@camerontaylor/paseo-cli 0.8.0-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.
- package/bin/paseo +3 -0
- package/dist/classify.d.ts +19 -0
- package/dist/classify.js +49 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +135 -0
- package/dist/commands/agent/archive.d.ts +18 -0
- package/dist/commands/agent/archive.js +102 -0
- package/dist/commands/agent/attach.d.ts +11 -0
- package/dist/commands/agent/attach.js +161 -0
- package/dist/commands/agent/delete.d.ts +15 -0
- package/dist/commands/agent/delete.js +107 -0
- package/dist/commands/agent/detach.d.ts +9 -0
- package/dist/commands/agent/detach.js +38 -0
- package/dist/commands/agent/import.d.ts +14 -0
- package/dist/commands/agent/import.js +122 -0
- package/dist/commands/agent/index.d.ts +3 -0
- package/dist/commands/agent/index.js +56 -0
- package/dist/commands/agent/inspect.d.ts +15 -0
- package/dist/commands/agent/inspect.js +209 -0
- package/dist/commands/agent/logs.d.ts +19 -0
- package/dist/commands/agent/logs.js +180 -0
- package/dist/commands/agent/ls.d.ts +44 -0
- package/dist/commands/agent/ls.js +212 -0
- package/dist/commands/agent/mode.d.ts +18 -0
- package/dist/commands/agent/mode.js +100 -0
- package/dist/commands/agent/open.d.ts +11 -0
- package/dist/commands/agent/open.js +61 -0
- package/dist/commands/agent/reload.d.ts +15 -0
- package/dist/commands/agent/reload.js +75 -0
- package/dist/commands/agent/run.d.ts +78 -0
- package/dist/commands/agent/run.js +554 -0
- package/dist/commands/agent/send.d.ts +19 -0
- package/dist/commands/agent/send.js +187 -0
- package/dist/commands/agent/stop.d.ts +17 -0
- package/dist/commands/agent/stop.js +115 -0
- package/dist/commands/agent/update.d.ts +51 -0
- package/dist/commands/agent/update.js +186 -0
- package/dist/commands/agent/wait.d.ts +17 -0
- package/dist/commands/agent/wait.js +158 -0
- package/dist/commands/clone.d.ts +17 -0
- package/dist/commands/clone.js +65 -0
- package/dist/commands/daemon/index.d.ts +3 -0
- package/dist/commands/daemon/index.js +60 -0
- package/dist/commands/daemon/local-daemon.d.ts +78 -0
- package/dist/commands/daemon/local-daemon.js +547 -0
- package/dist/commands/daemon/pair.d.ts +35 -0
- package/dist/commands/daemon/pair.js +167 -0
- package/dist/commands/daemon/reload.d.ts +10 -0
- package/dist/commands/daemon/reload.js +36 -0
- package/dist/commands/daemon/restart.d.ts +12 -0
- package/dist/commands/daemon/restart.js +99 -0
- package/dist/commands/daemon/runtime-toolchain.d.ts +6 -0
- package/dist/commands/daemon/runtime-toolchain.js +87 -0
- package/dist/commands/daemon/set-password.d.ts +17 -0
- package/dist/commands/daemon/set-password.js +82 -0
- package/dist/commands/daemon/start.d.ts +6 -0
- package/dist/commands/daemon/start.js +57 -0
- package/dist/commands/daemon/status.d.ts +21 -0
- package/dist/commands/daemon/status.js +363 -0
- package/dist/commands/daemon/stop.d.ts +15 -0
- package/dist/commands/daemon/stop.js +60 -0
- package/dist/commands/heartbeat/index.d.ts +3 -0
- package/dist/commands/heartbeat/index.js +139 -0
- package/dist/commands/hooks.d.ts +19 -0
- package/dist/commands/hooks.js +89 -0
- package/dist/commands/hub/authority.d.ts +17 -0
- package/dist/commands/hub/authority.js +18 -0
- package/dist/commands/hub/connect.d.ts +23 -0
- package/dist/commands/hub/connect.js +44 -0
- package/dist/commands/hub/credentials.d.ts +21 -0
- package/dist/commands/hub/credentials.js +143 -0
- package/dist/commands/hub/daemon-client.d.ts +40 -0
- package/dist/commands/hub/daemon-client.js +14 -0
- package/dist/commands/hub/deploy-bundle.d.ts +16 -0
- package/dist/commands/hub/deploy-bundle.js +248 -0
- package/dist/commands/hub/deploy-triggers.d.ts +6 -0
- package/dist/commands/hub/deploy-triggers.js +116 -0
- package/dist/commands/hub/deploy.d.ts +50 -0
- package/dist/commands/hub/deploy.js +159 -0
- package/dist/commands/hub/disconnect.d.ts +16 -0
- package/dist/commands/hub/disconnect.js +24 -0
- package/dist/commands/hub/error.d.ts +6 -0
- package/dist/commands/hub/error.js +9 -0
- package/dist/commands/hub/export.d.ts +28 -0
- package/dist/commands/hub/export.js +80 -0
- package/dist/commands/hub/help.d.ts +3 -0
- package/dist/commands/hub/help.js +5 -0
- package/dist/commands/hub/hub-client/index.d.ts +22 -0
- package/dist/commands/hub/hub-client/index.js +135 -0
- package/dist/commands/hub/hub-client/internal/contracts.d.ts +126 -0
- package/dist/commands/hub/hub-client/internal/contracts.js +85 -0
- package/dist/commands/hub/hub-client/internal/problem.d.ts +3 -0
- package/dist/commands/hub/hub-client/internal/problem.js +85 -0
- package/dist/commands/hub/hub-client/internal/transport.d.ts +15 -0
- package/dist/commands/hub/hub-client/internal/transport.js +30 -0
- package/dist/commands/hub/index.d.ts +20 -0
- package/dist/commands/hub/index.js +94 -0
- package/dist/commands/hub/init-plan.d.ts +33 -0
- package/dist/commands/hub/init-plan.js +94 -0
- package/dist/commands/hub/init.d.ts +35 -0
- package/dist/commands/hub/init.js +524 -0
- package/dist/commands/hub/login-flow.d.ts +34 -0
- package/dist/commands/hub/login-flow.js +78 -0
- package/dist/commands/hub/login.d.ts +23 -0
- package/dist/commands/hub/login.js +40 -0
- package/dist/commands/hub/logout.d.ts +32 -0
- package/dist/commands/hub/logout.js +71 -0
- package/dist/commands/hub/origin.d.ts +2 -0
- package/dist/commands/hub/origin.js +27 -0
- package/dist/commands/hub/permissions.d.ts +21 -0
- package/dist/commands/hub/permissions.js +61 -0
- package/dist/commands/hub/projects.d.ts +24 -0
- package/dist/commands/hub/projects.js +49 -0
- package/dist/commands/hub/reporter.d.ts +10 -0
- package/dist/commands/hub/reporter.js +11 -0
- package/dist/commands/hub/starter-agent-runtime.d.ts +37 -0
- package/dist/commands/hub/starter-agent-runtime.js +49 -0
- package/dist/commands/hub/starter-trigger.d.ts +10 -0
- package/dist/commands/hub/starter-trigger.js +30 -0
- package/dist/commands/hub/status-output.d.ts +13 -0
- package/dist/commands/hub/status-output.js +30 -0
- package/dist/commands/onboard.d.ts +10 -0
- package/dist/commands/onboard.js +400 -0
- package/dist/commands/open.d.ts +4 -0
- package/dist/commands/open.js +89 -0
- package/dist/commands/permit/allow.d.ts +20 -0
- package/dist/commands/permit/allow.js +133 -0
- package/dist/commands/permit/deny.d.ts +12 -0
- package/dist/commands/permit/deny.js +105 -0
- package/dist/commands/permit/index.d.ts +3 -0
- package/dist/commands/permit/index.js +27 -0
- package/dist/commands/permit/ls.d.ts +18 -0
- package/dist/commands/permit/ls.js +66 -0
- package/dist/commands/plugin/index.d.ts +17 -0
- package/dist/commands/plugin/index.js +138 -0
- package/dist/commands/plugin/scaffold.d.ts +6 -0
- package/dist/commands/plugin/scaffold.js +162 -0
- package/dist/commands/plugin/shared.d.ts +5 -0
- package/dist/commands/plugin/shared.js +30 -0
- package/dist/commands/project/create.d.ts +10 -0
- package/dist/commands/project/create.js +41 -0
- package/dist/commands/project/delete.d.ts +9 -0
- package/dist/commands/project/delete.js +33 -0
- package/dist/commands/project/index.d.ts +3 -0
- package/dist/commands/project/index.js +28 -0
- package/dist/commands/project/ls.d.ts +5 -0
- package/dist/commands/project/ls.js +19 -0
- package/dist/commands/project/rename.d.ts +15 -0
- package/dist/commands/project/rename.js +50 -0
- package/dist/commands/project/shared.d.ts +11 -0
- package/dist/commands/project/shared.js +18 -0
- package/dist/commands/provider/add.d.ts +30 -0
- package/dist/commands/provider/add.js +123 -0
- package/dist/commands/provider/diagnostic.d.ts +12 -0
- package/dist/commands/provider/diagnostic.js +31 -0
- package/dist/commands/provider/index.d.ts +3 -0
- package/dist/commands/provider/index.js +38 -0
- package/dist/commands/provider/ls.d.ts +20 -0
- package/dist/commands/provider/ls.js +76 -0
- package/dist/commands/provider/models.d.ts +20 -0
- package/dist/commands/provider/models.js +53 -0
- package/dist/commands/provider/rm.d.ts +10 -0
- package/dist/commands/provider/rm.js +45 -0
- package/dist/commands/provider/shared.d.ts +7 -0
- package/dist/commands/provider/shared.js +10 -0
- package/dist/commands/schedule/create.d.ts +19 -0
- package/dist/commands/schedule/create.js +41 -0
- package/dist/commands/schedule/delete.d.ts +10 -0
- package/dist/commands/schedule/delete.js +32 -0
- package/dist/commands/schedule/index.d.ts +3 -0
- package/dist/commands/schedule/index.js +66 -0
- package/dist/commands/schedule/inspect.d.ts +6 -0
- package/dist/commands/schedule/inspect.js +27 -0
- package/dist/commands/schedule/logs.d.ts +6 -0
- package/dist/commands/schedule/logs.js +24 -0
- package/dist/commands/schedule/ls.d.ts +5 -0
- package/dist/commands/schedule/ls.js +25 -0
- package/dist/commands/schedule/pause.d.ts +5 -0
- package/dist/commands/schedule/pause.js +24 -0
- package/dist/commands/schedule/resume.d.ts +5 -0
- package/dist/commands/schedule/resume.js +24 -0
- package/dist/commands/schedule/run-once.d.ts +5 -0
- package/dist/commands/schedule/run-once.js +24 -0
- package/dist/commands/schedule/schema.d.ts +21 -0
- package/dist/commands/schedule/schema.js +67 -0
- package/dist/commands/schedule/shared.d.ts +59 -0
- package/dist/commands/schedule/shared.js +358 -0
- package/dist/commands/schedule/types.d.ts +165 -0
- package/dist/commands/schedule/types.js +2 -0
- package/dist/commands/schedule/update.d.ts +21 -0
- package/dist/commands/schedule/update.js +40 -0
- package/dist/commands/script/index.d.ts +3 -0
- package/dist/commands/script/index.js +19 -0
- package/dist/commands/script/ls.d.ts +6 -0
- package/dist/commands/script/ls.js +20 -0
- package/dist/commands/script/schema.d.ts +5 -0
- package/dist/commands/script/schema.js +13 -0
- package/dist/commands/script/shared.d.ts +11 -0
- package/dist/commands/script/shared.js +59 -0
- package/dist/commands/script/start.d.ts +6 -0
- package/dist/commands/script/start.js +23 -0
- package/dist/commands/script/stop.d.ts +6 -0
- package/dist/commands/script/stop.js +23 -0
- package/dist/commands/speech/index.d.ts +3 -0
- package/dist/commands/speech/index.js +5 -0
- package/dist/commands/terminal/capture.d.ts +10 -0
- package/dist/commands/terminal/capture.js +68 -0
- package/dist/commands/terminal/create.d.ts +11 -0
- package/dist/commands/terminal/create.js +29 -0
- package/dist/commands/terminal/index.d.ts +3 -0
- package/dist/commands/terminal/index.js +45 -0
- package/dist/commands/terminal/kill.d.ts +6 -0
- package/dist/commands/terminal/kill.js +36 -0
- package/dist/commands/terminal/ls.d.ts +11 -0
- package/dist/commands/terminal/ls.js +21 -0
- package/dist/commands/terminal/schema.d.ts +10 -0
- package/dist/commands/terminal/schema.js +17 -0
- package/dist/commands/terminal/send-keys.d.ts +7 -0
- package/dist/commands/terminal/send-keys.js +45 -0
- package/dist/commands/terminal/shared.d.ts +12 -0
- package/dist/commands/terminal/shared.js +62 -0
- package/dist/commands/workspace/archive.d.ts +12 -0
- package/dist/commands/workspace/archive.js +41 -0
- package/dist/commands/workspace/create.d.ts +49 -0
- package/dist/commands/workspace/create.js +114 -0
- package/dist/commands/workspace/index.d.ts +3 -0
- package/dist/commands/workspace/index.js +45 -0
- package/dist/commands/workspace/ls.d.ts +7 -0
- package/dist/commands/workspace/ls.js +28 -0
- package/dist/commands/workspace/rename.d.ts +22 -0
- package/dist/commands/workspace/rename.js +61 -0
- package/dist/commands/workspace/setup.d.ts +11 -0
- package/dist/commands/workspace/setup.js +41 -0
- package/dist/commands/workspace/shared.d.ts +12 -0
- package/dist/commands/workspace/shared.js +20 -0
- package/dist/commands/worktree/archive.d.ts +20 -0
- package/dist/commands/worktree/archive.js +104 -0
- package/dist/commands/worktree/create-input.d.ts +15 -0
- package/dist/commands/worktree/create-input.js +56 -0
- package/dist/commands/worktree/create.d.ts +11 -0
- package/dist/commands/worktree/create.js +58 -0
- package/dist/commands/worktree/index.d.ts +3 -0
- package/dist/commands/worktree/index.js +25 -0
- package/dist/commands/worktree/ls.d.ts +19 -0
- package/dist/commands/worktree/ls.js +97 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/output/index.d.ts +45 -0
- package/dist/output/index.js +47 -0
- package/dist/output/json.d.ts +11 -0
- package/dist/output/json.js +37 -0
- package/dist/output/pairing.d.ts +8 -0
- package/dist/output/pairing.js +24 -0
- package/dist/output/quiet.d.ts +9 -0
- package/dist/output/quiet.js +22 -0
- package/dist/output/render.d.ts +15 -0
- package/dist/output/render.js +84 -0
- package/dist/output/table.d.ts +13 -0
- package/dist/output/table.js +135 -0
- package/dist/output/types.d.ts +73 -0
- package/dist/output/types.js +8 -0
- package/dist/output/with-output.d.ts +41 -0
- package/dist/output/with-output.js +85 -0
- package/dist/output/yaml.d.ts +11 -0
- package/dist/output/yaml.js +38 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.js +40 -0
- package/dist/ssh/ssh-tunnel.d.ts +9 -0
- package/dist/ssh/ssh-tunnel.js +79 -0
- package/dist/utils/client-id.d.ts +2 -0
- package/dist/utils/client-id.js +37 -0
- package/dist/utils/client.d.ts +54 -0
- package/dist/utils/client.js +363 -0
- package/dist/utils/command-options.d.ts +7 -0
- package/dist/utils/command-options.js +25 -0
- package/dist/utils/duration.d.ts +7 -0
- package/dist/utils/duration.js +39 -0
- package/dist/utils/errors.d.ts +5 -0
- package/dist/utils/errors.js +10 -0
- package/dist/utils/paths.d.ts +12 -0
- package/dist/utils/paths.js +22 -0
- package/dist/utils/provider-model.d.ts +11 -0
- package/dist/utils/provider-model.js +49 -0
- package/dist/utils/timeline.d.ts +11 -0
- package/dist/utils/timeline.js +11 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +10 -0
- package/package.json +50 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { buildDaemonConnectionCommandError, connectToDaemon } from "../../utils/client.js";
|
|
2
|
+
const projectDeleteSchema = {
|
|
3
|
+
idField: "projectId",
|
|
4
|
+
columns: [
|
|
5
|
+
{ header: "PROJECT ID", field: "projectId", width: 20 },
|
|
6
|
+
{
|
|
7
|
+
header: "REMOVED WORKSPACES",
|
|
8
|
+
field: (result) => result.removedWorkspaceIds.length,
|
|
9
|
+
width: 18,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
export async function runDeleteCommand(projectId, options, _command) {
|
|
14
|
+
const client = await connectToDaemon({ host: options.host }).catch((error) => {
|
|
15
|
+
throw buildDaemonConnectionCommandError({ host: options.host, error });
|
|
16
|
+
});
|
|
17
|
+
try {
|
|
18
|
+
const result = await client.removeProject(projectId);
|
|
19
|
+
return {
|
|
20
|
+
type: "single",
|
|
21
|
+
data: { projectId, removedWorkspaceIds: result.removedWorkspaceIds },
|
|
22
|
+
schema: projectDeleteSchema,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
27
|
+
throw { code: "PROJECT_DELETE_FAILED", message };
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
await client.close().catch(() => undefined);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { withOutput } from "../../output/index.js";
|
|
3
|
+
import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
|
|
4
|
+
import { runCreateCommand } from "./create.js";
|
|
5
|
+
import { runDeleteCommand } from "./delete.js";
|
|
6
|
+
import { runLsCommand } from "./ls.js";
|
|
7
|
+
import { runRenameCommand } from "./rename.js";
|
|
8
|
+
export function createProjectCommand() {
|
|
9
|
+
const project = new Command("project").description("Manage projects");
|
|
10
|
+
addJsonAndDaemonHostOptions(project
|
|
11
|
+
.command("create")
|
|
12
|
+
.description("Register a project directory")
|
|
13
|
+
.argument("[path]", "Project directory (default: current directory)")).action(withOutput(runCreateCommand));
|
|
14
|
+
addJsonAndDaemonHostOptions(project.command("ls").description("List projects")).action(withOutput(runLsCommand));
|
|
15
|
+
addJsonAndDaemonHostOptions(project
|
|
16
|
+
.command("rename")
|
|
17
|
+
.description("Set a project's user-visible name")
|
|
18
|
+
.argument("<project-id>", "Project id")
|
|
19
|
+
.argument("[name]", "New project name")
|
|
20
|
+
.option("--reset", "Clear the custom name and use the directory name")
|
|
21
|
+
.allowExcessArguments(false)).action(withOutput(runRenameCommand));
|
|
22
|
+
addJsonAndDaemonHostOptions(project
|
|
23
|
+
.command("delete")
|
|
24
|
+
.description("Delete a project and its workspaces")
|
|
25
|
+
.argument("<project-id>", "Project id")).action(withOutput(runDeleteCommand));
|
|
26
|
+
return project;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, ListResult } from "../../output/index.js";
|
|
3
|
+
import { type ProjectRow } from "./shared.js";
|
|
4
|
+
export declare function runLsCommand(options: CommandOptions, _command: Command): Promise<ListResult<ProjectRow>>;
|
|
5
|
+
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { buildDaemonConnectionCommandError, connectToDaemon } from "../../utils/client.js";
|
|
2
|
+
import { projectSchema, toProjectRow } from "./shared.js";
|
|
3
|
+
export async function runLsCommand(options, _command) {
|
|
4
|
+
const client = await connectToDaemon({ host: options.host }).catch((error) => {
|
|
5
|
+
throw buildDaemonConnectionCommandError({ host: options.host, error });
|
|
6
|
+
});
|
|
7
|
+
try {
|
|
8
|
+
const payload = await client.listProjects();
|
|
9
|
+
return {
|
|
10
|
+
type: "list",
|
|
11
|
+
data: payload.projects.map(toProjectRow),
|
|
12
|
+
schema: projectSchema,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
finally {
|
|
16
|
+
await client.close().catch(() => undefined);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ls.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, SingleResult } from "../../output/index.js";
|
|
3
|
+
interface ProjectRenameResult {
|
|
4
|
+
projectId: string;
|
|
5
|
+
name: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveProjectName(input: {
|
|
8
|
+
name?: string;
|
|
9
|
+
reset?: boolean;
|
|
10
|
+
}): string | null;
|
|
11
|
+
export declare function runRenameCommand(projectId: string, nameArg: string | undefined, options: CommandOptions & {
|
|
12
|
+
reset?: boolean;
|
|
13
|
+
}, _command: Command): Promise<SingleResult<ProjectRenameResult>>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=rename.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { buildDaemonConnectionCommandError, connectToDaemon } from "../../utils/client.js";
|
|
2
|
+
const projectRenameSchema = {
|
|
3
|
+
idField: "projectId",
|
|
4
|
+
columns: [
|
|
5
|
+
{ header: "PROJECT ID", field: "projectId", width: 20 },
|
|
6
|
+
{ header: "NAME", field: "name", width: 30 },
|
|
7
|
+
],
|
|
8
|
+
};
|
|
9
|
+
export function resolveProjectName(input) {
|
|
10
|
+
if (input.reset) {
|
|
11
|
+
if (input.name !== undefined) {
|
|
12
|
+
throw {
|
|
13
|
+
code: "INVALID_OPTIONS",
|
|
14
|
+
message: "--reset cannot be combined with a name",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const name = input.name?.trim() ?? "";
|
|
20
|
+
if (name.length === 0) {
|
|
21
|
+
throw {
|
|
22
|
+
code: "MISSING_NAME",
|
|
23
|
+
message: "Project name cannot be empty",
|
|
24
|
+
details: "Usage: paseo project rename <project-id> <name> | --reset",
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return name;
|
|
28
|
+
}
|
|
29
|
+
export async function runRenameCommand(projectId, nameArg, options, _command) {
|
|
30
|
+
const name = resolveProjectName({ name: nameArg, reset: options.reset });
|
|
31
|
+
const client = await connectToDaemon({ host: options.host }).catch((error) => {
|
|
32
|
+
throw buildDaemonConnectionCommandError({ host: options.host, error });
|
|
33
|
+
});
|
|
34
|
+
try {
|
|
35
|
+
const applied = await client.renameProject(projectId, name);
|
|
36
|
+
return {
|
|
37
|
+
type: "single",
|
|
38
|
+
data: { projectId, name: applied.customName },
|
|
39
|
+
schema: projectRenameSchema,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
44
|
+
throw { code: "PROJECT_RENAME_FAILED", message };
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await client.close().catch(() => undefined);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=rename.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkspaceProjectDescriptorPayload } from "@camerontaylor/paseo-protocol/messages";
|
|
2
|
+
import type { OutputSchema } from "../../output/index.js";
|
|
3
|
+
export interface ProjectRow {
|
|
4
|
+
projectId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
kind: "git" | "non_git" | "directory";
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const projectSchema: OutputSchema<ProjectRow>;
|
|
10
|
+
export declare function toProjectRow(project: WorkspaceProjectDescriptorPayload): ProjectRow;
|
|
11
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const projectSchema = {
|
|
2
|
+
idField: "projectId",
|
|
3
|
+
columns: [
|
|
4
|
+
{ header: "PROJECT ID", field: "projectId", width: 20 },
|
|
5
|
+
{ header: "NAME", field: "name", width: 24 },
|
|
6
|
+
{ header: "KIND", field: "kind", width: 10 },
|
|
7
|
+
{ header: "PATH", field: "path", width: 42 },
|
|
8
|
+
],
|
|
9
|
+
};
|
|
10
|
+
export function toProjectRow(project) {
|
|
11
|
+
return {
|
|
12
|
+
projectId: project.projectId,
|
|
13
|
+
name: project.projectDisplayName,
|
|
14
|
+
kind: project.projectKind,
|
|
15
|
+
path: project.projectRootPath,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { ProviderOverride } from "@camerontaylor/paseo-protocol/provider-config";
|
|
3
|
+
import type { CommandOptions, OutputSchema, SingleResult } from "../../output/index.js";
|
|
4
|
+
export interface ProviderAddOptions extends CommandOptions {
|
|
5
|
+
extends?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
env?: string[];
|
|
9
|
+
model?: string[];
|
|
10
|
+
command?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface ProviderAddRow {
|
|
13
|
+
provider: string;
|
|
14
|
+
label: string;
|
|
15
|
+
extends: string;
|
|
16
|
+
models: string;
|
|
17
|
+
env: string;
|
|
18
|
+
command: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const providerAddSchema: OutputSchema<ProviderAddRow>;
|
|
21
|
+
/**
|
|
22
|
+
* Build the provider override for `provider add`. The daemon validates too; this
|
|
23
|
+
* catches the common mistakes before a round trip so the message names the flag.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildProviderOverride(id: string, options: ProviderAddOptions): {
|
|
26
|
+
id: string;
|
|
27
|
+
override: ProviderOverride;
|
|
28
|
+
};
|
|
29
|
+
export declare function runAddCommand(id: string, options: ProviderAddOptions, _command: Command): Promise<SingleResult<ProviderAddRow>>;
|
|
30
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
|
|
2
|
+
import { PROVIDER_ID_PATTERN, VALID_EXTENDS_VALUES, isBuiltinProviderId } from "./shared.js";
|
|
3
|
+
export const providerAddSchema = {
|
|
4
|
+
idField: "provider",
|
|
5
|
+
columns: [
|
|
6
|
+
{ header: "PROVIDER", field: "provider", width: 16 },
|
|
7
|
+
{ header: "LABEL", field: "label", width: 20 },
|
|
8
|
+
{ header: "EXTENDS", field: "extends", width: 10 },
|
|
9
|
+
{ header: "MODELS", field: "models", width: 30 },
|
|
10
|
+
{ header: "ENV", field: "env", width: 24 },
|
|
11
|
+
{ header: "COMMAND", field: "command", width: 30 },
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
const ENV_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
15
|
+
function parseEnvEntries(entries) {
|
|
16
|
+
const env = {};
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
const separator = entry.indexOf("=");
|
|
19
|
+
if (separator <= 0) {
|
|
20
|
+
throw new Error(`Invalid --env "${entry}": expected KEY=VALUE`);
|
|
21
|
+
}
|
|
22
|
+
const key = entry.slice(0, separator);
|
|
23
|
+
if (!ENV_KEY_PATTERN.test(key)) {
|
|
24
|
+
throw new Error(`Invalid --env key "${key}": must match ${ENV_KEY_PATTERN}`);
|
|
25
|
+
}
|
|
26
|
+
env[key] = entry.slice(separator + 1);
|
|
27
|
+
}
|
|
28
|
+
return env;
|
|
29
|
+
}
|
|
30
|
+
function parseModelEntries(entries) {
|
|
31
|
+
return entries.map((entry, index) => {
|
|
32
|
+
const separator = entry.indexOf("=");
|
|
33
|
+
const id = separator === -1 ? entry : entry.slice(0, separator);
|
|
34
|
+
const label = separator === -1 ? entry : entry.slice(separator + 1);
|
|
35
|
+
if (id.trim().length === 0) {
|
|
36
|
+
throw new Error(`Invalid --model "${entry}": expected id or id=label`);
|
|
37
|
+
}
|
|
38
|
+
if (label.trim().length === 0) {
|
|
39
|
+
throw new Error(`Invalid --model "${entry}": label must not be empty`);
|
|
40
|
+
}
|
|
41
|
+
return { id: id.trim(), label: label.trim(), ...(index === 0 ? { isDefault: true } : {}) };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build the provider override for `provider add`. The daemon validates too; this
|
|
46
|
+
* catches the common mistakes before a round trip so the message names the flag.
|
|
47
|
+
*/
|
|
48
|
+
export function buildProviderOverride(id, options) {
|
|
49
|
+
if (!PROVIDER_ID_PATTERN.test(id)) {
|
|
50
|
+
throw new Error(`Invalid provider id "${id}": must start with a lowercase letter and contain only lowercase letters, digits, and hyphens`);
|
|
51
|
+
}
|
|
52
|
+
if (isBuiltinProviderId(id)) {
|
|
53
|
+
throw new Error(`"${id}" is a built-in provider. Pick a different id and use --extends ${id} to base a profile on it.`);
|
|
54
|
+
}
|
|
55
|
+
const extendsProvider = options.extends;
|
|
56
|
+
if (!extendsProvider) {
|
|
57
|
+
throw new Error(`--extends is required (one of: ${VALID_EXTENDS_VALUES.join(", ")})`);
|
|
58
|
+
}
|
|
59
|
+
if (!VALID_EXTENDS_VALUES.includes(extendsProvider)) {
|
|
60
|
+
throw new Error(`Invalid --extends "${extendsProvider}": expected one of ${VALID_EXTENDS_VALUES.join(", ")}`);
|
|
61
|
+
}
|
|
62
|
+
const commandArgv = options.command ?? [];
|
|
63
|
+
if (extendsProvider === "acp" && commandArgv.length === 0) {
|
|
64
|
+
throw new Error("--command is required when extending acp");
|
|
65
|
+
}
|
|
66
|
+
const env = parseEnvEntries(options.env ?? []);
|
|
67
|
+
const models = parseModelEntries(options.model ?? []);
|
|
68
|
+
const override = {
|
|
69
|
+
extends: extendsProvider,
|
|
70
|
+
label: options.label ?? id,
|
|
71
|
+
...(options.description ? { description: options.description } : {}),
|
|
72
|
+
...(commandArgv.length > 0 ? { command: commandArgv } : {}),
|
|
73
|
+
...(Object.keys(env).length > 0 ? { env } : {}),
|
|
74
|
+
...(models.length > 0 ? { models } : {}),
|
|
75
|
+
};
|
|
76
|
+
return { id, override };
|
|
77
|
+
}
|
|
78
|
+
function toRow(id, override) {
|
|
79
|
+
return {
|
|
80
|
+
provider: id,
|
|
81
|
+
label: override.label ?? id,
|
|
82
|
+
extends: override.extends ?? "-",
|
|
83
|
+
models: (override.models ?? []).map((model) => model.id).join(", ") || "-",
|
|
84
|
+
env: Object.keys(override.env ?? {}).join(", ") || "-",
|
|
85
|
+
command: (override.command ?? []).join(" ") || "-",
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export async function runAddCommand(id, options, _command) {
|
|
89
|
+
let built;
|
|
90
|
+
try {
|
|
91
|
+
built = buildProviderOverride(id, options);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw {
|
|
95
|
+
code: "INVALID_PROVIDER_CONFIG",
|
|
96
|
+
message: error instanceof Error ? error.message : String(error),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const host = getDaemonHost({ host: options.host });
|
|
100
|
+
const client = await connectToDaemon({ host: options.host }).catch((error) => {
|
|
101
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
102
|
+
throw {
|
|
103
|
+
code: "DAEMON_NOT_RUNNING",
|
|
104
|
+
message: `Cannot connect to daemon at ${host}: ${message}`,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
try {
|
|
108
|
+
const { config } = await client.getDaemonConfig();
|
|
109
|
+
if (built.id in (config.providers ?? {})) {
|
|
110
|
+
throw new Error(`Provider "${built.id}" already exists. Remove it with "paseo provider rm ${built.id}" first.`);
|
|
111
|
+
}
|
|
112
|
+
await client.patchDaemonConfig({ providers: { [built.id]: built.override } });
|
|
113
|
+
return { type: "single", data: toRow(built.id, built.override), schema: providerAddSchema };
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117
|
+
throw { code: "PROVIDER_ADD_FAILED", message };
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
await client.close().catch(() => undefined);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, OutputSchema, SingleResult } from "../../output/index.js";
|
|
3
|
+
export interface ProviderDiagnosticResult {
|
|
4
|
+
provider: string;
|
|
5
|
+
diagnostic: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const providerDiagnosticSchema: OutputSchema<ProviderDiagnosticResult>;
|
|
8
|
+
export interface ProviderDiagnosticOptions extends CommandOptions {
|
|
9
|
+
host?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function runDiagnosticCommand(provider: string, options: ProviderDiagnosticOptions, _command: Command): Promise<SingleResult<ProviderDiagnosticResult>>;
|
|
12
|
+
//# sourceMappingURL=diagnostic.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { connectToDaemon } from "../../utils/client.js";
|
|
2
|
+
export const providerDiagnosticSchema = {
|
|
3
|
+
idField: "provider",
|
|
4
|
+
columns: [
|
|
5
|
+
{ header: "PROVIDER", field: "provider" },
|
|
6
|
+
{ header: "DIAGNOSTIC", field: "diagnostic" },
|
|
7
|
+
],
|
|
8
|
+
renderHuman(result) {
|
|
9
|
+
if (result.type === "single")
|
|
10
|
+
return result.data.diagnostic;
|
|
11
|
+
return result.data.map((entry) => entry.diagnostic).join("\n\n");
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export async function runDiagnosticCommand(provider, options, _command) {
|
|
15
|
+
const client = await connectToDaemon({ host: options.host });
|
|
16
|
+
try {
|
|
17
|
+
const result = await client.getProviderDiagnostic(provider.trim().toLowerCase());
|
|
18
|
+
return {
|
|
19
|
+
type: "single",
|
|
20
|
+
data: {
|
|
21
|
+
provider: result.provider,
|
|
22
|
+
diagnostic: result.diagnostic,
|
|
23
|
+
},
|
|
24
|
+
schema: providerDiagnosticSchema,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
await client.close();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=diagnostic.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { runAddCommand } from "./add.js";
|
|
3
|
+
import { runDiagnosticCommand } from "./diagnostic.js";
|
|
4
|
+
import { runLsCommand } from "./ls.js";
|
|
5
|
+
import { runModelsCommand } from "./models.js";
|
|
6
|
+
import { runRmCommand } from "./rm.js";
|
|
7
|
+
import { VALID_EXTENDS_VALUES } from "./shared.js";
|
|
8
|
+
import { withOutput } from "../../output/index.js";
|
|
9
|
+
import { addJsonAndDaemonHostOptions, collectMultiple } from "../../utils/command-options.js";
|
|
10
|
+
export function createProviderCommand() {
|
|
11
|
+
const provider = new Command("provider").description("Manage agent providers");
|
|
12
|
+
addJsonAndDaemonHostOptions(provider.command("ls").description("List available providers and status")).action(withOutput(runLsCommand));
|
|
13
|
+
addJsonAndDaemonHostOptions(provider
|
|
14
|
+
.command("models")
|
|
15
|
+
.description("List models for a provider")
|
|
16
|
+
.argument("<provider>", "Provider name (claude, codex, opencode)")
|
|
17
|
+
.option("--thinking", "Include thinking option IDs for each model")).action(withOutput(runModelsCommand));
|
|
18
|
+
addJsonAndDaemonHostOptions(provider
|
|
19
|
+
.command("diagnostic")
|
|
20
|
+
.description("Show provider installation, environment, and availability diagnostics")
|
|
21
|
+
.argument("<provider>", "Provider name")).action(withOutput(runDiagnosticCommand));
|
|
22
|
+
addJsonAndDaemonHostOptions(provider
|
|
23
|
+
.command("add")
|
|
24
|
+
.description("Add a custom provider profile")
|
|
25
|
+
.argument("<id>", "New provider id (lowercase letters, digits, hyphens)")
|
|
26
|
+
.requiredOption("--extends <provider>", `Provider to inherit from (${VALID_EXTENDS_VALUES.join(", ")})`)
|
|
27
|
+
.option("--label <label>", "Display label (default: the provider id)")
|
|
28
|
+
.option("--description <text>", "Description shown next to the label")
|
|
29
|
+
.option("--env <KEY=VALUE>", "Environment variable, repeatable", collectMultiple, [])
|
|
30
|
+
.option("--model <id[=label]>", "Model offered by this profile, repeatable; the first is the default", collectMultiple, [])
|
|
31
|
+
.option("--command <arg>", "Launch argv entry, repeatable; required with --extends acp", collectMultiple, [])).action(withOutput(runAddCommand));
|
|
32
|
+
addJsonAndDaemonHostOptions(provider
|
|
33
|
+
.command("rm")
|
|
34
|
+
.description("Remove a custom provider profile")
|
|
35
|
+
.argument("<id>", "Custom provider id")).action(withOutput(runRmCommand));
|
|
36
|
+
return provider;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
|
|
3
|
+
import type { ProviderSnapshotEntry } from "@camerontaylor/paseo-protocol/agent-types";
|
|
4
|
+
export interface ProviderListItem {
|
|
5
|
+
provider: ProviderSnapshotEntry["provider"];
|
|
6
|
+
label: string;
|
|
7
|
+
source: "builtin" | "custom";
|
|
8
|
+
status: string;
|
|
9
|
+
enabled: "Enabled" | "Disabled";
|
|
10
|
+
defaultMode: string;
|
|
11
|
+
modes: string;
|
|
12
|
+
}
|
|
13
|
+
/** Schema for provider ls output */
|
|
14
|
+
export declare const providerLsSchema: OutputSchema<ProviderListItem>;
|
|
15
|
+
export type ProviderLsResult = ListResult<ProviderListItem>;
|
|
16
|
+
export interface ProviderLsOptions extends CommandOptions {
|
|
17
|
+
host?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function runLsCommand(options: ProviderLsOptions, _command: Command): Promise<ProviderLsResult>;
|
|
20
|
+
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AGENT_PROVIDER_DEFINITIONS } from "@camerontaylor/paseo-protocol/provider-manifest";
|
|
2
|
+
import { tryConnectToDaemon } from "../../utils/client.js";
|
|
3
|
+
/** Derive provider list from the manifest — single source of truth */
|
|
4
|
+
const PROVIDERS = AGENT_PROVIDER_DEFINITIONS.map((def) => ({
|
|
5
|
+
provider: def.id,
|
|
6
|
+
label: def.label,
|
|
7
|
+
source: "builtin",
|
|
8
|
+
status: "available",
|
|
9
|
+
enabled: def.enabledByDefault === false ? "Disabled" : "Enabled",
|
|
10
|
+
defaultMode: def.defaultModeId ?? "-",
|
|
11
|
+
modes: def.modes.length > 0 ? def.modes.map((m) => m.label).join(", ") : "-",
|
|
12
|
+
}));
|
|
13
|
+
function getStaticProviders() {
|
|
14
|
+
return PROVIDERS;
|
|
15
|
+
}
|
|
16
|
+
/** Schema for provider ls output */
|
|
17
|
+
export const providerLsSchema = {
|
|
18
|
+
idField: "provider",
|
|
19
|
+
columns: [
|
|
20
|
+
{ header: "PROVIDER", field: "provider", width: 12 },
|
|
21
|
+
{ header: "LABEL", field: "label", width: 16 },
|
|
22
|
+
{ header: "SOURCE", field: "source", width: 8 },
|
|
23
|
+
{
|
|
24
|
+
header: "STATUS",
|
|
25
|
+
field: "status",
|
|
26
|
+
width: 12,
|
|
27
|
+
color: (value) => {
|
|
28
|
+
if (value === "available")
|
|
29
|
+
return "green";
|
|
30
|
+
if (value === "unavailable")
|
|
31
|
+
return "red";
|
|
32
|
+
return undefined;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{ header: "ENABLED", field: "enabled", width: 10 },
|
|
36
|
+
{ header: "DEFAULT MODE", field: "defaultMode", width: 14 },
|
|
37
|
+
{ header: "MODES", field: "modes", width: 30 },
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
export async function runLsCommand(options, _command) {
|
|
41
|
+
const client = await tryConnectToDaemon({ host: options.host });
|
|
42
|
+
if (!client) {
|
|
43
|
+
return {
|
|
44
|
+
type: "list",
|
|
45
|
+
data: getStaticProviders(),
|
|
46
|
+
schema: providerLsSchema,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const snapshot = await client.getProvidersSnapshot();
|
|
51
|
+
return {
|
|
52
|
+
type: "list",
|
|
53
|
+
data: snapshot.entries.map((entry) => ({
|
|
54
|
+
provider: entry.provider,
|
|
55
|
+
label: entry.label ?? entry.provider,
|
|
56
|
+
source: entry.source ?? "builtin",
|
|
57
|
+
status: entry.status === "ready" ? "available" : entry.status,
|
|
58
|
+
enabled: !entry.enabled ? "Disabled" : "Enabled",
|
|
59
|
+
defaultMode: entry.defaultModeId ?? "default",
|
|
60
|
+
modes: (entry.modes ?? []).map((mode) => mode.label).join(", "),
|
|
61
|
+
})),
|
|
62
|
+
schema: providerLsSchema,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return {
|
|
67
|
+
type: "list",
|
|
68
|
+
data: getStaticProviders(),
|
|
69
|
+
schema: providerLsSchema,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
await client.close().catch(() => { });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=ls.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
|
|
3
|
+
/** Model list item for display */
|
|
4
|
+
export interface ModelListItem {
|
|
5
|
+
model: string;
|
|
6
|
+
id: string;
|
|
7
|
+
description: string;
|
|
8
|
+
thinkingOptionIds: string[];
|
|
9
|
+
defaultThinkingOptionId: string | null;
|
|
10
|
+
thinkingOptions: string;
|
|
11
|
+
}
|
|
12
|
+
/** Schema for provider models output */
|
|
13
|
+
export declare const providerModelsSchema: OutputSchema<ModelListItem>;
|
|
14
|
+
export type ProviderModelsResult = ListResult<ModelListItem>;
|
|
15
|
+
export interface ProviderModelsOptions extends CommandOptions {
|
|
16
|
+
host?: string;
|
|
17
|
+
thinking?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function runModelsCommand(provider: string, options: ProviderModelsOptions, _command: Command): Promise<ProviderModelsResult>;
|
|
20
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { connectToDaemon } from "../../utils/client.js";
|
|
2
|
+
/** Schema for provider models output */
|
|
3
|
+
export const providerModelsSchema = {
|
|
4
|
+
idField: "id",
|
|
5
|
+
columns: [
|
|
6
|
+
{ header: "ID", field: "id", width: 30 },
|
|
7
|
+
{ header: "MODEL", field: "model", width: 30 },
|
|
8
|
+
{ header: "DESCRIPTION", field: "description", width: 40 },
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
const providerModelsWithThinkingSchema = {
|
|
12
|
+
idField: "id",
|
|
13
|
+
columns: [
|
|
14
|
+
{ header: "ID", field: "id", width: 30 },
|
|
15
|
+
{ header: "MODEL", field: "model", width: 30 },
|
|
16
|
+
{ header: "THINKING IDS", field: "thinkingOptions", width: 40 },
|
|
17
|
+
{
|
|
18
|
+
header: "DEFAULT THINKING",
|
|
19
|
+
field: (item) => item.defaultThinkingOptionId ?? "auto",
|
|
20
|
+
width: 18,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
export async function runModelsCommand(provider, options, _command) {
|
|
25
|
+
const normalizedProvider = provider.toLowerCase();
|
|
26
|
+
const client = await connectToDaemon({ host: options.host });
|
|
27
|
+
try {
|
|
28
|
+
const result = await client.listProviderModels(normalizedProvider);
|
|
29
|
+
if (result.error) {
|
|
30
|
+
throw {
|
|
31
|
+
code: "PROVIDER_ERROR",
|
|
32
|
+
message: `Failed to fetch models for ${provider}: ${result.error}`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const models = (result.models ?? []).map((m) => ({
|
|
36
|
+
model: m.label,
|
|
37
|
+
id: m.id,
|
|
38
|
+
description: m.description ?? "",
|
|
39
|
+
thinkingOptionIds: (m.thinkingOptions ?? []).map((option) => option.id),
|
|
40
|
+
defaultThinkingOptionId: m.defaultThinkingOptionId ?? null,
|
|
41
|
+
thinkingOptions: (m.thinkingOptions ?? []).map((option) => option.id).join(", ") || "none",
|
|
42
|
+
}));
|
|
43
|
+
return {
|
|
44
|
+
type: "list",
|
|
45
|
+
data: models,
|
|
46
|
+
schema: options.thinking ? providerModelsWithThinkingSchema : providerModelsSchema,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
await client.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandOptions, OutputSchema, SingleResult } from "../../output/index.js";
|
|
3
|
+
export type ProviderRmOptions = CommandOptions;
|
|
4
|
+
export interface ProviderRmRow {
|
|
5
|
+
provider: string;
|
|
6
|
+
removed: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const providerRmSchema: OutputSchema<ProviderRmRow>;
|
|
9
|
+
export declare function runRmCommand(id: string, options: ProviderRmOptions, _command: Command): Promise<SingleResult<ProviderRmRow>>;
|
|
10
|
+
//# sourceMappingURL=rm.d.ts.map
|