@ultrst-armada/kloks 1.0.2 → 1.1.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 (26) hide show
  1. package/index.d.ts +2 -0
  2. package/index.js +2 -0
  3. package/package.json +19 -10
  4. package/packages/backend/dist/index.js +8 -8
  5. package/packages/contracts/dist/index.d.ts +552 -0
  6. package/packages/contracts/dist/index.js +422 -0
  7. package/packages/contracts/kloks.manifest.json +20 -0
  8. package/packages/contracts/package.json +33 -0
  9. package/packages/state-graph/dist/{BaseGraph-Bl2f7Pqx.d.ts → BaseGraph-BvkSYOTw.d.ts} +1 -1
  10. package/packages/state-graph/dist/{BaseNode-1HCEqmap.d.ts → BaseNode-DTcd3K1B.d.ts} +1 -1
  11. package/packages/state-graph/dist/{CompatibilityMatrix-DX307_vS.d.ts → CompatibilityMatrix-Dj-tCWUA.d.ts} +1 -1
  12. package/packages/state-graph/dist/chunk-JXDJZSFW.js +459 -0
  13. package/packages/state-graph/dist/chunk-RHRXPY2U.js +0 -0
  14. package/packages/state-graph/dist/domain/index.d.ts +3 -3
  15. package/packages/state-graph/dist/index.d.ts +8 -9
  16. package/packages/state-graph/dist/index.js +25 -16
  17. package/packages/state-graph/dist/rules/index.d.ts +3 -3
  18. package/packages/state-graph/dist/rules/index.js +2 -1
  19. package/packages/state-graph/dist/spatial/index.d.ts +53 -5
  20. package/packages/state-graph/dist/spatial/index.js +12 -3
  21. package/packages/state-graph/dist/store/index.d.ts +159 -6
  22. package/packages/state-graph/dist/types-VDoc4FIc.d.ts +150 -0
  23. package/packages/state-graph/dist/TraceEngine-CJVpUb80.d.ts +0 -18
  24. package/packages/state-graph/dist/chunk-YTWCH6P2.js +0 -109
  25. package/packages/state-graph/dist/index-CiekWEH3.d.ts +0 -272
  26. /package/packages/state-graph/dist/{chunk-QN74PLMF.js → chunk-TZOL3RN7.js} +0 -0
package/index.d.ts CHANGED
@@ -2,4 +2,6 @@ export * from './packages/functions/dist/index.d.ts';
2
2
  export * from './packages/state-graph/dist/index.d.ts';
3
3
  export * from './packages/audio-midi/dist/index.d.ts';
4
4
  export * from './packages/services/dist/index.d.ts';
5
+ export * from './packages/backend/dist/index.d.ts';
5
6
  export * from './packages/orchestrations/dist/index.d.ts';
7
+ export * from './packages/contracts/dist/index.d.ts';
package/index.js CHANGED
@@ -2,4 +2,6 @@ export * from './packages/functions/dist/index.js';
2
2
  export * from './packages/state-graph/dist/index.js';
3
3
  export * from './packages/audio-midi/dist/index.js';
4
4
  export * from './packages/services/dist/index.js';
5
+ export * from './packages/backend/dist/index.js';
5
6
  export * from './packages/orchestrations/dist/index.js';
7
+ export * from './packages/contracts/dist/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -84,19 +84,22 @@
84
84
  "import": "./packages/backend/dist/execution/index.js",
85
85
  "default": "./packages/backend/dist/execution/index.js"
86
86
  },
87
+ "./backend/krnl-services": {
88
+ "types": "./packages/backend/dist/krnl-services.d.ts",
89
+ "import": "./packages/backend/dist/krnl-services.js",
90
+ "default": "./packages/backend/dist/krnl-services.js"
91
+ },
87
92
  "./orchestrations": {
88
93
  "types": "./packages/orchestrations/dist/index.d.ts",
89
94
  "import": "./packages/orchestrations/dist/index.js",
90
95
  "default": "./packages/orchestrations/dist/index.js"
96
+ },
97
+ "./contracts": {
98
+ "types": "./packages/contracts/dist/index.d.ts",
99
+ "import": "./packages/contracts/dist/index.js",
100
+ "default": "./packages/contracts/dist/index.js"
91
101
  }
