Skip to content

Commit e882cf9

Browse files
authored
feat(runtime): add managed-local ownership and the exact-only managed runtime (#2258)
* docs: trim the CONTEXT.md glossary within the guidance byte budget CONTEXT.md sat at 11,992 of its 12,000-byte guidance budget, so no new domain term could be added without first paying for it. - Condense eighteen definitions that had grown past one line (platform leaf, command surface, runtime use, runner command traits, interactor, coordinate-first resolved element activation, parent-owned touch point, guarantee cell, delegation-on-error, ref frame, snapshot producer, snapshot policy facet, capture hint, regular presented-depth frontier, clip fold, AX-unavailable target invalidation, Maestro program, Maestro observation generation). The definitions keep their meaning; only the elaboration is gone. - Move the five test-harness terms of 'Providers and tests' (provider-backed integration scenario, provider transcript, scenario transcript, in-process provider scenario harness, HTTP contract test) to docs/agents/domain.md, which AGENTS.md already routes to for domain vocabulary. None of them names a concept a command or a wire shape carries, and none appears in a test name. CONTEXT.md is 10,517 bytes after this pass. * feat(runtime): add the managed-local owner kind, device-claim rule, and managed binding fence ADR 0021 foundations, unit 1. Nothing registers a managed local owner yet, so every arm below is reached from tests only; the point of the unit is that the arms exist and fail closed. - `RuntimeOwnerRef` gains `{ kind: 'managed-local'; instance }` with `managedLocalRuntimeOwner`: one owner per allocator instance, family-agnostic because the device carries its family. Every owner-kind discrimination becomes an exhaustive switch, so a fourth kind is a type error at each site: the owner key, the unavailable-facts provider mode, the durable envelope decode, and the gateway's provider-mode acceptance and exact-owner selection. - `deviceClaimRuleForOwner` ('ordinary' | 'allocator-held' | 'none') in the new leaf src/daemon/device-claim-rule.ts replaces the boolean `isLocalDeviceClaimTarget`. Both claim gates switch on it, and the admission gate now evaluates it under every device-claim policy: the `transient-exclusive` condition moved inside the ordinary arm, so a managed owner is verified where an ordinary owner would never have touched the store. - `requireAllocatorHeldDeviceClaim` (src/daemon/device-claim-allocator.ts) is the one read-only verifier both gates consult. It never acquires, never locks and never clears; in this unit it can only answer `binding-invalid`, `missing`, or `conflict`, because no allocator-held claim kind exists until unit 2. `allocatorHeldAdmissionError` answers each outcome with its own refusal through an exhaustive switch, so an outcome the verifier learns to produce is a compile error until it is answered. - A missing allocator-held claim refuses with COMMAND_FAILED / `allocator-claim-missing`, `retriable: false`. It is deliberately not a `DeviceClaimConflictReason`: replay retries every conflict reason as infrastructure, and a managed identity no allocator activated is permanent. - `managedBindingFence` / `decodeManagedBindingFence` encode `[requesterId, identityIncarnationId]` as the fence token and the request generation as its generation, so two requesters on one identity incarnation never share a fence. The ids are fenced verbatim, and the decoder accepts a token only if it re-encodes to itself. - Claim admission now receives the binding intent the gateway bound, so an exact-owner fence reaches the gate unchanged. Session open still binds ordinarily and passes an ordinary intent: a managed local owner is therefore refused there structurally, and the Host open route replaces that intent when it lands. - CONTEXT.md: managed local owner, device-claim rule, managed binding fence, request generation, identity incarnation. * fix(daemon): decide allocator-held admission totally instead of by an optional error `allocatorHeldAdmissionError` returned `AppError | undefined`, so its switch without a default was never exhaustiveness-checked: TS2366 fires only when the return type excludes `undefined`, `noImplicitReturns` is off, and oxlint has no exhaustiveness rule. A verifier outcome nobody answered would therefore fall out as `undefined`, which both gates read as an admission — claim admission throws nothing and session open proceeds to open the session on a device it never verified. Replace it with `decideAllocatorHeldAdmission`, returning `{ admitted: true } | { admitted: false; error }`. The return type excludes `undefined`, so dropping an arm is now a compile error at the switch, and a gate asks whether the outcome was admitted rather than whether an error happened to come back. `buildAllocatorHeldRefusal` and the admission gate are projections of that one decision. * docs: restore the meaning five CONTEXT.md definitions lost in the trim The condensing pass shortened these five past the point where they still said what they meant: - Capture hint said 'presented depth' where the term is 'regular presented depth', which is what Regular presented-depth frontier is measured against; the short form read as a different axis. - Clip fold lost both that the interpreter runs inside presentation for every backend and that a platform difference may not enter as a backend exception. Those are the whole rule. - Snapshot policy facet lost the process boundary that makes it host-side at all: runner-side Swift presentation stays separate. - Runner command traits lost 'independently of the public command surface', which is what distinguishes them from the command surface. - Delegation-on-error said 'settles', and Settled observation makes 'settle' a term of its own. CONTEXT.md is 11,674 of its 12,000-byte budget. * docs(daemon): correct the claim-gate and managed-owner comments - The claim-gate docstring claimed there is no other way to obtain device operations. That is true of command handlers, but two daemon-owned recovery paths bind outside the seam: application-lifecycle-recovery.ts (ordinary intent, daemon shutdown) and durable-capture-runtime-recovery.ts (exact-owner intent read back from a durable envelope, which this unit makes able to carry a managed local owner). Name them instead of claiming coverage the seam does not have. - The open path's comment described a session executing under an allocator-held claim, a state this route cannot produce. Say what the `{ kind: 'ordinary' }` literal actually is: the truth of a route that binds ordinarily, which the Host open route replaces with the request's exact intent when it lands. - Name U3 as the unit that fills the exact-owner selection arm, rather than the whole ADR. * fix(runtime): accept transport-composed facts for a managed owner providerModeMatchesOwner's managed-local arm accepted mode === 'local' only, but selectExactOwner's managed-local arm loads the device's local family owner through the same loadLocal a local-family owner uses, so it inherits that owner's provider modes verbatim. A managed binding over a transport-composed local device (e.g. a remote ADB or web-provider transport) would fail bindingContractFailure's facts check and be rejected as an owner/facts mismatch. Accept the same local-family modes the local-family arm already does; still unreachable until U3 registers the exact-only owner, which is where the binding regression test that pins this lives. * feat(runtime): register the managed local owner as an exact-only wrapper and add the neutral allocator port (#2259) * feat(runtime): register the managed local owner as an exact-only wrapper and add the neutral allocator port ADR 0021 foundations, unit 3. Unit 1 added the `managed-local` owner kind and left the gateway's exact-owner arm for it failing closed; this unit gives that arm a registry and the owner it selects. Nothing in production registers a managed owner yet, so both are reached from tests only. - `createComposedPlatformRuntimeGateway` gains a `managedOwners` list that only the `managed-local` arm of `selectExactOwner` reads. `selectOrdinaryProvider`, `inspectFacts` and the ordinary `bind` arm never see it, and `providerModules` pairs one provider-runtime owner with one `ProviderDeviceRuntime`, so ordinary selection cannot reach a managed owner by construction rather than by a check. A duplicate instance is refused at composition. - The wrapper (src/platform-runtime-managed-owner.ts, root zone, no platform imports) binds only under an exact-owner intent naming itself, loads the device's own family owner through the gateway's loader, delegates with an ordinary intent — a family owner refuses a foreign exact owner — and republishes the binding under the managed owner. It does not read the fence: what a managed binding fence proves is the device-claim gate's business. `ownsDevice` returns false. - Twenty cells are withheld as `owner-capability-missing`, enumerated by mechanics rather than by catalog group: the four device-lifecycle cells, the four application cells that boot or shut the device down (`prepareApplicationOpen`, `prepareAppleRunner`, `closeApplication`, `finalizeApplicationClose`), and the twelve durable-capture cells, which a managed binding could never reattach because the family runtime stamps envelopes with its own local owner. The operations are then filtered by those facts, so an operation cannot outlive its own fact. - `@agent-device/contracts/managed-device-allocation` is agent-device's own allocator port: lease request, lookup, supersession, cancellation, renewal, release, activation confirmation, identity status, removal acknowledgement, and the typed environment projection. Types only, named to match the allocator's published contract so the two sides cannot drift, with no dependency on any allocator package. Its only implementation is a scripted fake under `*.fixtures.ts`. - Budgets: the new contracts entry surface is a one-module closure; the `src/platform-runtime.ts` hub moves 47 -> 48 for the wrapper, whose own value imports were already in that closure. * fix(runtime): withhold the deployment cells from a managed binding and trim the allocator port Review findings on the managed local owner. - `deployApp` and `deployMaterializedApp` join the lifecycle group. Both family deployment runtimes ensure device readiness before installing, and `deployAppUse` requires `deployApp` alone — so `install` on a managed binding would have booted the allocator's device with nothing to refuse it. Twenty withheld cells become twenty-two, and the refused-uses test covers `deployAppUse`. - The wrapper's doc comment no longer implies that withholding cells is a complete lifecycle exclusion: several retained Apple cells (screenshot capture, settings, clipboard, application launch) boot the simulator lazily inside the family runtime, where cell selection cannot reach. That is the same class as the pre-binding readiness path, and closing it is a family-runtime change. - `readLeaseEnvironment` leaves the allocator port. It was beyond the vocabulary the contract fixes, and it made the scripted fake carry a real parser whose only test passed with every production line reverted. `ManagedLeaseEnvironment`, `ManagedLeaseEnvironmentKey` and `LeaseEnvironmentError` stay as types; the reader that produces them lands with the unit that first turns a grant into a device. - CONTEXT.md drops an operation enumeration that was already incomplete. * fix(runtime): withhold the lazily-booting Apple system and screenshot cells Screenshot capture, settings, clipboard and application launch were retained on a managed binding even though their Apple family-runtime implementations can boot the simulator lazily below cell-selection granularity (screenshot's shutdown-failure retry boot; settings, clipboard and application launch each resolve a local interactor the same way). That preserves rather than blocks the exact bypass ADR-0021 section 3's hard boundary names: managed lifecycle/readiness belongs to the allocator, and no handler path may fall back to direct lifecycle tooling. Withhold captureScreenshot, setSetting, readClipboard, writeClipboard and openApplication alongside the existing withheld groups. The wrapper's doc comment now names the pre-binding readiness gap explicitly as the same class of follow-up, rather than folding it into a retained- cells caveat that no longer applies. MANAGED_RETAINED_OPERATION moves to tapPoint, the cell the fixture-based regression tests now use to prove something survives the wrapper. * chore: retrigger CI (stale synchronize event after rebase) * fix(runtime): lazy-load the managed owner wrapper to satisfy the eager-closure no-growth gate Main's eager-closure budget gate (the merge-base ratchet) replaced the hand-tracked HUB_BUDGETS map with an automatic no-growth-vs-merge-base check: src/platform-runtime.ts is a hub with no growth allowed at all, not a number bumped by hand with a justifying comment. The static import of createManagedLocalRuntimeOwner in platform-runtime-gateway.ts added one module to that hub's closure (47 -> 48), which now fails scripts/__tests__/eager-closure-budgets.test.ts outright rather than needing a manual bump. Move the value import into loadManaged's dynamic `await import`, matching how the rest of this file's owner loaders defer their leaf modules. Only the managed-local arm reaches this path, so an ordinary bind never pays for it, same as before -- the wrapper module itself was simply the wrong side of the eager/lazy line.
1 parent e2ce985 commit e882cf9

33 files changed

Lines changed: 1943 additions & 180 deletions

‎CONTEXT.md‎

Lines changed: 59 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ An internal ownership group for related automation platforms: Apple, Android, Ha
1212
Linux, or web.
1313

1414
**Platform leaf**:
15-
A concrete OS and device shape within a platform family whose support is classified independently,
16-
such as iOS simulator, physical iOS, tvOS, or macOS.
15+
A concrete OS and device shape within a platform family, classified independently: iOS simulator,
16+
physical iOS, tvOS, or macOS.
1717

1818
**Platform module**:
1919
A private package that owns one platform family's device mechanics and exposes its metadata and
@@ -27,8 +27,13 @@ The platform-neutral boundary that reports runtime facts and binds an admitted d
2727
runtime owner.
2828

2929
**Runtime owner**:
30-
The one local platform module or provider runtime selected to execute behavior for an
31-
ownership-qualified device.
30+
The one local platform module, managed local owner, or provider runtime selected to execute
31+
behavior for an ownership-qualified device.
32+
33+
**Managed local owner**:
34+
The exact-only runtime owner for an allocator-managed local device; it delegates automation
35+
mechanics to the device's platform module while device lifecycle stays with the allocator.
36+
_Avoid_: Managed provider, provider runtime
3237

3338
**Request binding**:
3439
A request-lived attachment of cancellation, diagnostics, progress, and admitted context to a
@@ -77,18 +82,34 @@ command.
7782
**Device-claim policy**:
7883
A command's observation, ownership, or exclusive-mutation rule.
7984

85+
**Device-claim rule**:
86+
The per-owner-kind decision at the claim gate: ordinary, allocator-held, or none.
87+
_Avoid_: Claim policy, device-claim policy
88+
89+
**Managed binding fence**:
90+
The ownership fence of one managed binding: requester and identity incarnation as its token,
91+
request generation as its generation.
92+
93+
**Request generation**:
94+
The per-requester monotonic number of one allocation attempt on an allocation lane; never shared
95+
across requesters.
96+
97+
**Identity incarnation**:
98+
The allocator-issued id of one creation of a managed identity, preserved across Android
99+
clean-baseline reuse; a fresh iOS identity is a new device with a new incarnation.
100+
_Avoid_: Request generation
101+
80102
**Human-control hold**:
81103
A device-scoped pause on agent mutations during human operation.
82104

83105
### Commands and routing
84106

85107
**Command surface**:
86108
The catalog of public command identity, interface exposure, adapter policy, and shared metadata
87-
across CLI, Node.js, MCP, and batch entrypoints.
109+
across entrypoints.
88110

89111
**Runtime use**:
90-
A command's platform-neutral declaration of operations required for admission and preferred fast
91-
paths whose absence does not reject the command.
112+
A command's platform-neutral declaration of required operations and optional preferred fast paths.
92113

93114
**Inventory use**:
94115
An inventory command's platform-neutral declaration for composing device sources without binding a
@@ -98,8 +119,8 @@ selected device.
98119
The daemon-side source of truth for route ownership and request-policy traits.
99120

100121
**Runner command traits**:
101-
Per-command classifications that control Apple runner lifecycle and recovery behavior independently
102-
of the public command surface.
122+
Per-command classifications controlling Apple runner lifecycle and recovery behavior
123+
independently of the public command surface.
103124

104125
**Daemon RPC protocol version**:
105126
The integer used to detect breaking compatibility across the remote daemon boundary.
@@ -111,31 +132,30 @@ separately versioned helpers, persisted artifacts, and released API consumers.
111132
### Interactions, selectors, and refs
112133

113134
**Interactor**:
114-
The legacy monolithic interface between dispatch and platform behavior, retained only for commands
115-
not yet migrated to request-bound runtimes.
135+
The legacy monolithic interface between dispatch and platform behavior, kept only for unmigrated
136+
commands.
116137
_Avoid_: New or migrated command behavior
117138

118139
**Interaction dispatch path**:
119140
One concrete route an interaction command takes from a resolved target to device execution.
120141

121142
**Coordinate-first resolved element activation**:
122-
An Apple interaction that resolves a semantic element and then activates its resolved center point,
123-
avoiding a second element lookup after navigation.
143+
An Apple interaction that resolves a semantic element and activates its resolved center point
144+
without a second lookup.
124145

125146
**Parent-owned touch point**:
126-
A point that preserves the selected parent's identity while avoiding independently interactive
147+
A point that keeps the selected parent's identity while avoiding independently interactive
127148
descendants at its center.
128149

129150
**Guarantee cell**:
130-
One dispatch-path-by-guarantee classification stating where an interaction guarantee is enforced,
131-
delegated, inapplicable, or waived.
151+
One dispatch-path-by-guarantee classification: enforced, delegated, inapplicable, or waived.
132152

133153
**Owned waiver**:
134154
A guarantee gap with a tracking issue and explicit owner.
135155

136156
**Delegation-on-error**:
137-
A fast path returning semantic failures to the shared path. It establishes failure-side handling,
138-
not success-path parity.
157+
A fast path that returns semantic failures to the shared path; it establishes failure-side
158+
handling, not success-path parity.
139159

140160
**Parity table**:
141161
A golden cross-language rule table consumed by both TypeScript and native tests.
@@ -144,8 +164,8 @@ A golden cross-language rule table consumed by both TypeScript and native tests.
144164
A contract test's declaration of the guarantee cells it proves.
145165

146166
**Ref frame**:
147-
The session's authorization namespace for mutating `@ref` targets, containing a frozen observation
148-
epoch and issuance scope separate from the latest operational snapshot.
167+
The session's authorization namespace for mutating `@ref` targets: a frozen observation epoch and
168+
issuance scope.
149169

150170
**Frame expiry seam**:
151171
The point immediately before a mutating device operation where the active ref frame becomes invalid.
@@ -190,35 +210,33 @@ A backend-owned accessibility value before snapshot presentation.
190210
One backend attempt's raw accessibility nodes and attempt-level capture facts.
191211

192212
**Snapshot producer**:
193-
The acquisition component that produced a snapshot's raw tree — the third identity axis beside
194-
the platform channel and the in-plan capture strategy. Producers on one channel carry different
195-
guarantees, so presentation, scope, and geometry logic keys on the producer, never the channel
196-
alone.
213+
The acquisition component that produced a snapshot's raw tree; presentation, scope, and geometry
214+
key on the producer, never on the platform channel alone.
197215

198216
**Presentation options**:
199217
The policy input controlling how one snapshot acquisition becomes a public projection.
200218

201219
**Snapshot policy facet**:
202-
The host-side owner of neutral snapshot policy: presentation, freshness, timeout and overlay.
203-
Platform acquisition supplies raw facts and a fold policy; runner-side Swift presentation remains
220+
The host-side owner of neutral snapshot policy (presentation, freshness, timeout, overlay);
221+
platform acquisition supplies raw facts and a fold policy, and runner-side Swift presentation stays
204222
separate across the process boundary.
205223

206224
**Capture hint**:
207-
The acquisition-facing view of a snapshot request, derived once from presentation options. It names
208-
the projection a backend must serve, keeps raw traversal depth separate from regular presented depth,
209-
and may narrow acquisition only where that backend can prove the narrowing complete.
225+
The acquisition-facing view of a snapshot request: the projection a backend must serve, raw
226+
traversal depth kept apart from regular presented depth, and narrowing only where the backend can
227+
prove it complete.
210228

211229
**Regular presented-depth frontier**:
212-
The acquisition boundary for an unscoped regular snapshot, measured against regular presented depth
213-
after structural wrappers collapse. It is distinct from raw traversal depth.
230+
The acquisition boundary for an unscoped regular snapshot, measured against regular presented
231+
depth after structural wrappers collapse.
214232

215233
**Snapshot eligibility**:
216234
Membership in a presented snapshot projection, independent of whether a node is currently hittable.
217235

218236
**Clip fold**:
219-
The regular projection's single visibility interpreter, run inside presentation for every backend:
220-
viewport and scroll-container clipping, ancestor projection, scroll hints, and collapsed depth.
221-
Platform differences enter as a fold policy, never as a backend exception.
237+
The regular projection's single visibility interpreter, run inside presentation for every
238+
backend: viewport and scroll-container clipping, ancestor projection, scroll hints, collapsed
239+
depth. Platform differences enter as a fold policy, never as a backend exception.
222240

223241
**Presented node**:
224242
A wire-facing snapshot value produced at the presentation boundary.
@@ -238,7 +256,7 @@ A fidelity limit in acquired evidence that presentation cannot repair and must d
238256

239257
**AX-unavailable target invalidation**:
240258
The Apple behavior that discards a suspect cached application target after a root accessibility
241-
failure so the next command reacquires it.
259+
failure.
242260

243261
### Recording and replay
244262

@@ -277,21 +295,20 @@ completed result, missing state, or typed refusal.
277295
### Maestro compatibility
278296

279297
**Maestro program**:
280-
A source-preserving typed representation of the Maestro Flow syntax and behavior supported by
281-
agent-device, interpreted through the compatibility runtime.
298+
A source-preserving typed representation of the supported Maestro Flow syntax and behavior.
282299

283300
**Maestro observation generation**:
284-
Compatibility-engine evidence captured since the most recent mutation; mutation invalidates it
285-
before dispatch.
301+
Compatibility-engine evidence captured since the most recent mutation; mutation invalidates it.
286302

287303
### Providers and tests
288304

289305
**Provider**:
290306
An external adapter that owns a device runtime or contributes transport to a platform module.
291307

292-
**Provider-backed integration scenario**:
293-
A device-free test through the real daemon request path that replaces only external device or host
294-
tool execution.
308+
**Managed device allocator port**:
309+
The daemon-owned interface to a managed-device allocator, covering everything the daemon needs to
310+
obtain, hold, and give back a managed device.
311+
_Avoid_: Simlock client, lease provider
295312

296313
**Cloud WebDriver runtime**:
297314
A provider runtime that maps a cloud-owned Appium or WebDriver session into agent-device inventory,
@@ -302,15 +319,3 @@ Provider-hosted session output such as video, automation logs, device logs, or d
302319

303320
**Daemon artifact type**:
304321
An optional semantic category supplied by the owner of a daemon-managed downloadable artifact.
305-
306-
**Provider transcript**:
307-
An exact record of external provider calls used to verify command translation.
308-
309-
**Scenario transcript**:
310-
A command-level integration flow describing user-visible behavior through daemon commands.
311-
312-
**In-process provider scenario harness**:
313-
An integration runner that invokes the daemon request handler without opening an HTTP listener.
314-
315-
**HTTP contract test**:
316-
A narrow test of JSON-RPC transport, authentication, and response finalization.

‎docs/agents/domain.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,21 @@ If a proposed change contradicts an ADR, say so explicitly and explain why the d
99
reopened.
1010

1111
`AGENTS.md` routes to the rest of this directory by task type.
12+
13+
## Test-harness vocabulary
14+
15+
**Provider-backed integration scenario**:
16+
A device-free test through the real daemon request path that replaces only external device or host
17+
tool execution.
18+
19+
**Provider transcript**:
20+
An exact record of external provider calls used to verify command translation.
21+
22+
**Scenario transcript**:
23+
A command-level integration flow describing user-visible behavior through daemon commands.
24+
25+
**In-process provider scenario harness**:
26+
An integration runner that invokes the daemon request handler without opening an HTTP listener.
27+
28+
**HTTP contract test**:
29+
A narrow test of JSON-RPC transport, authentication, and response finalization.

‎packages/capture-kit/src/durable-resource-envelope.test.ts‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,42 @@ test('neutral envelope canonicalizes persisted provider owner identity', () => {
127127
instance: 'tenant-a',
128128
});
129129
});
130+
131+
test('neutral envelope canonicalizes persisted managed local owner identity on any family', () => {
132+
const android = decodeDurableResourceEnvelope({
133+
...APP_LOG_ENVELOPE_FIXTURE,
134+
owner: { kind: 'managed-local', instance: ' sim-a ' },
135+
});
136+
assert.equal(android.status, 'decoded');
137+
if (android.status !== 'decoded') return;
138+
assert.deepEqual(android.envelope.owner, { kind: 'managed-local', instance: 'sim-a' });
139+
assert.ok(Object.isFrozen(android.envelope.owner));
140+
141+
// A managed owner carries no family, so the local-family coherence check does not apply.
142+
const apple = decodeDurableResourceEnvelope({
143+
...APP_LOG_ENVELOPE_FIXTURE,
144+
device: {
145+
id: 'simulator-1',
146+
family: 'apple',
147+
appleOs: 'ios',
148+
kind: 'simulator',
149+
target: 'mobile',
150+
},
151+
owner: { kind: 'managed-local', instance: 'sim-a' },
152+
});
153+
assert.equal(apple.status, 'decoded');
154+
});
155+
156+
test('neutral envelope rejects a managed local owner without an allocator instance', () => {
157+
assert.deepEqual(
158+
decodeDurableResourceEnvelope({
159+
...APP_LOG_ENVELOPE_FIXTURE,
160+
owner: { kind: 'managed-local', instance: ' ' },
161+
}),
162+
{
163+
status: 'unreattachable',
164+
reason: 'descriptor-invalid',
165+
message: 'Durable resource owner reference is invalid',
166+
},
167+
);
168+
});

