@yinaoxiong/paseo-plugin 0.0.0-stage → 0.11.2-personal.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.
Files changed (53) hide show
  1. package/build-info.json +21 -0
  2. package/dist/attachments.d.ts +26 -0
  3. package/dist/attachments.js +17 -0
  4. package/dist/client/buttons.d.ts +64 -0
  5. package/dist/client/buttons.js +2 -0
  6. package/dist/client/client-state.d.ts +15 -0
  7. package/dist/client/client-state.js +32 -0
  8. package/dist/client/contracts.d.ts +262 -0
  9. package/dist/client/contracts.js +2 -0
  10. package/dist/client/host.d.ts +19 -0
  11. package/dist/client/host.js +12 -0
  12. package/dist/client/index.d.ts +22 -0
  13. package/dist/client/index.js +4 -0
  14. package/dist/client/paseo-context.d.ts +9 -0
  15. package/dist/client/paseo-context.js +16 -0
  16. package/dist/client/react-native.d.ts +46 -0
  17. package/dist/client/react-native.js +2 -0
  18. package/dist/client/rpc-context.d.ts +13 -0
  19. package/dist/client/rpc-context.js +18 -0
  20. package/dist/client/runtime-context-bridge.d.ts +5 -0
  21. package/dist/client/runtime-context-bridge.js +19 -0
  22. package/dist/client/shallow.d.ts +2 -0
  23. package/dist/client/shallow.js +45 -0
  24. package/dist/client/ui.d.ts +91 -0
  25. package/dist/client/ui.js +2 -0
  26. package/dist/contracts.d.ts +90 -0
  27. package/dist/contracts.js +2 -0
  28. package/dist/index.d.ts +5 -0
  29. package/dist/index.js +4 -0
  30. package/dist/rpc.d.ts +17 -0
  31. package/dist/rpc.js +13 -0
  32. package/dist/server/acp-internal/connection.d.ts +4 -0
  33. package/dist/server/acp-internal/connection.js +1230 -0
  34. package/dist/server/acp.d.ts +112 -0
  35. package/dist/server/acp.js +22 -0
  36. package/dist/server/contracts.d.ts +31 -0
  37. package/dist/server/contracts.js +2 -0
  38. package/dist/server/index.d.ts +5 -0
  39. package/dist/server/index.js +2 -0
  40. package/dist/server/lifecycle.d.ts +95 -0
  41. package/dist/server/lifecycle.js +2 -0
  42. package/dist/server/process-internal/windows-command.d.ts +15 -0
  43. package/dist/server/process-internal/windows-command.js +41 -0
  44. package/dist/server/process.d.ts +25 -0
  45. package/dist/server/process.js +71 -0
  46. package/dist/server/provider.d.ts +636 -0
  47. package/dist/server/provider.js +825 -0
  48. package/dist/server/usage.d.ts +140 -0
  49. package/dist/server/usage.js +107 -0
  50. package/dist/settings.d.ts +70 -0
  51. package/dist/settings.js +40 -0
  52. package/package.json +85 -4
  53. package/README.md +0 -3
