praxis-agent 0.62.7 → 0.63.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.
|
@@ -72,6 +72,8 @@ export interface ClaudeSessionServiceOptions {
|
|
|
72
72
|
providerForMainModel?: (model: string) => ModelProvider;
|
|
73
73
|
/** Creates one fresh main-turn provider per outer user turn; never used for auxiliary model calls. */
|
|
74
74
|
providerForTurn?: (model?: string) => ModelProvider;
|
|
75
|
+
/** Creates one fresh provider for each automatic session-name suggestion. */
|
|
76
|
+
sessionNameProviderFactory?: () => ModelProvider;
|
|
75
77
|
/** Creates a provider adapter dedicated to Session memory requests so
|
|
76
78
|
* adapter-local cache and retry state are not shared with the foreground. */
|
|
77
79
|
sessionMemoryProviderFactory?: () => ModelProvider;
|
|
@@ -1534,7 +1534,7 @@ export class ClaudeSessionService {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
async sessionNameSuggestion(sessionId, signal) {
|
|
1537
|
-
const provider = this.provider();
|
|
1537
|
+
const provider = this.options.sessionNameProviderFactory?.() ?? this.provider();
|
|
1538
1538
|
{
|
|
1539
1539
|
const transcript = new NativeSessionTranscript({
|
|
1540
1540
|
sessionId,
|
package/dist/cli-runtime.js
CHANGED
|
@@ -1047,6 +1047,7 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1047
1047
|
let providerForModel;
|
|
1048
1048
|
let providerForMainModel;
|
|
1049
1049
|
let providerForTurn;
|
|
1050
|
+
let sessionNameProviderFactory;
|
|
1050
1051
|
let providerBillingMode;
|
|
1051
1052
|
const context = parseContextEnvironment(runtimeEnvironment);
|
|
1052
1053
|
const apiKey = runtimeEnvironment.PRAXIS_API_KEY;
|
|
@@ -1186,6 +1187,9 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1186
1187
|
? defaultProvider
|
|
1187
1188
|
: createProviderStack(selectedModel, 'turn');
|
|
1188
1189
|
};
|
|
1190
|
+
if (registry.hasExplicitModelAlias('haiku')) {
|
|
1191
|
+
sessionNameProviderFactory = () => createProviderStack('haiku', 'completion');
|
|
1192
|
+
}
|
|
1189
1193
|
}
|
|
1190
1194
|
catch (error) {
|
|
1191
1195
|
const optionalProviderError = error instanceof ProviderAuthenticationError ||
|
|
@@ -1238,6 +1242,9 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1238
1242
|
...(!experimentalNativeTranscriptWrites && sessionMemoryProviderFactory
|
|
1239
1243
|
? { sessionMemoryProviderFactory }
|
|
1240
1244
|
: {}),
|
|
1245
|
+
...(!experimentalNativeTranscriptWrites && sessionNameProviderFactory
|
|
1246
|
+
? { sessionNameProviderFactory }
|
|
1247
|
+
: {}),
|
|
1241
1248
|
...(!experimentalNativeTranscriptWrites && sessionKind !== undefined
|
|
1242
1249
|
? { sessionKind }
|
|
1243
1250
|
: {}),
|
|
@@ -47,6 +47,7 @@ export type ProviderRegistrySourceMetadata = ProviderCredentialSourceMetadata;
|
|
|
47
47
|
export interface ProviderRegistry {
|
|
48
48
|
readonly target: ProviderTarget;
|
|
49
49
|
readonly credentialSource: ProviderRegistrySourceMetadata;
|
|
50
|
+
hasExplicitModelAlias(modelId: string): boolean;
|
|
50
51
|
create(modelId?: string): ModelProvider;
|
|
51
52
|
}
|
|
52
53
|
export declare function resolveProviderContextWindowTokens(options: {
|
|
@@ -228,6 +228,15 @@ class NativeProviderRegistry {
|
|
|
228
228
|
}
|
|
229
229
|
throw new ProviderRegistryError('unsupported_provider', `Unsupported provider protocol: ${target.protocol}`);
|
|
230
230
|
}
|
|
231
|
+
hasExplicitModelAlias(modelId) {
|
|
232
|
+
if (this.target.providerId !== 'anthropic' ||
|
|
233
|
+
this.target.protocol !== 'anthropic-messages')
|
|
234
|
+
return false;
|
|
235
|
+
if (modelId !== 'sonnet' && modelId !== 'opus' && modelId !== 'haiku')
|
|
236
|
+
return false;
|
|
237
|
+
const override = this.options.anthropicModelAliasOverrides?.[modelId];
|
|
238
|
+
return override !== undefined && override.trim().length > 0;
|
|
239
|
+
}
|
|
231
240
|
resolveTarget(target) {
|
|
232
241
|
if (target.providerId !== 'anthropic' ||
|
|
233
242
|
target.protocol !== 'anthropic-messages')
|