Files
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

69 lines
2.1 KiB
Markdown

# @tutti-os/workbench-host
Product-neutral Workbench coordinator and disposable session lifecycle for
renderer hosts.
The package owns renderer-local session indexing, immutable partition
replacement, lease disposal, stable host-input publication, surface attachment
handoff, and deterministic capability ownership checks. It does not own React,
Electron, product transport clients, authentication discovery, or product
business policy.
## Runtime API
```ts
import {
createWorkbenchHostSessionConfiguration,
WorkbenchHostCoordinator,
WorkbenchHostSession
} from "@tutti-os/workbench-host";
const configuration = createWorkbenchHostSessionConfiguration({
createSession: (partition) =>
new WorkbenchHostSession({
partition,
resolve: (update: string) => ({
hostInput: { value: update },
state: update
})
})
});
const coordinator = new WorkbenchHostCoordinator();
const lease = coordinator.open({
configuration,
partition: {
scope: { id: "workspace-1", kind: "workspace" }
}
});
lease.session.update("ready");
lease.release();
coordinator.dispose();
```
Create one coordinator per renderer/window dependency-injection root. Product
DI tokens and registration stay in the product renderer. Separate renderer
coordinators never share sessions, and renderer isolation does not grant a
second durable snapshot writer.
## Conformance
The `@tutti-os/workbench-host/conformance` subpath exposes runner-neutral test
cases. Consumers can register the same cases in Node test, Vitest, or another
test runner and may supply their DI-resolved coordinator, partition mapping, and
capability profile fixture.
```ts
import { test } from "node:test";
import { createWorkbenchHostConformanceCases } from "@tutti-os/workbench-host/conformance";
for (const conformanceCase of createWorkbenchHostConformanceCases()) {
test(conformanceCase.name, conformanceCase.run);
}
```
The shared cases cover the public kernel contract. Product repositories and
composition roots must add their own durable-writer, metadata preservation,
snapshot restore, and transport isolation cases.