eai-cli 0.0.0-bootstrap.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 +183 -0
- package/NOTICE +4 -0
- package/README.md +14 -0
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +69 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/blocks.d.ts +3 -0
- package/dist/commands/blocks.d.ts.map +1 -0
- package/dist/commands/blocks.js +249 -0
- package/dist/commands/blocks.js.map +1 -0
- package/dist/commands/chat.d.ts +6 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +105 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/deploy.d.ts +36 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +712 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +15 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +133 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/docs.d.ts +6 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +118 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/env.d.ts +10 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +200 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/errors.d.ts +3 -0
- package/dist/commands/errors.d.ts.map +1 -0
- package/dist/commands/errors.js +72 -0
- package/dist/commands/errors.js.map +1 -0
- package/dist/commands/gofer.d.ts +3 -0
- package/dist/commands/gofer.d.ts.map +1 -0
- package/dist/commands/gofer.js +134 -0
- package/dist/commands/gofer.js.map +1 -0
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1437 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +7 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +117 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/provision.d.ts +6 -0
- package/dist/commands/provision.d.ts.map +1 -0
- package/dist/commands/provision.js +855 -0
- package/dist/commands/provision.js.map +1 -0
- package/dist/commands/publicapi.d.ts +6 -0
- package/dist/commands/publicapi.d.ts.map +1 -0
- package/dist/commands/publicapi.js +184 -0
- package/dist/commands/publicapi.js.map +1 -0
- package/dist/commands/resources.d.ts +38 -0
- package/dist/commands/resources.d.ts.map +1 -0
- package/dist/commands/resources.js +1010 -0
- package/dist/commands/resources.js.map +1 -0
- package/dist/commands/runtime.d.ts +3 -0
- package/dist/commands/runtime.d.ts.map +1 -0
- package/dist/commands/runtime.js +78 -0
- package/dist/commands/runtime.js.map +1 -0
- package/dist/commands/template.d.ts +3 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +365 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/tenant.d.ts +45 -0
- package/dist/commands/tenant.d.ts.map +1 -0
- package/dist/commands/tenant.js +1036 -0
- package/dist/commands/tenant.js.map +1 -0
- package/dist/commands/types.d.ts +130 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +1636 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/update.d.ts +13 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +163 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/user.d.ts +6 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +359 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/verify.d.ts +40 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +1442 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/vertical.d.ts +24 -0
- package/dist/commands/vertical.d.ts.map +1 -0
- package/dist/commands/vertical.js +301 -0
- package/dist/commands/vertical.js.map +1 -0
- package/dist/commands/whoami.d.ts +6 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +73 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/workflow.d.ts +6 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +400 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +272 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/agent-guide.d.ts +24 -0
- package/dist/lib/agent-guide.d.ts.map +1 -0
- package/dist/lib/agent-guide.js +155 -0
- package/dist/lib/agent-guide.js.map +1 -0
- package/dist/lib/api.d.ts +338 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +991 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/auth.d.ts +65 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +592 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/azure-cli.d.ts +6 -0
- package/dist/lib/azure-cli.d.ts.map +1 -0
- package/dist/lib/azure-cli.js +13 -0
- package/dist/lib/azure-cli.js.map +1 -0
- package/dist/lib/block-catalog-normalize.d.ts +47 -0
- package/dist/lib/block-catalog-normalize.d.ts.map +1 -0
- package/dist/lib/block-catalog-normalize.js +355 -0
- package/dist/lib/block-catalog-normalize.js.map +1 -0
- package/dist/lib/block-catalog-types.d.ts +111 -0
- package/dist/lib/block-catalog-types.d.ts.map +1 -0
- package/dist/lib/block-catalog-types.js +41 -0
- package/dist/lib/block-catalog-types.js.map +1 -0
- package/dist/lib/block-catalog-utils.d.ts +7 -0
- package/dist/lib/block-catalog-utils.d.ts.map +1 -0
- package/dist/lib/block-catalog-utils.js +47 -0
- package/dist/lib/block-catalog-utils.js.map +1 -0
- package/dist/lib/block-catalog-validation.d.ts +5 -0
- package/dist/lib/block-catalog-validation.d.ts.map +1 -0
- package/dist/lib/block-catalog-validation.js +112 -0
- package/dist/lib/block-catalog-validation.js.map +1 -0
- package/dist/lib/block-catalog.d.ts +3 -0
- package/dist/lib/block-catalog.d.ts.map +1 -0
- package/dist/lib/block-catalog.js +284 -0
- package/dist/lib/block-catalog.js.map +1 -0
- package/dist/lib/cloud-env.d.ts +25 -0
- package/dist/lib/cloud-env.d.ts.map +1 -0
- package/dist/lib/cloud-env.js +79 -0
- package/dist/lib/cloud-env.js.map +1 -0
- package/dist/lib/config.d.ts +116 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +195 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/context.d.ts +43 -0
- package/dist/lib/context.d.ts.map +1 -0
- package/dist/lib/context.js +68 -0
- package/dist/lib/context.js.map +1 -0
- package/dist/lib/error-codes.d.ts +56 -0
- package/dist/lib/error-codes.d.ts.map +1 -0
- package/dist/lib/error-codes.js +211 -0
- package/dist/lib/error-codes.js.map +1 -0
- package/dist/lib/error-guidance/catalog.d.ts +648 -0
- package/dist/lib/error-guidance/catalog.d.ts.map +1 -0
- package/dist/lib/error-guidance/catalog.js +940 -0
- package/dist/lib/error-guidance/catalog.js.map +1 -0
- package/dist/lib/error-guidance/match.d.ts +3 -0
- package/dist/lib/error-guidance/match.d.ts.map +1 -0
- package/dist/lib/error-guidance/match.js +46 -0
- package/dist/lib/error-guidance/match.js.map +1 -0
- package/dist/lib/error-guidance/render.d.ts +5 -0
- package/dist/lib/error-guidance/render.d.ts.map +1 -0
- package/dist/lib/error-guidance/render.js +92 -0
- package/dist/lib/error-guidance/render.js.map +1 -0
- package/dist/lib/error-guidance/types.d.ts +76 -0
- package/dist/lib/error-guidance/types.d.ts.map +1 -0
- package/dist/lib/error-guidance/types.js +2 -0
- package/dist/lib/error-guidance/types.js.map +1 -0
- package/dist/lib/error-guidance/validate.d.ts +3 -0
- package/dist/lib/error-guidance/validate.d.ts.map +1 -0
- package/dist/lib/error-guidance/validate.js +59 -0
- package/dist/lib/error-guidance/validate.js.map +1 -0
- package/dist/lib/gofer-installer.d.ts +32 -0
- package/dist/lib/gofer-installer.d.ts.map +1 -0
- package/dist/lib/gofer-installer.js +589 -0
- package/dist/lib/gofer-installer.js.map +1 -0
- package/dist/lib/gofer-refresh.d.ts +46 -0
- package/dist/lib/gofer-refresh.d.ts.map +1 -0
- package/dist/lib/gofer-refresh.js +536 -0
- package/dist/lib/gofer-refresh.js.map +1 -0
- package/dist/lib/next-route-exports.d.ts +6 -0
- package/dist/lib/next-route-exports.d.ts.map +1 -0
- package/dist/lib/next-route-exports.js +127 -0
- package/dist/lib/next-route-exports.js.map +1 -0
- package/dist/lib/npm.d.ts +2 -0
- package/dist/lib/npm.d.ts.map +1 -0
- package/dist/lib/npm.js +4 -0
- package/dist/lib/npm.js.map +1 -0
- package/dist/lib/object-type-defaults.d.ts +4 -0
- package/dist/lib/object-type-defaults.d.ts.map +1 -0
- package/dist/lib/object-type-defaults.js +72 -0
- package/dist/lib/object-type-defaults.js.map +1 -0
- package/dist/lib/output.d.ts +35 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +166 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/profile.d.ts +52 -0
- package/dist/lib/profile.d.ts.map +1 -0
- package/dist/lib/profile.js +116 -0
- package/dist/lib/profile.js.map +1 -0
- package/dist/lib/project-manifest.d.ts +42 -0
- package/dist/lib/project-manifest.d.ts.map +1 -0
- package/dist/lib/project-manifest.js +191 -0
- package/dist/lib/project-manifest.js.map +1 -0
- package/dist/lib/resourceapi-bundle.d.ts +33 -0
- package/dist/lib/resourceapi-bundle.d.ts.map +1 -0
- package/dist/lib/resourceapi-bundle.js +79 -0
- package/dist/lib/resourceapi-bundle.js.map +1 -0
- package/dist/lib/runtime-contract.d.ts +84 -0
- package/dist/lib/runtime-contract.d.ts.map +1 -0
- package/dist/lib/runtime-contract.js +318 -0
- package/dist/lib/runtime-contract.js.map +1 -0
- package/dist/lib/schema-builder.d.ts +28 -0
- package/dist/lib/schema-builder.d.ts.map +1 -0
- package/dist/lib/schema-builder.js +69 -0
- package/dist/lib/schema-builder.js.map +1 -0
- package/dist/lib/tenant-context.d.ts +127 -0
- package/dist/lib/tenant-context.d.ts.map +1 -0
- package/dist/lib/tenant-context.js +573 -0
- package/dist/lib/tenant-context.js.map +1 -0
- package/dist/lib/update-check.d.ts +52 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +271 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/update-maintenance.d.ts +15 -0
- package/dist/lib/update-maintenance.d.ts.map +1 -0
- package/dist/lib/update-maintenance.js +187 -0
- package/dist/lib/update-maintenance.js.map +1 -0
- package/dist/lib/utils.d.ts +23 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +48 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/workflow-provisioning.d.ts +54 -0
- package/dist/lib/workflow-provisioning.d.ts.map +1 -0
- package/dist/lib/workflow-provisioning.js +281 -0
- package/dist/lib/workflow-provisioning.js.map +1 -0
- package/package.json +51 -0
- package/resources/gofer/.gofer-version +7 -0
- package/resources/gofer/agents-skills/0_gofer_start/SKILL.md +1287 -0
- package/resources/gofer/agents-skills/0a_problem_validation/SKILL.md +429 -0
- package/resources/gofer/agents-skills/10_gofer_cloud/SKILL.md +635 -0
- package/resources/gofer/agents-skills/1_gofer_research/SKILL.md +1159 -0
- package/resources/gofer/agents-skills/2_gofer_specify/SKILL.md +860 -0
- package/resources/gofer/agents-skills/3_gofer_plan/SKILL.md +886 -0
- package/resources/gofer/agents-skills/4_gofer_tasks/SKILL.md +748 -0
- package/resources/gofer/agents-skills/5_gofer_implement/SKILL.md +924 -0
- package/resources/gofer/agents-skills/6_gofer_validate/SKILL.md +2269 -0
- package/resources/gofer/agents-skills/7_gofer_save/SKILL.md +423 -0
- package/resources/gofer/agents-skills/7a_stakeholder_comms/SKILL.md +508 -0
- package/resources/gofer/agents-skills/8_gofer_branding/SKILL.md +315 -0
- package/resources/gofer/agents-skills/9_gofer_tests/SKILL.md +558 -0
- package/resources/gofer/agents-skills/gofer_bootstrap_workspace/SKILL.md +148 -0
- package/resources/gofer/agents-skills/gofer_check_workspace/SKILL.md +119 -0
- package/resources/gofer/agents-skills/gofer_constitution/SKILL.md +612 -0
- package/resources/gofer/agents-skills/gofer_diagnose/SKILL.md +114 -0
- package/resources/gofer/agents-skills/gofer_eai_first_run/SKILL.md +397 -0
- package/resources/gofer/agents-skills/gofer_hydrate/SKILL.md +561 -0
- package/resources/gofer/agents-skills/gofer_personality/SKILL.md +44 -0
- package/resources/gofer/agents-skills/gofer_plan/SKILL.md +40 -0
- package/resources/gofer/agents-skills/gofer_side/SKILL.md +45 -0
- package/resources/gofer/agents-skills/gofer_spec_summary/SKILL.md +112 -0
- package/resources/gofer/agents-skills/gofer_tdd/SKILL.md +112 -0
- package/resources/gofer/agents-skills/gofer_vocabulary/SKILL.md +112 -0
- package/resources/gofer/agents-skills/gofer_zoom_out/SKILL.md +112 -0
- package/resources/gofer/bash-scripts/check-context-health.sh +365 -0
- package/resources/gofer/bash-scripts/check-persona-pack.sh +81 -0
- package/resources/gofer/bash-scripts/check-prerequisites.sh +168 -0
- package/resources/gofer/bash-scripts/common.sh +192 -0
- package/resources/gofer/bash-scripts/create-new-feature.sh +260 -0
- package/resources/gofer/bash-scripts/install-optional-tools.sh +270 -0
- package/resources/gofer/bash-scripts/log-stage.sh +224 -0
- package/resources/gofer/bash-scripts/mark-task-complete.sh +74 -0
- package/resources/gofer/bash-scripts/pipeline-state.sh +306 -0
- package/resources/gofer/bash-scripts/read-failed-approaches.sh +114 -0
- package/resources/gofer/bash-scripts/read-session-memories.sh +96 -0
- package/resources/gofer/bash-scripts/save-checkpoint.sh +407 -0
- package/resources/gofer/bash-scripts/setup-plan.sh +62 -0
- package/resources/gofer/bash-scripts/sync-implementation-status.sh +47 -0
- package/resources/gofer/bash-scripts/update-agent-context.sh +772 -0
- package/resources/gofer/bash-scripts/validate-artifact.sh +335 -0
- package/resources/gofer/bash-scripts/verify-task.sh +384 -0
- package/resources/gofer/bash-scripts/write-failed-approach.sh +110 -0
- package/resources/gofer/bash-scripts/write-periodic-checkpoint.sh +128 -0
- package/resources/gofer/bash-scripts/write-session-memory.sh +118 -0
- package/resources/gofer/claude-agents/assumption-tracker.md +168 -0
- package/resources/gofer/claude-agents/business-metrics-analyzer.md +169 -0
- package/resources/gofer/claude-agents/business-problem-validator.md +168 -0
- package/resources/gofer/claude-agents/codebase-analyzer.md +124 -0
- package/resources/gofer/claude-agents/codebase-locator.md +95 -0
- package/resources/gofer/claude-agents/codebase-pattern-finder.md +180 -0
- package/resources/gofer/claude-agents/comms-writer.md +158 -0
- package/resources/gofer/claude-agents/engineer-review.md +169 -0
- package/resources/gofer/claude-agents/implement-bug-triangulator.md +94 -0
- package/resources/gofer/claude-agents/implement-code-review-council.md +89 -0
- package/resources/gofer/claude-agents/implement-doc-writer.md +89 -0
- package/resources/gofer/claude-agents/implement-error-hardener.md +84 -0
- package/resources/gofer/claude-agents/implement-performance-explorer.md +95 -0
- package/resources/gofer/claude-agents/implement-test-diversifier.md +82 -0
- package/resources/gofer/claude-agents/implement-variant-generator.md +80 -0
- package/resources/gofer/claude-agents/multi-perspective-judge.md +114 -0
- package/resources/gofer/claude-agents/plan-api-comparator.md +90 -0
- package/resources/gofer/claude-agents/plan-architecture-diverger.md +100 -0
- package/resources/gofer/claude-agents/plan-data-model-stress-tester.md +95 -0
- package/resources/gofer/claude-agents/plan-migration-path-finder.md +95 -0
- package/resources/gofer/claude-agents/plan-refactor-rewrite-advisor.md +97 -0
- package/resources/gofer/claude-agents/research-dependency-evaluator.md +106 -0
- package/resources/gofer/claude-agents/research-horizon-scanner.md +100 -0
- package/resources/gofer/claude-agents/research-market-scanner.md +137 -0
- package/resources/gofer/claude-agents/research-perspective-multiplier.md +102 -0
- package/resources/gofer/claude-agents/scope-creep-detector.md +152 -0
- package/resources/gofer/claude-agents/specify-ambiguity-detector.md +95 -0
- package/resources/gofer/claude-agents/specify-journey-stress-tester.md +92 -0
- package/resources/gofer/claude-agents/tasks-cross-cutting-scanner.md +91 -0
- package/resources/gofer/claude-agents/tasks-rollback-planner.md +89 -0
- package/resources/gofer/claude-agents/validate-security-red-team.md +102 -0
- package/resources/gofer/claude-agents/validation-correctness.md +103 -0
- package/resources/gofer/claude-agents/validation-integration.md +129 -0
- package/resources/gofer/claude-agents/validation-performance.md +120 -0
- package/resources/gofer/claude-agents/validation-security.md +115 -0
- package/resources/gofer/claude-agents/validation-standards.md +151 -0
- package/resources/gofer/claude-agents/validation-test-quality.md +146 -0
- package/resources/gofer/claude-agents/visual-bounded-context-writer.md +40 -0
- package/resources/gofer/claude-agents/visual-c4-writer.md +45 -0
- package/resources/gofer/claude-agents/visual-erd-writer.md +34 -0
- package/resources/gofer/claude-agents/visual-heatmap-writer.md +63 -0
- package/resources/gofer/claude-agents/visual-risk-writer.md +64 -0
- package/resources/gofer/claude-commands/0_gofer_start.md +1282 -0
- package/resources/gofer/claude-commands/0a_problem_validation.md +424 -0
- package/resources/gofer/claude-commands/10_gofer_cloud.md +630 -0
- package/resources/gofer/claude-commands/1_gofer_research.md +1154 -0
- package/resources/gofer/claude-commands/2_gofer_specify.md +855 -0
- package/resources/gofer/claude-commands/3_gofer_plan.md +881 -0
- package/resources/gofer/claude-commands/4_gofer_tasks.md +743 -0
- package/resources/gofer/claude-commands/5_gofer_implement.md +919 -0
- package/resources/gofer/claude-commands/6_gofer_validate.md +2264 -0
- package/resources/gofer/claude-commands/7_gofer_save.md +418 -0
- package/resources/gofer/claude-commands/7a_stakeholder_comms.md +503 -0
- package/resources/gofer/claude-commands/8_gofer_branding.md +310 -0
- package/resources/gofer/claude-commands/9_gofer_tests.md +553 -0
- package/resources/gofer/claude-commands/gofer_bootstrap_workspace.md +143 -0
- package/resources/gofer/claude-commands/gofer_check_workspace.md +114 -0
- package/resources/gofer/claude-commands/gofer_constitution.md +607 -0
- package/resources/gofer/claude-commands/gofer_diagnose.md +109 -0
- package/resources/gofer/claude-commands/gofer_eai_first_run.md +392 -0
- package/resources/gofer/claude-commands/gofer_hydrate.md +556 -0
- package/resources/gofer/claude-commands/gofer_personality.md +39 -0
- package/resources/gofer/claude-commands/gofer_plan.md +35 -0
- package/resources/gofer/claude-commands/gofer_side.md +40 -0
- package/resources/gofer/claude-commands/gofer_spec_summary.md +107 -0
- package/resources/gofer/claude-commands/gofer_tdd.md +107 -0
- package/resources/gofer/claude-commands/gofer_vocabulary.md +107 -0
- package/resources/gofer/claude-commands/gofer_zoom_out.md +107 -0
- package/resources/gofer/claude-skills/eai-gofer/SKILL.md +56 -0
- package/resources/gofer/commands/.gitkeep +0 -0
- package/resources/gofer/commands/0_gofer_start.md +1299 -0
- package/resources/gofer/commands/0a_problem_validation.md +405 -0
- package/resources/gofer/commands/10_gofer_cloud.md +611 -0
- package/resources/gofer/commands/1_gofer_research.md +1135 -0
- package/resources/gofer/commands/2_gofer_specify.md +836 -0
- package/resources/gofer/commands/3_gofer_plan.md +862 -0
- package/resources/gofer/commands/4_gofer_tasks.md +724 -0
- package/resources/gofer/commands/5_gofer_implement.md +900 -0
- package/resources/gofer/commands/6_gofer_validate.md +2245 -0
- package/resources/gofer/commands/7_gofer_save.md +399 -0
- package/resources/gofer/commands/7a_stakeholder_comms.md +484 -0
- package/resources/gofer/commands/8_gofer_branding.md +291 -0
- package/resources/gofer/commands/9_gofer_tests.md +534 -0
- package/resources/gofer/commands/gofer_bootstrap_workspace.md +159 -0
- package/resources/gofer/commands/gofer_check_workspace.md +130 -0
- package/resources/gofer/commands/gofer_constitution.md +588 -0
- package/resources/gofer/commands/gofer_diagnose.md +89 -0
- package/resources/gofer/commands/gofer_eai_first_run.md +392 -0
- package/resources/gofer/commands/gofer_hydrate.md +537 -0
- package/resources/gofer/commands/gofer_personality.md +61 -0
- package/resources/gofer/commands/gofer_plan.md +51 -0
- package/resources/gofer/commands/gofer_side.md +56 -0
- package/resources/gofer/commands/gofer_spec_summary.md +87 -0
- package/resources/gofer/commands/gofer_tdd.md +87 -0
- package/resources/gofer/commands/gofer_vocabulary.md +87 -0
- package/resources/gofer/commands/gofer_zoom_out.md +87 -0
- package/resources/gofer/copilot-instructions/gofer-cost.instructions.md +13 -0
- package/resources/gofer/copilot-instructions/language-server.instructions.md +49 -0
- package/resources/gofer/copilot-instructions/typescript.instructions.md +47 -0
- package/resources/gofer/copilot-instructions/vscode-extension.instructions.md +46 -0
- package/resources/gofer/copilot-prompts/0_gofer_start.prompt.md +1308 -0
- package/resources/gofer/copilot-prompts/0a_problem_validation.prompt.md +429 -0
- package/resources/gofer/copilot-prompts/10_gofer_cloud.prompt.md +644 -0
- package/resources/gofer/copilot-prompts/1_gofer_research.prompt.md +1177 -0
- package/resources/gofer/copilot-prompts/2_gofer_specify.prompt.md +878 -0
- package/resources/gofer/copilot-prompts/3_gofer_plan.prompt.md +904 -0
- package/resources/gofer/copilot-prompts/4_gofer_tasks.prompt.md +766 -0
- package/resources/gofer/copilot-prompts/5_gofer_implement.prompt.md +942 -0
- package/resources/gofer/copilot-prompts/6_gofer_validate.prompt.md +2277 -0
- package/resources/gofer/copilot-prompts/7_gofer_save.prompt.md +433 -0
- package/resources/gofer/copilot-prompts/7a_stakeholder_comms.prompt.md +516 -0
- package/resources/gofer/copilot-prompts/8_gofer_branding.prompt.md +323 -0
- package/resources/gofer/copilot-prompts/9_gofer_tests.prompt.md +566 -0
- package/resources/gofer/copilot-prompts/gofer_bootstrap_workspace.prompt.md +161 -0
- package/resources/gofer/copilot-prompts/gofer_check_workspace.prompt.md +132 -0
- package/resources/gofer/copilot-prompts/gofer_constitution.prompt.md +621 -0
- package/resources/gofer/copilot-prompts/gofer_diagnose.prompt.md +127 -0
- package/resources/gofer/copilot-prompts/gofer_eai_first_run.prompt.md +410 -0
- package/resources/gofer/copilot-prompts/gofer_hydrate.prompt.md +571 -0
- package/resources/gofer/copilot-prompts/gofer_personality.prompt.md +57 -0
- package/resources/gofer/copilot-prompts/gofer_plan.prompt.md +53 -0
- package/resources/gofer/copilot-prompts/gofer_side.prompt.md +58 -0
- package/resources/gofer/copilot-prompts/gofer_spec_summary.prompt.md +125 -0
- package/resources/gofer/copilot-prompts/gofer_tdd.prompt.md +125 -0
- package/resources/gofer/copilot-prompts/gofer_vocabulary.prompt.md +125 -0
- package/resources/gofer/copilot-prompts/gofer_zoom_out.prompt.md +125 -0
- package/resources/gofer/gemini/agents/assumption-tracker.md +171 -0
- package/resources/gofer/gemini/agents/business-metrics-analyzer.md +172 -0
- package/resources/gofer/gemini/agents/business-problem-validator.md +171 -0
- package/resources/gofer/gemini/agents/codebase-analyzer.md +127 -0
- package/resources/gofer/gemini/agents/codebase-locator.md +98 -0
- package/resources/gofer/gemini/agents/codebase-pattern-finder.md +183 -0
- package/resources/gofer/gemini/agents/comms-writer.md +161 -0
- package/resources/gofer/gemini/agents/engineer-review.md +172 -0
- package/resources/gofer/gemini/agents/implement-bug-triangulator.md +97 -0
- package/resources/gofer/gemini/agents/implement-code-review-council.md +92 -0
- package/resources/gofer/gemini/agents/implement-doc-writer.md +92 -0
- package/resources/gofer/gemini/agents/implement-error-hardener.md +87 -0
- package/resources/gofer/gemini/agents/implement-performance-explorer.md +98 -0
- package/resources/gofer/gemini/agents/implement-test-diversifier.md +85 -0
- package/resources/gofer/gemini/agents/implement-variant-generator.md +83 -0
- package/resources/gofer/gemini/agents/multi-perspective-judge.md +117 -0
- package/resources/gofer/gemini/agents/plan-api-comparator.md +93 -0
- package/resources/gofer/gemini/agents/plan-architecture-diverger.md +103 -0
- package/resources/gofer/gemini/agents/plan-data-model-stress-tester.md +98 -0
- package/resources/gofer/gemini/agents/plan-migration-path-finder.md +98 -0
- package/resources/gofer/gemini/agents/plan-refactor-rewrite-advisor.md +100 -0
- package/resources/gofer/gemini/agents/research-dependency-evaluator.md +109 -0
- package/resources/gofer/gemini/agents/research-horizon-scanner.md +103 -0
- package/resources/gofer/gemini/agents/research-market-scanner.md +140 -0
- package/resources/gofer/gemini/agents/research-perspective-multiplier.md +105 -0
- package/resources/gofer/gemini/agents/scope-creep-detector.md +155 -0
- package/resources/gofer/gemini/agents/specify-ambiguity-detector.md +98 -0
- package/resources/gofer/gemini/agents/specify-journey-stress-tester.md +95 -0
- package/resources/gofer/gemini/agents/tasks-cross-cutting-scanner.md +94 -0
- package/resources/gofer/gemini/agents/tasks-rollback-planner.md +92 -0
- package/resources/gofer/gemini/agents/validate-security-red-team.md +105 -0
- package/resources/gofer/gemini/agents/validation-correctness.md +106 -0
- package/resources/gofer/gemini/agents/validation-integration.md +132 -0
- package/resources/gofer/gemini/agents/validation-performance.md +123 -0
- package/resources/gofer/gemini/agents/validation-security.md +118 -0
- package/resources/gofer/gemini/agents/validation-standards.md +154 -0
- package/resources/gofer/gemini/agents/validation-test-quality.md +149 -0
- package/resources/gofer/gemini/agents/visual-bounded-context-writer.md +40 -0
- package/resources/gofer/gemini/agents/visual-c4-writer.md +44 -0
- package/resources/gofer/gemini/agents/visual-erd-writer.md +36 -0
- package/resources/gofer/gemini/agents/visual-heatmap-writer.md +63 -0
- package/resources/gofer/gemini/agents/visual-risk-writer.md +64 -0
- package/resources/gofer/gemini/commands/gofer/.gitkeep +0 -0
- package/resources/gofer/gemini/commands/gofer/0_gofer_start.md +1282 -0
- package/resources/gofer/gemini/commands/gofer/0_gofer_start.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/0a_problem_validation.md +424 -0
- package/resources/gofer/gemini/commands/gofer/0a_problem_validation.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/10_gofer_cloud.md +630 -0
- package/resources/gofer/gemini/commands/gofer/10_gofer_cloud.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/1_gofer_research.md +1154 -0
- package/resources/gofer/gemini/commands/gofer/1_gofer_research.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/2_gofer_specify.md +855 -0
- package/resources/gofer/gemini/commands/gofer/2_gofer_specify.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/3_gofer_plan.md +881 -0
- package/resources/gofer/gemini/commands/gofer/3_gofer_plan.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/4_gofer_tasks.md +743 -0
- package/resources/gofer/gemini/commands/gofer/4_gofer_tasks.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/5_gofer_implement.md +919 -0
- package/resources/gofer/gemini/commands/gofer/5_gofer_implement.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/6_gofer_validate.md +2264 -0
- package/resources/gofer/gemini/commands/gofer/6_gofer_validate.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/7_gofer_save.md +418 -0
- package/resources/gofer/gemini/commands/gofer/7_gofer_save.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/7a_stakeholder_comms.md +503 -0
- package/resources/gofer/gemini/commands/gofer/7a_stakeholder_comms.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/8_gofer_branding.md +310 -0
- package/resources/gofer/gemini/commands/gofer/8_gofer_branding.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/9_gofer_tests.md +553 -0
- package/resources/gofer/gemini/commands/gofer/9_gofer_tests.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_bootstrap_workspace.md +143 -0
- package/resources/gofer/gemini/commands/gofer/gofer_bootstrap_workspace.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_check_workspace.md +114 -0
- package/resources/gofer/gemini/commands/gofer/gofer_check_workspace.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_constitution.md +607 -0
- package/resources/gofer/gemini/commands/gofer/gofer_constitution.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_diagnose.md +109 -0
- package/resources/gofer/gemini/commands/gofer/gofer_diagnose.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_eai_first_run.md +392 -0
- package/resources/gofer/gemini/commands/gofer/gofer_eai_first_run.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_hydrate.md +556 -0
- package/resources/gofer/gemini/commands/gofer/gofer_hydrate.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_personality.md +39 -0
- package/resources/gofer/gemini/commands/gofer/gofer_personality.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_plan.md +35 -0
- package/resources/gofer/gemini/commands/gofer/gofer_plan.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_side.md +40 -0
- package/resources/gofer/gemini/commands/gofer/gofer_side.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_spec_summary.md +107 -0
- package/resources/gofer/gemini/commands/gofer/gofer_spec_summary.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_tdd.md +107 -0
- package/resources/gofer/gemini/commands/gofer/gofer_tdd.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_vocabulary.md +107 -0
- package/resources/gofer/gemini/commands/gofer/gofer_vocabulary.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/gofer_zoom_out.md +107 -0
- package/resources/gofer/gemini/commands/gofer/gofer_zoom_out.toml +2 -0
- package/resources/gofer/gemini/commands/gofer/manifest.json +32 -0
- package/resources/gofer/gemini/extension.json +16 -0
- package/resources/gofer/github-agents/gofer-business.agent.md +20 -0
- package/resources/gofer/github-agents/gofer-implement.agent.md +15 -0
- package/resources/gofer/github-agents/gofer-plan.agent.md +15 -0
- package/resources/gofer/github-agents/gofer-research.agent.md +15 -0
- package/resources/gofer/github-agents/gofer-validate.agent.md +10 -0
- package/resources/gofer/github-skills/eai-gofer/SKILL.md +56 -0
- package/resources/gofer/hook-scripts/agent-stop.mjs +655 -0
- package/resources/gofer/hook-scripts/log-stage-launch-time.mjs +77 -0
- package/resources/gofer/hook-scripts/post-tool-use.mjs +333 -0
- package/resources/gofer/hook-scripts/queued-input.mjs +188 -0
- package/resources/gofer/hook-scripts/session-lifecycle.mjs +93 -0
- package/resources/gofer/hook-scripts/user-prompt-submit.mjs +228 -0
- package/resources/gofer/instruction-templates/base/agents-base.md +37 -0
- package/resources/gofer/instruction-templates/base/claude-base.md +7 -0
- package/resources/gofer/instruction-templates/base/copilot-base.md +26 -0
- package/resources/gofer/instruction-templates/gofer/gofer-claude.md +5 -0
- package/resources/gofer/instruction-templates/gofer/gofer-copilot.md +9 -0
- package/resources/gofer/instruction-templates/languages/generic.md +7 -0
- package/resources/gofer/instruction-templates/languages/go.md +8 -0
- package/resources/gofer/instruction-templates/languages/java.md +8 -0
- package/resources/gofer/instruction-templates/languages/python.md +9 -0
- package/resources/gofer/instruction-templates/languages/rust.md +9 -0
- package/resources/gofer/instruction-templates/languages/typescript.md +19 -0
- package/resources/gofer/instruction-templates/workflow/principles.md +52 -0
- package/resources/gofer/memory/constitution.md +391 -0
- package/resources/gofer/memory/context-profiles.yaml +74 -0
- package/resources/gofer/memory/decisions/000-use-adr-for-decisions.md +67 -0
- package/resources/gofer/memory/decisions/001-di-framework.md +190 -0
- package/resources/gofer/memory/decisions/002-module-extraction.md +305 -0
- package/resources/gofer/memory/decisions/003-error-handling.md +368 -0
- package/resources/gofer/memory/decisions/004-cache-eviction.md +436 -0
- package/resources/gofer/memory/decisions/005-constants-management.md +520 -0
- package/resources/gofer/memory/decisions/README.md +129 -0
- package/resources/gofer/memory/diagrams/di-container.mmd +321 -0
- package/resources/gofer/memory/diagrams/extension-activation.mmd +184 -0
- package/resources/gofer/memory/diagrams/module-dependencies.mmd +264 -0
- package/resources/gofer/memory/gofer-model-policy.yaml +97 -0
- package/resources/gofer/memory/lessons.md +46 -0
- package/resources/gofer/node-scripts/canonical-descriptions.mjs +86 -0
- package/resources/gofer/node-scripts/check-version-alignment.mjs +131 -0
- package/resources/gofer/node-scripts/codex-doctor.mjs +425 -0
- package/resources/gofer/node-scripts/generate-commands.mjs +1366 -0
- package/resources/gofer/node-scripts/generate-issues.js +563 -0
- package/resources/gofer/node-scripts/gofer-closed-loop-audit.mjs +893 -0
- package/resources/gofer/node-scripts/gofer-loop-audit.mjs +541 -0
- package/resources/gofer/node-scripts/gofer-performance-report.mjs +306 -0
- package/resources/gofer/node-scripts/gofer-workspace-bootstrap.mjs +56 -0
- package/resources/gofer/node-scripts/gofer-workspace-check.mjs +56 -0
- package/resources/gofer/node-scripts/lib/ai-leverage-tagger.mjs +103 -0
- package/resources/gofer/node-scripts/lib/assemble-stakeholder-pack.mjs +114 -0
- package/resources/gofer/node-scripts/lib/marp-deck.mjs +87 -0
- package/resources/gofer/node-scripts/lib/mermaid-tabular-fallback.mjs +264 -0
- package/resources/gofer/node-scripts/lib/render-visual.mjs +54 -0
- package/resources/gofer/node-scripts/lib/validate-aliases.mjs +85 -0
- package/resources/gofer/node-scripts/lib/visual-counts.mjs +44 -0
- package/resources/gofer/node-scripts/lib/visual-pass-pipeline.mjs +134 -0
- package/resources/gofer/node-scripts/mermaid-export.mjs +72 -0
- package/resources/gofer/node-scripts/package-agent-plugin.mjs +940 -0
- package/resources/gofer/node-scripts/parse-stage-command.mjs +211 -0
- package/resources/gofer/node-scripts/schemas/.gitkeep +0 -0
- package/resources/gofer/node-scripts/schemas/stage-command.schema.json +72 -0
- package/resources/gofer/node-scripts/sync-extension-resources.mjs +110 -0
- package/resources/gofer/node-scripts/workspace-bootstrap-lib.mjs +1166 -0
- package/resources/gofer/powershell-scripts/install-optional-tools.ps1 +214 -0
- package/resources/gofer/references/platform/README.md +17 -0
- package/resources/gofer/references/platform/deployment-repo.md +9 -0
- package/resources/gofer/references/platform/eai-app-template.md +45 -0
- package/resources/gofer/references/platform/eai-config-driven-ui.md +156 -0
- package/resources/gofer/references/platform/eai-error-catalog.yaml +197 -0
- package/resources/gofer/references/platform/eai-repo-contract.md +134 -0
- package/resources/gofer/references/platform/eai-service-patterns.md +56 -0
- package/resources/gofer/references/platform/eai.md +85 -0
- package/resources/gofer/references/platform/vertical-template.md +49 -0
- package/resources/gofer/specify-commands/.gitkeep +0 -0
- package/resources/gofer/specify-commands/0_gofer_start.md +1299 -0
- package/resources/gofer/specify-commands/0a_problem_validation.md +405 -0
- package/resources/gofer/specify-commands/10_gofer_cloud.md +611 -0
- package/resources/gofer/specify-commands/1_gofer_research.md +1135 -0
- package/resources/gofer/specify-commands/2_gofer_specify.md +836 -0
- package/resources/gofer/specify-commands/3_gofer_plan.md +862 -0
- package/resources/gofer/specify-commands/4_gofer_tasks.md +724 -0
- package/resources/gofer/specify-commands/5_gofer_implement.md +900 -0
- package/resources/gofer/specify-commands/6_gofer_validate.md +2245 -0
- package/resources/gofer/specify-commands/7_gofer_save.md +399 -0
- package/resources/gofer/specify-commands/7a_stakeholder_comms.md +484 -0
- package/resources/gofer/specify-commands/8_gofer_branding.md +291 -0
- package/resources/gofer/specify-commands/9_gofer_tests.md +534 -0
- package/resources/gofer/specify-commands/gofer_bootstrap_workspace.md +159 -0
- package/resources/gofer/specify-commands/gofer_check_workspace.md +130 -0
- package/resources/gofer/specify-commands/gofer_constitution.md +588 -0
- package/resources/gofer/specify-commands/gofer_diagnose.md +89 -0
- package/resources/gofer/specify-commands/gofer_eai_first_run.md +392 -0
- package/resources/gofer/specify-commands/gofer_hydrate.md +537 -0
- package/resources/gofer/specify-commands/gofer_personality.md +61 -0
- package/resources/gofer/specify-commands/gofer_plan.md +51 -0
- package/resources/gofer/specify-commands/gofer_side.md +56 -0
- package/resources/gofer/specify-commands/gofer_spec_summary.md +87 -0
- package/resources/gofer/specify-commands/gofer_tdd.md +87 -0
- package/resources/gofer/specify-commands/gofer_vocabulary.md +87 -0
- package/resources/gofer/specify-commands/gofer_zoom_out.md +87 -0
- package/resources/gofer/system-skills/0_gofer_start/SKILL.md +1287 -0
- package/resources/gofer/system-skills/0a_problem_validation/SKILL.md +429 -0
- package/resources/gofer/system-skills/10_gofer_cloud/SKILL.md +635 -0
- package/resources/gofer/system-skills/1_gofer_research/SKILL.md +1159 -0
- package/resources/gofer/system-skills/2_gofer_specify/SKILL.md +860 -0
- package/resources/gofer/system-skills/3_gofer_plan/SKILL.md +886 -0
- package/resources/gofer/system-skills/4_gofer_tasks/SKILL.md +748 -0
- package/resources/gofer/system-skills/5_gofer_implement/SKILL.md +924 -0
- package/resources/gofer/system-skills/6_gofer_validate/SKILL.md +2269 -0
- package/resources/gofer/system-skills/7_gofer_save/SKILL.md +423 -0
- package/resources/gofer/system-skills/7a_stakeholder_comms/SKILL.md +508 -0
- package/resources/gofer/system-skills/8_gofer_branding/SKILL.md +315 -0
- package/resources/gofer/system-skills/9_gofer_tests/SKILL.md +558 -0
- package/resources/gofer/system-skills/gofer_bootstrap_workspace/SKILL.md +148 -0
- package/resources/gofer/system-skills/gofer_check_workspace/SKILL.md +119 -0
- package/resources/gofer/system-skills/gofer_constitution/SKILL.md +612 -0
- package/resources/gofer/system-skills/gofer_diagnose/SKILL.md +114 -0
- package/resources/gofer/system-skills/gofer_eai_first_run/SKILL.md +397 -0
- package/resources/gofer/system-skills/gofer_hydrate/SKILL.md +561 -0
- package/resources/gofer/system-skills/gofer_personality/SKILL.md +44 -0
- package/resources/gofer/system-skills/gofer_plan/SKILL.md +40 -0
- package/resources/gofer/system-skills/gofer_side/SKILL.md +45 -0
- package/resources/gofer/system-skills/gofer_spec_summary/SKILL.md +112 -0
- package/resources/gofer/system-skills/gofer_tdd/SKILL.md +112 -0
- package/resources/gofer/system-skills/gofer_vocabulary/SKILL.md +112 -0
- package/resources/gofer/system-skills/gofer_zoom_out/SKILL.md +112 -0
- package/resources/gofer/templates/agent-file-template.md +28 -0
- package/resources/gofer/templates/assumptions-template.md +94 -0
- package/resources/gofer/templates/audit-history-template.md +35 -0
- package/resources/gofer/templates/brand/brand-profile-template.json +45 -0
- package/resources/gofer/templates/brand/document-style-template.md +50 -0
- package/resources/gofer/templates/brand/marp-theme-template.css +58 -0
- package/resources/gofer/templates/brownfield-analysis.md +44 -0
- package/resources/gofer/templates/business-metrics-template.md +120 -0
- package/resources/gofer/templates/business-owner-summary-template.md +83 -0
- package/resources/gofer/templates/checklist-template.md +40 -0
- package/resources/gofer/templates/ciso-security-summary-template.md +70 -0
- package/resources/gofer/templates/context-bundle-template.md +76 -0
- package/resources/gofer/templates/contract-pack-template.md +109 -0
- package/resources/gofer/templates/cto-architecture-summary-template.md +83 -0
- package/resources/gofer/templates/discovery-template.md +92 -0
- package/resources/gofer/templates/eai-preflight-template.md +144 -0
- package/resources/gofer/templates/goal-ledger-template.json +69 -0
- package/resources/gofer/templates/gofer-model-policy.yaml +97 -0
- package/resources/gofer/templates/issues-template.md +106 -0
- package/resources/gofer/templates/journey/base-journey.md +95 -0
- package/resources/gofer/templates/journey/industry-variants.yaml +277 -0
- package/resources/gofer/templates/loop-contract-template.json +68 -0
- package/resources/gofer/templates/plan-template.md +215 -0
- package/resources/gofer/templates/problem-brief-template.md +85 -0
- package/resources/gofer/templates/proposal-review-template.md +79 -0
- package/resources/gofer/templates/research-template.md +222 -0
- package/resources/gofer/templates/reuse-scan-template.md +43 -0
- package/resources/gofer/templates/sequence-diagrams/option-spectrum.yaml +178 -0
- package/resources/gofer/templates/service-fit-matrix-template.md +29 -0
- package/resources/gofer/templates/session-handoff-template.md +172 -0
- package/resources/gofer/templates/spec-summary-template.md +118 -0
- package/resources/gofer/templates/spec-template.md +196 -0
- package/resources/gofer/templates/stakeholder-comms-template.md +330 -0
- package/resources/gofer/templates/stakeholder-review-index-template.md +54 -0
- package/resources/gofer/templates/tasks-template.md +323 -0
- package/resources/gofer/templates/ui-approval-template.md +32 -0
- package/resources/gofer/templates/ui-preview-brief-template.md +65 -0
- package/resources/gofer/templates/ui-review-log-template.md +11 -0
- package/resources/gofer/templates/visuals/.gitkeep +0 -0
- package/resources/gofer/templates/visuals/bounded-context-map.md +19 -0
- package/resources/gofer/templates/visuals/bounded-context-template.md +47 -0
- package/resources/gofer/templates/visuals/c4-container-template.md +38 -0
- package/resources/gofer/templates/visuals/c4-container.md +20 -0
- package/resources/gofer/templates/visuals/c4-context-template.md +46 -0
- package/resources/gofer/templates/visuals/capability-heatmap-template.md +54 -0
- package/resources/gofer/templates/visuals/data-model-erd-template.md +41 -0
- package/resources/gofer/templates/visuals/erd.md +19 -0
- package/resources/gofer/templates/visuals/impact-canvas.md +40 -0
- package/resources/gofer/templates/visuals/risk-heatmap-template.md +51 -0
- package/resources/gofer/templates/visuals/roi-projection.md +17 -0
- package/resources/gofer/templates/visuals/value-stream-asis.md +16 -0
- package/resources/gofer/templates/visuals/value-stream-tobe.md +18 -0
- package/resources/gofer/templates/working-backwards-prfaq-template.md +165 -0
- package/resources/linked-sources.json +25 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
import inquirer from "inquirer";
|
|
2
|
+
import { findProjectRoot, loadEnvFile, patchEnvFile } from "./config.js";
|
|
3
|
+
import { getAccessToken, getActiveAuthConfigMismatch, loadTokens, storeTokens, } from "./auth.js";
|
|
4
|
+
import { PlatformAPIClient } from "./api.js";
|
|
5
|
+
import { isRecord } from "./utils.js";
|
|
6
|
+
import { getActiveProfile, loadProfileConfig } from "./profile.js";
|
|
7
|
+
export const DEFAULT_PUBLIC_API_URL = "https://api.au.myenterprise.ai/public";
|
|
8
|
+
const REGION_PUBLIC_API_URLS = {
|
|
9
|
+
au: DEFAULT_PUBLIC_API_URL,
|
|
10
|
+
ca: "https://api.ca.myenterprise.ai/public",
|
|
11
|
+
eu: "https://api.eu.myenterprise.ai/public",
|
|
12
|
+
};
|
|
13
|
+
const TRUSTED_SESSION_PUBLIC_API_HOSTS = new Set([
|
|
14
|
+
"api.au.myenterprise.ai",
|
|
15
|
+
"api.ca.myenterprise.ai",
|
|
16
|
+
"api.eu.myenterprise.ai",
|
|
17
|
+
]);
|
|
18
|
+
const LOOPBACK_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
19
|
+
const TENANT_MEMBERSHIP_AUTH_MESSAGE = "Authentication is missing or expired. Run `eai login` to refresh your session.";
|
|
20
|
+
export class TenantMembershipAuthError extends Error {
|
|
21
|
+
status;
|
|
22
|
+
constructor(status) {
|
|
23
|
+
super(TENANT_MEMBERSHIP_AUTH_MESSAGE);
|
|
24
|
+
this.name = "TenantMembershipAuthError";
|
|
25
|
+
this.status = status;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function normalizeBaseUrl(value) {
|
|
29
|
+
return value.trim().replace(/\/+$/g, "");
|
|
30
|
+
}
|
|
31
|
+
export function normalizeHomeRegion(value) {
|
|
32
|
+
const normalized = value?.trim().toLowerCase();
|
|
33
|
+
return normalized === "au" || normalized === "ca" || normalized === "eu"
|
|
34
|
+
? normalized
|
|
35
|
+
: null;
|
|
36
|
+
}
|
|
37
|
+
export function publicApiUrlForHomeRegion(value) {
|
|
38
|
+
const region = normalizeHomeRegion(value);
|
|
39
|
+
return region ? REGION_PUBLIC_API_URLS[region] : null;
|
|
40
|
+
}
|
|
41
|
+
export async function syncProjectPublicApiUrlForTenant(tenant, projectRoot) {
|
|
42
|
+
const homeRegion = normalizeHomeRegion(tenant.homeRegion);
|
|
43
|
+
if (!homeRegion) {
|
|
44
|
+
return {
|
|
45
|
+
status: "skipped",
|
|
46
|
+
reason: "unresolved-home-region",
|
|
47
|
+
homeRegion: tenant.homeRegion,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const root = projectRoot ?? (await findProjectRoot());
|
|
51
|
+
if (!root) {
|
|
52
|
+
return { status: "skipped", reason: "no-project-root", homeRegion };
|
|
53
|
+
}
|
|
54
|
+
const publicApiUrl = REGION_PUBLIC_API_URLS[homeRegion];
|
|
55
|
+
const env = await loadEnvFile(root);
|
|
56
|
+
const previousPublicApiUrl = env.BASE_URL_PUBLIC_API?.trim();
|
|
57
|
+
if (previousPublicApiUrl === publicApiUrl) {
|
|
58
|
+
return {
|
|
59
|
+
status: "already-current",
|
|
60
|
+
projectRoot: root,
|
|
61
|
+
publicApiUrl,
|
|
62
|
+
homeRegion,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
await patchEnvFile(root, { BASE_URL_PUBLIC_API: publicApiUrl });
|
|
66
|
+
return {
|
|
67
|
+
status: "updated",
|
|
68
|
+
projectRoot: root,
|
|
69
|
+
publicApiUrl,
|
|
70
|
+
previousPublicApiUrl: previousPublicApiUrl || undefined,
|
|
71
|
+
homeRegion,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function buildPublicApiEnvSyncNotice(result) {
|
|
75
|
+
if (!result)
|
|
76
|
+
return null;
|
|
77
|
+
if (result.status === "skipped" &&
|
|
78
|
+
result.reason === "unresolved-home-region") {
|
|
79
|
+
return {
|
|
80
|
+
level: "warn",
|
|
81
|
+
message: "Active tenant homeRegion is missing; regional PublicAPI routing may fall back. " +
|
|
82
|
+
"Ask a tenant or platform admin to repair tenant metadata before provisioning resources.",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (result.status !== "updated")
|
|
86
|
+
return null;
|
|
87
|
+
const target = `BASE_URL_PUBLIC_API=${result.publicApiUrl}`;
|
|
88
|
+
if (result.previousPublicApiUrl) {
|
|
89
|
+
return {
|
|
90
|
+
level: "warn",
|
|
91
|
+
message: `.env.local ${target} for active tenant homeRegion ${result.homeRegion} ` +
|
|
92
|
+
`(was ${result.previousPublicApiUrl}).`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
level: "success",
|
|
97
|
+
message: `.env.local ${target} for active tenant homeRegion ${result.homeRegion}.`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function normalizeCliPublicApiUrl(value) {
|
|
101
|
+
if (typeof value !== "string" || !value.trim())
|
|
102
|
+
return null;
|
|
103
|
+
try {
|
|
104
|
+
const url = new URL(value.trim());
|
|
105
|
+
const pathWithoutTrailingSlash = url.pathname.replace(/\/+$/g, "");
|
|
106
|
+
if (!pathWithoutTrailingSlash &&
|
|
107
|
+
/\.myenterprise\.ai$/i.test(url.hostname)) {
|
|
108
|
+
url.pathname = "/public";
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
url.pathname = pathWithoutTrailingSlash;
|
|
112
|
+
}
|
|
113
|
+
return url.toString().replace(/\/+$/g, "");
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return normalizeBaseUrl(value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function isLoopbackHost(hostname) {
|
|
120
|
+
return LOOPBACK_HOSTS.has(hostname.toLowerCase());
|
|
121
|
+
}
|
|
122
|
+
function normalizeTrustedSessionPublicApiUrl(value) {
|
|
123
|
+
const normalized = normalizeCliPublicApiUrl(value);
|
|
124
|
+
if (!normalized)
|
|
125
|
+
return null;
|
|
126
|
+
try {
|
|
127
|
+
const url = new URL(normalized);
|
|
128
|
+
const hostname = url.hostname.toLowerCase();
|
|
129
|
+
const isLoopback = isLoopbackHost(hostname);
|
|
130
|
+
if (url.username || url.password)
|
|
131
|
+
return null;
|
|
132
|
+
if (url.protocol !== "https:" &&
|
|
133
|
+
!(url.protocol === "http:" && isLoopback)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
if (!isLoopback && !TRUSTED_SESSION_PUBLIC_API_HOSTS.has(hostname)) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return normalizeCliPublicApiUrl(url.toString());
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function buildSessionResolveUrl(baseUrl) {
|
|
146
|
+
return `${normalizeBaseUrl(baseUrl)}/v4/identity/session/resolve`;
|
|
147
|
+
}
|
|
148
|
+
async function resolveRegionalPublicApiUrlFromSession(requestedTenantId) {
|
|
149
|
+
const accessToken = await getAccessToken();
|
|
150
|
+
if (!accessToken)
|
|
151
|
+
return null;
|
|
152
|
+
const bootstrapBaseUrl = process.env.ROUTING_BOOTSTRAP_PUBLIC_API_URL?.trim() ||
|
|
153
|
+
DEFAULT_PUBLIC_API_URL;
|
|
154
|
+
try {
|
|
155
|
+
const response = await fetch(buildSessionResolveUrl(bootstrapBaseUrl), {
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers: {
|
|
158
|
+
Authorization: `Bearer ${accessToken}`,
|
|
159
|
+
"Content-Type": "application/json",
|
|
160
|
+
},
|
|
161
|
+
body: JSON.stringify({
|
|
162
|
+
product: "eai-cli",
|
|
163
|
+
requestedTenantId: requestedTenantId || undefined,
|
|
164
|
+
}),
|
|
165
|
+
});
|
|
166
|
+
if (!response.ok)
|
|
167
|
+
return null;
|
|
168
|
+
const payload = (await response.json());
|
|
169
|
+
if (payload.status !== "resolved")
|
|
170
|
+
return null;
|
|
171
|
+
return normalizeTrustedSessionPublicApiUrl(payload.apiBaseUrl);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function resolveRegionalPublicApiUrlFromTenantManagement(tokens) {
|
|
178
|
+
if (!tokens?.activeTenantId)
|
|
179
|
+
return null;
|
|
180
|
+
const bootstrapBaseUrl = process.env.ROUTING_BOOTSTRAP_PUBLIC_API_URL?.trim() ||
|
|
181
|
+
DEFAULT_PUBLIC_API_URL;
|
|
182
|
+
try {
|
|
183
|
+
const client = new PlatformAPIClient(normalizeBaseUrl(bootstrapBaseUrl), tokens.activeTenantId);
|
|
184
|
+
const response = await client.getTenant(tokens.activeTenantId);
|
|
185
|
+
if (!response.ok)
|
|
186
|
+
return null;
|
|
187
|
+
const detail = tenantManagementDetailRecord(await response.json());
|
|
188
|
+
if (!detail)
|
|
189
|
+
return null;
|
|
190
|
+
const homeRegion = optionalStringOrNull(detail.homeRegion);
|
|
191
|
+
const regionalUrl = publicApiUrlForHomeRegion(homeRegion);
|
|
192
|
+
if (!regionalUrl)
|
|
193
|
+
return null;
|
|
194
|
+
const hqCountryCode = optionalStringOrNull(detail.hqCountryCode);
|
|
195
|
+
await storeTokens({
|
|
196
|
+
...tokens,
|
|
197
|
+
activeTenantHomeRegion: homeRegion,
|
|
198
|
+
activeTenantHqCountryCode: hqCountryCode === undefined
|
|
199
|
+
? tokens.activeTenantHqCountryCode
|
|
200
|
+
: hqCountryCode,
|
|
201
|
+
});
|
|
202
|
+
return regionalUrl;
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function unique(values) {
|
|
209
|
+
return Array.from(new Set(values.filter((value) => Boolean(value))));
|
|
210
|
+
}
|
|
211
|
+
async function readTenantManagementRecord(client, tenantId) {
|
|
212
|
+
const response = await client.getTenant(tenantId);
|
|
213
|
+
if (!response.ok) {
|
|
214
|
+
const body = await response.text().catch(() => "");
|
|
215
|
+
throw new Error(`Tenant ${tenantId} could not be resolved (${response.status}). ${body}`.trim());
|
|
216
|
+
}
|
|
217
|
+
const payload = await response.json();
|
|
218
|
+
if (!isRecord(payload)) {
|
|
219
|
+
throw new Error(`Tenant ${tenantId} returned an invalid response.`);
|
|
220
|
+
}
|
|
221
|
+
return payload;
|
|
222
|
+
}
|
|
223
|
+
export async function resolveMainCompanyTenantId(publicApiUrl, tenantId) {
|
|
224
|
+
const client = new PlatformAPIClient(publicApiUrl, tenantId);
|
|
225
|
+
await readTenantManagementRecord(client, tenantId);
|
|
226
|
+
return tenantId;
|
|
227
|
+
}
|
|
228
|
+
export function getTenantRoles(entry) {
|
|
229
|
+
return unique([
|
|
230
|
+
...(entry.roles ?? []),
|
|
231
|
+
entry.role,
|
|
232
|
+
...(entry.roleAssignments ?? []).map((assignment) => assignment.baseRole),
|
|
233
|
+
entry.isTenantAdmin ? "tenant-admin" : undefined,
|
|
234
|
+
]);
|
|
235
|
+
}
|
|
236
|
+
export function tenantEntryHasTenantAdminRole(entry) {
|
|
237
|
+
return getTenantRoles(entry).includes("tenant-admin");
|
|
238
|
+
}
|
|
239
|
+
export function filterTenantAdminEntries(entries) {
|
|
240
|
+
return entries.filter((entry) => entry.tenant?.isActive !== false && tenantEntryHasTenantAdminRole(entry));
|
|
241
|
+
}
|
|
242
|
+
function isAdminTenantMembership(value) {
|
|
243
|
+
return (isRecord(value) &&
|
|
244
|
+
typeof value.id === "string" &&
|
|
245
|
+
typeof value.displayName === "string" &&
|
|
246
|
+
typeof value.slug === "string");
|
|
247
|
+
}
|
|
248
|
+
function toTenantEntry(value) {
|
|
249
|
+
if ("tenant" in value) {
|
|
250
|
+
return value;
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
tenant: {
|
|
254
|
+
id: value.id,
|
|
255
|
+
displayName: value.displayName,
|
|
256
|
+
slug: value.slug,
|
|
257
|
+
domain: value.domain,
|
|
258
|
+
isActive: value.isActive !== false,
|
|
259
|
+
parent: value.parent,
|
|
260
|
+
parentId: value.parentId,
|
|
261
|
+
homeRegion: value.homeRegion,
|
|
262
|
+
hqCountryCode: value.hqCountryCode,
|
|
263
|
+
},
|
|
264
|
+
role: value.role,
|
|
265
|
+
roles: value.roles,
|
|
266
|
+
isTenantAdmin: value.isTenantAdmin,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
export function normalizeTenantEntries(payload) {
|
|
270
|
+
if (!isRecord(payload)) {
|
|
271
|
+
return [];
|
|
272
|
+
}
|
|
273
|
+
const record = payload;
|
|
274
|
+
const source = record.tenants ?? record.user?.tenants ?? [];
|
|
275
|
+
return source
|
|
276
|
+
.filter((entry) => isRecord(entry))
|
|
277
|
+
.map(toTenantEntry)
|
|
278
|
+
.filter((entry) => isAdminTenantMembership(entry.tenant) || isRecord(entry.tenant));
|
|
279
|
+
}
|
|
280
|
+
export function toTenantMembership(entry) {
|
|
281
|
+
return {
|
|
282
|
+
id: entry.tenant.id,
|
|
283
|
+
displayName: entry.tenant.displayName,
|
|
284
|
+
slug: entry.tenant.slug,
|
|
285
|
+
domain: entry.tenant.domain,
|
|
286
|
+
isActive: entry.tenant.isActive,
|
|
287
|
+
roles: getTenantRoles(entry),
|
|
288
|
+
homeRegion: entry.tenant.homeRegion,
|
|
289
|
+
hqCountryCode: entry.tenant.hqCountryCode,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
function optionalStringOrNull(value) {
|
|
293
|
+
if (typeof value === "string")
|
|
294
|
+
return value;
|
|
295
|
+
if (value === null)
|
|
296
|
+
return null;
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
function tenantManagementDetailRecord(payload) {
|
|
300
|
+
if (!isRecord(payload))
|
|
301
|
+
return null;
|
|
302
|
+
return isRecord(payload.tenant) ? payload.tenant : payload;
|
|
303
|
+
}
|
|
304
|
+
function mergeTenantManagementDetails(membership, payload) {
|
|
305
|
+
const detail = tenantManagementDetailRecord(payload);
|
|
306
|
+
if (!detail)
|
|
307
|
+
return membership;
|
|
308
|
+
const homeRegion = optionalStringOrNull(detail.homeRegion);
|
|
309
|
+
const hqCountryCode = optionalStringOrNull(detail.hqCountryCode);
|
|
310
|
+
return {
|
|
311
|
+
...membership,
|
|
312
|
+
homeRegion: homeRegion === undefined ? membership.homeRegion : homeRegion,
|
|
313
|
+
hqCountryCode: hqCountryCode === undefined ? membership.hqCountryCode : hqCountryCode,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
async function hydrateTenantMembershipManagementDetails(client, memberships) {
|
|
317
|
+
return Promise.all(memberships.map(async (membership) => {
|
|
318
|
+
if (membership.homeRegion && membership.hqCountryCode) {
|
|
319
|
+
return membership;
|
|
320
|
+
}
|
|
321
|
+
try {
|
|
322
|
+
const response = await client.getTenant(membership.id);
|
|
323
|
+
if (!response.ok) {
|
|
324
|
+
return membership;
|
|
325
|
+
}
|
|
326
|
+
return mergeTenantManagementDetails(membership, await response.json());
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
return membership;
|
|
330
|
+
}
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
export function findTenantMembership(memberships, tenantId) {
|
|
334
|
+
return memberships.find((membership) => membership.id === tenantId || membership.slug === tenantId);
|
|
335
|
+
}
|
|
336
|
+
export function evaluateTenantUsability(tenantId, memberships, options) {
|
|
337
|
+
const membership = findTenantMembership(memberships, tenantId);
|
|
338
|
+
const adminConfirmed = Boolean(membership?.roles.includes("tenant-admin"));
|
|
339
|
+
return {
|
|
340
|
+
tenantId,
|
|
341
|
+
created: options?.created ?? true,
|
|
342
|
+
bootstrapped: options?.bootstrapped ?? false,
|
|
343
|
+
membershipConfirmed: Boolean(membership),
|
|
344
|
+
adminConfirmed,
|
|
345
|
+
usable: Boolean(membership) && adminConfirmed,
|
|
346
|
+
autoSelected: options?.autoSelected ?? false,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Resolve the Public API URL for the CLI to call.
|
|
351
|
+
*
|
|
352
|
+
* Priority:
|
|
353
|
+
* 1. Profile config (non-default profiles only)
|
|
354
|
+
* 2. BASE_URL_PUBLIC_API from project .env.local or process env
|
|
355
|
+
* 3. Active tenant homeRegion from stored login context
|
|
356
|
+
* 4. Tenant management homeRegion from PublicAPI
|
|
357
|
+
* 5. PublicAPI session routing bootstrap for authenticated default profiles
|
|
358
|
+
* 6. DEFAULT_PUBLIC_API_URL fallback
|
|
359
|
+
*/
|
|
360
|
+
async function loadContextEnv(projectRoot) {
|
|
361
|
+
const root = projectRoot ?? (await findProjectRoot()) ?? undefined;
|
|
362
|
+
const envVars = root ? await loadEnvFile(root) : {};
|
|
363
|
+
return { ...envVars, ...process.env };
|
|
364
|
+
}
|
|
365
|
+
export async function resolvePublicApiUrl(projectRoot) {
|
|
366
|
+
// 1. Profile config (named profiles carry their own API URL)
|
|
367
|
+
const profile = getActiveProfile();
|
|
368
|
+
if (profile !== "default") {
|
|
369
|
+
const config = await loadProfileConfig(profile);
|
|
370
|
+
if (config?.publicApiUrl) {
|
|
371
|
+
return config.publicApiUrl;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// 2. Preserve the existing project-aware override path for default profile usage.
|
|
375
|
+
const env = await loadContextEnv(projectRoot);
|
|
376
|
+
if (env.BASE_URL_PUBLIC_API) {
|
|
377
|
+
return env.BASE_URL_PUBLIC_API;
|
|
378
|
+
}
|
|
379
|
+
const tokens = await loadTokens();
|
|
380
|
+
const storedRegionalUrl = publicApiUrlForHomeRegion(tokens?.activeTenantHomeRegion);
|
|
381
|
+
if (storedRegionalUrl) {
|
|
382
|
+
return storedRegionalUrl;
|
|
383
|
+
}
|
|
384
|
+
const tenantManagementRegionalUrl = await resolveRegionalPublicApiUrlFromTenantManagement(tokens);
|
|
385
|
+
if (tenantManagementRegionalUrl) {
|
|
386
|
+
return tenantManagementRegionalUrl;
|
|
387
|
+
}
|
|
388
|
+
const routedUrl = await resolveRegionalPublicApiUrlFromSession(tokens?.activeTenantId);
|
|
389
|
+
if (routedUrl) {
|
|
390
|
+
return routedUrl;
|
|
391
|
+
}
|
|
392
|
+
return DEFAULT_PUBLIC_API_URL;
|
|
393
|
+
}
|
|
394
|
+
export function getStoredActiveTenant(tokens) {
|
|
395
|
+
if (!tokens.activeTenantId || !tokens.activeTenantName) {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
return {
|
|
399
|
+
id: tokens.activeTenantId,
|
|
400
|
+
displayName: tokens.activeTenantName,
|
|
401
|
+
slug: tokens.activeTenantSlug || tokens.activeTenantName,
|
|
402
|
+
domain: tokens.activeTenantDomain,
|
|
403
|
+
isActive: true,
|
|
404
|
+
roles: ["tenant-admin"],
|
|
405
|
+
homeRegion: tokens.activeTenantHomeRegion,
|
|
406
|
+
hqCountryCode: tokens.activeTenantHqCountryCode,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
export async function fetchTenantAdminMemberships(publicApiUrl) {
|
|
410
|
+
const tokens = await loadTokens();
|
|
411
|
+
if (!tokens?.oid) {
|
|
412
|
+
throw new Error("Not logged in. Run `eai login` to authenticate.");
|
|
413
|
+
}
|
|
414
|
+
const authMismatch = await getActiveAuthConfigMismatch(tokens);
|
|
415
|
+
if (authMismatch) {
|
|
416
|
+
throw new Error(authMismatch);
|
|
417
|
+
}
|
|
418
|
+
const resolvedPublicApiUrl = publicApiUrl || (await resolvePublicApiUrl());
|
|
419
|
+
const accessToken = await getAccessToken();
|
|
420
|
+
if (!accessToken) {
|
|
421
|
+
throw new TenantMembershipAuthError(401);
|
|
422
|
+
}
|
|
423
|
+
const client = new PlatformAPIClient(resolvedPublicApiUrl, "system");
|
|
424
|
+
const response = await client.listCurrentUserTenants();
|
|
425
|
+
if (!response.ok) {
|
|
426
|
+
const body = await response.text();
|
|
427
|
+
if (response.status === 401) {
|
|
428
|
+
throw new TenantMembershipAuthError(response.status);
|
|
429
|
+
}
|
|
430
|
+
throw new Error(`Failed to load tenant memberships: ${response.status} ${response.statusText}${body ? ` — ${body}` : ""}`);
|
|
431
|
+
}
|
|
432
|
+
const payload = await response.json();
|
|
433
|
+
const memberships = await hydrateTenantMembershipManagementDetails(client, filterTenantAdminEntries(normalizeTenantEntries(payload)).map(toTenantMembership));
|
|
434
|
+
return {
|
|
435
|
+
publicApiUrl: resolvedPublicApiUrl,
|
|
436
|
+
tokens,
|
|
437
|
+
memberships,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
export async function saveActiveTenantSelection(tenant, publicApiUrl, existingTokens) {
|
|
441
|
+
const tokens = existingTokens ?? (await loadTokens());
|
|
442
|
+
if (!tokens) {
|
|
443
|
+
throw new Error("Not logged in. Run `eai login` to authenticate.");
|
|
444
|
+
}
|
|
445
|
+
const next = {
|
|
446
|
+
...tokens,
|
|
447
|
+
activeTenantId: tenant.id,
|
|
448
|
+
activeTenantName: tenant.displayName,
|
|
449
|
+
activeTenantSlug: tenant.slug,
|
|
450
|
+
activeTenantDomain: tenant.domain,
|
|
451
|
+
activeTenantHomeRegion: tenant.homeRegion,
|
|
452
|
+
activeTenantHqCountryCode: tenant.hqCountryCode,
|
|
453
|
+
publicApiUrl: publicApiUrl || tokens.publicApiUrl,
|
|
454
|
+
membershipsCachedAt: Date.now(),
|
|
455
|
+
};
|
|
456
|
+
await storeTokens(next);
|
|
457
|
+
return next;
|
|
458
|
+
}
|
|
459
|
+
export async function refreshTenantUsabilityStatus(tenantId, options) {
|
|
460
|
+
const fetched = await fetchTenantAdminMemberships(options?.publicApiUrl);
|
|
461
|
+
const membership = findTenantMembership(fetched.memberships, tenantId);
|
|
462
|
+
let status = evaluateTenantUsability(tenantId, fetched.memberships, {
|
|
463
|
+
created: options?.created,
|
|
464
|
+
bootstrapped: options?.bootstrapped,
|
|
465
|
+
autoSelected: false,
|
|
466
|
+
});
|
|
467
|
+
let tokens = fetched.tokens;
|
|
468
|
+
if (options?.autoSelect && membership && status.usable) {
|
|
469
|
+
tokens = await saveActiveTenantSelection(membership, fetched.publicApiUrl);
|
|
470
|
+
await syncProjectPublicApiUrlForTenant(membership);
|
|
471
|
+
status = {
|
|
472
|
+
...status,
|
|
473
|
+
autoSelected: true,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
publicApiUrl: fetched.publicApiUrl,
|
|
478
|
+
tokens,
|
|
479
|
+
memberships: fetched.memberships,
|
|
480
|
+
membership,
|
|
481
|
+
status,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
async function promptForTenantSelection(memberships) {
|
|
485
|
+
const { tenantId } = await inquirer.prompt([
|
|
486
|
+
{
|
|
487
|
+
type: "select",
|
|
488
|
+
name: "tenantId",
|
|
489
|
+
message: "Select the tenant to work with now",
|
|
490
|
+
choices: memberships.map((tenant) => ({
|
|
491
|
+
name: `${tenant.displayName} (${tenant.slug})${tenant.domain ? ` — ${tenant.domain}` : ""}`,
|
|
492
|
+
value: tenant.id,
|
|
493
|
+
})),
|
|
494
|
+
},
|
|
495
|
+
]);
|
|
496
|
+
const selected = memberships.find((tenant) => tenant.id === tenantId);
|
|
497
|
+
if (!selected) {
|
|
498
|
+
throw new Error("Selected tenant was not found.");
|
|
499
|
+
}
|
|
500
|
+
return selected;
|
|
501
|
+
}
|
|
502
|
+
const MEMBERSHIP_CACHE_TTL_MS = 15 * 60_000;
|
|
503
|
+
export async function resolveActiveTenantContext(options) {
|
|
504
|
+
const authMismatch = await getActiveAuthConfigMismatch(undefined, options?.projectRoot);
|
|
505
|
+
if (authMismatch) {
|
|
506
|
+
throw new Error(authMismatch);
|
|
507
|
+
}
|
|
508
|
+
// Short-circuit: if tenant context is cached and TTL is valid, skip Admin API call
|
|
509
|
+
if (!options?.forceRefresh && !options?.forcePrompt && !options?.tenantId) {
|
|
510
|
+
const cached = await loadTokens();
|
|
511
|
+
if (cached?.activeTenantId &&
|
|
512
|
+
cached.activeTenantName &&
|
|
513
|
+
cached.membershipsCachedAt &&
|
|
514
|
+
Date.now() - cached.membershipsCachedAt < MEMBERSHIP_CACHE_TTL_MS) {
|
|
515
|
+
const activeTenant = {
|
|
516
|
+
id: cached.activeTenantId,
|
|
517
|
+
displayName: cached.activeTenantName,
|
|
518
|
+
slug: cached.activeTenantSlug || cached.activeTenantName,
|
|
519
|
+
domain: cached.activeTenantDomain,
|
|
520
|
+
isActive: true,
|
|
521
|
+
roles: ["tenant-admin"],
|
|
522
|
+
homeRegion: cached.activeTenantHomeRegion,
|
|
523
|
+
hqCountryCode: cached.activeTenantHqCountryCode,
|
|
524
|
+
};
|
|
525
|
+
const publicApiUrl = options?.publicApiUrl ||
|
|
526
|
+
(await resolvePublicApiUrl(options?.projectRoot));
|
|
527
|
+
return {
|
|
528
|
+
publicApiUrl,
|
|
529
|
+
tokens: cached,
|
|
530
|
+
activeTenant,
|
|
531
|
+
memberships: [activeTenant],
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
const fetched = await fetchTenantAdminMemberships(options?.publicApiUrl || (await resolvePublicApiUrl(options?.projectRoot)));
|
|
536
|
+
const { tokens, memberships } = fetched;
|
|
537
|
+
if (memberships.length === 0) {
|
|
538
|
+
throw new Error("No active tenant-admin memberships found for the current login. Run `eai tenant list` to inspect your access.");
|
|
539
|
+
}
|
|
540
|
+
let selected;
|
|
541
|
+
if (options?.tenantId) {
|
|
542
|
+
selected = memberships.find((tenant) => tenant.id === options.tenantId || tenant.slug === options.tenantId);
|
|
543
|
+
if (!selected) {
|
|
544
|
+
throw new Error(`Tenant "${options.tenantId}" is not available in your active tenant-admin memberships.`);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
else if (!options?.forcePrompt && tokens.activeTenantId) {
|
|
548
|
+
selected = memberships.find((tenant) => tenant.id === tokens.activeTenantId);
|
|
549
|
+
}
|
|
550
|
+
if (!selected) {
|
|
551
|
+
if (memberships.length === 1) {
|
|
552
|
+
selected = memberships[0];
|
|
553
|
+
}
|
|
554
|
+
else if (options?.interactive === false ||
|
|
555
|
+
!process.stdin.isTTY ||
|
|
556
|
+
!process.stdout.isTTY) {
|
|
557
|
+
throw new Error("Multiple active tenant-admin memberships found. Run `eai tenant select` to choose one.");
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
selected = await promptForTenantSelection(memberships);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const updatedTokens = await saveActiveTenantSelection(selected, fetched.publicApiUrl, tokens);
|
|
564
|
+
const publicApiEnvSync = await syncProjectPublicApiUrlForTenant(selected, options?.projectRoot);
|
|
565
|
+
return {
|
|
566
|
+
publicApiUrl: fetched.publicApiUrl,
|
|
567
|
+
tokens: updatedTokens,
|
|
568
|
+
activeTenant: selected,
|
|
569
|
+
memberships,
|
|
570
|
+
publicApiEnvSync,
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
//# sourceMappingURL=tenant-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-context.js","sourceRoot":"","sources":["../../src/lib/tenant-context.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,UAAU,EACV,WAAW,GAEZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EA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AAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,MAAM,wBAAwB,CAAC,WAAW,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,yBAAyB,CACnD,QAAQ,EACR,OAAO,CAAC,YAAY,EACpB,MAAM,CACP,CAAC;IACF,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAC7D,QAAQ,EACR,OAAO,EAAE,WAAW,CACrB,CAAC;IACF,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,QAAQ;QACtB,WAAW;QACX,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update check — non-blocking background version check with 24h cache.
|
|
3
|
+
*
|
|
4
|
+
* Skipped entirely in CI, when NO_UPDATE_NOTIFIER=1, or non-TTY output.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STATIC_REGISTRY_URL = "https://eai-tools.github.io/eai/registry/";
|
|
7
|
+
export declare const STATIC_PACKUMENT_URL = "https://eai-tools.github.io/eai/registry/@enterpriseai/cli";
|
|
8
|
+
export declare const NPMJS_REGISTRY_URL = "https://registry.npmjs.org/";
|
|
9
|
+
export declare const NPMJS_PACKUMENT_URL = "https://registry.npmjs.org/@enterpriseai%2fcli";
|
|
10
|
+
export type ReleaseChannel = 'npmjs' | 'static-registry';
|
|
11
|
+
export interface LatestRelease {
|
|
12
|
+
channel: ReleaseChannel;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateCache {
|
|
16
|
+
lastCheck: number;
|
|
17
|
+
latestVersion: string;
|
|
18
|
+
currentVersion: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateNoticeOptions {
|
|
21
|
+
readonly args?: readonly string[];
|
|
22
|
+
readonly runUpdate?: () => Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
export declare function isMachineReadableInvocation(args: readonly string[]): boolean;
|
|
25
|
+
export declare function shouldOfferInteractiveUpdatePrompt(args: readonly string[], env?: NodeJS.ProcessEnv, stdin?: Pick<NodeJS.ReadStream, 'isTTY'>, stderr?: Pick<NodeJS.WriteStream, 'isTTY'>): boolean;
|
|
26
|
+
/** Compare two semver strings (major.minor.patch). */
|
|
27
|
+
export declare function isNewerVersion(current: string, latest: string): boolean;
|
|
28
|
+
export declare function compareVersions(left: string, right: string): number;
|
|
29
|
+
export declare function selectNewestRelease(candidates: readonly LatestRelease[]): LatestRelease | null;
|
|
30
|
+
/** Fetch the newest release from the public npm registry, falling back to the static EAI registry. */
|
|
31
|
+
export declare function fetchLatestRelease(timeoutMs?: number): Promise<LatestRelease | null>;
|
|
32
|
+
/** Fetch the latest version from the available release channels. */
|
|
33
|
+
export declare function fetchLatestVersion(timeoutMs?: number): Promise<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Fire-and-forget background update check.
|
|
36
|
+
* Reads cache; skips if checked within 24h; otherwise fetches and caches.
|
|
37
|
+
*/
|
|
38
|
+
export declare function checkForUpdate(currentVersion: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Print update banner to stderr if a newer version is cached.
|
|
41
|
+
* Called after command execution so the banner appears last.
|
|
42
|
+
*/
|
|
43
|
+
export declare function notifyIfUpdateAvailable(currentVersion: string, options?: UpdateNoticeOptions): Promise<void>;
|
|
44
|
+
export declare function runCurrentCliUpdate(): Promise<boolean>;
|
|
45
|
+
export declare function printUpdateNotice(currentVersion: string, cache: UpdateCache | null, options?: UpdateNoticeOptions): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Discovery commands are where stale CLIs hurt most: a user or agent asks
|
|
48
|
+
* "what can this do?" and old binaries cannot list new commands. Do a bounded
|
|
49
|
+
* foreground refresh so root help and unknown commands can point at eai update.
|
|
50
|
+
*/
|
|
51
|
+
export declare function notifyIfUpdateAvailableForDiscovery(currentVersion: string): Promise<void>;
|
|
52
|
+
//# sourceMappingURL=update-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,eAAO,MAAM,mBAAmB,8CAA8C,CAAC;AAC/E,eAAO,MAAM,oBAAoB,+DAA4C,CAAC;AAC9E,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAChE,eAAO,MAAM,mBAAmB,mDAA6C,CAAC;AAK9E,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAyBD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAqB5E;AAED,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,KAAK,GAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAiB,EACvD,MAAM,GAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAkB,GACzD,OAAO,CAUT;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAQvE;AAED,wBAAg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