@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,331 @@
|
|
|
1
|
+
// formatters.mjs — output-format renderers for `pa knowledge`.
|
|
2
|
+
//
|
|
3
|
+
// Three formats are supported per the brief:
|
|
4
|
+
//
|
|
5
|
+
// - `table` : human-readable ASCII with sane column widths.
|
|
6
|
+
// - `json` : machine-readable, stable-shape-by-convention. Consumed
|
|
7
|
+
// by dispatch-briefer (A2, next wave) and other agents.
|
|
8
|
+
// - `mermaid` : graph syntax for any mermaid renderer. Useful for
|
|
9
|
+
// visual debugging of "what's connected to what".
|
|
10
|
+
//
|
|
11
|
+
// Each verb has its own renderer per format. The JSON renderers just
|
|
12
|
+
// pass through the verb result — the CLI-layer wraps in `{verb, ...}`
|
|
13
|
+
// for stability.
|
|
14
|
+
|
|
15
|
+
// --- generic table primitives ---------------------------------------------
|
|
16
|
+
|
|
17
|
+
const TABLE_MAX_WIDTH = 120;
|
|
18
|
+
|
|
19
|
+
function padRight(s, width) {
|
|
20
|
+
return String(s ?? '').padEnd(width, ' ');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function truncate(s, max) {
|
|
24
|
+
s = String(s ?? '');
|
|
25
|
+
if (s.length <= max) return s;
|
|
26
|
+
return s.slice(0, Math.max(0, max - 1)) + '…';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function renderTable(headers, rows, { maxWidth = TABLE_MAX_WIDTH } = {}) {
|
|
30
|
+
if (rows.length === 0) return '(no rows)\n';
|
|
31
|
+
const cols = headers.map((h) => h.key);
|
|
32
|
+
const widths = {};
|
|
33
|
+
for (const h of headers) widths[h.key] = Math.max(h.label.length, ...rows.map((r) => String(r[h.key] ?? '').length));
|
|
34
|
+
// Cap column widths so a very long id doesn't blow out the table.
|
|
35
|
+
const capped = capWidths(headers, widths, maxWidth);
|
|
36
|
+
const lines = [];
|
|
37
|
+
lines.push(headers.map((h) => padRight(h.label, capped[h.key])).join(' '));
|
|
38
|
+
lines.push(headers.map((h) => '-'.repeat(capped[h.key])).join(' '));
|
|
39
|
+
for (const row of rows) {
|
|
40
|
+
lines.push(headers.map((h) => padRight(truncate(row[h.key], capped[h.key]), capped[h.key])).join(' '));
|
|
41
|
+
}
|
|
42
|
+
return lines.join('\n') + '\n';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function capWidths(headers, widths, maxWidth) {
|
|
46
|
+
const separators = (headers.length - 1) * 2;
|
|
47
|
+
const total = Object.values(widths).reduce((a, b) => a + b, 0) + separators;
|
|
48
|
+
if (total <= maxWidth) return { ...widths };
|
|
49
|
+
// Trim the widest column iteratively until we fit.
|
|
50
|
+
const capped = { ...widths };
|
|
51
|
+
let budget = total;
|
|
52
|
+
while (budget > maxWidth) {
|
|
53
|
+
const [widestKey, widestVal] = Object.entries(capped).sort((a, b) => b[1] - a[1])[0];
|
|
54
|
+
if (widestVal <= 8) break;
|
|
55
|
+
capped[widestKey] = widestVal - 1;
|
|
56
|
+
budget -= 1;
|
|
57
|
+
}
|
|
58
|
+
return capped;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- verb: related --------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
export function formatRelated(result, format) {
|
|
64
|
+
if (format === 'json') return JSON.stringify({ verb: 'related', ...result }, null, 2) + '\n';
|
|
65
|
+
if (format === 'mermaid') return renderRelatedMermaid(result);
|
|
66
|
+
return renderRelatedTable(result);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function renderRelatedTable({ anchor, neighbours }) {
|
|
70
|
+
if (neighbours.length === 0) return `${anchor}\n(no neighbours)\n`;
|
|
71
|
+
const rows = neighbours.map((n) => ({
|
|
72
|
+
direction: n.direction === 'out' ? '→' : '←',
|
|
73
|
+
id: n.id,
|
|
74
|
+
title: n.title ?? '',
|
|
75
|
+
domain: n.domain ?? '',
|
|
76
|
+
type: n.type ?? '',
|
|
77
|
+
}));
|
|
78
|
+
const header = `${anchor} (${neighbours.length} neighbour${neighbours.length === 1 ? '' : 's'})\n`;
|
|
79
|
+
return header + renderTable(
|
|
80
|
+
[
|
|
81
|
+
{ key: 'direction', label: 'dir' },
|
|
82
|
+
{ key: 'id', label: 'id' },
|
|
83
|
+
{ key: 'title', label: 'title' },
|
|
84
|
+
{ key: 'domain', label: 'domain' },
|
|
85
|
+
{ key: 'type', label: 'type' },
|
|
86
|
+
],
|
|
87
|
+
rows,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function renderRelatedMermaid({ anchor, neighbours }) {
|
|
92
|
+
const lines = ['graph LR'];
|
|
93
|
+
const seen = new Set();
|
|
94
|
+
const idFor = (s) => 'n' + hashSlug(s);
|
|
95
|
+
const declare = (id, label) => {
|
|
96
|
+
if (seen.has(id)) return;
|
|
97
|
+
seen.add(id);
|
|
98
|
+
lines.push(` ${idFor(id)}["${escapeMermaid(label ?? id)}"]`);
|
|
99
|
+
};
|
|
100
|
+
declare(anchor, anchor);
|
|
101
|
+
for (const n of neighbours) {
|
|
102
|
+
declare(n.id, n.title ?? n.id);
|
|
103
|
+
const label = n.type ? `|${n.type}|` : '';
|
|
104
|
+
if (n.direction === 'out') lines.push(` ${idFor(anchor)} -->${label} ${idFor(n.id)}`);
|
|
105
|
+
else lines.push(` ${idFor(n.id)} -->${label} ${idFor(anchor)}`);
|
|
106
|
+
}
|
|
107
|
+
return lines.join('\n') + '\n';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- verb: search ---------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
// The `envelope` opt carries the searchCascade() result envelope when the
|
|
113
|
+
// caller took the cascade path (default). Byte-identical rule: a tier-1
|
|
114
|
+
// hit (`mode:'title'`, non-empty results) MUST render exactly what the
|
|
115
|
+
// pre-cascade world rendered — no header line, JSON without `mode` or
|
|
116
|
+
// `hint`. Cascade tiers (body / partial / miss) get a header label and
|
|
117
|
+
// the JSON gains `mode` plus, for miss, a `hint.nearestDomains`.
|
|
118
|
+
//
|
|
119
|
+
// `--strict` and the eval runner call this without an envelope; those
|
|
120
|
+
// callers see the pre-cascade shape unconditionally.
|
|
121
|
+
export function formatSearch(results, format, { term, envelope } = {}) {
|
|
122
|
+
const isCascade = envelope != null;
|
|
123
|
+
const showBanner = isCascade && envelope.mode !== 'title';
|
|
124
|
+
if (format === 'json') {
|
|
125
|
+
const payload = { verb: 'search', term, results };
|
|
126
|
+
if (showBanner) {
|
|
127
|
+
payload.mode = envelope.mode;
|
|
128
|
+
if (envelope.tokensTotal != null) payload.tokensTotal = envelope.tokensTotal;
|
|
129
|
+
if (envelope.hint) payload.hint = envelope.hint;
|
|
130
|
+
}
|
|
131
|
+
return JSON.stringify(payload, null, 2) + '\n';
|
|
132
|
+
}
|
|
133
|
+
if (format === 'mermaid') return renderSearchMermaid(results);
|
|
134
|
+
return renderSearchTable(results, showBanner ? envelope : null);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function renderSearchTable(results, envelope) {
|
|
138
|
+
if (envelope != null && envelope.mode === 'miss') {
|
|
139
|
+
return renderGuidedMiss(envelope);
|
|
140
|
+
}
|
|
141
|
+
if (results.length === 0) return '(no matches)\n';
|
|
142
|
+
const rows = results.map((r) => ({
|
|
143
|
+
score: r.score,
|
|
144
|
+
edges: r.edgeCount,
|
|
145
|
+
id: r.id,
|
|
146
|
+
title: r.title ?? '',
|
|
147
|
+
domain: r.domain ?? '',
|
|
148
|
+
hits: r.tokensMatched != null ? `${r.tokensMatched}/${r.tokensTotal}` : '',
|
|
149
|
+
}));
|
|
150
|
+
const headers = [
|
|
151
|
+
{ key: 'score', label: 'score' },
|
|
152
|
+
{ key: 'edges', label: 'edges' },
|
|
153
|
+
{ key: 'id', label: 'id' },
|
|
154
|
+
{ key: 'title', label: 'title' },
|
|
155
|
+
{ key: 'domain', label: 'domain' },
|
|
156
|
+
];
|
|
157
|
+
let prefix = '';
|
|
158
|
+
if (envelope != null) {
|
|
159
|
+
if (envelope.mode === 'body') {
|
|
160
|
+
prefix = '(matched in body)\n';
|
|
161
|
+
} else if (envelope.mode === 'partial') {
|
|
162
|
+
const total = envelope.tokensTotal;
|
|
163
|
+
// Column added only for the partial tier so tier-1 tables stay
|
|
164
|
+
// shape-compatible with the pre-cascade world.
|
|
165
|
+
headers.push({ key: 'hits', label: 'hits' });
|
|
166
|
+
const nMax = results.reduce((m, r) => Math.max(m, r.tokensMatched ?? 0), 0);
|
|
167
|
+
prefix = `(partial match — ${nMax} of ${total} terms)\n`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return prefix + renderTable(headers, rows);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function renderGuidedMiss(envelope) {
|
|
174
|
+
const nd = envelope.hint?.nearestDomains ?? [];
|
|
175
|
+
const parts = ['(no matches — no doc contains every search term, even in the body.)', ''];
|
|
176
|
+
if (nd.length > 0) {
|
|
177
|
+
parts.push('Nearest domains:');
|
|
178
|
+
for (const d of nd) parts.push(` - ${d}`);
|
|
179
|
+
parts.push('');
|
|
180
|
+
parts.push(`Browse one with: pa knowledge domain <name>`);
|
|
181
|
+
parts.push(`Example: pa knowledge domain ${nd[0]}`);
|
|
182
|
+
} else {
|
|
183
|
+
parts.push('No populated domains in this graph.');
|
|
184
|
+
}
|
|
185
|
+
return parts.join('\n') + '\n';
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function renderSearchMermaid(results) {
|
|
189
|
+
if (results.length === 0) return '%% no matches\n';
|
|
190
|
+
const lines = ['graph LR'];
|
|
191
|
+
const idFor = (s) => 'n' + hashSlug(s);
|
|
192
|
+
for (const r of results) {
|
|
193
|
+
lines.push(` ${idFor(r.id)}["${escapeMermaid(r.title ?? r.id)}"]`);
|
|
194
|
+
}
|
|
195
|
+
return lines.join('\n') + '\n';
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// --- verb: domain ---------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
export function formatDomain(result, format) {
|
|
201
|
+
if (format === 'json') return JSON.stringify({ verb: 'domain', ...result }, null, 2) + '\n';
|
|
202
|
+
if (format === 'mermaid') return renderDomainMermaid(result);
|
|
203
|
+
return renderDomainTable(result);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function renderDomainTable({ domain, nodes, edges }) {
|
|
207
|
+
const header = `domain: ${domain} (${nodes.length} node${nodes.length === 1 ? '' : 's'}, ${edges.length} internal edge${edges.length === 1 ? '' : 's'})\n`;
|
|
208
|
+
const rows = nodes.map((n) => ({ id: n.id, title: n.title ?? '' }));
|
|
209
|
+
return header + renderTable(
|
|
210
|
+
[
|
|
211
|
+
{ key: 'id', label: 'id' },
|
|
212
|
+
{ key: 'title', label: 'title' },
|
|
213
|
+
],
|
|
214
|
+
rows,
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function renderDomainMermaid({ domain, nodes, edges }) {
|
|
219
|
+
const lines = ['graph LR'];
|
|
220
|
+
const idFor = (s) => 'n' + hashSlug(s);
|
|
221
|
+
for (const n of nodes) lines.push(` ${idFor(n.id)}["${escapeMermaid(n.title ?? n.id)}"]`);
|
|
222
|
+
for (const e of edges) {
|
|
223
|
+
const label = e.type ? `|${e.type}|` : '';
|
|
224
|
+
lines.push(` ${idFor(e.from)} -->${label} ${idFor(e.to)}`);
|
|
225
|
+
}
|
|
226
|
+
lines.push(` %% domain: ${domain}`);
|
|
227
|
+
return lines.join('\n') + '\n';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// --- verb: orphans --------------------------------------------------------
|
|
231
|
+
|
|
232
|
+
export function formatOrphans(results, format) {
|
|
233
|
+
if (format === 'json') return JSON.stringify({ verb: 'orphans', results }, null, 2) + '\n';
|
|
234
|
+
if (format === 'mermaid') return renderOrphansMermaid(results);
|
|
235
|
+
return renderOrphansTable(results);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function renderOrphansTable(results) {
|
|
239
|
+
if (results.length === 0) return '(no orphans)\n';
|
|
240
|
+
const rows = results.map((r) => ({
|
|
241
|
+
id: r.id,
|
|
242
|
+
title: r.title ?? '',
|
|
243
|
+
domain: r.domain ?? '',
|
|
244
|
+
outDegree: r.outDegree,
|
|
245
|
+
}));
|
|
246
|
+
return renderTable(
|
|
247
|
+
[
|
|
248
|
+
{ key: 'id', label: 'id' },
|
|
249
|
+
{ key: 'title', label: 'title' },
|
|
250
|
+
{ key: 'domain', label: 'domain' },
|
|
251
|
+
{ key: 'outDegree', label: 'outEdges' },
|
|
252
|
+
],
|
|
253
|
+
rows,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function renderOrphansMermaid(results) {
|
|
258
|
+
if (results.length === 0) return '%% no orphans\n';
|
|
259
|
+
const lines = ['graph LR'];
|
|
260
|
+
const idFor = (s) => 'n' + hashSlug(s);
|
|
261
|
+
for (const r of results) lines.push(` ${idFor(r.id)}["${escapeMermaid(r.title ?? r.id)}"]`);
|
|
262
|
+
return lines.join('\n') + '\n';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// --- verb: path -----------------------------------------------------------
|
|
266
|
+
|
|
267
|
+
export function formatPath(result, format) {
|
|
268
|
+
if (format === 'json') return JSON.stringify({ verb: 'path', ...result }, null, 2) + '\n';
|
|
269
|
+
if (format === 'mermaid') return renderPathMermaid(result);
|
|
270
|
+
return renderPathTable(result);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function renderPathTable({ from, to, path }) {
|
|
274
|
+
if (path == null) return `no path from ${from} to ${to}\n`;
|
|
275
|
+
const header = `${from} → ${to} (${path.length - 1} hop${path.length - 1 === 1 ? '' : 's'})\n`;
|
|
276
|
+
const rows = path.map((step, i) => ({
|
|
277
|
+
step: i + 1,
|
|
278
|
+
id: step.id,
|
|
279
|
+
title: step.title ?? '',
|
|
280
|
+
edge: step.type ?? '(anchor)',
|
|
281
|
+
}));
|
|
282
|
+
return header + renderTable(
|
|
283
|
+
[
|
|
284
|
+
{ key: 'step', label: 'step' },
|
|
285
|
+
{ key: 'id', label: 'id' },
|
|
286
|
+
{ key: 'title', label: 'title' },
|
|
287
|
+
{ key: 'edge', label: 'via' },
|
|
288
|
+
],
|
|
289
|
+
rows,
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function renderPathMermaid({ from, to, path }) {
|
|
294
|
+
if (path == null) return `%% no path from ${from} to ${to}\n`;
|
|
295
|
+
const lines = ['graph LR'];
|
|
296
|
+
const idFor = (s) => 'n' + hashSlug(s);
|
|
297
|
+
for (const step of path) lines.push(` ${idFor(step.id)}["${escapeMermaid(step.title ?? step.id)}"]`);
|
|
298
|
+
for (let i = 1; i < path.length; i++) {
|
|
299
|
+
const prev = path[i - 1];
|
|
300
|
+
const curr = path[i];
|
|
301
|
+
const label = curr.type ? `|${curr.type}|` : '';
|
|
302
|
+
lines.push(` ${idFor(prev.id)} -->${label} ${idFor(curr.id)}`);
|
|
303
|
+
}
|
|
304
|
+
return lines.join('\n') + '\n';
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// --- shared helpers -------------------------------------------------------
|
|
308
|
+
|
|
309
|
+
// Mermaid ids must match `[A-Za-z_][A-Za-z0-9_]*`. Our slugs contain
|
|
310
|
+
// slashes, dots, dashes. Hash the slug to a stable short id — no
|
|
311
|
+
// collisions in practice at graph sizes we care about (<10K nodes).
|
|
312
|
+
function hashSlug(slug) {
|
|
313
|
+
// djb2 truncated to 8 hex chars. Deterministic + node-stdlib only.
|
|
314
|
+
let hash = 5381;
|
|
315
|
+
for (let i = 0; i < slug.length; i++) {
|
|
316
|
+
hash = ((hash << 5) + hash) ^ slug.charCodeAt(i);
|
|
317
|
+
hash = hash >>> 0;
|
|
318
|
+
}
|
|
319
|
+
return hash.toString(16).padStart(8, '0');
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function escapeMermaid(s) {
|
|
323
|
+
// Mermaid node labels wrapped in double quotes tolerate most characters
|
|
324
|
+
// except embedded double quotes. Backslash + double-quote is not portable
|
|
325
|
+
// across mermaid renderers, so we substitute with a single quote.
|
|
326
|
+
return String(s).replace(/"/g, "'");
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Test seams — exposed so unit tests can pin the primitives without
|
|
330
|
+
// duplicating the format contract.
|
|
331
|
+
export const _internals = { renderTable, hashSlug, escapeMermaid };
|