@e4779/pi-fabric 0.92.41-fork.6 → 0.96.4-fork.10

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 (300) hide show
  1. package/LAWS.bend +502 -0
  2. package/PROOF.bend +452 -0
  3. package/README.md +5 -1
  4. package/THIRD_PARTY_NOTICES.md +9 -0
  5. package/dist/agents/handoff.d.ts +2 -1
  6. package/dist/agents/handoff.d.ts.map +1 -1
  7. package/dist/agents/manager.d.ts +2 -0
  8. package/dist/agents/manager.d.ts.map +1 -1
  9. package/dist/agents.js +6 -5
  10. package/dist/agents.js.map +1 -1
  11. package/dist/chunks/{chunk-3TXOQ5MG.js → chunk-3CJETB4S.js} +828 -204
  12. package/dist/chunks/chunk-3CJETB4S.js.map +7 -0
  13. package/dist/chunks/{chunk-IUCVOZRX.js → chunk-3SIXBW6A.js} +2 -2
  14. package/dist/chunks/chunk-4E63LJDD.js +468 -0
  15. package/dist/chunks/chunk-4E63LJDD.js.map +7 -0
  16. package/dist/chunks/{chunk-AAHHYDTO.js → chunk-4NF3S3NM.js} +1 -1
  17. package/dist/chunks/{chunk-AAHHYDTO.js.map → chunk-4NF3S3NM.js.map} +2 -2
  18. package/dist/chunks/{chunk-2SWRVIYJ.js → chunk-754HA6KO.js} +2 -2
  19. package/dist/chunks/{chunk-K6DHXXF5.js → chunk-B2IVWASP.js} +2 -2
  20. package/dist/chunks/{chunk-ZDNGXLEC.js → chunk-B4HECUJI.js} +2 -2
  21. package/dist/chunks/{chunk-H6DDV6E2.js → chunk-CSJSHBAT.js} +5 -5
  22. package/dist/chunks/{chunk-MW5VI7IW.js → chunk-D4B4CCTA.js} +2 -2
  23. package/dist/chunks/{chunk-EDL4JDW7.js → chunk-EBWMC3OO.js} +2 -2
  24. package/dist/chunks/{chunk-4NUTVNS2.js → chunk-F72MAIQY.js} +31 -368
  25. package/dist/chunks/chunk-F72MAIQY.js.map +7 -0
  26. package/dist/chunks/{chunk-W3FRE4VI.js → chunk-FDIEQEXS.js} +2 -2
  27. package/dist/chunks/{chunk-7A6NVHB5.js → chunk-FJSHRHOR.js} +7 -4
  28. package/dist/chunks/chunk-FJSHRHOR.js.map +7 -0
  29. package/dist/chunks/{chunk-PSNXUZMY.js → chunk-G2F2RDZI.js} +5 -47
  30. package/dist/chunks/chunk-G2F2RDZI.js.map +7 -0
  31. package/dist/chunks/{chunk-3WIGAX56.js → chunk-JCV54SSP.js} +2 -2
  32. package/dist/chunks/chunk-KS44WKJJ.js +51 -0
  33. package/dist/chunks/chunk-KS44WKJJ.js.map +7 -0
  34. package/dist/chunks/{chunk-3H7SDWZI.js → chunk-LNLQ2LX3.js} +22 -1
  35. package/dist/chunks/chunk-LNLQ2LX3.js.map +7 -0
  36. package/dist/chunks/{chunk-G4LADAYY.js → chunk-OINADFEF.js} +8 -3
  37. package/dist/chunks/chunk-OINADFEF.js.map +7 -0
  38. package/dist/chunks/{chunk-UQ4LTUH4.js → chunk-OUAC6O5C.js} +36 -9
  39. package/dist/chunks/chunk-OUAC6O5C.js.map +7 -0
  40. package/dist/chunks/{chunk-MQG5QKGI.js → chunk-Q5BMTL6A.js} +217 -95
  41. package/dist/chunks/chunk-Q5BMTL6A.js.map +7 -0
  42. package/dist/chunks/{chunk-IK6PPFWG.js → chunk-QFKHAAZA.js} +11 -11
  43. package/dist/chunks/chunk-QFKHAAZA.js.map +7 -0
  44. package/dist/chunks/{chunk-RTXZHKMS.js → chunk-QNMQJNXE.js} +7 -3
  45. package/dist/chunks/chunk-QNMQJNXE.js.map +7 -0
  46. package/dist/chunks/{chunk-U5FYOMG5.js → chunk-UBPFGMDQ.js} +6 -2
  47. package/dist/chunks/chunk-UBPFGMDQ.js.map +7 -0
  48. package/dist/chunks/{chunk-FLKGJPCN.js → chunk-ULQFHZJE.js} +4 -1
  49. package/dist/chunks/chunk-ULQFHZJE.js.map +7 -0
  50. package/dist/chunks/{chunk-7VAZ4N43.js → chunk-V3PIO7QL.js} +2 -2
  51. package/dist/chunks/{chunk-MGDLRV2R.js → chunk-VQGO4P7C.js} +2 -2
  52. package/dist/chunks/{chunk-XT4346N7.js → chunk-WXSELMFV.js} +9 -3
  53. package/dist/chunks/chunk-WXSELMFV.js.map +7 -0
  54. package/dist/chunks/{chunk-D5WKZONW.js → chunk-X3IRR7CV.js} +2 -2
  55. package/dist/chunks/{chunk-IJL3QK3J.js → chunk-Y57UHPIK.js} +1 -1
  56. package/dist/chunks/{chunk-IJL3QK3J.js.map → chunk-Y57UHPIK.js.map} +1 -1
  57. package/dist/chunks/{chunk-RKRVOBVO.js → chunk-YC3QQDZ3.js} +2 -2
  58. package/dist/chunks/{chunk-Q4XJ4PYL.js → chunk-ZRI433JP.js} +299 -83
  59. package/dist/chunks/chunk-ZRI433JP.js.map +7 -0
  60. package/dist/chunks/{chunk-36B4AIRT.js → chunk-ZTXZ6JDO.js} +2 -2
  61. package/dist/commands/fabric.d.ts.map +1 -1
  62. package/dist/compaction/bounds.d.ts +4 -0
  63. package/dist/compaction/bounds.d.ts.map +1 -1
  64. package/dist/compaction/branch-summary.d.ts.map +1 -1
  65. package/dist/compaction/dialogue.d.ts +24 -0
  66. package/dist/compaction/dialogue.d.ts.map +1 -0
  67. package/dist/compaction/hook.d.ts +6 -2
  68. package/dist/compaction/hook.d.ts.map +1 -1
  69. package/dist/compaction/hook.js +6 -5
  70. package/dist/compaction/instructions.d.ts +1 -0
  71. package/dist/compaction/instructions.d.ts.map +1 -1
  72. package/dist/compaction/projections.d.ts +3 -3
  73. package/dist/compaction/projections.d.ts.map +1 -1
  74. package/dist/compaction/qa.d.ts.map +1 -1
  75. package/dist/compaction/render.d.ts +11 -0
  76. package/dist/compaction/render.d.ts.map +1 -1
  77. package/dist/components/configuration.js +2 -3
  78. package/dist/components/effect-policy.d.ts +2 -0
  79. package/dist/components/effect-policy.d.ts.map +1 -1
  80. package/dist/components/effect-scope.d.ts.map +1 -1
  81. package/dist/components/supervisor.d.ts +1 -1
  82. package/dist/components/supervisor.d.ts.map +1 -1
  83. package/dist/core/action-registry.d.ts +14 -2
  84. package/dist/core/action-registry.d.ts.map +1 -1
  85. package/dist/core/action-registry.js +7 -5
  86. package/dist/core/provider-bindings.d.ts +8 -2
  87. package/dist/core/provider-bindings.d.ts.map +1 -1
  88. package/dist/core/provider-operations.d.ts +28 -0
  89. package/dist/core/provider-operations.d.ts.map +1 -0
  90. package/dist/core/provider-operations.js +201 -0
  91. package/dist/core/provider-operations.js.map +7 -0
  92. package/dist/core/shell-inbox.d.ts +13 -0
  93. package/dist/core/shell-inbox.d.ts.map +1 -0
  94. package/dist/core/shell-jobs.d.ts +51 -7
  95. package/dist/core/shell-jobs.d.ts.map +1 -1
  96. package/dist/core/shell-limits.d.ts +3 -0
  97. package/dist/core/shell-limits.d.ts.map +1 -0
  98. package/dist/core/shell-monitor.d.ts +51 -0
  99. package/dist/core/shell-monitor.d.ts.map +1 -0
  100. package/dist/entropy/index.js +8 -7
  101. package/dist/entropy/normal-form.d.ts.map +1 -1
  102. package/dist/execution-service.d.ts +1 -1
  103. package/dist/execution-service.d.ts.map +1 -1
  104. package/dist/fabric-runtime-state.d.ts +1 -1
  105. package/dist/fabric-runtime-state.d.ts.map +1 -1
  106. package/dist/fabric-runtime-state.js +1124 -325
  107. package/dist/fabric-runtime-state.js.map +4 -4
  108. package/dist/index.js +155 -44
  109. package/dist/index.js.map +3 -3
  110. package/dist/jev/observation.js +5 -3
  111. package/dist/jev.d.ts +0 -1
  112. package/dist/jev.d.ts.map +1 -1
  113. package/dist/jev.js +9 -13
  114. package/dist/memory/digest.d.ts.map +1 -1
  115. package/dist/memory/digest.js +2 -1
  116. package/dist/memory/discovery.js +6 -5
  117. package/dist/memory/expand-service.d.ts.map +1 -1
  118. package/dist/memory/file-worker.js +9 -8
  119. package/dist/memory/file-worker.js.map +1 -1
  120. package/dist/memory/index.d.ts.map +1 -1
  121. package/dist/memory/normalize.d.ts.map +1 -1
  122. package/dist/memory/normalize.js +5 -4
  123. package/dist/memory/search.js +7 -6
  124. package/dist/memory/worker-provider.js +10 -9
  125. package/dist/memory.js +9 -8
  126. package/dist/memory.js.map +1 -1
  127. package/dist/mesh/store.d.ts.map +1 -1
  128. package/dist/prewalk/handoff.d.ts +1 -1
  129. package/dist/prewalk/handoff.d.ts.map +1 -1
  130. package/dist/protocol.d.ts +2 -0
  131. package/dist/protocol.d.ts.map +1 -1
  132. package/dist/protocol.js +1 -1
  133. package/dist/providers/jev-provider.d.ts +1 -1
  134. package/dist/providers/jev-provider.d.ts.map +1 -1
  135. package/dist/providers/jev-provider.js +9 -7
  136. package/dist/providers/memory-provider.js +9 -8
  137. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  138. package/dist/providers/tasks-provider.d.ts +12 -0
  139. package/dist/providers/tasks-provider.d.ts.map +1 -0
  140. package/dist/residency/host.js +10 -9
  141. package/dist/residency/pi-entry.js +10 -9
  142. package/dist/residency/pi-entry.js.map +1 -1
  143. package/dist/runtime/core-override-guest-types.js +2 -2
  144. package/dist/runtime/guest-types.d.ts +1 -1
  145. package/dist/runtime/guest-types.d.ts.map +1 -1
  146. package/dist/runtime/guest-types.js +1 -1
  147. package/dist/runtime/monty-runtime.js +1 -2
  148. package/dist/runtime/monty-runtime.js.map +1 -1
  149. package/dist/runtime/typescript-kernel.js +2 -2
  150. package/dist/runtime-state-builtins.d.ts +1 -1
  151. package/dist/runtime-state-builtins.d.ts.map +1 -1
  152. package/dist/schema/controller.d.ts.map +1 -1
  153. package/dist/state/store.d.ts.map +1 -1
  154. package/dist/ui/controller.d.ts +1 -0
  155. package/dist/ui/controller.d.ts.map +1 -1
  156. package/dist/ui/conversation-targets.js +2 -2
  157. package/dist/ui/conversation.js +7 -7
  158. package/dist/ui/dashboard.js +9 -9
  159. package/dist/ui/highlight.d.ts.map +1 -1
  160. package/dist/ui/languages/bend.d.ts +4 -0
  161. package/dist/ui/languages/bend.d.ts.map +1 -0
  162. package/dist/ui/languages/bend.js +73 -0
  163. package/dist/ui/languages/bend.js.map +7 -0
  164. package/dist/ui/settings.js +1 -2
  165. package/dist/ui/settings.js.map +1 -1
  166. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  167. package/dist/ui/shell-tasks.d.ts +22 -0
  168. package/dist/ui/shell-tasks.d.ts.map +1 -0
  169. package/dist/ui/shell-tasks.js +161 -0
  170. package/dist/ui/shell-tasks.js.map +7 -0
  171. package/dist/ui/shiki-catalog.d.ts +2 -1
  172. package/dist/ui/shiki-catalog.d.ts.map +1 -1
  173. package/dist/ui/snapshot.d.ts.map +1 -1
  174. package/dist/ui/types.d.ts +1 -0
  175. package/dist/ui/types.d.ts.map +1 -1
  176. package/dist/ui/widget.d.ts.map +1 -1
  177. package/dist/verified/authority.d.ts +17 -0
  178. package/dist/verified/authority.d.ts.map +1 -0
  179. package/dist/verified/generated/authority-kernel.d.ts +10 -0
  180. package/dist/verified/generated/authority-kernel.js +116 -0
  181. package/dist/verified/generated/kernel.d.ts +31 -0
  182. package/dist/verified/generated/kernel.js +351 -0
  183. package/dist/verified/generated/lifecycle-kernel.d.ts +7 -0
  184. package/dist/verified/generated/lifecycle-kernel.js +155 -0
  185. package/dist/verified/generated/manifest.json +54 -0
  186. package/dist/verified/generated/provider-kernel.d.ts +9 -0
  187. package/dist/verified/generated/provider-kernel.js +80 -0
  188. package/dist/verified/generated/storage-kernel.d.ts +11 -0
  189. package/dist/verified/generated/storage-kernel.js +98 -0
  190. package/dist/verified/memory.d.ts +11 -0
  191. package/dist/verified/memory.d.ts.map +1 -0
  192. package/dist/verified/nat.d.ts +2 -0
  193. package/dist/verified/nat.d.ts.map +1 -0
  194. package/dist/verified/policy.d.ts +37 -0
  195. package/dist/verified/policy.d.ts.map +1 -0
  196. package/dist/verified/resources.d.ts +14 -0
  197. package/dist/verified/resources.d.ts.map +1 -0
  198. package/dist/verified/storage.d.ts +32 -0
  199. package/dist/verified/storage.d.ts.map +1 -0
  200. package/dist/worker/event-projection.d.ts +6 -0
  201. package/dist/worker/event-projection.d.ts.map +1 -0
  202. package/dist/worker/event-projection.js +99 -0
  203. package/dist/worker/event-projection.js.map +7 -0
  204. package/dist/worker/recovery-watchdog.d.ts +12 -0
  205. package/dist/worker/recovery-watchdog.d.ts.map +1 -0
  206. package/dist/worker/recovery-watchdog.js +41 -0
  207. package/dist/worker/recovery-watchdog.js.map +7 -0
  208. package/dist/worker.js +80 -22
  209. package/dist/worker.js.map +2 -2
  210. package/docs/agents.md +26 -14
  211. package/docs/architecture.md +1 -1
  212. package/docs/background-tasks.md +140 -0
  213. package/docs/compaction.md +91 -28
  214. package/docs/components.md +5 -1
  215. package/docs/configuration.md +6 -6
  216. package/docs/foreman.md +4 -4
  217. package/docs/harnesses.md +95 -0
  218. package/docs/interface.md +7 -0
  219. package/docs/jev.md +59 -52
  220. package/docs/kernels.md +2 -2
  221. package/docs/licenses/bend-apache-2.0.txt +202 -0
  222. package/docs/memory-recall.md +1 -1
  223. package/docs/programmatic-compaction.md +13 -2
  224. package/docs/provider-capabilities.md +197 -0
  225. package/docs/shell-middleware.md +3 -3
  226. package/docs/skills.md +1 -1
  227. package/docs/verified-kernels.md +278 -0
  228. package/package.json +14 -4
  229. package/proofs/abi.json +308 -0
  230. package/proofs/authority-abi.json +7 -0
  231. package/proofs/authority-kernel.bend +23 -0
  232. package/proofs/authority-proof.bend +74 -0
  233. package/proofs/authority-spec.bend +30 -0
  234. package/proofs/authority-state.bend +43 -0
  235. package/proofs/authority-types.d.ts +3 -0
  236. package/proofs/kernel.bend +139 -0
  237. package/proofs/lifecycle-abi.json +3 -0
  238. package/proofs/lifecycle-kernel.bend +11 -0
  239. package/proofs/lifecycle-proof.bend +249 -0
  240. package/proofs/lifecycle-spec.bend +261 -0
  241. package/proofs/lifecycle-types.d.ts +4 -0
  242. package/proofs/lifecycle.bend +119 -0
  243. package/proofs/provider-abi.json +4 -0
  244. package/proofs/provider-kernel.bend +14 -0
  245. package/proofs/provider-plans.bend +28 -0
  246. package/proofs/provider-spec.bend +14 -0
  247. package/proofs/provider-types.d.ts +5 -0
  248. package/proofs/resource-proof.bend +633 -0
  249. package/proofs/resource-spec.bend +133 -0
  250. package/proofs/resources.bend +160 -0
  251. package/proofs/state-kernel.bend +17 -0
  252. package/proofs/state-plans.bend +40 -0
  253. package/proofs/state-proof.bend +42 -0
  254. package/proofs/state-spec.bend +26 -0
  255. package/proofs/storage-abi.json +3 -0
  256. package/proofs/storage-kernel.bend +11 -0
  257. package/proofs/storage-plans.bend +100 -0
  258. package/proofs/storage-proof.bend +176 -0
  259. package/proofs/storage-spec.bend +70 -0
  260. package/proofs/storage-types.d.ts +8 -0
  261. package/proofs/types.d.ts +7 -0
  262. package/scripts/test-verified-kernels.mjs +107 -0
  263. package/scripts/verified-kernels.mjs +136 -0
  264. package/skillsets/python/fabric-jev/SKILL.md +13 -9
  265. package/skillsets/typescript/fabric-exec/SKILL.md +4 -2
  266. package/skillsets/typescript/fabric-jev/SKILL.md +13 -9
  267. package/dist/chunks/chunk-3H7SDWZI.js.map +0 -7
  268. package/dist/chunks/chunk-3TXOQ5MG.js.map +0 -7
  269. package/dist/chunks/chunk-4NUTVNS2.js.map +0 -7
  270. package/dist/chunks/chunk-77PDIBK2.js +0 -129
  271. package/dist/chunks/chunk-77PDIBK2.js.map +0 -7
  272. package/dist/chunks/chunk-7A6NVHB5.js.map +0 -7
  273. package/dist/chunks/chunk-FLKGJPCN.js.map +0 -7
  274. package/dist/chunks/chunk-G4LADAYY.js.map +0 -7
  275. package/dist/chunks/chunk-IK6PPFWG.js.map +0 -7
  276. package/dist/chunks/chunk-MQG5QKGI.js.map +0 -7
  277. package/dist/chunks/chunk-PSNXUZMY.js.map +0 -7
  278. package/dist/chunks/chunk-Q4XJ4PYL.js.map +0 -7
  279. package/dist/chunks/chunk-RTXZHKMS.js.map +0 -7
  280. package/dist/chunks/chunk-U5FYOMG5.js.map +0 -7
  281. package/dist/chunks/chunk-UQ4LTUH4.js.map +0 -7
  282. package/dist/chunks/chunk-XT4346N7.js.map +0 -7
  283. package/dist/jev/browser.d.ts +0 -37
  284. package/dist/jev/browser.d.ts.map +0 -1
  285. package/dist/jev/browser.js +0 -13
  286. package/dist/jev/browser.js.map +0 -7
  287. /package/dist/chunks/{chunk-IUCVOZRX.js.map → chunk-3SIXBW6A.js.map} +0 -0
  288. /package/dist/chunks/{chunk-2SWRVIYJ.js.map → chunk-754HA6KO.js.map} +0 -0
  289. /package/dist/chunks/{chunk-K6DHXXF5.js.map → chunk-B2IVWASP.js.map} +0 -0
  290. /package/dist/chunks/{chunk-ZDNGXLEC.js.map → chunk-B4HECUJI.js.map} +0 -0
  291. /package/dist/chunks/{chunk-H6DDV6E2.js.map → chunk-CSJSHBAT.js.map} +0 -0
  292. /package/dist/chunks/{chunk-MW5VI7IW.js.map → chunk-D4B4CCTA.js.map} +0 -0
  293. /package/dist/chunks/{chunk-EDL4JDW7.js.map → chunk-EBWMC3OO.js.map} +0 -0
  294. /package/dist/chunks/{chunk-W3FRE4VI.js.map → chunk-FDIEQEXS.js.map} +0 -0
  295. /package/dist/chunks/{chunk-3WIGAX56.js.map → chunk-JCV54SSP.js.map} +0 -0
  296. /package/dist/chunks/{chunk-7VAZ4N43.js.map → chunk-V3PIO7QL.js.map} +0 -0
  297. /package/dist/chunks/{chunk-MGDLRV2R.js.map → chunk-VQGO4P7C.js.map} +0 -0
  298. /package/dist/chunks/{chunk-D5WKZONW.js.map → chunk-X3IRR7CV.js.map} +0 -0
  299. /package/dist/chunks/{chunk-RKRVOBVO.js.map → chunk-YC3QQDZ3.js.map} +0 -0
  300. /package/dist/chunks/{chunk-36B4AIRT.js.map → chunk-ZTXZ6JDO.js.map} +0 -0
