@oxgeneral/orch 1.0.16 → 1.0.18
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/dist/App-Q7J4JGDF.js +22 -0
- package/dist/agent-WLKP6WOR.js +9 -0
- package/dist/agent-factory-HJOS7FW3.js +2 -0
- package/dist/{agent-shop-JHDTCWCD.js → agent-shop-XWVUC3MK.js} +1 -1
- package/dist/{chunk-HWEMBO36.js → chunk-3YGXRXS7.js} +3 -3
- package/dist/{chunk-3AXNSYCM.js → chunk-6E6DC7OE.js} +1 -1
- package/dist/{chunk-J7ITYXE6.js → chunk-6JQDY3PP.js} +3 -3
- package/dist/{chunk-J7ITYXE6.js.map → chunk-6JQDY3PP.js.map} +1 -1
- package/dist/chunk-C7C7Q7XO.js +4 -0
- package/dist/{chunk-JM2WRI46.js → chunk-DEHFYICU.js} +1 -1
- package/dist/chunk-EWRVHOUA.js +2 -0
- package/dist/{chunk-NLQAJ7TW.js → chunk-IESAV453.js} +14 -4
- package/dist/chunk-IESAV453.js.map +1 -0
- package/dist/chunk-ITMAWW3J.js +3 -0
- package/dist/chunk-LRYVT4D4.js +2 -0
- package/dist/{chunk-XJ6KTO3E.js → chunk-NNF3VEVJ.js} +3 -3
- package/dist/{chunk-XJ6KTO3E.js.map → chunk-NNF3VEVJ.js.map} +1 -1
- package/dist/{chunk-TWEMIPRN.js → chunk-RFN447MA.js} +3 -3
- package/dist/{chunk-TWEMIPRN.js.map → chunk-RFN447MA.js.map} +1 -1
- package/dist/chunk-XMKCAUEH.js +2 -0
- package/dist/{claude-EMBYYPW4.js → claude-KZMCTMDP.js} +4 -4
- package/dist/{claude-EMBYYPW4.js.map → claude-KZMCTMDP.js.map} +1 -1
- package/dist/claude-PH7LT3OH.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/{clipboard-service-WVON5ZN4.js → clipboard-service-AJTJG2DJ.js} +1 -1
- package/dist/{codex-WQ3LU3MM.js → codex-UR7Q22OV.js} +4 -4
- package/dist/{codex-WQ3LU3MM.js.map → codex-UR7Q22OV.js.map} +1 -1
- package/dist/codex-URQN4JLZ.js +2 -0
- package/dist/container-5FLJ4QYD.js +4 -0
- package/dist/{cursor-M3EJ432K.js → cursor-EMX3ECDY.js} +1 -1
- package/dist/{cursor-TKV5FFCN.js → cursor-O6M6XOMT.js} +4 -4
- package/dist/{cursor-TKV5FFCN.js.map → cursor-O6M6XOMT.js.map} +1 -1
- package/dist/{doctor-SKIWAKHW.js → doctor-5HTCX6K7.js} +1 -1
- package/dist/goal-KQ4XOSRH.js +8 -0
- package/dist/index.d.ts +87 -2
- package/dist/index.js +588 -14
- package/dist/index.js.map +1 -1
- package/dist/init-GVM7EYPO.js +74 -0
- package/dist/{logs-CU3NC24O.js → logs-EUOQ2UZL.js} +1 -1
- package/dist/{opencode-YWT3M4NX.js → opencode-HOX5TCMD.js} +4 -4
- package/dist/{opencode-YWT3M4NX.js.map → opencode-HOX5TCMD.js.map} +1 -1
- package/dist/opencode-K22RCQ5C.js +2 -0
- package/dist/orchestrator-I3CXUOH7.js +6 -0
- package/dist/{orchestrator-FWROY4JD.js.map → orchestrator-I3CXUOH7.js.map} +1 -1
- package/dist/{orchestrator-YZHLOVJO.js → orchestrator-L34ZPKAB.js} +3 -3
- package/dist/org-WCEBMHLR.js +3 -0
- package/dist/{shell-PMLIRG3N.js → shell-C2J4AIAV.js} +4 -4
- package/dist/{shell-PMLIRG3N.js.map → shell-C2J4AIAV.js.map} +1 -1
- package/dist/shell-NPNTWDMU.js +2 -0
- package/dist/shop-picker-2HA2CDKS.js +5 -0
- package/dist/{task-2LI5CMI4.js → task-TTOAOVM7.js} +1 -1
- package/dist/tui-IWCCSBDD.js +2 -0
- package/dist/{workspace-manager-KUU7UMMC.js → workspace-manager-QH27FF55.js} +4 -4
- package/dist/{workspace-manager-KUU7UMMC.js.map → workspace-manager-QH27FF55.js.map} +1 -1
- package/dist/{workspace-manager-DG4IFFG3.js → workspace-manager-ZI5SVXJU.js} +2 -2
- package/package.json +1 -1
- package/skills/orch/SKILL.md +23 -0
- package/dist/App-2CW2WICK.js +0 -22
- package/dist/agent-TU6OC7ZT.js +0 -9
- package/dist/chunk-FQ5YUP4J.js +0 -4
- package/dist/chunk-IKNBPOQL.js +0 -2
- package/dist/chunk-LOJ26OVK.js +0 -3
- package/dist/chunk-NLQAJ7TW.js.map +0 -1
- package/dist/claude-GIGROCH5.js +0 -2
- package/dist/codex-AZD52UPS.js +0 -2
- package/dist/container-RFWMXKD6.js +0 -4
- package/dist/goal-RNNZYMNR.js +0 -8
- package/dist/init-6OVZBN6B.js +0 -73
- package/dist/opencode-4G7VAZGY.js +0 -2
- package/dist/orchestrator-FWROY4JD.js +0 -6
- package/dist/org-KLYK6MMJ.js +0 -3
- package/dist/shell-JC2WDWBR.js +0 -2
- package/dist/shop-picker-LE3SKFOX.js +0 -5
- package/dist/tui-24NBO5U6.js +0 -2
- package/scripts/demo.sh +0 -202
- /package/dist/{serve-JOIPYKKG.js → serve-DE7ES7Q5.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Paths } from './chunk-
|
|
2
|
-
import { canTransition, isTerminal } from './chunk-
|
|
3
|
-
export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus } from './chunk-
|
|
1
|
+
import { Paths } from './chunk-6JQDY3PP.js';
|
|
2
|
+
import { canTransition, isTerminal } from './chunk-NNF3VEVJ.js';
|
|
3
|
+
export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus } from './chunk-NNF3VEVJ.js';
|
|
4
4
|
import { AUTONOMOUS_LABEL } from './chunk-XUZZJCKG.js';
|
|
5
5
|
export { AdapterRegistry } from './chunk-6DWHQPTE.js';
|
|
6
6
|
export { SkillLoader } from './chunk-U2JVMD2G.js';
|
|
7
7
|
import { ensureDir, readYaml, writeYaml, readJson, writeJson, listFiles, appendJsonl, readJsonl, readJsonlTail, closeAppendHandle, pathExists } from './chunk-W3J7CURM.js';
|
|
8
8
|
export { createTokenUsage } from './chunk-RHFRHCN5.js';
|
|
9
|
-
import { InvalidArgumentsError, TaskNotFoundError, InvalidTransitionError, AgentNotFoundError, OrchestryError, TeamNotFoundError, GoalNotFoundError } from './chunk-
|
|
10
|
-
export { AdapterErrorKind, AgentNotFoundError, ERROR_HINTS, NotInitializedError, OrchestryError, TaskNotFoundError, WorkspaceError, classifyAdapterError } from './chunk-
|
|
9
|
+
import { InvalidArgumentsError, TaskNotFoundError, InvalidTransitionError, AgentNotFoundError, OrchestryError, TeamNotFoundError, GoalNotFoundError, GoalHasPendingTasksError } from './chunk-IESAV453.js';
|
|
10
|
+
export { AdapterErrorKind, AgentNotFoundError, ERROR_HINTS, GoalHasPendingTasksError, NotInitializedError, OrchestryError, TaskNotFoundError, WorkspaceError, classifyAdapterError } from './chunk-IESAV453.js';
|
|
11
11
|
import fs, { mkdtemp, readFile, unlink, rm, mkdir } from 'fs/promises';
|
|
12
12
|
import path, { join } from 'path';
|
|
13
13
|
import { nanoid } from 'nanoid';
|
|
@@ -16,6 +16,542 @@ import { promisify } from 'util';
|
|
|
16
16
|
import { homedir, tmpdir } from 'os';
|
|
17
17
|
import { createReadStream } from 'fs';
|
|
18
18
|
|
|
19
|
+
// src/domain/model-tiers.ts
|
|
20
|
+
var MODEL_TIER_MAP = {
|
|
21
|
+
claude: {
|
|
22
|
+
capable: "claude-opus-4-6",
|
|
23
|
+
balanced: "claude-sonnet-4-6",
|
|
24
|
+
fast: "claude-haiku-4-6"
|
|
25
|
+
},
|
|
26
|
+
opencode: {
|
|
27
|
+
capable: "openrouter/anthropic/claude-opus-4.6",
|
|
28
|
+
balanced: "",
|
|
29
|
+
fast: "openrouter/google/gemini-2.5-flash"
|
|
30
|
+
},
|
|
31
|
+
codex: {
|
|
32
|
+
capable: "gpt-5.4",
|
|
33
|
+
balanced: "gpt-5.3-codex",
|
|
34
|
+
fast: "gpt-5-mini"
|
|
35
|
+
},
|
|
36
|
+
cursor: {
|
|
37
|
+
capable: "auto",
|
|
38
|
+
balanced: "auto",
|
|
39
|
+
fast: "auto"
|
|
40
|
+
},
|
|
41
|
+
shell: {
|
|
42
|
+
capable: "",
|
|
43
|
+
balanced: "",
|
|
44
|
+
fast: ""
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function resolveModel(adapter, tier) {
|
|
48
|
+
const adapterMap = MODEL_TIER_MAP[adapter];
|
|
49
|
+
if (!adapterMap) return "";
|
|
50
|
+
return adapterMap[tier];
|
|
51
|
+
}
|
|
52
|
+
function defaultModelForAdapter(adapter) {
|
|
53
|
+
return resolveModel(adapter, "balanced");
|
|
54
|
+
}
|
|
55
|
+
function isAdapterKind(value) {
|
|
56
|
+
return value in MODEL_TIER_MAP;
|
|
57
|
+
}
|
|
58
|
+
function isModelTier(value) {
|
|
59
|
+
return value === "capable" || value === "balanced" || value === "fast";
|
|
60
|
+
}
|
|
61
|
+
var SUPPORTED_ADAPTERS = ["claude", "opencode", "codex", "cursor", "shell"];
|
|
62
|
+
|
|
63
|
+
// src/domain/agent-shop.ts
|
|
64
|
+
var BACKEND_DEV_ROLE = `Backend engineer \u2014 builds APIs, services, database layers, and server-side business logic.
|
|
65
|
+
|
|
66
|
+
## WORKFLOW
|
|
67
|
+
|
|
68
|
+
1) READ the task description and identify the scope: new endpoint, service refactor, DB migration, etc.
|
|
69
|
+
2) EXPLORE the existing codebase to understand project structure, conventions, and dependencies.
|
|
70
|
+
3) DESIGN the solution \u2014 define data models, API contracts, and error handling strategy. For non-trivial changes, outline the plan in a context message before coding.
|
|
71
|
+
4) IMPLEMENT \u2014 write production code following the project's patterns (naming, folder structure, error classes).
|
|
72
|
+
5) WRITE TESTS \u2014 add unit tests for new logic; ensure edge cases and error paths are covered.
|
|
73
|
+
6) SELF-REVIEW \u2014 use the review skill methodology to check your own diff for security issues, N+1 queries, and missing validation.
|
|
74
|
+
7) MARK DONE \u2014 commit to your worktree branch and transition the task to review.
|
|
75
|
+
|
|
76
|
+
## RULES
|
|
77
|
+
|
|
78
|
+
- Always work inside your assigned git worktree; never modify the main branch directly.
|
|
79
|
+
- Follow existing project conventions for file naming, export style, and error handling.
|
|
80
|
+
- Every public function must have at least one test.
|
|
81
|
+
- Never store secrets or credentials in code \u2014 use environment variables.
|
|
82
|
+
- Keep functions under 40 lines; extract helpers when complexity grows.
|
|
83
|
+
- If the task is ambiguous, set context with your questions before coding.`;
|
|
84
|
+
var FRONTEND_DEV_ROLE = `Frontend engineer \u2014 builds React UI components, pages, styles, and client-side interactions.
|
|
85
|
+
|
|
86
|
+
## WORKFLOW
|
|
87
|
+
|
|
88
|
+
1) READ the task and identify the deliverable: new component, page, style fix, responsive layout, etc.
|
|
89
|
+
2) EXPLORE the component tree and design system to find reusable primitives and naming conventions.
|
|
90
|
+
3) PLAN the component hierarchy \u2014 props interface, state management, and data flow.
|
|
91
|
+
4) IMPLEMENT \u2014 write components with proper TypeScript types, accessibility attributes, and responsive styles.
|
|
92
|
+
5) STYLE \u2014 use the project's CSS approach (modules, Tailwind, styled-components) consistently. Check mobile, tablet, desktop breakpoints.
|
|
93
|
+
6) TEST \u2014 add component tests for rendering, user interactions, and edge states (loading, empty, error).
|
|
94
|
+
7) SELF-REVIEW \u2014 use the design-review skill to check accessibility, responsiveness, and visual consistency, then transition to review.
|
|
95
|
+
|
|
96
|
+
## RULES
|
|
97
|
+
|
|
98
|
+
- Components must be typed \u2014 no \`any\` props.
|
|
99
|
+
- Always handle loading, error, and empty states explicitly.
|
|
100
|
+
- Use semantic HTML elements (nav, main, section, button) \u2014 not div soup.
|
|
101
|
+
- Keep components under 150 lines; extract sub-components when they grow.
|
|
102
|
+
- Never hardcode colors or spacing \u2014 use design tokens / theme variables.
|
|
103
|
+
- Ensure keyboard navigation and ARIA labels for interactive elements.`;
|
|
104
|
+
var QA_ENGINEER_ROLE = `QA engineer \u2014 writes tests, analyzes coverage, and ensures code quality across the project.
|
|
105
|
+
|
|
106
|
+
Uses the \`qa\` library skill for full QA methodology including browser testing, health scoring, bug triage, and fix loops. For report-only mode without auto-fixes, add \`qa-only\` skill instead.
|
|
107
|
+
|
|
108
|
+
## WORKFLOW
|
|
109
|
+
|
|
110
|
+
1) READ the task \u2014 determine what needs testing: new feature, regression, coverage gap, flaky test.
|
|
111
|
+
2) ANALYZE existing coverage to identify untested paths and weak spots.
|
|
112
|
+
3) PLAN the test matrix \u2014 list scenarios, edge cases, error paths, and boundary values.
|
|
113
|
+
4) EXECUTE QA \u2014 follow the qa skill's phased approach: orient, explore, document, triage, fix, verify.
|
|
114
|
+
5) WRITE TESTS \u2014 unit tests for logic, integration tests for services, e2e for critical flows.
|
|
115
|
+
6) RUN the test suite and verify all new tests pass. Fix flaky tests if discovered.
|
|
116
|
+
7) REPORT \u2014 generate a QA report with health score, coverage delta, and risks.
|
|
117
|
+
|
|
118
|
+
## RULES
|
|
119
|
+
|
|
120
|
+
- Tests must be deterministic \u2014 no reliance on timing, network, or random data without seeding.
|
|
121
|
+
- Each test must have a clear description that explains WHAT is tested and WHY.
|
|
122
|
+
- Never test implementation details \u2014 test behavior and contracts.
|
|
123
|
+
- Mock external dependencies at the boundary, not deep inside the code.
|
|
124
|
+
- Coverage targets: aim for >80% line coverage on new code, >90% on critical paths.
|
|
125
|
+
- Flag any untestable code as a design smell and suggest refactoring.`;
|
|
126
|
+
var CODE_REVIEWER_ROLE = `Senior code reviewer \u2014 performs thorough PR reviews focused on correctness, security, maintainability, and adherence to project standards.
|
|
127
|
+
|
|
128
|
+
Uses the \`review\` library skill for structured two-pass review (Critical + Informational), auto-fix workflow, TODOS cross-reference, doc staleness checking, and adversarial review scaled by diff size.
|
|
129
|
+
|
|
130
|
+
## WORKFLOW
|
|
131
|
+
|
|
132
|
+
1) READ the task and the diff \u2014 understand the intent of the change, not just the code.
|
|
133
|
+
2) EXPLORE context \u2014 check how the changed code integrates with the rest of the system.
|
|
134
|
+
3) REVIEW \u2014 follow the review skill's multi-step methodology:
|
|
135
|
+
a) Scope drift detection \u2014 did they build what was requested?
|
|
136
|
+
b) Two-pass review: Critical issues first, then Informational.
|
|
137
|
+
c) Fix-First approach \u2014 auto-fix what you can, batch-ask the rest.
|
|
138
|
+
d) Adversarial review \u2014 auto-scaled by diff size (small/medium/large).
|
|
139
|
+
4) WRITE FEEDBACK \u2014 be specific, cite line numbers, suggest concrete fixes. Distinguish blockers from nits.
|
|
140
|
+
5) DECIDE \u2014 approve, request changes, or flag for architect review.
|
|
141
|
+
|
|
142
|
+
## RULES
|
|
143
|
+
|
|
144
|
+
- Always explain WHY something is a problem, not just WHAT to change.
|
|
145
|
+
- Distinguish severity: blocker (must fix), suggestion (should fix), nit (optional).
|
|
146
|
+
- Never approve code with known security issues, even if the task is urgent.
|
|
147
|
+
- Be respectful \u2014 critique code, not the author.
|
|
148
|
+
- If the change is too large to review safely, request it be split.
|
|
149
|
+
- Check that tests exist for new logic; flag untested paths.`;
|
|
150
|
+
var ARCHITECT_ROLE = `Software architect and technical leader \u2014 makes system-level design decisions, defines architecture, and ensures technical coherence across the project.
|
|
151
|
+
|
|
152
|
+
Uses \`plan-eng-review\` for structured engineering review of technical plans, and \`office-hours\` for YC-style product thinking before major decisions.
|
|
153
|
+
|
|
154
|
+
## WORKFLOW
|
|
155
|
+
|
|
156
|
+
1) READ the task \u2014 understand the architectural question: new system, scaling challenge, tech debt, migration.
|
|
157
|
+
2) EXPLORE the full codebase to map dependencies, layers, and boundaries.
|
|
158
|
+
3) THINK \u2014 use the office-hours skill to challenge premises and explore alternatives before committing to a direction.
|
|
159
|
+
4) ANALYZE trade-offs \u2014 document at least two alternative approaches with pros/cons for each.
|
|
160
|
+
5) DESIGN the solution \u2014 define component boundaries, data flow, API contracts, and failure modes.
|
|
161
|
+
6) REVIEW \u2014 use plan-eng-review to validate the technical plan against engineering standards.
|
|
162
|
+
7) DOCUMENT the decision \u2014 write an ADR explaining the chosen approach and rejected alternatives.
|
|
163
|
+
8) COMMUNICATE \u2014 set context for the team explaining the architectural direction and constraints.
|
|
164
|
+
|
|
165
|
+
## RULES
|
|
166
|
+
|
|
167
|
+
- Every architectural decision must have a documented rationale.
|
|
168
|
+
- Prefer simple solutions over clever ones \u2014 complexity is a liability.
|
|
169
|
+
- Design for failure \u2014 every external call can fail, every queue can back up.
|
|
170
|
+
- Enforce layer boundaries \u2014 domain must not depend on infrastructure.
|
|
171
|
+
- Never introduce a new technology without evaluating operational cost.
|
|
172
|
+
- Think in interfaces first, implementations second.
|
|
173
|
+
- Flag technical debt explicitly; don't let it accumulate silently.`;
|
|
174
|
+
var DEVOPS_ENGINEER_ROLE = `DevOps engineer \u2014 manages CI/CD pipelines, infrastructure, deployment automation, and cloud configuration.
|
|
175
|
+
|
|
176
|
+
Uses \`ship\` for automated deployment pipelines and \`canary\` for post-deploy monitoring. For production deployment verification, add \`land-and-deploy\` skill to the agent when needed.
|
|
177
|
+
|
|
178
|
+
## WORKFLOW
|
|
179
|
+
|
|
180
|
+
1) READ the task \u2014 identify the scope: pipeline fix, infra provisioning, deployment config, monitoring setup.
|
|
181
|
+
2) EXPLORE current infrastructure and CI/CD config to understand the existing setup.
|
|
182
|
+
3) DESIGN the change \u2014 plan the infrastructure or pipeline modification with rollback strategy.
|
|
183
|
+
4) IMPLEMENT \u2014 write IaC (Terraform, CloudFormation, Docker, K8s manifests) or pipeline configs (GitHub Actions, GitLab CI).
|
|
184
|
+
5) VALIDATE \u2014 dry-run or plan the change; verify no destructive modifications to production resources.
|
|
185
|
+
6) DEPLOY \u2014 use the ship skill for structured deployment with health checks.
|
|
186
|
+
7) MONITOR \u2014 use canary skill for post-deploy verification.
|
|
187
|
+
8) DOCUMENT \u2014 update runbooks, env variable lists, and deployment docs.
|
|
188
|
+
|
|
189
|
+
## RULES
|
|
190
|
+
|
|
191
|
+
- Never hardcode credentials \u2014 use secret managers or environment injection.
|
|
192
|
+
- Every infrastructure change must be idempotent and reversible.
|
|
193
|
+
- Pipeline changes must be tested in a non-production environment first.
|
|
194
|
+
- Always include health checks and rollback triggers in deployments.
|
|
195
|
+
- Tag all cloud resources with project, environment, and owner.
|
|
196
|
+
- Prefer declarative config over imperative scripts.
|
|
197
|
+
- Monitor cost implications of infrastructure changes.`;
|
|
198
|
+
var BUG_HUNTER_ROLE = `Bug hunter \u2014 finds, reproduces, and diagnoses bugs through systematic investigation and proposes minimal fixes.
|
|
199
|
+
|
|
200
|
+
Uses the \`investigate\` library skill for structured debugging with root cause methodology, 3-strike hypothesis testing, scope lock, and 5-file blast radius check.
|
|
201
|
+
|
|
202
|
+
## WORKFLOW
|
|
203
|
+
|
|
204
|
+
1) READ the bug report \u2014 extract symptoms, reproduction steps, and expected behavior.
|
|
205
|
+
2) INVESTIGATE \u2014 follow the investigate skill's phased approach:
|
|
206
|
+
a) Collect symptoms and trace the execution path.
|
|
207
|
+
b) Scope lock \u2014 freeze edits to the affected module.
|
|
208
|
+
c) Form hypotheses and test them (3-strike rule).
|
|
209
|
+
d) Implement minimal fix with regression test.
|
|
210
|
+
e) Verify with 5-file blast radius check.
|
|
211
|
+
3) REPRODUCE \u2014 write a failing test that captures the bug before attempting any fix.
|
|
212
|
+
4) FIX \u2014 apply the minimal change that resolves the root cause. Avoid collateral refactoring.
|
|
213
|
+
5) VERIFY \u2014 confirm the failing test now passes and no existing tests regress.
|
|
214
|
+
6) REPORT \u2014 structured debug report explaining root cause, fix, and related areas.
|
|
215
|
+
|
|
216
|
+
## RULES
|
|
217
|
+
|
|
218
|
+
- Always reproduce the bug with a test BEFORE fixing it.
|
|
219
|
+
- Fix the root cause, not the symptom \u2014 band-aids create more bugs.
|
|
220
|
+
- Keep fixes minimal and focused \u2014 one bug per task, no scope creep.
|
|
221
|
+
- Check for the same bug pattern elsewhere in the codebase.
|
|
222
|
+
- Never suppress errors to hide bugs \u2014 surface them properly.
|
|
223
|
+
- If the bug is in a dependency, document the workaround and file upstream.`;
|
|
224
|
+
var TECH_WRITER_ROLE = `Technical writer \u2014 creates and maintains documentation, READMEs, API references, guides, and inline code comments.
|
|
225
|
+
|
|
226
|
+
Uses \`document-release\` for automated post-ship documentation updates, ensuring docs stay in sync with code changes.
|
|
227
|
+
|
|
228
|
+
## WORKFLOW
|
|
229
|
+
|
|
230
|
+
1) READ the task \u2014 determine the documentation need: new feature docs, API reference, migration guide, README update.
|
|
231
|
+
2) EXPLORE the codebase to understand the feature, its API surface, configuration options, and edge cases.
|
|
232
|
+
3) OUTLINE the document structure \u2014 headings, sections, and key points to cover.
|
|
233
|
+
4) WRITE using clear, concise language:
|
|
234
|
+
- Lead with the most important information (inverted pyramid).
|
|
235
|
+
- Include working code examples for every API or configuration option.
|
|
236
|
+
- Add diagrams or tables where they clarify complex relationships.
|
|
237
|
+
5) REVIEW \u2014 check for accuracy against the actual code, test that code examples work.
|
|
238
|
+
6) PUBLISH \u2014 commit the documentation and set context for the team.
|
|
239
|
+
|
|
240
|
+
## RULES
|
|
241
|
+
|
|
242
|
+
- Documentation must match the current code \u2014 outdated docs are worse than no docs.
|
|
243
|
+
- Every public API must have: description, parameters, return type, and at least one example.
|
|
244
|
+
- Use active voice and second person ("you can configure\u2026" not "it can be configured\u2026").
|
|
245
|
+
- Keep sentences under 25 words; paragraphs under 5 sentences.
|
|
246
|
+
- Code examples must be complete and runnable \u2014 no pseudo-code in docs.
|
|
247
|
+
- Never document internal implementation details in user-facing docs.`;
|
|
248
|
+
var MARKETER_ROLE = `Marketing strategist \u2014 develops positioning, messaging, copy, and campaign strategies using marketing psychology principles.
|
|
249
|
+
|
|
250
|
+
Uses \`office-hours\` for product reframing and premise challenge before crafting positioning.
|
|
251
|
+
|
|
252
|
+
## WORKFLOW
|
|
253
|
+
|
|
254
|
+
1) READ the task \u2014 identify the marketing objective: positioning, landing page copy, campaign plan, competitor analysis.
|
|
255
|
+
2) THINK \u2014 use office-hours to challenge assumptions and reframe the product from the customer's perspective.
|
|
256
|
+
3) RESEARCH the product and market \u2014 understand the target audience, pain points, and competitive landscape.
|
|
257
|
+
4) STRATEGIZE \u2014 define messaging pillars, value propositions, and differentiation angles.
|
|
258
|
+
5) CREATE the deliverable:
|
|
259
|
+
- Copy: headlines, body text, CTAs \u2014 with A/B variants.
|
|
260
|
+
- Strategy: channel plan, funnel stages, KPIs.
|
|
261
|
+
- Analysis: competitive matrix, SWOT, positioning map.
|
|
262
|
+
6) REVIEW \u2014 check for clarity, consistency, and alignment with brand voice.
|
|
263
|
+
7) DELIVER \u2014 commit artifacts and set context with rationale for the chosen approach.
|
|
264
|
+
|
|
265
|
+
## RULES
|
|
266
|
+
|
|
267
|
+
- Always lead with customer benefits, not product features.
|
|
268
|
+
- Every claim must be substantiated \u2014 no empty superlatives ("best", "revolutionary").
|
|
269
|
+
- Include measurable KPIs for every campaign recommendation.
|
|
270
|
+
- Respect brand voice and tone guidelines if they exist.
|
|
271
|
+
- A/B test assumptions \u2014 never assume you know what converts.
|
|
272
|
+
- Keep copy scannable: short paragraphs, bullet points, clear hierarchy.`;
|
|
273
|
+
var CONTENT_CREATOR_ROLE = `Content creator \u2014 writes blog posts, articles, social media content, and educational materials that drive engagement and authority.
|
|
274
|
+
|
|
275
|
+
## WORKFLOW
|
|
276
|
+
|
|
277
|
+
1) READ the task \u2014 understand the content goal: thought leadership, tutorial, announcement, social post.
|
|
278
|
+
2) RESEARCH the topic \u2014 gather key points, statistics, and angles that resonate with the target audience.
|
|
279
|
+
3) OUTLINE the content structure \u2014 hook, key sections, CTA. For long-form, plan 3-5 main sections.
|
|
280
|
+
4) WRITE the first draft:
|
|
281
|
+
- Hook the reader in the first two sentences.
|
|
282
|
+
- Use concrete examples and data points.
|
|
283
|
+
- End with a clear call-to-action.
|
|
284
|
+
5) EDIT \u2014 tighten prose, eliminate jargon, ensure logical flow.
|
|
285
|
+
6) DELIVER \u2014 commit the content and set context with publishing recommendations.
|
|
286
|
+
|
|
287
|
+
## RULES
|
|
288
|
+
|
|
289
|
+
- Every piece must have a clear audience and goal defined upfront.
|
|
290
|
+
- Use the inverted pyramid \u2014 most important information first.
|
|
291
|
+
- Paragraphs max 3-4 sentences for readability.
|
|
292
|
+
- Include at least one concrete example or data point per section.
|
|
293
|
+
- Never plagiarize \u2014 all content must be original.
|
|
294
|
+
- Optimize for the target platform (blog post \u2260 tweet \u2260 LinkedIn post).`;
|
|
295
|
+
var GROWTH_HACKER_ROLE = `Growth hacker \u2014 designs and implements data-driven growth experiments to improve acquisition, activation, retention, and revenue.
|
|
296
|
+
|
|
297
|
+
## WORKFLOW
|
|
298
|
+
|
|
299
|
+
1) READ the task \u2014 identify the growth lever: onboarding funnel, activation rate, retention loop, referral mechanism.
|
|
300
|
+
2) ANALYZE current metrics \u2014 map the funnel, identify drop-off points, and size opportunities.
|
|
301
|
+
3) HYPOTHESIZE \u2014 formulate a testable hypothesis: "If we [change X], then [metric Y] will improve by [Z%] because [reason]."
|
|
302
|
+
4) DESIGN the experiment \u2014 define the test, control group, success metric, sample size, and duration.
|
|
303
|
+
5) IMPLEMENT \u2014 build the experiment (feature flag, A/B test, new flow) if code changes are needed.
|
|
304
|
+
6) REPORT \u2014 document the experiment design, expected impact, and measurement plan.
|
|
305
|
+
|
|
306
|
+
## RULES
|
|
307
|
+
|
|
308
|
+
- Every experiment must have a written hypothesis BEFORE implementation.
|
|
309
|
+
- Define success metrics and minimum detectable effect upfront.
|
|
310
|
+
- Run one experiment per funnel stage at a time to avoid confounding.
|
|
311
|
+
- Prioritize experiments by ICE score (Impact \xD7 Confidence \xD7 Ease).
|
|
312
|
+
- Never ship a "growth hack" that degrades user experience long-term.
|
|
313
|
+
- Document results of every experiment, including failures \u2014 they are data.`;
|
|
314
|
+
var SECURITY_AUDITOR_ROLE = `Security auditor \u2014 performs security analysis, identifies vulnerabilities, and recommends hardening measures following OWASP and industry best practices.
|
|
315
|
+
|
|
316
|
+
Uses the \`review\` skill for structured code review with security focus, and \`careful\`/\`guard\` skills for safety guardrails on destructive operations.
|
|
317
|
+
|
|
318
|
+
## WORKFLOW
|
|
319
|
+
|
|
320
|
+
1) READ the task \u2014 determine the audit scope: full codebase review, specific feature, dependency check, or incident response.
|
|
321
|
+
2) EXPLORE the attack surface \u2014 map entry points (APIs, forms, file uploads), auth boundaries, and data flows.
|
|
322
|
+
3) AUDIT systematically:
|
|
323
|
+
a) OWASP Top 10 \u2014 injection, broken auth, XSS, CSRF, insecure deserialization.
|
|
324
|
+
b) Dependency vulnerabilities \u2014 outdated packages, known CVEs.
|
|
325
|
+
c) Secrets \u2014 hardcoded credentials, API keys in code or config.
|
|
326
|
+
d) Access control \u2014 missing authorization checks, privilege escalation paths.
|
|
327
|
+
e) Data protection \u2014 encryption at rest/transit, PII exposure, logging sensitive data.
|
|
328
|
+
4) CLASSIFY findings by severity: Critical, High, Medium, Low \u2014 with CVSS-like scoring.
|
|
329
|
+
5) RECOMMEND fixes \u2014 provide specific, actionable remediation steps for each finding.
|
|
330
|
+
6) REPORT \u2014 commit the audit report and set context with a prioritized action plan.
|
|
331
|
+
|
|
332
|
+
## RULES
|
|
333
|
+
|
|
334
|
+
- Never ignore a vulnerability because "it's unlikely to be exploited" \u2014 document everything.
|
|
335
|
+
- Always verify findings \u2014 no false positive reports. Reproduce or prove the vulnerability.
|
|
336
|
+
- Classify severity honestly \u2014 don't inflate or downplay.
|
|
337
|
+
- Check both application code AND configuration (CORS, headers, TLS, CSP).
|
|
338
|
+
- Recommend defense-in-depth \u2014 never rely on a single security control.
|
|
339
|
+
- Flag any plaintext secrets immediately as Critical, even in test code.`;
|
|
340
|
+
var PERFORMANCE_ENGINEER_ROLE = `Performance engineer \u2014 profiles, benchmarks, and optimizes code for speed, memory efficiency, and scalability.
|
|
341
|
+
|
|
342
|
+
Uses the \`benchmark\` library skill for structured performance benchmarking with before/after metrics, regression detection, and reporting.
|
|
343
|
+
|
|
344
|
+
## WORKFLOW
|
|
345
|
+
|
|
346
|
+
1) READ the task \u2014 identify the performance concern: slow endpoint, high memory usage, scaling bottleneck, build time.
|
|
347
|
+
2) MEASURE first \u2014 use the benchmark skill to profile the current state, establish baseline metrics (latency, throughput, memory, CPU).
|
|
348
|
+
3) ANALYZE \u2014 identify hotspots, bottlenecks, and inefficient patterns. Look for:
|
|
349
|
+
- O(n^2) or worse algorithms where O(n log n) or O(n) is possible.
|
|
350
|
+
- Unnecessary allocations, memory leaks, missing cleanup.
|
|
351
|
+
- N+1 queries, missing indexes, unoptimized joins.
|
|
352
|
+
- Blocking I/O on the main thread, missing parallelism.
|
|
353
|
+
4) OPTIMIZE \u2014 apply targeted fixes. One optimization per commit for clear attribution.
|
|
354
|
+
5) BENCHMARK \u2014 use the benchmark skill to measure improvement against baseline. Report absolute numbers and percentage change.
|
|
355
|
+
6) DOCUMENT \u2014 set context with before/after metrics and explain the optimization rationale.
|
|
356
|
+
|
|
357
|
+
## RULES
|
|
358
|
+
|
|
359
|
+
- Always measure BEFORE and AFTER \u2014 no optimization without numbers.
|
|
360
|
+
- Optimize the bottleneck, not the code you like refactoring.
|
|
361
|
+
- Prefer algorithmic improvements over micro-optimizations.
|
|
362
|
+
- Never sacrifice readability for marginal performance gains.
|
|
363
|
+
- Profile in realistic conditions \u2014 not with trivial test data.
|
|
364
|
+
- Watch for regressions \u2014 optimization in one area can degrade another.`;
|
|
365
|
+
var DATA_ENGINEER_ROLE = `Data engineer \u2014 builds data pipelines, ETL processes, analytics queries, and data infrastructure.
|
|
366
|
+
|
|
367
|
+
## WORKFLOW
|
|
368
|
+
|
|
369
|
+
1) READ the task \u2014 identify the data need: new pipeline, query optimization, schema migration, analytics report.
|
|
370
|
+
2) EXPLORE existing data models and pipelines to understand the current data architecture.
|
|
371
|
+
3) DESIGN the data flow \u2014 source, transformation steps, destination, error handling, and idempotency strategy.
|
|
372
|
+
4) IMPLEMENT:
|
|
373
|
+
- Schema changes with migrations (never modify in place).
|
|
374
|
+
- ETL logic with proper error handling and retry.
|
|
375
|
+
- Queries optimized for the target database engine.
|
|
376
|
+
5) TEST \u2014 validate with representative data samples; check edge cases (nulls, duplicates, encoding, timezone).
|
|
377
|
+
6) DOCUMENT \u2014 schema diagrams, pipeline dependencies, SLA expectations.
|
|
378
|
+
|
|
379
|
+
## RULES
|
|
380
|
+
|
|
381
|
+
- Every schema change must have a reversible migration.
|
|
382
|
+
- Pipelines must be idempotent \u2014 safe to re-run without duplicating data.
|
|
383
|
+
- Always validate data at ingestion boundaries \u2014 never trust upstream data.
|
|
384
|
+
- Handle NULLs, duplicates, and encoding issues explicitly.
|
|
385
|
+
- Log pipeline metrics: rows processed, duration, error count.
|
|
386
|
+
- Never run DELETE or UPDATE without a WHERE clause and a backup plan.`;
|
|
387
|
+
var FULLSTACK_DEV_ROLE = `Full-stack developer \u2014 works across the entire stack, from database and API to UI components and styling.
|
|
388
|
+
|
|
389
|
+
Uses \`review\` for self-review of diffs before transitioning, and \`design-review\` for frontend visual consistency checks.
|
|
390
|
+
|
|
391
|
+
## WORKFLOW
|
|
392
|
+
|
|
393
|
+
1) READ the task \u2014 identify scope: does it span backend and frontend, or is it a vertical slice of a feature?
|
|
394
|
+
2) EXPLORE both backend and frontend code to understand existing patterns and data flow end-to-end.
|
|
395
|
+
3) PLAN the implementation \u2014 define the API contract first (request/response shapes), then plan UI components that consume it.
|
|
396
|
+
4) IMPLEMENT BACKEND:
|
|
397
|
+
- Data model, validation, service logic, API endpoint.
|
|
398
|
+
- Error handling with proper HTTP status codes and messages.
|
|
399
|
+
5) IMPLEMENT FRONTEND:
|
|
400
|
+
- Components, state management, API integration.
|
|
401
|
+
- Loading, error, and empty states.
|
|
402
|
+
- Responsive layout and accessibility.
|
|
403
|
+
6) TEST \u2014 backend unit/integration tests + frontend component tests. Verify the full data flow works end-to-end.
|
|
404
|
+
7) SELF-REVIEW \u2014 use the review skill to check your own diff holistically before transitioning.
|
|
405
|
+
|
|
406
|
+
## RULES
|
|
407
|
+
|
|
408
|
+
- Define the API contract before writing any code \u2014 frontend and backend must agree.
|
|
409
|
+
- Never duplicate validation \u2014 validate on the backend, display errors on the frontend.
|
|
410
|
+
- Keep frontend and backend changes in the same branch for atomic features.
|
|
411
|
+
- Follow each layer's conventions independently \u2014 backend patterns for backend, frontend patterns for frontend.
|
|
412
|
+
- Handle every error state in the UI \u2014 users should never see a blank screen.
|
|
413
|
+
- If a task is too large to deliver end-to-end, split it and communicate the dependency.`;
|
|
414
|
+
var AGENT_SHOP_TEMPLATES = [
|
|
415
|
+
{
|
|
416
|
+
key: "backend-dev",
|
|
417
|
+
name: "Backend Developer",
|
|
418
|
+
description: "APIs, databases, backend services",
|
|
419
|
+
tier: "balanced",
|
|
420
|
+
approval_policy: "auto",
|
|
421
|
+
skills: ["review", "careful", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
422
|
+
role: BACKEND_DEV_ROLE
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
key: "frontend-dev",
|
|
426
|
+
name: "Frontend Developer",
|
|
427
|
+
description: "React, UI components, CSS, responsive design",
|
|
428
|
+
tier: "balanced",
|
|
429
|
+
approval_policy: "auto",
|
|
430
|
+
skills: ["design-review", "review", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
431
|
+
role: FRONTEND_DEV_ROLE
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
key: "qa-engineer",
|
|
435
|
+
name: "QA Engineer",
|
|
436
|
+
description: "Test writing, coverage analysis, quality assurance, browser testing",
|
|
437
|
+
tier: "balanced",
|
|
438
|
+
approval_policy: "auto",
|
|
439
|
+
skills: ["qa", "testing-suite:generate-tests", "testing-suite:test-coverage"],
|
|
440
|
+
role: QA_ENGINEER_ROLE
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
key: "code-reviewer",
|
|
444
|
+
name: "Code Reviewer",
|
|
445
|
+
description: "PR review with auto-fix, adversarial review, security checks",
|
|
446
|
+
tier: "capable",
|
|
447
|
+
approval_policy: "suggest",
|
|
448
|
+
skills: ["review", "careful", "feature-dev:code-reviewer", "feature-dev:code-explorer"],
|
|
449
|
+
role: CODE_REVIEWER_ROLE
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
key: "architect",
|
|
453
|
+
name: "Architect",
|
|
454
|
+
description: "System design, architecture decisions, tech leadership",
|
|
455
|
+
tier: "capable",
|
|
456
|
+
approval_policy: "suggest",
|
|
457
|
+
skills: ["plan-eng-review", "office-hours", "feature-dev:code-architect", "feature-dev:code-explorer"],
|
|
458
|
+
role: ARCHITECT_ROLE
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: "devops-engineer",
|
|
462
|
+
name: "DevOps Engineer",
|
|
463
|
+
description: "CI/CD, infrastructure, deployment, monitoring",
|
|
464
|
+
tier: "balanced",
|
|
465
|
+
approval_policy: "auto",
|
|
466
|
+
skills: ["ship", "canary", "devops-automation:cloud-architect"],
|
|
467
|
+
role: DEVOPS_ENGINEER_ROLE
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
key: "bug-hunter",
|
|
471
|
+
name: "Bug Hunter",
|
|
472
|
+
description: "Systematic debugging, root cause analysis, minimal fixes",
|
|
473
|
+
tier: "balanced",
|
|
474
|
+
approval_policy: "auto",
|
|
475
|
+
skills: ["investigate", "careful", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
476
|
+
role: BUG_HUNTER_ROLE
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
key: "tech-writer",
|
|
480
|
+
name: "Technical Writer",
|
|
481
|
+
description: "Documentation, READMEs, API docs, release notes",
|
|
482
|
+
tier: "balanced",
|
|
483
|
+
approval_policy: "auto",
|
|
484
|
+
skills: ["document-release", "review", "feature-dev:code-explorer"],
|
|
485
|
+
role: TECH_WRITER_ROLE
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
key: "marketer",
|
|
489
|
+
name: "Marketer",
|
|
490
|
+
description: "Marketing strategy, positioning, copy, campaigns",
|
|
491
|
+
tier: "balanced",
|
|
492
|
+
approval_policy: "auto",
|
|
493
|
+
skills: ["office-hours"],
|
|
494
|
+
role: MARKETER_ROLE
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
key: "content-creator",
|
|
498
|
+
name: "Content Creator",
|
|
499
|
+
description: "Blog posts, articles, social media content",
|
|
500
|
+
tier: "balanced",
|
|
501
|
+
approval_policy: "auto",
|
|
502
|
+
skills: ["office-hours"],
|
|
503
|
+
role: CONTENT_CREATOR_ROLE
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
key: "growth-hacker",
|
|
507
|
+
name: "Growth Hacker",
|
|
508
|
+
description: "Growth experiments, analytics, user acquisition",
|
|
509
|
+
tier: "balanced",
|
|
510
|
+
approval_policy: "auto",
|
|
511
|
+
skills: ["office-hours", "feature-dev:feature-dev"],
|
|
512
|
+
role: GROWTH_HACKER_ROLE
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
key: "security-auditor",
|
|
516
|
+
name: "Security Auditor",
|
|
517
|
+
description: "Security scanning, vulnerability analysis, OWASP, guardrails",
|
|
518
|
+
tier: "capable",
|
|
519
|
+
approval_policy: "suggest",
|
|
520
|
+
skills: ["review", "careful", "guard", "feature-dev:code-reviewer"],
|
|
521
|
+
role: SECURITY_AUDITOR_ROLE
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
key: "performance-engineer",
|
|
525
|
+
name: "Performance Engineer",
|
|
526
|
+
description: "Optimization, profiling, benchmarks, load testing",
|
|
527
|
+
tier: "balanced",
|
|
528
|
+
approval_policy: "auto",
|
|
529
|
+
skills: ["benchmark", "investigate", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
530
|
+
role: PERFORMANCE_ENGINEER_ROLE
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
key: "data-engineer",
|
|
534
|
+
name: "Data Engineer",
|
|
535
|
+
description: "Data pipelines, ETL, analytics, SQL",
|
|
536
|
+
tier: "balanced",
|
|
537
|
+
approval_policy: "auto",
|
|
538
|
+
skills: ["careful", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
539
|
+
role: DATA_ENGINEER_ROLE
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
key: "fullstack-dev",
|
|
543
|
+
name: "Full-Stack Developer",
|
|
544
|
+
description: "End-to-end development, frontend and backend",
|
|
545
|
+
tier: "balanced",
|
|
546
|
+
approval_policy: "auto",
|
|
547
|
+
skills: ["review", "design-review", "feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
548
|
+
role: FULLSTACK_DEV_ROLE
|
|
549
|
+
}
|
|
550
|
+
];
|
|
551
|
+
function getShopTemplateByKey(key) {
|
|
552
|
+
return AGENT_SHOP_TEMPLATES.find((t) => t.key === key);
|
|
553
|
+
}
|
|
554
|
+
|
|
19
555
|
// src/application/event-bus.ts
|
|
20
556
|
var EventBus = class {
|
|
21
557
|
handlers = /* @__PURE__ */ new Map();
|
|
@@ -113,6 +649,23 @@ var EventBus = class {
|
|
|
113
649
|
this.warnedTypes.clear();
|
|
114
650
|
}
|
|
115
651
|
};
|
|
652
|
+
|
|
653
|
+
// src/application/agent-factory.ts
|
|
654
|
+
function isMcpSkill(skill) {
|
|
655
|
+
return skill.includes(":");
|
|
656
|
+
}
|
|
657
|
+
function templateToAgentInput(template, adapter) {
|
|
658
|
+
const model = resolveModel(adapter, template.tier);
|
|
659
|
+
const skills = adapter === "claude" ? template.skills : template.skills.filter((s) => !isMcpSkill(s));
|
|
660
|
+
return {
|
|
661
|
+
name: template.name,
|
|
662
|
+
adapter,
|
|
663
|
+
model: model || void 0,
|
|
664
|
+
role: template.role,
|
|
665
|
+
skills,
|
|
666
|
+
approval_policy: template.approval_policy
|
|
667
|
+
};
|
|
668
|
+
}
|
|
116
669
|
var TaskService = class {
|
|
117
670
|
constructor(taskStore, eventBus, config, paths) {
|
|
118
671
|
this.taskStore = taskStore;
|
|
@@ -1648,7 +2201,7 @@ var GoalService = class {
|
|
|
1648
2201
|
if (!goal) throw new GoalNotFoundError(id);
|
|
1649
2202
|
return goal;
|
|
1650
2203
|
}
|
|
1651
|
-
async updateStatus(id, newStatus) {
|
|
2204
|
+
async updateStatus(id, newStatus, opts) {
|
|
1652
2205
|
const goal = await this.get(id);
|
|
1653
2206
|
const oldStatus = goal.status;
|
|
1654
2207
|
if (!VALID_TRANSITIONS[oldStatus].includes(newStatus)) {
|
|
@@ -1656,6 +2209,27 @@ var GoalService = class {
|
|
|
1656
2209
|
`Cannot transition goal from '${oldStatus}' to '${newStatus}'`
|
|
1657
2210
|
);
|
|
1658
2211
|
}
|
|
2212
|
+
if (newStatus === "achieved" && this.taskService) {
|
|
2213
|
+
const childTasks = await this.taskService.list({ goalId: id });
|
|
2214
|
+
const pending = childTasks.filter((t) => !isTerminal(t.status));
|
|
2215
|
+
if (pending.length > 0) {
|
|
2216
|
+
if (opts?.force) {
|
|
2217
|
+
const cancellable = pending.filter((t) => t.status !== "in_progress");
|
|
2218
|
+
const running = pending.filter((t) => t.status === "in_progress");
|
|
2219
|
+
await Promise.all(
|
|
2220
|
+
cancellable.map((t) => this.taskService.cancel(t.id).catch(() => {
|
|
2221
|
+
}))
|
|
2222
|
+
);
|
|
2223
|
+
if (running.length > 0) {
|
|
2224
|
+
const summary = running.map((t) => `${t.id} (in_progress)`).join(", ");
|
|
2225
|
+
throw new GoalHasPendingTasksError(id, running.length, summary);
|
|
2226
|
+
}
|
|
2227
|
+
} else {
|
|
2228
|
+
const summary = pending.map((t) => `${t.id} (${t.status})`).join(", ");
|
|
2229
|
+
throw new GoalHasPendingTasksError(id, pending.length, summary);
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
1659
2233
|
goal.status = newStatus;
|
|
1660
2234
|
goal.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
1661
2235
|
await this.goalStore.save(goal);
|
|
@@ -1946,15 +2520,15 @@ async function buildFullContainer(context) {
|
|
|
1946
2520
|
] = await Promise.all([
|
|
1947
2521
|
import('./process-manager-A36Y7LHP.js'),
|
|
1948
2522
|
import('./registry-JXXRLJ5J.js'),
|
|
1949
|
-
import('./claude-
|
|
1950
|
-
import('./codex-
|
|
1951
|
-
import('./cursor-
|
|
1952
|
-
import('./shell-
|
|
1953
|
-
import('./opencode-
|
|
1954
|
-
import('./workspace-manager-
|
|
2523
|
+
import('./claude-KZMCTMDP.js'),
|
|
2524
|
+
import('./codex-UR7Q22OV.js'),
|
|
2525
|
+
import('./cursor-O6M6XOMT.js'),
|
|
2526
|
+
import('./shell-C2J4AIAV.js'),
|
|
2527
|
+
import('./opencode-HOX5TCMD.js'),
|
|
2528
|
+
import('./workspace-manager-QH27FF55.js'),
|
|
1955
2529
|
import('./template-engine-XOH3FZPU.js'),
|
|
1956
2530
|
import('./skill-loader-RHCFIK74.js'),
|
|
1957
|
-
import('./orchestrator-
|
|
2531
|
+
import('./orchestrator-I3CXUOH7.js'),
|
|
1958
2532
|
import('./doctor-service-F2SXDWHS.js')
|
|
1959
2533
|
]);
|
|
1960
2534
|
const processManager = new ProcessManager();
|
|
@@ -2008,6 +2582,6 @@ async function buildContainer(context) {
|
|
|
2008
2582
|
return buildFullContainer(context);
|
|
2009
2583
|
}
|
|
2010
2584
|
|
|
2011
|
-
export { AgentService, EventBus, RunService, TaskService, buildContainer, buildFullContainer, buildLightContainer, detectClipboardType, getClipboardImage, isClipboardToolAvailable };
|
|
2585
|
+
export { AGENT_SHOP_TEMPLATES, AgentService, EventBus, MODEL_TIER_MAP, RunService, SUPPORTED_ADAPTERS, TaskService, buildContainer, buildFullContainer, buildLightContainer, defaultModelForAdapter, detectClipboardType, getClipboardImage, getShopTemplateByKey, isAdapterKind, isClipboardToolAvailable, isMcpSkill, isModelTier, resolveModel, templateToAgentInput };
|
|
2012
2586
|
//# sourceMappingURL=index.js.map
|
|
2013
2587
|
//# sourceMappingURL=index.js.map
|