@adhd/apigen-engine-runtime 0.2.3 → 0.2.4
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 +25 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +682 -509
- package/lib/describe-params.d.ts +12 -1
- package/lib/op-plan.d.ts +7 -0
- package/lib/package-invoker.d.ts +17 -0
- package/package.json +25 -5
package/lib/describe-params.d.ts
CHANGED
|
@@ -4,11 +4,22 @@ export interface ParamInfo {
|
|
|
4
4
|
required: boolean;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Extract a composed schema entry's domain parameters for logging
|
|
7
|
+
* Extract a composed schema entry's domain parameters for logging AND for a
|
|
8
|
+
* per-command `--help` rendering.
|
|
8
9
|
*
|
|
9
10
|
* Params live under `input.properties.data.properties` — the `data` envelope
|
|
10
11
|
* wrapper is always present (see [def:ComposedSchemas]). Returns both a
|
|
11
12
|
* structured list (for JSON logs) and a `name?: type` summary string.
|
|
13
|
+
*
|
|
14
|
+
* Every TOP-LEVEL param's type is expanded one level deep — an integer `depth`
|
|
15
|
+
* budget of 2 is passed to `typeName` (see its doc comment for the exact
|
|
16
|
+
* contract) — so an `object` with declared `properties` renders its fields and
|
|
17
|
+
* a `oneOf`/`anyOf` union renders its member shapes, e.g. `update`'s single
|
|
18
|
+
* `input` param renders as `input: { repo: string, humanId: string, patch:
|
|
19
|
+
* object, by: string }` instead of the placebo `input: object` that told a
|
|
20
|
+
* reader nothing about what the command actually accepts (the surviving half of
|
|
21
|
+
* FEAT-BACKLOG-003 / the `--help` finding in P5-cli-serve-transport). Nested
|
|
22
|
+
* unions/objects collapse to their placeholders, keeping the render bounded.
|
|
12
23
|
*/
|
|
13
24
|
export declare function describeParams(schema: {
|
|
14
25
|
input?: unknown;
|
package/lib/op-plan.d.ts
CHANGED
|
@@ -30,6 +30,13 @@ export interface OpPlanCliFlag {
|
|
|
30
30
|
valueKind: 'boolean' | 'json' | 'string';
|
|
31
31
|
/** (envelope only) `APIGEN_<PLUGINID>_<FIELD>` fallback when the flag is absent. */
|
|
32
32
|
envVar?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Set ONLY on a camelCase alias entry, naming the canonical kebab-case key it
|
|
35
|
+
* resolves to (BUG-BACKLOG-CLI-FLAG-CASE-MISMATCH-001). Transports must
|
|
36
|
+
* exclude aliased entries when LISTING available flags — kebab-case remains
|
|
37
|
+
* the single advertised spelling — while still accepting them on input.
|
|
38
|
+
*/
|
|
39
|
+
aliasOf?: string;
|
|
33
40
|
}
|
|
34
41
|
/**
|
|
35
42
|
* A fully-resolved, transport-complete plan for one `Operation` (proposal §3a).
|
package/lib/package-invoker.d.ts
CHANGED
|
@@ -47,6 +47,23 @@ export type UseOptions = Record<string, Record<string, unknown>>;
|
|
|
47
47
|
* carries no dedicated field, so they ride on `options.usePlugins`).
|
|
48
48
|
*/
|
|
49
49
|
export declare function readUsePlugins(options: Record<string, unknown>): UsePlugin[];
|
|
50
|
+
/**
|
|
51
|
+
* Optional `options.exitCode` hook: maps a SUCCESSFULLY-RETURNED result to a
|
|
52
|
+
* process exit code.
|
|
53
|
+
*
|
|
54
|
+
* A host whose operations return a result-shaped outcome (`{ok:false, error}`)
|
|
55
|
+
* rather than throwing looks like unqualified success to a transport, so the
|
|
56
|
+
* CLI exits 0 on a reported failure — a caller's `&&` chain then proceeds and
|
|
57
|
+
* `set -e` never trips. This hook is the seam that lets such a host state its
|
|
58
|
+
* own mapping without apigen having to know the envelope shape.
|
|
59
|
+
*
|
|
60
|
+
* Opt-in and absent by default: a host that does not pass it keeps the
|
|
61
|
+
* existing "returned normally ⇒ exit 0" behaviour exactly.
|
|
62
|
+
*
|
|
63
|
+
* Thrown `ApiError`s are unaffected — those already map through
|
|
64
|
+
* `CLI_EXIT_CODE`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function readExitCodeHook(options: Record<string, unknown>): ((result: unknown) => number | undefined) | undefined;
|
|
50
67
|
export declare function readUseOptions(options: Record<string, unknown>): UseOptions;
|
|
51
68
|
/**
|
|
52
69
|
* Adapt a core `LayerCapability.layer` (which receives the SPEC §7.1 `Call`
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhd/apigen-engine-runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"ajv": "^8.20.0",
|
|
6
6
|
"ajv-formats": "2.1.1",
|
|
7
7
|
"pino": "10.3.1",
|
|
8
|
-
"@adhd/apigen-core-client": "^0.3.
|
|
9
|
-
"@adhd/apigen-base-logical": "^0.1.
|
|
10
|
-
"@adhd/apigen-base-errors": "^0.2.
|
|
11
|
-
"@adhd/apigen-engine-naming": "^0.2.
|
|
8
|
+
"@adhd/apigen-core-client": "^0.3.1",
|
|
9
|
+
"@adhd/apigen-base-logical": "^0.1.2",
|
|
10
|
+
"@adhd/apigen-base-errors": "^0.2.1",
|
|
11
|
+
"@adhd/apigen-engine-naming": "^0.2.3",
|
|
12
12
|
"better-sqlite3": "12.10.0"
|
|
13
13
|
},
|
|
14
14
|
"main": "./index.js",
|
|
@@ -16,5 +16,25 @@
|
|
|
16
16
|
"typings": "./index.d.ts",
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"description": "Runtime executor for apigen - dispatch derived operations with pluggable concurrency and transports",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"api",
|
|
23
|
+
"runtime",
|
|
24
|
+
"typescript",
|
|
25
|
+
"schema",
|
|
26
|
+
"dispatch",
|
|
27
|
+
"concurrency",
|
|
28
|
+
"codegen"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/PseudoSky/adhd.git",
|
|
34
|
+
"directory": "packages/apigen/apigen-engine-runtime"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/PseudoSky/adhd/tree/main/packages/apigen/apigen-engine-runtime#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/PseudoSky/adhd/issues"
|
|
19
39
|
}
|
|
20
40
|
}
|