gsd-pi 2.29.0-dev.77f06e2 → 2.29.0-dev.953d788
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 +17 -24
- package/dist/resources/extensions/bg-shell/process-manager.ts +0 -13
- package/dist/resources/extensions/gsd/auto-dashboard.ts +65 -186
- package/dist/resources/extensions/gsd/auto-post-unit.ts +3 -6
- package/dist/resources/extensions/gsd/auto-recovery.ts +22 -16
- package/dist/resources/extensions/gsd/auto-worktree-sync.ts +6 -7
- package/dist/resources/extensions/gsd/auto.ts +15 -0
- package/dist/resources/extensions/gsd/commands-handlers.ts +1 -20
- package/dist/resources/extensions/gsd/commands-logs.ts +14 -13
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +14 -44
- package/dist/resources/extensions/gsd/commands.ts +22 -55
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +1 -2
- package/dist/resources/extensions/gsd/json-persistence.ts +1 -16
- package/dist/resources/extensions/gsd/queue-order.ts +11 -10
- package/dist/resources/extensions/gsd/session-status-io.ts +41 -23
- package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +38 -60
- package/dist/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/dist/resources/extensions/mcporter/index.ts +525 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +19 -8
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +17 -11
- package/dist/resources/extensions/remote-questions/telegram-adapter.ts +19 -8
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +0 -13
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +0 -13
- package/src/resources/extensions/bg-shell/process-manager.ts +0 -13
- package/src/resources/extensions/gsd/auto-dashboard.ts +65 -186
- package/src/resources/extensions/gsd/auto-post-unit.ts +3 -6
- package/src/resources/extensions/gsd/auto-recovery.ts +22 -16
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +6 -7
- package/src/resources/extensions/gsd/auto.ts +15 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +1 -20
- package/src/resources/extensions/gsd/commands-logs.ts +14 -13
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +14 -44
- package/src/resources/extensions/gsd/commands.ts +22 -55
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -2
- package/src/resources/extensions/gsd/json-persistence.ts +1 -16
- package/src/resources/extensions/gsd/queue-order.ts +11 -10
- package/src/resources/extensions/gsd/session-status-io.ts +41 -23
- package/src/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/extension-selector-separator.test.ts +38 -60
- package/src/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/src/resources/extensions/mcporter/index.ts +525 -0
- package/src/resources/extensions/remote-questions/discord-adapter.ts +19 -8
- package/src/resources/extensions/remote-questions/slack-adapter.ts +17 -11
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +19 -8
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +0 -544
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +0 -28
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +0 -173
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +0 -87
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +0 -74
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +0 -41
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +0 -45
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +0 -83
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +0 -85
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +0 -73
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +0 -81
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +0 -69
- package/dist/resources/extensions/gsd/workflow-templates.ts +0 -241
- package/dist/resources/extensions/mcp-client/index.ts +0 -459
- package/dist/resources/extensions/remote-questions/http-client.ts +0 -76
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +0 -544
- package/src/resources/extensions/gsd/prompts/workflow-start.md +0 -28
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +0 -173
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +0 -87
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +0 -74
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +0 -41
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +0 -45
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +0 -83
- package/src/resources/extensions/gsd/workflow-templates/registry.json +0 -85
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +0 -73
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +0 -81
- package/src/resources/extensions/gsd/workflow-templates/spike.md +0 -69
- package/src/resources/extensions/gsd/workflow-templates.ts +0 -241
- package/src/resources/extensions/mcp-client/index.ts +0 -459
- package/src/resources/extensions/remote-questions/http-client.ts +0 -76
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Small Feature Workflow
|
|
2
|
-
|
|
3
|
-
<template_meta>
|
|
4
|
-
name: small-feature
|
|
5
|
-
version: 1
|
|
6
|
-
requires_project: false
|
|
7
|
-
artifact_dir: .gsd/workflows/features/
|
|
8
|
-
</template_meta>
|
|
9
|
-
|
|
10
|
-
<purpose>
|
|
11
|
-
Build a small-to-medium feature with lightweight planning. Designed for work that
|
|
12
|
-
needs more structure than /gsd quick but doesn't warrant full milestone ceremony.
|
|
13
|
-
Typical scope: a new command, endpoint, component, or module.
|
|
14
|
-
</purpose>
|
|
15
|
-
|
|
16
|
-
<phases>
|
|
17
|
-
1. scope — Define what we're building and confirm boundaries
|
|
18
|
-
2. plan — Break into 2-5 implementable tasks
|
|
19
|
-
3. implement — Execute the plan with atomic commits
|
|
20
|
-
4. verify — Run tests, build, and validate
|
|
21
|
-
</phases>
|
|
22
|
-
|
|
23
|
-
<process>
|
|
24
|
-
|
|
25
|
-
## Phase 1: Scope
|
|
26
|
-
|
|
27
|
-
**Goal:** Align on what to build and what's out of scope.
|
|
28
|
-
|
|
29
|
-
1. **Understand the request:** Clarify the feature's purpose and user-facing behavior
|
|
30
|
-
2. **Identify gray areas:** Surface 3-4 design decisions that need answers:
|
|
31
|
-
- API shape / interface design
|
|
32
|
-
- Where in the codebase this fits
|
|
33
|
-
- What existing patterns to follow
|
|
34
|
-
- Edge cases to handle (or explicitly skip)
|
|
35
|
-
3. **Define boundaries:** What's in scope vs out of scope for this workflow
|
|
36
|
-
4. **Produce:** Write a brief `CONTEXT.md` in the artifact directory with:
|
|
37
|
-
- Feature description
|
|
38
|
-
- Key decisions made
|
|
39
|
-
- Scope boundaries
|
|
40
|
-
|
|
41
|
-
5. **Gate:** Confirm scope with user before planning.
|
|
42
|
-
|
|
43
|
-
## Phase 2: Plan
|
|
44
|
-
|
|
45
|
-
**Goal:** Create a clear, executable plan.
|
|
46
|
-
|
|
47
|
-
1. **Research (if needed):** Read relevant existing code to understand patterns
|
|
48
|
-
2. **Break into tasks:** 2-5 tasks, each independently committable:
|
|
49
|
-
- Each task should take ~10-30 minutes of AI work
|
|
50
|
-
- Include file paths and specific changes
|
|
51
|
-
- Include verification steps per task
|
|
52
|
-
3. **Produce:** Write `PLAN.md` in the artifact directory
|
|
53
|
-
|
|
54
|
-
4. **Gate:** Present plan to user for approval. Adjust if needed.
|
|
55
|
-
|
|
56
|
-
## Phase 3: Implement
|
|
57
|
-
|
|
58
|
-
**Goal:** Build the feature following the plan.
|
|
59
|
-
|
|
60
|
-
1. Execute tasks in order
|
|
61
|
-
2. After each task:
|
|
62
|
-
- Verify the specific task's acceptance criteria
|
|
63
|
-
- Commit with message: `feat(<scope>): <description>`
|
|
64
|
-
3. If a task reveals the plan needs adjustment, note the deviation and adapt
|
|
65
|
-
4. Run incremental tests as you go (don't wait until the end)
|
|
66
|
-
|
|
67
|
-
## Phase 4: Verify
|
|
68
|
-
|
|
69
|
-
**Goal:** Ensure everything works together.
|
|
70
|
-
|
|
71
|
-
1. Run the full test suite
|
|
72
|
-
2. Run the build
|
|
73
|
-
3. Run the linter
|
|
74
|
-
4. Manual smoke check if applicable
|
|
75
|
-
5. **Produce:** Write a brief `SUMMARY.md` with:
|
|
76
|
-
- What was built
|
|
77
|
-
- Files changed
|
|
78
|
-
- How to test/use the feature
|
|
79
|
-
6. Present summary to user
|
|
80
|
-
|
|
81
|
-
</process>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Research Spike Workflow
|
|
2
|
-
|
|
3
|
-
<template_meta>
|
|
4
|
-
name: spike
|
|
5
|
-
version: 1
|
|
6
|
-
requires_project: false
|
|
7
|
-
artifact_dir: .gsd/workflows/spikes/
|
|
8
|
-
</template_meta>
|
|
9
|
-
|
|
10
|
-
<purpose>
|
|
11
|
-
Investigate a question, evaluate options, prototype if needed, and produce a
|
|
12
|
-
clear recommendation. No production code is shipped — the output is knowledge.
|
|
13
|
-
Use for: technology evaluation, architecture decisions, "should we X?" questions.
|
|
14
|
-
</purpose>
|
|
15
|
-
|
|
16
|
-
<phases>
|
|
17
|
-
1. scope — Define the question and success criteria
|
|
18
|
-
2. research — Investigate from multiple angles
|
|
19
|
-
3. synthesize — Combine findings into a recommendation
|
|
20
|
-
</phases>
|
|
21
|
-
|
|
22
|
-
<process>
|
|
23
|
-
|
|
24
|
-
## Phase 1: Scope
|
|
25
|
-
|
|
26
|
-
**Goal:** Define exactly what we're investigating and what a good answer looks like.
|
|
27
|
-
|
|
28
|
-
1. **Frame the question:** What specific question(s) need answering?
|
|
29
|
-
2. **Define success criteria:** What would a useful answer include?
|
|
30
|
-
- Comparison criteria (performance, DX, maintenance, ecosystem, etc.)
|
|
31
|
-
- Constraints (must integrate with X, must support Y)
|
|
32
|
-
- Decision format (go/no-go, pick from options, tradeoff matrix)
|
|
33
|
-
3. **Identify research angles:** 2-3 distinct approaches to investigate:
|
|
34
|
-
- e.g., "evaluate library A", "evaluate library B", "evaluate building our own"
|
|
35
|
-
- e.g., "performance implications", "DX implications", "migration path"
|
|
36
|
-
4. **Produce:** Write `SCOPE.md` in the artifact directory
|
|
37
|
-
|
|
38
|
-
5. **Gate:** Confirm scope and research angles with user.
|
|
39
|
-
|
|
40
|
-
## Phase 2: Research
|
|
41
|
-
|
|
42
|
-
**Goal:** Investigate each angle thoroughly.
|
|
43
|
-
|
|
44
|
-
1. For each research angle:
|
|
45
|
-
- Search for relevant documentation, benchmarks, comparisons
|
|
46
|
-
- Read relevant source code in the project
|
|
47
|
-
- Build small prototypes or proof-of-concepts if needed
|
|
48
|
-
- Note pros, cons, risks, and unknowns
|
|
49
|
-
2. **Produce:** Write a research doc per angle in `research/` subdirectory:
|
|
50
|
-
- `research/ANGLE-1.md`, `research/ANGLE-2.md`, etc.
|
|
51
|
-
- Each doc: findings, evidence, pros/cons, confidence level
|
|
52
|
-
|
|
53
|
-
## Phase 3: Synthesize
|
|
54
|
-
|
|
55
|
-
**Goal:** Combine findings into a clear recommendation.
|
|
56
|
-
|
|
57
|
-
1. **Compare across angles:** Build a comparison matrix or summary table
|
|
58
|
-
2. **Make a recommendation:** Based on the evidence, what should we do?
|
|
59
|
-
- Primary recommendation with rationale
|
|
60
|
-
- Alternative if the primary doesn't work out
|
|
61
|
-
- What would change the recommendation (risk factors)
|
|
62
|
-
3. **Produce:** Write `RECOMMENDATION.md` with:
|
|
63
|
-
- Executive summary (1-2 paragraphs)
|
|
64
|
-
- Comparison matrix
|
|
65
|
-
- Recommendation with rationale
|
|
66
|
-
- Next steps if the recommendation is accepted
|
|
67
|
-
4. **Present** the recommendation to the user for discussion
|
|
68
|
-
|
|
69
|
-
</process>
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GSD Workflow Templates — Registry & Resolution
|
|
3
|
-
*
|
|
4
|
-
* Loads the workflow template registry and resolves templates by name,
|
|
5
|
-
* alias, or trigger-keyword matching against user input.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
9
|
-
import { join, dirname } from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
|
-
|
|
12
|
-
const __extensionDir = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const registryPath = join(__extensionDir, "workflow-templates", "registry.json");
|
|
14
|
-
|
|
15
|
-
// ─── Types ───────────────────────────────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
export interface TemplateEntry {
|
|
18
|
-
name: string;
|
|
19
|
-
description: string;
|
|
20
|
-
file: string;
|
|
21
|
-
phases: string[];
|
|
22
|
-
triggers: string[];
|
|
23
|
-
artifact_dir: string | null;
|
|
24
|
-
estimated_complexity: string;
|
|
25
|
-
requires_project: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface TemplateRegistry {
|
|
29
|
-
version: number;
|
|
30
|
-
templates: Record<string, TemplateEntry>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface TemplateMatch {
|
|
34
|
-
id: string;
|
|
35
|
-
template: TemplateEntry;
|
|
36
|
-
confidence: "exact" | "high" | "medium" | "low";
|
|
37
|
-
matchedTrigger?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ─── Registry Cache ──────────────────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
let cachedRegistry: TemplateRegistry | null = null;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Load and cache the workflow template registry.
|
|
46
|
-
*/
|
|
47
|
-
export function loadRegistry(): TemplateRegistry {
|
|
48
|
-
if (cachedRegistry) return cachedRegistry;
|
|
49
|
-
|
|
50
|
-
const content = readFileSync(registryPath, "utf-8");
|
|
51
|
-
cachedRegistry = JSON.parse(content) as TemplateRegistry;
|
|
52
|
-
return cachedRegistry;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Resolve a template by exact name or alias.
|
|
57
|
-
* Returns null if no match found.
|
|
58
|
-
*/
|
|
59
|
-
export function resolveByName(nameOrAlias: string): TemplateMatch | null {
|
|
60
|
-
const registry = loadRegistry();
|
|
61
|
-
const normalized = nameOrAlias.toLowerCase().trim();
|
|
62
|
-
|
|
63
|
-
// Exact key match
|
|
64
|
-
if (registry.templates[normalized]) {
|
|
65
|
-
return {
|
|
66
|
-
id: normalized,
|
|
67
|
-
template: registry.templates[normalized],
|
|
68
|
-
confidence: "exact",
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Match by template name (case-insensitive)
|
|
73
|
-
for (const [id, entry] of Object.entries(registry.templates)) {
|
|
74
|
-
if (entry.name.toLowerCase() === normalized) {
|
|
75
|
-
return { id, template: entry, confidence: "exact" };
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Fuzzy: prefix match on id
|
|
80
|
-
for (const [id, entry] of Object.entries(registry.templates)) {
|
|
81
|
-
if (id.startsWith(normalized) || normalized.startsWith(id)) {
|
|
82
|
-
return { id, template: entry, confidence: "high" };
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Common aliases
|
|
87
|
-
const aliases: Record<string, string> = {
|
|
88
|
-
"bug": "bugfix",
|
|
89
|
-
"fix": "bugfix",
|
|
90
|
-
"feature": "small-feature",
|
|
91
|
-
"feat": "small-feature",
|
|
92
|
-
"research": "spike",
|
|
93
|
-
"investigate": "spike",
|
|
94
|
-
"hot": "hotfix",
|
|
95
|
-
"urgent": "hotfix",
|
|
96
|
-
"security": "security-audit",
|
|
97
|
-
"audit": "security-audit",
|
|
98
|
-
"upgrade": "dep-upgrade",
|
|
99
|
-
"deps": "dep-upgrade",
|
|
100
|
-
"update-deps": "dep-upgrade",
|
|
101
|
-
"migration": "refactor",
|
|
102
|
-
"project": "full-project",
|
|
103
|
-
"full": "full-project",
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const aliasMatch = aliases[normalized];
|
|
107
|
-
if (aliasMatch && registry.templates[aliasMatch]) {
|
|
108
|
-
return {
|
|
109
|
-
id: aliasMatch,
|
|
110
|
-
template: registry.templates[aliasMatch],
|
|
111
|
-
confidence: "high",
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Auto-detect the best template based on user description text.
|
|
120
|
-
* Returns ranked matches sorted by confidence.
|
|
121
|
-
*/
|
|
122
|
-
export function autoDetect(description: string): TemplateMatch[] {
|
|
123
|
-
const registry = loadRegistry();
|
|
124
|
-
const lower = description.toLowerCase();
|
|
125
|
-
const words = lower.split(/\s+/);
|
|
126
|
-
const matches: TemplateMatch[] = [];
|
|
127
|
-
|
|
128
|
-
for (const [id, entry] of Object.entries(registry.templates)) {
|
|
129
|
-
let bestScore = 0;
|
|
130
|
-
let bestTrigger = "";
|
|
131
|
-
|
|
132
|
-
for (const trigger of entry.triggers) {
|
|
133
|
-
const triggerLower = trigger.toLowerCase();
|
|
134
|
-
|
|
135
|
-
// Exact phrase match in description
|
|
136
|
-
if (lower.includes(triggerLower)) {
|
|
137
|
-
const score = triggerLower.split(/\s+/).length * 2; // multi-word triggers score higher
|
|
138
|
-
if (score > bestScore) {
|
|
139
|
-
bestScore = score;
|
|
140
|
-
bestTrigger = trigger;
|
|
141
|
-
}
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Single-word trigger match against description words
|
|
146
|
-
if (!triggerLower.includes(" ") && words.includes(triggerLower)) {
|
|
147
|
-
if (1 > bestScore) {
|
|
148
|
-
bestScore = 1;
|
|
149
|
-
bestTrigger = trigger;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (bestScore > 0) {
|
|
155
|
-
const confidence = bestScore >= 4 ? "high" : bestScore >= 2 ? "medium" : "low";
|
|
156
|
-
matches.push({
|
|
157
|
-
id,
|
|
158
|
-
template: entry,
|
|
159
|
-
confidence,
|
|
160
|
-
matchedTrigger: bestTrigger,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Sort by confidence (high > medium > low), then alphabetically
|
|
166
|
-
const order = { exact: 0, high: 1, medium: 2, low: 3 };
|
|
167
|
-
matches.sort((a, b) => order[a.confidence] - order[b.confidence] || a.id.localeCompare(b.id));
|
|
168
|
-
|
|
169
|
-
return matches;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* List all templates as formatted text for display.
|
|
174
|
-
*/
|
|
175
|
-
export function listTemplates(): string {
|
|
176
|
-
const registry = loadRegistry();
|
|
177
|
-
const lines: string[] = ["Workflow Templates\n"];
|
|
178
|
-
|
|
179
|
-
for (const [id, entry] of Object.entries(registry.templates)) {
|
|
180
|
-
const phases = entry.phases.join(" → ");
|
|
181
|
-
const complexity = entry.estimated_complexity;
|
|
182
|
-
lines.push(` ${id.padEnd(16)} ${entry.name}`);
|
|
183
|
-
lines.push(` ${"".padEnd(16)} ${entry.description}`);
|
|
184
|
-
lines.push(` ${"".padEnd(16)} Phases: ${phases} | Complexity: ${complexity}`);
|
|
185
|
-
lines.push("");
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
lines.push("Usage: /gsd start <template> [description]");
|
|
189
|
-
lines.push(" /gsd templates info <name>");
|
|
190
|
-
|
|
191
|
-
return lines.join("\n");
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Get detailed info about a specific template.
|
|
196
|
-
*/
|
|
197
|
-
export function getTemplateInfo(name: string): string | null {
|
|
198
|
-
const match = resolveByName(name);
|
|
199
|
-
if (!match) return null;
|
|
200
|
-
|
|
201
|
-
const { id, template: t } = match;
|
|
202
|
-
const lines = [
|
|
203
|
-
`Template: ${t.name} (${id})`,
|
|
204
|
-
"",
|
|
205
|
-
`Description: ${t.description}`,
|
|
206
|
-
`Complexity: ${t.estimated_complexity}`,
|
|
207
|
-
`Requires .gsd/: ${t.requires_project ? "yes" : "no"}`,
|
|
208
|
-
"",
|
|
209
|
-
"Phases:",
|
|
210
|
-
...t.phases.map((p, i) => ` ${i + 1}. ${p}`),
|
|
211
|
-
"",
|
|
212
|
-
"Triggers:",
|
|
213
|
-
` ${t.triggers.join(", ")}`,
|
|
214
|
-
];
|
|
215
|
-
|
|
216
|
-
if (t.artifact_dir) {
|
|
217
|
-
lines.push("", `Artifacts: ${t.artifact_dir}`);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const templateFilePath = join(__extensionDir, "workflow-templates", t.file);
|
|
221
|
-
if (existsSync(templateFilePath)) {
|
|
222
|
-
lines.push("", "Template file: loaded");
|
|
223
|
-
} else {
|
|
224
|
-
lines.push("", "Template file: not yet created");
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return lines.join("\n");
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Load the raw content of a workflow template .md file.
|
|
232
|
-
*/
|
|
233
|
-
export function loadWorkflowTemplate(templateId: string): string | null {
|
|
234
|
-
const match = resolveByName(templateId);
|
|
235
|
-
if (!match) return null;
|
|
236
|
-
|
|
237
|
-
const filePath = join(__extensionDir, "workflow-templates", match.template.file);
|
|
238
|
-
if (!existsSync(filePath)) return null;
|
|
239
|
-
|
|
240
|
-
return readFileSync(filePath, "utf-8");
|
|
241
|
-
}
|