pi-fabric 0.130.2 → 0.131.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 (225) hide show
  1. package/dist/activity/store.d.ts +2 -1
  2. package/dist/activity/store.d.ts.map +1 -1
  3. package/dist/actors/directory.d.ts.map +1 -1
  4. package/dist/actors/global-registry.d.ts.map +1 -1
  5. package/dist/actors/manager.d.ts +4 -3
  6. package/dist/actors/manager.d.ts.map +1 -1
  7. package/dist/actors/mesh-monitor.d.ts +2 -0
  8. package/dist/actors/mesh-monitor.d.ts.map +1 -1
  9. package/dist/actors/name-policy.d.ts +3 -0
  10. package/dist/actors/name-policy.d.ts.map +1 -0
  11. package/dist/actors/registry-store.d.ts +1 -1
  12. package/dist/actors/registry-store.d.ts.map +1 -1
  13. package/dist/agents/agent-files.d.ts +8 -0
  14. package/dist/agents/agent-files.d.ts.map +1 -1
  15. package/dist/agents/agent-files.js +48 -3
  16. package/dist/agents/agent-files.js.map +2 -2
  17. package/dist/agents/child-skills.d.ts +60 -0
  18. package/dist/agents/child-skills.d.ts.map +1 -0
  19. package/dist/agents/child-skills.js +94 -0
  20. package/dist/agents/child-skills.js.map +7 -0
  21. package/dist/agents/clone-first-worktree.d.ts +6 -0
  22. package/dist/agents/clone-first-worktree.d.ts.map +1 -1
  23. package/dist/agents/cow-clone.d.ts.map +1 -1
  24. package/dist/agents/handoff.d.ts +12 -2
  25. package/dist/agents/handoff.d.ts.map +1 -1
  26. package/dist/agents/manager.d.ts +4 -1
  27. package/dist/agents/manager.d.ts.map +1 -1
  28. package/dist/agents/model-pin-guard.d.ts +27 -0
  29. package/dist/agents/model-pin-guard.d.ts.map +1 -0
  30. package/dist/agents/model-pin-guard.js +86 -0
  31. package/dist/agents/model-pin-guard.js.map +7 -0
  32. package/dist/agents/model-pin.d.ts +25 -0
  33. package/dist/agents/model-pin.d.ts.map +1 -0
  34. package/dist/agents/provider-bridge.d.ts +5 -4
  35. package/dist/agents/provider-bridge.d.ts.map +1 -1
  36. package/dist/agents/provider-bridge.js +32 -4
  37. package/dist/agents/provider-bridge.js.map +3 -3
  38. package/dist/agents/request.d.ts.map +1 -1
  39. package/dist/agents/service-schema.d.ts.map +1 -1
  40. package/dist/agents/types.d.ts +25 -0
  41. package/dist/agents/types.d.ts.map +1 -1
  42. package/dist/agents/worktree-manager.d.ts.map +1 -1
  43. package/dist/agents.js +6 -5
  44. package/dist/agents.js.map +2 -2
  45. package/dist/audit/details.d.ts +4 -0
  46. package/dist/audit/details.d.ts.map +1 -1
  47. package/dist/chunks/{chunk-SBAROA4Y.js → chunk-2RWNVCFD.js} +17 -1
  48. package/dist/chunks/{chunk-SBAROA4Y.js.map → chunk-2RWNVCFD.js.map} +2 -2
  49. package/dist/chunks/{chunk-6O6UWMBO.js → chunk-36XQFTEN.js} +2 -2
  50. package/dist/chunks/chunk-3PKZSIRA.js +1312 -0
  51. package/dist/chunks/chunk-3PKZSIRA.js.map +7 -0
  52. package/dist/chunks/{chunk-JJXUOXI5.js → chunk-4KX6BIPL.js} +17 -2
  53. package/dist/chunks/chunk-4KX6BIPL.js.map +7 -0
  54. package/dist/chunks/{chunk-EYHTTMSM.js → chunk-4PBW54I2.js} +5 -5
  55. package/dist/chunks/{chunk-WTIF3MIM.js → chunk-56NMRVTV.js} +8 -8
  56. package/dist/chunks/{chunk-WQFG7ZVC.js → chunk-5BOTHX47.js} +48 -13
  57. package/dist/chunks/chunk-5BOTHX47.js.map +7 -0
  58. package/dist/chunks/chunk-5QJFDKPN.js +179 -0
  59. package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
  60. package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
  61. package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
  62. package/dist/chunks/{chunk-NF6W327N.js → chunk-7CIES6X2.js} +9 -2
  63. package/dist/chunks/chunk-7CIES6X2.js.map +7 -0
  64. package/dist/chunks/{chunk-KDX3762L.js → chunk-DGERP4VL.js} +4 -4
  65. package/dist/chunks/{chunk-K3ZWBUUL.js → chunk-IOGDTIGN.js} +13 -13
  66. package/dist/chunks/chunk-IOGDTIGN.js.map +7 -0
  67. package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
  68. package/dist/chunks/{chunk-D5224P2R.js → chunk-LKYLD5SN.js} +7 -7
  69. package/dist/chunks/chunk-NENQZCGW.js +45 -0
  70. package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
  71. package/dist/chunks/{chunk-YTYLKL3Z.js → chunk-OJ4HAALD.js} +8 -8
  72. package/dist/chunks/{chunk-TBB7F7WS.js → chunk-PQVUMJ5J.js} +84 -18
  73. package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
  74. package/dist/chunks/chunk-UD7LFV43.js +28 -0
  75. package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
  76. package/dist/chunks/{chunk-CH2QMORW.js → chunk-UFMYN5TA.js} +2 -2
  77. package/dist/chunks/chunk-V4OW2ULC.js +422 -0
  78. package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
  79. package/dist/chunks/{chunk-6C2DMTQC.js → chunk-VNWQIGQL.js} +552 -145
  80. package/dist/chunks/chunk-VNWQIGQL.js.map +7 -0
  81. package/dist/chunks/{chunk-OA5SJT2T.js → chunk-WGMCNCP6.js} +183 -82
  82. package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
  83. package/dist/chunks/{chunk-HAHRJMWY.js → chunk-WWTGWGH7.js} +6 -6
  84. package/dist/chunks/{chunk-F4HL6KJR.js → chunk-X7QETPBC.js} +7 -7
  85. package/dist/chunks/{chunk-SSRSCT2M.js → chunk-XFOSUGLU.js} +4 -4
  86. package/dist/chunks/{chunk-4VGB6HMU.js → chunk-ZFWICFNJ.js} +23 -18
  87. package/dist/chunks/{chunk-4VGB6HMU.js.map → chunk-ZFWICFNJ.js.map} +2 -2
  88. package/dist/commands/fabric-handler.d.ts.map +1 -1
  89. package/dist/commands/fabric-handler.js +43 -7
  90. package/dist/commands/fabric-handler.js.map +2 -2
  91. package/dist/compaction/claim-events.js +2 -2
  92. package/dist/components/configuration.js +3 -3
  93. package/dist/config.d.ts +9 -1
  94. package/dist/config.d.ts.map +1 -1
  95. package/dist/core/action-registry.js +4 -4
  96. package/dist/core/model-aliases.d.ts +22 -0
  97. package/dist/core/model-aliases.d.ts.map +1 -0
  98. package/dist/core/model-resolution.d.ts +41 -20
  99. package/dist/core/model-resolution.d.ts.map +1 -1
  100. package/dist/core/prompt-guidance.js +9 -4
  101. package/dist/core/prompt-guidance.js.map +2 -2
  102. package/dist/core/system-guidance.d.ts.map +1 -1
  103. package/dist/decisions/command.d.ts +2 -1
  104. package/dist/decisions/command.d.ts.map +1 -1
  105. package/dist/decisions/command.js +31 -11
  106. package/dist/decisions/command.js.map +2 -2
  107. package/dist/decisions/events.js +2 -1
  108. package/dist/decisions/events.js.map +1 -1
  109. package/dist/decisions/host.d.ts +8 -0
  110. package/dist/decisions/host.d.ts.map +1 -1
  111. package/dist/decisions/render.d.ts +44 -0
  112. package/dist/decisions/render.d.ts.map +1 -0
  113. package/dist/durable/agent.d.ts +6 -0
  114. package/dist/durable/agent.d.ts.map +1 -1
  115. package/dist/durable/worker-host.d.ts.map +1 -1
  116. package/dist/durable/worker-host.js +7 -1283
  117. package/dist/durable/worker-host.js.map +4 -4
  118. package/dist/durable/worker-options.d.ts +2 -0
  119. package/dist/durable/worker-options.d.ts.map +1 -1
  120. package/dist/durable/worker-role-seed.d.ts +82 -0
  121. package/dist/durable/worker-role-seed.d.ts.map +1 -0
  122. package/dist/durable/worker.js +10 -1
  123. package/dist/durable/worker.js.map +2 -2
  124. package/dist/durable-extension.d.ts +1 -1
  125. package/dist/durable-extension.js +1 -1
  126. package/dist/durable-extension.js.map +1 -1
  127. package/dist/durable-host.d.ts +8 -0
  128. package/dist/durable-host.d.ts.map +1 -0
  129. package/dist/durable-host.js +20 -0
  130. package/dist/durable-host.js.map +7 -0
  131. package/dist/entropy/index.js +1 -1
  132. package/dist/execution-service.d.ts.map +1 -1
  133. package/dist/extension-bootstrap.d.ts.map +1 -1
  134. package/dist/extension-bootstrap.js +16 -16
  135. package/dist/extension.d.ts.map +1 -1
  136. package/dist/fabric-exec-tool.d.ts.map +1 -1
  137. package/dist/fabric-runtime-state.d.ts +2 -0
  138. package/dist/fabric-runtime-state.d.ts.map +1 -1
  139. package/dist/fabric-runtime-state.js +203 -124
  140. package/dist/fabric-runtime-state.js.map +2 -2
  141. package/dist/fabric-state.d.ts +26 -1
  142. package/dist/fabric-state.d.ts.map +1 -1
  143. package/dist/index.js +20 -16
  144. package/dist/index.js.map +1 -1
  145. package/dist/jev/client.js +2 -2
  146. package/dist/jev/observation.js +3 -3
  147. package/dist/jev.js +7 -7
  148. package/dist/protocol.d.ts +84 -0
  149. package/dist/protocol.d.ts.map +1 -1
  150. package/dist/protocol.js +5 -1
  151. package/dist/providers/agents-actions.d.ts.map +1 -1
  152. package/dist/providers/agents-provider.d.ts +3 -0
  153. package/dist/providers/agents-provider.d.ts.map +1 -1
  154. package/dist/providers/jev-provider.js +7 -7
  155. package/dist/residency/host.d.ts.map +1 -1
  156. package/dist/residency/host.js +13 -10
  157. package/dist/residency/pi-entry.js +13 -10
  158. package/dist/residency/pi-entry.js.map +1 -1
  159. package/dist/runtime/core-override-guest-types.js +2 -2
  160. package/dist/runtime/cpython-runtime.js +3 -3
  161. package/dist/runtime/exec-journal.js +3 -3
  162. package/dist/runtime/guest-types.d.ts +1 -1
  163. package/dist/runtime/guest-types.d.ts.map +1 -1
  164. package/dist/runtime/guest-types.js +1 -1
  165. package/dist/runtime/monty-runtime.js +6 -6
  166. package/dist/runtime/node-process-runtime.js +5 -5
  167. package/dist/runtime/quickjs-runtime.js +3 -3
  168. package/dist/runtime/typescript-kernel.js +11 -11
  169. package/dist/storage/retention.d.ts.map +1 -1
  170. package/dist/type-error-guidance.js +1 -1
  171. package/dist/ui/conversation-chrome.js +2 -2
  172. package/dist/ui/conversation.js +10 -10
  173. package/dist/ui/dashboard.d.ts.map +1 -1
  174. package/dist/ui/dashboard.js +14 -12
  175. package/dist/ui/dashboard.js.map +2 -2
  176. package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
  177. package/dist/ui/settings.js +12 -9
  178. package/dist/ui/settings.js.map +2 -2
  179. package/dist/ui/widget.d.ts.map +1 -1
  180. package/dist/verified/generated/actor-name.d.ts +4 -0
  181. package/dist/verified/generated/actor-name.js +17 -0
  182. package/dist/verified/generated/manifest.json +11 -3
  183. package/dist/worker/options.d.ts.map +1 -1
  184. package/dist/worker/options.js +20 -0
  185. package/dist/worker/options.js.map +2 -2
  186. package/dist/worker.js +57 -8
  187. package/dist/worker.js.map +2 -2
  188. package/docs/actor-name-policy-handoff.md +5 -0
  189. package/docs/agents.md +64 -5
  190. package/docs/audit-trace.md +2 -1
  191. package/docs/components.md +1 -1
  192. package/docs/configuration.md +7 -4
  193. package/docs/decisions.md +47 -2
  194. package/docs/durable-pi.md +162 -2
  195. package/docs/interface.md +1 -1
  196. package/docs/providers.md +1 -1
  197. package/docs/verified-kernels.md +1 -0
  198. package/package.json +5 -1
  199. package/proofs/actor-name.ts +27 -0
  200. package/proofs/index.ts +2 -0
  201. package/scripts/verified-kernels.ts +1 -1
  202. package/skillsets/python/fabric-exec/references/agents.md +6 -4
  203. package/skillsets/typescript/fabric-exec/references/agents.md +6 -3
  204. package/dist/chunks/chunk-6C2DMTQC.js.map +0 -7
  205. package/dist/chunks/chunk-JJXUOXI5.js.map +0 -7
  206. package/dist/chunks/chunk-K3ZWBUUL.js.map +0 -7
  207. package/dist/chunks/chunk-KJZAOENY.js +0 -212
  208. package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
  209. package/dist/chunks/chunk-NF6W327N.js.map +0 -7
  210. package/dist/chunks/chunk-OA5SJT2T.js.map +0 -7
  211. package/dist/chunks/chunk-TBB7F7WS.js.map +0 -7
  212. package/dist/chunks/chunk-WQFG7ZVC.js.map +0 -7
  213. package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
  214. package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
  215. /package/dist/chunks/{chunk-6O6UWMBO.js.map → chunk-36XQFTEN.js.map} +0 -0
  216. /package/dist/chunks/{chunk-EYHTTMSM.js.map → chunk-4PBW54I2.js.map} +0 -0
  217. /package/dist/chunks/{chunk-WTIF3MIM.js.map → chunk-56NMRVTV.js.map} +0 -0
  218. /package/dist/chunks/{chunk-KDX3762L.js.map → chunk-DGERP4VL.js.map} +0 -0
  219. /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
  220. /package/dist/chunks/{chunk-D5224P2R.js.map → chunk-LKYLD5SN.js.map} +0 -0
  221. /package/dist/chunks/{chunk-YTYLKL3Z.js.map → chunk-OJ4HAALD.js.map} +0 -0
  222. /package/dist/chunks/{chunk-CH2QMORW.js.map → chunk-UFMYN5TA.js.map} +0 -0
  223. /package/dist/chunks/{chunk-HAHRJMWY.js.map → chunk-WWTGWGH7.js.map} +0 -0
  224. /package/dist/chunks/{chunk-F4HL6KJR.js.map → chunk-X7QETPBC.js.map} +0 -0
  225. /package/dist/chunks/{chunk-SSRSCT2M.js.map → chunk-XFOSUGLU.js.map} +0 -0
