@skrr-ai/cli 0.1.201 → 0.1.204

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 (67) hide show
  1. package/dist/base-command.js +1 -1
  2. package/dist/commands/agent/message/context.d.ts +3 -0
  3. package/dist/commands/agent/message/context.js +33 -1
  4. package/dist/commands/agent/message/no-reply.d.ts +17 -0
  5. package/dist/commands/agent/message/no-reply.js +54 -0
  6. package/dist/commands/agent/message/retract.d.ts +24 -0
  7. package/dist/commands/agent/message/retract.js +167 -0
  8. package/dist/commands/agent/message/send.d.ts +47 -3
  9. package/dist/commands/agent/message/send.js +135 -4
  10. package/dist/commands/agents/chat.d.ts +12 -0
  11. package/dist/commands/agents/chat.js +258 -25
  12. package/dist/commands/agents/manager/status.d.ts +9 -0
  13. package/dist/commands/agents/manager/status.js +84 -0
  14. package/dist/commands/agents/queue/clear.d.ts +13 -0
  15. package/dist/commands/agents/queue/clear.js +31 -0
  16. package/dist/commands/agents/queue/list.d.ts +10 -0
  17. package/dist/commands/agents/queue/list.js +34 -0
  18. package/dist/commands/agents/queue/move.d.ts +16 -0
  19. package/dist/commands/agents/queue/move.js +33 -0
  20. package/dist/commands/agents/queue/pause.d.ts +7 -0
  21. package/dist/commands/agents/queue/pause.js +24 -0
  22. package/dist/commands/agents/queue/resume.d.ts +7 -0
  23. package/dist/commands/agents/queue/resume.js +24 -0
  24. package/dist/commands/agents/queue/steer.d.ts +14 -0
  25. package/dist/commands/agents/queue/steer.js +38 -0
  26. package/dist/commands/agents/queue/withdraw.d.ts +10 -0
  27. package/dist/commands/agents/queue/withdraw.js +27 -0
  28. package/dist/commands/agents/supervision.d.ts +1 -0
  29. package/dist/commands/agents/supervision.js +28 -9
  30. package/dist/commands/duties/advance-next.d.ts +17 -0
  31. package/dist/commands/duties/advance-next.js +122 -0
  32. package/dist/commands/duties/create.js +22 -3
  33. package/dist/commands/duties/pack/plan.js +45 -0
  34. package/dist/commands/duties/preflight.d.ts +1 -0
  35. package/dist/commands/duties/preflight.js +18 -2
  36. package/dist/commands/spaces/auto-executor/preview.js +6 -2
  37. package/dist/commands/spaces/charter/revise.d.ts +16 -0
  38. package/dist/commands/spaces/charter/revise.js +84 -0
  39. package/dist/commands/spaces/skills/propose.d.ts +1 -0
  40. package/dist/commands/spaces/skills/propose.js +5 -0
  41. package/dist/commands/tasks/create.js +16 -1
  42. package/dist/commands/tasks/result/show.d.ts +1 -0
  43. package/dist/commands/tasks/result/show.js +22 -1
  44. package/dist/commands/tasks/start.d.ts +3 -0
  45. package/dist/commands/tasks/start.js +12 -1
  46. package/dist/commands/triggers/capabilities.js +24 -5
  47. package/dist/commands/triggers/create.d.ts +1 -1
  48. package/dist/commands/triggers/create.js +15 -6
  49. package/dist/generated/agent-guides.json +258 -24
  50. package/dist/lib/agent-chat-queue-command.d.ts +29 -0
  51. package/dist/lib/agent-chat-queue-command.js +75 -0
  52. package/dist/lib/agent-chat-queue.d.ts +77 -0
  53. package/dist/lib/agent-chat-queue.js +245 -0
  54. package/dist/lib/agent-chat-start.d.ts +101 -0
  55. package/dist/lib/agent-chat-start.js +151 -6
  56. package/dist/lib/duties.d.ts +5 -1
  57. package/dist/lib/duties.js +16 -5
  58. package/dist/lib/duty-product.js +6 -0
  59. package/dist/lib/input-queue.d.ts +18 -0
  60. package/dist/lib/input-queue.js +59 -0
  61. package/dist/lib/message-intent.d.ts +26 -3
  62. package/dist/lib/message-intent.js +7 -1
  63. package/dist/lib/task-runtime-headers.d.ts +7 -0
  64. package/dist/lib/task-runtime-headers.js +46 -9
  65. package/dist/node_modules/@skrr-ai/data-provider/index.js +10464 -10221
  66. package/oclif.manifest.json +1288 -87
  67. package/package.json +6 -3
