Dashboard › opencode › Distillation
2f2a2540-63c4-4b95-a2ef-f1c81d5c23c9["lore_tm_v1_Q2gsqifouPNbExwMUd0-ItPyfx7niEGLjUoVolp9h8Q","lore_tm_v1_nZuzTPuTpZrWhNYQJ9bGk0Shw0hDtyT4_q58kXPSjRI","lore_tm_v1_nheQKQx5zzGigJhagUz78PtIxUoR0Rcw5lmzNY2xcVM","lore_tm_v1_d1KpdTvP5j-1es8jrUH5IxaYVVDX7rlPWbshKobhJq8","lore_tm_v1_1soFTxD8DngA4afbKyldyG9Ud3aaeJxBRWy6rNMDioY","lore_tm_v1_oB7tvBNTuTt2bsJhurZbBH0Cy0RqIK9SV9eFqqhT6DA","lore_tm_v1_Qdq0KbNA7OU0F4njcASCXWCfbsqoSx8Bh0d0buzpHuY","lore_tm_v1_HC20hF0lli9Tq6KylZ4A6eUeOwx2cLvHUbWM59nsR4Y","lore_tm_v1_PXlLYptV59DylCOInmt_AGOuAcXg0nIdvMDIyQDU6yw","lore_tm_v1_c9mLOh_LkfXqReSQS1w6CKzFRRk7Dx1wroqYIPYlDyg","lore_tm_v1_CFu8z64jRcxN6JpsHgvKy-AwqB2JjziOvhhAQ6xXyAc","lore_tm_v1_0M_5Lijz8R9tC2JroMTvxx178gK-HsTMZPpRH6RZHUk","lore_tm_v1_UbEo95fFksj0AMqGilWYX3KVJYDVr2h5J9zdr6KvPCc"]
Date: September 9, 2026
/home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/session.ts defines ParentIDFilter as Session.ID | null, where query string "null" decodes to null to return only root sessions.workspace?, positive integer limit? (default newest 50), order?: "asc" | "desc", search?, and parentID?; SessionsQuery additionally accepts optional directory, project, subpath, and opaque cursor.SessionsCursor encodes a directory-, project-, or all-sessions query with limit removed and anchor: Session.ListAnchor, using JSON plus Base64URL. SessionsCursor.make() creates the branded cursor; SessionsCursor.parse() returns an Effect and maps Base64 or schema failures to exact error "Invalid cursor"./home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/session.ts defines 39 server.session endpoints in order: 1. session.list (GET /api/session), 2. session.stats (GET /api/session/stats), 3. session.create (POST /api/session), 4. session.import (POST /api/session/import), 5. session.export (GET /api/session/:sessionID/export), 6. session.active (GET /api/session/active), 7. session.get (GET /api/session/:sessionID), 8. session.remove (DELETE /api/session/:sessionID), 9. session.fork (POST /api/session/:sessionID/fork), 10. session.switchAgent (POST /api/session/:sessionID/agent), 11. session.switchModel (POST /api/session/:sessionID/model), 12. session.rename (POST /api/session/:sessionID/rename), 13. session.move (POST /api/session/:sessionID/move), 14. session.prompt (POST /api/session/:sessionID/prompt), 15. session.command (POST /api/session/:sessionID/command), 16. session.skill (POST /api/session/:sessionID/skill), 17. session.synthetic (POST /api/session/:sessionID/synthetic), 18. session.shell (POST /api/session/:sessionID/shell), 19. session.compact (POST /api/session/:sessionID/compact), 20. session.wait (POST /api/session/:sessionID/wait), 21. session.revert.stage (POST /api/session/:sessionID/revert/stage), 22. session.revert.clear (POST /api/session/:sessionID/revert/clear), 23. session.revert.commit (POST /api/session/:sessionID/revert/commit), 24. session.context (GET /api/session/:sessionID/context), 25. session.inbox.list (GET /api/session/:sessionID/inbox), 26. session.inbox.cancel (DELETE /api/session/:sessionID/inbox/:inboxID), 27. session.inbox.steer (POST /api/session/:sessionID/inbox/:inboxID/steer), 28. session.inbox.queue (POST /api/session/:sessionID/inbox/:inboxID/queue), 29. session.instructions.entry.list (GET /api/session/:sessionID/instructions/entries), 30. session.instructions.entry.put (PUT /api/session/:sessionID/instructions/entries/:key), 31. session.instructions.entry.remove (DELETE /api/session/:sessionID/instructions/entries/:key), 32. session.generate (POST /api/session/:sessionID/generate), 33. session.log (GET /api/experimental/session/:sessionID/log), 34. session.interrupt (POST /api/session/:sessionID/interrupt), 35. session.background (POST /api/session/:sessionID/background), 36. session.message (GET /api/session/:sessionID/message/:messageID), 37. session.messageUpdate (PATCH /api/session/:sessionID/message/:messageID), 38. session.environment (PUT /api/session/:sessionID/environment), 39. session.view (POST /api/session/:sessionID/view).id, title, agent, model, location, and metadata. Import projects SessionTransfer.Data.fields plus optional location; if parentID is supplied, its parent must exist and parents must be imported before children. Export accepts optional string-decoded boolean sanitize.session.active returns Schema.Record(Session.ID, { type: "running" }) and represents foreground Session drains owned by the current OpenCode process; absent sessions are inactive.session.fork accepts boundary: Session.ForkRequestBoundary; session.switchAgent accepts agent: Agent.ID; session.switchModel accepts model: Model.Ref; session.rename accepts title; and session.move accepts Location.Ref.fields plus optional delivery: SessionInbox.Delivery.session.prompt accepts optional message id, PromptInput.Prompt.fields, required-shape metadata from SessionInbox.UserPayload.fields.metadata, optional delivery, and optional resume; it durably admits input and schedules execution unless resume is false.session.command immediately runs a slash-command callback from command, PromptInput.Prompt.fields, and optional delivery. session.skill accepts optional message id, skill: Skill.ID, and optional resume, appending a skill message and resuming execution.session.synthetic accepts optional message id, required text, optional description, SessionMessage.Synthetic.fields.metadata, optional delivery, and optional resume; it returns SessionInbox.Synthetic.session.shell accepts optional Event.ID and a command, executes in the session working directory, and emits shell.started before execution plus shell.ended with merged output afterward.session.compact accepts optional message id and delivery, durably admits a compaction request, and steers by default so it runs at the next step boundary rather than behind queued prompts. session.wait waits for the agent loop to become idle.session.revert.stage, accepting messageID and optional files and returning Session.Revert; session.revert.clear; and session.revert.commit. Stage can move a reversible boundary and optionally apply file changes.session.context returns all active SessionMessage.Info values after the last compaction. session.inbox.list returns durable undelivered user, synthetic, compaction, and move items in enqueue order; inbox items can be canceled, changed to steer delivery and wake execution, or changed from steered back to queued delivery.InstructionEntry.Info, put { value: Schema.Json } by InstructionEntry.Key, or remove a key. Puts attach or replace durable entries and announce updates at the next step boundary; removals are likewise announced at the next step boundary. Put may return InstructionEntry.ValueTooLargeError.session.generate accepts { prompt: string } and returns { data: { text: string } }, generating transient text from current context without changing session history.session.log accepts optional after decoded to Event.Seq and optional follow decoded from "true" | "false"; it streams SSE items of SessionEvent.Durable | EventLog.Synced, reads after an exclusive aggregate sequence, and follows live events when follow=true.session.interrupt accepts optional query continue; it returns { interrupted: boolean }, where false is an idle no-op. With continue=true, execution resumes pending steering input and next-in-line control items such as manual compaction and moves while queued prompts remain parked.session.background moves active foreground backgroundable tools into background observation and is an idle no-op. session.messageUpdate replaces content: SessionMessage.AssistantContent[] on a completed assistant message only while the session is idle. session.environment replaces local-shell process environment with variables: Record<string, string>. session.view accepts idle: NonNegativeInt to mark an observed idle transition viewed.server.session groupβs OpenAPI title is "session" and description is "Experimental session routes."; location-sensitive operations selectively use sessionLocationMiddleware, including fork, agent/model switching, rename, prompt, command, skill, synthetic, shell, compact, wait, all revert operations, instruction-entry operations, generate, interrupt, and background./home/byk/Code/opencode-v2-pilot/packages/schema/src/session.ts defines Session.Info with required id, projectID, cost, tokens, time, and location; optional parentID, fork, agent, model, outcome, title, subpath, metadata, and revert.Session.Info.fork, when present, contains sessionID and boundary: Session.ForkBoundary. outcome is exactly "succeeded" | "failed" | "interrupted" and records the last completed execution at time.idle; it is absent until a run reaches a terminal transition.Session.Info.time requires created and updated and optionally contains idle, viewed, and archived, all using DateTimeUtcFromMillis.Session.ListAnchor is { id: Session.ID, time: Schema.Finite, direction: "previous" | "next" }./home/byk/Code/opencode-v2-pilot/packages/schema/src/model.ts defines Model.Ref as { id: Model.ID, providerID: Provider.ID, variant?: Model.VariantID }, with textual syntax providerID/modelID or providerID/modelID#variant.Model.Ref.parse() splits on the first / and optional subsequent #; it throws Invalid model reference: ${input} if the provider is missing, model ID is empty, provider contains #, variant is empty, or variant contains another #.reasoningField, requireReasoning, maxTokensField, requireFinishReason, and requireAssistantAfterTool. Canonical reasoning fields include "reasoning", "reasoning_content", and "reasoning_text" but permit other strings; max-token fields are exactly "max_completion_tokens" | "max_tokens".Model.Capabilities contains tools, string arrays input and output, and optional responsesWebsockets. Capabilities.default() returns { tools: true, input: ["text", "image"], output: ["text"] }.Model.Cost has optional context tier { type: "context", size: Schema.Int }, input/output prices in Money.USDPerMillionTokens, and cache read/write prices. Model.Variant contains id: VariantID plus Provider.Overlays.Model.Info contains id, modelID, providerID, optional canonical, optional family, name, optional compatibility, optional package, optional compaction, provider overlays, capabilities, variants, release time, costs, status ("alpha" | "beta" | "deprecated" | "active"), enabled, and context/input/output limits.Model.Info.default(providerID, id) sets both id and modelID to id, name=id, default capabilities, variants=[], time.released=0, cost=[], status="active", enabled=true, and limit={ context: 200_000, output: 32_000 }.@opencode/plugin occur in /home/byk/Code/opencode-v2-pilot/packages/sdk/package.json, packages/plugin-browser/package.json, packages/latex/package.json, packages/core/package.json, root package.json, packages/simulation/package.json, packages/server/package.json, packages/cli/package.json, packages/merman/package.json, and packages/tui/package.json; the package is named in packages/plugin/package.json. Separate legacy @opencode-ai/sdk dependencies are version 1.18.21 in packages/enterprise/package.json and 1.18.5 in github/package.json./home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts defines plugin Host.Target as required directory plus optional package name, and Host.Entrypoints as optional server, tui, and rpc.Host.resolve(target) resolves server entrypoints in preference order ["server", ""], then "tui" and "rpc". Named targets build package subpaths; unnamed targets resolve filesystem paths relative to target.directory, using "index" for the empty subpath.Host.resolve() treats ENOENT, ENOTDIR, MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_PATH_NOT_EXPORTED, and ERR_UNSUPPORTED_DIR_IMPORT as absent candidate entrypoints and rethrows other errors. Host.load(entrypoint) delegates to importModule(entrypoint)./home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.node.ts uses registerHooks() and a monotonically incremented generation; fresh() adds query parameter __opencode_reload=<version> to module URLs.parentURL carries the current __opencode_reload version. It resolves relative imports directly and package-like imports through localSource(), skips node_modules and non-file URLs, tracks local files, and rewrites resolved file URLs with the reload query parameter.prepareSource() tracks its parent directory with track(path.dirname(fileURLToPath(local)), true) before rethrowing, allowing newly created dependencies to trigger reload. It returns { version: specifier, load: () => Host.load(specifier), dispose: () => hook.deregister() }./home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.bun.ts recursively scans local JavaScript/TypeScript dependencies using Bun.Transpiler(...).scan(...).imports, with loaders selected among "tsx", "jsx", "ts", and "js" and target "bun".prepareSource() deletes require.cache[file + search] and require.cache[file], tracks each visited file, skips dependency traversal into node_modules, resolves require-call imports with createRequire(file).resolve(requested), and resolves other imports with Bun.resolveSync(requested, path.dirname(file)).track(path.dirname(requested), true). The return value is { version: String(++generation), load: () => Host.load(entrypoint) } and has no dispose./home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules contained exactly 28 entries: 1. .bin/, 2. @msgpackr-extract/, 3. @protobufjs/, 4. @types/, 5. ajv-draft-04/, 6. ajv/, 7. ast-types/, 8. bun-pty/, 9. bun-types/, 10. csstype/, 11. detect-libc/, 12. effect/, 13. fast-check/, 14. fast-deep-equal/, 15. fast-uri/, 16. immer/, 17. json-schema-traverse/, 18. long/, 19. msgpackr-extract/, 20. msgpackr/, 21. node-gyp-build-optional-packages/, 22. protobufjs/, 23. pure-rand/, 24. require-from-string/, 25. tinybench/, 26. tslib/, 27. undici-types/, 28. valibot/./home/byk/Code/opencode-v2-pilot/packages/schema/src/config/plugin.ts defines ConfigPlugin.Entry with required package: string and optional options: Record<string, unknown>. A plugin configuration is either a string or Entry, and ConfigPlugin.Plugins is an array of those values./home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts has optional plugins: ConfigPlugin.Plugins around line 99; Config.Document begins around line 112, and Config.Entry is the union [Document, Directory, AgentsDirectory, ClaudeDirectory] around line 133.