@contractspec/module.workspace 1.44.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.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/ai/code-generation.d.ts +28 -0
  4. package/dist/ai/code-generation.d.ts.map +1 -0
  5. package/dist/ai/code-generation.js +138 -0
  6. package/dist/ai/code-generation.js.map +1 -0
  7. package/dist/ai/spec-creation.d.ts +27 -0
  8. package/dist/ai/spec-creation.d.ts.map +1 -0
  9. package/dist/ai/spec-creation.js +102 -0
  10. package/dist/ai/spec-creation.js.map +1 -0
  11. package/dist/analysis/deps/graph.d.ts +34 -0
  12. package/dist/analysis/deps/graph.d.ts.map +1 -0
  13. package/dist/analysis/deps/graph.js +85 -0
  14. package/dist/analysis/deps/graph.js.map +1 -0
  15. package/dist/analysis/deps/parse-imports.d.ts +17 -0
  16. package/dist/analysis/deps/parse-imports.d.ts.map +1 -0
  17. package/dist/analysis/deps/parse-imports.js +31 -0
  18. package/dist/analysis/deps/parse-imports.js.map +1 -0
  19. package/dist/analysis/diff/deep-diff.d.ts +33 -0
  20. package/dist/analysis/diff/deep-diff.d.ts.map +1 -0
  21. package/dist/analysis/diff/deep-diff.js +114 -0
  22. package/dist/analysis/diff/deep-diff.js.map +1 -0
  23. package/dist/analysis/diff/semantic.d.ts +11 -0
  24. package/dist/analysis/diff/semantic.d.ts.map +1 -0
  25. package/dist/analysis/diff/semantic.js +97 -0
  26. package/dist/analysis/diff/semantic.js.map +1 -0
  27. package/dist/analysis/feature-scan.d.ts +15 -0
  28. package/dist/analysis/feature-scan.d.ts.map +1 -0
  29. package/dist/analysis/feature-scan.js +152 -0
  30. package/dist/analysis/feature-scan.js.map +1 -0
  31. package/dist/analysis/grouping.d.ts +79 -0
  32. package/dist/analysis/grouping.d.ts.map +1 -0
  33. package/dist/analysis/grouping.js +115 -0
  34. package/dist/analysis/grouping.js.map +1 -0
  35. package/dist/analysis/impact/classifier.d.ts +19 -0
  36. package/dist/analysis/impact/classifier.d.ts.map +1 -0
  37. package/dist/analysis/impact/classifier.js +135 -0
  38. package/dist/analysis/impact/classifier.js.map +1 -0
  39. package/dist/analysis/impact/index.js +2 -0
  40. package/dist/analysis/impact/rules.d.ts +35 -0
  41. package/dist/analysis/impact/rules.d.ts.map +1 -0
  42. package/dist/analysis/impact/rules.js +154 -0
  43. package/dist/analysis/impact/rules.js.map +1 -0
  44. package/dist/analysis/impact/types.d.ts +95 -0
  45. package/dist/analysis/impact/types.d.ts.map +1 -0
  46. package/dist/analysis/index.js +14 -0
  47. package/dist/analysis/snapshot/index.js +2 -0
  48. package/dist/analysis/snapshot/normalizer.d.ts +36 -0
  49. package/dist/analysis/snapshot/normalizer.d.ts.map +1 -0
  50. package/dist/analysis/snapshot/normalizer.js +66 -0
  51. package/dist/analysis/snapshot/normalizer.js.map +1 -0
  52. package/dist/analysis/snapshot/snapshot.d.ts +18 -0
  53. package/dist/analysis/snapshot/snapshot.d.ts.map +1 -0
  54. package/dist/analysis/snapshot/snapshot.js +163 -0
  55. package/dist/analysis/snapshot/snapshot.js.map +1 -0
  56. package/dist/analysis/snapshot/types.d.ts +80 -0
  57. package/dist/analysis/snapshot/types.d.ts.map +1 -0
  58. package/dist/analysis/spec-scan.d.ts +34 -0
  59. package/dist/analysis/spec-scan.d.ts.map +1 -0
  60. package/dist/analysis/spec-scan.js +349 -0
  61. package/dist/analysis/spec-scan.js.map +1 -0
  62. package/dist/analysis/validate/spec-structure.d.ts +29 -0
  63. package/dist/analysis/validate/spec-structure.d.ts.map +1 -0
  64. package/dist/analysis/validate/spec-structure.js +139 -0
  65. package/dist/analysis/validate/spec-structure.js.map +1 -0
  66. package/dist/formatter.d.ts +42 -0
  67. package/dist/formatter.d.ts.map +1 -0
  68. package/dist/formatter.js +163 -0
  69. package/dist/formatter.js.map +1 -0
  70. package/dist/index.d.ts +35 -0
  71. package/dist/index.js +33 -0
  72. package/dist/templates/app-config.d.ts +7 -0
  73. package/dist/templates/app-config.d.ts.map +1 -0
  74. package/dist/templates/app-config.js +106 -0
  75. package/dist/templates/app-config.js.map +1 -0
  76. package/dist/templates/data-view.d.ts +7 -0
  77. package/dist/templates/data-view.d.ts.map +1 -0
  78. package/dist/templates/data-view.js +69 -0
  79. package/dist/templates/data-view.js.map +1 -0
  80. package/dist/templates/event.d.ts +11 -0
  81. package/dist/templates/event.d.ts.map +1 -0
  82. package/dist/templates/event.js +41 -0
  83. package/dist/templates/event.js.map +1 -0
  84. package/dist/templates/experiment.d.ts +7 -0
  85. package/dist/templates/experiment.d.ts.map +1 -0
  86. package/dist/templates/experiment.js +88 -0
  87. package/dist/templates/experiment.js.map +1 -0
  88. package/dist/templates/handler.d.ts +20 -0
  89. package/dist/templates/handler.d.ts.map +1 -0
  90. package/dist/templates/handler.js +96 -0
  91. package/dist/templates/handler.js.map +1 -0
  92. package/dist/templates/integration-utils.js +105 -0
  93. package/dist/templates/integration-utils.js.map +1 -0
  94. package/dist/templates/integration.d.ts +7 -0
  95. package/dist/templates/integration.d.ts.map +1 -0
  96. package/dist/templates/integration.js +63 -0
  97. package/dist/templates/integration.js.map +1 -0
  98. package/dist/templates/knowledge.d.ts +7 -0
  99. package/dist/templates/knowledge.d.ts.map +1 -0
  100. package/dist/templates/knowledge.js +69 -0
  101. package/dist/templates/knowledge.js.map +1 -0
  102. package/dist/templates/migration.d.ts +7 -0
  103. package/dist/templates/migration.d.ts.map +1 -0
  104. package/dist/templates/migration.js +61 -0
  105. package/dist/templates/migration.js.map +1 -0
  106. package/dist/templates/operation.d.ts +11 -0
  107. package/dist/templates/operation.d.ts.map +1 -0
  108. package/dist/templates/operation.js +101 -0
  109. package/dist/templates/operation.js.map +1 -0
  110. package/dist/templates/presentation.d.ts +11 -0
  111. package/dist/templates/presentation.d.ts.map +1 -0
  112. package/dist/templates/presentation.js +79 -0
  113. package/dist/templates/presentation.js.map +1 -0
  114. package/dist/templates/telemetry.d.ts +7 -0
  115. package/dist/templates/telemetry.d.ts.map +1 -0
  116. package/dist/templates/telemetry.js +90 -0
  117. package/dist/templates/telemetry.js.map +1 -0
  118. package/dist/templates/utils.d.ts +27 -0
  119. package/dist/templates/utils.d.ts.map +1 -0
  120. package/dist/templates/utils.js +39 -0
  121. package/dist/templates/utils.js.map +1 -0
  122. package/dist/templates/workflow-runner.d.ts +16 -0
  123. package/dist/templates/workflow-runner.d.ts.map +1 -0
  124. package/dist/templates/workflow-runner.js +49 -0
  125. package/dist/templates/workflow-runner.js.map +1 -0
  126. package/dist/templates/workflow.d.ts +11 -0
  127. package/dist/templates/workflow.d.ts.map +1 -0
  128. package/dist/templates/workflow.js +68 -0
  129. package/dist/templates/workflow.js.map +1 -0
  130. package/dist/types/analysis-types.d.ts +126 -0
  131. package/dist/types/analysis-types.d.ts.map +1 -0
  132. package/dist/types/generation-types.d.ts +84 -0
  133. package/dist/types/generation-types.d.ts.map +1 -0
  134. package/dist/types/generation-types.js +21 -0
  135. package/dist/types/generation-types.js.map +1 -0
  136. package/dist/types/spec-types.d.ts +345 -0
  137. package/dist/types/spec-types.d.ts.map +1 -0
  138. package/package.json +55 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","names":[],"sources":["../../src/templates/telemetry.ts"],"sourcesContent":["import type { TelemetrySpecData } from '../types/spec-types';\nimport { toPascalCase } from './utils';\n\nexport function generateTelemetrySpec(data: TelemetrySpecData): string {\n const specVar =\n toPascalCase(data.name.split('.').pop() ?? 'Telemetry') + 'Telemetry';\n\n const providers = data.providers?.length\n ? `providers: [\n${data.providers\n .map(\n (provider) => ` {\n type: '${provider.type}',\n config: ${formatConfigValue(provider.config)},\n }`\n )\n .join(',\\n')}\n ],`\n : '';\n\n const events = data.events\n .map((event) => {\n const properties = event.properties\n .map(\n (prop) => ` '${prop.name}': {\n type: '${prop.type}',\n ${prop.required ? 'required: true,' : ''}\n ${prop.pii ? 'pii: true,' : ''}\n ${prop.redact ? 'redact: true,' : ''}\n ${\n prop.description\n ? `description: '${escapeString(prop.description)}',`\n : ''\n }\n }`\n )\n .join(',\\n');\n\n const anomalyRules = event.anomalyRules?.length\n ? ` anomalyDetection: {\n enabled: true,\n ${typeof event.anomalyMinimumSample === 'number' ? `minimumSample: ${event.anomalyMinimumSample},` : ''}\n thresholds: [\n${event.anomalyRules\n .map(\n (rule) => ` {\n metric: '${escapeString(rule.metric)}',\n ${typeof rule.min === 'number' ? `min: ${rule.min},` : ''}\n ${typeof rule.max === 'number' ? `max: ${rule.max},` : ''}\n }`\n )\n .join(',\\n')}\n ],\n actions: [${(event.anomalyActions ?? [])\n .map((action) => `'${action}'`)\n .join(', ')}],\n },`\n : event.anomalyEnabled\n ? ` anomalyDetection: {\n enabled: true,\n ${typeof event.anomalyMinimumSample === 'number' ? `minimumSample: ${event.anomalyMinimumSample},` : ''}\n },`\n : '';\n\n return ` {\n name: '${escapeString(event.name)}',\n version: ${event.version},\n semantics: {\n what: '${escapeString(event.what)}',\n ${event.who ? `who: '${escapeString(event.who)}',` : ''}\n ${event.why ? `why: '${escapeString(event.why)}',` : ''}\n },\n privacy: '${event.privacy}',\n properties: {\n${properties}\n },\n ${\n typeof event.retentionDays === 'number'\n ? `retention: { days: ${event.retentionDays}, ${\n event.retentionPolicy ? `policy: '${event.retentionPolicy}'` : ''\n } },`\n : ''\n }\n ${\n typeof event.samplingRate === 'number'\n ? `sampling: { rate: ${event.samplingRate}${\n event.samplingConditions\n ? `, conditions: ['${escapeString(event.samplingConditions)}']`\n : ''\n } },`\n : ''\n }\n${anomalyRules}\n ${event.tags?.length ? `tags: [${event.tags.map((tag) => `'${escapeString(tag)}'`).join(', ')}],` : ''}\n }`;\n })\n .join(',\\n');\n\n return `import type { TelemetrySpec } from '@contractspec/lib.contracts/telemetry';\n\nexport const ${specVar}: TelemetrySpec = {\n meta: {\n key: '${escapeString(data.name)}',\n version: ${data.version},\n title: '${escapeString(data.name)} telemetry',\n description: '${escapeString(\n data.description || 'Describe the purpose of this telemetry spec.'\n )}',\n domain: '${escapeString(data.domain)}',\n owners: [${data.owners.map((owner) => `'${escapeString(owner)}'`).join(', ')}],\n tags: [${data.tags.map((tag) => `'${escapeString(tag)}'`).join(', ')}],\n stability: '${data.stability}',\n },\n config: {\n ${typeof data.defaultRetentionDays === 'number' ? `defaultRetentionDays: ${data.defaultRetentionDays},` : ''}\n ${typeof data.defaultSamplingRate === 'number' ? `defaultSamplingRate: ${data.defaultSamplingRate},` : ''}\n ${data.anomalyEnabled ? `anomalyDetection: { enabled: true${typeof data.anomalyCheckIntervalMs === 'number' ? `, checkIntervalMs: ${data.anomalyCheckIntervalMs}` : ''} },` : ''}\n${providers}\n },\n events: [\n${events}\n ],\n};\n`;\n}\n\nfunction escapeString(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\");\n}\n\nfunction formatConfigValue(value: string): string {\n const trimmed = value.trim();\n if (!trimmed) return '{}';\n if (\n (trimmed.startsWith('{') && trimmed.endsWith('}')) ||\n (trimmed.startsWith('[') && trimmed.endsWith(']'))\n ) {\n return trimmed;\n }\n return `'${escapeString(trimmed)}'`;\n}\n"],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ //#region src/templates/utils.d.ts
