@almadar/workspace 0.3.0 → 0.4.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/__tests__/list-workspaces.test.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +41 -3
- package/dist/index.js.map +1 -1
- package/dist/list-workspaces.d.ts +14 -0
- package/dist/types.d.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `listWorkspaces` — enumerate the app-workspaces a user has under a root.
|
|
3
|
+
*
|
|
4
|
+
* The single source for "which projects exist locally": scans
|
|
5
|
+
* `<root>/<userId>/*` for dirs carrying an `app-marker.json` (minted or
|
|
6
|
+
* adopted-as-app workspaces) and reports `{ appId, workDir, name?, updatedAt? }`.
|
|
7
|
+
* Bare-adopted loose files (no marker) are intentionally excluded — they aren't
|
|
8
|
+
* projects. Consumers (apps/builder's offline AppStore, orbital-agent-cli) use
|
|
9
|
+
* this instead of fs-scanning the layout themselves.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import type { ListWorkspacesOptions, WorkspaceSummary } from './types.js';
|
|
14
|
+
export declare function listWorkspaces(opts: ListWorkspacesOptions): Promise<WorkspaceSummary[]>;
|
package/dist/types.d.ts
CHANGED
|
@@ -190,6 +190,26 @@ export interface OpenWorkspaceOptions {
|
|
|
190
190
|
*/
|
|
191
191
|
embedder?: EmbedderPort;
|
|
192
192
|
}
|
|
193
|
+
/** Input for {@link listWorkspaces}. */
|
|
194
|
+
export interface ListWorkspacesOptions {
|
|
195
|
+
/** Workspaces root, e.g. `/workspaces` — user dirs nest under it. */
|
|
196
|
+
root: string;
|
|
197
|
+
/** Owning user id. */
|
|
198
|
+
userId: string;
|
|
199
|
+
/** Storage selector. `'memory'` is for tests; `'local'` is default. */
|
|
200
|
+
backend?: 'local' | 'memory';
|
|
201
|
+
}
|
|
202
|
+
/** One project workspace returned by {@link listWorkspaces}. */
|
|
203
|
+
export interface WorkspaceSummary {
|
|
204
|
+
/** Pinned app id from `.almadar/app-marker.json`. */
|
|
205
|
+
appId: string;
|
|
206
|
+
/** Absolute workspace directory. */
|
|
207
|
+
workDir: string;
|
|
208
|
+
/** Schema display name (`schema.orb` `name`), when present. */
|
|
209
|
+
name?: string;
|
|
210
|
+
/** `schema.orb` mtime if present, else the marker's `createdAt`. */
|
|
211
|
+
updatedAt?: number;
|
|
212
|
+
}
|
|
193
213
|
/**
|
|
194
214
|
* The single workspace I/O surface. Every consumer (rabit, apps/builder,
|
|
195
215
|
* cli, future tools) operates through this. Methods are grouped per
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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",
|