topchester-ai 0.57.0 → 0.59.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/bin.mjs +1 -1
- package/dist/bin.mjs.map +1 -1
- package/dist/{cli-kvaa3acN.mjs → cli-DNu9mjMF.mjs} +52 -29
- package/dist/cli-DNu9mjMF.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/package.json +13 -13
- package/dist/cli-kvaa3acN.mjs.map +0 -1
package/dist/bin.mjs
CHANGED
package/dist/bin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.mjs","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runTopchesterCli } from \"./cli.js\";\n\nawait runTopchesterCli();\n"],"mappings":";;;AAGA,MAAM,
|
|
1
|
+
{"version":3,"file":"bin.mjs","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runTopchesterCli } from \"./cli.js\";\n\nawait runTopchesterCli();\n"],"mappings":";;;AAGA,MAAM,iBAAiB"}
|
|
@@ -5677,6 +5677,7 @@ var ModelGateway = class ModelGateway {
|
|
|
5677
5677
|
providerId: resolved.providerId,
|
|
5678
5678
|
modelId: resolved.modelId,
|
|
5679
5679
|
purpose: resolved.purpose,
|
|
5680
|
+
...resolved.providerConfig.reasoningEffort ? { reasoningEffort: resolved.providerConfig.reasoningEffort } : {},
|
|
5680
5681
|
...usage ? { usage } : {}
|
|
5681
5682
|
};
|
|
5682
5683
|
}
|
|
@@ -5763,6 +5764,7 @@ var ModelGateway = class ModelGateway {
|
|
|
5763
5764
|
providerId: resolved.providerId,
|
|
5764
5765
|
modelId: resolved.modelId,
|
|
5765
5766
|
purpose: resolved.purpose,
|
|
5767
|
+
...resolved.providerConfig.reasoningEffort ? { reasoningEffort: resolved.providerConfig.reasoningEffort } : {},
|
|
5766
5768
|
...usage ? { usage } : {},
|
|
5767
5769
|
toolCalls,
|
|
5768
5770
|
toolProtocol: "native-openai-compatible",
|
|
@@ -5798,6 +5800,7 @@ var ModelGateway = class ModelGateway {
|
|
|
5798
5800
|
providerId: resolved.providerId,
|
|
5799
5801
|
modelId: resolved.modelId,
|
|
5800
5802
|
purpose: resolved.purpose,
|
|
5803
|
+
...resolved.providerConfig.reasoningEffort ? { reasoningEffort: resolved.providerConfig.reasoningEffort } : {},
|
|
5801
5804
|
...usage ? { usage } : {},
|
|
5802
5805
|
toolCalls: parsed ? [{
|
|
5803
5806
|
id: `${parsed.source}-0`,
|
|
@@ -9867,19 +9870,11 @@ const slashCommandSuggestions = [
|
|
|
9867
9870
|
},
|
|
9868
9871
|
{
|
|
9869
9872
|
value: "/effort",
|
|
9870
|
-
description:
|
|
9871
|
-
},
|
|
9872
|
-
{
|
|
9873
|
-
value: "/effort high",
|
|
9874
|
-
description: "set reasoning effort to high"
|
|
9873
|
+
description: `show or set reasoning effort (${reasoningEfforts.join(", ")}, clear)`
|
|
9875
9874
|
},
|
|
9876
9875
|
{
|
|
9877
9876
|
value: "/reasoning",
|
|
9878
|
-
description:
|
|
9879
|
-
},
|
|
9880
|
-
{
|
|
9881
|
-
value: "/reasoning high",
|
|
9882
|
-
description: "set reasoning effort to high"
|
|
9877
|
+
description: `show or set reasoning effort (${reasoningEfforts.join(", ")}, clear)`
|
|
9883
9878
|
},
|
|
9884
9879
|
{
|
|
9885
9880
|
value: "/kb status",
|
|
@@ -10116,8 +10111,24 @@ function getSlashCommandSuggestions(input) {
|
|
|
10116
10111
|
const trimmed = input.trimStart();
|
|
10117
10112
|
if (!trimmed.startsWith("/")) return [];
|
|
10118
10113
|
const query = trimmed.toLowerCase();
|
|
10114
|
+
const reasoningSuggestions = getReasoningEffortValueSuggestions(query);
|
|
10115
|
+
if (reasoningSuggestions) return reasoningSuggestions;
|
|
10119
10116
|
return slashCommandSuggestions.filter((suggestion) => suggestion.value.toLowerCase().startsWith(query));
|
|
10120
10117
|
}
|
|
10118
|
+
function getReasoningEffortValueSuggestions(query) {
|
|
10119
|
+
const match = /^\/(?<command>effort|reasoning)\s+(?<value>\S*)$/u.exec(query);
|
|
10120
|
+
if (!match?.groups) return;
|
|
10121
|
+
const command = match.groups.command;
|
|
10122
|
+
const valuePrefix = match.groups.value;
|
|
10123
|
+
return [
|
|
10124
|
+
...reasoningEfforts,
|
|
10125
|
+
"clear",
|
|
10126
|
+
"default"
|
|
10127
|
+
].filter((option) => option.startsWith(valuePrefix)).map((option) => ({
|
|
10128
|
+
value: `/${command} ${option}`,
|
|
10129
|
+
description: option === "clear" || option === "default" ? "use provider default reasoning effort" : `set reasoning effort to ${option}`
|
|
10130
|
+
}));
|
|
10131
|
+
}
|
|
10121
10132
|
async function executeKbCommand(args, context) {
|
|
10122
10133
|
const subcommand = args[0];
|
|
10123
10134
|
if (subcommand === "status") return { messages: formatKnowledgeCompileStatusResult(filterNonCleanKnowledgeCompileResult(await dryRunKnowledgeCompile(context.workspaceRoot, { config: context.config })), { formatSyncStatus: context.formatSyncStatus }) };
|
|
@@ -13003,9 +13014,13 @@ var TopchesterAgentRuntime = class TopchesterAgentRuntime {
|
|
|
13003
13014
|
profile,
|
|
13004
13015
|
permissions
|
|
13005
13016
|
}, projectInstructions);
|
|
13017
|
+
const modelRequestMetadata = this.resolveModelMetadata("agent.primary");
|
|
13006
13018
|
this.context.logger.debug({
|
|
13007
13019
|
event: "model_prompt",
|
|
13008
13020
|
purpose: "agent.primary",
|
|
13021
|
+
providerId: modelRequestMetadata?.providerId,
|
|
13022
|
+
modelId: modelRequestMetadata?.modelId,
|
|
13023
|
+
reasoningEffort: modelRequestMetadata?.providerConfig.reasoningEffort,
|
|
13009
13024
|
afterTool,
|
|
13010
13025
|
toolProtocol: toolProtocolOverride,
|
|
13011
13026
|
promptLength: nextPrompt.length,
|
|
@@ -13036,6 +13051,8 @@ var TopchesterAgentRuntime = class TopchesterAgentRuntime {
|
|
|
13036
13051
|
event: "model_response",
|
|
13037
13052
|
purpose: "agent.primary",
|
|
13038
13053
|
modelId: result.modelId,
|
|
13054
|
+
providerId: result.providerId,
|
|
13055
|
+
reasoningEffort: result.reasoningEffort,
|
|
13039
13056
|
durationMs,
|
|
13040
13057
|
totalDurationMs,
|
|
13041
13058
|
textLength: result.text.length,
|
|
@@ -13059,6 +13076,8 @@ var TopchesterAgentRuntime = class TopchesterAgentRuntime {
|
|
|
13059
13076
|
event: "model_response_text",
|
|
13060
13077
|
purpose: "agent.primary",
|
|
13061
13078
|
modelId: result.modelId,
|
|
13079
|
+
providerId: result.providerId,
|
|
13080
|
+
reasoningEffort: result.reasoningEffort,
|
|
13062
13081
|
afterTool,
|
|
13063
13082
|
toolProtocol: result.toolProtocol,
|
|
13064
13083
|
text: result.text
|
|
@@ -13419,30 +13438,34 @@ var TopchesterAgentRuntime = class TopchesterAgentRuntime {
|
|
|
13419
13438
|
};
|
|
13420
13439
|
}
|
|
13421
13440
|
createHookModelPayload(purpose) {
|
|
13441
|
+
const resolved = this.resolveModelMetadata(purpose);
|
|
13442
|
+
if (!resolved) return {};
|
|
13443
|
+
const modelRef = `${resolved.providerId}/${resolved.modelId}`;
|
|
13444
|
+
return {
|
|
13445
|
+
model_purpose: resolved.purpose,
|
|
13446
|
+
model_provider: resolved.providerId,
|
|
13447
|
+
model_id: resolved.modelId,
|
|
13448
|
+
model_ref: modelRef,
|
|
13449
|
+
model: {
|
|
13450
|
+
purpose: resolved.purpose,
|
|
13451
|
+
providerId: resolved.providerId,
|
|
13452
|
+
modelId: resolved.modelId,
|
|
13453
|
+
ref: modelRef
|
|
13454
|
+
}
|
|
13455
|
+
};
|
|
13456
|
+
}
|
|
13457
|
+
resolveModelMetadata(purpose) {
|
|
13422
13458
|
const resolveModel = this.context.modelGateway.resolveModel;
|
|
13423
|
-
if (typeof resolveModel !== "function") return
|
|
13459
|
+
if (typeof resolveModel !== "function") return;
|
|
13424
13460
|
try {
|
|
13425
|
-
|
|
13426
|
-
const modelRef = `${resolved.providerId}/${resolved.modelId}`;
|
|
13427
|
-
return {
|
|
13428
|
-
model_purpose: resolved.purpose,
|
|
13429
|
-
model_provider: resolved.providerId,
|
|
13430
|
-
model_id: resolved.modelId,
|
|
13431
|
-
model_ref: modelRef,
|
|
13432
|
-
model: {
|
|
13433
|
-
purpose: resolved.purpose,
|
|
13434
|
-
providerId: resolved.providerId,
|
|
13435
|
-
modelId: resolved.modelId,
|
|
13436
|
-
ref: modelRef
|
|
13437
|
-
}
|
|
13438
|
-
};
|
|
13461
|
+
return resolveModel.call(this.context.modelGateway, purpose);
|
|
13439
13462
|
} catch (error) {
|
|
13440
13463
|
this.context.logger.debug({
|
|
13441
|
-
event: "
|
|
13464
|
+
event: "model_resolution_skipped",
|
|
13442
13465
|
purpose,
|
|
13443
13466
|
error: error instanceof Error ? error.message : String(error)
|
|
13444
|
-
}, "
|
|
13445
|
-
return
|
|
13467
|
+
}, "model metadata unavailable");
|
|
13468
|
+
return;
|
|
13446
13469
|
}
|
|
13447
13470
|
}
|
|
13448
13471
|
createToolHookPayload(event, call, toolCallId, session, extra = {}) {
|
|
@@ -16168,4 +16191,4 @@ function formatDryRunSyncStatus(status) {
|
|
|
16168
16191
|
//#endregion
|
|
16169
16192
|
export { runTopchesterCli as t };
|
|
16170
16193
|
|
|
16171
|
-
//# sourceMappingURL=cli-
|
|
16194
|
+
//# sourceMappingURL=cli-DNu9mjMF.mjs.map
|