@camerontaylor/paseo-cli 0.12.0-beta.1.fork.1 → 0.12.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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Command } from "commander";
|
|
2
|
+
import type { ActiveTurnBehavior } from "@camerontaylor/paseo-protocol/messages";
|
|
2
3
|
import type { CommandOptions, SingleResult, OutputSchema } from "../../output/index.js";
|
|
3
4
|
/** Result type for agent send command */
|
|
4
5
|
export interface AgentSendResult {
|
|
@@ -9,6 +10,7 @@ export interface AgentSendResult {
|
|
|
9
10
|
/** Schema for agent send output */
|
|
10
11
|
export declare const agentSendSchema: OutputSchema<AgentSendResult>;
|
|
11
12
|
export interface AgentSendOptions extends CommandOptions {
|
|
13
|
+
behavior?: ActiveTurnBehavior;
|
|
12
14
|
wait?: boolean;
|
|
13
15
|
image?: string[];
|
|
14
16
|
prompt?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Option } from "commander";
|
|
1
2
|
import { collectMultiple } from "../../utils/command-options.js";
|
|
2
3
|
import { connectToDaemon } from "../../utils/client.js";
|
|
3
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -19,6 +20,7 @@ export function addSendOptions(cmd) {
|
|
|
19
20
|
.option("--prompt <text>", "Provide the message inline as a flag")
|
|
20
21
|
.option("--prompt-file <path>", "Read the message from a UTF-8 text file")
|
|
21
22
|
.option("--image <path>", "Attach image(s) to the message", collectMultiple, [])
|
|
23
|
+
.addOption(new Option("--behavior <behavior>", "Active-turn behavior (agent default: steer; otherwise: interrupt)").choices(["interrupt", "steer"]))
|
|
22
24
|
.option("--no-wait", "Return immediately without waiting for completion");
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
@@ -138,10 +140,12 @@ export async function runSendCommand(agentIdArg, prompt, options, _command) {
|
|
|
138
140
|
try {
|
|
139
141
|
// Read image files if provided
|
|
140
142
|
const images = options.image && options.image.length > 0 ? await readImageFiles(options.image) : undefined;
|
|
143
|
+
const sourceAgentId = process.env.PASEO_AGENT_ID?.trim() || undefined;
|
|
141
144
|
// Send the message
|
|
142
145
|
await client.sendAgentMessage(agentIdArg, promptInput, {
|
|
143
146
|
images,
|
|
144
|
-
sourceAgentId
|
|
147
|
+
sourceAgentId,
|
|
148
|
+
activeTurnBehavior: options.behavior ?? (sourceAgentId ? "steer" : "interrupt"),
|
|
145
149
|
});
|
|
146
150
|
// If --no-wait, return immediately
|
|
147
151
|
if (options.wait === false) {
|
|
@@ -34,8 +34,17 @@ function summary(entry) {
|
|
|
34
34
|
const lines = [failureText(report)];
|
|
35
35
|
for (const login of entry.loginErrors ?? [])
|
|
36
36
|
lines.push(`${login.harness}: ${failureText(login.report)}`);
|
|
37
|
+
if (entry.lastSuccessful) {
|
|
38
|
+
lines.push(`Last successful: ${entry.lastSuccessful.fetchedAt}`);
|
|
39
|
+
lines.push(...availableSummary(entry.lastSuccessful.report).map((line) => `Retained: ${line}`));
|
|
40
|
+
}
|
|
41
|
+
else
|
|
42
|
+
lines.push("No successful update");
|
|
37
43
|
return lines;
|
|
38
44
|
}
|
|
45
|
+
return [...availableSummary(report), `Last successful: ${successfulTime(entry)}`];
|
|
46
|
+
}
|
|
47
|
+
function availableSummary(report) {
|
|
39
48
|
const lines = report.windows.map(windowText);
|
|
40
49
|
lines.push(...(report.balances ?? []).map(balanceText));
|
|
41
50
|
return lines.length ? lines : ["-"];
|
|
@@ -48,7 +57,7 @@ const summarySchema = {
|
|
|
48
57
|
{ header: "ACCOUNT", field: "account" },
|
|
49
58
|
{ header: "STATUS", field: "status" },
|
|
50
59
|
{ header: "USAGE", field: "usage" },
|
|
51
|
-
{ header: "FETCHED", field: "fetched" },
|
|
60
|
+
{ header: "FETCHED (LATEST ATTEMPT)", field: "fetched" },
|
|
52
61
|
],
|
|
53
62
|
};
|
|
54
63
|
function inspect(entry) {
|
|
@@ -58,34 +67,17 @@ function inspect(entry) {
|
|
|
58
67
|
`Source ID: ${entry.sourceId}`,
|
|
59
68
|
`Account: ${value(entry.account.label)}`,
|
|
60
69
|
`Status: ${entry.report.status}`,
|
|
61
|
-
`
|
|
70
|
+
`Latest attempt: ${value(entry.fetchedAt)}`,
|
|
62
71
|
];
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (window.shortfallPct != null)
|
|
73
|
-
lines.push(` Shortfall: ${percent(window.shortfallPct)}`);
|
|
74
|
-
}
|
|
75
|
-
lines.push("Balances:");
|
|
76
|
-
if (!report.balances?.length)
|
|
77
|
-
lines.push(" -");
|
|
78
|
-
for (const balance of report.balances ?? []) {
|
|
79
|
-
lines.push(` ${balanceText(balance)} [${balance.id}]`, ` Resets: ${value(balance.resetsAt)}`);
|
|
80
|
-
}
|
|
81
|
-
lines.push("Details:");
|
|
82
|
-
if (!report.details?.length)
|
|
83
|
-
lines.push(" -");
|
|
84
|
-
for (const detail of report.details ?? [])
|
|
85
|
-
lines.push(` ${detail.label}: ${detail.value}`);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
lines.push(`Reason: ${failureText(report)}`);
|
|
72
|
+
const report = entry.report.status === "available" ? entry.report : entry.lastSuccessful?.report;
|
|
73
|
+
const successfulAt = successfulTime(entry);
|
|
74
|
+
lines.push(successfulAt ? `Last successful: ${successfulAt}` : "No successful update");
|
|
75
|
+
if (entry.report.status !== "available")
|
|
76
|
+
lines.push(`Reason: ${failureText(entry.report)}`);
|
|
77
|
+
if (report) {
|
|
78
|
+
if (entry.report.status !== "available")
|
|
79
|
+
lines.push("Retained usage:");
|
|
80
|
+
lines.push(...availableDetails(report));
|
|
89
81
|
}
|
|
90
82
|
if (entry.loginErrors?.length) {
|
|
91
83
|
lines.push("Login failures:");
|
|
@@ -119,4 +111,36 @@ export const usageSchema = {
|
|
|
119
111
|
return renderTable({ type: "list", data: rows, schema: summarySchema }, options);
|
|
120
112
|
},
|
|
121
113
|
};
|
|
114
|
+
function availableDetails(report) {
|
|
115
|
+
const lines = [];
|
|
116
|
+
lines.push(`Plan: ${value(report.planLabel)}`, "Windows:");
|
|
117
|
+
if (!report.windows.length)
|
|
118
|
+
lines.push(" -");
|
|
119
|
+
for (const window of report.windows) {
|
|
120
|
+
lines.push(` ${windowText(window)} [${window.id}]`, ` Resets: ${value(window.resetsAt)}`);
|
|
121
|
+
if (window.runsOutAt != null)
|
|
122
|
+
lines.push(` Runs out: ${window.runsOutAt}`);
|
|
123
|
+
if (window.shortfallPct != null)
|
|
124
|
+
lines.push(` Shortfall: ${percent(window.shortfallPct)}`);
|
|
125
|
+
}
|
|
126
|
+
lines.push("Balances:");
|
|
127
|
+
if (!report.balances?.length)
|
|
128
|
+
lines.push(" -");
|
|
129
|
+
for (const balance of report.balances ?? []) {
|
|
130
|
+
lines.push(` ${balanceText(balance)} [${balance.id}]`, ` Resets: ${value(balance.resetsAt)}`);
|
|
131
|
+
}
|
|
132
|
+
lines.push("Details:");
|
|
133
|
+
if (!report.details?.length)
|
|
134
|
+
lines.push(" -");
|
|
135
|
+
for (const detail of report.details ?? [])
|
|
136
|
+
lines.push(` ${detail.label}: ${detail.value}`);
|
|
137
|
+
return lines;
|
|
138
|
+
}
|
|
139
|
+
function successfulTime(entry) {
|
|
140
|
+
// COMPAT(usageSuccessfulAt): added in v0.12.0, remove after 2027-04-17 once daemon floor >= v0.12.0.
|
|
141
|
+
// Only available reports from older daemons can use their attempt timestamp as freshness.
|
|
142
|
+
if (entry.report.status === "available")
|
|
143
|
+
return entry.successfulAt ?? entry.fetchedAt;
|
|
144
|
+
return entry.lastSuccessful?.fetchedAt;
|
|
145
|
+
}
|
|
122
146
|
//# sourceMappingURL=presentation.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camerontaylor/paseo-cli",
|
|
3
|
-
"version": "0.12.0-
|
|
3
|
+
"version": "0.12.0-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.12.0-
|
|
32
|
-
"@camerontaylor/paseo-protocol": "0.12.0-
|
|
33
|
-
"@camerontaylor/paseo-server": "0.12.0-
|
|
31
|
+
"@camerontaylor/paseo-client": "0.12.0-fork.1",
|
|
32
|
+
"@camerontaylor/paseo-protocol": "0.12.0-fork.1",
|
|
33
|
+
"@camerontaylor/paseo-server": "0.12.0-fork.1",
|
|
34
34
|
"chalk": "^5.3.0",
|
|
35
35
|
"commander": "^12.0.0",
|
|
36
36
|
"mime-types": "^2.1.35",
|