@lssm/bundle.contractspec-workspace 0.0.0-canary-20251213172311 → 0.0.0-canary-20251215231151

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 (54) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -0
  2. package/dist/ai/agents/claude-code-agent.js +44 -0
  3. package/dist/ai/agents/cursor-agent.js +168 -0
  4. package/dist/ai/agents/index.js +1 -0
  5. package/dist/ai/agents/openai-codex-agent.js +34 -0
  6. package/dist/ai/agents/orchestrator.js +1 -0
  7. package/dist/ai/agents/simple-agent.js +15 -0
  8. package/dist/ai/client.js +1 -0
  9. package/dist/ai/index.js +1 -0
  10. package/dist/ai/prompts/code-generation.js +100 -0
  11. package/dist/ai/prompts/index.js +1 -0
  12. package/dist/ai/prompts/spec-creation.js +69 -0
  13. package/dist/ai/providers.js +1 -0
  14. package/dist/index.js +1 -1
  15. package/dist/node_modules/chalk/source/index.js +2 -0
  16. package/dist/node_modules/chalk/source/utilities.js +4 -0
  17. package/dist/node_modules/chalk/source/vendor/ansi-styles/index.js +1 -0
  18. package/dist/node_modules/chalk/source/vendor/supports-color/browser.js +1 -0
  19. package/dist/node_modules/cli-cursor/index.js +1 -0
  20. package/dist/node_modules/cli-spinners/index.js +1 -0
  21. package/dist/node_modules/cli-spinners/spinners.js +1 -0
  22. package/dist/node_modules/get-east-asian-width/index.js +1 -0
  23. package/dist/node_modules/get-east-asian-width/lookup.js +1 -0
  24. package/dist/node_modules/is-interactive/index.js +1 -0
  25. package/dist/node_modules/is-unicode-supported/index.js +1 -0
  26. package/dist/node_modules/log-symbols/browser-symbols.js +1 -0
  27. package/dist/node_modules/mimic-function/index.js +1 -0
  28. package/dist/node_modules/onetime/index.js +1 -0
  29. package/dist/node_modules/ora/index.js +6 -0
  30. package/dist/node_modules/restore-cursor/index.js +1 -0
  31. package/dist/node_modules/signal-exit/dist/mjs/index.js +1 -0
  32. package/dist/node_modules/signal-exit/dist/mjs/signals.js +1 -0
  33. package/dist/node_modules/stdin-discarder/index.js +1 -0
  34. package/dist/node_modules/string-width/index.js +1 -0
  35. package/dist/node_modules/strip-ansi/index.js +1 -0
  36. package/dist/node_modules/strip-ansi/node_modules/ansi-regex/index.js +1 -0
  37. package/dist/services/index.js +1 -1
  38. package/dist/services/openapi.js +2 -0
  39. package/dist/services/registry.js +1 -0
  40. package/dist/templates/app-config.template.js +33 -0
  41. package/dist/templates/data-view.template.js +54 -0
  42. package/dist/templates/event.template.js +24 -0
  43. package/dist/templates/experiment.template.js +62 -0
  44. package/dist/templates/handler.template.js +63 -0
  45. package/dist/templates/index.js +1 -0
  46. package/dist/templates/integration.template.js +75 -0
  47. package/dist/templates/knowledge.template.js +33 -0
  48. package/dist/templates/migration.template.js +37 -0
  49. package/dist/templates/operation.template.js +88 -0
  50. package/dist/templates/presentation.template.js +53 -0
  51. package/dist/templates/telemetry.template.js +69 -0
  52. package/dist/templates/workflow-runner.template.js +43 -0
  53. package/dist/templates/workflow.template.js +41 -0
  54. package/package.json +3 -3
