@getpaseo/plugin 0.7.2 → 0.8.0

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.
Files changed (48) hide show
  1. package/dist/attachments.d.ts +2 -0
  2. package/dist/attachments.js +3 -0
  3. package/dist/client/buttons.d.ts +64 -0
  4. package/dist/client/buttons.js +2 -0
  5. package/dist/{client-state.d.ts → client/client-state.d.ts} +1 -1
  6. package/dist/client/contracts.d.ts +201 -0
  7. package/dist/client/contracts.js +2 -0
  8. package/dist/client/host.d.ts +19 -0
  9. package/dist/client/host.js +12 -0
  10. package/dist/client/index.d.ts +10 -0
  11. package/dist/client/index.js +4 -0
  12. package/dist/client/react-native.d.ts +46 -0
  13. package/dist/{rpc-context.d.ts → client/rpc-context.d.ts} +1 -1
  14. package/dist/{rpc-context.js → client/rpc-context.js} +1 -1
  15. package/dist/client/ui.d.ts +60 -0
  16. package/dist/client/ui.js +2 -0
  17. package/dist/contracts.d.ts +3 -172
  18. package/dist/index.d.ts +4 -8
  19. package/dist/index.js +3 -4
  20. package/dist/rpc.d.ts +2 -0
  21. package/dist/server/acp-internal/connection.d.ts +4 -0
  22. package/dist/server/acp-internal/connection.js +1187 -0
  23. package/dist/server/acp.d.ts +112 -0
  24. package/dist/server/acp.js +21 -0
  25. package/dist/server/contracts.d.ts +16 -0
  26. package/dist/server/contracts.js +2 -0
  27. package/dist/server/index.d.ts +3 -0
  28. package/dist/server/index.js +2 -0
  29. package/dist/server/lifecycle.d.ts +92 -0
  30. package/dist/server/lifecycle.js +2 -0
  31. package/dist/server/provider.d.ts +610 -0
  32. package/dist/server/provider.js +811 -0
  33. package/dist/settings.d.ts +70 -0
  34. package/dist/settings.js +40 -0
  35. package/package.json +45 -17
  36. package/dist/host.d.ts +0 -43
  37. package/dist/host.js +0 -43
  38. package/dist/react-native.d.ts +0 -29
  39. package/dist/server.d.ts +0 -6
  40. package/dist/server.js +0 -6
  41. /package/dist/{client-state.js → client/client-state.js} +0 -0
  42. /package/dist/{paseo-context.d.ts → client/paseo-context.d.ts} +0 -0
  43. /package/dist/{paseo-context.js → client/paseo-context.js} +0 -0
  44. /package/dist/{react-native.js → client/react-native.js} +0 -0
  45. /package/dist/{runtime-context-bridge.d.ts → client/runtime-context-bridge.d.ts} +0 -0
  46. /package/dist/{runtime-context-bridge.js → client/runtime-context-bridge.js} +0 -0
  47. /package/dist/{shallow.d.ts → client/shallow.d.ts} +0 -0
  48. /package/dist/{shallow.js → client/shallow.js} +0 -0
@@ -1,7 +1,4 @@
1
- import type { ComponentType } from "react";
2
- import type { PaseoApi } from "@getpaseo/client";
3
- import type { AgentTimelineItem } from "@getpaseo/protocol/agent-types";
4
- import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
1
+ import type { JsonValue } from "@getpaseo/protocol/agent-types";
5
2
  import type { PluginRpcContract } from "./rpc.js";
