dsh-opencode-go 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +1 -0
  2. package/README.en.md +74 -194
  3. package/README.md +73 -184
  4. package/THIRD_PARTY_NOTICES.md +7 -1
  5. package/docs/advanced.en.md +137 -0
  6. package/docs/advanced.md +135 -0
  7. package/docs/assets/accounts.png +0 -0
  8. package/docs/assets/advanced-settings.png +0 -0
  9. package/docs/assets/model-settings.png +0 -0
  10. package/docs/assets/usage-panel.png +0 -0
  11. package/docs/development.md +65 -7
  12. package/docs/fork-review-2026-09-25.md +191 -0
  13. package/docs/independent-package.md +2 -2
  14. package/docs/verification.md +283 -0
  15. package/lib/build-info.json +8 -1
  16. package/lib/client.js +830 -635
  17. package/lib/index.js +52687 -856
  18. package/lib/types/account-manager.d.ts +25 -0
  19. package/lib/types/account-operations.d.ts +31 -0
  20. package/lib/types/account-policy.d.ts +16 -0
  21. package/lib/types/account-recovery.d.ts +2 -0
  22. package/lib/types/account-selection.d.ts +30 -0
  23. package/lib/types/account-service.d.ts +12 -0
  24. package/lib/types/accounts-contract.d.ts +38 -0
  25. package/lib/types/accounts.d.ts +8 -1
  26. package/lib/types/adapter.d.ts +33 -11
  27. package/lib/types/call-trace.d.ts +54 -0
  28. package/lib/types/catalog-manager.d.ts +20 -0
  29. package/lib/types/catalog.d.ts +6 -4
  30. package/lib/types/client/accounts-controller.d.ts +8 -17
  31. package/lib/types/client/hint-mark.d.ts +17 -0
  32. package/lib/types/client/host-compat.d.ts +7 -0
  33. package/lib/types/client/host-primitives.d.ts +11 -0
  34. package/lib/types/client/locales.d.ts +14 -3
  35. package/lib/types/client/section-controller.d.ts +11 -48
  36. package/lib/types/client/staged-form.d.ts +1 -3
  37. package/lib/types/client/usage.d.ts +1 -1
  38. package/lib/types/config-contract.d.ts +70 -0
  39. package/lib/types/config.d.ts +13 -54
  40. package/lib/types/conversion/context.d.ts +5 -1
  41. package/lib/types/conversion/image-pool.d.ts +24 -0
  42. package/lib/types/conversion/replay.d.ts +1 -1
  43. package/lib/types/conversion/stream.d.ts +1 -1
  44. package/lib/types/gateway-diagnostics.d.ts +22 -0
  45. package/lib/types/gateway-error.d.ts +2 -0
  46. package/lib/types/gateway-url.d.ts +7 -0
  47. package/lib/types/google-fetch.d.ts +6 -0
  48. package/lib/types/google-generative-ai.d.ts +3 -0
  49. package/lib/types/host-settings.d.ts +11 -0
  50. package/lib/types/index.d.ts +2 -2
  51. package/lib/types/model-metadata.d.ts +5 -3
  52. package/lib/types/models-contract.d.ts +7 -0
  53. package/lib/types/protocol-contract.d.ts +5 -0
  54. package/lib/types/protocol-policy.d.ts +4 -0
  55. package/lib/types/reasoning.d.ts +36 -6
  56. package/lib/types/request-control.d.ts +2 -0
  57. package/lib/types/sdk-types.d.ts +3156 -0
  58. package/lib/types/settings-bridge.d.ts +22 -0
  59. package/lib/vendor-licenses.txt +1861 -0
  60. package/package.json +7 -2
