@feltdb/core 0.6.9 → 0.6.11

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 (122) hide show
  1. package/dist/cli/application-lifecycle.js +112 -0
  2. package/dist/cli/application.js +10 -0
  3. package/dist/cli/commands.js +407 -119
  4. package/dist/cli/development-session.js +54 -0
  5. package/dist/cli/index.js +1 -1
  6. package/dist/cli/workspace-integration.js +146 -20
  7. package/dist/collection.d.ts +110 -2
  8. package/dist/collection.d.ts.map +1 -1
  9. package/dist/collection.js +228 -3
  10. package/dist/create/cli.js +4 -2
  11. package/dist/create/create.js +42 -6
  12. package/dist/create/frameworks.js +18 -0
  13. package/dist/create/package-versions.js +1 -1
  14. package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +408 -178
  15. package/dist/create/server-source/crates/feltdb/src/lib.rs +49 -5
  16. package/dist/create/server-source/crates/feltdb/src/multi_operation_transaction.rs +659 -0
  17. package/dist/create/server-source/crates/feltdb/src/p1_application_atomicity.rs +285 -0
  18. package/dist/create/server-source/crates/feltdb/src/p1_atomicity_acceptance.rs +582 -0
  19. package/dist/create/server-source/crates/feltdb-server/src/main.rs +141 -0
  20. package/dist/create/workspace-initialization.js +4 -5
  21. package/dist/db.d.ts +63 -1
  22. package/dist/db.d.ts.map +1 -1
  23. package/dist/db.js +145 -4
  24. package/dist/development-runtime-bridge.d.ts +60 -0
  25. package/dist/development-runtime-bridge.d.ts.map +1 -0
  26. package/dist/development-runtime-bridge.js +171 -0
  27. package/dist/embedded-transaction.d.ts +77 -0
  28. package/dist/embedded-transaction.d.ts.map +1 -0
  29. package/dist/embedded-transaction.js +102 -0
  30. package/dist/feltdb.d.ts +49 -1
  31. package/dist/feltdb.d.ts.map +1 -1
  32. package/dist/file-db.d.ts +33 -0
  33. package/dist/file-db.d.ts.map +1 -1
  34. package/dist/file-db.js +128 -4
  35. package/dist/freshness.d.ts +119 -0
  36. package/dist/freshness.d.ts.map +1 -0
  37. package/dist/freshness.js +115 -0
  38. package/dist/http-db.d.ts +48 -0
  39. package/dist/http-db.d.ts.map +1 -1
  40. package/dist/http-db.js +77 -1
  41. package/dist/index-backend.d.ts +8 -0
  42. package/dist/index-backend.d.ts.map +1 -1
  43. package/dist/index-backend.js +13 -0
  44. package/dist/index-core.d.ts +80 -0
  45. package/dist/index-core.d.ts.map +1 -0
  46. package/dist/index-core.js +74 -0
  47. package/dist/index-manager.d.ts +11 -0
  48. package/dist/index-manager.d.ts.map +1 -1
  49. package/dist/index-manager.js +30 -13
  50. package/dist/index-types.d.ts +17 -0
  51. package/dist/index-types.d.ts.map +1 -1
  52. package/dist/index.browser.d.ts +14 -0
  53. package/dist/index.browser.d.ts.map +1 -0
  54. package/dist/index.browser.js +13 -0
  55. package/dist/index.d.ts +8 -59
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +11 -54
  58. package/dist/indexeddb-db.d.ts +32 -0
  59. package/dist/indexeddb-db.d.ts.map +1 -1
  60. package/dist/indexeddb-db.js +151 -1
  61. package/dist/memory-db.d.ts +26 -0
  62. package/dist/memory-db.d.ts.map +1 -1
  63. package/dist/memory-db.js +86 -0
  64. package/dist/runtime-registry.d.ts +32 -0
  65. package/dist/runtime-registry.d.ts.map +1 -0
  66. package/dist/runtime-registry.js +38 -0
  67. package/dist/studio/app.d.ts +2 -1
  68. package/dist/studio/app.d.ts.map +1 -1
  69. package/dist/studio/components/StateExplorer.d.ts +2 -1
  70. package/dist/studio/components/StateExplorer.d.ts.map +1 -1
  71. package/dist/studio/components/index.js +1 -1
  72. package/dist/studio/{components-9kDSWiGL.js → components-C5p2TfIU.js} +25 -14
  73. package/dist/studio/index.js +234 -160
  74. package/dist/studio-app/assets/{feltdb_wasm-B4wq4mqp.js → feltdb_wasm-CJv3wHzi.js} +1 -1
  75. package/dist/studio-app/assets/feltdb_wasm_bg-C8TG8r2n.wasm +0 -0
  76. package/dist/studio-app/assets/index-DospFFYE.js +28 -0
  77. package/dist/studio-app/index.html +1 -1
  78. package/dist/transaction.d.ts +98 -0
  79. package/dist/transaction.d.ts.map +1 -0
  80. package/dist/transaction.js +86 -0
  81. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  82. package/dist/workspace/browser.d.ts +22 -0
  83. package/dist/workspace/browser.d.ts.map +1 -0
  84. package/dist/workspace/browser.js +17 -0
  85. package/dist/workspace/development-node.d.ts +16 -0
  86. package/dist/workspace/development-node.d.ts.map +1 -1
  87. package/dist/workspace/development-node.js +85 -1
  88. package/dist/workspace/git-identity.d.ts +35 -0
  89. package/dist/workspace/git-identity.d.ts.map +1 -0
  90. package/dist/workspace/git-identity.js +81 -0
  91. package/dist/workspace/index.d.ts +12 -2
  92. package/dist/workspace/index.d.ts.map +1 -1
  93. package/dist/workspace/index.js +7 -1
  94. package/dist/workspace/investigation-analysis.d.ts +47 -0
  95. package/dist/workspace/investigation-analysis.d.ts.map +1 -0
  96. package/dist/workspace/investigation-analysis.js +181 -0
  97. package/dist/workspace/investigation-lifecycle-manager.d.ts +88 -0
  98. package/dist/workspace/investigation-lifecycle-manager.d.ts.map +1 -0
  99. package/dist/workspace/investigation-lifecycle-manager.js +259 -0
  100. package/dist/workspace/investigation-supervisor.d.ts +100 -0
  101. package/dist/workspace/investigation-supervisor.d.ts.map +1 -0
  102. package/dist/workspace/investigation-supervisor.js +238 -0
  103. package/dist/workspace/runtime-investigation.d.ts +5 -1
  104. package/dist/workspace/runtime-investigation.d.ts.map +1 -1
  105. package/dist/workspace/runtime-investigation.js +50 -21
  106. package/dist/workspace/runtime-observation.d.ts +82 -0
  107. package/dist/workspace/runtime-observation.d.ts.map +1 -0
  108. package/dist/workspace/runtime-observation.js +170 -0
  109. package/dist/workspace/runtime-observer.d.ts +57 -0
  110. package/dist/workspace/runtime-observer.d.ts.map +1 -0
  111. package/dist/workspace/runtime-observer.js +272 -0
  112. package/dist/workspace/workspace-connection.d.ts.map +1 -1
  113. package/dist/workspace/workspace-connection.js +14 -5
  114. package/dist/workspace/workspace-identity.d.ts +1 -1
  115. package/dist/workspace/workspace-identity.d.ts.map +1 -1
  116. package/dist/workspace/workspace-identity.js +4 -4
  117. package/dist/workspace/workspace-types.d.ts +208 -0
  118. package/dist/workspace/workspace-types.d.ts.map +1 -1
  119. package/package.json +12 -4
  120. package/dist/create/server-source/crates/feltdb/src/phase_1c_three_node.rs +0 -523
  121. package/dist/studio-app/assets/feltdb_wasm_bg-Ceyi7l21.wasm +0 -0
  122. package/dist/studio-app/assets/index-BF45M757.js +0 -28
