@getpaseo/cli 0.9.1 → 0.9.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.
@@ -102,6 +102,7 @@ function localStatus(home, instance) {
102
102
  pid: instance?.pid ?? null,
103
103
  startedAt: instance?.startedAt ?? null,
104
104
  listen: instance?.listen ?? null,
105
+ serverId: instance?.serverId ?? undefined,
105
106
  hostname: instance?.hostname ?? null,
106
107
  configuredListen: config.listen,
107
108
  localDaemon,
@@ -1,4 +1,5 @@
1
1
  import type { Command } from "commander";
2
+ import type { AgentPermissionRequest } from "@getpaseo/protocol/agent-types";
2
3
  import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
3
4
  /** Permission response item for display */
4
5
  export interface PermissionResponseItem {
@@ -10,6 +11,8 @@ export interface PermissionResponseItem {
10
11
  }
11
12
  /** Schema for permit allow/deny output */
12
13
  export declare const permitResponseSchema: OutputSchema<PermissionResponseItem>;
14
+ /** Transform a permission the agent answered to a response item */
15
+ export declare function toPermissionResponseItem(agentId: string, permission: AgentPermissionRequest, result: "allowed" | "denied"): PermissionResponseItem;
13
16
  export type PermitAllowResult = ListResult<PermissionResponseItem>;
14
17
  export interface PermitAllowOptions extends CommandOptions {
15
18
  all?: boolean;
@@ -3,7 +3,7 @@ import { connectToDaemon } from "../../utils/client.js";
3
3
  export const permitResponseSchema = {
4
4
  idField: "requestId",
5
5
  columns: [
6
- { header: "REQUEST ID", field: "requestId", width: 12 },
6
+ { header: "REQUEST ID", field: (item) => item.requestId.slice(0, 8), width: 12 },
7
7
  { header: "AGENT", field: "agentShortId", width: 10 },
8
8
  { header: "TOOL", field: "name", width: 20 },
9
9
  {
@@ -20,6 +20,16 @@ export const permitResponseSchema = {
20
20
  },
21
21
  ],
22
22
  };
23
+ /** Transform a permission the agent answered to a response item */
24
+ export function toPermissionResponseItem(agentId, permission, result) {
25
+ return {
26
+ requestId: permission.id,
27
+ agentId,
28
+ agentShortId: agentId.slice(0, 7),
29
+ name: permission.name,
30
+ result,
31
+ };
32
+ }
23
33
  export async function runAllowCommand(agentIdOrPrefix, reqId, options, _command) {
24
34
  // No validation needed - if no reqId provided, allow all by default
25
35
  // Parse input JSON if provided
@@ -88,13 +98,7 @@ export async function runAllowCommand(agentIdOrPrefix, reqId, options, _command)
88
98
  behavior: "allow",
89
99
  ...(updatedInput ? { updatedInput } : {}),
90
100
  });
91
- return {
92
- requestId: permission.id.slice(0, 8),
93
- agentId: resolvedAgentId,
94
- agentShortId: resolvedAgentId.slice(0, 7),
95
- name: permission.name,
96
- result: "allowed",
97
- };
101
+ return toPermissionResponseItem(resolvedAgentId, permission, "allowed");
98
102
  }));
99
103
  await client.close();
100
104
  return {
@@ -1,5 +1,5 @@
1
1
  import { connectToDaemon } from "../../utils/client.js";
2
- import { permitResponseSchema } from "./allow.js";
2
+ import { permitResponseSchema, toPermissionResponseItem, } from "./allow.js";
3
3
  export async function runDenyCommand(agentIdOrPrefix, reqId, options, _command) {
4
4
  // Validate arguments
5
5
  if (!options.all && !reqId) {
@@ -60,13 +60,7 @@ export async function runDenyCommand(agentIdOrPrefix, reqId, options, _command)
60
60
  ...(options.message ? { message: options.message } : {}),
61
61
  ...(options.interrupt ? { interrupt: true } : {}),
62
62
  });
63
- return {
64
- requestId: permission.id.slice(0, 8),
65
- agentId: resolvedAgentId,
66
- agentShortId: resolvedAgentId.slice(0, 7),
67
- name: permission.name,
68
- result: "denied",
69
- };
63
+ return toPermissionResponseItem(resolvedAgentId, permission, "denied");
70
64
  }));
71
65
  await client.close();
