@interf/compiler 0.22.2 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -282
- package/dist/bin-mcp.d.ts +2 -0
- package/dist/bin-mcp.js +63 -0
- package/dist/bin-runtime.d.ts +2 -0
- package/dist/bin-runtime.js +111 -0
- package/dist/cli/commands/agents.js +4 -35
- package/dist/cli/commands/auth.d.ts +20 -0
- package/dist/cli/commands/auth.js +161 -0
- package/dist/cli/commands/benchmark.d.ts +9 -0
- package/dist/cli/commands/benchmark.js +58 -0
- package/dist/cli/commands/build-plan.js +107 -139
- package/dist/cli/commands/build.d.ts +3 -4
- package/dist/cli/commands/build.js +16 -45
- package/dist/cli/commands/doctor.js +3 -3
- package/dist/cli/commands/graphs.d.ts +2 -0
- package/dist/cli/commands/graphs.js +344 -0
- package/dist/cli/commands/login.js +4 -6
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +4 -2
- package/dist/cli/commands/mcp.js +846 -232
- package/dist/cli/commands/project.d.ts +2 -0
- package/dist/cli/commands/project.js +176 -0
- package/dist/cli/commands/reset.d.ts +3 -4
- package/dist/cli/commands/reset.js +10 -31
- package/dist/cli/commands/runs.js +136 -57
- package/dist/cli/commands/runtime.d.ts +24 -0
- package/dist/cli/commands/runtime.js +373 -0
- package/dist/cli/commands/status.d.ts +1 -0
- package/dist/cli/commands/status.js +35 -45
- package/dist/cli/commands/traces.d.ts +2 -0
- package/dist/cli/commands/traces.js +97 -0
- package/dist/cli/commands/wizard.js +171 -178
- package/dist/cli/index.d.ts +7 -4
- package/dist/cli/index.js +13 -7
- package/dist/cli/lib/http-client.d.ts +39 -0
- package/dist/cli/lib/http-client.js +73 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/build-plans/authoring/brief.d.ts +538 -0
- package/dist/packages/build-plans/authoring/brief.js +89 -0
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +52 -11
- package/dist/packages/build-plans/authoring/build-plan-authoring.js +493 -46
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +10 -1
- package/dist/packages/build-plans/authoring/build-plan-edit-session.js +27 -4
- package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +9 -6
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +97 -46
- package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.d.ts +1 -0
- package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.js +7 -7
- package/dist/packages/build-plans/build-plan-resolution.d.ts +1 -1
- package/dist/packages/build-plans/build-plan-resolution.js +3 -3
- package/dist/packages/build-plans/index.d.ts +1 -1
- package/dist/packages/build-plans/index.js +1 -1
- package/dist/packages/build-plans/package/build-plan-definitions.d.ts +14 -13
- package/dist/packages/build-plans/package/build-plan-definitions.js +45 -42
- package/dist/packages/build-plans/package/build-plan-helpers.d.ts +3 -2
- package/dist/packages/build-plans/package/build-plan-helpers.js +27 -13
- package/dist/packages/build-plans/package/build-plan-review-paths.d.ts +5 -5
- package/dist/packages/build-plans/package/build-plan-review-paths.js +15 -15
- package/dist/packages/build-plans/package/build-plan-stage-runner.d.ts +5 -4
- package/dist/packages/build-plans/package/build-plan-stage-runner.js +23 -11
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +7 -8
- package/dist/packages/build-plans/package/builtin-build-plan.js +10 -11
- package/dist/packages/build-plans/package/context-interface.d.ts +14 -9
- package/dist/packages/build-plans/package/context-interface.js +14 -33
- package/dist/packages/build-plans/package/interf-build-plan-package.d.ts +6 -17
- package/dist/packages/build-plans/package/interf-build-plan-package.js +68 -64
- package/dist/packages/build-plans/package/local-build-plans.d.ts +21 -14
- package/dist/packages/build-plans/package/local-build-plans.js +105 -55
- package/dist/packages/build-plans/package/user-build-plans.js +1 -1
- package/dist/packages/contracts/index.d.ts +5 -2
- package/dist/packages/contracts/index.js +3 -1
- package/dist/packages/contracts/lib/context-graph-layer.d.ts +161 -0
- package/dist/packages/contracts/lib/context-graph-layer.js +216 -0
- package/dist/packages/contracts/lib/project-paths.d.ts +144 -0
- package/dist/packages/contracts/lib/project-paths.js +220 -0
- package/dist/packages/contracts/lib/project-schema.d.ts +423 -0
- package/dist/packages/contracts/lib/project-schema.js +138 -0
- package/dist/packages/contracts/lib/schema.d.ts +1273 -81
- package/dist/packages/contracts/lib/schema.js +675 -79
- package/dist/packages/contracts/utils/filesystem.d.ts +1 -0
- package/dist/packages/contracts/utils/filesystem.js +29 -1
- package/dist/packages/contracts/utils/parse.js +67 -0
- package/dist/packages/projects/index.d.ts +6 -0
- package/dist/packages/{project → projects}/index.js +0 -3
- package/dist/packages/{project → projects}/interf-detect.d.ts +12 -12
- package/dist/packages/{project → projects}/interf-detect.js +56 -50
- package/dist/packages/projects/interf.d.ts +2 -0
- package/dist/packages/projects/interf.js +1 -0
- package/dist/packages/projects/lib/schema.d.ts +77 -0
- package/dist/packages/projects/lib/schema.js +91 -0
- package/dist/packages/projects/source-config.d.ts +53 -0
- package/dist/packages/projects/source-config.js +339 -0
- package/dist/packages/projects/source-folders.d.ts +11 -0
- package/dist/packages/{project → projects}/source-folders.js +26 -26
- package/dist/packages/{engine → runtime}/action-planner.d.ts +1 -1
- package/dist/packages/{engine → runtime}/action-planner.js +20 -22
- package/dist/packages/runtime/action-values.d.ts +1 -0
- package/dist/packages/runtime/action-values.js +1 -0
- package/dist/packages/runtime/actions/errors.d.ts +2 -0
- package/dist/packages/runtime/actions/errors.js +12 -0
- package/dist/packages/runtime/actions/fields.d.ts +86 -0
- package/dist/packages/runtime/actions/form-builders.d.ts +14 -0
- package/dist/packages/runtime/actions/form-builders.js +667 -0
- package/dist/packages/runtime/actions/form-validators.d.ts +8 -0
- package/dist/packages/runtime/actions/form-validators.js +134 -0
- package/dist/packages/runtime/actions/helpers.d.ts +11 -0
- package/dist/packages/runtime/actions/helpers.js +80 -0
- package/dist/packages/runtime/actions/index.d.ts +8 -0
- package/dist/packages/runtime/actions/index.js +11 -0
- package/dist/packages/runtime/actions/registry.d.ts +64 -0
- package/dist/packages/runtime/actions/registry.js +62 -0
- package/dist/packages/runtime/actions/requests.d.ts +45 -0
- package/dist/packages/runtime/actions/requests.js +164 -0
- package/dist/packages/runtime/actions/schemas.d.ts +161 -0
- package/dist/packages/runtime/actions/schemas.js +37 -0
- package/dist/packages/runtime/agent-handoff.d.ts +11 -0
- package/dist/packages/runtime/agent-handoff.js +102 -0
- package/dist/packages/{engine → runtime}/agents/index.d.ts +1 -2
- package/dist/packages/{engine → runtime}/agents/index.js +1 -2
- package/dist/packages/runtime/agents/lib/args.d.ts +14 -0
- package/dist/packages/runtime/agents/lib/args.js +24 -0
- package/dist/packages/{engine → runtime}/agents/lib/constants.d.ts +4 -1
- package/dist/packages/runtime/agents/lib/constants.js +13 -0
- package/dist/packages/runtime/agents/lib/context-graph-bootstrap.d.ts +3 -0
- package/dist/packages/{engine/agents/lib/verifiable-context-bootstrap.js → runtime/agents/lib/context-graph-bootstrap.js} +5 -6
- package/dist/packages/{engine → runtime}/agents/lib/detection.d.ts +5 -0
- package/dist/packages/{engine → runtime}/agents/lib/detection.js +16 -7
- package/dist/packages/{engine → runtime}/agents/lib/execution-profile.d.ts +14 -0
- package/dist/packages/{engine → runtime}/agents/lib/execution-profile.js +31 -14
- package/dist/packages/{engine → runtime}/agents/lib/execution.js +22 -6
- package/dist/packages/{engine → runtime}/agents/lib/executors.d.ts +1 -0
- package/dist/packages/{engine → runtime}/agents/lib/executors.js +11 -2
- package/dist/packages/runtime/agents/lib/logs.d.ts +12 -0
- package/dist/packages/runtime/agents/lib/logs.js +41 -0
- package/dist/packages/{engine → runtime}/agents/lib/preflight.js +19 -14
- package/dist/packages/runtime/agents/lib/render.d.ts +26 -0
- package/dist/packages/{engine → runtime}/agents/lib/render.js +48 -22
- package/dist/packages/runtime/agents/lib/shell-fs.d.ts +18 -0
- package/dist/packages/runtime/agents/lib/shell-fs.js +190 -0
- package/dist/packages/runtime/agents/lib/shell-paths.d.ts +16 -0
- package/dist/packages/runtime/agents/lib/shell-paths.js +63 -0
- package/dist/packages/runtime/agents/lib/shell-projection.d.ts +25 -0
- package/dist/packages/runtime/agents/lib/shell-projection.js +314 -0
- package/dist/packages/runtime/agents/lib/shell-templates.d.ts +30 -0
- package/dist/packages/runtime/agents/lib/shell-templates.js +494 -0
- package/dist/packages/runtime/agents/lib/shell-workspace.d.ts +17 -0
- package/dist/packages/runtime/agents/lib/shell-workspace.js +70 -0
- package/dist/packages/runtime/agents/lib/shells.d.ts +92 -0
- package/dist/packages/runtime/agents/lib/shells.js +509 -0
- package/dist/packages/runtime/agents/lib/source-context-scan.d.ts +10 -0
- package/dist/packages/runtime/agents/lib/source-context-scan.js +388 -0
- package/dist/packages/{engine → runtime}/agents/lib/status.js +1 -14
- package/dist/packages/runtime/agents/lib/string-utils.d.ts +16 -0
- package/dist/packages/runtime/agents/lib/string-utils.js +36 -0
- package/dist/packages/{engine → runtime}/agents/lib/types.d.ts +1 -0
- package/dist/packages/{engine → runtime}/agents/lib/user-config.d.ts +8 -2
- package/dist/packages/{engine → runtime}/agents/lib/user-config.js +8 -2
- package/dist/packages/runtime/agents/providers/claude-code.d.ts +13 -0
- package/dist/packages/runtime/agents/providers/claude-code.js +45 -0
- package/dist/packages/runtime/agents/providers/codex.d.ts +17 -0
- package/dist/packages/runtime/agents/providers/codex.js +66 -0
- package/dist/packages/runtime/agents/providers/cursor.d.ts +9 -0
- package/dist/packages/runtime/agents/providers/cursor.js +24 -0
- package/dist/packages/runtime/agents/providers/index.d.ts +9 -0
- package/dist/packages/runtime/agents/providers/index.js +31 -0
- package/dist/packages/runtime/agents/providers/types.d.ts +50 -0
- package/dist/packages/{engine → runtime}/agents/registry.d.ts +13 -2
- package/dist/packages/{engine → runtime}/agents/registry.js +48 -10
- package/dist/packages/{engine → runtime}/agents/role-executors.d.ts +1 -1
- package/dist/packages/{engine → runtime}/agents/role-executors.js +9 -7
- package/dist/packages/{engine → runtime}/agents/role-router.js +7 -5
- package/dist/packages/runtime/auth/account-context.d.ts +52 -0
- package/dist/packages/runtime/auth/account-context.js +68 -0
- package/dist/packages/runtime/auth/auth-flow.d.ts +73 -0
- package/dist/packages/runtime/auth/auth-flow.js +189 -0
- package/dist/packages/runtime/auth/jwt-validator.d.ts +58 -0
- package/dist/packages/runtime/auth/jwt-validator.js +86 -0
- package/dist/packages/runtime/auth/keychain.d.ts +35 -0
- package/dist/packages/runtime/auth/keychain.js +85 -0
- package/dist/packages/runtime/auth/session-store.d.ts +38 -0
- package/dist/packages/runtime/auth/session-store.js +96 -0
- package/dist/packages/runtime/auth/workos-client.d.ts +58 -0
- package/dist/packages/runtime/auth/workos-client.js +87 -0
- package/dist/packages/runtime/benchmark-question-draft.d.ts +23 -0
- package/dist/packages/runtime/benchmark-question-draft.js +153 -0
- package/dist/packages/runtime/build/artifact-counts.d.ts +1 -0
- package/dist/packages/{engine → runtime}/build/artifact-counts.js +5 -9
- package/dist/packages/{engine → runtime}/build/artifact-status.d.ts +6 -6
- package/dist/packages/{engine → runtime}/build/artifact-status.js +26 -24
- package/dist/packages/runtime/build/atomic-fs.d.ts +3 -0
- package/dist/packages/runtime/build/atomic-fs.js +95 -0
- package/dist/packages/runtime/build/billing-events.d.ts +78 -0
- package/dist/packages/{engine → runtime}/build/billing-events.js +17 -19
- package/dist/packages/runtime/build/build-evidence.d.ts +16 -0
- package/dist/packages/runtime/build/build-evidence.js +179 -0
- package/dist/packages/{engine → runtime}/build/build-pipeline.d.ts +12 -8
- package/dist/packages/runtime/build/build-pipeline.js +388 -0
- package/dist/packages/{engine → runtime}/build/build-plan-primitives.d.ts +1 -1
- package/dist/packages/{engine → runtime}/build/build-plan-primitives.js +0 -1
- package/dist/packages/runtime/build/build-plan-runs.d.ts +14 -0
- package/dist/packages/runtime/build/build-plan-runs.js +31 -0
- package/dist/packages/runtime/build/build-stage-plan.d.ts +16 -0
- package/dist/packages/runtime/build/build-stage-plan.js +101 -0
- package/dist/packages/{engine → runtime}/build/build-stage-runner.d.ts +2 -1
- package/dist/packages/runtime/build/build-stage-runner.js +302 -0
- package/dist/packages/{engine → runtime}/build/build-target.d.ts +7 -4
- package/dist/packages/runtime/build/build-target.js +40 -0
- package/dist/packages/{engine → runtime}/build/check-evaluator.d.ts +14 -16
- package/dist/packages/runtime/build/check-evaluator.js +1226 -0
- package/dist/packages/runtime/build/context-graph-paths.d.ts +64 -0
- package/dist/packages/runtime/build/context-graph-paths.js +160 -0
- package/dist/packages/runtime/build/context-graph-schema.d.ts +19 -0
- package/dist/packages/runtime/build/context-graph-schema.js +39 -0
- package/dist/packages/{engine → runtime}/build/discovery.d.ts +2 -2
- package/dist/packages/{engine → runtime}/build/discovery.js +4 -4
- package/dist/packages/{engine → runtime}/build/index.d.ts +7 -5
- package/dist/packages/{engine → runtime}/build/index.js +7 -5
- package/dist/packages/runtime/build/inspect-map.d.ts +10 -0
- package/dist/packages/runtime/build/inspect-map.js +270 -0
- package/dist/packages/{engine → runtime}/build/lib/schema.d.ts +449 -123
- package/dist/packages/runtime/build/lib/schema.js +494 -0
- package/dist/packages/runtime/build/native-entrypoint.d.ts +2 -0
- package/dist/packages/runtime/build/native-entrypoint.js +286 -0
- package/dist/packages/runtime/build/reset.d.ts +2 -0
- package/dist/packages/runtime/build/reset.js +62 -0
- package/dist/packages/{engine → runtime}/build/runtime-contracts.js +13 -7
- package/dist/packages/runtime/build/runtime-inventory.d.ts +7 -0
- package/dist/packages/{engine → runtime}/build/runtime-inventory.js +3 -3
- package/dist/packages/runtime/build/runtime-log-paths.d.ts +3 -0
- package/dist/packages/runtime/build/runtime-log-paths.js +16 -0
- package/dist/packages/{engine → runtime}/build/runtime-prompt.js +12 -9
- package/dist/packages/{engine → runtime}/build/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{engine → runtime}/build/runtime-reconcile.js +25 -21
- package/dist/packages/runtime/build/runtime-runs.d.ts +10 -0
- package/dist/packages/runtime/build/runtime-runs.js +318 -0
- package/dist/packages/{engine → runtime}/build/runtime-types.d.ts +9 -6
- package/dist/packages/runtime/build/runtime-types.js +1 -0
- package/dist/packages/runtime/build/runtime.d.ts +8 -0
- package/dist/packages/runtime/build/runtime.js +7 -0
- package/dist/packages/runtime/build/source-files.d.ts +58 -0
- package/dist/packages/runtime/build/source-files.js +193 -0
- package/dist/packages/runtime/build/source-inventory.d.ts +28 -0
- package/dist/packages/runtime/build/source-inventory.js +512 -0
- package/dist/packages/runtime/build/source-manifest.d.ts +63 -0
- package/dist/packages/runtime/build/source-manifest.js +220 -0
- package/dist/packages/runtime/build/stage-evidence.d.ts +22 -0
- package/dist/packages/runtime/build/stage-evidence.js +386 -0
- package/dist/packages/runtime/build/stage-manifest.d.ts +45 -0
- package/dist/packages/runtime/build/stage-manifest.js +1125 -0
- package/dist/packages/runtime/build/stage-reuse.d.ts +11 -0
- package/dist/packages/runtime/build/stage-reuse.js +154 -0
- package/dist/packages/runtime/build/stage-session.d.ts +81 -0
- package/dist/packages/runtime/build/stage-session.js +308 -0
- package/dist/packages/runtime/build/state-artifacts.d.ts +9 -0
- package/dist/packages/runtime/build/state-artifacts.js +14 -0
- package/dist/packages/runtime/build/state-health.d.ts +4 -0
- package/dist/packages/{engine → runtime}/build/state-health.js +21 -26
- package/dist/packages/runtime/build/state-io.d.ts +12 -0
- package/dist/packages/runtime/build/state-io.js +118 -0
- package/dist/packages/runtime/build/state-view.d.ts +5 -0
- package/dist/packages/runtime/build/state-view.js +121 -0
- package/dist/packages/runtime/build/state.d.ts +7 -0
- package/dist/packages/runtime/build/state.js +12 -0
- package/dist/packages/runtime/build/summary-coverage-index.d.ts +21 -0
- package/dist/packages/runtime/build/summary-coverage-index.js +189 -0
- package/dist/packages/runtime/build/traces.d.ts +30 -0
- package/dist/packages/runtime/build/traces.js +133 -0
- package/dist/packages/{engine/build/validate-verifiable-context.d.ts → runtime/build/validate-context-graph.d.ts} +6 -6
- package/dist/packages/{engine/build/validate-verifiable-context.js → runtime/build/validate-context-graph.js} +49 -36
- package/dist/packages/{engine → runtime}/build/validate.d.ts +5 -5
- package/dist/packages/{engine → runtime}/build/validate.js +26 -26
- package/dist/packages/{engine → runtime}/client.d.ts +18 -18
- package/dist/packages/{engine → runtime}/client.js +48 -36
- package/dist/packages/{engine → runtime}/connection-config.d.ts +3 -2
- package/dist/packages/{engine → runtime}/connection-config.js +9 -8
- package/dist/packages/runtime/context-checks.d.ts +10 -0
- package/dist/packages/runtime/context-checks.js +127 -0
- package/dist/packages/runtime/context-graph-scaffold.d.ts +9 -0
- package/dist/packages/runtime/context-graph-scaffold.js +135 -0
- package/dist/packages/runtime/context-graph-semantic-graph.d.ts +9 -0
- package/dist/packages/runtime/context-graph-semantic-graph.js +416 -0
- package/dist/packages/runtime/entitlement-guard.d.ts +43 -0
- package/dist/packages/runtime/entitlement-guard.js +70 -0
- package/dist/packages/{engine → runtime}/execution/index.d.ts +2 -2
- package/dist/packages/{engine → runtime}/execution/index.js +1 -1
- package/dist/packages/{engine → runtime}/execution/lib/schema.d.ts +272 -191
- package/dist/packages/{engine → runtime}/execution/lib/schema.js +35 -32
- package/dist/packages/runtime/index.d.ts +29 -0
- package/dist/packages/runtime/index.js +21 -0
- package/dist/packages/runtime/instance-paths.d.ts +30 -0
- package/dist/packages/runtime/instance-paths.js +29 -0
- package/dist/packages/runtime/native-run-handlers.d.ts +63 -0
- package/dist/packages/{engine → runtime}/native-run-handlers.js +217 -166
- package/dist/packages/runtime/plan-artifact-contract.d.ts +17 -0
- package/dist/packages/runtime/plan-artifact-contract.js +42 -0
- package/dist/packages/runtime/project-entries.d.ts +11 -0
- package/dist/packages/runtime/project-entries.js +49 -0
- package/dist/packages/runtime/project-source-state.d.ts +26 -0
- package/dist/packages/runtime/project-source-state.js +56 -0
- package/dist/packages/runtime/project-store.d.ts +90 -0
- package/dist/packages/runtime/project-store.js +195 -0
- package/dist/packages/runtime/requested-artifacts.d.ts +7 -0
- package/dist/packages/{engine → runtime}/requested-artifacts.js +23 -1
- package/dist/packages/{engine → runtime}/run-observability.d.ts +2 -1
- package/dist/packages/{engine → runtime}/run-observability.js +174 -87
- package/dist/packages/runtime/runtime-action-proposals.d.ts +7 -0
- package/dist/packages/runtime/runtime-action-proposals.js +542 -0
- package/dist/packages/runtime/runtime-build-plans.d.ts +5 -0
- package/dist/packages/runtime/runtime-build-plans.js +175 -0
- package/dist/packages/runtime/runtime-build-runs.d.ts +47 -0
- package/dist/packages/runtime/runtime-build-runs.js +555 -0
- package/dist/packages/runtime/runtime-caches.d.ts +117 -0
- package/dist/packages/runtime/runtime-caches.js +266 -0
- package/dist/packages/{engine → runtime}/runtime-event-applier.d.ts +3 -1
- package/dist/packages/{engine → runtime}/runtime-event-applier.js +53 -17
- package/dist/packages/runtime/runtime-executor.d.ts +22 -0
- package/dist/packages/runtime/runtime-executor.js +131 -0
- package/dist/packages/runtime/runtime-jobs.d.ts +13 -0
- package/dist/packages/runtime/runtime-jobs.js +463 -0
- package/dist/packages/runtime/runtime-observability.d.ts +11 -0
- package/dist/packages/runtime/runtime-observability.js +39 -0
- package/dist/packages/{engine → runtime}/runtime-persistence.d.ts +9 -18
- package/dist/packages/{engine → runtime}/runtime-persistence.js +25 -25
- package/dist/packages/runtime/runtime-project-mutations.d.ts +7 -0
- package/dist/packages/runtime/runtime-project-mutations.js +65 -0
- package/dist/packages/runtime/runtime-project-reads.d.ts +18 -0
- package/dist/packages/runtime/runtime-project-reads.js +574 -0
- package/dist/packages/runtime/runtime-proposal-helpers.d.ts +22 -0
- package/dist/packages/runtime/runtime-proposal-helpers.js +223 -0
- package/dist/packages/{engine → runtime}/runtime-resource-builders.d.ts +23 -16
- package/dist/packages/{engine → runtime}/runtime-resource-builders.js +58 -46
- package/dist/packages/runtime/runtime-status.d.ts +14 -0
- package/dist/packages/runtime/runtime-status.js +15 -0
- package/dist/packages/runtime/runtime-verify-runs.d.ts +84 -0
- package/dist/packages/runtime/runtime-verify-runs.js +296 -0
- package/dist/packages/runtime/runtime.d.ts +1582 -0
- package/dist/packages/runtime/runtime.js +431 -0
- package/dist/packages/runtime/schemas/actions.d.ts +1206 -0
- package/dist/packages/runtime/schemas/actions.js +117 -0
- package/dist/packages/runtime/schemas/agents.d.ts +104 -0
- package/dist/packages/runtime/schemas/agents.js +74 -0
- package/dist/packages/runtime/schemas/build-plans.d.ts +1132 -0
- package/dist/packages/runtime/schemas/build-plans.js +141 -0
- package/dist/packages/runtime/schemas/context-graphs.d.ts +1522 -0
- package/dist/packages/runtime/schemas/context-graphs.js +110 -0
- package/dist/packages/runtime/schemas/files.d.ts +227 -0
- package/dist/packages/runtime/schemas/files.js +28 -0
- package/dist/packages/runtime/schemas/index.d.ts +9 -0
- package/dist/packages/runtime/schemas/index.js +13 -0
- package/dist/packages/runtime/schemas/instance.d.ts +141 -0
- package/dist/packages/runtime/schemas/instance.js +143 -0
- package/dist/packages/runtime/schemas/jobs.d.ts +339 -0
- package/dist/packages/runtime/schemas/jobs.js +107 -0
- package/dist/packages/runtime/schemas/projects.d.ts +366 -0
- package/dist/packages/runtime/schemas/projects.js +160 -0
- package/dist/packages/runtime/schemas/runs.d.ts +3445 -0
- package/dist/packages/runtime/schemas/runs.js +115 -0
- package/dist/packages/runtime/service/index.d.ts +3 -0
- package/dist/packages/runtime/service/index.js +3 -0
- package/dist/packages/runtime/service/openapi.d.ts +7 -0
- package/dist/packages/runtime/service/openapi.js +118 -0
- package/dist/packages/runtime/service/operations.d.ts +3011 -0
- package/dist/packages/runtime/service/operations.js +375 -0
- package/dist/packages/runtime/service/routes.d.ts +114 -0
- package/dist/packages/runtime/service/routes.js +128 -0
- package/dist/packages/runtime/service/server-api-files.d.ts +10 -0
- package/dist/packages/runtime/service/server-api-files.js +85 -0
- package/dist/packages/runtime/service/server-app-boot.d.ts +4 -0
- package/dist/packages/runtime/service/server-app-boot.js +46 -0
- package/dist/packages/runtime/service/server-guards.d.ts +63 -0
- package/dist/packages/runtime/service/server-guards.js +181 -0
- package/dist/packages/runtime/service/server-helpers.d.ts +38 -0
- package/dist/packages/runtime/service/server-helpers.js +108 -0
- package/dist/packages/runtime/service/server-instance-helpers.d.ts +30 -0
- package/dist/packages/runtime/service/server-instance-helpers.js +114 -0
- package/dist/packages/runtime/service/server-routes-action-proposals.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-action-proposals.js +45 -0
- package/dist/packages/runtime/service/server-routes-agents.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-agents.js +132 -0
- package/dist/packages/runtime/service/server-routes-auth.d.ts +33 -0
- package/dist/packages/runtime/service/server-routes-auth.js +138 -0
- package/dist/packages/runtime/service/server-routes-build-plans.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-build-plans.js +86 -0
- package/dist/packages/runtime/service/server-routes-discovery.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-discovery.js +196 -0
- package/dist/packages/runtime/service/server-routes-events.d.ts +5 -0
- package/dist/packages/runtime/service/server-routes-events.js +99 -0
- package/dist/packages/runtime/service/server-routes-project-context.d.ts +9 -0
- package/dist/packages/runtime/service/server-routes-project-context.js +287 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.d.ts +9 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.js +137 -0
- package/dist/packages/runtime/service/server-routes-project-runs.d.ts +14 -0
- package/dist/packages/runtime/service/server-routes-project-runs.js +88 -0
- package/dist/packages/runtime/service/server-routes-projects.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-projects.js +96 -0
- package/dist/packages/runtime/service/server-routes-runs.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-runs.js +119 -0
- package/dist/packages/runtime/service/server.d.ts +37 -0
- package/dist/packages/runtime/service/server.js +300 -0
- package/dist/packages/{engine → runtime/service}/service-registry.d.ts +5 -5
- package/dist/packages/{engine → runtime/service}/service-registry.js +7 -7
- package/dist/packages/runtime/verify/benchmark-run.d.ts +81 -0
- package/dist/packages/runtime/verify/benchmark-run.js +303 -0
- package/dist/packages/{engine → runtime}/verify/index.d.ts +2 -2
- package/dist/packages/{engine → runtime}/verify/index.js +1 -1
- package/dist/packages/{engine → runtime}/verify/lib/schema.d.ts +83 -16
- package/dist/packages/{engine → runtime}/verify/lib/schema.js +38 -18
- package/dist/packages/runtime/verify/test-file-guard.d.ts +2 -0
- package/dist/packages/runtime/verify/test-file-guard.js +29 -0
- package/dist/packages/{engine → runtime}/verify/verify-execution.d.ts +7 -0
- package/dist/packages/{engine → runtime}/verify/verify-execution.js +119 -45
- package/dist/packages/{engine → runtime}/verify/verify-paths.d.ts +5 -4
- package/dist/packages/runtime/verify/verify-paths.js +65 -0
- package/dist/packages/{engine → runtime}/verify/verify-sandbox.d.ts +1 -1
- package/dist/packages/runtime/verify/verify-sandbox.js +88 -0
- package/dist/packages/{engine → runtime}/verify/verify-specs.d.ts +2 -0
- package/dist/packages/runtime/verify/verify-specs.js +126 -0
- package/dist/packages/runtime/verify/verify-targets.d.ts +5 -0
- package/dist/packages/{engine → runtime}/verify/verify-targets.js +12 -12
- package/dist/packages/runtime/verify/verify-types.js +1 -0
- package/dist/packages/{engine → runtime}/verify/verify.d.ts +1 -1
- package/dist/packages/{engine → runtime}/verify/verify.js +1 -1
- package/dist/packages/runtime/wire-schemas.d.ts +18 -0
- package/dist/packages/runtime/wire-schemas.js +27 -0
- package/package.json +32 -30
- package/public-repo/CONTRIBUTING.md +16 -18
- package/public-repo/README.md +119 -282
- package/public-repo/SECURITY.md +3 -4
- package/public-repo/build-plans/interf-default/README.md +24 -16
- package/public-repo/build-plans/interf-default/build/stages/entrypoint/SKILL.md +74 -0
- package/public-repo/build-plans/interf-default/build/stages/knowledge/SKILL.md +95 -0
- package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +49 -4
- package/public-repo/build-plans/interf-default/build-plan.json +49 -39
- package/public-repo/build-plans/interf-default/build-plan.schema.json +59 -33
- package/public-repo/build-plans/interf-default/improve/SKILL.md +3 -3
- package/public-repo/build-plans/interf-default/use/query/SKILL.md +18 -11
- package/public-repo/openapi/local-service.openapi.json +14227 -0
- package/public-repo/skills/interf/SKILL.md +508 -187
- package/dist/cli/commands/prep.d.ts +0 -2
- package/dist/cli/commands/prep.js +0 -240
- package/dist/cli/commands/test.d.ts +0 -10
- package/dist/cli/commands/test.js +0 -85
- package/dist/cli/commands/web.d.ts +0 -2
- package/dist/cli/commands/web.js +0 -286
- package/dist/interf-ui/404.html +0 -1
- package/dist/interf-ui/__next.__PAGE__.txt +0 -10
- package/dist/interf-ui/__next._full.txt +0 -20
- package/dist/interf-ui/__next._head.txt +0 -5
- package/dist/interf-ui/__next._index.txt +0 -5
- package/dist/interf-ui/__next._tree.txt +0 -5
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_buildManifest.js +0 -11
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_clientMiddlewareManifest.js +0 -1
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_ssgManifest.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0.tjb6f4golw..css +0 -3
- package/dist/interf-ui/_next/static/chunks/03~yq9q893hmn.js +0 -1
- package/dist/interf-ui/_next/static/chunks/085-n_jv2ng_q.css +0 -1
- package/dist/interf-ui/_next/static/chunks/0dn41fa_zvgsl.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0g-ea0zj5d-0k.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0gwqglc4iz583.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0haldgm65ve6l.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0nv3am99vjzn4.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0s77gt_o4jwtx.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0y5z3t-z1c8ks.js.map +0 -5
- package/dist/interf-ui/_next/static/chunks/0~a36ujuzpaz..js +0 -116
- package/dist/interf-ui/_next/static/chunks/10jeodxe4nkgj.js +0 -31
- package/dist/interf-ui/_next/static/chunks/119h2rouych2t.js +0 -1
- package/dist/interf-ui/_next/static/chunks/13c8b~m8knjsf.js +0 -1
- package/dist/interf-ui/_next/static/chunks/14dznb2qpt-ho.js +0 -91
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +0 -5
- package/dist/interf-ui/_next/static/chunks/turbopack-0p.pvcjrtq-jh.js +0 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-0usj_75.8frlw.js +0 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -1
- package/dist/interf-ui/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/dist/interf-ui/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/dist/interf-ui/_next/static/media/worker.102zas1s52_pf.js +0 -109
- package/dist/interf-ui/_not-found/__next._full.txt +0 -15
- package/dist/interf-ui/_not-found/__next._head.txt +0 -5
- package/dist/interf-ui/_not-found/__next._index.txt +0 -5
- package/dist/interf-ui/_not-found/__next._not-found.__PAGE__.txt +0 -5
- package/dist/interf-ui/_not-found/__next._not-found.txt +0 -5
- package/dist/interf-ui/_not-found/__next._tree.txt +0 -2
- package/dist/interf-ui/_not-found.html +0 -1
- package/dist/interf-ui/_not-found.txt +0 -15
- package/dist/interf-ui/index.html +0 -1
- package/dist/interf-ui/index.txt +0 -20
- package/dist/packages/contracts/lib/preparation-paths.d.ts +0 -117
- package/dist/packages/contracts/lib/preparation-paths.js +0 -177
- package/dist/packages/engine/action-definitions.d.ts +0 -407
- package/dist/packages/engine/action-definitions.js +0 -1158
- package/dist/packages/engine/action-values.d.ts +0 -1
- package/dist/packages/engine/action-values.js +0 -1
- package/dist/packages/engine/agents/lib/args.d.ts +0 -4
- package/dist/packages/engine/agents/lib/args.js +0 -52
- package/dist/packages/engine/agents/lib/chart-guidance.d.ts +0 -1
- package/dist/packages/engine/agents/lib/chart-guidance.js +0 -8
- package/dist/packages/engine/agents/lib/constants.js +0 -28
- package/dist/packages/engine/agents/lib/logs.d.ts +0 -2
- package/dist/packages/engine/agents/lib/logs.js +0 -17
- package/dist/packages/engine/agents/lib/render.d.ts +0 -8
- package/dist/packages/engine/agents/lib/schema.d.ts +0 -8
- package/dist/packages/engine/agents/lib/schema.js +0 -7
- package/dist/packages/engine/agents/lib/shells.d.ts +0 -74
- package/dist/packages/engine/agents/lib/shells.js +0 -1052
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.d.ts +0 -3
- package/dist/packages/engine/build/artifact-counts.d.ts +0 -1
- package/dist/packages/engine/build/billing-events.d.ts +0 -89
- package/dist/packages/engine/build/build-pipeline.js +0 -175
- package/dist/packages/engine/build/build-plan-runs.d.ts +0 -14
- package/dist/packages/engine/build/build-plan-runs.js +0 -31
- package/dist/packages/engine/build/build-stage-plan.d.ts +0 -16
- package/dist/packages/engine/build/build-stage-plan.js +0 -100
- package/dist/packages/engine/build/build-stage-runner.js +0 -94
- package/dist/packages/engine/build/build-target.js +0 -16
- package/dist/packages/engine/build/check-evaluator.js +0 -298
- package/dist/packages/engine/build/lib/schema.js +0 -316
- package/dist/packages/engine/build/reset.d.ts +0 -2
- package/dist/packages/engine/build/reset.js +0 -74
- package/dist/packages/engine/build/runtime-inventory.d.ts +0 -7
- package/dist/packages/engine/build/runtime-paths.d.ts +0 -8
- package/dist/packages/engine/build/runtime-paths.js +0 -26
- package/dist/packages/engine/build/runtime-runs.d.ts +0 -10
- package/dist/packages/engine/build/runtime-runs.js +0 -224
- package/dist/packages/engine/build/runtime.d.ts +0 -5
- package/dist/packages/engine/build/runtime.js +0 -4
- package/dist/packages/engine/build/source-files.d.ts +0 -46
- package/dist/packages/engine/build/source-files.js +0 -149
- package/dist/packages/engine/build/state-artifacts.d.ts +0 -9
- package/dist/packages/engine/build/state-artifacts.js +0 -14
- package/dist/packages/engine/build/state-health.d.ts +0 -4
- package/dist/packages/engine/build/state-io.d.ts +0 -11
- package/dist/packages/engine/build/state-io.js +0 -82
- package/dist/packages/engine/build/state-paths.d.ts +0 -5
- package/dist/packages/engine/build/state-paths.js +0 -16
- package/dist/packages/engine/build/state-view.d.ts +0 -5
- package/dist/packages/engine/build/state-view.js +0 -94
- package/dist/packages/engine/build/state.d.ts +0 -7
- package/dist/packages/engine/build/state.js +0 -12
- package/dist/packages/engine/build/validate-helpers.d.ts +0 -12
- package/dist/packages/engine/build/validate-helpers.js +0 -41
- package/dist/packages/engine/build/verifiable-context-paths.d.ts +0 -47
- package/dist/packages/engine/build/verifiable-context-paths.js +0 -121
- package/dist/packages/engine/build/verifiable-context-schema.d.ts +0 -21
- package/dist/packages/engine/build/verifiable-context-schema.js +0 -126
- package/dist/packages/engine/cloud-seams.d.ts +0 -115
- package/dist/packages/engine/cloud-seams.js +0 -84
- package/dist/packages/engine/index.d.ts +0 -22
- package/dist/packages/engine/index.js +0 -15
- package/dist/packages/engine/instance-paths.d.ts +0 -106
- package/dist/packages/engine/instance-paths.js +0 -171
- package/dist/packages/engine/lib/schema.d.ts +0 -6304
- package/dist/packages/engine/lib/schema.js +0 -730
- package/dist/packages/engine/native-run-handlers.d.ts +0 -25
- package/dist/packages/engine/preparation-store.d.ts +0 -105
- package/dist/packages/engine/preparation-store.js +0 -213
- package/dist/packages/engine/readiness-check-draft.d.ts +0 -20
- package/dist/packages/engine/readiness-check-draft.js +0 -111
- package/dist/packages/engine/requested-artifacts.d.ts +0 -5
- package/dist/packages/engine/routes.d.ts +0 -85
- package/dist/packages/engine/routes.js +0 -99
- package/dist/packages/engine/runtime-caches.d.ts +0 -76
- package/dist/packages/engine/runtime-caches.js +0 -191
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +0 -35
- package/dist/packages/engine/runtime-proposal-helpers.js +0 -247
- package/dist/packages/engine/runtime.d.ts +0 -371
- package/dist/packages/engine/runtime.js +0 -2463
- package/dist/packages/engine/server.d.ts +0 -58
- package/dist/packages/engine/server.js +0 -1399
- package/dist/packages/engine/verify/readiness-check-run.d.ts +0 -82
- package/dist/packages/engine/verify/readiness-check-run.js +0 -265
- package/dist/packages/engine/verify/verify-paths.js +0 -61
- package/dist/packages/engine/verify/verify-sandbox.js +0 -88
- package/dist/packages/engine/verify/verify-specs.js +0 -114
- package/dist/packages/engine/verify/verify-targets.d.ts +0 -5
- package/dist/packages/engine/wire-schemas.d.ts +0 -547
- package/dist/packages/engine/wire-schemas.js +0 -59
- package/dist/packages/project/index.d.ts +0 -9
- package/dist/packages/project/interf-bootstrap.d.ts +0 -1
- package/dist/packages/project/interf-bootstrap.js +0 -1
- package/dist/packages/project/interf-scaffold.d.ts +0 -3
- package/dist/packages/project/interf-scaffold.js +0 -136
- package/dist/packages/project/interf.d.ts +0 -4
- package/dist/packages/project/interf.js +0 -3
- package/dist/packages/project/lib/schema.d.ts +0 -328
- package/dist/packages/project/lib/schema.js +0 -136
- package/dist/packages/project/preparation-entries.d.ts +0 -11
- package/dist/packages/project/preparation-entries.js +0 -49
- package/dist/packages/project/source-config.d.ts +0 -46
- package/dist/packages/project/source-config.js +0 -394
- package/dist/packages/project/source-folders.d.ts +0 -11
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +0 -27
- package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +0 -21
- package/public-repo/plugins/README.md +0 -9
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +0 -21
- package/public-repo/plugins/interf/.mcp.json +0 -12
- package/public-repo/plugins/interf/README.md +0 -32
- package/public-repo/plugins/interf/skills/interf/SKILL.md +0 -376
- /package/dist/packages/{engine/agents/lib/types.js → runtime/actions/fields.js} +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/agents.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/agents.js +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/execution.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/preflight.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/status.d.ts +0 -0
- /package/dist/packages/{engine/build/runtime-types.js → runtime/agents/lib/types.js} +0 -0
- /package/dist/packages/{engine/verify/verify-types.js → runtime/agents/providers/types.js} +0 -0
- /package/dist/packages/{engine → runtime}/agents/role-router.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/build-execution.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/build-execution.js +0 -0
- /package/dist/packages/{engine → runtime}/build/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/adapters.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/adapters.js +0 -0
- /package/dist/packages/{engine → runtime}/execution/events.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/events.js +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.js +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-types.d.ts +0 -0
|
@@ -1,1158 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { RequestedArtifactSchema, SourceProfileSchema, } from "../project/lib/schema.js";
|
|
3
|
-
import { artifactRequirementsFromRequestedArtifacts, formatRequestedArtifactsForPrompt, } from "./requested-artifacts.js";
|
|
4
|
-
export const ActionValueIdPattern = /^[a-z0-9][a-z0-9-]{0,79}$/;
|
|
5
|
-
export const ActionValueIdSchema = z.string().trim().regex(ActionValueIdPattern, "Use lowercase letters, numbers, and dashes.");
|
|
6
|
-
export const OptionalActionValueIdSchema = z.string().trim().refine((value) => value === "" || ActionValueIdPattern.test(value), "Use lowercase letters, numbers, and dashes.");
|
|
7
|
-
export const SourceReadinessCheckActionValueSchema = z.object({
|
|
8
|
-
question: z.string().trim().min(1),
|
|
9
|
-
answer: z.string().trim().optional(),
|
|
10
|
-
}).strict();
|
|
11
|
-
export const RequestedArtifactActionValueSchema = RequestedArtifactSchema;
|
|
12
|
-
export const SourceProfileActionValueSchema = SourceProfileSchema;
|
|
13
|
-
export const PreparationSetupActionValuesSchema = z.object({
|
|
14
|
-
name: ActionValueIdSchema,
|
|
15
|
-
path: z.string().trim().min(1, "Source Folder is required."),
|
|
16
|
-
about: z.string().trim().min(1, "Agent work is required."),
|
|
17
|
-
build_plan: OptionalActionValueIdSchema.optional(),
|
|
18
|
-
checks: z.array(SourceReadinessCheckActionValueSchema).optional(),
|
|
19
|
-
requested_artifacts: z.array(RequestedArtifactActionValueSchema).optional(),
|
|
20
|
-
source_profile: SourceProfileActionValueSchema.optional(),
|
|
21
|
-
max_attempts: z.number().int().min(1).max(5).optional(),
|
|
22
|
-
max_loops: z.number().int().min(1).max(3).optional(),
|
|
23
|
-
readiness_notes: z.string().trim().optional(),
|
|
24
|
-
build_after_setup: z.boolean().optional(),
|
|
25
|
-
setup_mode: z.enum(["create", "select-build-plan"]).optional(),
|
|
26
|
-
}).strict();
|
|
27
|
-
export const BuildPlanAuthoringActionValuesSchema = z.object({
|
|
28
|
-
build_plan_id: ActionValueIdSchema.optional(),
|
|
29
|
-
base_build_plan_id: ActionValueIdSchema.optional(),
|
|
30
|
-
reference_build_plan_id: ActionValueIdSchema.optional(),
|
|
31
|
-
label: z.string().trim().optional(),
|
|
32
|
-
hint: z.string().trim().optional(),
|
|
33
|
-
task_prompt: z.string().trim().min(1, "Agent work is required."),
|
|
34
|
-
requested_artifacts_description: z.string().trim().optional(),
|
|
35
|
-
requested_artifacts: z.array(RequestedArtifactActionValueSchema).optional(),
|
|
36
|
-
source_profile: SourceProfileActionValueSchema.nullable().optional(),
|
|
37
|
-
readiness_notes: z.string().trim().optional(),
|
|
38
|
-
}).strict();
|
|
39
|
-
export const INTERF_SERVICE_ACTIONS = {
|
|
40
|
-
createPreparation: {
|
|
41
|
-
id: "create-preparation",
|
|
42
|
-
serviceAction: "preparation-setup",
|
|
43
|
-
title: "Create Preparation",
|
|
44
|
-
description: "Save a Source, requested Artifacts, Build Plan, and run history under one Preparation.",
|
|
45
|
-
},
|
|
46
|
-
buildRun: {
|
|
47
|
-
id: "build-run",
|
|
48
|
-
serviceAction: "build",
|
|
49
|
-
title: "Build Artifacts",
|
|
50
|
-
description: "Run the saved Build Plan against this Source and write verifiable context.",
|
|
51
|
-
},
|
|
52
|
-
selectBuildPlan: {
|
|
53
|
-
id: "select-build-plan",
|
|
54
|
-
serviceAction: "preparation-setup",
|
|
55
|
-
title: "Select Build Plan",
|
|
56
|
-
description: "Choose the Build Plan that will build this Preparation's requested Artifacts.",
|
|
57
|
-
},
|
|
58
|
-
createBuildPlan: {
|
|
59
|
-
id: "build-plan-draft",
|
|
60
|
-
serviceAction: "build-plan-draft",
|
|
61
|
-
title: "Draft Build Plan",
|
|
62
|
-
description: "Draft a Build Plan for the Artifacts this Preparation should build.",
|
|
63
|
-
},
|
|
64
|
-
buildPlanChange: {
|
|
65
|
-
id: "build-plan-change",
|
|
66
|
-
serviceAction: "build-plan-change",
|
|
67
|
-
title: "Build Plan Change",
|
|
68
|
-
description: "Modify, duplicate, or remove an existing Build Plan.",
|
|
69
|
-
},
|
|
70
|
-
preparationChange: {
|
|
71
|
-
id: "preparation-change",
|
|
72
|
-
serviceAction: "preparation-change",
|
|
73
|
-
title: "Preparation Change",
|
|
74
|
-
description: "Modify, duplicate, or remove an existing Preparation.",
|
|
75
|
-
},
|
|
76
|
-
confirmAction: {
|
|
77
|
-
id: "confirm-action",
|
|
78
|
-
serviceAction: "action-proposal",
|
|
79
|
-
title: "Send Request",
|
|
80
|
-
description: "Confirm the typed Interf service request before it runs.",
|
|
81
|
-
},
|
|
82
|
-
checkReadiness: {
|
|
83
|
-
id: "check-readiness",
|
|
84
|
-
serviceAction: "test",
|
|
85
|
-
title: "Check Readiness",
|
|
86
|
-
description: "Run saved readiness checks against this Preparation.",
|
|
87
|
-
},
|
|
88
|
-
draftReadinessChecks: {
|
|
89
|
-
id: "draft-readiness-checks",
|
|
90
|
-
serviceAction: "readiness-check-draft",
|
|
91
|
-
title: "Draft Readiness Checks",
|
|
92
|
-
description: "Ask the configured local executor to draft saved readiness checks.",
|
|
93
|
-
},
|
|
94
|
-
improvePreparation: {
|
|
95
|
-
id: "improve-preparation",
|
|
96
|
-
serviceAction: "build-plan-improvement",
|
|
97
|
-
title: "Improve Build Plan",
|
|
98
|
-
description: "Use readiness evidence to refine the Build Plan this Preparation uses.",
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
function optionalLine(label, value) {
|
|
102
|
-
const trimmed = value?.trim();
|
|
103
|
-
return trimmed ? `${label}: ${trimmed}` : null;
|
|
104
|
-
}
|
|
105
|
-
export function buildPlanAuthoringTaskPrompt(values) {
|
|
106
|
-
const requestedArtifacts = values.requested_artifacts?.length
|
|
107
|
-
? formatRequestedArtifactsForPrompt(values.requested_artifacts)
|
|
108
|
-
: null;
|
|
109
|
-
return [
|
|
110
|
-
`Agent work: ${values.task_prompt}`,
|
|
111
|
-
requestedArtifacts ? `Requested Artifacts:\n${requestedArtifacts}` : null,
|
|
112
|
-
optionalLine("Requested Artifacts", values.requested_artifacts_description),
|
|
113
|
-
optionalLine("Readiness checks", values.readiness_notes),
|
|
114
|
-
].filter((line) => Boolean(line)).join("\n");
|
|
115
|
-
}
|
|
116
|
-
const requiredActionText = (field) => z.string().trim().min(1, `${field} is required.`);
|
|
117
|
-
const optionalActionText = z.string().trim();
|
|
118
|
-
const actionIdField = (field) => requiredActionText(field).regex(ActionValueIdPattern, `${field} must use lowercase letters, numbers, and dashes.`);
|
|
119
|
-
const optionalActionIdField = (field) => optionalActionText.refine((value) => value === "" || ActionValueIdPattern.test(value), `${field} must use lowercase letters, numbers, and dashes.`);
|
|
120
|
-
export function packageSchemaFieldErrors(result, pathMap) {
|
|
121
|
-
if (result.success)
|
|
122
|
-
return {};
|
|
123
|
-
const errors = {};
|
|
124
|
-
for (const issue of result.error.issues) {
|
|
125
|
-
const path = issue.path.join(".");
|
|
126
|
-
const key = pathMap[path] ?? pathMap[issue.path.at(-1)?.toString() ?? ""] ?? "";
|
|
127
|
-
if (key && !errors[key])
|
|
128
|
-
errors[key] = issue.message;
|
|
129
|
-
}
|
|
130
|
-
return errors;
|
|
131
|
-
}
|
|
132
|
-
export function slugForActionId(value) {
|
|
133
|
-
const slug = value
|
|
134
|
-
.toLowerCase()
|
|
135
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
136
|
-
.replace(/^-+|-+$/g, "")
|
|
137
|
-
.slice(0, 72)
|
|
138
|
-
.replace(/-+$/g, "");
|
|
139
|
-
return slug || "preparation";
|
|
140
|
-
}
|
|
141
|
-
export function uniqueActionId(seed, usedIds) {
|
|
142
|
-
const base = slugForActionId(seed);
|
|
143
|
-
if (!usedIds.has(base))
|
|
144
|
-
return base;
|
|
145
|
-
for (let index = 2; index < 100; index += 1) {
|
|
146
|
-
const candidate = `${base}-${index}`;
|
|
147
|
-
if (!usedIds.has(candidate))
|
|
148
|
-
return candidate;
|
|
149
|
-
}
|
|
150
|
-
return `${base}-${Date.now().toString(36)}`;
|
|
151
|
-
}
|
|
152
|
-
export function titleFromActionId(value) {
|
|
153
|
-
return value
|
|
154
|
-
.split("-")
|
|
155
|
-
.filter(Boolean)
|
|
156
|
-
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
157
|
-
.join(" ");
|
|
158
|
-
}
|
|
159
|
-
export function maybeActionValue(value) {
|
|
160
|
-
const trimmed = value.trim();
|
|
161
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
162
|
-
}
|
|
163
|
-
function inputValue(values, key) {
|
|
164
|
-
return values[key] ?? "";
|
|
165
|
-
}
|
|
166
|
-
export function buildPlanChoiceOptions(buildPlans) {
|
|
167
|
-
const seen = new Set();
|
|
168
|
-
const options = [];
|
|
169
|
-
for (const buildPlan of [{ id: "interf-default", label: "interf-default" }, ...buildPlans]) {
|
|
170
|
-
if (seen.has(buildPlan.id))
|
|
171
|
-
continue;
|
|
172
|
-
seen.add(buildPlan.id);
|
|
173
|
-
options.push({ label: buildPlan.label ?? buildPlan.id, value: buildPlan.id });
|
|
174
|
-
}
|
|
175
|
-
return options;
|
|
176
|
-
}
|
|
177
|
-
export function buildPlanTaskPromptFromInput(values) {
|
|
178
|
-
const parsed = BuildPlanAuthoringActionValuesSchema.safeParse(values);
|
|
179
|
-
if (parsed.success)
|
|
180
|
-
return buildPlanAuthoringTaskPrompt(parsed.data);
|
|
181
|
-
const taskPrompt = inputValue(values, "task_prompt");
|
|
182
|
-
const requestedArtifactsDescription = inputValue(values, "requested_artifacts_description");
|
|
183
|
-
const readinessNotes = inputValue(values, "readiness_notes");
|
|
184
|
-
return [
|
|
185
|
-
`Agent work: ${taskPrompt}`,
|
|
186
|
-
maybeActionValue(requestedArtifactsDescription) ? `Requested Artifacts: ${requestedArtifactsDescription}` : null,
|
|
187
|
-
maybeActionValue(readinessNotes) ? `Readiness checks: ${readinessNotes}` : null,
|
|
188
|
-
].filter((line) => Boolean(line)).join("\n");
|
|
189
|
-
}
|
|
190
|
-
function createPreparationSchema(existingNames) {
|
|
191
|
-
return z.object({
|
|
192
|
-
name: actionIdField("Preparation name"),
|
|
193
|
-
path: requiredActionText("Source Folder"),
|
|
194
|
-
about: requiredActionText("Agent work"),
|
|
195
|
-
build_plan: optionalActionIdField("Build Plan"),
|
|
196
|
-
readiness_notes: optionalActionText,
|
|
197
|
-
}).strict().superRefine((values, ctx) => {
|
|
198
|
-
if (existingNames.has(values.name)) {
|
|
199
|
-
ctx.addIssue({
|
|
200
|
-
code: z.ZodIssueCode.custom,
|
|
201
|
-
path: ["name"],
|
|
202
|
-
message: "A Preparation with this name already exists.",
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
function prepareRunSchema() {
|
|
208
|
-
return z.object({
|
|
209
|
-
preparation: actionIdField("Preparation"),
|
|
210
|
-
build_plan: optionalActionIdField("Build Plan"),
|
|
211
|
-
about: optionalActionText,
|
|
212
|
-
source_folder_path: optionalActionText,
|
|
213
|
-
}).strict();
|
|
214
|
-
}
|
|
215
|
-
function selectBuildPlanSchema() {
|
|
216
|
-
return z.object({
|
|
217
|
-
name: actionIdField("Preparation"),
|
|
218
|
-
path: requiredActionText("Source Folder"),
|
|
219
|
-
about: requiredActionText("Agent work"),
|
|
220
|
-
current_build_plan: optionalActionIdField("Current Build Plan"),
|
|
221
|
-
build_plan: actionIdField("Build Plan"),
|
|
222
|
-
}).strict();
|
|
223
|
-
}
|
|
224
|
-
function buildPlanAuthoringSchema(existingBuildPlanIds) {
|
|
225
|
-
return z.object({
|
|
226
|
-
build_plan_id: optionalActionIdField("Build Plan id"),
|
|
227
|
-
label: optionalActionText,
|
|
228
|
-
hint: optionalActionText,
|
|
229
|
-
task_prompt: requiredActionText("Agent work"),
|
|
230
|
-
requested_artifacts_description: optionalActionText,
|
|
231
|
-
readiness_notes: optionalActionText,
|
|
232
|
-
}).strict().superRefine((values, ctx) => {
|
|
233
|
-
const explicitBuildPlanId = maybeActionValue(values.build_plan_id ?? "");
|
|
234
|
-
if (explicitBuildPlanId && existingBuildPlanIds.has(explicitBuildPlanId)) {
|
|
235
|
-
ctx.addIssue({
|
|
236
|
-
code: z.ZodIssueCode.custom,
|
|
237
|
-
path: ["build_plan_id"],
|
|
238
|
-
message: "A Build Plan with this id already exists.",
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
function buildPlanChangeSchema(action, buildPlanId, existingBuildPlanIds) {
|
|
244
|
-
const base = {
|
|
245
|
-
action: requiredActionText("Action"),
|
|
246
|
-
build_plan: actionIdField("Build Plan"),
|
|
247
|
-
preparation: optionalActionIdField("Preparation"),
|
|
248
|
-
};
|
|
249
|
-
if (action === "modify") {
|
|
250
|
-
return z.object({
|
|
251
|
-
...base,
|
|
252
|
-
change_request: requiredActionText("Requested change"),
|
|
253
|
-
label: optionalActionText,
|
|
254
|
-
hint: optionalActionText,
|
|
255
|
-
}).strict();
|
|
256
|
-
}
|
|
257
|
-
if (action === "duplicate") {
|
|
258
|
-
return z.object({
|
|
259
|
-
...base,
|
|
260
|
-
new_build_plan_id: actionIdField("New Build Plan id"),
|
|
261
|
-
}).strict().superRefine((values, ctx) => {
|
|
262
|
-
if (existingBuildPlanIds.has(values.new_build_plan_id)) {
|
|
263
|
-
ctx.addIssue({
|
|
264
|
-
code: z.ZodIssueCode.custom,
|
|
265
|
-
path: ["new_build_plan_id"],
|
|
266
|
-
message: "A Build Plan with this id already exists.",
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
return z.object({
|
|
272
|
-
...base,
|
|
273
|
-
confirmation: requiredActionText("Confirmation").refine((value) => value === buildPlanId, `Type ${buildPlanId} to confirm.`),
|
|
274
|
-
}).strict();
|
|
275
|
-
}
|
|
276
|
-
function preparationChangeSchema(action, preparation, existingNames) {
|
|
277
|
-
const base = {
|
|
278
|
-
action: requiredActionText("Action"),
|
|
279
|
-
preparation: actionIdField("Preparation"),
|
|
280
|
-
};
|
|
281
|
-
if (action === "modify") {
|
|
282
|
-
return z.object({
|
|
283
|
-
...base,
|
|
284
|
-
name: actionIdField("Preparation id"),
|
|
285
|
-
path: requiredActionText("Source Folder"),
|
|
286
|
-
about: requiredActionText("Agent work"),
|
|
287
|
-
build_plan: optionalActionIdField("Build Plan"),
|
|
288
|
-
}).strict().superRefine((values, ctx) => {
|
|
289
|
-
if (values.name !== preparation && existingNames.has(values.name)) {
|
|
290
|
-
ctx.addIssue({
|
|
291
|
-
code: z.ZodIssueCode.custom,
|
|
292
|
-
path: ["name"],
|
|
293
|
-
message: "A Preparation with this name already exists.",
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
if (action === "duplicate") {
|
|
299
|
-
return z.object({
|
|
300
|
-
...base,
|
|
301
|
-
name: actionIdField("New Preparation id"),
|
|
302
|
-
path: requiredActionText("Source Folder"),
|
|
303
|
-
about: requiredActionText("Agent work"),
|
|
304
|
-
build_plan: optionalActionIdField("Build Plan"),
|
|
305
|
-
}).strict().superRefine((values, ctx) => {
|
|
306
|
-
if (existingNames.has(values.name)) {
|
|
307
|
-
ctx.addIssue({
|
|
308
|
-
code: z.ZodIssueCode.custom,
|
|
309
|
-
path: ["name"],
|
|
310
|
-
message: "A Preparation with this name already exists.",
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
return z.object({
|
|
316
|
-
...base,
|
|
317
|
-
confirmation: requiredActionText("Confirmation").refine((value) => value === preparation, `Type ${preparation} to confirm.`),
|
|
318
|
-
}).strict();
|
|
319
|
-
}
|
|
320
|
-
function conciseSummary(value, fallback) {
|
|
321
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
322
|
-
if (!normalized)
|
|
323
|
-
return fallback;
|
|
324
|
-
const sentence = normalized.match(/^.{24,180}?(?:[.!?](?:\s|$)|$)/)?.[0]?.trim() ?? normalized;
|
|
325
|
-
return sentence.length > 180 ? `${sentence.slice(0, 177).trim()}...` : sentence;
|
|
326
|
-
}
|
|
327
|
-
function normalizedBuildPlanActionValues(values, existingBuildPlanIds, defaultSeed) {
|
|
328
|
-
const explicitBuildPlanId = maybeActionValue(inputValue(values, "build_plan_id"));
|
|
329
|
-
const taskPrompt = inputValue(values, "task_prompt").trim();
|
|
330
|
-
const buildPlanId = explicitBuildPlanId ?? uniqueActionId(taskPrompt || defaultSeed || "custom-build-plan", existingBuildPlanIds);
|
|
331
|
-
const output = maybeActionValue(inputValue(values, "requested_artifacts_description"));
|
|
332
|
-
return {
|
|
333
|
-
...values,
|
|
334
|
-
build_plan_id: buildPlanId,
|
|
335
|
-
label: maybeActionValue(inputValue(values, "label")) ?? titleFromActionId(buildPlanId),
|
|
336
|
-
hint: maybeActionValue(inputValue(values, "hint")) ?? conciseSummary(output ?? taskPrompt, "Reusable Build Plan for building Artifacts."),
|
|
337
|
-
task_prompt: taskPrompt,
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
function createPreparationActionValues(values) {
|
|
341
|
-
const buildPlan = inputValue(values, "build_plan");
|
|
342
|
-
const readinessNotes = inputValue(values, "readiness_notes");
|
|
343
|
-
return {
|
|
344
|
-
name: inputValue(values, "name"),
|
|
345
|
-
path: inputValue(values, "path"),
|
|
346
|
-
about: inputValue(values, "about"),
|
|
347
|
-
build_after_setup: false,
|
|
348
|
-
...(maybeActionValue(buildPlan) ? { build_plan: buildPlan } : {}),
|
|
349
|
-
...(maybeActionValue(readinessNotes) ? { readiness_notes: readinessNotes } : {}),
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
function selectBuildPlanActionValues(values) {
|
|
353
|
-
return {
|
|
354
|
-
name: inputValue(values, "name"),
|
|
355
|
-
path: inputValue(values, "path"),
|
|
356
|
-
about: inputValue(values, "about"),
|
|
357
|
-
build_plan: inputValue(values, "build_plan"),
|
|
358
|
-
build_after_setup: false,
|
|
359
|
-
setup_mode: "select-build-plan",
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
export function preparationSetupRequestFromActionValues(input) {
|
|
363
|
-
const values = PreparationSetupActionValuesSchema.parse(input);
|
|
364
|
-
const buildPlan = values.build_plan;
|
|
365
|
-
return {
|
|
366
|
-
build_after_setup: values.build_after_setup ?? false,
|
|
367
|
-
setup_mode: values.setup_mode === "select-build-plan" ? "select-build-plan" : "create",
|
|
368
|
-
preparation: {
|
|
369
|
-
name: values.name,
|
|
370
|
-
path: values.path,
|
|
371
|
-
about: values.about,
|
|
372
|
-
...(buildPlan && buildPlan.length > 0 ? { build_plan: buildPlan } : {}),
|
|
373
|
-
checks: values.checks ?? [],
|
|
374
|
-
...(values.requested_artifacts ? { requested_artifacts: values.requested_artifacts } : {}),
|
|
375
|
-
...(values.source_profile ? { source_profile: values.source_profile } : {}),
|
|
376
|
-
...(typeof values.max_attempts === "number" ? { max_attempts: values.max_attempts } : {}),
|
|
377
|
-
...(typeof values.max_loops === "number" ? { max_loops: values.max_loops } : {}),
|
|
378
|
-
},
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
export function buildPlanAuthoringRequestFromActionValues(input, context) {
|
|
382
|
-
const values = BuildPlanAuthoringActionValuesSchema.parse(input);
|
|
383
|
-
const buildPlanId = values.build_plan_id ?? values.build_plan_id;
|
|
384
|
-
if (!buildPlanId) {
|
|
385
|
-
throw new Error("Build Plan id is required.");
|
|
386
|
-
}
|
|
387
|
-
const taskPrompt = buildPlanAuthoringTaskPrompt(values);
|
|
388
|
-
const requestedArtifacts = values.requested_artifacts ?? context.requestedArtifacts ?? [];
|
|
389
|
-
const sourceProfile = values.source_profile ?? context.sourceProfile ?? null;
|
|
390
|
-
return {
|
|
391
|
-
...(context.preparation ? { preparation: context.preparation } : {}),
|
|
392
|
-
source_folder_path: context.sourceFolderPath,
|
|
393
|
-
...(values.base_build_plan_id ?? values.base_build_plan_id ? { base_build_plan_id: values.base_build_plan_id ?? values.base_build_plan_id } : {}),
|
|
394
|
-
...(values.reference_build_plan_id ?? values.reference_build_plan_id ? { reference_build_plan_id: values.reference_build_plan_id ?? values.reference_build_plan_id } : {}),
|
|
395
|
-
build_plan_id: buildPlanId,
|
|
396
|
-
label: values.label ?? titleFromActionId(buildPlanId),
|
|
397
|
-
hint: values.hint ?? conciseSummary(values.requested_artifacts_description ?? values.task_prompt, "Reusable Build Plan for building Artifacts."),
|
|
398
|
-
task_prompt: taskPrompt,
|
|
399
|
-
checks: context.checks ?? [],
|
|
400
|
-
requested_artifacts: requestedArtifacts,
|
|
401
|
-
source_profile: sourceProfile,
|
|
402
|
-
artifact_requirements: artifactRequirementsFromRequestedArtifacts(requestedArtifacts),
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
export function buildPlanImprovementActionValues(options) {
|
|
406
|
-
const readinessNotes = (options.checks ?? [])
|
|
407
|
-
.map((check) => check.question)
|
|
408
|
-
.filter((question) => question.trim().length > 0)
|
|
409
|
-
.join("\n");
|
|
410
|
-
return {
|
|
411
|
-
build_plan_id: options.buildPlanId,
|
|
412
|
-
reference_build_plan_id: options.buildPlanId,
|
|
413
|
-
...(maybeActionValue(options.label ?? "") ? { label: options.label } : {}),
|
|
414
|
-
...(maybeActionValue(options.hint ?? "") ? { hint: options.hint } : {}),
|
|
415
|
-
task_prompt: `Improve Build Plan ${options.buildPlanId} using the latest readiness evidence for Preparation ${options.preparationName}.`,
|
|
416
|
-
...(maybeActionValue(readinessNotes) ? { readiness_notes: readinessNotes } : {}),
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
function buildPlanAuthoringActionValues(values) {
|
|
420
|
-
const buildPlanId = inputValue(values, "build_plan_id");
|
|
421
|
-
const label = inputValue(values, "label");
|
|
422
|
-
const hint = inputValue(values, "hint");
|
|
423
|
-
const requestedArtifactsDescription = inputValue(values, "requested_artifacts_description");
|
|
424
|
-
const readinessNotes = inputValue(values, "readiness_notes");
|
|
425
|
-
return {
|
|
426
|
-
...(maybeActionValue(buildPlanId) ? { build_plan_id: buildPlanId } : {}),
|
|
427
|
-
...(maybeActionValue(label) ? { label } : {}),
|
|
428
|
-
...(maybeActionValue(hint) ? { hint } : {}),
|
|
429
|
-
task_prompt: inputValue(values, "task_prompt"),
|
|
430
|
-
...(maybeActionValue(requestedArtifactsDescription) ? { requested_artifacts_description: requestedArtifactsDescription } : {}),
|
|
431
|
-
...(maybeActionValue(readinessNotes) ? { readiness_notes: readinessNotes } : {}),
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
function buildPlanChangeActionValues(action, values) {
|
|
435
|
-
if (action === "modify") {
|
|
436
|
-
const buildPlanId = inputValue(values, "build_plan");
|
|
437
|
-
return {
|
|
438
|
-
build_plan_id: buildPlanId,
|
|
439
|
-
reference_build_plan_id: buildPlanId,
|
|
440
|
-
...(maybeActionValue(inputValue(values, "label")) ? { label: inputValue(values, "label") } : {}),
|
|
441
|
-
...(maybeActionValue(inputValue(values, "hint")) ? { hint: inputValue(values, "hint") } : {}),
|
|
442
|
-
task_prompt: [
|
|
443
|
-
`Modify Build Plan ${buildPlanId}.`,
|
|
444
|
-
inputValue(values, "change_request"),
|
|
445
|
-
].filter(Boolean).join("\n"),
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
if (action === "duplicate") {
|
|
449
|
-
const newBuildPlanId = inputValue(values, "new_build_plan_id");
|
|
450
|
-
return {
|
|
451
|
-
action_type: "build-plan-change",
|
|
452
|
-
operation: "duplicate",
|
|
453
|
-
build_plan: inputValue(values, "build_plan"),
|
|
454
|
-
new_build_plan_id: newBuildPlanId,
|
|
455
|
-
label: titleFromActionId(newBuildPlanId),
|
|
456
|
-
hint: `Duplicate of ${inputValue(values, "build_plan")}`,
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
return {
|
|
460
|
-
action_type: "build-plan-change",
|
|
461
|
-
operation: "remove",
|
|
462
|
-
build_plan: inputValue(values, "build_plan"),
|
|
463
|
-
confirmation: inputValue(values, "confirmation"),
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function duplicatePreparationActionValues(values) {
|
|
467
|
-
const buildPlan = inputValue(values, "build_plan");
|
|
468
|
-
return {
|
|
469
|
-
name: inputValue(values, "name"),
|
|
470
|
-
path: inputValue(values, "path"),
|
|
471
|
-
about: inputValue(values, "about"),
|
|
472
|
-
build_after_setup: false,
|
|
473
|
-
setup_mode: "create",
|
|
474
|
-
...(maybeActionValue(buildPlan) ? { build_plan: buildPlan } : {}),
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function preparationChangeActionValues(action, values) {
|
|
478
|
-
if (action === "modify" || action === "duplicate")
|
|
479
|
-
return duplicatePreparationActionValues(values);
|
|
480
|
-
return {
|
|
481
|
-
action_type: "preparation-change",
|
|
482
|
-
operation: "remove",
|
|
483
|
-
preparation: inputValue(values, "preparation"),
|
|
484
|
-
confirmation: inputValue(values, "confirmation"),
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
export function buildCreatePreparationActionDefinition(context) {
|
|
488
|
-
const existingNames = new Set(context.existingNames);
|
|
489
|
-
const name = uniqueActionId(context.suggestedName, existingNames);
|
|
490
|
-
return {
|
|
491
|
-
id: INTERF_SERVICE_ACTIONS.createPreparation.id,
|
|
492
|
-
title: INTERF_SERVICE_ACTIONS.createPreparation.title,
|
|
493
|
-
description: "Describe the Source and agent job. Interf saves a Preparation so a Build Plan can be drafted and reviewed before build.",
|
|
494
|
-
submitLabel: "Create",
|
|
495
|
-
initialValues: {
|
|
496
|
-
name,
|
|
497
|
-
path: context.prepDataDir,
|
|
498
|
-
about: "",
|
|
499
|
-
readiness_notes: "",
|
|
500
|
-
},
|
|
501
|
-
schema: createPreparationSchema(existingNames),
|
|
502
|
-
validateRequest: (values) => packageSchemaFieldErrors(PreparationSetupActionValuesSchema.safeParse(createPreparationActionValues(values)), {
|
|
503
|
-
name: "name",
|
|
504
|
-
path: "path",
|
|
505
|
-
about: "about",
|
|
506
|
-
build_plan: "build_plan",
|
|
507
|
-
}),
|
|
508
|
-
valuesPreview: createPreparationActionValues,
|
|
509
|
-
buildDraft: (values) => {
|
|
510
|
-
const actionValues = createPreparationActionValues(values);
|
|
511
|
-
const readinessNotes = inputValue(values, "readiness_notes");
|
|
512
|
-
return {
|
|
513
|
-
preparation: inputValue(values, "name"),
|
|
514
|
-
values: actionValues,
|
|
515
|
-
message: [
|
|
516
|
-
`Create Preparation ${inputValue(values, "name")}.`,
|
|
517
|
-
`Agent work: ${inputValue(values, "about")}`,
|
|
518
|
-
maybeActionValue(readinessNotes) ? `Requested Artifacts and readiness: ${readinessNotes}` : null,
|
|
519
|
-
`Source folder: ${inputValue(values, "path")}`,
|
|
520
|
-
"Draft or select the Build Plan after this Preparation exists. Do not build yet.",
|
|
521
|
-
"Use the attached typed action input as the source of truth.",
|
|
522
|
-
].filter((line) => Boolean(line)).join("\n"),
|
|
523
|
-
};
|
|
524
|
-
},
|
|
525
|
-
fields: [
|
|
526
|
-
{
|
|
527
|
-
name: "path",
|
|
528
|
-
label: "Source folder",
|
|
529
|
-
type: "text",
|
|
530
|
-
help: "Absolute path to the folder Interf will read from. Files stay where they are; Interf reads them by reference.",
|
|
531
|
-
context: "Saved as the Preparation's source binding and sent as typed action input.",
|
|
532
|
-
placeholder: context.prepDataDir || "/Users/you/Documents/your-folder",
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
name: "about",
|
|
536
|
-
label: "Agent job",
|
|
537
|
-
type: "textarea",
|
|
538
|
-
rows: 4,
|
|
539
|
-
help: "The concrete work this Preparation should enable.",
|
|
540
|
-
context: "Saved as the Preparation intent and sent as typed action input.",
|
|
541
|
-
placeholder: "Example: Analyze every report chart, extract annual take-up by location, and produce a source data file plus markdown summary.",
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
name: "readiness_notes",
|
|
545
|
-
label: "Requested Artifacts",
|
|
546
|
-
type: "textarea",
|
|
547
|
-
rows: 3,
|
|
548
|
-
help: "Artifacts, coverage, and proof the agent needs before it can trust the Source.",
|
|
549
|
-
context: "Used as guidance when Interf drafts the Build Plan and readiness checks for review.",
|
|
550
|
-
placeholder: "Example: Extract every chart, produce a source data file, write a markdown summary, and show evidence for every location.",
|
|
551
|
-
},
|
|
552
|
-
],
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
export function buildBuildRunActionDefinition(context) {
|
|
556
|
-
return {
|
|
557
|
-
id: INTERF_SERVICE_ACTIONS.buildRun.id,
|
|
558
|
-
title: INTERF_SERVICE_ACTIONS.buildRun.title,
|
|
559
|
-
description: "Build verifiable context for this Preparation. Interf will run the saved Build Plan against the Source and record a visible run.",
|
|
560
|
-
submitLabel: "Run",
|
|
561
|
-
initialValues: {
|
|
562
|
-
preparation: context.name,
|
|
563
|
-
build_plan: context.buildPlanId,
|
|
564
|
-
about: context.about,
|
|
565
|
-
source_folder_path: context.sourceFolderPath,
|
|
566
|
-
},
|
|
567
|
-
schema: prepareRunSchema(),
|
|
568
|
-
valuesPreview: (values) => ({
|
|
569
|
-
action_type: INTERF_SERVICE_ACTIONS.buildRun.serviceAction,
|
|
570
|
-
preparation: inputValue(values, "preparation"),
|
|
571
|
-
build_plan: inputValue(values, "build_plan"),
|
|
572
|
-
source_folder_path: inputValue(values, "source_folder_path"),
|
|
573
|
-
about: inputValue(values, "about"),
|
|
574
|
-
}),
|
|
575
|
-
buildDraft: (values) => ({
|
|
576
|
-
preparation: inputValue(values, "preparation"),
|
|
577
|
-
values: {
|
|
578
|
-
action_type: INTERF_SERVICE_ACTIONS.buildRun.serviceAction,
|
|
579
|
-
preparation: inputValue(values, "preparation"),
|
|
580
|
-
...(maybeActionValue(inputValue(values, "build_plan")) ? { build_plan: inputValue(values, "build_plan") } : {}),
|
|
581
|
-
},
|
|
582
|
-
message: [
|
|
583
|
-
`Build Artifacts for Preparation ${inputValue(values, "preparation")}.`,
|
|
584
|
-
maybeActionValue(inputValue(values, "about")) ? `Agent work: ${inputValue(values, "about")}` : null,
|
|
585
|
-
`Build Plan: ${inputValue(values, "build_plan") || "(saved selection)"}.`,
|
|
586
|
-
"Build verifiable context from the saved Source and requested Artifacts.",
|
|
587
|
-
"Use the attached typed action input as the source of truth.",
|
|
588
|
-
].filter((line) => Boolean(line)).join("\n"),
|
|
589
|
-
}),
|
|
590
|
-
fields: [
|
|
591
|
-
{
|
|
592
|
-
name: "preparation",
|
|
593
|
-
label: "Preparation",
|
|
594
|
-
type: "text",
|
|
595
|
-
readOnly: true,
|
|
596
|
-
help: "The saved Preparation that will be built.",
|
|
597
|
-
context: "Sent as the build target.",
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
name: "build_plan",
|
|
601
|
-
label: "Build Plan",
|
|
602
|
-
type: "text",
|
|
603
|
-
readOnly: true,
|
|
604
|
-
help: "The Build Plan Interf will run to build the requested Artifacts.",
|
|
605
|
-
context: "Sent as the Build Plan override.",
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
name: "about",
|
|
609
|
-
label: "Agent job",
|
|
610
|
-
type: "textarea",
|
|
611
|
-
readOnly: true,
|
|
612
|
-
advanced: true,
|
|
613
|
-
help: "The work this Preparation is meant to support.",
|
|
614
|
-
context: "Preserved as context for the Build run proposal.",
|
|
615
|
-
placeholder: "No saved job description.",
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
name: "source_folder_path",
|
|
619
|
-
label: "Source Folder",
|
|
620
|
-
type: "text",
|
|
621
|
-
readOnly: true,
|
|
622
|
-
advanced: true,
|
|
623
|
-
help: "The local folder Interf will read.",
|
|
624
|
-
context: "Resolved from the saved Preparation.",
|
|
625
|
-
},
|
|
626
|
-
],
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
export function buildBuildRunActionDraft(context) {
|
|
630
|
-
const definition = buildBuildRunActionDefinition(context);
|
|
631
|
-
return definition.buildDraft(definition.initialValues);
|
|
632
|
-
}
|
|
633
|
-
export function buildSelectBuildPlanActionDefinition(context) {
|
|
634
|
-
const actionValues = (values) => ({
|
|
635
|
-
...selectBuildPlanActionValues(values),
|
|
636
|
-
checks: context.checks ?? [],
|
|
637
|
-
requested_artifacts: context.requestedArtifacts ?? [],
|
|
638
|
-
...(context.sourceProfile ? { source_profile: context.sourceProfile } : {}),
|
|
639
|
-
...(typeof context.maxAttempts === "number" ? { max_attempts: context.maxAttempts } : {}),
|
|
640
|
-
...(typeof context.maxLoops === "number" ? { max_loops: context.maxLoops } : {}),
|
|
641
|
-
});
|
|
642
|
-
return {
|
|
643
|
-
id: INTERF_SERVICE_ACTIONS.selectBuildPlan.id,
|
|
644
|
-
title: INTERF_SERVICE_ACTIONS.selectBuildPlan.title,
|
|
645
|
-
description: "Choose the Build Plan that builds this Preparation's requested Artifacts. This saves the selection without running a Build run.",
|
|
646
|
-
submitLabel: "Confirm",
|
|
647
|
-
initialValues: {
|
|
648
|
-
name: context.name,
|
|
649
|
-
path: context.sourceFolderPath,
|
|
650
|
-
about: context.about,
|
|
651
|
-
current_build_plan: context.currentBuildPlanId ?? "",
|
|
652
|
-
build_plan: context.currentBuildPlanId ?? "",
|
|
653
|
-
},
|
|
654
|
-
schema: selectBuildPlanSchema(),
|
|
655
|
-
validateRequest: (values) => packageSchemaFieldErrors(PreparationSetupActionValuesSchema.safeParse(actionValues(values)), {
|
|
656
|
-
name: "name",
|
|
657
|
-
path: "path",
|
|
658
|
-
about: "about",
|
|
659
|
-
build_plan: "build_plan",
|
|
660
|
-
}),
|
|
661
|
-
valuesPreview: actionValues,
|
|
662
|
-
buildDraft: (values) => ({
|
|
663
|
-
preparation: inputValue(values, "name"),
|
|
664
|
-
values: actionValues(values),
|
|
665
|
-
message: [
|
|
666
|
-
`Select Build Plan ${inputValue(values, "build_plan")} for Preparation ${inputValue(values, "name")}.`,
|
|
667
|
-
"Save the selected Build Plan. Do not build yet.",
|
|
668
|
-
"Use the attached typed action input as the source of truth.",
|
|
669
|
-
].join("\n"),
|
|
670
|
-
}),
|
|
671
|
-
fields: [
|
|
672
|
-
{
|
|
673
|
-
name: "build_plan",
|
|
674
|
-
label: "Build Plan",
|
|
675
|
-
type: "select",
|
|
676
|
-
help: "The Build Plan future Build runs should use to build requested Artifacts.",
|
|
677
|
-
context: "Saved on the existing Preparation.",
|
|
678
|
-
options: buildPlanChoiceOptions(context.buildPlans),
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
name: "current_build_plan",
|
|
682
|
-
label: "Current Build Plan",
|
|
683
|
-
type: "text",
|
|
684
|
-
readOnly: true,
|
|
685
|
-
help: "The Build Plan currently saved for this Preparation.",
|
|
686
|
-
context: "Shown so the change is explicit before approval.",
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
name: "name",
|
|
690
|
-
label: "Preparation",
|
|
691
|
-
type: "text",
|
|
692
|
-
readOnly: true,
|
|
693
|
-
advanced: true,
|
|
694
|
-
help: "The Preparation whose Build Plan selection will be updated.",
|
|
695
|
-
context: "Sent with the setup action.",
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
name: "about",
|
|
699
|
-
label: "Agent job",
|
|
700
|
-
type: "textarea",
|
|
701
|
-
readOnly: true,
|
|
702
|
-
advanced: true,
|
|
703
|
-
help: "The saved job intent for this Preparation.",
|
|
704
|
-
context: "Preserved while updating the selected Build Plan.",
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
name: "path",
|
|
708
|
-
label: "Source Folder",
|
|
709
|
-
type: "text",
|
|
710
|
-
readOnly: true,
|
|
711
|
-
advanced: true,
|
|
712
|
-
help: "The saved Source Folder path.",
|
|
713
|
-
context: "Preserved while updating the selected Build Plan.",
|
|
714
|
-
},
|
|
715
|
-
],
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
export function buildCreateBuildPlanActionDefinition(context) {
|
|
719
|
-
const existingBuildPlanIds = new Set(context.existingBuildPlanIds);
|
|
720
|
-
const defaultSeed = context.defaultPreparation ? `${context.defaultPreparation}-build-plan` : context.suggestedBuildPlanId;
|
|
721
|
-
const buildPlanId = uniqueActionId(defaultSeed, existingBuildPlanIds);
|
|
722
|
-
const label = titleFromActionId(buildPlanId);
|
|
723
|
-
return {
|
|
724
|
-
id: INTERF_SERVICE_ACTIONS.createBuildPlan.id,
|
|
725
|
-
title: INTERF_SERVICE_ACTIONS.createBuildPlan.title,
|
|
726
|
-
description: "Describe the Artifacts the agent needs. Interf drafts the Build Plan from this description; the Build run later proves source coverage.",
|
|
727
|
-
submitLabel: "Send Request",
|
|
728
|
-
initialValues: {
|
|
729
|
-
build_plan_id: "",
|
|
730
|
-
label: "",
|
|
731
|
-
hint: "",
|
|
732
|
-
task_prompt: "",
|
|
733
|
-
requested_artifacts_description: "",
|
|
734
|
-
readiness_notes: "",
|
|
735
|
-
},
|
|
736
|
-
normalizeValues: (values) => normalizedBuildPlanActionValues(values, existingBuildPlanIds, defaultSeed),
|
|
737
|
-
schema: buildPlanAuthoringSchema(existingBuildPlanIds),
|
|
738
|
-
validateRequest: (values) => packageSchemaFieldErrors(BuildPlanAuthoringActionValuesSchema.safeParse(buildPlanAuthoringActionValues(values)), {
|
|
739
|
-
build_plan_id: "build_plan_id",
|
|
740
|
-
label: "label",
|
|
741
|
-
hint: "hint",
|
|
742
|
-
task_prompt: "task_prompt",
|
|
743
|
-
requested_artifacts_description: "requested_artifacts_description",
|
|
744
|
-
readiness_notes: "readiness_notes",
|
|
745
|
-
}),
|
|
746
|
-
valuesPreview: (values) => ({
|
|
747
|
-
build_plan_id: inputValue(values, "build_plan_id"),
|
|
748
|
-
label: inputValue(values, "label"),
|
|
749
|
-
hint: inputValue(values, "hint"),
|
|
750
|
-
task_prompt: buildPlanTaskPromptFromInput(values),
|
|
751
|
-
}),
|
|
752
|
-
buildDraft: (values) => ({
|
|
753
|
-
preparation: context.defaultPreparation,
|
|
754
|
-
values: buildPlanAuthoringActionValues(values),
|
|
755
|
-
message: [
|
|
756
|
-
`Draft Build Plan ${inputValue(values, "build_plan_id")}${context.defaultPreparation ? ` for Preparation ${context.defaultPreparation}` : ""}.`,
|
|
757
|
-
`Label: ${inputValue(values, "label")}`,
|
|
758
|
-
`Summary: ${inputValue(values, "hint")}`,
|
|
759
|
-
buildPlanTaskPromptFromInput(values),
|
|
760
|
-
"Use the attached typed action input as the Build Plan authoring request.",
|
|
761
|
-
].join("\n"),
|
|
762
|
-
}),
|
|
763
|
-
fields: [
|
|
764
|
-
{
|
|
765
|
-
name: "task_prompt",
|
|
766
|
-
label: "Agent work",
|
|
767
|
-
type: "textarea",
|
|
768
|
-
rows: 4,
|
|
769
|
-
help: "The agent task this Preparation should unlock.",
|
|
770
|
-
context: "Used as the main Build Plan authoring instruction.",
|
|
771
|
-
placeholder: "Example: Analyze every report chart, extract annual take-up by location, and produce a source data file plus markdown summary.",
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
name: "requested_artifacts_description",
|
|
775
|
-
label: "Requested Artifacts",
|
|
776
|
-
type: "textarea",
|
|
777
|
-
rows: 3,
|
|
778
|
-
help: "Files, sections, or evidence agents should receive in verifiable context.",
|
|
779
|
-
context: "Guides the requested Artifact shape and Build Plan stages before a Build run proves source coverage.",
|
|
780
|
-
placeholder: "Describe the files or sections agents should receive.",
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
name: "readiness_notes",
|
|
784
|
-
label: "Readiness guidance",
|
|
785
|
-
type: "textarea",
|
|
786
|
-
rows: 3,
|
|
787
|
-
help: "What these Artifacts should be able to prove.",
|
|
788
|
-
context: "Guides readiness checks. Artifact contract checks stay separate.",
|
|
789
|
-
placeholder: "Describe the evidence that should make these Artifacts ready.",
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
name: "build_plan_id",
|
|
793
|
-
label: "Build Plan id",
|
|
794
|
-
type: "text",
|
|
795
|
-
advanced: true,
|
|
796
|
-
help: "Optional. Leave blank and Interf generates a stable id from the job.",
|
|
797
|
-
context: "Saved as the Build Plan id and referenced by Preparations.",
|
|
798
|
-
placeholder: buildPlanId,
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
name: "label",
|
|
802
|
-
label: "Label",
|
|
803
|
-
type: "text",
|
|
804
|
-
advanced: true,
|
|
805
|
-
help: "Optional readable name people can choose later.",
|
|
806
|
-
context: "Shown in the UI and sent to the local agent while drafting the Build Plan.",
|
|
807
|
-
placeholder: label,
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
name: "hint",
|
|
811
|
-
label: "Summary",
|
|
812
|
-
type: "textarea",
|
|
813
|
-
advanced: true,
|
|
814
|
-
rows: 2,
|
|
815
|
-
help: "Optional short description. Interf derives one from the job if left blank.",
|
|
816
|
-
context: "Gives the local agent quick context before it drafts stages and outputs.",
|
|
817
|
-
placeholder: "Prepare charts, tables, and cited findings for analyst agents.",
|
|
818
|
-
},
|
|
819
|
-
],
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
export function buildBuildPlanChangeActionDefinition(context) {
|
|
823
|
-
const existingBuildPlanIds = new Set(context.existingBuildPlanIds);
|
|
824
|
-
const actionLabel = titleFromActionId(context.action);
|
|
825
|
-
const newBuildPlanId = context.action === "duplicate"
|
|
826
|
-
? uniqueActionId(`${context.buildPlanId}-copy`, existingBuildPlanIds)
|
|
827
|
-
: "";
|
|
828
|
-
const initialValues = {
|
|
829
|
-
action: `build-plan-${context.action}`,
|
|
830
|
-
build_plan: context.buildPlanId,
|
|
831
|
-
preparation: context.preparation,
|
|
832
|
-
...(context.action === "modify" ? { change_request: "", label: context.label ?? "", hint: context.hint ?? "" } : {}),
|
|
833
|
-
...(context.action === "duplicate" ? { new_build_plan_id: newBuildPlanId } : {}),
|
|
834
|
-
...(context.action === "remove" ? { confirmation: "" } : {}),
|
|
835
|
-
};
|
|
836
|
-
const actionValues = (values) => buildPlanChangeActionValues(context.action, values);
|
|
837
|
-
const messageFor = (values) => {
|
|
838
|
-
if (context.action === "modify") {
|
|
839
|
-
return [
|
|
840
|
-
`Modify Build Plan ${inputValue(values, "build_plan")}.`,
|
|
841
|
-
`Requested change: ${inputValue(values, "change_request")}`,
|
|
842
|
-
"Use the attached typed Build Plan authoring input as the source of truth.",
|
|
843
|
-
].join("\n");
|
|
844
|
-
}
|
|
845
|
-
if (context.action === "duplicate") {
|
|
846
|
-
return [
|
|
847
|
-
`Duplicate Build Plan ${inputValue(values, "build_plan")} as ${inputValue(values, "new_build_plan_id")}.`,
|
|
848
|
-
"Use the attached typed Build Plan change input as the source of truth.",
|
|
849
|
-
].join("\n");
|
|
850
|
-
}
|
|
851
|
-
return [
|
|
852
|
-
`Remove Build Plan ${inputValue(values, "build_plan")}.`,
|
|
853
|
-
"The user typed the Build Plan id to confirm removal.",
|
|
854
|
-
"Use the attached typed Build Plan change input as the source of truth.",
|
|
855
|
-
].join("\n");
|
|
856
|
-
};
|
|
857
|
-
const fields = [
|
|
858
|
-
{
|
|
859
|
-
name: "build_plan",
|
|
860
|
-
label: "Build Plan",
|
|
861
|
-
type: "text",
|
|
862
|
-
readOnly: true,
|
|
863
|
-
help: "The Build Plan this request targets.",
|
|
864
|
-
context: "Sent as the Build Plan change target.",
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
name: "change_request",
|
|
868
|
-
label: context.action === "duplicate" ? "Requested difference" : "Requested change",
|
|
869
|
-
type: "textarea",
|
|
870
|
-
rows: 4,
|
|
871
|
-
advanced: context.action === "remove",
|
|
872
|
-
help: context.action === "duplicate"
|
|
873
|
-
? "What should be different in the duplicate Build Plan."
|
|
874
|
-
: "What should change in the existing Build Plan.",
|
|
875
|
-
context: "Sent as the human-authored Build Plan change request.",
|
|
876
|
-
placeholder: "Describe the concrete change Interf should make.",
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
name: "new_build_plan_id",
|
|
880
|
-
label: "New Build Plan id",
|
|
881
|
-
type: "text",
|
|
882
|
-
advanced: context.action !== "duplicate",
|
|
883
|
-
help: "Stable id for the duplicated Build Plan.",
|
|
884
|
-
context: "Used as the target Build Plan id for the duplicate request.",
|
|
885
|
-
placeholder: newBuildPlanId,
|
|
886
|
-
},
|
|
887
|
-
{
|
|
888
|
-
name: "confirmation",
|
|
889
|
-
label: "Confirm removal",
|
|
890
|
-
type: "text",
|
|
891
|
-
advanced: context.action !== "remove",
|
|
892
|
-
help: `Type ${context.buildPlanId} to confirm this removal request.`,
|
|
893
|
-
context: "Prevents accidental destructive Build Plan requests.",
|
|
894
|
-
placeholder: context.buildPlanId,
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
name: "label",
|
|
898
|
-
label: "Label",
|
|
899
|
-
type: "text",
|
|
900
|
-
advanced: true,
|
|
901
|
-
help: "Readable Build Plan name to keep while modifying this Build Plan.",
|
|
902
|
-
context: "Sent to the Build Plan authoring run.",
|
|
903
|
-
placeholder: context.label ?? context.buildPlanId,
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
name: "hint",
|
|
907
|
-
label: "Summary",
|
|
908
|
-
type: "textarea",
|
|
909
|
-
rows: 2,
|
|
910
|
-
advanced: true,
|
|
911
|
-
help: "Short Build Plan summary to keep while modifying this Build Plan.",
|
|
912
|
-
context: "Sent to the Build Plan authoring run.",
|
|
913
|
-
placeholder: context.hint ?? "Reusable Build Plan for compiling Artifacts.",
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
name: "preparation",
|
|
917
|
-
label: "Preparation",
|
|
918
|
-
type: "text",
|
|
919
|
-
readOnly: true,
|
|
920
|
-
advanced: true,
|
|
921
|
-
help: "A related Preparation used as context for this request.",
|
|
922
|
-
context: "Sent with the proposal request when available.",
|
|
923
|
-
placeholder: "No Preparation selected",
|
|
924
|
-
},
|
|
925
|
-
];
|
|
926
|
-
return {
|
|
927
|
-
id: `${INTERF_SERVICE_ACTIONS.buildPlanChange.id}-${context.action}`,
|
|
928
|
-
title: `${actionLabel} Build Plan`,
|
|
929
|
-
description: context.action === "remove"
|
|
930
|
-
? "Confirm the Build Plan removal request. Interf will reject removal while any saved Preparation still uses it."
|
|
931
|
-
: context.action === "duplicate"
|
|
932
|
-
? "Duplicate this Build Plan through the local Interf service."
|
|
933
|
-
: "Describe the change and Interf will run a visible Build Plan draft job.",
|
|
934
|
-
submitLabel: context.action === "modify" ? "Send Request" : "Confirm",
|
|
935
|
-
initialValues,
|
|
936
|
-
schema: buildPlanChangeSchema(context.action, context.buildPlanId, existingBuildPlanIds),
|
|
937
|
-
valuesPreview: actionValues,
|
|
938
|
-
buildDraft: (values) => ({
|
|
939
|
-
preparation: inputValue(values, "preparation"),
|
|
940
|
-
values: actionValues(values),
|
|
941
|
-
message: messageFor(values),
|
|
942
|
-
}),
|
|
943
|
-
fields: fields.filter((field) => {
|
|
944
|
-
if (field.name === "change_request")
|
|
945
|
-
return context.action === "modify";
|
|
946
|
-
if (field.name === "new_build_plan_id")
|
|
947
|
-
return context.action === "duplicate";
|
|
948
|
-
if (field.name === "confirmation")
|
|
949
|
-
return context.action === "remove";
|
|
950
|
-
if (field.name === "label" || field.name === "hint")
|
|
951
|
-
return context.action === "modify";
|
|
952
|
-
return true;
|
|
953
|
-
}),
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
export function buildPreparationChangeActionDefinition(context) {
|
|
957
|
-
const existingNames = new Set(context.existingNames);
|
|
958
|
-
const actionLabel = titleFromActionId(context.action);
|
|
959
|
-
const duplicateName = context.action === "duplicate"
|
|
960
|
-
? uniqueActionId(`${context.preparation}-copy`, existingNames)
|
|
961
|
-
: "";
|
|
962
|
-
const initialValues = {
|
|
963
|
-
action: `preparation-${context.action}`,
|
|
964
|
-
preparation: context.preparation,
|
|
965
|
-
...(context.action === "modify" || context.action === "duplicate"
|
|
966
|
-
? {
|
|
967
|
-
name: context.action === "duplicate" ? duplicateName : context.preparation,
|
|
968
|
-
path: context.sourceFolderPath,
|
|
969
|
-
about: context.about ?? "",
|
|
970
|
-
build_plan: context.buildPlanId ?? "",
|
|
971
|
-
}
|
|
972
|
-
: {}),
|
|
973
|
-
...(context.action === "remove" ? { confirmation: "" } : {}),
|
|
974
|
-
};
|
|
975
|
-
const actionValues = (values) => preparationChangeActionValues(context.action, values);
|
|
976
|
-
const messageFor = (values) => {
|
|
977
|
-
if (context.action === "modify") {
|
|
978
|
-
return [
|
|
979
|
-
`Modify Preparation ${inputValue(values, "preparation")}.`,
|
|
980
|
-
`Agent work: ${inputValue(values, "about")}`,
|
|
981
|
-
maybeActionValue(inputValue(values, "build_plan")) ? `Build Plan: ${inputValue(values, "build_plan")}` : null,
|
|
982
|
-
`Source folder: ${inputValue(values, "path")}`,
|
|
983
|
-
"Use the attached typed Preparation setup input as the source of truth.",
|
|
984
|
-
].filter((line) => Boolean(line)).join("\n");
|
|
985
|
-
}
|
|
986
|
-
if (context.action === "duplicate") {
|
|
987
|
-
return [
|
|
988
|
-
`Duplicate Preparation ${inputValue(values, "preparation")} as ${inputValue(values, "name")}.`,
|
|
989
|
-
`Agent work: ${inputValue(values, "about")}`,
|
|
990
|
-
maybeActionValue(inputValue(values, "build_plan")) ? `Build Plan: ${inputValue(values, "build_plan")}` : null,
|
|
991
|
-
`Source folder: ${inputValue(values, "path")}`,
|
|
992
|
-
"Use the attached typed Preparation setup input as the source of truth.",
|
|
993
|
-
].filter((line) => Boolean(line)).join("\n");
|
|
994
|
-
}
|
|
995
|
-
return [
|
|
996
|
-
`Remove Preparation ${inputValue(values, "preparation")}.`,
|
|
997
|
-
"The user typed the Preparation id to confirm removal.",
|
|
998
|
-
"Use the attached typed Preparation change input as the source of truth.",
|
|
999
|
-
].join("\n");
|
|
1000
|
-
};
|
|
1001
|
-
const fields = [
|
|
1002
|
-
{
|
|
1003
|
-
name: "preparation",
|
|
1004
|
-
label: "Preparation",
|
|
1005
|
-
type: "text",
|
|
1006
|
-
readOnly: true,
|
|
1007
|
-
help: "The saved Preparation this request targets.",
|
|
1008
|
-
context: "Sent as the Preparation target.",
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
name: "name",
|
|
1012
|
-
label: context.action === "duplicate" ? "New Preparation id" : "Preparation id",
|
|
1013
|
-
type: "text",
|
|
1014
|
-
readOnly: context.action === "modify",
|
|
1015
|
-
help: context.action === "duplicate"
|
|
1016
|
-
? "Stable id for the duplicated Preparation."
|
|
1017
|
-
: "Stable id for this Preparation.",
|
|
1018
|
-
context: "Saved as the Preparation name.",
|
|
1019
|
-
placeholder: duplicateName || context.preparation,
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
name: "about",
|
|
1023
|
-
label: "Agent job",
|
|
1024
|
-
type: "textarea",
|
|
1025
|
-
rows: 4,
|
|
1026
|
-
help: "The concrete work this Preparation should support.",
|
|
1027
|
-
context: "Saved as the Preparation intent.",
|
|
1028
|
-
placeholder: "Describe the agent job.",
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
name: "build_plan",
|
|
1032
|
-
label: "Build Plan",
|
|
1033
|
-
type: "text",
|
|
1034
|
-
help: "The Build Plan future Build runs should use.",
|
|
1035
|
-
context: "Saved on this Preparation.",
|
|
1036
|
-
placeholder: "interf-default",
|
|
1037
|
-
},
|
|
1038
|
-
{
|
|
1039
|
-
name: "path",
|
|
1040
|
-
label: "Source Folder",
|
|
1041
|
-
type: "text",
|
|
1042
|
-
readOnly: true,
|
|
1043
|
-
advanced: context.action === "modify",
|
|
1044
|
-
help: "The Source Folder for this Preparation.",
|
|
1045
|
-
context: "Saved on this Preparation.",
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
name: "confirmation",
|
|
1049
|
-
label: "Confirm removal",
|
|
1050
|
-
type: "text",
|
|
1051
|
-
help: `Type ${context.preparation} to confirm this removal request.`,
|
|
1052
|
-
context: "Prevents accidental destructive Preparation requests.",
|
|
1053
|
-
placeholder: context.preparation,
|
|
1054
|
-
},
|
|
1055
|
-
];
|
|
1056
|
-
return {
|
|
1057
|
-
id: `${INTERF_SERVICE_ACTIONS.preparationChange.id}-${context.action}`,
|
|
1058
|
-
title: `${actionLabel} Preparation`,
|
|
1059
|
-
description: context.action === "remove"
|
|
1060
|
-
? "Confirm the Preparation removal request before Interf removes it from the saved config."
|
|
1061
|
-
: context.action === "duplicate"
|
|
1062
|
-
? "Describe the new Preparation created from this saved Source Folder."
|
|
1063
|
-
: "Update the saved Preparation fields through the local Interf service.",
|
|
1064
|
-
submitLabel: "Confirm",
|
|
1065
|
-
initialValues,
|
|
1066
|
-
schema: preparationChangeSchema(context.action, context.preparation, existingNames),
|
|
1067
|
-
validateRequest: context.action === "modify" || context.action === "duplicate"
|
|
1068
|
-
? (values) => packageSchemaFieldErrors(PreparationSetupActionValuesSchema.safeParse(duplicatePreparationActionValues(values)), {
|
|
1069
|
-
name: "name",
|
|
1070
|
-
path: "path",
|
|
1071
|
-
about: "about",
|
|
1072
|
-
build_plan: "build_plan",
|
|
1073
|
-
})
|
|
1074
|
-
: undefined,
|
|
1075
|
-
valuesPreview: actionValues,
|
|
1076
|
-
buildDraft: (values) => ({
|
|
1077
|
-
preparation: inputValue(values, "preparation"),
|
|
1078
|
-
values: actionValues(values),
|
|
1079
|
-
message: messageFor(values),
|
|
1080
|
-
}),
|
|
1081
|
-
fields: fields.filter((field) => {
|
|
1082
|
-
if (field.name === "name" || field.name === "about" || field.name === "build_plan" || field.name === "path")
|
|
1083
|
-
return context.action === "modify" || context.action === "duplicate";
|
|
1084
|
-
if (field.name === "confirmation")
|
|
1085
|
-
return context.action === "remove";
|
|
1086
|
-
return true;
|
|
1087
|
-
}),
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
export function buildConfirmActionDefinition(draft) {
|
|
1091
|
-
return {
|
|
1092
|
-
id: INTERF_SERVICE_ACTIONS.confirmAction.id,
|
|
1093
|
-
title: INTERF_SERVICE_ACTIONS.confirmAction.title,
|
|
1094
|
-
description: "This request will be sent to the local Interf service to create an approval proposal.",
|
|
1095
|
-
submitLabel: "Send Request",
|
|
1096
|
-
initialValues: {
|
|
1097
|
-
preparation: draft.preparation,
|
|
1098
|
-
message: draft.message,
|
|
1099
|
-
},
|
|
1100
|
-
schema: z.object({
|
|
1101
|
-
preparation: optionalActionText,
|
|
1102
|
-
message: requiredActionText("Action"),
|
|
1103
|
-
}).strict(),
|
|
1104
|
-
valuesPreview: () => draft.values ?? { message: draft.message },
|
|
1105
|
-
buildDraft: () => ({ ...draft, confirmed: true }),
|
|
1106
|
-
fields: [
|
|
1107
|
-
{
|
|
1108
|
-
name: "preparation",
|
|
1109
|
-
label: "Preparation",
|
|
1110
|
-
type: "text",
|
|
1111
|
-
readOnly: true,
|
|
1112
|
-
help: "The Preparation this action targets.",
|
|
1113
|
-
context: "Sent with the proposal request.",
|
|
1114
|
-
placeholder: "No Preparation selected",
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
name: "message",
|
|
1118
|
-
label: "Request to Interf service",
|
|
1119
|
-
type: "textarea",
|
|
1120
|
-
readOnly: true,
|
|
1121
|
-
rows: 5,
|
|
1122
|
-
help: "Interf sends this request with typed values so the local service can propose the concrete action.",
|
|
1123
|
-
context: "Sent to the local Interf service together with typed action values when available.",
|
|
1124
|
-
},
|
|
1125
|
-
],
|
|
1126
|
-
};
|
|
1127
|
-
}
|
|
1128
|
-
export function buildReadinessActionDraft(options) {
|
|
1129
|
-
if (options.action === "check") {
|
|
1130
|
-
return {
|
|
1131
|
-
preparation: options.preparation,
|
|
1132
|
-
message: `Check readiness for ${options.preparation}.`,
|
|
1133
|
-
values: {
|
|
1134
|
-
action_type: INTERF_SERVICE_ACTIONS.checkReadiness.serviceAction,
|
|
1135
|
-
preparation: options.preparation,
|
|
1136
|
-
},
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
if (options.action === "draft-checks") {
|
|
1140
|
-
return {
|
|
1141
|
-
preparation: options.preparation,
|
|
1142
|
-
message: `Draft readiness checks for ${options.preparation}.`,
|
|
1143
|
-
values: {
|
|
1144
|
-
action_type: INTERF_SERVICE_ACTIONS.draftReadinessChecks.serviceAction,
|
|
1145
|
-
preparation: options.preparation,
|
|
1146
|
-
},
|
|
1147
|
-
};
|
|
1148
|
-
}
|
|
1149
|
-
return {
|
|
1150
|
-
preparation: options.preparation,
|
|
1151
|
-
message: `Improve ${options.preparation} using the latest readiness evidence.`,
|
|
1152
|
-
values: {
|
|
1153
|
-
action_type: INTERF_SERVICE_ACTIONS.improvePreparation.serviceAction,
|
|
1154
|
-
...(options.buildPlanId ? { build_plan: options.buildPlanId } : {}),
|
|
1155
|
-
preparation: options.preparation,
|
|
1156
|
-
},
|
|
1157
|
-
};
|
|
1158
|
-
}
|