@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.
@@ -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
- * has a bounded, tool-less inference on the chat's own daemon for every listed
13
- * harness, and refuses any other;
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
- * The first-party harness is deliberately NOT listed yet. Its ACP backend could
25
- * mount the server as it mounts `delegation` (`daemon/src/backends/acp.ts`; not wired,
26
- * and a resident engine reads MCP bindings from its turn channel, not a file), but
27
- * the intent check has no qualified local inference for it:
28
- * the daemon's private inference answers only `claude` and the native Codex draft
29
- * (`daemon/src/continuity/inference.ts`, `PROVIDERS`), and a hosted check would
30
- * move a local chat's judgment and its cost onto the platform, which is a product
31
- * decision, not this list's.
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(["codex", "claude"]);
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
- * has a bounded, tool-less inference on the chat's own daemon for every listed
13
- * harness, and refuses any other;
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
- * The first-party harness is deliberately NOT listed yet. Its ACP backend could
25
- * mount the server as it mounts `delegation` (`daemon/src/backends/acp.ts`; not wired,
26
- * and a resident engine reads MCP bindings from its turn channel, not a file), but
27
- * the intent check has no qualified local inference for it:
28
- * the daemon's private inference answers only `claude` and the native Codex draft
29
- * (`daemon/src/continuity/inference.ts`, `PROVIDERS`), and a hosted check would
30
- * move a local chat's judgment and its cost onto the platform, which is a product
31
- * decision, not this list's.
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
- * has a bounded, tool-less inference on the chat's own daemon for every listed
13
- * harness, and refuses any other;
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
- * The first-party harness is deliberately NOT listed yet. Its ACP backend could
25
- * mount the server as it mounts `delegation` (`daemon/src/backends/acp.ts`; not wired,
26
- * and a resident engine reads MCP bindings from its turn channel, not a file), but
27
- * the intent check has no qualified local inference for it:
28
- * the daemon's private inference answers only `claude` and the native Codex draft
29
- * (`daemon/src/continuity/inference.ts`, `PROVIDERS`), and a hosted check would
30
- * move a local chat's judgment and its cost onto the platform, which is a product
31
- * decision, not this list's.
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(['codex', 'claude']);
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)