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
package/dist/lib/api.js
ADDED
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform API client for CLI — wraps PublicAPI calls with auth.
|
|
3
|
+
*
|
|
4
|
+
* Unlike the Platform SDK (which goes through the BFF proxy),
|
|
5
|
+
* the CLI calls PublicAPI directly with a Bearer token from browser-based
|
|
6
|
+
* authorization code flow with PKCE.
|
|
7
|
+
*/
|
|
8
|
+
import { getAccessToken } from './auth.js';
|
|
9
|
+
import { toObjectTypeSlug } from './utils.js';
|
|
10
|
+
const PUBLIC_AI_PATH = '/v4/ai';
|
|
11
|
+
const PUBLIC_DATA_DOCUMENTS_PATH = '/v4/data/documents';
|
|
12
|
+
const PUBLIC_DATA_RESOURCES_PATH = '/v4/data/resources';
|
|
13
|
+
const PUBLIC_GEO_PATH = '/v4/geo';
|
|
14
|
+
const PUBLIC_IDENTITY_PATH = '/v4/identity';
|
|
15
|
+
const PUBLIC_INTEGRATIONS_PATH = '/v4/integrations';
|
|
16
|
+
const PUBLIC_PLATFORM_PATH = '/v4/platform';
|
|
17
|
+
const PUBLIC_REALTIME_PATH = '/v4/realtime';
|
|
18
|
+
const PUBLIC_VERTICALS_DAISY_PATH = '/v4/verticals/daisy';
|
|
19
|
+
const PUBLIC_WEBHOOKS_PATH = '/v4/webhooks';
|
|
20
|
+
const PUBLIC_WORKFLOWS_PATH = '/v4/workflows';
|
|
21
|
+
const PUBLIC_API_V4_PATH_PREFIXES = [
|
|
22
|
+
PUBLIC_AI_PATH,
|
|
23
|
+
PUBLIC_DATA_DOCUMENTS_PATH,
|
|
24
|
+
PUBLIC_DATA_RESOURCES_PATH,
|
|
25
|
+
PUBLIC_GEO_PATH,
|
|
26
|
+
PUBLIC_IDENTITY_PATH,
|
|
27
|
+
PUBLIC_INTEGRATIONS_PATH,
|
|
28
|
+
PUBLIC_PLATFORM_PATH,
|
|
29
|
+
PUBLIC_REALTIME_PATH,
|
|
30
|
+
PUBLIC_VERTICALS_DAISY_PATH,
|
|
31
|
+
PUBLIC_WEBHOOKS_PATH,
|
|
32
|
+
PUBLIC_WORKFLOWS_PATH,
|
|
33
|
+
];
|
|
34
|
+
function formatApiRequestErrorMessage(options) {
|
|
35
|
+
return `${options.operation} failed`;
|
|
36
|
+
}
|
|
37
|
+
export class PlatformAPIRequestError extends Error {
|
|
38
|
+
operation;
|
|
39
|
+
status;
|
|
40
|
+
statusText;
|
|
41
|
+
serverMessage;
|
|
42
|
+
serverCode;
|
|
43
|
+
requestId;
|
|
44
|
+
rawBody;
|
|
45
|
+
constructor(options) {
|
|
46
|
+
super(formatApiRequestErrorMessage(options));
|
|
47
|
+
this.name = 'PlatformAPIRequestError';
|
|
48
|
+
this.operation = options.operation;
|
|
49
|
+
this.status = options.status;
|
|
50
|
+
this.statusText = options.statusText;
|
|
51
|
+
this.serverMessage = options.serverMessage;
|
|
52
|
+
this.serverCode = options.serverCode;
|
|
53
|
+
this.requestId = options.requestId;
|
|
54
|
+
this.rawBody = options.rawBody;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Best-effort extraction of server-provided diagnostic context from a failed
|
|
59
|
+
* Response. Tolerates non-JSON bodies and FastAPI/Pydantic error envelopes
|
|
60
|
+
* (``{detail: "..."}``, ``{detail: {message, code}}``, ``{errors: [...]}``).
|
|
61
|
+
*
|
|
62
|
+
* Always returns the raw text so ``--debug`` can show the full body, even
|
|
63
|
+
* when no message field could be parsed.
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* Coerce a server-provided error field to a string. Platform responses
|
|
67
|
+
* sometimes nest a structured object in message/error/detail/code despite the
|
|
68
|
+
* declared string shape; returning a non-string here previously crashed
|
|
69
|
+
* callers that assume a string (e.g. `.trim()`).
|
|
70
|
+
*/
|
|
71
|
+
function coerceServerMessage(value) {
|
|
72
|
+
if (typeof value === 'string') {
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
return JSON.stringify(value);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return String(value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function extractServerErrorContext(res) {
|
|
86
|
+
const requestId = res.headers.get('x-request-id') ?? res.headers.get('x-correlation-id') ?? undefined;
|
|
87
|
+
const rawBody = await res.text().catch(() => '');
|
|
88
|
+
if (!rawBody) {
|
|
89
|
+
return { requestId, rawBody: '' };
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const parsed = JSON.parse(rawBody);
|
|
93
|
+
let serverMessage;
|
|
94
|
+
let serverCode;
|
|
95
|
+
if (typeof parsed.detail === 'string') {
|
|
96
|
+
serverMessage = parsed.detail;
|
|
97
|
+
}
|
|
98
|
+
else if (parsed.detail && typeof parsed.detail === 'object') {
|
|
99
|
+
serverMessage = coerceServerMessage(parsed.detail.message ?? parsed.detail.error);
|
|
100
|
+
serverCode = coerceServerMessage(parsed.detail.code);
|
|
101
|
+
}
|
|
102
|
+
if (!serverMessage) {
|
|
103
|
+
serverMessage = coerceServerMessage(parsed.message ?? parsed.error);
|
|
104
|
+
}
|
|
105
|
+
if (!serverMessage && Array.isArray(parsed.errors) && parsed.errors[0]?.message) {
|
|
106
|
+
serverMessage = coerceServerMessage(parsed.errors[0].message);
|
|
107
|
+
serverCode = serverCode ?? coerceServerMessage(parsed.errors[0].code);
|
|
108
|
+
}
|
|
109
|
+
serverCode = serverCode ?? coerceServerMessage(parsed.code);
|
|
110
|
+
return { serverMessage, serverCode, requestId, rawBody };
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return { requestId, rawBody };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function buildPayloadEqualsParams(filters, extras) {
|
|
117
|
+
const params = { ...(extras || {}) };
|
|
118
|
+
for (const [field, value] of Object.entries(filters)) {
|
|
119
|
+
params[`where[${field}][equals]`] = value;
|
|
120
|
+
}
|
|
121
|
+
return params;
|
|
122
|
+
}
|
|
123
|
+
function appendParams(path, params) {
|
|
124
|
+
if (!params || Object.keys(params).length === 0) {
|
|
125
|
+
return path;
|
|
126
|
+
}
|
|
127
|
+
const searchParams = new URLSearchParams();
|
|
128
|
+
for (const [key, value] of Object.entries(params)) {
|
|
129
|
+
if (value === undefined || value === null) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (Array.isArray(value)) {
|
|
133
|
+
for (const item of value) {
|
|
134
|
+
if (item !== undefined && item !== null) {
|
|
135
|
+
searchParams.append(key, String(item));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
searchParams.set(key, String(value));
|
|
141
|
+
}
|
|
142
|
+
const qs = searchParams.toString();
|
|
143
|
+
return qs ? `${path}?${qs}` : path;
|
|
144
|
+
}
|
|
145
|
+
function normalizePublicApiV4Path(path) {
|
|
146
|
+
const trimmed = path.trim();
|
|
147
|
+
if (!trimmed) {
|
|
148
|
+
throw new Error('PublicAPI path is required.');
|
|
149
|
+
}
|
|
150
|
+
const normalized = trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
|
|
151
|
+
if (!normalized.startsWith('/v4/')) {
|
|
152
|
+
throw new Error('Only PublicAPI V4 paths are supported. Start the path with /v4/.');
|
|
153
|
+
}
|
|
154
|
+
const allowed = PUBLIC_API_V4_PATH_PREFIXES.some((prefix) => (normalized === prefix || normalized.startsWith(`${prefix}/`)));
|
|
155
|
+
if (!allowed) {
|
|
156
|
+
throw new Error(`Unsupported PublicAPI V4 path: ${normalized}`);
|
|
157
|
+
}
|
|
158
|
+
return normalized;
|
|
159
|
+
}
|
|
160
|
+
export async function parseApiError(response) {
|
|
161
|
+
const bodyText = await response.text();
|
|
162
|
+
if (!bodyText) {
|
|
163
|
+
return {
|
|
164
|
+
status: response.status,
|
|
165
|
+
message: response.statusText || `HTTP ${response.status}`,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
const body = JSON.parse(bodyText);
|
|
170
|
+
const detail = body.detail;
|
|
171
|
+
if (detail && typeof detail === 'object') {
|
|
172
|
+
return {
|
|
173
|
+
status: response.status,
|
|
174
|
+
code: detail.error,
|
|
175
|
+
message: detail.message || response.statusText || `HTTP ${response.status}`,
|
|
176
|
+
bodyText,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
status: response.status,
|
|
181
|
+
code: typeof body.error === 'string' ? body.error : undefined,
|
|
182
|
+
message: typeof body.message === 'string'
|
|
183
|
+
? body.message
|
|
184
|
+
: typeof detail === 'string'
|
|
185
|
+
? detail
|
|
186
|
+
: response.statusText || `HTTP ${response.status}`,
|
|
187
|
+
bodyText,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
return {
|
|
192
|
+
status: response.status,
|
|
193
|
+
message: bodyText,
|
|
194
|
+
bodyText,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function readStringField(body, camelKey, snakeKey) {
|
|
199
|
+
const value = body[camelKey] ?? body[snakeKey];
|
|
200
|
+
return typeof value === 'string' && value.trim() ? value : null;
|
|
201
|
+
}
|
|
202
|
+
function readWorkflowStatus(value) {
|
|
203
|
+
if (value === 'upgrade-required' || value === 'paid-upgrade-required') {
|
|
204
|
+
return 'paid_upgrade_required';
|
|
205
|
+
}
|
|
206
|
+
if (value === 'available'
|
|
207
|
+
|| value === 'not_ready'
|
|
208
|
+
|| value === 'blocked'
|
|
209
|
+
|| value === 'operator_required'
|
|
210
|
+
|| value === 'paid_upgrade_required'
|
|
211
|
+
|| value === 'rate_limited'
|
|
212
|
+
|| value === 'upgrade_required'
|
|
213
|
+
|| value === 'unsupported') {
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
return 'operator_required';
|
|
217
|
+
}
|
|
218
|
+
function parseRuntimeWorkflowStatus(body) {
|
|
219
|
+
return {
|
|
220
|
+
workflowKey: readStringField(body, 'workflowKey', 'workflow_key') ?? 'unknown',
|
|
221
|
+
tenantId: readStringField(body, 'tenantId', 'tenant_id'),
|
|
222
|
+
status: readWorkflowStatus(body.status),
|
|
223
|
+
reasonCode: readStringField(body, 'reasonCode', 'reason_code') ?? 'runtime_workflow_status_unknown',
|
|
224
|
+
reasonMessage: readStringField(body, 'reasonMessage', 'reason_message') ?? 'Runtime workflow status is unknown.',
|
|
225
|
+
runtimeWorkflowRef: readStringField(body, 'runtimeWorkflowRef', 'runtime_workflow_ref'),
|
|
226
|
+
nextAction: readStringField(body, 'nextAction', 'next_action'),
|
|
227
|
+
checkedAt: readStringField(body, 'checkedAt', 'checked_at'),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function parseRuntimeWorkflowRequest(body) {
|
|
231
|
+
return {
|
|
232
|
+
requestId: readStringField(body, 'requestId', 'request_id') ?? 'unknown',
|
|
233
|
+
workflowKey: readStringField(body, 'workflowKey', 'workflow_key') ?? 'unknown',
|
|
234
|
+
tenantId: readStringField(body, 'tenantId', 'tenant_id') ?? 'unknown',
|
|
235
|
+
status: readWorkflowStatus(body.status),
|
|
236
|
+
reasonCode: readStringField(body, 'reasonCode', 'reason_code') ?? 'runtime_workflow_requested',
|
|
237
|
+
reasonMessage: readStringField(body, 'reasonMessage', 'reason_message') ?? 'Runtime workflow request submitted.',
|
|
238
|
+
runtimeWorkflowRef: readStringField(body, 'runtimeWorkflowRef', 'runtime_workflow_ref'),
|
|
239
|
+
nextAction: readStringField(body, 'nextAction', 'next_action'),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function parseBuilderReadiness(body) {
|
|
243
|
+
const checks = Array.isArray(body.checks)
|
|
244
|
+
? body.checks.filter((check) => Boolean(check) && typeof check === 'object')
|
|
245
|
+
: [];
|
|
246
|
+
return {
|
|
247
|
+
tenantId: readStringField(body, 'tenantId', 'tenant_id') ?? 'unknown',
|
|
248
|
+
status: readWorkflowStatus(body.status),
|
|
249
|
+
checkedAt: readStringField(body, 'checkedAt', 'checked_at'),
|
|
250
|
+
checks: checks.map((check) => ({
|
|
251
|
+
key: readStringField(check, 'key', 'key') ?? 'unknown',
|
|
252
|
+
status: readWorkflowStatus(check.status),
|
|
253
|
+
reasonCode: readStringField(check, 'reasonCode', 'reason_code') ?? 'builder_check_unknown',
|
|
254
|
+
reasonMessage: readStringField(check, 'reasonMessage', 'reason_message') ?? 'Builder check did not return detail.',
|
|
255
|
+
nextAction: readStringField(check, 'nextAction', 'next_action'),
|
|
256
|
+
})),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
export class PlatformAPIClient {
|
|
260
|
+
baseUrl;
|
|
261
|
+
tenantId;
|
|
262
|
+
constructor(baseUrl, tenantId) {
|
|
263
|
+
this.baseUrl = baseUrl;
|
|
264
|
+
this.tenantId = tenantId;
|
|
265
|
+
}
|
|
266
|
+
async headers() {
|
|
267
|
+
const token = await getAccessToken();
|
|
268
|
+
const h = {
|
|
269
|
+
'Content-Type': 'application/json',
|
|
270
|
+
};
|
|
271
|
+
if (token) {
|
|
272
|
+
h['Authorization'] = `Bearer ${token}`;
|
|
273
|
+
}
|
|
274
|
+
if (this.tenantId && this.tenantId !== 'system') {
|
|
275
|
+
h['X-Tenant-Id'] = this.tenantId;
|
|
276
|
+
}
|
|
277
|
+
return h;
|
|
278
|
+
}
|
|
279
|
+
// --------------- V4 PublicAPI routing ---------------
|
|
280
|
+
async publicRequest(path, method = 'GET', body, params) {
|
|
281
|
+
return fetch(`${this.baseUrl}${appendParams(path, params)}`, {
|
|
282
|
+
method,
|
|
283
|
+
headers: await this.headers(),
|
|
284
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
async requestPublicApi(path, options) {
|
|
288
|
+
return this.publicRequest(normalizePublicApiV4Path(path), options?.method ?? 'GET', options?.body, options?.params);
|
|
289
|
+
}
|
|
290
|
+
// --------------- Resources ---------------
|
|
291
|
+
async listResources(objectType, options) {
|
|
292
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
293
|
+
const params = new URLSearchParams();
|
|
294
|
+
if (options?.page)
|
|
295
|
+
params.set('page', String(options.page));
|
|
296
|
+
if (options?.limit)
|
|
297
|
+
params.set('limit', String(options.limit));
|
|
298
|
+
if (options?.sort)
|
|
299
|
+
params.set('sort', options.sort);
|
|
300
|
+
if (options?.where)
|
|
301
|
+
params.set('where', JSON.stringify(options.where));
|
|
302
|
+
if (options?.cursor)
|
|
303
|
+
params.set('cursor', options.cursor);
|
|
304
|
+
const qs = params.toString();
|
|
305
|
+
const url = `${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}${qs ? `?${qs}` : ''}`;
|
|
306
|
+
return fetch(url, { headers: await this.headers() });
|
|
307
|
+
}
|
|
308
|
+
async streamResources(objectType, options) {
|
|
309
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
310
|
+
const params = new URLSearchParams();
|
|
311
|
+
if (options?.limit)
|
|
312
|
+
params.set('limit', String(options.limit));
|
|
313
|
+
if (options?.sort)
|
|
314
|
+
params.set('sort', options.sort);
|
|
315
|
+
if (options?.where)
|
|
316
|
+
params.set('where', JSON.stringify(options.where));
|
|
317
|
+
if (options?.cursor)
|
|
318
|
+
params.set('cursor', options.cursor);
|
|
319
|
+
const qs = params.toString();
|
|
320
|
+
const url = `${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/stream${qs ? `?${qs}` : ''}`;
|
|
321
|
+
return fetch(url, { headers: await this.headers() });
|
|
322
|
+
}
|
|
323
|
+
async getResource(objectType, id) {
|
|
324
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
325
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}`, { headers: await this.headers() });
|
|
326
|
+
}
|
|
327
|
+
async createResource(objectType, data) {
|
|
328
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
329
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}`, {
|
|
330
|
+
method: 'POST',
|
|
331
|
+
headers: await this.headers(),
|
|
332
|
+
body: JSON.stringify({ data }),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
async updateResource(objectType, id, data, version) {
|
|
336
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
337
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}`, {
|
|
338
|
+
method: 'PUT',
|
|
339
|
+
headers: await this.headers(),
|
|
340
|
+
body: JSON.stringify({ data, version }),
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
async deleteResource(objectType, id) {
|
|
344
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
345
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}`, {
|
|
346
|
+
method: 'DELETE',
|
|
347
|
+
headers: await this.headers(),
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
async batchCreateResources(objectType, items) {
|
|
351
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
352
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/batch/create`, {
|
|
353
|
+
method: 'POST',
|
|
354
|
+
headers: await this.headers(),
|
|
355
|
+
body: JSON.stringify({ items }),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
async batchUpdateResources(objectType, items) {
|
|
359
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
360
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/batch/update`, {
|
|
361
|
+
method: 'POST',
|
|
362
|
+
headers: await this.headers(),
|
|
363
|
+
body: JSON.stringify({ items }),
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
async batchDeleteResources(objectType, ids) {
|
|
367
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
368
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/batch/delete`, {
|
|
369
|
+
method: 'POST',
|
|
370
|
+
headers: await this.headers(),
|
|
371
|
+
body: JSON.stringify({ ids }),
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
async aggregateResources(objectType, request) {
|
|
375
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
376
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/aggregate`, {
|
|
377
|
+
method: 'POST',
|
|
378
|
+
headers: await this.headers(),
|
|
379
|
+
body: JSON.stringify(request),
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
async executeAction(objectType, id, action, params) {
|
|
383
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
384
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}/actions/${action}`, {
|
|
385
|
+
method: 'POST',
|
|
386
|
+
headers: await this.headers(),
|
|
387
|
+
body: JSON.stringify({ params: params || {} }),
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
async queryResources(query) {
|
|
391
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/query`, {
|
|
392
|
+
method: 'POST',
|
|
393
|
+
headers: await this.headers(),
|
|
394
|
+
body: JSON.stringify({
|
|
395
|
+
...query,
|
|
396
|
+
object_types: query.object_types.map(toObjectTypeSlug),
|
|
397
|
+
}),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
async getPublishedObjectTypes(options) {
|
|
401
|
+
const filters = {
|
|
402
|
+
tenant: this.tenantId,
|
|
403
|
+
};
|
|
404
|
+
if (options?.name) {
|
|
405
|
+
filters.name = options.name;
|
|
406
|
+
}
|
|
407
|
+
return this.publicRequest(`${PUBLIC_DATA_RESOURCES_PATH}/object-types`, 'GET', undefined, buildPayloadEqualsParams(filters, {
|
|
408
|
+
limit: Math.min(options?.limit ?? 100, 100),
|
|
409
|
+
sort: options?.sort ?? 'name',
|
|
410
|
+
}));
|
|
411
|
+
}
|
|
412
|
+
async createObjectType(data) {
|
|
413
|
+
return this.publicRequest(`${PUBLIC_DATA_RESOURCES_PATH}/object-types`, 'POST', data);
|
|
414
|
+
}
|
|
415
|
+
async updateObjectType(objectTypeId, data) {
|
|
416
|
+
return this.publicRequest(`${PUBLIC_DATA_RESOURCES_PATH}/object-types/${encodeURIComponent(objectTypeId)}`, 'PATCH', data);
|
|
417
|
+
}
|
|
418
|
+
async saveAppObjectTypeManifest(verticalKey, objectTypes) {
|
|
419
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(this.tenantId)}/apps/${encodeURIComponent(verticalKey)}/object-types/manifest`, 'PUT', { objectTypes });
|
|
420
|
+
}
|
|
421
|
+
async publishAppObjectTypes(verticalKey) {
|
|
422
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(this.tenantId)}/apps/${encodeURIComponent(verticalKey)}/object-types/publish`, 'POST');
|
|
423
|
+
}
|
|
424
|
+
async getSchema() {
|
|
425
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/schema/${this.tenantId}`, {
|
|
426
|
+
method: 'GET',
|
|
427
|
+
headers: await this.headers(),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
async getStorageStatus() {
|
|
431
|
+
return this.getResourceStorageStatus();
|
|
432
|
+
}
|
|
433
|
+
async getResourceStorageStatus() {
|
|
434
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/storage`, {
|
|
435
|
+
method: 'GET',
|
|
436
|
+
headers: await this.headers(),
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
async getStorageDoctor() {
|
|
440
|
+
return this.getResourceStorageDoctor();
|
|
441
|
+
}
|
|
442
|
+
async getResourceStorageDoctor() {
|
|
443
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/storage/doctor`, {
|
|
444
|
+
method: 'GET',
|
|
445
|
+
headers: await this.headers(),
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
async getResourceStorageSchemaStatus() {
|
|
449
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/storage/schema-status`, {
|
|
450
|
+
method: 'GET',
|
|
451
|
+
headers: await this.headers(),
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
async provisionStorage(options) {
|
|
455
|
+
const backend = options.backend === 'mongodb' ? 'documentdb' : options.backend;
|
|
456
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/storage/provision`, {
|
|
457
|
+
method: 'POST',
|
|
458
|
+
headers: await this.headers(),
|
|
459
|
+
body: JSON.stringify({
|
|
460
|
+
backend: backend || 'all',
|
|
461
|
+
dry_run: Boolean(options.dryRun),
|
|
462
|
+
rebuild_search: Boolean(options.rebuildSearch),
|
|
463
|
+
provisioning_mode: options.provisioningMode ?? 'dedicated-tenant-storage',
|
|
464
|
+
}),
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
async syncStorageSchema(options) {
|
|
468
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/storage/sync-schema`, {
|
|
469
|
+
method: 'POST',
|
|
470
|
+
headers: await this.headers(),
|
|
471
|
+
body: JSON.stringify({
|
|
472
|
+
backend: options?.backend,
|
|
473
|
+
dry_run: options?.dryRun ?? false,
|
|
474
|
+
objectTypes: options?.objectTypes,
|
|
475
|
+
}),
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
async searchResources(request) {
|
|
479
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/search`, {
|
|
480
|
+
method: 'POST',
|
|
481
|
+
headers: await this.headers(),
|
|
482
|
+
body: JSON.stringify({
|
|
483
|
+
query: request.query,
|
|
484
|
+
objectTypes: request.objectTypes?.map(toObjectTypeSlug),
|
|
485
|
+
mode: request.mode || 'hybrid',
|
|
486
|
+
limit: request.limit ?? 10,
|
|
487
|
+
includePayload: request.includePayload ?? true,
|
|
488
|
+
}),
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
async uploadResourceFile(objectType, id, propertyName, filePath) {
|
|
492
|
+
const { readFile } = await import('node:fs/promises');
|
|
493
|
+
const { basename } = await import('node:path');
|
|
494
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
495
|
+
const content = await readFile(filePath);
|
|
496
|
+
const token = await getAccessToken();
|
|
497
|
+
const h = {
|
|
498
|
+
'Content-Type': 'application/octet-stream',
|
|
499
|
+
};
|
|
500
|
+
if (token) {
|
|
501
|
+
h.Authorization = `Bearer ${token}`;
|
|
502
|
+
}
|
|
503
|
+
const filename = encodeURIComponent(basename(filePath));
|
|
504
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}/files/${propertyName}?filename=${filename}`, {
|
|
505
|
+
method: 'POST',
|
|
506
|
+
headers: h,
|
|
507
|
+
body: content,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
async downloadResourceFile(objectType, id, propertyName) {
|
|
511
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
512
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}/files/${propertyName}`, {
|
|
513
|
+
method: 'GET',
|
|
514
|
+
headers: await this.headers(),
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
async deleteResourceFile(objectType, id, propertyName) {
|
|
518
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
519
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}/files/${propertyName}`, {
|
|
520
|
+
method: 'DELETE',
|
|
521
|
+
headers: await this.headers(),
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
async getHistory(objectType, id) {
|
|
525
|
+
const normalizedObjectType = toObjectTypeSlug(objectType);
|
|
526
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_RESOURCES_PATH}/${this.tenantId}/${normalizedObjectType}/${id}/history`, { headers: await this.headers() });
|
|
527
|
+
}
|
|
528
|
+
// --------------- Chat ---------------
|
|
529
|
+
async sendChat(workflowId, stage, message, conversationId, params) {
|
|
530
|
+
return fetch(`${this.baseUrl}${PUBLIC_AI_PATH}/chat/${this.tenantId}/${workflowId}/${stage}`, {
|
|
531
|
+
method: 'POST',
|
|
532
|
+
headers: await this.headers(),
|
|
533
|
+
body: JSON.stringify({
|
|
534
|
+
message,
|
|
535
|
+
conversation_id: conversationId,
|
|
536
|
+
params: params || {},
|
|
537
|
+
}),
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
async streamChat(workflowId, stage, message, conversationId, params) {
|
|
541
|
+
return fetch(`${this.baseUrl}${PUBLIC_AI_PATH}/chat/stream/${this.tenantId}/${workflowId}/${stage}`, {
|
|
542
|
+
method: 'POST',
|
|
543
|
+
headers: await this.headers(),
|
|
544
|
+
body: JSON.stringify({
|
|
545
|
+
message,
|
|
546
|
+
conversation_id: conversationId,
|
|
547
|
+
params: params || {},
|
|
548
|
+
}),
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
// --------------- Builder / Workflows ---------------
|
|
552
|
+
async getBuilderReadiness(options) {
|
|
553
|
+
const params = new URLSearchParams();
|
|
554
|
+
params.set('tenant_id', options?.tenantId || this.tenantId);
|
|
555
|
+
for (const workflowKey of options?.workflowKeys || []) {
|
|
556
|
+
params.append('workflow_keys', workflowKey);
|
|
557
|
+
}
|
|
558
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_INTEGRATIONS_PATH}/builder/readiness?${params.toString()}`, {
|
|
559
|
+
method: 'GET',
|
|
560
|
+
headers: await this.headers(),
|
|
561
|
+
});
|
|
562
|
+
if (!response.ok) {
|
|
563
|
+
const context = await extractServerErrorContext(response);
|
|
564
|
+
throw new PlatformAPIRequestError({
|
|
565
|
+
operation: 'Builder readiness check',
|
|
566
|
+
status: response.status,
|
|
567
|
+
statusText: response.statusText,
|
|
568
|
+
...context,
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
return parseBuilderReadiness(await response.json());
|
|
572
|
+
}
|
|
573
|
+
async getRuntimeWorkflowStatus(workflowKey, tenantId = this.tenantId) {
|
|
574
|
+
const params = new URLSearchParams({ tenant_id: tenantId });
|
|
575
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_WORKFLOWS_PATH}/runtime/${encodeURIComponent(workflowKey)}/status?${params.toString()}`, {
|
|
576
|
+
method: 'GET',
|
|
577
|
+
headers: await this.headers(),
|
|
578
|
+
});
|
|
579
|
+
if (!response.ok) {
|
|
580
|
+
const context = await extractServerErrorContext(response);
|
|
581
|
+
throw new PlatformAPIRequestError({
|
|
582
|
+
operation: `Runtime workflow status (${workflowKey})`,
|
|
583
|
+
status: response.status,
|
|
584
|
+
statusText: response.statusText,
|
|
585
|
+
...context,
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
return parseRuntimeWorkflowStatus(await response.json());
|
|
589
|
+
}
|
|
590
|
+
async requestRuntimeWorkflow(request) {
|
|
591
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_WORKFLOWS_PATH}/runtime-requests`, {
|
|
592
|
+
method: 'POST',
|
|
593
|
+
headers: await this.headers(),
|
|
594
|
+
body: JSON.stringify({
|
|
595
|
+
tenant_id: request.tenantId || this.tenantId,
|
|
596
|
+
workflow_key: request.workflowKey,
|
|
597
|
+
display_name: request.displayName,
|
|
598
|
+
reason: request.reason,
|
|
599
|
+
}),
|
|
600
|
+
});
|
|
601
|
+
if (!response.ok) {
|
|
602
|
+
const context = await extractServerErrorContext(response);
|
|
603
|
+
throw new PlatformAPIRequestError({
|
|
604
|
+
operation: `Runtime workflow request (${request.workflowKey})`,
|
|
605
|
+
status: response.status,
|
|
606
|
+
statusText: response.statusText,
|
|
607
|
+
...context,
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
return parseRuntimeWorkflowRequest(await response.json());
|
|
611
|
+
}
|
|
612
|
+
// --------------- Documents ---------------
|
|
613
|
+
async uploadDocumentBatch(filePath, processingMode) {
|
|
614
|
+
const { readFile } = await import('node:fs/promises');
|
|
615
|
+
const { basename } = await import('node:path');
|
|
616
|
+
const content = await readFile(filePath);
|
|
617
|
+
const form = new FormData();
|
|
618
|
+
form.append('files', new Blob([content]), basename(filePath));
|
|
619
|
+
form.append('tenant_id', this.tenantId);
|
|
620
|
+
form.append('processing_mode', processingMode);
|
|
621
|
+
const token = await getAccessToken();
|
|
622
|
+
const h = {};
|
|
623
|
+
if (token)
|
|
624
|
+
h['Authorization'] = `Bearer ${token}`;
|
|
625
|
+
h['X-Tenant-Id'] = this.tenantId;
|
|
626
|
+
const endpoint = processingMode === 'classification'
|
|
627
|
+
? `${PUBLIC_DATA_DOCUMENTS_PATH}/classify`
|
|
628
|
+
: `${PUBLIC_DATA_DOCUMENTS_PATH}/upload`;
|
|
629
|
+
return fetch(`${this.baseUrl}${endpoint}`, {
|
|
630
|
+
method: 'POST',
|
|
631
|
+
headers: h,
|
|
632
|
+
body: form,
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
async uploadDocument(filePath) {
|
|
636
|
+
return this.uploadDocumentBatch(filePath, 'full');
|
|
637
|
+
}
|
|
638
|
+
async classifyDocument(filePath) {
|
|
639
|
+
return this.uploadDocumentBatch(filePath, 'classification');
|
|
640
|
+
}
|
|
641
|
+
async getDocumentRecord(documentId) {
|
|
642
|
+
return this.publicRequest(`${PUBLIC_DATA_DOCUMENTS_PATH}/records/${encodeURIComponent(documentId)}`, 'GET');
|
|
643
|
+
}
|
|
644
|
+
async indexDocument(documentId) {
|
|
645
|
+
const lookup = await this.getDocumentRecord(documentId);
|
|
646
|
+
if (!lookup.ok) {
|
|
647
|
+
return lookup;
|
|
648
|
+
}
|
|
649
|
+
const document = await lookup.json();
|
|
650
|
+
const storagePath = document.fileInfo?.dataLakeUrl;
|
|
651
|
+
if (!storagePath) {
|
|
652
|
+
return new Response(JSON.stringify({
|
|
653
|
+
error: 'MISSING_STORAGE_PATH',
|
|
654
|
+
message: 'The document does not have a dataLakeUrl/storage path and cannot be indexed.',
|
|
655
|
+
}), {
|
|
656
|
+
status: 400,
|
|
657
|
+
headers: { 'Content-Type': 'application/json' },
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
const tenantId = typeof document.tenant === 'string'
|
|
661
|
+
? document.tenant
|
|
662
|
+
: document.tenant?.id || this.tenantId;
|
|
663
|
+
const businessRequestId = typeof document.businessRequest === 'string'
|
|
664
|
+
? document.businessRequest
|
|
665
|
+
: document.businessRequest?.id;
|
|
666
|
+
return fetch(`${this.baseUrl}${PUBLIC_DATA_DOCUMENTS_PATH}/rag-index`, {
|
|
667
|
+
method: 'POST',
|
|
668
|
+
headers: await this.headers(),
|
|
669
|
+
body: JSON.stringify({
|
|
670
|
+
documentId: document.documentId || document.id || documentId,
|
|
671
|
+
storagePath,
|
|
672
|
+
tenantId,
|
|
673
|
+
businessRequestId,
|
|
674
|
+
title: document.title,
|
|
675
|
+
}),
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
// --------------- Tenants ---------------
|
|
679
|
+
async listTenants(parentId) {
|
|
680
|
+
const params = { limit: 100 };
|
|
681
|
+
if (parentId) {
|
|
682
|
+
params['where[parentTenant][equals]'] = parentId;
|
|
683
|
+
}
|
|
684
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants`, 'GET', undefined, params);
|
|
685
|
+
}
|
|
686
|
+
async getTenant(id) {
|
|
687
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(id)}/management`, 'GET');
|
|
688
|
+
}
|
|
689
|
+
async listTenantChildren(tenantId, options) {
|
|
690
|
+
const params = {};
|
|
691
|
+
if (options?.includeDescendants !== undefined) {
|
|
692
|
+
params.include_descendants = options.includeDescendants;
|
|
693
|
+
}
|
|
694
|
+
if (options?.limit !== undefined) {
|
|
695
|
+
params.limit = options.limit;
|
|
696
|
+
}
|
|
697
|
+
if (options?.offset !== undefined) {
|
|
698
|
+
params.offset = options.offset;
|
|
699
|
+
}
|
|
700
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/children`, 'GET', undefined, params);
|
|
701
|
+
}
|
|
702
|
+
async createTenantApp(parentTenantId, data) {
|
|
703
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(parentTenantId)}/apps`, 'POST', data);
|
|
704
|
+
}
|
|
705
|
+
async createAppProvisioningJob(verticalKey) {
|
|
706
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(this.tenantId)}/apps/${encodeURIComponent(verticalKey)}/provisioning-jobs`, 'POST');
|
|
707
|
+
}
|
|
708
|
+
async createTenant(data) {
|
|
709
|
+
if (data.parent) {
|
|
710
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(data.parent)}/children`, 'POST', {
|
|
711
|
+
displayName: data.name,
|
|
712
|
+
slug: data.slug,
|
|
713
|
+
usecase: data.usecase || 'generic',
|
|
714
|
+
...(data.homeRegion ? { homeRegion: data.homeRegion } : {}),
|
|
715
|
+
...(data.industry ? { industry: data.industry } : {}),
|
|
716
|
+
...(data.starterTemplate ? { starterTemplate: data.starterTemplate } : {}),
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants`, 'POST', {
|
|
720
|
+
displayName: data.name,
|
|
721
|
+
name: data.name,
|
|
722
|
+
slug: data.slug,
|
|
723
|
+
parentTenant: data.parent,
|
|
724
|
+
domain: data.domain,
|
|
725
|
+
usecase: data.usecase || 'generic',
|
|
726
|
+
...(data.homeRegion ? { homeRegion: data.homeRegion } : {}),
|
|
727
|
+
...(data.industry ? { industry: data.industry } : {}),
|
|
728
|
+
...(data.starterTemplate ? { starterTemplate: data.starterTemplate } : {}),
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
async deleteTenant(tenantId) {
|
|
732
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/delete`, 'POST');
|
|
733
|
+
}
|
|
734
|
+
async bootstrapChildTenantAdmin(parentTenantId, childTenantId, body) {
|
|
735
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(parentTenantId)}/children/${encodeURIComponent(childTenantId)}/bootstrap-admin`, 'POST', body);
|
|
736
|
+
}
|
|
737
|
+
async evaluateCapability(request) {
|
|
738
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_PLATFORM_PATH}/capabilities/evaluate`, {
|
|
739
|
+
method: 'POST',
|
|
740
|
+
headers: await this.headers(),
|
|
741
|
+
body: JSON.stringify({
|
|
742
|
+
tenant_id: request.tenantId,
|
|
743
|
+
target_capability: request.targetCapability,
|
|
744
|
+
requested_operation: request.requestedOperation || 'inspect',
|
|
745
|
+
}),
|
|
746
|
+
});
|
|
747
|
+
if (!response.ok) {
|
|
748
|
+
const context = await extractServerErrorContext(response);
|
|
749
|
+
throw new PlatformAPIRequestError({
|
|
750
|
+
operation: `POST ${PUBLIC_PLATFORM_PATH}/capabilities/evaluate (${request.targetCapability})`,
|
|
751
|
+
status: response.status,
|
|
752
|
+
statusText: response.statusText,
|
|
753
|
+
serverMessage: context.serverMessage,
|
|
754
|
+
serverCode: context.serverCode,
|
|
755
|
+
requestId: context.requestId,
|
|
756
|
+
rawBody: context.rawBody,
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
return await response.json();
|
|
760
|
+
}
|
|
761
|
+
// --------------- Users ---------------
|
|
762
|
+
async getUserMemberships(oid) {
|
|
763
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/users/${encodeURIComponent(oid)}/memberships`, 'GET');
|
|
764
|
+
}
|
|
765
|
+
async provisionMe() {
|
|
766
|
+
return fetch(`${this.baseUrl}${PUBLIC_IDENTITY_PATH}/me/provision`, {
|
|
767
|
+
method: 'POST',
|
|
768
|
+
headers: await this.headers(),
|
|
769
|
+
body: JSON.stringify({ tenant_id: this.tenantId }),
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
async lookupUserByEmail(email) {
|
|
773
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/users/by-email`, 'GET', undefined, { email });
|
|
774
|
+
}
|
|
775
|
+
async listCurrentUserTenants() {
|
|
776
|
+
return fetch(`${this.baseUrl}${PUBLIC_IDENTITY_PATH}/tenants`, {
|
|
777
|
+
method: 'GET',
|
|
778
|
+
headers: await this.headers(),
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
async provisionUserToTenant(tenantId, userOid) {
|
|
782
|
+
if (userOid) {
|
|
783
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/users/${encodeURIComponent(userOid)}/provision`, 'POST', { tenant_id: tenantId });
|
|
784
|
+
}
|
|
785
|
+
const body = { tenant_id: tenantId };
|
|
786
|
+
return fetch(`${this.baseUrl}${PUBLIC_IDENTITY_PATH}/me/provision`, {
|
|
787
|
+
method: 'POST',
|
|
788
|
+
headers: await this.headers(),
|
|
789
|
+
body: JSON.stringify(body),
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
async inviteTenantMember(tenantId, request) {
|
|
793
|
+
const body = {
|
|
794
|
+
email: request.email,
|
|
795
|
+
};
|
|
796
|
+
if (request.roleDefinitionId) {
|
|
797
|
+
body.roleDefinitionId = request.roleDefinitionId;
|
|
798
|
+
}
|
|
799
|
+
if (request.role || !request.roleDefinitionId) {
|
|
800
|
+
body.role = request.role || 'tenant-viewer';
|
|
801
|
+
}
|
|
802
|
+
if (request.firstName)
|
|
803
|
+
body.firstName = request.firstName;
|
|
804
|
+
if (request.lastName)
|
|
805
|
+
body.lastName = request.lastName;
|
|
806
|
+
if (request.message)
|
|
807
|
+
body.message = request.message;
|
|
808
|
+
if (request.redirectUri)
|
|
809
|
+
body.redirectUri = request.redirectUri;
|
|
810
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/members/invite`, 'POST', body);
|
|
811
|
+
}
|
|
812
|
+
async listTenantMembers(tenantId, options) {
|
|
813
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/members`, 'GET', undefined, {
|
|
814
|
+
page: options?.page,
|
|
815
|
+
limit: options?.limit,
|
|
816
|
+
sort: options?.sort,
|
|
817
|
+
search: options?.search,
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
async listTenantRoleDefinitions(tenantId) {
|
|
821
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/role-definitions`, 'GET');
|
|
822
|
+
}
|
|
823
|
+
async updateTenantMemberRole(tenantId, memberId, request) {
|
|
824
|
+
const body = {};
|
|
825
|
+
if (request.roleDefinitionId) {
|
|
826
|
+
body.roleDefinitionId = request.roleDefinitionId;
|
|
827
|
+
}
|
|
828
|
+
if (request.role || !request.roleDefinitionId) {
|
|
829
|
+
body.role = request.role || 'tenant-viewer';
|
|
830
|
+
}
|
|
831
|
+
return this.publicRequest(`${PUBLIC_PLATFORM_PATH}/tenants/${encodeURIComponent(tenantId)}/members/${encodeURIComponent(memberId)}/roles`, 'PATCH', body);
|
|
832
|
+
}
|
|
833
|
+
// --------------- Provisioning ---------------
|
|
834
|
+
async provisionEntraApp(request) {
|
|
835
|
+
const body = {
|
|
836
|
+
tenant_id: request.tenantId,
|
|
837
|
+
app_name: request.appName,
|
|
838
|
+
redirect_uris: request.redirectUris,
|
|
839
|
+
idempotent: request.idempotent ?? false,
|
|
840
|
+
};
|
|
841
|
+
const endpoint = `${PUBLIC_PLATFORM_PATH}/provisioning/entra-apps`;
|
|
842
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
843
|
+
const res = await fetch(url, {
|
|
844
|
+
method: 'POST',
|
|
845
|
+
headers: await this.headers(),
|
|
846
|
+
body: JSON.stringify(body),
|
|
847
|
+
});
|
|
848
|
+
if (!res.ok) {
|
|
849
|
+
const ctx = await extractServerErrorContext(res);
|
|
850
|
+
throw new PlatformAPIRequestError({
|
|
851
|
+
operation: 'Entra app provisioning',
|
|
852
|
+
status: res.status,
|
|
853
|
+
statusText: res.statusText,
|
|
854
|
+
...ctx,
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
const data = await res.json();
|
|
858
|
+
const clientId = data.clientId ?? data.client_id;
|
|
859
|
+
if (typeof clientId !== 'string' || clientId.trim() === '') {
|
|
860
|
+
throw new PlatformAPIRequestError({
|
|
861
|
+
operation: 'Entra app provisioning',
|
|
862
|
+
status: res.status,
|
|
863
|
+
statusText: 'Invalid provisioning response',
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
const toStringArray = (value) => Array.isArray(value) ? value.filter((v) => typeof v === 'string' && v.trim() !== '') : [];
|
|
867
|
+
return {
|
|
868
|
+
clientId,
|
|
869
|
+
clientSecret: data.clientSecret ?? data.client_secret ?? null,
|
|
870
|
+
existing: Boolean(data.existing),
|
|
871
|
+
scopes: toStringArray(data.scopes),
|
|
872
|
+
redirectUris: toStringArray(data.redirectUris ?? data.redirect_uris),
|
|
873
|
+
environment: typeof data.environment === 'string' ? data.environment : null,
|
|
874
|
+
tenantId: typeof (data.tenantId ?? data.tenant_id) === 'string'
|
|
875
|
+
? (data.tenantId ?? data.tenant_id)
|
|
876
|
+
: null,
|
|
877
|
+
tenantAuthorization: parseTenantAuthorization(data.tenantAuthorization ?? data.tenant_authorization),
|
|
878
|
+
signinCompleteness: parseSigninCompleteness(data.signinCompleteness ?? data.signin_completeness),
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
async rotateEntraAppSecret(request) {
|
|
882
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_PLATFORM_PATH}/provisioning/entra-apps/${encodeURIComponent(request.clientId)}/rotate-secret`, {
|
|
883
|
+
method: 'POST',
|
|
884
|
+
headers: await this.headers(),
|
|
885
|
+
body: JSON.stringify({ tenant_id: request.tenantId }),
|
|
886
|
+
});
|
|
887
|
+
if (!response.ok) {
|
|
888
|
+
const context = await extractServerErrorContext(response);
|
|
889
|
+
throw new PlatformAPIRequestError({
|
|
890
|
+
operation: 'Entra app secret rotation',
|
|
891
|
+
status: response.status,
|
|
892
|
+
statusText: response.statusText,
|
|
893
|
+
...context,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
const data = await response.json();
|
|
897
|
+
const clientId = readStringField(data, 'clientId', 'client_id');
|
|
898
|
+
const clientSecret = readStringField(data, 'clientSecret', 'client_secret');
|
|
899
|
+
if (!clientId || !clientSecret) {
|
|
900
|
+
throw new PlatformAPIRequestError({
|
|
901
|
+
operation: 'Entra app secret rotation',
|
|
902
|
+
status: response.status,
|
|
903
|
+
statusText: 'Invalid secret rotation response',
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
return {
|
|
907
|
+
clientId,
|
|
908
|
+
clientSecret,
|
|
909
|
+
tenantId: readStringField(data, 'tenantId', 'tenant_id') ?? request.tenantId,
|
|
910
|
+
expiresAt: readStringField(data, 'expiresAt', 'expires_at'),
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
async deprovisionEntraApp(request) {
|
|
914
|
+
const response = await fetch(`${this.baseUrl}${PUBLIC_PLATFORM_PATH}/provisioning/entra-apps/${encodeURIComponent(request.clientId)}`, {
|
|
915
|
+
method: 'DELETE',
|
|
916
|
+
headers: await this.headers(),
|
|
917
|
+
body: JSON.stringify({
|
|
918
|
+
tenant_id: request.tenantId,
|
|
919
|
+
delete_registration: request.deleteRegistration ?? true,
|
|
920
|
+
}),
|
|
921
|
+
});
|
|
922
|
+
if (!response.ok) {
|
|
923
|
+
const context = await extractServerErrorContext(response);
|
|
924
|
+
throw new PlatformAPIRequestError({
|
|
925
|
+
operation: 'Entra app deprovisioning',
|
|
926
|
+
status: response.status,
|
|
927
|
+
statusText: response.statusText,
|
|
928
|
+
...context,
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
const data = await response.json();
|
|
932
|
+
const clientId = readStringField(data, 'clientId', 'client_id');
|
|
933
|
+
const tenantId = readStringField(data, 'tenantId', 'tenant_id');
|
|
934
|
+
if (!clientId || !tenantId) {
|
|
935
|
+
throw new PlatformAPIRequestError({
|
|
936
|
+
operation: 'Entra app deprovisioning',
|
|
937
|
+
status: response.status,
|
|
938
|
+
statusText: 'Invalid deprovision response',
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
const tenantDeauthorizationRaw = (data.tenantDeauthorization ?? data.tenant_deauthorization);
|
|
942
|
+
return {
|
|
943
|
+
clientId,
|
|
944
|
+
tenantId,
|
|
945
|
+
tenantDeauthorization: {
|
|
946
|
+
removed: Boolean(tenantDeauthorizationRaw?.removed),
|
|
947
|
+
alreadyAbsent: Boolean(tenantDeauthorizationRaw?.alreadyAbsent ?? tenantDeauthorizationRaw?.already_absent),
|
|
948
|
+
},
|
|
949
|
+
appRegistrationFound: Boolean(data.appRegistrationFound ?? data.app_registration_found),
|
|
950
|
+
appRegistrationDeleted: Boolean(data.appRegistrationDeleted ?? data.app_registration_deleted),
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
function parseTenantAuthorization(value) {
|
|
955
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
956
|
+
return null;
|
|
957
|
+
}
|
|
958
|
+
const v = value;
|
|
959
|
+
const warning = v.warning;
|
|
960
|
+
return {
|
|
961
|
+
added: Boolean(v.added),
|
|
962
|
+
alreadyAuthorized: Boolean(v.already_authorized ?? v.alreadyAuthorized),
|
|
963
|
+
warning: typeof warning === 'string' && warning.trim() !== '' ? warning : null,
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
function parseSigninCompleteness(value) {
|
|
967
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
968
|
+
return null;
|
|
969
|
+
}
|
|
970
|
+
const v = value;
|
|
971
|
+
const warnings = Array.isArray(v.warnings)
|
|
972
|
+
? v.warnings.filter((w) => typeof w === 'string')
|
|
973
|
+
: [];
|
|
974
|
+
return {
|
|
975
|
+
graphPermsAdded: Boolean(v.graph_perms_added ?? v.graphPermsAdded),
|
|
976
|
+
publicapiPermsAdded: Boolean(v.publicapi_perms_added ?? v.publicapiPermsAdded),
|
|
977
|
+
consentGranted: Boolean(v.consent_granted ?? v.consentGranted),
|
|
978
|
+
publicapiPreauthorized: Boolean(v.publicapi_preauthorized ?? v.publicapiPreauthorized),
|
|
979
|
+
// Older AdminAPI deployments don't emit `signin_ready`; derive it from
|
|
980
|
+
// the four boolean steps so the CLI behaves identically once each step
|
|
981
|
+
// is observably True/False.
|
|
982
|
+
signinReady: typeof (v.signin_ready ?? v.signinReady) === 'boolean'
|
|
983
|
+
? Boolean(v.signin_ready ?? v.signinReady)
|
|
984
|
+
: Boolean(v.graph_perms_added ?? v.graphPermsAdded)
|
|
985
|
+
&& Boolean(v.publicapi_perms_added ?? v.publicapiPermsAdded)
|
|
986
|
+
&& Boolean(v.consent_granted ?? v.consentGranted)
|
|
987
|
+
&& Boolean(v.publicapi_preauthorized ?? v.publicapiPreauthorized),
|
|
988
|
+
warnings,
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
//# sourceMappingURL=api.js.map
|