@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.
Files changed (45) hide show
  1. package/dist/attachments.d.ts +26 -0
  2. package/dist/attachments.js +17 -0
  3. package/dist/client/buttons.d.ts +64 -0
  4. package/dist/client/buttons.js +2 -0
  5. package/dist/client/client-state.d.ts +15 -0
  6. package/dist/client/client-state.js +32 -0
  7. package/dist/client/contracts.d.ts +201 -0
  8. package/dist/client/contracts.js +2 -0
  9. package/dist/client/host.d.ts +19 -0
  10. package/dist/client/host.js +12 -0
  11. package/dist/client/index.d.ts +10 -0
  12. package/dist/client/index.js +4 -0
  13. package/dist/client/paseo-context.d.ts +9 -0
  14. package/dist/client/paseo-context.js +16 -0
  15. package/dist/client/react-native.d.ts +46 -0
  16. package/dist/client/react-native.js +2 -0
  17. package/dist/client/rpc-context.d.ts +13 -0
  18. package/dist/client/rpc-context.js +18 -0
  19. package/dist/client/runtime-context-bridge.d.ts +5 -0
  20. package/dist/client/runtime-context-bridge.js +19 -0
  21. package/dist/client/shallow.d.ts +2 -0
  22. package/dist/client/shallow.js +45 -0
  23. package/dist/client/ui.d.ts +60 -0
  24. package/dist/client/ui.js +2 -0
  25. package/dist/contracts.d.ts +90 -0
  26. package/dist/contracts.js +2 -0
  27. package/dist/index.d.ts +5 -0
  28. package/dist/index.js +4 -0
  29. package/dist/rpc.d.ts +17 -0
  30. package/dist/rpc.js +13 -0
  31. package/dist/server/acp-internal/connection.d.ts +4 -0
  32. package/dist/server/acp-internal/connection.js +1187 -0
  33. package/dist/server/acp.d.ts +112 -0
  34. package/dist/server/acp.js +21 -0
  35. package/dist/server/contracts.d.ts +16 -0
  36. package/dist/server/contracts.js +2 -0
  37. package/dist/server/index.d.ts +3 -0
  38. package/dist/server/index.js +2 -0
  39. package/dist/server/lifecycle.d.ts +92 -0
  40. package/dist/server/lifecycle.js +2 -0
  41. package/dist/server/provider.d.ts +610 -0
  42. package/dist/server/provider.js +811 -0
  43. package/dist/settings.d.ts +70 -0
  44. package/dist/settings.js +40 -0
  45. package/package.json +90 -0
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ import type { ZodType } from "zod";
3
+ export interface SettingsDefinition<Schema extends ZodType = ZodType> {
4
+ id: string;
5
+ scope: "host";
6
+ version: number;
7
+ schema: Schema;
8
+ /** Convert a previous stored version to the current schema. Runs on the host. */
9
+ migrate?: (values: unknown, fromVersion: number) => unknown | Promise<unknown>;
10
+ }
11
+ export declare function defineSettings<Schema extends ZodType>(definition: SettingsDefinition<Schema>): SettingsDefinition<Schema>;
12
+ export declare const SettingsReadResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ status: z.ZodLiteral<"ready">;
14
+ revision: z.ZodString;
15
+ values: z.ZodJSONSchema;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ status: z.ZodLiteral<"invalid">;
18
+ revision: z.ZodString;
19
+ error: z.ZodString;
20
+ }, z.core.$strip>], "status">;
21
+ export declare const SettingsWriteResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ status: z.ZodLiteral<"saved">;
23
+ revision: z.ZodString;
24
+ values: z.ZodJSONSchema;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ status: z.ZodLiteral<"conflict">;
27
+ error: z.ZodString;
28
+ }, z.core.$strip>, z.ZodObject<{
29
+ status: z.ZodLiteral<"invalid">;
30
+ error: z.ZodString;
31
+ }, z.core.$strip>], "status">;
32
+ export declare function settingsRpc(id: string): {
33
+ read: import("./rpc.js").PluginRpcContract<z.ZodObject<{}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ status: z.ZodLiteral<"ready">;
35
+ revision: z.ZodString;
36
+ values: z.ZodJSONSchema;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ status: z.ZodLiteral<"invalid">;
39
+ revision: z.ZodString;
40
+ error: z.ZodString;
41
+ }, z.core.$strip>], "status">>;
42
+ write: import("./rpc.js").PluginRpcContract<z.ZodObject<{
43
+ revision: z.ZodString;
44
+ values: z.ZodJSONSchema;
45
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
46
+ status: z.ZodLiteral<"saved">;
47
+ revision: z.ZodString;
48
+ values: z.ZodJSONSchema;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ status: z.ZodLiteral<"conflict">;
51
+ error: z.ZodString;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ status: z.ZodLiteral<"invalid">;
54
+ error: z.ZodString;
55
+ }, z.core.$strip>], "status">>;
56
+ reset: import("./rpc.js").PluginRpcContract<z.ZodObject<{
57
+ revision: z.ZodString;
58
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
59
+ status: z.ZodLiteral<"saved">;
60
+ revision: z.ZodString;
61
+ values: z.ZodJSONSchema;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ status: z.ZodLiteral<"conflict">;
64
+ error: z.ZodString;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ status: z.ZodLiteral<"invalid">;
67
+ error: z.ZodString;
68
+ }, z.core.$strip>], "status">>;
69
+ };
70
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { defineRpc } from "./rpc.js";
3
+ export function defineSettings(definition) {
4
+ if (!/^[a-z][a-z0-9_-]*$/.test(definition.id))
5
+ throw new Error("Invalid settings ID");
6
+ if (definition.scope !== "host")
7
+ throw new Error("Only host-scoped settings are supported");
8
+ if (!Number.isSafeInteger(definition.version) || definition.version < 1)
9
+ throw new Error("Invalid settings version");
10
+ return definition;
11
+ }
12
+ export const SettingsReadResultSchema = z.discriminatedUnion("status", [
13
+ z.object({ status: z.literal("ready"), revision: z.string(), values: z.json() }),
14
+ z.object({ status: z.literal("invalid"), revision: z.string(), error: z.string() }),
15
+ ]);
16
+ export const SettingsWriteResultSchema = z.discriminatedUnion("status", [
17
+ z.object({ status: z.literal("saved"), revision: z.string(), values: z.json() }),
18
+ z.object({ status: z.literal("conflict"), error: z.string() }),
19
+ z.object({ status: z.literal("invalid"), error: z.string() }),
20
+ ]);
21
+ export function settingsRpc(id) {
22
+ return {
23
+ read: defineRpc({
24
+ name: `settings.${id}.read`,
25
+ input: z.object({}),
26
+ output: SettingsReadResultSchema,
27
+ }),
28
+ write: defineRpc({
29
+ name: `settings.${id}.write`,
30
+ input: z.object({ revision: z.string(), values: z.json() }),
31
+ output: SettingsWriteResultSchema,
32
+ }),
33
+ reset: defineRpc({
34
+ name: `settings.${id}.reset`,
35
+ input: z.object({ revision: z.string() }),
36
+ output: SettingsWriteResultSchema,
37
+ }),
38
+ };
39
+ }
40
+ //# sourceMappingURL=settings.js.map
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@camerontaylor/paseo-plugin",
3
+ "version": "0.8.0-fork.1",
4
+ "description": "Paseo plugin SDK package",
5
+ "files": [
6
+ "dist",
7
+ "!dist/**/*.map"
8
+ ],
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "source": "./src/index.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./server": {
17
+ "types": "./dist/server/index.d.ts",
18
+ "source": "./src/server/index.ts",
19
+ "default": "./dist/server/index.js"
20
+ },
21
+ "./server/provider": {
22
+ "types": "./dist/server/provider.d.ts",
23
+ "source": "./src/server/provider.ts",
24
+ "default": "./dist/server/provider.js"
25
+ },
26
+ "./server/acp": {
27
+ "types": "./dist/server/acp.d.ts",
28
+ "source": "./src/server/acp.ts",
29
+ "default": "./dist/server/acp.js"
30
+ },
31
+ "./client/react-native": {
32
+ "types": "./dist/client/react-native.d.ts",
33
+ "source": "./src/client/react-native.ts",
34
+ "default": "./dist/client/react-native.js"
35
+ },
36
+ "./client/host": {
37
+ "types": "./dist/client/host.d.ts",
38
+ "source": "./src/client/host.ts",
39
+ "default": "./dist/client/host.js"
40
+ },
41
+ "./client/ui": {
42
+ "types": "./dist/client/ui.d.ts",
43
+ "source": "./src/client/ui.ts",
44
+ "default": "./dist/client/ui.js"
45
+ },
46
+ "./client": {
47
+ "types": "./dist/client/index.d.ts",
48
+ "source": "./src/client/index.ts",
49
+ "default": "./dist/client/index.js"
50
+ }
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "scripts": {
56
+ "clean": "node ../../scripts/clean-package-dist.mjs",
57
+ "build": "tsc -p tsconfig.json --incremental false",
58
+ "build:clean": "npm run clean && npm run build",
59
+ "prepack": "npm run build:clean",
60
+ "typecheck": "tsgo --noEmit && tsgo -p tsconfig.examples.json --noEmit",
61
+ "test": "vitest run"
62
+ },
63
+ "dependencies": {
64
+ "@agentclientprotocol/sdk": "^1.4.0",
65
+ "use-sync-external-store": "^1.6.0"
66
+ },
67
+ "devDependencies": {
68
+ "@camerontaylor/paseo-client": "0.8.0-fork.1",
69
+ "@camerontaylor/paseo-protocol": "0.8.0-fork.1",
70
+ "@types/node": "^20.9.0",
71
+ "@types/react": "~19.2.0",
72
+ "react": "19.1.0",
73
+ "react-native": "0.81.5",
74
+ "typescript": "^5.9.3",
75
+ "vitest": "^4.1.6",
76
+ "zod": "^4.4.3"
77
+ },
78
+ "peerDependencies": {
79
+ "@camerontaylor/paseo-client": "0.8.0-fork.1",
80
+ "@camerontaylor/paseo-protocol": "0.8.0-fork.1",
81
+ "react": "~19.1.0",
82
+ "react-native": ">=0.81.5",
83
+ "zod": "^4.4.3"
84
+ },
85
+ "peerDependenciesMeta": {
86
+ "react-native": {
87
+ "optional": true
88
+ }
89
+ }
90
+ }