@skrr-ai/cli 0.1.207 → 0.1.209
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/no-reply.js +1 -1
- package/dist/commands/agent/message/react.d.ts +23 -0
- package/dist/commands/agent/message/react.js +125 -0
- package/dist/commands/agent/message/resolve.d.ts +31 -0
- package/dist/commands/agent/message/resolve.js +111 -0
- package/dist/commands/agent/message/retract.js +1 -1
- package/dist/commands/agent/message/send.d.ts +25 -6
- package/dist/commands/agent/message/send.js +135 -30
- package/dist/commands/agent/request/list.d.ts +15 -0
- package/dist/commands/agent/request/list.js +82 -0
- package/dist/commands/agent/request/send.d.ts +18 -0
- package/dist/commands/agent/request/send.js +56 -0
- package/dist/commands/agents/access/approve.d.ts +17 -0
- package/dist/commands/agents/access/approve.js +94 -0
- package/dist/commands/agents/access/deny.d.ts +10 -0
- package/dist/commands/agents/access/deny.js +36 -0
- package/dist/commands/agents/access/list.d.ts +10 -0
- package/dist/commands/agents/access/list.js +55 -0
- package/dist/commands/agents/access/reach.d.ts +13 -0
- package/dist/commands/agents/access/reach.js +53 -0
- package/dist/commands/agents/access/revoke.d.ts +13 -0
- package/dist/commands/agents/access/revoke.js +50 -0
- package/dist/commands/agents/always-on/recovery-review.d.ts +5 -0
- package/dist/commands/agents/always-on/recovery-review.js +16 -0
- package/dist/commands/agents/chat.d.ts +8 -0
- package/dist/commands/agents/chat.js +369 -90
- package/dist/commands/agents/import.d.ts +15 -1
- package/dist/commands/agents/import.js +212 -24
- package/dist/commands/agents/intuitions/accept.d.ts +0 -1
- package/dist/commands/agents/intuitions/accept.js +22 -7
- package/dist/commands/agents/intuitions/generate.d.ts +0 -1
- package/dist/commands/agents/intuitions/generate.js +4 -16
- package/dist/commands/agents/intuitions/list.js +9 -3
- package/dist/commands/agents/intuitions/resume.d.ts +11 -0
- package/dist/commands/agents/intuitions/resume.js +37 -0
- package/dist/commands/agents/manager/status.js +7 -6
- package/dist/commands/agents/not-for-task.d.ts +24 -0
- package/dist/commands/agents/not-for-task.js +60 -0
- package/dist/commands/agents/schedule-overview.d.ts +20 -0
- package/dist/commands/agents/schedule-overview.js +35 -2
- package/dist/commands/agents/shared-memory.d.ts +24 -0
- package/dist/commands/agents/shared-memory.js +67 -0
- package/dist/commands/agents/stop.d.ts +23 -0
- package/dist/commands/agents/stop.js +61 -0
- package/dist/commands/agents/update.d.ts +7 -0
- package/dist/commands/agents/update.js +45 -2
- package/dist/commands/agents/visibility.d.ts +1 -0
- package/dist/commands/agents/visibility.js +14 -0
- package/dist/commands/code/migrate.js +3 -1
- package/dist/commands/convos/messages.js +5 -0
- package/dist/commands/convos/transcript.js +2 -2
- package/dist/commands/daemon/logs.d.ts +3 -1
- package/dist/commands/daemon/logs.js +6 -2
- package/dist/commands/duties/advance-next.js +16 -7
- package/dist/commands/duties/preflight.js +17 -13
- package/dist/commands/followups/show.js +9 -0
- package/dist/commands/followups/watch-pr.d.ts +27 -0
- package/dist/commands/followups/watch-pr.js +124 -0
- package/dist/commands/harnesses/evaluations/evidence.js +2 -2
- package/dist/commands/harnesses/evaluations/grant.js +1 -1
- package/dist/commands/harnesses/evaluations/revoke.js +1 -1
- package/dist/commands/harnesses/evaluations/show.js +1 -1
- package/dist/commands/harnesses/rollouts/grant.js +1 -1
- package/dist/commands/harnesses/rollouts/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
- package/dist/commands/memory/consolidation/index.d.ts +20 -0
- package/dist/commands/memory/consolidation/index.js +78 -0
- package/dist/commands/memory/consolidation/resume.d.ts +14 -0
- package/dist/commands/memory/consolidation/resume.js +46 -0
- package/dist/commands/memory/consolidation/undo.d.ts +18 -0
- package/dist/commands/memory/consolidation/undo.js +61 -0
- package/dist/commands/messages/list.js +9 -1
- package/dist/commands/slack/mutes.d.ts +10 -0
- package/dist/commands/slack/mutes.js +62 -0
- package/dist/commands/slack/unmute.d.ts +12 -0
- package/dist/commands/slack/unmute.js +44 -0
- package/dist/commands/tasks/actionability.js +10 -0
- package/dist/commands/tasks/ask.d.ts +50 -0
- package/dist/commands/tasks/ask.js +190 -0
- package/dist/commands/tasks/bulk-update.js +12 -0
- package/dist/commands/tasks/handover.js +14 -0
- package/dist/commands/tasks/input/answer.js +8 -2
- package/dist/commands/tasks/input/show.d.ts +26 -0
- package/dist/commands/tasks/input/show.js +185 -17
- package/dist/commands/tasks/list.d.ts +8 -0
- package/dist/commands/tasks/list.js +50 -9
- package/dist/commands/tasks/move.d.ts +3 -0
- package/dist/commands/tasks/move.js +71 -1
- package/dist/commands/tasks/result/show.js +19 -7
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/runs.d.ts +4 -1
- package/dist/commands/tasks/runs.js +22 -3
- package/dist/commands/tasks/show.d.ts +4 -3
- package/dist/commands/tasks/show.js +40 -7
- package/dist/commands/tasks/start.js +35 -16
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +55 -1
- package/dist/commands/tasks/updates/add.js +3 -0
- package/dist/commands/tasks/wait.d.ts +20 -0
- package/dist/commands/tasks/wait.js +103 -2
- package/dist/generated/agent-guides.json +892 -183
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-access-command.d.ts +19 -0
- package/dist/lib/agent-access-command.js +44 -0
- package/dist/lib/agent-access.d.ts +18 -0
- package/dist/lib/agent-access.js +48 -0
- package/dist/lib/agent-import/apply.d.ts +50 -0
- package/dist/lib/agent-import/apply.js +85 -0
- package/dist/lib/agent-import/plan.d.ts +132 -0
- package/dist/lib/agent-import/plan.js +504 -0
- package/dist/lib/agent-import/reader.d.ts +94 -0
- package/dist/lib/agent-import/reader.js +326 -0
- package/dist/lib/agent-import/schedule.d.ts +46 -0
- package/dist/lib/agent-import/schedule.js +220 -0
- package/dist/lib/agent-import/sources.d.ts +124 -0
- package/dist/lib/agent-import/sources.js +797 -0
- package/dist/lib/chat-stop.d.ts +17 -0
- package/dist/lib/chat-stop.js +70 -0
- package/dist/lib/cloud-reply.d.ts +21 -0
- package/dist/lib/cloud-reply.js +52 -0
- package/dist/lib/duties.js +24 -4
- package/dist/lib/duty-ledgers.js +19 -2
- package/dist/lib/file-mime.js +8 -0
- package/dist/lib/followups.d.ts +61 -0
- package/dist/lib/followups.js +39 -0
- package/dist/lib/handover-interview.d.ts +18 -0
- package/dist/lib/handover-interview.js +53 -0
- package/dist/lib/inbound-messages.d.ts +156 -0
- package/dist/lib/inbound-messages.js +375 -0
- package/dist/lib/input-queue.js +2 -1
- package/dist/lib/intuition-look.d.ts +10 -0
- package/dist/lib/intuition-look.js +64 -0
- package/dist/lib/message-intent.d.ts +18 -2
- package/dist/lib/message-intent.js +23 -1
- package/dist/lib/preflight-copy.d.ts +16 -1
- package/dist/lib/preflight-copy.js +33 -1
- package/dist/lib/record-output.d.ts +1 -1
- package/dist/lib/record-output.js +2 -0
- package/dist/lib/skill-import.d.ts +19 -0
- package/dist/lib/skill-import.js +34 -0
- package/dist/lib/slack-thread-mutes.d.ts +25 -0
- package/dist/lib/slack-thread-mutes.js +12 -0
- package/dist/lib/task-carriers.d.ts +18 -0
- package/dist/lib/task-carriers.js +43 -0
- package/dist/lib/task-extras.d.ts +5 -0
- package/dist/lib/task-extras.js +5 -0
- package/dist/lib/task-operations.d.ts +2 -0
- package/dist/lib/task-operations.js +28 -4
- package/dist/lib/task-preflight.js +1 -0
- package/dist/lib/task-recurrence-summary.d.ts +15 -0
- package/dist/lib/task-recurrence-summary.js +22 -0
- package/dist/lib/task-review-notice.d.ts +21 -0
- package/dist/lib/task-review-notice.js +46 -0
- package/dist/lib/task-version.d.ts +53 -0
- package/dist/lib/task-version.js +89 -0
- package/dist/lib/task-write-attribution.d.ts +7 -0
- package/dist/lib/task-write-attribution.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.js +124 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.js +141 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +13492 -12505
- package/oclif.manifest.json +2090 -132
- package/package.json +9 -2
|
@@ -44,7 +44,7 @@ class AgentMessageNoReply extends base_command_1.BaseCommand {
|
|
|
44
44
|
credential: (0, message_intent_1.sessionCredential)(sessionContext.token),
|
|
45
45
|
body: { disposition: data_provider_1.TURN_REPLY_DISPOSITIONS[0] },
|
|
46
46
|
});
|
|
47
|
-
this.
|
|
47
|
+
this.printJsonResult(result);
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
50
|
this.handleApiError(error);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* React to one of the owner's messages with an emoji, as the Agent (design §4.7, D5). A reaction
|
|
4
|
+
* is the lightest acknowledgement: "seen", "on it", "done", with no message to read. It replaces
|
|
5
|
+
* the Agent's earlier reaction to that message.
|
|
6
|
+
*
|
|
7
|
+
* Inside an interactive Agent session it reacts as that session's Agent. An unattended run is
|
|
8
|
+
* refused: nobody is there to acknowledge, so it sends a message instead. Outside a session the
|
|
9
|
+
* owner reacts as one of their Agents, named with `--agent`.
|
|
10
|
+
*/
|
|
11
|
+
export default class AgentMessageReact 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
|
+
emoji: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
static flags: {
|
|
19
|
+
agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
};
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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 agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
+
const http_error_1 = require("../../../lib/http-error");
|
|
8
|
+
const inbound_messages_1 = require("../../../lib/inbound-messages");
|
|
9
|
+
const message_intent_1 = require("../../../lib/message-intent");
|
|
10
|
+
/**
|
|
11
|
+
* React to one of the owner's messages with an emoji, as the Agent (design §4.7, D5). A reaction
|
|
12
|
+
* is the lightest acknowledgement: "seen", "on it", "done", with no message to read. It replaces
|
|
13
|
+
* the Agent's earlier reaction to that message.
|
|
14
|
+
*
|
|
15
|
+
* Inside an interactive Agent session it reacts as that session's Agent. An unattended run is
|
|
16
|
+
* refused: nobody is there to acknowledge, so it sends a message instead. Outside a session the
|
|
17
|
+
* owner reacts as one of their Agents, named with `--agent`.
|
|
18
|
+
*/
|
|
19
|
+
class AgentMessageReact extends base_command_1.BaseCommand {
|
|
20
|
+
static description = "React to one of the owner's messages with an emoji, as the Agent: the lightest acknowledgement. Replaces the Agent's earlier reaction to that message";
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> agent message react <message-id> 👀',
|
|
23
|
+
'<%= config.bin %> agent message react <message-id> done',
|
|
24
|
+
'<%= config.bin %> agent message react <message-id> thumbs-up --agent <agent-id> --json',
|
|
25
|
+
];
|
|
26
|
+
static args = {
|
|
27
|
+
messageId: core_1.Args.string({
|
|
28
|
+
description: "The messageId of the owner's message (in `agent message context`, or from the chat)",
|
|
29
|
+
required: true,
|
|
30
|
+
ignoreStdin: true,
|
|
31
|
+
}),
|
|
32
|
+
emoji: core_1.Args.string({
|
|
33
|
+
description: `The reaction: ${Object.entries(inbound_messages_1.REACTION_NAMES)
|
|
34
|
+
.map(([emoji, name]) => `${emoji} (${name})`)
|
|
35
|
+
.join(', ')}`,
|
|
36
|
+
required: true,
|
|
37
|
+
ignoreStdin: true,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
static flags = {
|
|
41
|
+
agent: core_1.Flags.string({
|
|
42
|
+
description: 'The Agent that reacts (outside an Agent session; inside one it is the session’s)',
|
|
43
|
+
}),
|
|
44
|
+
json: core_1.Flags.boolean({ description: 'Print the server’s answer as JSON' }),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { args, flags } = await this.parse(AgentMessageReact);
|
|
48
|
+
const emoji = (0, inbound_messages_1.reactionFromInput)(args.emoji);
|
|
49
|
+
if (!emoji) {
|
|
50
|
+
this.failWithCliError({
|
|
51
|
+
message: inbound_messages_1.AGENT_REPLY_REFUSAL_COPY.reaction_invalid,
|
|
52
|
+
code: 'reaction_invalid',
|
|
53
|
+
exit: 2,
|
|
54
|
+
retryable: false,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
let sessionContext;
|
|
58
|
+
try {
|
|
59
|
+
sessionContext = (0, message_intent_1.resolveMessageCommandSessionContext)({
|
|
60
|
+
requireHumanAuth: () => this.requireAuth(),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
this.failWithCliError({
|
|
65
|
+
message: error.message,
|
|
66
|
+
code: error.code || 'MESSAGE_INTENT_ERROR',
|
|
67
|
+
exit: 2,
|
|
68
|
+
retryable: false,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
let agentId;
|
|
72
|
+
try {
|
|
73
|
+
agentId = sessionContext
|
|
74
|
+
? (0, agent_resolver_1.resolveSessionAgentIdentity)(flags.agent).id
|
|
75
|
+
: (await (0, agent_resolver_1.resolveAgentIdentity)(flags.agent)).id;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
79
|
+
this.failWithCliError({
|
|
80
|
+
message: failure.message,
|
|
81
|
+
code: failure.code,
|
|
82
|
+
exit: 2,
|
|
83
|
+
retryable: false,
|
|
84
|
+
details: { suggestion: failure.suggestion },
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
let answer;
|
|
88
|
+
try {
|
|
89
|
+
answer = sessionContext
|
|
90
|
+
? await (0, message_intent_1.reactAsSession)({
|
|
91
|
+
context: sessionContext,
|
|
92
|
+
messageId: args.messageId,
|
|
93
|
+
emoji: emoji,
|
|
94
|
+
})
|
|
95
|
+
: await data_provider_1.dataService.reactToAgentDmMessage(agentId, args.messageId, { emoji: emoji });
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error instanceof Error && error.name === 'MessageIntentCliError') {
|
|
99
|
+
this.failWithCliError({
|
|
100
|
+
message: error.message,
|
|
101
|
+
code: error.code || 'MESSAGE_INTENT_ERROR',
|
|
102
|
+
exit: 2,
|
|
103
|
+
retryable: false,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const refusal = (0, inbound_messages_1.agentReplyRefusalOf)(error);
|
|
107
|
+
if (refusal) {
|
|
108
|
+
this.failWithCliError({
|
|
109
|
+
message: inbound_messages_1.AGENT_REPLY_REFUSAL_COPY[refusal.code],
|
|
110
|
+
code: refusal.code,
|
|
111
|
+
status: (0, http_error_1.httpStatusOf)(error),
|
|
112
|
+
exit: 1,
|
|
113
|
+
retryable: false,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
this.handleApiError(error);
|
|
117
|
+
}
|
|
118
|
+
if (flags.json) {
|
|
119
|
+
this.log(JSON.stringify(answer, null, 2));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.log(`Reacted ${emoji} to message ${answer.messageId}. The owner sees it on the message.`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.default = AgentMessageReact;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** What the server answers a resolution with (`Communication/messageAsks.resolveAsk`). */
|
|
3
|
+
export type AskResolution = {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
messageId?: string;
|
|
6
|
+
already?: boolean;
|
|
7
|
+
reason?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
currentMessageId?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Record that this Agent has the answer to a question it asked its owner (a message sent with
|
|
13
|
+
* `--requires-response`, a `decision` or a `blocker`). Nothing is sent: the server marks the ask
|
|
14
|
+
* resolved after proving, through the session, that this Agent sent it. The person's Needs-you list
|
|
15
|
+
* stops showing the wait, and the Agent's next turn stops listing it as open.
|
|
16
|
+
*
|
|
17
|
+
* Only inside an Agent session: a person at a terminal has no ask of their own to resolve.
|
|
18
|
+
*/
|
|
19
|
+
export default class AgentMessageResolve extends BaseCommand {
|
|
20
|
+
static description: string;
|
|
21
|
+
static examples: string[];
|
|
22
|
+
static args: {
|
|
23
|
+
messageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
24
|
+
};
|
|
25
|
+
static flags: {
|
|
26
|
+
note: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
};
|
|
29
|
+
run(): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export declare function describeAskResolution(messageId: string, result: AskResolution): string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeAskResolution = describeAskResolution;
|
|
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 api_fetch_1 = require("../../../lib/api-fetch");
|
|
8
|
+
const message_intent_1 = require("../../../lib/message-intent");
|
|
9
|
+
/**
|
|
10
|
+
* Record that this Agent has the answer to a question it asked its owner (a message sent with
|
|
11
|
+
* `--requires-response`, a `decision` or a `blocker`). Nothing is sent: the server marks the ask
|
|
12
|
+
* resolved after proving, through the session, that this Agent sent it. The person's Needs-you list
|
|
13
|
+
* stops showing the wait, and the Agent's next turn stops listing it as open.
|
|
14
|
+
*
|
|
15
|
+
* Only inside an Agent session: a person at a terminal has no ask of their own to resolve.
|
|
16
|
+
*/
|
|
17
|
+
class AgentMessageResolve extends base_command_1.BaseCommand {
|
|
18
|
+
static description = 'Record that a question this Agent asked its owner is answered, so it stops showing as waiting on them. Nothing is sent. Only inside an Agent session, for its own messages';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> agent message resolve <message-id>',
|
|
21
|
+
'<%= config.bin %> agent message resolve <message-id> --note "They chose staging"',
|
|
22
|
+
];
|
|
23
|
+
static args = {
|
|
24
|
+
messageId: core_1.Args.string({
|
|
25
|
+
description: 'The messageId of the question (printed by `agent message send`, listed among your open questions at the start of a turn, and in `agent message context`)',
|
|
26
|
+
required: true,
|
|
27
|
+
ignoreStdin: true,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
static flags = {
|
|
31
|
+
note: core_1.Flags.string({
|
|
32
|
+
description: `A short note of the answer, kept with the question (at most ${data_provider_1.MESSAGE_ASK_NOTE_MAX_CHARS} characters)`,
|
|
33
|
+
}),
|
|
34
|
+
json: core_1.Flags.boolean({ description: 'Print the server’s answer as JSON' }),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { args, flags } = await this.parse(AgentMessageResolve);
|
|
38
|
+
const messageId = args.messageId.trim();
|
|
39
|
+
if (!messageId) {
|
|
40
|
+
this.failWithCliError({
|
|
41
|
+
message: 'Name the messageId of the question to resolve.',
|
|
42
|
+
code: 'INVALID_MESSAGE_ID',
|
|
43
|
+
exit: 1,
|
|
44
|
+
retryable: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (flags.note !== undefined && flags.note.length > data_provider_1.MESSAGE_ASK_NOTE_MAX_CHARS) {
|
|
48
|
+
this.failWithCliError({
|
|
49
|
+
message: `--note is at most ${data_provider_1.MESSAGE_ASK_NOTE_MAX_CHARS} characters.`,
|
|
50
|
+
code: 'ASK_NOTE_TOO_LONG',
|
|
51
|
+
exit: 1,
|
|
52
|
+
retryable: false,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
let sessionContext;
|
|
56
|
+
try {
|
|
57
|
+
sessionContext = (0, message_intent_1.resolveMessageCommandSessionContext)({
|
|
58
|
+
// A person has no ask of their own to resolve: only the Agent's session can.
|
|
59
|
+
requireHumanAuth: () => undefined,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.failWithCliError({
|
|
64
|
+
message: error.message,
|
|
65
|
+
code: error.code || 'MESSAGE_INTENT_ERROR',
|
|
66
|
+
exit: 2,
|
|
67
|
+
retryable: false,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (!sessionContext?.sessionId) {
|
|
71
|
+
this.failWithCliError({
|
|
72
|
+
message: '`agent message resolve` closes one of the Agent’s own questions, so it only works inside that Agent’s session.',
|
|
73
|
+
code: 'MESSAGE_OPERATION_REQUIRES_SESSION',
|
|
74
|
+
exit: 2,
|
|
75
|
+
retryable: false,
|
|
76
|
+
details: {
|
|
77
|
+
suggestion: 'Run it from the session of the Agent that asked. Outside one there is no Agent to resolve it as.',
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
let result;
|
|
82
|
+
try {
|
|
83
|
+
result = (await (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(sessionContext.sessionId)}/message-asks/${encodeURIComponent(messageId)}/resolve`, {
|
|
84
|
+
method: 'POST',
|
|
85
|
+
credential: (0, message_intent_1.sessionCredential)(sessionContext.token),
|
|
86
|
+
body: flags.note ? { note: flags.note } : {},
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
this.handleApiError(error);
|
|
91
|
+
}
|
|
92
|
+
if (flags.json) {
|
|
93
|
+
this.printJsonResult(result);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.log(describeAskResolution(messageId, result));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.default = AgentMessageResolve;
|
|
100
|
+
function describeAskResolution(messageId, result) {
|
|
101
|
+
if (result.ok && result.already) {
|
|
102
|
+
return `Question ${messageId} was already resolved; nothing changed.`;
|
|
103
|
+
}
|
|
104
|
+
if (result.ok) {
|
|
105
|
+
return `Resolved question ${messageId}. It no longer shows as waiting on the person.`;
|
|
106
|
+
}
|
|
107
|
+
if (result.reason === data_provider_1.MESSAGE_ASK_REFUSALS.NOT_CURRENT && result.currentMessageId) {
|
|
108
|
+
return `Question ${messageId} was replaced by ${result.currentMessageId}; resolve that one instead.`;
|
|
109
|
+
}
|
|
110
|
+
return `Question ${messageId} was not resolved: ${result.message || result.reason || 'unknown'}.`;
|
|
111
|
+
}
|
|
@@ -140,7 +140,7 @@ class AgentMessageRetract extends base_command_1.BaseCommand {
|
|
|
140
140
|
this.handleApiError(error);
|
|
141
141
|
}
|
|
142
142
|
if (flags.json) {
|
|
143
|
-
this.
|
|
143
|
+
this.printJsonResult(result);
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
this.log(describeRetraction(targetMessageId, result));
|
|
@@ -38,6 +38,8 @@ export type CanonicalIntentEnvelope = {
|
|
|
38
38
|
idempotencyKey: string;
|
|
39
39
|
/** Requested Agent Chat Thread root (the server remains authoritative). */
|
|
40
40
|
threadRootMessageId?: string;
|
|
41
|
+
/** The owner's messages this one answers, as requested (the server proved each one). */
|
|
42
|
+
replyTo?: string[];
|
|
41
43
|
/** Sender-declared semantics echoed for auditability; not a delivery promise. */
|
|
42
44
|
presentation?: CommunicationPresentation;
|
|
43
45
|
/** Legacy app-DM reach ceiling echoed when explicitly supplied. */
|
|
@@ -110,6 +112,7 @@ export default class AgentMessageSend extends BaseCommand {
|
|
|
110
112
|
channel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
111
113
|
'thread-ts': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
112
114
|
'thread-root': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
115
|
+
'reply-to': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
113
116
|
'from-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
114
117
|
supersedes: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
115
118
|
'status-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -137,6 +140,8 @@ export default class AgentMessageSend extends BaseCommand {
|
|
|
137
140
|
*/
|
|
138
141
|
private exitForDelivery;
|
|
139
142
|
private readPayload;
|
|
143
|
+
/** A reply the server refused, in the CLI's words, with the ids it could not prove. */
|
|
144
|
+
private failOnReplyRefusal;
|
|
140
145
|
private submitAsSession;
|
|
141
146
|
private submitAsHuman;
|
|
142
147
|
}
|
|
@@ -152,22 +157,35 @@ export type NormalizedIntentPayload = {
|
|
|
152
157
|
presentation?: CommunicationPresentation;
|
|
153
158
|
notificationPolicy?: 'normal' | 'silent';
|
|
154
159
|
threadRootMessageId?: string;
|
|
160
|
+
replyTo?: string[];
|
|
155
161
|
context?: {
|
|
156
162
|
taskId?: string;
|
|
157
163
|
spaceId?: string;
|
|
158
164
|
goalId?: string;
|
|
159
165
|
};
|
|
160
166
|
};
|
|
161
|
-
/**
|
|
162
|
-
* Keep segmentation a sender decision: this advisory must never rewrite,
|
|
163
|
-
* reject, or automatically split the text. It only covers private owner DMs,
|
|
164
|
-
* where a chat-like reading cadence is normally expected.
|
|
165
|
-
*/
|
|
167
|
+
/** A long owner DM sent as one message. Silent once the sender split it with `--part`. */
|
|
166
168
|
export declare function messageSegmentationAdvisory({ destination, text, followingParts, }: {
|
|
167
169
|
destination: CanonicalMessageDestination;
|
|
168
170
|
text: string;
|
|
169
171
|
followingParts: string[];
|
|
170
172
|
}): string | undefined;
|
|
173
|
+
/** The two voice habits the doctrine names and a check can see: a label opener, named filler. */
|
|
174
|
+
export declare function messageVoiceAdvisory({ destination, text, }: {
|
|
175
|
+
destination: CanonicalMessageDestination;
|
|
176
|
+
text: string;
|
|
177
|
+
}): string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* A `result` delivered from an Agent session that is not a Task run: the turn's final reply must
|
|
180
|
+
* not say it again (C13's `turn_duplicate_result`).
|
|
181
|
+
*/
|
|
182
|
+
export declare function resultReplyAdvisory({ inSession, inTaskRun, kind, destination, envelopes, }: {
|
|
183
|
+
inSession: boolean;
|
|
184
|
+
inTaskRun: boolean;
|
|
185
|
+
kind: string | undefined;
|
|
186
|
+
destination: CanonicalMessageDestination;
|
|
187
|
+
envelopes: readonly CanonicalIntentEnvelope[];
|
|
188
|
+
}): string | undefined;
|
|
171
189
|
/**
|
|
172
190
|
* Preserve the caller's semantic boundary while allowing them to send a few
|
|
173
191
|
* naturally separate short messages. A sequence is never automatic: the model
|
|
@@ -239,7 +257,7 @@ export declare function normalizeIntentPayload({ agentId, jsonBody, merged, }: {
|
|
|
239
257
|
jsonBody: Record<string, unknown>;
|
|
240
258
|
merged: Record<string, unknown>;
|
|
241
259
|
}): NormalizedIntentPayload;
|
|
242
|
-
export declare function generateIdempotencyKey(agentId: string, payload: Pick<NormalizedIntentPayload, 'destination' | 'content' | 'presentation' | 'context' | 'threadRootMessageId'>, operation?: MessageOperation): string;
|
|
260
|
+
export declare function generateIdempotencyKey(agentId: string, payload: Pick<NormalizedIntentPayload, 'destination' | 'content' | 'presentation' | 'context' | 'threadRootMessageId' | 'replyTo'>, operation?: MessageOperation): string;
|
|
243
261
|
/**
|
|
244
262
|
* The app message a person's owner-DM send became, as the session path names it (`messageId`),
|
|
245
263
|
* so the text output says `Message id: …` on this path too. Only a send that reached the chat
|
|
@@ -259,6 +277,7 @@ export declare function buildEnvelope(input: {
|
|
|
259
277
|
};
|
|
260
278
|
idempotencyKey: string;
|
|
261
279
|
threadRootMessageId?: string;
|
|
280
|
+
replyTo?: string[];
|
|
262
281
|
embeds?: EntityEmbed[];
|
|
263
282
|
embedRejections?: WireEmbedRejection[];
|
|
264
283
|
presentation?: CommunicationPresentation;
|