@fission-ai/openspec 1.4.1 → 1.5.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 +24 -3
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +95 -95
- package/dist/commands/change.d.ts +5 -1
- package/dist/commands/change.js +17 -15
- package/dist/commands/config.js +6 -65
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.js +155 -0
- package/dist/commands/doctor.d.ts +8 -0
- package/dist/commands/doctor.js +163 -0
- package/dist/commands/shared-gather.d.ts +14 -0
- package/dist/commands/shared-gather.js +31 -0
- package/dist/commands/shared-output.d.ts +18 -0
- package/dist/commands/shared-output.js +61 -0
- package/dist/commands/show.d.ts +11 -6
- package/dist/commands/show.js +70 -25
- package/dist/commands/spec.d.ts +5 -1
- package/dist/commands/spec.js +15 -4
- package/dist/commands/store.d.ts +3 -0
- package/dist/commands/store.js +547 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +75 -39
- package/dist/commands/workflow/index.d.ts +0 -2
- package/dist/commands/workflow/index.js +0 -1
- package/dist/commands/workflow/instructions.d.ts +11 -1
- package/dist/commands/workflow/instructions.js +71 -22
- package/dist/commands/workflow/new-change.d.ts +6 -3
- package/dist/commands/workflow/new-change.js +42 -77
- package/dist/commands/workflow/shared.d.ts +15 -3
- package/dist/commands/workflow/shared.js +20 -3
- package/dist/commands/workflow/status.d.ts +2 -0
- package/dist/commands/workflow/status.js +19 -17
- package/dist/commands/workset-input.d.ts +19 -0
- package/dist/commands/workset-input.js +112 -0
- package/dist/commands/workset-prompts.d.ts +12 -0
- package/dist/commands/workset-prompts.js +143 -0
- package/dist/commands/workset.d.ts +25 -0
- package/dist/commands/workset.js +446 -0
- package/dist/core/archive.d.ts +17 -6
- package/dist/core/archive.js +209 -56
- package/dist/core/artifact-graph/index.d.ts +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +18 -13
- package/dist/core/artifact-graph/instruction-loader.js +8 -31
- package/dist/core/change-metadata/schema.d.ts +1 -0
- package/dist/core/change-metadata/schema.js +4 -2
- package/dist/core/change-status-policy.d.ts +5 -18
- package/dist/core/change-status-policy.js +2 -37
- package/dist/core/command-generation/adapters/bob.js +1 -14
- package/dist/core/command-generation/adapters/claude.js +1 -14
- package/dist/core/command-generation/adapters/cursor.js +1 -14
- package/dist/core/command-generation/adapters/pi.js +1 -14
- package/dist/core/command-generation/adapters/windsurf.js +1 -14
- package/dist/core/command-generation/yaml.d.ts +22 -0
- package/dist/core/command-generation/yaml.js +38 -0
- package/dist/core/completions/command-registry.js +87 -289
- package/dist/core/completions/generators/zsh-generator.js +3 -1
- package/dist/core/completions/installers/bash-installer.js +3 -0
- package/dist/core/completions/installers/fish-installer.js +8 -0
- package/dist/core/completions/installers/powershell-installer.js +30 -2
- package/dist/core/completions/installers/zsh-installer.js +3 -0
- package/dist/core/completions/shared-flags.d.ts +1 -0
- package/dist/core/completions/shared-flags.js +5 -0
- package/dist/core/config-schema.d.ts +2 -1
- package/dist/core/config-schema.js +26 -0
- package/dist/core/file-state.d.ts +36 -0
- package/dist/core/file-state.js +112 -0
- package/dist/core/global-config.d.ts +2 -0
- package/dist/core/id.d.ts +17 -0
- package/dist/core/id.js +30 -0
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/core/init.js +24 -4
- package/dist/core/list.d.ts +2 -0
- package/dist/core/list.js +19 -5
- package/dist/core/openers.d.ts +77 -0
- package/dist/core/openers.js +251 -0
- package/dist/core/openspec-root.d.ts +45 -0
- package/dist/core/openspec-root.js +192 -0
- package/dist/core/planning-home.d.ts +1 -6
- package/dist/core/planning-home.js +2 -43
- package/dist/core/project-config.d.ts +44 -1
- package/dist/core/project-config.js +160 -10
- package/dist/core/references.d.ts +63 -0
- package/dist/core/references.js +310 -0
- package/dist/core/relationship-health.d.ts +65 -0
- package/dist/core/relationship-health.js +64 -0
- package/dist/core/root-selection.d.ts +122 -0
- package/dist/core/root-selection.js +337 -0
- package/dist/core/specs-apply.d.ts +6 -1
- package/dist/core/specs-apply.js +6 -4
- package/dist/core/store/errors.d.ts +20 -0
- package/dist/core/{context-store → store}/errors.js +3 -3
- package/dist/core/store/foundation.d.ts +56 -0
- package/dist/core/store/foundation.js +251 -0
- package/dist/core/store/git.d.ts +23 -0
- package/dist/core/store/git.js +137 -0
- package/dist/core/{context-store → store}/index.d.ts +0 -1
- package/dist/core/{context-store → store}/index.js +0 -1
- package/dist/core/store/operations.d.ts +114 -0
- package/dist/core/store/operations.js +783 -0
- package/dist/core/store/registry.d.ts +58 -0
- package/dist/core/store/registry.js +275 -0
- package/dist/core/templates/workflows/apply-change.js +5 -4
- package/dist/core/templates/workflows/archive-change.js +5 -4
- package/dist/core/templates/workflows/bulk-archive-change.js +5 -4
- package/dist/core/templates/workflows/continue-change.js +7 -2
- package/dist/core/templates/workflows/explore.js +5 -0
- package/dist/core/templates/workflows/ff-change.js +5 -0
- package/dist/core/templates/workflows/new-change.js +5 -0
- package/dist/core/templates/workflows/onboard.js +4 -1
- package/dist/core/templates/workflows/propose.js +5 -0
- package/dist/core/templates/workflows/store-selection.d.ts +8 -0
- package/dist/core/templates/workflows/store-selection.js +8 -0
- package/dist/core/templates/workflows/sync-specs.js +5 -4
- package/dist/core/templates/workflows/verify-change.js +5 -4
- package/dist/core/working-set.d.ts +47 -0
- package/dist/core/working-set.js +43 -0
- package/dist/core/worksets.d.ts +75 -0
- package/dist/core/worksets.js +245 -0
- package/dist/core/zod-issues.d.ts +4 -0
- package/dist/core/zod-issues.js +10 -0
- package/dist/utils/change-metadata.d.ts +1 -0
- package/dist/utils/change-metadata.js +1 -1
- package/dist/utils/change-utils.js +15 -0
- package/dist/utils/file-system.js +36 -17
- package/package.json +6 -6
- package/dist/commands/context-store.d.ts +0 -3
- package/dist/commands/context-store.js +0 -475
- package/dist/commands/initiative.d.ts +0 -13
- package/dist/commands/initiative.js +0 -318
- package/dist/commands/workflow/initiative-link.d.ts +0 -24
- package/dist/commands/workflow/initiative-link.js +0 -47
- package/dist/commands/workflow/set-change.d.ts +0 -13
- package/dist/commands/workflow/set-change.js +0 -87
- package/dist/commands/workspace/context-status.d.ts +0 -4
- package/dist/commands/workspace/context-status.js +0 -59
- package/dist/commands/workspace/open-target-selection.d.ts +0 -13
- package/dist/commands/workspace/open-target-selection.js +0 -146
- package/dist/commands/workspace/open-view.d.ts +0 -62
- package/dist/commands/workspace/open-view.js +0 -249
- package/dist/commands/workspace/open.d.ts +0 -37
- package/dist/commands/workspace/open.js +0 -110
- package/dist/commands/workspace/opener-selection.d.ts +0 -11
- package/dist/commands/workspace/opener-selection.js +0 -98
- package/dist/commands/workspace/operations.d.ts +0 -29
- package/dist/commands/workspace/operations.js +0 -543
- package/dist/commands/workspace/prompt-theme.d.ts +0 -29
- package/dist/commands/workspace/prompt-theme.js +0 -24
- package/dist/commands/workspace/registration.d.ts +0 -13
- package/dist/commands/workspace/registration.js +0 -84
- package/dist/commands/workspace/selection.d.ts +0 -8
- package/dist/commands/workspace/selection.js +0 -104
- package/dist/commands/workspace/setup-prompts.d.ts +0 -13
- package/dist/commands/workspace/setup-prompts.js +0 -121
- package/dist/commands/workspace/types.d.ts +0 -103
- package/dist/commands/workspace/types.js +0 -36
- package/dist/commands/workspace.d.ts +0 -5
- package/dist/commands/workspace.js +0 -574
- package/dist/core/collections/index.d.ts +0 -3
- package/dist/core/collections/index.js +0 -3
- package/dist/core/collections/initiatives/collection.d.ts +0 -4
- package/dist/core/collections/initiatives/collection.js +0 -17
- package/dist/core/collections/initiatives/index.d.ts +0 -6
- package/dist/core/collections/initiatives/index.js +0 -6
- package/dist/core/collections/initiatives/operations.d.ts +0 -49
- package/dist/core/collections/initiatives/operations.js +0 -175
- package/dist/core/collections/initiatives/resolution.d.ts +0 -87
- package/dist/core/collections/initiatives/resolution.js +0 -374
- package/dist/core/collections/initiatives/schema.d.ts +0 -41
- package/dist/core/collections/initiatives/schema.js +0 -134
- package/dist/core/collections/initiatives/templates.d.ts +0 -12
- package/dist/core/collections/initiatives/templates.js +0 -90
- package/dist/core/collections/runtime.d.ts +0 -46
- package/dist/core/collections/runtime.js +0 -194
- package/dist/core/context-store/binding.d.ts +0 -53
- package/dist/core/context-store/binding.js +0 -197
- package/dist/core/context-store/errors.d.ts +0 -20
- package/dist/core/context-store/foundation.d.ts +0 -55
- package/dist/core/context-store/foundation.js +0 -321
- package/dist/core/context-store/operations.d.ts +0 -85
- package/dist/core/context-store/operations.js +0 -528
- package/dist/core/context-store/registry.d.ts +0 -45
- package/dist/core/context-store/registry.js +0 -229
- package/dist/core/workspace/foundation.d.ts +0 -67
- package/dist/core/workspace/foundation.js +0 -295
- package/dist/core/workspace/index.d.ts +0 -8
- package/dist/core/workspace/index.js +0 -8
- package/dist/core/workspace/legacy-state.d.ts +0 -28
- package/dist/core/workspace/legacy-state.js +0 -200
- package/dist/core/workspace/link-input.d.ts +0 -9
- package/dist/core/workspace/link-input.js +0 -32
- package/dist/core/workspace/open-surface.d.ts +0 -45
- package/dist/core/workspace/open-surface.js +0 -215
- package/dist/core/workspace/openers.d.ts +0 -21
- package/dist/core/workspace/openers.js +0 -124
- package/dist/core/workspace/registry.d.ts +0 -24
- package/dist/core/workspace/registry.js +0 -146
- package/dist/core/workspace/skills.d.ts +0 -57
- package/dist/core/workspace/skills.js +0 -334
- package/dist/core/workspace/state-io.d.ts +0 -10
- package/dist/core/workspace/state-io.js +0 -121
- package/schemas/workspace-planning/schema.yaml +0 -72
- package/schemas/workspace-planning/templates/design.md +0 -33
- package/schemas/workspace-planning/templates/proposal.md +0 -28
- package/schemas/workspace-planning/templates/spec.md +0 -9
- package/schemas/workspace-planning/templates/tasks.md +0 -15
|
@@ -1,574 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { createWorkspaceSkillSkippedReport, generateWorkspaceAgentSkills, getWorkspaceSkillCapableTools, getWorkspaceSkillToolIds, getWorkspaceOpenerLabel, parseWorkspaceSkillToolsValue, updateWorkspaceAgentSkills, listKnownWorkspaceEntries, readWorkspaceViewState, syncWorkspaceOpenSurface, writeWorkspaceViewState, } from '../core/workspace/index.js';
|
|
3
|
-
import { isInteractive, resolveNoInteractive } from '../utils/interactive.js';
|
|
4
|
-
import { addWorkspaceLink, createManagedWorkspace, loadWorkspaceForDoctor, loadWorkspaceForList, parseSetupLinks, readWorkspaceForMutation, updateWorkspaceLink, validateWorkspaceNameForSetup, } from './workspace/operations.js';
|
|
5
|
-
import { selectWorkspaceForCommand } from './workspace/selection.js';
|
|
6
|
-
import { launchWorkspaceOpenCommand, } from './workspace/open.js';
|
|
7
|
-
import { buildWorkspaceOpenJsonPayload, prepareWorkspaceOpen, } from './workspace/open-view.js';
|
|
8
|
-
import { getPreferredWorkspaceSkillAgentId, parseSetupOpenerOption, promptPreferredOpener, } from './workspace/opener-selection.js';
|
|
9
|
-
import { workspacePromptTheme } from './workspace/prompt-theme.js';
|
|
10
|
-
import { registerWorkspaceCommandWith } from './workspace/registration.js';
|
|
11
|
-
import { promptSetupLinks } from './workspace/setup-prompts.js';
|
|
12
|
-
import { WorkspaceCliError, appendStatus, asErrorMessage, asStatus, } from './workspace/types.js';
|
|
13
|
-
function printJson(payload) {
|
|
14
|
-
console.log(JSON.stringify(payload, null, 2));
|
|
15
|
-
}
|
|
16
|
-
function printWorkspaceSetupIntro() {
|
|
17
|
-
console.log(chalk.bold('Workspace setup'));
|
|
18
|
-
console.log('');
|
|
19
|
-
}
|
|
20
|
-
function isPromptCancellationError(error) {
|
|
21
|
-
return (error instanceof Error &&
|
|
22
|
-
(error.name === 'ExitPromptError' || error.message.includes('force closed the prompt with SIGINT')));
|
|
23
|
-
}
|
|
24
|
-
async function promptWorkspaceName(initialName) {
|
|
25
|
-
if (initialName) {
|
|
26
|
-
return validateWorkspaceNameForSetup(initialName);
|
|
27
|
-
}
|
|
28
|
-
const { input } = await import('@inquirer/prompts');
|
|
29
|
-
console.log(chalk.bold('[1/5] Name the workspace'));
|
|
30
|
-
console.log(chalk.dim('Use a stable name for the repo group, e.g. platform.'));
|
|
31
|
-
console.log('');
|
|
32
|
-
return input({
|
|
33
|
-
message: 'Workspace name:',
|
|
34
|
-
required: true,
|
|
35
|
-
theme: workspacePromptTheme,
|
|
36
|
-
validate(value) {
|
|
37
|
-
try {
|
|
38
|
-
validateWorkspaceNameForSetup(value);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return 'Workspace names must be kebab-case with lowercase letters, numbers, and single hyphen separators.';
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function parseSetupToolsOption(tools) {
|
|
48
|
-
try {
|
|
49
|
-
return parseWorkspaceSkillToolsValue(tools);
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
throw new WorkspaceCliError(asErrorMessage(error), 'invalid_workspace_setup_tools', {
|
|
53
|
-
target: 'workspace.skills',
|
|
54
|
-
fix: `Use --tools all, --tools none, or one of: ${getWorkspaceSkillToolIds().join(', ')}`,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function parseUpdateToolsOption(tools) {
|
|
59
|
-
try {
|
|
60
|
-
return parseWorkspaceSkillToolsValue(tools);
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
throw new WorkspaceCliError(asErrorMessage(error), 'invalid_workspace_update_tools', {
|
|
64
|
-
target: 'workspace.skills',
|
|
65
|
-
fix: `Use --tools all, --tools none, or one of: ${getWorkspaceSkillToolIds().join(', ')}`,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
async function promptWorkspaceSkillAgents(preferredOpener) {
|
|
70
|
-
const { searchableMultiSelect } = await import('../prompts/searchable-multi-select.js');
|
|
71
|
-
const preferredAgentId = getPreferredWorkspaceSkillAgentId(preferredOpener);
|
|
72
|
-
const tools = getWorkspaceSkillCapableTools();
|
|
73
|
-
const sortedChoices = tools
|
|
74
|
-
.map((tool) => ({
|
|
75
|
-
name: tool.name,
|
|
76
|
-
value: tool.value,
|
|
77
|
-
preSelected: tool.value === preferredAgentId,
|
|
78
|
-
}))
|
|
79
|
-
.sort((a, b) => {
|
|
80
|
-
if (a.preSelected !== b.preSelected) {
|
|
81
|
-
return a.preSelected ? -1 : 1;
|
|
82
|
-
}
|
|
83
|
-
return a.name.localeCompare(b.name);
|
|
84
|
-
});
|
|
85
|
-
if (preferredAgentId) {
|
|
86
|
-
const preferredTool = tools.find((tool) => tool.value === preferredAgentId);
|
|
87
|
-
if (preferredTool) {
|
|
88
|
-
console.log(`${preferredTool.name} matches your preferred opener and is pre-selected.`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return searchableMultiSelect({
|
|
92
|
-
message: 'Which agents should get OpenSpec skills in this workspace?',
|
|
93
|
-
pageSize: 15,
|
|
94
|
-
choices: sortedChoices,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function printStatusLines(statuses) {
|
|
98
|
-
for (const status of statuses) {
|
|
99
|
-
const label = status.severity === 'warning' ? 'Warning' : 'Issue';
|
|
100
|
-
console.log(`${label}: ${status.message}`);
|
|
101
|
-
if (status.fix) {
|
|
102
|
-
console.log(`Fix: ${status.fix}`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function printLinksHuman(links) {
|
|
107
|
-
if (links.length === 0) {
|
|
108
|
-
console.log(' (no linked repos or folders)');
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
for (const link of links) {
|
|
112
|
-
const suffix = link.status.some((status) => status.severity === 'error') ? ' [issue]' : '';
|
|
113
|
-
console.log(` ${link.name} -> ${link.path ?? '(no local path recorded)'}${suffix}`);
|
|
114
|
-
if (link.repo_specs_path) {
|
|
115
|
-
console.log(` repo specs: ${link.repo_specs_path}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function collectWorkspaceIssues(workspace) {
|
|
120
|
-
return [
|
|
121
|
-
...workspace.status,
|
|
122
|
-
...workspace.links.flatMap((link) => link.status),
|
|
123
|
-
];
|
|
124
|
-
}
|
|
125
|
-
function printDoctorHuman(result) {
|
|
126
|
-
console.log(`Workspace: ${result.workspace.name}`);
|
|
127
|
-
console.log(`Location: ${result.workspace.root}`);
|
|
128
|
-
if (result.workspace.context) {
|
|
129
|
-
const selector = result.workspace.context.store_selector;
|
|
130
|
-
const suffix = selector.kind === 'path' ? ` via ${selector.path}` : '';
|
|
131
|
-
console.log(`Context: ${result.workspace.context.store}/${result.workspace.context.initiative}${suffix}`);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
console.log('Context: (none)');
|
|
135
|
-
}
|
|
136
|
-
console.log('');
|
|
137
|
-
printStatusLines(result.status);
|
|
138
|
-
if (result.status.length > 0) {
|
|
139
|
-
console.log('');
|
|
140
|
-
}
|
|
141
|
-
console.log('Linked repos or folders:');
|
|
142
|
-
printLinksHuman(result.workspace.links);
|
|
143
|
-
const issues = collectWorkspaceIssues(result.workspace);
|
|
144
|
-
console.log('');
|
|
145
|
-
console.log('Advisory edit boundaries:');
|
|
146
|
-
if (result.workspace.context) {
|
|
147
|
-
console.log(' Initiative/context-store files are shared coordination context.');
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
console.log(' No initiative coordination context is attached.');
|
|
151
|
-
}
|
|
152
|
-
console.log(' Linked repos and folders are local implementation context when selected.');
|
|
153
|
-
if (issues.length === 0) {
|
|
154
|
-
console.log('');
|
|
155
|
-
console.log('No workspace issues found.');
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
console.log('');
|
|
159
|
-
console.log('Issues:');
|
|
160
|
-
for (const issue of issues) {
|
|
161
|
-
console.log(` - ${issue.message}`);
|
|
162
|
-
if (issue.target) {
|
|
163
|
-
console.log(` Target: ${issue.target}`);
|
|
164
|
-
}
|
|
165
|
-
if (issue.fix) {
|
|
166
|
-
console.log(` Fix: ${issue.fix}`);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function printWorkspaceListHuman(workspaces) {
|
|
171
|
-
console.log(chalk.bold(`OpenSpec workspaces (${workspaces.length})`));
|
|
172
|
-
for (const workspace of workspaces) {
|
|
173
|
-
console.log('');
|
|
174
|
-
console.log(chalk.bold(workspace.name));
|
|
175
|
-
console.log(` Location: ${workspace.root}`);
|
|
176
|
-
if (workspace.status.length > 0) {
|
|
177
|
-
console.log(' Status:');
|
|
178
|
-
for (const status of workspace.status) {
|
|
179
|
-
const statusLabel = status.severity === 'warning' ? chalk.yellow('Warning') : chalk.red('Issue');
|
|
180
|
-
console.log(` ${statusLabel}: ${status.message}`);
|
|
181
|
-
if (status.fix) {
|
|
182
|
-
console.log(` Fix: ${status.fix}`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
console.log(` Linked repos or folders (${workspace.links.length}):`);
|
|
187
|
-
if (workspace.links.length === 0) {
|
|
188
|
-
console.log(chalk.dim(' (none)'));
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
for (const link of workspace.links) {
|
|
192
|
-
const suffix = link.status.some((status) => status.severity === 'error') ? chalk.red(' [issue]') : '';
|
|
193
|
-
console.log(` ${link.name} -> ${link.path ?? '(no local path recorded)'}${suffix}`);
|
|
194
|
-
if (link.repo_specs_path) {
|
|
195
|
-
console.log(chalk.dim(` repo specs: ${link.repo_specs_path}`));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function printWorkspaceCheckSummaryHuman(result) {
|
|
201
|
-
printStatusLines(result.status);
|
|
202
|
-
const issues = collectWorkspaceIssues(result.workspace);
|
|
203
|
-
if (issues.length === 0) {
|
|
204
|
-
console.log(' No workspace issues found.');
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
console.log(' Issues:');
|
|
208
|
-
for (const issue of issues) {
|
|
209
|
-
console.log(` - ${issue.message}`);
|
|
210
|
-
if (issue.target) {
|
|
211
|
-
console.log(` Target: ${issue.target}`);
|
|
212
|
-
}
|
|
213
|
-
if (issue.fix) {
|
|
214
|
-
console.log(` Fix: ${issue.fix}`);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
function printLinkMutationHuman(heading, payload) {
|
|
219
|
-
printStatusLines(payload.status);
|
|
220
|
-
console.log(heading);
|
|
221
|
-
console.log(` ${payload.link.name} -> ${payload.link.path}`);
|
|
222
|
-
console.log(`Workspace: ${payload.workspace.name}`);
|
|
223
|
-
}
|
|
224
|
-
function formatWorkspaceSkillAgentResult(result) {
|
|
225
|
-
const workflowCount = result.workflow_ids?.length ?? 0;
|
|
226
|
-
const workflowLabel = workflowCount === 1 ? '1 workflow' : `${workflowCount} workflows`;
|
|
227
|
-
return `${result.name} (${workflowLabel})`;
|
|
228
|
-
}
|
|
229
|
-
function formatWorkspaceSkillRemovedResult(result) {
|
|
230
|
-
const workflowCount = result.workflow_ids?.length ?? 0;
|
|
231
|
-
const workflowLabel = workflowCount === 1 ? '1 workflow' : `${workflowCount} workflows`;
|
|
232
|
-
return `${result.name} (${workflowLabel} removed)`;
|
|
233
|
-
}
|
|
234
|
-
function printWorkspaceSkillReportHuman(report) {
|
|
235
|
-
console.log('Agent skills:');
|
|
236
|
-
console.log(` Profile: ${report.profile}`);
|
|
237
|
-
console.log(` Workflows: ${report.workflow_ids.length > 0 ? report.workflow_ids.join(', ') : '(none selected)'}`);
|
|
238
|
-
if (report.generated.length > 0) {
|
|
239
|
-
console.log(` Generated: ${report.generated.map(formatWorkspaceSkillAgentResult).join(', ')}`);
|
|
240
|
-
}
|
|
241
|
-
if (report.added.length > 0) {
|
|
242
|
-
console.log(` Added: ${report.added.map(formatWorkspaceSkillAgentResult).join(', ')}`);
|
|
243
|
-
}
|
|
244
|
-
if (report.refreshed.length > 0) {
|
|
245
|
-
console.log(` Refreshed: ${report.refreshed.map(formatWorkspaceSkillAgentResult).join(', ')}`);
|
|
246
|
-
}
|
|
247
|
-
if (report.removed.length > 0) {
|
|
248
|
-
console.log(` Removed: ${report.removed.map(formatWorkspaceSkillRemovedResult).join(', ')}`);
|
|
249
|
-
}
|
|
250
|
-
if (report.skipped.length > 0) {
|
|
251
|
-
for (const skipped of report.skipped) {
|
|
252
|
-
const prefix = skipped.name ? `${skipped.name}: ` : '';
|
|
253
|
-
console.log(` Skipped: ${prefix}${skipped.message}`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (report.failed.length > 0) {
|
|
257
|
-
console.log(chalk.red(` Failed: ${report.failed.map((failure) => `${failure.name} (${failure.error})`).join(', ')}`));
|
|
258
|
-
}
|
|
259
|
-
if (report.delivery_notice) {
|
|
260
|
-
console.log(chalk.dim(` ${report.delivery_notice}`));
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
function hasWorkspaceSkillFailures(report) {
|
|
264
|
-
return report.failed.length > 0;
|
|
265
|
-
}
|
|
266
|
-
function setWorkspaceSkillFailureExitCode(report) {
|
|
267
|
-
if (hasWorkspaceSkillFailures(report)) {
|
|
268
|
-
process.exitCode = 1;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
async function writeWorkspaceSkillState(workspaceRoot, selectedAgentIds, report) {
|
|
272
|
-
const viewState = await readWorkspaceViewState(workspaceRoot);
|
|
273
|
-
await writeWorkspaceViewState(workspaceRoot, {
|
|
274
|
-
...viewState,
|
|
275
|
-
workspace_skills: {
|
|
276
|
-
selected_agents: selectedAgentIds,
|
|
277
|
-
last_applied_profile: report.profile,
|
|
278
|
-
last_applied_delivery: report.delivery,
|
|
279
|
-
last_applied_workflow_ids: report.workflow_ids,
|
|
280
|
-
last_applied_at: new Date().toISOString(),
|
|
281
|
-
},
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
function resolveUpdateWorkspaceName(positionalName, options) {
|
|
285
|
-
if (positionalName && options.workspace && positionalName !== options.workspace) {
|
|
286
|
-
throw new WorkspaceCliError(`Conflicting workspace selectors: positional '${positionalName}' and --workspace '${options.workspace}'.`, 'workspace_selection_conflict', {
|
|
287
|
-
target: 'workspace.name',
|
|
288
|
-
fix: 'Use either the positional workspace name or --workspace with the same value.',
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
return positionalName ?? options.workspace;
|
|
292
|
-
}
|
|
293
|
-
function printWorkspaceOpenHuman(prepared) {
|
|
294
|
-
console.log(`Opening workspace: ${prepared.selected.name}`);
|
|
295
|
-
console.log(`Location: ${prepared.selected.root}`);
|
|
296
|
-
if (prepared.initiative) {
|
|
297
|
-
console.log(`Initiative: ${prepared.initiative.store}/${prepared.initiative.id}`);
|
|
298
|
-
console.log(`Initiative path: ${prepared.initiative.root}`);
|
|
299
|
-
}
|
|
300
|
-
console.log(`Opener: ${getWorkspaceOpenerLabel(prepared.opener)}`);
|
|
301
|
-
if (prepared.skipped.length === 0) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
console.log('');
|
|
305
|
-
console.log('Skipped linked repos or folders:');
|
|
306
|
-
for (const link of prepared.skipped) {
|
|
307
|
-
const location = link.path ?? '(no local path recorded)';
|
|
308
|
-
console.log(` ${link.name} -> ${location}`);
|
|
309
|
-
}
|
|
310
|
-
console.log('Repair skipped links with openspec workspace doctor.');
|
|
311
|
-
}
|
|
312
|
-
class WorkspaceCommand {
|
|
313
|
-
async setup(options = {}) {
|
|
314
|
-
try {
|
|
315
|
-
const noInteractive = resolveNoInteractive(options);
|
|
316
|
-
if (options.json && !noInteractive) {
|
|
317
|
-
throw new WorkspaceCliError('workspace setup --json requires --no-interactive.', 'setup_json_requires_no_interactive', {
|
|
318
|
-
fix: 'openspec workspace setup --no-interactive --json --name <name> --link <path>',
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
const interactive = !noInteractive && isInteractive(options);
|
|
322
|
-
if (interactive) {
|
|
323
|
-
printWorkspaceSetupIntro();
|
|
324
|
-
}
|
|
325
|
-
if (!interactive && (!options.name || (options.link ?? []).length === 0)) {
|
|
326
|
-
throw new WorkspaceCliError('workspace setup --no-interactive requires --name <name> and at least one --link <path>.', 'missing_setup_inputs', {
|
|
327
|
-
fix: 'openspec workspace setup --no-interactive --name platform --link /path/to/repo',
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
const workspaceName = interactive
|
|
331
|
-
? await promptWorkspaceName(options.name)
|
|
332
|
-
: validateWorkspaceNameForSetup(options.name ?? '');
|
|
333
|
-
const links = interactive ? await promptSetupLinks() : await parseSetupLinks(options.link);
|
|
334
|
-
if (interactive) {
|
|
335
|
-
console.log('');
|
|
336
|
-
console.log(chalk.bold('[3/5] Choose preferred opener'));
|
|
337
|
-
}
|
|
338
|
-
const preferredOpener = interactive
|
|
339
|
-
? await promptPreferredOpener('Preferred opener:')
|
|
340
|
-
: parseSetupOpenerOption(options.opener);
|
|
341
|
-
let selectedWorkspaceSkillAgents;
|
|
342
|
-
if (options.tools !== undefined) {
|
|
343
|
-
selectedWorkspaceSkillAgents = parseSetupToolsOption(options.tools);
|
|
344
|
-
}
|
|
345
|
-
else if (interactive) {
|
|
346
|
-
console.log('');
|
|
347
|
-
console.log(chalk.bold('[4/5] Install agent skills'));
|
|
348
|
-
console.log(chalk.dim('Choose which coding agents should get OpenSpec skills in this workspace.'));
|
|
349
|
-
console.log(chalk.dim('Press Enter with no agents selected to skip skill installation for now.'));
|
|
350
|
-
console.log('');
|
|
351
|
-
selectedWorkspaceSkillAgents = await promptWorkspaceSkillAgents(preferredOpener);
|
|
352
|
-
}
|
|
353
|
-
if (Object.keys(links).length === 0) {
|
|
354
|
-
throw new WorkspaceCliError('workspace setup --no-interactive requires --name <name> and at least one --link <path>.', 'missing_setup_inputs', {
|
|
355
|
-
fix: 'openspec workspace setup --no-interactive --name platform --link /path/to/repo',
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
if (interactive) {
|
|
359
|
-
console.log('');
|
|
360
|
-
console.log(chalk.bold('[5/5] Create workspace files'));
|
|
361
|
-
}
|
|
362
|
-
const workspace = await createManagedWorkspace(workspaceName, links, preferredOpener);
|
|
363
|
-
const skillReport = selectedWorkspaceSkillAgents === undefined
|
|
364
|
-
? createWorkspaceSkillSkippedReport('tools_omitted', 'No workspace skills were installed. Run openspec workspace update --tools <ids> to install them later.')
|
|
365
|
-
: await generateWorkspaceAgentSkills(workspace.root, selectedWorkspaceSkillAgents);
|
|
366
|
-
if (selectedWorkspaceSkillAgents !== undefined && !hasWorkspaceSkillFailures(skillReport)) {
|
|
367
|
-
await writeWorkspaceSkillState(workspace.root, selectedWorkspaceSkillAgents, skillReport);
|
|
368
|
-
}
|
|
369
|
-
const doctorResult = await loadWorkspaceForDoctor({
|
|
370
|
-
name: workspace.name,
|
|
371
|
-
root: workspace.root,
|
|
372
|
-
status: [],
|
|
373
|
-
unregisteredCurrentWorkspace: false,
|
|
374
|
-
});
|
|
375
|
-
if (options.json) {
|
|
376
|
-
printJson({
|
|
377
|
-
workspace: doctorResult.workspace,
|
|
378
|
-
workspace_skills: skillReport,
|
|
379
|
-
status: doctorResult.status,
|
|
380
|
-
});
|
|
381
|
-
setWorkspaceSkillFailureExitCode(skillReport);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
console.log(chalk.green('Workspace setup complete'));
|
|
385
|
-
console.log('');
|
|
386
|
-
printWorkspaceListHuman([doctorResult.workspace]);
|
|
387
|
-
console.log('');
|
|
388
|
-
console.log('Workspace check:');
|
|
389
|
-
printWorkspaceCheckSummaryHuman(doctorResult);
|
|
390
|
-
console.log('');
|
|
391
|
-
printWorkspaceSkillReportHuman(skillReport);
|
|
392
|
-
console.log('');
|
|
393
|
-
console.log('Next useful commands:');
|
|
394
|
-
console.log(` openspec workspace doctor --workspace ${workspace.name}`);
|
|
395
|
-
console.log(` openspec workspace update --workspace ${workspace.name} --tools <ids>`);
|
|
396
|
-
console.log(' openspec workspace list');
|
|
397
|
-
setWorkspaceSkillFailureExitCode(skillReport);
|
|
398
|
-
}
|
|
399
|
-
catch (error) {
|
|
400
|
-
this.handleFailure(options.json, { workspace: null, status: [] }, error);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
async list(options = {}) {
|
|
404
|
-
try {
|
|
405
|
-
const entries = await listKnownWorkspaceEntries();
|
|
406
|
-
const workspaces = await Promise.all(entries.map((entry) => loadWorkspaceForList(entry)));
|
|
407
|
-
const payload = { workspaces, status: [] };
|
|
408
|
-
if (options.json) {
|
|
409
|
-
printJson(payload);
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
if (workspaces.length === 0) {
|
|
413
|
-
console.log("No OpenSpec workspaces found. Run 'openspec workspace setup' first.");
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
printWorkspaceListHuman(workspaces);
|
|
417
|
-
}
|
|
418
|
-
catch (error) {
|
|
419
|
-
this.handleFailure(options.json, { workspaces: [], status: [] }, error);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
async link(nameOrPath, linkPath, options = {}) {
|
|
423
|
-
try {
|
|
424
|
-
if (!nameOrPath) {
|
|
425
|
-
throw new WorkspaceCliError('workspace link requires a repo or folder path.', 'missing_link_path', {
|
|
426
|
-
fix: 'openspec workspace link /path/to/repo',
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
const selected = await selectWorkspaceForCommand(options, 'link');
|
|
430
|
-
const payload = await addWorkspaceLink(selected, nameOrPath, linkPath);
|
|
431
|
-
if (options.json) {
|
|
432
|
-
printJson(payload);
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
printLinkMutationHuman('Linked repo or folder:', payload);
|
|
436
|
-
}
|
|
437
|
-
catch (error) {
|
|
438
|
-
this.handleFailure(options.json, { workspace: null, link: null, status: [] }, error);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
async relink(linkNameInput, linkPath, options = {}) {
|
|
442
|
-
try {
|
|
443
|
-
if (!linkNameInput || !linkPath) {
|
|
444
|
-
throw new WorkspaceCliError('workspace relink requires a link name and repo or folder path.', 'missing_relink_arguments', {
|
|
445
|
-
fix: 'openspec workspace relink <name> /path/to/repo',
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
const selected = await selectWorkspaceForCommand(options, 'relink');
|
|
449
|
-
const payload = await updateWorkspaceLink(selected, linkNameInput, linkPath);
|
|
450
|
-
if (options.json) {
|
|
451
|
-
printJson(payload);
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
printLinkMutationHuman('Relinked repo or folder:', payload);
|
|
455
|
-
}
|
|
456
|
-
catch (error) {
|
|
457
|
-
this.handleFailure(options.json, { workspace: null, link: null, status: [] }, error);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
async doctor(options = {}) {
|
|
461
|
-
try {
|
|
462
|
-
const selected = await selectWorkspaceForCommand(options, 'doctor');
|
|
463
|
-
const result = await loadWorkspaceForDoctor(selected);
|
|
464
|
-
if (options.json) {
|
|
465
|
-
printJson(result);
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
printDoctorHuman(result);
|
|
469
|
-
}
|
|
470
|
-
catch (error) {
|
|
471
|
-
this.handleFailure(options.json, { workspace: null, status: [] }, error);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
async update(positionalName, options = {}) {
|
|
475
|
-
try {
|
|
476
|
-
const workspaceName = resolveUpdateWorkspaceName(positionalName, options);
|
|
477
|
-
const selected = await selectWorkspaceForCommand({
|
|
478
|
-
...options,
|
|
479
|
-
workspace: workspaceName,
|
|
480
|
-
}, 'update', { preferPositionalName: Boolean(positionalName) });
|
|
481
|
-
await this.updateSelected(selected, options);
|
|
482
|
-
}
|
|
483
|
-
catch (error) {
|
|
484
|
-
this.handleFailure(options.json, { workspace: null, workspace_skills: null, status: [] }, error);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
async updateSelected(selected, options) {
|
|
488
|
-
const viewState = await readWorkspaceForMutation(selected);
|
|
489
|
-
await syncWorkspaceOpenSurface(selected.root, viewState);
|
|
490
|
-
const hasExplicitToolSelection = options.tools !== undefined;
|
|
491
|
-
const selectedAgentIds = hasExplicitToolSelection
|
|
492
|
-
? parseUpdateToolsOption(options.tools ?? '')
|
|
493
|
-
: viewState.workspace_skills?.selected_agents ?? [];
|
|
494
|
-
const previousSkillState = hasExplicitToolSelection
|
|
495
|
-
? viewState.workspace_skills ?? { selected_agents: [] }
|
|
496
|
-
: viewState.workspace_skills;
|
|
497
|
-
const skillReport = await updateWorkspaceAgentSkills(selected.root, selectedAgentIds, previousSkillState);
|
|
498
|
-
const shouldStoreSelection = hasExplicitToolSelection || Boolean(viewState.workspace_skills);
|
|
499
|
-
if (shouldStoreSelection && !hasWorkspaceSkillFailures(skillReport)) {
|
|
500
|
-
await writeWorkspaceSkillState(selected.root, selectedAgentIds, skillReport);
|
|
501
|
-
}
|
|
502
|
-
const doctorResult = await loadWorkspaceForDoctor(selected);
|
|
503
|
-
if (options.json) {
|
|
504
|
-
printJson({
|
|
505
|
-
workspace: doctorResult.workspace,
|
|
506
|
-
workspace_skills: skillReport,
|
|
507
|
-
status: doctorResult.status,
|
|
508
|
-
});
|
|
509
|
-
setWorkspaceSkillFailureExitCode(skillReport);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
console.log(chalk.green('Workspace update complete'));
|
|
513
|
-
console.log(`Workspace: ${doctorResult.workspace.name}`);
|
|
514
|
-
console.log(`Location: ${doctorResult.workspace.root}`);
|
|
515
|
-
console.log('');
|
|
516
|
-
printStatusLines(doctorResult.status);
|
|
517
|
-
if (doctorResult.status.length > 0) {
|
|
518
|
-
console.log('');
|
|
519
|
-
}
|
|
520
|
-
printWorkspaceSkillReportHuman(skillReport);
|
|
521
|
-
console.log('');
|
|
522
|
-
console.log('Next useful commands:');
|
|
523
|
-
console.log(` openspec workspace doctor --workspace ${doctorResult.workspace.name}`);
|
|
524
|
-
console.log(` openspec workspace update --workspace ${doctorResult.workspace.name} --tools <ids>`);
|
|
525
|
-
setWorkspaceSkillFailureExitCode(skillReport);
|
|
526
|
-
}
|
|
527
|
-
async open(positionalName, options = {}) {
|
|
528
|
-
try {
|
|
529
|
-
const prepared = await prepareWorkspaceOpen(positionalName, options);
|
|
530
|
-
if (!options.json) {
|
|
531
|
-
printStatusLines(prepared.selected.status);
|
|
532
|
-
if (prepared.selected.status.length > 0) {
|
|
533
|
-
console.log('');
|
|
534
|
-
}
|
|
535
|
-
printWorkspaceOpenHuman(prepared);
|
|
536
|
-
}
|
|
537
|
-
await launchWorkspaceOpenCommand(prepared.command, {
|
|
538
|
-
stdio: options.json ? 'ignore' : 'inherit',
|
|
539
|
-
});
|
|
540
|
-
if (options.json) {
|
|
541
|
-
printJson(buildWorkspaceOpenJsonPayload(prepared));
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
catch (error) {
|
|
545
|
-
this.handleFailure(options.json, { workspace: null, status: [] }, error);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
handleFailure(json, payload, error) {
|
|
549
|
-
if (!json && isPromptCancellationError(error)) {
|
|
550
|
-
console.error('Cancelled.');
|
|
551
|
-
process.exitCode = 130;
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
if (json) {
|
|
555
|
-
printJson(appendStatus(payload, asStatus(error)));
|
|
556
|
-
process.exitCode = 1;
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
const status = asStatus(error);
|
|
560
|
-
console.error(`Error: ${status.message}`);
|
|
561
|
-
if (status.fix) {
|
|
562
|
-
console.error(`Fix: ${status.fix}`);
|
|
563
|
-
}
|
|
564
|
-
process.exitCode = 1;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
export async function runWorkspaceUpdate(positionalName, options = {}) {
|
|
568
|
-
const workspaceCommand = new WorkspaceCommand();
|
|
569
|
-
await workspaceCommand.update(positionalName, options);
|
|
570
|
-
}
|
|
571
|
-
export function registerWorkspaceCommand(program) {
|
|
572
|
-
registerWorkspaceCommandWith(program, new WorkspaceCommand());
|
|
573
|
-
}
|
|
574
|
-
//# sourceMappingURL=workspace.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type CollectionRegistry, type MountedCollection } from '../runtime.js';
|
|
2
|
-
export declare function createInitiativesCollectionRegistry(): CollectionRegistry;
|
|
3
|
-
export declare function mountInitiativesCollection(storeRoot: string): MountedCollection;
|
|
4
|
-
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createCollectionRegistry, mountCollections, } from '../runtime.js';
|
|
2
|
-
import { INITIATIVE_COLLECTION_ID } from './schema.js';
|
|
3
|
-
export function createInitiativesCollectionRegistry() {
|
|
4
|
-
return createCollectionRegistry([
|
|
5
|
-
{
|
|
6
|
-
id: INITIATIVE_COLLECTION_ID,
|
|
7
|
-
mount: INITIATIVE_COLLECTION_ID,
|
|
8
|
-
},
|
|
9
|
-
]);
|
|
10
|
-
}
|
|
11
|
-
export function mountInitiativesCollection(storeRoot) {
|
|
12
|
-
return mountCollections({
|
|
13
|
-
storeRoot,
|
|
14
|
-
collections: createInitiativesCollectionRegistry(),
|
|
15
|
-
}).require(INITIATIVE_COLLECTION_ID);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=collection.js.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as nodeFs from 'node:fs';
|
|
2
|
-
import type { MountedCollection } from '../runtime.js';
|
|
3
|
-
import { type InitiativeMetadata, type InitiativeState, type InitiativeStatus } from './schema.js';
|
|
4
|
-
import { type InitiativeTemplateFile } from './templates.js';
|
|
5
|
-
export interface InitiativeDirectoryEntry {
|
|
6
|
-
name: string;
|
|
7
|
-
isDirectory(): boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface InitiativeOperationsFileSystem {
|
|
10
|
-
mkdir(dirPath: string, options: {
|
|
11
|
-
recursive?: boolean;
|
|
12
|
-
}): Promise<void>;
|
|
13
|
-
writeFile(filePath: string, content: string, options: {
|
|
14
|
-
flag?: nodeFs.OpenMode;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
readFile(filePath: string): Promise<string>;
|
|
17
|
-
readdir(dirPath: string, options: {
|
|
18
|
-
withFileTypes: true;
|
|
19
|
-
}): Promise<readonly InitiativeDirectoryEntry[]>;
|
|
20
|
-
rm(dirPath: string, options: {
|
|
21
|
-
recursive?: boolean;
|
|
22
|
-
force?: boolean;
|
|
23
|
-
}): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export interface InitiativeOperationDependencies {
|
|
26
|
-
fileSystem?: InitiativeOperationsFileSystem;
|
|
27
|
-
}
|
|
28
|
-
export interface CreateInitiativeInput extends InitiativeOperationDependencies {
|
|
29
|
-
collection: MountedCollection;
|
|
30
|
-
id: string;
|
|
31
|
-
title: string;
|
|
32
|
-
summary: string;
|
|
33
|
-
status?: InitiativeStatus;
|
|
34
|
-
owners?: string[];
|
|
35
|
-
metadata?: InitiativeMetadata;
|
|
36
|
-
getCurrentDate?: () => string;
|
|
37
|
-
buildTemplateFiles?: (state: InitiativeState) => readonly InitiativeTemplateFile[];
|
|
38
|
-
}
|
|
39
|
-
export interface ListInitiativesInput extends InitiativeOperationDependencies {
|
|
40
|
-
collection: MountedCollection;
|
|
41
|
-
}
|
|
42
|
-
export interface ReadInitiativeInput extends InitiativeOperationDependencies {
|
|
43
|
-
collection: MountedCollection;
|
|
44
|
-
id: string;
|
|
45
|
-
}
|
|
46
|
-
export declare function createInitiative(input: CreateInitiativeInput): Promise<InitiativeState>;
|
|
47
|
-
export declare function readInitiative(input: ReadInitiativeInput): Promise<InitiativeState | null>;
|
|
48
|
-
export declare function listInitiatives(input: ListInitiativesInput): Promise<InitiativeState[]>;
|
|
49
|
-
//# sourceMappingURL=operations.d.ts.map
|