@aui.io/apollo 0.1.39 → 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.
Files changed (66) hide show
  1. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +131 -27
  2. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
  3. package/node_modules/@aui.io/apollo-cli/dist/src/commands/vault.js +3 -4
  4. package/node_modules/@aui.io/apollo-cli/dist/src/commands/vault.js.map +1 -1
  5. package/node_modules/@aui.io/apollo-cli/dist/src/index.js +0 -2
  6. package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
  7. package/node_modules/@aui.io/apollo-cli/package.json +3 -3
  8. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +11 -100
  9. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +0 -17
  10. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -1
  11. package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.d.ts +71 -0
  12. package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js +17 -0
  13. package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js.map +1 -1
  14. package/node_modules/@aui.io/apollo-core/dist/src/api/vault.d.ts +8 -23
  15. package/node_modules/@aui.io/apollo-core/dist/src/api/vault.js +4 -23
  16. package/node_modules/@aui.io/apollo-core/dist/src/api/vault.js.map +1 -1
  17. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.d.ts +12 -1
  18. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js +8 -2
  19. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js.map +1 -1
  20. package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.d.ts +15 -0
  21. package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.js +121 -0
  22. package/node_modules/@aui.io/apollo-core/dist/src/bundle/build-area.js.map +1 -0
  23. package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +3 -4
  24. package/node_modules/@aui.io/apollo-core/dist/src/index.js +0 -1
  25. package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
  26. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +54 -5
  27. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +189 -36
  28. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -1
  29. package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.d.ts +42 -0
  30. package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.js +106 -0
  31. package/node_modules/@aui.io/apollo-core/dist/src/services/evaluations.js.map +1 -0
  32. package/node_modules/@aui.io/apollo-core/dist/src/services/vault.d.ts +2 -3
  33. package/node_modules/@aui.io/apollo-core/dist/src/services/vault.js +12 -12
  34. package/node_modules/@aui.io/apollo-core/dist/src/services/vault.js.map +1 -1
  35. package/node_modules/@aui.io/apollo-core/package.json +1 -1
  36. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +0 -28
  37. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
  38. package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js +0 -3
  39. package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js.map +1 -1
  40. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +1 -3
  41. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +3 -3
  42. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -1
  43. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +4 -90
  44. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
  45. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +1 -1
  46. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +0 -50
  47. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
  48. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +15 -159
  49. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
  50. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.d.ts +1 -1
  51. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +0 -1
  52. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -1
  53. package/node_modules/@aui.io/apollo-tui/package.json +2 -2
  54. package/package.json +4 -4
  55. package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.d.ts +0 -3
  56. package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js +0 -124
  57. package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js.map +0 -1
  58. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.d.ts +0 -158
  59. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js +0 -481
  60. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js.map +0 -1
  61. package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.d.ts +0 -22
  62. package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js +0 -99
  63. package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js.map +0 -1
  64. package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.d.ts +0 -47
  65. package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js +0 -284
  66. package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js.map +0 -1
