@tangle-network/agent-runtime 0.79.2 → 0.79.4

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 (48) hide show
  1. package/README.md +50 -327
  2. package/dist/agent.js +5 -5
  3. package/dist/analyst-loop.js +2 -2
  4. package/dist/{chunk-TSDKBFZP.js → chunk-44CX5JU6.js} +414 -113
  5. package/dist/chunk-44CX5JU6.js.map +1 -0
  6. package/dist/{chunk-T2HVQVB4.js → chunk-4J6RBI3K.js} +15 -1
  7. package/dist/chunk-4J6RBI3K.js.map +1 -0
  8. package/dist/{chunk-75V2XXYJ.js → chunk-AHZ3YBL6.js} +524 -12
  9. package/dist/chunk-AHZ3YBL6.js.map +1 -0
  10. package/dist/{chunk-IODKUOBA.js → chunk-C2FZ6GR6.js} +2 -2
  11. package/dist/{chunk-Z3RRRPRB.js → chunk-H7IBHAFT.js} +23 -14
  12. package/dist/chunk-H7IBHAFT.js.map +1 -0
  13. package/dist/{chunk-VMNEQHJR.js → chunk-IPEQ3ERC.js} +17 -2
  14. package/dist/chunk-IPEQ3ERC.js.map +1 -0
  15. package/dist/{chunk-PBE35ULD.js → chunk-NXZEVWKP.js} +2 -2
  16. package/dist/{chunk-SONQUREI.js → chunk-RUJZK6VH.js} +2 -2
  17. package/dist/{chunk-2DS6T46I.js → chunk-U6AP535M.js} +4 -4
  18. package/dist/{coordination-BoEPhGas.d.ts → coordination-BFVtgRax.d.ts} +30 -4
  19. package/dist/environment-provider.d.ts +1 -1
  20. package/dist/environment-provider.js +1 -1
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +8 -8
  23. package/dist/intelligence.d.ts +30 -2
  24. package/dist/intelligence.js +33 -23
  25. package/dist/intelligence.js.map +1 -1
  26. package/dist/{loop-runner-bin-DCr5OMe5.d.ts → loop-runner-bin-CTVja8e0.d.ts} +2 -2
  27. package/dist/loop-runner-bin.d.ts +4 -4
  28. package/dist/loop-runner-bin.js +7 -7
  29. package/dist/loops.d.ts +283 -13
  30. package/dist/loops.js +26 -6
  31. package/dist/mcp/bin.js +5 -5
  32. package/dist/mcp/index.d.ts +6 -6
  33. package/dist/mcp/index.js +7 -7
  34. package/dist/{router-client-CMAWGv1h.d.ts → router-client-Ak2IGuXq.d.ts} +33 -1
  35. package/dist/{types-C1sozrte.d.ts → types-DYW0tloU.d.ts} +2 -2
  36. package/dist/{worktree-fanout-CtQrRDME.d.ts → worktree-fanout-DaUDwCA_.d.ts} +5 -74
  37. package/dist/{worktree-CpptK3oF.d.ts → worktree-harness-Dt6s_m3z.d.ts} +74 -2
  38. package/package.json +1 -1
  39. package/skills/build-with-agent-runtime/SKILL.md +53 -23
  40. package/dist/chunk-75V2XXYJ.js.map +0 -1
  41. package/dist/chunk-T2HVQVB4.js.map +0 -1
  42. package/dist/chunk-TSDKBFZP.js.map +0 -1
  43. package/dist/chunk-VMNEQHJR.js.map +0 -1
  44. package/dist/chunk-Z3RRRPRB.js.map +0 -1
  45. /package/dist/{chunk-IODKUOBA.js.map → chunk-C2FZ6GR6.js.map} +0 -0
  46. /package/dist/{chunk-PBE35ULD.js.map → chunk-NXZEVWKP.js.map} +0 -0
  47. /package/dist/{chunk-SONQUREI.js.map → chunk-RUJZK6VH.js.map} +0 -0
  48. /package/dist/{chunk-2DS6T46I.js.map → chunk-U6AP535M.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  buildLoopOtelSpans,
3
3
  createOtelExporter,
4
- loopEventToOtelSpan
5
- } from "./chunk-VMNEQHJR.js";
4
+ flatOtelSpan
5
+ } from "./chunk-IPEQ3ERC.js";
6
6
  import "./chunk-DGUM43GV.js";
