@tangle-network/agent-runtime 0.52.0 → 0.53.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/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/{chunk-7SP2OVYZ.js → chunk-5M2WDWBI.js} +3 -3
- package/dist/{chunk-4JI4BCBI.js → chunk-AYRQZRDV.js} +2 -2
- package/dist/{chunk-BERLUBAP.js → chunk-FO4DCM7R.js} +2 -2
- package/dist/{chunk-7JITYN6T.js → chunk-JFIYKDXF.js} +17 -2
- package/dist/chunk-JFIYKDXF.js.map +1 -0
- package/dist/{chunk-COAVO6QB.js → chunk-K5M3SHEU.js} +3 -3
- package/dist/{chunk-2OU7ZQPD.js → chunk-K6WP7PYW.js} +42 -57
- package/dist/chunk-K6WP7PYW.js.map +1 -0
- package/dist/{chunk-V2K35HF2.js → chunk-P4QNEXFC.js} +2 -2
- package/dist/{coder-_YCf3BAK.d.ts → coder-LKm3Mczw.d.ts} +1 -1
- package/dist/{delegation-profile-1GbW5yA3.d.ts → delegation-profile-Bvfro2m1.d.ts} +28 -2
- package/dist/{driver-DLI1io57.d.ts → driver-B2RKkVJW.d.ts} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +475 -5
- package/dist/intelligence.js +547 -3
- package/dist/intelligence.js.map +1 -1
- package/dist/{kb-gate-CHAyt4aI.d.ts → kb-gate-CKfykcYQ.d.ts} +2 -2
- package/dist/{loop-runner-bin-DFUNgpeK.d.ts → loop-runner-bin-D4Ir7b00.d.ts} +4 -4
- package/dist/loop-runner-bin.d.ts +5 -5
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +6 -5
- package/dist/loops.js +1 -1
- package/dist/mcp/bin.js +4 -4
- package/dist/mcp/index.d.ts +7 -7
- package/dist/mcp/index.js +6 -6
- package/dist/{openai-tools-D4HLDWgw.d.ts → openai-tools-CKfR3EMh.d.ts} +1 -1
- package/dist/profiles.d.ts +2 -2
- package/dist/router-client-B0Qi1NiN.d.ts +120 -0
- package/dist/{run-loop-BIineL1T.d.ts → run-loop-DgVhucoR.d.ts} +1 -1
- package/dist/runtime.d.ts +16 -119
- package/dist/runtime.js +1 -1
- package/dist/{types-5MGt5KTY.d.ts → types-CNDJCL_0.d.ts} +1 -1
- package/dist/{types-BEQsBhOE.d.ts → types-CklkW4Eh.d.ts} +2 -1
- package/dist/workflow.d.ts +2 -2
- package/dist/workflow.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2OU7ZQPD.js.map +0 -1
- package/dist/chunk-7JITYN6T.js.map +0 -1
- /package/dist/{chunk-7SP2OVYZ.js.map → chunk-5M2WDWBI.js.map} +0 -0
- /package/dist/{chunk-4JI4BCBI.js.map → chunk-AYRQZRDV.js.map} +0 -0
- /package/dist/{chunk-BERLUBAP.js.map → chunk-FO4DCM7R.js.map} +0 -0
- /package/dist/{chunk-COAVO6QB.js.map → chunk-K5M3SHEU.js.map} +0 -0
- /package/dist/{chunk-V2K35HF2.js.map → chunk-P4QNEXFC.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mcp/delegation-profile.ts"],"sourcesContent":["/**\n * Production-profile composition for the agent-runtime delegation MCP.\n *\n * A product agent's sandbox loads the delegation tools (`delegate_code`,\n * `delegate_research`, `delegate_feedback`, `delegation_status`,\n * `delegation_history`) by mounting the `agent-runtime-mcp` stdio server as\n * an MCP entry in its `AgentProfile`. This module is the single composer for\n * that wiring, so every consumer — the fleet agents and agent-builder's\n * generated agents — shares one implementation instead of copying it.\n *\n * The load-bearing invariant: the delegation MCP entry is only ever emitted\n * when a sandbox API key is present. Without the key the kernel's\n * coder/researcher delegate cannot construct an authenticated sandbox client,\n * so we omit the entry rather than ship an MCP child that fails to\n * authenticate on startup. No static profile entry, ever.\n */\n\nimport type {\n AgentProfile,\n AgentProfileFileMount,\n AgentProfileMcpServer,\n} from '@tangle-network/sandbox'\n\n/** MCP server key under which the agent-runtime delegation tools mount. */\nexport const DELEGATION_MCP_SERVER_KEY = 'agent-runtime-delegation'\n\n/**\n * Env vars forwarded into the delegation MCP child so its delegated\n * build/research loops export topology spans to the configured OTLP /\n * Tangle Intelligence sink. Each is forwarded only when present, so the\n * child is a no-op exporter until `OTEL_EXPORTER_OTLP_ENDPOINT` is set in the\n * parent env — never a hardcoded endpoint.\n */\nconst OTEL_FORWARD_KEYS = [\n 'OTEL_EXPORTER_OTLP_ENDPOINT',\n 'OTEL_EXPORTER_OTLP_HEADERS',\n 'TRACE_ID',\n 'PARENT_SPAN_ID',\n] as const\n\nconst DEFAULT_SANDBOX_BASE_URL = 'https://sandbox.tangle.tools'\n\nexport interface BuildDelegationMcpServerOptions {\n /** Sandbox API key forwarded as `TANGLE_API_KEY` to the MCP child. The\n * agent-runtime MCP bin reads `TANGLE_API_KEY` and passes it straight to\n * `new Sandbox({ apiKey })`. Defaults to `env.TANGLE_API_KEY`. */\n sandboxApiKey?: string\n /** Sandbox base URL forwarded as `SANDBOX_BASE_URL`. Defaults to\n * `env.SANDBOX_BASE_URL`, then `env.SANDBOX_API_URL`, then the public\n * sandbox endpoint. */\n sandboxBaseUrl?: string\n /** Environment source for key + OTEL resolution. Defaults to `process.env`;\n * injectable for tests and non-process callers. */\n env?: Record<string, string | undefined>\n}\n\n/**\n * Build the delegation MCP entry the sandbox-side agent loads on startup.\n * Returns `undefined` when no sandbox API key is resolvable — callers merge\n * the result into a profile's `mcp` map only when defined.\n */\nexport function buildDelegationMcpServer(\n options: BuildDelegationMcpServerOptions = {},\n): Record<string, AgentProfileMcpServer> | undefined {\n const env = options.env ?? process.env\n const sandboxApiKey = options.sandboxApiKey ?? env.TANGLE_API_KEY\n if (!sandboxApiKey) return undefined\n const baseUrl =\n options.sandboxBaseUrl ??\n env.SANDBOX_BASE_URL ??\n env.SANDBOX_API_URL ??\n DEFAULT_SANDBOX_BASE_URL\n\n const otelEnv: Record<string, string> = {}\n for (const key of OTEL_FORWARD_KEYS) {\n const value = env[key]\n if (value) otelEnv[key] = value\n }\n\n return {\n [DELEGATION_MCP_SERVER_KEY]: {\n transport: 'stdio',\n command: 'npx',\n args: ['-y', '@tangle-network/agent-runtime', 'mcp'],\n env: {\n TANGLE_API_KEY: sandboxApiKey,\n SANDBOX_BASE_URL: baseUrl,\n ...otelEnv,\n },\n enabled: true,\n metadata: {\n surface: 'delegation:dispatch',\n tools: [\n 'delegate_code',\n 'delegate_research',\n 'delegate_feedback',\n 'delegation_status',\n 'delegation_history',\n ],\n },\n },\n }\n}\n\nexport interface ComposeProductionAgentProfileOptions {\n /** Sandbox API key forwarded to the delegation MCP child. Defaults to\n * `env.TANGLE_API_KEY`. When unset, the delegation MCP entry is omitted. */\n sandboxApiKey?: string\n /** Sandbox base URL forwarded as `SANDBOX_BASE_URL` to the MCP child. */\n sandboxBaseUrl?: string\n /** Replace the base profile's system prompt. Used by per-turn calls that\n * swap in workspace-augmented prompts (board summary, learned style). */\n systemPrompt?: string\n /** Extra file mounts layered after the base profile's `resources.files`. */\n extraFiles?: AgentProfileFileMount[]\n /** Override the profile `name`. Defaults to the base profile's name. */\n name?: string\n /** Environment source for key + OTEL resolution. Defaults to `process.env`. */\n env?: Record<string, string | undefined>\n}\n\n/**\n * Compose the production `AgentProfile`: the canonical base profile with the\n * delegation MCP merged into `mcp`. Used by every call site that boots a\n * sandbox or runs a chat turn through the sandbox path, and by eval wiring so\n * the scorecard profile hash reflects the actual production profile.\n *\n * Merge rules:\n * - `mcp`: base map preserved; the delegation entry is appended under\n * {@link DELEGATION_MCP_SERVER_KEY}, and omitted entirely when no sandbox\n * API key resolves.\n * - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set.\n * - `resources.files`: `options.extraFiles` concatenated after base files.\n * - `name`: replaced when `options.name` is set.\n */\nexport function composeProductionAgentProfile(\n baseProfile: AgentProfile,\n options: ComposeProductionAgentProfileOptions = {},\n): AgentProfile {\n const delegationMcp = buildDelegationMcpServer({\n sandboxApiKey: options.sandboxApiKey,\n sandboxBaseUrl: options.sandboxBaseUrl,\n env: options.env,\n })\n\n const baseMcp = baseProfile.mcp ?? {}\n const mergedMcp: Record<string, AgentProfileMcpServer> = delegationMcp\n ? { ...baseMcp, ...delegationMcp }\n : { ...baseMcp }\n\n const baseFiles = baseProfile.resources?.files ?? []\n const mergedFiles: AgentProfileFileMount[] = options.extraFiles?.length\n ? [...baseFiles, ...options.extraFiles]\n : [...baseFiles]\n\n const prompt = options.systemPrompt\n ? { ...baseProfile.prompt, systemPrompt: options.systemPrompt }\n : baseProfile.prompt\n\n return {\n ...baseProfile,\n name: options.name ?? baseProfile.name,\n prompt,\n mcp: mergedMcp,\n resources: {\n ...baseProfile.resources,\n files: mergedFiles,\n },\n }\n}\n"],"mappings":";AAwBO,IAAM,4BAA4B;AASzC,IAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,2BAA2B;AAqB1B,SAAS,yBACd,UAA2C,CAAC,GACO;AACnD,QAAM,MAAM,QAAQ,OAAO,QAAQ;AACnC,QAAM,gBAAgB,QAAQ,iBAAiB,IAAI;AACnD,MAAI,CAAC,cAAe,QAAO;AAC3B,QAAM,UACJ,QAAQ,kBACR,IAAI,oBACJ,IAAI,mBACJ;AAEF,QAAM,UAAkC,CAAC;AACzC,aAAW,OAAO,mBAAmB;AACnC,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,MAAO,SAAQ,GAAG,IAAI;AAAA,EAC5B;AAEA,SAAO;AAAA,IACL,CAAC,yBAAyB,GAAG;AAAA,MAC3B,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM,CAAC,MAAM,iCAAiC,KAAK;AAAA,MACnD,KAAK;AAAA,QACH,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,QAClB,GAAG;AAAA,MACL;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,QACR,SAAS;AAAA,QACT,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAiCO,SAAS,8BACd,aACA,UAAgD,CAAC,GACnC;AACd,QAAM,gBAAgB,yBAAyB;AAAA,IAC7C,eAAe,QAAQ;AAAA,IACvB,gBAAgB,QAAQ;AAAA,IACxB,KAAK,QAAQ;AAAA,EACf,CAAC;AAED,QAAM,UAAU,YAAY,OAAO,CAAC;AACpC,QAAM,YAAmD,gBACrD,EAAE,GAAG,SAAS,GAAG,cAAc,IAC/B,EAAE,GAAG,QAAQ;AAEjB,QAAM,YAAY,YAAY,WAAW,SAAS,CAAC;AACnD,QAAM,cAAuC,QAAQ,YAAY,SAC7D,CAAC,GAAG,WAAW,GAAG,QAAQ,UAAU,IACpC,CAAC,GAAG,SAAS;AAEjB,QAAM,SAAS,QAAQ,eACnB,EAAE,GAAG,YAAY,QAAQ,cAAc,QAAQ,aAAa,IAC5D,YAAY;AAEhB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,QAAQ,QAAQ,YAAY;AAAA,IAClC;AAAA,IACA,KAAK;AAAA,IACL,WAAW;AAAA,MACT,GAAG,YAAY;AAAA,MACf,OAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|