refactor(core): consolidate references

This commit is contained in:
Dax Raad 2026-06-09 11:38:35 -04:00
commit f76ca58a54
63 changed files with 683 additions and 2722 deletions

View file

@ -5400,64 +5400,6 @@
]
}
},
"/reference": {
"get": {
"tags": ["reference"],
"operationId": "reference.list",
"parameters": [
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"responses": {
"200": {
"description": "Resolved configured references",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReferenceDescriptor"
},
"description": "Resolved configured references"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BadRequestError"
}
}
}
}
},
"description": "List configured references resolved in the current workspace.",
"summary": "List configured references",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.reference.list({\n ...\n})"
}
]
}
},
"/session": {
"get": {
"tags": ["session"],
@ -11414,14 +11356,6 @@
"type": "string"
},
"required": true
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
@ -11515,14 +11449,6 @@
"type": "string"
},
"required": false
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
@ -12062,6 +11988,87 @@
]
}
},
"/api/reference": {
"get": {
"tags": ["reference"],
"operationId": "v2.reference.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReferenceInfo"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "List references available in the requested location.",
"summary": "List references",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.reference.list({\n ...\n})"
}
]
}
},
"/pty/{ptyID}/connect": {
"get": {
"tags": ["pty"],
@ -14068,12 +14075,6 @@
"items": {
"$ref": "#/components/schemas/PromptAgentAttachment"
}
},
"references": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PromptReferenceAttachment"
}
}
},
"required": ["text"],
@ -20041,70 +20042,6 @@
"required": ["name", "data"],
"additionalProperties": false
},
"ReferenceDescriptor": {
"anyOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"kind": {
"type": "string",
"enum": ["local"]
},
"path": {
"type": "string"
}
},
"required": ["name", "kind", "path"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"kind": {
"type": "string",
"enum": ["git"]
},
"repository": {
"type": "string"
},
"path": {
"type": "string"
},
"branch": {
"type": "string"
}
},
"required": ["name", "kind", "repository", "path"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"kind": {
"type": "string",
"enum": ["invalid"]
},
"repository": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["name", "kind", "message"],
"additionalProperties": false
}
]
},
"NotFoundError": {
"type": "object",
"required": ["name", "data"],
@ -21498,41 +21435,6 @@
"required": ["name"],
"additionalProperties": false
},
"PromptReferenceAttachment": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"kind": {
"type": "string",
"enum": ["local", "git", "invalid"]
},
"uri": {
"type": "string"
},
"repository": {
"type": "string"
},
"branch": {
"type": "string"
},
"target": {
"type": "string"
},
"targetUri": {
"type": "string"
},
"problem": {
"type": "string"
},
"source": {
"$ref": "#/components/schemas/PromptSource"
}
},
"required": ["name", "kind"],
"additionalProperties": false
},
"SessionErrorUnknown": {
"type": "object",
"properties": {
@ -24339,12 +24241,6 @@
"$ref": "#/components/schemas/PromptAgentAttachment"
}
},
"references": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PromptReferenceAttachment"
}
},
"type": {
"type": "string",
"enum": ["user"]
@ -25214,6 +25110,60 @@
"required": ["answers"],
"additionalProperties": false
},
"ReferenceLocalSource": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["local"]
},
"path": {
"type": "string"
}
},
"required": ["type", "path"],
"additionalProperties": false
},
"ReferenceGitSource": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["git"]
},
"repository": {
"type": "string"
},
"branch": {
"type": "string"
}
},
"required": ["type", "repository"],
"additionalProperties": false
},
"ReferenceInfo": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"source": {
"anyOf": [
{
"$ref": "#/components/schemas/ReferenceLocalSource"
},
{
"$ref": "#/components/schemas/ReferenceGitSource"
}
]
}
},
"required": ["name", "path", "source"],
"additionalProperties": false
},
"EventModels-devRefreshed": {
"type": "object",
"properties": {
@ -28767,10 +28717,6 @@
"name": "provider",
"description": "Experimental HttpApi provider routes."
},
{
"name": "reference",
"description": "Configured reference routes."
},
{
"name": "session",
"description": "Experimental HttpApi session routes."
@ -28835,6 +28781,10 @@
"name": "session questions",
"description": "Experimental session question routes."
},
{
"name": "reference",
"description": "Location-scoped project references."
},
{
"name": "pty",
"description": "PTY websocket route."