engine7 7.1.64 → 7.1.65
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/cli.mjs +25 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -19762,6 +19762,8 @@ function parseCcRunArgs(argv) {
|
|
|
19762
19762
|
args.agentName = takeValue().trim();
|
|
19763
19763
|
} else if (a === "--resume") {
|
|
19764
19764
|
takeValue();
|
|
19765
|
+
} else if (a === "--model") {
|
|
19766
|
+
args.model = takeValue().trim();
|
|
19765
19767
|
}
|
|
19766
19768
|
}
|
|
19767
19769
|
if (!hasPrompt) {
|
|
@@ -19864,6 +19866,25 @@ async function runQuery(args) {
|
|
|
19864
19866
|
loadSecretsEnv(stateDir, configName);
|
|
19865
19867
|
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loader(), loader_exports));
|
|
19866
19868
|
const config = loadConfig2(configPath);
|
|
19869
|
+
let effectiveModel = config.model;
|
|
19870
|
+
if (args.model && args.model !== config.model) {
|
|
19871
|
+
const slash = args.model.indexOf("/");
|
|
19872
|
+
const pid = slash > 0 ? args.model.slice(0, slash) : "";
|
|
19873
|
+
const mid = slash > 0 ? args.model.slice(slash + 1) : args.model;
|
|
19874
|
+
const provExists = pid && config.providers?.[pid];
|
|
19875
|
+
const modelExists = provExists?.models?.some((m) => (typeof m === "string" ? m : m?.id) === mid);
|
|
19876
|
+
if (provExists && modelExists) {
|
|
19877
|
+
effectiveModel = args.model;
|
|
19878
|
+
config.provider = {
|
|
19879
|
+
...config.providers?.[pid],
|
|
19880
|
+
id: pid,
|
|
19881
|
+
models: config.providers?.[pid]?.models
|
|
19882
|
+
};
|
|
19883
|
+
console.log(`[cc-run] --model override: ${args.model} (found in providers)`);
|
|
19884
|
+
} else {
|
|
19885
|
+
console.log(`[cc-run] --model "${args.model}" not in config providers, using default ${config.model}`);
|
|
19886
|
+
}
|
|
19887
|
+
}
|
|
19867
19888
|
const { buildStablePrompt: buildStablePrompt2, buildDynamicPrompt: buildDynamicPrompt2 } = await Promise.resolve().then(() => (init_prompt(), prompt_exports));
|
|
19868
19889
|
const systemStable = buildStablePrompt2(config.workspace, config.prompt);
|
|
19869
19890
|
const systemDynamic = buildDynamicPrompt2({ workspace: config.workspace });
|
|
@@ -19872,7 +19893,7 @@ async function runQuery(args) {
|
|
|
19872
19893
|
const provider = createProvider2(config.provider);
|
|
19873
19894
|
const { QueryEngine: QueryEngine2 } = await Promise.resolve().then(() => (init_query(), query_exports));
|
|
19874
19895
|
const engine = new QueryEngine2(provider, {
|
|
19875
|
-
model:
|
|
19896
|
+
model: effectiveModel,
|
|
19876
19897
|
systemPrompt,
|
|
19877
19898
|
maxTokens: 4096,
|
|
19878
19899
|
temperature: 0.7,
|
|
@@ -19885,7 +19906,7 @@ async function runQuery(args) {
|
|
|
19885
19906
|
workspace: config.workspace,
|
|
19886
19907
|
providerId: config.provider.id,
|
|
19887
19908
|
providerApi: config.provider.api,
|
|
19888
|
-
model:
|
|
19909
|
+
model: effectiveModel,
|
|
19889
19910
|
scopeConfig: config.session,
|
|
19890
19911
|
restoreRecall: config.topics?.restoreRecall
|
|
19891
19912
|
});
|
|
@@ -19907,8 +19928,8 @@ async function runQuery(args) {
|
|
|
19907
19928
|
stateDir: config.stateDir,
|
|
19908
19929
|
providerId: config.provider.id,
|
|
19909
19930
|
providerApi: config.provider.api,
|
|
19910
|
-
model:
|
|
19911
|
-
modelInputs: config.provider.models?.find((m) => m.id ===
|
|
19931
|
+
model: effectiveModel,
|
|
19932
|
+
modelInputs: config.provider.models?.find((m) => m.id === effectiveModel)?.input || ["text"],
|
|
19912
19933
|
systemPrompt,
|
|
19913
19934
|
channels: config.channels,
|
|
19914
19935
|
config,
|