‎packages/capture-kit/src/durable-resource-envelope.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
type ResourceOwnershipFence,
2121
type RuntimeOwnerRef,
2222
localRuntimeOwner,
23+
managedLocalRuntimeOwner,
2324
providerRuntimeOwner,
2425
} from '@agent-device/contracts/platform-runtime';
2526
import { freezeJsonObject, isBoundedJsonObject } from './durable-json.ts';
@@ -121,6 +122,9 @@ function decodeRuntimeOwnerRef(value: unknown): RuntimeOwnerRef | null {
121122
if (value.kind === 'local-family' && isPlatform(value.family)) {
122123
return localRuntimeOwner(value.family);
123124
}
125+
if (value.kind === 'managed-local' && isNonEmptyString(value.instance)) {
126+
return managedLocalRuntimeOwner(value.instance);
127+
}
124128
if (
125129
value.kind === 'provider-runtime' &&
126130
isNonEmptyString(value.provider) &&

‎packages/contracts/package.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@
275275
"types": "./src/logs-runtime-plan.ts",
276276
"default": "./src/logs-runtime-plan.ts"
277277
},
278+
"./managed-device-allocation": {
279+
"types": "./src/managed-device-allocation.ts",
280+
"default": "./src/managed-device-allocation.ts"
281+
},
278282
"./managed-web-backend": {
279283
"types": "./src/managed-web-backend.ts",
280284
"default": "./src/managed-web-backend.ts"

0 commit comments

Comments
 (0)