sideby 0.19.1 → 0.20.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 (159) hide show
  1. package/README.md +7 -4
  2. package/ai-tasks.json +28 -0
  3. package/dist/build.json +1 -1
  4. package/dist/src/cli/commands.d.ts +22 -1
  5. package/dist/src/cli/commands.js +815 -21
  6. package/dist/src/cli/format.d.ts +4 -0
  7. package/dist/src/cli/format.js +42 -4
  8. package/dist/src/cli/json-schemas.js +334 -4
  9. package/dist/src/cli/main.js +159 -13
  10. package/dist/src/core/accounts.d.ts +6 -0
  11. package/dist/src/core/accounts.js +12 -0
  12. package/dist/src/core/autostart.d.ts +11 -0
  13. package/dist/src/core/autostart.js +32 -5
  14. package/dist/src/core/browser-profiles.d.ts +23 -2
  15. package/dist/src/core/browser-profiles.js +148 -37
  16. package/dist/src/core/claude-settings-file.d.ts +18 -0
  17. package/dist/src/core/claude-settings-file.js +52 -3
  18. package/dist/src/core/config.d.ts +5 -0
  19. package/dist/src/core/config.js +12 -1
  20. package/dist/src/core/edit-settings.d.ts +7 -0
  21. package/dist/src/core/edit-settings.js +10 -5
  22. package/dist/src/core/history-group.d.ts +28 -0
  23. package/dist/src/core/history-group.js +47 -0
  24. package/dist/src/core/history-index.d.ts +145 -0
  25. package/dist/src/core/history-index.js +447 -0
  26. package/dist/src/core/history-project.d.ts +13 -0
  27. package/dist/src/core/history-project.js +87 -0
  28. package/dist/src/core/history.d.ts +210 -0
  29. package/dist/src/core/history.js +952 -0
  30. package/dist/src/core/inbound.d.ts +62 -0
  31. package/dist/src/core/inbound.js +215 -0
  32. package/dist/src/core/launch.d.ts +9 -1
  33. package/dist/src/core/launch.js +58 -24
  34. package/dist/src/core/live-sessions-copy.d.ts +5 -0
  35. package/dist/src/core/live-sessions-copy.js +46 -0
  36. package/dist/src/core/live-sessions-procs.d.ts +89 -0
  37. package/dist/src/core/live-sessions-procs.js +296 -0
  38. package/dist/src/core/live-sessions-title.d.ts +28 -0
  39. package/dist/src/core/live-sessions-title.js +80 -0
  40. package/dist/src/core/live-sessions.d.ts +68 -0
  41. package/dist/src/core/live-sessions.js +163 -0
  42. package/dist/src/core/login-check.d.ts +15 -0
  43. package/dist/src/core/login-check.js +32 -0
  44. package/dist/src/core/messages.d.ts +83 -0
  45. package/dist/src/core/messages.js +433 -0
  46. package/dist/src/core/project-categories.d.ts +14 -0
  47. package/dist/src/core/project-categories.js +48 -0
  48. package/dist/src/core/quota-fetch.d.ts +3 -3
  49. package/dist/src/core/quota-fetch.js +5 -5
  50. package/dist/src/core/quota-levels.d.ts +5 -0
  51. package/dist/src/core/quota-levels.js +5 -0
  52. package/dist/src/core/remote-control.d.ts +2 -0
  53. package/dist/src/core/remote-control.js +34 -59
  54. package/dist/src/core/run-link.d.ts +76 -0
  55. package/dist/src/core/run-link.js +245 -0
  56. package/dist/src/core/same-login.d.ts +4 -3
  57. package/dist/src/core/same-login.js +10 -7
  58. package/dist/src/core/session-select.d.ts +31 -0
  59. package/dist/src/core/session-select.js +44 -0
  60. package/dist/src/families/browser.d.ts +7 -18
  61. package/dist/src/families/browser.js +19 -8
  62. package/dist/src/families/claude/deliver.d.ts +2 -0
  63. package/dist/src/families/claude/deliver.js +43 -0
  64. package/dist/src/families/claude/history.d.ts +2 -0
  65. package/dist/src/families/claude/history.js +192 -0
  66. package/dist/src/families/claude/live-sessions.d.ts +13 -0
  67. package/dist/src/families/claude/live-sessions.js +117 -0
  68. package/dist/src/families/claude/messaging.d.ts +69 -0
  69. package/dist/src/families/claude/messaging.js +165 -0
  70. package/dist/src/families/claude/mod.d.ts +26 -0
  71. package/dist/src/families/claude/mod.js +105 -0
  72. package/dist/src/families/claude/session-files.d.ts +21 -0
  73. package/dist/src/families/claude/session-files.js +54 -0
  74. package/dist/src/families/codex/deliver.d.ts +5 -0
  75. package/dist/src/families/codex/deliver.js +76 -0
  76. package/dist/src/families/codex/history.d.ts +7 -0
  77. package/dist/src/families/codex/history.js +174 -0
  78. package/dist/src/families/codex/index.js +2 -0
  79. package/dist/src/families/codex/live-sessions.d.ts +12 -0
  80. package/dist/src/families/codex/live-sessions.js +193 -0
  81. package/dist/src/families/codex/quota.d.ts +3 -0
  82. package/dist/src/families/codex/quota.js +123 -0
  83. package/dist/src/families/codex/rate-limits.js +2 -0
  84. package/dist/src/families/codex/rollout.js +1 -1
  85. package/dist/src/families/grok/browser.d.ts +3 -0
  86. package/dist/src/families/grok/browser.js +5 -0
  87. package/dist/src/families/grok/history.d.ts +2 -0
  88. package/dist/src/families/grok/history.js +157 -0
  89. package/dist/src/families/grok/live-sessions.d.ts +4 -0
  90. package/dist/src/families/grok/live-sessions.js +80 -0
  91. package/dist/src/families/grok/login-key.d.ts +14 -0
  92. package/dist/src/families/grok/login-key.js +37 -0
  93. package/dist/src/families/history.d.ts +20 -0
  94. package/dist/src/families/history.js +81 -0
  95. package/dist/src/families/live-sessions.d.ts +26 -0
  96. package/dist/src/families/live-sessions.js +9 -0
  97. package/dist/src/families/login-keys.js +5 -1
  98. package/dist/src/families/messaging.d.ts +27 -0
  99. package/dist/src/families/messaging.js +6 -0
  100. package/dist/src/families/pi/history.d.ts +2 -0
  101. package/dist/src/families/pi/history.js +124 -0
  102. package/dist/src/families/pi/live-sessions.d.ts +2 -0
  103. package/dist/src/families/pi/live-sessions.js +70 -0
  104. package/dist/src/families/shared/history-text.d.ts +65 -0
  105. package/dist/src/families/shared/history-text.js +261 -0
  106. package/dist/src/menubar/hotkey.d.ts +86 -0
  107. package/dist/src/menubar/hotkey.js +159 -0
  108. package/dist/src/menubar/script.d.ts +2 -0
  109. package/dist/src/menubar/script.js +118 -22
  110. package/dist/src/menubar/snapshot.d.ts +8 -4
  111. package/dist/src/menubar/snapshot.js +45 -13
  112. package/dist/src/menubar/strings.d.ts +24 -6
  113. package/dist/src/menubar/strings.js +24 -6
  114. package/dist/src/panel/handler.d.ts +69 -0
  115. package/dist/src/panel/handler.js +686 -15
  116. package/dist/src/panel/i18n.d.ts +304 -3
  117. package/dist/src/panel/i18n.js +620 -18
  118. package/dist/src/panel/orca.d.ts +48 -0
  119. package/dist/src/panel/orca.js +153 -0
  120. package/dist/src/panel/page-logic.d.ts +255 -13
  121. package/dist/src/panel/page-logic.js +483 -1
  122. package/dist/src/panel/page-script.js +2260 -204
  123. package/dist/src/panel/page-styles.js +404 -32
  124. package/dist/src/panel/page.js +1 -0
  125. package/dist/src/plugins/check.js +16 -4
  126. package/dist/src/plugins/loader.d.ts +8 -1
  127. package/dist/src/plugins/loader.js +72 -7
  128. package/dist/src/runtime.d.ts +5 -0
  129. package/dist/src/runtime.js +27 -5
  130. package/dist/src/types.d.ts +116 -1
  131. package/dist/testing/index.d.ts +5 -0
  132. package/dist/testing/index.js +5 -0
  133. package/mods/claude/.claude-plugin/plugin.json +7 -0
  134. package/mods/claude/hooks/hooks.json +1 -0
  135. package/mods/claude/hooks/register.js +261 -0
  136. package/package.json +5 -2
  137. package/schemas/autostart.json +74 -1
  138. package/schemas/browser-set.json +110 -0
  139. package/schemas/browser.json +22 -2
  140. package/schemas/config.json +26 -1
  141. package/schemas/history-index.json +209 -0
  142. package/schemas/history-projects.json +133 -0
  143. package/schemas/history-show.json +275 -0
  144. package/schemas/history.json +410 -0
  145. package/schemas/menubar-hotkey.json +139 -0
  146. package/schemas/menubar-snapshot.json +36 -2
  147. package/schemas/menubar.json +74 -1
  148. package/schemas/messages-inbound.json +258 -0
  149. package/schemas/messages.json +164 -0
  150. package/schemas/send.json +165 -0
  151. package/schemas/sessions-copy.json +113 -0
  152. package/schemas/sessions-open-run.json +97 -0
  153. package/schemas/sessions.json +237 -0
  154. package/skills/sideby/SKILL.md +10 -5
  155. package/skills/sideby/references/accounts.md +11 -0
  156. package/skills/sideby/references/ai-tasks.md +17 -1
  157. package/skills/sideby/references/panel.md +6 -4
  158. package/skills/sideby/references/quota.md +2 -2
  159. package/skills/sideby/references/sessions.md +79 -0