@@ -1,4 +1,4 @@
1
- import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, x as y, y as b } from "./components-9kDSWiGL.js";
1
+ import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, x as y, y as b } from "./components-C5p2TfIU.js";
2
2
  import { t as x } from "./KeyManagementPanel-DZuSeWBK.js";
3
3
  import { ManagedInstanceUtil as S } from "./utils/managed-instance.js";
4
4
  import { ManagedInstancePanel as C } from "./components/ManagedInstancePanel.js";
@@ -8,8 +8,8 @@ import { BrowserRouter as I, Link as L, Route as R, Routes as z } from "react-ro
8
8
  import { jsx as B, jsxs as V } from "react/jsx-runtime";
9
9
  import { parseFlowSpec as H } from "@feltdb/core";
10
10
  //#region src/app.tsx
11
- function U({ db: s, remoteUrl: b = "", token: S = "", namespace: C = "default", deploymentRuntime: w = "browser", applicationUrl: T = "", onConnect: E }) {
12
- let [D, O] = F(null), k = e(s || null, C), A = o(s || null, D, C), { diagnostics: j } = n(s || null), M = v(s || null), [N, U] = F(), W = w !== "browser" || !!b, G = (e) => ({
11
+ function U({ db: s, remoteUrl: b = "", token: S = "", namespace: C = "default", deploymentRuntime: w = "browser", applicationUrl: T = "", developmentSession: E, onConnect: D }) {
12
+ let [O, k] = F(null), A = e(s || null, C), j = o(s || null, O, C), { diagnostics: M } = n(s || null), N = v(s || null), [U, W] = F(), G = w !== "browser" || !!b, [K, q] = F([]), [J, Y] = F([]), [X, Z] = F(0), Q = (e) => ({
13
13
  pathname: e,
14
14
  search: window.location.search
15
15
  });
@@ -18,30 +18,56 @@ function U({ db: s, remoteUrl: b = "", token: S = "", namespace: C = "default",
18
18
  return fetch("/_feltdb/project", { cache: "no-store" }).then(async (t) => {
19
19
  if (!t.ok) throw Error("No project model endpoint");
20
20
  let n = await t.json();
21
- e && O(H(n.source));
21
+ e && k(H(n.source));
22
22
  }).catch(async () => {
23
23
  let t = s ? await s.collection("_flow_apps").all() : [];
24
- e && t[0]?.spec && O(t[0].spec);
24
+ e && t[0]?.spec && k(t[0].spec);
25
25
  }), () => {
26
26
  e = !1;
27
27
  };
28
- }, [s]), /* @__PURE__ */ B(I, { children: /* @__PURE__ */ V("div", {
28
+ }, [s]), P(() => {
29
+ if (!E?.sessionId) return;
30
+ let e = !0, t = () => void fetch("/_feltdb/runtime", { cache: "no-store" }).then((e) => e.ok ? e.json() : { runtimes: [] }).then((t) => {
31
+ e && q(t.runtimes || []);
32
+ }).catch(() => {
33
+ e && q([]);
34
+ });
35
+ t();
36
+ let n = window.setInterval(t, 2e3);
37
+ return () => {
38
+ e = !1, window.clearInterval(n);
39
+ };
40
+ }, [E?.sessionId]), P(() => {
41
+ let e = K[0]?.runtimeInstanceId;
42
+ if (!e) {
43
+ Y([]);
44
+ return;
45
+ }
46
+ let t = !0, n = 0, r = () => void fetch(`/_feltdb/observations?runtimeInstanceId=${encodeURIComponent(e)}&cursor=${n}&limit=100`, { cache: "no-store" }).then((e) => e.ok ? e.json() : { observations: [] }).then((e) => {
47
+ t && (n = e.nextCursor ?? n, Z(e.dropped || 0), Y((t) => [...t, ...e.observations || []].slice(-200)));
48
+ }).catch(() => void 0);
49
+ r();
50
+ let i = window.setInterval(r, 1e3);
51
+ return () => {
52
+ t = !1, window.clearInterval(i);
53
+ };
54
+ }, [K[0]?.runtimeInstanceId]), /* @__PURE__ */ B(I, { children: /* @__PURE__ */ V("div", {
29
55
  className: "studio-app",
30
56
  children: [/* @__PURE__ */ V("nav", {
31
57
  className: "studio-nav",
32
58
  children: [
33
59
  /* @__PURE__ */ V("div", {
34
60
  className: "nav-header",
35
- children: [/* @__PURE__ */ B("h1", { children: "FeltDB Studio" }), k && /* @__PURE__ */ B("div", {
61
+ children: [/* @__PURE__ */ B("h1", { children: "FeltDB Studio" }), A && /* @__PURE__ */ B("div", {
36
62
  className: "instance-info",
37
- children: k.namespace
63
+ children: A.namespace
38
64
  })]
39
65
  }),
40
66
  /* @__PURE__ */ B("div", {
41
67
  className: "nav-search",
42
68
  children: /* @__PURE__ */ B(d, {
43
69
  db: s,
44
- model: D
70
+ model: O
45
71
  })
46
72
  }),
47
73
  /* @__PURE__ */ V("ul", {
@@ -52,67 +78,71 @@ function U({ db: s, remoteUrl: b = "", token: S = "", namespace: C = "default",
52
78
  children: "Design"
53
79
  }),
54
80
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
55
- to: G("/"),
81
+ to: Q("/"),
56
82
  children: "Application"
57
83
  }) }),
58
84
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
59
- to: G("/capabilities"),
85
+ to: Q("/capabilities"),
60
86
  children: "Capabilities"
61
87
  }) }),
62
88
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
63
- to: G("/workflows"),
89
+ to: Q("/workflows"),
64
90
  children: "Workflows"
65
91
  }) }),
66
92
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
67
- to: G("/agents"),
93
+ to: Q("/agents"),
68
94
  children: "Agents"
69
95
  }) }),
70
96
  /* @__PURE__ */ B("li", {
71
97
  className: "nav-section",
72
98
  children: "Observe"
73
99
  }),
74
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
75
- to: G("/overview"),
100
+ E?.sessionId && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
101
+ to: Q("/activity"),
102
+ children: "Live Activity"
103
+ }) }),
104
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
105
+ to: Q("/overview"),
76
106
  children: "Overview"
