@exodus/openspec 1.2.2 → 1.2.4
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/core/init.js +2 -1
- package/dist/core/templates/workflows/apply-change.js +2 -2
- package/dist/core/templates/workflows/archive-change.js +34 -2
- package/dist/core/templates/workflows/continue-change.js +34 -2
- package/dist/core/update.js +4 -2
- package/dist/utils/command-references.d.ts +5 -4
- package/dist/utils/command-references.js +7 -5
- package/package.json +1 -1
package/dist/core/init.js
CHANGED
|
@@ -407,7 +407,8 @@ export class InitCommand {
|
|
|
407
407
|
const generatedCommands = generateCommands(commandContents, adapter);
|
|
408
408
|
for (const cmd of generatedCommands) {
|
|
409
409
|
const commandFile = path.isAbsolute(cmd.path) ? cmd.path : path.join(projectPath, cmd.path);
|
|
410
|
-
|
|
410
|
+
const commandContent = cliTransformer ? cliTransformer(cmd.fileContent) : cmd.fileContent;
|
|
411
|
+
await FileSystemUtils.writeFile(commandFile, commandContent);
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
414
|
else {
|
|
@@ -13,7 +13,7 @@ export function getApplyChangeSkillTemplate() {
|
|
|
13
13
|
If a name is provided, use it. Otherwise:
|
|
14
14
|
- Infer from conversation context if the user mentioned a change
|
|
15
15
|
- Auto-select if only one active change exists
|
|
16
|
-
- If ambiguous, run \`openspec list --json\`
|
|
16
|
+
- If ambiguous, check for a workspace manifest (\`cat openspec/workspace.yaml 2>/dev/null\`). If it exists, run \`(cd <scope.path> && openspec list --json)\` for each scope and \`ls openspec/changes/ 2>/dev/null\` for umbrella changes; otherwise run \`openspec list --json\`. Aggregate all results and use the **AskUserQuestion tool** to let the user select, showing which scope each change belongs to
|
|
17
17
|
|
|
18
18
|
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
19
19
|
|
|
@@ -196,7 +196,7 @@ export function getOpsxApplyCommandTemplate() {
|
|
|
196
196
|
If a name is provided, use it. Otherwise:
|
|
197
197
|
- Infer from conversation context if the user mentioned a change
|
|
198
198
|
- Auto-select if only one active change exists
|
|
199
|
-
- If ambiguous, run \`openspec list --json\`
|
|
199
|
+
- If ambiguous, check for a workspace manifest (\`cat openspec/workspace.yaml 2>/dev/null\`). If it exists, run \`(cd <scope.path> && openspec list --json)\` for each scope and \`ls openspec/changes/ 2>/dev/null\` for umbrella changes; otherwise run \`openspec list --json\`. Aggregate all results and use the **AskUserQuestion tool** to let the user select, showing which scope each change belongs to
|
|
200
200
|
|
|
201
201
|
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
202
202
|
|
|
@@ -10,8 +10,24 @@ export function getArchiveChangeSkillTemplate() {
|
|
|
10
10
|
|
|
11
11
|
1. **If no change name provided, prompt for selection**
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Check for a workspace manifest:
|
|
14
|
+
\`\`\`bash
|
|
15
|
+
cat openspec/workspace.yaml 2>/dev/null
|
|
16
|
+
\`\`\`
|
|
17
|
+
|
|
18
|
+
If workspace.yaml exists, list changes across all scopes:
|
|
19
|
+
\`\`\`bash
|
|
20
|
+
(cd <scope.path> && openspec list --json) # for each scope in workspace.yaml
|
|
21
|
+
ls openspec/changes/ 2>/dev/null # umbrella changes at root
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Otherwise:
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
openspec list --json
|
|
27
|
+
\`\`\`
|
|
14
28
|
|
|
29
|
+
Aggregate all results. Use the **AskUserQuestion tool** to let the user select.
|
|
30
|
+
In workspace mode, show which scope each change belongs to.
|
|
15
31
|
Show only active changes (not already archived).
|
|
16
32
|
Include the schema used for each change if available.
|
|
17
33
|
|
|
@@ -154,8 +170,24 @@ export function getOpsxArchiveCommandTemplate() {
|
|
|
154
170
|
|
|
155
171
|
1. **If no change name provided, prompt for selection**
|
|
156
172
|
|
|
157
|
-
|
|
173
|
+
Check for a workspace manifest:
|
|
174
|
+
\`\`\`bash
|
|
175
|
+
cat openspec/workspace.yaml 2>/dev/null
|
|
176
|
+
\`\`\`
|
|
177
|
+
|
|
178
|
+
If workspace.yaml exists, list changes across all scopes:
|
|
179
|
+
\`\`\`bash
|
|
180
|
+
(cd <scope.path> && openspec list --json) # for each scope in workspace.yaml
|
|
181
|
+
ls openspec/changes/ 2>/dev/null # umbrella changes at root
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
Otherwise:
|
|
185
|
+
\`\`\`bash
|
|
186
|
+
openspec list --json
|
|
187
|
+
\`\`\`
|
|
158
188
|
|
|
189
|
+
Aggregate all results. Use the **AskUserQuestion tool** to let the user select.
|
|
190
|
+
In workspace mode, show which scope each change belongs to.
|
|
159
191
|
Show only active changes (not already archived).
|
|
160
192
|
Include the schema used for each change if available.
|
|
161
193
|
|
|
@@ -10,7 +10,23 @@ export function getContinueChangeSkillTemplate() {
|
|
|
10
10
|
|
|
11
11
|
1. **If no change name provided, prompt for selection**
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Check for a workspace manifest:
|
|
14
|
+
\`\`\`bash
|
|
15
|
+
cat openspec/workspace.yaml 2>/dev/null
|
|
16
|
+
\`\`\`
|
|
17
|
+
|
|
18
|
+
If workspace.yaml exists, list changes across all scopes:
|
|
19
|
+
\`\`\`bash
|
|
20
|
+
(cd <scope.path> && openspec list --json) # for each scope in workspace.yaml
|
|
21
|
+
ls openspec/changes/ 2>/dev/null # umbrella changes at root
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Otherwise:
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
openspec list --json
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
Aggregate all results sorted by most recently modified. Use the **AskUserQuestion tool** to let the user select which change to work on.
|
|
14
30
|
|
|
15
31
|
Present the top 3-4 most recently modified changes as options, showing:
|
|
16
32
|
- Change name
|
|
@@ -128,7 +144,23 @@ export function getOpsxContinueCommandTemplate() {
|
|
|
128
144
|
|
|
129
145
|
1. **If no change name provided, prompt for selection**
|
|
130
146
|
|
|
131
|
-
|
|
147
|
+
Check for a workspace manifest:
|
|
148
|
+
\`\`\`bash
|
|
149
|
+
cat openspec/workspace.yaml 2>/dev/null
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
If workspace.yaml exists, list changes across all scopes:
|
|
153
|
+
\`\`\`bash
|
|
154
|
+
(cd <scope.path> && openspec list --json) # for each scope in workspace.yaml
|
|
155
|
+
ls openspec/changes/ 2>/dev/null # umbrella changes at root
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
Otherwise:
|
|
159
|
+
\`\`\`bash
|
|
160
|
+
openspec list --json
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
Aggregate all results sorted by most recently modified. Use the **AskUserQuestion tool** to let the user select which change to work on.
|
|
132
164
|
|
|
133
165
|
Present the top 3-4 most recently modified changes as options, showing:
|
|
134
166
|
- Change name
|
package/dist/core/update.js
CHANGED
|
@@ -152,7 +152,8 @@ export class UpdateCommand {
|
|
|
152
152
|
const generatedCommands = generateCommands(commandContents, adapter);
|
|
153
153
|
for (const cmd of generatedCommands) {
|
|
154
154
|
const commandFile = path.isAbsolute(cmd.path) ? cmd.path : path.join(resolvedProjectPath, cmd.path);
|
|
155
|
-
|
|
155
|
+
const commandContent = cliTransformer ? cliTransformer(cmd.fileContent) : cmd.fileContent;
|
|
156
|
+
await FileSystemUtils.writeFile(commandFile, commandContent);
|
|
156
157
|
}
|
|
157
158
|
removedDeselectedCommandCount += await this.removeUnselectedCommandFiles(resolvedProjectPath, toolId, desiredWorkflows);
|
|
158
159
|
}
|
|
@@ -527,7 +528,8 @@ export class UpdateCommand {
|
|
|
527
528
|
const generatedCommands = generateCommands(commandContents, adapter);
|
|
528
529
|
for (const cmd of generatedCommands) {
|
|
529
530
|
const commandFile = path.isAbsolute(cmd.path) ? cmd.path : path.join(projectPath, cmd.path);
|
|
530
|
-
|
|
531
|
+
const commandContent = legacyCliTransformer ? legacyCliTransformer(cmd.fileContent) : cmd.fileContent;
|
|
532
|
+
await FileSystemUtils.writeFile(commandFile, commandContent);
|
|
531
533
|
}
|
|
532
534
|
}
|
|
533
535
|
}
|
|
@@ -17,16 +17,17 @@
|
|
|
17
17
|
export declare function transformToHyphenCommands(text: string): string;
|
|
18
18
|
/**
|
|
19
19
|
* Creates a transformer that replaces bare `openspec` CLI invocations with a custom command.
|
|
20
|
-
* Only replaces command invocations (backtick-quoted or
|
|
21
|
-
* like `openspec/changes/`.
|
|
20
|
+
* Only replaces command invocations (backtick-quoted, after `&&`, or at line start),
|
|
21
|
+
* not path references like `openspec/changes/`.
|
|
22
22
|
*
|
|
23
23
|
* @param cli - The CLI command to use instead of bare `openspec`
|
|
24
24
|
* @returns Transformer function, or undefined if cli is not set
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* const t = createCliTransformer('pnpm exec openspec');
|
|
28
|
-
* t('`openspec list --json`')
|
|
29
|
-
* t('openspec
|
|
28
|
+
* t('`openspec list --json`') // '`pnpm exec openspec list --json`'
|
|
29
|
+
* t('openspec status --change "x"') // 'pnpm exec openspec status --change "x"' (line-start)
|
|
30
|
+
* t('openspec/changes/foo') // 'openspec/changes/foo' (path unchanged)
|
|
30
31
|
*/
|
|
31
32
|
export declare function createCliTransformer(cli: string | undefined): ((text: string) => string) | undefined;
|
|
32
33
|
//# sourceMappingURL=command-references.d.ts.map
|
|
@@ -19,22 +19,24 @@ export function transformToHyphenCommands(text) {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Creates a transformer that replaces bare `openspec` CLI invocations with a custom command.
|
|
22
|
-
* Only replaces command invocations (backtick-quoted or
|
|
23
|
-
* like `openspec/changes/`.
|
|
22
|
+
* Only replaces command invocations (backtick-quoted, after `&&`, or at line start),
|
|
23
|
+
* not path references like `openspec/changes/`.
|
|
24
24
|
*
|
|
25
25
|
* @param cli - The CLI command to use instead of bare `openspec`
|
|
26
26
|
* @returns Transformer function, or undefined if cli is not set
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* const t = createCliTransformer('pnpm exec openspec');
|
|
30
|
-
* t('`openspec list --json`')
|
|
31
|
-
* t('openspec
|
|
30
|
+
* t('`openspec list --json`') // '`pnpm exec openspec list --json`'
|
|
31
|
+
* t('openspec status --change "x"') // 'pnpm exec openspec status --change "x"' (line-start)
|
|
32
|
+
* t('openspec/changes/foo') // 'openspec/changes/foo' (path unchanged)
|
|
32
33
|
*/
|
|
33
34
|
export function createCliTransformer(cli) {
|
|
34
35
|
if (!cli)
|
|
35
36
|
return undefined;
|
|
36
37
|
return (text) => text
|
|
37
38
|
.replace(/`openspec\s/g, `\`${cli} `)
|
|
38
|
-
.replace(/&& openspec\s/g, `&& ${cli} `)
|
|
39
|
+
.replace(/&& openspec\s/g, `&& ${cli} `)
|
|
40
|
+
.replace(/^(\s*)openspec\s/gm, `$1${cli} `);
|
|
39
41
|
}
|
|
40
42
|
//# sourceMappingURL=command-references.js.map
|