@qoder-ai/qoder-agent-sdk 1.0.39 → 1.0.41

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.
@@ -359,6 +359,8 @@ export type ModelInfo = {
359
359
  model?: string;
360
360
  /** BYOK: provider key, e.g. `'openai'`, `'deepseek'`. */
361
361
  provider?: string;
362
+ /** External-model provider, e.g. `'cmcc'`. */
363
+ outerProvider?: string;
362
364
  /** Rich context-window config from the server (tier labels → token_count). */
363
365
  context_config?: ModelContextConfig;
364
366
  /** Rich thinking config from the server (effort levels with descriptions). */
@@ -313,7 +313,7 @@ export type SDKControlGetModelPolicyResponse = {
313
313
  type: 'get_model_policy';
314
314
  /** Optional model override. Omitted means keep the CLI-resolved model. */
315
315
  model?: string;
316
- /** Optional per-request model policy parameters (contextWindow, reasoningEffort). */
316
+ /** Optional per-request model policy parameters, including outerProvider. */
317
317
  parameters?: Record<string, unknown>;
318
318
  /**
319
319
  * Optional per-call BYOK credential payload. When present, the CLI
@@ -130,7 +130,7 @@ export type SDKResultSuccess = {
130
130
  usage: NonNullableUsage;
131
131
  modelUsage: Record<string, ModelUsage>;
132
132
  permission_denials: SDKPermissionDenial[];
133
- error_code?: number;
133
+ error_code?: number | string;
134
134
  deferred_tool_use?: unknown;
135
135
  terminal_reason?: string | null;
136
136
  fast_mode_state?: FastModeState;
@@ -153,7 +153,7 @@ export type SDKResultError = {
153
153
  modelUsage: Record<string, ModelUsage>;
154
154
  permission_denials: SDKPermissionDenial[];
155
155
  errors: string[];
156
- error_code?: number;
156
+ error_code?: number | string;
157
157
  terminal_reason?: string | null;
158
158
  fast_mode_state?: FastModeState;
159
159
  origin?: SDKMessageOrigin;
@@ -332,6 +332,7 @@ export declare class QueryRunner implements InternalQuery {
332
332
  getAvailableModels(options?: {
333
333
  fetchStrategy?: 'live' | 'cache';
334
334
  uid?: string;
335
+ outerProviders?: string[];
335
336
  }): Promise<ModelInfo[]>;
336
337
  /**
337
338
  * List the available BYOK (Bring Your Own Key) providers and their supported models.
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "version": 1,
3
3
  "brand": "global",
4
- "sdkVersion": "1.0.39",
5
- "qoderCliVersion": "1.1.49",
4
+ "sdkVersion": "1.0.41",
5
+ "qoderCliVersion": "1.1.53",
6
6
  "defaultTransport": "worker",
7
7
  "workerRuntime": {
8
8
  "packaged": false,
9
9
  "delivery": "install",
10
10
  "source": "qodercli-worker-runtime",
11
- "urlTemplate": "https://download.qoder.com/qodercli/releases/1.1.49/qodercli-worker-runtime-{target}.tgz",
11
+ "urlTemplate": "https://download.qoder.com/qodercli/releases/1.1.53/qodercli-worker-runtime-{target}.tgz",
12
12
  "artifactNameTemplate": "qodercli-worker-runtime-{target}.tgz",
13
- "sdkVersion": "1.0.39",
14
- "qoderCliVersion": "1.1.49"
13
+ "sdkVersion": "1.0.41",
14
+ "qoderCliVersion": "1.1.53"
15
15
  }
16
16
  }
@@ -40,6 +40,17 @@ export interface ModelPolicyContext {
40
40
  /**
41
41
  * Result returned by the resolveModel callback.
42
42
  */
43
+ export interface ModelPolicyParameters extends Record<string, unknown> {
44
+ /** Context window token count advertised by the selected model. */
45
+ contextWindow?: number;
46
+ /** Reasoning effort advertised by the selected model. */
47
+ reasoningEffort?: string;
48
+ /**
49
+ * External-provider routing for this request. It must match the provider
50
+ * declared by the selected model catalog entry.
51
+ */
52
+ outerProvider?: string;
53
+ }
43
54
  export interface ModelPolicyResult {
44
55
  /**
45
56
  * Selected model identifier, or a BYOK custom model object.
@@ -52,8 +63,8 @@ export interface ModelPolicyResult {
52
63
  model?: string | (CustomModel & {
53
64
  model: string;
54
65
  });
55
- /** Optional per-request model policy parameters (contextWindow, reasoningEffort). */
56
- parameters?: Record<string, unknown>;
66
+ /** Optional per-request model policy parameters. */
67
+ parameters?: ModelPolicyParameters;
57
68
  /**
58
69
  * Optional routing scene label sent as the inference request body `task_id`.
59
70
  * The server selects models by it; internal CLI tasks keep their own values.
@@ -323,8 +323,11 @@ export type Options = {
323
323
  * Pull-mode model selection callback.
324
324
  *
325
325
  * When provided, the SDK enters pull mode: the CLI asks the SDK before
326
- * every LLM call, and this callback is the sole decider of the model.
327
- * `options.model` and the CLI's model router are bypassed.
326
+ * every LLM call. The CLI first resolves the local base model from
327
+ * `options.model`, settings, and its model router, then exposes that result
328
+ * to the callback as `resolvedModel` when available. The callback may keep
329
+ * or override the model; overrides without an inline `customModel` are
330
+ * validated by the CLI's normal model-routing chain before inference.
328
331
  *
329
332
  * When omitted, the SDK uses push mode: the CLI uses its local resolution
330
333
  * chain (`options.model` / settings / model router).
@@ -517,6 +520,8 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
517
520
  getAvailableModels(options?: {
518
521
  fetchStrategy?: 'live' | 'cache';
519
522
  uid?: string;
523
+ /** External-model providers to append to the normal model list. */
524
+ outerProviders?: string[];
520
525
  }): Promise<ModelInfo[]>;
521
526
  /**
522
527
  * List the available BYOK (Bring Your Own Key) providers and their supported models.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoder-ai/qoder-agent-sdk",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "TypeScript SDK for building Qoder-powered coding agents.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "peerDependencies": {
51
51
  "zod": "^3.25.0 || ^4.0.0"
52
52
  },
53
- "qoderCliVersion": "1.1.49",
53
+ "qoderCliVersion": "1.1.53",
54
54
  "qoderSdkBrand": "global",
55
55
  "license": "SEE LICENSE IN LICENSE"
56
56
  }