@@ -331,7 +331,7 @@ class BaseCommand extends core_1.Command {
331
331
  }
332
332
  jsonOperationError(value) {
333
333
  return this.jsonOperationContext
334
- ? this.jsonOperationResult(value, { outcome: 'failed', writeState: 'unknown' })
334
+ ? this.jsonOperationResult(value, { outcome: 'failed' })
335
335
  : value;
336
336
  }
337
337
  cliConfig;
@@ -14,6 +14,9 @@ export default class AgentMessageContext extends BaseCommand {
14
14
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
15
  task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  run: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ conversation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ before: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
20
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
21
  };
19
22
  run(): Promise<void>;
@@ -12,9 +12,11 @@ const message_intent_1 = require("../../../lib/message-intent");
12
12
  * it never returns a schedule or tells the model that it must send a message.
13
13
  */
14
14
  class AgentMessageContext extends base_command_1.BaseCommand {
15
- static description = 'Show recent Agent Updates and user-engagement observations for adaptive communication judgment';
15
+ static description = "Show what the owner saw in a conversation with the Agent (its replies, its messages, the platform's and the owner's), how far they read, what they said since, and recent Agent Updates, as observations for communication judgment";
16
16
  static examples = [
17
17
  '<%= config.bin %> agent message context --agent <agent-id>',
18
+ '<%= config.bin %> agent message context --agent <agent-id> --conversation <conversation-id>',
19
+ '<%= config.bin %> agent message context --agent <agent-id> --limit 20 --before <cursor>',
18
20
  '<%= config.bin %> agent message context --agent <agent-id> --task <task-id>',
19
21
  ];
20
22
  static args = {
@@ -26,6 +28,17 @@ class AgentMessageContext extends base_command_1.BaseCommand {
26
28
  run: core_1.Flags.string({
27
29
  description: 'Optional run context to narrow recent updates (refused inside a daemon session — the session path is already bound to its own run)',
28
30
  }),
31
+ conversation: core_1.Flags.string({
32
+ description: `Conversation to read: \`${data_provider_1.AGENT_COMMUNICATION_CONTEXT_MAIN_CONVERSATION}\` (the default) or a conversation id of yours with this Agent. Refused inside a daemon session, which reads the conversation its turn belongs to`,
33
+ }),
34
+ limit: core_1.Flags.integer({
35
+ description: `Timeline entries to return (1-${data_provider_1.AGENT_COMMUNICATION_CONTEXT_MAX_LIMIT})`,
36
+ min: 1,
37
+ max: data_provider_1.AGENT_COMMUNICATION_CONTEXT_MAX_LIMIT,
38
+ }),
39
+ before: core_1.Flags.string({
40
+ description: 'Read the page before this cursor (`timeline.before` of an earlier answer)',
41
+ }),
29
42
  json: core_1.Flags.boolean({
30
43
  description: 'Accepted for consistency; this command always outputs JSON',
31
44
  }),
@@ -75,9 +88,25 @@ class AgentMessageContext extends base_command_1.BaseCommand {
75
88
  },
76
89
  });
77
90
  }
91
+ // Same reason as --run: the session's conversation comes from its claim.
92
+ if (flags.conversation !== undefined) {
93
+ this.failWithCliError({
94
+ message: '--conversation cannot be chosen inside a daemon session: the session reads the conversation its turn belongs to.',
95
+ code: 'CONVERSATION_CONTEXT_UNSUPPORTED_IN_SESSION',
96
+ exit: 2,
97
+ retryable: false,
98
+ details: {
99
+ suggestion: 'Drop --conversation (the context already reads the conversation your next message lands in), or call the command outside a daemon session.',
100
+ },
101
+ });
102
+ }
78
103
  const params = new URLSearchParams();