package/dist/index.js CHANGED
@@ -31,23 +31,23 @@ import {
31
31
  singleCallProgressLine,
32
32
  spinnerFrame,
33
33
  updateSpinner
34
- } from "./chunks/chunk-7VAZ4N43.js";
34
+ } from "./chunks/chunk-V3PIO7QL.js";
35
35
  import {
36
36
  configureHighlighting,
37
37
  highlightCode,
38
38
  observePiTheme
39
- } from "./chunks/chunk-RTXZHKMS.js";
40
- import {
41
- activeStatuses,
42
- isActiveStatus,
43
- orderAgentsByCreation
44
- } from "./chunks/chunk-AAHHYDTO.js";
39
+ } from "./chunks/chunk-QNMQJNXE.js";
45
40
  import {
46
41
  formatCost,
47
42
  formatDuration,
48
43
  formatTokens,
49
44
  safeText
50
45
  } from "./chunks/chunk-IR3PIHJM.js";
46
+ import {
47
+ activeStatuses,
48
+ isActiveStatus,
49
+ orderAgentsByCreation
50
+ } from "./chunks/chunk-4NF3S3NM.js";
51
51
  import {
52
52
  repairFabricGuestCode
53
53
  } from "./chunks/chunk-VXZZJ44D.js";
@@ -83,11 +83,7 @@ import "./chunks/chunk-DLXPTBPL.js";
83
83
  import {
84
84
  GUEST_TYPE_DECLARATIONS,
85
85
  PI_CORE_COMPATIBILITY_ARGUMENT_TYPE_NAMES
86
- } from "./chunks/chunk-FLKGJPCN.js";
87
- import {
88
- NESTED_TOOL_CALL_ID_PREFIX
89
- } from "./chunks/chunk-3TXOQ5MG.js";
90
- import "./chunks/chunk-LMAVZN7J.js";
86
+ } from "./chunks/chunk-ULQFHZJE.js";
91
87
  import {
92
88
  AUTO_APPLY_PROPOSAL_KINDS,
93
89
  BackgroundEntropyCompiler,
@@ -144,7 +140,7 @@ import {
144
140
  sessionWindowEvidence,
145
141
  sessionWindowEvidenceAsync,
146
142
  surfaceFreedomReport
147
- } from "./chunks/chunk-H6DDV6E2.js";
143
+ } from "./chunks/chunk-CSJSHBAT.js";
148
144
  import {
149
145
  COMPILED_SURFACE_VERSION,
150
146
  ENTROPY_INVOCATION_STAGES,
@@ -168,9 +164,9 @@ import {
168
164
  saveCompiledSurface,
169
165
  saveCompiledSurfaceAsync,
170
166
  schemaDigest
171
- } from "./chunks/chunk-3WIGAX56.js";
172
- import "./chunks/chunk-MGDLRV2R.js";
173
- import "./chunks/chunk-XT4346N7.js";
167
+ } from "./chunks/chunk-JCV54SSP.js";
168
+ import "./chunks/chunk-VQGO4P7C.js";
169
+ import "./chunks/chunk-WXSELMFV.js";
174
170
  import {
175
171
  registerJevAuth
176
172
  } from "./chunks/chunk-T3A5GNCW.js";
