@silo-code/sdk 0.8.0 → 0.10.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, } from "./workspace-service";
14
+ export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceStatusRow, WorkspaceDecorationProvider, } 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, } from "./terminal-service";
18
+ export type { TerminalService, CreateTerminalInput, TerminalKind, TerminalRecord, TerminalTabDecoration, TerminalTabDecorationProvider, } 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";
@@ -25,6 +25,7 @@ export type { ExtensionStorage } from "./extension-storage";
25
25
  export type { DndService, DndItem, DndMime, DragInit, DndMode, DropContext, DropTargetHandlers, } from "./dnd-service";
26
26
  export { DND_MIME } from "./dnd-service";
27
27
  export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, NotifyAction, NotifyOptions, } from "./ui-service";
28
+ export type { NetworkService, NetworkRequestOptions, NetworkResponse, } from "./network-service";
28
29
  export type { ContextKeys } from "./context-keys";
29
30
  export { Tooltip } from "./Tooltip";
30
31
  export { useServiceState } from "./use-service-state";
@@ -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,GACrB,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,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE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,WAAW,EACX,aAAa,EACb,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;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;AAqFH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA0BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAuBzC,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;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"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Options for {@link NetworkService.fetch} and {@link NetworkService.fetchHeaders}.
3
+ *
4
+ * @category Core Types
5
+ * @public
6
+ */
7
+ export interface NetworkRequestOptions {
8
+ /**
9
+ * HTTP method. Defaults to `"GET"` for {@link NetworkService.fetch} and
10
+ * `"HEAD"` for {@link NetworkService.fetchHeaders}.
11
+ */
12
+ method?: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH";
13
+ /** Request headers to send. */
14
+ headers?: Record<string, string>;
15
+ /** Request body (string). Only meaningful for methods that carry a body. */
16
+ body?: string;
17
+ /** Follow HTTP redirects. Defaults to `true`. */
18
+ followRedirects?: boolean;
19
+ /** Request timeout in milliseconds. Omit for the platform default (~30 s). */
20
+ timeoutMs?: number;
21
+ }
22
+ /**
23
+ * Response from {@link NetworkService.fetch}.
24
+ *
25
+ * @category Core Types
26
+ * @public
27
+ */
28
+ export interface NetworkResponse {
29
+ /** HTTP status code. */
30
+ status: number;
31
+ /**
32
+ * Response headers, lowercased. Multi-value headers are joined with `", "`,
33
+ * matching the HTTP/1.1 field-value combining rule.
34
+ */
35
+ headers: Record<string, string>;
36
+ /** Response body decoded as UTF-8 text. */
37
+ body: string;
38
+ /** Final URL after redirects. */
39
+ finalUrl: string;
40
+ }
41
+ /**
42
+ * Server-side HTTP client exposed as {@link ExtensionContext.net}. Requests
43
+ * run in the Rust backend via `reqwest`, so they bypass the browser's CORS
44
+ * policy and can read response headers that the browser would otherwise hide
45
+ * from cross-origin requests.
46
+ *
47
+ * Typical use-cases:
48
+ * - Checking `X-Frame-Options` / CSP `frame-ancestors` before embedding a URL
49
+ * in an `<iframe>` (see the Web Viewer extension).
50
+ * - Probing a `localhost` dev server that has no CORS headers.
51
+ * - Fetching data from an external API that doesn't grant cross-origin access.
52
+ *
53
+ * @category Consumer Services
54
+ * @public
55
+ */
56
+ export interface NetworkService {
57
+ /**
58
+ * Make an HTTP request server-side, bypassing CORS. Returns the full
59
+ * response: status, headers, body, and the final URL after any redirects.
60
+ *
61
+ * @param url - The URL to fetch.
62
+ * @param options - Method, headers, body, redirect and timeout controls.
63
+ * @throws A string error message if the request fails (network error, DNS
64
+ * failure, TLS error, etc.).
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const { status, body } = await ctx.net.fetch("https://api.example.com/data");
69
+ * ```
70
+ */
71
+ fetch(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse>;
72
+ /**
73
+ * Send a `HEAD` request and return only the response headers — no body is
74
+ * downloaded. More efficient than {@link NetworkService.fetch} when you only
75
+ * need to inspect headers (e.g. checking embeddability before loading an
76
+ * iframe).
77
+ *
78
+ * Header names are lowercased; multi-value headers are joined with `", "`.
79
+ *
80
+ * @param url - The URL to probe.
81
+ * @param options - Redirect and timeout controls (`method` and `body` are
82
+ * ignored — this is always a HEAD request).
83
+ * @throws A string error message if the request fails.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const headers = await ctx.net.fetchHeaders("https://github.com");
88
+ * const blocked = headers["x-frame-options"] === "deny";
89
+ * ```
90
+ */
91
+ fetchHeaders(url: string, options?: Pick<NetworkRequestOptions, "followRedirects" | "timeoutMs">): Promise<Record<string, string>>;
92
+ }
93
+ //# sourceMappingURL=network-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-service.d.ts","sourceRoot":"","sources":["../src/network-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC9D,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAE9E;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CACV,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,WAAW,CAAC,GACrE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=network-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-service.js","sourceRoot":"","sources":["../src/network-service.ts"],"names":[],"mappings":""}
@@ -1,5 +1,47 @@
1
+ import type React from "react";
2
+ import type { Disposable } from "./types";
1
3
  import type { TerminalKind, TerminalRecord } from "./domain-types";
2
4
  export type { TerminalKind, TerminalRecord } from "./domain-types";
5
+ /**
6
+ * A decoration that an extension can attach to a terminal tab — a small icon
7
+ * with an optional tooltip and semantic color. Registered via
8
+ * {@link TerminalService.registerTabDecoration}.
9
+ *
10
+ * @category Consumer Services
11
+ * @public
12
+ */
13
+ export interface TerminalTabDecoration {
14
+ /**
15
+ * Small React node rendered as a decoration badge on the tab (≤16 px).
16
+ * The extension supplies the shape; the host applies `color` via a CSS
17
+ * data attribute mapped to design tokens.
18
+ */
19
+ icon: React.ReactNode;
20
+ /** Tooltip shown when hovering the decoration icon. */
21
+ tooltip?: string;
22
+ /**
23
+ * Semantic color applied to the icon element. The host maps this to the
24
+ * matching `--silo-color-*` design token so themes control the exact shade.
25
+ */
26
+ color?: "accent" | "warn" | "ok" | "error" | "muted";
27
+ }
28
+ /**
29
+ * A decoration provider for terminal tabs. Register via
30
+ * {@link TerminalService.registerTabDecoration}.
31
+ *
32
+ * @category Consumer Services
33
+ * @public
34
+ */
35
+ export interface TerminalTabDecorationProvider {
36
+ /** Unique id — conventionally `"<extension-id>.tab-decoration"`. */
37
+ id: string;
38
+ /**
39
+ * Called synchronously for each terminal tab during render. Return `null`
40
+ * to contribute nothing for this terminal. When multiple providers are
41
+ * registered, the first non-null result wins.
42
+ */
43
+ provide(terminalId: string): TerminalTabDecoration | null;
44
+ }
3
45
  /**
4
46
  * Input for {@link TerminalService.create}.
5
47
  *
@@ -34,5 +76,33 @@ export interface TerminalService {
34
76
  create(input?: CreateTerminalInput): TerminalRecord | undefined;
35
77
  /** Close and kill every terminal in a workspace (e.g. on workspace delete). */
36
78
  closeWorkspace(workspaceId: string): void;
79
+ /**
80
+ * Switch to the workspace containing this terminal and activate its tab in
81
+ * the center dock. No-ops if the terminal id is unknown.
82
+ */
83
+ focus(terminalId: string): void;
84
+ /**
85
+ * Register a decoration provider for terminal tabs. The first registered
86
+ * provider that returns a non-null decoration for a terminal wins; subsequent
87
+ * providers are not consulted. Returns a {@link Disposable} that unregisters
88
+ * the provider.
89
+ */
90
+ registerTabDecoration(provider: TerminalTabDecorationProvider): Disposable;
91
+ /**
92
+ * Get the current decoration for a terminal tab. Returns the first non-null
93
+ * result from registered providers, or `null` if none apply.
94
+ */
95
+ getTabDecoration(terminalId: string): TerminalTabDecoration | null;
96
+ /**
97
+ * Signal that tab decoration data has changed. Fires all listeners registered
98
+ * via {@link TerminalService.subscribeTabDecorations}, causing terminal tabs
99
+ * to re-query providers and re-render their decoration.
100
+ */
101
+ invalidateTabDecorations(): void;
102
+ /**
103
+ * Subscribe to tab decoration invalidations. Returns a {@link Disposable}
104
+ * that cancels the subscription.
105
+ */
106
+ subscribeTabDecorations(listener: () => void): Disposable;
37
107
  }
