Dashboard › opencode › Distillation
f2ea49da-e739-49b5-a3f2-a4ef3ebe72d2["lore_tm_v1_wda5j7tVU_xOpjkAou42WNlaSBYiyrS9satDSI9y1Yc","lore_tm_v1_o_gMok2slwQBNW4tDgAovL1jb5wshhHEIy4cZMSw8WA"]
Date: Sep 14, 2026
packages/schema/AGENTS.md states @opencode-ai/schema owns browser-safe wire/storage contracts shared by protocol, server, core, and generated SDKs; runtime behavior, service layers, side effects, and host-local implementation details remain in the owning domain package.V1 naming, and permanent replacement architecture names/brands/identifiers to remove V2; retained V1 contracts are intended to move under src/v1/, and new/current code must not depend on that subtree.current, shared transitional, or V1-only; V1-emitted events are not automatically included in Protocol or SDK Next, and clearly V1-only events such as message.updated and message.part.* stay outside the current Protocol/SDK Next event surface absent a documented current-client requirement.PluginID, PluginEvent, PtyInfo, PtyEvent, and SessionTodoInfo, and permits Core domain facades only when they re-export the exact canonical Schema value without creating a second schema identity.Schema.Struct records use same-name interfaces; unions, scalars, arrays, branded scalars, and event payload helpers use type aliases; closed string sets use Schema.Literals(...); public contracts are readonly by default and must not use Schema.mutable(...).optional(...) helper so encoded objects omit undefined; raw Schema.optional(...) is reserved for intentionally preserving an explicitly encoded undefined, and convenience defaults normally use decode-only Schema.withDecodingDefault(...).Schema.Any; JSON-serializable values use Schema.Json, genuinely opaque values use Schema.Unknown, and Schema.Any is allowed only at a documented unsafe compatibility boundary.create(), newly generated ID schemas to validate the exact emitted prefix including _, and reusable public schemas to have unique, stable, domain-qualified identifiers; legacy loose validators must not be tightened without an explicit compatibility and migration decision.undefined, absence of accidental current-contract Schema.Any, stable and unique public identifiers, exact facade/schema identity, and exclusion of V1-only events from current Protocol manifests.packages/schema/src/session.ts exports the Session namespace from itself, defines ID = SessionID, Event = SessionEvent, and defines Session.Info with fields id, optional parentID, projectID, optional agent, optional model, cost, token counts (input, output, reasoning, and cache read/write), timestamps (created, updated, optional archived), title, location, optional subpath, and optional revert.packages/schema/src/session.ts:44 currently annotates the current Session.Info schema with identifier "SessionV2.Info", conflicting with the Schema package rule that current contract identifiers must remove V2.packages/schema/src/session.ts:46-51 defines Session.ListAnchor with id: ID, time: Schema.Finite, and direction: Schema.Literals(["previous", "next"]), annotated with identifier "Session.ListAnchor".Session.Info contains no durable execution/recovery state such as active-run identity, provider-turn status, tool-work status, recovery claim, recovery epoch, or recovery timestamp; the visible durable fields alone describe session metadata, accounting, placement, timestamps, and revert state.