@skrr-ai/cli 0.1.190 → 0.1.191

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.
@@ -19,7 +19,7 @@ const web_url_1 = require("../../lib/web-url");
19
19
  * docs/architecture/agent-chat-handover-2026-08-20.md
20
20
  */
21
21
  class ConvosHandover extends base_command_1.BaseCommand {
22
- static description = 'Hand a conversation over to another agent, carrying its context';
22
+ static description = 'Copy saved chat history to a new conversation with another agent. The source chat and any live turn continue independently.';
23
23
  static examples = [
24
24
  '<%= config.bin %> convos handover <id> --to <agentId>',
25
25
  '<%= config.bin %> convos handover <id> --to <agentId> --reason "frontend problem"',
@@ -39,7 +39,7 @@ class ConvosHandover extends base_command_1.BaseCommand {
39
39
  required: true,
40
40
  }),
41
41
  'up-to': core_1.Flags.string({
42
- description: 'Carry history up to this message ID (default: the whole thread)',
42
+ description: 'Carry saved history up to this message ID (default: the latest saved turn)',
43
43
  }),
44
44
  reason: core_1.Flags.string({
45
45
  description: 'Why the work is moving — recorded in provenance and the forward link',
@@ -84,6 +84,10 @@ class ConvosHandover extends base_command_1.BaseCommand {
84
84
  this.handleApiError(err);
85
85
  }
86
86
  const r = result;
87
+ const disposition = {
88
+ handoverMode: 'saved_history_snapshot',
89
+ sourceDisposition: 'continues_independently',
90
+ };
87
91
  if (flags.json) {
88
92
  // The link belongs in BOTH modes. The repo's own rule is to hand over a
89
93
  // clickable link rather than a bare id, and PR #1842 added one — to the
@@ -92,7 +96,7 @@ class ConvosHandover extends base_command_1.BaseCommand {
92
96
  const jsonUrl = r.conversation
93
97
  ? (0, web_url_1.conversationUrlFrom)(this.cliConfig.baseURL, r.conversation)
94
98
  : null;
95
- this.log(JSON.stringify({ ...result, ...(jsonUrl ? { url: jsonUrl } : {}) }, null, 2));
99
+ this.log(JSON.stringify({ ...result, ...disposition, ...(jsonUrl ? { url: jsonUrl } : {}) }, null, 2));
96
100
  return;
97
101
  }
98
102
  const newId = r.conversation?.conversationId ?? r.conversation?._id ?? '?';
@@ -114,6 +118,7 @@ class ConvosHandover extends base_command_1.BaseCommand {
114
118
  this.log(carried === undefined
115
119
  ? '? messages carried'
116
120
  : `${carried} ${carried === 1 ? 'message' : 'messages'} carried`);
121
+ this.log('The source chat and any live turn continue independently.');
117
122
  if (r.forwardLinked === false) {
118
123
  // The handover itself committed; only the breadcrumb is missing. Say so
119
124
  // rather than letting it look like a partial failure.
@@ -173,8 +173,11 @@ class HarnessesEvaluationsPlatformH9Turn extends base_command_1.BaseCommand {
173
173
  ...(0, h9_prior_stream_1.bindH9PriorStreamSettlement)(plan, stream, priorFinance, priorEvidence, grantBinding),
174
174
  });
175
175
  }
176
- const deadline = Math.min(Date.now() + 60_000, Date.parse(grant.expiresAt ?? ''), Date.parse(plan.expiresAt));
177
- if (cancelled.signal.aborted || !Number.isFinite(deadline) || deadline <= Date.now() + 10_000)
176
+ const authorizationDeadline = Math.min(Date.parse(grant.expiresAt ?? ''), Date.parse(plan.expiresAt));
177
+ const acceptanceDeadline = Math.min(Date.now() + h9_platform_stream_1.H9_ACCEPTANCE_WINDOW_MS, authorizationDeadline);
178
+ if (cancelled.signal.aborted ||
179
+ !Number.isFinite(acceptanceDeadline) ||
180
+ acceptanceDeadline <= Date.now() + 10_000)
178
181
  throw new Error('H9_TIMELINE_EXHAUSTED');
179
182
  const recover = receiptPath(label);
180
183
  const identity = {
@@ -197,7 +200,7 @@ class HarnessesEvaluationsPlatformH9Turn extends base_command_1.BaseCommand {
197
200
  credential: this.resolvedCredential,
198
201
  signal: AbortSignal.any([
199
202
  cancelled.signal,
200
- AbortSignal.timeout(Math.max(1, deadline - Date.now())),
203
+ AbortSignal.timeout(Math.max(1, acceptanceDeadline - Date.now())),
201
204
  ]),
202
205
  body: {
203
206
  endpoint: 'agents',
@@ -229,6 +232,7 @@ class HarnessesEvaluationsPlatformH9Turn extends base_command_1.BaseCommand {
229
232
  (0, operator_probe_files_1.durable)(recover, { ...identity, ...admittedIds, state: 'accepted' });
230
233
  (0, h9_platform_stream_1.validateH9Acceptance)(accepted, scope);
231
234
  emit({ type: 'run.accepted', ...admittedIds });
235
+ const deadline = Math.min(Date.now() + h9_platform_stream_1.H9_EXECUTION_WINDOW_MS, authorizationDeadline);
232
236
  const summary = await (0, h9_platform_stream_1.streamH9PlatformTurn)({
233
237
  label,
234
238
  nonce: plan.nonce,
@@ -279,6 +283,12 @@ class HarnessesEvaluationsPlatformH9Turn extends base_command_1.BaseCommand {
279
283
  process.exitCode = 1;
280
284
  }
281
285
  catch (error) {
286
+ // Retain the reviewed probe's typed failure across the operator's child
287
+ // process boundary without forwarding arbitrary provider error text.
288
+ const code = error instanceof Error && /^H9_[A-Z0-9_]+$/.test(error.message)
289
+ ? error.message
290
+ : 'H9_PLATFORM_TURN_FAILED';
291
+ emit({ type: 'h9.turn.failure', code });
282
292
  // A normal start may already have launched. Bind interruption to its actual returned session.
283
293
  if (admittedIds.sessionId) {
284
294
  const client = new agentic_stream_1.AgenticStreamClient({
@@ -45,7 +45,18 @@ class TasksInterrupt extends base_command_1.BaseCommand {
45
45
  return;
46
46
  }
47
47
  const c = result;
48
- this.log(`Stop requested for task ${taskRef} (comment ${c.id ?? c._id ?? '?'}). Child runs and schedules are unchanged; inspect run state to confirm it stopped.`);
48
+ const stop = c.interrupt;
49
+ if (stop?.acknowledged) {
50
+ this.log(`Run ${stop.runId ?? '?'} for task ${taskRef} has ended.`);
51
+ return;
52
+ }
53
+ if (stop?.requested === false) {
54
+ this.log(stop.reason === 'no_current_checkout'
55
+ ? `Task ${taskRef} has no current checkout to stop.`
56
+ : `No stop was requested for task ${taskRef} (${stop.reason ?? 'run unavailable'}). Check the current run before trying again.`);
57
+ return;
58
+ }
59
+ this.log(`Stop requested for ${stop?.runId ? `run ${stop.runId} of ` : ''}task ${taskRef} (comment ${c.id ?? c._id ?? '?'}). Inspect run state to confirm it stopped.`);
49
60
  }
50
61
  }
51
62
  exports.default = TasksInterrupt;
@@ -2,6 +2,8 @@ import { type AgenticStreamEvent, type EnvelopeReplayPage } from './agentic-stre
2
2
  export declare const H9_TURN_LABELS: readonly ["streaming", "toolCalls", "remember", "interrupt", "recall", "cancel"];
3
3
  export type H9TurnLabel = (typeof H9_TURN_LABELS)[number];
4
4
  export type H9Harness = 'pi' | 'copilot-sdk';
5
+ export declare const H9_EXECUTION_WINDOW_MS = 120000;
6
+ export declare const H9_ACCEPTANCE_WINDOW_MS = 60000;
5
7
  type Row = Record<string, any>;
6
8
  /** Fixed prompts for the two reviewed platform qualification pairs. */
7
9
  export declare function h9FixedPrompt(label: H9TurnLabel, nonce: string, harness?: H9Harness): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.H9_TURN_LABELS = void 0;
3
+ exports.H9_ACCEPTANCE_WINDOW_MS = exports.H9_EXECUTION_WINDOW_MS = exports.H9_TURN_LABELS = void 0;
4
4
  exports.h9FixedPrompt = h9FixedPrompt;
5
5
  exports.validateH9Acceptance = validateH9Acceptance;
6
6
  exports.streamH9PlatformTurn = streamH9PlatformTurn;
@@ -16,6 +16,10 @@ exports.H9_TURN_LABELS = [
16
16
  'recall',
17
17
  'cancel',
18
18
  ];
19
+ // An accepted production turn still needs to clear the worker queue, prepare
20
+ // managed inference and reach the daemon before it can run the fixed case.
21
+ exports.H9_EXECUTION_WINDOW_MS = 120_000;
22
+ exports.H9_ACCEPTANCE_WINDOW_MS = 60_000;
19
23
  const need = (value, code) => {
20
24
  if (!value)
21
25
  throw new Error(code);
@@ -123,7 +127,9 @@ function recordedH9Response(rows, accepted, outcome) {
123
127
  async function streamH9PlatformTurn(input) {
124
128
  h9FixedPrompt(input.label, input.nonce, input.scope.harness);
125
129
  const now = Date.now();
126
- need(Number.isFinite(input.deadline) && input.deadline > now && input.deadline <= now + 60_000, 'H9_TURN_DEADLINE_INVALID');
130
+ need(Number.isFinite(input.deadline) &&
131
+ input.deadline > now &&
132
+ input.deadline <= now + exports.H9_EXECUTION_WINDOW_MS, 'H9_TURN_DEADLINE_INVALID');
127
133
  const context = validateH9Acceptance(input.accepted, input.scope);
128
134
  // Non-tool turns intentionally have no permission gate. Their first ask cancels the run.
129
135
  const permission = input.label === 'toolCalls'