38
108
  //# 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,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGnE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MA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;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,mBAAmB,GAAG,cAAc,GAAG,SAAS,CAAC;IAChE,+EAA+E;IAC/E,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1C;;;OAGG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;OAKG;IACH,qBAAqB,CAAC,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;CAC3D"}
package/dist/types.d.ts CHANGED
@@ -30,6 +30,7 @@ import type { SearchService } from "./search-service";
30
30
  import type { ThemeService, ThemePreset } from "./theme-service";
31
31
  import type { DndService } from "./dnd-service";
32
32
  import type { UiService } from "./ui-service";
33
+ import type { NetworkService } from "./network-service";
33
34
  import type { ExtensionStorage } from "./extension-storage";
34
35
  /**
35
36
  * The teardown handle returned by every `register*` call on
@@ -471,6 +472,14 @@ export interface ExtensionContext {
471
472
  * notifications ({@link UiService.notify}). Mirrors VS Code's `window.show*`.
472
473
  */
473
474
  readonly ui: UiService;
475
+ /**
476
+ * Server-side HTTP client — makes requests from the Rust backend, bypassing
477
+ * the browser's CORS policy. Use when browser `fetch` is insufficient:
478
+ * reading response headers from cross-origin requests, probing localhost
479
+ * services without CORS headers, or checking iframe embeddability before
480
+ * loading a URL. See {@link NetworkService} for the full API.
481
+ */
482
+ readonly net: NetworkService;
474
483
  /**
475
484
  * Resolve a handle to another extension in order to consume the API it
476
485
  * published (the value its {@link Extension.activate} returned). This is how
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRo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AKG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C,gEAAgE;IAChE,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB"}
@@ -1,6 +1,44 @@
1
1
  import type { Disposable } from "./types";
2
2
  import type { Workspace } from "./domain-types";
3
3
  export type { Workspace, TerminalRecord } from "./domain-types";
4
+ /**
5
+ * A single status row contributed by a {@link WorkspaceDecorationProvider}.
6
+ * Rows appear below the path line in the Workspaces side panel.
7
+ *
8
+ * @category Consumer Services
9
+ * @public
10
+ */
11
+ export interface WorkspaceStatusRow {
12
+ /** Stable key unique within this provider's results; used for reconciliation. */
13
+ id: string;
14
+ /** Semantic status dot shown to the left of the label. */
15
+ status?: "ok" | "warn" | "busy" | "error";
16
+ /** Short label — the host truncates with an ellipsis when space is tight. */
17
+ label: string;
18
+ /**
19
+ * ISO timestamp for when this row started. The host renders it as elapsed
20
+ * time using the same `formatElapsed` helper as workspace uptime ("6h", "2d",
21
+ * "just now").
22
+ */
23
+ startedAt?: string;
24
+ }
25
+ /**
26
+ * A decoration provider that contributes {@link WorkspaceStatusRow}s to
27
+ * workspace rows in the Workspaces side panel. Register via
28
+ * {@link WorkspaceService.registerDecoration}.
29
+ *
30
+ * @category Consumer Services
31
+ * @public
32
+ */
33
+ export interface WorkspaceDecorationProvider {
34
+ /** Unique id for this provider — conventionally `"<extension-id>.decoration"`. */
35
+ id: string;
36
+ /**
37
+ * Called synchronously for each workspace during render. Return an empty
38
+ * array to contribute nothing for this workspace.
39
+ */
40
+ provide(workspaceId: string): WorkspaceStatusRow[];
41
+ }
4
42
  /**
5
43
  * An immutable, frozen view of workspace state, returned by
6
44
  * {@link WorkspaceService.getState} and delivered to subscribers — read
@@ -68,5 +106,49 @@ export interface WorkspaceService {
68
106
  removeFolder(id: string, folder: string): void;
69
107
  /** Hard delete — permanent removal. */
70
108
  delete(id: string): void;
109
+ /**
110
+ * Register a decoration provider that contributes status rows to workspace
111
+ * rows in the Workspaces side panel. Multiple providers may be registered;
112
+ * their rows are concatenated in registration order. Returns a
113
+ * {@link Disposable} that unregisters the provider.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * ctx.subscriptions.push(
118
+ * ctx.workspaces.registerDecoration({
119
+ * id: "my-ext.decoration",
120
+ * provide(workspaceId) {
121
+ * const running = getRunningTasks(workspaceId);
122
+ * return running.map(t => ({ id: t.id, status: "busy", label: t.name, startedAt: t.startedAt }));
123
+ * },
124
+ * }),
125
+ * ctx.workspaces.subscribeDecorations(() => ctx.workspaces.invalidateDecorations()),
126
+ * );
127
+ * ```
128
+ */
129
+ registerDecoration(provider: WorkspaceDecorationProvider): Disposable;
130
+ /**
131
+ * Concatenate all registered providers' rows for one workspace (in
132
+ * registration order). Called synchronously during panel render — providers
133
+ * must be fast and side-effect-free.
134
+ */
135
+ getDecorations(workspaceId: string): WorkspaceStatusRow[];
136
+ /**
137
+ * Signal that decoration data has changed. Fires all listeners registered
138
+ * via {@link WorkspaceService.subscribeDecorations}, causing the Workspaces
139
+ * panel to re-query providers and re-render the status rows.
140
+ *
141
+ * Call this after any mutation to the state your `provide` function reads.
142
+ */
143
+ invalidateDecorations(): void;
144
+ /**
145
+ * Subscribe to decoration invalidations. The listener is called whenever
146
+ * {@link WorkspaceService.invalidateDecorations} is invoked. Returns a
147
+ * {@link Disposable} that cancels the subscription.
148
+ *
149
+ * The Workspaces panel subscribes internally; extensions may also subscribe
150
+ * to observe invalidations.
151
+ */
152
+ subscribeDecorations(listener: () => void): Disposable;
71
153
  }
