/** * AgentScript tool description for AI agents * * Use this constant in your CodeCall tool description to help AI agents * understand how to write valid AgentScript code. */ /** * Short description (~500 chars) for space-constrained tool descriptions */ export declare const AGENTSCRIPT_DESCRIPTION_SHORT = "AgentScript: Safe JS subset for tool orchestration.\n\nAPI: `await callTool(name, args)` - returns tool result\n\nAllowed: for/for-of loops, arrow functions, array methods (map/filter/reduce), Math, JSON, if/else\n\nBlocked: while loops, function declarations, eval, require, fetch, setTimeout\n\nExample:\nconst users = await callTool('users:list', { active: true });\nreturn users.items.map(u => ({ id: u.id, name: u.name }));"; /** * Medium description (~1500 chars) for standard tool descriptions */ export declare const AGENTSCRIPT_DESCRIPTION_MEDIUM = "Execute AgentScript - a restricted JavaScript subset for safe AI agent orchestration.\n\n## callTool Function\n```javascript\nawait callTool(toolName: string, args: object): Promise\n```\n- `toolName`: Tool identifier (e.g., 'users:list', 'orders:create')\n- `args`: Object with tool arguments\n\n## Allowed Features\n- Loops: `for`, `for...of` (bounded iteration)\n- Arrow functions: `x => x.id`, `(a, b) => a + b`\n- Array methods: `map`, `filter`, `reduce`, `find`, `some`, `every`, `sort`\n- Math: `Math.max()`, `Math.min()`, `Math.round()`, `Math.floor()`\n- JSON: `JSON.parse()`, `JSON.stringify()`\n- Control flow: `if/else`, ternary `? :`\n- Syntax: destructuring, spread `...`, template literals\n\n## Blocked Features\n- Unbounded loops: `while`, `do...while`\n- Function declarations (no recursion)\n- System access: `process`, `require`, `eval`, `Function`\n- Network: `fetch`, `XMLHttpRequest`, `WebSocket`\n- Timers: `setTimeout`, `setInterval`\n- Globals: `window`, `globalThis`, `this`\n\n## Example\n```javascript\nconst accounts = await callTool('accounts:list', { type: 'premium' });\nconst results = [];\nfor (const acc of accounts.items) {\n const billing = await callTool('billing:get', { accountId: acc.id });\n results.push({ id: acc.id, amount: billing.amount });\n}\nreturn results;\n```\n\nLimits: Max 10,000 loop iterations, 30s execution timeout."; /** * Full description (~2500 chars) for detailed tool documentation */ export declare const AGENTSCRIPT_DESCRIPTION_FULL = "Execute AgentScript code to orchestrate multiple tool calls safely.\n\nAgentScript is a restricted JavaScript subset designed for AI agent orchestration. It allows chaining tool calls, transforming data, and implementing logic without sandbox escape risks.\n\n## callTool API\n```javascript\nawait callTool(toolName: string, args: object): Promise\n```\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `toolName` | string | Tool identifier (e.g., 'users:list') |\n| `args` | object | Tool arguments as key-value pairs |\n\n## Allowed Features\n| Feature | Example |\n|---------|---------|\n| `for`, `for...of` loops | `for (const x of items) { }` |\n| Arrow functions | `items.map(x => x.id)` |\n| Array methods | `map`, `filter`, `reduce`, `find`, `sort` |\n| Math methods | `Math.max()`, `Math.round()` |\n| JSON methods | `JSON.parse()`, `JSON.stringify()` |\n| Control flow | `if/else`, ternary `? :` |\n| Destructuring | `const { id, name } = user` |\n| Spread | `[...items, newItem]` |\n| Template literals | `\\`Hello ${name}\\`` |\n\n## Blocked Features\n| Feature | Reason |\n|---------|--------|\n| `while`, `do...while` | Unbounded loops |\n| `function` declarations | No recursion |\n| `eval`, `Function` | Code execution |\n| `process`, `require` | System access |\n| `fetch`, `XMLHttpRequest` | Network access |\n| `setTimeout` | Timing attacks |\n| `window`, `globalThis` | Global access |\n\n## Example: Data Aggregation\n```javascript\nconst users = await callTool('users:list', { role: 'admin', active: true });\n\nconst results = [];\nfor (const user of users.items) {\n const orders = await callTool('orders:list', { userId: user.id });\n const total = orders.items.reduce((sum, o) => sum + o.amount, 0);\n results.push({\n userId: user.id,\n name: user.name,\n orderCount: orders.items.length,\n totalAmount: Math.round(total * 100) / 100\n });\n}\n\nreturn results.sort((a, b) => b.totalAmount - a.totalAmount);\n```\n\n## Limits\n- Max 10,000 iterations per loop\n- 30 second execution timeout\n- No try/catch (errors propagate to runtime)"; /** * Default export - the medium description is recommended for most use cases */ export declare const AGENTSCRIPT_DESCRIPTION = "Execute AgentScript - a restricted JavaScript subset for safe AI agent orchestration.\n\n## callTool Function\n```javascript\nawait callTool(toolName: string, args: object): Promise\n```\n- `toolName`: Tool identifier (e.g., 'users:list', 'orders:create')\n- `args`: Object with tool arguments\n\n## Allowed Features\n- Loops: `for`, `for...of` (bounded iteration)\n- Arrow functions: `x => x.id`, `(a, b) => a + b`\n- Array methods: `map`, `filter`, `reduce`, `find`, `some`, `every`, `sort`\n- Math: `Math.max()`, `Math.min()`, `Math.round()`, `Math.floor()`\n- JSON: `JSON.parse()`, `JSON.stringify()`\n- Control flow: `if/else`, ternary `? :`\n- Syntax: destructuring, spread `...`, template literals\n\n## Blocked Features\n- Unbounded loops: `while`, `do...while`\n- Function declarations (no recursion)\n- System access: `process`, `require`, `eval`, `Function`\n- Network: `fetch`, `XMLHttpRequest`, `WebSocket`\n- Timers: `setTimeout`, `setInterval`\n- Globals: `window`, `globalThis`, `this`\n\n## Example\n```javascript\nconst accounts = await callTool('accounts:list', { type: 'premium' });\nconst results = [];\nfor (const acc of accounts.items) {\n const billing = await callTool('billing:get', { accountId: acc.id });\n results.push({ id: acc.id, amount: billing.amount });\n}\nreturn results;\n```\n\nLimits: Max 10,000 loop iterations, 30s execution timeout.";