@skrr-ai/cli 0.1.231 → 0.1.233
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 +42 -4
- package/bin/dev.cjs +4 -1
- package/bin/run.js +0 -15
- package/dist/base-command.d.ts +6 -11
- package/dist/base-command.js +34 -43
- package/dist/commands/agenda/plan.d.ts +2 -1
- package/dist/commands/agenda/plan.js +18 -4
- package/dist/commands/agent/message/context.d.ts +2 -0
- package/dist/commands/agent/message/context.js +18 -3
- package/dist/commands/agent/message/list.d.ts +22 -0
- package/dist/commands/agent/message/list.js +66 -0
- package/dist/commands/agent/message/send.d.ts +1 -1
- package/dist/commands/agent/message/send.js +1 -3
- package/dist/commands/agent/message/show.d.ts +14 -0
- package/dist/commands/agent/message/show.js +39 -0
- package/dist/commands/agents/chat.d.ts +4 -0
- package/dist/commands/agents/chat.js +79 -17
- package/dist/commands/agents/eval/list.d.ts +4 -0
- package/dist/commands/agents/eval/list.js +33 -0
- package/dist/commands/agents/eval/show.d.ts +1 -0
- package/dist/commands/agents/eval/show.js +19 -0
- package/dist/commands/agents/intuitions/generate.js +1 -1
- package/dist/commands/agents/intuitions/list.js +1 -1
- package/dist/commands/agents/permissions/policy.js +25 -2
- package/dist/commands/agents/spawn.js +61 -24
- package/dist/commands/agents/triggers/fire.js +1 -1
- package/dist/commands/agents/triggers/runs.js +3 -0
- package/dist/commands/code/acp.js +1 -1
- package/dist/commands/code/handover.d.ts +3 -3
- package/dist/commands/code/handover.js +12 -12
- package/dist/commands/code/index.d.ts +3 -8
- package/dist/commands/code/index.js +15 -21
- package/dist/commands/code/jobs/approve.d.ts +1 -11
- package/dist/commands/code/jobs/approve.js +3 -15
- package/dist/commands/code/jobs/cancel.js +3 -2
- package/dist/commands/code/jobs/index.js +1 -1
- package/dist/commands/code/jobs/list.js +4 -11
- package/dist/commands/code/jobs/run.js +13 -7
- package/dist/commands/code/jobs/show.js +52 -6
- package/dist/commands/code/run.js +1 -1
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +5 -1
- package/dist/commands/context.d.ts +1 -0
- package/dist/commands/context.js +1 -0
- package/dist/commands/duties/catalog/add.d.ts +18 -0
- package/dist/commands/duties/catalog/add.js +52 -0
- package/dist/commands/duties/catalog/index.d.ts +18 -0
- package/dist/commands/duties/catalog/index.js +88 -0
- package/dist/commands/duties/receipt.js +56 -1
- package/dist/commands/goals/plan-now.d.ts +5 -3
- package/dist/commands/goals/plan-now.js +21 -16
- package/dist/commands/goals/planner-compare.js +5 -3
- package/dist/commands/instructions/discovery.d.ts +10 -0
- package/dist/commands/instructions/discovery.js +74 -0
- package/dist/commands/runs/admission.d.ts +12 -0
- package/dist/commands/runs/admission.js +66 -0
- package/dist/commands/runs/events.d.ts +16 -0
- package/dist/commands/runs/events.js +89 -0
- package/dist/commands/runs/list.d.ts +27 -0
- package/dist/commands/runs/list.js +151 -0
- package/dist/commands/runs/show.d.ts +14 -0
- package/dist/commands/runs/show.js +273 -0
- package/dist/commands/runs/stop.d.ts +15 -0
- package/dist/commands/runs/stop.js +105 -0
- package/dist/commands/runs/transcript.d.ts +19 -0
- package/dist/commands/runs/transcript.js +178 -0
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +6 -4
- package/dist/commands/tasks/attachments/source.d.ts +6 -0
- package/dist/commands/tasks/attachments/source.js +18 -0
- package/dist/commands/tasks/chat/exchange.d.ts +0 -14
- package/dist/commands/tasks/chat/exchange.js +8 -39
- package/dist/commands/tasks/chat/reply-run.d.ts +15 -0
- package/dist/commands/tasks/chat/reply-run.js +69 -0
- package/dist/commands/tasks/complete.js +1 -1
- package/dist/commands/tasks/lifecycle/transition.d.ts +1 -0
- package/dist/commands/tasks/lifecycle/transition.js +51 -13
- package/dist/commands/tasks/operations/show.js +5 -0
- package/dist/commands/tasks/result/submit.js +4 -2
- package/dist/commands/tasks/retry.js +25 -16
- package/dist/commands/tasks/runs.js +7 -0
- package/dist/commands/tasks/start-receipt.js +8 -8
- package/dist/commands/tasks/start.js +12 -1
- package/dist/commands/triggers/audit.js +3 -1
- package/dist/commands/triggers/fire-detail.js +4 -1
- package/dist/commands/triggers/fire.js +1 -1
- package/dist/commands/usage.d.ts +1 -0
- package/dist/commands/usage.js +1 -0
- package/dist/generated/agent-guides.json +350 -777
- package/dist/help.d.ts +2 -7
- package/dist/help.js +13 -7
- package/dist/hooks/init.js +10 -0
- package/dist/lib/agent-chat-queue.d.ts +2 -1
- package/dist/lib/agent-chat-queue.js +26 -21
- package/dist/lib/agent-evals.d.ts +1 -1
- package/dist/lib/agent-evals.js +13 -3
- package/dist/lib/agent-guides.d.ts +3 -5
- package/dist/lib/agent-guides.js +12 -13
- package/dist/lib/agent-runs.d.ts +101 -0
- package/dist/lib/agent-runs.js +350 -0
- package/dist/lib/agentic-stream.d.ts +13 -1
- package/dist/lib/agentic-stream.js +165 -81
- package/dist/lib/api-fetch.d.ts +4 -2
- package/dist/lib/api-fetch.js +11 -5
- package/dist/lib/code-handover.d.ts +2 -3
- package/dist/lib/code-handover.js +4 -6
- package/dist/lib/command-manifest.d.ts +1 -6
- package/dist/lib/command-manifest.js +86 -13
- package/dist/lib/communication-history.d.ts +27 -0
- package/dist/lib/communication-history.js +45 -0
- package/dist/lib/config.d.ts +2 -3
- package/dist/lib/config.js +2 -3
- package/dist/lib/duties.d.ts +5 -1
- package/dist/lib/duties.js +4 -0
- package/dist/lib/execution-history.d.ts +34 -0
- package/dist/lib/execution-history.js +7 -0
- package/dist/lib/first-party-harness-broker.d.ts +1 -1
- package/dist/lib/first-party-harness-broker.js +3 -5
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/format.js +18 -0
- package/dist/lib/guide-pointer.d.ts +5 -1
- package/dist/lib/guide-pointer.js +21 -2
- package/dist/lib/hosted-job-status.d.ts +4 -0
- package/dist/lib/hosted-job-status.js +19 -0
- package/dist/lib/inbound-messages.d.ts +2 -0
- package/dist/lib/inbound-messages.js +5 -0
- package/dist/lib/intuition-look.js +20 -4
- package/dist/lib/memory-history-session.d.ts +8 -4
- package/dist/lib/memory-history-session.js +30 -23
- package/dist/lib/roles.d.ts +2 -2
- package/dist/lib/schedule.d.ts +4 -0
- package/dist/lib/schedule.js +4 -3
- package/dist/lib/task-agent-run.d.ts +4 -0
- package/dist/lib/task-agent-run.js +15 -0
- package/dist/lib/task-execution.d.ts +1 -1
- package/dist/lib/task-execution.js +3 -19
- package/dist/lib/task-extras.d.ts +11 -1
- package/dist/lib/task-extras.js +15 -1
- package/dist/lib/task-transcript.js +3 -8
- package/dist/lib/triggers.d.ts +5 -36
- package/dist/lib/triggers.js +48 -33
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +40 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessCommand.d.ts +37 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessCommand.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +56 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +34 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessCommand.d.ts +37 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessCommand.js +57 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +12259 -12160
- package/docs/v1/quickstart.md +18 -0
- package/oclif.manifest.json +3405 -2112
- package/package.json +6 -2
- package/skills/skrr/SKILL.md +14 -0
- package/dist/commands/triggers/runs.d.ts +0 -22
- package/dist/commands/triggers/runs.js +0 -58
package/dist/help.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Help } from '@oclif/core';
|
|
1
|
+
import { Help, type Command } from '@oclif/core';
|
|
2
2
|
/**
|
|
3
3
|
* Make `--help` on a command that does not exist say the same thing running it
|
|
4
4
|
* says.
|
|
@@ -35,12 +35,7 @@ import { Help } from '@oclif/core';
|
|
|
35
35
|
* for people who already knew.
|
|
36
36
|
*/
|
|
37
37
|
export default class SkrrHelp extends Help {
|
|
38
|
-
/**
|
|
39
|
-
* The two commands, before the topic list rather than after it.
|
|
40
|
-
*
|
|
41
|
-
* Deliberately not a tutorial: two lines, both runnable, in the order a new
|
|
42
|
-
* machine needs them.
|
|
43
|
-
*/
|
|
44
38
|
protected showRootHelp(): Promise<void>;
|
|
39
|
+
showCommandHelp(command: Command.Loadable): Promise<void>;
|
|
45
40
|
showHelp(argv: string[]): Promise<void>;
|
|
46
41
|
}
|
package/dist/help.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const command_miss_1 = require("./lib/command-miss");
|
|
5
|
+
const guide_pointer_1 = require("./lib/guide-pointer");
|
|
5
6
|
/**
|
|
6
7
|
* Make `--help` on a command that does not exist say the same thing running it
|
|
7
8
|
* says.
|
|
@@ -38,20 +39,25 @@ const command_miss_1 = require("./lib/command-miss");
|
|
|
38
39
|
* for people who already knew.
|
|
39
40
|
*/
|
|
40
41
|
class SkrrHelp extends core_1.Help {
|
|
41
|
-
/**
|
|
42
|
-
* The two commands, before the topic list rather than after it.
|
|
43
|
-
*
|
|
44
|
-
* Deliberately not a tutorial: two lines, both runnable, in the order a new
|
|
45
|
-
* machine needs them.
|
|
46
|
-
*/
|
|
47
42
|
async showRootHelp() {
|
|
48
43
|
this.log('GETTING STARTED');
|
|
49
|
-
this.log(' skrr
|
|
44
|
+
this.log(' skrr context --json Before writing, check sign-in, bound Agent or Task, and who Task writes are attributed to.');
|
|
45
|
+
this.log(' skrr login Sign in from your own terminal. Offers to install the background service.');
|
|
50
46
|
this.log(' skrr daemon install Install the background service by hand (fetches the signed release).');
|
|
51
47
|
this.log(" skrr guide Read a Skrr domain's guide before you write in it.");
|
|
48
|
+
this.log(' skrr instructions discovery --provider codex Let a new coding agent discover Skrr in this project.');
|
|
52
49
|
this.log('');
|
|
53
50
|
return super.showRootHelp();
|
|
54
51
|
}
|
|
52
|
+
async showCommandHelp(command) {
|
|
53
|
+
const guide = (0, guide_pointer_1.agentGuidePointerForCommand)(command.id);
|
|
54
|
+
if (guide) {
|
|
55
|
+
this.log((0, guide_pointer_1.agentGuidePointerLine)(guide));
|
|
56
|
+
this.log(`Read this when ${guide.readWhen}.`);
|
|
57
|
+
this.log('');
|
|
58
|
+
}
|
|
59
|
+
return super.showCommandHelp(command);
|
|
60
|
+
}
|
|
55
61
|
async showHelp(argv) {
|
|
56
62
|
// Resolve the id exactly as running the same words would — a word after a
|
|
57
63
|
// command that takes arguments is an argument, not part of the name
|
package/dist/hooks/init.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_1 = require("../lib/config");
|
|
4
|
+
const keychain_1 = require("../lib/keychain");
|
|
4
5
|
const update_check_1 = require("../lib/update-check");
|
|
5
6
|
const turn_context_1 = require("../lib/turn-context");
|
|
6
7
|
/** All commands pass through this hook, including the local code/daemon
|
|
@@ -18,6 +19,15 @@ const hook = async function (options) {
|
|
|
18
19
|
...(options.id ?? '').split(':').filter(Boolean),
|
|
19
20
|
...(options.argv ?? process.argv.slice(2)),
|
|
20
21
|
];
|
|
22
|
+
try {
|
|
23
|
+
(0, keychain_1.selectActiveProfile)((0, keychain_1.resolveProfileFromArgv)(argv));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
// Local commands can write configuration without passing through BaseCommand.
|
|
27
|
+
this.error(error.message, { exit: 64 });
|
|
28
|
+
}
|
|
29
|
+
if (process.env.OVERSKY_AUTONOMOUS_SESSION !== '1')
|
|
30
|
+
(0, config_1.seedWorkspaceEnv)();
|
|
21
31
|
if (!(0, update_check_1.shouldCheckCliUpdateAtStartup)(argv, !!process.stderr.isTTY && !!process.stdin.isTTY))
|
|
22
32
|
return;
|
|
23
33
|
try {
|
|
@@ -9,6 +9,7 @@ export interface QueuedTurn {
|
|
|
9
9
|
clientInputId: string;
|
|
10
10
|
sessionId: string;
|
|
11
11
|
responseMessageId: string;
|
|
12
|
+
runId?: string;
|
|
12
13
|
submitted: TConversationInputQueueSubmitResponse;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -26,7 +27,7 @@ export declare function queueAgentChatTurn(params: AgenticChatParams & {
|
|
|
26
27
|
}): Promise<QueuedTurn>;
|
|
27
28
|
export type QueuedTurnWait = {
|
|
28
29
|
outcome: 'sent';
|
|
29
|
-
turn?: Pick<QueuedTurn, 'sessionId' | 'responseMessageId'>;
|
|
30
|
+
turn?: Pick<QueuedTurn, 'sessionId' | 'responseMessageId' | 'runId'>;
|
|
30
31
|
} | {
|
|
31
32
|
outcome: 'held';
|
|
32
33
|
card: TConversationInputQueueCard;
|
|
@@ -22,6 +22,7 @@ exports.renderQueue = renderQueue;
|
|
|
22
22
|
*/
|
|
23
23
|
const node_crypto_1 = require("node:crypto");
|
|
24
24
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
25
|
+
const agent_runs_1 = require("./agent-runs");
|
|
25
26
|
const agent_chat_start_1 = require("./agent-chat-start");
|
|
26
27
|
const http_error_1 = require("./http-error");
|
|
27
28
|
const input_queue_1 = require("./input-queue");
|
|
@@ -107,32 +108,36 @@ async function waitForQueuedTurn(turn, { timeoutMs, onPaused, onPosition, deps =
|
|
|
107
108
|
lastPosition = index;
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
111
|
+
const current = snapshot.turn;
|
|
112
|
+
const sameSession = current?.sessionId === turn.sessionId;
|
|
113
|
+
const active = sameSession
|
|
114
|
+
? { sessionId: turn.sessionId, responseMessageId: current?.responseMessageId ?? turn.responseMessageId }
|
|
115
|
+
: current?.userMessageId === turn.clientInputId && current.responseMessageId
|
|
116
|
+
? { sessionId: current.sessionId, responseMessageId: current.responseMessageId }
|
|
117
|
+
: null;
|
|
118
|
+
const currentRunId = (0, agent_runs_1.canonicalRunId)(current?.runId);
|
|
119
|
+
if (active && currentRunId)
|
|
120
|
+
return { outcome: 'sent', turn: { ...active, runId: currentRunId } };
|
|
121
|
+
// The live queue can show an accepted session before it projects that
|
|
122
|
+
// Run ID. The admitted user message carries its exact turn coordinates.
|
|
123
|
+
const reading = messages(turn.conversationId);
|
|
124
|
+
const rows = active ? await reading.catch(() => undefined) : await reading;
|
|
123
125
|
if (Array.isArray(rows)) {
|
|
124
|
-
if (rows.some((m) => m.messageId === turn.responseMessageId)) {
|
|
125
|
-
return { outcome: 'sent' };
|
|
126
|
-
}
|
|
127
|
-
// A replay may be waiting under IDs reserved by an earlier invocation.
|
|
128
|
-
// The admitted input names its own session and reply once it starts.
|
|
129
126
|
const input = rows.find((m) => m.messageId === turn.clientInputId && m.isCreatedByUser === true);
|
|
130
127
|
const metadata = input?.metadata;
|
|
131
|
-
const { sessionId, responseMessageId } = metadata?.agentic ?? {};
|
|
132
|
-
if (typeof sessionId === 'string' && typeof responseMessageId === 'string'
|
|
133
|
-
|
|
128
|
+
const { sessionId, responseMessageId, canonicalRunId: acceptedRunId } = metadata?.agentic ?? {};
|
|
129
|
+
if (typeof sessionId === 'string' && typeof responseMessageId === 'string' &&
|
|
130
|
+
(!active || (sessionId === active.sessionId && responseMessageId === active.responseMessageId))) {
|
|
131
|
+
const runId = (0, agent_runs_1.canonicalRunId)(acceptedRunId);
|
|
132
|
+
if (!active || runId) {
|
|
133
|
+
return { outcome: 'sent', turn: { sessionId, responseMessageId, ...(runId ? { runId } : {}) } };
|
|
134
|
+
}
|
|
134
135
|
}
|
|
136
|
+
if (!active && rows.some((m) => m.messageId === turn.responseMessageId))
|
|
137
|
+
return { outcome: 'sent' };
|
|
135
138
|
}
|
|
139
|
+
if (active)
|
|
140
|
+
return { outcome: 'sent', ...(!sameSession ? { turn: active } : {}) };
|
|
136
141
|
goneFor += 1;
|
|
137
142
|
if (goneFor >= SETTLE_POLLS)
|
|
138
143
|
return { outcome: 'not_sent' };
|
|
@@ -21,7 +21,7 @@ export declare function readEvalCases(casesPath: string): ReleaseEvalCase[];
|
|
|
21
21
|
* newest release. Releases arrive newest first.
|
|
22
22
|
*/
|
|
23
23
|
export declare function pickRelease(releases: AgentRelease[], wanted?: string): AgentRelease | undefined;
|
|
24
|
-
/** The planned trials that
|
|
24
|
+
/** The planned trials that can still run, in run order. */
|
|
25
25
|
export declare function pendingTrials(evaluation: AgentReleaseEval): ReleaseEvalTrialPlanEntry[];
|
|
26
26
|
export declare function describeTrialLine(evaluation: AgentReleaseEval, trial: ReleaseEvalTrial, position: number, total: number, replayed?: boolean): string;
|
|
27
27
|
export declare function describeEvalHeader(evaluation: AgentReleaseEval): string[];
|
package/dist/lib/agent-evals.js
CHANGED
|
@@ -138,9 +138,9 @@ function pickRelease(releases, wanted) {
|
|
|
138
138
|
const label = wanted.replace(PICK_RELEASE_RE, '');
|
|
139
139
|
return releases.find((release) => release.id === wanted || release.versionLabel === label);
|
|
140
140
|
}
|
|
141
|
-
/** The planned trials that
|
|
141
|
+
/** The planned trials that can still run, in run order. */
|
|
142
142
|
function pendingTrials(evaluation) {
|
|
143
|
-
const done = new Set((evaluation.trials ?? []).filter((t) => t.state === 'completed').map((t) => t.key));
|
|
143
|
+
const done = new Set((evaluation.trials ?? []).filter((t) => t.state === 'completed' || t.state === 'cancelled').map((t) => t.key));
|
|
144
144
|
return (0, data_provider_1.releaseEvalTrialPlan)({
|
|
145
145
|
cases: evaluation.cases,
|
|
146
146
|
trialsPerCase: evaluation.trialsPerCase,
|
|
@@ -198,12 +198,13 @@ function describeEvalHeader(evaluation) {
|
|
|
198
198
|
/** The comparison, the per-case table, and the provenance lines. */
|
|
199
199
|
function describeEvalReport(evaluation) {
|
|
200
200
|
const { summary } = evaluation;
|
|
201
|
+
const stopped = evaluation.trials?.filter(({ state }) => state === 'cancelled').length ?? 0;
|
|
201
202
|
const provenance = (0, data_provider_1.describeReleaseEvalProvenance)(evaluation);
|
|
202
203
|
const lines = [
|
|
203
204
|
...describeEvalHeader(evaluation),
|
|
204
205
|
` Status: ${evaluation.status}${evaluation.status === 'running'
|
|
205
206
|
? ` — ${summary.recordedTrials} of ${summary.expectedTrials} trials graded`
|
|
206
|
-
: ''}`,
|
|
207
|
+
: ''}${stopped ? ` · ${stopped} stopped` : ''}`,
|
|
207
208
|
'',
|
|
208
209
|
` ${''.padEnd(18)} ${'pass rate'.padEnd(16)} ${'cost/run'.padStart(10)} ${'total cost'.padStart(12)}`,
|
|
209
210
|
armRow(armLabel(evaluation, 'candidate'), summary.candidate),
|
|
@@ -273,6 +274,11 @@ async function runEvalTrial(client, entry) {
|
|
|
273
274
|
const sleep = client.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
274
275
|
const now = client.now ?? (() => Date.now());
|
|
275
276
|
const deadline = now() + exports.EVAL_TRIAL_OBSERVE_LIMIT_MS;
|
|
277
|
+
const rejectCancellation = (trial) => {
|
|
278
|
+
if (trial?.state === 'cancelled') {
|
|
279
|
+
throw new EvalTrialFailedError(entry.key, `Trial ${entry.key} was stopped`);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
276
282
|
let started;
|
|
277
283
|
try {
|
|
278
284
|
started = await client.start(entry);
|
|
@@ -281,6 +287,7 @@ async function runEvalTrial(client, entry) {
|
|
|
281
287
|
if (!isTrialStillRunningError(error))
|
|
282
288
|
throw error;
|
|
283
289
|
}
|
|
290
|
+
rejectCancellation(started?.trial);
|
|
284
291
|
if (started?.trial.state === 'completed') {
|
|
285
292
|
return { trial: started.trial, evaluation: started.evaluation, replayed: started.replayed };
|
|
286
293
|
}
|
|
@@ -304,6 +311,7 @@ async function runEvalTrial(client, entry) {
|
|
|
304
311
|
continue;
|
|
305
312
|
}
|
|
306
313
|
const trial = (evaluation.trials ?? []).find((t) => t.key === entry.key);
|
|
314
|
+
rejectCancellation(trial);
|
|
307
315
|
if (trial?.state === 'completed') {
|
|
308
316
|
return { trial, evaluation, replayed: false };
|
|
309
317
|
}
|
|
@@ -315,6 +323,7 @@ async function runEvalTrial(client, entry) {
|
|
|
315
323
|
restartedLostStart = true;
|
|
316
324
|
try {
|
|
317
325
|
const restarted = await client.start(entry);
|
|
326
|
+
rejectCancellation(restarted.trial);
|
|
318
327
|
if (restarted.trial.state === 'completed') {
|
|
319
328
|
return {
|
|
320
329
|
trial: restarted.trial,
|
|
@@ -341,6 +350,7 @@ async function runEvalTrial(client, entry) {
|
|
|
341
350
|
// The run behind the claim is gone; starting again retakes it.
|
|
342
351
|
try {
|
|
343
352
|
const retaken = await client.start(entry);
|
|
353
|
+
rejectCancellation(retaken.trial);
|
|
344
354
|
if (retaken.trial.state === 'completed') {
|
|
345
355
|
return {
|
|
346
356
|
trial: retaken.trial,
|
|
@@ -4,7 +4,7 @@ export type AgentGuideRequest = {
|
|
|
4
4
|
id?: string;
|
|
5
5
|
section?: string;
|
|
6
6
|
};
|
|
7
|
-
export type AgentGuideFallbackReason = 'no-session' | 'server-unavailable' | 'server-hash-mismatch' | 'offline-requested';
|
|
7
|
+
export type AgentGuideFallbackReason = 'no-session' | 'server-unavailable' | 'server-guide-not-found' | 'server-hash-mismatch' | 'offline-requested';
|
|
8
8
|
export type AgentGuideRead = {
|
|
9
9
|
found: true;
|
|
10
10
|
response: AgentGuideResponse;
|
|
@@ -47,10 +47,8 @@ export declare function agentGuideJson(read: Extract<AgentGuideRead, {
|
|
|
47
47
|
found: true;
|
|
48
48
|
}>): string;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* server whose body does not match its own hash is an integrity failure, so it
|
|
53
|
-
* is said on stderr and stdout stays the guide (OSK-17944).
|
|
50
|
+
* Explain when a server miss or hash mismatch changes the source to the bundle.
|
|
51
|
+
* Keep stdout available for the guide text.
|
|
54
52
|
*/
|
|
55
53
|
export declare function agentGuideFallbackNotice(read: Extract<AgentGuideRead, {
|
|
56
54
|
found: true;
|
package/dist/lib/agent-guides.js
CHANGED
|
@@ -56,7 +56,7 @@ function guideMissFrom(error) {
|
|
|
56
56
|
}
|
|
57
57
|
function readBundledGuide(request) {
|
|
58
58
|
if (!request.id)
|
|
59
|
-
return { found: true, response: bundle.
|
|
59
|
+
return { found: true, response: bundle.index };
|
|
60
60
|
const resolved = (0, data_provider_1.resolveAgentGuideRequest)(bundle.index.guides, { id: request.id, ...(request.section ? { section: request.section } : {}) }, { surface: 'cli' });
|
|
61
61
|
if (!resolved.found)
|
|
62
62
|
return resolved;
|
|
@@ -134,17 +134,14 @@ async function readAgentGuide(request, flags) {
|
|
|
134
134
|
}
|
|
135
135
|
catch (error) {
|
|
136
136
|
miss = guideMissFrom(error) ?? undefined;
|
|
137
|
-
|
|
138
|
-
reason = 'server-unavailable';
|
|
137
|
+
reason = miss ? 'server-guide-not-found' : 'server-unavailable';
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
|
-
if (miss)
|
|
143
|
-
return { found: false, miss };
|
|
144
141
|
if (!response) {
|
|
145
142
|
const bundled = readBundledGuide(request);
|
|
146
143
|
if (!bundled.found)
|
|
147
|
-
return bundled;
|
|
144
|
+
return miss ? { found: false, miss } : bundled;
|
|
148
145
|
response = bundled.response;
|
|
149
146
|
}
|
|
150
147
|
return {
|
|
@@ -170,15 +167,17 @@ function agentGuideJson(read) {
|
|
|
170
167
|
}, null, 2)}\n`;
|
|
171
168
|
}
|
|
172
169
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* server whose body does not match its own hash is an integrity failure, so it
|
|
176
|
-
* is said on stderr and stdout stays the guide (OSK-17944).
|
|
170
|
+
* Explain when a server miss or hash mismatch changes the source to the bundle.
|
|
171
|
+
* Keep stdout available for the guide text.
|
|
177
172
|
*/
|
|
178
173
|
function agentGuideFallbackNotice(read) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
if (read.reason === 'server-guide-not-found') {
|
|
175
|
+
return 'This guide is unavailable on the server. Reading the copy bundled with this CLI.';
|
|
176
|
+
}
|
|
177
|
+
if (read.reason === 'server-hash-mismatch') {
|
|
178
|
+
return 'The server guide’s body does not match its hash; using the guide bundled with this CLI.';
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
182
181
|
}
|
|
183
182
|
/** A miss is steering, not a crash: print it with its nearest addresses and exit 1. */
|
|
184
183
|
function writeAgentGuideMiss(command, miss, json) {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { AgentRunBusinessResult, AgentRunEventPage, AgentRunHistoryPage, AgentRunHumanInput, AgentRunStopReceipt, AgentRunSummary, AgentRunTranscriptPage, PrivateReleaseEvalHistoryPage } from '@skrr-ai/data-provider';
|
|
2
|
+
export declare function canonicalRunId(value: unknown): string | undefined;
|
|
3
|
+
export declare const runIdArgument: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
4
|
+
export declare function exactAttemptId(input: string): string;
|
|
5
|
+
export declare const attemptIdFlag: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
export declare function runReadScopeArgs(workspaceId?: string): string[];
|
|
7
|
+
export declare class RunListCursorInvalidError extends Error {
|
|
8
|
+
readonly workspaceId: string | undefined;
|
|
9
|
+
constructor(workspaceId: string | undefined, cause: unknown);
|
|
10
|
+
}
|
|
11
|
+
export declare function listAgentRuns({ agentId, conversationId, goalId, source, evaluationId, from, to, status, cursor, limit, personal, }: {
|
|
12
|
+
agentId?: string;
|
|
13
|
+
conversationId?: string;
|
|
14
|
+
goalId?: string;
|
|
15
|
+
source?: string;
|
|
16
|
+
evaluationId?: string;
|
|
17
|
+
from?: string;
|
|
18
|
+
to?: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
cursor?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
personal?: boolean;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
page: AgentRunHistoryPage;
|
|
25
|
+
workspaceId?: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function listPrivateReleaseEvalHistory({ agentId, releaseId, limit, cursor, }: {
|
|
28
|
+
agentId: string;
|
|
29
|
+
releaseId?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
cursor?: string;
|
|
32
|
+
}): Promise<PrivateReleaseEvalHistoryPage>;
|
|
33
|
+
type ChatCopyOrigin = {
|
|
34
|
+
kind: 'fork' | 'handover';
|
|
35
|
+
runId: string;
|
|
36
|
+
attemptId: string;
|
|
37
|
+
workspaceId?: string;
|
|
38
|
+
};
|
|
39
|
+
export type AgentRunDetail = AgentRunSummary & {
|
|
40
|
+
status?: string;
|
|
41
|
+
delivery?: 'silent' | 'accepted' | 'delivered' | 'failed' | 'pending' | 'unconfirmed';
|
|
42
|
+
businessResult?: AgentRunBusinessResult;
|
|
43
|
+
humanInput?: AgentRunHumanInput;
|
|
44
|
+
derivedFrom?: ChatCopyOrigin;
|
|
45
|
+
};
|
|
46
|
+
export declare function chatCopyOrigin(run: AgentRunDetail): ChatCopyOrigin | undefined;
|
|
47
|
+
export declare function readAgentRun(runId: string, { personal }?: {
|
|
48
|
+
personal?: boolean | undefined;
|
|
49
|
+
}): Promise<AgentRunDetail & {
|
|
50
|
+
snapshot?: AgentRunEventPage['snapshot'];
|
|
51
|
+
snapshotAvailability?: 'unavailable';
|
|
52
|
+
}>;
|
|
53
|
+
export declare class RunEventCursorStaleError extends Error {
|
|
54
|
+
readonly workspaceId: string | undefined;
|
|
55
|
+
constructor(workspaceId: string | undefined, cause: unknown);
|
|
56
|
+
}
|
|
57
|
+
export declare function readAgentRunEvents(runId: string, options?: {
|
|
58
|
+
attempt?: string;
|
|
59
|
+
cursor?: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
personal?: boolean;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
page: AgentRunEventPage;
|
|
64
|
+
workspaceId?: string;
|
|
65
|
+
}>;
|
|
66
|
+
export declare class RunTranscriptCursorInvalidError extends Error {
|
|
67
|
+
readonly workspaceId: string | undefined;
|
|
68
|
+
constructor(workspaceId: string | undefined, cause: unknown);
|
|
69
|
+
}
|
|
70
|
+
export declare function readAgentRunTranscript(runId: string, { attempt, offset, after, limit, personal }: {
|
|
71
|
+
attempt: string;
|
|
72
|
+
offset?: number;
|
|
73
|
+
after?: string;
|
|
74
|
+
limit?: number;
|
|
75
|
+
personal?: boolean;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
page: AgentRunTranscriptPage;
|
|
78
|
+
workspaceId?: string;
|
|
79
|
+
}>;
|
|
80
|
+
type StopRunResult = {
|
|
81
|
+
kind: 'receipt';
|
|
82
|
+
receipt: AgentRunStopReceipt;
|
|
83
|
+
} | {
|
|
84
|
+
kind: 'already-ended';
|
|
85
|
+
runId: string;
|
|
86
|
+
status: string;
|
|
87
|
+
};
|
|
88
|
+
export declare class RunStopUnconfirmedError extends Error {
|
|
89
|
+
readonly expectedAttemptId: string | null;
|
|
90
|
+
readonly workspaceId: string | undefined;
|
|
91
|
+
constructor(expectedAttemptId: string | null, workspaceId: string | undefined, cause?: unknown);
|
|
92
|
+
}
|
|
93
|
+
export declare class RunStopConflictError extends Error {
|
|
94
|
+
readonly expectedAttemptId: string | null;
|
|
95
|
+
readonly workspaceId: string | undefined;
|
|
96
|
+
constructor(expectedAttemptId: string | null, workspaceId: string | undefined, cause: unknown);
|
|
97
|
+
}
|
|
98
|
+
export declare function stopAgentRun(runId: string, expectedAttemptId?: string | null, { personal }?: {
|
|
99
|
+
personal?: boolean | undefined;
|
|
100
|
+
}): Promise<StopRunResult>;
|
|
101
|
+
export {};
|