@tuned-tensor/cli 0.23.0 → 0.24.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/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2545,8 +2545,11 @@ import { dirname as dirname3, join as join6 } from "path";
|
|
|
2545
2545
|
function missingProviderAuthMessage() {
|
|
2546
2546
|
return "No API key is saved for the selected model. Run /login, or /model to pick a different one.";
|
|
2547
2547
|
}
|
|
2548
|
-
function unknownAgentProviderMessage(provider) {
|
|
2549
|
-
|
|
2548
|
+
function unknownAgentProviderMessage(provider, hint2 = "Use /login <id> or /model <id>.") {
|
|
2549
|
+
if (provider === "azure-openai-responses") {
|
|
2550
|
+
return `Pi renamed provider "azure-openai-responses" to "azure". Rename the provider key in ${getAgentAuthPath()} and ${getAgentModelsPath()} if present, then run \`tt agent configure --provider azure --model <model>\`. If TUNED_TENSOR_AGENT_PROVIDER is set, update it to azure too. Keep the api field "azure-openai-responses" and AZURE_OPENAI_* environment variables unchanged.`;
|
|
2551
|
+
}
|
|
2552
|
+
return `Unknown provider "${provider}". ${hint2}`;
|
|
2550
2553
|
}
|
|
2551
2554
|
function isRecord(value) {
|
|
2552
2555
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -2617,7 +2620,7 @@ function resolveAgentModelDefinition(runtime, selection) {
|
|
|
2617
2620
|
);
|
|
2618
2621
|
if (!provider) {
|
|
2619
2622
|
throw new Error(
|
|
2620
|
-
|
|
2623
|
+
unknownAgentProviderMessage(selection.provider, "Run `tt agent models --all` to list providers and models.")
|
|
2621
2624
|
);
|
|
2622
2625
|
}
|
|
2623
2626
|
if (selection.provider === "openrouter" && !runtime.getModel(selection.provider, selection.model)) {
|
|
@@ -3752,6 +3755,9 @@ ${account}
|
|
|
3752
3755
|
You have no general filesystem tools. Workspace-scoped capabilities can review the spec, propose a validated edit, prepare one new spec folder, or prepare a sealed pipeline dry-run; writes and previews require the user's approval.
|
|
3753
3756
|
${host}`;
|
|
3754
3757
|
}
|
|
3758
|
+
function withoutSystemMessages(messages) {
|
|
3759
|
+
return messages.filter((message) => message?.role !== "system");
|
|
3760
|
+
}
|
|
3755
3761
|
function defaultAgent(options) {
|
|
3756
3762
|
if (!options.streamSimple) {
|
|
3757
3763
|
throw new Error("The configured model runtime cannot stream this model.");
|
|
@@ -3859,7 +3865,7 @@ function createLocalAgentClient(options) {
|
|
|
3859
3865
|
model: selected.model,
|
|
3860
3866
|
thinking: selected.thinking,
|
|
3861
3867
|
systemPrompt: await systemPrompt(Boolean(options.cloudEnabled)),
|
|
3862
|
-
messages: state.messages,
|
|
3868
|
+
messages: withoutSystemMessages(state.messages),
|
|
3863
3869
|
tools,
|
|
3864
3870
|
streamSimple: options.modelRuntime.streamSimple?.bind(options.modelRuntime)
|
|
3865
3871
|
});
|
|
@@ -3910,7 +3916,7 @@ ${prompt}` : prompt));
|
|
|
3910
3916
|
signal?.removeEventListener("abort", abort);
|
|
3911
3917
|
unsubscribe();
|
|
3912
3918
|
}
|
|
3913
|
-
state.messages = agent.state.messages;
|
|
3919
|
+
state.messages = withoutSystemMessages(agent.state.messages);
|
|
3914
3920
|
if (state.thread.title === "New conversation") state.thread.title = titleFrom(options.store.redact(prompt));
|
|
3915
3921
|
state.thread.last_message_at = now();
|
|
3916
3922
|
await persist(state);
|
|
@@ -8735,7 +8741,7 @@ function registerAgentCommands(parent, options) {
|
|
|
8735
8741
|
agent.command("models").description("List provider models available to the local agent").option("--provider <provider>", "Filter by provider ID").option("--all", "Include models whose provider auth is not configured").action(async (commandOptions) => {
|
|
8736
8742
|
const runtime = await options.getRuntime();
|
|
8737
8743
|
if (commandOptions.provider && !runtime.getProviders().some((provider) => provider.id === commandOptions.provider)) {
|
|
8738
|
-
throw new Error(`
|
|
8744
|
+
throw new Error(unknownAgentProviderMessage(commandOptions.provider, "Run `tt agent models --all` to list providers and models."));
|
|
8739
8745
|
}
|
|
8740
8746
|
const models = listAgentModels(runtime, {
|
|
8741
8747
|
provider: commandOptions.provider,
|
|
@@ -13966,7 +13972,7 @@ ${formatCliUpdateNotice(update)}
|
|
|
13966
13972
|
}
|
|
13967
13973
|
|
|
13968
13974
|
// src/index.ts
|
|
13969
|
-
runCli("0.
|
|
13975
|
+
runCli("0.24.0").catch((err) => {
|
|
13970
13976
|
reportError(err);
|
|
13971
13977
|
process.exit(1);
|
|
13972
13978
|
});
|