feat(core): add project reference guidance (#31601)

This commit is contained in:
Dax 2026-06-10 00:08:26 -04:00 committed by GitHub
commit 8a2cfc00c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 753 additions and 165 deletions

View file

@ -1685,26 +1685,6 @@ export type ServerConfig = {
cors?: Array<string>
}
export type ReferenceConfigEntry =
| string
| {
/**
* Git repository URL, host/path reference, or GitHub owner/repo shorthand
*/
repository: string
branch?: string
}
| {
/**
* Absolute path, ~/ path, or workspace-relative path to a local reference directory
*/
path: string
}
export type ReferenceConfig = {
[key: string]: ReferenceConfigEntry
}
export type PermissionActionConfig = "ask" | "allow" | "deny"
export type PermissionObjectConfig = {
@ -1948,7 +1928,9 @@ export type Config = {
paths?: Array<string>
urls?: Array<string>
}
reference?: ReferenceConfig
references?: {
[key: string]: string | ConfigV2ReferenceGit | ConfigV2ReferenceLocal
}
watcher?: {
ignore?: Array<string>
}
@ -3723,6 +3705,19 @@ export type SyncEventSessionNextCompactionEnded = {
}
}
export type ConfigV2ReferenceGit = {
repository: string
branch?: string
description?: string
hidden?: boolean
}
export type ConfigV2ReferenceLocal = {
path: string
description?: string
hidden?: boolean
}
export type PolicyEffect = "allow" | "deny"
export type ConfigV2ExperimentalPolicy = {
@ -4174,17 +4169,23 @@ export type QuestionV2Reply = {
export type ReferenceLocalSource = {
type: "local"
path: string
description?: string
hidden?: boolean
}
export type ReferenceGitSource = {
type: "git"
repository: string
branch?: string
description?: string
hidden?: boolean
}
export type ReferenceInfo = {
name: string
path: string
description?: string
hidden?: boolean
source: ReferenceLocalSource | ReferenceGitSource
}

View file

@ -17628,44 +17628,6 @@
"additionalProperties": false,
"description": "Server configuration for opencode serve and web commands"
},
"ReferenceConfigEntry": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "Git repository URL, host/path reference, or GitHub owner/repo shorthand"
},
"branch": {
"type": "string"
}
},
"required": ["repository"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Absolute path, ~/ path, or workspace-relative path to a local reference directory"
}
},
"required": ["path"],
"additionalProperties": false
}
]
},
"ReferenceConfig": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ReferenceConfigEntry"
}
},
"PermissionActionConfig": {
"type": "string",
"enum": ["ask", "allow", "deny"]
@ -18256,8 +18218,21 @@
},
"additionalProperties": false
},
"reference": {
"$ref": "#/components/schemas/ReferenceConfig"
"references": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ConfigV2ReferenceGit"
},
{
"$ref": "#/components/schemas/ConfigV2ReferenceLocal"
}
]
}
},
"watcher": {
"type": "object",
@ -23918,6 +23893,41 @@
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"ConfigV2ReferenceGit": {
"type": "object",
"properties": {
"repository": {
"type": "string"
},
"branch": {
"type": "string"
},
"description": {
"type": "string"
},
"hidden": {
"type": "boolean"
}
},
"required": ["repository"],
"additionalProperties": false
},
"ConfigV2ReferenceLocal": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"description": {
"type": "string"
},
"hidden": {
"type": "boolean"
}
},
"required": ["path"],
"additionalProperties": false
},
"PolicyEffect": {
"type": "string",
"enum": ["allow", "deny"]
@ -25190,6 +25200,12 @@
},
"path": {
"type": "string"
},
"description": {
"type": "string"
},
"hidden": {
"type": "boolean"
}
},
"required": ["type", "path"],
@ -25207,6 +25223,12 @@
},
"branch": {
"type": "string"
},
"description": {
"type": "string"
},
"hidden": {
"type": "boolean"
}
},
"required": ["type", "repository"],
@ -25221,6 +25243,12 @@
"path": {
"type": "string"
},
"description": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"source": {
"anyOf": [
{