@aigne/agent-runtime 1.12.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +26 -0
- package/README.md +79 -0
- package/dist/agent-runners/ai-runner.cjs +133 -0
- package/dist/agent-runners/ai-runner.d.cts +33 -0
- package/dist/agent-runners/ai-runner.d.cts.map +1 -0
- package/dist/agent-runners/ai-runner.d.mts +33 -0
- package/dist/agent-runners/ai-runner.d.mts.map +1 -0
- package/dist/agent-runners/ai-runner.mjs +134 -0
- package/dist/agent-runners/ai-runner.mjs.map +1 -0
- package/dist/agent-runners/ash-runner.cjs +272 -0
- package/dist/agent-runners/ash-runner.d.cts +30 -0
- package/dist/agent-runners/ash-runner.d.cts.map +1 -0
- package/dist/agent-runners/ash-runner.d.mts +30 -0
- package/dist/agent-runners/ash-runner.d.mts.map +1 -0
- package/dist/agent-runners/ash-runner.mjs +273 -0
- package/dist/agent-runners/ash-runner.mjs.map +1 -0
- package/dist/agent-runners/budget.cjs +71 -0
- package/dist/agent-runners/budget.d.cts +40 -0
- package/dist/agent-runners/budget.d.cts.map +1 -0
- package/dist/agent-runners/budget.d.mts +40 -0
- package/dist/agent-runners/budget.d.mts.map +1 -0
- package/dist/agent-runners/budget.mjs +67 -0
- package/dist/agent-runners/budget.mjs.map +1 -0
- package/dist/agent-runners/code-runner.cjs +61 -0
- package/dist/agent-runners/code-runner.mjs +61 -0
- package/dist/agent-runners/code-runner.mjs.map +1 -0
- package/dist/agent-runners/env-whitelist.cjs +36 -0
- package/dist/agent-runners/env-whitelist.d.cts +5 -0
- package/dist/agent-runners/env-whitelist.d.cts.map +1 -0
- package/dist/agent-runners/env-whitelist.d.mts +5 -0
- package/dist/agent-runners/env-whitelist.d.mts.map +1 -0
- package/dist/agent-runners/env-whitelist.mjs +36 -0
- package/dist/agent-runners/env-whitelist.mjs.map +1 -0
- package/dist/agent-runners/guide-rails.cjs +47 -0
- package/dist/agent-runners/guide-rails.d.cts +16 -0
- package/dist/agent-runners/guide-rails.d.cts.map +1 -0
- package/dist/agent-runners/guide-rails.d.mts +16 -0
- package/dist/agent-runners/guide-rails.d.mts.map +1 -0
- package/dist/agent-runners/guide-rails.mjs +48 -0
- package/dist/agent-runners/guide-rails.mjs.map +1 -0
- package/dist/agent-runners/hook-channel.cjs +55 -0
- package/dist/agent-runners/hook-channel.d.cts +38 -0
- package/dist/agent-runners/hook-channel.d.cts.map +1 -0
- package/dist/agent-runners/hook-channel.d.mts +38 -0
- package/dist/agent-runners/hook-channel.d.mts.map +1 -0
- package/dist/agent-runners/hook-channel.mjs +55 -0
- package/dist/agent-runners/hook-channel.mjs.map +1 -0
- package/dist/agent-runners/hooks.cjs +107 -0
- package/dist/agent-runners/hooks.d.cts +41 -0
- package/dist/agent-runners/hooks.d.cts.map +1 -0
- package/dist/agent-runners/hooks.d.mts +41 -0
- package/dist/agent-runners/hooks.d.mts.map +1 -0
- package/dist/agent-runners/hooks.mjs +107 -0
- package/dist/agent-runners/hooks.mjs.map +1 -0
- package/dist/agent-runners/memory-afs.cjs +342 -0
- package/dist/agent-runners/memory-afs.d.cts +221 -0
- package/dist/agent-runners/memory-afs.d.cts.map +1 -0
- package/dist/agent-runners/memory-afs.d.mts +221 -0
- package/dist/agent-runners/memory-afs.d.mts.map +1 -0
- package/dist/agent-runners/memory-afs.mjs +326 -0
- package/dist/agent-runners/memory-afs.mjs.map +1 -0
- package/dist/agent-runners/memory-archive.cjs +263 -0
- package/dist/agent-runners/memory-archive.d.cts +47 -0
- package/dist/agent-runners/memory-archive.d.cts.map +1 -0
- package/dist/agent-runners/memory-archive.d.mts +47 -0
- package/dist/agent-runners/memory-archive.d.mts.map +1 -0
- package/dist/agent-runners/memory-archive.mjs +257 -0
- package/dist/agent-runners/memory-archive.mjs.map +1 -0
- package/dist/agent-runners/orchestrator-runner.cjs +302 -0
- package/dist/agent-runners/orchestrator-runner.d.cts +23 -0
- package/dist/agent-runners/orchestrator-runner.d.cts.map +1 -0
- package/dist/agent-runners/orchestrator-runner.d.mts +23 -0
- package/dist/agent-runners/orchestrator-runner.d.mts.map +1 -0
- package/dist/agent-runners/orchestrator-runner.mjs +303 -0
- package/dist/agent-runners/orchestrator-runner.mjs.map +1 -0
- package/dist/agent-runners/orchestrator-state.cjs +68 -0
- package/dist/agent-runners/orchestrator-state.d.cts +23 -0
- package/dist/agent-runners/orchestrator-state.d.cts.map +1 -0
- package/dist/agent-runners/orchestrator-state.d.mts +23 -0
- package/dist/agent-runners/orchestrator-state.d.mts.map +1 -0
- package/dist/agent-runners/orchestrator-state.mjs +65 -0
- package/dist/agent-runners/orchestrator-state.mjs.map +1 -0
- package/dist/agent-runners/retry.cjs +30 -0
- package/dist/agent-runners/retry.d.cts +13 -0
- package/dist/agent-runners/retry.d.cts.map +1 -0
- package/dist/agent-runners/retry.d.mts +13 -0
- package/dist/agent-runners/retry.d.mts.map +1 -0
- package/dist/agent-runners/retry.mjs +30 -0
- package/dist/agent-runners/retry.mjs.map +1 -0
- package/dist/agent-runners/scratchpad-afs.cjs +276 -0
- package/dist/agent-runners/scratchpad-afs.d.cts +103 -0
- package/dist/agent-runners/scratchpad-afs.d.cts.map +1 -0
- package/dist/agent-runners/scratchpad-afs.d.mts +103 -0
- package/dist/agent-runners/scratchpad-afs.d.mts.map +1 -0
- package/dist/agent-runners/scratchpad-afs.mjs +271 -0
- package/dist/agent-runners/scratchpad-afs.mjs.map +1 -0
- package/dist/agent-runners/stream-router.cjs +72 -0
- package/dist/agent-runners/stream-router.d.cts +22 -0
- package/dist/agent-runners/stream-router.d.cts.map +1 -0
- package/dist/agent-runners/stream-router.d.mts +22 -0
- package/dist/agent-runners/stream-router.d.mts.map +1 -0
- package/dist/agent-runners/stream-router.mjs +72 -0
- package/dist/agent-runners/stream-router.mjs.map +1 -0
- package/dist/agent-runners/system-prompt.cjs +35 -0
- package/dist/agent-runners/system-prompt.d.cts +17 -0
- package/dist/agent-runners/system-prompt.d.cts.map +1 -0
- package/dist/agent-runners/system-prompt.d.mts +17 -0
- package/dist/agent-runners/system-prompt.d.mts.map +1 -0
- package/dist/agent-runners/system-prompt.mjs +34 -0
- package/dist/agent-runners/system-prompt.mjs.map +1 -0
- package/dist/agent-runners/team-modes/aggregates.cjs +36 -0
- package/dist/agent-runners/team-modes/aggregates.mjs +35 -0
- package/dist/agent-runners/team-modes/aggregates.mjs.map +1 -0
- package/dist/agent-runners/team-modes/iterate.cjs +46 -0
- package/dist/agent-runners/team-modes/iterate.mjs +47 -0
- package/dist/agent-runners/team-modes/iterate.mjs.map +1 -0
- package/dist/agent-runners/team-modes/parallel.cjs +59 -0
- package/dist/agent-runners/team-modes/parallel.mjs +60 -0
- package/dist/agent-runners/team-modes/parallel.mjs.map +1 -0
- package/dist/agent-runners/team-modes/reflection.cjs +155 -0
- package/dist/agent-runners/team-modes/reflection.mjs +156 -0
- package/dist/agent-runners/team-modes/reflection.mjs.map +1 -0
- package/dist/agent-runners/team-modes/sequential.cjs +63 -0
- package/dist/agent-runners/team-modes/sequential.mjs +64 -0
- package/dist/agent-runners/team-modes/sequential.mjs.map +1 -0
- package/dist/agent-runners/team-modes/utils.cjs +39 -0
- package/dist/agent-runners/team-modes/utils.mjs +36 -0
- package/dist/agent-runners/team-modes/utils.mjs.map +1 -0
- package/dist/agent-runners/team-runner.cjs +277 -0
- package/dist/agent-runners/team-runner.d.cts +34 -0
- package/dist/agent-runners/team-runner.d.cts.map +1 -0
- package/dist/agent-runners/team-runner.d.mts +34 -0
- package/dist/agent-runners/team-runner.d.mts.map +1 -0
- package/dist/agent-runners/team-runner.mjs +278 -0
- package/dist/agent-runners/team-runner.mjs.map +1 -0
- package/dist/agent-runners/template-context.cjs +32 -0
- package/dist/agent-runners/template-context.d.cts +43 -0
- package/dist/agent-runners/template-context.d.cts.map +1 -0
- package/dist/agent-runners/template-context.d.mts +43 -0
- package/dist/agent-runners/template-context.d.mts.map +1 -0
- package/dist/agent-runners/template-context.mjs +33 -0
- package/dist/agent-runners/template-context.mjs.map +1 -0
- package/dist/index.cjs +123 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +29 -0
- package/dist/program/agent-action.cjs +496 -0
- package/dist/program/agent-action.d.cts +42 -0
- package/dist/program/agent-action.d.cts.map +1 -0
- package/dist/program/agent-action.d.mts +42 -0
- package/dist/program/agent-action.d.mts.map +1 -0
- package/dist/program/agent-action.mjs +497 -0
- package/dist/program/agent-action.mjs.map +1 -0
- package/dist/program/agent-messages-tools.cjs +137 -0
- package/dist/program/agent-messages-tools.d.cts +59 -0
- package/dist/program/agent-messages-tools.d.cts.map +1 -0
- package/dist/program/agent-messages-tools.d.mts +59 -0
- package/dist/program/agent-messages-tools.d.mts.map +1 -0
- package/dist/program/agent-messages-tools.mjs +130 -0
- package/dist/program/agent-messages-tools.mjs.map +1 -0
- package/dist/program/agent-runner-registry.cjs +314 -0
- package/dist/program/agent-runner-registry.d.cts +52 -0
- package/dist/program/agent-runner-registry.d.cts.map +1 -0
- package/dist/program/agent-runner-registry.d.mts +52 -0
- package/dist/program/agent-runner-registry.d.mts.map +1 -0
- package/dist/program/agent-runner-registry.mjs +313 -0
- package/dist/program/agent-runner-registry.mjs.map +1 -0
- package/dist/program/agent-subscribe.cjs +72 -0
- package/dist/program/agent-subscribe.d.cts +18 -0
- package/dist/program/agent-subscribe.d.cts.map +1 -0
- package/dist/program/agent-subscribe.d.mts +18 -0
- package/dist/program/agent-subscribe.d.mts.map +1 -0
- package/dist/program/agent-subscribe.mjs +73 -0
- package/dist/program/agent-subscribe.mjs.map +1 -0
- package/dist/program/agent-tools.cjs +135 -0
- package/dist/program/agent-tools.d.cts +35 -0
- package/dist/program/agent-tools.d.cts.map +1 -0
- package/dist/program/agent-tools.d.mts +35 -0
- package/dist/program/agent-tools.d.mts.map +1 -0
- package/dist/program/agent-tools.mjs +136 -0
- package/dist/program/agent-tools.mjs.map +1 -0
- package/dist/program/manifest-nesting.cjs +57 -0
- package/dist/program/manifest-nesting.d.cts +13 -0
- package/dist/program/manifest-nesting.d.cts.map +1 -0
- package/dist/program/manifest-nesting.d.mts +13 -0
- package/dist/program/manifest-nesting.d.mts.map +1 -0
- package/dist/program/manifest-nesting.mjs +57 -0
- package/dist/program/manifest-nesting.mjs.map +1 -0
- package/dist/program/result-contract.cjs +55 -0
- package/dist/program/result-contract.d.cts +23 -0
- package/dist/program/result-contract.d.cts.map +1 -0
- package/dist/program/result-contract.d.mts +23 -0
- package/dist/program/result-contract.d.mts.map +1 -0
- package/dist/program/result-contract.mjs +51 -0
- package/dist/program/result-contract.mjs.map +1 -0
- package/dist/program/runner-error.cjs +71 -0
- package/dist/program/runner-error.d.cts +25 -0
- package/dist/program/runner-error.d.cts.map +1 -0
- package/dist/program/runner-error.d.mts +25 -0
- package/dist/program/runner-error.d.mts.map +1 -0
- package/dist/program/runner-error.mjs +72 -0
- package/dist/program/runner-error.mjs.map +1 -0
- package/dist/program/scoped-afs.cjs +538 -0
- package/dist/program/scoped-afs.d.cts +245 -0
- package/dist/program/scoped-afs.d.cts.map +1 -0
- package/dist/program/scoped-afs.d.mts +245 -0
- package/dist/program/scoped-afs.d.mts.map +1 -0
- package/dist/program/scoped-afs.mjs +531 -0
- package/dist/program/scoped-afs.mjs.map +1 -0
- package/dist/program/session-hierarchy.cjs +1 -0
- package/dist/program/session-hierarchy.d.cts +2 -0
- package/dist/program/session-hierarchy.d.mts +2 -0
- package/dist/program/session-hierarchy.mjs +3 -0
- package/dist/program/tool-discovery/ash-frontmatter.cjs +83 -0
- package/dist/program/tool-discovery/ash-frontmatter.d.cts +21 -0
- package/dist/program/tool-discovery/ash-frontmatter.d.cts.map +1 -0
- package/dist/program/tool-discovery/ash-frontmatter.d.mts +21 -0
- package/dist/program/tool-discovery/ash-frontmatter.d.mts.map +1 -0
- package/dist/program/tool-discovery/ash-frontmatter.mjs +84 -0
- package/dist/program/tool-discovery/ash-frontmatter.mjs.map +1 -0
- package/dist/program/tool-discovery/dot-path-resolver.cjs +60 -0
- package/dist/program/tool-discovery/dot-path-resolver.mjs +61 -0
- package/dist/program/tool-discovery/dot-path-resolver.mjs.map +1 -0
- package/dist/program/tool-discovery/skill-gate.cjs +36 -0
- package/dist/program/tool-discovery/skill-gate.d.cts +10 -0
- package/dist/program/tool-discovery/skill-gate.d.cts.map +1 -0
- package/dist/program/tool-discovery/skill-gate.d.mts +10 -0
- package/dist/program/tool-discovery/skill-gate.d.mts.map +1 -0
- package/dist/program/tool-discovery/skill-gate.mjs +35 -0
- package/dist/program/tool-discovery/skill-gate.mjs.map +1 -0
- package/dist/providers/basic/ash/dist/index.cjs +1809 -0
- package/dist/providers/basic/ash/dist/index.mjs +1807 -0
- package/dist/providers/basic/ash/dist/index.mjs.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../providers/basic/ash/dist/index.mjs"],"sourcesContent":["import { AFSNotFoundError, SCRIPT_EVENT_TYPES, getPlatform, makeNsLog } from \"@aigne/afs\";\nimport { AFSBaseProvider, Actions, Delete, Exec, Explain, List, Meta, Read, Search, Stat, Write } from \"@aigne/afs/provider\";\nimport { ASH_REFERENCE, compileSource } from \"@aigne/ash\";\nimport { Cron, CronPattern } from \"croner\";\nimport { joinURL } from \"ufo\";\nimport { z } from \"zod\";\n\n//#region \\0@oxc-project+runtime@0.108.0/helpers/decorate.js\nfunction __decorate(decorators, target, key, desc) {\n\tvar c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\tif (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\telse for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n\treturn c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\n//#endregion\n//#region src/path-validator.ts\n/**\n* Read-class pairing: a grant of `list` on a data root implies `query` (the\n* collection-query standard action) — both are readPaths-class observation\n* privileges, and the agent default tooling rule says standard observation\n* comes with the data root, not per-tool opt-in. Idempotent.\n*/\nfunction withQueryPairing(ops) {\n\tif (ops.includes(\"list\") && !ops.includes(\"query\")) return [...ops, \"query\"];\n\treturn ops;\n}\n/**\n* Match an actual path against a declaration pattern.\n*\n* Supports:\n* - Exact: \"/a/b\" matches \"/a/b\"\n* - Single-level `*`: \"/a/*\" matches \"/a/b\" but NOT \"/a/b/c\"\n* - Multi-level `**`: \"/a/**\" matches \"/a/b/c\" up to `maxDepth` levels from `**` position\n*\n* @param maxDepth Maximum levels `**` can consume. Defaults to 0 (no expansion).\n*/\nfunction matchPath(actual, pattern, maxDepth = 0) {\n\tif (actual === pattern) return true;\n\tconst patternParts = pattern.split(\"/\");\n\tconst actualParts = actual.split(\"/\");\n\tconst dstarIdx = patternParts.indexOf(\"**\");\n\tif (dstarIdx === -1) return matchSingleLevel(actualParts, patternParts);\n\tconst prefix = patternParts.slice(0, dstarIdx);\n\tconst suffix = patternParts.slice(dstarIdx + 1);\n\tif (actualParts.length < prefix.length + suffix.length) return false;\n\tfor (let i = 0; i < prefix.length; i++) {\n\t\tif (prefix[i] === \"*\") continue;\n\t\tif (prefix[i] !== actualParts[i]) return false;\n\t}\n\tconst suffixStart = actualParts.length - suffix.length;\n\tif (suffixStart < prefix.length) return false;\n\tfor (let i = 0; i < suffix.length; i++) {\n\t\tif (suffix[i] === \"*\") continue;\n\t\tif (suffix[i] !== actualParts[suffixStart + i]) return false;\n\t}\n\tconst dstarLevels = actualParts.length - prefix.length - suffix.length;\n\treturn dstarLevels >= 0 && dstarLevels <= maxDepth;\n}\n/** Single-level * matching (no **). */\nfunction matchSingleLevel(actualParts, patternParts) {\n\tif (!patternParts.some((p) => p === \"*\")) return false;\n\tif (actualParts.length === patternParts.length) {\n\t\tfor (let i = 0; i < patternParts.length; i++) {\n\t\t\tif (patternParts[i] === \"*\") continue;\n\t\t\tif (patternParts[i] !== actualParts[i]) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tif (actualParts.length < patternParts.length) {\n\t\tfor (let i = actualParts.length; i < patternParts.length; i++) if (patternParts[i] !== \"*\") return false;\n\t\tfor (let i = 0; i < actualParts.length; i++) if (patternParts[i] !== \"*\" && patternParts[i] !== actualParts[i]) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\n/**\n* Extract the action name from an exec path.\n* E.g., \"/modules/github/issues/42/.actions/close-issue\" → \"close-issue\"\n*/\nfunction extractActionName(path) {\n\tconst idx = path.lastIndexOf(\"/.actions/\");\n\tif (idx === -1) return void 0;\n\treturn path.slice(idx + 10).split(\"/\")[0];\n}\n/**\n* Validate a tool_call's path and operation against the tools declaration.\n*/\nfunction validateToolCall(path, op, tools) {\n\tif (hasUnsafePathSyntax(path)) return {\n\t\tallowed: false,\n\t\treason: `Unsafe path syntax in '${path}'`\n\t};\n\tlet basePath;\n\tif (op === \"exec\") {\n\t\tconst idx = path.indexOf(\"/.actions/\");\n\t\tif (idx !== -1) basePath = path.slice(0, idx);\n\t}\n\tlet pathMatched = false;\n\tfor (const entry of tools) {\n\t\tconst md = entry.maxDepth ?? 0;\n\t\tif (!matchPath(path, entry.path, md) && !(basePath && matchPath(basePath, entry.path, md))) continue;\n\t\tpathMatched = true;\n\t\tif (!entry.ops.includes(op)) continue;\n\t\tif (op === \"exec\" && entry.exclude_actions?.length) {\n\t\t\tconst actionName = extractActionName(path);\n\t\t\tif (actionName && entry.exclude_actions.includes(actionName)) return {\n\t\t\t\tallowed: false,\n\t\t\t\treason: `Action '${actionName}' is excluded on '${entry.path}'`\n\t\t\t};\n\t\t}\n\t\treturn { allowed: true };\n\t}\n\tif (pathMatched) return {\n\t\tallowed: false,\n\t\treason: `Operation '${op}' not allowed on '${path}'`\n\t};\n\treturn {\n\t\tallowed: false,\n\t\treason: `Path '${path}' not in tools declaration`\n\t};\n}\nfunction hasUnsafePathSyntax(path) {\n\tif (path.includes(\"..\") || path.includes(\"{\") || path.includes(\"\\\\\") || path.includes(\"\\0\")) return true;\n\ttry {\n\t\tconst decoded = decodeURIComponent(path);\n\t\treturn decoded !== path && hasUnsafePathSyntax(decoded);\n\t} catch {\n\t\treturn true;\n\t}\n}\nfunction isChildPath(childPath, parentPath, parentMaxDepth) {\n\tif (childPath === parentPath) return true;\n\tconst childHasGlob = childPath.includes(\"**\") || childPath.includes(\"*\");\n\tconst parentHasGlob = parentPath.includes(\"**\") || parentPath.includes(\"*\");\n\tif (!parentHasGlob && !childHasGlob) return childPath === parentPath;\n\tif (parentHasGlob && !childHasGlob) return matchPath(childPath, parentPath, parentMaxDepth);\n\tif (parentHasGlob && childHasGlob) {\n\t\tconst parentBase = parentPath.replace(/\\/\\*\\*$/, \"\").replace(/\\/\\*$/, \"\");\n\t\tconst childBase = childPath.replace(/\\/\\*\\*$/, \"\").replace(/\\/\\*$/, \"\");\n\t\treturn childBase === parentBase || childBase.startsWith(`${parentBase}/`);\n\t}\n\treturn false;\n}\n/**\n* Intersect two ToolEntry[] arrays. Returns the effective tool list for a\n* child agent: only entries that both parent and child declare, with ops\n* narrowed to the intersection and maxDepth capped by the parent.\n*\n* Violations are silently absent (no errors). This is a pure function.\n*/\nfunction intersectTools(parent, child) {\n\tif (parent.length === 0 || child.length === 0) return [];\n\tconst result = [];\n\tfor (const c of child) {\n\t\tif (hasUnsafePathSyntax(c.path)) continue;\n\t\tlet bestParent = null;\n\t\tfor (const p of parent) {\n\t\t\tif (hasUnsafePathSyntax(p.path)) continue;\n\t\t\tif (!isChildPath(c.path, p.path, p.maxDepth ?? 0)) continue;\n\t\t\tbestParent = p;\n\t\t\tbreak;\n\t\t}\n\t\tif (!bestParent) continue;\n\t\tconst ops = c.ops.filter((op) => bestParent.ops.includes(op));\n\t\tif (ops.length === 0) continue;\n\t\tconst entry = {\n\t\t\tpath: c.path,\n\t\t\tops\n\t\t};\n\t\tif (c.path.includes(\"**\")) {\n\t\t\tconst parentDepth = bestParent.maxDepth ?? 0;\n\t\t\tconst childDepth = c.maxDepth ?? 0;\n\t\t\tentry.maxDepth = Math.min(parentDepth, childDepth);\n\t\t} else if (c.maxDepth != null) entry.maxDepth = bestParent.maxDepth != null ? Math.min(bestParent.maxDepth, c.maxDepth) : c.maxDepth;\n\t\tconst excludes = /* @__PURE__ */ new Set();\n\t\tif (bestParent.exclude_actions) for (const a of bestParent.exclude_actions) excludes.add(a);\n\t\tif (c.exclude_actions) for (const a of c.exclude_actions) excludes.add(a);\n\t\tif (excludes.size > 0) entry.exclude_actions = [...excludes];\n\t\tresult.push(entry);\n\t}\n\treturn result;\n}\n/**\n* Validate an ash action path against the manifest's tools whitelist.\n* Used by the ash runner to enforce that compiled ash scripts only call\n* paths permitted by the agent manifest.\n*\n* Returns { allowed: true } or { allowed: false, code, path, reason }.\n*/\nfunction validateActionPath(actionPath, tools) {\n\tif (hasUnsafePathSyntax(actionPath)) return {\n\t\tallowed: false,\n\t\tcode: \"PATH_TRAVERSAL\",\n\t\tpath: actionPath,\n\t\treason: `Unsafe path syntax detected in '${actionPath}'`\n\t};\n\tif (tools.length === 0) return {\n\t\tallowed: false,\n\t\tcode: \"TOOL_WHITELIST_VIOLATION\",\n\t\tpath: actionPath,\n\t\treason: `No tools declared — action '${actionPath}' is not permitted`\n\t};\n\tconst result = validateToolCall(actionPath, \"exec\", tools);\n\tif (!result.allowed) return {\n\t\tallowed: false,\n\t\tcode: \"TOOL_WHITELIST_VIOLATION\",\n\t\tpath: actionPath,\n\t\treason: result.reason\n\t};\n\treturn { allowed: true };\n}\n\n//#endregion\n//#region src/index.ts\nconst log = makeNsLog(\"provider:ash\");\n/** Lazily resolved docs directory path */\nlet _docsDir;\nfunction getDocsDir() {\n\tif (!_docsDir) {\n\t\tconst platform = getPlatform();\n\t\tconst moduleDir = platform.path.dirname(new URL(import.meta.url).pathname);\n\t\t_docsDir = platform.path.join(moduleDir, \"..\", \"docs\");\n\t}\n\treturn _docsDir;\n}\nasync function readDoc(relativePath) {\n\tconst platform = getPlatform();\n\treturn platform.fs.readTextFile(platform.path.join(getDocsDir(), relativePath));\n}\n/**\n* Dedup deprecation warning for the legacy `/ash/.actions/agent-run`\n* alias — log once per process, not on every call.\n*/\nlet ashAgentRunDeprecationLogged = false;\n/**\n* Derive tool declarations for agent-run from a BlockletManifest.\n*\n* Generates tools for:\n* - `/packages/**` — readonly (read, list, search, stat)\n* - `/instance/**` — readwrite (read, list, write, delete, search, stat)\n* - `/{target}/**` — per mount ops from manifest\n*\n* Path rename (post 83210d71): runtime AFS now mounts blocklet source at\n* `/packages` and instance data at `/instance` (was `/blocklet` and `/data`).\n*/\nfunction deriveToolsFromProgram(manifest) {\n\tconst tools = [{\n\t\tpath: \"/packages/**\",\n\t\tops: [\n\t\t\t\"read\",\n\t\t\t\"list\",\n\t\t\t\"search\",\n\t\t\t\"stat\"\n\t\t],\n\t\tmaxDepth: 10\n\t}, {\n\t\tpath: \"/instance/**\",\n\t\tops: [\n\t\t\t\"read\",\n\t\t\t\"list\",\n\t\t\t\"write\",\n\t\t\t\"delete\",\n\t\t\t\"search\",\n\t\t\t\"stat\"\n\t\t],\n\t\tmaxDepth: 10\n\t}];\n\tfor (const mount of manifest.mounts) {\n\t\tconst ops = mount.ops ?? [\"read\", \"list\"];\n\t\tif (ops.length === 0) continue;\n\t\ttools.push({\n\t\t\tpath: `${mount.target}/**`,\n\t\t\tops: [...ops],\n\t\t\tmaxDepth: 5\n\t\t});\n\t}\n\treturn tools;\n}\nfunction sanitizeErrorPath(msg) {\n\treturn msg.replace(/'\\/[^']*'/g, \"'[path]'\").replace(/\"\\/[^\"]*\"/g, \"\\\"[path]\\\"\");\n}\nfunction normalizeAbsoluteAfsPath(path) {\n\tif (!path.startsWith(\"/\")) return path;\n\tconst segments = [];\n\tfor (const segment of path.split(\"/\")) {\n\t\tif (!segment || segment === \".\") continue;\n\t\tif (segment === \"..\") segments.pop();\n\t\telse segments.push(segment);\n\t}\n\treturn `/${segments.join(\"/\")}`;\n}\nasync function writeFileAtomic(path, data) {\n\tconst platform = getPlatform();\n\tconst fs = platform.fs;\n\tif (!fs.rename) {\n\t\tawait fs.writeFile(path, data);\n\t\treturn;\n\t}\n\tconst dir = platform.path.dirname(path);\n\tconst base = platform.path.basename(path);\n\tconst suffix = platform.crypto?.randomUUID() ?? `${Date.now()}-${Math.random()}`;\n\tconst tmpPath = platform.path.join(dir, `.${base}.${suffix}.tmp`);\n\tawait fs.writeFile(tmpPath, data);\n\ttry {\n\t\tawait fs.rename(tmpPath, path);\n\t} catch (error) {\n\t\tawait fs.rm(tmpPath).catch(() => {});\n\t\tthrow error;\n\t}\n}\n/**\n* Normalize an entry's content into a flat record for ASH pipeline access.\n*\n* Object content is spread so scripts can reference fields directly\n* (`${state}`, `${attributes.temperature}`, etc.). String / null / array\n* content is returned as-is under `content` — providers that need structured\n* field access are responsible for returning objects from their read path\n* (e.g. JSON, markdown, registry providers all do this).\n*/\nfunction normalizeContent(content) {\n\tif (content == null) return {};\n\tif (typeof content === \"object\" && !Array.isArray(content)) return {\n\t\tcontent,\n\t\t...content\n\t};\n\treturn { content };\n}\nfunction normalizeAfsEntry(entry, fallbackPath) {\n\tconst path = entry.path ?? fallbackPath;\n\treturn {\n\t\tpath,\n\t\tname: path.split(\"/\").filter(Boolean).pop(),\n\t\t...entry.meta,\n\t\t...normalizeContent(entry.content)\n\t};\n}\nfunction querySearchNeedle(query) {\n\tif (!query || query.op !== \"contains\") return void 0;\n\tif (query.field !== \"content\" && query.field !== \"_content\" && query.field !== \"summary\") return void 0;\n\tif (Array.isArray(query.value)) return void 0;\n\tconst needle = String(query.value);\n\treturn needle === \"\" ? void 0 : needle;\n}\nasync function readAfsRecords(afs, localWorld, path, query) {\n\tconst local = await localWorld.read(path, query);\n\tif (local.length > 0) return local;\n\tconst searchNeedle = querySearchNeedle(query);\n\tif (searchNeedle && afs.search) try {\n\t\tconst searchResult = await afs.search(path, searchNeedle, { limit: 1e3 });\n\t\tif (searchResult.data.length > 0) return searchResult.data.map((entry) => normalizeAfsEntry(entry, path));\n\t} catch {}\n\tif (afs.list) try {\n\t\tconst listResult = await afs.list(path, query ? { query } : {});\n\t\tif (listResult.data.length > 0) {\n\t\t\tconst needsEnrich = listResult.data.some((entry) => entry.content == null);\n\t\t\tlet entries = listResult.data;\n\t\t\tif (needsEnrich && afs.read) {\n\t\t\t\tconst afsRead = afs.read.bind(afs);\n\t\t\t\tentries = await Promise.all(listResult.data.map(async (entry) => {\n\t\t\t\t\tif (entry.content != null) return entry;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await afsRead(entry.path, {});\n\t\t\t\t\t\treturn result.data ? {\n\t\t\t\t\t\t\t...entry,\n\t\t\t\t\t\t\tcontent: result.data.content\n\t\t\t\t\t\t} : entry;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn entry;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn entries.map((entry) => normalizeAfsEntry(entry, path));\n\t\t}\n\t} catch {}\n\tif (afs.read) try {\n\t\tconst readResult = await afs.read(path, {});\n\t\tif (readResult.data) return [normalizeAfsEntry(readResult.data, path)];\n\t} catch {}\n\treturn [];\n}\n/**\n* AFS ASH Provider\n*\n* Bridges ASH pipeline DSL to AFS. ASH scripts are stored in-memory and\n* executed against AFS via a world bridge that translates ASH's\n* read/write/publish to AFS read/write operations.\n*\n* Structure:\n* - `/` - root directory\n* - `/scripts` - stored .ash scripts\n* - `/scripts/{name}.ash` - individual script files (executable)\n* - `/.actions/run` - execute inline ASH code\n* - `/.actions/validate` - validate ASH source (compile + type-check)\n*/\nvar AFSAsh = class AFSAsh extends AFSBaseProvider {\n\tstatic manifest() {\n\t\treturn {\n\t\t\tname: \"ash\",\n\t\t\tdescription: \"ASH pipeline DSL for deterministic data pipelines.\\n- Store, validate, and execute ASH scripts\\n- Commands: find, where, map, save, publish, tee, fanout, output, input, count, group-by, action, route, lookup\\n- Read /.meta/.ash-reference for full syntax\",\n\t\t\turiTemplate: \"ash://\",\n\t\t\tcategory: \"compute\",\n\t\t\tagentMdPath: new URL(\"../docs/agent.md\", import.meta.url).pathname,\n\t\t\tschema: z.object({\n\t\t\t\tname: z.string().optional(),\n\t\t\t\tdescription: z.string().optional(),\n\t\t\t\tallowRootActions: z.array(z.enum([\n\t\t\t\t\t\"agent-run\",\n\t\t\t\t\t\"run\",\n\t\t\t\t\t\"mount\",\n\t\t\t\t\t\"unmount\",\n\t\t\t\t\t\"read\",\n\t\t\t\t\t\"list\",\n\t\t\t\t\t\"write\",\n\t\t\t\t\t\"delete\"\n\t\t\t\t])).optional()\n\t\t\t}),\n\t\t\ttags: [\n\t\t\t\t\"ash\",\n\t\t\t\t\"pipeline\",\n\t\t\t\t\"etl\",\n\t\t\t\t\"dsl\"\n\t\t\t],\n\t\t\tcapabilityTags: [\n\t\t\t\t\"read-write\",\n\t\t\t\t\"search\",\n\t\t\t\t\"auth:none\",\n\t\t\t\t\"local\"\n\t\t\t],\n\t\t\tsecurity: {\n\t\t\t\triskLevel: \"system\",\n\t\t\t\tresourceAccess: [\"process-spawn\"],\n\t\t\t\tdataSensitivity: [\"code\"],\n\t\t\t\tnotes: [\"Executes ASH pipeline scripts that can read/write data across mounted providers\"]\n\t\t\t},\n\t\t\tcapabilities: { crossProvider: { afsAccess: true } }\n\t\t};\n\t}\n\tstatic treeSchema() {\n\t\treturn {\n\t\t\toperations: [\n\t\t\t\t\"list\",\n\t\t\t\t\"read\",\n\t\t\t\t\"write\",\n\t\t\t\t\"delete\",\n\t\t\t\t\"exec\",\n\t\t\t\t\"search\",\n\t\t\t\t\"stat\",\n\t\t\t\t\"explain\"\n\t\t\t],\n\t\t\ttree: {\n\t\t\t\t\"/\": {\n\t\t\t\t\tkind: \"ash:root\",\n\t\t\t\t\toperations: [\n\t\t\t\t\t\t\"list\",\n\t\t\t\t\t\t\"read\",\n\t\t\t\t\t\t\"exec\"\n\t\t\t\t\t],\n\t\t\t\t\tactions: [\"run\", \"validate\"]\n\t\t\t\t},\n\t\t\t\t\"/scripts\": {\n\t\t\t\t\tkind: \"ash:directory\",\n\t\t\t\t\toperations: [\"list\", \"read\"]\n\t\t\t\t},\n\t\t\t\t\"/scripts/{name}.ash\": {\n\t\t\t\t\tkind: \"ash:script\",\n\t\t\t\t\toperations: [\n\t\t\t\t\t\t\"read\",\n\t\t\t\t\t\t\"write\",\n\t\t\t\t\t\t\"delete\",\n\t\t\t\t\t\t\"exec\"\n\t\t\t\t\t],\n\t\t\t\t\tactions: [\"exec\"]\n\t\t\t\t}\n\t\t\t},\n\t\t\tauth: { type: \"none\" },\n\t\t\tbestFor: [\n\t\t\t\t\"data pipelines\",\n\t\t\t\t\"ETL scripts\",\n\t\t\t\t\"deterministic DSL\"\n\t\t\t],\n\t\t\tnotFor: [\"general-purpose code\"]\n\t\t};\n\t}\n\tstatic async load({ config } = {}) {\n\t\treturn new AFSAsh(config);\n\t}\n\tname;\n\tdescription;\n\taccessMode = \"readwrite\";\n\tscripts = /* @__PURE__ */ new Map();\n\twriteQueues = /* @__PURE__ */ new Map();\n\tafsRoot;\n\tscriptsDir;\n\tdataDir;\n\tallowRootActions;\n\ttriggerSubs = /* @__PURE__ */ new Map();\n\tcronJobs = /* @__PURE__ */ new Map();\n\t/** Cron registry for alarm-driven execution (CF Worker DOs where setTimeout is unreliable). */\n\tcronRegistry = /* @__PURE__ */ new Map();\n\texternalScripts = /* @__PURE__ */ new Map();\n\texternalScriptSubs = [];\n\t/** Pending trigger execution promises — for testing/awaiting async triggers. */\n\tpendingTriggers = /* @__PURE__ */ new Set();\n\t/** Per-script AFS override for program-scoped triggers (scriptName → program AFS). */\n\ttriggerAfsOverrides = /* @__PURE__ */ new Map();\n\t/** Script trigger keys owned by each program trigger registration. */\n\tprogramTriggerKeys = /* @__PURE__ */ new Map();\n\t/** Namespace prefixes registered via registerProgramTriggers (e.g. \"/blocklets/evan\"). */\n\tprogramNamespaces = /* @__PURE__ */ new Set();\n\t/** Runtime AFSes promoted to program-AFS. When events arrive on these,\n\t* the onMount-installed `initTriggers` subscription skips to avoid\n\t* duplicate registration — `registerProgramTriggers` owns them. */\n\tprogramAfses = /* @__PURE__ */ new WeakSet();\n\tdirsReady = false;\n\tconstructor(options = {}) {\n\t\tsuper();\n\t\tthis.name = options.name ?? \"ash\";\n\t\tthis.description = options.description ?? \"ASH pipeline DSL for deterministic data pipelines\";\n\t\tthis.scriptsDir = options.scriptsDir;\n\t\tthis.dataDir = options.dataDir;\n\t\tconst rawAllow = options.allowRootActions;\n\t\tconst allowList = Array.isArray(rawAllow) ? rawAllow : typeof rawAllow === \"string\" ? [rawAllow] : [\"agent-run\"];\n\t\tconst validActions = new Set([\n\t\t\t\"agent-run\",\n\t\t\t\"run\",\n\t\t\t\"mount\",\n\t\t\t\"unmount\",\n\t\t\t\"read\",\n\t\t\t\"list\",\n\t\t\t\"write\",\n\t\t\t\"delete\"\n\t\t]);\n\t\tconst normalized = allowList.filter((a) => validActions.has(a));\n\t\tthis.allowRootActions = new Set(normalized.length > 0 ? normalized : [\"agent-run\"]);\n\t}\n\tasync ready() {\n\t\tif (this.dirsReady) return;\n\t\tconst fs = getPlatform().fs;\n\t\tif (this.scriptsDir) await fs.mkdir(this.scriptsDir, { recursive: true });\n\t\tif (this.dataDir) await fs.mkdir(this.dataDir, { recursive: true });\n\t\tthis.dirsReady = true;\n\t}\n\tasync ensureDirs() {\n\t\tif (!this.dirsReady) await this.ready();\n\t}\n\tasync enqueueWrite(key, fn) {\n\t\tconst previous = this.writeQueues.get(key) ?? Promise.resolve();\n\t\tlet release;\n\t\tconst current = new Promise((resolve) => {\n\t\t\trelease = resolve;\n\t\t});\n\t\tthis.writeQueues.set(key, previous.then(() => current, () => current));\n\t\tawait previous.catch(() => {});\n\t\ttry {\n\t\t\treturn await fn();\n\t\t} finally {\n\t\t\trelease();\n\t\t\tif (this.writeQueues.get(key) === current) this.writeQueues.delete(key);\n\t\t}\n\t}\n\tasync getScript(name) {\n\t\tif (this.scriptsDir) {\n\t\t\tconst platform = getPlatform();\n\t\t\tconst filePath = platform.path.join(this.scriptsDir, `${name}.ash`);\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tsource: await platform.fs.readTextFile(filePath),\n\t\t\t\t\tcreatedAt: /* @__PURE__ */ new Date(),\n\t\t\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\treturn this.scripts.get(name);\n\t}\n\tasync setScript(name, script) {\n\t\tif (this.scriptsDir) {\n\t\t\tawait this.ensureDirs();\n\t\t\tawait writeFileAtomic(getPlatform().path.join(this.scriptsDir, `${name}.ash`), script.source);\n\t\t}\n\t\tthis.scripts.set(name, script);\n\t}\n\tasync hasScript(name) {\n\t\tif (this.scriptsDir) try {\n\t\t\tconst platform = getPlatform();\n\t\t\tawait platform.fs.stat(platform.path.join(this.scriptsDir, `${name}.ash`));\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.scripts.has(name);\n\t}\n\tasync removeScript(name) {\n\t\tif (this.scriptsDir) try {\n\t\t\tconst platform = getPlatform();\n\t\t\tawait platform.fs.rm(platform.path.join(this.scriptsDir, `${name}.ash`));\n\t\t} catch {}\n\t\tthis.scripts.delete(name);\n\t}\n\tasync getAllScriptNames() {\n\t\tif (this.scriptsDir) try {\n\t\t\treturn (await getPlatform().fs.readdir(this.scriptsDir)).filter((f) => f.endsWith(\".ash\")).map((f) => f.replace(/\\.ash$/, \"\"));\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\treturn Array.from(this.scripts.keys());\n\t}\n\tasync getScriptCount() {\n\t\treturn (await this.getAllScriptNames()).length;\n\t}\n\t/** Sanitize an ASH path to a flat filename: /data/clean → data%2Fclean.json */\n\tdataFileName(path) {\n\t\treturn `${path.replace(/^\\/+/, \"\").replace(/\\//g, \"%2F\")}.json`;\n\t}\n\t/** Persist save output to dataDir */\n\tasync persistData(path, data) {\n\t\tif (!this.dataDir) return;\n\t\tawait this.enqueueWrite(`data:${path}`, async () => {\n\t\t\tawait this.ensureDirs();\n\t\t\tawait writeFileAtomic(getPlatform().path.join(this.dataDir, this.dataFileName(path)), JSON.stringify(data));\n\t\t});\n\t}\n\tasync updateScript(name, update) {\n\t\treturn this.enqueueWrite(`script:${name}`, async () => {\n\t\t\tconst next = await update(await this.getScript(name));\n\t\t\tif (next) await this.setScript(name, next);\n\t\t\telse await this.removeScript(name);\n\t\t\treturn next;\n\t\t});\n\t}\n\t/** Load all persisted data files into a dataStore */\n\tasync loadPersistedData() {\n\t\tconst store = {};\n\t\tif (!this.dataDir) return store;\n\t\tconst platform = getPlatform();\n\t\ttry {\n\t\t\tconst files = await platform.fs.readdir(this.dataDir);\n\t\t\tfor (const file of files) {\n\t\t\t\tif (!file.endsWith(\".json\")) continue;\n\t\t\t\tconst key = `/${file.replace(/\\.json$/, \"\").replace(/%2F/gi, \"/\")}`;\n\t\t\t\ttry {\n\t\t\t\t\tstore[key] = JSON.parse(await platform.fs.readTextFile(platform.path.join(this.dataDir, file)));\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t} catch {}\n\t\treturn store;\n\t}\n\tonMount(afs) {\n\t\tthis.destroy();\n\t\tthis.afsRoot = afs;\n\t\tthis.initTriggers().catch(() => {});\n\t\tif (afs.subscribe) this.externalScriptSubs = [afs.subscribe({ type: SCRIPT_EVENT_TYPES.REGISTERED }, (evt) => {\n\t\t\tif (evt.data?.runtime !== \"ash\") return;\n\t\t\tif (this.isFromProgramNamespace(evt.path)) return;\n\t\t\tif (this.programAfses.has(afs)) return;\n\t\t\tthis.trackPendingTrigger(this.registerExternalScript(evt.path).catch(() => {}));\n\t\t}), afs.subscribe({ type: SCRIPT_EVENT_TYPES.UNREGISTERED }, (evt) => {\n\t\t\tif (evt.data?.runtime !== \"ash\") return;\n\t\t\tif (this.isFromProgramNamespace(evt.path)) return;\n\t\t\tif (this.programAfses.has(afs)) return;\n\t\t\tthis.unregisterExternalScript(evt.path);\n\t\t})];\n\t}\n\t/** Check if a global event path belongs to a registered program namespace. */\n\tisFromProgramNamespace(path) {\n\t\tif (path.startsWith(\"/blocklets/\")) return true;\n\t\tfor (const ns of this.programNamespaces) if (path.startsWith(`${ns}/`)) return true;\n\t\treturn false;\n\t}\n\tasync registerExternalScript(path) {\n\t\tconst afs = this.afsRoot;\n\t\tif (!afs?.read) return;\n\t\tfor (const ns of this.programNamespaces) if (this.triggerAfsOverrides.has(`${ns}:${path}`)) return;\n\t\tfor (const key of this.triggerSubs.keys()) if (key.endsWith(`:${path}`)) return;\n\t\ttry {\n\t\t\tconst file = await afs.read(path, {});\n\t\t\tconst source = String(file.data?.content ?? \"\");\n\t\t\tif (!source.trim()) return;\n\t\t\tthis.externalScripts.set(path, source);\n\t\t\tthis.registerTriggers(path, source);\n\t\t} catch {}\n\t}\n\tunregisterExternalScript(path) {\n\t\tthis.externalScripts.delete(path);\n\t\tthis.unregisterTriggers(path);\n\t}\n\t/** Wait for all pending trigger executions to complete. Useful in tests. */\n\tasync flushTriggers() {\n\t\twhile (this.pendingTriggers.size > 0) await Promise.allSettled([...this.pendingTriggers]);\n\t}\n\ttrackPendingTrigger(promise) {\n\t\tthis.pendingTriggers.add(promise);\n\t\tpromise.finally(() => {\n\t\t\tthis.pendingTriggers.delete(promise);\n\t\t});\n\t}\n\t/** Stop all cron jobs and unsubscribe all event triggers. Call on provider teardown. */\n\tdestroy() {\n\t\tconst allNames = new Set([...this.triggerSubs.keys(), ...this.cronJobs.keys()]);\n\t\tfor (const name of allNames) this.unregisterTriggers(name);\n\t\tfor (const unsub of this.externalScriptSubs) unsub();\n\t\tthis.externalScriptSubs = [];\n\t\tthis.externalScripts.clear();\n\t\tthis.triggerAfsOverrides.clear();\n\t\tthis.programTriggerKeys.clear();\n\t\tthis.programNamespaces.clear();\n\t}\n\tasync initTriggers() {\n\t\tawait this.ensureDirs();\n\t\tfor (const name of await this.getAllScriptNames()) {\n\t\t\tconst script = await this.getScript(name);\n\t\t\tif (script) this.registerTriggers(name, script.source);\n\t\t}\n\t}\n\t/**\n\t* Register triggers for all .ash scripts in a program's /program/scripts/ directory.\n\t* Uses the program's runtime AFS for both event subscription and action execution,\n\t* ensuring triggered jobs operate in the correct program namespace (e.g., accessing\n\t* the program's own telegram/slack providers instead of the host's).\n\t*/\n\t/**\n\t* Register triggers for all .ash scripts in a program's script directories.\n\t* @param runtimeAFS - The program's runtime AFS instance\n\t* @param namespace - Optional namespace prefix to avoid key collisions when\n\t* multiple blocklets share the same ASH provider instance.\n\t* e.g. \"/blocklets/telegram-assistant\" → keys become\n\t* \"/blocklets/telegram-assistant:/program/scripts/foo.ash\"\n\t*/\n\tasync registerProgramTriggers(runtimeAFS, namespace) {\n\t\tif (!runtimeAFS.list || !runtimeAFS.read) return;\n\t\tif (namespace) this.programNamespaces.add(namespace);\n\t\tthis.programAfses.add(runtimeAFS);\n\t\tconst keyPrefix = namespace ? `${namespace}:` : \"\";\n\t\tconst programKey = namespace ?? \"__default__\";\n\t\tconst subKey = `${keyPrefix}__program__`;\n\t\tthis.unregisterProgramTriggers(programKey);\n\t\tthis.unregisterProgramSubscription(subKey);\n\t\tlet registeredCount = 0;\n\t\tfor (const dir of [\n\t\t\t\"/packages/scripts\",\n\t\t\t\"/instance/scripts\",\n\t\t\t\"/instance\"\n\t\t]) try {\n\t\t\tconst scriptsList = await runtimeAFS.list(dir, {});\n\t\t\tfor (const entry of scriptsList.data) {\n\t\t\t\tif (!entry.path.endsWith(\".ash\")) continue;\n\t\t\t\tconst scriptPath = entry.path.startsWith(\"/\") ? entry.path : `${dir}/${entry.path}`;\n\t\t\t\ttry {\n\t\t\t\t\tconst readResult = await runtimeAFS.read(scriptPath, {});\n\t\t\t\t\tconst source = String(readResult.data?.content ?? \"\");\n\t\t\t\t\tif (!source.trim()) continue;\n\t\t\t\t\tconst result = compileSource(source);\n\t\t\t\t\tif (!result.program) continue;\n\t\t\t\t\tif (!result.program.units.some((u) => u.kind === \"job\" && u.trigger)) continue;\n\t\t\t\t\tif (this.triggerSubs.has(scriptPath)) {\n\t\t\t\t\t\tthis.unregisterTriggers(scriptPath);\n\t\t\t\t\t\tthis.externalScripts.delete(scriptPath);\n\t\t\t\t\t}\n\t\t\t\t\tthis.registerProgramScriptTrigger(programKey, keyPrefix + scriptPath, source, runtimeAFS);\n\t\t\t\t\tregisteredCount++;\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t} catch {}\n\t\tlog.debug(`[ASH] registerProgramTriggers ns=${namespace ?? \"(none)\"} registered=${registeredCount}`);\n\t\tif (runtimeAFS.subscribe) {\n\t\t\tconst unsub = runtimeAFS.subscribe({ type: SCRIPT_EVENT_TYPES.REGISTERED }, (evt) => {\n\t\t\t\tif (evt.data?.runtime !== \"ash\") return;\n\t\t\t\tconst p = (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst readResult = await runtimeAFS.read(evt.path, {});\n\t\t\t\t\t\tconst source = String(readResult.data?.content ?? \"\");\n\t\t\t\t\t\tif (!source.trim()) return;\n\t\t\t\t\t\tthis.registerProgramScriptTrigger(programKey, keyPrefix + evt.path, source, runtimeAFS);\n\t\t\t\t\t} catch {}\n\t\t\t\t})();\n\t\t\t\tthis.trackPendingTrigger(p);\n\t\t\t});\n\t\t\tthis.triggerSubs.set(subKey, [unsub]);\n\t\t}\n\t}\n\tregisterProgramScriptTrigger(programKey, scriptName, source, runtimeAFS) {\n\t\tthis.registerTriggers(scriptName, source, runtimeAFS);\n\t\tconst keys = this.programTriggerKeys.get(programKey) ?? /* @__PURE__ */ new Set();\n\t\tkeys.add(scriptName);\n\t\tthis.programTriggerKeys.set(programKey, keys);\n\t}\n\tunregisterProgramTriggers(programKey) {\n\t\tconst keys = this.programTriggerKeys.get(programKey);\n\t\tif (!keys) return;\n\t\tfor (const scriptName of keys) this.unregisterTriggers(scriptName);\n\t\tthis.programTriggerKeys.delete(programKey);\n\t}\n\tunregisterProgramSubscription(subKey) {\n\t\tconst existing = this.triggerSubs.get(subKey);\n\t\tif (!existing) return;\n\t\tfor (const unsub of existing) unsub();\n\t\tthis.triggerSubs.delete(subKey);\n\t}\n\t/**\n\t* Register EventBus subscriptions and cron schedules for all triggers in a script.\n\t* Replaces any previous subscriptions/schedules for the same script name.\n\t*\n\t* When `afsOverride` is provided (program-scoped triggers), events are subscribed\n\t* on the program AFS and the override is stored for use by `executeTriggerJob`.\n\t* When re-registered without an explicit override (e.g., via script:registered),\n\t* any existing program-scoped override is preserved.\n\t*/\n\tregisterTriggers(scriptName, source, afsOverride) {\n\t\tconst effectiveOverride = afsOverride ?? this.triggerAfsOverrides.get(scriptName);\n\t\tthis.unregisterTriggers(scriptName);\n\t\tif (effectiveOverride) this.triggerAfsOverrides.set(scriptName, effectiveOverride);\n\t\tconst result = compileSource(source);\n\t\tif (!result.program) return;\n\t\tconst afs = effectiveOverride ?? this.afsRoot;\n\t\tconst unsubs = [];\n\t\tconst crons = [];\n\t\tfor (const unit of result.program.units) {\n\t\t\tif (unit.kind !== \"job\" || !unit.trigger) continue;\n\t\t\tconst jobName = unit.name;\n\t\t\tconst trigger = unit.trigger;\n\t\t\tif (trigger.kind === \"event\") {\n\t\t\t\tif (!afs?.subscribe) continue;\n\t\t\t\tconst filter = {\n\t\t\t\t\tpath: trigger.path,\n\t\t\t\t\ttype: trigger.event ? `*:${trigger.event}` : void 0\n\t\t\t\t};\n\t\t\t\tconst unsub = afs.subscribe(filter, (evt) => {\n\t\t\t\t\tconst p = this.executeTriggerJob(scriptName, jobName, evt);\n\t\t\t\t\tthis.trackPendingTrigger(p);\n\t\t\t\t});\n\t\t\t\tunsubs.push(unsub);\n\t\t\t} else if (trigger.kind === \"cron\") try {\n\t\t\t\tnew CronPattern(trigger.expression);\n\t\t\t\tconst cronKey = `${scriptName}:${jobName}`;\n\t\t\t\tthis.cronRegistry.set(cronKey, {\n\t\t\t\t\texpression: trigger.expression,\n\t\t\t\t\tscriptName,\n\t\t\t\t\tjobName,\n\t\t\t\t\tlastFiredMinute: 0\n\t\t\t\t});\n\t\t\t\tconst cron = new Cron(trigger.expression, { protect: true }, () => {\n\t\t\t\t\tconst reg = this.cronRegistry.get(cronKey);\n\t\t\t\t\tif (reg) reg.lastFiredMinute = Math.floor(Date.now() / 6e4);\n\t\t\t\t\tconst syntheticEvent = {\n\t\t\t\t\t\ttype: \"cron\",\n\t\t\t\t\t\tpath: `/cron/${scriptName}/${jobName}`,\n\t\t\t\t\t\tsource: \"ash-cron\",\n\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t};\n\t\t\t\t\tconst p = this.executeTriggerJob(scriptName, jobName, syntheticEvent);\n\t\t\t\t\tthis.trackPendingTrigger(p);\n\t\t\t\t});\n\t\t\t\tcrons.push(cron);\n\t\t\t} catch (err) {\n\t\t\t\tlog.error(`[ASH cron] Invalid cron expression \"${trigger.expression}\" in ${scriptName}/${jobName}:`, err);\n\t\t\t}\n\t\t}\n\t\tif (unsubs.length > 0) this.triggerSubs.set(scriptName, unsubs);\n\t\tif (crons.length > 0) this.cronJobs.set(scriptName, crons);\n\t}\n\t/** Unsubscribe all event triggers and stop all cron jobs for a given script. */\n\tunregisterTriggers(scriptName) {\n\t\tconst unsubs = this.triggerSubs.get(scriptName);\n\t\tif (unsubs) {\n\t\t\tfor (const unsub of unsubs) unsub();\n\t\t\tthis.triggerSubs.delete(scriptName);\n\t\t}\n\t\tconst crons = this.cronJobs.get(scriptName);\n\t\tif (crons) {\n\t\t\tfor (const cron of crons) cron.stop();\n\t\t\tthis.cronJobs.delete(scriptName);\n\t\t}\n\t\tfor (const key of this.cronRegistry.keys()) if (key.startsWith(`${scriptName}:`)) this.cronRegistry.delete(key);\n\t\tthis.triggerAfsOverrides.delete(scriptName);\n\t}\n\t/**\n\t* Tick all registered cron triggers — called by external alarm (e.g., DO alarm).\n\t* Checks each cron expression against the current minute and fires matching jobs.\n\t* Uses lastFiredMinute to prevent double-firing (croner timer may also fire).\n\t*/\n\ttickCronTriggers() {\n\t\tconst now = Date.now();\n\t\tconst currentMinute = Math.floor(now / 6e4);\n\t\tfor (const [, entry] of this.cronRegistry) {\n\t\t\tif (entry.lastFiredMinute >= currentMinute) continue;\n\t\t\ttry {\n\t\t\t\tif (!new Cron(entry.expression).match(new Date(now))) continue;\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tentry.lastFiredMinute = currentMinute;\n\t\t\tconst syntheticEvent = {\n\t\t\t\ttype: \"cron\",\n\t\t\t\tpath: `/cron/${entry.scriptName}/${entry.jobName}`,\n\t\t\t\tsource: \"ash-cron-tick\",\n\t\t\t\ttimestamp: now\n\t\t\t};\n\t\t\tconst p = this.executeTriggerJob(entry.scriptName, entry.jobName, syntheticEvent);\n\t\t\tthis.trackPendingTrigger(p);\n\t\t}\n\t}\n\t/**\n\t* Execute a single triggered job reactively in response to an AFS event.\n\t* Re-compiles the script, builds a bridged world context, executes the\n\t* target job with event data as the initial stream, and writes results\n\t* back to AFS.\n\t*/\n\tasync executeTriggerJob(scriptName, jobName, event) {\n\t\ttry {\n\t\t\tlet source;\n\t\t\tconst script = await this.getScript(scriptName);\n\t\t\tif (script) source = script.source;\n\t\t\telse if (this.externalScripts.has(scriptName)) source = this.externalScripts.get(scriptName);\n\t\t\telse {\n\t\t\t\tconst readAFS = this.triggerAfsOverrides.get(scriptName) ?? this.afsRoot;\n\t\t\t\tconst colonIdx = scriptName.indexOf(\":\");\n\t\t\t\tconst readPath = colonIdx >= 0 ? scriptName.slice(colonIdx + 1) : scriptName;\n\t\t\t\tif (readAFS?.read) try {\n\t\t\t\t\tconst file = await readAFS.read(readPath, {});\n\t\t\t\t\tsource = String(file.data?.content ?? \"\");\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t\tif (!source) return;\n\t\t\tconst result = compileSource(source);\n\t\t\tif (!result.program) return;\n\t\t\tconst job = result.program.units.find((u) => u.kind === \"job\" && u.name === jobName);\n\t\t\tif (!job || job.kind !== \"job\") return;\n\t\t\tconst afsOverride = this.triggerAfsOverrides.get(scriptName);\n\t\t\tconst effectiveAFS = afsOverride ?? this.afsRoot;\n\t\t\tconst { world, written } = await this.createAsyncWorld(afsOverride);\n\t\t\tconst ctx = {\n\t\t\t\tworld: effectiveAFS ? {\n\t\t\t\t\tread: (path, query) => readAfsRecords(effectiveAFS, world, path, query),\n\t\t\t\t\twrite: (path, data) => {\n\t\t\t\t\t\tworld.write(path, data);\n\t\t\t\t\t},\n\t\t\t\t\tpublish: (topic, data) => {\n\t\t\t\t\t\tworld.publish(topic, data);\n\t\t\t\t\t},\n\t\t\t\t\texec: world.exec && afsOverride ? async (path, input, params) => {\n\t\t\t\t\t\tconst augmentedInput = input.map((item) => typeof item === \"object\" && item !== null ? {\n\t\t\t\t\t\t\t...item,\n\t\t\t\t\t\t\t_scope_afs: afsOverride\n\t\t\t\t\t\t} : item);\n\t\t\t\t\t\treturn world.exec(path, augmentedInput, params);\n\t\t\t\t\t} : world.exec\n\t\t\t\t} : world,\n\t\t\t\tcaps: new Set([\"*\"]),\n\t\t\t\tlogger: { log() {} },\n\t\t\t\toutput: { output() {} }\n\t\t\t};\n\t\t\tconst initialStream = [{ ...event }];\n\t\t\tconst jobResult = await job.execute(ctx, initialStream);\n\t\t\tif (jobResult.status !== \"ok\") log.error(`[ASH trigger] ${scriptName}/${jobName} status=${jobResult.status}`, jobResult.errors);\n\t\t\tif (effectiveAFS?.write) for (const [path, data] of Object.entries(written)) if (path.endsWith(\".log\")) {\n\t\t\t\tconst content = `${data.map((item) => JSON.stringify(item)).join(\"\\n\")}\\n`;\n\t\t\t\tawait effectiveAFS.write(path, { content }, { mode: \"append\" });\n\t\t\t} else await effectiveAFS.write(path, { content: JSON.stringify(data) });\n\t\t} catch (err) {\n\t\t\tlog.error(`[ASH trigger] ${scriptName}/${jobName} threw:`, err);\n\t\t}\n\t}\n\tasync listRoot(_ctx) {\n\t\treturn { data: [{\n\t\t\tid: \"/scripts\",\n\t\t\tpath: \"/scripts\",\n\t\t\tsummary: \"Stored ASH scripts\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: await this.getScriptCount()\n\t\t\t}\n\t\t}, {\n\t\t\tid: \"/cookbook\",\n\t\t\tpath: \"/cookbook\",\n\t\t\tsummary: \"ASH best practices and quick reference\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: 2\n\t\t\t}\n\t\t}] };\n\t}\n\tasync listScripts(_ctx) {\n\t\tconst entries = [];\n\t\tfor (const name of await this.getAllScriptNames()) {\n\t\t\tconst script = await this.getScript(name);\n\t\t\tif (!script) continue;\n\t\t\tentries.push(this.buildScriptEntry(name, script));\n\t\t}\n\t\treturn { data: entries };\n\t}\n\tasync listScript(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tif (!await this.hasScript(name)) throw new AFSNotFoundError(ctx.path);\n\t\treturn { data: [] };\n\t}\n\tasync listRootActions(_ctx) {\n\t\treturn { data: [{\n\t\t\tid: \"run\",\n\t\t\tpath: \"/.actions/run\",\n\t\t\tsummary: \"Execute inline ASH code\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"afs:executable\",\n\t\t\t\tkinds: [\"afs:executable\", \"afs:node\"],\n\t\t\t\tname: \"run\",\n\t\t\t\tdescription: \"Execute inline ASH pipeline code\",\n\t\t\t\tinputSchema: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsource: {\n\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\tdescription: \"ASH pipeline source code. Read /.meta/.ash-reference for syntax.\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcaps: {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\titems: { type: \"string\" },\n\t\t\t\t\t\t\tdescription: \"Capability paths. Required for write-back to AFS (default: no write-back without caps)\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"source\"]\n\t\t\t\t}\n\t\t\t}\n\t\t}, {\n\t\t\tid: \"validate\",\n\t\t\tpath: \"/.actions/validate\",\n\t\t\tsummary: \"Validate ASH source code\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"afs:executable\",\n\t\t\t\tkinds: [\"afs:executable\", \"afs:node\"],\n\t\t\t\tname: \"validate\",\n\t\t\t\tdescription: \"Compile and type-check ASH source, return diagnostics\",\n\t\t\t\tinputSchema: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: { source: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription: \"ASH pipeline source code to validate. Read /.meta/.ash-reference for syntax.\"\n\t\t\t\t\t} },\n\t\t\t\t\trequired: [\"source\"]\n\t\t\t\t}\n\t\t\t}\n\t\t}] };\n\t}\n\tasync listScriptActions(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) throw new AFSNotFoundError(ctx.path);\n\t\tconst inputSchema = this.buildScriptExecInputSchema(script.source);\n\t\treturn { data: [{\n\t\t\tid: \"exec\",\n\t\t\tpath: joinURL(joinURL(\"/scripts\", ctx.params.scriptName, \".actions\"), \"exec\"),\n\t\t\tsummary: `Execute script ${name}`,\n\t\t\tmeta: {\n\t\t\t\tkind: \"afs:executable\",\n\t\t\t\tkinds: [\"afs:executable\", \"afs:node\"],\n\t\t\t\tname: \"exec\",\n\t\t\t\tdescription: `Execute the ${name} ASH script`,\n\t\t\t\tinputSchema\n\t\t\t}\n\t\t}] };\n\t}\n\tasync readRoot(_ctx) {\n\t\treturn {\n\t\t\tid: \"/\",\n\t\t\tpath: \"/\",\n\t\t\tmeta: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: 2\n\t\t\t},\n\t\t\tactions: [{\n\t\t\t\tname: \"run\",\n\t\t\t\tdescription: \"Execute inline ASH code\"\n\t\t\t}, {\n\t\t\t\tname: \"validate\",\n\t\t\t\tdescription: \"Validate ASH source code\"\n\t\t\t}]\n\t\t};\n\t}\n\tasync readScriptsDir(_ctx) {\n\t\treturn {\n\t\t\tid: \"/scripts\",\n\t\t\tpath: \"/scripts\",\n\t\t\tsummary: \"Stored ASH scripts\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: await this.getScriptCount()\n\t\t\t}\n\t\t};\n\t}\n\tasync readScript(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\treturn this.buildScriptEntry(name, script);\n\t}\n\tstatic COOKBOOK_FILES = [\"patterns.md\", \"quickref.md\"];\n\tasync listCookbook(_ctx) {\n\t\treturn { data: AFSAsh.COOKBOOK_FILES.map((file) => ({\n\t\t\tid: joinURL(\"/cookbook\", file),\n\t\t\tpath: joinURL(\"/cookbook\", file),\n\t\t\tsummary: file === \"patterns.md\" ? \"agent-run patterns and pitfalls\" : \"Quick reference card\",\n\t\t\tmeta: { kind: \"ash:documentation\" }\n\t\t})) };\n\t}\n\tasync readCookbookDir(_ctx) {\n\t\treturn {\n\t\t\tid: \"/cookbook\",\n\t\t\tpath: \"/cookbook\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: AFSAsh.COOKBOOK_FILES.length\n\t\t\t}\n\t\t};\n\t}\n\tasync listCookbookFile(_ctx) {\n\t\treturn { data: [] };\n\t}\n\tasync readCookbook(ctx) {\n\t\tconst file = ctx.params.file;\n\t\tif (!AFSAsh.COOKBOOK_FILES.includes(file)) throw new AFSNotFoundError(ctx.path);\n\t\treturn {\n\t\t\tid: joinURL(\"/cookbook\", file),\n\t\t\tpath: joinURL(\"/cookbook\", file),\n\t\t\tcontent: await readDoc(joinURL(\"cookbook\", file)),\n\t\t\tmeta: { kind: \"ash:documentation\" }\n\t\t};\n\t}\n\tasync readAgentMd(_ctx) {\n\t\treturn {\n\t\t\tid: \"/.meta/agent.md\",\n\t\t\tpath: \"/.meta/agent.md\",\n\t\t\tcontent: await readDoc(\"agent.md\"),\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:documentation\",\n\t\t\t\tdescription: \"ASH agent usage guide\"\n\t\t\t}\n\t\t};\n\t}\n\tasync readAshReference(_ctx) {\n\t\treturn {\n\t\t\tid: \"/.meta/.ash-reference\",\n\t\t\tpath: \"/.meta/.ash-reference\",\n\t\t\tcontent: ASH_REFERENCE,\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:reference\",\n\t\t\t\tdescription: \"ASH language reference for writing valid ASH pipelines\"\n\t\t\t}\n\t\t};\n\t}\n\tasync readCapabilities(_ctx) {\n\t\treturn {\n\t\t\tid: \"/.meta/.capabilities\",\n\t\t\tpath: \"/.meta/.capabilities\",\n\t\t\tcontent: {\n\t\t\t\tschemaVersion: 1,\n\t\t\t\tprovider: this.name,\n\t\t\t\tdescription: `${this.description}. Read /.meta/.ash-reference for ASH syntax.`,\n\t\t\t\ttools: [],\n\t\t\t\toperations: this.getOperationsDeclaration(),\n\t\t\t\tactions: [{\n\t\t\t\t\tdescription: \"Root-level ASH actions\",\n\t\t\t\t\tcatalog: [{\n\t\t\t\t\t\tname: \"run\",\n\t\t\t\t\t\tdescription: \"Execute inline ASH code\"\n\t\t\t\t\t}, {\n\t\t\t\t\t\tname: \"validate\",\n\t\t\t\t\t\tdescription: \"Validate ASH source code\"\n\t\t\t\t\t}],\n\t\t\t\t\tdiscovery: { pathTemplate: \"/.actions\" }\n\t\t\t\t}, {\n\t\t\t\t\tkind: \"ash:script\",\n\t\t\t\t\tdescription: \"Script-level actions\",\n\t\t\t\t\tcatalog: [{\n\t\t\t\t\t\tname: \"exec\",\n\t\t\t\t\t\tdescription: \"Execute the script\"\n\t\t\t\t\t}],\n\t\t\t\t\tdiscovery: { pathTemplate: \"/scripts/:scriptName/.actions\" }\n\t\t\t\t}],\n\t\t\t\tresources: { caps: [\n\t\t\t\t\t{\n\t\t\t\t\t\top: \"read\",\n\t\t\t\t\t\tpath: \"/*\",\n\t\t\t\t\t\tdescription: \"Read scripts and results\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\top: \"write\",\n\t\t\t\t\t\tpath: \"/scripts/*\",\n\t\t\t\t\t\tdescription: \"Write ASH script files\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\top: \"exec\",\n\t\t\t\t\t\tpath: \"/.actions/*\",\n\t\t\t\t\t\tdescription: \"Execute root actions (run, validate)\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\top: \"exec\",\n\t\t\t\t\t\tpath: \"/scripts/*/.actions/*\",\n\t\t\t\t\t\tdescription: \"Execute a script\"\n\t\t\t\t\t}\n\t\t\t\t] }\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\tkind: \"afs:capabilities\",\n\t\t\t\tdescription: \"ASH provider capabilities manifest\",\n\t\t\t\toperations: [\n\t\t\t\t\t\"list\",\n\t\t\t\t\t\"read\",\n\t\t\t\t\t\"write\",\n\t\t\t\t\t\"delete\",\n\t\t\t\t\t\"exec\",\n\t\t\t\t\t\"stat\",\n\t\t\t\t\t\"explain\",\n\t\t\t\t\t\"search\"\n\t\t\t\t]\n\t\t\t}\n\t\t};\n\t}\n\tasync readRootMeta(_ctx) {\n\t\treturn {\n\t\t\tid: \"/.meta\",\n\t\t\tpath: \"/.meta\",\n\t\t\tcontent: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: 2\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: 2\n\t\t\t}\n\t\t};\n\t}\n\tasync readCookbookMeta(_ctx) {\n\t\treturn {\n\t\t\tid: \"/cookbook/.meta\",\n\t\t\tpath: \"/cookbook/.meta\",\n\t\t\tcontent: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: AFSAsh.COOKBOOK_FILES.length\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\tkind: \"ash:directory\",\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: AFSAsh.COOKBOOK_FILES.length\n\t\t\t}\n\t\t};\n\t}\n\tasync readCookbookFileMeta(ctx) {\n\t\treturn {\n\t\t\tid: joinURL(\"/cookbook\", ctx.params.file, \".meta\"),\n\t\t\tpath: joinURL(\"/cookbook\", ctx.params.file, \".meta\"),\n\t\t\tcontent: { kind: \"ash:documentation\" },\n\t\t\tmeta: { kind: \"ash:documentation\" }\n\t\t};\n\t}\n\tasync readScriptsMeta(_ctx) {\n\t\treturn {\n\t\t\tid: \"/scripts/.meta\",\n\t\t\tpath: \"/scripts/.meta\",\n\t\t\tcontent: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: await this.getScriptCount()\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: await this.getScriptCount()\n\t\t\t}\n\t\t};\n\t}\n\tasync readScriptMeta(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\tconst entry = this.buildScriptEntry(name, script);\n\t\treturn {\n\t\t\tid: joinURL(\"/scripts\", ctx.params.scriptName, \".meta\"),\n\t\t\tpath: joinURL(\"/scripts\", ctx.params.scriptName, \".meta\"),\n\t\t\tcontent: entry.meta ?? {},\n\t\t\tmeta: entry.meta ?? {}\n\t\t};\n\t}\n\tasync writeScript(ctx, entry) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst now = /* @__PURE__ */ new Date();\n\t\tconst rawContent = typeof entry === \"string\" ? entry : entry.content;\n\t\tlet existed = false;\n\t\tconst stored = await this.updateScript(name, async (existing) => {\n\t\t\texisted = existing !== void 0;\n\t\t\tif (rawContent === void 0 && existing) return {\n\t\t\t\tsource: existing.source,\n\t\t\t\tcreatedAt: existing.createdAt,\n\t\t\t\tupdatedAt: now\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tsource: typeof rawContent === \"string\" ? rawContent : JSON.stringify(rawContent) ?? \"\",\n\t\t\t\tcreatedAt: existing?.createdAt ?? now,\n\t\t\t\tupdatedAt: now\n\t\t\t};\n\t\t});\n\t\tif (!stored) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\tthis.registerTriggers(name, stored.source);\n\t\treturn {\n\t\t\tdata: this.buildScriptEntry(name, stored),\n\t\t\tmessage: existed ? \"Script updated\" : \"Script created\"\n\t\t};\n\t}\n\tasync deleteScript(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tlet existed = false;\n\t\tawait this.updateScript(name, async (existing) => {\n\t\t\texisted = existing !== void 0 || await this.hasScript(name);\n\t\t});\n\t\tif (!existed) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\tthis.unregisterTriggers(name);\n\t\treturn { message: `Script '${name}' deleted` };\n\t}\n\tasync deleteCatchAll(ctx) {\n\t\tthrow new AFSNotFoundError(ctx.path);\n\t}\n\tasync execScript(ctx, args) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) return {\n\t\t\tsuccess: false,\n\t\t\tdata: { error: `Script not found: ${name}` }\n\t\t};\n\t\treturn this.runAsh(script.source, args);\n\t}\n\tasync execScriptDirect(ctx, args) {\n\t\treturn this.execScript(ctx, args);\n\t}\n\tasync execRootAction(ctx, args) {\n\t\tconst actionName = ctx.params.action;\n\t\tif (actionName === \"run\") {\n\t\t\tconst source = args.source;\n\t\t\tif (typeof source !== \"string\") throw new Error(\"action 'run' requires 'source' parameter as string\");\n\t\t\tconst jobName = args.job;\n\t\t\tif (jobName) {\n\t\t\t\tconst runtimeAFS$1 = args._scope_afs;\n\t\t\t\treturn this.runJob(source, jobName, args, { afsOverride: runtimeAFS$1 });\n\t\t\t}\n\t\t\tconst hasCaps = Array.isArray(args.caps) && args.caps.length > 0;\n\t\t\tconst runtimeAFS = args._scope_afs;\n\t\t\tconst returnWrittenData = args._return_written_data === true;\n\t\t\tconst skipWritePrefix = typeof args._skip_write_prefix === \"string\" ? args._skip_write_prefix : void 0;\n\t\t\tconst cleanArgs = { ...args };\n\t\t\tdelete cleanArgs._scope_afs;\n\t\t\tdelete cleanArgs._return_written_data;\n\t\t\tdelete cleanArgs._skip_write_prefix;\n\t\t\treturn this.runAsh(source, cleanArgs, {\n\t\t\t\tallowWriteBack: hasCaps,\n\t\t\t\tafsOverride: runtimeAFS,\n\t\t\t\treturnWrittenData,\n\t\t\t\tskipWritePrefix\n\t\t\t});\n\t\t}\n\t\tif (actionName === \"validate\") {\n\t\t\tconst source = args.source;\n\t\t\tif (typeof source !== \"string\") throw new Error(\"action 'validate' requires 'source' parameter as string\");\n\t\t\tconst result = compileSource(source);\n\t\t\tconst errors = result.diagnostics.filter((d) => d.severity !== \"warning\");\n\t\t\tconst warnings = result.diagnostics.filter((d) => d.severity === \"warning\");\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: {\n\t\t\t\t\tvalid: errors.length === 0,\n\t\t\t\t\terrors,\n\t\t\t\t\twarnings,\n\t\t\t\t\tjobCount: result.program?.jobs.length ?? 0,\n\t\t\t\t\tsourceHash: result.sourceHash\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tif (actionName === \"agent-run\") {\n\t\t\tif (!ashAgentRunDeprecationLogged) {\n\t\t\t\tlog.warn(\"[ash] DEPRECATED: /ash/.actions/agent-run — use /dev/agent/.actions/run instead. This alias will be removed in a future version.\");\n\t\t\t\tashAgentRunDeprecationLogged = true;\n\t\t\t}\n\t\t\tconst afs = args._scope_afs ?? this.afsRoot;\n\t\t\tif (!afs?.exec) return {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"AGENT_RUN_ALIAS_NO_AFS\",\n\t\t\t\t\tmessage: \"AFS root not available\"\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn afs.exec(\"/dev/agent/.actions/run\", args, {});\n\t\t}\n\t\tif (actionName === \"register-triggers\") {\n\t\t\tconst runtimeAFS = args._scope_afs;\n\t\t\tconst namespace = typeof args.namespace === \"string\" ? args.namespace : void 0;\n\t\t\tif (runtimeAFS) await this.registerProgramTriggers(runtimeAFS, namespace);\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: { registered: !!runtimeAFS }\n\t\t\t};\n\t\t}\n\t\tif (actionName === \"tick-crons\") {\n\t\t\tthis.tickCronTriggers();\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: { cronCount: this.cronRegistry.size }\n\t\t\t};\n\t\t}\n\t\tthrow new Error(`Unknown action: ${actionName}`);\n\t}\n\tasync statRoot(_ctx) {\n\t\treturn { data: {\n\t\t\tid: \"/\",\n\t\t\tpath: \"/\",\n\t\t\tmeta: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: 1,\n\t\t\t\tscriptCount: await this.getScriptCount()\n\t\t\t}\n\t\t} };\n\t}\n\tasync statScriptsDir(_ctx) {\n\t\treturn { data: {\n\t\t\tid: \"/scripts\",\n\t\t\tpath: \"/scripts\",\n\t\t\tmeta: {\n\t\t\t\ttype: \"directory\",\n\t\t\t\tchildrenCount: await this.getScriptCount()\n\t\t\t}\n\t\t} };\n\t}\n\tasync statScript(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\treturn { data: {\n\t\t\tid: joinURL(\"/scripts\", `${name}.ash`),\n\t\t\tpath: joinURL(\"/scripts\", `${name}.ash`),\n\t\t\tcreatedAt: script.createdAt,\n\t\t\tupdatedAt: script.updatedAt,\n\t\t\tmeta: {\n\t\t\t\ttype: \"file\",\n\t\t\t\tkind: \"ash:script\",\n\t\t\t\tscriptName: name,\n\t\t\t\tsize: new TextEncoder().encode(script.source).length\n\t\t\t}\n\t\t} };\n\t}\n\tasync explainRoot(_ctx) {\n\t\treturn {\n\t\t\tformat: \"markdown\",\n\t\t\tcontent: await readDoc(\"agent.md\")\n\t\t};\n\t}\n\tasync explainScript(ctx) {\n\t\tconst name = ctx.params.scriptName.replace(/\\.ash$/, \"\");\n\t\tconst script = await this.getScript(name);\n\t\tif (!script) throw new AFSNotFoundError(ctx.path, `Script not found: ${name}`);\n\t\tconst result = compileSource(script.source);\n\t\tconst lines = [];\n\t\tlines.push(`# Script: ${name}.ash`);\n\t\tlines.push(\"\");\n\t\tlines.push(\"## Source\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"```ash\");\n\t\tlines.push(script.source);\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"## Analysis\");\n\t\tlines.push(\"\");\n\t\tlines.push(`- **Jobs**: ${result.program?.jobs.length ?? 0}`);\n\t\tlines.push(`- **Diagnostics**: ${result.diagnostics.length}`);\n\t\tlines.push(`- **Size**: ${new TextEncoder().encode(script.source).length} bytes`);\n\t\tlines.push(\"\");\n\t\treturn {\n\t\t\tformat: \"markdown\",\n\t\t\tcontent: lines.join(\"\\n\")\n\t\t};\n\t}\n\tasync searchScripts(_ctx, query) {\n\t\tconst results = [];\n\t\tconst lowerQuery = query.toLowerCase();\n\t\tfor (const name of await this.getAllScriptNames()) {\n\t\t\tconst script = await this.getScript(name);\n\t\t\tif (!script) continue;\n\t\t\tif (name.toLowerCase().includes(lowerQuery) || script.source.toLowerCase().includes(lowerQuery)) results.push(this.buildScriptEntry(name, script));\n\t\t}\n\t\treturn { data: results };\n\t}\n\tbuildScriptEntry(name, script) {\n\t\tconst inputSchema = this.buildScriptExecInputSchema(script.source);\n\t\treturn {\n\t\t\tid: joinURL(\"/scripts\", `${name}.ash`),\n\t\t\tpath: joinURL(\"/scripts\", `${name}.ash`),\n\t\t\tcontent: script.source,\n\t\t\tcreatedAt: script.createdAt,\n\t\t\tupdatedAt: script.updatedAt,\n\t\t\tmeta: {\n\t\t\t\ttype: \"file\",\n\t\t\t\tkind: \"ash:script\",\n\t\t\t\tkinds: [\n\t\t\t\t\t\"ash:script\",\n\t\t\t\t\t\"afs:executable\",\n\t\t\t\t\t\"afs:node\"\n\t\t\t\t],\n\t\t\t\tscriptName: name,\n\t\t\t\tsize: new TextEncoder().encode(script.source).length\n\t\t\t},\n\t\t\tactions: [{\n\t\t\t\tname: \"exec\",\n\t\t\t\tdescription: `Execute script ${name}`,\n\t\t\t\tinputSchema\n\t\t\t}]\n\t\t};\n\t}\n\tbuildScriptExecInputSchema(source) {\n\t\tconst properties = { caps: {\n\t\t\ttype: \"array\",\n\t\t\titems: { type: \"string\" },\n\t\t\tdescription: \"Capability paths. Required for write-back to AFS (default: no write-back without caps)\"\n\t\t} };\n\t\tconst result = compileSource(source);\n\t\tif (result.program) for (const [key, value] of result.program.params) properties[key] = {\n\t\t\ttype: typeof value === \"number\" ? \"number\" : \"string\",\n\t\t\tdescription: `Override ASH param '${key}' at execution time`\n\t\t};\n\t\treturn {\n\t\t\ttype: \"object\",\n\t\t\tproperties\n\t\t};\n\t}\n\t/**\n\t* Create an async-capable world that bridges ASH to AFS.\n\t* Since ASH's WorldInterface is synchronous but AFS is async,\n\t* we collect operations and replay them, or use a pre-loaded data approach.\n\t*/\n\tasync createAsyncWorld(afsOverride) {\n\t\tconst dataStore = { ...await this.loadPersistedData() };\n\t\tconst written = {};\n\t\tconst published = {};\n\t\tconst writeCounts = {};\n\t\tconst afsRoot = afsOverride ?? this.afsRoot;\n\t\tconst selfPrefix = `/${this.name}/`;\n\t\tconst allowRootActions = this.allowRootActions;\n\t\tconst pendingPersist = [];\n\t\tconst persistData = (path, data) => {\n\t\t\tpendingPersist.push(this.persistData(path, data).catch(() => {}));\n\t\t};\n\t\treturn {\n\t\t\tworld: {\n\t\t\t\tread(path) {\n\t\t\t\t\treturn dataStore[normalizeAbsoluteAfsPath(path)] ?? [];\n\t\t\t\t},\n\t\t\t\twrite(path, data) {\n\t\t\t\t\tconst normalizedPath = normalizeAbsoluteAfsPath(path);\n\t\t\t\t\tif (normalizedPath.startsWith(selfPrefix) || normalizedPath.startsWith(\"/scripts\") || normalizedPath.startsWith(\"/.actions\") || normalizedPath.startsWith(\"/.meta\")) throw new Error(`Write blocked: '${path}' is a protected ASH provider path`);\n\t\t\t\t\twriteCounts[normalizedPath] = (writeCounts[normalizedPath] ?? 0) + 1;\n\t\t\t\t\tif (written[normalizedPath]) written[normalizedPath].push(...data);\n\t\t\t\t\telse written[normalizedPath] = [...data];\n\t\t\t\t\tdataStore[normalizedPath] = written[normalizedPath];\n\t\t\t\t\tpersistData(normalizedPath, data);\n\t\t\t\t},\n\t\t\t\tpublish(topic, data) {\n\t\t\t\t\tpublished[topic] = data;\n\t\t\t\t},\n\t\t\t\tasync exec(path, input, params) {\n\t\t\t\t\tconst normalizedPath = normalizeAbsoluteAfsPath(path);\n\t\t\t\t\tconst rootActionMatch = /^\\/\\.actions\\/([^/]+)$/.exec(normalizedPath) ?? (/* @__PURE__ */ new RegExp(`^${selfPrefix.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\\\\.actions\\\\/([^/]+)$`)).exec(normalizedPath);\n\t\t\t\t\tif (!(rootActionMatch !== null && allowRootActions.has(rootActionMatch[1])) && (normalizedPath.startsWith(selfPrefix) || normalizedPath.startsWith(\"/.actions\") || normalizedPath.startsWith(\"/scripts\"))) throw new Error(`Exec blocked: self-referencing call to '${path}' would cause recursion`);\n\t\t\t\t\tif (afsRoot?.exec) {\n\t\t\t\t\t\tconst baseParams = params ?? {};\n\t\t\t\t\t\tconst records = input.filter((r) => typeof r === \"object\" && r !== null);\n\t\t\t\t\t\tconst mergeContext = (inputArgs, outputData) => {\n\t\t\t\t\t\t\tconst items = Array.isArray(outputData) ? outputData : [outputData];\n\t\t\t\t\t\t\tconst { _scope_afs: _, ...context } = inputArgs;\n\t\t\t\t\t\t\treturn items.map((d) => typeof d === \"object\" && d !== null ? {\n\t\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\t\t...d\n\t\t\t\t\t\t\t} : d);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst execAndCheck = async (mergedArgs) => {\n\t\t\t\t\t\t\tconst result = await afsRoot.exec(normalizedPath, mergedArgs, {});\n\t\t\t\t\t\t\tif (!result.success) {\n\t\t\t\t\t\t\t\tconst errMsg = typeof result.error === \"object\" && result.error !== null ? result.error.message ?? JSON.stringify(result.error) : typeof result.data?.error === \"string\" ? result.data.error : `Action failed: ${normalizedPath}`;\n\t\t\t\t\t\t\t\tthrow new Error(errMsg);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn mergeContext(mergedArgs, result.data);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (records.length <= 1) {\n\t\t\t\t\t\t\tconst mergedArgs = {\n\t\t\t\t\t\t\t\t...records[0] ?? {},\n\t\t\t\t\t\t\t\t...baseParams\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (afsOverride) mergedArgs._scope_afs = afsOverride;\n\t\t\t\t\t\t\treturn execAndCheck(mergedArgs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst results = [];\n\t\t\t\t\t\tfor (const record of records) {\n\t\t\t\t\t\t\tconst mergedArgs = {\n\t\t\t\t\t\t\t\t...record,\n\t\t\t\t\t\t\t\t...baseParams\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (afsOverride) mergedArgs._scope_afs = afsOverride;\n\t\t\t\t\t\t\tresults.push(...await execAndCheck(mergedArgs));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t\treturn input;\n\t\t\t\t},\n\t\t\t\tasync input(prompt) {\n\t\t\t\t\tif (afsRoot?.exec) try {\n\t\t\t\t\t\tconst result = await afsRoot.exec(\"/ui/.actions/prompt\", {\n\t\t\t\t\t\t\tmessage: prompt,\n\t\t\t\t\t\t\ttype: \"text\"\n\t\t\t\t\t\t}, {});\n\t\t\t\t\t\treturn String(result.data?.response ?? \"\");\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (err instanceof AFSNotFoundError) return \"\";\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t}\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t},\n\t\t\twritten,\n\t\t\tpublished,\n\t\t\twriteCounts,\n\t\t\tpreload(path, data) {\n\t\t\t\tdataStore[path] = data;\n\t\t\t},\n\t\t\tasync flushPersist() {\n\t\t\t\tawait Promise.all(pendingPersist);\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Execute a single named job from an ASH source.\n\t* Used by ProgramManager to run trigger jobs with event data.\n\t*/\n\tasync runJob(source, jobName, args, options) {\n\t\tconst result = compileSource(this.applyParamOverridesToSource(source, args));\n\t\tif (!result.program) return {\n\t\t\tsuccess: false,\n\t\t\tdata: {\n\t\t\t\terror: `Compilation failed: ${result.diagnostics.map((d) => d.message).join(\"; \") || \"unknown error\"}`,\n\t\t\t\tdiagnostics: result.diagnostics\n\t\t\t}\n\t\t};\n\t\tconst job = result.program.units.find((u) => u.kind === \"job\" && u.name === jobName);\n\t\tif (!job || job.kind !== \"job\") return {\n\t\t\tsuccess: false,\n\t\t\tdata: { error: `Job \"${jobName}\" not found in source` }\n\t\t};\n\t\tconst afsOverride = options?.afsOverride;\n\t\tconst { world, written } = await this.createAsyncWorld(afsOverride);\n\t\tconst effectiveAFS = afsOverride ?? this.afsRoot;\n\t\tconst bridgedWorld = effectiveAFS ? {\n\t\t\tread: (path, query) => readAfsRecords(effectiveAFS, world, path, query),\n\t\t\twrite: (path, data) => {\n\t\t\t\tworld.write(path, data);\n\t\t\t},\n\t\t\tpublish: (topic, data) => {\n\t\t\t\tworld.publish(topic, data);\n\t\t\t},\n\t\t\texec: world.exec\n\t\t} : world;\n\t\tlet outputResult;\n\t\tconst ctx = {\n\t\t\tworld: bridgedWorld,\n\t\t\tcaps: new Set([\"*\"]),\n\t\t\tlogger: { log() {} },\n\t\t\toutput: { output(event$1) {\n\t\t\t\toutputResult = event$1.content;\n\t\t\t} }\n\t\t};\n\t\tconst event = args.event;\n\t\tconst initialStream = event ? [{ ...event }] : [];\n\t\tconst jobResult = await job.execute(ctx, initialStream);\n\t\tconst afs = effectiveAFS;\n\t\tif (afs?.write) for (const [path, data] of Object.entries(written)) if (path.endsWith(\".log\")) {\n\t\t\tconst content = `${data.map((item) => JSON.stringify(item)).join(\"\\n\")}\\n`;\n\t\t\tawait afs.write(path, { content }, { mode: \"append\" });\n\t\t} else await afs.write(path, { content: JSON.stringify(data) });\n\t\tif (jobResult.status !== \"ok\") return {\n\t\t\tsuccess: false,\n\t\t\tdata: {\n\t\t\t\terror: `Job \"${jobName}\" failed`,\n\t\t\t\tstatus: jobResult.status,\n\t\t\t\terrors: jobResult.errors\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tjob: jobName,\n\t\t\t\trecordCount: jobResult.recordCount,\n\t\t\t\t...outputResult !== void 0 ? { result: outputResult } : {}\n\t\t\t}\n\t\t};\n\t}\n\tasync runAsh(source, args, options) {\n\t\tconst result = compileSource(this.applyParamOverridesToSource(source, args));\n\t\tif (result.diagnostics.filter((d) => d.severity !== \"warning\").length > 0 || !result.program) {\n\t\t\tconst sanitizedDiags = result.diagnostics.map((d) => ({\n\t\t\t\t...d,\n\t\t\t\tmessage: sanitizeErrorPath(d.message)\n\t\t\t}));\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tdata: {\n\t\t\t\t\terror: `Compilation failed: ${sanitizedDiags.filter((d) => d.severity !== \"warning\").map((d) => d.message).join(\"; \") || \"unknown error\"}`,\n\t\t\t\t\tdiagnostics: sanitizedDiags,\n\t\t\t\t\tsourceHash: result.sourceHash\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst expectedHash = args.expectedHash;\n\t\tif (typeof expectedHash === \"string\" && expectedHash !== result.sourceHash) return {\n\t\t\tsuccess: false,\n\t\t\tdata: {\n\t\t\t\terror: \"Source hash mismatch — code was modified between validate and run (TOCTOU)\",\n\t\t\t\texpectedHash,\n\t\t\t\tactualHash: result.sourceHash\n\t\t\t}\n\t\t};\n\t\tconst capsArg = args.caps;\n\t\tconst caps = Array.isArray(capsArg) && capsArg.every((c) => typeof c === \"string\") ? new Set(capsArg) : new Set([\"*\"]);\n\t\tconst afsOverride = options?.afsOverride;\n\t\tconst { world, written, published, writeCounts, flushPersist } = await this.createAsyncWorld(afsOverride);\n\t\tconst effectiveAFS = afsOverride ?? this.afsRoot;\n\t\tconst bridgedWorld = effectiveAFS ? {\n\t\t\tread: (path, query) => readAfsRecords(effectiveAFS, world, path, query),\n\t\t\twrite: (path, data) => {\n\t\t\t\tworld.write(path, data);\n\t\t\t},\n\t\t\tpublish: (topic, data) => {\n\t\t\t\tworld.publish(topic, data);\n\t\t\t},\n\t\t\texec: world.exec\n\t\t} : world;\n\t\tconst logs = [];\n\t\tconst logger = { log(stage, action, detail) {\n\t\t\tlogs.push({\n\t\t\t\tstage,\n\t\t\t\taction,\n\t\t\t\tdetail\n\t\t\t});\n\t\t} };\n\t\tconst outputs = [];\n\t\tconst ctx = {\n\t\t\tworld: bridgedWorld,\n\t\t\tcaps,\n\t\t\tlogger,\n\t\t\toutput: { output(event) {\n\t\t\t\toutputs.push(event.content);\n\t\t\t} }\n\t\t};\n\t\tconst jobResults = [];\n\t\tfor (const unit of result.program.units) if (unit.kind === \"job\") {\n\t\t\tif (result.program.routeTargets?.has(unit.name)) continue;\n\t\t\tif (unit.trigger) continue;\n\t\t\tjobResults.push(await unit.execute(ctx));\n\t\t} else await unit.execute(ctx);\n\t\tconst sanitizedJobs = jobResults.map(({ stages, ...rest }) => rest);\n\t\tconst allOk = jobResults.every((r) => r.status === \"ok\");\n\t\tconst allErrors = jobResults.flatMap((r) => r.errors).map(sanitizeErrorPath);\n\t\tconst afs = afsOverride ?? this.afsRoot;\n\t\tconst skipPrefix = options?.skipWritePrefix;\n\t\tif (afs?.write && options?.allowWriteBack !== false) {\n\t\t\tfor (const [path, data] of Object.entries(written)) {\n\t\t\t\tif (skipPrefix && path.startsWith(skipPrefix)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tif (path.endsWith(\".log\")) {\n\t\t\t\t\t\tconst content = `${data.map((item) => JSON.stringify(item)).join(\"\\n\")}\\n`;\n\t\t\t\t\t\tawait afs.write(path, { content }, { mode: \"append\" });\n\t\t\t\t\t} else await afs.write(path, { content: JSON.stringify(data) });\n\t\t\t\t} catch {\n\t\t\t\t\tallErrors.push(\"Failed to write to AFS\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [topic, data] of Object.entries(published)) try {\n\t\t\t\tawait afs.write(topic, { content: JSON.stringify(data) });\n\t\t\t} catch {\n\t\t\t\tallErrors.push(\"Failed to publish to AFS\");\n\t\t\t}\n\t\t}\n\t\tconst overwrittenPaths = Object.entries(writeCounts).filter(([, count]) => count > 1).map(([path, count]) => sanitizeErrorPath(`Path '${path}' was written ${count} times — only last write preserved`));\n\t\tif (overwrittenPaths.length > 0) allErrors.push(...overwrittenPaths);\n\t\tawait flushPersist();\n\t\treturn {\n\t\t\tsuccess: allOk && allErrors.length === 0 && overwrittenPaths.length === 0,\n\t\t\tdata: {\n\t\t\t\tjobs: sanitizedJobs,\n\t\t\t\twritten: Object.keys(written),\n\t\t\t\tpublished: Object.keys(published),\n\t\t\t\toutputs,\n\t\t\t\terrors: allErrors.length > 0 ? allErrors : void 0,\n\t\t\t\twarnings: result.diagnostics.filter((d) => d.severity === \"warning\").map((d) => ({\n\t\t\t\t\t...d,\n\t\t\t\t\tmessage: sanitizeErrorPath(d.message)\n\t\t\t\t})),\n\t\t\t\tsourceHash: result.sourceHash,\n\t\t\t\t...options?.returnWrittenData ? { writtenData: written } : {}\n\t\t\t}\n\t\t};\n\t}\n\tapplyParamOverridesToSource(source, args) {\n\t\tconst lines = source.split(\"\\n\");\n\t\tlet changed = false;\n\t\tconst replaced = lines.map((line) => {\n\t\t\tconst match = /^(\\s*param\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*=\\s*)(.+)$/.exec(line);\n\t\t\tif (!match) return line;\n\t\t\tconst [, prefix, name] = match;\n\t\t\tif (!name) return line;\n\t\t\tconst value = args[name];\n\t\t\tif (typeof value !== \"string\" && typeof value !== \"number\") return line;\n\t\t\tchanged = true;\n\t\t\treturn `${prefix}${typeof value === \"string\" ? JSON.stringify(value) : String(value)}`;\n\t\t});\n\t\treturn changed ? replaced.join(\"\\n\") : source;\n\t}\n};\n__decorate([List(\"/\")], AFSAsh.prototype, \"listRoot\", null);\n__decorate([List(\"/scripts\")], AFSAsh.prototype, \"listScripts\", null);\n__decorate([List(\"/scripts/:scriptName\")], AFSAsh.prototype, \"listScript\", null);\n__decorate([Actions(\"/\")], AFSAsh.prototype, \"listRootActions\", null);\n__decorate([Actions(\"/scripts/:scriptName\")], AFSAsh.prototype, \"listScriptActions\", null);\n__decorate([Read(\"/\")], AFSAsh.prototype, \"readRoot\", null);\n__decorate([Read(\"/scripts\")], AFSAsh.prototype, \"readScriptsDir\", null);\n__decorate([Read(\"/scripts/:scriptName\")], AFSAsh.prototype, \"readScript\", null);\n__decorate([List(\"/cookbook\")], AFSAsh.prototype, \"listCookbook\", null);\n__decorate([Read(\"/cookbook\")], AFSAsh.prototype, \"readCookbookDir\", null);\n__decorate([List(\"/cookbook/:file\")], AFSAsh.prototype, \"listCookbookFile\", null);\n__decorate([Read(\"/cookbook/:file\")], AFSAsh.prototype, \"readCookbook\", null);\n__decorate([Read(\"/.meta/agent.md\")], AFSAsh.prototype, \"readAgentMd\", null);\n__decorate([Read(\"/.meta/.ash-reference\")], AFSAsh.prototype, \"readAshReference\", null);\n__decorate([Read(\"/.meta/.capabilities\")], AFSAsh.prototype, \"readCapabilities\", null);\n__decorate([Meta(\"/\")], AFSAsh.prototype, \"readRootMeta\", null);\n__decorate([Meta(\"/cookbook\")], AFSAsh.prototype, \"readCookbookMeta\", null);\n__decorate([Meta(\"/cookbook/:file\")], AFSAsh.prototype, \"readCookbookFileMeta\", null);\n__decorate([Meta(\"/scripts\")], AFSAsh.prototype, \"readScriptsMeta\", null);\n__decorate([Meta(\"/scripts/:scriptName\")], AFSAsh.prototype, \"readScriptMeta\", null);\n__decorate([Write(\"/scripts/:scriptName\")], AFSAsh.prototype, \"writeScript\", null);\n__decorate([Delete(\"/scripts/:scriptName\")], AFSAsh.prototype, \"deleteScript\", null);\n__decorate([Delete(\"/:path*\")], AFSAsh.prototype, \"deleteCatchAll\", null);\n__decorate([Actions.Exec(\"/scripts/:scriptName\", \"exec\", void 0, { effect: \"write\" })], AFSAsh.prototype, \"execScript\", null);\n__decorate([Exec(\"/scripts/:scriptName\")], AFSAsh.prototype, \"execScriptDirect\", null);\n__decorate([Actions.Exec(\"/\", void 0, void 0, { effect: \"write\" })], AFSAsh.prototype, \"execRootAction\", null);\n__decorate([Stat(\"/\")], AFSAsh.prototype, \"statRoot\", null);\n__decorate([Stat(\"/scripts\")], AFSAsh.prototype, \"statScriptsDir\", null);\n__decorate([Stat(\"/scripts/:scriptName\")], AFSAsh.prototype, \"statScript\", null);\n__decorate([Explain(\"/\")], AFSAsh.prototype, \"explainRoot\", null);\n__decorate([Explain(\"/scripts/:scriptName\")], AFSAsh.prototype, \"explainScript\", null);\n__decorate([Search(\"/:path*\")], AFSAsh.prototype, \"searchScripts\", null);\nvar src_default = AFSAsh;\n\n//#endregion\nexport { AFSAsh, src_default as default, deriveToolsFromProgram, intersectTools, matchPath, validateActionPath, validateToolCall, withQueryPairing };\n//# sourceMappingURL=index.mjs.map"],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AAO,WAAW,mBAAmB,KAAK;AACzE,WAAW,CAAC,KAAK,uBAAuB,CAAC,EAAE,OAAO,WAAW,kBAAkB,KAAK;AACpF,WAAW,CAAC,MAAM,uBAAuB,CAAC,EAAE,OAAO,WAAW,eAAe,KAAK;AAClF,WAAW,CAAC,OAAO,uBAAuB,CAAC,EAAE,OAAO,WAAW,gBAAgB,KAAK;AACpF,WAAW,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,WAAW,kBAAkB,KAAK;AACzE,WAAW,CAAC,QAAQ,KAAK,wBAAwB,QAAQ,KAAK,GAAG,EAAE,QAAQ,SAAS,CAAC,CAAC,EAAE,OAAO,WAAW,cAAc,KAAK;AAC7H,WAAW,CAAC,KAAK,uBAAuB,CAAC,EAAE,OAAO,WAAW,oBAAoB,KAAK;AACtF,WAAW,CAAC,QAAQ,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,EAAE,QAAQ,SAAS,CAAC,CAAC,EAAE,OAAO,WAAW,kBAAkB,KAAK;AAC9G,WAAW,CAAC,KAAK,IAAI,CAAC,EAAE,OAAO,WAAW,YAAY,KAAK;AAC3D,WAAW,CAAC,KAAK,WAAW,CAAC,EAAE,OAAO,WAAW,kBAAkB,KAAK;AACxE,WAAW,CAAC,KAAK,uBAAuB,CAAC,EAAE,OAAO,WAAW,cAAc,KAAK;AAChF,WAAW,CAAC,QAAQ,IAAI,CAAC,EAAE,OAAO,WAAW,eAAe,KAAK;AACjE,WAAW,CAAC,QAAQ,uBAAuB,CAAC,EAAE,OAAO,WAAW,iBAAiB,KAAK;AACtF,WAAW,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,WAAW,iBAAiB,KAAK"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aigne/agent-runtime",
|
|
3
|
+
"version": "1.12.0-beta.5",
|
|
4
|
+
"description": "Agent dispatch + runners extracted from arc-cli — ai/ash/team/orchestrator runners plus registerAgentActions/Subscribes wiring",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"author": "Arcblock <blocklet@arcblock.io> https://github.com/arcblock",
|
|
10
|
+
"homepage": "https://github.com/arcblock/arc",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/arcblock/arc"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/arcblock/arc/issues"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.mjs",
|
|
21
|
+
"types": "./dist/index.d.cts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"require": "./dist/index.cjs",
|
|
25
|
+
"import": "./dist/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./*": "./*"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@aigne/uuid": "^13.0.1",
|
|
37
|
+
"croner": "^10.0.1",
|
|
38
|
+
"js-yaml": "^4.1.1",
|
|
39
|
+
"ufo": "^1.6.3",
|
|
40
|
+
"zod": "^4.0.0",
|
|
41
|
+
"@aigne/afs": "1.12.0-beta.5",
|
|
42
|
+
"@aigne/afs-agent": "1.11.0-beta.13",
|
|
43
|
+
"@aigne/afs-index": "1.12.0-beta.5",
|
|
44
|
+
"@aigne/afs-memory": "1.12.0-beta.5",
|
|
45
|
+
"@aigne/ash": "0.0.2-beta.5"
|
|
46
|
+
},
|
|
47
|
+
"optionalDependencies": {
|
|
48
|
+
"@aigne/afs-ash": "1.12.0-beta.5"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/bun": "^1.3.6",
|
|
52
|
+
"@types/js-yaml": "^4.0.9",
|
|
53
|
+
"npm-run-all": "^4.1.5",
|
|
54
|
+
"rimraf": "^6.1.2",
|
|
55
|
+
"tsdown": "0.20.0-beta.3",
|
|
56
|
+
"typescript": "5.9.2",
|
|
57
|
+
"@aigne/afs-ash": "1.12.0-beta.5",
|
|
58
|
+
"@aigne/afs-fs": "1.12.0-beta.5",
|
|
59
|
+
"@aigne/typescript-config": "0.0.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsdown",
|
|
63
|
+
"check-types": "tsc --noEmit",
|
|
64
|
+
"clean": "rimraf dist",
|
|
65
|
+
"test": "bun test"
|
|
66
|
+
}
|
|
67
|
+
}
|