@skrr-ai/cli 0.1.230 → 0.1.232

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.
Files changed (75) hide show
  1. package/README.md +22 -0
  2. package/bin/dev.cjs +4 -0
  3. package/dist/base-command.d.ts +0 -10
  4. package/dist/base-command.js +10 -39
  5. package/dist/commands/agent/message/context.d.ts +2 -0
  6. package/dist/commands/agent/message/context.js +18 -3
  7. package/dist/commands/agent/message/list.d.ts +22 -0
  8. package/dist/commands/agent/message/list.js +66 -0
  9. package/dist/commands/agent/message/send.d.ts +1 -1
  10. package/dist/commands/agent/message/send.js +1 -3
  11. package/dist/commands/agent/message/show.d.ts +14 -0
  12. package/dist/commands/agent/message/show.js +39 -0
  13. package/dist/commands/agents/chat.d.ts +2 -0
  14. package/dist/commands/agents/chat.js +20 -4
  15. package/dist/commands/agents/eval/show.d.ts +1 -0
  16. package/dist/commands/agents/eval/show.js +19 -0
  17. package/dist/commands/agents/intuitions/generate.js +1 -1
  18. package/dist/commands/agents/intuitions/list.js +1 -1
  19. package/dist/commands/code/acp.js +1 -1
  20. package/dist/commands/code/handover.d.ts +3 -3
  21. package/dist/commands/code/handover.js +12 -12
  22. package/dist/commands/code/index.d.ts +3 -8
  23. package/dist/commands/code/index.js +15 -21
  24. package/dist/commands/code/jobs/show.js +1 -0
  25. package/dist/commands/code/run.js +1 -1
  26. package/dist/commands/goals/plan-now.d.ts +5 -3
  27. package/dist/commands/goals/plan-now.js +21 -16
  28. package/dist/commands/runs/events.d.ts +14 -0
  29. package/dist/commands/runs/events.js +59 -0
  30. package/dist/commands/runs/list.d.ts +21 -0
  31. package/dist/commands/runs/list.js +87 -0
  32. package/dist/commands/runs/show.d.ts +13 -0
  33. package/dist/commands/runs/show.js +63 -0
  34. package/dist/commands/runs/stop.d.ts +14 -0
  35. package/dist/commands/runs/stop.js +78 -0
  36. package/dist/commands/runs/transcript.d.ts +17 -0
  37. package/dist/commands/runs/transcript.js +93 -0
  38. package/dist/commands/tasks/runs.js +7 -0
  39. package/dist/commands/tasks/start-receipt.js +8 -8
  40. package/dist/commands/tasks/start.js +12 -1
  41. package/dist/generated/agent-guides.json +226 -5
  42. package/dist/lib/agent-chat-queue.d.ts +2 -1
  43. package/dist/lib/agent-chat-queue.js +26 -21
  44. package/dist/lib/agent-runs.d.ts +41 -0
  45. package/dist/lib/agent-runs.js +177 -0
  46. package/dist/lib/agentic-stream.d.ts +1 -1
  47. package/dist/lib/agentic-stream.js +2 -2
  48. package/dist/lib/api-fetch.d.ts +2 -2
  49. package/dist/lib/api-fetch.js +5 -4
  50. package/dist/lib/code-handover.d.ts +2 -3
  51. package/dist/lib/code-handover.js +4 -6
  52. package/dist/lib/communication-history.d.ts +27 -0
  53. package/dist/lib/communication-history.js +45 -0
  54. package/dist/lib/execution-history.d.ts +31 -0
  55. package/dist/lib/execution-history.js +7 -0
  56. package/dist/lib/first-party-harness-broker.d.ts +1 -1
  57. package/dist/lib/first-party-harness-broker.js +3 -5
  58. package/dist/lib/inbound-messages.d.ts +1 -0
  59. package/dist/lib/inbound-messages.js +3 -0
  60. package/dist/lib/intuition-look.js +20 -4
  61. package/dist/lib/memory-history-session.d.ts +8 -4
  62. package/dist/lib/memory-history-session.js +30 -23
  63. package/dist/lib/task-agent-run.d.ts +4 -0
  64. package/dist/lib/task-agent-run.js +15 -0
  65. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.d.ts +9 -0
  66. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +35 -2
  67. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +62 -0
  68. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +56 -0
  69. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.d.ts +9 -0
  70. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +29 -2
  71. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +62 -0
  72. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +51 -0
  73. package/dist/node_modules/@skrr-ai/data-provider/index.js +10997 -10987
  74. package/oclif.manifest.json +1065 -1648
  75. package/package.json +5 -2
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const agent_runs_1 = require("../../lib/agent-runs");
6
+ const http_error_1 = require("../../lib/http-error");
7
+ class RunsStop extends base_command_1.BaseCommand {
8
+ static description = 'Request Stop for a canonical Agent Run or recover an exact Stop receipt';
9
+ static examples = [
10
+ '<%= config.bin %> runs stop <run-id>',
11
+ '<%= config.bin %> runs stop <run-id> --attempt <attempt-id> --json',
12
+ '<%= config.bin %> runs stop <run-id> --queued --json',
13
+ ];
14
+ static args = { runId: agent_runs_1.runIdArgument };
15
+ static flags = {
16
+ attempt: core_1.Flags.string({
17
+ description: 'Stop this exact Attempt or recover its Stop receipt',
18
+ exclusive: ['queued'],
19
+ parse: async (input) => (0, agent_runs_1.exactAttemptId)(input),
20
+ }),
21
+ queued: core_1.Flags.boolean({
22
+ description: 'Stop before any Attempt has started or recover that queued Stop receipt',
23
+ exclusive: ['attempt'],
24
+ }),
25
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
26
+ };
27
+ async run() {
28
+ this.requireAuth();
29
+ const { args, flags } = await this.parse(RunsStop);
30
+ try {
31
+ const result = await (0, agent_runs_1.stopAgentRun)(args.runId, flags.queued ? null : flags.attempt);
32
+ if (result.kind === 'already-ended') {
33
+ if (flags.json) {
34
+ this.log(JSON.stringify({ runId: result.runId, status: result.status, alreadyEnded: true }, null, 2));
35
+ }
36
+ else {
37
+ this.log(`Run ${result.runId} has already ended (${result.status}).`);
38
+ }
39
+ return;
40
+ }
41
+ const { receipt } = result;
42
+ if (flags.json) {
43
+ this.log(JSON.stringify(receipt, null, 2));
44
+ }
45
+ else if (receipt.status === 'cancelled') {
46
+ this.log(`Run ${receipt.runId} is cancelled.`);
47
+ }
48
+ else {
49
+ this.log(`Stop requested for Run ${receipt.runId}. The runtime has yet to confirm it stopped.`);
50
+ }
51
+ }
52
+ catch (error) {
53
+ if (error instanceof agent_runs_1.RunStopUnconfirmedError) {
54
+ const target = error.expectedAttemptId === null ? '--queued' : `--attempt ${error.expectedAttemptId}`;
55
+ const command = `${this.config.bin} runs stop ${args.runId} ${target}`;
56
+ this.failWithCliError({
57
+ code: 'AGENT_RUN_STOP_OUTCOME_UNKNOWN',
58
+ message: `Stop was not confirmed. In the same workspace, retry with ${command}.`,
59
+ status: (0, http_error_1.httpStatusOf)(error.cause),
60
+ exit: 1,
61
+ retryable: false,
62
+ details: { expectedAttemptId: error.expectedAttemptId, command },
63
+ });
64
+ }
65
+ if ((0, http_error_1.httpStatusOf)(error) === 409) {
66
+ this.failWithCliError({
67
+ code: 'AGENT_RUN_STOP_CONFLICT',
68
+ message: `The Run changed before Stop was accepted. Check ${this.config.bin} runs show ${args.runId} before requesting Stop again.`,
69
+ status: 409,
70
+ exit: 1,
71
+ retryable: false,
72
+ });
73
+ }
74
+ this.handleApiError(error);
75
+ }
76
+ }
77
+ }
78
+ exports.default = RunsStop;
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class RunsTranscript extends BaseCommand {
3
+ static autonomousCredentialPolicy: "bound-session";
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ runId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ attempt: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ offset: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const node_util_1 = require("node:util");
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
+ const agent_runs_1 = require("../../lib/agent-runs");
8
+ const communication_history_1 = require("../../lib/communication-history");
9
+ const execution_history_1 = require("../../lib/execution-history");
10
+ const search_display_1 = require("../../lib/search-display");
11
+ const availability = {
12
+ available: 'Transcript available',
13
+ partial: 'Partial transcript',
14
+ unverified: 'Transcript source unverified',
15
+ unavailable: 'Transcript unavailable',
16
+ };
17
+ function terminalText(value) {
18
+ return (0, node_util_1.stripVTControlCharacters)(value.replace(/\r\n?/g, '\n'))
19
+ .replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, '');
20
+ }
21
+ class RunsTranscript extends base_command_1.BaseCommand {
22
+ static autonomousCredentialPolicy = 'bound-session';
23
+ static description = 'Read the transcript of an exact Agent Run Attempt';
24
+ static examples = [
25
+ '<%= config.bin %> runs transcript <run-id> --attempt <attempt-id>',
26
+ '<%= config.bin %> runs transcript <run-id> --attempt <attempt-id> --offset 50 --json',
27
+ ];
28
+ static args = { runId: agent_runs_1.runIdArgument };
29
+ static flags = {
30
+ attempt: agent_runs_1.attemptIdFlag,
31
+ offset: core_1.Flags.integer({
32
+ description: 'Start at this offset (default 0). Use the next offset returned by the previous page.',
33
+ min: 0,
34
+ max: Number.MAX_SAFE_INTEGER,
35
+ exclusive: ['cursor'],
36
+ }),
37
+ cursor: core_1.Flags.string({ description: 'Read the next older window in an Agent session' }),
38
+ limit: core_1.Flags.integer({ description: 'Maximum items (1–100 for people, 1–8 for Agent sessions, default 6 for sessions)', min: 1, max: 100 }),
39
+ json: core_1.Flags.boolean({ description: 'Output the transcript page as JSON' }),
40
+ };
41
+ async run() {
42
+ const { args: { runId }, flags } = await this.parse(RunsTranscript);
43
+ const session = (0, communication_history_1.resolveHistorySession)(() => this.requireAuth());
44
+ const { attempt, offset, limit, cursor } = flags;
45
+ if ((session && offset !== undefined) || (!session && cursor !== undefined)) {
46
+ this.failWithCliError({ code: 'HISTORY_FILTER_CONFLICT', message: 'Use --cursor in a bound Agent session and --offset in a human session.', exit: 2, retryable: false });
47
+ }
48
+ try {
49
+ if (session) {
50
+ const page = await (0, execution_history_1.readExecutionHistory)(session.sessionId, 'transcript', { runId, attempt, limit, cursor });
51
+ if (flags.json)
52
+ this.log(JSON.stringify(page, null, 2));
53
+ else {
54
+ for (const row of page.items)
55
+ this.log(terminalText([row.at, row.name ?? row.kind, row.outcome, row.text].filter(Boolean).join(' · ')));
56
+ if (page.coverage === 'partial')
57
+ this.log('Transcript coverage is partial.');
58
+ if (page.nextCursor)
59
+ this.log(`Earlier window Repeat with --cursor ${(0, search_display_1.shellSearchCursor)(page.nextCursor)}.`);
60
+ }
61
+ return;
62
+ }
63
+ const page = await (0, agent_runs_1.readAgentRunTranscript)(runId, flags);
64
+ if (flags.json) {
65
+ this.log(JSON.stringify(page, null, 2));
66
+ return;
67
+ }
68
+ this.log(`Run ${runId}`);
69
+ this.log(`Attempt ${attempt}`);
70
+ this.log(page.availability === 'partial' && page.coverage === 'result_only'
71
+ ? 'Saved result only'
72
+ : availability[page.availability]);
73
+ const { body } = page;
74
+ if (!body)
75
+ return;
76
+ for (const row of (0, data_provider_1.buildEnvelopeRows)(body.envelopes ?? [])) {
77
+ if (row.kind === 'answer')
78
+ this.log(terminalText(row.text));
79
+ }
80
+ const count = (body.envelopes?.length ?? 0) + (body.content?.length ?? 0) + (body.events?.length ?? 0);
81
+ this.log(`${count} ${count === 1 ? 'item' : 'items'} on this page. Use --json to read the full page.`);
82
+ const next = body.nextOffset;
83
+ if (typeof next === 'number' && Number.isSafeInteger(next) && next > (offset ?? 0)) {
84
+ const pageSize = limit === undefined ? '' : ` --limit ${limit}`;
85
+ this.log(`Next page ${this.config.bin} runs transcript ${runId} --attempt ${attempt} --offset ${next}${pageSize}`);
86
+ }
87
+ }
88
+ catch (error) {
89
+ this.handleApiError(error);
90
+ }
91
+ }
92
+ }
93
+ exports.default = RunsTranscript;
@@ -15,6 +15,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
15
15
  const base_command_1 = require("../../base-command");
