@stitchmux/client 0.0.0-stage → 0.96.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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/dist/chunk-wddwdvbj.js +714 -0
  4. package/dist/index.js +4070 -0
  5. package/dist/monitoring.js +279 -0
  6. package/native-stream.json +8 -0
  7. package/package.json +36 -4
  8. package/types/src/agent/claude/native/commandSchema.d.ts +14 -0
  9. package/types/src/agent/custom/config.d.ts +159 -0
  10. package/types/src/agent/custom/endpoint.d.ts +26 -0
  11. package/types/src/agent/transcript/messageSchema.d.ts +153 -0
  12. package/types/src/attachments/reference.d.ts +56 -0
  13. package/types/src/attachments/schema.d.ts +512 -0
  14. package/types/src/chat/communicationAuthorizationSchema.d.ts +77 -0
  15. package/types/src/chat/communicationReceiptSchema.d.ts +82 -0
  16. package/types/src/chat/feedSchema.d.ts +641 -0
  17. package/types/src/chat/holdKind.d.ts +26 -0
  18. package/types/src/chat/identity.d.ts +55 -0
  19. package/types/src/chat/identitySchema.d.ts +121 -0
  20. package/types/src/chat/letterRequestSchema.d.ts +35 -0
  21. package/types/src/chat/messageOperationSchema.d.ts +277 -0
  22. package/types/src/chat/messageSchema.d.ts +284 -0
  23. package/types/src/chat/originSchema.d.ts +67 -0
  24. package/types/src/chat/sentLetterSchema.d.ts +79 -0
  25. package/types/src/client.d.ts +16 -0
  26. package/types/src/config/claudeProfileSchema.d.ts +22 -0
  27. package/types/src/config/launchSchema.d.ts +136 -0
  28. package/types/src/config/location.d.ts +6 -0
  29. package/types/src/config/machineSchema.d.ts +320 -0
  30. package/types/src/config/modelSelectionFlags.d.ts +4 -0
  31. package/types/src/config/paths.d.ts +87 -0
  32. package/types/src/config/remoteTransport.d.ts +12 -0
  33. package/types/src/content/schema.d.ts +312 -0
  34. package/types/src/content/toolSchema.d.ts +36 -0
  35. package/types/src/context/corpusSearchSchema.d.ts +578 -0
  36. package/types/src/context/exactMessageSchema.d.ts +54 -0
  37. package/types/src/context/messageSenderSchema.d.ts +14 -0
  38. package/types/src/context/schema.d.ts +176 -0
  39. package/types/src/context/searchFrames.d.ts +225 -0
  40. package/types/src/context/searchRequestSchema.d.ts +47 -0
  41. package/types/src/context/transcriptJsonSchema.d.ts +210 -0
  42. package/types/src/control/schema/context.d.ts +188 -0
  43. package/types/src/control/schema/contract.d.ts +7142 -0
  44. package/types/src/control/schema/core.d.ts +722 -0
  45. package/types/src/control/schema/directory.d.ts +34 -0
  46. package/types/src/control/schema/eventsContract.d.ts +1423 -0
  47. package/types/src/control/schema/externalList.d.ts +96 -0
  48. package/types/src/control/schema/message.d.ts +280 -0
  49. package/types/src/control/schema/model.d.ts +128 -0
  50. package/types/src/control/schema/native.d.ts +664 -0
  51. package/types/src/control/schema/nativeStreamContract.d.ts +155 -0
  52. package/types/src/control/schema/performance.d.ts +85 -0
  53. package/types/src/control/schema/public.d.ts +48 -0
  54. package/types/src/control/schema/reading.d.ts +24 -0
  55. package/types/src/control/schema/refusals.d.ts +433 -0
  56. package/types/src/control/schema/runtimeOps.d.ts +724 -0
  57. package/types/src/control/schema/searchContract.d.ts +258 -0
  58. package/types/src/control/schema/selection.d.ts +124 -0
  59. package/types/src/control/schema/session.d.ts +272 -0
  60. package/types/src/control/schema/terminalPrompt.d.ts +102 -0
  61. package/types/src/control/transport/boundary.d.ts +7137 -0
  62. package/types/src/control/transport/client.d.ts +10838 -0
  63. package/types/src/control/transport/connection.d.ts +13 -0
  64. package/types/src/control/transport/socketPath.d.ts +3 -0
  65. package/types/src/control-client.d.ts +9 -0
  66. package/types/src/delegation/applicationSchema.d.ts +132 -0
  67. package/types/src/delegation/schema.d.ts +267 -0
  68. package/types/src/events/schema.d.ts +155 -0
  69. package/types/src/external/contentSchema.d.ts +145 -0
  70. package/types/src/external/messageSchema.d.ts +131 -0
  71. package/types/src/external/residentFrames.d.ts +130 -0
  72. package/types/src/external/residentSchema.d.ts +144 -0
  73. package/types/src/external/sessionSchema.d.ts +427 -0
  74. package/types/src/external/turnSchema.d.ts +55 -0
  75. package/types/src/fleet/fleetSchema.d.ts +937 -0
  76. package/types/src/inventory/listSchema.d.ts +442 -0
  77. package/types/src/monitoring/nativeFile.d.ts +7 -0
  78. package/types/src/monitoring/nativeRead.d.ts +14 -0
  79. package/types/src/monitoring/performanceSchema.d.ts +28 -0
  80. package/types/src/monitoring/schema.d.ts +410 -0
  81. package/types/src/monitoring/validate.d.ts +5 -0
  82. package/types/src/monitoring-reader.d.ts +4 -0
  83. package/types/src/policy/reference.d.ts +93 -0
  84. package/types/src/policy/runtimeProfile.d.ts +24 -0
  85. package/types/src/policy/schema.d.ts +177 -0
  86. package/types/src/runtime/capabilities.d.ts +124 -0
  87. package/types/src/runtime/modes.d.ts +47 -0
  88. package/types/src/runtime/permissionScope.d.ts +22 -0
  89. package/types/src/runtime/planLimitsSchema.d.ts +55 -0
  90. package/types/src/runtime/projectionSchema.d.ts +539 -0
  91. package/types/src/runtime/rewindSchema.d.ts +16 -0
  92. package/types/src/runtime/selectionSchema.d.ts +158 -0
  93. package/types/src/runtime/workloadContract.d.ts +55 -0
  94. package/types/src/session/boundary.d.ts +43 -0
  95. package/types/src/session/identitySchema.d.ts +353 -0
  96. package/types/src/session/schema.d.ts +341 -0
  97. package/types/src/session/sleep/schema.d.ts +283 -0
  98. package/types/src/steering/schema.d.ts +197 -0
  99. package/types/src/types.d.ts +48 -0
  100. package/types/src/usage/schema.d.ts +978 -0
  101. package/types/src/util/home.d.ts +9 -0
  102. package/types/src/util/preview.d.ts +13 -0
  103. package/types/src/util/version.d.ts +3 -0
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const ControlClientOptionsSchema: z.ZodObject<{
3
+ socket: z.ZodOptional<z.ZodString>;
4
+ session: z.ZodOptional<z.ZodString>;
5
+ credential: z.ZodOptional<z.ZodString>;
6
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
7
+ }, z.core.$strict>;
8
+ export type ControlClientOptions = z.input<typeof ControlClientOptionsSchema>;
9
+ export declare function createControlConnection(options: ControlClientOptions): {
10
+ http: import("stitchkit").ConfiguredHttpClient;
11
+ readonly stream: import("stitchkit").ConfiguredHttpClient;
12
+ close: () => Promise<void>;
13
+ };
@@ -0,0 +1,3 @@
1
+ import type { MachineConfig } from "../../types.js";
2
+ export declare function controlSocket(m: Pick<MachineConfig, 'stateDir'>): string;
3
+ export declare function prepareControlDirectory(m: Pick<MachineConfig, 'stateDir'>): void;
@@ -0,0 +1,9 @@
1
+ export { type ControlSnapshot, ControlSnapshotSchema, } from "./control/schema/core.js";
2
+ export { controlEventsContract } from "./control/schema/eventsContract.js";
3
+ export * from "./control/schema/public.js";
4
+ export { currentControlSnapshot } from "./control/schema/runtimeOps.js";
5
+ export type { ControlArchiveReceipt } from "./control/schema/session.js";
6
+ export { type ControlClientOptions, ControlClientOptionsSchema, createControlClient, createControlProxy, } from "./control/transport/client.js";
7
+ export { applyExternalStatusFrame, createExternalStatusEncoder, type ExternalStatusFrame, ExternalStatusFrameSchema, type ExternalStatusRenewal, ExternalStatusRenewalSchema, } from "./external/residentFrames.js";
8
+ export { currentExternalStatus, type ExternalStatusRow, ExternalStatusRowSchema, type ExternalStatusSnapshot, ExternalStatusSnapshotSchema, } from "./external/residentSchema.js";
9
+ export { VERSION as CONTROL_CLIENT_VERSION } from "./util/version.js";
@@ -0,0 +1,132 @@
1
+ import { z } from 'zod';
2
+ /** An application run is an attested authority, never a managed session registration. */
3
+ export declare const ApplicationParentSchema: z.ZodObject<{
4
+ kind: z.ZodLiteral<"application">;
5
+ machine: z.ZodString;
6
+ applicationId: z.ZodString;
7
+ authorityId: z.ZodUUID;
8
+ }, z.core.$strict>;
9
+ export declare const ApplicationBindingSchema: z.ZodObject<{
10
+ applicationId: z.ZodString;
11
+ channelId: z.ZodString;
12
+ actor: z.ZodLiteral<"agent">;
13
+ revision: z.ZodString;
14
+ }, z.core.$strict>;
15
+ export declare const ApplicationDelegationGrantSchema: z.ZodObject<{
16
+ binding: z.ZodObject<{
17
+ applicationId: z.ZodString;
18
+ channelId: z.ZodString;
19
+ actor: z.ZodLiteral<"agent">;
20
+ revision: z.ZodString;
21
+ }, z.core.$strict>;
22
+ policy: z.ZodObject<{
23
+ access: z.ZodEnum<{
24
+ "read-only": "read-only";
25
+ "workspace-write": "workspace-write";
26
+ }>;
27
+ readScope: z.ZodLiteral<"host">;
28
+ workspace: z.ZodString;
29
+ network: z.ZodLiteral<false>;
30
+ }, z.core.$strict>;
31
+ leaseMs: z.ZodNumber;
32
+ lifetimeMs: z.ZodNumber;
33
+ }, z.core.$strict>;
34
+ export declare const ApplicationAuthorityOpenSchema: z.ZodObject<{
35
+ operationId: z.ZodUUID;
36
+ binding: z.ZodObject<{
37
+ applicationId: z.ZodString;
38
+ channelId: z.ZodString;
39
+ actor: z.ZodLiteral<"agent">;
40
+ revision: z.ZodString;
41
+ }, z.core.$strict>;
42
+ conversationId: z.ZodString;
43
+ runId: z.ZodString;
44
+ sourceMessageRef: z.ZodString;
45
+ authorizationQuote: z.ZodString;
46
+ }, z.core.$strict>;
47
+ export declare const ApplicationAuthoritySelectorSchema: z.ZodObject<{
48
+ parent: z.ZodObject<{
49
+ target: z.ZodObject<{
50
+ kind: z.ZodLiteral<"application">;
51
+ machine: z.ZodString;
52
+ applicationId: z.ZodString;
53
+ authorityId: z.ZodUUID;
54
+ }, z.core.$strict>;
55
+ registrationGeneration: z.ZodUUID;
56
+ }, z.core.$strict>;
57
+ }, z.core.$strict>;
58
+ export declare const ApplicationAuthorityUpdateSchema: z.ZodObject<{
59
+ parent: z.ZodObject<{
60
+ target: z.ZodObject<{
61
+ kind: z.ZodLiteral<"application">;
62
+ machine: z.ZodString;
63
+ applicationId: z.ZodString;
64
+ authorityId: z.ZodUUID;
65
+ }, z.core.$strict>;
66
+ registrationGeneration: z.ZodUUID;
67
+ }, z.core.$strict>;
68
+ operationId: z.ZodUUID;
69
+ expectedExpiresAt: z.ZodOptional<z.ZodISODateTime>;
70
+ }, z.core.$strict>;
71
+ export declare const ApplicationAuthoritySchema: z.ZodObject<{
72
+ operationId: z.ZodUUID;
73
+ binding: z.ZodObject<{
74
+ applicationId: z.ZodString;
75
+ channelId: z.ZodString;
76
+ actor: z.ZodLiteral<"agent">;
77
+ revision: z.ZodString;
78
+ }, z.core.$strict>;
79
+ conversationId: z.ZodString;
80
+ runId: z.ZodString;
81
+ sourceMessageRef: z.ZodString;
82
+ authorizationQuote: z.ZodString;
83
+ parent: z.ZodObject<{
84
+ target: z.ZodObject<{
85
+ kind: z.ZodLiteral<"application">;
86
+ machine: z.ZodString;
87
+ applicationId: z.ZodString;
88
+ authorityId: z.ZodUUID;
89
+ }, z.core.$strict>;
90
+ registrationGeneration: z.ZodUUID;
91
+ }, z.core.$strict>;
92
+ caller: z.ZodString;
93
+ assurance: z.ZodLiteral<"application-attested">;
94
+ bindingDigest: z.ZodString;
95
+ policy: z.ZodObject<{
96
+ access: z.ZodEnum<{
97
+ "read-only": "read-only";
98
+ "workspace-write": "workspace-write";
99
+ }>;
100
+ readScope: z.ZodLiteral<"host">;
101
+ workspace: z.ZodString;
102
+ network: z.ZodLiteral<false>;
103
+ }, z.core.$strict>;
104
+ issuedAt: z.ZodISODateTime;
105
+ expiresAt: z.ZodISODateTime;
106
+ deadlineAt: z.ZodISODateTime;
107
+ closedAt: z.ZodNullable<z.ZodISODateTime>;
108
+ lastOperationId: z.ZodUUID;
109
+ }, z.core.$strict>;
110
+ export declare const ApplicationAuthorityCapabilitiesSchema: z.ZodObject<{
111
+ bindings: z.ZodArray<z.ZodObject<{
112
+ binding: z.ZodObject<{
113
+ applicationId: z.ZodString;
114
+ channelId: z.ZodString;
115
+ actor: z.ZodLiteral<"agent">;
116
+ revision: z.ZodString;
117
+ }, z.core.$strict>;
118
+ policy: z.ZodObject<{
119
+ access: z.ZodEnum<{
120
+ "read-only": "read-only";
121
+ "workspace-write": "workspace-write";
122
+ }>;
123
+ readScope: z.ZodLiteral<"host">;
124
+ workspace: z.ZodString;
125
+ network: z.ZodLiteral<false>;
126
+ }, z.core.$strict>;
127
+ leaseMs: z.ZodNumber;
128
+ lifetimeMs: z.ZodNumber;
129
+ }, z.core.$strict>>;
130
+ assurance: z.ZodLiteral<"application-attested">;
131
+ requiresTrustedRunAttestation: z.ZodLiteral<true>;
132
+ }, z.core.$strict>;
@@ -0,0 +1,267 @@
1
+ import { z } from 'zod';
2
+ /** Read access covers the host; write access is limited to the canonical workspace. */
3
+ export declare const DelegatedPolicySchema: z.ZodObject<{
4
+ access: z.ZodEnum<{
5
+ "full-access": "full-access";
6
+ "read-only": "read-only";
7
+ "workspace-write": "workspace-write";
8
+ }>;
9
+ readScope: z.ZodLiteral<"host">;
10
+ workspace: z.ZodString;
11
+ network: z.ZodLiteral<false>;
12
+ }, z.core.$strict>;
13
+ export type DelegatedPolicy = z.infer<typeof DelegatedPolicySchema>;
14
+ export declare const DelegationParentSchema: z.ZodObject<{
15
+ target: z.ZodUnion<readonly [z.ZodObject<{
16
+ kind: z.ZodLiteral<"managed">;
17
+ source: z.ZodLiteral<"stitchmux">;
18
+ machine: z.ZodString;
19
+ agent: z.ZodEnum<{
20
+ antigravity: "antigravity";
21
+ claude: "claude";
22
+ codex: "codex";
23
+ custom: "custom";
24
+ opencode: "opencode";
25
+ }>;
26
+ session: z.ZodString;
27
+ threadId: z.ZodUUID;
28
+ }, z.core.$strict>, z.ZodObject<{
29
+ kind: z.ZodLiteral<"application">;
30
+ machine: z.ZodString;
31
+ applicationId: z.ZodString;
32
+ authorityId: z.ZodUUID;
33
+ }, z.core.$strict>]>;
34
+ registrationGeneration: z.ZodUUID;
35
+ }, z.core.$strict>;
36
+ export declare const DelegationRequestSchema: z.ZodObject<{
37
+ parent: z.ZodObject<{
38
+ target: z.ZodUnion<readonly [z.ZodObject<{
39
+ kind: z.ZodLiteral<"managed">;
40
+ source: z.ZodLiteral<"stitchmux">;
41
+ machine: z.ZodString;
42
+ agent: z.ZodEnum<{
43
+ antigravity: "antigravity";
44
+ claude: "claude";
45
+ codex: "codex";
46
+ custom: "custom";
47
+ opencode: "opencode";
48
+ }>;
49
+ session: z.ZodString;
50
+ threadId: z.ZodUUID;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"application">;
53
+ machine: z.ZodString;
54
+ applicationId: z.ZodString;
55
+ authorityId: z.ZodUUID;
56
+ }, z.core.$strict>]>;
57
+ registrationGeneration: z.ZodUUID;
58
+ }, z.core.$strict>;
59
+ policy: z.ZodObject<{
60
+ access: z.ZodEnum<{
61
+ "full-access": "full-access";
62
+ "read-only": "read-only";
63
+ "workspace-write": "workspace-write";
64
+ }>;
65
+ readScope: z.ZodLiteral<"host">;
66
+ workspace: z.ZodString;
67
+ network: z.ZodLiteral<false>;
68
+ }, z.core.$strict>;
69
+ deadlineAt: z.ZodOptional<z.ZodISODateTime>;
70
+ }, z.core.$strict>;
71
+ export type DelegationRequest = z.infer<typeof DelegationRequestSchema>;
72
+ /** Host-owned grants are exact registrations, never inferred from names or prompts. */
73
+ export declare const DelegationAuthoritySchema: z.ZodObject<{
74
+ parent: z.ZodObject<{
75
+ target: z.ZodUnion<readonly [z.ZodObject<{
76
+ kind: z.ZodLiteral<"managed">;
77
+ source: z.ZodLiteral<"stitchmux">;
78
+ machine: z.ZodString;
79
+ agent: z.ZodEnum<{
80
+ antigravity: "antigravity";
81
+ claude: "claude";
82
+ codex: "codex";
83
+ custom: "custom";
84
+ opencode: "opencode";
85
+ }>;
86
+ session: z.ZodString;
87
+ threadId: z.ZodUUID;
88
+ }, z.core.$strict>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"application">;
90
+ machine: z.ZodString;
91
+ applicationId: z.ZodString;
92
+ authorityId: z.ZodUUID;
93
+ }, z.core.$strict>]>;
94
+ registrationGeneration: z.ZodUUID;
95
+ }, z.core.$strict>;
96
+ policy: z.ZodObject<{
97
+ access: z.ZodEnum<{
98
+ "full-access": "full-access";
99
+ "read-only": "read-only";
100
+ "workspace-write": "workspace-write";
101
+ }>;
102
+ readScope: z.ZodLiteral<"host">;
103
+ workspace: z.ZodString;
104
+ network: z.ZodLiteral<false>;
105
+ }, z.core.$strict>;
106
+ deadlineAt: z.ZodOptional<z.ZodISODateTime>;
107
+ }, z.core.$strict>;
108
+ export declare const DelegationSchema: z.ZodObject<{
109
+ parent: z.ZodObject<{
110
+ target: z.ZodUnion<readonly [z.ZodObject<{
111
+ kind: z.ZodLiteral<"managed">;
112
+ source: z.ZodLiteral<"stitchmux">;
113
+ machine: z.ZodString;
114
+ agent: z.ZodEnum<{
115
+ antigravity: "antigravity";
116
+ claude: "claude";
117
+ codex: "codex";
118
+ custom: "custom";
119
+ opencode: "opencode";
120
+ }>;
121
+ session: z.ZodString;
122
+ threadId: z.ZodUUID;
123
+ }, z.core.$strict>, z.ZodObject<{
124
+ kind: z.ZodLiteral<"application">;
125
+ machine: z.ZodString;
126
+ applicationId: z.ZodString;
127
+ authorityId: z.ZodUUID;
128
+ }, z.core.$strict>]>;
129
+ registrationGeneration: z.ZodUUID;
130
+ }, z.core.$strict>;
131
+ policy: z.ZodObject<{
132
+ access: z.ZodEnum<{
133
+ "full-access": "full-access";
134
+ "read-only": "read-only";
135
+ "workspace-write": "workspace-write";
136
+ }>;
137
+ readScope: z.ZodLiteral<"host">;
138
+ workspace: z.ZodString;
139
+ network: z.ZodLiteral<false>;
140
+ }, z.core.$strict>;
141
+ deadlineAt: z.ZodOptional<z.ZodISODateTime>;
142
+ requestId: z.ZodUUID;
143
+ applicationAuthority: z.ZodOptional<z.ZodObject<{
144
+ target: z.ZodObject<{
145
+ kind: z.ZodLiteral<"application">;
146
+ machine: z.ZodString;
147
+ applicationId: z.ZodString;
148
+ authorityId: z.ZodUUID;
149
+ }, z.core.$strict>;
150
+ registrationGeneration: z.ZodUUID;
151
+ }, z.core.$strict>>;
152
+ policyDigest: z.ZodString;
153
+ }, z.core.$strict>;
154
+ export type Delegation = z.infer<typeof DelegationSchema>;
155
+ export declare const DelegationEvidenceSchema: z.ZodObject<{
156
+ delegation: z.ZodObject<{
157
+ parent: z.ZodObject<{
158
+ target: z.ZodUnion<readonly [z.ZodObject<{
159
+ kind: z.ZodLiteral<"managed">;
160
+ source: z.ZodLiteral<"stitchmux">;
161
+ machine: z.ZodString;
162
+ agent: z.ZodEnum<{
163
+ antigravity: "antigravity";
164
+ claude: "claude";
165
+ codex: "codex";
166
+ custom: "custom";
167
+ opencode: "opencode";
168
+ }>;
169
+ session: z.ZodString;
170
+ threadId: z.ZodUUID;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ kind: z.ZodLiteral<"application">;
173
+ machine: z.ZodString;
174
+ applicationId: z.ZodString;
175
+ authorityId: z.ZodUUID;
176
+ }, z.core.$strict>]>;
177
+ registrationGeneration: z.ZodUUID;
178
+ }, z.core.$strict>;
179
+ policy: z.ZodObject<{
180
+ access: z.ZodEnum<{
181
+ "full-access": "full-access";
182
+ "read-only": "read-only";
183
+ "workspace-write": "workspace-write";
184
+ }>;
185
+ readScope: z.ZodLiteral<"host">;
186
+ workspace: z.ZodString;
187
+ network: z.ZodLiteral<false>;
188
+ }, z.core.$strict>;
189
+ deadlineAt: z.ZodOptional<z.ZodISODateTime>;
190
+ requestId: z.ZodUUID;
191
+ applicationAuthority: z.ZodOptional<z.ZodObject<{
192
+ target: z.ZodObject<{
193
+ kind: z.ZodLiteral<"application">;
194
+ machine: z.ZodString;
195
+ applicationId: z.ZodString;
196
+ authorityId: z.ZodUUID;
197
+ }, z.core.$strict>;
198
+ registrationGeneration: z.ZodUUID;
199
+ }, z.core.$strict>>;
200
+ policyDigest: z.ZodString;
201
+ }, z.core.$strict>;
202
+ state: z.ZodEnum<{
203
+ applied: "applied";
204
+ unavailable: "unavailable";
205
+ }>;
206
+ generation: z.ZodNullable<z.ZodUUID>;
207
+ observedAt: z.ZodISODateTime;
208
+ }, z.core.$strict>;
209
+ export declare const DelegationCancelSchema: z.ZodObject<{
210
+ parent: z.ZodObject<{
211
+ target: z.ZodUnion<readonly [z.ZodObject<{
212
+ kind: z.ZodLiteral<"managed">;
213
+ source: z.ZodLiteral<"stitchmux">;
214
+ machine: z.ZodString;
215
+ agent: z.ZodEnum<{
216
+ antigravity: "antigravity";
217
+ claude: "claude";
218
+ codex: "codex";
219
+ custom: "custom";
220
+ opencode: "opencode";
221
+ }>;
222
+ session: z.ZodString;
223
+ threadId: z.ZodUUID;
224
+ }, z.core.$strict>, z.ZodObject<{
225
+ kind: z.ZodLiteral<"application">;
226
+ machine: z.ZodString;
227
+ applicationId: z.ZodString;
228
+ authorityId: z.ZodUUID;
229
+ }, z.core.$strict>]>;
230
+ registrationGeneration: z.ZodUUID;
231
+ }, z.core.$strict>;
232
+ target: z.ZodObject<{
233
+ kind: z.ZodLiteral<"managed">;
234
+ source: z.ZodLiteral<"stitchmux">;
235
+ machine: z.ZodString;
236
+ agent: z.ZodEnum<{
237
+ antigravity: "antigravity";
238
+ claude: "claude";
239
+ codex: "codex";
240
+ custom: "custom";
241
+ opencode: "opencode";
242
+ }>;
243
+ session: z.ZodString;
244
+ threadId: z.ZodUUID;
245
+ }, z.core.$strict>;
246
+ registrationGeneration: z.ZodUUID;
247
+ operationId: z.ZodUUID;
248
+ }, z.core.$strict>;
249
+ export declare const DelegationCancelReceiptSchema: z.ZodObject<{
250
+ target: z.ZodObject<{
251
+ kind: z.ZodLiteral<"managed">;
252
+ source: z.ZodLiteral<"stitchmux">;
253
+ machine: z.ZodString;
254
+ agent: z.ZodEnum<{
255
+ antigravity: "antigravity";
256
+ claude: "claude";
257
+ codex: "codex";
258
+ custom: "custom";
259
+ opencode: "opencode";
260
+ }>;
261
+ session: z.ZodString;
262
+ threadId: z.ZodUUID;
263
+ }, z.core.$strict>;
264
+ registrationGeneration: z.ZodUUID;
265
+ operationId: z.ZodUUID;
266
+ stopped: z.ZodLiteral<true>;
267
+ }, z.core.$strict>;
@@ -0,0 +1,155 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * One session event: a TRANSITION, not a state.
4
+ *
5
+ * The distinction is the whole reason this exists. Every outside surface used to learn about
6
+ * sessions by polling `list --json`, which answers "what is true now" — so a turn that started and
7
+ * ended between two polls left no trace, and "this ran for thirty minutes" could not be recovered
8
+ * from two snapshots. A feed of transitions answers that directly, and costs nothing while nothing
9
+ * happens.
10
+ *
11
+ * `id` is the idempotency key, and it is load-bearing rather than decorative: delivery here is
12
+ * at-least-once by construction (a reader reconnecting with `--since` re-reads the boundary, and two
13
+ * writers append independently), so a consumer that ACTS on an event — speaks it, blinks a light —
14
+ * must be able to recognise one it has already handled.
15
+ */
16
+ export declare const SessionEventKindSchema: z.ZodEnum<{
17
+ inventory: "inventory";
18
+ resumed: "resumed";
19
+ "session-blocked": "session-blocked";
20
+ "session-start": "session-start";
21
+ "session-stop": "session-stop";
22
+ "turn-end": "turn-end";
23
+ "turn-start": "turn-start";
24
+ waiting: "waiting";
25
+ }>;
26
+ export declare const SESSION_EVENT_VERSION = 1;
27
+ /**
28
+ * One session as the daemon's observation pass last saw it — only what changes at the pace of the
29
+ * session's own life. Read leniently: rows cross machines on mixed builds.
30
+ */
31
+ export declare const InventoryRowSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ agent: z.ZodEnum<{
34
+ antigravity: "antigravity";
35
+ claude: "claude";
36
+ codex: "codex";
37
+ custom: "custom";
38
+ opencode: "opencode";
39
+ }>;
40
+ uuid: z.ZodUUID;
41
+ address: z.ZodString;
42
+ archived: z.ZodBoolean;
43
+ running: z.ZodBoolean;
44
+ sleeping: z.ZodOptional<z.ZodBoolean>;
45
+ pinned: z.ZodOptional<z.ZodBoolean>;
46
+ state: z.ZodString;
47
+ model: z.ZodNullable<z.ZodString>;
48
+ contextPercent: z.ZodNullable<z.ZodNumber>;
49
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
50
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
51
+ step: z.ZodNullable<z.ZodObject<{
52
+ kind: z.ZodString;
53
+ role: z.ZodString;
54
+ toolName: z.ZodNullable<z.ZodString>;
55
+ at: z.ZodNullable<z.ZodString>;
56
+ }, z.core.$loose>>;
57
+ }, z.core.$loose>;
58
+ export type InventoryRow = z.infer<typeof InventoryRowSchema>;
59
+ /** Where an inventory stands: the daemon run that owns it and how many changes it has made. */
60
+ export declare const InventoryRevisionSchema: z.ZodObject<{
61
+ generation: z.ZodUUID;
62
+ sequence: z.ZodNumber;
63
+ }, z.core.$strip>;
64
+ export declare const InventorySnapshotSchema: z.ZodObject<{
65
+ generation: z.ZodUUID;
66
+ sequence: z.ZodNumber;
67
+ pid: z.ZodNumber;
68
+ sessions: z.ZodArray<z.ZodObject<{
69
+ name: z.ZodString;
70
+ agent: z.ZodEnum<{
71
+ antigravity: "antigravity";
72
+ claude: "claude";
73
+ codex: "codex";
74
+ custom: "custom";
75
+ opencode: "opencode";
76
+ }>;
77
+ uuid: z.ZodUUID;
78
+ address: z.ZodString;
79
+ archived: z.ZodBoolean;
80
+ running: z.ZodBoolean;
81
+ sleeping: z.ZodOptional<z.ZodBoolean>;
82
+ pinned: z.ZodOptional<z.ZodBoolean>;
83
+ state: z.ZodString;
84
+ model: z.ZodNullable<z.ZodString>;
85
+ contextPercent: z.ZodNullable<z.ZodNumber>;
86
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
87
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
88
+ step: z.ZodNullable<z.ZodObject<{
89
+ kind: z.ZodString;
90
+ role: z.ZodString;
91
+ toolName: z.ZodNullable<z.ZodString>;
92
+ at: z.ZodNullable<z.ZodString>;
93
+ }, z.core.$loose>>;
94
+ }, z.core.$loose>>;
95
+ }, z.core.$loose>;
96
+ export type InventorySnapshot = z.infer<typeof InventorySnapshotSchema>;
97
+ export declare const SessionEventSchema: z.ZodObject<{
98
+ v: z.ZodNumber;
99
+ id: z.ZodUUID;
100
+ ts: z.ZodISODateTime;
101
+ machine: z.ZodString;
102
+ session: z.ZodString;
103
+ agent: z.ZodEnum<{
104
+ antigravity: "antigravity";
105
+ claude: "claude";
106
+ codex: "codex";
107
+ custom: "custom";
108
+ opencode: "opencode";
109
+ }>;
110
+ threadId: z.ZodUUID;
111
+ event: z.ZodEnum<{
112
+ inventory: "inventory";
113
+ resumed: "resumed";
114
+ "session-blocked": "session-blocked";
115
+ "session-start": "session-start";
116
+ "session-stop": "session-stop";
117
+ "turn-end": "turn-end";
118
+ "turn-start": "turn-start";
119
+ waiting: "waiting";
120
+ }>;
121
+ durationMs: z.ZodOptional<z.ZodNumber>;
122
+ interrupted: z.ZodOptional<z.ZodBoolean>;
123
+ detail: z.ZodOptional<z.ZodString>;
124
+ inventory: z.ZodOptional<z.ZodObject<{
125
+ generation: z.ZodUUID;
126
+ sequence: z.ZodNumber;
127
+ }, z.core.$strip>>;
128
+ row: z.ZodOptional<z.ZodNullable<z.ZodObject<{
129
+ name: z.ZodString;
130
+ agent: z.ZodEnum<{
131
+ antigravity: "antigravity";
132
+ claude: "claude";
133
+ codex: "codex";
134
+ custom: "custom";
135
+ opencode: "opencode";
136
+ }>;
137
+ uuid: z.ZodUUID;
138
+ address: z.ZodString;
139
+ archived: z.ZodBoolean;
140
+ running: z.ZodBoolean;
141
+ sleeping: z.ZodOptional<z.ZodBoolean>;
142
+ pinned: z.ZodOptional<z.ZodBoolean>;
143
+ state: z.ZodString;
144
+ model: z.ZodNullable<z.ZodString>;
145
+ contextPercent: z.ZodNullable<z.ZodNumber>;
146
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
147
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
148
+ step: z.ZodNullable<z.ZodObject<{
149
+ kind: z.ZodString;
150
+ role: z.ZodString;
151
+ toolName: z.ZodNullable<z.ZodString>;
152
+ at: z.ZodNullable<z.ZodString>;
153
+ }, z.core.$loose>>;
154
+ }, z.core.$loose>>>;
155
+ }, z.core.$loose>;