@camerontaylor/paseo-plugin 0.8.0-fork.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 +26 -0
- package/dist/attachments.js +17 -0
- package/dist/client/buttons.d.ts +64 -0
- package/dist/client/buttons.js +2 -0
- package/dist/client/client-state.d.ts +15 -0
- package/dist/client/client-state.js +32 -0
- package/dist/client/contracts.d.ts +201 -0
- package/dist/client/contracts.js +2 -0
- package/dist/client/host.d.ts +19 -0
- package/dist/client/host.js +12 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.js +4 -0
- package/dist/client/paseo-context.d.ts +9 -0
- package/dist/client/paseo-context.js +16 -0
- package/dist/client/react-native.d.ts +46 -0
- package/dist/client/react-native.js +2 -0
- package/dist/client/rpc-context.d.ts +13 -0
- package/dist/client/rpc-context.js +18 -0
- package/dist/client/runtime-context-bridge.d.ts +5 -0
- package/dist/client/runtime-context-bridge.js +19 -0
- package/dist/client/shallow.d.ts +2 -0
- package/dist/client/shallow.js +45 -0
- package/dist/client/ui.d.ts +60 -0
- package/dist/client/ui.js +2 -0
- package/dist/contracts.d.ts +90 -0
- package/dist/contracts.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/rpc.d.ts +17 -0
- package/dist/rpc.js +13 -0
- package/dist/server/acp-internal/connection.d.ts +4 -0
- package/dist/server/acp-internal/connection.js +1187 -0
- package/dist/server/acp.d.ts +112 -0
- package/dist/server/acp.js +21 -0
- package/dist/server/contracts.d.ts +16 -0
- package/dist/server/contracts.js +2 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +2 -0
- package/dist/server/lifecycle.d.ts +92 -0
- package/dist/server/lifecycle.js +2 -0
- package/dist/server/provider.d.ts +610 -0
- package/dist/server/provider.js +811 -0
- package/dist/settings.d.ts +70 -0
- package/dist/settings.js +40 -0
- package/package.json +90 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode, Ref } from "react";
|
|
2
|
+
export interface SettingsSectionProps {
|
|
3
|
+
title: string;
|
|
4
|
+
info?: ReactNode;
|
|
5
|
+
trailing?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SettingsRowProps {
|
|
10
|
+
label: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
error?: string | null;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SettingsSwitchProps extends SettingsRowProps {
|
|
17
|
+
value: boolean;
|
|
18
|
+
onValueChange(value: boolean): void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SettingsSelectProps<Value extends string = string> extends SettingsRowProps {
|
|
22
|
+
value: Value;
|
|
23
|
+
options: readonly {
|
|
24
|
+
label: string;
|
|
25
|
+
value: Value;
|
|
26
|
+
}[];
|
|
27
|
+
onValueChange(value: Value): void;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface SettingsInputHandle {
|
|
31
|
+
focus(): void;
|
|
32
|
+
blur(): void;
|
|
33
|
+
getText(): string;
|
|
34
|
+
replaceText(text: string): void;
|
|
35
|
+
}
|
|
36
|
+
export interface SettingsInputProps extends SettingsRowProps {
|
|
37
|
+
initialValue?: string;
|
|
38
|
+
onChangeText(text: string): void;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
secureTextEntry?: boolean;
|
|
42
|
+
ref?: Ref<SettingsInputHandle>;
|
|
43
|
+
}
|
|
44
|
+
export interface SettingsActionProps extends SettingsRowProps {
|
|
45
|
+
actionLabel: string;
|
|
46
|
+
onPress(): void;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare const SettingsGroup: ComponentType<SettingsSectionProps>;
|
|
50
|
+
export declare const SettingsSection: ComponentType<SettingsSectionProps>;
|
|
51
|
+
export declare const SettingsCard: ComponentType<{
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
testID?: string;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const SettingsRow: ComponentType<SettingsRowProps>;
|
|
56
|
+
export declare const SettingsSwitch: ComponentType<SettingsSwitchProps>;
|
|
57
|
+
export declare function SettingsSelect<Value extends string>(props: SettingsSelectProps<Value>): ReactNode;
|
|
58
|
+
export declare const SettingsInput: ComponentType<SettingsInputProps>;
|
|
59
|
+
export declare const SettingsAction: ComponentType<SettingsActionProps>;
|
|
60
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { JsonValue } from "@camerontaylor/paseo-protocol/agent-types";
|
|
2
|
+
import type { PluginRpcContract } from "./rpc.js";
|
|
3
|
+
export interface PluginTheme {
|
|
4
|
+
readonly colors: {
|
|
5
|
+
readonly surface0: string;
|
|
6
|
+
readonly surface1: string;
|
|
7
|
+
readonly surface2: string;
|
|
8
|
+
readonly border: string;
|
|
9
|
+
readonly foreground: string;
|
|
10
|
+
readonly foregroundMuted: string;
|
|
11
|
+
readonly accent: string;
|
|
12
|
+
readonly accentForeground: string;
|
|
13
|
+
readonly statusSuccess: string;
|
|
14
|
+
readonly statusWarning: string;
|
|
15
|
+
readonly statusDanger: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface PluginWorkspaceSnapshot {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly projectId: string;
|
|
21
|
+
readonly projectDisplayName: string;
|
|
22
|
+
readonly projectRootPath: string;
|
|
23
|
+
readonly directory: string;
|
|
24
|
+
readonly projectKind: "git" | "non_git" | "directory";
|
|
25
|
+
readonly kind: "directory" | "local_checkout" | "checkout" | "worktree";
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly title: string | null;
|
|
28
|
+
readonly status: "needs_input" | "failed" | "running" | "attention" | "done";
|
|
29
|
+
readonly statusEnteredAt: string | null;
|
|
30
|
+
readonly archivingAt: string | null;
|
|
31
|
+
readonly diffStat: {
|
|
32
|
+
readonly additions: number;
|
|
33
|
+
readonly deletions: number;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
36
|
+
export interface PluginAgentSnapshot {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly workspaceId: string;
|
|
39
|
+
readonly provider: string;
|
|
40
|
+
readonly status: "initializing" | "idle" | "running" | "error" | "closed";
|
|
41
|
+
readonly createdAt: string;
|
|
42
|
+
readonly updatedAt: string;
|
|
43
|
+
readonly lastActivityAt: string;
|
|
44
|
+
readonly title: string | null;
|
|
45
|
+
readonly cwd: string;
|
|
46
|
+
readonly model: string | null;
|
|
47
|
+
readonly currentModeId: string | null;
|
|
48
|
+
readonly thinkingOptionId: string | null;
|
|
49
|
+
readonly requiresAttention: boolean;
|
|
50
|
+
readonly attentionReason: "finished" | "error" | "permission" | null;
|
|
51
|
+
readonly parentAgentId: string | null;
|
|
52
|
+
readonly labels: Readonly<Record<string, string>>;
|
|
53
|
+
}
|
|
54
|
+
export interface PluginThemeColors {
|
|
55
|
+
background: string;
|
|
56
|
+
foreground: string;
|
|
57
|
+
raised: string;
|
|
58
|
+
control: string;
|
|
59
|
+
border: string;
|
|
60
|
+
accent?: string;
|
|
61
|
+
mutedForeground: string;
|
|
62
|
+
ring: string;
|
|
63
|
+
}
|
|
64
|
+
export interface PluginThemeContribution {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
appearance: "light" | "dark";
|
|
68
|
+
colors: PluginThemeColors;
|
|
69
|
+
}
|
|
70
|
+
export interface PluginAttachmentSourceContribution {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string;
|
|
73
|
+
icon: string;
|
|
74
|
+
pickerTitle: string;
|
|
75
|
+
searchPlaceholder: string;
|
|
76
|
+
search: PluginRpcContract;
|
|
77
|
+
}
|
|
78
|
+
export type PluginTimelineData = JsonValue;
|
|
79
|
+
export interface PluginTimelineItem {
|
|
80
|
+
type: "plugin";
|
|
81
|
+
id?: string;
|
|
82
|
+
kind: string;
|
|
83
|
+
version: number;
|
|
84
|
+
data: PluginTimelineData;
|
|
85
|
+
}
|
|
86
|
+
export interface PluginTimelineTransformResult {
|
|
87
|
+
items: PluginTimelineItem[];
|
|
88
|
+
}
|
|
89
|
+
export type PluginCleanup = () => void | Promise<void>;
|
|
90
|
+
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { PluginTheme, PluginWorkspaceSnapshot, PluginAgentSnapshot, PluginThemeColors, PluginThemeContribution, PluginAttachmentSourceContribution, PluginTimelineData, PluginTimelineItem, PluginTimelineTransformResult, PluginCleanup, } from "./contracts.js";
|
|
2
|
+
export { defineSettings, settingsRpc, type SettingsDefinition } from "./settings.js";
|
|
3
|
+
export { defineAttachmentSource, PluginAttachmentItemSchema, PluginAttachmentSearchPayloadSchema, type PluginAttachmentItem, type PluginAttachmentSearchPayload, } from "./attachments.js";
|
|
4
|
+
export { defineRpc, type PluginRpcContract, type RpcInput, type RpcOutput } from "./rpc.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
package/dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
|
|
2
|
+
export interface PluginRpcContract<InputSchema extends ZodType = ZodType, OutputSchema extends ZodType = ZodType> {
|
|
3
|
+
name: string;
|
|
4
|
+
input: InputSchema;
|
|
5
|
+
output: OutputSchema;
|
|
6
|
+
}
|
|
7
|
+
export type RpcInput<Contract extends PluginRpcContract> = ZodOutput<Contract["input"]>;
|
|
8
|
+
export type RpcOutput<Contract extends PluginRpcContract> = ZodInput<Contract["output"]>;
|
|
9
|
+
interface RpcDefinition<InputSchema extends ZodType, OutputSchema extends ZodType> {
|
|
10
|
+
name: string;
|
|
11
|
+
input: InputSchema;
|
|
12
|
+
output: OutputSchema;
|
|
13
|
+
}
|
|
14
|
+
export declare function defineRpc<InputSchema extends ZodType, OutputSchema extends ZodType>(definition: RpcDefinition<InputSchema, OutputSchema>): PluginRpcContract<InputSchema, OutputSchema>;
|
|
15
|
+
export declare function callPluginRpc<InputSchema extends ZodType, OutputSchema extends ZodType>(contract: PluginRpcContract<InputSchema, OutputSchema>, invoke: (method: string, input: unknown) => Promise<unknown>, input: ZodInput<InputSchema>): Promise<ZodOutput<OutputSchema>>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=rpc.d.ts.map
|
package/dist/rpc.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const RPC_NAME = /^[a-z][a-z0-9._-]*$/;
|
|
2
|
+
export function defineRpc(definition) {
|
|
3
|
+
const name = definition.name.trim();
|
|
4
|
+
if (!RPC_NAME.test(name))
|
|
5
|
+
throw new Error(`Invalid plugin RPC method: ${definition.name}`);
|
|
6
|
+
return { ...definition, name };
|
|
7
|
+
}
|
|
8
|
+
export async function callPluginRpc(contract, invoke, input) {
|
|
9
|
+
const parsedInput = await contract.input.parseAsync(input);
|
|
10
|
+
const output = await invoke(contract.name, parsedInput);
|
|
11
|
+
return contract.output.parseAsync(output);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RunAcpProviderOptions } from "../acp.js";
|
|
2
|
+
import { type ProviderConnectRequest, type ProviderConnection } from "../provider.js";
|
|
3
|
+
export declare function createAcpProviderConnection(options: RunAcpProviderOptions, request: ProviderConnectRequest): Promise<ProviderConnection>;
|
|
4
|
+
//# sourceMappingURL=connection.d.ts.map
|