77
107
  }) }),
78
108
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
79
- to: G("/data"),
109
+ to: Q("/data"),
80
110
  children: "Data"
81
111
  }) }),
82
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
83
- to: G("/references"),
112
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
113
+ to: Q("/references"),
84
114
  children: "References"
85
115
  }) }),
86
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
87
- to: G("/operations"),
116
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
117
+ to: Q("/operations"),
88
118
  children: "Operations"
89
119
  }) }),
90
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
91
- to: G("/executions"),
120
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
121
+ to: Q("/executions"),
92
122
  children: "Executions"
93
123
  }) }),
94
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
95
- to: G("/peers"),
124
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
125
+ to: Q("/peers"),
96
126
  children: "Peers"
97
127
  }) }),
98
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
99
- to: G("/provenance"),
128
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
129
+ to: Q("/provenance"),
100
130
  children: "Provenance"
101
131
  }) }),
102
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
103
- to: G("/conflicts"),
132
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
133
+ to: Q("/conflicts"),
104
134
  children: "Conflicts"
105
135
  }) }),
106
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
107
- to: G("/health"),
136
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
137
+ to: Q("/health"),
108
138
  children: "Health"
109
139
  }) }),
110
140
  /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
111
- to: G("/settings"),
141
+ to: Q("/settings"),
112
142
  children: "Settings"
113
143
  }) }),
114
- W && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
115
- to: G("/api-keys"),
144
+ G && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(L, {
145
+ to: Q("/api-keys"),
116
146
  children: "API Keys"
117
147
  }) })
118
148
  ]
