gate-evm-tools 1.0.31 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -20
- package/bin/cli.js +3 -0
- package/bin/delivery.cjs +8 -7
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +26 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/plan/index.d.ts.map +1 -1
- package/dist/commands/plan/index.js +1 -1
- package/dist/commands/plan/index.js.map +1 -1
- package/dist/core/preparation/batch.d.ts +26 -0
- package/dist/core/preparation/batch.d.ts.map +1 -0
- package/dist/core/preparation/batch.js +72 -0
- package/dist/core/preparation/batch.js.map +1 -0
- package/dist/core/preparation/evm.d.ts +23 -4
- package/dist/core/preparation/evm.d.ts.map +1 -1
- package/dist/core/preparation/evm.js +19 -3
- package/dist/core/preparation/evm.js.map +1 -1
- package/dist/core/preparation/evmManifestSync.d.ts +5 -0
- package/dist/core/preparation/evmManifestSync.d.ts.map +1 -1
- package/dist/core/preparation/evmManifestSync.js +15 -7
- package/dist/core/preparation/evmManifestSync.js.map +1 -1
- package/dist/core/preparation/index.d.ts +2 -2
- package/dist/core/preparation/index.d.ts.map +1 -1
- package/dist/core/preparation/manifest.d.ts +2 -0
- package/dist/core/preparation/manifest.d.ts.map +1 -1
- package/dist/core/preparation/manifest.js +2 -2
- package/dist/core/preparation/manifest.js.map +1 -1
- package/dist/core/preparation/normalize.d.ts.map +1 -1
- package/dist/core/preparation/normalize.js +53 -11
- package/dist/core/preparation/normalize.js.map +1 -1
- package/dist/core/preparation/transparent.d.ts +23 -0
- package/dist/core/preparation/transparent.d.ts.map +1 -0
- package/dist/core/preparation/transparent.js +103 -0
- package/dist/core/preparation/transparent.js.map +1 -0
- package/dist/core/preparation/types.d.ts +47 -5
- package/dist/core/preparation/types.d.ts.map +1 -1
- package/dist/core/preparation/zksync.d.ts.map +1 -1
- package/dist/core/preparation/zksync.js +2 -0
- package/dist/core/preparation/zksync.js.map +1 -1
- package/dist/custody/credential.d.ts.map +1 -1
- package/dist/custody/credential.js +1 -6
- package/dist/custody/credential.js.map +1 -1
- package/dist/deployment-evm/index.d.ts +4 -0
- package/dist/deployment-evm/index.d.ts.map +1 -0
- package/dist/deployment-evm/index.js +3 -0
- package/dist/deployment-evm/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +5 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow/index.d.ts +4 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +2 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist-cjs/core/preparation/batch.js +76 -0
- package/dist-cjs/core/preparation/batch.js.map +1 -0
- package/dist-cjs/core/preparation/evm.js +25 -7
- package/dist-cjs/core/preparation/evm.js.map +1 -1
- package/dist-cjs/core/preparation/evmManifestSync.js +15 -7
- package/dist-cjs/core/preparation/evmManifestSync.js.map +1 -1
- package/dist-cjs/core/preparation/manifest.js +2 -2
- package/dist-cjs/core/preparation/manifest.js.map +1 -1
- package/dist-cjs/core/preparation/normalize.js +53 -11
- package/dist-cjs/core/preparation/normalize.js.map +1 -1
- package/dist-cjs/core/preparation/transparent.js +110 -0
- package/dist-cjs/core/preparation/transparent.js.map +1 -0
- package/dist-cjs/core/preparation/zksync.js +2 -0
- package/dist-cjs/core/preparation/zksync.js.map +1 -1
- package/dist-cjs/custody/credential.js +1 -6
- package/dist-cjs/custody/credential.js.map +1 -1
- package/dist-cjs/deployment-evm/index.js +10 -0
- package/dist-cjs/deployment-evm/index.js.map +1 -0
- package/dist-cjs/sync/index.js +5 -0
- package/dist-cjs/sync/index.js.map +1 -1
- package/dist-cjs/workflow/index.js +11 -1
- package/dist-cjs/workflow/index.js.map +1 -1
- package/dist-runtime/config/hardhatAdapters.js +2 -1
- package/dist-runtime/config/hardhatAdapters.js.map +1 -1
- package/dist-runtime/delivery/aggregate-bootstrap.js +3 -1
- package/dist-runtime/delivery/aggregate-bootstrap.js.map +1 -1
- package/dist-runtime/delivery/aggregate-channel.js +7 -3
- package/dist-runtime/delivery/aggregate-channel.js.map +1 -1
- package/dist-runtime/delivery/aggregate-diagnostics.d.ts +14 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js +73 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js.map +1 -0
- package/dist-runtime/delivery/aggregate-inputs.d.ts +13 -9
- package/dist-runtime/delivery/aggregate-source.js +11 -3
- package/dist-runtime/delivery/aggregate-source.js.map +1 -1
- package/dist-runtime/delivery/aggregate-worker.js +12 -4
- package/dist-runtime/delivery/aggregate-worker.js.map +1 -1
- package/dist-runtime/delivery/aggregate.js +2 -2
- package/dist-runtime/delivery/aggregate.js.map +1 -1
- package/dist-runtime/delivery/business-extension.d.ts +10 -0
- package/dist-runtime/delivery/business-extension.js +38 -0
- package/dist-runtime/delivery/business-extension.js.map +1 -0
- package/dist-runtime/delivery/calldata-archive.d.ts +18 -0
- package/dist-runtime/delivery/calldata-archive.js +31 -0
- package/dist-runtime/delivery/calldata-archive.js.map +1 -0
- package/dist-runtime/delivery/calldata-details.d.ts +47 -0
- package/dist-runtime/delivery/calldata-details.js +94 -0
- package/dist-runtime/delivery/calldata-details.js.map +1 -0
- package/dist-runtime/delivery/calldata-format.d.ts +4 -0
- package/dist-runtime/delivery/calldata-format.js +17 -0
- package/dist-runtime/delivery/calldata-format.js.map +1 -0
- package/dist-runtime/delivery/calldata-preparations.d.ts +13 -0
- package/dist-runtime/delivery/calldata-preparations.js +85 -0
- package/dist-runtime/delivery/calldata-preparations.js.map +1 -0
- package/dist-runtime/delivery/calldata-review.d.ts +44 -0
- package/dist-runtime/delivery/calldata-review.js +131 -0
- package/dist-runtime/delivery/calldata-review.js.map +1 -0
- package/dist-runtime/delivery/codec-pin.d.ts +2 -2
- package/dist-runtime/delivery/codec-pin.js +4 -4
- package/dist-runtime/delivery/codec-pin.js.map +1 -1
- package/dist-runtime/delivery/compiler-files.js +3 -1
- package/dist-runtime/delivery/compiler-files.js.map +1 -1
- package/dist-runtime/delivery/compiler-pins.js +1 -1
- package/dist-runtime/delivery/compiler.js +17 -16
- package/dist-runtime/delivery/compiler.js.map +1 -1
- package/dist-runtime/delivery/config.d.ts +1 -1
- package/dist-runtime/delivery/config.js +27 -2
- package/dist-runtime/delivery/config.js.map +1 -1
- package/dist-runtime/delivery/configuration-definition.d.ts +9 -0
- package/dist-runtime/delivery/configuration-definition.js +33 -6
- package/dist-runtime/delivery/configuration-definition.js.map +1 -1
- package/dist-runtime/delivery/configuration.js +7 -4
- package/dist-runtime/delivery/configuration.js.map +1 -1
- package/dist-runtime/delivery/contract-source.d.ts +14 -0
- package/dist-runtime/delivery/contract-source.js +138 -0
- package/dist-runtime/delivery/contract-source.js.map +1 -0
- package/dist-runtime/delivery/custom-format.js +51 -24
- package/dist-runtime/delivery/custom-format.js.map +1 -1
- package/dist-runtime/delivery/development-inputs.d.ts +14 -0
- package/dist-runtime/delivery/development-inputs.js +76 -0
- package/dist-runtime/delivery/development-inputs.js.map +1 -0
- package/dist-runtime/delivery/development.d.ts +3 -1
- package/dist-runtime/delivery/development.js +24 -10
- package/dist-runtime/delivery/development.js.map +1 -1
- package/dist-runtime/delivery/eoa.d.ts +1 -0
- package/dist-runtime/delivery/execution-identity.d.ts +15 -0
- package/dist-runtime/delivery/execution-identity.js +33 -0
- package/dist-runtime/delivery/execution-identity.js.map +1 -0
- package/dist-runtime/delivery/existing-code.js +14 -6
- package/dist-runtime/delivery/existing-code.js.map +1 -1
- package/dist-runtime/delivery/history-package.d.ts +2 -0
- package/dist-runtime/delivery/history-package.js +70 -0
- package/dist-runtime/delivery/history-package.js.map +1 -0
- package/dist-runtime/delivery/history-registration.d.ts +1 -1
- package/dist-runtime/delivery/inputs.js +22 -15
- package/dist-runtime/delivery/inputs.js.map +1 -1
- package/dist-runtime/delivery/journal.js +18 -10
- package/dist-runtime/delivery/journal.js.map +1 -1
- package/dist-runtime/delivery/parameter-defaults.d.ts +10 -0
- package/dist-runtime/delivery/parameter-defaults.js +86 -0
- package/dist-runtime/delivery/parameter-defaults.js.map +1 -0
- package/dist-runtime/delivery/parameters.d.ts +2 -0
- package/dist-runtime/delivery/parameters.js +22 -0
- package/dist-runtime/delivery/parameters.js.map +1 -1
- package/dist-runtime/delivery/planning.d.ts +4 -1
- package/dist-runtime/delivery/planning.js +19 -3
- package/dist-runtime/delivery/planning.js.map +1 -1
- package/dist-runtime/delivery/preparation.js +43 -23
- package/dist-runtime/delivery/preparation.js.map +1 -1
- package/dist-runtime/delivery/production-environment.js +2 -1
- package/dist-runtime/delivery/production-environment.js.map +1 -1
- package/dist-runtime/delivery/production-finalization.js +23 -9
- package/dist-runtime/delivery/production-finalization.js.map +1 -1
- package/dist-runtime/delivery/production-intent.d.ts +2 -0
- package/dist-runtime/delivery/production-intent.js +16 -0
- package/dist-runtime/delivery/production-intent.js.map +1 -0
- package/dist-runtime/delivery/production.d.ts +129 -8
- package/dist-runtime/delivery/production.js +60 -11
- package/dist-runtime/delivery/production.js.map +1 -1
- package/dist-runtime/delivery/project-files.d.ts +3 -3
- package/dist-runtime/delivery/project-files.js +19 -14
- package/dist-runtime/delivery/project-files.js.map +1 -1
- package/dist-runtime/delivery/project-rpc.d.ts +19 -0
- package/dist-runtime/delivery/project-rpc.js +138 -0
- package/dist-runtime/delivery/project-rpc.js.map +1 -0
- package/dist-runtime/delivery/project.d.ts +3 -1
- package/dist-runtime/delivery/project.js +21 -8
- package/dist-runtime/delivery/project.js.map +1 -1
- package/dist-runtime/delivery/public-calldata.d.ts +25 -0
- package/dist-runtime/delivery/public-calldata.js +97 -0
- package/dist-runtime/delivery/public-calldata.js.map +1 -0
- package/dist-runtime/delivery/release-graph.d.ts +7 -3
- package/dist-runtime/delivery/release-graph.js +58 -25
- package/dist-runtime/delivery/release-graph.js.map +1 -1
- package/dist-runtime/delivery/release-history-capture.js +22 -26
- package/dist-runtime/delivery/release-history-capture.js.map +1 -1
- package/dist-runtime/delivery/release-history.d.ts +3 -2
- package/dist-runtime/delivery/release-history.js +97 -50
- package/dist-runtime/delivery/release-history.js.map +1 -1
- package/dist-runtime/delivery/release-inputs.d.ts +33 -0
- package/dist-runtime/delivery/release-inputs.js +129 -0
- package/dist-runtime/delivery/release-inputs.js.map +1 -0
- package/dist-runtime/delivery/release.d.ts +38 -14
- package/dist-runtime/delivery/release.js +81 -29
- package/dist-runtime/delivery/release.js.map +1 -1
- package/dist-runtime/delivery/safe.d.ts +1 -0
- package/dist-runtime/delivery/safe.js +13 -2
- package/dist-runtime/delivery/safe.js.map +1 -1
- package/dist-runtime/delivery/same-fork-baseline.d.ts +1 -1
- package/dist-runtime/delivery/same-fork-baseline.js +5 -4
- package/dist-runtime/delivery/same-fork-baseline.js.map +1 -1
- package/dist-runtime/delivery/setup.d.ts +1 -1
- package/dist-runtime/delivery/setup.js +21 -6
- package/dist-runtime/delivery/setup.js.map +1 -1
- package/dist-runtime/delivery/source.d.ts +1 -0
- package/dist-runtime/delivery/source.js +12 -10
- package/dist-runtime/delivery/source.js.map +1 -1
- package/dist-runtime/delivery/task-identity.d.ts +23 -0
- package/dist-runtime/delivery/task-identity.js +109 -0
- package/dist-runtime/delivery/task-identity.js.map +1 -0
- package/dist-runtime/delivery/toolchain.d.ts +3 -0
- package/dist-runtime/delivery/toolchain.js +52 -0
- package/dist-runtime/delivery/toolchain.js.map +1 -0
- package/dist-runtime/delivery/validation.js +7 -2
- package/dist-runtime/delivery/validation.js.map +1 -1
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/vendor/plan-codec/index.cjs +97 -20
- package/dist-runtime/vendor/plan-codec/index.d.cts +6 -0
- package/dist-runtime/vendor/plan-codec/provenance.json +9 -8
- package/dist-runtime/workflow/lib/calls.js +1 -0
- package/dist-runtime/workflow/lib/calls.js.map +1 -1
- package/dist-runtime/workflow/lib/checkCodeRunner.js +7 -4
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -1
- package/dist-runtime/workflow/lib/context.d.ts +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +4 -26
- package/dist-runtime/workflow/lib/create2.js +2 -67
- package/dist-runtime/workflow/lib/create2.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentInfo.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js +6 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js +2 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -1
- package/dist-runtime/workflow/lib/gateTool.js +2 -2
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -1
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +3 -0
- package/dist-runtime/workflow/lib/gateToolSync.js +5 -0
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -1
- package/dist-runtime/workflow/lib/parameters.js +5 -0
- package/dist-runtime/workflow/lib/parameters.js.map +1 -1
- package/dist-runtime/workflow/lib/proxy.d.ts +1 -0
- package/dist-runtime/workflow/lib/proxy.js.map +1 -1
- package/dist-runtime/workflow/run.js +1 -3
- package/dist-runtime/workflow/run.js.map +1 -1
- package/dist-runtime/workflow/steps/deploy.js +53 -0
- package/dist-runtime/workflow/steps/deploy.js.map +1 -1
- package/dist-runtime/workflow/steps/upgrade.js +24 -10
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -1
- package/docs/compiler-qualification.md +8 -2
- package/docs/delivery-aggregate.md +2 -0
- package/docs/delivery-calldata.md +27 -0
- package/docs/delivery-development.md +6 -0
- package/docs/delivery-execution-store.md +1 -1
- package/docs/delivery-inputs.md +55 -6
- package/docs/delivery-parameters.md +1 -1
- package/docs/delivery-release.md +77 -7
- package/docs/delivery-safe.md +7 -4
- package/docs/delivery-setup.md +72 -20
- package/docs/delivery-source.md +8 -8
- package/docs/direct-package-acceptance.md +2 -0
- package/docs/openzeppelin-acceptance.md +86 -0
- package/docs/openzeppelin-baseline.json +27 -0
- package/docs/openzeppelin-integration.md +115 -0
- package/docs/plans/2026-10-28-openzeppelin-toolkit-consolidation.md +396 -0
- package/docs/plans/2026-11-02-transparent-proxy-delivery.md +78 -0
- package/docs/superpowers/plans/2026-08-17-custody-hardhat-signers.md +1 -1
- package/docs/workflow-reference.md +12 -4
- package/docs/workflow-runtime.md +6 -0
- package/package.json +19 -5
- package/runtime/config/hardhatAdapters.ts +2 -1
- package/runtime/delivery/aggregate-bootstrap.ts +3 -1
- package/runtime/delivery/aggregate-channel.ts +6 -3
- package/runtime/delivery/aggregate-diagnostics.ts +63 -0
- package/runtime/delivery/aggregate-source.ts +6 -2
- package/runtime/delivery/aggregate-worker.ts +15 -5
- package/runtime/delivery/aggregate.ts +2 -2
- package/runtime/delivery/business-extension.ts +33 -0
- package/runtime/delivery/calldata-archive.ts +25 -0
- package/runtime/delivery/calldata-details.ts +90 -0
- package/runtime/delivery/calldata-format.ts +14 -0
- package/runtime/delivery/calldata-preparations.ts +76 -0
- package/runtime/delivery/calldata-review.ts +126 -0
- package/runtime/delivery/codec-pin.ts +3 -3
- package/runtime/delivery/compiler-files.ts +3 -1
- package/runtime/delivery/compiler-pins.ts +1 -1
- package/runtime/delivery/compiler.ts +18 -17
- package/runtime/delivery/config.ts +25 -2
- package/runtime/delivery/configuration-definition.ts +34 -7
- package/runtime/delivery/configuration.ts +8 -5
- package/runtime/delivery/contract-source.ts +112 -0
- package/runtime/delivery/custom-format.ts +20 -5
- package/runtime/delivery/development-inputs.ts +42 -0
- package/runtime/delivery/development.ts +14 -11
- package/runtime/delivery/execution-identity.ts +32 -0
- package/runtime/delivery/existing-code.ts +7 -6
- package/runtime/delivery/history-package.ts +50 -0
- package/runtime/delivery/inputs.ts +18 -11
- package/runtime/delivery/journal.ts +14 -10
- package/runtime/delivery/parameter-defaults.ts +75 -0
- package/runtime/delivery/parameters.ts +18 -0
- package/runtime/delivery/planning.ts +19 -5
- package/runtime/delivery/preparation.ts +17 -1
- package/runtime/delivery/production-environment.ts +2 -1
- package/runtime/delivery/production-finalization.ts +19 -10
- package/runtime/delivery/production-intent.ts +14 -0
- package/runtime/delivery/production.ts +51 -11
- package/runtime/delivery/project-files.ts +16 -11
- package/runtime/delivery/project-rpc.ts +116 -0
- package/runtime/delivery/project.ts +19 -7
- package/runtime/delivery/public-calldata.ts +74 -0
- package/runtime/delivery/release-graph.ts +44 -14
- package/runtime/delivery/release-history-capture.ts +19 -9
- package/runtime/delivery/release-history.ts +76 -22
- package/runtime/delivery/release-inputs.ts +107 -0
- package/runtime/delivery/release.ts +56 -18
- package/runtime/delivery/safe.ts +14 -3
- package/runtime/delivery/same-fork-baseline.ts +5 -4
- package/runtime/delivery/setup.ts +20 -8
- package/runtime/delivery/source.ts +10 -10
- package/runtime/delivery/task-identity.ts +85 -0
- package/runtime/delivery/toolchain.ts +48 -0
- package/runtime/delivery/validation.ts +7 -2
- package/runtime/vendor/plan-codec/index.cjs +97 -20
- package/runtime/vendor/plan-codec/index.d.cts +6 -0
- package/runtime/vendor/plan-codec/provenance.json +9 -8
- package/runtime/workflow/lib/calls.ts +1 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +7 -3
- package/runtime/workflow/lib/context.ts +1 -0
- package/runtime/workflow/lib/create2.ts +7 -108
- package/runtime/workflow/lib/deploymentInfo.ts +8 -0
- package/runtime/workflow/lib/deploymentRecords.ts +3 -1
- package/runtime/workflow/lib/externalExecutionScanner.ts +2 -1
- package/runtime/workflow/lib/gateTool.ts +2 -2
- package/runtime/workflow/lib/gateToolSync.ts +8 -0
- package/runtime/workflow/lib/parameters.ts +4 -0
- package/runtime/workflow/lib/proxy.ts +1 -0
- package/runtime/workflow/run.ts +1 -2
- package/runtime/workflow/steps/deploy.ts +42 -0
- package/runtime/workflow/steps/upgrade.ts +19 -11
- package/bin/workflow.cjs +0 -19
|
@@ -28,8 +28,11 @@ __export(read_only_exports, {
|
|
|
28
28
|
SCHEMA_V1: () => SCHEMA_V1,
|
|
29
29
|
SKILL_NAME: () => SKILL_NAME,
|
|
30
30
|
TASK_STATUSES: () => TASK_STATUSES,
|
|
31
|
+
deploymentPurpose: () => deploymentPurpose,
|
|
32
|
+
deploymentRequirementIssue: () => deploymentRequirementIssue,
|
|
31
33
|
detectSchema: () => detectSchema,
|
|
32
34
|
parsePlan: () => parsePlan,
|
|
35
|
+
productionActionAllowed: () => productionActionAllowed,
|
|
33
36
|
projectDefinitions: () => projectDefinitions,
|
|
34
37
|
skillNames: () => skillNames,
|
|
35
38
|
toolRefs: () => toolRefs,
|
|
@@ -39,7 +42,7 @@ module.exports = __toCommonJS(read_only_exports);
|
|
|
39
42
|
|
|
40
43
|
// builtin-skills/gateflow-plan/scripts/lib/evm-contract.mjs
|
|
41
44
|
var PROJECT_FIELDS = ["chainFamily", "framework", "projectRoot", "templateProfile", "templateVersion", "mode"];
|
|
42
|
-
var DEPLOYMENT_FIELDS = ["chainFamily", "framework", "projectRoot", "deploymentId", "specPath", "sourceCodeRef", "requiredOperations", "developmentNetwork", "releaseTargetNetworks", "environment", "targetNetwork", "allowedActions", "releaseRef"];
|
|
45
|
+
var DEPLOYMENT_FIELDS = ["purpose", "chainFamily", "framework", "projectRoot", "deploymentId", "specPath", "sourceCodeRef", "requiredOperations", "developmentNetwork", "releaseTargetNetworks", "environment", "targetNetwork", "allowedActions", "releaseRef", "requirementRef", "productionRequirementRef", "referenceDeploymentId"];
|
|
43
46
|
var ANALYSIS_STEPS = ["deployment-request", "deployment-plan", "script"];
|
|
44
47
|
var STEP_ACTIONS = {
|
|
45
48
|
deploy: ["simulate", "execute", "reconcile", "verify"],
|
|
@@ -49,11 +52,53 @@ var STEP_ACTIONS = {
|
|
|
49
52
|
"release-execute": ["execute", "export-calldata", "reconcile"],
|
|
50
53
|
"release-verify": ["verify"]
|
|
51
54
|
};
|
|
55
|
+
var PURPOSE_ACTIONS = {
|
|
56
|
+
"dev-execution": ["simulate", "execute", "reconcile", "verify"],
|
|
57
|
+
"prod-qualification": ["simulate", "verify"],
|
|
58
|
+
"prod-execution": ["simulate", "execute", "export-calldata", "reconcile", "verify"]
|
|
59
|
+
};
|
|
60
|
+
function deploymentPurpose(task) {
|
|
61
|
+
const explicit = task.scope?.deployment?.purpose;
|
|
62
|
+
if (explicit !== void 0) return explicit;
|
|
63
|
+
if (ANALYSIS_STEPS.includes(task.step)) return "analysis";
|
|
64
|
+
if (["deploy", "check-code"].includes(task.step)) return "dev-execution";
|
|
65
|
+
if (task.step === "deploy-test") return "prod-qualification";
|
|
66
|
+
if (["release-prepare", "release-execute", "release-verify"].includes(task.step)) return "prod-execution";
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
function productionActionAllowed(task, intent) {
|
|
70
|
+
const d = task.scope?.deployment;
|
|
71
|
+
const action = intent === "prepare" ? "simulate" : intent;
|
|
72
|
+
return deploymentPurpose(task) === "prod-execution" && d?.environment === "prod" && !!d.releaseRef && Array.isArray(d.allowedActions) && d.allowedActions.includes(action);
|
|
73
|
+
}
|
|
52
74
|
var OPERATIONS = ["deploy", "upgrade", "call", "view", "check", "custom"];
|
|
53
75
|
var isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
76
|
+
function deploymentRequirementIssue(plan, task) {
|
|
77
|
+
const d = task.scope?.deployment;
|
|
78
|
+
if (!d || deploymentPurpose(task) === "analysis") return null;
|
|
79
|
+
const ref = d.requirementRef;
|
|
80
|
+
if (!ref) return "部署实施前必须引用本轮已确认的需求(requirementRef)";
|
|
81
|
+
const request = Object.values(plan.tasks).flat().find((t) => t.planKey === ref.planKey);
|
|
82
|
+
if (!request || request.status === "cancelled" || deploymentPurpose(request) !== "analysis" || request.scope?.deployment?.projectRoot !== d.projectRoot || request.rev !== ref.rev || request.requirementConfirmation?.rev !== ref.rev) return "本轮部署需求尚未确认或确认修订已失效";
|
|
83
|
+
const r = request.scope.deployment;
|
|
84
|
+
if (d.productionRequirementRef !== void 0) {
|
|
85
|
+
if (!["prod-qualification", "prod-execution"].includes(deploymentPurpose(task))) return "生产补充确认只用于 prod 资格或执行任务";
|
|
86
|
+
const extra = d.productionRequirementRef;
|
|
87
|
+
const production = Object.values(plan.tasks).flat().find((t) => t.planKey === extra.planKey);
|
|
88
|
+
const p = production?.scope?.deployment;
|
|
89
|
+
if (!production || production.status === "cancelled" || deploymentPurpose(production) !== "analysis" || production.rev !== extra.rev || production.requirementConfirmation?.rev !== extra.rev || p?.projectRoot !== d.projectRoot || p?.deploymentId !== d.deploymentId || JSON.stringify(p.requirementRef) !== JSON.stringify(ref)) return "本轮生产补充需求尚未确认或绑定已失效";
|
|
90
|
+
if (!task.dependsOn.includes(production.planKey)) return "生产任务必须依赖其补充需求确认任务";
|
|
91
|
+
if (p.developmentNetwork !== r.developmentNetwork || d.developmentNetwork !== r.developmentNetwork || p.sourceCodeRef !== d.sourceCodeRef || JSON.stringify(p.releaseTargetNetworks) !== JSON.stringify(d.releaseTargetNetworks) || !d.requiredOperations?.every((operation) => p.requiredOperations?.includes(operation) && r.requiredOperations?.includes(operation))) return "生产补充需求只能扩充 prod 网络与参数,不能改变原部署动作或源码";
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (r.developmentNetwork !== d.developmentNetwork || JSON.stringify(r.releaseTargetNetworks) !== JSON.stringify(d.releaseTargetNetworks) || !d.requiredOperations?.every((operation) => r.requiredOperations?.includes(operation))) return "部署动作或网络超出本轮确认范围";
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
54
97
|
function validateEvmContracts(plan, fail3) {
|
|
55
98
|
const releases = /* @__PURE__ */ new Map();
|
|
56
99
|
const projects = /* @__PURE__ */ new Map();
|
|
100
|
+
const requirementRounds = /* @__PURE__ */ new Map();
|
|
101
|
+
const roundRequirements = /* @__PURE__ */ new Map();
|
|
57
102
|
const object = (value, where, fields) => {
|
|
58
103
|
if (!isObject(value)) fail3(`${where} 必须是对象`);
|
|
59
104
|
for (const field of Object.keys(value)) if (!fields.includes(field)) fail3(`${where}.${field} 是未知字段`);
|
|
@@ -101,7 +146,7 @@ function validateEvmContracts(plan, fail3) {
|
|
|
101
146
|
if (explicitEvmProject || evmProject && (project !== void 0 || task.step === "project-setup")) {
|
|
102
147
|
const p = object(project, `${where}.project`, PROJECT_FIELDS);
|
|
103
148
|
identity(p, `${where}.project`);
|
|
104
|
-
if (p.templateProfile !== "
|
|
149
|
+
if (p.templateProfile !== "full") fail3(`${where}.project.templateProfile 必须是 full`);
|
|
105
150
|
if (p.templateVersion !== 1) fail3(`${where}.project.templateVersion 必须是 1`);
|
|
106
151
|
if (!["create", "resume"].includes(p.mode)) fail3(`${where}.project.mode 必须是 create 或 resume`);
|
|
107
152
|
const metadata2 = JSON.stringify([p.chainFamily, p.framework, p.templateProfile, p.templateVersion]);
|
|
@@ -113,29 +158,38 @@ function validateEvmContracts(plan, fail3) {
|
|
|
113
158
|
const w = `${where}.deployment`;
|
|
114
159
|
const d = object(task.scope?.deployment, w, DEPLOYMENT_FIELDS);
|
|
115
160
|
identity(d, w);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
161
|
+
const initialAnalysis = d.purpose === "analysis" || d.purpose === void 0 && task.step === "deployment-request";
|
|
162
|
+
if (!initialAnalysis || d.deploymentId !== void 0) identifier(d.deploymentId, `${w}.deploymentId`);
|
|
163
|
+
if (!initialAnalysis || d.specPath !== void 0) relativePath(d.specPath, `${w}.specPath`);
|
|
164
|
+
if (!initialAnalysis || d.sourceCodeRef !== void 0) text(d.sourceCodeRef, `${w}.sourceCodeRef`);
|
|
165
|
+
if (!initialAnalysis || d.requiredOperations !== void 0) strings(d.requiredOperations, `${w}.requiredOperations`, OPERATIONS, 1);
|
|
166
|
+
if (!initialAnalysis || d.developmentNetwork !== void 0) identifier(d.developmentNetwork, `${w}.developmentNetwork`, true);
|
|
167
|
+
if (!initialAnalysis || d.releaseTargetNetworks !== void 0) strings(d.releaseTargetNetworks, `${w}.releaseTargetNetworks`);
|
|
168
|
+
for (const network of d.releaseTargetNetworks ?? []) identifier(network, `${w}.releaseTargetNetworks`, true);
|
|
169
|
+
if (d.referenceDeploymentId !== void 0) identifier(d.referenceDeploymentId, `${w}.referenceDeploymentId`);
|
|
170
|
+
for (const field of ["requirementRef", "productionRequirementRef"]) if (d[field] !== void 0) {
|
|
171
|
+
const ref2 = object(d[field], `${w}.${field}`, ["planKey", "rev"]);
|
|
172
|
+
identifier(ref2.planKey, `${w}.${field}.planKey`);
|
|
173
|
+
if (!Number.isSafeInteger(ref2.rev) || ref2.rev < 1) fail3(`${w}.${field}.rev 必须是正整数`);
|
|
174
|
+
}
|
|
175
|
+
const purpose = deploymentPurpose(task);
|
|
176
|
+
if (d.productionRequirementRef !== void 0 && !["prod-qualification", "prod-execution"].includes(purpose)) fail3(`${w}.productionRequirementRef 只用于 prod 任务`);
|
|
177
|
+
if (!["analysis", ...Object.keys(PURPOSE_ACTIONS)].includes(purpose)) fail3(`${w} 不支持步骤 ${task.step};purpose 必须明确部署用途`);
|
|
178
|
+
if (purpose === "analysis") {
|
|
124
179
|
for (const field of ["environment", "targetNetwork", "allowedActions", "releaseRef"]) {
|
|
125
180
|
if (d[field] !== void 0) fail3(`${w}.${field} 只能用于执行任务`);
|
|
126
181
|
}
|
|
127
182
|
continue;
|
|
128
183
|
}
|
|
129
|
-
const actions = STEP_ACTIONS[task.step];
|
|
130
|
-
|
|
131
|
-
const environment = ["deploy", "check-code"].includes(task.step) ? "dev" : "prod";
|
|
184
|
+
const actions = d.purpose === void 0 ? STEP_ACTIONS[task.step] : PURPOSE_ACTIONS[purpose];
|
|
185
|
+
const environment = purpose === "dev-execution" ? "dev" : "prod";
|
|
132
186
|
if (d.environment !== environment) fail3(`${w}.environment 在 ${task.step} 中必须是 ${environment}`);
|
|
133
187
|
identifier(d.targetNetwork, `${w}.targetNetwork`, true);
|
|
134
188
|
if (environment === "dev" ? d.targetNetwork !== d.developmentNetwork : !d.releaseTargetNetworks.includes(d.targetNetwork)) {
|
|
135
189
|
fail3(`${w}.targetNetwork 与已声明的 ${environment} 网络不一致`);
|
|
136
190
|
}
|
|
137
191
|
strings(d.allowedActions, `${w}.allowedActions`, actions, 1);
|
|
138
|
-
if (
|
|
192
|
+
if (purpose !== "prod-execution") {
|
|
139
193
|
if (d.releaseRef !== void 0) fail3(`${w}.releaseRef 只用于正式发布任务`);
|
|
140
194
|
continue;
|
|
141
195
|
}
|
|
@@ -150,6 +204,18 @@ function validateEvmContracts(plan, fail3) {
|
|
|
150
204
|
releases.set(releaseKey, metadata);
|
|
151
205
|
}
|
|
152
206
|
}
|
|
207
|
+
for (const task of Object.values(plan.tasks).flat()) {
|
|
208
|
+
const d = task.scope?.deployment;
|
|
209
|
+
if (!d?.requirementRef || deploymentPurpose(task) === "analysis") continue;
|
|
210
|
+
const requirement = JSON.stringify([d.projectRoot, d.requirementRef.planKey, d.requirementRef.rev]);
|
|
211
|
+
const round = JSON.stringify([d.projectRoot, d.deploymentId]);
|
|
212
|
+
const existingRound = requirementRounds.get(requirement);
|
|
213
|
+
if (existingRound !== void 0 && existingRound !== d.deploymentId) fail3(`任务 ${task.planKey}.scope.deployment 同一需求修订必须复用 deploymentId=${existingRound},不能因脚本准备、模拟或执行阶段另建部署轮次`);
|
|
214
|
+
const existingRequirement = roundRequirements.get(round);
|
|
215
|
+
if (existingRequirement !== void 0 && existingRequirement !== requirement) fail3(`任务 ${task.planKey}.scope.deployment 同一 deploymentId 必须引用同一需求修订;新业务轮次使用新 deploymentId`);
|
|
216
|
+
requirementRounds.set(requirement, d.deploymentId);
|
|
217
|
+
roundRequirements.set(round, requirement);
|
|
218
|
+
}
|
|
153
219
|
}
|
|
154
220
|
|
|
155
221
|
// builtin-skills/gateflow-plan/scripts/lib/yaml-lite.mjs
|
|
@@ -386,8 +452,8 @@ var TASK_STATUSES = ["pending", "running", "blocked", "completed", "failed", "ca
|
|
|
386
452
|
var FAILURE_CATEGORIES = ["execution_error", "acceptance_failed", "review_rejected", "input_missing"];
|
|
387
453
|
var CONTRACT_FIELDS = ["objective", "acceptance", "dependsOn", "step", "scope", "parameters", "expectedArtifacts", "allowedChanges"];
|
|
388
454
|
var TOOL_FIELDS = ["tools", "toolsOptional", "skills"];
|
|
389
|
-
var DEF_FIELDS = [...CONTRACT_FIELDS, ...TOOL_FIELDS];
|
|
390
|
-
var PROGRESS_FIELDS = ["status", "adoptedRev", "blockedReason", "cancelReason", "result", "previousResult"];
|
|
455
|
+
var DEF_FIELDS = [...CONTRACT_FIELDS, ...TOOL_FIELDS, "executionNotes"];
|
|
456
|
+
var PROGRESS_FIELDS = ["status", "adoptedRev", "blockedReason", "cancelReason", "result", "previousResult", "requirementConfirmation"];
|
|
391
457
|
var TASK_ORDER = ["no", "planKey", "rev", "title", ...DEF_FIELDS, ...PROGRESS_FIELDS];
|
|
392
458
|
var PlanError = class extends Error {
|
|
393
459
|
constructor(message, code = "invalid") {
|
|
@@ -508,11 +574,11 @@ function parseResult(v, where) {
|
|
|
508
574
|
}
|
|
509
575
|
fail2(`${where}.kind 必须是 success 或 failure`);
|
|
510
576
|
}
|
|
511
|
-
var TOOL_REF = /^(?:plugin:[A-Za-z0-9][A-Za-z0-9._-]{0,99}|mcp:[A-Za-z0-9][A-Za-z0-9._-]{0,99}(?:\/[A-Za-z0-9][A-Za-z0-9._-]{0,99})
|
|
577
|
+
var TOOL_REF = /^(?:plugin:[A-Za-z0-9][A-Za-z0-9._-]{0,99}|mcp:[A-Za-z0-9][A-Za-z0-9._-]{0,99}(?:\/[A-Za-z0-9][A-Za-z0-9._-]{0,99})?|host:[A-Za-z0-9][A-Za-z0-9._-]{0,99})$/;
|
|
512
578
|
function toolRefs(v, where) {
|
|
513
579
|
const refs = strArray(v, where);
|
|
514
580
|
refs.forEach((ref, i) => {
|
|
515
|
-
if (!TOOL_REF.test(ref)) fail2(`${where}[${i}] 不是有效的工具引用:"${ref}"(plugin:<id
|
|
581
|
+
if (!TOOL_REF.test(ref)) fail2(`${where}[${i}] 不是有效的工具引用:"${ref}"(plugin:<id>、mcp:<服务器>[/<工具>] 或 host:<本机 Codex 的 MCP>)`);
|
|
516
582
|
});
|
|
517
583
|
if (new Set(refs).size !== refs.length) fail2(`${where} 有重复的工具`);
|
|
518
584
|
return refs;
|
|
@@ -544,6 +610,7 @@ function parseTaskDef(raw, where) {
|
|
|
544
610
|
t.parameters = raw.parameters;
|
|
545
611
|
}
|
|
546
612
|
if (raw.expectedArtifacts !== void 0) t.expectedArtifacts = strArray(raw.expectedArtifacts, `${where}.expectedArtifacts`);
|
|
613
|
+
if (raw.executionNotes !== void 0) t.executionNotes = strArray(raw.executionNotes, `${where}.executionNotes`);
|
|
547
614
|
if (raw.allowedChanges !== void 0) t.allowedChanges = strArray(raw.allowedChanges, `${where}.allowedChanges`);
|
|
548
615
|
if (raw.tools !== void 0) t.tools = toolRefs(raw.tools, `${where}.tools`);
|
|
549
616
|
if (raw.toolsOptional !== void 0) t.toolsOptional = toolRefs(raw.toolsOptional, `${where}.toolsOptional`);
|
|
@@ -567,6 +634,12 @@ function parseTask(raw, where) {
|
|
|
567
634
|
}
|
|
568
635
|
if (raw.blockedReason !== void 0) t.blockedReason = str(raw.blockedReason, `${where}.blockedReason`);
|
|
569
636
|
if (raw.cancelReason !== void 0) t.cancelReason = str(raw.cancelReason, `${where}.cancelReason`);
|
|
637
|
+
if (raw.requirementConfirmation !== void 0) {
|
|
638
|
+
const c = raw.requirementConfirmation;
|
|
639
|
+
if (!isObject2(c) || Object.keys(c).some((k) => !["rev", "confirmedAt"].includes(k))) fail2(`${where}.requirementConfirmation 无效`);
|
|
640
|
+
t.requirementConfirmation = { rev: posInt(c.rev, `${where}.requirementConfirmation.rev`), confirmedAt: str(c.confirmedAt, `${where}.requirementConfirmation.confirmedAt`) };
|
|
641
|
+
if (c.rev > t.rev || !Number.isFinite(Date.parse(c.confirmedAt))) fail2(`${where}.requirementConfirmation 修订或时间无效`);
|
|
642
|
+
}
|
|
570
643
|
const result = parseResult(raw.result, `${where}.result`);
|
|
571
644
|
if (result) t.result = result;
|
|
572
645
|
const previous = parseResult(raw.previousResult, `${where}.previousResult`);
|
|
@@ -747,7 +820,6 @@ function parsePlan(text) {
|
|
|
747
820
|
|
|
748
821
|
// builtin-skills/gateflow-plan/scripts/lib/read-only.mjs
|
|
749
822
|
var DEFINITION_CONTRACT = "gateflow-plan/definition@1";
|
|
750
|
-
var RELEASE_STEPS = /* @__PURE__ */ new Set(["release-prepare", "release-execute", "release-verify"]);
|
|
751
823
|
function freeze(value) {
|
|
752
824
|
if (value && typeof value === "object") {
|
|
753
825
|
Object.values(value).forEach(freeze);
|
|
@@ -774,9 +846,11 @@ function projectDefinitions(text, selection) {
|
|
|
774
846
|
if (selected.has(key2)) return;
|
|
775
847
|
const entry = byKey.get(key2);
|
|
776
848
|
if (!entry) throw new PlanError(`Definition root/dependency missing: ${key2}`);
|
|
777
|
-
if (selection.mode === "upstream" &&
|
|
849
|
+
if (selection.mode === "upstream" && deploymentPurpose(entry.task) === "prod-execution") throw new PlanError(`Upstream definitions cannot include generated release task: ${key2}`);
|
|
778
850
|
selected.add(key2);
|
|
779
851
|
entry.task.dependsOn.forEach(visit);
|
|
852
|
+
const requirement = entry.task.scope?.deployment?.requirementRef;
|
|
853
|
+
if (requirement) visit(requirement.planKey);
|
|
780
854
|
};
|
|
781
855
|
roots.forEach(visit);
|
|
782
856
|
const entries = line.filter(({ task }) => selected.has(task.planKey));
|
|
@@ -811,8 +885,11 @@ function projectDefinitions(text, selection) {
|
|
|
811
885
|
SCHEMA_V1,
|
|
812
886
|
SKILL_NAME,
|
|
813
887
|
TASK_STATUSES,
|
|
888
|
+
deploymentPurpose,
|
|
889
|
+
deploymentRequirementIssue,
|
|
814
890
|
detectSchema,
|
|
815
891
|
parsePlan,
|
|
892
|
+
productionActionAllowed,
|
|
816
893
|
projectDefinitions,
|
|
817
894
|
skillNames,
|
|
818
895
|
toolRefs,
|
|
@@ -11,6 +11,7 @@ export interface PlanTask {
|
|
|
11
11
|
step?: string; scope?: Record<string, unknown>; parameters?: unknown[]; expectedArtifacts?: string[]; allowedChanges?: string[]
|
|
12
12
|
tools?: string[]; toolsOptional?: string[]; skills?: string[]; status: typeof TASK_STATUSES[number]; adoptedRev?: number
|
|
13
13
|
blockedReason?: string; cancelReason?: string; result?: Record<string, unknown>; previousResult?: Record<string, unknown>
|
|
14
|
+
requirementConfirmation?: { rev: number; confirmedAt: string }
|
|
14
15
|
}
|
|
15
16
|
export interface PlanLane { name: string; state: 'enabled' | 'disabled'; reason?: string; skill?: string; steps?: { id: string; name: string }[] }
|
|
16
17
|
export interface Plan {
|
|
@@ -30,3 +31,8 @@ export function projectDefinitions(text: string, selection: DefinitionSelection)
|
|
|
30
31
|
export function skillNames(value: unknown, where: string): string[]
|
|
31
32
|
export function toolRefs(value: unknown, where: string): string[]
|
|
32
33
|
export function validateEvmContracts(plan: { flow?: string; lanes: Record<string, { skill?: string }>; tasks: Record<string, { planKey: string; step?: string; scope?: Record<string, unknown> }[]> }, fail: (message: string) => never): void
|
|
34
|
+
|
|
35
|
+
export type DeploymentPurpose = 'analysis' | 'dev-execution' | 'prod-qualification' | 'prod-execution'
|
|
36
|
+
export function deploymentPurpose(task: {step?: string; scope?: Record<string, unknown>}): DeploymentPurpose | undefined
|
|
37
|
+
export function productionActionAllowed(task: {step?: string; scope?: Record<string, unknown>}, intent: string): boolean
|
|
38
|
+
export function deploymentRequirementIssue(plan: { tasks: Record<string, {planKey:string;rev:number;status:string;step?:string;scope?:Record<string,unknown>;requirementConfirmation?:{rev:number;confirmedAt:string}}[]> }, task: Pick<PlanTask, 'step' | 'scope' | 'dependsOn'>): string | null
|
|
@@ -4,21 +4,22 @@
|
|
|
4
4
|
"version": 1,
|
|
5
5
|
"schema": "gateflow-plan/v2",
|
|
6
6
|
"definitionContract": "gateflow-plan/definition@1",
|
|
7
|
-
"sourceCommit": "
|
|
7
|
+
"sourceCommit": "ee0f90991ca1a94c3f58c8893df16d0c8c41b230",
|
|
8
|
+
"sourceMode": "working-tree",
|
|
8
9
|
"sources": {
|
|
9
|
-
"builtin-skills/gateflow-plan/scripts/lib/evm-contract.mjs": "
|
|
10
|
-
"builtin-skills/gateflow-plan/scripts/lib/handoff-v2.mjs": "
|
|
11
|
-
"builtin-skills/gateflow-plan/scripts/lib/read-only.d.mts": "
|
|
12
|
-
"builtin-skills/gateflow-plan/scripts/lib/read-only.mjs": "
|
|
10
|
+
"builtin-skills/gateflow-plan/scripts/lib/evm-contract.mjs": "c41dd9e6d630ea033001dd0922911bf365ff2baaa894107f6a80a3019eca1c17",
|
|
11
|
+
"builtin-skills/gateflow-plan/scripts/lib/handoff-v2.mjs": "05c89b794b65d6c73dc2427df8dc1b21f06c377c30f2c3baf8517459b8df56e0",
|
|
12
|
+
"builtin-skills/gateflow-plan/scripts/lib/read-only.d.mts": "716d1252adf79d5c7e6c3b7ed17984203ae3e1853695dc04fa9e769c9ac24c50",
|
|
13
|
+
"builtin-skills/gateflow-plan/scripts/lib/read-only.mjs": "1cb928d76ce14b07028efe002e624d91d36168494b5cc2cc0ba35153a311ff3e",
|
|
13
14
|
"builtin-skills/gateflow-plan/scripts/lib/yaml-lite.mjs": "b53b8322b27bb73bbbf2a4254be4698ee43ec79c27828068954afd6d05902784",
|
|
14
|
-
"scripts/build-plan-codec.mjs": "
|
|
15
|
+
"scripts/build-plan-codec.mjs": "048e647687da5a55a9f1899af510b9f1b0eb0872876e5eef278ede89c53c5d75"
|
|
15
16
|
},
|
|
16
17
|
"builder": {
|
|
17
18
|
"name": "esbuild",
|
|
18
19
|
"version": "0.21.5"
|
|
19
20
|
},
|
|
20
21
|
"artifacts": {
|
|
21
|
-
"index.cjs": "
|
|
22
|
-
"index.d.cts": "
|
|
22
|
+
"index.cjs": "1014b59dad45b47510602791e426eaf2ee6d58720583670134fa14431b935d0d",
|
|
23
|
+
"index.d.cts": "716d1252adf79d5c7e6c3b7ed17984203ae3e1853695dc04fa9e769c9ac24c50"
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -252,6 +252,7 @@ export const runContractWriteCalls = async (
|
|
|
252
252
|
operation: 0,
|
|
253
253
|
...(zkSync ? { scheme: "zksync-eravm" as const, factoryDeps: [] } : {}),
|
|
254
254
|
});
|
|
255
|
+
context.calldataReview?.record(planned, { abi: resolved.contract.interface.fragments, method: call.method, args });
|
|
255
256
|
if (planned.executionAction === "replay") {
|
|
256
257
|
context.reporter.result("execution", {
|
|
257
258
|
stepId: planned.stepId,
|
|
@@ -657,6 +657,7 @@ const manifestIsCurrent = (input: {
|
|
|
657
657
|
proxyAddress: string;
|
|
658
658
|
implementationAddress: string;
|
|
659
659
|
storageLayoutHash: string;
|
|
660
|
+
proxyKind?: string;
|
|
660
661
|
}): boolean => {
|
|
661
662
|
const proxy = input.proxyAddress.toLowerCase();
|
|
662
663
|
const implementation = input.implementationAddress.toLowerCase();
|
|
@@ -669,6 +670,7 @@ const manifestIsCurrent = (input: {
|
|
|
669
670
|
isRecord(item)
|
|
670
671
|
&& typeof item.address === "string"
|
|
671
672
|
&& item.address.toLowerCase() === proxy
|
|
673
|
+
&& (input.proxyKind === undefined || item.kind === input.proxyKind)
|
|
672
674
|
));
|
|
673
675
|
}
|
|
674
676
|
if (isRecord(document.impls)) {
|
|
@@ -1114,7 +1116,7 @@ export const runCheckCode = async (
|
|
|
1114
1116
|
manifestFile: exactManifest.relative,
|
|
1115
1117
|
beforeHash,
|
|
1116
1118
|
};
|
|
1117
|
-
if (metadata?.proxyKind === "uups" && !implementationAddress) {
|
|
1119
|
+
if ((metadata?.proxyKind === "uups" || metadata?.proxyKind === "transparent") && !implementationAddress) {
|
|
1118
1120
|
entries.push({ ...base, syncStatus: "failed", afterHash: directoryHash(directory) });
|
|
1119
1121
|
continue;
|
|
1120
1122
|
}
|
|
@@ -1135,11 +1137,11 @@ export const runCheckCode = async (
|
|
|
1135
1137
|
}
|
|
1136
1138
|
continue;
|
|
1137
1139
|
}
|
|
1138
|
-
if (!implementationAddress || metadata?.proxyKind && metadata.proxyKind !== "uups") {
|
|
1140
|
+
if (!implementationAddress || metadata?.proxyKind && metadata.proxyKind !== "uups" && metadata.proxyKind !== "transparent") {
|
|
1139
1141
|
entries.push({ ...base, syncStatus: "not_required", afterHash: directoryHash(directory) });
|
|
1140
1142
|
continue;
|
|
1141
1143
|
}
|
|
1142
|
-
if (!metadata || metadata.proxyKind !== "uups") {
|
|
1144
|
+
if (!metadata || (metadata.proxyKind !== "uups" && metadata.proxyKind !== "transparent")) {
|
|
1143
1145
|
entries.push({ ...base, syncStatus: "proxy_kind_unknown", afterHash: directoryHash(directory) });
|
|
1144
1146
|
continue;
|
|
1145
1147
|
}
|
|
@@ -1159,6 +1161,7 @@ export const runCheckCode = async (
|
|
|
1159
1161
|
proxyAddress: selected.address,
|
|
1160
1162
|
implementationAddress,
|
|
1161
1163
|
storageLayoutHash,
|
|
1164
|
+
proxyKind:metadata.proxyKind,
|
|
1162
1165
|
})) {
|
|
1163
1166
|
entries.push({ ...base, syncStatus: "already_current", afterHash: beforeHash });
|
|
1164
1167
|
continue;
|
|
@@ -1178,6 +1181,7 @@ export const runCheckCode = async (
|
|
|
1178
1181
|
"--target",
|
|
1179
1182
|
selected.network,
|
|
1180
1183
|
"--skip-tx-hash",
|
|
1184
|
+
...(metadata.proxyKind === "transparent" ? ["--proxy-kind","transparent","--proxy-admin-address",metadata.proxyAdminAddress??"","--proxy-admin-owner",metadata.proxyAdminOwner??""] : []),
|
|
1181
1185
|
], {
|
|
1182
1186
|
network: selected.network,
|
|
1183
1187
|
scheme,
|
|
@@ -67,6 +67,7 @@ export interface WorkflowContext {
|
|
|
67
67
|
validation?: WorkflowValidationPort;
|
|
68
68
|
pendingUupsReuse?: PendingUupsResolverPort;
|
|
69
69
|
verification?: VerificationSink;
|
|
70
|
+
calldataReview?: import('../../delivery/calldata-review').CalldataReviewSink;
|
|
70
71
|
deploymentRecorder?: DeploymentRecorder;
|
|
71
72
|
executionPlanner?: TransactionPlannerPort;
|
|
72
73
|
externalCalls: ExternalCall[];
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { resolveWorkflowValue, type Create2FieldKind } from './validation';
|
|
2
2
|
import type { Signer } from "ethers";
|
|
3
|
-
import { getAddress,
|
|
3
|
+
import { getAddress, isAddress } from "ethers";
|
|
4
4
|
import { WorkflowStep } from "./parameters";
|
|
5
5
|
import type { WorkflowContext } from "./context";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export type Create2Scheme = "evm" | "zksync-eravm";
|
|
13
|
-
|
|
7
|
+
import { prepareControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
8
|
+
import type { PreparedWorkflowTransaction, PreparedControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
9
|
+
export { prepareControlledMulticallTransaction } from 'gate-evm-tools/workflow';
|
|
10
|
+
export type { PreparedWorkflowTransaction, PreparedControlledMulticallTransaction, ControlledMulticallInnerCall } from 'gate-evm-tools/workflow';
|
|
11
|
+
export type Create2Scheme = 'evm' | 'zksync-eravm';
|
|
14
12
|
export interface Create2Options {
|
|
15
13
|
scheme: Create2Scheme;
|
|
16
14
|
factory: string;
|
|
@@ -23,106 +21,7 @@ export interface Create2Options {
|
|
|
23
21
|
uupsPlaceholderImplementation?: string;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
target: string;
|
|
28
|
-
value: string;
|
|
29
|
-
data: string;
|
|
30
|
-
operation: 0;
|
|
31
|
-
scheme?: "zksync-eravm";
|
|
32
|
-
factoryDeps?: string[];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ControlledMulticallInnerCall {
|
|
36
|
-
target: string;
|
|
37
|
-
value: string;
|
|
38
|
-
data: string;
|
|
39
|
-
factoryDeps?: string[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface PreparedControlledMulticallTransaction
|
|
43
|
-
extends PreparedWorkflowTransaction {
|
|
44
|
-
method: "aggregate3" | "aggregate3Value";
|
|
45
|
-
calls: Array<{
|
|
46
|
-
target: string;
|
|
47
|
-
allowFailure: false;
|
|
48
|
-
value: string;
|
|
49
|
-
callData: string;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface SentTransaction {
|
|
54
|
-
hash: string;
|
|
55
|
-
wait: () => Promise<unknown>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const bigintValue = (value: string | undefined): bigint => {
|
|
59
|
-
if (!value || value === "0") return 0n;
|
|
60
|
-
const parsed = BigInt(value);
|
|
61
|
-
if (parsed < 0n) throw new Error("transaction value must be nonnegative");
|
|
62
|
-
return parsed;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const normalizeFactoryDeps = (
|
|
66
|
-
input: string[],
|
|
67
|
-
label: string,
|
|
68
|
-
): string[] => {
|
|
69
|
-
const seen = new Set<string>();
|
|
70
|
-
const output: string[] = [];
|
|
71
|
-
for (const [index, dependency] of input.entries()) {
|
|
72
|
-
if (!/^0x(?:[0-9a-fA-F]{2})+$/.test(dependency)) {
|
|
73
|
-
throw new Error(`${label}[${index}] must be non-empty byte-aligned bytecode`);
|
|
74
|
-
}
|
|
75
|
-
const normalized = dependency.toLowerCase();
|
|
76
|
-
if (seen.has(normalized)) continue;
|
|
77
|
-
seen.add(normalized);
|
|
78
|
-
output.push(normalized);
|
|
79
|
-
}
|
|
80
|
-
return output;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const prepareControlledMulticallTransaction = (
|
|
84
|
-
controlledMulticall: string,
|
|
85
|
-
inputCalls: ControlledMulticallInnerCall[],
|
|
86
|
-
scheme: Create2Scheme = "evm",
|
|
87
|
-
): PreparedControlledMulticallTransaction => {
|
|
88
|
-
if (!isAddress(controlledMulticall)) {
|
|
89
|
-
throw new Error("controlledMulticall must be an EVM address");
|
|
90
|
-
}
|
|
91
|
-
if (inputCalls.length === 0) {
|
|
92
|
-
throw new Error("controlled multicall requires at least one inner call");
|
|
93
|
-
}
|
|
94
|
-
if (scheme === "evm" && inputCalls.some((call) => call.factoryDeps !== undefined)) {
|
|
95
|
-
throw new Error("factoryDeps are only supported for zkSync transactions");
|
|
96
|
-
}
|
|
97
|
-
if (scheme === "zksync-eravm" && inputCalls.some((call) => call.factoryDeps === undefined)) {
|
|
98
|
-
throw new Error("every zkSync GateTool call must include factoryDeps");
|
|
99
|
-
}
|
|
100
|
-
const calls = inputCalls.map((call) => ({
|
|
101
|
-
target: getAddress(call.target),
|
|
102
|
-
allowFailure: false as const,
|
|
103
|
-
value: bigintValue(call.value).toString(10),
|
|
104
|
-
callData: call.data,
|
|
105
|
-
}));
|
|
106
|
-
const totalValue = calls.reduce((sum, call) => sum + BigInt(call.value), 0n);
|
|
107
|
-
const method = totalValue === 0n ? "aggregate3" as const : "aggregate3Value" as const;
|
|
108
|
-
const encodedCalls = method === "aggregate3"
|
|
109
|
-
? calls.map(({ value: _value, ...call }) => call)
|
|
110
|
-
: calls;
|
|
111
|
-
const factoryDeps = scheme === "zksync-eravm"
|
|
112
|
-
? normalizeFactoryDeps(inputCalls.flatMap((call) => call.factoryDeps!), "factoryDeps")
|
|
113
|
-
: undefined;
|
|
114
|
-
return {
|
|
115
|
-
target: getAddress(controlledMulticall),
|
|
116
|
-
value: totalValue.toString(10),
|
|
117
|
-
data: CONTROLLED_MULTICALL_INTERFACE.encodeFunctionData(method, [encodedCalls]),
|
|
118
|
-
operation: 0,
|
|
119
|
-
method,
|
|
120
|
-
calls,
|
|
121
|
-
...(scheme === "zksync-eravm"
|
|
122
|
-
? { scheme: "zksync-eravm" as const, factoryDeps: factoryDeps! }
|
|
123
|
-
: {}),
|
|
124
|
-
};
|
|
125
|
-
};
|
|
24
|
+
interface SentTransaction { hash:string; wait:()=>Promise<unknown>; }
|
|
126
25
|
|
|
127
26
|
export const sendPreparedWorkflowTransaction = async (
|
|
128
27
|
prepared: PreparedWorkflowTransaction,
|
|
@@ -11,6 +11,8 @@ export interface DeploymentInfoEntry {
|
|
|
11
11
|
actualContract: string;
|
|
12
12
|
proxyKind?: "uups" | "transparent";
|
|
13
13
|
implementationAddress?: string;
|
|
14
|
+
proxyAdminAddress?: string;
|
|
15
|
+
proxyAdminOwner?: string;
|
|
14
16
|
source: DeploymentInfoSource;
|
|
15
17
|
updatedAt: string;
|
|
16
18
|
}
|
|
@@ -114,6 +116,8 @@ const validateEntry = (value: unknown, label: string): DeploymentInfoEntry => {
|
|
|
114
116
|
"actualContract",
|
|
115
117
|
"proxyKind",
|
|
116
118
|
"implementationAddress",
|
|
119
|
+
"proxyAdminAddress",
|
|
120
|
+
"proxyAdminOwner",
|
|
117
121
|
"source",
|
|
118
122
|
"updatedAt",
|
|
119
123
|
]);
|
|
@@ -140,6 +144,8 @@ const validateEntry = (value: unknown, label: string): DeploymentInfoEntry => {
|
|
|
140
144
|
...(value.implementationAddress
|
|
141
145
|
? { implementationAddress: address(value.implementationAddress, `${label}.implementationAddress`) }
|
|
142
146
|
: {}),
|
|
147
|
+
...(value.proxyAdminAddress?{proxyAdminAddress:address(value.proxyAdminAddress,`${label}.proxyAdminAddress`)}:{}),
|
|
148
|
+
...(value.proxyAdminOwner?{proxyAdminOwner:address(value.proxyAdminOwner,`${label}.proxyAdminOwner`)}:{}),
|
|
143
149
|
source: validateSource(value.source, `${label}.source`),
|
|
144
150
|
updatedAt: value.updatedAt,
|
|
145
151
|
};
|
|
@@ -243,6 +249,7 @@ export function prepareDeploymentInfoFromRecords(input: {
|
|
|
243
249
|
actualContract,
|
|
244
250
|
...(proxyKind ? { proxyKind } : {}),
|
|
245
251
|
...(implementationAddress ? { implementationAddress } : {}),
|
|
252
|
+
...(proxyKind === "transparent" ? {proxyAdminAddress:optionalAddress(rawChange.proxyAdminAddress??existing?.proxyAdminAddress,"ProxyAdmin address"),proxyAdminOwner:optionalAddress(rawChange.proxyAdminOwner??existing?.proxyAdminOwner,"ProxyAdmin owner")}:{}),
|
|
246
253
|
source: {
|
|
247
254
|
kind: "deployment" as const,
|
|
248
255
|
deploymentId,
|
|
@@ -259,6 +266,7 @@ export function prepareDeploymentInfoFromRecords(input: {
|
|
|
259
266
|
...(existing.implementationAddress
|
|
260
267
|
? { implementationAddress: existing.implementationAddress }
|
|
261
268
|
: {}),
|
|
269
|
+
...(existing.proxyKind === "transparent" ? {proxyAdminAddress:existing.proxyAdminAddress,proxyAdminOwner:existing.proxyAdminOwner}:{}),
|
|
262
270
|
source: existing.source,
|
|
263
271
|
}
|
|
264
272
|
: undefined;
|
|
@@ -63,6 +63,8 @@ export interface DeploymentChange {
|
|
|
63
63
|
proxyKind?: string;
|
|
64
64
|
address?: string;
|
|
65
65
|
proxyAddress?: string;
|
|
66
|
+
proxyAdminAddress?: string;
|
|
67
|
+
proxyAdminOwner?: string;
|
|
66
68
|
implementationAddress?: string;
|
|
67
69
|
preparedImplementationAddress?: string;
|
|
68
70
|
placeholderImplementationAddress?: string;
|
|
@@ -272,7 +274,7 @@ export class DeploymentRecorder {
|
|
|
272
274
|
throw new Error("Deployment proxy transactionId is invalid");
|
|
273
275
|
}
|
|
274
276
|
const change = this.record.changes.find((entry) => entry.stepId === stepId);
|
|
275
|
-
if (!change || change.proxyKind !== "uups") {
|
|
277
|
+
if (!change || (change.proxyKind !== "uups" && change.proxyKind !== "transparent")) {
|
|
276
278
|
throw new Error(`Cannot bind a proxy transaction for deployment change ${stepId}`);
|
|
277
279
|
}
|
|
278
280
|
if (
|
|
@@ -790,7 +790,7 @@ export const reconcileExternalExecution = async (input: {
|
|
|
790
790
|
orderedMatches.map((match) => [match.transactionId, match]),
|
|
791
791
|
);
|
|
792
792
|
for (const change of deployment.changes) {
|
|
793
|
-
if (change.proxyKind !== "uups") continue;
|
|
793
|
+
if (change.proxyKind !== "uups" && change.proxyKind !== "transparent") continue;
|
|
794
794
|
if (
|
|
795
795
|
!change.proxyAddress
|
|
796
796
|
|| !change.implementationAddress
|
|
@@ -846,6 +846,7 @@ export const reconcileExternalExecution = async (input: {
|
|
|
846
846
|
target: input.network,
|
|
847
847
|
manifestDir: target.openzeppelin.manifestDir,
|
|
848
848
|
proxy: change.proxyAddress,
|
|
849
|
+
...(change.proxyKind === 'transparent'?{proxyKind:'transparent' as const,proxyAdminAddress:change.proxyAdminAddress,proxyAdminOwner:change.proxyAdminOwner}:{}),
|
|
849
850
|
implementation: change.implementationAddress,
|
|
850
851
|
contract: change.actualContract,
|
|
851
852
|
constructorArgs: change.constructorArgs,
|
|
@@ -162,7 +162,7 @@ export const expectedTransactionPurposes = (
|
|
|
162
162
|
if (plan.kind === "create2-deploy") {
|
|
163
163
|
return requiredRoles.has("contract") ? ["deploy-contract"] : [];
|
|
164
164
|
}
|
|
165
|
-
if (plan.kind === "uups-placeholder-deploy") {
|
|
165
|
+
if (plan.kind === "uups-placeholder-deploy" || plan.kind === "transparent-deploy") {
|
|
166
166
|
if (!requiredRoles.has("proxy")) {
|
|
167
167
|
if (requiredRoles.has("implementation")) {
|
|
168
168
|
throw new Error(
|
|
@@ -174,7 +174,7 @@ export const expectedTransactionPurposes = (
|
|
|
174
174
|
return [
|
|
175
175
|
...(requiredRoles.has("implementation") ? ["deploy-implementation" as const] : []),
|
|
176
176
|
"deploy-proxy",
|
|
177
|
-
"upgrade-proxy",
|
|
177
|
+
...(plan.kind === "uups-placeholder-deploy" ? ["upgrade-proxy" as const] : []),
|
|
178
178
|
];
|
|
179
179
|
}
|
|
180
180
|
return [
|
|
@@ -20,6 +20,9 @@ export interface SyncGateToolUupsOptions {
|
|
|
20
20
|
target: string;
|
|
21
21
|
manifestDir: string;
|
|
22
22
|
proxy: string;
|
|
23
|
+
proxyKind?: "uups" | "transparent";
|
|
24
|
+
proxyAdminAddress?: string;
|
|
25
|
+
proxyAdminOwner?: string;
|
|
23
26
|
implementation: string;
|
|
24
27
|
contract: string;
|
|
25
28
|
constructorArgs: unknown[];
|
|
@@ -163,6 +166,9 @@ const validateEvidenceIdentity = (
|
|
|
163
166
|
|| raw.scheme !== options.scheme
|
|
164
167
|
|| raw.network !== options.network
|
|
165
168
|
|| raw.target !== options.target
|
|
169
|
+
|| raw.proxyKind !== options.proxyKind
|
|
170
|
+
|| raw.proxyAdminAddress !== options.proxyAdminAddress
|
|
171
|
+
|| raw.proxyAdminOwner !== options.proxyAdminOwner
|
|
166
172
|
|| raw.manifestDir !== options.manifestDir
|
|
167
173
|
|| raw.contract !== options.contract
|
|
168
174
|
|| JSON.stringify(raw.constructorArgs) !== JSON.stringify(options.constructorArgs)
|
|
@@ -239,6 +245,7 @@ const buildSyncEvidence = (
|
|
|
239
245
|
network: options.network,
|
|
240
246
|
target: options.target,
|
|
241
247
|
manifestDir: options.manifestDir,
|
|
248
|
+
...(options.proxyKind?{proxyKind:options.proxyKind,proxyAdminAddress:options.proxyAdminAddress,proxyAdminOwner:options.proxyAdminOwner}:{}),
|
|
242
249
|
proxy: options.proxy.toLowerCase(),
|
|
243
250
|
implementation: options.implementation.toLowerCase(),
|
|
244
251
|
contract: options.contract,
|
|
@@ -335,6 +342,7 @@ export const syncGateToolUups = async (
|
|
|
335
342
|
network: options.network,
|
|
336
343
|
target: options.target,
|
|
337
344
|
proxy: options.proxy,
|
|
345
|
+
...(options.proxyKind?{proxyKind:options.proxyKind,proxyAdminAddress:options.proxyAdminAddress,proxyAdminOwner:options.proxyAdminOwner}:{}),
|
|
338
346
|
contract: options.contract,
|
|
339
347
|
constructorArgs: options.constructorArgs,
|
|
340
348
|
...(options.scheme === "evm"
|
|
@@ -246,6 +246,10 @@ export const validateDeployCreate2Strategy = (steps: WorkflowStep[]): void => {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
if (step.proxy !== undefined) {
|
|
249
|
+
if(asObject(step.proxy).kind === "transparent") {
|
|
250
|
+
if(step.upgradeableStrategy!=="transparent-proxy"||step.firstUpgrade!==undefined)throw new Error(`Deploy step ${step.id} requires transparent-proxy strategy without firstUpgrade`);
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
249
253
|
if (step.upgradeableStrategy !== "uups-placeholder-proxy") {
|
|
250
254
|
throw new Error(`Deploy step ${step.id} requires upgradeableStrategy: uups-placeholder-proxy`);
|
|
251
255
|
}
|