@agentdock/wire 0.0.46 → 0.0.48

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 (108) hide show
  1. package/README.md +1 -1
  2. package/dist/agentCapabilities.js +1 -195
  3. package/dist/agentCommonEnv.js +1 -20
  4. package/dist/agentInstallGuide.js +1 -81
  5. package/dist/checkpointSchemas.js +1 -46
  6. package/dist/controlLevel.js +1 -11
  7. package/dist/edition.js +1 -13
  8. package/dist/envelope.d.ts +35 -1
  9. package/dist/envelope.js +1 -78
  10. package/dist/errorMessage.js +1 -6
  11. package/dist/events.d.ts +37 -1
  12. package/dist/events.js +1 -97
  13. package/dist/features.js +1 -112
  14. package/dist/feedback.d.ts +23 -5
  15. package/dist/feedback.js +1 -26
  16. package/dist/index.d.ts +7 -7
  17. package/dist/index.js +1 -64
  18. package/dist/interactionEvents.js +1 -108
  19. package/dist/legacyProtocol.d.ts +1 -1
  20. package/dist/legacyProtocol.js +1 -30
  21. package/dist/license.d.ts +100 -11
  22. package/dist/license.js +1 -17
  23. package/dist/machine.d.ts +8 -0
  24. package/dist/machine.js +1 -56
  25. package/dist/messageMeta.js +1 -60
  26. package/dist/messages.d.ts +85 -1
  27. package/dist/messages.js +1 -35
  28. package/dist/ops.js +1 -74
  29. package/dist/pairing.d.ts +10 -0
  30. package/dist/pairing.js +1 -115
  31. package/dist/protocol.js +1 -7
  32. package/dist/rpc.js +1 -246
  33. package/dist/scheduledTasks.js +1 -81
  34. package/dist/semver.js +1 -60
  35. package/dist/sessionResult.js +1 -23
  36. package/dist/socketEvents.d.ts +3 -0
  37. package/dist/socketEvents.js +1 -44
  38. package/dist/spawnError.js +1 -31
  39. package/dist/stats.d.ts +27 -422
  40. package/dist/stats.js +1 -126
  41. package/dist/sync.d.ts +47 -1
  42. package/dist/sync.js +1 -78
  43. package/dist/telemetry.d.ts +9 -9
  44. package/dist/telemetry.js +1 -80
  45. package/dist/utils.js +1 -2
  46. package/package.json +2 -2
  47. package/dist/agentCapabilities.d.ts.map +0 -1
  48. package/dist/agentCapabilities.js.map +0 -1
  49. package/dist/agentCommonEnv.d.ts.map +0 -1
  50. package/dist/agentCommonEnv.js.map +0 -1
  51. package/dist/agentInstallGuide.d.ts.map +0 -1
  52. package/dist/agentInstallGuide.js.map +0 -1
  53. package/dist/checkpointSchemas.d.ts.map +0 -1
  54. package/dist/checkpointSchemas.js.map +0 -1
  55. package/dist/controlLevel.d.ts.map +0 -1
  56. package/dist/controlLevel.js.map +0 -1
  57. package/dist/edition.d.ts.map +0 -1
  58. package/dist/edition.js.map +0 -1
  59. package/dist/envelope.d.ts.map +0 -1
  60. package/dist/envelope.js.map +0 -1
  61. package/dist/errorMessage.d.ts.map +0 -1
  62. package/dist/errorMessage.js.map +0 -1
  63. package/dist/events.d.ts.map +0 -1
  64. package/dist/events.js.map +0 -1
  65. package/dist/features.d.ts.map +0 -1
  66. package/dist/features.js.map +0 -1
  67. package/dist/feedback.d.ts.map +0 -1
  68. package/dist/feedback.js.map +0 -1
  69. package/dist/index.d.ts.map +0 -1
  70. package/dist/index.js.map +0 -1
  71. package/dist/interactionEvents.d.ts.map +0 -1
  72. package/dist/interactionEvents.js.map +0 -1
  73. package/dist/legacyProtocol.d.ts.map +0 -1
  74. package/dist/legacyProtocol.js.map +0 -1
  75. package/dist/license.d.ts.map +0 -1
  76. package/dist/license.js.map +0 -1
  77. package/dist/machine.d.ts.map +0 -1
  78. package/dist/machine.js.map +0 -1
  79. package/dist/messageMeta.d.ts.map +0 -1
  80. package/dist/messageMeta.js.map +0 -1
  81. package/dist/messages.d.ts.map +0 -1
  82. package/dist/messages.js.map +0 -1
  83. package/dist/ops.d.ts.map +0 -1
  84. package/dist/ops.js.map +0 -1
  85. package/dist/pairing.d.ts.map +0 -1
  86. package/dist/pairing.js.map +0 -1
  87. package/dist/protocol.d.ts.map +0 -1
  88. package/dist/protocol.js.map +0 -1
  89. package/dist/rpc.d.ts.map +0 -1
  90. package/dist/rpc.js.map +0 -1
  91. package/dist/scheduledTasks.d.ts.map +0 -1
  92. package/dist/scheduledTasks.js.map +0 -1
  93. package/dist/semver.d.ts.map +0 -1
  94. package/dist/semver.js.map +0 -1
  95. package/dist/sessionResult.d.ts.map +0 -1
  96. package/dist/sessionResult.js.map +0 -1
  97. package/dist/socketEvents.d.ts.map +0 -1
  98. package/dist/socketEvents.js.map +0 -1
  99. package/dist/spawnError.d.ts.map +0 -1
  100. package/dist/spawnError.js.map +0 -1
  101. package/dist/stats.d.ts.map +0 -1
  102. package/dist/stats.js.map +0 -1
  103. package/dist/sync.d.ts.map +0 -1
  104. package/dist/sync.js.map +0 -1
  105. package/dist/telemetry.d.ts.map +0 -1
  106. package/dist/telemetry.js.map +0 -1
  107. package/dist/utils.d.ts.map +0 -1
  108. package/dist/utils.js.map +0 -1
