@narumitw/pi-subagents 2.1.3 → 3.0.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 (314) hide show
  1. package/README.md +181 -1250
  2. package/dist/child-communication-bridge.ts +136 -0
  3. package/dist/child-communication-bridge.ts.map +7 -0
  4. package/dist/chunks/chunk-UKTWUQRM.js +667 -0
  5. package/dist/chunks/chunk-UKTWUQRM.js.map +7 -0
  6. package/dist/index.ts +1448 -1598
  7. package/dist/index.ts.map +4 -4
  8. package/docs/design-principles.md +31 -0
  9. package/docs/ipc-transport-idea.md +103 -0
  10. package/docs/tools.md +109 -0
  11. package/package.json +11 -19
  12. package/src/broker-credentials.ts +71 -0
  13. package/src/child-communication-bridge.ts +153 -0
  14. package/src/child-communication-tools.ts +147 -0
  15. package/src/completion-renderer.ts +60 -0
  16. package/src/index.ts +1 -1
  17. package/src/message-broker.ts +628 -0
  18. package/src/model-output.ts +42 -0
  19. package/src/process.ts +688 -0
  20. package/src/runtime.ts +538 -0
  21. package/src/subagents.ts +33 -34
  22. package/src/tools.ts +416 -0
  23. package/src/types.ts +85 -0
  24. package/src/widget.ts +130 -0
  25. package/dist/chunks/auto-transport-FUUKFDIG.ts +0 -109
  26. package/dist/chunks/auto-transport-FUUKFDIG.ts.map +0 -7
  27. package/dist/chunks/capability-grant-PR72SWWS.ts +0 -19
  28. package/dist/chunks/capability-grant-PR72SWWS.ts.map +0 -7
  29. package/dist/chunks/child-peer-bridge.ts +0 -108
  30. package/dist/chunks/child-peer-bridge.ts.map +0 -7
  31. package/dist/chunks/chunk-2LMJU25E.ts +0 -1641
  32. package/dist/chunks/chunk-2LMJU25E.ts.map +0 -7
  33. package/dist/chunks/chunk-47SK2QYC.ts +0 -56
  34. package/dist/chunks/chunk-47SK2QYC.ts.map +0 -7
  35. package/dist/chunks/chunk-4AQSF7AS.ts +0 -29
  36. package/dist/chunks/chunk-4AQSF7AS.ts.map +0 -7
  37. package/dist/chunks/chunk-5DGRMKNV.ts +0 -126
  38. package/dist/chunks/chunk-5DGRMKNV.ts.map +0 -7
  39. package/dist/chunks/chunk-6H6TBBED.ts +0 -108
  40. package/dist/chunks/chunk-6H6TBBED.ts.map +0 -7
  41. package/dist/chunks/chunk-6KJ34M6S.ts +0 -159
  42. package/dist/chunks/chunk-6KJ34M6S.ts.map +0 -7
  43. package/dist/chunks/chunk-6NSJVPXX.ts +0 -480
  44. package/dist/chunks/chunk-6NSJVPXX.ts.map +0 -7
  45. package/dist/chunks/chunk-7AAJEUSL.ts +0 -238
  46. package/dist/chunks/chunk-7AAJEUSL.ts.map +0 -7
  47. package/dist/chunks/chunk-BFK2Z4ZF.ts +0 -189
  48. package/dist/chunks/chunk-BFK2Z4ZF.ts.map +0 -7
  49. package/dist/chunks/chunk-BOAXY55Y.ts +0 -153
  50. package/dist/chunks/chunk-BOAXY55Y.ts.map +0 -7
  51. package/dist/chunks/chunk-D4CR7T73.ts +0 -353
  52. package/dist/chunks/chunk-D4CR7T73.ts.map +0 -7
  53. package/dist/chunks/chunk-FEVPWRMU.ts +0 -300
  54. package/dist/chunks/chunk-FEVPWRMU.ts.map +0 -7
  55. package/dist/chunks/chunk-G6VZTCFH.ts +0 -70
  56. package/dist/chunks/chunk-G6VZTCFH.ts.map +0 -7
  57. package/dist/chunks/chunk-H3FP6DLR.ts +0 -160
  58. package/dist/chunks/chunk-H3FP6DLR.ts.map +0 -7
  59. package/dist/chunks/chunk-HA36LPCO.ts +0 -130
  60. package/dist/chunks/chunk-HA36LPCO.ts.map +0 -7
  61. package/dist/chunks/chunk-HOP5FXDT.ts +0 -27
  62. package/dist/chunks/chunk-HOP5FXDT.ts.map +0 -7
  63. package/dist/chunks/chunk-IGAMVWFN.ts +0 -139
  64. package/dist/chunks/chunk-IGAMVWFN.ts.map +0 -7
  65. package/dist/chunks/chunk-ILEQ27AL.ts +0 -45
  66. package/dist/chunks/chunk-ILEQ27AL.ts.map +0 -7
  67. package/dist/chunks/chunk-ITVWPNU4.ts +0 -819
  68. package/dist/chunks/chunk-ITVWPNU4.ts.map +0 -7
  69. package/dist/chunks/chunk-IWC32VPY.ts +0 -172
  70. package/dist/chunks/chunk-IWC32VPY.ts.map +0 -7
  71. package/dist/chunks/chunk-JSZIP73U.ts +0 -362
  72. package/dist/chunks/chunk-JSZIP73U.ts.map +0 -7
  73. package/dist/chunks/chunk-JU6LUNLP.ts +0 -380
  74. package/dist/chunks/chunk-JU6LUNLP.ts.map +0 -7
  75. package/dist/chunks/chunk-KMGKCEO4.ts +0 -38
  76. package/dist/chunks/chunk-KMGKCEO4.ts.map +0 -7
  77. package/dist/chunks/chunk-LASD73CM.ts +0 -339
  78. package/dist/chunks/chunk-LASD73CM.ts.map +0 -7
  79. package/dist/chunks/chunk-LEOYDZI3.ts +0 -22
  80. package/dist/chunks/chunk-LEOYDZI3.ts.map +0 -7
  81. package/dist/chunks/chunk-LL4LP2T7.ts +0 -737
  82. package/dist/chunks/chunk-LL4LP2T7.ts.map +0 -7
  83. package/dist/chunks/chunk-N2T5IN4X.ts +0 -18
  84. package/dist/chunks/chunk-N2T5IN4X.ts.map +0 -7
  85. package/dist/chunks/chunk-N7BLVXKK.ts +0 -73
  86. package/dist/chunks/chunk-N7BLVXKK.ts.map +0 -7
  87. package/dist/chunks/chunk-NLT67IZS.ts +0 -322
  88. package/dist/chunks/chunk-NLT67IZS.ts.map +0 -7
  89. package/dist/chunks/chunk-NTRPLF46.ts +0 -63
  90. package/dist/chunks/chunk-NTRPLF46.ts.map +0 -7
  91. package/dist/chunks/chunk-ONDTY4EL.ts +0 -91
  92. package/dist/chunks/chunk-ONDTY4EL.ts.map +0 -7
  93. package/dist/chunks/chunk-OVPHFGKO.ts +0 -1769
  94. package/dist/chunks/chunk-OVPHFGKO.ts.map +0 -7
  95. package/dist/chunks/chunk-P7OH4XMF.ts +0 -60
  96. package/dist/chunks/chunk-P7OH4XMF.ts.map +0 -7
  97. package/dist/chunks/chunk-PBZMBTNJ.ts +0 -422
  98. package/dist/chunks/chunk-PBZMBTNJ.ts.map +0 -7
  99. package/dist/chunks/chunk-PGLSFLYW.ts +0 -52
  100. package/dist/chunks/chunk-PGLSFLYW.ts.map +0 -7
  101. package/dist/chunks/chunk-RRR66UWR.ts +0 -28
  102. package/dist/chunks/chunk-RRR66UWR.ts.map +0 -7
  103. package/dist/chunks/chunk-RSUXZD6S.ts +0 -275
  104. package/dist/chunks/chunk-RSUXZD6S.ts.map +0 -7
  105. package/dist/chunks/chunk-RTCVYIZA.ts +0 -221
  106. package/dist/chunks/chunk-RTCVYIZA.ts.map +0 -7
  107. package/dist/chunks/chunk-RY2AEGMZ.ts +0 -34
  108. package/dist/chunks/chunk-RY2AEGMZ.ts.map +0 -7
  109. package/dist/chunks/chunk-SWGQLFSD.ts +0 -60
  110. package/dist/chunks/chunk-SWGQLFSD.ts.map +0 -7
  111. package/dist/chunks/chunk-TM2R67J3.ts +0 -52
  112. package/dist/chunks/chunk-TM2R67J3.ts.map +0 -7
  113. package/dist/chunks/chunk-TMZRHIIK.ts +0 -497
  114. package/dist/chunks/chunk-TMZRHIIK.ts.map +0 -7
  115. package/dist/chunks/chunk-TZ34IQ3M.ts +0 -59
  116. package/dist/chunks/chunk-TZ34IQ3M.ts.map +0 -7
  117. package/dist/chunks/chunk-UMBPMVJW.ts +0 -22
  118. package/dist/chunks/chunk-UMBPMVJW.ts.map +0 -7
  119. package/dist/chunks/chunk-VDG7LTYE.ts +0 -80
  120. package/dist/chunks/chunk-VDG7LTYE.ts.map +0 -7
  121. package/dist/chunks/chunk-X4NMONPE.ts +0 -73
  122. package/dist/chunks/chunk-X4NMONPE.ts.map +0 -7
  123. package/dist/chunks/chunk-YPJEN6NU.ts +0 -65
  124. package/dist/chunks/chunk-YPJEN6NU.ts.map +0 -7
  125. package/dist/chunks/chunk-YU53SHA7.ts +0 -328
  126. package/dist/chunks/chunk-YU53SHA7.ts.map +0 -7
  127. package/dist/chunks/completion-delivery-RSJU6BXL.ts +0 -17
  128. package/dist/chunks/completion-delivery-RSJU6BXL.ts.map +0 -7
  129. package/dist/chunks/config-status-FKGDECZ3.ts +0 -35
  130. package/dist/chunks/config-status-FKGDECZ3.ts.map +0 -7
  131. package/dist/chunks/config-ui-ABHYNGQ7.ts +0 -1212
  132. package/dist/chunks/config-ui-ABHYNGQ7.ts.map +0 -7
  133. package/dist/chunks/consult-LJU3IQY5.ts +0 -519
  134. package/dist/chunks/consult-LJU3IQY5.ts.map +0 -7
  135. package/dist/chunks/context-QDKLVQXE.ts +0 -11
  136. package/dist/chunks/context-QDKLVQXE.ts.map +0 -7
  137. package/dist/chunks/create-stateful-transport-JWC2EFYL.ts +0 -130
  138. package/dist/chunks/create-stateful-transport-JWC2EFYL.ts.map +0 -7
  139. package/dist/chunks/cwd-policy-NB6XZ5GF.ts +0 -17
  140. package/dist/chunks/cwd-policy-NB6XZ5GF.ts.map +0 -7
  141. package/dist/chunks/delegation-contract-LA56I5DT.ts +0 -24
  142. package/dist/chunks/delegation-contract-LA56I5DT.ts.map +0 -7
  143. package/dist/chunks/discovery-MIFB2U4Y.ts +0 -12
  144. package/dist/chunks/discovery-MIFB2U4Y.ts.map +0 -7
  145. package/dist/chunks/execution-Q2JZLKJA.ts +0 -4037
  146. package/dist/chunks/execution-Q2JZLKJA.ts.map +0 -7
  147. package/dist/chunks/in-process-transport-HJ6TZXC3.ts +0 -39
  148. package/dist/chunks/in-process-transport-HJ6TZXC3.ts.map +0 -7
  149. package/dist/chunks/inspect-UH2TKH6E.ts +0 -634
  150. package/dist/chunks/inspect-UH2TKH6E.ts.map +0 -7
  151. package/dist/chunks/peer-communication-KL36Z6CO.ts +0 -294
  152. package/dist/chunks/peer-communication-KL36Z6CO.ts.map +0 -7
  153. package/dist/chunks/persistence-UY3PY6E5.ts +0 -348
  154. package/dist/chunks/persistence-UY3PY6E5.ts.map +0 -7
  155. package/dist/chunks/registry-BT54L6CY.ts +0 -1445
  156. package/dist/chunks/registry-BT54L6CY.ts.map +0 -7
  157. package/dist/chunks/retained-semantic-state-GM75FZGE.ts +0 -81
  158. package/dist/chunks/retained-semantic-state-GM75FZGE.ts.map +0 -7
  159. package/dist/chunks/rpc-transport-7R7DVCEB.ts +0 -1222
  160. package/dist/chunks/rpc-transport-7R7DVCEB.ts.map +0 -7
  161. package/dist/chunks/runtime-policy-5YELCOVC.ts +0 -15
  162. package/dist/chunks/runtime-policy-5YELCOVC.ts.map +0 -7
  163. package/dist/chunks/semantic-snapshot-WPJ3UAFW.ts +0 -19
  164. package/dist/chunks/semantic-snapshot-WPJ3UAFW.ts.map +0 -7
  165. package/dist/chunks/spawn-idempotency-BNHOSMZW.ts +0 -13
  166. package/dist/chunks/spawn-idempotency-BNHOSMZW.ts.map +0 -7
  167. package/dist/chunks/stateful-lifecycle-JAR6K55H.ts +0 -15
  168. package/dist/chunks/stateful-lifecycle-JAR6K55H.ts.map +0 -7
  169. package/dist/chunks/subprocess-transport-VHZJRBTW.ts +0 -160
  170. package/dist/chunks/subprocess-transport-VHZJRBTW.ts.map +0 -7
  171. package/dist/chunks/usage-recording-store-CW3EH2SZ.ts +0 -164
  172. package/dist/chunks/usage-recording-store-CW3EH2SZ.ts.map +0 -7
  173. package/dist/chunks/workspace-WDKLN72J.ts +0 -11
  174. package/dist/chunks/workspace-WDKLN72J.ts.map +0 -7
  175. package/docs/async-runtime-protocol.md +0 -84
  176. package/docs/implementation-notes/pi-subagents-capability-matrix.md +0 -62
  177. package/docs/implementation-notes/pi-subagents-current-direction.md +0 -99
  178. package/docs/implementation-notes/pi-subagents-rpc-v1.md +0 -153
  179. package/docs/pi-subagents-diagrams.md +0 -183
  180. package/src/adaptive-scheduler.ts +0 -224
  181. package/src/admission-benchmark.ts +0 -95
  182. package/src/admission-policy.ts +0 -78
  183. package/src/agent-projection.ts +0 -53
  184. package/src/agents/built-ins.ts +0 -71
  185. package/src/agents/catalog.ts +0 -241
  186. package/src/agents/discovery.ts +0 -265
  187. package/src/agents/types.ts +0 -100
  188. package/src/agents.ts +0 -51
  189. package/src/async-subagent-benchmark.ts +0 -532
  190. package/src/auto-transport.ts +0 -121
  191. package/src/blocking-status.ts +0 -63
  192. package/src/cached-module-loader.ts +0 -18
  193. package/src/capabilities.ts +0 -145
  194. package/src/capability-grant.ts +0 -115
  195. package/src/capability-router.ts +0 -107
  196. package/src/child-peer-bridge.ts +0 -124
  197. package/src/child-peer-tools.ts +0 -132
  198. package/src/completion-delivery.ts +0 -409
  199. package/src/completion-render.ts +0 -190
  200. package/src/completion-requirement.ts +0 -479
  201. package/src/completion-routing.ts +0 -24
  202. package/src/config-registration.ts +0 -114
  203. package/src/config-status.ts +0 -217
  204. package/src/config-ui.ts +0 -983
  205. package/src/consult-policy.ts +0 -15
  206. package/src/consult-registration.ts +0 -125
  207. package/src/consult-render.ts +0 -194
  208. package/src/consult-resources.ts +0 -51
  209. package/src/consult-tool.ts +0 -95
  210. package/src/consult.ts +0 -566
  211. package/src/context.ts +0 -126
  212. package/src/create-stateful-transport.ts +0 -157
  213. package/src/cwd-policy.ts +0 -183
  214. package/src/delegation-contract.ts +0 -463
  215. package/src/execution/budget.ts +0 -56
  216. package/src/execution/runtime-policy.ts +0 -19
  217. package/src/execution-plan.ts +0 -322
  218. package/src/execution-ui.ts +0 -259
  219. package/src/execution.ts +0 -1679
  220. package/src/in-process-transport.ts +0 -941
  221. package/src/inspect-registration.ts +0 -64
  222. package/src/inspect-render.ts +0 -334
  223. package/src/inspect-tool.ts +0 -45
  224. package/src/inspect.ts +0 -769
  225. package/src/integration-controller.ts +0 -98
  226. package/src/limits.ts +0 -75
  227. package/src/orchestration-metrics.ts +0 -116
  228. package/src/outcome.ts +0 -61
  229. package/src/panel-child-group.ts +0 -35
  230. package/src/panel-contract.ts +0 -343
  231. package/src/panel-evidence.ts +0 -59
  232. package/src/panel-execution.ts +0 -769
  233. package/src/panel-failure.ts +0 -56
  234. package/src/panel-planning.ts +0 -175
  235. package/src/panel-presets.ts +0 -3
  236. package/src/panel-prompts.ts +0 -132
  237. package/src/panel-reconciliation.ts +0 -57
  238. package/src/panel-render.ts +0 -103
  239. package/src/parallel-limit-ui.ts +0 -113
  240. package/src/params.ts +0 -278
  241. package/src/peer-communication.ts +0 -352
  242. package/src/peer-transport.ts +0 -49
  243. package/src/persistence.ts +0 -522
  244. package/src/pi-args.ts +0 -43
  245. package/src/pi-invocation.ts +0 -168
  246. package/src/process-control.ts +0 -43
  247. package/src/prompt-resources.ts +0 -38
  248. package/src/prompt-source-safety.ts +0 -48
  249. package/src/protocol.ts +0 -76
  250. package/src/registry-types.ts +0 -204
  251. package/src/registry.ts +0 -1698
  252. package/src/render-common.ts +0 -252
  253. package/src/render.ts +0 -704
  254. package/src/result-contract.ts +0 -431
  255. package/src/retained-semantic-state.ts +0 -100
  256. package/src/rpc-timeout-finalization.ts +0 -207
  257. package/src/rpc-transport-metadata.ts +0 -65
  258. package/src/rpc-transport.ts +0 -1035
  259. package/src/rpc-turn-capture.ts +0 -217
  260. package/src/runner-outcome.ts +0 -31
  261. package/src/runner-result.ts +0 -55
  262. package/src/runner-types.ts +0 -102
  263. package/src/runner-usage.ts +0 -48
  264. package/src/runner.ts +0 -866
  265. package/src/safe-text.ts +0 -67
  266. package/src/semantic-snapshot.ts +0 -214
  267. package/src/session-guidance-contract.ts +0 -399
  268. package/src/settings/inspection.ts +0 -302
  269. package/src/settings/schema.ts +0 -195
  270. package/src/settings-reader.ts +0 -215
  271. package/src/settings.ts +0 -452
  272. package/src/spawn-idempotency.ts +0 -68
  273. package/src/stateful-agent-view.ts +0 -85
  274. package/src/stateful-config.ts +0 -13
  275. package/src/stateful-guidance.ts +0 -29
  276. package/src/stateful-lifecycle.ts +0 -74
  277. package/src/stateful-limit-ui.ts +0 -249
  278. package/src/stateful-limits.ts +0 -96
  279. package/src/stateful-prompt.ts +0 -49
  280. package/src/stateful-registration.ts +0 -1320
  281. package/src/stateful-render.ts +0 -318
  282. package/src/stateful-safety.ts +0 -47
  283. package/src/stateful-tool-params.ts +0 -215
  284. package/src/stateful.ts +0 -12
  285. package/src/subagent-details.ts +0 -43
  286. package/src/subagents-extension.ts +0 -355
  287. package/src/subprocess-transport.ts +0 -145
  288. package/src/supervision.ts +0 -104
  289. package/src/task-path.ts +0 -65
  290. package/src/timeout-checkpoint.ts +0 -305
  291. package/src/timeout-finalization.ts +0 -75
  292. package/src/tool-schema-compatibility.ts +0 -73
  293. package/src/transport-types.ts +0 -74
  294. package/src/transport-ui.ts +0 -135
  295. package/src/transport.ts +0 -43
  296. package/src/turn-budget.ts +0 -109
  297. package/src/usage-format.ts +0 -42
  298. package/src/usage-recording-config.ts +0 -13
  299. package/src/usage-recording-store.ts +0 -183
  300. package/src/usage-recording.ts +0 -478
  301. package/src/verification-harness.ts +0 -516
  302. package/src/verification-policy.ts +0 -67
  303. package/src/verification-receipt.ts +0 -275
  304. package/src/verified-execution-benchmark.ts +0 -86
  305. package/src/verified-execution-contract.ts +0 -191
  306. package/src/verified-execution-schema.ts +0 -32
  307. package/src/work-item-ledger.ts +0 -1404
  308. package/src/work-item-persistence.ts +0 -254
  309. package/src/workflow-completion-controller.ts +0 -397
  310. package/src/workflow-planning.ts +0 -172
  311. package/src/workflow-tree-identity.ts +0 -289
  312. package/src/workflow-ui.ts +0 -69
  313. package/src/workflow-verification.ts +0 -296
  314. package/src/workspace.ts +0 -174
