@apralabs/apra-fleet 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -8
- package/dist/agents/ci-watcher.md +46 -0
- package/dist/agents/deployer.md +75 -0
- package/dist/agents/doer.md +70 -0
- package/dist/agents/harvester.md +79 -0
- package/dist/agents/integ-test-runner.md +96 -0
- package/dist/agents/plan-reviewer.md +64 -0
- package/dist/agents/planner.md +94 -0
- package/dist/agents/reviewer.md +82 -0
- package/dist/cli/agent-transform.d.ts +11 -0
- package/dist/cli/agent-transform.d.ts.map +1 -0
- package/dist/cli/agent-transform.js +63 -0
- package/dist/cli/agent-transform.js.map +1 -0
- package/dist/cli/config.d.ts +1 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +15 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +5 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +200 -23
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/uninstall.js +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/opencode.d.ts +40 -0
- package/dist/providers/opencode.d.ts.map +1 -0
- package/dist/providers/opencode.js +178 -0
- package/dist/providers/opencode.js.map +1 -0
- package/dist/services/cloud/task-wrapper.js +1 -1
- package/dist/services/cloud/task-wrapper.js.map +1 -1
- package/dist/skills/pm/SKILL.md +343 -0
- package/dist/skills/pm/beads.md +137 -0
- package/dist/skills/pm/cost.md +152 -0
- package/dist/skills/pm/doer-reviewer-loop.md +297 -0
- package/dist/skills/pm/fleet-addendum.md +115 -0
- package/dist/skills/pm/simple-sprint.md +64 -0
- package/dist/skills/pm/sprint.md +311 -0
- package/dist/skills/pm/tpl-progress.json +35 -0
- package/dist/skills/pm/worktrees.md +92 -0
- package/dist/tools/cloud-control.d.ts +2 -2
- package/dist/tools/credential-store-set.d.ts +2 -2
- package/dist/tools/credential-store-update.d.ts +2 -2
- package/dist/tools/execute-prompt.d.ts +3 -0
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +17 -3
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/register-member.d.ts +29 -6
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +43 -3
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/update-member.d.ts +29 -6
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +43 -3
- package/dist/tools/update-member.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/opencode-model-validation.d.ts +15 -0
- package/dist/utils/opencode-model-validation.d.ts.map +1 -0
- package/dist/utils/opencode-model-validation.js +40 -0
- package/dist/utils/opencode-model-validation.js.map +1 -0
- package/dist/workflows/auto-sprint.js +1676 -0
- package/package.json +2 -2
- package/version.json +1 -1
- package/skills/pm/SKILL.md +0 -110
- package/skills/pm/backlog-item.md +0 -65
- package/skills/pm/beads.md +0 -192
- package/skills/pm/cleanup.md +0 -15
- package/skills/pm/context-file.md +0 -40
- package/skills/pm/doer-reviewer.md +0 -123
- package/skills/pm/init.md +0 -25
- package/skills/pm/multi-pair-sprint.md +0 -64
- package/skills/pm/plan-prompt.md +0 -94
- package/skills/pm/simple-sprint.md +0 -42
- package/skills/pm/single-pair-sprint.md +0 -178
- package/skills/pm/tpl-deploy.md +0 -24
- package/skills/pm/tpl-design.md +0 -29
- package/skills/pm/tpl-doer.md +0 -43
- package/skills/pm/tpl-plan.md +0 -72
- package/skills/pm/tpl-pm.md +0 -2
- package/skills/pm/tpl-progress.json +0 -28
- package/skills/pm/tpl-projects.md +0 -4
- package/skills/pm/tpl-requirements.md +0 -21
- package/skills/pm/tpl-reviewer-plan.md +0 -53
- package/skills/pm/tpl-reviewer.md +0 -72
- package/skills/pm/tpl-status.md +0 -29
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
description: Reviews latest commits against beads task acceptance criteria; can reopen tasks; returns APPROVED or CHANGES NEEDED.
|
|
4
|
+
tools: [Read, Grep, Glob, Bash, Write]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Review
|
|
8
|
+
|
|
9
|
+
You are reviewing the latest development commits on the sprint branch.
|
|
10
|
+
|
|
11
|
+
## Step 1 -- Context recovery
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git log --oneline <base-branch>..<branch>
|
|
15
|
+
git diff <base-branch>..<branch> --stat
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Step 2 -- Find completed tasks
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bd list --status=closed --closed-after=$(date +%Y-%m-%d)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For each recently closed task, run `bd show <id>` to read its acceptance criteria.
|
|
25
|
+
|
|
26
|
+
## Step 3 -- Review the diff
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git diff <base-branch>..<branch>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For each task closed since the last review check:
|
|
33
|
+
- Does the code match the task's acceptance criteria?
|
|
34
|
+
- Does it solve what the task asked for, not just something nearby?
|
|
35
|
+
- Are new tests added for new behaviour?
|
|
36
|
+
- Test quality: flag redundant tests; flag untested error paths or edge cases
|
|
37
|
+
- No security issues (injection, auth bypass, secrets in code)?
|
|
38
|
+
- Consistent with existing patterns and conventions?
|
|
39
|
+
- No regressions in adjacent code?
|
|
40
|
+
|
|
41
|
+
**File hygiene**: for every file added or modified, it must be justifiable against the sprint tasks.
|
|
42
|
+
Flag temp files, tool config that slipped in, unrelated scripts.
|
|
43
|
+
Do NOT flag `sprint-logs/` -- these are durable per-branch cost logs written by the workflow, not scaffold.
|
|
44
|
+
|
|
45
|
+
## Step 4 -- Run the test suite
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# adapt to project's build system
|
|
49
|
+
git status --porcelain # must be empty
|
|
50
|
+
npm run build # or cargo build, go build, etc.
|
|
51
|
+
npm run lint # if configured
|
|
52
|
+
npm test # or cargo test, pytest, etc.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
All must pass. If any fail: CHANGES NEEDED.
|
|
56
|
+
|
|
57
|
+
## Step 5 -- Verdict
|
|
58
|
+
|
|
59
|
+
Return your structured output:
|
|
60
|
+
- `verdict`: "APPROVED" or "CHANGES NEEDED"
|
|
61
|
+
- `notes`: specific findings with file and line references where possible
|
|
62
|
+
|
|
63
|
+
**APPROVED** means all acceptance criteria met, tests pass, no regressions, no hygiene issues.
|
|
64
|
+
|
|
65
|
+
**CHANGES NEEDED**: reopen affected tasks so the doer can fix them:
|
|
66
|
+
```bash
|
|
67
|
+
bd update <id> --status=open
|
|
68
|
+
```
|
|
69
|
+
Notes must be specific: "auth_test.ts line 42: no test for expired token path".
|
|
70
|
+
|
|
71
|
+
## Token tracking
|
|
72
|
+
|
|
73
|
+
After completing your review, run:
|
|
74
|
+
```
|
|
75
|
+
bd remember "<your-label> <model> tokens: input=<N> output=<N>"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Rules
|
|
79
|
+
|
|
80
|
+
- NEVER push to the base branch
|
|
81
|
+
- NEVER close issues -- only the doer closes tasks
|
|
82
|
+
- NEVER write feedback.md -- return structured output only
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Claude-format agent files to OpenCode format at install time.
|
|
3
|
+
*
|
|
4
|
+
* Claude frontmatter: name, description, tools (comma/list)
|
|
5
|
+
* OpenCode frontmatter: description, mode: subagent, permission map (no name)
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This mirrors apra-pm/install.mjs:transformAgentForOpenCode -- keep both in sync
|
|
8
|
+
* when adding new tool mappings or frontmatter fields.
|
|
9
|
+
*/
|
|
10
|
+
export declare function transformAgentForOpenCode(content: string, _filename: string): string;
|
|
11
|
+
//# sourceMappingURL=agent-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-transform.d.ts","sourceRoot":"","sources":["../../src/cli/agent-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8BH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAsCpF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Claude-format agent files to OpenCode format at install time.
|
|
3
|
+
*
|
|
4
|
+
* Claude frontmatter: name, description, tools (comma/list)
|
|
5
|
+
* OpenCode frontmatter: description, mode: subagent, permission map (no name)
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This mirrors apra-pm/install.mjs:transformAgentForOpenCode -- keep both in sync
|
|
8
|
+
* when adding new tool mappings or frontmatter fields.
|
|
9
|
+
*/
|
|
10
|
+
function parseToolsList(toolsRaw) {
|
|
11
|
+
return toolsRaw
|
|
12
|
+
.replace(/^\[/, '')
|
|
13
|
+
.replace(/\]$/, '')
|
|
14
|
+
.split(',')
|
|
15
|
+
.map(t => t.trim())
|
|
16
|
+
.filter(Boolean);
|
|
17
|
+
}
|
|
18
|
+
function buildPermissionMap(tools) {
|
|
19
|
+
const toolSet = new Set(tools);
|
|
20
|
+
return {
|
|
21
|
+
edit: toolSet.has('Edit') ? 'allow' : 'deny',
|
|
22
|
+
write: toolSet.has('Write') ? 'allow' : 'allow',
|
|
23
|
+
bash: toolSet.has('Bash') ? 'allow' : 'deny',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function buildDefaultPermissionMap() {
|
|
27
|
+
return { edit: 'deny', write: 'allow', bash: 'deny' };
|
|
28
|
+
}
|
|
29
|
+
export function transformAgentForOpenCode(content, _filename) {
|
|
30
|
+
const fmMatch = content.match(/^---\s*\n([\s\S]*?)\n---\s*\n/);
|
|
31
|
+
if (!fmMatch)
|
|
32
|
+
return content;
|
|
33
|
+
const frontmatter = fmMatch[1];
|
|
34
|
+
const body = content.slice(fmMatch[0].length);
|
|
35
|
+
let description = '';
|
|
36
|
+
let tools = [];
|
|
37
|
+
let hasTools = false;
|
|
38
|
+
for (const line of frontmatter.split('\n')) {
|
|
39
|
+
const descMatch = line.match(/^description:\s*(.+)/);
|
|
40
|
+
if (descMatch) {
|
|
41
|
+
description = descMatch[1].trim();
|
|
42
|
+
}
|
|
43
|
+
const toolsMatch = line.match(/^tools:\s*(.+)/);
|
|
44
|
+
if (toolsMatch) {
|
|
45
|
+
hasTools = true;
|
|
46
|
+
tools = parseToolsList(toolsMatch[1].trim());
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const perm = hasTools ? buildPermissionMap(tools) : buildDefaultPermissionMap();
|
|
50
|
+
const opencodeFm = [
|
|
51
|
+
'---',
|
|
52
|
+
`description: ${description}`,
|
|
53
|
+
'mode: subagent',
|
|
54
|
+
'permission:',
|
|
55
|
+
` edit: ${perm.edit}`,
|
|
56
|
+
` write: ${perm.write}`,
|
|
57
|
+
` bash: ${perm.bash}`,
|
|
58
|
+
'---',
|
|
59
|
+
'',
|
|
60
|
+
].join('\n');
|
|
61
|
+
return opencodeFm + body;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=agent-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-transform.js","sourceRoot":"","sources":["../../src/cli/agent-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,SAAS,cAAc,CAAC,QAAgB;IACtC,OAAO,QAAQ;SACZ,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC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AAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAChD,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,GAAG,IAAI,CAAC;YAChB,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC;IAEhF,MAAM,UAAU,GAAG;QACjB,KAAK;QACL,gBAAgB,WAAW,EAAE;QAC7B,gBAAgB;QAChB,aAAa;QACb,WAAW,IAAI,CAAC,IAAI,EAAE;QACtB,YAAY,IAAI,CAAC,KAAK,EAAE;QACxB,WAAW,IAAI,CAAC,IAAI,EAAE;QACtB,KAAK;QACL,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,UAAU,GAAG,IAAI,CAAC;AAC3B,CAAC"}
|
package/dist/cli/config.d.ts
CHANGED
package/dist/cli/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,eAAO,MAAM,UAAU,QAAiC,CAAC;AACzD,eAAO,MAAM,OAAO,QAA+B,CAAC;AACpD,eAAO,MAAM,SAAS,QAAiC,CAAC;AACxD,eAAO,MAAM,WAAW,QAAmC,CAAC;AAC5D,eAAO,MAAM,QAAQ,QAAgC,CAAC;AACtD,eAAO,MAAM,mBAAmB,QAA6C,CAAC;AAE9E,eAAO,MAAM,oBAAoB,oIAOvB,CAAC;AAEX,eAAO,MAAM,uBA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5D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAS3E;AAED,wBAAgB,iBAAiB,IAAI,0BAA0B,CAyB9D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAQ5F"}
|
package/dist/cli/config.js
CHANGED
|
@@ -40,6 +40,7 @@ export const PROVIDER_STANDARD_MODELS = {
|
|
|
40
40
|
codex: 'gpt-5.4',
|
|
41
41
|
copilot: 'claude-sonnet-4-5',
|
|
42
42
|
agy: 'gemini-3.5-flash',
|
|
43
|
+
opencode: 'ollama/qwen3-coder:30b',
|
|
43
44
|
};
|
|
44
45
|
export function getProviderInstallConfig(provider) {
|
|
45
46
|
switch (provider) {
|
|
@@ -49,6 +50,7 @@ export function getProviderInstallConfig(provider) {
|
|
|
49
50
|
settingsFile: path.join(home, '.gemini', 'antigravity-cli', 'settings.json'),
|
|
50
51
|
skillsDir: path.join(home, '.gemini', 'antigravity-cli', 'skills', 'pm'),
|
|
51
52
|
fleetSkillsDir: path.join(home, '.gemini', 'antigravity-cli', 'skills', 'fleet'),
|
|
53
|
+
agentsDir: path.join(home, '.gemini', 'antigravity-cli', 'agents'),
|
|
52
54
|
name: 'Antigravity',
|
|
53
55
|
};
|
|
54
56
|
case 'gemini':
|
|
@@ -57,6 +59,7 @@ export function getProviderInstallConfig(provider) {
|
|
|
57
59
|
settingsFile: path.join(home, '.gemini', 'settings.json'),
|
|
58
60
|
skillsDir: path.join(home, '.gemini', 'skills', 'pm'),
|
|
59
61
|
fleetSkillsDir: path.join(home, '.gemini', 'skills', 'fleet'),
|
|
62
|
+
agentsDir: path.join(home, '.gemini', 'agents'),
|
|
60
63
|
name: 'Gemini',
|
|
61
64
|
};
|
|
62
65
|
case 'codex':
|
|
@@ -65,6 +68,7 @@ export function getProviderInstallConfig(provider) {
|
|
|
65
68
|
settingsFile: path.join(home, '.codex', 'config.toml'),
|
|
66
69
|
skillsDir: path.join(home, '.codex', 'skills', 'pm'),
|
|
67
70
|
fleetSkillsDir: path.join(home, '.codex', 'skills', 'fleet'),
|
|
71
|
+
agentsDir: undefined,
|
|
68
72
|
name: 'Codex',
|
|
69
73
|
};
|
|
70
74
|
case 'copilot':
|
|
@@ -73,8 +77,18 @@ export function getProviderInstallConfig(provider) {
|
|
|
73
77
|
settingsFile: path.join(home, '.copilot', 'settings.json'),
|
|
74
78
|
skillsDir: path.join(home, '.copilot', 'skills', 'pm'),
|
|
75
79
|
fleetSkillsDir: path.join(home, '.copilot', 'skills', 'fleet'),
|
|
80
|
+
agentsDir: undefined,
|
|
76
81
|
name: 'Copilot',
|
|
77
82
|
};
|
|
83
|
+
case 'opencode':
|
|
84
|
+
return {
|
|
85
|
+
configDir: path.join(home, '.config', 'opencode'),
|
|
86
|
+
settingsFile: path.join(home, '.config', 'opencode', 'opencode.json'),
|
|
87
|
+
skillsDir: path.join(home, '.config', 'opencode', 'skills', 'pm'),
|
|
88
|
+
fleetSkillsDir: path.join(home, '.config', 'opencode', 'skills', 'fleet'),
|
|
89
|
+
agentsDir: path.join(home, '.config', 'opencode', 'agents'),
|
|
90
|
+
name: 'OpenCode',
|
|
91
|
+
};
|
|
78
92
|
case 'claude':
|
|
79
93
|
default:
|
|
80
94
|
return {
|
|
@@ -82,6 +96,7 @@ export function getProviderInstallConfig(provider) {
|
|
|
82
96
|
settingsFile: path.join(home, '.claude', 'settings.json'),
|
|
83
97
|
skillsDir: path.join(home, '.claude', 'skills', 'pm'),
|
|
84
98
|
fleetSkillsDir: path.join(home, '.claude', 'skills', 'fleet'),
|
|
99
|
+
agentsDir: path.join(home, '.claude', 'agents'),
|
|
85
100
|
name: 'Claude',
|
|
86
101
|
};
|
|
87
102
|
}
|
package/dist/cli/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot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AC3B,OAAO;gBACL,SAAS,EAAE;oBACT,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;wBACV,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QACD,iCAAiC;QACjC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC1D,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,IAAkC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW,EAAE,KAAsC;IACpF,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG;QACtB,KAAK;QACL,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACtC,CAAC;IACF,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
package/dist/cli/install.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProviderInstallConfig } from './config.js';
|
|
1
2
|
/** Override isSea() result -- for tests only. Pass null to restore default. */
|
|
2
3
|
export declare function _setSeaOverride(v: boolean | null): void;
|
|
3
4
|
export declare function isSea(): boolean;
|
|
@@ -18,9 +19,13 @@ interface AssetManifest {
|
|
|
18
19
|
scripts: Record<string, string>;
|
|
19
20
|
skills: Record<string, string>;
|
|
20
21
|
fleetSkills: Record<string, string>;
|
|
22
|
+
agents: Record<string, string>;
|
|
23
|
+
workflows: Record<string, string>;
|
|
21
24
|
}
|
|
22
25
|
/** Inject a manifest for tests — avoids SEA asset extraction. Pass null to restore default. */
|
|
23
26
|
export declare function _setManifestOverride(m: AssetManifest | null): void;
|
|
27
|
+
export declare function pruneInvalidRules(allow: string[], providerName: string): string[];
|
|
28
|
+
export declare function buildRequiredPerms(paths: ProviderInstallConfig): string[];
|
|
24
29
|
export declare function isApraFleetRunning(): boolean;
|
|
25
30
|
export declare function killApraFleet(): void;
|
|
26
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/cli/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/cli/install.ts"],"names":[],"mappings":"AAMA,OAAO,EASL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAKrB,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAsB;AAE9E,wBAAgB,KAAK,IAAI,OAAO,CAQ/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAe5C;AAcD,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AA6ED,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAA2B;AAmH9F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,EAAE,CAgBzE;AAwGD,wBAAgB,kBAAkB,IAAI,OAAO,CAoB5C;AAED,wBAAgB,aAAa,IAAI,IAAI,CAOpC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAUlE;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAua9D"}
|
package/dist/cli/install.js
CHANGED
|
@@ -4,6 +4,7 @@ import os from 'node:os';
|
|
|
4
4
|
import { execSync, execFileSync } from 'node:child_process';
|
|
5
5
|
import { serverVersion } from '../version.js';
|
|
6
6
|
import { BIN_DIR, HOOKS_DIR, SCRIPTS_DIR, getProviderInstallConfig, readConfig, writeConfig, writeInstallConfig, PROVIDER_STANDARD_MODELS } from './config.js';
|
|
7
|
+
import { transformAgentForOpenCode } from './agent-transform.js';
|
|
7
8
|
// Detect SEA mode
|
|
8
9
|
let _seaOverride = null;
|
|
9
10
|
/** Override isSea() result -- for tests only. Pass null to restore default. */
|
|
@@ -101,10 +102,32 @@ function buildDevManifest(root) {
|
|
|
101
102
|
continue; // skip build scripts
|
|
102
103
|
scripts[entry] = `scripts/${entry}`;
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
// Source PM skills and agents from vendor/apra-pm submodule (dev mode),
|
|
106
|
+
// fall back to dist/ for npm global installs where submodule is absent.
|
|
107
|
+
const vendorPmSkills = path.join(root, 'vendor', 'apra-pm', 'skills', 'pm');
|
|
108
|
+
const vendorAgents = path.join(root, 'vendor', 'apra-pm', 'agents');
|
|
109
|
+
const pmSkillsDir = fs.existsSync(vendorPmSkills) ? vendorPmSkills : path.join(root, 'dist', 'skills', 'pm');
|
|
110
|
+
const agentsDir = fs.existsSync(vendorAgents) ? vendorAgents : path.join(root, 'dist', 'agents');
|
|
111
|
+
const pmBase = fs.existsSync(vendorPmSkills) ? 'vendor/apra-pm/skills/pm' : 'dist/skills/pm';
|
|
112
|
+
const agentsBase = fs.existsSync(vendorAgents) ? 'vendor/apra-pm/agents' : 'dist/agents';
|
|
113
|
+
const skills = collectFilesRec(pmSkillsDir, pmBase, pmBase);
|
|
114
|
+
const agents = collectFilesRec(agentsDir, agentsBase, agentsBase);
|
|
105
115
|
const fleetSkills = collectFilesRec(path.join(root, 'skills', 'fleet'), 'skills/fleet');
|
|
116
|
+
// Collect auto-sprint.js from vendor/apra-pm/.claude/workflows (or dist/workflows fallback)
|
|
117
|
+
const vendorWorkflows = path.join(root, 'vendor', 'apra-pm', '.claude', 'workflows');
|
|
118
|
+
const workflowsSrc = fs.existsSync(vendorWorkflows)
|
|
119
|
+
? vendorWorkflows
|
|
120
|
+
: path.join(root, 'dist', 'workflows');
|
|
121
|
+
const workflows = {};
|
|
122
|
+
if (fs.existsSync(workflowsSrc)) {
|
|
123
|
+
for (const f of fs.readdirSync(workflowsSrc)) {
|
|
124
|
+
if (f.endsWith('.js')) {
|
|
125
|
+
workflows[f] = path.join(workflowsSrc, f).replace(/\\/g, '/');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
106
129
|
const vf = JSON.parse(fs.readFileSync(path.join(root, 'version.json'), 'utf-8'));
|
|
107
|
-
return { version: vf.version, hooks, scripts, skills, fleetSkills };
|
|
130
|
+
return { version: vf.version, hooks, scripts, skills, fleetSkills, agents, workflows };
|
|
108
131
|
}
|
|
109
132
|
let _manifestOverride = null;
|
|
110
133
|
/** Inject a manifest for tests — avoids SEA asset extraction. Pass null to restore default. */
|
|
@@ -207,19 +230,35 @@ function mergeHooksConfig(paths, hooksConfig, provider) {
|
|
|
207
230
|
writeConfig(paths, settings);
|
|
208
231
|
}
|
|
209
232
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
233
|
+
const CLAUDE_INVALID_RULES = ['tracker_*'];
|
|
234
|
+
export function pruneInvalidRules(allow, providerName) {
|
|
235
|
+
if (providerName !== 'Claude')
|
|
236
|
+
return allow;
|
|
237
|
+
return allow.filter(rule => !CLAUDE_INVALID_RULES.includes(rule));
|
|
238
|
+
}
|
|
239
|
+
export function buildRequiredPerms(paths) {
|
|
240
|
+
const perms = [
|
|
213
241
|
'mcp__apra-fleet__*',
|
|
214
242
|
'activate_skill(*)',
|
|
215
|
-
'tracker_*',
|
|
216
243
|
'Agent(*)',
|
|
217
244
|
`Read(${paths.skillsDir.replace(/\\/g, '/')}/**)`,
|
|
218
245
|
`Read(${paths.fleetSkillsDir.replace(/\\/g, '/')}/**)`,
|
|
219
246
|
`Read(${path.join(paths.configDir, 'skills').replace(/\\/g, '/')}/**)`,
|
|
220
247
|
];
|
|
248
|
+
if (paths.agentsDir) {
|
|
249
|
+
perms.push(`Read(${paths.agentsDir.replace(/\\/g, '/')}/**)`);
|
|
250
|
+
}
|
|
251
|
+
if (paths.name !== 'Claude') {
|
|
252
|
+
perms.push('tracker_*');
|
|
253
|
+
}
|
|
254
|
+
return perms;
|
|
255
|
+
}
|
|
256
|
+
function mergePermissions(paths, extraPerms = []) {
|
|
257
|
+
const settings = readConfig(paths);
|
|
258
|
+
const requiredPerms = [...buildRequiredPerms(paths), ...extraPerms];
|
|
221
259
|
settings.permissions = settings.permissions || {};
|
|
222
260
|
settings.permissions.allow = settings.permissions.allow || [];
|
|
261
|
+
settings.permissions.allow = pruneInvalidRules(settings.permissions.allow, paths.name);
|
|
223
262
|
const existing = new Set(settings.permissions.allow);
|
|
224
263
|
for (const perm of requiredPerms) {
|
|
225
264
|
if (!existing.has(perm)) {
|
|
@@ -275,6 +314,16 @@ function mergeCopilotConfig(paths, mcpConfig) {
|
|
|
275
314
|
settings.mcpServers['apra-fleet'] = mcpConfig;
|
|
276
315
|
writeConfig(paths, settings);
|
|
277
316
|
}
|
|
317
|
+
function mergeOpenCodeConfig(paths, mcpConfig) {
|
|
318
|
+
const settings = readConfig(paths);
|
|
319
|
+
settings.mcp = settings.mcp || {};
|
|
320
|
+
settings.mcp['apra-fleet'] = {
|
|
321
|
+
type: 'local',
|
|
322
|
+
command: [mcpConfig.command, ...(mcpConfig.args || [])],
|
|
323
|
+
enabled: true,
|
|
324
|
+
};
|
|
325
|
+
writeConfig(paths, settings);
|
|
326
|
+
}
|
|
278
327
|
function mergeCodexConfig(paths, mcpConfig) {
|
|
279
328
|
const settings = readConfig(paths);
|
|
280
329
|
settings.mcp_servers = settings.mcp_servers || {};
|
|
@@ -355,11 +404,11 @@ Usage:
|
|
|
355
404
|
apra-fleet install --skill none Skip skill installation
|
|
356
405
|
apra-fleet install --no-skill Same as --skill none
|
|
357
406
|
apra-fleet install --force Stop a running server before installing
|
|
358
|
-
apra-fleet install --llm <provider> Target LLM provider: claude (default), gemini, codex, copilot, agy
|
|
407
|
+
apra-fleet install --llm <provider> Target LLM provider: claude (default), gemini, codex, copilot, agy, opencode
|
|
359
408
|
apra-fleet install --help Show this help
|
|
360
409
|
|
|
361
410
|
Options:
|
|
362
|
-
--llm <provider> LLM provider to configure. Supported: claude, gemini, codex, copilot, agy.
|
|
411
|
+
--llm <provider> LLM provider to configure. Supported: claude, gemini, codex, copilot, agy, opencode.
|
|
363
412
|
Defaults to claude. Note: --llm gemini shows a warning about sequential
|
|
364
413
|
dispatch — Gemini does not support background agents, so fleet operations
|
|
365
414
|
run sequentially rather than in parallel.
|
|
@@ -381,7 +430,7 @@ Options:
|
|
|
381
430
|
llm = args[idx + 1];
|
|
382
431
|
}
|
|
383
432
|
}
|
|
384
|
-
const supported = ['claude', 'gemini', 'codex', 'copilot', 'agy'];
|
|
433
|
+
const supported = ['claude', 'gemini', 'codex', 'copilot', 'agy', 'opencode'];
|
|
385
434
|
if (!supported.includes(llm)) {
|
|
386
435
|
console.error(`Error: Unsupported LLM provider "${llm}". Supported: ${supported.join(', ')}`);
|
|
387
436
|
process.exit(1);
|
|
@@ -433,7 +482,12 @@ Options:
|
|
|
433
482
|
}
|
|
434
483
|
const installFleet = skillMode === 'fleet' || skillMode === 'pm' || skillMode === 'all';
|
|
435
484
|
const installPm = skillMode === 'pm' || skillMode === 'all';
|
|
436
|
-
const
|
|
485
|
+
const installAgents = installPm && paths.agentsDir !== undefined;
|
|
486
|
+
let totalSteps = (installFleet && installPm) ? 8 : installFleet ? 7 : installPm ? 8 : 6;
|
|
487
|
+
if (installAgents)
|
|
488
|
+
totalSteps++;
|
|
489
|
+
if (installPm)
|
|
490
|
+
totalSteps++; // cost.js extraction + workflow copy step
|
|
437
491
|
if (llm === 'gemini' && (installFleet || installPm)) {
|
|
438
492
|
console.warn(`\n⚠ Note: Gemini does not support background agents. If you plan to use Gemini as the\n PM/orchestrator, fleet operations will run sequentially (no parallel dispatch).\n For best orchestration performance, consider using Claude. See docs for details.\n`);
|
|
439
493
|
}
|
|
@@ -501,13 +555,15 @@ ${killHint}
|
|
|
501
555
|
}
|
|
502
556
|
// --- Step 4: Configure hooks + statusline in settings.json ---
|
|
503
557
|
console.log(` [4/${totalSteps}] Configuring ${paths.name} settings...`);
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
558
|
+
// OpenCode has a strict config schema -- hooks/statusLine/defaultModel are not valid keys
|
|
559
|
+
if (llm !== 'opencode') {
|
|
560
|
+
const installedHooksConfig = JSON.parse(fs.readFileSync(path.join(HOOKS_DIR, 'hooks-config.json'), 'utf-8'));
|
|
561
|
+
mergeHooksConfig(paths, installedHooksConfig, llm);
|
|
562
|
+
const statuslineScript = path.join(SCRIPTS_DIR, 'fleet-statusline.sh');
|
|
563
|
+
configureStatusline(paths, statuslineScript);
|
|
564
|
+
const standardModel = PROVIDER_STANDARD_MODELS[llm] ?? PROVIDER_STANDARD_MODELS['claude'];
|
|
565
|
+
writeDefaultModel(paths, standardModel);
|
|
566
|
+
}
|
|
511
567
|
// --- Step 5: Register MCP server ---
|
|
512
568
|
console.log(` [5/${totalSteps}] Registering MCP server...`);
|
|
513
569
|
const mcpConfig = isSea()
|
|
@@ -541,6 +597,9 @@ ${killHint}
|
|
|
541
597
|
else if (llm === 'agy') {
|
|
542
598
|
mergeAgyConfig(paths, mcpConfig);
|
|
543
599
|
}
|
|
600
|
+
else if (llm === 'opencode') {
|
|
601
|
+
mergeOpenCodeConfig(paths, mcpConfig);
|
|
602
|
+
}
|
|
544
603
|
// --- Step 6: Install fleet skill (optional) ---
|
|
545
604
|
if (skillMode === 'pm') {
|
|
546
605
|
console.warn(`\n⚠ Note: PM skill depends on fleet skill — installing fleet skill first.\n`);
|
|
@@ -562,6 +621,20 @@ ${killHint}
|
|
|
562
621
|
}
|
|
563
622
|
}
|
|
564
623
|
// --- Step 7: Install PM skill (optional) ---
|
|
624
|
+
// Empty-submodule guard: vendor/apra-pm dir exists but was not initialized
|
|
625
|
+
if (installPm && !isSea()) {
|
|
626
|
+
const root = findProjectRoot();
|
|
627
|
+
const vendorDir = path.join(root, 'vendor', 'apra-pm');
|
|
628
|
+
if (fs.existsSync(vendorDir)) {
|
|
629
|
+
const skillMarker = path.join(vendorDir, 'skills', 'pm', 'SKILL.md');
|
|
630
|
+
if (!fs.existsSync(skillMarker)) {
|
|
631
|
+
console.error(`Error: vendor/apra-pm exists but appears empty (non-recursive clone).
|
|
632
|
+
Run: git submodule update --init --recursive
|
|
633
|
+
Then re-run: apra-fleet install`);
|
|
634
|
+
process.exit(1);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
565
638
|
if (installPm) {
|
|
566
639
|
console.log(` [7/${totalSteps}] Installing PM skill...`);
|
|
567
640
|
clearDirSync(paths.skillsDir);
|
|
@@ -573,15 +646,107 @@ ${killHint}
|
|
|
573
646
|
}
|
|
574
647
|
}
|
|
575
648
|
else {
|
|
576
|
-
// Dev mode:
|
|
577
|
-
const
|
|
649
|
+
// Dev/npm mode: prefer vendor/apra-pm submodule, fall back to dist/
|
|
650
|
+
const root = findProjectRoot();
|
|
651
|
+
const vendorPm = path.join(root, 'vendor', 'apra-pm', 'skills', 'pm');
|
|
652
|
+
const pmSrc = fs.existsSync(vendorPm) ? vendorPm : path.join(root, 'dist', 'skills', 'pm');
|
|
578
653
|
copyDirSync(pmSrc, paths.skillsDir);
|
|
579
654
|
}
|
|
580
655
|
}
|
|
656
|
+
// --- Step 8: cost.js extraction + auto-sprint workflow copy (PM only) ---
|
|
657
|
+
if (installPm) {
|
|
658
|
+
console.log(` [8/${totalSteps}] Installing PM cost functions + workflow...`);
|
|
659
|
+
// Locate auto-sprint.js source
|
|
660
|
+
let workflowContent = null;
|
|
661
|
+
if (isSea()) {
|
|
662
|
+
try {
|
|
663
|
+
workflowContent = extractAsset('auto-sprint.js');
|
|
664
|
+
}
|
|
665
|
+
catch { /* absent in older SEA build */ }
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
const root = findProjectRoot();
|
|
669
|
+
const wfPath = path.join(root, 'vendor', 'apra-pm', '.claude', 'workflows', 'auto-sprint.js');
|
|
670
|
+
const wfFallback = path.join(root, 'dist', 'workflows', 'auto-sprint.js');
|
|
671
|
+
const wfSrc = fs.existsSync(wfPath) ? wfPath : fs.existsSync(wfFallback) ? wfFallback : null;
|
|
672
|
+
if (wfSrc)
|
|
673
|
+
workflowContent = fs.readFileSync(wfSrc, 'utf-8');
|
|
674
|
+
}
|
|
675
|
+
if (workflowContent) {
|
|
676
|
+
// Extract PURE_FUNCTIONS_BEGIN/END block and write cost.js to skill dir
|
|
677
|
+
const blockStart = workflowContent.indexOf('// PURE_FUNCTIONS_BEGIN');
|
|
678
|
+
const blockEndIdx = workflowContent.indexOf('// PURE_FUNCTIONS_END');
|
|
679
|
+
const blockEnd = blockEndIdx >= 0 ? blockEndIdx + '// PURE_FUNCTIONS_END'.length : -1;
|
|
680
|
+
if (blockStart >= 0 && blockEnd > blockStart) {
|
|
681
|
+
const block = workflowContent.slice(blockStart, blockEnd);
|
|
682
|
+
const costJs = [
|
|
683
|
+
'// Auto-generated by apra-fleet install -- do not edit directly.',
|
|
684
|
+
'// Source: apra-pm/.claude/workflows/auto-sprint.js (PURE_FUNCTIONS_BEGIN..END block)',
|
|
685
|
+
'',
|
|
686
|
+
block,
|
|
687
|
+
'',
|
|
688
|
+
"if (typeof module !== 'undefined') {",
|
|
689
|
+
' module.exports = {',
|
|
690
|
+
' DEFAULT_CALIBRATION,',
|
|
691
|
+
' computeSprintQuote,',
|
|
692
|
+
' computeSprintAnalysis,',
|
|
693
|
+
' accumulateBucketTokens,',
|
|
694
|
+
' computeUpdatedCalibration,',
|
|
695
|
+
' buildSprintSummary,',
|
|
696
|
+
' reviewerModelFor,',
|
|
697
|
+
' };',
|
|
698
|
+
'}',
|
|
699
|
+
].join('\n');
|
|
700
|
+
writeAssetFile(path.join(paths.skillsDir, 'cost.js'), costJs);
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
console.warn(' [!] PURE_FUNCTIONS_BEGIN/END markers not found -- cost.js not written');
|
|
704
|
+
}
|
|
705
|
+
// Claude only: copy full auto-sprint.js to ~/.claude/workflows/
|
|
706
|
+
if (llm === 'claude') {
|
|
707
|
+
const wfDest = path.join(os.homedir(), '.claude', 'workflows', 'auto-sprint.js');
|
|
708
|
+
fs.mkdirSync(path.dirname(wfDest), { recursive: true });
|
|
709
|
+
writeAssetFile(wfDest, workflowContent);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
console.warn(' [!] auto-sprint.js not found -- cost.js and workflow not written');
|
|
714
|
+
}
|
|
715
|
+
}
|
|
581
716
|
if (!installFleet && !installPm) {
|
|
582
717
|
console.log(` Skipping skills (use --skill all to install, or omit --skill for default)`);
|
|
583
718
|
}
|
|
584
|
-
// ---
|
|
719
|
+
// --- Agent install step (only when agentsDir is defined and PM is installed) ---
|
|
720
|
+
if (installAgents) {
|
|
721
|
+
const agentStep = (installFleet && installPm) ? 9 : installPm ? 9 : 7;
|
|
722
|
+
console.log(` [${agentStep}/${totalSteps}] Installing PM agents...`);
|
|
723
|
+
const agentsDestDir = paths.agentsDir;
|
|
724
|
+
fs.mkdirSync(agentsDestDir, { recursive: true });
|
|
725
|
+
if (isSea()) {
|
|
726
|
+
for (const [name, assetKey] of Object.entries(manifest.agents)) {
|
|
727
|
+
let content = extractAsset(assetKey);
|
|
728
|
+
if (llm === 'opencode') {
|
|
729
|
+
content = transformAgentForOpenCode(content, name);
|
|
730
|
+
}
|
|
731
|
+
writeAssetFile(path.join(agentsDestDir, name), content);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
const root = findProjectRoot();
|
|
736
|
+
const vendorAgents = path.join(root, 'vendor', 'apra-pm', 'agents');
|
|
737
|
+
const agentsSrc = fs.existsSync(vendorAgents) ? vendorAgents : path.join(root, 'dist', 'agents');
|
|
738
|
+
for (const entry of fs.readdirSync(agentsSrc, { withFileTypes: true })) {
|
|
739
|
+
if (entry.isDirectory())
|
|
740
|
+
continue;
|
|
741
|
+
let content = fs.readFileSync(path.join(agentsSrc, entry.name), 'utf-8');
|
|
742
|
+
if (llm === 'opencode') {
|
|
743
|
+
content = transformAgentForOpenCode(content, entry.name);
|
|
744
|
+
}
|
|
745
|
+
writeAssetFile(path.join(agentsDestDir, entry.name), content);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
// --- Beads install step ---
|
|
585
750
|
// shell:true required on Windows — npm global packages install as .cmd wrappers
|
|
586
751
|
// that cannot be directly spawned by Node without a shell
|
|
587
752
|
console.log(` [${totalSteps}/${totalSteps}] Installing Beads task tracker...`);
|
|
@@ -600,8 +765,14 @@ ${killHint}
|
|
|
600
765
|
// non-fatal: warn but don't fail the install
|
|
601
766
|
console.warn(' ⚠ Beads install skipped — npm not available or install failed');
|
|
602
767
|
}
|
|
603
|
-
//
|
|
604
|
-
|
|
768
|
+
// OpenCode uses --dangerously-skip-permissions and per-agent permission: frontmatter;
|
|
769
|
+
// a top-level "permissions" key is invalid in opencode.json
|
|
770
|
+
if (llm !== 'opencode') {
|
|
771
|
+
const extraPerms = (llm === 'claude' && installPm)
|
|
772
|
+
? ['Skill(auto-sprint)', 'Workflow(auto-sprint)']
|
|
773
|
+
: [];
|
|
774
|
+
mergePermissions(paths, extraPerms);
|
|
775
|
+
}
|
|
605
776
|
// Write install-config.json (merge provider entry)
|
|
606
777
|
writeInstallConfig(llm, skillMode);
|
|
607
778
|
// --- Done ---
|
|
@@ -621,10 +792,16 @@ Apra Fleet ${serverVersion} installed successfully for ${paths.name}.
|
|
|
621
792
|
Binary: ${BIN_DIR}
|
|
622
793
|
Hooks: ${HOOKS_DIR}
|
|
623
794
|
Scripts: ${SCRIPTS_DIR}
|
|
624
|
-
Settings: ${paths.settingsFile}${installFleet ? `\n Fleet Skill: ${paths.fleetSkillsDir}` : ''}${installPm ? `\n PM Skill: ${paths.skillsDir}` : ''}
|
|
795
|
+
Settings: ${paths.settingsFile}${installFleet ? `\n Fleet Skill: ${paths.fleetSkillsDir}` : ''}${installPm ? `\n PM Skill: ${paths.skillsDir}` : ''}${installAgents ? `\n Agents: ${paths.agentsDir}` : ''}
|
|
625
796
|
Beads: ${beadsVersion}
|
|
626
797
|
|
|
627
798
|
${instructions}${forceNote}
|
|
628
799
|
`);
|
|
800
|
+
if (llm === 'claude' && installPm) {
|
|
801
|
+
console.log(' /auto-sprint BD-1 (native workflow, current branch)');
|
|
802
|
+
console.log(' /auto-sprint BD-1 BD-2 (multiple sprint goals)');
|
|
803
|
+
console.log(' /pm (provider-agnostic skill, fleet-ready)');
|
|
804
|
+
console.log('');
|
|
805
|
+
}
|
|
629
806
|
}
|
|
630
807
|
//# sourceMappingURL=install.js.map
|