@skrr-ai/cli 0.1.217 → 0.1.218
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/watch-escalated.d.ts +8 -0
- package/dist/commands/agent/message/watch-escalated.js +16 -0
- package/dist/commands/agent/message/watch-resolved.d.ts +8 -0
- package/dist/commands/agent/message/watch-resolved.js +16 -0
- package/dist/commands/convos/transcript.js +1 -0
- package/dist/lib/agent-chat-queue.js +3 -3
- package/dist/lib/watch-outcome-command.d.ts +14 -0
- package/dist/lib/watch-outcome-command.js +48 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.d.ts +17 -10
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.js +5 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.d.ts +17 -10
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.js +23 -12
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8192 -8179
- package/oclif.manifest.json +137 -1
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WatchOutcomeCommand } from '../../../lib/watch-outcome-command';
|
|
2
|
+
/** The watch check needs the owner: settle the follow-up as escalated. */
|
|
3
|
+
export default class AgentMessageWatchEscalated extends WatchOutcomeCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
protected get disposition(): "watch_escalated";
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const watch_outcome_command_1 = require("../../../lib/watch-outcome-command");
|
|
4
|
+
/** The watch check needs the owner: settle the follow-up as escalated. */
|
|
5
|
+
class AgentMessageWatchEscalated extends watch_outcome_command_1.WatchOutcomeCommand {
|
|
6
|
+
static description = 'Declare that this watch check needs the owner, so the follow-up is escalated (recorded on the wake’s run, replacing the FOLLOWUP_ESCALATE last line; wins over watch-resolved if both are declared). Only inside a scheduled watch wake';
|
|
7
|
+
static examples = ['<%= config.bin %> agent message watch-escalated'];
|
|
8
|
+
get disposition() {
|
|
9
|
+
return 'watch_escalated';
|
|
10
|
+
}
|
|
11
|
+
async run() {
|
|
12
|
+
await this.parse(AgentMessageWatchEscalated);
|
|
13
|
+
await this.declareWatchOutcome();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = AgentMessageWatchEscalated;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WatchOutcomeCommand } from '../../../lib/watch-outcome-command';
|
|
2
|
+
/** The watch check found what it was waiting for: settle the follow-up as resolved. */
|
|
3
|
+
export default class AgentMessageWatchResolved extends WatchOutcomeCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
protected get disposition(): "watch_resolved";
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const watch_outcome_command_1 = require("../../../lib/watch-outcome-command");
|
|
4
|
+
/** The watch check found what it was waiting for: settle the follow-up as resolved. */
|
|
5
|
+
class AgentMessageWatchResolved extends watch_outcome_command_1.WatchOutcomeCommand {
|
|
6
|
+
static description = 'Declare that this watch check found what it was waiting for, so the follow-up is resolved (recorded on the wake’s run, replacing the FOLLOWUP_RESOLVED last line). Only inside a scheduled watch wake';
|
|
7
|
+
static examples = ['<%= config.bin %> agent message watch-resolved'];
|
|
8
|
+
get disposition() {
|
|
9
|
+
return 'watch_resolved';
|
|
10
|
+
}
|
|
11
|
+
async run() {
|
|
12
|
+
await this.parse(AgentMessageWatchResolved);
|
|
13
|
+
await this.declareWatchOutcome();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = AgentMessageWatchResolved;
|
|
@@ -165,6 +165,7 @@ const USER_MESSAGE_ORIGIN_LABELS = {
|
|
|
165
165
|
heartbeat: 'heartbeat check-in, sent automatically',
|
|
166
166
|
subagent: 'sent by the Agent that delegated this work',
|
|
167
167
|
activity: 'sent automatically for new group or Space activity',
|
|
168
|
+
child_return: 'work you dispatched came back (a system note, not you)',
|
|
168
169
|
automatic: 'sent automatically',
|
|
169
170
|
};
|
|
170
171
|
function userMessageLines(item) {
|
|
@@ -75,7 +75,7 @@ async function waitForQueuedTurn(turn, { timeoutMs, onPaused, onPosition, deps =
|
|
|
75
75
|
let goneFor = 0;
|
|
76
76
|
for (;;) {
|
|
77
77
|
const snapshot = await read(turn.conversationId);
|
|
78
|
-
const ordered = [...snapshot.cards].sort((a, b) => a.position - b.position);
|
|
78
|
+
const ordered = [...snapshot.cards.filter((card) => !(0, data_provider_1.isSystemInputCard)(card))].sort((a, b) => a.position - b.position);
|
|
79
79
|
const index = ordered.findIndex((c) => c.clientInputId === turn.clientInputId);
|
|
80
80
|
const card = index >= 0 ? ordered[index] : null;
|
|
81
81
|
if (card) {
|
|
@@ -185,7 +185,7 @@ function clearQueue(conversationId) {
|
|
|
185
185
|
* characters.
|
|
186
186
|
*/
|
|
187
187
|
function resolveCard(snapshot, ref) {
|
|
188
|
-
const ordered = [...snapshot.cards].sort((a, b) => a.position - b.position);
|
|
188
|
+
const ordered = [...snapshot.cards.filter((card) => !(0, data_provider_1.isSystemInputCard)(card))].sort((a, b) => a.position - b.position);
|
|
189
189
|
const positional = /^#(\d+)$/.exec(ref);
|
|
190
190
|
if (positional)
|
|
191
191
|
return ordered[Number(positional[1]) - 1] ?? null;
|
|
@@ -221,7 +221,7 @@ function renderQueue(read) {
|
|
|
221
221
|
else
|
|
222
222
|
lines.push('A turn is running.');
|
|
223
223
|
}
|
|
224
|
-
const ordered = [...read.cards].sort((a, b) => a.position - b.position);
|
|
224
|
+
const ordered = [...read.cards.filter((card) => !(0, data_provider_1.isSystemInputCard)(card))].sort((a, b) => a.position - b.position);
|
|
225
225
|
if (ordered.length === 0) {
|
|
226
226
|
lines.push('The queue is empty.');
|
|
227
227
|
return lines;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WatchTurnDisposition } from '@skrr-ai/data-provider';
|
|
2
|
+
import { BaseCommand } from '../base-command';
|
|
3
|
+
/**
|
|
4
|
+
* Shared body of `agent message watch-resolved` and `watch-escalated`: a follow-up watch wake
|
|
5
|
+
* declares how it ended (OSK-33334). The server records it on the wake's Run, bound to the attempt
|
|
6
|
+
* and follow-up it resolves from the session token; nothing here names either.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class WatchOutcomeCommand extends BaseCommand {
|
|
9
|
+
protected abstract get disposition(): WatchTurnDisposition;
|
|
10
|
+
static flags: {
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
protected declareWatchOutcome(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WatchOutcomeCommand = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const base_command_1 = require("../base-command");
|
|
6
|
+
const api_fetch_1 = require("./api-fetch");
|
|
7
|
+
const message_intent_1 = require("./message-intent");
|
|
8
|
+
/**
|
|
9
|
+
* Shared body of `agent message watch-resolved` and `watch-escalated`: a follow-up watch wake
|
|
10
|
+
* declares how it ended (OSK-33334). The server records it on the wake's Run, bound to the attempt
|
|
11
|
+
* and follow-up it resolves from the session token; nothing here names either.
|
|
12
|
+
*/
|
|
13
|
+
class WatchOutcomeCommand extends base_command_1.BaseCommand {
|
|
14
|
+
static flags = {
|
|
15
|
+
json: core_1.Flags.boolean({
|
|
16
|
+
description: 'Accepted for consistency; this command always outputs JSON',
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
async declareWatchOutcome() {
|
|
20
|
+
const sessionContext = (0, message_intent_1.resolveMessageCommandSessionContext)({
|
|
21
|
+
// A person has no watch turn to settle: only a session can.
|
|
22
|
+
requireHumanAuth: () => undefined,
|
|
23
|
+
});
|
|
24
|
+
if (!sessionContext?.sessionId) {
|
|
25
|
+
this.failWithCliError({
|
|
26
|
+
message: `\`agent message ${this.disposition === 'watch_resolved' ? 'watch-resolved' : 'watch-escalated'}\` declares how a running watch check ended, so it only works inside a daemon session.`,
|
|
27
|
+
code: 'WATCH_OUTCOME_REQUIRES_SESSION',
|
|
28
|
+
exit: 2,
|
|
29
|
+
retryable: false,
|
|
30
|
+
details: {
|
|
31
|
+
suggestion: 'Run it from the scheduled watch check whose turn it is.',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const result = await (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(sessionContext.sessionId)}/turn-disposition`, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
credential: (0, message_intent_1.sessionCredential)(sessionContext.token),
|
|
39
|
+
body: { disposition: this.disposition },
|
|
40
|
+
});
|
|
41
|
+
this.printJsonResult(result);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.handleApiError(error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.WatchOutcomeCommand = WatchOutcomeCommand;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* a listed harness's dispatch, and seals the owner's message on the dispatch
|
|
10
10
|
* receipt the tools are checked against when one is called;
|
|
11
11
|
* - the server's intent check (`api/server/services/Duties/OwnerChatDutyIntent.js`)
|
|
12
|
-
*
|
|
13
|
-
* harness
|
|
12
|
+
* asks whether the owner's message authorizes the change, and refuses any
|
|
13
|
+
* harness this list does not name;
|
|
14
14
|
* - the daemon mints the session credential the tools need
|
|
15
15
|
* (`daemon/src/connection-helpers/session-credential.ts`) and admits the turn
|
|
16
16
|
* (`daemon/src/delegation-mcp/owner-chat-duty-gate.ts`) only for a listed
|
|
@@ -21,14 +21,21 @@
|
|
|
21
21
|
* it, and the daemon mints its credential. Listing one that lacks the second
|
|
22
22
|
* would offer tools whose every change is refused.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the
|
|
29
|
-
* (
|
|
30
|
-
*
|
|
31
|
-
* decision
|
|
24
|
+
* Where each listed harness's intent check runs:
|
|
25
|
+
*
|
|
26
|
+
* - `codex`: on the chat's own daemon, through Codex's native no-tools draft, on
|
|
27
|
+
* the person's own Codex sign-in.
|
|
28
|
+
* - `claude`: on the chat's own daemon, through the daemon's private Claude
|
|
29
|
+
* inference (no tools), on the person's own Claude sign-in.
|
|
30
|
+
* - the first-party harness: HOSTED, on the platform's managed inference, billed
|
|
31
|
+
* to the Agent's owner (owner decision recorded on OSK-33476). The daemon has no
|
|
32
|
+
* qualified local inference for it (`daemon/src/continuity/inference.ts`,
|
|
33
|
+
* `PROVIDERS`), and its turn's own model calls are already sent by the
|
|
34
|
+
* platform's managed inference, so the check sends nothing new off the machine.
|
|
35
|
+
* Its ACP backend mounts the tools on both engine paths (`daemon/src/backends/acp.ts`).
|
|
36
|
+
*
|
|
37
|
+
* The first two keep their local check: their bounded calls stay on the person's
|
|
38
|
+
* own sign-in, and nothing here moves them.
|
|
32
39
|
*
|
|
33
40
|
* The server stays the authority whatever this list says: the tools act only after
|
|
34
41
|
* `OwnerChatDuty.run` re-checks the stored owner stamp, the quoted request and the
|
|
@@ -23,7 +23,11 @@ __export(ownerChatDutyHarnesses_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(ownerChatDutyHarnesses_exports);
|
|
25
25
|
var import_firstPartyHarness = require("./firstPartyHarness.js");
|
|
26
|
-
const OWNER_CHAT_DUTY_TOOL_HARNESSES = Object.freeze([
|
|
26
|
+
const OWNER_CHAT_DUTY_TOOL_HARNESSES = Object.freeze([
|
|
27
|
+
"codex",
|
|
28
|
+
"claude",
|
|
29
|
+
import_firstPartyHarness.FIRST_PARTY_HARNESS.provider
|
|
30
|
+
]);
|
|
27
31
|
function supportsOwnerChatDutyTools(provider) {
|
|
28
32
|
if (typeof provider !== "string" || !provider)
|
|
29
33
|
return false;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* a listed harness's dispatch, and seals the owner's message on the dispatch
|
|
10
10
|
* receipt the tools are checked against when one is called;
|
|
11
11
|
* - the server's intent check (`api/server/services/Duties/OwnerChatDutyIntent.js`)
|
|
12
|
-
*
|
|
13
|
-
* harness
|
|
12
|
+
* asks whether the owner's message authorizes the change, and refuses any
|
|
13
|
+
* harness this list does not name;
|
|
14
14
|
* - the daemon mints the session credential the tools need
|
|
15
15
|
* (`daemon/src/connection-helpers/session-credential.ts`) and admits the turn
|
|
16
16
|
* (`daemon/src/delegation-mcp/owner-chat-duty-gate.ts`) only for a listed
|
|
@@ -21,14 +21,21 @@
|
|
|
21
21
|
* it, and the daemon mints its credential. Listing one that lacks the second
|
|
22
22
|
* would offer tools whose every change is refused.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the
|
|
29
|
-
* (
|
|
30
|
-
*
|
|
31
|
-
* decision
|
|
24
|
+
* Where each listed harness's intent check runs:
|
|
25
|
+
*
|
|
26
|
+
* - `codex`: on the chat's own daemon, through Codex's native no-tools draft, on
|
|
27
|
+
* the person's own Codex sign-in.
|
|
28
|
+
* - `claude`: on the chat's own daemon, through the daemon's private Claude
|
|
29
|
+
* inference (no tools), on the person's own Claude sign-in.
|
|
30
|
+
* - the first-party harness: HOSTED, on the platform's managed inference, billed
|
|
31
|
+
* to the Agent's owner (owner decision recorded on OSK-33476). The daemon has no
|
|
32
|
+
* qualified local inference for it (`daemon/src/continuity/inference.ts`,
|
|
33
|
+
* `PROVIDERS`), and its turn's own model calls are already sent by the
|
|
34
|
+
* platform's managed inference, so the check sends nothing new off the machine.
|
|
35
|
+
* Its ACP backend mounts the tools on both engine paths (`daemon/src/backends/acp.ts`).
|
|
36
|
+
*
|
|
37
|
+
* The first two keep their local check: their bounded calls stay on the person's
|
|
38
|
+
* own sign-in, and nothing here moves them.
|
|
32
39
|
*
|
|
33
40
|
* The server stays the authority whatever this list says: the tools act only after
|
|
34
41
|
* `OwnerChatDuty.run` re-checks the stored owner stamp, the quoted request and the
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* a listed harness's dispatch, and seals the owner's message on the dispatch
|
|
10
10
|
* receipt the tools are checked against when one is called;
|
|
11
11
|
* - the server's intent check (`api/server/services/Duties/OwnerChatDutyIntent.js`)
|
|
12
|
-
*
|
|
13
|
-
* harness
|
|
12
|
+
* asks whether the owner's message authorizes the change, and refuses any
|
|
13
|
+
* harness this list does not name;
|
|
14
14
|
* - the daemon mints the session credential the tools need
|
|
15
15
|
* (`daemon/src/connection-helpers/session-credential.ts`) and admits the turn
|
|
16
16
|
* (`daemon/src/delegation-mcp/owner-chat-duty-gate.ts`) only for a listed
|
|
@@ -21,14 +21,21 @@
|
|
|
21
21
|
* it, and the daemon mints its credential. Listing one that lacks the second
|
|
22
22
|
* would offer tools whose every change is refused.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the
|
|
29
|
-
* (
|
|
30
|
-
*
|
|
31
|
-
* decision
|
|
24
|
+
* Where each listed harness's intent check runs:
|
|
25
|
+
*
|
|
26
|
+
* - `codex`: on the chat's own daemon, through Codex's native no-tools draft, on
|
|
27
|
+
* the person's own Codex sign-in.
|
|
28
|
+
* - `claude`: on the chat's own daemon, through the daemon's private Claude
|
|
29
|
+
* inference (no tools), on the person's own Claude sign-in.
|
|
30
|
+
* - the first-party harness: HOSTED, on the platform's managed inference, billed
|
|
31
|
+
* to the Agent's owner (owner decision recorded on OSK-33476). The daemon has no
|
|
32
|
+
* qualified local inference for it (`daemon/src/continuity/inference.ts`,
|
|
33
|
+
* `PROVIDERS`), and its turn's own model calls are already sent by the
|
|
34
|
+
* platform's managed inference, so the check sends nothing new off the machine.
|
|
35
|
+
* Its ACP backend mounts the tools on both engine paths (`daemon/src/backends/acp.ts`).
|
|
36
|
+
*
|
|
37
|
+
* The first two keep their local check: their bounded calls stay on the person's
|
|
38
|
+
* own sign-in, and nothing here moves them.
|
|
32
39
|
*
|
|
33
40
|
* The server stays the authority whatever this list says: the tools act only after
|
|
34
41
|
* `OwnerChatDuty.run` re-checks the stored owner stamp, the quoted request and the
|
|
@@ -37,9 +44,13 @@
|
|
|
37
44
|
*
|
|
38
45
|
* Pure: no `node:` imports and nothing read at module load.
|
|
39
46
|
*/
|
|
40
|
-
import { canonicalHarnessProvider } from './firstPartyHarness.js';
|
|
47
|
+
import { FIRST_PARTY_HARNESS, canonicalHarnessProvider } from './firstPartyHarness.js';
|
|
41
48
|
/** Canonical provider spellings, in the order they were admitted. */
|
|
42
|
-
export const OWNER_CHAT_DUTY_TOOL_HARNESSES = Object.freeze([
|
|
49
|
+
export const OWNER_CHAT_DUTY_TOOL_HARNESSES = Object.freeze([
|
|
50
|
+
'codex',
|
|
51
|
+
'claude',
|
|
52
|
+
FIRST_PARTY_HARNESS.provider,
|
|
53
|
+
]);
|
|
43
54
|
/** Whether a Main Chat turn on this harness may carry the owner-chat Duty tools. */
|
|
44
55
|
export function supportsOwnerChatDutyTools(provider) {
|
|
45
56
|
if (typeof provider !== 'string' || !provider)
|