@stravica-ai/digital-operator-pa 0.1.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/LICENSE +21 -0
- package/README.md +170 -0
- package/bin/desk +9 -0
- package/bin/distill +2 -0
- package/bin/estate-sync +2 -0
- package/bin/launch +2 -0
- package/bin/memory-sync +2 -0
- package/bin/migrate-inspect +2 -0
- package/bin/pa +2 -0
- package/bin/pa-coordinator-hook +2 -0
- package/bin/pa-init +2 -0
- package/bin/research +2 -0
- package/bin/scheduler +2 -0
- package/bin/secrets +2 -0
- package/bin/slice +2 -0
- package/bin/smoke +9 -0
- package/bin/sync +2 -0
- package/dist/engineering-pa-cli/README.md +205 -0
- package/dist/engineering-pa-cli/bin/estate-sync +2 -0
- package/dist/engineering-pa-cli/bin/launch +2 -0
- package/dist/engineering-pa-cli/bin/pa +2 -0
- package/dist/engineering-pa-cli/bin/pa-coordinator-hook +12 -0
- package/dist/engineering-pa-cli/bin/research +2 -0
- package/dist/engineering-pa-cli/bin/scheduler +2 -0
- package/dist/engineering-pa-cli/bin/secrets +2 -0
- package/dist/engineering-pa-cli/bin/smoke +9 -0
- package/dist/engineering-pa-cli/bin/sync +2 -0
- package/dist/engineering-pa-cli/config/coordinator-allowlist.json +118 -0
- package/dist/engineering-pa-cli/docs/coordinator-hook.md +211 -0
- package/dist/engineering-pa-cli/docs/estate-sync.md +412 -0
- package/dist/engineering-pa-cli/docs/gsc.md +175 -0
- package/dist/engineering-pa-cli/docs/lint-linkedin.md +139 -0
- package/dist/engineering-pa-cli/docs/secrets.md +221 -0
- package/dist/engineering-pa-cli/docs/smoke.md +113 -0
- package/dist/engineering-pa-cli/docs/staging-alias.md +114 -0
- package/dist/engineering-pa-cli/index.mjs +17 -0
- package/dist/engineering-pa-cli/package.json +37 -0
- package/dist/engineering-pa-cli/src/autonomy/cli.mjs +329 -0
- package/dist/engineering-pa-cli/src/autonomy/envelope.mjs +301 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/cli.mjs +140 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/config.mjs +134 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/message.mjs +47 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/policy.mjs +211 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/repo-root.mjs +44 -0
- package/dist/engineering-pa-cli/src/coordinator-hook/self.mjs +30 -0
- package/dist/engineering-pa-cli/src/environment/cli.mjs +287 -0
- package/dist/engineering-pa-cli/src/environment/probes.mjs +302 -0
- package/dist/engineering-pa-cli/src/gsc/auth.mjs +148 -0
- package/dist/engineering-pa-cli/src/gsc/cli.mjs +93 -0
- package/dist/engineering-pa-cli/src/gsc/cloudflare.mjs +318 -0
- package/dist/engineering-pa-cli/src/gsc/commands/add-property.mjs +70 -0
- package/dist/engineering-pa-cli/src/gsc/commands/list-properties.mjs +33 -0
- package/dist/engineering-pa-cli/src/gsc/commands/pull-analytics.mjs +130 -0
- package/dist/engineering-pa-cli/src/gsc/commands/submit-sitemap.mjs +41 -0
- package/dist/engineering-pa-cli/src/gsc/commands/verify-via-cf-dns.mjs +189 -0
- package/dist/engineering-pa-cli/src/knowledge/call-log.mjs +59 -0
- package/dist/engineering-pa-cli/src/knowledge/cli.mjs +242 -0
- package/dist/engineering-pa-cli/src/knowledge/eval.mjs +446 -0
- package/dist/engineering-pa-cli/src/knowledge/formatters.mjs +331 -0
- package/dist/engineering-pa-cli/src/knowledge/graph.mjs +710 -0
- package/dist/engineering-pa-cli/src/launch/README.md +214 -0
- package/dist/engineering-pa-cli/src/launch/cli.mjs +51 -0
- package/dist/engineering-pa-cli/src/launch/commands/launch.mjs +106 -0
- package/dist/engineering-pa-cli/src/launch/identity.mjs +43 -0
- package/dist/engineering-pa-cli/src/launch/planner.mjs +44 -0
- package/dist/engineering-pa-cli/src/launch/repo-root.mjs +53 -0
- package/dist/engineering-pa-cli/src/launch/runner.mjs +147 -0
- package/dist/engineering-pa-cli/src/launch/task-loader.mjs +85 -0
- package/dist/engineering-pa-cli/src/lint/cli.mjs +61 -0
- package/dist/engineering-pa-cli/src/lint/commands/linkedin.mjs +133 -0
- package/dist/engineering-pa-cli/src/lint/detectors.mjs +90 -0
- package/dist/engineering-pa-cli/src/lint/linter.mjs +69 -0
- package/dist/engineering-pa-cli/src/lint/reporter.mjs +32 -0
- package/dist/engineering-pa-cli/src/lint/rules.mjs +132 -0
- package/dist/engineering-pa-cli/src/pa/cli.mjs +369 -0
- package/dist/engineering-pa-cli/src/pa/doc-groups.mjs +164 -0
- package/dist/engineering-pa-cli/src/pa/io.mjs +80 -0
- package/dist/engineering-pa-cli/src/pa/project-cli.mjs +385 -0
- package/dist/engineering-pa-cli/src/pa/projects.mjs +352 -0
- package/dist/engineering-pa-cli/src/pa/repo-root.mjs +64 -0
- package/dist/engineering-pa-cli/src/pa/session.mjs +254 -0
- package/dist/engineering-pa-cli/src/pa/work-cli.mjs +164 -0
- package/dist/engineering-pa-cli/src/pa/work.mjs +196 -0
- package/dist/engineering-pa-cli/src/pa/workstreams.mjs +201 -0
- package/dist/engineering-pa-cli/src/research/README.md +360 -0
- package/dist/engineering-pa-cli/src/research/briefs/extractor.md +103 -0
- package/dist/engineering-pa-cli/src/research/briefs/searcher.md +113 -0
- package/dist/engineering-pa-cli/src/research/briefs/synthesizer.md +124 -0
- package/dist/engineering-pa-cli/src/research/briefs/verifier.md +86 -0
- package/dist/engineering-pa-cli/src/research/cli.mjs +141 -0
- package/dist/engineering-pa-cli/src/research/commands/gates.mjs +176 -0
- package/dist/engineering-pa-cli/src/research/commands/list.mjs +56 -0
- package/dist/engineering-pa-cli/src/research/commands/mark.mjs +97 -0
- package/dist/engineering-pa-cli/src/research/commands/paths.mjs +69 -0
- package/dist/engineering-pa-cli/src/research/commands/prune.mjs +86 -0
- package/dist/engineering-pa-cli/src/research/commands/run.mjs +94 -0
- package/dist/engineering-pa-cli/src/research/commands/show.mjs +43 -0
- package/dist/engineering-pa-cli/src/research/docs/operator-present-flow.md +120 -0
- package/dist/engineering-pa-cli/src/research/format.mjs +59 -0
- package/dist/engineering-pa-cli/src/research/promote.mjs +260 -0
- package/dist/engineering-pa-cli/src/research/schema/finding.schema.json +55 -0
- package/dist/engineering-pa-cli/src/research/schema/gates.schema.json +34 -0
- package/dist/engineering-pa-cli/src/research/schema/manifest.schema.json +59 -0
- package/dist/engineering-pa-cli/src/research/schema/plan.schema.json +41 -0
- package/dist/engineering-pa-cli/src/research/schema/sources.schema.json +31 -0
- package/dist/engineering-pa-cli/src/research/store/findings.mjs +61 -0
- package/dist/engineering-pa-cli/src/research/store/gates.mjs +73 -0
- package/dist/engineering-pa-cli/src/research/store/index.mjs +312 -0
- package/dist/engineering-pa-cli/src/research/store/manifest.mjs +56 -0
- package/dist/engineering-pa-cli/src/research/store/plan.mjs +59 -0
- package/dist/engineering-pa-cli/src/research/store/sources.mjs +44 -0
- package/dist/engineering-pa-cli/src/research/store/validate.mjs +92 -0
- package/dist/engineering-pa-cli/src/research/workflows/research-normal.js +573 -0
- package/dist/engineering-pa-cli/src/scheduler/cli.mjs +197 -0
- package/dist/engineering-pa-cli/src/secrets/cli.mjs +254 -0
- package/dist/engineering-pa-cli/src/secrets/commands/backup-template.mjs +67 -0
- package/dist/engineering-pa-cli/src/secrets/commands/backup.mjs +85 -0
- package/dist/engineering-pa-cli/src/secrets/commands/delete.mjs +58 -0
- package/dist/engineering-pa-cli/src/secrets/commands/find.mjs +36 -0
- package/dist/engineering-pa-cli/src/secrets/commands/get.mjs +49 -0
- package/dist/engineering-pa-cli/src/secrets/commands/init.mjs +69 -0
- package/dist/engineering-pa-cli/src/secrets/commands/list.mjs +37 -0
- package/dist/engineering-pa-cli/src/secrets/commands/rotate.mjs +46 -0
- package/dist/engineering-pa-cli/src/secrets/commands/set.mjs +123 -0
- package/dist/engineering-pa-cli/src/secrets/commands/status.mjs +146 -0
- package/dist/engineering-pa-cli/src/secrets/commands/vaults.mjs +57 -0
- package/dist/engineering-pa-cli/src/secrets/commands/verify.mjs +143 -0
- package/dist/engineering-pa-cli/src/secrets/vault.mjs +766 -0
- package/dist/engineering-pa-cli/src/smoke/checks.mjs +199 -0
- package/dist/engineering-pa-cli/src/smoke/cli.mjs +108 -0
- package/dist/engineering-pa-cli/src/smoke/commands/run.mjs +237 -0
- package/dist/engineering-pa-cli/src/smoke/runner.mjs +191 -0
- package/dist/engineering-pa-cli/src/staging-alias/cli.mjs +91 -0
- package/dist/engineering-pa-cli/src/staging-alias/cloudflare.mjs +380 -0
- package/dist/engineering-pa-cli/src/staging-alias/commands/list.mjs +36 -0
- package/dist/engineering-pa-cli/src/staging-alias/commands/set.mjs +188 -0
- package/dist/engineering-pa-cli/src/staging-alias/commands/status.mjs +113 -0
- package/dist/engineering-pa-cli/src/staging-alias/commands/unset.mjs +95 -0
- package/dist/engineering-pa-cli/src/staging-alias/sites.mjs +105 -0
- package/dist/engineering-pa-cli/src/sync/cli.mjs +151 -0
- package/dist/engineering-pa-cli/src/sync/git.mjs +149 -0
- package/dist/engineering-pa-cli/src/sync/lock.mjs +30 -0
- package/dist/engineering-pa-cli/src/sync/regenerated-artifacts.mjs +114 -0
- package/dist/engineering-pa-cli/src/sync/registry-scope.mjs +260 -0
- package/dist/engineering-pa-cli/src/sync/run.mjs +531 -0
- package/dist/engineering-pa-cli/src/sync/runner.mjs +62 -0
- package/dist/engineering-pa-cli/src/sync/runs-digest.mjs +138 -0
- package/dist/engineering-pa-core/README.md +60 -0
- package/dist/engineering-pa-core/bin/desk +9 -0
- package/dist/engineering-pa-core/bin/distill +2 -0
- package/dist/engineering-pa-core/bin/memory-sync +2 -0
- package/dist/engineering-pa-core/bin/slice +2 -0
- package/dist/engineering-pa-core/docs/autonomy-envelope-tracker.md +111 -0
- package/dist/engineering-pa-core/docs/blueprints/README.md +45 -0
- package/dist/engineering-pa-core/docs/blueprints/docker-services/blueprint.md +168 -0
- package/dist/engineering-pa-core/docs/blueprints/git-identity/blueprint.md +116 -0
- package/dist/engineering-pa-core/docs/blueprints/ideas/custom-workspace-views.md +9 -0
- package/dist/engineering-pa-core/docs/blueprints/ideas/knowledge-domain-patterns.md +15 -0
- package/dist/engineering-pa-core/docs/blueprints/ideas/office-integration.md +11 -0
- package/dist/engineering-pa-core/docs/blueprints/ideas/team-scaling.md +9 -0
- package/dist/engineering-pa-core/docs/blueprints/ideas/work-personal-separation.md +9 -0
- package/dist/engineering-pa-core/docs/blueprints/scheduled-distillation/blueprint.md +129 -0
- package/dist/engineering-pa-core/docs/blueprints/tool-integration/blueprint.md +110 -0
- package/dist/engineering-pa-core/docs/commands/init.md +159 -0
- package/dist/engineering-pa-core/docs/commands/schedule.md +98 -0
- package/dist/engineering-pa-core/docs/commands/upgrade.md +67 -0
- package/dist/engineering-pa-core/docs/entity-location-map.md +93 -0
- package/dist/engineering-pa-core/docs/knowledge-scaffold.md +121 -0
- package/dist/engineering-pa-core/docs/lock.md +155 -0
- package/dist/engineering-pa-core/docs/memory-sync.md +28 -0
- package/dist/engineering-pa-core/docs/pa-operating-model.md +457 -0
- package/dist/engineering-pa-core/docs/scheduling.md +35 -0
- package/dist/engineering-pa-core/docs/standards/README.md +24 -0
- package/dist/engineering-pa-core/docs/standards/briefing-contract.md +161 -0
- package/dist/engineering-pa-core/docs/standards/tooling.md +240 -0
- package/dist/engineering-pa-core/docs/tools/distill.md +230 -0
- package/dist/engineering-pa-core/docs/tools/memory-sync.md +98 -0
- package/dist/engineering-pa-core/docs/tools/scheduler.md +243 -0
- package/dist/engineering-pa-core/docs/tools/slice.md +150 -0
- package/dist/engineering-pa-core/docs/upstream-issue-filing.md +88 -0
- package/dist/engineering-pa-core/docs/working-directory.md +29 -0
- package/dist/engineering-pa-core/docs/workspace-operations.md +46 -0
- package/dist/engineering-pa-core/index.mjs +21 -0
- package/dist/engineering-pa-core/knowledge/README.md +53 -0
- package/dist/engineering-pa-core/knowledge/canonical/.gitkeep +0 -0
- package/dist/engineering-pa-core/knowledge/content-voice/README.md +64 -0
- package/dist/engineering-pa-core/knowledge/content-voice/banned-ai-tells-baseline.md +133 -0
- package/dist/engineering-pa-core/knowledge/content-voice/banned-ai-tells-shape.md +58 -0
- package/dist/engineering-pa-core/knowledge/content-voice/banned-ai-tells-taxonomy.md +33 -0
- package/dist/engineering-pa-core/knowledge/content-voice/content-pipeline-routing.md +58 -0
- package/dist/engineering-pa-core/knowledge/content-voice/new-tell-capture-procedure.md +40 -0
- package/dist/engineering-pa-core/knowledge/content-voice/voice-guide-shape.md +43 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/README.md +34 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/briefing-contract.md +77 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/delegation-modes.md +84 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/dispatch-envelope.md +238 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/task-groups-and-orchestrators.md +62 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/team-improvement-loop.md +48 -0
- package/dist/engineering-pa-core/knowledge/delegation-dispatch/tool-development-policy.md +48 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/README.md +33 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/blast-radius-and-safety.md +50 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/investigate-root-causes.md +48 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/role-ladder.md +57 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/verify-runtime-behaviour.md +53 -0
- package/dist/engineering-pa-core/knowledge/engineering-discipline/worktree-isolation.md +50 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/README.md +33 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/claude-md-hygiene.md +47 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/journal-and-self-improvement.md +53 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/knowledge-retrieval-discipline.md +62 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/librarian-synthesis-mandate.md +56 -0
- package/dist/engineering-pa-core/knowledge/knowledge-memory/staging-and-observations.md +58 -0
- package/dist/engineering-pa-core/knowledge/operator-interface/README.md +32 -0
- package/dist/engineering-pa-core/knowledge/operator-interface/communication-style.md +33 -0
- package/dist/engineering-pa-core/knowledge/operator-interface/escalation-and-correction.md +45 -0
- package/dist/engineering-pa-core/knowledge/operator-interface/push-back-discipline.md +42 -0
- package/dist/engineering-pa-core/knowledge/operator-interface/session-boot-and-end.md +56 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/README.md +37 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/desk-cli-reference.md +52 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/environment-awareness.md +91 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/mcp-servers-catalogue.md +52 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/pa-cli-reference.md +55 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/scheduling-and-launchd.md +56 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/tool-discovery-discipline.md +49 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/working-directory-vs-project-root.md +43 -0
- package/dist/engineering-pa-core/knowledge/platform-tooling/workspace-server.md +51 -0
- package/dist/engineering-pa-core/knowledge/raw/.gitkeep +0 -0
- package/dist/engineering-pa-core/knowledge/scaffold/domains.json +5 -0
- package/dist/engineering-pa-core/knowledge/schema/.gitkeep +0 -0
- package/dist/engineering-pa-core/knowledge/work-management/README.md +33 -0
- package/dist/engineering-pa-core/knowledge/work-management/desk-cli.md +84 -0
- package/dist/engineering-pa-core/knowledge/work-management/progress-md.md +48 -0
- package/dist/engineering-pa-core/knowledge/work-management/projects.md +64 -0
- package/dist/engineering-pa-core/knowledge/work-management/spawn-log.md +48 -0
- package/dist/engineering-pa-core/knowledge/work-management/work-items.md +67 -0
- package/dist/engineering-pa-core/package.json +26 -0
- package/dist/engineering-pa-core/roles/agent-ops/definition.md +79 -0
- package/dist/engineering-pa-core/roles/dispatch-briefer/definition.md +195 -0
- package/dist/engineering-pa-core/roles/librarian/definition.md +176 -0
- package/dist/engineering-pa-core/roles/pa/definition.md +93 -0
- package/dist/engineering-pa-core/roles/system-admin/definition.md +106 -0
- package/dist/engineering-pa-core/roles/tool-developer/definition.md +116 -0
- package/dist/engineering-pa-core/roles/writer/definition.md +130 -0
- package/dist/engineering-pa-core/schema/autonomy-envelope.schema.json +61 -0
- package/dist/engineering-pa-core/schema/project.json +114 -0
- package/dist/engineering-pa-core/schema/schedule.json +63 -0
- package/dist/engineering-pa-core/schema/work-item.json +92 -0
- package/dist/engineering-pa-core/src/config/pa-package-name.mjs +30 -0
- package/dist/engineering-pa-core/src/desk/cli.mjs +95 -0
- package/dist/engineering-pa-core/src/desk/commands.mjs +398 -0
- package/dist/engineering-pa-core/src/desk/format.mjs +84 -0
- package/dist/engineering-pa-core/src/desk/repo.mjs +172 -0
- package/dist/engineering-pa-core/src/desk/team-scope.mjs +142 -0
- package/dist/engineering-pa-core/src/distill/cli.mjs +112 -0
- package/dist/engineering-pa-core/src/distill/prereqs.mjs +171 -0
- package/dist/engineering-pa-core/src/distill/prompt.mjs +74 -0
- package/dist/engineering-pa-core/src/distill/run.mjs +230 -0
- package/dist/engineering-pa-core/src/distill/runner.mjs +86 -0
- package/dist/engineering-pa-core/src/distill/staging.mjs +59 -0
- package/dist/engineering-pa-core/src/knowledge/retrieval/backlink-indexer.mjs +154 -0
- package/dist/engineering-pa-core/src/knowledge/retrieval/graph-builder.mjs +186 -0
- package/dist/engineering-pa-core/src/knowledge/retrieval/index-builder.mjs +225 -0
- package/dist/engineering-pa-core/src/knowledge/retrieval/query.mjs +263 -0
- package/dist/engineering-pa-core/src/lock/lock.mjs +202 -0
- package/dist/engineering-pa-core/src/memory-sync/cli-support.mjs +12 -0
- package/dist/engineering-pa-core/src/memory-sync/cli.mjs +56 -0
- package/dist/engineering-pa-core/src/memory-sync/commands/pull.mjs +44 -0
- package/dist/engineering-pa-core/src/memory-sync/commands/push.mjs +46 -0
- package/dist/engineering-pa-core/src/memory-sync/mirror.mjs +114 -0
- package/dist/engineering-pa-core/src/memory-sync/repo.mjs +65 -0
- package/dist/engineering-pa-core/src/scheduler/detect.mjs +111 -0
- package/dist/engineering-pa-core/src/scheduler/host.mjs +38 -0
- package/dist/engineering-pa-core/src/scheduler/index.mjs +13 -0
- package/dist/engineering-pa-core/src/scheduler/install.mjs +854 -0
- package/dist/engineering-pa-core/src/scheduler/list.mjs +168 -0
- package/dist/engineering-pa-core/src/scheduler/remove.mjs +176 -0
- package/dist/engineering-pa-core/src/scheduler/verify.mjs +435 -0
- package/dist/engineering-pa-core/src/session-boot/autonomy-injection.mjs +84 -0
- package/dist/engineering-pa-core/src/slice/cli.mjs +139 -0
- package/dist/engineering-pa-core/src/slice/inputs.mjs +174 -0
- package/dist/engineering-pa-core/src/slice/prompt.mjs +94 -0
- package/dist/engineering-pa-core/src/slice/prompts/dave-boot.md +91 -0
- package/dist/engineering-pa-core/src/slice/run.mjs +334 -0
- package/dist/engineering-pa-core-extensions-atlassian/README.md +31 -0
- package/dist/engineering-pa-core-extensions-atlassian/index.mjs +9 -0
- package/dist/engineering-pa-core-extensions-atlassian/package.json +19 -0
- package/dist/engineering-pa-core-extensions-n8n/README.md +29 -0
- package/dist/engineering-pa-core-extensions-n8n/index.mjs +8 -0
- package/dist/engineering-pa-core-extensions-n8n/package.json +19 -0
- package/dist/engineering-pa-librarian/README.md +38 -0
- package/dist/engineering-pa-librarian/index.mjs +12 -0
- package/dist/engineering-pa-librarian/package.json +19 -0
- package/dist/engineering-pa-migrate-inspect/README.md +131 -0
- package/dist/engineering-pa-migrate-inspect/bin/migrate-inspect +2 -0
- package/dist/engineering-pa-migrate-inspect/package.json +21 -0
- package/dist/engineering-pa-migrate-inspect/src/age-key-migrate.mjs +83 -0
- package/dist/engineering-pa-migrate-inspect/src/cli.mjs +97 -0
- package/dist/engineering-pa-migrate-inspect/src/inspector.mjs +237 -0
- package/dist/engineering-pa-migrate-inspect/src/platforms/linux.mjs +87 -0
- package/dist/engineering-pa-migrate-inspect/src/platforms/macos.mjs +105 -0
- package/dist/engineering-pa-migrate-inspect/src/runner.mjs +87 -0
- package/dist/engineering-pa-runbook/README.md +103 -0
- package/dist/engineering-pa-runbook/package.json +18 -0
- package/dist/engineering-pa-runbook/reference/dex-template.runbook.json +66 -0
- package/dist/engineering-pa-runbook/reference/hq-dave.runbook.json +69 -0
- package/dist/engineering-pa-runbook/reference/smarthome01.runbook.json +92 -0
- package/dist/engineering-pa-runbook/schema/inspection.schema.json +113 -0
- package/dist/engineering-pa-runbook/schema/runbook.schema.json +67 -0
- package/dist/engineering-pa-runbook/src/validator.mjs +167 -0
- package/dist/engineering-pa-scaffold/README.md +164 -0
- package/dist/engineering-pa-scaffold/bin/pa-init +2 -0
- package/dist/engineering-pa-scaffold/index.mjs +42 -0
- package/dist/engineering-pa-scaffold/package.json +22 -0
- package/dist/engineering-pa-scaffold/src/cli.mjs +115 -0
- package/dist/engineering-pa-scaffold/src/commands/init.mjs +169 -0
- package/dist/engineering-pa-scaffold/src/generator.mjs +354 -0
- package/dist/engineering-pa-scaffold/src/prompts.mjs +125 -0
- package/dist/engineering-pa-scaffold/src/runner.mjs +142 -0
- package/dist/engineering-pa-scaffold/templates/CLAUDE.md.template +196 -0
- package/dist/engineering-pa-scaffold/templates/operator-README.md.template +44 -0
- package/dist/engineering-pa-types-engineering/README.md +35 -0
- package/dist/engineering-pa-types-engineering/docs/commands/product-build.md +120 -0
- package/dist/engineering-pa-types-engineering/index.mjs +9 -0
- package/dist/engineering-pa-types-engineering/package.json +19 -0
- package/dist/engineering-pa-types-engineering/roles/product-engineer/definition.md +650 -0
- package/dist/engineering-pa-types-engineering/roles/product-engineer/templates/build-spec.md +82 -0
- package/dist/engineering-pa-types-engineering/roles/product-engineer/templates/preflight-checklist.md +158 -0
- package/dist/engineering-pa-types-engineering/roles/product-engineer/templates/worker-brief.md +130 -0
- package/dist/engineering-pa-workspace/README.md +197 -0
- package/dist/engineering-pa-workspace/app/assets/md.js +187 -0
- package/dist/engineering-pa-workspace/app/assets/modal.js +120 -0
- package/dist/engineering-pa-workspace/app/assets/theme.css +132 -0
- package/dist/engineering-pa-workspace/app/assets/theme.js +159 -0
- package/dist/engineering-pa-workspace/app/banner.js +320 -0
- package/dist/engineering-pa-workspace/app/delegations.html +345 -0
- package/dist/engineering-pa-workspace/app/home.html +1060 -0
- package/dist/engineering-pa-workspace/app/index.html +361 -0
- package/dist/engineering-pa-workspace/app/knowledge-map.html +163 -0
- package/dist/engineering-pa-workspace/app/knowledge.html +304 -0
- package/dist/engineering-pa-workspace/app/nav.json +75 -0
- package/dist/engineering-pa-workspace/app/notes.html +199 -0
- package/dist/engineering-pa-workspace/app/onboarding.html +592 -0
- package/dist/engineering-pa-workspace/app/profile.html +243 -0
- package/dist/engineering-pa-workspace/app/project-detail.html +432 -0
- package/dist/engineering-pa-workspace/app/projects.html +297 -0
- package/dist/engineering-pa-workspace/app/repos.html +598 -0
- package/dist/engineering-pa-workspace/app/schedules.html +486 -0
- package/dist/engineering-pa-workspace/app/secrets.html +164 -0
- package/dist/engineering-pa-workspace/app/staging.html +319 -0
- package/dist/engineering-pa-workspace/app/tasks.html +465 -0
- package/dist/engineering-pa-workspace/app/vendor/chart.umd.min.js +21 -0
- package/dist/engineering-pa-workspace/app/viewer.html +116 -0
- package/dist/engineering-pa-workspace/docs/DAEMON.md +104 -0
- package/dist/engineering-pa-workspace/docs/page-blueprint.md +286 -0
- package/dist/engineering-pa-workspace/docs/status-mon.md +168 -0
- package/dist/engineering-pa-workspace/index.mjs +12 -0
- package/dist/engineering-pa-workspace/nav.json.example +8 -0
- package/dist/engineering-pa-workspace/package.json +27 -0
- package/dist/engineering-pa-workspace/src/api.mjs +2086 -0
- package/dist/engineering-pa-workspace/src/install-daemon.mjs +573 -0
- package/dist/engineering-pa-workspace/src/nav.mjs +190 -0
- package/dist/engineering-pa-workspace/src/secrets-api.mjs +175 -0
- package/dist/engineering-pa-workspace/src/server.mjs +516 -0
- package/dist/engineering-pa-workspace/src/status-mon/poll.mjs +220 -0
- package/dist/engineering-pa-workspace/src/status-mon/poller.mjs +113 -0
- package/dist/engineering-pa-workspace/src/status-mon/run.mjs +133 -0
- package/dist/engineering-pa-workspace/src/supervisor.mjs +264 -0
- package/dist/engineering-pa-workspace/src/ws.mjs +633 -0
- package/index.mjs +60 -0
- package/package.json +58 -0
- package/templates/banned-ai-tells.md +102 -0
- package/templates/purpose.md +105 -0
- package/templates/voice-guide.md +98 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace nav manifest loader.
|
|
3
|
+
*
|
|
4
|
+
* Reads the core manifest at core/tools/workspace/app/nav.json and, if present,
|
|
5
|
+
* the operator extension manifest at operator/extensions/workspace/nav.json.
|
|
6
|
+
* Merges them into a single ordered list of nav items.
|
|
7
|
+
*
|
|
8
|
+
* Merge rules:
|
|
9
|
+
* - Core items come first, in manifest order.
|
|
10
|
+
* - Extension items are appended; on id collision, the extension entry
|
|
11
|
+
* replaces the core entry in place (extension wins, warning logged).
|
|
12
|
+
* - A missing or absent operator manifest is not an error.
|
|
13
|
+
* - A malformed manifest is logged and skipped; the other side still loads.
|
|
14
|
+
*
|
|
15
|
+
* Caching: each load checks both manifest mtimes. The cached merged list is
|
|
16
|
+
* returned unchanged if neither file changed since the last load. Missing
|
|
17
|
+
* files are tracked with mtime 0 so their appearance triggers a reload.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { readFileSync, statSync, existsSync } from 'node:fs';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
|
|
23
|
+
const CACHE = {
|
|
24
|
+
coreMtimeMs: -1,
|
|
25
|
+
extMtimeMs: -1,
|
|
26
|
+
items: null,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function mtime(path) {
|
|
30
|
+
try { return statSync(path).mtimeMs; } catch { return 0; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function validateItem(raw, source, warn) {
|
|
34
|
+
if (!raw || typeof raw !== 'object') {
|
|
35
|
+
warn('[nav] warning: ' + source + ' contains a non-object entry, skipping');
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (typeof raw.id !== 'string' || !raw.id) {
|
|
39
|
+
warn('[nav] warning: ' + source + ' entry missing string "id", skipping');
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if (typeof raw.label !== 'string' || !raw.label) {
|
|
43
|
+
warn('[nav] warning: ' + source + ' entry "' + raw.id + '" missing string "label", skipping');
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (typeof raw.href !== 'string' || !raw.href) {
|
|
47
|
+
warn('[nav] warning: ' + source + ' entry "' + raw.id + '" missing string "href", skipping');
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const item = {
|
|
51
|
+
id: raw.id,
|
|
52
|
+
label: raw.label,
|
|
53
|
+
href: raw.href,
|
|
54
|
+
section: typeof raw.section === 'string' && raw.section ? raw.section : 'Workspace',
|
|
55
|
+
};
|
|
56
|
+
if (Array.isArray(raw.aliases)) {
|
|
57
|
+
item.aliases = raw.aliases.filter(function(a) { return typeof a === 'string' && a; });
|
|
58
|
+
} else {
|
|
59
|
+
item.aliases = [];
|
|
60
|
+
}
|
|
61
|
+
return item;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function readManifest(path, source, warn) {
|
|
65
|
+
if (!existsSync(path)) return [];
|
|
66
|
+
let raw;
|
|
67
|
+
try {
|
|
68
|
+
raw = JSON.parse(readFileSync(path, 'utf-8'));
|
|
69
|
+
} catch (e) {
|
|
70
|
+
warn('[nav] warning: ' + source + ' is not valid JSON (' + e.message + '), skipping');
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
if (!Array.isArray(raw)) {
|
|
74
|
+
warn('[nav] warning: ' + source + ' must be a JSON array, got ' + typeof raw + ', skipping');
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const items = [];
|
|
78
|
+
for (let i = 0; i < raw.length; i++) {
|
|
79
|
+
const item = validateItem(raw[i], source, warn);
|
|
80
|
+
if (item) items.push(item);
|
|
81
|
+
}
|
|
82
|
+
return items;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Merge core and extension items. Extension items with a matching id replace
|
|
87
|
+
* the corresponding core item in its original slot (preserving core ordering)
|
|
88
|
+
* and emit a warning. Extension items with no collision are appended in
|
|
89
|
+
* manifest order.
|
|
90
|
+
*/
|
|
91
|
+
function mergeItems(coreItems, extItems, warn) {
|
|
92
|
+
const merged = coreItems.slice();
|
|
93
|
+
const indexById = new Map();
|
|
94
|
+
for (let i = 0; i < merged.length; i++) {
|
|
95
|
+
indexById.set(merged[i].id, i);
|
|
96
|
+
}
|
|
97
|
+
for (const ext of extItems) {
|
|
98
|
+
if (indexById.has(ext.id)) {
|
|
99
|
+
warn('[nav] warning: extension nav id "' + ext.id + '" shadows core item');
|
|
100
|
+
merged[indexById.get(ext.id)] = ext;
|
|
101
|
+
} else {
|
|
102
|
+
indexById.set(ext.id, merged.length);
|
|
103
|
+
merged.push(ext);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return merged;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Validate that every item's href resolves to an existing page, either under
|
|
111
|
+
* APP_DIR or EXT_DIR (for top-level /<name>.html). Non-resolving items are
|
|
112
|
+
* kept in the list with a warning so operators can see their work-in-progress.
|
|
113
|
+
*/
|
|
114
|
+
function warnOnMissingHrefs(items, appDir, extDir, warn) {
|
|
115
|
+
for (const item of items) {
|
|
116
|
+
const href = item.href;
|
|
117
|
+
// Core-shape paths: /core/tools/workspace/app/<file>
|
|
118
|
+
const corePrefix = '/core/tools/workspace/app/';
|
|
119
|
+
if (href.indexOf(corePrefix) === 0) {
|
|
120
|
+
const name = href.slice(corePrefix.length).split('?')[0].split('#')[0];
|
|
121
|
+
if (!existsSync(join(appDir, name))) {
|
|
122
|
+
warn('[nav] warning: nav item "' + item.id + '" points at missing page ' + href);
|
|
123
|
+
}
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
// Top-level extension-shape: /<file>.html
|
|
127
|
+
const topMatch = href.match(/^\/([^/?#]+\.html)(?:[?#].*)?$/);
|
|
128
|
+
if (topMatch) {
|
|
129
|
+
const name = topMatch[1];
|
|
130
|
+
const inExt = extDir && existsSync(join(extDir, name));
|
|
131
|
+
const inApp = existsSync(join(appDir, name));
|
|
132
|
+
if (!inExt && !inApp) {
|
|
133
|
+
warn('[nav] warning: nav item "' + item.id + '" points at missing page ' + href);
|
|
134
|
+
}
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
// Any other shape we leave alone — might be an external link or a deep core path.
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Returns the merged nav items array. Reads from disk when either manifest's
|
|
143
|
+
* mtime has changed since the previous call; otherwise returns the cached list.
|
|
144
|
+
*
|
|
145
|
+
* @param {object} opts
|
|
146
|
+
* @param {string} opts.appDir absolute path to core app dir
|
|
147
|
+
* @param {string} [opts.extDir] absolute path to operator extension dir
|
|
148
|
+
* @param {function(string):void} [opts.warn] warning sink (defaults to console.warn)
|
|
149
|
+
* @returns {Array<{id:string,label:string,href:string,section:string,aliases:string[]}>}
|
|
150
|
+
*/
|
|
151
|
+
export function loadNav(opts) {
|
|
152
|
+
const appDir = opts.appDir;
|
|
153
|
+
const extDir = opts.extDir || null;
|
|
154
|
+
const warn = opts.warn || function(m) { console.warn(m); };
|
|
155
|
+
|
|
156
|
+
const coreManifest = join(appDir, 'nav.json');
|
|
157
|
+
const extManifest = extDir ? join(extDir, 'nav.json') : null;
|
|
158
|
+
|
|
159
|
+
const coreMtime = mtime(coreManifest);
|
|
160
|
+
const extMtime = extManifest ? mtime(extManifest) : 0;
|
|
161
|
+
|
|
162
|
+
if (
|
|
163
|
+
CACHE.items !== null &&
|
|
164
|
+
CACHE.coreMtimeMs === coreMtime &&
|
|
165
|
+
CACHE.extMtimeMs === extMtime
|
|
166
|
+
) {
|
|
167
|
+
return CACHE.items;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const coreItems = readManifest(coreManifest, 'core nav manifest', warn);
|
|
171
|
+
const extItems = extManifest
|
|
172
|
+
? readManifest(extManifest, 'extension nav manifest', warn)
|
|
173
|
+
: [];
|
|
174
|
+
const merged = mergeItems(coreItems, extItems, warn);
|
|
175
|
+
warnOnMissingHrefs(merged, appDir, extDir, warn);
|
|
176
|
+
|
|
177
|
+
CACHE.coreMtimeMs = coreMtime;
|
|
178
|
+
CACHE.extMtimeMs = extMtime;
|
|
179
|
+
CACHE.items = merged;
|
|
180
|
+
return merged;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Test-only helper: clear the in-memory cache so reloads re-read manifests.
|
|
185
|
+
*/
|
|
186
|
+
export function _resetNavCache() {
|
|
187
|
+
CACHE.coreMtimeMs = -1;
|
|
188
|
+
CACHE.extMtimeMs = -1;
|
|
189
|
+
CACHE.items = null;
|
|
190
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// secrets-api.mjs — in-process bridge to the vault module.
|
|
2
|
+
//
|
|
3
|
+
// History:
|
|
4
|
+
// v0.1.4 spawned `node core/tools/secrets/bin/secrets` — a v1 path that
|
|
5
|
+
// doesn't exist in v2 installs, so every GET reported
|
|
6
|
+
// initialised:false on healthy vaults (w-2026-05-18-014).
|
|
7
|
+
// v0.1.5 imported the vault primitives in-process, but only spoke to the
|
|
8
|
+
// LEGACY single-file vault — on the live estate that hid 29 of 50
|
|
9
|
+
// secrets (the scoped vaults) and silently pointed every write at
|
|
10
|
+
// the legacy store.
|
|
11
|
+
// v0.5.3 (this file) rebuilt on the scoped-vault primitives:
|
|
12
|
+
// enumerateVaults + readVaultKeyNames for listing (key NAMES are
|
|
13
|
+
// plaintext in sops JSON — no decryption, no age key, no binaries
|
|
14
|
+
// needed to list), and explicit-target writes (legacy OR scope) —
|
|
15
|
+
// a write with no vault target is refused, never defaulted.
|
|
16
|
+
//
|
|
17
|
+
// Values are NEVER returned by any function in this module.
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
defaultPaths,
|
|
21
|
+
resolveScopePaths,
|
|
22
|
+
enumerateVaults,
|
|
23
|
+
readVaultKeyNames,
|
|
24
|
+
checkDeps,
|
|
25
|
+
checkVault,
|
|
26
|
+
getPublicKey,
|
|
27
|
+
secretsFileExists,
|
|
28
|
+
sopsDecrypt,
|
|
29
|
+
sopsEncrypt,
|
|
30
|
+
sopsEncryptScoped,
|
|
31
|
+
} from '../../engineering-pa-cli/src/secrets/vault.mjs';
|
|
32
|
+
|
|
33
|
+
/** Sentinel accepted (in either spelling) as the explicit legacy-vault target. */
|
|
34
|
+
const LEGACY_TARGETS = new Set(['legacy', '(legacy)']);
|
|
35
|
+
|
|
36
|
+
export const MISSING_TARGET_ERROR =
|
|
37
|
+
"Missing vault target — pass vault: 'legacy' or a scope name. Writes never default to a vault silently.";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Enumerate every vault visible from the workspace and their key NAMES.
|
|
41
|
+
* No decryption anywhere on this path: names come from the plaintext
|
|
42
|
+
* structure of the sops JSON, so this works with no age key and no
|
|
43
|
+
* sops/age binaries installed.
|
|
44
|
+
*
|
|
45
|
+
* Returns:
|
|
46
|
+
* {
|
|
47
|
+
* initialised: boolean, // at least one vault store file visible
|
|
48
|
+
* vaults: [{ scope, layout, path, keys: string[] }],
|
|
49
|
+
* keys: string[], // flat sorted union — back-compat for
|
|
50
|
+
* // consumers of the pre-0.5.3 shape
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* @param {string} repoRoot
|
|
54
|
+
* @param {object} [overrides] Injected for tests.
|
|
55
|
+
* @param {Function} [overrides.enumerate] (root) => [{scope,layout,path}].
|
|
56
|
+
* @param {Function} [overrides.readKeyNames] (path) => string[]|null.
|
|
57
|
+
*/
|
|
58
|
+
export async function getSecretsStatus(repoRoot, overrides = {}) {
|
|
59
|
+
const enumerate = overrides.enumerate || enumerateVaults;
|
|
60
|
+
const readKeyNames = overrides.readKeyNames || readVaultKeyNames;
|
|
61
|
+
|
|
62
|
+
const vaults = enumerate(repoRoot).map((v) => ({
|
|
63
|
+
scope: v.scope,
|
|
64
|
+
layout: v.layout,
|
|
65
|
+
path: v.path,
|
|
66
|
+
keys: readKeyNames(v.path) ?? [],
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
const union = new Set();
|
|
70
|
+
for (const v of vaults) for (const k of v.keys) union.add(k);
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
initialised: vaults.length > 0,
|
|
74
|
+
vaults,
|
|
75
|
+
keys: [...union].sort(),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Upsert a secret into an EXPLICITLY targeted vault. Returns
|
|
81
|
+
* `{ success: true }` or `{ success: false, error }` — never throws.
|
|
82
|
+
*
|
|
83
|
+
* `vault` is required: the string 'legacy' (or '(legacy)') for the legacy
|
|
84
|
+
* single-file vault, or a scope name for a scoped vault. There is no
|
|
85
|
+
* default — a missing target is refused so a UI or caller bug can never
|
|
86
|
+
* silently write a secret into the wrong store.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} repoRoot
|
|
89
|
+
* @param {string} key
|
|
90
|
+
* @param {string} value
|
|
91
|
+
* @param {string} vault REQUIRED explicit target.
|
|
92
|
+
* @param {object} [overrides] Injected for tests.
|
|
93
|
+
* @returns {Promise<{success: boolean, error?: string}>}
|
|
94
|
+
*/
|
|
95
|
+
export async function setSecret(repoRoot, key, value, vault, overrides = {}) {
|
|
96
|
+
if (!key || value == null || value === '') {
|
|
97
|
+
return { success: false, error: 'Missing key or value' };
|
|
98
|
+
}
|
|
99
|
+
if (!vault || typeof vault !== 'string') {
|
|
100
|
+
return { success: false, error: MISSING_TARGET_ERROR };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const checkDepsFn = overrides.checkDeps || checkDeps;
|
|
104
|
+
const checkVaultFn = overrides.checkVault || checkVault;
|
|
105
|
+
const getPubFn = overrides.getPublicKey || getPublicKey;
|
|
106
|
+
const decryptFn = overrides.decrypt || sopsDecrypt;
|
|
107
|
+
const encryptFn = overrides.encrypt || sopsEncrypt;
|
|
108
|
+
const encryptScopedFn = overrides.encryptScoped || sopsEncryptScoped;
|
|
109
|
+
|
|
110
|
+
const isLegacy = LEGACY_TARGETS.has(vault);
|
|
111
|
+
|
|
112
|
+
let paths;
|
|
113
|
+
try {
|
|
114
|
+
if (overrides.makePaths) {
|
|
115
|
+
paths = overrides.makePaths(vault);
|
|
116
|
+
} else if (isLegacy) {
|
|
117
|
+
paths = defaultPaths({ root: repoRoot });
|
|
118
|
+
} else {
|
|
119
|
+
// Scope-name validation, workspace/canonical layout resolution, and
|
|
120
|
+
// ambiguity refusal all live in resolveScopePaths. cwd is pinned to
|
|
121
|
+
// the workspace root the server was started for.
|
|
122
|
+
paths = resolveScopePaths({ scope: vault, cwd: repoRoot, env: overrides.env, home: overrides.home });
|
|
123
|
+
}
|
|
124
|
+
} catch (err) {
|
|
125
|
+
return { success: false, error: err && err.message ? err.message : String(err) };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const missingDeps = await checkDepsFn();
|
|
129
|
+
if (missingDeps.length > 0) {
|
|
130
|
+
return { success: false, error: `missing dependency: ${missingDeps[0]}` };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const vaultState = checkVaultFn(paths);
|
|
134
|
+
if (!vaultState.ok) {
|
|
135
|
+
return { success: false, error: vaultState.message || 'vault not initialised' };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Legacy encrypts to an explicit --age recipient from recipients.txt;
|
|
139
|
+
// scoped vaults have no recipients.txt — recipients come from the scope's
|
|
140
|
+
// own .sops.yaml creation_rule inside sopsEncryptScoped.
|
|
141
|
+
const pubKey = isLegacy ? getPubFn(paths) : null;
|
|
142
|
+
|
|
143
|
+
let data = {};
|
|
144
|
+
if (secretsFileExists(paths)) {
|
|
145
|
+
try {
|
|
146
|
+
data = await decryptFn(paths, paths.secretsFile);
|
|
147
|
+
} catch (err) {
|
|
148
|
+
// The pre-0.5.3 bridge (and the CLI's `set`) fall back to `data = {}`
|
|
149
|
+
// here — which REPLACES the entire store on the next encrypt if this
|
|
150
|
+
// host merely can't decrypt it (key not a recipient, wrong key, sops
|
|
151
|
+
// hiccup). That is the vault-clobber incident class. The workspace API
|
|
152
|
+
// refuses instead: an existing store you can't read is never a store
|
|
153
|
+
// you may overwrite.
|
|
154
|
+
const detail = err && err.message ? err.message : String(err);
|
|
155
|
+
return {
|
|
156
|
+
success: false,
|
|
157
|
+
error: `refusing to write: existing store at ${paths.secretsFile} could not be decrypted (${detail}) — writing would replace its contents`,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
data[key] = value;
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
if (isLegacy) {
|
|
166
|
+
await encryptFn(paths, pubKey, data);
|
|
167
|
+
} else {
|
|
168
|
+
await encryptScopedFn(paths, data);
|
|
169
|
+
}
|
|
170
|
+
} catch (err) {
|
|
171
|
+
return { success: false, error: err && err.message ? err.message : String(err) };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return { success: true };
|
|
175
|
+
}
|