@@ -178,13 +174,12 @@ import {
178
174
  ApprovalController,
179
175
  FabricAutoApprovalClassifier,
180
176
  FabricSessionApprovals
181
- } from "./chunks/chunk-MW5VI7IW.js";
177
+ } from "./chunks/chunk-D4B4CCTA.js";
182
178
  import "./chunks/chunk-XB3RJVT4.js";
183
- import "./chunks/chunk-7TB7NXSL.js";
184
179
  import {
185
180
  getActiveRepairCompiler,
186
181
  setActiveCompiledSurface
187
- } from "./chunks/chunk-PSNXUZMY.js";
182
+ } from "./chunks/chunk-KS44WKJJ.js";
188
183
  import {
189
184
  FABRIC_BASH_MIDDLEWARE,
190
185
  FABRIC_COMPONENT_DISCOVER_EVENT,
@@ -200,11 +195,15 @@ import {
200
195
  readFabricPeerCardsRequestV1,
201
196
  readFabricPrewalkRequestV1,
202
197
  readFabricToolResultProxyDetailsV1
203
- } from "./chunks/chunk-IJL3QK3J.js";
198
+ } from "./chunks/chunk-Y57UHPIK.js";
204
199
  import {
205
200
  awaitPeerSettle,
206
201
  buildPeerCards
207
202
  } from "./chunks/chunk-YV2PHCDB.js";
