@silo-code/sdk 0.11.0 → 0.12.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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/terminal-service.d.ts +48 -0
- package/dist/terminal-service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/terminal-service.ts +53 -0
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceS
|
|
|
15
15
|
export type { EditorService, EditorSaveHandlers, OpenFileOptions, EditorViewInfo, OpenDiffSpec, DiffContent, DiffContentRequest, DiffContentProvider, } from "./editor-service";
|
|
16
16
|
export type { LayoutService, LayoutState, SidePanelColumnState, SideLocation, } from "./layout-service";
|
|
17
17
|
export type { ProcessService, ProcessSession, ProcessSpawnOptions, ProcessExecOptions, ProcessExecResult, } from "./process-service";
|
|
18
|
-
export type { TerminalService, CreateTerminalInput, TerminalKind, TerminalRecord, TerminalTabDecoration, TerminalTabDecorationProvider, } from "./terminal-service";
|
|
18
|
+
export type { TerminalService, CreateTerminalInput, TerminalKind, TerminalRecord, TerminalTabDecoration, TerminalTabDecorationProvider, OscEvent, } from "./terminal-service";
|
|
19
19
|
export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
|
|
20
20
|
export type { SearchService, SearchOptions, SearchMatch, SearchFileResult, SearchResponse, } from "./search-service";
|
|
21
21
|
export type { Permission } from "./permissions";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAA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R,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,SAAS,EACT,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0FH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA0BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA8BzC,yEAAyE;AACzE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wEAAwE;AACxE,iFAAiF;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { Disposable } from "./types";
|
|
3
3
|
import type { TerminalKind, TerminalRecord } from "./domain-types";
|
|
4
|
+
/**
|
|
5
|
+
* A parsed OSC (Operating System Command) escape sequence emitted by a
|
|
6
|
+
* terminal program. Delivered by {@link TerminalService.subscribeOsc}.
|
|
7
|
+
*
|
|
8
|
+
* Common codes:
|
|
9
|
+
* - `0` — set window/tab title (e.g. Claude Code encodes busy/idle state here)
|
|
10
|
+
* - `7` — working directory (`file://host/path`)
|
|
11
|
+
* - `9` — iTerm2 notifications (attention, progress)
|
|
12
|
+
* - `133` — shell prompt markers (semantic shell integration)
|
|
13
|
+
*
|
|
14
|
+
* @category Consumer Services
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface OscEvent {
|
|
18
|
+
/** The numeric OSC code (the integer before the first semicolon). */
|
|
19
|
+
code: number;
|
|
20
|
+
/** The raw payload string after the code and its separating semicolon. */
|
|
21
|
+
payload: string;
|
|
22
|
+
}
|
|
4
23
|
export type { TerminalKind, TerminalRecord } from "./domain-types";
|
|
5
24
|
/**
|
|
6
25
|
* A decoration that an extension can attach to a terminal tab — a small icon
|
|
@@ -104,5 +123,34 @@ export interface TerminalService {
|
|
|
104
123
|
* that cancels the subscription.
|
|
105
124
|
*/
|
|
106
125
|
subscribeTabDecorations(listener: () => void): Disposable;
|
|
126
|
+
/**
|
|
127
|
+
* Subscribe to raw OSC (Operating System Command) escape sequences emitted
|
|
128
|
+
* by the terminal identified by `terminalId`. The handler is called once per
|
|
129
|
+
* parsed sequence — regardless of whether the terminal's panel is currently
|
|
130
|
+
* visible — making it suitable for background status monitoring.
|
|
131
|
+
*
|
|
132
|
+
* The subscription is keyed to the **terminal record id** (e.g.
|
|
133
|
+
* `"term_…"`), not the underlying PTY session id, so it survives terminal
|
|
134
|
+
* recreation within the same record.
|
|
135
|
+
*
|
|
136
|
+
* Returns a {@link Disposable} that cancels the subscription.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* // Detect Claude Code busy/idle state from OSC 0 title sequences.
|
|
141
|
+
* const BRAILLE_START = 0x2800;
|
|
142
|
+
* const BRAILLE_END = 0x28FF;
|
|
143
|
+
* const IDLE_CHAR = '\u2733'; // ✳
|
|
144
|
+
*
|
|
145
|
+
* const sub = ctx.terminals.subscribeOsc(terminalId, ({ code, payload }) => {
|
|
146
|
+
* if (code !== 0) return;
|
|
147
|
+
* const first = payload.charCodeAt(0);
|
|
148
|
+
* if (first >= BRAILLE_START && first <= BRAILLE_END) setStatus('busy');
|
|
149
|
+
* else if (payload.startsWith(IDLE_CHAR)) setStatus('idle');
|
|
150
|
+
* });
|
|
151
|
+
* ctx.subscriptions.push(sub);
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
subscribeOsc(terminalId: string, handler: (event: OscEvent) => void): Disposable;
|
|
107
155
|
}
|
|
108
156
|
//# sourceMappingURL=terminal-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-service.d.ts","sourceRoot":"","sources":["../src/terminal-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"terminal-service.d.ts","sourceRoot":"","sources":["../src/terminal-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACvB,qEAAqE;IACrE,IAAI,EA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,IAAI,CAAC;IAEjC;;;OAGG;IACH,uBAAuB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;IAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GACjC,UAAU,CAAC;CACf"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -83,6 +83,7 @@ export type {
|
|
|
83
83
|
TerminalRecord,
|
|
84
84
|
TerminalTabDecoration,
|
|
85
85
|
TerminalTabDecorationProvider,
|
|
86
|
+
OscEvent,
|
|
86
87
|
} from "./terminal-service";
|
|
87
88
|
export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
|
|
88
89
|
// Cross-file content search exposed on the ExtensionContext as `ctx.search`.
|
package/src/terminal-service.ts
CHANGED
|
@@ -2,6 +2,26 @@ import type React from "react";
|
|
|
2
2
|
import type { Disposable } from "./types";
|
|
3
3
|
import type { TerminalKind, TerminalRecord } from "./domain-types";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A parsed OSC (Operating System Command) escape sequence emitted by a
|
|
7
|
+
* terminal program. Delivered by {@link TerminalService.subscribeOsc}.
|
|
8
|
+
*
|
|
9
|
+
* Common codes:
|
|
10
|
+
* - `0` — set window/tab title (e.g. Claude Code encodes busy/idle state here)
|
|
11
|
+
* - `7` — working directory (`file://host/path`)
|
|
12
|
+
* - `9` — iTerm2 notifications (attention, progress)
|
|
13
|
+
* - `133` — shell prompt markers (semantic shell integration)
|
|
14
|
+
*
|
|
15
|
+
* @category Consumer Services
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export interface OscEvent {
|
|
19
|
+
/** The numeric OSC code (the integer before the first semicolon). */
|
|
20
|
+
code: number;
|
|
21
|
+
/** The raw payload string after the code and its separating semicolon. */
|
|
22
|
+
payload: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
// Re-export the terminal domain types so consumers can name them from the SDK.
|
|
6
26
|
export type { TerminalKind, TerminalRecord } from "./domain-types";
|
|
7
27
|
|
|
@@ -115,4 +135,37 @@ export interface TerminalService {
|
|
|
115
135
|
* that cancels the subscription.
|
|
116
136
|
*/
|
|
117
137
|
subscribeTabDecorations(listener: () => void): Disposable;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Subscribe to raw OSC (Operating System Command) escape sequences emitted
|
|
141
|
+
* by the terminal identified by `terminalId`. The handler is called once per
|
|
142
|
+
* parsed sequence — regardless of whether the terminal's panel is currently
|
|
143
|
+
* visible — making it suitable for background status monitoring.
|
|
144
|
+
*
|
|
145
|
+
* The subscription is keyed to the **terminal record id** (e.g.
|
|
146
|
+
* `"term_…"`), not the underlying PTY session id, so it survives terminal
|
|
147
|
+
* recreation within the same record.
|
|
148
|
+
*
|
|
149
|
+
* Returns a {@link Disposable} that cancels the subscription.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* // Detect Claude Code busy/idle state from OSC 0 title sequences.
|
|
154
|
+
* const BRAILLE_START = 0x2800;
|
|
155
|
+
* const BRAILLE_END = 0x28FF;
|
|
156
|
+
* const IDLE_CHAR = '\u2733'; // ✳
|
|
157
|
+
*
|
|
158
|
+
* const sub = ctx.terminals.subscribeOsc(terminalId, ({ code, payload }) => {
|
|
159
|
+
* if (code !== 0) return;
|
|
160
|
+
* const first = payload.charCodeAt(0);
|
|
161
|
+
* if (first >= BRAILLE_START && first <= BRAILLE_END) setStatus('busy');
|
|
162
|
+
* else if (payload.startsWith(IDLE_CHAR)) setStatus('idle');
|
|
163
|
+
* });
|
|
164
|
+
* ctx.subscriptions.push(sub);
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
subscribeOsc(
|
|
168
|
+
terminalId: string,
|
|
169
|
+
handler: (event: OscEvent) => void,
|
|
170
|
+
): Disposable;
|
|
118
171
|
}
|