@rpamis/comet 0.4.0-beta.10 → 0.4.0-beta.12
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 +1 -1
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/SKILL.md +8 -4
- package/assets/skills/comet/reference/classic-layout.md +3 -3
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +4 -3
- package/assets/skills/comet/rules/comet-workflow-guard.md +4 -3
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +145 -145
- package/assets/skills/comet/scripts/comet-hook-router.mjs +353 -1035
- package/assets/skills/comet/scripts/comet-runtime.mjs +164 -186
- package/assets/skills/comet-native/SKILL.md +20 -23
- package/assets/skills/comet-native/reference/artifacts.md +0 -7
- package/assets/skills/comet-native/reference/clarification.md +1 -1
- package/assets/skills/comet-native/reference/commands.md +63 -65
- package/assets/skills/comet-native/reference/recovery.md +9 -1
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +2574 -5719
- package/assets/skills-zh/comet/SKILL.md +8 -4
- package/assets/skills-zh/comet/reference/classic-layout.md +3 -3
- package/assets/skills-zh/comet-native/SKILL.md +20 -23
- package/assets/skills-zh/comet-native/reference/artifacts.md +0 -7
- package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
- package/assets/skills-zh/comet-native/reference/commands.md +63 -65
- package/assets/skills-zh/comet-native/reference/recovery.md +9 -1
- package/dist/app/commands/classic.js +2 -2
- package/dist/app/commands/classic.js.map +1 -1
- package/dist/app/commands/dashboard.d.ts.map +1 -1
- package/dist/app/commands/dashboard.js +2 -1
- package/dist/app/commands/dashboard.js.map +1 -1
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +9 -3
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +14 -2
- package/dist/app/commands/update.js.map +1 -1
- package/dist/config/repository-layout.json +1 -4
- package/dist/domains/comet-classic/classic-layout-initialization.js +3 -3
- package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -1
- package/dist/domains/comet-classic/classic-root-command.d.ts +4 -1
- package/dist/domains/comet-classic/classic-root-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-root-command.js +159 -49
- package/dist/domains/comet-classic/classic-root-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-root-move.d.ts +0 -1
- package/dist/domains/comet-classic/classic-root-move.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-root-move.js +24 -121
- package/dist/domains/comet-classic/classic-root-move.js.map +1 -1
- package/dist/domains/comet-entry/current-selection-repair.js +1 -1
- package/dist/domains/comet-entry/current-selection-repair.js.map +1 -1
- package/dist/domains/comet-entry/hook-router.d.ts +12 -2
- package/dist/domains/comet-entry/hook-router.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router.js +40 -14
- package/dist/domains/comet-entry/hook-router.js.map +1 -1
- package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
- package/dist/domains/comet-entry/init-workflow.js +17 -3
- package/dist/domains/comet-entry/init-workflow.js.map +1 -1
- package/dist/domains/comet-native/native-acceptance.d.ts +1 -2
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
- package/dist/domains/comet-native/native-acceptance.js +5 -29
- package/dist/domains/comet-native/native-acceptance.js.map +1 -1
- package/dist/domains/comet-native/native-change.d.ts +0 -2
- package/dist/domains/comet-native/native-change.d.ts.map +1 -1
- package/dist/domains/comet-native/native-change.js +8 -104
- package/dist/domains/comet-native/native-change.js.map +1 -1
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli.js +6 -493
- package/dist/domains/comet-native/native-cli.js.map +1 -1
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-continuation.js +18 -5
- package/dist/domains/comet-native/native-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.js +5 -21
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.d.ts +2 -8
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.js +2 -23
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
- package/dist/domains/comet-native/native-findings.js +6 -4
- package/dist/domains/comet-native/native-findings.js.map +1 -1
- package/dist/domains/comet-native/native-repair-integration.d.ts +1 -3
- package/dist/domains/comet-native/native-repair-integration.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-integration.js +12 -15
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
- package/dist/domains/comet-native/native-repair-runtime.d.ts +0 -1
- package/dist/domains/comet-native/native-repair-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-runtime.js +3 -10
- package/dist/domains/comet-native/native-repair-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-repair-stagnation.d.ts +1 -9
- package/dist/domains/comet-native/native-repair-stagnation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-stagnation.js +4 -14
- package/dist/domains/comet-native/native-repair-stagnation.js.map +1 -1
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
- package/dist/domains/comet-native/native-snapshot.js +0 -77
- package/dist/domains/comet-native/native-snapshot.js.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.js +0 -10
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transitions.js +3 -31
- package/dist/domains/comet-native/native-transitions.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +1 -16
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-evidence.d.ts +2 -48
- package/dist/domains/comet-native/native-verification-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-evidence.js +13 -301
- package/dist/domains/comet-native/native-verification-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +2 -138
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +103 -769
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt.d.ts +3 -89
- package/dist/domains/comet-native/native-verification-receipt.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt.js +19 -350
- package/dist/domains/comet-native/native-verification-receipt.js.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.d.ts +1 -4
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.js +14 -209
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{arc-BXWNV2Qv.js → arc-BXDAG6Qx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{architectureDiagram-3BPJPVTR-CjVHPivo.js → architectureDiagram-3BPJPVTR-R2JyCv0i.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-P2PGImSM.js → blockDiagram-GPEHLZMM-STNPWdDl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-fTj6Xhs1.js → c4Diagram-AAUBKEIU-Bh-rUIcJ.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-XR_5gd6D.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-BjFDZ5yo.js → chunk-2J33WTMH-BRhFNAFH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-BAUkbZdT.js → chunk-4BX2VUAB-CwA3zkFS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DBmuiYme.js → chunk-55IACEB6-C1tqAl_E.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-Do9ufCgY.js → chunk-727SXJPM-DDefBoUS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-qRQWlB5d.js → chunk-AQP2D5EJ-Dq-0Yi9D.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BzDzeJ4_.js → chunk-FMBD7UC4-DC-MVNgk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-OQcAmIvL.js → chunk-ND2GUHAM-BLWZ8zWd.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-BiRfH4d2.js → chunk-QZHKN3VN-DaK5rvZu.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CG_TnucZ.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CG_TnucZ.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-CZk37fGn.js → cose-bilkent-S5V4N54A-DCPgAyMU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-B3F-qRTJ.js → cynefin-VYW2F7L2-CBaY4KFj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-BM42HDAG-D5BQ0eqN.js → dagre-BM42HDAG-CLKQ6BQM.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-2AECGRRQ-33mXstha.js → diagram-2AECGRRQ-DCup336F.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-5GNKFQAL-BWHCMFvD.js → diagram-5GNKFQAL-DgpDOFTE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-DrPGimEt.js → diagram-KO2AKTUF-BZcengGf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-LMA3HP47-BBlsg7jG.js → diagram-LMA3HP47-DSECilBo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-OG6HWLK6-CsaFSpHi.js → diagram-OG6HWLK6-3FuzANXW.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-CoB0mzhk.js → erDiagram-TEJ5UH35-BBrwULhs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-lT53XfSE.js → flowDiagram-I6XJVG4X-DiNn0Yzp.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ganttDiagram-6RSMTGT7-D1SQ56fl.js → ganttDiagram-6RSMTGT7-DcvbTHnu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-D4oDMS5x.js → gitGraphDiagram-PVQCEYII-CgCY3MJo.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-BR3wUr2k.css +1 -0
- package/dist/domains/dashboard/web/assets/{index-Msce_H_q.js → index-CovQUq5W.js} +4 -4
- package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-BeICn98s.js → infoDiagram-5YYISTIA-hzBGAEue.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkspu33d.js → ishikawaDiagram-YF4QCWOH-DCPPspol.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C-EM1sZl.js → journeyDiagram-JHISSGLW-C_v8b1Os.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BTbB0IO2.js → kanban-definition-UN3LZRKU-CgpE9lG7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-Cp0UrqDr.js → linear-jSddcREx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-CucmqsLW.js → mermaid.core-5Ibr28Ig.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-CjEshF1X.js → mindmap-definition-RKZ34NQL-XPCohX0x.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-DrwFnX1b.js → pieDiagram-4H26LBE5-DvhxgQWl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-CjG6pBR2.js → quadrantDiagram-W4KKPZXB-CCUxdF-S.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-BpUQVqCV.js → requirementDiagram-4Y6WPE33-FS3TCmdX.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-BeGkEvzR.js → sankeyDiagram-5OEKKPKP-r129rscN.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-sSTU3MCO.js → sequenceDiagram-3UESZ5HK--DCY0bvU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-AJRCARHV-CcFBc6qh.js → stateDiagram-AJRCARHV-yHkUByrT.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-XHzDdqcm.js +1 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DCN7NjEs.js → timeline-definition-PNZ67QCA-NlqCuFuo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-DZAN1_rr.js → vennDiagram-CIIHVFJN-B4W_d1Nq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-FfkJfr4C.js → wardleyDiagram-YWT4CUSO-Bex-_jWd.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-CD8B-EmR.js → xychartDiagram-2RQKCTM6-CmxeVM2Z.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +22 -2
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
- package/dist/domains/workflow-contract/project-config.js +4 -4
- package/dist/domains/workflow-contract/project-config.js.map +1 -1
- package/eval/local/tasks/comet-native-workflow/instruction.md +4 -17
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +22 -232
- package/eval/local/tests/conftest.py +0 -218
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +0 -163
- package/eval/local/tests/scaffold/test_tasks.py +1 -8
- package/eval/local/tests/scaffold/test_utils.py +4 -7
- package/eval/scaffold/shell/docker.sh +2 -95
- package/package.json +1 -1
- package/dist/domains/comet-native/native-controller-trust.d.ts +0 -22
- package/dist/domains/comet-native/native-controller-trust.d.ts.map +0 -1
- package/dist/domains/comet-native/native-controller-trust.js +0 -153
- package/dist/domains/comet-native/native-controller-trust.js.map +0 -1
- package/dist/domains/comet-native/native-creation-authorization.d.ts +0 -30
- package/dist/domains/comet-native/native-creation-authorization.d.ts.map +0 -1
- package/dist/domains/comet-native/native-creation-authorization.js +0 -110
- package/dist/domains/comet-native/native-creation-authorization.js.map +0 -1
- package/dist/domains/comet-native/native-independent-review.d.ts +0 -28
- package/dist/domains/comet-native/native-independent-review.d.ts.map +0 -1
- package/dist/domains/comet-native/native-independent-review.js +0 -134
- package/dist/domains/comet-native/native-independent-review.js.map +0 -1
- package/dist/domains/comet-native/native-review-contract.d.ts +0 -6
- package/dist/domains/comet-native/native-review-contract.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-contract.js +0 -6
- package/dist/domains/comet-native/native-review-contract.js.map +0 -1
- package/dist/domains/comet-native/native-review-identity.d.ts +0 -50
- package/dist/domains/comet-native/native-review-identity.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-identity.js +0 -209
- package/dist/domains/comet-native/native-review-identity.js.map +0 -1
- package/dist/domains/comet-native/native-review-signer.d.ts +0 -24
- package/dist/domains/comet-native/native-review-signer.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-signer.js +0 -125
- package/dist/domains/comet-native/native-review-signer.js.map +0 -1
- package/dist/domains/comet-native/native-review-trust.d.ts +0 -35
- package/dist/domains/comet-native/native-review-trust.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-trust.js +0 -176
- package/dist/domains/comet-native/native-review-trust.js.map +0 -1
- package/dist/domains/dashboard/web/assets/channel--JtnhJr8.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BRGmx8Iz.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BRGmx8Iz.js +0 -1
- package/dist/domains/dashboard/web/assets/index-D-AGxvI4.css +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-D5zZYi4x.js +0 -1
- package/eval/local/tasks/comet-native-workflow/environment/.include-trusted-native-review-fixture +0 -1
- package/eval/scaffold/shell/native-review-signer-daemon.mjs +0 -144
- package/eval/scaffold/shell/native-review-verifier-daemon.mjs +0 -178
|
@@ -49,9 +49,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
49
49
|
mod
|
|
50
50
|
));
|
|
51
51
|
|
|
52
|
-
// node_modules
|
|
52
|
+
// node_modules/yaml/dist/nodes/identity.js
|
|
53
53
|
var require_identity = __commonJS({
|
|
54
|
-
"node_modules
|
|
54
|
+
"node_modules/yaml/dist/nodes/identity.js"(exports) {
|
|
55
55
|
"use strict";
|
|
56
56
|
var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias");
|
|
57
57
|
var DOC = /* @__PURE__ */ Symbol.for("yaml.document");
|
|
@@ -106,9 +106,9 @@ var require_identity = __commonJS({
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
// node_modules
|
|
109
|
+
// node_modules/yaml/dist/visit.js
|
|
110
110
|
var require_visit = __commonJS({
|
|
111
|
-
"node_modules
|
|
111
|
+
"node_modules/yaml/dist/visit.js"(exports) {
|
|
112
112
|
"use strict";
|
|
113
113
|
var identity = require_identity();
|
|
114
114
|
var BREAK = /* @__PURE__ */ Symbol("break visit");
|
|
@@ -126,17 +126,17 @@ var require_visit = __commonJS({
|
|
|
126
126
|
visit.BREAK = BREAK;
|
|
127
127
|
visit.SKIP = SKIP;
|
|
128
128
|
visit.REMOVE = REMOVE;
|
|
129
|
-
function visit_(key, node, visitor,
|
|
130
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
129
|
+
function visit_(key, node, visitor, path19) {
|
|
130
|
+
const ctrl = callVisitor(key, node, visitor, path19);
|
|
131
131
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
132
|
-
replaceNode(key,
|
|
133
|
-
return visit_(key, ctrl, visitor,
|
|
132
|
+
replaceNode(key, path19, ctrl);
|
|
133
|
+
return visit_(key, ctrl, visitor, path19);
|
|
134
134
|
}
|
|
135
135
|
if (typeof ctrl !== "symbol") {
|
|
136
136
|
if (identity.isCollection(node)) {
|
|
137
|
-
|
|
137
|
+
path19 = Object.freeze(path19.concat(node));
|
|
138
138
|
for (let i = 0; i < node.items.length; ++i) {
|
|
139
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
139
|
+
const ci = visit_(i, node.items[i], visitor, path19);
|
|
140
140
|
if (typeof ci === "number")
|
|
141
141
|
i = ci - 1;
|
|
142
142
|
else if (ci === BREAK)
|
|
@@ -147,13 +147,13 @@ var require_visit = __commonJS({
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
} else if (identity.isPair(node)) {
|
|
150
|
-
|
|
151
|
-
const ck = visit_("key", node.key, visitor,
|
|
150
|
+
path19 = Object.freeze(path19.concat(node));
|
|
151
|
+
const ck = visit_("key", node.key, visitor, path19);
|
|
152
152
|
if (ck === BREAK)
|
|
153
153
|
return BREAK;
|
|
154
154
|
else if (ck === REMOVE)
|
|
155
155
|
node.key = null;
|
|
156
|
-
const cv = visit_("value", node.value, visitor,
|
|
156
|
+
const cv = visit_("value", node.value, visitor, path19);
|
|
157
157
|
if (cv === BREAK)
|
|
158
158
|
return BREAK;
|
|
159
159
|
else if (cv === REMOVE)
|
|
@@ -174,17 +174,17 @@ var require_visit = __commonJS({
|
|
|
174
174
|
visitAsync.BREAK = BREAK;
|
|
175
175
|
visitAsync.SKIP = SKIP;
|
|
176
176
|
visitAsync.REMOVE = REMOVE;
|
|
177
|
-
async function visitAsync_(key, node, visitor,
|
|
178
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
177
|
+
async function visitAsync_(key, node, visitor, path19) {
|
|
178
|
+
const ctrl = await callVisitor(key, node, visitor, path19);
|
|
179
179
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
180
|
-
replaceNode(key,
|
|
181
|
-
return visitAsync_(key, ctrl, visitor,
|
|
180
|
+
replaceNode(key, path19, ctrl);
|
|
181
|
+
return visitAsync_(key, ctrl, visitor, path19);
|
|
182
182
|
}
|
|
183
183
|
if (typeof ctrl !== "symbol") {
|
|
184
184
|
if (identity.isCollection(node)) {
|
|
185
|
-
|
|
185
|
+
path19 = Object.freeze(path19.concat(node));
|
|
186
186
|
for (let i = 0; i < node.items.length; ++i) {
|
|
187
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
187
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path19);
|
|
188
188
|
if (typeof ci === "number")
|
|
189
189
|
i = ci - 1;
|
|
190
190
|
else if (ci === BREAK)
|
|
@@ -195,13 +195,13 @@ var require_visit = __commonJS({
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
} else if (identity.isPair(node)) {
|
|
198
|
-
|
|
199
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
198
|
+
path19 = Object.freeze(path19.concat(node));
|
|
199
|
+
const ck = await visitAsync_("key", node.key, visitor, path19);
|
|
200
200
|
if (ck === BREAK)
|
|
201
201
|
return BREAK;
|
|
202
202
|
else if (ck === REMOVE)
|
|
203
203
|
node.key = null;
|
|
204
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
204
|
+
const cv = await visitAsync_("value", node.value, visitor, path19);
|
|
205
205
|
if (cv === BREAK)
|
|
206
206
|
return BREAK;
|
|
207
207
|
else if (cv === REMOVE)
|
|
@@ -228,23 +228,23 @@ var require_visit = __commonJS({
|
|
|
228
228
|
}
|
|
229
229
|
return visitor;
|
|
230
230
|
}
|
|
231
|
-
function callVisitor(key, node, visitor,
|
|
231
|
+
function callVisitor(key, node, visitor, path19) {
|
|
232
232
|
if (typeof visitor === "function")
|
|
233
|
-
return visitor(key, node,
|
|
233
|
+
return visitor(key, node, path19);
|
|
234
234
|
if (identity.isMap(node))
|
|
235
|
-
return visitor.Map?.(key, node,
|
|
235
|
+
return visitor.Map?.(key, node, path19);
|
|
236
236
|
if (identity.isSeq(node))
|
|
237
|
-
return visitor.Seq?.(key, node,
|
|
237
|
+
return visitor.Seq?.(key, node, path19);
|
|
238
238
|
if (identity.isPair(node))
|
|
239
|
-
return visitor.Pair?.(key, node,
|
|
239
|
+
return visitor.Pair?.(key, node, path19);
|
|
240
240
|
if (identity.isScalar(node))
|
|
241
|
-
return visitor.Scalar?.(key, node,
|
|
241
|
+
return visitor.Scalar?.(key, node, path19);
|
|
242
242
|
if (identity.isAlias(node))
|
|
243
|
-
return visitor.Alias?.(key, node,
|
|
243
|
+
return visitor.Alias?.(key, node, path19);
|
|
244
244
|
return void 0;
|
|
245
245
|
}
|
|
246
|
-
function replaceNode(key,
|
|
247
|
-
const parent =
|
|
246
|
+
function replaceNode(key, path19, node) {
|
|
247
|
+
const parent = path19[path19.length - 1];
|
|
248
248
|
if (identity.isCollection(parent)) {
|
|
249
249
|
parent.items[key] = node;
|
|
250
250
|
} else if (identity.isPair(parent)) {
|
|
@@ -264,9 +264,9 @@ var require_visit = __commonJS({
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
|
|
267
|
-
// node_modules
|
|
267
|
+
// node_modules/yaml/dist/doc/directives.js
|
|
268
268
|
var require_directives = __commonJS({
|
|
269
|
-
"node_modules
|
|
269
|
+
"node_modules/yaml/dist/doc/directives.js"(exports) {
|
|
270
270
|
"use strict";
|
|
271
271
|
var identity = require_identity();
|
|
272
272
|
var visit = require_visit();
|
|
@@ -435,9 +435,9 @@ var require_directives = __commonJS({
|
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
|
|
438
|
-
// node_modules
|
|
438
|
+
// node_modules/yaml/dist/doc/anchors.js
|
|
439
439
|
var require_anchors = __commonJS({
|
|
440
|
-
"node_modules
|
|
440
|
+
"node_modules/yaml/dist/doc/anchors.js"(exports) {
|
|
441
441
|
"use strict";
|
|
442
442
|
var identity = require_identity();
|
|
443
443
|
var visit = require_visit();
|
|
@@ -505,9 +505,9 @@ var require_anchors = __commonJS({
|
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
|
|
508
|
-
// node_modules
|
|
508
|
+
// node_modules/yaml/dist/doc/applyReviver.js
|
|
509
509
|
var require_applyReviver = __commonJS({
|
|
510
|
-
"node_modules
|
|
510
|
+
"node_modules/yaml/dist/doc/applyReviver.js"(exports) {
|
|
511
511
|
"use strict";
|
|
512
512
|
function applyReviver(reviver, obj, key, val) {
|
|
513
513
|
if (val && typeof val === "object") {
|
|
@@ -555,9 +555,9 @@ var require_applyReviver = __commonJS({
|
|
|
555
555
|
}
|
|
556
556
|
});
|
|
557
557
|
|
|
558
|
-
// node_modules
|
|
558
|
+
// node_modules/yaml/dist/nodes/toJS.js
|
|
559
559
|
var require_toJS = __commonJS({
|
|
560
|
-
"node_modules
|
|
560
|
+
"node_modules/yaml/dist/nodes/toJS.js"(exports) {
|
|
561
561
|
"use strict";
|
|
562
562
|
var identity = require_identity();
|
|
563
563
|
function toJS(value, arg, ctx) {
|
|
@@ -585,9 +585,9 @@ var require_toJS = __commonJS({
|
|
|
585
585
|
}
|
|
586
586
|
});
|
|
587
587
|
|
|
588
|
-
// node_modules
|
|
588
|
+
// node_modules/yaml/dist/nodes/Node.js
|
|
589
589
|
var require_Node = __commonJS({
|
|
590
|
-
"node_modules
|
|
590
|
+
"node_modules/yaml/dist/nodes/Node.js"(exports) {
|
|
591
591
|
"use strict";
|
|
592
592
|
var applyReviver = require_applyReviver();
|
|
593
593
|
var identity = require_identity();
|
|
@@ -626,9 +626,9 @@ var require_Node = __commonJS({
|
|
|
626
626
|
}
|
|
627
627
|
});
|
|
628
628
|
|
|
629
|
-
// node_modules
|
|
629
|
+
// node_modules/yaml/dist/nodes/Alias.js
|
|
630
630
|
var require_Alias = __commonJS({
|
|
631
|
-
"node_modules
|
|
631
|
+
"node_modules/yaml/dist/nodes/Alias.js"(exports) {
|
|
632
632
|
"use strict";
|
|
633
633
|
var anchors = require_anchors();
|
|
634
634
|
var visit = require_visit();
|
|
@@ -742,9 +742,9 @@ var require_Alias = __commonJS({
|
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
|
|
745
|
-
// node_modules
|
|
745
|
+
// node_modules/yaml/dist/nodes/Scalar.js
|
|
746
746
|
var require_Scalar = __commonJS({
|
|
747
|
-
"node_modules
|
|
747
|
+
"node_modules/yaml/dist/nodes/Scalar.js"(exports) {
|
|
748
748
|
"use strict";
|
|
749
749
|
var identity = require_identity();
|
|
750
750
|
var Node = require_Node();
|
|
@@ -772,9 +772,9 @@ var require_Scalar = __commonJS({
|
|
|
772
772
|
}
|
|
773
773
|
});
|
|
774
774
|
|
|
775
|
-
// node_modules
|
|
775
|
+
// node_modules/yaml/dist/doc/createNode.js
|
|
776
776
|
var require_createNode = __commonJS({
|
|
777
|
-
"node_modules
|
|
777
|
+
"node_modules/yaml/dist/doc/createNode.js"(exports) {
|
|
778
778
|
"use strict";
|
|
779
779
|
var Alias = require_Alias();
|
|
780
780
|
var identity = require_identity();
|
|
@@ -847,17 +847,17 @@ var require_createNode = __commonJS({
|
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
849
|
|
|
850
|
-
// node_modules
|
|
850
|
+
// node_modules/yaml/dist/nodes/Collection.js
|
|
851
851
|
var require_Collection = __commonJS({
|
|
852
|
-
"node_modules
|
|
852
|
+
"node_modules/yaml/dist/nodes/Collection.js"(exports) {
|
|
853
853
|
"use strict";
|
|
854
854
|
var createNode = require_createNode();
|
|
855
855
|
var identity = require_identity();
|
|
856
856
|
var Node = require_Node();
|
|
857
|
-
function collectionFromPath(schema,
|
|
857
|
+
function collectionFromPath(schema, path19, value) {
|
|
858
858
|
let v = value;
|
|
859
|
-
for (let i =
|
|
860
|
-
const k =
|
|
859
|
+
for (let i = path19.length - 1; i >= 0; --i) {
|
|
860
|
+
const k = path19[i];
|
|
861
861
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
862
862
|
const a = [];
|
|
863
863
|
a[k] = v;
|
|
@@ -876,7 +876,7 @@ var require_Collection = __commonJS({
|
|
|
876
876
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
877
877
|
});
|
|
878
878
|
}
|
|
879
|
-
var isEmptyPath = (
|
|
879
|
+
var isEmptyPath = (path19) => path19 == null || typeof path19 === "object" && !!path19[Symbol.iterator]().next().done;
|
|
880
880
|
var Collection = class extends Node.NodeBase {
|
|
881
881
|
constructor(type, schema) {
|
|
882
882
|
super(type);
|
|
@@ -906,11 +906,11 @@ var require_Collection = __commonJS({
|
|
|
906
906
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
907
907
|
* that already exists in the map.
|
|
908
908
|
*/
|
|
909
|
-
addIn(
|
|
910
|
-
if (isEmptyPath(
|
|
909
|
+
addIn(path19, value) {
|
|
910
|
+
if (isEmptyPath(path19))
|
|
911
911
|
this.add(value);
|
|
912
912
|
else {
|
|
913
|
-
const [key, ...rest] =
|
|
913
|
+
const [key, ...rest] = path19;
|
|
914
914
|
const node = this.get(key, true);
|
|
915
915
|
if (identity.isCollection(node))
|
|
916
916
|
node.addIn(rest, value);
|
|
@@ -924,8 +924,8 @@ var require_Collection = __commonJS({
|
|
|
924
924
|
* Removes a value from the collection.
|
|
925
925
|
* @returns `true` if the item was found and removed.
|
|
926
926
|
*/
|
|
927
|
-
deleteIn(
|
|
928
|
-
const [key, ...rest] =
|
|
927
|
+
deleteIn(path19) {
|
|
928
|
+
const [key, ...rest] = path19;
|
|
929
929
|
if (rest.length === 0)
|
|
930
930
|
return this.delete(key);
|
|
931
931
|
const node = this.get(key, true);
|
|
@@ -939,8 +939,8 @@ var require_Collection = __commonJS({
|
|
|
939
939
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
940
940
|
* `true` (collections are always returned intact).
|
|
941
941
|
*/
|
|
942
|
-
getIn(
|
|
943
|
-
const [key, ...rest] =
|
|
942
|
+
getIn(path19, keepScalar) {
|
|
943
|
+
const [key, ...rest] = path19;
|
|
944
944
|
const node = this.get(key, true);
|
|
945
945
|
if (rest.length === 0)
|
|
946
946
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -958,8 +958,8 @@ var require_Collection = __commonJS({
|
|
|
958
958
|
/**
|
|
959
959
|
* Checks if the collection includes a value with the key `key`.
|
|
960
960
|
*/
|
|
961
|
-
hasIn(
|
|
962
|
-
const [key, ...rest] =
|
|
961
|
+
hasIn(path19) {
|
|
962
|
+
const [key, ...rest] = path19;
|
|
963
963
|
if (rest.length === 0)
|
|
964
964
|
return this.has(key);
|
|
965
965
|
const node = this.get(key, true);
|
|
@@ -969,8 +969,8 @@ var require_Collection = __commonJS({
|
|
|
969
969
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
970
970
|
* boolean to add/remove the item from the set.
|
|
971
971
|
*/
|
|
972
|
-
setIn(
|
|
973
|
-
const [key, ...rest] =
|
|
972
|
+
setIn(path19, value) {
|
|
973
|
+
const [key, ...rest] = path19;
|
|
974
974
|
if (rest.length === 0) {
|
|
975
975
|
this.set(key, value);
|
|
976
976
|
} else {
|
|
@@ -990,9 +990,9 @@ var require_Collection = __commonJS({
|
|
|
990
990
|
}
|
|
991
991
|
});
|
|
992
992
|
|
|
993
|
-
// node_modules
|
|
993
|
+
// node_modules/yaml/dist/stringify/stringifyComment.js
|
|
994
994
|
var require_stringifyComment = __commonJS({
|
|
995
|
-
"node_modules
|
|
995
|
+
"node_modules/yaml/dist/stringify/stringifyComment.js"(exports) {
|
|
996
996
|
"use strict";
|
|
997
997
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
998
998
|
function indentComment(comment, indent) {
|
|
@@ -1007,9 +1007,9 @@ var require_stringifyComment = __commonJS({
|
|
|
1007
1007
|
}
|
|
1008
1008
|
});
|
|
1009
1009
|
|
|
1010
|
-
// node_modules
|
|
1010
|
+
// node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
1011
1011
|
var require_foldFlowLines = __commonJS({
|
|
1012
|
-
"node_modules
|
|
1012
|
+
"node_modules/yaml/dist/stringify/foldFlowLines.js"(exports) {
|
|
1013
1013
|
"use strict";
|
|
1014
1014
|
var FOLD_FLOW = "flow";
|
|
1015
1015
|
var FOLD_BLOCK = "block";
|
|
@@ -1143,9 +1143,9 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1143
1143
|
}
|
|
1144
1144
|
});
|
|
1145
1145
|
|
|
1146
|
-
// node_modules
|
|
1146
|
+
// node_modules/yaml/dist/stringify/stringifyString.js
|
|
1147
1147
|
var require_stringifyString = __commonJS({
|
|
1148
|
-
"node_modules
|
|
1148
|
+
"node_modules/yaml/dist/stringify/stringifyString.js"(exports) {
|
|
1149
1149
|
"use strict";
|
|
1150
1150
|
var Scalar = require_Scalar();
|
|
1151
1151
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -1426,9 +1426,9 @@ ${indent}`);
|
|
|
1426
1426
|
}
|
|
1427
1427
|
});
|
|
1428
1428
|
|
|
1429
|
-
// node_modules
|
|
1429
|
+
// node_modules/yaml/dist/stringify/stringify.js
|
|
1430
1430
|
var require_stringify = __commonJS({
|
|
1431
|
-
"node_modules
|
|
1431
|
+
"node_modules/yaml/dist/stringify/stringify.js"(exports) {
|
|
1432
1432
|
"use strict";
|
|
1433
1433
|
var anchors = require_anchors();
|
|
1434
1434
|
var identity = require_identity();
|
|
@@ -1550,9 +1550,9 @@ ${ctx.indent}${str}`;
|
|
|
1550
1550
|
}
|
|
1551
1551
|
});
|
|
1552
1552
|
|
|
1553
|
-
// node_modules
|
|
1553
|
+
// node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1554
1554
|
var require_stringifyPair = __commonJS({
|
|
1555
|
-
"node_modules
|
|
1555
|
+
"node_modules/yaml/dist/stringify/stringifyPair.js"(exports) {
|
|
1556
1556
|
"use strict";
|
|
1557
1557
|
var identity = require_identity();
|
|
1558
1558
|
var Scalar = require_Scalar();
|
|
@@ -1683,9 +1683,9 @@ ${ctx.indent}`;
|
|
|
1683
1683
|
}
|
|
1684
1684
|
});
|
|
1685
1685
|
|
|
1686
|
-
// node_modules
|
|
1686
|
+
// node_modules/yaml/dist/log.js
|
|
1687
1687
|
var require_log = __commonJS({
|
|
1688
|
-
"node_modules
|
|
1688
|
+
"node_modules/yaml/dist/log.js"(exports) {
|
|
1689
1689
|
"use strict";
|
|
1690
1690
|
var node_process = __require("process");
|
|
1691
1691
|
function debug(logLevel, ...messages) {
|
|
@@ -1705,9 +1705,9 @@ var require_log = __commonJS({
|
|
|
1705
1705
|
}
|
|
1706
1706
|
});
|
|
1707
1707
|
|
|
1708
|
-
// node_modules
|
|
1708
|
+
// node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
1709
1709
|
var require_merge = __commonJS({
|
|
1710
|
-
"node_modules
|
|
1710
|
+
"node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports) {
|
|
1711
1711
|
"use strict";
|
|
1712
1712
|
var identity = require_identity();
|
|
1713
1713
|
var Scalar = require_Scalar();
|
|
@@ -1765,9 +1765,9 @@ var require_merge = __commonJS({
|
|
|
1765
1765
|
}
|
|
1766
1766
|
});
|
|
1767
1767
|
|
|
1768
|
-
// node_modules
|
|
1768
|
+
// node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
1769
1769
|
var require_addPairToJSMap = __commonJS({
|
|
1770
|
-
"node_modules
|
|
1770
|
+
"node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports) {
|
|
1771
1771
|
"use strict";
|
|
1772
1772
|
var log = require_log();
|
|
1773
1773
|
var merge = require_merge();
|
|
@@ -1829,9 +1829,9 @@ var require_addPairToJSMap = __commonJS({
|
|
|
1829
1829
|
}
|
|
1830
1830
|
});
|
|
1831
1831
|
|
|
1832
|
-
// node_modules
|
|
1832
|
+
// node_modules/yaml/dist/nodes/Pair.js
|
|
1833
1833
|
var require_Pair = __commonJS({
|
|
1834
|
-
"node_modules
|
|
1834
|
+
"node_modules/yaml/dist/nodes/Pair.js"(exports) {
|
|
1835
1835
|
"use strict";
|
|
1836
1836
|
var createNode = require_createNode();
|
|
1837
1837
|
var stringifyPair = require_stringifyPair();
|
|
@@ -1869,9 +1869,9 @@ var require_Pair = __commonJS({
|
|
|
1869
1869
|
}
|
|
1870
1870
|
});
|
|
1871
1871
|
|
|
1872
|
-
// node_modules
|
|
1872
|
+
// node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
1873
1873
|
var require_stringifyCollection = __commonJS({
|
|
1874
|
-
"node_modules
|
|
1874
|
+
"node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) {
|
|
1875
1875
|
"use strict";
|
|
1876
1876
|
var identity = require_identity();
|
|
1877
1877
|
var stringify3 = require_stringify();
|
|
@@ -2020,9 +2020,9 @@ ${indent}${end}`;
|
|
|
2020
2020
|
}
|
|
2021
2021
|
});
|
|
2022
2022
|
|
|
2023
|
-
// node_modules
|
|
2023
|
+
// node_modules/yaml/dist/nodes/YAMLMap.js
|
|
2024
2024
|
var require_YAMLMap = __commonJS({
|
|
2025
|
-
"node_modules
|
|
2025
|
+
"node_modules/yaml/dist/nodes/YAMLMap.js"(exports) {
|
|
2026
2026
|
"use strict";
|
|
2027
2027
|
var stringifyCollection = require_stringifyCollection();
|
|
2028
2028
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -2164,9 +2164,9 @@ var require_YAMLMap = __commonJS({
|
|
|
2164
2164
|
}
|
|
2165
2165
|
});
|
|
2166
2166
|
|
|
2167
|
-
// node_modules
|
|
2167
|
+
// node_modules/yaml/dist/schema/common/map.js
|
|
2168
2168
|
var require_map = __commonJS({
|
|
2169
|
-
"node_modules
|
|
2169
|
+
"node_modules/yaml/dist/schema/common/map.js"(exports) {
|
|
2170
2170
|
"use strict";
|
|
2171
2171
|
var identity = require_identity();
|
|
2172
2172
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2186,9 +2186,9 @@ var require_map = __commonJS({
|
|
|
2186
2186
|
}
|
|
2187
2187
|
});
|
|
2188
2188
|
|
|
2189
|
-
// node_modules
|
|
2189
|
+
// node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2190
2190
|
var require_YAMLSeq = __commonJS({
|
|
2191
|
-
"node_modules
|
|
2191
|
+
"node_modules/yaml/dist/nodes/YAMLSeq.js"(exports) {
|
|
2192
2192
|
"use strict";
|
|
2193
2193
|
var createNode = require_createNode();
|
|
2194
2194
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -2302,9 +2302,9 @@ var require_YAMLSeq = __commonJS({
|
|
|
2302
2302
|
}
|
|
2303
2303
|
});
|
|
2304
2304
|
|
|
2305
|
-
// node_modules
|
|
2305
|
+
// node_modules/yaml/dist/schema/common/seq.js
|
|
2306
2306
|
var require_seq = __commonJS({
|
|
2307
|
-
"node_modules
|
|
2307
|
+
"node_modules/yaml/dist/schema/common/seq.js"(exports) {
|
|
2308
2308
|
"use strict";
|
|
2309
2309
|
var identity = require_identity();
|
|
2310
2310
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -2324,9 +2324,9 @@ var require_seq = __commonJS({
|
|
|
2324
2324
|
}
|
|
2325
2325
|
});
|
|
2326
2326
|
|
|
2327
|
-
// node_modules
|
|
2327
|
+
// node_modules/yaml/dist/schema/common/string.js
|
|
2328
2328
|
var require_string = __commonJS({
|
|
2329
|
-
"node_modules
|
|
2329
|
+
"node_modules/yaml/dist/schema/common/string.js"(exports) {
|
|
2330
2330
|
"use strict";
|
|
2331
2331
|
var stringifyString = require_stringifyString();
|
|
2332
2332
|
var string = {
|
|
@@ -2343,9 +2343,9 @@ var require_string = __commonJS({
|
|
|
2343
2343
|
}
|
|
2344
2344
|
});
|
|
2345
2345
|
|
|
2346
|
-
// node_modules
|
|
2346
|
+
// node_modules/yaml/dist/schema/common/null.js
|
|
2347
2347
|
var require_null = __commonJS({
|
|
2348
|
-
"node_modules
|
|
2348
|
+
"node_modules/yaml/dist/schema/common/null.js"(exports) {
|
|
2349
2349
|
"use strict";
|
|
2350
2350
|
var Scalar = require_Scalar();
|
|
2351
2351
|
var nullTag = {
|
|
@@ -2361,9 +2361,9 @@ var require_null = __commonJS({
|
|
|
2361
2361
|
}
|
|
2362
2362
|
});
|
|
2363
2363
|
|
|
2364
|
-
// node_modules
|
|
2364
|
+
// node_modules/yaml/dist/schema/core/bool.js
|
|
2365
2365
|
var require_bool = __commonJS({
|
|
2366
|
-
"node_modules
|
|
2366
|
+
"node_modules/yaml/dist/schema/core/bool.js"(exports) {
|
|
2367
2367
|
"use strict";
|
|
2368
2368
|
var Scalar = require_Scalar();
|
|
2369
2369
|
var boolTag = {
|
|
@@ -2385,9 +2385,9 @@ var require_bool = __commonJS({
|
|
|
2385
2385
|
}
|
|
2386
2386
|
});
|
|
2387
2387
|
|
|
2388
|
-
// node_modules
|
|
2388
|
+
// node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2389
2389
|
var require_stringifyNumber = __commonJS({
|
|
2390
|
-
"node_modules
|
|
2390
|
+
"node_modules/yaml/dist/stringify/stringifyNumber.js"(exports) {
|
|
2391
2391
|
"use strict";
|
|
2392
2392
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2393
2393
|
if (typeof value === "bigint")
|
|
@@ -2412,9 +2412,9 @@ var require_stringifyNumber = __commonJS({
|
|
|
2412
2412
|
}
|
|
2413
2413
|
});
|
|
2414
2414
|
|
|
2415
|
-
// node_modules
|
|
2415
|
+
// node_modules/yaml/dist/schema/core/float.js
|
|
2416
2416
|
var require_float = __commonJS({
|
|
2417
|
-
"node_modules
|
|
2417
|
+
"node_modules/yaml/dist/schema/core/float.js"(exports) {
|
|
2418
2418
|
"use strict";
|
|
2419
2419
|
var Scalar = require_Scalar();
|
|
2420
2420
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2458,9 +2458,9 @@ var require_float = __commonJS({
|
|
|
2458
2458
|
}
|
|
2459
2459
|
});
|
|
2460
2460
|
|
|
2461
|
-
// node_modules
|
|
2461
|
+
// node_modules/yaml/dist/schema/core/int.js
|
|
2462
2462
|
var require_int = __commonJS({
|
|
2463
|
-
"node_modules
|
|
2463
|
+
"node_modules/yaml/dist/schema/core/int.js"(exports) {
|
|
2464
2464
|
"use strict";
|
|
2465
2465
|
var stringifyNumber = require_stringifyNumber();
|
|
2466
2466
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2503,9 +2503,9 @@ var require_int = __commonJS({
|
|
|
2503
2503
|
}
|
|
2504
2504
|
});
|
|
2505
2505
|
|
|
2506
|
-
// node_modules
|
|
2506
|
+
// node_modules/yaml/dist/schema/core/schema.js
|
|
2507
2507
|
var require_schema = __commonJS({
|
|
2508
|
-
"node_modules
|
|
2508
|
+
"node_modules/yaml/dist/schema/core/schema.js"(exports) {
|
|
2509
2509
|
"use strict";
|
|
2510
2510
|
var map = require_map();
|
|
2511
2511
|
var _null = require_null();
|
|
@@ -2531,9 +2531,9 @@ var require_schema = __commonJS({
|
|
|
2531
2531
|
}
|
|
2532
2532
|
});
|
|
2533
2533
|
|
|
2534
|
-
// node_modules
|
|
2534
|
+
// node_modules/yaml/dist/schema/json/schema.js
|
|
2535
2535
|
var require_schema2 = __commonJS({
|
|
2536
|
-
"node_modules
|
|
2536
|
+
"node_modules/yaml/dist/schema/json/schema.js"(exports) {
|
|
2537
2537
|
"use strict";
|
|
2538
2538
|
var Scalar = require_Scalar();
|
|
2539
2539
|
var map = require_map();
|
|
@@ -2598,9 +2598,9 @@ var require_schema2 = __commonJS({
|
|
|
2598
2598
|
}
|
|
2599
2599
|
});
|
|
2600
2600
|
|
|
2601
|
-
// node_modules
|
|
2601
|
+
// node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2602
2602
|
var require_binary = __commonJS({
|
|
2603
|
-
"node_modules
|
|
2603
|
+
"node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports) {
|
|
2604
2604
|
"use strict";
|
|
2605
2605
|
var node_buffer = __require("buffer");
|
|
2606
2606
|
var Scalar = require_Scalar();
|
|
@@ -2664,9 +2664,9 @@ var require_binary = __commonJS({
|
|
|
2664
2664
|
}
|
|
2665
2665
|
});
|
|
2666
2666
|
|
|
2667
|
-
// node_modules
|
|
2667
|
+
// node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2668
2668
|
var require_pairs = __commonJS({
|
|
2669
|
-
"node_modules
|
|
2669
|
+
"node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports) {
|
|
2670
2670
|
"use strict";
|
|
2671
2671
|
var identity = require_identity();
|
|
2672
2672
|
var Pair = require_Pair();
|
|
@@ -2742,9 +2742,9 @@ ${cn.comment}` : item.comment;
|
|
|
2742
2742
|
}
|
|
2743
2743
|
});
|
|
2744
2744
|
|
|
2745
|
-
// node_modules
|
|
2745
|
+
// node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2746
2746
|
var require_omap = __commonJS({
|
|
2747
|
-
"node_modules
|
|
2747
|
+
"node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports) {
|
|
2748
2748
|
"use strict";
|
|
2749
2749
|
var identity = require_identity();
|
|
2750
2750
|
var toJS = require_toJS();
|
|
@@ -2820,9 +2820,9 @@ var require_omap = __commonJS({
|
|
|
2820
2820
|
}
|
|
2821
2821
|
});
|
|
2822
2822
|
|
|
2823
|
-
// node_modules
|
|
2823
|
+
// node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2824
2824
|
var require_bool2 = __commonJS({
|
|
2825
|
-
"node_modules
|
|
2825
|
+
"node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports) {
|
|
2826
2826
|
"use strict";
|
|
2827
2827
|
var Scalar = require_Scalar();
|
|
2828
2828
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -2852,9 +2852,9 @@ var require_bool2 = __commonJS({
|
|
|
2852
2852
|
}
|
|
2853
2853
|
});
|
|
2854
2854
|
|
|
2855
|
-
// node_modules
|
|
2855
|
+
// node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
2856
2856
|
var require_float2 = __commonJS({
|
|
2857
|
-
"node_modules
|
|
2857
|
+
"node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports) {
|
|
2858
2858
|
"use strict";
|
|
2859
2859
|
var Scalar = require_Scalar();
|
|
2860
2860
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2901,9 +2901,9 @@ var require_float2 = __commonJS({
|
|
|
2901
2901
|
}
|
|
2902
2902
|
});
|
|
2903
2903
|
|
|
2904
|
-
// node_modules
|
|
2904
|
+
// node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
2905
2905
|
var require_int2 = __commonJS({
|
|
2906
|
-
"node_modules
|
|
2906
|
+
"node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports) {
|
|
2907
2907
|
"use strict";
|
|
2908
2908
|
var stringifyNumber = require_stringifyNumber();
|
|
2909
2909
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2980,9 +2980,9 @@ var require_int2 = __commonJS({
|
|
|
2980
2980
|
}
|
|
2981
2981
|
});
|
|
2982
2982
|
|
|
2983
|
-
// node_modules
|
|
2983
|
+
// node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
2984
2984
|
var require_set = __commonJS({
|
|
2985
|
-
"node_modules
|
|
2985
|
+
"node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports) {
|
|
2986
2986
|
"use strict";
|
|
2987
2987
|
var identity = require_identity();
|
|
2988
2988
|
var Pair = require_Pair();
|
|
@@ -3069,9 +3069,9 @@ var require_set = __commonJS({
|
|
|
3069
3069
|
}
|
|
3070
3070
|
});
|
|
3071
3071
|
|
|
3072
|
-
// node_modules
|
|
3072
|
+
// node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
3073
3073
|
var require_timestamp = __commonJS({
|
|
3074
|
-
"node_modules
|
|
3074
|
+
"node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) {
|
|
3075
3075
|
"use strict";
|
|
3076
3076
|
var stringifyNumber = require_stringifyNumber();
|
|
3077
3077
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -3157,9 +3157,9 @@ var require_timestamp = __commonJS({
|
|
|
3157
3157
|
}
|
|
3158
3158
|
});
|
|
3159
3159
|
|
|
3160
|
-
// node_modules
|
|
3160
|
+
// node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
3161
3161
|
var require_schema3 = __commonJS({
|
|
3162
|
-
"node_modules
|
|
3162
|
+
"node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports) {
|
|
3163
3163
|
"use strict";
|
|
3164
3164
|
var map = require_map();
|
|
3165
3165
|
var _null = require_null();
|
|
@@ -3201,9 +3201,9 @@ var require_schema3 = __commonJS({
|
|
|
3201
3201
|
}
|
|
3202
3202
|
});
|
|
3203
3203
|
|
|
3204
|
-
// node_modules
|
|
3204
|
+
// node_modules/yaml/dist/schema/tags.js
|
|
3205
3205
|
var require_tags = __commonJS({
|
|
3206
|
-
"node_modules
|
|
3206
|
+
"node_modules/yaml/dist/schema/tags.js"(exports) {
|
|
3207
3207
|
"use strict";
|
|
3208
3208
|
var map = require_map();
|
|
3209
3209
|
var _null = require_null();
|
|
@@ -3295,9 +3295,9 @@ var require_tags = __commonJS({
|
|
|
3295
3295
|
}
|
|
3296
3296
|
});
|
|
3297
3297
|
|
|
3298
|
-
// node_modules
|
|
3298
|
+
// node_modules/yaml/dist/schema/Schema.js
|
|
3299
3299
|
var require_Schema = __commonJS({
|
|
3300
|
-
"node_modules
|
|
3300
|
+
"node_modules/yaml/dist/schema/Schema.js"(exports) {
|
|
3301
3301
|
"use strict";
|
|
3302
3302
|
var identity = require_identity();
|
|
3303
3303
|
var map = require_map();
|
|
@@ -3327,9 +3327,9 @@ var require_Schema = __commonJS({
|
|
|
3327
3327
|
}
|
|
3328
3328
|
});
|
|
3329
3329
|
|
|
3330
|
-
// node_modules
|
|
3330
|
+
// node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3331
3331
|
var require_stringifyDocument = __commonJS({
|
|
3332
|
-
"node_modules
|
|
3332
|
+
"node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) {
|
|
3333
3333
|
"use strict";
|
|
3334
3334
|
var identity = require_identity();
|
|
3335
3335
|
var stringify3 = require_stringify();
|
|
@@ -3407,9 +3407,9 @@ var require_stringifyDocument = __commonJS({
|
|
|
3407
3407
|
}
|
|
3408
3408
|
});
|
|
3409
3409
|
|
|
3410
|
-
// node_modules
|
|
3410
|
+
// node_modules/yaml/dist/doc/Document.js
|
|
3411
3411
|
var require_Document = __commonJS({
|
|
3412
|
-
"node_modules
|
|
3412
|
+
"node_modules/yaml/dist/doc/Document.js"(exports) {
|
|
3413
3413
|
"use strict";
|
|
3414
3414
|
var Alias = require_Alias();
|
|
3415
3415
|
var Collection = require_Collection();
|
|
@@ -3485,9 +3485,9 @@ var require_Document = __commonJS({
|
|
|
3485
3485
|
this.contents.add(value);
|
|
3486
3486
|
}
|
|
3487
3487
|
/** Adds a value to the document. */
|
|
3488
|
-
addIn(
|
|
3488
|
+
addIn(path19, value) {
|
|
3489
3489
|
if (assertCollection(this.contents))
|
|
3490
|
-
this.contents.addIn(
|
|
3490
|
+
this.contents.addIn(path19, value);
|
|
3491
3491
|
}
|
|
3492
3492
|
/**
|
|
3493
3493
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -3562,14 +3562,14 @@ var require_Document = __commonJS({
|
|
|
3562
3562
|
* Removes a value from the document.
|
|
3563
3563
|
* @returns `true` if the item was found and removed.
|
|
3564
3564
|
*/
|
|
3565
|
-
deleteIn(
|
|
3566
|
-
if (Collection.isEmptyPath(
|
|
3565
|
+
deleteIn(path19) {
|
|
3566
|
+
if (Collection.isEmptyPath(path19)) {
|
|
3567
3567
|
if (this.contents == null)
|
|
3568
3568
|
return false;
|
|
3569
3569
|
this.contents = null;
|
|
3570
3570
|
return true;
|
|
3571
3571
|
}
|
|
3572
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
3572
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path19) : false;
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -3584,10 +3584,10 @@ var require_Document = __commonJS({
|
|
|
3584
3584
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3585
3585
|
* `true` (collections are always returned intact).
|
|
3586
3586
|
*/
|
|
3587
|
-
getIn(
|
|
3588
|
-
if (Collection.isEmptyPath(
|
|
3587
|
+
getIn(path19, keepScalar) {
|
|
3588
|
+
if (Collection.isEmptyPath(path19))
|
|
3589
3589
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
3590
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
3590
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path19, keepScalar) : void 0;
|
|
3591
3591
|
}
|
|
3592
3592
|
/**
|
|
3593
3593
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -3598,10 +3598,10 @@ var require_Document = __commonJS({
|
|
|
3598
3598
|
/**
|
|
3599
3599
|
* Checks if the document includes a value at `path`.
|
|
3600
3600
|
*/
|
|
3601
|
-
hasIn(
|
|
3602
|
-
if (Collection.isEmptyPath(
|
|
3601
|
+
hasIn(path19) {
|
|
3602
|
+
if (Collection.isEmptyPath(path19))
|
|
3603
3603
|
return this.contents !== void 0;
|
|
3604
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
3604
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path19) : false;
|
|
3605
3605
|
}
|
|
3606
3606
|
/**
|
|
3607
3607
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -3618,13 +3618,13 @@ var require_Document = __commonJS({
|
|
|
3618
3618
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
3619
3619
|
* boolean to add/remove the item from the set.
|
|
3620
3620
|
*/
|
|
3621
|
-
setIn(
|
|
3622
|
-
if (Collection.isEmptyPath(
|
|
3621
|
+
setIn(path19, value) {
|
|
3622
|
+
if (Collection.isEmptyPath(path19)) {
|
|
3623
3623
|
this.contents = value;
|
|
3624
3624
|
} else if (this.contents == null) {
|
|
3625
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
3625
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path19), value);
|
|
3626
3626
|
} else if (assertCollection(this.contents)) {
|
|
3627
|
-
this.contents.setIn(
|
|
3627
|
+
this.contents.setIn(path19, value);
|
|
3628
3628
|
}
|
|
3629
3629
|
}
|
|
3630
3630
|
/**
|
|
@@ -3716,9 +3716,9 @@ var require_Document = __commonJS({
|
|
|
3716
3716
|
}
|
|
3717
3717
|
});
|
|
3718
3718
|
|
|
3719
|
-
// node_modules
|
|
3719
|
+
// node_modules/yaml/dist/errors.js
|
|
3720
3720
|
var require_errors = __commonJS({
|
|
3721
|
-
"node_modules
|
|
3721
|
+
"node_modules/yaml/dist/errors.js"(exports) {
|
|
3722
3722
|
"use strict";
|
|
3723
3723
|
var YAMLError = class extends Error {
|
|
3724
3724
|
constructor(name, pos, code, message) {
|
|
@@ -3781,9 +3781,9 @@ ${pointer}
|
|
|
3781
3781
|
}
|
|
3782
3782
|
});
|
|
3783
3783
|
|
|
3784
|
-
// node_modules
|
|
3784
|
+
// node_modules/yaml/dist/compose/resolve-props.js
|
|
3785
3785
|
var require_resolve_props = __commonJS({
|
|
3786
|
-
"node_modules
|
|
3786
|
+
"node_modules/yaml/dist/compose/resolve-props.js"(exports) {
|
|
3787
3787
|
"use strict";
|
|
3788
3788
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3789
3789
|
let spaceBefore = false;
|
|
@@ -3915,9 +3915,9 @@ var require_resolve_props = __commonJS({
|
|
|
3915
3915
|
}
|
|
3916
3916
|
});
|
|
3917
3917
|
|
|
3918
|
-
// node_modules
|
|
3918
|
+
// node_modules/yaml/dist/compose/util-contains-newline.js
|
|
3919
3919
|
var require_util_contains_newline = __commonJS({
|
|
3920
|
-
"node_modules
|
|
3920
|
+
"node_modules/yaml/dist/compose/util-contains-newline.js"(exports) {
|
|
3921
3921
|
"use strict";
|
|
3922
3922
|
function containsNewline(key) {
|
|
3923
3923
|
if (!key)
|
|
@@ -3957,9 +3957,9 @@ var require_util_contains_newline = __commonJS({
|
|
|
3957
3957
|
}
|
|
3958
3958
|
});
|
|
3959
3959
|
|
|
3960
|
-
// node_modules
|
|
3960
|
+
// node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
3961
3961
|
var require_util_flow_indent_check = __commonJS({
|
|
3962
|
-
"node_modules
|
|
3962
|
+
"node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports) {
|
|
3963
3963
|
"use strict";
|
|
3964
3964
|
var utilContainsNewline = require_util_contains_newline();
|
|
3965
3965
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -3975,9 +3975,9 @@ var require_util_flow_indent_check = __commonJS({
|
|
|
3975
3975
|
}
|
|
3976
3976
|
});
|
|
3977
3977
|
|
|
3978
|
-
// node_modules
|
|
3978
|
+
// node_modules/yaml/dist/compose/util-map-includes.js
|
|
3979
3979
|
var require_util_map_includes = __commonJS({
|
|
3980
|
-
"node_modules
|
|
3980
|
+
"node_modules/yaml/dist/compose/util-map-includes.js"(exports) {
|
|
3981
3981
|
"use strict";
|
|
3982
3982
|
var identity = require_identity();
|
|
3983
3983
|
function mapIncludes(ctx, items, search) {
|
|
@@ -3991,9 +3991,9 @@ var require_util_map_includes = __commonJS({
|
|
|
3991
3991
|
}
|
|
3992
3992
|
});
|
|
3993
3993
|
|
|
3994
|
-
// node_modules
|
|
3994
|
+
// node_modules/yaml/dist/compose/resolve-block-map.js
|
|
3995
3995
|
var require_resolve_block_map = __commonJS({
|
|
3996
|
-
"node_modules
|
|
3996
|
+
"node_modules/yaml/dist/compose/resolve-block-map.js"(exports) {
|
|
3997
3997
|
"use strict";
|
|
3998
3998
|
var Pair = require_Pair();
|
|
3999
3999
|
var YAMLMap = require_YAMLMap();
|
|
@@ -4099,9 +4099,9 @@ var require_resolve_block_map = __commonJS({
|
|
|
4099
4099
|
}
|
|
4100
4100
|
});
|
|
4101
4101
|
|
|
4102
|
-
// node_modules
|
|
4102
|
+
// node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
4103
4103
|
var require_resolve_block_seq = __commonJS({
|
|
4104
|
-
"node_modules
|
|
4104
|
+
"node_modules/yaml/dist/compose/resolve-block-seq.js"(exports) {
|
|
4105
4105
|
"use strict";
|
|
4106
4106
|
var YAMLSeq = require_YAMLSeq();
|
|
4107
4107
|
var resolveProps = require_resolve_props();
|
|
@@ -4150,9 +4150,9 @@ var require_resolve_block_seq = __commonJS({
|
|
|
4150
4150
|
}
|
|
4151
4151
|
});
|
|
4152
4152
|
|
|
4153
|
-
// node_modules
|
|
4153
|
+
// node_modules/yaml/dist/compose/resolve-end.js
|
|
4154
4154
|
var require_resolve_end = __commonJS({
|
|
4155
|
-
"node_modules
|
|
4155
|
+
"node_modules/yaml/dist/compose/resolve-end.js"(exports) {
|
|
4156
4156
|
"use strict";
|
|
4157
4157
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
4158
4158
|
let comment = "";
|
|
@@ -4193,9 +4193,9 @@ var require_resolve_end = __commonJS({
|
|
|
4193
4193
|
}
|
|
4194
4194
|
});
|
|
4195
4195
|
|
|
4196
|
-
// node_modules
|
|
4196
|
+
// node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
4197
4197
|
var require_resolve_flow_collection = __commonJS({
|
|
4198
|
-
"node_modules
|
|
4198
|
+
"node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports) {
|
|
4199
4199
|
"use strict";
|
|
4200
4200
|
var identity = require_identity();
|
|
4201
4201
|
var Pair = require_Pair();
|
|
@@ -4387,9 +4387,9 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4387
4387
|
}
|
|
4388
4388
|
});
|
|
4389
4389
|
|
|
4390
|
-
// node_modules
|
|
4390
|
+
// node_modules/yaml/dist/compose/compose-collection.js
|
|
4391
4391
|
var require_compose_collection = __commonJS({
|
|
4392
|
-
"node_modules
|
|
4392
|
+
"node_modules/yaml/dist/compose/compose-collection.js"(exports) {
|
|
4393
4393
|
"use strict";
|
|
4394
4394
|
var identity = require_identity();
|
|
4395
4395
|
var Scalar = require_Scalar();
|
|
@@ -4452,9 +4452,9 @@ var require_compose_collection = __commonJS({
|
|
|
4452
4452
|
}
|
|
4453
4453
|
});
|
|
4454
4454
|
|
|
4455
|
-
// node_modules
|
|
4455
|
+
// node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4456
4456
|
var require_resolve_block_scalar = __commonJS({
|
|
4457
|
-
"node_modules
|
|
4457
|
+
"node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports) {
|
|
4458
4458
|
"use strict";
|
|
4459
4459
|
var Scalar = require_Scalar();
|
|
4460
4460
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -4635,9 +4635,9 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4635
4635
|
}
|
|
4636
4636
|
});
|
|
4637
4637
|
|
|
4638
|
-
// node_modules
|
|
4638
|
+
// node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4639
4639
|
var require_resolve_flow_scalar = __commonJS({
|
|
4640
|
-
"node_modules
|
|
4640
|
+
"node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports) {
|
|
4641
4641
|
"use strict";
|
|
4642
4642
|
var Scalar = require_Scalar();
|
|
4643
4643
|
var resolveEnd = require_resolve_end();
|
|
@@ -4855,9 +4855,9 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
4855
4855
|
}
|
|
4856
4856
|
});
|
|
4857
4857
|
|
|
4858
|
-
// node_modules
|
|
4858
|
+
// node_modules/yaml/dist/compose/compose-scalar.js
|
|
4859
4859
|
var require_compose_scalar = __commonJS({
|
|
4860
|
-
"node_modules
|
|
4860
|
+
"node_modules/yaml/dist/compose/compose-scalar.js"(exports) {
|
|
4861
4861
|
"use strict";
|
|
4862
4862
|
var identity = require_identity();
|
|
4863
4863
|
var Scalar = require_Scalar();
|
|
@@ -4936,9 +4936,9 @@ var require_compose_scalar = __commonJS({
|
|
|
4936
4936
|
}
|
|
4937
4937
|
});
|
|
4938
4938
|
|
|
4939
|
-
// node_modules
|
|
4939
|
+
// node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
4940
4940
|
var require_util_empty_scalar_position = __commonJS({
|
|
4941
|
-
"node_modules
|
|
4941
|
+
"node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports) {
|
|
4942
4942
|
"use strict";
|
|
4943
4943
|
function emptyScalarPosition(offset, before, pos) {
|
|
4944
4944
|
if (before) {
|
|
@@ -4966,9 +4966,9 @@ var require_util_empty_scalar_position = __commonJS({
|
|
|
4966
4966
|
}
|
|
4967
4967
|
});
|
|
4968
4968
|
|
|
4969
|
-
// node_modules
|
|
4969
|
+
// node_modules/yaml/dist/compose/compose-node.js
|
|
4970
4970
|
var require_compose_node = __commonJS({
|
|
4971
|
-
"node_modules
|
|
4971
|
+
"node_modules/yaml/dist/compose/compose-node.js"(exports) {
|
|
4972
4972
|
"use strict";
|
|
4973
4973
|
var Alias = require_Alias();
|
|
4974
4974
|
var identity = require_identity();
|
|
@@ -5072,9 +5072,9 @@ var require_compose_node = __commonJS({
|
|
|
5072
5072
|
}
|
|
5073
5073
|
});
|
|
5074
5074
|
|
|
5075
|
-
// node_modules
|
|
5075
|
+
// node_modules/yaml/dist/compose/compose-doc.js
|
|
5076
5076
|
var require_compose_doc = __commonJS({
|
|
5077
|
-
"node_modules
|
|
5077
|
+
"node_modules/yaml/dist/compose/compose-doc.js"(exports) {
|
|
5078
5078
|
"use strict";
|
|
5079
5079
|
var Document2 = require_Document();
|
|
5080
5080
|
var composeNode = require_compose_node();
|
|
@@ -5115,9 +5115,9 @@ var require_compose_doc = __commonJS({
|
|
|
5115
5115
|
}
|
|
5116
5116
|
});
|
|
5117
5117
|
|
|
5118
|
-
// node_modules
|
|
5118
|
+
// node_modules/yaml/dist/compose/composer.js
|
|
5119
5119
|
var require_composer = __commonJS({
|
|
5120
|
-
"node_modules
|
|
5120
|
+
"node_modules/yaml/dist/compose/composer.js"(exports) {
|
|
5121
5121
|
"use strict";
|
|
5122
5122
|
var node_process = __require("process");
|
|
5123
5123
|
var directives = require_directives();
|
|
@@ -5323,9 +5323,9 @@ ${end.comment}` : end.comment;
|
|
|
5323
5323
|
}
|
|
5324
5324
|
});
|
|
5325
5325
|
|
|
5326
|
-
// node_modules
|
|
5326
|
+
// node_modules/yaml/dist/parse/cst-scalar.js
|
|
5327
5327
|
var require_cst_scalar = __commonJS({
|
|
5328
|
-
"node_modules
|
|
5328
|
+
"node_modules/yaml/dist/parse/cst-scalar.js"(exports) {
|
|
5329
5329
|
"use strict";
|
|
5330
5330
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
5331
5331
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -5508,9 +5508,9 @@ var require_cst_scalar = __commonJS({
|
|
|
5508
5508
|
}
|
|
5509
5509
|
});
|
|
5510
5510
|
|
|
5511
|
-
// node_modules
|
|
5511
|
+
// node_modules/yaml/dist/parse/cst-stringify.js
|
|
5512
5512
|
var require_cst_stringify = __commonJS({
|
|
5513
|
-
"node_modules
|
|
5513
|
+
"node_modules/yaml/dist/parse/cst-stringify.js"(exports) {
|
|
5514
5514
|
"use strict";
|
|
5515
5515
|
var stringify3 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
5516
5516
|
function stringifyToken(token) {
|
|
@@ -5569,9 +5569,9 @@ var require_cst_stringify = __commonJS({
|
|
|
5569
5569
|
}
|
|
5570
5570
|
});
|
|
5571
5571
|
|
|
5572
|
-
// node_modules
|
|
5572
|
+
// node_modules/yaml/dist/parse/cst-visit.js
|
|
5573
5573
|
var require_cst_visit = __commonJS({
|
|
5574
|
-
"node_modules
|
|
5574
|
+
"node_modules/yaml/dist/parse/cst-visit.js"(exports) {
|
|
5575
5575
|
"use strict";
|
|
5576
5576
|
var BREAK = /* @__PURE__ */ Symbol("break visit");
|
|
5577
5577
|
var SKIP = /* @__PURE__ */ Symbol("skip children");
|
|
@@ -5584,9 +5584,9 @@ var require_cst_visit = __commonJS({
|
|
|
5584
5584
|
visit.BREAK = BREAK;
|
|
5585
5585
|
visit.SKIP = SKIP;
|
|
5586
5586
|
visit.REMOVE = REMOVE;
|
|
5587
|
-
visit.itemAtPath = (cst,
|
|
5587
|
+
visit.itemAtPath = (cst, path19) => {
|
|
5588
5588
|
let item = cst;
|
|
5589
|
-
for (const [field2, index] of
|
|
5589
|
+
for (const [field2, index] of path19) {
|
|
5590
5590
|
const tok = item?.[field2];
|
|
5591
5591
|
if (tok && "items" in tok) {
|
|
5592
5592
|
item = tok.items[index];
|
|
@@ -5595,23 +5595,23 @@ var require_cst_visit = __commonJS({
|
|
|
5595
5595
|
}
|
|
5596
5596
|
return item;
|
|
5597
5597
|
};
|
|
5598
|
-
visit.parentCollection = (cst,
|
|
5599
|
-
const parent = visit.itemAtPath(cst,
|
|
5600
|
-
const field2 =
|
|
5598
|
+
visit.parentCollection = (cst, path19) => {
|
|
5599
|
+
const parent = visit.itemAtPath(cst, path19.slice(0, -1));
|
|
5600
|
+
const field2 = path19[path19.length - 1][0];
|
|
5601
5601
|
const coll = parent?.[field2];
|
|
5602
5602
|
if (coll && "items" in coll)
|
|
5603
5603
|
return coll;
|
|
5604
5604
|
throw new Error("Parent collection not found");
|
|
5605
5605
|
};
|
|
5606
|
-
function _visit(
|
|
5607
|
-
let ctrl = visitor(item,
|
|
5606
|
+
function _visit(path19, item, visitor) {
|
|
5607
|
+
let ctrl = visitor(item, path19);
|
|
5608
5608
|
if (typeof ctrl === "symbol")
|
|
5609
5609
|
return ctrl;
|
|
5610
5610
|
for (const field2 of ["key", "value"]) {
|
|
5611
5611
|
const token = item[field2];
|
|
5612
5612
|
if (token && "items" in token) {
|
|
5613
5613
|
for (let i = 0; i < token.items.length; ++i) {
|
|
5614
|
-
const ci = _visit(Object.freeze(
|
|
5614
|
+
const ci = _visit(Object.freeze(path19.concat([[field2, i]])), token.items[i], visitor);
|
|
5615
5615
|
if (typeof ci === "number")
|
|
5616
5616
|
i = ci - 1;
|
|
5617
5617
|
else if (ci === BREAK)
|
|
@@ -5622,18 +5622,18 @@ var require_cst_visit = __commonJS({
|
|
|
5622
5622
|
}
|
|
5623
5623
|
}
|
|
5624
5624
|
if (typeof ctrl === "function" && field2 === "key")
|
|
5625
|
-
ctrl = ctrl(item,
|
|
5625
|
+
ctrl = ctrl(item, path19);
|
|
5626
5626
|
}
|
|
5627
5627
|
}
|
|
5628
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
5628
|
+
return typeof ctrl === "function" ? ctrl(item, path19) : ctrl;
|
|
5629
5629
|
}
|
|
5630
5630
|
exports.visit = visit;
|
|
5631
5631
|
}
|
|
5632
5632
|
});
|
|
5633
5633
|
|
|
5634
|
-
// node_modules
|
|
5634
|
+
// node_modules/yaml/dist/parse/cst.js
|
|
5635
5635
|
var require_cst = __commonJS({
|
|
5636
|
-
"node_modules
|
|
5636
|
+
"node_modules/yaml/dist/parse/cst.js"(exports) {
|
|
5637
5637
|
"use strict";
|
|
5638
5638
|
var cstScalar = require_cst_scalar();
|
|
5639
5639
|
var cstStringify = require_cst_stringify();
|
|
@@ -5733,9 +5733,9 @@ var require_cst = __commonJS({
|
|
|
5733
5733
|
}
|
|
5734
5734
|
});
|
|
5735
5735
|
|
|
5736
|
-
// node_modules
|
|
5736
|
+
// node_modules/yaml/dist/parse/lexer.js
|
|
5737
5737
|
var require_lexer = __commonJS({
|
|
5738
|
-
"node_modules
|
|
5738
|
+
"node_modules/yaml/dist/parse/lexer.js"(exports) {
|
|
5739
5739
|
"use strict";
|
|
5740
5740
|
var cst = require_cst();
|
|
5741
5741
|
function isEmpty(ch) {
|
|
@@ -6322,9 +6322,9 @@ var require_lexer = __commonJS({
|
|
|
6322
6322
|
}
|
|
6323
6323
|
});
|
|
6324
6324
|
|
|
6325
|
-
// node_modules
|
|
6325
|
+
// node_modules/yaml/dist/parse/line-counter.js
|
|
6326
6326
|
var require_line_counter = __commonJS({
|
|
6327
|
-
"node_modules
|
|
6327
|
+
"node_modules/yaml/dist/parse/line-counter.js"(exports) {
|
|
6328
6328
|
"use strict";
|
|
6329
6329
|
var LineCounter = class {
|
|
6330
6330
|
constructor() {
|
|
@@ -6353,9 +6353,9 @@ var require_line_counter = __commonJS({
|
|
|
6353
6353
|
}
|
|
6354
6354
|
});
|
|
6355
6355
|
|
|
6356
|
-
// node_modules
|
|
6356
|
+
// node_modules/yaml/dist/parse/parser.js
|
|
6357
6357
|
var require_parser = __commonJS({
|
|
6358
|
-
"node_modules
|
|
6358
|
+
"node_modules/yaml/dist/parse/parser.js"(exports) {
|
|
6359
6359
|
"use strict";
|
|
6360
6360
|
var node_process = __require("process");
|
|
6361
6361
|
var cst = require_cst();
|
|
@@ -6927,14 +6927,14 @@ var require_parser = __commonJS({
|
|
|
6927
6927
|
case "scalar":
|
|
6928
6928
|
case "single-quoted-scalar":
|
|
6929
6929
|
case "double-quoted-scalar": {
|
|
6930
|
-
const
|
|
6930
|
+
const fs14 = this.flowScalar(this.type);
|
|
6931
6931
|
if (atNextItem || it.value) {
|
|
6932
|
-
map.items.push({ start, key:
|
|
6932
|
+
map.items.push({ start, key: fs14, sep: [] });
|
|
6933
6933
|
this.onKeyLine = true;
|
|
6934
6934
|
} else if (it.sep) {
|
|
6935
|
-
this.stack.push(
|
|
6935
|
+
this.stack.push(fs14);
|
|
6936
6936
|
} else {
|
|
6937
|
-
Object.assign(it, { key:
|
|
6937
|
+
Object.assign(it, { key: fs14, sep: [] });
|
|
6938
6938
|
this.onKeyLine = true;
|
|
6939
6939
|
}
|
|
6940
6940
|
return;
|
|
@@ -7062,13 +7062,13 @@ var require_parser = __commonJS({
|
|
|
7062
7062
|
case "scalar":
|
|
7063
7063
|
case "single-quoted-scalar":
|
|
7064
7064
|
case "double-quoted-scalar": {
|
|
7065
|
-
const
|
|
7065
|
+
const fs14 = this.flowScalar(this.type);
|
|
7066
7066
|
if (!it || it.value)
|
|
7067
|
-
fc.items.push({ start: [], key:
|
|
7067
|
+
fc.items.push({ start: [], key: fs14, sep: [] });
|
|
7068
7068
|
else if (it.sep)
|
|
7069
|
-
this.stack.push(
|
|
7069
|
+
this.stack.push(fs14);
|
|
7070
7070
|
else
|
|
7071
|
-
Object.assign(it, { key:
|
|
7071
|
+
Object.assign(it, { key: fs14, sep: [] });
|
|
7072
7072
|
return;
|
|
7073
7073
|
}
|
|
7074
7074
|
case "flow-map-end":
|
|
@@ -7227,9 +7227,9 @@ var require_parser = __commonJS({
|
|
|
7227
7227
|
}
|
|
7228
7228
|
});
|
|
7229
7229
|
|
|
7230
|
-
// node_modules
|
|
7230
|
+
// node_modules/yaml/dist/public-api.js
|
|
7231
7231
|
var require_public_api = __commonJS({
|
|
7232
|
-
"node_modules
|
|
7232
|
+
"node_modules/yaml/dist/public-api.js"(exports) {
|
|
7233
7233
|
"use strict";
|
|
7234
7234
|
var composer = require_composer();
|
|
7235
7235
|
var Document2 = require_Document();
|
|
@@ -7324,9 +7324,9 @@ var require_public_api = __commonJS({
|
|
|
7324
7324
|
}
|
|
7325
7325
|
});
|
|
7326
7326
|
|
|
7327
|
-
// node_modules
|
|
7327
|
+
// node_modules/yaml/dist/index.js
|
|
7328
7328
|
var require_dist = __commonJS({
|
|
7329
|
-
"node_modules
|
|
7329
|
+
"node_modules/yaml/dist/index.js"(exports) {
|
|
7330
7330
|
"use strict";
|
|
7331
7331
|
var composer = require_composer();
|
|
7332
7332
|
var Document2 = require_Document();
|
|
@@ -7398,7 +7398,7 @@ function normalizeWorkflowArtifactRoot(value) {
|
|
|
7398
7398
|
const segments = projectRelativeSegments(value, "native.artifact_root");
|
|
7399
7399
|
return segments.length === 0 ? "." : segments.join("/");
|
|
7400
7400
|
}
|
|
7401
|
-
function normalizeClassicArtifactLayout(value, fallback = "
|
|
7401
|
+
function normalizeClassicArtifactLayout(value, fallback = "docs") {
|
|
7402
7402
|
const resolved = value ?? fallback;
|
|
7403
7403
|
if (resolved !== "legacy" && resolved !== "docs") {
|
|
7404
7404
|
throw new Error("classic.artifact_layout must be legacy or docs");
|
|
@@ -8475,8 +8475,8 @@ var init_state = __esm({
|
|
|
8475
8475
|
});
|
|
8476
8476
|
|
|
8477
8477
|
// domains/comet-entry/hook-router-entry.ts
|
|
8478
|
-
import
|
|
8479
|
-
import { promises as
|
|
8478
|
+
import path18 from "path";
|
|
8479
|
+
import { promises as fs13 } from "fs";
|
|
8480
8480
|
|
|
8481
8481
|
// domains/comet-native/native-paths.ts
|
|
8482
8482
|
init_project_config();
|
|
@@ -8939,12 +8939,12 @@ function addTarget(targets, value) {
|
|
|
8939
8939
|
function collectTargets(input, args) {
|
|
8940
8940
|
const targets = [];
|
|
8941
8941
|
const records = [args, input].filter(isRecord);
|
|
8942
|
-
for (const
|
|
8943
|
-
for (const key of SINGULAR_PATH_KEYS) addTarget(targets,
|
|
8944
|
-
for (const key of PLURAL_PATH_KEYS) addTarget(targets,
|
|
8945
|
-
for (const key of NESTED_TARGET_KEYS) addTarget(targets,
|
|
8942
|
+
for (const record3 of records) {
|
|
8943
|
+
for (const key of SINGULAR_PATH_KEYS) addTarget(targets, record3[key]);
|
|
8944
|
+
for (const key of PLURAL_PATH_KEYS) addTarget(targets, record3[key]);
|
|
8945
|
+
for (const key of NESTED_TARGET_KEYS) addTarget(targets, record3[key]);
|
|
8946
8946
|
for (const key of PATCH_KEYS) {
|
|
8947
|
-
const value =
|
|
8947
|
+
const value = record3[key];
|
|
8948
8948
|
if (typeof value === "string") targets.push(...patchTargets(value));
|
|
8949
8949
|
}
|
|
8950
8950
|
}
|
|
@@ -9147,9 +9147,9 @@ async function resolveBranchBinding(changeDir, options) {
|
|
|
9147
9147
|
if (document.errors.length > 0) {
|
|
9148
9148
|
throw new Error(`Invalid .comet.yaml: ${document.errors[0].message}`);
|
|
9149
9149
|
}
|
|
9150
|
-
const
|
|
9151
|
-
const isolation = typeof
|
|
9152
|
-
const boundBranch = typeof
|
|
9150
|
+
const record3 = document.toJS() ?? {};
|
|
9151
|
+
const isolation = typeof record3.isolation === "string" ? record3.isolation : null;
|
|
9152
|
+
const boundBranch = typeof record3.bound_branch === "string" && record3.bound_branch !== "" ? record3.bound_branch : null;
|
|
9153
9153
|
const bindingRequired = requiresBranchBinding(isolation);
|
|
9154
9154
|
const currentBranch = liveGitBranch(options.cwd);
|
|
9155
9155
|
const gitWorkTree = bindingRequired && boundBranch === null && currentBranch === null ? isGitWorkTree(options.cwd) : true;
|
|
@@ -10232,14 +10232,13 @@ async function inspectClassicHookGuard(projectRoot, changeName, request) {
|
|
|
10232
10232
|
}
|
|
10233
10233
|
|
|
10234
10234
|
// domains/comet-native/native-hook-guard.ts
|
|
10235
|
-
import { promises as
|
|
10236
|
-
import
|
|
10235
|
+
import { promises as fs12 } from "fs";
|
|
10236
|
+
import path17 from "path";
|
|
10237
10237
|
|
|
10238
10238
|
// domains/comet-native/native-change.ts
|
|
10239
10239
|
var import_yaml4 = __toESM(require_dist(), 1);
|
|
10240
|
-
import {
|
|
10241
|
-
import
|
|
10242
|
-
import path18 from "path";
|
|
10240
|
+
import { promises as fs11 } from "fs";
|
|
10241
|
+
import path16 from "path";
|
|
10243
10242
|
|
|
10244
10243
|
// domains/comet-native/native-bounded-file.ts
|
|
10245
10244
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -10451,528 +10450,6 @@ async function readNativeBoundedTextFile(options) {
|
|
|
10451
10450
|
}
|
|
10452
10451
|
}
|
|
10453
10452
|
|
|
10454
|
-
// domains/comet-native/native-canonical-hash.ts
|
|
10455
|
-
import { createHash as createHash3 } from "crypto";
|
|
10456
|
-
function invalidCanonicalJson(detail) {
|
|
10457
|
-
throw new TypeError(`Value is not valid canonical JSON: ${detail}`);
|
|
10458
|
-
}
|
|
10459
|
-
function canonicalArray(value, ancestors) {
|
|
10460
|
-
if (ancestors.has(value)) invalidCanonicalJson("cyclic structures are not supported");
|
|
10461
|
-
ancestors.add(value);
|
|
10462
|
-
try {
|
|
10463
|
-
const enumerableKeys = Object.keys(value);
|
|
10464
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
10465
|
-
if (!Object.prototype.hasOwnProperty.call(value, index)) {
|
|
10466
|
-
invalidCanonicalJson("sparse arrays are not supported");
|
|
10467
|
-
}
|
|
10468
|
-
}
|
|
10469
|
-
if (enumerableKeys.length !== value.length || enumerableKeys.some((key, index) => key !== String(index))) {
|
|
10470
|
-
invalidCanonicalJson("arrays must not have named enumerable properties");
|
|
10471
|
-
}
|
|
10472
|
-
if (Object.getOwnPropertySymbols(value).length > 0) {
|
|
10473
|
-
invalidCanonicalJson("symbol properties are not supported");
|
|
10474
|
-
}
|
|
10475
|
-
return `[${value.map((entry) => canonicalValue(entry, ancestors)).join(",")}]`;
|
|
10476
|
-
} finally {
|
|
10477
|
-
ancestors.delete(value);
|
|
10478
|
-
}
|
|
10479
|
-
}
|
|
10480
|
-
function canonicalObject(value, ancestors) {
|
|
10481
|
-
const prototype = Object.getPrototypeOf(value);
|
|
10482
|
-
if (prototype !== Object.prototype && prototype !== null) {
|
|
10483
|
-
invalidCanonicalJson("only plain objects are supported");
|
|
10484
|
-
}
|
|
10485
|
-
if (ancestors.has(value)) invalidCanonicalJson("cyclic structures are not supported");
|
|
10486
|
-
if (Object.getOwnPropertySymbols(value).length > 0) {
|
|
10487
|
-
invalidCanonicalJson("symbol properties are not supported");
|
|
10488
|
-
}
|
|
10489
|
-
ancestors.add(value);
|
|
10490
|
-
try {
|
|
10491
|
-
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
10492
|
-
const keys = Object.keys(value).sort();
|
|
10493
|
-
const fields = keys.map((key) => {
|
|
10494
|
-
const descriptor = descriptors[key];
|
|
10495
|
-
if (!descriptor || !("value" in descriptor)) {
|
|
10496
|
-
invalidCanonicalJson("accessor properties are not supported");
|
|
10497
|
-
}
|
|
10498
|
-
return `${JSON.stringify(key)}:${canonicalValue(descriptor.value, ancestors)}`;
|
|
10499
|
-
});
|
|
10500
|
-
return `{${fields.join(",")}}`;
|
|
10501
|
-
} finally {
|
|
10502
|
-
ancestors.delete(value);
|
|
10503
|
-
}
|
|
10504
|
-
}
|
|
10505
|
-
function canonicalValue(value, ancestors) {
|
|
10506
|
-
if (value === null) return "null";
|
|
10507
|
-
switch (typeof value) {
|
|
10508
|
-
case "boolean":
|
|
10509
|
-
return value ? "true" : "false";
|
|
10510
|
-
case "string":
|
|
10511
|
-
return JSON.stringify(value);
|
|
10512
|
-
case "number":
|
|
10513
|
-
if (!Number.isFinite(value)) invalidCanonicalJson("numbers must be finite");
|
|
10514
|
-
return JSON.stringify(Object.is(value, -0) ? 0 : value);
|
|
10515
|
-
case "object":
|
|
10516
|
-
return Array.isArray(value) ? canonicalArray(value, ancestors) : canonicalObject(value, ancestors);
|
|
10517
|
-
case "bigint":
|
|
10518
|
-
case "function":
|
|
10519
|
-
case "symbol":
|
|
10520
|
-
case "undefined":
|
|
10521
|
-
return invalidCanonicalJson(`${typeof value} values are not supported`);
|
|
10522
|
-
}
|
|
10523
|
-
return invalidCanonicalJson("unsupported value type");
|
|
10524
|
-
}
|
|
10525
|
-
function canonicalJson(value) {
|
|
10526
|
-
return canonicalValue(value, /* @__PURE__ */ new Set());
|
|
10527
|
-
}
|
|
10528
|
-
function canonicalHash(tag, value) {
|
|
10529
|
-
if (tag.length === 0) throw new TypeError("Canonical hash tag must be non-empty");
|
|
10530
|
-
if (/[\r\n]/u.test(tag)) {
|
|
10531
|
-
throw new TypeError("Canonical hash tag must not contain a line break");
|
|
10532
|
-
}
|
|
10533
|
-
return createHash3("sha256").update(`${tag}
|
|
10534
|
-
${canonicalJson(value)}`).digest("hex");
|
|
10535
|
-
}
|
|
10536
|
-
|
|
10537
|
-
// domains/comet-native/native-controller-trust.ts
|
|
10538
|
-
init_race_safe_read();
|
|
10539
|
-
import { promises as fs11 } from "node:fs";
|
|
10540
|
-
import os2 from "node:os";
|
|
10541
|
-
import path15 from "node:path";
|
|
10542
|
-
|
|
10543
|
-
// platform/fs/trusted-readonly-file.ts
|
|
10544
|
-
import { constants as fsConstants2, promises as fs10 } from "node:fs";
|
|
10545
|
-
import path14 from "node:path";
|
|
10546
|
-
function trustedReadonlyPosixFactsIssue(facts) {
|
|
10547
|
-
if (facts.fileUid === facts.currentUid) {
|
|
10548
|
-
return "Trusted file must be owned by a different host identity";
|
|
10549
|
-
}
|
|
10550
|
-
if ((facts.fileMode & 18) !== 0 || facts.fileWritable) {
|
|
10551
|
-
return "Trusted file is writable by the current process";
|
|
10552
|
-
}
|
|
10553
|
-
if (facts.parents.some(
|
|
10554
|
-
(parent) => parent.uid === facts.currentUid || (parent.mode & 18) !== 0 || parent.writable
|
|
10555
|
-
)) {
|
|
10556
|
-
return "Trusted file parent chain is writable by the current process";
|
|
10557
|
-
}
|
|
10558
|
-
return null;
|
|
10559
|
-
}
|
|
10560
|
-
var testHostIsolatedFiles = /* @__PURE__ */ new Set();
|
|
10561
|
-
function sameIdentity(left, right) {
|
|
10562
|
-
return left.realPath === right.realPath && left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeMs === right.mtimeMs;
|
|
10563
|
-
}
|
|
10564
|
-
async function currentProcessCanWrite(file) {
|
|
10565
|
-
try {
|
|
10566
|
-
await fs10.access(file, fsConstants2.W_OK);
|
|
10567
|
-
return true;
|
|
10568
|
-
} catch (error) {
|
|
10569
|
-
if (error.code === "EACCES" || error.code === "EPERM") {
|
|
10570
|
-
return false;
|
|
10571
|
-
}
|
|
10572
|
-
throw error;
|
|
10573
|
-
}
|
|
10574
|
-
}
|
|
10575
|
-
async function inspectIdentity(file) {
|
|
10576
|
-
const [stat, realPath] = await Promise.all([fs10.lstat(file), fs10.realpath(file)]);
|
|
10577
|
-
if (!stat.isFile() || stat.isSymbolicLink()) {
|
|
10578
|
-
throw new Error("Trusted file capability requires a regular non-symlink file");
|
|
10579
|
-
}
|
|
10580
|
-
return {
|
|
10581
|
-
realPath,
|
|
10582
|
-
dev: stat.dev,
|
|
10583
|
-
ino: stat.ino,
|
|
10584
|
-
size: stat.size,
|
|
10585
|
-
mtimeMs: stat.mtimeMs
|
|
10586
|
-
};
|
|
10587
|
-
}
|
|
10588
|
-
async function assertTrustedReadonlyFile(options) {
|
|
10589
|
-
const identity = await inspectIdentity(options.file);
|
|
10590
|
-
if (options.previous && !sameIdentity(options.previous, identity)) {
|
|
10591
|
-
throw new Error("Trusted file identity changed while reading");
|
|
10592
|
-
}
|
|
10593
|
-
if (process.env.NODE_ENV === "test" && testHostIsolatedFiles.has(path14.resolve(options.file))) {
|
|
10594
|
-
return identity;
|
|
10595
|
-
}
|
|
10596
|
-
if (process.platform === "win32") {
|
|
10597
|
-
throw new Error(
|
|
10598
|
-
"Trusted file isolation cannot be proven from Windows file mode; use a host read-only mount capability"
|
|
10599
|
-
);
|
|
10600
|
-
}
|
|
10601
|
-
const currentUid = process.geteuid?.() ?? process.getuid?.();
|
|
10602
|
-
if (currentUid === void 0) {
|
|
10603
|
-
throw new Error("Trusted file owner isolation is unavailable on this platform");
|
|
10604
|
-
}
|
|
10605
|
-
const fileStat = await fs10.stat(identity.realPath);
|
|
10606
|
-
const parents = [];
|
|
10607
|
-
let directory = path14.dirname(identity.realPath);
|
|
10608
|
-
for (; ; ) {
|
|
10609
|
-
const stat = await fs10.lstat(directory);
|
|
10610
|
-
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
10611
|
-
throw new Error("Trusted file parent chain is not a physical directory chain");
|
|
10612
|
-
}
|
|
10613
|
-
parents.push({
|
|
10614
|
-
uid: stat.uid,
|
|
10615
|
-
mode: stat.mode,
|
|
10616
|
-
writable: await currentProcessCanWrite(directory)
|
|
10617
|
-
});
|
|
10618
|
-
const parent = path14.dirname(directory);
|
|
10619
|
-
if (parent === directory) break;
|
|
10620
|
-
directory = parent;
|
|
10621
|
-
}
|
|
10622
|
-
const issue = trustedReadonlyPosixFactsIssue({
|
|
10623
|
-
currentUid,
|
|
10624
|
-
fileUid: fileStat.uid,
|
|
10625
|
-
fileMode: fileStat.mode,
|
|
10626
|
-
fileWritable: await currentProcessCanWrite(identity.realPath),
|
|
10627
|
-
parents
|
|
10628
|
-
});
|
|
10629
|
-
if (issue) throw new Error(issue);
|
|
10630
|
-
return identity;
|
|
10631
|
-
}
|
|
10632
|
-
|
|
10633
|
-
// domains/comet-native/native-review-identity.ts
|
|
10634
|
-
import {
|
|
10635
|
-
createHash as createHash4,
|
|
10636
|
-
createPrivateKey,
|
|
10637
|
-
createPublicKey,
|
|
10638
|
-
generateKeyPairSync,
|
|
10639
|
-
sign as cryptoSign,
|
|
10640
|
-
verify as cryptoVerify
|
|
10641
|
-
} from "node:crypto";
|
|
10642
|
-
var NATIVE_REVIEW_IDENTITY_SCHEMA = "comet.native.review-identity.v1";
|
|
10643
|
-
var NATIVE_REVIEW_SIGNATURE_SCHEMA = "comet.native.review-signature.v1";
|
|
10644
|
-
var ALGORITHM = "ed25519";
|
|
10645
|
-
var HASH_PATTERN = /^[a-f0-9]{64}$/u;
|
|
10646
|
-
var MAX_PUBLIC_KEY_TEXT = 512;
|
|
10647
|
-
var MAX_SIGNATURE_TEXT = 256;
|
|
10648
|
-
var SIGNATURE_CONTEXT = Buffer.from("comet.native.review-payload.v1\0", "utf8");
|
|
10649
|
-
function record(value, label) {
|
|
10650
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
10651
|
-
throw new Error(`${label} must be an object`);
|
|
10652
|
-
}
|
|
10653
|
-
return value;
|
|
10654
|
-
}
|
|
10655
|
-
function exactKeys(value, expected, label) {
|
|
10656
|
-
const actual = Object.keys(value).sort();
|
|
10657
|
-
const canonical = [...expected].sort();
|
|
10658
|
-
if (JSON.stringify(actual) !== JSON.stringify(canonical)) {
|
|
10659
|
-
throw new Error(`${label} fields are invalid`);
|
|
10660
|
-
}
|
|
10661
|
-
}
|
|
10662
|
-
function sha2562(value) {
|
|
10663
|
-
return createHash4("sha256").update(value).digest("hex");
|
|
10664
|
-
}
|
|
10665
|
-
function payloadHash(value, label = "Native review payloadHash") {
|
|
10666
|
-
if (typeof value !== "string" || !HASH_PATTERN.test(value)) {
|
|
10667
|
-
throw new Error(`${label} must be a lowercase SHA-256 hash`);
|
|
10668
|
-
}
|
|
10669
|
-
return value;
|
|
10670
|
-
}
|
|
10671
|
-
function canonicalBase64(value, label, maxCharacters, expectedBytes) {
|
|
10672
|
-
if (typeof value !== "string" || value.length === 0 || value.length > maxCharacters || value.length % 4 !== 0) {
|
|
10673
|
-
throw new Error(`${label} is invalid`);
|
|
10674
|
-
}
|
|
10675
|
-
const bytes = Buffer.from(value, "base64");
|
|
10676
|
-
if (bytes.length === 0 || bytes.toString("base64") !== value || expectedBytes !== void 0 && bytes.length !== expectedBytes) {
|
|
10677
|
-
throw new Error(`${label} must use canonical base64`);
|
|
10678
|
-
}
|
|
10679
|
-
return bytes;
|
|
10680
|
-
}
|
|
10681
|
-
function publicKeyMaterial(value) {
|
|
10682
|
-
const supplied = canonicalBase64(value, "Native review public key", MAX_PUBLIC_KEY_TEXT);
|
|
10683
|
-
let key;
|
|
10684
|
-
try {
|
|
10685
|
-
key = createPublicKey({ key: supplied, format: "der", type: "spki" });
|
|
10686
|
-
} catch (error) {
|
|
10687
|
-
throw new Error("Native review public key is invalid", { cause: error });
|
|
10688
|
-
}
|
|
10689
|
-
if (key.type !== "public" || key.asymmetricKeyType !== "ed25519") {
|
|
10690
|
-
throw new Error("Native review public key must be Ed25519");
|
|
10691
|
-
}
|
|
10692
|
-
const der = key.export({ format: "der", type: "spki" });
|
|
10693
|
-
if (!Buffer.isBuffer(der) || !supplied.equals(der)) {
|
|
10694
|
-
throw new Error("Native review public key must use canonical SPKI DER");
|
|
10695
|
-
}
|
|
10696
|
-
return { key, der, text: der.toString("base64") };
|
|
10697
|
-
}
|
|
10698
|
-
function signaturePayload(hash) {
|
|
10699
|
-
return Buffer.concat([SIGNATURE_CONTEXT, Buffer.from(hash, "hex")]);
|
|
10700
|
-
}
|
|
10701
|
-
function parseNativeReviewSignature(value) {
|
|
10702
|
-
const root = record(value, "Native review signature");
|
|
10703
|
-
exactKeys(
|
|
10704
|
-
root,
|
|
10705
|
-
["schema", "algorithm", "keyId", "payloadHash", "signature"],
|
|
10706
|
-
"Native review signature"
|
|
10707
|
-
);
|
|
10708
|
-
if (root.schema !== NATIVE_REVIEW_SIGNATURE_SCHEMA || root.algorithm !== ALGORITHM || typeof root.keyId !== "string" || !HASH_PATTERN.test(root.keyId)) {
|
|
10709
|
-
throw new Error("Native review signature identity is invalid");
|
|
10710
|
-
}
|
|
10711
|
-
const hash = payloadHash(root.payloadHash);
|
|
10712
|
-
const signature = canonicalBase64(
|
|
10713
|
-
root.signature,
|
|
10714
|
-
"Native review signature",
|
|
10715
|
-
MAX_SIGNATURE_TEXT,
|
|
10716
|
-
64
|
|
10717
|
-
).toString("base64");
|
|
10718
|
-
return {
|
|
10719
|
-
schema: NATIVE_REVIEW_SIGNATURE_SCHEMA,
|
|
10720
|
-
algorithm: ALGORITHM,
|
|
10721
|
-
keyId: root.keyId,
|
|
10722
|
-
payloadHash: hash,
|
|
10723
|
-
signature
|
|
10724
|
-
};
|
|
10725
|
-
}
|
|
10726
|
-
function parseNativeReviewIdentity(value) {
|
|
10727
|
-
const root = record(value, "Native review identity");
|
|
10728
|
-
exactKeys(root, ["schema", "algorithm", "keyId", "publicKey"], "Native review identity");
|
|
10729
|
-
if (root.schema !== NATIVE_REVIEW_IDENTITY_SCHEMA || root.algorithm !== ALGORITHM || typeof root.keyId !== "string" || !HASH_PATTERN.test(root.keyId)) {
|
|
10730
|
-
throw new Error("Native review identity keyId is invalid");
|
|
10731
|
-
}
|
|
10732
|
-
const publicKey = publicKeyMaterial(root.publicKey);
|
|
10733
|
-
const keyId = sha2562(publicKey.der);
|
|
10734
|
-
if (root.keyId !== keyId) {
|
|
10735
|
-
throw new Error("Native review identity keyId does not match its public key");
|
|
10736
|
-
}
|
|
10737
|
-
return {
|
|
10738
|
-
schema: NATIVE_REVIEW_IDENTITY_SCHEMA,
|
|
10739
|
-
algorithm: ALGORITHM,
|
|
10740
|
-
keyId,
|
|
10741
|
-
publicKey: publicKey.text
|
|
10742
|
-
};
|
|
10743
|
-
}
|
|
10744
|
-
function verifyNativeReviewPayloadHash(options) {
|
|
10745
|
-
const identity = parseNativeReviewIdentity(options.identity);
|
|
10746
|
-
const hash = payloadHash(options.payloadHash);
|
|
10747
|
-
const proof = parseNativeReviewSignature(options.proof);
|
|
10748
|
-
if (proof.payloadHash !== hash) {
|
|
10749
|
-
throw new Error("Native review signature payloadHash does not match the expected payloadHash");
|
|
10750
|
-
}
|
|
10751
|
-
if (proof.keyId !== identity.keyId) {
|
|
10752
|
-
throw new Error("Native review signature keyId does not match the public identity");
|
|
10753
|
-
}
|
|
10754
|
-
const signature = canonicalBase64(
|
|
10755
|
-
proof.signature,
|
|
10756
|
-
"Native review signature",
|
|
10757
|
-
MAX_SIGNATURE_TEXT,
|
|
10758
|
-
64
|
|
10759
|
-
);
|
|
10760
|
-
const publicKey = publicKeyMaterial(identity.publicKey);
|
|
10761
|
-
if (!cryptoVerify(null, signaturePayload(hash), publicKey.key, signature)) {
|
|
10762
|
-
throw new Error("Native review signature is invalid");
|
|
10763
|
-
}
|
|
10764
|
-
return proof;
|
|
10765
|
-
}
|
|
10766
|
-
|
|
10767
|
-
// domains/comet-native/native-controller-trust.ts
|
|
10768
|
-
var NATIVE_CONTROLLER_TRUST_STORE_SCHEMA = "comet.native.controller-trust-store.v1";
|
|
10769
|
-
var NATIVE_CONTROLLER_TRUST_STORE_TEST_ENV = "COMET_NATIVE_CONTROLLER_TRUST_STORE_TEST_PATH";
|
|
10770
|
-
var PROJECT_ROOT_HASH_TAG = "comet.native.controller-project-root.v1";
|
|
10771
|
-
var MAX_STORE_BYTES = 256 * 1024;
|
|
10772
|
-
var HASH_PATTERN2 = /^[a-f0-9]{64}$/u;
|
|
10773
|
-
var CHANGE_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
10774
|
-
function record2(value, label) {
|
|
10775
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
10776
|
-
throw new Error(`${label} must be an object`);
|
|
10777
|
-
}
|
|
10778
|
-
return value;
|
|
10779
|
-
}
|
|
10780
|
-
function exactKeys2(value, keys, label) {
|
|
10781
|
-
const actual = Object.keys(value).sort();
|
|
10782
|
-
const expected = [...keys].sort();
|
|
10783
|
-
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
|
|
10784
|
-
throw new Error(`${label} fields are invalid`);
|
|
10785
|
-
}
|
|
10786
|
-
}
|
|
10787
|
-
function isInside4(parent, target) {
|
|
10788
|
-
const relative = path15.relative(parent, target);
|
|
10789
|
-
return relative === "" || !path15.isAbsolute(relative) && relative !== ".." && !relative.startsWith(`..${path15.sep}`);
|
|
10790
|
-
}
|
|
10791
|
-
function normalizedPhysicalRoot(root) {
|
|
10792
|
-
const normalized2 = path15.normalize(root).replaceAll("\\", "/");
|
|
10793
|
-
return process.platform === "win32" ? normalized2.toLowerCase() : normalized2;
|
|
10794
|
-
}
|
|
10795
|
-
async function nativeControllerProjectRootHash(projectRoot) {
|
|
10796
|
-
return canonicalHash(
|
|
10797
|
-
PROJECT_ROOT_HASH_TAG,
|
|
10798
|
-
normalizedPhysicalRoot(await fs11.realpath(projectRoot))
|
|
10799
|
-
);
|
|
10800
|
-
}
|
|
10801
|
-
function parseNativeControllerTrustStore(value) {
|
|
10802
|
-
const root = record2(value, "Native controller trust store");
|
|
10803
|
-
exactKeys2(root, ["schema", "projects"], "Native controller trust store");
|
|
10804
|
-
if (root.schema !== NATIVE_CONTROLLER_TRUST_STORE_SCHEMA || !Array.isArray(root.projects) || root.projects.length === 0 || root.projects.length > 1024) {
|
|
10805
|
-
throw new Error("Native controller trust store is invalid");
|
|
10806
|
-
}
|
|
10807
|
-
const projects = root.projects.map((value2, index) => {
|
|
10808
|
-
const project = record2(value2, `Native controller trust project ${index}`);
|
|
10809
|
-
exactKeys2(
|
|
10810
|
-
project,
|
|
10811
|
-
["projectRootHash", "controllerIdentity", "legacyChanges"],
|
|
10812
|
-
`Native controller trust project ${index}`
|
|
10813
|
-
);
|
|
10814
|
-
if (typeof project.projectRootHash !== "string" || !HASH_PATTERN2.test(project.projectRootHash) || !Array.isArray(project.legacyChanges)) {
|
|
10815
|
-
throw new Error(`Native controller trust project ${index} is invalid`);
|
|
10816
|
-
}
|
|
10817
|
-
const legacyChanges = project.legacyChanges.map((change) => {
|
|
10818
|
-
if (typeof change !== "string" || !CHANGE_NAME_PATTERN.test(change)) {
|
|
10819
|
-
throw new Error(`Native controller trust project ${index} legacy change is invalid`);
|
|
10820
|
-
}
|
|
10821
|
-
return change;
|
|
10822
|
-
});
|
|
10823
|
-
if (JSON.stringify(legacyChanges) !== JSON.stringify(
|
|
10824
|
-
[...new Set(legacyChanges)].sort((left, right) => left.localeCompare(right, "en"))
|
|
10825
|
-
)) {
|
|
10826
|
-
throw new Error(`Native controller trust project ${index} legacy changes must be sorted`);
|
|
10827
|
-
}
|
|
10828
|
-
return {
|
|
10829
|
-
projectRootHash: project.projectRootHash,
|
|
10830
|
-
controllerIdentity: parseNativeReviewIdentity(project.controllerIdentity),
|
|
10831
|
-
legacyChanges
|
|
10832
|
-
};
|
|
10833
|
-
});
|
|
10834
|
-
if (JSON.stringify(projects.map((project) => project.projectRootHash)) !== JSON.stringify(
|
|
10835
|
-
[...new Set(projects.map((project) => project.projectRootHash))].sort(
|
|
10836
|
-
(left, right) => left.localeCompare(right, "en")
|
|
10837
|
-
)
|
|
10838
|
-
)) {
|
|
10839
|
-
throw new Error("Native controller trust projects must be sorted and unique");
|
|
10840
|
-
}
|
|
10841
|
-
return { schema: NATIVE_CONTROLLER_TRUST_STORE_SCHEMA, projects };
|
|
10842
|
-
}
|
|
10843
|
-
function nativeControllerTrustStorePath() {
|
|
10844
|
-
const testPath = process.env.NODE_ENV === "test" ? process.env[NATIVE_CONTROLLER_TRUST_STORE_TEST_ENV] : void 0;
|
|
10845
|
-
return path15.resolve(
|
|
10846
|
-
testPath ?? path15.join(os2.homedir(), ".comet", "native-controller-trust.json")
|
|
10847
|
-
);
|
|
10848
|
-
}
|
|
10849
|
-
async function readNativeControllerTrustProject(projectRoot) {
|
|
10850
|
-
const storePath = nativeControllerTrustStorePath();
|
|
10851
|
-
let physicalProjectRoot;
|
|
10852
|
-
try {
|
|
10853
|
-
physicalProjectRoot = await fs11.realpath(projectRoot);
|
|
10854
|
-
} catch (error) {
|
|
10855
|
-
throw new Error("Native project root is unavailable for controller trust", { cause: error });
|
|
10856
|
-
}
|
|
10857
|
-
let trustedIdentity;
|
|
10858
|
-
try {
|
|
10859
|
-
trustedIdentity = await assertTrustedReadonlyFile({ file: storePath });
|
|
10860
|
-
} catch (error) {
|
|
10861
|
-
if (error.code === "ENOENT") return null;
|
|
10862
|
-
throw new Error("Native controller trust store is not host-isolated read-only", {
|
|
10863
|
-
cause: error
|
|
10864
|
-
});
|
|
10865
|
-
}
|
|
10866
|
-
let result2;
|
|
10867
|
-
try {
|
|
10868
|
-
result2 = await readFileRaceSafe(storePath, MAX_STORE_BYTES, {
|
|
10869
|
-
label: "Native controller trust store",
|
|
10870
|
-
verify: (_checkpoint, context) => {
|
|
10871
|
-
if (isInside4(physicalProjectRoot, context.realPath)) {
|
|
10872
|
-
throw new Error("Native controller trust store must resolve outside the project");
|
|
10873
|
-
}
|
|
10874
|
-
}
|
|
10875
|
-
});
|
|
10876
|
-
} catch (error) {
|
|
10877
|
-
if (error.code === "ENOENT") return null;
|
|
10878
|
-
throw error;
|
|
10879
|
-
}
|
|
10880
|
-
try {
|
|
10881
|
-
await assertTrustedReadonlyFile({
|
|
10882
|
-
file: storePath,
|
|
10883
|
-
previous: trustedIdentity
|
|
10884
|
-
});
|
|
10885
|
-
} catch (error) {
|
|
10886
|
-
throw new Error("Native controller trust store isolation changed while reading", {
|
|
10887
|
-
cause: error
|
|
10888
|
-
});
|
|
10889
|
-
}
|
|
10890
|
-
let parsed;
|
|
10891
|
-
try {
|
|
10892
|
-
parsed = parseNativeControllerTrustStore(JSON.parse(result2.bytes.toString("utf8")));
|
|
10893
|
-
} catch (error) {
|
|
10894
|
-
throw new Error("Native controller trust store is not valid canonical JSON", {
|
|
10895
|
-
cause: error
|
|
10896
|
-
});
|
|
10897
|
-
}
|
|
10898
|
-
const projectRootHash = await nativeControllerProjectRootHash(projectRoot);
|
|
10899
|
-
return parsed.projects.find((project) => project.projectRootHash === projectRootHash) ?? null;
|
|
10900
|
-
}
|
|
10901
|
-
|
|
10902
|
-
// domains/comet-native/native-creation-authorization.ts
|
|
10903
|
-
var NATIVE_CREATION_AUTHORIZATION_SCHEMA = "comet.native.creation-authorization.v1";
|
|
10904
|
-
var HASH_PATTERN3 = /^[a-f0-9]{64}$/u;
|
|
10905
|
-
var CHANGE_NAME_PATTERN2 = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
10906
|
-
function record3(value, label) {
|
|
10907
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
10908
|
-
throw new Error(`${label} must be an object`);
|
|
10909
|
-
}
|
|
10910
|
-
return value;
|
|
10911
|
-
}
|
|
10912
|
-
function exactKeys3(value, expected, label) {
|
|
10913
|
-
const actual = Object.keys(value).sort();
|
|
10914
|
-
const canonical = [...expected].sort();
|
|
10915
|
-
if (JSON.stringify(actual) !== JSON.stringify(canonical)) {
|
|
10916
|
-
throw new Error(`${label} fields are invalid`);
|
|
10917
|
-
}
|
|
10918
|
-
}
|
|
10919
|
-
function parseNativeCreationAuthorization(value) {
|
|
10920
|
-
const root = record3(value, "Native creation authorization");
|
|
10921
|
-
exactKeys3(
|
|
10922
|
-
root,
|
|
10923
|
-
[
|
|
10924
|
-
"schema",
|
|
10925
|
-
"controllerKeyId",
|
|
10926
|
-
"projectRootHash",
|
|
10927
|
-
"policyHash",
|
|
10928
|
-
"protocol",
|
|
10929
|
-
"change",
|
|
10930
|
-
"issuedAt",
|
|
10931
|
-
"authorizationHash",
|
|
10932
|
-
"controllerSignature"
|
|
10933
|
-
],
|
|
10934
|
-
"Native creation authorization"
|
|
10935
|
-
);
|
|
10936
|
-
if (root.schema !== NATIVE_CREATION_AUTHORIZATION_SCHEMA || typeof root.controllerKeyId !== "string" || !HASH_PATTERN3.test(root.controllerKeyId) || typeof root.projectRootHash !== "string" || !HASH_PATTERN3.test(root.projectRootHash) || typeof root.policyHash !== "string" || !HASH_PATTERN3.test(root.policyHash) || root.protocol !== "signed-v2" || typeof root.change !== "string" || !CHANGE_NAME_PATTERN2.test(root.change) || typeof root.issuedAt !== "string" || Number.isNaN(Date.parse(root.issuedAt)) || typeof root.authorizationHash !== "string" || !HASH_PATTERN3.test(root.authorizationHash)) {
|
|
10937
|
-
throw new Error("Native creation authorization is invalid");
|
|
10938
|
-
}
|
|
10939
|
-
const content = {
|
|
10940
|
-
schema: NATIVE_CREATION_AUTHORIZATION_SCHEMA,
|
|
10941
|
-
controllerKeyId: root.controllerKeyId,
|
|
10942
|
-
projectRootHash: root.projectRootHash,
|
|
10943
|
-
policyHash: root.policyHash,
|
|
10944
|
-
protocol: "signed-v2",
|
|
10945
|
-
change: root.change,
|
|
10946
|
-
issuedAt: root.issuedAt
|
|
10947
|
-
};
|
|
10948
|
-
const authorizationHash = canonicalHash(NATIVE_CREATION_AUTHORIZATION_SCHEMA, content);
|
|
10949
|
-
if (authorizationHash !== root.authorizationHash) {
|
|
10950
|
-
throw new Error("Native creation authorization hash mismatch");
|
|
10951
|
-
}
|
|
10952
|
-
const controllerSignature = parseNativeReviewSignature(root.controllerSignature);
|
|
10953
|
-
if (controllerSignature.keyId !== root.controllerKeyId || controllerSignature.payloadHash !== authorizationHash) {
|
|
10954
|
-
throw new Error("Native creation authorization signature binding is invalid");
|
|
10955
|
-
}
|
|
10956
|
-
return { ...content, authorizationHash, controllerSignature };
|
|
10957
|
-
}
|
|
10958
|
-
async function verifyNativeCreationAuthorization(options) {
|
|
10959
|
-
const controllerTrust = await readNativeControllerTrustProject(options.paths.projectRoot);
|
|
10960
|
-
if (!controllerTrust) {
|
|
10961
|
-
throw new Error("Native project has no controller-owned trust root");
|
|
10962
|
-
}
|
|
10963
|
-
const authorization = parseNativeCreationAuthorization(options.authorization);
|
|
10964
|
-
const projectRootHash = await nativeControllerProjectRootHash(options.paths.projectRoot);
|
|
10965
|
-
if (authorization.controllerKeyId !== controllerTrust.controllerIdentity.keyId || authorization.projectRootHash !== projectRootHash || authorization.policyHash !== options.policyHash || authorization.change !== options.change) {
|
|
10966
|
-
throw new Error("Native creation authorization does not match the trusted project/change");
|
|
10967
|
-
}
|
|
10968
|
-
verifyNativeReviewPayloadHash({
|
|
10969
|
-
identity: controllerTrust.controllerIdentity,
|
|
10970
|
-
payloadHash: authorization.authorizationHash,
|
|
10971
|
-
proof: authorization.controllerSignature
|
|
10972
|
-
});
|
|
10973
|
-
return authorization;
|
|
10974
|
-
}
|
|
10975
|
-
|
|
10976
10453
|
// domains/comet-native/native-config.ts
|
|
10977
10454
|
init_project_config();
|
|
10978
10455
|
init_project_config_reader();
|
|
@@ -10994,13 +10471,13 @@ var nativeLockCoordinator = new AsyncLocalStorage();
|
|
|
10994
10471
|
import { TextDecoder as TextDecoder4 } from "util";
|
|
10995
10472
|
|
|
10996
10473
|
// domains/comet-native/native-protected-file.ts
|
|
10997
|
-
import { createHash as
|
|
10998
|
-
import { constants as
|
|
10999
|
-
import
|
|
10474
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
10475
|
+
import { constants as fsConstants2, promises as fs10 } from "node:fs";
|
|
10476
|
+
import path14 from "node:path";
|
|
11000
10477
|
import { TextDecoder as TextDecoder3 } from "node:util";
|
|
11001
|
-
function
|
|
11002
|
-
const relative =
|
|
11003
|
-
return relative === "" || !
|
|
10478
|
+
function isInside4(parent, target) {
|
|
10479
|
+
const relative = path14.relative(parent, target);
|
|
10480
|
+
return relative === "" || !path14.isAbsolute(relative) && relative !== ".." && !relative.startsWith(`..${path14.sep}`);
|
|
11004
10481
|
}
|
|
11005
10482
|
function positiveLimit2(value) {
|
|
11006
10483
|
if (!Number.isSafeInteger(value) || value < 1) {
|
|
@@ -11037,31 +10514,31 @@ function sameFileIdentity3(expected, actual) {
|
|
|
11037
10514
|
) && expected.birthtimeMs === actual.birthtimeMs && expected.ctimeMs === actual.ctimeMs && expected.mtimeMs === actual.mtimeMs && expected.size === actual.size;
|
|
11038
10515
|
}
|
|
11039
10516
|
async function captureDirectoryIdentity2(directory, label) {
|
|
11040
|
-
const stat = await
|
|
10517
|
+
const stat = await fs10.lstat(directory);
|
|
11041
10518
|
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
11042
10519
|
throw new Error(`${label} parent must be a real directory: ${directory}`);
|
|
11043
10520
|
}
|
|
11044
10521
|
return {
|
|
11045
10522
|
path: directory,
|
|
11046
|
-
realPath: await
|
|
10523
|
+
realPath: await fs10.realpath(directory),
|
|
11047
10524
|
dev: stat.dev,
|
|
11048
10525
|
ino: stat.ino,
|
|
11049
10526
|
birthtimeMs: stat.birthtimeMs
|
|
11050
10527
|
};
|
|
11051
10528
|
}
|
|
11052
10529
|
async function captureDirectoryChain2(root, directory, label) {
|
|
11053
|
-
const lexicalRoot =
|
|
11054
|
-
const lexicalDirectory =
|
|
11055
|
-
if (!
|
|
10530
|
+
const lexicalRoot = path14.resolve(root);
|
|
10531
|
+
const lexicalDirectory = path14.resolve(directory);
|
|
10532
|
+
if (!isInside4(lexicalRoot, lexicalDirectory)) {
|
|
11056
10533
|
throw new Error(`${label} is outside its managed root`);
|
|
11057
10534
|
}
|
|
11058
10535
|
const chain = [await captureDirectoryIdentity2(lexicalRoot, label)];
|
|
11059
10536
|
let cursor = lexicalRoot;
|
|
11060
|
-
for (const segment of
|
|
10537
|
+
for (const segment of path14.relative(lexicalRoot, lexicalDirectory).split(path14.sep).filter(Boolean)) {
|
|
11061
10538
|
await verifyDirectoryChain3(chain, label);
|
|
11062
|
-
cursor =
|
|
10539
|
+
cursor = path14.join(cursor, segment);
|
|
11063
10540
|
const identity = await captureDirectoryIdentity2(cursor, label);
|
|
11064
|
-
if (!
|
|
10541
|
+
if (!isInside4(chain[0].realPath, identity.realPath)) {
|
|
11065
10542
|
throw new Error(`${label} parent resolves outside its managed root: ${cursor}`);
|
|
11066
10543
|
}
|
|
11067
10544
|
chain.push(identity);
|
|
@@ -11071,8 +10548,8 @@ async function captureDirectoryChain2(root, directory, label) {
|
|
|
11071
10548
|
}
|
|
11072
10549
|
async function verifyDirectoryChain3(chain, label) {
|
|
11073
10550
|
for (const identity of chain) {
|
|
11074
|
-
const stat = await
|
|
11075
|
-
if (!stat.isDirectory() || stat.isSymbolicLink() || !sameDirectoryIdentity3(identity, stat) || await
|
|
10551
|
+
const stat = await fs10.lstat(identity.path);
|
|
10552
|
+
if (!stat.isDirectory() || stat.isSymbolicLink() || !sameDirectoryIdentity3(identity, stat) || await fs10.realpath(identity.path) !== identity.realPath) {
|
|
11076
10553
|
throw new Error(`${label} parent changed during I/O: ${identity.path}`);
|
|
11077
10554
|
}
|
|
11078
10555
|
}
|
|
@@ -11093,36 +10570,36 @@ async function readHandleBounded(handle, maxBytes, label) {
|
|
|
11093
10570
|
}
|
|
11094
10571
|
async function readNativeProtectedFile(options) {
|
|
11095
10572
|
const maxBytes = positiveLimit2(options.maxBytes);
|
|
11096
|
-
const file =
|
|
11097
|
-
const chain = await captureDirectoryChain2(options.root,
|
|
10573
|
+
const file = path14.resolve(options.file);
|
|
10574
|
+
const chain = await captureDirectoryChain2(options.root, path14.dirname(file), options.label);
|
|
11098
10575
|
const forbidden = await Promise.all(
|
|
11099
10576
|
(options.forbiddenRoots ?? []).map(
|
|
11100
|
-
(root) => captureDirectoryIdentity2(
|
|
10577
|
+
(root) => captureDirectoryIdentity2(path14.resolve(root), options.label)
|
|
11101
10578
|
)
|
|
11102
10579
|
);
|
|
11103
10580
|
await options.hooks?.afterParentChainCaptured?.();
|
|
11104
10581
|
await verifyDirectoryChain3(chain, options.label);
|
|
11105
|
-
const before = await
|
|
10582
|
+
const before = await fs10.lstat(file);
|
|
11106
10583
|
if (!before.isFile() || before.isSymbolicLink()) {
|
|
11107
10584
|
throw new Error(`${options.label} must be a regular file`);
|
|
11108
10585
|
}
|
|
11109
10586
|
if (before.size > maxBytes) throw new Error(`${options.label} exceeds ${maxBytes} bytes`);
|
|
11110
10587
|
const beforeIdentity = asFileIdentity(before);
|
|
11111
|
-
const beforeRealPath = await
|
|
11112
|
-
if (!
|
|
10588
|
+
const beforeRealPath = await fs10.realpath(file);
|
|
10589
|
+
if (!isInside4(chain[0].realPath, beforeRealPath)) {
|
|
11113
10590
|
throw new Error(`${options.label} resolves outside its managed root`);
|
|
11114
10591
|
}
|
|
11115
|
-
if (forbidden.some((identity) =>
|
|
10592
|
+
if (forbidden.some((identity) => isInside4(identity.realPath, beforeRealPath))) {
|
|
11116
10593
|
throw new Error(`${options.label} resolves inside an excluded root`);
|
|
11117
10594
|
}
|
|
11118
|
-
const flags = process.platform === "win32" ?
|
|
11119
|
-
const handle = await
|
|
10595
|
+
const flags = process.platform === "win32" ? fsConstants2.O_RDONLY : fsConstants2.O_RDONLY | fsConstants2.O_NOFOLLOW | fsConstants2.O_NONBLOCK;
|
|
10596
|
+
const handle = await fs10.open(file, flags);
|
|
11120
10597
|
try {
|
|
11121
10598
|
const opened = await handle.stat();
|
|
11122
10599
|
await options.hooks?.afterOpen?.();
|
|
11123
10600
|
const [pathAfterOpen, realPathAfterOpen] = await Promise.all([
|
|
11124
|
-
|
|
11125
|
-
|
|
10601
|
+
fs10.lstat(file),
|
|
10602
|
+
fs10.realpath(file)
|
|
11126
10603
|
]);
|
|
11127
10604
|
await verifyDirectoryChain3(chain, options.label);
|
|
11128
10605
|
await verifyDirectoryChain3(forbidden, options.label);
|
|
@@ -11134,8 +10611,8 @@ async function readNativeProtectedFile(options) {
|
|
|
11134
10611
|
await options.hooks?.beforeFinalCheck?.();
|
|
11135
10612
|
const [afterHandle, afterPath, afterRealPath] = await Promise.all([
|
|
11136
10613
|
handle.stat(),
|
|
11137
|
-
|
|
11138
|
-
|
|
10614
|
+
fs10.lstat(file),
|
|
10615
|
+
fs10.realpath(file)
|
|
11139
10616
|
]);
|
|
11140
10617
|
await verifyDirectoryChain3(chain, options.label);
|
|
11141
10618
|
await verifyDirectoryChain3(forbidden, options.label);
|
|
@@ -11144,7 +10621,7 @@ async function readNativeProtectedFile(options) {
|
|
|
11144
10621
|
}
|
|
11145
10622
|
return {
|
|
11146
10623
|
bytes,
|
|
11147
|
-
hash:
|
|
10624
|
+
hash: createHash3("sha256").update(bytes).digest("hex"),
|
|
11148
10625
|
size: bytes.length
|
|
11149
10626
|
};
|
|
11150
10627
|
} finally {
|
|
@@ -11169,104 +10646,13 @@ var NATIVE_TRANSACTION_EVENT_MAX_BYTES = 16 * 1024;
|
|
|
11169
10646
|
var NATIVE_LEGACY_TRANSACTION_FILE_MAX_BYTES = 64 * 1024 * 1024;
|
|
11170
10647
|
var UTF8_DECODER = new TextDecoder4("utf-8", { fatal: true });
|
|
11171
10648
|
|
|
11172
|
-
// domains/comet-native/native-review-trust.ts
|
|
11173
|
-
var NATIVE_REVIEW_TRUST_POLICY_SCHEMA = "comet.native.review-trust-policy.v2";
|
|
11174
|
-
var POLICY_HASH_TAG = NATIVE_REVIEW_TRUST_POLICY_SCHEMA;
|
|
11175
|
-
var MAX_POLICY_BYTES = 64 * 1024;
|
|
11176
|
-
var HASH_PATTERN4 = /^[a-f0-9]{64}$/u;
|
|
11177
|
-
function record4(value, label) {
|
|
11178
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
11179
|
-
throw new Error(`${label} must be an object`);
|
|
11180
|
-
}
|
|
11181
|
-
return value;
|
|
11182
|
-
}
|
|
11183
|
-
function exactKeys4(value, expected, label) {
|
|
11184
|
-
const actual = Object.keys(value).sort();
|
|
11185
|
-
const canonical = [...expected].sort();
|
|
11186
|
-
if (JSON.stringify(actual) !== JSON.stringify(canonical)) {
|
|
11187
|
-
throw new Error(`${label} fields are invalid`);
|
|
11188
|
-
}
|
|
11189
|
-
}
|
|
11190
|
-
function identities(value, label) {
|
|
11191
|
-
if (!Array.isArray(value) || value.length === 0 || value.length > 64) {
|
|
11192
|
-
throw new Error(`${label} must be a bounded non-empty array`);
|
|
11193
|
-
}
|
|
11194
|
-
const parsed = value.map(parseNativeReviewIdentity).sort((left, right) => left.keyId.localeCompare(right.keyId, "en"));
|
|
11195
|
-
if (new Set(parsed.map((identity) => identity.keyId)).size !== parsed.length || JSON.stringify(value) !== JSON.stringify(parsed)) {
|
|
11196
|
-
throw new Error(`${label} must be sorted and unique`);
|
|
11197
|
-
}
|
|
11198
|
-
return parsed;
|
|
11199
|
-
}
|
|
11200
|
-
function parseNativeReviewTrustPolicy(value) {
|
|
11201
|
-
const root = record4(value, "Native review trust policy");
|
|
11202
|
-
exactKeys4(
|
|
11203
|
-
root,
|
|
11204
|
-
[
|
|
11205
|
-
"schema",
|
|
11206
|
-
"controllerKeyId",
|
|
11207
|
-
"implementationKeyId",
|
|
11208
|
-
"trustedReviewers",
|
|
11209
|
-
"trustedWaiverSigners",
|
|
11210
|
-
"policyHash",
|
|
11211
|
-
"controllerSignature"
|
|
11212
|
-
],
|
|
11213
|
-
"Native review trust policy"
|
|
11214
|
-
);
|
|
11215
|
-
if (root.schema !== NATIVE_REVIEW_TRUST_POLICY_SCHEMA || typeof root.controllerKeyId !== "string" || !HASH_PATTERN4.test(root.controllerKeyId) || typeof root.implementationKeyId !== "string" || !HASH_PATTERN4.test(root.implementationKeyId) || typeof root.policyHash !== "string" || !HASH_PATTERN4.test(root.policyHash)) {
|
|
11216
|
-
throw new Error("Native review trust policy identity or hash is invalid");
|
|
11217
|
-
}
|
|
11218
|
-
const trustedReviewers = identities(root.trustedReviewers, "Native trusted reviewers");
|
|
11219
|
-
const trustedWaiverSigners = identities(
|
|
11220
|
-
root.trustedWaiverSigners,
|
|
11221
|
-
"Native trusted waiver signers"
|
|
11222
|
-
);
|
|
11223
|
-
if (trustedReviewers.some((identity) => identity.keyId === root.implementationKeyId) || trustedWaiverSigners.some((identity) => identity.keyId === root.implementationKeyId) || (/* @__PURE__ */ new Set([
|
|
11224
|
-
root.controllerKeyId,
|
|
11225
|
-
root.implementationKeyId,
|
|
11226
|
-
...trustedReviewers.map((identity) => identity.keyId),
|
|
11227
|
-
...trustedWaiverSigners.map((identity) => identity.keyId)
|
|
11228
|
-
])).size !== 2 + trustedReviewers.length + trustedWaiverSigners.length) {
|
|
11229
|
-
throw new Error(
|
|
11230
|
-
"Native controller, implementation, reviewer, and waiver signer identities must be globally distinct"
|
|
11231
|
-
);
|
|
11232
|
-
}
|
|
11233
|
-
const content = {
|
|
11234
|
-
schema: NATIVE_REVIEW_TRUST_POLICY_SCHEMA,
|
|
11235
|
-
controllerKeyId: root.controllerKeyId,
|
|
11236
|
-
implementationKeyId: root.implementationKeyId,
|
|
11237
|
-
trustedReviewers,
|
|
11238
|
-
trustedWaiverSigners
|
|
11239
|
-
};
|
|
11240
|
-
const policyHash = canonicalHash(POLICY_HASH_TAG, content);
|
|
11241
|
-
if (policyHash !== root.policyHash) {
|
|
11242
|
-
throw new Error("Native review trust policy hash mismatch");
|
|
11243
|
-
}
|
|
11244
|
-
const controllerSignature = parseNativeReviewSignature(root.controllerSignature);
|
|
11245
|
-
if (controllerSignature.keyId !== root.controllerKeyId || controllerSignature.payloadHash !== policyHash) {
|
|
11246
|
-
throw new Error("Native review trust policy controller signature binding is invalid");
|
|
11247
|
-
}
|
|
11248
|
-
return { ...content, policyHash, controllerSignature };
|
|
11249
|
-
}
|
|
11250
|
-
function verifyNativeReviewTrustPolicy(value, controllerIdentity) {
|
|
11251
|
-
const policy = parseNativeReviewTrustPolicy(value);
|
|
11252
|
-
if (policy.controllerKeyId !== controllerIdentity.keyId) {
|
|
11253
|
-
throw new Error("Native review trust policy controller is not host-trusted");
|
|
11254
|
-
}
|
|
11255
|
-
verifyNativeReviewPayloadHash({
|
|
11256
|
-
identity: controllerIdentity,
|
|
11257
|
-
payloadHash: policy.policyHash,
|
|
11258
|
-
proof: policy.controllerSignature
|
|
11259
|
-
});
|
|
11260
|
-
return policy;
|
|
11261
|
-
}
|
|
11262
|
-
|
|
11263
10649
|
// domains/comet-native/native-snapshot.ts
|
|
11264
|
-
import
|
|
10650
|
+
import path15 from "path";
|
|
11265
10651
|
|
|
11266
10652
|
// domains/comet-native/native-hash.ts
|
|
11267
|
-
import { createHash as
|
|
10653
|
+
import { createHash as createHash4 } from "crypto";
|
|
11268
10654
|
function sha256Text(content) {
|
|
11269
|
-
return
|
|
10655
|
+
return createHash4("sha256").update(content).digest("hex");
|
|
11270
10656
|
}
|
|
11271
10657
|
|
|
11272
10658
|
// domains/comet-native/native-snapshot.ts
|
|
@@ -11278,11 +10664,10 @@ var DEFAULT_NATIVE_SNAPSHOT_LIMITS = {
|
|
|
11278
10664
|
};
|
|
11279
10665
|
var MAX_RECORDED_OMISSIONS = 1e3;
|
|
11280
10666
|
var NATIVE_SNAPSHOT_MANIFEST_HARD_MAX_BYTES = 8 * 1024 * 1024;
|
|
11281
|
-
var
|
|
10667
|
+
var CHANGE_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
11282
10668
|
var MANIFEST_KEYS = /* @__PURE__ */ new Set([
|
|
11283
10669
|
"schema",
|
|
11284
10670
|
"origin",
|
|
11285
|
-
"creation",
|
|
11286
10671
|
"capture",
|
|
11287
10672
|
"createdAt",
|
|
11288
10673
|
"complete",
|
|
@@ -11302,14 +10687,6 @@ var LIMIT_KEYS = /* @__PURE__ */ new Set([
|
|
|
11302
10687
|
]);
|
|
11303
10688
|
var POLICY_KEYS = /* @__PURE__ */ new Set(["schema", "include", "exclude", "hash"]);
|
|
11304
10689
|
var CAPTURE_KEYS = /* @__PURE__ */ new Set(["provider", "gitSelection", "physicalSelection", "projection"]);
|
|
11305
|
-
var CREATION_KEYS = /* @__PURE__ */ new Set([
|
|
11306
|
-
"schema",
|
|
11307
|
-
"protocol",
|
|
11308
|
-
"policyHash",
|
|
11309
|
-
"policySnapshotRef",
|
|
11310
|
-
"policySnapshotHash",
|
|
11311
|
-
"authorization"
|
|
11312
|
-
]);
|
|
11313
10690
|
var GIT_PROJECTION_KEYS = /* @__PURE__ */ new Set(["provider", "selection"]);
|
|
11314
10691
|
var GIT_SELECTION_KEYS = /* @__PURE__ */ new Set([
|
|
11315
10692
|
"schema",
|
|
@@ -11363,7 +10740,7 @@ var OMISSION_REASONS = /* @__PURE__ */ new Set([
|
|
|
11363
10740
|
"physical-enumeration-limit",
|
|
11364
10741
|
"physical-selection-changed"
|
|
11365
10742
|
]);
|
|
11366
|
-
var
|
|
10743
|
+
var HASH_PATTERN = /^[a-f0-9]{64}$/u;
|
|
11367
10744
|
var GIT_LIST_STDERR_LIMIT = 64 * 1024;
|
|
11368
10745
|
var GIT_TEXT_STDOUT_LIMIT = 64 * 1024;
|
|
11369
10746
|
var DEFAULT_NATIVE_GIT_SELECTION_LIMITS = {
|
|
@@ -11495,7 +10872,7 @@ function resolveSnapshotPolicy(value) {
|
|
|
11495
10872
|
excludeMatchers: exclude.map(compileNativeSnapshotPattern)
|
|
11496
10873
|
};
|
|
11497
10874
|
}
|
|
11498
|
-
function
|
|
10875
|
+
function record(value, label) {
|
|
11499
10876
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
11500
10877
|
throw new Error(`${label} must be an object`);
|
|
11501
10878
|
}
|
|
@@ -11521,17 +10898,17 @@ function snapshotPath(value, label) {
|
|
|
11521
10898
|
if (typeof value !== "string" || value.length === 0 || value.includes("\\") || value.includes("\0")) {
|
|
11522
10899
|
throw new Error(`${label} must be a normalized project-relative path`);
|
|
11523
10900
|
}
|
|
11524
|
-
const normalized2 =
|
|
11525
|
-
if (normalized2 !== value ||
|
|
10901
|
+
const normalized2 = path15.posix.normalize(value);
|
|
10902
|
+
if (normalized2 !== value || path15.posix.isAbsolute(value) || normalized2 === ".." || normalized2.startsWith("../")) {
|
|
11526
10903
|
throw new Error(`${label} must stay inside the project root`);
|
|
11527
10904
|
}
|
|
11528
10905
|
return value;
|
|
11529
10906
|
}
|
|
11530
10907
|
function parseEntry(value, index) {
|
|
11531
|
-
const entry =
|
|
10908
|
+
const entry = record(value, `Native snapshot entry ${index}`);
|
|
11532
10909
|
rejectUnknown(entry, ENTRY_KEYS, `Native snapshot entry ${index}`);
|
|
11533
10910
|
const entryPath = snapshotPath(entry.path, `Native snapshot entry ${index} path`);
|
|
11534
|
-
if (typeof entry.hash !== "string" || !
|
|
10911
|
+
if (typeof entry.hash !== "string" || !HASH_PATTERN.test(entry.hash)) {
|
|
11535
10912
|
throw new Error(`Native snapshot entry ${index} hash is invalid`);
|
|
11536
10913
|
}
|
|
11537
10914
|
if (entry.type !== "file") throw new Error(`Native snapshot entry ${index} type is invalid`);
|
|
@@ -11543,7 +10920,7 @@ function parseEntry(value, index) {
|
|
|
11543
10920
|
};
|
|
11544
10921
|
}
|
|
11545
10922
|
function parseOmission(value, index) {
|
|
11546
|
-
const omission =
|
|
10923
|
+
const omission = record(value, `Native snapshot omission ${index}`);
|
|
11547
10924
|
rejectUnknown(omission, OMISSION_KEYS, `Native snapshot omission ${index}`);
|
|
11548
10925
|
if (!OMISSION_TYPES.has(omission.type)) {
|
|
11549
10926
|
throw new Error(`Native snapshot omission ${index} type is invalid`);
|
|
@@ -11559,9 +10936,9 @@ function parseOmission(value, index) {
|
|
|
11559
10936
|
};
|
|
11560
10937
|
}
|
|
11561
10938
|
function parseOmissionOverflow(value) {
|
|
11562
|
-
const overflow =
|
|
10939
|
+
const overflow = record(value, "Native snapshot omission overflow");
|
|
11563
10940
|
rejectUnknown(overflow, OMISSION_OVERFLOW_KEYS, "Native snapshot omission overflow");
|
|
11564
|
-
if (typeof overflow.hash !== "string" || !
|
|
10941
|
+
if (typeof overflow.hash !== "string" || !HASH_PATTERN.test(overflow.hash)) {
|
|
11565
10942
|
throw new Error("Native snapshot omission overflow hash is invalid");
|
|
11566
10943
|
}
|
|
11567
10944
|
const expectedRef = `native-snapshot://omitted-overflow/${overflow.hash}`;
|
|
@@ -11575,9 +10952,9 @@ function parseOmissionOverflow(value) {
|
|
|
11575
10952
|
};
|
|
11576
10953
|
}
|
|
11577
10954
|
function parseGitSelectionStreamEvidence(value, label) {
|
|
11578
|
-
const stream =
|
|
10955
|
+
const stream = record(value, label);
|
|
11579
10956
|
rejectUnknown(stream, GIT_SELECTION_STREAM_KEYS, label);
|
|
11580
|
-
if (typeof stream.hash !== "string" || !
|
|
10957
|
+
if (typeof stream.hash !== "string" || !HASH_PATTERN.test(stream.hash)) {
|
|
11581
10958
|
throw new Error(`${label} hash is invalid`);
|
|
11582
10959
|
}
|
|
11583
10960
|
if (typeof stream.overflow !== "boolean") {
|
|
@@ -11601,7 +10978,7 @@ function parseGitSelectionStreamEvidence(value, label) {
|
|
|
11601
10978
|
};
|
|
11602
10979
|
}
|
|
11603
10980
|
function parseGitSelectionEvidence(value) {
|
|
11604
|
-
const selection =
|
|
10981
|
+
const selection = record(value, "Native Git selection evidence");
|
|
11605
10982
|
rejectUnknown(selection, GIT_SELECTION_KEYS, "Native Git selection evidence");
|
|
11606
10983
|
if (selection.schema !== "comet.native.git-selection.v1") {
|
|
11607
10984
|
throw new Error("Native Git selection evidence schema is invalid");
|
|
@@ -11661,9 +11038,9 @@ function parseGitSelectionEvidence(value) {
|
|
|
11661
11038
|
};
|
|
11662
11039
|
}
|
|
11663
11040
|
function parsePhysicalSelectionStreamEvidence(value, label) {
|
|
11664
|
-
const stream =
|
|
11041
|
+
const stream = record(value, label);
|
|
11665
11042
|
rejectUnknown(stream, PHYSICAL_SELECTION_STREAM_KEYS, label);
|
|
11666
|
-
if (typeof stream.hash !== "string" || !
|
|
11043
|
+
if (typeof stream.hash !== "string" || !HASH_PATTERN.test(stream.hash)) {
|
|
11667
11044
|
throw new Error(`${label} hash is invalid`);
|
|
11668
11045
|
}
|
|
11669
11046
|
if (typeof stream.overflow !== "boolean" || typeof stream.unstable !== "boolean") {
|
|
@@ -11690,7 +11067,7 @@ function parsePhysicalSelectionStreamEvidence(value, label) {
|
|
|
11690
11067
|
};
|
|
11691
11068
|
}
|
|
11692
11069
|
function parsePhysicalSelectionEvidence(value) {
|
|
11693
|
-
const selection =
|
|
11070
|
+
const selection = record(value, "Native physical selection evidence");
|
|
11694
11071
|
rejectUnknown(selection, PHYSICAL_SELECTION_KEYS, "Native physical selection evidence");
|
|
11695
11072
|
if (selection.schema !== "comet.native.physical-selection.v1") {
|
|
11696
11073
|
throw new Error("Native physical selection evidence schema is invalid");
|
|
@@ -11723,7 +11100,7 @@ function parsePhysicalSelectionEvidence(value) {
|
|
|
11723
11100
|
};
|
|
11724
11101
|
}
|
|
11725
11102
|
function parseNativeContentSnapshotManifest(value) {
|
|
11726
|
-
const manifest =
|
|
11103
|
+
const manifest = record(value, "Native content snapshot manifest");
|
|
11727
11104
|
rejectUnknown(manifest, MANIFEST_KEYS, "Native content snapshot manifest");
|
|
11728
11105
|
if (manifest.schema !== "comet.native.content-snapshot.v1") {
|
|
11729
11106
|
throw new Error("Unsupported Native content snapshot schema");
|
|
@@ -11731,28 +11108,9 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11731
11108
|
if (!SNAPSHOT_ORIGINS.has(manifest.origin)) {
|
|
11732
11109
|
throw new Error("Native content snapshot origin is invalid");
|
|
11733
11110
|
}
|
|
11734
|
-
let creation;
|
|
11735
|
-
if (manifest.creation !== void 0) {
|
|
11736
|
-
const value2 = record5(manifest.creation, "Native change creation binding");
|
|
11737
|
-
rejectUnknown(value2, CREATION_KEYS, "Native change creation binding");
|
|
11738
|
-
if (value2.schema !== "comet.native.change-creation-binding.v1" || value2.protocol !== "signed-v2" || typeof value2.policyHash !== "string" || !HASH_PATTERN5.test(value2.policyHash) || typeof value2.policySnapshotHash !== "string" || !HASH_PATTERN5.test(value2.policySnapshotHash) || typeof value2.policySnapshotRef !== "string" || !/^runtime\/trust\/review-policy-[a-f0-9]{64}\.json$/u.test(value2.policySnapshotRef)) {
|
|
11739
|
-
throw new Error("Native change creation binding is invalid");
|
|
11740
|
-
}
|
|
11741
|
-
creation = {
|
|
11742
|
-
schema: "comet.native.change-creation-binding.v1",
|
|
11743
|
-
protocol: "signed-v2",
|
|
11744
|
-
policyHash: value2.policyHash,
|
|
11745
|
-
policySnapshotRef: value2.policySnapshotRef,
|
|
11746
|
-
policySnapshotHash: value2.policySnapshotHash,
|
|
11747
|
-
authorization: parseNativeCreationAuthorization(value2.authorization)
|
|
11748
|
-
};
|
|
11749
|
-
}
|
|
11750
|
-
if (manifest.origin !== "change-created" && creation !== void 0) {
|
|
11751
|
-
throw new Error("Native change creation binding does not match snapshot origin");
|
|
11752
|
-
}
|
|
11753
11111
|
let capture;
|
|
11754
11112
|
if (manifest.capture !== void 0) {
|
|
11755
|
-
const captureValue =
|
|
11113
|
+
const captureValue = record(manifest.capture, "Native content snapshot capture");
|
|
11756
11114
|
rejectUnknown(captureValue, CAPTURE_KEYS, "Native content snapshot capture");
|
|
11757
11115
|
if (captureValue.provider !== "git" && captureValue.provider !== "physical-tree") {
|
|
11758
11116
|
throw new Error("Native content snapshot capture provider is invalid");
|
|
@@ -11761,7 +11119,7 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11761
11119
|
const physicalSelection2 = captureValue.physicalSelection === void 0 ? void 0 : parsePhysicalSelectionEvidence(captureValue.physicalSelection);
|
|
11762
11120
|
let projection = null;
|
|
11763
11121
|
if (captureValue.projection !== void 0) {
|
|
11764
|
-
const projectionValue =
|
|
11122
|
+
const projectionValue = record(captureValue.projection, "Native content snapshot projection");
|
|
11765
11123
|
rejectUnknown(projectionValue, GIT_PROJECTION_KEYS, "Native content snapshot projection");
|
|
11766
11124
|
if (projectionValue.provider !== "git") {
|
|
11767
11125
|
throw new Error("Native content snapshot projection provider is invalid");
|
|
@@ -11798,7 +11156,7 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11798
11156
|
if (typeof manifest.complete !== "boolean") {
|
|
11799
11157
|
throw new Error("Native content snapshot complete flag is invalid");
|
|
11800
11158
|
}
|
|
11801
|
-
const limitValue =
|
|
11159
|
+
const limitValue = record(manifest.limits, "Native content snapshot limits");
|
|
11802
11160
|
rejectUnknown(limitValue, LIMIT_KEYS, "Native content snapshot limits");
|
|
11803
11161
|
const limits = {
|
|
11804
11162
|
maxFiles: positiveInteger(limitValue.maxFiles, "Native snapshot maxFiles"),
|
|
@@ -11814,7 +11172,7 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11814
11172
|
};
|
|
11815
11173
|
let policy;
|
|
11816
11174
|
if (manifest.policy !== void 0) {
|
|
11817
|
-
const policyValue =
|
|
11175
|
+
const policyValue = record(manifest.policy, "Native snapshot policy");
|
|
11818
11176
|
rejectUnknown(policyValue, POLICY_KEYS, "Native snapshot policy");
|
|
11819
11177
|
if (policyValue.schema !== "comet.native.snapshot-policy.v1") {
|
|
11820
11178
|
throw new Error("Native snapshot policy schema is invalid");
|
|
@@ -11907,7 +11265,6 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11907
11265
|
const parsed = {
|
|
11908
11266
|
schema: "comet.native.content-snapshot.v1",
|
|
11909
11267
|
origin: manifest.origin,
|
|
11910
|
-
...creation ? { creation } : {},
|
|
11911
11268
|
...capture ? { capture } : {},
|
|
11912
11269
|
createdAt: manifest.createdAt,
|
|
11913
11270
|
complete: manifest.complete,
|
|
@@ -11924,10 +11281,10 @@ function parseNativeContentSnapshotManifest(value) {
|
|
|
11924
11281
|
return parsed;
|
|
11925
11282
|
}
|
|
11926
11283
|
function nativeBaselineManifestFile(paths, name) {
|
|
11927
|
-
if (!
|
|
11928
|
-
const changeDir =
|
|
11284
|
+
if (!CHANGE_NAME_PATTERN.test(name)) throw new Error(`Invalid Native change name: ${name}`);
|
|
11285
|
+
const changeDir = path15.join(paths.changesDir, name);
|
|
11929
11286
|
if (!isInsidePath(paths.changesDir, changeDir)) throw new Error("Native change path escaped");
|
|
11930
|
-
return
|
|
11287
|
+
return path15.join(changeDir, "runtime", "baseline-manifest.json");
|
|
11931
11288
|
}
|
|
11932
11289
|
async function readNativeBaselineManifest(paths, name) {
|
|
11933
11290
|
const file = nativeBaselineManifestFile(paths, name);
|
|
@@ -12000,7 +11357,7 @@ var PHASES2 = /* @__PURE__ */ new Set(["shape", "build", "verify", "archive"]);
|
|
|
12000
11357
|
var APPROVALS = /* @__PURE__ */ new Set(["implicit", "confirmed"]);
|
|
12001
11358
|
var VERIFY_RESULTS2 = /* @__PURE__ */ new Set(["pending", "pass", "fail"]);
|
|
12002
11359
|
var NATIVE_CHANGE_STATE_FILE = "comet-state.yaml";
|
|
12003
|
-
var
|
|
11360
|
+
var HASH_PATTERN2 = /^[a-f0-9]{64}$/u;
|
|
12004
11361
|
var NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
12005
11362
|
var CONTENT_ADDRESSED_REF_PATTERN = /^runtime\/evidence\/(scopes|allowances|verifications)\/([a-f0-9]{64})\.json$/u;
|
|
12006
11363
|
var NativeSchemaMigrationRequiredError = class extends Error {
|
|
@@ -12047,7 +11404,7 @@ var NATIVE_BRIEF_TEMPLATE = [
|
|
|
12047
11404
|
"# Verification expectations",
|
|
12048
11405
|
""
|
|
12049
11406
|
].join("\n");
|
|
12050
|
-
function
|
|
11407
|
+
function record2(value, label) {
|
|
12051
11408
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
12052
11409
|
throw new Error(`${label} must be a mapping`);
|
|
12053
11410
|
}
|
|
@@ -12064,12 +11421,12 @@ function assertCapabilityId(value) {
|
|
|
12064
11421
|
if (!NAME_PATTERN.test(value)) throw new Error(`Invalid Native capability id: ${value}`);
|
|
12065
11422
|
}
|
|
12066
11423
|
function assertRelativeRef(value, label) {
|
|
12067
|
-
if (value.length === 0 ||
|
|
11424
|
+
if (value.length === 0 || path16.isAbsolute(value) || /^(?:[A-Za-z]:|~|[\\/])/u.test(value) || value.split(/[\\/]/u).includes("..")) {
|
|
12068
11425
|
throw new Error(`${label} must stay inside the Native change`);
|
|
12069
11426
|
}
|
|
12070
11427
|
}
|
|
12071
11428
|
function parseSpecChange(value, index) {
|
|
12072
|
-
const item =
|
|
11429
|
+
const item = record2(value, `spec_changes[${index}]`);
|
|
12073
11430
|
rejectUnknown2(item, SPEC_CHANGE_KEYS, `spec_changes[${index}]`);
|
|
12074
11431
|
if (typeof item.capability !== "string") throw new Error("spec change capability is required");
|
|
12075
11432
|
assertCapabilityId(item.capability);
|
|
@@ -12088,12 +11445,12 @@ function parseSpecChange(value, index) {
|
|
|
12088
11445
|
throw new Error(`Create spec ${item.capability} requires null base_hash`);
|
|
12089
11446
|
} else if (item.operation === "replace") {
|
|
12090
11447
|
if (!source) throw new Error(`Replace spec ${item.capability} requires source`);
|
|
12091
|
-
if (typeof baseHash !== "string" || !
|
|
11448
|
+
if (typeof baseHash !== "string" || !HASH_PATTERN2.test(baseHash)) {
|
|
12092
11449
|
throw new Error(`Replace spec ${item.capability} requires a SHA-256 base_hash`);
|
|
12093
11450
|
}
|
|
12094
11451
|
} else {
|
|
12095
11452
|
if (source !== void 0) throw new Error(`Remove spec ${item.capability} forbids source`);
|
|
12096
|
-
if (typeof baseHash !== "string" || !
|
|
11453
|
+
if (typeof baseHash !== "string" || !HASH_PATTERN2.test(baseHash)) {
|
|
12097
11454
|
throw new Error(`Remove spec ${item.capability} requires a SHA-256 base_hash`);
|
|
12098
11455
|
}
|
|
12099
11456
|
}
|
|
@@ -12161,7 +11518,7 @@ function parseChangeFields(root, knownKeys) {
|
|
|
12161
11518
|
};
|
|
12162
11519
|
}
|
|
12163
11520
|
function parseLegacyNativeChangeValue(value) {
|
|
12164
|
-
const root =
|
|
11521
|
+
const root = record2(value, NATIVE_CHANGE_STATE_FILE);
|
|
12165
11522
|
if (root.schema !== NATIVE_LEGACY_CHANGE_SCHEMA) {
|
|
12166
11523
|
throw new Error(`Expected ${NATIVE_LEGACY_CHANGE_SCHEMA}`);
|
|
12167
11524
|
}
|
|
@@ -12188,20 +11545,20 @@ function contentAddressedRef(value, label, kind) {
|
|
|
12188
11545
|
}
|
|
12189
11546
|
function approvedContractHash(value) {
|
|
12190
11547
|
if (value === void 0 || value === null) return null;
|
|
12191
|
-
if (typeof value !== "string" || !
|
|
11548
|
+
if (typeof value !== "string" || !HASH_PATTERN2.test(value)) {
|
|
12192
11549
|
throw new Error("Native approved_contract_hash must be null or a SHA-256 hash");
|
|
12193
11550
|
}
|
|
12194
11551
|
return value;
|
|
12195
11552
|
}
|
|
12196
11553
|
function verificationProtocol(value) {
|
|
12197
11554
|
if (value === void 0) return "legacy-v1";
|
|
12198
|
-
if (value !== "legacy-v1"
|
|
12199
|
-
throw new Error("Native verification_protocol must be legacy-v1
|
|
11555
|
+
if (value !== "legacy-v1") {
|
|
11556
|
+
throw new Error("Native verification_protocol must be legacy-v1");
|
|
12200
11557
|
}
|
|
12201
11558
|
return value;
|
|
12202
11559
|
}
|
|
12203
11560
|
function parseV2NativeChangeValue(value) {
|
|
12204
|
-
const root =
|
|
11561
|
+
const root = record2(value, NATIVE_CHANGE_STATE_FILE);
|
|
12205
11562
|
if (root.schema !== NATIVE_V2_CHANGE_SCHEMA) {
|
|
12206
11563
|
throw new Error(`Expected ${NATIVE_V2_CHANGE_SCHEMA}`);
|
|
12207
11564
|
}
|
|
@@ -12220,7 +11577,7 @@ function parseV2NativeChangeValue(value) {
|
|
|
12220
11577
|
};
|
|
12221
11578
|
}
|
|
12222
11579
|
function parseNativeChangeValue(value) {
|
|
12223
|
-
const root =
|
|
11580
|
+
const root = record2(value, NATIVE_CHANGE_STATE_FILE);
|
|
12224
11581
|
if (root.schema !== NATIVE_CHANGE_SCHEMA) {
|
|
12225
11582
|
if (root.schema === NATIVE_LEGACY_CHANGE_SCHEMA || root.schema === NATIVE_V2_CHANGE_SCHEMA) {
|
|
12226
11583
|
const previous = root.schema === NATIVE_LEGACY_CHANGE_SCHEMA ? parseLegacyNativeChangeValue(root) : parseV2NativeChangeValue(root);
|
|
@@ -12274,7 +11631,7 @@ function parseNativeChangeValue(value) {
|
|
|
12274
11631
|
};
|
|
12275
11632
|
}
|
|
12276
11633
|
function inspectNativeChangeValue(value) {
|
|
12277
|
-
const root =
|
|
11634
|
+
const root = record2(value, NATIVE_CHANGE_STATE_FILE);
|
|
12278
11635
|
if (root.schema === NATIVE_LEGACY_CHANGE_SCHEMA) {
|
|
12279
11636
|
const state2 = parseLegacyNativeChangeValue(root);
|
|
12280
11637
|
return {
|
|
@@ -12331,15 +11688,15 @@ function inspectNativeChangeValue(value) {
|
|
|
12331
11688
|
}
|
|
12332
11689
|
function nativeChangeDir(paths, name) {
|
|
12333
11690
|
assertNativeName(name);
|
|
12334
|
-
const target =
|
|
11691
|
+
const target = path16.join(paths.changesDir, name);
|
|
12335
11692
|
if (!isInsidePath(paths.changesDir, target)) throw new Error("Native change path escaped");
|
|
12336
11693
|
return target;
|
|
12337
11694
|
}
|
|
12338
11695
|
async function hasPendingNativeSchemaMigration(paths, name) {
|
|
12339
|
-
const file =
|
|
11696
|
+
const file = path16.join(nativeChangeDir(paths, name), "runtime", "schema-migration.json");
|
|
12340
11697
|
await resolveContainedNativePath(paths.nativeRoot, file);
|
|
12341
11698
|
try {
|
|
12342
|
-
await
|
|
11699
|
+
await fs11.lstat(file);
|
|
12343
11700
|
return true;
|
|
12344
11701
|
} catch (error) {
|
|
12345
11702
|
if (error.code === "ENOENT") return false;
|
|
@@ -12347,8 +11704,8 @@ async function hasPendingNativeSchemaMigration(paths, name) {
|
|
|
12347
11704
|
}
|
|
12348
11705
|
}
|
|
12349
11706
|
var NATIVE_CHANGE_DOCUMENT_MAX_BYTES = 256 * 1024;
|
|
12350
|
-
async function readChangeDocumentFile(file, root =
|
|
12351
|
-
const ref =
|
|
11707
|
+
async function readChangeDocumentFile(file, root = path16.dirname(file)) {
|
|
11708
|
+
const ref = path16.relative(root, file).split(path16.sep).join("/");
|
|
12352
11709
|
const source = await readNativeBoundedTextFile({
|
|
12353
11710
|
root,
|
|
12354
11711
|
ref,
|
|
@@ -12361,7 +11718,7 @@ async function readChangeDocumentFile(file, root = path18.dirname(file)) {
|
|
|
12361
11718
|
return document.toJS();
|
|
12362
11719
|
}
|
|
12363
11720
|
async function inspectNativeChange(paths, name) {
|
|
12364
|
-
const file =
|
|
11721
|
+
const file = path16.join(nativeChangeDir(paths, name), NATIVE_CHANGE_STATE_FILE);
|
|
12365
11722
|
await resolveContainedNativePath(paths.nativeRoot, file);
|
|
12366
11723
|
const inspection = inspectNativeChangeValue(await readChangeDocumentFile(file, paths.nativeRoot));
|
|
12367
11724
|
if (inspection.state && inspection.state.name !== name) {
|
|
@@ -12382,67 +11739,10 @@ async function inspectNativeChange(paths, name) {
|
|
|
12382
11739
|
return inspection;
|
|
12383
11740
|
}
|
|
12384
11741
|
async function assertNativeVerificationProtocolBinding(paths, state) {
|
|
12385
|
-
const controllerTrust = await readNativeControllerTrustProject(paths.projectRoot);
|
|
12386
|
-
const controllerRequiresSigned = controllerTrust !== null && !controllerTrust.legacyChanges.includes(state.name);
|
|
12387
|
-
if (controllerRequiresSigned && state.verification_protocol !== "signed-v2") {
|
|
12388
|
-
throw new Error(
|
|
12389
|
-
`Native verification protocol does not match its creation baseline (controller-backed): expected signed-v2 for ${state.name}`
|
|
12390
|
-
);
|
|
12391
|
-
}
|
|
12392
|
-
if (controllerTrust !== null && controllerTrust.legacyChanges.includes(state.name) && state.verification_protocol !== "legacy-v1") {
|
|
12393
|
-
throw new Error(`Native controller trust marks ${state.name} as legacy-v1`);
|
|
12394
|
-
}
|
|
12395
11742
|
const baseline = await readNativeBaselineManifest(paths, state.name);
|
|
12396
|
-
if (baseline === null)
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
`Native signed-v2 verification protocol has no creation baseline: ${state.name}`
|
|
12400
|
-
);
|
|
12401
|
-
}
|
|
12402
|
-
return;
|
|
12403
|
-
}
|
|
12404
|
-
const expectedProtocol = baseline.creation ? "signed-v2" : "legacy-v1";
|
|
12405
|
-
if (state.verification_protocol !== expectedProtocol) {
|
|
12406
|
-
throw new Error(
|
|
12407
|
-
`Native verification protocol does not match its creation baseline: expected ${expectedProtocol}, got ${state.verification_protocol}`
|
|
12408
|
-
);
|
|
12409
|
-
}
|
|
12410
|
-
if (expectedProtocol === "signed-v2") {
|
|
12411
|
-
if (!controllerTrust) {
|
|
12412
|
-
throw new Error("Native signed-v2 creation has no controller-owned trust root");
|
|
12413
|
-
}
|
|
12414
|
-
const creation = baseline.creation;
|
|
12415
|
-
const changeDir = nativeChangeDir(paths, state.name);
|
|
12416
|
-
const snapshot = await readNativeProtectedTextFile({
|
|
12417
|
-
root: nativeChangeDir(paths, state.name),
|
|
12418
|
-
file: path18.join(changeDir, ...creation.policySnapshotRef.split("/")),
|
|
12419
|
-
maxBytes: 64 * 1024,
|
|
12420
|
-
label: "Native creation-time trust policy snapshot"
|
|
12421
|
-
});
|
|
12422
|
-
if (createHash7("sha256").update(snapshot.text).digest("hex") !== creation.policySnapshotHash) {
|
|
12423
|
-
throw new Error("Native creation-time trust policy snapshot hash mismatch");
|
|
12424
|
-
}
|
|
12425
|
-
let policy;
|
|
12426
|
-
try {
|
|
12427
|
-
policy = JSON.parse(snapshot.text);
|
|
12428
|
-
} catch (error) {
|
|
12429
|
-
throw new Error("Native creation-time trust policy snapshot is invalid JSON", {
|
|
12430
|
-
cause: error
|
|
12431
|
-
});
|
|
12432
|
-
}
|
|
12433
|
-
const verifiedPolicy = verifyNativeReviewTrustPolicy(
|
|
12434
|
-
policy,
|
|
12435
|
-
controllerTrust.controllerIdentity
|
|
12436
|
-
);
|
|
12437
|
-
if (verifiedPolicy.policyHash !== creation.policyHash) {
|
|
12438
|
-
throw new Error("Native creation-time trust policy snapshot does not match its binding");
|
|
12439
|
-
}
|
|
12440
|
-
await verifyNativeCreationAuthorization({
|
|
12441
|
-
paths,
|
|
12442
|
-
policyHash: creation.policyHash,
|
|
12443
|
-
authorization: creation.authorization,
|
|
12444
|
-
change: state.name
|
|
12445
|
-
});
|
|
11743
|
+
if (baseline === null) return;
|
|
11744
|
+
if (state.verification_protocol !== "legacy-v1") {
|
|
11745
|
+
throw new Error(`Native verification protocol is unsupported: ${state.verification_protocol}`);
|
|
12446
11746
|
}
|
|
12447
11747
|
}
|
|
12448
11748
|
async function readNativeChange(paths, name) {
|
|
@@ -12473,14 +11773,14 @@ async function resolveSelectedNativeChange(paths) {
|
|
|
12473
11773
|
|
|
12474
11774
|
// domains/comet-native/native-hook-guard.ts
|
|
12475
11775
|
function isWithin(parent, target) {
|
|
12476
|
-
const relative =
|
|
12477
|
-
return relative === "" || !relative.startsWith("..") && !
|
|
11776
|
+
const relative = path17.relative(parent, target);
|
|
11777
|
+
return relative === "" || !relative.startsWith("..") && !path17.isAbsolute(relative);
|
|
12478
11778
|
}
|
|
12479
11779
|
function requestTargetsAreControlOnly(projectRoot, nativeRoot, request) {
|
|
12480
11780
|
return request.targets.length > 0 && request.targets.every((targetPath) => {
|
|
12481
|
-
const target =
|
|
11781
|
+
const target = path17.resolve(projectRoot, targetPath);
|
|
12482
11782
|
if (!isWithin(projectRoot, target)) return true;
|
|
12483
|
-
const relative =
|
|
11783
|
+
const relative = path17.relative(projectRoot, target).replaceAll("\\", "/");
|
|
12484
11784
|
return relative === ".comet/config.yaml" || isWithin(nativeRoot, target);
|
|
12485
11785
|
});
|
|
12486
11786
|
}
|
|
@@ -12490,7 +11790,7 @@ async function activeNativeContext(projectRoot) {
|
|
|
12490
11790
|
const paths = await nativeProjectPaths(projectRoot, config.native.artifact_root);
|
|
12491
11791
|
let entries;
|
|
12492
11792
|
try {
|
|
12493
|
-
entries = await
|
|
11793
|
+
entries = await fs12.readdir(paths.changesDir, { withFileTypes: true });
|
|
12494
11794
|
} catch (error) {
|
|
12495
11795
|
if (error.code === "ENOENT") return { paths, changes: [] };
|
|
12496
11796
|
throw error;
|
|
@@ -12568,12 +11868,12 @@ async function inspectNativeHookGuard(projectRoot, request, selectedChangeName)
|
|
|
12568
11868
|
let controlTarget = false;
|
|
12569
11869
|
let externalTarget = false;
|
|
12570
11870
|
for (const targetPath of request.targets) {
|
|
12571
|
-
const target =
|
|
11871
|
+
const target = path17.resolve(projectRoot, targetPath);
|
|
12572
11872
|
if (!isWithin(projectRoot, target)) {
|
|
12573
11873
|
externalTarget = true;
|
|
12574
11874
|
continue;
|
|
12575
11875
|
}
|
|
12576
|
-
const relative =
|
|
11876
|
+
const relative = path17.relative(projectRoot, target).replaceAll("\\", "/");
|
|
12577
11877
|
if (relative === ".comet/config.yaml" || isWithin(context.paths.nativeRoot, target)) {
|
|
12578
11878
|
controlTarget = true;
|
|
12579
11879
|
continue;
|
|
@@ -12607,6 +11907,20 @@ function enabledWorkflows(config) {
|
|
|
12607
11907
|
if (!config) return ["classic"];
|
|
12608
11908
|
return config.workflows ?? [config.default_workflow];
|
|
12609
11909
|
}
|
|
11910
|
+
async function listEnabledActiveChanges(projectRoot, enabled, dependencies, cached) {
|
|
11911
|
+
const [native, classic] = await Promise.all([
|
|
11912
|
+
enabled.includes("native") ? cached?.workflow === "native" ? cached.candidates : dependencies.listNative(projectRoot) : [],
|
|
11913
|
+
enabled.includes("classic") ? cached?.workflow === "classic" ? cached.candidates : dependencies.listClassic(projectRoot) : []
|
|
11914
|
+
]);
|
|
11915
|
+
return [...native, ...classic];
|
|
11916
|
+
}
|
|
11917
|
+
function resolveActiveCandidates(candidates, staleSelection) {
|
|
11918
|
+
if (candidates.length === 0) return { status: "none", staleSelection };
|
|
11919
|
+
if (candidates.length === 1) {
|
|
11920
|
+
return { status: "inferred", owner: candidates[0], staleSelection };
|
|
11921
|
+
}
|
|
11922
|
+
return { status: "ambiguous", candidates, staleSelection };
|
|
11923
|
+
}
|
|
12610
11924
|
async function resolveHookWorkflowOwner(projectRoot, dependencies = DEFAULT_DEPENDENCIES) {
|
|
12611
11925
|
const config = await readWorkflowProjectConfig(projectRoot);
|
|
12612
11926
|
const enabled = enabledWorkflows(config);
|
|
@@ -12641,11 +11955,23 @@ async function resolveHookWorkflowOwner(projectRoot, dependencies = DEFAULT_DEPE
|
|
|
12641
11955
|
}
|
|
12642
11956
|
const owner = selectedCandidates.find((candidate) => candidate.name === selection.change);
|
|
12643
11957
|
if (!owner) {
|
|
12644
|
-
|
|
12645
|
-
status: "stale",
|
|
11958
|
+
const staleSelection = {
|
|
12646
11959
|
code: "target-missing",
|
|
12647
11960
|
reason: `selected ${selection.workflow} change '${selection.change}' is missing or archived`
|
|
12648
11961
|
};
|
|
11962
|
+
try {
|
|
11963
|
+
const candidates = await listEnabledActiveChanges(projectRoot, enabled, dependencies, {
|
|
11964
|
+
workflow: selection.workflow,
|
|
11965
|
+
candidates: selectedCandidates
|
|
11966
|
+
});
|
|
11967
|
+
return resolveActiveCandidates(candidates, staleSelection);
|
|
11968
|
+
} catch (error) {
|
|
11969
|
+
return {
|
|
11970
|
+
status: "stale",
|
|
11971
|
+
code: "change-state-unreadable",
|
|
11972
|
+
reason: `cannot safely enumerate active Comet changes: ${error instanceof Error ? error.message : String(error)}`
|
|
11973
|
+
};
|
|
11974
|
+
}
|
|
12649
11975
|
}
|
|
12650
11976
|
if (selection.workflow === "classic") {
|
|
12651
11977
|
const resolved = await resolveCurrentChange(projectRoot);
|
|
@@ -12659,13 +11985,9 @@ async function resolveHookWorkflowOwner(projectRoot, dependencies = DEFAULT_DEPE
|
|
|
12659
11985
|
}
|
|
12660
11986
|
return { status: "owned", owner };
|
|
12661
11987
|
}
|
|
12662
|
-
let native;
|
|
12663
|
-
let classic;
|
|
12664
11988
|
try {
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
enabled.includes("classic") ? dependencies.listClassic(projectRoot) : Promise.resolve([])
|
|
12668
|
-
]);
|
|
11989
|
+
const candidates = await listEnabledActiveChanges(projectRoot, enabled, dependencies);
|
|
11990
|
+
return resolveActiveCandidates(candidates);
|
|
12669
11991
|
} catch (error) {
|
|
12670
11992
|
return {
|
|
12671
11993
|
status: "stale",
|
|
@@ -12673,10 +11995,6 @@ async function resolveHookWorkflowOwner(projectRoot, dependencies = DEFAULT_DEPE
|
|
|
12673
11995
|
reason: `cannot safely enumerate active Comet changes: ${error instanceof Error ? error.message : String(error)}`
|
|
12674
11996
|
};
|
|
12675
11997
|
}
|
|
12676
|
-
const candidates = [...native, ...classic];
|
|
12677
|
-
if (candidates.length === 0) return { status: "none" };
|
|
12678
|
-
if (candidates.length === 1) return { status: "inferred", owner: candidates[0] };
|
|
12679
|
-
return { status: "ambiguous", candidates };
|
|
12680
11998
|
}
|
|
12681
11999
|
async function inspectCometHook(projectRoot, request, dependencies = DEFAULT_DEPENDENCIES) {
|
|
12682
12000
|
if (request.intent === "non-write") {
|
|
@@ -12731,14 +12049,14 @@ function parseArgs(args) {
|
|
|
12731
12049
|
throw new Error(`unsupported Hook platform: ${platformId}`);
|
|
12732
12050
|
}
|
|
12733
12051
|
if (projectRoot?.startsWith("--")) throw new Error("--project-root requires a value");
|
|
12734
|
-
return { platformId, ...projectRoot ? { projectRoot:
|
|
12052
|
+
return { platformId, ...projectRoot ? { projectRoot: path18.resolve(projectRoot) } : {} };
|
|
12735
12053
|
}
|
|
12736
12054
|
async function projectRootFrom(parsed) {
|
|
12737
12055
|
if (parsed.projectRoot) return parsed.projectRoot;
|
|
12738
12056
|
const discovered = await discoverNativeProject(process.cwd());
|
|
12739
12057
|
for (const marker of [[".comet", "config.yaml"], [".git"]]) {
|
|
12740
12058
|
try {
|
|
12741
|
-
await
|
|
12059
|
+
await fs13.lstat(path18.join(discovered, ...marker));
|
|
12742
12060
|
return discovered;
|
|
12743
12061
|
} catch (error) {
|
|
12744
12062
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -12747,7 +12065,7 @@ async function projectRootFrom(parsed) {
|
|
|
12747
12065
|
const classic = await discoverClassicProject(process.cwd());
|
|
12748
12066
|
const layout = await assertClassicLayoutReadable(classic);
|
|
12749
12067
|
try {
|
|
12750
|
-
await
|
|
12068
|
+
await fs13.lstat(layout.changesDir);
|
|
12751
12069
|
return classic;
|
|
12752
12070
|
} catch (error) {
|
|
12753
12071
|
if (error.code !== "ENOENT") throw error;
|