@tomradex/code-sessions 0.15.1 → 0.16.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/drop.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /** A path as Terminal.app types a dropped file: a backslash before blanks and the shell's special characters. */
2
+ export declare function shellEscape(file: string): string;
3
+ /**
4
+ * What a drop of files types into a terminal: their paths, escaped, one space apart and one after,
5
+ * as a bracketed paste (herdr drops the markers for a program that did not ask for them). Null when
6
+ * no file had a path on disk.
7
+ */
8
+ export declare function droppedPaste(paths: readonly string[]): string | null;
9
+ /**
10
+ * Whether a dropped file sits in the temp folder's TemporaryItems, where macOS keeps what is dragged out of a
11
+ * screenshot's thumbnail: only the app it was dropped on may read it there, not the programs in its terminals.
12
+ */
13
+ export declare const heldForDrop: (file: string, tmp?: string) => boolean;
14
+ /**
15
+ * 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.
17
+ */
18
+ export declare function readableDrops(paths: readonly string[], into: string, tmp?: string): Promise<string[]>;
19
+ //# sourceMappingURL=drop.d.ts.map
package/dist/index.d.ts CHANGED
@@ -9,8 +9,8 @@ export declare const Config: z.ZodObject<{
9
9
  stateFile: z.ZodOptional<z.ZodString>;
10
10
  }, z.core.$strip>;
11
11
  export type Config = z.infer<typeof Config>;
12
- /** Ended sessions stay listed this long, so the last look at one is a click away. */
13
- export declare const ENDED_SHOWN_MS: number;
12
+ /** A session that ended in herdr this recently may come back with herdr's server: the window starts it for them. */
13
+ export declare const RECENTLY_ENDED_MS: number;
14
14
  /** How often an open window asks herdr how it is, besides every session change. */
15
15
  export declare const BRIDGE_POLL_MS = 10000;
16
16
  /** Whether a stored value is a layout the window can draw. */
@@ -20,7 +20,7 @@ export declare function isLayout(value: unknown): value is Layout;
20
20
  * the folder, or a PowerShell window there when it is not installed. Resolves with the app it opened.
21
21
  */
22
22
  export declare function openSystemTerminal(cwd: string, platform?: NodeJS.Platform, launch?: typeof spawn): Promise<string>;
