@camerontaylor/paseo-cli 0.11.1-fork.2 → 0.11.2-fork.1
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { type DaemonClient } from "@camerontaylor/paseo-client/internal/daemon-client";
|
|
2
3
|
import { connectToDaemon } from "../../utils/client.js";
|
|
3
4
|
import type { CommandOptions, SingleResult, OutputSchema } from "../../output/index.js";
|
|
5
|
+
import { type ResolvedProviderModel } from "../../utils/provider-model.js";
|
|
4
6
|
export { resolveProviderAndModel } from "../../utils/provider-model.js";
|
|
5
7
|
export declare function addRunOptions(cmd: Command): Command;
|
|
6
8
|
/** Result type for agent run command */
|
|
@@ -71,6 +73,11 @@ export interface RunWorkspaceLookupClient {
|
|
|
71
73
|
}>;
|
|
72
74
|
}
|
|
73
75
|
export declare function resolveExistingRunWorkspace(client: RunWorkspaceLookupClient, workspaceId: string): Promise<RunWorkspace>;
|
|
76
|
+
interface ResolveRunThinkingOptionInput extends ResolvedProviderModel {
|
|
77
|
+
cwd: string;
|
|
78
|
+
thinking: string | undefined;
|
|
79
|
+
}
|
|
80
|
+
export declare function resolveRunThinkingOption(client: Pick<DaemonClient, "listProviderModels">, input: ResolveRunThinkingOptionInput): Promise<string | undefined>;
|
|
74
81
|
export declare function runRunCommand(prompt: string, options: AgentRunOptions, _command: Command): Promise<SingleResult<AgentRunResult>>;
|
|
75
82
|
export interface RunCallerLookupClient {
|
|
76
83
|
fetchAgent(options: {
|
|
@@ -412,6 +412,19 @@ async function resolveRunWorkspace(client, options, cwd, callerAgentId) {
|
|
|
412
412
|
console.error("Tip: pass --workspace <id> (or set PASEO_WORKSPACE_ID) to run in an existing workspace.");
|
|
413
413
|
return { id: result.workspace.id, cwd: result.workspace.workspaceDirectory ?? cwd };
|
|
414
414
|
}
|
|
415
|
+
export async function resolveRunThinkingOption(client, input) {
|
|
416
|
+
if (input.thinking !== undefined)
|
|
417
|
+
return input.thinking;
|
|
418
|
+
const result = await client.listProviderModels(input.provider, { cwd: input.cwd });
|
|
419
|
+
if (result.error) {
|
|
420
|
+
throw { code: "PROVIDER_ERROR", message: result.error };
|
|
421
|
+
}
|
|
422
|
+
const models = result.models ?? [];
|
|
423
|
+
const model = input.model
|
|
424
|
+
? models.find((candidate) => candidate.id === input.model)
|
|
425
|
+
: (models.find((candidate) => candidate.isDefault) ?? models[0]);
|
|
426
|
+
return (model?.defaultThinkingOptionId ?? model?.thinkingOptions?.find((option) => option.isDefault)?.id);
|
|
427
|
+
}
|
|
415
428
|
export async function runRunCommand(prompt, options, _command) {
|
|
416
429
|
const outputSchema = options.outputSchema ? loadOutputSchema(options.outputSchema) : undefined;
|
|
417
430
|
validateRunOptions(prompt, options, outputSchema);
|
|
@@ -422,8 +435,8 @@ export async function runRunCommand(prompt, options, _command) {
|
|
|
422
435
|
try {
|
|
423
436
|
// Resolve working directory
|
|
424
437
|
const cwd = options.cwd ?? process.cwd();
|
|
425
|
-
const
|
|
426
|
-
if (options.thinking !== undefined && !
|
|
438
|
+
const requestedThinkingOptionId = options.thinking?.trim();
|
|
439
|
+
if (options.thinking !== undefined && !requestedThinkingOptionId) {
|
|
427
440
|
const error = {
|
|
428
441
|
code: "INVALID_THINKING_OPTION",
|
|
429
442
|
message: "--thinking cannot be empty",
|
|
@@ -439,6 +452,11 @@ export async function runRunCommand(prompt, options, _command) {
|
|
|
439
452
|
const workspace = await resolveRunWorkspace(client, options, cwd, callerAgentId);
|
|
440
453
|
const workspaceId = workspace.id;
|
|
441
454
|
const runCwd = workspace.cwd;
|
|
455
|
+
const thinkingOptionId = await resolveRunThinkingOption(client, {
|
|
456
|
+
...resolvedProviderModel,
|
|
457
|
+
cwd: runCwd,
|
|
458
|
+
thinking: requestedThinkingOptionId,
|
|
459
|
+
});
|
|
442
460
|
if (outputSchema) {
|
|
443
461
|
let structuredAgent = null;
|
|
444
462
|
const callStructuredTurn = async (structuredPrompt) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camerontaylor/paseo-cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2-fork.1",
|
|
4
4
|
"description": "Paseo CLI - control your AI coding agents from the command line",
|
|
5
5
|
"bin": {
|
|
6
6
|
"paseo": "bin/paseo"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.0.0",
|
|
31
|
-
"@camerontaylor/paseo-client": "0.11.
|
|
32
|
-
"@camerontaylor/paseo-protocol": "0.11.
|
|
33
|
-
"@camerontaylor/paseo-server": "0.11.
|
|
31
|
+
"@camerontaylor/paseo-client": "0.11.2-fork.1",
|
|
32
|
+
"@camerontaylor/paseo-protocol": "0.11.2-fork.1",
|
|
33
|
+
"@camerontaylor/paseo-server": "0.11.2-fork.1",
|
|
34
34
|
"chalk": "^5.3.0",
|
|
35
35
|
"commander": "^12.0.0",
|
|
36
36
|
"mime-types": "^2.1.35",
|