@silo-code/sdk 0.11.0 → 0.13.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 CHANGED
@@ -11,11 +11,11 @@
11
11
  */
12
12
  export type { Disposable, DockPanelApi, DockPanelProps, EditorProps, EditorCapabilities, Editor, NewFileTemplate, FileType, Command, MenuId, MenuItemContribution, Keybinding, SidePanelProps, SidePanel, DockPanelKind, StatusItem, SettingsPage, ExtensionContext, Extension, ExtensionManifest, ExtensionHandle, } from "./types";
13
13
  export type { Workspace, EditorMode, EditorRecord, SidePanelSlot, } from "./domain-types";
14
- export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceStatusRow, WorkspaceDecorationProvider, } from "./workspace-service";
14
+ export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceStatusRow, WorkspaceDecorationProvider, WorkspaceSectionProps, WorkspaceSectionProvider, } from "./workspace-service";
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";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;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;AAG5D,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,WAAW,EACX,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,YAAY,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,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;AAyFH,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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA4FH,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;AAGnE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,uDAAuD;IACvD,OAAO,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AAC,QAAQ,EAAE,6BAA6B,GAAG,UAAU,CAAC;IAE3E;;;OAGG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAAC;IAEnE;;;;OAIG;IACH,wBAAwB,IAAI,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"}
@@ -22,6 +22,37 @@ export interface WorkspaceStatusRow {
22
22
  */
23
23
  startedAt?: string;
24
24
  }
25
+ /**
26
+ * Props passed to a {@link WorkspaceSectionProvider} component for each
27
+ * workspace row it is mounted in.
28
+ *
29
+ * @category Consumer Services
30
+ * @public
31
+ */
32
+ export interface WorkspaceSectionProps {
33
+ /** The id of the workspace whose row this component is rendering inside. */
34
+ workspaceId: string;
35
+ }
36
+ /**
37
+ * A section provider that mounts a React component inside workspace rows in the
38
+ * Workspaces side panel. Register via {@link WorkspaceService.registerSection}.
39
+ *
40
+ * Sections appear below the path line and any status-row decorations. Multiple
41
+ * providers stack vertically in ascending {@link WorkspaceSectionProvider.order}
42
+ * order. Return `null` from your component for workspaces where the section
43
+ * should not appear — this produces no DOM node and no visual gap.
44
+ *
45
+ * @category Consumer Services
46
+ * @public
47
+ */
48
+ export interface WorkspaceSectionProvider {
49
+ /** Unique id, conventionally `"<extension-id>.section"`. */
50
+ id: string;
51
+ /** The React component mounted once per workspace row. */
52
+ component: React.ComponentType<WorkspaceSectionProps>;
53
+ /** Sort order among sections. Lower values appear first. Defaults to `0`. */
54
+ order?: number;
55
+ }
25
56
  /**
26
57
  * A decoration provider that contributes {@link WorkspaceStatusRow}s to
27
58
  * workspace rows in the Workspaces side panel. Register via
@@ -150,5 +181,37 @@ export interface WorkspaceService {
150
181
  * to observe invalidations.
151
182
  */
152
183
  subscribeDecorations(listener: () => void): Disposable;
184
+ /**
185
+ * Register a section provider that mounts a React component inside workspace
186
+ * rows in the Workspaces side panel. Returns a {@link Disposable} that
187
+ * unregisters the provider and unmounts the component from all rows.
188
+ *
189
+ * Return `null` from your component for workspaces where the section should
190
+ * not appear — this produces no DOM node and no visual gap.
191
+ *
192
+ * @example
193
+ * ```tsx
194
+ * ctx.subscriptions.push(
195
+ * ctx.workspaces.registerSection({
196
+ * id: "my-ext.section",
197
+ * component: ({ workspaceId }) => {
198
+ * const ws = ctx.workspaces.get(workspaceId);
199
+ * if (!ws?.terminals.length) return null;
200
+ * return <MyCard terminals={ws.terminals} />;
201
+ * },
202
+ * }),
203
+ * );
204
+ * ```
205
+ */
206
+ registerSection(provider: WorkspaceSectionProvider): Disposable;
207
+ /**
208
+ * Subscribe to section registration changes. The listener is called whenever
209
+ * a {@link WorkspaceSectionProvider} is registered or unregistered. Returns a
210
+ * {@link Disposable} that cancels the subscription.
211
+ *
212
+ * The Workspaces panel subscribes internally to re-render when providers
213
+ * are added or removed.
214
+ */
215
+ subscribeSection(listener: () => void): Disposable;
153
216
  }