@@ -1,124 +0,0 @@
1
- import { ConfigError } from "@aui.io/apollo-core/errors/index.js";
2
- import { INTENT_DIR, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, } from "@aui.io/apollo-core/services/scenarios.js";
3
- function requireCheckout(run) {
4
- if (!run.context.agentRoot) {
5
- throw new ConfigError("Scenarios live in an agent checkout.", "cd into an agent checkout (or `apollo agent import` one) first.");
6
- }
7
- return run.context.agentRoot;
8
- }
9
- export function registerScenarios(program, runtime) {
10
- const scenarios = program
11
- .command("scenarios")
12
- .description("Evaluation suite for the agent — scenarios/scores files synced via agent-settings");
13
- scenarios
14
- .command("generate")
15
- .description(`Scaffold ${SCENARIOS_DIR}/ (suite skeleton + ${INTENT_DIR}/)`)
16
- .action(async () => {
17
- const run = runtime();
18
- const root = requireCheckout(run);
19
- const result = await scaffoldScenarios(root);
20
- const paths = scenariosPaths(root);
21
- run.output.result({ ...result, ...paths }, () => [
22
- result.createdScenariosFile
23
- ? `Created ${paths.scenariosFile}`
24
- : `Kept existing ${paths.scenariosFile}`,
25
- result.createdIntentDir
26
- ? `Created ${paths.intentDir}/`
27
- : `Kept existing ${paths.intentDir}/`,
28
- "Fill in the scenarios (an authoring copilot does this well), drop raw",
29
- `source material into ${INTENT_DIR}/, then \`apollo scenarios push\`.`,
30
- ].join("\n"));
31
- });
32
- scenarios
33
- .command("pull")
34
- .description(`Pull the agent's evaluation suite into ${SCENARIOS_DIR}/ (latest bundle by default)`)
35
- .option("--bundle <n>", "specific bundle version")
36
- .action(async (options) => {
37
- const run = runtime();
38
- requireCheckout(run);
39
- const result = await pullScenarios(run.context, {
40
- ...(options.bundle === undefined
41
- ? {}
42
- : { bundleVersion: Number(options.bundle) }),
43
- });
44
- run.output.result(result, () => result.found
45
- ? `Pulled bundle v${String(result.version)} — ${String(result.filesCount)} file(s) (${String(result.scenariosCount)} scenario(s)).`
46
- : "No scenarios bundle for this agent yet — `apollo scenarios generate` to start one.");
47
- });
48
- scenarios
49
- .command("push")
50
- .description(`Push ${SCENARIOS_DIR}/ (${SCENARIOS_FILE} + extras) as a new bundle version, then ${SCORES_FILE} when present`)
51
- .option("--notes <text>", "notes stored on the bundle version")
52
- .option("--skip-scores", `push the bundle only, ignore ${SCORES_FILE}`)
53
- .action(async (options) => {
54
- const run = runtime();
55
- const root = requireCheckout(run);
56
- const bundle = await pushScenarioBundle(run.context, {
57
- ...(options.notes === undefined ? {} : { notes: options.notes }),
58
- });
59
- const lines = [
60
- `Pushed bundle v${String(bundle.version)} — ${String(bundle.filesCount)} file(s) (${String(bundle.scenariosCount)} scenario(s)).`,
61
- ];
62
- let scores;
63
- const hasScores = options.skipScores !== true &&
64
- (await readLocalScores(root)) !== undefined;
65
- if (hasScores) {
66
- // The bundle landed; a scores failure must say so, not mask it.
67
- try {
68
- scores = await pushScores(run.context, {
69
- bundleVersion: bundle.version,
70
- });
71
- lines.push(`Pushed scores — ${String(scores.pass)}/${String(scores.total)} pass @ ${scores.versionTag}.`);
72
- }
73
- catch (error) {
74
- throw new ConfigError(`Bundle v${String(bundle.version)} pushed, but the scores push failed: ${error instanceof Error ? error.message : String(error)}`, "Fix scores.json (or the version binding) and re-run `apollo scenarios push`.");
75
- }
76
- }
77
- else if (options.skipScores !== true) {
78
- lines.push(`No ${SCORES_FILE} — bundle only.`);
79
- }
80
- run.output.result({ bundle, ...(scores ? { scores } : {}) }, () => lines.join("\n"));
81
- });
82
- scenarios
83
- .command("scores")
84
- .description(`Show ${SCORES_FILE} (or --pull the newest remote score for the bound version)`)
85
- .option("--pull", "fetch the latest remote score and overwrite the local file")
86
- .action(async (options) => {
87
- const run = runtime();
88
- const root = requireCheckout(run);
89
- if (options.pull === true) {
90
- const pulled = await pullScores(run.context);
91
- run.output.result(pulled, () => pulled.found
92
- ? `Pulled scores — ${String(pulled.pass)}/${String(pulled.total)} pass @ ${pulled.versionTag ?? "?"}.`
93
- : "No scores for this version yet.");
94
- return;
95
- }
96
- const [scores, suite] = await Promise.all([
97
- readLocalScores(root),
98
- readLocalScenarios(root),
99
- ]);
100
- if (!scores) {
101
- run.output.result({ found: false }, () => `No ${SCENARIOS_DIR}/${SCORES_FILE} — run the scoring skill, or \`apollo scenarios scores --pull\`.`);
102
- return;
103
- }
104
- run.output.result(scores, () => {
105
- const rows = scores.scenarios ?? [];
106
- const total = scores.total_scenarios ?? rows.length;
107
- const pass = scores.pass_scenarios ??
108
- rows.filter((row) => row.status === "pass").length;
109
- const lines = [
110
- `${String(pass)}/${String(total)} pass (${String(scores.pass_percentage ?? (total > 0 ? Math.round((pass / total) * 100) : 0))}%) · suite has ${String(suite?.scenarios.length ?? 0)} scenario(s)`,
111
- ];
112
- if (scores.summary)
113
- lines.push(`summary: ${scores.summary}`);
114
- for (const row of rows) {
115
- const attempts = row.k !== undefined
116
- ? ` (${String(row.passed ?? 0)}/${String(row.k)})`
117
- : "";
118
- lines.push(` ${row.status === "pass" ? "✓" : "✕"} ${row.scenario_code}${attempts}${row.comments ? ` — ${row.comments}` : ""}`);
119
- }
120
- return lines.join("\n");
121
- });
122
- });
123
- }
124
- //# sourceMappingURL=scenarios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scenarios.js","sourceRoot":"","sources":["../../../src/commands/scenarios.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,2CAA2C,CAAC;AAGnD,SAAS,eAAe,CAAC,GAAmB;IAC1C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,WAAW,CACnB,sCAAsC,EACtC,iEAAiE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAAgB,EAChB,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO;SACtB,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CACV,mFAAmF,CACpF,CAAC;IAEJ,SAAS;SACN,OAAO,C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ACrD,MAAM,KAAK,GAAG;gBACZ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,eAAe,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,cAAc;aACnM,CAAC;YACF,IAAI,MAAM,CAAC,OAAO;gBAAE,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,QAAQ,GACZ,GAAG,CAAC,CAAC,KAAK,SAAS;oBACjB,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;oBAClD,CAAC,CAAC,EAAE,CAAC;gBACT,KAAK,CAAC,IAAI,CACR,KAAK,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACpH,CAAC;YACJ,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,158 +0,0 @@
1
- import { type BundleUploadFile, type EvaluationScorePush, type ScenarioResult, type ScoreReportBlocks } from "../api/agent-settings.js";
2
- import type { Context } from "../config/index.js";
3
- import { type Clients } from "./clients.js";
4
- export declare const SCENARIOS_DIR = "scenarios";
5
- export declare const SCENARIOS_FILE = "scenarios.json";
6
- export declare const SCORES_FILE = "scores.json";
7
- export declare const INTENT_DIR = "intent";
8
- export interface ScenariosPaths {
9
- dir: string;
10
- intentDir: string;
11
- scenariosFile: string;
12
- scoresFile: string;
13
- }
14
- export declare function scenariosPaths(checkoutRoot: string): ScenariosPaths;
15
- /** A scenario as stored on disk (flat — extra keys at the top level). */
16
- export interface LocalScenario {
17
- code: string;
18
- goal?: string | null;
19
- description?: string | null;
20
- [key: string]: unknown;
21
- }
22
- export interface ScenariosFile {
23
- scenarios: LocalScenario[];
24
- }
25
- /**
26
- * The on-disk `scores.json`. Mirrors the score push body minus the
27
- * server-owned identifiers (version id/tag, bundle version, created_by),
28
- * which are filled at push time. `pass_percentage` is a convenience for
29
- * humans — recomputed on write, ignored on push.
30
- */
31
- export interface LocalScores extends ScoreReportBlocks {
32
- summary?: string | null;
33
- total_scenarios?: number;
34
- pass_scenarios?: number;
35
- pass_percentage?: number;
36
- residuals?: string | null;
37
- scenarios?: ScenarioResult[];
38
- /** Run-level session ids (distinct from per-scenario ones). */
39
- session_ids?: string[];
40
- }
41
- export interface ScenariosServiceOptions {
42
- clients?: Clients;
43
- /** Injected for tests; also used for signed-URL intent downloads. */
44
- fetch?: typeof globalThis.fetch;
45
- }
46
- export declare function readLocalScenarios(checkoutRoot: string): Promise<ScenariosFile | undefined>;
47
- export declare function writeLocalScenarios(checkoutRoot: string, data: ScenariosFile): Promise<void>;
48
- export declare function readLocalScores(checkoutRoot: string): Promise<LocalScores | undefined>;
49
- export declare function writeLocalScores(checkoutRoot: string, data: LocalScores): Promise<void>;
50
- /** Absolute paths of every file directly under `scenarios/intent/`. */
51
- export declare function listIntentFiles(checkoutRoot: string): Promise<string[]>;
52
- /** Every file under `scenarios/` except `scores.json`, as relative POSIX paths. */
53
- export declare function listBundleFiles(checkoutRoot: string): Promise<{
54
- rel: string;
55
- abs: string;
56
- }[]>;
57
- /**
58
- * Pre-flight the suite against the server contract so a push fails here
59
- * with a clear message instead of a remote 422. Returns the scenarios.
60
- */
61
- export declare function validateScenariosFile(file: ScenariosFile): LocalScenario[];
62
- export interface AssembledBundle {
63
- files: BundleUploadFile[];
64
- scenariosCount: number;
65
- }
66
- /**
67
- * Assemble a bundle push from the checkout: the validated suite plus every
68
- * other file under `scenarios/` except `scores.json`. Throws when the suite
69
- * is missing/invalid or a file is too large.
70
- */
71
- export declare function assembleBundleUpload(checkoutRoot: string): Promise<AssembledBundle>;
72
- export interface PushBundleResult {
73
- version: number;
74
- scenariosCount: number;
75
- filesCount: number;
76
- intentsCount: number;
77
- }
78
- /** Push the checkout's scenarios tree as a new bundle version. */
79
- export declare function pushScenarioBundle(context: Context, params?: {
80
- notes?: string;
81
- }, options?: ScenariosServiceOptions): Promise<PushBundleResult>;
82
- /**
83
- * Map the on-disk `scores.json` to the `evaluation-scores/push` body.
84
- * Totals derive from the `scenarios` array when the file doesn't set them.
85
- */
86
- export declare function scoresToPushBody(scores: LocalScores, ids: {
87
- versionId: string;
88
- versionTag?: string;
89
- bundleVersion?: number;
90
- createdBy: string;
91
- }): EvaluationScorePush;
92
- /** Report blocks in display order (subview + docs share it). */
93
- export declare const REPORT_BLOCK_KEYS: readonly ["result", "ground", "skills", "depth", "speed", "grading", "custom", "weaknesses", "ships"];
94
- export interface PushScoresResult {
95
- total: number;
96
- pass: number;
97
- versionTag: string;
98
- }
99
- /**
100
- * Push the checkout's `scores.json` against the version Talk runs would be
101
- * graded on: the bound tag, else the live version (`resolveSendVersion`).
102
- */
103
- export declare function pushScores(context: Context, params?: {
104
- bundleVersion?: number;
105
- }, options?: ScenariosServiceOptions): Promise<PushScoresResult>;
106
- export interface PullScenariosResult {
107
- found: boolean;
108
- version?: number;
109
- scenariosCount?: number;
110
- filesCount?: number;
111
- intentsCount?: number;
112
- }
113
- /**
114
- * Pull the latest (or a specific) bundle into `scenarios/`: downloads every
115
- * file via its signed URL. `found: false` (no throw) when the agent has no
116
- * bundle yet.
117
- */
118
- export declare function pullScenarios(context: Context, params?: {
119
- bundleVersion?: number;
120
- }, options?: ScenariosServiceOptions): Promise<PullScenariosResult>;
121
- export interface PullScoresResult {
122
- found: boolean;
123
- total?: number;
124
- pass?: number;
125
- versionTag?: string;
126
- }
127
- /**
128
- * Pull the newest score for the version Talk runs against (bound tag, else
129
- * live) and write it to `scenarios/scores.json`. `found: false` when the
130
- * version has no scores yet (empty array — not an error).
131
- */
132
- export declare function pullScores(context: Context, options?: ScenariosServiceOptions): Promise<PullScoresResult>;
133
- export interface SyncScenariosResult {
134
- /** True when a bundle was found and written. */
135
- found: boolean;
136
- version?: number;
137
- scenariosCount?: number;
138
- filesCount?: number;
139
- intentsCount?: number;
140
- scoresFound?: boolean;
141
- /** Set when the pull failed; callers note it but do NOT fail. */
142
- error?: string;
143
- }
144
- /**
145
- * Best-effort scenarios pull for `agent import`. NEVER throws — scenarios
146
- * are supplementary, exactly like skills and schemas, so a failure here
147
- * must not break the import.
148
- */
149
- export declare function syncScenarios(context: Context, options?: ScenariosServiceOptions): Promise<SyncScenariosResult>;
150
- export interface ScaffoldResult {
151
- createdScenariosFile: boolean;
152
- createdIntentDir: boolean;
153
- }
154
- /**
155
- * Scaffold `scenarios/` for a fresh start: `intent/` plus a skeleton suite
156
- * — only when missing, never clobbering existing work.
157
- */
158
- export declare function scaffoldScenarios(checkoutRoot: string): Promise<ScaffoldResult>;