squadfoundry 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +76 -0
- package/PROJECT.md +79 -0
- package/README.md +255 -0
- package/dist/orchestrator/adapters/context/IContextAdapter.d.ts +65 -0
- package/dist/orchestrator/adapters/context/IContextAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/context/IContextAdapter.js +12 -0
- package/dist/orchestrator/adapters/context/IContextAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/context/filesystem.context-adapter.d.ts +33 -0
- package/dist/orchestrator/adapters/context/filesystem.context-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/context/filesystem.context-adapter.js +179 -0
- package/dist/orchestrator/adapters/context/filesystem.context-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/deploy/IDeployAdapter.d.ts +78 -0
- package/dist/orchestrator/adapters/deploy/IDeployAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/deploy/IDeployAdapter.js +14 -0
- package/dist/orchestrator/adapters/deploy/IDeployAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/deploy/vercel.adapter.d.ts +31 -0
- package/dist/orchestrator/adapters/deploy/vercel.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/deploy/vercel.adapter.js +83 -0
- package/dist/orchestrator/adapters/deploy/vercel.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/IHostAdapter.d.ts +89 -0
- package/dist/orchestrator/adapters/host/IHostAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/IHostAdapter.js +10 -0
- package/dist/orchestrator/adapters/host/IHostAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/anthropic.adapter.d.ts +27 -0
- package/dist/orchestrator/adapters/host/anthropic.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/anthropic.adapter.js +118 -0
- package/dist/orchestrator/adapters/host/anthropic.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/antigravity.adapter.d.ts +53 -0
- package/dist/orchestrator/adapters/host/antigravity.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/antigravity.adapter.js +148 -0
- package/dist/orchestrator/adapters/host/antigravity.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/claude-code.adapter.d.ts +13 -0
- package/dist/orchestrator/adapters/host/claude-code.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/claude-code.adapter.js +27 -0
- package/dist/orchestrator/adapters/host/claude-code.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/command-model-invoker.d.ts +8 -0
- package/dist/orchestrator/adapters/host/command-model-invoker.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/command-model-invoker.js +46 -0
- package/dist/orchestrator/adapters/host/command-model-invoker.js.map +1 -0
- package/dist/orchestrator/adapters/host/ide.adapter.d.ts +61 -0
- package/dist/orchestrator/adapters/host/ide.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/ide.adapter.js +173 -0
- package/dist/orchestrator/adapters/host/ide.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/local.adapter.d.ts +26 -0
- package/dist/orchestrator/adapters/host/local.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/local.adapter.js +82 -0
- package/dist/orchestrator/adapters/host/local.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/openai.adapter.d.ts +26 -0
- package/dist/orchestrator/adapters/host/openai.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/openai.adapter.js +77 -0
- package/dist/orchestrator/adapters/host/openai.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/host/opencode.adapter.d.ts +13 -0
- package/dist/orchestrator/adapters/host/opencode.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/host/opencode.adapter.js +27 -0
- package/dist/orchestrator/adapters/host/opencode.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/model/IModelAdapter.d.ts +68 -0
- package/dist/orchestrator/adapters/model/IModelAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/model/IModelAdapter.js +11 -0
- package/dist/orchestrator/adapters/model/IModelAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.d.ts +93 -0
- package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.js +10 -0
- package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/publishing/instagram.adapter.d.ts +34 -0
- package/dist/orchestrator/adapters/publishing/instagram.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/publishing/instagram.adapter.js +105 -0
- package/dist/orchestrator/adapters/publishing/instagram.adapter.js.map +1 -0
- package/dist/orchestrator/adapters/tools/IToolAdapter.d.ts +52 -0
- package/dist/orchestrator/adapters/tools/IToolAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/tools/IToolAdapter.js +10 -0
- package/dist/orchestrator/adapters/tools/IToolAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/vcs/IVCSAdapter.d.ts +89 -0
- package/dist/orchestrator/adapters/vcs/IVCSAdapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/vcs/IVCSAdapter.js +11 -0
- package/dist/orchestrator/adapters/vcs/IVCSAdapter.js.map +1 -0
- package/dist/orchestrator/adapters/vcs/github.adapter.d.ts +36 -0
- package/dist/orchestrator/adapters/vcs/github.adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/vcs/github.adapter.js +110 -0
- package/dist/orchestrator/adapters/vcs/github.adapter.js.map +1 -0
- package/dist/orchestrator/artifacts/artifact-store.d.ts +47 -0
- package/dist/orchestrator/artifacts/artifact-store.d.ts.map +1 -0
- package/dist/orchestrator/artifacts/artifact-store.js +135 -0
- package/dist/orchestrator/artifacts/artifact-store.js.map +1 -0
- package/dist/orchestrator/builder/domain-classifier.d.ts +24 -0
- package/dist/orchestrator/builder/domain-classifier.d.ts.map +1 -0
- package/dist/orchestrator/builder/domain-classifier.js +156 -0
- package/dist/orchestrator/builder/domain-classifier.js.map +1 -0
- package/dist/orchestrator/builder/interview-questions.d.ts +13 -0
- package/dist/orchestrator/builder/interview-questions.d.ts.map +1 -0
- package/dist/orchestrator/builder/interview-questions.js +127 -0
- package/dist/orchestrator/builder/interview-questions.js.map +1 -0
- package/dist/orchestrator/builder/squad-builder.d.ts +53 -0
- package/dist/orchestrator/builder/squad-builder.d.ts.map +1 -0
- package/dist/orchestrator/builder/squad-builder.js +107 -0
- package/dist/orchestrator/builder/squad-builder.js.map +1 -0
- package/dist/orchestrator/builder/squad-generator.d.ts +33 -0
- package/dist/orchestrator/builder/squad-generator.d.ts.map +1 -0
- package/dist/orchestrator/builder/squad-generator.js +360 -0
- package/dist/orchestrator/builder/squad-generator.js.map +1 -0
- package/dist/orchestrator/cli/index.d.ts +3 -0
- package/dist/orchestrator/cli/index.d.ts.map +1 -0
- package/dist/orchestrator/cli/index.js +8 -0
- package/dist/orchestrator/cli/index.js.map +1 -0
- package/dist/orchestrator/context/context-index.d.ts +48 -0
- package/dist/orchestrator/context/context-index.d.ts.map +1 -0
- package/dist/orchestrator/context/context-index.js +116 -0
- package/dist/orchestrator/context/context-index.js.map +1 -0
- package/dist/orchestrator/context/context-loader.d.ts +49 -0
- package/dist/orchestrator/context/context-loader.d.ts.map +1 -0
- package/dist/orchestrator/context/context-loader.js +111 -0
- package/dist/orchestrator/context/context-loader.js.map +1 -0
- package/dist/orchestrator/core/guardrails.d.ts +33 -0
- package/dist/orchestrator/core/guardrails.d.ts.map +1 -0
- package/dist/orchestrator/core/guardrails.js +272 -0
- package/dist/orchestrator/core/guardrails.js.map +1 -0
- package/dist/orchestrator/core/state-machine.d.ts +65 -0
- package/dist/orchestrator/core/state-machine.d.ts.map +1 -0
- package/dist/orchestrator/core/state-machine.js +227 -0
- package/dist/orchestrator/core/state-machine.js.map +1 -0
- package/dist/orchestrator/core/types.d.ts +364 -0
- package/dist/orchestrator/core/types.d.ts.map +1 -0
- package/dist/orchestrator/core/types.js +10 -0
- package/dist/orchestrator/core/types.js.map +1 -0
- package/dist/orchestrator/index.d.ts +75 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +64 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/mcp/server.d.ts +35 -0
- package/dist/orchestrator/mcp/server.d.ts.map +1 -0
- package/dist/orchestrator/mcp/server.js +378 -0
- package/dist/orchestrator/mcp/server.js.map +1 -0
- package/dist/orchestrator/runtime/agent-dispatcher.d.ts +25 -0
- package/dist/orchestrator/runtime/agent-dispatcher.d.ts.map +1 -0
- package/dist/orchestrator/runtime/agent-dispatcher.js +82 -0
- package/dist/orchestrator/runtime/agent-dispatcher.js.map +1 -0
- package/dist/orchestrator/runtime/approval-gate.d.ts +55 -0
- package/dist/orchestrator/runtime/approval-gate.d.ts.map +1 -0
- package/dist/orchestrator/runtime/approval-gate.js +104 -0
- package/dist/orchestrator/runtime/approval-gate.js.map +1 -0
- package/dist/orchestrator/runtime/handoff-manager.d.ts +29 -0
- package/dist/orchestrator/runtime/handoff-manager.d.ts.map +1 -0
- package/dist/orchestrator/runtime/handoff-manager.js +80 -0
- package/dist/orchestrator/runtime/handoff-manager.js.map +1 -0
- package/dist/orchestrator/runtime/job-manager.d.ts +39 -0
- package/dist/orchestrator/runtime/job-manager.d.ts.map +1 -0
- package/dist/orchestrator/runtime/job-manager.js +132 -0
- package/dist/orchestrator/runtime/job-manager.js.map +1 -0
- package/dist/orchestrator/runtime/squad-runtime.d.ts +70 -0
- package/dist/orchestrator/runtime/squad-runtime.d.ts.map +1 -0
- package/dist/orchestrator/runtime/squad-runtime.js +249 -0
- package/dist/orchestrator/runtime/squad-runtime.js.map +1 -0
- package/dist/orchestrator/shell/cli.d.ts +4 -0
- package/dist/orchestrator/shell/cli.d.ts.map +1 -0
- package/dist/orchestrator/shell/cli.js +27 -0
- package/dist/orchestrator/shell/cli.js.map +1 -0
- package/dist/orchestrator/shell/commands/create.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/create.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/create.command.js +41 -0
- package/dist/orchestrator/shell/commands/create.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/edit.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/edit.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/edit.command.js +49 -0
- package/dist/orchestrator/shell/commands/edit.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/hosts.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/hosts.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/hosts.command.js +27 -0
- package/dist/orchestrator/shell/commands/hosts.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/init.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/init.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/init.command.js +13 -0
- package/dist/orchestrator/shell/commands/init.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/list.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/list.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/list.command.js +18 -0
- package/dist/orchestrator/shell/commands/list.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/run.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/run.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/run.command.js +71 -0
- package/dist/orchestrator/shell/commands/run.command.js.map +1 -0
- package/dist/orchestrator/shell/commands/status.command.d.ts +3 -0
- package/dist/orchestrator/shell/commands/status.command.d.ts.map +1 -0
- package/dist/orchestrator/shell/commands/status.command.js +29 -0
- package/dist/orchestrator/shell/commands/status.command.js.map +1 -0
- package/dist/orchestrator/shell/services/active-host-detector.service.d.ts +25 -0
- package/dist/orchestrator/shell/services/active-host-detector.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/active-host-detector.service.js +128 -0
- package/dist/orchestrator/shell/services/active-host-detector.service.js.map +1 -0
- package/dist/orchestrator/shell/services/host-resolution.service.d.ts +42 -0
- package/dist/orchestrator/shell/services/host-resolution.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/host-resolution.service.js +108 -0
- package/dist/orchestrator/shell/services/host-resolution.service.js.map +1 -0
- package/dist/orchestrator/shell/services/host-runtime.service.d.ts +23 -0
- package/dist/orchestrator/shell/services/host-runtime.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/host-runtime.service.js +167 -0
- package/dist/orchestrator/shell/services/host-runtime.service.js.map +1 -0
- package/dist/orchestrator/shell/services/interview-host-bridge.service.d.ts +14 -0
- package/dist/orchestrator/shell/services/interview-host-bridge.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/interview-host-bridge.service.js +16 -0
- package/dist/orchestrator/shell/services/interview-host-bridge.service.js.map +1 -0
- package/dist/orchestrator/shell/services/job-execution.service.d.ts +22 -0
- package/dist/orchestrator/shell/services/job-execution.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/job-execution.service.js +39 -0
- package/dist/orchestrator/shell/services/job-execution.service.js.map +1 -0
- package/dist/orchestrator/shell/services/project-bootstrap.service.d.ts +6 -0
- package/dist/orchestrator/shell/services/project-bootstrap.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/project-bootstrap.service.js +111 -0
- package/dist/orchestrator/shell/services/project-bootstrap.service.js.map +1 -0
- package/dist/orchestrator/shell/services/squad-scaffold.service.d.ts +3 -0
- package/dist/orchestrator/shell/services/squad-scaffold.service.d.ts.map +1 -0
- package/dist/orchestrator/shell/services/squad-scaffold.service.js +30 -0
- package/dist/orchestrator/shell/services/squad-scaffold.service.js.map +1 -0
- package/dist/tests/integration/instagram-squad.test.d.ts +8 -0
- package/dist/tests/integration/instagram-squad.test.d.ts.map +1 -0
- package/dist/tests/integration/instagram-squad.test.js +187 -0
- package/dist/tests/integration/instagram-squad.test.js.map +1 -0
- package/dist/tests/integration/shell/cli-run-host-native.test.d.ts +2 -0
- package/dist/tests/integration/shell/cli-run-host-native.test.d.ts.map +1 -0
- package/dist/tests/integration/shell/cli-run-host-native.test.js +42 -0
- package/dist/tests/integration/shell/cli-run-host-native.test.js.map +1 -0
- package/dist/tests/integration/software-squad.test.d.ts +8 -0
- package/dist/tests/integration/software-squad.test.d.ts.map +1 -0
- package/dist/tests/integration/software-squad.test.js +207 -0
- package/dist/tests/integration/software-squad.test.js.map +1 -0
- package/dist/tests/unit/artifact-store.test.d.ts +2 -0
- package/dist/tests/unit/artifact-store.test.d.ts.map +1 -0
- package/dist/tests/unit/artifact-store.test.js +137 -0
- package/dist/tests/unit/artifact-store.test.js.map +1 -0
- package/dist/tests/unit/context-loader.test.d.ts +2 -0
- package/dist/tests/unit/context-loader.test.d.ts.map +1 -0
- package/dist/tests/unit/context-loader.test.js +109 -0
- package/dist/tests/unit/context-loader.test.js.map +1 -0
- package/dist/tests/unit/docs/host-native-docs.test.d.ts +2 -0
- package/dist/tests/unit/docs/host-native-docs.test.d.ts.map +1 -0
- package/dist/tests/unit/docs/host-native-docs.test.js +18 -0
- package/dist/tests/unit/docs/host-native-docs.test.js.map +1 -0
- package/dist/tests/unit/guardrails.test.d.ts +2 -0
- package/dist/tests/unit/guardrails.test.d.ts.map +1 -0
- package/dist/tests/unit/guardrails.test.js +202 -0
- package/dist/tests/unit/guardrails.test.js.map +1 -0
- package/dist/tests/unit/host/host-adapter-contract.test.d.ts +2 -0
- package/dist/tests/unit/host/host-adapter-contract.test.d.ts.map +1 -0
- package/dist/tests/unit/host/host-adapter-contract.test.js +53 -0
- package/dist/tests/unit/host/host-adapter-contract.test.js.map +1 -0
- package/dist/tests/unit/host/ide.adapter.test.d.ts +2 -0
- package/dist/tests/unit/host/ide.adapter.test.d.ts.map +1 -0
- package/dist/tests/unit/host/ide.adapter.test.js +17 -0
- package/dist/tests/unit/host/ide.adapter.test.js.map +1 -0
- package/dist/tests/unit/host/native-ide-adapters.test.d.ts +2 -0
- package/dist/tests/unit/host/native-ide-adapters.test.d.ts.map +1 -0
- package/dist/tests/unit/host/native-ide-adapters.test.js +26 -0
- package/dist/tests/unit/host/native-ide-adapters.test.js.map +1 -0
- package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.d.ts +2 -0
- package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.d.ts.map +1 -0
- package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.js +128 -0
- package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.js.map +1 -0
- package/dist/tests/unit/shell/active-host-detector.test.d.ts +2 -0
- package/dist/tests/unit/shell/active-host-detector.test.d.ts.map +1 -0
- package/dist/tests/unit/shell/active-host-detector.test.js +85 -0
- package/dist/tests/unit/shell/active-host-detector.test.js.map +1 -0
- package/dist/tests/unit/shell/host-resolution.service.test.d.ts +2 -0
- package/dist/tests/unit/shell/host-resolution.service.test.d.ts.map +1 -0
- package/dist/tests/unit/shell/host-resolution.service.test.js +252 -0
- package/dist/tests/unit/shell/host-resolution.service.test.js.map +1 -0
- package/dist/tests/unit/shell/interview-host-bridge.test.d.ts +2 -0
- package/dist/tests/unit/shell/interview-host-bridge.test.d.ts.map +1 -0
- package/dist/tests/unit/shell/interview-host-bridge.test.js +58 -0
- package/dist/tests/unit/shell/interview-host-bridge.test.js.map +1 -0
- package/dist/tests/unit/shell/project-bootstrap.service.test.d.ts +2 -0
- package/dist/tests/unit/shell/project-bootstrap.service.test.d.ts.map +1 -0
- package/dist/tests/unit/shell/project-bootstrap.service.test.js +58 -0
- package/dist/tests/unit/shell/project-bootstrap.service.test.js.map +1 -0
- package/dist/tests/unit/shell/squad-scaffold.service.test.d.ts +2 -0
- package/dist/tests/unit/shell/squad-scaffold.service.test.d.ts.map +1 -0
- package/dist/tests/unit/shell/squad-scaffold.service.test.js +40 -0
- package/dist/tests/unit/shell/squad-scaffold.service.test.js.map +1 -0
- package/dist/tests/unit/squad-builder.test.d.ts +2 -0
- package/dist/tests/unit/squad-builder.test.d.ts.map +1 -0
- package/dist/tests/unit/squad-builder.test.js +126 -0
- package/dist/tests/unit/squad-builder.test.js.map +1 -0
- package/dist/tests/unit/state-machine.test.d.ts +2 -0
- package/dist/tests/unit/state-machine.test.d.ts.map +1 -0
- package/dist/tests/unit/state-machine.test.js +133 -0
- package/dist/tests/unit/state-machine.test.js.map +1 -0
- package/docs/architecture/overview.md +115 -0
- package/docs/development/adding-agents.md +75 -0
- package/docs/development/adding-hosts.md +104 -0
- package/docs/development/adding-integrations.md +83 -0
- package/docs/development/host-detection-and-resolution.md +59 -0
- package/docs/squads/how-to-create.md +85 -0
- package/docs/squads/how-to-execute.md +139 -0
- package/docs/superpowers/plans/2026-04-01-host-native-cli-shell-implementation.md +617 -0
- package/docs/superpowers/specs/2026-04-01-host-native-cli-shell-design.md +253 -0
- package/package.json +103 -0
- package/squads/examples/instagram-content/AGENTS.md +63 -0
- package/squads/examples/instagram-content/POLICIES.md +45 -0
- package/squads/examples/instagram-content/SQUAD.md +63 -0
- package/squads/examples/instagram-content/WORKFLOW.md +58 -0
- package/squads/examples/instagram-content/config/squad.json +474 -0
- package/squads/examples/software-development/AGENTS.md +88 -0
- package/squads/examples/software-development/POLICIES.md +44 -0
- package/squads/examples/software-development/SQUAD.md +65 -0
- package/squads/examples/software-development/WORKFLOW.md +78 -0
- package/squads/examples/software-development/config/squad.json +442 -0
- package/templates/AGENTS.md +46 -0
- package/templates/POLICIES.md +24 -0
- package/templates/PROJECT.md +52 -0
- package/templates/SQUAD.md +52 -0
- package/templates/TASKS.md +31 -0
- package/templates/WORKFLOW.md +35 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArtifactStore
|
|
3
|
+
*
|
|
4
|
+
* Filesystem-based artifact persistence for squad jobs.
|
|
5
|
+
* All job state, handoffs, events, outputs, and approvals are stored
|
|
6
|
+
* as human-readable JSON/Markdown files under:
|
|
7
|
+
*
|
|
8
|
+
* artifacts/<squad_id>/<job_id>/
|
|
9
|
+
* state.json
|
|
10
|
+
* handoffs.json
|
|
11
|
+
* events.json
|
|
12
|
+
* approvals.json
|
|
13
|
+
* outputs/
|
|
14
|
+
* reports/
|
|
15
|
+
*/
|
|
16
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync, readdirSync } from 'node:fs';
|
|
17
|
+
import { join, dirname } from 'node:path';
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
// Paths
|
|
20
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
21
|
+
export class ArtifactStore {
|
|
22
|
+
baseDir;
|
|
23
|
+
constructor(baseDir = 'artifacts') {
|
|
24
|
+
this.baseDir = baseDir;
|
|
25
|
+
}
|
|
26
|
+
jobDir(squadId, jobId) {
|
|
27
|
+
return join(this.baseDir, squadId, jobId);
|
|
28
|
+
}
|
|
29
|
+
ensureDir(path) {
|
|
30
|
+
mkdirSync(path, { recursive: true });
|
|
31
|
+
}
|
|
32
|
+
write(path, data) {
|
|
33
|
+
this.ensureDir(dirname(path));
|
|
34
|
+
writeFileSync(path, JSON.stringify(data, null, 2), 'utf-8');
|
|
35
|
+
}
|
|
36
|
+
read(path) {
|
|
37
|
+
if (!existsSync(path))
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// ─── Job State ─────────────────────────────────────────────────────────────
|
|
47
|
+
/** Persist the full job state */
|
|
48
|
+
saveJob(job) {
|
|
49
|
+
const path = join(this.jobDir(job.squadId, job.id), 'state.json');
|
|
50
|
+
this.write(path, job);
|
|
51
|
+
}
|
|
52
|
+
/** Load a job state from disk */
|
|
53
|
+
loadJob(squadId, jobId) {
|
|
54
|
+
return this.read(join(this.jobDir(squadId, jobId), 'state.json'));
|
|
55
|
+
}
|
|
56
|
+
/** List all job IDs for a squad */
|
|
57
|
+
listJobs(squadId) {
|
|
58
|
+
const squadPath = join(this.baseDir, squadId);
|
|
59
|
+
if (!existsSync(squadPath))
|
|
60
|
+
return [];
|
|
61
|
+
return readdirSync(squadPath, { withFileTypes: true })
|
|
62
|
+
.filter((d) => d.isDirectory())
|
|
63
|
+
.map((d) => d.name);
|
|
64
|
+
}
|
|
65
|
+
// ─── Handoffs ──────────────────────────────────────────────────────────────
|
|
66
|
+
appendHandoff(squadId, jobId, handoff) {
|
|
67
|
+
const path = join(this.jobDir(squadId, jobId), 'handoffs.json');
|
|
68
|
+
const existing = this.read(path) ?? [];
|
|
69
|
+
existing.push(handoff);
|
|
70
|
+
this.write(path, existing);
|
|
71
|
+
}
|
|
72
|
+
loadHandoffs(squadId, jobId) {
|
|
73
|
+
return this.read(join(this.jobDir(squadId, jobId), 'handoffs.json')) ?? [];
|
|
74
|
+
}
|
|
75
|
+
// ─── Events / History ──────────────────────────────────────────────────────
|
|
76
|
+
appendEvent(squadId, jobId, event) {
|
|
77
|
+
const path = join(this.jobDir(squadId, jobId), 'events.json');
|
|
78
|
+
const existing = this.read(path) ?? [];
|
|
79
|
+
existing.push(event);
|
|
80
|
+
this.write(path, existing);
|
|
81
|
+
}
|
|
82
|
+
loadEvents(squadId, jobId) {
|
|
83
|
+
return this.read(join(this.jobDir(squadId, jobId), 'events.json')) ?? [];
|
|
84
|
+
}
|
|
85
|
+
// ─── Approvals ─────────────────────────────────────────────────────────────
|
|
86
|
+
saveApprovals(squadId, jobId, approvals) {
|
|
87
|
+
const path = join(this.jobDir(squadId, jobId), 'approvals.json');
|
|
88
|
+
this.write(path, approvals);
|
|
89
|
+
}
|
|
90
|
+
loadApprovals(squadId, jobId) {
|
|
91
|
+
return this.read(join(this.jobDir(squadId, jobId), 'approvals.json')) ?? [];
|
|
92
|
+
}
|
|
93
|
+
// ─── Artifact Outputs ──────────────────────────────────────────────────────
|
|
94
|
+
/**
|
|
95
|
+
* Persist a pending artifact (content produced by an agent) to disk.
|
|
96
|
+
* Returns an ArtifactRef that can be stored in the job.
|
|
97
|
+
*/
|
|
98
|
+
persistArtifact(squadId, jobId, artifact, agentId, stepId) {
|
|
99
|
+
const ext = artifact.format === 'json' ? 'json' : artifact.format === 'markdown' ? 'md' : 'txt';
|
|
100
|
+
const safeName = artifact.name.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
101
|
+
const fileName = `${safeName}.${ext}`;
|
|
102
|
+
const outputPath = join(this.jobDir(squadId, jobId), 'outputs', fileName);
|
|
103
|
+
this.ensureDir(dirname(outputPath));
|
|
104
|
+
writeFileSync(outputPath, artifact.content, 'utf-8');
|
|
105
|
+
const ref = {
|
|
106
|
+
id: `artifact-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
107
|
+
name: artifact.name,
|
|
108
|
+
path: outputPath,
|
|
109
|
+
producedByAgentId: agentId,
|
|
110
|
+
producedAtStepId: stepId,
|
|
111
|
+
format: artifact.format,
|
|
112
|
+
createdAt: new Date().toISOString(),
|
|
113
|
+
};
|
|
114
|
+
return ref;
|
|
115
|
+
}
|
|
116
|
+
/** Save a Markdown report to artifacts/<squad_id>/<job_id>/reports/ */
|
|
117
|
+
saveReport(squadId, jobId, name, content) {
|
|
118
|
+
const safeName = name.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
119
|
+
const path = join(this.jobDir(squadId, jobId), 'reports', `${safeName}.md`);
|
|
120
|
+
this.ensureDir(dirname(path));
|
|
121
|
+
writeFileSync(path, content, 'utf-8');
|
|
122
|
+
return path;
|
|
123
|
+
}
|
|
124
|
+
/** List all artifact refs from the job's outputs directory */
|
|
125
|
+
listArtifacts(squadId, jobId) {
|
|
126
|
+
const outputDir = join(this.jobDir(squadId, jobId), 'outputs');
|
|
127
|
+
if (!existsSync(outputDir))
|
|
128
|
+
return [];
|
|
129
|
+
return readdirSync(outputDir);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function createArtifactStore(baseDir) {
|
|
133
|
+
return new ArtifactStore(baseDir);
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=artifact-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-store.js","sourceRoot":"","sources":["../../../orchestrator/artifacts/artifact-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAezC,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF,MAAM,OAAO,aAAa;IAChB,OAAO,CAAQ;IAEvB,YAAY,OAAO,GAAG,WAAW;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEO,MAAM,CAAC,OAAgB,EAAE,KAAY;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3C,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACtC,CAAC;IAEO,KAAK,CAAC,IAAY,EAAE,IAAa;QACvC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAC7B,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;IAC7D,CAAC;IAEO,IAAI,CAAI,IAAY;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAA;QAClC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAM,CAAA;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAA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tE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAA;QAC3E,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAC7B,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,8DAA8D;IAC9D,aAAa,CAAC,OAAgB,EAAE,KAAY;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,EAAE,CAAA;QACrC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DomainClassifier
|
|
3
|
+
*
|
|
4
|
+
* Maps interview answers to a SquadDomain and selects the appropriate
|
|
5
|
+
* agent template set and workflow pattern.
|
|
6
|
+
*
|
|
7
|
+
* The classifier uses keyword matching — it is intentionally simple
|
|
8
|
+
* and transparent. Replace with an LLM-based classifier if needed.
|
|
9
|
+
*/
|
|
10
|
+
import type { SquadDomain, InterviewAnswer } from '../core/types.js';
|
|
11
|
+
export interface ClassificationResult {
|
|
12
|
+
domain: SquadDomain;
|
|
13
|
+
confidence: 'high' | 'medium' | 'low';
|
|
14
|
+
suggestedAgentRoles: string[];
|
|
15
|
+
suggestedWorkflowPattern: WorkflowPattern;
|
|
16
|
+
notes: string[];
|
|
17
|
+
}
|
|
18
|
+
export type WorkflowPattern = 'linear' | 'review-loop' | 'publish-gate' | 'iterative' | 'pipeline' | 'custom';
|
|
19
|
+
export declare class DomainClassifier {
|
|
20
|
+
classify(answers: InterviewAnswer[]): ClassificationResult;
|
|
21
|
+
private parseExplicitDomain;
|
|
22
|
+
}
|
|
23
|
+
export declare function createDomainClassifier(): DomainClassifier;
|
|
24
|
+
//# sourceMappingURL=domain-classifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-classifier.d.ts","sourceRoot":"","sources":["../../../orchestrator/builder/domain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEpE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACrC,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,wBAAwB,EAAE,eAAe,CAAA;IACzC,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,aAAa,GACb,cAAc,GACd,WAAW,GACX,UAAU,GACV,QAAQ,CAAA;AA4EZ,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,oBAAoB;IAkE1D,OAAO,CAAC,mBAAmB;CA2B5B;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DomainClassifier
|
|
3
|
+
*
|
|
4
|
+
* Maps interview answers to a SquadDomain and selects the appropriate
|
|
5
|
+
* agent template set and workflow pattern.
|
|
6
|
+
*
|
|
7
|
+
* The classifier uses keyword matching — it is intentionally simple
|
|
8
|
+
* and transparent. Replace with an LLM-based classifier if needed.
|
|
9
|
+
*/
|
|
10
|
+
const DOMAIN_TEMPLATES = [
|
|
11
|
+
{
|
|
12
|
+
domain: 'software-development',
|
|
13
|
+
keywords: [
|
|
14
|
+
'code', 'software', 'dev', 'development', 'programming', 'deploy', 'ci', 'cd',
|
|
15
|
+
'github', 'pr', 'pull request', 'test', 'review', 'bug', 'feature', 'branch',
|
|
16
|
+
'commit', 'release', 'build', 'api', 'backend', 'frontend', 'typescript', 'python',
|
|
17
|
+
],
|
|
18
|
+
agentRoles: ['Product Agent', 'Code Agent', 'Reviewer Agent', 'Test Agent', 'Commit Agent', 'PR Agent', 'Deploy Agent'],
|
|
19
|
+
workflowPattern: 'pipeline',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
domain: 'social-media',
|
|
23
|
+
keywords: [
|
|
24
|
+
'instagram', 'twitter', 'linkedin', 'tiktok', 'social', 'post', 'publish',
|
|
25
|
+
'content', 'caption', 'hashtag', 'story', 'reel', 'engagement', 'follower',
|
|
26
|
+
'brand', 'campaign', 'influencer', 'analytics',
|
|
27
|
+
],
|
|
28
|
+
agentRoles: ['Strategy Agent', 'Research Agent', 'Copy Agent', 'Creative Review Agent', 'Brand/Compliance Agent', 'Approval Agent', 'Publisher Agent', 'Analytics Agent'],
|
|
29
|
+
workflowPattern: 'publish-gate',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
domain: 'content-marketing',
|
|
33
|
+
keywords: [
|
|
34
|
+
'blog', 'article', 'seo', 'content', 'marketing', 'copy', 'editorial',
|
|
35
|
+
'newsletter', 'email', 'landing page', 'keyword', 'audience', 'traffic',
|
|
36
|
+
],
|
|
37
|
+
agentRoles: ['Strategy Agent', 'Research Agent', 'Writer Agent', 'Editor Agent', 'SEO Agent', 'Approval Agent', 'Publisher Agent'],
|
|
38
|
+
workflowPattern: 'review-loop',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
domain: 'documentation',
|
|
42
|
+
keywords: [
|
|
43
|
+
'doc', 'documentation', 'spec', 'wiki', 'readme', 'guide', 'manual',
|
|
44
|
+
'technical writing', 'confluence', 'notion', 'changelog', 'api doc',
|
|
45
|
+
],
|
|
46
|
+
agentRoles: ['Intake Agent', 'Structuring Agent', 'Writer Agent', 'Reviewer Agent', 'Approval Agent', 'Publisher Agent'],
|
|
47
|
+
workflowPattern: 'review-loop',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
domain: 'research',
|
|
51
|
+
keywords: [
|
|
52
|
+
'research', 'analysis', 'report', 'data', 'survey', 'literature', 'findings',
|
|
53
|
+
'summary', 'competitive', 'market research', 'insights',
|
|
54
|
+
],
|
|
55
|
+
agentRoles: ['Planning Agent', 'Research Agent', 'Analysis Agent', 'Synthesis Agent', 'Review Agent', 'Report Agent'],
|
|
56
|
+
workflowPattern: 'iterative',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
domain: 'operations',
|
|
60
|
+
keywords: [
|
|
61
|
+
'operations', 'hr', 'onboarding', 'sales', 'crm', 'pipeline', 'customer',
|
|
62
|
+
'support', 'ticket', 'process', 'workflow', 'automation', 'runbook',
|
|
63
|
+
],
|
|
64
|
+
agentRoles: ['Intake Agent', 'Processing Agent', 'Review Agent', 'Approval Agent', 'Execution Agent', 'Reporting Agent'],
|
|
65
|
+
workflowPattern: 'linear',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
// Classifier
|
|
70
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
71
|
+
export class DomainClassifier {
|
|
72
|
+
classify(answers) {
|
|
73
|
+
const allText = answers.map((a) => a.answer).join(' ').toLowerCase();
|
|
74
|
+
// Score each domain template
|
|
75
|
+
const scores = DOMAIN_TEMPLATES.map((template) => ({
|
|
76
|
+
template,
|
|
77
|
+
score: template.keywords.filter((kw) => allText.includes(kw)).length,
|
|
78
|
+
}));
|
|
79
|
+
scores.sort((a, b) => b.score - a.score);
|
|
80
|
+
const best = scores[0];
|
|
81
|
+
const runner = scores[1];
|
|
82
|
+
const notes = [];
|
|
83
|
+
// Check explicit domain selection from q_domain
|
|
84
|
+
const domainAnswer = answers.find((a) => a.questionId === 'q_domain')?.answer ?? '';
|
|
85
|
+
const explicitDomain = this.parseExplicitDomain(domainAnswer);
|
|
86
|
+
if (explicitDomain) {
|
|
87
|
+
const template = DOMAIN_TEMPLATES.find((t) => t.domain === explicitDomain);
|
|
88
|
+
if (template) {
|
|
89
|
+
notes.push(`Domain explicitly selected: ${explicitDomain}`);
|
|
90
|
+
return {
|
|
91
|
+
domain: explicitDomain,
|
|
92
|
+
confidence: 'high',
|
|
93
|
+
suggestedAgentRoles: template.agentRoles,
|
|
94
|
+
suggestedWorkflowPattern: template.workflowPattern,
|
|
95
|
+
notes,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!best || best.score === 0) {
|
|
100
|
+
notes.push('Could not confidently classify domain — defaulting to custom');
|
|
101
|
+
return {
|
|
102
|
+
domain: 'custom',
|
|
103
|
+
confidence: 'low',
|
|
104
|
+
suggestedAgentRoles: ['Intake Agent', 'Processing Agent', 'Review Agent', 'Output Agent'],
|
|
105
|
+
suggestedWorkflowPattern: 'linear',
|
|
106
|
+
notes,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const confidence = best.score >= 3 && (!runner || best.score > runner.score * 1.5)
|
|
110
|
+
? 'high'
|
|
111
|
+
: best.score >= 2
|
|
112
|
+
? 'medium'
|
|
113
|
+
: 'low';
|
|
114
|
+
if (confidence !== 'high') {
|
|
115
|
+
notes.push(`Classification confidence is ${confidence}. Consider clarifying the domain.`);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
domain: best.template.domain,
|
|
119
|
+
confidence,
|
|
120
|
+
suggestedAgentRoles: best.template.agentRoles,
|
|
121
|
+
suggestedWorkflowPattern: best.template.workflowPattern,
|
|
122
|
+
notes,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
parseExplicitDomain(answer) {
|
|
126
|
+
const lower = answer.toLowerCase().trim();
|
|
127
|
+
const map = {
|
|
128
|
+
'1': 'software-development',
|
|
129
|
+
'software': 'software-development',
|
|
130
|
+
'development': 'software-development',
|
|
131
|
+
'2': 'content-marketing',
|
|
132
|
+
'content': 'content-marketing',
|
|
133
|
+
'marketing': 'content-marketing',
|
|
134
|
+
'3': 'social-media',
|
|
135
|
+
'social': 'social-media',
|
|
136
|
+
'instagram': 'social-media',
|
|
137
|
+
'4': 'documentation',
|
|
138
|
+
'docs': 'documentation',
|
|
139
|
+
'documentation': 'documentation',
|
|
140
|
+
'5': 'research',
|
|
141
|
+
'research': 'research',
|
|
142
|
+
'6': 'operations',
|
|
143
|
+
'operations': 'operations',
|
|
144
|
+
'hr': 'operations',
|
|
145
|
+
'sales': 'operations',
|
|
146
|
+
'7': 'custom',
|
|
147
|
+
'other': 'custom',
|
|
148
|
+
'custom': 'custom',
|
|
149
|
+
};
|
|
150
|
+
return map[lower] ?? null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function createDomainClassifier() {
|
|
154
|
+
return new DomainClassifier();
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=domain-classifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-classifier.js","sourceRoot":"","sources":["../../../orchestrator/builder/domain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+BH,MAAM,gBAAgB,GAAqB;IACzC;QACE,MAAM,EAAE,sBAAsB;QAC9B,QAAQ,EAAE;YACR,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI;YAC7E,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ;YAC5E,QAAQ,EAAE,SAAS,EAAE,O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AAE,YAAY;YACjB,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,YAAY;YACrB,GAAG,EAAE,QAAQ;YACb,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,QAAQ;SACnB,CAAA;QACD,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAA;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,gBAAgB,EAAE,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interview Questions Bank
|
|
3
|
+
*
|
|
4
|
+
* Structured questions used by the Squad Builder to discover
|
|
5
|
+
* the user's intent, domain, workflow, and constraints before
|
|
6
|
+
* generating a squad definition.
|
|
7
|
+
*/
|
|
8
|
+
import type { InterviewQuestion } from '../core/types.js';
|
|
9
|
+
export declare const INTERVIEW_QUESTIONS: InterviewQuestion[];
|
|
10
|
+
export declare function getRequiredQuestions(): InterviewQuestion[];
|
|
11
|
+
export declare function getQuestionById(id: string): InterviewQuestion | undefined;
|
|
12
|
+
export declare function getQuestionsByCategory(category: InterviewQuestion['category']): InterviewQuestion[];
|
|
13
|
+
//# sourceMappingURL=interview-questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interview-questions.d.ts","sourceRoot":"","sources":["../../../orchestrator/builder/interview-questions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAqHlD,CAAA;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,EAAE,CAE1D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEzE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,GACtC,iBAAiB,EAAE,CAErB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interview Questions Bank
|
|
3
|
+
*
|
|
4
|
+
* Structured questions used by the Squad Builder to discover
|
|
5
|
+
* the user's intent, domain, workflow, and constraints before
|
|
6
|
+
* generating a squad definition.
|
|
7
|
+
*/
|
|
8
|
+
export const INTERVIEW_QUESTIONS = [
|
|
9
|
+
// ── Objective ──────────────────────────────────────────────────────────────
|
|
10
|
+
{
|
|
11
|
+
id: 'q_objective',
|
|
12
|
+
category: 'objective',
|
|
13
|
+
required: true,
|
|
14
|
+
question: 'What is the primary objective of this squad? What problem does it solve?',
|
|
15
|
+
hint: 'e.g. "Automate publishing of Instagram content, from idea to post"',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'q_domain',
|
|
19
|
+
category: 'domain',
|
|
20
|
+
required: true,
|
|
21
|
+
question: 'What domain does this squad operate in?\n 1. Software Development\n 2. Content Marketing\n 3. Social Media\n 4. Documentation\n 5. Research\n 6. Operations / HR / Sales\n 7. Other (describe)',
|
|
22
|
+
hint: 'Enter the number or describe freely',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'q_description',
|
|
26
|
+
category: 'objective',
|
|
27
|
+
required: true,
|
|
28
|
+
question: 'Describe the squad in 2–3 sentences. What does it do end-to-end?',
|
|
29
|
+
},
|
|
30
|
+
// ── I/O ───────────────────────────────────────────────────────────────────
|
|
31
|
+
{
|
|
32
|
+
id: 'q_inputs',
|
|
33
|
+
category: 'io',
|
|
34
|
+
required: true,
|
|
35
|
+
question: 'What are the typical INPUTS for this squad? (e.g. a task description, a brief, a JIRA ticket, a keyword)',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'q_outputs',
|
|
39
|
+
category: 'io',
|
|
40
|
+
required: true,
|
|
41
|
+
question: 'What are the expected OUTPUTS? (e.g. a PR, a published post, a documented spec, a report)',
|
|
42
|
+
},
|
|
43
|
+
// ── Steps ─────────────────────────────────────────────────────────────────
|
|
44
|
+
{
|
|
45
|
+
id: 'q_steps',
|
|
46
|
+
category: 'steps',
|
|
47
|
+
required: true,
|
|
48
|
+
question: 'What are the main steps in this process TODAY (even if manual)?\nList them in order, e.g. "1. Research, 2. Write, 3. Review, 4. Publish"',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'q_loop_steps',
|
|
52
|
+
category: 'steps',
|
|
53
|
+
required: false,
|
|
54
|
+
question: 'Are there any steps that loop or iterate? (e.g. "Review → Revise → Review again")',
|
|
55
|
+
hint: 'Leave blank if steps are strictly sequential',
|
|
56
|
+
},
|
|
57
|
+
// ── Approvals ─────────────────────────────────────────────────────────────
|
|
58
|
+
{
|
|
59
|
+
id: 'q_approvals',
|
|
60
|
+
category: 'approvals',
|
|
61
|
+
required: true,
|
|
62
|
+
question: 'Which steps REQUIRE human approval or sign-off before moving forward?',
|
|
63
|
+
hint: 'e.g. "Publishing always needs approval. Commit never does."',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'q_human_in_loop',
|
|
67
|
+
category: 'approvals',
|
|
68
|
+
required: true,
|
|
69
|
+
question: 'What is NEVER allowed to be fully automated? What must always involve a human?',
|
|
70
|
+
hint: 'e.g. "Never auto-publish. Never deploy to production without confirmation."',
|
|
71
|
+
},
|
|
72
|
+
// ── Tools ─────────────────────────────────────────────────────────────────
|
|
73
|
+
{
|
|
74
|
+
id: 'q_tools',
|
|
75
|
+
category: 'tools',
|
|
76
|
+
required: false,
|
|
77
|
+
question: 'What tools or systems are involved? (e.g. GitHub, Vercel, Instagram, Google Docs, Slack, Notion)',
|
|
78
|
+
hint: 'List any APIs, platforms, or services this squad will interact with',
|
|
79
|
+
},
|
|
80
|
+
// ── Policies ──────────────────────────────────────────────────────────────
|
|
81
|
+
{
|
|
82
|
+
id: 'q_policies',
|
|
83
|
+
category: 'policies',
|
|
84
|
+
required: false,
|
|
85
|
+
question: 'Are there any rules, brand guidelines, compliance requirements, or policies that must be respected?',
|
|
86
|
+
hint: 'e.g. "Must follow brand voice guidelines. No profanity. Legal review required for contracts."',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'q_prohibited',
|
|
90
|
+
category: 'policies',
|
|
91
|
+
required: false,
|
|
92
|
+
question: 'What actions are strictly PROHIBITED for this squad to take automatically?',
|
|
93
|
+
hint: 'e.g. "No auto-merge of PRs. No posting without brand review."',
|
|
94
|
+
},
|
|
95
|
+
// ── Risks ─────────────────────────────────────────────────────────────────
|
|
96
|
+
{
|
|
97
|
+
id: 'q_risks',
|
|
98
|
+
category: 'risks',
|
|
99
|
+
required: false,
|
|
100
|
+
question: 'What are the most critical risks if something goes wrong in this workflow?',
|
|
101
|
+
hint: 'e.g. "Wrong post published. Broken deploy. PII exposed in public doc."',
|
|
102
|
+
},
|
|
103
|
+
// ── Context ───────────────────────────────────────────────────────────────
|
|
104
|
+
{
|
|
105
|
+
id: 'q_context_files',
|
|
106
|
+
category: 'context',
|
|
107
|
+
required: false,
|
|
108
|
+
question: 'What documentation already exists for this domain?\n(e.g. brand guide, design system, spec templates, playbooks)',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'q_squad_name',
|
|
112
|
+
category: 'objective',
|
|
113
|
+
required: true,
|
|
114
|
+
question: 'What should this squad be called? (used as the squad ID and folder name)',
|
|
115
|
+
hint: 'e.g. "instagram-content", "software-dev", "technical-docs"',
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
export function getRequiredQuestions() {
|
|
119
|
+
return INTERVIEW_QUESTIONS.filter((q) => q.required);
|
|
120
|
+
}
|
|
121
|
+
export function getQuestionById(id) {
|
|
122
|
+
return INTERVIEW_QUESTIONS.find((q) => q.id === id);
|
|
123
|
+
}
|
|
124
|
+
export function getQuestionsByCategory(category) {
|
|
125
|
+
return INTERVIEW_QUESTIONS.filter((q) => q.category === category);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=interview-questions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interview-questions.js","sourceRoot":"","sources":["../../../orchestrator/builder/interview-questions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,8EAA8E;IAC9E;QACE,EAAE,EAAE,aAAa;QACjB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,0EAA0E;QACpF,IAAI,EAAE,oEAAoE;KAC3E;IACD;QACE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,IAAI;QACd,QAAQ,EACN,uMAAuM;QACzM,IAAI,EAAE,qCAAqC;KAC5C;IACD;QACE,EAAE,EAAE,eAAe;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,kEAAkE;KAC7E;IAED,6EAA6E;IAC7E;QACE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,0GAA0G;KACrH;IACD;QACE,EAAE,EAAE,WAAW;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,2FAA2F;KACtG;IAED,6EAA6E;IAC7E;QACE,EAAE,EAAE,SAAS;QACb,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,0IAA0I;KACrJ;IACD;QACE,EAAE,EAAE,cAAc;QAClB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,mFAAmF;QAC7F,IAAI,EAAE,8CAA8C;KACrD;IAED,6EAA6E;IAC7E;QACE,EAAE,EAAE,aAAa;QACjB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,uEAAuE;QACjF,IAAI,EAAE,6DAA6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AC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,QAAuC;IAEvC,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;AACnE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SquadBuilder
|
|
3
|
+
*
|
|
4
|
+
* High-level orchestrator for the squad design interview.
|
|
5
|
+
* Coordinates: questions → answers → classification → generation → file output.
|
|
6
|
+
*
|
|
7
|
+
* SquadBuilder is designed to run in two modes:
|
|
8
|
+
* 1. Programmatic: call conductInterview(answers[]) with pre-filled answers
|
|
9
|
+
* 2. Interactive CLI: use with the CLI entrypoint which prompts the user
|
|
10
|
+
*/
|
|
11
|
+
import type { InterviewAnswer, SquadBuildResult } from '../core/types.js';
|
|
12
|
+
import { DomainClassifier } from './domain-classifier.js';
|
|
13
|
+
import { SquadGenerator } from './squad-generator.js';
|
|
14
|
+
export interface SquadBuilderOptions {
|
|
15
|
+
/** Root path for context discovery */
|
|
16
|
+
contextRootPath?: string;
|
|
17
|
+
/** Output directory for generated squad files */
|
|
18
|
+
outputDir?: string;
|
|
19
|
+
classifier?: DomainClassifier;
|
|
20
|
+
generator?: SquadGenerator;
|
|
21
|
+
}
|
|
22
|
+
export declare class SquadBuilder {
|
|
23
|
+
private contextRootPath;
|
|
24
|
+
private outputDir;
|
|
25
|
+
private classifier;
|
|
26
|
+
private generator;
|
|
27
|
+
constructor(options?: SquadBuilderOptions);
|
|
28
|
+
/**
|
|
29
|
+
* Return all interview questions (for display in CLI or agent conversation).
|
|
30
|
+
*/
|
|
31
|
+
getQuestions(): import("../index.js").InterviewQuestion[];
|
|
32
|
+
/**
|
|
33
|
+
* Conduct the interview programmatically with a pre-built answer set.
|
|
34
|
+
* Returns the squad build result without writing files.
|
|
35
|
+
*/
|
|
36
|
+
conductInterview(answers: InterviewAnswer[]): SquadBuildResult;
|
|
37
|
+
/**
|
|
38
|
+
* Build a squad from answers and write all generated files to disk.
|
|
39
|
+
*/
|
|
40
|
+
build(answers: InterviewAnswer[]): Promise<SquadBuildResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Validate that all required questions have answers.
|
|
43
|
+
* Returns an array of missing question IDs.
|
|
44
|
+
*/
|
|
45
|
+
validateAnswers(answers: InterviewAnswer[]): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Generate a formatted prompt string for the orquestrador to use
|
|
48
|
+
* when interviewing the user in an agent conversation context.
|
|
49
|
+
*/
|
|
50
|
+
generateInterviewPrompt(): string;
|
|
51
|
+
}
|
|
52
|
+
export declare function createSquadBuilder(options?: SquadBuilderOptions): SquadBuilder;
|
|
53
|
+
//# sourceMappingURL=squad-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squad-builder.d.ts","sourceRoot":"","sources":["../../../orchestrator/builder/squad-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEzE,OAAO,EAAE,gBAAgB,EAA0B,MAAM,wBAAwB,CAAA;AACjF,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAA;AAG3E,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,SAAS,CAAC,EAAE,cAAc,CAAA;CAC3B;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,SAAS,CAAgB;gBAErB,OAAO,GAAE,mBAAwB;IAO7C;;OAEG;IACH,YAAY;IAIZ;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,gBAAgB;IAK9D;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgClE;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE;IAQrD;;;OAGG;IACH,uBAAuB,IAAI,MAAM;CAgBlC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAE9E"}
|