@tangle-network/agent-runtime 0.115.1 → 0.116.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 (52) hide show
  1. package/dist/{activation-Bt_XVkjK.js → activation-DuqQhee6.js} +2 -2
  2. package/dist/{activation-Bt_XVkjK.js.map → activation-DuqQhee6.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{environment-provider-Cygthiy3.d.ts → environment-provider-CWsRh6Uz.d.ts} +365 -4
  6. package/dist/environment-provider.d.ts +1 -1
  7. package/dist/{improvement-cycle-tEswzEPr.js → improvement-cycle-C1cmjvPD.js} +3 -3
  8. package/dist/{improvement-cycle-tEswzEPr.js.map → improvement-cycle-C1cmjvPD.js.map} +1 -1
  9. package/dist/{index-BUWd8QJq.d.ts → index-COumPQka.d.ts} +40 -225
  10. package/dist/{index-DZukewLl.d.ts → index-CYkDeM5L.d.ts} +3 -3
  11. package/dist/{index-K7nucOmw.d.ts → index-DcLMNnG5.d.ts} +7 -6
  12. package/dist/index.d.ts +6 -7
  13. package/dist/index.js +7 -8
  14. package/dist/index.js.map +1 -1
  15. package/dist/intelligence.d.ts +3 -3
  16. package/dist/intelligence.js +3 -3
  17. package/dist/kernel.d.ts +4 -4
  18. package/dist/kernel.js +5 -5
  19. package/dist/{knowledge-CUXQE8Sq.js → knowledge-DOzbywZT.js} +3 -3
  20. package/dist/{knowledge-CUXQE8Sq.js.map → knowledge-DOzbywZT.js.map} +1 -1
  21. package/dist/knowledge.d.ts +1 -1
  22. package/dist/knowledge.js +1 -1
  23. package/dist/{local-harness-BnB1E9nM.d.ts → local-harness-t6cDWDQ2.d.ts} +3 -105
  24. package/dist/{loop-runner-bin-BZl5vp7t.d.ts → loop-runner-bin-BFrhPLKt.d.ts} +3 -3
  25. package/dist/{loop-runner-bin-DzJz48Fb.js → loop-runner-bin-BuQjc5DR.js} +3 -3
  26. package/dist/{loop-runner-bin-DzJz48Fb.js.map → loop-runner-bin-BuQjc5DR.js.map} +1 -1
  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 +3 -2
  31. package/dist/mcp/index.js +4 -5
  32. package/dist/mcp/index.js.map +1 -1
  33. package/dist/{openai-tools-CynwZMZd.js → openai-tools-_Wyp4udO.js} +2 -2
  34. package/dist/{openai-tools-CynwZMZd.js.map → openai-tools-_Wyp4udO.js.map} +1 -1
  35. package/dist/primeintellect/index.d.ts +1 -1
  36. package/dist/{redact-BRaHUFMf.d.ts → redact-BEtQtvd6.d.ts} +2 -2
  37. package/dist/{runtime-BatQajPB.js → runtime-Ut1pkd2n.js} +4 -4
  38. package/dist/{runtime-BatQajPB.js.map → runtime-Ut1pkd2n.js.map} +1 -1
  39. package/dist/{structural-rollout-DEf37yQy.js → structural-rollout-CVY_0hJp.js} +2 -2
  40. package/dist/{structural-rollout-DEf37yQy.js.map → structural-rollout-CVY_0hJp.js.map} +1 -1
  41. package/dist/{supervise-B7TIJR3D.js → supervise-BUR9ByF7.js} +61 -22
  42. package/dist/supervise-BUR9ByF7.js.map +1 -0
  43. package/dist/{supervisor-DzQu5Ydu.js → supervisor-BBbPBXpe.js} +1004 -4
  44. package/dist/supervisor-BBbPBXpe.js.map +1 -0
  45. package/dist/testing.js +8 -8
  46. package/package.json +1 -1
  47. package/dist/otel-export-CPZTSADj.js +0 -852
  48. package/dist/otel-export-CPZTSADj.js.map +0 -1
  49. package/dist/supervise-B7TIJR3D.js.map +0 -1
  50. package/dist/supervisor-DzQu5Ydu.js.map +0 -1
  51. package/dist/trace-propagation-B-pL7xn_.js +0 -57
  52. package/dist/trace-propagation-B-pL7xn_.js.map +0 -1
@@ -1,57 +0,0 @@
1
- import { a as createOtelExporter, n as buildLoopOtelSpans } from "./otel-export-CPZTSADj.js";
2
- //#region src/mcp/trace-propagation.ts
3
- /**
4
- * Read trace context from the process environment.
5
- * Returns a context with inherited ids or a freshly generated root.
6
- */
7
- function readTraceContextFromEnv() {
8
- return {
9
- traceId: process.env.TRACE_ID || generateTraceId(),
10
- parentSpanId: process.env.PARENT_SPAN_ID || void 0
11
- };
12
- }
13
- /**
14
- * Create a LoopTraceEmitter that:
15
- * 1. Parents all spans under the inherited PARENT_SPAN_ID.
16
- * 2. Exports spans to OTEL when OTEL_EXPORTER_OTLP_ENDPOINT is set.
17
- *
18
- * Returns both the emitter and the optional exporter handle for shutdown.
19
- */
20
- function createPropagatingTraceEmitter(ctx) {
21
- const exporter = createOtelExporter();
22
- const buffers = /* @__PURE__ */ new Map();
23
- return {
24
- emitter: { emit(event) {
25
- if (!exporter) return;
26
- const buf = buffers.get(event.runId);
27
- if (buf) buf.push(event);
28
- else buffers.set(event.runId, [event]);
29
- if (event.kind === "loop.ended") {
30
- const events = buffers.get(event.runId) ?? [event];
31
- buffers.delete(event.runId);
32
- for (const span of buildLoopOtelSpans(events, ctx.traceId, ctx.parentSpanId)) exporter.exportSpan(span);
33
- }
34
- } },
35
- exporter,
36
- context: ctx
37
- };
38
- }
39
- /**
40
- * Build env vars to pass to a child MCP subprocess so it inherits the
41
- * current trace context.
42
- */
43
- function traceContextToEnv(ctx) {
44
- const env = { TRACE_ID: ctx.traceId };
45
- if (ctx.parentSpanId) env.PARENT_SPAN_ID = ctx.parentSpanId;
46
- return env;
47
- }
48
- function generateTraceId() {
49
- const bytes = /* @__PURE__ */ new Uint8Array(16);
50
- if (typeof globalThis.crypto?.getRandomValues === "function") globalThis.crypto.getRandomValues(bytes);
51
- else for (let i = 0; i < 16; i++) bytes[i] = Math.floor(Math.random() * 256);
52
- return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
53
- }
54
- //#endregion
55
- export { readTraceContextFromEnv as n, traceContextToEnv as r, createPropagatingTraceEmitter as t };
56
-
57
- //# sourceMappingURL=trace-propagation-B-pL7xn_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trace-propagation-B-pL7xn_.js","names":[],"sources":["../src/mcp/trace-propagation.ts"],"sourcesContent":["/**\n *\n * Trace context propagation for MCP subprocess.\n *\n * When the MCP server is launched as a child process by a sandbox harness,\n * the parent passes trace context via environment variables:\n *\n * TRACE_ID=<current-run-trace-id>\n * PARENT_SPAN_ID=<span-that-dispatched-the-delegation>\n *\n * The MCP server reads these at startup and uses them as the root of its\n * internal trace tree. All spans emitted by `runAgentRounds` invocations inside\n * the MCP are children of the parent's delegation span.\n *\n * When these env vars are absent, the MCP generates a fresh trace root —\n * the server operates standalone without trace joining.\n *\n * @experimental\n */\n\nimport type { OtelExporter } from '../otel-export'\nimport { buildLoopOtelSpans, createOtelExporter } from '../otel-export'\nimport type { LoopTraceEmitter, LoopTraceEvent } from '../runtime/types'\n\nexport interface TraceContext {\n /** Trace id inherited from the parent process, or a fresh one. */\n traceId: string\n /** Parent span id from the delegation that launched this MCP server. */\n parentSpanId?: string\n}\n\n/**\n * Read trace context from the process environment.\n * Returns a context with inherited ids or a freshly generated root.\n */\nexport function readTraceContextFromEnv(): TraceContext {\n const traceId = process.env.TRACE_ID || generateTraceId()\n const parentSpanId = process.env.PARENT_SPAN_ID || undefined\n return { traceId, parentSpanId }\n}\n\n/**\n * Create a LoopTraceEmitter that:\n * 1. Parents all spans under the inherited PARENT_SPAN_ID.\n * 2. Exports spans to OTEL when OTEL_EXPORTER_OTLP_ENDPOINT is set.\n *\n * Returns both the emitter and the optional exporter handle for shutdown.\n */\nexport function createPropagatingTraceEmitter(ctx: TraceContext): {\n emitter: LoopTraceEmitter\n exporter: OtelExporter | undefined\n context: TraceContext\n} {\n const exporter = createOtelExporter()\n\n // Buffer events per loop run, then emit the full nested span tree on\n // `loop.ended` so the topology hierarchy (loop → round → branch) reaches the\n // OTLP collector — not a flat list of zero-duration point spans. A run that\n // never reaches `loop.ended` (hard abort) drops its buffer; acceptable for\n // the short-lived MCP subprocess.\n const buffers = new Map<string, LoopTraceEvent[]>()\n\n const emitter: LoopTraceEmitter = {\n emit(event: LoopTraceEvent) {\n if (!exporter) return\n const buf = buffers.get(event.runId)\n if (buf) buf.push(event)\n else buffers.set(event.runId, [event])\n if (event.kind === 'loop.ended') {\n const events = buffers.get(event.runId) ?? [event]\n buffers.delete(event.runId)\n for (const span of buildLoopOtelSpans(events, ctx.traceId, ctx.parentSpanId)) {\n exporter.exportSpan(span)\n }\n }\n },\n }\n\n return { emitter, exporter, context: ctx }\n}\n\n/**\n * Build env vars to pass to a child MCP subprocess so it inherits the\n * current trace context.\n */\nexport function traceContextToEnv(ctx: TraceContext): Record<string, string> {\n const env: Record<string, string> = { TRACE_ID: ctx.traceId }\n if (ctx.parentSpanId) env.PARENT_SPAN_ID = ctx.parentSpanId\n return env\n}\n\nfunction generateTraceId(): string {\n const bytes = new Uint8Array(16)\n if (typeof globalThis.crypto?.getRandomValues === 'function') {\n globalThis.crypto.getRandomValues(bytes)\n } else {\n for (let i = 0; i < 16; i++) bytes[i] = Math.floor(Math.random() * 256)\n }\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('')\n}\n"],"mappings":";;;;;;AAmCA,SAAgB,0BAAwC;CAGtD,OAAO;EAAE,SAFO,QAAQ,IAAI,YAAY,gBAAgB;EAEtC,cADG,QAAQ,IAAI,kBAAkB,KAAA;CACpB;AACjC;;;;;;;;AASA,SAAgB,8BAA8B,KAI5C;CACA,MAAM,WAAW,mBAAmB;CAOpC,MAAM,0BAAU,IAAI,IAA8B;CAkBlD,OAAO;EAAE,SAAA,EAfP,KAAK,OAAuB;GAC1B,IAAI,CAAC,UAAU;GACf,MAAM,MAAM,QAAQ,IAAI,MAAM,KAAK;GACnC,IAAI,KAAK,IAAI,KAAK,KAAK;QAClB,QAAQ,IAAI,MAAM,OAAO,CAAC,KAAK,CAAC;GACrC,IAAI,MAAM,SAAS,cAAc;IAC/B,MAAM,SAAS,QAAQ,IAAI,MAAM,KAAK,KAAK,CAAC,KAAK;IACjD,QAAQ,OAAO,MAAM,KAAK;IAC1B,KAAK,MAAM,QAAQ,mBAAmB,QAAQ,IAAI,SAAS,IAAI,YAAY,GACzE,SAAS,WAAW,IAAI;GAE5B;EACF,EAGa;EAAG;EAAU,SAAS;CAAI;AAC3C;;;;;AAMA,SAAgB,kBAAkB,KAA2C;CAC3E,MAAM,MAA8B,EAAE,UAAU,IAAI,QAAQ;CAC5D,IAAI,IAAI,cAAc,IAAI,iBAAiB,IAAI;CAC/C,OAAO;AACT;AAEA,SAAS,kBAA0B;CACjC,MAAM,wBAAQ,IAAI,WAAW,EAAE;CAC/B,IAAI,OAAO,WAAW,QAAQ,oBAAoB,YAChD,WAAW,OAAO,gBAAgB,KAAK;MAEvC,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,MAAM,KAAK,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;CAExE,OAAO,MAAM,KAAK,KAAK,CAAC,CACrB,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAC3C,KAAK,EAAE;AACZ"}