203
+ import {
204
+ closeScratch,
205
+ createScratch
206
+ } from "./chunks/chunk-RAO6TQFP.js";
208
207
  import {
209
208
  resolveAgentDir
210
209
  } from "./chunks/chunk-PXAICAUT.js";
@@ -215,31 +214,27 @@ import {
215
214
  loadFabricConfig,
216
215
  loadFabricConfigForScope,
217
216
  saveFabricConfig
218
- } from "./chunks/chunk-4NUTVNS2.js";
217
+ } from "./chunks/chunk-F72MAIQY.js";
219
218
  import {
220
219
  defaultCodePreviewSettings
221
220
  } from "./chunks/chunk-OKOHRXGF.js";
222
- import {
223
- closeScratch,
224
- createScratch
225
- } from "./chunks/chunk-RAO6TQFP.js";
226
221
  import {
227
222
  compactAtConfiguredThreshold,
228
223
  fabricExecTitleHintCached,
229
224
  normalizeRunDisplay,
230
225
  registerCompactionHook
231
- } from "./chunks/chunk-MQG5QKGI.js";
226
+ } from "./chunks/chunk-Q5BMTL6A.js";
232
227
  import {
233
228
  fabricWriteBindings
234
229
  } from "./chunks/chunk-SZUXWOO7.js";
235
230
  import "./chunks/chunk-KAD7UWT2.js";
236
- import "./chunks/chunk-ZDNGXLEC.js";
231
+ import "./chunks/chunk-B4HECUJI.js";
237
232
  import {
238
233
  FABRIC_ACTOR_PI_HOST_EVENTS
239
234
  } from "./chunks/chunk-2QAOC3BO.js";
240
235
  import "./chunks/chunk-A4VP7HDF.js";
241
236
  import "./chunks/chunk-MGWQOKBV.js";
242
- import "./chunks/chunk-3H7SDWZI.js";
237
+ import "./chunks/chunk-LNLQ2LX3.js";
243
238
  import "./chunks/chunk-UR2K6WK6.js";
244
239
  import "./chunks/chunk-B54Z662X.js";
245
240
  import {
@@ -254,7 +249,7 @@ import {
254
249
  projectFabricAuditArgs,
255
250
  projectFabricAuditResult,
256
251
  readFabricExecutionTraceV1
257
- } from "./chunks/chunk-D5WKZONW.js";
252
+ } from "./chunks/chunk-X3IRR7CV.js";
258
253
  import {
259
254
  MAX_NORMAL_FORM_PLANS,
260
255
  MAX_NORMAL_FORM_RULES,
@@ -272,11 +267,12 @@ import {
272
267
  signatureDistance,
273
268
  staticFreedomFromSchema,
274
269
  trendFromScores
275
- } from "./chunks/chunk-G4LADAYY.js";
270
+ } from "./chunks/chunk-OINADFEF.js";
276
271
  import {
277
272
  PI_CORE_TOOL_NAMES,
278
273
  PI_CORE_TOOL_NAME_SET
279
274
  } from "./chunks/chunk-YU62DDKK.js";
