@primusclaw/personal-agent-runtime 0.14.0 → 0.15.1

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 CHANGED
@@ -536,6 +536,13 @@ function enabledOf(answer2) {
536
536
  if (typeof enabled !== "boolean") throw new ClawAnswerInvalid4("the approvals setting has no enabled");
537
537
  return enabled;
538
538
  }
539
+ function summaryOf(answer2) {
540
+ const data = anyDataOf(answer2, "the summary setting");
541
+ const minutes = data !== null && typeof data === "object" ? data["summary_minutes"] : void 0;
542
+ if (typeof minutes !== "number" || !Number.isSafeInteger(minutes) || minutes < 0)
543
+ throw new ClawAnswerInvalid4("the summary setting has no summary_minutes");
544
+ return minutes;
545
+ }
539
546
  var HttpRemoteAgents = class {
540
547
  constructor(http, clientLabel) {
541
548
  this.http = http;
@@ -556,6 +563,12 @@ var HttpRemoteAgents = class {
556
563
  async setApprovals(key2, enabled) {
557
564
  return enabledOf(await this.#call("PUT", "/approvals", key2, { enabled }));
558
565
  }
566
+ async summary(key2) {
567
+ return summaryOf(await this.#call("GET", "/approvals", key2));
568
+ }
569
+ async setSummary(key2, minutes) {
570
+ return summaryOf(await this.#call("PUT", "/approvals/summary", key2, { minutes }));
571
+ }
559
572
  async muteTerminal(key2, item2, muted) {
560
573
  const data = anyDataOf(await this.#call("PUT", "/approvals/mutes", key2, { item: item2, muted }), "a terminal mute");
561
574
  const d = data !== null && typeof data === "object" ? data : {};
@@ -568,6 +581,18 @@ var HttpRemoteAgents = class {
568
581
  title: typeof d["title"] === "string" ? d["title"] : ""
569
582
  };
570
583
  }
584
+ async mutedTerminals(key2) {
585
+ return rowsOf(await this.#call("GET", "/approvals/mutes", key2), "the muted conversations").map((row) => {
586
+ if (typeof row["muted_since"] !== "string")
587
+ throw new ClawAnswerInvalid4("a muted conversation has no muted_since");
588
+ return {
589
+ item: typeof row["item"] === "number" ? row["item"] : null,
590
+ machine: typeof row["machine"] === "string" ? row["machine"] : null,
591
+ title: typeof row["title"] === "string" ? row["title"] : null,
592
+ muted_since: row["muted_since"]
593
+ };
594
+ });
595
+ }
571
596
  async pair(key2) {
572
597
  return read(
573
598
  remotePairingSchema,
@@ -1,4 +1,4 @@
1
- import { type ClawCredential, type ClawRemoteAgentsPort, type JsonObject, type NewRemoteSession, type RemoteConnector, type RemoteEventRow, type RemoteHidden, type RemotePairing, type RemoteSession, type RemoteSetup, type SseEvent, type TerminalMute } from "@primusclaw/personal-agent";
1
+ import { type ClawCredential, type ClawRemoteAgentsPort, type JsonObject, type NewRemoteSession, type RemoteConnector, type RemoteEventRow, type RemoteHidden, type RemoteMutedConversation, type RemotePairing, type RemoteSession, type RemoteSetup, type SseEvent, type TerminalMute } from "@primusclaw/personal-agent";
2
2
  import { type ClawHttp } from "./http.js";
3
3
  /** `ClawRemoteAgentsPort` over Claw's HTTP API; every call names this client (`X-Claw-Client`) in Claw's audit trail. */
4
4
  export declare class HttpRemoteAgents implements ClawRemoteAgentsPort {
@@ -12,7 +12,10 @@ export declare class HttpRemoteAgents implements ClawRemoteAgentsPort {
12
12
  }): Promise<RemoteConnector[]>;
13
13
  approvals(key: ClawCredential): Promise<boolean>;
14
14
  setApprovals(key: ClawCredential, enabled: boolean): Promise<boolean>;
15
+ summary(key: ClawCredential): Promise<number>;
16
+ setSummary(key: ClawCredential, minutes: number): Promise<number>;
15
17
  muteTerminal(key: ClawCredential, item: number, muted: boolean): Promise<TerminalMute>;
18
+ mutedTerminals(key: ClawCredential): Promise<RemoteMutedConversation[]>;
16
19
  pair(key: ClawCredential): Promise<RemotePairing>;
17
20
  hide(key: ClawCredential, connectorId: string, refs: readonly string[], hidden: boolean): Promise<RemoteHidden>;
18
21
  revoke(key: ClawCredential, connectorId: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent-runtime",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "Node adapters for the personal agent's ports (clock, randomness, logging, storage, Claw, metrics, HTTP), and, at @primusclaw/personal-agent-runtime/worker, the worker process on any chat surface.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@primusclaw/personal-agent": "0.14.0",
36
+ "@primusclaw/personal-agent": "0.15.1",
37
37
  "fastify": "^5.12.8",
38
38
  "zod": "^4.6.7"
39
39
  }