@tangle-network/agent-runtime 0.71.1 → 0.73.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 (66) hide show
  1. package/README.md +8 -8
  2. package/dist/agent.d.ts +27 -17
  3. package/dist/agent.js +21 -9
  4. package/dist/agent.js.map +1 -1
  5. package/dist/analyst-loop.d.ts +1 -1
  6. package/dist/analyst-loop.js +3 -2
  7. package/dist/{chunk-4KGQHS7U.js → chunk-7ODB76J5.js} +2 -18
  8. package/dist/chunk-7ODB76J5.js.map +1 -0
  9. package/dist/chunk-HPYWEFVY.js +4039 -0
  10. package/dist/chunk-HPYWEFVY.js.map +1 -0
  11. package/dist/{chunk-P5OKDSLB.js → chunk-IODKUOBA.js} +5 -3
  12. package/dist/{chunk-P5OKDSLB.js.map → chunk-IODKUOBA.js.map} +1 -1
  13. package/dist/chunk-NBV35BR6.js +68 -0
  14. package/dist/chunk-NBV35BR6.js.map +1 -0
  15. package/dist/{chunk-5ISW5JUF.js → chunk-NCH4XUZ7.js} +2004 -6551
  16. package/dist/chunk-NCH4XUZ7.js.map +1 -0
  17. package/dist/chunk-PBE35ULD.js +52 -0
  18. package/dist/chunk-PBE35ULD.js.map +1 -0
  19. package/dist/{chunk-VLF5RHEQ.js → chunk-T2HVQVB4.js} +1 -66
  20. package/dist/chunk-T2HVQVB4.js.map +1 -0
  21. package/dist/{chunk-K3RM4MPM.js → chunk-U56XGKVY.js} +9 -24
  22. package/dist/chunk-U56XGKVY.js.map +1 -0
  23. package/dist/chunk-UZ5SODU7.js +29 -0
  24. package/dist/chunk-UZ5SODU7.js.map +1 -0
  25. package/dist/{delegates-CsXJPZDH.d.ts → coordination-DU0saWeg.d.ts} +875 -1099
  26. package/dist/index.d.ts +7 -8
  27. package/dist/index.js +10 -12
  28. package/dist/index.js.map +1 -1
  29. package/dist/intelligence.d.ts +1 -1
  30. package/dist/lifecycle.d.ts +281 -0
  31. package/dist/lifecycle.js +174 -0
  32. package/dist/lifecycle.js.map +1 -0
  33. package/dist/{loop-runner-bin-DLM_bVQO.d.ts → loop-runner-bin-eD3m0rHW.d.ts} +10 -27
  34. package/dist/loop-runner-bin.d.ts +5 -6
  35. package/dist/loop-runner-bin.js +6 -6
  36. package/dist/loops.d.ts +47 -10
  37. package/dist/loops.js +47 -42
  38. package/dist/mcp/bin.js +17 -329
  39. package/dist/mcp/bin.js.map +1 -1
  40. package/dist/mcp/index.d.ts +10 -190
  41. package/dist/mcp/index.js +949 -47
  42. package/dist/mcp/index.js.map +1 -1
  43. package/dist/{openai-tools-kdCS-T12.d.ts → openai-tools-CBurv8Cu.d.ts} +11 -13
  44. package/dist/otel-export-BKmNwiCb.d.ts +180 -0
  45. package/dist/profiles.d.ts +3 -3
  46. package/dist/profiles.js +1 -5
  47. package/dist/profiles.js.map +1 -1
  48. package/dist/{substrate-BoRXgvka.d.ts → substrate-rNj6TDc3.d.ts} +7 -23
  49. package/dist/{types-CdnEAE3U.d.ts → types-JufmXF2a.d.ts} +80 -1
  50. package/dist/worktree-DaxOvw-C.d.ts +702 -0
  51. package/dist/{worktree-fanout-CK2ypmEm.d.ts → worktree-fanout-DIffZohV.d.ts} +15 -5
  52. package/package.json +6 -1
  53. package/dist/chunk-4KGQHS7U.js.map +0 -1
  54. package/dist/chunk-5ISW5JUF.js.map +0 -1
  55. package/dist/chunk-74UAWZXE.js +0 -278
  56. package/dist/chunk-74UAWZXE.js.map +0 -1
  57. package/dist/chunk-DVQGYDN5.js +0 -59
  58. package/dist/chunk-DVQGYDN5.js.map +0 -1
  59. package/dist/chunk-INXDNX2W.js +0 -475
  60. package/dist/chunk-INXDNX2W.js.map +0 -1
  61. package/dist/chunk-K3RM4MPM.js.map +0 -1
  62. package/dist/chunk-VLF5RHEQ.js.map +0 -1
  63. package/dist/chunk-XRYEZPR6.js +0 -88
  64. package/dist/chunk-XRYEZPR6.js.map +0 -1
  65. package/dist/coordination-BPQmuwv8.d.ts +0 -666
  66. package/dist/delegation-profile-Bvfro2m1.d.ts +0 -99