6
3
  export interface PluginTheme {
7
4
  readonly colors: {
@@ -18,35 +15,6 @@ export interface PluginTheme {
18
15
  readonly statusDanger: string;
19
16
  };
20
17
  }
21
- export interface PluginHostProps {
22
- theme: PluginTheme;
23
- host: {
24
- id: string;
25
- label: string;
26
- };
27
- layout: {
28
- compact: boolean;
29
- platform: "ios" | "android" | "web";
30
- };
31
- }
32
- interface PluginNavigableHostProps extends PluginHostProps {
33
- /** Client-owned navigation. Undefined on older hosts; hide dependent affordances when absent. */
34
- readonly navigation?: {
35
- readonly openAgent: (input: {
36
- readonly agentId: string;
37
- }) => void;
38
- readonly openWorkspace: (input: {
39
- readonly workspaceId: string;
40
- }) => void;
41
- };
42
- }
43
- export interface PluginSurfaceProps extends PluginNavigableHostProps {
44
- }
45
- export interface PluginIconProps {
46
- name: string;
47
- size?: number;
48
- color?: string;
49
- }
50
18
  export interface PluginWorkspaceSnapshot {
51
19
  readonly id: string;
52
20
  readonly projectId: string;
@@ -83,63 +51,6 @@ export interface PluginAgentSnapshot {
83
51
  readonly parentAgentId: string | null;
84
52
  readonly labels: Readonly<Record<string, string>>;
85
53
  }
86
- export type PluginPanelLocation = "workspace" | "explorer";
87
- export interface PluginOpenPanelOptions {
88
- location?: PluginPanelLocation;
89
- }
90
- interface PluginWorkspacePanelBase {
91
- id: string;
92
- title: string;
93
- icon: string;
94
- locations?: readonly PluginPanelLocation[];
95
- }
96
- export interface PluginWorkspacePanelProps extends PluginNavigableHostProps {
97
- context: "workspace";
98
- workspaceId: string;
99
- }
100
- export interface PluginAgentPanelProps extends PluginNavigableHostProps {
101
- context: "agent";
102
- workspaceId: string;
103
- agentId: string;
104
- }
105
- export interface PluginComposerPillProps extends PluginHostProps {
106
- workspaceId: string;
107
- agentId: string;
108
- }
109
- export interface PluginComposerPillContribution {
110
- id: string;
111
- title: string;
112
- workspaceId: string;
113
- agentId: string;
114
- Component: ComponentType<PluginComposerPillProps>;
115
- onPress(): void | Promise<void>;
116
- }
117
- export interface PluginClientOpenPanelOptions extends PluginOpenPanelOptions {
118
- workspaceId: string;
119
- agentId?: string;
120
- }
121
- export interface PluginClientContext extends PluginCommandCapabilities {
122
- addComposerPill(contribution: PluginComposerPillContribution): PluginCleanup;
123
- openPanel(id: string, options: PluginClientOpenPanelOptions): void;
124
- }
125
- export type PluginClientContribution = (client: PluginClientContext) => PluginCleanup;
126
- export type PluginWorkspacePanelContribution = (PluginWorkspacePanelBase & {
127
- context: "workspace";
128
- Component: ComponentType<PluginWorkspacePanelProps>;
129
- }) | (PluginWorkspacePanelBase & {
130
- context: "agent";
131
- Component: ComponentType<PluginAgentPanelProps>;
132
- });
133
- export interface PluginSurfaceContribution {
134
- id: string;
135
- Component: ComponentType<PluginSurfaceProps>;
136
- }
137
- export interface PluginSidebarContribution {
138
- id: string;
139
- title: string;
140
- icon: string;
141
- surface: string;
142
- }
143
54
  export interface PluginThemeColors {
144
55
  background: string;
145
56
  foreground: string;
@@ -164,11 +75,10 @@ export interface PluginAttachmentSourceContribution {
164
75
  searchPlaceholder: string;
165
76
  search: PluginRpcContract;
166
77
  }
167
- export type PluginTimelineData = null | boolean | number | string | PluginTimelineData[] | {
168
- [key: string]: PluginTimelineData;
169
- };
78
+ export type PluginTimelineData = JsonValue;
170
79
  export interface PluginTimelineItem {
171
80
  type: "plugin";
81
+ id?: string;
172
82
  kind: string;
173
83
  version: number;
174
84
  data: PluginTimelineData;
@@ -176,84 +86,5 @@ export interface PluginTimelineItem {
176
86
  export interface PluginTimelineTransformResult {
177
87
  items: PluginTimelineItem[];
178
88
  }
179
- export type PluginTimelineTransformerContribution<ItemType extends AgentTimelineItem["type"] = AgentTimelineItem["type"]> = ItemType extends AgentTimelineItem["type"] ? {
180
- id: string;
181
- query: {
182
- itemType: ItemType;
183
- };
184
- transform(input: {
185
- item: Extract<AgentTimelineItem, {
186
- type: ItemType;
187
- }>;
188
- }): PluginTimelineTransformResult | undefined;
189
- } : never;
190
- export interface PluginTimelineItemProps<Data = unknown> extends PluginHostProps {
191
- agentId: string;
192
- item: {
193
- type: "plugin";
194
- kind: string;
195
- version: number;
196
- data: Data;
197
- };
198
- timestamp: Date;
199
- }
200
- export interface PluginTimelineRendererContribution<Schema extends ZodType = ZodType> {
201
- kind: string;
202
- version: number;
203
- schema: Schema;
204
- Component: ComponentType<PluginTimelineItemProps<ZodOutput<Schema>>>;
205
- }
206
- export interface PluginCommandCapabilities {
207
- paseo: PaseoApi;
208
- rpc<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>, input: ZodInput<InputSchema>): Promise<ZodOutput<OutputSchema>>;
209
- openSurface(id: string): void;
210
- }
211
- export interface PluginGlobalCommandContext extends PluginCommandCapabilities {
212
- context: "global";
213
- }
214
- export interface PluginWorkspaceCommandContext extends PluginCommandCapabilities {
215
- context: "workspace";
216
- workspace: PluginWorkspaceSnapshot;
217
- openPanel(id: string, options?: PluginOpenPanelOptions): void;
218
- }
219
- export interface PluginAgentCommandContext extends PluginCommandCapabilities {
220
- context: "agent";
221
- workspace: PluginWorkspaceSnapshot;
222
- agent: PluginAgentSnapshot;
223
- openPanel(id: string, options?: PluginOpenPanelOptions): void;
224
- }
225
- interface PluginCommandCenterItemBase {
226
- id: string;
227
- title: string;
228
- icon: string;
229
- keywords?: readonly string[];
230
- }
231
- export type PluginCommandCenterItemContribution = (PluginCommandCenterItemBase & {
232
- context: "global";
233
- onSelect(context: PluginGlobalCommandContext): void | Promise<void>;
234
- }) | (PluginCommandCenterItemBase & {
235
- context: "workspace";
236
- onSelect(context: PluginWorkspaceCommandContext): void | Promise<void>;
237
- }) | (PluginCommandCenterItemBase & {
238
- context: "agent";
239
- onSelect(context: PluginAgentCommandContext): void | Promise<void>;
240
- });
241
- export interface PluginHandlerContext {
242
- paseo: PaseoApi;
243
- }
244
- export interface PluginContext {
245
- handle<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>, handler: (input: ZodOutput<InputSchema>, context: PluginHandlerContext) => ZodInput<OutputSchema> | Promise<ZodInput<OutputSchema>>): void;
246
- addSurface(id: string, Component: ComponentType<PluginSurfaceProps>): void;
247
- addSidebarItem(contribution: PluginSidebarContribution): void;
248
- addWorkspacePanel(contribution: PluginWorkspacePanelContribution): void;
249
- addCommandCenterItem(contribution: PluginCommandCenterItemContribution): void;
250
- addClientSide(contribution: PluginClientContribution): void;
251
- addAttachmentSource(contribution: PluginAttachmentSourceContribution): void;
252
- addTheme(contribution: PluginThemeContribution): void;
253
- addTimelineTransformer<ItemType extends AgentTimelineItem["type"]>(contribution: PluginTimelineTransformerContribution<ItemType>): void;
254
- addTimelineRenderer<Schema extends ZodType>(contribution: PluginTimelineRendererContribution<Schema>): void;
255
- }
256
89
  export type PluginCleanup = () => void | Promise<void>;
257
- export type PluginContribution = (plugin: PluginContext) => PluginCleanup;
258
- export {};
259
90
  //# sourceMappingURL=contracts.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
- import type { ComponentType } from "react";
2
- import type { PluginIconProps } from "./contracts.js";
3
- export { PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, defineAttachmentSource, defineRpc, type PluginAttachmentItem, type PluginAttachmentSearchPayload, type PluginRpcContract, } from "./server.js";
4
- export declare const Icon: ComponentType<PluginIconProps>;
5
- export type { PluginAttachmentSourceContribution, PluginAgentCommandContext, PluginAgentPanelProps, PluginAgentSnapshot, PluginCleanup, PluginCommandCapabilities, PluginCommandCenterItemContribution, PluginClientContext, PluginClientContribution, PluginClientOpenPanelOptions, PluginComposerPillContribution, PluginComposerPillProps, PluginContribution, PluginContext, PluginGlobalCommandContext, PluginHandlerContext, PluginHostProps, PluginOpenPanelOptions, PluginIconProps, PluginPanelLocation, PluginTheme, PluginSidebarContribution, PluginSurfaceContribution, PluginSurfaceProps, PluginThemeColors, PluginThemeContribution, PluginTimelineData, PluginTimelineItem, PluginTimelineItemProps, PluginTimelineRendererContribution, PluginTimelineTransformerContribution, PluginTimelineTransformResult, PluginWorkspaceCommandContext, PluginWorkspacePanelContribution, PluginWorkspacePanelProps, PluginWorkspaceSnapshot, } from "./contracts.js";
6
- export { usePaseo } from "./paseo-context.js";
7
- export { useAgent, useWorkspace } from "./client-state.js";
8
- export { useRpc } from "./rpc-context.js";
1
+ export type { PluginTheme, PluginWorkspaceSnapshot, PluginAgentSnapshot, PluginThemeColors, PluginThemeContribution, PluginAttachmentSourceContribution, PluginTimelineData, PluginTimelineItem, PluginTimelineTransformResult, PluginCleanup, } from "./contracts.js";
2
+ export { defineSettings, settingsRpc, type SettingsDefinition } from "./settings.js";
3
+ export { defineAttachmentSource, PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, type PluginAttachmentItem, type PluginAttachmentSearchPayload, } from "./attachments.js";
4
+ export { defineRpc, type PluginRpcContract, type RpcInput, type RpcOutput } from "./rpc.js";
9
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- export { PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, defineAttachmentSource, defineRpc, } from "./server.js";
2
- export { usePaseo } from "./paseo-context.js";
3
- export { useAgent, useWorkspace } from "./client-state.js";
4
- export { useRpc } from "./rpc-context.js";
1
+ export { defineSettings, settingsRpc } from "./settings.js";
2
+ export { defineAttachmentSource, PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, } from "./attachments.js";
3
+ export { defineRpc } from "./rpc.js";
5
4
  //# sourceMappingURL=index.js.map
package/dist/rpc.d.ts CHANGED
@@ -4,6 +4,8 @@ export interface PluginRpcContract<InputSchema extends ZodType = ZodType, Output
4
4
  input: InputSchema;
5
5
  output: OutputSchema;
6
6
  }
7
+ export type RpcInput<Contract extends PluginRpcContract> = ZodOutput<Contract["input"]>;
8
+ export type RpcOutput<Contract extends PluginRpcContract> = ZodInput<Contract["output"]>;
7
9
  interface RpcDefinition<InputSchema extends ZodType, OutputSchema extends ZodType> {
8
10
  name: string;
9
11
  input: InputSchema;
@@ -0,0 +1,4 @@
1
+ import type { RunAcpProviderOptions } from "../acp.js";
2
+ import { type ProviderConnectRequest, type ProviderConnection } from "../provider.js";
3
+ export declare function createAcpProviderConnection(options: RunAcpProviderOptions, request: ProviderConnectRequest): Promise<ProviderConnection>;
4
+ //# sourceMappingURL=connection.d.ts.map