chainlesschain 0.166.88 → 0.166.90
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 +101 -14
- package/package.json +3 -3
- 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-QzeGep9J.js → AIOps-CZzXRe1-.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-Dfc5bx7S.js → ActionButton-_AZfbW1Q.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-tn-_ZG2E.js → Analytics-CzaUx_wv.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-Deg3WAK8.js → AppLayout-xHEeeD-m.js} +4 -4
- package/src/assets/web-panel/assets/{Artifacts-KU05t0a6.js → Artifacts-DmTbtudE.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-CkSZf54T.js → Audit-Cn4ng4fo.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-i7ivfXF0.js → BackgroundAgents-DLUY1VD2.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-QcVUKtf0.js → Backup-B2v--wB6.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-B3h5ZJ0g.js → BaseInput-Bgih7yAv.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-D7AVz0xi.js → Chat-1MiiA3yA.js} +5 -5
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-B0-euPW7.js → ChatBubbleRenderer-CPLynmbb.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-H0p0TMlD.js → Checkbox-DsyBa_NO.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-B6HOmAY3.js → Codegen-B7WCFx9H.js} +1 -1
- package/src/assets/web-panel/assets/{Col-n_64Fog2.js → Col-D2x4GBGm.js} +1 -1
- package/src/assets/web-panel/assets/{Community-CX0JGgj0.js → Community-Rnwg9nea.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-C4JWUZlx.js → Compact-BPczlrRh.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-DKyTZakB.js → Compliance-Br1L_wGU.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-C0joBMci.js → Cowork-DlsWB_oS.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-D6VkYpxK.js → Cron-BWo_KGpG.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-7b6Uu8jc.js → Crosschain-Cug7N8ge.js} +1 -1
- package/src/assets/web-panel/assets/{DID-C8YPKqzY.js → DID-CMbyOZJN.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-DJsOiEry.js → Dashboard-C4dl_UaE.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-CyStFY-4.js → Dropdown-CBrC7M-9.js} +1 -1
- package/src/assets/web-panel/assets/EmailListRenderer-DTq7tU4b.js +1 -0
- package/src/assets/web-panel/assets/{EvolutionSettings-DpxORusH.js → EvolutionSettings-DWP3csxS.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-5BYZdMG0.js → FamilyGuardDashboard-DZl7zuv_.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-s1kS0ekU.js → Federation-W-GSlVK5.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-CmgoH9HV.js → FormItemContext-DMB7xYFV.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DSRWrvcL.js → GenericCardRenderer-DNv8GEoq.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Cz3EgnS1.js → Git-BZ0Bbzw6.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-De4atTe7.js → Governance-BNEdcOM5.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-DoitBBxJ.js → Inference-C8249gIz.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-CIdmJ1pH.js → KnowledgeGraph-ngzebU3e.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-Coa_qNhU.js → Logs-CP15th-f.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-CW3B3JDq.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-C6kbAQoM.js → Marketplace-CaH59OsY.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-C2TZn8D-.js → McpTools-C07vnJev.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-DYdEKDuB.js → Memory-CqAOkVAS.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-pKLeVviZ.js → MobileBridge-qp7mZimq.js} +1 -1
- package/src/assets/web-panel/assets/MobileProjects-DKhbqvTw.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-IEoVRV29.js → Mtc-CRYCnWXv.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-Cov-yYTY.js → MtcAudit-Z08IrKws.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig--Jr7OCmp.js → Multisig-BWdatUnH.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-D2gXnYAA.js → NLProgramming-BKWiCZ_m.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-hk8pMyve.js → Notes-Bgpzk3sm.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-D26Nc7MU.js → NotificationSettings-DvtZEktR.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-DmzHMEOa.js → OrderTableRenderer-CBcy0szc.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-Cn-o6mHT.js → Organization-DRRL6vW1.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-DP6xpDak.js → Overflow-COmfB8Ns.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-C9WAjG-I.js → P2P-BqMq_DSa.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-BX7iNvle.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-BFBN4-IL.js → Permissions-DzYkjmV_.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-BEDvoAiz.js → PersonalDataHub-BBTcxBbN.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-Co2Ze_rR.js → Pipeline-eRkYFSbO.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BOTn1EId.js → Privacy-Ch7IFKBh.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CObyrZYm.js → ProjectInit-Ci8EcBYg.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-DVTN31rd.js → ProjectSettings-B4lYHFbI.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-DQSEaVjE.js → Projects-zkE5cCo_.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-BRIKWIdQ.js → Providers-BKDVD3_e.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-3nxaEXxN.js → QrScannerModal-BromrHlf.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-iwZJEE9z.js → QuickAsk-CCgoY1gR.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-D2_EEbvc.js → Recommend-DCPZvpq7.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-S4w2mUfq.js → RemoteSession-DPnFP8HU.js} +3 -3
- package/src/assets/web-panel/assets/{Reputation-CstUvfTC.js → Reputation-l6r8ytAs.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DEGHFpxz.js → Row-ke9Mk1cx.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-DGdZtJQl.js → RssFeed-DQOEzUEn.js} +2 -2
- package/src/assets/web-panel/assets/{Search-DhfXi99U.js → Search-BqgA0aUz.js} +1 -1
- package/src/assets/web-panel/assets/{Security-BbzISrgX.js → Security-FeGD_jqV.js} +4 -4
- package/src/assets/web-panel/assets/{Services-CFjP2sQ3.js → Services-4kiYYAjZ.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CFn5wbvm.js → Skeleton-BbU8Xegs.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-fVbT8RcW.js → Skills-Dl2bUMUL.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-D6OtC0MT.js → Sla-xRGALeaZ.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-D0kteBjU.js → SpeechSettings-DZfd4RDm.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BGEWCtPh.js → SyncSettings-BRtCV9Ga.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-B1xZUG4D.js → Tasks-DVRQklfG.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-COlorjqb.js → Templates-BbhE5jt5.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-yLkwfuo3.js → Tenant-qXPDNKbK.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-CAmkq1wf.js → Terminal-CV48Ks7E.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-CcKYq1Ue.js → TimelineRenderer-BLGfJIDr.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-9hIqn_LE.js → Tokens-7G9H6Hrt.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-Dsdkb74C.js → Trigger--F64N11F.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-DC4GuE3C.js → Trust-Cq1r-D_y.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-CSlh00wf.js → UkeySign-Dqyu4RVh.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-QEWLo3QY.js → VideoEditing-DuFmWH_B.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-BkPNQgmg.js → Wallet-C3mg7EWP.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-7---jCBl.js → WebAuthn-CDK-Aj_X.js} +5 -5
- package/src/assets/web-panel/assets/{WorkflowEditor-Dq6Yiu8E.js → WorkflowEditor--K7K-T1F.js} +1 -1
- package/src/assets/web-panel/assets/{chat-CTYIMpWD.js → chat-BQDcS6VP.js} +1 -1
- package/src/assets/web-panel/assets/{colors-C8JtYlDN.js → colors-BKxJL2-T.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-spXpnsNC.js → compact-item-CFjQAMbY.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-D04ewPuL.js → createContext-DbgCsdQd.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-DlIv9Mbc.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-DZblOKXx.js → hasIn-BhkaOBNv.js} +1 -1
- package/src/assets/web-panel/assets/{index-DdC0OsNh.js → index-3YutaXnp.js} +1 -1
- package/src/assets/web-panel/assets/{index-rVEqWa0_.js → index-3djsY75k.js} +1 -1
- package/src/assets/web-panel/assets/{index-DSoyEHi2.js → index-3uR0ThJO.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLUHbPl3.js → index-7BY44UEv.js} +1 -1
- package/src/assets/web-panel/assets/{index-B7RA974g.js → index-B4LlAJqc.js} +1 -1
- package/src/assets/web-panel/assets/index-BC972Grv.js +1 -0
- package/src/assets/web-panel/assets/{index-BKfR2eSQ.js → index-BNjYPJNU.js} +1 -1
- package/src/assets/web-panel/assets/{index-KIoJ2eCK.js → index-BRqlCTrz.js} +1 -1
- package/src/assets/web-panel/assets/{index-rU6_An6N.js → index-BfGGsAU7.js} +1 -1
- package/src/assets/web-panel/assets/{index-B57W1RB6.js → index-BuWPqSGT.js} +1 -1
- package/src/assets/web-panel/assets/{index-BLv-KSGc.js → index-C0DzhUOX.js} +1 -1
- package/src/assets/web-panel/assets/{index-DHOV24VR.js → index-CB4oHynY.js} +1 -1
- package/src/assets/web-panel/assets/{index-IFEbaISP.js → index-CE506mgj.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cgztj1JO.js → index-CJoXgJ2N.js} +1 -1
- package/src/assets/web-panel/assets/{index-DruABY-g.js → index-COGy6wXn.js} +1 -1
- package/src/assets/web-panel/assets/{index-CLkua5sJ.js → index-CRtUDiXx.js} +1 -1
- package/src/assets/web-panel/assets/{index-BSO33_O2.js → index-CSUDlsIr.js} +1 -1
- package/src/assets/web-panel/assets/{index-CHtwoTKX.js → index-CUs7XpUO.js} +1 -1
- package/src/assets/web-panel/assets/index-CVifyQqL.js +1 -0
- package/src/assets/web-panel/assets/{index-DtSzmzFF.js → index-CoOu7sdP.js} +1 -1
- package/src/assets/web-panel/assets/{index-B-cKXztT.js → index-D-Yh3-1z.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_65aY6c.js → index-D2Zb-Kd1.js} +1 -1
- package/src/assets/web-panel/assets/{index-749P1pkM.js → index-D9sVcw6v.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bw-3CtK2.js → index-DEwHywz9.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dssnz_1x.js → index-DFt48Z-x.js} +1 -1
- package/src/assets/web-panel/assets/{index-BOuUUW2U.js → index-DJ2OiRvh.js} +3 -3
- package/src/assets/web-panel/assets/{index-D_Md0Jhp.js → index-DP1NrM9J.js} +1 -1
- package/src/assets/web-panel/assets/{index-BjMY3Y_L.js → index-DdcrixaQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-EM4_wLPi.js → index-De7daEnc.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cz0gkRz_.js → index-Dhfa_BIl.js} +1 -1
- package/src/assets/web-panel/assets/{index-CZmBlh5P.js → index-DjmVlpap.js} +1 -1
- package/src/assets/web-panel/assets/{index-DwIEfKo7.js → index-DmYK9Tqt.js} +1 -1
- package/src/assets/web-panel/assets/{index-COvZnoIg.js → index-Dn2QSsuI.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bm0z1M6s.js → index-Du_SxxBY.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cfk4o9eI.js → index-DvWWFJHJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-Mxj-qi1G.js → index-T9ka3Xj3.js} +1 -1
- package/src/assets/web-panel/assets/{index-CE3TYhl0.js → index-aPdVzagA.js} +1 -1
- package/src/assets/web-panel/assets/{index-DcjouIsi.js → index-bMX8BBLE.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dcd-qZ68.js → index-sKfUUldY.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-Dl0wiMxn.js → initDefaultProps-wrqabmui.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BFmZYrGO.js → motion-BoyB3ilP.js} +1 -1
- package/src/assets/web-panel/assets/{move-Cjs64yWq.js → move-Cq31cSFE.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-NeQsnBuP.js → mtc-parser-BkxNt-8H.js} +1 -1
- package/src/assets/web-panel/assets/{omit-4Rs-rfs9.js → omit-DofGni53.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-CUhx2rDY.js → pickAttrs-BnluLL16.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-DbIM_OB2.js → placementArrow-C-yegJSP.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-B_TGx9AN.js → responsiveObserve-CD3ziNhu.js} +1 -1
- package/src/assets/web-panel/assets/{slide-C46cEP5t.js → slide-ToZO4gQ1.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-DqeksICX.js → statusUtils-DFVmDmVl.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-2rrypo5u.js → styleChecker-De0Y8g1O.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-RRe1Edsg.js → useFlexGapSupport-wBKIYFKX.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CB0oxU1U.js → useFs-CP9nmUMJ.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-B98WdlUE.js → usePersonalDataHub-vFGrVDyp.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CY8AoD95.js → vnode-BcBIjvjH.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-BnT-0MbP.js → zoom-DnXDAQxA.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +5 -5
- package/src/commands/agent-controlled-host.js +220 -0
- package/src/commands/agent.js +3 -1
- package/src/commands/automation.js +35 -8
- package/src/commands/hub.js +147 -0
- package/src/commands/project.js +162 -0
- package/src/data/changelog.json +26 -0
- package/src/gateways/ws/personal-data-hub-protocol.js +54 -8
- package/src/lib/audit-logger.js +16 -29
- package/src/lib/audit-sanitizer.js +279 -0
- package/src/lib/automation-center.js +14 -4
- package/src/lib/automation-engine.js +151 -39
- package/src/lib/eval/verify01-execution.js +9 -0
- package/src/lib/eval/verify01-host-capture.js +430 -0
- package/src/lib/knowledge-graph.js +27 -0
- package/src/lib/personal-data-hub-wiring.js +44 -1
- package/src/lib/scheduler-kernel/automation-adapter.js +15 -3
- package/src/lib/scheduler-kernel/automation-event-adapter.js +15 -3
- package/src/assets/web-panel/assets/EmailListRenderer-COrIx2Rg.js +0 -1
- package/src/assets/web-panel/assets/MarkdownRenderer-CeT_RocE.js +0 -1
- package/src/assets/web-panel/assets/MobileProjects-D4bWcHA_.js +0 -1
- package/src/assets/web-panel/assets/PdhVaultBrowser-DxZb0Ux8.js +0 -7
- package/src/assets/web-panel/assets/devWarning-3-s4adfp.js +0 -1
- package/src/assets/web-panel/assets/index-ZMf_BGlO.js +0 -1
- package/src/assets/web-panel/assets/index-jvp8bJBF.js +0 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { evalDigest } from "./evidence.js";
|
|
5
|
+
import { outcomeDigest } from "./outcomes.js";
|
|
6
|
+
import {
|
|
7
|
+
requireValue,
|
|
8
|
+
relativeFile,
|
|
9
|
+
readBytes,
|
|
10
|
+
validateVerify01Review,
|
|
11
|
+
} from "./verify01-contracts.js";
|
|
12
|
+
import {
|
|
13
|
+
materializeVerify01Checkout,
|
|
14
|
+
snapshotVerify01Workspace,
|
|
15
|
+
diffVerify01Workspace,
|
|
16
|
+
runVerify01ReviewedProcess,
|
|
17
|
+
} from "./verify01-execution.js";
|
|
18
|
+
import { importVerify01HostCapture } from "./verify01-host-evidence.js";
|
|
19
|
+
|
|
20
|
+
const STATE_SCHEMA = "chainlesschain.verify01-host-preparation/v1";
|
|
21
|
+
const save = (root, file, value) => {
|
|
22
|
+
const bytes = Buffer.from(JSON.stringify(value, null, 2) + "\n");
|
|
23
|
+
fs.writeFileSync(path.join(root, file), bytes, { flag: "wx", mode: 0o600 });
|
|
24
|
+
return { path: file, digest: evalDigest(bytes) };
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function captureArtifactReader(directory) {
|
|
28
|
+
const root = fs.realpathSync(directory);
|
|
29
|
+
return (relative) => {
|
|
30
|
+
relativeFile(relative);
|
|
31
|
+
let file = root;
|
|
32
|
+
for (const segment of relative.split("/")) {
|
|
33
|
+
file = path.join(file, segment);
|
|
34
|
+
requireValue(
|
|
35
|
+
!fs.lstatSync(file).isSymbolicLink(),
|
|
36
|
+
"capture path traverses a link",
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return readBytes(file);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function outside(workspace, directory) {
|
|
44
|
+
const suffix = path.relative(workspace, directory);
|
|
45
|
+
requireValue(
|
|
46
|
+
suffix && (suffix.startsWith(`..${path.sep}`) || path.isAbsolute(suffix)),
|
|
47
|
+
"host control directories must be outside task workspace",
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function budget(deadline) {
|
|
52
|
+
return {
|
|
53
|
+
remainingMs(stage) {
|
|
54
|
+
const remaining = deadline - Date.now();
|
|
55
|
+
requireValue(
|
|
56
|
+
remaining > 0,
|
|
57
|
+
`host task deadline exhausted during ${stage}`,
|
|
58
|
+
);
|
|
59
|
+
return remaining;
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function select(bundle, preparation, sampleId) {
|
|
65
|
+
const artifacts = new Map();
|
|
66
|
+
const validated = validateVerify01Review(bundle, {
|
|
67
|
+
...preparation,
|
|
68
|
+
readReviewedFile(file) {
|
|
69
|
+
const bytes = Buffer.from(preparation.readReviewedFile(file));
|
|
70
|
+
artifacts.set(file, bytes);
|
|
71
|
+
return bytes;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
const sample = validated.samples.get(sampleId);
|
|
75
|
+
requireValue(sample, "sample outside frozen population");
|
|
76
|
+
const target = bundle.bindings.matrix.find((row) =>
|
|
77
|
+
sample.stratum.startsWith(`${row.platform}-${row.entry}-`),
|
|
78
|
+
);
|
|
79
|
+
requireValue(
|
|
80
|
+
target && ["vscode", "jetbrains"].includes(target.entry),
|
|
81
|
+
"host capture requires an actual IDE entry",
|
|
82
|
+
);
|
|
83
|
+
const comparison = bundle.bindings.comparisons[sample.stratum];
|
|
84
|
+
requireValue(
|
|
85
|
+
process.platform === target.platform &&
|
|
86
|
+
process.arch === target.arch &&
|
|
87
|
+
process.version === target.node,
|
|
88
|
+
"actual capture runtime differs from frozen platform/arch/Node",
|
|
89
|
+
);
|
|
90
|
+
return {
|
|
91
|
+
sample,
|
|
92
|
+
target,
|
|
93
|
+
comparison,
|
|
94
|
+
artifacts,
|
|
95
|
+
task: validated.tasks.get(sample.taskId),
|
|
96
|
+
reviewed: validated.reviewed.get(sample.taskId),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Stores before bodies outside the candidate checkout. Each blob remains
|
|
101
|
+
* byte-bound; dependency files retain only their existing streamed identity.
|
|
102
|
+
*/
|
|
103
|
+
function storeBaseline(root, snapshot) {
|
|
104
|
+
const blobDirectory = path.join(root, "baseline-blobs");
|
|
105
|
+
fs.mkdirSync(blobDirectory, { mode: 0o700 });
|
|
106
|
+
const indexes = [];
|
|
107
|
+
let page = [],
|
|
108
|
+
pageBytes = 0;
|
|
109
|
+
const flush = () => {
|
|
110
|
+
if (!page.length) return;
|
|
111
|
+
indexes.push(save(root, `baseline-index-${indexes.length}.json`, page));
|
|
112
|
+
page = [];
|
|
113
|
+
pageBytes = 0;
|
|
114
|
+
};
|
|
115
|
+
for (const [file, value] of snapshot) {
|
|
116
|
+
let blob = null;
|
|
117
|
+
if (value.bytes !== null) {
|
|
118
|
+
blob = `baseline-blobs/${value.digest.slice(7)}.blob`;
|
|
119
|
+
const location = path.join(root, blob);
|
|
120
|
+
if (!fs.existsSync(location))
|
|
121
|
+
fs.writeFileSync(location, value.bytes, { flag: "wx", mode: 0o600 });
|
|
122
|
+
}
|
|
123
|
+
const entry = { path: file, ...value, bytes: undefined, blob };
|
|
124
|
+
const size = Buffer.byteLength(JSON.stringify(entry)) + 64;
|
|
125
|
+
if (pageBytes + size > 4 * 1024 * 1024) flush();
|
|
126
|
+
page.push(entry);
|
|
127
|
+
pageBytes += size;
|
|
128
|
+
}
|
|
129
|
+
flush();
|
|
130
|
+
return {
|
|
131
|
+
indexes,
|
|
132
|
+
files: snapshot.size,
|
|
133
|
+
dependencyBoundary: snapshot.dependencyBoundary,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function loadBaseline(root, baseline) {
|
|
138
|
+
const read = captureArtifactReader(root);
|
|
139
|
+
const entries = new Map();
|
|
140
|
+
let total = 0;
|
|
141
|
+
requireValue(
|
|
142
|
+
Number.isSafeInteger(baseline.files) &&
|
|
143
|
+
baseline.files <= 1100000 &&
|
|
144
|
+
Array.isArray(baseline.indexes),
|
|
145
|
+
"baseline file count exceeds scan bounds",
|
|
146
|
+
);
|
|
147
|
+
for (const index of baseline.indexes) {
|
|
148
|
+
const indexBytes = read(index.path);
|
|
149
|
+
requireValue(
|
|
150
|
+
evalDigest(indexBytes) === index.digest,
|
|
151
|
+
"baseline index byte binding differs",
|
|
152
|
+
);
|
|
153
|
+
for (const file of JSON.parse(indexBytes)) {
|
|
154
|
+
relativeFile(file.path);
|
|
155
|
+
requireValue(!entries.has(file.path), "duplicate baseline path");
|
|
156
|
+
const bytes = file.blob === null ? null : read(file.blob);
|
|
157
|
+
if (bytes !== null) {
|
|
158
|
+
total += bytes.length;
|
|
159
|
+
requireValue(
|
|
160
|
+
total <= 512 * 1024 * 1024 &&
|
|
161
|
+
bytes.length === file.size &&
|
|
162
|
+
evalDigest(bytes) === file.digest,
|
|
163
|
+
"before body differs from pinned baseline",
|
|
164
|
+
);
|
|
165
|
+
} else
|
|
166
|
+
requireValue(
|
|
167
|
+
file.dependency === true,
|
|
168
|
+
"nondependency baseline lacks its before body",
|
|
169
|
+
);
|
|
170
|
+
entries.set(file.path, { ...file, bytes });
|
|
171
|
+
requireValue(
|
|
172
|
+
entries.size <= baseline.files,
|
|
173
|
+
"baseline index has extra paths",
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
requireValue(entries.size === baseline.files, "baseline index is incomplete");
|
|
178
|
+
entries.dependencyBoundary = baseline.dependencyBoundary;
|
|
179
|
+
return entries;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export async function prepareVerify01HostTask(bundle, preparation, options) {
|
|
183
|
+
const { sample, target, comparison, artifacts, task, reviewed } = select(
|
|
184
|
+
bundle,
|
|
185
|
+
preparation,
|
|
186
|
+
options.sampleId,
|
|
187
|
+
);
|
|
188
|
+
requireValue(
|
|
189
|
+
options.os === target.os,
|
|
190
|
+
"operator OS declaration differs from frozen target",
|
|
191
|
+
);
|
|
192
|
+
requireValue(
|
|
193
|
+
/^[a-f0-9]{40}$/u.test(options.sourceCommit || ""),
|
|
194
|
+
"tested CLI source SHA required",
|
|
195
|
+
);
|
|
196
|
+
const workspace = path.resolve(options.workspace),
|
|
197
|
+
root = path.resolve(options.captureRoot);
|
|
198
|
+
const reviewRoot = fs.realpathSync(options.reviewRoot);
|
|
199
|
+
outside(workspace, root);
|
|
200
|
+
outside(workspace, reviewRoot);
|
|
201
|
+
requireValue(
|
|
202
|
+
!fs.existsSync(workspace) && !fs.existsSync(root),
|
|
203
|
+
"workspace and capture directory must be new; retry cannot overwrite an attempt",
|
|
204
|
+
);
|
|
205
|
+
const startedAt = new Date().toISOString(),
|
|
206
|
+
deadline = Date.now() + sample.timeBudgetMs;
|
|
207
|
+
fs.mkdirSync(workspace, { recursive: true, mode: 0o700 });
|
|
208
|
+
fs.mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
209
|
+
const stageBudget = budget(deadline);
|
|
210
|
+
try {
|
|
211
|
+
const checkout = await materializeVerify01Checkout(
|
|
212
|
+
options.projectRoot,
|
|
213
|
+
bundle.catalog.projectCommit,
|
|
214
|
+
workspace,
|
|
215
|
+
stageBudget,
|
|
216
|
+
);
|
|
217
|
+
const setupBytes = artifacts.get(reviewed.setup.path);
|
|
218
|
+
const setup = runVerify01ReviewedProcess(
|
|
219
|
+
setupBytes,
|
|
220
|
+
workspace,
|
|
221
|
+
reviewRoot,
|
|
222
|
+
"setup",
|
|
223
|
+
stageBudget.remainingMs("setup"),
|
|
224
|
+
);
|
|
225
|
+
save(root, "setup.json", setup);
|
|
226
|
+
requireValue(
|
|
227
|
+
setup.exitCode === 0 && setup.signal === null && setup.error === null,
|
|
228
|
+
"reviewed host setup failed; preserve this first attempt",
|
|
229
|
+
);
|
|
230
|
+
const baseline = storeBaseline(
|
|
231
|
+
root,
|
|
232
|
+
snapshotVerify01Workspace(workspace, stageBudget, "baseline"),
|
|
233
|
+
);
|
|
234
|
+
const state = {
|
|
235
|
+
schema: STATE_SCHEMA,
|
|
236
|
+
sampleId: sample.id,
|
|
237
|
+
taskId: task.id,
|
|
238
|
+
planDigest: bundle.expectedPlanDigest,
|
|
239
|
+
reviewDigest: preparation.expectedReviewDigest,
|
|
240
|
+
projectCommit: bundle.catalog.projectCommit,
|
|
241
|
+
sourceCommit: options.sourceCommit,
|
|
242
|
+
entry: target.entry,
|
|
243
|
+
platform: process.platform,
|
|
244
|
+
arch: process.arch,
|
|
245
|
+
node: process.version,
|
|
246
|
+
os: options.os,
|
|
247
|
+
host: target.host,
|
|
248
|
+
workspace,
|
|
249
|
+
captureRoot: root,
|
|
250
|
+
startedAt,
|
|
251
|
+
deadline,
|
|
252
|
+
runId: `verify01-host-${randomUUID()}`,
|
|
253
|
+
checkout,
|
|
254
|
+
baseline,
|
|
255
|
+
provider: comparison.provider,
|
|
256
|
+
model: comparison.model,
|
|
257
|
+
permissionMode: comparison.permissionMode,
|
|
258
|
+
observationsCreated: false,
|
|
259
|
+
productionAttested: false,
|
|
260
|
+
};
|
|
261
|
+
save(root, "host-state.json", state);
|
|
262
|
+
fs.writeFileSync(path.join(root, "prompt.txt"), task.prompt, {
|
|
263
|
+
flag: "wx",
|
|
264
|
+
mode: 0o600,
|
|
265
|
+
});
|
|
266
|
+
return {
|
|
267
|
+
stateFile: path.join(root, "host-state.json"),
|
|
268
|
+
stateDigest: outcomeDigest(state),
|
|
269
|
+
state,
|
|
270
|
+
};
|
|
271
|
+
} catch (error) {
|
|
272
|
+
save(root, "prepare-failure.json", {
|
|
273
|
+
startedAt,
|
|
274
|
+
finishedAt: new Date().toISOString(),
|
|
275
|
+
sampleId: sample.id,
|
|
276
|
+
error: error.message,
|
|
277
|
+
observationsCreated: false,
|
|
278
|
+
});
|
|
279
|
+
throw error;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** Execute the externally pinned acceptance bytes and assemble only actual
|
|
284
|
+
* driver files. Import into Eval/outcome is validated before writing output.
|
|
285
|
+
* First-run stage receipts are operator evidence, never inferred from setup.
|
|
286
|
+
*/
|
|
287
|
+
export function finishVerify01HostTask(bundle, preparation, options) {
|
|
288
|
+
requireValue(
|
|
289
|
+
Number.isSafeInteger(options.retries ?? 0) &&
|
|
290
|
+
(options.retries ?? 0) >= 0 &&
|
|
291
|
+
(options.retries ?? 0) <= 1 &&
|
|
292
|
+
Number.isSafeInteger(options.manualRepairs ?? 0) &&
|
|
293
|
+
(options.manualRepairs ?? 0) >= 0,
|
|
294
|
+
"host attempt and manual repair counts must retain the frozen bounds",
|
|
295
|
+
);
|
|
296
|
+
const state = options.state;
|
|
297
|
+
requireValue(
|
|
298
|
+
state?.schema === STATE_SCHEMA &&
|
|
299
|
+
outcomeDigest(state) === options.expectedStateDigest,
|
|
300
|
+
"host preparation state byte binding differs",
|
|
301
|
+
);
|
|
302
|
+
requireValue(
|
|
303
|
+
state.planDigest === bundle.expectedPlanDigest &&
|
|
304
|
+
state.reviewDigest === preparation.expectedReviewDigest &&
|
|
305
|
+
state.projectCommit === bundle.catalog.projectCommit &&
|
|
306
|
+
state.sourceCommit === options.sourceCommit,
|
|
307
|
+
"host preparation frozen identity differs",
|
|
308
|
+
);
|
|
309
|
+
const { sample, target, task, reviewed, artifacts } = select(
|
|
310
|
+
bundle,
|
|
311
|
+
preparation,
|
|
312
|
+
state.sampleId,
|
|
313
|
+
);
|
|
314
|
+
requireValue(
|
|
315
|
+
state.entry === target.entry &&
|
|
316
|
+
state.os === target.os &&
|
|
317
|
+
state.host === target.host &&
|
|
318
|
+
state.platform === target.platform &&
|
|
319
|
+
state.arch === target.arch &&
|
|
320
|
+
state.node === target.node,
|
|
321
|
+
"prepared host identity changed",
|
|
322
|
+
);
|
|
323
|
+
requireValue(
|
|
324
|
+
Number.isSafeInteger(state.deadline) &&
|
|
325
|
+
Number.isFinite(Date.parse(state.startedAt)) &&
|
|
326
|
+
state.deadline > Date.parse(state.startedAt) &&
|
|
327
|
+
state.deadline - Date.parse(state.startedAt) <= sample.timeBudgetMs + 1,
|
|
328
|
+
"host task deadline differs from frozen budget",
|
|
329
|
+
);
|
|
330
|
+
const stageBudget = budget(state.deadline),
|
|
331
|
+
root = fs.realpathSync(state.captureRoot),
|
|
332
|
+
workspace = fs.realpathSync(state.workspace);
|
|
333
|
+
outside(workspace, root);
|
|
334
|
+
outside(workspace, fs.realpathSync(options.reviewRoot));
|
|
335
|
+
const read = captureArtifactReader(root);
|
|
336
|
+
// Require raw host evidence before spending the remaining acceptance budget.
|
|
337
|
+
const protocol = read("protocol.json"),
|
|
338
|
+
ui = read("ui.json");
|
|
339
|
+
const before = loadBaseline(root, state.baseline);
|
|
340
|
+
const after = snapshotVerify01Workspace(workspace, stageBudget, "after-host");
|
|
341
|
+
const changes = diffVerify01Workspace(before, after);
|
|
342
|
+
const unrelatedChanges = changes
|
|
343
|
+
.filter(
|
|
344
|
+
(change) =>
|
|
345
|
+
!reviewed.allowedChangedPaths.includes(change.path) ||
|
|
346
|
+
change.before?.dependency ||
|
|
347
|
+
change.after?.dependency ||
|
|
348
|
+
change.after?.type === "link",
|
|
349
|
+
)
|
|
350
|
+
.map((change) => change.path);
|
|
351
|
+
save(root, "diff.json", changes);
|
|
352
|
+
save(root, "dependency-boundary.json", {
|
|
353
|
+
before: before.dependencyBoundary,
|
|
354
|
+
after: after.dependencyBoundary,
|
|
355
|
+
});
|
|
356
|
+
requireValue(
|
|
357
|
+
unrelatedChanges.length === 0,
|
|
358
|
+
"host task changed unreviewed/dependency paths; full diff preserved",
|
|
359
|
+
);
|
|
360
|
+
const processReceipt = runVerify01ReviewedProcess(
|
|
361
|
+
artifacts.get(reviewed.check.path),
|
|
362
|
+
workspace,
|
|
363
|
+
options.reviewRoot,
|
|
364
|
+
"check",
|
|
365
|
+
stageBudget.remainingMs("check"),
|
|
366
|
+
);
|
|
367
|
+
save(root, "check-process.json", processReceipt);
|
|
368
|
+
requireValue(
|
|
369
|
+
processReceipt.exitCode === 0 &&
|
|
370
|
+
processReceipt.signal === null &&
|
|
371
|
+
processReceipt.error === null,
|
|
372
|
+
"reviewed host check failed to complete; process receipt preserved",
|
|
373
|
+
);
|
|
374
|
+
const verdict = JSON.parse(processReceipt.stdout);
|
|
375
|
+
requireValue(
|
|
376
|
+
typeof verdict.pass === "boolean" && typeof verdict.detail === "string",
|
|
377
|
+
"reviewed host check did not emit a verdict",
|
|
378
|
+
);
|
|
379
|
+
const check = {
|
|
380
|
+
taskId: task.id,
|
|
381
|
+
reviewDigest: state.reviewDigest,
|
|
382
|
+
pass: verdict.pass,
|
|
383
|
+
detail: verdict.detail,
|
|
384
|
+
changedFiles: changes.map((change) => change.path),
|
|
385
|
+
unrelatedChanges,
|
|
386
|
+
process: processReceipt,
|
|
387
|
+
};
|
|
388
|
+
save(root, "check.json", check);
|
|
389
|
+
const observedAt = new Date().toISOString();
|
|
390
|
+
const manifest = {
|
|
391
|
+
schema: "chainlesschain.verify01-host-capture/v1",
|
|
392
|
+
sampleId: state.sampleId,
|
|
393
|
+
planDigest: state.planDigest,
|
|
394
|
+
reviewDigest: state.reviewDigest,
|
|
395
|
+
projectCommit: state.projectCommit,
|
|
396
|
+
sourceCommit: state.sourceCommit,
|
|
397
|
+
entry: state.entry,
|
|
398
|
+
platform: state.platform,
|
|
399
|
+
os: state.os,
|
|
400
|
+
arch: state.arch,
|
|
401
|
+
node: state.node,
|
|
402
|
+
host: state.host,
|
|
403
|
+
runId: state.runId,
|
|
404
|
+
observedAt,
|
|
405
|
+
elapsedMs: Date.parse(observedAt) - Date.parse(state.startedAt),
|
|
406
|
+
retries: options.retries ?? 0,
|
|
407
|
+
manualRepairs: options.manualRepairs ?? 0,
|
|
408
|
+
failureCause: options.failureCause ?? "unknown",
|
|
409
|
+
protocol: { path: "protocol.json", digest: evalDigest(protocol) },
|
|
410
|
+
ui: { path: "ui.json", digest: evalDigest(ui) },
|
|
411
|
+
check: { path: "check.json", digest: evalDigest(read("check.json")) },
|
|
412
|
+
diff: { path: "diff.json", digest: evalDigest(read("diff.json")) },
|
|
413
|
+
...(sample.kind === "first-run" ? { firstRun: options.firstRun } : {}),
|
|
414
|
+
};
|
|
415
|
+
const captureDigest = outcomeDigest(manifest);
|
|
416
|
+
const imported = importVerify01HostCapture(bundle, preparation, {
|
|
417
|
+
manifest,
|
|
418
|
+
expectedManifestDigest: captureDigest,
|
|
419
|
+
readArtifact: read,
|
|
420
|
+
sourceCommit: state.sourceCommit,
|
|
421
|
+
});
|
|
422
|
+
save(root, "capture.json", manifest);
|
|
423
|
+
save(root, "host-import.json", imported);
|
|
424
|
+
return {
|
|
425
|
+
manifestFile: path.join(root, "capture.json"),
|
|
426
|
+
captureDigest,
|
|
427
|
+
imported,
|
|
428
|
+
observationsSavedToFormalPlan: false,
|
|
429
|
+
};
|
|
430
|
+
}
|
|
@@ -239,6 +239,33 @@ export function getEntity(id) {
|
|
|
239
239
|
return e ? _strip(e) : null;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
/** Replace supplied entity fields while preserving identity and relationships. */
|
|
243
|
+
export function updateEntity(db, id, config = {}) {
|
|
244
|
+
const current = _entities.get(id);
|
|
245
|
+
if (!current) throw new Error(`Entity not found: ${id}`);
|
|
246
|
+
const name = String(config.name ?? current.name).trim();
|
|
247
|
+
const type = String(config.type ?? current.type).trim();
|
|
248
|
+
if (!name) throw new Error("entity name is required");
|
|
249
|
+
if (!type) throw new Error("entity type is required");
|
|
250
|
+
const entity = {
|
|
251
|
+
...current,
|
|
252
|
+
name,
|
|
253
|
+
type,
|
|
254
|
+
properties: Object.hasOwn(config, "properties")
|
|
255
|
+
? config.properties
|
|
256
|
+
: current.properties,
|
|
257
|
+
tags: Object.hasOwn(config, "tags")
|
|
258
|
+
? Array.isArray(config.tags)
|
|
259
|
+
? [...config.tags]
|
|
260
|
+
: null
|
|
261
|
+
: current.tags,
|
|
262
|
+
updatedAt: Number(config.now ?? Date.now()),
|
|
263
|
+
};
|
|
264
|
+
_persistEntity(db, entity);
|
|
265
|
+
_entities.set(id, entity);
|
|
266
|
+
return _strip(entity);
|
|
267
|
+
}
|
|
268
|
+
|
|
242
269
|
export function listEntities(opts = {}) {
|
|
243
270
|
let rows = [..._entities.values()];
|
|
244
271
|
if (opts.type) {
|
|
@@ -368,6 +368,17 @@ async function loadBm25() {
|
|
|
368
368
|
let _hub = null;
|
|
369
369
|
let _initPromise = null;
|
|
370
370
|
let _bm25 = null;
|
|
371
|
+
let _processExitHook = null;
|
|
372
|
+
|
|
373
|
+
function installProcessExitHook() {
|
|
374
|
+
if (_processExitHook) return;
|
|
375
|
+
_processExitHook = (code) => {
|
|
376
|
+
// exit callbacks are synchronous. Nonzero exits keep the generation active;
|
|
377
|
+
// exit(0) still has to pass the registry's in-flight operation guard.
|
|
378
|
+
close({ retireConsumer: code === 0 });
|
|
379
|
+
};
|
|
380
|
+
process.once("exit", _processExitHook);
|
|
381
|
+
}
|
|
371
382
|
|
|
372
383
|
// LLM override — see file header. Default cli-side hub uses a direct
|
|
373
384
|
// OllamaClient; when the desktop main process embeds this wiring via
|
|
@@ -453,6 +464,11 @@ async function initHub() {
|
|
|
453
464
|
kgSink = new CcKgSink({
|
|
454
465
|
addEntity: kgMod.addEntity,
|
|
455
466
|
addRelation: kgMod.addRelation,
|
|
467
|
+
updateEntity: kgMod.updateEntity,
|
|
468
|
+
getEntity: kgMod.getEntity,
|
|
469
|
+
removeEntity: kgMod.removeEntity,
|
|
470
|
+
listRelations: kgMod.listRelations,
|
|
471
|
+
removeRelation: kgMod.removeRelation,
|
|
456
472
|
db: null,
|
|
457
473
|
});
|
|
458
474
|
}
|
|
@@ -550,6 +566,8 @@ async function initHub() {
|
|
|
550
566
|
vault,
|
|
551
567
|
kgSink: kgSink ? kgSink.write.bind(kgSink) : null,
|
|
552
568
|
ragSink: ragSink ? ragSink.write.bind(ragSink) : null,
|
|
569
|
+
kgRemove: kgSink?.remove?.bind(kgSink) || null,
|
|
570
|
+
ragRemove: ragSink?.remove?.bind(ragSink) || null,
|
|
553
571
|
entityResolver,
|
|
554
572
|
adbReadiness: {
|
|
555
573
|
probe: adbReadinessProbe,
|
|
@@ -557,6 +575,20 @@ async function initHub() {
|
|
|
557
575
|
},
|
|
558
576
|
});
|
|
559
577
|
|
|
578
|
+
// Both projections are in memory. A fresh registry consumer must rebuild
|
|
579
|
+
// from durable desired state before serving retrieval; leave failures
|
|
580
|
+
// visible and explicitly retryable instead of blocking startup forever.
|
|
581
|
+
if (typeof registry.retryDerivations === "function") {
|
|
582
|
+
for (let page = 0; page < 100; page += 1) {
|
|
583
|
+
const result = await registry.retryDerivations({ limit: 1000 });
|
|
584
|
+
if (!result.remaining) break;
|
|
585
|
+
// A referenced KG endpoint can occur on a later page. Visit fresh
|
|
586
|
+
// work before concluding that a failed dependency is unrecoverable.
|
|
587
|
+
if (result.summary?.pending > 0) continue;
|
|
588
|
+
if (!result.succeeded || result.unsupported || result.blocked) break;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
560
592
|
const engine = new AnalysisEngine({
|
|
561
593
|
vault,
|
|
562
594
|
llm,
|
|
@@ -2106,6 +2138,7 @@ export async function getHub() {
|
|
|
2106
2138
|
_initPromise = initHub()
|
|
2107
2139
|
.then((h) => {
|
|
2108
2140
|
_hub = h;
|
|
2141
|
+
installProcessExitHook();
|
|
2109
2142
|
return h;
|
|
2110
2143
|
})
|
|
2111
2144
|
.catch((err) => {
|
|
@@ -2226,6 +2259,7 @@ export async function getHubMinimal() {
|
|
|
2226
2259
|
_hubMinimalInitPromise = initHubMinimal()
|
|
2227
2260
|
.then((h) => {
|
|
2228
2261
|
_hubMinimal = h;
|
|
2262
|
+
installProcessExitHook();
|
|
2229
2263
|
return h;
|
|
2230
2264
|
})
|
|
2231
2265
|
.catch((err) => {
|
|
@@ -2236,7 +2270,11 @@ export async function getHubMinimal() {
|
|
|
2236
2270
|
return _hubMinimalInitPromise;
|
|
2237
2271
|
}
|
|
2238
2272
|
|
|
2239
|
-
export function close() {
|
|
2273
|
+
export function close({ retireConsumer = true } = {}) {
|
|
2274
|
+
if (_processExitHook) {
|
|
2275
|
+
process.removeListener("exit", _processExitHook);
|
|
2276
|
+
_processExitHook = null;
|
|
2277
|
+
}
|
|
2240
2278
|
if (_hub && _hub.aichatHealthChecker) {
|
|
2241
2279
|
try {
|
|
2242
2280
|
_hub.aichatHealthChecker.stop();
|
|
@@ -2245,6 +2283,11 @@ export function close() {
|
|
|
2245
2283
|
}
|
|
2246
2284
|
}
|
|
2247
2285
|
if (_hub && _hub.vault) {
|
|
2286
|
+
try {
|
|
2287
|
+
if (retireConsumer) _hub.registry?.retireDerivationConsumer?.();
|
|
2288
|
+
} catch {
|
|
2289
|
+
// Busy/unknown generations retain their receipts for explicit recovery.
|
|
2290
|
+
}
|
|
2248
2291
|
try {
|
|
2249
2292
|
_hub.vault.close();
|
|
2250
2293
|
} catch {
|
|
@@ -779,7 +779,7 @@ function existingExecutionResult(db, occurrence, expected, now) {
|
|
|
779
779
|
}
|
|
780
780
|
if (execution.status !== EXECUTION_STATUS.SUCCESS) {
|
|
781
781
|
throw automationError(
|
|
782
|
-
|
|
782
|
+
executionFailureCode(execution.status),
|
|
783
783
|
`Automation execution did not succeed: ${execution.id}`,
|
|
784
784
|
{ executionId: execution.id, status: execution.status },
|
|
785
785
|
);
|
|
@@ -790,6 +790,14 @@ function existingExecutionResult(db, occurrence, expected, now) {
|
|
|
790
790
|
return execution;
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
+
function executionFailureCode(status) {
|
|
794
|
+
if (status === EXECUTION_STATUS.UNSUPPORTED)
|
|
795
|
+
return "AUTOMATION_EXECUTION_UNSUPPORTED";
|
|
796
|
+
if (status === EXECUTION_STATUS.SIMULATED)
|
|
797
|
+
return "AUTOMATION_EXECUTION_SIMULATED";
|
|
798
|
+
return "AUTOMATION_SCHEDULER_EXECUTION_FAILED";
|
|
799
|
+
}
|
|
800
|
+
|
|
793
801
|
export function createAutomationSchedulerAdapter({ db, now = Date.now } = {}) {
|
|
794
802
|
if (!db || typeof db.prepare !== "function") {
|
|
795
803
|
throw automationError(
|
|
@@ -930,9 +938,13 @@ export function createAutomationSchedulerAdapter({ db, now = Date.now } = {}) {
|
|
|
930
938
|
}
|
|
931
939
|
if (execution.status !== EXECUTION_STATUS.SUCCESS) {
|
|
932
940
|
throw automationError(
|
|
933
|
-
|
|
941
|
+
executionFailureCode(execution.status),
|
|
934
942
|
`Automation execution failed: ${execution.id}`,
|
|
935
|
-
{
|
|
943
|
+
{
|
|
944
|
+
executionId: execution.id,
|
|
945
|
+
status: execution.status,
|
|
946
|
+
error: execution.error,
|
|
947
|
+
},
|
|
936
948
|
);
|
|
937
949
|
}
|
|
938
950
|
resolveAutomationExecutionIncidentsForSucceededRun(db, execution.id, {
|
|
@@ -576,7 +576,7 @@ function existingExecutionResult(db, occurrence, expectedFlow, now) {
|
|
|
576
576
|
}
|
|
577
577
|
if (execution.status !== EXECUTION_STATUS.SUCCESS) {
|
|
578
578
|
throw eventError(
|
|
579
|
-
|
|
579
|
+
executionFailureCode(execution.status),
|
|
580
580
|
`automation event execution did not succeed: ${execution.id}`,
|
|
581
581
|
{ executionId: execution.id, status: execution.status },
|
|
582
582
|
);
|
|
@@ -587,6 +587,14 @@ function existingExecutionResult(db, occurrence, expectedFlow, now) {
|
|
|
587
587
|
return execution;
|
|
588
588
|
}
|
|
589
589
|
|
|
590
|
+
function executionFailureCode(status) {
|
|
591
|
+
if (status === EXECUTION_STATUS.UNSUPPORTED)
|
|
592
|
+
return "AUTOMATION_EXECUTION_UNSUPPORTED";
|
|
593
|
+
if (status === EXECUTION_STATUS.SIMULATED)
|
|
594
|
+
return "AUTOMATION_EXECUTION_SIMULATED";
|
|
595
|
+
return "AUTOMATION_EVENT_EXECUTION_FAILED";
|
|
596
|
+
}
|
|
597
|
+
|
|
590
598
|
export function createAutomationEventAdapter({ db, now = Date.now } = {}) {
|
|
591
599
|
if (!db || typeof db.prepare !== "function") {
|
|
592
600
|
throw eventError(
|
|
@@ -729,9 +737,13 @@ export function createAutomationEventAdapter({ db, now = Date.now } = {}) {
|
|
|
729
737
|
}
|
|
730
738
|
if (execution.status !== EXECUTION_STATUS.SUCCESS) {
|
|
731
739
|
throw eventError(
|
|
732
|
-
|
|
740
|
+
executionFailureCode(execution.status),
|
|
733
741
|
`automation event execution failed: ${execution.id}`,
|
|
734
|
-
{
|
|
742
|
+
{
|
|
743
|
+
executionId: execution.id,
|
|
744
|
+
status: execution.status,
|
|
745
|
+
error: execution.error,
|
|
746
|
+
},
|
|
735
747
|
);
|
|
736
748
|
}
|
|
737
749
|
resolveAutomationExecutionIncidentsForSucceededRun(db, execution.id, {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as C,P as c,J as f,U as r,c as h,_ as k,R as n,V as l,K as d,Q as u,S as g,b as t}from"./vendor-Bn1JzzAn.js";import{_ as j}from"./index-BOuUUW2U.js";import{aH as w}from"./icons-DG5UD-6K.js";const M={__name:"EmailListRenderer",props:{event:{type:Object,required:!0}},setup(_,{expose:m}){m();const a=_,e=t(()=>a.event.content||{}),i=t(()=>a.event.extra||{}),v=t(()=>e.value.from||e.value.sender||e.value.fromName||a.event.actor||"(未知发件人)"),s=t(()=>e.value.subject||e.value.title||"(无主题)"),x=t(()=>e.value.snippet||e.value.preview||e.value.body?.slice(0,100)||null),y=t(()=>Array.isArray(e.value.attachments)?e.value.attachments.length:typeof e.value.attachmentCount=="number"?e.value.attachmentCount:0),b=t(()=>i.value.category||e.value.category),S=t(()=>e.value.unread===!0),T=t(()=>{if(!a.event.occurredAt)return"";const o=new Date(a.event.occurredAt);return`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")} ${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}),p={props:a,c:e,e:i,fromText:v,subjectText:s,snippetText:x,attachmentCount:y,category:b,isUnread:S,formattedTime:T,computed:t,get MailOutlined(){return w}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}},N={class:"email-row"},O={class:"left"},V={class:"body"},A={class:"head"},B={class:"from"},E={class:"time"},R={class:"subject"},D={key:0,class:"snippet"},L={class:"meta"};function U(_,m,a,e,i,v){const s=C("a-tag");return c(),f("div",N,[r("div",O,[h(e.MailOutlined,{class:k(["icon",{unread:e.isUnread}])},null,8,["class"])]),r("div",V,[r("div",A,[r("span",B,n(e.fromText),1),r("span",E,n(e.formattedTime),1)]),r("div",R,n(e.subjectText),1),e.snippetText?(c(),f("div",D,n(e.snippetText),1)):l("v-if",!0),r("div",L,[h(s,{color:"blue",class:"src"},{default:d(()=>[u(n(a.event.source.adapter),1)]),_:1}),e.attachmentCount>0?(c(),g(s,{key:0,color:"orange"},{default:d(()=>[u(" 📎 "+n(e.attachmentCount),1)]),_:1})):l("v-if",!0),e.category?(c(),g(s,{key:1},{default:d(()=>[u(n(e.category),1)]),_:1})):l("v-if",!0)])])])}const P=j(M,[["render",U],["__scopeId","data-v-e4ddf632"],["__file","/tmp/cc-web-panel-2xvxKv/repo/packages/web-panel/src/components/pdh/renderers/EmailListRenderer.vue"]]);export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as c,J as p,b as s}from"./vendor-Bn1JzzAn.js";import{r as a}from"./markdown-Yo_c6Krv.js";import{_ as d}from"./index-BOuUUW2U.js";const _={__name:"MarkdownRenderer",props:{content:{type:String,default:""}},setup(t,{expose:o}){o();const e=t,r=s(()=>a(e.content||"")),n={props:e,rendered:r,computed:s,get renderMarkdown(){return a}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}},i=["innerHTML"];function m(t,o,e,r,n,u){return c(),p("div",{class:"markdown-content",innerHTML:r.rendered},null,8,i)}const w=d(_,[["render",m],["__scopeId","data-v-0b0b9f63"],["__file","/tmp/cc-web-panel-2xvxKv/repo/packages/web-panel/src/components/MarkdownRenderer.vue"]]);export{w as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as n,J as g,c as l,K as r,N as u,P as h,U as o,R as t,Q as b}from"./vendor-Bn1JzzAn.js";import{_ as v,b as m}from"./index-BOuUUW2U.js";import{a8 as x,M as y}from"./icons-DG5UD-6K.js";const M={__name:"MobileProjects",setup(p,{expose:i}){i();const c=u(),{t:e}=m();function a(){c.push("/projects")}function _(){c.push("/mobile-bridge")}const s={router:c,t:e,goToProjects:a,goToMobileBridge:_,get useRouter(){return u},get useI18n(){return m},get MobileOutlined(){return y},get FolderOutlined(){return x}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}},B={class:"mobile-projects-placeholder"},O={class:"title"},k={class:"subtitle"},w={class:"explainer"};function T(p,i,c,e,a,_){const s=n("a-alert"),d=n("a-button"),f=n("a-space"),P=n("a-empty"),j=n("a-card");return h(),g("div",B,[l(j,null,{default:r(()=>[l(P,{description:!1},{image:r(()=>[l(e.MobileOutlined,{style:{fontSize:"64px",color:"#bfbfbf"}})]),default:r(()=>[o("h2",O,t(e.t("mobileProjects.title")),1),o("p",k,t(e.t("mobileProjects.subtitle")),1),l(s,{message:e.t("mobileProjects.v02Banner"),type:"info","show-icon":"",class:"banner"},null,8,["message"]),o("div",w,[o("h3",null,t(e.t("mobileProjects.currentDirection")),1),o("p",null,t(e.t("mobileProjects.currentDirectionBody")),1),o("ul",null,[o("li",null,t(e.t("mobileProjects.stepPhone")),1),o("li",null,t(e.t("mobileProjects.stepTap")),1),o("li",null,t(e.t("mobileProjects.stepPull")),1)]),o("h3",null,t(e.t("mobileProjects.reverseDirection")),1),o("p",null,t(e.t("mobileProjects.reverseDirectionBody")),1)]),l(f,{class:"actions"},{default:r(()=>[l(d,{type:"primary",onClick:e.goToProjects},{default:r(()=>[l(e.FolderOutlined),b(" "+t(e.t("mobileProjects.viewLocalProjects")),1)]),_:1}),l(d,{onClick:e.goToMobileBridge},{default:r(()=>[l(e.MobileOutlined),b(" "+t(e.t("mobileProjects.checkBridge")),1)]),_:1})]),_:1})]),_:1})]),_:1})])}const N=v(M,[["render",T],["__scopeId","data-v-9262cc45"],["__file","/tmp/cc-web-panel-2xvxKv/repo/packages/web-panel/src/views/MobileProjects.vue"]]);export{N as default};
|