154
217
  //# sourceMappingURL=workspace-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../src/workspace-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,6EAA6E;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;;;;;;;;OAqBG;IACH,eAAe,CAAC,QAAQ,EAAE,wBAAwB,GAAG,UAAU,CAAC;IAEhE;;;;;;;OAOG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;CACpD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silo-code/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "The public, types-first SDK for building Silo extensions — the only surface third-party extensions import.",
5
5
  "license": "MIT",
6
6
  "author": "Dave Weaver",
package/src/index.ts CHANGED
@@ -52,6 +52,8 @@ export type {
52
52
  CreateWorkspaceInput,
53
53
  WorkspaceStatusRow,
54
54
  WorkspaceDecorationProvider,
55
+ WorkspaceSectionProps,
56
+ WorkspaceSectionProvider,
55
57
  } from "./workspace-service";
56
58
  export type {
57
59
  EditorService,
@@ -83,6 +85,7 @@ export type {
83
85
  TerminalRecord,
84
86
  TerminalTabDecoration,
85
87
  TerminalTabDecorationProvider,
88
+ OscEvent,
86
89
  } from "./terminal-service";
87
90
  export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
88
91
  // Cross-file content search exposed on the ExtensionContext as `ctx.search`.
@@ -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
  }
@@ -26,6 +26,39 @@ export interface WorkspaceStatusRow {
26
26
  startedAt?: string;
27
27
  }
28
28
 
29
+ /**
30
+ * Props passed to a {@link WorkspaceSectionProvider} component for each
31
+ * workspace row it is mounted in.
32
+ *
33
+ * @category Consumer Services
34
+ * @public
35
+ */
36
+ export interface WorkspaceSectionProps {
37
+ /** The id of the workspace whose row this component is rendering inside. */
38
+ workspaceId: string;
39
+ }
40
+
41
+ /**
42
+ * A section provider that mounts a React component inside workspace rows in the
43
+ * Workspaces side panel. Register via {@link WorkspaceService.registerSection}.
44
+ *
45
+ * Sections appear below the path line and any status-row decorations. Multiple
46
+ * providers stack vertically in ascending {@link WorkspaceSectionProvider.order}
47
+ * order. Return `null` from your component for workspaces where the section
48
+ * should not appear — this produces no DOM node and no visual gap.
49
+ *
50
+ * @category Consumer Services
51
+ * @public
52
+ */
53
+ export interface WorkspaceSectionProvider {
54
+ /** Unique id, conventionally `"<extension-id>.section"`. */
55
+ id: string;
56
+ /** The React component mounted once per workspace row. */
57
+ component: React.ComponentType<WorkspaceSectionProps>;
58
+ /** Sort order among sections. Lower values appear first. Defaults to `0`. */
59
+ order?: number;
60
+ }
61
+
29
62
  /**
30
63
  * A decoration provider that contributes {@link WorkspaceStatusRow}s to
31
64
  * workspace rows in the Workspaces side panel. Register via
@@ -161,4 +194,38 @@ export interface WorkspaceService {
161
194
  * to observe invalidations.
162
195
  */
163
196
  subscribeDecorations(listener: () => void): Disposable;
197
+
198
+ /**
199
+ * Register a section provider that mounts a React component inside workspace
200
+ * rows in the Workspaces side panel. Returns a {@link Disposable} that
201
+ * unregisters the provider and unmounts the component from all rows.
202
+ *
203
+ * Return `null` from your component for workspaces where the section should
204
+ * not appear — this produces no DOM node and no visual gap.
205
+ *
206
+ * @example
207
+ * ```tsx
208
+ * ctx.subscriptions.push(
209
+ * ctx.workspaces.registerSection({
210
+ * id: "my-ext.section",
211
+ * component: ({ workspaceId }) => {
212
+ * const ws = ctx.workspaces.get(workspaceId);
213
+ * if (!ws?.terminals.length) return null;
214
+ * return <MyCard terminals={ws.terminals} />;
215
+ * },
216
+ * }),
217
+ * );
218
+ * ```
219
+ */
220
+ registerSection(provider: WorkspaceSectionProvider): Disposable;
221
+
222
+ /**
223
+ * Subscribe to section registration changes. The listener is called whenever
224
+ * a {@link WorkspaceSectionProvider} is registered or unregistered. Returns a
225
+ * {@link Disposable} that cancels the subscription.
226
+ *
227
+ * The Workspaces panel subscribes internally to re-render when providers
228
+ * are added or removed.
229
+ */
230
+ subscribeSection(listener: () => void): Disposable;
164
231
  }