@specverse/engines 6.39.3 → 6.40.7
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/dist/libs/instance-factories/services/templates/prisma/controller-generator.js +39 -20
- package/dist/libs/instance-factories/services/templates/prisma/service-generator.js +14 -5
- package/dist/libs/instance-factories/services/templates/prisma/step-conventions.js +10 -1
- package/dist/realize/index.d.ts.map +1 -1
- package/dist/realize/index.js +91 -13
- package/dist/realize/index.js.map +1 -1
- package/dist/realize/per-owner-emit.d.ts +101 -0
- package/dist/realize/per-owner-emit.d.ts.map +1 -0
- package/dist/realize/per-owner-emit.js +351 -0
- package/dist/realize/per-owner-emit.js.map +1 -0
- package/dist/realize/per-owner-runner.d.ts +105 -0
- package/dist/realize/per-owner-runner.d.ts.map +1 -0
- package/dist/realize/per-owner-runner.js +336 -0
- package/dist/realize/per-owner-runner.js.map +1 -0
- package/dist/realize/runtime-emitters/library.d.ts.map +1 -1
- package/dist/realize/runtime-emitters/library.js +17 -1
- package/dist/realize/runtime-emitters/library.js.map +1 -1
- package/libs/instance-factories/services/templates/_shared/step-matching.d.ts +39 -0
- package/libs/instance-factories/services/templates/_shared/step-matching.d.ts.map +1 -0
- package/libs/instance-factories/services/templates/_shared/step-matching.js +90 -0
- package/libs/instance-factories/services/templates/_shared/step-matching.js.map +1 -0
- package/libs/instance-factories/services/templates/prisma/__tests__/step-conventions-return.test.ts +124 -0
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +70 -22
- package/libs/instance-factories/services/templates/prisma/service-generator.ts +52 -6
- package/libs/instance-factories/services/templates/prisma/step-conventions.ts +33 -1
- package/package.json +1 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-owner realize runner — Phase 1 of the 2026-05-11-PER-OWNER-VS-PER-ACTION
|
|
3
|
+
* proposal.
|
|
4
|
+
*
|
|
5
|
+
* Sibling of `per-action-runner.ts`. SAME spec-walking + owner-grouping
|
|
6
|
+
* logic, DIFFERENT emission granularity: instead of calling
|
|
7
|
+
* `emitActionBody` once per action, this runner calls the per-owner
|
|
8
|
+
* LLM emit hook ONCE per owner and writes the resulting whole-file
|
|
9
|
+
* content as `<Owner>.ai.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Why this exists: the per-action emitter (Realize L3 Phase 3) gave
|
|
12
|
+
* the LLM narrow context — one action's steps, no class shell, no
|
|
13
|
+
* sibling methods, no manifest capabilities. Empirically on
|
|
14
|
+
* idle-meta sonnet, that produced 29 of 94 actions as throw-stubs
|
|
15
|
+
* because the LLM correctly refused to invent imports it couldn't
|
|
16
|
+
* see were available. Per-owner restores the holistic context.
|
|
17
|
+
*
|
|
18
|
+
* Same `<Owner>.ai.ts` output shape (exported async functions per
|
|
19
|
+
* action) → no consumer-interface change. The downstream controller
|
|
20
|
+
* still does `import * as aiBehaviors from '../behaviors/X.ai.js'`.
|
|
21
|
+
*/
|
|
22
|
+
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
23
|
+
import { dirname, join } from 'path';
|
|
24
|
+
import { collectActions, buildAvailableClientsByOwner, } from './per-action-runner.js';
|
|
25
|
+
/**
|
|
26
|
+
* Run per-owner LLM emission across every controller / service the
|
|
27
|
+
* spec declares. For each owner:
|
|
28
|
+
* 1. Collect its actions and resolve per-step matcher results.
|
|
29
|
+
* 2. Call the perOwnerEmit hook with the whole owner's context.
|
|
30
|
+
* 3. Write the returned file contents to disk (or fall back to a
|
|
31
|
+
* placeholder file containing one γ stub per action when emit
|
|
32
|
+
* returned null).
|
|
33
|
+
*/
|
|
34
|
+
export async function runPerOwnerEmission(opts) {
|
|
35
|
+
const collected = collectActions(opts.spec);
|
|
36
|
+
const ownerGroups = groupByOwner(collected);
|
|
37
|
+
const owners = [];
|
|
38
|
+
const filesWritten = [];
|
|
39
|
+
const totals = {
|
|
40
|
+
ownerCount: 0,
|
|
41
|
+
actionCount: 0,
|
|
42
|
+
ownersEmittedByLLM: 0,
|
|
43
|
+
ownersFellBack: 0,
|
|
44
|
+
};
|
|
45
|
+
// Matcher must be supplied by the caller — the libs/ step-matching
|
|
46
|
+
// module sits OUTSIDE engines/src/'s tsconfig rootDir and can't be
|
|
47
|
+
// statically imported here. realize/index.ts already resolves the
|
|
48
|
+
// shared matcher via resolveGenPath + dynamic import and threads it
|
|
49
|
+
// into per-action-runner; per-owner-runner uses the same matcher.
|
|
50
|
+
if (!opts.matcher) {
|
|
51
|
+
throw new Error('runPerOwnerEmission requires `matcher` in options — the caller (realize/index.ts) ' +
|
|
52
|
+
'resolves the shared step-matching module via resolveGenPath + dynamic import.');
|
|
53
|
+
}
|
|
54
|
+
const matcher = opts.matcher;
|
|
55
|
+
const conventions = opts.conventions ?? [];
|
|
56
|
+
for (const [ownerName, actions] of ownerGroups) {
|
|
57
|
+
// Resolve per-step matches for every action on this owner.
|
|
58
|
+
const collectedOwnerActions = actions.map((action) => {
|
|
59
|
+
const ctx = {
|
|
60
|
+
componentName: ownerName,
|
|
61
|
+
modelName: action.modelName,
|
|
62
|
+
matcher,
|
|
63
|
+
conventions,
|
|
64
|
+
};
|
|
65
|
+
const perStepMatches = matchSteps(action.spec, ctx, matcher, conventions);
|
|
66
|
+
return {
|
|
67
|
+
actionName: action.actionName,
|
|
68
|
+
spec: action.spec,
|
|
69
|
+
perStepMatches,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
// Owner-level spec block — re-derive from the spec for
|
|
73
|
+
// self-contained prompt context. Best-effort; missing → empty obj.
|
|
74
|
+
const ownerSpec = lookupOwnerSpec(opts.spec, ownerName, actions[0]?.ownerKind);
|
|
75
|
+
// Isolate per-owner emission failures so a single owner's throw
|
|
76
|
+
// (e.g. structural-validator rejection because the LLM dropped a
|
|
77
|
+
// pre-baked snippet) doesn't kill emission for the other 27
|
|
78
|
+
// owners. The 2026-05-11 trial run hit this: HealthController
|
|
79
|
+
// failed structural-preservation, the throw bubbled out to
|
|
80
|
+
// realize/index.ts's outer catch, and 25 owners that hadn't run
|
|
81
|
+
// yet got skipped. Each owner's success is independent — catch
|
|
82
|
+
// here, fall back to the deterministic placeholder file, log to
|
|
83
|
+
// stderr (gated by SPECVERSE_VERBOSE), and keep walking.
|
|
84
|
+
let fileContents = null;
|
|
85
|
+
try {
|
|
86
|
+
fileContents = await opts.perOwnerEmit({
|
|
87
|
+
ownerName,
|
|
88
|
+
ownerKind: actions[0]?.ownerKind ?? 'model',
|
|
89
|
+
ownerSpec,
|
|
90
|
+
actions: collectedOwnerActions,
|
|
91
|
+
availableClients: opts.availableClientsByOwner?.get(ownerName),
|
|
92
|
+
availableCapabilities: opts.availableCapabilities,
|
|
93
|
+
processContext: opts.processContextByOwner?.get(ownerName),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
if (process.env.SPECVERSE_VERBOSE) {
|
|
98
|
+
const cls = (e && e.constructor && e.constructor.name) || 'Error';
|
|
99
|
+
const msg = (e && e.message) || String(e);
|
|
100
|
+
const head = String(msg).slice(0, 240).replace(/\s+/g, ' ');
|
|
101
|
+
console.error(` ✗ per-owner emit threw for ${ownerName} [${cls}]: ${head}`);
|
|
102
|
+
}
|
|
103
|
+
fileContents = null;
|
|
104
|
+
}
|
|
105
|
+
const finalContents = fileContents ?? renderFallbackPlaceholderFile(ownerName, actions);
|
|
106
|
+
const llmEmitted = fileContents !== null;
|
|
107
|
+
owners.push({
|
|
108
|
+
ownerName,
|
|
109
|
+
actionCount: actions.length,
|
|
110
|
+
llmEmitted,
|
|
111
|
+
fileContents: finalContents,
|
|
112
|
+
});
|
|
113
|
+
totals.ownerCount += 1;
|
|
114
|
+
totals.actionCount += actions.length;
|
|
115
|
+
if (llmEmitted)
|
|
116
|
+
totals.ownersEmittedByLLM += 1;
|
|
117
|
+
else
|
|
118
|
+
totals.ownersFellBack += 1;
|
|
119
|
+
if (!opts.dryRun) {
|
|
120
|
+
const filePath = writeOwnerAiFile(opts.outputDir, ownerName, finalContents);
|
|
121
|
+
filesWritten.push(filePath);
|
|
122
|
+
if (!opts.silent) {
|
|
123
|
+
const tag = llmEmitted ? 'LLM' : 'placeholder';
|
|
124
|
+
console.log(` ✅ Per-owner AI behaviors: ${ownerName}.ai.ts (${actions.length} action${actions.length === 1 ? '' : 's'}, ${tag})`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return { owners, filesWritten, totals };
|
|
129
|
+
}
|
|
130
|
+
// ─── Internal helpers ────────────────────────────────────────────────
|
|
131
|
+
/** Group collected actions by owner name. Mirrors per-action-runner. */
|
|
132
|
+
function groupByOwner(actions) {
|
|
133
|
+
const groups = new Map();
|
|
134
|
+
for (const a of actions) {
|
|
135
|
+
const list = groups.get(a.ownerName) ?? [];
|
|
136
|
+
list.push(a);
|
|
137
|
+
groups.set(a.ownerName, list);
|
|
138
|
+
}
|
|
139
|
+
return groups;
|
|
140
|
+
}
|
|
141
|
+
/** Find the owner's spec block in the inferred spec. Searches the
|
|
142
|
+
* flat-at-root `spec.controllers` / `spec.services` first (which
|
|
143
|
+
* inference + analyse pipeline both produce), falling back to
|
|
144
|
+
* per-component nesting. Returns an empty object if not found. */
|
|
145
|
+
function lookupOwnerSpec(spec, ownerName, ownerKind) {
|
|
146
|
+
// Flat-at-root path.
|
|
147
|
+
const lookups = [
|
|
148
|
+
spec?.controllers,
|
|
149
|
+
spec?.services,
|
|
150
|
+
];
|
|
151
|
+
for (const block of lookups) {
|
|
152
|
+
if (!block)
|
|
153
|
+
continue;
|
|
154
|
+
if (Array.isArray(block)) {
|
|
155
|
+
const hit = block.find((b) => b?.name === ownerName);
|
|
156
|
+
if (hit)
|
|
157
|
+
return hit;
|
|
158
|
+
}
|
|
159
|
+
else if (typeof block === 'object') {
|
|
160
|
+
if (block[ownerName])
|
|
161
|
+
return block[ownerName];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Per-component nested path.
|
|
165
|
+
const componentsList = Array.isArray(spec?.components)
|
|
166
|
+
? spec.components
|
|
167
|
+
: Object.values(spec?.components ?? {});
|
|
168
|
+
for (const comp of componentsList) {
|
|
169
|
+
const compBlocks = [comp?.controllers, comp?.services];
|
|
170
|
+
for (const block of compBlocks) {
|
|
171
|
+
if (!block)
|
|
172
|
+
continue;
|
|
173
|
+
if (Array.isArray(block)) {
|
|
174
|
+
const hit = block.find((b) => b?.name === ownerName);
|
|
175
|
+
if (hit)
|
|
176
|
+
return hit;
|
|
177
|
+
}
|
|
178
|
+
else if (typeof block === 'object') {
|
|
179
|
+
if (block[ownerName])
|
|
180
|
+
return block[ownerName];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {};
|
|
185
|
+
}
|
|
186
|
+
/** Run every step of an action through the matcher. Returns null per
|
|
187
|
+
* step when the action has no steps to dispatch. Same as
|
|
188
|
+
* per-action-emitter's `matchSteps` — duplicated here so the
|
|
189
|
+
* per-owner runner doesn't need an extra import dance through the
|
|
190
|
+
* per-action emitter. */
|
|
191
|
+
function matchSteps(action, context, matcher, conventions) {
|
|
192
|
+
if (!action.steps || action.steps.length === 0)
|
|
193
|
+
return [];
|
|
194
|
+
const aiArgsExpr = (inputs) => inputs.length > 0 ? `{ ${inputs.join(', ')} }` : '{}';
|
|
195
|
+
const declaredVars = new Set();
|
|
196
|
+
const parameterNames = action.parameters ? Object.keys(action.parameters) : [];
|
|
197
|
+
const results = [];
|
|
198
|
+
for (let i = 0; i < action.steps.length; i++) {
|
|
199
|
+
const step = action.steps[i];
|
|
200
|
+
const ctx = {
|
|
201
|
+
modelName: context.modelName,
|
|
202
|
+
serviceName: action.ownerName,
|
|
203
|
+
operationName: action.name,
|
|
204
|
+
stepNum: i + 1,
|
|
205
|
+
parameterNames,
|
|
206
|
+
declaredVars,
|
|
207
|
+
};
|
|
208
|
+
const result = matcher(step, ctx, conventions, aiArgsExpr);
|
|
209
|
+
results.push(result);
|
|
210
|
+
}
|
|
211
|
+
return results;
|
|
212
|
+
}
|
|
213
|
+
/** TS reserved words that can't appear as `export async function <name>`.
|
|
214
|
+
* When the spec action is named one of these (e.g. `delete`, `class`),
|
|
215
|
+
* we declare the implementation under a sanitized name then re-export
|
|
216
|
+
* via `export { sanitized as reserved }` — that's a legal re-export
|
|
217
|
+
* rename and `import * as aiBehaviors` continues to resolve
|
|
218
|
+
* `aiBehaviors.delete(...)` correctly. Subset of the full reserved-word
|
|
219
|
+
* list — only those plausibly used as action names. */
|
|
220
|
+
const TS_RESERVED_WORDS = new Set([
|
|
221
|
+
'delete', 'class', 'function', 'return', 'void', 'typeof',
|
|
222
|
+
'instanceof', 'new', 'this', 'throw', 'try', 'catch', 'finally',
|
|
223
|
+
'if', 'else', 'for', 'while', 'do', 'switch', 'case', 'break',
|
|
224
|
+
'continue', 'default', 'var', 'let', 'const', 'in', 'of',
|
|
225
|
+
'async', 'await', 'yield', 'export', 'import', 'from',
|
|
226
|
+
'true', 'false', 'null', 'undefined', 'static', 'public',
|
|
227
|
+
'private', 'protected', 'interface', 'type', 'enum', 'extends',
|
|
228
|
+
'implements', 'super',
|
|
229
|
+
]);
|
|
230
|
+
/** Render a deterministic placeholder file used when the LLM emit
|
|
231
|
+
* returns null for an entire owner. One γ-shaped exported function
|
|
232
|
+
* per action so the downstream `import * as aiBehaviors` continues
|
|
233
|
+
* to resolve — the runtime stub explains the gap.
|
|
234
|
+
*
|
|
235
|
+
* Reserved-word action names (e.g. `delete`, `class`) can't appear as
|
|
236
|
+
* `export async function <name>` declarations. Use a re-export rename
|
|
237
|
+
* in that case so consumers (`aiBehaviors.delete(...)`) still resolve.
|
|
238
|
+
* Caught empirically: the 2026-05-11 per-owner trial v4 produced a
|
|
239
|
+
* syntactically-broken placeholder for SaveGameService whose `delete`
|
|
240
|
+
* action name made the file fail TS parsing, which bailed tsc from
|
|
241
|
+
* the whole project. */
|
|
242
|
+
function renderFallbackPlaceholderFile(ownerName, actions) {
|
|
243
|
+
const parts = [];
|
|
244
|
+
parts.push(`/**`);
|
|
245
|
+
parts.push(` * ${ownerName} — Per-owner AI behaviors (placeholder)`);
|
|
246
|
+
parts.push(` *`);
|
|
247
|
+
parts.push(` * The per-owner LLM emit returned null for this owner (LLM`);
|
|
248
|
+
parts.push(` * declined, parse-failed twice, or rate-limited). Each action`);
|
|
249
|
+
parts.push(` * is stubbed individually so the consumer's`);
|
|
250
|
+
parts.push(` * \`import * as aiBehaviors\` continues to resolve. Inspect`);
|
|
251
|
+
parts.push(` * the realize log for the failure reason (set SPECVERSE_VERBOSE=1`);
|
|
252
|
+
parts.push(` * for diagnostic detail).`);
|
|
253
|
+
parts.push(` *`);
|
|
254
|
+
parts.push(` * Generated: ${new Date().toISOString().split('T')[0]}`);
|
|
255
|
+
parts.push(` */`);
|
|
256
|
+
parts.push('');
|
|
257
|
+
for (const action of actions) {
|
|
258
|
+
const name = action.actionName;
|
|
259
|
+
const isReserved = TS_RESERVED_WORDS.has(name);
|
|
260
|
+
parts.push(`/** Placeholder — LLM declined to emit ${name}. */`);
|
|
261
|
+
if (isReserved) {
|
|
262
|
+
// Declare under a sanitized identifier (`<name>_`) then re-export
|
|
263
|
+
// as the reserved-word name. Consumer `aiBehaviors.<name>(...)`
|
|
264
|
+
// resolves through the re-export.
|
|
265
|
+
const safeName = `${name}_`;
|
|
266
|
+
parts.push(`async function ${safeName}(input: any): Promise<any> {`);
|
|
267
|
+
parts.push(` throw new Error("${name}: not implemented (per-owner emit fell back)");`);
|
|
268
|
+
parts.push(`}`);
|
|
269
|
+
parts.push(`export { ${safeName} as ${name} };`);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
parts.push(`export async function ${name}(input: any): Promise<any> {`);
|
|
273
|
+
parts.push(` throw new Error("${name}: not implemented (per-owner emit fell back)");`);
|
|
274
|
+
parts.push(`}`);
|
|
275
|
+
}
|
|
276
|
+
parts.push('');
|
|
277
|
+
}
|
|
278
|
+
return parts.join('\n');
|
|
279
|
+
}
|
|
280
|
+
/** Write the owner's `.ai.ts` to disk under
|
|
281
|
+
* `<outputDir>/backend/src/behaviors/<Owner>.ai.ts`. Returns the
|
|
282
|
+
* absolute path. */
|
|
283
|
+
function writeOwnerAiFile(outputDir, ownerName, fileContents) {
|
|
284
|
+
const filePath = join(outputDir, 'backend', 'src', 'behaviors', `${ownerName}.ai.ts`);
|
|
285
|
+
const dir = dirname(filePath);
|
|
286
|
+
if (!existsSync(dir))
|
|
287
|
+
mkdirSync(dir, { recursive: true });
|
|
288
|
+
writeFileSync(filePath, fileContents, 'utf-8');
|
|
289
|
+
return filePath;
|
|
290
|
+
}
|
|
291
|
+
/** Build the availableCapabilities string consumed by the per-owner
|
|
292
|
+
* prompt's `availableCapabilities` slot. Walks the manifest's
|
|
293
|
+
* capabilityMappings and renders one line per mapping with a brief
|
|
294
|
+
* hint about what the factory provides. Exported so the realize
|
|
295
|
+
* caller can build it once and feed it to every owner.
|
|
296
|
+
*
|
|
297
|
+
* Format example:
|
|
298
|
+
* - orm.client → PrismaORM (provides Prisma's typed query API)
|
|
299
|
+
* - jwt.signer → JsonWebToken (jsonwebtoken.sign / verify)
|
|
300
|
+
* - event.bus → InMemoryEventBus (publish / subscribe)
|
|
301
|
+
*/
|
|
302
|
+
export function buildAvailableCapabilitiesString(manifest) {
|
|
303
|
+
if (!manifest || typeof manifest !== 'object')
|
|
304
|
+
return '(no capabilities)';
|
|
305
|
+
const mappings = collectCapabilityMappings(manifest);
|
|
306
|
+
if (!Array.isArray(mappings) || mappings.length === 0) {
|
|
307
|
+
return '(none — only `input: any` is available)';
|
|
308
|
+
}
|
|
309
|
+
const lines = [];
|
|
310
|
+
for (const m of mappings) {
|
|
311
|
+
if (!m?.capability || !m?.instanceFactory)
|
|
312
|
+
continue;
|
|
313
|
+
lines.push(` - ${m.capability} → ${m.instanceFactory}`);
|
|
314
|
+
}
|
|
315
|
+
return lines.length > 0 ? lines.join('\n') : '(none — only `input: any` is available)';
|
|
316
|
+
}
|
|
317
|
+
/** Walk both root and `manifests[].capabilityMappings` shapes. */
|
|
318
|
+
function collectCapabilityMappings(manifest) {
|
|
319
|
+
if (!manifest || typeof manifest !== 'object')
|
|
320
|
+
return [];
|
|
321
|
+
if (Array.isArray(manifest.capabilityMappings))
|
|
322
|
+
return manifest.capabilityMappings;
|
|
323
|
+
if (Array.isArray(manifest.manifests)) {
|
|
324
|
+
const out = [];
|
|
325
|
+
for (const inner of manifest.manifests) {
|
|
326
|
+
if (Array.isArray(inner?.capabilityMappings))
|
|
327
|
+
out.push(...inner.capabilityMappings);
|
|
328
|
+
}
|
|
329
|
+
return out;
|
|
330
|
+
}
|
|
331
|
+
return [];
|
|
332
|
+
}
|
|
333
|
+
// Re-export buildAvailableClientsByOwner so callers that want both
|
|
334
|
+
// strings don't have to import from two modules.
|
|
335
|
+
export { buildAvailableClientsByOwner };
|
|
336
|
+
//# sourceMappingURL=per-owner-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"per-owner-runner.js","sourceRoot":"","sources":["../../src/realize/per-owner-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EACL,cAAc,EACd,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;AA0EhC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAgC;IAEhC,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG;QACb,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,kBAAkB,EAAE,CAAC;QAC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AC,OAAO,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,yCAAyC,CAAC;AACzF,CAAC;AAED,kEAAkE;AAClE,SAAS,yBAAyB,CAAC,QAAa;IAC9C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAAE,OAAO,QAAQ,CAAC,kBAAkB,CAAC;IACnF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,MAAM,GAAG,GAAU,EAAE,CAAC;QACtB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;YACvC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,mEAAmE;AACnE,iDAAiD;AACjD,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../src/realize/runtime-emitters/library.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../src/realize/runtime-emitters/library.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAyRzB;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IAC1D,QAAQ,CAAC,QAAQ,EAAG,SAAS,CAAU;IAEjC,IAAI,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA+EtE"}
|
|
@@ -166,7 +166,23 @@ function generateImportBlock(ctx, selectEntries) {
|
|
|
166
166
|
const availableIds = new Map();
|
|
167
167
|
if (resolved.source === 'local') {
|
|
168
168
|
// Relative import to the provider's module in the same spec's output tree.
|
|
169
|
-
|
|
169
|
+
//
|
|
170
|
+
// The fallback path `../${toFileName(...)}` is a heuristic that
|
|
171
|
+
// assumes the provider lives one level up from the V2 client. In
|
|
172
|
+
// practice the realize pipeline doesn't currently emit per-component
|
|
173
|
+
// aggregate modules (`components/<Provider>/<from>.ts`) — providers
|
|
174
|
+
// are emitted directly to deterministic backend dirs (services/,
|
|
175
|
+
// controllers/, etc.). V2 client files end up with broken module
|
|
176
|
+
// references regardless of which depth we compute. The resolver's
|
|
177
|
+
// explicit `localRelativePath` is the authoritative form when
|
|
178
|
+
// available; the fallback is best-effort.
|
|
179
|
+
//
|
|
180
|
+
// We append `.js` extension when missing — NodeNext module
|
|
181
|
+
// resolution (the realized backend's default) requires explicit
|
|
182
|
+
// extensions on relative imports. Without this, the stub trial
|
|
183
|
+
// surfaced TS2834.
|
|
184
|
+
const rawPath = resolved.localRelativePath ?? `../${toFileName(resolved.resolvedName)}`;
|
|
185
|
+
const relativePath = /\.(m?[jt]sx?|json)$/.test(rawPath) ? rawPath : `${rawPath}.js`;
|
|
170
186
|
// Group dotted entries by head (entity) — one import per head.
|
|
171
187
|
const heads = new Set();
|
|
172
188
|
const bareEntries = [];
|
|
@@ -1 +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AAW,CAAC,IAAI,kDAAkD,CAClG,CAAC;QACJ,CAAC;QACD,IACE,QAAQ,CAAC,MAAM,KAAK,oBAAoB;YACxC,QAAQ,CAAC,MAAM,KAAK,kBAAkB,EACtC,CAAC;YACD,KAAK,CAAC,IAAI,CACR,sCAAsC,QAAQ,CAAC,YAAY,4EAA4E,CACxI,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;YACvC,OAAO,EAAE,CAAC,cAAc,CAAC;YACzB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SAC5C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared step-matching machinery — common helpers + the canonical
|
|
3
|
+
* `matchAgainstConventions` walker that any ORM-specific step-conventions
|
|
4
|
+
* library can compose with.
|
|
5
|
+
*
|
|
6
|
+
* Each ORM library (prisma, mongodb-native) exports its own
|
|
7
|
+
* `STEP_CONVENTIONS` array of `{name, pattern, generateCall}` items
|
|
8
|
+
* describing what code to emit for matched patterns. The matcher itself
|
|
9
|
+
* is identical across libraries: walk the conventions in order, first
|
|
10
|
+
* match wins; if nothing matches, compute the AI-fallback shape
|
|
11
|
+
* (functionName + inputs + resultVar) deterministically.
|
|
12
|
+
*
|
|
13
|
+
* Extracted from prisma/step-conventions.ts and mongodb-native/step-conventions.ts
|
|
14
|
+
* so future ORM libraries can drop in just the conventions array
|
|
15
|
+
* without re-implementing matching logic. (#43K-D)
|
|
16
|
+
*/
|
|
17
|
+
/** Camel-case a step's text into a TS identifier. Identical algorithm
|
|
18
|
+
* across all ORM libraries — function names emitted in `aiBehaviors.<X>(...)`
|
|
19
|
+
* calls must agree with the function declarations the AI-behaviors-generator
|
|
20
|
+
* emits. Both sides go through this. */
|
|
21
|
+
export declare function toMethod(words: string): string;
|
|
22
|
+
export declare function toVar(name: string): string;
|
|
23
|
+
export type { SharedStepContext, SharedConvention, MatchResult, MatcherFn, } from '@specverse/types';
|
|
24
|
+
import type { SharedStepContext, SharedConvention, MatchResult } from '@specverse/types';
|
|
25
|
+
export interface StepMatchRecord {
|
|
26
|
+
ownerName: string;
|
|
27
|
+
actionName: string;
|
|
28
|
+
stepOrdinal: number;
|
|
29
|
+
stepText: string;
|
|
30
|
+
matched: boolean;
|
|
31
|
+
helperMethod?: string;
|
|
32
|
+
aiFunctionName?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function setStepMatchRecorder(fn: ((r: StepMatchRecord) => void) | null): void;
|
|
35
|
+
/** Walk conventions in order. First match wins (with empty-string fallthrough).
|
|
36
|
+
* Unmatched: compute the AI-delegate call site shape so the controller and
|
|
37
|
+
* the AI-behaviors-generator agree on function name + inputs + resultVar. */
|
|
38
|
+
export declare function matchAgainstConventions<C extends SharedStepContext>(step: string, ctx: C, conventions: ReadonlyArray<SharedConvention<C>>, aiArgsExpr: (inputs: string[], paramNames: string[]) => string): MatchResult;
|
|
39
|
+
//# sourceMappingURL=step-matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-matching.d.ts","sourceRoot":"","sources":["step-matching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;wCAGwC;AACxC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9C;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;AAMD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWzF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAEpF;AAED;;6EAE6E;AAC7E,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,EACjE,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,EACN,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAC/C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,MAAM,GAC7D,WAAW,CAsDb"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared step-matching machinery — common helpers + the canonical
|
|
3
|
+
* `matchAgainstConventions` walker that any ORM-specific step-conventions
|
|
4
|
+
* library can compose with.
|
|
5
|
+
*
|
|
6
|
+
* Each ORM library (prisma, mongodb-native) exports its own
|
|
7
|
+
* `STEP_CONVENTIONS` array of `{name, pattern, generateCall}` items
|
|
8
|
+
* describing what code to emit for matched patterns. The matcher itself
|
|
9
|
+
* is identical across libraries: walk the conventions in order, first
|
|
10
|
+
* match wins; if nothing matches, compute the AI-fallback shape
|
|
11
|
+
* (functionName + inputs + resultVar) deterministically.
|
|
12
|
+
*
|
|
13
|
+
* Extracted from prisma/step-conventions.ts and mongodb-native/step-conventions.ts
|
|
14
|
+
* so future ORM libraries can drop in just the conventions array
|
|
15
|
+
* without re-implementing matching logic. (#43K-D)
|
|
16
|
+
*/
|
|
17
|
+
/** Camel-case a step's text into a TS identifier. Identical algorithm
|
|
18
|
+
* across all ORM libraries — function names emitted in `aiBehaviors.<X>(...)`
|
|
19
|
+
* calls must agree with the function declarations the AI-behaviors-generator
|
|
20
|
+
* emits. Both sides go through this. */
|
|
21
|
+
export function toMethod(words) {
|
|
22
|
+
const cleaned = words.trim().replace(/[^A-Za-z0-9\s]+/g, ' ');
|
|
23
|
+
const camel = cleaned.replace(/\s+(.)/g, (_, c) => c.toUpperCase()).replace(/^\w/, (c) => c.toLowerCase());
|
|
24
|
+
const safe = camel.replace(/[^A-Za-z0-9_$]/g, '');
|
|
25
|
+
return safe || 'unnamedStep';
|
|
26
|
+
}
|
|
27
|
+
export function toVar(name) {
|
|
28
|
+
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
29
|
+
}
|
|
30
|
+
let _stepRecorder = null;
|
|
31
|
+
export function setStepMatchRecorder(fn) {
|
|
32
|
+
_stepRecorder = fn;
|
|
33
|
+
}
|
|
34
|
+
/** Walk conventions in order. First match wins (with empty-string fallthrough).
|
|
35
|
+
* Unmatched: compute the AI-delegate call site shape so the controller and
|
|
36
|
+
* the AI-behaviors-generator agree on function name + inputs + resultVar. */
|
|
37
|
+
export function matchAgainstConventions(step, ctx, conventions, aiArgsExpr) {
|
|
38
|
+
let result = null;
|
|
39
|
+
for (const convention of conventions) {
|
|
40
|
+
const m = step.match(convention.pattern);
|
|
41
|
+
if (m) {
|
|
42
|
+
const call = convention.generateCall(m, ctx);
|
|
43
|
+
if (call) {
|
|
44
|
+
result = {
|
|
45
|
+
matched: true,
|
|
46
|
+
call,
|
|
47
|
+
helperMethod: convention.generateMethod?.(m, ctx),
|
|
48
|
+
};
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (!result) {
|
|
54
|
+
// AI fallback shape — same across all ORMs.
|
|
55
|
+
const functionName = toMethod(step);
|
|
56
|
+
const declared = Array.from(ctx.declaredVars || []);
|
|
57
|
+
const paramNames = ctx.parameterNames || [];
|
|
58
|
+
const inputs = [...paramNames, ...declared];
|
|
59
|
+
const resultVar = ctx.resultName || `step${ctx.stepNum}Result`;
|
|
60
|
+
if (ctx.declaredVars)
|
|
61
|
+
ctx.declaredVars.add(resultVar);
|
|
62
|
+
const inputObj = aiArgsExpr(inputs, paramNames);
|
|
63
|
+
result = {
|
|
64
|
+
matched: false,
|
|
65
|
+
call: ` // Step ${ctx.stepNum}: ${step} [AI-generated — pure transform]
|
|
66
|
+
const ${resultVar} = await aiBehaviors.${functionName}(${inputObj});`,
|
|
67
|
+
functionName,
|
|
68
|
+
inputs,
|
|
69
|
+
resultVar,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Forward-log the decision. ctx.serviceName carries the spec owner
|
|
73
|
+
// (controller or service — the shared context uses one field for both).
|
|
74
|
+
if (_stepRecorder) {
|
|
75
|
+
try {
|
|
76
|
+
_stepRecorder({
|
|
77
|
+
ownerName: ctx.serviceName,
|
|
78
|
+
actionName: ctx.operationName,
|
|
79
|
+
stepOrdinal: ctx.stepNum,
|
|
80
|
+
stepText: step,
|
|
81
|
+
matched: result.matched,
|
|
82
|
+
helperMethod: result.helperMethod,
|
|
83
|
+
aiFunctionName: result.functionName,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
catch { /* recorder must never break generation */ }
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=step-matching.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-matching.js","sourceRoot":"","sources":["step-matching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;wCAGwC;AACxC,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EA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