16
16
  const format_1 = require("../../lib/format");
17
17
  const handover_interview_1 = require("../../lib/handover-interview");
18
+ const task_agent_run_1 = require("../../lib/task-agent-run");
18
19
  const activity_1 = require("./activity");
19
20
  /**
20
21
  * OSK-4836 — say WHERE a run executed. A named daemon wins over the environment
@@ -288,8 +289,11 @@ class TasksRuns extends base_command_1.BaseCommand {
288
289
  const showAttempt = attempts.some(Boolean);
289
290
  const showSettlement = settlements.some(Boolean);
290
291
  const showCleanup = cleanups.some(Boolean);
292
+ const runCommands = items.map(({ agentRunId, agentRunWorkspaceId }) => (0, task_agent_run_1.taskAgentRunCommand)({ agentRunId, agentRunWorkspaceId }, this.config.bin));
293
+ const inspectRun = runCommands.find(Boolean);
291
294
  const rows = items.map((run, i) => ({
292
295
  runId: String(run.runId ?? run.id ?? run._id ?? '-'),
296
+ agentRunId: runCommands[i] ? String(run.agentRunId) : '-',
293
297
  status: String(run.status ?? '-'),
294
298
  executor: formatRunExecutor(run),
295
299
  started: run.startedAt ? (0, format_1.localTime)(run.startedAt) : '-',
@@ -304,6 +308,7 @@ class TasksRuns extends base_command_1.BaseCommand {
304
308
  }));
305
309
  (0, format_1.renderTable)(rows, [
306
310
  { key: 'runId', header: 'RUN ID' },
311
+ ...(inspectRun ? [{ key: 'agentRunId', header: 'AGENT RUN ID' }] : []),
307
312
  { key: 'status', header: 'STATUS' },
308
313
  { key: 'executor', header: 'EXECUTOR' },
309
314
  { key: 'started', header: 'STARTED' },
@@ -316,6 +321,8 @@ class TasksRuns extends base_command_1.BaseCommand {
316
321
  ...(showCleanup ? [{ key: 'cleanup', header: 'CLEANUP', maxWidth: 42 }] : []),
317
322
  ...(showHandover ? [{ key: 'handover', header: 'HANDOVER' }] : []),
318
323
  ], (line) => this.log(line));
324
+ if (inspectRun)
325
+ this.log(`Inspect an Agent Run with ${inspectRun}`);
319
326
  // The previous owner's notes on each continuation, under the table: the column
320
327
  // says where each interview stands, this says what the previous agent said.
321
328
  for (const run of items) {
@@ -4,6 +4,7 @@ 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 task_resolver_1 = require("../../lib/task-resolver");
7
+ const task_agent_run_1 = require("../../lib/task-agent-run");
7
8
  /** Read-only recovery for one caller-owned task-start request. */
