@@ -24,6 +24,7 @@ import type { Command } from "@opencode/schema/command"
2424import { Form } from "@opencode/schema/form"
2525import type { Location } from "@opencode/schema/location"
2626import type { Model } from "@opencode/schema/model"
27+ import type { Plugin } from "@opencode/schema/plugin"
2728import type { Session } from "@opencode/schema/session"
2829import type { SessionMessage } from "@opencode/schema/session-message"
2930import type { TokenUsage } from "@opencode/schema/token-usage"
@@ -40,6 +41,7 @@ type CommandInfo = typeof Command.Info.Encoded
4041type LocationRef = typeof Location . PublicRef . Encoded
4142type ModelInfo = typeof Model . Info . Encoded
4243type ModelRef = typeof Model . Ref . Encoded
44+ type PluginInfo = typeof Plugin . Info . Encoded
4345type SessionInfo = typeof Session . Info . Encoded
4446type SessionMessageInfo = typeof SessionMessage . Info . Encoded
4547type TokenUsageInfo = typeof TokenUsage . Info . Encoded
@@ -155,6 +157,7 @@ type Catalog = {
155157 models : ModelInfo [ ]
156158 agents : AgentInfo [ ]
157159 commands : CommandInfo [ ]
160+ plugins : PluginInfo [ ]
158161}
159162
160163export type InitializeOptions = {
@@ -559,6 +562,14 @@ function startServer(options: WireOptions, changed: () => void) {
559562 models : [ testModel , secondModel ] ,
560563 agents : [ buildAgent , planAgent ] ,
561564 commands : [ reviewCommand ] ,
565+ plugins : [
566+ {
567+ id : "opencode.models.dev" ,
568+ source : { type : "builtin" } ,
569+ features : { server : true } ,
570+ state : { status : "active" } ,
571+ } ,
572+ ] ,
562573 }
563574 const requests : ServerRequest [ ] = [ ]
564575 const submissions : Submission [ ] = [ ]
@@ -697,6 +708,7 @@ function startServer(options: WireOptions, changed: () => void) {
697708 "/api/model/default" : { GET : catalogRoute ( ( ) => catalog . models [ 0 ] ?? null ) } ,
698709 "/api/agent" : { GET : catalogRoute ( ( ) => catalog . agents ) } ,
699710 "/api/command" : { GET : catalogRoute ( ( ) => catalog . commands ) } ,
711+ "/api/plugin" : { GET : catalogRoute ( ( ) => catalog . plugins ) } ,
700712 "/api/session" : {
701713 GET : route ( ( _req , query ) => {
702714 const sessions = [ ...fake . sessions . values ( ) ]
0 commit comments