@agentdock/wire 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +152 -0
  2. package/dist/agentCapabilities.d.ts +30 -0
  3. package/dist/agentCapabilities.d.ts.map +1 -0
  4. package/dist/agentCapabilities.js +103 -0
  5. package/dist/agentCapabilities.js.map +1 -0
  6. package/dist/agentInstallGuide.d.ts +15 -0
  7. package/dist/agentInstallGuide.d.ts.map +1 -0
  8. package/dist/agentInstallGuide.js +63 -0
  9. package/dist/agentInstallGuide.js.map +1 -0
  10. package/dist/agentModels.d.ts +23 -0
  11. package/dist/agentModels.d.ts.map +1 -0
  12. package/dist/agentModels.js +77 -0
  13. package/dist/agentModels.js.map +1 -0
  14. package/dist/controlLevel.d.ts +12 -0
  15. package/dist/controlLevel.d.ts.map +1 -0
  16. package/dist/controlLevel.js +11 -0
  17. package/dist/controlLevel.js.map +1 -0
  18. package/dist/envelope.d.ts +582 -0
  19. package/dist/envelope.d.ts.map +1 -0
  20. package/dist/envelope.js +64 -0
  21. package/dist/envelope.js.map +1 -0
  22. package/dist/events.d.ts +441 -0
  23. package/dist/events.d.ts.map +1 -0
  24. package/dist/events.js +88 -0
  25. package/dist/events.js.map +1 -0
  26. package/dist/index.d.ts +38 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +42 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/interactionEvents.d.ts +182 -0
  31. package/dist/interactionEvents.d.ts.map +1 -0
  32. package/dist/interactionEvents.js +92 -0
  33. package/dist/interactionEvents.js.map +1 -0
  34. package/dist/legacyProtocol.d.ts +385 -0
  35. package/dist/legacyProtocol.d.ts.map +1 -0
  36. package/dist/legacyProtocol.js +30 -0
  37. package/dist/legacyProtocol.js.map +1 -0
  38. package/dist/machine.d.ts +45 -0
  39. package/dist/machine.d.ts.map +1 -0
  40. package/dist/machine.js +28 -0
  41. package/dist/machine.js.map +1 -0
  42. package/dist/messageMeta.d.ts +49 -0
  43. package/dist/messageMeta.d.ts.map +1 -0
  44. package/dist/messageMeta.js +33 -0
  45. package/dist/messageMeta.js.map +1 -0
  46. package/dist/messages.d.ts +1843 -0
  47. package/dist/messages.d.ts.map +1 -0
  48. package/dist/messages.js +35 -0
  49. package/dist/messages.js.map +1 -0
  50. package/dist/pairing.d.ts +133 -0
  51. package/dist/pairing.d.ts.map +1 -0
  52. package/dist/pairing.js +115 -0
  53. package/dist/pairing.js.map +1 -0
  54. package/dist/rpc.d.ts +340 -0
  55. package/dist/rpc.d.ts.map +1 -0
  56. package/dist/rpc.js +115 -0
  57. package/dist/rpc.js.map +1 -0
  58. package/dist/sessionResult.d.ts +40 -0
  59. package/dist/sessionResult.d.ts.map +1 -0
  60. package/dist/sessionResult.js +23 -0
  61. package/dist/sessionResult.js.map +1 -0
  62. package/dist/spawnError.d.ts +40 -0
  63. package/dist/spawnError.d.ts.map +1 -0
  64. package/dist/spawnError.js +31 -0
  65. package/dist/spawnError.js.map +1 -0
  66. package/dist/stats.d.ts +1213 -0
  67. package/dist/stats.d.ts.map +1 -0
  68. package/dist/stats.js +79 -0
  69. package/dist/stats.js.map +1 -0
  70. package/dist/sync.d.ts +721 -0
  71. package/dist/sync.d.ts.map +1 -0
  72. package/dist/sync.js +62 -0
  73. package/dist/sync.js.map +1 -0
  74. package/dist/team.d.ts +1557 -0
  75. package/dist/team.d.ts.map +1 -0
  76. package/dist/team.js +93 -0
  77. package/dist/team.js.map +1 -0
  78. package/dist/utils.d.ts +2 -0
  79. package/dist/utils.d.ts.map +1 -0
  80. package/dist/utils.js +2 -0
  81. package/dist/utils.js.map +1 -0
  82. package/package.json +40 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,2BAA2B;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Message schemas — aligned with Happy messages.ts.
