@tangle-network/agent-runtime 0.71.1 → 0.72.0
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/README.md +8 -8
- package/dist/agent.d.ts +27 -17
- package/dist/agent.js +19 -8
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/{chunk-5ISW5JUF.js → chunk-55WKGOGU.js} +1907 -6534
- package/dist/chunk-55WKGOGU.js.map +1 -0
- package/dist/{chunk-K3RM4MPM.js → chunk-HXVMLRYU.js} +5 -20
- package/dist/chunk-HXVMLRYU.js.map +1 -0
- package/dist/chunk-PBE35ULD.js +52 -0
- package/dist/chunk-PBE35ULD.js.map +1 -0
- package/dist/chunk-PHKNOAOU.js +4021 -0
- package/dist/chunk-PHKNOAOU.js.map +1 -0
- package/dist/chunk-UZ5SODU7.js +29 -0
- package/dist/chunk-UZ5SODU7.js.map +1 -0
- package/dist/{chunk-4KGQHS7U.js → chunk-VYXBFWHZ.js} +2 -18
- package/dist/chunk-VYXBFWHZ.js.map +1 -0
- package/dist/{delegates-CsXJPZDH.d.ts → coordination-CFVF0OzX.d.ts} +869 -1099
- package/dist/index.d.ts +7 -8
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +1 -1
- package/dist/{loop-runner-bin-DLM_bVQO.d.ts → loop-runner-bin-B7biH0Gk.d.ts} +10 -27
- package/dist/loop-runner-bin.d.ts +5 -6
- package/dist/loop-runner-bin.js +3 -4
- package/dist/loops.d.ts +10 -9
- package/dist/loops.js +43 -41
- package/dist/mcp/bin.js +13 -326
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +10 -190
- package/dist/mcp/index.js +948 -47
- package/dist/mcp/index.js.map +1 -1
- package/dist/{openai-tools-kdCS-T12.d.ts → openai-tools-DOI5mKNw.d.ts} +11 -13
- package/dist/otel-export-BKmNwiCb.d.ts +180 -0
- package/dist/profiles.d.ts +3 -3
- package/dist/profiles.js +1 -5
- package/dist/profiles.js.map +1 -1
- package/dist/{substrate-BoRXgvka.d.ts → substrate-rNj6TDc3.d.ts} +7 -23
- package/dist/{types-CdnEAE3U.d.ts → types-K8-xkiw1.d.ts} +1 -1
- package/dist/worktree-JXGJ1MxQ.d.ts +702 -0
- package/dist/{worktree-fanout-CK2ypmEm.d.ts → worktree-fanout-DJHQy7Ux.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-4KGQHS7U.js.map +0 -1
- package/dist/chunk-5ISW5JUF.js.map +0 -1
- package/dist/chunk-74UAWZXE.js +0 -278
- package/dist/chunk-74UAWZXE.js.map +0 -1
- package/dist/chunk-DVQGYDN5.js +0 -59
- package/dist/chunk-DVQGYDN5.js.map +0 -1
- package/dist/chunk-INXDNX2W.js +0 -475
- package/dist/chunk-INXDNX2W.js.map +0 -1
- package/dist/chunk-K3RM4MPM.js.map +0 -1
- package/dist/chunk-XRYEZPR6.js +0 -88
- package/dist/chunk-XRYEZPR6.js.map +0 -1
- package/dist/coordination-BPQmuwv8.d.ts +0 -666
- package/dist/delegation-profile-Bvfro2m1.d.ts +0 -99
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/profiles/coder.ts
|
|
2
|
+
var DEFAULT_MAX_DIFF_LINES = 400;
|
|
3
|
+
function coderTaskToPrompt(task) {
|
|
4
|
+
const base = task.baseBranch ?? "main";
|
|
5
|
+
const testCmd = task.testCmd ?? "pnpm test --run";
|
|
6
|
+
const typecheckCmd = task.typecheckCmd ?? "pnpm typecheck";
|
|
7
|
+
const maxDiff = task.maxDiffLines ?? DEFAULT_MAX_DIFF_LINES;
|
|
8
|
+
const forbidden = task.forbiddenPaths?.length ? task.forbiddenPaths.join(", ") : "(none)";
|
|
9
|
+
const context = task.contextFiles?.length ? task.contextFiles.map((f) => ` - ${f}`).join("\n") : " (none)";
|
|
10
|
+
return [
|
|
11
|
+
`Goal: ${task.goal}`,
|
|
12
|
+
`Repo: ${task.repoRoot}`,
|
|
13
|
+
`Base branch: ${base}`,
|
|
14
|
+
`Run tests with: ${testCmd}`,
|
|
15
|
+
`Run typecheck with: ${typecheckCmd}`,
|
|
16
|
+
`Forbidden paths: ${forbidden}`,
|
|
17
|
+
`Max diff lines: ${maxDiff}`,
|
|
18
|
+
"Context files:",
|
|
19
|
+
context,
|
|
20
|
+
"",
|
|
21
|
+
"Produce a minimal patch on a fresh branch. Run tests and typecheck before",
|
|
22
|
+
"returning. Emit the final JSON result block exactly as instructed."
|
|
23
|
+
].join("\n");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
coderTaskToPrompt
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-UZ5SODU7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/profiles/coder.ts"],"sourcesContent":["/**\n * @experimental\n *\n * `CoderTask` + `coderTaskToPrompt` — the per-task DATA + pure formatter for code-modification tasks\n * (§1.5: the system authors profiles; there is no hardcoded coder profile constant). A domain\n * customizes the worker by authoring its own `AgentProfile` and handing it to a leaf executor\n * (`createWorktreeCliExecutor`) or a fanout (`worktreeFanout`); \"is it delivered\" is a\n * `DeliverableSpec` (`patchDelivered`), not a bundled validator. This formatter renders a `CoderTask`\n * into the per-task instruction that profile receives.\n */\n\nconst DEFAULT_MAX_DIFF_LINES = 400\n\n/** @experimental The per-task inputs `coderTaskToPrompt` renders + the worktree gate enforces. */\nexport interface CoderTask {\n /** What the agent must accomplish. Free-form prose. */\n goal: string\n /** Absolute path inside the sandbox where the repo lives. */\n repoRoot: string\n /** Default `main`. The branch the agent diffs against. */\n baseBranch?: string\n /** Default `pnpm test --run`. */\n testCmd?: string\n /** Default `pnpm typecheck`. */\n typecheckCmd?: string\n /** Files the agent may inspect for context. Surfaced verbatim in the prompt. */\n contextFiles?: string[]\n /**\n * Paths the agent must not touch. The mechanical gate hard-fails on any match.\n * Use glob-free literal path prefixes for unambiguous enforcement.\n */\n forbiddenPaths?: string[]\n /** Default 400. Hard cap; the gate hard-fails when exceeded. */\n maxDiffLines?: number\n}\n\n/** @experimental Render a `CoderTask` into the per-task instruction handed to the coder profile. */\nexport function coderTaskToPrompt(task: CoderTask): string {\n const base = task.baseBranch ?? 'main'\n const testCmd = task.testCmd ?? 'pnpm test --run'\n const typecheckCmd = task.typecheckCmd ?? 'pnpm typecheck'\n const maxDiff = task.maxDiffLines ?? DEFAULT_MAX_DIFF_LINES\n const forbidden = task.forbiddenPaths?.length ? task.forbiddenPaths.join(', ') : '(none)'\n const context = task.contextFiles?.length\n ? task.contextFiles.map((f) => ` - ${f}`).join('\\n')\n : ' (none)'\n return [\n `Goal: ${task.goal}`,\n `Repo: ${task.repoRoot}`,\n `Base branch: ${base}`,\n `Run tests with: ${testCmd}`,\n `Run typecheck with: ${typecheckCmd}`,\n `Forbidden paths: ${forbidden}`,\n `Max diff lines: ${maxDiff}`,\n 'Context files:',\n context,\n '',\n 'Produce a minimal patch on a fresh branch. Run tests and typecheck before',\n 'returning. Emit the final JSON result block exactly as instructed.',\n ].join('\\n')\n}\n"],"mappings":";AAWA,IAAM,yBAAyB;AA0BxB,SAAS,kBAAkB,MAAyB;AACzD,QAAM,OAAO,KAAK,cAAc;AAChC,QAAM,UAAU,KAAK,WAAW;AAChC,QAAM,eAAe,KAAK,gBAAgB;AAC1C,QAAM,UAAU,KAAK,gBAAgB;AACrC,QAAM,YAAY,KAAK,gBAAgB,SAAS,KAAK,eAAe,KAAK,IAAI,IAAI;AACjF,QAAM,UAAU,KAAK,cAAc,SAC/B,KAAK,aAAa,IAAI,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,KAAK,IAAI,IAClD;AACJ,SAAO;AAAA,IACL,SAAS,KAAK,IAAI;AAAA,IAClB,SAAS,KAAK,QAAQ;AAAA,IACtB,gBAAgB,IAAI;AAAA,IACpB,mBAAmB,OAAO;AAAA,IAC1B,uBAAuB,YAAY;AAAA,IACnC,oBAAoB,SAAS;AAAA,IAC7B,mBAAmB,OAAO;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DELEGATE_CODE_DESCRIPTION,
|
|
3
|
-
DELEGATE_CODE_INPUT_SCHEMA,
|
|
4
|
-
DELEGATE_CODE_TOOL_NAME,
|
|
5
2
|
DELEGATE_FEEDBACK_DESCRIPTION,
|
|
6
3
|
DELEGATE_FEEDBACK_INPUT_SCHEMA,
|
|
7
4
|
DELEGATE_FEEDBACK_TOOL_NAME,
|
|
8
|
-
DELEGATE_RESEARCH_DESCRIPTION,
|
|
9
|
-
DELEGATE_RESEARCH_INPUT_SCHEMA,
|
|
10
|
-
DELEGATE_RESEARCH_TOOL_NAME,
|
|
11
5
|
DELEGATION_HISTORY_DESCRIPTION,
|
|
12
6
|
DELEGATION_HISTORY_INPUT_SCHEMA,
|
|
13
7
|
DELEGATION_HISTORY_TOOL_NAME,
|
|
14
8
|
DELEGATION_STATUS_DESCRIPTION,
|
|
15
9
|
DELEGATION_STATUS_INPUT_SCHEMA,
|
|
16
10
|
DELEGATION_STATUS_TOOL_NAME
|
|
17
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-55WKGOGU.js";
|
|
18
12
|
|
|
19
13
|
// src/mcp/openai-tools.ts
|
|
20
14
|
function buildTool(name, description, parameters) {
|
|
@@ -25,16 +19,6 @@ function buildTool(name, description, parameters) {
|
|
|
25
19
|
}
|
|
26
20
|
function mcpToolsForRuntimeMcp() {
|
|
27
21
|
return [
|
|
28
|
-
buildTool(
|
|
29
|
-
DELEGATE_CODE_TOOL_NAME,
|
|
30
|
-
DELEGATE_CODE_DESCRIPTION,
|
|
31
|
-
DELEGATE_CODE_INPUT_SCHEMA
|
|
32
|
-
),
|
|
33
|
-
buildTool(
|
|
34
|
-
DELEGATE_RESEARCH_TOOL_NAME,
|
|
35
|
-
DELEGATE_RESEARCH_DESCRIPTION,
|
|
36
|
-
DELEGATE_RESEARCH_INPUT_SCHEMA
|
|
37
|
-
),
|
|
38
22
|
buildTool(
|
|
39
23
|
DELEGATE_FEEDBACK_TOOL_NAME,
|
|
40
24
|
DELEGATE_FEEDBACK_DESCRIPTION,
|
|
@@ -61,4 +45,4 @@ export {
|
|
|
61
45
|
mcpToolsForRuntimeMcp,
|
|
62
46
|
mcpToolsForRuntimeMcpSubset
|
|
63
47
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-VYXBFWHZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n * @experimental\n *\n * OpenAI Chat Completions `tools[]` projection of the queue-bound agent-runtime\n * MCP delegation tools.\n *\n * Use when configuring `createOpenAICompatibleBackend({ tools: ... })` so the\n * model can call `delegate_feedback`, `delegation_status`, and\n * `delegation_history` through the OpenAI-compat transport (tcloud, OpenRouter,\n * OpenAI direct, cli-bridge). The runtime surfaces tool calls as `tool_call`\n * stream events — execution is the caller's responsibility (typically the\n * parent sandbox runtime's MCP mount).\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compat backend JSON-serializes the body so a shallow copy\n // into a plain object is sufficient — and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n * @experimental\n *\n * Returns the queue-bound delegation tools projected into OpenAI Chat\n * Completions `tools[]` shape. The order is stable: `delegate_feedback`,\n * `delegation_status`, `delegation_history`.\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n * @experimental\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAAS,UACP,MACA,aACA,YACgB;AAKhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,EAAE,MAAM,aAAa,YAAY,EAAE,GAAG,WAAW,EAAE;AAAA,EAC/D;AACF;AASO,SAAS,wBAA0C;AACxD,SAAO;AAAA,IACL;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAUO,SAAS,4BAA4B,OAAgD;AAC1F,QAAM,UAAU,IAAI,IAAI,KAAK;AAC7B,SAAO,sBAAsB,EAAE,OAAO,CAAC,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF;","names":[]}
|