2
+ /**
3
+ * Utility functions for template generation.
4
+ */
5
+ /**
6
+ * Convert string to camelCase.
7
+ */
8
+ declare function toCamelCase(str: string): string;
9
+ /**
10
+ * Convert string to PascalCase.
11
+ */
12
+ declare function toPascalCase(str: string): string;
13
+ /**
14
+ * Convert string to kebab-case.
15
+ */
16
+ declare function toKebabCase(str: string): string;
17
+ /**
18
+ * Capitalize first letter.
19
+ */
20
+ declare function capitalize(str: string): string;
21
+ /**
22
+ * Escape single quotes in string.
23
+ */
24
+ declare function escapeString(value: string): string;
25
+ //#endregion
26
+ export { capitalize, escapeString, toCamelCase, toKebabCase, toPascalCase };
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/templates/utils.ts"],"sourcesContent":[],"mappings":";;AAOA;AAQA;AAUA;AAUA;AAOA;iBAnCgB,WAAA;;;;iBAQA,YAAA;;;;iBAUA,WAAA;;;;iBAUA,UAAA;;;;iBAOA,YAAA"}
@@ -0,0 +1,39 @@
1
+ //#region src/templates/utils.ts
2
+ /**
3
+ * Utility functions for template generation.
4
+ */
5
+ /**
6
+ * Convert string to camelCase.
7
+ */
8
+ function toCamelCase(str) {
9
+ const pascal = toPascalCase(str);
10
+ return pascal.charAt(0).toLowerCase() + pascal.slice(1);
11
+ }
12
+ /**
13
+ * Convert string to PascalCase.
14
+ */
15
+ function toPascalCase(str) {
16
+ return str.split(/[-_.]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
17
+ }
18
+ /**
19
+ * Convert string to kebab-case.
20
+ */
21
+ function toKebabCase(str) {
22
+ return str.replace(/\./g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
23
+ }
24
+ /**
25
+ * Capitalize first letter.
26
+ */
27
+ function capitalize(str) {
28
+ return str.charAt(0).toUpperCase() + str.slice(1);
29
+ }
30
+ /**
31
+ * Escape single quotes in string.
32
+ */
33
+ function escapeString(value) {
34
+ return value.replace(/'/g, "\\'");
35
+ }
36
+
37
+ //#endregion
38
+ export { capitalize, escapeString, toCamelCase, toKebabCase, toPascalCase };
39
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/templates/utils.ts"],"sourcesContent":["/**\n * Utility functions for template generation.\n */\n\n/**\n * Convert string to camelCase.\n */\nexport function toCamelCase(str: string): string {\n const pascal = toPascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\n/**\n * Convert string to PascalCase.\n */\nexport function toPascalCase(str: string): string {\n return str\n .split(/[-_.]/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n}\n\n/**\n * Convert string to kebab-case.\n */\nexport function toKebabCase(str: string): string {\n return str\n .replace(/\\./g, '-')\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}\n\n/**\n * Capitalize first letter.\n */\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n/**\n * Escape single quotes in string.\n */\nexport function escapeString(value: string): string {\n return value.replace(/'/g, \"\\\\'\");\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,YAAY,KAAqB;CAC/C,MAAM,SAAS,aAAa,IAAI;AAChC,QAAO,OAAO,OAAO,EAAE,CAAC,aAAa,GAAG,OAAO,MAAM,EAAE;;;;;AAMzD,SAAgB,aAAa,KAAqB;AAChD,QAAO,IACJ,MAAM,QAAQ,CACd,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,GAAG;;;;;AAMb,SAAgB,YAAY,KAAqB;AAC/C,QAAO,IACJ,QAAQ,OAAO,IAAI,CACnB,QAAQ,mBAAmB,QAAQ,CACnC,aAAa;;;;;AAMlB,SAAgB,WAAW,KAAqB;AAC9C,QAAO,IAAI,OAAO,EAAE,CAAC,aAAa,GAAG,IAAI,MAAM,EAAE;;;;;AAMnD,SAAgB,aAAa,OAAuB;AAClD,QAAO,MAAM,QAAQ,MAAM,MAAM"}
@@ -0,0 +1,16 @@
1
+ //#region src/templates/workflow-runner.d.ts
2
+ interface RunnerTemplateOptions {
3
+ exportName: string;
4
+ specImportPath: string;
5
+ runnerName: string;
6
+ workflowName: string;
7
+ }
8
+ declare function generateWorkflowRunnerTemplate({
9
+ exportName,
10
+ specImportPath,
11
+ runnerName,
12
+ workflowName
13
+ }: RunnerTemplateOptions): string;
14
+ //#endregion
15
+ export { generateWorkflowRunnerTemplate };
16
+ //# sourceMappingURL=workflow-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-runner.d.ts","names":[],"sources":["../../src/templates/workflow-runner.ts"],"sourcesContent":[],"mappings":";UAAU,qBAAA;EAAA,UAAA,EAAA,MAAA;EAOM,cAAA,EAAA,MAAA;EACd,UAAA,EAAA,MAAA;EACA,YAAA,EAAA,MAAA;;AAEA,iBAJc,8BAAA,CAId;EAAA,UAAA;EAAA,cAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EACC,qBADD,CAAA,EAAA,MAAA"}
@@ -0,0 +1,49 @@
1
+ //#region src/templates/workflow-runner.ts
2
+ function generateWorkflowRunnerTemplate({ exportName, specImportPath, runnerName, workflowName }) {
3
+ return `import {
4
+ InMemoryStateStore,
5
+ WorkflowRegistry,
6
+ WorkflowRunner,
7
+ } from '@contractspec/lib.contracts/workflow';
8
+ import { ${exportName} } from '${specImportPath}';
9
+
10
+ /**
11
+ * Runner wiring for ${workflowName}.
12
+ *
13
+ * TODO:
14
+ * - Replace the in-memory state store with a persistent adapter if needed.
15
+ * - Implement opExecutor to invoke the correct contract handlers.
16
+ * - Wire eventEmitter to telemetry sinks.
17
+ */
18
+ const registry = new WorkflowRegistry();
19
+ registry.register(${exportName});
20
+
21
+ const stateStore = new InMemoryStateStore();
22
+
23
+ export const ${runnerName} = new WorkflowRunner({
24
+ registry,
25
+ stateStore,
26
+ opExecutor: async (operation, input, ctx) => {
27
+ // TODO: route to the appropriate contract handler
28
+ // Example: return contractRegistry.execute(operation.name, operation.version, input, ctx);
29
+ throw new Error(
30
+ \`opExecutor for \${operation.name}.v\${operation.version} is not implemented\`
31
+ );
32
+ },
33
+ // appConfigProvider: async (state) => {
34
+ // // TODO: return the ResolvedAppConfig for this workflow run (tenant/environment)
35
+ // return undefined;
36
+ // },
37
+ // enforceCapabilities: async (operation, context) => {
38
+ // // TODO: ensure required capabilities are satisfied using context.integrations/context.resolvedAppConfig
39
+ // },
40
+ eventEmitter: (_event, _payload) => {
41
+ // TODO: forward workflow events to telemetry or logging sinks
42
+ },
43
+ });
44
+ `;
45
+ }
46
+
47
+ //#endregion
48
+ export { generateWorkflowRunnerTemplate };
49
+ //# sourceMappingURL=workflow-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-runner.js","names":[],"sources":["../../src/templates/workflow-runner.ts"],"sourcesContent":["interface RunnerTemplateOptions {\n exportName: string;\n specImportPath: string;\n runnerName: string;\n workflowName: string;\n}\n\nexport function generateWorkflowRunnerTemplate({\n exportName,\n specImportPath,\n runnerName,\n workflowName,\n}: RunnerTemplateOptions): string {\n return `import {\n InMemoryStateStore,\n WorkflowRegistry,\n WorkflowRunner,\n} from '@contractspec/lib.contracts/workflow';\nimport { ${exportName} } from '${specImportPath}';\n\n/**\n * Runner wiring for ${workflowName}.\n *\n * TODO:\n * - Replace the in-memory state store with a persistent adapter if needed.\n * - Implement opExecutor to invoke the correct contract handlers.\n * - Wire eventEmitter to telemetry sinks.\n */\nconst registry = new WorkflowRegistry();\nregistry.register(${exportName});\n\nconst stateStore = new InMemoryStateStore();\n\nexport const ${runnerName} = new WorkflowRunner({\n registry,\n stateStore,\n opExecutor: async (operation, input, ctx) => {\n // TODO: route to the appropriate contract handler\n // Example: return contractRegistry.execute(operation.name, operation.version, input, ctx);\n throw new Error(\n \\`opExecutor for \\${operation.name}.v\\${operation.version} is not implemented\\`\n );\n },\n // appConfigProvider: async (state) => {\n // // TODO: return the ResolvedAppConfig for this workflow run (tenant/environment)\n // return undefined;\n // },\n // enforceCapabilities: async (operation, context) => {\n // // TODO: ensure required capabilities are satisfied using context.integrations/context.resolvedAppConfig\n // },\n eventEmitter: (_event, _payload) => {\n // TODO: forward workflow events to telemetry or logging sinks\n },\n});\n`;\n}\n"],"mappings":";AAOA,SAAgB,+BAA+B,EAC7C,YACA,gBACA,YACA,gBACgC;AAChC,QAAO;;;;;WAKE,WAAW,WAAW,eAAe;;;uBAGzB,aAAa;;;;;;;;oBAQhB,WAAW;;;;eAIhB,WAAW"}
@@ -0,0 +1,11 @@
1
+ import { WorkflowSpecData } from "../types/spec-types.js";
2
+
3
+ //#region src/templates/workflow.d.ts
4
+
5
+ /**
6
+ * Generate workflow spec TypeScript code.
7
+ */
8
+ declare function generateWorkflowSpec(data: WorkflowSpecData): string;
9
+ //#endregion
10
+ export { generateWorkflowSpec };
11
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","names":[],"sources":["../../src/templates/workflow.ts"],"sourcesContent":[],"mappings":";;;;;;;iBAWgB,oBAAA,OAA2B"}
@@ -0,0 +1,68 @@
1
+ import { escapeString, toPascalCase } from "./utils.js";
2
+
3
+ //#region src/templates/workflow.ts
4
+ /**
5
+ * Generate workflow spec TypeScript code.
6
+ */
7
+ function generateWorkflowSpec(data) {
8
+ const specVarName = toPascalCase(data.name.split(".").pop() ?? "Workflow") + "Workflow";
9
+ const stepsCode = data.steps.map((step) => formatStep(step)).join(",\n");
10
+ const transitionsCode = data.transitions.map((transition) => ` {
11
+ from: '${transition.from}',
12
+ to: '${transition.to}',
13
+ ${transition.condition ? ` condition: '${escapeString(transition.condition)}',` : ""}
14
+ }`).join(",\n");
15
+ return `import type { WorkflowSpec } from '@contractspec/lib.contracts/workflow';
16
+
17
+ /**
18
+ * Workflow generated via contractspec CLI.
19
+ * TODO:
20
+ * - Review step definitions and descriptions.
21
+ * - Wire automation steps to actual operations.
22
+ * - Provide form renderers for human steps.
23
+ * - Add guards/conditions as needed.
24
+ */
25
+ export const ${specVarName}: WorkflowSpec = {
26
+ meta: {
27
+ key: '${data.name}',
28
+ version: ${data.version},
29
+ title: '${escapeString(data.title)}',
30
+ description: '${escapeString(data.description)}',
31
+ domain: '${escapeString(data.domain)}',
32
+ stability: '${data.stability}',
33
+ owners: [${data.owners.map((owner) => `'${owner}'`).join(", ")}],
34
+ tags: [${data.tags.map((tag) => `'${tag}'`).join(", ")}],
35
+ },
36
+ definition: {
37
+ ${data.entryStepId ? ` entryStepId: '${data.entryStepId}',\n` : ""} steps: [
38
+ ${stepsCode}
39
+ ],
40
+ transitions: [
41
+ ${transitionsCode}
42
+ ],
43
+ },
44
+ ${data.policyFlags.length > 0 ? `policy: {
45
+ flags: [${data.policyFlags.map((flag) => `'${flag}'`).join(", ")}],
46
+ },` : "// policy: { flags: [] },"}
47
+ };
48
+ `;
49
+ }
50
+ function formatStep(step) {
51
+ const lines = [
52
+ ` {`,
53
+ ` id: '${step.id}',`,
54
+ ` type: '${step.type}',`,
55
+ ` label: '${escapeString(step.label)}',`
56
+ ];
57
+ if (step.description) lines.push(` description: '${escapeString(step.description)}',`);
58
+ const actionLines = [];
59
+ if (step.operation) actionLines.push(`operation: { name: '${step.operation.name}', version: ${step.operation.version} }`);
60
+ if (step.form) actionLines.push(`form: { key: '${step.form.key}', version: ${step.form.version} }`);
61
+ if (actionLines.length) lines.push(` action: { ${actionLines.join(", ")} },`);
62
+ lines.push(` }`);
63
+ return lines.join("\n");
64
+ }
65
+
66
+ //#endregion
67
+ export { generateWorkflowSpec };
68
+ //# sourceMappingURL=workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.js","names":["lines: string[]","actionLines: string[]"],"sources":["../../src/templates/workflow.ts"],"sourcesContent":["/**\n * Workflow spec template generation.\n * Extracted from cli-contractspec/src/templates/workflow.template.ts\n */\n\nimport type { WorkflowSpecData } from '../types/spec-types';\nimport { toPascalCase, escapeString } from './utils';\n\n/**\n * Generate workflow spec TypeScript code.\n */\nexport function generateWorkflowSpec(data: WorkflowSpecData): string {\n const specVarName =\n toPascalCase(data.name.split('.').pop() ?? 'Workflow') + 'Workflow';\n\n const stepsCode = data.steps.map((step) => formatStep(step)).join(',\\n');\n\n const transitionsCode = data.transitions\n .map(\n (transition) => ` {\n from: '${transition.from}',\n to: '${transition.to}',\n${transition.condition ? ` condition: '${escapeString(transition.condition)}',` : ''}\n }`\n )\n .join(',\\n');\n\n return `import type { WorkflowSpec } from '@contractspec/lib.contracts/workflow';\n\n/**\n * Workflow generated via contractspec CLI.\n * TODO:\n * - Review step definitions and descriptions.\n * - Wire automation steps to actual operations.\n * - Provide form renderers for human steps.\n * - Add guards/conditions as needed.\n */\nexport const ${specVarName}: WorkflowSpec = {\n meta: {\n key: '${data.name}',\n version: ${data.version},\n title: '${escapeString(data.title)}',\n description: '${escapeString(data.description)}',\n domain: '${escapeString(data.domain)}',\n stability: '${data.stability}',\n owners: [${data.owners.map((owner) => `'${owner}'`).join(', ')}],\n tags: [${data.tags.map((tag) => `'${tag}'`).join(', ')}],\n },\n definition: {\n${data.entryStepId ? ` entryStepId: '${data.entryStepId}',\\n` : ''} steps: [\n${stepsCode}\n ],\n transitions: [\n${transitionsCode}\n ],\n },\n ${\n data.policyFlags.length > 0\n ? `policy: {\n flags: [${data.policyFlags.map((flag) => `'${flag}'`).join(', ')}],\n },`\n : '// policy: { flags: [] },'\n }\n};\n`;\n}\n\nfunction formatStep(step: WorkflowSpecData['steps'][number]): string {\n const lines: string[] = [\n ` {`,\n ` id: '${step.id}',`,\n ` type: '${step.type}',`,\n ` label: '${escapeString(step.label)}',`,\n ];\n if (step.description) {\n lines.push(` description: '${escapeString(step.description)}',`);\n }\n\n const actionLines: string[] = [];\n if (step.operation) {\n actionLines.push(\n `operation: { name: '${step.operation.name}', version: ${step.operation.version} }`\n );\n }\n if (step.form) {\n actionLines.push(\n `form: { key: '${step.form.key}', version: ${step.form.version} }`\n );\n }\n if (actionLines.length) {\n lines.push(` action: { ${actionLines.join(', ')} },`);\n }\n\n lines.push(` }`);\n return lines.join('\\n');\n}\n"],"mappings":";;;;;;AAWA,SAAgB,qBAAqB,MAAgC;CACnE,MAAM,cACJ,aAAa,KAAK,KAAK,MAAM,IAAI,CAAC,KAAK,IAAI,WAAW,GAAG;CAE3D,MAAM,YAAY,KAAK,MAAM,KAAK,SAAS,WAAW,KAAK,CAAC,CAAC,KAAK,MAAM;CAExE,MAAM,kBAAkB,KAAK,YAC1B,KACE,eAAe;eACP,WAAW,KAAK;aAClB,WAAW,GAAG;EACzB,WAAW,YAAY,qBAAqB,aAAa,WAAW,UAAU,CAAC,MAAM,GAAG;OAErF,CACA,KAAK,MAAM;AAEd,QAAO;;;;;;;;;;eAUM,YAAY;;YAEf,KAAK,KAAK;eACP,KAAK,QAAQ;cACd,aAAa,KAAK,MAAM,CAAC;oBACnB,aAAa,KAAK,YAAY,CAAC;eACpC,aAAa,KAAK,OAAO,CAAC;kBACvB,KAAK,UAAU;eAClB,KAAK,OAAO,KAAK,UAAU,IAAI,MAAM,GAAG,CAAC,KAAK,KAAK,CAAC;aACtD,KAAK,KAAK,KAAK,QAAQ,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,CAAC;;;EAGzD,KAAK,cAAc,qBAAqB,KAAK,YAAY,QAAQ,GAAG;EACpE,UAAU;;;EAGV,gBAAgB;;;IAId,KAAK,YAAY,SAAS,IACtB;cACM,KAAK,YAAY,KAAK,SAAS,IAAI,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC;QAE7D,4BACL;;;;AAKH,SAAS,WAAW,MAAiD;CACnE,MAAMA,QAAkB;EACtB;EACA,cAAc,KAAK,GAAG;EACtB,gBAAgB,KAAK,KAAK;EAC1B,iBAAiB,aAAa,KAAK,MAAM,CAAC;EAC3C;AACD,KAAI,KAAK,YACP,OAAM,KAAK,uBAAuB,aAAa,KAAK,YAAY,CAAC,IAAI;CAGvE,MAAMC,cAAwB,EAAE;AAChC,KAAI,KAAK,UACP,aAAY,KACV,uBAAuB,KAAK,UAAU,KAAK,cAAc,KAAK,UAAU,QAAQ,IACjF;AAEH,KAAI,KAAK,KACP,aAAY,KACV,iBAAiB,KAAK,KAAK,IAAI,cAAc,KAAK,KAAK,QAAQ,IAChE;AAEH,KAAI,YAAY,OACd,OAAM,KAAK,mBAAmB,YAAY,KAAK,KAAK,CAAC,KAAK;AAG5D,OAAM,KAAK,QAAQ;AACnB,QAAO,MAAM,KAAK,KAAK"}
@@ -0,0 +1,126 @@
1
+ import { Stability } from "./spec-types.js";
2
+
3
+ //#region src/types/analysis-types.d.ts
4
+
5
+ /**
6
+ * Spec type detected from file analysis.
7
+ * Covers all contract types from @contractspec/lib.contracts.
8
+ */
9
+ type AnalyzedSpecType = 'operation' | 'event' | 'presentation' | 'feature' | 'capability' | 'data-view' | 'form' | 'migration' | 'workflow' | 'experiment' | 'integration' | 'knowledge' | 'telemetry' | 'app-config' | 'policy' | 'test-spec' | 'unknown';
10
+ /**
11
+ * Types that can be referenced by features.
12
+ */
13
+ type RefType = 'operation' | 'event' | 'presentation' | 'capability' | 'experiment' | 'policy' | 'test';
14
+ /**
15
+ * Operation kind detected from file analysis.
16
+ */
17
+ type AnalyzedOperationKind = 'command' | 'query' | 'unknown';
18
+ /**
19
+ * Reference information (name + version).
20
+ */
21
+ interface RefInfo {
22
+ key: string;
23
+ version: number;
24
+ }
25
+ /**
26
+ * A reference extracted from source code with location context.
27
+ */
28
+ interface ExtractedRef {
29
+ type: RefType;
30
+ key: string;
31
+ version: number;
32
+ sourceFile: string;
33
+ sourceLine?: number;
34
+ }
35
+ /**
36
+ * Result of scanning a spec source file.
37
+ */
38
+ interface SpecScanResult {
39
+ filePath: string;
40
+ specType: AnalyzedSpecType;
41
+ key?: string;
42
+ version?: number;
43
+ kind?: AnalyzedOperationKind;
44
+ stability?: Stability;
45
+ description?: string;
46
+ owners?: string[];
47
+ tags?: string[];
48
+ hasMeta: boolean;
49
+ hasIo: boolean;
50
+ hasPolicy: boolean;
51
+ hasPayload: boolean;
52
+ hasContent: boolean;
53
+ hasDefinition: boolean;
54
+ emittedEvents?: RefInfo[];
55
+ policyRefs?: RefInfo[];
56
+ testRefs?: RefInfo[];
57
+ }
58
+ /**
59
+ * Result of scanning a feature file.
60
+ */
61
+ interface FeatureScanResult {
62
+ filePath: string;
63
+ key: string;
64
+ title?: string;
65
+ description?: string;
66
+ domain?: string;
67
+ stability?: Stability;
68
+ owners?: string[];
69
+ tags?: string[];
70
+ operations: RefInfo[];
71
+ events: RefInfo[];
72
+ presentations: RefInfo[];
73
+ experiments: RefInfo[];
74
+ capabilities: {
75
+ provides: RefInfo[];
76
+ requires: RefInfo[];
77
+ };
78
+ opToPresentationLinks: {
79
+ op: RefInfo;
80
+ pres: RefInfo;
81
+ }[];
82
+ }
83
+ /**
84
+ * Semantic diff item types.
85
+ */
86
+ type SemanticDiffType = 'breaking' | 'changed' | 'added' | 'removed';
87
+ /**
88
+ * A single semantic difference between two specs.
89
+ */
90
+ interface SemanticDiffItem {
91
+ type: SemanticDiffType;
92
+ path: string;
93
+ oldValue?: unknown;
94
+ newValue?: unknown;
95
+ description: string;
96
+ }
97
+ /**
98
+ * Options for semantic diff computation.
99
+ */
100
+ interface SemanticDiffOptions {
101
+ breakingOnly?: boolean;
102
+ }
103
+ /**
104
+ * A node in the contract dependency graph.
105
+ */
106
+ interface ContractNode {
107
+ key: string;
108
+ file: string;
109
+ dependencies: string[];
110
+ dependents: string[];
111
+ }
112
+ /**
113
+ * The contract dependency graph.
114
+ */
115
+ type ContractGraph = Map<string, ContractNode>;
116
+ /**
117
+ * Result of spec structure validation.
118
+ */
119
+ interface ValidationResult {
120
+ valid: boolean;
121
+ errors: string[];
122
+ warnings: string[];
123
+ }
124
+ //#endregion
125
+ export { AnalyzedOperationKind, AnalyzedSpecType, ContractGraph, ContractNode, ExtractedRef, FeatureScanResult, RefInfo, RefType, SemanticDiffItem, SemanticDiffOptions, SemanticDiffType, SpecScanResult, ValidationResult };
126
+ //# sourceMappingURL=analysis-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis-types.d.ts","names":[],"sources":["../../src/types/analysis-types.ts"],"sourcesContent":[],"mappings":";;;;AAgCA;AAYA;AAKA;AAQA;AAWiB,KA1DL,gBAAA,GA0DmB,WAAA,GAAA,OAAA,GAAA,cAAA,GAAA,SAAA,GAAA,YAAA,GAAA,WAAA,GAAA,MAAA,GAAA,WAAA,GAAA,UAAA,GAAA,YAAA,GAAA,aAAA,GAAA,WAAA,GAAA,WAAA,GAAA,YAAA,GAAA,QAAA,GAAA,WAAA,GAAA,SAAA;;;;AAoBb,KAxDN,OAAA,GAwDM,WAAA,GAAA,OAAA,GAAA,cAAA,GAAA,YAAA,GAAA,YAAA,GAAA,QAAA,GAAA,MAAA;;;;AAQD,KApDL,qBAAA,GAoDsB,SAAA,GAAA,OAAA,GAAA,SAAA;;;;AAajB,UA5DA,OAAA,CA4DA;EACF,GAAA,EAAA,MAAA;EAID,OAAA,EAAA,MAAA;;;;;AAWF,UApEK,YAAA,CAoEW;EAKX,IAAA,EAxET,OAwES;EAWA,GAAA,EAAA,MAAA;EAOA,OAAA,EAAA,MAAY;EAUjB,UAAA,EAAA,MAAa;EAKR,UAAA,CAAA,EAAA,MAAgB;;;;;UA/FhB,cAAA;;YAEL;;;SAGH;cACK;;;;;;;;;;kBAcI;eACH;aACF;;;;;UAMI,iBAAA;;;;;;cAMH;;;cAKA;UACJ;iBACO;eACF;;cAID;cACA;;;QAIiB;UAAe;;;;;;KAMlC,gBAAA;;;;UAKK,gBAAA;QACT;;;;;;;;;UAUS,mBAAA;;;;;;UAOA,YAAA;;;;;;;;;KAUL,aAAA,GAAgB,YAAY;;;;UAKvB,gBAAA"}
@@ -0,0 +1,84 @@
1
+ import { OpKind, PresentationKind, SpecType } from "./spec-types.js";
2
+
3
+ //#region src/types/generation-types.d.ts
4
+
5
+ /**
6
+ * AI provider options for generation.
7
+ */
8
+ interface AIGenerationOptions {
9
+ provider: 'claude' | 'openai' | 'ollama' | 'custom';
10
+ model?: string;
11
+ endpoint?: string;
12
+ stream?: boolean;
13
+ }
14
+ /**
15
+ * Result of code generation.
16
+ */
17
+ interface GenerationResult {
18
+ code: string;
19
+ filePath: string;
20
+ specType: SpecType;
21
+ }
22
+ /**
23
+ * Build target types.
24
+ */
25
+ type GenerationTarget = 'handler' | 'component' | 'form';
26
+ /**
27
+ * Test target types.
28
+ */
29
+ type TestTarget = 'handler' | 'component';
30
+ /**
31
+ * Spec build type detected during build.
32
+ */
33
+ type SpecBuildType = 'operation' | 'presentation' | 'form' | 'event' | 'workflow' | 'data-view' | 'telemetry' | 'migration' | 'experiment' | 'app-config' | 'integration' | 'knowledge' | 'unknown';
34
+ /**
35
+ * Configuration for workspace operations.
36
+ */
37
+ interface WorkspaceConfig {
38
+ aiProvider: 'claude' | 'openai' | 'ollama' | 'custom';
39
+ aiModel?: string;
40
+ agentMode: 'simple' | 'cursor' | 'claude-code' | 'openai-codex';
41
+ customEndpoint?: string | null;
42
+ customApiKey?: string | null;
43
+ outputDir: string;
44
+ conventions: {
45
+ operations: string;
46
+ events: string;
47
+ presentations: string;
48
+ forms: string;
49
+ workflows?: string;
50
+ 'data-views'?: string;
51
+ dataViews?: string;
52
+ migrations?: string;
53
+ telemetry?: string;
54
+ experiments?: string;
55
+ appConfig?: string;
56
+ integrations?: string;
57
+ knowledge?: string;
58
+ };
59
+ defaultOwners: string[];
60
+ defaultTags: string[];
61
+ }
62
+ /**
63
+ * Default workspace configuration.
64
+ */
65
+ declare const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig;
66
+ /**
67
+ * AI prompt context for spec generation.
68
+ */
69
+ interface SpecGenerationContext {
70
+ description: string;
71
+ kind?: OpKind;
72
+ presentationKind?: PresentationKind;
73
+ }
74
+ /**
75
+ * AI prompt context for code generation.
76
+ */
77
+ interface CodeGenerationContext {
78
+ specCode: string;
79
+ targetPath?: string;
80
+ existingCode?: string;
81
+ }
82
+ //#endregion
83
+ export { AIGenerationOptions, CodeGenerationContext, DEFAULT_WORKSPACE_CONFIG, GenerationResult, GenerationTarget, SpecBuildType, SpecGenerationContext, TestTarget, WorkspaceConfig };
84
+ //# sourceMappingURL=generation-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-types.d.ts","names":[],"sources":["../../src/types/generation-types.ts"],"sourcesContent":[],"mappings":";;;;AAmBA;AASA;AAKA;AAKY,UA7BK,mBAAA,CA6BQ;EAkBR,QAAA,EAAA,QAAe,GAAA,QAAA,GAAA,QAAA,GAAA,QAAA;EA6BnB,KAAA,CAAA,EAAA,MAAA;EAiBI,QAAA,CAAA,EAAA,MAAA;EASA,MAAA,CAAA,EAAA,OAAA;;;;;UA5FA,gBAAA;;;YAGL;;;;;KAMA,gBAAA;;;;KAKA,UAAA;;;;KAKA,aAAA;;;;UAkBK,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6BJ,0BAA0B;;;;UAiBtB,qBAAA;;SAER;qBACY;;;;;UAMJ,qBAAA"}
@@ -0,0 +1,21 @@
1
+ //#region src/types/generation-types.ts
2
+ /**
3
+ * Default workspace configuration.
4
+ */
5
+ const DEFAULT_WORKSPACE_CONFIG = {
6
+ aiProvider: "claude",
7
+ agentMode: "simple",
8
+ outputDir: "./src",
9
+ conventions: {
10
+ operations: "interactions/commands|queries",
11
+ events: "events",
12
+ presentations: "presentations",
13
+ forms: "forms"
14
+ },
15
+ defaultOwners: [],
16
+ defaultTags: []
17
+ };
18
+
19
+ //#endregion
20
+ export { DEFAULT_WORKSPACE_CONFIG };
21
+ //# sourceMappingURL=generation-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-types.js","names":["DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig"],"sources":["../../src/types/generation-types.ts"],"sourcesContent":["/**\n * Code generation related type definitions.\n */\n\nimport type { SpecType, OpKind, PresentationKind } from './spec-types';\n\n/**\n * AI provider options for generation.\n */\nexport interface AIGenerationOptions {\n provider: 'claude' | 'openai' | 'ollama' | 'custom';\n model?: string;\n endpoint?: string;\n stream?: boolean;\n}\n\n/**\n * Result of code generation.\n */\nexport interface GenerationResult {\n code: string;\n filePath: string;\n specType: SpecType;\n}\n\n/**\n * Build target types.\n */\nexport type GenerationTarget = 'handler' | 'component' | 'form';\n\n/**\n * Test target types.\n */\nexport type TestTarget = 'handler' | 'component';\n\n/**\n * Spec build type detected during build.\n */\nexport type SpecBuildType =\n | 'operation'\n | 'presentation'\n | 'form'\n | 'event'\n | 'workflow'\n | 'data-view'\n | 'telemetry'\n | 'migration'\n | 'experiment'\n | 'app-config'\n | 'integration'\n | 'knowledge'\n | 'unknown';\n\n/**\n * Configuration for workspace operations.\n */\nexport interface WorkspaceConfig {\n aiProvider: 'claude' | 'openai' | 'ollama' | 'custom';\n aiModel?: string;\n agentMode: 'simple' | 'cursor' | 'claude-code' | 'openai-codex';\n customEndpoint?: string | null;\n customApiKey?: string | null;\n outputDir: string;\n conventions: {\n operations: string;\n events: string;\n presentations: string;\n forms: string;\n workflows?: string;\n 'data-views'?: string;\n dataViews?: string;\n migrations?: string;\n telemetry?: string;\n experiments?: string;\n appConfig?: string;\n integrations?: string;\n knowledge?: string;\n };\n defaultOwners: string[];\n defaultTags: string[];\n}\n\n/**\n * Default workspace configuration.\n */\nexport const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig = {\n aiProvider: 'claude',\n agentMode: 'simple',\n outputDir: './src',\n conventions: {\n operations: 'interactions/commands|queries',\n events: 'events',\n presentations: 'presentations',\n forms: 'forms',\n },\n defaultOwners: [],\n defaultTags: [],\n};\n\n/**\n * AI prompt context for spec generation.\n */\nexport interface SpecGenerationContext {\n description: string;\n kind?: OpKind;\n presentationKind?: PresentationKind;\n}\n\n/**\n * AI prompt context for code generation.\n */\nexport interface CodeGenerationContext {\n specCode: string;\n targetPath?: string;\n existingCode?: string;\n}\n"],"mappings":";;;;AAqFA,MAAaA,2BAA4C;CACvD,YAAY;CACZ,WAAW;CACX,WAAW;CACX,aAAa;EACX,YAAY;EACZ,QAAQ;EACR,eAAe;EACf,OAAO;EACR;CACD,eAAe,EAAE;CACjB,aAAa,EAAE;CAChB"}