275
+ import "./chunks/chunk-4E63LJDD.js";
280
276
  import {
281
277
  FABRIC_EXECUTION_GUIDANCE_SLOT,
282
278
  MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS,
@@ -1125,12 +1121,25 @@ ${top}` : "fingerprints: (none this session)"
1125
1121
  }
1126
1122
  }
1127
1123
  });
1124
+ pi.registerShortcut?.("ctrl+alt+t", {
1125
+ description: "Inspect Fabric background shell tasks",
1126
+ handler: async (context) => {
1127
+ if (context.mode !== "tui") return;
1128
+ try {
1129
+ await state.ensure(context);
1130
+ await fabricUi.openTasks(context);
1131
+ } catch (error) {
1132
+ context.ui.notify(safeText(error instanceof Error ? error.message : String(error)), "error");
1133
+ }
1134
+ }
1135
+ });
1128
1136
  pi.registerCommand("fabric", {
1129
- description: "Open Fabric dashboard or chat, arm prewalk, reload, or manage agents and actors",
1137
+ description: "Open Fabric dashboard, chat or tasks, arm prewalk, reload, or manage agents and actors",
1130
1138
  getArgumentCompletions: (argumentPrefix) => {
1131
1139
  const subcommands = [
1132
1140
  "status",
1133
1141
  "dashboard",
1142
+ "tasks",
1134
1143
  "chat",
1135
1144
  "settings",
1136
1145
  "schema",
@@ -1173,6 +1182,10 @@ ${top}` : "fingerprints: (none this session)"
1173
1182
  const subcommand = argumentPrefix.slice(0, firstSpace);
1174
1183
  const idPrefix = argumentPrefix.slice(firstSpace + 1);
1175
1184
  if (!state.initialized) return null;
1185
+ if (subcommand === "tasks") {
1186
+ const matches = state.shellJobs?.list().filter((job) => job.id.startsWith(idPrefix)) ?? [];
1187
+ return matches.map((job) => ({ value: `tasks ${job.id}`, label: job.id.slice(0, 8), description: safeText(job.description ?? job.command).slice(0, 120) }));
1188
+ }
1176
1189
  if (subcommand === "chat") {
1177
1190
  const snapshot = fabricUi.snapshot();
1178
1191
  const seen = /* @__PURE__ */ new Set();
@@ -1377,6 +1390,10 @@ Task: ${status.task}` : ""}`,
1377
1390
  await armPrewalk(state, context, pi, task);
1378
1391
  return;
1379
1392
  }
1393
+ if (command === "tasks") {
1394
+ await fabricUi.openTasks(context, argumentsList[0]);
1395
+ return;
1396
+ }
1380
1397
  if (command === "chat") {
1381
1398
  await fabricUi.openConversation(context, argumentsList.join(" ") || void 0);
1382
1399
  return;
@@ -2046,7 +2063,7 @@ var FabricToolLifecycle = class {
2046
2063
  }
2047
2064
  #outerCalls = /* @__PURE__ */ new Set();
2048
2065
  async toolCall(event, context) {
2049
- if (event.toolCallId.startsWith(NESTED_TOOL_CALL_ID_PREFIX)) {
2066
+ if (event.toolCallId.startsWith(FABRIC_NESTED_TOOL_CALL_ID_PREFIX)) {
2050
2067
  if (this.#outerCalls.size > 0) return void 0;
2051
2068
  await this.#authorizeTopLevel(event);
2052
2069
  return void 0;
@@ -2064,7 +2081,7 @@ var FabricToolLifecycle = class {
2064
2081
  return void 0;
2065
2082
  }
2066
2083
  toolResult(event) {
2067
- if (event.toolName !== FABRIC_TOOL_NAME || event.toolCallId.startsWith(NESTED_TOOL_CALL_ID_PREFIX) || !this.#outerCalls.delete(event.toolCallId)) {
2084
+ if (event.toolName !== FABRIC_TOOL_NAME || event.toolCallId.startsWith(FABRIC_NESTED_TOOL_CALL_ID_PREFIX) || !this.#outerCalls.delete(event.toolCallId)) {
2068
2085
  return void 0;
2069
2086
  }
2070
2087
  return !event.isError && finalFabricDetailsFailed(event.details) ? { isError: true } : void 0;
@@ -2192,7 +2209,7 @@ var fabricExecutionKernelGuidance = (fullCodeMode, kernel = "typescript", python
2192
2209
  // caches stay warm.
2193
2210
  `Read every file the user provides (images, screenshots, code, text) with the ${fullCodeMode ? "`pi.read`" : "`read`"} tool before responding \u2014 never assume its contents.`
2194
2211
  ].join(" ");
2195
- var defaultFabricExecutionGuidance = (fullCodeMode, kernel = "typescript", pythonRuntime = "monty") => kernel === "python" ? (pythonRuntime === "monty" ? "Python backend: Monty sandboxed subset, not CPython. Native filesystem/network/environment access and arbitrary imports are unavailable; use host tools for effects. Supply acyclic JSON host arguments; recursive containers are unsupported. Underscore-prefixed direct capability attributes are unavailable: use tools.call with the exact discovered ref instead. \u03C0 is an attribute object; payloads is a dict, not the same identity. " : "Python backend: CPython; native standard-library imports are available. ") + 'Python fabric_exec: write an async function body with `await` and `return`; each invocation starts fresh. Use imports supported by the configured backend, such as `import asyncio`. Host methods accept one dict or keyword arguments: `await tools.search(query="example")`, `await tools.call(ref="provider.action", args={"key": "value"})`; discover with tools.search instead of enumerating: tools.list is a capped page (default 100, hard cap 1000) with no truncation marker, so a short result never proves an action is absent (tools.list(envelope=True) reports totals). Known actions use mcp.<server>.<tool>, memory.*, state.*, schema.*, compact.*, components.*, agents.*, or mesh.*. Responses are native Python dicts/lists, not attribute objects. Use `asyncio.gather` for independent calls. `\u03C0.key` and `payloads["key"]` contain only the exact top-level payload keys. Return JSON-compatible data (convert sets, bytes, paths, and datetimes explicitly); print output is bounded. JavaScript callback helpers (workflow, memory.walk, and predicate callbacks) are not Python APIs; page with ordinary await/loops instead. Provider argument validation and approvals remain host-enforced. Schema enforce retains host gates and requires the selected runtime\u2019s isolation; no unrestricted fallback.' + (fullCodeMode ? ' `await pi.read("/x")`, `await pi.grep(pattern="TODO", path="src")`, `await pi.find(pattern="*.py", path="src")`, and `await pi.ls("src")` return strings. `await pi.bash(command="ls")`, `await pi.edit(path="/x", oldText="a", newText="b")`, and `await pi.write(path="/y", content=\u03C0.body)` return dicts; read `r["output"]`. Shell nonzero exits raise; `settle=True` returns a failure dict instead. Cancellation, timeout, approval and security errors still raise. A nested shell that exceeds executor.shellHangMs still resolves ok with a still-running notice, pid, and live output path; background=True detaches immediately. Inspect with pi.read and stop with kill <pid> through pi.bash. Captured tools are `await extensions.<name>(...)`.' : " Pi core and extensions are unavailable inside fabric_exec in orchestration-only mode.") : fullCodeMode ? "Examples and returns: `pi.read('/x')`, `pi.grep('TODO','src')` / `pi.grep({pattern:'TODO', path:'src', ignoreCase:true, context:2})`, `pi.find({pattern:'*.ts', path:'src', limit:20})`, and `pi.ls('src')` return strings; `pi.bash({cmd:'ls'})` (or `pi.powershell` on Windows), `pi.edit({path:'/x', old:'a', new:'b'})`, and `pi.write({path:'/y', text:'z'})` return `{ok, output, details}` (read `.output`); failed core calls reject, including shell tools on an ordinary nonzero exit; pass `settle: true` to `pi.bash` or `pi.powershell` to get `{ ok: false, exitCode, output, error }` instead. Timeout, cancellation, approval, and security failures still reject. A nested shell that exceeds `executor.shellHangMs` still resolves `ok: true` with a still-running notice, pid, and live output path; `background: true` detaches immediately. Inspect with `pi.read` and stop with `kill <pid>` through `pi.bash`.\n`tools` is discovery + generic calls only (`providers`/`catalog`/`list`/`search`/`describe`/`call`/`models`). Call known MCP tools as `mcp.<sanitized_server>.<sanitized_tool>(args)`, captured tools as `extensions.<tool>(args)`, and stable providers as `memory.*`, `state.*`, `schema.*`, or `compact.*`. Use `tools.call({ref,args})` for computed refs. `pi` is the core tools; `\u03C0.<key>` reads named `strings` (not a tool)." : "Call known actions through `mcp.<sanitized_server>.<sanitized_tool>(args)`, `memory.*`, `state.*`, `schema.*`, `components.*`, `compact.*`, `agents.*`, or `mesh.*`; use `tools.catalog`/`search`/`describe`/`list` for discovery and `tools.call({ref,args})` for computed refs. Other surfaces are opt-in via user-loaded skills.";
2212
+ var defaultFabricExecutionGuidance = (fullCodeMode, kernel = "typescript", pythonRuntime = "monty") => kernel === "python" ? (pythonRuntime === "monty" ? "Python backend: Monty sandboxed subset, not CPython. Native filesystem/network/environment access and arbitrary imports are unavailable; use host tools for effects. Supply acyclic JSON host arguments; recursive containers are unsupported. Underscore-prefixed direct capability attributes are unavailable: use tools.call with the exact discovered ref instead. \u03C0 is an attribute object; payloads is a dict, not the same identity. " : "Python backend: CPython; native standard-library imports are available. ") + 'Python fabric_exec: write an async function body with `await` and `return`; each invocation starts fresh. Use imports supported by the configured backend, such as `import asyncio`. Host methods accept one dict or keyword arguments: `await tools.search(query="example")`, `await tools.call(ref="provider.action", args={"key": "value"})`; discover with tools.search instead of enumerating: tools.list is a capped page (default 100, hard cap 1000) with no truncation marker, so a short result never proves an action is absent (tools.list(envelope=True) reports totals). Known actions use mcp.<server>.<tool>, memory.*, state.*, schema.*, compact.*, components.*, agents.*, or mesh.*. Responses are native Python dicts/lists, not attribute objects. Use `asyncio.gather` for independent calls. `\u03C0.key` and `payloads["key"]` contain only the exact top-level payload keys. Return JSON-compatible data (convert sets, bytes, paths, and datetimes explicitly); print output is bounded. JavaScript callback helpers (workflow, memory.walk, and predicate callbacks) are not Python APIs; page with ordinary await/loops instead. Provider argument validation and approvals remain host-enforced. Schema enforce retains host gates and requires the selected runtime\u2019s isolation; no unrestricted fallback.' + (fullCodeMode ? ' `await pi.read("/x")`, `await pi.grep(pattern="TODO", path="src")`, `await pi.find(pattern="*.py", path="src")`, and `await pi.ls("src")` return strings. `await pi.bash(command="ls")`, `await pi.edit(path="/x", oldText="a", newText="b")`, and `await pi.write(path="/y", content=\u03C0.body)` return dicts; read `r["output"]`. Shell nonzero exits raise; `settle=True` returns a failure dict instead. Cancellation, timeout, approval and security errors still raise. A nested shell that exceeds executor.shellHangMs still resolves ok with a still-running notice, pid, and live output path; background=True detaches immediately. Detached results include details.taskId; completion notifies this session. Use tools.call(ref=\'tasks.list\', args={}), tasks.get or tasks.stop with {\'id\': taskId}; pi.read can read the bounded log. Bounded controllers can await tasks.wait or tasks.watch (monitor batches, after cursor) without polling; timeout/cancellation affects only the observation. Opt-in monitor={\'delivery\':\'wake\',\'match\':\'literal\',\'timeoutMs\':300000,\'intervalMs\':5000} (choose delivery \'ui\' or \'wake\') also detaches: UI-only never wakes the agent, wake sends coalesced line events. Monitors expire and are not automatically renewed. Captured tools are `await extensions.<name>(...)`.' : " Pi core and extensions are unavailable inside fabric_exec in orchestration-only mode.") : fullCodeMode ? "Examples and returns: `pi.read('/x')`, `pi.grep('TODO','src')` / `pi.grep({pattern:'TODO', path:'src', ignoreCase:true, context:2})`, `pi.find({pattern:'*.ts', path:'src', limit:20})`, and `pi.ls('src')` return strings; `pi.bash({cmd:'ls'})` (or `pi.powershell` on Windows), `pi.edit({path:'/x', old:'a', new:'b'})`, and `pi.write({path:'/y', text:'z'})` return `{ok, output, details}` (read `.output`); failed core calls reject, including shell tools on an ordinary nonzero exit; pass `settle: true` to `pi.bash` or `pi.powershell` to get `{ ok: false, exitCode, output, error }` instead. Timeout, cancellation, approval, and security failures still reject. A nested shell that exceeds `executor.shellHangMs` still resolves `ok: true` with a still-running notice, pid, and live output path; `background: true` detaches immediately. Detached results include `details.taskId`; completion notifies this session, without polling. Use `tools.call({ref:'tasks.list',args:{}})` or `tasks.get`/`tasks.stop` with `{id: taskId}`; `pi.read` can read the bounded log. Bounded controllers can await `tasks.wait` or `tasks.watch` (monitor batches, `after` cursor) without polling; timeout/cancellation affects only the observation. Opt-in `monitor:{delivery:'ui'|'wake',match:'literal',timeoutMs:300000,intervalMs:5000}` also detaches: UI-only never wakes the agent, wake sends coalesced line events. Monitors expire and are not automatically renewed.\n`tools` is discovery + generic calls only (`providers`/`catalog`/`list`/`search`/`describe`/`call`/`models`). Call known MCP tools as `mcp.<sanitized_server>.<sanitized_tool>(args)`, captured tools as `extensions.<tool>(args)`, and stable providers as `memory.*`, `state.*`, `schema.*`, or `compact.*`. Use `tools.call({ref,args})` for computed refs. `pi` is the core tools; `\u03C0.<key>` reads named `strings` (not a tool)." : "Call known actions through `mcp.<sanitized_server>.<sanitized_tool>(args)`, `memory.*`, `state.*`, `schema.*`, `components.*`, `compact.*`, `agents.*`, or `mesh.*`; use `tools.catalog`/`search`/`describe`/`list` for discovery and `tools.call({ref,args})` for computed refs. Other surfaces are opt-in via user-loaded skills.";
2196
2213
  var manifestNameCache = /* @__PURE__ */ new Map();
2197
2214
  var packageNameFromManifest = (startPath) => {
2198
2215
  if (!startPath) return void 0;
@@ -4441,6 +4458,7 @@ var createDashboardSnapshot = (state, events, context, activityRuns, cache, immu
4441
4458
  const globalActors = state.globalActors.list();
4442
4459
  const componentGraph = typeof state.componentGraph === "function" ? state.componentGraph() : { components: [], edges: [], cycles: [] };
4443
4460
  const meshEntries = state.config.mesh.enabled ? state.mesh.list("", 200) : [];
4461
+ const shells = state.shellJobs?.list().filter((job) => job.spilledAt !== void 0 || job.monitor) ?? [];
4444
4462
  const inputs = {
4445
4463
  runs,
4446
4464
  agentRecords,
@@ -4448,6 +4466,7 @@ var createDashboardSnapshot = (state, events, context, activityRuns, cache, immu
4448
4466
  participants,
4449
4467
  main,
4450
4468
  peers,
4469
+ shells,
4451
4470
  globalActors,
4452
4471
  componentGraph,
4453
4472
  meshEntries,
@@ -4598,6 +4617,7 @@ var createDashboardSnapshot = (state, events, context, activityRuns, cache, immu
4598
4617
  }).slice(0, 120);
4599
4618
  const snapshot = {
4600
4619
  now: Date.now(),
4620
+ shells,
4601
4621
  runs: orderedRuns,
4602
4622
  main,
4603
4623
  peers,
@@ -4621,19 +4641,19 @@ var createDashboardSnapshot = (state, events, context, activityRuns, cache, immu
4621
4641
  // src/ui/widget.ts
4622
4642
  import { truncateToWidth as truncateToWidth3, visibleWidth as visibleWidth2 } from "@earendil-works/pi-tui";
4623
4643
  var statusGlyph = (status) => {
4624
- if (status === "completed" || status === "done") return "\u2713";
4644
+ if (status === "completed" || status === "done" || status === "exited") return "\u2713";
4625
4645
  if (status === "failed" || status === "timed_out") return "\u2717";
4626
4646
  if (status === "blocked") return "!";
4627
- if (status === "stopped" || status === "cancelled") return "\u25A0";
4647
+ if (status === "stopped" || status === "cancelled" || status === "killed") return "\u25A0";
4628
4648
  if (status === "queued" || status === "pending" || status === "ready") return "\u25CB";
4629
4649
  if (status === "idle" || status === "state") return "\xB7";
4630
4650
  return spinnerFrame();
4631
4651
  };
4632
4652
  var colorStatus = (theme, status, value) => {
4633
- if (status === "completed" || status === "done") return theme.fg("success", value);
4653
+ if (status === "completed" || status === "done" || status === "exited") return theme.fg("success", value);
4634
4654
  if (status === "failed" || status === "timed_out") return theme.fg("error", value);
4635
- if (status === "blocked") return theme.fg("warning", value);
4636
- if (status === "running" || status === "in_progress") return theme.fg("accent", value);
4655
+ if (status === "blocked" || status === "stopping") return theme.fg("warning", value);
4656
+ if (status === "running" || status === "in_progress" || status === "spilled") return theme.fg("accent", value);
4637
4657
  return theme.fg("dim", value);
4638
4658
  };
4639
4659
  var phaseProgress = (run, phaseId) => {
@@ -4666,6 +4686,7 @@ var agentLines = (theme, agent, now) => {
4666
4686
  var shouldShowFabricWidget = (snapshot, mode) => {
4667
4687
  if (mode === "hidden") return false;
4668
4688
  if (mode === "always") return true;
4689
+ if (snapshot.shells?.some((job) => job.finishedAt === void 0 || snapshot.now - job.finishedAt < 3e4)) return true;
4669
4690
  if (snapshot.agents.some((agent) => isActiveStatus(agent.status))) return true;
4670
4691
  if (snapshot.actors.some((actor) => actor.status !== "stopped")) return true;
4671
4692
  const run = snapshot.runs[0];
@@ -4743,7 +4764,10 @@ var FabricWidget = class {
4743
4764
  const terminalActorWorkers = visibleActors.filter((actor) => actor.worker && !isActiveStatus(actor.worker.status)).map((actor) => ({ ...actor.worker, name: actor.name }));
4744
4765
  const nestedCalls = run?.calls.filter((call) => call.kind !== "agent" && call.kind !== "actor") ?? [];
4745
4766
  const title = run?.name ?? "Fabric session";
4746
- const headerStatus = run?.status ?? (activeAgents.length > 0 || activeActorWorkers.length > 0 ? "running" : "idle");
4767
+ const shells = snapshot.shells ?? [];
4768
+ const liveShells = shells.filter((job) => job.finishedAt === void 0);
4769
+ const recentShells = shells.filter((job) => job.finishedAt !== void 0 && snapshot.now - job.finishedAt < 3e4);
4770
+ const headerStatus = run?.status ?? (activeAgents.length > 0 || activeActorWorkers.length > 0 || liveShells.length > 0 ? "running" : "idle");
4747
4771
  const parts = [];
4748
4772
  const callTotal = nestedCalls.length;
4749
4773
  if (callTotal > 1) {
@@ -4762,6 +4786,7 @@ var FabricWidget = class {
4762
4786
  );
4763
4787
  }
4764
4788
  }
4789
+ if (liveShells.length > 0) parts.push(`${liveShells.length} shell${liveShells.length === 1 ? "" : "s"}`);
4765
4790
  if (activeAgents.length > 0) parts.push(`${activeAgents.length} running`);
4766
4791
  if (visibleActors.length > 0) parts.push(`${visibleActors.length} actor${visibleActors.length === 1 ? "" : "s"}`);
4767
4792
  const tokens = totalTokens(snapshot, run);
@@ -4776,7 +4801,19 @@ var FabricWidget = class {
4776
4801
  safeText(title)
4777
4802
  )}${parts.length > 0 ? this.theme.fg("dim", ` \xB7 ${parts.join(" \xB7 ")}`) : ""}`;
4778
4803
  const hasActiveConversations = activeAgents.some((agent) => !agent.stale) || activeActorWorkers.length > 0 || visibleActors.some((actor) => isActiveStatus(actor.status));
4779
- const lines = [hasActiveConversations ? `${header} \xB7 ${this.theme.fg("dim", FABRIC_CONVERSATION_HINT)}` : header];
4804
+ const taskHint = liveShells.length || recentShells.length ? this.theme.fg("dim", " \xB7 /fabric tasks \xB7 ctrl+alt+t") : "";
4805
+ const taskHeader = taskHint ? `${glyph} ${this.theme.fg("accent", "Fabric")}${taskHint}${parts.length ? this.theme.fg("dim", ` \xB7 ${parts.join(" \xB7 ")}`) : ""}` : header;
4806
+ const lines = [hasActiveConversations ? `${taskHeader} \xB7 ${this.theme.fg("dim", FABRIC_CONVERSATION_HINT)}` : taskHeader];
4807
+ for (const job of [...liveShells, ...recentShells].slice(0, 3)) {
4808
+ const elapsed2 = formatDuration((job.finishedAt ?? snapshot.now) - job.startedAt) || "0s";
4809
+ const status = job.stopping ? "stopping" : job.status;
4810
+ const label = job.monitor && job.finishedAt === void 0 && !job.stopping ? `monitor:${job.monitor.delivery}` : status;
4811
+ const glyph2 = colorStatus(this.theme, status, statusGlyph(status));
4812
+ lines.push(
4813
+ ` ${glyph2} ${this.theme.fg("muted", job.id.slice(0, 8))} ${this.theme.fg("muted", label)}${this.theme.fg("dim", ` \xB7 ${elapsed2} \xB7 `)}${this.theme.fg("muted", safeText(job.description ?? job.command))}`
4814
+ );
4815
+ }
4816
+ if (liveShells.length + recentShells.length > 3) lines.push(this.theme.fg("dim", ` +${liveShells.length + recentShells.length - 3} more shell tasks`));
4780
4817
  lines.push(
4781
4818
  ...activeAgents.flatMap((agent) => agentLines(this.theme, agent, snapshot.now)),
4782
4819
  ...activeActorWorkers.flatMap(
@@ -4845,6 +4882,10 @@ var FabricUiController = class {
4845
4882
  #activityUnsubscribe;
4846
4883
  #actorUnsubscribe;
4847
4884
  #agentUnsubscribe;
4885
+ #shellUnsubscribe;
4886
+ #tasksOpen = false;
4887
+ #tasksView;
4888
+ #closeTasks;
4848
4889
  #scheduledRefresh;
4849
4890
  #widgetTui;
4850
4891
  #dashboardTui;
@@ -4883,11 +4924,19 @@ var FabricUiController = class {
4883
4924
  this.#activityUnsubscribe = this.state.activity.subscribe(() => this.#scheduleRefresh());
4884
4925
  this.#actorUnsubscribe = this.state.actors.subscribe(() => this.#scheduleRefresh());
4885
4926
  this.#agentUnsubscribe = this.state.agents.subscribeUi(() => this.#scheduleRefresh());
4927
+ this.#shellUnsubscribe = this.state.shellJobs?.subscribe(() => this.#scheduleRefresh());
4886
4928
  this.#refresh();
4887
4929
  this.#schedulePoll();
4888
4930
  }
4889
4931
  stop() {
4890
4932
  this.#epoch++;
4933
+ this.#closeTasks?.();
4934
+ this.#closeTasks = void 0;
4935
+ this.#tasksView?.dispose();
4936
+ this.#tasksView = void 0;
4937
+ this.#tasksOpen = false;
4938
+ this.#shellUnsubscribe?.();
4939
+ this.#shellUnsubscribe = void 0;
4891
4940
  this.#closeConversation?.();
4892
4941
  this.#closeConversation = void 0;
4893
4942
  this.#conversationView?.dispose();
@@ -4932,9 +4981,58 @@ var FabricUiController = class {
4932
4981
  }
4933
4982
  /** True while Fabric owns keyboard input, including asynchronous view setup. */
4934
4983
  get ownsInput() {
4935
- return this.#dashboardOpen || this.#conversationOpen;
4984
+ return this.#dashboardOpen || this.#conversationOpen || this.#tasksOpen;
4985
+ }
4986
+ async openTasks(context, query) {
4987
+ if (this.ownsInput) return;
4988
+ const jobs = this.state.shellJobs;
4989
+ if (!jobs) {
4990
+ context.ui.notify("No shell task store in this session", "info");
4991
+ return;
4992
+ }
4993
+ const candidates = query ? jobs.list().filter((job) => job.id === query || job.id.startsWith(query)) : [];
4994
+ if (query && candidates.length !== 1) {
4995
+ context.ui.notify("Task ID is unknown or ambiguous", "warning");
4996
+ return;
4997
+ }
4998
+ if (context.mode !== "tui") {
4999
+ context.ui.notify(JSON.stringify(query ? candidates[0] : jobs.list(), null, 2), "info");
5000
+ return;
5001
+ }
5002
+ if (!this.state.config.ui.enabled) {
5003
+ context.ui.notify("The Fabric UI is disabled by ui.enabled", "warning");
5004
+ return;
5005
+ }
5006
+ if (!this.#context) this.start(context);
5007
+ this.#tasksOpen = true;
5008
+ const epoch = this.#epoch;
5009
+ try {
5010
+ const { ShellTasksView } = await import("./ui/shell-tasks.js");
5011
+ if (epoch !== this.#epoch) return;
5012
+ await context.ui.custom((tui, theme, _keys, done) => {
5013
+ this.#closeTasks = () => done();
5014
+ const id = candidates[0]?.id;
5015
+ this.#tasksView = new ShellTasksView({
5016
+ jobs,
5017
+ theme,
5018
+ done: () => done(),
5019
+ requestRender: () => tui.requestRender(),
5020
+ rows: () => tui.terminal?.rows ?? 24,
5021
+ ...id ? { id } : {}
5022
+ });
5023
+ return this.#tasksView;
5024
+ }, { overlay: true, overlayOptions: { width: "94%", maxHeight: "90%", anchor: "center", margin: 1 } });
5025
+ } finally {
5026
+ if (epoch === this.#epoch) {
5027
+ this.#tasksView?.dispose();
5028
+ this.#tasksView = void 0;
5029
+ this.#closeTasks = void 0;
5030
+ this.#tasksOpen = false;
5031
+ }
5032
+ }
4936
5033
  }
4937
5034
  async openConversation(context, query) {
5035
+ if (this.#tasksOpen) return;
4938
5036
  if (context.mode !== "tui") {
4939
5037
  context.ui.notify("Fabric conversations are available in TUI mode", "warning");
4940
5038
  return;
@@ -5313,7 +5411,7 @@ var FabricUiController = class {
5313
5411
  this.#timer = void 0;
5314
5412
  }
5315
5413
  if (this.#timer || !this.#context) return;
5316
- const active = this.#snapshot.runs.some((run) => run.status === "running") || this.#snapshot.peers.length > 0 || this.#snapshot.agents.some((agent) => isActiveStatus(agent.status)) || this.#snapshot.actors.some(
5414
+ const active = this.#snapshot.shells?.some((job) => job.finishedAt === void 0 || Date.now() - job.finishedAt < 3e4) || this.#snapshot.runs.some((run) => run.status === "running") || this.#snapshot.peers.length > 0 || this.#snapshot.agents.some((agent) => isActiveStatus(agent.status)) || this.#snapshot.actors.some(
5317
5415
  (actor) => isActiveStatus(actor.status) || Boolean(actor.worker && isActiveStatus(actor.worker.status))
5318
5416
  );
5319
5417
  if (!this.ownsInput && !active) return;
@@ -5490,6 +5588,16 @@ var CTRL_B_CHORD_MS = 1e3;
5490
5588
  function installFabricShellHangKeys(context, options) {
5491
5589
  if (context.mode !== "tui" || typeof context.ui.onTerminalInput !== "function") return () => {
5492
5590
  };
5591
+ const stopMonitors = installFabricEscapeHalt(context, {
5592
+ enabled: options.enabled,
5593
+ ownsInput: options.ownsInput,
5594
+ halted: () => false,
5595
+ halt: () => {
5596
+ let count = 0;
5597
+ for (const job of options.jobs()?.live() ?? []) if (job.options.monitor && job.stop("Main interrupted")) count++;
5598
+ return count;
5599
+ }
5600
+ });
5493
5601
  let chordArmedAt = 0;
5494
5602
  const unsubscribe = context.ui.onTerminalInput((data) => {
5495
5603
  if (options.ownsInput() || !options.enabled()) {
@@ -5530,7 +5638,10 @@ function installFabricShellHangKeys(context, options) {
5530
5638
  }
5531
5639
  return void 0;
5532
5640
  });
5533
- return unsubscribe;
5641
+ return () => {
5642
+ stopMonitors();
5643
+ unsubscribe();
5644
+ };
5534
5645
  }
5535
5646
 
5536
5647
  // src/ui/tool-display.ts