@moxxy/sdk 0.38.0 → 0.40.0

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.
package/src/provider.ts CHANGED
@@ -160,6 +160,16 @@ export interface ModelDescriptor {
160
160
  export interface LLMProvider {
161
161
  readonly name: string;
162
162
  readonly models: ReadonlyArray<ModelDescriptor>;
163
+ /**
164
+ * Optional provider-owned metadata preparation for a dynamically selected
165
+ * model. The runtime awaits it before it calculates context budgets, so a
166
+ * provider whose catalog is discovered at runtime can publish the exact
167
+ * descriptor without trusting a client-supplied context-window value.
168
+ */
169
+ prepareModel?(
170
+ model: string,
171
+ options?: { readonly signal?: AbortSignal },
172
+ ): Promise<void>;
163
173
  stream(req: ProviderRequest): AsyncIterable<ProviderEvent>;
164
174
  countTokens(req: Pick<ProviderRequest, 'model' | 'messages' | 'system' | 'tools'>): Promise<number>;
165
175
  }
@@ -202,6 +212,18 @@ export interface ProviderAuthContext {
202
212
  * whether they're running inside a wizard or a one-shot command.
203
213
  */
204
214
  readonly write: (chunk: string) => void;
215
+ /**
216
+ * True when a GUI host owns browser opening. OAuth implementations still
217
+ * build the loopback URL and report it through {@link onAuthUrl}, but must not
218
+ * invoke their process-local browser helper.
219
+ */
220
+ readonly noOpen?: boolean;
221
+ /**
222
+ * Browser authorization URL produced by a loopback flow. GUI hosts relay it
223
+ * over their authenticated transport, validate it again, and open it using
224
+ * their native browser API.
225
+ */
226
+ readonly onAuthUrl?: (url: string) => void;
205
227
  /**
206
228
  * Optional single-line input prompt. Present when the host has an
207
229
  * interactive TTY; absent in headless runs. Flows that need the user to
@@ -305,6 +327,12 @@ export interface ProviderOAuthStatus {
305
327
  export interface ProviderDef {
306
328
  readonly name: string;
307
329
  readonly models: ReadonlyArray<ModelDescriptor>;
330
+ /**
331
+ * True when the provider can return its current model catalog at runtime.
332
+ * Hosts use this capability signal to offer live discovery instead of
333
+ * presenting the provider's build-time fallback catalog as authoritative.
334
+ */
335
+ readonly supportsLiveModelDiscovery?: boolean;
308
336
  createClient(config: Record<string, unknown>): LLMProvider;
309
337
  /**
310
338
  * Optional provider-owned credential/config resolver. Hosts call this before
package/src/server.ts CHANGED
@@ -73,3 +73,14 @@ export {
73
73
  MOXXY_WS_SUBPROTOCOL,
74
74
  MOXXY_WS_BEARER_PROTOCOL_PREFIX,
75
75
  } from './channel-auth.js';
76
+ export {
77
+ execExecutableTargetSync,
78
+ executableCandidates,
79
+ findExecutable,
80
+ resolveExecutableTarget,
81
+ spawnExecutableTarget,
82
+ type ExecutableSearchOptions,
83
+ type ExecutableTarget,
84
+ type SafeExecFileSyncOptions,
85
+ type SafeSpawnOptions,
86
+ } from './process-invocation.js';