@tomradex/code-sessions 0.16.2 → 0.17.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/drop.d.ts CHANGED
@@ -11,9 +11,16 @@ export declare function droppedPaste(paths: readonly string[]): string | null;
11
11
  * screenshot's thumbnail: only the app it was dropped on may read it there, not the programs in its terminals.
12
12
  */
13
13
  export declare const heldForDrop: (file: string, tmp?: string) => boolean;
14
+ export declare const PRIVATE_COPY_MAX: number;
15
+ /**
16
+ * The folders macOS keeps to the apps the person allowed and to the app a file from them was dropped on (Tomrade).
17
+ * A terminal's programs count as whichever app started herdr, often neither. None off macOS.
18
+ */
19
+ export declare function privateFolders(home?: string | null): string[];
14
20
  /**
15
21
  * The dropped paths as a terminal's programs can read them: each file held for Tomrade alone is copied, under
16
- * its own name, into a new folder in `into`; one that cannot be copied keeps its own path.
22
+ * its own name, into a new folder in `into` — anything held for a drop, and from a private folder a file up to
23
+ * PRIVATE_COPY_MAX. One that cannot be copied, and a folder or bigger file from a private folder, keeps its own path.
17
24
  */
18
- export declare function readableDrops(paths: readonly string[], into: string, tmp?: string): Promise<string[]>;
25
+ export declare function readableDrops(paths: readonly string[], into: string, tmp?: string, folders?: string[]): Promise<string[]>;
19
26
  //# sourceMappingURL=drop.d.ts.map
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
2
2
  import type { Context } from "cordis";
3
3
  import { z } from "zod";
4
4
  import { type CodeLink } from "@tomradex/code-link";
5
- import type { Layout, SessionRow } from "./protocol.js";
5
+ import type { Layout, SessionRow, TerminalRow } from "./protocol.js";
6
6
  export type * from "./protocol.js";
7
7
  export declare const Config: z.ZodObject<{
8
8
  document: z.ZodString;
@@ -29,6 +29,11 @@ export declare function sessionRows(codeLink: Pick<CodeLink, "sessionsOf" | "lin
29
29
  title: string;
30
30
  } | null | undefined;
31
31
  }, projectId: string, now?: number, device?: string, platform?: NodeJS.Platform): SessionRow[];
32
+ /**
33
+ * The row an ended session's pane goes on as, when it does: a terminal opened here on it, else the newest live session
34
+ * on it — the agent working another ticket in the same pane. Null once nothing of the window runs there.
35
+ */
36
+ export declare function continuedIn(pane: string | null, sessions: SessionRow[], terminals: TerminalRow[]): string | null;
32
37
  /**
33
38
  * A window per project for its code sessions: the list with live status, and
34
39
  * their terminals side by side — streamed from herdr's panes through core,
@@ -1,4 +1,4 @@
1
- import type { HerdrBridge, TerminalMouse, TerminalScroll } from "@tomradex/herdr";
1
+ import type { HerdrBridge, HerdrScroll, TerminalMouse, TerminalScroll } from "@tomradex/herdr";
2
2
  /** One code session as the window lists it. */
3
3
  export interface SessionRow {
4
4
  id: string;
@@ -39,6 +39,8 @@ export interface SessionRow {
39
39
  startedAt: number;
40
40
  /** When it ended; null while it lives. */
41
41
  endedAt: number | null;
42
+ /** Ended while its pane goes on here as another of the window's rows (another ticket of the same agent): that row's id; null otherwise. */
43
+ continuedIn: string | null;
42
44
  }
43
45
  /** A plain terminal the window opened: a herdr pane of the person's, with no ticket or code-link session behind it. */
44
46
  export interface TerminalRow {
@@ -50,6 +52,8 @@ export interface TerminalRow {
50
52
  startedAt: number;
51
53
  /** What the agent herdr sees in it calls the conversation; null without one. */
52
54
  agentTitle: string | null;
55
+ /** How herdr reads that agent; null without one, or when herdr cannot tell. */
56
+ agentStatus: "working" | "blocked" | "idle" | "done" | null;
53
57
  /** With no agent in it: what runs in its foreground when that is not the shell, else the title its shell set. */
54
58
  running: string | null;
55
59
  /** The code session its agent claimed a ticket for: the cell shows that session, on the same pane. */
@@ -93,6 +97,8 @@ export interface WindowState {
93
97
  /** The app's language, so the window speaks it even before the main window says how it looks. */
94
98
  locale: string;
95
99
  bridge: HerdrBridge;
100
+ /** A herdr client of its own runs on this machine: "Show in herdr" has a window to show the pane in. */
101
+ herdrClient: boolean;
96
102
  /** herdr's server went away under this window's terminals: being started again, or that did not work (the person can retry). */
97
103
  revive: "starting" | "failed" | null;
98
104
  /** How herdr installs here, when it is missing: the command shown on the button, or only the guide. */
@@ -204,7 +210,13 @@ export type WindowMessage = {
204
210
  } | ({
205
211
  type: "scroll";
206
212
  cell: string;
207
- } & TerminalScroll) | ({
213
+ } & TerminalScroll)
214
+ /** Dragging the cell's scrollbar: its pane's view, this many rows above the bottom of the scrollback. */
215
+ | {
216
+ type: "scrollTo";
217
+ cell: string;
218
+ offset: number;
219
+ } | ({
208
220
  type: "mouse";
209
221
  cell: string;
210
222
  } & TerminalMouse) | {
@@ -234,6 +246,11 @@ export type WindowMessage = {
234
246
  type: "install";
235
247
  } | {
236
248
  type: "openGuide";
249
+ }
250
+ /** A link clicked in a terminal: opened in the system browser. */
251
+ | {
252
+ type: "openLink";
253
+ url: string;
237
254
  } | {
238
255
  type: "switchTerminal";
239
256
  switch: boolean;
@@ -258,6 +275,11 @@ export type WindowPost = {
258
275
  cell: string;
259
276
  reason: string | null;
260
277
  }
278
+ /** Where the cell's pane is in its scrollback, in rows, for its scrollbar. */
279
+ | ({
280
+ type: "scrolled";
281
+ cell: string;
282
+ } & HerdrScroll)
261
283
  /** herdr's server is back: attach the cell's pane again. */
262
284
  | {
263
285
  type: "reattach";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/code-sessions",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -27,14 +27,15 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@tomradex/code-link": "0.16.2",
31
- "@tomradex/contributions": "0.16.2",
32
- "@tomradex/db": "0.16.2",
33
- "@tomradex/desktop-surface": "0.16.2",
34
- "@tomradex/domain": "0.2.18",
35
- "@tomradex/herdr": "0.16.2",
36
- "@tomradex/items": "0.16.2",
37
- "@tomradex/settings": "0.16.2",
30
+ "@tomradex/code-link": "0.17.0",
31
+ "@tomradex/contracts": "0.17.0",
32
+ "@tomradex/contributions": "0.17.0",
33
+ "@tomradex/db": "0.17.0",
34
+ "@tomradex/desktop-surface": "0.17.0",
35
+ "@tomradex/domain": "0.2.24",
36
+ "@tomradex/herdr": "0.17.0",
37
+ "@tomradex/items": "0.17.0",
38
+ "@tomradex/settings": "0.17.0",
38
39
  "cordis": "4.0.0-rc.8",
39
40
  "zod": "^4.4.3"
40
41
  }