@@ -0,0 +1,25 @@
1
+ import { type CredentialProvider } from '@deepseek-ai/dsh-credentials';
2
+ import { type AccountSettingsWriter, type SettingsWriteResult } from './settings-bridge.ts';
3
+ import { type AccountCommand } from './accounts-contract.ts';
4
+ export declare const ACCOUNT_RECOVERY_TIMEOUT_MS = 30000;
5
+ /** Serialize account commands and recover the same durable operations for one profile. */
6
+ export declare class GoAccountManager {
7
+ private readonly logger;
8
+ private connection;
9
+ private pending;
10
+ private again;
11
+ private queue;
12
+ constructor(logger: {
13
+ warn(message: string): void;
14
+ });
15
+ connect(settings: AccountSettingsWriter, credentials: Pick<CredentialProvider, 'describe' | 'unset'> & Partial<Pick<CredentialProvider, 'set'>>): () => void;
16
+ trigger(): void;
17
+ recover(): Promise<void>;
18
+ private row;
19
+ private run;
20
+ /** Preserve an old selection by moving it first in the same revision-guarded write. */
21
+ private normalizeOrder;
22
+ private complete;
23
+ private enqueue;
24
+ execute(raw: AccountCommand): Promise<SettingsWriteResult>;
25
+ }
@@ -0,0 +1,31 @@
1
+ /** Durable, client-safe intentions. Never put a credential value in this document. */
2
+ import { type AccountSettings, type GoAccount } from './accounts.ts';
3
+ export type GoAccountOperation = {
4
+ id: string;
5
+ kind: 'add';
6
+ account: GoAccount;
7
+ previousRef: string;
8
+ select: boolean;
9
+ } | {
10
+ id: string;
11
+ kind: 'remove';
12
+ account: GoAccount;
13
+ };
14
+ export declare function ownsAccountCredential(account: GoAccount): boolean;
15
+ export declare function assertAccountOperations(value: readonly GoAccountOperation[] | undefined): void;
16
+ /** Pending additions remain visible so a lost key write can be repaired or removed. */
17
+ export declare function visibleAccountsOf(settings: AccountSettings): readonly GoAccount[];
18
+ /** The same transition completes a foreground operation or a recovered intention. */
19
+ export declare function accountOperationPatch(settings: AccountSettings, operation: GoAccountOperation, dropLegacyRef?: string): ({
20
+ op: "set";
21
+ path: string[];
22
+ value: GoAccount[];
23
+ } | {
24
+ op: "set";
25
+ path: string[];
26
+ value: string;
27
+ } | {
28
+ op: "set";
29
+ path: string[];
30
+ value: GoAccountOperation[];
31
+ })[];
@@ -0,0 +1,16 @@
1
+ import type { GoAccountSwitch } from './accounts.ts';
2
+ export interface AttemptOutcome {
3
+ failure?: {
4
+ code: string;
5
+ };
6
+ emitted: boolean;
7
+ totalTokens: number;
8
+ aborted: boolean;
9
+ hasNext: boolean;
10
+ }
11
+ /** Switching accounts must never replay output or already charged work. */
12
+ export declare function accountFallback(outcome: AttemptOutcome): GoAccountSwitch['reason'] | undefined;
13
+ /** Missing local credentials and exhausted quota do not blacklist a gateway key. */
14
+ export declare function isGatewayKeyRejection(failure: {
15
+ code: string;
16
+ }): boolean;
@@ -0,0 +1,2 @@
1
+ /** Backward-compatible name for the host's shared foreground/recovery executor. */
2
+ export { GoAccountManager as GoAccountRecovery, ACCOUNT_RECOVERY_TIMEOUT_MS } from './account-manager.ts';
@@ -0,0 +1,30 @@
1
+ import type { GoAccountSettlement } from './adapter.ts';
2
+ import { type GoAccountSwitch } from './accounts.ts';
3
+ import type { OpencodeGoConfig } from './config.ts';
4
+ import { type AccountSettingsWriter } from './settings-bridge.ts';
5
+ export type { AccountSettingsWriter } from './settings-bridge.ts';
6
+ /** Owns both the fallback notice and its optional persisted account selection. */
7
+ export declare class GoAccountSelection {
8
+ private readonly config;
9
+ private readonly logger;
10
+ private settings;
11
+ private connection;
12
+ private credentials;
13
+ private version;
14
+ private signature;
15
+ private latestSeq;
16
+ private notice;
17
+ constructor(config: () => OpencodeGoConfig, logger: {
18
+ debug(message: string): void;
19
+ warn(message: string): void;
20
+ });
21
+ connect(settings: AccountSettingsWriter): () => void;
22
+ private row;
23
+ /** Reading the revision also catches A → C → A before async change watchers run. */
24
+ capture(): number;
25
+ credentialChanged(): void;
26
+ lastSwitch(): GoAccountSwitch | undefined;
27
+ /** One freshness decision governs both side effects of a request's outcome. */
28
+ settle(event: GoAccountSettlement): void;
29
+ private adopt;
30
+ }
@@ -0,0 +1,12 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { AccountCommand } from './accounts-contract.ts';
4
+ import type { GoAccountManager } from './account-manager.ts';
5
+ /** The browser sends commands; the host owns credentials, revisions and recovery. */
6
+ export declare class GoAccountsService extends TypertRemoteService {
7
+ private readonly options;
8
+ constructor(ctx: Context, options: {
9
+ manager: GoAccountManager;
10
+ });
11
+ execute(command: AccountCommand): Promise<import("./settings-bridge.ts").SettingsWriteResult>;
12
+ }
@@ -0,0 +1,38 @@
1
+ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
2
+ import type { SettingsWriteResult } from './settings-bridge.ts';
3
+ export type AccountCommand = {
4
+ kind: 'add';
5
+ id: string;
6
+ name: string;
7
+ key: string;
8
+ } | {
9
+ kind: 'remove';
10
+ ref: string;
11
+ } | {
12
+ kind: 'select';
13
+ ref: string;
14
+ } | {
15
+ kind: 'rename';
16
+ ref: string;
17
+ name: string;
18
+ } | {
19
+ kind: 'replace-key';
20
+ ref: string;
21
+ key: string;
22
+ } | {
23
+ kind: 'move';
24
+ ref: string;
25
+ toIndex: number;
26
+ } | {
27
+ kind: 'auto-switch';
28
+ value: boolean;
29
+ };
30
+ export declare function parseAccountCommand(value: unknown): AccountCommand;
31
+ declare module '@deepseek-ai/dsh-typert-protocol' {
32
+ interface TypertRemoteNamespaceMap {
33
+ opencodeGoAccounts: {
34
+ execute(command: AccountCommand): Promise<RemoteResult<SettingsWriteResult>>;
35
+ };
36
+ }
37
+ }
38
+ export declare const accountsRemote: TypertRemoteContribution;
@@ -1,4 +1,5 @@
1
1
  /** Client-safe account metadata. Secrets stay in the host credential service. */