package/dist/license.d.ts CHANGED
@@ -1,52 +1,141 @@
1
1
  import { z } from 'zod';
2
- export declare const LicensePayloadSchema: z.ZodObject<{
2
+ export declare const EnterpriseLicenseSchema: z.ZodObject<{
3
3
  licensee: z.ZodString;
4
- edition: z.ZodLiteral<"enterprise">;
5
- maxUsers: z.ZodNumber;
6
4
  expiresAt: z.ZodString;
7
5
  issuedAt: z.ZodString;
6
+ } & {
7
+ edition: z.ZodLiteral<"enterprise">;
8
+ maxUsers: z.ZodNumber;
8
9
  suffix: z.ZodString;
9
10
  }, "strip", z.ZodTypeAny, {
10
11
  licensee: string;
12
+ expiresAt: string;
13
+ issuedAt: string;
11
14
  edition: "enterprise";
12
15
  maxUsers: number;
16
+ suffix: string;
17
+ }, {
18
+ licensee: string;
13
19
  expiresAt: string;
14
20
  issuedAt: string;
21
+ edition: "enterprise";
22
+ maxUsers: number;
15
23
  suffix: string;
24
+ }>;
25
+ export declare const PrivateLicenseSchema: z.ZodObject<{
26
+ licensee: z.ZodString;
27
+ expiresAt: z.ZodString;
28
+ issuedAt: z.ZodString;
29
+ } & {
30
+ edition: z.ZodLiteral<"personal">;
31
+ domain: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ licensee: string;
34
+ expiresAt: string;
35
+ issuedAt: string;
36
+ edition: "personal";
37
+ domain: string;
16
38
  }, {
17
39
  licensee: string;
40
+ expiresAt: string;
41
+ issuedAt: string;
42
+ edition: "personal";
43
+ domain: string;
44
+ }>;
45
+ export declare const LicensePayloadSchema: z.ZodDiscriminatedUnion<"edition", [z.ZodObject<{
46
+ licensee: z.ZodString;
47
+ expiresAt: z.ZodString;
48
+ issuedAt: z.ZodString;
49
+ } & {
50
+ edition: z.ZodLiteral<"enterprise">;
51
+ maxUsers: z.ZodNumber;
52
+ suffix: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ licensee: string;
55
+ expiresAt: string;
56
+ issuedAt: string;
18
57
  edition: "enterprise";
19
58
  maxUsers: number;
59
+ suffix: string;
60
+ }, {
61
+ licensee: string;
20
62
  expiresAt: string;
21
63
  issuedAt: string;
64
+ edition: "enterprise";
65
+ maxUsers: number;
22
66
  suffix: string;
23
- }>;
67
+ }>, z.ZodObject<{
68
+ licensee: z.ZodString;
69
+ expiresAt: z.ZodString;
70
+ issuedAt: z.ZodString;
71
+ } & {
72
+ edition: z.ZodLiteral<"personal">;
73
+ domain: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ licensee: string;
76
+ expiresAt: string;
77
+ issuedAt: string;
78
+ edition: "personal";
79
+ domain: string;
80
+ }, {
81
+ licensee: string;
82
+ expiresAt: string;
83
+ issuedAt: string;
84
+ edition: "personal";
85
+ domain: string;
86
+ }>]>;
24
87
  export type LicensePayload = z.infer<typeof LicensePayloadSchema>;