@@ -120,137 +150,181 @@ function U({ db: s, remoteUrl: b = "", token: S = "", namespace: C = "default",
120
150
  ]
121
151
  }), /* @__PURE__ */ V("main", {
122
152
  className: "studio-content",
123
- children: [!W && /* @__PURE__ */ B("div", {
124
- className: "runtime-notice",
125
- children: "Browser data is read live from the generated application origin through the local Studio bridge."
126
- }), /* @__PURE__ */ V(z, { children: [
127
- /* @__PURE__ */ B(R, {
128
- path: "/",
129
- element: /* @__PURE__ */ B(g, {
130
- db: s,
131
- namespace: C,
132
- projectSpec: D,
133
- onSpecChange: O
134
- })
135
- }),
136
- /* @__PURE__ */ B(R, {
137
- path: "/overview",
138
- element: /* @__PURE__ */ B(y, { stats: A })
139
- }),
140
- /* @__PURE__ */ B(R, {
141
- path: "/data",
142
- element: /* @__PURE__ */ B(u, {
143
- db: s,
144
- model: D,
145
- namespace: C,
146
- applicationUrl: w === "browser" ? T : ""
147
- })
148
- }),
149
- /* @__PURE__ */ B(R, {
150
- path: "/state",
151
- element: /* @__PURE__ */ B(u, {
152
- db: s,
153
- model: D,
154
- namespace: C,
155
- applicationUrl: w === "browser" ? T : ""
156
- })
157
- }),
158
- /* @__PURE__ */ B(R, {
159
- path: "/references",
160
- element: /* @__PURE__ */ B(p, {
161
- db: s,
162
- model: D,
163
- namespace: C
164
- })
165
- }),
166
- /* @__PURE__ */ B(R, {
167
- path: "/operations",
168
- element: /* @__PURE__ */ B(a, {
169
- db: s,
170
- model: D,
171
- namespace: C
172
- })
173
- }),
174
- /* @__PURE__ */ B(R, {
175
- path: "/peers",
176
- element: /* @__PURE__ */ B(i, {
177
- peers: M,
178
- localInstance: k?.instanceId
179
- })
180
- }),
181
- /* @__PURE__ */ B(R, {
182
- path: "/capabilities",
183
- element: /* @__PURE__ */ B(_, {
184
- db: s,
185
- model: D
186
- })
187
- }),
188
- /* @__PURE__ */ B(R, {
189
- path: "/executions",
190
- element: /* @__PURE__ */ B(l, {
191
- db: s,
192
- model: D
193
- })
194
- }),
195
- /* @__PURE__ */ B(R, {
196
- path: "/workflows",
197
- element: /* @__PURE__ */ B(h, {
198
- db: s,
199
- model: D
200
- })
201
- }),
202
- /* @__PURE__ */ B(R, {
203
- path: "/agents",
204
- element: /* @__PURE__ */ B(f, {
205
- db: s,
206
- model: D
207
- })
208
- }),
209
- /* @__PURE__ */ B(R, {
210
- path: "/provenance",
211
- element: /* @__PURE__ */ B(t, {
212
- db: s,
213
- model: D,
214
- namespace: C,
215
- reference: N
216
- })
217
- }),
218
- /* @__PURE__ */ B(R, {
219
- path: "/conflicts",
220
- element: /* @__PURE__ */ B(r, {
221
- db: s,
222
- diagnostics: j
223
- })
224
- }),
225
- /* @__PURE__ */ B(R, {
226
- path: "/health",
227
- element: /* @__PURE__ */ B(c, {
228
- diagnostics: j,
229
- model: D
230
- })
153
+ children: [
154
+ E?.sessionId && /* @__PURE__ */ V("div", {
155
+ className: "runtime-notice",
156
+ children: ["Application runtime: ", K.length ? `Connected (${K[0].runtime}, ${K[0].namespace})` : "Not connected"]
231
157
  }),
232
- /* @__PURE__ */ B(R, {
233
- path: "/settings",
234
- element: /* @__PURE__ */ B(m, {
235
- db: s,
236
- remoteUrl: b,
237
- token: S,
238
- onConnect: E
239
- })
158
+ !G && /* @__PURE__ */ B("div", {
159
+ className: "runtime-notice",
160
+ children: "Browser data is read live from the generated application origin through the local Studio bridge."
240
161
  }),
241
- /* @__PURE__ */ B(R, {
242
- path: "/api-keys",
243
- element: /* @__PURE__ */ V("div", {
244
- style: { padding: "2rem" },
245
- children: [/* @__PURE__ */ B("h1", { children: "API Key Management" }), /* @__PURE__ */ B(x, {
246
- apiUrl: b,
247
- token: S,
162
+ /* @__PURE__ */ V(z, { children: [
163
+ /* @__PURE__ */ B(R, {
164
+ path: "/",
165
+ element: /* @__PURE__ */ B(g, {
166
+ db: s,
248
167
  namespace: C,
249
- onConfigure: () => window.location.assign("/settings")
250
- })]
168
+ projectSpec: O,
169
+ onSpecChange: k
170
+ })
171
+ }),
172
+ /* @__PURE__ */ B(R, {
173
+ path: "/overview",
174
+ element: /* @__PURE__ */ B(y, { stats: j })
175
+ }),
176
+ /* @__PURE__ */ B(R, {
177
+ path: "/activity",
178
+ element: /* @__PURE__ */ V("div", {
179
+ className: "runtime-activity",
180
+ children: [
181
+ /* @__PURE__ */ B("h1", { children: "Live Activity" }),
182
+ /* @__PURE__ */ V("p", { children: [
183
+ J.some((e) => Date.now() - e.timestamp < 5e3) ? "Active" : "Idle",
184
+ " · Runtime ",
185
+ K[0]?.runtimeInstanceId || "not connected"
186
+ ] }),
187
+ X > 0 && /* @__PURE__ */ V("p", {
188
+ className: "runtime-notice",
189
+ children: [
190
+ "Observation is incomplete: ",
191
+ X,
192
+ " events dropped."
193
+ ]
194
+ }),
195
+ /* @__PURE__ */ V("table", { children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ V("tr", { children: [
196
+ /* @__PURE__ */ B("th", { children: "Time" }),
197
+ /* @__PURE__ */ B("th", { children: "Operation" }),
198
+ /* @__PURE__ */ B("th", { children: "Collection" }),
199
+ /* @__PURE__ */ B("th", { children: "Status" }),
200
+ /* @__PURE__ */ B("th", { children: "Duration" })
201
+ ] }) }), /* @__PURE__ */ B("tbody", { children: [...J].reverse().map((e) => /* @__PURE__ */ V("tr", { children: [
202
+ /* @__PURE__ */ B("td", { children: new Date(e.timestamp).toLocaleTimeString() }),
203
+ /* @__PURE__ */ B("td", { children: e.operation?.type }),
204
+ /* @__PURE__ */ B("td", { children: e.operation?.collection || "—" }),
205
+ /* @__PURE__ */ B("td", { children: e.status }),
206
+ /* @__PURE__ */ B("td", { children: e.durationMs === void 0 ? "—" : `${e.durationMs} ms` })
207
+ ] }, e.cursor || e.eventId)) })] })
208
+ ]
209
+ })
210
+ }),
211
+ /* @__PURE__ */ B(R, {
212
+ path: "/data",
213
+ element: /* @__PURE__ */ B(u, {
214
+ db: s,
215
+ model: O,
216
+ namespace: C,
217
+ applicationUrl: w === "browser" ? T : "",
218
+ developmentSession: E
219
+ })
220
+ }),
221
+ /* @__PURE__ */ B(R, {
222
+ path: "/state",
223
+ element: /* @__PURE__ */ B(u, {
224
+ db: s,
225
+ model: O,
226
+ namespace: C,
227
+ applicationUrl: w === "browser" ? T : "",
228
+ developmentSession: E
229
+ })
230
+ }),
231
+ /* @__PURE__ */ B(R, {
232
+ path: "/references",
233
+ element: /* @__PURE__ */ B(p, {
234
+ db: s,
235
+ model: O,
236
+ namespace: C
237
+ })
238
+ }),
239
+ /* @__PURE__ */ B(R, {
240
+ path: "/operations",
241
+ element: /* @__PURE__ */ B(a, {
242
+ db: s,
243
+ model: O,
244
+ namespace: C
245
+ })
246
+ }),
247
+ /* @__PURE__ */ B(R, {
248
+ path: "/peers",
249
+ element: /* @__PURE__ */ B(i, {
250
+ peers: N,
251
+ localInstance: A?.instanceId
252
+ })
253
+ }),
254
+ /* @__PURE__ */ B(R, {
255
+ path: "/capabilities",
256
+ element: /* @__PURE__ */ B(_, {
257
+ db: s,
258
+ model: O
259
+ })
260
+ }),
261
+ /* @__PURE__ */ B(R, {
262
+ path: "/executions",
263
+ element: /* @__PURE__ */ B(l, {
264
+ db: s,
265
+ model: O
266
+ })
267
+ }),
268
+ /* @__PURE__ */ B(R, {
269
+ path: "/workflows",
270
+ element: /* @__PURE__ */ B(h, {
271
+ db: s,
272
+ model: O
273
+ })
274
+ }),
275
+ /* @__PURE__ */ B(R, {
276
+ path: "/agents",
277
+ element: /* @__PURE__ */ B(f, {
278
+ db: s,
279
+ model: O
280
+ })
281
+ }),
282
+ /* @__PURE__ */ B(R, {
283
+ path: "/provenance",
284
+ element: /* @__PURE__ */ B(t, {
285
+ db: s,
286
+ model: O,
287
+ namespace: C,
288
+ reference: U
289
+ })
290
+ }),
291
+ /* @__PURE__ */ B(R, {
292
+ path: "/conflicts",
293
+ element: /* @__PURE__ */ B(r, {
294
+ db: s,
295
+ diagnostics: M
296
+ })
297
+ }),
298
+ /* @__PURE__ */ B(R, {
299
+ path: "/health",
300
+ element: /* @__PURE__ */ B(c, {
301
+ diagnostics: M,
302
+ model: O
303
+ })
304
+ }),
305
+ /* @__PURE__ */ B(R, {
306
+ path: "/settings",
307
+ element: /* @__PURE__ */ B(m, {
308
+ db: s,
309
+ remoteUrl: b,
310
+ token: S,
311
+ onConnect: D
312
+ })
313
+ }),
314
+ /* @__PURE__ */ B(R, {
315
+ path: "/api-keys",
316
+ element: /* @__PURE__ */ V("div", {
317
+ style: { padding: "2rem" },
318
+ children: [/* @__PURE__ */ B("h1", { children: "API Key Management" }), /* @__PURE__ */ B(x, {
319
+ apiUrl: b,
320
+ token: S,
321
+ namespace: C,
322
+ onConfigure: () => window.location.assign("/settings")
323
+ })]
324
+ })
251
325
  })
252
- })
253
- ] })]
326
+ ] })
327
+ ]
254
328
  })]
255
329
  }) });