92
102
  },
93
- "scripts": {
94
- "build": "pnpm -r run build",
95
- "postbuild": "node -e \"import('fs').then(fs => { for (const pkg of fs.readdirSync('packages')) { const d = 'packages/' + pkg + '/dist'; if (!fs.existsSync(d)) continue; for (const f of fs.readdirSync(d, { recursive: true })) { const p = d + '/' + f; if (fs.statSync(p).isFile() && (p.endsWith('.js') || p.endsWith('.d.ts'))) { const c = fs.readFileSync(p, 'utf8'); const n = c.replaceAll('@kloks/', '@ultrst-armada/kloks/').replaceAll('@ultrst/kloks/', '@ultrst-armada/kloks/').replaceAll('\\\"kloks/', '\\\"@ultrst-armada/kloks/').replaceAll('\\'kloks/', '\\'@ultrst-armada/kloks/'); if (c !== n) fs.writeFileSync(p, n); } } } })\"",
96
- "test": "vitest run",
97
- "typecheck": "pnpm -r run typecheck",
98
- "clean": "pnpm -r run clean"
99
- },
100
103
  "dependencies": {
101
104
  "bullmq": "^6.3.8",
102
105
  "zod": "^3.24.1",
@@ -119,5 +122,11 @@
119
122
  "typescript": "^5.7.3",
120
123
  "vitest": "^3.1.0"
121
124
  },