@@ -1,8 +1,3 @@
1
- import {
2
- diffLineNumberWidth,
3
- formatDiffLineNumber,
4
- parseDiffLine
5
- } from "./chunk-F2LGSRIN.js";
6
1
  import {
7
2
  ansi256ToRgb,
8
3
  effectiveShikiThemeIsLight,
@@ -14,6 +9,11 @@ import {
14
9
  observedThemeVariant,
15
10
  shikiLanguages
16
11
  } from "./chunk-QNMQJNXE.js";
12
+ import {
13
+ diffLineNumberWidth,
14
+ formatDiffLineNumber,
15
+ parseDiffLine
16
+ } from "./chunk-F2LGSRIN.js";
17
17
  import {
18
18
  countContentLines,
19
19
  headlineArg,
@@ -2614,4 +2614,4 @@ export {
2614
2614
  formatJsonAsYaml,
2615
2615
  formatFabricValue
2616
2616
  };
2617
- //# sourceMappingURL=chunk-HAHRJMWY.js.map
2617
+ //# sourceMappingURL=chunk-WWTGWGH7.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  JevClient,
3
3
  JevCredentials
4
- } from "./chunk-UXIBKMUM.js";
4
+ } from "./chunk-KIFOEBYJ.js";
5
5
  import {
6
6
  checkObserve,
7
7
  jevObserveSchema
8
- } from "./chunk-SSRSCT2M.js";
8
+ } from "./chunk-XFOSUGLU.js";
9
9
  import {
10
10
  JevBilledError,
11
11
  checkSchema,
@@ -20,10 +20,7 @@ import {
20
20
  ApprovalController,
21
21
  FabricAutoApprovalClassifier,
22
22
  FabricSessionApprovals
23
- } from "./chunk-EYHTTMSM.js";
24
- import {
25
- runAbortable
26
- } from "./chunk-7TB7NXSL.js";
23
+ } from "./chunk-4PBW54I2.js";
27
24
  import {
28
25
  DECISION_APIS,
29
26
  DECISION_MAX_BYTES
@@ -31,6 +28,9 @@ import {
31
28
  import {
32
29
  resolveJevModelRoute
33
30
  } from "./chunk-G54PEZ44.js";
31
+ import {
32
+ runAbortable
33
+ } from "./chunk-7TB7NXSL.js";
34
34
 
35
35
  // src/providers/jev-provider.ts
36
36
  import { Type as Type2 } from "typebox";
@@ -867,4 +867,4 @@ export {
867
867
  JEV_ACTION_DESCRIPTORS,
868
868
  JevProvider
869
869
  };
870
- //# sourceMappingURL=chunk-F4HL6KJR.js.map
870
+ //# sourceMappingURL=chunk-X7QETPBC.js.map
@@ -1,9 +1,9 @@
1
- import {
2
- prepareFabricActorHostPayload
3
- } from "./chunk-4XMXFHAR.js";
4
1
  import {
5
2
  object
6
3
  } from "./chunk-FSYAGCGA.js";
4
+ import {
5
+ prepareFabricActorHostPayload
6
+ } from "./chunk-4XMXFHAR.js";
7
7
  import {
8
8
  validationMessage
9
9
  } from "./chunk-7N7IC3Z2.js";
@@ -283,4 +283,4 @@ export {
283
283
  JevObservationHost,
284
284
  JevSubscription
285
285
  };
286
- //# sourceMappingURL=chunk-SSRSCT2M.js.map
286
+ //# sourceMappingURL=chunk-XFOSUGLU.js.map
@@ -790,15 +790,16 @@ var labelForCall = (ref, args) => {
790
790
  const target = headlineArg(args, MAX_NAME_CHARS);
791
791
  return target ? `${ref} \xB7 ${target}` : ref;
792
792
  };
793
+ var finiteCount = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : void 0;
793
794
  var metricsFrom = (value) => {
794
795
  if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
795
796
  const record = value;
796
797
  const usage = typeof record.usage === "object" && record.usage !== null && !Array.isArray(record.usage) ? record.usage : void 0;
797
- const input = typeof usage?.input === "number" ? usage.input : 0;
798
- const output = typeof usage?.output === "number" ? usage.output : 0;
798
+ const input = finiteCount(usage?.input) ?? 0;
799
+ const output = finiteCount(usage?.output) ?? 0;
799
800
  const tokens = input + output;
800
- const toolCalls = typeof record.toolCalls === "number" ? record.toolCalls : void 0;
801
- const cost = typeof usage?.cost === "number" ? usage.cost : void 0;
801
+ const toolCalls = finiteCount(record.toolCalls);
802
+ const cost = finiteCount(usage?.cost);
802
803
  if (tokens <= 0 && toolCalls === void 0 && cost === void 0) return void 0;
803
804
  return {
804
805
  ...tokens > 0 ? { tokens } : {},
@@ -806,10 +807,11 @@ var metricsFrom = (value) => {
806
807
  ...cost !== void 0 ? { cost } : {}
807
808
  };
808
809
  };
809
- var isFailedResult = (value) => {
810
- if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
810
+ var resultStatus = (value) => {
811
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
811
812
  const status = value.status;
812
- return status === "failed" || status === "stopped" || status === "timed_out";
813
+ if (status === "stopped") return "stopped";
814
+ return status === "failed" || status === "timed_out" ? "failed" : void 0;
813
815
  };
814
816
  var freezeProjection = (value) => {
815
817
  const pending = [value];
@@ -965,8 +967,8 @@ var FabricActivityStore = class {
965
967
  const label = cleanText(input.label, MAX_NAME_CHARS);
966
968
  if (!label) throw new Error("Workflow activity item label must not be empty");
967
969
  const now = Date.now();
968
- const status = input.status ?? "running";
969
970
  let item = run.items.find((candidate) => candidate.id === id);
971
+ const status = input.status ?? item?.status ?? "running";
970
972
  const phaseId = input.phase !== void 0 ? this.#resolvePhaseId(run, input.phase) : item?.phaseId ?? run.currentPhaseId;
971
973
  const detail = cleanText(input.detail, MAX_DETAIL_CHARS);
972
974
  const current = cleanText(input.current, MAX_DETAIL_CHARS);
@@ -1101,16 +1103,19 @@ var FabricActivityStore = class {
1101
1103
  const message = cleanText(update.message, MAX_DETAIL_CHARS);
1102
1104
  if (message) call.progress = message;
1103
1105
  } else if (update.type === "entity") {
1104
- call.entityId = cleanId(update.id, update.id);
1106
+ call.entityId = cleanId(update.id, update.id.slice(0, 160));
1105
1107
  call.entityKind = update.kind;
1106
1108
  const name = cleanText(update.name, MAX_NAME_CHARS);
1107
1109
  if (name) call.label = name;
1108
1110
  } else if (update.type === "metrics") {
1111
+ const tokens = finiteCount(update.tokens);
1112
+ const toolCalls = finiteCount(update.toolCalls);
1113
+ const cost = finiteCount(update.cost);
1109
1114
  call.metrics = {
1110
1115
  ...call.metrics ?? {},
1111
- ...typeof update.tokens === "number" ? { tokens: Math.max(0, update.tokens) } : {},
1112
- ...typeof update.toolCalls === "number" ? { toolCalls: Math.max(0, update.toolCalls) } : {},
1113
- ...typeof update.cost === "number" ? { cost: Math.max(0, update.cost) } : {}
1116
+ ...tokens !== void 0 ? { tokens } : {},
1117
+ ...toolCalls !== void 0 ? { toolCalls } : {},
1118
+ ...cost !== void 0 ? { cost } : {}
1114
1119
  };
1115
1120
  }
1116
1121
  if (before.progress === call.progress && before.entityId === call.entityId && before.entityKind === call.entityKind && before.label === call.label && Object.is(before.metrics?.tokens, call.metrics?.tokens) && Object.is(before.metrics?.toolCalls, call.metrics?.toolCalls) && Object.is(before.metrics?.cost, call.metrics?.cost)) {
@@ -1128,8 +1133,8 @@ var FabricActivityStore = class {
1128
1133
  const call = this.#callIndex.get(runId)?.get(callId);
1129
1134
  if (!call) return;
1130
1135
  const now = Date.now();
1131
- const resultFailed = isFailedResult(input.result);
1132
- call.status = input.success && !resultFailed ? "completed" : "failed";
1136
+ const reported = resultStatus(input.result);
1137
+ call.status = !input.success ? "failed" : reported ?? "completed";
1133
1138
  call.updatedAt = now;
1134
1139
  call.finishedAt = now;
1135
1140
  const error = cleanText(input.error, MAX_DETAIL_CHARS);
@@ -1148,7 +1153,7 @@ var FabricActivityStore = class {
1148
1153
  }
1149
1154
  if (typeof input.result === "object" && input.result !== null && !Array.isArray(input.result)) {
1150
1155
  const record = input.result;
1151
- if (typeof record.id === "string") call.entityId = cleanId(record.id, record.id);
1156
+ if (typeof record.id === "string") call.entityId = cleanId(record.id, record.id.slice(0, 160));
1152
1157
  if (call.kind === "agent") call.entityKind = "agent";
1153
1158
  if (call.kind === "actor") call.entityKind = "actor";
1154
1159
  if (!error && typeof record.error === "string") {
@@ -1159,11 +1164,11 @@ var FabricActivityStore = class {
1159
1164
  run.updatedAt = now;
1160
1165
  this.#emit(run, call);
1161
1166
  }
1162
- finish(runId, success, error) {
1167
+ /** `cancelled` comes from the caller's abort signal, never from error text. */
1168
+ finish(runId, success, error, cancelled = false) {
1163
1169
  const run = this.#runs.get(runId);
1164
1170
  if (!run || run.status !== "running") return;
1165
1171
  const now = Date.now();
1166
- const cancelled = Boolean(error && /cancel(?:led|ed)/i.test(error));
1167
1172
  run.status = success ? "completed" : cancelled ? "cancelled" : "failed";
1168
1173
  run.updatedAt = now;
1169
1174
  run.finishedAt = now;
@@ -1845,4 +1850,4 @@ export {
1845
1850
  captureLoadedFileIdentity,
1846
1851
  runtimeIdentityStatus
1847
1852
  };
1848
- //# sourceMappingURL=chunk-4VGB6HMU.js.map
1853
+ //# sourceMappingURL=chunk-ZFWICFNJ.js.map