@@ -1,99 +0,0 @@
1
- import { AgentProfileFileMount, AgentProfile, AgentSubagentProfile, AgentProfileMcpServer } from '@tangle-network/sandbox';
2
-
3
- /**
4
- * Production-profile composition for the agent-runtime delegation MCP.
5
- *
6
- * A product agent's sandbox loads the delegation tools (`delegate_code`,
7
- * `delegate_research`, `delegate_feedback`, `delegation_status`,
8
- * `delegation_history`) by mounting the `agent-runtime-mcp` stdio server as
9
- * an MCP entry in its `AgentProfile`. This module is the single composer for
10
- * that wiring, so every consumer — the fleet agents and agent-builder's
11
- * generated agents — shares one implementation instead of copying it.
12
- *
13
- * The load-bearing invariant: the delegation MCP entry is only ever emitted
14
- * when a sandbox API key is present. Without the key the kernel's
15
- * coder/researcher delegate cannot construct an authenticated sandbox client,
16
- * so we omit the entry rather than ship an MCP child that fails to
17
- * authenticate on startup. No static profile entry, ever.
18
- */
19
-
20
- /** One hook command entry. The SDK declares `AgentProfile.hooks` as
21
- * `Record<string, AgentProfileHookCommand[]>` but does not re-export the element
22
- * type from the package entry, so derive it from `AgentProfile` by indexed
23
- * access — the single source of truth, no drift from the SDK shape. */
24
- type AgentProfileHookCommand = NonNullable<AgentProfile['hooks']>[string][number];
25
- /** MCP server key under which the agent-runtime delegation tools mount. */
26
- declare const DELEGATION_MCP_SERVER_KEY = "agent-runtime-delegation";
27
- interface BuildDelegationMcpServerOptions {
28
- /** Sandbox API key forwarded as `TANGLE_API_KEY` to the MCP child. The
29
- * agent-runtime MCP bin reads `TANGLE_API_KEY` and passes it straight to
30
- * `new Sandbox({ apiKey })`. Defaults to `env.TANGLE_API_KEY`. */
31
- sandboxApiKey?: string;
32
- /** Sandbox base URL forwarded as `SANDBOX_BASE_URL`. Defaults to
33
- * `env.SANDBOX_BASE_URL`, then `env.SANDBOX_API_URL`, then the public
34
- * sandbox endpoint. */
35
- sandboxBaseUrl?: string;
36
- /** Environment source for key + OTEL resolution. Defaults to `process.env`;
37
- * injectable for tests and non-process callers. */
38
- env?: Record<string, string | undefined>;
39
- }
40
- /**
41
- * Build the delegation MCP entry the sandbox-side agent loads on startup.
42
- * Returns `undefined` when no sandbox API key is resolvable — callers merge
43
- * the result into a profile's `mcp` map only when defined.
44
- */
45
- declare function buildDelegationMcpServer(options?: BuildDelegationMcpServerOptions): Record<string, AgentProfileMcpServer> | undefined;
46
- interface ComposeProductionAgentProfileOptions {
47
- /** Sandbox API key forwarded to the delegation MCP child. Defaults to
48
- * `env.TANGLE_API_KEY`. When unset, the delegation MCP entry is omitted. */
49
- sandboxApiKey?: string;
50
- /** Sandbox base URL forwarded as `SANDBOX_BASE_URL` to the MCP child. */
51
- sandboxBaseUrl?: string;
52
- /** Replace the base profile's system prompt. Used by per-turn calls that
53
- * swap in workspace-augmented prompts (board summary, learned style). */
54
- systemPrompt?: string;
55
- /** Extra file mounts layered after the base profile's `resources.files`. */
56
- extraFiles?: AgentProfileFileMount[];
57
- /** Override the profile `name`. Defaults to the base profile's name. */
58
- name?: string;
59
- /** Environment source for key + OTEL resolution. Defaults to `process.env`. */
60
- env?: Record<string, string | undefined>;
61
- /** Box built-in tool ON/OFF flags merged over the base profile's `tools`
62
- * (overlay wins per key). The sandbox-seam mapping of a certified surface's
63
- * tool grants — `AgentProfile.tools` is `Record<string, boolean>` box flags,
64
- * so it carries grants, not arbitrary tool defs. */
65
- tools?: Record<string, boolean>;
66
- /** Per-event hook commands merged over the base profile's `hooks`. An event
67
- * present in both has the extra commands appended after the base ones. */
68
- hooks?: Record<string, AgentProfileHookCommand[]>;
69
- /** Subagent definitions merged over the base profile's `subagents` (overlay
70
- * wins per key). */
71
- subagents?: Record<string, AgentSubagentProfile>;
72
- /** Resolved certified MCP connections injected into `AgentProfile.mcp` — the
73
- * sandbox-seam delivery of a `ResolvedSurface.mcpConnections`. Merged after
74
- * the base map and before the delegation entry, so a base/delegation key is
75
- * never silently shadowed by an injected one. */
76
- mcpConnections?: Record<string, AgentProfileMcpServer>;
77
- }
78
- /**
79
- * Compose the production `AgentProfile`: the canonical base profile with the
80
- * delegation MCP merged into `mcp`. Used by every call site that boots a
81
- * sandbox or runs a chat turn through the sandbox path, and by eval wiring so
82
- * the scorecard profile hash reflects the actual production profile.
83
- *
84
- * Merge rules:
85
- * - `mcp`: base map preserved; `options.mcpConnections` (resolved certified
86
- * servers) merged over it; the delegation entry is appended last under
87
- * {@link DELEGATION_MCP_SERVER_KEY}, and omitted entirely when no sandbox
88
- * API key resolves.
89
- * - `tools`: base box-flags map preserved; `options.tools` overlaid per key.
90
- * - `hooks`: per event, base commands preserved; `options.hooks[event]`
91
- * appended after the base ones.
92
- * - `subagents`: base map preserved; `options.subagents` overlaid per key.
93
- * - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set.
94
- * - `resources.files`: `options.extraFiles` concatenated after base files.
95
- * - `name`: replaced when `options.name` is set.
96
- */
97
- declare function composeProductionAgentProfile(baseProfile: AgentProfile, options?: ComposeProductionAgentProfileOptions): AgentProfile;
98
-
99
- export { type BuildDelegationMcpServerOptions as B, type ComposeProductionAgentProfileOptions as C, DELEGATION_MCP_SERVER_KEY as D, buildDelegationMcpServer as b, composeProductionAgentProfile as c };