@primusclaw/personal-agent 0.15.0 → 0.15.2

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.
@@ -87,6 +87,10 @@ export declare const connectorReasonHints: import("./catalog.js").Catalog<{
87
87
  status: string;
88
88
  newSession: string;
89
89
  retry: string;
90
+ /** A length of time in the sentences that name one (`{wait}`): the connector's own whole seconds. */
91
+ seconds: (p: {
92
+ n: number;
93
+ }) => string;
90
94
  unknown: (p: {
91
95
  code: string;
92
96
  }) => string;
@@ -45,6 +45,15 @@ export declare const terminalApprovalText: import("./catalog.js").Catalog<{
45
45
  approvalsTurnedOn: string;
46
46
  approvalsTurnedOff: string;
47
47
  approvalsUsage: string;
48
+ mutedNone: string;
49
+ mutedHeader: (p: {
50
+ count: string;
51
+ }) => string;
52
+ mutedLine: (p: {
53
+ who: string;
54
+ since: string;
55
+ }) => string;
56
+ mutedUnnamed: string;
48
57
  muted: (p: {
49
58
  item: string;
50
59
  where: string;
@@ -1,5 +1,5 @@
1
1
  import type { JsonObject } from "../../json.js";
2
- import type { RemoteHidden } from "../../protocol.js";
2
+ import type { RemoteHidden, RemoteMutedConversation } from "../../protocol.js";
3
3
  import type { ClawCredential } from "../../claw/credential.js";
4
4
  import type { SseEvent } from "../../claw/model.js";
5
5
  import type { RemoteConnector, RemoteEventRow, RemotePairing, RemoteSession, RemoteSetup } from "../../claw/remote.js";
@@ -55,6 +55,11 @@ export interface ClawRemoteAgentsPort {
55
55
  * is pushed while muted (`PUT /approvals/mutes`). Answers what Claw stored, and the machine and conversation it names.
56
56
  */
57
57
  muteTerminal(key: ClawCredential, item: number, muted: boolean): Promise<TerminalMute>;
58
+ /**
59
+ * The conversations the caller muted, newest first (`GET /approvals/mutes`): each with its machine, its name now, since when and the
60
+ * `#<item>` that unmutes it (null when no item of it is left).
61
+ */
62
+ mutedTerminals(key: ClawCredential): Promise<RemoteMutedConversation[]>;
58
63
  /**
59
64
  * How often (minutes; 0 never) a conversation of the caller's that keeps working in a terminal on its own is summed up
60
65
  * (`GET /approvals`, `summary_minutes`; an hour unless they set otherwise).
@@ -327,6 +327,23 @@ export declare function parseTerminalMute(body: unknown): Parsed<{
327
327
  item: number;
328
328
  muted: boolean;
329
329
  }>;
330
+ /**
331
+ * One conversation open in a terminal whose pushes its owner muted, as `GET /v1/remote-agents/approvals/mutes` lists them (newest
332
+ * mute first; `/approvals` says them).
333
+ */
334
+ export interface RemoteMutedConversation {
335
+ /**
336
+ * The owner's latest work item of the conversation: the `#<item>` `/approvals unmute` and `PUT /v1/remote-agents/approvals/mutes`
337
+ * name it by. Null when no item of it is left to name it by.
338
+ */
339
+ item: number | null;
340
+ /** Its machine's name; null when that machine is gone. */
341
+ machine: string | null;
342
+ /** The conversation's name now, as its machine lists it, else the title its item had when it was muted; null: it has none. */
343
+ title: string | null;
344
+ /** When it was muted (ISO 8601). */
345
+ muted_since: string;
346
+ }
330
347
  /**
331
348
  * Hiding conversations of a machine from its owner's lists (`POST /v1/remote-agents/connectors/:cid/hidden`), and the
332
349
  * listing that leaves them out (`GET /v1/remote-agents/connectors`, `?hidden=include` to list them too). Nothing on the
@@ -3,8 +3,10 @@ import type { CommandHandler, CommandRoute } from "../ports/routing.js";
3
3
  export declare class TerminalApprovalsCommand implements CommandHandler {
4
4
  private readonly claw;
5
5
  readonly name = "approvals";
6
- constructor(claw: Pick<ClawRemoteAgentsPort, "approvals" | "setApprovals" | "muteTerminal" | "summary" | "setSummary">);
6
+ constructor(claw: Pick<ClawRemoteAgentsPort, "approvals" | "setApprovals" | "muteTerminal" | "mutedTerminals" | "summary" | "setSummary">);
7
7
  run(route: CommandRoute, args: string): Promise<boolean>;
8
+ /** The whole state, as one message: the switch, how often a conversation that works on its own is summed up, the muted ones. */
9
+ private state;
8
10
  private summary;
9
11
  /** What to say when Claw refused or could not be reached; anything else is not this command's to answer. */
10
12
  private refusal;
@@ -4,6 +4,11 @@ import { Setup } from "./setup.js";
4
4
  export type Pair = readonly [zh: string, en: string];
5
5
  /** The release whose Claude agent runs as root with `approval = "never"`; an older connector there refuses every new session. */
6
6
  export declare const FIXED_IN: readonly [number, number, number];
7
+ /**
8
+ * `reason` with the connector's figure (`wait_s`, whole seconds) after it when it is a code that says one and the figure is good;
9
+ * `reason` as it is otherwise.
10
+ */
11
+ export declare function reasonWithWait(reason: string, wait: unknown): string;
7
12
  /** The one upgrade command: it installs the new version and restarts the connector on it, under whichever supervisor it has. */
8
13
  export declare const UPGRADE: Pair;
9
14
  export declare const SANDBOX: Pair;
@@ -25,7 +30,7 @@ export declare function isCode(reason: string): boolean;
25
30
  * [Chinese, English] for one reason code: what happened and what to do. An unknown code gets a generic pair that names it.
26
31
  * `setup`: the commands of the address this worker reaches Claw at (the login a revoked connector is given).
27
32
  */
28
- export declare function explain(code: string, version?: unknown, setup?: Setup): Pair;
33
+ export declare function explain(reason: string, version?: unknown, setup?: Setup): Pair;
29
34
  /** A reason as given: trimmed, without the full stops at its end. */
30
35
  export declare function bareReason(reason: string | null | undefined): string;
31
36
  /**
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * How the asker of a review someone else runs hears of it: only its asker view (state, link, conclusion, merged, what a
3
- * waiting one waits for, what it found), as one line for one review, or one message for a request's several. And what the
4
- * reviewer hears when the reviews asked of them end. `viewStage` is the key that changes exactly when there is news.
3
+ * waiting one waits for, what it found), as one line for one review, or one message for a request's several. `viewStage` is
4
+ * the key that changes exactly when the view changes, and `isNewsStage` says which of those changes the asker is told at once.
5
+ * What the reviewer hears of the reviews asked of them is not here: Claw sums it up (`review-digest.ts`, the reviewer's one
6
+ * message every `/approvals summary` minutes), and what waits for them has its own notice (`Notices.tellReviewerWaiting`).
5
7
  */
6
8
  import type { AskerView, PullRef } from "../claw/model.js";
7
9
  import { type ReviewTurn } from "./review-turn.js";
@@ -29,14 +31,19 @@ export declare function requesterResultText(review: ReviewTurn, view: AskerView)
29
31
  export declare function itemEndText(view: AskerView): string;
30
32
  /** How a review of one's own ended, as its card shows it: from what its turn left on GitHub. */
31
33
  export declare function ownItemEndText(review: ReviewTurn): string;
32
- /** What the reviewer hears when a review asked of them ends. */
33
- export declare function reviewerResultText(review: ReviewTurn, view: AskerView): string;
34
34
  /** What the asker has been told of a review, as a key that changes exactly when there is news ('' nothing yet). */
35
35
  export declare function viewStage(view: AskerView): string;
36
36
  /** `viewStage` for one followed review, with one more piece of news: a review that waited for a slot has 'started'. */
37
37
  export declare function entryStage(entry: Followed, view: AskerView): string;
38
38
  /** The conclusion a `viewStage` key holds ('' none). */
39
39
  export declare function stageVerdict(stage: string): string;
40
+ /**
41
+ * Whether a change of the view is news to the asker, told at once: an end, a failure, a wait for the reviewer, and a conclusion that
42
+ * needs the author's hands (changes requested, a comment). Not news: that the review waits for a slot, that it started, and an approval
43
+ * that is not merged yet, which the end's line carries within minutes; a review may wait a day for CI, and the conclusions that ask
44
+ * something of the author are told as they come.
45
+ */
46
+ export declare function isNewsStage(stage: string): boolean;
40
47
  /** How a review someone else runs stands, as its asker is told. `started`: it waited for a slot, and has just started. */
41
48
  export declare function progressWords(review: ReviewTurn, view: AskerView, started?: boolean): string;
42
49
  /**
@@ -46,5 +53,3 @@ export declare function progressWords(review: ReviewTurn, view: AskerView, start
46
53
  export declare function progressText(entries: readonly Followed[], told: readonly (readonly [Followed, AskerView])[]): string;
47
54
  /** The asker's last line when the reviews they follow are still open at the deadline. */
48
55
  export declare function unfinishedText(left: readonly Followed[]): string;
49
- /** What the reviewer hears when reviews asked of them end. */
50
- export declare function reviewerEndedText(ended: readonly (readonly [Followed, AskerView])[]): string;
@@ -46,6 +46,12 @@ export declare class AskerFollow {
46
46
  private endStopped;
47
47
  /** What one view is: news to hold, back to what was said, a start, or an end. */
48
48
  private note;
49
+ /**
50
+ * What the view's stage is to the asker: news to hold for the next message, a change they are not told (an approval not merged yet, that
51
+ * the review started) or back to what was said. A change not told is kept as what was seen, so that a later message counts the review
52
+ * right, and it lets go of news held from before it. Returns the stage.
53
+ */
54
+ private holdNews;
49
55
  /** Says the held news in one message; what is said is recorded first, and put back when the message did not go. */
50
56
  private flush;
51
57
  /** A line for the asker where they asked: in a group it @mentions them (and only them). */
@@ -23,9 +23,6 @@ export declare class Notices {
23
23
  personalChatOf(person: Actor, via: ConversationRef): Promise<Conversation | undefined>;
24
24
  /** The reviewer's own 1:1 chat. */
25
25
  reviewerChat(review: ReviewTurn): Promise<Conversation | undefined>;
26
- tellReviewer(review: ReviewTurn, text: string): Promise<void>;
27
- /** The reviewer hears, in their own chat, that someone asked a review of them and that it is an item on their board. */
28
- tellReviewerStarted(review: ReviewTurn): Promise<void>;
29
26
  /** The reviewer's item as Claw shows it to them, read with their own key; undefined when it cannot be. */
30
27
  private reviewersItem;
31
28
  /** The reviewer's item waits for them: what it asks and how to answer, with the item's card when it can be read as them. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "The personal agent's channel-neutral core: domain logic, ports and plugin interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {