@silo-code/sdk 0.14.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/extension-storage.d.ts +35 -9
- package/dist/extension-storage.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +31 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/workspace-service.d.ts +76 -0
- package/dist/workspace-service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/extension-storage.ts +36 -9
- package/src/index.ts +6 -1
- package/src/types.ts +34 -4
- package/src/workspace-service.ts +82 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Namespaced, persisted key/value storage handed to
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Namespaced, persisted key/value storage handed to extensions. Two scopes are
|
|
3
|
+
* exposed on {@link ExtensionContext.storage} ({@link ExtensionStorageScopes}):
|
|
4
|
+
* `global` (one bag per extension, shared across every workspace) and
|
|
5
|
+
* `workspace` (one bag per extension × the active workspace). Side panels also
|
|
6
|
+
* receive a workspace-scoped bag keyed by panel id via `SidePanelProps.storage`.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Values persist alongside the rest of the app state. The store hydrates
|
|
9
|
+
* asynchronously, and the workspace bag is swapped when the active workspace
|
|
10
|
+
* changes, so consumers that need to react to restored or switched values
|
|
11
|
+
* should {@link ExtensionStorage.subscribe | subscribe} and re-read.
|
|
9
12
|
*
|
|
10
13
|
* @category Consumer Services
|
|
11
14
|
* @public
|
|
@@ -16,11 +19,34 @@ export interface ExtensionStorage {
|
|
|
16
19
|
get<T>(key: string, fallback: T): T;
|
|
17
20
|
/** Write a value. `undefined` deletes the key. */
|
|
18
21
|
set(key: string, value: unknown): void;
|
|
22
|
+
/** The keys currently set in this namespace. */
|
|
23
|
+
keys(): string[];
|
|
19
24
|
/**
|
|
20
|
-
* Subscribe to changes in this namespace. Called
|
|
21
|
-
* namespace,
|
|
22
|
-
* (
|
|
25
|
+
* Subscribe to changes in this namespace. Called when a value in this
|
|
26
|
+
* namespace changes, when the underlying app state finishes hydrating, and
|
|
27
|
+
* (for the workspace scope) when the active workspace changes. Returns an
|
|
28
|
+
* unsubscribe function.
|
|
23
29
|
*/
|
|
24
30
|
subscribe(listener: () => void): () => void;
|
|
25
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The two persisted-storage scopes available to an extension, exposed as
|
|
34
|
+
* {@link ExtensionContext.storage}.
|
|
35
|
+
*
|
|
36
|
+
* @category Consumer Services
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface ExtensionStorageScopes {
|
|
40
|
+
/**
|
|
41
|
+
* Per-extension storage shared across **all** workspaces — the place for
|
|
42
|
+
* an extension's own settings (enabled features, layout choices, etc.).
|
|
43
|
+
*/
|
|
44
|
+
readonly global: ExtensionStorage;
|
|
45
|
+
/**
|
|
46
|
+
* Per-extension storage scoped to the **active workspace** — the place for
|
|
47
|
+
* state that should differ per workspace (last selection, per-project
|
|
48
|
+
* toggles). The bag is swapped when the active workspace changes.
|
|
49
|
+
*/
|
|
50
|
+
readonly workspace: ExtensionStorage;
|
|
51
|
+
}
|
|
26
52
|
//# sourceMappingURL=extension-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-storage.d.ts","sourceRoot":"","sources":["../src/extension-storage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"extension-storage.d.ts","sourceRoot":"","sources":["../src/extension-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IACnC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IACpC,kDAAkD;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,gDAAgD;IAChD,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;CACtC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
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, WorkspaceSectionProps, WorkspaceSectionProvider, } from "./workspace-service";
|
|
14
|
+
export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceStatusRow, WorkspaceDecorationProvider, WorkspaceSectionProps, WorkspaceSectionProvider, WorkspaceBadge, WorkspaceBadgeProvider, } 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";
|
|
@@ -21,7 +21,7 @@ export type { SearchService, SearchOptions, SearchMatch, SearchFileResult, Searc
|
|
|
21
21
|
export type { Permission } from "./permissions";
|
|
22
22
|
export { PathDeniedError } from "./permissions";
|
|
23
23
|
export type { ThemeService, ThemeState, ThemePreset, ResolvedTheme, ThemeBase, ThemeVars, CustomTheme, ThemeExport, } from "./theme-service";
|
|
24
|
-
export type { ExtensionStorage } from "./extension-storage";
|
|
24
|
+
export type { ExtensionStorage, ExtensionStorageScopes, } 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";
|
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,EAC3B,qBAAqB,EACrB,wBAAwB,
|
|
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,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,GACvB,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,EAC7B,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7E,YAAY,EACV,aAAa,EACb,aAA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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;AA8FH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6BhD,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"}
|
package/dist/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ import type { ThemeService, ThemePreset } from "./theme-service";
|
|
|
31
31
|
import type { DndService } from "./dnd-service";
|
|
32
32
|
import type { UiService } from "./ui-service";
|
|
33
33
|
import type { NetworkService } from "./network-service";
|
|
34
|
-
import type { ExtensionStorage } from "./extension-storage";
|
|
34
|
+
import type { ExtensionStorage, ExtensionStorageScopes } from "./extension-storage";
|
|
35
35
|
/**
|
|
36
36
|
* The teardown handle returned by every `register*` call on
|
|
37
37
|
* {@link ExtensionContext}. Calling {@link Disposable.dispose | dispose}
|
|
@@ -254,9 +254,12 @@ export interface SidePanelProps {
|
|
|
254
254
|
/** True when this side panel is currently visible / selected in its column. */
|
|
255
255
|
active: boolean;
|
|
256
256
|
/**
|
|
257
|
-
* Namespaced, persisted key/value storage scoped to this panel id
|
|
258
|
-
*
|
|
259
|
-
*
|
|
257
|
+
* Namespaced, persisted key/value storage scoped to this panel id (the
|
|
258
|
+
* `workspace` scope of {@link ExtensionStorageScopes}, keyed by panel rather
|
|
259
|
+
* than extension). Use for **panel-local UI state** — scroll positions,
|
|
260
|
+
* selections, expanded sections, etc. — which is kept per workspace. For
|
|
261
|
+
* extension-level settings shared across surfaces and workspaces, use
|
|
262
|
+
* {@link ExtensionContext.storage}`.global` instead.
|
|
260
263
|
*/
|
|
261
264
|
storage: ExtensionStorage;
|
|
262
265
|
/**
|
|
@@ -321,6 +324,14 @@ export interface DockPanelKind {
|
|
|
321
324
|
/**
|
|
322
325
|
* A widget in the status bar (the strip along the bottom of the window).
|
|
323
326
|
*
|
|
327
|
+
* @remarks
|
|
328
|
+
* The status bar container sets `font-size` and `color` on itself, so
|
|
329
|
+
* components rendered inside it inherit the correct values automatically —
|
|
330
|
+
* **do not override `font-size` or `font-family`** in status item CSS unless
|
|
331
|
+
* you have a deliberate reason to deviate. You may override `color` using
|
|
332
|
+
* design tokens (e.g. `--silo-color-text-lo` for a label / `--silo-color-text`
|
|
333
|
+
* for a value) to create visual distinctions within an item.
|
|
334
|
+
*
|
|
324
335
|
* @category Registration
|
|
325
336
|
* @public
|
|
326
337
|
*/
|
|
@@ -380,6 +391,22 @@ export interface ExtensionContext {
|
|
|
380
391
|
readonly extensionId: string;
|
|
381
392
|
/** Disposables tracked for this extension; the host disposes them on teardown. */
|
|
382
393
|
readonly subscriptions: Disposable[];
|
|
394
|
+
/**
|
|
395
|
+
* Persisted, per-extension key/value storage, in two scopes
|
|
396
|
+
* ({@link ExtensionStorageScopes}): `global` (shared across all workspaces —
|
|
397
|
+
* for the extension's own settings) and `workspace` (scoped to the active
|
|
398
|
+
* workspace). Each is the extension's own bag, shared across all its surfaces
|
|
399
|
+
* — status bar, side panels, and settings page — independent of whether any
|
|
400
|
+
* panel has mounted.
|
|
401
|
+
*
|
|
402
|
+
* `.get()` / `.set()` are safe to call in {@link Extension.activate}. Note the
|
|
403
|
+
* app state hydrates asynchronously and the `workspace` bag is swapped on
|
|
404
|
+
* workspace change, so a value persisted last session may not be present at
|
|
405
|
+
* the instant `activate` runs — `subscribe` and re-read to pick up restored or
|
|
406
|
+
* switched values. (`SidePanelProps.storage` exposes the same `workspace`
|
|
407
|
+
* scope keyed by panel id, for panel-local UI state.)
|
|
408
|
+
*/
|
|
409
|
+
readonly storage: ExtensionStorageScopes;
|
|
383
410
|
/** Register an {@link Editor} (a presenter for a file type's editor tab). */
|
|
384
411
|
registerEditor(editor: Editor): Disposable;
|
|
385
412
|
/** Register a {@link FileType} (declarative file metadata). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,
|
|
1
|
+
{"version":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,GAAG,OAAO;IACtC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;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"}
|
|
@@ -53,6 +53,41 @@ export interface WorkspaceSectionProvider {
|
|
|
53
53
|
/** Sort order among sections. Lower values appear first. Defaults to `0`. */
|
|
54
54
|
order?: number;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* A badge displayed next to the workspace name in the Workspaces side panel.
|
|
58
|
+
* Contributed by a {@link WorkspaceBadgeProvider}.
|
|
59
|
+
*
|
|
60
|
+
* @category Consumer Services
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface WorkspaceBadge {
|
|
64
|
+
/** Stable key unique within this provider's results; used for reconciliation. */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Short text rendered inside the badge. */
|
|
67
|
+
text: string;
|
|
68
|
+
/**
|
|
69
|
+
* CSS color applied to both the badge border and text. Falls back to the
|
|
70
|
+
* muted text color (`--silo-color-text-lo`) when omitted.
|
|
71
|
+
*/
|
|
72
|
+
color?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A badge provider that contributes {@link WorkspaceBadge}s next to the
|
|
76
|
+
* workspace name in the Workspaces side panel. Register via
|
|
77
|
+
* {@link WorkspaceService.registerBadge}.
|
|
78
|
+
*
|
|
79
|
+
* @category Consumer Services
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export interface WorkspaceBadgeProvider {
|
|
83
|
+
/** Unique id for this provider — conventionally `"<extension-id>.badges"`. */
|
|
84
|
+
id: string;
|
|
85
|
+
/**
|
|
86
|
+
* Called synchronously for each workspace during render. Return an empty
|
|
87
|
+
* array to contribute nothing for this workspace.
|
|
88
|
+
*/
|
|
89
|
+
provide(workspaceId: string): WorkspaceBadge[];
|
|
90
|
+
}
|
|
56
91
|
/**
|
|
57
92
|
* A decoration provider that contributes {@link WorkspaceStatusRow}s to
|
|
58
93
|
* workspace rows in the Workspaces side panel. Register via
|
|
@@ -213,5 +248,46 @@ export interface WorkspaceService {
|
|
|
213
248
|
* are added or removed.
|
|
214
249
|
*/
|
|
215
250
|
subscribeSection(listener: () => void): Disposable;
|
|
251
|
+
/**
|
|
252
|
+
* Register a badge provider that contributes {@link WorkspaceBadge}s next to
|
|
253
|
+
* the workspace name in the Workspaces side panel. Multiple providers may be
|
|
254
|
+
* registered; their badges are concatenated in registration order. Returns a
|
|
255
|
+
* {@link Disposable} that unregisters the provider.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* ctx.subscriptions.push(
|
|
260
|
+
* ctx.workspaces.registerBadge({
|
|
261
|
+
* id: "my-ext.badges",
|
|
262
|
+
* provide(workspaceId) {
|
|
263
|
+
* const status = getStatus(workspaceId);
|
|
264
|
+
* if (!status) return [];
|
|
265
|
+
* return [{ id: "status", text: status.label, color: status.color }];
|
|
266
|
+
* },
|
|
267
|
+
* }),
|
|
268
|
+
* );
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
registerBadge(provider: WorkspaceBadgeProvider): Disposable;
|
|
272
|
+
/**
|
|
273
|
+
* Concatenate all registered providers' badges for one workspace (in
|
|
274
|
+
* registration order). Called synchronously during panel render — providers
|
|
275
|
+
* must be fast and side-effect-free.
|
|
276
|
+
*/
|
|
277
|
+
getBadges(workspaceId: string): WorkspaceBadge[];
|
|
278
|
+
/**
|
|
279
|
+
* Signal that badge data has changed. Fires all listeners registered via
|
|
280
|
+
* {@link WorkspaceService.subscribeBadges}, causing the Workspaces panel to
|
|
281
|
+
* re-query providers and re-render the name row.
|
|
282
|
+
*
|
|
283
|
+
* Call this after any mutation to the state your `provide` function reads.
|
|
284
|
+
*/
|
|
285
|
+
invalidateBadges(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Subscribe to badge invalidations. The listener is called whenever
|
|
288
|
+
* {@link WorkspaceService.invalidateBadges} is invoked. Returns a
|
|
289
|
+
* {@link Disposable} that cancels the subscription.
|
|
290
|
+
*/
|
|
291
|
+
subscribeBadges(listener: () => void): Disposable;
|
|
216
292
|
}
|
|
217
293
|
//# 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;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACtD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kFAAkF;IAClF,EAAE,EAA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AC,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;IAEvD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,eAAe,CAAC,QAAQ,EAAE,wBAAwB,GAAG,UAAU,CAAC;IAEhE;;;;;;;OAOG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;IAEnD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,aAAa,CAAC,QAAQ,EAAE,sBAAsB,GAAG,UAAU,CAAC;IAE5D;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAAC;IAEjD;;;;;;OAMG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;CACnD"}
|
package/package.json
CHANGED
package/src/extension-storage.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Namespaced, persisted key/value storage handed to
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Namespaced, persisted key/value storage handed to extensions. Two scopes are
|
|
3
|
+
* exposed on {@link ExtensionContext.storage} ({@link ExtensionStorageScopes}):
|
|
4
|
+
* `global` (one bag per extension, shared across every workspace) and
|
|
5
|
+
* `workspace` (one bag per extension × the active workspace). Side panels also
|
|
6
|
+
* receive a workspace-scoped bag keyed by panel id via `SidePanelProps.storage`.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Values persist alongside the rest of the app state. The store hydrates
|
|
9
|
+
* asynchronously, and the workspace bag is swapped when the active workspace
|
|
10
|
+
* changes, so consumers that need to react to restored or switched values
|
|
11
|
+
* should {@link ExtensionStorage.subscribe | subscribe} and re-read.
|
|
9
12
|
*
|
|
10
13
|
* @category Consumer Services
|
|
11
14
|
* @public
|
|
@@ -16,10 +19,34 @@ export interface ExtensionStorage {
|
|
|
16
19
|
get<T>(key: string, fallback: T): T;
|
|
17
20
|
/** Write a value. `undefined` deletes the key. */
|
|
18
21
|
set(key: string, value: unknown): void;
|
|
22
|
+
/** The keys currently set in this namespace. */
|
|
23
|
+
keys(): string[];
|
|
19
24
|
/**
|
|
20
|
-
* Subscribe to changes in this namespace. Called
|
|
21
|
-
* namespace,
|
|
22
|
-
* (
|
|
25
|
+
* Subscribe to changes in this namespace. Called when a value in this
|
|
26
|
+
* namespace changes, when the underlying app state finishes hydrating, and
|
|
27
|
+
* (for the workspace scope) when the active workspace changes. Returns an
|
|
28
|
+
* unsubscribe function.
|
|
23
29
|
*/
|
|
24
30
|
subscribe(listener: () => void): () => void;
|
|
25
31
|
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The two persisted-storage scopes available to an extension, exposed as
|
|
35
|
+
* {@link ExtensionContext.storage}.
|
|
36
|
+
*
|
|
37
|
+
* @category Consumer Services
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export interface ExtensionStorageScopes {
|
|
41
|
+
/**
|
|
42
|
+
* Per-extension storage shared across **all** workspaces — the place for
|
|
43
|
+
* an extension's own settings (enabled features, layout choices, etc.).
|
|
44
|
+
*/
|
|
45
|
+
readonly global: ExtensionStorage;
|
|
46
|
+
/**
|
|
47
|
+
* Per-extension storage scoped to the **active workspace** — the place for
|
|
48
|
+
* state that should differ per workspace (last selection, per-project
|
|
49
|
+
* toggles). The bag is swapped when the active workspace changes.
|
|
50
|
+
*/
|
|
51
|
+
readonly workspace: ExtensionStorage;
|
|
52
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,8 @@ export type {
|
|
|
54
54
|
WorkspaceDecorationProvider,
|
|
55
55
|
WorkspaceSectionProps,
|
|
56
56
|
WorkspaceSectionProvider,
|
|
57
|
+
WorkspaceBadge,
|
|
58
|
+
WorkspaceBadgeProvider,
|
|
57
59
|
} from "./workspace-service";
|
|
58
60
|
export type {
|
|
59
61
|
EditorService,
|
|
@@ -114,7 +116,10 @@ export type {
|
|
|
114
116
|
CustomTheme,
|
|
115
117
|
ThemeExport,
|
|
116
118
|
} from "./theme-service";
|
|
117
|
-
export type {
|
|
119
|
+
export type {
|
|
120
|
+
ExtensionStorage,
|
|
121
|
+
ExtensionStorageScopes,
|
|
122
|
+
} from "./extension-storage";
|
|
118
123
|
// The drag-and-drop domain: the consumer service + its payload/handler shapes.
|
|
119
124
|
// DND_MIME is a value (the well-known MIME vocabulary), so it's a runtime export.
|
|
120
125
|
export type {
|
package/src/types.ts
CHANGED
|
@@ -31,7 +31,10 @@ import type { ThemeService, ThemePreset } from "./theme-service";
|
|
|
31
31
|
import type { DndService } from "./dnd-service";
|
|
32
32
|
import type { UiService } from "./ui-service";
|
|
33
33
|
import type { NetworkService } from "./network-service";
|
|
34
|
-
import type {
|
|
34
|
+
import type {
|
|
35
|
+
ExtensionStorage,
|
|
36
|
+
ExtensionStorageScopes,
|
|
37
|
+
} from "./extension-storage";
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
40
|
* The teardown handle returned by every `register*` call on
|
|
@@ -268,9 +271,12 @@ export interface SidePanelProps {
|
|
|
268
271
|
/** True when this side panel is currently visible / selected in its column. */
|
|
269
272
|
active: boolean;
|
|
270
273
|
/**
|
|
271
|
-
* Namespaced, persisted key/value storage scoped to this panel id
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
+
* Namespaced, persisted key/value storage scoped to this panel id (the
|
|
275
|
+
* `workspace` scope of {@link ExtensionStorageScopes}, keyed by panel rather
|
|
276
|
+
* than extension). Use for **panel-local UI state** — scroll positions,
|
|
277
|
+
* selections, expanded sections, etc. — which is kept per workspace. For
|
|
278
|
+
* extension-level settings shared across surfaces and workspaces, use
|
|
279
|
+
* {@link ExtensionContext.storage}`.global` instead.
|
|
274
280
|
*/
|
|
275
281
|
storage: ExtensionStorage;
|
|
276
282
|
/**
|
|
@@ -338,6 +344,14 @@ export interface DockPanelKind {
|
|
|
338
344
|
/**
|
|
339
345
|
* A widget in the status bar (the strip along the bottom of the window).
|
|
340
346
|
*
|
|
347
|
+
* @remarks
|
|
348
|
+
* The status bar container sets `font-size` and `color` on itself, so
|
|
349
|
+
* components rendered inside it inherit the correct values automatically —
|
|
350
|
+
* **do not override `font-size` or `font-family`** in status item CSS unless
|
|
351
|
+
* you have a deliberate reason to deviate. You may override `color` using
|
|
352
|
+
* design tokens (e.g. `--silo-color-text-lo` for a label / `--silo-color-text`
|
|
353
|
+
* for a value) to create visual distinctions within an item.
|
|
354
|
+
*
|
|
341
355
|
* @category Registration
|
|
342
356
|
* @public
|
|
343
357
|
*/
|
|
@@ -399,6 +413,22 @@ export interface ExtensionContext {
|
|
|
399
413
|
readonly extensionId: string;
|
|
400
414
|
/** Disposables tracked for this extension; the host disposes them on teardown. */
|
|
401
415
|
readonly subscriptions: Disposable[];
|
|
416
|
+
/**
|
|
417
|
+
* Persisted, per-extension key/value storage, in two scopes
|
|
418
|
+
* ({@link ExtensionStorageScopes}): `global` (shared across all workspaces —
|
|
419
|
+
* for the extension's own settings) and `workspace` (scoped to the active
|
|
420
|
+
* workspace). Each is the extension's own bag, shared across all its surfaces
|
|
421
|
+
* — status bar, side panels, and settings page — independent of whether any
|
|
422
|
+
* panel has mounted.
|
|
423
|
+
*
|
|
424
|
+
* `.get()` / `.set()` are safe to call in {@link Extension.activate}. Note the
|
|
425
|
+
* app state hydrates asynchronously and the `workspace` bag is swapped on
|
|
426
|
+
* workspace change, so a value persisted last session may not be present at
|
|
427
|
+
* the instant `activate` runs — `subscribe` and re-read to pick up restored or
|
|
428
|
+
* switched values. (`SidePanelProps.storage` exposes the same `workspace`
|
|
429
|
+
* scope keyed by panel id, for panel-local UI state.)
|
|
430
|
+
*/
|
|
431
|
+
readonly storage: ExtensionStorageScopes;
|
|
402
432
|
/** Register an {@link Editor} (a presenter for a file type's editor tab). */
|
|
403
433
|
registerEditor(editor: Editor): Disposable;
|
|
404
434
|
/** Register a {@link FileType} (declarative file metadata). */
|
package/src/workspace-service.ts
CHANGED
|
@@ -59,6 +59,43 @@ export interface WorkspaceSectionProvider {
|
|
|
59
59
|
order?: number;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* A badge displayed next to the workspace name in the Workspaces side panel.
|
|
64
|
+
* Contributed by a {@link WorkspaceBadgeProvider}.
|
|
65
|
+
*
|
|
66
|
+
* @category Consumer Services
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export interface WorkspaceBadge {
|
|
70
|
+
/** Stable key unique within this provider's results; used for reconciliation. */
|
|
71
|
+
id: string;
|
|
72
|
+
/** Short text rendered inside the badge. */
|
|
73
|
+
text: string;
|
|
74
|
+
/**
|
|
75
|
+
* CSS color applied to both the badge border and text. Falls back to the
|
|
76
|
+
* muted text color (`--silo-color-text-lo`) when omitted.
|
|
77
|
+
*/
|
|
78
|
+
color?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A badge provider that contributes {@link WorkspaceBadge}s next to the
|
|
83
|
+
* workspace name in the Workspaces side panel. Register via
|
|
84
|
+
* {@link WorkspaceService.registerBadge}.
|
|
85
|
+
*
|
|
86
|
+
* @category Consumer Services
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export interface WorkspaceBadgeProvider {
|
|
90
|
+
/** Unique id for this provider — conventionally `"<extension-id>.badges"`. */
|
|
91
|
+
id: string;
|
|
92
|
+
/**
|
|
93
|
+
* Called synchronously for each workspace during render. Return an empty
|
|
94
|
+
* array to contribute nothing for this workspace.
|
|
95
|
+
*/
|
|
96
|
+
provide(workspaceId: string): WorkspaceBadge[];
|
|
97
|
+
}
|
|
98
|
+
|
|
62
99
|
/**
|
|
63
100
|
* A decoration provider that contributes {@link WorkspaceStatusRow}s to
|
|
64
101
|
* workspace rows in the Workspaces side panel. Register via
|
|
@@ -228,4 +265,49 @@ export interface WorkspaceService {
|
|
|
228
265
|
* are added or removed.
|
|
229
266
|
*/
|
|
230
267
|
subscribeSection(listener: () => void): Disposable;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Register a badge provider that contributes {@link WorkspaceBadge}s next to
|
|
271
|
+
* the workspace name in the Workspaces side panel. Multiple providers may be
|
|
272
|
+
* registered; their badges are concatenated in registration order. Returns a
|
|
273
|
+
* {@link Disposable} that unregisters the provider.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* ctx.subscriptions.push(
|
|
278
|
+
* ctx.workspaces.registerBadge({
|
|
279
|
+
* id: "my-ext.badges",
|
|
280
|
+
* provide(workspaceId) {
|
|
281
|
+
* const status = getStatus(workspaceId);
|
|
282
|
+
* if (!status) return [];
|
|
283
|
+
* return [{ id: "status", text: status.label, color: status.color }];
|
|
284
|
+
* },
|
|
285
|
+
* }),
|
|
286
|
+
* );
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
registerBadge(provider: WorkspaceBadgeProvider): Disposable;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Concatenate all registered providers' badges for one workspace (in
|
|
293
|
+
* registration order). Called synchronously during panel render — providers
|
|
294
|
+
* must be fast and side-effect-free.
|
|
295
|
+
*/
|
|
296
|
+
getBadges(workspaceId: string): WorkspaceBadge[];
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Signal that badge data has changed. Fires all listeners registered via
|
|
300
|
+
* {@link WorkspaceService.subscribeBadges}, causing the Workspaces panel to
|
|
301
|
+
* re-query providers and re-render the name row.
|
|
302
|
+
*
|
|
303
|
+
* Call this after any mutation to the state your `provide` function reads.
|
|
304
|
+
*/
|
|
305
|
+
invalidateBadges(): void;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Subscribe to badge invalidations. The listener is called whenever
|
|
309
|
+
* {@link WorkspaceService.invalidateBadges} is invoked. Returns a
|
|
310
|
+
* {@link Disposable} that cancels the subscription.
|
|
311
|
+
*/
|
|
312
|
+
subscribeBadges(listener: () => void): Disposable;
|
|
231
313
|
}
|