@@ -0,0 +1,21 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "upstreamVersion": "0.11.2",
4
+ "revision": 1,
5
+ "version": "0.11.2-personal.1",
6
+ "appVersion": "0.11.2",
7
+ "androidVersionCode": 11002001,
8
+ "iosBuildNumber": "11002999",
9
+ "sourceSha": "f6d461e8aed966e668ec4dd7c5e574877fde0937",
10
+ "lockSha256": "2c24d71c5c42c035bf12fda1d893f203fd2e659e8477953995cb55f870d3b861",
11
+ "nodeVersion": "v24.21.0",
12
+ "npmVersion": "11.19.0",
13
+ "platform": "linux",
14
+ "arch": "x64",
15
+ "signature": "unsigned",
16
+ "githubRunId": "37967635075",
17
+ "githubRunAttempt": "1",
18
+ "marker": "v0112-all-1884",
19
+ "packageName": "@yinaoxiong/paseo-plugin",
20
+ "desktopVersion": "0.11.2+personal.1"
21
+ }
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import type { PluginAttachmentSourceContribution } from "./contracts.js";
3
+ export declare function defineAttachmentSource<Definition extends PluginAttachmentSourceContribution>(definition: Definition): Definition;
4
+ export declare const PluginAttachmentItemSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ identifier: z.ZodString;
7
+ title: z.ZodString;
8
+ subtitle: z.ZodOptional<z.ZodString>;
9
+ url: z.ZodURL;
10
+ text: z.ZodString;
11
+ resourceType: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export declare const PluginAttachmentSearchPayloadSchema: z.ZodObject<{
14
+ items: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ identifier: z.ZodString;
17
+ title: z.ZodString;
18
+ subtitle: z.ZodOptional<z.ZodString>;
19
+ url: z.ZodURL;
20
+ text: z.ZodString;
21
+ resourceType: z.ZodString;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip>;
24
+ export type PluginAttachmentItem = z.infer<typeof PluginAttachmentItemSchema>;
25
+ export type PluginAttachmentSearchPayload = z.infer<typeof PluginAttachmentSearchPayloadSchema>;
26
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ export function defineAttachmentSource(definition) {
3
+ return definition;
4
+ }
5
+ export const PluginAttachmentItemSchema = z.object({
6
+ id: z.string(),
7
+ identifier: z.string(),
8
+ title: z.string(),
9
+ subtitle: z.string().optional(),
10
+ url: z.url(),
11
+ text: z.string(),
12
+ resourceType: z.string(),
13
+ });
14
+ export const PluginAttachmentSearchPayloadSchema = z.object({
15
+ items: z.array(PluginAttachmentItemSchema),
16
+ });
17
+ //# sourceMappingURL=attachments.js.map
@@ -0,0 +1,64 @@
1
+ import type { ComponentType } from "react";
2
+ import type { PluginHostProps } from "./contracts.js";
3
+ export type PluginButtonContext = {
4
+ context: "workspace";
5
+ workspaceId: string;
6
+ } | {
7
+ context: "agent";
8
+ workspaceId: string;
9
+ agentId: string;
10
+ };
11
+ export type PluginButtonIconProps = PluginHostProps & PluginButtonContext & {
12
+ size: number;
13
+ color: string;
14
+ };
15
+ export type PluginButtonContentProps = PluginHostProps & PluginButtonContext & {
16
+ close(): void;
17
+ };
18
+ export type PluginButtonIcon = string | ComponentType<PluginButtonIconProps>;
19
+ export type PluginButtonBehavior = {
20
+ kind: "action";
21
+ onPress(): void | Promise<void>;
22
+ } | {
23
+ kind: "menu";
24
+ items: readonly PluginButtonMenuEntry[];
25
+ } | {
26
+ kind: "popover";
27
+ Content: ComponentType<PluginButtonContentProps>;
28
+ };
29
+ export type PluginButtonMenuEntry = {
30
+ kind: "separator";
31
+ id: string;
32
+ } | {
33
+ kind: "item";
34
+ id: string;
35
+ title: string;
36
+ icon?: PluginButtonIcon;
37
+ visible?: boolean;
38
+ disabled?: boolean;
39
+ behavior: PluginButtonBehavior;
40
+ };
41
+ export interface PluginButton {
42
+ title: string;
43
+ icon: PluginButtonIcon;
44
+ /** Omit for an icon-only header button. Composer pills use title when omitted. */
45
+ label?: string;
46
+ visible?: boolean;
47
+ disabled?: boolean;
48
+ behavior: PluginButtonBehavior;
49
+ }
50
+ export interface PluginButtonRegistration {
51
+ /** Updates presentation in place. Supply a complete behavior to replace it. */
52
+ update(patch: Partial<PluginButton>): void;
53
+ /** Idempotent. Updates after removal do nothing. */
54
+ remove(): void;
55
+ }
56
+ export interface PluginHeaderButtonContribution {
57
+ id: string;
58
+ workspaceId: string;
59
+ button: PluginButton;
60
+ }
61
+ export interface PluginComposerPillContribution extends PluginHeaderButtonContribution {
62
+ agentId: string;
63
+ }
64
+ //# sourceMappingURL=buttons.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=buttons.js.map
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ import type { PluginAgentSnapshot, PluginWorkspaceSnapshot } from "../contracts.js";
3
+ export interface PluginClientStateSource {
4
+ subscribe(listener: () => void): () => void;
5
+ getWorkspace(id: string): PluginWorkspaceSnapshot | null;
6
+ getAgent(id: string): PluginAgentSnapshot | null;
7
+ }
8
+ export declare function usePluginClientStateSource(): PluginClientStateSource | null;
9
+ export declare function useWorkspace<Selection>(workspaceId: string, selector: (workspace: PluginWorkspaceSnapshot) => Selection): Selection | null;
10
+ export declare function useAgent<Selection>(agentId: string, selector: (agent: PluginAgentSnapshot) => Selection): Selection | null;
11
+ export declare function PluginClientStateProvider({ children, source, }: {
12
+ children: ReactNode;
13
+ source: PluginClientStateSource;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=client-state.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
4
+ import { shallowEqual } from "./shallow.js";
5
+ const PluginClientStateContext = createContext(null);
6
+ export function usePluginClientStateSource() {
7
+ return useContext(PluginClientStateContext);
8
+ }
9
+ function usePluginEntity(input) {
10
+ const source = usePluginClientStateSource();
11
+ if (!source)
12
+ throw new Error("Plugin state hooks must run inside a workspace panel");
13
+ return useSyncExternalStoreWithSelector(source.subscribe, () => input.read(source, input.id), () => input.read(source, input.id), (entity) => (entity ? input.selector(entity) : null), shallowEqual);
14
+ }
15
+ export function useWorkspace(workspaceId, selector) {
16
+ return usePluginEntity({
17
+ id: workspaceId,
18
+ read: (source, id) => source.getWorkspace(id),
19
+ selector,
20
+ });
21
+ }
22
+ export function useAgent(agentId, selector) {
23
+ return usePluginEntity({
24
+ id: agentId,
25
+ read: (source, id) => source.getAgent(id),
26
+ selector,
27
+ });
28
+ }
29
+ export function PluginClientStateProvider({ children, source, }) {
30
+ return (_jsx(PluginClientStateContext.Provider, { value: source, children: children }));
31
+ }
32
+ //# sourceMappingURL=client-state.js.map
@@ -0,0 +1,262 @@
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";
5
+ import type { PluginRpcContract } from "../rpc.js";
6
+ import type { PluginButtonRegistration, PluginHeaderButtonContribution, PluginComposerPillContribution } from "./buttons.js";
7
+ import type { PluginTheme, PluginWorkspaceSnapshot, PluginAgentSnapshot, PluginThemeContribution, PluginAttachmentSourceContribution, PluginTimelineTransformResult, PluginCleanup } from "../contracts.js";
8
+ export interface PluginHostProps {
9
+ theme: PluginTheme;
10
+ host: {
11
+ id: string;
12
+ label: string;
13
+ };
14
+ layout: {
15
+ compact: boolean;
16
+ platform: "ios" | "android" | "web";
17
+ };
18
+ }
19
+ interface PluginNavigableHostProps extends PluginHostProps {
20
+ /** Client-owned navigation. Undefined on older hosts; hide dependent affordances when absent. */
21
+ readonly navigation?: {
22
+ /** Present only on Electron. The browser runs locally; serverId selects workspace ownership. */
23
+ readonly openBrowser?: (input: {
24
+ readonly url: string;
25
+ readonly workspaceId: string;
26
+ readonly serverId?: string;
27
+ }) => void;
28
+ readonly openAgent: (input: {
29
+ readonly agentId: string;
30
+ readonly serverId?: string;
31
+ }) => void;
32
+ readonly openWorkspace: (input: {
33
+ readonly workspaceId: string;
34
+ readonly serverId?: string;
35
+ }) => void;
36
+ };
37
+ }
38
+ /** String keys and values: params travel in the screen's URL. */
39
+ export type PluginScreenParams = Record<string, string>;
40
+ export interface PluginOpenScreenInput {
41
+ screenId: string;
42
+ params?: PluginScreenParams;
43
+ }
44
+ export interface PluginScreenLocation {
45
+ screenId: string;
46
+ params: PluginScreenParams;
47
+ }
48
+ export interface PluginSurfaceProps extends PluginNavigableHostProps {
49
+ }
50
+ export interface PluginScreenProps extends PluginSurfaceProps {
51
+ /** The params the screen was opened with; `{}` when none. */
52
+ params: PluginScreenParams;
53
+ }
54
+ export interface PluginPopoverProps extends PluginHostProps {
55
+ close(): void;
56
+ openScreen(input: PluginOpenScreenInput): void;
57
+ }
58
+ export interface PluginSidebarItemProps extends PluginHostProps {
59
+ /** This plugin's screen open on this item's host, with its params, else null. */
60
+ currentScreen: PluginScreenLocation | null;
61
+ openScreen(input: PluginOpenScreenInput): void;
62
+ /** Anchored to the item on wide layouts; a bottom sheet on compact layouts. */
63
+ openPopover(Content: ComponentType<PluginPopoverProps>): void;
64
+ }
65
+ export interface PluginSidebarItemContribution {
66
+ id: string;
67
+ /** Settings row label, accessibility label, and default label for SidebarRow. */
68
+ title: string;
69
+ Component: ComponentType<PluginSidebarItemProps>;
70
+ }
71
+ export interface PluginIconProps {
72
+ name: string;
73
+ size?: number;
74
+ color?: string;
75
+ }
76
+ export type PluginPanelLocation = "workspace" | "explorer";
77
+ export interface PluginOpenPanelOptions {
78
+ location?: PluginPanelLocation;
79
+ }
80
+ interface PluginWorkspacePanelBase {
81
+ id: string;
82
+ title: string;
83
+ icon: string;
84
+ locations?: readonly PluginPanelLocation[];
85
+ }
86
+ export interface PluginWorkspacePanelProps extends PluginNavigableHostProps {
87
+ context: "workspace";
88
+ workspaceId: string;
89
+ }
90
+ export interface PluginAgentPanelProps extends PluginNavigableHostProps {
91
+ context: "agent";
92
+ workspaceId: string;
93
+ agentId: string;
94
+ }
95
+ export interface PluginClientOpenPanelOptions extends PluginOpenPanelOptions {
96
+ workspaceId: string;
97
+ agentId?: string;
98
+ }
99
+ interface PluginClientContextAliases {
100
+ /** @deprecated Use `addScreen`. */
101
+ addSurface(id: string, Component: ComponentType<PluginSurfaceProps>): PluginCleanup;
102
+ /** @deprecated Use `addSidebarHeaderItem`. */
103
+ addSidebarItem(contribution: PluginSidebarContribution): PluginCleanup;
104
+ }
105
+ export interface PluginClientContext extends PluginCommandCapabilities, PluginClientContextAliases {
106
+ /** Play a base64-encoded audio file on this client; resolves when playback ends. */
107
+ playAudio(source: {
108
+ base64: string;
109
+ mimeType: string;
110
+ }): Promise<void>;
111
+ addSettingsScreen(contribution: PluginSettingsScreenContribution): PluginCleanup;
112
+ addScreen(contribution: PluginScreenContribution): PluginCleanup;
113
+ addSidebarHeaderItem(contribution: PluginSidebarItemContribution): PluginCleanup;
114
+ addSidebarFooterItem(contribution: PluginSidebarItemContribution): PluginCleanup;
115
+ addWorkspacePanel(contribution: PluginWorkspacePanelContribution): PluginCleanup;
116
+ addCommandCenterItem(contribution: PluginCommandCenterItemContribution): PluginCleanup;
117
+ addSlashCommand(contribution: PluginClientSlashCommandContribution): PluginCleanup;
118
+ addHeaderButton(contribution: PluginHeaderButtonContribution): PluginButtonRegistration;
119
+ addComposerPill(contribution: PluginComposerPillContribution): PluginButtonRegistration;
120
+ addAttachmentSource(contribution: PluginAttachmentSourceContribution): PluginCleanup;
121
+ addTheme(contribution: PluginThemeContribution): PluginCleanup;
122
+ addTimelineTransformer<ItemType extends AgentTimelineItem["type"]>(contribution: PluginTimelineTransformerContribution<ItemType>): PluginCleanup;
123
+ addTimelineRenderer<Schema extends ZodType>(contribution: PluginTimelineRendererContribution<Schema>): PluginCleanup;
124
+ openPanel(id: string, options: PluginClientOpenPanelOptions): void;
125
+ }
126
+ export type PluginClientContribution = (client: PluginClientContext) => PluginCleanup;
127
+ export type PluginWorkspacePanelContribution = (PluginWorkspacePanelBase & {
128
+ context: "workspace";
129
+ Component: ComponentType<PluginWorkspacePanelProps>;
130
+ }) | (PluginWorkspacePanelBase & {
131
+ context: "agent";
132
+ Component: ComponentType<PluginAgentPanelProps>;
133
+ });
134
+ export interface PluginSettingsScreenContribution {
135
+ id: string;
136
+ title: string;
137
+ icon: string;
138
+ Component: ComponentType<PluginSurfaceProps>;
139
+ }
140
+ /** The screen header's title: fixed, or derived from the params the screen was opened with. */
141
+ export type PluginScreenTitle = string | ((params: PluginScreenParams) => string);
142
+ export interface PluginScreenContribution {
143
+ id: string;
144
+ title: PluginScreenTitle;
145
+ Component: ComponentType<PluginScreenProps>;
146
+ }
147
+ export interface PluginSurfaceContribution {
148
+ id: string;
149
+ Component: ComponentType<PluginSurfaceProps>;
150
+ }
151
+ /** @deprecated Use `PluginSidebarItemContribution` with `addSidebarHeaderItem`. */
152
+ export interface PluginSidebarContribution {
153
+ id: string;
154
+ title: string;
155
+ icon: string;
156
+ surface: string;
157
+ }
158
+ export type PluginTimelineTransformerContribution<ItemType extends AgentTimelineItem["type"] = AgentTimelineItem["type"]> = ItemType extends AgentTimelineItem["type"] ? {
159
+ id: string;
160
+ query: {
161
+ itemType: ItemType;
162
+ };
163
+ transform(input: {
164
+ item: Extract<AgentTimelineItem, {
165
+ type: ItemType;
166
+ }>;
167
+ phase: "streaming" | "complete";
168
+ }): PluginTimelineTransformResult | undefined;
169
+ } : never;
170
+ export interface PluginTimelineItemProps<Data = unknown> extends PluginHostProps {
171
+ agentId: string;
172
+ item: {
173
+ type: "plugin";
174
+ kind: string;
175
+ version: number;
176
+ data: Data;
177
+ };
178
+ timestamp: Date;
179
+ }
180
+ export interface PluginTimelineRendererContribution<Schema extends ZodType = ZodType> {
181
+ kind: string;
182
+ version: number;
183
+ schema: Schema;
184
+ Component: ComponentType<PluginTimelineItemProps<ZodOutput<Schema>>>;
185
+ }
186
+ export interface PluginCommandCapabilities {
187
+ paseo: PaseoApi;
188
+ rpc<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>, input: ZodInput<InputSchema>): Promise<ZodOutput<OutputSchema>>;
189
+ openScreen(input: PluginOpenScreenInput): void;
190
+ /** @deprecated Use `openScreen`. */
191
+ openSurface(id: string): void;
192
+ openSettings(id: string): void;
193
+ }
194
+ export interface PluginGlobalCommandContext extends PluginCommandCapabilities {
195
+ context: "global";
196
+ }
197
+ export interface PluginWorkspaceCommandContext extends PluginCommandCapabilities {
198
+ context: "workspace";
199
+ workspace: PluginWorkspaceSnapshot;
200
+ openPanel(id: string, options?: PluginOpenPanelOptions): void;
201
+ }
202
+ export interface PluginAgentCommandContext extends PluginCommandCapabilities {
203
+ context: "agent";
204
+ workspace: PluginWorkspaceSnapshot;
205
+ agent: PluginAgentSnapshot;
206
+ openPanel(id: string, options?: PluginOpenPanelOptions): void;
207
+ }
208
+ interface PluginCommandCenterItemBase {
209
+ id: string;
210
+ title: string;
211
+ icon: string;
212
+ keywords?: readonly string[];
213
+ }
214
+ export type PluginCommandCenterItemContribution = (PluginCommandCenterItemBase & {
215
+ context: "global";
216
+ onSelect(context: PluginGlobalCommandContext): void | Promise<void>;
217
+ }) | (PluginCommandCenterItemBase & {
218
+ context: "workspace";
219
+ onSelect(context: PluginWorkspaceCommandContext): void | Promise<void>;
220
+ }) | (PluginCommandCenterItemBase & {
221
+ context: "agent";
222
+ onSelect(context: PluginAgentCommandContext): void | Promise<void>;
223
+ });
224
+ interface PluginClientSlashCommandBase {
225
+ name: string;
226
+ description: string;
227
+ argumentHint: string;
228
+ }
229
+ export type PluginClientSlashCommandContribution = (PluginClientSlashCommandBase & {
230
+ context: "workspace";
231
+ onSubmit(context: PluginWorkspaceCommandContext & {
232
+ args: string;
233
+ }): void | Promise<void>;
234
+ }) | (PluginClientSlashCommandBase & {
235
+ context: "agent";
236
+ onSubmit(context: PluginAgentCommandContext & {
237
+ args: string;
238
+ }): void | Promise<void>;
239
+ });
240
+ export type SettingsState<Schema extends ZodType> = ({
241
+ status: "loading";
242
+ } | {
243
+ status: "error";
244
+ error: string;
245
+ } | {
246
+ status: "invalid";
247
+ error: string;
248
+ revision: string;
249
+ } | {
250
+ status: "ready";
251
+ values: ZodOutput<Schema>;
252
+ revision: string;
253
+ }) & {
254
+ saving: boolean;
255
+ saveError: string | null;
256
+ /** Save an entire document against the revision currently displayed. Never throws. */
257
+ save(values: ZodOutput<Schema>, revision: string): Promise<boolean>;
258
+ reset(): Promise<boolean>;
259
+ reload(): Promise<void>;
260
+ };
261
+ export {};
262
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1,19 @@
1
+ export { PluginClientStateProvider, type PluginClientStateSource } from "./client-state.js";
2
+ export { usePluginRuntimeContextBridge, type PluginRuntimeContextBridge, } from "./runtime-context-bridge.js";
3
+ import type { PluginAttachmentSourceContribution } from "../contracts.js";
4
+ import { PluginRpcProvider } from "./rpc-context.js";
5
+ import { PaseoApiProvider } from "./paseo-context.js";
6
+ import { callPluginRpc } from "../rpc.js";
7
+ export declare function searchPluginAttachments(source: PluginAttachmentSourceContribution, invoke: (method: string, input: unknown) => Promise<unknown>, query: string): Promise<{
8
+ items: {
9
+ id: string;
10
+ identifier: string;
11
+ title: string;
12
+ url: string;
13
+ text: string;
14
+ resourceType: string;
15
+ subtitle?: string | undefined;
16
+ }[];
17
+ }>;
18
+ export { callPluginRpc, PaseoApiProvider, PluginRpcProvider };
19
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { PluginAttachmentSearchPayloadSchema } from "../attachments.js";
2
+ export { PluginClientStateProvider } from "./client-state.js";
3
+ export { usePluginRuntimeContextBridge, } from "./runtime-context-bridge.js";
4
+ import { PluginRpcProvider } from "./rpc-context.js";
5
+ import { PaseoApiProvider } from "./paseo-context.js";
6
+ import { callPluginRpc } from "../rpc.js";
7
+ export async function searchPluginAttachments(source, invoke, query) {
8
+ const output = await callPluginRpc(source.search, invoke, { query });
9
+ return PluginAttachmentSearchPayloadSchema.parseAsync(output);
10
+ }
11
+ export { callPluginRpc, PaseoApiProvider, PluginRpcProvider };
12
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1,22 @@
1
+ export type { PluginHostProps, PluginSurfaceProps, PluginScreenProps, PluginPopoverProps, PluginScreenParams, PluginOpenScreenInput, PluginScreenLocation, PluginSidebarItemProps, PluginSidebarItemContribution, PluginIconProps, PluginPanelLocation, PluginOpenPanelOptions, PluginWorkspacePanelProps, PluginAgentPanelProps, PluginClientOpenPanelOptions, PluginClientContext, PluginClientContribution, PluginWorkspacePanelContribution, PluginSettingsScreenContribution, PluginSurfaceContribution, PluginScreenContribution, PluginScreenTitle, PluginSidebarContribution, PluginTimelineTransformerContribution, PluginTimelineItemProps, PluginTimelineRendererContribution, PluginCommandCapabilities, PluginGlobalCommandContext, PluginWorkspaceCommandContext, PluginAgentCommandContext, PluginCommandCenterItemContribution, PluginClientSlashCommandContribution, SettingsState, } from "./contracts.js";
2
+ export type { PluginButton, PluginButtonBehavior, PluginButtonContentProps, PluginButtonContext, PluginButtonIcon, PluginButtonIconProps, PluginButtonMenuEntry, PluginButtonRegistration, PluginComposerPillContribution, PluginHeaderButtonContribution, } from "./buttons.js";
3
+ export { usePaseo } from "./paseo-context.js";
4
+ export { useAgent, useWorkspace } from "./client-state.js";
5
+ export { useRpc } from "./rpc-context.js";
6
+ import type { SettingsDefinition } from "../settings.js";
7
+ import type { SettingsState } from "./contracts.js";
8
+ import type { ZodType } from "zod";
9
+ export declare function useSettings<Schema extends ZodType>(definition: SettingsDefinition<Schema>): SettingsState<Schema>;
10
+ /** Configured app host, including hosts that are currently disconnected. */
11
+ export interface PluginHostSummary {
12
+ readonly serverId: string;
13
+ readonly label: string;
14
+ readonly status: "idle" | "connecting" | "online" | "offline" | "error";
15
+ }
16
+ /** Live configured hosts. Supplied by the app's client bundle loader. */
17
+ export declare function useHosts(): readonly PluginHostSummary[];
18
+ /** Borrow an online host's API under this installation's lifetime. */
19
+ export declare function getPaseoClient(serverId: string): import("@getpaseo/client").PaseoApi;
20
+ /** Open an absolute HTTP(S) URL using the client platform’s external opener. */
21
+ export declare function openExternalUrl(url: string): Promise<void>;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { usePaseo } from "./paseo-context.js";
2
+ export { useAgent, useWorkspace } from "./client-state.js";
3
+ export { useRpc } from "./rpc-context.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import type { PaseoApi } from "@getpaseo/client";
2
+ import { type ReactNode } from "react";
3
+ export declare function usePaseoContextValue(): PaseoApi | null;
4
+ export declare function PaseoApiProvider({ children, paseo }: {
5
+ children: ReactNode;
6
+ paseo: PaseoApi;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function usePaseo(): PaseoApi;
9
+ //# sourceMappingURL=paseo-context.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ const PaseoApiContext = createContext(null);
4
+ export function usePaseoContextValue() {
5
+ return useContext(PaseoApiContext);
6
+ }
7
+ export function PaseoApiProvider({ children, paseo }) {
8
+ return _jsx(PaseoApiContext.Provider, { value: paseo, children: children });
9
+ }
10
+ export function usePaseo() {
11
+ const paseo = usePaseoContextValue();
12
+ if (!paseo)
13
+ throw new Error("usePaseo must run inside a contributed plugin surface");
14
+ return paseo;
15
+ }
16
+ //# sourceMappingURL=paseo-context.js.map
@@ -0,0 +1,46 @@
1
+ import type { ComponentType, FunctionComponent, ReactNode, ForwardRefExoticComponent, RefAttributes, ReactElement, Ref } from "react";
2
+ import type { StyleProp, ViewStyle, ScrollView as NativeScrollView, ScrollViewProps, FlatList as NativeFlatList, FlatListProps, TextInput as NativeTextInput, TextInputProps } from "react-native";
3
+ import type { PluginIconProps } from "./contracts.js";
4
+ export interface ModalProps {
5
+ title: string;
6
+ icon?: ReactNode;
7
+ open: boolean;
8
+ onOpenChange(open: boolean): void;
9
+ children: ReactNode;
10
+ }
11
+ export interface ModalContentProps {
12
+ children: ReactNode;
13
+ /** Paint the full body below the header. */
14
+ style?: StyleProp<ViewStyle>;
15
+ /** Overrides the default 24px padding and 16px gap. Safe-area clearance stays host-owned. */
16
+ contentContainerStyle?: StyleProp<ViewStyle>;
17
+ /** Default true. Set false for a bounded body with your own ScrollView or FlatList. */
18
+ scrollable?: boolean;
19
+ }
20
+ export interface ModalComponent extends FunctionComponent<ModalProps> {
21
+ Content: ComponentType<ModalContentProps>;
22
+ }
23
+ export type ToastVariant = "default" | "info" | "success" | "warning" | "error";
24
+ export interface ToastOptions {
25
+ variant?: ToastVariant;
26
+ durationMs?: number;
27
+ }
28
+ export interface ToastApi {
29
+ show(message: string, options?: ToastOptions): void;
30
+ error(message: string): void;
31
+ }
32
+ export declare const Icon: ComponentType<PluginIconProps>;
33
+ export declare const Modal: ModalComponent;
34
+ export declare function useToast(): ToastApi;
35
+ export declare function useRevealedText(text: string, phase: "streaming" | "complete"): string;
36
+ export type { PluginIconProps } from "./contracts.js";
37
+ /** React Native scrolling with the host's sheet gestures when rendered inside a sheet. */
38
+ export declare const ScrollView: ForwardRefExoticComponent<ScrollViewProps & RefAttributes<NativeScrollView>>;
39
+ export declare function FlatList<Item>(props: FlatListProps<Item> & {
40
+ ref?: Ref<NativeFlatList<Item>>;
41
+ }): ReactElement;
42
+ /** Copies text to this client's clipboard. Rejects when copying is unavailable or denied. */
43
+ export declare function copyText(text: string): Promise<void>;
44
+ /** Native input focus integrated with modal keyboard positioning. */
45
+ export declare const TextInput: ForwardRefExoticComponent<TextInputProps & RefAttributes<NativeTextInput>>;
46
+ //# sourceMappingURL=react-native.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=react-native.js.map
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
3
+ import { type PluginRpcContract } from "../rpc.js";
4
+ export interface PluginRpcContextValue {
5
+ invoke(method: string, input: unknown): Promise<unknown>;
6
+ }
7
+ export declare function usePluginRpcContextValue(): PluginRpcContextValue | null;
8
+ export declare function PluginRpcProvider({ children, invoke, }: {
9
+ children: ReactNode;
10
+ invoke(method: string, input: unknown): Promise<unknown>;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function useRpc<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>): (input: ZodInput<InputSchema>) => Promise<ZodOutput<OutputSchema>>;
13
+ //# sourceMappingURL=rpc-context.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useMemo } from "react";
3
+ import { callPluginRpc } from "../rpc.js";
4
+ const PluginRpcContext = createContext(null);
5
+ export function usePluginRpcContextValue() {
6
+ return useContext(PluginRpcContext);
7
+ }
8
+ export function PluginRpcProvider({ children, invoke, }) {
9
+ const value = useMemo(() => ({ invoke }), [invoke]);
10
+ return _jsx(PluginRpcContext.Provider, { value: value, children: children });
11
+ }
12
+ export function useRpc(contract) {
13
+ const context = usePluginRpcContextValue();
14
+ if (!context)
15
+ throw new Error("useRpc must run inside a contributed plugin surface");
16
+ return useCallback((input) => callPluginRpc(contract, context.invoke, input), [context, contract]);
17
+ }
18
+ //# sourceMappingURL=rpc-context.js.map
@@ -0,0 +1,5 @@
1
+ import { type ReactNode } from "react";
2
+ export type PluginRuntimeContextBridge = (children: ReactNode) => ReactNode;
3
+ /** Rebuilds plugin runtime contexts inside React Native portal hosts. */
4
+ export declare function usePluginRuntimeContextBridge(): PluginRuntimeContextBridge;
5
+ //# sourceMappingURL=runtime-context-bridge.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { PluginClientStateProvider, usePluginClientStateSource } from "./client-state.js";
4
+ import { PaseoApiProvider, usePaseoContextValue } from "./paseo-context.js";
5
+ import { PluginRpcProvider, usePluginRpcContextValue } from "./rpc-context.js";
6
+ /** Rebuilds plugin runtime contexts inside React Native portal hosts. */
7
+ export function usePluginRuntimeContextBridge() {
8
+ const paseo = usePaseoContextValue();
9
+ const rpc = usePluginRpcContextValue();
10
+ const state = usePluginClientStateSource();
11
+ if (!paseo || !rpc) {
12
+ throw new Error("Plugin UI must run inside a contributed plugin surface");
13
+ }
14
+ return useCallback((children) => {
15
+ const content = state ? (_jsx(PluginClientStateProvider, { source: state, children: children })) : (children);
16
+ return (_jsx(PaseoApiProvider, { paseo: paseo, children: _jsx(PluginRpcProvider, { invoke: rpc.invoke, children: content }) }));
17
+ }, [paseo, rpc, state]);
18
+ }
19
+ //# sourceMappingURL=runtime-context-bridge.js.map
@@ -0,0 +1,2 @@
1
+ export declare function shallowEqual(left: unknown, right: unknown): boolean;
2
+ //# sourceMappingURL=shallow.d.ts.map