@skrr-ai/cli 0.1.207 → 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.d.ts +31 -0
- package/dist/commands/agent/message/resolve.js +111 -0
- package/dist/commands/agent/message/retract.js +1 -1
- package/dist/commands/agent/message/send.d.ts +25 -6
- package/dist/commands/agent/message/send.js +135 -30
- package/dist/commands/agent/request/list.d.ts +15 -0
- package/dist/commands/agent/request/list.js +82 -0
- package/dist/commands/agent/request/send.d.ts +18 -0
- package/dist/commands/agent/request/send.js +56 -0
- package/dist/commands/agents/access/approve.d.ts +17 -0
- package/dist/commands/agents/access/approve.js +94 -0
- package/dist/commands/agents/access/deny.d.ts +10 -0
- package/dist/commands/agents/access/deny.js +36 -0
- package/dist/commands/agents/access/list.d.ts +10 -0
- package/dist/commands/agents/access/list.js +55 -0
- package/dist/commands/agents/access/reach.d.ts +13 -0
- package/dist/commands/agents/access/reach.js +53 -0
- package/dist/commands/agents/access/revoke.d.ts +13 -0
- package/dist/commands/agents/access/revoke.js +50 -0
- 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.d.ts +15 -1
- package/dist/commands/agents/import.js +212 -24
- package/dist/commands/agents/intuitions/accept.d.ts +0 -1
- package/dist/commands/agents/intuitions/accept.js +22 -7
- package/dist/commands/agents/intuitions/generate.d.ts +0 -1
- package/dist/commands/agents/intuitions/generate.js +4 -16
- package/dist/commands/agents/intuitions/list.js +9 -3
- package/dist/commands/agents/intuitions/resume.d.ts +11 -0
- package/dist/commands/agents/intuitions/resume.js +37 -0
- 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.d.ts +24 -0
- package/dist/commands/agents/shared-memory.js +67 -0
- 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/agents/visibility.d.ts +1 -0
- package/dist/commands/agents/visibility.js +14 -0
- package/dist/commands/code/migrate.js +3 -1
- 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 +16 -7
- package/dist/commands/duties/preflight.js +17 -13
- package/dist/commands/followups/show.js +9 -0
- package/dist/commands/followups/watch-pr.d.ts +27 -0
- package/dist/commands/followups/watch-pr.js +124 -0
- 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/index.d.ts +20 -0
- package/dist/commands/memory/consolidation/index.js +78 -0
- package/dist/commands/memory/consolidation/resume.d.ts +14 -0
- package/dist/commands/memory/consolidation/resume.js +46 -0
- package/dist/commands/memory/consolidation/undo.d.ts +18 -0
- package/dist/commands/memory/consolidation/undo.js +61 -0
- package/dist/commands/messages/list.js +9 -1
- package/dist/commands/slack/mutes.d.ts +10 -0
- package/dist/commands/slack/mutes.js +62 -0
- package/dist/commands/slack/unmute.d.ts +12 -0
- package/dist/commands/slack/unmute.js +44 -0
- package/dist/commands/tasks/actionability.js +10 -0
- package/dist/commands/tasks/ask.d.ts +50 -0
- package/dist/commands/tasks/ask.js +190 -0
- package/dist/commands/tasks/bulk-update.js +12 -0
- package/dist/commands/tasks/handover.js +14 -0
- package/dist/commands/tasks/input/answer.js +8 -2
- package/dist/commands/tasks/input/show.d.ts +26 -0
- package/dist/commands/tasks/input/show.js +185 -17
- package/dist/commands/tasks/list.d.ts +8 -0
- package/dist/commands/tasks/list.js +50 -9
- package/dist/commands/tasks/move.d.ts +3 -0
- package/dist/commands/tasks/move.js +71 -1
- package/dist/commands/tasks/result/show.js +19 -7
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/runs.d.ts +4 -1
- package/dist/commands/tasks/runs.js +22 -3
- package/dist/commands/tasks/show.d.ts +4 -3
- package/dist/commands/tasks/show.js +40 -7
- package/dist/commands/tasks/start.js +35 -16
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +55 -1
- package/dist/commands/tasks/updates/add.js +3 -0
- package/dist/commands/tasks/wait.d.ts +20 -0
- package/dist/commands/tasks/wait.js +103 -2
- package/dist/generated/agent-guides.json +892 -183
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-access-command.d.ts +19 -0
- package/dist/lib/agent-access-command.js +44 -0
- package/dist/lib/agent-access.d.ts +18 -0
- package/dist/lib/agent-access.js +48 -0
- package/dist/lib/agent-import/apply.d.ts +50 -0
- package/dist/lib/agent-import/apply.js +85 -0
- package/dist/lib/agent-import/plan.d.ts +132 -0
- package/dist/lib/agent-import/plan.js +504 -0
- package/dist/lib/agent-import/reader.d.ts +94 -0
- package/dist/lib/agent-import/reader.js +326 -0
- package/dist/lib/agent-import/schedule.d.ts +46 -0
- package/dist/lib/agent-import/schedule.js +220 -0
- package/dist/lib/agent-import/sources.d.ts +124 -0
- package/dist/lib/agent-import/sources.js +797 -0
- 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/followups.d.ts +61 -0
- package/dist/lib/followups.js +39 -0
- package/dist/lib/handover-interview.d.ts +18 -0
- package/dist/lib/handover-interview.js +53 -0
- package/dist/lib/inbound-messages.d.ts +156 -0
- package/dist/lib/inbound-messages.js +375 -0
- package/dist/lib/input-queue.js +2 -1
- package/dist/lib/intuition-look.d.ts +10 -0
- package/dist/lib/intuition-look.js +64 -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/record-output.d.ts +1 -1
- package/dist/lib/record-output.js +2 -0
- package/dist/lib/skill-import.d.ts +19 -0
- package/dist/lib/skill-import.js +34 -0
- package/dist/lib/slack-thread-mutes.d.ts +25 -0
- package/dist/lib/slack-thread-mutes.js +12 -0
- package/dist/lib/task-carriers.d.ts +18 -0
- package/dist/lib/task-carriers.js +43 -0
- package/dist/lib/task-extras.d.ts +5 -0
- package/dist/lib/task-extras.js +5 -0
- 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-recurrence-summary.d.ts +15 -0
- package/dist/lib/task-recurrence-summary.js +22 -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 +53 -0
- package/dist/lib/task-version.js +89 -0
- package/dist/lib/task-write-attribution.d.ts +7 -0
- package/dist/lib/task-write-attribution.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.js +124 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.js +141 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +13492 -12505
- package/oclif.manifest.json +2090 -132
- package/package.json +9 -2
|
@@ -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') {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/** One shared row as a line: the key, then the start of its content on one line. */
|
|
3
|
+
export declare function sharedMemoryLine(row: {
|
|
4
|
+
key: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}, width?: number): string;
|
|
7
|
+
/**
|
|
8
|
+
* The exact memory rows a release of this agent would carry (share mode
|
|
9
|
+
* `memory` or `full`), and the rows the publish scan keeps back with the reason
|
|
10
|
+
* for each (OSK-33159). Installers receive the rows marked as shared by you:
|
|
11
|
+
* notes, not instructions. Pass the printed digest to `skrr agents visibility
|
|
12
|
+
* --shared-memory-digest` and the publish is refused if the rows changed since.
|
|
13
|
+
*/
|
|
14
|
+
export default class AgentsSharedMemory extends BaseCommand {
|
|
15
|
+
static description: string;
|
|
16
|
+
static examples: string[];
|
|
17
|
+
static args: {
|
|
18
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
static flags: {
|
|
21
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sharedMemoryLine = sharedMemoryLine;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../base-command");
|
|
7
|
+
/** One shared row as a line: the key, then the start of its content on one line. */
|
|
8
|
+
function sharedMemoryLine(row, width = 100) {
|
|
9
|
+
const content = row.content.replace(/\s+/g, ' ').trim();
|
|
10
|
+
const shown = content.length > width ? `${content.slice(0, width - 1)}…` : content;
|
|
11
|
+
return ` ${row.key}: ${shown}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The exact memory rows a release of this agent would carry (share mode
|
|
15
|
+
* `memory` or `full`), and the rows the publish scan keeps back with the reason
|
|
16
|
+
* for each (OSK-33159). Installers receive the rows marked as shared by you:
|
|
17
|
+
* notes, not instructions. Pass the printed digest to `skrr agents visibility
|
|
18
|
+
* --shared-memory-digest` and the publish is refused if the rows changed since.
|
|
19
|
+
*/
|
|
20
|
+
class AgentsSharedMemory extends base_command_1.BaseCommand {
|
|
21
|
+
static description = 'Show the memory rows a release of an agent would share, and the rows kept back';
|
|
22
|
+
static examples = [
|
|
23
|
+
'<%= config.bin %> agents shared-memory <agent-id>',
|
|
24
|
+
'<%= config.bin %> agents shared-memory <agent-id> --json',
|
|
25
|
+
];
|
|
26
|
+
static args = {
|
|
27
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
28
|
+
};
|
|
29
|
+
static flags = {
|
|
30
|
+
json: core_1.Flags.boolean({ description: 'Output the preview as JSON' }),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
this.requireAuth();
|
|
34
|
+
const { args, flags } = await this.parse(AgentsSharedMemory);
|
|
35
|
+
let preview;
|
|
36
|
+
try {
|
|
37
|
+
preview = await data_provider_1.dataService.getAgentSharedMemoryPreview(args.id);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
this.handleApiError(err);
|
|
41
|
+
}
|
|
42
|
+
if (flags.json) {
|
|
43
|
+
this.printJsonResult(preview);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const { memories, withheld, omitted, digest } = preview;
|
|
47
|
+
if (!memories.length) {
|
|
48
|
+
this.log('No memories would ship with a release of this agent.');
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.log(`Installers receive ${memories.length} ${memories.length === 1 ? 'memory' : 'memories'}, marked as shared by you: notes, not instructions.`);
|
|
52
|
+
for (const row of memories)
|
|
53
|
+
this.log(sharedMemoryLine(row));
|
|
54
|
+
}
|
|
55
|
+
if (omitted)
|
|
56
|
+
this.log(`${omitted} more past the limit are not shared.`);
|
|
57
|
+
if (withheld.length) {
|
|
58
|
+
this.log('');
|
|
59
|
+
this.log(`Kept back (${withheld.length}):`);
|
|
60
|
+
for (const row of withheld)
|
|
61
|
+
this.log(` ${row.key}: ${(0, data_provider_1.sharedMemoryWithheldCopy)(row.reason)}`);
|
|
62
|
+
}
|
|
63
|
+
this.log('');
|
|
64
|
+
this.log(`To publish exactly these rows: skrr agents visibility ${args.id} --public --share-mode memory --shared-memory-digest ${digest}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.default = AgentsSharedMemory;
|
|
@@ -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`
|
|
@@ -59,6 +59,7 @@ export default class AgentsVisibility extends BaseCommand {
|
|
|
59
59
|
private: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
60
60
|
price: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
61
61
|
'share-mode': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
62
|
+
'shared-memory-digest': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
62
63
|
changelog: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
63
64
|
'version-major': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
64
65
|
'version-minor': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -146,6 +146,7 @@ class AgentsVisibility extends base_command_1.BaseCommand {
|
|
|
146
146
|
'<%= config.bin %> agents visibility <agent-id> --public --license proprietary --source-visibility sealed',
|
|
147
147
|
'<%= config.bin %> agents visibility <agent-id> --public --slug trip-planner',
|
|
148
148
|
'<%= config.bin %> agents visibility <agent-id> --public --price 5000000 --trial-brief @trial-brief.md',
|
|
149
|
+
'<%= config.bin %> agents visibility <agent-id> --public --share-mode memory --shared-memory-digest <digest>',
|
|
149
150
|
];
|
|
150
151
|
static args = {
|
|
151
152
|
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
@@ -167,6 +168,11 @@ class AgentsVisibility extends base_command_1.BaseCommand {
|
|
|
167
168
|
description: 'Published data sharing mode',
|
|
168
169
|
options: ['none', 'bootstrap', 'memory', 'full'],
|
|
169
170
|
}),
|
|
171
|
+
'shared-memory-digest': core_1.Flags.string({
|
|
172
|
+
description: 'The digest `skrr agents shared-memory <id>` printed for the memory rows you reviewed. ' +
|
|
173
|
+
'With it, the publish is refused (SHARED_MEMORY_CHANGED) if the rows a memory or full ' +
|
|
174
|
+
'share mode would carry changed since; without it they ship as they are now',
|
|
175
|
+
}),
|
|
170
176
|
changelog: core_1.Flags.string({ description: 'Release changelog' }),
|
|
171
177
|
'version-major': core_1.Flags.integer({ description: 'Explicit release major version' }),
|
|
172
178
|
'version-minor': core_1.Flags.integer({ description: 'Explicit release minor version' }),
|
|
@@ -250,6 +256,11 @@ class AgentsVisibility extends base_command_1.BaseCommand {
|
|
|
250
256
|
if ((license || sourceVisibility) && !isPublic) {
|
|
251
257
|
this.error('--license, --remix and --source-visibility are terms of a public release; pass them with --public.', { exit: 1 });
|
|
252
258
|
}
|
|
259
|
+
if (flags['shared-memory-digest'] && !isPublic) {
|
|
260
|
+
this.error('--shared-memory-digest binds the rows of a public release; pass it with --public.', {
|
|
261
|
+
exit: 1,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
253
264
|
const { trialBrief, error: trialBriefError } = resolveTrialBrief(flags['trial-brief']);
|
|
254
265
|
if (trialBriefError)
|
|
255
266
|
this.error(trialBriefError, { exit: 1 });
|
|
@@ -275,6 +286,9 @@ class AgentsVisibility extends base_command_1.BaseCommand {
|
|
|
275
286
|
isPublic,
|
|
276
287
|
price: flags.price,
|
|
277
288
|
shareMode: flags['share-mode'],
|
|
289
|
+
...(flags['shared-memory-digest']
|
|
290
|
+
? { sharedMemoryDigest: flags['shared-memory-digest'] }
|
|
291
|
+
: {}),
|
|
278
292
|
changelog: flags.changelog,
|
|
279
293
|
versionMajor: flags['version-major'],
|
|
280
294
|
versionMinor: flags['version-minor'],
|
|
@@ -35,10 +35,12 @@ class CodeMigrate extends core_1.Command {
|
|
|
35
35
|
description: 'Actually perform the migration (default is a dry run)',
|
|
36
36
|
default: false,
|
|
37
37
|
}),
|
|
38
|
+
// No `dependsOn: ['apply']`: `--apply` defaults to false, so oclif counted it as
|
|
39
|
+
// present and the dependency never fired. Without --apply this is a dry run that
|
|
40
|
+
// previews what --overwrite would replace, which is what it has always done.
|
|
38
41
|
overwrite: core_1.Flags.boolean({
|
|
39
42
|
description: `Replace existing ${auth_core_1.FIRST_PARTY_HARNESS.displayName} files, moving each aside to a timestamped .bak first`,
|
|
40
43
|
default: false,
|
|
41
|
-
dependsOn: ['apply'],
|
|
42
44
|
}),
|
|
43
45
|
scope: core_1.Flags.string({
|
|
44
46
|
description: 'Which configuration scope to migrate',
|
|
@@ -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) {
|
|
@@ -17,20 +17,23 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
17
17
|
};
|
|
18
18
|
static flags = {
|
|
19
19
|
at: core_1.Flags.string({ description: 'Earlier time in ISO 8601 with a timezone' }),
|
|
20
|
-
confirm: core_1.Flags.boolean({
|
|
21
|
-
|
|
20
|
+
confirm: core_1.Flags.boolean({
|
|
21
|
+
description: 'Schedule the earlier check after checking the current slot',
|
|
22
|
+
}),
|
|
23
|
+
fresh: core_1.Flags.boolean({
|
|
24
|
+
description: 'Request a refresh of declared Agent observations for this Check',
|
|
25
|
+
}),
|
|
22
26
|
'request-id': core_1.Flags.string({ description: 'UUID to reuse when retrying a confirmed request' }),
|
|
23
27
|
cancel: core_1.Flags.string({ description: 'Cancel a pending advance by its ID' }),
|
|
24
28
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
25
29
|
};
|
|
26
30
|
async run() {
|
|
27
31
|
this.requireAuth();
|
|
28
|
-
const { args: { id }, flags } = await this.parse(DutiesAdvanceNext);
|
|
32
|
+
const { args: { id }, flags, } = await this.parse(DutiesAdvanceNext);
|
|
29
33
|
if (flags.cancel && (flags.at || flags.confirm || flags.fresh || flags['request-id'])) {
|
|
30
34
|
this.error('Use --cancel by itself.');
|
|
31
35
|
}
|
|
32
|
-
if (((flags.confirm || flags.fresh) && !flags.at) ||
|
|
33
|
-
(flags['request-id'] && !flags.confirm)) {
|
|
36
|
+
if (((flags.confirm || flags.fresh) && !flags.at) || (flags['request-id'] && !flags.confirm)) {
|
|
34
37
|
this.error('Provide --at with --confirm or --fresh. Use --request-id with --confirm.');
|
|
35
38
|
}
|
|
36
39
|
let result;
|
|
@@ -74,7 +77,7 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
74
77
|
}
|
|
75
78
|
const url = (0, web_url_1.dutyUrlFrom)(this.cliConfig.baseURL, { id });
|
|
76
79
|
if (flags.json) {
|
|
77
|
-
this.
|
|
80
|
+
this.printJsonResult({ ...result, url });
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
83
|
if (result.proposal) {
|
|
@@ -86,7 +89,7 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
86
89
|
: 'Evidence Use the Duty’s configured evidence');
|
|
87
90
|
}
|
|
88
91
|
if (result.current) {
|
|
89
|
-
const { status, id: advanceId, at, originalAt, occurrenceId, checkId, reason } = result.current;
|
|
92
|
+
const { status, id: advanceId, at, originalAt, occurrenceId, checkId, reason, } = result.current;
|
|
90
93
|
this.log(`Advance ${status} (${advanceId})`);
|
|
91
94
|
this.log(`Earlier check ${at}`);
|
|
92
95
|
this.log(`Original slot ${originalAt}`);
|
|
@@ -98,6 +101,8 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
98
101
|
const receipt = new URL(url);
|
|
99
102
|
receipt.searchParams.set('view', 'activity');
|
|
100
103
|
receipt.searchParams.set('checkId', checkId);
|
|
104
|
+
// Without it the page opens the raw Check and not its execution receipt (OSK-33097).
|
|
105
|
+
receipt.searchParams.set('receipt', '1');
|
|
101
106
|
this.log(`Check receipt ${receipt.toString()}`);
|
|
102
107
|
}
|
|
103
108
|
if (result.current.handoff === 'coalesced' && !checkId) {
|
|
@@ -111,6 +116,10 @@ class DutiesAdvanceNext extends base_command_1.BaseCommand {
|
|
|
111
116
|
}
|
|
112
117
|
else if (!result.proposal) {
|
|
113
118
|
this.log('There is no earlier check scheduled.');
|
|
119
|
+
// A bare call is a status read, so say what moves a check (OSK-33184).
|
|
120
|
+
if (!flags.at) {
|
|
121
|
+
this.log('To move the next check earlier, preview it with --at <ISO 8601 time>, then add --confirm.');
|
|
122
|
+
}
|
|
114
123
|
}
|
|
115
124
|
if (result.allowance?.runsToday != null && result.allowance.maxRunsPerDay != null) {
|
|
116
125
|
this.log(`Agent Runs used today ${result.allowance.runsToday}/${result.allowance.maxRunsPerDay}`);
|