@skrr-ai/cli 0.1.219 → 0.1.221
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/approve.d.ts +3 -2
- package/dist/commands/agent/message/approve.js +4 -14
- package/dist/commands/agent/message/decline.d.ts +3 -2
- package/dist/commands/agent/message/decline.js +4 -14
- package/dist/commands/agent/message/pending.js +2 -12
- package/dist/commands/agent/message/review.js +2 -11
- package/dist/commands/agents/chat.d.ts +1 -1
- package/dist/commands/agents/chat.js +40 -25
- package/dist/commands/agents/tools/calls.js +2 -1
- package/dist/commands/convos/show.js +1 -1
- package/dist/commands/convos/transcript.js +1 -0
- package/dist/commands/dm/messages.js +3 -1
- package/dist/commands/duties/create.js +5 -6
- package/dist/commands/duties/update.js +8 -14
- package/dist/generated/agent-guides.json +93 -93
- package/dist/lib/agent-chat-queue.d.ts +1 -0
- package/dist/lib/agent-chat-queue.js +23 -3
- package/dist/lib/agentic-stream.d.ts +3 -1
- package/dist/lib/agentic-stream.js +38 -3
- package/dist/lib/duties.d.ts +11 -5
- package/dist/lib/duties.js +11 -5
- package/dist/lib/node-adapter.js +4 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10322 -10290
- package/oclif.manifest.json +6 -6
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
* Approve an Agent's message that is waiting for your approval, and deliver it
|
|
4
|
-
*
|
|
3
|
+
* Approve an Agent's message that is waiting for your approval, and deliver it.
|
|
4
|
+
* A person or their Agent may decide (OSK-33488, owner decision 2026-11-29); an Agent's decision is
|
|
5
|
+
* recorded as the Agent. The server refuses an automation credential (OSK-22364).
|
|
5
6
|
*/
|
|
6
7
|
export default class AgentMessageApprove extends BaseCommand {
|
|
7
8
|
static description: string;
|
|
@@ -4,10 +4,10 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
-
const message_intent_1 = require("../../../lib/message-intent");
|
|
8
7
|
/**
|
|
9
|
-
* Approve an Agent's message that is waiting for your approval, and deliver it
|
|
10
|
-
*
|
|
8
|
+
* Approve an Agent's message that is waiting for your approval, and deliver it.
|
|
9
|
+
* A person or their Agent may decide (OSK-33488, owner decision 2026-11-29); an Agent's decision is
|
|
10
|
+
* recorded as the Agent. The server refuses an automation credential (OSK-22364).
|
|
11
11
|
*/
|
|
12
12
|
class AgentMessageApprove extends base_command_1.BaseCommand {
|
|
13
13
|
static description = "Approve an Agent's message that is waiting for your approval, and deliver it";
|
|
@@ -32,17 +32,7 @@ class AgentMessageApprove extends base_command_1.BaseCommand {
|
|
|
32
32
|
};
|
|
33
33
|
async run() {
|
|
34
34
|
const { args, flags } = await this.parse(AgentMessageApprove);
|
|
35
|
-
|
|
36
|
-
requireHumanAuth: () => this.requireAuth(),
|
|
37
|
-
});
|
|
38
|
-
if (sessionContext) {
|
|
39
|
-
this.failWithCliError({
|
|
40
|
-
message: 'Only a person can see and decide on messages waiting for approval, not an Agent session.',
|
|
41
|
-
code: 'HUMAN_APPROVAL_REQUIRED',
|
|
42
|
-
exit: 2,
|
|
43
|
-
retryable: false,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
35
|
+
this.requireAuth();
|
|
46
36
|
let agentId;
|
|
47
37
|
try {
|
|
48
38
|
const explicitAgentId = (0, agent_resolver_1.mergeExplicitAgentInputs)([{ label: '--agent', value: flags.agent }]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
* Decline an Agent's message that is waiting for your approval, and cancel it
|
|
4
|
-
*
|
|
3
|
+
* Decline an Agent's message that is waiting for your approval, and cancel it.
|
|
4
|
+
* A person or their Agent may decide (OSK-33488, owner decision 2026-11-29); an Agent's decision is
|
|
5
|
+
* recorded as the Agent. The server refuses an automation credential (OSK-22364).
|
|
5
6
|
*/
|
|
6
7
|
export default class AgentMessageDecline extends BaseCommand {
|
|
7
8
|
static description: string;
|
|
@@ -4,10 +4,10 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
-
const message_intent_1 = require("../../../lib/message-intent");
|
|
8
7
|
/**
|
|
9
|
-
* Decline an Agent's message that is waiting for your approval, and cancel it
|
|
10
|
-
*
|
|
8
|
+
* Decline an Agent's message that is waiting for your approval, and cancel it.
|
|
9
|
+
* A person or their Agent may decide (OSK-33488, owner decision 2026-11-29); an Agent's decision is
|
|
10
|
+
* recorded as the Agent. The server refuses an automation credential (OSK-22364).
|
|
11
11
|
*/
|
|
12
12
|
class AgentMessageDecline extends base_command_1.BaseCommand {
|
|
13
13
|
static description = "Decline an Agent's message that is waiting for your approval, and cancel it";
|
|
@@ -32,17 +32,7 @@ class AgentMessageDecline extends base_command_1.BaseCommand {
|
|
|
32
32
|
};
|
|
33
33
|
async run() {
|
|
34
34
|
const { args, flags } = await this.parse(AgentMessageDecline);
|
|
35
|
-
|
|
36
|
-
requireHumanAuth: () => this.requireAuth(),
|
|
37
|
-
});
|
|
38
|
-
if (sessionContext) {
|
|
39
|
-
this.failWithCliError({
|
|
40
|
-
message: 'Only a person can see and decide on messages waiting for approval, not an Agent session.',
|
|
41
|
-
code: 'HUMAN_APPROVAL_REQUIRED',
|
|
42
|
-
exit: 2,
|
|
43
|
-
retryable: false,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
35
|
+
this.requireAuth();
|
|
46
36
|
let agentId;
|
|
47
37
|
try {
|
|
48
38
|
const explicitAgentId = (0, agent_resolver_1.mergeExplicitAgentInputs)([{ label: '--agent', value: flags.agent }]);
|
|
@@ -4,7 +4,6 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
-
const message_intent_1 = require("../../../lib/message-intent");
|
|
8
7
|
/**
|
|
9
8
|
* The owner's view of an Agent's own messages that are waiting on `ask_first`. Without this the
|
|
10
9
|
* Gateway held them and told nobody (OSK-22364): `skrr agent message send` answered
|
|
@@ -25,17 +24,8 @@ class AgentMessagePending extends base_command_1.BaseCommand {
|
|
|
25
24
|
};
|
|
26
25
|
async run() {
|
|
27
26
|
const { args, flags } = await this.parse(AgentMessagePending);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
if (sessionContext) {
|
|
32
|
-
this.failWithCliError({
|
|
33
|
-
message: 'Only a person can see and decide on messages waiting for approval, not an Agent session.',
|
|
34
|
-
code: 'HUMAN_APPROVAL_REQUIRED',
|
|
35
|
-
exit: 2,
|
|
36
|
-
retryable: false,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
27
|
+
// A person or their Agent may see what waits (OSK-33488); the server refuses automation.
|
|
28
|
+
this.requireAuth();
|
|
39
29
|
let agentId;
|
|
40
30
|
try {
|
|
41
31
|
const explicitAgentId = (0, agent_resolver_1.mergeExplicitAgentInputs)([
|
|
@@ -4,7 +4,6 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
-
const message_intent_1 = require("../../../lib/message-intent");
|
|
8
7
|
/** Prepare and show the current message; this command does not decide it. */
|
|
9
8
|
class AgentMessageReview extends base_command_1.BaseCommand {
|
|
10
9
|
static description = 'Review the current pending Agent message before deciding';
|
|
@@ -17,16 +16,8 @@ class AgentMessageReview extends base_command_1.BaseCommand {
|
|
|
17
16
|
};
|
|
18
17
|
async run() {
|
|
19
18
|
const { args, flags } = await this.parse(AgentMessageReview);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
if (sessionContext)
|
|
24
|
-
this.failWithCliError({
|
|
25
|
-
message: 'Only a person can review a pending message.',
|
|
26
|
-
code: 'HUMAN_APPROVAL_REQUIRED',
|
|
27
|
-
exit: 2,
|
|
28
|
-
retryable: false,
|
|
29
|
-
});
|
|
19
|
+
// A person or their Agent may review (OSK-33488); the server refuses automation.
|
|
20
|
+
this.requireAuth();
|
|
30
21
|
let agentId;
|
|
31
22
|
try {
|
|
32
23
|
const explicit = (0, agent_resolver_1.mergeExplicitAgentInputs)([{ label: '--agent', value: flags.agent }]);
|
|
@@ -49,7 +49,7 @@ export declare function cancelNotice(input: {
|
|
|
49
49
|
}): string | null;
|
|
50
50
|
/**
|
|
51
51
|
* Exit code for a streamed run that reached its terminal state: 1 when it
|
|
52
|
-
* failed, 0
|
|
52
|
+
* failed or was stopped, and 0 for completion. A local signal has its own exit status.
|
|
53
53
|
*
|
|
54
54
|
* The streaming modes share this line. `--jsonl` used to print `run.result
|
|
55
55
|
* {status: "failed"}` and exit 0 while the human mode exited 1 for the same run
|
|
@@ -89,7 +89,7 @@ function cancelNotice(input) {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Exit code for a streamed run that reached its terminal state: 1 when it
|
|
92
|
-
* failed, 0
|
|
92
|
+
* failed or was stopped, and 0 for completion. A local signal has its own exit status.
|
|
93
93
|
*
|
|
94
94
|
* The streaming modes share this line. `--jsonl` used to print `run.result
|
|
95
95
|
* {status: "failed"}` and exit 0 while the human mode exited 1 for the same run
|
|
@@ -97,7 +97,7 @@ function cancelNotice(input) {
|
|
|
97
97
|
* a failure here, unlike `--no-stream`: a turn that only ran tools is a success.
|
|
98
98
|
*/
|
|
99
99
|
function streamedResultExitCode(result) {
|
|
100
|
-
return result.status === 'failed' ? 1 : 0;
|
|
100
|
+
return result.status === 'failed' || result.status === 'aborted' ? 1 : 0;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* What to say when the user pressed Ctrl-C and the run did not stop.
|
|
@@ -167,8 +167,9 @@ function cancelledRunMessage(input) {
|
|
|
167
167
|
* because a long tool call is silence, not a failure.
|
|
168
168
|
*/
|
|
169
169
|
function reconcileTerminalFromMessages(messages, responseMessageId) {
|
|
170
|
-
const row =
|
|
171
|
-
|
|
170
|
+
const row = responseMessageId
|
|
171
|
+
? messages.find((m) => m?.messageId === responseMessageId && m.isCreatedByUser === false)
|
|
172
|
+
: [...messages].reverse().find((m) => m && m.isCreatedByUser === false);
|
|
172
173
|
if (!row)
|
|
173
174
|
return null;
|
|
174
175
|
const projection = row.metadata && typeof row.metadata === 'object'
|
|
@@ -177,21 +178,24 @@ function reconcileTerminalFromMessages(messages, responseMessageId) {
|
|
|
177
178
|
const publicProjection = (0, data_provider_1.isDecodedPublicProjection)(projection)
|
|
178
179
|
? { publicProjection: projection }
|
|
179
180
|
: {};
|
|
181
|
+
const outcome = (0, data_provider_1.turnRecordNegativeStatus)(row);
|
|
182
|
+
if (outcome === 'cancelled')
|
|
183
|
+
return { status: 'aborted', text: '', ...publicProjection };
|
|
180
184
|
const failure = (0, data_provider_1.resolveMessageFailure)(row);
|
|
181
|
-
if (
|
|
185
|
+
if (outcome === 'failed') {
|
|
182
186
|
return {
|
|
183
187
|
status: 'failed',
|
|
184
188
|
...publicProjection,
|
|
185
|
-
...(failure
|
|
189
|
+
...(failure?.answer ? { text: failure.answer } : {}),
|
|
186
190
|
// The reason exists on the row; it simply never reached the surface. Say
|
|
187
191
|
// it, rather than the transport error that masked it (OSK-7595).
|
|
188
|
-
error: failure
|
|
192
|
+
error: failure?.reason ?? 'The run failed. No reason was recorded on the message.',
|
|
189
193
|
// Provisional, not final: the server rewrites this row from the
|
|
190
194
|
// machine's own turn-end (OSK-13543).
|
|
191
195
|
...(agenticErrorSubtype(row) === agentic_stream_1.DAEMON_HANDOVER_REASON ? { handedOver: true } : {}),
|
|
192
196
|
};
|
|
193
197
|
}
|
|
194
|
-
const text =
|
|
198
|
+
const text = settledReplyText(messages, row);
|
|
195
199
|
// `unfinished: false` is the persister's terminal marker; an empty body with
|
|
196
200
|
// it set is a turn that ended having produced nothing, which is still
|
|
197
201
|
// terminal and still better reported than waited on.
|
|
@@ -199,6 +203,17 @@ function reconcileTerminalFromMessages(messages, responseMessageId) {
|
|
|
199
203
|
return { status: 'completed', text, ...publicProjection };
|
|
200
204
|
return null;
|
|
201
205
|
}
|
|
206
|
+
function settledReplyText(messages, turn) {
|
|
207
|
+
const resultId = typeof turn.chatTurnResultId === 'string' ? turn.chatTurnResultId : null;
|
|
208
|
+
const reply = resultId
|
|
209
|
+
? messages.find((message) => message?.messageId === resultId &&
|
|
210
|
+
message.conversationId === turn.conversationId &&
|
|
211
|
+
message.isCreatedByUser === false)
|
|
212
|
+
: undefined;
|
|
213
|
+
if (typeof reply?.text === 'string')
|
|
214
|
+
return reply.text;
|
|
215
|
+
return !turn.chatTurnReplyVersion && typeof turn.text === 'string' ? turn.text : '';
|
|
216
|
+
}
|
|
202
217
|
function agenticRecord(row) {
|
|
203
218
|
const metadata = row.metadata;
|
|
204
219
|
if (!metadata || typeof metadata !== 'object')
|
|
@@ -259,7 +274,7 @@ function handoverStateFromMessages(messages, responseMessageId) {
|
|
|
259
274
|
return {
|
|
260
275
|
state: 'repaired',
|
|
261
276
|
...publicProjection,
|
|
262
|
-
text:
|
|
277
|
+
text: settledReplyText(messages, row),
|
|
263
278
|
...(repairedAt ? { repairedAt } : {}),
|
|
264
279
|
};
|
|
265
280
|
}
|
|
@@ -527,11 +542,10 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
527
542
|
description: 'Emit one JSON event per line while streaming. Every line is a complete JSON value. ' +
|
|
528
543
|
'Assistant text arrives as `text.delta`, a real delta: `delta` is the characters it ' +
|
|
529
544
|
'adds, and a rewrite that is not an append arrives as `replace`, the new full text. ' +
|
|
530
|
-
'
|
|
531
|
-
'
|
|
532
|
-
'far; it grows with the square of
|
|
533
|
-
'
|
|
534
|
-
'so folding both doubles the answer: pick ONE lane. A widget the agent wrote ' +
|
|
545
|
+
'Fold `text.delta` for live progress. On a compatible runtime, `run.result` holds ' +
|
|
546
|
+
'the confirmed final reply. (--cumulative restores the older form, where `text` is ' +
|
|
547
|
+
'the whole streamed text so far; it grows with the square of its length.) ' +
|
|
548
|
+
'Read `session.output` for the raw execution stream. A widget the agent wrote ' +
|
|
535
549
|
'(a block of CSS, HTML and JavaScript the apps draw) is its text description in ' +
|
|
536
550
|
'`text.delta` and `run.result`; the `session.output` lane carries the block itself. ' +
|
|
537
551
|
'Inside a `session.output`, ' +
|
|
@@ -547,8 +561,8 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
547
561
|
'calls arrive as `tool.started` / `tool.completed`, once per `toolUseId`, on cloud ' +
|
|
548
562
|
'and local-harness runs alike. A `session.notice` with `notice: ' +
|
|
549
563
|
'"harness-session-reset"` means the local harness could not resume its previous ' +
|
|
550
|
-
'session and started a new one
|
|
551
|
-
'
|
|
564
|
+
'session and started a new one. `message` states the cause and whether conversation ' +
|
|
565
|
+
'history was restored. `notice: "model-request-retrying"` means the ' +
|
|
552
566
|
'model rejected or could not answer a request and the harness is retrying it: ' +
|
|
553
567
|
'`message` names the cause (for example the model rejecting the credentials on ' +
|
|
554
568
|
'this machine, HTTP 403) and the attempt, a few times per retry episode, so a ' +
|
|
@@ -809,7 +823,7 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
809
823
|
const listHint = `${this.config.bin} agents queue list --conversation ${input.conversationId}`;
|
|
810
824
|
switch (waited.outcome) {
|
|
811
825
|
case 'sent':
|
|
812
|
-
return startedHere;
|
|
826
|
+
return { ...startedHere, ...waited.turn };
|
|
813
827
|
case 'held':
|
|
814
828
|
return this.failWithCliError({
|
|
815
829
|
message: `The queued message could not be sent: ${waited.reason}${waited.card.holdMessage ? ` ${waited.card.holdMessage}` : ''} It is held in the queue; see it with \`${listHint}\`.`,
|
|
@@ -991,6 +1005,7 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
991
1005
|
sessionId: sent.sessionId,
|
|
992
1006
|
conversationId,
|
|
993
1007
|
responseMessageId: sent.responseMessageId,
|
|
1008
|
+
...waited.turn,
|
|
994
1009
|
};
|
|
995
1010
|
case 'held':
|
|
996
1011
|
return this.failWithCliError({
|
|
@@ -1669,13 +1684,18 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
1669
1684
|
baseURL: this.cliConfig.baseURL,
|
|
1670
1685
|
threadRootMessageId: flags['thread-root'],
|
|
1671
1686
|
}), null, 2));
|
|
1672
|
-
|
|
1673
|
-
|
|
1687
|
+
const exitCode = streamedResultExitCode(result);
|
|
1688
|
+
if (exitCode || !result.text?.trim())
|
|
1689
|
+
process.exitCode = exitCode || 1;
|
|
1674
1690
|
}
|
|
1675
1691
|
else if (result.status === 'failed') {
|
|
1676
1692
|
this.error(agentRunFailureMessage(result), { exit: 1 });
|
|
1677
1693
|
}
|
|
1678
|
-
else if (
|
|
1694
|
+
else if (result.status === 'aborted' && interruptedBy !== 'SIGHUP') {
|
|
1695
|
+
this.log(`\n${cancelledRunMessage({ sessionId: started.sessionId, conversationId: started.conversationId })}`);
|
|
1696
|
+
process.exitCode = streamedResultExitCode(result);
|
|
1697
|
+
}
|
|
1698
|
+
else if (quiet && result.status !== 'aborted') {
|
|
1679
1699
|
// Non-streaming human output: the answer the turn produced.
|
|
1680
1700
|
const noOutput = noOutputFailureMessage({
|
|
1681
1701
|
status: result.status,
|
|
@@ -1687,11 +1707,6 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
1687
1707
|
if (!noOutput)
|
|
1688
1708
|
this.log(result.text);
|
|
1689
1709
|
}
|
|
1690
|
-
else if (result.status === 'aborted' && interruptedBy !== 'SIGHUP') {
|
|
1691
|
-
// Streaming human mode: say the cancel took, rather than leave the keypress warning last.
|
|
1692
|
-
// (Not after SIGHUP: the terminal that would show it is gone.)
|
|
1693
|
-
this.log(`\n${cancelledRunMessage({ sessionId: started.sessionId, conversationId: started.conversationId })}`);
|
|
1694
|
-
}
|
|
1695
1710
|
// Human modes say it under the answer, on stderr. `--jsonl` carries it on `run.completed`
|
|
1696
1711
|
// and `run.result`, `--json` in its payload (OSK-33192).
|
|
1697
1712
|
const downgraded = !flags.jsonl && !(quiet && flags.json) && result.status === 'completed'
|
|
@@ -44,7 +44,8 @@ function toolCallsFromMessages(messages) {
|
|
|
44
44
|
toolUseId: String(call.id ?? '-'),
|
|
45
45
|
name: String(call.name ?? '-'),
|
|
46
46
|
args: clip(call.args, 200),
|
|
47
|
-
|
|
47
|
+
// A row stored before OSK-33503 carries the CLI's `PreToolUse:<tool> hook error: ` framing.
|
|
48
|
+
output: clip((0, data_provider_1.withoutHookResultFraming)(call.output), 200),
|
|
48
49
|
complete: Number(call.progress ?? 0) >= 1 || call.output != null,
|
|
49
50
|
source: 'message',
|
|
50
51
|
});
|
|
@@ -36,7 +36,7 @@ class ConvosShow extends base_command_1.BaseCommand {
|
|
|
36
36
|
this.log(`ID: ${c.conversationId ?? c._id ?? args.id}`);
|
|
37
37
|
this.log(`Title: ${c.title ?? '(untitled)'}`);
|
|
38
38
|
this.log(`Endpoint: ${c.endpoint ?? '-'}`);
|
|
39
|
-
this.log(`
|
|
39
|
+
this.log(`Default model: ${c.model ?? '-'}`);
|
|
40
40
|
this.log(`User: ${c.user ?? '-'}`);
|
|
41
41
|
if (c.createdAt) {
|
|
42
42
|
this.log(`Created: ${(0, format_1.localTime)(c.createdAt)}`);
|
|
@@ -27,6 +27,7 @@ exports.CONTEXT_BREAK_WORDS = {
|
|
|
27
27
|
cleared_after_failure: 'the previous session was cleared after a failure',
|
|
28
28
|
resume_failed: 'the previous session could not be resumed',
|
|
29
29
|
not_resumable: 'this kind of turn does not resume a session',
|
|
30
|
+
managed_turn_isolation: 'managed execution uses a fresh harness session per turn',
|
|
30
31
|
};
|
|
31
32
|
/** What each transcript source says in a turn header. Exhaustive by type. */
|
|
32
33
|
exports.TRANSCRIPT_SOURCE_WORDS = {
|
|
@@ -90,7 +90,9 @@ class DmMessages extends base_command_1.BaseCommand {
|
|
|
90
90
|
(0, format_1.renderTable)(selected.map((message) => ({
|
|
91
91
|
when: (0, format_1.localTime)(message.createdAt),
|
|
92
92
|
role: String(message.sender ?? (message.isCreatedByUser ? 'user' : 'assistant')),
|
|
93
|
-
text:
|
|
93
|
+
text: (0, data_provider_1.turnRecordNegativeStatus)(message) === 'cancelled'
|
|
94
|
+
? 'Stopped. See the session transcript for partial output.'
|
|
95
|
+
: textFromMessage(message).replace(RUN_RE, ' ').trim(),
|
|
94
96
|
id: String(message.messageId ?? message._id ?? message.id ?? '-'),
|
|
95
97
|
})), [
|
|
96
98
|
{ key: 'when', header: 'TIME', maxWidth: 20 },
|
|
@@ -485,10 +485,10 @@ JSON
|
|
|
485
485
|
}),
|
|
486
486
|
'max-nudges': core_1.Flags.string({ description: duty_attention_copy_1.MAX_NUDGES_FLAG_HELP }),
|
|
487
487
|
'max-concurrent-runs': core_1.Flags.string({
|
|
488
|
-
description: 'Owner concurrency policy: "unlimited" (default) or 1..100. Finite values require --concurrency-reason
|
|
488
|
+
description: 'Owner concurrency policy: "unlimited" (default) or 1..100. Finite values require --concurrency-reason. A person or their Agent sets it; an automated credential cannot.',
|
|
489
489
|
}),
|
|
490
490
|
'concurrency-reason': core_1.Flags.string({
|
|
491
|
-
description: 'Why
|
|
491
|
+
description: 'Why this finite Duty concurrency cap was chosen',
|
|
492
492
|
}),
|
|
493
493
|
};
|
|
494
494
|
async run() {
|
|
@@ -619,13 +619,12 @@ JSON
|
|
|
619
619
|
payload.createdVia = process.env.OVERSKY_AUTONOMOUS_SESSION === '1' ? 'agent_cli' : 'cli';
|
|
620
620
|
}
|
|
621
621
|
// `--from-json` is intentionally powerful, but it must not be an escape
|
|
622
|
-
// hatch around the same authoring
|
|
622
|
+
// hatch around the same authoring rule the explicit flag enforces. An Agent's
|
|
623
|
+
// session sets a finite cap as its person does (OSK-33488); the server refuses
|
|
624
|
+
// an automated credential and records which credential decided.
|
|
623
625
|
const envelope = policy.executionBudget;
|
|
624
626
|
if (envelope && Object.prototype.hasOwnProperty.call(envelope, 'maxConcurrentRuns')) {
|
|
625
627
|
const value = envelope.maxConcurrentRuns;
|
|
626
|
-
if (process.env.OVERSKY_AUTONOMOUS_SESSION === '1' && value != null) {
|
|
627
|
-
throw new Error('An autonomous Agent cannot activate a finite Duty concurrency cap from --from-json. Omit it or set it to null; an owner may set it later.');
|
|
628
|
-
}
|
|
629
628
|
if (value != null && !String(envelope.maxConcurrentRunsReason || '').trim()) {
|
|
630
629
|
throw new Error('A finite policy.executionBudget.maxConcurrentRuns in --from-json requires maxConcurrentRunsReason.');
|
|
631
630
|
}
|
|
@@ -156,10 +156,10 @@ JSON
|
|
|
156
156
|
description: duty_attention_copy_1.MAX_NUDGES_FLAG_HELP,
|
|
157
157
|
}),
|
|
158
158
|
'max-concurrent-runs': core_1.Flags.string({
|
|
159
|
-
description: 'Set 1..100, or "unlimited" to remove the owner cap. Finite values require --concurrency-reason.',
|
|
159
|
+
description: 'Set 1..100, or "unlimited" to remove the owner cap. Finite values require --concurrency-reason. A person or their Agent sets it; an automated credential cannot.',
|
|
160
160
|
}),
|
|
161
161
|
'concurrency-reason': core_1.Flags.string({
|
|
162
|
-
description: 'Why
|
|
162
|
+
description: 'Why this finite Duty concurrency cap was chosen',
|
|
163
163
|
}),
|
|
164
164
|
};
|
|
165
165
|
async run() {
|
|
@@ -449,19 +449,12 @@ JSON
|
|
|
449
449
|
const finalPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
|
|
450
450
|
? payload.policy
|
|
451
451
|
: undefined;
|
|
452
|
-
const finalEnvelope = finalPolicy?.executionBudget &&
|
|
453
|
-
typeof finalPolicy.executionBudget === 'object' &&
|
|
454
|
-
!Array.isArray(finalPolicy.executionBudget)
|
|
455
|
-
? finalPolicy.executionBudget
|
|
456
|
-
: undefined;
|
|
457
452
|
const quietHoursProblem = (0, duty_attention_copy_1.quietHoursInputProblem)(finalPolicy);
|
|
458
453
|
if (quietHoursProblem)
|
|
459
454
|
throw new Error(quietHoursProblem);
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
throw new Error('An autonomous Agent cannot change owner Duty concurrency policy. Ask the owner to run this update outside the Agent session.');
|
|
464
|
-
}
|
|
455
|
+
// OSK-33488, owner decision 2026-11-29: an Agent's session sets the concurrency policy as its
|
|
456
|
+
// person does, so there is no local refusal here (an autonomous session was refused); the
|
|
457
|
+
// server records the decision as the Agent's and still refuses an automated credential.
|
|
465
458
|
if (Array.isArray(payload.watchedSources)) {
|
|
466
459
|
payload.watchedSources = (0, duties_1.normalizeWatchedSourceDeclarations)(payload.watchedSources);
|
|
467
460
|
}
|
|
@@ -479,8 +472,9 @@ JSON
|
|
|
479
472
|
catch (err) {
|
|
480
473
|
this.handleApiError(err);
|
|
481
474
|
}
|
|
482
|
-
//
|
|
483
|
-
// (OSK-33445)
|
|
475
|
+
// A server from before OSK-33488 answers an Agent's cadence change to a non-draft Duty as a
|
|
476
|
+
// request for the owner (OSK-33445), with the cadence the Duty still has. A current server writes
|
|
477
|
+
// it and sends no receipt, so this is `undefined` and the update reads as any other.
|
|
484
478
|
const cadenceRequest = (0, duties_1.readDutyCadenceRequest)(duty);
|
|
485
479
|
const pendingCadence = cadenceRequest?.status === 'awaiting_approval';
|
|
486
480
|
// A replacement edit is accepted as written; these say what it removed. A cadence still waiting
|