@silo-code/sdk 0.21.0 → 0.22.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.
Files changed (45) hide show
  1. package/dist/editor-service.d.ts +135 -3
  2. package/dist/editor-service.d.ts.map +1 -1
  3. package/dist/event.d.ts +28 -0
  4. package/dist/event.d.ts.map +1 -0
  5. package/dist/event.js +2 -0
  6. package/dist/event.js.map +1 -0
  7. package/dist/file-service.d.ts +33 -2
  8. package/dist/file-service.d.ts.map +1 -1
  9. package/dist/index.d.ts +15 -7
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +15 -5
  12. package/dist/index.js.map +1 -1
  13. package/dist/network-service.d.ts +46 -2
  14. package/dist/network-service.d.ts.map +1 -1
  15. package/dist/path.d.ts +62 -0
  16. package/dist/path.d.ts.map +1 -0
  17. package/dist/path.js +150 -0
  18. package/dist/path.js.map +1 -0
  19. package/dist/process-service.d.ts +24 -4
  20. package/dist/process-service.d.ts.map +1 -1
  21. package/dist/processes-service.d.ts +1 -1
  22. package/dist/search-service.d.ts +11 -0
  23. package/dist/search-service.d.ts.map +1 -1
  24. package/dist/system-service.d.ts +2 -2
  25. package/dist/terminal-service.d.ts +37 -0
  26. package/dist/terminal-service.d.ts.map +1 -1
  27. package/dist/types.d.ts +12 -5
  28. package/dist/types.d.ts.map +1 -1
  29. package/dist/workspace-service.d.ts +13 -0
  30. package/dist/workspace-service.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/src/editor-service.ts +141 -5
  33. package/src/event.ts +28 -0
  34. package/src/file-service.ts +33 -2
  35. package/src/index.ts +24 -5
  36. package/src/network-service.ts +51 -2
  37. package/src/path.test.ts +135 -0
  38. package/src/path.ts +188 -0
  39. package/src/process-service.ts +24 -4
  40. package/src/processes-service.ts +1 -1
  41. package/src/search-service.ts +11 -0
  42. package/src/system-service.ts +2 -2
  43. package/src/terminal-service.ts +40 -0
  44. package/src/types.ts +12 -5
  45. package/src/workspace-service.ts +13 -0
package/src/types.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
- * The Silo extension API — types only.
2
+ * The Silo extension API — types-first contract plus a small set of blessed
3
+ * runtime helpers.
3
4
  *
4
5
  * Everything an extension author can see at compile time lives here (plus the
5
6
  * service interfaces in the sibling `*-service` files, which this module
@@ -8,6 +9,12 @@
8
9
  * never import the host. This is the VS Code (`vscode.d.ts`) / Obsidian
9
10
  * (`obsidian-api`) model.
10
11
  *
12
+ * **Runtime exports:** the SDK also ships a small set of blessed runtime
13
+ * helpers (`Tooltip`, `useFocusGroup`, `useServiceState`, `DND_MIME`,
14
+ * `PathDeniedError`, `NetworkError`) and peer-depends on React 19. Changes to
15
+ * these can be breaking even when the types are unchanged — treat them with
16
+ * the same care as the type surface.
17
+ *
11
18
  * Start with {@link Extension} (the unit you export) and
12
19
  * {@link ExtensionContext} (the `ctx` the host hands you).
13
20
  *
@@ -207,10 +214,10 @@ export interface NewFileTemplate {
207
214
 
208
215
  /**
209
216
  * Declarative metadata about a file extension — the open-ended counterpart to
210
- * Viewer (which is purely a renderer). A single source of truth that "New File"
211
- * surfaces (and, later, tab/explorer icons) can enumerate. Registering a
212
- * FileType does not register a viewer; the two are matched independently by
213
- * extension at dispatch time.
217
+ * {@link Editor} (which is purely a presenter/renderer). A single source of
218
+ * truth that "New File" surfaces (and, later, tab/explorer icons) can
219
+ * enumerate. Registering a FileType does not register an Editor; the two are
220
+ * matched independently by extension at dispatch time.
214
221
  *
215
222
  * @category Registration
216
223
  * @public
@@ -170,6 +170,12 @@ export interface WorkspaceService {
170
170
  createFromFolderPicker(): Promise<Workspace | null>;
171
171
  create(input: CreateWorkspaceInput): Workspace;
172
172
  rename(id: string, name: string): void;
173
+ /**
174
+ * Move a workspace to a new position relative to a reference workspace.
175
+ * @param from - Id of the workspace being dragged / moved.
176
+ * @param to - Id of the reference workspace (the insertion anchor).
177
+ * @param position - Whether to place `from` before or after `to`.
178
+ */
173
179
  reorder(from: string, to: string, position: "before" | "after"): void;
174
180
  /** Activate (and reopen if closed). */
175
181
  activate(id: string): void;
@@ -263,6 +269,13 @@ export interface WorkspaceService {
263
269
  *
264
270
  * The Workspaces panel subscribes internally to re-render when providers
265
271
  * are added or removed.
272
+ *
273
+ * **No `invalidateSection` by design.** Unlike status rows and badges, a
274
+ * section is a live React component that re-renders on its own internal or
275
+ * context-driven state changes — it is not a snapshot returned from a
276
+ * `provide()` call, so there is nothing for the host to re-query. If a
277
+ * section needs to trigger a full workspace-panel refresh (rare), it should
278
+ * update its own state directly.
266
279
  */
267
280
  subscribeSection(listener: () => void): Disposable;
268
281