@camerontaylor/paseo-cli 0.11.1-fork.1 → 0.11.1-fork.2

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.
@@ -0,0 +1,21 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, SingleResult } from "../../output/index.js";
3
+ interface AgentArtifactsScanResult {
4
+ agentId: string;
5
+ addedOrUpdated: number;
6
+ total: number;
7
+ }
8
+ export interface ArtifactsScanOptions extends CommandOptions {
9
+ limit?: string;
10
+ }
11
+ export declare function addArtifactsScanOptions(command: Command): Command;
12
+ /**
13
+ * Backfills an agent's artifact feed from files already on disk.
14
+ *
15
+ * Artifacts are normally collected per turn, so an agent that did its work
16
+ * before the feature existed shows an empty feed no matter how much it
17
+ * produced. This scans its working directory once and records what it finds.
18
+ */
19
+ export declare function runArtifactsScanCommand(agentIdArg: string, options: ArtifactsScanOptions, _command: Command): Promise<SingleResult<AgentArtifactsScanResult>>;
20
+ export {};
21
+ //# sourceMappingURL=artifacts-scan.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { connectToDaemon, getDaemonHost, resolveAgentId } from "../../utils/client.js";
2
+ import { selectDaemonTarget } from "../../utils/daemon-target.js";
3
+ const artifactsScanSchema = {
4
+ idField: "agentId",
5
+ columns: [
6
+ { header: "AGENT ID", field: "agentId" },
7
+ { header: "ADDED/UPDATED", field: "addedOrUpdated" },
8
+ { header: "TOTAL", field: "total" },
9
+ ],
10
+ };
11
+ export function addArtifactsScanOptions(command) {
12
+ return command.option("--limit <count>", "Maximum artifacts to retain, newest first (default: daemon default)");
13
+ }
14
+ /**
15
+ * Backfills an agent's artifact feed from files already on disk.
16
+ *
17
+ * Artifacts are normally collected per turn, so an agent that did its work
18
+ * before the feature existed shows an empty feed no matter how much it
19
+ * produced. This scans its working directory once and records what it finds.
20
+ */
21
+ export async function runArtifactsScanCommand(agentIdArg, options, _command) {
22
+ let limit;
23
+ if (options.limit !== undefined) {
24
+ const parsed = Number.parseInt(options.limit, 10);
25
+ if (!Number.isFinite(parsed) || parsed <= 0) {
26
+ throw {
27
+ code: "INVALID_ARGUMENT",
28
+ message: `--limit must be a positive integer, got: ${options.limit}`,
29
+ };
30
+ }
31
+ limit = parsed;
32
+ }
33
+ const daemonTarget = selectDaemonTarget(options);
34
+ const host = getDaemonHost({ target: daemonTarget });
35
+ let client;
36
+ try {
37
+ client = await connectToDaemon({ target: daemonTarget });
38
+ }
39
+ catch (error) {
40
+ const message = error instanceof Error ? error.message : String(error);
41
+ throw {
42
+ code: "DAEMON_NOT_RUNNING",
43
+ message: `Cannot connect to daemon at ${host}: ${message}`,
44
+ };
45
+ }
46
+ try {
47
+ const payload = await client.fetchAgents({ filter: { includeArchived: true } });
48
+ const agentId = resolveAgentId(agentIdArg, payload.entries.map((entry) => entry.agent));
49
+ if (!agentId) {
50
+ throw {
51
+ code: "AGENT_NOT_FOUND",
52
+ message: `Agent not found: ${agentIdArg}`,
53
+ };
54
+ }
55
+ const result = await client.scanAgentArtifacts(agentId, limit !== undefined ? { limit } : {});
56
+ return {
57
+ type: "single",
58
+ data: { agentId, addedOrUpdated: result.addedOrUpdated, total: result.total },
59
+ schema: artifactsScanSchema,
60
+ };
61
+ }
62
+ finally {
63
+ await client.close().catch(() => undefined);
64
+ }
65
+ }
66
+ //# sourceMappingURL=artifacts-scan.js.map
@@ -11,6 +11,7 @@ import { addInspectOptions, runInspectCommand } from "./inspect.js";
11
11
  import { addWaitOptions, runWaitCommand } from "./wait.js";
12
12
  import { addAttachOptions, runAttachCommand } from "./attach.js";
13
13
  import { addReloadOptions, runReloadCommand } from "./reload.js";
14
+ import { addArtifactsScanOptions, runArtifactsScanCommand } from "./artifacts-scan.js";
14
15
  import { addImportOptions, runImportCommand } from "./import.js";
15
16
  import { runUpdateCommand } from "./update.js";
16
17
  import { runDetachCommand } from "./detach.js";
@@ -40,6 +41,10 @@ export function createAgentCommand() {
40
41
  .option("--list", "List available modes for this agent")).action(withOutput(runModeCommand));
41
42
  addJsonAndDaemonHostOptions(addArchiveOptions(agent.command("archive"))).action(withOutput(runArchiveCommand));
42
43
  addJsonAndDaemonHostOptions(addReloadOptions(agent.command("reload"))).action(withOutput(runReloadCommand));
44
+ addJsonAndDaemonHostOptions(addArtifactsScanOptions(agent
45
+ .command("artifacts-scan")
46
+ .description("Backfill an agent's artifact feed from files already on disk")
47
+ .argument("<id>", "Agent ID, prefix, or name"))).action(withOutput(runArtifactsScanCommand));
43
48
  addJsonAndDaemonHostOptions(agent
44
49
  .command("detach")
45
50
  .description("Make a subagent independent without stopping or moving it")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camerontaylor/paseo-cli",
3
- "version": "0.11.1-fork.1",
3
+ "version": "0.11.1-fork.2",
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.1-fork.1",
32
- "@camerontaylor/paseo-protocol": "0.11.1-fork.1",
33
- "@camerontaylor/paseo-server": "0.11.1-fork.1",
31
+ "@camerontaylor/paseo-client": "0.11.1-fork.2",
32
+ "@camerontaylor/paseo-protocol": "0.11.1-fork.2",
33
+ "@camerontaylor/paseo-server": "0.11.1-fork.2",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
36
36
  "mime-types": "^2.1.35",