@@ -3,11 +3,15 @@ import { type AppProfileStatus } from '../core/app-profiles.ts';
3
3
  import { type AutostartContext, type AutostartStatus } from '../core/autostart.ts';
4
4
  import { type BrowserReport } from '../core/browser-profiles.ts';
5
5
  import { type DisplayConfig, type HandoffSettings, type PanelConfig } from '../core/config.ts';
6
+ import { type InboundGroup } from '../core/inbound.ts';
7
+ import { type LiveSession, type LiveSessionsResult, sessionCopyText } from '../core/live-sessions.ts';
8
+ import { listMessages, type MessageReceipt, sendMessage } from '../core/messages.ts';
6
9
  import { type AccountModel } from '../core/model-choice.ts';
7
10
  import type { RemoteControlGroup } from '../core/remote-control.ts';
8
11
  import * as update from '../core/update.ts';
9
12
  import type { AccountStatus, DoctorHistory, FamilyInfo, QuotaCheckInfo, Runtime } from '../runtime.ts';
10
13
  import type { Account, FamilyLogo, QuotaResult, QuotaSetupPlan, UsageResult } from '../types.ts';
14
+ import { type OrcaDeps } from './orca.ts';
11
15
  import { type PanelTheme } from './theme.ts';
12
16
  export declare const PANEL_VERSION: string;
