@tequila99/githuman 0.11.2 → 0.13.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/README.md +74 -2
- package/dist/cli/commands/mcp.js +112 -0
- package/dist/cli/commands/pi-acp.js +21 -0
- package/dist/cli/config.js +10 -1
- package/dist/cli/index.js +19 -8
- package/dist/cli/server-runtime.js +5 -0
- package/dist/server/adapters/agents/artifact-permission.js +88 -0
- package/dist/server/adapters/pi-acp/agent.js +98 -0
- package/dist/server/adapters/pi-acp/compatibility.js +57 -0
- package/dist/server/adapters/pi-acp/control.js +76 -0
- package/dist/server/adapters/pi-acp/errors.js +17 -0
- package/dist/server/adapters/pi-acp/extension.js +255 -0
- package/dist/server/adapters/pi-acp/launch.js +16 -0
- package/dist/server/adapters/pi-acp/mcp.js +153 -0
- package/dist/server/adapters/pi-acp/process.js +199 -0
- package/dist/server/adapters/pi-acp/session.js +409 -0
- package/dist/server/adapters/pi-acp/vendor/LICENSE +21 -0
- package/dist/server/adapters/pi-acp/vendor/README.md +29 -0
- package/dist/server/adapters/pi-acp/vendor/prompt.js +56 -0
- package/dist/server/app.js +95 -5
- package/dist/server/config/agents.js +4 -6
- package/dist/server/db/artifact-graph-migrations.js +56 -0
- package/dist/server/db/artifact-migrations.js +70 -0
- package/dist/server/db/artifact-review-migrations.js +24 -0
- package/dist/server/db/artifact-search-migrations.js +31 -0
- package/dist/server/db/artifact-validation-migrations.js +70 -0
- package/dist/server/db/index.js +3 -0
- package/dist/server/db/migrations.js +10 -0
- package/dist/server/db/sqlite-error.js +15 -0
- package/dist/server/db/transaction.js +40 -0
- package/dist/server/errors/artifacts.js +28 -0
- package/dist/server/errors/database.js +2 -0
- package/dist/server/hooks/access/local-request.js +5 -0
- package/dist/server/hooks/access/require-access.js +13 -2
- package/dist/server/repositories/artifact-catalog.repo.js +283 -0
- package/dist/server/repositories/artifact-files.repo.js +181 -0
- package/dist/server/repositories/artifact-graph.repo.js +50 -0
- package/dist/server/repositories/artifact-search.repo.js +192 -0
- package/dist/server/repositories/artifact-transition.repo.js +85 -0
- package/dist/server/repositories/artifact-validation.repo.js +157 -0
- package/dist/server/repositories/notes-catalog.repo.js +2 -10
- package/dist/server/repositories/task.repo.js +114 -0
- package/dist/server/routes/agent.js +8 -1
- package/dist/server/routes/artifact-actions.js +129 -0
- package/dist/server/routes/artifact-agent.js +199 -0
- package/dist/server/routes/artifact-definitions.js +163 -0
- package/dist/server/routes/artifact-transitions.js +80 -0
- package/dist/server/routes/artifacts.js +111 -0
- package/dist/server/routes/events.js +5 -1
- package/dist/server/services/agent/agent-session.js +180 -10
- package/dist/server/services/agent/context-builder.js +30 -2
- package/dist/server/services/agent/session-registry.js +136 -10
- package/dist/server/services/agent/turn-task-context.js +1 -0
- package/dist/server/services/artifact-authorization.service.js +199 -0
- package/dist/server/services/artifact-definition.service.js +96 -0
- package/dist/server/services/artifact-export.service.js +44 -0
- package/dist/server/services/artifact-graph-validation.js +541 -0
- package/dist/server/services/artifact-graph.service.js +81 -0
- package/dist/server/services/artifact-lifecycle.service.js +431 -0
- package/dist/server/services/artifact-maintenance.service.js +55 -0
- package/dist/server/services/artifact-search.service.js +331 -0
- package/dist/server/services/artifact-storage.service.js +646 -0
- package/dist/server/services/artifact-transition.service.js +608 -0
- package/dist/server/services/artifact-type.service.js +74 -0
- package/dist/server/services/artifact-validation-jobs.service.js +848 -0
- package/dist/server/services/device-connections.js +9 -1
- package/dist/server/services/review.service.js +6 -5
- package/dist/server/services/task.service.js +225 -0
- package/dist/server/utils/artifact-actor.js +13 -0
- package/dist/server/utils/artifact-page.js +42 -0
- package/dist/server/utils/take-within-bytes.js +16 -0
- package/dist/server/utils/text.js +7 -0
- package/dist/shared/agents/schemas.js +30 -0
- package/dist/shared/app/storage-constants.js +2 -0
- package/dist/shared/artifact-tools/descriptions.js +17 -0
- package/dist/shared/artifact-tools/instructions.js +14 -0
- package/dist/shared/artifact-tools/schemas.js +124 -0
- package/dist/shared/artifact-transitions/constants.js +21 -0
- package/dist/shared/artifact-transitions/schemas.js +111 -0
- package/dist/shared/artifact-transitions/transitions.js +61 -0
- package/dist/shared/artifact-transitions/types.js +1 -0
- package/dist/shared/artifacts/constants.js +34 -0
- package/dist/shared/artifacts/mcp-constants.js +24 -0
- package/dist/shared/artifacts/normalize.js +9 -0
- package/dist/shared/artifacts/schemas.js +874 -0
- package/dist/shared/artifacts/search.js +101 -0
- package/dist/shared/artifacts/types.js +1 -0
- package/dist/shared/events/schemas.js +1 -1
- package/dist/shared/events/types.js +1 -0
- package/dist/shared/tasks/schemas.js +261 -0
- package/dist/shared/tasks/types.js +1 -0
- package/dist/shared/utils/artifact-body.js +10 -0
- package/dist/shared/utils/canonical-json.js +22 -0
- package/dist/shared/utils/is-safe-prefixed-filename.js +10 -0
- package/dist/shared/utils/is-uuid.js +4 -2
- package/dist/shared/utils/is-valid-artifact-type-id.js +9 -0
- package/dist/shared/utils/is-valid-filename-prefix.js +13 -0
- package/dist/web/assets/AccessPage-D9xfFUBC.js +1 -0
- package/dist/web/assets/AddButton-DKNKmS1i.js +4 -0
- package/dist/web/assets/AddToAgentButton-wC1dzbDE.js +1 -0
- package/dist/web/assets/AppPage-Cozv2vqG.js +1 -0
- package/dist/web/assets/ArtifactsPage-IHUO7SbH.js +2 -0
- package/dist/web/assets/ArtifactsPage-nRD9XiRm.css +1 -0
- package/dist/web/assets/CancelButton-mkxRHwoZ.js +1 -0
- package/dist/web/assets/ClosePopup-Bd5a-Lu_.js +1 -0
- package/dist/web/assets/CreateButton-zCmb7snC.js +1 -0
- package/dist/web/assets/CreateReviewFabButton-D58IHr36.js +1 -0
- package/dist/web/assets/DialogHeader-BVrtb0Ri.js +1 -0
- package/dist/web/assets/DialogHeader-CPL9OtDV.css +1 -0
- package/dist/web/assets/{ErrorNotFound-DucDzOUJ.js → ErrorNotFound-fXS367lZ.js} +1 -1
- package/dist/web/assets/{IndexPage-D5PvyGrX.css → IndexPage-5V5GLtgi.css} +1 -1
- package/dist/web/assets/IndexPage-BJ1EQdlT.js +1 -0
- package/dist/web/assets/MainLayout-C3Ie5yOo.css +1 -0
- package/dist/web/assets/MainLayout-CeogGMHH.js +7 -0
- package/dist/web/assets/{NoteVisualEditor-CawpxEFB.css → NoteVisualEditor-DE4ACTRJ.css} +1 -1
- package/dist/web/assets/NoteVisualEditor-DqAZZig1.js +1054 -0
- package/dist/web/assets/NotesPage-C_eoCUl7.css +1 -0
- package/dist/web/assets/NotesPage-DXgI-kwN.js +4 -0
- package/dist/web/assets/{PdfPreview-rlkcqoMF.js → PdfPreview-ByeBjQMQ.js} +2 -2
- package/dist/web/assets/ProjectFilePage-DV1anYfN.js +1 -0
- package/dist/web/assets/QBtn-V3VXtJXi.js +1 -0
- package/dist/web/assets/QFab-DJhLqo9i.js +1 -0
- package/dist/web/assets/{QForm-Be8-ucuJ.js → QForm-ClpSneeD.js} +1 -1
- package/dist/web/assets/QInput-BnqLJGXl.js +1 -0
- package/dist/web/assets/QScrollArea-qf2G1s2r.js +1 -0
- package/dist/web/assets/QSeparator-B8uLaDiI.js +1 -0
- package/dist/web/assets/QSpace-CVp0CPR_.js +1 -0
- package/dist/web/assets/QSplitter-K2LjbupZ.js +1 -0
- package/dist/web/assets/QTabs-Bl_rIz4_.js +1 -0
- package/dist/web/assets/QVirtualScroll-BeEkuL6x.js +1 -0
- package/dist/web/assets/ReviewDetailPage-BgxcsTqY.css +1 -0
- package/dist/web/assets/ReviewDetailPage-CL4Dmz0L.js +1 -0
- package/dist/web/assets/ReviewsPage-BPJFTulG.js +1 -0
- package/dist/web/assets/SaveButton-D1q2suzR.js +3 -0
- package/dist/web/assets/SaveButton-Vtjvcbt0.css +1 -0
- package/dist/web/assets/SearchInput-DapVXrFj.js +1 -0
- package/dist/web/assets/StatusSwitcher-BtbSIr5q.js +1 -0
- package/dist/web/assets/{StatusSwitcher-D6i8_OfR.css → StatusSwitcher-DaE1ufAA.css} +1 -1
- package/dist/web/assets/TagFilterField-CPl-BxtL.js +1 -0
- package/dist/web/assets/TagFilterField-DjUH0m3_.css +1 -0
- package/dist/web/assets/{TerminalView-D4elkzN4.js → TerminalView-B56cEx8g.js} +12 -12
- package/dist/web/assets/{TerminalView-617DZuPt.css → TerminalView-BCeke4xd.css} +1 -1
- package/dist/web/assets/{abnfDiagram-O67JEVCF-Cugru96L.js → abnfDiagram-O67JEVCF-D_6l0gCA.js} +1 -1
- package/dist/web/assets/{access-store-Cdg8oRAM.js → access-store-CwkOl71l.js} +1 -1
- package/dist/web/assets/{agent-store-D_W7iD_B.js → agent-store-Cs-hu1v1.js} +5 -5
- package/dist/web/assets/architecture-7GRP2DOG-KT2-_RA5.js +1 -0
- package/dist/web/assets/{architectureDiagram-NJMV4G6O-7rMsE4Wt.js → architectureDiagram-NJMV4G6O-BFgjp9nL.js} +1 -1
- package/dist/web/assets/{blockDiagram-BEXU5L5S-BvSnwUrI.js → blockDiagram-BEXU5L5S-BWfbJk26.js} +1 -1
- package/dist/web/assets/{c4Diagram-YGBWAQC7-CgmQlCVx.js → c4Diagram-YGBWAQC7-oIqgOwQa.js} +1 -1
- package/dist/web/assets/channel-CAhty-fl.js +1 -0
- package/dist/web/assets/{chunk-3FUC2YCW-_i8udThz.js → chunk-3FUC2YCW-WI2pliXT.js} +1 -1
- package/dist/web/assets/{chunk-5DYCD2WN-Mhk2LlLk.js → chunk-5DYCD2WN-DYvaF8o2.js} +1 -1
- package/dist/web/assets/{chunk-742MDFTN-CDVcwgEp.js → chunk-742MDFTN-xd7B3x5h.js} +1 -1
- package/dist/web/assets/{chunk-7INBJB4K-C2c1fi9s.js → chunk-7INBJB4K-nsyx3RGB.js} +1 -1
- package/dist/web/assets/{chunk-7M6MHVWA-BeGkoIBL.js → chunk-7M6MHVWA-BxPQ9AEv.js} +1 -1
- package/dist/web/assets/{chunk-7PRAP22T-BVWTh9sT.js → chunk-7PRAP22T-CvHw2y-F.js} +1 -1
- package/dist/web/assets/{chunk-GTNCS2PH-gVhX7NZP.js → chunk-GTNCS2PH-DIfN1SOI.js} +1 -1
- package/dist/web/assets/{chunk-GWA4HPMP-BPdnIcQH.js → chunk-GWA4HPMP-2WZX1fG-.js} +1 -1
- package/dist/web/assets/{chunk-MBY4JIJT-B2VfO_06.js → chunk-MBY4JIJT-BL7akw7q.js} +1 -1
- package/dist/web/assets/{chunk-NETBCI7D-DZF_gITO.js → chunk-NETBCI7D-CQX1tY3W.js} +1 -1
- package/dist/web/assets/{chunk-O7XYJQB3-CDpBWiLq.js → chunk-O7XYJQB3-CtGXf4J6.js} +1 -1
- package/dist/web/assets/{chunk-UA2S7LBM-Iv7TSRE_.js → chunk-UA2S7LBM-C_3M_IIp.js} +1 -1
- package/dist/web/assets/{chunk-WEXAMYUT-Ce6goZ2Y.js → chunk-WEXAMYUT-6MO559WJ.js} +1 -1
- package/dist/web/assets/{chunk-Z7XXMR3K-CY6E6_Ux.js → chunk-Z7XXMR3K-CHJ55IlF.js} +1 -1
- package/dist/web/assets/{chunk-ZIGJFQKS-BLzsXZBc.js → chunk-ZIGJFQKS-533qcfPb.js} +1 -1
- package/dist/web/assets/{classDiagram-v2-NBCMYWYE-Dz0kD9P6.js → classDiagram-v2-NBCMYWYE-CFySVswx.js} +1 -1
- package/dist/web/assets/copy-code-XoEu_Yh6.js +1 -0
- package/dist/web/assets/create-DedXY-KP.js +1 -0
- package/dist/web/assets/{cynefin-OW5HDTMX-DWIx3wRm.js → cynefin-OW5HDTMX-Dfg_2VTu.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-VND7K2PF-2D80uocv.js → cynefinDiagram-VND7K2PF-DaSXiPph.js} +1 -1
- package/dist/web/assets/{dagre-6A5THRUB-BLBhukn-.js → dagre-6A5THRUB-D7d1gbRO.js} +1 -1
- package/dist/web/assets/date-snFAXn1W.js +1 -0
- package/dist/web/assets/{devices-store-BfZKPOhg.js → devices-store-DB_tWC1Q.js} +1 -1
- package/dist/web/assets/{diagram-22UHCM2B-DY8dMLZ3.js → diagram-22UHCM2B-CNuTss_x.js} +1 -1
- package/dist/web/assets/{diagram-3UASUU5V-Bf6Od1NH.js → diagram-3UASUU5V--Rt3-ARV.js} +1 -1
- package/dist/web/assets/{diagram-ATOU4E4O-CjLGcYD5.js → diagram-ATOU4E4O-BP79L-gP.js} +1 -1
- package/dist/web/assets/{diagram-CDSNMT55-gIvaVNvs.js → diagram-CDSNMT55-CRO5cocs.js} +1 -1
- package/dist/web/assets/{diagram-MLGK6HIB-VR5kiCi5.js → diagram-MLGK6HIB-Difu0Zmh.js} +1 -1
- package/dist/web/assets/{diagram-MPIPVDR6-CdAdj25I.js → diagram-MPIPVDR6-grQ3ie17.js} +1 -1
- package/dist/web/assets/diff-store-D4XiTkfi.js +93 -0
- package/dist/web/assets/{dist-CBGyhCYv.js → dist-75uxNoTf.js} +1 -1
- package/dist/web/assets/{dist-CIMEaJAX.js → dist-9rzCziV2.js} +1 -1
- package/dist/web/assets/{dist-CEl-Ko94.js → dist-B9i6cUYu.js} +1 -1
- package/dist/web/assets/{dist-yzAhvE-V.js → dist-BU-fZfEv.js} +1 -1
- package/dist/web/assets/{dist-CTd7Kuqx.js → dist-BeUB43Ur.js} +1 -1
- package/dist/web/assets/{dist-C85t5q3z.js → dist-BxIdk5Al.js} +1 -1
- package/dist/web/assets/{dist-joQDFmfy.js → dist-By534Syk.js} +1 -1
- package/dist/web/assets/{dist-C54FrSb8.js → dist-DFjLCq-0.js} +1 -1
- package/dist/web/assets/{dist-lgw4kcVA.js → dist-DNrP7O-J.js} +1 -1
- package/dist/web/assets/{dist-BU8erXQF.js → dist-Du5VPTAq.js} +1 -1
- package/dist/web/assets/{dist-DLuI1PxH.js → dist-DyBqP777.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-ZINNZB2B-irTAlMFO.js → ebnfDiagram-ZINNZB2B-DX2rcvMK.js} +1 -1
- package/dist/web/assets/{elk-276RUBZZ-Dj5ligvC.js → elk-276RUBZZ-DSHIl9hv.js} +1 -1
- package/dist/web/assets/{erDiagram-OPXOYQCR-Bvn6rbL1.js → erDiagram-OPXOYQCR-BIZVJO8N.js} +1 -1
- package/dist/web/assets/eventmodeling-NTZA5JFV-Bh_xDKx6.js +1 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-DXkIxaXL.js +1 -0
- package/dist/web/assets/{ganttDiagram-FUAMR5RP-BNGAUF5H.js → ganttDiagram-FUAMR5RP-D4kPfh4X.js} +1 -1
- package/dist/web/assets/{gitGraph-4MIJSDKK-DYSHOl72.js → gitGraph-4MIJSDKK-B41R-oAb.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-X574FWY7-BGwRHrPq.js → gitGraphDiagram-X574FWY7-xXrZiSJI.js} +1 -1
- package/dist/web/assets/i18n-Cfw_OfRR.js +1 -0
- package/dist/web/assets/icons-BIOTvmdT.js +1 -0
- package/dist/web/assets/index-B1Bugudn.js +2 -0
- package/dist/web/assets/index-BQU3KK1E.css +1 -0
- package/dist/web/assets/{info-A6RAGUB7-DNWR20pW.js → info-A6RAGUB7-CgSmK-La.js} +1 -1
- package/dist/web/assets/{infoDiagram-VRGFBTTK-BhNwJLY5.js → infoDiagram-VRGFBTTK-CDNEJ_R-.js} +1 -1
- package/dist/web/assets/{init-app-cg-B_TFN.js → init-app-C3tD3faT.js} +1 -1
- package/dist/web/assets/{is-D0waCELe.js → is-B1kBQ5Va.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-OU5B5YK6-CSkDpn64.js → ishikawaDiagram-OU5B5YK6-ZcU1IxFn.js} +1 -1
- package/dist/web/assets/{journeyDiagram-ZHPQQLJL-D2CEecC3.js → journeyDiagram-ZHPQQLJL-g-8ZRhJj.js} +1 -1
- package/dist/web/assets/{kanban-definition-PNTS6WVX-CQHlo4Hh.js → kanban-definition-PNTS6WVX-nfsfxVOE.js} +1 -1
- package/dist/web/assets/{line-C-izH1ks.js → line-BpuX_ban.js} +1 -1
- package/dist/web/assets/markdown-ogvtoQzt.js +16 -0
- package/dist/web/assets/mdi-Du7sIqtH.js +1 -0
- package/dist/web/assets/{mermaid-parser.core-CAGwq6D-.js → mermaid-parser.core-BBj_ep7Z.js} +3 -3
- package/dist/web/assets/{mermaid.core--xlI_0tK.js → mermaid.core-DP4USVSM.js} +4 -4
- package/dist/web/assets/{mindmap-definition-NLK3R4M7-BuCxhlwy.js → mindmap-definition-NLK3R4M7-C5GhUvi3.js} +1 -1
- package/dist/web/assets/{packet-AYTQ26CC-Bi7x5lJK.js → packet-AYTQ26CC-BIdb-vfg.js} +1 -1
- package/dist/web/assets/{pegDiagram-GJSIUBJH-qWzBPkCQ.js → pegDiagram-GJSIUBJH-DH-SdKj6.js} +1 -1
- package/dist/web/assets/{pie-WAS4IAKB-Di0wC4XB.js → pie-WAS4IAKB-Du3-jRjK.js} +1 -1
- package/dist/web/assets/{pieDiagram-5QR66LMP-BCDVY9q2.js → pieDiagram-5QR66LMP-CJh2ngqY.js} +1 -1
- package/dist/web/assets/pinia-BfqEuvsi.js +1 -0
- package/dist/web/assets/pinia-mdReENsc.js +1 -0
- package/dist/web/assets/preview-store-DOnSmm_C.js +2 -0
- package/dist/web/assets/{project-files-store-byqyG2ts.js → project-files-store-CHP6RYFI.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-O4NWA36T-CpFObUjT.js → quadrantDiagram-O4NWA36T-DYsSScxc.js} +1 -1
- package/dist/web/assets/{radar-RG4KPBEZ-Br8yH8rq.js → radar-RG4KPBEZ-BBjvaVVB.js} +1 -1
- package/dist/web/assets/{railroad-74A4TZTK-CACSqhA-.js → railroad-74A4TZTK-B-CRncBU.js} +1 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-D37zpoYN.js +1 -0
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-ZnMxH6Ym.js +1 -0
- package/dist/web/assets/railroad-peg-WCYAUIDC-Dg3g-VsM.js +1 -0
- package/dist/web/assets/{railroadDiagram-XR7U4H2S-sYXRKGK1.js → railroadDiagram-XR7U4H2S-hqp-2UHb.js} +1 -1
- package/dist/web/assets/{render-C7fu7uYY.js → render-Brao9Nj2.js} +1 -1
- package/dist/web/assets/repository-store-DZgQ5H7J.js +1 -0
- package/dist/web/assets/{requirementDiagram-PLB6GJNP-C9I1JbQc.js → requirementDiagram-PLB6GJNP-Dhuw5jcQ.js} +1 -1
- package/dist/web/assets/runtime-core.esm-bundler-DDnHUoIy.js +1 -0
- package/dist/web/assets/{safe-storage-C76bPypO.js → safe-storage-BchoYSbq.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-IPEJSGJF-CuvFQhPh.js → sankeyDiagram-IPEJSGJF-D5rCIxGR.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-PO4LG4MO-CaVb9Y6e.js → sequenceDiagram-PO4LG4MO-YEHR4Mp-.js} +1 -1
- package/dist/web/assets/single-flight-CyDZB3rb.js +1 -0
- package/dist/web/assets/{stateDiagram-v2-GCMORJYK-Dp_APryr.js → stateDiagram-v2-GCMORJYK-9iWmz6Xf.js} +1 -1
- package/dist/web/assets/{swimlanes-2SLR337P-FclUI-k0.js → swimlanes-2SLR337P-Cjwvgt_n.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-gJwxhWoO.js +8 -0
- package/dist/web/assets/{terminal-store-BnEkXuBj.js → terminal-store-i7HHlWzR.js} +1 -1
- package/dist/web/assets/theme-CQ9InaWa.js +1 -0
- package/dist/web/assets/{timeline-definition-EJHVYXUP-BAqwqj3c.js → timeline-definition-EJHVYXUP-Cd5n2-Py.js} +1 -1
- package/dist/web/assets/{treeView-Q6P3EWNA-D87jJbUQ.js → treeView-Q6P3EWNA-C_QH9vtR.js} +1 -1
- package/dist/web/assets/{treemap-WGGIJYW6-B6nhGhRc.js → treemap-WGGIJYW6-CVnU7TVz.js} +1 -1
- package/dist/web/assets/use-add-agent-context-D5VqMr0p.js +1 -0
- package/dist/web/assets/use-app-theme-DgC4ivPF.js +1 -0
- package/dist/web/assets/use-countdown-D6_qSOZJ.js +1 -0
- package/dist/web/assets/use-notify-error-Dx2D9IEP.js +1 -0
- package/dist/web/assets/use-router-link-D7geCGQI.js +1 -0
- package/dist/web/assets/use-row-height-BgHg4-J-.js +1 -0
- package/dist/web/assets/use-server-events-CvcbsbIf.js +1 -0
- package/dist/web/assets/use-virtual-scroll-DixIsJk4.js +1 -0
- package/dist/web/assets/{use-workspace-navigation-CnebLvBV.js → use-workspace-navigation-Dq-Aw8Xq.js} +1 -1
- package/dist/web/assets/{usecaseDiagram-POWQR4AR-7YcIKxAb.js → usecaseDiagram-POWQR4AR-Cbj2Pvab.js} +1 -1
- package/dist/web/assets/{vennDiagram-UO4OBE2U-BZq5cFC4.js → vennDiagram-UO4OBE2U-2j79YqCN.js} +1 -1
- package/dist/web/assets/viewport-store-NqQS7itT.js +1 -0
- package/dist/web/assets/{vue-i18n.runtime-CEtihHHL.js → vue-i18n.runtime-JOo8b7-t.js} +2 -2
- package/dist/web/assets/{wardley-WFR3VGLG-BT8YO9H4.js → wardley-WFR3VGLG-wsMK7zm3.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-VNRHLVJA-rDpXFf6D.js → wardleyDiagram-VNRHLVJA-D6PKTQIJ.js} +1 -1
- package/dist/web/assets/weighted-lru-BFtZKA_y.js +1 -0
- package/dist/web/assets/workspace-navigation-CoXKJJpP.js +1 -0
- package/dist/web/assets/{xychartDiagram-PMCCYNJV-ClniUuZc.js → xychartDiagram-PMCCYNJV-D1fQN7KG.js} +1 -1
- package/dist/web/index.html +10 -9
- package/package.json +5 -3
- package/dist/web/assets/AccessPage-CX3w30zw.js +0 -1
- package/dist/web/assets/AppPage-PFJG281y.js +0 -1
- package/dist/web/assets/CreateButton-Ch0b7juj.js +0 -1
- package/dist/web/assets/CreateReviewFabButton-DTuJzw3q.js +0 -1
- package/dist/web/assets/IndexPage-tgW07Qvs.js +0 -1
- package/dist/web/assets/MainLayout-C6yBhQnf.css +0 -1
- package/dist/web/assets/MainLayout-Cw4jpB1x.js +0 -8
- package/dist/web/assets/NoteVisualEditor-DiGhLhQg.js +0 -1054
- package/dist/web/assets/NotesPage-CVyVr9tl.js +0 -4
- package/dist/web/assets/NotesPage-CxGnZuVQ.css +0 -1
- package/dist/web/assets/PanelResize-B6FP9ZVB.js +0 -1
- package/dist/web/assets/ProjectFilePage-CkxfX9b1.js +0 -1
- package/dist/web/assets/QBtn-CyyV1Bx_.js +0 -1
- package/dist/web/assets/QExpansionItem-Dp9lbdVb.js +0 -4
- package/dist/web/assets/QFab-LOmZ9rev.js +0 -1
- package/dist/web/assets/QInput-Dq6131uz.js +0 -1
- package/dist/web/assets/QSelect-B34OqtIH.js +0 -1
- package/dist/web/assets/QSpace-BhOVGpQh.js +0 -1
- package/dist/web/assets/QVirtualScroll-BYgJ1Kh2.js +0 -1
- package/dist/web/assets/ReviewDetailPage-CkCilMNW.css +0 -1
- package/dist/web/assets/ReviewDetailPage-GNjBa4X0.js +0 -1
- package/dist/web/assets/ReviewsPage-An5fRS92.js +0 -1
- package/dist/web/assets/StatusSwitcher-DrFHHwGm.js +0 -1
- package/dist/web/assets/architecture-7GRP2DOG-BPCNj4lR.js +0 -1
- package/dist/web/assets/channel-CzRYxuLe.js +0 -1
- package/dist/web/assets/create-B9Tn5Xvi.js +0 -1
- package/dist/web/assets/diff-store-B4adGxC2.js +0 -93
- package/dist/web/assets/eventmodeling-NTZA5JFV-BJsTZ_nG.js +0 -1
- package/dist/web/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa-Dr0goTwe.woff +0 -0
- package/dist/web/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ-D-x-0Q06.woff2 +0 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-CvXh1Df7.js +0 -1
- package/dist/web/assets/i18n-DnlAcIbT.js +0 -1
- package/dist/web/assets/index-Cw7GJi3K.js +0 -2
- package/dist/web/assets/index-wsOPzloa.css +0 -1
- package/dist/web/assets/markdown-CvtLTiBZ.js +0 -16
- package/dist/web/assets/pinia-DO0AdKGg.js +0 -1
- package/dist/web/assets/pinia-uOZCmBi-.js +0 -1
- package/dist/web/assets/preview-store-DyO8G-ox.js +0 -1
- package/dist/web/assets/railroad-abnf-HS5TGJTU-DTBsRB1c.js +0 -1
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-D3mrY4ar.js +0 -1
- package/dist/web/assets/railroad-peg-WCYAUIDC-33ZjWX0u.js +0 -1
- package/dist/web/assets/repository-store-DtRDth1L.js +0 -1
- package/dist/web/assets/runtime-core.esm-bundler-CAvPiMpd.js +0 -1
- package/dist/web/assets/single-flight-fPyIy7h5.js +0 -1
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-CuUvsn0e.js +0 -8
- package/dist/web/assets/theme-CnbaLamF.js +0 -1
- package/dist/web/assets/use-add-agent-context-xHAjjOf1.js +0 -1
- package/dist/web/assets/use-app-theme-DEowpWRR.js +0 -1
- package/dist/web/assets/use-countdown-DlcwwJrs.js +0 -1
- package/dist/web/assets/use-panel-width-CjSWCFr4.js +0 -1
- package/dist/web/assets/use-router-link-CUoYaYUw.js +0 -1
- package/dist/web/assets/use-row-height-BsE9-rO2.js +0 -1
- package/dist/web/assets/use-server-events-C2X4Xz00.js +0 -1
- package/dist/web/assets/use-virtual-scroll-BAZGswHv.js +0 -1
- package/dist/web/assets/viewport-store-CCHiY2QG.js +0 -1
- package/dist/web/assets/weighted-lru-BGovtJ2a.js +0 -1
- package/dist/web/assets/workspace-navigation-DdW0rSGz.js +0 -1
- /package/dist/web/assets/{PanelResize-XjrbOj2S.css → AddToAgentButton-XjrbOj2S.css} +0 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
import { UUID_PATTERN_SOURCE } from "../utils/is-uuid.js";
|
|
2
|
+
import { Type } from '@sinclair/typebox';
|
|
3
|
+
import { Nullable } from "../utils/schemas.js";
|
|
4
|
+
import { ARTIFACT_STATUSES, MAX_SEARCH_QUERY_CODEPOINTS, MAX_SEARCH_TOKENS, MAX_ARTIFACT_CHUNK_BYTES, MAX_ARTIFACT_PAGE_SIZE, MAX_ARTIFACT_SOURCE_QUOTE_BYTES } from "./constants.js";
|
|
5
|
+
// Keep import provenance separate from the human-readable title; this value never grants file access.
|
|
6
|
+
const ARTIFACT_SOURCE_PATH = Type.Optional(Type.String({
|
|
7
|
+
minLength: 1,
|
|
8
|
+
maxLength: 4096,
|
|
9
|
+
description: 'Informational original document path; never used for file access.'
|
|
10
|
+
}));
|
|
11
|
+
export const ArtifactStatusSchema = Type.Union(
|
|
12
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Mapping preserves tuple length and order; Fastify requires this tuple type.
|
|
13
|
+
ARTIFACT_STATUSES.map(status => Type.Literal(status)), {
|
|
14
|
+
description: 'Artifact lifecycle status; transitions are not exposed in stage 0089.'
|
|
15
|
+
});
|
|
16
|
+
export const ArtifactRelationSchema = Type.Object({
|
|
17
|
+
kind: Type.Union([
|
|
18
|
+
Type.Literal('parent'),
|
|
19
|
+
Type.Literal('replaces'),
|
|
20
|
+
Type.Literal('supplements'),
|
|
21
|
+
Type.Literal('references')
|
|
22
|
+
], { description: 'Directed relationship kind.' }),
|
|
23
|
+
targetId: Type.String({
|
|
24
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
25
|
+
description: 'Target artifact in the same store.'
|
|
26
|
+
})
|
|
27
|
+
}, {
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
description: 'Directed artifact relationship.'
|
|
30
|
+
});
|
|
31
|
+
export const ArtifactGraphFields = {
|
|
32
|
+
typeId: Type.String({
|
|
33
|
+
minLength: 1,
|
|
34
|
+
maxLength: 100,
|
|
35
|
+
description: 'Stable artifact type identifier.'
|
|
36
|
+
}),
|
|
37
|
+
taskIds: Type.Array(Type.String({ pattern: UUID_PATTERN_SOURCE }), {
|
|
38
|
+
maxItems: 100,
|
|
39
|
+
uniqueItems: true,
|
|
40
|
+
description: 'Tasks associated with the artifact.'
|
|
41
|
+
}),
|
|
42
|
+
relations: Type.Array(ArtifactRelationSchema, {
|
|
43
|
+
maxItems: 200,
|
|
44
|
+
description: 'Proposed relationships; they do not activate draft decisions.'
|
|
45
|
+
}),
|
|
46
|
+
revisionOf: Type.Array(Type.String({ pattern: UUID_PATTERN_SOURCE }), {
|
|
47
|
+
maxItems: 1,
|
|
48
|
+
uniqueItems: true,
|
|
49
|
+
description: 'Immutable predecessor, assigned at creation.'
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
export const GraphIssueSchema = Type.Object({
|
|
53
|
+
code: Type.String({ description: 'Structural issue code.' }),
|
|
54
|
+
artifactIds: Type.Array(Type.String(), {
|
|
55
|
+
description: 'Artifacts involved in the issue.'
|
|
56
|
+
}),
|
|
57
|
+
message: Type.String({
|
|
58
|
+
description: 'Explanation of the structural issue.'
|
|
59
|
+
})
|
|
60
|
+
}, { description: 'Graph validation issue.' });
|
|
61
|
+
export const ExpectedArtifactVersionSchema = Type.Object({
|
|
62
|
+
id: Type.String({
|
|
63
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
64
|
+
description: 'Artifact identifier.'
|
|
65
|
+
}),
|
|
66
|
+
version: Type.Integer({
|
|
67
|
+
minimum: 1,
|
|
68
|
+
description: 'Expected metadata version.'
|
|
69
|
+
})
|
|
70
|
+
}, {
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
description: 'Optimistic concurrency condition.'
|
|
73
|
+
});
|
|
74
|
+
export const SupplementDispositionSchema = Type.Object({
|
|
75
|
+
artifactId: Type.String({
|
|
76
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
77
|
+
description: 'Active supplement identifier.'
|
|
78
|
+
}),
|
|
79
|
+
disposition: Type.Union([
|
|
80
|
+
Type.Literal('incorporated'),
|
|
81
|
+
Type.Literal('carry_forward'),
|
|
82
|
+
Type.Literal('obsolete')
|
|
83
|
+
], { description: 'Disposition of an active supplement.' }),
|
|
84
|
+
newBaseId: Type.Optional(Type.String({
|
|
85
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
86
|
+
description: 'New accepted base for carry_forward.'
|
|
87
|
+
})),
|
|
88
|
+
targetStatus: Type.Optional(Type.Union([Type.Literal('archived'), Type.Literal('deleted')], {
|
|
89
|
+
description: 'Inactive status required for obsolete.'
|
|
90
|
+
}))
|
|
91
|
+
}, {
|
|
92
|
+
additionalProperties: false,
|
|
93
|
+
description: 'Explicit treatment of a supplement.'
|
|
94
|
+
});
|
|
95
|
+
export const ArtifactHistoricalChangeSetSchema = Type.Object({
|
|
96
|
+
storeId: Type.String({
|
|
97
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
98
|
+
description: 'Store owning all affected artifacts.'
|
|
99
|
+
}),
|
|
100
|
+
command: Type.Union([
|
|
101
|
+
Type.Literal('submit_review'),
|
|
102
|
+
Type.Literal('return_to_draft'),
|
|
103
|
+
Type.Literal('reject'),
|
|
104
|
+
Type.Literal('accept'),
|
|
105
|
+
Type.Literal('archive'),
|
|
106
|
+
Type.Literal('delete'),
|
|
107
|
+
Type.Literal('restore'),
|
|
108
|
+
Type.Literal('update_relations')
|
|
109
|
+
], { description: 'Proposed lifecycle command.' }),
|
|
110
|
+
subjectIds: Type.Array(Type.String({ pattern: UUID_PATTERN_SOURCE }), {
|
|
111
|
+
minItems: 1,
|
|
112
|
+
maxItems: 100,
|
|
113
|
+
uniqueItems: true,
|
|
114
|
+
description: 'Subjects of the operation.'
|
|
115
|
+
}),
|
|
116
|
+
expectedVersions: Type.Array(ExpectedArtifactVersionSchema, {
|
|
117
|
+
maxItems: 1000,
|
|
118
|
+
description: 'Versions supplied by the caller.'
|
|
119
|
+
}),
|
|
120
|
+
relationChanges: Type.Array(Type.Object({
|
|
121
|
+
artifactId: Type.String({
|
|
122
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
123
|
+
description: 'Artifact whose relations are replaced.'
|
|
124
|
+
}),
|
|
125
|
+
relations: ArtifactGraphFields.relations
|
|
126
|
+
}, {
|
|
127
|
+
additionalProperties: false,
|
|
128
|
+
description: 'Complete proposed relationship list.'
|
|
129
|
+
}), { maxItems: 100, description: 'Proposed relationship updates.' }),
|
|
130
|
+
targetStatuses: Type.Array(Type.Object({
|
|
131
|
+
artifactId: Type.String({
|
|
132
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
133
|
+
description: 'Artifact whose status changes.'
|
|
134
|
+
}),
|
|
135
|
+
status: ArtifactStatusSchema
|
|
136
|
+
}, {
|
|
137
|
+
additionalProperties: false,
|
|
138
|
+
description: 'Proposed lifecycle transition.'
|
|
139
|
+
}), { maxItems: 200, description: 'Explicit target statuses.' }),
|
|
140
|
+
supplementDispositions: Type.Array(SupplementDispositionSchema, {
|
|
141
|
+
maxItems: 200,
|
|
142
|
+
description: 'Decisions for every affected active supplement.'
|
|
143
|
+
}),
|
|
144
|
+
reason: Type.String({
|
|
145
|
+
minLength: 1,
|
|
146
|
+
maxLength: 4000,
|
|
147
|
+
description: 'Reason for the proposed change.'
|
|
148
|
+
})
|
|
149
|
+
}, {
|
|
150
|
+
additionalProperties: false,
|
|
151
|
+
description: 'Canonical input to a proposed atomic change; preview never commits it.'
|
|
152
|
+
});
|
|
153
|
+
export const ArtifactChangeSetSchema = Type.Object({
|
|
154
|
+
...ArtifactHistoricalChangeSetSchema.properties,
|
|
155
|
+
command: Type.Union([
|
|
156
|
+
Type.Literal('return_to_draft'),
|
|
157
|
+
Type.Literal('reject'),
|
|
158
|
+
Type.Literal('accept'),
|
|
159
|
+
Type.Literal('archive'),
|
|
160
|
+
Type.Literal('delete'),
|
|
161
|
+
Type.Literal('restore'),
|
|
162
|
+
Type.Literal('update_relations')
|
|
163
|
+
], { description: 'Supported lifecycle command.' })
|
|
164
|
+
}, {
|
|
165
|
+
additionalProperties: false,
|
|
166
|
+
description: 'Supported canonical atomic change input.'
|
|
167
|
+
});
|
|
168
|
+
export const GraphPageQuery = Type.Object({
|
|
169
|
+
limit: Type.Optional(Type.Integer({
|
|
170
|
+
minimum: 1,
|
|
171
|
+
maximum: 100,
|
|
172
|
+
description: 'Maximum number of items.'
|
|
173
|
+
})),
|
|
174
|
+
cursor: Type.Optional(Type.String({
|
|
175
|
+
maxLength: 2048,
|
|
176
|
+
description: 'Cursor bound to store, query and epoch.'
|
|
177
|
+
})),
|
|
178
|
+
direction: Type.Optional(Type.Union([Type.Literal('outgoing'), Type.Literal('incoming')], {
|
|
179
|
+
description: 'Relationship query direction.'
|
|
180
|
+
})),
|
|
181
|
+
kind: Type.Optional(ArtifactRelationSchema.properties.kind)
|
|
182
|
+
}, { additionalProperties: false, description: 'Relationship page options.' });
|
|
183
|
+
export const ArtifactGraphEdgeSchema = Type.Object({
|
|
184
|
+
sourceId: Type.String({ description: 'Relationship source identifier.' }),
|
|
185
|
+
targetId: Type.String({ description: 'Relationship target identifier.' }),
|
|
186
|
+
kind: ArtifactRelationSchema.properties.kind
|
|
187
|
+
}, { description: 'Directed graph edge.' });
|
|
188
|
+
export const ArtifactGraphPageSchema = Type.Object({
|
|
189
|
+
storeId: Type.String({ description: 'Owning store.' }),
|
|
190
|
+
storeEpoch: Type.Integer({ description: 'Committed store revision.' }),
|
|
191
|
+
items: Type.Array(ArtifactGraphEdgeSchema, {
|
|
192
|
+
description: 'Edges in stable source/kind/target order.'
|
|
193
|
+
}),
|
|
194
|
+
nextCursor: Nullable(Type.String({ description: 'Cursor for the next page.' }))
|
|
195
|
+
}, { description: 'Relationship page.' });
|
|
196
|
+
export const ArtifactAncestrySchema = Type.Object({
|
|
197
|
+
storeId: Type.String({ description: 'Owning store.' }),
|
|
198
|
+
storeEpoch: Type.Integer({ description: 'Committed store revision.' }),
|
|
199
|
+
nextCursor: Nullable(Type.String({ description: 'Next ancestry page cursor.' })),
|
|
200
|
+
artifactId: Type.String({ description: 'Descendant identifier.' }),
|
|
201
|
+
ancestorIds: Type.Array(Type.String(), {
|
|
202
|
+
description: 'Immutable lineage ancestors, nearest first.'
|
|
203
|
+
})
|
|
204
|
+
}, { description: 'Lineage ancestry, independent of editable relationships.' });
|
|
205
|
+
export const ArtifactActorSchema = Type.Object({
|
|
206
|
+
kind: Type.Union([Type.Literal('user'), Type.Literal('agent'), Type.Literal('system')], { description: 'Authenticated source of the operation.' }),
|
|
207
|
+
id: Type.String({
|
|
208
|
+
minLength: 1,
|
|
209
|
+
maxLength: 256,
|
|
210
|
+
description: 'Identity assigned by the server transport.'
|
|
211
|
+
})
|
|
212
|
+
}, { additionalProperties: false, description: 'Operation author.' });
|
|
213
|
+
export const ArtifactMetadataInputSchema = Type.Object({
|
|
214
|
+
title: Type.String({
|
|
215
|
+
minLength: 1,
|
|
216
|
+
maxLength: 1000,
|
|
217
|
+
description: 'Document title.'
|
|
218
|
+
}),
|
|
219
|
+
sourcePath: ARTIFACT_SOURCE_PATH,
|
|
220
|
+
typeId: Type.Optional(ArtifactGraphFields.typeId),
|
|
221
|
+
taskIds: Type.Optional(ArtifactGraphFields.taskIds),
|
|
222
|
+
relations: Type.Optional(ArtifactGraphFields.relations),
|
|
223
|
+
tags: Type.Array(Type.String({
|
|
224
|
+
minLength: 1,
|
|
225
|
+
maxLength: 128,
|
|
226
|
+
description: 'Free-form tag.'
|
|
227
|
+
}), { maxItems: 100, uniqueItems: true, description: 'Document tags.' })
|
|
228
|
+
}, {
|
|
229
|
+
additionalProperties: false,
|
|
230
|
+
description: 'Editable metadata supported by the storage stage.'
|
|
231
|
+
});
|
|
232
|
+
export const ArtifactSchema = Type.Object({
|
|
233
|
+
storeId: Type.String({ description: 'Artifact store UUID.' }),
|
|
234
|
+
id: Type.String({ description: 'Immutable artifact UUID.' }),
|
|
235
|
+
sha256: Type.String({ description: 'SHA-256 of the exact stored bytes.' }),
|
|
236
|
+
bytes: Type.Integer({ description: 'Stored file size in bytes.' }),
|
|
237
|
+
bodyStartLine: Type.Integer({
|
|
238
|
+
description: 'One-based first body line in the stored file.'
|
|
239
|
+
}),
|
|
240
|
+
createdAt: Type.String({ description: 'Creation time in UTC.' }),
|
|
241
|
+
metadataVersion: Type.Integer({ description: 'Current metadata version.' }),
|
|
242
|
+
metadataUpdatedAt: Type.String({
|
|
243
|
+
description: 'Last metadata change in UTC.'
|
|
244
|
+
}),
|
|
245
|
+
title: Type.String({ description: 'Current document title.' }),
|
|
246
|
+
sourcePath: ARTIFACT_SOURCE_PATH,
|
|
247
|
+
tags: Type.Array(Type.String(), { description: 'Current document tags.' }),
|
|
248
|
+
...ArtifactGraphFields,
|
|
249
|
+
status: ArtifactStatusSchema
|
|
250
|
+
}, {
|
|
251
|
+
additionalProperties: false,
|
|
252
|
+
description: 'Artifact identity and current metadata.'
|
|
253
|
+
});
|
|
254
|
+
export const ArtifactEventSchema = Type.Object({
|
|
255
|
+
storeId: Type.String({ description: 'Artifact store UUID.' }),
|
|
256
|
+
seq: Type.Integer({
|
|
257
|
+
description: 'Monotonic event sequence in the database.'
|
|
258
|
+
}),
|
|
259
|
+
artifactId: Type.String({ description: 'Artifact UUID.' }),
|
|
260
|
+
requestId: Type.String({ description: 'Idempotent operation identifier.' }),
|
|
261
|
+
actor: ArtifactActorSchema,
|
|
262
|
+
action: Type.Union([Type.Literal('created'), Type.Literal('metadata_updated')], { description: 'Recorded operation.' }),
|
|
263
|
+
beforeVersion: Nullable(Type.Integer({ description: 'Previous version; null on creation.' })),
|
|
264
|
+
afterVersion: Type.Integer({ description: 'New metadata version.' }),
|
|
265
|
+
createdAt: Type.String({ description: 'Event time in UTC.' }),
|
|
266
|
+
metadata: ArtifactMetadataInputSchema
|
|
267
|
+
}, { description: 'Immutable metadata history event.' });
|
|
268
|
+
export const ArtifactParams = Type.Object({
|
|
269
|
+
id: Type.String({
|
|
270
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
271
|
+
description: 'Artifact UUID.'
|
|
272
|
+
})
|
|
273
|
+
}, { additionalProperties: false, description: 'Artifact identity.' });
|
|
274
|
+
export const ArtifactListQuery = Type.Object({
|
|
275
|
+
limit: Type.Optional(Type.Integer({
|
|
276
|
+
minimum: 1,
|
|
277
|
+
maximum: MAX_ARTIFACT_PAGE_SIZE,
|
|
278
|
+
description: 'Maximum page size.'
|
|
279
|
+
})),
|
|
280
|
+
cursor: Type.Optional(Type.String({
|
|
281
|
+
maxLength: 2048,
|
|
282
|
+
description: 'Opaque cursor bound to the store epoch.'
|
|
283
|
+
}))
|
|
284
|
+
}, { additionalProperties: false, description: 'Artifact catalog page.' });
|
|
285
|
+
export const ArtifactHistoryQuery = Type.Object({
|
|
286
|
+
limit: Type.Optional(Type.Integer({
|
|
287
|
+
minimum: 1,
|
|
288
|
+
maximum: MAX_ARTIFACT_PAGE_SIZE,
|
|
289
|
+
description: 'Maximum page size.'
|
|
290
|
+
})),
|
|
291
|
+
afterSeq: Type.Optional(Type.Integer({
|
|
292
|
+
minimum: 0,
|
|
293
|
+
description: 'Return events after this sequence.'
|
|
294
|
+
}))
|
|
295
|
+
}, { additionalProperties: false, description: 'Artifact history page.' });
|
|
296
|
+
export const ArtifactContentQuery = Type.Object({
|
|
297
|
+
offset: Type.Optional(Type.Integer({
|
|
298
|
+
minimum: 0,
|
|
299
|
+
description: 'UTF-8 byte offset in the complete stored file.'
|
|
300
|
+
})),
|
|
301
|
+
limit: Type.Optional(Type.Integer({
|
|
302
|
+
minimum: 4,
|
|
303
|
+
maximum: MAX_ARTIFACT_CHUNK_BYTES,
|
|
304
|
+
description: 'Maximum bytes; chunks end on UTF-8 boundaries.'
|
|
305
|
+
}))
|
|
306
|
+
}, { additionalProperties: false, description: 'Artifact content page.' });
|
|
307
|
+
export const ArtifactListSchema = Type.Object({
|
|
308
|
+
storeId: Type.String({ description: 'Artifact store UUID.' }),
|
|
309
|
+
storeEpoch: Type.Integer({
|
|
310
|
+
description: 'Current committed event sequence.'
|
|
311
|
+
}),
|
|
312
|
+
items: Type.Array(ArtifactSchema, {
|
|
313
|
+
description: 'Committed artifacts in creation order.'
|
|
314
|
+
}),
|
|
315
|
+
nextCursor: Nullable(Type.String({ description: 'Next page cursor, or null.' }))
|
|
316
|
+
}, { description: 'Artifact catalog result.' });
|
|
317
|
+
export const ArtifactHistorySchema = Type.Object({
|
|
318
|
+
storeId: Type.String({ description: 'Artifact store UUID.' }),
|
|
319
|
+
items: Type.Array(ArtifactEventSchema, {
|
|
320
|
+
description: 'Events in sequence order.'
|
|
321
|
+
}),
|
|
322
|
+
nextAfterSeq: Nullable(Type.Integer({ description: 'Last sequence for the next page, or null.' }))
|
|
323
|
+
}, { description: 'Artifact history result.' });
|
|
324
|
+
export const ArtifactContentSchema = Type.Object({
|
|
325
|
+
storeId: Type.String({ description: 'Artifact store UUID.' }),
|
|
326
|
+
id: Type.String({ description: 'Artifact UUID.' }),
|
|
327
|
+
sha256: Type.String({
|
|
328
|
+
description: 'Verified hash of the entire stored file.'
|
|
329
|
+
}),
|
|
330
|
+
bodyStartLine: Type.Integer({ description: 'One-based first body line.' }),
|
|
331
|
+
totalBytes: Type.Integer({ description: 'Complete file size.' }),
|
|
332
|
+
offset: Type.Integer({ description: 'First byte of this chunk.' }),
|
|
333
|
+
nextOffset: Nullable(Type.Integer({ description: 'Next UTF-8 byte offset, or null.' })),
|
|
334
|
+
text: Type.String({
|
|
335
|
+
description: 'Exact decoded UTF-8 content in this chunk.'
|
|
336
|
+
})
|
|
337
|
+
}, { description: 'Verified document content chunk.' });
|
|
338
|
+
export const ArtifactChangeSetPreviewSchema = Type.Object({
|
|
339
|
+
canonical: ArtifactHistoricalChangeSetSchema,
|
|
340
|
+
changeDigest: Type.String({
|
|
341
|
+
description: 'Server SHA-256 digest of canonical change set.'
|
|
342
|
+
}),
|
|
343
|
+
affectedIds: Type.Array(Type.String(), {
|
|
344
|
+
description: 'Artifacts affected by the proposed change.'
|
|
345
|
+
}),
|
|
346
|
+
requiredSupplementDispositions: Type.Array(Type.String(), {
|
|
347
|
+
description: 'Active supplements requiring an explicit decision.'
|
|
348
|
+
}),
|
|
349
|
+
expectedVersions: Type.Array(ExpectedArtifactVersionSchema, {
|
|
350
|
+
description: 'Current versions required for the affected artifacts.'
|
|
351
|
+
}),
|
|
352
|
+
errors: Type.Array(GraphIssueSchema, {
|
|
353
|
+
description: 'Structural errors blocking the proposed change.'
|
|
354
|
+
}),
|
|
355
|
+
postState: Type.Array(ArtifactSchema, {
|
|
356
|
+
description: 'Proposed state; no changes are committed.'
|
|
357
|
+
}),
|
|
358
|
+
includedIn: Type.Array(Type.Object({
|
|
359
|
+
artifactId: Type.String({ description: 'Incorporated supplement.' }),
|
|
360
|
+
targetId: Type.String({ description: 'Accepting artifact.' })
|
|
361
|
+
}, { description: 'Proposed historical incorporation record.' }), { description: 'Derived incorporation audit records.' })
|
|
362
|
+
}, { description: 'Change set preview without lifecycle authorization.' });
|
|
363
|
+
export const ArtifactSourceAnchorSchema = Type.Object({
|
|
364
|
+
artifactId: Type.String({
|
|
365
|
+
pattern: UUID_PATTERN_SOURCE,
|
|
366
|
+
description: 'Original artifact identifier.'
|
|
367
|
+
}),
|
|
368
|
+
fileSha256: Type.String({
|
|
369
|
+
pattern: '^[a-f0-9]{64}$',
|
|
370
|
+
description: 'SHA-256 of the exact original file bytes.'
|
|
371
|
+
}),
|
|
372
|
+
bodyStartLine: Type.Integer({
|
|
373
|
+
minimum: 1,
|
|
374
|
+
description: 'One-based body start in the original file.'
|
|
375
|
+
}),
|
|
376
|
+
startLine: Type.Integer({
|
|
377
|
+
minimum: 1,
|
|
378
|
+
description: 'First selected body line, one-based.'
|
|
379
|
+
}),
|
|
380
|
+
endLine: Type.Integer({
|
|
381
|
+
minimum: 1,
|
|
382
|
+
description: 'Last selected body line, inclusive.'
|
|
383
|
+
}),
|
|
384
|
+
quote: Type.String({
|
|
385
|
+
maxLength: MAX_ARTIFACT_SOURCE_QUOTE_BYTES,
|
|
386
|
+
description: 'Exact original source excerpt; verified against the stored body.'
|
|
387
|
+
})
|
|
388
|
+
}, {
|
|
389
|
+
additionalProperties: false,
|
|
390
|
+
description: 'Immutable source anchor; range, hash and quote require service validation.'
|
|
391
|
+
});
|
|
392
|
+
export const ArtifactChangeSetProposeBody = Type.Object({
|
|
393
|
+
requestId: Type.String({
|
|
394
|
+
minLength: 1,
|
|
395
|
+
maxLength: 128,
|
|
396
|
+
description: 'Idempotent proposal request.'
|
|
397
|
+
}),
|
|
398
|
+
id: Type.Optional(ArtifactParams.properties.id),
|
|
399
|
+
expectedVersion: Type.Optional(Type.Integer({ minimum: 1, description: 'Previous proposal version.' })),
|
|
400
|
+
changeSet: ArtifactChangeSetSchema
|
|
401
|
+
}, {
|
|
402
|
+
additionalProperties: false,
|
|
403
|
+
description: 'Create or revise an immutable change set proposal.'
|
|
404
|
+
});
|
|
405
|
+
export const ArtifactValidationPrepareBody = Type.Object({
|
|
406
|
+
changeSetId: ArtifactParams.properties.id,
|
|
407
|
+
version: Type.Integer({
|
|
408
|
+
minimum: 1,
|
|
409
|
+
description: 'Exact proposal version.'
|
|
410
|
+
})
|
|
411
|
+
}, {
|
|
412
|
+
additionalProperties: false,
|
|
413
|
+
description: 'Prepare a complete validation manifest.'
|
|
414
|
+
});
|
|
415
|
+
export const ArtifactValidationStartBody = Type.Object({
|
|
416
|
+
presetId: Type.String({
|
|
417
|
+
minLength: 1,
|
|
418
|
+
maxLength: 128,
|
|
419
|
+
description: 'Configured validator preset.'
|
|
420
|
+
})
|
|
421
|
+
}, {
|
|
422
|
+
additionalProperties: false,
|
|
423
|
+
description: 'Start a bounded validation job.'
|
|
424
|
+
});
|
|
425
|
+
export const ArtifactValidationFindingSchema = Type.Object({
|
|
426
|
+
artifactId: ArtifactParams.properties.id,
|
|
427
|
+
quote: Type.String({
|
|
428
|
+
maxLength: 65536,
|
|
429
|
+
description: 'Evidence quoted from the manifest text.'
|
|
430
|
+
}),
|
|
431
|
+
message: Type.String({
|
|
432
|
+
minLength: 1,
|
|
433
|
+
maxLength: 8000,
|
|
434
|
+
description: 'Finding explanation.'
|
|
435
|
+
})
|
|
436
|
+
}, { additionalProperties: false, description: 'A cited validation finding.' });
|
|
437
|
+
export const ArtifactValidationSubmitBody = Type.Object({
|
|
438
|
+
verdict: Type.Union([
|
|
439
|
+
Type.Literal('pass'),
|
|
440
|
+
Type.Literal('conflict'),
|
|
441
|
+
Type.Literal('incomplete')
|
|
442
|
+
], { description: 'Validator outcome.' }),
|
|
443
|
+
findings: Type.Array(ArtifactValidationFindingSchema, {
|
|
444
|
+
maxItems: 100,
|
|
445
|
+
description: 'Cited findings.'
|
|
446
|
+
}),
|
|
447
|
+
resolutions: Type.Array(Type.String({ maxLength: 8000, description: 'Resolution explanation.' }), { maxItems: 100, description: 'How issues were addressed.' }),
|
|
448
|
+
report: Type.Optional(Type.String({
|
|
449
|
+
maxLength: 131072,
|
|
450
|
+
description: 'Optional standalone draft Markdown report.'
|
|
451
|
+
}))
|
|
452
|
+
}, {
|
|
453
|
+
additionalProperties: false,
|
|
454
|
+
description: 'Submit an outcome for the server-assigned manifest and session.'
|
|
455
|
+
});
|
|
456
|
+
export const ArtifactLifecycleCommitBody = Type.Object({
|
|
457
|
+
version: Type.Integer({
|
|
458
|
+
minimum: 1,
|
|
459
|
+
description: 'Exact change set version.'
|
|
460
|
+
}),
|
|
461
|
+
validationId: ArtifactParams.properties.id,
|
|
462
|
+
authorizationId: ArtifactParams.properties.id,
|
|
463
|
+
requestId: Type.String({
|
|
464
|
+
minLength: 1,
|
|
465
|
+
maxLength: 128,
|
|
466
|
+
description: 'Idempotent commit request.'
|
|
467
|
+
})
|
|
468
|
+
}, {
|
|
469
|
+
additionalProperties: false,
|
|
470
|
+
description: 'Commit a validated and authorized package atomically.'
|
|
471
|
+
});
|
|
472
|
+
export const ArtifactAuthorizationRequestBody = Type.Object({
|
|
473
|
+
kind: Type.Literal('lifecycle', {
|
|
474
|
+
description: 'Lifecycle authorization.'
|
|
475
|
+
}),
|
|
476
|
+
changeSetId: ArtifactParams.properties.id,
|
|
477
|
+
version: Type.Integer({ minimum: 1, description: 'Proposal version.' }),
|
|
478
|
+
validationId: ArtifactParams.properties.id
|
|
479
|
+
}, {
|
|
480
|
+
additionalProperties: false,
|
|
481
|
+
description: 'Request permission for a validated package.'
|
|
482
|
+
});
|
|
483
|
+
export const ArtifactAuthorizationApproveBody = Type.Object({
|
|
484
|
+
sourceUserRequestId: Type.String({
|
|
485
|
+
minLength: 1,
|
|
486
|
+
maxLength: 128,
|
|
487
|
+
description: 'Structured user confirmation request.'
|
|
488
|
+
})
|
|
489
|
+
}, {
|
|
490
|
+
additionalProperties: false,
|
|
491
|
+
description: 'Approve the exact pending action.'
|
|
492
|
+
});
|
|
493
|
+
export const ArtifactLifecycleResultSchema = Type.Record(Type.String(), Type.Unknown(), {
|
|
494
|
+
description: 'Complete lifecycle result including digests, versions, manifest or history pagination.'
|
|
495
|
+
});
|
|
496
|
+
export const ArtifactValidationReadBody = Type.Object({
|
|
497
|
+
key: Type.String({
|
|
498
|
+
minLength: 1,
|
|
499
|
+
maxLength: 64,
|
|
500
|
+
description: 'Artifact ID from the assigned manifest.'
|
|
501
|
+
}),
|
|
502
|
+
offset: Type.Optional(Type.Integer({ minimum: 0, description: 'Sequential UTF-8 byte offset.' }))
|
|
503
|
+
}, {
|
|
504
|
+
additionalProperties: false,
|
|
505
|
+
description: 'Read and receipt one complete context chunk.'
|
|
506
|
+
});
|
|
507
|
+
export const ArtifactValidationReportBody = Type.Object({
|
|
508
|
+
body: Type.String({
|
|
509
|
+
maxLength: 131072,
|
|
510
|
+
description: 'Isolated draft Markdown report body.'
|
|
511
|
+
})
|
|
512
|
+
}, {
|
|
513
|
+
additionalProperties: false,
|
|
514
|
+
description: 'Save a standalone report without changing the manifest.'
|
|
515
|
+
});
|
|
516
|
+
export const ArtifactValidationReportQuery = Type.Object({
|
|
517
|
+
offset: Type.Optional(Type.Integer({
|
|
518
|
+
minimum: 0,
|
|
519
|
+
description: 'UTF-8 byte offset in the complete structured report.'
|
|
520
|
+
}))
|
|
521
|
+
}, {
|
|
522
|
+
additionalProperties: false,
|
|
523
|
+
description: 'Read a bounded structured report chunk.'
|
|
524
|
+
});
|
|
525
|
+
export const ArtifactSearchFiltersSchema = Type.Object({
|
|
526
|
+
statuses: Type.Optional(Type.Array(ArtifactStatusSchema, {
|
|
527
|
+
maxItems: 7,
|
|
528
|
+
description: 'Explicit statuses; defaults to accepted.'
|
|
529
|
+
})),
|
|
530
|
+
typeIds: Type.Optional(Type.Array(Type.String({ maxLength: 128, description: 'Artifact type ID.' }), { maxItems: 100, description: 'Allowed artifact types.' })),
|
|
531
|
+
taskIds: Type.Optional(Type.Array(ArtifactParams.properties.id, {
|
|
532
|
+
maxItems: 100,
|
|
533
|
+
description: 'Match any selected task.'
|
|
534
|
+
})),
|
|
535
|
+
tags: Type.Optional(Type.Array(Type.String({ maxLength: 128, description: 'Required tag.' }), { maxItems: 100, description: 'Selected tags; see tagMode.' })),
|
|
536
|
+
tagMode: Type.Optional(Type.Union([Type.Literal('all'), Type.Literal('any')], {
|
|
537
|
+
description: 'Require every selected tag (all, default) or any (any).'
|
|
538
|
+
})),
|
|
539
|
+
createdFrom: Type.Optional(Type.String({
|
|
540
|
+
maxLength: 40,
|
|
541
|
+
description: 'Earliest creation time, inclusive; ISO 8601 timestamp.'
|
|
542
|
+
})),
|
|
543
|
+
createdTo: Type.Optional(Type.String({
|
|
544
|
+
maxLength: 40,
|
|
545
|
+
description: 'Latest creation time, inclusive; ISO 8601 timestamp.'
|
|
546
|
+
}))
|
|
547
|
+
}, {
|
|
548
|
+
additionalProperties: false,
|
|
549
|
+
description: 'Metadata filters applied before ranking and pagination.'
|
|
550
|
+
});
|
|
551
|
+
export const ArtifactSearchBody = Type.Object({
|
|
552
|
+
query: Type.Optional(Type.String({
|
|
553
|
+
maxLength: MAX_SEARCH_QUERY_CODEPOINTS * 2,
|
|
554
|
+
description: `Literal text; coarse length cap ${MAX_SEARCH_QUERY_CODEPOINTS * 2}, service limit ${MAX_SEARCH_QUERY_CODEPOINTS} Unicode codepoints and ${MAX_SEARCH_TOKENS} tokens.`
|
|
555
|
+
})),
|
|
556
|
+
mode: Type.Optional(Type.Union([Type.Literal('auto'), Type.Literal('exact'), Type.Literal('fuzzy')], { description: 'Exact and/or bounded typo matching.' })),
|
|
557
|
+
filters: Type.Optional(ArtifactSearchFiltersSchema),
|
|
558
|
+
sort: Type.Optional(Type.Union([
|
|
559
|
+
Type.Literal('relevance'),
|
|
560
|
+
Type.Literal('createdAt'),
|
|
561
|
+
Type.Literal('metadataUpdatedAt')
|
|
562
|
+
], { description: 'Stable order; timestamps sort newest first.' })),
|
|
563
|
+
limit: Type.Optional(Type.Integer({
|
|
564
|
+
minimum: 1,
|
|
565
|
+
maximum: 100,
|
|
566
|
+
description: 'Maximum items in this page.'
|
|
567
|
+
})),
|
|
568
|
+
cursor: Type.Optional(Type.String({
|
|
569
|
+
maxLength: 32768,
|
|
570
|
+
description: 'Cursor bound to query, filters and epochs.'
|
|
571
|
+
}))
|
|
572
|
+
}, {
|
|
573
|
+
additionalProperties: false,
|
|
574
|
+
description: 'Search current artifact titles and original body text.'
|
|
575
|
+
});
|
|
576
|
+
export const ArtifactSearchQuery = Type.Object({
|
|
577
|
+
...Type.Omit(ArtifactSearchBody, ['filters']).properties,
|
|
578
|
+
status: Type.Optional(ArtifactStatusSchema),
|
|
579
|
+
typeId: Type.Optional(Type.String({ maxLength: 128, description: 'Artifact type filter.' })),
|
|
580
|
+
taskId: Type.Optional(ArtifactParams.properties.id),
|
|
581
|
+
tag: Type.Optional(Type.String({ maxLength: 128, description: 'Required tag.' }))
|
|
582
|
+
}, {
|
|
583
|
+
additionalProperties: false,
|
|
584
|
+
description: 'Read-only search query with single-value metadata filters.'
|
|
585
|
+
});
|
|
586
|
+
export const ArtifactSearchItemSchema = Type.Object({
|
|
587
|
+
storeId: ArtifactSchema.properties.storeId,
|
|
588
|
+
id: ArtifactParams.properties.id,
|
|
589
|
+
title: ArtifactSchema.properties.title,
|
|
590
|
+
createdAt: ArtifactSchema.properties.createdAt,
|
|
591
|
+
tags: ArtifactSchema.properties.tags,
|
|
592
|
+
status: ArtifactStatusSchema,
|
|
593
|
+
typeId: ArtifactSchema.properties.typeId,
|
|
594
|
+
taskIds: ArtifactSchema.properties.taskIds,
|
|
595
|
+
snippet: Type.String({
|
|
596
|
+
description: 'Plain-text excerpt from original text; never HTML.'
|
|
597
|
+
}),
|
|
598
|
+
source: Type.Union([Type.Literal('title'), Type.Literal('body')], {
|
|
599
|
+
description: 'Original field containing the excerpt.'
|
|
600
|
+
}),
|
|
601
|
+
matchKind: Type.Union([
|
|
602
|
+
Type.Literal('exact'),
|
|
603
|
+
Type.Literal('exact_normalized'),
|
|
604
|
+
Type.Literal('token'),
|
|
605
|
+
Type.Literal('fuzzy'),
|
|
606
|
+
Type.Literal('catalog')
|
|
607
|
+
], {
|
|
608
|
+
description: 'Fuzzy and normalized matches are explicitly distinguished.'
|
|
609
|
+
}),
|
|
610
|
+
highlights: Type.Array(Type.Object({
|
|
611
|
+
start: Type.Integer({
|
|
612
|
+
minimum: 0,
|
|
613
|
+
description: 'UTF-16 start within snippet.'
|
|
614
|
+
}),
|
|
615
|
+
end: Type.Integer({
|
|
616
|
+
minimum: 0,
|
|
617
|
+
description: 'Exclusive UTF-16 end within snippet.'
|
|
618
|
+
})
|
|
619
|
+
}, { description: 'Highlight range in original plain text.' }), { description: 'Original-text match ranges.' }),
|
|
620
|
+
anchor: Nullable(ArtifactSourceAnchorSchema)
|
|
621
|
+
}, { description: 'One ranked verified artifact search result.' });
|
|
622
|
+
export const ArtifactSearchSchema = Type.Object({
|
|
623
|
+
storeId: ArtifactSchema.properties.storeId,
|
|
624
|
+
storeEpoch: ArtifactListSchema.properties.storeEpoch,
|
|
625
|
+
indexEpoch: Type.Integer({
|
|
626
|
+
minimum: 0,
|
|
627
|
+
description: 'Derived index generation.'
|
|
628
|
+
}),
|
|
629
|
+
items: Type.Array(ArtifactSearchItemSchema, {
|
|
630
|
+
description: 'Filtered ranked complete results.'
|
|
631
|
+
}),
|
|
632
|
+
nextCursor: Nullable(Type.String({
|
|
633
|
+
description: 'Continue this query while both epochs remain unchanged.'
|
|
634
|
+
})),
|
|
635
|
+
partial: Type.Boolean({
|
|
636
|
+
description: 'Fuzzy work reached its processing budget.'
|
|
637
|
+
}),
|
|
638
|
+
reason: Nullable(Type.String({ description: 'Explicit partial-result reason.' }))
|
|
639
|
+
}, { description: 'Bounded artifact search page.' });
|
|
640
|
+
export const ArtifactSearchDiagnosticsSchema = Type.Object({
|
|
641
|
+
available: Type.Boolean({
|
|
642
|
+
description: 'Whether both required FTS5 tokenizers are available.'
|
|
643
|
+
}),
|
|
644
|
+
documents: Type.Integer({
|
|
645
|
+
minimum: 0,
|
|
646
|
+
description: 'Indexed documents in this store.'
|
|
647
|
+
}),
|
|
648
|
+
suppressed: Type.Array(Type.Object({
|
|
649
|
+
id: ArtifactParams.properties.id,
|
|
650
|
+
reason: Type.String({
|
|
651
|
+
description: 'Why this document was excluded from the derived index.'
|
|
652
|
+
})
|
|
653
|
+
}, { description: 'Suppressed artifact diagnostic.' }), {
|
|
654
|
+
description: 'Documents suppressed after integrity verification failed.'
|
|
655
|
+
})
|
|
656
|
+
}, {
|
|
657
|
+
description: 'Availability and integrity diagnostics of the derived search index.'
|
|
658
|
+
});
|
|
659
|
+
function lifecycleId(description) {
|
|
660
|
+
return Type.String({ pattern: UUID_PATTERN_SOURCE, description });
|
|
661
|
+
}
|
|
662
|
+
function lifecycleDigest(description) {
|
|
663
|
+
return Type.String({ pattern: '^[a-f0-9]{64}$', description });
|
|
664
|
+
}
|
|
665
|
+
export const ArtifactStoredChangeSetSchema = Type.Object({
|
|
666
|
+
id: lifecycleId('Change set identifier.'),
|
|
667
|
+
version: Type.Integer({
|
|
668
|
+
minimum: 1,
|
|
669
|
+
description: 'Immutable proposal version.'
|
|
670
|
+
}),
|
|
671
|
+
requestId: Type.String({ description: 'Idempotent proposal request.' }),
|
|
672
|
+
changeSet: ArtifactHistoricalChangeSetSchema,
|
|
673
|
+
changeDigest: lifecycleDigest('Canonical change set digest.'),
|
|
674
|
+
requestDigest: lifecycleDigest('Canonical proposal request digest.'),
|
|
675
|
+
actor: ArtifactActorSchema
|
|
676
|
+
}, { description: 'Current immutable change set proposal.' });
|
|
677
|
+
export const ArtifactValidationStateSchema = Type.Union([
|
|
678
|
+
Type.Literal('prepared'),
|
|
679
|
+
Type.Literal('running'),
|
|
680
|
+
Type.Literal('pass'),
|
|
681
|
+
Type.Literal('conflict'),
|
|
682
|
+
Type.Literal('incomplete'),
|
|
683
|
+
Type.Literal('cancelled')
|
|
684
|
+
], { description: 'Validation job state.' });
|
|
685
|
+
export const ArtifactValidationViewSchema = Type.Object({
|
|
686
|
+
id: lifecycleId('Validation identifier.'),
|
|
687
|
+
changeSetId: lifecycleId('Validated proposal.'),
|
|
688
|
+
version: Type.Integer({
|
|
689
|
+
minimum: 1,
|
|
690
|
+
description: 'Validated proposal version.'
|
|
691
|
+
}),
|
|
692
|
+
state: ArtifactValidationStateSchema,
|
|
693
|
+
validatorSessionId: Nullable(lifecycleId('Assigned validator session.')),
|
|
694
|
+
manifestDigest: lifecycleDigest('Server-assigned manifest digest.'),
|
|
695
|
+
changeDigest: lifecycleDigest('Validated change digest.'),
|
|
696
|
+
validationEpoch: Type.Integer({
|
|
697
|
+
description: 'Manifest validation epoch.'
|
|
698
|
+
}),
|
|
699
|
+
expiresAt: Nullable(Type.Number({
|
|
700
|
+
description: 'Validation lease expiry in Unix milliseconds.'
|
|
701
|
+
})),
|
|
702
|
+
reason: Type.Optional(Type.String({ description: 'Terminal outcome explanation.' })),
|
|
703
|
+
generation: Type.Optional(Type.Integer({
|
|
704
|
+
minimum: 1,
|
|
705
|
+
description: 'Manifest generation; it grows when a running validation follows its set.'
|
|
706
|
+
})),
|
|
707
|
+
metrics: Type.Optional(Type.Object({
|
|
708
|
+
startedAt: Type.Number({
|
|
709
|
+
description: 'Validator start in Unix milliseconds.'
|
|
710
|
+
}),
|
|
711
|
+
finishedAt: Type.Number({
|
|
712
|
+
description: 'Terminal state time in Unix milliseconds.'
|
|
713
|
+
}),
|
|
714
|
+
toolCalls: Type.Integer({
|
|
715
|
+
minimum: 0,
|
|
716
|
+
description: 'Tool calls that the validator made.'
|
|
717
|
+
}),
|
|
718
|
+
failedToolCalls: Type.Integer({
|
|
719
|
+
minimum: 0,
|
|
720
|
+
description: 'Tool calls that failed.'
|
|
721
|
+
}),
|
|
722
|
+
contextTokens: Type.Optional(Type.Integer({
|
|
723
|
+
minimum: 0,
|
|
724
|
+
description: 'Last reported context size in tokens.'
|
|
725
|
+
})),
|
|
726
|
+
costUsd: Type.Optional(Type.Number({
|
|
727
|
+
minimum: 0,
|
|
728
|
+
description: 'Last reported session cost in US dollars.'
|
|
729
|
+
})),
|
|
730
|
+
stopReason: Type.Optional(Type.String({ description: 'Agent stop reason of the last turn.' })),
|
|
731
|
+
lastFailure: Type.Optional(Type.String({
|
|
732
|
+
description: 'Last failed tool and its output, cut to 300 characters.'
|
|
733
|
+
}))
|
|
734
|
+
}, { description: 'Validator run metrics (ADR 0120).' })),
|
|
735
|
+
report: Nullable(Type.Object({
|
|
736
|
+
verdict: ArtifactValidationSubmitBody.properties.verdict,
|
|
737
|
+
findingCount: Type.Integer({
|
|
738
|
+
minimum: 0,
|
|
739
|
+
description: 'Number of cited findings.'
|
|
740
|
+
}),
|
|
741
|
+
reportArtifactId: Type.Optional(lifecycleId('Standalone draft report artifact.'))
|
|
742
|
+
}, {
|
|
743
|
+
description: 'Structured report summary; full text is read in chunks.'
|
|
744
|
+
}))
|
|
745
|
+
}, { description: 'Validation progress and report summary.' });
|
|
746
|
+
export const ArtifactReportChunkSchema = Type.Object({
|
|
747
|
+
id: lifecycleId('Validation identifier.'),
|
|
748
|
+
offset: Type.Integer({
|
|
749
|
+
minimum: 0,
|
|
750
|
+
description: 'First UTF-8 byte offset.'
|
|
751
|
+
}),
|
|
752
|
+
totalBytes: Type.Integer({
|
|
753
|
+
minimum: 0,
|
|
754
|
+
description: 'Complete JSON report size.'
|
|
755
|
+
}),
|
|
756
|
+
nextOffset: Nullable(Type.Integer({ minimum: 0, description: 'Next UTF-8 offset, or null.' })),
|
|
757
|
+
text: Type.String({ description: 'Exact report JSON chunk.' })
|
|
758
|
+
}, { description: 'Bounded UTF-8 report response.' });
|
|
759
|
+
export const PendingArtifactActionSchema = Type.Object({
|
|
760
|
+
id: lifecycleId('Pending action identifier.'),
|
|
761
|
+
sessionId: Type.String({
|
|
762
|
+
description: 'Requesting session; user actors use the user prefix.'
|
|
763
|
+
}),
|
|
764
|
+
action: ArtifactAuthorizationRequestBody,
|
|
765
|
+
actionDigest: lifecycleDigest('Exact requested action digest.'),
|
|
766
|
+
manifestDigest: Nullable(lifecycleDigest('Bound validation manifest digest.')),
|
|
767
|
+
expiresAt: Type.Number({
|
|
768
|
+
description: 'Pending action expiry in Unix milliseconds.'
|
|
769
|
+
})
|
|
770
|
+
}, { description: 'One exact action awaiting explicit user approval.' });
|
|
771
|
+
export const ArtifactActionSummarySchema = Type.Object({
|
|
772
|
+
command: Type.String({ description: 'Lifecycle command of the package.' }),
|
|
773
|
+
reason: Type.String({
|
|
774
|
+
description: 'Reason the requester gave, cut to a list-sized length.'
|
|
775
|
+
}),
|
|
776
|
+
documentCount: Type.Integer({
|
|
777
|
+
description: 'Number of documents whose status changes.'
|
|
778
|
+
})
|
|
779
|
+
}, {
|
|
780
|
+
description: 'What the package does, in a few fields for the request list.'
|
|
781
|
+
});
|
|
782
|
+
export const ArtifactActionListItemSchema = Type.Object({
|
|
783
|
+
...PendingArtifactActionSchema.properties,
|
|
784
|
+
summary: Nullable(ArtifactActionSummarySchema)
|
|
785
|
+
}, { description: 'A pending request with a summary of its package.' });
|
|
786
|
+
export const ArtifactActionListSchema = Type.Object({
|
|
787
|
+
storeId: lifecycleId('Owning store.'),
|
|
788
|
+
items: Type.Array(ArtifactActionListItemSchema, {
|
|
789
|
+
description: 'Live pending requests.'
|
|
790
|
+
})
|
|
791
|
+
}, { description: 'Current pending actions in one store.' });
|
|
792
|
+
export const ArtifactActionPhaseSchema = Type.Union([
|
|
793
|
+
Type.Literal('pending'),
|
|
794
|
+
Type.Literal('authorized'),
|
|
795
|
+
Type.Literal('consumed')
|
|
796
|
+
], { description: 'Authorization lifecycle of this request.' });
|
|
797
|
+
export const ArtifactActionInspectionSchema = Type.Object({
|
|
798
|
+
storeId: lifecycleId('Owning store.'),
|
|
799
|
+
pending: PendingArtifactActionSchema,
|
|
800
|
+
phase: ArtifactActionPhaseSchema,
|
|
801
|
+
canExecute: Type.Boolean({
|
|
802
|
+
description: 'Current user owns the requesting execution session.'
|
|
803
|
+
}),
|
|
804
|
+
ready: Type.Boolean({
|
|
805
|
+
description: 'Exact action is currently fresh, valid and unblocked.'
|
|
806
|
+
}),
|
|
807
|
+
problem: Nullable(Type.String({
|
|
808
|
+
description: 'Reason confirmation or execution is blocked.'
|
|
809
|
+
})),
|
|
810
|
+
proposal: Nullable(ArtifactStoredChangeSetSchema),
|
|
811
|
+
validation: Nullable(ArtifactValidationViewSchema),
|
|
812
|
+
preview: Nullable(ArtifactChangeSetPreviewSchema),
|
|
813
|
+
authorizationId: Nullable(lifecycleId('Existing user-owned grant; never persisted by the browser.'))
|
|
814
|
+
}, { description: 'Reviewable current scope with server readiness checks.' });
|
|
815
|
+
export const ArtifactActionStatusStateSchema = Type.Union([
|
|
816
|
+
...ArtifactActionPhaseSchema.anyOf,
|
|
817
|
+
Type.Literal('revoked'),
|
|
818
|
+
Type.Literal('expired')
|
|
819
|
+
], {
|
|
820
|
+
description: 'Phase of the request, or how it ended without a commit: the user rejected it, or its time ran out.'
|
|
821
|
+
});
|
|
822
|
+
export const ArtifactActionStatusSchema = Type.Object({
|
|
823
|
+
id: lifecycleId('Original pending request identifier.'),
|
|
824
|
+
state: ArtifactActionStatusStateSchema,
|
|
825
|
+
authorizationId: Nullable(lifecycleId('Grant for this requesting session after approval.')),
|
|
826
|
+
expiresAt: Type.Number({
|
|
827
|
+
description: 'Authorization expiry in Unix milliseconds.'
|
|
828
|
+
})
|
|
829
|
+
}, { description: 'Read-only authorization status for the requesting session.' });
|
|
830
|
+
export const ArtifactValidationInspectionSchema = Type.Object({
|
|
831
|
+
storeId: lifecycleId('Owning store.'),
|
|
832
|
+
proposal: ArtifactStoredChangeSetSchema,
|
|
833
|
+
validation: ArtifactValidationViewSchema,
|
|
834
|
+
preview: ArtifactChangeSetPreviewSchema,
|
|
835
|
+
ready: Type.Boolean({
|
|
836
|
+
description: 'A current matching pass has no blocking conflicts.'
|
|
837
|
+
}),
|
|
838
|
+
problem: Nullable(Type.String({ description: 'Why authorization cannot be requested.' }))
|
|
839
|
+
}, { description: 'Read-only validation freshness and proposed post-state.' });
|
|
840
|
+
export const ArtifactExportQuery = Type.Object({
|
|
841
|
+
format: Type.Union([Type.Literal('original'), Type.Literal('metadata-history')], {
|
|
842
|
+
description: 'Exact original file or consistent metadata history snapshot.'
|
|
843
|
+
})
|
|
844
|
+
}, { additionalProperties: false, description: 'Artifact download format.' });
|
|
845
|
+
export const ArtifactOriginalExportSchema = Type.String({
|
|
846
|
+
format: 'binary',
|
|
847
|
+
description: 'Verified exact original Markdown bytes, including historical frontmatter.'
|
|
848
|
+
});
|
|
849
|
+
export const ArtifactExportEventSchema = Type.Object({ ...ArtifactEventSchema.properties, snapshot: ArtifactSchema }, {
|
|
850
|
+
additionalProperties: false,
|
|
851
|
+
description: 'Metadata event with its complete immutable artifact version.'
|
|
852
|
+
});
|
|
853
|
+
export const ArtifactMetadataExportSchema = Type.Object({
|
|
854
|
+
formatVersion: Type.Literal(1, {
|
|
855
|
+
description: 'Metadata export format version.'
|
|
856
|
+
}),
|
|
857
|
+
storeId: Type.String({ description: 'Owning artifact store identity.' }),
|
|
858
|
+
artifactId: Type.String({ description: 'Exported artifact identity.' }),
|
|
859
|
+
snapshotSeq: Type.Integer({
|
|
860
|
+
minimum: 0,
|
|
861
|
+
description: 'Store artifact event sequence captured with current metadata; history never exceeds this boundary.'
|
|
862
|
+
}),
|
|
863
|
+
storeEpoch: Type.Integer({
|
|
864
|
+
minimum: 0,
|
|
865
|
+
description: 'Store revision captured with the metadata snapshot.'
|
|
866
|
+
}),
|
|
867
|
+
artifact: ArtifactSchema,
|
|
868
|
+
history: Type.Array(ArtifactExportEventSchema, {
|
|
869
|
+
description: 'Complete ordered metadata events through snapshotSeq, with full version snapshots.'
|
|
870
|
+
})
|
|
871
|
+
}, {
|
|
872
|
+
additionalProperties: false,
|
|
873
|
+
description: 'Consistent artifact metadata and complete history export, streamed in bounded pages.'
|
|
874
|
+
});
|