@almadar/workspace 0.7.0 → 0.9.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/service.d.ts CHANGED
@@ -27,13 +27,19 @@ export declare class WorkspaceServiceImpl implements WorkspaceService {
27
27
  private readonly backend;
28
28
  private readonly sinks;
29
29
  private readonly git;
30
- private readonly github;
30
+ private github;
31
31
  /** Per-absolute-path serial queue. */
32
32
  private readonly writeQueue;
33
33
  readonly index: WorkspaceIndex;
34
34
  constructor(args: ServiceCtorArgs);
35
35
  get appId(): string | undefined;
36
36
  setAppId(id: string): void;
37
+ /**
38
+ * Set (or clear) the GitHub config after open. Lets a consumer resolve the
39
+ * link/token lazily — e.g. from a workspace file read post-open — and wire
40
+ * `commitAndPush`/`pullIfLinked` without knowing it at construction time.
41
+ */
42
+ setGitHub(config: GitHubConfig | undefined): void;
37
43
  /** Run `op` under a per-path serial lock. */
38
44
  private withLock;
39
45
  /** Make sure the parent directory of `absPath` exists. */
@@ -74,6 +80,7 @@ export declare class WorkspaceServiceImpl implements WorkspaceService {
74
80
  clearCompiled(): Promise<void>;
75
81
  readFile(relPath: string): Promise<string | null>;
76
82
  writeFile(relPath: string, content: string): Promise<void>;
83
+ removeFile(relPath: string): Promise<void>;
77
84
  listTree(relPath?: string): Promise<FileTreeNode[]>;
78
85
  exists(relPath: string): Promise<boolean>;
79
86
  commitAndPush(opts: {
package/dist/types.d.ts CHANGED
@@ -90,6 +90,9 @@ export type WorkspaceWriteEvent = {
90
90
  kind: 'file';
91
91
  relPath: string;
92
92
  content: string;
93
+ } | {
94
+ kind: 'file-removed';
95
+ relPath: string;
93
96
  } | {
94
97
  kind: 'workspace-index';
95
98
  orbital: string;
@@ -233,6 +236,8 @@ export interface WorkspaceService {
233
236
  readonly appId: string | undefined;
234
237
  readonly workDir: string;
235
238
  setAppId(id: string): void;
239
+ /** Set/clear the GitHub config post-open (resolve link/token lazily, then wire push/pull). */
240
+ setGitHub(config: GitHubConfig | undefined): void;
236
241
  readOrbital(name: string): string | null;
237
242
  writeOrbital(name: string, content: string): Promise<void>;
238
243
  listOrbitals(): string[];
@@ -274,6 +279,8 @@ export interface WorkspaceService {
274
279
  clearCompiled(): Promise<void>;
275
280
  readFile(relPath: string): Promise<string | null>;
276
281
  writeFile(relPath: string, content: string): Promise<void>;
282
+ /** Delete a sandboxed file and emit a `file-removed` event (unmirrors downstream). No-op if absent. */
283
+ removeFile(relPath: string): Promise<void>;
277
284
  listTree(relPath?: string): Promise<FileTreeNode[]>;
278
285
  exists(relPath: string): Promise<boolean>;
279
286
  commitAndPush(opts: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/workspace",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Storage-agnostic workspace primitives shared by Almadar consumers. One service, six exports, hidden paths, single observer. See docs/Almadar_Workspace.md.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",