25
- export declare const LicenseFileSchema: z.ZodObject<{
88
+ export type EnterpriseLicensePayload = z.infer<typeof EnterpriseLicenseSchema>;
89
+ export type PrivateLicensePayload = z.infer<typeof PrivateLicenseSchema>;
90
+ export declare const LicenseFileSchema: z.ZodDiscriminatedUnion<"edition", [z.ZodObject<{
26
91
  licensee: z.ZodString;
27
- edition: z.ZodLiteral<"enterprise">;
28
- maxUsers: z.ZodNumber;
29
92
  expiresAt: z.ZodString;
30
93
  issuedAt: z.ZodString;
94
+ } & {
95
+ edition: z.ZodLiteral<"enterprise">;
96
+ maxUsers: z.ZodNumber;
31
97
  suffix: z.ZodString;
32
98
  } & {
33
99
  signature: z.ZodString;
34
100
  }, "strip", z.ZodTypeAny, {
35
101
  licensee: string;
36
- edition: "enterprise";
37
- maxUsers: number;
38
102
  expiresAt: string;
39
103
  issuedAt: string;
104
+ edition: "enterprise";
105
+ maxUsers: number;
40
106
  suffix: string;
41
107
  signature: string;
42
108
  }, {
43
109
  licensee: string;
110
+ expiresAt: string;
111
+ issuedAt: string;
44
112
  edition: "enterprise";
45
113
  maxUsers: number;
114
+ suffix: string;
115
+ signature: string;
116
+ }>, z.ZodObject<{
117
+ licensee: z.ZodString;
118
+ expiresAt: z.ZodString;
119
+ issuedAt: z.ZodString;
120
+ } & {
121
+ edition: z.ZodLiteral<"personal">;
122
+ domain: z.ZodString;
123
+ } & {
124
+ signature: z.ZodString;
125
+ }, "strip", z.ZodTypeAny, {
126
+ licensee: string;
46
127
  expiresAt: string;
47
128
  issuedAt: string;
48
- suffix: string;
129
+ edition: "personal";
130
+ domain: string;
49
131
  signature: string;
50
- }>;
132
+ }, {
133
+ licensee: string;
134
+ expiresAt: string;
135
+ issuedAt: string;
136
+ edition: "personal";
137
+ domain: string;
138
+ signature: string;
139
+ }>]>;
51
140
  export type LicenseFile = z.infer<typeof LicenseFileSchema>;
52
141
  //# sourceMappingURL=license.d.ts.map
