@getpaseo/plugin 0.12.0-beta.3 → 0.13.0-beta.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.
- package/dist/attachments.d.ts +2 -1
- package/dist/client/buttons.d.ts +19 -20
- package/dist/client/contracts.d.ts +67 -44
- package/dist/client/file.d.ts +107 -0
- package/dist/client/file.js +87 -0
- package/dist/client/host.d.ts +4 -1
- package/dist/client/host.js +1 -0
- package/dist/client/index.d.ts +7 -1
- package/dist/client/index.js +2 -0
- package/dist/client/react-native.d.ts +2 -45
- package/dist/client/react-native.js +3 -1
- package/dist/client/runtime-context-bridge.js +4 -2
- package/dist/client/translations.d.ts +42 -0
- package/dist/client/translations.js +153 -0
- package/dist/client/ui.d.ts +74 -6
- package/dist/contracts.d.ts +9 -7
- package/dist/icons.d.ts +18 -0
- package/dist/icons.js +30 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/server/lifecycle.d.ts +4 -0
- package/dist/text.d.ts +34 -0
- package/dist/text.js +2 -0
- package/package.json +12 -10
package/dist/attachments.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { PluginText } from "./text.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import type { PluginAttachmentSourceContribution } from "./contracts.js";
|
|
3
|
-
export declare function defineAttachmentSource<Definition extends PluginAttachmentSourceContribution
|
|
4
|
+
export declare function defineAttachmentSource<Definition extends PluginAttachmentSourceContribution<PluginText>>(definition: Definition): Definition;
|
|
4
5
|
export declare const PluginAttachmentItemSchema: z.ZodObject<{
|
|
5
6
|
id: z.ZodString;
|
|
6
7
|
identifier: z.ZodString;
|
package/dist/client/buttons.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { PluginText } from "../text.js";
|
|
1
2
|
import type { ComponentType } from "react";
|
|
2
|
-
import type {
|
|
3
|
+
import type { PluginIconProps } from "../icons.js";
|
|
4
|
+
import type { PluginHostProps, PluginIcon } from "./contracts.js";
|
|
3
5
|
export type PluginButtonContext = {
|
|
4
6
|
context: "workspace";
|
|
5
7
|
workspaceId: string;
|
|
@@ -8,57 +10,54 @@ export type PluginButtonContext = {
|
|
|
8
10
|
workspaceId: string;
|
|
9
11
|
agentId: string;
|
|
10
12
|
};
|
|
11
|
-
export type PluginButtonIconProps = PluginHostProps & PluginButtonContext &
|
|
12
|
-
size: number;
|
|
13
|
-
color: string;
|
|
14
|
-
};
|
|
13
|
+
export type PluginButtonIconProps = PluginHostProps & PluginButtonContext & PluginIconProps;
|
|
15
14
|
export type PluginButtonContentProps = PluginHostProps & PluginButtonContext & {
|
|
16
15
|
close(): void;
|
|
17
16
|
};
|
|
18
|
-
export type PluginButtonIcon =
|
|
19
|
-
export type PluginButtonBehavior = {
|
|
17
|
+
export type PluginButtonIcon = PluginIcon<PluginButtonIconProps>;
|
|
18
|
+
export type PluginButtonBehavior<Text extends PluginText = string> = {
|
|
20
19
|
kind: "action";
|
|
21
20
|
onPress(): void | Promise<void>;
|
|
22
21
|
} | {
|
|
23
22
|
kind: "menu";
|
|
24
|
-
items: readonly PluginButtonMenuEntry[];
|
|
23
|
+
items: readonly PluginButtonMenuEntry<Text>[];
|
|
25
24
|
} | {
|
|
26
25
|
kind: "popover";
|
|
27
26
|
Content: ComponentType<PluginButtonContentProps>;
|
|
28
27
|
};
|
|
29
|
-
export type PluginButtonMenuEntry = {
|
|
28
|
+
export type PluginButtonMenuEntry<Text extends PluginText = string> = {
|
|
30
29
|
kind: "separator";
|
|
31
30
|
id: string;
|
|
32
31
|
} | {
|
|
33
32
|
kind: "item";
|
|
34
33
|
id: string;
|
|
35
|
-
title:
|
|
34
|
+
title: Text;
|
|
36
35
|
icon?: PluginButtonIcon;
|
|
37
36
|
visible?: boolean;
|
|
38
37
|
disabled?: boolean;
|
|
39
|
-
behavior: PluginButtonBehavior
|
|
38
|
+
behavior: PluginButtonBehavior<Text>;
|
|
40
39
|
};
|
|
41
|
-
export interface PluginButton {
|
|
42
|
-
title:
|
|
40
|
+
export interface PluginButton<Text extends PluginText = string> {
|
|
41
|
+
title: Text;
|
|
43
42
|
icon: PluginButtonIcon;
|
|
44
43
|
/** Omit for an icon-only header button. Composer pills use title when omitted. */
|
|
45
|
-
label?:
|
|
44
|
+
label?: Text;
|
|
46
45
|
visible?: boolean;
|
|
47
46
|
disabled?: boolean;
|
|
48
|
-
behavior: PluginButtonBehavior
|
|
47
|
+
behavior: PluginButtonBehavior<Text>;
|
|
49
48
|
}
|
|
50
|
-
export interface PluginButtonRegistration {
|
|
49
|
+
export interface PluginButtonRegistration<Text extends PluginText = string> {
|
|
51
50
|
/** Updates presentation in place. Supply a complete behavior to replace it. */
|
|
52
|
-
update(patch: Partial<PluginButton
|
|
51
|
+
update(patch: Partial<PluginButton<Text>>): void;
|
|
53
52
|
/** Idempotent. Updates after removal do nothing. */
|
|
54
53
|
remove(): void;
|
|
55
54
|
}
|
|
56
|
-
export interface PluginHeaderButtonContribution {
|
|
55
|
+
export interface PluginHeaderButtonContribution<Text extends PluginText = string> {
|
|
57
56
|
id: string;
|
|
58
57
|
workspaceId: string;
|
|
59
|
-
button: PluginButton
|
|
58
|
+
button: PluginButton<Text>;
|
|
60
59
|
}
|
|
61
|
-
export interface PluginComposerPillContribution extends PluginHeaderButtonContribution {
|
|
60
|
+
export interface PluginComposerPillContribution<Text extends PluginText = string> extends PluginHeaderButtonContribution<Text> {
|
|
62
61
|
agentId: string;
|
|
63
62
|
}
|
|
64
63
|
//# sourceMappingURL=buttons.d.ts.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { PluginText } from "../text.js";
|
|
1
2
|
import type { ComponentType } from "react";
|
|
2
3
|
import type { PaseoApi } from "@getpaseo/client";
|
|
3
4
|
import type { AgentTimelineItem } from "@getpaseo/protocol/agent-types";
|
|
4
5
|
import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
|
|
6
|
+
import type { PluginFile, PluginFileLocation, PluginFileTab } from "./file.js";
|
|
5
7
|
import type { PluginRpcContract } from "../rpc.js";
|
|
6
8
|
import type { PluginButtonRegistration, PluginHeaderButtonContribution, PluginComposerPillContribution } from "./buttons.js";
|
|
7
9
|
import type { PluginTheme, PluginWorkspaceSnapshot, PluginAgentSnapshot, PluginThemeContribution, PluginAttachmentSourceContribution, PluginTimelineTransformResult, PluginCleanup } from "../contracts.js";
|
|
10
|
+
import type { PluginIconProps, PluginSerializableIcon } from "../icons.js";
|
|
8
11
|
export interface PluginHostProps {
|
|
9
12
|
theme: PluginTheme;
|
|
10
13
|
host: {
|
|
@@ -62,25 +65,25 @@ export interface PluginSidebarItemProps extends PluginHostProps {
|
|
|
62
65
|
/** Anchored to the item on wide layouts; a bottom sheet on compact layouts. */
|
|
63
66
|
openPopover(Content: ComponentType<PluginPopoverProps>): void;
|
|
64
67
|
}
|
|
65
|
-
export interface PluginSidebarItemContribution {
|
|
68
|
+
export interface PluginSidebarItemContribution<Text extends PluginText = string> {
|
|
66
69
|
id: string;
|
|
67
70
|
/** Settings row label, accessibility label, and default label for SidebarRow. */
|
|
68
|
-
title:
|
|
71
|
+
title: Text;
|
|
69
72
|
Component: ComponentType<PluginSidebarItemProps>;
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
/**
|
|
75
|
+
* A Lucide icon name, inline SVG markup, or a component. Components receive the surface's size
|
|
76
|
+
* and color; buttons widen the props with their host and target context.
|
|
77
|
+
*/
|
|
78
|
+
export type PluginIcon<Props extends PluginIconProps = PluginIconProps> = PluginSerializableIcon | ComponentType<Props>;
|
|
76
79
|
export type PluginPanelLocation = "workspace" | "explorer";
|
|
77
80
|
export interface PluginOpenPanelOptions {
|
|
78
81
|
location?: PluginPanelLocation;
|
|
79
82
|
}
|
|
80
|
-
interface PluginWorkspacePanelBase {
|
|
83
|
+
interface PluginWorkspacePanelBase<Text extends PluginText = string> {
|
|
81
84
|
id: string;
|
|
82
|
-
title:
|
|
83
|
-
icon:
|
|
85
|
+
title: Text;
|
|
86
|
+
icon: PluginIcon;
|
|
84
87
|
locations?: readonly PluginPanelLocation[];
|
|
85
88
|
}
|
|
86
89
|
export interface PluginWorkspacePanelProps extends PluginNavigableHostProps {
|
|
@@ -92,6 +95,24 @@ export interface PluginAgentPanelProps extends PluginNavigableHostProps {
|
|
|
92
95
|
workspaceId: string;
|
|
93
96
|
agentId: string;
|
|
94
97
|
}
|
|
98
|
+
export interface PluginFilePanelProps extends PluginNavigableHostProps {
|
|
99
|
+
workspaceId: string;
|
|
100
|
+
/** The file itself. The panel decides how to read it, show it, and save it. */
|
|
101
|
+
file: PluginFile;
|
|
102
|
+
tab: PluginFileTab;
|
|
103
|
+
location: PluginFileLocation;
|
|
104
|
+
}
|
|
105
|
+
export interface PluginFilePanelContribution<Text extends PluginText = string> {
|
|
106
|
+
id: string;
|
|
107
|
+
title: Text;
|
|
108
|
+
icon: PluginIcon;
|
|
109
|
+
/** Extensions without the dot, case-insensitive, and exact filenames. */
|
|
110
|
+
files: {
|
|
111
|
+
extensions: readonly string[];
|
|
112
|
+
filenames?: readonly string[];
|
|
113
|
+
};
|
|
114
|
+
Component: ComponentType<PluginFilePanelProps>;
|
|
115
|
+
}
|
|
95
116
|
export interface PluginClientOpenPanelOptions extends PluginOpenPanelOptions {
|
|
96
117
|
workspaceId: string;
|
|
97
118
|
agentId?: string;
|
|
@@ -100,48 +121,50 @@ interface PluginClientContextAliases {
|
|
|
100
121
|
/** @deprecated Use `addScreen`. */
|
|
101
122
|
addSurface(id: string, Component: ComponentType<PluginSurfaceProps>): PluginCleanup;
|
|
102
123
|
/** @deprecated Use `addSidebarHeaderItem`. */
|
|
103
|
-
addSidebarItem(contribution: PluginSidebarContribution): PluginCleanup;
|
|
124
|
+
addSidebarItem(contribution: PluginSidebarContribution<PluginText>): PluginCleanup;
|
|
104
125
|
}
|
|
105
126
|
export interface PluginClientContext extends PluginCommandCapabilities, PluginClientContextAliases {
|
|
127
|
+
readonly i18n: import("./translations.js").PluginI18n;
|
|
106
128
|
/** Play a base64-encoded audio file on this client; resolves when playback ends. */
|
|
107
129
|
playAudio(source: {
|
|
108
130
|
base64: string;
|
|
109
131
|
mimeType: string;
|
|
110
132
|
}): 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;
|
|
133
|
+
addSettingsScreen(contribution: PluginSettingsScreenContribution<PluginText>): PluginCleanup;
|
|
134
|
+
addScreen(contribution: PluginScreenContribution<PluginText>): PluginCleanup;
|
|
135
|
+
addSidebarHeaderItem(contribution: PluginSidebarItemContribution<PluginText>): PluginCleanup;
|
|
136
|
+
addSidebarFooterItem(contribution: PluginSidebarItemContribution<PluginText>): PluginCleanup;
|
|
137
|
+
addWorkspacePanel(contribution: PluginWorkspacePanelContribution<PluginText>): PluginCleanup;
|
|
138
|
+
addCommandCenterItem(contribution: PluginCommandCenterItemContribution<PluginText>): PluginCleanup;
|
|
139
|
+
addSlashCommand(contribution: PluginClientSlashCommandContribution<PluginText>): PluginCleanup;
|
|
140
|
+
addHeaderButton(contribution: PluginHeaderButtonContribution<PluginText>): PluginButtonRegistration<PluginText>;
|
|
141
|
+
addComposerPill(contribution: PluginComposerPillContribution<PluginText>): PluginButtonRegistration<PluginText>;
|
|
142
|
+
addAttachmentSource(contribution: PluginAttachmentSourceContribution<PluginText>): PluginCleanup;
|
|
143
|
+
addTheme(contribution: PluginThemeContribution<PluginText>): PluginCleanup;
|
|
144
|
+
addFilePanel(contribution: PluginFilePanelContribution<PluginText>): PluginCleanup;
|
|
122
145
|
addTimelineTransformer<ItemType extends AgentTimelineItem["type"]>(contribution: PluginTimelineTransformerContribution<ItemType>): PluginCleanup;
|
|
123
146
|
addTimelineRenderer<Schema extends ZodType>(contribution: PluginTimelineRendererContribution<Schema>): PluginCleanup;
|
|
124
147
|
openPanel(id: string, options: PluginClientOpenPanelOptions): void;
|
|
125
148
|
}
|
|
126
149
|
export type PluginClientContribution = (client: PluginClientContext) => PluginCleanup;
|
|
127
|
-
export type PluginWorkspacePanelContribution = (PluginWorkspacePanelBase & {
|
|
150
|
+
export type PluginWorkspacePanelContribution<Text extends PluginText = string> = (PluginWorkspacePanelBase<Text> & {
|
|
128
151
|
context: "workspace";
|
|
129
152
|
Component: ComponentType<PluginWorkspacePanelProps>;
|
|
130
|
-
}) | (PluginWorkspacePanelBase & {
|
|
153
|
+
}) | (PluginWorkspacePanelBase<Text> & {
|
|
131
154
|
context: "agent";
|
|
132
155
|
Component: ComponentType<PluginAgentPanelProps>;
|
|
133
156
|
});
|
|
134
|
-
export interface PluginSettingsScreenContribution {
|
|
157
|
+
export interface PluginSettingsScreenContribution<Text extends PluginText = string> {
|
|
135
158
|
id: string;
|
|
136
|
-
title:
|
|
137
|
-
icon:
|
|
159
|
+
title: Text;
|
|
160
|
+
icon: PluginIcon;
|
|
138
161
|
Component: ComponentType<PluginSurfaceProps>;
|
|
139
162
|
}
|
|
140
163
|
/** The screen header's title: fixed, or derived from the params the screen was opened with. */
|
|
141
|
-
export type PluginScreenTitle = string | ((params: PluginScreenParams) =>
|
|
142
|
-
export interface PluginScreenContribution {
|
|
164
|
+
export type PluginScreenTitle<Text extends PluginText = string> = Text | ((params: PluginScreenParams) => Text);
|
|
165
|
+
export interface PluginScreenContribution<Text extends PluginText = string> {
|
|
143
166
|
id: string;
|
|
144
|
-
title: PluginScreenTitle
|
|
167
|
+
title: PluginScreenTitle<Text>;
|
|
145
168
|
Component: ComponentType<PluginScreenProps>;
|
|
146
169
|
}
|
|
147
170
|
export interface PluginSurfaceContribution {
|
|
@@ -149,10 +172,10 @@ export interface PluginSurfaceContribution {
|
|
|
149
172
|
Component: ComponentType<PluginSurfaceProps>;
|
|
150
173
|
}
|
|
151
174
|
/** @deprecated Use `PluginSidebarItemContribution` with `addSidebarHeaderItem`. */
|
|
152
|
-
export interface PluginSidebarContribution {
|
|
175
|
+
export interface PluginSidebarContribution<Text extends PluginText = string> {
|
|
153
176
|
id: string;
|
|
154
|
-
title:
|
|
155
|
-
icon:
|
|
177
|
+
title: Text;
|
|
178
|
+
icon: PluginIcon;
|
|
156
179
|
surface: string;
|
|
157
180
|
}
|
|
158
181
|
export type PluginTimelineTransformerContribution<ItemType extends AgentTimelineItem["type"] = AgentTimelineItem["type"]> = ItemType extends AgentTimelineItem["type"] ? {
|
|
@@ -205,33 +228,33 @@ export interface PluginAgentCommandContext extends PluginCommandCapabilities {
|
|
|
205
228
|
agent: PluginAgentSnapshot;
|
|
206
229
|
openPanel(id: string, options?: PluginOpenPanelOptions): void;
|
|
207
230
|
}
|
|
208
|
-
interface PluginCommandCenterItemBase {
|
|
231
|
+
interface PluginCommandCenterItemBase<Text extends PluginText = string> {
|
|
209
232
|
id: string;
|
|
210
|
-
title:
|
|
211
|
-
icon:
|
|
233
|
+
title: Text;
|
|
234
|
+
icon: PluginIcon;
|
|
212
235
|
keywords?: readonly string[];
|
|
213
236
|
}
|
|
214
|
-
export type PluginCommandCenterItemContribution = (PluginCommandCenterItemBase & {
|
|
237
|
+
export type PluginCommandCenterItemContribution<Text extends PluginText = string> = (PluginCommandCenterItemBase<Text> & {
|
|
215
238
|
context: "global";
|
|
216
239
|
onSelect(context: PluginGlobalCommandContext): void | Promise<void>;
|
|
217
|
-
}) | (PluginCommandCenterItemBase & {
|
|
240
|
+
}) | (PluginCommandCenterItemBase<Text> & {
|
|
218
241
|
context: "workspace";
|
|
219
242
|
onSelect(context: PluginWorkspaceCommandContext): void | Promise<void>;
|
|
220
|
-
}) | (PluginCommandCenterItemBase & {
|
|
243
|
+
}) | (PluginCommandCenterItemBase<Text> & {
|
|
221
244
|
context: "agent";
|
|
222
245
|
onSelect(context: PluginAgentCommandContext): void | Promise<void>;
|
|
223
246
|
});
|
|
224
|
-
interface PluginClientSlashCommandBase {
|
|
247
|
+
interface PluginClientSlashCommandBase<Text extends PluginText = string> {
|
|
225
248
|
name: string;
|
|
226
|
-
description:
|
|
227
|
-
argumentHint:
|
|
249
|
+
description: Text;
|
|
250
|
+
argumentHint: Text;
|
|
228
251
|
}
|
|
229
|
-
export type PluginClientSlashCommandContribution = (PluginClientSlashCommandBase & {
|
|
252
|
+
export type PluginClientSlashCommandContribution<Text extends PluginText = string> = (PluginClientSlashCommandBase<Text> & {
|
|
230
253
|
context: "workspace";
|
|
231
254
|
onSubmit(context: PluginWorkspaceCommandContext & {
|
|
232
255
|
args: string;
|
|
233
256
|
}): void | Promise<void>;
|
|
234
|
-
}) | (PluginClientSlashCommandBase & {
|
|
257
|
+
}) | (PluginClientSlashCommandBase<Text> & {
|
|
235
258
|
context: "agent";
|
|
236
259
|
onSubmit(context: PluginAgentCommandContext & {
|
|
237
260
|
args: string;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file a file panel shows. Stable for the life of the tab's target. The stat fields hold the
|
|
3
|
+
* latest version Paseo knows; read them while rendering. Changing them does not re-render the
|
|
4
|
+
* panel: `watch`, or a re-render from the read hooks, is how a panel learns they changed.
|
|
5
|
+
*/
|
|
6
|
+
export interface PluginFile {
|
|
7
|
+
/** Absolute path on the host. */
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** Lowercase, without the dot; empty when the name has none. */
|
|
11
|
+
readonly extension: string;
|
|
12
|
+
readonly size: number;
|
|
13
|
+
readonly modifiedAt: string;
|
|
14
|
+
readonly mimeType: string;
|
|
15
|
+
/** Reads the file as UTF-8. A byte order mark is dropped here and written back by `writeText`. */
|
|
16
|
+
readText(): Promise<string>;
|
|
17
|
+
readBytes(): Promise<Uint8Array>;
|
|
18
|
+
/**
|
|
19
|
+
* A local URL of the file's current bytes, for `DocumentFrame` and images. Paseo owns it: it stays
|
|
20
|
+
* valid until a URL of a newer version resolves or the tab closes.
|
|
21
|
+
*/
|
|
22
|
+
url(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Writes the file if it has not changed since this handle last read or wrote it. Otherwise
|
|
25
|
+
* rejects with `PluginFileConflictError`; `force: true` writes anyway. Rejects with
|
|
26
|
+
* `PluginFileDeletedError` when the file is gone.
|
|
27
|
+
*/
|
|
28
|
+
writeText(text: string, options?: PluginFileWriteOptions): Promise<void>;
|
|
29
|
+
writeBytes(bytes: Uint8Array, options?: PluginFileWriteOptions): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Calls `listener` when the file changes on disk or is deleted. This handle's own writes do not
|
|
32
|
+
* notify. A deletion is reported once a read confirms it; the panel stays mounted. Returns the
|
|
33
|
+
* unsubscribe function.
|
|
34
|
+
*/
|
|
35
|
+
watch(listener: (event: PluginFileEvent) => void): () => void;
|
|
36
|
+
}
|
|
37
|
+
export interface PluginFileWriteOptions {
|
|
38
|
+
force?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** What happened to the file on disk. Switch on `type`; later versions may add fields. */
|
|
41
|
+
export type PluginFileEvent = {
|
|
42
|
+
type: "changed";
|
|
43
|
+
} | {
|
|
44
|
+
type: "deleted";
|
|
45
|
+
};
|
|
46
|
+
/** What the panel reports back to its tab. */
|
|
47
|
+
export interface PluginFileTab {
|
|
48
|
+
/** Shows the tab's unsaved dot and asks before the tab closes. */
|
|
49
|
+
setModified(modified: boolean): void;
|
|
50
|
+
}
|
|
51
|
+
/** The line a link or search result opened the file at. `revision` bumps on every new target. */
|
|
52
|
+
export interface PluginFileLocation {
|
|
53
|
+
lineStart?: number;
|
|
54
|
+
lineEnd?: number;
|
|
55
|
+
revision: number;
|
|
56
|
+
}
|
|
57
|
+
/** The file changed on disk since the handle last read or wrote it. */
|
|
58
|
+
export declare class PluginFileConflictError extends Error {
|
|
59
|
+
constructor(message?: string);
|
|
60
|
+
}
|
|
61
|
+
/** The file was deleted on disk. */
|
|
62
|
+
export declare class PluginFileDeletedError extends Error {
|
|
63
|
+
constructor(message?: string);
|
|
64
|
+
}
|
|
65
|
+
export type PluginFileTextState = {
|
|
66
|
+
status: "loading";
|
|
67
|
+
} | {
|
|
68
|
+
status: "ready";
|
|
69
|
+
text: string;
|
|
70
|
+
} | {
|
|
71
|
+
status: "error";
|
|
72
|
+
error: Error;
|
|
73
|
+
};
|
|
74
|
+
export type PluginFileBytesState = {
|
|
75
|
+
status: "loading";
|
|
76
|
+
} | {
|
|
77
|
+
status: "ready";
|
|
78
|
+
bytes: Uint8Array;
|
|
79
|
+
} | {
|
|
80
|
+
status: "error";
|
|
81
|
+
error: Error;
|
|
82
|
+
};
|
|
83
|
+
export type PluginFileUrlState = {
|
|
84
|
+
status: "loading";
|
|
85
|
+
} | {
|
|
86
|
+
status: "ready";
|
|
87
|
+
url: string;
|
|
88
|
+
} | {
|
|
89
|
+
status: "error";
|
|
90
|
+
error: Error;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* The file's text, re-read when it changes on disk. Keeps the current text during a re-read. A
|
|
94
|
+
* deleted file is an error holding a `PluginFileDeletedError`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useFileText(file: PluginFile): PluginFileTextState;
|
|
97
|
+
/**
|
|
98
|
+
* The file's bytes, re-read when it changes on disk. Keeps the current bytes during a re-read. A
|
|
99
|
+
* deleted file is an error holding a `PluginFileDeletedError`.
|
|
100
|
+
*/
|
|
101
|
+
export declare function useFileBytes(file: PluginFile): PluginFileBytesState;
|
|
102
|
+
/**
|
|
103
|
+
* A local URL of the file, replaced when it changes on disk. A deleted file is an error holding a
|
|
104
|
+
* `PluginFileDeletedError`.
|
|
105
|
+
*/
|
|
106
|
+
export declare function useFileUrl(file: PluginFile): PluginFileUrlState;
|
|
107
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
/** The file changed on disk since the handle last read or wrote it. */
|
|
3
|
+
export class PluginFileConflictError extends Error {
|
|
4
|
+
constructor(message = "The file changed on disk.") {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "PluginFileConflictError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** The file was deleted on disk. */
|
|
10
|
+
export class PluginFileDeletedError extends Error {
|
|
11
|
+
constructor(message = "The file was deleted.") {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "PluginFileDeletedError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The file's text, re-read when it changes on disk. Keeps the current text during a re-read. A
|
|
18
|
+
* deleted file is an error holding a `PluginFileDeletedError`.
|
|
19
|
+
*/
|
|
20
|
+
export function useFileText(file) {
|
|
21
|
+
const state = useFileRead(file, "text");
|
|
22
|
+
return state.status === "ready" ? { status: "ready", text: state.value } : state;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The file's bytes, re-read when it changes on disk. Keeps the current bytes during a re-read. A
|
|
26
|
+
* deleted file is an error holding a `PluginFileDeletedError`.
|
|
27
|
+
*/
|
|
28
|
+
export function useFileBytes(file) {
|
|
29
|
+
const state = useFileRead(file, "bytes");
|
|
30
|
+
return state.status === "ready" ? { status: "ready", bytes: state.value } : state;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A local URL of the file, replaced when it changes on disk. A deleted file is an error holding a
|
|
34
|
+
* `PluginFileDeletedError`.
|
|
35
|
+
*/
|
|
36
|
+
export function useFileUrl(file) {
|
|
37
|
+
const state = useFileRead(file, "url");
|
|
38
|
+
return state.status === "ready" ? { status: "ready", url: state.value } : state;
|
|
39
|
+
}
|
|
40
|
+
function useFileRead(file, read) {
|
|
41
|
+
const [state, setState] = useState(() => ({ file, read, state: { status: "loading" } }));
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
let generation = 0;
|
|
44
|
+
let active = true;
|
|
45
|
+
const load = async () => {
|
|
46
|
+
const current = ++generation;
|
|
47
|
+
let next;
|
|
48
|
+
try {
|
|
49
|
+
next = { status: "ready", value: await readFile(file, read) };
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
next = { status: "error", error: asError(error) };
|
|
53
|
+
}
|
|
54
|
+
if (active && current === generation)
|
|
55
|
+
setState({ file, read, state: next });
|
|
56
|
+
};
|
|
57
|
+
void load();
|
|
58
|
+
const unwatch = file.watch((event) => {
|
|
59
|
+
if (event.type === "changed") {
|
|
60
|
+
void load();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
generation += 1;
|
|
64
|
+
setState({
|
|
65
|
+
file,
|
|
66
|
+
read,
|
|
67
|
+
state: { status: "error", error: new PluginFileDeletedError() },
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
return () => {
|
|
71
|
+
active = false;
|
|
72
|
+
unwatch();
|
|
73
|
+
};
|
|
74
|
+
}, [file, read]);
|
|
75
|
+
return state.file === file && state.read === read ? state.state : { status: "loading" };
|
|
76
|
+
}
|
|
77
|
+
function readFile(file, read) {
|
|
78
|
+
if (read === "text")
|
|
79
|
+
return file.readText();
|
|
80
|
+
if (read === "bytes")
|
|
81
|
+
return file.readBytes();
|
|
82
|
+
return file.url();
|
|
83
|
+
}
|
|
84
|
+
function asError(error) {
|
|
85
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=file.js.map
|
package/dist/client/host.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { PluginText } from "../text.js";
|
|
1
2
|
export { PluginClientStateProvider, type PluginClientStateSource } from "./client-state.js";
|
|
2
3
|
export { usePluginRuntimeContextBridge, type PluginRuntimeContextBridge, } from "./runtime-context-bridge.js";
|
|
3
4
|
import type { PluginAttachmentSourceContribution } from "../contracts.js";
|
|
4
5
|
import { PluginRpcProvider } from "./rpc-context.js";
|
|
5
6
|
import { PaseoApiProvider } from "./paseo-context.js";
|
|
6
7
|
import { callPluginRpc } from "../rpc.js";
|
|
7
|
-
export declare function searchPluginAttachments(source: PluginAttachmentSourceContribution
|
|
8
|
+
export declare function searchPluginAttachments(source: PluginAttachmentSourceContribution<PluginText>, invoke: (method: string, input: unknown) => Promise<unknown>, query: string): Promise<{
|
|
8
9
|
items: {
|
|
9
10
|
id: string;
|
|
10
11
|
identifier: string;
|
|
@@ -16,4 +17,6 @@ export declare function searchPluginAttachments(source: PluginAttachmentSourceCo
|
|
|
16
17
|
}[];
|
|
17
18
|
}>;
|
|
18
19
|
export { callPluginRpc, PaseoApiProvider, PluginRpcProvider };
|
|
20
|
+
export { PluginTranslationRuntime, PluginTranslationProvider, usePluginTranslationRuntime, requirePluginText, isPluginMessage, } from "./translations.js";
|
|
21
|
+
export type { PluginLocaleSource } from "./translations.js";
|
|
19
22
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/client/host.js
CHANGED
|
@@ -9,4 +9,5 @@ export async function searchPluginAttachments(source, invoke, query) {
|
|
|
9
9
|
return PluginAttachmentSearchPayloadSchema.parseAsync(output);
|
|
10
10
|
}
|
|
11
11
|
export { callPluginRpc, PaseoApiProvider, PluginRpcProvider };
|
|
12
|
+
export { PluginTranslationRuntime, PluginTranslationProvider, usePluginTranslationRuntime, requirePluginText, isPluginMessage, } from "./translations.js";
|
|
12
13
|
//# sourceMappingURL=host.js.map
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export type { PluginHostProps, PluginSurfaceProps, PluginScreenProps, PluginPopoverProps, PluginScreenParams, PluginOpenScreenInput, PluginScreenLocation, PluginSidebarItemProps, PluginSidebarItemContribution,
|
|
1
|
+
export type { PluginHostProps, PluginFilePanelContribution, PluginFilePanelProps, PluginSurfaceProps, PluginScreenProps, PluginPopoverProps, PluginScreenParams, PluginOpenScreenInput, PluginScreenLocation, PluginSidebarItemProps, PluginSidebarItemContribution, PluginIcon, 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
2
|
export type { PluginButton, PluginButtonBehavior, PluginButtonContentProps, PluginButtonContext, PluginButtonIcon, PluginButtonIconProps, PluginButtonMenuEntry, PluginButtonRegistration, PluginComposerPillContribution, PluginHeaderButtonContribution, } from "./buttons.js";
|
|
3
|
+
export type { PluginIconProps, PluginSerializableIcon, PluginSvgIcon } from "../icons.js";
|
|
4
|
+
export type { PluginFile, PluginFileBytesState, PluginFileEvent, PluginFileLocation, PluginFileTab, PluginFileTextState, PluginFileUrlState, PluginFileWriteOptions, } from "./file.js";
|
|
5
|
+
export { PluginFileConflictError, PluginFileDeletedError, useFileBytes, useFileText, useFileUrl, } from "./file.js";
|
|
3
6
|
export { usePaseo } from "./paseo-context.js";
|
|
4
7
|
export { useAgent, useWorkspace } from "./client-state.js";
|
|
5
8
|
export { useRpc } from "./rpc-context.js";
|
|
@@ -19,4 +22,7 @@ export declare function useHosts(): readonly PluginHostSummary[];
|
|
|
19
22
|
export declare function getPaseoClient(serverId: string): import("@getpaseo/client").PaseoApi;
|
|
20
23
|
/** Open an absolute HTTP(S) URL using the client platform’s external opener. */
|
|
21
24
|
export declare function openExternalUrl(url: string): Promise<void>;
|
|
25
|
+
export { defineTranslations, useTranslation } from "./translations.js";
|
|
26
|
+
export type { PluginI18n } from "./translations.js";
|
|
27
|
+
export type { PluginText, PluginMessage, PluginTranslations } from "../text.js";
|
|
22
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { PluginFileConflictError, PluginFileDeletedError, useFileBytes, useFileText, useFileUrl, } from "./file.js";
|
|
1
2
|
export { usePaseo } from "./paseo-context.js";
|
|
2
3
|
export { useAgent, useWorkspace } from "./client-state.js";
|
|
3
4
|
export { useRpc } from "./rpc-context.js";
|
|
5
|
+
export { defineTranslations, useTranslation } from "./translations.js";
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,46 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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>>;
|
|
1
|
+
/** @deprecated Import Paseo UI from @getpaseo/plugin/client/ui. */
|
|
2
|
+
export * from "./ui.js";
|
|
46
3
|
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PluginTranslationProvider, usePluginTranslationRuntime } from "./translations.js";
|
|
2
3
|
import { useCallback } from "react";
|
|
3
4
|
import { PluginClientStateProvider, usePluginClientStateSource } from "./client-state.js";
|
|
4
5
|
import { PaseoApiProvider, usePaseoContextValue } from "./paseo-context.js";
|
|
5
6
|
import { PluginRpcProvider, usePluginRpcContextValue } from "./rpc-context.js";
|
|
6
7
|
/** Rebuilds plugin runtime contexts inside React Native portal hosts. */
|
|
7
8
|
export function usePluginRuntimeContextBridge() {
|
|
9
|
+
const translations = usePluginTranslationRuntime();
|
|
8
10
|
const paseo = usePaseoContextValue();
|
|
9
11
|
const rpc = usePluginRpcContextValue();
|
|
10
12
|
const state = usePluginClientStateSource();
|
|
@@ -13,7 +15,7 @@ export function usePluginRuntimeContextBridge() {
|
|
|
13
15
|
}
|
|
14
16
|
return useCallback((children) => {
|
|
15
17
|
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
|
+
return (_jsx(PaseoApiProvider, { paseo: paseo, children: _jsx(PluginRpcProvider, { invoke: rpc.invoke, children: _jsx(PluginTranslationProvider, { runtime: translations, children: content }) }) }));
|
|
19
|
+
}, [paseo, rpc, state, translations]);
|
|
18
20
|
}
|
|
19
21
|
//# sourceMappingURL=runtime-context-bridge.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PluginMessage, PluginText, PluginTranslations, TranslationKey, TranslationArguments, TranslationResource } from "../text.js";
|
|
3
|
+
export declare function defineTranslations<const Resource extends TranslationResource>(definition: {
|
|
4
|
+
resources: Readonly<Record<string, TranslationResource>> & {
|
|
5
|
+
en: Resource;
|
|
6
|
+
};
|
|
7
|
+
}): PluginTranslations<Resource>;
|
|
8
|
+
/** App language source. Each installation subscribes for exactly its own lifetime. */
|
|
9
|
+
export interface PluginLocaleSource {
|
|
10
|
+
getLocale(): string;
|
|
11
|
+
subscribe(listener: () => void): () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PluginI18n {
|
|
14
|
+
readonly locale: string;
|
|
15
|
+
t<Resource extends TranslationResource, Key extends TranslationKey<Resource>>(messages: PluginTranslations<Resource>, key: Key, ...args: TranslationArguments<Resource, Key>): string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PluginTranslationRuntime implements PluginI18n {
|
|
18
|
+
private readonly source;
|
|
19
|
+
private readonly engines;
|
|
20
|
+
private readonly listeners;
|
|
21
|
+
private readonly unsubscribe;
|
|
22
|
+
private stopped;
|
|
23
|
+
constructor(source: PluginLocaleSource);
|
|
24
|
+
get locale(): string;
|
|
25
|
+
getSnapshot: () => string;
|
|
26
|
+
subscribe: (listener: () => void) => (() => void);
|
|
27
|
+
t<Resource extends TranslationResource, Key extends TranslationKey<Resource>>(messages: PluginTranslations<Resource>, key: Key, ...args: TranslationArguments<Resource, Key>): string;
|
|
28
|
+
resolve: (text: PluginText, locale?: string) => string;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function isPluginMessage(value: unknown): value is PluginMessage;
|
|
32
|
+
export declare function requirePluginText(text: unknown): PluginText;
|
|
33
|
+
export declare function PluginTranslationProvider({ runtime, children, }: {
|
|
34
|
+
runtime: PluginTranslationRuntime;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function usePluginTranslationRuntime(): PluginTranslationRuntime;
|
|
38
|
+
export declare function useTranslation<Resource extends TranslationResource>(messages: PluginTranslations<Resource>): {
|
|
39
|
+
locale: string;
|
|
40
|
+
t: <Key extends TranslationKey<Resource>>(key: Key, ...args: TranslationArguments<Resource, Key>) => string;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useSyncExternalStore, } from "react";
|
|
3
|
+
import { createInstance } from "i18next";
|
|
4
|
+
const messageDefinitions = new WeakMap();
|
|
5
|
+
export function defineTranslations(definition) {
|
|
6
|
+
const english = validateResources(definition.resources);
|
|
7
|
+
return {
|
|
8
|
+
resources: definition.resources,
|
|
9
|
+
message: (key, ...args) => {
|
|
10
|
+
const source = english.get(key) ?? english.get(`${key}_other`);
|
|
11
|
+
if (source === undefined)
|
|
12
|
+
throw new Error(`Unknown translation key: ${key}`);
|
|
13
|
+
const options = args[0];
|
|
14
|
+
for (const name of placeholders(source)) {
|
|
15
|
+
if (options?.[name] === undefined)
|
|
16
|
+
throw new Error(`Missing translation value: ${name} (${key})`);
|
|
17
|
+
}
|
|
18
|
+
const message = Object.freeze({});
|
|
19
|
+
messageDefinitions.set(message, { resources: definition.resources, key, options });
|
|
20
|
+
return message;
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export class PluginTranslationRuntime {
|
|
25
|
+
constructor(source) {
|
|
26
|
+
this.source = source;
|
|
27
|
+
this.engines = new Map();
|
|
28
|
+
this.listeners = new Set();
|
|
29
|
+
this.stopped = false;
|
|
30
|
+
this.getSnapshot = () => this.locale;
|
|
31
|
+
this.subscribe = (listener) => {
|
|
32
|
+
if (this.stopped)
|
|
33
|
+
throw new Error("Plugin translations have stopped");
|
|
34
|
+
this.listeners.add(listener);
|
|
35
|
+
return () => {
|
|
36
|
+
this.listeners.delete(listener);
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
this.resolve = (text, locale = this.locale) => {
|
|
40
|
+
if (typeof text === "string")
|
|
41
|
+
return text;
|
|
42
|
+
if (this.stopped)
|
|
43
|
+
throw new Error("Plugin translations have stopped");
|
|
44
|
+
const message = messageDefinitions.get(text);
|
|
45
|
+
if (!message)
|
|
46
|
+
throw new Error("Plugin labels must use messages.message()");
|
|
47
|
+
let engine = this.engines.get(message.resources);
|
|
48
|
+
if (!engine) {
|
|
49
|
+
engine = createInstance();
|
|
50
|
+
void engine.init({
|
|
51
|
+
initAsync: false,
|
|
52
|
+
lng: this.locale,
|
|
53
|
+
fallbackLng: "en",
|
|
54
|
+
resources: Object.fromEntries(Object.entries(message.resources).map(([language, translation]) => [
|
|
55
|
+
language,
|
|
56
|
+
{ translation },
|
|
57
|
+
])),
|
|
58
|
+
interpolation: { escapeValue: false },
|
|
59
|
+
returnNull: false,
|
|
60
|
+
returnObjects: false,
|
|
61
|
+
});
|
|
62
|
+
this.engines.set(message.resources, engine);
|
|
63
|
+
}
|
|
64
|
+
return engine.t(message.key, { ...message.options, lng: locale });
|
|
65
|
+
};
|
|
66
|
+
this.unsubscribe = source.subscribe(() => {
|
|
67
|
+
for (const listener of this.listeners)
|
|
68
|
+
listener();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
get locale() {
|
|
72
|
+
return this.source.getLocale();
|
|
73
|
+
}
|
|
74
|
+
t(messages, key, ...args) {
|
|
75
|
+
return this.resolve(messages.message(key, ...args));
|
|
76
|
+
}
|
|
77
|
+
dispose() {
|
|
78
|
+
if (this.stopped)
|
|
79
|
+
return;
|
|
80
|
+
this.stopped = true;
|
|
81
|
+
this.unsubscribe();
|
|
82
|
+
this.listeners.clear();
|
|
83
|
+
this.engines.clear();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export function isPluginMessage(value) {
|
|
87
|
+
return (typeof value === "object" && value !== null && messageDefinitions.has(value));
|
|
88
|
+
}
|
|
89
|
+
export function requirePluginText(text) {
|
|
90
|
+
if (typeof text === "string" && text.trim())
|
|
91
|
+
return text.trim();
|
|
92
|
+
if (isPluginMessage(text))
|
|
93
|
+
return text;
|
|
94
|
+
throw new Error("Plugin label must be a non-empty string or a translation message");
|
|
95
|
+
}
|
|
96
|
+
function flatten(resource, prefix = "") {
|
|
97
|
+
if (!resource || typeof resource !== "object" || Array.isArray(resource))
|
|
98
|
+
throw new Error("Translation resources must be objects of strings");
|
|
99
|
+
const result = new Map();
|
|
100
|
+
for (const [key, value] of Object.entries(resource)) {
|
|
101
|
+
if (!key || key.includes(".") || ["__proto__", "constructor", "prototype"].includes(key))
|
|
102
|
+
throw new Error(`Invalid translation key: ${key}`);
|
|
103
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
104
|
+
if (typeof value === "string")
|
|
105
|
+
result.set(path, value);
|
|
106
|
+
else
|
|
107
|
+
for (const entry of flatten(value, path))
|
|
108
|
+
result.set(...entry);
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
function pluralBase(key) {
|
|
113
|
+
return key.replace(/_(zero|one|two|few|many|other)$/, "");
|
|
114
|
+
}
|
|
115
|
+
function placeholders(value) {
|
|
116
|
+
return [
|
|
117
|
+
...new Set([...value.matchAll(/{{-?\s*([^},\s]+)(?:[^}]*)}}/g)].map((match) => match[1])),
|
|
118
|
+
].sort();
|
|
119
|
+
}
|
|
120
|
+
function validateResources(resources) {
|
|
121
|
+
const english = flatten(resources.en);
|
|
122
|
+
if (!english.size)
|
|
123
|
+
throw new Error("Plugin translations require English messages");
|
|
124
|
+
for (const [locale, resource] of Object.entries(resources)) {
|
|
125
|
+
if (Intl.getCanonicalLocales(locale)[0] !== locale)
|
|
126
|
+
throw new Error(`Translation locale must be canonical: ${locale}`);
|
|
127
|
+
for (const [key, value] of flatten(resource)) {
|
|
128
|
+
const source = english.get(key) ?? english.get(`${pluralBase(key)}_other`);
|
|
129
|
+
if (source === undefined)
|
|
130
|
+
throw new Error(`Unknown translation key in ${locale}: ${key}`);
|
|
131
|
+
if (placeholders(value).join(",") !== placeholders(source).join(","))
|
|
132
|
+
throw new Error(`Translation placeholders differ in ${locale}: ${key}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return english;
|
|
136
|
+
}
|
|
137
|
+
const Context = createContext(null);
|
|
138
|
+
export function PluginTranslationProvider({ runtime, children, }) {
|
|
139
|
+
return _jsx(Context.Provider, { value: runtime, children: children });
|
|
140
|
+
}
|
|
141
|
+
export function usePluginTranslationRuntime() {
|
|
142
|
+
const runtime = useContext(Context);
|
|
143
|
+
if (!runtime)
|
|
144
|
+
throw new Error("Plugin translations must run inside a contributed plugin surface");
|
|
145
|
+
return runtime;
|
|
146
|
+
}
|
|
147
|
+
export function useTranslation(messages) {
|
|
148
|
+
const runtime = usePluginTranslationRuntime();
|
|
149
|
+
const locale = useSyncExternalStore(runtime.subscribe, runtime.getSnapshot, runtime.getSnapshot);
|
|
150
|
+
const t = useCallback((key, ...args) => runtime.resolve(messages.message(key, ...args), locale), [runtime, messages, locale]);
|
|
151
|
+
return { locale, t };
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=translations.js.map
|
package/dist/client/ui.d.ts
CHANGED
|
@@ -1,4 +1,62 @@
|
|
|
1
|
-
import type { ComponentType, ReactNode, Ref } from "react";
|
|
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, TextProps } from "react-native";
|
|
3
|
+
import type { PluginIconProps } from "../icons.js";
|
|
4
|
+
import type { PluginIcon } from "./contracts.js";
|
|
5
|
+
export interface ModalProps {
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange(open: boolean): void;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface ModalContentProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/** Paint the full body below the header. */
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
/** Overrides the default 24px padding and 16px gap. Safe-area clearance stays host-owned. */
|
|
17
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
18
|
+
/** Default true. Set false for a bounded body with your own ScrollView or FlatList. */
|
|
19
|
+
scrollable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ModalComponent extends FunctionComponent<ModalProps> {
|
|
22
|
+
Content: ComponentType<ModalContentProps>;
|
|
23
|
+
}
|
|
24
|
+
export type ToastVariant = "default" | "info" | "success" | "warning" | "error";
|
|
25
|
+
export interface ToastOptions {
|
|
26
|
+
variant?: ToastVariant;
|
|
27
|
+
durationMs?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ToastApi {
|
|
30
|
+
show(message: string, options?: ToastOptions): void;
|
|
31
|
+
error(message: string): void;
|
|
32
|
+
}
|
|
33
|
+
/** Renders a Lucide icon by `name`, or any plugin icon by `icon`. An unusable icon renders nothing. */
|
|
34
|
+
export type IconProps = Partial<PluginIconProps> & ({
|
|
35
|
+
name: string;
|
|
36
|
+
icon?: never;
|
|
37
|
+
} | {
|
|
38
|
+
icon: PluginIcon;
|
|
39
|
+
name?: never;
|
|
40
|
+
});
|
|
41
|
+
export declare const Icon: ComponentType<IconProps>;
|
|
42
|
+
export declare const Modal: ModalComponent;
|
|
43
|
+
export declare function useToast(): ToastApi;
|
|
44
|
+
export interface StreamedTextProps extends Omit<TextProps, "children"> {
|
|
45
|
+
text: string;
|
|
46
|
+
phase: "streaming" | "complete";
|
|
47
|
+
}
|
|
48
|
+
/** Plain assistant text with host-owned streaming pacing and typography. */
|
|
49
|
+
export declare const StreamedText: ComponentType<StreamedTextProps>;
|
|
50
|
+
export type { PluginIconProps } from "../icons.js";
|
|
51
|
+
/** React Native scrolling with the host's sheet gestures when rendered inside a sheet. */
|
|
52
|
+
export declare const ScrollView: ForwardRefExoticComponent<ScrollViewProps & RefAttributes<NativeScrollView>>;
|
|
53
|
+
export declare function FlatList<Item>(props: FlatListProps<Item> & {
|
|
54
|
+
ref?: Ref<NativeFlatList<Item>>;
|
|
55
|
+
}): ReactElement;
|
|
56
|
+
/** Copies text to this client's clipboard. Rejects when copying is unavailable or denied. */
|
|
57
|
+
export declare function copyText(text: string): Promise<void>;
|
|
58
|
+
/** Native input focus integrated with modal keyboard positioning. */
|
|
59
|
+
export declare const TextInput: ForwardRefExoticComponent<TextInputProps & RefAttributes<NativeTextInput>>;
|
|
2
60
|
export interface SettingsSectionProps {
|
|
3
61
|
title: string;
|
|
4
62
|
info?: ReactNode;
|
|
@@ -46,6 +104,7 @@ export interface SettingsActionProps extends SettingsRowProps {
|
|
|
46
104
|
onPress(): void;
|
|
47
105
|
disabled?: boolean;
|
|
48
106
|
}
|
|
107
|
+
/** @deprecated Use SettingsSection for plugin settings headings. */
|
|
49
108
|
export declare const SettingsGroup: ComponentType<SettingsSectionProps>;
|
|
50
109
|
export declare const SettingsSection: ComponentType<SettingsSectionProps>;
|
|
51
110
|
export declare const SettingsCard: ComponentType<{
|
|
@@ -65,17 +124,14 @@ export interface ExternalLinkProps {
|
|
|
65
124
|
onError?: (error: unknown) => void;
|
|
66
125
|
}
|
|
67
126
|
export declare const ExternalLink: ComponentType<ExternalLinkProps>;
|
|
68
|
-
export type SidebarIcon =
|
|
69
|
-
size: number;
|
|
70
|
-
color: string;
|
|
71
|
-
}>;
|
|
127
|
+
export type SidebarIcon = PluginIcon;
|
|
72
128
|
export interface SidebarRowProps {
|
|
73
129
|
/**
|
|
74
130
|
* Tells rows of one item apart when the item renders several: "bot-2". Unique within the item.
|
|
75
131
|
* Omit it when the item renders one row.
|
|
76
132
|
*/
|
|
77
133
|
id?: string;
|
|
78
|
-
/** A Lucide icon name or a component. */
|
|
134
|
+
/** A Lucide icon name, inline SVG, or a component. */
|
|
79
135
|
icon?: SidebarIcon;
|
|
80
136
|
/** Defaults to the item's registered title. */
|
|
81
137
|
label?: string;
|
|
@@ -88,4 +144,16 @@ export interface SidebarRowProps {
|
|
|
88
144
|
export declare const SidebarRow: ComponentType<SidebarRowProps>;
|
|
89
145
|
/** A line between groups of rows. Render it from a sidebar item's `Component`. */
|
|
90
146
|
export declare const SidebarSeparator: ComponentType;
|
|
147
|
+
/** Paseo's loading state. Fills the panel; the panel decides when to show it. */
|
|
148
|
+
export declare const Loading: ComponentType;
|
|
149
|
+
/** Render a local document URL in an isolated frame. */
|
|
150
|
+
export declare const DocumentFrame: ComponentType<{
|
|
151
|
+
url: string;
|
|
152
|
+
testID?: string;
|
|
153
|
+
}>;
|
|
154
|
+
export interface MarkdownProps {
|
|
155
|
+
children: string;
|
|
156
|
+
}
|
|
157
|
+
/** Renders Markdown using Paseo’s theme, selection, and link behavior. */
|
|
158
|
+
export declare const Markdown: ComponentType<MarkdownProps>;
|
|
91
159
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/contracts.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { PluginText } from "./text.js";
|
|
1
2
|
import type { JsonValue } from "@getpaseo/protocol/agent-types";
|
|
3
|
+
import type { PluginSerializableIcon } from "./icons.js";
|
|
2
4
|
import type { PluginRpcContract } from "./rpc.js";
|
|
3
5
|
export interface PluginTheme {
|
|
4
6
|
readonly colors: {
|
|
@@ -61,18 +63,18 @@ export interface PluginThemeColors {
|
|
|
61
63
|
mutedForeground: string;
|
|
62
64
|
ring: string;
|
|
63
65
|
}
|
|
64
|
-
export interface PluginThemeContribution {
|
|
66
|
+
export interface PluginThemeContribution<Text extends PluginText = string> {
|
|
65
67
|
id: string;
|
|
66
|
-
name:
|
|
68
|
+
name: Text;
|
|
67
69
|
appearance: "light" | "dark";
|
|
68
70
|
colors: PluginThemeColors;
|
|
69
71
|
}
|
|
70
|
-
export interface PluginAttachmentSourceContribution {
|
|
72
|
+
export interface PluginAttachmentSourceContribution<Text extends PluginText = string> {
|
|
71
73
|
id: string;
|
|
72
|
-
title:
|
|
73
|
-
icon:
|
|
74
|
-
pickerTitle:
|
|
75
|
-
searchPlaceholder:
|
|
74
|
+
title: Text;
|
|
75
|
+
icon: PluginSerializableIcon;
|
|
76
|
+
pickerTitle: Text;
|
|
77
|
+
searchPlaceholder: Text;
|
|
76
78
|
search: PluginRpcContract;
|
|
77
79
|
}
|
|
78
80
|
export type PluginTimelineData = JsonValue;
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** What a component icon receives from the surface that draws it. */
|
|
2
|
+
export interface PluginIconProps {
|
|
3
|
+
size: number;
|
|
4
|
+
color: string;
|
|
5
|
+
}
|
|
6
|
+
/** Inline SVG markup. Paseo validates it when the contribution registers. */
|
|
7
|
+
export interface PluginSvgIcon {
|
|
8
|
+
svg: string;
|
|
9
|
+
}
|
|
10
|
+
/** An icon that can be stored or sent: a Lucide icon name, or inline SVG. */
|
|
11
|
+
export type PluginSerializableIcon = string | PluginSvgIcon;
|
|
12
|
+
export declare const PLUGIN_SVG_ICON_MAX_BYTES: number;
|
|
13
|
+
/**
|
|
14
|
+
* Why Paseo refuses to render this SVG, or null when it is a self-contained document.
|
|
15
|
+
* The daemon applies it to provider and usage-source icon files; the app to inline plugin icons.
|
|
16
|
+
*/
|
|
17
|
+
export declare function findSvgIconProblem(svg: string): string | null;
|
|
18
|
+
//# sourceMappingURL=icons.d.ts.map
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const PLUGIN_SVG_ICON_MAX_BYTES = 64 * 1024;
|
|
2
|
+
const EXTERNAL_HREF = /\s(?:href|xlink:href)\s*=\s*(?:(["'])(.*?)\1|([^\s>]+))/gi;
|
|
3
|
+
/**
|
|
4
|
+
* Why Paseo refuses to render this SVG, or null when it is a self-contained document.
|
|
5
|
+
* The daemon applies it to provider and usage-source icon files; the app to inline plugin icons.
|
|
6
|
+
*/
|
|
7
|
+
export function findSvgIconProblem(svg) {
|
|
8
|
+
if (new TextEncoder().encode(svg).byteLength > PLUGIN_SVG_ICON_MAX_BYTES) {
|
|
9
|
+
return "exceeds 64 KiB";
|
|
10
|
+
}
|
|
11
|
+
if (!/^\s*<svg(?:\s|>)/i.test(svg))
|
|
12
|
+
return "not an SVG document";
|
|
13
|
+
if (/<script(?:\s|>)/i.test(svg))
|
|
14
|
+
return "script elements are not allowed";
|
|
15
|
+
if (/<foreignObject(?:\s|>)/i.test(svg))
|
|
16
|
+
return "foreignObject elements are not allowed";
|
|
17
|
+
if (/<style(?:\s|>)/i.test(svg))
|
|
18
|
+
return "style elements are not allowed";
|
|
19
|
+
if (/\son[a-z0-9_-]*\s*=/i.test(svg))
|
|
20
|
+
return "event-handler attributes are not allowed";
|
|
21
|
+
if (/javascript\s*:/i.test(svg))
|
|
22
|
+
return "javascript URLs are not allowed";
|
|
23
|
+
for (const match of svg.matchAll(EXTERNAL_HREF)) {
|
|
24
|
+
const href = match[2] ?? match[3] ?? "";
|
|
25
|
+
if (!href.startsWith("#"))
|
|
26
|
+
return "external href references are not allowed";
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=icons.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export type { PluginTheme, PluginWorkspaceSnapshot, PluginAgentSnapshot, PluginT
|
|
|
2
2
|
export { defineSettings, settingsRpc, type SettingsDefinition } from "./settings.js";
|
|
3
3
|
export { defineAttachmentSource, PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, type PluginAttachmentItem, type PluginAttachmentSearchPayload, } from "./attachments.js";
|
|
4
4
|
export { defineRpc, type PluginRpcContract, type RpcInput, type RpcOutput } from "./rpc.js";
|
|
5
|
+
export type { PluginText, PluginMessage } from "./text.js";
|
|
6
|
+
export { findSvgIconProblem, PLUGIN_SVG_ICON_MAX_BYTES, type PluginIconProps, type PluginSerializableIcon, type PluginSvgIcon, } from "./icons.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { defineSettings, settingsRpc } from "./settings.js";
|
|
2
2
|
export { defineAttachmentSource, PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, } from "./attachments.js";
|
|
3
3
|
export { defineRpc } from "./rpc.js";
|
|
4
|
+
export { findSvgIconProblem, PLUGIN_SVG_ICON_MAX_BYTES, } from "./icons.js";
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -50,6 +50,10 @@ export interface PluginLifecycleEvents {
|
|
|
50
50
|
agent: PluginHookAgent;
|
|
51
51
|
turnId: string | null;
|
|
52
52
|
outcome: PluginTurnOutcome;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Always empty. Fetch history on demand with
|
|
55
|
+
* context.paseo.agents.ref(agent.id).timeline.refetch({ direction: "tail", limit: 20 }).
|
|
56
|
+
*/
|
|
53
57
|
timeline: readonly AgentTimelineItem[];
|
|
54
58
|
};
|
|
55
59
|
"agent.permission_requested": {
|
package/dist/text.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** A persistent label resolved in the presenting app's language. */
|
|
2
|
+
declare const pluginMessage: unique symbol;
|
|
3
|
+
export interface PluginMessage {
|
|
4
|
+
readonly [pluginMessage]: true;
|
|
5
|
+
}
|
|
6
|
+
export type PluginText = string | PluginMessage;
|
|
7
|
+
export interface TranslationResource {
|
|
8
|
+
readonly [key: string]: string | TranslationResource;
|
|
9
|
+
}
|
|
10
|
+
export interface TranslationOptions {
|
|
11
|
+
readonly count?: number;
|
|
12
|
+
readonly [name: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export type TranslationKey<Resource> = {
|
|
15
|
+
[Key in keyof Resource & string]: Resource[Key] extends string ? Key | (Key extends `${infer Base}_${"zero" | "one" | "two" | "few" | "many" | "other"}` ? Base : never) : Resource[Key] extends TranslationResource ? `${Key}.${TranslationKey<Resource[Key]>}` : never;
|
|
16
|
+
}[keyof Resource & string];
|
|
17
|
+
export interface PluginTranslations<Resource extends TranslationResource = TranslationResource> {
|
|
18
|
+
readonly resources: Readonly<Record<string, TranslationResource>> & {
|
|
19
|
+
readonly en: Resource;
|
|
20
|
+
};
|
|
21
|
+
message<Key extends TranslationKey<Resource>>(key: Key, ...args: TranslationArguments<Resource, Key>): PluginMessage;
|
|
22
|
+
}
|
|
23
|
+
type Lookup<Resource, Key extends string> = Key extends `${infer Head}.${infer Tail}` ? Head extends keyof Resource ? Lookup<Resource[Head], Tail> : never : Key extends keyof Resource ? Resource[Key] : never;
|
|
24
|
+
type Trim<Value extends string> = Value extends ` ${infer Rest}` | `${infer Rest} ` ? Trim<Rest> : Value;
|
|
25
|
+
type InterpolationName<Value extends string> = Trim<Value> extends `-${infer Rest}` ? InterpolationName<Rest> : Trim<Value> extends `${infer Name},${string}` ? Trim<Name> : Trim<Value>;
|
|
26
|
+
type InterpolationNames<Value> = Value extends string ? string extends Value ? never : Value extends `${string}{{${infer Name}}}${infer Rest}` ? InterpolationName<Name> | InterpolationNames<Rest> : never : never;
|
|
27
|
+
type MessageOptions<Resource, Key extends string> = TranslationOptions & ([Lookup<Resource, `${Key}_other`>] extends [never] ? {} : {
|
|
28
|
+
count: number;
|
|
29
|
+
}) & {
|
|
30
|
+
[Name in InterpolationNames<Lookup<Resource, Key> | Lookup<Resource, `${Key}_other`>>]: string | number | boolean | Date;
|
|
31
|
+
};
|
|
32
|
+
export type TranslationArguments<Resource, Key extends string> = {} extends MessageOptions<Resource, Key> ? [options?: MessageOptions<Resource, Key>] : [options: MessageOptions<Resource, Key>];
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=text.d.ts.map
|
package/dist/text.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-beta.1",
|
|
4
4
|
"description": "Paseo plugin SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -62,28 +62,30 @@
|
|
|
62
62
|
"build": "tsc -p tsconfig.json --incremental false",
|
|
63
63
|
"build:clean": "npm run clean && npm run build",
|
|
64
64
|
"prepack": "npm run build:clean",
|
|
65
|
-
"typecheck": "tsgo --noEmit &&
|
|
66
|
-
"test": "vitest run"
|
|
65
|
+
"typecheck": "tsgo --noEmit && npm run typecheck:examples",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"typecheck:examples": "npm --prefix ../../plugin-examples/markdown-panel install --ignore-scripts --no-audit --no-fund && tsgo -p tsconfig.examples.json --noEmit"
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
70
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
71
|
+
"i18next": "^26.3.0",
|
|
70
72
|
"use-sync-external-store": "^1.6.0"
|
|
71
73
|
},
|
|
72
74
|
"devDependencies": {
|
|
73
|
-
"@getpaseo/client": "0.
|
|
74
|
-
"@getpaseo/protocol": "0.
|
|
75
|
+
"@getpaseo/client": "0.13.0-beta.1",
|
|
76
|
+
"@getpaseo/protocol": "0.13.0-beta.1",
|
|
75
77
|
"@types/node": "^20.9.0",
|
|
76
78
|
"@types/react": "~19.2.0",
|
|
77
|
-
"react": "19.
|
|
78
|
-
"react-native": "0.
|
|
79
|
+
"react": "19.2.3",
|
|
80
|
+
"react-native": "0.86.3",
|
|
79
81
|
"typescript": "^5.9.3",
|
|
80
82
|
"vitest": "^4.1.6",
|
|
81
83
|
"zod": "^4.4.3"
|
|
82
84
|
},
|
|
83
85
|
"peerDependencies": {
|
|
84
|
-
"@getpaseo/client": "0.
|
|
85
|
-
"@getpaseo/protocol": "0.
|
|
86
|
-
"react": "
|
|
86
|
+
"@getpaseo/client": "0.13.0-beta.1",
|
|
87
|
+
"@getpaseo/protocol": "0.13.0-beta.1",
|
|
88
|
+
"react": ">=19.1.0 <20",
|
|
87
89
|
"react-native": ">=0.81.5",
|
|
88
90
|
"zod": "^4.4.3"
|
|
89
91
|
},
|