@tangle-network/agent-runtime 0.170.0 → 0.171.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.
Files changed (43) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +1 -1
  3. package/dist/{authored-code-C2TGxNtf.js → authored-code-DzYtiflw.js} +9 -16
  4. package/dist/authored-code-DzYtiflw.js.map +1 -0
  5. package/dist/{authoring-CUTgAxxE.js → authoring-U8BvENNa.js} +2 -2
  6. package/dist/{authoring-CUTgAxxE.js.map → authoring-U8BvENNa.js.map} +1 -1
  7. package/dist/durable.d.ts +1 -1
  8. package/dist/durable.js +1 -1
  9. package/dist/{graph-ZDMygFIo.js → graph-DK_za3yj.js} +2 -2
  10. package/dist/{graph-ZDMygFIo.js.map → graph-DK_za3yj.js.map} +1 -1
  11. package/dist/graph.d.ts +25 -85
  12. package/dist/graph.js +4 -157
  13. package/dist/graph.js.map +1 -1
  14. package/dist/{index-BgptUCKl.d.ts → index-C38CMh7Y.d.ts} +2 -2
  15. package/dist/{index-BGQtpQuJ.d.ts → index-CTIWK6cQ.d.ts} +59 -2
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.js +4 -4
  18. package/dist/kernel.d.ts +2 -2
  19. package/dist/kernel.js +5 -5
  20. package/dist/{knowledge-D3211Z_x.js → knowledge-CbSzAeP-.js} +2 -2
  21. package/dist/{knowledge-D3211Z_x.js.map → knowledge-CbSzAeP-.js.map} +1 -1
  22. package/dist/knowledge.d.ts +1 -1
  23. package/dist/knowledge.js +1 -1
  24. package/dist/{loop-runner-bin-B_g5JOKA.js → loop-runner-bin-CglWRAZs.js} +2 -2
  25. package/dist/{loop-runner-bin-B_g5JOKA.js.map → loop-runner-bin-CglWRAZs.js.map} +1 -1
  26. package/dist/{loop-runner-bin-C2NXQK7J.d.ts → loop-runner-bin-CxXDdDd8.d.ts} +2 -2
  27. package/dist/loop-runner-bin.d.ts +1 -1
  28. package/dist/loop-runner-bin.js +1 -1
  29. package/dist/mcp/bin.js +2 -2
  30. package/dist/mcp/index.d.ts +1 -1
  31. package/dist/mcp/index.js +3 -3
  32. package/dist/{openai-tools-UyXVO0kd.js → openai-tools-B_zjkAey.js} +2 -2
  33. package/dist/{openai-tools-UyXVO0kd.js.map → openai-tools-B_zjkAey.js.map} +1 -1
  34. package/dist/{runtime-C-7uhhFs.js → runtime-DWs-CucB.js} +246 -6
  35. package/dist/runtime-DWs-CucB.js.map +1 -0
  36. package/dist/{supervise-rEE46ruH.js → supervise-CG7JDcEG.js} +11 -2
  37. package/dist/{supervise-rEE46ruH.js.map → supervise-CG7JDcEG.js.map} +1 -1
  38. package/dist/testing.d.ts +1 -1
  39. package/dist/testing.js +10 -10
  40. package/package.json +1 -1
  41. package/skills/codemode/SKILL.md +5 -4
  42. package/dist/authored-code-C2TGxNtf.js.map +0 -1
  43. package/dist/runtime-C-7uhhFs.js.map +0 -1
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $t as RunGraphTestOptions, Ao as supervisorAgentWithTestBrain, Mn as driverAgent, co as SuperviseTestOptions, jn as DriverAgentOptions, rn as runGraphWithTestBrain, uo as superviseWithTestBrain, xo as SupervisorAgentTestDeps } from "./index-BGQtpQuJ.js";
1
+ import { $t as RunGraphTestOptions, Eo as SupervisorAgentTestDeps, Fo as supervisorAgentWithTestBrain, Mn as driverAgent, fo as SuperviseTestOptions, jn as DriverAgentOptions, mo as superviseWithTestBrain, rn as runGraphWithTestBrain } from "./index-CTIWK6cQ.js";
2
2
  import { _t as ToolLoopChat, gt as ToolLoopCallContext } from "./runtime-B0HZbuEv.js";
