@saturn-universe/core 0.1.0 → 0.1.2-dev.2

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.
@@ -1250,6 +1250,7 @@ export interface ProviderProfile {
1250
1250
  readonly codecId: string;
1251
1251
  readonly codecVersion: number;
1252
1252
  readonly models: Readonly<Record<string, ModelCapabilities>>;
1253
+ readonly modelRoutes?: Readonly<Record<string, Partial<Pick<ProviderProfile, 'protocol' | 'baseURL'>>>>;
1253
1254
  }
1254
1255
  export interface ProviderBinding {
1255
1256
  readonly profileId: string;
package/dist/execution.js CHANGED
@@ -20,6 +20,9 @@ export function defaultModelTotalTimeoutMs(baselineMs, effort) {
20
20
  }
21
21
  export const maxModelReasoningSummaryLength = 32 * 1024;
22
22
  export function modelReasoningSummary(response, streamed) {
23
+ const captured = response.continuation.providerMetadata.reasoningSummary;
24
+ if (typeof captured === 'string' && captured.trim())
25
+ return captured.slice(0, maxModelReasoningSummaryLength);
23
26
  const canonical = response.continuation.outputItems
24
27
  .flatMap((item) => item.kind === 'reasoning'
25
28
  ? item.value.summary.flatMap((part) => part.type === 'summary_text' && typeof part.text === 'string' ? [part.text] : [])
@@ -27,6 +27,10 @@ export interface ProviderPreset {
27
27
  readonly defaultBaseUrl?: string;
28
28
  readonly defaultProtocol: ProviderProtocol;
29
29
  readonly defaultEnvKey: string;
30
+ readonly openCodeModelsUrl?: string;
30
31
  }
32
+ export declare const openCodeClientHeaders: {
33
+ readonly 'x-opencode-client': "saturn";
34
+ };
31
35
  export declare const providerPresets: readonly ProviderPreset[];
32
36
  export declare function normalizeProviderBaseUrl(value: string): string | undefined;
@@ -112,6 +112,7 @@ export const providerIdPattern = /^[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*$/;
112
112
  export function providerCredentialKey(id) {
113
113
  return `SATURN_PROVIDER_${id.toUpperCase().replaceAll('-', '_')}_API_KEY`;
114
114
  }
115
+ export const openCodeClientHeaders = { 'x-opencode-client': 'saturn' };
115
116
  export const providerPresets = [
116
117
  {
117
118
  id: 'openai',
@@ -143,8 +144,27 @@ export const providerPresets = [
143
144
  defaultBaseUrl: 'https://openrouter.ai/api/v1',
144
145
  defaultProtocol: 'openai-responses',
145
146
  },
146
- { id: 'custom', label: 'Custom', defaultProtocol: 'openai-responses' },
147
- ].map((preset) => ({ ...preset, defaultEnvKey: providerCredentialKey(preset.id) }));
147
+ {
148
+ id: 'opencode-go',
149
+ label: 'OpenCode Go Subscription',
150
+ defaultBaseUrl: 'https://opencode.ai/inference/go/openai/v1',
151
+ defaultProtocol: 'openai-chat',
152
+ defaultEnvKey: 'OPENCODE_API_KEY',
153
+ openCodeModelsUrl: 'https://opencode.ai/zen/go/v1/models',
154
+ },
155
+ {
156
+ id: 'opencode-zen',
157
+ label: 'OpenCode Zen',
158
+ defaultBaseUrl: 'https://opencode.ai/inference/openai/v1',
159
+ defaultProtocol: 'openai-chat',
160
+ defaultEnvKey: 'OPENCODE_API_KEY',
161
+ openCodeModelsUrl: 'https://opencode.ai/zen/v1/models',
162
+ },
163
+ { id: 'custom', label: 'Custom', defaultProtocol: 'openai-chat' },
164
+ ].map((preset) => ({
165
+ ...preset,
166
+ defaultEnvKey: 'defaultEnvKey' in preset ? preset.defaultEnvKey : providerCredentialKey(preset.id),
167
+ }));
148
168
  export function normalizeProviderBaseUrl(value) {
149
169
  try {
150
170
  const url = new URL(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saturn-universe/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2-dev.2",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "files": [