gmc-openspec 1.1.0 → 1.4.2
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 +2 -2
- package/bin/openspec.js +3 -1
- package/dist/cli/index.d.ts +4 -1
- package/dist/cli/index.js +36 -2
- package/dist/commands/config.js +4 -4
- package/dist/commands/context-store.d.ts +3 -0
- package/dist/commands/context-store.js +475 -0
- package/dist/commands/initiative.d.ts +13 -0
- package/dist/commands/initiative.js +318 -0
- package/dist/commands/workflow/index.d.ts +2 -0
- package/dist/commands/workflow/index.js +1 -0
- package/dist/commands/workflow/initiative-link.d.ts +24 -0
- package/dist/commands/workflow/initiative-link.js +47 -0
- package/dist/commands/workflow/instructions.js +10 -2
- package/dist/commands/workflow/new-change.d.ts +4 -0
- package/dist/commands/workflow/new-change.js +72 -23
- package/dist/commands/workflow/set-change.d.ts +13 -0
- package/dist/commands/workflow/set-change.js +87 -0
- package/dist/commands/workflow/shared.d.ts +2 -0
- package/dist/commands/workflow/status.js +3 -0
- package/dist/commands/workspace/context-status.d.ts +4 -0
- package/dist/commands/workspace/context-status.js +59 -0
- package/dist/commands/workspace/open-target-selection.d.ts +13 -0
- package/dist/commands/workspace/open-target-selection.js +146 -0
- package/dist/commands/workspace/open-view.d.ts +62 -0
- package/dist/commands/workspace/open-view.js +249 -0
- package/dist/commands/workspace/open.d.ts +16 -8
- package/dist/commands/workspace/open.js +40 -14
- package/dist/commands/workspace/opener-selection.d.ts +11 -0
- package/dist/commands/workspace/opener-selection.js +98 -0
- package/dist/commands/workspace/operations.d.ts +14 -8
- package/dist/commands/workspace/operations.js +228 -160
- package/dist/commands/workspace/prompt-theme.d.ts +29 -0
- package/dist/commands/workspace/prompt-theme.js +24 -0
- package/dist/commands/workspace/registration.d.ts +13 -0
- package/dist/commands/workspace/registration.js +84 -0
- package/dist/commands/workspace/selection.d.ts +3 -0
- package/dist/commands/workspace/selection.js +42 -40
- package/dist/commands/workspace/setup-prompts.d.ts +13 -0
- package/dist/commands/workspace/setup-prompts.js +121 -0
- package/dist/commands/workspace/types.d.ts +15 -0
- package/dist/commands/workspace.js +59 -340
- package/dist/core/artifact-graph/index.d.ts +2 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +10 -23
- package/dist/core/artifact-graph/instruction-loader.js +28 -89
- package/dist/core/artifact-graph/types.d.ts +0 -7
- package/dist/core/artifact-graph/types.js +0 -19
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/schema.d.ts +18 -0
- package/dist/core/change-metadata/schema.js +28 -0
- package/dist/core/change-status-policy.d.ts +50 -0
- package/dist/core/change-status-policy.js +70 -0
- package/dist/core/collections/index.d.ts +3 -0
- package/dist/core/collections/index.js +3 -0
- package/dist/core/collections/initiatives/collection.d.ts +4 -0
- package/dist/core/collections/initiatives/collection.js +17 -0
- package/dist/core/collections/initiatives/index.d.ts +6 -0
- package/dist/core/collections/initiatives/index.js +6 -0
- package/dist/core/collections/initiatives/operations.d.ts +49 -0
- package/dist/core/collections/initiatives/operations.js +175 -0
- package/dist/core/collections/initiatives/resolution.d.ts +87 -0
- package/dist/core/collections/initiatives/resolution.js +374 -0
- package/dist/core/collections/initiatives/schema.d.ts +41 -0
- package/dist/core/collections/initiatives/schema.js +134 -0
- package/dist/core/collections/initiatives/templates.d.ts +12 -0
- package/dist/core/collections/initiatives/templates.js +90 -0
- package/dist/core/collections/runtime.d.ts +46 -0
- package/dist/core/collections/runtime.js +194 -0
- package/dist/core/completions/command-registry.d.ts +1 -5
- package/dist/core/completions/command-registry.js +475 -70
- package/dist/core/completions/shared-flags.d.ts +12 -0
- package/dist/core/completions/shared-flags.js +28 -0
- package/dist/core/config.js +2 -1
- package/dist/core/context-store/binding.d.ts +53 -0
- package/dist/core/context-store/binding.js +197 -0
- package/dist/core/context-store/errors.d.ts +20 -0
- package/dist/core/context-store/errors.js +22 -0
- package/dist/core/context-store/foundation.d.ts +55 -0
- package/dist/core/context-store/foundation.js +321 -0
- package/dist/core/context-store/index.d.ts +6 -0
- package/dist/core/context-store/index.js +6 -0
- package/dist/core/context-store/operations.d.ts +85 -0
- package/dist/core/context-store/operations.js +528 -0
- package/dist/core/context-store/registry.d.ts +45 -0
- package/dist/core/context-store/registry.js +229 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/jira/templates.js +14 -5
- package/dist/core/planning-home.js +5 -21
- package/dist/core/validation/validator.d.ts +11 -0
- package/dist/core/validation/validator.js +19 -2
- package/dist/core/workspace/foundation.d.ts +28 -48
- package/dist/core/workspace/foundation.js +130 -214
- package/dist/core/workspace/index.d.ts +2 -0
- package/dist/core/workspace/index.js +2 -0
- package/dist/core/workspace/legacy-state.d.ts +28 -0
- package/dist/core/workspace/legacy-state.js +200 -0
- package/dist/core/workspace/open-surface.d.ts +29 -8
- package/dist/core/workspace/open-surface.js +122 -44
- package/dist/core/workspace/openers.js +11 -6
- package/dist/core/workspace/registry.d.ts +24 -0
- package/dist/core/workspace/registry.js +146 -0
- package/dist/core/workspace/skills.d.ts +4 -2
- package/dist/core/workspace/skills.js +2 -2
- package/dist/core/workspace/state-io.d.ts +10 -0
- package/dist/core/workspace/state-io.js +119 -0
- package/dist/utils/change-metadata.d.ts +5 -2
- package/dist/utils/change-metadata.js +6 -12
- package/dist/utils/change-utils.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeMetadata } from '../core/
|
|
1
|
+
import { type ChangeMetadata } from '../core/change-metadata/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Error thrown when change metadata validation fails.
|
|
4
4
|
*/
|
|
@@ -34,6 +34,9 @@ export declare function writeChangeMetadata(changeDir: string, metadata: ChangeM
|
|
|
34
34
|
* @throws ChangeMetadataError if the file exists but is invalid
|
|
35
35
|
*/
|
|
36
36
|
export declare function readChangeMetadata(changeDir: string, projectRoot?: string): ChangeMetadata | null;
|
|
37
|
+
export interface ResolveSchemaForChangeOptions {
|
|
38
|
+
metadata?: ChangeMetadata | null;
|
|
39
|
+
}
|
|
37
40
|
/**
|
|
38
41
|
* Resolves the schema for a change, with explicit override taking precedence.
|
|
39
42
|
*
|
|
@@ -47,5 +50,5 @@ export declare function readChangeMetadata(changeDir: string, projectRoot?: stri
|
|
|
47
50
|
* @param explicitSchema - Optional explicit schema override
|
|
48
51
|
* @returns The resolved schema name
|
|
49
52
|
*/
|
|
50
|
-
export declare function resolveSchemaForChange(changeDir: string, explicitSchema?: string, projectRootOverride?: string): string;
|
|
53
|
+
export declare function resolveSchemaForChange(changeDir: string, explicitSchema?: string, projectRootOverride?: string, options?: ResolveSchemaForChangeOptions): string;
|
|
51
54
|
//# sourceMappingURL=change-metadata.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import * as yaml from 'yaml';
|
|
4
|
-
import { ChangeMetadataSchema } from '../core/
|
|
4
|
+
import { ChangeMetadataSchema } from '../core/change-metadata/index.js';
|
|
5
5
|
import { listSchemas } from '../core/artifact-graph/resolver.js';
|
|
6
6
|
import { readProjectConfig } from '../core/project-config.js';
|
|
7
7
|
const METADATA_FILENAME = '.openspec.yaml';
|
|
@@ -114,24 +114,18 @@ export function readChangeMetadata(changeDir, projectRoot) {
|
|
|
114
114
|
* @param explicitSchema - Optional explicit schema override
|
|
115
115
|
* @returns The resolved schema name
|
|
116
116
|
*/
|
|
117
|
-
export function resolveSchemaForChange(changeDir, explicitSchema, projectRootOverride) {
|
|
117
|
+
export function resolveSchemaForChange(changeDir, explicitSchema, projectRootOverride, options = {}) {
|
|
118
118
|
// Derive project root from changeDir (changeDir is typically projectRoot/openspec/changes/change-name)
|
|
119
119
|
const projectRoot = projectRootOverride ?? path.resolve(changeDir, '../../..');
|
|
120
120
|
// 1. Explicit override wins
|
|
121
121
|
if (explicitSchema) {
|
|
122
122
|
return explicitSchema;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (metadata?.schema) {
|
|
128
|
-
return metadata.schema;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
// If metadata read fails, continue to next option
|
|
124
|
+
const metadata = options.metadata !== undefined ? options.metadata : readChangeMetadata(changeDir, projectRoot);
|
|
125
|
+
if (metadata?.schema) {
|
|
126
|
+
return metadata.schema;
|
|
133
127
|
}
|
|
134
|
-
// 3. Try reading from project config
|
|
128
|
+
// 3. Try reading from project config when metadata is absent.
|
|
135
129
|
try {
|
|
136
130
|
const config = readProjectConfig(projectRoot);
|
|
137
131
|
if (config?.schema) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChangeMetadata } from '../core/
|
|
1
|
+
import type { ChangeMetadata } from '../core/change-metadata/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Options for creating a change.
|
|
4
4
|
*/
|
|
@@ -10,7 +10,7 @@ export interface CreateChangeOptions {
|
|
|
10
10
|
/** Directory that should contain the change directories */
|
|
11
11
|
changesDir?: string;
|
|
12
12
|
/** Additional metadata to persist in the change's .openspec.yaml */
|
|
13
|
-
metadata?: Partial<Pick<ChangeMetadata, 'goal' | 'affected_areas'>>;
|
|
13
|
+
metadata?: Partial<Pick<ChangeMetadata, 'goal' | 'affected_areas' | 'initiative'>>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Result of creating a change.
|