---
id: ai-lang-specification
title: AiLang - A Contextual Interface Definition Language for AI Agents
summary: AiLang is a declarative format that unifies tool interfaces, type systems, capability controls, domain knowledge, and usage examples into a single, AI-readable document. It enables agents to understand not just what tools exist, but when to use them, how to handle failures, and what contextual knowledge is required for effective operation. Features hierarchical detail levels for efficient context management.
loading: manual
keywords: specification, interface-definition, type-system, capability-model, ai-tools, runtime, tooling, context-management, detail-levels
related: @import(./manifesto.md), @import(./send_tweet.md)
version: 0.3.0
---This document analyzes a Remote Code Execution (RCE) vulnerability in React's Flight protocol, which powers Next.js Server Actions. The exploit chains three vulnerabilities:
- Unsanitized path traversal in reference resolution (
__proto__,constructoraccess) - Fake chunk injection - crafted objects treated as internal Chunk objects
- Function constructor injection -
_formData.getreplaced withFunction
| // a generic node for example | |
| interface GNode { text: string; kind: string; next(): GNode | null; children(): GNode[]; } | |
| // Process one node during traversal | |
| type Process<T> = (n: GNode, t: Traversal) => Promise<T> | T | |
| // continue the traversal to process children/siblings | |
| interface Next { <T>(f: Process<T>): Promise<T> | T } | |
| // traversal context | |
| interface Traversal { | |
| // past nodes will be ready in Array | |
| ancestors: GNode[]; prevSiblings: GNode[] |
Q: tell me how Gemini family models can scale context to millions of token?
A:
The Gemini family of models achieves its impressive context window scaling through a combination of architectural innovations and advanced training techniques. Here's a breakdown of how they manage to handle millions of tokens:
1. Large Context Windows:
- Gemini 1.5 Pro: This model boasts a standard context window of 2 million tokens. This is significantly larger than most other large language models, allowing it to process vast amounts of information in a single request.
- Gemini 1.5 Flash: This model has a context window of 1 million tokens and is designed for high-volume, cost-effective applications.
| function findCombinations(numbers, targetSum) { | |
| const result = []; | |
| function find(currentSum, index, currentCombination) { | |
| if (currentSum === targetSum) { | |
| result.push([...currentCombination]); | |
| return; | |
| } | |
| if (currentSum > targetSum || index === numbers.length) return; | |
| // Include the number at the current index. |
This syntax extension is a mere fantasy of future React Script syntax. It is not a RFC, proposal or suggestion to React team or community. It is just a fun idea to imagine how React could be in the future.
Read this like a fan-fiction, for fun. :)
There are two recent new features in React community that are introducing new extensions to JavaScript, both syntax and semantics:
| #define エスティーディー std | |
| #define アイオーストリーム <iostream> | |
| #define ユージング using | |
| #define イフ if | |
| #define インクルード #include | |
| #define イント int | |
| #define シーアウト cout | |
| #define シーイン cin | |
| #define ネームスペース namespace | |
| #define ブール bool |
| const emailRef = ref('') | |
| const userBio = server(async () => { | |
| const findUser = await import('./server') | |
| const userRef = ref(null) | |
| watch(async () => { | |
| userRef.value = await findUser(emailRef.value) | |
| }) | |
| return (props) => ( | |
| h('div', [userRef.value.bio]), |
| import annotation.tailrec | |
| abstract class Tree(val left: Tree) { | |
| def o = new Ball(this) | |
| def x = new Spike(this) | |
| def * = new Candle(this) | |
| def oxo = new BigBall(this) | |
| def oo = new DoubleBall(this) | |
| def *** = new ElectricCandle(this) |
| # Character | |
| You're an ast-grep assistant. As a dedicated helper, you specialize in guiding users in and about the ast-grep tool. | |
| ast-grep has three kinds of usage: using pattern, using YAML rule and using API. Your task is to identify the most proper | |
| use case. | |
| * Pattern can match simple and straightforward expression/constructs in programming language. | |
| * YAML can match complicate expressions and take the surrounding AST around the expression. | |
| * API is the most flexible and powerful tool for users to implement their own matching logic. Custom matching should use API. | |
| # Actions |