72
66
  return {
@@ -1,4 +1,5 @@
1
1
  import type { Command } from "commander";
2
+ import type { AgentSnapshotPayload } from "@getpaseo/protocol/messages";
2
3
  import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
3
4
  /** Permission list item for display */
4
5
  export interface PermissionListItem {
@@ -11,6 +12,8 @@ export interface PermissionListItem {
11
12
  /** Schema for permit ls output */
12
13
  export declare const permitLsSchema: OutputSchema<PermissionListItem>;
13
14
  export type PermitLsResult = ListResult<PermissionListItem>;
15
+ /** Collect the pending permissions of every agent */
16
+ export declare function listPendingPermissions(agents: AgentSnapshotPayload[]): PermitLsResult;
14
17
  export interface PermitLsOptions extends CommandOptions {
15
18
  host?: string;
16
19
  }
@@ -4,7 +4,7 @@ export const permitLsSchema = {
4
4
  idField: "id",
5
5
  columns: [
6
6
  { header: "AGENT", field: "agentShortId", width: 12 },
7
- { header: "REQ_ID", field: "id", width: 12 },
7
+ { header: "REQ_ID", field: (item) => item.id.slice(0, 8), width: 12 },
8
8
  { header: "TOOL", field: "name", width: 20 },
9
9
  { header: "DESCRIPTION", field: "description", width: 50 },
10
10
  ],
@@ -12,33 +12,34 @@ export const permitLsSchema = {
12
12
  /** Transform agent snapshot + permission to list item */
13
13
  function toListItem(agent, permission) {
14
14
  return {
15
- id: permission.id.slice(0, 8),
15
+ id: permission.id,
16
16
  agentId: agent.id,
17
17
  agentShortId: agent.id.slice(0, 7),
18
18
  name: permission.name,
19
19
  description: permission.description ?? "-",
20
20
  };
21
21
  }
22
+ /** Collect the pending permissions of every agent */
23
+ export function listPendingPermissions(agents) {
24
+ const items = [];
25
+ for (const agent of agents) {
26
+ for (const permission of agent.pendingPermissions ?? []) {
27
+ items.push(toListItem(agent, permission));
28
+ }
29
+ }
30
+ return {
31
+ type: "list",
32
+ data: items,
33
+ schema: permitLsSchema,
34
+ };
35
+ }
22
36
  export async function runLsCommand(options, _command) {
23
37
  const client = await connectToDaemon({ target: options.daemonTarget });
24
38
  try {
25
39
  const agentsPayload = await client.fetchAgents({ filter: { includeArchived: true } });
26
40
  const agents = agentsPayload.entries.map((entry) => entry.agent);
27
41
  await client.close();
28
- // Collect all pending permissions from all agents
29
- const items = [];
30
- for (const agent of agents) {
31
- if (agent.pendingPermissions && agent.pendingPermissions.length > 0) {
32
- for (const permission of agent.pendingPermissions) {
33
- items.push(toListItem(agent, permission));
34
- }
35
- }
36
- }
37
- return {
38
- type: "list",
39
- data: items,
40
- schema: permitLsSchema,
41
- };
42
+ return listPendingPermissions(agents);
42
43
  }
43
44
  catch (err) {
44
45
  await client.close().catch(() => { });
@@ -31,11 +31,18 @@ export function buildDaemonConnectionCommandError(options) {
31
31
  return {
32
32
  code,
33
33
  message: `Cannot connect to daemon at ${describeDaemonTarget(options.target)}: ${message}`,
34
- details: options.target.kind === "instance"
35
- ? `Start with: paseo daemon start --home ${JSON.stringify(options.target.home)}`
36
- : "Check the selected endpoint and credentials. SSH transport does not install or start the daemon.",
34
+ details: describeConnectionRemedy(code, options.target),
37
35
  };
38
36
  }
37
+ function describeConnectionRemedy(code, target) {
38
+ if (code === "AUTH_REQUIRED")
39
+ return "The daemon requires a password. Set PASEO_PASSWORD and retry.";
40
+ if (code === "AUTH_FAILED")
41
+ return "The daemon rejected the password. Check PASEO_PASSWORD and retry.";
42
+ if (target.kind === "instance")
43
+ return `Start with: paseo daemon start --home ${JSON.stringify(target.home)}`;
44
+ return "Check the selected endpoint and credentials. SSH transport does not install or start the daemon.";
45
+ }
39
46
  export function normalizeDaemonHost(raw) {
40
47
  const trimmed = raw.trim();
41
48
  if (!trimmed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/cli",
3
- "version": "0.9.1",
3
+ "version": "0.9.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
- "@getpaseo/client": "0.9.1",
32
- "@getpaseo/protocol": "0.9.1",
33
- "@getpaseo/server": "0.9.1",
31
+ "@getpaseo/client": "0.9.2",
32
+ "@getpaseo/protocol": "0.9.2",
33
+ "@getpaseo/server": "0.9.2",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
36
36
  "mime-types": "^2.1.35",