@oxap/sdk 0.1.0-alpha.34 → 0.1.0-alpha.36

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/README.md CHANGED
@@ -524,10 +524,15 @@ type RunOptions = {
524
524
  */
525
525
  session_id?: string;
526
526
  metadata?: Record<string, string>;
527
+ headers?: Record<string, string>;
527
528
  signal?: AbortSignal;
528
529
  };
529
530
  ```
530
531
 
532
+ `headers` go on a direct provider call only; an agent run refuses them. The
533
+ endpoint decides which headers it forwards to the provider and refuses the rest
534
+ with `unsupported_feature`.
535
+
531
536
  Core namespaces:
532
537
 
533
538
  ```ts
@@ -58,6 +58,7 @@ export interface RunOptions {
58
58
  auth_retry_policy?: AuthRetryPolicy;
59
59
  session_id?: string;
60
60
  metadata?: Record<string, string>;
61
+ headers?: Record<string, string>;
61
62
  signal?: AbortSignal;
62
63
  }
63
64
  export type UsageCountField = "input_tokens" | "output_tokens" | "total_tokens" | "cache_read_input_tokens" | "cache_write_input_tokens" | "reasoning_tokens";
@@ -499,6 +499,7 @@ class OapProviderApi {
499
499
  ...(request.options?.temperature !== undefined ? { temperature: request.options.temperature } : {}),
500
500
  ...(request.options?.reasoning_effort && request.options.reasoning_effort !== "off" ? { reasoning: { enabled: true, effort: request.options.reasoning_effort } } : {}),
501
501
  ...(request.options?.metadata ? { metadata: request.options.metadata } : {}),
502
+ ...(request.options?.headers && Object.keys(request.options.headers).length ? { headers: request.options.headers } : {}),
502
503
  });
503
504
  if (create.type !== "inference.create.response")
504
505
  throw new models_types_1.MakaiProtocolError(`unexpected ${create.type}`, "malformed_response");
@@ -879,6 +880,8 @@ class OapAgentApi {
879
880
  unsupported("temperature on an agent run");
880
881
  if (request.options?.reasoning_effort === "minimal")
881
882
  unsupported("minimal reasoning, which the agent loop runs as low");
883
+ if (request.options?.headers && Object.keys(request.options.headers).length)
884
+ unsupported("request headers on an agent run; they reach a provider only on a direct provider call");
882
885
  const maxTokens = request.options?.max_tokens;
883
886
  if (maxTokens !== undefined && (!Number.isInteger(maxTokens) || maxTokens < 1 || maxTokens > 4_294_967_295))
884
887
  throw new models_types_1.MakaiProtocolError("max_tokens must be an integer between 1 and 4294967295", "invalid_request");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxap/sdk",
3
- "version": "0.1.0-alpha.34",
3
+ "version": "0.1.0-alpha.36",
4
4
  "description": "TypeScript SDK for the Open Agent Protocol project's runtime, over its stdio protocol",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -41,6 +41,6 @@
41
41
  "ulid": "^3.0.2"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@oxap/cli": "0.1.0-alpha.34"
44
+ "@oxap/cli": "0.1.0-alpha.36"
45
45
  }
46
46
  }