gmc-openspec 1.1.0 → 1.4.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.
Files changed (110) hide show
  1. package/README.md +2 -2
  2. package/bin/openspec.js +3 -1
  3. package/dist/cli/index.d.ts +4 -1
  4. package/dist/cli/index.js +36 -2
  5. package/dist/commands/config.js +4 -4
  6. package/dist/commands/context-store.d.ts +3 -0
  7. package/dist/commands/context-store.js +475 -0
  8. package/dist/commands/initiative.d.ts +13 -0
  9. package/dist/commands/initiative.js +318 -0
  10. package/dist/commands/workflow/index.d.ts +2 -0
  11. package/dist/commands/workflow/index.js +1 -0
  12. package/dist/commands/workflow/initiative-link.d.ts +24 -0
  13. package/dist/commands/workflow/initiative-link.js +47 -0
  14. package/dist/commands/workflow/instructions.js +10 -2
  15. package/dist/commands/workflow/new-change.d.ts +4 -0
  16. package/dist/commands/workflow/new-change.js +72 -23
  17. package/dist/commands/workflow/set-change.d.ts +13 -0
  18. package/dist/commands/workflow/set-change.js +87 -0
  19. package/dist/commands/workflow/shared.d.ts +2 -0
  20. package/dist/commands/workflow/status.js +3 -0
  21. package/dist/commands/workspace/context-status.d.ts +4 -0
  22. package/dist/commands/workspace/context-status.js +59 -0
  23. package/dist/commands/workspace/open-target-selection.d.ts +13 -0
  24. package/dist/commands/workspace/open-target-selection.js +146 -0
  25. package/dist/commands/workspace/open-view.d.ts +62 -0
  26. package/dist/commands/workspace/open-view.js +249 -0
  27. package/dist/commands/workspace/open.d.ts +16 -8
  28. package/dist/commands/workspace/open.js +40 -14
  29. package/dist/commands/workspace/opener-selection.d.ts +11 -0
  30. package/dist/commands/workspace/opener-selection.js +98 -0
  31. package/dist/commands/workspace/operations.d.ts +14 -8
  32. package/dist/commands/workspace/operations.js +228 -160
  33. package/dist/commands/workspace/prompt-theme.d.ts +29 -0
  34. package/dist/commands/workspace/prompt-theme.js +24 -0
  35. package/dist/commands/workspace/registration.d.ts +13 -0
  36. package/dist/commands/workspace/registration.js +84 -0
  37. package/dist/commands/workspace/selection.d.ts +3 -0
  38. package/dist/commands/workspace/selection.js +42 -40
  39. package/dist/commands/workspace/setup-prompts.d.ts +13 -0
  40. package/dist/commands/workspace/setup-prompts.js +121 -0
  41. package/dist/commands/workspace/types.d.ts +15 -0
  42. package/dist/commands/workspace.js +59 -340
  43. package/dist/core/artifact-graph/index.d.ts +2 -1
  44. package/dist/core/artifact-graph/instruction-loader.d.ts +10 -23
  45. package/dist/core/artifact-graph/instruction-loader.js +28 -89
  46. package/dist/core/artifact-graph/types.d.ts +0 -7
  47. package/dist/core/artifact-graph/types.js +0 -19
  48. package/dist/core/change-metadata/index.d.ts +2 -0
  49. package/dist/core/change-metadata/index.js +2 -0
  50. package/dist/core/change-metadata/schema.d.ts +18 -0
  51. package/dist/core/change-metadata/schema.js +28 -0
  52. package/dist/core/change-status-policy.d.ts +50 -0
  53. package/dist/core/change-status-policy.js +70 -0
  54. package/dist/core/collections/index.d.ts +3 -0
  55. package/dist/core/collections/index.js +3 -0
  56. package/dist/core/collections/initiatives/collection.d.ts +4 -0
  57. package/dist/core/collections/initiatives/collection.js +17 -0
  58. package/dist/core/collections/initiatives/index.d.ts +6 -0
  59. package/dist/core/collections/initiatives/index.js +6 -0
  60. package/dist/core/collections/initiatives/operations.d.ts +49 -0
  61. package/dist/core/collections/initiatives/operations.js +175 -0
  62. package/dist/core/collections/initiatives/resolution.d.ts +87 -0
  63. package/dist/core/collections/initiatives/resolution.js +374 -0
  64. package/dist/core/collections/initiatives/schema.d.ts +41 -0
  65. package/dist/core/collections/initiatives/schema.js +134 -0
  66. package/dist/core/collections/initiatives/templates.d.ts +12 -0
  67. package/dist/core/collections/initiatives/templates.js +90 -0
  68. package/dist/core/collections/runtime.d.ts +46 -0
  69. package/dist/core/collections/runtime.js +194 -0
  70. package/dist/core/completions/command-registry.d.ts +1 -5
  71. package/dist/core/completions/command-registry.js +475 -70
  72. package/dist/core/completions/shared-flags.d.ts +12 -0
  73. package/dist/core/completions/shared-flags.js +28 -0
  74. package/dist/core/config.js +2 -1
  75. package/dist/core/context-store/binding.d.ts +53 -0
  76. package/dist/core/context-store/binding.js +197 -0
  77. package/dist/core/context-store/errors.d.ts +20 -0
  78. package/dist/core/context-store/errors.js +22 -0
  79. package/dist/core/context-store/foundation.d.ts +55 -0
  80. package/dist/core/context-store/foundation.js +321 -0
  81. package/dist/core/context-store/index.d.ts +6 -0
  82. package/dist/core/context-store/index.js +6 -0
  83. package/dist/core/context-store/operations.d.ts +85 -0
  84. package/dist/core/context-store/operations.js +528 -0
  85. package/dist/core/context-store/registry.d.ts +45 -0
  86. package/dist/core/context-store/registry.js +229 -0
  87. package/dist/core/index.d.ts +2 -0
  88. package/dist/core/index.js +2 -0
  89. package/dist/core/planning-home.js +5 -21
  90. package/dist/core/validation/validator.d.ts +11 -0
  91. package/dist/core/validation/validator.js +19 -2
  92. package/dist/core/workspace/foundation.d.ts +28 -48
  93. package/dist/core/workspace/foundation.js +130 -214
  94. package/dist/core/workspace/index.d.ts +2 -0
  95. package/dist/core/workspace/index.js +2 -0
  96. package/dist/core/workspace/legacy-state.d.ts +28 -0
  97. package/dist/core/workspace/legacy-state.js +200 -0
  98. package/dist/core/workspace/open-surface.d.ts +29 -8
  99. package/dist/core/workspace/open-surface.js +122 -44
  100. package/dist/core/workspace/openers.js +11 -6
  101. package/dist/core/workspace/registry.d.ts +24 -0
  102. package/dist/core/workspace/registry.js +146 -0
  103. package/dist/core/workspace/skills.d.ts +4 -2
  104. package/dist/core/workspace/skills.js +2 -2
  105. package/dist/core/workspace/state-io.d.ts +10 -0
  106. package/dist/core/workspace/state-io.js +119 -0
  107. package/dist/utils/change-metadata.d.ts +5 -2
  108. package/dist/utils/change-metadata.js +6 -12
  109. package/dist/utils/change-utils.d.ts +2 -2
  110. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { type ChangeMetadata } from '../core/artifact-graph/types.js';
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/artifact-graph/types.js';
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
- // 2. Try reading from metadata
125
- try {
126
- const metadata = readChangeMetadata(changeDir, projectRoot);
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/artifact-graph/types.js';
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gmc-openspec",
3
- "version": "1.1.0",
3
+ "version": "1.4.1",
4
4
  "description": "AI-native system for spec-driven development",
5
5
  "keywords": [
6
6
  "openspec",