Project format updates

This commit is contained in:
Peter Willemsen
2026-11-30 17:25:03 +01:00
parent 563d1992a2
commit 4822a697bf
11 changed files with 425 additions and 111 deletions
+8 -8
View File
@@ -1,8 +1,8 @@
# ISA Project format
Version 1 is a dashboard-backed `<name>.isap` folder containing `project.json`, `extensions/<extension-id>/` and `assets/`. The manifest contains `formatVersion: 1`, stable `id`, display `name`, and UTC `createdAt`/`updatedAt` timestamps. Canonical dashboard folder IDs are storage identities; names and paths do not grant access. Imports allocate a new identity and folder.
Version 1 is an ordinary workspace `<name>.isap` folder containing `project.json`, `extensions/<extension-id>/` and `assets/`. The manifest contains `formatVersion: 1`, stable `id`, display `name`, UTC `createdAt`/`updatedAt` timestamps, and optional `archived` state. Canonical dashboard folder IDs are storage identities; names and paths do not grant access. Imports allocate a new identity and folder.
Extension namespaces organize data and are not permission boundaries. A project read-write grant permits supported edits across namespaces. Preserve unknown manifest fields, files and extension data. Each extension documents its canonical data; ISA Projects owns planning and detailed progress. Common summaries live in `extensions/<extension-id>/status.json` with `schemaVersion: 1`, `status` (`not-started`, `in-progress`, `blocked`, `complete`), `updatedAt`, and optional `completion` between 0 and 100. Summary data is editable project content and never grants publishing authority.
Extension namespaces organize data and are not permission boundaries. An ordinary writable folder grant permits supported edits across namespaces. Preserve unknown manifest fields, files and extension data. Each extension documents its canonical data; ISA Projects owns planning and detailed progress. Common summaries live in `extensions/<extension-id>/status.json` with `schemaVersion: 1`, `status` (`not-started`, `in-progress`, `blocked`, `complete`), `updatedAt`, and optional `completion` between 0 and 100. Summary data is editable project content and never grants publishing authority.
## Public APIs
@@ -15,7 +15,7 @@ import { mountProjectWorkspace } from '@isa-warden/isa-project-format/dom';
const client = createProjectClient({
bridge,
extensionId: 'example',
projectCommands: appInfo.projects?.commands,
filesystemCommands: appInfo.filesystem?.commands,
scope: { workspaceId, groupId }
});
const view = mountProjectWorkspace(target, { client, bridge, extensionName: 'Example', locale: 'en' });
@@ -24,17 +24,17 @@ view.destroy();
await client.close();
```
The shared UI provides a searchable group project overview, recent activity, project creation, an active-project header, file/media browsing, transfer actions and a Tauri-compatible HTML confirmation for dirty project switches. English and Dutch labels are included. It inherits ISA extension theme tokens; detailed application workflows and planning remain in the extension. Components consume a captured client instance: remount with a new client when the launch context changes.
The shared UI provides a searchable project overview, recent activity, project creation, an active-project header, file/media browsing, transfer actions and a Tauri-compatible HTML confirmation for dirty project switches. English and Dutch labels are included. It inherits ISA extension theme tokens; detailed application workflows and planning remain in the extension. Components consume a captured client instance: remount with a new client when the launch context changes.
`client.activate(reference)` opens a listed or recent reference by reading its manifest through an existing grant. `client.create(name, operationId?)` uses host creation and retains its operation ID through uncertain retries in the current client. Callers with durable recovery journals should provide their persisted operation ID. Recent references are private, launch-scoped host preferences rather than canonical project state. Preference failures are observable on `session.preferenceError` and do not invalidate an already committed creation/switch.
`client.activate(reference)` opens a listed or recent reference by reading its manifest through an existing grant. `client.create(name, operationId?)` creates an ordinary folder and publishes its manifest after the standard subdirectories exist. It retains the same operation ID and folder through uncertain retries in the current client. Callers with durable recovery journals should provide their persisted operation ID. Recent references are private, launch-scoped host preferences rather than canonical project state. Preference failures are observable on `session.preferenceError` and do not invalidate an already committed creation/switch.
Sessions capture their project path and abort signal. `readJson` returns an authoritative CAS base; `writeJson(relative, value, base, {operationId?})` requires that same file’s base and sends its revision/hash. `ensureDirectory(relative)` creates real parent directories in order; `openKv` does this for its parent before opening a store. `openKv`, `applyKv` and `subscribeKv` use the captured project destination. Use `extensionPath` for extension-owned paths, `publishStatus` for summaries and `readStatuses` for the overview. Subscriptions and registered cleanup callbacks close on switching; late results cannot use a retired session. Mark unsaved work with `session.markDirty()`. Without explicit confirmation, dirty sessions block switching. Mounting the shared UI supplies a confirmation; applications can provide `beforeSwitch` to integrate an existing save/discard workflow.
Sessions capture their project path and abort signal. `readJson` returns an authoritative CAS base; `writeJson(relative, value, base, {operationId?})` requires that same file’s base and sends its revision/hash. `ensureDirectory(relative)` creates real parent directories in order; `openKv` does this for its parent before opening a store. A requested synchronized store uses offline storage when the granted parent is synchronized. Otherwise, new stores use the ordinary online filesystem contract. `openKv`, `applyKv` and `subscribeKv` use the captured project destination. Use `extensionPath` for extension-owned paths, `publishStatus` for summaries and `readStatuses` for the overview. Subscriptions and registered cleanup callbacks close on switching; late results cannot use a retired session. Mark unsaved work with `session.markDirty()`. Without explicit confirmation, dirty sessions block switching. Mounting the shared UI supplies a confirmation; applications can provide `beforeSwitch` to integrate an existing save/discard workflow.
## Project start screen
Use the ISA Match layout for a project-based extension. Show recent activity on the left and **Projects** (**Projecten**) on the right. Place **+ Create project** at the top right of the Projects panel. Populate this list on launch with `await client.list()`, which returns active shared projects for the launch group, including ones this extension has never used. `client.recent()` supplies optional personal shortcuts. Use the project rows to open existing projects and the create button to launch the setup form.
Use the ISA Match layout for a project-based extension. Show recent activity on the left and **Projects** (**Projecten**) on the right. Place **+ Create project** at the top right of the Projects panel. Populate this list on launch with `await client.list()`, which returns active projects discovered in the folders selected by the user. `client.recent()` supplies optional personal shortcuts. Use the project rows to open existing projects and the create button to launch the setup form.
Use the shared `ProjectWorkspace` or `mountProjectWorkspace` overview with the extension’s display name, locale and launch-scoped client. Pass `projectCommands: appInfo.projects?.commands` to the client. Custom overviews call `client.list()` and `client.openListed(row)`. Declare `projects_open_listed`, `projects_read` and `filesystem_read` for direct access. On older hosts the client reads the selected folder using its existing grant. If access is unavailable, the overview shows the error and keeps the project list available. Only explicit creation calls `client.create(name, operationId)`.
Use the shared `ProjectWorkspace` or `mountProjectWorkspace` with the extension display name, locale and launch-scoped client. Custom overviews call `client.pickFolder()` from a user action and refresh `client.list()` after a selection. The picker can select a container such as `/shared` or a single existing `.isap` folder. The extension remembers selected paths for the launch scope and reads only through its ordinary filesystem grants. Use `client.openListed(row)` to reopen a project, `client.create(name, operationId)` to create it in an editable container, and `client.setArchived(row, archived)` to update the manifest. Extensions need the host permissions for filesystem reads, optional writes, and private preferences.
Every project extension initializes its own data when a writable project first opens. The client ensures the extension directory exists, and the extension opens its workspace with the stored data. For a JSON-backed workspace, call `await session.ensureExtensionJson('data/current.json', () => initialState(session.manifest.name))` using the extension’s canonical relative path and default schema. The result includes the saved JSON value and version. The helper creates missing parents, uses a create-only write, and reads the committed record even if another client created it. An absent record on a read-only or archived project returns `status: 'absent'`. Unavailable or malformed data raises an error.