@aid-framework/generator-ts-vercel 0.0.0 → 0.1.48
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 +123 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/emit/agents.d.ts +62 -0
- package/dist/emit/agents.d.ts.map +1 -0
- package/dist/emit/agents.js +256 -0
- package/dist/emit/agents.js.map +1 -0
- package/dist/emit/business.d.ts +23 -0
- package/dist/emit/business.d.ts.map +1 -0
- package/dist/emit/business.js +414 -0
- package/dist/emit/business.js.map +1 -0
- package/dist/emit/control.d.ts +40 -0
- package/dist/emit/control.d.ts.map +1 -0
- package/dist/emit/control.js +108 -0
- package/dist/emit/control.js.map +1 -0
- package/dist/emit/file.d.ts +64 -0
- package/dist/emit/file.d.ts.map +1 -0
- package/dist/emit/file.js +80 -0
- package/dist/emit/file.js.map +1 -0
- package/dist/emit/guardrails.d.ts +45 -0
- package/dist/emit/guardrails.d.ts.map +1 -0
- package/dist/emit/guardrails.js +192 -0
- package/dist/emit/guardrails.js.map +1 -0
- package/dist/emit/infrastructure.d.ts +15 -0
- package/dist/emit/infrastructure.d.ts.map +1 -0
- package/dist/emit/infrastructure.js +238 -0
- package/dist/emit/infrastructure.js.map +1 -0
- package/dist/emit/pipelines.d.ts +46 -0
- package/dist/emit/pipelines.d.ts.map +1 -0
- package/dist/emit/pipelines.js +1015 -0
- package/dist/emit/pipelines.js.map +1 -0
- package/dist/emit/prompts.d.ts +14 -0
- package/dist/emit/prompts.d.ts.map +1 -0
- package/dist/emit/prompts.js +61 -0
- package/dist/emit/prompts.js.map +1 -0
- package/dist/emit/retrieval.d.ts +19 -0
- package/dist/emit/retrieval.d.ts.map +1 -0
- package/dist/emit/retrieval.js +206 -0
- package/dist/emit/retrieval.js.map +1 -0
- package/dist/emit/schemas.d.ts +22 -0
- package/dist/emit/schemas.d.ts.map +1 -0
- package/dist/emit/schemas.js +145 -0
- package/dist/emit/schemas.js.map +1 -0
- package/dist/emit/text.d.ts +86 -0
- package/dist/emit/text.d.ts.map +1 -0
- package/dist/emit/text.js +242 -0
- package/dist/emit/text.js.map +1 -0
- package/dist/emit/tools.d.ts +15 -0
- package/dist/emit/tools.d.ts.map +1 -0
- package/dist/emit/tools.js +225 -0
- package/dist/emit/tools.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +16 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +48 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +88 -0
- package/dist/manifest.js.map +1 -0
- package/dist/names.d.ts +57 -0
- package/dist/names.d.ts.map +1 -0
- package/dist/names.js +294 -0
- package/dist/names.js.map +1 -0
- package/dist/placeholders.d.ts +48 -0
- package/dist/placeholders.d.ts.map +1 -0
- package/dist/placeholders.js +114 -0
- package/dist/placeholders.js.map +1 -0
- package/dist/plan.d.ts +18 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +81 -0
- package/dist/plan.js.map +1 -0
- package/dist/validate.d.ts +88 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +790 -0
- package/dist/validate.js.map +1 -0
- package/package.json +43 -14
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `generated/agents.ts`: the spec's agents, and the runtime built over them.
|
|
3
|
+
*
|
|
4
|
+
* The runtime ships the loop (`@aid-framework/runtime`'s `AgentRuntime`); this module is wiring,
|
|
5
|
+
* not semantics. It carries two things and nothing else:
|
|
6
|
+
*
|
|
7
|
+
* 1. `DOCUMENT` -- the slice of the IR the agent runtime reads, as a TypeScript literal.
|
|
8
|
+
* `fromIr` is the only consumer, so the projection is written by hand here rather
|
|
9
|
+
* than by dumping the whole IR: a reader can see exactly which declarations cross the
|
|
10
|
+
* boundary, and a field the runtime does not read cannot sneak across. A field the
|
|
11
|
+
* runtime *does* read and this module omits is a refusal in `validate.ts`, not a
|
|
12
|
+
* silent default -- `retrievers` and `structuredOutput` are the two today.
|
|
13
|
+
* 2. `buildAgentRuntime` -- one constructor over the app's own gateway and tools, so a
|
|
14
|
+
* pipeline's `agent` step prices against the same ledger and calls the same tool
|
|
15
|
+
* objects as every other step in the request.
|
|
16
|
+
*
|
|
17
|
+
* ## No routes, deliberately
|
|
18
|
+
*
|
|
19
|
+
* The Python target publishes `POST /agents/{id}/run` and `/agents/resume`. This target
|
|
20
|
+
* emits neither: `managedRoots` is `app/generated`, `app/business` and
|
|
21
|
+
* `app/aid.manifest.json`, so `app/api/**` is unowned and a route emitted there would
|
|
22
|
+
* break `validatePlan` on the next `aid gen`. The pause/resume surface is its own design
|
|
23
|
+
* slice; until it lands, an agent is reachable only through an `agent` step, and the
|
|
24
|
+
* validator refuses a step whose agent can pause, so nothing here can enter a state that
|
|
25
|
+
* would need a resume.
|
|
26
|
+
*
|
|
27
|
+
* ## Why `models` is every model, not the agents' closure
|
|
28
|
+
*
|
|
29
|
+
* The Python emitter narrows this list to what the agent routes can reach, because its
|
|
30
|
+
* `from_ir` builds a `ModelSpec` for every entry and refuses an unpriced one. This
|
|
31
|
+
* runtime's `fromIr` builds `ModelSpec`s only for the *reachable* closure -- it reads
|
|
32
|
+
* every entry's `fallbacks` and nothing else -- so an unpriced pipeline-only embedder or
|
|
33
|
+
* reranker never reaches `modelDefinition`. Emitting the whole table is therefore both
|
|
34
|
+
* safe and simpler, and it keeps the document a projection of the IR rather than a
|
|
35
|
+
* second computation over it.
|
|
36
|
+
*
|
|
37
|
+
* ## Why `prompts` is assembled at wiring time
|
|
38
|
+
*
|
|
39
|
+
* The Python emitter reads the generated `TEMPLATES` literal. This target's equivalent is
|
|
40
|
+
* module-private in `prompts/index.ts`, and `deps.prompts` is the seam a business
|
|
41
|
+
* override replaces. Projecting the registry instead of the generated text is what keeps
|
|
42
|
+
* an override from being honoured by a pipeline and missed by an agent.
|
|
43
|
+
*/
|
|
44
|
+
import { generated, paths } from './file.js';
|
|
45
|
+
import { orderedGuardrails } from './guardrails.js';
|
|
46
|
+
import { importStatement, moduleText, tsValue } from './text.js';
|
|
47
|
+
/** The agents this app declares, in id order. */
|
|
48
|
+
export function orderedAgents(ir) {
|
|
49
|
+
return [...(ir.agents ?? [])].sort((left, right) => (left.id < right.id ? -1 : 1));
|
|
50
|
+
}
|
|
51
|
+
/** The memory declarations this app makes, in id order. */
|
|
52
|
+
export function orderedMemory(ir) {
|
|
53
|
+
return [...(ir.memory ?? [])].sort((left, right) => (left.id < right.id ? -1 : 1));
|
|
54
|
+
}
|
|
55
|
+
/** Whether this app declares an agent at all. */
|
|
56
|
+
export function hasAgents(ir) {
|
|
57
|
+
return orderedAgents(ir).length > 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An entry with its `undefined` fields dropped.
|
|
61
|
+
*
|
|
62
|
+
* `tsValue` renders `undefined` as `null`, and a `null` where `fromIr` expects a list
|
|
63
|
+
* (`redact`, `tools`, `fallbacks`) is a configuration error rather than an absent field.
|
|
64
|
+
* Omitting the key is what the runtime's own readers treat as "not declared".
|
|
65
|
+
*/
|
|
66
|
+
function entry(fields) {
|
|
67
|
+
const kept = {};
|
|
68
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
69
|
+
if (value !== undefined)
|
|
70
|
+
kept[key] = value;
|
|
71
|
+
}
|
|
72
|
+
return kept;
|
|
73
|
+
}
|
|
74
|
+
function modelEntry(model) {
|
|
75
|
+
const cost = model.costProfile;
|
|
76
|
+
return entry({
|
|
77
|
+
id: model.id,
|
|
78
|
+
modelId: model.modelId,
|
|
79
|
+
provider: model.provider,
|
|
80
|
+
capabilities: [...model.capabilities],
|
|
81
|
+
limits: entry({
|
|
82
|
+
contextTokens: model.limits.contextTokens,
|
|
83
|
+
// The same fallback the generated gateway uses, so the document's ModelSpec and
|
|
84
|
+
// the gateway's agree on one ceiling for one model.
|
|
85
|
+
maxOutputTokens: model.limits.maxOutputTokens ?? model.params.maxTokens ?? 1024,
|
|
86
|
+
}),
|
|
87
|
+
costProfile: cost === undefined
|
|
88
|
+
? undefined
|
|
89
|
+
: entry({ inputPerMTok: cost.inputPerMTok, outputPerMTok: cost.outputPerMTok }),
|
|
90
|
+
fallbacks: [...model.fallbacks],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function toolEntry(tool) {
|
|
94
|
+
return entry({
|
|
95
|
+
id: tool.id,
|
|
96
|
+
name: tool.name,
|
|
97
|
+
description: tool.description,
|
|
98
|
+
sideEffects: tool.sideEffects,
|
|
99
|
+
requiresConfirmation: tool.requiresConfirmation,
|
|
100
|
+
auth: tool.auth,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function memoryEntry(memory) {
|
|
104
|
+
return entry({
|
|
105
|
+
id: memory.id,
|
|
106
|
+
kind: memory.kind,
|
|
107
|
+
scope: memory.scope,
|
|
108
|
+
tokenBudget: memory.tokenBudget,
|
|
109
|
+
backend: memory.backend,
|
|
110
|
+
store: memory.store,
|
|
111
|
+
summarizeModel: memory.summarizeModel,
|
|
112
|
+
ttl: memory.ttl,
|
|
113
|
+
redact: [...memory.redact],
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* One guardrail, in the *nested* IR shape.
|
|
118
|
+
*
|
|
119
|
+
* The runtime's `guardrailDefinition` reads `onFail.message`/`fallbackPrompt`/`log` from
|
|
120
|
+
* the entry, so the projection here is the IR's own shape rather than the flat
|
|
121
|
+
* `GuardrailDefinition` that `guardrails.ts` builds for a pipeline call site. The two are
|
|
122
|
+
* deliberately different: that module is a declaration the engine evaluates directly,
|
|
123
|
+
* this is input to the runtime's parser.
|
|
124
|
+
*/
|
|
125
|
+
function guardrailEntry(guardrail) {
|
|
126
|
+
return entry({
|
|
127
|
+
id: guardrail.id,
|
|
128
|
+
stages: [...guardrail.stages],
|
|
129
|
+
policies: [...guardrail.policies],
|
|
130
|
+
action: guardrail.action,
|
|
131
|
+
redact: [...guardrail.redact],
|
|
132
|
+
tools: [...guardrail.tools],
|
|
133
|
+
onFail: entry({
|
|
134
|
+
message: guardrail.onFail.message,
|
|
135
|
+
fallbackPrompt: guardrail.onFail.fallbackPrompt,
|
|
136
|
+
log: guardrail.onFail.log,
|
|
137
|
+
}),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function agentEntry(agent) {
|
|
141
|
+
return entry({
|
|
142
|
+
id: agent.id,
|
|
143
|
+
name: agent.name,
|
|
144
|
+
instructions: agent.instructions,
|
|
145
|
+
model: agent.model,
|
|
146
|
+
tools: [...agent.tools],
|
|
147
|
+
memory: [...agent.memory],
|
|
148
|
+
guardrails: [...agent.guardrails],
|
|
149
|
+
maxSteps: agent.maxSteps,
|
|
150
|
+
maxTokensBudget: agent.maxTokensBudget,
|
|
151
|
+
maxCostBudget: agent.maxCostBudget,
|
|
152
|
+
onBudgetExhausted: agent.onBudgetExhausted ?? 'fail',
|
|
153
|
+
handoffs: [...agent.handoffs],
|
|
154
|
+
delegates: [...agent.delegates],
|
|
155
|
+
engine: agent.engine,
|
|
156
|
+
engineVersion: agent.engineVersion,
|
|
157
|
+
// Already a parsed policy object in the IR, and the runtime's `approval` reads it as
|
|
158
|
+
// one: the document carries the parse, never the source text.
|
|
159
|
+
humanInTheLoop: agent.humanInTheLoop,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The IR projection `fromIr` reads, without `prompts`.
|
|
164
|
+
*
|
|
165
|
+
* Every collection is emitted whole rather than pruned to what one agent names: `fromIr`
|
|
166
|
+
* resolves references and refuses a dangling one by name, and a pruned document would
|
|
167
|
+
* turn that refusal into a claim this module makes silently.
|
|
168
|
+
*/
|
|
169
|
+
export function agentDocumentEntries(ir) {
|
|
170
|
+
return {
|
|
171
|
+
models: ir.models.map(modelEntry),
|
|
172
|
+
tools: ir.tools.map(toolEntry),
|
|
173
|
+
memory: orderedMemory(ir).map(memoryEntry),
|
|
174
|
+
guardrails: orderedGuardrails(ir).map(guardrailEntry),
|
|
175
|
+
agents: orderedAgents(ir).map(agentEntry),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const DOCUMENT = [
|
|
179
|
+
'/**',
|
|
180
|
+
' * The declarations an agent run reads, as the IR states them.',
|
|
181
|
+
' *',
|
|
182
|
+
' * `fromIr` is the only consumer: every field here is one it resolves, and a declaration',
|
|
183
|
+
' * it would need and this literal omits is refused at plan time rather than left to fail',
|
|
184
|
+
' * at the first call. `prompts` is assembled beside it by `agentDocument` -- see',
|
|
185
|
+
' * `promptDocument` for why it is not a second literal here.',
|
|
186
|
+
' */',
|
|
187
|
+
].join('\n');
|
|
188
|
+
const AGENT_DOCUMENT = [
|
|
189
|
+
'/**',
|
|
190
|
+
" * The document `fromIr` parses: the IR projection plus this app's prompt text.",
|
|
191
|
+
' *',
|
|
192
|
+
' * `deps` is a parameter, not a module-level read, so a test can hand in a registry it',
|
|
193
|
+
' * built itself and see the projection without standing up the generated app.',
|
|
194
|
+
' */',
|
|
195
|
+
].join('\n');
|
|
196
|
+
const PROMPT_DOCUMENT = [
|
|
197
|
+
'/**',
|
|
198
|
+
' * The prompt entries `fromIr` resolves, borrowed from the registry.',
|
|
199
|
+
' *',
|
|
200
|
+
' * `prompts/index.ts` owns the generated text and is the seam a business override',
|
|
201
|
+
' * replaces, so a second copy here would be a copy an override silently misses: a',
|
|
202
|
+
' * pipeline would answer with the override while an agent answered with the generated',
|
|
203
|
+
' * text. `PromptRegistry.latest` is the same string `fromIr` reads verbatim, and the',
|
|
204
|
+
' * validator refuses an agent prompt that declares variables, so nothing formats either',
|
|
205
|
+
' * side and the two representations cannot differ while that refusal holds.',
|
|
206
|
+
' */',
|
|
207
|
+
'function promptDocument(deps: Deps): readonly unknown[] {',
|
|
208
|
+
' return deps.prompts',
|
|
209
|
+
' .names()',
|
|
210
|
+
' .map((name) => ({ id: name, template: deps.prompts.latest(name).template }));',
|
|
211
|
+
'}',
|
|
212
|
+
].join('\n');
|
|
213
|
+
const BUILD = [
|
|
214
|
+
'/**',
|
|
215
|
+
' * Build the runtime over this app, reusing the caller-supplied gateway and tools.',
|
|
216
|
+
' *',
|
|
217
|
+
' * Taking both from `Deps` rather than constructing them here is what keeps an `agent`',
|
|
218
|
+
' * step on the same ledger, the same provider overrides and the same tool objects as the',
|
|
219
|
+
' * pipeline it runs inside. `AgentRuntime.fromIr` builds a gateway of its own from a',
|
|
220
|
+
' * provider mapping, which would put a second ledger beside the first, so the document is',
|
|
221
|
+
' * resolved by `fromIr` and the gateway is passed in instead.',
|
|
222
|
+
' *',
|
|
223
|
+
' * One runtime per call, because `Deps` is replaceable: a test that swaps the gateway for',
|
|
224
|
+
' * a fake must reach the agent loop too, and a module-level runtime would hold the real',
|
|
225
|
+
' * one from the first import.',
|
|
226
|
+
' */',
|
|
227
|
+
'export function buildAgentRuntime(deps: Deps = getDeps()): AgentRuntime {',
|
|
228
|
+
' return new AgentRuntime(fromIr({ ...agentDocument(deps) }), deps.gateway, {',
|
|
229
|
+
' tools: deps.toolList,',
|
|
230
|
+
' });',
|
|
231
|
+
'}',
|
|
232
|
+
].join('\n');
|
|
233
|
+
/** `generated/agents.ts`: the agent document and the runtime built over it, or nothing. */
|
|
234
|
+
export function emitAgents(ir) {
|
|
235
|
+
if (!hasAgents(ir))
|
|
236
|
+
return undefined;
|
|
237
|
+
const ids = orderedAgents(ir).map((agent) => tsValue(agent.id, ''));
|
|
238
|
+
const header = importStatement('@aid-framework/runtime', [
|
|
239
|
+
{ name: 'AgentRuntime', type: false },
|
|
240
|
+
{ name: 'fromIr', type: false },
|
|
241
|
+
]);
|
|
242
|
+
const depsImport = importStatement('./deps.js', [
|
|
243
|
+
{ name: 'Deps', type: true },
|
|
244
|
+
{ name: 'getDeps', type: false },
|
|
245
|
+
]);
|
|
246
|
+
return generated(paths.agents, moduleText(`${header}\n${depsImport}`, [
|
|
247
|
+
'/** The agents this app declares, in id order. */',
|
|
248
|
+
`export const AGENT_IDS: readonly string[] = [${ids.join(', ')}];`,
|
|
249
|
+
].join('\n'), DOCUMENT, 'const ENTRIES: Record<string, unknown> = ' +
|
|
250
|
+
`${tsValue(agentDocumentEntries(ir), '')} as Record<string, unknown>;`, AGENT_DOCUMENT, [
|
|
251
|
+
'export function agentDocument(deps: Deps): Record<string, unknown> {',
|
|
252
|
+
' return { ...ENTRIES, prompts: promptDocument(deps) };',
|
|
253
|
+
'}',
|
|
254
|
+
].join('\n'), PROMPT_DOCUMENT, BUILD));
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/emit/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAWH,OAAO,EAAoB,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEjE,iDAAiD;AACjD,MAAM,UAAU,aAAa,CAAC,EAAM;IAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,aAAa,CAAC,EAAM;IAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC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AAS,CAAC;IACrC,MAAM,GAAG,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACpE,MAAM,MAAM,GAAG,eAAe,CAAC,wBAAwB,EAAE;QACvD,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE;QACrC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;KAChC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,eAAe,CAAC,WAAW,EAAE;QAC9C,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;QAC5B,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;KACjC,CAAC,CAAC;IACH,OAAO,SAAS,CACd,KAAK,CAAC,MAAM,EACZ,UAAU,CACR,GAAG,MAAM,KAAK,UAAU,EAAE,EAC1B;QACE,mDAAmD;QACnD,gDAAgD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;KACnE,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,QAAQ,EACR,2CAA2C;QACzC,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,8BAA8B,EACxE,cAAc,EACd;QACE,sEAAsE;QACtE,yDAAyD;QACzD,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,eAAe,EACf,KAAK,CACN,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `generated/evals/*` and `generated/business/*`.
|
|
3
|
+
*
|
|
4
|
+
* An eval module is generated, not constructed at run time: the dataset, the metrics and
|
|
5
|
+
* the gate thresholds are all IR inputs, so the harness a failure points at is reviewable
|
|
6
|
+
* in the diff that changed it.
|
|
7
|
+
*
|
|
8
|
+
* A business module is the opposite: generated exactly once and then owned by the
|
|
9
|
+
* application. `planRegeneration` never overwrites it, which is why the seed has to
|
|
10
|
+
* compile and fail loudly rather than compile and return a plausible lie.
|
|
11
|
+
*/
|
|
12
|
+
import type { EvalShape, IR } from '@aid-framework/ir';
|
|
13
|
+
import { type EmittedFile } from './file.js';
|
|
14
|
+
/** The retriever a retrieval eval samples: the eval's own pipeline, else the only one. */
|
|
15
|
+
export declare function evalRetriever(ir: IR, evalShape: EvalShape): string | undefined;
|
|
16
|
+
export declare function emitEvalModules(ir: IR): EmittedFile[];
|
|
17
|
+
export declare function emitEvalsIndex(ir: IR): EmittedFile;
|
|
18
|
+
export declare function emitBusinessToolSeeds(ir: IR): EmittedFile[];
|
|
19
|
+
export declare function emitBusinessToolsIndex(ir: IR): EmittedFile;
|
|
20
|
+
export declare function emitBusinessPromptsIndex(ir: IR): EmittedFile;
|
|
21
|
+
export declare function emitBusinessIndex(ir: IR): EmittedFile;
|
|
22
|
+
export declare function emitGeneratedIndex(ir: IR): EmittedFile;
|
|
23
|
+
//# sourceMappingURL=business.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/emit/business.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,EAAE,EAA0B,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EAGL,KAAK,WAAW,EAIjB,MAAM,WAAW,CAAC;AAkEnB,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9E;AAgPD,wBAAgB,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,EAAE,CAIrD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,CAelD;AAiCD,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,EAAE,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,CAuB1D;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,CAiB5D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,CAkBrD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,GAAG,WAAW,CAiCtD"}
|