79
104
  if (flags.task)
80
105
  params.set('taskId', flags.task);
106
+ if (flags.limit !== undefined)
107
+ params.set('limit', String(flags.limit));
108
+ if (flags.before)
109
+ params.set('before', flags.before);
81
110
  const query = params.size ? `?${params.toString()}` : '';
82
111
  const result = await (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(sessionContext.sessionId)}/message-context${query}`, { credential: (0, message_intent_1.sessionCredential)(sessionContext.token) });
83
112
  this.log(JSON.stringify(result, null, 2));
@@ -89,6 +118,9 @@ class AgentMessageContext extends base_command_1.BaseCommand {
89
118
  const result = await data_provider_1.dataService.getAgentAdaptiveCommunicationContext(agentId, {
90
119
  taskId: flags.task,
91
120
  runId: flags.run,
121
+ ...(flags.conversation !== undefined ? { conversation: flags.conversation } : {}),
122
+ ...(flags.limit !== undefined ? { limit: flags.limit } : {}),
123
+ ...(flags.before ? { before: flags.before } : {}),
92
124
  });
93
125
  this.log(JSON.stringify(result, null, 2));
94
126
  }
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Declare that the running interactive turn needs no message in Main Chat: the person only
4
+ * acknowledged something, or the work speaks for itself. The server records it on the turn
5
+ * (`declared_silent`), and the turn's marker still shows that the turn happened.
6
+ *
7
+ * Only inside a daemon session, for that session's own running turn: the server proves the
8
+ * turn from the session token, exactly as it does for a send.
9
+ */
10
+ export default class AgentMessageNoReply extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const api_fetch_1 = require("../../../lib/api-fetch");
7
+ const message_intent_1 = require("../../../lib/message-intent");
8
+ /**
9
+ * Declare that the running interactive turn needs no message in Main Chat: the person only
10
+ * acknowledged something, or the work speaks for itself. The server records it on the turn
11
+ * (`declared_silent`), and the turn's marker still shows that the turn happened.
12
+ *
13
+ * Only inside a daemon session, for that session's own running turn: the server proves the
14
+ * turn from the session token, exactly as it does for a send.
15
+ */
16
+ class AgentMessageNoReply extends base_command_1.BaseCommand {
17
+ static description = 'Declare that this interactive turn needs no message in Main Chat (recorded on the turn; Main Chat does not act on it yet). Only inside a daemon session, for its own running turn';
18
+ static examples = ['<%= config.bin %> agent message no-reply'];
19
+ static flags = {
20
+ json: core_1.Flags.boolean({
21
+ description: 'Accepted for consistency; this command always outputs JSON',
22
+ }),
23
+ };
24
+ async run() {
25
+ await this.parse(AgentMessageNoReply);
26
+ const sessionContext = (0, message_intent_1.resolveMessageCommandSessionContext)({
27
+ // A person has no turn to declare: only a session can.
28
+ requireHumanAuth: () => undefined,
29
+ });
30
+ if (!sessionContext?.sessionId) {
31
+ this.failWithCliError({
32
+ message: '`agent message no-reply` declares something about a running turn, so it only works inside a daemon session.',
33
+ code: 'NO_REPLY_REQUIRES_SESSION',
34
+ exit: 2,
35
+ retryable: false,
36
+ details: {
37
+ suggestion: 'Run it from the interactive session whose turn it is; outside one there is no turn to declare.',
38
+ },
39
+ });
40
+ }
41
+ try {
42
+ const result = await (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(sessionContext.sessionId)}/turn-disposition`, {
43
+ method: 'POST',
44
+ credential: (0, message_intent_1.sessionCredential)(sessionContext.token),
45
+ body: { disposition: data_provider_1.TURN_REPLY_DISPOSITIONS[0] },
46
+ });
47
+ this.log(JSON.stringify(result, null, 2));
48
+ }
49
+ catch (error) {
50
+ this.handleApiError(error);
51
+ }
52
+ }
53
+ }
54
+ exports.default = AgentMessageNoReply;
@@ -0,0 +1,24 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ import { type CanonicalMessageIntentResponse } from '../../../lib/message-intent';
3
+ /**
4
+ * Withdraw a message this Agent sent its owner (C10). Nothing is sent: the server marks the
5
+ * message retracted after proving, through the session, that this Agent sent it. The message
6
+ * stays in the conversation as a placeholder and in the audit.
7
+ *
8
+ * Only inside an Agent session: a person at a terminal has no Agent message of their own to
9
+ * withdraw. To correct a message instead, send the correction with `send --supersedes`.
10
+ */
11
+ export default class AgentMessageRetract extends BaseCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static args: {
15
+ messageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
16
+ };
17
+ static flags: {
18
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ };
20
+ run(): Promise<void>;
21
+ }
22
+ /** The key of withdrawing one message from one session; ids are hashed so the key stays short. */
23
+ export declare function retractIdempotencyKey(sessionId: string, messageId: string): string;
24
+ export declare function describeRetraction(messageId: string, result: Pick<CanonicalMessageIntentResponse, 'status' | 'reason'>): string;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.retractIdempotencyKey = retractIdempotencyKey;
37
+ exports.describeRetraction = describeRetraction;
38
+ const crypto = __importStar(require("node:crypto"));
39
+ const core_1 = require("@oclif/core");
40
+ const data_provider_1 = require("@skrr-ai/data-provider");
41
+ const base_command_1 = require("../../../base-command");
42
+ const agent_resolver_1 = require("../../../lib/agent-resolver");
43
+ const message_intent_1 = require("../../../lib/message-intent");
44
+ /**
45
+ * Withdraw a message this Agent sent its owner (C10). Nothing is sent: the server marks the
46
+ * message retracted after proving, through the session, that this Agent sent it. The message
47
+ * stays in the conversation as a placeholder and in the audit.
48
+ *
49
+ * Only inside an Agent session: a person at a terminal has no Agent message of their own to
50
+ * withdraw. To correct a message instead, send the correction with `send --supersedes`.
51
+ */
52
+ class AgentMessageRetract extends base_command_1.BaseCommand {
53
+ static description = 'Withdraw a message this Agent sent in the owner’s chat. Nothing new is sent; the message is shown as withdrawn. Only inside an Agent session, for its own messages';
54
+ static examples = [
55
+ '<%= config.bin %> agent message retract <message-id>',
56
+ '<%= config.bin %> agent message retract <message-id> --json',
57
+ ];
58
+ static args = {
59
+ messageId: core_1.Args.string({
60
+ description: 'The messageId of the message to withdraw (printed by `agent message send`, and in `agent message context`)',
61
+ required: true,
62
+ ignoreStdin: true,
63
+ }),
64
+ };
65
+ static flags = {
66
+ json: core_1.Flags.boolean({ description: 'Print the server’s answer as JSON' }),
67
+ };
68
+ async run() {
69
+ const { args, flags } = await this.parse(AgentMessageRetract);
70
+ const parsed = (0, data_provider_1.parseMessageOperation)({ kind: 'retract', targetMessageId: args.messageId });
71
+ if (!parsed.ok) {
72
+ this.failWithCliError({
73
+ message: parsed.reason,
74
+ code: 'INVALID_MESSAGE_OPERATION',
75
+ exit: 1,
76
+ retryable: false,
77
+ });
78
+ }
79
+ let sessionContext;
80
+ try {
81
+ sessionContext = (0, message_intent_1.resolveMessageCommandSessionContext)({
82
+ // A person has no Agent message to withdraw: only the Agent's session can.
83
+ requireHumanAuth: () => undefined,
84
+ });
85
+ }
86
+ catch (error) {
87
+ this.failWithCliError({
88
+ message: error.message,
89
+ code: error.code || 'MESSAGE_INTENT_ERROR',
90
+ exit: 2,
91
+ retryable: false,
92
+ });
93
+ }
94
+ if (!sessionContext?.sessionId) {
95
+ this.failWithCliError({
96
+ message: '`agent message retract` withdraws one of the Agent’s own messages, so it only works inside that Agent’s session.',
97
+ code: 'MESSAGE_OPERATION_REQUIRES_SESSION',
98
+ exit: 2,
99
+ retryable: false,
100
+ details: {
101
+ suggestion: 'Run it from the session of the Agent that sent the message. Outside one there is no Agent to withdraw it as.',
102
+ },
103
+ });
104
+ }
105
+ let agentId;
106
+ try {
107
+ agentId = (0, agent_resolver_1.resolveSessionAgentIdentity)().id;
108
+ }
109
+ catch (error) {
110
+ const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
111
+ this.failWithCliError({
112
+ message: failure.message,
113
+ code: failure.code,
114
+ exit: 2,
115
+ retryable: false,
116
+ details: { suggestion: failure.suggestion },
117
+ });
118
+ }
119
+ const targetMessageId = parsed.ok && parsed.value.kind === 'retract' ? parsed.value.targetMessageId : '';
120
+ const request = (0, message_intent_1.canonicalAppOwnerDmRequest)({
121
+ agentId: agentId,
122
+ text: '',
123
+ // One withdrawal per message per session: a retry replays it.
124
+ idempotencyKey: retractIdempotencyKey(sessionContext.sessionId, targetMessageId),
125
+ operation: { kind: 'retract', targetMessageId },
126
+ });
127
+ let result;
128
+ try {
129
+ result = await (0, message_intent_1.submitSessionMessageIntent)({ context: sessionContext, request });
130
+ }
131
+ catch (error) {
132
+ if (error instanceof Error && error.name === 'MessageIntentCliError') {
133
+ this.failWithCliError({
134
+ message: error.message,
135
+ code: error.code || 'MESSAGE_INTENT_ERROR',
136
+ exit: 2,
137
+ retryable: false,
138
+ });
139
+ }
140
+ this.handleApiError(error);
141
+ }
142
+ if (flags.json) {
143
+ this.log(JSON.stringify(result, null, 2));
144
+ return;
145
+ }
146
+ this.log(describeRetraction(targetMessageId, result));
147
+ }
148
+ }
149
+ exports.default = AgentMessageRetract;
150
+ /** The key of withdrawing one message from one session; ids are hashed so the key stays short. */
151
+ function retractIdempotencyKey(sessionId, messageId) {
152
+ const digest = crypto
153
+ .createHash('sha256')
154
+ .update(JSON.stringify(['retract', sessionId, messageId]))
155
+ .digest('hex')
156
+ .slice(0, 32);
157
+ return `cli:agent-message-retract:${digest}`;
158
+ }
159
+ function describeRetraction(messageId, result) {
160
+ if (result.status === 'retracted') {
161
+ return `Withdrew message ${messageId}. The person sees that it was withdrawn.`;
162
+ }
163
+ if (result.status === 'duplicate') {
164
+ return `Message ${messageId} was already withdrawn by this request; nothing changed.`;
165
+ }
166
+ return `Message ${messageId} was not withdrawn: ${result.status || 'unknown'}${result.reason ? ` (${result.reason})` : ''}.`;
167
+ }
@@ -1,7 +1,7 @@
1
- import { type EntityEmbed } from '@skrr-ai/data-provider';
1
+ import { type EntityEmbed, type MessageOperation } from '@skrr-ai/data-provider';
2
2
  import { BaseCommand } from '../../../base-command';