3
+ *
4
+ * SessionMessage: encrypted content container.
5
+ * Timestamps are Unix numbers (milliseconds).
6
+ */
7
+ import { z } from 'zod';
8
+ import { SessionEnvelopeSchema } from './envelope.js';
9
+ import { MessageMetaSchema } from './messageMeta.js';
10
+ import { UserMessageSchema, AgentMessageSchema } from './legacyProtocol.js';
11
+ export const SessionMessageContentSchema = z.object({
12
+ c: z.string(),
13
+ t: z.literal('encrypted'),
14
+ });
15
+ export const SessionMessageSchema = z.object({
16
+ id: z.string(),
17
+ seq: z.number(),
18
+ localId: z.string().nullish(),
19
+ content: SessionMessageContentSchema,
20
+ createdAt: z.number(),
21
+ updatedAt: z.number(),
22
+ });
23
+ // ── SessionProtocolMessage (bridges envelope into message content) ──
24
+ export const SessionProtocolMessageSchema = z.object({
25
+ role: z.literal('session'),
26
+ content: SessionEnvelopeSchema,
27
+ meta: MessageMetaSchema.optional(),
28
+ });
29
+ // ── MessageContent (union of all message content types) ─────────────
30
+ export const MessageContentSchema = z.discriminatedUnion('role', [
31
+ UserMessageSchema,
32
+ AgentMessageSchema,
33
+ SessionProtocolMessageSchema,
34
+ ]);
35
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IACb,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC7B,OAAO,EAAE,2BAA2B;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAIH,uEAAuE;AAEvE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH,uEAAuE;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,iBAAiB;IACjB,kBAAkB;IAClB,4BAA4B;CAC7B,CAAC,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Pairing protocol schemas.
3
+ *
4
+ * Defines the wire format for device pairing:
5
+ * - PairingRequest: CLI sends publicKey + optional PIN to server
6
+ * - PairingResponse: Web sends encrypted payload back via server
7
+ * - PairingStatus: Polling response — discriminated union on state
8
+ *
9
+ * Security: Uses NaCl Box (Curve25519 + XSalsa20-Poly1305) for key exchange.
10
+ * PIN code provides iOS PWA fallback where QR scanning is unreliable.
11
+ */
12
+ import { z } from 'zod';
13
+ /** Pairing state machine. */
14
+ export declare const PairingState: z.ZodEnum<["pending", "exchange", "authorized", "expired"]>;
15
+ /**
16
+ * CLI → Server: initiate a pairing request.
17
+ *
18
+ * publicKey: base64-encoded Curve25519 public key (32 bytes)
19
+ * pin: optional 6-digit PIN for manual entry (iOS PWA fallback)
20
+ * label: optional human-readable device label
21
+ */
22
+ export declare const PairingRequestSchema: z.ZodObject<{
23
+ publicKey: z.ZodEffects<z.ZodString, string, string>;
24
+ pin: z.ZodOptional<z.ZodString>;
25
+ label: z.ZodOptional<z.ZodString>;
26
+ type: z.ZodOptional<z.ZodEnum<["join", "invite"]>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ publicKey: string;
29
+ type?: "join" | "invite" | undefined;
30
+ label?: string | undefined;
31
+ pin?: string | undefined;
32
+ }, {
33
+ publicKey: string;
34
+ type?: "join" | "invite" | undefined;
35
+ label?: string | undefined;
36
+ pin?: string | undefined;
37
+ }>;
38
+ /**
39
+ * Web → Server: approve pairing with encrypted key material.
40
+ *
41
+ * publicKey: identifies which pairing request to respond to (32-byte Curve25519 key)
42
+ * encryptedPayload: NaCl Box encrypted data (base64) containing the DEK
43
+ */
44
+ export declare const PairingResponseSchema: z.ZodObject<{
45
+ publicKey: z.ZodEffects<z.ZodString, string, string>;
46
+ encryptedPayload: z.ZodString;
47
+ }, "strip", z.ZodTypeAny, {
48
+ publicKey: string;
49
+ encryptedPayload: string;
50
+ }, {
51
+ publicKey: string;
52
+ encryptedPayload: string;
53
+ }>;
54
+ /**
55
+ * New device → Server: submit device's temporary Curve25519 public key.
56
+ * Used in invite flow when a new device joins an existing account.
57
+ */
58
+ export declare const PairingExchangeSchema: z.ZodObject<{
59
+ daemonPublicKey: z.ZodEffects<z.ZodString, string, string>;
60
+ devicePublicKey: z.ZodEffects<z.ZodString, string, string>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ daemonPublicKey: string;
63
+ devicePublicKey: string;
64
+ }, {
65
+ daemonPublicKey: string;
66
+ devicePublicKey: string;
67
+ }>;
68
+ /**
69
+ * Daemon → Server: deliver encrypted master secret to new device.
70
+ * Requires Bearer auth. Encrypted via NaCl Box using device's public key.
71
+ */
72
+ export declare const PairingDeliverSchema: z.ZodObject<{
73
+ publicKey: z.ZodEffects<z.ZodString, string, string>;
74
+ encryptedPayload: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ publicKey: string;
77
+ encryptedPayload: string;
78
+ }, {
79
+ publicKey: string;
80
+ encryptedPayload: string;
81
+ }>;
82
+ export declare const PairingStatusSchema: z.ZodDiscriminatedUnion<"state", [z.ZodObject<{
83
+ state: z.ZodLiteral<"pending">;
84
+ publicKey: z.ZodString;
85
+ }, "strip", z.ZodTypeAny, {
86
+ publicKey: string;
87
+ state: "pending";
88
+ }, {
89
+ publicKey: string;
90
+ state: "pending";
91
+ }>, z.ZodObject<{
92
+ state: z.ZodLiteral<"exchange">;
93
+ publicKey: z.ZodString;
94
+ devicePublicKey: z.ZodString;
95
+ }, "strip", z.ZodTypeAny, {
96
+ publicKey: string;
97
+ devicePublicKey: string;
98
+ state: "exchange";
99
+ }, {
100
+ publicKey: string;
101
+ devicePublicKey: string;
102
+ state: "exchange";
103
+ }>, z.ZodObject<{
104
+ state: z.ZodLiteral<"authorized">;
105
+ publicKey: z.ZodString;
106
+ encryptedPayload: z.ZodString;
107
+ token: z.ZodString;
108
+ }, "strip", z.ZodTypeAny, {
109
+ publicKey: string;
110
+ encryptedPayload: string;
111
+ state: "authorized";
112
+ token: string;
113
+ }, {
114
+ publicKey: string;
115
+ encryptedPayload: string;
116
+ state: "authorized";
117
+ token: string;
118
+ }>, z.ZodObject<{
119
+ state: z.ZodLiteral<"expired">;
120
+ publicKey: z.ZodString;
121
+ }, "strip", z.ZodTypeAny, {
122
+ publicKey: string;
123
+ state: "expired";
124
+ }, {
125
+ publicKey: string;
126
+ state: "expired";
127
+ }>]>;
128
+ export type PairingRequest = z.infer<typeof PairingRequestSchema>;
129
+ export type PairingResponse = z.infer<typeof PairingResponseSchema>;
130
+ export type PairingExchange = z.infer<typeof PairingExchangeSchema>;
131
+ export type PairingDeliver = z.infer<typeof PairingDeliverSchema>;
132
+ export type PairingStatus = z.infer<typeof PairingStatusSchema>;
133
+ //# sourceMappingURL=pairing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pairing.d.ts","sourceRoot":"","sources":["../src/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6BAA6B;AAC7B,eAAO,MAAM,YAAY,6DAA2D,CAAC;AA8BrF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAgCH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK9B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Pairing protocol schemas.
3
+ *
4
+ * Defines the wire format for device pairing:
5
+ * - PairingRequest: CLI sends publicKey + optional PIN to server
6
+ * - PairingResponse: Web sends encrypted payload back via server
7
+ * - PairingStatus: Polling response — discriminated union on state
8
+ *
9
+ * Security: Uses NaCl Box (Curve25519 + XSalsa20-Poly1305) for key exchange.
10
+ * PIN code provides iOS PWA fallback where QR scanning is unreliable.
11
+ */
12
+ import { z } from 'zod';
13
+ /** 6-digit numeric PIN for iOS PWA fallback. */
14
+ const PinSchema = z.string().regex(/^\d{6}$/, 'PIN must be exactly 6 digits');
15
+ /** Pairing state machine. */
16
+ export const PairingState = z.enum(['pending', 'exchange', 'authorized', 'expired']);
17
+ /**
18
+ * Validates that a string is a base64/base64url-encoded 32-byte Curve25519 public key.
19
+ * Accepts both standard base64 (with padding) and base64url (without padding).
20
+ */
21
+ /**
22
+ * Check if a base64/base64url string decodes to exactly `expectedBytes` bytes.
23
+ * Uses string-length math: 4 base64 chars = 3 bytes.
24
+ * No runtime decoding needed — just validate charset + length.
25
+ */
26
+ function isBase64OfLength(val, expectedBytes) {
27
+ // Must be non-empty and only valid base64/base64url characters
28
+ if (!/^[A-Za-z0-9+/\-_]+=*$/.test(val))
29
+ return false;
30
+ // Normalize base64url → standard base64
31
+ const b64 = val.replace(/-/g, '+').replace(/_/g, '/');
32
+ const padded = b64.padEnd(b64.length + ((4 - (b64.length % 4)) % 4), '=');
33
+ // Count padding
34
+ const paddingCount = (padded.match(/=+$/) ?? [''])[0].length;
35
+ const totalBytes = (padded.length / 4) * 3 - paddingCount;
36
+ return totalBytes === expectedBytes;
37
+ }
38
+ const Curve25519PublicKeySchema = z
39
+ .string()
40
+ .min(1)
41
+ .refine((val) => isBase64OfLength(val, 32), {
42
+ message: 'publicKey must be a base64-encoded 32-byte Curve25519 key',
43
+ });
44
+ /**
45
+ * CLI → Server: initiate a pairing request.
46
+ *
47
+ * publicKey: base64-encoded Curve25519 public key (32 bytes)
48
+ * pin: optional 6-digit PIN for manual entry (iOS PWA fallback)
49
+ * label: optional human-readable device label
50
+ */
51
+ export const PairingRequestSchema = z.object({
52
+ publicKey: Curve25519PublicKeySchema,
53
+ pin: PinSchema.optional(),
54
+ label: z.string().max(100).optional(),
55
+ type: z.enum(['join', 'invite']).optional(),
56
+ });
57
+ /**
58
+ * Web → Server: approve pairing with encrypted key material.
59
+ *
60
+ * publicKey: identifies which pairing request to respond to (32-byte Curve25519 key)
61
+ * encryptedPayload: NaCl Box encrypted data (base64) containing the DEK
62
+ */
63
+ export const PairingResponseSchema = z.object({
64
+ publicKey: Curve25519PublicKeySchema,
65
+ encryptedPayload: z.string().min(1),
66
+ });
67
+ /**
68
+ * New device → Server: submit device's temporary Curve25519 public key.
69
+ * Used in invite flow when a new device joins an existing account.
70
+ */
71
+ export const PairingExchangeSchema = z.object({
72
+ daemonPublicKey: Curve25519PublicKeySchema,
73
+ devicePublicKey: Curve25519PublicKeySchema,
74
+ });
75
+ /**
76
+ * Daemon → Server: deliver encrypted master secret to new device.
77
+ * Requires Bearer auth. Encrypted via NaCl Box using device's public key.
78
+ */
79
+ export const PairingDeliverSchema = z.object({
80
+ publicKey: Curve25519PublicKeySchema,
81
+ encryptedPayload: z.string().min(1),
82
+ });
83
+ /**
84
+ * Server → CLI: current pairing status (polled).
85
+ * Discriminated union on `state`:
86
+ * - pending: waiting for web approval
87
+ * - authorized: web approved, encryptedPayload + token required
88
+ * - expired: request timed out
89
+ */
90
+ const PairingStatusPending = z.object({
91
+ state: z.literal('pending'),
92
+ publicKey: z.string().min(1),
93
+ });
94
+ const PairingStatusExchange = z.object({
95
+ state: z.literal('exchange'),
96
+ publicKey: z.string().min(1),
97
+ devicePublicKey: z.string().min(1),
98
+ });
99
+ const PairingStatusAuthorized = z.object({
100
+ state: z.literal('authorized'),
101
+ publicKey: z.string().min(1),
102
+ encryptedPayload: z.string().min(1),
103
+ token: z.string().min(1),
104
+ });
105
+ const PairingStatusExpired = z.object({
106
+ state: z.literal('expired'),
107
+ publicKey: z.string().min(1),
108
+ });
109
+ export const PairingStatusSchema = z.discriminatedUnion('state', [
110
+ PairingStatusPending,
111
+ PairingStatusExchange,
112
+ PairingStatusAuthorized,
113
+ PairingStatusExpired,
114
+ ]);
115
+ //# sourceMappingURL=pairing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pairing.js","sourceRoot":"","sources":["../src/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,8BAA8B,CAAC,CAAC;AAE9E,6BAA6B;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;AAErF;;;GAGG;AACH;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAW,EAAE,aAAqB;IAC1D,+DAA+D;IAC/D,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,wCAAwC;IACxC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1E,gBAAgB;IAChB,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC7D,MAAM,UAAU,GAAG,CAAC,MAAM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 'zod';
2
+ export declare const RpcMethod: z.ZodEnum<["spawn-session", "stop-session", "abort", "switch-mode", "approve-permission", "deny-permission", "answer-question", "shutdown-daemon", "get-messages", "get-stats", "get-team-stats", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings"]>;
3
+ /**
4
+ * Session-scoped RPC methods — registered by `agentbox start` (CLI process).
5
+ * These operate on a specific session and require the CLI to be running.
6
+ */
7
+ export declare const SESSION_RPC_METHODS: readonly ["answer-question", "approve-permission", "deny-permission", "abort", "stop-session"];
8
+ /**
9
+ * Machine-scoped RPC methods — registered by the persistent daemon only.
10
+ * These are account/machine-level operations independent of any session.
11
+ */
12
+ export declare const MACHINE_RPC_METHODS: readonly ["start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings"];
13
+ /**
14
+ * All RPC methods that must be registered for Web UI to function.
15
+ * Daemon registers MACHINE_RPC_METHODS; CLI registers SESSION_RPC_METHODS.
16
+ *
17
+ * @deprecated Use SESSION_RPC_METHODS or MACHINE_RPC_METHODS directly.
18
+ */
19
+ export declare const DAEMON_REQUIRED_RPC_METHODS: readonly ["answer-question", "approve-permission", "deny-permission", "abort", "stop-session", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings"];
20
+ export declare const RpcCallSchema: z.ZodObject<{
21
+ method: z.ZodString;
22
+ params: z.ZodUnknown;
23
+ timeout: z.ZodDefault<z.ZodNumber>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ method: string;
26
+ timeout: number;
27
+ params?: unknown;
28
+ }, {
29
+ method: string;
30
+ params?: unknown;
31
+ timeout?: number | undefined;
32
+ }>;
33
+ export declare const RpcResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
34
+ ok: z.ZodLiteral<true>;
35
+ result: z.ZodUnknown;
36
+ }, "strip", z.ZodTypeAny, {
37
+ ok: true;
38
+ result?: unknown;
39
+ }, {
40
+ ok: true;
41
+ result?: unknown;
42
+ }>, z.ZodObject<{
43
+ ok: z.ZodLiteral<false>;
44
+ error: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ error: string;
47
+ ok: false;
48
+ }, {
49
+ error: string;
50
+ ok: false;
51
+ }>]>;
52
+ export declare const SpawnSessionParamsSchema: z.ZodObject<{
53
+ cli: z.ZodEnum<["claude", "copilot", "opencode", "codex", "gemini", "qwen"]>;
54
+ cwd: z.ZodString;
55
+ prompt: z.ZodOptional<z.ZodString>;
56
+ permissionMode: z.ZodDefault<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
57
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
58
+ model: z.ZodOptional<z.ZodString>;
59
+ baseUrl: z.ZodOptional<z.ZodString>;
60
+ /** System prompt text appended to the agent's built-in system prompt. */
61
+ appendSystemPrompt: z.ZodOptional<z.ZodString>;
62
+ /** Restrict agent to only these tools (Claude CLI --allowedTools). */
63
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
+ /** Deny agent from using these tools (Claude CLI --disallowedTools). */
65
+ disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
66
+ /** MCP server config JSON string (Claude CLI --mcp-config). */
67
+ mcpConfig: z.ZodOptional<z.ZodString>;
68
+ /** Resume a previous session by ID (Claude CLI --resume). */
69
+ resumeSessionId: z.ZodOptional<z.ZodString>;
70
+ /** Server session ID to reuse (skip creating new session on resume). */
71
+ serverSessionId: z.ZodOptional<z.ZodString>;
72
+ /** Maximum conversation turns before auto-stop (Claude CLI --max-turns). */
73
+ maxTurns: z.ZodOptional<z.ZodNumber>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ permissionMode: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo";
76
+ cli: "claude" | "copilot" | "opencode" | "codex" | "gemini" | "qwen";
77
+ cwd: string;
78
+ model?: string | undefined;
79
+ appendSystemPrompt?: string | undefined;
80
+ allowedTools?: string[] | undefined;
81
+ disallowedTools?: string[] | undefined;
82
+ prompt?: string | undefined;
83
+ env?: Record<string, string> | undefined;
84
+ baseUrl?: string | undefined;
85
+ mcpConfig?: string | undefined;
86
+ resumeSessionId?: string | undefined;
87
+ serverSessionId?: string | undefined;
88
+ maxTurns?: number | undefined;
89
+ }, {
90
+ cli: "claude" | "copilot" | "opencode" | "codex" | "gemini" | "qwen";
91
+ cwd: string;
92
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
93
+ model?: string | undefined;
94
+ appendSystemPrompt?: string | undefined;
95
+ allowedTools?: string[] | undefined;
96
+ disallowedTools?: string[] | undefined;
97
+ prompt?: string | undefined;
98
+ env?: Record<string, string> | undefined;
99
+ baseUrl?: string | undefined;
100
+ mcpConfig?: string | undefined;
101
+ resumeSessionId?: string | undefined;
102
+ serverSessionId?: string | undefined;
103
+ maxTurns?: number | undefined;
104
+ }>;
105
+ export declare const GetMessagesParamsSchema: z.ZodObject<{
106
+ sessionId: z.ZodString;
107
+ fromSeq: z.ZodOptional<z.ZodNumber>;
108
+ limit: z.ZodDefault<z.ZodNumber>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ sessionId: string;
111
+ limit: number;
112
+ fromSeq?: number | undefined;
113
+ }, {
114
+ sessionId: string;
115
+ fromSeq?: number | undefined;
116
+ limit?: number | undefined;
117
+ }>;
118
+ export declare const GetMessagesResponseSchema: z.ZodObject<{
119
+ messages: z.ZodArray<z.ZodObject<{
120
+ id: z.ZodString;
121
+ seq: z.ZodNumber;
122
+ localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ content: z.ZodObject<{
124
+ c: z.ZodString;
125
+ t: z.ZodLiteral<"encrypted">;
126
+ }, "strip", z.ZodTypeAny, {
127
+ t: "encrypted";
128
+ c: string;
129
+ }, {
130
+ t: "encrypted";
131
+ c: string;
132
+ }>;
133
+ createdAt: z.ZodNumber;
134
+ updatedAt: z.ZodNumber;
135
+ }, "strip", z.ZodTypeAny, {
136
+ id: string;
137
+ createdAt: number;
138
+ content: {
139
+ t: "encrypted";
140
+ c: string;
141
+ };
142
+ seq: number;
143
+ updatedAt: number;
144
+ localId?: string | null | undefined;
145
+ }, {
146
+ id: string;
147
+ createdAt: number;
148
+ content: {
149
+ t: "encrypted";
150
+ c: string;
151
+ };
152
+ seq: number;
153
+ updatedAt: number;
154
+ localId?: string | null | undefined;
155
+ }>, "many">;
156
+ total: z.ZodNumber;
157
+ hasMore: z.ZodBoolean;
158
+ }, "strip", z.ZodTypeAny, {
159
+ messages: {
160
+ id: string;
161
+ createdAt: number;
162
+ content: {
163
+ t: "encrypted";
164
+ c: string;
165
+ };
166
+ seq: number;
167
+ updatedAt: number;
168
+ localId?: string | null | undefined;
169
+ }[];
170
+ total: number;
171
+ hasMore: boolean;
172
+ }, {
173
+ messages: {
174
+ id: string;
175
+ createdAt: number;
176
+ content: {
177
+ t: "encrypted";
178
+ c: string;
179
+ };
180
+ seq: number;
181
+ updatedAt: number;
182
+ localId?: string | null | undefined;
183
+ }[];
184
+ total: number;
185
+ hasMore: boolean;
186
+ }>;
187
+ export declare const MachineInfoResponseSchema: z.ZodObject<{
188
+ homedir: z.ZodString;
189
+ recentCwds: z.ZodArray<z.ZodString, "many">;
190
+ availableAgents: z.ZodArray<z.ZodString, "many">;
191
+ }, "strip", z.ZodTypeAny, {
192
+ homedir: string;
193
+ recentCwds: string[];
194
+ availableAgents: string[];
195
+ }, {
196
+ homedir: string;
197
+ recentCwds: string[];
198
+ availableAgents: string[];
199
+ }>;
200
+ export declare const AgentEnvConfigSchema: z.ZodObject<{
201
+ httpProxy: z.ZodOptional<z.ZodString>;
202
+ httpsProxy: z.ZodOptional<z.ZodString>;
203
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ httpProxy?: string | undefined;
206
+ httpsProxy?: string | undefined;
207
+ customEnv?: Record<string, string> | undefined;
208
+ }, {
209
+ httpProxy?: string | undefined;
210
+ httpsProxy?: string | undefined;
211
+ customEnv?: Record<string, string> | undefined;
212
+ }>;
213
+ export declare const AgentSettingsSchema: z.ZodObject<{
214
+ claude: z.ZodOptional<z.ZodObject<{
215
+ httpProxy: z.ZodOptional<z.ZodString>;
216
+ httpsProxy: z.ZodOptional<z.ZodString>;
217
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ httpProxy?: string | undefined;
220
+ httpsProxy?: string | undefined;
221
+ customEnv?: Record<string, string> | undefined;
222
+ }, {
223
+ httpProxy?: string | undefined;
224
+ httpsProxy?: string | undefined;
225
+ customEnv?: Record<string, string> | undefined;
226
+ }>>;
227
+ copilot: z.ZodOptional<z.ZodObject<{
228
+ httpProxy: z.ZodOptional<z.ZodString>;
229
+ httpsProxy: z.ZodOptional<z.ZodString>;
230
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ httpProxy?: string | undefined;
233
+ httpsProxy?: string | undefined;
234
+ customEnv?: Record<string, string> | undefined;
235
+ }, {
236
+ httpProxy?: string | undefined;
237
+ httpsProxy?: string | undefined;
238
+ customEnv?: Record<string, string> | undefined;
239
+ }>>;
240
+ codex: z.ZodOptional<z.ZodObject<{
241
+ httpProxy: z.ZodOptional<z.ZodString>;
242
+ httpsProxy: z.ZodOptional<z.ZodString>;
243
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ httpProxy?: string | undefined;
246
+ httpsProxy?: string | undefined;
247
+ customEnv?: Record<string, string> | undefined;
248
+ }, {
249
+ httpProxy?: string | undefined;
250
+ httpsProxy?: string | undefined;
251
+ customEnv?: Record<string, string> | undefined;
252
+ }>>;
253
+ gemini: z.ZodOptional<z.ZodObject<{
254
+ httpProxy: z.ZodOptional<z.ZodString>;
255
+ httpsProxy: z.ZodOptional<z.ZodString>;
256
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ httpProxy?: string | undefined;
259
+ httpsProxy?: string | undefined;
260
+ customEnv?: Record<string, string> | undefined;
261
+ }, {
262
+ httpProxy?: string | undefined;
263
+ httpsProxy?: string | undefined;
264
+ customEnv?: Record<string, string> | undefined;
265
+ }>>;
266
+ opencode: z.ZodOptional<z.ZodObject<{
267
+ httpProxy: z.ZodOptional<z.ZodString>;
268
+ httpsProxy: z.ZodOptional<z.ZodString>;
269
+ customEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ httpProxy?: string | undefined;
272
+ httpsProxy?: string | undefined;
273
+ customEnv?: Record<string, string> | undefined;
274
+ }, {
275
+ httpProxy?: string | undefined;
276
+ httpsProxy?: string | undefined;
277
+ customEnv?: Record<string, string> | undefined;
278
+ }>>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ claude?: {
281
+ httpProxy?: string | undefined;
282
+ httpsProxy?: string | undefined;
283
+ customEnv?: Record<string, string> | undefined;
284
+ } | undefined;
285
+ copilot?: {
286
+ httpProxy?: string | undefined;
287
+ httpsProxy?: string | undefined;
288
+ customEnv?: Record<string, string> | undefined;
289
+ } | undefined;
290
+ opencode?: {
291
+ httpProxy?: string | undefined;
292
+ httpsProxy?: string | undefined;
293
+ customEnv?: Record<string, string> | undefined;
294
+ } | undefined;
295
+ codex?: {
296
+ httpProxy?: string | undefined;
297
+ httpsProxy?: string | undefined;
298
+ customEnv?: Record<string, string> | undefined;
299
+ } | undefined;
300
+ gemini?: {
301
+ httpProxy?: string | undefined;
302
+ httpsProxy?: string | undefined;
303
+ customEnv?: Record<string, string> | undefined;
304
+ } | undefined;
305
+ }, {
306
+ claude?: {
307
+ httpProxy?: string | undefined;
308
+ httpsProxy?: string | undefined;
309
+ customEnv?: Record<string, string> | undefined;
310
+ } | undefined;
311
+ copilot?: {
312
+ httpProxy?: string | undefined;
313
+ httpsProxy?: string | undefined;
314
+ customEnv?: Record<string, string> | undefined;
315
+ } | undefined;
316
+ opencode?: {
317
+ httpProxy?: string | undefined;
318
+ httpsProxy?: string | undefined;
319
+ customEnv?: Record<string, string> | undefined;
320
+ } | undefined;
321
+ codex?: {
322
+ httpProxy?: string | undefined;
323
+ httpsProxy?: string | undefined;
324
+ customEnv?: Record<string, string> | undefined;
325
+ } | undefined;
326
+ gemini?: {
327
+ httpProxy?: string | undefined;
328
+ httpsProxy?: string | undefined;
329
+ customEnv?: Record<string, string> | undefined;
330
+ } | undefined;
331
+ }>;
332
+ export type RpcCall = z.infer<typeof RpcCallSchema>;
333
+ export type RpcResult = z.infer<typeof RpcResultSchema>;
334
+ export type SpawnSessionParams = z.infer<typeof SpawnSessionParamsSchema>;
335
+ export type GetMessagesParams = z.infer<typeof GetMessagesParamsSchema>;
336
+ export type GetMessagesResponse = z.infer<typeof GetMessagesResponseSchema>;
337
+ export type MachineInfoResponse = z.infer<typeof MachineInfoResponseSchema>;
338
+ export type AgentEnvConfig = z.infer<typeof AgentEnvConfigSchema>;
339
+ export type AgentSettings = z.infer<typeof AgentSettingsSchema>;
340
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,SAAS,oRAgBpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gGAMyB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,2FAKyB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,gLAGiB,CAAC;AAE1D,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;IA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