8
9
  class TasksStartReceipt extends base_command_1.BaseCommand {
9
10
  static description = 'Read the durable receipt for one task-start request without starting another run.';
@@ -47,14 +48,9 @@ class TasksStartReceipt extends base_command_1.BaseCommand {
47
48
  // turns whatever it picked into something the API can resolve — a UUID and
48
49
  // an OSK-2423 ref pass through untouched, a title is searched.
49
50
  const taskId = await this.resolveTaskReference(taskIdentity.id);
50
- // The CLI may compile against a published data-provider declaration that
51
- // predates this additive reader; use the runtime surface just as `start`
52
- // does for its newer options.
53
- const getTaskStartReceipt = data_provider_1.dataService
54
- .getTaskStartReceipt;
55
51
  let receipt;
56
52
  try {
57
- receipt = await getTaskStartReceipt(taskId, flags['request-id']);
53
+ receipt = await data_provider_1.dataService.getTaskStartReceipt(taskId, flags['request-id']);
58
54
  }
59
55
  catch (err) {
60
56
  this.handleApiError(err, { subject: `Task ${taskId} start receipt` });
@@ -72,8 +68,12 @@ class TasksStartReceipt extends base_command_1.BaseCommand {
72
68
  if (receipt.input.exchangeId)
73
69
  this.log(`Exchange: ${receipt.input.exchangeId}`);
74
70
  }
75
- if (receipt.run?.runId)
76
- this.log(`Run: ${receipt.run.runId}`);
71
+ const physicalRunId = receipt.input?.runId ?? receipt.run?.runId;
72
+ if (physicalRunId)
73
+ this.log(`Task run: ${physicalRunId}`);
74
+ const run = (0, task_agent_run_1.taskAgentRunCommand)(receipt.input ?? receipt.run, this.config.bin);
75
+ if (run)
76
+ this.log(`Inspect Agent Run with ${run}`);
77
77
  if (receipt.run?.autonomousRunId)
78
78
  this.log(`Autonomous Run: ${receipt.run.autonomousRunId}`);
79
79
  if (receipt.run?.conversationId)
@@ -11,6 +11,7 @@ const task_resolver_1 = require("../../lib/task-resolver");
11
11
  const git_task_1 = require("../../lib/git-task");
12
12
  const task_admission_1 = require("../../lib/task-admission");
13
13
  const http_error_1 = require("../../lib/http-error");
14
+ const task_agent_run_1 = require("../../lib/task-agent-run");
14
15
  const TASK_START_REQUEST_ID_PATTERN = /^[A-Za-z0-9._:/-]{1,200}$/;
15
16
  class TasksStart extends base_command_1.BaseCommand {
16
17
  static description = 'Request execution of a Task by its assigned Agent. ' + 'Alias: tasks execute';
@@ -192,8 +193,12 @@ class TasksStart extends base_command_1.BaseCommand {
192
193
  if (prior && prior.state !== 'unknown') {
193
194
  if (flags.json)
194
195
  this.printJsonResult(prior);
195
- else
196
+ else {
196
197
  this.log(`Start request ${requestId} is ${prior.state}. Inspect it with ${this.config.bin} tasks start-receipt ${taskId} --request-id ${requestId}.`);
198
+ const run = (0, task_agent_run_1.taskAgentRunCommand)(prior.input ?? prior.run, this.config.bin);
199
+ if (run)
200
+ this.log(`Inspect Agent Run with ${run}`);
201
+ }
197
202
  return;
198
203
  }
199
204
  const input = await data_provider_1.dataService.submitTaskConversationInput(taskId, {
@@ -211,6 +216,9 @@ class TasksStart extends base_command_1.BaseCommand {
211
216
  this.log(`${branch.created ? 'Created' : 'Checked out'} branch: ${branch.branch}`);
212
217
  this.log(`Task ${taskId} start input: ${input.phase}.`);
213
218
  this.log(`Start request: ${requestId}`);
219
+ const run = (0, task_agent_run_1.taskAgentRunCommand)(input, this.config.bin);
220
+ if (run)
221
+ this.log(`Inspect Agent Run with ${run}`);
214
222
  this.log(`Inspect execution: ${this.config.bin} tasks execution-state ${taskId}`);
215
223
  }
216
224
  return;
@@ -281,6 +289,9 @@ class TasksStart extends base_command_1.BaseCommand {
281
289
  this.log(`Run: ${result.runId}`);
282
290
  if (result.autonomousRunId)
283
291
  this.log(`Autonomous Run: ${result.autonomousRunId}`);
292
+ const run = (0, task_agent_run_1.taskAgentRunCommand)(result, this.config.bin);
293
+ if (run)
294
+ this.log(`Inspect Agent Run with ${run}`);
284
295
  this.log(`Conversation: ${result.conversationId}`);
285
296
  this.log(`Session: ${result.sessionId}`);
286
297
  if (result.responseMessageId)
@@ -664,8 +664,16 @@
664
664
  "version": 1,
665
665
  "routed": false,
666
666
  "aliases": [],
667
- "tokens": 1454,
667
+ "tokens": 1473,
668
668
  "sections": [
669
+ {
670
+ "id": "history",
671
+ "title": "Read communication and execution history",
672
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
673
+ "tokens": 374,
674
+ "aliases": [],
675
+ "explains": []
676
+ },
669
677
  {
670
678
  "id": "pacing",
671
679
  "title": "Pacing long work",
@@ -786,8 +794,8 @@
786
794
  ]
787
795
  }
788
796
  ],
789
- "hash": "ebe1f1c8cfa86223a5fcdaa14b29bc025924b73223f8f122661d6c61ae893a24",
790
- "tokens": 574
797
+ "hash": "22f8d965aa1af9dc1bd2369b14d5c604746fcb84f19959ca1d842a30fe1255db",
798
+ "tokens": 578
791
799
  },
792
800
  "routedIndex": {
793
801
  "level": "index",
@@ -2140,9 +2148,17 @@
2140
2148
  "routed": false,
2141
2149
  "aliases": [],
2142
2150
  "body": "## Concept model\n\nAn **Agent Update** is a deliberate owner-facing message, not a record: durable changes go in\nthe work's own records, which it points at.\n\n## Agent Updates\n\nProactively message the owner whenever it would improve their ability to steer the work, understand\na meaningful change, or stay confidently involved. Adapt to the task, uncertainty and stakes, the\nuser's engagement, what you have already communicated, and any per-agent style direction. Do not\nfollow a fixed schedule or manufacture status chatter.\n\n- Choose the semantic kind: `milestone` for a meaningful completed stage, `status` for a\n useful non-blocking checkpoint, `decision` for a concrete choice, `blocker` when user action is needed to\n continue, and one `result` for the terminal outcome (including failure).\n- Declare the attention intent with `--attention ambient|notify|interrupt`: `ambient` stays in\n the durable timeline by default, `notify` is worth seeing soon, and `interrupt` is reserved for\n work that is blocked or genuinely time-sensitive. The system and the user choose delivery channels and native\n presentation; attention never directly selects an Android channel, iOS interruption level, sound, or critical\n alert, and never bypasses notification preferences, quiet hours, Focus, or rate limits.\n- Say what is newly true and what it changes for the work. Include the next step, decision, or\n uncertainty when it would help the user; do not force every message into a fixed template.\n- Before work of more than a few minutes that they are not watching (a Task run, a Duty, or\n they are away), send a short `status`: what you are doing and roughly when they will hear back.\n- A time you gave is a promise. If you will miss it, say so before it passes, with the new estimate\n and why. When work runs long with nothing new to report, one short status around the time they\n would start to wonder keeps them confident; keep those under one status key so each replaces the\n last instead of piling up.\n- Write like a capable teammate giving a busy owner a real, in-the-moment briefing — not like a\n system log, a customer-service script, or a task template. Open on the thing itself, never on a\n subject line (\"Status on the refactor:\", \"Quick update:\"). In the user's language, lead with the\n fresh fact, decision, or risk; then make clear why it matters and what happens next. Where the\n evidence is available, ground the update in one or two useful specifics: the affected thing, the\n evidence, the timing, or the trade-off.\n Use plain, varied sentences and only the confidence the evidence earns. Keep them short: where a\n dash would staple two clauses into one, use two sentences instead. Be warm and direct, but\n never manufacture familiarity, emotion, certainty, or colour that is not true. Avoid AI-shaped\n filler such as \"I am pleased to report\", \"completed / in progress / next step\" recaps,\n \"I will continue to monitor\", \"feel free to let me know\", ceremonial thanks, and vague claims\n such as \"the optimization is complete\". Say the thing instead: \"The migration is in; the\n slowest query fell from 2.8s to 420ms. I am running the full regression now and will flag any\n breakage before merge.\" Treat that as a standard of specificity, not a rigid script. Do not make\n a message longer merely to sound human.\n- Task context and card presentation are separate: a message shows no Task Card unless you choose\n `--attach-task-card` (or `presentation.taskCard: true`). Use one only when it helps them follow\n the live task.\n- In a hand-started session, use `skrr agent message context --agent <id>` when recent\n updates, read state, or a user's reply would help your judgment. It supplies observations, not a\n schedule or a command to send.\n- In a skrr-managed session, do not pass task, run, or session identity: skrr derives it.\n In a hand-started session, add `--task <task-id>` only when you know the correct task; it is\n declared context.\n- Prefer one message for one thought. Send separate things the person would read, answer or act on\n apart as a sequence with `--part \"<next thought>\"` and one explicit semantic `--idempotency-key`, the\n most important first. One thought stays one message however long it runs: give it paragraphs. Never\n split text mechanically. If one part does not reach the user, the remaining parts are deliberately not\n sent — the user would otherwise read your thoughts out of order.\n- An idempotency key names ONE update for this agent permanently, so make it specific to this run\n (for example `<task-id>:verify-complete`). Reuse it only to retry that same update: reused with\n the same text it is dropped as a duplicate, and with different text it is rejected.\n- A non-`delivered` status (`held`, `approval_required`, `duplicate`, `dropped`) is a policy\n outcome, not an error. It is never a reason to bypass this command with a direct DM or Slack\n call — this is the only sanctioned agent-to-user path.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Decide to message, and its kind, attention, task and card | Choose the channel and presentation; release a held or approval-gated intent |\n| Person | Everything an Agent may do | — |\n\n## Live state\n\n- `skrr agent message context --agent <id>` (above); inside a session it also reports what this\n turn has sent (`currentTurn`).\n\n## Related guides\n\n- `tasks` — the records an update points at.\n- `agents` — which Agent a session speaks as (`identity`).",
2143
- "hash": "d2e3bd609c6bdf481d3e1031b352ee91d7b62dcf658142adfb4d4479c6c591f0",
2144
- "tokens": 1454,
2151
+ "hash": "adec1f24a78517bcf6bc878a6c8017cbcc2fe6ac04d1eb70bc5c60c511320873",
2152
+ "tokens": 1473,
2145
2153
  "sections": [
2154
+ {
2155
+ "id": "history",
2156
+ "title": "Read communication and execution history",
2157
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
2158
+ "tokens": 374,
2159
+ "aliases": [],
2160
+ "explains": []
2161
+ },
2146
2162
  {
2147
2163
  "id": "pacing",
2148
2164
  "title": "Pacing long work",
@@ -8457,6 +8473,147 @@
8457
8473
  }
8458
8474
  ]
8459
8475
  },
8476
+ "communication/history": {
8477
+ "level": "section",
8478
+ "surface": "cli",
8479
+ "id": "communication",
8480
+ "section": "history",
8481
+ "title": "Read communication and execution history",
8482
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
8483
+ "version": 1,
8484
+ "aliases": [],
8485
+ "explains": [],
8486
+ "body": "Read this when you are deciding whether to contact the owner or need evidence from an earlier Run.\n\n- Before sending, start with outreach. Look for the owner's latest explicit decision, earlier promises and open asks, and whether you already shared the same change. Read the surrounding exchange or open the exact message if you need its wording. Silence alone says nothing about the owner's preference.\n- To verify earlier work, find the Run, then open the exact Attempt that did the work. A retained excerpt can show what happened. An earlier claim in a message still needs evidence. In a resumed session, use the evidence already available when it answers the question.\n- Read only what can change your decision. If there is no material change, due commitment, or decision the owner needs to make, finish quietly. Follow any configured reporting contract. Use the existing send path and reuse its idempotency key for the same business event.\n\n```bash\nskrr agent message context --view outreach --json\nskrr agent message list --direction inbound --since today --limit 5 --json\nskrr agent message show <message-id> --json\nskrr runs list --since 7d --status failed --json\nskrr runs show <run-id> --json\nskrr runs transcript <run-id> --attempt <attempt-id> --json\n```\n\nUse the commands your launcher advertises. In a managed session, history derives your Agent and access from the session. Use `--help` for the exact filters and repeat the same filters when supplying `nextCursor` as `--cursor`.\n\nPartial coverage means some evidence may be missing. Keep that uncertainty when you decide what to send. A pending or unknown delivery stays on its original route. If a read is refused, use authorized evidence already available in this turn.",
8487
+ "hash": "64333cbb719f8f7533955f8212340a7f6b61a5dd73e19446fcf541e2883ac786",
8488
+ "tokens": 374,
8489
+ "sections": [
8490
+ {
8491
+ "id": "history",
8492
+ "title": "Read communication and execution history",
8493
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
8494
+ "tokens": 374,
8495
+ "aliases": [],
8496
+ "explains": []
8497
+ },
8498
+ {
8499
+ "id": "pacing",
8500
+ "title": "Pacing long work",
8501
+ "readWhen": "work runs for minutes and you are deciding when to speak",
8502
+ "tokens": 651,
8503
+ "aliases": [],
8504
+ "explains": []
8505
+ },
8506
+ {
8507
+ "id": "writing",
8508
+ "title": "Writing and sending an update",
8509
+ "readWhen": "you need the send invocation, a destination or a flag",
8510
+ "tokens": 858,
8511
+ "aliases": [],
8512
+ "explains": [
8513
+ "INVALID_MESSAGE_INTENT",
8514
+ "INVALID_JSON_INPUT",
8515
+ "invalid_request",
8516
+ "content_text_too_long",
8517
+ "slack_channel_id_invalid",
8518
+ "agent_email_plain_text_only",
8519
+ "thread_root_destination_unsupported",
8520
+ "native_notification_presentation_user_owned",
8521
+ "user_owned_notification_control"
8522
+ ]
8523
+ },
8524
+ {
8525
+ "id": "parts",
8526
+ "title": "Multi-part updates: --part",
8527
+ "readWhen": "one update needs several messages, or a send halted its sequence",
8528
+ "tokens": 515,
8529
+ "aliases": [],
8530
+ "explains": [
8531
+ "INVALID_MESSAGE_SEQUENCE",
8532
+ "sequence_invalid"
8533
+ ]
8534
+ },
8535
+ {
8536
+ "id": "idempotency-keys",
8537
+ "title": "Idempotency keys",
8538
+ "readWhen": "a send may be retried, or answered `duplicate` or `idempotency_conflict`",
8539
+ "tokens": 306,
8540
+ "aliases": [],
8541
+ "explains": [
8542
+ "idempotency_conflict"
8543
+ ]
8544
+ },
8545
+ {
8546
+ "id": "correcting",
8547
+ "title": "Correcting, updating or withdrawing a sent message",
8548
+ "readWhen": "something you sent is wrong, stale, or should not have gone",
8549
+ "tokens": 722,
8550
+ "aliases": [],
8551
+ "explains": [
8552
+ "target_not_found",
8553
+ "target_not_agent_message",
8554
+ "target_other_agent",
8555
+ "target_unprovable",
8556
+ "target_superseded",
8557
+ "target_retracted",
8558
+ "operation_invalid",
8559
+ "operation_destination_unsupported",
8560
+ "INVALID_MESSAGE_OPERATION",
8561
+ "MESSAGE_OPERATION_REQUIRES_SESSION",
8562
+ "MESSAGE_OPERATION_SEQUENCE_UNSUPPORTED",
8563
+ "MESSAGE_OPERATION_UNAVAILABLE"
8564
+ ]
8565
+ },
8566
+ {
8567
+ "id": "replying",
8568
+ "title": "Replying or reacting to an owner's message",
8569
+ "readWhen": "you answer or react to their message",
8570
+ "tokens": 555,
8571
+ "aliases": [],
8572
+ "explains": [
8573
+ "reply_to_invalid",
8574
+ "reply_to_not_found",
8575
+ "reply_to_destination_unsupported",
8576
+ "reply_to_offline_unsupported",
8577
+ "reaction_invalid",
8578
+ "reaction_message_not_found",
8579
+ "reaction_needs_interactive_session"
8580
+ ]
8581
+ },
8582
+ {
8583
+ "id": "asking",
8584
+ "title": "Asking the owner and resolving the ask",
8585
+ "readWhen": "you need the owner’s answer, or they gave it",
8586
+ "tokens": 462,
8587
+ "aliases": [],
8588
+ "explains": [
8589
+ "ask_not_found",
8590
+ "ask_not_an_ask",
8591
+ "ask_not_current",
8592
+ "ask_note_invalid",
8593
+ "ASK_NOTE_TOO_LONG"
8594
+ ]
8595
+ },
8596
+ {
8597
+ "id": "delivery-statuses",
8598
+ "title": "Delivery statuses",
8599
+ "readWhen": "you need what a send’s status means",
8600
+ "tokens": 949,
8601
+ "aliases": [],
8602
+ "explains": [
8603
+ "agent_not_authorized_for_session",
8604
+ "session_claim_required",
8605
+ "context_task_not_authorized_for_session",
8606
+ "task_context_forbidden",
8607
+ "main_chat_disabled",
8608
+ "destination_not_allowed",
8609
+ "delivery_mode_off",
8610
+ "delivery_mode_suggestions_only",
8611
+ "delivery_mode_ask_first",
8612
+ "delivery_policy_unavailable"
8613
+ ]
8614
+ }
8615
+ ]
8616
+ },
8460
8617
  "communication/pacing": {
8461
8618
  "level": "section",
8462
8619
  "surface": "cli",
@@ -8471,6 +8628,14 @@
8471
8628
  "hash": "2abcadf97585fcd7d6c4b777d25653562a9a5dc51417cc7398df9a2fdaa84af8",
8472
8629
  "tokens": 651,
8473
8630
  "sections": [
8631
+ {
8632
+ "id": "history",
8633
+ "title": "Read communication and execution history",
8634
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
8635
+ "tokens": 374,
8636
+ "aliases": [],
8637
+ "explains": []
8638
+ },
8474
8639
  {
8475
8640
  "id": "pacing",
8476
8641
  "title": "Pacing long work",
@@ -8614,6 +8779,14 @@
8614
8779
  "hash": "22deb08dd7cf3b8432b94d2c056af8302fe77310a9bf002471c1d7630aad9320",
8615
8780
  "tokens": 858,
8616
8781
  "sections": [
8782
+ {
8783
+ "id": "history",
8784
+ "title": "Read communication and execution history",
8785
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
8786
+ "tokens": 374,
8787
+ "aliases": [],
8788
+ "explains": []
8789
+ },
8617
8790
  {
8618
8791
  "id": "pacing",
8619
8792
  "title": "Pacing long work",
@@ -8750,6 +8923,14 @@
8750
8923
  "hash": "ff9c1f9962ed70d24178b0932ecd232162599fabefed7741c65378b4ad4e3456",
8751
8924
  "tokens": 515,
8752
8925
  "sections": [
8926
+ {
8927
+ "id": "history",
8928
+ "title": "Read communication and execution history",
8929
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
8930
+ "tokens": 374,
8931
+ "aliases": [],
8932
+ "explains": []
8933
+ },
8753
8934
  {
8754
8935
  "id": "pacing",
8755
8936
  "title": "Pacing long work",
@@ -8885,6 +9066,14 @@
8885
9066
  "hash": "dcc0d8fa8ad7076807d02d0b6ff9bee50b72b73e9cb9c42e59c40cdc32a47000",
8886
9067
  "tokens": 306,
8887
9068
  "sections": [
9069
+ {
9070
+ "id": "history",
9071
+ "title": "Read communication and execution history",
9072
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
9073
+ "tokens": 374,
9074
+ "aliases": [],
9075
+ "explains": []
9076
+ },
8888
9077
  {
8889
9078
  "id": "pacing",
8890
9079
  "title": "Pacing long work",
@@ -9031,6 +9220,14 @@
9031
9220
  "hash": "194f1c8663eecc26e973121ad3c9d49050b78d16e407cb33a00793cb52d012ff",
9032
9221
  "tokens": 722,
9033
9222
  "sections": [
9223
+ {
9224
+ "id": "history",
9225
+ "title": "Read communication and execution history",
9226
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
9227
+ "tokens": 374,
9228
+ "aliases": [],
9229
+ "explains": []
9230
+ },
9034
9231
  {
9035
9232
  "id": "pacing",
9036
9233
  "title": "Pacing long work",
@@ -9172,6 +9369,14 @@
9172
9369
  "hash": "e0e9aced857e24fcd43d4fa07e8b52c93ad3ff2630866a3b0558fd05c413809d",
9173
9370
  "tokens": 555,
9174
9371
  "sections": [
9372
+ {
9373
+ "id": "history",
9374
+ "title": "Read communication and execution history",
9375
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
9376
+ "tokens": 374,
9377
+ "aliases": [],
9378
+ "explains": []
9379
+ },
9175
9380
  {
9176
9381
  "id": "pacing",
9177
9382
  "title": "Pacing long work",
@@ -9311,6 +9516,14 @@
9311
9516
  "hash": "890ce7930b190e8ad9a8fc13d3abda9936dbe43d0848ecd1518da0febb5b99fc",
9312
9517
  "tokens": 462,
9313
9518
  "sections": [
9519
+ {
9520
+ "id": "history",
9521
+ "title": "Read communication and execution history",
9522
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
9523
+ "tokens": 374,
9524
+ "aliases": [],
9525
+ "explains": []
9526
+ },
9314
9527
  {
9315
9528
  "id": "pacing",
9316
9529
  "title": "Pacing long work",
@@ -9455,6 +9668,14 @@
9455
9668
  "hash": "82fe838cb1d1f60a1b33b379f537706d71236be5661a8e62fe66fa9b62dfdc0b",
9456
9669
  "tokens": 949,
9457
9670
  "sections": [
9671
+ {
9672
+ "id": "history",
9673
+ "title": "Read communication and execution history",
9674
+ "readWhen": "you need to decide whether to contact the owner or verify earlier work",
9675
+ "tokens": 374,
9676
+ "aliases": [],
9677
+ "explains": []
9678
+ },
9458
9679
  {
9459
9680
  "id": "pacing",
9460
9681
  "title": "Pacing long work",
@@ -9,6 +9,7 @@ export interface QueuedTurn {
9
9
  clientInputId: string;
10
10
  sessionId: string;
11
11
  responseMessageId: string;
12
+ runId?: string;
12
13
  submitted: TConversationInputQueueSubmitResponse;
13
14
  }
14
15
  /**
@@ -26,7 +27,7 @@ export declare function queueAgentChatTurn(params: AgenticChatParams & {
26
27
  }): Promise<QueuedTurn>;
27
28
  export type QueuedTurnWait = {
28
29
  outcome: 'sent';
29
- turn?: Pick<QueuedTurn, 'sessionId' | 'responseMessageId'>;
30
+ turn?: Pick<QueuedTurn, 'sessionId' | 'responseMessageId' | 'runId'>;
30
31
  } | {
31
32
  outcome: 'held';
32
33
  card: TConversationInputQueueCard;