72
154
  //# 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,MA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AM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,uCAAuC;IACvC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAAkB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,UAAU,CAAC;IAEtE;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAAC;IAE1D;;;;;;OAMG;IACH,qBAAqB,IAAI,IAAI,CAAC;IAE9B;;;;;;;OAOG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;CACxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silo-code/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.10.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
@@ -50,6 +50,8 @@ export type {
50
50
  WorkspaceService,
51
51
  WorkspaceState,
52
52
  CreateWorkspaceInput,
53
+ WorkspaceStatusRow,
54
+ WorkspaceDecorationProvider,
53
55
  } from "./workspace-service";
54
56
  export type {
55
57
  EditorService,
@@ -79,6 +81,8 @@ export type {
79
81
  CreateTerminalInput,
80
82
  TerminalKind,
81
83
  TerminalRecord,
84
+ TerminalTabDecoration,
85
+ TerminalTabDecorationProvider,
82
86
  } from "./terminal-service";
83
87
  export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
84
88
  // Cross-file content search exposed on the ExtensionContext as `ctx.search`.
@@ -139,6 +143,13 @@ export type {
139
143
  NotifyOptions,
140
144
  } from "./ui-service";
141
145
 
146
+ // Server-side HTTP client — bypasses CORS, readable response headers.
147
+ export type {
148
+ NetworkService,
149
+ NetworkRequestOptions,
150
+ NetworkResponse,
151
+ } from "./network-service";
152
+
142
153
  // Context keys referenced by `when` predicates on menu items / keybindings.
143
154
  export type { ContextKeys } from "./context-keys";
144
155
 
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Options for {@link NetworkService.fetch} and {@link NetworkService.fetchHeaders}.
3
+ *
4
+ * @category Core Types
5
+ * @public
6
+ */
7
+ export interface NetworkRequestOptions {
8
+ /**
9
+ * HTTP method. Defaults to `"GET"` for {@link NetworkService.fetch} and
10
+ * `"HEAD"` for {@link NetworkService.fetchHeaders}.
11
+ */
12
+ method?: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH";
13
+ /** Request headers to send. */
14
+ headers?: Record<string, string>;
15
+ /** Request body (string). Only meaningful for methods that carry a body. */
16
+ body?: string;
17
+ /** Follow HTTP redirects. Defaults to `true`. */
18
+ followRedirects?: boolean;
19
+ /** Request timeout in milliseconds. Omit for the platform default (~30 s). */
20
+ timeoutMs?: number;
21
+ }
22
+
23
+ /**
24
+ * Response from {@link NetworkService.fetch}.
25
+ *
26
+ * @category Core Types
27
+ * @public
28
+ */
29
+ export interface NetworkResponse {
30
+ /** HTTP status code. */
31
+ status: number;
32
+ /**
33
+ * Response headers, lowercased. Multi-value headers are joined with `", "`,
34
+ * matching the HTTP/1.1 field-value combining rule.
35
+ */
36
+ headers: Record<string, string>;
37
+ /** Response body decoded as UTF-8 text. */
38
+ body: string;
39
+ /** Final URL after redirects. */
40
+ finalUrl: string;
41
+ }
42
+
43
+ /**
44
+ * Server-side HTTP client exposed as {@link ExtensionContext.net}. Requests
45
+ * run in the Rust backend via `reqwest`, so they bypass the browser's CORS
46
+ * policy and can read response headers that the browser would otherwise hide
47
+ * from cross-origin requests.
48
+ *
49
+ * Typical use-cases:
50
+ * - Checking `X-Frame-Options` / CSP `frame-ancestors` before embedding a URL
51
+ * in an `<iframe>` (see the Web Viewer extension).
52
+ * - Probing a `localhost` dev server that has no CORS headers.
53
+ * - Fetching data from an external API that doesn't grant cross-origin access.
54
+ *
55
+ * @category Consumer Services
56
+ * @public
57
+ */
58
+ export interface NetworkService {
59
+ /**
60
+ * Make an HTTP request server-side, bypassing CORS. Returns the full
61
+ * response: status, headers, body, and the final URL after any redirects.
62
+ *
63
+ * @param url - The URL to fetch.
64
+ * @param options - Method, headers, body, redirect and timeout controls.
65
+ * @throws A string error message if the request fails (network error, DNS
66
+ * failure, TLS error, etc.).
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const { status, body } = await ctx.net.fetch("https://api.example.com/data");
71
+ * ```
72
+ */
73
+ fetch(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse>;
74
+
75
+ /**
76
+ * Send a `HEAD` request and return only the response headers — no body is
77
+ * downloaded. More efficient than {@link NetworkService.fetch} when you only
78
+ * need to inspect headers (e.g. checking embeddability before loading an
79
+ * iframe).
80
+ *
81
+ * Header names are lowercased; multi-value headers are joined with `", "`.
82
+ *
83
+ * @param url - The URL to probe.
84
+ * @param options - Redirect and timeout controls (`method` and `body` are
85
+ * ignored — this is always a HEAD request).
86
+ * @throws A string error message if the request fails.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const headers = await ctx.net.fetchHeaders("https://github.com");
91
+ * const blocked = headers["x-frame-options"] === "deny";
92
+ * ```
93
+ */
94
+ fetchHeaders(
95
+ url: string,
96
+ options?: Pick<NetworkRequestOptions, "followRedirects" | "timeoutMs">,
97
+ ): Promise<Record<string, string>>;
98
+ }
@@ -1,8 +1,52 @@
1
+ import type React from "react";
2
+ import type { Disposable } from "./types";
1
3
  import type { TerminalKind, TerminalRecord } from "./domain-types";
2
4
 
3
5
  // Re-export the terminal domain types so consumers can name them from the SDK.
4
6
  export type { TerminalKind, TerminalRecord } from "./domain-types";
5
7
 
8
+ /**
9
+ * A decoration that an extension can attach to a terminal tab — a small icon
10
+ * with an optional tooltip and semantic color. Registered via
11
+ * {@link TerminalService.registerTabDecoration}.
12
+ *
13
+ * @category Consumer Services
14
+ * @public
15
+ */
16
+ export interface TerminalTabDecoration {
17
+ /**
18
+ * Small React node rendered as a decoration badge on the tab (≤16 px).
19
+ * The extension supplies the shape; the host applies `color` via a CSS
20
+ * data attribute mapped to design tokens.
21
+ */
22
+ icon: React.ReactNode;
23
+ /** Tooltip shown when hovering the decoration icon. */
24
+ tooltip?: string;
25
+ /**
26
+ * Semantic color applied to the icon element. The host maps this to the
27
+ * matching `--silo-color-*` design token so themes control the exact shade.
28
+ */
29
+ color?: "accent" | "warn" | "ok" | "error" | "muted";
30
+ }
31
+
32
+ /**
33
+ * A decoration provider for terminal tabs. Register via
34
+ * {@link TerminalService.registerTabDecoration}.
35
+ *
36
+ * @category Consumer Services
37
+ * @public
38
+ */
39
+ export interface TerminalTabDecorationProvider {
40
+ /** Unique id — conventionally `"<extension-id>.tab-decoration"`. */
41
+ id: string;
42
+ /**
43
+ * Called synchronously for each terminal tab during render. Return `null`
44
+ * to contribute nothing for this terminal. When multiple providers are
45
+ * registered, the first non-null result wins.
46
+ */
47
+ provide(terminalId: string): TerminalTabDecoration | null;
48
+ }
49
+
6
50
  /**
7
51
  * Input for {@link TerminalService.create}.
8
52
  *
@@ -38,4 +82,37 @@ export interface TerminalService {
38
82
  create(input?: CreateTerminalInput): TerminalRecord | undefined;
39
83
  /** Close and kill every terminal in a workspace (e.g. on workspace delete). */
40
84
  closeWorkspace(workspaceId: string): void;
85
+
86
+ /**
87
+ * Switch to the workspace containing this terminal and activate its tab in
88
+ * the center dock. No-ops if the terminal id is unknown.
89
+ */
90
+ focus(terminalId: string): void;
91
+
92
+ /**
93
+ * Register a decoration provider for terminal tabs. The first registered
94
+ * provider that returns a non-null decoration for a terminal wins; subsequent
95
+ * providers are not consulted. Returns a {@link Disposable} that unregisters
96
+ * the provider.
97
+ */
98
+ registerTabDecoration(provider: TerminalTabDecorationProvider): Disposable;
99
+
100
+ /**
101
+ * Get the current decoration for a terminal tab. Returns the first non-null
102
+ * result from registered providers, or `null` if none apply.
103
+ */
104
+ getTabDecoration(terminalId: string): TerminalTabDecoration | null;
105
+
106
+ /**
107
+ * Signal that tab decoration data has changed. Fires all listeners registered
108
+ * via {@link TerminalService.subscribeTabDecorations}, causing terminal tabs
109
+ * to re-query providers and re-render their decoration.
110
+ */
111
+ invalidateTabDecorations(): void;
112
+
113
+ /**
114
+ * Subscribe to tab decoration invalidations. Returns a {@link Disposable}
115
+ * that cancels the subscription.
116
+ */
117
+ subscribeTabDecorations(listener: () => void): Disposable;
41
118
  }
package/src/types.ts CHANGED
@@ -30,6 +30,7 @@ import type { SearchService } from "./search-service";
30
30
  import type { ThemeService, ThemePreset } from "./theme-service";
31
31
  import type { DndService } from "./dnd-service";
32
32
  import type { UiService } from "./ui-service";
33
+ import type { NetworkService } from "./network-service";
33
34
  import type { ExtensionStorage } from "./extension-storage";
34
35
 
35
36
  /**
@@ -490,6 +491,14 @@ export interface ExtensionContext {
490
491
  * notifications ({@link UiService.notify}). Mirrors VS Code's `window.show*`.
491
492
  */
492
493
  readonly ui: UiService;
494
+ /**
495
+ * Server-side HTTP client — makes requests from the Rust backend, bypassing
496
+ * the browser's CORS policy. Use when browser `fetch` is insufficient:
497
+ * reading response headers from cross-origin requests, probing localhost
498
+ * services without CORS headers, or checking iframe embeddability before
499
+ * loading a URL. See {@link NetworkService} for the full API.
500
+ */
501
+ readonly net: NetworkService;
493
502
  /**
494
503
  * Resolve a handle to another extension in order to consume the API it
495
504
  * published (the value its {@link Extension.activate} returned). This is how
@@ -4,6 +4,46 @@ import type { Workspace } from "./domain-types";
4
4
  // Re-export the workspace domain types so consumers can name them from the SDK.
5
5
  export type { Workspace, TerminalRecord } from "./domain-types";
6
6
 
7
+ /**
8
+ * A single status row contributed by a {@link WorkspaceDecorationProvider}.
9
+ * Rows appear below the path line in the Workspaces side panel.
10
+ *
11
+ * @category Consumer Services
12
+ * @public
13
+ */
14
+ export interface WorkspaceStatusRow {
15
+ /** Stable key unique within this provider's results; used for reconciliation. */
16
+ id: string;
17
+ /** Semantic status dot shown to the left of the label. */
18
+ status?: "ok" | "warn" | "busy" | "error";
19
+ /** Short label — the host truncates with an ellipsis when space is tight. */
20
+ label: string;
21
+ /**
22
+ * ISO timestamp for when this row started. The host renders it as elapsed
23
+ * time using the same `formatElapsed` helper as workspace uptime ("6h", "2d",
24
+ * "just now").
25
+ */
26
+ startedAt?: string;
27
+ }
28
+
29
+ /**
30
+ * A decoration provider that contributes {@link WorkspaceStatusRow}s to
31
+ * workspace rows in the Workspaces side panel. Register via
32
+ * {@link WorkspaceService.registerDecoration}.
33
+ *
34
+ * @category Consumer Services
35
+ * @public
36
+ */
37
+ export interface WorkspaceDecorationProvider {
38
+ /** Unique id for this provider — conventionally `"<extension-id>.decoration"`. */
39
+ id: string;
40
+ /**
41
+ * Called synchronously for each workspace during render. Return an empty
42
+ * array to contribute nothing for this workspace.
43
+ */
44
+ provide(workspaceId: string): WorkspaceStatusRow[];
45
+ }
46
+
7
47
  /**
8
48
  * An immutable, frozen view of workspace state, returned by
9
49
  * {@link WorkspaceService.getState} and delivered to subscribers — read
@@ -73,4 +113,52 @@ export interface WorkspaceService {
73
113
  removeFolder(id: string, folder: string): void;
74
114
  /** Hard delete — permanent removal. */
75
115
  delete(id: string): void;
116
+
117
+ /**
118
+ * Register a decoration provider that contributes status rows to workspace
119
+ * rows in the Workspaces side panel. Multiple providers may be registered;
120
+ * their rows are concatenated in registration order. Returns a
121
+ * {@link Disposable} that unregisters the provider.
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * ctx.subscriptions.push(
126
+ * ctx.workspaces.registerDecoration({
127
+ * id: "my-ext.decoration",
128
+ * provide(workspaceId) {
129
+ * const running = getRunningTasks(workspaceId);
130
+ * return running.map(t => ({ id: t.id, status: "busy", label: t.name, startedAt: t.startedAt }));
131
+ * },
132
+ * }),
133
+ * ctx.workspaces.subscribeDecorations(() => ctx.workspaces.invalidateDecorations()),
134
+ * );
135
+ * ```
136
+ */
137
+ registerDecoration(provider: WorkspaceDecorationProvider): Disposable;
138
+
139
+ /**
140
+ * Concatenate all registered providers' rows for one workspace (in
141
+ * registration order). Called synchronously during panel render — providers
142
+ * must be fast and side-effect-free.
143
+ */
144
+ getDecorations(workspaceId: string): WorkspaceStatusRow[];
145
+
146
+ /**
147
+ * Signal that decoration data has changed. Fires all listeners registered
148
+ * via {@link WorkspaceService.subscribeDecorations}, causing the Workspaces
149
+ * panel to re-query providers and re-render the status rows.
150
+ *
151
+ * Call this after any mutation to the state your `provide` function reads.
152
+ */
153
+ invalidateDecorations(): void;
154
+
155
+ /**
156
+ * Subscribe to decoration invalidations. The listener is called whenever
157
+ * {@link WorkspaceService.invalidateDecorations} is invoked. Returns a
158
+ * {@link Disposable} that cancels the subscription.
159
+ *
160
+ * The Workspaces panel subscribes internally; extensions may also subscribe
161
+ * to observe invalidations.
162
+ */
163
+ subscribeDecorations(listener: () => void): Disposable;
76
164
  }