@aid-framework/generator-sdk 0.0.0 → 0.1.39
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/LICENSE +201 -0
- package/README.md +171 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/aid-manifest.d.ts +71 -0
- package/dist/aid-manifest.d.ts.map +1 -0
- package/dist/aid-manifest.js +233 -0
- package/dist/aid-manifest.js.map +1 -0
- package/dist/determinism.d.ts +76 -0
- package/dist/determinism.d.ts.map +1 -0
- package/dist/determinism.js +142 -0
- package/dist/determinism.js.map +1 -0
- package/dist/diagnostics.d.ts +49 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +59 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/drift.d.ts +114 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +259 -0
- package/dist/drift.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +100 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +357 -0
- package/dist/manifest.js.map +1 -0
- package/dist/node-sink.d.ts +17 -0
- package/dist/node-sink.d.ts.map +1 -0
- package/dist/node-sink.js +62 -0
- package/dist/node-sink.js.map +1 -0
- package/dist/ownership.d.ts +50 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +90 -0
- package/dist/ownership.js.map +1 -0
- package/dist/plan.d.ts +51 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +132 -0
- package/dist/plan.js.map +1 -0
- package/dist/semver.d.ts +46 -0
- package/dist/semver.d.ts.map +1 -0
- package/dist/semver.js +264 -0
- package/dist/semver.js.map +1 -0
- package/dist/targets.d.ts +44 -0
- package/dist/targets.d.ts.map +1 -0
- package/dist/targets.js +88 -0
- package/dist/targets.js.map +1 -0
- package/package.json +43 -14
package/dist/targets.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Phase 0 target declarations, in the shape `@aid-framework/ir`'s capability gate consumes.
|
|
3
|
+
*
|
|
4
|
+
* `@aid-framework/ir` ships a placeholder (`PHASE_0_TARGET_CAPABILITIES`) precisely so the gate
|
|
5
|
+
* can exist before a real generator does; this module is the replacement. It matters
|
|
6
|
+
* that these are *declarations*, not aspirations: a target that claims `streaming`
|
|
7
|
+
* makes every spec requiring streaming pass the capability gate, so the list is the
|
|
8
|
+
* honest answer to "what does the code this generator emits actually do".
|
|
9
|
+
*
|
|
10
|
+
* Two facts are recorded here rather than hidden in prose:
|
|
11
|
+
*
|
|
12
|
+
* - `streaming` is declared since layer P7a. It was absent while both gateways raised
|
|
13
|
+
* `FeatureDeferredError`; the Python runtime now streams and the generator emits a
|
|
14
|
+
* route that negotiates `Accept: text/event-stream`, so the declaration is backed by
|
|
15
|
+
* an emitter, a runtime and a committed example. The TypeScript runtime still defers
|
|
16
|
+
* streaming (ratified to L6), which is why `@aid-framework/ir`'s derivation and this list are
|
|
17
|
+
* kept separate concerns.
|
|
18
|
+
* - `agents` and `cursor-memory` are declared since layer P7b, and they are two
|
|
19
|
+
* declarations rather than one because the IR derives two: `agents` from an `agents`
|
|
20
|
+
* collection, `cursor-memory` from a `memory` collection (there is no `memory`
|
|
21
|
+
* capability to declare). Both are backed by emitted code -- `generated/agents.py`
|
|
22
|
+
* builds the runtime over this app's own gateway and tools and serves the routes --
|
|
23
|
+
* and by the example's `tests/test_agents.py`, which pauses a run and resumes it. The
|
|
24
|
+
* TypeScript target declares neither, so `@aid-framework/ir` will route a spec that needs them
|
|
25
|
+
* to the Python target or refuse it.
|
|
26
|
+
* - the absence of `emitsAgainst.orchestration` — Phase 0 control flow is plain async,
|
|
27
|
+
* and orchestration frameworks are deferred to Phase 2. An agent loop is not an
|
|
28
|
+
* orchestration framework: the emitted `build_runtime` calls `AgentRuntime.from_ir`
|
|
29
|
+
* from the repo's own runtime and depends on nothing outside it.
|
|
30
|
+
*/
|
|
31
|
+
import { IR_VERSION } from '@aid-framework/ir';
|
|
32
|
+
import { formatDiagnostics } from '@aid-framework/spec';
|
|
33
|
+
import { parseManifest, targetCapabilityDeclarations, } from './manifest.js';
|
|
34
|
+
export const PY_FASTAPI_TARGET = 'py-fastapi';
|
|
35
|
+
/**
|
|
36
|
+
* The FastAPI + Pydantic target. `emitsAgainst` says the emitted code binds to
|
|
37
|
+
* Pydantic for structured output and OpenTelemetry GenAI for tracing, and to no
|
|
38
|
+
* orchestration framework at all.
|
|
39
|
+
*/
|
|
40
|
+
export const PY_FASTAPI_MANIFEST_INPUT = {
|
|
41
|
+
manifestVersion: 1,
|
|
42
|
+
name: '@aid-framework/generator-py-fastapi',
|
|
43
|
+
target: PY_FASTAPI_TARGET,
|
|
44
|
+
version: '0.1.0',
|
|
45
|
+
irRange: `^${IR_VERSION}`,
|
|
46
|
+
capabilities: [
|
|
47
|
+
'http-trigger',
|
|
48
|
+
'json-schema',
|
|
49
|
+
'streaming',
|
|
50
|
+
'tool-calling',
|
|
51
|
+
'otel',
|
|
52
|
+
'embeddings',
|
|
53
|
+
'rerank',
|
|
54
|
+
'guardrails',
|
|
55
|
+
'agents',
|
|
56
|
+
'cursor-memory',
|
|
57
|
+
],
|
|
58
|
+
emitsAgainst: {
|
|
59
|
+
structuredOutput: 'pydantic',
|
|
60
|
+
tracing: 'otel-genai',
|
|
61
|
+
},
|
|
62
|
+
output: {
|
|
63
|
+
root: 'app',
|
|
64
|
+
generatedDir: 'generated',
|
|
65
|
+
businessDir: 'business',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The generator set is validated at module load. A manifest that does not parse is a
|
|
70
|
+
* programming error in this package, not user input, so it throws rather than returning
|
|
71
|
+
* diagnostics no caller is in a position to act on.
|
|
72
|
+
*/
|
|
73
|
+
function requireValidManifest(label, input) {
|
|
74
|
+
const { manifest, diagnostics } = parseManifest(input);
|
|
75
|
+
if (manifest === undefined) {
|
|
76
|
+
throw new Error(`${label} is not a valid generator manifest:\n${formatDiagnostics(diagnostics)}`);
|
|
77
|
+
}
|
|
78
|
+
return manifest;
|
|
79
|
+
}
|
|
80
|
+
export const PY_FASTAPI_MANIFEST = requireValidManifest(PY_FASTAPI_MANIFEST_INPUT.name, PY_FASTAPI_MANIFEST_INPUT);
|
|
81
|
+
export function phase0Generators() {
|
|
82
|
+
return [PY_FASTAPI_MANIFEST];
|
|
83
|
+
}
|
|
84
|
+
/** Drop-in replacement for `@aid-framework/ir`'s `phase0TargetCapabilities()`. */
|
|
85
|
+
export function phase0TargetCapabilities() {
|
|
86
|
+
return targetCapabilityDeclarations(phase0Generators());
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.js","sourceRoot":"","sources":["../src/targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAqC,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAGL,aAAa,EACb,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAC/D,eAAe,EAAE,CAAC;IAClB,IAAI,EAAE,qCAAqC;IAC3C,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,IAAI,UAAU,EAAE;IACzB,YAAY,EAAE;QACZ,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;QACd,MAAM;QACN,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,QAAQ;QACR,eAAe;KAChB;IACD,YAAY,EAAE;QACZ,gBAAgB,EAAE,UAAU;QAC5B,OAAO,EAAE,YAAY;KACtB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,WAAW;QACzB,WAAW,EAAE,UAAU;KACxB;CACF,CAAC;AAEF;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,KAAa,EAAE,KAA6B;IACxE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,wCAAwC,iBAAiB,CAAC,WAAW,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAsB,oBAAoB,CACxE,yBAAyB,CAAC,IAAI,EAC9B,yBAAyB,CAC1B,CAAC;AAEF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC/B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,wBAAwB;IACtC,OAAO,4BAA4B,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@aid-framework/generator-sdk",
|
|
3
|
+
"version": "0.1.39",
|
|
4
|
+
"description": "The AID Framework generator plugin interface: the manifest contract, the drift/ownership algorithm, and the determinism helpers every target generator emits through.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/aid-framework/aid-framework.git",
|
|
9
|
+
"directory": "packages/generator-sdk"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=24"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@aid-framework/ir": "0.1.39",
|
|
34
|
+
"@aid-framework/spec": "0.1.39"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^26.6.5"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -b",
|
|
41
|
+
"clean": "tsc -b --clean"
|
|
42
|
+
}
|
|
43
|
+
}
|