@tomradex/code-sessions 0.15.0 → 0.16.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/index.d.ts +3 -3
- package/dist/protocol.d.ts +41 -1
- package/dist/words.d.ts +2 -1
- package/package.json +8 -8
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
|
-
/**
|
|
13
|
-
export declare const
|
|
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
|
|
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;
|
package/dist/protocol.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface SessionRow {
|
|
|
25
25
|
prUrl: string | null;
|
|
26
26
|
worktree: string | null;
|
|
27
27
|
startedAt: number;
|
|
28
|
+
/** When it ended; null while it lives. */
|
|
29
|
+
endedAt: number | null;
|
|
28
30
|
}
|
|
29
31
|
/** A plain terminal the window opened: a herdr pane of the person's, with no ticket or code-link session behind it. */
|
|
30
32
|
export interface TerminalRow {
|
|
@@ -34,6 +36,8 @@ export interface TerminalRow {
|
|
|
34
36
|
/** Null while herdr is still opening it. */
|
|
35
37
|
pane: string | null;
|
|
36
38
|
startedAt: number;
|
|
39
|
+
/** What the agent herdr sees in it calls the conversation; null without one. */
|
|
40
|
+
agentTitle: string | null;
|
|
37
41
|
/** The code session its agent claimed a ticket for: the cell shows that session, on the same pane. */
|
|
38
42
|
sessionId: string | null;
|
|
39
43
|
/** Why it stays a plain terminal although an agent claimed a ticket, when Tomrade cannot tell which terminal that was. */
|
|
@@ -51,10 +55,12 @@ export interface LayoutPreset {
|
|
|
51
55
|
layout: Layout;
|
|
52
56
|
}
|
|
53
57
|
/** A cell of the window's layout: one session or terminal (by its id), or a split of two. */
|
|
58
|
+
/** A leaf `locked` keeps its session until the person unlocks or closes it. */
|
|
54
59
|
export type Layout = {
|
|
55
60
|
type: "leaf";
|
|
56
61
|
id: string;
|
|
57
62
|
sessionId: string | null;
|
|
63
|
+
locked?: true;
|
|
58
64
|
} | {
|
|
59
65
|
type: "split";
|
|
60
66
|
id: string;
|
|
@@ -63,13 +69,18 @@ export type Layout = {
|
|
|
63
69
|
a: Layout;
|
|
64
70
|
b: Layout;
|
|
65
71
|
};
|
|
66
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* What the window shows, set as its whole state. `sessions` holds the live ones and the ended ones a cell still
|
|
74
|
+
* shows; the rest are in `archive`.
|
|
75
|
+
*/
|
|
67
76
|
export interface WindowState {
|
|
68
77
|
projectId: string;
|
|
69
78
|
projectName: string;
|
|
70
79
|
/** The app's language, so the window speaks it even before the main window says how it looks. */
|
|
71
80
|
locale: string;
|
|
72
81
|
bridge: HerdrBridge;
|
|
82
|
+
/** herdr's server went away under this window's terminals: being started again, or that did not work (the person can retry). */
|
|
83
|
+
revive: "starting" | "failed" | null;
|
|
73
84
|
/** How herdr installs here, when it is missing: the command shown on the button, or only the guide. */
|
|
74
85
|
install: {
|
|
75
86
|
command: string | null;
|
|
@@ -91,6 +102,18 @@ export interface WindowState {
|
|
|
91
102
|
defaultPreset: string | null;
|
|
92
103
|
/** New sessions and terminals go to the first empty cell. */
|
|
93
104
|
autoPlace: boolean;
|
|
105
|
+
/** A session asked to be shown, from outside the window: put in a cell and selected once; `at` tells a new ask from one done. */
|
|
106
|
+
reveal: {
|
|
107
|
+
sessionId: string;
|
|
108
|
+
at: number;
|
|
109
|
+
} | null;
|
|
110
|
+
/** Ended sessions, put away: how many, and the rows themselves only while the window has the archive open, newest first. */
|
|
111
|
+
archive: {
|
|
112
|
+
count: number;
|
|
113
|
+
rows: SessionRow[] | null;
|
|
114
|
+
};
|
|
115
|
+
/** The sidebar folded to a strip, as this project's window was left. */
|
|
116
|
+
folded: boolean;
|
|
94
117
|
}
|
|
95
118
|
/** What the window asks for. */
|
|
96
119
|
export type WindowMessage = {
|
|
@@ -130,6 +153,14 @@ export type WindowMessage = {
|
|
|
130
153
|
} | {
|
|
131
154
|
type: "autoPlace";
|
|
132
155
|
on: boolean;
|
|
156
|
+
}
|
|
157
|
+
/** The archive opened or closed: its rows come with the state while it is open. */
|
|
158
|
+
| {
|
|
159
|
+
type: "archive";
|
|
160
|
+
open: boolean;
|
|
161
|
+
} | {
|
|
162
|
+
type: "fold";
|
|
163
|
+
folded: boolean;
|
|
133
164
|
} | {
|
|
134
165
|
type: "detach";
|
|
135
166
|
cell: string;
|
|
@@ -178,6 +209,10 @@ export type WindowMessage = {
|
|
|
178
209
|
} | {
|
|
179
210
|
type: "switchTerminal";
|
|
180
211
|
switch: boolean;
|
|
212
|
+
}
|
|
213
|
+
/** Start herdr's server again after it would not come up. */
|
|
214
|
+
| {
|
|
215
|
+
type: "startHerdr";
|
|
181
216
|
} | {
|
|
182
217
|
type: "refresh";
|
|
183
218
|
};
|
|
@@ -194,6 +229,11 @@ export type WindowPost = {
|
|
|
194
229
|
type: "closed";
|
|
195
230
|
cell: string;
|
|
196
231
|
reason: string | null;
|
|
232
|
+
}
|
|
233
|
+
/** herdr's server is back: attach the cell's pane again. */
|
|
234
|
+
| {
|
|
235
|
+
type: "reattach";
|
|
236
|
+
cell: string;
|
|
197
237
|
} | {
|
|
198
238
|
type: "toast";
|
|
199
239
|
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: "
|
|
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";
|
|
@@ -19,5 +19,6 @@ export declare const CODE_SESSIONS_WORDS: import("@tomradex/domain").WordBook<{
|
|
|
19
19
|
readonly switchFailed: "Could not bring {{app}} forward";
|
|
20
20
|
readonly openedOutside: "Opened in {{app}}. An agent you start there shows up here as a session";
|
|
21
21
|
readonly outsideFailed: "Could not open a terminal: {{reason}}";
|
|
22
|
+
readonly herdrRestarting: "herdr's server stopped — starting it again, this terminal comes back on its own";
|
|
22
23
|
}>;
|
|
23
24
|
//# sourceMappingURL=words.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomradex/code-sessions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
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.
|
|
31
|
-
"@tomradex/contributions": "0.
|
|
32
|
-
"@tomradex/db": "0.
|
|
33
|
-
"@tomradex/desktop-surface": "0.
|
|
30
|
+
"@tomradex/code-link": "0.16.0",
|
|
31
|
+
"@tomradex/contributions": "0.16.0",
|
|
32
|
+
"@tomradex/db": "0.16.0",
|
|
33
|
+
"@tomradex/desktop-surface": "0.16.0",
|
|
34
34
|
"@tomradex/domain": "0.2.18",
|
|
35
|
-
"@tomradex/herdr": "0.
|
|
36
|
-
"@tomradex/items": "0.
|
|
37
|
-
"@tomradex/settings": "0.
|
|
35
|
+
"@tomradex/herdr": "0.16.0",
|
|
36
|
+
"@tomradex/items": "0.16.0",
|
|
37
|
+
"@tomradex/settings": "0.16.0",
|
|
38
38
|
"cordis": "4.0.0-rc.8",
|
|
39
39
|
"zod": "^4.4.3"
|
|
40
40
|
}
|