3
3
  import { type ResolvedAgentIdentity } from '../../../lib/agent-resolver';
4
- import { type CanonicalMessageDestination, type CanonicalMessageIntentRequest, type CanonicalMessageIntentResponse, type CommunicationPresentation, type OneVoiceOutcome } from '../../../lib/message-intent';
4
+ import { type CanonicalDestinationKind, type CanonicalMessageDestination, type CanonicalMessageIntentRequest, type CanonicalMessageIntentResponse, type CommunicationPresentation, type MessageOperationOutcome, type OneVoiceOutcome } from '../../../lib/message-intent';
5
5
  import { type WireEmbedRejection } from '../../../lib/entity-embeds';
6
6
  /**
7
7
  * A reading-comfort prompt, not a protocol limit. The Gateway deliberately
@@ -51,6 +51,12 @@ export type CanonicalIntentEnvelope = {
51
51
  */
52
52
  embeds?: EntityEmbed[];
53
53
  embedRejections?: WireEmbedRejection[];
54
+ /** C10: the app message this send became, which a later correction or withdrawal names. */
55
+ messageId?: string;
56
+ /** C10: the operation this send asked for, and what the server did with it. */
57
+ operation?: MessageOperation & {
58
+ outcome?: MessageOperationOutcome;
59
+ };
54
60
  intent: {
55
61
  id: string | null;
56
62
  status: NonNullable<CanonicalMessageIntentResponse['status']> | 'delivered' | 'submitted';
@@ -105,6 +111,8 @@ export default class AgentMessageSend extends BaseCommand {
105
111
  'thread-ts': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
106
112
  'thread-root': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
107
113
  'from-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
114
+ supersedes: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
115
+ 'status-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
108
116
  'idempotency-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
109
117
  kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
110
118
  phase: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -231,7 +239,7 @@ export declare function normalizeIntentPayload({ agentId, jsonBody, merged, }: {
231
239
  jsonBody: Record<string, unknown>;
232
240
  merged: Record<string, unknown>;
233
241
  }): NormalizedIntentPayload;
234
- export declare function generateIdempotencyKey(agentId: string, payload: Pick<NormalizedIntentPayload, 'destination' | 'content' | 'presentation' | 'context' | 'threadRootMessageId'>): string;
242
+ export declare function generateIdempotencyKey(agentId: string, payload: Pick<NormalizedIntentPayload, 'destination' | 'content' | 'presentation' | 'context' | 'threadRootMessageId'>, operation?: MessageOperation): string;
235
243
  export declare function buildEnvelope(input: {
236
244
  ok: boolean;
237
245
  principalKind: PrincipalKind;
@@ -251,6 +259,8 @@ export declare function buildEnvelope(input: {
251
259
  /** What the server applied to `presentation`; shown instead of the request when it differs. */
252
260
  appliedPresentation?: Pick<CommunicationPresentation, 'kind' | 'attention' | 'attentionRequested'>;
253
261
  notificationPolicy?: 'normal' | 'silent';
262
+ messageId?: string;
263
+ operation?: CanonicalIntentEnvelope['operation'];
254
264
  intent: CanonicalIntentEnvelope['intent'];
255
265
  }): CanonicalIntentEnvelope;
256
266
  /**
@@ -263,4 +273,38 @@ export declare function buildEnvelope(input: {
263
273
  */
264
274
  export declare function withAppliedAttention(declared: CommunicationPresentation, applied?: Pick<CommunicationPresentation, 'kind' | 'attention' | 'attentionRequested'>): CommunicationPresentation;
265
275
  export declare function formatEnvelope(envelope: CanonicalIntentEnvelope): string;
276
+ /**
277
+ * The message id a later correction names, and what this send did to an earlier message (C10).
278
+ * A send whose mark did not land is said to have gone out WITHOUT replacing anything: the exit
279
+ * code cannot say it, because the message itself was delivered.
280
+ */
281
+ export declare function describeMessageOperation(envelope: CanonicalIntentEnvelope): string;
282
+ /**
283
+ * The operation a send asks for, from `--supersedes`, `--status-key` or a JSON body's
284
+ * `operation`. One source only: two that disagree are refused rather than one silently winning.
285
+ * A retraction is not a send (`agent message retract`).
286
+ */
287
+ export declare function resolveSendOperation({ supersedes, statusKey, jsonOperation, }: {
288
+ supersedes?: string;
289
+ statusKey?: string;
290
+ jsonOperation?: unknown;
291
+ }): {
292
+ operation?: MessageOperation;
293
+ } | {
294
+ error: string;
295
+ };
296
+ /**
297
+ * Why a send cannot carry an operation here, or null. Only an Agent's own session can name its
298
+ * own message (the server proves it through the session), only an owner DM can be named, and a
299
+ * sequence would leave unclear which part replaces the earlier message.
300
+ */
301
+ export declare function sendOperationUnsupported({ destinationKind, inSession, partCount, }: {
302
+ destinationKind: CanonicalDestinationKind;
303
+ inSession: boolean;
304
+ partCount: number;
305
+ }): {
306
+ message: string;
307
+ code: string;
308
+ exit: number;
309
+ } | null;
266
310
  export {};