@lssm/module.contractspec-workspace 0.0.0-canary-20251215234340 → 0.0.0-canary-20251216024228
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 +3 -0
- package/dist/analysis/feature-scan.js +1 -0
- package/dist/analysis/spec-scan.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.includes(`.feature.`)}function t(e,t){let l=o(e,`key`)??a(t),u=o(e,`title`)??void 0,d=o(e,`description`)??void 0,f=o(e,`domain`)??void 0,p=o(e,`stability`);return{filePath:t,key:l,title:u,description:d,domain:f,stability:c(p)?p:void 0,owners:s(e,`owners`),tags:s(e,`tags`),operations:n(e,`operations`),events:n(e,`events`),presentations:n(e,`presentations`),experiments:n(e,`experiments`),capabilities:r(e),opToPresentationLinks:i(e)}}function n(e,t){let n=[],r=RegExp(`${l(t)}\\s*:\\s*\\[([\\s\\S]*?)\\]`,`m`),i=e.match(r);if(!i?.[1])return n;let a=/\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,o;for(;(o=a.exec(i[1]))!==null;)o[1]&&o[2]&&n.push({name:o[1],version:Number(o[2])});return n}function r(e){let t=[],n=[],r=e.match(/capabilities\s*:\s*\{([\s\S]*?)\}/);if(!r?.[1])return{provides:t,requires:n};let i=r[1],a=i.match(/provides\s*:\s*\[([\s\S]*?)\]/);if(a?.[1]){let e=/\{\s*key:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,n;for(;(n=e.exec(a[1]))!==null;)n[1]&&n[2]&&t.push({name:n[1],version:Number(n[2])})}let o=i.match(/requires\s*:\s*\[([\s\S]*?)\]/);if(o?.[1]){let e=/\{\s*key:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,t=/\{\s*key:\s*['"]([^'"]+)['"]\s*\}/g,r=null;for(;(r=e.exec(o[1]))!==null;)r[1]&&r[2]&&n.push({name:r[1],version:Number(r[2])});for(;(r=t.exec(o[1]))!==null;)r&&r[1]&&(n.some(e=>e.name===r[1])||n.push({name:r[1],version:1}))}return{provides:t,requires:n}}function i(e){let t=[],n=e.match(/opToPresentation\s*:\s*\[([\s\S]*?)\]/);if(!n?.[1])return t;let r=/\{\s*op:\s*\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)\s*\}\s*,\s*pres:\s*\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)\s*\}/g,i;for(;(i=r.exec(n[1]))!==null;)i[1]&&i[2]&&i[3]&&i[4]&&t.push({op:{name:i[1],version:Number(i[2])},pres:{name:i[3],version:Number(i[4])}});return t}function a(e){return(e.split(`/`).pop()??e).replace(/\.feature\.[jt]s$/,``).replace(/[^a-zA-Z0-9-]/g,`-`)}function o(e,t){let n=RegExp(`${l(t)}\\s*:\\s*['"]([^'"]+)['"]`);return e.match(n)?.[1]??null}function s(e,t){let n=RegExp(`${l(t)}\\s*:\\s*\\[([\\s\\S]*?)\\]`),r=e.match(n);if(!r?.[1])return;let i=r[1],a=Array.from(i.matchAll(/['"]([^'"]+)['"]/g)).map(e=>e[1]).filter(e=>typeof e==`string`&&e.length>0);return a.length>0?a:void 0}function c(e){return e===`experimental`||e===`beta`||e===`stable`||e===`deprecated`}function l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}export{e as isFeatureFile,t as scanFeatureSource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e.includes(`.contracts.`)?`operation`:e.includes(`.event.`)?`event`:e.includes(`.presentation.`)?`presentation`:e.includes(`.
|
|
1
|
+
function e(e){return e.includes(`.contracts.`)?`operation`:e.includes(`.event.`)?`event`:e.includes(`.presentation.`)?`presentation`:e.includes(`.feature.`)?`feature`:e.includes(`.capability.`)?`capability`:e.includes(`.data-view.`)?`data-view`:e.includes(`.form.`)?`form`:e.includes(`.migration.`)?`migration`:e.includes(`.workflow.`)?`workflow`:e.includes(`.experiment.`)?`experiment`:e.includes(`.integration.`)?`integration`:e.includes(`.knowledge.`)?`knowledge`:e.includes(`.telemetry.`)?`telemetry`:e.includes(`.app-config.`)?`app-config`:e.includes(`.policy.`)?`policy`:e.includes(`.test-spec.`)?`test-spec`:`unknown`}function t(t,l){let u=e(l),d=a(t,`name`),f=a(t,`description`),p=a(t,`stability`),m=c(p)?p:void 0,h=s(t,`owners`),g=s(t,`tags`),_=o(t,`version`),v=a(t,`kind`),y=v===`command`||v===`query`?v:`unknown`,b=/meta\s*:\s*{/.test(t),x=/\bio\s*:\s*{/.test(t),S=/\bpolicy\s*:\s*{/.test(t),C=/\bpayload\s*:\s*{/.test(t),w=/\bcontent\s*:\s*{/.test(t),T=/\bdefinition\s*:\s*{/.test(t),E=u===`operation`?n(t):void 0,D=u===`operation`?r(t):void 0,O=i(t);return{filePath:l,specType:u,name:d??void 0,description:f??void 0,stability:m,owners:h,tags:g,version:_??void 0,kind:y,hasMeta:b,hasIo:x,hasPolicy:S,hasPayload:C,hasContent:w,hasDefinition:T,emittedEvents:E,policyRefs:D,testRefs:O}}function n(e){let t=[],n=/\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,r;for(;(r=n.exec(e))!==null;)r[1]&&r[2]&&t.push({name:r[1],version:Number(r[2])});let i=/\{\s*ref:\s*(\w+)/g;for(;(r=i.exec(e))!==null;)r[1]&&r[1].startsWith(`when`);return t.length>0?t:void 0}function r(e){let t=[],n=/\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,r=e.match(/policies\s*:\s*\[([\s\S]*?)\]/);if(r?.[1]){let e;for(;(e=n.exec(r[1]))!==null;)e[1]&&e[2]&&t.push({name:e[1],version:Number(e[2])})}return t.length>0?t:void 0}function i(e){let t=[],n=e.match(/tests\s*:\s*\[([\s\S]*?)\]/);if(n?.[1]){let e=/\{\s*name:\s*['"]([^'"]+)['"]\s*,\s*version:\s*(\d+)/g,r;for(;(r=e.exec(n[1]))!==null;)r[1]&&r[2]&&t.push({name:r[1],version:Number(r[2])})}return t.length>0?t:void 0}function a(e,t){let n=RegExp(`${l(t)}\\s*:\\s*['"]([^'"]+)['"]`);return e.match(n)?.[1]??null}function o(e,t){let n=RegExp(`${l(t)}\\s*:\\s*(\\d+)`),r=e.match(n);if(!r?.[1])return null;let i=Number(r[1]);return Number.isFinite(i)?i:null}function s(e,t){let n=RegExp(`${l(t)}\\s*:\\s*\\[([\\s\\S]*?)\\]`),r=e.match(n);if(!r?.[1])return;let i=r[1],a=Array.from(i.matchAll(/['"]([^'"]+)['"]/g)).map(e=>e[1]).filter(e=>typeof e==`string`&&e.length>0);return a.length>0?a:void 0}function c(e){return e===`experimental`||e===`beta`||e===`stable`||e===`deprecated`}function l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}export{n as extractEmittedEvents,r as extractPolicyRefs,i as extractTestRefs,e as inferSpecTypeFromFilePath,t as scanSpecSource};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_WORKSPACE_CONFIG as e}from"./types/generation-types.js";import{
|
|
1
|
+
import{DEFAULT_WORKSPACE_CONFIG as e}from"./types/generation-types.js";import{extractEmittedEvents as t,extractPolicyRefs as n,extractTestRefs as r,inferSpecTypeFromFilePath as i,scanSpecSource as a}from"./analysis/spec-scan.js";import{isFeatureFile as o,scanFeatureSource as s}from"./analysis/feature-scan.js";import{computeSemanticDiff as c}from"./analysis/diff/semantic.js";import{addContractNode as l,buildReverseEdges as u,createContractGraph as d,detectCycles as f,findMissingDependencies as p,toDot as m}from"./analysis/deps/graph.js";import{parseImportedSpecNames as h}from"./analysis/deps/parse-imports.js";import{validateSpecStructure as g}from"./analysis/validate/spec-structure.js";import{capitalize as _,escapeString as v,toCamelCase as y,toKebabCase as b,toPascalCase as x}from"./templates/utils.js";import{generateOperationSpec as S}from"./templates/operation.js";import{generateEventSpec as C}from"./templates/event.js";import{generatePresentationSpec as w}from"./templates/presentation.js";import{generateWorkflowSpec as T}from"./templates/workflow.js";import{generateWorkflowRunnerTemplate as E}from"./templates/workflow-runner.js";import{generateDataViewSpec as D}from"./templates/data-view.js";import{generateTelemetrySpec as O}from"./templates/telemetry.js";import{generateExperimentSpec as k}from"./templates/experiment.js";import{generateAppBlueprintSpec as A}from"./templates/app-config.js";import{generateMigrationSpec as j}from"./templates/migration.js";import{generateIntegrationSpec as M}from"./templates/integration.js";import{generateKnowledgeSpaceSpec as N}from"./templates/knowledge.js";import{generateComponentTemplate as P,generateHandlerTemplate as F,generateTestTemplate as I}from"./templates/handler.js";import{addExampleContext as L,buildEventSpecPrompt as R,buildOperationSpecPrompt as z,buildPresentationSpecPrompt as B,getSystemPrompt as V}from"./ai/spec-creation.js";import{buildComponentPrompt as H,buildFormPrompt as U,buildHandlerPrompt as W,buildTestPrompt as G,getCodeGenSystemPrompt as K}from"./ai/code-generation.js";export{e as DEFAULT_WORKSPACE_CONFIG,l as addContractNode,L as addExampleContext,H as buildComponentPrompt,R as buildEventSpecPrompt,U as buildFormPrompt,W as buildHandlerPrompt,z as buildOperationSpecPrompt,B as buildPresentationSpecPrompt,u as buildReverseEdges,G as buildTestPrompt,_ as capitalize,c as computeSemanticDiff,d as createContractGraph,f as detectCycles,v as escapeString,t as extractEmittedEvents,n as extractPolicyRefs,r as extractTestRefs,p as findMissingDependencies,A as generateAppBlueprintSpec,P as generateComponentTemplate,D as generateDataViewSpec,C as generateEventSpec,k as generateExperimentSpec,F as generateHandlerTemplate,M as generateIntegrationSpec,N as generateKnowledgeSpaceSpec,j as generateMigrationSpec,S as generateOperationSpec,w as generatePresentationSpec,O as generateTelemetrySpec,I as generateTestTemplate,E as generateWorkflowRunnerTemplate,T as generateWorkflowSpec,K as getCodeGenSystemPrompt,V as getSystemPrompt,i as inferSpecTypeFromFilePath,o as isFeatureFile,h as parseImportedSpecNames,s as scanFeatureSource,a as scanSpecSource,y as toCamelCase,m as toDot,b as toKebabCase,x as toPascalCase,g as validateSpecStructure};
|