package/dist/license.js CHANGED
@@ -1,17 +1 @@
1
- import { z } from 'zod';
2
- export const LicensePayloadSchema = z.object({
3
- licensee: z.string().min(1),
4
- edition: z.literal('enterprise'),
5
- maxUsers: z.number().int().positive(),
6
- expiresAt: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
7
- issuedAt: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
8
- suffix: z
9
- .string()
10
- .min(1)
11
- .max(32)
12
- .regex(/^[a-z0-9_-]+$/),
13
- });
14
- export const LicenseFileSchema = LicensePayloadSchema.extend({
15
- signature: z.string().min(1),
16
- });
17
- //# sourceMappingURL=license.js.map
1
+ "use strict";import{z as e}from"zod";const i=e.object({licensee:e.string().min(1),expiresAt:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),issuedAt:e.string().regex(/^\d{4}-\d{2}-\d{2}$/)});export const EnterpriseLicenseSchema=i.extend({edition:e.literal("enterprise"),maxUsers:e.number().int().positive(),suffix:e.string().min(1).max(32).regex(/^[a-z0-9_-]+$/)}),PrivateLicenseSchema=i.extend({edition:e.literal("personal"),domain:e.string().min(1)}),LicensePayloadSchema=e.discriminatedUnion("edition",[EnterpriseLicenseSchema,PrivateLicenseSchema]),LicenseFileSchema=e.discriminatedUnion("edition",[EnterpriseLicenseSchema.extend({signature:e.string().min(1)}),PrivateLicenseSchema.extend({signature:e.string().min(1)})]);
package/dist/machine.d.ts CHANGED
@@ -28,6 +28,8 @@ export declare const MachineSummarySchema: z.ZodObject<{
28
28
  totalSessions: z.ZodOptional<z.ZodNumber>;
29
29
  /** Agent types available on this machine (persisted on each daemon connect). */
30
30
  availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
+ /** Agent versions keyed by agent type name (e.g. { claude: "1.2.3" }). */
32
+ agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
31
33
  /** RPC methods this machine's daemon has registered (RFC-035). */
32
34
  supportedMethods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
33
35
  /** Why the machine disconnected — 'upgrade-required' triggers UI upgrade prompts (RFC-037). */
@@ -38,6 +40,8 @@ export declare const MachineSummarySchema: z.ZodObject<{
38
40
  upgradeError: z.ZodOptional<z.ZodString>;
39
41
  /** True when this machine has been replaced by a new one (container rebuild). */
40
42
  superseded: z.ZodOptional<z.ZodBoolean>;
43
+ /** Content derivation version: 0=Happy EnCoder (legacy), 1=CCPark EnCoder. */
44
+ derivationVersion: z.ZodOptional<z.ZodNumber>;
41
45
  }, "strip", z.ZodTypeAny, {
42
46
  id: string;
43
47
  createdAt: number;
@@ -52,11 +56,13 @@ export declare const MachineSummarySchema: z.ZodObject<{
52
56
  hasTerminal?: boolean | undefined;
53
57
  activeSessions?: number | undefined;
54
58
  totalSessions?: number | undefined;
59
+ agentVersions?: Record<string, string> | undefined;
55
60
  supportedMethods?: string[] | undefined;
56
61
  disconnectReason?: "normal" | "upgrade-required" | undefined;
57
62
  upgradeStatus?: "idle" | "failed" | "preflight" | "downloading" | "switching" | undefined;
58
63
  upgradeError?: string | undefined;
59
64
  superseded?: boolean | undefined;
65
+ derivationVersion?: number | undefined;
60
66
  }, {
61
67
  id: string;
62
68
  createdAt: number;
@@ -71,11 +77,13 @@ export declare const MachineSummarySchema: z.ZodObject<{
71
77
  hasTerminal?: boolean | undefined;
72
78
  activeSessions?: number | undefined;
73
79
  totalSessions?: number | undefined;
80
+ agentVersions?: Record<string, string> | undefined;
74
81
  supportedMethods?: string[] | undefined;
75
82
  disconnectReason?: "normal" | "upgrade-required" | undefined;
76
83
  upgradeStatus?: "idle" | "failed" | "preflight" | "downloading" | "switching" | undefined;
77
84
  upgradeError?: string | undefined;
78
85
  superseded?: boolean | undefined;
86
+ derivationVersion?: number | undefined;
79
87
  }>;
80
88
  export type MachineSummary = z.infer<typeof MachineSummarySchema>;
81
89
  export declare const MachineRegisterResultSchema: z.ZodObject<{
package/dist/machine.js CHANGED
@@ -1,56 +1 @@
1
- /**
2
- * Machine and session status schemas for Dashboard & Machine Management.
3
- *
4
- * MachineSummary — device info returned by GET /v1/machines.
5
- * SessionStatus — real-time session state indicator.
6
- * Platform — OS platform enum matching Node's process.platform.
7
- */
8
- import { z } from 'zod';
9
- import { LabsSettingsSchema } from './rpc.js';
10
- export const PlatformSchema = z.enum(['darwin', 'linux', 'win32']);
11
- export const SessionStatusSchema = z.enum([
12
- 'idle',
13
- 'thinking',
14
- 'tool_running',
15
- 'permission_required',
16
- 'disconnected',
17
- ]);
18
- export const MachineSummarySchema = z.object({
19
- id: z.string(),
20
- hostname: z.string(),
21
- platform: PlatformSchema,
22
- arch: z.string().optional(),
23
- displayName: z.string().optional(),
24
- daemonVersion: z.string().optional(),
25
- active: z.boolean(),
26
- activeAt: z.number(),
27
- createdAt: z.number(),
28
- /** Whether this machine has an active terminal-server tunnel. */
29
- hasTerminal: z.boolean().optional(),
30
- /** Number of active sessions on this machine. */
31
- activeSessions: z.number().optional(),
32
- /** Total number of sessions on this machine. */
33
- totalSessions: z.number().optional(),
34
- /** Agent types available on this machine (persisted on each daemon connect). */
35
- availableAgents: z.array(z.string()).optional(),
36
- /** RPC methods this machine's daemon has registered (RFC-035). */
37
- supportedMethods: z.array(z.string()).optional(),
38
- /** Why the machine disconnected — 'upgrade-required' triggers UI upgrade prompts (RFC-037). */
39
- disconnectReason: z.enum(['normal', 'upgrade-required']).optional(),
40
- /** Current upgrade state reported by the daemon (RFC-042). */
41
- upgradeStatus: z.enum(['idle', 'preflight', 'downloading', 'switching', 'failed']).optional(),
42
- /** Error message when upgradeStatus is 'failed' (RFC-042). */
43
- upgradeError: z.string().optional(),
44
- /** True when this machine has been replaced by a new one (container rebuild). */
45
- superseded: z.boolean().optional(),
46
- });
47
- export const MachineRegisterResultSchema = z.object({
48
- ok: z.boolean(),
49
- error: z.string().optional(),
50
- latestVersion: z.string().optional(),
51
- labsSettings: LabsSettingsSchema.optional(),
52
- });
53
- export const SetDefaultMachineBodySchema = z.object({
54
- machineId: z.string().nullable(),
55
- });
56
- //# sourceMappingURL=machine.js.map
1
+ "use strict";import{z as o}from"zod";import{LabsSettingsSchema as n}from"./rpc.js";export const PlatformSchema=o.enum(["darwin","linux","win32"]),SessionStatusSchema=o.enum(["idle","thinking","tool_running","permission_required","disconnected"]),MachineSummarySchema=o.object({id:o.string(),hostname:o.string(),platform:PlatformSchema,arch:o.string().optional(),displayName:o.string().optional(),daemonVersion:o.string().optional(),active:o.boolean(),activeAt:o.number(),createdAt:o.number(),hasTerminal:o.boolean().optional(),activeSessions:o.number().optional(),totalSessions:o.number().optional(),availableAgents:o.array(o.string()).optional(),agentVersions:o.record(o.string()).optional(),supportedMethods:o.array(o.string()).optional(),disconnectReason:o.enum(["normal","upgrade-required"]).optional(),upgradeStatus:o.enum(["idle","preflight","downloading","switching","failed"]).optional(),upgradeError:o.string().optional(),superseded:o.boolean().optional(),derivationVersion:o.number().int().min(0).optional()}),MachineRegisterResultSchema=o.object({ok:o.boolean(),error:o.string().optional(),latestVersion:o.string().optional(),labsSettings:n.optional()}),SetDefaultMachineBodySchema=o.object({machineId:o.string().nullable()});
@@ -1,60 +1 @@
1
- import { z } from 'zod';
2
- import { PermissionModeSchema } from './interactionEvents.js';
3
- /** Supported agent types for avatar and UI differentiation. */
4
- export const AgentTypeSchema = z.enum([
5
- 'claude',
6
- 'copilot',
7
- 'codex',
8
- 'gemini',
9
- 'opencode',
10
- 'hermes',
11
- 'openclaw',
12
- 'custom',
13
- ]);
14
- /** All agent type values derived from the schema (single source of truth). */
15
- export const AGENT_TYPES = AgentTypeSchema.options;
16
- /** Agent types that can be spawned as sessions (excludes 'custom'). */
17
- export const SPAWNABLE_AGENTS = AGENT_TYPES.filter((a) => a !== 'custom');
18
- /** CLI identifiers accepted by spawn-session RPC. */
19
- export const CLI_AGENT_TYPES = [
20
- 'claude',
21
- 'copilot',
22
- 'opencode',
23
- 'codex',
24
- 'gemini',
25
- 'hermes',
26
- 'openclaw',
27
- ];
28
- export const MessageMetaSchema = z.object({
29
- sentFrom: z.string().optional(),
30
- permissionMode: PermissionModeSchema.optional(),
31
- model: z.string().nullable().optional(),
32
- fallbackModel: z.string().nullable().optional(),
33
- customSystemPrompt: z.string().nullable().optional(),
34
- appendSystemPrompt: z.string().nullable().optional(),
35
- allowedTools: z.array(z.string()).nullable().optional(),
36
- disallowedTools: z.array(z.string()).nullable().optional(),
37
- displayText: z.string().optional(),
38
- /** Agent type for UI differentiation (avatar, colors). */
39
- agentType: AgentTypeSchema.nullable().optional(),
40
- /** Session start timestamp (Unix ms). */
41
- startedAt: z.number().nullable().optional(),
42
- /** Session status for info display. */
43
- sessionStatus: z
44
- .enum(['running', 'idle', 'completed', 'failed', 'cancelled'])
45
- .nullable()
46
- .optional(),
47
- });
48
- /** Hardcoded per-agent image support. UX-driven: hides image button immediately on agent selection.
49
- * Updated when agents add ACP promptCapabilities.image support. */
50
- export const AGENT_SUPPORTS_IMAGES = {
51
- claude: true,
52
- copilot: true,
53
- codex: false, // Only supports URL/localPath, not base64
54
- gemini: true,
55
- opencode: true,
56
- hermes: false, // ACP: promptCapabilities.image = false
57
- openclaw: false, // ACP: promptCapabilities.image = false
58
- custom: true, // Unknown, assume yes
59
- };
60
- //# sourceMappingURL=messageMeta.js.map
1
+ "use strict";import{z as e}from"zod";import{PermissionModeSchema as l}from"./interactionEvents.js";export const AgentTypeSchema=e.enum(["claude","copilot","codex","gemini","opencode","hermes","openclaw","custom"]),AGENT_TYPES=AgentTypeSchema.options,SPAWNABLE_AGENTS=AGENT_TYPES.filter(o=>o!=="custom"),CLI_AGENT_TYPES=["claude","copilot","opencode","codex","gemini","hermes","openclaw"],MessageMetaSchema=e.object({sentFrom:e.string().optional(),permissionMode:l.optional(),model:e.string().nullable().optional(),fallbackModel:e.string().nullable().optional(),customSystemPrompt:e.string().nullable().optional(),appendSystemPrompt:e.string().nullable().optional(),allowedTools:e.array(e.string()).nullable().optional(),disallowedTools:e.array(e.string()).nullable().optional(),displayText:e.string().optional(),agentType:AgentTypeSchema.nullable().optional(),startedAt:e.number().nullable().optional(),sessionStatus:e.enum(["running","idle","completed","failed","cancelled"]).nullable().optional()}),AGENT_SUPPORTS_IMAGES={claude:!0,copilot:!0,codex:!1,gemini:!0,opencode:!0,hermes:!1,openclaw:!1,custom:!0};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Message schemas — aligned with Happy messages.ts.
2
+ * Message schemas.
3
3
  *
4
4
  * SessionMessage: encrypted content container.
5
5
  * Timestamps are Unix numbers (milliseconds).
@@ -67,13 +67,31 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
67
67
  t: z.ZodLiteral<"text">;
68
68
  text: z.ZodString;
69
69
  thinking: z.ZodOptional<z.ZodBoolean>;
70
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
+ data: z.ZodString;
72
+ mediaType: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ data: string;
75
+ mediaType: string;
76
+ }, {
77
+ data: string;
78
+ mediaType: string;
79
+ }>, "many">>;
70
80
  }, "strip", z.ZodTypeAny, {
71
81
  t: "text";
72
82
  text: string;
83
+ images?: {
84
+ data: string;
85
+ mediaType: string;
86
+ }[] | undefined;
73
87
  thinking?: boolean | undefined;
74
88
  }, {
75
89
  t: "text";
76
90
  text: string;
91
+ images?: {
92
+ data: string;
93
+ mediaType: string;
94
+ }[] | undefined;
77
95
  thinking?: boolean | undefined;
78
96
  }>, z.ZodObject<{
79
97
  t: z.ZodLiteral<"service">;
@@ -353,6 +371,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
353
371
  } | {
354
372
  t: "text";
355
373
  text: string;
374
+ images?: {
375
+ data: string;
376
+ mediaType: string;
377
+ }[] | undefined;
356
378
  thinking?: boolean | undefined;
357
379
  } | {
358
380
  t: "service";
@@ -438,6 +460,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
438
460
  } | {
439
461
  t: "text";
440
462
  text: string;
463
+ images?: {
464
+ data: string;
465
+ mediaType: string;
466
+ }[] | undefined;
441
467
  thinking?: boolean | undefined;
442
468
  } | {
443
469
  t: "service";
@@ -523,6 +549,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
523
549
  } | {
524
550
  t: "text";
525
551
  text: string;
552
+ images?: {
553
+ data: string;
554
+ mediaType: string;
555
+ }[] | undefined;
526
556
  thinking?: boolean | undefined;
527
557
  } | {
528
558
  t: "service";
@@ -608,6 +638,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
608
638
  } | {
609
639
  t: "text";
610
640
  text: string;
641
+ images?: {
642
+ data: string;
643
+ mediaType: string;
644
+ }[] | undefined;
611
645
  thinking?: boolean | undefined;
612
646
  } | {
613
647
  t: "service";
@@ -736,6 +770,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
736
770
  } | {
737
771
  t: "text";
738
772
  text: string;
773
+ images?: {
774
+ data: string;
775
+ mediaType: string;
776
+ }[] | undefined;
739
777
  thinking?: boolean | undefined;
740
778
  } | {
741
779
  t: "service";
@@ -838,6 +876,10 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
838
876
  } | {
839
877
  t: "text";
840
878
  text: string;
879
+ images?: {
880
+ data: string;
881
+ mediaType: string;
882
+ }[] | undefined;
841
883
  thinking?: boolean | undefined;
842
884
  } | {
843
885
  t: "service";
@@ -1105,13 +1147,31 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1105
1147
  t: z.ZodLiteral<"text">;
1106
1148
  text: z.ZodString;
1107
1149
  thinking: z.ZodOptional<z.ZodBoolean>;
1150
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
1151
+ data: z.ZodString;
1152
+ mediaType: z.ZodString;
1153
+ }, "strip", z.ZodTypeAny, {
1154
+ data: string;
1155
+ mediaType: string;
1156
+ }, {
1157
+ data: string;
1158
+ mediaType: string;
1159
+ }>, "many">>;
1108
1160
  }, "strip", z.ZodTypeAny, {
1109
1161
  t: "text";
1110
1162
  text: string;
1163
+ images?: {
1164
+ data: string;
1165
+ mediaType: string;
1166
+ }[] | undefined;
1111
1167
  thinking?: boolean | undefined;
1112
1168
  }, {
1113
1169
  t: "text";
1114
1170
  text: string;
1171
+ images?: {
1172
+ data: string;
1173
+ mediaType: string;
1174
+ }[] | undefined;
1115
1175
  thinking?: boolean | undefined;
1116
1176
  }>, z.ZodObject<{
1117
1177
  t: z.ZodLiteral<"service">;
@@ -1391,6 +1451,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1391
1451
  } | {
1392
1452
  t: "text";
1393
1453
  text: string;
1454
+ images?: {
1455
+ data: string;
1456
+ mediaType: string;
1457
+ }[] | undefined;
1394
1458
  thinking?: boolean | undefined;
1395
1459
  } | {
1396
1460
  t: "service";
@@ -1476,6 +1540,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1476
1540
  } | {
1477
1541
  t: "text";
1478
1542
  text: string;
1543
+ images?: {
1544
+ data: string;
1545
+ mediaType: string;
1546
+ }[] | undefined;
1479
1547
  thinking?: boolean | undefined;
1480
1548
  } | {
1481
1549
  t: "service";
@@ -1561,6 +1629,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1561
1629
  } | {
1562
1630
  t: "text";
1563
1631
  text: string;
1632
+ images?: {
1633
+ data: string;
1634
+ mediaType: string;
1635
+ }[] | undefined;
1564
1636
  thinking?: boolean | undefined;
1565
1637
  } | {
1566
1638
  t: "service";
@@ -1646,6 +1718,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1646
1718
  } | {
1647
1719
  t: "text";
1648
1720
  text: string;
1721
+ images?: {
1722
+ data: string;
1723
+ mediaType: string;
1724
+ }[] | undefined;
1649
1725
  thinking?: boolean | undefined;
1650
1726
  } | {
1651
1727
  t: "service";
@@ -1774,6 +1850,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1774
1850
  } | {
1775
1851
  t: "text";
1776
1852
  text: string;
1853
+ images?: {
1854
+ data: string;
1855
+ mediaType: string;
1856
+ }[] | undefined;
1777
1857
  thinking?: boolean | undefined;
1778
1858
  } | {
1779
1859
  t: "service";
@@ -1876,6 +1956,10 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1876
1956
  } | {
1877
1957
  t: "text";
1878
1958
  text: string;
1959
+ images?: {
1960
+ data: string;
1961
+ mediaType: string;
1962
+ }[] | undefined;
1879
1963
  thinking?: boolean | undefined;
1880
1964
  } | {
1881
1965
  t: "service";
package/dist/messages.js CHANGED
@@ -1,35 +1 @@
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.enum(['encrypted', 'plaintext']),
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
1
+ "use strict";import{z as e}from"zod";import{SessionEnvelopeSchema as t}from"./envelope.js";import{MessageMetaSchema as o}from"./messageMeta.js";import{UserMessageSchema as s,AgentMessageSchema as n}from"./legacyProtocol.js";export const SessionMessageContentSchema=e.object({c:e.string(),t:e.enum(["encrypted","plaintext"])}),SessionMessageSchema=e.object({id:e.string(),seq:e.number(),localId:e.string().nullish(),content:SessionMessageContentSchema,createdAt:e.number(),updatedAt:e.number()}),SessionProtocolMessageSchema=e.object({role:e.literal("session"),content:t,meta:o.optional()}),MessageContentSchema=e.discriminatedUnion("role",[s,n,SessionProtocolMessageSchema]);
package/dist/ops.js CHANGED
@@ -1,74 +1 @@
1
- import { z } from 'zod';
2
- /**
3
- * Ops RPC method naming convention: namespace.action
4
- * - file.* — RFC-033 file management
5
- * - sync.* — RFC-034 data sync (Ops Agent → Server)
6
- * - config.* — RFC-034 policy push (Server → Ops Agent)
7
- */
8
- export const OpsMethodSchema = z
9
- .string()
10
- .min(1)
11
- .regex(/^[a-z]+\.[a-z][a-z0-9-]*$/);
12
- export const OpsRpcTypeSchema = z.enum(['request', 'response', 'event']);
13
- /** Unified RPC message over the ops-upstream tunnel. */
14
- export const OpsRpcMessageSchema = z.object({
15
- id: z.string().min(1),
16
- type: OpsRpcTypeSchema,
17
- method: OpsMethodSchema,
18
- payload: z.unknown(),
19
- });
20
- // FileEntry — directory listing item
21
- export const FileEntrySchema = z.object({
22
- name: z.string(),
23
- type: z.enum(['file', 'directory']),
24
- size: z.number().int().nonnegative(),
25
- modifiedAt: z.string(),
26
- mimeType: z.string().optional(),
27
- });
28
- // FileStat — detailed metadata
29
- export const FileStatSchema = z.object({
30
- name: z.string(),
31
- path: z.string(),
32
- type: z.enum(['file', 'directory']),
33
- size: z.number().int().nonnegative(),
34
- modifiedAt: z.string(),
35
- createdAt: z.string(),
36
- mimeType: z.string().optional(),
37
- });
38
- // StorageUsage — quota info
39
- export const StorageUsageSchema = z.object({
40
- used: z.number().int().nonnegative(),
41
- limit: z.number().int().nonnegative(),
42
- fileCount: z.number().int().nonnegative(),
43
- });
44
- // ─── Sync payloads (RFC-034 P1) ─────────────────────────
45
- /** A single user record in a full sync push. */
46
- export const SyncUserSchema = z.object({
47
- username: z.string().min(1),
48
- displayName: z.string(),
49
- machineId: z.string().nullable(),
50
- containerStatus: z.string(),
51
- healthStatus: z.string().nullable(),
52
- enabled: z.boolean(),
53
- });
54
- /** sync.full — all users pushed on tunnel connect/reconnect. */
55
- export const SyncFullPayloadSchema = z.object({
56
- users: z.array(SyncUserSchema),
57
- });
58
- /** sync.user-created — single user just created. */
59
- export const SyncUserCreatedPayloadSchema = z.object({
60
- username: z.string().min(1),
61
- displayName: z.string(),
62
- });
63
- /** sync.container-status — container state change. */
64
- export const SyncContainerStatusPayloadSchema = z.object({
65
- username: z.string().min(1),
66
- containerStatus: z.string(),
67
- healthStatus: z.string().nullable().optional(),
68
- });
69
- /** sync.user-paired — daemon pairing detected, machineId available. */
70
- export const SyncUserPairedPayloadSchema = z.object({
71
- username: z.string().min(1),
72
- machineId: z.string().min(1),
73
- });
74
- //# sourceMappingURL=ops.js.map
1
+ "use strict";import{z as e}from"zod";export const OpsMethodSchema=e.string().min(1).regex(/^[a-z]+\.[a-z][a-z0-9-]*$/),OpsRpcTypeSchema=e.enum(["request","response","event"]),OpsRpcMessageSchema=e.object({id:e.string().min(1),type:OpsRpcTypeSchema,method:OpsMethodSchema,payload:e.unknown()}),FileEntrySchema=e.object({name:e.string(),type:e.enum(["file","directory"]),size:e.number().int().nonnegative(),modifiedAt:e.string(),mimeType:e.string().optional()}),FileStatSchema=e.object({name:e.string(),path:e.string(),type:e.enum(["file","directory"]),size:e.number().int().nonnegative(),modifiedAt:e.string(),createdAt:e.string(),mimeType:e.string().optional()}),StorageUsageSchema=e.object({used:e.number().int().nonnegative(),limit:e.number().int().nonnegative(),fileCount:e.number().int().nonnegative()}),SyncUserSchema=e.object({username:e.string().min(1),displayName:e.string(),machineId:e.string().nullable(),containerStatus:e.string(),healthStatus:e.string().nullable(),enabled:e.boolean()}),SyncFullPayloadSchema=e.object({users:e.array(SyncUserSchema)}),SyncUserCreatedPayloadSchema=e.object({username:e.string().min(1),displayName:e.string()}),SyncContainerStatusPayloadSchema=e.object({username:e.string().min(1),containerStatus:e.string(),healthStatus:e.string().nullable().optional()}),SyncUserPairedPayloadSchema=e.object({username:e.string().min(1),machineId:e.string().min(1)});
package/dist/pairing.d.ts CHANGED
@@ -130,4 +130,14 @@ export type PairingResponse = z.infer<typeof PairingResponseSchema>;
130
130
  export type PairingExchange = z.infer<typeof PairingExchangeSchema>;
131
131
  export type PairingDeliver = z.infer<typeof PairingDeliverSchema>;
132
132
  export type PairingStatus = z.infer<typeof PairingStatusSchema>;
133
+ /**
134
+ * Parse derivation version from decrypted pairing payload.
135
+ * Version 1+: payload = [version_byte, ...masterSecret] (33 bytes)
136
+ * Version 0 (legacy): payload = masterSecret (32 bytes, no prefix)
137
+ * Returns null for unknown versions or unexpected lengths.
138
+ */
139
+ export declare function parseVersionByte(rawPayload: Uint8Array): {
140
+ masterSecret: Uint8Array;
141
+ derivationVersion: number;
142
+ } | null;
133
143
  //# sourceMappingURL=pairing.d.ts.map