@primusclaw/personal-agent 0.1.1 → 0.3.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.
Files changed (53) hide show
  1. package/dist/index.js +7985 -6816
  2. package/dist/types/assistant/chat.d.ts +2 -2
  3. package/dist/types/assistant/events.d.ts +6 -1
  4. package/dist/types/capabilities/capability.d.ts +6 -0
  5. package/dist/types/capabilities/natural.d.ts +1 -1
  6. package/dist/types/capabilities/phrases.d.ts +5 -0
  7. package/dist/types/commands/names.d.ts +1 -1
  8. package/dist/types/config/settings.d.ts +6 -0
  9. package/dist/types/feedback/reporting.d.ts +10 -0
  10. package/dist/types/group-context/buffer.d.ts +66 -0
  11. package/dist/types/group-context/command.d.ts +11 -0
  12. package/dist/types/group-context/index.d.ts +3 -0
  13. package/dist/types/index.d.ts +2 -0
  14. package/dist/types/locales/assistant-chat.d.ts +4 -4
  15. package/dist/types/locales/connector-reasons.d.ts +1 -0
  16. package/dist/types/locales/group-context.d.ts +44 -0
  17. package/dist/types/locales/link.d.ts +1 -0
  18. package/dist/types/locales/remote-agents.d.ts +12 -1
  19. package/dist/types/locales/routing.d.ts +9 -2
  20. package/dist/types/locales/terminal-approvals.d.ts +44 -0
  21. package/dist/types/ports/claw/remote-agents.d.ts +4 -0
  22. package/dist/types/ports/store/group-context.d.ts +10 -0
  23. package/dist/types/ports/store/index.d.ts +3 -0
  24. package/dist/types/ports/store/link.d.ts +19 -0
  25. package/dist/types/ports/store/remote.d.ts +12 -1
  26. package/dist/types/proactive/deliver.d.ts +18 -1
  27. package/dist/types/proactive/deps.d.ts +6 -0
  28. package/dist/types/protocol/claw-api/assistant-events.d.ts +35 -1
  29. package/dist/types/protocol/remote-agents.d.ts +34 -0
  30. package/dist/types/remote/approvals-command.d.ts +8 -0
  31. package/dist/types/remote/chats.d.ts +40 -0
  32. package/dist/types/remote/events.d.ts +4 -1
  33. package/dist/types/remote/follow/control.d.ts +10 -0
  34. package/dist/types/remote/prompt.d.ts +14 -2
  35. package/dist/types/remote/state.d.ts +4 -1
  36. package/dist/types/remote/terminal-asks.d.ts +9 -0
  37. package/dist/types/remote/turn-state.d.ts +16 -1
  38. package/dist/types/remote/turns/chat-turn.d.ts +12 -1
  39. package/dist/types/remote/turns/display.d.ts +2 -0
  40. package/dist/types/remote/turns/runner.d.ts +15 -0
  41. package/dist/types/remote/turns/window-turn.d.ts +5 -1
  42. package/dist/types/remote-view/index.d.ts +3 -0
  43. package/dist/types/remote-view/terminal-ask-view.d.ts +68 -0
  44. package/dist/types/routing/commands-session.d.ts +3 -1
  45. package/dist/types/routing/credentials.d.ts +9 -0
  46. package/dist/types/routing/deps.d.ts +3 -1
  47. package/dist/types/routing/features.d.ts +14 -3
  48. package/dist/types/routing/group-router.d.ts +2 -0
  49. package/dist/types/routing/personal-router.d.ts +13 -0
  50. package/dist/types/routing/turn-registry.d.ts +23 -6
  51. package/dist/types/routing/turn-start.d.ts +13 -5
  52. package/dist/types/subscriptions/subscriptions.d.ts +6 -2
  53. package/package.json +1 -1
@@ -3,8 +3,6 @@ import type { InboundFile } from "../ports/surface.js";
3
3
  import type { Chat } from "./chat.js";
4
4
  import type { RouterContext } from "./context.js";
5
5
  import type { ReviewRunFields, TurnOutcome } from "./turn-runner.js";
6
- /** What a waiting message gives the turn in front to start running in Claw (`_queue_behind`). */
7
- export declare const SUBMIT_WAIT_SECONDS = 15;
8
6
  /** Teams on a phone or a tablet: its own Stop under a reply is greyed out, and its own thumbs never reach the worker. */
9
7
  export declare function isMobile(clientPlatform: string): boolean;
10
8
  /** A review the review service starts as a turn here (its item runs in Claw already; the turn only follows it). */
@@ -47,7 +45,8 @@ export interface StartTurn {
47
45
  /**
48
46
  * Starting and following a turn (the Python `Agent._start_turn`, `_queue_behind`, `_guarded`, `_record_session`,
49
47
  * `_record_turn`): a new task is admitted under the person's task limit; a message sent while the chat's turn runs is
50
- * queued in Claw behind it (one at most); a review has a session of its own and is neither queued nor queued behind.
48
+ * queued behind it (up to `QUEUED_TURNS_MAX`, in order, each told its place) and goes to Claw once every turn in front of it
49
+ * is over, so `/stop` can still give it up; a review has a session of its own and is neither queued nor queued behind.
51
50
  */
52
51
  export declare class TurnStarter {
53
52
  private readonly ctx;
@@ -57,11 +56,20 @@ export declare class TurnStarter {
57
56
  settled(): Promise<void>;
58
57
  /** The turn that runs (its end is `done`), or undefined when none was started (the person was told why). */
59
58
  start(request: StartTurn): Promise<RunningTurn | undefined>;
59
+ private track;
60
+ /** The turn goes to Claw now; its end is `done`. */
61
+ private launch;
62
+ /**
63
+ * A queued turn: it goes once every turn in front of it is over, or stopped (Claw took its interrupt: Claw is free for the next
64
+ * message, whether or not that turn ever reports its end); the caller does not wait for it. Not at all when it was given up
65
+ * meanwhile (`/stop`, said there).
66
+ */
67
+ private afterFront;
60
68
  /** True when admitted as the chat's first turn; false when the chat has one (queue behind it); undefined: refused. */
61
69
  private admit;
62
70
  /**
63
- * Registers `turn` behind the chat's running one; false (the person is told why) when it may not go. It is sent only
64
- * once Claw runs the turn in front: then Claw names that turn as the one it waits behind.
71
+ * Registers `turn` behind the chat's running one: "front" when the chat has none after all (it runs now), "waiting" when it
72
+ * is queued (the person is told its place), "refused" (and told why) when it may not wait.
65
73
  */
66
74
  private queueBehind;
67
75
  private sessionOf;
@@ -51,8 +51,12 @@ export declare class Subscriptions {
51
51
  * mended first and the user id filled in, so what is said is the state after trying. Never throws.
52
52
  */
53
53
  reachable(aadId: string): Promise<Unreachable>;
54
- /** Make sure this linked person has a subscription (with the assistant's types when it is on). Never throws. */
55
- ensure(aadId: string): Promise<void>;
54
+ /**
55
+ * Make sure this person has a subscription (with the assistant's types when it is on). It is made and mended with
56
+ * `credential` when one is given (a person with no link, whose chats run on an exchanged token), else with their linked
57
+ * key. Never throws.
58
+ */
59
+ ensure(aadId: string, credential?: string): Promise<void>;
56
60
  private create;
57
61
  /**
58
62
  * With the assistant on, the recorded subscription must be there in Claw, enabled and asking for the assistant's events: looked
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "The personal agent's channel-neutral core: domain logic, ports and plugin interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {