@sensigo/realm-cli 0.12.0 → 0.13.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.
- package/dist/agent/run-attach.d.ts +24 -0
- package/dist/agent/run-attach.d.ts.map +1 -0
- package/dist/agent/run-attach.js +77 -0
- package/dist/agent/run-attach.js.map +1 -0
- package/dist/commands/agent.d.ts +13 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +38 -8
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +42 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/inspect.d.ts +1 -0
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +93 -1
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/listen.d.ts +11 -0
- package/dist/commands/listen.d.ts.map +1 -1
- package/dist/commands/listen.js +36 -1
- package/dist/commands/listen.js.map +1 -1
- package/dist/commands/mcp.d.ts +2 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +12 -5
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/register.d.ts +6 -0
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +20 -1
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +12 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/serve.d.ts +6 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +17 -4
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +25 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +53 -8
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +6 -1
- package/dist/commands/watch.js.map +1 -1
- package/dist/extensions/extension-identity.d.ts +63 -0
- package/dist/extensions/extension-identity.d.ts.map +1 -0
- package/dist/extensions/extension-identity.js +218 -0
- package/dist/extensions/extension-identity.js.map +1 -0
- package/dist/extensions/load-project-extensions.d.ts +36 -0
- package/dist/extensions/load-project-extensions.d.ts.map +1 -0
- package/dist/extensions/load-project-extensions.js +358 -0
- package/dist/extensions/load-project-extensions.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
// load-project-extensions.ts — the ONE loader for workflow-declared project extension modules.
|
|
2
|
+
//
|
|
3
|
+
// Every step-executing or config-validating CLI entry point (run, agent, listen, serve, mcp,
|
|
4
|
+
// test, validate, register, watch) resolves extensions through this function. Core resolves and
|
|
5
|
+
// stores PATHS only (source_dir / trust_root / declared relative paths on the definition) — the
|
|
6
|
+
// dynamic import lives here, in the CLI composition layer.
|
|
7
|
+
//
|
|
8
|
+
// Trust model: extension module paths originate ONLY from operator-registered workflow
|
|
9
|
+
// definitions or from the operator-typed --extensions-module flag — never from request data.
|
|
10
|
+
// Declared paths resolve against the definition's source_dir and must realpath-contain within
|
|
11
|
+
// its trust_root (nearest package.json/.git ancestor, derived at registration time).
|
|
12
|
+
import { createRequire } from 'node:module';
|
|
13
|
+
import { realpathSync } from 'node:fs';
|
|
14
|
+
import { resolve, sep } from 'node:path';
|
|
15
|
+
import { pathToFileURL } from 'node:url';
|
|
16
|
+
import { createDefaultRegistry } from '@sensigo/realm';
|
|
17
|
+
import { computeExtensionIdentity, errorExtensionIdentityEntry } from './extension-identity.js';
|
|
18
|
+
/** Registration surfaces of a declarative extension module, keyed by export map name. */
|
|
19
|
+
const EXTENSION_SURFACES = [
|
|
20
|
+
{ mapKey: 'adapters', type: 'adapter', probeMembers: ['fetch', 'create', 'update'] },
|
|
21
|
+
{ mapKey: 'handlers', type: 'handler', probeMembers: ['execute'] },
|
|
22
|
+
{ mapKey: 'processors', type: 'processor', probeMembers: ['process'] },
|
|
23
|
+
];
|
|
24
|
+
const DEFAULT_REGISTRY_CACHE_KEY = '\u0000default-registry\u0000';
|
|
25
|
+
// Process-lifetime cache keyed by the ORDERED list of resolved module paths (plus a sentinel
|
|
26
|
+
// for the extension-less default registry). Restart-required semantics: module CONTENT changes
|
|
27
|
+
// in long-lived processes (listen parent, serve, mcp) need a process restart — there is no
|
|
28
|
+
// cache-busting re-import (ESM module cache would defeat it anyway).
|
|
29
|
+
const cache = new Map();
|
|
30
|
+
/** @internal Test-only: clears the process-lifetime registry cache. */
|
|
31
|
+
export function clearProjectExtensionsCache() {
|
|
32
|
+
cache.clear();
|
|
33
|
+
}
|
|
34
|
+
function emptyManifest() {
|
|
35
|
+
return { modules: [], adapters: [], handlers: [], processors: [] };
|
|
36
|
+
}
|
|
37
|
+
function errMsg(err) {
|
|
38
|
+
return err instanceof Error ? err.message : String(err);
|
|
39
|
+
}
|
|
40
|
+
function realpathOrFail(path, what) {
|
|
41
|
+
try {
|
|
42
|
+
return realpathSync(path);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
throw new Error(`Cannot resolve ${what}: ${errMsg(err)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** True when `child` is `root` or lives underneath it (both must be realpaths). */
|
|
49
|
+
function isContainedIn(child, root) {
|
|
50
|
+
return child === root || child.startsWith(root + sep);
|
|
51
|
+
}
|
|
52
|
+
function normalizeDeclared(extensions) {
|
|
53
|
+
if (extensions === undefined)
|
|
54
|
+
return undefined;
|
|
55
|
+
return typeof extensions === 'string' ? [extensions] : extensions;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Loads the project extension modules declared by a workflow definition (or an operator
|
|
59
|
+
* override) and returns a registry (defaults + extensions applied) plus a manifest of what
|
|
60
|
+
* was loaded. No `extensions` on the definition and no override → `createDefaultRegistry()`
|
|
61
|
+
* plus an empty manifest — the byte-identical fallback, cached process-wide.
|
|
62
|
+
*
|
|
63
|
+
* Precedence: defaults < legacy env-gated built-ins (applied by `realm agent`, see agent.ts)
|
|
64
|
+
* < declared extensions < --extensions-module override.
|
|
65
|
+
*
|
|
66
|
+
* CONTRACT: returned registries are shared process-lifetime cache entries. The only
|
|
67
|
+
* permitted mutation is `getOrCreateRateLimiter` (serve bucket persistence, by design);
|
|
68
|
+
* any tier composition on top requires `ExtensionRegistry.clone()`.
|
|
69
|
+
*/
|
|
70
|
+
export async function loadProjectExtensions(definition, opts) {
|
|
71
|
+
const moduleRefs = resolveModuleRefs(definition, opts?.overrideModule);
|
|
72
|
+
if (moduleRefs === undefined) {
|
|
73
|
+
// Extension-free fallback: byte-identical default registry, process-lifetime cached
|
|
74
|
+
// (the sentinel keeps rate-limiter buckets stable across requests in serve/mcp too).
|
|
75
|
+
let entry = cache.get(DEFAULT_REGISTRY_CACHE_KEY);
|
|
76
|
+
if (entry === undefined) {
|
|
77
|
+
entry = { registry: createDefaultRegistry(), manifest: emptyManifest() };
|
|
78
|
+
cache.set(DEFAULT_REGISTRY_CACHE_KEY, entry);
|
|
79
|
+
}
|
|
80
|
+
return entry;
|
|
81
|
+
}
|
|
82
|
+
const cacheKey = moduleRefs.map((m) => m.resolved).join('\n');
|
|
83
|
+
const cached = cache.get(cacheKey);
|
|
84
|
+
if (cached !== undefined)
|
|
85
|
+
return cached;
|
|
86
|
+
const registry = createDefaultRegistry();
|
|
87
|
+
const builtinNames = {
|
|
88
|
+
adapter: new Set(registry.names('adapter')),
|
|
89
|
+
handler: new Set(registry.names('handler')),
|
|
90
|
+
processor: new Set(registry.names('processor')),
|
|
91
|
+
};
|
|
92
|
+
// `${type}:${name}` → declared path of the module that first claimed it.
|
|
93
|
+
const claimedBy = new Map();
|
|
94
|
+
const manifest = {
|
|
95
|
+
modules: moduleRefs,
|
|
96
|
+
adapters: [],
|
|
97
|
+
handlers: [],
|
|
98
|
+
processors: [],
|
|
99
|
+
};
|
|
100
|
+
const moduleFormats = new Map();
|
|
101
|
+
for (const ref of moduleRefs) {
|
|
102
|
+
const { exported, format } = await importExtensionModule(ref);
|
|
103
|
+
moduleFormats.set(ref.resolved, format);
|
|
104
|
+
applyModule(exported, ref, registry, builtinNames, claimedBy, manifest);
|
|
105
|
+
}
|
|
106
|
+
// Drift evidence (issue #119): capture the identity of the loaded code ONCE per cache
|
|
107
|
+
// entry, at module-LOAD time (what is actually in memory). Capture failure NEVER fails
|
|
108
|
+
// loading — an error entry is attached and logged instead. The extension-less sentinel
|
|
109
|
+
// above gets NO identity: extension-free runs record nothing.
|
|
110
|
+
const overrideActive = opts?.overrideModule !== undefined;
|
|
111
|
+
try {
|
|
112
|
+
registry.setIdentity(computeExtensionIdentity(moduleRefs.map((ref) => ({
|
|
113
|
+
declared: ref.declared,
|
|
114
|
+
resolved: ref.resolved,
|
|
115
|
+
format: moduleFormats.get(ref.resolved) ?? 'esm',
|
|
116
|
+
})), {
|
|
117
|
+
...(definition.trust_root !== undefined ? { trustRoot: definition.trust_root } : {}),
|
|
118
|
+
...(overrideActive ? { overrideActive: true } : {}),
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
console.error(`[realm] extension identity capture failed: ${errMsg(err)} — drift evidence will carry an error entry for this load.`);
|
|
123
|
+
registry.setIdentity(errorExtensionIdentityEntry(`identity capture failed: ${errMsg(err)}`, overrideActive ? { overrideActive: true } : {}));
|
|
124
|
+
}
|
|
125
|
+
const result = { registry, manifest };
|
|
126
|
+
cache.set(cacheKey, result);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Resolves the list of modules to load. Returns undefined for the extension-free fallback.
|
|
131
|
+
* Enforces the trust model for declared modules: agent-origin refusal, re-register guidance
|
|
132
|
+
* when resolution metadata is missing, and realpath containment within trust_root.
|
|
133
|
+
*/
|
|
134
|
+
function resolveModuleRefs(definition, overrideModule) {
|
|
135
|
+
if (overrideModule !== undefined) {
|
|
136
|
+
const resolved = resolve(overrideModule);
|
|
137
|
+
const real = realpathOrFail(resolved, `--extensions-module '${overrideModule}'`);
|
|
138
|
+
// Loud by design: the override replaces whatever the workflow declared.
|
|
139
|
+
console.warn(`[realm] --extensions-module override active: loading '${overrideModule}' (resolved: ${real}). ` +
|
|
140
|
+
`Declared workflow extensions are IGNORED.`);
|
|
141
|
+
return [{ declared: overrideModule, resolved: real }];
|
|
142
|
+
}
|
|
143
|
+
const declared = normalizeDeclared(definition.extensions);
|
|
144
|
+
if (declared === undefined || declared.length === 0)
|
|
145
|
+
return undefined;
|
|
146
|
+
if (definition.origin === 'agent') {
|
|
147
|
+
throw new Error(`Workflow '${definition.id}' was created by an agent (origin: 'agent') but declares 'extensions' — ` +
|
|
148
|
+
`refusing to load extension code. Extensions are register-time and operator-only: ` +
|
|
149
|
+
`register the workflow from its YAML file with 'realm workflow register <path>'.`);
|
|
150
|
+
}
|
|
151
|
+
if (definition.source_dir === undefined || definition.trust_root === undefined) {
|
|
152
|
+
throw new Error(`Workflow '${definition.id}' declares 'extensions' but its stored definition carries no ` +
|
|
153
|
+
`source_dir/trust_root resolution metadata (registered by an older Realm version). ` +
|
|
154
|
+
`Re-register this workflow: realm workflow register <path-to-workflow>`);
|
|
155
|
+
}
|
|
156
|
+
const trustRootReal = realpathOrFail(definition.trust_root, `trust_root '${definition.trust_root}' of workflow '${definition.id}'`);
|
|
157
|
+
return declared.map((declaredPath) => {
|
|
158
|
+
const resolved = resolve(definition.source_dir, declaredPath);
|
|
159
|
+
const real = realpathOrFail(resolved, `extension module '${declaredPath}' of workflow '${definition.id}' (resolved: ${resolved})`);
|
|
160
|
+
if (!isContainedIn(real, trustRootReal)) {
|
|
161
|
+
throw new Error(`Extension module '${declaredPath}' resolves to '${real}', which is OUTSIDE the ` +
|
|
162
|
+
`workflow's trust root '${trustRootReal}'. Extension modules must live within the ` +
|
|
163
|
+
`project containing the workflow (nearest package.json/.git ancestor of the workflow ` +
|
|
164
|
+
`directory). Move the module inside the project, or re-register the workflow from ` +
|
|
165
|
+
`its real location.`);
|
|
166
|
+
}
|
|
167
|
+
return { declared: declaredPath, resolved: real };
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Imports one extension module (jiti-bridged for TypeScript paths) and returns its default
|
|
172
|
+
* export plus the load format (descriptive metadata for the drift-evidence identity record:
|
|
173
|
+
* ts-jiti for TypeScript paths, cjs for .cjs / detected CJS-interop wrappers, esm otherwise).
|
|
174
|
+
*/
|
|
175
|
+
async function importExtensionModule(ref) {
|
|
176
|
+
const isTypescript = /\.(ts|mts|cts)$/.test(ref.resolved);
|
|
177
|
+
let mod;
|
|
178
|
+
if (isTypescript) {
|
|
179
|
+
mod = await importViaJiti(ref);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
try {
|
|
183
|
+
mod = (await import(pathToFileURL(ref.resolved).href));
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
throw new Error(`Failed to import extension module '${ref.declared}' (${ref.resolved}): ${errMsg(err)}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
let format = isTypescript
|
|
190
|
+
? 'ts-jiti'
|
|
191
|
+
: ref.resolved.endsWith('.cjs')
|
|
192
|
+
? 'cjs'
|
|
193
|
+
: 'esm';
|
|
194
|
+
let exported = mod['default'];
|
|
195
|
+
// CJS-ESM interop: `import()` of a tsc-CommonJS build ("type" not "module") yields
|
|
196
|
+
// namespace.default = module.exports = { __esModule: true, default: <manifest> }.
|
|
197
|
+
// Unwrap that wrapper so CJS consumers get the same contract as ESM ones.
|
|
198
|
+
if (typeof exported === 'object' &&
|
|
199
|
+
exported !== null &&
|
|
200
|
+
exported['__esModule'] === true &&
|
|
201
|
+
'default' in exported) {
|
|
202
|
+
exported = exported['default'];
|
|
203
|
+
if (!isTypescript)
|
|
204
|
+
format = 'cjs';
|
|
205
|
+
}
|
|
206
|
+
if (exported === undefined) {
|
|
207
|
+
throw new Error(`Extension module '${ref.declared}' has no default export — export a declarative object: ` +
|
|
208
|
+
`export default { adapters: { name: instance }, handlers: { ... }, processors: { ... } }`);
|
|
209
|
+
}
|
|
210
|
+
return { exported, format };
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* TypeScript modules load through jiti resolved from the MODULE'S OWN directory (the consumer
|
|
214
|
+
* project's node_modules) — never from the CLI install (npx/global installs carry no jiti).
|
|
215
|
+
* Compiled JS is the documented default; jiti is a consumer-side optional peer.
|
|
216
|
+
*/
|
|
217
|
+
async function importViaJiti(ref) {
|
|
218
|
+
const requireFromModule = createRequire(ref.resolved);
|
|
219
|
+
let jitiPath;
|
|
220
|
+
try {
|
|
221
|
+
jitiPath = requireFromModule.resolve('jiti');
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
throw new Error(`Extension module '${ref.declared}' (${ref.resolved}) is TypeScript, but 'jiti' is not ` +
|
|
225
|
+
`installed in your project. Install jiti in your project (npm install --save-dev jiti), ` +
|
|
226
|
+
`or compile the module to JS and declare the compiled path.`);
|
|
227
|
+
}
|
|
228
|
+
let jitiModule;
|
|
229
|
+
try {
|
|
230
|
+
jitiModule = (await import(pathToFileURL(jitiPath).href));
|
|
231
|
+
}
|
|
232
|
+
catch (err) {
|
|
233
|
+
throw new Error(`Failed to load 'jiti' from '${jitiPath}': ${errMsg(err)}`);
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
// jiti v2: createJiti(parentPath).import(path) → module namespace.
|
|
237
|
+
const createJiti = jitiModule['createJiti'];
|
|
238
|
+
if (typeof createJiti === 'function') {
|
|
239
|
+
const jiti = createJiti(ref.resolved);
|
|
240
|
+
return (await jiti.import(ref.resolved));
|
|
241
|
+
}
|
|
242
|
+
// jiti v1: default export is a factory returning a require-like function.
|
|
243
|
+
const factory = jitiModule['default'];
|
|
244
|
+
if (typeof factory === 'function') {
|
|
245
|
+
const jitiRequire = factory(ref.resolved, { interopDefault: false });
|
|
246
|
+
const required = jitiRequire(ref.resolved);
|
|
247
|
+
if (typeof required === 'object' && required !== null && 'default' in required) {
|
|
248
|
+
return required;
|
|
249
|
+
}
|
|
250
|
+
return { default: required };
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
throw new Error(`Failed to import TypeScript extension module '${ref.declared}' via jiti: ${errMsg(err)}`);
|
|
255
|
+
}
|
|
256
|
+
throw new Error(`Unrecognized 'jiti' package shape at '${jitiPath}' — upgrade jiti in your project, or ` +
|
|
257
|
+
`compile the extension module to JS.`);
|
|
258
|
+
}
|
|
259
|
+
/** Reads a property defensively — a throwing getter becomes a clean validation error. */
|
|
260
|
+
function safeGet(obj, key, context) {
|
|
261
|
+
try {
|
|
262
|
+
return obj[key];
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
throw new Error(`${context}: reading '${key}' threw: ${errMsg(err)}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Duck-validates and applies one module's declarative default export onto the registry.
|
|
270
|
+
* Collision policy: overriding a BUILT-IN name → WARN and allow; the same name claimed twice
|
|
271
|
+
* across declared modules → ERROR. Registration name = map key (a differing instance `id` WARNs).
|
|
272
|
+
*/
|
|
273
|
+
function applyModule(exported, ref, registry, builtinNames, claimedBy, manifest) {
|
|
274
|
+
const context = `Extension module '${ref.declared}'`;
|
|
275
|
+
if (typeof exported !== 'object' || exported === null || Array.isArray(exported)) {
|
|
276
|
+
throw new Error(`${context}: default export must be a plain object ({ adapters?, handlers?, processors? }), ` +
|
|
277
|
+
`got ${Array.isArray(exported) ? 'array' : typeof exported}.`);
|
|
278
|
+
}
|
|
279
|
+
// Reject registry-instance-like exports: the contract is declarative maps, not a registry.
|
|
280
|
+
if (typeof safeGet(exported, 'register', context) === 'function' ||
|
|
281
|
+
typeof safeGet(exported, 'getAdapter', context) === 'function') {
|
|
282
|
+
throw new Error(`${context}: default export looks like an ExtensionRegistry instance. Export a declarative ` +
|
|
283
|
+
`object instead: export default { adapters: { name: instance }, handlers: { ... }, ` +
|
|
284
|
+
`processors: { ... } }`);
|
|
285
|
+
}
|
|
286
|
+
const allowedKeys = new Set(EXTENSION_SURFACES.map((s) => s.mapKey));
|
|
287
|
+
for (const key of Object.keys(exported)) {
|
|
288
|
+
if (!allowedKeys.has(key)) {
|
|
289
|
+
throw new Error(`${context}: unknown key '${key}' in default export — allowed keys are ` +
|
|
290
|
+
`'adapters', 'handlers', 'processors'.`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
for (const surface of EXTENSION_SURFACES) {
|
|
294
|
+
const map = safeGet(exported, surface.mapKey, context);
|
|
295
|
+
if (map === undefined)
|
|
296
|
+
continue;
|
|
297
|
+
if (typeof map !== 'object' || map === null || Array.isArray(map)) {
|
|
298
|
+
throw new Error(`${context}: '${surface.mapKey}' must be an object map of name → instance, got ` +
|
|
299
|
+
`${Array.isArray(map) ? 'array' : typeof map}.`);
|
|
300
|
+
}
|
|
301
|
+
for (const name of Object.keys(map)) {
|
|
302
|
+
const impl = safeGet(map, name, `${context}, ${surface.type} '${name}'`);
|
|
303
|
+
probeShape(impl, surface.type, surface.probeMembers, name, ref);
|
|
304
|
+
warnOnIdMismatch(impl, surface.type, name, ref);
|
|
305
|
+
const claimKey = `${surface.type}:${name}`;
|
|
306
|
+
const previousClaim = claimedBy.get(claimKey);
|
|
307
|
+
if (previousClaim !== undefined) {
|
|
308
|
+
throw new Error(`Extension ${surface.type} '${name}' is declared by both '${previousClaim}' and ` +
|
|
309
|
+
`'${ref.declared}' — extension names must be unique across declared modules.`);
|
|
310
|
+
}
|
|
311
|
+
claimedBy.set(claimKey, ref.declared);
|
|
312
|
+
if (builtinNames[surface.type].has(name)) {
|
|
313
|
+
console.warn(`[realm] extension ${surface.type} '${name}' from '${ref.declared}' overrides the ` +
|
|
314
|
+
`built-in ${surface.type} '${name}'.`);
|
|
315
|
+
}
|
|
316
|
+
// Safe: probeShape validated the minimal distinguishing members of each interface.
|
|
317
|
+
registry.register(surface.type, name, impl);
|
|
318
|
+
manifest[surface.mapKey].push(name);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/** Probes the minimal distinguishing members of the extension interface — no instanceof. */
|
|
323
|
+
function probeShape(impl, type, members, name, ref) {
|
|
324
|
+
const context = `Extension ${type} '${name}' in '${ref.declared}'`;
|
|
325
|
+
if (typeof impl !== 'object' || impl === null) {
|
|
326
|
+
throw new Error(`${context}: expected an object instance, got ${impl === null ? 'null' : typeof impl}.`);
|
|
327
|
+
}
|
|
328
|
+
for (const member of members) {
|
|
329
|
+
const value = safeGet(impl, member, context);
|
|
330
|
+
if (typeof value !== 'function') {
|
|
331
|
+
throw new Error(`${context}: missing callable '${member}' — ${type}s must implement ` +
|
|
332
|
+
`${members.map((m) => `'${m}'`).join('/')} per the @sensigo/realm ${type === 'adapter' ? 'ServiceAdapter' : type === 'handler' ? 'StepHandler' : 'Processor'} interface.`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/** Registration name = map key; a differing instance `id` is evidence worth surfacing. */
|
|
337
|
+
function warnOnIdMismatch(impl, type, name, ref) {
|
|
338
|
+
let id;
|
|
339
|
+
try {
|
|
340
|
+
id = impl['id'];
|
|
341
|
+
}
|
|
342
|
+
catch {
|
|
343
|
+
return; // a throwing id getter is not worth failing the load over — probe already passed
|
|
344
|
+
}
|
|
345
|
+
if (typeof id === 'string' && id !== name) {
|
|
346
|
+
console.warn(`[realm] extension ${type} registered as '${name}' (map key) but its instance id is ` +
|
|
347
|
+
`'${id}' (module '${ref.declared}'). The registration name is the map key.`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Builds a `registryProvider` for the MCP server (serve / mcp stdio): resolves each
|
|
352
|
+
* definition's extensions through the process-lifetime loader cache. An operator override
|
|
353
|
+
* replaces declared modules for EVERY definition served by this process.
|
|
354
|
+
*/
|
|
355
|
+
export function makeRegistryProvider(overrideModule) {
|
|
356
|
+
return async (definition) => (await loadProjectExtensions(definition, overrideModule !== undefined ? { overrideModule } : {})).registry;
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=load-project-extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-project-extensions.js","sourceRoot":"","sources":["../../src/extensions/load-project-extensions.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,EAAE;AACF,6FAA6F;AAC7F,gGAAgG;AAChG,gGAAgG;AAChG,2DAA2D;AAC3D,EAAE;AACF,uFAAuF;AACvF,6FAA6F;AAC7F,8FAA8F;AAC9F,qFAAqF;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAqB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAehG,yFAAyF;AACzF,MAAM,kBAAkB,GAAG;IACzB,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE;IACpF,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE;IAClE,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE;CAC9D,CAAC;AAEX,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AAElE,6FAA6F;AAC7F,+FAA+F;AAC/F,2FAA2F;AAC3F,qEAAqE;AACrE,MAAM,KAAK,GAAG,IAAI,GAAG,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AAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CACvD,CACF,CAAC,QAAQ,CAAC;AACf,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import 'dotenv/config';
|
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { workflowCommands, runCommands, topLevelCommands } from './commands-registry.js';
|
|
6
6
|
const program = new Command();
|
|
7
|
-
program.name('realm').description('Realm workflow engine CLI').version('0.
|
|
7
|
+
program.name('realm').description('Realm workflow engine CLI').version('0.13.0');
|
|
8
8
|
// realm workflow — operations on workflow definitions
|
|
9
9
|
const workflowCmd = new Command('workflow').description('Manage workflow definitions');
|
|
10
10
|
for (const cmd of workflowCommands)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensigo/realm-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"vitest": "^4.1.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@sensigo/realm": "^0.
|
|
65
|
-
"@sensigo/realm-mcp": "^0.
|
|
66
|
-
"@sensigo/realm-testing": "^0.
|
|
64
|
+
"@sensigo/realm": "^0.13.0",
|
|
65
|
+
"@sensigo/realm-mcp": "^0.13.0",
|
|
66
|
+
"@sensigo/realm-testing": "^0.13.0",
|
|
67
67
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
68
68
|
"chalk": "^5.0.0",
|
|
69
69
|
"commander": "^14.0.3",
|