256
330
  }
@@ -1 +1 @@
1
- var e=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,T.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,T.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsdb_free(e,0)}acknowledge_peer_operations(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_acknowledge_peer_operations(this.__wbg_ptr,r,i,n);return t.__wrap(a)}add_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_add_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}delete(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_delete(this.__wbg_ptr,n,r);return t.__wrap(i)}execute_canonical_query(e,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.jsdb_execute_canonical_query(this.__wbg_ptr,a,o,s,c,l,u,d,f);return t.__wrap(p)}execute_canonical_transaction(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_execute_canonical_transaction(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}get(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get(this.__wbg_ptr,n,r);return t.__wrap(i)}get_capability_records(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get_capability_records(this.__wbg_ptr,n,r);return t.__wrap(i)}get_pending_for_peer(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_get_pending_for_peer(this.__wbg_ptr,r,i,n);return t.__wrap(a)}get_sequence(){let e=U.jsdb_get_sequence(this.__wbg_ptr);return BigInt.asUintN(64,e)}insert(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_insert(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}instance_id(){let e,t;try{let n=U.jsdb_instance_id(this.__wbg_ptr);return e=n[0],t=n[1],j(n[0],n[1])}finally{U.__wbindgen_free(e,t,1)}}is_auto_indexed(){return U.jsdb_is_auto_indexed(this.__wbg_ptr)!==0}query(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_query(this.__wbg_ptr,n,r);return t.__wrap(i)}remove_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_remove_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}sync_info(){let e=U.jsdb_sync_info(this.__wbg_ptr);return t.__wrap(e)}update(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_update(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);var t=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,E.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsresult_free(e,0)}get data(){let e=U.jsresult_data(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get error(){let e=U.jsresult_error(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get success(){return U.jsresult_success(this.__wbg_ptr)!==0}};Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);var n=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmanalytics_free(e,0)}generate_report(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.wasmanalytics_generate_report(this.__wbg_ptr,o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}get_all_metrics(){let e,t;try{let i=U.wasmanalytics_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_frequent_fields(e){let t,n;try{let a=U.wasmanalytics_get_frequent_fields(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_index_metrics(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmanalytics_get_index_metrics(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_slowest_queries(e){let t,n;try{let a=U.wasmanalytics_get_slowest_queries(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}constructor(){let e=U.wasmanalytics_new();return this.__wbg_ptr=e,D.register(this,this.__wbg_ptr,this),this}record_index_usage(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;U.wasmanalytics_record_index_usage(this.__wbg_ptr,r,i,a,o,n)}record_query(e,t,n,r,i,a){let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H;var u=P(a)?0:F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H;let f=U.wasmanalytics_record_query(this.__wbg_ptr,o,s,c,l,n,r,i,u,d);if(f[1])throw I(f[0])}reset(){U.wasmanalytics_reset(this.__wbg_ptr)}};Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);var r=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,O.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmdistributedindexmanager_free(e,0)}create_replicated_index(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmdistributedindexmanager_create_replicated_index(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}detect_conflicts(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_detect_conflicts(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_status(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_status(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_targets(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_targets(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_sync_status(){let e,t;try{let i=U.wasmdistributedindexmanager_get_sync_status(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}merge_versions(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_merge_versions(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_new(t,n);return this.__wbg_ptr=r,O.register(this,this.__wbg_ptr,this),this}register_peer(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H;U.wasmdistributedindexmanager_register_peer(this.__wbg_ptr,t,n)}set_peer_reachable(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H;U.wasmdistributedindexmanager_set_peer_reachable(this.__wbg_ptr,n,r,t)}};Symbol.dispose&&(r.prototype[Symbol.dispose]=r.prototype.free);var i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmindexmanager_free(e,0)}create_index(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmindexmanager_create_index(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}get_stats(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmindexmanager_get_stats(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}list_indexes(){let e,t;try{let i=U.wasmindexmanager_list_indexes(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}constructor(){let e=U.wasmindexmanager_new();return this.__wbg_ptr=e,k.register(this,this.__wbg_ptr,this),this}query_index(e,t,n){let r,i;try{let s=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.wasmindexmanager_query_index(this.__wbg_ptr,s,c,l,u,d,f);var a=p[0],o=p[1];if(p[3])throw a=0,o=0,I(p[2]);return r=a,i=o,j(a,o)}finally{U.__wbindgen_free(r,i,1)}}update_record(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H;var a=P(t)?0:F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;let s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmindexmanager_update_record(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);var a=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,A.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmshardmanager_free(e,0)}detect_hotspots(){let e,t;try{let i=U.wasmshardmanager_detect_hotspots(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}generate_rebalance_ops(){let e,t;try{let i=U.wasmshardmanager_generate_rebalance_ops(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_all_metrics(){let e,t;try{let i=U.wasmshardmanager_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_distribution_summary(){let e,t;try{let i=U.wasmshardmanager_get_distribution_summary(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_shard_for_key(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmshardmanager_get_shard_for_key(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}initialize_shards(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmshardmanager_initialize_shards(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.wasmshardmanager_new(n,r,i,a);return this.__wbg_ptr=o,A.register(this,this.__wbg_ptr,this),this}record_shard_operation(e,t,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H;U.wasmshardmanager_record_shard_operation(this.__wbg_ptr,a,o,s,c,n,r,i)}};Symbol.dispose&&(a.prototype[Symbol.dispose]=a.prototype.free);function o(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.apply_sync_result(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function s(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.authorize_offline(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function c(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonical_bundle_hash(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function l(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonicalize_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function u(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.compare_state_schemas(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function d(e,t){let n,r;try{var i=P(e)?0:F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H;let c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.diff_application_revisions(i,a,c,l);var o=u[0],s=u[1];if(u[3])throw o=0,s=0,I(u[2]);return n=o,r=s,j(o,s)}finally{U.__wbindgen_free(n,r,1)}}function f(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function p(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.hash_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function m(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function h(t){let n=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.open(n,r);if(i[2])throw I(i[1]);return e.__wrap(i[0])}function g(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.resolve_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function _(e,t,n,r){let i=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.validate_mesh_claim(i,a,o,s,c,l,r);if(u[1])throw I(u[0])}function v(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function y(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_sync_operation(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function b(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_worker_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function x(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_workload_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function S(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.verify_bundle_integrity(t,n);if(r[2])throw I(r[1]);return r[0]!==0}function C(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.verify_signed_grant(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function w(){return{__proto__:null,"./feltdb_wasm_bg.js":{__proto__:null,__wbg___wbindgen_throw_bb96b2010945f0bc:function(e,t){throw Error(j(e,t))},__wbindgen_cast_0000000000000001:function(e,t){return j(e,t)},__wbindgen_init_externref_table:function(){let e=U.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}var T=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsdb_free(e,1)),E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsresult_free(e,1)),D=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmanalytics_free(e,1)),O=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmdistributedindexmanager_free(e,1)),k=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmindexmanager_free(e,1)),A=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmshardmanager_free(e,1));function j(e,t){return B(e>>>0,t)}var M=null;function N(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(U.memory.buffer)),M}function P(e){return e==null}function F(e,t,n){if(n===void 0){let n=V.encode(e),r=t(n.length,1)>>>0;return N().subarray(r,r+n.length).set(n),H=n.length,r}let r=e.length,i=t(r,1)>>>0,a=N(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=N().subarray(i+o,i+r),a=V.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return H=o,i}function I(e){let t=U.__wbindgen_externrefs.get(e);return U.__externref_table_dealloc(e),t}var L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});L.decode();var R=2146435072,z=0;function B(e,t){return z+=t,z>=R&&(L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),z=t),L.decode(N().subarray(e,e+t))}var V=new TextEncoder;`encodeInto`in V||(V.encodeInto=function(e,t){let n=V.encode(e);return t.set(n),{read:e.length,written:n.length}});var H=0,U;function W(e,t){return U=e.exports,M=null,U.__wbindgen_start(),U}async function G(e,t){if(typeof Response==`function`&&e instanceof Response){if(!e.ok)throw Error(`failed to fetch Wasm: ${e.status} ${e.statusText} fetching '${e.url}'`);if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function K(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=w();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),W(new WebAssembly.Instance(e,t),e)}async function q(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/feltdb_wasm_bg-Ceyi7l21.wasm`,``+import.meta.url));let t=w();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await G(await e,t);return W(n,r)}export{e as JsDb,t as JsResult,n as WasmAnalytics,r as WasmDistributedIndexManager,i as WasmIndexManager,a as WasmShardManager,o as apply_sync_result,s as authorize_offline,c as canonical_bundle_hash,l as canonicalize_application_manifest,u as compare_state_schemas,q as default,d as diff_application_revisions,f as hash_application_manifest,p as hash_application_runtime,m as hash_state_schema,K as initSync,h as open,g as resolve_application_runtime,_ as validate_mesh_claim,v as validate_state_schema,y as validate_sync_operation,b as validate_worker_transition,x as validate_workload_transition,S as verify_bundle_integrity,C as verify_signed_grant};
1
+ var e=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,T.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,T.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsdb_free(e,0)}acknowledge_peer_operations(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_acknowledge_peer_operations(this.__wbg_ptr,r,i,n);return t.__wrap(a)}add_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_add_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}delete(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_delete(this.__wbg_ptr,n,r);return t.__wrap(i)}execute_canonical_query(e,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.jsdb_execute_canonical_query(this.__wbg_ptr,a,o,s,c,l,u,d,f);return t.__wrap(p)}execute_canonical_transaction(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_execute_canonical_transaction(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}get(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get(this.__wbg_ptr,n,r);return t.__wrap(i)}get_capability_records(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get_capability_records(this.__wbg_ptr,n,r);return t.__wrap(i)}get_pending_for_peer(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_get_pending_for_peer(this.__wbg_ptr,r,i,n);return t.__wrap(a)}get_sequence(){let e=U.jsdb_get_sequence(this.__wbg_ptr);return BigInt.asUintN(64,e)}insert(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_insert(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}instance_id(){let e,t;try{let n=U.jsdb_instance_id(this.__wbg_ptr);return e=n[0],t=n[1],j(n[0],n[1])}finally{U.__wbindgen_free(e,t,1)}}is_auto_indexed(){return U.jsdb_is_auto_indexed(this.__wbg_ptr)!==0}query(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_query(this.__wbg_ptr,n,r);return t.__wrap(i)}remove_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_remove_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}sync_info(){let e=U.jsdb_sync_info(this.__wbg_ptr);return t.__wrap(e)}update(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_update(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);var t=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,E.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsresult_free(e,0)}get data(){let e=U.jsresult_data(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get error(){let e=U.jsresult_error(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get success(){return U.jsresult_success(this.__wbg_ptr)!==0}};Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);var n=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmanalytics_free(e,0)}generate_report(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.wasmanalytics_generate_report(this.__wbg_ptr,o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}get_all_metrics(){let e,t;try{let i=U.wasmanalytics_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_frequent_fields(e){let t,n;try{let a=U.wasmanalytics_get_frequent_fields(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_index_metrics(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmanalytics_get_index_metrics(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_slowest_queries(e){let t,n;try{let a=U.wasmanalytics_get_slowest_queries(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}constructor(){let e=U.wasmanalytics_new();return this.__wbg_ptr=e,D.register(this,this.__wbg_ptr,this),this}record_index_usage(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;U.wasmanalytics_record_index_usage(this.__wbg_ptr,r,i,a,o,n)}record_query(e,t,n,r,i,a){let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H;var u=P(a)?0:F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H;let f=U.wasmanalytics_record_query(this.__wbg_ptr,o,s,c,l,n,r,i,u,d);if(f[1])throw I(f[0])}reset(){U.wasmanalytics_reset(this.__wbg_ptr)}};Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);var r=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,O.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmdistributedindexmanager_free(e,0)}create_replicated_index(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmdistributedindexmanager_create_replicated_index(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}detect_conflicts(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_detect_conflicts(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_status(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_status(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_targets(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_targets(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_sync_status(){let e,t;try{let i=U.wasmdistributedindexmanager_get_sync_status(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}merge_versions(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_merge_versions(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_new(t,n);return this.__wbg_ptr=r,O.register(this,this.__wbg_ptr,this),this}register_peer(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H;U.wasmdistributedindexmanager_register_peer(this.__wbg_ptr,t,n)}set_peer_reachable(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H;U.wasmdistributedindexmanager_set_peer_reachable(this.__wbg_ptr,n,r,t)}};Symbol.dispose&&(r.prototype[Symbol.dispose]=r.prototype.free);var i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmindexmanager_free(e,0)}create_index(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmindexmanager_create_index(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}get_stats(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmindexmanager_get_stats(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}list_indexes(){let e,t;try{let i=U.wasmindexmanager_list_indexes(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}constructor(){let e=U.wasmindexmanager_new();return this.__wbg_ptr=e,k.register(this,this.__wbg_ptr,this),this}query_index(e,t,n){let r,i;try{let s=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.wasmindexmanager_query_index(this.__wbg_ptr,s,c,l,u,d,f);var a=p[0],o=p[1];if(p[3])throw a=0,o=0,I(p[2]);return r=a,i=o,j(a,o)}finally{U.__wbindgen_free(r,i,1)}}update_record(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H;var a=P(t)?0:F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;let s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmindexmanager_update_record(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);var a=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,A.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmshardmanager_free(e,0)}detect_hotspots(){let e,t;try{let i=U.wasmshardmanager_detect_hotspots(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}generate_rebalance_ops(){let e,t;try{let i=U.wasmshardmanager_generate_rebalance_ops(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_all_metrics(){let e,t;try{let i=U.wasmshardmanager_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_distribution_summary(){let e,t;try{let i=U.wasmshardmanager_get_distribution_summary(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_shard_for_key(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmshardmanager_get_shard_for_key(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}initialize_shards(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmshardmanager_initialize_shards(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.wasmshardmanager_new(n,r,i,a);return this.__wbg_ptr=o,A.register(this,this.__wbg_ptr,this),this}record_shard_operation(e,t,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H;U.wasmshardmanager_record_shard_operation(this.__wbg_ptr,a,o,s,c,n,r,i)}};Symbol.dispose&&(a.prototype[Symbol.dispose]=a.prototype.free);function o(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.apply_sync_result(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function s(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.authorize_offline(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function c(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonical_bundle_hash(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function l(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonicalize_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function u(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.compare_state_schemas(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function d(e,t){let n,r;try{var i=P(e)?0:F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H;let c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.diff_application_revisions(i,a,c,l);var o=u[0],s=u[1];if(u[3])throw o=0,s=0,I(u[2]);return n=o,r=s,j(o,s)}finally{U.__wbindgen_free(n,r,1)}}function f(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function p(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.hash_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function m(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function h(t){let n=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.open(n,r);if(i[2])throw I(i[1]);return e.__wrap(i[0])}function g(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.resolve_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function _(e,t,n,r){let i=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.validate_mesh_claim(i,a,o,s,c,l,r);if(u[1])throw I(u[0])}function v(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function y(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_sync_operation(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function b(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_worker_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function x(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_workload_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function S(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.verify_bundle_integrity(t,n);if(r[2])throw I(r[1]);return r[0]!==0}function C(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.verify_signed_grant(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function w(){return{__proto__:null,"./feltdb_wasm_bg.js":{__proto__:null,__wbg___wbindgen_throw_bb96b2010945f0bc:function(e,t){throw Error(j(e,t))},__wbindgen_cast_0000000000000001:function(e,t){return j(e,t)},__wbindgen_init_externref_table:function(){let e=U.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}var T=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsdb_free(e,1)),E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsresult_free(e,1)),D=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmanalytics_free(e,1)),O=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmdistributedindexmanager_free(e,1)),k=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmindexmanager_free(e,1)),A=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmshardmanager_free(e,1));function j(e,t){return B(e>>>0,t)}var M=null;function N(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(U.memory.buffer)),M}function P(e){return e==null}function F(e,t,n){if(n===void 0){let n=V.encode(e),r=t(n.length,1)>>>0;return N().subarray(r,r+n.length).set(n),H=n.length,r}let r=e.length,i=t(r,1)>>>0,a=N(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=N().subarray(i+o,i+r),a=V.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return H=o,i}function I(e){let t=U.__wbindgen_externrefs.get(e);return U.__externref_table_dealloc(e),t}var L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});L.decode();var R=2146435072,z=0;function B(e,t){return z+=t,z>=R&&(L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),z=t),L.decode(N().subarray(e,e+t))}var V=new TextEncoder;`encodeInto`in V||(V.encodeInto=function(e,t){let n=V.encode(e);return t.set(n),{read:e.length,written:n.length}});var H=0,U;function W(e,t){return U=e.exports,M=null,U.__wbindgen_start(),U}async function G(e,t){if(typeof Response==`function`&&e instanceof Response){if(!e.ok)throw Error(`failed to fetch Wasm: ${e.status} ${e.statusText} fetching '${e.url}'`);if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function K(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=w();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),W(new WebAssembly.Instance(e,t),e)}async function q(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/feltdb_wasm_bg-C8TG8r2n.wasm`,``+import.meta.url));let t=w();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await G(await e,t);return W(n,r)}export{e as JsDb,t as JsResult,n as WasmAnalytics,r as WasmDistributedIndexManager,i as WasmIndexManager,a as WasmShardManager,o as apply_sync_result,s as authorize_offline,c as canonical_bundle_hash,l as canonicalize_application_manifest,u as compare_state_schemas,q as default,d as diff_application_revisions,f as hash_application_manifest,p as hash_application_runtime,m as hash_state_schema,K as initSync,h as open,g as resolve_application_runtime,_ as validate_mesh_claim,v as validate_state_schema,y as validate_sync_operation,b as validate_worker_transition,x as validate_workload_transition,S as verify_bundle_integrity,C as verify_signed_grant};