@aui.io/apollo 0.1.40 → 0.1.41
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/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +133 -29
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js +0 -2
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +11 -100
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +0 -17
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.d.ts +71 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.d.ts +12 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js +8 -2
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.d.ts +15 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.js +121 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +2 -3
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +0 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +55 -6
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +189 -36
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.d.ts +42 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.js +106 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.d.ts +5 -3
- package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.js +15 -6
- package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/package.json +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +0 -28
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js +0 -3
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +1 -3
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +3 -3
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +3 -82
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +0 -43
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +15 -159
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.d.ts +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +0 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.d.ts +0 -3
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js +0 -124
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js.map +0 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.d.ts +0 -158
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js +0 -481
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js.map +0 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.d.ts +0 -22
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js +0 -99
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js.map +0 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.d.ts +0 -47
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js +0 -284
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js.map +0 -1
|
@@ -107,6 +107,69 @@ export interface AdvisorView {
|
|
|
107
107
|
answer: string | null;
|
|
108
108
|
usage: Record<string, unknown> | null;
|
|
109
109
|
}
|
|
110
|
+
/** One live evaluation over one shipped tree (the detached lane). `files`
|
|
111
|
+
* must carry `build/evaluation.yaml` and the `src/**` program; `agent_id`
|
|
112
|
+
* names whose workspace the trial threads belong to; `version_tag` labels
|
|
113
|
+
* them (absent: the agent's active tag); `scenarios` scopes the run to
|
|
114
|
+
* named codes — a scoped run is a fixing-loop tool, never promotable. */
|
|
115
|
+
export interface EvaluateRequest {
|
|
116
|
+
agent_id: string;
|
|
117
|
+
files: BuilderTree;
|
|
118
|
+
message?: string;
|
|
119
|
+
scenarios?: string[];
|
|
120
|
+
version_tag?: string;
|
|
121
|
+
}
|
|
122
|
+
/** The 202 — the run to poll, sized before a single trial moves. */
|
|
123
|
+
export interface EvaluationReceipt {
|
|
124
|
+
evaluation_id: string;
|
|
125
|
+
status: string;
|
|
126
|
+
scope: string;
|
|
127
|
+
total_trials: number;
|
|
128
|
+
scenarios: string[];
|
|
129
|
+
judge_model: string;
|
|
130
|
+
}
|
|
131
|
+
/** One trial row — `thread_id` opens the minted conversation. */
|
|
132
|
+
export interface EvaluationTrial {
|
|
133
|
+
scenario_code: string;
|
|
134
|
+
iteration: number;
|
|
135
|
+
status: string;
|
|
136
|
+
thread_id: string | null;
|
|
137
|
+
verdict: {
|
|
138
|
+
passed?: boolean;
|
|
139
|
+
reasons?: string[];
|
|
140
|
+
} | null;
|
|
141
|
+
turns: number | null;
|
|
142
|
+
error: string | null;
|
|
143
|
+
}
|
|
144
|
+
/** The poll view: the run row plus its trial rows. `verdict` and the
|
|
145
|
+
* tallies stay null until the run settles; `status` leaves
|
|
146
|
+
* queued/running/cancelling exactly once. */
|
|
147
|
+
export interface EvaluationView {
|
|
148
|
+
evaluation_id: string;
|
|
149
|
+
session_id: string | null;
|
|
150
|
+
agent_id: string | null;
|
|
151
|
+
status: string;
|
|
152
|
+
scope: string;
|
|
153
|
+
message: string | null;
|
|
154
|
+
judge_model: string | null;
|
|
155
|
+
verdict: string | null;
|
|
156
|
+
pass_scenarios: number | null;
|
|
157
|
+
total_scenarios: number | null;
|
|
158
|
+
result: {
|
|
159
|
+
threshold?: number;
|
|
160
|
+
scenarios?: {
|
|
161
|
+
code: string;
|
|
162
|
+
name: string;
|
|
163
|
+
k: number;
|
|
164
|
+
passed: number;
|
|
165
|
+
errors: number;
|
|
166
|
+
ungraded: number;
|
|
167
|
+
verdict: string;
|
|
168
|
+
}[];
|
|
169
|
+
} | null;
|
|
170
|
+
error: string | null;
|
|
171
|
+
trials: EvaluationTrial[];
|
|
172
|
+
}
|
|
110
173
|
/** One build over one pushed agent. No files ride in — the service pulls
|
|
111
174
|
* the agent's bundle itself; `version_tag` names the base (absent: the
|
|
112
175
|
* agent's current pin). */
|
|
@@ -163,6 +226,14 @@ export declare class BuilderApiClient {
|
|
|
163
226
|
/** Enqueue one advisor turn (202 immediately — the answer comes by poll). */
|
|
164
227
|
advise(ask: AdvisorAsk): Promise<AdvisorStarted>;
|
|
165
228
|
adviceView(turnId: string): Promise<AdvisorView>;
|
|
229
|
+
/** Enqueue one detached evaluation (202 immediately — the scoreboard
|
|
230
|
+
* comes by poll; there is no session and no SSE stream). */
|
|
231
|
+
startEvaluation(request: EvaluateRequest): Promise<EvaluationReceipt>;
|
|
232
|
+
evaluationView(evaluationId: string): Promise<EvaluationView>;
|
|
233
|
+
cancelEvaluation(evaluationId: string): Promise<{
|
|
234
|
+
evaluation_id: string;
|
|
235
|
+
status: string;
|
|
236
|
+
}>;
|
|
166
237
|
/** Enqueue one build (202 immediately — the verdict comes by poll). The
|
|
167
238
|
* idempotency key makes a network retry the SAME build, not a second one. */
|
|
168
239
|
startBuild(build: BuildRequest, idempotencyKey: string): Promise<BuildStarted>;
|
|
@@ -36,6 +36,23 @@ export class BuilderApiClient {
|
|
|
36
36
|
adviceView(turnId) {
|
|
37
37
|
return this.http.request(`/v1/builder/advisor/${turnId}`);
|
|
38
38
|
}
|
|
39
|
+
/** Enqueue one detached evaluation (202 immediately — the scoreboard
|
|
40
|
+
* comes by poll; there is no session and no SSE stream). */
|
|
41
|
+
startEvaluation(request) {
|
|
42
|
+
return this.http.request("/v1/builder/evaluate", {
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: request,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
evaluationView(evaluationId) {
|
|
48
|
+
return this.http.request(`/v1/builder/evaluations/${evaluationId}`);
|
|
49
|
+
}
|
|
50
|
+
cancelEvaluation(evaluationId) {
|
|
51
|
+
return this.http.request(`/v1/builder/evaluations/${evaluationId}/cancel`, {
|
|
52
|
+
method: "POST",
|
|
53
|
+
body: {},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
39
56
|
/** Enqueue one build (202 immediately — the verdict comes by poll). The
|
|
40
57
|
* idempotency key makes a network retry the SAME build, not a second one. */
|
|
41
58
|
startBuild(build, idempotencyKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-api.js","sourceRoot":"","sources":["../../../src/api/builder-api.ts"],"names":[],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AE;YAC/C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;IACL,CAAC;IAEM,cAAc,CAAC,YAAoB;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAC;IACtE,CAAC;IAEM,gBAAgB,CACrB,YAAoB;QAEpB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,YAAY,SAAS,EAAE;YACzE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;IACL,CAAC;IAED;kFAC8E;IACvE,UAAU,CAAC,KAAmB,EAAE,cAAsB;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE;YAC5C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,EAAE,iBAAiB,EAAE,cAAc,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC;IAEM,SAAS,CAAC,OAAe;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -4,6 +4,13 @@ export interface Baseline {
|
|
|
4
4
|
versionTag: string;
|
|
5
5
|
files: Record<string, string>;
|
|
6
6
|
fileLayout?: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* The build area (`bundle/build/**`) as last synced — hashes keyed by the
|
|
9
|
+
* path relative to `bundle/build/`, matching the wire's relative paths.
|
|
10
|
+
* Absent on baselines written before the build lane existed; readers treat
|
|
11
|
+
* that as an empty area (everything local reads as new work to push).
|
|
12
|
+
*/
|
|
13
|
+
buildHashes?: Record<string, string>;
|
|
7
14
|
writtenAt: string;
|
|
8
15
|
}
|
|
9
16
|
export interface FileDiff {
|
|
@@ -11,7 +18,11 @@ export interface FileDiff {
|
|
|
11
18
|
changed: string[];
|
|
12
19
|
removed: string[];
|
|
13
20
|
}
|
|
14
|
-
export declare function writeBaseline(home: string, agentId: string, versionTag: string, files: Record<string, string>, fileLayout?: Record<string, string
|
|
21
|
+
export declare function writeBaseline(home: string, agentId: string, versionTag: string, files: Record<string, string>, fileLayout?: Record<string, string>,
|
|
22
|
+
/** Pre-hashed (build files may be binary, so contents never travel here). */
|
|
23
|
+
buildHashes?: Record<string, string>): Promise<void>;
|
|
15
24
|
export declare function readBaseline(home: string, agentId: string): Promise<Baseline | null>;
|
|
16
25
|
export declare function diffHashes(baseline: Record<string, string>, currentFiles: Record<string, string>): FileDiff;
|
|
26
|
+
/** Diff two pre-hashed maps — the build lane hashes Buffers itself. */
|
|
27
|
+
export declare function diffHashMaps(baseline: Record<string, string>, current: Record<string, string>): FileDiff;
|
|
17
28
|
export declare function isClean(diff: FileDiff): boolean;
|
|
@@ -4,7 +4,9 @@ import { hashFiles } from "./files.js";
|
|
|
4
4
|
function baselinePath(home, agentId) {
|
|
5
5
|
return path.join(home, ".apollo", "baselines", agentId, "baseline.json");
|
|
6
6
|
}
|
|
7
|
-
export async function writeBaseline(home, agentId, versionTag, files, fileLayout
|
|
7
|
+
export async function writeBaseline(home, agentId, versionTag, files, fileLayout,
|
|
8
|
+
/** Pre-hashed (build files may be binary, so contents never travel here). */
|
|
9
|
+
buildHashes) {
|
|
8
10
|
const target = baselinePath(home, agentId);
|
|
9
11
|
await mkdir(path.dirname(target), { recursive: true, mode: 0o700 });
|
|
10
12
|
const baseline = {
|
|
@@ -13,6 +15,7 @@ export async function writeBaseline(home, agentId, versionTag, files, fileLayout
|
|
|
13
15
|
versionTag,
|
|
14
16
|
files: hashFiles(files),
|
|
15
17
|
...(fileLayout ? { fileLayout } : {}),
|
|
18
|
+
...(buildHashes ? { buildHashes } : {}),
|
|
16
19
|
writtenAt: new Date().toISOString(),
|
|
17
20
|
};
|
|
18
21
|
await writeFile(target, `${JSON.stringify(baseline, null, 2)}\n`, {
|
|
@@ -31,7 +34,10 @@ export async function readBaseline(home, agentId) {
|
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
export function diffHashes(baseline, currentFiles) {
|
|
34
|
-
|
|
37
|
+
return diffHashMaps(baseline, hashFiles(currentFiles));
|
|
38
|
+
}
|
|
39
|
+
/** Diff two pre-hashed maps — the build lane hashes Buffers itself. */
|
|
40
|
+
export function diffHashMaps(baseline, current) {
|
|
35
41
|
const previousPaths = new Set(Object.keys(baseline));
|
|
36
42
|
const currentPaths = new Set(Object.keys(current));
|
|
37
43
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseline.js","sourceRoot":"","sources":["../../../src/bundle/baseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"baseline.js","sourceRoot":"","sources":["../../../src/bundle/baseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAwBvC,SAAS,YAAY,CAAC,IAAY,EAAE,OAAe;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,OAAe,EACf,UAAkB,EAClB,KAA6B,EAC7B,UAAmC;AACnC,6EAA6E;AAC7E,WAAoC;IAEpC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAA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AM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEnD,OAAO;QACL,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;QAC1E,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;aACvB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;aAC7E,IAAI,EAAE;QACT,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;KAC7E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAc;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BuildFiles {
|
|
2
|
+
root: string;
|
|
3
|
+
/** POSIX path relative to `bundle/build/` → raw bytes. */
|
|
4
|
+
files: Record<string, Buffer>;
|
|
5
|
+
}
|
|
6
|
+
/** Every file under the area, dotfiles skipped. A missing directory reads
|
|
7
|
+
* as an empty area — "no proof material yet" is a normal state. */
|
|
8
|
+
export declare function readBuildFiles(root: string): Promise<BuildFiles>;
|
|
9
|
+
export declare function hashBuildFiles(files: Record<string, Buffer>): Record<string, string>;
|
|
10
|
+
/** Exact sync to the given snapshot: write everything, delete what the
|
|
11
|
+
* snapshot no longer holds, prune emptied directories. */
|
|
12
|
+
export declare function writeBuildFiles(destination: string, files: Record<string, Buffer>): Promise<{
|
|
13
|
+
written: string[];
|
|
14
|
+
removed: string[];
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The build area — `<checkout>/bundle/build/**` as files on the wire.
|
|
3
|
+
*
|
|
4
|
+
* The tree law (AGENTS_HEADLESS.md §2): `bundle/src/**` is the program and
|
|
5
|
+
* rides agent versions; `bundle/build/**` is the proof material (the
|
|
6
|
+
* scenario suite, the live-eval pair, fixtures) and rides the agent's BUILD
|
|
7
|
+
* BUNDLE — a separately versioned tree on agent-settings whose wire paths
|
|
8
|
+
* are relative to `bundle/build/` (no prefix). This module is the disk half
|
|
9
|
+
* of that lane: read, hash, and exact-sync the area.
|
|
10
|
+
*
|
|
11
|
+
* Unlike the program scan (`files.ts`, text-only), the build area may hold
|
|
12
|
+
* binary fixtures — contents stay `Buffer` end to end and only hashes ever
|
|
13
|
+
* reach the baseline.
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from "node:crypto";
|
|
16
|
+
import { mkdir, readdir, readFile, rmdir, unlink, writeFile } from "node:fs/promises";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
function safeBuildRel(relativePath) {
|
|
19
|
+
const normalised = path.posix.normalize(relativePath.replaceAll("\\", "/"));
|
|
20
|
+
if (path.posix.isAbsolute(normalised) ||
|
|
21
|
+
normalised === ".." ||
|
|
22
|
+
normalised.startsWith("../")) {
|
|
23
|
+
throw new Error(`Build path escapes the build area: ${relativePath}`);
|
|
24
|
+
}
|
|
25
|
+
return normalised;
|
|
26
|
+
}
|
|
27
|
+
function resolveInside(root, relativePath) {
|
|
28
|
+
const target = path.resolve(root, safeBuildRel(relativePath));
|
|
29
|
+
if (target !== root && !target.startsWith(`${root}${path.sep}`)) {
|
|
30
|
+
throw new Error(`Build path escapes the build area: ${relativePath}`);
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
34
|
+
/** Every file under the area, dotfiles skipped. A missing directory reads
|
|
35
|
+
* as an empty area — "no proof material yet" is a normal state. */
|
|
36
|
+
export async function readBuildFiles(root) {
|
|
37
|
+
const absoluteRoot = path.resolve(root);
|
|
38
|
+
const files = {};
|
|
39
|
+
async function walk(directory, relativeDirectory = "") {
|
|
40
|
+
let entries;
|
|
41
|
+
try {
|
|
42
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (error.code === "ENOENT")
|
|
46
|
+
return;
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
entries.sort((left, right) => left.name.localeCompare(right.name));
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
if (entry.name.startsWith("."))
|
|
52
|
+
continue;
|
|
53
|
+
const relativePath = relativeDirectory
|
|
54
|
+
? `${relativeDirectory}/${entry.name}`
|
|
55
|
+
: entry.name;
|
|
56
|
+
const absolutePath = path.join(directory, entry.name);
|
|
57
|
+
if (entry.isDirectory()) {
|
|
58
|
+
await walk(absolutePath, relativePath);
|
|
59
|
+
}
|
|
60
|
+
else if (entry.isFile()) {
|
|
61
|
+
files[relativePath] = await readFile(absolutePath);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await walk(absoluteRoot);
|
|
66
|
+
return { root: absoluteRoot, files };
|
|
67
|
+
}
|
|
68
|
+
export function hashBuildFiles(files) {
|
|
69
|
+
return Object.fromEntries(Object.entries(files)
|
|
70
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
71
|
+
.map(([relativePath, content]) => [
|
|
72
|
+
relativePath,
|
|
73
|
+
createHash("sha256").update(content).digest("hex"),
|
|
74
|
+
]));
|
|
75
|
+
}
|
|
76
|
+
/** Exact sync to the given snapshot: write everything, delete what the
|
|
77
|
+
* snapshot no longer holds, prune emptied directories. */
|
|
78
|
+
export async function writeBuildFiles(destination, files) {
|
|
79
|
+
const root = path.resolve(destination);
|
|
80
|
+
await mkdir(root, { recursive: true });
|
|
81
|
+
const desired = new Map(Object.entries(files).map(([relativePath, content]) => [
|
|
82
|
+
safeBuildRel(relativePath),
|
|
83
|
+
content,
|
|
84
|
+
]));
|
|
85
|
+
const removed = [];
|
|
86
|
+
const existing = await readBuildFiles(root);
|
|
87
|
+
for (const relativePath of Object.keys(existing.files).sort()) {
|
|
88
|
+
if (desired.has(relativePath))
|
|
89
|
+
continue;
|
|
90
|
+
await unlink(resolveInside(root, relativePath));
|
|
91
|
+
removed.push(relativePath);
|
|
92
|
+
}
|
|
93
|
+
for (const [relativePath, content] of desired) {
|
|
94
|
+
const target = resolveInside(root, relativePath);
|
|
95
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
96
|
+
await writeFile(target, content);
|
|
97
|
+
}
|
|
98
|
+
await removeEmptyDirectories(root);
|
|
99
|
+
return { written: [...desired.keys()].sort(), removed };
|
|
100
|
+
}
|
|
101
|
+
async function removeEmptyDirectories(root) {
|
|
102
|
+
async function walk(directory) {
|
|
103
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
104
|
+
let empty = true;
|
|
105
|
+
for (const entry of entries) {
|
|
106
|
+
const child = path.join(directory, entry.name);
|
|
107
|
+
if (entry.isDirectory()) {
|
|
108
|
+
if (await walk(child)) {
|
|
109
|
+
await rmdir(child);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
empty = false;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
empty = false;
|
|
116
|
+
}
|
|
117
|
+
return empty;
|
|
118
|
+
}
|
|
119
|
+
await walk(root);
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=build-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-area.js","sourceRoot":"","sources":["../../../src/bundle/build-area.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imeTrace,
|
|
|
10
10
|
export { BuilderApiClient, type AdvisorAsk, type AdvisorStarted, type AdvisorView, type BuilderCertification, type BuilderFinding, type BuilderTree, type BuilderValidation, type BuildRequest, type BuildStarted, type BuildView, type EraCensus, type OrphanCensus, type ScenarioFailure, } from "./api/builder-api.js";
|
|
11
11
|
export { Transport, type FormBody, type FormFilePart, type RequestCapture, type TransportOptions, } from "./api/transport.js";
|
|
12
12
|
export { CaptureLog, captureLog, defaultCapturePath, type CaptureSink, } from "./api/capture.js";
|
|
13
|
-
export { AgentSettingsClient, type AgentBlobStats, type AgentRecord, type AgentRecordKind, type AgentRecordScope, type RuntimeVersionRecord, type BuildBundle, type BuildBundleFile, type BuildBundlePullResponse, type BuildBundlePushResponse, type BundleUploadFile,
|
|
13
|
+
export { AgentSettingsClient, type AgentBlobStats, type AgentRecord, type AgentRecordKind, type AgentRecordScope, type RuntimeVersionRecord, type BuildBundle, type BuildBundleFile, type BuildBundlePullResponse, type BuildBundlePushResponse, type BundleUploadFile, } from "./api/agent-settings.js";
|
|
14
14
|
export { diffHashes, isClean, readBaseline, writeBaseline, type Baseline, type FileDiff, } from "./bundle/baseline.js";
|
|
15
15
|
export { contentDigest, hashFiles, readProgramFiles, type ProgramFiles, } from "./bundle/files.js";
|
|
16
16
|
export { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, type BundleDocument, } from "./bundle/materialize.js";
|
|
@@ -22,7 +22,7 @@ export { environments, type BaseUrls, type ConfigFlags, type Context, type Crede
|
|
|
22
22
|
export { ApiError, AuthError, CliError, ConfigError, ExitCode, ValidationError, toCliError, type ExitCodeValue, } from "./errors/index.js";
|
|
23
23
|
export { Output, errorEnvelope, successEnvelope, type ErrorEnvelope, type OutputOptions, } from "./output/index.js";
|
|
24
24
|
export { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "./services/auth.js";
|
|
25
|
-
export { DEFAULT_SKILL_TARGETS, agentRoot, importBundle, listVersions, localDiff, pullBundle, pullCheckout, pushBundle, readCheckoutTree, remoteDiff, validateLocalBundle, validateProgramBundle, type BundleValidation, type PullCheckoutOptions, type PullCheckoutResult, type PushCheckoutResult, certifyLocalBundle, needsLocalBundle, } from "./services/bundles.js";
|
|
25
|
+
export { DEFAULT_SKILL_TARGETS, agentRoot, importBundle, listVersions, localDiff, pullBundle, pullCheckout, pushBundle, readCheckoutTree, remoteDiff, validateLocalBundle, validateProgramBundle, type BuildAreaSync, type BundleValidation, type PullCheckoutOptions, type PullCheckoutResult, type PushCheckoutResult, certifyLocalBundle, needsLocalBundle, } from "./services/bundles.js";
|
|
26
26
|
export { ADVISE_DEADLINE_MS, adviseLocalBundle, readAdvisorState, writeAdvisorState, type AdviceResult, type AdviseOptions, type AdvisorState, } from "./services/advisor.js";
|
|
27
27
|
export { BUILD_DEADLINE_MS, buildAgent, type BuildOptions, } from "./services/builds.js";
|
|
28
28
|
export { createClients, type Clients } from "./services/clients.js";
|
|
@@ -33,7 +33,6 @@ export { createThread, debugInteraction, getThread, listMessages, listThreads, p
|
|
|
33
33
|
export { createCollection, createEndpoint, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, inspectSession, listCollections, listEndpoints, normalizeSchema, parseJsonFlag, provisionMockDb, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, type MockDbResolved, type MockDbServiceOptions, type WireResult, } from "./services/mockdb.js";
|
|
34
34
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, type SetSecretParams, type VaultScopeLevel, type VaultServiceOptions, } from "./services/vault.js";
|
|
35
35
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, type HubStatus, type HubUploadResult, type KnowledgeServiceOptions, } from "./services/knowledge.js";
|
|
36
|
-
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listBundleFiles, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, type AssembledBundle, type LocalScenario, type LocalScores, type PullScenariosResult, type PullScoresResult, type PushBundleResult, type PushScoresResult, type ScaffoldResult, type ScenariosFile, type ScenariosServiceOptions, type SyncScenariosResult, } from "./services/scenarios.js";
|
|
37
36
|
export { currentProfile, listProfiles, useProfile, type CurrentProfile, type ProfileSummary, } from "./services/profile.service.js";
|
|
38
37
|
export { captureFailed, filterCaptures, formatCurl, readCapturedRequests, type CaptureFilters, } from "./services/requests.js";
|
|
39
38
|
export { runDoctor, type DoctorCheck, type DoctorOptions, type DoctorReport, type DoctorSection, type DoctorStatus, } from "./services/doctor.js";
|
|
@@ -32,7 +32,6 @@ export { createThread, debugInteraction, getThread, listMessages, listThreads, p
|
|
|
32
32
|
export { createCollection, createEndpoint, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, inspectSession, listCollections, listEndpoints, normalizeSchema, parseJsonFlag, provisionMockDb, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, } from "./services/mockdb.js";
|
|
33
33
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, } from "./services/vault.js";
|
|
34
34
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, } from "./services/knowledge.js";
|
|
35
|
-
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listBundleFiles, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, } from "./services/scenarios.js";
|
|
36
35
|
export { currentProfile, listProfiles, useProfile, } from "./services/profile.service.js";
|
|
37
36
|
export { captureFailed, filterCaptures, formatCurl, readCapturedRequests, } from "./services/requests.js";
|
|
38
37
|
export { runDoctor, } from "./services/doctor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAQhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,GAOb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,GAMZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,GAOV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,GASjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,GAcjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,GAKV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,UAAU,EACV,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAQh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AAgB,EAChB,YAAY,EACZ,aAAa,GAEd,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentSettingsClient, BuildBundlePushResponse } from "../api/agent-settings.js";
|
|
1
2
|
import { type AgentVersion, type ManagementClient, type VersionPull, type VersionPush } from "../api/management.js";
|
|
2
3
|
import type { BuilderApiClient, BuilderCertification, EraCensus, OrphanCensus } from "../api/builder-api.js";
|
|
3
4
|
import type { RuntimeApiClient } from "../api/runtime-api.js";
|
|
@@ -11,27 +12,47 @@ export declare function requireAgent(context: Context): string;
|
|
|
11
12
|
/** The checkout root the context is bound to (exported for the sibling
|
|
12
13
|
* services that anchor per-checkout state there, e.g. the advisor thread). */
|
|
13
14
|
export declare function agentRoot(context: Context): string;
|
|
14
|
-
|
|
15
|
+
/** What one pull moved in the build area, when the agent has a build bundle. */
|
|
16
|
+
export interface BuildAreaSync {
|
|
17
|
+
version: number;
|
|
18
|
+
written: string[];
|
|
19
|
+
removed: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function pullBundle(context: Context, clients: {
|
|
22
|
+
management: ManagementClient;
|
|
23
|
+
agentSettings: AgentSettingsClient;
|
|
24
|
+
}, options?: {
|
|
15
25
|
tag?: string;
|
|
16
26
|
destination?: string;
|
|
17
27
|
homeDir?: string;
|
|
18
28
|
force?: boolean;
|
|
29
|
+
/** Injected for tests; used for the signed-URL build-file downloads. */
|
|
30
|
+
fetch?: typeof globalThis.fetch;
|
|
19
31
|
}): Promise<{
|
|
20
32
|
pull: VersionPull;
|
|
21
33
|
files: Record<string, string>;
|
|
22
34
|
removed: string[];
|
|
35
|
+
/** Absent when the agent has no build bundle yet — the area is untouched. */
|
|
36
|
+
build?: BuildAreaSync;
|
|
23
37
|
}>;
|
|
24
|
-
export declare function importBundle(context: Context,
|
|
38
|
+
export declare function importBundle(context: Context, clients: {
|
|
39
|
+
management: ManagementClient;
|
|
40
|
+
agentSettings: AgentSettingsClient;
|
|
41
|
+
}, agentId: string, destination: string, options?: {
|
|
25
42
|
tag?: string;
|
|
26
43
|
homeDir?: string;
|
|
27
44
|
/** The engine build to pin the new checkout to (see `runtime-version/`). */
|
|
28
45
|
runtimeVersion?: string;
|
|
29
46
|
/** `headless` skips skill packs for the checkout's whole life — see `WorkspaceMode`. */
|
|
30
47
|
workspace?: "headless";
|
|
48
|
+
/** Injected for tests; used for the signed-URL build-file downloads. */
|
|
49
|
+
fetch?: typeof globalThis.fetch;
|
|
31
50
|
}): Promise<{
|
|
32
51
|
pull: VersionPull;
|
|
33
52
|
files: Record<string, string>;
|
|
34
53
|
binding: ProjectBinding;
|
|
54
|
+
/** Absent when the agent has no build bundle yet. */
|
|
55
|
+
build?: BuildAreaSync;
|
|
35
56
|
}>;
|
|
36
57
|
/** Skill packs a checkout gets unless the caller narrows or disables them. */
|
|
37
58
|
export declare const DEFAULT_SKILL_TARGETS: SkillTarget[];
|
|
@@ -44,18 +65,22 @@ export interface PullCheckoutOptions {
|
|
|
44
65
|
skills?: SkillTarget[] | false;
|
|
45
66
|
/** Refresh the authoring JSON Schemas (default true). */
|
|
46
67
|
schemas?: boolean;
|
|
68
|
+
/** Injected for tests; used for the signed-URL build-file downloads. */
|
|
69
|
+
fetch?: typeof globalThis.fetch;
|
|
47
70
|
}
|
|
48
71
|
export interface PullCheckoutResult {
|
|
49
72
|
pull: VersionPull;
|
|
50
73
|
files: Record<string, string>;
|
|
51
74
|
removed: string[];
|
|
75
|
+
/** The build area sync, when the agent has a build bundle. */
|
|
76
|
+
build?: BuildAreaSync;
|
|
52
77
|
/** The engine build every fetch above was routed to, when pinned. */
|
|
53
78
|
runtimeVersion?: string;
|
|
54
79
|
skills?: string[];
|
|
55
80
|
/** Managed skill packs deleted — reconciliation, or the headless sweep. */
|
|
56
81
|
removedSkills?: string[];
|
|
57
82
|
schemas?: string[];
|
|
58
|
-
/** True when this pull wrote the checkout's AGENTS.md. */
|
|
83
|
+
/** True when this pull wrote the checkout's AGENTS.md (and its CLAUDE.md copy). */
|
|
59
84
|
agentsPage?: boolean;
|
|
60
85
|
/**
|
|
61
86
|
* Why the runtime-served half was skipped. The bundle is already on disk
|
|
@@ -76,14 +101,26 @@ export interface PullCheckoutResult {
|
|
|
76
101
|
export declare function pullCheckout(context: Context, clients: {
|
|
77
102
|
management: ManagementClient;
|
|
78
103
|
runtime: RuntimeApiClient;
|
|
104
|
+
agentSettings: AgentSettingsClient;
|
|
79
105
|
}, options?: PullCheckoutOptions): Promise<PullCheckoutResult>;
|
|
106
|
+
/** Both lanes against the baseline in one report: program paths bare (as
|
|
107
|
+
* ever), build paths under a `build/` prefix — same dialect as the push
|
|
108
|
+
* and pull dirty-guard messages. */
|
|
80
109
|
export declare function localDiff(context: Context, root?: string, homeDir?: string): Promise<FileDiff>;
|
|
110
|
+
/** Program lane only — the build-bundle pull serves signed URLs, not
|
|
111
|
+
* hashes, so a remote build diff would download the whole bundle to say
|
|
112
|
+
* anything. `apollo pull` (whose dirty guard covers the area) is the
|
|
113
|
+
* honest tool there. */
|
|
81
114
|
export declare function remoteDiff(context: Context, management: ManagementClient, root?: string): Promise<FileDiff>;
|
|
82
|
-
/** Named for symmetry with `PullCheckoutResult
|
|
83
|
-
* already owns `PushBundleResult` — its bundles are evaluation suites). */
|
|
115
|
+
/** Named for symmetry with `PullCheckoutResult`. */
|
|
84
116
|
export interface PushCheckoutResult {
|
|
117
|
+
/** The program lane (`bundle/src/**` vs the baseline). */
|
|
85
118
|
diff: FileDiff;
|
|
119
|
+
/** The build lane (`bundle/build/**` vs the baseline), bare relative paths. */
|
|
120
|
+
buildDiff: FileDiff;
|
|
86
121
|
push?: VersionPush;
|
|
122
|
+
/** Present when the build area changed and was published as a new bundle. */
|
|
123
|
+
buildPush?: BuildBundlePushResponse;
|
|
87
124
|
validation?: ValidationResult;
|
|
88
125
|
/**
|
|
89
126
|
* The runtime pin the push rode — the pre-flight validate routed to it,
|
|
@@ -92,7 +129,19 @@ export interface PushCheckoutResult {
|
|
|
92
129
|
*/
|
|
93
130
|
runtimeVersion?: string;
|
|
94
131
|
}
|
|
95
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Publish the checkout, both lanes: a changed program becomes a new agent
|
|
134
|
+
* version (validated first), a changed build area becomes a new build
|
|
135
|
+
* bundle. Each lane only pushes when IT changed, so suite iteration does
|
|
136
|
+
* not mint program versions and vice versa. The baseline advances after
|
|
137
|
+
* each lane lands — a build-lane failure after a version push leaves a
|
|
138
|
+
* state where re-running pushes only the build lane.
|
|
139
|
+
*/
|
|
140
|
+
export declare function pushBundle(context: Context, clients: {
|
|
141
|
+
management: ManagementClient;
|
|
142
|
+
runtime: RuntimeApiClient;
|
|
143
|
+
agentSettings: AgentSettingsClient;
|
|
144
|
+
}, options?: {
|
|
96
145
|
root?: string;
|
|
97
146
|
commitMessage?: string;
|
|
98
147
|
homeDir?: string;
|