Document group project discovery and folder access for extensions

This commit is contained in:
Sander Grootendorst
2026-12-01 10:09:43 +01:00
parent 5d9b44150e
commit cbec3262f5
2 changed files with 24 additions and 0 deletions
@@ -481,6 +481,22 @@ The result contains active projects by default, ordered by most recent update, t
For a click on a project row, call `bridge.invoke('projects_open_listed', { projectId: row.id })`. The installed extension must declare `projects_read`, `filesystem_read` and `projects_open_listed`. Check the command in `get_app_info().projects.commands`. The host resolves the ID in the authenticated launch group and returns the current folder reference and access grant. An archived or unlinked project, revoked access, or a failed read leaves the overview open. Older extensions that call the retired `projects_open` command receive `{ status: "cancelled", project: null }`.
### `projects_open_extension`
Use this command when someone selects a project action that belongs to another extension. The source needs the permissions for `projects_open_listed` plus `group_extensions_read`. Query `get_app_info().projectNavigation.commands` before offering navigation. The target needs the permissions for `projects_open_listed`.
```js
await bridge.invoke('projects_open_extension', {
projectId: session.project.id,
extensionId: 'isa-match-rsx-to-quote',
actionId: 'supplier'
});
```
Pass the canonical folder ID from the current project session, the target's manifest ID and its stable action key. Action keys start with an ASCII letter or digit and may contain letters, digits, periods, underscores, colons and hyphens, up to 128 characters. The host resolves the target from the source's current group, verifies the active project under both packages and supplies the verified project ID to the target. Desktop opens or focuses the target's dedicated extension window. The dashboard web UI opens a verified extension launch in the current shell. The response contains `status: 'opened'` and `requestId`.
The target subscribes to `bridge.on('project-navigation', handler)` before its first `get_app_info` request. It also reads `info.projectNavigation?.pending` on startup. Both supply `{ requestId, projectId, actionId }`. Deduplicate by request ID, recognize the action key, and open the project using the target's own session and ordinary unsaved-change handling. Use only recognized local routes. Project navigation should show the relevant work and leave any workflow mutation to an explicit user action.
### `projects_create`
Request:
@@ -80,6 +80,14 @@ Use `projects_create` when the user explicitly creates a shared project, reusing
**Verify with two extensions in the same group.** Create a project in A, then open it from B with empty recents. Confirm B opens its initialized workspace on the first click. Reopen in B and verify that its saved record is reused and A’s data is intact. Check simultaneous first opens, a read-only grant and a failed dashboard read. Both extensions should list one shared project with the original ID. An unlinked group must have no access.
### Share project actions with ISA Projects
Publish workflow steps and task handoffs with `publishProjectActions(session, {extensionId, extensionName, sourceRevision, actions})` from `@isa-warden/isa-project-format` 1.2 or later. The provider writes one versioned document at `extensions/<manifest-id>/actions/v1.json` inside the open project. The helper captures the workspace and portable project identity, validates the actions and writes conditionally. Use a monotonically increasing revision of the confirmed source data and a stable key for each action. Reopening an existing project should publish its current data.
Each action carries `key`, `kind`, and `title`. A linked action adds `openCount` and `unit`. Publish zero to finish existing work and a positive count to reopen it. ISA Match uses one action per workflow step. A handoff represents one accepted commitment that Projects owns after import. Both kinds support plain-text `detail`, localized `translations`, and an optional semantic `route` for opening the source view. Projects updates the same board task across refreshes and preserves the team's scheduling and comments.
Consumers call `readProjectActions(session)`. Process valid sources independently, retain the last usable tasks on missing or unreadable data, and use `projectActionText(action, locale)` for display. Source identity consists of workspace, manifest project ID, provider manifest ID and action key. Groups authorized on the same project see the same actions. The host checks each extension's project grant when opening a source route.
## 20.3 Capability and root discovery
Read `get_app_info().projects.commands` for the captured launch. Request `projects_read` to list the group's projects and `projects_write` for project creation or lifecycle actions. Check each command before enabling its action. Request the filesystem or KV permissions needed to read and save this extension’s project data.