apcore-cli 0.9.1 → 0.10.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/CHANGELOG.md +24 -0
- package/dist/bin/apcore-cli.js +1606 -1579
- package/dist/bin/apcore-cli.js.map +1 -1
- package/dist/index.d.ts +43 -10
- package/dist/index.js +2268 -2251
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
package/dist/index.d.ts
CHANGED
|
@@ -195,10 +195,20 @@ declare class ApcliGroup {
|
|
|
195
195
|
* Protocol spec: CLI command structure & lazy loading
|
|
196
196
|
*/
|
|
197
197
|
|
|
198
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* CLI-internal Registry shim. Method names align with apcore-js >= 0.22.0
|
|
200
|
+
* (Registry.list() / Registry.getDefinition()). Embedders may pass an
|
|
201
|
+
* apcore-js `Registry` instance directly — no adapter required.
|
|
202
|
+
*
|
|
203
|
+
* The required surface is intentionally the apcore-js surface (no batch
|
|
204
|
+
* `listModules()`); use the {@link listAllDefinitions} helper to iterate
|
|
205
|
+
* all descriptors.
|
|
206
|
+
*/
|
|
199
207
|
interface Registry {
|
|
200
|
-
|
|
201
|
-
|
|
208
|
+
/** Enumerate module IDs. Aligned with apcore-js Registry.list(). */
|
|
209
|
+
list(): string[];
|
|
210
|
+
/** Resolve a module descriptor by ID. Aligned with apcore-js Registry.getDefinition(). */
|
|
211
|
+
getDefinition(moduleId: string): ModuleDescriptor | null;
|
|
202
212
|
}
|
|
203
213
|
/** Strategy info returned by Executor.describePipeline(). */
|
|
204
214
|
interface StrategyInfo {
|
|
@@ -214,9 +224,20 @@ interface StrategyStep {
|
|
|
214
224
|
removable: boolean;
|
|
215
225
|
timeoutMs?: number;
|
|
216
226
|
}
|
|
217
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* CLI-internal Executor shim. Method names align with apcore-js >= 0.22.0
|
|
229
|
+
* (Executor.call as the primary invocation method). Embedders may pass
|
|
230
|
+
* an apcore-js `Executor` instance directly — no adapter required.
|
|
231
|
+
*/
|
|
218
232
|
interface Executor {
|
|
219
|
-
|
|
233
|
+
/** Invoke a module. Aligned with apcore-js Executor.call(). */
|
|
234
|
+
call(moduleId: string, input: Record<string, unknown>): Promise<unknown>;
|
|
235
|
+
/**
|
|
236
|
+
* The executor's registry. Aligned with apcore-js `Executor.registry`.
|
|
237
|
+
* Used for synchronous availability probes (e.g. system-module gating)
|
|
238
|
+
* since `validate` is async and cannot be awaited during sync registration.
|
|
239
|
+
*/
|
|
240
|
+
registry?: Registry;
|
|
220
241
|
/** Validate inputs without executing. Returns a PreflightResult. */
|
|
221
242
|
validate?(moduleId: string, input: Record<string, unknown>): Promise<PreflightResult>;
|
|
222
243
|
/** Execute with pipeline trace. Returns [result, PipelineTrace]. */
|
|
@@ -225,8 +246,6 @@ interface Executor {
|
|
|
225
246
|
}): Promise<[unknown, PipelineTrace]>;
|
|
226
247
|
/** Stream execution — async iterator of chunks. */
|
|
227
248
|
stream?(moduleId: string, input: Record<string, unknown>): AsyncIterable<unknown>;
|
|
228
|
-
/** Call a module (synchronous-style, used by system commands). */
|
|
229
|
-
call?(moduleId: string, input: Record<string, unknown>): Promise<unknown>;
|
|
230
249
|
/**
|
|
231
250
|
* Describe the executor's currently-set strategy. Returns StrategyInfo
|
|
232
251
|
* (apcore-js >= 0.18.0). Takes no arguments — to introspect a different
|
|
@@ -267,10 +286,24 @@ interface PipelineTrace {
|
|
|
267
286
|
readonly success: boolean;
|
|
268
287
|
readonly steps: readonly PipelineTraceStep[];
|
|
269
288
|
}
|
|
270
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* CLI-internal ModuleDescriptor shim. Field names align with apcore-js
|
|
291
|
+
* >= 0.22.0 — embedders may pass apcore-js descriptors directly without
|
|
292
|
+
* field-level remapping. The interface is intentionally a structural
|
|
293
|
+
* subset of apcore-js's `ModuleDescriptor`: only fields actually consumed
|
|
294
|
+
* by the CLI are listed. apcore-js descriptors satisfy this shape
|
|
295
|
+
* trivially because every CLI-required field is also required there with
|
|
296
|
+
* the same name and a compatible type.
|
|
297
|
+
*
|
|
298
|
+
* Note: CLI JSON output (e.g. `apcli list --format json`) still emits the
|
|
299
|
+
* field as `id` for backward compatibility with downstream scripts —
|
|
300
|
+
* see `output.ts` for the moduleId → id mapping at the output boundary.
|
|
301
|
+
*/
|
|
271
302
|
interface ModuleDescriptor {
|
|
272
|
-
|
|
273
|
-
|
|
303
|
+
/** Module ID (`a.b.c` form). Aligned with apcore-js `ModuleDescriptor.moduleId`. */
|
|
304
|
+
moduleId: string;
|
|
305
|
+
/** Human-readable name. `null` when unset (matches apcore-js). */
|
|
306
|
+
name: string | null;
|
|
274
307
|
description: string;
|
|
275
308
|
tags?: string[];
|
|
276
309
|
inputSchema?: Record<string, unknown>;
|