@oxgeneral/orch 1.0.1 → 1.0.3
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-A5TZETZ2.js +21 -0
- package/dist/agent-Q34L27AY.js +9 -0
- package/dist/agent-shop-D2RS4BZK.js +2 -0
- package/dist/chunk-4MMHVHA6.js +112 -0
- package/dist/chunk-64WUDYEM.js +6 -0
- package/dist/chunk-6MJ7V6VY.js +2 -0
- package/dist/{chunk-DAVHOWGD.js → chunk-BCPUTULS.js} +16 -188
- package/dist/{chunk-UIJYU3J7.js → chunk-BSJVYRI3.js} +5 -2
- package/dist/chunk-BSJVYRI3.js.map +1 -0
- package/dist/chunk-CDFA4IIQ.js +2 -0
- package/dist/chunk-CHRW4CLD.js +2 -0
- package/dist/{chunk-O2OQCSBL.js → chunk-FDSFFFMT.js} +46 -29
- package/dist/chunk-FDSFFFMT.js.map +1 -0
- package/dist/chunk-HMMPM7MF.js +3 -0
- package/dist/chunk-HXOMNULD.js +2 -0
- package/dist/chunk-IKNBPOQL.js +2 -0
- package/dist/chunk-KFQTWMZI.js +3 -0
- package/dist/chunk-LXNRCJ22.js +2 -0
- package/dist/{chunk-C6XZ3FJT.js → chunk-MOWC2CHX.js} +7 -4
- package/dist/chunk-MOWC2CHX.js.map +1 -0
- package/dist/chunk-P4JTJBWO.js +2 -0
- package/dist/chunk-PJ5DKXGR.js +2 -0
- package/dist/chunk-QNZ6D63E.js +4 -0
- package/dist/chunk-RHFRHCN5.js +16 -0
- package/dist/chunk-RHFRHCN5.js.map +1 -0
- package/dist/chunk-TPTHLFOB.js +2 -0
- package/dist/chunk-UMZEA3JT.js +5 -0
- package/dist/chunk-X54D5JZG.js +11 -0
- package/dist/{claude-WUJU5KIE.js → claude-4R6L6BWY.js} +4 -4
- package/dist/{claude-WUJU5KIE.js.map → claude-4R6L6BWY.js.map} +1 -1
- package/dist/claude-ZLVOLRUG.js +2 -0
- package/dist/cli.js +1 -199
- package/dist/clipboard-service-WVON5ZN4.js +25 -0
- package/dist/{codex-NYJWEPRQ.js → codex-IMOW5ZUZ.js} +4 -4
- package/dist/{codex-NYJWEPRQ.js.map → codex-IMOW5ZUZ.js.map} +1 -1
- package/dist/codex-YRSODLH4.js +2 -0
- package/dist/config-OOB7QEKM.js +2 -0
- package/dist/container-CFMUT5KS.js +4 -0
- package/dist/context-FXRERFSP.js +7 -0
- package/dist/cursor-2HILMNM3.js +2 -0
- package/dist/{cursor-3YHVD4NP.js → cursor-NHV7X3WG.js} +4 -4
- package/dist/{cursor-3YHVD4NP.js.map → cursor-NHV7X3WG.js.map} +1 -1
- package/dist/doctor-GKTV4YYD.js +2 -0
- package/dist/doctor-service-PB7YBH3F.js +2 -0
- package/dist/editor-7IFRWVTL.js +8 -0
- package/dist/goal-RNNZYMNR.js +8 -0
- package/dist/index.d.ts +16 -14
- package/dist/index.js +247 -75
- package/dist/index.js.map +1 -1
- package/dist/init-56QC5QVX.js +53 -0
- package/dist/logs-4ISTWUWV.js +12 -0
- package/dist/msg-4ELI7Q52.js +9 -0
- package/dist/opencode-3S4VDXRG.js +2 -0
- package/dist/{opencode-FAMPSA6X.js → opencode-ULT6DYCT.js} +6 -5
- package/dist/opencode-ULT6DYCT.js.map +1 -0
- package/dist/orchestrator-6XH2TY3T.js +6 -0
- package/dist/{orchestrator-X2CWGFCL.js.map → orchestrator-6XH2TY3T.js.map} +1 -1
- package/dist/orchestrator-DRITPUWT.js +13 -0
- package/dist/org-WAK3CDPG.js +3 -0
- package/dist/process-manager-33H27MQF.js +2 -0
- package/dist/registry-BO2PPRNG.js +2 -0
- package/dist/run-NE5E4JPW.js +3 -0
- package/dist/shell-OBHIVC2H.js +2 -0
- package/dist/{shell-NJNW3O6K.js → shell-UXEJRK3D.js} +4 -4
- package/dist/{shell-NJNW3O6K.js.map → shell-UXEJRK3D.js.map} +1 -1
- package/dist/shop-picker-LE3SKFOX.js +5 -0
- package/dist/status-NYHZ7Q5G.js +2 -0
- package/dist/task-JUS5OZJR.js +20 -0
- package/dist/team-VCJSUDWX.js +4 -0
- package/dist/template-engine-42PKL5KD.js +2 -0
- package/dist/tui-R6LXKKSH.js +2 -0
- package/dist/update-FFKCOV63.js +2 -0
- package/dist/update-check-HGMBDYHL.js +2 -0
- package/dist/{workspace-manager-EVD67GCG.js → workspace-manager-ABXFBL2A.js} +3 -3
- package/dist/{workspace-manager-EVD67GCG.js.map → workspace-manager-ABXFBL2A.js.map} +1 -1
- package/dist/workspace-manager-Q6WWXSTR.js +3 -0
- package/package.json +1 -1
- package/readme.md +5 -5
- package/dist/App-GJVTVGRU.js +0 -6717
- package/dist/agent-7ZJ3ZDJ7.js +0 -183
- package/dist/agent-shop-YN2BSLHM.js +0 -2
- package/dist/chunk-2C2TFQ7K.js +0 -136
- package/dist/chunk-45K2XID7.js +0 -29
- package/dist/chunk-4IFIOMCW.js +0 -86
- package/dist/chunk-7X2GI5OV.js +0 -181
- package/dist/chunk-C6XZ3FJT.js.map +0 -1
- package/dist/chunk-CHIP7O6V.js +0 -83
- package/dist/chunk-FRTKB575.js +0 -87
- package/dist/chunk-HXYAZGLP.js +0 -15
- package/dist/chunk-I3SMISEF.js +0 -29
- package/dist/chunk-K6DMQERQ.js +0 -89
- package/dist/chunk-LV6GDBBI.js +0 -297
- package/dist/chunk-MGGSRXWJ.js +0 -69
- package/dist/chunk-O2OQCSBL.js.map +0 -1
- package/dist/chunk-P6ATSXGL.js +0 -107
- package/dist/chunk-PNE6LQRF.js +0 -5
- package/dist/chunk-U2VDNUZL.js +0 -52
- package/dist/chunk-UIJYU3J7.js.map +0 -1
- package/dist/chunk-VXS2CJFH.js +0 -273
- package/dist/chunk-XDVMX2FO.js +0 -8
- package/dist/chunk-XDVMX2FO.js.map +0 -1
- package/dist/chunk-XJTJ2TJV.js +0 -221
- package/dist/claude-ZUEKJJ4X.js +0 -5
- package/dist/clipboard-service-RTDUUQQU.js +0 -200
- package/dist/codex-7IXXXG5U.js +0 -123
- package/dist/config-OTAVSMOD.js +0 -75
- package/dist/container-RY54L3XC.js +0 -1596
- package/dist/context-OL4BVUV5.js +0 -83
- package/dist/cursor-622RBRHH.js +0 -97
- package/dist/doctor-XSGQSD57.js +0 -67
- package/dist/doctor-service-TPOMFAIG.js +0 -2
- package/dist/goal-FMYYN2FR.js +0 -138
- package/dist/init-45BEMVL6.js +0 -199
- package/dist/logs-PHPYWQ6I.js +0 -207
- package/dist/msg-FUWWLEKM.js +0 -95
- package/dist/opencode-FAMPSA6X.js.map +0 -1
- package/dist/opencode-WOR53TSC.js +0 -98
- package/dist/orchestrator-O6MFMATT.js +0 -1448
- package/dist/orchestrator-X2CWGFCL.js +0 -5
- package/dist/process-manager-HUVNAPQV.js +0 -2
- package/dist/registry-PQWRVNF2.js +0 -2
- package/dist/run-N72G5V2H.js +0 -95
- package/dist/shell-DVFHHYAZ.js +0 -5
- package/dist/shop-picker-2HY67UWP.js +0 -79
- package/dist/status-RZWN2C6C.js +0 -56
- package/dist/task-5EL2RNGW.js +0 -221
- package/dist/team-PFLP4PPL.js +0 -97
- package/dist/template-engine-AWIS56BL.js +0 -3
- package/dist/tui-LN5XHSQY.js +0 -245
- package/dist/update-YLP7FPNY.js +0 -64
- package/dist/update-check-4YKLGBFB.js +0 -2
- package/dist/workspace-manager-JM6U7JOH.js +0 -215
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
var BACKEND_DEV_ROLE = `Backend engineer \u2014 builds APIs, services, database layers, and server-side business logic.
|
|
2
|
+
var n=`Backend engineer \u2014 builds APIs, services, database layers, and server-side business logic.
|
|
4
3
|
|
|
5
4
|
## WORKFLOW
|
|
6
5
|
|
|
@@ -19,8 +18,7 @@ var BACKEND_DEV_ROLE = `Backend engineer \u2014 builds APIs, services, database
|
|
|
19
18
|
- Every public function must have at least one test.
|
|
20
19
|
- Never store secrets or credentials in code \u2014 use environment variables.
|
|
21
20
|
- Keep functions under 40 lines; extract helpers when complexity grows.
|
|
22
|
-
- If the task is ambiguous, set context with your questions before coding
|
|
23
|
-
var FRONTEND_DEV_ROLE = `Frontend engineer \u2014 builds React UI components, pages, styles, and client-side interactions.
|
|
21
|
+
- If the task is ambiguous, set context with your questions before coding.`,a=`Frontend engineer \u2014 builds React UI components, pages, styles, and client-side interactions.
|
|
24
22
|
|
|
25
23
|
## WORKFLOW
|
|
26
24
|
|
|
@@ -39,8 +37,7 @@ var FRONTEND_DEV_ROLE = `Frontend engineer \u2014 builds React UI components, pa
|
|
|
39
37
|
- Use semantic HTML elements (nav, main, section, button) \u2014 not div soup.
|
|
40
38
|
- Keep components under 150 lines; extract sub-components when they grow.
|
|
41
39
|
- Never hardcode colors or spacing \u2014 use design tokens / theme variables.
|
|
42
|
-
- Ensure keyboard navigation and ARIA labels for interactive elements
|
|
43
|
-
var QA_ENGINEER_ROLE = `QA engineer \u2014 writes tests, analyzes coverage, and ensures code quality across the project.
|
|
40
|
+
- Ensure keyboard navigation and ARIA labels for interactive elements.`,i=`QA engineer \u2014 writes tests, analyzes coverage, and ensures code quality across the project.
|
|
44
41
|
|
|
45
42
|
## WORKFLOW
|
|
46
43
|
|
|
@@ -58,8 +55,7 @@ var QA_ENGINEER_ROLE = `QA engineer \u2014 writes tests, analyzes coverage, and
|
|
|
58
55
|
- Never test implementation details \u2014 test behavior and contracts.
|
|
59
56
|
- Mock external dependencies at the boundary, not deep inside the code.
|
|
60
57
|
- Coverage targets: aim for >80% line coverage on new code, >90% on critical paths.
|
|
61
|
-
- Flag any untestable code as a design smell and suggest refactoring
|
|
62
|
-
var CODE_REVIEWER_ROLE = `Senior code reviewer \u2014 performs thorough PR reviews focused on correctness, security, maintainability, and adherence to project standards.
|
|
58
|
+
- Flag any untestable code as a design smell and suggest refactoring.`,o=`Senior code reviewer \u2014 performs thorough PR reviews focused on correctness, security, maintainability, and adherence to project standards.
|
|
63
59
|
|
|
64
60
|
## WORKFLOW
|
|
65
61
|
|
|
@@ -81,8 +77,7 @@ var CODE_REVIEWER_ROLE = `Senior code reviewer \u2014 performs thorough PR revie
|
|
|
81
77
|
- Never approve code with known security issues, even if the task is urgent.
|
|
82
78
|
- Be respectful \u2014 critique code, not the author.
|
|
83
79
|
- If the change is too large to review safely, request it be split.
|
|
84
|
-
- Check that tests exist for new logic; flag untested paths
|
|
85
|
-
var ARCHITECT_ROLE = `Software architect and technical leader \u2014 makes system-level design decisions, defines architecture, and ensures technical coherence across the project.
|
|
80
|
+
- Check that tests exist for new logic; flag untested paths.`,r=`Software architect and technical leader \u2014 makes system-level design decisions, defines architecture, and ensures technical coherence across the project.
|
|
86
81
|
|
|
87
82
|
## WORKFLOW
|
|
88
83
|
|
|
@@ -101,8 +96,7 @@ var ARCHITECT_ROLE = `Software architect and technical leader \u2014 makes syste
|
|
|
101
96
|
- Enforce layer boundaries \u2014 domain must not depend on infrastructure.
|
|
102
97
|
- Never introduce a new technology without evaluating operational cost.
|
|
103
98
|
- Think in interfaces first, implementations second.
|
|
104
|
-
- Flag technical debt explicitly; don't let it accumulate silently
|
|
105
|
-
var DEVOPS_ENGINEER_ROLE = `DevOps engineer \u2014 manages CI/CD pipelines, infrastructure, deployment automation, and cloud configuration.
|
|
99
|
+
- Flag technical debt explicitly; don't let it accumulate silently.`,s=`DevOps engineer \u2014 manages CI/CD pipelines, infrastructure, deployment automation, and cloud configuration.
|
|
106
100
|
|
|
107
101
|
## WORKFLOW
|
|
108
102
|
|
|
@@ -121,8 +115,7 @@ var DEVOPS_ENGINEER_ROLE = `DevOps engineer \u2014 manages CI/CD pipelines, infr
|
|
|
121
115
|
- Always include health checks and rollback triggers in deployments.
|
|
122
116
|
- Tag all cloud resources with project, environment, and owner.
|
|
123
117
|
- Prefer declarative config over imperative scripts.
|
|
124
|
-
- Monitor cost implications of infrastructure changes
|
|
125
|
-
var BUG_HUNTER_ROLE = `Bug hunter \u2014 finds, reproduces, and diagnoses bugs through systematic investigation and proposes minimal fixes.
|
|
118
|
+
- Monitor cost implications of infrastructure changes.`,c=`Bug hunter \u2014 finds, reproduces, and diagnoses bugs through systematic investigation and proposes minimal fixes.
|
|
126
119
|
|
|
127
120
|
## WORKFLOW
|
|
128
121
|
|
|
@@ -141,8 +134,7 @@ var BUG_HUNTER_ROLE = `Bug hunter \u2014 finds, reproduces, and diagnoses bugs t
|
|
|
141
134
|
- Keep fixes minimal and focused \u2014 one bug per task, no scope creep.
|
|
142
135
|
- Check for the same bug pattern elsewhere in the codebase.
|
|
143
136
|
- Never suppress errors to hide bugs \u2014 surface them properly.
|
|
144
|
-
- If the bug is in a dependency, document the workaround and file upstream
|
|
145
|
-
var TECH_WRITER_ROLE = `Technical writer \u2014 creates and maintains documentation, READMEs, API references, guides, and inline code comments.
|
|
137
|
+
- If the bug is in a dependency, document the workaround and file upstream.`,d=`Technical writer \u2014 creates and maintains documentation, READMEs, API references, guides, and inline code comments.
|
|
146
138
|
|
|
147
139
|
## WORKFLOW
|
|
148
140
|
|
|
@@ -163,8 +155,7 @@ var TECH_WRITER_ROLE = `Technical writer \u2014 creates and maintains documentat
|
|
|
163
155
|
- Use active voice and second person ("you can configure\u2026" not "it can be configured\u2026").
|
|
164
156
|
- Keep sentences under 25 words; paragraphs under 5 sentences.
|
|
165
157
|
- Code examples must be complete and runnable \u2014 no pseudo-code in docs.
|
|
166
|
-
- Never document internal implementation details in user-facing docs
|
|
167
|
-
var MARKETER_ROLE = `Marketing strategist \u2014 develops positioning, messaging, copy, and campaign strategies using marketing psychology principles.
|
|
158
|
+
- Never document internal implementation details in user-facing docs.`,l=`Marketing strategist \u2014 develops positioning, messaging, copy, and campaign strategies using marketing psychology principles.
|
|
168
159
|
|
|
169
160
|
## WORKFLOW
|
|
170
161
|
|
|
@@ -185,8 +176,7 @@ var MARKETER_ROLE = `Marketing strategist \u2014 develops positioning, messaging
|
|
|
185
176
|
- Include measurable KPIs for every campaign recommendation.
|
|
186
177
|
- Respect brand voice and tone guidelines if they exist.
|
|
187
178
|
- A/B test assumptions \u2014 never assume you know what converts.
|
|
188
|
-
- Keep copy scannable: short paragraphs, bullet points, clear hierarchy
|
|
189
|
-
var CONTENT_CREATOR_ROLE = `Content creator \u2014 writes blog posts, articles, social media content, and educational materials that drive engagement and authority.
|
|
179
|
+
- Keep copy scannable: short paragraphs, bullet points, clear hierarchy.`,p=`Content creator \u2014 writes blog posts, articles, social media content, and educational materials that drive engagement and authority.
|
|
190
180
|
|
|
191
181
|
## WORKFLOW
|
|
192
182
|
|
|
@@ -207,8 +197,7 @@ var CONTENT_CREATOR_ROLE = `Content creator \u2014 writes blog posts, articles,
|
|
|
207
197
|
- Paragraphs max 3-4 sentences for readability.
|
|
208
198
|
- Include at least one concrete example or data point per section.
|
|
209
199
|
- Never plagiarize \u2014 all content must be original.
|
|
210
|
-
- Optimize for the target platform (blog post \u2260 tweet \u2260 LinkedIn post)
|
|
211
|
-
var GROWTH_HACKER_ROLE = `Growth hacker \u2014 designs and implements data-driven growth experiments to improve acquisition, activation, retention, and revenue.
|
|
200
|
+
- Optimize for the target platform (blog post \u2260 tweet \u2260 LinkedIn post).`,u=`Growth hacker \u2014 designs and implements data-driven growth experiments to improve acquisition, activation, retention, and revenue.
|
|
212
201
|
|
|
213
202
|
## WORKFLOW
|
|
214
203
|
|
|
@@ -226,8 +215,7 @@ var GROWTH_HACKER_ROLE = `Growth hacker \u2014 designs and implements data-drive
|
|
|
226
215
|
- Run one experiment per funnel stage at a time to avoid confounding.
|
|
227
216
|
- Prioritize experiments by ICE score (Impact \xD7 Confidence \xD7 Ease).
|
|
228
217
|
- Never ship a "growth hack" that degrades user experience long-term.
|
|
229
|
-
- Document results of every experiment, including failures \u2014 they are data
|
|
230
|
-
var SECURITY_AUDITOR_ROLE = `Security auditor \u2014 performs security analysis, identifies vulnerabilities, and recommends hardening measures following OWASP and industry best practices.
|
|
218
|
+
- Document results of every experiment, including failures \u2014 they are data.`,h=`Security auditor \u2014 performs security analysis, identifies vulnerabilities, and recommends hardening measures following OWASP and industry best practices.
|
|
231
219
|
|
|
232
220
|
## WORKFLOW
|
|
233
221
|
|
|
@@ -250,8 +238,7 @@ var SECURITY_AUDITOR_ROLE = `Security auditor \u2014 performs security analysis,
|
|
|
250
238
|
- Classify severity honestly \u2014 don't inflate or downplay.
|
|
251
239
|
- Check both application code AND configuration (CORS, headers, TLS, CSP).
|
|
252
240
|
- Recommend defense-in-depth \u2014 never rely on a single security control.
|
|
253
|
-
- Flag any plaintext secrets immediately as Critical, even in test code
|
|
254
|
-
var PERFORMANCE_ENGINEER_ROLE = `Performance engineer \u2014 profiles, benchmarks, and optimizes code for speed, memory efficiency, and scalability.
|
|
241
|
+
- Flag any plaintext secrets immediately as Critical, even in test code.`,m=`Performance engineer \u2014 profiles, benchmarks, and optimizes code for speed, memory efficiency, and scalability.
|
|
255
242
|
|
|
256
243
|
## WORKFLOW
|
|
257
244
|
|
|
@@ -273,8 +260,7 @@ var PERFORMANCE_ENGINEER_ROLE = `Performance engineer \u2014 profiles, benchmark
|
|
|
273
260
|
- Prefer algorithmic improvements over micro-optimizations.
|
|
274
261
|
- Never sacrifice readability for marginal performance gains.
|
|
275
262
|
- Profile in realistic conditions \u2014 not with trivial test data.
|
|
276
|
-
- Watch for regressions \u2014 optimization in one area can degrade another
|
|
277
|
-
var DATA_ENGINEER_ROLE = `Data engineer \u2014 builds data pipelines, ETL processes, analytics queries, and data infrastructure.
|
|
263
|
+
- Watch for regressions \u2014 optimization in one area can degrade another.`,g=`Data engineer \u2014 builds data pipelines, ETL processes, analytics queries, and data infrastructure.
|
|
278
264
|
|
|
279
265
|
## WORKFLOW
|
|
280
266
|
|
|
@@ -295,8 +281,7 @@ var DATA_ENGINEER_ROLE = `Data engineer \u2014 builds data pipelines, ETL proces
|
|
|
295
281
|
- Always validate data at ingestion boundaries \u2014 never trust upstream data.
|
|
296
282
|
- Handle NULLs, duplicates, and encoding issues explicitly.
|
|
297
283
|
- Log pipeline metrics: rows processed, duration, error count.
|
|
298
|
-
- Never run DELETE or UPDATE without a WHERE clause and a backup plan
|
|
299
|
-
var FULLSTACK_DEV_ROLE = `Full-stack developer \u2014 works across the entire stack, from database and API to UI components and styling.
|
|
284
|
+
- Never run DELETE or UPDATE without a WHERE clause and a backup plan.`,f=`Full-stack developer \u2014 works across the entire stack, from database and API to UI components and styling.
|
|
300
285
|
|
|
301
286
|
## WORKFLOW
|
|
302
287
|
|
|
@@ -320,161 +305,4 @@ var FULLSTACK_DEV_ROLE = `Full-stack developer \u2014 works across the entire st
|
|
|
320
305
|
- Keep frontend and backend changes in the same branch for atomic features.
|
|
321
306
|
- Follow each layer's conventions independently \u2014 backend patterns for backend, frontend patterns for frontend.
|
|
322
307
|
- Handle every error state in the UI \u2014 users should never see a blank screen.
|
|
323
|
-
- If a task is too large to deliver end-to-end, split it and communicate the dependency
|
|
324
|
-
var AGENT_SHOP_TEMPLATES = [
|
|
325
|
-
{
|
|
326
|
-
key: "backend-dev",
|
|
327
|
-
name: "Backend Developer",
|
|
328
|
-
description: "APIs, databases, backend services",
|
|
329
|
-
adapter: "claude",
|
|
330
|
-
model: "claude-sonnet-4-6",
|
|
331
|
-
approval_policy: "auto",
|
|
332
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
333
|
-
role: BACKEND_DEV_ROLE
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
key: "frontend-dev",
|
|
337
|
-
name: "Frontend Developer",
|
|
338
|
-
description: "React, UI components, CSS, responsive design",
|
|
339
|
-
adapter: "claude",
|
|
340
|
-
model: "claude-sonnet-4-6",
|
|
341
|
-
approval_policy: "auto",
|
|
342
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer", "frontend-design"],
|
|
343
|
-
role: FRONTEND_DEV_ROLE
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
key: "qa-engineer",
|
|
347
|
-
name: "QA Engineer",
|
|
348
|
-
description: "Test writing, coverage analysis, quality assurance",
|
|
349
|
-
adapter: "claude",
|
|
350
|
-
model: "claude-sonnet-4-6",
|
|
351
|
-
approval_policy: "auto",
|
|
352
|
-
skills: ["testing-suite:generate-tests", "testing-suite:test-coverage", "testing-suite:test-quality-analyzer"],
|
|
353
|
-
role: QA_ENGINEER_ROLE
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
key: "code-reviewer",
|
|
357
|
-
name: "Code Reviewer",
|
|
358
|
-
description: "PR review, bug finding, code quality, security",
|
|
359
|
-
adapter: "claude",
|
|
360
|
-
model: "claude-opus-4-6",
|
|
361
|
-
approval_policy: "suggest",
|
|
362
|
-
skills: ["feature-dev:code-reviewer", "feature-dev:code-explorer"],
|
|
363
|
-
role: CODE_REVIEWER_ROLE
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
key: "architect",
|
|
367
|
-
name: "Architect",
|
|
368
|
-
description: "System design, architecture decisions, tech leadership",
|
|
369
|
-
adapter: "claude",
|
|
370
|
-
model: "claude-opus-4-6",
|
|
371
|
-
approval_policy: "suggest",
|
|
372
|
-
skills: ["feature-dev:code-architect", "feature-dev:code-explorer"],
|
|
373
|
-
role: ARCHITECT_ROLE
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
key: "devops-engineer",
|
|
377
|
-
name: "DevOps Engineer",
|
|
378
|
-
description: "CI/CD, infrastructure, deployment, cloud",
|
|
379
|
-
adapter: "claude",
|
|
380
|
-
model: "claude-sonnet-4-6",
|
|
381
|
-
approval_policy: "auto",
|
|
382
|
-
skills: ["devops-automation:cloud-architect", "feature-dev:code-explorer"],
|
|
383
|
-
role: DEVOPS_ENGINEER_ROLE
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
key: "bug-hunter",
|
|
387
|
-
name: "Bug Hunter",
|
|
388
|
-
description: "Find bugs, reproduce issues, propose fixes",
|
|
389
|
-
adapter: "claude",
|
|
390
|
-
model: "claude-sonnet-4-6",
|
|
391
|
-
approval_policy: "auto",
|
|
392
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
393
|
-
role: BUG_HUNTER_ROLE
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
key: "tech-writer",
|
|
397
|
-
name: "Technical Writer",
|
|
398
|
-
description: "Documentation, READMEs, API docs, guides",
|
|
399
|
-
adapter: "claude",
|
|
400
|
-
model: "claude-sonnet-4-6",
|
|
401
|
-
approval_policy: "auto",
|
|
402
|
-
skills: ["feature-dev:code-explorer", "docx"],
|
|
403
|
-
role: TECH_WRITER_ROLE
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
key: "marketer",
|
|
407
|
-
name: "Marketer",
|
|
408
|
-
description: "Marketing strategy, positioning, copy, campaigns",
|
|
409
|
-
adapter: "claude",
|
|
410
|
-
model: "claude-sonnet-4-6",
|
|
411
|
-
approval_policy: "auto",
|
|
412
|
-
skills: ["marketing-psychology", "product-manager-toolkit"],
|
|
413
|
-
role: MARKETER_ROLE
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
key: "content-creator",
|
|
417
|
-
name: "Content Creator",
|
|
418
|
-
description: "Blog posts, articles, social media content",
|
|
419
|
-
adapter: "claude",
|
|
420
|
-
model: "claude-sonnet-4-6",
|
|
421
|
-
approval_policy: "auto",
|
|
422
|
-
skills: ["marketing-psychology"],
|
|
423
|
-
role: CONTENT_CREATOR_ROLE
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
key: "growth-hacker",
|
|
427
|
-
name: "Growth Hacker",
|
|
428
|
-
description: "Growth experiments, analytics, user acquisition",
|
|
429
|
-
adapter: "claude",
|
|
430
|
-
model: "claude-sonnet-4-6",
|
|
431
|
-
approval_policy: "auto",
|
|
432
|
-
skills: ["product-manager-toolkit", "feature-dev:feature-dev"],
|
|
433
|
-
role: GROWTH_HACKER_ROLE
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
key: "security-auditor",
|
|
437
|
-
name: "Security Auditor",
|
|
438
|
-
description: "Security scanning, vulnerability analysis, OWASP",
|
|
439
|
-
adapter: "claude",
|
|
440
|
-
model: "claude-opus-4-6",
|
|
441
|
-
approval_policy: "suggest",
|
|
442
|
-
skills: ["feature-dev:code-reviewer", "feature-dev:code-explorer"],
|
|
443
|
-
role: SECURITY_AUDITOR_ROLE
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
key: "performance-engineer",
|
|
447
|
-
name: "Performance Engineer",
|
|
448
|
-
description: "Optimization, profiling, benchmarks, load testing",
|
|
449
|
-
adapter: "claude",
|
|
450
|
-
model: "claude-sonnet-4-6",
|
|
451
|
-
approval_policy: "auto",
|
|
452
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
453
|
-
role: PERFORMANCE_ENGINEER_ROLE
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
key: "data-engineer",
|
|
457
|
-
name: "Data Engineer",
|
|
458
|
-
description: "Data pipelines, ETL, analytics, SQL",
|
|
459
|
-
adapter: "claude",
|
|
460
|
-
model: "claude-sonnet-4-6",
|
|
461
|
-
approval_policy: "auto",
|
|
462
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer"],
|
|
463
|
-
role: DATA_ENGINEER_ROLE
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
key: "fullstack-dev",
|
|
467
|
-
name: "Full-Stack Developer",
|
|
468
|
-
description: "End-to-end development, frontend and backend",
|
|
469
|
-
adapter: "claude",
|
|
470
|
-
model: "claude-sonnet-4-6",
|
|
471
|
-
approval_policy: "auto",
|
|
472
|
-
skills: ["feature-dev:feature-dev", "feature-dev:code-explorer", "frontend-design"],
|
|
473
|
-
role: FULLSTACK_DEV_ROLE
|
|
474
|
-
}
|
|
475
|
-
];
|
|
476
|
-
function getShopTemplateByKey(key) {
|
|
477
|
-
return AGENT_SHOP_TEMPLATES.find((t) => t.key === key);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
export { AGENT_SHOP_TEMPLATES, getShopTemplateByKey };
|
|
308
|
+
- If a task is too large to deliver end-to-end, split it and communicate the dependency.`,y=[{key:"backend-dev",name:"Backend Developer",description:"APIs, databases, backend services",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:n},{key:"frontend-dev",name:"Frontend Developer",description:"React, UI components, CSS, responsive design",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer","frontend-design"],role:a},{key:"qa-engineer",name:"QA Engineer",description:"Test writing, coverage analysis, quality assurance",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["testing-suite:generate-tests","testing-suite:test-coverage","testing-suite:test-quality-analyzer"],role:i},{key:"code-reviewer",name:"Code Reviewer",description:"PR review, bug finding, code quality, security",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-reviewer","feature-dev:code-explorer"],role:o},{key:"architect",name:"Architect",description:"System design, architecture decisions, tech leadership",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-architect","feature-dev:code-explorer"],role:r},{key:"devops-engineer",name:"DevOps Engineer",description:"CI/CD, infrastructure, deployment, cloud",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["devops-automation:cloud-architect","feature-dev:code-explorer"],role:s},{key:"bug-hunter",name:"Bug Hunter",description:"Find bugs, reproduce issues, propose fixes",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:c},{key:"tech-writer",name:"Technical Writer",description:"Documentation, READMEs, API docs, guides",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:code-explorer","docx"],role:d},{key:"marketer",name:"Marketer",description:"Marketing strategy, positioning, copy, campaigns",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["marketing-psychology","product-manager-toolkit"],role:l},{key:"content-creator",name:"Content Creator",description:"Blog posts, articles, social media content",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["marketing-psychology"],role:p},{key:"growth-hacker",name:"Growth Hacker",description:"Growth experiments, analytics, user acquisition",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["product-manager-toolkit","feature-dev:feature-dev"],role:u},{key:"security-auditor",name:"Security Auditor",description:"Security scanning, vulnerability analysis, OWASP",adapter:"claude",model:"claude-opus-4-6",approval_policy:"suggest",skills:["feature-dev:code-reviewer","feature-dev:code-explorer"],role:h},{key:"performance-engineer",name:"Performance Engineer",description:"Optimization, profiling, benchmarks, load testing",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:m},{key:"data-engineer",name:"Data Engineer",description:"Data pipelines, ETL, analytics, SQL",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer"],role:g},{key:"fullstack-dev",name:"Full-Stack Developer",description:"End-to-end development, frontend and backend",adapter:"claude",model:"claude-sonnet-4-6",approval_policy:"auto",skills:["feature-dev:feature-dev","feature-dev:code-explorer","frontend-design"],role:f}];function v(e){return y.find(t=>t.key===e)}export{y as a,v as b};
|
|
@@ -146,8 +146,11 @@ function parseJsonlLines(lines) {
|
|
|
146
146
|
}
|
|
147
147
|
return results;
|
|
148
148
|
}
|
|
149
|
+
var ensuredDirs = /* @__PURE__ */ new Set();
|
|
149
150
|
async function ensureDir(dirPath) {
|
|
151
|
+
if (ensuredDirs.has(dirPath)) return;
|
|
150
152
|
await fs.mkdir(dirPath, { recursive: true });
|
|
153
|
+
ensuredDirs.add(dirPath);
|
|
151
154
|
}
|
|
152
155
|
async function pathExists(filePath) {
|
|
153
156
|
try {
|
|
@@ -281,5 +284,5 @@ function validateWorkspacePath(workspacePath, projectRoot) {
|
|
|
281
284
|
}
|
|
282
285
|
|
|
283
286
|
export { Paths, appendJsonl, ensureDir, listFiles, pathExists, readJson, readJsonl, readJsonlTail, readYaml, sanitizeId, validateWorkspacePath, writeJson, writeYaml };
|
|
284
|
-
//# sourceMappingURL=chunk-
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
287
|
+
//# sourceMappingURL=chunk-BSJVYRI3.js.map
|
|
288
|
+
//# sourceMappingURL=chunk-BSJVYRI3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/infrastructure/storage/fs-utils.ts","../src/infrastructure/storage/paths.ts"],"names":["path","lines"],"mappings":";;;;;;;AAgBA,eAAsB,WAAA,CAAY,UAAkB,OAAA,EAAgC;AAClF,EAAA,MAAM,GAAA,GAAMA,KAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA;AACjC,EAAA,MAAM,UAAU,GAAG,CAAA;AAEnB,EAAA,MAAM,UAAUA,KAAA,CAAK,IAAA,CAAK,GAAA,EAAK,CAAA,CAAA,EAAIA,MAAK,QAAA,CAAS,QAAQ,CAAC,CAAA,CAAA,EAAI,YAAY,CAAC,CAAA,CAAE,QAAA,CAAS,KAAK,CAAC,CAAA,IAAA,CAAM,CAAA;AAElG,EAAA,IAAI;AACF,IAAA,MAAM,EAAA,CAAG,SAAA,CAAU,OAAA,EAAS,OAAA,EAAS,OAAO,CAAA;AAC5C,IAAA,MAAM,EAAA,CAAG,MAAA,CAAO,OAAA,EAAS,QAAQ,CAAA;AAAA,EACnC,SAAS,GAAA,EAAK;AAEZ,IAAA,MAAM,EAAA,CAAG,MAAA,CAAO,OAAO,CAAA,CAAE,MAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AACvC,IAAA,MAAM,GAAA;AAAA,EACR;AACF;AAKA,eAAsB,SAAY,QAAA,EAAqC;AACrE,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,MAAM,EAAA,CAAG,QAAA,CAAS,UAAU,OAAO,CAAA;AACnD,IAAA,OAAO,IAAA,CAAK,KAAK,OAAO,CAAA;AAAA,EAC1B,SAAS,GAAA,EAAK;AACZ,IAAA,IAAI,QAAA,CAAS,GAAG,CAAA,EAAG,OAAO,I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,CAAA;AAC3C,EAAA,MAAM,IAAA,GAAOA,KAAAA,CAAK,OAAA,CAAQ,WAAW,CAAA;AAErC,EAAA,IAAI,CAAC,SAAS,UAAA,CAAW,IAAA,GAAOA,MAAK,GAAG,CAAA,IAAK,aAAa,IAAA,EAAM;AAC9D,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,gBAAA,EAAmB,aAAa,CAAA,yBAAA,CAA2B,CAAA;AAAA,EAC7E;AACF","file":"chunk-BSJVYRI3.js","sourcesContent":["/**\n * Low-level filesystem utilities.\n *\n * All file persistence goes through these functions.\n * atomicWrite guarantees no partial reads via temp → rename.\n */\n\nimport { randomBytes } from 'node:crypto';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport yaml from 'js-yaml';\n\n/**\n * Write file atomically: write to temp file, then rename.\n * Prevents corrupted reads on concurrent access.\n */\nexport async function atomicWrite(filePath: string, content: string): Promise<void> {\n const dir = path.dirname(filePath);\n await ensureDir(dir);\n\n const tmpPath = path.join(dir, `.${path.basename(filePath)}.${randomBytes(4).toString('hex')}.tmp`);\n\n try {\n await fs.writeFile(tmpPath, content, 'utf-8');\n await fs.rename(tmpPath, filePath);\n } catch (err) {\n // Clean up temp file on failure\n await fs.unlink(tmpPath).catch(() => {});\n throw err;\n }\n}\n\n/**\n * Read and parse a YAML file. Returns null if file does not exist.\n */\nexport async function readYaml<T>(filePath: string): Promise<T | null> {\n try {\n const content = await fs.readFile(filePath, 'utf-8');\n return yaml.load(content) as T;\n } catch (err) {\n if (isENOENT(err)) return null;\n throw err;\n }\n}\n\n/**\n * Write data as YAML atomically.\n */\nexport async function writeYaml<T>(filePath: string, data: T): Promise<void> {\n const content = yaml.dump(data, {\n indent: 2,\n lineWidth: 120,\n noRefs: true,\n sortKeys: false,\n });\n await atomicWrite(filePath, content);\n}\n\n/**\n * Read and parse a JSON file. Returns null if file does not exist.\n */\nexport async function readJson<T>(filePath: string): Promise<T | null> {\n try {\n const content = await fs.readFile(filePath, 'utf-8');\n return JSON.parse(content) as T;\n } catch (err) {\n if (isENOENT(err)) return null;\n throw err;\n }\n}\n\n/**\n * Write data as JSON atomically.\n */\nexport async function writeJson<T>(filePath: string, data: T): Promise<void> {\n const content = JSON.stringify(data, null, 2) + '\\n';\n await atomicWrite(filePath, content);\n}\n\n/**\n * POSIX PIPE_BUF — writes up to this size are guaranteed atomic with O_APPEND.\n * 4096 on Linux/macOS. We leave some room for encoding overhead.\n */\nconst PIPE_BUF = 4096;\n\n/**\n * Append a JSON record to a .jsonl file (newline-delimited JSON).\n *\n * Uses a file handle opened with 'a' (O_APPEND) to ensure atomic writes.\n * On POSIX, O_APPEND guarantees that each write() call appends atomically\n * when the data fits within PIPE_BUF (typically 4096 bytes), preventing\n * interleaving from concurrent writers.\n *\n * If the serialized line exceeds PIPE_BUF, the record's `data` field is\n * truncated so the entire line fits within the atomic-write limit.\n * This prevents interleaving corruption from concurrent writers.\n */\nexport async function appendJsonl(filePath: string, record: unknown): Promise<void> {\n const dir = path.dirname(filePath);\n await ensureDir(dir);\n let line = JSON.stringify(record) + '\\n';\n\n // If the line exceeds PIPE_BUF, truncate the `data` field to fit\n const byteLen = Buffer.byteLength(line, 'utf-8');\n if (byteLen > PIPE_BUF && record !== null && typeof record === 'object') {\n const obj = record as Record<string, unknown>;\n if (typeof obj.data === 'string' && obj.data.length > 0) {\n // Measure overhead without data to know how much room data gets\n const shell = JSON.stringify({ ...obj, data: '' }) + '\\n';\n const overhead = Buffer.byteLength(shell, 'utf-8');\n const budget = PIPE_BUF - overhead - 3; // 3 bytes for the '…' suffix (UTF-8 ellipsis)\n if (budget > 0) {\n // Slice to budget chars — for ASCII (most event data) this equals bytes.\n // For multi-byte chars the result may be slightly over PIPE_BUF,\n // which is acceptable on local filesystems (ext4/APFS hold inode lock).\n const truncated = obj.data.slice(0, budget);\n line = JSON.stringify({ ...obj, data: truncated + '…' }) + '\\n';\n }\n }\n }\n\n const fd = await fs.open(filePath, 'a');\n try {\n await fd.write(line, null, 'utf-8');\n } finally {\n await fd.close();\n }\n}\n\n/** Max file size for full readJsonl (50 MB). Larger files use tail read. */\nconst MAX_JSONL_READ_SIZE = 50 * 1024 * 1024;\n\n/**\n * Read all records from a .jsonl file.\n * Falls back to reading only the last 200 records if the file exceeds MAX_JSONL_READ_SIZE.\n */\nexport async function readJsonl<T>(filePath: string): Promise<T[]> {\n try {\n const stat = await fs.stat(filePath);\n if (stat.size > MAX_JSONL_READ_SIZE) {\n process.stderr.write(\n `[readJsonl] file too large (${(stat.size / 1024 / 1024).toFixed(1)} MB), reading tail only: ${filePath}\\n`,\n );\n return readJsonlTail<T>(filePath, 200);\n }\n return readAndParseJsonl<T>(filePath);\n } catch (err) {\n if (isENOENT(err)) return [];\n throw err;\n }\n}\n\n/**\n * Read the last N records from a .jsonl file.\n *\n * Reads the file in reverse chunks to avoid loading multi-MB files into memory.\n * Falls back to full read for small files (< 32KB).\n */\nexport async function readJsonlTail<T>(filePath: string, count: number): Promise<T[]> {\n try {\n const stat = await fs.stat(filePath);\n // For small files, read directly and slice (avoid mutual recursion with readJsonl)\n if (stat.size < 32768) {\n return (await readAndParseJsonl<T>(filePath)).slice(-count);\n }\n\n // Read from end in chunks to find enough lines\n // Use larger chunks for bigger files (tool_result events can be 8KB+ per line)\n const fd = await fs.open(filePath, 'r');\n try {\n const chunkSize = Math.min(stat.size, stat.size > 1_048_576 ? 131072 : 65536);\n let position = Math.max(0, stat.size - chunkSize);\n let earliestReadPosition = position;\n let tail = '';\n\n // Read up to 4 chunks from the end\n for (let attempt = 0; attempt < 4 && position >= 0; attempt++) {\n earliestReadPosition = position;\n const readSize = Math.min(chunkSize, stat.size - position);\n const buf = Buffer.alloc(readSize);\n await fd.read(buf, 0, readSize, position);\n tail = buf.toString('utf-8') + tail;\n\n const lines = tail.split('\\n').filter((l) => l.trim().length > 0);\n if (lines.length >= count + 1) {\n // +1 because first line might be partial\n return parseJsonlLines<T>(lines.slice(-count));\n }\n if (position === 0) break;\n position = Math.max(0, position - chunkSize);\n }\n\n // Parse whatever we got\n const lines = tail.split('\\n').filter((l) => l.trim().length > 0);\n // Skip first line if we didn't read from start (could be partial)\n const safeLines = earliestReadPosition > 0 ? lines.slice(1) : lines;\n return parseJsonlLines<T>(safeLines.slice(-count));\n } finally {\n await fd.close();\n }\n } catch (err) {\n if (isENOENT(err)) return [];\n throw err;\n }\n}\n\n/** Read a file and parse all JSONL records. */\nasync function readAndParseJsonl<T>(filePath: string): Promise<T[]> {\n const content = await fs.readFile(filePath, 'utf-8');\n const lines = content.split('\\n').filter((l) => l.trim().length > 0);\n return parseJsonlLines<T>(lines);\n}\n\n/**\n * Parse JSONL lines with error tolerance — corrupt lines are logged and skipped.\n */\nfunction parseJsonlLines<T>(lines: string[]): T[] {\n const results: T[] = [];\n for (const raw of lines) {\n const line = raw.trim();\n if (!line) continue;\n try {\n results.push(JSON.parse(line) as T);\n } catch {\n process.stderr.write(`[readJsonl] skipping corrupt line: ${line.slice(0, 200)}\\n`);\n }\n }\n return results;\n}\n\n/**\n * Module-level cache of directories already ensured during this process lifetime.\n * Eliminates redundant fs.mkdir syscalls (~50 per tick loop).\n */\nconst ensuredDirs = new Set<string>();\n\n/**\n * Ensure a directory exists, creating it recursively if needed.\n * Uses an in-memory cache to skip redundant mkdir syscalls.\n */\nexport async function ensureDir(dirPath: string): Promise<void> {\n if (ensuredDirs.has(dirPath)) return;\n await fs.mkdir(dirPath, { recursive: true });\n ensuredDirs.add(dirPath);\n}\n\n/**\n * Clear the ensureDir cache. Intended for tests only.\n */\nexport function clearEnsuredDirs(): void {\n ensuredDirs.clear();\n}\n\n/**\n * Check if a path exists.\n */\nexport async function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * List files in a directory matching an optional extension filter.\n */\nexport async function listFiles(dirPath: string, ext?: string): Promise<string[]> {\n try {\n const entries = await fs.readdir(dirPath);\n if (ext) {\n return entries.filter((e) => e.endsWith(ext));\n }\n return entries;\n } catch (err) {\n if (isENOENT(err)) return [];\n throw err;\n }\n}\n\nfunction isENOENT(err: unknown): boolean {\n return err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT';\n}\n","/**\n * Path resolution for .orchestry/ directory.\n *\n * All path construction goes through this module.\n * Validates initialization state and sanitizes identifiers.\n */\n\nimport path from 'node:path';\nimport { accessSync } from 'node:fs';\nimport { NotInitializedError } from '../../domain/errors.js';\nimport { pathExists } from './fs-utils.js';\n\nexport const ORCHESTRY_DIR = '.orchestry';\nconst ID_PATTERN = /^[A-Za-z0-9._-]+$/;\n\nexport class Paths {\n constructor(private readonly projectRoot: string) {}\n\n /** Root .orchestry/ directory */\n get root(): string {\n return path.join(this.projectRoot, ORCHESTRY_DIR);\n }\n\n get configPath(): string {\n return path.join(this.root, 'config.yml');\n }\n\n get statePath(): string {\n return path.join(this.root, 'state.json');\n }\n\n get lockPath(): string {\n return path.join(this.root, 'orchestry.lock');\n }\n\n get tasksDir(): string {\n return path.join(this.root, 'tasks');\n }\n\n get agentsDir(): string {\n return path.join(this.root, 'agents');\n }\n\n get runsDir(): string {\n return path.join(this.root, 'runs');\n }\n\n get templatesDir(): string {\n return path.join(this.root, 'templates');\n }\n\n get logsDir(): string {\n return path.join(this.root, 'logs');\n }\n\n get contextDir(): string {\n return path.join(this.root, 'context');\n }\n\n contextPath(key: string): string {\n return path.join(this.contextDir, `${sanitizeId(key)}.json`);\n }\n\n get messagesDir(): string {\n return path.join(this.root, 'messages');\n }\n\n messagePath(id: string): string {\n return path.join(this.messagesDir, `${sanitizeId(id)}.json`);\n }\n\n get goalsDir(): string {\n return path.join(this.root, 'goals');\n }\n\n goalPath(id: string): string {\n return path.join(this.goalsDir, `${sanitizeId(id)}.yml`);\n }\n\n get teamsDir(): string {\n return path.join(this.root, 'teams');\n }\n\n get attachmentsDir(): string {\n return path.join(this.root, 'attachments');\n }\n\n taskAttachmentsDir(taskId: string): string {\n return path.join(this.attachmentsDir, sanitizeId(taskId));\n }\n\n teamPath(id: string): string {\n return path.join(this.teamsDir, `${sanitizeId(id)}.yml`);\n }\n\n get gitignorePath(): string {\n return path.join(this.root, '.gitignore');\n }\n\n get workspaceExcludePath(): string {\n return path.join(this.root, 'workspace-exclude');\n }\n\n taskPath(id: string): string {\n return path.join(this.tasksDir, `${sanitizeId(id)}.yml`);\n }\n\n agentPath(id: string): string {\n return path.join(this.agentsDir, `${sanitizeId(id)}.yml`);\n }\n\n runPath(id: string): string {\n return path.join(this.runsDir, `${sanitizeId(id)}.json`);\n }\n\n runEventsPath(id: string): string {\n return path.join(this.runsDir, `${sanitizeId(id)}.jsonl`);\n }\n\n defaultTemplatePath(): string {\n return path.join(this.templatesDir, 'default.md');\n }\n\n async isInitialized(): Promise<boolean> {\n return pathExists(this.root);\n }\n\n async requireInit(): Promise<void> {\n if (!(await this.isInitialized())) {\n throw new NotInitializedError();\n }\n }\n}\n\n/**\n * Validate an identifier for use in file paths.\n * Only allows [A-Za-z0-9._-] characters.\n * Rejects identifiers containing forbidden characters (path separators, etc.)\n * to prevent path traversal attacks.\n */\nexport function sanitizeId(id: string): string {\n if (!ID_PATTERN.test(id)) {\n throw new Error(`Invalid identifier: \"${id}\"`);\n }\n return id;\n}\n\n/**\n * Validate that a workspace path is within the project root.\n * Prevents path traversal attacks.\n */\nexport function validateWorkspacePath(workspacePath: string, projectRoot: string): void {\n const resolved = path.resolve(workspacePath);\n const root = path.resolve(projectRoot);\n\n if (!resolved.startsWith(root + path.sep) && resolved !== root) {\n throw new Error(`Workspace path \"${workspacePath}\" is outside project root`);\n }\n}\n\n/**\n * Module-level cache for findProjectRoot().\n * Key: resolved startDir, Value: found project root.\n * Avoids repeated accessSync() traversals on every CLI invocation.\n */\nconst projectRootCache = new Map<string, string>();\n\n/**\n * Resolve project root by walking up from cwd looking for .orchestry/.\n * Returns cwd if not found (for init command).\n *\n * Results are cached per startDir to avoid redundant filesystem traversals.\n */\nexport function findProjectRoot(startDir: string = process.cwd()): string {\n const resolvedStart = path.resolve(startDir);\n const cached = projectRootCache.get(resolvedStart);\n if (cached !== undefined) return cached;\n\n let dir = resolvedStart;\n const root = path.parse(dir).root;\n\n while (dir !== root) {\n try {\n accessSync(path.join(dir, '.orchestry'));\n projectRootCache.set(resolvedStart, dir);\n return dir;\n } catch {\n // Not found, go up\n }\n dir = path.dirname(dir);\n }\n\n // Not found — return resolved dir (for init command)\n projectRootCache.set(resolvedStart, resolvedStart);\n return resolvedStart;\n}\n\n/**\n * Clear the findProjectRoot cache.\n * Useful in tests or after `orch init` changes the project structure.\n */\nexport function clearProjectRootCache(): void {\n projectRootCache.clear();\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var e=class{adapters=new Map;register(t){this.adapters.set(t.kind,t);}get(t){return this.adapters.get(t)}require(t){let r=this.adapters.get(t);if(!r)throw new Error(`Unknown adapter: "${t}". Available: ${this.listKinds().join(", ")}`);return r}list(){return Array.from(this.adapters.values())}listKinds(){return Array.from(this.adapters.keys())}has(t){return this.adapters.has(t)}};export{e as a};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AUTONOMOUS_LABEL, DEFAULT_SYSTEM_TEMPLATE, DEFAULT_USER_TEMPLATE, buildPromptContext } from './chunk-VG4465AG.js';
|
|
2
|
+
import { createTokenUsage } from './chunk-RHFRHCN5.js';
|
|
2
3
|
import { LockConflictError, WorkspaceError, TaskAlreadyRunningError, NoAgentsError, classifyAdapterError } from './chunk-NLQAJ7TW.js';
|
|
3
4
|
import { dirname } from 'path';
|
|
4
5
|
import fs from 'fs/promises';
|
|
@@ -750,34 +751,44 @@ var Orchestrator = class {
|
|
|
750
751
|
}
|
|
751
752
|
}
|
|
752
753
|
const runningAgentIds = new Set(Object.values(state.running).map((e) => e.agent_id));
|
|
753
|
-
const allAgents = await
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
754
|
+
const [allAgents, allTasks] = await Promise.all([
|
|
755
|
+
this.cachedAgentStore.list(),
|
|
756
|
+
this.cachedTaskStore.list()
|
|
757
|
+
]);
|
|
758
|
+
const staleAgents = allAgents.filter(
|
|
759
|
+
(a) => a.status === "running" && !runningAgentIds.has(a.id)
|
|
760
|
+
);
|
|
761
|
+
if (staleAgents.length > 0) {
|
|
762
|
+
await Promise.all(
|
|
763
|
+
staleAgents.map((agent) => this.deps.agentService.setStatus(agent.id, "idle"))
|
|
764
|
+
);
|
|
758
765
|
}
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
766
|
+
const orphanedTasks = allTasks.filter(
|
|
767
|
+
(t) => t.status === "in_progress" && !state.running[t.id]
|
|
768
|
+
);
|
|
769
|
+
if (orphanedTasks.length > 0) {
|
|
770
|
+
await Promise.all(
|
|
771
|
+
orphanedTasks.map(async (task) => {
|
|
772
|
+
try {
|
|
773
|
+
await this.deps.taskService.updateStatus(task.id, "failed");
|
|
774
|
+
} catch {
|
|
775
|
+
task.status = "failed";
|
|
776
|
+
task.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
777
|
+
await this.deps.taskStore.save(task).catch((err) => {
|
|
778
|
+
this.deps.eventBus.emit({
|
|
779
|
+
type: "orchestrator:error",
|
|
780
|
+
error: err instanceof Error ? err.message : String(err),
|
|
781
|
+
context: `force-write orphaned task ${task.id}`,
|
|
782
|
+
fatal: false
|
|
783
|
+
});
|
|
773
784
|
});
|
|
785
|
+
}
|
|
786
|
+
this.deps.eventBus.emit({
|
|
787
|
+
type: "task:orphaned",
|
|
788
|
+
taskId: task.id
|
|
774
789
|
});
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
type: "task:orphaned",
|
|
778
|
-
taskId: task.id
|
|
779
|
-
});
|
|
780
|
-
}
|
|
790
|
+
})
|
|
791
|
+
);
|
|
781
792
|
}
|
|
782
793
|
const dueRetries = [];
|
|
783
794
|
state.retry_queue = state.retry_queue.filter((retry) => {
|
|
@@ -1081,7 +1092,10 @@ Agent role: ${role}` : `Autonomous work cycle. Agent role: ${role}`;
|
|
|
1081
1092
|
for await (const event of generator) {
|
|
1082
1093
|
if (this.shuttingDown) break;
|
|
1083
1094
|
if (event.type === "done") {
|
|
1084
|
-
if (event.tokens)
|
|
1095
|
+
if (event.tokens) {
|
|
1096
|
+
const { input, output, reasoning, cache_read, cache_write } = event.tokens;
|
|
1097
|
+
collectedTokens = createTokenUsage(input, output, { reasoning, cache_read, cache_write });
|
|
1098
|
+
}
|
|
1085
1099
|
const data = event.data;
|
|
1086
1100
|
if (data && typeof data.result === "string") {
|
|
1087
1101
|
resultText = data.result;
|
|
@@ -1208,7 +1222,10 @@ Agent role: ${role}` : `Autonomous work cycle. Agent role: ${role}`;
|
|
|
1208
1222
|
if (tokens) {
|
|
1209
1223
|
state.stats.total_tokens.input += tokens.input;
|
|
1210
1224
|
state.stats.total_tokens.output += tokens.output;
|
|
1211
|
-
state.stats.total_tokens.
|
|
1225
|
+
state.stats.total_tokens.reasoning += tokens.reasoning;
|
|
1226
|
+
state.stats.total_tokens.cache_read += tokens.cache_read;
|
|
1227
|
+
state.stats.total_tokens.cache_write += tokens.cache_write;
|
|
1228
|
+
state.stats.total_tokens.total = state.stats.total_tokens.input + state.stats.total_tokens.output + state.stats.total_tokens.reasoning;
|
|
1212
1229
|
}
|
|
1213
1230
|
if (task.proof?.branch) {
|
|
1214
1231
|
try {
|
|
@@ -1491,5 +1508,5 @@ function serializeEventData(data, maxLen) {
|
|
|
1491
1508
|
}
|
|
1492
1509
|
|
|
1493
1510
|
export { Orchestrator, canTransition, isBlocked, isDispatchable, isTerminal, resolveFailureStatus };
|
|
1494
|
-
//# sourceMappingURL=chunk-
|
|
1495
|
-
//# sourceMappingURL=chunk-
|
|
1511
|
+
//# sourceMappingURL=chunk-FDSFFFMT.js.map
|
|
1512
|
+
//# sourceMappingURL=chunk-FDSFFFMT.js.map
|