@skrr-ai/cli 0.1.208 → 0.1.209
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/dist/commands/agent/message/no-reply.js +1 -1
- package/dist/commands/agent/message/react.d.ts +23 -0
- package/dist/commands/agent/message/react.js +125 -0
- package/dist/commands/agent/message/resolve.js +1 -1
- package/dist/commands/agent/message/retract.js +1 -1
- package/dist/commands/agent/message/send.d.ts +8 -1
- package/dist/commands/agent/message/send.js +58 -4
- package/dist/commands/agents/access/approve.js +1 -1
- package/dist/commands/agents/access/deny.js +1 -1
- package/dist/commands/agents/access/list.js +3 -1
- package/dist/commands/agents/access/reach.js +1 -1
- package/dist/commands/agents/access/revoke.js +1 -1
- package/dist/commands/agents/always-on/recovery-review.d.ts +5 -0
- package/dist/commands/agents/always-on/recovery-review.js +16 -0
- package/dist/commands/agents/chat.d.ts +8 -0
- package/dist/commands/agents/chat.js +369 -90
- package/dist/commands/agents/import.js +3 -3
- package/dist/commands/agents/manager/status.js +7 -6
- package/dist/commands/agents/not-for-task.d.ts +24 -0
- package/dist/commands/agents/not-for-task.js +60 -0
- package/dist/commands/agents/schedule-overview.d.ts +20 -0
- package/dist/commands/agents/schedule-overview.js +35 -2
- package/dist/commands/agents/shared-memory.js +1 -1
- package/dist/commands/agents/stop.d.ts +23 -0
- package/dist/commands/agents/stop.js +61 -0
- package/dist/commands/agents/update.d.ts +7 -0
- package/dist/commands/agents/update.js +45 -2
- package/dist/commands/convos/messages.js +5 -0
- package/dist/commands/convos/transcript.js +2 -2
- package/dist/commands/daemon/logs.d.ts +3 -1
- package/dist/commands/daemon/logs.js +6 -2
- package/dist/commands/duties/advance-next.js +1 -1
- package/dist/commands/duties/preflight.js +17 -13
- package/dist/commands/followups/watch-pr.js +2 -1
- package/dist/commands/harnesses/evaluations/evidence.js +2 -2
- package/dist/commands/harnesses/evaluations/grant.js +1 -1
- package/dist/commands/harnesses/evaluations/revoke.js +1 -1
- package/dist/commands/harnesses/evaluations/show.js +1 -1
- package/dist/commands/harnesses/rollouts/grant.js +1 -1
- package/dist/commands/harnesses/rollouts/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
- package/dist/commands/memory/consolidation/undo.js +1 -0
- package/dist/commands/messages/list.js +9 -1
- package/dist/commands/slack/mutes.js +1 -1
- package/dist/commands/slack/unmute.js +1 -1
- package/dist/commands/tasks/actionability.js +1 -0
- package/dist/commands/tasks/ask.js +1 -1
- package/dist/commands/tasks/bulk-update.js +12 -0
- package/dist/commands/tasks/input/show.js +2 -2
- package/dist/commands/tasks/list.d.ts +8 -0
- package/dist/commands/tasks/list.js +50 -9
- package/dist/commands/tasks/move.d.ts +2 -10
- package/dist/commands/tasks/move.js +7 -18
- package/dist/commands/tasks/result/show.js +19 -7
- package/dist/commands/tasks/show.d.ts +4 -3
- package/dist/commands/tasks/show.js +20 -8
- package/dist/commands/tasks/start.js +35 -16
- package/dist/commands/tasks/update.js +3 -0
- package/dist/commands/tasks/wait.js +2 -2
- package/dist/generated/agent-guides.json +433 -133
- package/dist/lib/chat-stop.d.ts +17 -0
- package/dist/lib/chat-stop.js +70 -0
- package/dist/lib/cloud-reply.d.ts +21 -0
- package/dist/lib/cloud-reply.js +52 -0
- package/dist/lib/duties.js +24 -4
- package/dist/lib/duty-ledgers.js +19 -2
- package/dist/lib/file-mime.js +8 -0
- package/dist/lib/inbound-messages.d.ts +156 -0
- package/dist/lib/inbound-messages.js +375 -0
- package/dist/lib/message-intent.d.ts +18 -2
- package/dist/lib/message-intent.js +23 -1
- package/dist/lib/preflight-copy.d.ts +16 -1
- package/dist/lib/preflight-copy.js +33 -1
- package/dist/lib/task-operations.d.ts +2 -0
- package/dist/lib/task-operations.js +28 -4
- package/dist/lib/task-preflight.js +1 -0
- package/dist/lib/task-review-notice.d.ts +21 -0
- package/dist/lib/task-review-notice.js +46 -0
- package/dist/lib/task-version.d.ts +9 -0
- package/dist/lib/task-version.js +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +11969 -11728
- package/oclif.manifest.json +290 -12
- package/package.json +6 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const inbound_messages_1 = require("../../lib/inbound-messages");
|
|
6
|
+
/**
|
|
7
|
+
* `skrr agents not-for-task <message> --conversation <id>`: a message of yours that your agent
|
|
8
|
+
* passed to a Task was not for that Task. It comes back to the conversation and is delivered there
|
|
9
|
+
* again; the Task is told, and its response is stopped when it was for this message alone.
|
|
10
|
+
* Running it again answers with the message as it is and changes nothing.
|
|
11
|
+
*/
|
|
12
|
+
class AgentsNotForTask extends base_command_1.BaseCommand {
|
|
13
|
+
static description = 'Bring back a message your agent passed to a Task, and have it answered in the conversation';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> agents not-for-task msg_3f9a1c2b --conversation <conversation-id>',
|
|
16
|
+
'<%= config.bin %> agents not-for-task msg_3f9a1c2b --conversation <conversation-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static args = {
|
|
19
|
+
message: core_1.Args.string({ description: 'The id of your message', required: true }),
|
|
20
|
+
};
|
|
21
|
+
static flags = {
|
|
22
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
23
|
+
conversation: core_1.Flags.string({ description: 'Conversation the message is in', required: true }),
|
|
24
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
this.requireAuth();
|
|
28
|
+
const { args, flags } = await this.parse(AgentsNotForTask);
|
|
29
|
+
let answer;
|
|
30
|
+
try {
|
|
31
|
+
answer = await (0, inbound_messages_1.returnInboundMessage)(flags.conversation, args.message);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
const refusal = (0, inbound_messages_1.returnRefusalOf)(err);
|
|
35
|
+
if (refusal) {
|
|
36
|
+
this.failWithCliError({
|
|
37
|
+
message: refusal,
|
|
38
|
+
code: 'MESSAGE_NOT_RETURNED',
|
|
39
|
+
exit: 1,
|
|
40
|
+
retryable: false,
|
|
41
|
+
details: { messageId: args.message, conversationId: flags.conversation },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
this.handleApiError(err);
|
|
45
|
+
}
|
|
46
|
+
if (flags.json)
|
|
47
|
+
return this.printJsonResult(answer);
|
|
48
|
+
this.log((0, inbound_messages_1.returnedSentence)(answer.returned ?? {}));
|
|
49
|
+
// How it is delivered here now: why it waits or failed, else what its route says.
|
|
50
|
+
const state = answer.delivery?.state;
|
|
51
|
+
const now = state === 'held' || state === 'failed'
|
|
52
|
+
? (0, inbound_messages_1.deliverySentence)(answer.delivery)
|
|
53
|
+
: answer.route
|
|
54
|
+
? inbound_messages_1.ROUTE_COPY[answer.route]
|
|
55
|
+
: null;
|
|
56
|
+
if (now)
|
|
57
|
+
this.log(now);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = AgentsNotForTask;
|
|
@@ -63,3 +63,23 @@ export interface WithheldTrigger {
|
|
|
63
63
|
* agent's Always-On switch. A server that predates `reasonText` still prints the code.
|
|
64
64
|
*/
|
|
65
65
|
export declare function withheldLine(trigger: WithheldTrigger): string;
|
|
66
|
+
/**
|
|
67
|
+
* Why the Recent fires section has no rows, when the read did not succeed. The states and reasons are
|
|
68
|
+
* the ones the agent's own overview tool answers with (`self_schedule_overview`'s `recentFiresCoverage`),
|
|
69
|
+
* so a person and an agent are told the same thing.
|
|
70
|
+
*
|
|
71
|
+
* The server refuses an Agent's fire history (409 `FIRE_SOURCE_UNVERIFIED`): a fire row records the
|
|
72
|
+
* Trigger's and the Agent's logical ids only, and an Agent recreated under the same id, or a Duty
|
|
73
|
+
* handed to another executor, shares them. That refusal is `unsupported`; any other failure is
|
|
74
|
+
* `unavailable`. Either way the section used to print "No fire audit records." under the error, which
|
|
75
|
+
* read as "nothing fired" (OSK-33261). Undefined for a read that succeeded, even with no rows.
|
|
76
|
+
*/
|
|
77
|
+
export interface RecentFiresCoverage {
|
|
78
|
+
state: 'unsupported' | 'unavailable';
|
|
79
|
+
reason: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const RECENT_FIRES_UNSUPPORTED_REASON = "Historical fires do not prove the physical Agent at occurrence time.";
|
|
82
|
+
export declare const RECENT_FIRES_UNAVAILABLE_REASON = "Recent fire history could not be read.";
|
|
83
|
+
export declare function recentFiresCoverage(result: PromiseSettledResult<unknown>): RecentFiresCoverage | undefined;
|
|
84
|
+
/** The one line the text view prints instead of the list. An unavailable read keeps its error. */
|
|
85
|
+
export declare function recentFiresCoverageLine(coverage: RecentFiresCoverage, result: PromiseSettledResult<unknown>): string;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RECENT_FIRES_UNAVAILABLE_REASON = exports.RECENT_FIRES_UNSUPPORTED_REASON = void 0;
|
|
3
4
|
exports.pausedTriggers = pausedTriggers;
|
|
4
5
|
exports.pausedTriggerLines = pausedTriggerLines;
|
|
5
6
|
exports.reflectionSummary = reflectionSummary;
|
|
6
7
|
exports.reflectionLine = reflectionLine;
|
|
7
8
|
exports.reflectionNoteLine = reflectionNoteLine;
|
|
8
9
|
exports.withheldLine = withheldLine;
|
|
10
|
+
exports.recentFiresCoverage = recentFiresCoverage;
|
|
11
|
+
exports.recentFiresCoverageLine = recentFiresCoverageLine;
|
|
9
12
|
const core_1 = require("@oclif/core");
|
|
10
13
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
11
14
|
const base_command_1 = require("../../base-command");
|
|
12
15
|
const format_1 = require("../../lib/format");
|
|
16
|
+
const http_error_1 = require("../../lib/http-error");
|
|
13
17
|
const triggers_1 = require("../../lib/triggers");
|
|
14
18
|
const schedule_1 = require("../../lib/schedule");
|
|
15
19
|
const planOutcome_1 = require("../../lib/planOutcome");
|
|
@@ -79,6 +83,8 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
|
|
|
79
83
|
// reports them here so "nothing upcoming" is never mistaken for a break.
|
|
80
84
|
const blockedUpcoming = settledValue(upcomingR)?.blocked ?? [];
|
|
81
85
|
const fires = settledValue(firesR)?.fires ?? [];
|
|
86
|
+
// A history that could not be read is not an empty one (OSK-33261).
|
|
87
|
+
const firesCoverage = recentFiresCoverage(firesR);
|
|
82
88
|
const triggers = settledValue(triggersR)?.triggers ?? [];
|
|
83
89
|
const todos = settledValue(todosR)?.todos ?? [];
|
|
84
90
|
const openTasks = filterAgentOpenTasks(settledValue(tasksR), agentId);
|
|
@@ -90,6 +96,8 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
|
|
|
90
96
|
upcoming,
|
|
91
97
|
pausedTriggers: pausedTriggers(triggers, reflection),
|
|
92
98
|
recentFires: fires,
|
|
99
|
+
// `recentFires` keeps its array shape; this says when that `[]` means "not read".
|
|
100
|
+
...(firesCoverage ? { recentFiresCoverage: firesCoverage } : {}),
|
|
93
101
|
openTasks,
|
|
94
102
|
todos,
|
|
95
103
|
triggers,
|
|
@@ -162,8 +170,12 @@ class AgentsScheduleOverview extends base_command_1.BaseCommand {
|
|
|
162
170
|
// PAST.
|
|
163
171
|
this.log('');
|
|
164
172
|
this.log('■ Recent fires');
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
if (firesCoverage) {
|
|
174
|
+
this.log(` ${recentFiresCoverageLine(firesCoverage, firesR)}`);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
(0, triggers_1.renderFireAudit)(fires, (line) => this.log(line), undefined, { timeZone: todayZone });
|
|
178
|
+
}
|
|
167
179
|
// Open tasks assigned to this agent.
|
|
168
180
|
this.log('');
|
|
169
181
|
this.log('■ Open tasks (assigned to this agent)');
|
|
@@ -272,6 +284,27 @@ function withheldLine(trigger) {
|
|
|
272
284
|
function settledValue(result) {
|
|
273
285
|
return result.status === 'fulfilled' ? result.value : undefined;
|
|
274
286
|
}
|
|
287
|
+
exports.RECENT_FIRES_UNSUPPORTED_REASON = 'Historical fires do not prove the physical Agent at occurrence time.';
|
|
288
|
+
exports.RECENT_FIRES_UNAVAILABLE_REASON = 'Recent fire history could not be read.';
|
|
289
|
+
function recentFiresCoverage(result) {
|
|
290
|
+
if (result.status === 'fulfilled')
|
|
291
|
+
return undefined;
|
|
292
|
+
return (0, http_error_1.httpBodyOf)(result.reason)?.code === 'FIRE_SOURCE_UNVERIFIED'
|
|
293
|
+
? { state: 'unsupported', reason: exports.RECENT_FIRES_UNSUPPORTED_REASON }
|
|
294
|
+
: { state: 'unavailable', reason: exports.RECENT_FIRES_UNAVAILABLE_REASON };
|
|
295
|
+
}
|
|
296
|
+
/** The one line the text view prints instead of the list. An unavailable read keeps its error. */
|
|
297
|
+
function recentFiresCoverageLine(coverage, result) {
|
|
298
|
+
if (coverage.state === 'unsupported')
|
|
299
|
+
return `Unsupported: ${coverage.reason}`;
|
|
300
|
+
const reason = result.status === 'rejected' ? result.reason : undefined;
|
|
301
|
+
let detail = '';
|
|
302
|
+
if (reason instanceof Error)
|
|
303
|
+
detail = reason.message;
|
|
304
|
+
else if (reason !== undefined && reason !== null)
|
|
305
|
+
detail = String(reason);
|
|
306
|
+
return `Unavailable: ${coverage.reason}${detail ? ` (${detail})` : ''}`;
|
|
307
|
+
}
|
|
275
308
|
/** Print a one-line "(unavailable: …)" note for a rejected source. */
|
|
276
309
|
function reportError(result, log) {
|
|
277
310
|
if (result.status === 'rejected') {
|
|
@@ -40,7 +40,7 @@ class AgentsSharedMemory extends base_command_1.BaseCommand {
|
|
|
40
40
|
this.handleApiError(err);
|
|
41
41
|
}
|
|
42
42
|
if (flags.json) {
|
|
43
|
-
this.
|
|
43
|
+
this.printJsonResult(preview);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const { memories, withheld, omitted, digest } = preview;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr agents stop --conversation <id> [--all]`: stop what an Agent is doing in one of your
|
|
4
|
+
* conversations, from any terminal. Stop stops the conversation's own work and its sub-agents and
|
|
5
|
+
* background commands; it never stops a Task. `--all` also stops the Tasks started from that
|
|
6
|
+
* conversation that are still running. `--dry-run` says what each would stop and stops nothing.
|
|
7
|
+
*/
|
|
8
|
+
export default class AgentsStop extends BaseCommand {
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
conversation: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
bare: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
raw: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
};
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_crypto_1 = require("node:crypto");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const base_command_1 = require("../../base-command");
|
|
6
|
+
const chat_stop_1 = require("../../lib/chat-stop");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr agents stop --conversation <id> [--all]`: stop what an Agent is doing in one of your
|
|
9
|
+
* conversations, from any terminal. Stop stops the conversation's own work and its sub-agents and
|
|
10
|
+
* background commands; it never stops a Task. `--all` also stops the Tasks started from that
|
|
11
|
+
* conversation that are still running. `--dry-run` says what each would stop and stops nothing.
|
|
12
|
+
*/
|
|
13
|
+
class AgentsStop extends base_command_1.BaseCommand {
|
|
14
|
+
static description = 'Stop what your agent is doing in a conversation; --all also stops the Tasks it started there';
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> agents stop --conversation <conversation-id>',
|
|
17
|
+
'<%= config.bin %> agents stop --conversation <conversation-id> --all',
|
|
18
|
+
'<%= config.bin %> agents stop --conversation <conversation-id> --dry-run',
|
|
19
|
+
];
|
|
20
|
+
static flags = {
|
|
21
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
22
|
+
conversation: core_1.Flags.string({ description: 'Conversation to stop', required: true }),
|
|
23
|
+
all: core_1.Flags.boolean({
|
|
24
|
+
description: 'Also stop the Tasks started from this conversation that are still running',
|
|
25
|
+
}),
|
|
26
|
+
'dry-run': core_1.Flags.boolean({ description: 'Say what would stop, and stop nothing' }),
|
|
27
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
this.requireAuth();
|
|
31
|
+
const { flags } = await this.parse(AgentsStop);
|
|
32
|
+
const conversationId = flags.conversation;
|
|
33
|
+
if (flags['dry-run']) {
|
|
34
|
+
let preview;
|
|
35
|
+
try {
|
|
36
|
+
preview = await (0, chat_stop_1.readStopPreview)(conversationId);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
this.handleApiError(err);
|
|
40
|
+
}
|
|
41
|
+
if (flags.json)
|
|
42
|
+
return this.printJsonResult(preview);
|
|
43
|
+
for (const line of (0, chat_stop_1.describeStopPreview)(preview))
|
|
44
|
+
this.log(line);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let receipt;
|
|
48
|
+
try {
|
|
49
|
+
receipt = await (0, chat_stop_1.requestStop)(conversationId, flags.all ? 'all' : 'session', `cli-${(0, node_crypto_1.randomUUID)()}`);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
this.handleApiError(err);
|
|
53
|
+
}
|
|
54
|
+
if (flags.json)
|
|
55
|
+
return this.printJsonResult(receipt);
|
|
56
|
+
for (const line of (0, chat_stop_1.describeStopReceipt)(receipt, { bin: this.config.bin, conversationId })) {
|
|
57
|
+
this.log(line);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = AgentsStop;
|
|
@@ -17,6 +17,7 @@ export default class AgentsUpdate extends BaseCommand {
|
|
|
17
17
|
category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
19
|
'next-target': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'cloud-reply': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
22
|
'default-permission-mode': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
23
|
'clear-default-permission-mode': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -123,6 +124,12 @@ export declare const AGENT_FENCE_RETRY_CODES: ReadonlySet<string>;
|
|
|
123
124
|
export declare function retryOnceOnAgentFence<T>(operation: () => Promise<T>, { delayMs }?: {
|
|
124
125
|
delayMs?: number;
|
|
125
126
|
}): Promise<T>;
|
|
127
|
+
/**
|
|
128
|
+
* What the cloud-reply setting is now, after a write that sent it or changed the runtime order
|
|
129
|
+
* (inbound messages D4). The server turns it off in the same write that removes the last cloud
|
|
130
|
+
* runtime, so a `--target` change that did that says so. Exported for tests.
|
|
131
|
+
*/
|
|
132
|
+
export declare function cloudReplyNote(payload: Record<string, unknown>, updated: Record<string, unknown>): string | null;
|
|
126
133
|
/**
|
|
127
134
|
* The `defaultPermissionMode` a PATCH carries for these flags. `null` is the
|
|
128
135
|
* server's clear, the same spelling `harnesses update --clear-default-permission-mode`
|
|
@@ -6,6 +6,7 @@ exports.agentRowFromUpdate = agentRowFromUpdate;
|
|
|
6
6
|
exports.alwaysOnReceiptLine = alwaysOnReceiptLine;
|
|
7
7
|
exports.writeReceiptWarnings = writeReceiptWarnings;
|
|
8
8
|
exports.retryOnceOnAgentFence = retryOnceOnAgentFence;
|
|
9
|
+
exports.cloudReplyNote = cloudReplyNote;
|
|
9
10
|
exports.defaultPermissionModePatch = defaultPermissionModePatch;
|
|
10
11
|
exports.defaultPermissionModeNote = defaultPermissionModeNote;
|
|
11
12
|
const core_1 = require("@oclif/core");
|
|
@@ -19,6 +20,7 @@ const execution_target_1 = require("../../lib/execution-target");
|
|
|
19
20
|
const prompt_1 = require("../../lib/prompt");
|
|
20
21
|
const agent_config_1 = require("../../lib/agent-config");
|
|
21
22
|
const web_url_1 = require("../../lib/web-url");
|
|
23
|
+
const cloud_reply_1 = require("../../lib/cloud-reply");
|
|
22
24
|
class AgentsUpdate extends base_command_1.BaseCommand {
|
|
23
25
|
static description = 'Update an existing agent (partial patch)';
|
|
24
26
|
static examples = [
|
|
@@ -27,6 +29,7 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
27
29
|
'<%= config.bin %> agents update <agent-id> --model claude-sonnet-5',
|
|
28
30
|
'<%= config.bin %> agents update <agent-id> --target sbs_123',
|
|
29
31
|
'<%= config.bin %> agents update <agent-id> --target rt_local --next-target hosted-machine',
|
|
32
|
+
'<%= config.bin %> agents update <agent-id> --cloud-reply on',
|
|
30
33
|
'<%= config.bin %> agents update <agent-id> --from-json patch.json',
|
|
31
34
|
];
|
|
32
35
|
static args = {
|
|
@@ -54,6 +57,12 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
54
57
|
description: 'Next execution target in exact execution order after --target. Repeat in the order it should be tried.',
|
|
55
58
|
multiple: true,
|
|
56
59
|
}),
|
|
60
|
+
'cloud-reply': core_1.Flags.string({
|
|
61
|
+
description: 'Whether this agent answers from the cloud while the computer it works on is offline or ' +
|
|
62
|
+
"too busy (off unless turned on). The reply sees the conversation and the state of its work, never that computer's files, " +
|
|
63
|
+
'and uses your usage like any cloud run. Needs an Agent Worker, or a Hosted Machine you approved, in its runtime order.',
|
|
64
|
+
options: ['on', 'off'],
|
|
65
|
+
}),
|
|
57
66
|
'working-directory': core_1.Flags.string({
|
|
58
67
|
description: 'Default working directory for local Harness sessions',
|
|
59
68
|
}),
|
|
@@ -173,6 +182,7 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
173
182
|
model: flags.model,
|
|
174
183
|
category: flags.category,
|
|
175
184
|
executionPolicy,
|
|
185
|
+
cloudReplyWhenMachineUnavailable: flags['cloud-reply'] === undefined ? undefined : flags['cloud-reply'] === 'on',
|
|
176
186
|
workingDirectory: flags['working-directory'],
|
|
177
187
|
defaultPermissionMode: defaultPermissionModePatch(flags),
|
|
178
188
|
});
|
|
@@ -199,6 +209,11 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
199
209
|
}));
|
|
200
210
|
}
|
|
201
211
|
catch (err) {
|
|
212
|
+
// A refusal of the cloud-reply setting answers in the CLI's own words, never the error's.
|
|
213
|
+
const { code } = (0, base_command_1.apiRefusal)(err);
|
|
214
|
+
if (code && code in cloud_reply_1.CLOUD_REPLY_SETTING_REFUSAL_COPY) {
|
|
215
|
+
this.error(cloud_reply_1.CLOUD_REPLY_SETTING_REFUSAL_COPY[code], { exit: 1 });
|
|
216
|
+
}
|
|
202
217
|
this.handleApiError(err);
|
|
203
218
|
}
|
|
204
219
|
for (const warning of agentUpdateWarnings(payload, updated))
|
|
@@ -235,6 +250,9 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
235
250
|
if (alwaysOnLine)
|
|
236
251
|
this.log(alwaysOnLine);
|
|
237
252
|
this.log(`URL: ${(0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, { ...a, id: a.id ?? a._id ?? args.id }).url ?? '-'}`);
|
|
253
|
+
const cloudLine = cloudReplyNote(payload, a);
|
|
254
|
+
if (cloudLine)
|
|
255
|
+
this.log(cloudLine);
|
|
238
256
|
const modeNote = defaultPermissionModeNote(flags['default-permission-mode'], a);
|
|
239
257
|
if (modeNote)
|
|
240
258
|
this.log(modeNote);
|
|
@@ -352,8 +370,8 @@ function alwaysOnReceiptLine(payload, updated) {
|
|
|
352
370
|
? `turned ${state}`
|
|
353
371
|
: null;
|
|
354
372
|
if (action) {
|
|
355
|
-
return `Always-On: ${action} at generation ${command.generation}; ` +
|
|
356
|
-
`now ${current.isAlwaysOn ? 'on' : 'off'} at generation ${command.supersededByGeneration}
|
|
373
|
+
return (`Always-On: ${action} at generation ${command.generation}; ` +
|
|
374
|
+
`now ${current.isAlwaysOn ? 'on' : 'off'} at generation ${command.supersededByGeneration}.`);
|
|
357
375
|
}
|
|
358
376
|
}
|
|
359
377
|
if (receipt.unchanged.some((entry) => entry.field === 'isAlwaysOn')) {
|
|
@@ -428,6 +446,31 @@ async function retryOnceOnAgentFence(operation, { delayMs = 750 } = {}) {
|
|
|
428
446
|
return operation();
|
|
429
447
|
}
|
|
430
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* What the cloud-reply setting is now, after a write that sent it or changed the runtime order
|
|
451
|
+
* (inbound messages D4). The server turns it off in the same write that removes the last cloud
|
|
452
|
+
* runtime, so a `--target` change that did that says so. Exported for tests.
|
|
453
|
+
*/
|
|
454
|
+
function cloudReplyNote(payload, updated) {
|
|
455
|
+
const sent = payload.cloudReplyWhenMachineUnavailable;
|
|
456
|
+
const stored = updated.cloudReplyWhenMachineUnavailable;
|
|
457
|
+
if (typeof sent === 'boolean') {
|
|
458
|
+
const on = typeof stored === 'boolean' ? stored : sent;
|
|
459
|
+
return on
|
|
460
|
+
? 'Cloud replies: on. While its computer is offline or too busy, this agent answers from ' +
|
|
461
|
+
"the cloud. It sees the conversation and the state of its work, never that computer's " +
|
|
462
|
+
'files, and those replies use your usage.'
|
|
463
|
+
: "Cloud replies: off. Messages wait for this agent's computer.";
|
|
464
|
+
}
|
|
465
|
+
// Said in the present tense: the prior setting is not in the reply, the current order is.
|
|
466
|
+
if (payload.executionPolicy !== undefined &&
|
|
467
|
+
stored === false &&
|
|
468
|
+
!(0, data_provider_1.cloudReplyPossible)(updated.executionPolicy)) {
|
|
469
|
+
return ('Cloud replies: off. The runtime order has no cloud runtime that may answer, so messages ' +
|
|
470
|
+
'wait for its computer.');
|
|
471
|
+
}
|
|
472
|
+
return null;
|
|
473
|
+
}
|
|
431
474
|
/**
|
|
432
475
|
* The `defaultPermissionMode` a PATCH carries for these flags. `null` is the
|
|
433
476
|
* server's clear, the same spelling `harnesses update --clear-default-permission-mode`
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const message_content_1 = require("../../lib/message-content");
|
|
8
|
+
const cloud_reply_1 = require("../../lib/cloud-reply");
|
|
8
9
|
const FORMAT_MESSAGE_LINES_RE_2 = /\s+/g;
|
|
9
10
|
const FORMAT_MESSAGE_LINES_RE = /\s+/g;
|
|
10
11
|
/**
|
|
@@ -30,6 +31,10 @@ function formatMessageLines(m, options = {}) {
|
|
|
30
31
|
.join('\n\n');
|
|
31
32
|
const clipped = body.length > 300 ? `${body.slice(0, 300)}…` : body;
|
|
32
33
|
const lines = [`${when} ${who}${failure ? ' [failed]' : ''}`];
|
|
34
|
+
// Written from the cloud while the machine could not answer: it could not see that machine.
|
|
35
|
+
const cloud = m.isCreatedByUser ? null : (0, cloud_reply_1.cloudReplyLine)(m.metadata);
|
|
36
|
+
if (cloud)
|
|
37
|
+
lines.push(` ${cloud}`);
|
|
33
38
|
if (clipped || !failure) {
|
|
34
39
|
for (const line of clipped.split('\n')) {
|
|
35
40
|
lines.push(` ${line}`);
|
|
@@ -404,7 +404,7 @@ class ConvosTranscript extends base_command_1.BaseCommand {
|
|
|
404
404
|
: {}),
|
|
405
405
|
};
|
|
406
406
|
if (flags.json) {
|
|
407
|
-
this.
|
|
407
|
+
this.printJsonResult(result);
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
410
|
if (result.items.length === 0) {
|
|
@@ -450,7 +450,7 @@ class ConvosTranscript extends base_command_1.BaseCommand {
|
|
|
450
450
|
...(first.events ? { events: pages.flatMap((page) => page.events ?? []) } : {}),
|
|
451
451
|
};
|
|
452
452
|
if (json) {
|
|
453
|
-
this.
|
|
453
|
+
this.printJsonResult(body);
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
456
456
|
for (const line of formatTurnBody(body))
|
|
@@ -144,7 +144,9 @@ export declare const ROTATED_WINDOW_NOTE_RUNTIME_VERSION = "0.8.121";
|
|
|
144
144
|
* 10 MB (`daemon/src/logger.ts` `maybeRotate`), and `logs` never reached them —
|
|
145
145
|
* `--lines 5000 | grep <run id>` found nothing while `daemon.app.1.log` held the
|
|
146
146
|
* run. A copy of `daemon/src/rotated-log-files.ts`, for runtimes that predate
|
|
147
|
-
* `--rotated`. Never throws.
|
|
147
|
+
* `--rotated`. Never throws. The supervisor capture's `<file>.previous` (the
|
|
148
|
+
* only log a `skrrd install` daemon has) is listed last, since it holds what
|
|
149
|
+
* came just before the current file.
|
|
148
150
|
*/
|
|
149
151
|
export declare function rotatedLogSiblings(filePath: string, readdir?: (dir: string) => string[]): string[];
|
|
150
152
|
/** The sentence shown when rotated siblings hold older lines the view leaves out. */
|
|
@@ -263,7 +263,9 @@ exports.ROTATED_WINDOW_NOTE_RUNTIME_VERSION = '0.8.121';
|
|
|
263
263
|
* 10 MB (`daemon/src/logger.ts` `maybeRotate`), and `logs` never reached them —
|
|
264
264
|
* `--lines 5000 | grep <run id>` found nothing while `daemon.app.1.log` held the
|
|
265
265
|
* run. A copy of `daemon/src/rotated-log-files.ts`, for runtimes that predate
|
|
266
|
-
* `--rotated`. Never throws.
|
|
266
|
+
* `--rotated`. Never throws. The supervisor capture's `<file>.previous` (the
|
|
267
|
+
* only log a `skrrd install` daemon has) is listed last, since it holds what
|
|
268
|
+
* came just before the current file.
|
|
267
269
|
*/
|
|
268
270
|
function rotatedLogSiblings(filePath, readdir = (dir) => (0, node_fs_1.readdirSync)(dir)) {
|
|
269
271
|
const dir = node_path_1.default.dirname(filePath);
|
|
@@ -278,11 +280,13 @@ function rotatedLogSiblings(filePath, readdir = (dir) => (0, node_fs_1.readdirSy
|
|
|
278
280
|
catch {
|
|
279
281
|
return [];
|
|
280
282
|
}
|
|
281
|
-
|
|
283
|
+
const numbered = names
|
|
282
284
|
.map((name) => ({ name, index: Number(pattern.exec(name)?.[1] ?? NaN) }))
|
|
283
285
|
.filter(({ index }) => Number.isSafeInteger(index) && index >= 1)
|
|
284
286
|
.sort((a, b) => b.index - a.index)
|
|
285
287
|
.map(({ name }) => node_path_1.default.join(dir, name));
|
|
288
|
+
const previous = `${node_path_1.default.basename(filePath)}.previous`;
|
|
289
|
+
return names.includes(previous) ? [...numbered, node_path_1.default.join(dir, previous)] : numbered;
|
|
286
290
|
}
|
|
287
291
|
/** The sentence shown when rotated siblings hold older lines the view leaves out. */
|
|
288
292
|
function describeRotatedSiblings(filePath, siblings) {
|
|
@@ -77,7 +77,7 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
77
77
|
}
|
|
78
78
|
const url = (0, web_url_1.dutyUrlFrom)(this.cliConfig.baseURL, { id });
|
|
79
79
|
if (flags.json) {
|
|
80
|
-
this.
|
|
80
|
+
this.printJsonResult({ ...result, url });
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
if (result.proposal) {
|
|
@@ -107,6 +107,10 @@ function preflightHeadline(report, persisted) {
|
|
|
107
107
|
const caveats = [];
|
|
108
108
|
if (noActionRuns)
|
|
109
109
|
caveats.push('its daily Run budget is 0, so no agent turn will start');
|
|
110
|
+
// Spent for today is a different fact from a budget of 0: it clears at 00:00 UTC (OSK-33248).
|
|
111
|
+
else if (gateById('run_budget')?.verdict === 'block') {
|
|
112
|
+
caveats.push('today\u2019s Run budget is spent, so no agent turn starts until it resets');
|
|
113
|
+
}
|
|
110
114
|
if (gateById('endpoint')?.verdict === 'block') {
|
|
111
115
|
caveats.push('no connected endpoint can deliver its reports');
|
|
112
116
|
}
|
|
@@ -164,7 +168,13 @@ function preflightGateLines(gate, verbose = false, refusesActivation = false, un
|
|
|
164
168
|
// answers 409 for it, so it is tagged BLOCK and says what it stops. `info (advisory: does not stop a
|
|
165
169
|
// run)` beside an "Activation: would be refused" section naming the same gate was two answers to one
|
|
166
170
|
// question.
|
|
167
|
-
|
|
171
|
+
// A spent run budget is advisory because it clears by itself and must not refuse activation, but
|
|
172
|
+
// it does refuse the next agent turn, so "does not stop a run" would be false (OSK-33248).
|
|
173
|
+
const spentRunBudget = gate.id === 'run_budget' && gate.verdict === 'block';
|
|
174
|
+
const advisoryBlock = gate.verdict === 'block' &&
|
|
175
|
+
gate.admission === 'advisory' &&
|
|
176
|
+
!refusesActivation &&
|
|
177
|
+
!spentRunBudget;
|
|
168
178
|
const stopsActivationOnly = gate.verdict === 'block' && gate.admission === 'advisory' && refusesActivation;
|
|
169
179
|
// A deleted Sensor is the one advisory block that must not read lower than a silent one (`warn`):
|
|
170
180
|
// it is the more serious state (OSK-22592).
|
|
@@ -195,7 +205,10 @@ function preflightGateLines(gate, verbose = false, refusesActivation = false, un
|
|
|
195
205
|
const lines = [
|
|
196
206
|
` ${mark.padEnd(5)} ${gate.label}${showReason && gate.reason ? ` — ${gate.reason}` : ''}` +
|
|
197
207
|
(advisoryBlock ? ' (advisory: does not stop a run)' : '') +
|
|
198
|
-
(stopsActivationOnly
|
|
208
|
+
(stopsActivationOnly && !spentRunBudget
|
|
209
|
+
? ' (stops activation, not a run that is already live)'
|
|
210
|
+
: '') +
|
|
211
|
+
(spentRunBudget ? ' (stops agent turns, not activation)' : ''),
|
|
199
212
|
];
|
|
200
213
|
if (hasNote) {
|
|
201
214
|
lines.push(` ${String(note).trim()}`);
|
|
@@ -396,18 +409,9 @@ class DutiesPreflight extends base_command_1.BaseCommand {
|
|
|
396
409
|
}
|
|
397
410
|
if (report.capabilities?.length) {
|
|
398
411
|
this.log('\nWhere access comes from:');
|
|
399
|
-
const sourceLabels = {
|
|
400
|
-
event_payload: 'Event facts',
|
|
401
|
-
platform_grant: 'Platform-attested access',
|
|
402
|
-
local_harness: 'This machine’s tooling',
|
|
403
|
-
cloud_runtime: 'Runtime-scoped access',
|
|
404
|
-
};
|
|
405
412
|
for (const capability of report.capabilities) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
this.log(` Tested: ${capability.testedAt}${capability.expiresAt ? ` · expires ${capability.expiresAt}` : ''}`);
|
|
409
|
-
if (capability.attestation === 'machine')
|
|
410
|
-
this.log(' Machine-attested; not platform-attested.');
|
|
413
|
+
for (const line of (0, preflight_copy_1.capabilityLines)(capability))
|
|
414
|
+
this.log(line);
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
417
|
for (const line of nextRunsLines(report, activation === true))
|
|
@@ -30,6 +30,7 @@ class FollowupsWatchPr extends base_command_1.BaseCommand {
|
|
|
30
30
|
ref: core_1.Args.string({
|
|
31
31
|
description: 'The pull request: owner/repo#number or its github.com URL',
|
|
32
32
|
required: true,
|
|
33
|
+
ignoreStdin: true,
|
|
33
34
|
}),
|
|
34
35
|
};
|
|
35
36
|
static flags = {
|
|
@@ -108,7 +109,7 @@ class FollowupsWatchPr extends base_command_1.BaseCommand {
|
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
111
|
if (flags.json) {
|
|
111
|
-
this.
|
|
112
|
+
this.printJsonResult(response);
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
115
|
const notice = (0, followups_1.producerDowngradeNotice)(response);
|
|
@@ -40,7 +40,7 @@ class HarnessesEvaluationsEvidence extends base_command_1.BaseCommand {
|
|
|
40
40
|
this.error('--financial requires --json and a standalone read', { exit: 2 });
|
|
41
41
|
try {
|
|
42
42
|
const result = await (0, harness_evaluations_1.harnessEvaluationFinancialEvidence)(args.grantId, flags['financial-workspace']);
|
|
43
|
-
this.
|
|
43
|
+
this.printJsonResult(result);
|
|
44
44
|
}
|
|
45
45
|
catch (err) {
|
|
46
46
|
this.handleApiError(err);
|
|
@@ -59,7 +59,7 @@ class HarnessesEvaluationsEvidence extends base_command_1.BaseCommand {
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
if (flags.json) {
|
|
62
|
-
this.
|
|
62
|
+
this.printJsonResult(result);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
this.log(`${result.grant.grantId}: ${result.turns.length} turns`);
|
|
@@ -36,7 +36,7 @@ class HarnessesEvaluationsRevoke extends base_command_1.BaseCommand {
|
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
if (flags.json) {
|
|
39
|
-
this.
|
|
39
|
+
this.printJsonResult(result);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
this.log(`Withdrew ${result.grant.grantId} (${result.grant.harness} on daemon ${result.grant.daemonId}) after ${result.grant.admissions.length} turns.`);
|
|
@@ -11,7 +11,7 @@ class Revoke extends base_command_1.BaseCommand {
|
|
|
11
11
|
this.requireAuth();
|
|
12
12
|
const { args, flags } = await this.parse(Revoke);
|
|
13
13
|
try {
|
|
14
|
-
this.
|
|
14
|
+
this.printJsonResult(await (0, hosted_identity_evaluations_1.revokeHostedIdentityEvaluation)(args.id, flags.reason));
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
17
17
|
this.handleApiError(error);
|