@cef-ai/cli 2.7.5 → 2.8.0
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/README.md +15 -0
- package/dist/cli-program.d.ts +2 -0
- package/dist/cli-program.d.ts.map +1 -1
- package/dist/cli-program.js +17 -0
- package/dist/cli-program.js.map +1 -1
- package/dist/commands/cubby.d.ts +7 -0
- package/dist/commands/cubby.d.ts.map +1 -1
- package/dist/commands/cubby.js +8 -4
- package/dist/commands/cubby.js.map +1 -1
- package/dist/commands/eval.d.ts +217 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/eval.js +860 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/eval.test.d.ts +2 -0
- package/dist/commands/eval.test.d.ts.map +1 -0
- package/dist/commands/eval.test.js +474 -0
- package/dist/commands/eval.test.js.map +1 -0
- package/dist/commands/push.d.ts +23 -0
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +70 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/lib/access-token.d.ts +33 -0
- package/dist/lib/access-token.d.ts.map +1 -1
- package/dist/lib/access-token.js +89 -20
- package/dist/lib/access-token.js.map +1 -1
- package/dist/lib/bucket-owner.d.ts +45 -0
- package/dist/lib/bucket-owner.d.ts.map +1 -0
- package/dist/lib/bucket-owner.js +107 -0
- package/dist/lib/bucket-owner.js.map +1 -0
- package/dist/lib/ddc.d.ts +22 -0
- package/dist/lib/ddc.d.ts.map +1 -1
- package/dist/lib/ddc.js +72 -20
- package/dist/lib/ddc.js.map +1 -1
- package/dist/lib/eval-auth.d.ts +139 -0
- package/dist/lib/eval-auth.d.ts.map +1 -0
- package/dist/lib/eval-auth.js +385 -0
- package/dist/lib/eval-auth.js.map +1 -0
- package/dist/lib/eval-auth.test.d.ts +2 -0
- package/dist/lib/eval-auth.test.d.ts.map +1 -0
- package/dist/lib/eval-auth.test.js +192 -0
- package/dist/lib/eval-auth.test.js.map +1 -0
- package/dist/lib/eval-store.d.ts +62 -0
- package/dist/lib/eval-store.d.ts.map +1 -0
- package/dist/lib/eval-store.js +334 -0
- package/dist/lib/eval-store.js.map +1 -0
- package/dist/lib/eval-store.test.d.ts +2 -0
- package/dist/lib/eval-store.test.d.ts.map +1 -0
- package/dist/lib/eval-store.test.js +155 -0
- package/dist/lib/eval-store.test.js.map +1 -0
- package/dist/lib/eval-target.d.ts +122 -0
- package/dist/lib/eval-target.d.ts.map +1 -0
- package/dist/lib/eval-target.js +320 -0
- package/dist/lib/eval-target.js.map +1 -0
- package/dist/lib/eval-target.test.d.ts +2 -0
- package/dist/lib/eval-target.test.d.ts.map +1 -0
- package/dist/lib/eval-target.test.js +209 -0
- package/dist/lib/eval-target.test.js.map +1 -0
- package/dist/lib/eval-workflow.d.ts +24 -0
- package/dist/lib/eval-workflow.d.ts.map +1 -0
- package/dist/lib/eval-workflow.js +91 -0
- package/dist/lib/eval-workflow.js.map +1 -0
- package/package.json +8 -4
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `WorkflowTarget` for Node: runs a deployed workflow the way ROC's Run
|
|
3
|
+
* button does, and reads back how each run ended and what it cost.
|
|
4
|
+
*
|
|
5
|
+
* start publish `workflow.start` into the run's context through
|
|
6
|
+
* vault-api, TARGETED at the workflow agent
|
|
7
|
+
* (`<asPubKey>:<workflowId>`) — untargeted, every workflow in the
|
|
8
|
+
* scope subscribed to the type would start
|
|
9
|
+
* waitForEnd poll the context's events for the runner's own
|
|
10
|
+
* `workflow.completed` / `workflow.failed` (payload.runId =
|
|
11
|
+
* `run-<context>`; a child run in the same context is not ours);
|
|
12
|
+
* report the end event's timestamp and the context's
|
|
13
|
+
* `workflow.start` timestamp — both server clocks, so the run's
|
|
14
|
+
* duration is never measured against this machine's clock
|
|
15
|
+
* metrics orchestrator jobs in the context and their tasks: model-call
|
|
16
|
+
* tokens from each task's `_modelCalls`, agent-reported tokens
|
|
17
|
+
* and cost from each job's `a2aTokens`/`a2aCost`, cpu/gpu from
|
|
18
|
+
* each job's metrics; steps = `workflow.step_ran` events;
|
|
19
|
+
* durationMs = first job createdAt → last job completedAt (the
|
|
20
|
+
* fallback when an event timestamp is missing; null while any
|
|
21
|
+
* job is open)
|
|
22
|
+
* pinVersion a temporary deployment row on the workflow agent, one tier
|
|
23
|
+
* above every other (lowest priority wins), targeting
|
|
24
|
+
* `event.context.startsWith("<prefix>")`, expiring on its own
|
|
25
|
+
* if never released; release deletes it
|
|
26
|
+
*
|
|
27
|
+
* Both clients are injected so the logic is testable without a network.
|
|
28
|
+
*/
|
|
29
|
+
import { type WorkflowTarget } from "@cef-ai/eval";
|
|
30
|
+
export declare const START_EVENT = "workflow.start";
|
|
31
|
+
export declare const COMPLETED_EVENT = "workflow.completed";
|
|
32
|
+
export declare const FAILED_EVENT = "workflow.failed";
|
|
33
|
+
export declare const STEP_RAN_EVENT = "workflow.step_ran";
|
|
34
|
+
export interface StreamEvent {
|
|
35
|
+
type: string;
|
|
36
|
+
payload?: unknown;
|
|
37
|
+
timestamp?: string;
|
|
38
|
+
}
|
|
39
|
+
/** What the target needs from vault-api. */
|
|
40
|
+
export interface VaultPort {
|
|
41
|
+
publish(event: {
|
|
42
|
+
type: string;
|
|
43
|
+
context: string;
|
|
44
|
+
payload: Record<string, unknown>;
|
|
45
|
+
target: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
/** One page of a context's events. */
|
|
48
|
+
events(context: string, cursor?: string): Promise<{
|
|
49
|
+
items: StreamEvent[];
|
|
50
|
+
nextCursor?: string;
|
|
51
|
+
hasMore?: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/** What the target needs from the orchestrator: JSON over a path, with auth applied. */
|
|
55
|
+
export interface OrchestratorPort {
|
|
56
|
+
request(method: "GET" | "PUT" | "DELETE", path: string, body?: unknown): Promise<unknown>;
|
|
57
|
+
}
|
|
58
|
+
export interface NodeTargetOptions {
|
|
59
|
+
vault: VaultPort;
|
|
60
|
+
orchestrator: OrchestratorPort;
|
|
61
|
+
vaultId: string;
|
|
62
|
+
asPubKey: string;
|
|
63
|
+
workflowId: string;
|
|
64
|
+
/** Poll interval while waiting for a run to end. Default 2000 ms. */
|
|
65
|
+
pollMs?: number;
|
|
66
|
+
/** Ceiling of the backoff between polls that failed. Default 30 000 ms. */
|
|
67
|
+
maxBackoffMs?: number;
|
|
68
|
+
/** How long to wait after pinning for every orchestrator to see the row (its cache TTL is 3 s). Default 5000 ms. */
|
|
69
|
+
pinSettleMs?: number;
|
|
70
|
+
/** Re-reads of a context's metrics while its tasks are still open. Default 10. */
|
|
71
|
+
settleAttempts?: number;
|
|
72
|
+
/** A pin that is never released expires after this long. Default 6 h. */
|
|
73
|
+
pinTtlMs?: number;
|
|
74
|
+
sleep?: (ms: number) => Promise<void>;
|
|
75
|
+
now?: () => number;
|
|
76
|
+
}
|
|
77
|
+
/** `<asPubKey>:<workflowId>` — the agent a workflow runs as (ROC's `workflowAgentId`). */
|
|
78
|
+
export declare const workflowAgentId: (asPubKey: string, workflowId: string) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Whether a failed read is worth retrying: network failures and 5xx are; a 4xx
|
|
81
|
+
* is a request that will fail the same way next time (auth, a bad id) — except
|
|
82
|
+
* 408/425/429, which say "later".
|
|
83
|
+
*/
|
|
84
|
+
export declare function isTransient(e: unknown): boolean;
|
|
85
|
+
interface DeploymentRow {
|
|
86
|
+
name: string;
|
|
87
|
+
priority: number;
|
|
88
|
+
targeting: string;
|
|
89
|
+
weight: number;
|
|
90
|
+
version: string;
|
|
91
|
+
params?: Record<string, unknown> | null;
|
|
92
|
+
engagements?: Record<string, unknown>;
|
|
93
|
+
enabled?: boolean;
|
|
94
|
+
expiresAt?: string;
|
|
95
|
+
}
|
|
96
|
+
/** The workflow agent's deployment set, or null when it has none. */
|
|
97
|
+
export declare function getDeploymentSet(orch: OrchestratorPort, agentId: string): Promise<{
|
|
98
|
+
revision?: number;
|
|
99
|
+
deployments: DeploymentRow[];
|
|
100
|
+
} | null>;
|
|
101
|
+
/** The version the workflow's default (empty-targeting) deployment runs. */
|
|
102
|
+
export declare function liveVersion(orch: OrchestratorPort, agentId: string): Promise<string | null>;
|
|
103
|
+
/** How many pages one listing follows before giving up. */
|
|
104
|
+
export declare const MAX_PAGES = 100;
|
|
105
|
+
/**
|
|
106
|
+
* A listing still had more after {@link MAX_PAGES} pages. Not transient:
|
|
107
|
+
* polling again reads the same pages. Thrown rather than returning what was
|
|
108
|
+
* read, so a context too long to read surfaces as an error — a truncated
|
|
109
|
+
* event list would miss the end event and read as a timeout.
|
|
110
|
+
*/
|
|
111
|
+
export declare class TooManyPagesError extends Error {
|
|
112
|
+
constructor(what: string);
|
|
113
|
+
}
|
|
114
|
+
export declare function nodeWorkflowTarget(opts: NodeTargetOptions): WorkflowTarget;
|
|
115
|
+
/** An orchestrator client over fetch with a bearer token. Errors carry `status`. */
|
|
116
|
+
export declare function fetchOrchestrator(opts: {
|
|
117
|
+
endpoint: string;
|
|
118
|
+
accessToken?: string;
|
|
119
|
+
fetchImpl?: typeof fetch;
|
|
120
|
+
}): OrchestratorPort;
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=eval-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-target.d.ts","sourceRoot":"","sources":["../../src/lib/eval-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAyE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1H,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,eAAe,uBAAuB,CAAC;AACpD,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,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AQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,gBAAgB,CAuBnB"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `WorkflowTarget` for Node: runs a deployed workflow the way ROC's Run
|
|
3
|
+
* button does, and reads back how each run ended and what it cost.
|
|
4
|
+
*
|
|
5
|
+
* start publish `workflow.start` into the run's context through
|
|
6
|
+
* vault-api, TARGETED at the workflow agent
|
|
7
|
+
* (`<asPubKey>:<workflowId>`) — untargeted, every workflow in the
|
|
8
|
+
* scope subscribed to the type would start
|
|
9
|
+
* waitForEnd poll the context's events for the runner's own
|
|
10
|
+
* `workflow.completed` / `workflow.failed` (payload.runId =
|
|
11
|
+
* `run-<context>`; a child run in the same context is not ours);
|
|
12
|
+
* report the end event's timestamp and the context's
|
|
13
|
+
* `workflow.start` timestamp — both server clocks, so the run's
|
|
14
|
+
* duration is never measured against this machine's clock
|
|
15
|
+
* metrics orchestrator jobs in the context and their tasks: model-call
|
|
16
|
+
* tokens from each task's `_modelCalls`, agent-reported tokens
|
|
17
|
+
* and cost from each job's `a2aTokens`/`a2aCost`, cpu/gpu from
|
|
18
|
+
* each job's metrics; steps = `workflow.step_ran` events;
|
|
19
|
+
* durationMs = first job createdAt → last job completedAt (the
|
|
20
|
+
* fallback when an event timestamp is missing; null while any
|
|
21
|
+
* job is open)
|
|
22
|
+
* pinVersion a temporary deployment row on the workflow agent, one tier
|
|
23
|
+
* above every other (lowest priority wins), targeting
|
|
24
|
+
* `event.context.startsWith("<prefix>")`, expiring on its own
|
|
25
|
+
* if never released; release deletes it
|
|
26
|
+
*
|
|
27
|
+
* Both clients are injected so the logic is testable without a network.
|
|
28
|
+
*/
|
|
29
|
+
import { emptyMetrics, isObject, runIdOf } from "@cef-ai/eval";
|
|
30
|
+
export const START_EVENT = "workflow.start";
|
|
31
|
+
export const COMPLETED_EVENT = "workflow.completed";
|
|
32
|
+
export const FAILED_EVENT = "workflow.failed";
|
|
33
|
+
export const STEP_RAN_EVENT = "workflow.step_ran";
|
|
34
|
+
/** `<asPubKey>:<workflowId>` — the agent a workflow runs as (ROC's `workflowAgentId`). */
|
|
35
|
+
export const workflowAgentId = (asPubKey, workflowId) => `${asPubKey}:${workflowId}`;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a failed read is worth retrying: network failures and 5xx are; a 4xx
|
|
38
|
+
* is a request that will fail the same way next time (auth, a bad id) — except
|
|
39
|
+
* 408/425/429, which say "later".
|
|
40
|
+
*/
|
|
41
|
+
export function isTransient(e) {
|
|
42
|
+
if (e instanceof TooManyPagesError)
|
|
43
|
+
return false;
|
|
44
|
+
const status = e?.status;
|
|
45
|
+
if (typeof status !== "number")
|
|
46
|
+
return true;
|
|
47
|
+
if (status === 408 || status === 425 || status === 429)
|
|
48
|
+
return true;
|
|
49
|
+
return status < 400 || status >= 500;
|
|
50
|
+
}
|
|
51
|
+
/** An orchestrator timestamp in ms, or null — Go serialises an unset time as year 1. */
|
|
52
|
+
function serverTime(v) {
|
|
53
|
+
if (typeof v !== "string" && typeof v !== "number")
|
|
54
|
+
return null;
|
|
55
|
+
const ms = typeof v === "number" ? v : Date.parse(v);
|
|
56
|
+
return Number.isFinite(ms) && ms > Date.UTC(2000, 0, 1) ? ms : null;
|
|
57
|
+
}
|
|
58
|
+
const message = (e) => (e instanceof Error ? e.message : String(e));
|
|
59
|
+
const num = (v) => (typeof v === "number" && Number.isFinite(v) ? v : 0);
|
|
60
|
+
/** The workflow agent's deployment set, or null when it has none. */
|
|
61
|
+
export async function getDeploymentSet(orch, agentId) {
|
|
62
|
+
try {
|
|
63
|
+
const set = await orch.request("GET", `/api/v1/agents/${encodeURIComponent(agentId)}/deployments`);
|
|
64
|
+
if (!isObject(set) || !Array.isArray(set.deployments))
|
|
65
|
+
return null;
|
|
66
|
+
return set;
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
if (e.status === 404)
|
|
70
|
+
return null;
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** The version the workflow's default (empty-targeting) deployment runs. */
|
|
75
|
+
export async function liveVersion(orch, agentId) {
|
|
76
|
+
const set = await getDeploymentSet(orch, agentId);
|
|
77
|
+
const row = set?.deployments.find((d) => d.targeting === "" && d.enabled !== false);
|
|
78
|
+
return row?.version ?? null;
|
|
79
|
+
}
|
|
80
|
+
/** How many pages one listing follows before giving up. */
|
|
81
|
+
export const MAX_PAGES = 100;
|
|
82
|
+
/**
|
|
83
|
+
* A listing still had more after {@link MAX_PAGES} pages. Not transient:
|
|
84
|
+
* polling again reads the same pages. Thrown rather than returning what was
|
|
85
|
+
* read, so a context too long to read surfaces as an error — a truncated
|
|
86
|
+
* event list would miss the end event and read as a timeout.
|
|
87
|
+
*/
|
|
88
|
+
export class TooManyPagesError extends Error {
|
|
89
|
+
constructor(what) {
|
|
90
|
+
super(`${what} has more than ${MAX_PAGES} pages; stopped reading rather than report a truncated list`);
|
|
91
|
+
this.name = "TooManyPagesError";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function allEvents(vault, context) {
|
|
95
|
+
const out = [];
|
|
96
|
+
let cursor;
|
|
97
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
98
|
+
const res = await vault.events(context, cursor);
|
|
99
|
+
out.push(...(res.items ?? []));
|
|
100
|
+
if (!res.nextCursor || res.hasMore === false)
|
|
101
|
+
return out;
|
|
102
|
+
cursor = res.nextCursor;
|
|
103
|
+
}
|
|
104
|
+
throw new TooManyPagesError(`the event stream of context ${context}`);
|
|
105
|
+
}
|
|
106
|
+
async function pages(fetchPage, field) {
|
|
107
|
+
const out = [];
|
|
108
|
+
let after;
|
|
109
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
110
|
+
const res = await fetchPage(after);
|
|
111
|
+
const items = isObject(res) && Array.isArray(res[field]) ? res[field] : [];
|
|
112
|
+
out.push(...items);
|
|
113
|
+
const next = isObject(res) && typeof res.nextCursor === "string" ? res.nextCursor : undefined;
|
|
114
|
+
if (!next || (isObject(res) && res.hasMore === false))
|
|
115
|
+
return out;
|
|
116
|
+
after = next;
|
|
117
|
+
}
|
|
118
|
+
throw new TooManyPagesError(`the ${field} listing`);
|
|
119
|
+
}
|
|
120
|
+
export function nodeWorkflowTarget(opts) {
|
|
121
|
+
const agentId = workflowAgentId(opts.asPubKey, opts.workflowId);
|
|
122
|
+
const pollMs = opts.pollMs ?? 2000;
|
|
123
|
+
const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
124
|
+
const now = opts.now ?? Date.now;
|
|
125
|
+
const endOf = (events, context) => {
|
|
126
|
+
const mine = (e) => isObject(e.payload) && e.payload.runId === runIdOf(context);
|
|
127
|
+
// The context holds one attempt's one start: its own server timestamp is where the run began.
|
|
128
|
+
const startedAt = events.find((e) => e.type === START_EVENT && e.timestamp)?.timestamp;
|
|
129
|
+
const started = startedAt ? { startedAt } : {};
|
|
130
|
+
const done = events.find((e) => e.type === COMPLETED_EVENT && mine(e));
|
|
131
|
+
if (done) {
|
|
132
|
+
const p = done.payload;
|
|
133
|
+
return {
|
|
134
|
+
status: "done",
|
|
135
|
+
output: (p.output ?? null),
|
|
136
|
+
...(typeof p.outcome === "string" ? { outcome: p.outcome } : {}),
|
|
137
|
+
...(done.timestamp ? { endedAt: done.timestamp } : {}),
|
|
138
|
+
...started,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const failed = events.find((e) => e.type === FAILED_EVENT && mine(e));
|
|
142
|
+
if (failed) {
|
|
143
|
+
const err = failed.payload.error;
|
|
144
|
+
return {
|
|
145
|
+
status: "failed",
|
|
146
|
+
error: typeof err?.message === "string" ? err.message : "the run failed",
|
|
147
|
+
...(failed.timestamp ? { endedAt: failed.timestamp } : {}),
|
|
148
|
+
...started,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
};
|
|
153
|
+
const target = {
|
|
154
|
+
async start(input, context) {
|
|
155
|
+
await opts.vault.publish({ type: START_EVENT, context, payload: input, target: agentId });
|
|
156
|
+
},
|
|
157
|
+
/*
|
|
158
|
+
* A FAILED POLL IS NOT A FAILED RUN. Minutes of waiting must survive a
|
|
159
|
+
* vault-api blip: a transient error (network, 5xx, 429) backs off —
|
|
160
|
+
* doubling from the poll interval, capped — and polls again until the
|
|
161
|
+
* deadline. Only a request that cannot succeed (another 4xx) is thrown at
|
|
162
|
+
* once; and a vault still failing at the deadline is thrown with its last
|
|
163
|
+
* error, so the run reads as "could not read how it ended" (`error`), not
|
|
164
|
+
* as a workflow that took too long (`timeout`).
|
|
165
|
+
*/
|
|
166
|
+
async waitForEnd(context, timeoutMs) {
|
|
167
|
+
const deadline = now() + timeoutMs;
|
|
168
|
+
let failures = 0;
|
|
169
|
+
for (;;) {
|
|
170
|
+
try {
|
|
171
|
+
const events = await allEvents(opts.vault, context);
|
|
172
|
+
failures = 0;
|
|
173
|
+
const end = endOf(events, context);
|
|
174
|
+
if (end)
|
|
175
|
+
return end;
|
|
176
|
+
if (now() >= deadline)
|
|
177
|
+
return { status: "timeout", error: `no workflow.completed or workflow.failed within ${timeoutMs} ms` };
|
|
178
|
+
}
|
|
179
|
+
catch (e) {
|
|
180
|
+
if (!isTransient(e))
|
|
181
|
+
throw e;
|
|
182
|
+
failures++;
|
|
183
|
+
if (now() >= deadline) {
|
|
184
|
+
throw new Error(`the vault kept failing until the ${timeoutMs} ms deadline (${failures} failed polls); last: ${message(e)}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const wait = failures ? Math.min(pollMs * 2 ** failures, opts.maxBackoffMs ?? 30_000) : pollMs;
|
|
188
|
+
await sleep(Math.min(wait, Math.max(0, deadline - now())));
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
/*
|
|
192
|
+
* SETTLED FIGURES ONLY. `workflow.completed` is published from INSIDE the
|
|
193
|
+
* runner's last task, and that task's model calls land on its row in the
|
|
194
|
+
* terminal transaction after the handler returns — so read too early and
|
|
195
|
+
* the last step's tokens are missing. Re-read while any task is still open.
|
|
196
|
+
*/
|
|
197
|
+
async metrics(context) {
|
|
198
|
+
for (let attempt = 1;; attempt++) {
|
|
199
|
+
const { metrics, open } = await readMetrics(context);
|
|
200
|
+
if (!open || attempt >= (opts.settleAttempts ?? 10))
|
|
201
|
+
return metrics;
|
|
202
|
+
await sleep(pollMs);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
async function readMetrics(context) {
|
|
207
|
+
const m = emptyMetrics();
|
|
208
|
+
let open = false;
|
|
209
|
+
const jobs = await pages((after) => opts.orchestrator.request("GET", `/api/v1/jobs?${new URLSearchParams({
|
|
210
|
+
vaultId: opts.vaultId, context, limit: "100", ...(after ? { after } : {}),
|
|
211
|
+
})}`), "jobs");
|
|
212
|
+
let a2aTokens = 0;
|
|
213
|
+
let tasksSeen = 0;
|
|
214
|
+
// Server-side span of the context's jobs: the duration fallback.
|
|
215
|
+
let first = Infinity;
|
|
216
|
+
let last = -Infinity;
|
|
217
|
+
let unfinished = jobs.length === 0;
|
|
218
|
+
for (const job of jobs) {
|
|
219
|
+
const created = serverTime(job.createdAt);
|
|
220
|
+
const completed = serverTime(job.completedAt);
|
|
221
|
+
if (created === null || completed === null)
|
|
222
|
+
unfinished = true;
|
|
223
|
+
else {
|
|
224
|
+
first = Math.min(first, created);
|
|
225
|
+
last = Math.max(last, completed);
|
|
226
|
+
}
|
|
227
|
+
a2aTokens += num(job.a2aTokens);
|
|
228
|
+
m.cost += num(job.a2aCost);
|
|
229
|
+
const jm = isObject(job.metrics) ? job.metrics : {};
|
|
230
|
+
m.cpuUnits += num(jm.cpuUnits);
|
|
231
|
+
m.gpuUnits += num(jm.gpuUnits);
|
|
232
|
+
const jobId = String(job.jobId ?? "");
|
|
233
|
+
if (!jobId)
|
|
234
|
+
continue;
|
|
235
|
+
const tasks = await pages((after) => opts.orchestrator.request("GET", `/api/v1/jobs/${encodeURIComponent(jobId)}/tasks?${new URLSearchParams({
|
|
236
|
+
limit: "100", ...(after ? { after } : {}),
|
|
237
|
+
})}`), "tasks");
|
|
238
|
+
tasksSeen += tasks.length;
|
|
239
|
+
for (const task of tasks) {
|
|
240
|
+
if (task.status === "queued" || task.status === "running")
|
|
241
|
+
open = true;
|
|
242
|
+
const calls = isObject(task.result) && Array.isArray(task.result._modelCalls) ? task.result._modelCalls : [];
|
|
243
|
+
for (const call of calls) {
|
|
244
|
+
if (!isObject(call))
|
|
245
|
+
continue;
|
|
246
|
+
m.modelCalls++;
|
|
247
|
+
m.inputTokens += num(call.inputTokens);
|
|
248
|
+
m.outputTokens += num(call.outputTokens);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
m.totalTokens = m.inputTokens + m.outputTokens + a2aTokens;
|
|
253
|
+
const ran = (await allEvents(opts.vault, context)).filter((e) => e.type === STEP_RAN_EVENT).length;
|
|
254
|
+
m.steps = ran || tasksSeen;
|
|
255
|
+
if (!unfinished && last >= first)
|
|
256
|
+
m.durationMs = last - first;
|
|
257
|
+
return { metrics: m, open };
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
...target,
|
|
261
|
+
async pinVersion(version, contextPrefix) {
|
|
262
|
+
const set = await getDeploymentSet(opts.orchestrator, agentId);
|
|
263
|
+
if (!set || set.deployments.length === 0) {
|
|
264
|
+
throw new Error(`workflow agent ${agentId} has no deployment set — deploy it once before evaluating a version`);
|
|
265
|
+
}
|
|
266
|
+
const live = set.deployments.find((d) => d.targeting === "") ?? set.deployments[0];
|
|
267
|
+
const name = `eval-${contextPrefix.replace(/^eval-/, "").replace(/-+$/, "")}`.toLowerCase().slice(0, 63);
|
|
268
|
+
// Carry the live row's non-graph params (connections, settings): the
|
|
269
|
+
// graph itself comes from the candidate version's manifest.
|
|
270
|
+
const { graph: _graph, canvas: _canvas, ...params } = (live.params ?? {});
|
|
271
|
+
const row = {
|
|
272
|
+
name,
|
|
273
|
+
priority: Math.min(...set.deployments.map((d) => num(d.priority))) - 1,
|
|
274
|
+
targeting: `event.context.startsWith(${JSON.stringify(contextPrefix)})`,
|
|
275
|
+
weight: 1,
|
|
276
|
+
version,
|
|
277
|
+
params,
|
|
278
|
+
...(live.engagements ? { engagements: live.engagements } : {}),
|
|
279
|
+
expiresAt: new Date(now() + (opts.pinTtlMs ?? 6 * 3600_000)).toISOString(),
|
|
280
|
+
};
|
|
281
|
+
await opts.orchestrator.request("PUT", `/api/v1/agents/${encodeURIComponent(agentId)}/deployments/${name}`, {
|
|
282
|
+
deployment: row,
|
|
283
|
+
author: "cef eval",
|
|
284
|
+
note: `evaluation pin: ${contextPrefix}* → ${version}`,
|
|
285
|
+
});
|
|
286
|
+
await sleep(opts.pinSettleMs ?? 5000);
|
|
287
|
+
return async () => {
|
|
288
|
+
await opts.orchestrator.request("DELETE", `/api/v1/agents/${encodeURIComponent(agentId)}/deployments/${name}?${new URLSearchParams({
|
|
289
|
+
author: "cef eval", note: `evaluation finished: ${contextPrefix}*`,
|
|
290
|
+
})}`);
|
|
291
|
+
};
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/** An orchestrator client over fetch with a bearer token. Errors carry `status`. */
|
|
296
|
+
export function fetchOrchestrator(opts) {
|
|
297
|
+
const base = opts.endpoint.replace(/\/+$/, "");
|
|
298
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
299
|
+
return {
|
|
300
|
+
async request(method, path, body) {
|
|
301
|
+
const res = await fetchImpl(`${base}${path}`, {
|
|
302
|
+
method,
|
|
303
|
+
headers: {
|
|
304
|
+
Accept: "application/json",
|
|
305
|
+
...(body !== undefined ? { "Content-Type": "application/json" } : {}),
|
|
306
|
+
...(opts.accessToken ? { Authorization: `Bearer ${opts.accessToken}` } : {}),
|
|
307
|
+
},
|
|
308
|
+
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
|
|
309
|
+
});
|
|
310
|
+
const text = await res.text();
|
|
311
|
+
if (!res.ok) {
|
|
312
|
+
const err = new Error(`[cef eval] ${method} ${path} → ${res.status}: ${text.slice(0, 300)}`);
|
|
313
|
+
err.status = res.status;
|
|
314
|
+
throw err;
|
|
315
|
+
}
|
|
316
|
+
return text ? JSON.parse(text) : null;
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=eval-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-target.js","sourceRoot":"","sources":["../../src/lib/eval-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAA6D,MAAM,cAAc,CAAC;AAE1H,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAwClD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,UAAkB,EAAU,EAAE,CAAC,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAC;AAE7G;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,CAAU;IACpC,IAAI,CAAC,YAAY,iBAAiB;QAAE,OAAO,KAAK,CAAC;IACjD,MAAM,MAAM,GAAI,CAAiC,EAAE,MAAM,CAAC;IAC1D,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACpE,OAAO,MAAM,GAAG,GAAG,IAAI,MA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