3
3
  import { AgentImprovementProposal, AgentProfile, AgentProfileImprovementMeasuredComparison, SandboxSizePreset } from "@tangle-network/agent-interface";
4
4
  //#region src/testing/index.d.ts
package/dist/testing.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { ct as immutableCandidateValue, et as parseExactAgentProfile, it as canonicalCandidateDigest$1, q as applyExactAgentProfileDiff } from "./prepare-BAyaNoZu.js";
2
2
  import { f as verifyAgentImprovementProposal } from "./improvement-cycle-BYCnKZ_G.js";
3
- import { c as supervisorAgentWithTestBrain, ft as driverAgent, r as superviseWithTestBrain } from "./supervise-rEE46ruH.js";
4
- import { i as runGraphWithTestBrain } from "./graph-ZDMygFIo.js";
3
+ import { c as supervisorAgentWithTestBrain, ft as driverAgent, r as superviseWithTestBrain } from "./supervise-CG7JDcEG.js";
4
+ import { i as runGraphWithTestBrain } from "./graph-DK_za3yj.js";
5
5
  import { SANDBOX_SIZE_PRESET_NAMES } from "@tangle-network/agent-interface";
6
6
  //#region src/testing/fixtures/agent-improvement-proposal.json
7
7
  var agent_improvement_proposal_default = {
8
8
  changedSurfaces: ["prompt"],
9
- digest: "sha256:62b716af557ebbb5fb1ac82cb343bef5d5d9333afc4dffaa642ef03a8023b047",
9
+ digest: "sha256:342108105db5ad0ae9cd1cd85776d1c335710fbd75ac025c9874967dde6e65bf",
10
10
  evaluation: {
11
11
  "decision": {
12
12
  "contributingChecks": [
@@ -4577,7 +4577,7 @@ var agent_improvement_proposal_default = {
4577
4577
  ],
4578
4578
  "metadata": {
4579
4579
  "fixture": "agent-improvement-proposal",
4580
- "runtimeVersion": "0.170.0"
4580
+ "runtimeVersion": "0.171.0"
4581
4581
  },
4582
4582
  "objectives": [
4583
4583
  {
@@ -4688,8 +4688,8 @@ var agent_improvement_proposal_default = {
4688
4688
  "baselineContentHash": "sha256:5c21ee53e513fc604cb09754e21c392b24a424da0ef37dbf8f1ee4a8a0b08f09",
4689
4689
  "candidateContentHash": "sha256:60fcbb1c728194bd51d7d19cb732d1c3f1881dce7e0a6266b41c8b98cfd65693",
4690
4690
  "kind": "agent-eval-loop",
4691
- "recordDigest": "sha256:9d28a3e26e57d69dd9798413154f710161b43b635bf0b19f182aa87fb3c390af",
4692
- "runId": "agent-runtime-0.170.0-proposal-fixture",
4691
+ "recordDigest": "sha256:38f585a34166bf8586f9fb55b715bf5652053e9b7369b9f6c31568452269aff5",
4692
+ "runId": "agent-runtime-0.171.0-proposal-fixture",
4693
4693
  "schema": "agent-candidate-experiment"
4694
4694
  }
4695
4695
  },
@@ -4712,13 +4712,13 @@ var agent_improvement_proposal_default = {
4712
4712
  }],
4713
4713
  kind: "agent-improvement-proposal",
4714
4714
  proposedAt: "2026-07-10T01:00:00.000Z",
4715
- runId: "agent-runtime-0.170.0-proposal-fixture"
4715
+ runId: "agent-runtime-0.171.0-proposal-fixture"
4716
4716
  };
4717
4717
  //#endregion
4718
4718
  //#region src/testing/fixtures/agent-profile-improvement-proposal.json
4719
4719
  var agent_profile_improvement_proposal_default = {
4720
4720
  changedSurfaces: ["prompt", "skills"],
4721
- digest: "sha256:6f1d98a819ac4bb1c873eb79ea0e430acee97f1dd11714dacb32b27b9f46748c",
4721
+ digest: "sha256:c647b2077aae2e6e321798155c75304dfdc65a4dd1bdfc92a205b9945dfb6e12",
4722
4722
  evaluation: {
4723
4723
  "decision": {
4724
4724
  "contributingChecks": [
@@ -6352,7 +6352,7 @@ var agent_profile_improvement_proposal_default = {
6352
6352
  ],
6353
6353
  "metadata": {
6354
6354
  "fixture": "agent-profile-improvement-proposal",
6355
- "runtimeVersion": "0.170.0"
6355
+ "runtimeVersion": "0.171.0"
6356
6356
  },
6357
6357
  "objectives": [
6358
6358
  {
@@ -6463,7 +6463,7 @@ var agent_profile_improvement_proposal_default = {
6463
6463
  "baselineContentHash": "sha256:21c495a37c418c10bde64fbaa188beddeed31f1f051ea60a6a6582a9ee0db704",
6464
6464
  "candidateContentHash": "sha256:103f77bc8481601eef1ad5fe6ba84a40dffabc3a44f421f8c8559121edab84e9",
6465
6465
  "kind": "agent-eval-loop",
6466
- "recordDigest": "sha256:1e7e4b7cf942418b42ccb1eae9db4c237bce187aac1d8ac2fb63e76367e9e6c4",
6466
+ "recordDigest": "sha256:09957f0f38d2e31782c086daa91cf364f2df5239b05c1f7f53bb413e37eb2c1a",
6467
6467
  "runId": "profile-improvement-1",
6468
6468
  "schema": "agent-profile-improvement-experiment"
6469
6469
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.170.0",
3
+ "version": "0.171.0",
4
4
  "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {
@@ -28,11 +28,12 @@ A script that reaches those verbs over HTTP bypasses the budget pool and the jou
28
28
  An operation that costs money must run where the runtime meters it; do not wrap metered work in a script that hides the spend.
29
29
  The lint on authored code refuses imports, `process`, and network access; it is a lint, not a sandbox, so treat generated code you did not review as untrusted.
30
30
 
31
- ## Router-Brained Agents
31
+ ## Router-Brained Supervisors
32
32
 
33
- A raw chat model has no shell, so this policy does not apply to it directly.
34
- Give such a node a code action space with the graph engine's `codemode` kind: an `operations` table projects the API the model sees, a host `codeRunner` executes, and each operation's spend reaches the settlement.
35
- A supervisor that only needs one small computation can carry an `extraTools` entry instead of a codemode node.
33
+ A raw chat model has no shell, so give it the runtime's code mode: pass `codeModeSupervisorTools()` as `resolveSupervisorTools` and the supervisor's tool surface becomes `search` and `execute`.
34
+ `search` answers a TypeScript API generated from the live coordination grant; `execute` runs the model's program through a caller-supplied runner, and every `api.spawn_agent` call crosses the kernel's pool, authorization, and journal.
35
+ Supply a jailed runner for an untrusted model: the in-process runner is not an isolation boundary.
36
+ The lifecycle verbs (`submit_result`, `stop`, `ask_parent`) stay model tools: the program does the mechanics, the model keeps the judgment.
36
37
 
37
38
  ## Common Mistakes
38
39
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"authored-code-C2TGxNtf.js","names":[],"sources":["../src/runtime/authored-code.ts"],"sourcesContent":["/**\n * The ONE lint over model-authored source, and the fence extractor beside it.\n *\n * Two features have a model write code the runtime then runs: `authorStrategy` (an authored\n * optimization strategy, since 0.60) and the graph engine's `codemode` node (0.169.0). Both need\n * the same refusals; 0.169.0 shipped them as two byte-near copies that could drift independently,\n * which an audit flagged. This module is the single copy both import.\n *\n * A LINT, NOT A SANDBOX — it reads text and cannot constrain what running code does. Its job is\n * refusing the obvious escapes in the authored source so a bad program is rejected before\n * anything executes. Isolation, where required, is the execution boundary's job (a jailed\n * `codeRunner`, a sandboxed loader), never this check's.\n */\nimport { ValidationError } from '../errors'\n\nexport interface AuthoredCodeOptions {\n /** Import specifiers an authored module may name. Empty (the default) bans every import. A\n * specifier admits ANY import form of that module (named, namespace, default) — the lint\n * gates WHICH module, not the syntax used to reach it. */\n readonly allowedImports?: ReadonlyArray<string>\n /** Names the refusal, e.g. `codemode \"planner\"`. Defaults to `authored code`. */\n readonly context?: string\n}\n\n/** Refuse the obvious escapes in authored source. See the module doc for what this is NOT. */\nexport function assertAuthoredCode(code: string, options: AuthoredCodeOptions = {}): void {\n const context = options.context ?? 'authored code'\n const allowed = options.allowedImports ?? []\n for (const line of code.split('\\n')) {\n if (!/^\\s*import\\s/.test(line)) continue\n const named = allowed.some(\n (specifier) => line.includes(`'${specifier}'`) || line.includes(`\"${specifier}\"`),\n )\n if (!named) {\n throw new ValidationError(\n `${context} rejected: foreign import — ${line.trim().slice(0, 120)}${\n allowed.length === 0\n ? ' (no import is allowed here)'\n : ` (allowed: ${allowed.join(', ')})`\n }`,\n )\n }\n }\n const banned: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\brequire\\s*\\(/, 'require()'],\n [/\\bimport\\s*\\(/, 'dynamic import()'],\n [/\\beval\\s*\\(/, 'eval()'],\n [/new\\s+Function\\s*\\(/, 'new Function()'],\n [/\\bprocess\\s*[.[]/, 'process access'],\n [/\\bglobalThis\\s*[.[]/, 'globalThis access'],\n [/\\bfetch\\s*\\(/, 'network access'],\n [/child_process|node:fs|node:net|node:http|worker_threads/, 'node builtin access'],\n ]\n for (const [pattern, what] of banned) {\n if (pattern.test(code)) throw new ValidationError(`${context} rejected: ${what}`)\n }\n}\n\n/** Pull the first fenced block out of a model reply; the whole reply if it carries no fence. */\nexport function extractCodeBlock(reply: string): string {\n const fenced = /```(?:[a-zA-Z]*)\\n([\\s\\S]*?)```/u.exec(reply)\n const code = (fenced?.[1] ?? reply).trim()\n if (code.length === 0) throw new ValidationError('authored code: the model returned no code')\n return code\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAAgB,mBAAmB,MAAc,UAA+B,CAAC,GAAS;CACxF,MAAM,UAAU,QAAQ,WAAW;CACnC,MAAM,UAAU,QAAQ,kBAAkB,CAAC;CAC3C,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;EACnC,IAAI,CAAC,eAAe,KAAK,IAAI,GAAG;EAIhC,IAAI,CAHU,QAAQ,MACnB,cAAc,KAAK,SAAS,IAAI,UAAU,EAAE,KAAK,KAAK,SAAS,IAAI,UAAU,EAAE,CAEzE,GACP,MAAM,IAAI,gBACR,GAAG,QAAQ,8BAA8B,KAAK,KAAK,CAAC,CAAC,MAAM,GAAG,GAAG,IAC/D,QAAQ,WAAW,IACf,iCACA,cAAc,QAAQ,KAAK,IAAI,EAAE,IAEzC;CAEJ;CAWA,KAAK,MAAM,CAAC,SAAS,SAAS;EAT5B,CAAC,kBAAkB,WAAW;EAC9B,CAAC,iBAAiB,kBAAkB;EACpC,CAAC,eAAe,QAAQ;EACxB,CAAC,uBAAuB,gBAAgB;EACxC,CAAC,oBAAoB,gBAAgB;EACrC,CAAC,uBAAuB,mBAAmB;EAC3C,CAAC,gBAAgB,gBAAgB;EACjC,CAAC,2DAA2D,qBAAqB;CAEhD,GACjC,IAAI,QAAQ,KAAK,IAAI,GAAG,MAAM,IAAI,gBAAgB,GAAG,QAAQ,aAAa,MAAM;AAEpF;;AAGA,SAAgB,iBAAiB,OAAuB;CAEtD,MAAM,QADS,mCAAmC,KAAK,KACpC,CAAC,GAAG,MAAM,MAAA,CAAO,KAAK;CACzC,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,gBAAgB,2CAA2C;CAC5F,OAAO;AACT"}