chainlesschain 0.166.141 → 0.166.143
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 +249 -14
- package/package.json +2 -2
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-BefmcZw2.js → AIOps-DNySV2Kf.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-BBlS9rmj.js → ActionButton-ByFuxJsa.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-DfNjXT9e.js → Analytics-ETbdywk5.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-CIBZPPMS.js → AppLayout-CuHekZaP.js} +2 -2
- package/src/assets/web-panel/assets/{Artifacts-CE66rTTZ.js → Artifacts-BJJq2BDq.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DOC8Lt8U.js → Audit-DXrietv8.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-9TMG041Q.js → BackgroundAgents-CFB1fxsr.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-us3KWb9F.js → Backup-VLtflRmp.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-D6Q95Wr5.js → BaseInput-BbqBaS2r.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-BPrM5ARp.js → Chat-t0g7BXL8.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-Drs9vSc4.js → ChatBubbleRenderer-JNFsjV0j.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-DqZGMV0o.js → Checkbox-BCSclHQb.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-CmolL6wr.js → Codegen-BcyINEHT.js} +1 -1
- package/src/assets/web-panel/assets/{Col-BwHSmoYQ.js → Col-C-0WNlwS.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DGWqobpd.js → Community-DxZeoORX.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-t_yy09-r.js → Compact-BNnX4jpz.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-D0S8-EsN.js → Compliance-KnjHtn9C.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-Y1LiuRwP.js → Cowork-CDyCrhbX.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-FTqEw7QV.js → Cron-DxpS3D1G.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-C3rPZ4Qu.js → Crosschain-BSzTZYyc.js} +1 -1
- package/src/assets/web-panel/assets/{DID-Ba2zySM-.js → DID-Bfj9Vdne.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-D6xyN2ND.js → Dashboard-CcERVdgo.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BF4QuXJw.js → Dropdown-BtYXAz6E.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-s9dUxq14.js → EmailListRenderer-fdCMeGXU.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-CoAKOfqZ.js → EvolutionSettings-LHxhcuF2.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-CEznwH1c.js → FamilyGuardDashboard-MIgtLsos.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-rIzOt8-a.js → Federation-9-TOztwa.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BARFiExr.js → FormItemContext-BKcwEE6w.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DI0A4swS.js → GenericCardRenderer-DJBPVUK2.js} +1 -1
- package/src/assets/web-panel/assets/{Git-DdmysND4.js → Git-C_XYISjG.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-DrdhwUz2.js → Governance-DWsbPrwq.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-Scm8tumd.js → Inference-D0_bYket.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-_6bgPs4W.js → KnowledgeGraph-BoA3VQlw.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-DW_v7bSo.js → Logs-LEGItChf.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-7JABuv1j.js → MarkdownRenderer-DOHVc-Uw.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-0h3YSvME.js → Marketplace-BKovl9NH.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-Byrg0Y3e.js → McpTools-D61ktoGb.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-Cyoq-o29.js → Memory-CllorS0l.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-ISIlploU.js → MobileBridge-D-dJ78bk.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-04EncaRx.js → MobileProjects-CaxMKkd3.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-BMzkpyOF.js → Mtc-qEc62Qsx.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-Cx7BR5sz.js → MtcAudit-BY68jOZJ.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-D4pmkSX4.js → Multisig-eCCR8ELt.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-CCfaaWNu.js → NLProgramming-VtGv8pky.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-Mq-1ZyaH.js → Notes-CPkYQySe.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-rzf5V1TR.js → NotificationSettings-BuAvlHUu.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-OREUs5ue.js → OrderTableRenderer-CLf_HAGv.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-BQfOATgw.js → Organization-DjujhMbD.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-D7Pa6aaA.js → Overflow-RznznTS4.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CaJ79ZsC.js → P2P-DSa5ot0t.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-CtimQQN3.js → PdhVaultBrowser-oSEh6vkf.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-AzmmkLZ0.js → Permissions-CdOZguX9.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-BRU8ME7z.js → PersonalDataHub-B4--6iEF.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-BnNqutXh.js → Pipeline-BnI57jE8.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-gMyZcxsz.js → Privacy-C8MId3ad.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CkK-Fvr0.js → ProjectInit-DPGyYO8a.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-CGY_uiIX.js → ProjectSettings-qBMqaJaO.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-DBNC7xXG.js → Projects-Bq87Syce.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-BVgWawtE.js → Providers-CVuG9Ugf.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-DZILESCa.js → QrScannerModal-C94c8m3q.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DwRBzFWW.js → QuickAsk-BvfsXZ8s.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-B3VxvUih.js → Recommend-CoezBYH9.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-DM74lufU.js → RemoteSession-CcYC4v3u.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-DOOEuGHh.js → Reputation-diDbL4cO.js} +1 -1
- package/src/assets/web-panel/assets/{Row-BZJYAo0S.js → Row-5qp3_fNS.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-CYw44jcD.js → RssFeed-BCsMvpV4.js} +1 -1
- package/src/assets/web-panel/assets/{Search-CbypjDNG.js → Search-Br9nVxOp.js} +1 -1
- package/src/assets/web-panel/assets/{Security-0rSBDrXh.js → Security-BdOUzRfA.js} +1 -1
- package/src/assets/web-panel/assets/{Services-kqP79CBD.js → Services-Cp9TqzyN.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-BjxvGVfI.js → Skeleton-DSdWsUMR.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-SOoWyPCO.js → Skills-DRczAMTe.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-kdRVAT19.js → Sla-B6G_Vd8N.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-DILtcMaJ.js → SpeechSettings-BCcLx5x4.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-C98Jauc4.js → SyncSettings-BFhwtxCp.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-Bw-KaQAs.js → Tasks-DGRE6VHO.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CDJ027Hd.js → Templates-CJkJRFzd.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-BqNV62UA.js → Tenant-CAOv6p00.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-B8aQ3GLO.js → Terminal-CDrwwrKj.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-BSpccq11.js → TimelineRenderer-DI0YE2SN.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BbGMoFO6.js → Tokens-DmqWTZSG.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-D75Mawa_.js → Trigger-CkXkhmjk.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-BiK_Pk05.js → Trust-U8YJLcoJ.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-Dv2xX_b9.js → UkeySign-BLTozMmr.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CdBWfeEE.js → VideoEditing-DHKyFlZa.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-Cvrp4agg.js → Wallet-DapBxIQt.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-D0Htlf3v.js → WebAuthn-CkvG3yOr.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-nuUBOHIF.js → WorkflowEditor-cNLsinXP.js} +1 -1
- package/src/assets/web-panel/assets/{chat-C6MLShIo.js → chat-BzgkgfMC.js} +1 -1
- package/src/assets/web-panel/assets/{colors-9G5FqFOC.js → colors-BPpVKQsb.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-0M49EurU.js → compact-item-zepznuTv.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-CiDDLED_.js → createContext-BRto-SQH.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-wZvUczmn.js → hasIn-CqsmU_n6.js} +1 -1
- package/src/assets/web-panel/assets/{index-B0JZ_ccM.js → index-B-bNzvdU.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_XOMujL.js → index-B0Z6rfV-.js} +1 -1
- package/src/assets/web-panel/assets/{index-DwX9cOL6.js → index-B9_jRD2e.js} +1 -1
- package/src/assets/web-panel/assets/{index-DwUOiN8M.js → index-BEXKES7V.js} +1 -1
- package/src/assets/web-panel/assets/{index-8jz-X3xg.js → index-BGHd4D8F.js} +1 -1
- package/src/assets/web-panel/assets/{index-BVV2mBbo.js → index-BLwY9y0X.js} +1 -1
- package/src/assets/web-panel/assets/{index-qJcOtd8J.js → index-B_l6gfDh.js} +1 -1
- package/src/assets/web-panel/assets/{index-B6TAOS4G.js → index-BeBxP1M6.js} +1 -1
- package/src/assets/web-panel/assets/{index-C63qiwQz.js → index-BeSzdB7x.js} +1 -1
- package/src/assets/web-panel/assets/{index-k0BVfcwQ.js → index-BuBnM6Kz.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXIY2BIN.js → index-Bz7pG8z3.js} +1 -1
- package/src/assets/web-panel/assets/{index-D51V5vmz.js → index-CBI-7Q3W.js} +1 -1
- package/src/assets/web-panel/assets/{index-BWTcG128.js → index-CTk9gY88.js} +1 -1
- package/src/assets/web-panel/assets/{index-sBsJaBmM.js → index-CdHXVSZ4.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dclwd_lj.js → index-CmPnDXx4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BlcOkfzz.js → index-CnezE05k.js} +1 -1
- package/src/assets/web-panel/assets/{index-DOxTmc3k.js → index-CwkhrUmw.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cs66y4oC.js → index-CzoKAiyT.js} +3 -3
- package/src/assets/web-panel/assets/{index-BzeA3eRQ.js → index-DDPmr5Yr.js} +1 -1
- package/src/assets/web-panel/assets/{index-CdaLWIz-.js → index-DEbAW3Ec.js} +1 -1
- package/src/assets/web-panel/assets/{index-DvWRS-s7.js → index-DJSn3owP.js} +1 -1
- package/src/assets/web-panel/assets/{index-DN9t1qjW.js → index-DKa_jSfj.js} +1 -1
- package/src/assets/web-panel/assets/{index-BTCIIdoS.js → index-DUclk35X.js} +1 -1
- package/src/assets/web-panel/assets/{index-BmS2P_eX.js → index-DXkw-nt5.js} +1 -1
- package/src/assets/web-panel/assets/{index-CoxzvhoN.js → index-D_-w4KkD.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cz1SAgnb.js → index-D_asIcU7.js} +1 -1
- package/src/assets/web-panel/assets/{index-BfwJm0DU.js → index-Df_CY0We.js} +1 -1
- package/src/assets/web-panel/assets/{index-JhfNEldK.js → index-Dnvj_XU-.js} +1 -1
- package/src/assets/web-panel/assets/index-DruOFzuF.js +1 -0
- package/src/assets/web-panel/assets/{index-D9J_tLGk.js → index-DvGttIXQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-DcZxOXd8.js → index-JrVhUwyh.js} +1 -1
- package/src/assets/web-panel/assets/{index-CdUmgLxP.js → index-LVvzNdPa.js} +1 -1
- package/src/assets/web-panel/assets/{index-CTy9gD3m.js → index-Q5sAV7wp.js} +1 -1
- package/src/assets/web-panel/assets/{index-CtbFv3Et.js → index-S8fkzbQ_.js} +1 -1
- package/src/assets/web-panel/assets/{index-BCfxxScC.js → index-Z6DBe2RU.js} +1 -1
- package/src/assets/web-panel/assets/{index-dJ_V_Fqy.js → index-faHHtBKj.js} +1 -1
- package/src/assets/web-panel/assets/index-hhOrZ6HO.js +1 -0
- package/src/assets/web-panel/assets/{index-DeHSwWVG.js → index-w36TkwyO.js} +1 -1
- package/src/assets/web-panel/assets/{index-D2wN6VIq.js → index-wbvZayBb.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DyIyjurJ.js → initDefaultProps-BlhbrsQk.js} +1 -1
- package/src/assets/web-panel/assets/{motion-B2D0PuTM.js → motion-UZx12NPM.js} +1 -1
- package/src/assets/web-panel/assets/{move-B22T5MnN.js → move-BTby5W4q.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-i4b7HNzF.js → mtc-parser-BOOaGiCg.js} +1 -1
- package/src/assets/web-panel/assets/{omit-ByNIr_gz.js → omit-BVylGzEr.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-_xP2RvxA.js → pickAttrs-Cp3Nflbr.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CVDvzK0z.js → placementArrow-BVXYvwH2.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CI1toXJ_.js → responsiveObserve-C67SbpBN.js} +1 -1
- package/src/assets/web-panel/assets/{slide-2_VosSRQ.js → slide-CnBvM22R.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-CMiWWrZC.js → statusUtils-T8fy53tf.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-DY8wTVCe.js → styleChecker-Bf7i4nlm.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DkdcgIyl.js → useFlexGapSupport-BUKk7jqw.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-gpl11PEF.js → useFs-T5lg6SpD.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DqnQ0H9y.js → usePersonalDataHub-Brvye8Tg.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CgY9xUvr.js → vnode-CK992ojP.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-Ch0jan5_.js → zoom-CcABB_97.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/goal.js +340 -145
- package/src/commands/setup.js +17 -0
- package/src/data/changelog.json +26 -0
- package/src/lib/llm-onboarding-catalog.json +4 -3
- package/src/lib/plugin-runtime/cli-goal-capabilities.js +29 -0
- package/src/lib/plugin-runtime/cli-goal-draft-request.js +25 -15
- package/src/lib/plugin-runtime/cli-goal-drafts.js +78 -35
- package/src/lib/plugin-runtime/cli-goal-event-history.js +284 -0
- package/src/lib/plugin-runtime/cli-goal-events.js +175 -0
- package/src/lib/plugin-runtime/cli-goal-extension-host.js +21 -13
- package/src/lib/plugin-runtime/cli-project-goal-events.js +212 -0
- package/src/lib/plugin-runtime/examples/goal-project-observer/plugin.json +20 -0
- package/src/lib/plugin-runtime/examples/goal-status-observer/plugin.json +17 -0
- package/src/lib/plugin-runtime/examples/goal-task-creator/README.md +60 -0
- package/src/lib/plugin-runtime/examples/goal-task-creator/plugin.json +13 -0
- package/src/lib/plugin-runtime/examples/project-delivery-assistant/README.md +125 -0
- package/src/lib/plugin-runtime/examples/project-delivery-assistant/plugin.json +8 -8
- package/src/lib/plugin-runtime/goal-extensions.js +17 -0
- package/src/lib/project-goal-connection.js +126 -30
- package/src/lib/project-goal-draft-connection.js +18 -11
- package/src/assets/web-panel/assets/index-C101Sec6.js +0 -1
- package/src/assets/web-panel/assets/index-D23TaGOp.js +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Project delivery assistant 0.3.0 (source-only)
|
|
2
|
+
|
|
3
|
+
This data-only scenario package combines evidence panels, bounded observations,
|
|
4
|
+
retained event replay, user-selected task-description drafts and separately
|
|
5
|
+
adopted task-creation request files, with separate CLI online creation drafts. It runs through
|
|
6
|
+
the existing CLI and both IDE plugin managers. Requires CLI 0.166.143, Session
|
|
7
|
+
Core 0.3.25 and a matching desktop build with the separately authorized goal
|
|
8
|
+
connections. Paired IDE releases are Open VSX 0.37.179 and JetBrains 0.4.196.
|
|
9
|
+
The version ranges in the manifest are compatibility floors; each operation
|
|
10
|
+
still needs its native source authorization.
|
|
11
|
+
|
|
12
|
+
This 0.3.0 source package requires matching local CLI and IDE builds. Its host
|
|
13
|
+
version floors do not add creation controls to the already published products.
|
|
14
|
+
The package contains no hooks, binaries, arbitrary code or autonomous scheduler.
|
|
15
|
+
It exports creation requests or saves pending creation drafts; the desktop
|
|
16
|
+
requires a current preview and individual native confirmation before creating a
|
|
17
|
+
pending task. It does not execute that task or mark a goal complete.
|
|
18
|
+
|
|
19
|
+
From the repository root, install at the scope you will use:
|
|
20
|
+
|
|
21
|
+
```powershell
|
|
22
|
+
cc plugin add packages/cli/src/lib/plugin-runtime/examples/project-delivery-assistant --scope project --json
|
|
23
|
+
cc plugin trust project-delivery-assistant --scope project
|
|
24
|
+
cc plugin consent project-delivery-assistant --scope project --grant --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Consent covers the full declared capability set. Each command still needs its
|
|
28
|
+
own selected source and separate desktop authorization:
|
|
29
|
+
|
|
30
|
+
| Entry | Source and result |
|
|
31
|
+
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `goal panels` | A separately authorized evidence connection; objective/status and historical risk/receipt summary. A summary-only connection cannot supply evidence fields. |
|
|
33
|
+
| `goal watch` with a connection | A v4 event connection; risk-check and action-receipt observations for a bounded interval. Polling can miss intermediate changes. |
|
|
34
|
+
| `goal watch` without a connection | A standalone CLI goal; status changes only. This does not subscribe to native project status. |
|
|
35
|
+
| `goal replay` | A v5 retained-history connection and explicit new/resume checkpoint; one page per invocation. |
|
|
36
|
+
| `goal draft-create-request` | A selected goal connection, current native creation proposal ID, explicit task type and body; exports a file for separate per-file desktop adoption. |
|
|
37
|
+
| `goal draft-access`, `draft-sources`, `draft-send`, `draft-receipt` | A separate v3 pending-draft authorization bound to this plugin/version/declaration. The user selects a current native source and a UTF-8 description file. |
|
|
38
|
+
| `goal draft-create-access`, `draft-create-sources`, `draft-create-send`, `draft-create-receipt` | Separate native v6 creation consent, current creation source, explicit task type and durable reference; saves pending only. |
|
|
39
|
+
|
|
40
|
+
In the desktop goal area, export the relevant connection with its separate native
|
|
41
|
+
confirmation. Connections are short-lived and tied to the active identity and
|
|
42
|
+
goal revision; keep their private files local. One connection does not grant the
|
|
43
|
+
other surfaces. For example:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
cc goal panels <goal-id> --connection "<evidence.json>" --plugin project-delivery-assistant --scope project --json
|
|
47
|
+
cc goal watch <goal-id> --connection "<events-v4.json>" --plugin project-delivery-assistant --scope project --duration 60 --json
|
|
48
|
+
cc goal replay <goal-id> --connection "<history-v5.json>" --checkpoint "<checkpoint.json>" --checkpoint-mode new --plugin project-delivery-assistant --scope project --json
|
|
49
|
+
# Subsequent explicit page: use the same checkpoint and --checkpoint-mode resume.
|
|
50
|
+
cc goal replay <goal-id> --connection "<history-v5.json>" --checkpoint "<checkpoint.json>" --checkpoint-mode resume --plugin project-delivery-assistant --scope project --json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Replay scans at most 20 retained events per page. Exit zero confirms checkpoint
|
|
54
|
+
commit; output alone does not. Keep the checkpoint after interruption because it
|
|
55
|
+
may already have advanced. Delivery can repeat event IDs. The newest 1000
|
|
56
|
+
instrumented events are retained; pre-instrumentation history is not backfilled.
|
|
57
|
+
Retention gaps and database regression are reported, without automatic reset.
|
|
58
|
+
|
|
59
|
+
For a pending description draft, export this plugin's access request first:
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
cc goal draft-access --plugin project-delivery-assistant --scope project --out "<new-access.json>" --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
In the desktop, choose the separate online-draft authorization and select that
|
|
66
|
+
access file. In either IDE select **Send online draft…** / **Submit pending
|
|
67
|
+
draft…**, pick the v3 connection, a current native source, the proposed description
|
|
68
|
+
and a new submission-record file. Alternatively use the CLI:
|
|
69
|
+
|
|
70
|
+
```powershell
|
|
71
|
+
cc goal draft-sources <goal-id> --connection "<draft-v3.json>" --plugin project-delivery-assistant --scope project --json
|
|
72
|
+
cc goal draft-send <goal-id> --connection "<draft-v3.json>" --plugin project-delivery-assistant --scope project --source "<source-id>" --request-id "<stable-request-id>" --title "Delivery follow-up" --description-file "<description.txt>" --record "<new-submission.json>" --json
|
|
73
|
+
cc goal draft-receipt <goal-id> --connection "<draft-v3.json>" --plugin project-delivery-assistant --scope project --record "<submission.json>" --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
A saved draft is pending. Open it in the desktop, inspect the current native
|
|
77
|
+
preview, then confirm through the existing action flow. Read the real receipt
|
|
78
|
+
and run a fresh risk check to assess the outcome; a description edit does not
|
|
79
|
+
prove that a deadline or dependency risk was resolved. If submission is unknown,
|
|
80
|
+
keep its record and look up the receipt before deciding whether to send again.
|
|
81
|
+
|
|
82
|
+
For creation, enable the goal's creation suggestion scope and run a fresh risk
|
|
83
|
+
check. Copy a current creation proposal ID from the desktop, then export:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
cc goal draft-create-request <goal-id> --connection "<summary-connection.json>" --plugin project-delivery-assistant --scope project --source "<current-native-creation-proposal-id>" --request-id "<stable-request-id>" --title "Delivery follow-up" --task-type analyze_data --description-file "<description.txt>" --out "<new-creation-request.json>" --json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
In either IDE use **Export task creation request…** and select the task type,
|
|
90
|
+
connection, source ID, description and new output file through native controls.
|
|
91
|
+
The IDE checks a separate creation export result and only reports success after
|
|
92
|
+
the CLI exits successfully. Import the same request in the desktop, inspect its
|
|
93
|
+
full body and task type, adopt it, then build and confirm the native preview.
|
|
94
|
+
An interrupted or failed export may have created the output file; inspect and
|
|
95
|
+
reuse it explicitly. Do not replace its request identity to recover an unknown
|
|
96
|
+
adoption outcome. Online v3 description grants never authorize creation.
|
|
97
|
+
|
|
98
|
+
For online creation, use the same commands from the
|
|
99
|
+
[creation example](../goal-task-creator/README.md) with
|
|
100
|
+
`--plugin project-delivery-assistant`. Export a creation access file and obtain
|
|
101
|
+
independent native v6 consent; the v3 description connection cannot substitute.
|
|
102
|
+
Keep the submission reference to query unknown outcomes without resending.
|
|
103
|
+
Both source IDEs expose dedicated online creation access/send/receipt controls
|
|
104
|
+
with native connection, source, task type and reference selections. File export
|
|
105
|
+
remains available; source builds require matching local CLI/Core/desktop code.
|
|
106
|
+
|
|
107
|
+
In VS Code / JetBrains choose this installed plugin, then **CLI goal panels…**,
|
|
108
|
+
**Observe desktop events…**, **Recover retained history…** or the draft controls.
|
|
109
|
+
Recovery uses native connection and new/resume checkpoint dialogs; **Read next
|
|
110
|
+
page / check again** is explicit. No automatic observation, retry or business
|
|
111
|
+
action starts when the package is installed or reinstalled.
|
|
112
|
+
|
|
113
|
+
Disable or uninstall using the normal plugin controls. New operations are refused,
|
|
114
|
+
and active observers stop when they recheck admission. Native goals, actions,
|
|
115
|
+
receipts and saved checkpoints stay in their existing stores. Reinstalling keeps
|
|
116
|
+
the existing trust/consent policy, and requires a new explicit command or IDE
|
|
117
|
+
action to read again; it does not reconnect by itself. Version changes require
|
|
118
|
+
project trust again, capability expansion requires new consent, and a changed
|
|
119
|
+
declaration/goal binding requires a matching new desktop authorization and an
|
|
120
|
+
explicit new checkpoint when the old binding no longer matches.
|
|
121
|
+
|
|
122
|
+
Upgrading from 0.2.0 requires trust for 0.3.0 and additional consent for
|
|
123
|
+
`proposal:task.create`. Previous consents cannot silently grant that capability.
|
|
124
|
+
Real IDE/Electron GUI journeys, automatic drafting,
|
|
125
|
+
independent business-effect evaluation and release gates remain pending.
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-delivery-assistant",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Project evidence, bounded observations, retained replay, description drafts and separately adopted task-creation request files",
|
|
5
5
|
"permissions": {
|
|
6
6
|
"goalExtension": [
|
|
7
7
|
"event:goal.status.changed",
|
|
8
8
|
"event:risk.review.completed",
|
|
9
9
|
"event:action.receipt.updated",
|
|
10
10
|
"panel:goal.evidence",
|
|
11
|
-
"proposal:task.
|
|
12
|
-
"proposal:task.
|
|
11
|
+
"proposal:task.description.update",
|
|
12
|
+
"proposal:task.create"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"goalExtension": {
|
|
16
16
|
"apiVersion": "1.0.0",
|
|
17
17
|
"hosts": {
|
|
18
|
-
"cli": ">=0.166.
|
|
19
|
-
"vscode": ">=0.37.
|
|
20
|
-
"jetbrains": ">=0.4.
|
|
18
|
+
"cli": ">=0.166.143",
|
|
19
|
+
"vscode": ">=0.37.179",
|
|
20
|
+
"jetbrains": ">=0.4.196"
|
|
21
21
|
},
|
|
22
22
|
"events": [
|
|
23
23
|
"goal.status.changed",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"fallback": "text"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
"proposals": ["task.
|
|
36
|
+
"proposals": ["task.description.update", "task.create"]
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -36,6 +36,11 @@ function fixedHostOptions(options) {
|
|
|
36
36
|
id: options.host?.id,
|
|
37
37
|
version: options.host?.version,
|
|
38
38
|
capabilities: Object.freeze([...(options.host?.capabilities || [])]),
|
|
39
|
+
activeCapabilities: Object.freeze([
|
|
40
|
+
...(options.host?.activeCapabilities ??
|
|
41
|
+
options.host?.capabilities ??
|
|
42
|
+
[]),
|
|
43
|
+
]),
|
|
39
44
|
}),
|
|
40
45
|
authorize: options.authorize,
|
|
41
46
|
readEvent: options.readEvent,
|
|
@@ -44,6 +49,14 @@ function fixedHostOptions(options) {
|
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
function requireActiveCapability(options, capability) {
|
|
53
|
+
if (
|
|
54
|
+
!options.host.capabilities.includes(capability) ||
|
|
55
|
+
!options.host.activeCapabilities.includes(capability)
|
|
56
|
+
)
|
|
57
|
+
throw new Error("goal extension capability is inactive for this operation");
|
|
58
|
+
}
|
|
59
|
+
|
|
47
60
|
/** Compatibility and mandatory consent are independent of legacy policy flags. */
|
|
48
61
|
export function collectGoalExtensions(options = {}) {
|
|
49
62
|
const extensions = [];
|
|
@@ -139,6 +152,7 @@ export async function projectGoalExtensionEvent(ref, request, options = {}) {
|
|
|
139
152
|
options = fixedHostOptions(options);
|
|
140
153
|
const type = request?.type;
|
|
141
154
|
const plugin = admittedPlugin(ref, options, "events", type);
|
|
155
|
+
requireActiveCapability(options, `event:${type}`);
|
|
142
156
|
const source = goalRef(request.goalRef);
|
|
143
157
|
const context = Object.freeze({
|
|
144
158
|
plugin: Object.freeze({
|
|
@@ -182,6 +196,7 @@ export async function projectGoalExtensionPanel(ref, request, options = {}) {
|
|
|
182
196
|
(entry) => entry.id === request?.panelId,
|
|
183
197
|
);
|
|
184
198
|
if (!panel) throw new Error("goal extension panel is undeclared");
|
|
199
|
+
requireActiveCapability(options, `panel:${panel.slot}`);
|
|
185
200
|
const source = goalRef(request.goalRef);
|
|
186
201
|
const context = Object.freeze({
|
|
187
202
|
plugin: Object.freeze({
|
|
@@ -229,6 +244,7 @@ export async function proposeGoalExtensionAction(ref, raw, options = {}) {
|
|
|
229
244
|
raw = normalizeGoalExtensionProposal(raw);
|
|
230
245
|
if (!plugin.declaration.proposals.includes(raw.type))
|
|
231
246
|
throw new Error("goal extension proposal is undeclared");
|
|
247
|
+
requireActiveCapability(options, `proposal:${raw.type}`);
|
|
232
248
|
const source = raw.goalRef;
|
|
233
249
|
const title = raw.title;
|
|
234
250
|
const description = raw.description;
|
|
@@ -243,6 +259,7 @@ export async function proposeGoalExtensionAction(ref, raw, options = {}) {
|
|
|
243
259
|
type: raw.type,
|
|
244
260
|
sourceRef: raw.sourceRef,
|
|
245
261
|
requestId: raw.requestId,
|
|
262
|
+
...(raw.type === "task.create" ? { taskType: raw.taskType } : {}),
|
|
246
263
|
});
|
|
247
264
|
await authorize(options.authorize, context);
|
|
248
265
|
if (typeof options.enqueueProposal !== "function")
|
|
@@ -5,8 +5,15 @@ import http from "node:http";
|
|
|
5
5
|
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
6
6
|
import { inspectPrivatePath } from "@chainlesschain/session-core/private-storage";
|
|
7
7
|
import { goalExtensionRef } from "@chainlesschain/session-core/goal-extension-proposal-contract";
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
validateGoalEvidenceProjection,
|
|
10
|
+
validateGoalEventHistoryPage,
|
|
11
|
+
parseGoalEventCursor,
|
|
12
|
+
} from "@chainlesschain/session-core/goal-evidence-contract";
|
|
13
|
+
import {
|
|
14
|
+
validateGoalDraftDescriptor,
|
|
15
|
+
validateGoalCreateDraftDescriptor,
|
|
16
|
+
} from "@chainlesschain/session-core/goal-draft-connection-contract";
|
|
10
17
|
import { createProjectGoalDraftClient } from "./project-goal-draft-connection.js";
|
|
11
18
|
function fail() {
|
|
12
19
|
throw new Error("CLI_GOAL_CONNECTION_UNAVAILABLE");
|
|
@@ -47,8 +54,17 @@ export function createProjectGoalConnection(file) {
|
|
|
47
54
|
const count = fs.readSync(fd, raw, 0, raw.length, 0);
|
|
48
55
|
if (count > 4096 || !sameFile(opened, fs.fstatSync(fd))) fail();
|
|
49
56
|
const descriptor = JSON.parse(raw.subarray(0, count).toString("utf8"));
|
|
50
|
-
if (
|
|
51
|
-
|
|
57
|
+
if (
|
|
58
|
+
[
|
|
59
|
+
"chainlesschain.project-goal-connection/v3",
|
|
60
|
+
"chainlesschain.project-goal-connection/v6",
|
|
61
|
+
].includes(descriptor.schema)
|
|
62
|
+
) {
|
|
63
|
+
const verified = (
|
|
64
|
+
descriptor.schema.endsWith("/v6")
|
|
65
|
+
? validateGoalCreateDraftDescriptor
|
|
66
|
+
: validateGoalDraftDescriptor
|
|
67
|
+
)(descriptor);
|
|
52
68
|
return createProjectGoalDraftClient(verified, () => {
|
|
53
69
|
if (
|
|
54
70
|
Date.now() >= verified.expiresAt ||
|
|
@@ -59,17 +75,32 @@ export function createProjectGoalConnection(file) {
|
|
|
59
75
|
}
|
|
60
76
|
const evidence =
|
|
61
77
|
descriptor.schema === "chainlesschain.project-goal-connection/v2";
|
|
62
|
-
const
|
|
78
|
+
const events =
|
|
79
|
+
descriptor.schema === "chainlesschain.project-goal-connection/v4";
|
|
80
|
+
const history =
|
|
81
|
+
descriptor.schema === "chainlesschain.project-goal-connection/v5";
|
|
82
|
+
const endpointPath = history
|
|
83
|
+
? "/goal-event-history"
|
|
84
|
+
: events
|
|
85
|
+
? "/goal-events"
|
|
86
|
+
: evidence
|
|
87
|
+
? "/goal-evidence"
|
|
88
|
+
: "/goal-summary";
|
|
63
89
|
if (
|
|
64
90
|
Object.keys(descriptor).sort().join() !==
|
|
65
|
-
(evidence
|
|
91
|
+
(evidence || events || history
|
|
66
92
|
? "capability,endpoint,expiresAt,goalRef,key,schema"
|
|
67
93
|
: "endpoint,expiresAt,goalRef,key,schema") ||
|
|
68
|
-
(
|
|
69
|
-
? descriptor.capability !== "goal.
|
|
70
|
-
:
|
|
94
|
+
(history
|
|
95
|
+
? descriptor.capability !== "goal.event-history"
|
|
96
|
+
: events
|
|
97
|
+
? descriptor.capability !== "goal.events"
|
|
98
|
+
: evidence
|
|
99
|
+
? descriptor.capability !== "goal.evidence"
|
|
100
|
+
: descriptor.schema !==
|
|
101
|
+
"chainlesschain.project-goal-connection/v1") ||
|
|
71
102
|
typeof descriptor.endpoint !== "string" ||
|
|
72
|
-
!/^http:\/\/127\.0\.0\.1:[1-9][0-9]{0,4}\/goal-(?:summary|evidence)$/.test(
|
|
103
|
+
!/^http:\/\/127\.0\.0\.1:[1-9][0-9]{0,4}\/goal-(?:summary|evidence|events|event-history)$/.test(
|
|
73
104
|
descriptor.endpoint,
|
|
74
105
|
) ||
|
|
75
106
|
new URL(descriptor.endpoint).pathname !== endpointPath ||
|
|
@@ -93,22 +124,26 @@ export function createProjectGoalConnection(file) {
|
|
|
93
124
|
createHmac("sha256", Buffer.from(descriptor.key, "hex"))
|
|
94
125
|
.update(value)
|
|
95
126
|
.digest("hex");
|
|
96
|
-
async function read(id = ref.id) {
|
|
127
|
+
async function read(id = ref.id, { signal, after } = {}) {
|
|
97
128
|
validate();
|
|
98
129
|
if (id !== ref.id) fail();
|
|
130
|
+
if (after !== undefined && !history) fail();
|
|
131
|
+
if (after !== undefined) parseGoalEventCursor(after);
|
|
132
|
+
const requestPath =
|
|
133
|
+
endpointPath + (after === undefined ? "" : `?after=${after}`);
|
|
99
134
|
const nonce = randomBytes(32).toString("hex");
|
|
100
135
|
try {
|
|
101
136
|
const result = await new Promise((resolve, reject) => {
|
|
102
137
|
const request = http.get(
|
|
103
|
-
descriptor.endpoint
|
|
138
|
+
descriptor.endpoint +
|
|
139
|
+
(after === undefined ? "" : `?after=${after}`),
|
|
104
140
|
{
|
|
105
141
|
agent: false,
|
|
142
|
+
signal,
|
|
106
143
|
maxHeaderSize: 4096,
|
|
107
144
|
headers: {
|
|
108
145
|
"X-CC-Nonce": nonce,
|
|
109
|
-
"X-CC-Signature": mac(
|
|
110
|
-
`request\nGET\n${endpointPath}\n${nonce}`,
|
|
111
|
-
),
|
|
146
|
+
"X-CC-Signature": mac(`request\nGET\n${requestPath}\n${nonce}`),
|
|
112
147
|
},
|
|
113
148
|
},
|
|
114
149
|
(response) => {
|
|
@@ -124,19 +159,48 @@ export function createProjectGoalConnection(file) {
|
|
|
124
159
|
const body = Buffer.concat(chunks).toString("utf8"),
|
|
125
160
|
signature = response.headers["x-cc-signature"];
|
|
126
161
|
if (
|
|
127
|
-
response.statusCode !== 200 ||
|
|
162
|
+
(!history && response.statusCode !== 200) ||
|
|
128
163
|
typeof signature !== "string" ||
|
|
129
164
|
!/^[a-f0-9]{64}$/.test(signature) ||
|
|
130
165
|
!timingSafeEqual(
|
|
131
166
|
Buffer.from(signature),
|
|
132
|
-
Buffer.from(
|
|
167
|
+
Buffer.from(
|
|
168
|
+
mac(
|
|
169
|
+
history
|
|
170
|
+
? `response\n${nonce}\n${response.statusCode}\n${body}`
|
|
171
|
+
: `response\n${nonce}\n${body}`,
|
|
172
|
+
),
|
|
173
|
+
),
|
|
133
174
|
)
|
|
134
175
|
) {
|
|
135
176
|
reject(new Error("signature"));
|
|
136
177
|
return;
|
|
137
178
|
}
|
|
138
179
|
try {
|
|
139
|
-
|
|
180
|
+
const parsed = JSON.parse(body);
|
|
181
|
+
if (history && response.statusCode !== 200) {
|
|
182
|
+
if (
|
|
183
|
+
[409, 410].includes(response.statusCode) &&
|
|
184
|
+
Object.keys(parsed).join() === "error" &&
|
|
185
|
+
[
|
|
186
|
+
"GOAL_EVENT_CURSOR_INVALID",
|
|
187
|
+
"GOAL_EVENT_HISTORY_GAP",
|
|
188
|
+
"GOAL_EVENT_HISTORY_REGRESSED",
|
|
189
|
+
"GOAL_EVENT_HISTORY_UNAVAILABLE",
|
|
190
|
+
"GOAL_EVENT_HISTORY_INVALID",
|
|
191
|
+
].includes(parsed.error)
|
|
192
|
+
) {
|
|
193
|
+
reject(
|
|
194
|
+
Object.assign(new Error(parsed.error), {
|
|
195
|
+
code: parsed.error,
|
|
196
|
+
}),
|
|
197
|
+
);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
reject(new Error("status"));
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
resolve(parsed);
|
|
140
204
|
} catch {
|
|
141
205
|
reject(new Error("json"));
|
|
142
206
|
}
|
|
@@ -152,34 +216,66 @@ export function createProjectGoalConnection(file) {
|
|
|
152
216
|
request.on("error", reject);
|
|
153
217
|
});
|
|
154
218
|
validate();
|
|
219
|
+
if (history) return validateGoalEventHistoryPage(result, ref, after);
|
|
155
220
|
if (
|
|
156
221
|
Object.keys(result).sort().join() !==
|
|
157
|
-
(
|
|
158
|
-
? "goalRef,
|
|
159
|
-
:
|
|
222
|
+
(events
|
|
223
|
+
? "goalRef,receipts,risk,schema"
|
|
224
|
+
: evidence
|
|
225
|
+
? "goalRef,objective,receipts,risk,schema,status"
|
|
226
|
+
: "goalRef,objective,schema,status") ||
|
|
160
227
|
result.schema !==
|
|
161
|
-
(
|
|
162
|
-
? "chainlesschain.project-goal-
|
|
163
|
-
:
|
|
228
|
+
(events
|
|
229
|
+
? "chainlesschain.project-goal-events/v1"
|
|
230
|
+
: evidence
|
|
231
|
+
? "chainlesschain.project-goal-evidence/v1"
|
|
232
|
+
: "chainlesschain.project-goal-summary/v1") ||
|
|
164
233
|
JSON.stringify(goalExtensionRef(result.goalRef)) !==
|
|
165
234
|
JSON.stringify(ref) ||
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
235
|
+
(!events &&
|
|
236
|
+
(typeof result.objective !== "string" ||
|
|
237
|
+
result.objective.length > 4096 ||
|
|
238
|
+
result.status !== "active"))
|
|
169
239
|
)
|
|
170
240
|
fail();
|
|
171
|
-
if (evidence)
|
|
241
|
+
if (evidence || events)
|
|
172
242
|
validateGoalEvidenceProjection({
|
|
173
243
|
risk: result.risk,
|
|
174
244
|
receipts: result.receipts,
|
|
175
245
|
});
|
|
176
246
|
return { ...result, goalRef: ref };
|
|
177
|
-
} catch {
|
|
247
|
+
} catch (error) {
|
|
248
|
+
if (
|
|
249
|
+
history &&
|
|
250
|
+
[
|
|
251
|
+
"GOAL_EVENT_CURSOR_INVALID",
|
|
252
|
+
"GOAL_EVENT_HISTORY_GAP",
|
|
253
|
+
"GOAL_EVENT_HISTORY_REGRESSED",
|
|
254
|
+
"GOAL_EVENT_HISTORY_UNAVAILABLE",
|
|
255
|
+
"GOAL_EVENT_HISTORY_INVALID",
|
|
256
|
+
].includes(error.code)
|
|
257
|
+
)
|
|
258
|
+
throw error;
|
|
178
259
|
fail();
|
|
179
260
|
}
|
|
180
261
|
}
|
|
181
262
|
validate();
|
|
182
|
-
return
|
|
263
|
+
return history
|
|
264
|
+
? Object.freeze({
|
|
265
|
+
goalRef: ref,
|
|
266
|
+
eventHistory: true,
|
|
267
|
+
readEventPage: (after, options = {}) =>
|
|
268
|
+
read(ref.id, { ...options, after }),
|
|
269
|
+
read: async () => fail(),
|
|
270
|
+
})
|
|
271
|
+
: events
|
|
272
|
+
? Object.freeze({
|
|
273
|
+
goalRef: ref,
|
|
274
|
+
events: true,
|
|
275
|
+
readEvents: read,
|
|
276
|
+
read: async () => fail(),
|
|
277
|
+
})
|
|
278
|
+
: Object.freeze({ goalRef: ref, evidence, read });
|
|
183
279
|
} catch {
|
|
184
280
|
fail();
|
|
185
281
|
} finally {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
validateGoalDraftSources,
|
|
11
11
|
validateGoalDraftReceipt,
|
|
12
12
|
validateGoalDraftProposal,
|
|
13
|
+
validateGoalCreateDraftProposal,
|
|
13
14
|
} from "@chainlesschain/session-core/goal-draft-connection-contract";
|
|
14
15
|
function unavailable() {
|
|
15
16
|
return new Error("CLI_GOAL_CONNECTION_UNAVAILABLE");
|
|
@@ -26,6 +27,12 @@ function exact(raw, keys) {
|
|
|
26
27
|
}
|
|
27
28
|
/** Constructed only after the shared private-file reader verifies the descriptor. */
|
|
28
29
|
export function createProjectGoalDraftClient(descriptor, validate) {
|
|
30
|
+
const creation =
|
|
31
|
+
descriptor.schema === "chainlesschain.project-goal-connection/v6";
|
|
32
|
+
const domain = creation ? "v6" : "v3",
|
|
33
|
+
endpointPath = creation ? "/goal-create-drafts" : "/goal-drafts";
|
|
34
|
+
const schema = (name) =>
|
|
35
|
+
`chainlesschain.${creation ? name.replace("goal-draft", "goal-create-draft") : name}/v1`;
|
|
29
36
|
const ref = Object.freeze({ ...descriptor.goalRef }),
|
|
30
37
|
grant = Object.freeze({
|
|
31
38
|
id: descriptor.grantRef.id,
|
|
@@ -58,7 +65,7 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
58
65
|
headers: {
|
|
59
66
|
"X-CC-Nonce": nonce,
|
|
60
67
|
"X-CC-Signature": mac(
|
|
61
|
-
`request
|
|
68
|
+
`request-${domain}\n${method}\n${endpointPath}\n${nonce}\n${bodyHash}`,
|
|
62
69
|
),
|
|
63
70
|
...(method === "POST"
|
|
64
71
|
? {
|
|
@@ -90,7 +97,7 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
90
97
|
Buffer.from(signature),
|
|
91
98
|
Buffer.from(
|
|
92
99
|
mac(
|
|
93
|
-
`response
|
|
100
|
+
`response-${domain}\n${nonce}\n${response.statusCode}\n${text}`,
|
|
94
101
|
),
|
|
95
102
|
),
|
|
96
103
|
)
|
|
@@ -135,7 +142,7 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
135
142
|
"sources",
|
|
136
143
|
]);
|
|
137
144
|
if (
|
|
138
|
-
result.schema !== "
|
|
145
|
+
result.schema !== schema("project-goal-drafts") ||
|
|
139
146
|
typeof result.objective !== "string" ||
|
|
140
147
|
result.objective.length > 4096 ||
|
|
141
148
|
result.status !== "active" ||
|
|
@@ -151,8 +158,7 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
151
158
|
...(afterId !== undefined ? { afterId } : {}),
|
|
152
159
|
});
|
|
153
160
|
exact(result, ["schema", "goalRef", "sources"]);
|
|
154
|
-
if (result.schema !== "
|
|
155
|
-
throw unavailable();
|
|
161
|
+
if (result.schema !== schema("goal-draft-sources")) throw unavailable();
|
|
156
162
|
return validateGoalDraftSources(result.sources);
|
|
157
163
|
}
|
|
158
164
|
async function receipt({ requestId, inputDigest }) {
|
|
@@ -162,15 +168,16 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
162
168
|
inputDigest,
|
|
163
169
|
});
|
|
164
170
|
exact(result, ["schema", "goalRef", "receipt"]);
|
|
165
|
-
if (result.schema !== "
|
|
166
|
-
throw unavailable();
|
|
171
|
+
if (result.schema !== schema("goal-draft-receipt")) throw unavailable();
|
|
167
172
|
const value = validateGoalDraftReceipt(result.receipt);
|
|
168
173
|
if (value.requestId !== requestId || value.inputDigest !== inputDigest)
|
|
169
174
|
throw unavailable();
|
|
170
175
|
return value;
|
|
171
176
|
}
|
|
172
177
|
async function enqueue(raw) {
|
|
173
|
-
const proposal =
|
|
178
|
+
const proposal = (
|
|
179
|
+
creation ? validateGoalCreateDraftProposal : validateGoalDraftProposal
|
|
180
|
+
)(raw),
|
|
174
181
|
inputDigest = digest(proposal);
|
|
175
182
|
let received = false;
|
|
176
183
|
try {
|
|
@@ -181,8 +188,7 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
181
188
|
);
|
|
182
189
|
received = true;
|
|
183
190
|
exact(result, ["schema", "goalRef", "receipt"]);
|
|
184
|
-
if (result.schema !== "
|
|
185
|
-
throw unavailable();
|
|
191
|
+
if (result.schema !== schema("goal-draft-submit")) throw unavailable();
|
|
186
192
|
const value = validateGoalDraftReceipt(result.receipt);
|
|
187
193
|
if (
|
|
188
194
|
value.state !== "saved" ||
|
|
@@ -205,7 +211,8 @@ export function createProjectGoalDraftClient(descriptor, validate) {
|
|
|
205
211
|
return Object.freeze({
|
|
206
212
|
goalRef: ref,
|
|
207
213
|
evidence: false,
|
|
208
|
-
drafts:
|
|
214
|
+
drafts: !creation,
|
|
215
|
+
...(creation ? { createDrafts: true } : {}),
|
|
209
216
|
plugin: grant.plugin,
|
|
210
217
|
declarationDigest: grant.declarationDigest,
|
|
211
218
|
grantRef: Object.freeze({ ...descriptor.grantRef }),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as o}from"./Row-BZJYAo0S.js";import{$ as t}from"./index-Cs66y4oC.js";import"./responsiveObserve-CI1toXJ_.js";import"./vendor-BXcBOG8b.js";import"./useFlexGapSupport-DkdcgIyl.js";import"./styleChecker-DY8wTVCe.js";import"./index-BlcOkfzz.js";import"./icons-DlxlFL4g.js";const l=t(o);export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./Col-BwHSmoYQ.js";import{$ as t}from"./index-Cs66y4oC.js";import"./index-BlcOkfzz.js";import"./vendor-BXcBOG8b.js";import"./icons-DlxlFL4g.js";const s=t(o);export{s as default};
|