gsd-opencode 1.9.1 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/gsd-debugger.md +5 -5
- package/agents/gsd-set-model.md +287 -0
- package/agents/gsd-set-profile.md +239 -0
- package/agents/gsd-settings.md +303 -0
- package/bin/gsd-install.js +105 -0
- package/bin/gsd.js +352 -0
- package/bin/install.js +81 -1
- package/{command → commands}/gsd/add-phase.md +1 -1
- package/{command → commands}/gsd/audit-milestone.md +1 -1
- package/{command → commands}/gsd/debug.md +3 -3
- package/{command → commands}/gsd/discuss-phase.md +1 -1
- package/{command → commands}/gsd/execute-phase.md +1 -1
- package/{command → commands}/gsd/list-phase-assumptions.md +1 -1
- package/{command → commands}/gsd/map-codebase.md +1 -1
- package/{command → commands}/gsd/new-milestone.md +1 -1
- package/{command → commands}/gsd/new-project.md +71 -6
- package/{command → commands}/gsd/plan-phase.md +2 -2
- package/{command → commands}/gsd/research-phase.md +1 -1
- package/commands/gsd/set-model.md +77 -0
- package/commands/gsd/set-profile.md +46 -0
- package/commands/gsd/settings.md +33 -0
- package/{command → commands}/gsd/verify-work.md +1 -1
- package/get-shit-done/references/model-profiles.md +67 -36
- package/get-shit-done/workflows/list-phase-assumptions.md +1 -1
- package/get-shit-done/workflows/verify-work.md +5 -5
- package/lib/constants.js +193 -0
- package/package.json +34 -20
- package/src/commands/check.js +329 -0
- package/src/commands/config.js +337 -0
- package/src/commands/install.js +608 -0
- package/src/commands/list.js +256 -0
- package/src/commands/repair.js +519 -0
- package/src/commands/uninstall.js +732 -0
- package/src/commands/update.js +444 -0
- package/src/services/backup-manager.js +585 -0
- package/src/services/config.js +262 -0
- package/src/services/file-ops.js +830 -0
- package/src/services/health-checker.js +475 -0
- package/src/services/manifest-manager.js +301 -0
- package/src/services/migration-service.js +831 -0
- package/src/services/repair-service.js +846 -0
- package/src/services/scope-manager.js +303 -0
- package/src/services/settings.js +553 -0
- package/src/services/structure-detector.js +240 -0
- package/src/services/update-service.js +863 -0
- package/src/utils/hash.js +71 -0
- package/src/utils/interactive.js +222 -0
- package/src/utils/logger.js +128 -0
- package/src/utils/npm-registry.js +255 -0
- package/src/utils/path-resolver.js +226 -0
- package/command/gsd/set-profile.md +0 -111
- package/command/gsd/settings.md +0 -136
- /package/{command → commands}/gsd/add-todo.md +0 -0
- /package/{command → commands}/gsd/check-todos.md +0 -0
- /package/{command → commands}/gsd/complete-milestone.md +0 -0
- /package/{command → commands}/gsd/help.md +0 -0
- /package/{command → commands}/gsd/insert-phase.md +0 -0
- /package/{command → commands}/gsd/pause-work.md +0 -0
- /package/{command → commands}/gsd/plan-milestone-gaps.md +0 -0
- /package/{command → commands}/gsd/progress.md +0 -0
- /package/{command → commands}/gsd/quick.md +0 -0
- /package/{command → commands}/gsd/remove-phase.md +0 -0
- /package/{command → commands}/gsd/resume-work.md +0 -0
- /package/{command → commands}/gsd/update.md +0 -0
- /package/{command → commands}/gsd/whats-new.md +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-set-model
|
|
3
|
+
description: Configure models for a specific profile's stages (planning/execution/verification)
|
|
4
|
+
arguments:
|
|
5
|
+
- name: profile
|
|
6
|
+
description: "Profile name: quality, balanced, or budget (optional - will prompt if not provided)"
|
|
7
|
+
required: false
|
|
8
|
+
agent: gsd-set-model
|
|
9
|
+
tools:
|
|
10
|
+
- read
|
|
11
|
+
- write
|
|
12
|
+
- bash
|
|
13
|
+
- question
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<objective>
|
|
17
|
+
Configure the models assigned to each stage (planning, execution, verification) for a specific profile.
|
|
18
|
+
|
|
19
|
+
Unlike `/gsd-set-profile` which switches between profiles, this command lets you define *what models* a profile uses. Implementation lives in the `gsd-set-model` agent.
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
Run the model configuration flow using the `gsd-set-model` agent.
|
|
25
|
+
|
|
26
|
+
</process>
|
|
27
|
+
|
|
28
|
+
<examples>
|
|
29
|
+
|
|
30
|
+
**Configure the balanced profile:**
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/gsd-set-model balanced
|
|
34
|
+
|
|
35
|
+
Configuring models for: balanced
|
|
36
|
+
|
|
37
|
+
Select model for Planning stage:
|
|
38
|
+
> anthropic/claude-sonnet-4-20250514
|
|
39
|
+
|
|
40
|
+
Select model for Execution stage:
|
|
41
|
+
> anthropic/claude-sonnet-4-20250514
|
|
42
|
+
|
|
43
|
+
Select model for Verification stage:
|
|
44
|
+
> openai/gpt-4o-mini
|
|
45
|
+
|
|
46
|
+
✓ Updated balanced profile:
|
|
47
|
+
| Stage | Model |
|
|
48
|
+
|-------|-------|
|
|
49
|
+
| planning | anthropic/claude-sonnet-4-20250514 |
|
|
50
|
+
| execution | anthropic/claude-sonnet-4-20250514 |
|
|
51
|
+
| verification | openai/gpt-4o-mini |
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Interactive mode (no argument):**
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/gsd-set-model
|
|
58
|
+
|
|
59
|
+
Which profile do you want to configure?
|
|
60
|
+
> Balanced
|
|
61
|
+
|
|
62
|
+
Configuring models for: balanced
|
|
63
|
+
...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
</examples>
|
|
67
|
+
|
|
68
|
+
<success_criteria>
|
|
69
|
+
|
|
70
|
+
- [ ] `.planning/config.json` exists (or clear error shown)
|
|
71
|
+
- [ ] User selects a profile (or provides via argument)
|
|
72
|
+
- [ ] User selects models for all three stages from available models
|
|
73
|
+
- [ ] Profile preset is updated in `.planning/config.json`
|
|
74
|
+
- [ ] `opencode.json` is regenerated if the modified profile is active
|
|
75
|
+
- [ ] Clear confirmation shown with updated model assignments
|
|
76
|
+
|
|
77
|
+
</success_criteria>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-set-profile
|
|
3
|
+
description: Switch model profile for GSD agents (quality/balanced/budget)
|
|
4
|
+
arguments:
|
|
5
|
+
- name: profile
|
|
6
|
+
description: "Profile name: quality, balanced, or budget"
|
|
7
|
+
required: true
|
|
8
|
+
agent: gsd-set-profile
|
|
9
|
+
tools:
|
|
10
|
+
- read
|
|
11
|
+
- write
|
|
12
|
+
- bash
|
|
13
|
+
- question
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<objective>
|
|
17
|
+
Switch the project’s active model profile (quality/balanced/budget).
|
|
18
|
+
|
|
19
|
+
Implementation lives in the `gsd-set-profile` agent so we don’t duplicate the full switching/migration logic in multiple places.
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
Run the profile switch using the `gsd-set-profile` agent.
|
|
25
|
+
|
|
26
|
+
</process>
|
|
27
|
+
|
|
28
|
+
<examples>
|
|
29
|
+
|
|
30
|
+
**Switch to budget profile:**
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/gsd-set-profile budget
|
|
34
|
+
|
|
35
|
+
✓ Active profile set to: budget
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Switch to quality profile:**
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
/gsd-set-profile quality
|
|
42
|
+
|
|
43
|
+
✓ Active profile set to: quality
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</examples>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-settings
|
|
3
|
+
description: Configure GSD model profiles and workflow settings
|
|
4
|
+
agent: gsd-settings
|
|
5
|
+
tools:
|
|
6
|
+
- read
|
|
7
|
+
- write
|
|
8
|
+
- bash
|
|
9
|
+
- question
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<objective>
|
|
13
|
+
Open an interactive settings menu.
|
|
14
|
+
|
|
15
|
+
This delegates the implementation to the `gsd-settings` agent, which manages `.planning/config.json` and regenerates `opencode.json` when needed.
|
|
16
|
+
</objective>
|
|
17
|
+
|
|
18
|
+
<process>
|
|
19
|
+
|
|
20
|
+
Run the interactive settings flow using the `gsd-settings` agent.
|
|
21
|
+
|
|
22
|
+
</process>
|
|
23
|
+
|
|
24
|
+
<success_criteria>
|
|
25
|
+
|
|
26
|
+
- [ ] `.planning/` is validated as an existing GSD project (or a clear error is shown)
|
|
27
|
+
- [ ] Current settings are displayed (active profile, effective models, workflow toggles)
|
|
28
|
+
- [ ] User can update profile and workflow toggles via interactive UI
|
|
29
|
+
- [ ] Updates are persisted to `.planning/config.json`
|
|
30
|
+
- [ ] `opencode.json` is regenerated/updated to reflect effective models
|
|
31
|
+
- [ ] A clear confirmation is shown ("GSD ► SETTINGS UPDATED")
|
|
32
|
+
|
|
33
|
+
</success_criteria>
|
|
@@ -26,7 +26,7 @@ Output: {phase}-UAT.md tracking all test results. If issues found: diagnosed gap
|
|
|
26
26
|
</execution_context>
|
|
27
27
|
|
|
28
28
|
<context>
|
|
29
|
-
Phase:
|
|
29
|
+
Phase: `$ARGUMENTS` (optional)
|
|
30
30
|
- If provided: Test specific phase (e.g., "4")
|
|
31
31
|
- If not provided: Check for active sessions or prompt for phase
|
|
32
32
|
|
|
@@ -2,72 +2,103 @@
|
|
|
2
2
|
|
|
3
3
|
Model profiles control which OpenCode model each GSD agent uses. This allows balancing quality vs token spend.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
| gsd-
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
## Stage-to-Agent Mapping
|
|
6
|
+
|
|
7
|
+
Agents are grouped by stage. Each profile assigns a model to each stage:
|
|
8
|
+
|
|
9
|
+
| Stage | Agents |
|
|
10
|
+
|-------|--------|
|
|
11
|
+
| Planning | gsd-planner, gsd-plan-checker, gsd-phase-researcher, gsd-roadmapper, gsd-project-researcher, gsd-research-synthesizer, gsd-codebase-mapper |
|
|
12
|
+
| Execution | gsd-executor, gsd-debugger |
|
|
13
|
+
| Verification | gsd-verifier, gsd-integration-checker, gsd-set-profile, gsd-settings |
|
|
14
|
+
|
|
15
|
+
## Profile Configuration
|
|
16
|
+
|
|
17
|
+
Models are **user-configured**, not hardcoded. OpenCode supports multiple providers (Anthropic, OpenAI, local models, etc.), so available models vary per installation.
|
|
18
|
+
|
|
19
|
+
On first run, `/gsd-settings` runs the **Preset Setup Wizard**:
|
|
20
|
+
|
|
21
|
+
1. Queries `opencode models` to discover available models
|
|
22
|
+
2. Prompts user to select models for each profile/stage combination
|
|
23
|
+
3. Saves to `.planning/config.json`
|
|
24
|
+
|
|
25
|
+
Configuration structure:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"profiles": {
|
|
30
|
+
"active_profile": "balanced",
|
|
31
|
+
"presets": {
|
|
32
|
+
"quality": { "planning": "...", "execution": "...", "verification": "..." },
|
|
33
|
+
"balanced": { "planning": "...", "execution": "...", "verification": "..." },
|
|
34
|
+
"budget": { "planning": "...", "execution": "...", "verification": "..." }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
20
39
|
|
|
21
40
|
## Profile Philosophy
|
|
22
41
|
|
|
42
|
+
When configuring presets, consider these guidelines:
|
|
43
|
+
|
|
23
44
|
**quality** - Maximum reasoning power
|
|
24
|
-
|
|
25
|
-
-
|
|
45
|
+
|
|
46
|
+
- Use your most capable model for all stages
|
|
26
47
|
- Use when: quota available, critical architecture work
|
|
27
48
|
|
|
28
49
|
**balanced** (default) - Smart allocation
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
50
|
+
|
|
51
|
+
- Strong model for planning (where architecture decisions happen)
|
|
52
|
+
- Mid-tier model for execution (follows explicit instructions)
|
|
53
|
+
- Mid-tier model for verification (needs reasoning, not just pattern matching)
|
|
32
54
|
- Use when: normal development, good balance of quality and cost
|
|
33
55
|
|
|
34
|
-
**budget** - Minimal
|
|
35
|
-
|
|
36
|
-
-
|
|
56
|
+
**budget** - Minimal token spend
|
|
57
|
+
|
|
58
|
+
- Mid-tier model for anything that writes code
|
|
59
|
+
- Lightweight model for research and verification
|
|
37
60
|
- Use when: conserving quota, high-volume work, less critical phases
|
|
38
61
|
|
|
39
62
|
## Resolution Logic
|
|
40
63
|
|
|
41
64
|
Orchestrators resolve model before spawning:
|
|
42
65
|
|
|
66
|
+
```text
|
|
67
|
+
1. Read .planning/config.json
|
|
68
|
+
2. Get active_profile (default: "balanced")
|
|
69
|
+
3. Look up preset[profile][stage] for the agent's stage
|
|
70
|
+
4. Apply any custom_overrides[profile][stage] if set
|
|
71
|
+
5. Pass model parameter to Task call
|
|
43
72
|
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
3. Look up agent in table above
|
|
47
|
-
4. Pass model parameter to Task call
|
|
48
|
-
```
|
|
73
|
+
|
|
74
|
+
Agent-to-model mappings are written to `opencode.json` by `/gsd-set-profile` and `/gsd-settings`.
|
|
49
75
|
|
|
50
76
|
## Switching Profiles
|
|
51
77
|
|
|
52
78
|
Runtime: `/gsd-set-profile <profile>`
|
|
53
79
|
|
|
54
|
-
|
|
80
|
+
Interactive settings: `/gsd-settings`
|
|
81
|
+
|
|
82
|
+
Per-project default stored in `.planning/config.json`:
|
|
83
|
+
|
|
55
84
|
```json
|
|
56
85
|
{
|
|
57
|
-
"
|
|
86
|
+
"profiles": {
|
|
87
|
+
"active_profile": "balanced"
|
|
88
|
+
}
|
|
58
89
|
}
|
|
59
90
|
```
|
|
60
91
|
|
|
61
92
|
## Design Rationale
|
|
62
93
|
|
|
63
|
-
**Why
|
|
94
|
+
**Why use your strongest model for planning?**
|
|
64
95
|
Planning involves architecture decisions, goal decomposition, and task design. This is where model quality has the highest impact.
|
|
65
96
|
|
|
66
|
-
**Why
|
|
97
|
+
**Why mid-tier for execution?**
|
|
67
98
|
Executors follow explicit PLAN.md instructions. The plan already contains the reasoning; execution is implementation.
|
|
68
99
|
|
|
69
|
-
**Why
|
|
70
|
-
Verification requires goal-backward reasoning - checking if code *delivers* what the phase promised, not just pattern matching.
|
|
100
|
+
**Why mid-tier (not lightweight) for verification?**
|
|
101
|
+
Verification requires goal-backward reasoning - checking if code *delivers* what the phase promised, not just pattern matching. Mid-tier models handle this well; lightweight models may miss subtle gaps.
|
|
71
102
|
|
|
72
|
-
**Why
|
|
73
|
-
|
|
103
|
+
**Why lightweight for codebase mapping?**
|
|
104
|
+
Read-only exploration and pattern extraction. No complex reasoning required, just structured output from file contents.
|
|
@@ -46,7 +46,7 @@ Store resolved models for use in Task calls below.
|
|
|
46
46
|
find .planning/phases -name "*-UAT.md" -type f 2>/dev/null | head -5
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
**If active sessions exist AND no
|
|
49
|
+
**If active sessions exist AND no `$ARGUMENTS` provided:**
|
|
50
50
|
|
|
51
51
|
read each file's frontmatter (status, phase) and Current Test section.
|
|
52
52
|
|
|
@@ -68,12 +68,12 @@ Wait for user response.
|
|
|
68
68
|
- If user replies with number (1, 2) → Load that file, go to `resume_from_file`
|
|
69
69
|
- If user replies with phase number → Treat as new session, go to `create_uat_file`
|
|
70
70
|
|
|
71
|
-
**If active sessions exist AND
|
|
71
|
+
**If active sessions exist AND `$ARGUMENTS` provided:**
|
|
72
72
|
|
|
73
73
|
Check if session exists for that phase. If yes, offer to resume or restart.
|
|
74
74
|
If no, continue to `create_uat_file`.
|
|
75
75
|
|
|
76
|
-
**If no active sessions AND no
|
|
76
|
+
**If no active sessions AND no `$ARGUMENTS`:**
|
|
77
77
|
|
|
78
78
|
```
|
|
79
79
|
No active UAT sessions.
|
|
@@ -81,7 +81,7 @@ No active UAT sessions.
|
|
|
81
81
|
Provide a phase number to start testing (e.g., /gsd-verify-work 4)
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
**If no active sessions AND
|
|
84
|
+
**If no active sessions AND `$ARGUMENTS` provided:**
|
|
85
85
|
|
|
86
86
|
Continue to `create_uat_file`.
|
|
87
87
|
</step>
|
|
@@ -89,7 +89,7 @@ Continue to `create_uat_file`.
|
|
|
89
89
|
<step name="find_summaries">
|
|
90
90
|
**Find what to test:**
|
|
91
91
|
|
|
92
|
-
Parse
|
|
92
|
+
Parse `$ARGUMENTS` as phase number (e.g., "4") or plan number (e.g., "04-02").
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
95
|
# Find phase directory (match both zero-padded and unpadded)
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for the GSD-OpenCode CLI.
|
|
3
|
+
*
|
|
4
|
+
* This module centralizes all configuration values, file paths, and error codes
|
|
5
|
+
* used throughout the CLI to ensure consistency and maintainability.
|
|
6
|
+
*
|
|
7
|
+
* All exports are immutable constants. Do not modify these values at runtime.
|
|
8
|
+
*
|
|
9
|
+
* @module constants
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default global configuration directory path.
|
|
14
|
+
* Resolved relative to user's home directory.
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @example
|
|
17
|
+
* // On macOS/Linux: ~/.config/opencode
|
|
18
|
+
* // On Windows: ~\AppData\Roaming\opencode
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_CONFIG_DIR = '.config/opencode';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Local configuration directory name.
|
|
24
|
+
* Created in the current working directory for project-specific configuration.
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @example
|
|
27
|
+
* // Creates: ./.opencode/ in project root
|
|
28
|
+
*/
|
|
29
|
+
export const LOCAL_CONFIG_DIR = '.opencode';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Name of the version tracking file.
|
|
33
|
+
* Used to store the installed version of GSD-OpenCode.
|
|
34
|
+
* Stored in get-shit-done/ directory since it's fully owned by gsd-opencode.
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
export const VERSION_FILE = 'get-shit-done/VERSION';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Regex patterns for path replacement in markdown files.
|
|
41
|
+
* These patterns are used to update internal references during installation.
|
|
42
|
+
* @type {Object.<string, RegExp>}
|
|
43
|
+
*/
|
|
44
|
+
export const PATH_PATTERNS = {
|
|
45
|
+
/**
|
|
46
|
+
* Pattern to match @gsd-opencode/ references in markdown files.
|
|
47
|
+
* Used for replacing package references with actual paths.
|
|
48
|
+
*/
|
|
49
|
+
gsdReference: /@gsd-opencode\//g
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Source directories to copy during installation.
|
|
54
|
+
* These directories contain the core GSD-OpenCode assets.
|
|
55
|
+
*
|
|
56
|
+
* All directories use the 'commands' (plural) structure consistently
|
|
57
|
+
* in both source and destination. The FileOperations service copies
|
|
58
|
+
* files directly from source to target without path transformation.
|
|
59
|
+
*
|
|
60
|
+
* @type {string[]}
|
|
61
|
+
*/
|
|
62
|
+
export const DIRECTORIES_TO_COPY = ['agents', 'commands', 'get-shit-done'];
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Command directory mapping for source-to-destination path transformation.
|
|
66
|
+
*
|
|
67
|
+
* Since the source package now uses 'commands/' (plural) and the destination
|
|
68
|
+
* also uses 'commands/' (plural), this mapping ensures consistency.
|
|
69
|
+
* This enables future transformations if needed.
|
|
70
|
+
*
|
|
71
|
+
* @type {Object.<string, string>}
|
|
72
|
+
* @example
|
|
73
|
+
* // During install, files from sourceDir/commands/gsd/ are copied to targetDir/commands/gsd/
|
|
74
|
+
* const sourceDirName = COMMAND_DIR_MAPPING[destDirName]; // 'commands'
|
|
75
|
+
*/
|
|
76
|
+
export const COMMAND_DIR_MAPPING = {
|
|
77
|
+
'commands': 'commands' // Both source and destination use 'commands/'
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Name of the manifest file that tracks all installed files.
|
|
82
|
+
* Used for safe uninstallation with namespace protection.
|
|
83
|
+
* Stored in get-shit-done/ directory since it's fully owned by gsd-opencode.
|
|
84
|
+
* @type {string}
|
|
85
|
+
*/
|
|
86
|
+
export const MANIFEST_FILENAME = 'get-shit-done/INSTALLED_FILES.json';
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Directory name for uninstall backups.
|
|
90
|
+
* Created within the installation directory to store backups before removal.
|
|
91
|
+
* @type {string}
|
|
92
|
+
*/
|
|
93
|
+
export const UNINSTALL_BACKUP_DIR = '.backups';
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Legacy command directory name (singular).
|
|
97
|
+
* Used for detecting and migrating old installations.
|
|
98
|
+
* @type {string}
|
|
99
|
+
*/
|
|
100
|
+
export const OLD_COMMAND_DIR = 'command';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* New command directory name (plural).
|
|
104
|
+
* Used as the default for fresh installations.
|
|
105
|
+
* @type {string}
|
|
106
|
+
*/
|
|
107
|
+
export const NEW_COMMAND_DIR = 'commands';
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Structure type constants for directory structure detection.
|
|
111
|
+
* Used to identify which command directory structure is present.
|
|
112
|
+
* @type {Object.<string, string>}
|
|
113
|
+
*/
|
|
114
|
+
export const STRUCTURE_TYPES = {
|
|
115
|
+
/** Legacy structure: command/gsd/ (singular) */
|
|
116
|
+
OLD: 'old',
|
|
117
|
+
|
|
118
|
+
/** New structure: commands/gsd/ (plural) */
|
|
119
|
+
NEW: 'new',
|
|
120
|
+
|
|
121
|
+
/** Both structures exist (dual/migration state) */
|
|
122
|
+
DUAL: 'dual',
|
|
123
|
+
|
|
124
|
+
/** Neither structure exists (fresh install) */
|
|
125
|
+
NONE: 'none'
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Allowed namespace patterns for safe uninstallation.
|
|
130
|
+
* Files in these namespaces are safe to delete during uninstall.
|
|
131
|
+
* Files outside these namespaces are NEVER deleted, even if tracked.
|
|
132
|
+
*
|
|
133
|
+
* Patterns:
|
|
134
|
+
* - agents/gsd-* (gsd-opencode specific agents)
|
|
135
|
+
* - command/gsd/* (gsd-opencode specific commands - legacy)
|
|
136
|
+
* - commands/gsd/* (gsd-opencode specific commands - new)
|
|
137
|
+
* - skills/gsd-* (gsd-opencode specific skills)
|
|
138
|
+
* - get-shit-done/* (fully owned by gsd-opencode)
|
|
139
|
+
*
|
|
140
|
+
* @type {RegExp[]}
|
|
141
|
+
*/
|
|
142
|
+
export const ALLOWED_NAMESPACES = [
|
|
143
|
+
/^agents\/gsd-/, // agents/gsd-* directories
|
|
144
|
+
/^command\/gsd\//, // command/gsd/* files (legacy structure)
|
|
145
|
+
/^commands\/gsd\//, // commands/gsd/* files (new structure)
|
|
146
|
+
/^skills\/gsd-/, // skills/gsd-* directories
|
|
147
|
+
/^get-shit-done\// // get-shit-done/ directory - fully owned
|
|
148
|
+
];
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Exit codes for different failure modes.
|
|
152
|
+
* Follows Unix convention where 0 = success, non-zero = error.
|
|
153
|
+
* @type {Object.<string, number>}
|
|
154
|
+
*/
|
|
155
|
+
export const ERROR_CODES = {
|
|
156
|
+
/** Operation completed successfully. */
|
|
157
|
+
SUCCESS: 0,
|
|
158
|
+
|
|
159
|
+
/** General error occurred (unspecified failure). */
|
|
160
|
+
GENERAL_ERROR: 1,
|
|
161
|
+
|
|
162
|
+
/** Permission denied (insufficient file system permissions). */
|
|
163
|
+
PERMISSION_ERROR: 2,
|
|
164
|
+
|
|
165
|
+
/** Path traversal detected (security violation). */
|
|
166
|
+
PATH_TRAVERSAL: 3,
|
|
167
|
+
|
|
168
|
+
/** Process interrupted by user (SIGINT, Ctrl+C). */
|
|
169
|
+
INTERRUPTED: 130
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Default export combining all constants.
|
|
174
|
+
* Useful for importing all constants at once.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* import constants from './lib/constants.js';
|
|
178
|
+
* console.log(constants.DEFAULT_CONFIG_DIR);
|
|
179
|
+
*/
|
|
180
|
+
export default {
|
|
181
|
+
DEFAULT_CONFIG_DIR,
|
|
182
|
+
LOCAL_CONFIG_DIR,
|
|
183
|
+
VERSION_FILE,
|
|
184
|
+
PATH_PATTERNS,
|
|
185
|
+
DIRECTORIES_TO_COPY,
|
|
186
|
+
MANIFEST_FILENAME,
|
|
187
|
+
UNINSTALL_BACKUP_DIR,
|
|
188
|
+
OLD_COMMAND_DIR,
|
|
189
|
+
NEW_COMMAND_DIR,
|
|
190
|
+
STRUCTURE_TYPES,
|
|
191
|
+
ALLOWED_NAMESPACES,
|
|
192
|
+
ERROR_CODES
|
|
193
|
+
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gsd-opencode",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"ai",
|
|
8
|
-
"meta-prompting",
|
|
9
|
-
"context-engineering",
|
|
10
|
-
"spec-driven-development"
|
|
11
|
-
],
|
|
3
|
+
"version": "1.10.1",
|
|
4
|
+
"description": "GSD-OpenCode distribution manager - install, verify, and maintain your GSD-OpenCode installation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "bin/gsd.js",
|
|
12
7
|
"homepage": "https://github.com/rokicool/gsd-opencode#readme",
|
|
13
8
|
"bugs": {
|
|
14
9
|
"url": "https://github.com/rokicool/gsd-opencode/issues"
|
|
@@ -17,23 +12,42 @@
|
|
|
17
12
|
"type": "git",
|
|
18
13
|
"url": "git+https://github.com/rokicool/gsd-opencode.git"
|
|
19
14
|
},
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"author": "TÂCHES & rokicool",
|
|
22
|
-
"type": "commonjs",
|
|
23
|
-
"main": "index.js",
|
|
24
15
|
"bin": {
|
|
25
|
-
"gsd-opencode": "bin/
|
|
16
|
+
"gsd-opencode": "bin/gsd.js",
|
|
17
|
+
"gsd-install": "bin/gsd-install.js"
|
|
26
18
|
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"opencode",
|
|
25
|
+
"ai",
|
|
26
|
+
"meta-prompting",
|
|
27
|
+
"context-engineering",
|
|
28
|
+
"spec-driven-development"
|
|
29
|
+
],
|
|
30
|
+
"author": "TÂCHES & rokicool",
|
|
31
|
+
"license": "MIT",
|
|
27
32
|
"files": [
|
|
28
33
|
"agents",
|
|
29
34
|
"bin",
|
|
30
|
-
"
|
|
31
|
-
"get-shit-done"
|
|
35
|
+
"commands",
|
|
36
|
+
"get-shit-done",
|
|
37
|
+
"src",
|
|
38
|
+
"lib"
|
|
32
39
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
35
|
-
},
|
|
36
40
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@iarna/toml": "^2.2.5",
|
|
45
|
+
"@inquirer/prompts": "^8.2.0",
|
|
46
|
+
"chalk": "^5.6.2",
|
|
47
|
+
"commander": "^12.1.0",
|
|
48
|
+
"ora": "^9.3.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"vitest": "^3.0.0"
|
|
38
52
|
}
|
|
39
53
|
}
|