@silo-code/sdk 0.25.0 → 0.25.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.
|
@@ -49,6 +49,12 @@ export interface ProcessTreeNode {
|
|
|
49
49
|
export interface ProcessInfo {
|
|
50
50
|
/** The underlying PTY session id — stable across app restarts. */
|
|
51
51
|
readonly sessionId: string;
|
|
52
|
+
/**
|
|
53
|
+
* The workspace this session belongs to. Use to group entries when
|
|
54
|
+
* requesting {@link ProcessesService.getState} with `{ allWorkspaces: true }`,
|
|
55
|
+
* or to correlate with `ctx.workspaces`.
|
|
56
|
+
*/
|
|
57
|
+
readonly workspaceId: string;
|
|
52
58
|
/**
|
|
53
59
|
* The terminal tab record id (e.g. `"term_abc"`) when this session is backed
|
|
54
60
|
* by a visible terminal tab. `undefined` only for headless sessions created
|
|
@@ -117,27 +123,40 @@ export interface ProcessInfo {
|
|
|
117
123
|
*/
|
|
118
124
|
export interface ProcessesService {
|
|
119
125
|
/**
|
|
120
|
-
* Current {@link ProcessInfo} for every live session in the active
|
|
121
|
-
*
|
|
122
|
-
*
|
|
126
|
+
* Current {@link ProcessInfo} for every live session in the active
|
|
127
|
+
* workspace. Pass `{ allWorkspaces: true }` to get every live session across
|
|
128
|
+
* every loaded workspace instead — use {@link ProcessInfo.workspaceId} to
|
|
129
|
+
* group or filter the result (e.g. for a sidebar badge per workspace).
|
|
130
|
+
* Sessions appear as soon as their terminal is attached, with placeholder
|
|
131
|
+
* values (`leader: ""`, `pgid: 0`) until the first foreground update
|
|
132
|
+
* arrives from the daemon.
|
|
123
133
|
*/
|
|
124
|
-
getState(
|
|
134
|
+
getState(options?: {
|
|
135
|
+
allWorkspaces?: boolean;
|
|
136
|
+
}): ProcessInfo[];
|
|
125
137
|
/**
|
|
126
138
|
* Look up the {@link ProcessInfo} for a specific terminal tab by its record
|
|
127
139
|
* id (e.g. `"term_abc"`). Returns `undefined` until the first foreground
|
|
128
|
-
* event has been received for that terminal's session.
|
|
140
|
+
* event has been received for that terminal's session. Terminal ids are
|
|
141
|
+
* unique across workspaces, so this looks across all loaded workspaces
|
|
142
|
+
* regardless of which one is active.
|
|
129
143
|
*
|
|
130
144
|
* Convenience shortcut — avoids scanning {@link ProcessesService.getState}
|
|
131
145
|
* when the caller already has a `terminalId`.
|
|
132
146
|
*/
|
|
133
147
|
getByTerminalId(terminalId: string): ProcessInfo | undefined;
|
|
134
148
|
/**
|
|
135
|
-
* Subscribe to changes in the active workspace's process list.
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* is
|
|
149
|
+
* Subscribe to changes in the active workspace's process list. Pass
|
|
150
|
+
* `{ allWorkspaces: true }` to be notified about changes across every
|
|
151
|
+
* loaded workspace instead (see {@link ProcessesService.getState}). The
|
|
152
|
+
* listener is called whenever a leader changes, `atPrompt` flips, a
|
|
153
|
+
* terminal is added or removed, or a stats tick arrives (if
|
|
154
|
+
* {@link ProcessesService.enableStats} is active). Returns a
|
|
155
|
+
* {@link Disposable} that cancels the subscription.
|
|
139
156
|
*/
|
|
140
|
-
subscribe(listener: (state: ProcessInfo[]) => void
|
|
157
|
+
subscribe(listener: (state: ProcessInfo[]) => void, options?: {
|
|
158
|
+
allWorkspaces?: boolean;
|
|
159
|
+
}): Disposable;
|
|
141
160
|
/**
|
|
142
161
|
* Kill a specific foreground process group by pgid — sends `SIGTERM`, then
|
|
143
162
|
* `SIGKILL` after 3 s if the group is still alive. **Does not destroy the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processes-service.d.ts","sourceRoot":"","sources":["../src/processes-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAO1C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,gGAAgG;IAChG,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EA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E,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,WAAW,EAAE,CAAC;IAE/D;;;;;;;;;OASG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAE7D;;;;;;;;OAQG;IACH,SAAS,CACP,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,EACxC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GACpC,UAAU,CAAC;IAEd;;;;;;;;;;OAUG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,UAAU,CAAC;CACxD"}
|
package/package.json
CHANGED
package/src/processes-service.ts
CHANGED
|
@@ -57,6 +57,12 @@ export interface ProcessTreeNode {
|
|
|
57
57
|
export interface ProcessInfo {
|
|
58
58
|
/** The underlying PTY session id — stable across app restarts. */
|
|
59
59
|
readonly sessionId: string;
|
|
60
|
+
/**
|
|
61
|
+
* The workspace this session belongs to. Use to group entries when
|
|
62
|
+
* requesting {@link ProcessesService.getState} with `{ allWorkspaces: true }`,
|
|
63
|
+
* or to correlate with `ctx.workspaces`.
|
|
64
|
+
*/
|
|
65
|
+
readonly workspaceId: string;
|
|
60
66
|
/**
|
|
61
67
|
* The terminal tab record id (e.g. `"term_abc"`) when this session is backed
|
|
62
68
|
* by a visible terminal tab. `undefined` only for headless sessions created
|
|
@@ -126,16 +132,22 @@ export interface ProcessInfo {
|
|
|
126
132
|
*/
|
|
127
133
|
export interface ProcessesService {
|
|
128
134
|
/**
|
|
129
|
-
* Current {@link ProcessInfo} for every live session in the active
|
|
130
|
-
*
|
|
131
|
-
*
|
|
135
|
+
* Current {@link ProcessInfo} for every live session in the active
|
|
136
|
+
* workspace. Pass `{ allWorkspaces: true }` to get every live session across
|
|
137
|
+
* every loaded workspace instead — use {@link ProcessInfo.workspaceId} to
|
|
138
|
+
* group or filter the result (e.g. for a sidebar badge per workspace).
|
|
139
|
+
* Sessions appear as soon as their terminal is attached, with placeholder
|
|
140
|
+
* values (`leader: ""`, `pgid: 0`) until the first foreground update
|
|
141
|
+
* arrives from the daemon.
|
|
132
142
|
*/
|
|
133
|
-
getState(): ProcessInfo[];
|
|
143
|
+
getState(options?: { allWorkspaces?: boolean }): ProcessInfo[];
|
|
134
144
|
|
|
135
145
|
/**
|
|
136
146
|
* Look up the {@link ProcessInfo} for a specific terminal tab by its record
|
|
137
147
|
* id (e.g. `"term_abc"`). Returns `undefined` until the first foreground
|
|
138
|
-
* event has been received for that terminal's session.
|
|
148
|
+
* event has been received for that terminal's session. Terminal ids are
|
|
149
|
+
* unique across workspaces, so this looks across all loaded workspaces
|
|
150
|
+
* regardless of which one is active.
|
|
139
151
|
*
|
|
140
152
|
* Convenience shortcut — avoids scanning {@link ProcessesService.getState}
|
|
141
153
|
* when the caller already has a `terminalId`.
|
|
@@ -143,12 +155,18 @@ export interface ProcessesService {
|
|
|
143
155
|
getByTerminalId(terminalId: string): ProcessInfo | undefined;
|
|
144
156
|
|
|
145
157
|
/**
|
|
146
|
-
* Subscribe to changes in the active workspace's process list.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* is
|
|
158
|
+
* Subscribe to changes in the active workspace's process list. Pass
|
|
159
|
+
* `{ allWorkspaces: true }` to be notified about changes across every
|
|
160
|
+
* loaded workspace instead (see {@link ProcessesService.getState}). The
|
|
161
|
+
* listener is called whenever a leader changes, `atPrompt` flips, a
|
|
162
|
+
* terminal is added or removed, or a stats tick arrives (if
|
|
163
|
+
* {@link ProcessesService.enableStats} is active). Returns a
|
|
164
|
+
* {@link Disposable} that cancels the subscription.
|
|
150
165
|
*/
|
|
151
|
-
subscribe(
|
|
166
|
+
subscribe(
|
|
167
|
+
listener: (state: ProcessInfo[]) => void,
|
|
168
|
+
options?: { allWorkspaces?: boolean },
|
|
169
|
+
): Disposable;
|
|
152
170
|
|
|
153
171
|
/**
|
|
154
172
|
* Kill a specific foreground process group by pgid — sends `SIGTERM`, then
|