122
- "packageManager": "pnpm@9.15.0"
123
- }
125
+ "scripts": {
126
+ "build": "pnpm -r run build",
127
+ "postbuild": "node -e \"import('fs').then(fs => { for (const pkg of fs.readdirSync('packages')) { const d = 'packages/' + pkg + '/dist'; if (!fs.existsSync(d)) continue; for (const f of fs.readdirSync(d, { recursive: true })) { const p = d + '/' + f; if (fs.statSync(p).isFile() && (p.endsWith('.js') || p.endsWith('.d.ts'))) { const c = fs.readFileSync(p, 'utf8'); const n = c.replaceAll('@kloks/', '@ultrst-armada/kloks/').replaceAll('@ultrst/kloks/', '@ultrst-armada/kloks/').replaceAll('\\\"kloks/', '\\\"@ultrst-armada/kloks/').replaceAll('\\'kloks/', '\\'@ultrst-armada/kloks/'); if (c !== n) fs.writeFileSync(p, n); } } } })\"",
128
+ "test": "vitest run",
129
+ "typecheck": "pnpm -r run typecheck",
130
+ "clean": "pnpm -r run clean"
131
+ }
132
+ }
@@ -1,3 +1,11 @@
1
+ import {
2
+ CompositeBackend,
3
+ EndpointGenerator,
4
+ createBackend,
5
+ createCompositeService,
6
+ createLocalService,
7
+ createRemoteService
8
+ } from "./chunk-P4HL4C6V.js";
1
9
  import {
2
10
  CANONICAL_SRKL_URL,
3
11
  SrklClient,
@@ -7,14 +15,6 @@ import {
7
15
  srklListBackblazeBuckets,
8
16
  useSrklServices
9
17
  } from "./chunk-MN54ZIKZ.js";
10
- import {
11
- CompositeBackend,
12
- EndpointGenerator,
13
- createBackend,
14
- createCompositeService,
15
- createLocalService,
16
- createRemoteService
17
- } from "./chunk-P4HL4C6V.js";
18
18
  import "./chunk-LS3HWJBX.js";
19
19
  import {
20
20
  authorizeB2,
@@ -0,0 +1,552 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * @file surface.ts
5
+ * @description Canonical export surface definitions and consumer compatibility validator.
6
+ * Enforces: QwnsrRequiredSurface ⊆ KloksPublicContract
7
+ */
8
+ interface ExportSymbolEntry {
9
+ name: string;
10
+ subpath: string;
11
+ category: 'state-graph' | 'audio-midi' | 'orchestrations' | 'backend' | 'services' | 'functions' | 'contracts';
12
+ hasZodSchema: boolean;
13
+ }
14
+ /**
15
+ * Authoritative Canonical Public Contract Surface for Kloks.
16
+ */
17
+ declare const KLOKS_PUBLIC_SURFACE: ExportSymbolEntry[];
18
+ /**
19
+ * Surface required by Qwnsr consumer according to docs/01_CONTRACT_FOUNDATION.md & docs/03_LIBRARY_CONTRACT_MIGRATION.md.
20
+ */
21
+ declare const QWNSR_REQUIRED_SURFACE: string[];
22
+ interface CompatibilityCheckResult {
23
+ compatible: boolean;
24
+ missingSymbols: string[];
25
+ totalRequired: number;
26
+ totalPresent: number;
27
+ }
28
+ /**
29
+ * Verifies that all symbols in requiredSurface are exported by Kloks.
30
+ * Enforces Invariant: QwnsrRequiredSurface ⊆ KloksPublicContract
31
+ */
32
+ declare function validateConsumerSurfaceCompatibility(requiredSymbols?: string[], publicSurface?: ExportSymbolEntry[]): CompatibilityCheckResult;
33
+
34
+ /**
35
+ * @file schemas.ts
36
+ * @description Runtime Zod Schemas for Kloks Public Contracts and Canonical Models.
37
+ * Enforces: ∀ public runtime boundary: TypeScriptContract ∧ ZodRuntimeContract
38
+ */
39
+
40
+ declare const GraphEntityMetadataSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ name: z.ZodString;
43
+ type: z.ZodString;
44
+ archetype: z.ZodString;
45
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ description: z.ZodOptional<z.ZodString>;
47
+ createdAt: z.ZodOptional<z.ZodNumber>;
48
+ updatedAt: z.ZodOptional<z.ZodNumber>;
49
+ customAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ type?: string;
52
+ id?: string;
53
+ name?: string;
54
+ archetype?: string;
55
+ tags?: string[];
56
+ description?: string;
57
+ createdAt?: number;
58
+ updatedAt?: number;
59
+ customAttributes?: Record<string, unknown>;
60
+ }, {
61
+ type?: string;
62
+ id?: string;
63
+ name?: string;
64
+ archetype?: string;
65
+ tags?: string[];
66
+ description?: string;
67
+ createdAt?: number;
68
+ updatedAt?: number;
69
+ customAttributes?: Record<string, unknown>;
70
+ }>;
71
+ type GraphEntityMetadata = z.infer<typeof GraphEntityMetadataSchema>;
72
+ declare const SocketPosition2DSchema: z.ZodObject<{
73
+ x: z.ZodNumber;
74
+ y: z.ZodNumber;
75
+ }, "strip", z.ZodTypeAny, {
76
+ x?: number;
77
+ y?: number;
78
+ }, {
79
+ x?: number;
80
+ y?: number;
81
+ }>;
82
+ type SocketPosition2D = z.infer<typeof SocketPosition2DSchema>;
83
+ declare const SocketDirectionSchema: z.ZodEnum<["input", "output", "bidirectional"]>;
84
+ type SocketDirection = z.infer<typeof SocketDirectionSchema>;
85
+ declare const SocketGeometryConfigSchema: z.ZodObject<{
86
+ radius: z.ZodDefault<z.ZodNumber>;
87
+ hitRadius: z.ZodDefault<z.ZodNumber>;
88
+ snapDistance: z.ZodDefault<z.ZodNumber>;
89
+ direction: z.ZodDefault<z.ZodEnum<["input", "output", "bidirectional"]>>;
90
+ relativeOffset: z.ZodDefault<z.ZodObject<{
91
+ x: z.ZodNumber;
92
+ y: z.ZodNumber;
93
+ }, "strip", z.ZodTypeAny, {
94
+ x?: number;
95
+ y?: number;
96
+ }, {
97
+ x?: number;
98
+ y?: number;
99
+ }>>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ radius?: number;
102
+ hitRadius?: number;
103
+ snapDistance?: number;
104
+ direction?: "input" | "output" | "bidirectional";
105
+ relativeOffset?: {
106
+ x?: number;
107
+ y?: number;
108
+ };
109
+ }, {
110
+ radius?: number;
111
+ hitRadius?: number;
112
+ snapDistance?: number;
113
+ direction?: "input" | "output" | "bidirectional";
114
+ relativeOffset?: {
115
+ x?: number;
116
+ y?: number;
117
+ };
118
+ }>;
119
+ type SocketGeometryConfig = z.infer<typeof SocketGeometryConfigSchema>;
120
+ declare const SocketStyleConfigSchema: z.ZodObject<{
121
+ color: z.ZodString;
122
+ hoverColor: z.ZodOptional<z.ZodString>;
123
+ activeColor: z.ZodOptional<z.ZodString>;
124
+ borderColor: z.ZodOptional<z.ZodString>;
125
+ borderWidth: z.ZodOptional<z.ZodNumber>;
126
+ fillOpacity: z.ZodOptional<z.ZodNumber>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ color?: string;
129
+ hoverColor?: string;
130
+ activeColor?: string;
131
+ borderColor?: string;
132
+ borderWidth?: number;
133
+ fillOpacity?: number;
134
+ }, {
135
+ color?: string;
136
+ hoverColor?: string;
137
+ activeColor?: string;
138
+ borderColor?: string;
139
+ borderWidth?: number;
140
+ fillOpacity?: number;
141
+ }>;
142
+ type SocketStyleConfig = z.infer<typeof SocketStyleConfigSchema>;
143
+ declare const WireEndpoint2DSchema: z.ZodObject<{
144
+ nodeId: z.ZodString;
145
+ socketId: z.ZodString;
146
+ position: z.ZodObject<{
147
+ x: z.ZodNumber;
148
+ y: z.ZodNumber;
149
+ }, "strip", z.ZodTypeAny, {
150
+ x?: number;
151
+ y?: number;
152
+ }, {
153
+ x?: number;
154
+ y?: number;
155
+ }>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ nodeId?: string;
158
+ socketId?: string;
159
+ position?: {
160
+ x?: number;
161
+ y?: number;
162
+ };
163
+ }, {
164
+ nodeId?: string;
165
+ socketId?: string;
166
+ position?: {
167
+ x?: number;
168
+ y?: number;
169
+ };
170
+ }>;
171
+ type WireEndpoint2D = z.infer<typeof WireEndpoint2DSchema>;
172
+ declare const WireCurveStyleSchema: z.ZodEnum<["bezier", "linear", "orthogonal", "stepped"]>;
173
+ type WireCurveStyle = z.infer<typeof WireCurveStyleSchema>;
174
+ declare const WireAnimationConfigSchema: z.ZodObject<{
175
+ animated: z.ZodDefault<z.ZodBoolean>;
176
+ speed: z.ZodDefault<z.ZodNumber>;
177
+ direction: z.ZodDefault<z.ZodEnum<["forward", "reverse"]>>;
178
+ pulseFrequency: z.ZodOptional<z.ZodNumber>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ direction?: "reverse" | "forward";
181
+ animated?: boolean;
182
+ speed?: number;
183
+ pulseFrequency?: number;
184
+ }, {
185
+ direction?: "reverse" | "forward";
186
+ animated?: boolean;
187
+ speed?: number;
188
+ pulseFrequency?: number;
189
+ }>;
190
+ type WireAnimationConfig = z.infer<typeof WireAnimationConfigSchema>;
191
+ declare const WireVisualConfigSchema: z.ZodObject<{
192
+ strokeColor: z.ZodString;
193
+ strokeWidth: z.ZodDefault<z.ZodNumber>;
194
+ strokeDashArray: z.ZodOptional<z.ZodString>;
195
+ curveStyle: z.ZodDefault<z.ZodEnum<["bezier", "linear", "orthogonal", "stepped"]>>;
196
+ curvature: z.ZodDefault<z.ZodNumber>;
197
+ opacity: z.ZodDefault<z.ZodNumber>;
198
+ glow: z.ZodDefault<z.ZodBoolean>;
199
+ glowColor: z.ZodOptional<z.ZodString>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ strokeColor?: string;
202
+ strokeWidth?: number;
203
+ strokeDashArray?: string;
204
+ curveStyle?: "bezier" | "linear" | "orthogonal" | "stepped";
205
+ curvature?: number;
206
+ opacity?: number;
207
+ glow?: boolean;
208
+ glowColor?: string;
209
+ }, {
210
+ strokeColor?: string;
211
+ strokeWidth?: number;
212
+ strokeDashArray?: string;
213
+ curveStyle?: "bezier" | "linear" | "orthogonal" | "stepped";
214
+ curvature?: number;
215
+ opacity?: number;
216
+ glow?: boolean;
217
+ glowColor?: string;
218
+ }>;
219
+ type WireVisualConfig = z.infer<typeof WireVisualConfigSchema>;
220
+ declare const NodeDimensions2DSchema: z.ZodObject<{
221
+ width: z.ZodNumber;
222
+ height: z.ZodNumber;
223
+ minWidth: z.ZodOptional<z.ZodNumber>;
224
+ minHeight: z.ZodOptional<z.ZodNumber>;
225
+ maxWidth: z.ZodOptional<z.ZodNumber>;
226
+ maxHeight: z.ZodOptional<z.ZodNumber>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ width?: number;
229
+ height?: number;
230
+ minWidth?: number;
231
+ minHeight?: number;
232
+ maxWidth?: number;
233
+ maxHeight?: number;
234
+ }, {
235
+ width?: number;
236
+ height?: number;
237
+ minWidth?: number;
238
+ minHeight?: number;
239
+ maxWidth?: number;
240
+ maxHeight?: number;
241
+ }>;
242
+ type NodeDimensions2D = z.infer<typeof NodeDimensions2DSchema>;
243
+ declare const NodeScreenRect2DSchema: z.ZodObject<{
244
+ x: z.ZodNumber;
245
+ y: z.ZodNumber;
246
+ width: z.ZodNumber;
247
+ height: z.ZodNumber;
248
+ }, "strip", z.ZodTypeAny, {
249
+ x?: number;
250
+ y?: number;
251
+ width?: number;
252
+ height?: number;
253
+ }, {
254
+ x?: number;
255
+ y?: number;
256
+ width?: number;
257
+ height?: number;
258
+ }>;
259
+ type NodeScreenRect2D = z.infer<typeof NodeScreenRect2DSchema>;
260
+ declare const NodeHeaderStyleSchema: z.ZodObject<{
261
+ backgroundColor: z.ZodOptional<z.ZodString>;
262
+ titleColor: z.ZodOptional<z.ZodString>;
263
+ iconColor: z.ZodOptional<z.ZodString>;
264
+ badgeColor: z.ZodOptional<z.ZodString>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ backgroundColor?: string;
267
+ titleColor?: string;
268
+ iconColor?: string;
269
+ badgeColor?: string;
270
+ }, {
271
+ backgroundColor?: string;
272
+ titleColor?: string;
273
+ iconColor?: string;
274
+ badgeColor?: string;
275
+ }>;
276
+ type NodeHeaderStyle = z.infer<typeof NodeHeaderStyleSchema>;
277
+ declare const AudioBusConfigSchema: z.ZodObject<{
278
+ channelCount: z.ZodDefault<z.ZodNumber>;
279
+ sampleRate: z.ZodDefault<z.ZodNumber>;
280
+ bufferSize: z.ZodDefault<z.ZodNumber>;
281
+ latencyHint: z.ZodDefault<z.ZodEnum<["interactive", "balanced", "playback"]>>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ channelCount?: number;
284
+ sampleRate?: number;
285
+ bufferSize?: number;
286
+ latencyHint?: "interactive" | "balanced" | "playback";
287
+ }, {
288
+ channelCount?: number;
289
+ sampleRate?: number;
290
+ bufferSize?: number;
291
+ latencyHint?: "interactive" | "balanced" | "playback";
292
+ }>;
293
+ type AudioBusConfig = z.infer<typeof AudioBusConfigSchema>;
294
+ declare const AudioHardwareStateSchema: z.ZodObject<{
295
+ contextState: z.ZodEnum<["suspended", "running", "closed", "uninitialized"]>;
296
+ sampleRate: z.ZodNumber;
297
+ inputChannels: z.ZodNumber;
298
+ outputChannels: z.ZodNumber;
299
+ activeInputDeviceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ activeOutputDeviceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ sampleRate?: number;
303
+ contextState?: "suspended" | "running" | "closed" | "uninitialized";
304
+ inputChannels?: number;
305
+ outputChannels?: number;
306
+ activeInputDeviceId?: string;
307
+ activeOutputDeviceId?: string;
308
+ }, {
309
+ sampleRate?: number;
310
+ contextState?: "suspended" | "running" | "closed" | "uninitialized";
311
+ inputChannels?: number;
312
+ outputChannels?: number;
313
+ activeInputDeviceId?: string;
314
+ activeOutputDeviceId?: string;
315
+ }>;
316
+ type AudioHardwareState = z.infer<typeof AudioHardwareStateSchema>;
317
+ declare const MidiCommandTypeSchema: z.ZodEnum<["NOTE_ON", "NOTE_OFF", "CONTROL_CHANGE", "PITCH_BEND", "PROGRAM_CHANGE", "AFTERTOUCH", "POLY_PRESSURE", "CLOCK", "START", "CONTINUE", "STOP", "ACTIVE_SENSING", "SYSTEM_RESET"]>;
318
+ type MidiCommandType = z.infer<typeof MidiCommandTypeSchema>;
319
+ declare const MidiEventPayloadSchema: z.ZodObject<{
320
+ command: z.ZodEnum<["NOTE_ON", "NOTE_OFF", "CONTROL_CHANGE", "PITCH_BEND", "PROGRAM_CHANGE", "AFTERTOUCH", "POLY_PRESSURE", "CLOCK", "START", "CONTINUE", "STOP", "ACTIVE_SENSING", "SYSTEM_RESET"]>;
321
+ channel: z.ZodDefault<z.ZodNumber>;
322
+ note: z.ZodOptional<z.ZodNumber>;
323
+ velocity: z.ZodOptional<z.ZodNumber>;
324
+ controller: z.ZodOptional<z.ZodNumber>;
325
+ value: z.ZodOptional<z.ZodNumber>;
326
+ timestamp: z.ZodOptional<z.ZodNumber>;
327
+ }, "strip", z.ZodTypeAny, {
328
+ timestamp?: number;
329
+ value?: number;
330
+ command?: "NOTE_ON" | "NOTE_OFF" | "CONTROL_CHANGE" | "PITCH_BEND" | "PROGRAM_CHANGE" | "AFTERTOUCH" | "POLY_PRESSURE" | "CLOCK" | "START" | "CONTINUE" | "STOP" | "ACTIVE_SENSING" | "SYSTEM_RESET";
331
+ channel?: number;
332
+ note?: number;
333
+ velocity?: number;
334
+ controller?: number;
335
+ }, {
336
+ timestamp?: number;
337
+ value?: number;
338
+ command?: "NOTE_ON" | "NOTE_OFF" | "CONTROL_CHANGE" | "PITCH_BEND" | "PROGRAM_CHANGE" | "AFTERTOUCH" | "POLY_PRESSURE" | "CLOCK" | "START" | "CONTINUE" | "STOP" | "ACTIVE_SENSING" | "SYSTEM_RESET";
339
+ channel?: number;
340
+ note?: number;
341
+ velocity?: number;
342
+ controller?: number;
343
+ }>;
344
+ type MidiEventPayload = z.infer<typeof MidiEventPayloadSchema>;
345
+ declare const BackendOperationSchema: z.ZodObject<{
346
+ name: z.ZodString;
347
+ service: z.ZodString;
348
+ description: z.ZodOptional<z.ZodString>;
349
+ inputSchemaName: z.ZodOptional<z.ZodString>;
350
+ outputSchemaName: z.ZodOptional<z.ZodString>;
351
+ }, "strip", z.ZodTypeAny, {
352
+ name?: string;
353
+ description?: string;
354
+ service?: string;
355
+ inputSchemaName?: string;
356
+ outputSchemaName?: string;
357
+ }, {
358
+ name?: string;
359
+ description?: string;
360
+ service?: string;
361
+ inputSchemaName?: string;
362
+ outputSchemaName?: string;
363
+ }>;
364
+ type BackendOperation = z.infer<typeof BackendOperationSchema>;
365
+ declare const PublicContractDefinitionSchema: z.ZodObject<{
366
+ package: z.ZodString;
367
+ version: z.ZodString;
368
+ description: z.ZodString;
369
+ exports: z.ZodRecord<z.ZodString, z.ZodObject<{
370
+ types: z.ZodString;
371
+ import: z.ZodString;
372
+ default: z.ZodString;
373
+ }, "strip", z.ZodTypeAny, {
374
+ types?: string;
375
+ import?: string;
376
+ default?: string;
377
+ }, {
378
+ types?: string;
379
+ import?: string;
380
+ default?: string;
381
+ }>>;
382
+ symbols: z.ZodArray<z.ZodObject<{
383
+ name: z.ZodString;
384
+ subpath: z.ZodString;
385
+ kind: z.ZodEnum<["class", "type", "interface", "function", "const", "object"]>;
386
+ hasZodSchema: z.ZodBoolean;
387
+ }, "strip", z.ZodTypeAny, {
388
+ name?: string;
389
+ subpath?: string;
390
+ kind?: "object" | "function" | "type" | "class" | "interface" | "const";
391
+ hasZodSchema?: boolean;
392
+ }, {
393
+ name?: string;
394
+ subpath?: string;
395
+ kind?: "object" | "function" | "type" | "class" | "interface" | "const";
396
+ hasZodSchema?: boolean;
397
+ }>, "many">;
398
+ facades: z.ZodArray<z.ZodObject<{
399
+ id: z.ZodString;
400
+ name: z.ZodString;
401
+ subpath: z.ZodString;
402
+ runtime: z.ZodEnum<["client", "server"]>;
403
+ deployment: z.ZodEnum<["local", "remote"]>;
404
+ }, "strip", z.ZodTypeAny, {
405
+ id?: string;
406
+ name?: string;
407
+ subpath?: string;
408
+ runtime?: "client" | "server";
409
+ deployment?: "local" | "remote";
410
+ }, {
411
+ id?: string;
412
+ name?: string;
413
+ subpath?: string;
414
+ runtime?: "client" | "server";
415
+ deployment?: "local" | "remote";
416
+ }>, "many">;
417
+ invariants: z.ZodArray<z.ZodString, "many">;
418
+ }, "strip", z.ZodTypeAny, {
419
+ package?: string;
420
+ version?: string;
421
+ facades?: {
422
+ id?: string;
423
+ name?: string;
424
+ subpath?: string;
425
+ runtime?: "client" | "server";
426
+ deployment?: "local" | "remote";
427
+ }[];
428
+ description?: string;
429
+ exports?: Record<string, {
430
+ types?: string;
431
+ import?: string;
432
+ default?: string;
433
+ }>;
434
+ symbols?: {
435
+ name?: string;
436
+ subpath?: string;
437
+ kind?: "object" | "function" | "type" | "class" | "interface" | "const";
438
+ hasZodSchema?: boolean;
439
+ }[];
440
+ invariants?: string[];
441
+ }, {
442
+ package?: string;
443
+ version?: string;
444
+ facades?: {
445
+ id?: string;
446
+ name?: string;
447
+ subpath?: string;
448
+ runtime?: "client" | "server";
449
+ deployment?: "local" | "remote";
450
+ }[];
451
+ description?: string;
452
+ exports?: Record<string, {
453
+ types?: string;
454
+ import?: string;
455
+ default?: string;
456
+ }>;
457
+ symbols?: {
458
+ name?: string;
459
+ subpath?: string;
460
+ kind?: "object" | "function" | "type" | "class" | "interface" | "const";
461
+ hasZodSchema?: boolean;
462
+ }[];
463
+ invariants?: string[];
464
+ }>;
465
+ type PublicContractDefinition = z.infer<typeof PublicContractDefinitionSchema>;
466
+ declare const ContractSnapshotSchema: z.ZodObject<{
467
+ package: z.ZodString;
468
+ version: z.ZodString;
469
+ timestamp: z.ZodNumber;
470
+ checksum: z.ZodString;
471
+ publicSymbols: z.ZodArray<z.ZodString, "many">;
472
+ normalizedSignatures: z.ZodRecord<z.ZodString, z.ZodString>;
473
+ zodFingerprints: z.ZodRecord<z.ZodString, z.ZodString>;
474
+ facades: z.ZodArray<z.ZodString, "many">;
475
+ events: z.ZodArray<z.ZodString, "many">;
476
+ commands: z.ZodArray<z.ZodString, "many">;
477
+ errorCodes: z.ZodArray<z.ZodString, "many">;
478
+ }, "strip", z.ZodTypeAny, {
479
+ package?: string;
480
+ version?: string;
481
+ timestamp?: number;
482
+ checksum?: string;
483
+ publicSymbols?: string[];
484
+ normalizedSignatures?: Record<string, string>;
485
+ zodFingerprints?: Record<string, string>;
486
+ facades?: string[];
487
+ events?: string[];
488
+ commands?: string[];
489
+ errorCodes?: string[];
490
+ }, {
491
+ package?: string;
492
+ version?: string;
493
+ timestamp?: number;
494
+ checksum?: string;
495
+ publicSymbols?: string[];
496
+ normalizedSignatures?: Record<string, string>;
497
+ zodFingerprints?: Record<string, string>;
498
+ facades?: string[];
499
+ events?: string[];
500
+ commands?: string[];
501
+ errorCodes?: string[];
502
+ }>;
503
+ type ContractSnapshot = z.infer<typeof ContractSnapshotSchema>;
504
+
505
+ /**
506
+ * @file snapshot.ts
507
+ * @description Contract snapshot generator, diff engine, and semantic versioning rules.
508
+ * Enforces:
509
+ * implementation_only => PATCH
510
+ * additive_compatible => MINOR
511
+ * breaking_contract_change => MAJOR
512
+ */
513
+
514
+ interface ContractDiffResult {
515
+ versionRecommendation: 'PATCH' | 'MINOR' | 'MAJOR';
516
+ hasBreakingChanges: boolean;
517
+ hasAdditiveChanges: boolean;
518
+ isIdentical: boolean;
519
+ removedSymbols: string[];
520
+ addedSymbols: string[];
521
+ changedSignatures: string[];
522
+ summary: string;
523
+ }
524
+ /**
525
+ * Generate canonical contract snapshot for Kloks.
526
+ */
527
+ declare function createKloksSnapshot(version?: string, surface?: ExportSymbolEntry[]): ContractSnapshot;
528
+ /**
529
+ * Computes semantic diff between previous and current contract snapshots.
530
+ */
531
+ declare function diffContractSnapshots(previous: ContractSnapshot, current: ContractSnapshot): ContractDiffResult;
532
+
533
+ declare const KLOKS_CANONICAL_CONTRACT: {
534
+ package: string;
535
+ version: string;
536
+ getSnapshot: () => {
537
+ package?: string;
538
+ version?: string;
539
+ timestamp?: number;
540
+ checksum?: string;
541
+ publicSymbols?: string[];
542
+ normalizedSignatures?: Record<string, string>;
543
+ zodFingerprints?: Record<string, string>;
544
+ facades?: string[];
545
+ events?: string[];
546
+ commands?: string[];
547
+ errorCodes?: string[];
548
+ };
549
+ validateCompatibility: (consumerSymbols?: string[]) => CompatibilityCheckResult;
550
+ };
551
+
552
+ export { type AudioBusConfig, AudioBusConfigSchema, type AudioHardwareState, AudioHardwareStateSchema, type BackendOperation, BackendOperationSchema, type CompatibilityCheckResult, type ContractDiffResult, type ContractSnapshot, ContractSnapshotSchema, type ExportSymbolEntry, type GraphEntityMetadata, GraphEntityMetadataSchema, KLOKS_CANONICAL_CONTRACT, KLOKS_PUBLIC_SURFACE, type MidiCommandType, MidiCommandTypeSchema, type MidiEventPayload, MidiEventPayloadSchema, type NodeDimensions2D, NodeDimensions2DSchema, type NodeHeaderStyle, NodeHeaderStyleSchema, type NodeScreenRect2D, NodeScreenRect2DSchema, type PublicContractDefinition, PublicContractDefinitionSchema, QWNSR_REQUIRED_SURFACE, type SocketDirection, SocketDirectionSchema, type SocketGeometryConfig, SocketGeometryConfigSchema, type SocketPosition2D, SocketPosition2DSchema, type SocketStyleConfig, SocketStyleConfigSchema, type WireAnimationConfig, WireAnimationConfigSchema, type WireCurveStyle, WireCurveStyleSchema, type WireEndpoint2D, WireEndpoint2DSchema, type WireVisualConfig, WireVisualConfigSchema, createKloksSnapshot, diffContractSnapshots, validateConsumerSurfaceCompatibility };