@@ -1,348 +0,0 @@
1
- // @generated by scripts/build-runtime.mjs; do not edit.
2
- // @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
3
- import {
4
- isSemanticSnapshot
5
- } from "./chunk-BOAXY55Y.ts";
6
- import {
7
- isCapabilityGrant,
8
- revokeCapabilityGrant
9
- } from "./chunk-YPJEN6NU.ts";
10
- import {
11
- copyExecutionPlan,
12
- isExecutionPlan
13
- } from "./chunk-7AAJEUSL.ts";
14
- import {
15
- validateTaskName,
16
- validateTaskPath
17
- } from "./chunk-N7BLVXKK.ts";
18
- import {
19
- copyTurnTerminationReport
20
- } from "./chunk-RTCVYIZA.ts";
21
- import {
22
- MAX_SUBAGENT_TOOL_CALLS,
23
- MAX_SUBAGENT_TURNS
24
- } from "./chunk-ONDTY4EL.ts";
25
- import {
26
- SUBAGENT_RESULT_FORMATS,
27
- parseAnyStructuredSubagentResult
28
- } from "./chunk-RSUXZD6S.ts";
29
- import {
30
- projectAgentRecords
31
- } from "./chunk-KMGKCEO4.ts";
32
- import {
33
- resolveStatefulLimits
34
- } from "./chunk-VDG7LTYE.ts";
35
- import {
36
- isThinkingLevel
37
- } from "./chunk-4AQSF7AS.ts";
38
- import {
39
- isCompletionRequirementRecord
40
- } from "./chunk-NLT67IZS.ts";
41
- import {
42
- normalizeDelegationContract
43
- } from "./chunk-JSZIP73U.ts";
44
- import {
45
- MAX_SUBAGENT_TIMEOUT_MS,
46
- redactPrivateText
47
- } from "./chunk-H3FP6DLR.ts";
48
-
49
- // src/persistence.ts
50
- import { createHash } from "node:crypto";
51
- import * as fs from "node:fs";
52
- import * as path from "node:path";
53
- import { getAgentDir, withFileMutationQueue } from "@earendil-works/pi-coding-agent";
54
- var STATE_VERSION = 3;
55
- var MAX_STORED_COMPLETIONS_PER_AGENT = 20;
56
- var DEFAULT_STATEFUL_LIMITS = resolveStatefulLimits();
57
- var MAX_STATE_BYTES = 5 * 1024 * 1024;
58
- var AgentPersistence = class {
59
- filePath;
60
- retentionMs;
61
- maxStoredAgents;
62
- constructor(owner, options = {}) {
63
- const retentionDays = options.retentionDays ?? 30;
64
- if (!Number.isFinite(retentionDays) || retentionDays <= 0) {
65
- throw new Error("Subagent retentionDays must be a positive finite number");
66
- }
67
- const retentionMs = retentionDays * 24 * 60 * 60 * 1e3;
68
- if (!Number.isFinite(retentionMs)) {
69
- throw new Error("Subagent retentionDays is too large");
70
- }
71
- const maxStoredAgents = options.maxStoredAgents ?? DEFAULT_STATEFUL_LIMITS.maxStoredAgents;
72
- if (!Number.isSafeInteger(maxStoredAgents) || maxStoredAgents < 1) {
73
- throw new Error("Subagent maxStoredAgents must be a positive safe integer");
74
- }
75
- const safeOwner = createHash("sha256").update(owner).digest("hex").slice(0, 24);
76
- const stateDir = options.stateDir ?? path.join(getAgentDir(), "pi-subagents-state");
77
- this.filePath = path.join(stateDir, `${safeOwner}.json`);
78
- this.retentionMs = retentionMs;
79
- this.maxStoredAgents = maxStoredAgents;
80
- }
81
- load() {
82
- if (!fs.existsSync(this.filePath)) return [];
83
- try {
84
- const stat = fs.statSync(this.filePath);
85
- if (stat.size > MAX_STATE_BYTES) throw new Error("state exceeds size limit");
86
- const parsed = JSON.parse(fs.readFileSync(this.filePath, "utf8"));
87
- if (!isStoredState(parsed)) throw new Error("unsupported or malformed state");
88
- const cutoff = Date.now() - this.retentionMs;
89
- return projectAgentRecords(
90
- parsed.agents.filter((agent) => agent.updatedAt >= cutoff && agent.state !== "closed"),
91
- { maxAgents: this.maxStoredAgents }
92
- ).map(sanitizeAgent);
93
- } catch {
94
- this.quarantine();
95
- return [];
96
- }
97
- }
98
- async save(agents) {
99
- const cutoff = Date.now() - this.retentionMs;
100
- const eligible = agents.filter(
101
- (agent) => agent.state !== "closed" && agent.updatedAt >= cutoff
102
- );
103
- const records = projectAgentRecords(eligible, {
104
- maxAgents: this.maxStoredAgents
105
- }).map(sanitizeAgent);
106
- const state = { version: STATE_VERSION, updatedAt: Date.now(), agents: records };
107
- let content = `${JSON.stringify(state, null, " ")}
108
- `;
109
- while (Buffer.byteLength(content, "utf8") > MAX_STATE_BYTES && state.agents.length > 0) {
110
- const rootsWithPendingCompletions = new Set(
111
- state.agents.filter((agent) => (agent.pendingCompletions?.length ?? 0) > 0).map((agent) => agent.rootId)
112
- );
113
- const droppableRoot = state.agents.find(
114
- (agent) => !rootsWithPendingCompletions.has(agent.rootId)
115
- )?.rootId;
116
- if (droppableRoot) {
117
- state.agents = state.agents.filter((agent) => agent.rootId !== droppableRoot);
118
- } else if (!trimOldestHistory(state.agents) && !clearOldestContext(state.agents)) {
119
- throw new Error("Subagent state exceeds its durable completion storage limit");
120
- }
121
- content = `${JSON.stringify(state, null, " ")}
122
- `;
123
- }
124
- await fs.promises.mkdir(path.dirname(this.filePath), { recursive: true });
125
- await withFileMutationQueue(this.filePath, async () => {
126
- const tempPath = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;
127
- await fs.promises.writeFile(tempPath, content, { encoding: "utf8", mode: 384 });
128
- await fs.promises.rename(tempPath, this.filePath);
129
- });
130
- }
131
- async delete() {
132
- await withFileMutationQueue(this.filePath, async () => {
133
- await fs.promises.rm(this.filePath, { force: true });
134
- });
135
- }
136
- quarantine() {
137
- try {
138
- fs.renameSync(this.filePath, `${this.filePath}.invalid-${Date.now()}`);
139
- } catch {
140
- }
141
- }
142
- };
143
- function trimOldestHistory(agents) {
144
- const candidate = agents.filter((agent) => agent.history.length > 0).sort(
145
- (left, right) => (left.history[0]?.completedAt ?? Number.POSITIVE_INFINITY) - (right.history[0]?.completedAt ?? Number.POSITIVE_INFINITY)
146
- )[0];
147
- if (!candidate) return false;
148
- candidate.history.shift();
149
- return true;
150
- }
151
- function clearOldestContext(agents) {
152
- const candidate = agents.find((agent) => agent.context !== void 0);
153
- if (!candidate) return false;
154
- candidate.context = void 0;
155
- candidate.contextTruncated = true;
156
- return true;
157
- }
158
- function sanitizeAgent(agent) {
159
- return {
160
- ...agent,
161
- rootId: agent.rootId ?? agent.id,
162
- depth: agent.depth ?? 0,
163
- children: [...agent.children ?? []],
164
- mailbox: (agent.mailbox ?? []).map((message) => ({
165
- ...message,
166
- recipientId: agent.id,
167
- content: redactPrivateText(message.content)
168
- })),
169
- state: agent.state === "running" || agent.state === "starting" ? "interrupted" : agent.state,
170
- currentTask: void 0,
171
- currentRunId: void 0,
172
- currentTurnGeneration: void 0,
173
- turnGeneration: agent.turnGeneration ?? 0,
174
- pendingCompletions: (agent.pendingCompletions ?? []).slice(-MAX_STORED_COMPLETIONS_PER_AGENT).map((completion) => ({
175
- ...completion,
176
- task: redactPrivateText(completion.task),
177
- output: redactPrivateText(completion.output),
178
- error: completion.error ? redactPrivateText(completion.error) : void 0
179
- })),
180
- completionRequirements: (agent.completionRequirements ?? []).filter(isCompletionRequirementRecord).slice(-MAX_STORED_COMPLETIONS_PER_AGENT).map((record) => ({ ...record })),
181
- currentTimeoutMs: void 0,
182
- currentIdleTimeoutMs: void 0,
183
- currentMaxTurns: void 0,
184
- currentMaxToolCalls: void 0,
185
- currentMailboxMessageIds: void 0,
186
- telemetry: void 0,
187
- contract: normalizeDelegationContract(agent.contract),
188
- structuredResult: agent.structuredResult && agent.resultFormat ? parseAnyStructuredSubagentResult(
189
- JSON.stringify(agent.structuredResult),
190
- agent.resultFormat
191
- ) : void 0,
192
- executionPlan: agent.executionPlan ? copyExecutionPlan(agent.executionPlan) : void 0,
193
- capabilityGrant: agent.capabilityGrant ? agent.capabilityGrant.state === "active" ? revokeCapabilityGrant(agent.capabilityGrant, "persistence-boundary", Date.now()) : structuredClone(agent.capabilityGrant) : void 0,
194
- semanticSnapshot: agent.semanticSnapshot ? structuredClone(agent.semanticSnapshot) : void 0,
195
- semanticCompatibility: agent.semanticCompatibility ? structuredClone(agent.semanticCompatibility) : void 0,
196
- termination: agent.termination ? sanitizeTermination(agent.termination) : void 0,
197
- context: agent.context ? redactPrivateText(agent.context) : void 0,
198
- error: agent.error ? redactPrivateText(agent.error) : void 0,
199
- history: agent.history.map((turn) => ({
200
- ...turn,
201
- task: redactPrivateText(turn.task),
202
- output: redactPrivateText(turn.output),
203
- termination: turn.termination ? sanitizeTermination(turn.termination) : void 0
204
- }))
205
- };
206
- }
207
- function sanitizeTermination(report) {
208
- const copy = copyTurnTerminationReport(report);
209
- copy.checkpoint.task = redactPrivateText(copy.checkpoint.task);
210
- copy.checkpoint.partialOutput = copy.checkpoint.partialOutput ? redactPrivateText(copy.checkpoint.partialOutput) : void 0;
211
- copy.checkpoint.assistantNotes = copy.checkpoint.assistantNotes.map(redactPrivateText);
212
- copy.checkpoint.completedTools = copy.checkpoint.completedTools.map((item) => ({
213
- ...item,
214
- toolName: redactPrivateText(item.toolName),
215
- output: redactPrivateText(item.output)
216
- }));
217
- copy.checkpoint.changedFiles = copy.checkpoint.changedFiles.map(redactPrivateText);
218
- copy.finalization.error = copy.finalization.error ? redactPrivateText(copy.finalization.error) : void 0;
219
- return copy;
220
- }
221
- function isStoredState(value) {
222
- if (!value || typeof value !== "object") return false;
223
- const state = value;
224
- if (state.version !== 1 && state.version !== 2 && state.version !== STATE_VERSION || !Array.isArray(state.agents)) {
225
- return false;
226
- }
227
- return state.agents.every((agent) => {
228
- if (!agent || typeof agent !== "object") return false;
229
- const record = agent;
230
- return typeof record.id === "string" && (record.taskName === void 0 || isValidTaskName(record.taskName)) && (record.taskPath === void 0 || isValidTaskPath(record.taskPath)) && typeof record.agent === "string" && typeof record.cwd === "string" && typeof record.createdAt === "number" && Number.isFinite(record.createdAt) && typeof record.updatedAt === "number" && Number.isFinite(record.updatedAt) && (record.parentId === void 0 || typeof record.parentId === "string") && (record.thinkingLevel === void 0 || isThinkingLevel(record.thinkingLevel)) && (record.timeoutMs === void 0 || isTurnTimeout(record.timeoutMs)) && (record.idleTimeoutMs === void 0 || isTurnTimeout(record.idleTimeoutMs)) && (record.maxTurns === void 0 || isPositiveBounded(record.maxTurns, MAX_SUBAGENT_TURNS)) && (record.maxToolCalls === void 0 || isPositiveBounded(record.maxToolCalls, MAX_SUBAGENT_TOOL_CALLS)) && (record.termination === void 0 || isTerminationReport(record.termination)) && (record.contextTurns === void 0 || isNonNegativeInteger(record.contextTurns)) && (record.contextBytes === void 0 || isNonNegativeInteger(record.contextBytes)) && (record.turnGeneration === void 0 || isNonNegativeInteger(record.turnGeneration)) && (record.pendingCompletions === void 0 || isCompletionOutbox(record.pendingCompletions, record.turnGeneration ?? 0)) && (record.completionRequirements === void 0 || Array.isArray(record.completionRequirements) && record.completionRequirements.length <= MAX_STORED_COMPLETIONS_PER_AGENT && record.completionRequirements.every(isCompletionRequirementRecord)) && (record.spawnIdempotencyKey === void 0 || typeof record.spawnIdempotencyKey === "string" && record.spawnIdempotencyKey.length > 0 && record.spawnIdempotencyKey.length <= 256) && (record.spawnRequestHash === void 0 || isSha256(record.spawnRequestHash)) && (record.contract === void 0 || normalizeDelegationContract(record.contract) !== void 0) && (record.resultFormat === void 0 || SUBAGENT_RESULT_FORMATS.includes(record.resultFormat)) && (record.structuredResult === void 0 || record.resultFormat !== void 0 && parseAnyStructuredSubagentResult(
231
- JSON.stringify(record.structuredResult),
232
- record.resultFormat
233
- ) !== void 0) && (record.executionPlan === void 0 || isExecutionPlan(record.executionPlan)) && (record.capabilityGrant === void 0 || isCapabilityGrant(record.capabilityGrant)) && (record.semanticSnapshot === void 0 || isSemanticSnapshot(record.semanticSnapshot)) && (record.semanticCompatibility === void 0 || isSemanticCompatibility(record.semanticCompatibility)) && (record.workspaceMode === void 0 || record.workspaceMode === "worktree") && (record.target === void 0 || isTargetPolicyAudit(record.target)) && (record.children === void 0 || Array.isArray(record.children) && record.children.every((id) => typeof id === "string")) && Array.isArray(record.history) && record.history.every(isAgentTurn) && (record.mailbox === void 0 || Array.isArray(record.mailbox) && record.mailbox.every(isMailboxMessage));
234
- });
235
- }
236
- function isValidTaskName(value) {
237
- if (typeof value !== "string") return false;
238
- try {
239
- return validateTaskName(value) === value;
240
- } catch {
241
- return false;
242
- }
243
- }
244
- function isValidTaskPath(value) {
245
- if (typeof value !== "string") return false;
246
- try {
247
- return validateTaskPath(value) === value;
248
- } catch {
249
- return false;
250
- }
251
- }
252
- function isSemanticCompatibility(value) {
253
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
254
- const compatibility = value;
255
- return ["compatible", "warning", "needs-revalidation", "rejected"].includes(
256
- String(compatibility.status)
257
- ) && Array.isArray(compatibility.changedComponents) && compatibility.changedComponents.every((item) => typeof item === "string");
258
- }
259
- function isNonNegativeInteger(value) {
260
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
261
- }
262
- function isTurnTimeout(value) {
263
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 1 && value <= MAX_SUBAGENT_TIMEOUT_MS;
264
- }
265
- function isPositiveBounded(value, maximum) {
266
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 1 && value <= maximum;
267
- }
268
- function isTerminationReport(value) {
269
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
270
- const report = value;
271
- if (report.version !== "pi-subagents:termination:v1" || ![
272
- "work_timeout",
273
- "idle_timeout",
274
- "turn_limit",
275
- "tool_call_limit",
276
- "orchestration_timeout"
277
- ].includes(String(report.reason)) || !isPositiveBounded(report.limit, MAX_SUBAGENT_TIMEOUT_MS)) {
278
- return false;
279
- }
280
- const checkpoint = report.checkpoint;
281
- const finalization = report.finalization;
282
- if (!checkpoint || typeof checkpoint !== "object" || Array.isArray(checkpoint)) return false;
283
- if (!finalization || typeof finalization !== "object" || Array.isArray(finalization))
284
- return false;
285
- const checkpointValue = checkpoint;
286
- const finalizationValue = finalization;
287
- return checkpointValue.version === "pi-subagents:checkpoint:v1" && typeof checkpointValue.task === "string" && (checkpointValue.partialOutput === void 0 || typeof checkpointValue.partialOutput === "string") && Array.isArray(checkpointValue.assistantNotes) && checkpointValue.assistantNotes.every((item) => typeof item === "string") && Array.isArray(checkpointValue.completedTools) && checkpointValue.completedTools.every(isCompletedToolEvidence) && Array.isArray(checkpointValue.changedFiles) && checkpointValue.changedFiles.every((item) => typeof item === "string") && typeof checkpointValue.sideEffectsMayHaveOccurred === "boolean" && typeof checkpointValue.truncated === "boolean" && typeof finalizationValue.attempted === "boolean" && ["completed", "failed", "timed_out", "skipped"].includes(String(finalizationValue.status)) && typeof finalizationValue.durationMs === "number" && Number.isFinite(finalizationValue.durationMs) && finalizationValue.durationMs >= 0 && (finalizationValue.error === void 0 || typeof finalizationValue.error === "string");
288
- }
289
- function isCompletedToolEvidence(value) {
290
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
291
- const item = value;
292
- return typeof item.toolName === "string" && typeof item.output === "string" && typeof item.isError === "boolean";
293
- }
294
- function isSha256(value) {
295
- return typeof value === "string" && /^[a-f0-9]{64}$/u.test(value);
296
- }
297
- function isTargetPolicyAudit(value) {
298
- if (!value || typeof value !== "object") return false;
299
- const target = value;
300
- if (typeof target.cwd !== "string" || target.boundary !== "current-workspace" && target.boundary !== "external" || !target.trust || typeof target.trust !== "object") {
301
- return false;
302
- }
303
- const trust = target.trust;
304
- return [
305
- "session-trusted",
306
- "session-untrusted",
307
- "saved-trusted",
308
- "saved-denied",
309
- "unsaved",
310
- "trust-error"
311
- ].includes(String(trust.kind)) && typeof trust.projectTrusted === "boolean" && (trust.sourcePath === void 0 || typeof trust.sourcePath === "string") && (trust.warning === void 0 || typeof trust.warning === "string");
312
- }
313
- function isCompletionOutbox(value, turnGeneration) {
314
- if (!Array.isArray(value) || value.length > MAX_STORED_COMPLETIONS_PER_AGENT) return false;
315
- const ids = /* @__PURE__ */ new Set();
316
- let previousGeneration = 0;
317
- let previousCreatedAt = Number.NEGATIVE_INFINITY;
318
- for (const completion of value) {
319
- if (!isPersistedCompletion(completion, turnGeneration)) return false;
320
- if (ids.has(completion.completionId)) return false;
321
- if (completion.generation <= previousGeneration || completion.createdAt <= previousCreatedAt) {
322
- return false;
323
- }
324
- ids.add(completion.completionId);
325
- previousGeneration = completion.generation;
326
- previousCreatedAt = completion.createdAt;
327
- }
328
- return true;
329
- }
330
- function isPersistedCompletion(value, turnGeneration) {
331
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
332
- const completion = value;
333
- return typeof completion.completionId === "string" && completion.completionId.length > 0 && completion.completionId.length <= 256 && (completion.recipientId === void 0 || typeof completion.recipientId === "string" && completion.recipientId.length > 0) && (completion.recipientPath === void 0 || isValidTaskPath(completion.recipientPath)) && typeof completion.runId === "string" && completion.runId.length > 0 && completion.runId.length <= 256 && typeof completion.generation === "number" && Number.isSafeInteger(completion.generation) && completion.generation >= 1 && completion.generation <= turnGeneration && typeof completion.task === "string" && typeof completion.output === "string" && (completion.error === void 0 || typeof completion.error === "string") && typeof completion.createdAt === "number" && Number.isFinite(completion.createdAt);
334
- }
335
- function isAgentTurn(value) {
336
- if (!value || typeof value !== "object") return false;
337
- const turn = value;
338
- return (turn.runId === void 0 || typeof turn.runId === "string" && turn.runId.length > 0 && turn.runId.length <= 256) && (turn.generation === void 0 || typeof turn.generation === "number" && Number.isSafeInteger(turn.generation) && turn.generation >= 1) && typeof turn.task === "string" && typeof turn.output === "string" && typeof turn.startedAt === "number" && Number.isFinite(turn.startedAt) && typeof turn.completedAt === "number" && Number.isFinite(turn.completedAt) && typeof turn.exitCode === "number" && Number.isFinite(turn.exitCode) && (turn.termination === void 0 || isTerminationReport(turn.termination));
339
- }
340
- function isMailboxMessage(value) {
341
- if (!value || typeof value !== "object") return false;
342
- const message = value;
343
- return typeof message.id === "string" && typeof message.senderId === "string" && typeof message.recipientId === "string" && typeof message.content === "string" && typeof message.createdAt === "number" && Number.isFinite(message.createdAt) && (message.readAt === void 0 || typeof message.readAt === "number" && Number.isFinite(message.readAt)) && (message.deduplicationKey === void 0 || typeof message.deduplicationKey === "string") && (message.completionId === void 0 || typeof message.completionId === "string");
344
- }
345
- export {
346
- AgentPersistence
347
- };
348
- //# sourceMappingURL=persistence-UY3PY6E5.ts.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/persistence.ts"],
4
- "sourcesContent": ["import { createHash } from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { getAgentDir, withFileMutationQueue } from \"@earendil-works/pi-coding-agent\";\nimport { projectAgentRecords } from \"./agent-projection.js\";\nimport { isThinkingLevel } from \"./agents/types.js\";\nimport { isCapabilityGrant, revokeCapabilityGrant } from \"./capability-grant.js\";\nimport { isCompletionRequirementRecord } from \"./completion-requirement.js\";\nimport { redactPrivateText } from \"./context.js\";\nimport { normalizeDelegationContract } from \"./delegation-contract.js\";\nimport { copyExecutionPlan, isExecutionPlan } from \"./execution-plan.js\";\nimport { MAX_SUBAGENT_TIMEOUT_MS } from \"./limits.js\";\nimport type { ManagedAgent } from \"./registry.js\";\nimport { parseAnyStructuredSubagentResult, SUBAGENT_RESULT_FORMATS } from \"./result-contract.js\";\nimport { isSemanticSnapshot } from \"./semantic-snapshot.js\";\nimport { resolveStatefulLimits } from \"./stateful-limits.js\";\nimport { validateTaskName, validateTaskPath } from \"./task-path.js\";\nimport { copyTurnTerminationReport, type TurnTerminationReport } from \"./timeout-checkpoint.js\";\nimport { MAX_SUBAGENT_TOOL_CALLS, MAX_SUBAGENT_TURNS } from \"./turn-budget.js\";\n\nconst STATE_VERSION = 3;\nconst MAX_STORED_COMPLETIONS_PER_AGENT = 20;\nconst DEFAULT_STATEFUL_LIMITS = resolveStatefulLimits();\nconst MAX_STATE_BYTES = 5 * 1024 * 1024;\n\ninterface StoredState {\n\tversion: 3;\n\tupdatedAt: number;\n\tagents: ManagedAgent[];\n}\n\nexport interface PersistenceOptions {\n\tretentionDays?: number;\n\tmaxStoredAgents?: number;\n\tstateDir?: string;\n}\n\nexport class AgentPersistence {\n\treadonly filePath: string;\n\tprivate readonly retentionMs: number;\n\tprivate readonly maxStoredAgents: number;\n\n\tconstructor(owner: string, options: PersistenceOptions = {}) {\n\t\tconst retentionDays = options.retentionDays ?? 30;\n\t\tif (!Number.isFinite(retentionDays) || retentionDays <= 0) {\n\t\t\tthrow new Error(\"Subagent retentionDays must be a positive finite number\");\n\t\t}\n\t\tconst retentionMs = retentionDays * 24 * 60 * 60 * 1000;\n\t\tif (!Number.isFinite(retentionMs)) {\n\t\t\tthrow new Error(\"Subagent retentionDays is too large\");\n\t\t}\n\t\tconst maxStoredAgents = options.maxStoredAgents ?? DEFAULT_STATEFUL_LIMITS.maxStoredAgents;\n\t\tif (!Number.isSafeInteger(maxStoredAgents) || maxStoredAgents < 1) {\n\t\t\tthrow new Error(\"Subagent maxStoredAgents must be a positive safe integer\");\n\t\t}\n\t\tconst safeOwner = createHash(\"sha256\").update(owner).digest(\"hex\").slice(0, 24);\n\t\tconst stateDir = options.stateDir ?? path.join(getAgentDir(), \"pi-subagents-state\");\n\t\tthis.filePath = path.join(stateDir, `${safeOwner}.json`);\n\t\tthis.retentionMs = retentionMs;\n\t\tthis.maxStoredAgents = maxStoredAgents;\n\t}\n\n\tload(): ManagedAgent[] {\n\t\tif (!fs.existsSync(this.filePath)) return [];\n\t\ttry {\n\t\t\tconst stat = fs.statSync(this.filePath);\n\t\t\tif (stat.size > MAX_STATE_BYTES) throw new Error(\"state exceeds size limit\");\n\t\t\tconst parsed = JSON.parse(fs.readFileSync(this.filePath, \"utf8\")) as unknown;\n\t\t\tif (!isStoredState(parsed)) throw new Error(\"unsupported or malformed state\");\n\t\t\tconst cutoff = Date.now() - this.retentionMs;\n\t\t\treturn projectAgentRecords(\n\t\t\t\tparsed.agents.filter((agent) => agent.updatedAt >= cutoff && agent.state !== \"closed\"),\n\t\t\t\t{ maxAgents: this.maxStoredAgents },\n\t\t\t).map(sanitizeAgent);\n\t\t} catch {\n\t\t\tthis.quarantine();\n\t\t\treturn [];\n\t\t}\n\t}\n\n\tasync save(agents: readonly ManagedAgent[]): Promise<void> {\n\t\tconst cutoff = Date.now() - this.retentionMs;\n\t\tconst eligible = agents.filter(\n\t\t\t(agent) => agent.state !== \"closed\" && agent.updatedAt >= cutoff,\n\t\t);\n\t\tconst records = projectAgentRecords(eligible, {\n\t\t\tmaxAgents: this.maxStoredAgents,\n\t\t}).map(sanitizeAgent);\n\t\tconst state: StoredState = { version: STATE_VERSION, updatedAt: Date.now(), agents: records };\n\t\tlet content = `${JSON.stringify(state, null, \"\\t\")}\\n`;\n\t\twhile (Buffer.byteLength(content, \"utf8\") > MAX_STATE_BYTES && state.agents.length > 0) {\n\t\t\tconst rootsWithPendingCompletions = new Set(\n\t\t\t\tstate.agents\n\t\t\t\t\t.filter((agent) => (agent.pendingCompletions?.length ?? 0) > 0)\n\t\t\t\t\t.map((agent) => agent.rootId),\n\t\t\t);\n\t\t\tconst droppableRoot = state.agents.find(\n\t\t\t\t(agent) => !rootsWithPendingCompletions.has(agent.rootId),\n\t\t\t)?.rootId;\n\t\t\tif (droppableRoot) {\n\t\t\t\tstate.agents = state.agents.filter((agent) => agent.rootId !== droppableRoot);\n\t\t\t} else if (!trimOldestHistory(state.agents) && !clearOldestContext(state.agents)) {\n\t\t\t\tthrow new Error(\"Subagent state exceeds its durable completion storage limit\");\n\t\t\t}\n\t\t\tcontent = `${JSON.stringify(state, null, \"\\t\")}\\n`;\n\t\t}\n\t\tawait fs.promises.mkdir(path.dirname(this.filePath), { recursive: true });\n\t\tawait withFileMutationQueue(this.filePath, async () => {\n\t\t\tconst tempPath = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;\n\t\t\tawait fs.promises.writeFile(tempPath, content, { encoding: \"utf8\", mode: 0o600 });\n\t\t\tawait fs.promises.rename(tempPath, this.filePath);\n\t\t});\n\t}\n\n\tasync delete(): Promise<void> {\n\t\tawait withFileMutationQueue(this.filePath, async () => {\n\t\t\tawait fs.promises.rm(this.filePath, { force: true });\n\t\t});\n\t}\n\n\tprivate quarantine(): void {\n\t\ttry {\n\t\t\tfs.renameSync(this.filePath, `${this.filePath}.invalid-${Date.now()}`);\n\t\t} catch {\n\t\t\t// A concurrent process may already have moved or removed it.\n\t\t}\n\t}\n}\n\nfunction trimOldestHistory(agents: ManagedAgent[]): boolean {\n\tconst candidate = agents\n\t\t.filter((agent) => agent.history.length > 0)\n\t\t.sort(\n\t\t\t(left, right) =>\n\t\t\t\t(left.history[0]?.completedAt ?? Number.POSITIVE_INFINITY) -\n\t\t\t\t(right.history[0]?.completedAt ?? Number.POSITIVE_INFINITY),\n\t\t)[0];\n\tif (!candidate) return false;\n\tcandidate.history.shift();\n\treturn true;\n}\n\nfunction clearOldestContext(agents: ManagedAgent[]): boolean {\n\tconst candidate = agents.find((agent) => agent.context !== undefined);\n\tif (!candidate) return false;\n\tcandidate.context = undefined;\n\tcandidate.contextTruncated = true;\n\treturn true;\n}\n\nfunction sanitizeAgent(agent: ManagedAgent): ManagedAgent {\n\treturn {\n\t\t...agent,\n\t\trootId: agent.rootId ?? agent.id,\n\t\tdepth: agent.depth ?? 0,\n\t\tchildren: [...(agent.children ?? [])],\n\t\tmailbox: (agent.mailbox ?? []).map((message) => ({\n\t\t\t...message,\n\t\t\trecipientId: agent.id,\n\t\t\tcontent: redactPrivateText(message.content),\n\t\t})),\n\t\tstate: agent.state === \"running\" || agent.state === \"starting\" ? \"interrupted\" : agent.state,\n\t\tcurrentTask: undefined,\n\t\tcurrentRunId: undefined,\n\t\tcurrentTurnGeneration: undefined,\n\t\tturnGeneration: agent.turnGeneration ?? 0,\n\t\tpendingCompletions: (agent.pendingCompletions ?? [])\n\t\t\t.slice(-MAX_STORED_COMPLETIONS_PER_AGENT)\n\t\t\t.map((completion) => ({\n\t\t\t\t...completion,\n\t\t\t\ttask: redactPrivateText(completion.task),\n\t\t\t\toutput: redactPrivateText(completion.output),\n\t\t\t\terror: completion.error ? redactPrivateText(completion.error) : undefined,\n\t\t\t})),\n\t\tcompletionRequirements: (agent.completionRequirements ?? [])\n\t\t\t.filter(isCompletionRequirementRecord)\n\t\t\t.slice(-MAX_STORED_COMPLETIONS_PER_AGENT)\n\t\t\t.map((record) => ({ ...record })),\n\t\tcurrentTimeoutMs: undefined,\n\t\tcurrentIdleTimeoutMs: undefined,\n\t\tcurrentMaxTurns: undefined,\n\t\tcurrentMaxToolCalls: undefined,\n\t\tcurrentMailboxMessageIds: undefined,\n\t\ttelemetry: undefined,\n\t\tcontract: normalizeDelegationContract(agent.contract),\n\t\tstructuredResult:\n\t\t\tagent.structuredResult && agent.resultFormat\n\t\t\t\t? parseAnyStructuredSubagentResult(\n\t\t\t\t\t\tJSON.stringify(agent.structuredResult),\n\t\t\t\t\t\tagent.resultFormat,\n\t\t\t\t\t)\n\t\t\t\t: undefined,\n\t\texecutionPlan: agent.executionPlan ? copyExecutionPlan(agent.executionPlan) : undefined,\n\t\tcapabilityGrant: agent.capabilityGrant\n\t\t\t? agent.capabilityGrant.state === \"active\"\n\t\t\t\t? revokeCapabilityGrant(agent.capabilityGrant, \"persistence-boundary\", Date.now())\n\t\t\t\t: structuredClone(agent.capabilityGrant)\n\t\t\t: undefined,\n\t\tsemanticSnapshot: agent.semanticSnapshot ? structuredClone(agent.semanticSnapshot) : undefined,\n\t\tsemanticCompatibility: agent.semanticCompatibility\n\t\t\t? structuredClone(agent.semanticCompatibility)\n\t\t\t: undefined,\n\t\ttermination: agent.termination ? sanitizeTermination(agent.termination) : undefined,\n\t\tcontext: agent.context ? redactPrivateText(agent.context) : undefined,\n\t\terror: agent.error ? redactPrivateText(agent.error) : undefined,\n\t\thistory: agent.history.map((turn) => ({\n\t\t\t...turn,\n\t\t\ttask: redactPrivateText(turn.task),\n\t\t\toutput: redactPrivateText(turn.output),\n\t\t\ttermination: turn.termination ? sanitizeTermination(turn.termination) : undefined,\n\t\t})),\n\t};\n}\n\nfunction sanitizeTermination(report: TurnTerminationReport): TurnTerminationReport {\n\tconst copy = copyTurnTerminationReport(report);\n\tcopy.checkpoint.task = redactPrivateText(copy.checkpoint.task);\n\tcopy.checkpoint.partialOutput = copy.checkpoint.partialOutput\n\t\t? redactPrivateText(copy.checkpoint.partialOutput)\n\t\t: undefined;\n\tcopy.checkpoint.assistantNotes = copy.checkpoint.assistantNotes.map(redactPrivateText);\n\tcopy.checkpoint.completedTools = copy.checkpoint.completedTools.map((item) => ({\n\t\t...item,\n\t\ttoolName: redactPrivateText(item.toolName),\n\t\toutput: redactPrivateText(item.output),\n\t}));\n\tcopy.checkpoint.changedFiles = copy.checkpoint.changedFiles.map(redactPrivateText);\n\tcopy.finalization.error = copy.finalization.error\n\t\t? redactPrivateText(copy.finalization.error)\n\t\t: undefined;\n\treturn copy;\n}\n\nfunction isStoredState(value: unknown): value is StoredState {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst state = value as { version?: unknown; agents?: unknown };\n\tif (\n\t\t(state.version !== 1 && state.version !== 2 && state.version !== STATE_VERSION) ||\n\t\t!Array.isArray(state.agents)\n\t) {\n\t\treturn false;\n\t}\n\treturn state.agents.every((agent) => {\n\t\tif (!agent || typeof agent !== \"object\") return false;\n\t\tconst record = agent as Partial<ManagedAgent>;\n\t\treturn (\n\t\t\ttypeof record.id === \"string\" &&\n\t\t\t(record.taskName === undefined || isValidTaskName(record.taskName)) &&\n\t\t\t(record.taskPath === undefined || isValidTaskPath(record.taskPath)) &&\n\t\t\ttypeof record.agent === \"string\" &&\n\t\t\ttypeof record.cwd === \"string\" &&\n\t\t\ttypeof record.createdAt === \"number\" &&\n\t\t\tNumber.isFinite(record.createdAt) &&\n\t\t\ttypeof record.updatedAt === \"number\" &&\n\t\t\tNumber.isFinite(record.updatedAt) &&\n\t\t\t(record.parentId === undefined || typeof record.parentId === \"string\") &&\n\t\t\t(record.thinkingLevel === undefined || isThinkingLevel(record.thinkingLevel)) &&\n\t\t\t(record.timeoutMs === undefined || isTurnTimeout(record.timeoutMs)) &&\n\t\t\t(record.idleTimeoutMs === undefined || isTurnTimeout(record.idleTimeoutMs)) &&\n\t\t\t(record.maxTurns === undefined || isPositiveBounded(record.maxTurns, MAX_SUBAGENT_TURNS)) &&\n\t\t\t(record.maxToolCalls === undefined ||\n\t\t\t\tisPositiveBounded(record.maxToolCalls, MAX_SUBAGENT_TOOL_CALLS)) &&\n\t\t\t(record.termination === undefined || isTerminationReport(record.termination)) &&\n\t\t\t(record.contextTurns === undefined || isNonNegativeInteger(record.contextTurns)) &&\n\t\t\t(record.contextBytes === undefined || isNonNegativeInteger(record.contextBytes)) &&\n\t\t\t(record.turnGeneration === undefined || isNonNegativeInteger(record.turnGeneration)) &&\n\t\t\t(record.pendingCompletions === undefined ||\n\t\t\t\tisCompletionOutbox(record.pendingCompletions, record.turnGeneration ?? 0)) &&\n\t\t\t(record.completionRequirements === undefined ||\n\t\t\t\t(Array.isArray(record.completionRequirements) &&\n\t\t\t\t\trecord.completionRequirements.length <= MAX_STORED_COMPLETIONS_PER_AGENT &&\n\t\t\t\t\trecord.completionRequirements.every(isCompletionRequirementRecord))) &&\n\t\t\t(record.spawnIdempotencyKey === undefined ||\n\t\t\t\t(typeof record.spawnIdempotencyKey === \"string\" &&\n\t\t\t\t\trecord.spawnIdempotencyKey.length > 0 &&\n\t\t\t\t\trecord.spawnIdempotencyKey.length <= 256)) &&\n\t\t\t(record.spawnRequestHash === undefined || isSha256(record.spawnRequestHash)) &&\n\t\t\t(record.contract === undefined ||\n\t\t\t\tnormalizeDelegationContract(record.contract) !== undefined) &&\n\t\t\t(record.resultFormat === undefined ||\n\t\t\t\tSUBAGENT_RESULT_FORMATS.includes(record.resultFormat)) &&\n\t\t\t(record.structuredResult === undefined ||\n\t\t\t\t(record.resultFormat !== undefined &&\n\t\t\t\t\tparseAnyStructuredSubagentResult(\n\t\t\t\t\t\tJSON.stringify(record.structuredResult),\n\t\t\t\t\t\trecord.resultFormat,\n\t\t\t\t\t) !== undefined)) &&\n\t\t\t(record.executionPlan === undefined || isExecutionPlan(record.executionPlan)) &&\n\t\t\t(record.capabilityGrant === undefined || isCapabilityGrant(record.capabilityGrant)) &&\n\t\t\t(record.semanticSnapshot === undefined || isSemanticSnapshot(record.semanticSnapshot)) &&\n\t\t\t(record.semanticCompatibility === undefined ||\n\t\t\t\tisSemanticCompatibility(record.semanticCompatibility)) &&\n\t\t\t(record.workspaceMode === undefined || record.workspaceMode === \"worktree\") &&\n\t\t\t(record.target === undefined || isTargetPolicyAudit(record.target)) &&\n\t\t\t(record.children === undefined ||\n\t\t\t\t(Array.isArray(record.children) &&\n\t\t\t\t\trecord.children.every((id) => typeof id === \"string\"))) &&\n\t\t\tArray.isArray(record.history) &&\n\t\t\trecord.history.every(isAgentTurn) &&\n\t\t\t(record.mailbox === undefined ||\n\t\t\t\t(Array.isArray(record.mailbox) && record.mailbox.every(isMailboxMessage)))\n\t\t);\n\t});\n}\n\nfunction isValidTaskName(value: unknown): value is string {\n\tif (typeof value !== \"string\") return false;\n\ttry {\n\t\treturn validateTaskName(value) === value;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isValidTaskPath(value: unknown): value is string {\n\tif (typeof value !== \"string\") return false;\n\ttry {\n\t\treturn validateTaskPath(value) === value;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isSemanticCompatibility(value: unknown): boolean {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst compatibility = value as Record<string, unknown>;\n\treturn (\n\t\t[\"compatible\", \"warning\", \"needs-revalidation\", \"rejected\"].includes(\n\t\t\tString(compatibility.status),\n\t\t) &&\n\t\tArray.isArray(compatibility.changedComponents) &&\n\t\tcompatibility.changedComponents.every((item) => typeof item === \"string\")\n\t);\n}\n\nfunction isNonNegativeInteger(value: unknown): value is number {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n\nfunction isTurnTimeout(value: unknown): value is number {\n\treturn (\n\t\ttypeof value === \"number\" &&\n\t\tNumber.isSafeInteger(value) &&\n\t\tvalue >= 1 &&\n\t\tvalue <= MAX_SUBAGENT_TIMEOUT_MS\n\t);\n}\n\nfunction isPositiveBounded(value: unknown, maximum: number): value is number {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value >= 1 && value <= maximum;\n}\n\nfunction isTerminationReport(value: unknown): value is TurnTerminationReport {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst report = value as Record<string, unknown>;\n\tif (\n\t\treport.version !== \"pi-subagents:termination:v1\" ||\n\t\t![\n\t\t\t\"work_timeout\",\n\t\t\t\"idle_timeout\",\n\t\t\t\"turn_limit\",\n\t\t\t\"tool_call_limit\",\n\t\t\t\"orchestration_timeout\",\n\t\t].includes(String(report.reason)) ||\n\t\t!isPositiveBounded(report.limit, MAX_SUBAGENT_TIMEOUT_MS)\n\t) {\n\t\treturn false;\n\t}\n\tconst checkpoint = report.checkpoint;\n\tconst finalization = report.finalization;\n\tif (!checkpoint || typeof checkpoint !== \"object\" || Array.isArray(checkpoint)) return false;\n\tif (!finalization || typeof finalization !== \"object\" || Array.isArray(finalization))\n\t\treturn false;\n\tconst checkpointValue = checkpoint as Record<string, unknown>;\n\tconst finalizationValue = finalization as Record<string, unknown>;\n\treturn (\n\t\tcheckpointValue.version === \"pi-subagents:checkpoint:v1\" &&\n\t\ttypeof checkpointValue.task === \"string\" &&\n\t\t(checkpointValue.partialOutput === undefined ||\n\t\t\ttypeof checkpointValue.partialOutput === \"string\") &&\n\t\tArray.isArray(checkpointValue.assistantNotes) &&\n\t\tcheckpointValue.assistantNotes.every((item) => typeof item === \"string\") &&\n\t\tArray.isArray(checkpointValue.completedTools) &&\n\t\tcheckpointValue.completedTools.every(isCompletedToolEvidence) &&\n\t\tArray.isArray(checkpointValue.changedFiles) &&\n\t\tcheckpointValue.changedFiles.every((item) => typeof item === \"string\") &&\n\t\ttypeof checkpointValue.sideEffectsMayHaveOccurred === \"boolean\" &&\n\t\ttypeof checkpointValue.truncated === \"boolean\" &&\n\t\ttypeof finalizationValue.attempted === \"boolean\" &&\n\t\t[\"completed\", \"failed\", \"timed_out\", \"skipped\"].includes(String(finalizationValue.status)) &&\n\t\ttypeof finalizationValue.durationMs === \"number\" &&\n\t\tNumber.isFinite(finalizationValue.durationMs) &&\n\t\tfinalizationValue.durationMs >= 0 &&\n\t\t(finalizationValue.error === undefined || typeof finalizationValue.error === \"string\")\n\t);\n}\n\nfunction isCompletedToolEvidence(value: unknown): boolean {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst item = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof item.toolName === \"string\" &&\n\t\ttypeof item.output === \"string\" &&\n\t\ttypeof item.isError === \"boolean\"\n\t);\n}\n\nfunction isSha256(value: unknown): value is string {\n\treturn typeof value === \"string\" && /^[a-f0-9]{64}$/u.test(value);\n}\n\nfunction isTargetPolicyAudit(value: unknown): boolean {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst target = value as Record<string, unknown>;\n\tif (\n\t\ttypeof target.cwd !== \"string\" ||\n\t\t(target.boundary !== \"current-workspace\" && target.boundary !== \"external\") ||\n\t\t!target.trust ||\n\t\ttypeof target.trust !== \"object\"\n\t) {\n\t\treturn false;\n\t}\n\tconst trust = target.trust as Record<string, unknown>;\n\treturn (\n\t\t[\n\t\t\t\"session-trusted\",\n\t\t\t\"session-untrusted\",\n\t\t\t\"saved-trusted\",\n\t\t\t\"saved-denied\",\n\t\t\t\"unsaved\",\n\t\t\t\"trust-error\",\n\t\t].includes(String(trust.kind)) &&\n\t\ttypeof trust.projectTrusted === \"boolean\" &&\n\t\t(trust.sourcePath === undefined || typeof trust.sourcePath === \"string\") &&\n\t\t(trust.warning === undefined || typeof trust.warning === \"string\")\n\t);\n}\n\nfunction isCompletionOutbox(value: unknown, turnGeneration: number): boolean {\n\tif (!Array.isArray(value) || value.length > MAX_STORED_COMPLETIONS_PER_AGENT) return false;\n\tconst ids = new Set<string>();\n\tlet previousGeneration = 0;\n\tlet previousCreatedAt = Number.NEGATIVE_INFINITY;\n\tfor (const completion of value) {\n\t\tif (!isPersistedCompletion(completion, turnGeneration)) return false;\n\t\tif (ids.has(completion.completionId)) return false;\n\t\tif (completion.generation <= previousGeneration || completion.createdAt <= previousCreatedAt) {\n\t\t\treturn false;\n\t\t}\n\t\tids.add(completion.completionId);\n\t\tpreviousGeneration = completion.generation;\n\t\tpreviousCreatedAt = completion.createdAt;\n\t}\n\treturn true;\n}\n\nfunction isPersistedCompletion(\n\tvalue: unknown,\n\tturnGeneration: number,\n): value is import(\"./registry.js\").PersistedAgentCompletion {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst completion = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof completion.completionId === \"string\" &&\n\t\tcompletion.completionId.length > 0 &&\n\t\tcompletion.completionId.length <= 256 &&\n\t\t(completion.recipientId === undefined ||\n\t\t\t(typeof completion.recipientId === \"string\" && completion.recipientId.length > 0)) &&\n\t\t(completion.recipientPath === undefined || isValidTaskPath(completion.recipientPath)) &&\n\t\ttypeof completion.runId === \"string\" &&\n\t\tcompletion.runId.length > 0 &&\n\t\tcompletion.runId.length <= 256 &&\n\t\ttypeof completion.generation === \"number\" &&\n\t\tNumber.isSafeInteger(completion.generation) &&\n\t\tcompletion.generation >= 1 &&\n\t\tcompletion.generation <= turnGeneration &&\n\t\ttypeof completion.task === \"string\" &&\n\t\ttypeof completion.output === \"string\" &&\n\t\t(completion.error === undefined || typeof completion.error === \"string\") &&\n\t\ttypeof completion.createdAt === \"number\" &&\n\t\tNumber.isFinite(completion.createdAt)\n\t);\n}\n\nfunction isAgentTurn(value: unknown): boolean {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst turn = value as Record<string, unknown>;\n\treturn (\n\t\t(turn.runId === undefined ||\n\t\t\t(typeof turn.runId === \"string\" && turn.runId.length > 0 && turn.runId.length <= 256)) &&\n\t\t(turn.generation === undefined ||\n\t\t\t(typeof turn.generation === \"number\" &&\n\t\t\t\tNumber.isSafeInteger(turn.generation) &&\n\t\t\t\tturn.generation >= 1)) &&\n\t\ttypeof turn.task === \"string\" &&\n\t\ttypeof turn.output === \"string\" &&\n\t\ttypeof turn.startedAt === \"number\" &&\n\t\tNumber.isFinite(turn.startedAt) &&\n\t\ttypeof turn.completedAt === \"number\" &&\n\t\tNumber.isFinite(turn.completedAt) &&\n\t\ttypeof turn.exitCode === \"number\" &&\n\t\tNumber.isFinite(turn.exitCode) &&\n\t\t(turn.termination === undefined || isTerminationReport(turn.termination))\n\t);\n}\n\nfunction isMailboxMessage(value: unknown): boolean {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst message = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof message.id === \"string\" &&\n\t\ttypeof message.senderId === \"string\" &&\n\t\ttypeof message.recipientId === \"string\" &&\n\t\ttypeof message.content === \"string\" &&\n\t\ttypeof message.createdAt === \"number\" &&\n\t\tNumber.isFinite(message.createdAt) &&\n\t\t(message.readAt === undefined ||\n\t\t\t(typeof message.readAt === \"number\" && Number.isFinite(message.readAt))) &&\n\t\t(message.deduplicationKey === undefined || typeof message.deduplicationKey === \"string\") &&\n\t\t(message.completionId === undefined || typeof message.completionId === \"string\")\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,aAAa,6BAA6B;AAiBnD,IAAM,gBAAgB;AACtB,IAAM,mCAAmC;AACzC,IAAM,0BAA0B,sBAAsB;AACtD,IAAM,kBAAkB,IAAI,OAAO;AAc5B,IAAM,mBAAN,MAAuB;AAAA,EACpB;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,OAAe,UAA8B,CAAC,GAAG;AAC5D,UAAM,gBAAgB,QAAQ,iBAAiB;AAC/C,QAAI,CAAC,OAAO,SAAS,aAAa,KAAK,iBAAiB,GAAG;AAC1D,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC1E;AACA,UAAM,cAAc,gBAAgB,KAAK,KAAK,KAAK;AACnD,QAAI,CAAC,OAAO,SAAS,WAAW,GAAG;AAClC,YAAM,IAAI,MAAM,qCAAqC;AAAA,IACtD;AACA,UAAM,kBAAkB,QAAQ,mBAAmB,wBAAwB;AAC3E,QAAI,CAAC,OAAO,cAAc,eAAe,KAAK,kBAAkB,GAAG;AAClE,YAAM,IAAI,MAAM,0DAA0D;AAAA,IAC3E;AACA,UAAM,YAAY,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AAC9E,UAAM,WAAW,QAAQ,YAAiB,UAAK,YAAY,GAAG,oBAAoB;AAClF,SAAK,WAAgB,UAAK,UAAU,GAAG,SAAS,OAAO;AACvD,SAAK,cAAc;AACnB,SAAK,kBAAkB;AAAA,EACxB;AAAA,EAEA,OAAuB;AACtB,QAAI,CAAI,cAAW,KAAK,QAAQ,EAAG,QAAO,CAAC;AAC3C,QAAI;AACH,YAAM,OAAU,YAA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