@getpaseo/cli 0.7.1 → 0.7.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.
@@ -1,5 +1,6 @@
1
1
  import { Command } from "commander";
2
2
  import path from "node:path";
3
+ import { formatPluginSourceReference, parsePluginSourceReference, } from "@getpaseo/protocol/plugin-source-reference";
3
4
  import { withOutput } from "../../output/index.js";
4
5
  import { addJsonAndDaemonHostOptions, addJsonOption } from "../../utils/command-options.js";
5
6
  import { scaffoldPluginDirectory } from "./scaffold.js";
@@ -69,6 +70,7 @@ export async function runPluginLogsCommand(pluginId, options, _command) {
69
70
  return { type: "list", data, schema: pluginLogsSchema };
70
71
  }
71
72
  async function install(source, options, _command) {
73
+ process.stderr.write("Trusting plugin code: server code and Git build commands run unsandboxed on the daemon host; client code runs inside Paseo. Dependencies and future updates are part of the codebase you trust.\n");
72
74
  const isExplicitPath = path.isAbsolute(source) ||
73
75
  source === "." ||
74
76
  source === ".." ||
@@ -76,14 +78,15 @@ async function install(source, options, _command) {
76
78
  source.startsWith("../") ||
77
79
  source.startsWith(".\\") ||
78
80
  source.startsWith("..\\");
79
- const canUseLegacyDirectoryInstall = isExplicitPath && !options.ref && !options.path;
81
+ const hasPluginPathSuffix = parsePluginSourceReference(source).pluginPath !== undefined;
82
+ const canUseLegacyDirectoryInstall = isExplicitPath && !hasPluginPathSuffix && !options.ref && !options.path;
83
+ const sourceReference = formatPluginSourceReference(source, options.path);
80
84
  const data = canUseLegacyDirectoryInstall
81
85
  ? await withPluginManagementClient(options.host, (client) => client.installDirectoryPlugin(source, options.id))
82
86
  : await withPluginSourceClient(options.host, (client) => client.installPluginSource({
83
- source,
87
+ source: sourceReference,
84
88
  ...(options.id ? { id: options.id } : {}),
85
89
  ...(options.ref ? { ref: options.ref } : {}),
86
- ...(options.path ? { pluginPath: options.path } : {}),
87
90
  }));
88
91
  return { type: "single", data, schema: pluginSchema };
89
92
  }
@@ -113,7 +116,7 @@ async function remove(pluginId, options, _command) {
113
116
  return { type: "single", data, schema: pluginSchema };
114
117
  }
115
118
  export function createPluginCommand() {
116
- const plugin = new Command("plugin").description("Manage trusted plugins");
119
+ const plugin = new Command("plugin").description("Manage trusted, unsandboxed plugins");
117
120
  addJsonOption(plugin
118
121
  .command("init")
119
122
  .description("Create a typecheckable local plugin")
@@ -124,11 +127,11 @@ export function createPluginCommand() {
124
127
  addJsonAndDaemonHostOptions(plugin
125
128
  .command("install")
126
129
  .alias("add")
127
- .description("Install a plugin from a directory or Git repository")
128
- .argument("<source>", "Host directory, owner/repo shorthand, or Git URL")
130
+ .description("Trust and install a plugin from a directory or Git repository")
131
+ .argument("<source>", "Host directory, Git source, or Git source:plugin/path")
129
132
  .option("--id <id>", "Runtime plugin ID (defaults to paseo-plugin.json id)")
130
133
  .option("--ref <ref>", "Git branch, tag, or commit")
131
- .option("--path <path>", "Plugin directory within the repository")).action(withOutput(install));
134
+ .option("--path <path>", "Legacy form of the :plugin/path source suffix")).action(withOutput(install));
132
135
  addJsonAndDaemonHostOptions(plugin.command("status").description("Check plugin source updates").argument("[id]")).action(withOutput(status));
133
136
  addJsonAndDaemonHostOptions(plugin
134
137
  .command("update")
@@ -1,363 +1,7 @@
1
1
  import { mkdir, readdir, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { PluginIdSchema } from "@getpaseo/protocol/messages";
4
- const SDK_DECLARATIONS = `declare module "@getpaseo/plugin/server" {
5
- import type { PaseoApi } from "@getpaseo/client";
6
- import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
7
-
8
- export interface PluginRpcContract<
9
- InputSchema extends ZodType = ZodType,
10
- OutputSchema extends ZodType = ZodType,
11
- > {
12
- name: string;
13
- input: InputSchema;
14
- output: OutputSchema;
15
- }
16
-
17
- export interface PluginAttachmentItem {
18
- id: string;
19
- identifier: string;
20
- title: string;
21
- subtitle?: string;
22
- url: string;
23
- text: string;
24
- resourceType: string;
25
- }
26
-
27
- export interface PluginAttachmentSearchPayload {
28
- items: PluginAttachmentItem[];
29
- }
30
-
31
- export interface PluginAttachmentSourceContribution {
32
- id: string;
33
- title: string;
34
- icon: string;
35
- pickerTitle: string;
36
- searchPlaceholder: string;
37
- search: PluginRpcContract;
38
- }
39
-
40
- export interface PluginHandlerContext {
41
- paseo: PaseoApi;
42
- }
43
-
44
- export function defineRpc<InputSchema extends ZodType, OutputSchema extends ZodType>(definition: {
45
- name: string;
46
- input: InputSchema;
47
- output: OutputSchema;
48
- }): PluginRpcContract<InputSchema, OutputSchema>;
49
-
50
- export function defineAttachmentSource<Definition extends PluginAttachmentSourceContribution>(
51
- definition: Definition,
52
- ): Definition;
53
-
54
- export const PluginAttachmentItemSchema: import("zod").ZodType<PluginAttachmentItem>;
55
- export const PluginAttachmentSearchPayloadSchema: import("zod").ZodType<PluginAttachmentSearchPayload>;
56
- }
57
-
58
- declare module "@getpaseo/plugin/react-native" {
59
- import type { ComponentType, FunctionComponent, ReactNode } from "react";
60
-
61
- export interface PluginIconProps {
62
- name: string;
63
- size?: number;
64
- color?: string;
65
- }
66
-
67
- export interface ModalProps {
68
- title: string;
69
- icon?: ReactNode;
70
- open: boolean;
71
- onOpenChange(open: boolean): void;
72
- children: ReactNode;
73
- }
74
-
75
- export interface ModalContentProps {
76
- children: ReactNode;
77
- }
78
-
79
- export interface ModalComponent extends FunctionComponent<ModalProps> {
80
- Content: ComponentType<ModalContentProps>;
81
- }
82
-
83
- export type ToastVariant = "default" | "info" | "success" | "warning" | "error";
84
- export interface ToastOptions {
85
- variant?: ToastVariant;
86
- durationMs?: number;
87
- }
88
- export interface ToastApi {
89
- show(message: string, options?: ToastOptions): void;
90
- error(message: string): void;
91
- }
92
-
93
- export const Icon: ComponentType<PluginIconProps>;
94
- export const Modal: ModalComponent;
95
- export function useToast(): ToastApi;
96
- }
97
-
98
- declare module "@getpaseo/plugin" {
99
- import type { ComponentType } from "react";
100
- import type { PaseoApi } from "@getpaseo/client";
101
- import type { AgentTimelineItem } from "@getpaseo/protocol/agent-types";
102
- import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
103
- import type {
104
- PluginAttachmentSourceContribution,
105
- PluginHandlerContext,
106
- PluginRpcContract,
107
- } from "@getpaseo/plugin/server";
108
-
109
- export {
110
- PluginAttachmentItemSchema,
111
- PluginAttachmentSearchPayloadSchema,
112
- defineAttachmentSource,
113
- defineRpc,
114
- type PluginAttachmentItem,
115
- type PluginAttachmentSearchPayload,
116
- type PluginAttachmentSourceContribution,
117
- type PluginHandlerContext,
118
- type PluginRpcContract,
119
- } from "@getpaseo/plugin/server";
120
-
121
- export interface PluginTheme {
122
- readonly colors: {
123
- readonly surface0: string;
124
- readonly surface1: string;
125
- readonly surface2: string;
126
- readonly border: string;
127
- readonly foreground: string;
128
- readonly foregroundMuted: string;
129
- readonly accent: string;
130
- readonly accentForeground: string;
131
- readonly statusSuccess: string;
132
- readonly statusWarning: string;
133
- readonly statusDanger: string;
134
- };
135
- }
136
-
137
- export interface PluginHostProps {
138
- theme: PluginTheme;
139
- host: { id: string; label: string };
140
- layout: { compact: boolean; platform: "ios" | "android" | "web" };
141
- }
142
-
143
- interface PluginNavigableHostProps extends PluginHostProps {
144
- /** Client-owned navigation. Undefined on older hosts; hide dependent affordances when absent. */
145
- readonly navigation?: {
146
- readonly openAgent: (input: { readonly agentId: string }) => void;
147
- readonly openWorkspace: (input: { readonly workspaceId: string }) => void;
148
- };
149
- }
150
-
151
- export interface PluginSurfaceProps extends PluginNavigableHostProps {}
152
-
153
- export interface PluginIconProps {
154
- name: string;
155
- size?: number;
156
- color?: string;
157
- }
158
-
159
- export interface PluginWorkspaceSnapshot {
160
- readonly id: string;
161
- readonly projectId: string;
162
- readonly projectDisplayName: string;
163
- readonly projectRootPath: string;
164
- readonly directory: string;
165
- readonly projectKind: "git" | "non_git" | "directory";
166
- readonly kind: "directory" | "local_checkout" | "checkout" | "worktree";
167
- readonly name: string;
168
- readonly title: string | null;
169
- readonly status: "needs_input" | "failed" | "running" | "attention" | "done";
170
- readonly statusEnteredAt: string | null;
171
- readonly archivingAt: string | null;
172
- readonly diffStat: { readonly additions: number; readonly deletions: number } | null;
173
- }
174
-
175
- export interface PluginAgentSnapshot {
176
- readonly id: string;
177
- readonly workspaceId: string;
178
- readonly provider: string;
179
- readonly status: "initializing" | "idle" | "running" | "error" | "closed";
180
- readonly createdAt: string;
181
- readonly updatedAt: string;
182
- readonly lastActivityAt: string;
183
- readonly title: string | null;
184
- readonly cwd: string;
185
- readonly model: string | null;
186
- readonly currentModeId: string | null;
187
- readonly thinkingOptionId: string | null;
188
- readonly requiresAttention: boolean;
189
- readonly attentionReason: "finished" | "error" | "permission" | null;
190
- readonly parentAgentId: string | null;
191
- readonly labels: Readonly<Record<string, string>>;
192
- }
193
-
194
- export interface PluginWorkspacePanelProps extends PluginNavigableHostProps {
195
- context: "workspace";
196
- workspaceId: string;
197
- }
198
-
199
- export interface PluginAgentPanelProps extends PluginNavigableHostProps {
200
- context: "agent";
201
- workspaceId: string;
202
- agentId: string;
203
- }
204
-
205
- export interface PluginComposerPillProps extends PluginHostProps {
206
- workspaceId: string;
207
- agentId: string;
208
- }
209
-
210
- export interface PluginComposerPillContribution {
211
- id: string;
212
- title: string;
213
- workspaceId: string;
214
- agentId: string;
215
- Component: ComponentType<PluginComposerPillProps>;
216
- onPress(): void | Promise<void>;
217
- }
218
-
219
- export type PluginPanelLocation = "workspace" | "explorer";
220
- export interface PluginOpenPanelOptions { location?: PluginPanelLocation; }
221
- export interface PluginClientOpenPanelOptions extends PluginOpenPanelOptions {
222
- workspaceId: string;
223
- agentId?: string;
224
- }
225
-
226
- export type PluginWorkspacePanelContribution =
227
- | { id: string; title: string; icon: string; locations?: readonly PluginPanelLocation[]; context: "workspace"; Component: ComponentType<PluginWorkspacePanelProps> }
228
- | { id: string; title: string; icon: string; locations?: readonly PluginPanelLocation[]; context: "agent"; Component: ComponentType<PluginAgentPanelProps> };
229
-
230
- export interface PluginSidebarContribution {
231
- id: string;
232
- title: string;
233
- icon: string;
234
- surface: string;
235
- }
236
-
237
- export interface PluginThemeColors {
238
- background: string;
239
- foreground: string;
240
- raised: string;
241
- control: string;
242
- border: string;
243
- accent?: string;
244
- mutedForeground: string;
245
- ring: string;
246
- }
247
-
248
- export interface PluginThemeContribution {
249
- id: string;
250
- name: string;
251
- appearance: "light" | "dark";
252
- colors: PluginThemeColors;
253
- }
254
-
255
- export interface PluginSurfaceContribution {
256
- id: string;
257
- Component: ComponentType<PluginSurfaceProps>;
258
- }
259
-
260
- export type PluginTimelineData = null | boolean | number | string | PluginTimelineData[] | { [key: string]: PluginTimelineData };
261
- export interface PluginTimelineItem { type: "plugin"; kind: string; version: number; data: PluginTimelineData; }
262
- export interface PluginTimelineTransformResult { items: PluginTimelineItem[]; }
263
- export type PluginTimelineTransformerContribution<ItemType extends AgentTimelineItem["type"] = AgentTimelineItem["type"]> =
264
- ItemType extends AgentTimelineItem["type"]
265
- ? {
266
- id: string;
267
- query: { itemType: ItemType };
268
- transform(input: { item: Extract<AgentTimelineItem, { type: ItemType }> }): PluginTimelineTransformResult | undefined;
269
- }
270
- : never;
271
- export interface PluginTimelineItemProps<Data = unknown> extends PluginHostProps {
272
- agentId: string;
273
- item: { type: "plugin"; kind: string; version: number; data: Data };
274
- timestamp: Date;
275
- }
276
- export interface PluginTimelineRendererContribution<Schema extends ZodType = ZodType> {
277
- kind: string;
278
- version: number;
279
- schema: Schema;
280
- Component: ComponentType<PluginTimelineItemProps<ZodOutput<Schema>>>;
281
- }
282
-
283
- export interface PluginCommandCapabilities {
284
- paseo: PaseoApi;
285
- rpc<InputSchema extends ZodType, OutputSchema extends ZodType>(
286
- contract: PluginRpcContract<InputSchema, OutputSchema>,
287
- input: ZodInput<InputSchema>,
288
- ): Promise<ZodOutput<OutputSchema>>;
289
- openSurface(id: string): void;
290
- }
291
-
292
- export interface PluginGlobalCommandContext extends PluginCommandCapabilities {
293
- context: "global";
294
- }
295
-
296
- export interface PluginWorkspaceCommandContext extends PluginCommandCapabilities {
297
- context: "workspace";
298
- workspace: PluginWorkspaceSnapshot;
299
- openPanel(id: string, options?: PluginOpenPanelOptions): void;
300
- }
301
-
302
- export interface PluginAgentCommandContext extends PluginCommandCapabilities {
303
- context: "agent";
304
- workspace: PluginWorkspaceSnapshot;
305
- agent: PluginAgentSnapshot;
306
- openPanel(id: string, options?: PluginOpenPanelOptions): void;
307
- }
308
-
309
- export interface PluginClientContext extends PluginCommandCapabilities {
310
- addComposerPill(contribution: PluginComposerPillContribution): PluginCleanup;
311
- openPanel(id: string, options: PluginClientOpenPanelOptions): void;
312
- }
313
- export type PluginClientContribution = (client: PluginClientContext) => PluginCleanup;
314
-
315
- export type PluginCommandCenterItemContribution =
316
- | { id: string; title: string; icon: string; keywords?: readonly string[]; context: "global"; onSelect(context: PluginGlobalCommandContext): void | Promise<void> }
317
- | { id: string; title: string; icon: string; keywords?: readonly string[]; context: "workspace"; onSelect(context: PluginWorkspaceCommandContext): void | Promise<void> }
318
- | { id: string; title: string; icon: string; keywords?: readonly string[]; context: "agent"; onSelect(context: PluginAgentCommandContext): void | Promise<void> };
319
-
320
- export interface PluginContext {
321
- handle<InputSchema extends ZodType, OutputSchema extends ZodType>(
322
- contract: PluginRpcContract<InputSchema, OutputSchema>,
323
- handler: (
324
- input: ZodOutput<InputSchema>,
325
- context: PluginHandlerContext,
326
- ) => ZodInput<OutputSchema> | Promise<ZodInput<OutputSchema>>,
327
- ): void;
328
- addSurface(id: string, Component: ComponentType<PluginSurfaceProps>): void;
329
- addSidebarItem(contribution: PluginSidebarContribution): void;
330
- addWorkspacePanel(contribution: PluginWorkspacePanelContribution): void;
331
- addCommandCenterItem(contribution: PluginCommandCenterItemContribution): void;
332
- addClientSide(contribution: PluginClientContribution): void;
333
- addAttachmentSource(contribution: PluginAttachmentSourceContribution): void;
334
- addTheme(contribution: PluginThemeContribution): void;
335
- addTimelineTransformer<ItemType extends AgentTimelineItem["type"]>(contribution: PluginTimelineTransformerContribution<ItemType>): void;
336
- addTimelineRenderer<Schema extends ZodType>(contribution: PluginTimelineRendererContribution<Schema>): void;
337
- }
338
-
339
- export type PluginCleanup = () => void | Promise<void>;
340
- export type PluginContribution = (plugin: PluginContext) => PluginCleanup;
341
-
342
- export const Icon: ComponentType<PluginIconProps>;
343
-
344
- export function useRpc<InputSchema extends ZodType, OutputSchema extends ZodType>(
345
- contract: PluginRpcContract<InputSchema, OutputSchema>,
346
- ): (input: ZodInput<InputSchema>) => Promise<ZodOutput<OutputSchema>>;
347
-
348
- export function usePaseo(): PaseoApi;
349
-
350
- export function useWorkspace<Selection>(
351
- workspaceId: string,
352
- selector: (workspace: PluginWorkspaceSnapshot) => Selection,
353
- ): Selection | null;
354
-
355
- export function useAgent<Selection>(
356
- agentId: string,
357
- selector: (agent: PluginAgentSnapshot) => Selection,
358
- ): Selection | null;
359
- }
360
- `;
4
+ import { resolveCliVersion } from "../../version.js";
361
5
  const TSCONFIG = {
362
6
  compilerOptions: {
363
7
  target: "ES2020",
@@ -418,8 +62,7 @@ export async function scaffoldPluginDirectory(targetDirectory, requestedId) {
418
62
  version: "0.0.0",
419
63
  scripts: { typecheck: "tsc --noEmit" },
420
64
  devDependencies: {
421
- "@getpaseo/client": "^0.4.0",
422
- "@getpaseo/protocol": "^0.6.1",
65
+ "@getpaseo/plugin": resolveCliVersion(),
423
66
  "@tanstack/react-query": "^5.90.11",
424
67
  "@types/react": "~19.2.0",
425
68
  react: "19.1.0",
@@ -432,7 +75,6 @@ export async function scaffoldPluginDirectory(targetDirectory, requestedId) {
432
75
  ["paseo-plugin.json", `${JSON.stringify({ id }, null, 2)}\n`],
433
76
  ["package.json", `${JSON.stringify(packageJson, null, 2)}\n`],
434
77
  ["tsconfig.json", `${JSON.stringify(TSCONFIG, null, 2)}\n`],
435
- ["paseo-plugin.d.ts", SDK_DECLARATIONS],
436
78
  ["index.ts", ENTRY],
437
79
  ["main.client.tsx", CLIENT_SURFACE],
438
80
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.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.7.1",
32
- "@getpaseo/protocol": "0.7.1",
33
- "@getpaseo/server": "0.7.1",
31
+ "@getpaseo/client": "0.7.2",
32
+ "@getpaseo/protocol": "0.7.2",
33
+ "@getpaseo/server": "0.7.2",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
36
36
  "mime-types": "^2.1.35",