7
7
 
8
8
  // src/intelligence/effort.ts
@@ -325,10 +325,8 @@ function composeCertifiedPrompt(base, certified) {
325
325
 
326
326
  ${parts.join("\n\n")}`;
327
327
  }
328
- function withCertifiedDelivery(agent, config) {
329
- const client = createIntelligenceClient(config);
330
- const target = config.target ?? config.project;
331
- const refreshMs = config.refreshMs ?? defaultRefreshMs;
328
+ function createCertifiedPromptSource(opts) {
329
+ const refreshMs = opts.refreshMs ?? defaultRefreshMs;
332
330
  let certified = null;
333
331
  let lastPullAt = 0;
334
332
  let inflight = null;
@@ -336,13 +334,7 @@ function withCertifiedDelivery(agent, config) {
336
334
  if (Date.now() - lastPullAt < refreshMs) return;
337
335
  if (inflight) return inflight;
338
336
  inflight = (async () => {
339
- const outcome = await pullCertified({
340
- target,
341
- apiKey: config.apiKey,
342
- baseUrl: config.baseUrl,
343
- timeoutMs: config.timeoutMs,
344
- fetchImpl: config.fetchImpl
345
- });
337
+ const outcome = await pullCertified(opts);
346
338
  lastPullAt = Date.now();
347
339
  if (outcome.succeeded) certified = outcome.value;
348
340
  })();
@@ -352,8 +344,28 @@ function withCertifiedDelivery(agent, config) {
352
344
  inflight = null;
353
345
  }
354
346
  }
347
+ return {
348
+ refresh,
349
+ current: () => certified,
350
+ async compose(base) {
351
+ await refresh();
352
+ return composeCertifiedPrompt(base, certified);
353
+ }
354
+ };
355
+ }
356
+ function withCertifiedDelivery(agent, config) {
357
+ const client = createIntelligenceClient(config);
358
+ const source = createCertifiedPromptSource({
359
+ target: config.target ?? config.project,
360
+ ...config.apiKey !== void 0 ? { apiKey: config.apiKey } : {},
361
+ ...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
362
+ ...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {},
363
+ ...config.fetchImpl !== void 0 ? { fetchImpl: config.fetchImpl } : {},
364
+ ...config.refreshMs !== void 0 ? { refreshMs: config.refreshMs } : {}
365
+ });
355
366
  const wrapped = (async (input) => {
356
- await refresh();
367
+ await source.refresh();
368
+ const certified = source.current();
357
369
  const applied = {
358
370
  certified,
359
371
  composePrompt: (base) => composeCertifiedPrompt(base, certified)
@@ -367,7 +379,7 @@ function withCertifiedDelivery(agent, config) {
367
379
  }
368
380
  );
369
381
  });
370
- wrapped.refresh = refresh;
382
+ wrapped.refresh = source.refresh;
371
383
  return wrapped;
372
384
  }
373
385
 
@@ -832,14 +844,11 @@ function createIntelligenceClient(config) {
832
844
  if (redactedOutput !== void 0) labels["tangle.output"] = previewJson(redactedOutput);
833
845
  try {
834
846
  ex.exportSpan(
835
- loopEventToOtelSpan(
836
- {
837
- kind: "tangle.intelligence.run",
838
- runId: outcome.runId,
839
- timestamp: Date.now(),
840
- payload: labels
841
- },
842
- outcome.traceId
847
+ flatOtelSpan(
848
+ "tangle.intelligence.run",
849
+ { "tangle.runId": outcome.runId, ...labels },
850
+ outcome.traceId,
851
+ Date.now()
843
852
  )
844
853
  );
845
854
  } catch {
@@ -957,6 +966,7 @@ export {
957
966
  composeCertifiedProfile,
958
967
  composeCertifiedProfileFromWire,
959
968
  composeCertifiedPrompt,
969
+ createCertifiedPromptSource,
960
970
  createIntelligenceClient,
961
971
  defaultEffortTier,
962
972
  defaultRedactor,