23
- /** A project's code sessions as the window lists them: live ones first, then the ones ended in the last day. */
23
+ /** A project's code sessions, live ones first and needs-you before the rest, then every ended one code link keeps. */
24
24
  export declare function sessionRows(codeLink: Pick<CodeLink, "sessionsOf" | "links">, items: {
25
25
  get(projectId: string, id: string): {
26
26
  key: string;
@@ -13,6 +13,18 @@ export interface SessionRow {
13
13
  activity: string | null;
14
14
  mode: "run" | "terminal";
15
15
  agent: string;
16
+ /** The agent's own name (Claude Code, Codex…), for a session with no ticket to go by; null when Tomrade does not know it. */
17
+ agentName: string | null;
18
+ /** What the agent herdr sees in the session's pane calls the conversation; null without one, or when a terminal row speaks for it. */
19
+ agentTitle: string | null;
20
+ /** What the conversation was called, kept after it ended: the agent's title, its pane's, or its first prompt. */
21
+ conversation: string | null;
22
+ /** The folder the agent ran in, as its hooks said. */
23
+ cwd: string | null;
24
+ /** Someone spoke to it. */
25
+ prompted: boolean;
26
+ /** Its agent can take it up again by its id in a new terminal. */
27
+ resumable: boolean;
16
28
  /** The herdr pane it runs in, on this machine; null when it has no terminal here. */
17
29
  pane: string | null;
18
30
  /** Where its terminal is: a herdr pane here, another terminal app here, another computer, or Tomrade running it. */
@@ -25,6 +37,8 @@ export interface SessionRow {
25
37
  prUrl: string | null;
26
38
  worktree: string | null;
27
39
  startedAt: number;
40
+ /** When it ended; null while it lives. */
41
+ endedAt: number | null;
28
42
  }
29
43
  /** A plain terminal the window opened: a herdr pane of the person's, with no ticket or code-link session behind it. */
30
44
  export interface TerminalRow {
@@ -34,6 +48,10 @@ export interface TerminalRow {
34
48
  /** Null while herdr is still opening it. */
35
49
  pane: string | null;
36
50
  startedAt: number;
51
+ /** What the agent herdr sees in it calls the conversation; null without one. */
52
+ agentTitle: string | null;
53
+ /** With no agent in it: what runs in its foreground when that is not the shell, else the title its shell set. */
54
+ running: string | null;
37
55
  /** The code session its agent claimed a ticket for: the cell shows that session, on the same pane. */
38
56
  sessionId: string | null;
39
57
  /** Why it stays a plain terminal although an agent claimed a ticket, when Tomrade cannot tell which terminal that was. */
@@ -51,10 +69,12 @@ export interface LayoutPreset {
51
69
  layout: Layout;
52
70
  }
53
71
  /** A cell of the window's layout: one session or terminal (by its id), or a split of two. */
72
+ /** A leaf `locked` keeps its session until the person unlocks or closes it. */
54
73
  export type Layout = {
55
74
  type: "leaf";
56
75
  id: string;
57
76
  sessionId: string | null;
77
+ locked?: true;
58
78
  } | {
59
79
  type: "split";
60
80
  id: string;
@@ -63,7 +83,10 @@ export type Layout = {
63
83
  a: Layout;
64
84
  b: Layout;
65
85
  };
66
- /** What the window shows, set as its whole state. */
86
+ /**
87
+ * What the window shows, set as its whole state. `sessions` holds the live ones and the ended ones a cell still
88
+ * shows; the rest are in `archive`.
89
+ */
67
90
  export interface WindowState {
68
91
  projectId: string;
69
92
  projectName: string;
@@ -98,6 +121,13 @@ export interface WindowState {
98
121
  sessionId: string;
99
122
  at: number;
100
123
  } | null;
124
+ /** Ended sessions, put away: how many, and the rows themselves only while the window has the archive open, newest first. */
125
+ archive: {
126
+ count: number;
127
+ rows: SessionRow[] | null;
128
+ };
129
+ /** The sidebar folded to a strip, as this project's window was left. */
130
+ folded: boolean;
101
131
  }
102
132
  /** What the window asks for. */
103
133
  export type WindowMessage = {
@@ -108,10 +138,18 @@ export type WindowMessage = {
108
138
  rows: number;
109
139
  }
110
140
  /** The window names the new terminal's id, so its cell shows it before herdr has opened it. */
141
+ /** The ended session a cell shows: its conversation, read from its agent's own record. */
142
+ | {
143
+ type: "conversation";
144
+ cell: string;
145
+ sessionId: string;
146
+ }
147
+ /** `resume`: a conversation's session, taken up again in the new terminal by its agent. */
111
148
  | {
112
149
  type: "newTerminal";
113
150
  terminalId: string;
114
151
  cwd: string | null;
152
+ resume?: string;
115
153
  } | {
116
154
  type: "closeTerminal";
117
155
  terminalId: string;
@@ -137,6 +175,14 @@ export type WindowMessage = {
137
175
  } | {
138
176
  type: "autoPlace";
139
177
  on: boolean;
178
+ }
179
+ /** The archive opened or closed: its rows come with the state while it is open. */
180
+ | {
181
+ type: "archive";
182
+ open: boolean;
183
+ } | {
184
+ type: "fold";
185
+ folded: boolean;
140
186
  } | {
141
187
  type: "detach";
142
188
  cell: string;
@@ -144,6 +190,12 @@ export type WindowMessage = {
144
190
  type: "input";
145
191
  cell: string;
146
192
  data: string;
193
+ }
194
+ /** Files dropped onto a cell's terminal, by their paths on disk: typed into it as a paste. */
195
+ | {
196
+ type: "drop";
197
+ cell: string;
198
+ paths: string[];
147
199
  } | {
148
200
  type: "resize";
149
201
  cell: string;
@@ -210,6 +262,23 @@ export type WindowPost = {
210
262
  | {
211
263
  type: "reattach";
212
264
  cell: string;
265
+ }
266
+ /** A session's conversation, read-only; `lines` null when its agent's record cannot be read. */
267
+ | {
268
+ type: "conversation";
269
+ cell: string;
270
+ sessionId: string;
271
+ lines: {
272
+ who: "person" | "agent" | "tool";
273
+ text: string;
274
+ }[] | null;
275
+ cut: boolean;
276
+ }
277
+ /** The pane the cell asked for streams in `other` already: one pane, one cell. */
278
+ | {
279
+ type: "shownIn";
280
+ cell: string;
281
+ other: string;
213
282
  } | {
214
283
  type: "toast";
215
284
  text: string;
package/dist/words.d.ts CHANGED
@@ -3,7 +3,7 @@ export declare const CODE_SESSIONS_WORDS: import("@tomradex/domain").WordBook<{
3
3
  readonly open: "Open terminal";
4
4
  readonly group: "Code link";
5
5
  readonly sidebar: "Terminal";
6
- readonly windowTitle: "Terminal — {{project}}";
6
+ readonly windowTitle: "{{project}} — Terminal";
7
7
  readonly openProject: "Open a project first";
8
8
  readonly noTerminal: "This session has no herdr terminal on this computer";
9
9
  readonly noTicket: "This session has no ticket";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/code-sessions",
3
- "version": "0.15.1",
3
+ "version": "0.16.1",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -27,14 +27,14 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@tomradex/code-link": "0.15.1",
31
- "@tomradex/contributions": "0.15.1",
32
- "@tomradex/db": "0.15.1",
33
- "@tomradex/desktop-surface": "0.15.1",
30
+ "@tomradex/code-link": "0.16.1",
31
+ "@tomradex/contributions": "0.16.1",
32
+ "@tomradex/db": "0.16.1",
33
+ "@tomradex/desktop-surface": "0.16.1",
34
34
  "@tomradex/domain": "0.2.18",
35
- "@tomradex/herdr": "0.15.1",
36
- "@tomradex/items": "0.15.1",
37
- "@tomradex/settings": "0.15.1",
35
+ "@tomradex/herdr": "0.16.1",
36
+ "@tomradex/items": "0.16.1",
37
+ "@tomradex/settings": "0.16.1",
38
38
  "cordis": "4.0.0-rc.8",
39
39
  "zod": "^4.4.3"
40
40
  }