@linghun/tui 0.1.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.
- package/LICENSE +190 -0
- package/dist/agent-completion-finalizer.d.ts +31 -0
- package/dist/agent-completion-finalizer.d.ts.map +1 -0
- package/dist/agent-completion-finalizer.js +20 -0
- package/dist/agent-handoff-safety.d.ts +13 -0
- package/dist/agent-handoff-safety.d.ts.map +1 -0
- package/dist/agent-handoff-safety.js +43 -0
- package/dist/agent-workflow-registry.d.ts +45 -0
- package/dist/agent-workflow-registry.d.ts.map +1 -0
- package/dist/agent-workflow-registry.js +12 -0
- package/dist/architecture-boundary.d.ts +151 -0
- package/dist/architecture-boundary.d.ts.map +1 -0
- package/dist/architecture-boundary.js +24 -0
- package/dist/architecture-runtime.d.ts +56 -0
- package/dist/architecture-runtime.d.ts.map +1 -0
- package/dist/architecture-runtime.js +18 -0
- package/dist/background-control-runtime.d.ts +29 -0
- package/dist/background-control-runtime.d.ts.map +1 -0
- package/dist/background-control-runtime.js +148 -0
- package/dist/bash-subcommand-parser.d.ts +34 -0
- package/dist/bash-subcommand-parser.d.ts.map +1 -0
- package/dist/bash-subcommand-parser.js +8 -0
- package/dist/batch-tool-confirmation.d.ts +18 -0
- package/dist/batch-tool-confirmation.d.ts.map +1 -0
- package/dist/batch-tool-confirmation.js +100 -0
- package/dist/break-cache-runtime.d.ts +40 -0
- package/dist/break-cache-runtime.d.ts.map +1 -0
- package/dist/break-cache-runtime.js +17 -0
- package/dist/btw-runtime.d.ts +45 -0
- package/dist/btw-runtime.d.ts.map +1 -0
- package/dist/btw-runtime.js +14 -0
- package/dist/cache-command-runtime.d.ts +22 -0
- package/dist/cache-command-runtime.d.ts.map +1 -0
- package/dist/cache-command-runtime.js +33 -0
- package/dist/cache-freshness.d.ts +26 -0
- package/dist/cache-freshness.d.ts.map +1 -0
- package/dist/cache-freshness.js +14 -0
- package/dist/capability-runtime.d.ts +75 -0
- package/dist/capability-runtime.d.ts.map +1 -0
- package/dist/capability-runtime.js +97 -0
- package/dist/chunk-2FVEKTKN.js +86 -0
- package/dist/chunk-2YL5VKJ5.js +531 -0
- package/dist/chunk-3AKXDMVS.js +85 -0
- package/dist/chunk-3GCIXKCI.js +221 -0
- package/dist/chunk-3LT6OWQ2.js +258 -0
- package/dist/chunk-3XNUDLOM.js +91 -0
- package/dist/chunk-4EIC5BCT.js +475 -0
- package/dist/chunk-4EP3TUFF.js +238 -0
- package/dist/chunk-4I2NWBOM.js +117 -0
- package/dist/chunk-4K6UB524.js +443 -0
- package/dist/chunk-4T5DJW54.js +88 -0
- package/dist/chunk-4WHZ6JKD.js +8105 -0
- package/dist/chunk-5H7RRF7C.js +6 -0
- package/dist/chunk-64MJP6FK.js +558 -0
- package/dist/chunk-66BNE332.js +1617 -0
- package/dist/chunk-6CI6TKLN.js +50 -0
- package/dist/chunk-6RJVTUWI.js +16 -0
- package/dist/chunk-6SMM5CMP.js +100 -0
- package/dist/chunk-6USL33ZO.js +289 -0
- package/dist/chunk-7ZE5JFAZ.js +760 -0
- package/dist/chunk-AKPXMCVF.js +1373 -0
- package/dist/chunk-AO4CXI37.js +284 -0
- package/dist/chunk-APJIC2O5.js +150 -0
- package/dist/chunk-B4GQTZMT.js +607 -0
- package/dist/chunk-BFVPLGAC.js +93 -0
- package/dist/chunk-BOV4K7FP.js +588 -0
- package/dist/chunk-CFMSB6ST.js +59 -0
- package/dist/chunk-CFXB5SE5.js +502 -0
- package/dist/chunk-CRQORMFF.js +32 -0
- package/dist/chunk-CRSLDQOA.js +146 -0
- package/dist/chunk-CRW3636S.js +214 -0
- package/dist/chunk-D3UTL2QX.js +86 -0
- package/dist/chunk-D7TCSOAZ.js +331 -0
- package/dist/chunk-DDXS2RDZ.js +228 -0
- package/dist/chunk-DICVLZHH.js +144 -0
- package/dist/chunk-DNQN74CC.js +1186 -0
- package/dist/chunk-DTK5NBTV.js +912 -0
- package/dist/chunk-E72U7WW7.js +50 -0
- package/dist/chunk-EBACIBJP.js +356 -0
- package/dist/chunk-ECFLCY5V.js +530 -0
- package/dist/chunk-EORRZP3F.js +109 -0
- package/dist/chunk-F43AMWLZ.js +115 -0
- package/dist/chunk-F46N43MG.js +56 -0
- package/dist/chunk-F6TVBCZV.js +51 -0
- package/dist/chunk-FRIMDSRU.js +242 -0
- package/dist/chunk-FTAEPAVY.js +314 -0
- package/dist/chunk-GC55DMZV.js +156 -0
- package/dist/chunk-GCMH5P4W.js +422 -0
- package/dist/chunk-GDQQNPBP.js +251 -0
- package/dist/chunk-GKZYTPN2.js +279 -0
- package/dist/chunk-GLWTWEGX.js +272 -0
- package/dist/chunk-GMUCSNUD.js +586 -0
- package/dist/chunk-GTP2KPLY.js +167 -0
- package/dist/chunk-GW5YDCRZ.js +42 -0
- package/dist/chunk-H3T4EF5F.js +87 -0
- package/dist/chunk-HAEU6OTS.js +381 -0
- package/dist/chunk-HQIJGQYU.js +172 -0
- package/dist/chunk-HW2TBXVK.js +34 -0
- package/dist/chunk-HWD22O6F.js +94 -0
- package/dist/chunk-I3NTAIMF.js +280 -0
- package/dist/chunk-IN42UISW.js +372 -0
- package/dist/chunk-IWUIOLMF.js +82 -0
- package/dist/chunk-J7ZE2JKP.js +283 -0
- package/dist/chunk-JBLVBO3U.js +109 -0
- package/dist/chunk-JDWXC2OQ.js +800 -0
- package/dist/chunk-JGDIO2NF.js +74 -0
- package/dist/chunk-JHGWGH2C.js +182 -0
- package/dist/chunk-JLCPHVBN.js +42 -0
- package/dist/chunk-JO5ANTMR.js +6027 -0
- package/dist/chunk-JPXSFZFC.js +100 -0
- package/dist/chunk-JQCRCDOC.js +1195 -0
- package/dist/chunk-K4FSYBSY.js +41 -0
- package/dist/chunk-K56D3X7S.js +1225 -0
- package/dist/chunk-KI7C6ZOD.js +92 -0
- package/dist/chunk-KO64OFSG.js +58 -0
- package/dist/chunk-KQJHVJZB.js +227 -0
- package/dist/chunk-KTWV5JC5.js +59 -0
- package/dist/chunk-L4XXW6Y5.js +374 -0
- package/dist/chunk-L5GOCMZP.js +18 -0
- package/dist/chunk-LDABZV5V.js +278 -0
- package/dist/chunk-LHHKPGLX.js +903 -0
- package/dist/chunk-LL7LBRDL.js +60 -0
- package/dist/chunk-LQTVYUT3.js +421 -0
- package/dist/chunk-LVIM2PA7.js +663 -0
- package/dist/chunk-M4AIK2SP.js +215 -0
- package/dist/chunk-MLUIOBKL.js +420 -0
- package/dist/chunk-MOJL4X4L.js +47 -0
- package/dist/chunk-MVONSJEN.js +300 -0
- package/dist/chunk-N7G2X2LK.js +709 -0
- package/dist/chunk-NKFKOEYX.js +146 -0
- package/dist/chunk-NMNOAFFT.js +167 -0
- package/dist/chunk-NSIKYD3X.js +74 -0
- package/dist/chunk-O7EFPSMC.js +60 -0
- package/dist/chunk-O7S3HYE6.js +210 -0
- package/dist/chunk-OEYW3JE3.js +262 -0
- package/dist/chunk-OF3K3CU5.js +159 -0
- package/dist/chunk-OMZYPQVA.js +298 -0
- package/dist/chunk-OZMX3E35.js +248 -0
- package/dist/chunk-P277M7Z5.js +303 -0
- package/dist/chunk-P4CPRJLI.js +65 -0
- package/dist/chunk-PBIPV4LD.js +494 -0
- package/dist/chunk-PGNALDEH.js +2003 -0
- package/dist/chunk-PGWW3DVE.js +157 -0
- package/dist/chunk-QB4VWH7W.js +515 -0
- package/dist/chunk-QBCGAIU7.js +120 -0
- package/dist/chunk-QIU3FJPC.js +99 -0
- package/dist/chunk-QLRTQHTR.js +744 -0
- package/dist/chunk-QTDGRZMZ.js +171 -0
- package/dist/chunk-RBOQJFIZ.js +183 -0
- package/dist/chunk-RDGM4RUE.js +178 -0
- package/dist/chunk-RM5JDRCW.js +71 -0
- package/dist/chunk-RM5QMOFY.js +189 -0
- package/dist/chunk-RMLTVKOY.js +588 -0
- package/dist/chunk-RVY34HK4.js +79 -0
- package/dist/chunk-S3YWTBXL.js +43 -0
- package/dist/chunk-SJOS5PM6.js +64 -0
- package/dist/chunk-SOPYWTFV.js +90 -0
- package/dist/chunk-SQIBPLLV.js +15 -0
- package/dist/chunk-SRZIA6B4.js +136 -0
- package/dist/chunk-SYBNJZEL.js +250 -0
- package/dist/chunk-TFZEFIQT.js +17 -0
- package/dist/chunk-THZBFYAH.js +136 -0
- package/dist/chunk-TJLC3QAS.js +83 -0
- package/dist/chunk-TYF4GJR3.js +598 -0
- package/dist/chunk-UDQT5CWK.js +252 -0
- package/dist/chunk-UOHZQIVL.js +168 -0
- package/dist/chunk-URNQUECO.js +187 -0
- package/dist/chunk-UT2TYK2A.js +148 -0
- package/dist/chunk-UT5BOJKU.js +190 -0
- package/dist/chunk-V7GDHHBL.js +526 -0
- package/dist/chunk-VCSRBS47.js +133 -0
- package/dist/chunk-VIBENDE3.js +152 -0
- package/dist/chunk-VTQL23UM.js +302 -0
- package/dist/chunk-W3KHJNSH.js +281 -0
- package/dist/chunk-W6NU7ZAV.js +52 -0
- package/dist/chunk-WHFDDZHY.js +407 -0
- package/dist/chunk-WJWYRBWH.js +48 -0
- package/dist/chunk-WKMBK5UP.js +145 -0
- package/dist/chunk-WQMSRO4D.js +489 -0
- package/dist/chunk-WV6YJGZR.js +81 -0
- package/dist/chunk-WVAQYKGL.js +269 -0
- package/dist/chunk-X7A22JHP.js +106 -0
- package/dist/chunk-XFPNU42I.js +59 -0
- package/dist/chunk-YH6UIHNF.js +161 -0
- package/dist/chunk-YPQFSFYK.js +19 -0
- package/dist/chunk-YTQFOZRZ.js +110 -0
- package/dist/chunk-ZJK25VFP.js +506 -0
- package/dist/chunk-ZOSK2UEU.js +1555 -0
- package/dist/chunk-ZYSN7AWW.js +336 -0
- package/dist/chunk-ZZ2CNCXJ.js +282 -0
- package/dist/command-panel-runtime.d.ts +33 -0
- package/dist/command-panel-runtime.d.ts.map +1 -0
- package/dist/command-panel-runtime.js +80 -0
- package/dist/compact-cache-command-runtime.d.ts +38 -0
- package/dist/compact-cache-command-runtime.d.ts.map +1 -0
- package/dist/compact-cache-command-runtime.js +146 -0
- package/dist/compact-context.d.ts +35 -0
- package/dist/compact-context.d.ts.map +1 -0
- package/dist/compact-context.js +16 -0
- package/dist/compact-preflight-runtime.d.ts +46 -0
- package/dist/compact-preflight-runtime.d.ts.map +1 -0
- package/dist/compact-preflight-runtime.js +62 -0
- package/dist/connector-runtime.d.ts +72 -0
- package/dist/connector-runtime.d.ts.map +1 -0
- package/dist/connector-runtime.js +88 -0
- package/dist/context-estimator.d.ts +20 -0
- package/dist/context-estimator.d.ts.map +1 -0
- package/dist/context-estimator.js +18 -0
- package/dist/context-window-runtime.d.ts +12 -0
- package/dist/context-window-runtime.d.ts.map +1 -0
- package/dist/context-window-runtime.js +10 -0
- package/dist/deep-compact-runtime.d.ts +53 -0
- package/dist/deep-compact-runtime.d.ts.map +1 -0
- package/dist/deep-compact-runtime.js +35 -0
- package/dist/deferred-tools-catalog.d.ts +52 -0
- package/dist/deferred-tools-catalog.d.ts.map +1 -0
- package/dist/deferred-tools-catalog.js +42 -0
- package/dist/details-status-runtime.d.ts +48 -0
- package/dist/details-status-runtime.d.ts.map +1 -0
- package/dist/details-status-runtime.js +102 -0
- package/dist/evidence-runtime.d.ts +48 -0
- package/dist/evidence-runtime.d.ts.map +1 -0
- package/dist/evidence-runtime.js +92 -0
- package/dist/extension-command-runtime.d.ts +63 -0
- package/dist/extension-command-runtime.d.ts.map +1 -0
- package/dist/extension-command-runtime.js +67 -0
- package/dist/extension-slash-runtime.d.ts +11 -0
- package/dist/extension-slash-runtime.d.ts.map +1 -0
- package/dist/extension-slash-runtime.js +79 -0
- package/dist/external-editor-runtime.d.ts +32 -0
- package/dist/external-editor-runtime.d.ts.map +1 -0
- package/dist/external-editor-runtime.js +71 -0
- package/dist/failure-learning-command-runtime.d.ts +10 -0
- package/dist/failure-learning-command-runtime.d.ts.map +1 -0
- package/dist/failure-learning-command-runtime.js +78 -0
- package/dist/failure-learning-presenter.d.ts +6 -0
- package/dist/failure-learning-presenter.d.ts.map +1 -0
- package/dist/failure-learning-presenter.js +12 -0
- package/dist/failure-learning-runtime.d.ts +39 -0
- package/dist/failure-learning-runtime.d.ts.map +1 -0
- package/dist/failure-learning-runtime.js +39 -0
- package/dist/feature-flag-runtime.d.ts +8 -0
- package/dist/feature-flag-runtime.d.ts.map +1 -0
- package/dist/feature-flag-runtime.js +12 -0
- package/dist/feishu-long-connection-runtime.d.ts +12 -0
- package/dist/feishu-long-connection-runtime.d.ts.map +1 -0
- package/dist/feishu-long-connection-runtime.js +7 -0
- package/dist/final-answer-gate.d.ts +24 -0
- package/dist/final-answer-gate.d.ts.map +1 -0
- package/dist/final-answer-gate.js +26 -0
- package/dist/ghost-text.d.ts +16 -0
- package/dist/ghost-text.d.ts.map +1 -0
- package/dist/ghost-text.js +8 -0
- package/dist/git-branch-runtime.d.ts +14 -0
- package/dist/git-branch-runtime.d.ts.map +1 -0
- package/dist/git-branch-runtime.js +68 -0
- package/dist/git-command-runtime.d.ts +22 -0
- package/dist/git-command-runtime.d.ts.map +1 -0
- package/dist/git-command-runtime.js +89 -0
- package/dist/git-operation-runtime.d.ts +188 -0
- package/dist/git-operation-runtime.d.ts.map +1 -0
- package/dist/git-operation-runtime.js +45 -0
- package/dist/git-runtime.d.ts +113 -0
- package/dist/git-runtime.d.ts.map +1 -0
- package/dist/git-runtime.js +16 -0
- package/dist/git-slash-runtime.d.ts +38 -0
- package/dist/git-slash-runtime.d.ts.map +1 -0
- package/dist/git-slash-runtime.js +18 -0
- package/dist/git-tool-dispatch-runtime.d.ts +108 -0
- package/dist/git-tool-dispatch-runtime.d.ts.map +1 -0
- package/dist/git-tool-dispatch-runtime.js +25 -0
- package/dist/git-tool-runtime.d.ts +64 -0
- package/dist/git-tool-runtime.d.ts.map +1 -0
- package/dist/git-tool-runtime.js +36 -0
- package/dist/guard-wiring.d.ts +67 -0
- package/dist/guard-wiring.d.ts.map +1 -0
- package/dist/guard-wiring.js +21 -0
- package/dist/handoff-session-runtime.d.ts +11 -0
- package/dist/handoff-session-runtime.d.ts.map +1 -0
- package/dist/handoff-session-runtime.js +36 -0
- package/dist/index-result-presenter.d.ts +14 -0
- package/dist/index-result-presenter.d.ts.map +1 -0
- package/dist/index-result-presenter.js +28 -0
- package/dist/index-runtime.d.ts +64 -0
- package/dist/index-runtime.d.ts.map +1 -0
- package/dist/index-runtime.js +28 -0
- package/dist/index-tool-runtime.d.ts +44 -0
- package/dist/index-tool-runtime.d.ts.map +1 -0
- package/dist/index-tool-runtime.js +24 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2346 -0
- package/dist/job-agent-command-runtime.d.ts +127 -0
- package/dist/job-agent-command-runtime.d.ts.map +1 -0
- package/dist/job-agent-command-runtime.js +138 -0
- package/dist/job-runner-presenter.d.ts +32 -0
- package/dist/job-runner-presenter.d.ts.map +1 -0
- package/dist/job-runner-presenter.js +30 -0
- package/dist/job-runtime.d.ts +65 -0
- package/dist/job-runtime.d.ts.map +1 -0
- package/dist/job-runtime.js +88 -0
- package/dist/keybinding-runtime.d.ts +29 -0
- package/dist/keybinding-runtime.d.ts.map +1 -0
- package/dist/keybinding-runtime.js +14 -0
- package/dist/log-artifact.d.ts +55 -0
- package/dist/log-artifact.d.ts.map +1 -0
- package/dist/log-artifact.js +10 -0
- package/dist/mcp-index-command-runtime.d.ts +21 -0
- package/dist/mcp-index-command-runtime.d.ts.map +1 -0
- package/dist/mcp-index-command-runtime.js +18 -0
- package/dist/mcp-index-runtime.d.ts +106 -0
- package/dist/mcp-index-runtime.d.ts.map +1 -0
- package/dist/mcp-index-runtime.js +142 -0
- package/dist/mcp-sse-runtime.d.ts +13 -0
- package/dist/mcp-sse-runtime.d.ts.map +1 -0
- package/dist/mcp-sse-runtime.js +8 -0
- package/dist/mcp-stdio-runtime.d.ts +37 -0
- package/dist/mcp-stdio-runtime.d.ts.map +1 -0
- package/dist/mcp-stdio-runtime.js +15 -0
- package/dist/memory-command-runtime.d.ts +37 -0
- package/dist/memory-command-runtime.d.ts.map +1 -0
- package/dist/memory-command-runtime.js +88 -0
- package/dist/memory-eviction-runtime.d.ts +7 -0
- package/dist/memory-eviction-runtime.d.ts.map +1 -0
- package/dist/memory-eviction-runtime.js +12 -0
- package/dist/memory-extraction-runtime.d.ts +40 -0
- package/dist/memory-extraction-runtime.d.ts.map +1 -0
- package/dist/memory-extraction-runtime.js +20 -0
- package/dist/memory-rules-runtime.d.ts +15 -0
- package/dist/memory-rules-runtime.d.ts.map +1 -0
- package/dist/memory-rules-runtime.js +14 -0
- package/dist/meta-scheduler-complexity.d.ts +16 -0
- package/dist/meta-scheduler-complexity.d.ts.map +1 -0
- package/dist/meta-scheduler-complexity.js +37 -0
- package/dist/meta-scheduler-runtime.d.ts +288 -0
- package/dist/meta-scheduler-runtime.d.ts.map +1 -0
- package/dist/meta-scheduler-runtime.js +17 -0
- package/dist/model-command-runtime.d.ts +12 -0
- package/dist/model-command-runtime.d.ts.map +1 -0
- package/dist/model-command-runtime.js +84 -0
- package/dist/model-doctor-runtime.d.ts +81 -0
- package/dist/model-doctor-runtime.d.ts.map +1 -0
- package/dist/model-doctor-runtime.js +46 -0
- package/dist/model-loop-runtime.d.ts +189 -0
- package/dist/model-loop-runtime.d.ts.map +1 -0
- package/dist/model-loop-runtime.js +141 -0
- package/dist/model-prompt-runtime.d.ts +25 -0
- package/dist/model-prompt-runtime.d.ts.map +1 -0
- package/dist/model-prompt-runtime.js +33 -0
- package/dist/model-setup-runtime.d.ts +28 -0
- package/dist/model-setup-runtime.d.ts.map +1 -0
- package/dist/model-setup-runtime.js +26 -0
- package/dist/model-stream-runtime.d.ts +47 -0
- package/dist/model-stream-runtime.d.ts.map +1 -0
- package/dist/model-stream-runtime.js +136 -0
- package/dist/model-tool-runtime.d.ts +114 -0
- package/dist/model-tool-runtime.d.ts.map +1 -0
- package/dist/model-tool-runtime.js +144 -0
- package/dist/natural-command-bridge.d.ts +158 -0
- package/dist/natural-command-bridge.d.ts.map +1 -0
- package/dist/natural-command-bridge.js +36 -0
- package/dist/pending-details-presenter.d.ts +8 -0
- package/dist/pending-details-presenter.d.ts.map +1 -0
- package/dist/pending-details-presenter.js +12 -0
- package/dist/permission-approval-runtime.d.ts +28 -0
- package/dist/permission-approval-runtime.d.ts.map +1 -0
- package/dist/permission-approval-runtime.js +136 -0
- package/dist/permission-continuation-runtime.d.ts +90 -0
- package/dist/permission-continuation-runtime.d.ts.map +1 -0
- package/dist/permission-continuation-runtime.js +68 -0
- package/dist/permission-policy-engine.d.ts +51 -0
- package/dist/permission-policy-engine.d.ts.map +1 -0
- package/dist/permission-policy-engine.js +12 -0
- package/dist/permission-presenter.d.ts +13 -0
- package/dist/permission-presenter.d.ts.map +1 -0
- package/dist/permission-presenter.js +8 -0
- package/dist/persistent-history.d.ts +18 -0
- package/dist/persistent-history.d.ts.map +1 -0
- package/dist/persistent-history.js +126 -0
- package/dist/platform-security.d.ts +4 -0
- package/dist/platform-security.d.ts.map +1 -0
- package/dist/platform-security.js +10 -0
- package/dist/process-command-runtime.d.ts +9 -0
- package/dist/process-command-runtime.d.ts.map +1 -0
- package/dist/process-command-runtime.js +11 -0
- package/dist/process-guard.d.ts +56 -0
- package/dist/process-guard.d.ts.map +1 -0
- package/dist/process-guard.js +22 -0
- package/dist/prompt-command-runtime.d.ts +12 -0
- package/dist/prompt-command-runtime.d.ts.map +1 -0
- package/dist/prompt-command-runtime.js +10 -0
- package/dist/prompt-stash.d.ts +15 -0
- package/dist/prompt-stash.d.ts.map +1 -0
- package/dist/prompt-stash.js +8 -0
- package/dist/provider-circuit-breaker.d.ts +132 -0
- package/dist/provider-circuit-breaker.d.ts.map +1 -0
- package/dist/provider-circuit-breaker.js +31 -0
- package/dist/provider-loop-runtime.d.ts +18 -0
- package/dist/provider-loop-runtime.d.ts.map +1 -0
- package/dist/provider-loop-runtime.js +16 -0
- package/dist/remote-command-runtime.d.ts +47 -0
- package/dist/remote-command-runtime.d.ts.map +1 -0
- package/dist/remote-command-runtime.js +125 -0
- package/dist/remote-inbound-bridge-runtime.d.ts +152 -0
- package/dist/remote-inbound-bridge-runtime.d.ts.map +1 -0
- package/dist/remote-inbound-bridge-runtime.js +44 -0
- package/dist/remote-mcp-presenter.d.ts +5 -0
- package/dist/remote-mcp-presenter.d.ts.map +1 -0
- package/dist/remote-mcp-presenter.js +10 -0
- package/dist/remote-repl-bridge-runtime.d.ts +134 -0
- package/dist/remote-repl-bridge-runtime.d.ts.map +1 -0
- package/dist/remote-repl-bridge-runtime.js +20 -0
- package/dist/remote-transport.d.ts +50 -0
- package/dist/remote-transport.d.ts.map +1 -0
- package/dist/remote-transport.js +14 -0
- package/dist/request-lifecycle-presenter.d.ts +25 -0
- package/dist/request-lifecycle-presenter.d.ts.map +1 -0
- package/dist/request-lifecycle-presenter.js +22 -0
- package/dist/runner-runtime.d.ts +41 -0
- package/dist/runner-runtime.d.ts.map +1 -0
- package/dist/runner-runtime.js +35 -0
- package/dist/runtime-budget.d.ts +38 -0
- package/dist/runtime-budget.d.ts.map +1 -0
- package/dist/runtime-budget.js +78 -0
- package/dist/runtime-path-marker.d.ts +112 -0
- package/dist/runtime-path-marker.d.ts.map +1 -0
- package/dist/runtime-path-marker.js +18 -0
- package/dist/runtime-status-presenter.d.ts +22 -0
- package/dist/runtime-status-presenter.d.ts.map +1 -0
- package/dist/runtime-status-presenter.js +15 -0
- package/dist/runtime-status-snapshot.d.ts +52 -0
- package/dist/runtime-status-snapshot.d.ts.map +1 -0
- package/dist/runtime-status-snapshot.js +11 -0
- package/dist/runtime-utils.d.ts +2 -0
- package/dist/runtime-utils.d.ts.map +1 -0
- package/dist/runtime-utils.js +6 -0
- package/dist/shell/clipboard.d.ts +23 -0
- package/dist/shell/clipboard.d.ts.map +1 -0
- package/dist/shell/clipboard.js +8 -0
- package/dist/shell/components/AgentProgressTree.d.ts +9 -0
- package/dist/shell/components/AgentProgressTree.d.ts.map +1 -0
- package/dist/shell/components/AgentProgressTree.js +9 -0
- package/dist/shell/components/BackgroundTaskOverlay.d.ts +8 -0
- package/dist/shell/components/BackgroundTaskOverlay.d.ts.map +1 -0
- package/dist/shell/components/BackgroundTaskOverlay.js +8 -0
- package/dist/shell/components/BtwPanel.d.ts +16 -0
- package/dist/shell/components/BtwPanel.d.ts.map +1 -0
- package/dist/shell/components/BtwPanel.js +8 -0
- package/dist/shell/components/CommandPanel.d.ts +11 -0
- package/dist/shell/components/CommandPanel.d.ts.map +1 -0
- package/dist/shell/components/CommandPanel.js +8 -0
- package/dist/shell/components/Composer.d.ts +187 -0
- package/dist/shell/components/Composer.d.ts.map +1 -0
- package/dist/shell/components/Composer.js +99 -0
- package/dist/shell/components/ConfigPanel.d.ts +11 -0
- package/dist/shell/components/ConfigPanel.d.ts.map +1 -0
- package/dist/shell/components/ConfigPanel.js +8 -0
- package/dist/shell/components/CtrlOToExpand.d.ts +30 -0
- package/dist/shell/components/CtrlOToExpand.d.ts.map +1 -0
- package/dist/shell/components/CtrlOToExpand.js +16 -0
- package/dist/shell/components/HelpPanel.d.ts +19 -0
- package/dist/shell/components/HelpPanel.d.ts.map +1 -0
- package/dist/shell/components/HelpPanel.js +8 -0
- package/dist/shell/components/HistorySearchPanel.d.ts +14 -0
- package/dist/shell/components/HistorySearchPanel.d.ts.map +1 -0
- package/dist/shell/components/HistorySearchPanel.js +104 -0
- package/dist/shell/components/MessageMarkdown.d.ts +34 -0
- package/dist/shell/components/MessageMarkdown.d.ts.map +1 -0
- package/dist/shell/components/MessageMarkdown.js +18 -0
- package/dist/shell/components/MessageResponse.d.ts +14 -0
- package/dist/shell/components/MessageResponse.d.ts.map +1 -0
- package/dist/shell/components/MessageResponse.js +6 -0
- package/dist/shell/components/MouseInputRouter.d.ts +28 -0
- package/dist/shell/components/MouseInputRouter.d.ts.map +1 -0
- package/dist/shell/components/MouseInputRouter.js +84 -0
- package/dist/shell/components/NotificationStack.d.ts +19 -0
- package/dist/shell/components/NotificationStack.d.ts.map +1 -0
- package/dist/shell/components/NotificationStack.js +6 -0
- package/dist/shell/components/OutputLine.d.ts +19 -0
- package/dist/shell/components/OutputLine.d.ts.map +1 -0
- package/dist/shell/components/OutputLine.js +38 -0
- package/dist/shell/components/ProductBlock.d.ts +10 -0
- package/dist/shell/components/ProductBlock.d.ts.map +1 -0
- package/dist/shell/components/ProductBlock.js +12 -0
- package/dist/shell/components/ScrollViewport.d.ts +43 -0
- package/dist/shell/components/ScrollViewport.d.ts.map +1 -0
- package/dist/shell/components/ScrollViewport.js +86 -0
- package/dist/shell/components/SessionsPanel.d.ts +24 -0
- package/dist/shell/components/SessionsPanel.d.ts.map +1 -0
- package/dist/shell/components/SessionsPanel.js +8 -0
- package/dist/shell/components/ShellApp.d.ts +8 -0
- package/dist/shell/components/ShellApp.d.ts.map +1 -0
- package/dist/shell/components/ShellApp.js +45 -0
- package/dist/shell/components/ShortcutPanel.d.ts +14 -0
- package/dist/shell/components/ShortcutPanel.d.ts.map +1 -0
- package/dist/shell/components/ShortcutPanel.js +59 -0
- package/dist/shell/components/SlashSuggestions.d.ts +24 -0
- package/dist/shell/components/SlashSuggestions.d.ts.map +1 -0
- package/dist/shell/components/SlashSuggestions.js +7 -0
- package/dist/shell/components/StatusFooter.d.ts +30 -0
- package/dist/shell/components/StatusFooter.d.ts.map +1 -0
- package/dist/shell/components/StatusFooter.js +7 -0
- package/dist/shell/components/StatusTray.d.ts +9 -0
- package/dist/shell/components/StatusTray.d.ts.map +1 -0
- package/dist/shell/components/StatusTray.js +6 -0
- package/dist/shell/components/StructuredDiff.d.ts +9 -0
- package/dist/shell/components/StructuredDiff.d.ts.map +1 -0
- package/dist/shell/components/StructuredDiff.js +7 -0
- package/dist/shell/components/TaskListView.d.ts +9 -0
- package/dist/shell/components/TaskListView.d.ts.map +1 -0
- package/dist/shell/components/TaskListView.js +9 -0
- package/dist/shell/components/TaskSuggestionBar.d.ts +15 -0
- package/dist/shell/components/TaskSuggestionBar.d.ts.map +1 -0
- package/dist/shell/components/TaskSuggestionBar.js +8 -0
- package/dist/shell/components/UnseenMessagePill.d.ts +12 -0
- package/dist/shell/components/UnseenMessagePill.d.ts.map +1 -0
- package/dist/shell/components/UnseenMessagePill.js +6 -0
- package/dist/shell/components/WorkflowProgressView.d.ts +9 -0
- package/dist/shell/components/WorkflowProgressView.d.ts.map +1 -0
- package/dist/shell/components/WorkflowProgressView.js +9 -0
- package/dist/shell/components/useAnchoredCursor.d.ts +32 -0
- package/dist/shell/components/useAnchoredCursor.d.ts.map +1 -0
- package/dist/shell/components/useAnchoredCursor.js +6 -0
- package/dist/shell/hooks/useRenderThrottle.d.ts +2 -0
- package/dist/shell/hooks/useRenderThrottle.d.ts.map +1 -0
- package/dist/shell/hooks/useRenderThrottle.js +35 -0
- package/dist/shell/hooks/useScrollBatcher.d.ts +10 -0
- package/dist/shell/hooks/useScrollBatcher.d.ts.map +1 -0
- package/dist/shell/hooks/useScrollBatcher.js +23 -0
- package/dist/shell/hooks/useScrollRuntime.d.ts +2 -0
- package/dist/shell/hooks/useScrollRuntime.d.ts.map +1 -0
- package/dist/shell/hooks/useScrollRuntime.js +6 -0
- package/dist/shell/hyperlink-utils.d.ts +18 -0
- package/dist/shell/hyperlink-utils.d.ts.map +1 -0
- package/dist/shell/hyperlink-utils.js +8 -0
- package/dist/shell/ink-renderer.d.ts +18 -0
- package/dist/shell/ink-renderer.d.ts.map +1 -0
- package/dist/shell/ink-renderer.js +54 -0
- package/dist/shell/models/command-transcript-presenter.d.ts +73 -0
- package/dist/shell/models/command-transcript-presenter.d.ts.map +1 -0
- package/dist/shell/models/command-transcript-presenter.js +26 -0
- package/dist/shell/models/help-panel.d.ts +37 -0
- package/dist/shell/models/help-panel.d.ts.map +1 -0
- package/dist/shell/models/help-panel.js +10 -0
- package/dist/shell/models/permission-elevation.d.ts +65 -0
- package/dist/shell/models/permission-elevation.d.ts.map +1 -0
- package/dist/shell/models/permission-elevation.js +10 -0
- package/dist/shell/models/permission-explanation.d.ts +45 -0
- package/dist/shell/models/permission-explanation.d.ts.map +1 -0
- package/dist/shell/models/permission-explanation.js +14 -0
- package/dist/shell/models/session-panel.d.ts +22 -0
- package/dist/shell/models/session-panel.d.ts.map +1 -0
- package/dist/shell/models/session-panel.js +18 -0
- package/dist/shell/models/task-scroll-state.d.ts +24 -0
- package/dist/shell/models/task-scroll-state.d.ts.map +1 -0
- package/dist/shell/models/task-scroll-state.js +26 -0
- package/dist/shell/models/terminal-input-runtime.d.ts +37 -0
- package/dist/shell/models/terminal-input-runtime.d.ts.map +1 -0
- package/dist/shell/models/terminal-input-runtime.js +18 -0
- package/dist/shell/models/transcript-scroll-state.d.ts +57 -0
- package/dist/shell/models/transcript-scroll-state.d.ts.map +1 -0
- package/dist/shell/models/transcript-scroll-state.js +12 -0
- package/dist/shell/models/transcript-selection-state.d.ts +39 -0
- package/dist/shell/models/transcript-selection-state.d.ts.map +1 -0
- package/dist/shell/models/transcript-selection-state.js +25 -0
- package/dist/shell/models/wheel-acceleration.d.ts +52 -0
- package/dist/shell/models/wheel-acceleration.d.ts.map +1 -0
- package/dist/shell/models/wheel-acceleration.js +6 -0
- package/dist/shell/output-utils.d.ts +22 -0
- package/dist/shell/output-utils.d.ts.map +1 -0
- package/dist/shell/output-utils.js +12 -0
- package/dist/shell/plain-renderer.d.ts +12 -0
- package/dist/shell/plain-renderer.d.ts.map +1 -0
- package/dist/shell/plain-renderer.js +13 -0
- package/dist/shell/progress-views.d.ts +10 -0
- package/dist/shell/progress-views.d.ts.map +1 -0
- package/dist/shell/progress-views.js +17 -0
- package/dist/shell/stdout-flush-barrier.d.ts +39 -0
- package/dist/shell/stdout-flush-barrier.d.ts.map +1 -0
- package/dist/shell/stdout-flush-barrier.js +10 -0
- package/dist/shell/terminal-capability.d.ts +54 -0
- package/dist/shell/terminal-capability.d.ts.map +1 -0
- package/dist/shell/terminal-capability.js +10 -0
- package/dist/shell/terminal-interaction-runtime.d.ts +11 -0
- package/dist/shell/terminal-interaction-runtime.d.ts.map +1 -0
- package/dist/shell/terminal-interaction-runtime.js +38 -0
- package/dist/shell/terminal-state-recovery.d.ts +52 -0
- package/dist/shell/terminal-state-recovery.d.ts.map +1 -0
- package/dist/shell/terminal-state-recovery.js +11 -0
- package/dist/shell/text-utils.d.ts +40 -0
- package/dist/shell/text-utils.d.ts.map +1 -0
- package/dist/shell/text-utils.js +26 -0
- package/dist/shell/theme.d.ts +41 -0
- package/dist/shell/theme.d.ts.map +1 -0
- package/dist/shell/theme.js +8 -0
- package/dist/shell/types.d.ts +784 -0
- package/dist/shell/types.d.ts.map +1 -0
- package/dist/shell/types.js +0 -0
- package/dist/shell/view-model.d.ts +82 -0
- package/dist/shell/view-model.d.ts.map +1 -0
- package/dist/shell/view-model.js +48 -0
- package/dist/slash-command-runtime.d.ts +64 -0
- package/dist/slash-command-runtime.d.ts.map +1 -0
- package/dist/slash-command-runtime.js +186 -0
- package/dist/slash-dispatch.d.ts +48 -0
- package/dist/slash-dispatch.d.ts.map +1 -0
- package/dist/slash-dispatch.js +53 -0
- package/dist/startup-runtime.d.ts +48 -0
- package/dist/startup-runtime.d.ts.map +1 -0
- package/dist/startup-runtime.js +43 -0
- package/dist/terminal-readiness-presenter.d.ts +131 -0
- package/dist/terminal-readiness-presenter.d.ts.map +1 -0
- package/dist/terminal-readiness-presenter.js +16 -0
- package/dist/terminal-readiness-runtime.d.ts +5 -0
- package/dist/terminal-readiness-runtime.d.ts.map +1 -0
- package/dist/terminal-readiness-runtime.js +15 -0
- package/dist/terminal-setup-runtime.d.ts +34 -0
- package/dist/terminal-setup-runtime.d.ts.map +1 -0
- package/dist/terminal-setup-runtime.js +257 -0
- package/dist/tool-output-presenter.d.ts +38 -0
- package/dist/tool-output-presenter.d.ts.map +1 -0
- package/dist/tool-output-presenter.js +16 -0
- package/dist/tool-result-budget.d.ts +42 -0
- package/dist/tool-result-budget.d.ts.map +1 -0
- package/dist/tool-result-budget.js +11 -0
- package/dist/tui-agent-job-runtime.d.ts +38 -0
- package/dist/tui-agent-job-runtime.d.ts.map +1 -0
- package/dist/tui-agent-job-runtime.js +86 -0
- package/dist/tui-context-runtime.d.ts +426 -0
- package/dist/tui-context-runtime.d.ts.map +1 -0
- package/dist/tui-context-runtime.js +65 -0
- package/dist/tui-data-types.d.ts +923 -0
- package/dist/tui-data-types.d.ts.map +1 -0
- package/dist/tui-data-types.js +0 -0
- package/dist/tui-details-runtime.d.ts +25 -0
- package/dist/tui-details-runtime.d.ts.map +1 -0
- package/dist/tui-details-runtime.js +29 -0
- package/dist/tui-memory-runtime.d.ts +33 -0
- package/dist/tui-memory-runtime.d.ts.map +1 -0
- package/dist/tui-memory-runtime.js +58 -0
- package/dist/tui-messages.d.ts +4 -0
- package/dist/tui-messages.d.ts.map +1 -0
- package/dist/tui-messages.js +6 -0
- package/dist/tui-model-runtime.d.ts +30 -0
- package/dist/tui-model-runtime.d.ts.map +1 -0
- package/dist/tui-model-runtime.js +39 -0
- package/dist/tui-output-surface.d.ts +141 -0
- package/dist/tui-output-surface.d.ts.map +1 -0
- package/dist/tui-output-surface.js +55 -0
- package/dist/tui-permission-runtime.d.ts +62 -0
- package/dist/tui-permission-runtime.d.ts.map +1 -0
- package/dist/tui-permission-runtime.js +24 -0
- package/dist/tui-state-runtime.d.ts +21 -0
- package/dist/tui-state-runtime.d.ts.map +1 -0
- package/dist/tui-state-runtime.js +47 -0
- package/dist/turn-continuity-runtime.d.ts +30 -0
- package/dist/turn-continuity-runtime.d.ts.map +1 -0
- package/dist/turn-continuity-runtime.js +8 -0
- package/dist/undo-ring.d.ts +16 -0
- package/dist/undo-ring.d.ts.map +1 -0
- package/dist/undo-ring.js +12 -0
- package/dist/usage-stats-presenter.d.ts +17 -0
- package/dist/usage-stats-presenter.d.ts.map +1 -0
- package/dist/usage-stats-presenter.js +22 -0
- package/dist/user-state-signal-runtime.d.ts +33 -0
- package/dist/user-state-signal-runtime.d.ts.map +1 -0
- package/dist/user-state-signal-runtime.js +8 -0
- package/dist/verification-command-runtime.d.ts +25 -0
- package/dist/verification-command-runtime.d.ts.map +1 -0
- package/dist/verification-command-runtime.js +51 -0
- package/dist/verification-level.d.ts +93 -0
- package/dist/verification-level.d.ts.map +1 -0
- package/dist/verification-level.js +18 -0
- package/dist/workflow-agent-runtime-bridge.d.ts +169 -0
- package/dist/workflow-agent-runtime-bridge.d.ts.map +1 -0
- package/dist/workflow-agent-runtime-bridge.js +9 -0
- package/dist/workflow-command-runtime.d.ts +94 -0
- package/dist/workflow-command-runtime.d.ts.map +1 -0
- package/dist/workflow-command-runtime.js +114 -0
- package/dist/workflow-plan-schema.d.ts +161 -0
- package/dist/workflow-plan-schema.d.ts.map +1 -0
- package/dist/workflow-plan-schema.js +12 -0
- package/dist/workflow-planner-entry.d.ts +52 -0
- package/dist/workflow-planner-entry.d.ts.map +1 -0
- package/dist/workflow-planner-entry.js +328 -0
- package/dist/workflow-task-surface.d.ts +39 -0
- package/dist/workflow-task-surface.d.ts.map +1 -0
- package/dist/workflow-task-surface.js +7 -0
- package/dist/workspace-reference-cache.d.ts +110 -0
- package/dist/workspace-reference-cache.d.ts.map +1 -0
- package/dist/workspace-reference-cache.js +12 -0
- package/package.json +41 -0
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatApprovedRunnerSpecLine
|
|
3
|
+
} from "./chunk-B4GQTZMT.js";
|
|
4
|
+
import {
|
|
5
|
+
formatJobNextAction,
|
|
6
|
+
formatJobRunnerInline,
|
|
7
|
+
formatJobRunnerReportLine
|
|
8
|
+
} from "./chunk-UDQT5CWK.js";
|
|
9
|
+
import {
|
|
10
|
+
isRecord
|
|
11
|
+
} from "./chunk-QLRTQHTR.js";
|
|
12
|
+
import {
|
|
13
|
+
formatDisplayPath,
|
|
14
|
+
sanitizeDisplayPaths,
|
|
15
|
+
truncateDisplay
|
|
16
|
+
} from "./chunk-OMZYPQVA.js";
|
|
17
|
+
|
|
18
|
+
// src/job-runtime.ts
|
|
19
|
+
import { createHash } from "crypto";
|
|
20
|
+
import { appendFile as fsAppendFile } from "fs";
|
|
21
|
+
import { mkdir, readFile, readdir, writeFile } from "fs/promises";
|
|
22
|
+
import { dirname, join, resolve } from "path";
|
|
23
|
+
import { promisify } from "util";
|
|
24
|
+
import { resolveStoragePaths } from "@linghun/config";
|
|
25
|
+
var appendFileAsync = promisify(fsAppendFile);
|
|
26
|
+
var DEFAULT_JOB_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
27
|
+
var DEFAULT_JOB_BUDGET_TOKENS = 12e4;
|
|
28
|
+
var JOB_LOG_TAIL_LINES = 40;
|
|
29
|
+
var JOB_RECOVERY_HEARTBEAT_STALE_MS = 2 * 60 * 1e3;
|
|
30
|
+
var DEFAULT_JOB_MAX_STEPS = 4;
|
|
31
|
+
var MAX_JOB_MAX_STEPS = 20;
|
|
32
|
+
var JOB_AGENT_HIGH_CONFIG_CANDIDATE = 8;
|
|
33
|
+
function parseJobRunOptions(args) {
|
|
34
|
+
const goalParts = [];
|
|
35
|
+
let phase = "default";
|
|
36
|
+
let target = "local-durable-jobs";
|
|
37
|
+
let requestedAgents = 1;
|
|
38
|
+
let runningCap;
|
|
39
|
+
let maxTokens = DEFAULT_JOB_BUDGET_TOKENS;
|
|
40
|
+
let maxSteps = DEFAULT_JOB_MAX_STEPS;
|
|
41
|
+
let timeoutMs = DEFAULT_JOB_TIMEOUT_MS;
|
|
42
|
+
let allowEdit = false;
|
|
43
|
+
let allowBash = false;
|
|
44
|
+
let allowMultiAgent = false;
|
|
45
|
+
let isolation;
|
|
46
|
+
const budgetExplicit = { tokens: false, steps: false, runtime: false };
|
|
47
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
48
|
+
const arg = args[index];
|
|
49
|
+
if (!arg) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (arg === "--phase") {
|
|
53
|
+
phase = args[index + 1] ?? phase;
|
|
54
|
+
index += 1;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (arg === "--target") {
|
|
58
|
+
target = args[index + 1] ?? target;
|
|
59
|
+
index += 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (arg === "--agents") {
|
|
63
|
+
requestedAgents = normalizePositiveInt(args[index + 1]) ?? requestedAgents;
|
|
64
|
+
index += 1;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (arg === "--running-cap" || arg === "--runningCap" || arg === "--cap") {
|
|
68
|
+
runningCap = normalizePositiveInt(args[index + 1]) ?? runningCap;
|
|
69
|
+
index += 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (arg === "--tokens") {
|
|
73
|
+
maxTokens = clampPositiveInt(args[index + 1], DEFAULT_JOB_BUDGET_TOKENS, 1e7);
|
|
74
|
+
budgetExplicit.tokens = true;
|
|
75
|
+
index += 1;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (arg === "--max-steps" || arg === "--steps") {
|
|
79
|
+
maxSteps = clampPositiveInt(args[index + 1], DEFAULT_JOB_MAX_STEPS, MAX_JOB_MAX_STEPS);
|
|
80
|
+
budgetExplicit.steps = true;
|
|
81
|
+
index += 1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (arg === "--timeout" || arg === "--max-runtime-ms") {
|
|
85
|
+
timeoutMs = clampPositiveInt(args[index + 1], DEFAULT_JOB_TIMEOUT_MS, 24 * 60 * 60 * 1e3);
|
|
86
|
+
budgetExplicit.runtime = true;
|
|
87
|
+
index += 1;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (arg === "--allow-edit") {
|
|
91
|
+
allowEdit = true;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (arg === "--allow-bash") {
|
|
95
|
+
allowBash = true;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (arg === "--multi-agent") {
|
|
99
|
+
allowMultiAgent = true;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (arg === "--isolation") {
|
|
103
|
+
if (args[index + 1] === "worktree") isolation = "worktree";
|
|
104
|
+
index += 1;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
goalParts.push(arg);
|
|
108
|
+
}
|
|
109
|
+
const goal = goalParts.join(" ").trim();
|
|
110
|
+
const normalizedAgents = allowMultiAgent ? requestedAgents : 1;
|
|
111
|
+
return {
|
|
112
|
+
goal,
|
|
113
|
+
phase,
|
|
114
|
+
target,
|
|
115
|
+
plan: [
|
|
116
|
+
goal || "prepare job",
|
|
117
|
+
"validate handoff",
|
|
118
|
+
"schedule bounded local agents",
|
|
119
|
+
"write report"
|
|
120
|
+
],
|
|
121
|
+
maxTokens,
|
|
122
|
+
maxSteps,
|
|
123
|
+
requestedAgents: normalizedAgents,
|
|
124
|
+
runningCap,
|
|
125
|
+
timeoutMs,
|
|
126
|
+
allowEdit,
|
|
127
|
+
allowBash,
|
|
128
|
+
allowMultiAgent,
|
|
129
|
+
isolation,
|
|
130
|
+
budgetExplicit
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function clampPositiveInt(value, fallback, max) {
|
|
134
|
+
const parsed = Number.parseInt(value ?? "", 10);
|
|
135
|
+
if (!Number.isFinite(parsed) || parsed < 1) {
|
|
136
|
+
return fallback;
|
|
137
|
+
}
|
|
138
|
+
return Math.min(parsed, max);
|
|
139
|
+
}
|
|
140
|
+
function normalizePositiveInt(value) {
|
|
141
|
+
const parsed = Number.parseInt(value ?? "", 10);
|
|
142
|
+
if (!Number.isFinite(parsed) || parsed < 1) {
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
return parsed;
|
|
146
|
+
}
|
|
147
|
+
function estimateJobTokens(text) {
|
|
148
|
+
return Math.max(1, Math.ceil(text.length / 4));
|
|
149
|
+
}
|
|
150
|
+
function getDurableJobMaxSteps(job) {
|
|
151
|
+
return Math.max(1, Math.min(job.budget.maxSteps ?? DEFAULT_JOB_MAX_STEPS, MAX_JOB_MAX_STEPS));
|
|
152
|
+
}
|
|
153
|
+
function formatJobBudgetLine(job) {
|
|
154
|
+
const explicit = job.budget.explicit;
|
|
155
|
+
const parts = [];
|
|
156
|
+
if (explicit?.tokens === true) {
|
|
157
|
+
parts.push(`tokens ${job.budget.usedTokens ?? 0}/${job.budget.maxTokens}`);
|
|
158
|
+
} else {
|
|
159
|
+
parts.push(`tokens ${job.budget.usedTokens ?? 0}/not set`);
|
|
160
|
+
}
|
|
161
|
+
if (explicit?.steps === true) {
|
|
162
|
+
parts.push(`steps ${job.budget.usedSteps ?? 0}/${getDurableJobMaxSteps(job)}`);
|
|
163
|
+
} else {
|
|
164
|
+
parts.push(`steps ${job.budget.usedSteps ?? 0}/not set`);
|
|
165
|
+
}
|
|
166
|
+
parts.push(explicit?.runtime === true ? `timeout ${job.timeoutMs}ms` : "timeout not set");
|
|
167
|
+
const anyExplicit = Boolean(explicit?.tokens || explicit?.steps || explicit?.runtime);
|
|
168
|
+
const prefix = anyExplicit ? "budget" : "budget not set";
|
|
169
|
+
return `- ${prefix}: ${parts.join("; ")}
|
|
170
|
+
- cap scope: durable job agents only; unrelated /fork agents do not silently consume this effective cap.`;
|
|
171
|
+
}
|
|
172
|
+
function countDurableJobAgents(job) {
|
|
173
|
+
return job.agents.reduce(
|
|
174
|
+
(counts, agent) => {
|
|
175
|
+
counts[agent.status] += 1;
|
|
176
|
+
return counts;
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
created: 0,
|
|
180
|
+
running: 0,
|
|
181
|
+
queued: 0,
|
|
182
|
+
sleeping: 0,
|
|
183
|
+
skipped: 0,
|
|
184
|
+
budget_limited: 0,
|
|
185
|
+
resource_limited: 0,
|
|
186
|
+
blocked: 0,
|
|
187
|
+
stale: 0,
|
|
188
|
+
cancelled: 0,
|
|
189
|
+
timeout: 0,
|
|
190
|
+
completed: 0,
|
|
191
|
+
failed: 0
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
function rescheduleDurableJobAgents(job) {
|
|
196
|
+
let running = 0;
|
|
197
|
+
const cap = getEffectiveAgentCap(job);
|
|
198
|
+
for (const agent of job.agents) {
|
|
199
|
+
const previousStatus = agent.status;
|
|
200
|
+
if (agent.status === "completed" || agent.status === "failed" || agent.status === "cancelled") {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (job.status === "running" && (agent.status === "running" || agent.status === "queued" || agent.status === "sleeping") && running < cap) {
|
|
204
|
+
agent.status = "running";
|
|
205
|
+
agent.heartbeatAt = job.updatedAt;
|
|
206
|
+
running += 1;
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (job.status === "running") {
|
|
210
|
+
agent.status = previousStatus === "running" || previousStatus === "sleeping" || agent.runId ? "sleeping" : "queued";
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
agent.status = job.status === "sleeping" ? "sleeping" : job.status === "blocked" ? "blocked" : job.status;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function getEffectiveAgentCap(job) {
|
|
217
|
+
return Math.max(
|
|
218
|
+
0,
|
|
219
|
+
Math.min(job.effectiveAgentCap ?? job.budget.maxRunningAgents, job.agents.length)
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
function updateDurableJobEffectiveAgentCap(job, cap, reason) {
|
|
223
|
+
job.effectiveAgentCap = Math.max(
|
|
224
|
+
0,
|
|
225
|
+
Math.min(cap, job.budget.maxRunningAgents, job.agents.length)
|
|
226
|
+
);
|
|
227
|
+
const preflightSuffix = extractJobPreflightCapSuffix(job.capReason);
|
|
228
|
+
job.capReason = preflightSuffix ? `${reason};${preflightSuffix}` : reason;
|
|
229
|
+
}
|
|
230
|
+
function extractJobPreflightCapSuffix(reason) {
|
|
231
|
+
if (!reason) return void 0;
|
|
232
|
+
const parts = reason.split(";").filter(
|
|
233
|
+
(part) => part.startsWith("generatedEvidence=") || part === "generatedVerification=partial" || part === "index=unknown_nonblocking"
|
|
234
|
+
);
|
|
235
|
+
return parts.length > 0 ? parts.join(";") : void 0;
|
|
236
|
+
}
|
|
237
|
+
function deriveAgentDisplayName(type, task) {
|
|
238
|
+
const stopWords = /* @__PURE__ */ new Set([
|
|
239
|
+
"a",
|
|
240
|
+
"an",
|
|
241
|
+
"and",
|
|
242
|
+
"for",
|
|
243
|
+
"help",
|
|
244
|
+
"job",
|
|
245
|
+
"please",
|
|
246
|
+
"run",
|
|
247
|
+
"task",
|
|
248
|
+
"the",
|
|
249
|
+
"to",
|
|
250
|
+
"with"
|
|
251
|
+
]);
|
|
252
|
+
const asciiTask = Array.from(task.normalize("NFKD").toLowerCase()).map((char) => char.charCodeAt(0) <= 127 ? char : " ").join("");
|
|
253
|
+
const tokens = asciiTask.replace(/[^a-z0-9]+/gu, " ").trim().split(/\s+/u).filter((token) => token && !stopWords.has(token)).slice(0, 3);
|
|
254
|
+
const base = tokens.length > 0 ? tokens.join("-") : `task-${createHash("sha1").update(task).digest("hex").slice(0, 6)}`;
|
|
255
|
+
const label = base.endsWith(`-${type}`) ? base : `${base}-${type}`;
|
|
256
|
+
return truncateAsciiLabel(label, 36);
|
|
257
|
+
}
|
|
258
|
+
function truncateAsciiLabel(value, maxLength) {
|
|
259
|
+
const cleaned = value.replace(/[^a-z0-9-]/gu, "-").replace(/-{2,}/gu, "-").replace(/^-|-$/gu, "");
|
|
260
|
+
if (cleaned.length <= maxLength) {
|
|
261
|
+
return cleaned || "agent";
|
|
262
|
+
}
|
|
263
|
+
return cleaned.slice(0, maxLength).replace(/-+$/u, "") || "agent";
|
|
264
|
+
}
|
|
265
|
+
function createDurableJobAgents(options, status, runningCap) {
|
|
266
|
+
const total = Math.max(1, options.requestedAgents);
|
|
267
|
+
const tasks = createDurableJobAgentTasks(options.goal, total);
|
|
268
|
+
return Array.from({ length: total }, (_, index) => {
|
|
269
|
+
const active = false;
|
|
270
|
+
const agentStatus = status === "running" ? index < runningCap ? "queued" : "sleeping" : status === "created" ? "created" : status;
|
|
271
|
+
const type = index === 0 ? "planner" : index === 1 ? "worker" : index === 2 ? "verifier" : "explorer";
|
|
272
|
+
return {
|
|
273
|
+
id: `job-agent-${index + 1}`,
|
|
274
|
+
type,
|
|
275
|
+
displayName: deriveAgentDisplayName(type, options.goal),
|
|
276
|
+
goal: `${options.goal}#${index + 1}`,
|
|
277
|
+
task: tasks[index] ?? `${type}: ${options.goal}`,
|
|
278
|
+
status: agentStatus,
|
|
279
|
+
budgetTokens: Math.floor(options.maxTokens / total),
|
|
280
|
+
heartbeatAt: active ? (/* @__PURE__ */ new Date()).toISOString() : void 0,
|
|
281
|
+
summary: active ? "scheduled with trimmed handoff/evidence/cache refs only; no full transcript/source/index/log output" : "planned; not started until durable job scheduler creates a real AgentRun"
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
function createDurableJobAgentTasks(goal, total) {
|
|
286
|
+
const templates = [
|
|
287
|
+
`planner subtask: turn the job goal into a concise execution plan. Goal: ${goal}`,
|
|
288
|
+
`worker subtask: execute the next bounded work item with real tools when available. Goal: ${goal}`,
|
|
289
|
+
`verifier subtask: run verification or synthetic self-check only; do not treat job lifecycle completion as verified. Goal: ${goal}`
|
|
290
|
+
];
|
|
291
|
+
for (let index = templates.length; index < total; index += 1) {
|
|
292
|
+
templates.push(
|
|
293
|
+
`explorer subtask ${index - 2}: inspect facts and risks with read-only tools. Goal: ${goal}`
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
return templates.slice(0, total);
|
|
297
|
+
}
|
|
298
|
+
function getDurableJobStatePath(job) {
|
|
299
|
+
return join(dirname(job.logPath), "state.json");
|
|
300
|
+
}
|
|
301
|
+
async function persistDurableJob(job) {
|
|
302
|
+
await mkdir(dirname(job.logPath), { recursive: true });
|
|
303
|
+
await writeFile(getDurableJobStatePath(job), `${JSON.stringify(job, null, 2)}
|
|
304
|
+
`, "utf8");
|
|
305
|
+
}
|
|
306
|
+
async function appendJobLog(job, message) {
|
|
307
|
+
await mkdir(dirname(job.logPath), { recursive: true });
|
|
308
|
+
await appendFileAsync(job.logPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] ${message}
|
|
309
|
+
`, "utf8");
|
|
310
|
+
await appendFileAsync(job.fullOutputPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] ${message}
|
|
311
|
+
`, "utf8");
|
|
312
|
+
}
|
|
313
|
+
async function readDurableJobState(path) {
|
|
314
|
+
try {
|
|
315
|
+
const parsed = JSON.parse(await readFile(path, "utf8"));
|
|
316
|
+
return isDurableJobState(parsed) ? parsed : null;
|
|
317
|
+
} catch {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function isDurableJobState(value) {
|
|
322
|
+
return isRecord(value) && typeof value.id === "string" && typeof value.goal === "string" && typeof value.projectPath === "string" && typeof value.status === "string" && Array.isArray(value.plan) && Array.isArray(value.agents) && typeof value.logPath === "string" && typeof value.reportPath === "string" && typeof value.fullOutputPath === "string";
|
|
323
|
+
}
|
|
324
|
+
function getDurableJobsRoot(context) {
|
|
325
|
+
return resolveStoragePaths(context.config, context.projectPath).jobs;
|
|
326
|
+
}
|
|
327
|
+
function getDurableJobPaths(context, id) {
|
|
328
|
+
const dir = join(getDurableJobsRoot(context), id);
|
|
329
|
+
return {
|
|
330
|
+
logPath: join(dir, "job.log"),
|
|
331
|
+
reportPath: join(dir, "report.md"),
|
|
332
|
+
fullOutputPath: join(dir, "full-output.log")
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
async function listDurableJobs(context) {
|
|
336
|
+
const root = getDurableJobsRoot(context);
|
|
337
|
+
const entries = await readdir(root, { withFileTypes: true }).catch(() => []);
|
|
338
|
+
const jobs = [];
|
|
339
|
+
for (const entry of entries) {
|
|
340
|
+
if (!entry.isDirectory()) continue;
|
|
341
|
+
const job = await readDurableJobState(join(root, entry.name, "state.json"));
|
|
342
|
+
if (job && isCurrentProjectJob(job, context.projectPath)) jobs.push(job);
|
|
343
|
+
}
|
|
344
|
+
return jobs.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
345
|
+
}
|
|
346
|
+
function isCurrentProjectJob(job, projectPath) {
|
|
347
|
+
const currentProjectPath = resolve(projectPath);
|
|
348
|
+
return resolve(currentProjectPath, job.projectPath).toLowerCase() === currentProjectPath.toLowerCase();
|
|
349
|
+
}
|
|
350
|
+
async function findDurableJob(context, id) {
|
|
351
|
+
const jobs = await listDurableJobs(context);
|
|
352
|
+
if (!id) return jobs[0];
|
|
353
|
+
return jobs.find((job) => job.id === id || job.id.endsWith(id));
|
|
354
|
+
}
|
|
355
|
+
async function writeDurableJobReport(job) {
|
|
356
|
+
const lines = [
|
|
357
|
+
`# Job Report ${job.id}`,
|
|
358
|
+
"",
|
|
359
|
+
`- status: ${job.status}`,
|
|
360
|
+
`- goal: ${job.goal}`,
|
|
361
|
+
`- projectPath: ${formatDisplayPath(job.projectPath, job.projectPath)}`,
|
|
362
|
+
`- isolation: ${job.isolation ?? "none"}`,
|
|
363
|
+
`- phase/target: ${job.phase} / ${job.target}`,
|
|
364
|
+
`- permission: ${job.permissionPolicy}; edit ${job.allowEdit}; bash ${job.allowBash}; multi-agent ${job.allowMultiAgent}`,
|
|
365
|
+
`- budget: max tokens ${job.budget.maxTokens}; used ${job.budget.usedTokens ?? 0}; remaining ${job.budget.remainingTokens ?? job.budget.maxTokens}; max steps ${getDurableJobMaxSteps(job)}; used steps ${job.budget.usedSteps ?? 0}; running agent cap ${job.budget.maxRunningAgents}; effective cap ${getEffectiveAgentCap(job)}; cap reason ${job.capReason ?? "default"}; timeout ${job.timeoutMs}ms; max runtime ${job.budget.maxRuntimeMs ?? job.timeoutMs}ms`,
|
|
366
|
+
`- budget note: ${job.budget.note}`,
|
|
367
|
+
`- pause reason: ${job.pauseReason ?? "-"}`,
|
|
368
|
+
`- owner: session ${job.ownerSessionId ?? "-"}; pid ${job.ownerPid ?? "-"}; heartbeat ${job.heartbeatAt ?? "-"}`,
|
|
369
|
+
`- worker: ${job.worker?.status ?? "not_started"}; session ${job.worker?.sessionId ?? "-"}; ${job.worker?.summary ?? "-"}`,
|
|
370
|
+
`- verification: ${job.verification?.status ?? "not_run"}; ${job.verification?.summary ?? "-"}`,
|
|
371
|
+
formatJobRunnerReportLine(job),
|
|
372
|
+
formatApprovedRunnerSpecLine(job),
|
|
373
|
+
`- handoff: ${job.handoffPacket?.id ?? "missing"}`,
|
|
374
|
+
`- summary: lifecycle ${job.status}; result ${formatJobResultStatus(job)}; next ${formatJobNextAction(job, "en-US")}`,
|
|
375
|
+
`- status semantics: ${formatJobLifecycleLegend()}`,
|
|
376
|
+
"- evidence boundary: lifecycle/status lines are not verification evidence; use verification report/evidence refs before claiming work passed.",
|
|
377
|
+
`- evidence refs: ${job.evidenceRefs.map((item) => item.id).join(", ") || "none"}`,
|
|
378
|
+
`- logs: ${formatDisplayPath(job.logPath, job.projectPath)}`,
|
|
379
|
+
`- fullOutput: ${formatDisplayPath(job.fullOutputPath, job.projectPath)}`,
|
|
380
|
+
"",
|
|
381
|
+
"## Task graph",
|
|
382
|
+
...job.plan.map((step, index) => `${index + 1}. ${step}`),
|
|
383
|
+
"",
|
|
384
|
+
"## Agent assignment",
|
|
385
|
+
...job.agents.map(
|
|
386
|
+
(agent) => `- ${agent.id}: ${agent.type}; status ${agent.status}; run ${agent.runId ?? "-"}; reason ${agent.statusReason ?? "-"}; budget tokens ${agent.budgetTokens}; goal ${agent.goal}`
|
|
387
|
+
),
|
|
388
|
+
"",
|
|
389
|
+
"## Worker result",
|
|
390
|
+
`- status: ${job.result?.status ?? "not_run"}`,
|
|
391
|
+
`- summary: ${job.result?.summary ?? "Worker loop has not produced a result yet."}`,
|
|
392
|
+
`- lifecycle: ${job.status === "completed" ? "completed means the bounded worker loop ended; verification remains partial until evidence is reviewed" : job.status}`,
|
|
393
|
+
`- facts: ${job.result?.facts.join(" | ") ?? "none"}`,
|
|
394
|
+
`- evidence refs: ${job.result?.evidenceRefs.join(", ") ?? "none"}`,
|
|
395
|
+
"",
|
|
396
|
+
"## Budget enforcement",
|
|
397
|
+
`- used tokens: ${job.budget.usedTokens ?? 0}`,
|
|
398
|
+
`- remaining tokens: ${job.budget.remainingTokens ?? job.budget.maxTokens}`,
|
|
399
|
+
`- max runtime ms: ${job.budget.maxRuntimeMs ?? job.timeoutMs}`,
|
|
400
|
+
"- conservative: overbudget/timeout/stale/blocked states do not generate evidence that verification passed.",
|
|
401
|
+
"",
|
|
402
|
+
"## Adopted conclusions",
|
|
403
|
+
...job.adoptedConclusions.length > 0 ? job.adoptedConclusions : ["- none"],
|
|
404
|
+
"",
|
|
405
|
+
"## Rejected conclusions",
|
|
406
|
+
...job.rejectedConclusions.length > 0 ? job.rejectedConclusions.map((item) => `- ${item}`) : [
|
|
407
|
+
"- No blocked/cancelled/timeout/stale state is treated as evidence that verification passed."
|
|
408
|
+
],
|
|
409
|
+
"",
|
|
410
|
+
"## Boundaries",
|
|
411
|
+
"- Node/TUI runtime remains default and explicit fallback; Phase 17C only adds a gated native runner resolver/adapter for approved durable job specs.",
|
|
412
|
+
"- Native runner lifecycle completion is not verification evidence; failed/timeout/cancelled/stale/crash/protocol mismatch paths do not create evidence that verification passed.",
|
|
413
|
+
"- DEFERRED: managed/bundled binary distribution, signing/AV/install matrix, real native-runner process-guard smoke, and parent hard-kill/crash proof.",
|
|
414
|
+
"- Remote channels / Phase 17B, Fast Workspace Scanner, and Phase 18 desktop are NOT entered.",
|
|
415
|
+
"- Agent context is trimmed to handoff/evidence/cache/index refs; no full transcript/source/index/log output is injected."
|
|
416
|
+
];
|
|
417
|
+
await mkdir(dirname(job.reportPath), { recursive: true });
|
|
418
|
+
await writeFile(job.reportPath, `${lines.join("\n")}
|
|
419
|
+
`, "utf8");
|
|
420
|
+
}
|
|
421
|
+
function formatJobList(jobs, context) {
|
|
422
|
+
if (jobs.length === 0) {
|
|
423
|
+
return context.language === "en-US" ? "No durable jobs. Usage: /job run <goal>." : "\u5F53\u524D\u6CA1\u6709 durable job\u3002\u7528\u6CD5\uFF1A/job run <goal>\u3002";
|
|
424
|
+
}
|
|
425
|
+
return [
|
|
426
|
+
context.language === "en-US" ? "Durable jobs:" : "Durable jobs\uFF1A",
|
|
427
|
+
...jobs.map((job) => {
|
|
428
|
+
const counts = countDurableJobAgents(job);
|
|
429
|
+
const label = job.agents[0]?.displayName ?? deriveAgentDisplayName("worker", job.goal);
|
|
430
|
+
return `${job.id} lifecycle ${formatJobStateSummary(job.status)} result ${formatJobResultStatus(job)} label ${label} agents ${job.agents.length}/${counts.running} queued ${counts.queued} sleeping ${counts.sleeping} blocked ${counts.blocked} stale ${counts.stale} step ${job.budget.usedSteps ?? 0}/${getDurableJobMaxSteps(job)} goal ${truncateDisplay(job.goal, 42)} next /job status ${job.id}`;
|
|
431
|
+
}),
|
|
432
|
+
context.language === "en-US" ? `No default 3/4/20 visible running cap; requested agents are scheduled under explicit/requested cap and resource guard. Full troubleshooting is only in /job status <id>, /job report <id>, or /job logs <id>.` : `\u4E0D\u518D\u4EE5\u9ED8\u8BA4 3/4/20 \u4F5C\u4E3A\u7528\u6237\u53EF\u611F\u77E5\u8FD0\u884C\u4E0A\u9650\uFF1B\u8BF7\u6C42\u7684 agents \u4F1A\u6309\u663E\u5F0F/\u8BF7\u6C42 cap \u548C resource guard \u8C03\u5EA6\u3002\u5B8C\u6574\u6392\u67E5\u5165\u53E3\u53EA\u5728 /job status <id>\u3001/job report <id> \u6216 /job logs <id>\u3002`
|
|
433
|
+
].join("\n");
|
|
434
|
+
}
|
|
435
|
+
function formatJobPrimary(job, context) {
|
|
436
|
+
const runningAgents = job.agents.filter((agent) => agent.status === "running").length;
|
|
437
|
+
const label = job.agents[0]?.displayName ?? deriveAgentDisplayName("worker", job.goal);
|
|
438
|
+
return [
|
|
439
|
+
`[job] ${job.id} \xB7 ${job.status} \xB7 ${label}`,
|
|
440
|
+
context.language === "en-US" ? `- goal: ${truncateDisplay(job.goal, 72)}` : `- \u76EE\u6807\uFF1A${truncateDisplay(job.goal, 72)}`,
|
|
441
|
+
context.language === "en-US" ? "- scope: local durable metadata + unified background task; no remote channel, Phase 18, Beta readiness, or smoke-ready claim." : "- \u8303\u56F4\uFF1A\u672C\u5730 durable metadata + \u7EDF\u4E00\u540E\u53F0\u4EFB\u52A1\uFF1B\u672A\u8FDB\u5165 remote\u3001Phase 18\u3001Beta readiness \u6216 smoke-ready\u3002",
|
|
442
|
+
`- agents: planned ${job.agents.length}; scheduled ${job.agents.filter((agent) => agent.runId).length}; started ${job.agents.filter((agent) => agent.startedAt).length}; running ${runningAgents}; queued ${job.agents.filter((agent) => agent.status === "queued").length}; skipped ${job.agents.filter((agent) => agent.status === "skipped").length}; limited ${job.agents.filter((agent) => agent.status === "budget_limited" || agent.status === "resource_limited").length}; effective cap ${getEffectiveAgentCap(job)}; cap reason ${job.capReason ?? "default"}.`,
|
|
443
|
+
`- status semantics: ${formatJobLifecycleLegend()}`,
|
|
444
|
+
`- runner: ${formatJobRunnerInline(job)}`,
|
|
445
|
+
`- verification: ${job.verification?.status ?? "not_run"}; lifecycle states never equal verification evidence.`,
|
|
446
|
+
`- next: ${formatJobNextAction(job, context.language)}`,
|
|
447
|
+
`- details: /job report ${job.id}; logs: /job logs ${job.id}; background: /background`
|
|
448
|
+
].join("\n");
|
|
449
|
+
}
|
|
450
|
+
function formatJobStatus(job) {
|
|
451
|
+
const counts = countDurableJobAgents(job);
|
|
452
|
+
return [
|
|
453
|
+
`Job ${job.id}`,
|
|
454
|
+
`- status: ${formatJobStateSummary(job.status)}`,
|
|
455
|
+
`- result: ${formatJobResultStatus(job)}`,
|
|
456
|
+
`- next action: ${formatJobNextAction(job, "en-US")}`,
|
|
457
|
+
`- pause reason: ${job.pauseReason ?? "-"}`,
|
|
458
|
+
"- resume check: handoff/evidence/index/resource guard before any worker step",
|
|
459
|
+
`- goal: ${truncateDisplay(job.goal, 120)}`,
|
|
460
|
+
`- projectPath: ${formatDisplayPath(job.projectPath, job.projectPath)}`,
|
|
461
|
+
`- isolation: ${job.isolation ?? "none"}`,
|
|
462
|
+
`- phase/target: ${job.phase} / ${job.target}`,
|
|
463
|
+
`- agents: planned ${job.agents.length}; scheduled ${job.agents.filter((agent) => agent.runId).length}; started ${job.agents.filter((agent) => agent.startedAt).length}; running ${counts.running}; completed ${counts.completed}; queued ${counts.queued}; sleeping ${counts.sleeping}; skipped ${counts.skipped}; budget limited ${counts.budget_limited}; resource limited ${counts.resource_limited}; blocked ${counts.blocked}; stale ${counts.stale}; cap ${job.budget.maxRunningAgents}; effective cap ${getEffectiveAgentCap(job)}; cap reason ${job.capReason ?? "default"}`,
|
|
464
|
+
`- status semantics: ${formatJobLifecycleLegend()}`,
|
|
465
|
+
`- agent labels: ${formatJobAgentLabels(job.agents)}`,
|
|
466
|
+
formatJobBudgetLine(job),
|
|
467
|
+
`- worker: ${job.worker?.status ?? "not_started"}; step ${job.worker?.completedSteps ?? job.budget.usedSteps ?? 0}/${getDurableJobMaxSteps(job)}; session ${job.worker?.sessionId ?? "-"}; ${truncateDisplay(job.worker?.summary ?? "-", 120)}`,
|
|
468
|
+
`- runner: ${formatJobRunnerInline(job)}`,
|
|
469
|
+
`- evidence boundary: status/result lines are not proof that verification passed; inspect /job report ${job.id} before using conclusions.`,
|
|
470
|
+
`- permission: ${job.permissionPolicy}; edit ${job.allowEdit}; bash ${job.allowBash}; multi-agent ${job.allowMultiAgent}`,
|
|
471
|
+
`- troubleshooting: /job report ${job.id}; /job logs ${job.id}; /details background ${job.id}`
|
|
472
|
+
].join("\n");
|
|
473
|
+
}
|
|
474
|
+
function formatJobReport(job) {
|
|
475
|
+
const counts = countDurableJobAgents(job);
|
|
476
|
+
return [
|
|
477
|
+
`Job report ${job.id}`,
|
|
478
|
+
`- status: ${formatJobStateSummary(job.status)}; result ${formatJobResultStatus(job)}; pause reason ${job.pauseReason ?? "-"}`,
|
|
479
|
+
`- conclusion: ${formatJobReportConclusion(job)}`,
|
|
480
|
+
`- next action: ${formatJobNextAction(job, "en-US")}`,
|
|
481
|
+
`- task graph: ${job.plan.length} steps; worker ${job.worker?.status ?? "not_started"}; used steps ${job.budget.usedSteps ?? 0}/${getDurableJobMaxSteps(job)}`,
|
|
482
|
+
`- isolation: ${job.isolation ?? "none"}`,
|
|
483
|
+
`- agent assignment: ${formatJobAgentLabels(job.agents)}`,
|
|
484
|
+
`- agent counts: planned ${job.agents.length}; scheduled ${job.agents.filter((agent) => agent.runId).length}; started ${job.agents.filter((agent) => agent.startedAt).length}; running ${counts.running}; completed ${counts.completed}; queued ${counts.queued}; sleeping ${counts.sleeping}; skipped ${counts.skipped}; budget limited ${counts.budget_limited}; resource limited ${counts.resource_limited}; blocked ${counts.blocked}; stale ${counts.stale}; cap ${job.budget.maxRunningAgents}; effective cap ${getEffectiveAgentCap(job)}; cap reason ${job.capReason ?? "default"}`,
|
|
485
|
+
`- status semantics: ${formatJobLifecycleLegend()}`,
|
|
486
|
+
formatJobBudgetLine(job),
|
|
487
|
+
`- verification: ${job.verification?.status ?? "not_run"}; ${truncateDisplay(job.verification?.summary ?? "-", 120)}`,
|
|
488
|
+
"- evidence boundary: report summarizes bounded job evidence only; full diagnostics stay in redacted/relative paths below.",
|
|
489
|
+
`- evidence refs: ${formatJobEvidenceRefs(job)}`,
|
|
490
|
+
`- runner: ${formatJobRunnerInline(job)}`,
|
|
491
|
+
`- adopted: ${job.adoptedConclusions.join("; ") || "none"}`,
|
|
492
|
+
`- rejected: ${job.rejectedConclusions.join("; ") || "blocked/cancelled/timeout/stale are never verification pass evidence"}`,
|
|
493
|
+
`- log path: ${formatDisplayPath(job.logPath, job.projectPath)}`,
|
|
494
|
+
`- full output path: ${formatDisplayPath(job.fullOutputPath, job.projectPath)}`,
|
|
495
|
+
`- report path: ${formatDisplayPath(job.reportPath, job.projectPath)}`
|
|
496
|
+
].join("\n");
|
|
497
|
+
}
|
|
498
|
+
function formatJobLifecycleLegend() {
|
|
499
|
+
return "running active now; queued waiting for an execution slot; sleeping paused by user/resource guard; blocked needs a concrete fix; stale lost owner/heartbeat freshness; cancelled stopped by user; timeout hit runtime limit; completed lifecycle ended only; partial means incomplete or unverified evidence.";
|
|
500
|
+
}
|
|
501
|
+
function formatJobStateSummary(status) {
|
|
502
|
+
return `${status} (${formatJobStateMeaning(status)})`;
|
|
503
|
+
}
|
|
504
|
+
function formatJobStateMeaning(status) {
|
|
505
|
+
if (status === "running") return "active now";
|
|
506
|
+
if (status === "queued") return "waiting for execution slot";
|
|
507
|
+
if (status === "sleeping" || status === "created") return "paused or not started";
|
|
508
|
+
if (status === "blocked") return "needs a concrete fix before resume";
|
|
509
|
+
if (status === "stale") return "owner or heartbeat freshness is missing";
|
|
510
|
+
if (status === "cancelled") return "stopped by user";
|
|
511
|
+
if (status === "timeout") return "runtime limit reached";
|
|
512
|
+
if (status === "completed") return "lifecycle ended; review evidence separately";
|
|
513
|
+
if (status === "partial") return "incomplete or unverified evidence";
|
|
514
|
+
if (status === "failed") return "runtime error; inspect logs";
|
|
515
|
+
return "durable job lifecycle state";
|
|
516
|
+
}
|
|
517
|
+
function formatJobResultStatus(job) {
|
|
518
|
+
return formatJobStateSummary(job.result?.status ?? "partial");
|
|
519
|
+
}
|
|
520
|
+
function formatJobEvidenceRefs(job) {
|
|
521
|
+
if (job.evidenceRefs.length === 0 && !job.result?.evidenceRefs?.length) return "none";
|
|
522
|
+
const durableRefs = job.evidenceRefs.map(
|
|
523
|
+
(item) => `${item.id}:${item.kind}:${truncateDisplay(item.summary, 56)}`
|
|
524
|
+
);
|
|
525
|
+
const resultRefs = job.result?.evidenceRefs.map((item) => `${item}:worker-result`) ?? [];
|
|
526
|
+
return [...durableRefs, ...resultRefs].join(", ");
|
|
527
|
+
}
|
|
528
|
+
function formatJobAgentLabels(agents) {
|
|
529
|
+
return truncateDisplay(
|
|
530
|
+
agents.map(
|
|
531
|
+
(agent) => `${agent.id}:${agent.displayName ?? deriveAgentDisplayName(agent.type, agent.goal)}:${agent.status}${agent.runId ? `:${agent.runId}` : ""}${agent.resultSummary ? `:${truncateDisplay(agent.resultSummary, 80)}` : ""}`
|
|
532
|
+
).join(", "),
|
|
533
|
+
200
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
function formatJobReportConclusion(job) {
|
|
537
|
+
if (job.status === "stale") {
|
|
538
|
+
return "stale because heartbeat/owner recovery failed; /job resume first rechecks handoff, evidence/index state, and resource guard.";
|
|
539
|
+
}
|
|
540
|
+
if (job.status === "blocked") {
|
|
541
|
+
return "blocked until handoff/evidence/index/resource guard is repaired; no evidence that verification passed was generated.";
|
|
542
|
+
}
|
|
543
|
+
if (job.status === "cancelled" || job.status === "timeout" || job.status === "completed") {
|
|
544
|
+
return `${job.status} is terminal or conservative; inspect verification before treating it as useful evidence.`;
|
|
545
|
+
}
|
|
546
|
+
return "running/created job uses trimmed handoff, evidence refs, cache/index refs, and resource guard.";
|
|
547
|
+
}
|
|
548
|
+
async function formatJobLogs(job) {
|
|
549
|
+
const content = await readFile(job.logPath, "utf8").catch(() => "");
|
|
550
|
+
const tail = content.split(/\r?\n/u).filter(Boolean).slice(-JOB_LOG_TAIL_LINES).map((line) => sanitizeDisplayPaths(line, job.projectPath));
|
|
551
|
+
return [
|
|
552
|
+
`Job logs ${job.id}`,
|
|
553
|
+
`- path: ${formatDisplayPath(job.logPath, job.projectPath)}`,
|
|
554
|
+
`- full output path: ${formatDisplayPath(job.fullOutputPath, job.projectPath)}`,
|
|
555
|
+
`- tail: bounded last ${tail.length}/${JOB_LOG_TAIL_LINES} lines; full troubleshooting uses the redacted/relative paths above`,
|
|
556
|
+
`- status: ${formatJobStateSummary(job.status)}; result ${formatJobResultStatus(job)}`,
|
|
557
|
+
tail.length > 0 ? tail.join("\n") : "\u65E5\u5FD7\u4E3A\u7A7A\uFF1Bjob \u53EF\u80FD\u5C1A\u672A\u5199\u5165\u8F93\u51FA\u3002"
|
|
558
|
+
].join("\n");
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export {
|
|
562
|
+
DEFAULT_JOB_TIMEOUT_MS,
|
|
563
|
+
DEFAULT_JOB_BUDGET_TOKENS,
|
|
564
|
+
JOB_LOG_TAIL_LINES,
|
|
565
|
+
JOB_RECOVERY_HEARTBEAT_STALE_MS,
|
|
566
|
+
DEFAULT_JOB_MAX_STEPS,
|
|
567
|
+
MAX_JOB_MAX_STEPS,
|
|
568
|
+
JOB_AGENT_HIGH_CONFIG_CANDIDATE,
|
|
569
|
+
parseJobRunOptions,
|
|
570
|
+
clampPositiveInt,
|
|
571
|
+
estimateJobTokens,
|
|
572
|
+
getDurableJobMaxSteps,
|
|
573
|
+
countDurableJobAgents,
|
|
574
|
+
rescheduleDurableJobAgents,
|
|
575
|
+
getEffectiveAgentCap,
|
|
576
|
+
updateDurableJobEffectiveAgentCap,
|
|
577
|
+
deriveAgentDisplayName,
|
|
578
|
+
truncateAsciiLabel,
|
|
579
|
+
createDurableJobAgents,
|
|
580
|
+
createDurableJobAgentTasks,
|
|
581
|
+
getDurableJobStatePath,
|
|
582
|
+
persistDurableJob,
|
|
583
|
+
appendJobLog,
|
|
584
|
+
readDurableJobState,
|
|
585
|
+
isDurableJobState,
|
|
586
|
+
getDurableJobsRoot,
|
|
587
|
+
getDurableJobPaths,
|
|
588
|
+
listDurableJobs,
|
|
589
|
+
findDurableJob,
|
|
590
|
+
writeDurableJobReport,
|
|
591
|
+
formatJobList,
|
|
592
|
+
formatJobPrimary,
|
|
593
|
+
formatJobStatus,
|
|
594
|
+
formatJobReport,
|
|
595
|
+
formatJobAgentLabels,
|
|
596
|
+
formatJobReportConclusion,
|
|
597
|
+
formatJobLogs
|
|
598
|
+
};
|