updated skills
This commit is contained in:
@@ -69,4 +69,3 @@ bunx turbo test:coverage --filter=@suaveplan/api-worker-host
|
||||
```
|
||||
|
||||
All four coverage dimensions land at 100/100/100/100.
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ host.close();
|
||||
|
||||
- `bootstrapWorkerPlugin(spec: BootstrapSpec): WorkerHost`
|
||||
- `BootstrapSpec`:
|
||||
- `manifest: ManifestEnvelope`
|
||||
- `capabilityHandles: CapabilityHandles`
|
||||
- `hooks: PluginLifecycleHooks`
|
||||
- `controlPort: PortLike` / `capabilityPort: PortLike`
|
||||
- `onReady?: (frame: WorkerReadyFrame) => void`
|
||||
- `manifest: ManifestEnvelope`
|
||||
- `capabilityHandles: CapabilityHandles`
|
||||
- `hooks: PluginLifecycleHooks`
|
||||
- `controlPort: PortLike` / `capabilityPort: PortLike`
|
||||
- `onReady?: (frame: WorkerReadyFrame) => void`
|
||||
- `WorkerHost`: `manifest`, `capabilities`, `receiver`, `close()`
|
||||
|
||||
## Implementation Notes
|
||||
@@ -95,6 +95,6 @@ starve lifecycle control (or vice versa) — different queues,
|
||||
different correlation-id namespaces, different backpressure budgets.
|
||||
On failure the bootstrap closes any RPC client it already opened
|
||||
before throwing, so the worker never leaks a half-attached
|
||||
`MessagePort` listener. The ready frame is posted *after* every
|
||||
`MessagePort` listener. The ready frame is posted _after_ every
|
||||
piece of wiring succeeds; an early failure means no ready frame and
|
||||
the main host can detect a stillborn worker via timeout.
|
||||
|
||||
@@ -72,12 +72,12 @@ handler?.(new Error("boom"));
|
||||
|
||||
- `installCrashDetector(opts: CrashDetectorOptions): CrashDetector`
|
||||
- `CrashDetectorOptions`:
|
||||
- `controlPort: PortLike` — required
|
||||
- `process?: ProcessLike`
|
||||
- `onTerminate?: (exitCode: number) => void`
|
||||
- `controlPort: PortLike` — required
|
||||
- `process?: ProcessLike`
|
||||
- `onTerminate?: (exitCode: number) => void`
|
||||
- `CrashDetector`:
|
||||
- `close(): void`
|
||||
- `trigger(cause: unknown): void`
|
||||
- `close(): void`
|
||||
- `trigger(cause: unknown): void`
|
||||
- `ProcessLike` — `{ on, off, exit }` subset of Node `process`.
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
@@ -75,11 +75,11 @@ serveWorkerRpc(controlPort, {
|
||||
|
||||
- `createLifecycleReceiver(opts: LifecycleReceiverOptions): LifecycleReceiver`
|
||||
- `LifecycleReceiverOptions`:
|
||||
- `hooks: PluginLifecycleHooks`
|
||||
- `initialState?: WorkerLifecycleState`
|
||||
- `hooks: PluginLifecycleHooks`
|
||||
- `initialState?: WorkerLifecycleState`
|
||||
- `LifecycleReceiver`:
|
||||
- `state(): WorkerLifecycleState`
|
||||
- `dispatch(raw: unknown): Promise<LifecycleAck>`
|
||||
- `state(): WorkerLifecycleState`
|
||||
- `dispatch(raw: unknown): Promise<LifecycleAck>`
|
||||
- `PluginLifecycleHooks` — optional async hooks per command kind.
|
||||
- `WorkerLifecycleState` — nine-state union.
|
||||
|
||||
@@ -88,8 +88,8 @@ serveWorkerRpc(controlPort, {
|
||||
Legal-from sets are declared at module scope so the transition table
|
||||
is auditable in one read. The `*ing` state is exposed mid-hook so the
|
||||
main host can observe an in-flight transition rather than only the
|
||||
terminal state. On hook throw, the receiver reverts to the *previous*
|
||||
state (not the *ing* state) so retry attempts are evaluated against
|
||||
terminal state. On hook throw, the receiver reverts to the _previous_
|
||||
state (not the _ing_ state) so retry attempts are evaluated against
|
||||
the correct legal-from set. Schema validation runs before any state
|
||||
mutation — a malformed envelope cannot push the FSM out of
|
||||
`loaded` accidentally.
|
||||
|
||||
@@ -10,7 +10,7 @@ This module defines the Zod schemas that the worker host layers on top
|
||||
of the transport-level frame protocol owned by
|
||||
`@suaveplan/api-worker-rpc`. Where the transport package speaks
|
||||
`request` / `response` / `cancel` / `stream-*` / `hello` / `goodbye`
|
||||
frames, the worker host carries higher-level *control envelopes* —
|
||||
frames, the worker host carries higher-level _control envelopes_ —
|
||||
manifest advertisement, lifecycle commands, lifecycle acks, crash
|
||||
reports and capability-handle descriptors — inside those frames'
|
||||
payloads. Keeping the envelope schemas in one place lets the bootstrap,
|
||||
@@ -94,6 +94,6 @@ Schemas are declared at module scope and reused on every parse so Zod
|
||||
does not rebuild the type graph per call. The tier enum is fixed to the
|
||||
three values from design doc §2.2 (`trusted` / `isolated` / `sandboxed`)
|
||||
— extending it requires an OpenSpec change. Capability handles only
|
||||
carry the *method names* exposed by each capability proxy; the actual
|
||||
carry the _method names_ exposed by each capability proxy; the actual
|
||||
`MessagePort` transfer happens out-of-band as part of the underlying
|
||||
`worker_threads` channel setup.
|
||||
|
||||
@@ -72,16 +72,16 @@ h.dispose();
|
||||
|
||||
- `runWorkerHostConformance(opts?): WorkerHostConformanceHarness`
|
||||
- `WorkerHostConformanceOptions`:
|
||||
- `manifest?: ManifestEnvelope`
|
||||
- `capabilityHandles?: CapabilityHandles`
|
||||
- `hooks?: PluginLifecycleHooks`
|
||||
- `capabilityHandlers?: WorkerRpcHandlers`
|
||||
- `manifest?: ManifestEnvelope`
|
||||
- `capabilityHandles?: CapabilityHandles`
|
||||
- `hooks?: PluginLifecycleHooks`
|
||||
- `capabilityHandlers?: WorkerRpcHandlers`
|
||||
- `WorkerHostConformanceHarness`:
|
||||
- `host: WorkerHost`
|
||||
- `mainClient: WorkerRpcClient`
|
||||
- `capabilityServer: WorkerRpcServer`
|
||||
- `controlPorts / capabilityPorts: InProcessPortPair`
|
||||
- `dispose(): void`
|
||||
- `host: WorkerHost`
|
||||
- `mainClient: WorkerRpcClient`
|
||||
- `capabilityServer: WorkerRpcServer`
|
||||
- `controlPorts / capabilityPorts: InProcessPortPair`
|
||||
- `dispose(): void`
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user