mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
docs: document the OpenCode client migration surfaces (OM-179)
Adds JSDoc comments to the functions this branch adds or changes, so the touched-code docstring coverage clears the review threshold. Comments only; no code, formatting or import changes.
This commit is contained in:
1 parent
64e87ba1ea
commit
6297403a41
41 files changed
+691
No files matched your search
@@ -14,6 +14,10 @@ const standardSchema = Schema.toStandardSchemaV1(Info, {
|
||||
const LEGACY_SKILLS_MESSAGE =
|
||||
'skills must be a list of skill paths. Replace the legacy `skills: { paths: [...] }` object with `skills: [...]`.'
|
||||
|
||||
/**
|
||||
* Renders a schema issue path as a dotted string, unwrapping the standard-schema key objects and
|
||||
* falling back to `root` for empty or missing paths.
|
||||
*/
|
||||
function toIssuePath(path: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }> | undefined): string {
|
||||
if (!path || path.length === 0) return 'root'
|
||||
return path
|
||||
@@ -21,6 +25,10 @@ function toIssuePath(path: ReadonlyArray<PropertyKey | { readonly key: PropertyK
|
||||
.join('.')
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects the v1 `skills: { paths: [...] }` object form, which the v2 schema rejects and which
|
||||
* `validateOpenCodeConfig` rewrites with an actionable message.
|
||||
*/
|
||||
function hasLegacySkillsObject(value: unknown): boolean {
|
||||
return isRecord(value) && isRecord(value.skills)
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ export interface McpServerView {
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a config server to its UI-facing view, exposing `command` for local servers and `url` for
|
||||
* remote ones so the view never carries both. `enabled` reflects the absence of `disabled: true`.
|
||||
*/
|
||||
function toMcpServerView(name: string, config: McpServerConfig, enabled: boolean): McpServerView {
|
||||
return {
|
||||
name,
|
||||
|
||||
Reference in new issue
Block a user