@getpaseo/cli 0.2.3 → 0.2.4
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/commands/agent/index.js +2 -1
- package/dist/commands/agent/update.d.ts +33 -0
- package/dist/commands/agent/update.js +72 -25
- package/dist/commands/schedule/create.d.ts +1 -0
- package/dist/commands/schedule/create.js +1 -0
- package/dist/commands/schedule/index.js +1 -0
- package/dist/commands/schedule/shared.d.ts +1 -0
- package/dist/commands/schedule/shared.js +10 -2
- package/package.json +4 -4
|
@@ -46,9 +46,10 @@ export function createAgentCommand() {
|
|
|
46
46
|
.argument("<id>", "Agent ID, prefix, or name")).action(withOutput(runDetachCommand));
|
|
47
47
|
addJsonAndDaemonHostOptions(agent
|
|
48
48
|
.command("update")
|
|
49
|
-
.description("Update an agent's metadata")
|
|
49
|
+
.description("Update an agent's settings or metadata")
|
|
50
50
|
.argument("<id>", "Agent ID (or prefix)")
|
|
51
51
|
.option("--name <name>", "Update the agent's display name")
|
|
52
|
+
.option("--thinking <id>", "Update the agent's thinking option ID")
|
|
52
53
|
.option("--label <label>", "Add/set label(s) on the agent (can be used multiple times or comma-separated)", collectMultiple, [])).action(withOutput(runUpdateCommand));
|
|
53
54
|
return agent;
|
|
54
55
|
}
|
|
@@ -1,18 +1,51 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
+
import type { AgentProviderNotice } from "@getpaseo/protocol/agent-types";
|
|
3
|
+
import type { AgentSnapshotPayload } from "@getpaseo/protocol/messages";
|
|
2
4
|
import type { CommandOptions, SingleResult, OutputSchema } from "../../output/index.js";
|
|
3
5
|
/** Result type for agent update command */
|
|
4
6
|
export interface AgentUpdateResult {
|
|
5
7
|
agentId: string;
|
|
6
8
|
name: string | null;
|
|
7
9
|
labels: string;
|
|
10
|
+
thinkingOptionId: string | null;
|
|
11
|
+
noticeType: AgentProviderNotice["type"] | null;
|
|
12
|
+
notice: string | null;
|
|
8
13
|
}
|
|
9
14
|
/** Schema for update command output */
|
|
10
15
|
export declare const updateSchema: OutputSchema<AgentUpdateResult>;
|
|
11
16
|
export interface AgentUpdateOptions extends CommandOptions {
|
|
12
17
|
name?: string;
|
|
13
18
|
label?: string[];
|
|
19
|
+
thinking?: string;
|
|
14
20
|
host?: string;
|
|
15
21
|
}
|
|
16
22
|
export type AgentUpdateCommandResult = SingleResult<AgentUpdateResult>;
|
|
23
|
+
export interface AgentMetadataChanges {
|
|
24
|
+
name?: string;
|
|
25
|
+
labels?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
interface AgentUpdateServerInfo {
|
|
28
|
+
features?: {
|
|
29
|
+
agentThinkingUpdate?: boolean;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface AgentUpdateClient {
|
|
33
|
+
getLastServerInfoMessage(): AgentUpdateServerInfo | null;
|
|
34
|
+
updateAgent(agentId: string, updates: AgentMetadataChanges): Promise<void>;
|
|
35
|
+
setAgentThinkingOption(agentId: string, thinkingOptionId: string): Promise<AgentProviderNotice | null>;
|
|
36
|
+
}
|
|
37
|
+
export type AgentChanges = {
|
|
38
|
+
type: "metadata";
|
|
39
|
+
updates: AgentMetadataChanges;
|
|
40
|
+
} | {
|
|
41
|
+
type: "thinking";
|
|
42
|
+
thinkingOptionId: string;
|
|
43
|
+
};
|
|
44
|
+
export interface AppliedAgentChanges {
|
|
45
|
+
notice: AgentProviderNotice | null;
|
|
46
|
+
}
|
|
47
|
+
export declare function toAgentUpdateResult(agent: Pick<AgentSnapshotPayload, "id" | "title" | "labels" | "effectiveThinkingOptionId">, appliedChanges: AppliedAgentChanges): AgentUpdateResult;
|
|
48
|
+
export declare function applyAgentChanges(client: AgentUpdateClient, agentId: string, changes: AgentChanges): Promise<AppliedAgentChanges>;
|
|
17
49
|
export declare function runUpdateCommand(agentIdArg: string, options: AgentUpdateOptions, _command: Command): Promise<AgentUpdateCommandResult>;
|
|
50
|
+
export {};
|
|
18
51
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -6,8 +6,35 @@ export const updateSchema = {
|
|
|
6
6
|
{ header: "AGENT ID", field: "agentId" },
|
|
7
7
|
{ header: "NAME", field: "name" },
|
|
8
8
|
{ header: "LABELS", field: "labels" },
|
|
9
|
+
{ header: "THINKING", field: "thinkingOptionId" },
|
|
10
|
+
{ header: "NOTICE", field: "notice" },
|
|
9
11
|
],
|
|
10
12
|
};
|
|
13
|
+
export function toAgentUpdateResult(agent, appliedChanges) {
|
|
14
|
+
return {
|
|
15
|
+
agentId: agent.id,
|
|
16
|
+
name: agent.title,
|
|
17
|
+
labels: formatLabels(agent.labels),
|
|
18
|
+
thinkingOptionId: agent.effectiveThinkingOptionId ?? null,
|
|
19
|
+
noticeType: appliedChanges.notice?.type ?? null,
|
|
20
|
+
notice: appliedChanges.notice?.message ?? null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export async function applyAgentChanges(client, agentId, changes) {
|
|
24
|
+
if (changes.type === "thinking") {
|
|
25
|
+
// COMPAT(agentThinkingUpdate): added in v0.2.4, remove gate after 2027-01-28.
|
|
26
|
+
if (client.getLastServerInfoMessage()?.features?.agentThinkingUpdate !== true) {
|
|
27
|
+
throw {
|
|
28
|
+
code: "DAEMON_UPDATE_REQUIRED",
|
|
29
|
+
message: "Update the host to use agent thinking updates.",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const notice = await client.setAgentThinkingOption(agentId, changes.thinkingOptionId);
|
|
33
|
+
return { notice };
|
|
34
|
+
}
|
|
35
|
+
await client.updateAgent(agentId, changes.updates);
|
|
36
|
+
return { notice: null };
|
|
37
|
+
}
|
|
11
38
|
function parseLabelOptions(labels) {
|
|
12
39
|
const parsed = {};
|
|
13
40
|
if (!labels) {
|
|
@@ -50,35 +77,62 @@ function formatLabels(labels) {
|
|
|
50
77
|
}
|
|
51
78
|
return entries.map(([key, value]) => `${key}=${value}`).join(",");
|
|
52
79
|
}
|
|
53
|
-
|
|
54
|
-
const host = getDaemonHost({ host: options.host });
|
|
55
|
-
// Validate arguments
|
|
56
|
-
if (!agentIdArg || agentIdArg.trim().length === 0) {
|
|
57
|
-
const error = {
|
|
58
|
-
code: "MISSING_AGENT_ID",
|
|
59
|
-
message: "Agent ID is required",
|
|
60
|
-
details: "Usage: paseo agent update <id> [--name <name>] [--label <key=value>]",
|
|
61
|
-
};
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
80
|
+
function parseAgentChanges(options) {
|
|
64
81
|
const name = options.name?.trim();
|
|
65
82
|
if (options.name !== undefined && !name) {
|
|
66
|
-
|
|
83
|
+
throw {
|
|
67
84
|
code: "INVALID_NAME",
|
|
68
85
|
message: "Name cannot be empty",
|
|
69
86
|
details: "Use --name <name> with a non-empty value",
|
|
70
87
|
};
|
|
71
|
-
throw error;
|
|
72
88
|
}
|
|
73
89
|
const labels = parseLabelOptions(options.label);
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
const thinkingOptionId = options.thinking?.trim();
|
|
91
|
+
if (options.thinking !== undefined && !thinkingOptionId) {
|
|
92
|
+
throw {
|
|
93
|
+
code: "INVALID_THINKING_OPTION",
|
|
94
|
+
message: "--thinking cannot be empty",
|
|
95
|
+
details: 'Provide a thinking option ID. Use "paseo provider models <provider> --thinking" to list valid IDs.',
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const hasMetadataUpdates = Boolean(name) || Object.keys(labels).length > 0;
|
|
99
|
+
if (hasMetadataUpdates && thinkingOptionId) {
|
|
100
|
+
throw {
|
|
101
|
+
code: "INVALID_OPTIONS",
|
|
102
|
+
message: "--thinking cannot be combined with --name or --label",
|
|
103
|
+
details: "Run separate agent update commands for runtime settings and metadata.",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (!hasMetadataUpdates && !thinkingOptionId) {
|
|
107
|
+
throw {
|
|
76
108
|
code: "NO_CHANGES_PROVIDED",
|
|
77
109
|
message: "Nothing to update",
|
|
78
|
-
details: "Provide at least one of: --name <name>, --label <key=value>",
|
|
110
|
+
details: "Provide at least one of: --name <name>, --label <key=value>, --thinking <id>",
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (thinkingOptionId) {
|
|
114
|
+
return { type: "thinking", thinkingOptionId };
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
type: "metadata",
|
|
118
|
+
updates: {
|
|
119
|
+
...(name ? { name } : {}),
|
|
120
|
+
...(Object.keys(labels).length > 0 ? { labels } : {}),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export async function runUpdateCommand(agentIdArg, options, _command) {
|
|
125
|
+
const host = getDaemonHost({ host: options.host });
|
|
126
|
+
// Validate arguments
|
|
127
|
+
if (!agentIdArg || agentIdArg.trim().length === 0) {
|
|
128
|
+
const error = {
|
|
129
|
+
code: "MISSING_AGENT_ID",
|
|
130
|
+
message: "Agent ID is required",
|
|
131
|
+
details: "Usage: paseo agent update <id> [--name <name>] [--label <key=value>]",
|
|
79
132
|
};
|
|
80
133
|
throw error;
|
|
81
134
|
}
|
|
135
|
+
const changes = parseAgentChanges(options);
|
|
82
136
|
let client;
|
|
83
137
|
try {
|
|
84
138
|
client = await connectToDaemon({ host: options.host });
|
|
@@ -103,10 +157,7 @@ export async function runUpdateCommand(agentIdArg, options, _command) {
|
|
|
103
157
|
throw error;
|
|
104
158
|
}
|
|
105
159
|
const agentId = fetchResult.agent.id;
|
|
106
|
-
await client
|
|
107
|
-
...(name ? { name } : {}),
|
|
108
|
-
...(Object.keys(labels).length > 0 ? { labels } : {}),
|
|
109
|
-
});
|
|
160
|
+
const appliedChanges = await applyAgentChanges(client, agentId, changes);
|
|
110
161
|
const updatedResult = await client.fetchAgent({ agentId });
|
|
111
162
|
if (!updatedResult) {
|
|
112
163
|
throw new Error(`Agent not found after update: ${agentId}`);
|
|
@@ -114,11 +165,7 @@ export async function runUpdateCommand(agentIdArg, options, _command) {
|
|
|
114
165
|
await client.close();
|
|
115
166
|
return {
|
|
116
167
|
type: "single",
|
|
117
|
-
data:
|
|
118
|
-
agentId,
|
|
119
|
-
name: updatedResult.agent.title,
|
|
120
|
-
labels: formatLabels(updatedResult.agent.labels),
|
|
121
|
-
},
|
|
168
|
+
data: toAgentUpdateResult(updatedResult.agent, appliedChanges),
|
|
122
169
|
schema: updateSchema,
|
|
123
170
|
};
|
|
124
171
|
}
|
|
@@ -23,6 +23,7 @@ export function createScheduleCommand() {
|
|
|
23
23
|
.addOption(new Option("--target <target>", "Legacy schedule target").hideHelp())
|
|
24
24
|
.option("--provider <provider>", "Agent provider, or provider/model (e.g. codex or codex/gpt-5.4)")
|
|
25
25
|
.option("--mode <mode>", "Provider-specific mode (e.g. claude bypassPermissions, opencode build)")
|
|
26
|
+
.option("--thinking <id>", "Thinking option ID for new-agent runs")
|
|
26
27
|
.option("--cwd <path>", "Working directory (default: current; required with --host)")
|
|
27
28
|
.option("--run-now", "Fire one immediate run on creation")
|
|
28
29
|
.option("--max-runs <n>", "Maximum number of runs")
|
|
@@ -82,7 +82,7 @@ function resolveScheduleTarget(args) {
|
|
|
82
82
|
if (hasExplicitNewAgentOption) {
|
|
83
83
|
throw {
|
|
84
84
|
code: "INVALID_TARGET",
|
|
85
|
-
message: "--provider/--mode can only be used with a new-agent target",
|
|
85
|
+
message: "--provider/--mode/--thinking can only be used with a new-agent target",
|
|
86
86
|
details: "Use --target new-agent or omit --target to create a new agent schedule",
|
|
87
87
|
};
|
|
88
88
|
}
|
|
@@ -125,7 +125,14 @@ export function parseScheduleCreateInput(options) {
|
|
|
125
125
|
const runOnCreate = resolveRunOnCreate(options.runNow, cadence.type);
|
|
126
126
|
const targetValue = options.target?.trim();
|
|
127
127
|
const modeId = options.mode?.trim();
|
|
128
|
-
const
|
|
128
|
+
const thinkingOptionId = options.thinking?.trim();
|
|
129
|
+
if (options.thinking !== undefined && !thinkingOptionId) {
|
|
130
|
+
throw {
|
|
131
|
+
code: "INVALID_THINKING_OPTION",
|
|
132
|
+
message: "--thinking cannot be empty",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const hasExplicitNewAgentOption = options.provider !== undefined || options.mode !== undefined || options.thinking !== undefined;
|
|
129
136
|
const createNewAgentTarget = () => {
|
|
130
137
|
const resolvedProviderModel = resolveProviderAndModel({
|
|
131
138
|
provider: options.provider,
|
|
@@ -137,6 +144,7 @@ export function parseScheduleCreateInput(options) {
|
|
|
137
144
|
cwd: cwdInput ?? process.cwd(),
|
|
138
145
|
...(resolvedProviderModel.model ? { model: resolvedProviderModel.model } : {}),
|
|
139
146
|
...(modeId ? { modeId } : {}),
|
|
147
|
+
...(thinkingOptionId ? { thinkingOptionId } : {}),
|
|
140
148
|
},
|
|
141
149
|
};
|
|
142
150
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
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
|
-
"@getpaseo/client": "0.2.
|
|
32
|
-
"@getpaseo/protocol": "0.2.
|
|
33
|
-
"@getpaseo/server": "0.2.
|
|
31
|
+
"@getpaseo/client": "0.2.4",
|
|
32
|
+
"@getpaseo/protocol": "0.2.4",
|
|
33
|
+
"@getpaseo/server": "0.2.4",
|
|
34
34
|
"chalk": "^5.3.0",
|
|
35
35
|
"commander": "^12.0.0",
|
|
36
36
|
"mime-types": "^2.1.35",
|