@almadar/workspace 0.11.1 → 0.11.3

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
@@ -7,7 +7,7 @@
7
7
  * @packageDocumentation
8
8
  */
9
9
  import type { JsonObject, JsonValue } from '@almadar/core';
10
- import type { FileTreeNode, GitHubConfig, GitStatusInfo, SnapshotMeta, WorkspaceArchiveBackend, WorkspaceObserver, WorkspaceService, WorkspaceWatchEvent } from './types.js';
10
+ import type { FileTreeNode, GitHubConfig, GitStatusInfo, InstantiateWorkspaceSeed, SnapshotMeta, WorkspaceArchiveBackend, WorkspaceObserver, WorkspaceService, WorkspaceWatchEvent } from './types.js';
11
11
  import type { WorkspaceBackend } from './internal/types.js';
12
12
  import { SinkManager } from './internal/sink-manager.js';
13
13
  import { GitClient } from './internal/git-client.js';
@@ -55,6 +55,7 @@ export declare class WorkspaceServiceImpl implements WorkspaceService {
55
55
  renameOrbitalSession(from: string, to: string): Promise<void>;
56
56
  readSchema(): string | null;
57
57
  writeSchema(content: string): Promise<void>;
58
+ instantiateWorkspace(seed: InstantiateWorkspaceSeed): Promise<void>;
58
59
  readAnalysis<T extends JsonObject>(): T | null;
59
60
  writeAnalysis<T extends JsonObject>(analysis: T): Promise<void>;
60
61
  readPlan<T extends JsonObject>(): T | null;
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- import type { JsonObject, JsonValue } from '@almadar/core';
9
+ import type { JsonObject, JsonValue, OrbitalSchema } from '@almadar/core';
10
10
  import type { ProviderConfig } from '@almadar/llm';
11
11
  import type { EmbedderPort, WorkspaceIndex } from './workspace-index/types.js';
12
12
  /**
@@ -252,6 +252,21 @@ export interface WorkspaceSummary {
252
252
  * observer. The service stays neutral — it serializes JSON and emits typed
253
253
  * `WorkspaceWriteEvent`s.
254
254
  */
255
+ /**
256
+ * Input for {@link WorkspaceService.instantiateWorkspace}. `schema` /
257
+ * `composedSchema` are `OrbitalSchema`s the caller already built (the on-disk
258
+ * `.orb` format is always an `OrbitalSchema`); `spec` / `planSnapshot` are
259
+ * JSON-shaped and ride the generic `writeSpec` / `writePlan` writers.
260
+ */
261
+ export interface InstantiateWorkspaceSeed {
262
+ orbitals: ReadonlyArray<{
263
+ name: string;
264
+ spec: JsonObject;
265
+ schema: OrbitalSchema;
266
+ }>;
267
+ composedSchema: OrbitalSchema;
268
+ planSnapshot: JsonObject;
269
+ }
255
270
  export interface WorkspaceService {
256
271
  readonly appId: string | undefined;
257
272
  readonly workDir: string;
@@ -273,6 +288,17 @@ export interface WorkspaceService {
273
288
  renameOrbitalSession(from: string, to: string): Promise<void>;
274
289
  readSchema(): string | null;
275
290
  writeSchema(content: string): Promise<void>;
291
+ /**
292
+ * Seed a complete, coordinator-adoptable workspace in one call from
293
+ * already-built artifacts: writes each orbital's `.orb` + per-orbital
294
+ * `spec.json`, the composed `schema.orb`, and the Coordinator plan snapshot.
295
+ * After this, a fresh `runCoordinator` turn against this workDir sees the
296
+ * orbitals as already-built (via their specs + the plan snapshot) and
297
+ * *iterates* them rather than rebuilding. Pure fs over the writers above —
298
+ * the caller materialises the schemas (e.g. via the std factory +
299
+ * `@almadar/core`'s `composeBehaviors`); this package never invokes a factory.
300
+ */
301
+ instantiateWorkspace(seed: InstantiateWorkspaceSeed): Promise<void>;
276
302
  readAnalysis<T extends JsonObject>(): T | null;
277
303
  writeAnalysis<T extends JsonObject>(analysis: T): Promise<void>;
278
304
  readPlan<T extends JsonObject>(): T | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/workspace",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
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",
@@ -36,7 +36,8 @@
36
36
  "@typescript-eslint/parser": "8.56.0",
37
37
  "eslint": "^10.0.0",
38
38
  "tsup": "^8.0.0",
39
- "vitest": "^3.2.4"
39
+ "vitest": "^3.2.4",
40
+ "turbo": "^2.8.17"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "tsup && tsc --declaration --emitDeclarationOnly --outDir dist --rootDir src --skipLibCheck || true",