2
+ import type { GoAccountOperation } from './account-operations.ts';
2
3
  export type GoAccount = {
3
4
  id: string;
4
5
  name: string;
@@ -7,14 +8,20 @@ export type GoAccount = {
7
8
  export declare const MAX_ACCOUNTS = 20;
8
9
  export declare const ACCOUNT_REF_PREFIX = "DSH_OPENCODE_GO_ACCOUNT_";
9
10
  export declare const DEFAULT_ACCOUNT_REF = "OPENCODE_API_KEY";
11
+ /** A credential reference is a bare environment variable name, never empty or decorated. */
12
+ export declare const ACCOUNT_REF_PATTERN: RegExp;
10
13
  export interface AccountSettings {
11
14
  apiKeyEnv?: string;
12
15
  /** Omission/null preserves legacy credentials; an explicit empty list removes all accounts. */
13
16
  accounts?: readonly GoAccount[] | null;
14
17
  autoSwitch?: boolean;
18
+ /** Recovery intentions owned by this exact settings/profile document. */
19
+ accountOperations?: readonly GoAccountOperation[];
15
20
  }
16
21
  export declare function accountRefOf(settings: AccountSettings): string;
17
- /** Include an externally selected reference without rewriting existing configuration. */
22
+ /** Promote one account while preserving every other account's relative order. */
23
+ export declare function moveAccountFirst(accounts: readonly GoAccount[], ref: string): readonly GoAccount[];
24
+ /** Read legacy selections as the first account until the host persists their order. */
18
25
  export declare function accountsOf(settings: AccountSettings): readonly GoAccount[];
19
26
  export declare function assertAccounts(accounts: readonly GoAccount[] | null | undefined, selectedRef?: string): void;
20
27
  /** Safe UI notice for a successful request using a fallback account. */
@@ -28,6 +28,8 @@ import { OpencodeGoCatalog } from './catalog.ts';
28
28
  import { ProxyTransport } from './proxy.ts';
29
29
  import type { OpencodeGoConfig } from './config.ts';
30
30
  import { type GoAccountSwitch } from './accounts.ts';
31
+ import { type GoCallTrace } from './call-trace.ts';
32
+ export type { GoCallTrace } from './call-trace.ts';
31
33
  /**
32
34
  * The attachment-service bridges one image request reads. Construction-time
33
35
  * (context-dependent); the config-dependent policy numbers are merged per
@@ -39,10 +41,22 @@ export interface OpencodeGoImageAccess {
39
41
  /** Bridge one attachment reference into the current model-tool execution world. */
40
42
  resolveImageAccess: (attachments: AttachmentStore, ref: ImageAttachmentRef) => ImageAttachmentAccess | undefined;
41
43
  }
44
+ /** One request's serving account, with the identity captured before discovery. */
45
+ export interface GoAccountSettlement {
46
+ seq: number;
47
+ generation: number;
48
+ config: OpencodeGoConfig;
49
+ ref: string;
50
+ notice?: GoAccountSwitch;
51
+ }
42
52
  /** Constructor inputs for {@link OpencodeGoAdapter}. */
43
53
  export interface OpencodeGoAdapterOptions {
44
54
  /** Shared with Host usage reads for this plugin mount. */
45
55
  transport?: ProxyTransport;
56
+ /** Mount-owned discovery; direct construction supplies its own manager. */
57
+ catalog?: (config: OpencodeGoConfig) => OpencodeGoCatalog;
58
+ /** Optional directory for bounded HTTP error evidence; request contents are omitted. */
59
+ debugDirectory?: () => string | undefined;
46
60
  /**
47
61
  * The current configuration, re-read at every operation: a settings write
48
62
  * reaches the next request without a restart, and one operation never mixes
@@ -50,7 +64,9 @@ export interface OpencodeGoAdapterOptions {
50
64
  */
51
65
  config: () => OpencodeGoConfig;
52
66
  /** Resolve the credential reference captured with this call's endpoint; missing must fail loud. */
53
- resolveApiKey: (config: OpencodeGoConfig) => Promise<string | undefined>;
67
+ resolveApiKey: (config: OpencodeGoConfig, signal?: AbortSignal) => Promise<string | undefined>;
68
+ /** Observe one bounded, content-free summary for every dispatched call. */
69
+ onCallTrace?: (trace: GoCallTrace) => void;
54
70
  /**
55
71
  * Image input machinery; absent refuses image content, which is the posture
56
72
  * for direct construction without a durable attachment service behind it.
@@ -64,11 +80,17 @@ export interface OpencodeGoAdapterOptions {
64
80
  }) => void;
65
81
  /** Observe live ids the curated table cannot route. */
66
82
  onOmitted?: (ids: readonly string[]) => void;
83
+ onCatalogWarning?: (warning: string) => void;
67
84
  /** Observe assistant history degrading to provider-neutral conversion. */
68
85
  onReplayDegrade?: (reason: string) => void;
69
86
  /** Re-read picker models after a background catalog refresh commits. */
70
87
  onCatalogRefresh?: () => void;
71
- onAccountSwitch?: (notice: GoAccountSwitch | undefined, config: OpencodeGoConfig) => void;
88
+ /** Host account-state version for actual requests, captured before asynchronous model discovery. */
89
+ accountGeneration?: () => number;
90
+ /** One outcome for both the displayed notice and the persisted selection. */
91
+ onAccountSettled?: (event: GoAccountSettlement) => void;
92
+ /** Legacy notice observer. Hosts that persist selection should use onAccountSettled. */
93
+ onAccountSwitch?: (notice: GoAccountSwitch | undefined, config: OpencodeGoConfig, seq: number) => void;
72
94
  }
73
95
  /**
74
96
  * The single route's adapter. The catalog snapshot freezes at each operation,
@@ -77,16 +99,14 @@ export interface OpencodeGoAdapterOptions {
77
99
  */
78
100
  export declare class OpencodeGoAdapter extends LlmAdapter {
79
101
  private readonly options;
80
- /**
81
- * One catalog instance per endpoint/refresh pair. A settings write that
82
- * changes either gets a fresh resolver (and a fresh live-listing fetch) on
83
- * the next operation; an unchanged configuration keeps its cached snapshot
84
- * for the whole refresh interval.
85
- */
86
- private catalogCache;
102
+ private readonly resolveCatalog;
87
103
  private readonly transport;
88
104
  /** Per-reference rejection deadlines, isolated by the gateway that rejected it. */
89
105
  private readonly rejectedKeys;
106
+ /** Reference updates invalidate rejections from attempts using an older key. */
107
+ private readonly credentialVersions;
108
+ /** Monotonic sequence of the latest request this adapter started. */
109
+ private callSeq;
90
110
  constructor(options: OpencodeGoAdapterOptions);
91
111
  dispose(): Promise<void>;
92
112
  /**
@@ -103,8 +123,8 @@ export declare class OpencodeGoAdapter extends LlmAdapter {
103
123
  };
104
124
  listModels(_provider: string): Promise<readonly LlmModelInfo[]>;
105
125
  resolveModel(_provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
106
- /** Copy nested limits before discovery can yield to a settings update. */
107
- private callSnapshot;
126
+ /** Capture limits and protocol before discovery can yield to a settings update. */
127
+ private modelSnapshot;
108
128
  /** Keep capability resolution and eventual dispatch on the same configuration. */
109
129
  prepareCall(_provider: string, model: string, signal?: AbortSignal): Promise<{
110
130
  model: LlmResolvedModelInfo;
@@ -116,6 +136,8 @@ export declare class OpencodeGoAdapter extends LlmAdapter {
116
136
  private resolveReasoningLevel;
117
137
  stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
118
138
  private streamWithSnapshot;
139
+ private dispatch;
140
+ private streamAccounts;
119
141
  private rememberRejectedKey;
120
142
  /** A stored change to a reference outranks the gateway's last rejection of it. */
121
143
  forgetRejectedKey(ref: string): void;
@@ -0,0 +1,54 @@
1
+ import type { ImagePoolObservation } from './conversion/image-pool.ts';
2
+ type Outcome = 'completed' | 'failed' | 'aborted' | 'consumer-stopped';
3
+ type Stages = Partial<Record<'discovery' | 'credential' | 'images' | 'stream', number>>;
4
+ export interface GoAttemptTrace {
5
+ attempt: number;
6
+ elapsedMs: number;
7
+ stages: Stages;
8
+ outcome: Outcome;
9
+ code?: string;
10
+ httpStatus?: number;
11
+ requestId?: string;
12
+ /** First text, reasoning or tool argument delta, measured from attempt start. */
13
+ firstOutputMs?: number;
14
+ imagePool?: {
15
+ queueWaitMs: number;
16
+ maxActive: number;
17
+ maxQueued: number;
18
+ maxRetainedBytes: number;
19
+ rejected: boolean;
20
+ };
21
+ }
22
+ /** Safe per-call diagnostics: no transcript, credential, URL or raw session id. */
23
+ export interface GoCallTrace {
24
+ callId: string;
25
+ model: string;
26
+ elapsedMs: number;
27
+ stages: Stages;
28
+ attempts: number;
29
+ attemptDetails: readonly GoAttemptTrace[];
30
+ outcome: Outcome;
31
+ code?: string;
32
+ }
33
+ export declare class CallTrace {
34
+ private readonly model;
35
+ private readonly observer?;
36
+ private readonly started;
37
+ readonly callId: `${string}-${string}-${string}-${string}-${string}`;
38
+ readonly stages: GoCallTrace['stages'];
39
+ attempts: number;
40
+ outcome: GoCallTrace['outcome'];
41
+ code: string | undefined;
42
+ private readonly details;
43
+ private current;
44
+ private finished;
45
+ constructor(model: string, observer?: ((trace: GoCallTrace) => void) | undefined);
46
+ startAttempt(): void;
47
+ response(status: number, requestId?: string): void;
48
+ firstOutput(): void;
49
+ imagePool: (value: ImagePoolObservation) => void;
50
+ endAttempt(outcome?: Outcome, code?: string): void;
51
+ measure<T>(stage: keyof GoCallTrace['stages'], work: () => Promise<T>): Promise<T>;
52
+ finish(): void;
53
+ }
54
+ export {};
@@ -0,0 +1,20 @@
1
+ import { OpencodeGoCatalog } from './catalog.ts';
2
+ import type { OpencodeGoConfig } from './config-contract.ts';
3
+ import type { ProxyTransport } from './proxy.ts';
4
+ /** One mount owns discovery; inference, settings and pickers share its snapshots. */
5
+ export declare class GoCatalogManager {
6
+ private readonly options;
7
+ private current;
8
+ constructor(options: {
9
+ transport: ProxyTransport;
10
+ onFallback?: (detail: {
11
+ url: string;
12
+ error: unknown;
13
+ kept: number;
14
+ }) => void;
15
+ onOmitted?: (ids: readonly string[]) => void;
16
+ onRefresh?: () => void;
17
+ onWarning?: (warning: string) => void;
18
+ });
19
+ forConfig(config: OpencodeGoConfig): OpencodeGoCatalog;
20
+ }
@@ -1,9 +1,9 @@
1
- import type { Api, Model, Provider } from 'opencode-go-pi-ai';
1
+ import type { Api, Model, Provider } from './sdk-types.ts';
2
2
  import type { LlmDiscoveredModel } from '@deepseek-ai/dsh-llm';
3
3
  import { type GoModelCatalog } from './models-contract.ts';
4
4
  import type { ModelMetadata } from './model-metadata.ts';
5
5
  export { PROVIDER_ID, DISPLAY_NAME } from './provider-identity.ts';
6
- export declare const DEFAULT_BASE_URL = "https://opencode.ai/zen/go/v1";
6
+ export { DEFAULT_BASE_URL } from './gateway-url.ts';
7
7
  export interface CatalogSnapshot {
8
8
  readonly details: ModelMetadata['details'];
9
9
  readonly models: ReadonlyMap<string, Model<Api>>;
@@ -14,6 +14,7 @@ export interface CatalogSnapshot {
14
14
  readonly metadataLive: boolean;
15
15
  /** Retained for explicit discovery; runtime callers may still use the last catalog. */
16
16
  readonly listingFailure?: unknown;
17
+ readonly listingWarning?: string;
17
18
  readonly metadataFailure?: unknown;
18
19
  /** Last successful fetch or revalidation, not the time of a failed attempt. */
19
20
  readonly listingUpdatedAtMs?: number;
@@ -21,7 +22,7 @@ export interface CatalogSnapshot {
21
22
  readonly fetchedAtMs: number;
22
23
  }
23
24
  /** A valid empty listing means the gateway serves nothing; malformed replies are failures. */
24
- export declare function readLiveModelIds(body: unknown): readonly string[];
25
+ export declare function readLiveModelIds(body: unknown, onInvalidRows?: (warning: string) => void): readonly string[];
25
26
  /** Runtime requests reuse a snapshot; discovery revalidates it. Concurrent reads coalesce. */
26
27
  export declare class OpencodeGoCatalog {
27
28
  private readonly baseURL;
@@ -31,6 +32,7 @@ export declare class OpencodeGoCatalog {
31
32
  private readonly onOmitted;
32
33
  private readonly onRefresh;
33
34
  private readonly fetcher?;
35
+ private readonly onWarning?;
34
36
  private served;
35
37
  private pending;
36
38
  /** A cold runtime read can use disk metadata while the shared online refresh runs. */
@@ -49,7 +51,7 @@ export declare class OpencodeGoCatalog {
49
51
  kept: number;
50
52
  }) => void,
51
53
  /** Kept for API compatibility; now reports unconfigured ids rather than hiding them. */
52
- onOmitted: (ids: readonly string[]) => void, onRefresh?: () => void, fetcher?: typeof globalThis.fetch | undefined);
54
+ onOmitted: (ids: readonly string[]) => void, onRefresh?: () => void, fetcher?: typeof globalThis.fetch | undefined, onWarning?: ((warning: string) => void) | undefined);
53
55
  snapshot(force?: boolean, signal?: AbortSignal): Promise<CatalogSnapshot>;
54
56
  private restoreMetadata;
55
57
  private readSnapshot;
@@ -2,6 +2,9 @@ import type { Context } from '@deepseek-ai/cordis';
2
2
  import { type AccountSettings, type GoAccount } from '../accounts.ts';
3
3
  import type { GoUsage } from '../usage-contract.ts';
4
4
  import type { SettingsScope } from './settings.ts';
5
+ import type { AccountCommand } from '../accounts-contract.ts';
6
+ import type { SettingsWriteResult } from '../settings-bridge.ts';
7
+ export type ExecuteAccountCommand = (command: AccountCommand) => Promise<SettingsWriteResult>;
5
8
  export interface GoAccountView extends GoAccount {
6
9
  configured?: boolean;
7
10
  writable?: boolean;
@@ -25,6 +28,8 @@ export interface GoAccountsState {
25
28
  export interface GoAccountsActions {
26
29
  loadAccounts: () => void;
27
30
  addAccount: (name: string, key: string) => Promise<boolean>;
31
+ /** A newly opened addition form owns a fresh ID; retries keep its existing ID. */
32
+ resetAddition?: () => void;
28
33
  renameAccount: (ref: string, name: string) => Promise<boolean>;
29
34
  removeAccount: (ref: string) => Promise<boolean>;
30
35
  selectAccount: (ref: string) => Promise<boolean>;
@@ -40,6 +45,7 @@ export declare class GoAccountsController {
40
45
  private readonly readUsage;
41
46
  private readonly publish;
42
47
  private readonly blocked;
48
+ private readonly execute;
43
49
  private rows;
44
50
  private busy;
45
51
  private refreshing;
@@ -48,10 +54,11 @@ export declare class GoAccountsController {
48
54
  private identity;
49
55
  private loaded;
50
56
  private disposed;
57
+ private addition;
51
58
  constructor(scope: SettingsScope<AccountSettings & {
52
59
  baseURL?: string;
53
60
  proxyURL?: string;
54
- }>, ctx: Context, readUsage: (ref: string) => Promise<GoUsage>, publish: () => void, blocked: () => boolean);
61
+ }>, ctx: Context, readUsage: (ref: string) => Promise<GoUsage>, publish: () => void, blocked: () => boolean, execute?: ExecuteAccountCommand);
55
62
  snapshot(): GoAccountsState;
56
63
  sync(): void;
57
64
  dispose(): void;
@@ -60,21 +67,5 @@ export declare class GoAccountsController {
60
67
  /** Mark every account row as unreadable with the Host's own diagnostic. */
61
68
  private markUnreadable;
62
69
  actions(): GoAccountsActions;
63
- /**
64
- * Reorder the visible accounts and keep the preferred reference on the first row.
65
- * The adapter tries the preferred reference first and the rest in array order, so
66
- * one write is what makes top-to-bottom the real call order. A placeholder row the
67
- * settings never stored is materialized here, which its `legacy:` id admits.
68
- */
69
- private move;
70
- private account;
71
- private mutate;
72
- private add;
73
- /** Loaded rows answer from cache; anything they do not know is described on
74
- * the spot, so a placeholder decision never races the page's first describe. */
75
- private configuredOf;
76
- private rename;
77
- private select;
78
- private remove;
79
70
  private run;
80
71
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The hint mark a label carries and the sentence behind it.
3
+ *
4
+ * The Host's own Tooltip opens the sentence on hover and on keyboard focus, while
5
+ * the same sentence stays in the document so assistive technology reads it without
6
+ * opening anything. A Host that ships no question glyph still gets a mark, and a
7
+ * Host with no Tooltip keeps the sentence visible instead of hiding it.
8
+ */
9
+ /** A focusable help trigger; fields also retain their {@link HintText} description. */
10
+ export declare function HintMark(props: {
11
+ hint: string;
12
+ }): import("react").JSX.Element;
13
+ /** The hint sentence, at the id a control points its `aria-describedby` at. */
14
+ export declare function HintText(props: {
15
+ id: string;
16
+ hint: string;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type OpencodeGoSettings } from '../config-contract.ts';
3
+ import type { SettingsScope } from './settings.ts';
4
+ import type { ExecuteAccountCommand } from './accounts-controller.ts';
5
+ /** Only the boundary knows whether the host exposes profile forms or legacy scopes. */
6
+ export declare function mountSettingsScopes(ctx: Context, mount: (ctx: Context, scope: SettingsScope<OpencodeGoSettings>) => void): void;
7
+ export declare function accountCommands(ctx: Context): ExecuteAccountCommand;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Host UI atoms this page reaches for across DSH generations.
3
+ *
4
+ * Icon names moved from pixel size (`IconQuestionOutline14`, DSH 0.1.6 and older) to
5
+ * stroke weight (`IconQuestionOutlineRegular`, 0.1.7 and later), and the old alias is
6
+ * gone in 0.2. A missing atom is not a cosmetic loss here: React throws on an
7
+ * undefined element type, which takes the whole settings surface down with it, so
8
+ * every lookup resolves the current name first and keeps the older one behind it.
9
+ */
10
+ /** The atom's component, or undefined when this Host ships neither name. */
11
+ export declare function hostAtom<T>(host: Record<string, unknown>, current: string, previous: string): T | undefined;
@@ -96,6 +96,11 @@ export declare const en: {
96
96
  limitsModel: string;
97
97
  limitsContext: string;
98
98
  limitsOutput: string;
99
+ thinkingBudgets: string;
100
+ thinkingBudgetsHint: string;
101
+ thinkingBudgetAddLabel: string;
102
+ thinkingBudgetAdd: string;
103
+ thinkingBudgetRemove: string;
99
104
  capacityDefault: string;
100
105
  capacityMissing: string;
101
106
  modalityLabel: string;
@@ -131,16 +136,22 @@ export declare const en: {
131
136
  limitsEmpty: string;
132
137
  limitsContextLabel: string;
133
138
  limitsOutputLabel: string;
134
- advancedSummary: string;
139
+ advancedResetAll: string;
135
140
  advancedLabel: string;
141
+ groupUsageProtocol: string;
142
+ groupConnection: string;
143
+ groupCacheTimeouts: string;
144
+ groupImages: string;
136
145
  advancedHint: string;
137
146
  usageDisplayLabel: string;
138
147
  usageDisplayHint: string;
139
148
  usageDisplay_auto: string;
140
149
  usageDisplay_always: string;
141
150
  usageDisplay_off: string;
142
- apiKeyEnvLabel: string;
143
- apiKeyEnvHint: string;
151
+ protocolOverridesLabel: string;
152
+ protocolOverridesHint: string;
153
+ protocolOverridesAuto: string;
154
+ protocolOverridesResponses: string;
144
155
  baseURLLabel: string;
145
156
  baseURLHint: string;
146
157
  proxyURLLabel: string;