@1agents/acp-service 0.8.3 → 0.9.1
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/README.md +25 -13
- package/dist/bin/a2a.js +16 -4
- package/dist/bin/acp-service.js +30 -0
- package/dist/bin/process.d.ts +4 -0
- package/dist/bin/process.js +57 -0
- package/dist/bin/roles.d.ts +1 -0
- package/dist/bin/roles.js +24 -0
- package/dist/bin/rsi.d.ts +3 -0
- package/dist/bin/rsi.js +114 -0
- package/dist/bin/ticket.d.ts +13 -0
- package/dist/bin/ticket.js +97 -0
- package/dist/bin/trail.d.ts +4 -0
- package/dist/bin/trail.js +62 -0
- package/dist/src/a2a/artifact-content.d.ts +9 -0
- package/dist/src/a2a/artifact-content.js +45 -0
- package/dist/src/a2a/desktop-notify.d.ts +1 -0
- package/dist/src/a2a/desktop-notify.js +12 -0
- package/dist/src/a2a/execution-binding.d.ts +9 -0
- package/dist/src/a2a/execution-binding.js +19 -0
- package/dist/src/a2a/executor.d.ts +22 -1
- package/dist/src/a2a/executor.js +308 -22
- package/dist/src/a2a/gateway.d.ts +613 -1
- package/dist/src/a2a/gateway.js +1337 -88
- package/dist/src/a2a/index.d.ts +14 -1
- package/dist/src/a2a/index.js +8 -0
- package/dist/src/a2a/job-directory.d.ts +6 -0
- package/dist/src/a2a/job-directory.js +19 -0
- package/dist/src/a2a/preflight.js +16 -1
- package/dist/src/a2a/resubmit.d.ts +46 -0
- package/dist/src/a2a/resubmit.js +82 -0
- package/dist/src/a2a/result-metadata.d.ts +6 -0
- package/dist/src/a2a/result-metadata.js +25 -6
- package/dist/src/a2a/server.d.ts +10 -0
- package/dist/src/a2a/server.js +127 -2
- package/dist/src/a2a/session-lifecycle.d.ts +40 -0
- package/dist/src/a2a/session-lifecycle.js +54 -0
- package/dist/src/a2a/store.d.ts +4 -0
- package/dist/src/a2a/store.js +76 -1
- package/dist/src/a2a/types.d.ts +77 -1
- package/dist/src/a2a/types.js +11 -1
- package/dist/src/a2a/workbench-ui.d.ts +28 -0
- package/dist/src/a2a/workbench-ui.js +182 -0
- package/dist/src/acp-connection.js +119 -14
- package/dist/src/bridge.d.ts +1 -0
- package/dist/src/bridge.js +312 -37
- package/dist/src/capacity-lifecycle.d.ts +5 -0
- package/dist/src/capacity-lifecycle.js +57 -0
- package/dist/src/capacity-queue.d.ts +58 -0
- package/dist/src/capacity-queue.js +388 -0
- package/dist/src/capacity.d.ts +101 -0
- package/dist/src/capacity.js +416 -0
- package/dist/src/dsh.js +1 -1
- package/dist/src/execution/agent-files.d.ts +25 -0
- package/dist/src/execution/agent-files.js +90 -0
- package/dist/src/execution/agent-registry.d.ts +164 -0
- package/dist/src/execution/agent-registry.js +275 -0
- package/dist/src/execution/human-review.d.ts +105 -0
- package/dist/src/execution/human-review.js +89 -0
- package/dist/src/execution/ledger.d.ts +57 -0
- package/dist/src/execution/ledger.js +122 -13
- package/dist/src/execution/ppt-delivery.d.ts +36 -3
- package/dist/src/execution/ppt-delivery.js +243 -53
- package/dist/src/execution/process-request.d.ts +151 -0
- package/dist/src/execution/process-request.js +177 -0
- package/dist/src/execution/project-discovery.d.ts +56 -0
- package/dist/src/execution/project-discovery.js +429 -0
- package/dist/src/execution/report-review.d.ts +60 -0
- package/dist/src/execution/report-review.js +173 -0
- package/dist/src/execution/targets.d.ts +20 -0
- package/dist/src/execution/targets.js +23 -3
- package/dist/src/execution/ticket-executor.d.ts +25 -0
- package/dist/src/execution/ticket-executor.js +27 -0
- package/dist/src/execution/ticket.d.ts +326 -0
- package/dist/src/execution/ticket.js +301 -0
- package/dist/src/execution/workbench-chat.d.ts +25 -0
- package/dist/src/execution/workbench-chat.js +54 -0
- package/dist/src/execution/workbench.d.ts +162 -0
- package/dist/src/execution/workbench.js +356 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +3 -0
- package/dist/src/roles/index.d.ts +1 -0
- package/dist/src/roles/index.js +1 -0
- package/dist/src/roles/skills.d.ts +71 -0
- package/dist/src/roles/skills.js +427 -0
- package/dist/src/rsi/gate.d.ts +25 -0
- package/dist/src/rsi/gate.js +59 -0
- package/dist/src/rsi/outline-run.d.ts +107 -0
- package/dist/src/rsi/outline-run.js +443 -0
- package/dist/workbench-ui/app.css +453 -0
- package/dist/workbench-ui/app.js +13 -0
- package/dist/workbench-ui/chunk-23JHGYT3.js +1 -0
- package/dist/workbench-ui/chunk-3H6STGPV.js +1 -0
- package/dist/workbench-ui/chunk-3SNBBMGH.js +1 -0
- package/dist/workbench-ui/chunk-3XJZ6DIE.js +1 -0
- package/dist/workbench-ui/chunk-44KDLLKJ.js +1 -0
- package/dist/workbench-ui/chunk-46H7FU5Y.js +7 -0
- package/dist/workbench-ui/chunk-4N44QPL7.js +1 -0
- package/dist/workbench-ui/chunk-4YN4BS7I.js +1 -0
- package/dist/workbench-ui/chunk-53EG4IVQ.js +96 -0
- package/dist/workbench-ui/chunk-5FIPUNR4.js +1 -0
- package/dist/workbench-ui/chunk-6DWWYA6G.js +2 -0
- package/dist/workbench-ui/chunk-6FU3T633.js +99 -0
- package/dist/workbench-ui/chunk-6XKIHRA4.js +1 -0
- package/dist/workbench-ui/chunk-7GIX43Y5.js +1 -0
- package/dist/workbench-ui/chunk-7Q4WBGX6.js +4 -0
- package/dist/workbench-ui/chunk-A3BQM7HR.js +1 -0
- package/dist/workbench-ui/chunk-AFCFDDOP.js +24 -0
- package/dist/workbench-ui/chunk-AG67EUYD.js +89 -0
- package/dist/workbench-ui/chunk-AGJHMMTN.js +1 -0
- package/dist/workbench-ui/chunk-AO6JUBV6.js +41 -0
- package/dist/workbench-ui/chunk-AUSLTP43.js +72 -0
- package/dist/workbench-ui/chunk-AVZL46TT.js +1 -0
- package/dist/workbench-ui/chunk-AZRIGIV2.js +168 -0
- package/dist/workbench-ui/chunk-B2LIVH37.js +1 -0
- package/dist/workbench-ui/chunk-B7YX5TR5.js +1 -0
- package/dist/workbench-ui/chunk-BCB4X4XX.js +1 -0
- package/dist/workbench-ui/chunk-BCRQUL2A.js +88 -0
- package/dist/workbench-ui/chunk-BI6UHHQP.js +1 -0
- package/dist/workbench-ui/chunk-BLSLQ4AQ.js +120 -0
- package/dist/workbench-ui/chunk-C3QSRS6E.js +1 -0
- package/dist/workbench-ui/chunk-CK7M2PJ3.js +62 -0
- package/dist/workbench-ui/chunk-CM6LZ7TU.js +1 -0
- package/dist/workbench-ui/chunk-CP63H27F.js +36 -0
- package/dist/workbench-ui/chunk-CPUMMIS2.js +70 -0
- package/dist/workbench-ui/chunk-CSEIBI5U.js +2 -0
- package/dist/workbench-ui/chunk-CUS65DKZ.js +161 -0
- package/dist/workbench-ui/chunk-CVQY7TNC.js +1 -0
- package/dist/workbench-ui/chunk-D6S3XBIX.js +106 -0
- package/dist/workbench-ui/chunk-E253Y562.js +1 -0
- package/dist/workbench-ui/chunk-EADDJUDC.js +1 -0
- package/dist/workbench-ui/chunk-EBGJ3YXG.js +206 -0
- package/dist/workbench-ui/chunk-EKPVZ3WY.js +8 -0
- package/dist/workbench-ui/chunk-EQDCEAFY.js +1 -0
- package/dist/workbench-ui/chunk-ES3SSDJY.js +40 -0
- package/dist/workbench-ui/chunk-ESFD2H7N.js +231 -0
- package/dist/workbench-ui/chunk-FVOHPMS6.js +1 -0
- package/dist/workbench-ui/chunk-FXMQAGVT.js +1 -0
- package/dist/workbench-ui/chunk-GGTADRXD.js +24 -0
- package/dist/workbench-ui/chunk-GHIVPGNQ.js +1 -0
- package/dist/workbench-ui/chunk-GLU2YQV2.js +1 -0
- package/dist/workbench-ui/chunk-GOCKBYSM.js +1 -0
- package/dist/workbench-ui/chunk-H2KMMTJB.js +1 -0
- package/dist/workbench-ui/chunk-HGVLDNPP.js +39 -0
- package/dist/workbench-ui/chunk-HSAVC5GY.js +1 -0
- package/dist/workbench-ui/chunk-HSEAD2JH.js +1 -0
- package/dist/workbench-ui/chunk-HSIHOBTY.js +1 -0
- package/dist/workbench-ui/chunk-IZXOKUGG.js +67 -0
- package/dist/workbench-ui/chunk-JFT2LC2T.js +1 -0
- package/dist/workbench-ui/chunk-JHL3ZDYK.js +3 -0
- package/dist/workbench-ui/chunk-JMORLCZG.js +257 -0
- package/dist/workbench-ui/chunk-JR4SIX7A.js +1 -0
- package/dist/workbench-ui/chunk-K23HAGEH.js +30 -0
- package/dist/workbench-ui/chunk-K43JDCBH.js +1 -0
- package/dist/workbench-ui/chunk-KINKFJY7.js +1 -0
- package/dist/workbench-ui/chunk-KKQSA4LI.js +2 -0
- package/dist/workbench-ui/chunk-KOUZX3UX.js +1 -0
- package/dist/workbench-ui/chunk-KR4DRHW2.js +78 -0
- package/dist/workbench-ui/chunk-KT4DJNOR.js +1 -0
- package/dist/workbench-ui/chunk-KTPNKRRZ.js +292 -0
- package/dist/workbench-ui/chunk-LFHIPGSU.js +7 -0
- package/dist/workbench-ui/chunk-LWDL4HZB.js +125 -0
- package/dist/workbench-ui/chunk-MVYC3CY4.js +1 -0
- package/dist/workbench-ui/chunk-NWUPALCY.js +129 -0
- package/dist/workbench-ui/chunk-NY7C662Z.js +1 -0
- package/dist/workbench-ui/chunk-O76WTHWP.js +1 -0
- package/dist/workbench-ui/chunk-OTF7YHRE.js +162 -0
- package/dist/workbench-ui/chunk-P6TKKRKP.js +1 -0
- package/dist/workbench-ui/chunk-PFHOOWV3.js +1 -0
- package/dist/workbench-ui/chunk-PUQLANIM.js +1 -0
- package/dist/workbench-ui/chunk-PZCGBYVO.js +1 -0
- package/dist/workbench-ui/chunk-QOHUZGP4.js +1 -0
- package/dist/workbench-ui/chunk-QSEG3OFF.js +1 -0
- package/dist/workbench-ui/chunk-QYPOXZIA.js +84 -0
- package/dist/workbench-ui/chunk-R6SOF3JC.js +1 -0
- package/dist/workbench-ui/chunk-RCLOYU5F.js +1 -0
- package/dist/workbench-ui/chunk-RSRUP64S.js +1 -0
- package/dist/workbench-ui/chunk-RVAIT6JW.js +1 -0
- package/dist/workbench-ui/chunk-S2CCN3II.js +1 -0
- package/dist/workbench-ui/chunk-S2Q52W46.js +1 -0
- package/dist/workbench-ui/chunk-S2W5THJ5.js +1 -0
- package/dist/workbench-ui/chunk-S6ZQZNOX.js +1 -0
- package/dist/workbench-ui/chunk-S74PLMMS.js +1 -0
- package/dist/workbench-ui/chunk-S7C4HKEY.js +1 -0
- package/dist/workbench-ui/chunk-SDTB3Q65.js +1 -0
- package/dist/workbench-ui/chunk-SLPRGYUV.js +32 -0
- package/dist/workbench-ui/chunk-SQE76S5B.js +1 -0
- package/dist/workbench-ui/chunk-SSDZPVPW.js +1 -0
- package/dist/workbench-ui/chunk-SVI7DGIE.js +1 -0
- package/dist/workbench-ui/chunk-T6QKLZ4H.js +62 -0
- package/dist/workbench-ui/chunk-TJNRPTFL.js +1 -0
- package/dist/workbench-ui/chunk-TP6U4EDH.js +2 -0
- package/dist/workbench-ui/chunk-TYAAT3GQ.js +1 -0
- package/dist/workbench-ui/chunk-U6OCY4ZH.js +1 -0
- package/dist/workbench-ui/chunk-UAN3NLRF.js +1 -0
- package/dist/workbench-ui/chunk-UMLU3FIX.js +1 -0
- package/dist/workbench-ui/chunk-URIY2OTM.js +1 -0
- package/dist/workbench-ui/chunk-V2NUKAA7.js +38 -0
- package/dist/workbench-ui/chunk-V4QLL4TE.js +139 -0
- package/dist/workbench-ui/chunk-VASHXUK4.js +2 -0
- package/dist/workbench-ui/chunk-VJLIWNIU.js +1 -0
- package/dist/workbench-ui/chunk-VQNQFBID.js +1 -0
- package/dist/workbench-ui/chunk-VSIWU7XA.js +3 -0
- package/dist/workbench-ui/chunk-VSJASPUZ.js +321 -0
- package/dist/workbench-ui/chunk-VXPNUNUX.js +3 -0
- package/dist/workbench-ui/chunk-WBKLDCV6.js +1 -0
- package/dist/workbench-ui/chunk-WOKJM3FY.js +1 -0
- package/dist/workbench-ui/chunk-X3U3NA3X.js +34 -0
- package/dist/workbench-ui/chunk-XBYU7M4J.js +1 -0
- package/dist/workbench-ui/chunk-XBZAO4ID.js +10 -0
- package/dist/workbench-ui/chunk-XLLPZ2WO.js +1 -0
- package/dist/workbench-ui/chunk-YFVL4NJL.js +1 -0
- package/dist/workbench-ui/chunk-YRFQENM4.js +1 -0
- package/dist/workbench-ui/chunk-YUADQVB2.js +1 -0
- package/dist/workbench-ui/chunk-Z3TCAKM5.js +1 -0
- package/dist/workbench-ui/chunk-Z6QR6FRE.js +10 -0
- package/dist/workbench-ui/chunk-ZJPSORPP.js +3 -0
- package/dist/workbench-ui/chunk-ZLGCSTR2.js +15 -0
- package/dist/workbench-ui/chunk-ZLR4SG5X.js +1 -0
- package/dist/workbench-ui/chunk-ZND3TTGF.js +1 -0
- package/dist/workbench-ui/chunk-ZOP3ZYH7.js +2 -0
- package/dist/workbench-ui/index.html +14 -0
- package/package.json +23 -8
- package/skills/acp-service/SKILL.md +24 -8
- package/skills/acp-service/references/a2a.md +24 -8
- package/skills/acp-service/references/async-caller.md +48 -0
- package/skills/acp-service/references/dsh.md +2 -0
- package/skills/acp-service/references/roles-and-tasks.md +120 -0
- package/skills/acp-service/scripts/a2a-caller.py +242 -0
- package/skills/rsi-coach/SKILL.md +134 -0
- package/vendor/dsh/README.md +11 -5
- package/vendor/dsh/a2a-executor.d.ts +60 -3
- package/vendor/dsh/a2a-executor.js +208 -18
- package/vendor/dsh/a2a.d.ts +12 -2
- package/vendor/dsh/a2a.js +9 -2
- package/vendor/dsh/adapter.d.ts +61 -2
- package/vendor/dsh/adapter.js +354 -23
- package/vendor/dsh/client.js +67 -11
- package/vendor/dsh/index.js +57 -4
- package/vendor/dsh/native-approvals.d.ts +4 -0
- package/vendor/dsh/native-approvals.js +44 -0
- package/vendor/dsh/preset-route.d.ts +49 -0
- package/vendor/dsh/preset-route.js +51 -0
- package/vendor/dsh/preset.js +10 -3
- package/vendor/dsh/process-admission.d.ts +25 -0
- package/vendor/dsh/process-admission.js +87 -0
- package/vendor/dsh/process-requests.d.ts +57 -0
- package/vendor/dsh/process-requests.js +49 -0
- package/vendor/dsh/review-mcp.d.ts +1 -0
- package/vendor/dsh/review-mcp.js +56 -0
- package/vendor/dsh/review.d.ts +30 -0
- package/vendor/dsh/review.js +149 -0
- package/vendor/dsh/session-settings.d.ts +34 -0
- package/vendor/dsh/session-settings.js +114 -0
- package/vendor/dsh/ticket-spec.d.ts +30 -0
- package/vendor/dsh/ticket-spec.js +10 -0
- package/vendor/dsh/ticket-tools.d.ts +21 -0
- package/vendor/dsh/ticket-tools.js +43 -0
- package/vendor/dsh/workbench.d.ts +18 -0
- package/vendor/dsh/workbench.js +91 -0
- package/vendor/runtime/README.md +6 -4
- package/vendor/runtime/dist/{cli-DeOpE2Xz.js → cli-DXmYwv3U.js} +4 -4
- package/vendor/runtime/dist/{cli-DeOpE2Xz.js.map → cli-DXmYwv3U.js.map} +1 -1
- package/vendor/runtime/dist/cli.js +7 -7
- package/vendor/runtime/dist/client-VQsqcIOJ.d.ts.map +1 -1
- package/vendor/runtime/dist/docs-site/CLI.html +2 -2
- package/vendor/runtime/dist/docs-site/VISION.html +2 -2
- package/vendor/runtime/dist/docs-site/agents.html +2 -2
- package/vendor/runtime/dist/docs-site/compare.html +2 -2
- package/vendor/runtime/dist/docs-site/config.html +2 -2
- package/vendor/runtime/dist/docs-site/custom-agents.html +2 -2
- package/vendor/runtime/dist/docs-site/exit-codes.html +2 -2
- package/vendor/runtime/dist/docs-site/flows.html +2 -2
- package/vendor/runtime/dist/docs-site/index.html +1 -1
- package/vendor/runtime/dist/docs-site/install.html +2 -2
- package/vendor/runtime/dist/docs-site/llms.txt +1 -1
- package/vendor/runtime/dist/docs-site/output-formats.html +2 -2
- package/vendor/runtime/dist/docs-site/permissions.html +2 -2
- package/vendor/runtime/dist/docs-site/prompting.html +2 -2
- package/vendor/runtime/dist/docs-site/quickstart.html +2 -2
- package/vendor/runtime/dist/docs-site/releasing.html +2 -2
- package/vendor/runtime/dist/docs-site/runtime-environment.html +2 -2
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +3 -2
- package/vendor/runtime/dist/docs-site/safe-errors.html +2 -2
- package/vendor/runtime/dist/docs-site/session-control.html +2 -2
- package/vendor/runtime/dist/docs-site/session-watch.html +2 -2
- package/vendor/runtime/dist/docs-site/sessions.html +2 -2
- package/vendor/runtime/dist/docs-site/shared-sessions.html +2 -2
- package/vendor/runtime/dist/{flows-oaBGn31w.js → flows-DJ17ajbw.js} +3 -3
- package/vendor/runtime/dist/{flows-oaBGn31w.js.map → flows-DJ17ajbw.js.map} +1 -1
- package/vendor/runtime/dist/flows.js +1 -1
- package/vendor/runtime/dist/{invocation-options-CUDEE8vW.js → invocation-options-PBfCgrdi.js} +3 -3
- package/vendor/runtime/dist/{invocation-options-CUDEE8vW.js.map → invocation-options-PBfCgrdi.js.map} +1 -1
- package/vendor/runtime/dist/{output-CFv3jcOQ.js → output-B3MDn7kv.js} +2 -2
- package/vendor/runtime/dist/{output-CFv3jcOQ.js.map → output-B3MDn7kv.js.map} +1 -1
- package/vendor/runtime/dist/{queue-owner-runtime-DvMJiGbP.js → queue-owner-runtime-DXCVngwU.js} +15 -8
- package/vendor/runtime/dist/queue-owner-runtime-DXCVngwU.js.map +1 -0
- package/vendor/runtime/dist/runtime.js +1 -1
- package/vendor/runtime/dist/{session-watch-Di-wIdCH.js → session-watch-DURyCw31.js} +2 -2
- package/vendor/runtime/dist/{session-watch-Di-wIdCH.js.map → session-watch-DURyCw31.js.map} +1 -1
- package/vendor/runtime/package.json +6 -4
- package/vendor/runtime/skills/acpx/SKILL.md +2 -0
- package/vendor/runtime/dist/queue-owner-runtime-DvMJiGbP.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Ticket, type TicketChange } from './ticket.js';
|
|
1
2
|
export type ExecutionStatus = 'not_started' | 'submitted' | 'working' | 'input_required' | 'auth_required' | 'completed' | 'failed' | 'canceled' | 'rejected' | 'unknown';
|
|
2
3
|
export type SubmissionStatus = 'prepared' | 'dispatching' | 'accepted' | 'known_not_submitted' | 'submission_unknown';
|
|
3
4
|
export interface JobRef {
|
|
@@ -30,9 +31,17 @@ export interface LedgerResult {
|
|
|
30
31
|
resultDigest?: string;
|
|
31
32
|
resultRevision?: string;
|
|
32
33
|
artifactLinks: unknown[];
|
|
34
|
+
/** Artifact byte receipts supplied by the execution host, when available. */
|
|
35
|
+
resultArtifacts?: unknown[];
|
|
33
36
|
resultAvailable: boolean;
|
|
34
37
|
observedAt: string;
|
|
35
38
|
}
|
|
39
|
+
/** Who acted: a person, or a coach agent naming its session. */
|
|
40
|
+
export interface LedgerActor {
|
|
41
|
+
kind: 'person' | 'coach';
|
|
42
|
+
agent?: string;
|
|
43
|
+
sessionId?: string;
|
|
44
|
+
}
|
|
36
45
|
export interface BusinessAcceptance {
|
|
37
46
|
attemptId: string;
|
|
38
47
|
resultRevision: string;
|
|
@@ -40,6 +49,8 @@ export interface BusinessAcceptance {
|
|
|
40
49
|
reviewStatus: 'pending' | 'accepted' | 'changes_requested';
|
|
41
50
|
note?: string;
|
|
42
51
|
recordedAt: string;
|
|
52
|
+
/** Absent on records written before acceptances named who decided. */
|
|
53
|
+
decidedBy?: LedgerActor;
|
|
43
54
|
}
|
|
44
55
|
export interface LedgerAttempt {
|
|
45
56
|
attemptId: string;
|
|
@@ -67,6 +78,14 @@ export interface LedgerAttempt {
|
|
|
67
78
|
updatedAt: string;
|
|
68
79
|
diagnostic?: string;
|
|
69
80
|
result?: LedgerResult;
|
|
81
|
+
resultHistory?: LedgerResult[];
|
|
82
|
+
/** The origin stopped waiting on this round before it ended (it timed out, or the caller itself failed); it may still run or have finished unseen. */
|
|
83
|
+
unwatched?: {
|
|
84
|
+
at: string;
|
|
85
|
+
reason: string;
|
|
86
|
+
};
|
|
87
|
+
/** Who asked for this round, when the caller named itself. */
|
|
88
|
+
initiatedBy?: LedgerActor;
|
|
70
89
|
}
|
|
71
90
|
export interface LedgerJob {
|
|
72
91
|
sourceId: string;
|
|
@@ -92,6 +111,8 @@ export interface LedgerJob {
|
|
|
92
111
|
updatedAt: string;
|
|
93
112
|
provenance: 'native' | 'legacy';
|
|
94
113
|
migratedAt?: string;
|
|
114
|
+
/** Who asked for the task. originSessionId stays the access scope, and many callers share a default one. */
|
|
115
|
+
initiatedBy?: LedgerActor;
|
|
95
116
|
}
|
|
96
117
|
export interface LedgerEvent {
|
|
97
118
|
eventId: string;
|
|
@@ -118,6 +139,8 @@ export interface LedgerState {
|
|
|
118
139
|
events: LedgerEvent[];
|
|
119
140
|
nextSequence: number;
|
|
120
141
|
acceptances: Record<string, BusinessAcceptance[]>;
|
|
142
|
+
/** Task tickets by executor jobId; absent in state written before tickets existed. */
|
|
143
|
+
tickets?: Record<string, Ticket>;
|
|
121
144
|
}
|
|
122
145
|
export interface LedgerPrepareInput {
|
|
123
146
|
originSessionId: string;
|
|
@@ -134,6 +157,7 @@ export interface LedgerPrepareInput {
|
|
|
134
157
|
operation?: string;
|
|
135
158
|
resultRevision?: string;
|
|
136
159
|
replacesJobRef?: JobRef;
|
|
160
|
+
initiatedBy?: LedgerActor;
|
|
137
161
|
}
|
|
138
162
|
export interface LedgerObservation {
|
|
139
163
|
executionStatus?: ExecutionStatus;
|
|
@@ -146,6 +170,7 @@ export interface LedgerObservation {
|
|
|
146
170
|
resultDigest?: string;
|
|
147
171
|
resultRevision?: string;
|
|
148
172
|
artifactLinks?: unknown[];
|
|
173
|
+
resultArtifacts?: unknown[];
|
|
149
174
|
resultAvailable?: boolean;
|
|
150
175
|
diagnostic?: string;
|
|
151
176
|
}
|
|
@@ -171,6 +196,7 @@ export interface LedgerJobView extends LedgerJob {
|
|
|
171
196
|
attempts: LedgerAttempt[];
|
|
172
197
|
children: LedgerJob[];
|
|
173
198
|
result?: LedgerResult;
|
|
199
|
+
resultHistory: LedgerResult[];
|
|
174
200
|
businessAcceptance?: BusinessAcceptance;
|
|
175
201
|
acceptanceHistory: BusinessAcceptance[];
|
|
176
202
|
}
|
|
@@ -223,7 +249,38 @@ export declare class JobLedger {
|
|
|
223
249
|
job: LedgerJob;
|
|
224
250
|
attempt: LedgerAttempt;
|
|
225
251
|
} | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* The origin stopped waiting on the job's current round while it was still running. The round itself is unchanged:
|
|
254
|
+
* the workbench lists the job as abnormal until a re-query finds the round ended.
|
|
255
|
+
*/
|
|
256
|
+
unwatch(originSessionId: string, jobId: string, reason: string): LedgerAttempt;
|
|
226
257
|
acceptance(originSessionId: string, jobId: string, input: Omit<BusinessAcceptance, 'recordedAt'>): BusinessAcceptance;
|
|
258
|
+
/** A process request changed. The request itself is stored by the gateway; this puts it on the job's timeline. */
|
|
259
|
+
processEvent(jobId: string, attemptId: string, type: string, data: unknown): void;
|
|
260
|
+
/** The originator waits on the job again, so it is no longer listed as abandoned. */
|
|
261
|
+
rewatch(originSessionId: string, jobId: string): LedgerAttempt;
|
|
262
|
+
ticket(originSessionId: string, jobId: string): Ticket;
|
|
263
|
+
/**
|
|
264
|
+
* One ticket operation: it gets the job's ticket (undefined before one is opened) to change in place and reports
|
|
265
|
+
* its changes, each appended as a `ticket.*` event stamped with `caller` (attempt, session, QA job).
|
|
266
|
+
*/
|
|
267
|
+
changeTicket(originSessionId: string, jobId: string, operation: (ticket: Ticket | undefined) => {
|
|
268
|
+
ticket: Ticket;
|
|
269
|
+
changes: TicketChange[];
|
|
270
|
+
}, caller?: {
|
|
271
|
+
attemptId?: string;
|
|
272
|
+
[key: string]: unknown;
|
|
273
|
+
}): Ticket;
|
|
274
|
+
/**
|
|
275
|
+
* Trusted adapter use only: the origin of the job whose current, unfinished attempt `attemptId` is. When the
|
|
276
|
+
* host reported which session runs the attempt, the caller must be that session.
|
|
277
|
+
*/
|
|
278
|
+
executorOrigin(jobId: string, attemptId: string, sessionId: string): string;
|
|
279
|
+
/** Trusted adapter use only: the job's current attempt and the session the host reported for it, for a caller that names only the job. */
|
|
280
|
+
currentAttempt(jobId: string): {
|
|
281
|
+
attemptId: string;
|
|
282
|
+
sessionId?: string;
|
|
283
|
+
};
|
|
227
284
|
/** Each old Task gets one legacy Job; matching context IDs never merge jobs. */
|
|
228
285
|
migrateLegacy(records: LegacyLedgerRecord[]): Array<{
|
|
229
286
|
remote: string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/** Durable Job/Attempt facts. This module does not execute or schedule work. */
|
|
2
2
|
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { TicketError } from './ticket.js';
|
|
3
4
|
const terminal = new Set(['completed', 'failed', 'canceled', 'rejected']);
|
|
4
5
|
const statuses = new Set(['not_started', 'submitted', 'working', 'input_required', 'auth_required', 'completed', 'failed', 'canceled', 'rejected', 'unknown']);
|
|
5
6
|
const clone = (value) => structuredClone(value);
|
|
6
7
|
const now = () => new Date().toISOString();
|
|
8
|
+
const resultContent = (result) => canonical({ resultSummary: result.resultSummary,
|
|
9
|
+
structuredResultRef: result.structuredResultRef, artifactLinks: result.artifactLinks, resultArtifacts: result.resultArtifacts ?? [] });
|
|
7
10
|
function nonempty(value, name) {
|
|
8
11
|
if (typeof value !== 'string' || !value.trim())
|
|
9
12
|
throw new Error(`${name} must be a nonempty string`);
|
|
@@ -46,10 +49,10 @@ export class JobLedger {
|
|
|
46
49
|
if (initial.version !== 1 || !initial.sourceId || !initial.jobs || !initial.attempts || !initial.requests || !Array.isArray(initial.events)
|
|
47
50
|
|| !Number.isSafeInteger(initial.nextSequence) || !initial.acceptances)
|
|
48
51
|
throw new Error('Invalid execution ledger state');
|
|
49
|
-
this.state = clone(initial);
|
|
52
|
+
this.state = { ...clone(initial), tickets: clone(initial.tickets ?? {}) };
|
|
50
53
|
}
|
|
51
54
|
else {
|
|
52
|
-
this.state = { version: 1, sourceId: randomUUID(), jobs: {}, attempts: {}, requests: {}, events: [], nextSequence: 1, acceptances: {} };
|
|
55
|
+
this.state = { version: 1, sourceId: randomUUID(), jobs: {}, attempts: {}, requests: {}, events: [], nextSequence: 1, acceptances: {}, tickets: {} };
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
snapshot() { return clone(this.state); }
|
|
@@ -174,7 +177,8 @@ export class JobLedger {
|
|
|
174
177
|
...(input.targetSnapshot.roleId ? { roleId: input.targetSnapshot.roleId } : {}),
|
|
175
178
|
...(input.parentJobRef ? { parentJobRef: clone(input.parentJobRef), parentAttemptId: input.parentAttemptId } : {}),
|
|
176
179
|
...(input.purpose ? { purpose: input.purpose } : {}), ...(input.resultRevision ? { resultRevision: input.resultRevision } : {}),
|
|
177
|
-
...(input.replacesJobRef ? { replacesJobRef: clone(input.replacesJobRef) } : {})
|
|
180
|
+
...(input.replacesJobRef ? { replacesJobRef: clone(input.replacesJobRef) } : {}),
|
|
181
|
+
...(input.initiatedBy ? { initiatedBy: clone(input.initiatedBy) } : {}) };
|
|
178
182
|
state.jobs[job.jobId] = job;
|
|
179
183
|
}
|
|
180
184
|
const attempt = { attemptId: randomUUID(), jobId: job.jobId, operation, requestDigest: digest,
|
|
@@ -183,12 +187,13 @@ export class JobLedger {
|
|
|
183
187
|
connectionId: input.targetSnapshot.connectionId, connectionVersion: input.targetSnapshot.connectionVersion,
|
|
184
188
|
provider: input.targetSnapshot.provider ?? 'a2a', targetSnapshot: clone(input.targetSnapshot), input: clone(input.input),
|
|
185
189
|
...(job.currentAttemptId ? { previousAttemptId: job.currentAttemptId } : {}), submissionStatus: 'prepared',
|
|
186
|
-
executionStatus: 'not_started', stale: false, createdAt: timestamp, updatedAt: timestamp
|
|
190
|
+
executionStatus: 'not_started', stale: false, createdAt: timestamp, updatedAt: timestamp,
|
|
191
|
+
...(input.initiatedBy ? { initiatedBy: clone(input.initiatedBy) } : {}) };
|
|
187
192
|
state.attempts[attempt.attemptId] = attempt;
|
|
188
193
|
job.currentAttemptId = attempt.attemptId;
|
|
189
194
|
if (requestKey)
|
|
190
195
|
state.requests[requestKey] = { digest, jobId: job.jobId, attemptId: attempt.attemptId };
|
|
191
|
-
this.event(state, job, attempt.attemptId, input.jobId ? 'attempt.prepared' : 'job.created', { operation });
|
|
196
|
+
this.event(state, job, attempt.attemptId, input.jobId ? 'attempt.prepared' : 'job.created', { operation, ...(input.initiatedBy ? { initiatedBy: input.initiatedBy } : {}) });
|
|
192
197
|
return { job, attempt, idempotent: false };
|
|
193
198
|
});
|
|
194
199
|
}
|
|
@@ -254,7 +259,7 @@ export class JobLedger {
|
|
|
254
259
|
});
|
|
255
260
|
}
|
|
256
261
|
applyObservation(attempt, input) {
|
|
257
|
-
const timestamp = input.checkedAt ?? now();
|
|
262
|
+
const timestamp = input.checkedAt ?? now(), completedBefore = attempt.executionStatus === 'completed';
|
|
258
263
|
let conflict = false;
|
|
259
264
|
if (input.executionStatus !== undefined) {
|
|
260
265
|
if (!statuses.has(input.executionStatus))
|
|
@@ -278,14 +283,41 @@ export class JobLedger {
|
|
|
278
283
|
attempt.checkedAt = timestamp;
|
|
279
284
|
attempt.updatedAt = timestamp;
|
|
280
285
|
if (!conflict && (input.resultSummary !== undefined || input.structuredResultRef !== undefined || input.resultDigest !== undefined
|
|
281
|
-
|| input.artifactLinks !== undefined || input.resultAvailable !== undefined || input.resultRevision !== undefined)) {
|
|
286
|
+
|| input.artifactLinks !== undefined || input.resultArtifacts !== undefined || input.resultAvailable !== undefined || input.resultRevision !== undefined)) {
|
|
282
287
|
const previous = attempt.result;
|
|
283
|
-
|
|
288
|
+
const result = { ...previous, attemptId: attempt.attemptId, artifactLinks: clone(input.artifactLinks ?? previous?.artifactLinks ?? []),
|
|
284
289
|
resultAvailable: input.resultAvailable ?? previous?.resultAvailable ?? true, observedAt: timestamp,
|
|
285
290
|
...(input.resultSummary !== undefined ? { resultSummary: input.resultSummary } : {}),
|
|
286
291
|
...(input.structuredResultRef !== undefined ? { structuredResultRef: clone(input.structuredResultRef) } : {}),
|
|
292
|
+
...(input.resultArtifacts !== undefined ? { resultArtifacts: clone(input.resultArtifacts) } : {}),
|
|
287
293
|
...(input.resultDigest !== undefined ? { resultDigest: input.resultDigest } : {}),
|
|
288
294
|
...(input.resultRevision !== undefined ? { resultRevision: input.resultRevision } : {}) };
|
|
295
|
+
if (attempt.executionStatus === 'completed' && result.resultAvailable) {
|
|
296
|
+
if (input.resultRevision !== undefined)
|
|
297
|
+
nonempty(input.resultRevision, 'resultRevision');
|
|
298
|
+
const content = resultContent(result), unchanged = previous && resultContent(previous) === content;
|
|
299
|
+
result.resultDigest = input.resultDigest ?? (unchanged ? previous.resultDigest : undefined)
|
|
300
|
+
?? createHash('sha256').update(content).digest('hex');
|
|
301
|
+
nonempty(result.resultDigest, 'resultDigest');
|
|
302
|
+
const history = attempt.resultHistory ??= [];
|
|
303
|
+
if (!history.length && completedBefore && previous?.resultRevision && previous.resultDigest)
|
|
304
|
+
history.push(clone(previous));
|
|
305
|
+
result.resultRevision = input.resultRevision ?? (unchanged && previous.resultDigest === result.resultDigest ? previous.resultRevision : undefined);
|
|
306
|
+
if (!result.resultRevision) {
|
|
307
|
+
let sequence = history.length + 1;
|
|
308
|
+
while (history.some(item => item.resultRevision === `result-${sequence}`))
|
|
309
|
+
sequence++;
|
|
310
|
+
result.resultRevision = `result-${sequence}`;
|
|
311
|
+
}
|
|
312
|
+
nonempty(result.resultRevision, 'resultRevision');
|
|
313
|
+
const existing = history.find(item => item.resultRevision === result.resultRevision);
|
|
314
|
+
if (existing && (existing.resultDigest !== result.resultDigest || resultContent(existing) !== content
|
|
315
|
+
|| previous?.resultRevision !== result.resultRevision))
|
|
316
|
+
throw new Error('A result revision cannot be overwritten or reused after supersession');
|
|
317
|
+
if (!existing)
|
|
318
|
+
history.push(clone(result));
|
|
319
|
+
}
|
|
320
|
+
attempt.result = result;
|
|
289
321
|
}
|
|
290
322
|
return conflict;
|
|
291
323
|
}
|
|
@@ -299,7 +331,8 @@ export class JobLedger {
|
|
|
299
331
|
const relevant = (item) => ({ status: item.executionStatus, providerState: item.providerState, phase: item.phase, stale: item.stale,
|
|
300
332
|
diagnostic: item.diagnostic, result: item.result ? { ...item.result, observedAt: undefined } : undefined });
|
|
301
333
|
if (canonical(relevant(previous)) !== canonical(relevant(attempt)))
|
|
302
|
-
this.event(state, state.jobs[attempt.jobId], attemptId, conflict ? 'attempt.observation_conflict' : previous.executionStatus !== attempt.executionStatus ? 'attempt.state_changed' : 'attempt.result_updated'
|
|
334
|
+
this.event(state, state.jobs[attempt.jobId], attemptId, conflict ? 'attempt.observation_conflict' : previous.executionStatus !== attempt.executionStatus ? 'attempt.state_changed' : 'attempt.result_updated', attempt.result?.resultRevision && previous.result?.resultRevision !== attempt.result.resultRevision
|
|
335
|
+
? { resultRevision: attempt.result.resultRevision, resultDigest: attempt.result.resultDigest, previousResultRevision: previous.result?.resultRevision } : undefined);
|
|
303
336
|
return attempt;
|
|
304
337
|
});
|
|
305
338
|
}
|
|
@@ -318,11 +351,12 @@ export class JobLedger {
|
|
|
318
351
|
get(originSessionId, jobId) {
|
|
319
352
|
const job = this.job(this.state, originSessionId, jobId), current = this.state.attempts[job.currentAttemptId];
|
|
320
353
|
const history = this.state.acceptances[jobId] ?? [];
|
|
321
|
-
const acceptance = [...history].reverse().find(item => item.attemptId === current.attemptId
|
|
354
|
+
const acceptance = current.executionStatus === 'completed' && current.result?.resultAvailable && [...history].reverse().find(item => item.attemptId === current.attemptId
|
|
322
355
|
&& item.resultRevision === current.result?.resultRevision && item.resultDigest === current.result?.resultDigest);
|
|
323
356
|
return clone({ ...job, attempts: Object.values(this.state.attempts).filter(item => item.jobId === jobId),
|
|
324
357
|
children: Object.values(this.state.jobs).filter(item => item.parentJobRef?.sourceId === this.sourceId && item.parentJobRef.jobId === jobId),
|
|
325
|
-
...(current.result ? { result: current.result } : {}),
|
|
358
|
+
...(current.result ? { result: current.result } : {}), resultHistory: current.resultHistory ?? [],
|
|
359
|
+
...(acceptance ? { businessAcceptance: acceptance } : {}), acceptanceHistory: history });
|
|
326
360
|
}
|
|
327
361
|
list(originSessionId) {
|
|
328
362
|
return Object.values(this.state.jobs).filter(job => job.originSessionId === originSessionId).map(job => this.get(originSessionId, job.jobId));
|
|
@@ -340,11 +374,26 @@ export class JobLedger {
|
|
|
340
374
|
&& Object.entries(ref).every(([key, value]) => value === undefined || item.backendRunRef?.[key] === value));
|
|
341
375
|
return attempt ? clone({ job: this.state.jobs[attempt.jobId], attempt }) : undefined;
|
|
342
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* The origin stopped waiting on the job's current round while it was still running. The round itself is unchanged:
|
|
379
|
+
* the workbench lists the job as abnormal until a re-query finds the round ended.
|
|
380
|
+
*/
|
|
381
|
+
unwatch(originSessionId, jobId, reason) {
|
|
382
|
+
return this.mutate(state => {
|
|
383
|
+
const job = this.job(state, originSessionId, jobId), attempt = this.attempt(state, job.currentAttemptId);
|
|
384
|
+
nonempty(reason, 'reason');
|
|
385
|
+
if (!terminal.has(attempt.executionStatus) && !attempt.unwatched) {
|
|
386
|
+
attempt.unwatched = { at: now(), reason };
|
|
387
|
+
this.event(state, job, attempt.attemptId, 'attempt.unwatched', { reason });
|
|
388
|
+
}
|
|
389
|
+
return clone(attempt);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
343
392
|
acceptance(originSessionId, jobId, input) {
|
|
344
393
|
return this.mutate(state => {
|
|
345
394
|
const job = this.job(state, originSessionId, jobId), attempt = this.attempt(state, input.attemptId);
|
|
346
|
-
if (attempt.jobId !== jobId || attempt.executionStatus !== 'completed')
|
|
347
|
-
throw new Error('Acceptance must reference
|
|
395
|
+
if (attempt.jobId !== jobId || attempt.attemptId !== job.currentAttemptId || attempt.executionStatus !== 'completed' || !attempt.result?.resultAvailable)
|
|
396
|
+
throw new Error('Acceptance must reference the current completed attempt with an available result');
|
|
348
397
|
nonempty(input.resultRevision, 'resultRevision');
|
|
349
398
|
nonempty(input.resultDigest, 'resultDigest');
|
|
350
399
|
if (attempt.result?.resultRevision !== input.resultRevision || attempt.result?.resultDigest !== input.resultDigest)
|
|
@@ -357,6 +406,66 @@ export class JobLedger {
|
|
|
357
406
|
return record;
|
|
358
407
|
});
|
|
359
408
|
}
|
|
409
|
+
/** A process request changed. The request itself is stored by the gateway; this puts it on the job's timeline. */
|
|
410
|
+
processEvent(jobId, attemptId, type, data) {
|
|
411
|
+
this.mutate(state => { this.event(state, state.jobs[jobId], attemptId, type, data); });
|
|
412
|
+
}
|
|
413
|
+
/** The originator waits on the job again, so it is no longer listed as abandoned. */
|
|
414
|
+
rewatch(originSessionId, jobId) {
|
|
415
|
+
return this.mutate(state => {
|
|
416
|
+
const job = this.job(state, originSessionId, jobId), attempt = this.attempt(state, job.currentAttemptId);
|
|
417
|
+
if (attempt.unwatched) {
|
|
418
|
+
delete attempt.unwatched;
|
|
419
|
+
this.event(state, job, attempt.attemptId, 'attempt.rewatched', {});
|
|
420
|
+
}
|
|
421
|
+
return clone(attempt);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
ticket(originSessionId, jobId) {
|
|
425
|
+
this.job(this.state, originSessionId, jobId);
|
|
426
|
+
const ticket = this.state.tickets[jobId];
|
|
427
|
+
if (!ticket)
|
|
428
|
+
throw new TicketError('这个任务还没有任务单');
|
|
429
|
+
return clone(ticket);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* One ticket operation: it gets the job's ticket (undefined before one is opened) to change in place and reports
|
|
433
|
+
* its changes, each appended as a `ticket.*` event stamped with `caller` (attempt, session, QA job).
|
|
434
|
+
*/
|
|
435
|
+
changeTicket(originSessionId, jobId, operation, caller = {}) {
|
|
436
|
+
return this.mutate(state => {
|
|
437
|
+
const job = this.job(state, originSessionId, jobId), tickets = state.tickets ??= {};
|
|
438
|
+
const { ticket, changes } = operation(tickets[jobId]);
|
|
439
|
+
tickets[jobId] = ticket;
|
|
440
|
+
for (const change of changes)
|
|
441
|
+
this.event(state, job, caller.attemptId, change.type, { ...change.data, ...caller });
|
|
442
|
+
return ticket;
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Trusted adapter use only: the origin of the job whose current, unfinished attempt `attemptId` is. When the
|
|
447
|
+
* host reported which session runs the attempt, the caller must be that session.
|
|
448
|
+
*/
|
|
449
|
+
executorOrigin(jobId, attemptId, sessionId) {
|
|
450
|
+
const job = Object.hasOwn(this.state.jobs, jobId) ? this.state.jobs[jobId] : undefined;
|
|
451
|
+
const attempt = Object.hasOwn(this.state.attempts, attemptId) ? this.state.attempts[attemptId] : undefined;
|
|
452
|
+
if (!job || !attempt || attempt.jobId !== jobId || job.currentAttemptId !== attemptId)
|
|
453
|
+
throw new TicketError('这一轮执行不是该任务的当前轮次');
|
|
454
|
+
if (terminal.has(attempt.executionStatus))
|
|
455
|
+
throw new TicketError('这一轮执行已经结束,不能再处理任务单');
|
|
456
|
+
const recorded = attempt.backendRunRef?.sessionId;
|
|
457
|
+
if (recorded !== undefined && recorded !== sessionId)
|
|
458
|
+
throw new TicketError('调用的会话不是执行这一轮的会话');
|
|
459
|
+
return job.originSessionId;
|
|
460
|
+
}
|
|
461
|
+
/** Trusted adapter use only: the job's current attempt and the session the host reported for it, for a caller that names only the job. */
|
|
462
|
+
currentAttempt(jobId) {
|
|
463
|
+
const job = Object.hasOwn(this.state.jobs, jobId) ? this.state.jobs[jobId] : undefined;
|
|
464
|
+
const attempt = job && Object.hasOwn(this.state.attempts, job.currentAttemptId) ? this.state.attempts[job.currentAttemptId] : undefined;
|
|
465
|
+
if (!attempt)
|
|
466
|
+
throw new TicketError('没有这个任务');
|
|
467
|
+
return { attemptId: attempt.attemptId, ...(attempt.backendRunRef?.sessionId !== undefined ? { sessionId: attempt.backendRunRef.sessionId } : {}) };
|
|
468
|
+
}
|
|
360
469
|
/** Each old Task gets one legacy Job; matching context IDs never merge jobs. */
|
|
361
470
|
migrateLegacy(records) {
|
|
362
471
|
return this.mutate(state => records.map(record => {
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type HumanReviewRequest } from './human-review.js';
|
|
2
3
|
export declare const pptDeliveryInputSchema: z.ZodObject<{
|
|
3
4
|
projectDirectory: z.ZodString;
|
|
4
5
|
projectName: z.ZodString;
|
|
5
6
|
instructions: z.ZodOptional<z.ZodString>;
|
|
6
|
-
slideCount: z.
|
|
7
|
+
slideCount: z.ZodOptional<z.ZodNumber>;
|
|
7
8
|
revisionRequest: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, z.core.$strict>;
|
|
9
10
|
export type PptDeliveryInput = z.infer<typeof pptDeliveryInputSchema>;
|
|
11
|
+
export declare const pptDeliveryRecoveryInputSchema: z.ZodObject<{
|
|
12
|
+
recoveryMode: z.ZodLiteral<"review_only">;
|
|
13
|
+
reviewTargetId: z.ZodString;
|
|
14
|
+
sourceSnapshotDirectory: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type PptDeliveryRecoveryInput = z.infer<typeof pptDeliveryRecoveryInputSchema>;
|
|
10
17
|
export declare const pptDeliveryPolicySchema: z.ZodObject<{
|
|
11
18
|
version: z.ZodDefault<z.ZodString>;
|
|
12
19
|
workspaceRoot: z.ZodString;
|
|
@@ -26,11 +33,17 @@ export declare const pptDeliveryPolicySchema: z.ZodObject<{
|
|
|
26
33
|
runtimeDocument: z.ZodString;
|
|
27
34
|
designSkill: z.ZodString;
|
|
28
35
|
pythonExecutable: z.ZodString;
|
|
36
|
+
roleSkills: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
profilePath: z.ZodString;
|
|
38
|
+
cacheRoot: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>;
|
|
29
40
|
nodeExecutable: z.ZodOptional<z.ZodString>;
|
|
30
41
|
nodeModuleRoot: z.ZodOptional<z.ZodString>;
|
|
31
42
|
maxRevisionRounds: z.ZodDefault<z.ZodNumber>;
|
|
32
43
|
maxExecutionRetries: z.ZodDefault<z.ZodNumber>;
|
|
33
44
|
maxDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
requireHumanReview: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
humanReviewerId: z.ZodDefault<z.ZodString>;
|
|
34
47
|
httpTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
35
48
|
}, z.core.$strict>;
|
|
36
49
|
export type PptDeliveryPolicy = z.infer<typeof pptDeliveryPolicySchema>;
|
|
@@ -169,6 +182,8 @@ export interface PptDeliveryRun {
|
|
|
169
182
|
};
|
|
170
183
|
resultSummary?: string;
|
|
171
184
|
deliveryReceipt?: Record<string, unknown>;
|
|
185
|
+
/** One parent-task skill lock shared by production, review, retries and recovery. */
|
|
186
|
+
roleSkillLockPath?: string;
|
|
172
187
|
parentUpdatePending?: PptDeliveryParentUpdate;
|
|
173
188
|
projectSnapshot?: {
|
|
174
189
|
gitHead: string;
|
|
@@ -177,6 +192,17 @@ export interface PptDeliveryRun {
|
|
|
177
192
|
};
|
|
178
193
|
scriptDigest?: string;
|
|
179
194
|
sourceManifestDigest?: string;
|
|
195
|
+
scriptRevision?: number;
|
|
196
|
+
humanReviews?: HumanReviewRequest[];
|
|
197
|
+
humanWaitStartedAt?: string;
|
|
198
|
+
humanWaitingMs?: number;
|
|
199
|
+
humanRevisionRounds?: number;
|
|
200
|
+
summaryRevisionPending?: {
|
|
201
|
+
reviewId: string;
|
|
202
|
+
authorJobId: string;
|
|
203
|
+
authorAttemptId: string;
|
|
204
|
+
reasons: string[];
|
|
205
|
+
};
|
|
180
206
|
publicationCheckedAt?: string;
|
|
181
207
|
recovery?: {
|
|
182
208
|
fromAttemptId: string;
|
|
@@ -187,6 +213,11 @@ export interface PptDeliveryRun {
|
|
|
187
213
|
attemptId: string;
|
|
188
214
|
}[];
|
|
189
215
|
validationCheckedAt?: string;
|
|
216
|
+
mode?: 'review_only';
|
|
217
|
+
artifactDigest?: string;
|
|
218
|
+
reviewTargetId?: string;
|
|
219
|
+
sourceSnapshotDirectory?: string;
|
|
220
|
+
previousElapsedMs?: number;
|
|
190
221
|
};
|
|
191
222
|
}
|
|
192
223
|
export interface PptDeliveryParentUpdate {
|
|
@@ -211,9 +242,11 @@ export interface PptDeliveryAdapter {
|
|
|
211
242
|
preflightPublication?(run: PptDeliveryRun): Promise<void>;
|
|
212
243
|
now?(): number;
|
|
213
244
|
}
|
|
214
|
-
export declare
|
|
245
|
+
export declare const scriptRevisionName: (run: PptDeliveryRun) => string;
|
|
246
|
+
export declare const scriptDirectory: (run: PptDeliveryRun) => string;
|
|
247
|
+
export declare function assertPptDeliveryRecoverable(previous: PptDeliveryRun, input?: PptDeliveryRecoveryInput): void;
|
|
215
248
|
/** Explicit new parent execution round at a verified review checkpoint; old rounds remain immutable. */
|
|
216
|
-
export declare function recoverPptDeliveryRun(previous: PptDeliveryRun, attemptId: string): Promise<PptDeliveryRun>;
|
|
249
|
+
export declare function recoverPptDeliveryRun(previous: PptDeliveryRun, attemptId: string, input?: PptDeliveryRecoveryInput): Promise<PptDeliveryRun>;
|
|
217
250
|
export declare function createPptDeliveryRun(input: {
|
|
218
251
|
sourceId: string;
|
|
219
252
|
jobId: string;
|