@@ -0,0 +1,69 @@
1
+ function e(e){let i=t(e.name.split(`.`).pop()??`Telemetry`)+`Telemetry`,a=e.providers?.length?`providers: [
2
+ ${e.providers.map(e=>` {
3
+ type: '${e.type}',
4
+ config: ${r(e.config)},
5
+ }`).join(`,
6
+ `)}
7
+ ],`:``,o=e.events.map(e=>{let t=e.properties.map(e=>` '${e.name}': {
8
+ type: '${e.type}',
9
+ ${e.required?`required: true,`:``}
10
+ ${e.pii?`pii: true,`:``}
11
+ ${e.redact?`redact: true,`:``}
12
+ ${e.description?`description: '${n(e.description)}',`:``}
13
+ }`).join(`,
14
+ `),r=e.anomalyRules?.length?` anomalyDetection: {
15
+ enabled: true,
16
+ ${typeof e.anomalyMinimumSample==`number`?`minimumSample: ${e.anomalyMinimumSample},`:``}
17
+ thresholds: [
18
+ ${e.anomalyRules.map(e=>` {
19
+ metric: '${n(e.metric)}',
20
+ ${typeof e.min==`number`?`min: ${e.min},`:``}
21
+ ${typeof e.max==`number`?`max: ${e.max},`:``}
22
+ }`).join(`,
23
+ `)}
24
+ ],
25
+ actions: [${(e.anomalyActions??[]).map(e=>`'${e}'`).join(`, `)}],
26
+ },`:e.anomalyEnabled?` anomalyDetection: {
27
+ enabled: true,
28
+ ${typeof e.anomalyMinimumSample==`number`?`minimumSample: ${e.anomalyMinimumSample},`:``}
29
+ },`:``;return` {
30
+ name: '${n(e.name)}',
31
+ version: ${e.version},
32
+ semantics: {
33
+ what: '${n(e.what)}',
34
+ ${e.who?`who: '${n(e.who)}',`:``}
35
+ ${e.why?`why: '${n(e.why)}',`:``}
36
+ },
37
+ privacy: '${e.privacy}',
38
+ properties: {
39
+ ${t}
40
+ },
41
+ ${typeof e.retentionDays==`number`?`retention: { days: ${e.retentionDays}, ${e.retentionPolicy?`policy: '${e.retentionPolicy}'`:``} },`:``}
42
+ ${typeof e.samplingRate==`number`?`sampling: { rate: ${e.samplingRate}${e.samplingConditions?`, conditions: ['${n(e.samplingConditions)}']`:``} },`:``}
43
+ ${r}
44
+ ${e.tags?.length?`tags: [${e.tags.map(e=>`'${n(e)}'`).join(`, `)}],`:``}
45
+ }`}).join(`,
46
+ `);return`import type { TelemetrySpec } from '@lssm/lib.contracts/telemetry';
47
+
48
+ export const ${i}: TelemetrySpec = {
49
+ meta: {
50
+ name: '${n(e.name)}',
51
+ version: ${e.version},
52
+ title: '${n(e.name)} telemetry',
53
+ description: '${n(e.description||`Describe the purpose of this telemetry spec.`)}',
54
+ domain: '${n(e.domain)}',
55
+ owners: [${e.owners.map(e=>`'${n(e)}'`).join(`, `)}],
56
+ tags: [${e.tags.map(e=>`'${n(e)}'`).join(`, `)}],
57
+ stability: '${e.stability}',
58
+ },
59
+ config: {
60
+ ${typeof e.defaultRetentionDays==`number`?`defaultRetentionDays: ${e.defaultRetentionDays},`:``}
61
+ ${typeof e.defaultSamplingRate==`number`?`defaultSamplingRate: ${e.defaultSamplingRate},`:``}
62
+ ${e.anomalyEnabled?`anomalyDetection: { enabled: true${typeof e.anomalyCheckIntervalMs==`number`?`, checkIntervalMs: ${e.anomalyCheckIntervalMs}`:``} },`:``}
63
+ ${a}
64
+ },
65
+ events: [
66
+ ${o}
67
+ ],
68
+ };
69
+ `}function t(e){return e.split(/[-_.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function n(e){return e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}function r(e){let t=e.trim();return t?t.startsWith(`{`)&&t.endsWith(`}`)||t.startsWith(`[`)&&t.endsWith(`]`)?t:`'${n(t)}'`:`{}`}export{e as generateTelemetrySpec};
@@ -0,0 +1,43 @@
1
+ function e({exportName:e,specImportPath:t,runnerName:n,workflowName:r}){return`import {
2
+ InMemoryStateStore,
3
+ WorkflowRegistry,
4
+ WorkflowRunner,
5
+ } from '@lssm/lib.contracts/workflow';
6
+ import { ${e} } from '${t}';
7
+
8
+ /**
9
+ * Runner wiring for ${r}.
10
+ *
11
+ * TODO:
12
+ * - Replace the in-memory state store with a persistent adapter if needed.
13
+ * - Implement opExecutor to invoke the correct contract handlers.
14
+ * - Wire eventEmitter to analytics/telemetry sinks.
15
+ */
16
+ const registry = new WorkflowRegistry();
17
+ registry.register(${e});
18
+
19
+ const stateStore = new InMemoryStateStore();
20
+
21
+ export const ${n} = new WorkflowRunner({
22
+ registry,
23
+ stateStore,
24
+ opExecutor: async (operation, input, ctx) => {
25
+ // TODO: route to the appropriate contract handler
26
+ // Example: return contractRegistry.execute(operation.name, operation.version, input, ctx);
27
+ throw new Error(
28
+ \`opExecutor for \${operation.name}.v\${operation.version} is not implemented\`
29
+ );
30
+ },
31
+ // appConfigProvider: async (state) => {
32
+ // // TODO: return the ResolvedAppConfig for this workflow run (tenant/environment)
33
+ // return undefined;
34
+ // },
35
+ // enforceCapabilities: async (operation, context) => {
36
+ // // TODO: ensure required capabilities are satisfied using context.integrations/context.resolvedAppConfig
37
+ // },
38
+ eventEmitter: (event, payload) => {
39
+ // TODO: forward workflow events to telemetry or logging sinks
40
+ // console.log(event, payload);
41
+ },
42
+ });
43
+ `}export{e as generateWorkflowRunnerTemplate};
@@ -0,0 +1,41 @@
1
+ function e(e){let i=n(e.name.split(`.`).pop()??`Workflow`)+`Workflow`,a=e.steps.map(e=>t(e)).join(`,
2
+ `),o=e.transitions.map(e=>` {
3
+ from: '${e.from}',
4
+ to: '${e.to}',
5
+ ${e.condition?` condition: '${r(e.condition)}',`:``}
6
+ }`).join(`,
7
+ `);return`import type { WorkflowSpec } from '@lssm/lib.contracts/workflow';
8
+
9
+ /**
10
+ * Workflow generated via contractspec CLI.
11
+ * TODO:
12
+ * - Review step definitions and descriptions.
13
+ * - Wire automation steps to actual operations.
14
+ * - Provide form renderers for human steps.
15
+ * - Add guards/conditions as needed.
16
+ */
17
+ export const ${i}: WorkflowSpec = {
18
+ meta: {
19
+ name: '${e.name}',
20
+ version: ${e.version},
21
+ title: '${r(e.title)}',
22
+ description: '${r(e.description)}',
23
+ domain: '${r(e.domain)}',
24
+ stability: '${e.stability}',
25
+ owners: [${e.owners.map(e=>`'${e}'`).join(`, `)}],
26
+ tags: [${e.tags.map(e=>`'${e}'`).join(`, `)}],
27
+ },
28
+ definition: {
29
+ ${e.entryStepId?` entryStepId: '${e.entryStepId}',\n`:``} steps: [
30
+ ${a}
31
+ ],
32
+ transitions: [
33
+ ${o}
34
+ ],
35
+ },
36
+ ${e.policyFlags.length>0?`policy: {
37
+ flags: [${e.policyFlags.map(e=>`'${e}'`).join(`, `)}],
38
+ },`:`// policy: { flags: [] },`}
39
+ };
40
+ `}function t(e){let t=[` {`,` id: '${e.id}',`,` type: '${e.type}',`,` label: '${r(e.label)}',`];e.description&&t.push(` description: '${r(e.description)}',`);let n=[];return e.operation&&n.push(`operation: { name: '${e.operation.name}', version: ${e.operation.version} }`),e.form&&n.push(`form: { key: '${e.form.key}', version: ${e.form.version} }`),n.length&&t.push(` action: { ${n.join(`, `)} },`),t.push(` }`),t.join(`
41
+ `)}function n(e){return e.split(/[-_.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function r(e){return e.replace(/'/g,`\\'`)}export{e as generateWorkflowSpec};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/bundle.contractspec-workspace",
3
- "version": "0.0.0-canary-20251213172311",
3
+ "version": "0.0.0-canary-20251215231151",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -31,14 +31,14 @@
31
31
  "@ai-sdk/openai": "beta",
32
32
  "ollama-ai-provider": "^1.2.0",
33
33
  "zod": "^4.1.13",
34
- "glob": "^11.0.1",
34
+ "glob": "^13.0.0",
35
35
  "chokidar": "^4.0.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@lssm/tool.tsdown": "workspace:*",
39
39
  "@lssm/tool.typescript": "workspace:*",
40
40
  "@types/node": "^22.10.2",
41
- "tsdown": "^0.17.0",
41
+ "tsdown": "^0.17.4",
42
42
  "typescript": "^5.9.3"
43
43
  },
44
44
  "exports": {