@primusclaw/personal-agent 0.12.0 → 0.14.0
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/index.js +2326 -1710
- package/dist/types/assistant/actions.d.ts +8 -1
- package/dist/types/assistant/confirm-outcome.d.ts +5 -2
- package/dist/types/assistant/events.d.ts +34 -4
- package/dist/types/assistant/say.d.ts +5 -2
- package/dist/types/assistant/seat-dispatch-outcome.d.ts +8 -0
- package/dist/types/assistant/seat-outcome.d.ts +4 -0
- package/dist/types/assistant/views.d.ts +21 -0
- package/dist/types/claw/model.d.ts +10 -0
- package/dist/types/claw/work-item.d.ts +17 -1
- package/dist/types/commands/agent-args.d.ts +6 -0
- package/dist/types/commands/parse.d.ts +2 -1
- package/dist/types/language/chosen.d.ts +2 -1
- package/dist/types/locales/assistant-cards.d.ts +9 -0
- package/dist/types/locales/assistant-seats.d.ts +46 -0
- package/dist/types/locales/assistant-work-clicks.d.ts +5 -0
- package/dist/types/locales/index.d.ts +1 -0
- package/dist/types/locales/remote-agents.d.ts +20 -3
- package/dist/types/locales/remote-leads.d.ts +2 -0
- package/dist/types/locales/remote.d.ts +10 -1
- package/dist/types/locales/turn.d.ts +2 -0
- package/dist/types/ports/claw/assistant.d.ts +5 -2
- package/dist/types/ports/store/assistant.d.ts +13 -2
- package/dist/types/ports/store/remote.d.ts +5 -0
- package/dist/types/proactive/deliver.d.ts +5 -0
- package/dist/types/proactive/deps.d.ts +4 -0
- package/dist/types/proactive/quiet.d.ts +4 -1
- package/dist/types/protocol/claw-api/assistant-events.d.ts +44 -4
- package/dist/types/protocol/remote-agents.d.ts +57 -0
- package/dist/types/remote/board.d.ts +6 -0
- package/dist/types/remote/chat-key.d.ts +2 -0
- package/dist/types/remote/chats.d.ts +7 -6
- package/dist/types/remote/clicks-start.d.ts +1 -1
- package/dist/types/remote/context.d.ts +4 -1
- package/dist/types/remote/lines.d.ts +1 -1
- package/dist/types/remote/remote-agents.d.ts +1 -0
- package/dist/types/remote/state.d.ts +4 -1
- package/dist/types/remote/turns/chat-turn.d.ts +1 -0
- package/dist/types/remote/turns/display.d.ts +5 -0
- package/dist/types/remote-view/permission-view.d.ts +4 -0
- package/dist/types/routing/chat.d.ts +11 -3
- package/dist/types/routing/features.d.ts +6 -0
- package/dist/types/routing/question-reply.d.ts +6 -1
- package/dist/types/routing/router.d.ts +6 -0
- package/dist/types/routing/turn-runner.d.ts +3 -2
- package/dist/types/routing/turn-start.d.ts +8 -13
- package/dist/types/turn/progress/status-message.d.ts +29 -1
- package/package.json +1 -1
|
@@ -50,9 +50,16 @@ export declare class AssistantActions {
|
|
|
50
50
|
private run;
|
|
51
51
|
/**
|
|
52
52
|
* Allow or Deny (`op`) on a write Claw holds until the person answers. The card must be the presser's and not yet used; what it
|
|
53
|
-
* answers is the recorded confirmation, as the person with their exchanged token. Of two presses exactly one is sent.
|
|
53
|
+
* answers is the recorded confirmation, as the person with their exchanged token. Of two presses exactly one is sent. On a choice
|
|
54
|
+
* card (places to pick from) Allow carries the place's index (`pick`): the place Claw is told was picked is read from the record,
|
|
55
|
+
* and a press that names none of its places sends nothing.
|
|
54
56
|
*/
|
|
55
57
|
confirmClick(click: CardClick): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* The held write a press answers, how, and (a choice card's Allow) the place it picked; undefined when the press answers nothing
|
|
60
|
+
* (the presser was told why): not the presser's card, not a held write, used already, or a place the card does not offer.
|
|
61
|
+
*/
|
|
62
|
+
private pressed;
|
|
56
63
|
/** The presser's exchanged token; undefined when it cannot be had (the card was answered with why, as it was). */
|
|
57
64
|
private token;
|
|
58
65
|
/** Claw did not answer, or refused: a 403 or 404 ends the card (pressing again cannot help); anything else gives it back. */
|
|
@@ -15,6 +15,9 @@ export declare function isGithubWrite(kind: string): boolean;
|
|
|
15
15
|
* (`POST /v1/github-review/confirmations/:id/decision`: `merged`, `queued`, `submitted`, `denied`, `stale`, `expired`, `refused`, `retry`).
|
|
16
16
|
*/
|
|
17
17
|
export declare function githubWriteOutcome(kind: string, out: Fields, lang: Lang): string;
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* What came of a press on a held write's card of `kind`, in one line: Claw's answer said plainly. `picked`: the label of the place a
|
|
20
|
+
* choice card's press picked ("" none).
|
|
21
|
+
*/
|
|
22
|
+
export declare function confirmOutcome(kind: string, out: Fields, lang: Lang, picked?: string): string;
|
|
20
23
|
export {};
|
|
@@ -13,7 +13,7 @@ export declare const SUGGESTED_REPLY_MAX = 30;
|
|
|
13
13
|
/** The suggested replies kept under a message when the channel's own limit is not given (`SurfaceCaps.suggestionsMax`). */
|
|
14
14
|
export declare const SUGGESTIONS_MAX = 3;
|
|
15
15
|
/** The writes Claw holds for the person that this worker draws as a card. */
|
|
16
|
-
export declare const CONFIRM_KINDS: readonly ["trigger_create", "trigger_cancel", "devenv_send", "github_comment", "devenv_hide", "skill_save", "github_merge", "github_review"];
|
|
16
|
+
export declare const CONFIRM_KINDS: readonly ["trigger_create", "trigger_cancel", "devenv_send", "github_comment", "devenv_hide", "skill_save", "seat_role", "seat_set", "seat_dispatch", "github_merge", "github_review"];
|
|
17
17
|
/** The default replies under what the assistant said: (what the button says, what it sends). */
|
|
18
18
|
export declare const ASSISTANT_SUGGESTED_REPLIES: Readonly<Record<Lang, readonly SuggestedReply[]>>;
|
|
19
19
|
type Event = Readonly<Record<string, unknown>>;
|
|
@@ -29,12 +29,30 @@ export interface ConfirmAction {
|
|
|
29
29
|
* whole); undefined when it carries none that could be one. `exactCommand` is the router's test of a command typed whole.
|
|
30
30
|
*/
|
|
31
31
|
export declare function confirmActionOf(event: Event, exactCommand: (text: string) => boolean): ConfirmAction | undefined;
|
|
32
|
+
/** One place a seat dispatch's choice card offers (`confirm_write.options`): what a press answers with, and what it shows. */
|
|
33
|
+
export interface ConfirmOption {
|
|
34
|
+
/** What Claw is told was picked (a seat's id, or `sandbox`). */
|
|
35
|
+
readonly id: string;
|
|
36
|
+
/** The name the person gave the seat, else `<machine>/<agent>`: the button's words. */
|
|
37
|
+
readonly label: string;
|
|
38
|
+
/** The folder, as the machine reported it ("" none): shown as text only. */
|
|
39
|
+
readonly detail: string;
|
|
40
|
+
}
|
|
41
|
+
/** The fewest and the most places a seat dispatch's choice card offers (Claw sends 2 to 5). */
|
|
42
|
+
export declare const CONFIRM_OPTIONS_MIN = 2;
|
|
43
|
+
export declare const CONFIRM_OPTIONS_MAX = 5;
|
|
32
44
|
export interface ConfirmWrite {
|
|
33
45
|
readonly confirmationId: string;
|
|
34
46
|
readonly kind: (typeof CONFIRM_KINDS)[number];
|
|
35
47
|
readonly allowLabel: string;
|
|
48
|
+
/** A choice card (`seat_dispatch` only): one button per option; absent for a card that is let through or not. */
|
|
49
|
+
readonly options?: readonly ConfirmOption[];
|
|
36
50
|
}
|
|
37
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The write Claw holds for the person (`confirm_write` of an `assistant.say`); undefined when it carries none this worker draws. A
|
|
53
|
+
* seat dispatch that offers places it cannot read whole is none (its words still name them, for the person to answer in the chat):
|
|
54
|
+
* a card without them could only send a choice Claw refuses.
|
|
55
|
+
*/
|
|
38
56
|
export declare function confirmWriteOf(event: Event): ConfirmWrite | undefined;
|
|
39
57
|
/**
|
|
40
58
|
* The suggested replies under an `assistant.say` (none under anything else, or with the style off): Claw's own, each one plain
|
|
@@ -87,8 +105,11 @@ export interface SayChoice {
|
|
|
87
105
|
*/
|
|
88
106
|
export declare function choiceOf(event: Event): SayChoice | undefined;
|
|
89
107
|
export interface RemoteNotice {
|
|
90
|
-
/**
|
|
91
|
-
|
|
108
|
+
/**
|
|
109
|
+
* `resolved`: a question a terminal asked no longer waits here (answered there, or given up); `resolved` says which. `progress`:
|
|
110
|
+
* the hourly line of a task handed to a seat that has run more than an hour (its words say all).
|
|
111
|
+
*/
|
|
112
|
+
readonly kind: "done" | "needs_you" | "error" | "resolved" | "progress";
|
|
92
113
|
readonly sessionId: string;
|
|
93
114
|
readonly ask: Event | undefined;
|
|
94
115
|
readonly machine: string;
|
|
@@ -98,6 +119,15 @@ export interface RemoteNotice {
|
|
|
98
119
|
readonly actionId: string;
|
|
99
120
|
readonly by: string;
|
|
100
121
|
};
|
|
122
|
+
/** A task the assistant handed to a seat: its item number (`#N`); undefined for a session's own message. */
|
|
123
|
+
readonly itemSeq?: number;
|
|
124
|
+
/** A task the assistant handed to a seat: the name the person gave that seat ("" none). */
|
|
125
|
+
readonly seatAlias?: string;
|
|
126
|
+
/**
|
|
127
|
+
* The request outlived its first wait and the agent keeps waiting until `ask.expires_at` (`ask.parked`): the one reminder of a
|
|
128
|
+
* request whose card may be in the chat already.
|
|
129
|
+
*/
|
|
130
|
+
readonly parked?: boolean;
|
|
101
131
|
}
|
|
102
132
|
/** What an `assistant.say` says of an agent session on the person's machine, or undefined for any other message. */
|
|
103
133
|
export declare function remoteNoticeOf(event: Event): RemoteNotice | undefined;
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* - What was said, whole and once: a long text is split into up to three messages at paragraph breaks, never cut, after what the
|
|
5
5
|
* receipt already shows of it (`shown`). It is an AI answer: the AI label and the thumbs under it, a citation for each source it
|
|
6
6
|
* cites as [n], and the replies to tap under the last of its messages when no card follows.
|
|
7
|
-
* - When the event's item holds a result that waits, a card with Accept and Stop; when
|
|
8
|
-
* that
|
|
7
|
+
* - When the event's item holds a result that waits, a card with Accept and Stop; when Claw delivered the result without an Accept,
|
|
8
|
+
* a card that says so (only for a say that puts no choice and offers no replies of its own; one that does keeps its choice card and
|
|
9
|
+
* replies), with the pull request it still watches and that a reply changes it (none for the system's own notice, whose
|
|
10
|
+
* words say all that); when it holds a write for the person, a card
|
|
11
|
+
* that lets it through or not (a seat dispatch that offers several places: a button for each, and Cancel); when it puts a command to the person, a card with Run and Cancel; when it puts a choice to the
|
|
9
12
|
* person, a card with the options and Send; when it is about one of the person's skills, the skill's card with Undo and Edit,
|
|
10
13
|
* or a draft's with Save and Discard (each recorded first, so its buttons mean something). A card holds the words only when they
|
|
11
14
|
* are short and not shown already; a skill's card always does.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Lang } from "../locales/lang.js";
|
|
2
|
+
type Fields = Readonly<Record<string, unknown>>;
|
|
3
|
+
/**
|
|
4
|
+
* What came of the press: `picked` is the label of the place a choice card's press picked ("" for a card of one place), said when
|
|
5
|
+
* Claw names no seat back.
|
|
6
|
+
*/
|
|
7
|
+
export declare function seatDispatchOutcome(status: string, out: Fields, lang: Lang, picked?: string): string;
|
|
8
|
+
export {};
|
|
@@ -20,6 +20,17 @@ export interface WorkCardModel {
|
|
|
20
20
|
/** "zh" or "en"; null to follow what was said, or the item's title. */
|
|
21
21
|
readonly lang: string | null;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* A result Claw delivered without an Accept (`WorkItem.delivered`), in place of the card that asked for one: the version, the pull
|
|
25
|
+
* request the item still watches, and that a reply changes it. No buttons: nothing waits for the person.
|
|
26
|
+
*/
|
|
27
|
+
export interface WorkDeliveredModel {
|
|
28
|
+
readonly item: WorkItem;
|
|
29
|
+
/** What the assistant said about it ("" when said apart). */
|
|
30
|
+
readonly text: string;
|
|
31
|
+
/** "zh" or "en"; null to follow what was said, or the item's title. */
|
|
32
|
+
readonly lang: string | null;
|
|
33
|
+
}
|
|
23
34
|
/** What replaces a work card after Accept or Stop went through (render.work_done_card). */
|
|
24
35
|
export interface WorkDoneModel {
|
|
25
36
|
/** "Accepted" (the version is said), or how it ended otherwise. */
|
|
@@ -68,6 +79,15 @@ export interface ConfirmWriteModel {
|
|
|
68
79
|
readonly allowLabel: string;
|
|
69
80
|
/** What is held (`github_merge`, `trigger_create`, ...): a merge's other button says "Don't merge". Absent: "Don't". */
|
|
70
81
|
readonly kind?: string;
|
|
82
|
+
/**
|
|
83
|
+
* A choice card (`seat_dispatch` with several places): a button for each, in this order, and Cancel instead of Allow and Deny.
|
|
84
|
+
* A button carries the card and the place's index; what Claw is told was picked is read from the card's record. Absent or empty:
|
|
85
|
+
* Allow and Deny.
|
|
86
|
+
*/
|
|
87
|
+
readonly options?: readonly {
|
|
88
|
+
readonly label: string;
|
|
89
|
+
readonly detail: string;
|
|
90
|
+
}[];
|
|
71
91
|
readonly lang: string;
|
|
72
92
|
}
|
|
73
93
|
/** A choice the assistant put to the person: its options as radio buttons (or check boxes) and Send. */
|
|
@@ -98,6 +118,7 @@ declare module "../ports/surface.js" {
|
|
|
98
118
|
board: BoardModel;
|
|
99
119
|
confirmWrite: ConfirmWriteModel;
|
|
100
120
|
workCard: WorkCardModel;
|
|
121
|
+
workDelivered: WorkDeliveredModel;
|
|
101
122
|
workDone: WorkDoneModel;
|
|
102
123
|
workNote: WorkNoteModel;
|
|
103
124
|
}
|
|
@@ -32,6 +32,16 @@ export interface WorkItem {
|
|
|
32
32
|
readonly pull: PullRef | null;
|
|
33
33
|
/** When Claw last changed it (ISO 8601; "" not said). */
|
|
34
34
|
readonly updatedAt: string;
|
|
35
|
+
/**
|
|
36
|
+
* A result Claw delivered without an Accept, while the item stands delivered (closed by it, or open only to watch a pull
|
|
37
|
+
* request); absent or null otherwise, and from a Claw that does not deliver.
|
|
38
|
+
*/
|
|
39
|
+
readonly delivered?: Delivered | null;
|
|
40
|
+
}
|
|
41
|
+
/** A result Claw delivered without an Accept: its version, and the pull requests (owner/repo#123) the item still watches. */
|
|
42
|
+
export interface Delivered {
|
|
43
|
+
readonly version: number;
|
|
44
|
+
readonly watching: readonly string[];
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* What Claw answered to a person's accept, stop or retry: `ok`, or a 409 that says why not (`error`) and carries the item
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import type { AskerView, PullRef, WorkItem } from "./model.js";
|
|
1
|
+
import type { AskerView, Delivered, PullRef, WorkItem } from "./model.js";
|
|
2
|
+
/** `{ delivered }` when there is one, else nothing: an item that is not delivered reads as it did before. */
|
|
3
|
+
export declare function delivery(d: Delivered | null): {
|
|
4
|
+
delivered?: Delivered;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A result Claw delivered without an Accept, while the item stands delivered: as an event's item says it (`delivered_version`,
|
|
8
|
+
* `watching_pr`), else as a board row's state and `params` show it (closed as accepted with `params.delivered`, or open with
|
|
9
|
+
* `params.watching_pr`). Null when it does not, and for anything malformed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deliveredOf(item: {
|
|
12
|
+
readonly board_state?: string | undefined;
|
|
13
|
+
readonly outcome?: string | undefined;
|
|
14
|
+
readonly params?: Readonly<Record<string, unknown>> | undefined;
|
|
15
|
+
readonly delivered_version?: unknown;
|
|
16
|
+
readonly watching_pr?: unknown;
|
|
17
|
+
}): Delivered | null;
|
|
2
18
|
/** The pull request of a review item (`params.pr`); null for anything else, or for one that is not a pull request. */
|
|
3
19
|
export declare function pullOf(params: Readonly<Record<string, unknown>> | undefined): PullRef | null;
|
|
4
20
|
/**
|
|
@@ -7,3 +7,9 @@ export interface AgentCommand {
|
|
|
7
7
|
}
|
|
8
8
|
/** The arguments of `/agent ARGS`; null when ARGS is empty or names no subcommand (the caller shows the usage). */
|
|
9
9
|
export declare function parseAgentCommand(arg: string): AgentCommand | null;
|
|
10
|
+
/**
|
|
11
|
+
* Whether `text` is a slip of `/agents` with nothing after it: a full-width slash, a capital, a full stop or a question mark
|
|
12
|
+
* after it, or one letter off (`/agnets`, `/agens`, `/agentss`). Such a message shows the list, as `/agents` does; it never
|
|
13
|
+
* starts or attaches anything, and it never goes on to the assistant as words. A known command (`/agent`, `/agents`) is not a slip.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAgentsSlip(text: string): boolean;
|
|
@@ -14,7 +14,8 @@ export declare const MENU_COMMANDS: Readonly<Record<string, string>>;
|
|
|
14
14
|
export declare const GROUP_MENU_COMMANDS: readonly ["help", "new", "stop", "whoami", "feedback"];
|
|
15
15
|
/**
|
|
16
16
|
* `text` as the command it is when it is exactly a word of the commands menu (case and spacing do not matter), `link CODE` with a
|
|
17
|
-
* code of the console's shape as `/link CODE`,
|
|
17
|
+
* code of the console's shape as `/link CODE`, a slip of `/agents` (`/agnets`, `/agents`) as `/agents` in a 1:1 chat, and
|
|
18
|
+
* `text` itself otherwise. `group`: a group chat reads only its own menu's words.
|
|
18
19
|
*/
|
|
19
20
|
export declare function menuCommand(text: string, group?: boolean): string;
|
|
20
21
|
/** The code of a `/link CODE` message, else null. */
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* choice, nothing is sent, and Claw reads the language from the message as before. To the assistant the choice goes in the
|
|
7
7
|
* message's `channel_context` (`reply_language`); to a plain session (a 1:1 chat without the assistant) as the line Claw's
|
|
8
8
|
* assistant uses for it, after the message (`replyLanguageLine`). A group's turn carries the group's language in that line
|
|
9
|
-
* instead (`groupChosenLang`), or with none set the language the asker writes in: in a group a person's own
|
|
9
|
+
* instead (`groupChosenLang`), or with none set the language the asker writes in, else English: in a group a person's own
|
|
10
|
+
* choice is not read.
|
|
10
11
|
*/
|
|
11
12
|
import type { Lang } from "../locales/lang.js";
|
|
12
13
|
/** What of a person's preferences says the choice (`Prefs.lang`, `Prefs.langSet`). */
|
|
@@ -4,6 +4,15 @@ export declare const assistantCardText: import("./catalog.js").Catalog<{
|
|
|
4
4
|
}) => string;
|
|
5
5
|
waiting: string;
|
|
6
6
|
replyForChanges: string;
|
|
7
|
+
/** A result Claw delivered without an Accept: its version, and the pull request the item still watches. */
|
|
8
|
+
delivered: (p: {
|
|
9
|
+
version: number;
|
|
10
|
+
}) => string;
|
|
11
|
+
deliveredWatching: (p: {
|
|
12
|
+
version: number;
|
|
13
|
+
pulls: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
replyToChange: string;
|
|
7
16
|
accept: (p: {
|
|
8
17
|
version: number;
|
|
9
18
|
}) => string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const seatOutcomeText: import("./catalog.js").Catalog<{
|
|
2
|
+
kept: (p: {
|
|
3
|
+
what: string;
|
|
4
|
+
}) => string;
|
|
5
|
+
alreadyAnswered: string;
|
|
6
|
+
retired: string;
|
|
7
|
+
denied: string;
|
|
8
|
+
expired: string;
|
|
9
|
+
stale: string;
|
|
10
|
+
gone: string;
|
|
11
|
+
failed: (p: {
|
|
12
|
+
why: string;
|
|
13
|
+
}) => string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* A task the assistant hands to a seat (`seat_dispatch`): its card (one place, or a choice of several places) and what came of a
|
|
17
|
+
* press on it, in one line.
|
|
18
|
+
*/
|
|
19
|
+
export declare const seatDispatchText: import("./catalog.js").Catalog<{
|
|
20
|
+
choiceTitle: string;
|
|
21
|
+
cancel: string;
|
|
22
|
+
sent: (p: {
|
|
23
|
+
who: string;
|
|
24
|
+
seq: string;
|
|
25
|
+
}) => string;
|
|
26
|
+
queued: (p: {
|
|
27
|
+
who: string;
|
|
28
|
+
why: string;
|
|
29
|
+
seq: string;
|
|
30
|
+
position: string;
|
|
31
|
+
ahead: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
busy: string;
|
|
34
|
+
inTerminal: string;
|
|
35
|
+
offline: string;
|
|
36
|
+
theSeat: string;
|
|
37
|
+
notSent: string;
|
|
38
|
+
alreadyAnswered: string;
|
|
39
|
+
expired: string;
|
|
40
|
+
notOnCard: string;
|
|
41
|
+
failed: (p: {
|
|
42
|
+
why: string;
|
|
43
|
+
}) => string;
|
|
44
|
+
}>;
|
|
45
|
+
/** Why Claw did not send a task to a seat (`result.error` of a `seat_dispatch` decision), as the person reads it. */
|
|
46
|
+
export declare const SEAT_DISPATCH_FAILED: Readonly<Record<string, Readonly<Record<"en" | "zh", string>>>>;
|
|
@@ -76,6 +76,11 @@ export declare const workClickText: import("./catalog.js").Catalog<{
|
|
|
76
76
|
label: string;
|
|
77
77
|
outcome: string;
|
|
78
78
|
}) => string;
|
|
79
|
+
/** An Accept pressed on a card drawn before Claw delivered the result by itself. */
|
|
80
|
+
alreadyDelivered: (p: {
|
|
81
|
+
label: string;
|
|
82
|
+
version: number;
|
|
83
|
+
}) => string;
|
|
79
84
|
waitingVersion: (p: {
|
|
80
85
|
label: string;
|
|
81
86
|
version: number;
|
|
@@ -10,6 +10,7 @@ export * from "./assistant-board.js";
|
|
|
10
10
|
export * from "./assistant-cards.js";
|
|
11
11
|
export * from "./assistant-chat.js";
|
|
12
12
|
export * from "./assistant-devenv-hide.js";
|
|
13
|
+
export * from "./assistant-seats.js";
|
|
13
14
|
export * from "./assistant-work-clicks.js";
|
|
14
15
|
export * from "./assistant.js";
|
|
15
16
|
export * from "./skills.js";
|
|
@@ -44,7 +44,19 @@ export declare const remoteAgentText: import("./catalog.js").Catalog<{
|
|
|
44
44
|
keyRejected: string;
|
|
45
45
|
whichSession: string;
|
|
46
46
|
whichSessionOrAgent: string;
|
|
47
|
-
|
|
47
|
+
backToBot: (p: {
|
|
48
|
+
bot: string;
|
|
49
|
+
}) => string;
|
|
50
|
+
/** A new session that never started: the chat was never said to be in it, so its messages never left the bot. */
|
|
51
|
+
stillToBot: (p: {
|
|
52
|
+
bot: string;
|
|
53
|
+
}) => string;
|
|
54
|
+
/** A New session tap or `/agent new`, said at once: what starts where; where messages go is said once the agent has started. */
|
|
55
|
+
starting: (p: {
|
|
56
|
+
label: string;
|
|
57
|
+
host: string;
|
|
58
|
+
folder: string;
|
|
59
|
+
}) => string;
|
|
48
60
|
tapInactive: string;
|
|
49
61
|
tapInvalid: string;
|
|
50
62
|
cardExpired: string;
|
|
@@ -105,11 +117,14 @@ export declare const remoteAgentText: import("./catalog.js").Catalog<{
|
|
|
105
117
|
/** A session that ended while the chat was idle, when its end cannot be described (said in English, as the worker did). */
|
|
106
118
|
endedWhileIdle: (p: {
|
|
107
119
|
reason: string;
|
|
120
|
+
bot: string;
|
|
108
121
|
}) => string;
|
|
109
122
|
noMachineYet: string;
|
|
110
123
|
changedElsewhere: string;
|
|
111
124
|
listBelow: string;
|
|
112
|
-
endedFollowTail:
|
|
125
|
+
endedFollowTail: (p: {
|
|
126
|
+
bot: string;
|
|
127
|
+
}) => string;
|
|
113
128
|
endedTail: string;
|
|
114
129
|
approvalInPersonal: (p: {
|
|
115
130
|
who: string;
|
|
@@ -193,7 +208,9 @@ export declare const remoteAgentText: import("./catalog.js").Catalog<{
|
|
|
193
208
|
closedIn: (p: {
|
|
194
209
|
folder: string;
|
|
195
210
|
}) => string;
|
|
196
|
-
closedBack:
|
|
211
|
+
closedBack: (p: {
|
|
212
|
+
bot: string;
|
|
213
|
+
}) => string;
|
|
197
214
|
newUsage: string;
|
|
198
215
|
modeIs: (p: {
|
|
199
216
|
mode: string;
|
|
@@ -6,6 +6,8 @@ type Pair = readonly [zh: string, en: string];
|
|
|
6
6
|
export declare const remoteLeads: {
|
|
7
7
|
readonly sessionEnded: readonly ["会话已结束", "The session ended"];
|
|
8
8
|
readonly couldNotStart: readonly ["会话没能启动", "The session could not start"];
|
|
9
|
+
/** (`folder`: already shown inert, in backticks) */
|
|
10
|
+
readonly couldNotStartIn: (folder: string) => Pair;
|
|
9
11
|
readonly turnIncomplete: readonly ["这一轮没有完成", "The turn did not complete"];
|
|
10
12
|
/** (a message the terminal may have taken: never said as a turn that did not complete) */
|
|
11
13
|
readonly inputUnconfirmed: readonly ["还没确认终端收到", "Not confirmed by the terminal yet"];
|
|
@@ -31,6 +31,13 @@ export declare const remoteText: import("./catalog.js").Catalog<{
|
|
|
31
31
|
until: string;
|
|
32
32
|
zone: string;
|
|
33
33
|
}) => string;
|
|
34
|
+
seatNeedsApproval: (p: {
|
|
35
|
+
seat: string;
|
|
36
|
+
}) => string;
|
|
37
|
+
stillWaiting: (p: {
|
|
38
|
+
until: string;
|
|
39
|
+
zone: string;
|
|
40
|
+
}) => string;
|
|
34
41
|
alwaysChanges: string;
|
|
35
42
|
needsApproval: string;
|
|
36
43
|
waitsForYou: (p: {
|
|
@@ -212,7 +219,9 @@ export declare const remoteText: import("./catalog.js").Catalog<{
|
|
|
212
219
|
shareNoteTyped: string;
|
|
213
220
|
shareNoteNoTmux: string;
|
|
214
221
|
shareNoteOld: string;
|
|
215
|
-
terminalClosed:
|
|
222
|
+
terminalClosed: (p: {
|
|
223
|
+
bot: string;
|
|
224
|
+
}) => string;
|
|
216
225
|
switched: (p: {
|
|
217
226
|
where: string;
|
|
218
227
|
}) => string;
|
|
@@ -23,6 +23,8 @@ export declare const turnText: import("./catalog.js").Catalog<{
|
|
|
23
23
|
stillWorking: string;
|
|
24
24
|
/** A turn whose stream is closed because a card now waits for the person's choice. */
|
|
25
25
|
awaitingChoice: string;
|
|
26
|
+
/** A turn whose stream is closed because the chat went on below it: the whole answer comes below. */
|
|
27
|
+
answerBelow: string;
|
|
26
28
|
interrupted: string;
|
|
27
29
|
/** What a turn the person stopped ends with. */
|
|
28
30
|
stopped: string;
|
|
@@ -42,8 +42,11 @@ export interface ClawAssistantPort {
|
|
|
42
42
|
send(key: ClawCredential, sessionId: string, text: string, options?: AssistantMessageOptions): Promise<string | null>;
|
|
43
43
|
/** The caller's brief, put together now: `{date, lang, sections, needs_you, text}`. */
|
|
44
44
|
brief(key: ClawCredential, lang: string, timezone: string): Promise<JsonObject>;
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The person's answer to a held write the assistant put to them (`allow` or `deny`); exchanged token only. `choice`: on a choice
|
|
47
|
+
* card's `allow`, the id of the place picked (sent only when given).
|
|
48
|
+
*/
|
|
49
|
+
decideConfirmation(token: ClawCredential, confirmationId: string, decision: string, choice?: string): Promise<JsonObject>;
|
|
47
50
|
/** Reviews as `actingAs`, each a work item. ReviewsRefused: none started. ClawError(404): a Claw without the route. */
|
|
48
51
|
startReviews(token: ClawCredential, request: StartReviews): Promise<ReviewStart[]>;
|
|
49
52
|
/** Makes the key owner's watcher of `scope` observe it. */
|
|
@@ -49,13 +49,24 @@ export interface ConfirmCard {
|
|
|
49
49
|
readonly cardId: string;
|
|
50
50
|
readonly userId: string;
|
|
51
51
|
readonly confirmationId: string;
|
|
52
|
-
/** trigger_create | trigger_cancel | devenv_send | github_comment */
|
|
52
|
+
/** trigger_create | trigger_cancel | devenv_send | github_comment | seat_dispatch | ... */
|
|
53
53
|
readonly kind: string;
|
|
54
54
|
/** What the button that lets it through says. */
|
|
55
55
|
readonly label: string;
|
|
56
|
+
/**
|
|
57
|
+
* A choice card's places (`seat_dispatch`), in the card's order: a button carries only the card and the place's index here, and
|
|
58
|
+
* what Claw is told was picked is read from this record. Empty for a card that is let through or not.
|
|
59
|
+
*/
|
|
60
|
+
readonly options: readonly ConfirmCardOption[];
|
|
56
61
|
readonly state: CardState;
|
|
57
62
|
readonly createdAt: number;
|
|
58
63
|
}
|
|
64
|
+
/** One place a choice card offers: what Claw is told was picked, and what the card showed for it. */
|
|
65
|
+
export interface ConfirmCardOption {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly label: string;
|
|
68
|
+
readonly detail: string;
|
|
69
|
+
}
|
|
59
70
|
/** A choice the assistant put to the person: what was asked, the options, and (once sent) what was picked. */
|
|
60
71
|
export interface ChoiceCard {
|
|
61
72
|
readonly cardId: string;
|
|
@@ -105,7 +116,7 @@ export interface AssistantButtonRepository {
|
|
|
105
116
|
/** Null once it is older than ASSISTANT_MESSAGE_KEEP_SECONDS. */
|
|
106
117
|
getActionCard(cardId: string): ActionCard | null;
|
|
107
118
|
moveActionCard(cardId: string, state: CardState, options?: MoveOptions): boolean;
|
|
108
|
-
addConfirmCard(userId: string, confirmationId: string, kind: string, label?: string): string;
|
|
119
|
+
addConfirmCard(userId: string, confirmationId: string, kind: string, label?: string, options?: readonly ConfirmCardOption[]): string;
|
|
109
120
|
/** Null once it is older than CONFIRM_CARD_KEEP_SECONDS. */
|
|
110
121
|
getConfirmCard(cardId: string): ConfirmCard | null;
|
|
111
122
|
moveConfirmCard(cardId: string, state: CardState, options?: MoveOptions): boolean;
|
|
@@ -117,6 +117,11 @@ export interface NewRemotePermission {
|
|
|
117
117
|
export interface RemotePermissionRepository {
|
|
118
118
|
/** Recorded before it is shown; false when this request already has a row. */
|
|
119
119
|
saveRemotePermission(permission: NewRemotePermission): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* A request the agent keeps waiting on past its first wait (parked): pending again until `expiresAt`, unless it was answered or an
|
|
122
|
+
* answer is on its way. True when it waits now.
|
|
123
|
+
*/
|
|
124
|
+
keepRemotePermission(sessionId: string, actionId: string, expiresAt: number): boolean;
|
|
120
125
|
getRemotePermission(sessionId: string, actionId: string): RemotePermission | null;
|
|
121
126
|
/** Pending and not run out, oldest first. */
|
|
122
127
|
pendingRemotePermissions(userId: string, sessionId: string): RemotePermission[];
|
|
@@ -63,6 +63,11 @@ export declare class Deliveries {
|
|
|
63
63
|
* or it ran out while held), undefined when it offers nothing that can be answered (its words go as they are).
|
|
64
64
|
*/
|
|
65
65
|
private sendRemoteAsk;
|
|
66
|
+
/**
|
|
67
|
+
* The one reminder of a request the agent keeps waiting on (parked) whose card the person was shown already: it waits again until
|
|
68
|
+
* the longer wait ends, unless it was answered (or an answer is on its way). True when it does, and its card comes again.
|
|
69
|
+
*/
|
|
70
|
+
private keptParked;
|
|
66
71
|
/**
|
|
67
72
|
* A question a terminal asked no longer waits here (`resolved`): answered at the terminal, or given up. Its card is edited in
|
|
68
73
|
* place to say so, without its buttons, and a click on it is told the same. True when that is done (or there is nothing to
|
|
@@ -20,6 +20,10 @@ export interface RemoteAskRequest {
|
|
|
20
20
|
readonly agent: string;
|
|
21
21
|
/** Which work item asks ("#seq title"; "" none). */
|
|
22
22
|
readonly about: string;
|
|
23
|
+
/** The name the person gave the seat the task was handed to (absent: none); the card's title names it. */
|
|
24
|
+
readonly seat?: string;
|
|
25
|
+
/** The one reminder of a request the agent keeps waiting on (`ask.parked`): the card says it still waits, until when. */
|
|
26
|
+
readonly parked?: boolean;
|
|
23
27
|
readonly expiresAt: number;
|
|
24
28
|
readonly zone: string;
|
|
25
29
|
readonly lang: string;
|
|
@@ -23,5 +23,8 @@ export declare function muted(prefs: Prefs, now: number): Muted | undefined;
|
|
|
23
23
|
export declare function isoSeconds(raw: unknown): number | undefined;
|
|
24
24
|
/** When an approval event runs out: its `approval.expires_at`, else APPROVAL_DEFAULT_SECONDS from now. */
|
|
25
25
|
export declare function approvalExpiry(event: Readonly<Record<string, unknown>>, now: number): number;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* When a pushed permission request runs out: its `expires_at`, at most an hour on (a day for a parked one); else
|
|
28
|
+
* PERMISSION_DEFAULT_SECONDS from now.
|
|
29
|
+
*/
|
|
27
30
|
export declare function remoteAskExpiry(ask: Readonly<Record<string, unknown>>, now: number): number;
|
|
@@ -76,10 +76,34 @@ export interface AssistantConfirmWrite {
|
|
|
76
76
|
* started for the person's own account holds for them (`claw_github_confirmations`, `assistant/review-items.ts`); the same decision
|
|
77
77
|
* route answers it, and it is made exactly as `POST /v1/github-review/confirmations/{confirmation_id}/decision` makes it.
|
|
78
78
|
*/
|
|
79
|
-
kind: "trigger_create" | "trigger_cancel" | "github_comment" | "devenv_send" | "devenv_hide" | "skill_save" | "github_merge" | "github_review";
|
|
79
|
+
kind: "trigger_create" | "trigger_cancel" | "github_comment" | "devenv_send" | "devenv_hide" | "skill_save" | "seat_role" | "seat_set" | "seat_dispatch" | "github_merge" | "github_review";
|
|
80
80
|
/** What the button that lets it through says, in the language of the text. */
|
|
81
81
|
allow_label: string;
|
|
82
82
|
expires_at: string;
|
|
83
|
+
/**
|
|
84
|
+
* Only on `seat_dispatch` when the router named several places a task could go (2 to 5): a choice card. A channel draws one button per
|
|
85
|
+
* option and one that cancels (`deny`); the button carries only the card, and the channel reads which option it was from its own record
|
|
86
|
+
* of the card, then posts `{decision: "allow", choice: option.id}`. Claw checks the choice is one it offered. A channel that cannot draw
|
|
87
|
+
* buttons shows the text; the person names the place in the chat.
|
|
88
|
+
*/
|
|
89
|
+
options?: AssistantConfirmOption[];
|
|
90
|
+
}
|
|
91
|
+
/** One place a `seat_dispatch` choice card offers. */
|
|
92
|
+
export interface AssistantConfirmOption {
|
|
93
|
+
/** Opaque, at most 64 characters (a seat's id, or `sandbox`). */
|
|
94
|
+
id: string;
|
|
95
|
+
/** The name the person confirmed for the seat, else `<machine>/<agent>`: one plain line of at most 40 code points. */
|
|
96
|
+
label: string;
|
|
97
|
+
/** The folder, as the machine reported it: shown as text only. */
|
|
98
|
+
detail?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The body of `POST /v1/assistant/confirmations/{confirmation_id}/decision`. `choice` only on a card with `options`, and required there
|
|
102
|
+
* for `allow`: the `id` of the option picked.
|
|
103
|
+
*/
|
|
104
|
+
export interface AssistantConfirmationDecision {
|
|
105
|
+
decision: "allow" | "deny";
|
|
106
|
+
choice?: string;
|
|
83
107
|
}
|
|
84
108
|
/**
|
|
85
109
|
* A personal skill as a message shows it (`assistant/skill-writes.ts`): what was just saved, changed, turned off or deleted at the
|
|
@@ -147,9 +171,10 @@ export interface AssistantRemoteNotice {
|
|
|
147
171
|
/**
|
|
148
172
|
* `resolved` (only for a terminal's request, `ask.origin` "terminal"): a request this channel was sent as a card was answered, or stopped
|
|
149
173
|
* waiting, somewhere else (`resolved`), so a channel that still shows that card marks it so in place; the text says the same in one line
|
|
150
|
-
* for a channel that does not.
|
|
174
|
+
* for a channel that does not. `progress` (only for a task the assistant handed to a seat): the hourly line of a task that has run
|
|
175
|
+
* more than an hour, naming its latest step.
|
|
151
176
|
*/
|
|
152
|
-
kind: "done" | "needs_you" | "error" | "resolved";
|
|
177
|
+
kind: "done" | "needs_you" | "error" | "resolved" | "progress";
|
|
153
178
|
session_id: string;
|
|
154
179
|
machine: string;
|
|
155
180
|
agent: string;
|
|
@@ -159,11 +184,21 @@ export interface AssistantRemoteNotice {
|
|
|
159
184
|
*/
|
|
160
185
|
tool?: "claude" | "codex" | "cursor";
|
|
161
186
|
ask?: AssistantRemoteAsk;
|
|
162
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* With `kind: "resolved"`: which request, and who ended it (`terminal`, or `timeout`, `park_expired`, `session_end`, `connector_restart`
|
|
189
|
+
* when nobody did).
|
|
190
|
+
*/
|
|
163
191
|
resolved?: {
|
|
164
192
|
action_id: string;
|
|
165
193
|
by: string;
|
|
166
194
|
};
|
|
195
|
+
/** A task the assistant handed to a seat: its item number (`#N`). Absent for a session's own message. */
|
|
196
|
+
item_seq?: number;
|
|
197
|
+
/** A task the assistant handed to a seat: which seat; `alias` is the name the person confirmed for it, null when none. */
|
|
198
|
+
seat?: {
|
|
199
|
+
seat_id: string;
|
|
200
|
+
alias: string | null;
|
|
201
|
+
};
|
|
167
202
|
}
|
|
168
203
|
/** A permission request a development environment's agent waits on (`permissionRequest`), as its connector posted it. */
|
|
169
204
|
export interface AssistantRemoteAsk {
|
|
@@ -203,6 +238,11 @@ export interface AssistantRemoteAsk {
|
|
|
203
238
|
* which withdraws the card (Codex).
|
|
204
239
|
*/
|
|
205
240
|
terminal_asks?: TerminalAsks;
|
|
241
|
+
/**
|
|
242
|
+
* The request outlived its first wait and the connector keeps waiting (a task the assistant handed to a seat): `expires_at` is then
|
|
243
|
+
* when that longer wait ends. The one reminder Claw sends for it carries this.
|
|
244
|
+
*/
|
|
245
|
+
parked?: true;
|
|
206
246
|
}
|
|
207
247
|
/** When a terminal asks a request that is also on a card, besides alongside it: see {@link AssistantRemoteAsk.terminal_asks}. */
|
|
208
248
|
export type TerminalAsks = "after_card" | "on_input";
|