13
17
  export declare const MAX_BODY_BYTES: number;
@@ -51,6 +55,59 @@ export interface PanelHandlerOptions {
51
55
  bridge: 'postMessage';
52
56
  };
53
57
  }
58
+ /**
59
+ * Internal, for tests and screenshots: a property under this key of the handler options replaces where the Sessions
60
+ * page reads Live Sessions and their copy texts from (spec §3.32). Not part of the Portal contract (`src/index.ts`
61
+ * does not export it); it may change without notice.
62
+ */
63
+ export declare const LIVE_SESSIONS_SOURCE: unique symbol;
64
+ export interface LiveSessionsSource {
65
+ list?: (rt: Runtime) => Promise<LiveSessionsResult>;
66
+ copyText?: typeof sessionCopyText;
67
+ /** The Orca CLI and process reader; tests pass a fake so they never call the real Orca. */
68
+ orca?: OrcaDeps;
69
+ /** Sends a Message and lists them (spec §3.32 step 2); tests pass fakes so they never reach a real Session. */
70
+ send?: typeof sendMessage;
71
+ messages?: typeof listMessages;
72
+ }
73
+ /** The longest text "Send to it" takes; the page's text box has the same limit. */
74
+ export declare const MAX_MESSAGE_TEXT = 8000;
75
+ /** The latest Message to one Session, for the status chip on its row. */
76
+ export interface PanelMessageStatus {
77
+ id: string;
78
+ status: MessageReceipt['status'];
79
+ sentAt: string;
80
+ /** The target's Session Label, and the sender's when sideby could tell it, for the Panel's message notices. */
81
+ to: string;
82
+ from?: string;
83
+ /** For `paste-needed`: the line to paste into the target's tab. */
84
+ pasteText?: string;
85
+ /** Why a paste is needed, or what the target must still do. */
86
+ note?: string;
87
+ /** Delivered, but the target shows it only once the user approves it in its terminal (ADR-0045). */
88
+ needsApproval?: true;
89
+ }
90
+ /** A Claude settings file and whether its sessions show Messages at once, for the "Receiving messages" dialog. */
91
+ export interface PanelInboundGroup {
92
+ /** The file, with `~`. */
93
+ file: string;
94
+ accounts: string[];
95
+ state: InboundGroup['state'];
96
+ reason?: string;
97
+ undo: boolean;
98
+ /** Its sessions hold a Message for approval: `hold`, or not set while an Account starts in bypass mode. */
99
+ waits: boolean;
100
+ }
101
+ /** A Live Session as the Sessions page gets it: the working directory with `~`, and the three texts it can copy. */
102
+ export interface PanelSession extends LiveSession {
103
+ copy: {
104
+ reference: string;
105
+ id: string;
106
+ resume: string;
107
+ };
108
+ /** True when the Session runs in a live Orca terminal tab the Panel can bring to the front. */
109
+ orca?: true;
110
+ }
54
111
  export type PanelHandler = ((req: IncomingMessage, res: ServerResponse) => Promise<boolean>) & {
55
112
  /** Per-instance secret the page sends as `x-sideby-token`. */
56
113
  readonly token: string;
@@ -71,6 +128,8 @@ export type PanelAccount = (AccountStatus | (Account & Partial<AccountStatus>))
71
128
  aliasArgs?: Record<string, string[]>;
72
129
  /** The model and effort it starts with and where each comes from (spec §3.19); absent for Families without a choice. */
73
130
  modelInfo?: Omit<AccountModel, 'ref' | 'family'>;
131
+ /** Its reads take longer than the state waits (`readBudget`); they go on, and a later state carries them. */
132
+ pending?: true;
74
133
  };
75
134
  export type { DoctorHistory };
76
135
  /** Counts of failing and warning Findings per checked Account, from the Doctor history. */
@@ -212,10 +271,20 @@ export declare function autostartView(s: AutostartStatus, home: string): {
212
271
  current: boolean;
213
272
  programArguments?: string[] | undefined;
214
273
  missing?: string[] | undefined;
274
+ loaded?: boolean | undefined;
215
275
  };
216
276
  /** The `handoff` map of the Panel state, from the statuses and Quota already read for the page. */
217
277
  export declare function handoffByFamily(rt: Runtime, accounts: readonly PanelAccount[], now: Date): Record<string, string>;
218
278
  export type RemoteControlView = Omit<RemoteControlGroup, 'file'> & {
219
279
  file: string;
220
280
  };
281
+ /**
282
+ * How long one state waits for an Account's reads. A slower Account (a plugin reader that hangs, a Host that answers
283
+ * late) is sent as pending, so it does not hold up every other row; its reads go on and the next state picks up the
284
+ * answer. Mutable for tests only.
285
+ */
286
+ export declare const readBudget: {
287
+ ms: number;
288
+ hungMs: number;
289
+ };
221
290
  export declare function createPanelHandler(opts: PanelHandlerOptions): PanelHandler;