@feltdb/core 0.12.0 → 0.12.2

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 (138) hide show
  1. package/dist/agent-state.d.ts +489 -0
  2. package/dist/agent-state.d.ts.map +1 -0
  3. package/dist/agent-state.js +993 -0
  4. package/dist/build-identity.json +28 -0
  5. package/dist/cli/commands.js +88 -43
  6. package/dist/collection.d.ts +41 -4
  7. package/dist/collection.d.ts.map +1 -1
  8. package/dist/collection.js +116 -47
  9. package/dist/composition.d.ts.map +1 -1
  10. package/dist/composition.js +11 -1
  11. package/dist/create/build-identity.json +28 -0
  12. package/dist/create/cli.js +3 -3
  13. package/dist/create/create.js +17 -19
  14. package/dist/create/package-versions.js +1 -1
  15. package/dist/create/server-source/Cargo.lock +18 -3
  16. package/dist/create/server-source/Cargo.toml +4 -2
  17. package/dist/create/server-source/crates/feltdb/Cargo.toml +20 -0
  18. package/dist/create/server-source/crates/feltdb/LICENSE +21 -0
  19. package/dist/create/server-source/crates/feltdb/README.md +75 -0
  20. package/dist/create/server-source/crates/feltdb/src/agent_state.rs +320 -0
  21. package/dist/create/server-source/crates/feltdb/src/agent_transition_contract.rs +1545 -0
  22. package/dist/create/server-source/crates/feltdb/src/authority.rs +145 -15
  23. package/dist/create/server-source/crates/feltdb/src/lib.rs +238 -23
  24. package/dist/create/server-source/crates/feltdb/src/query_performance.rs +4 -1
  25. package/dist/create/server-source/crates/feltdb/src/state_model.rs +850 -155
  26. package/dist/create/server-source/crates/feltdb/tests/agent_state_native.rs +1188 -0
  27. package/dist/create/server-source/crates/feltdb/tests/agent_transition_contract_conformance.rs +2884 -0
  28. package/dist/create/server-source/crates/feltdb/tests/authority_transaction_identity.rs +534 -0
  29. package/dist/create/server-source/crates/feltdb/tests/fixtures/agent_transition_corpus.json +23340 -0
  30. package/dist/create/server-source/crates/feltdb/tests/generalized_version_control_substrate_completion.rs +31 -13
  31. package/dist/create/server-source/crates/feltdb/tests/state_ref_authority.rs +918 -0
  32. package/dist/create/server-source/crates/feltdb/tests/workload_envelope_contract.rs +15 -2
  33. package/dist/create/server-source/crates/feltdb-client/Cargo.toml +29 -0
  34. package/dist/create/server-source/crates/feltdb-client/LICENSE +21 -0
  35. package/dist/create/server-source/crates/feltdb-client/README.md +70 -0
  36. package/dist/create/server-source/crates/feltdb-client/src/application.rs +527 -0
  37. package/dist/create/server-source/crates/feltdb-client/src/authority.rs +679 -0
  38. package/dist/create/server-source/crates/feltdb-client/src/control.rs +292 -0
  39. package/dist/create/server-source/crates/feltdb-client/src/error.rs +227 -0
  40. package/dist/create/server-source/crates/feltdb-client/src/events.rs +146 -0
  41. package/dist/create/server-source/crates/feltdb-client/src/lib.rs +466 -0
  42. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/README.md +4 -0
  43. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/private-ca.pem +20 -0
  44. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/server-key.pem +28 -0
  45. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/server.pem +20 -0
  46. package/dist/create/server-source/crates/feltdb-client/tests/private_ca.rs +95 -0
  47. package/dist/create/server-source/crates/feltdb-server/Cargo.toml +24 -1
  48. package/dist/create/server-source/crates/feltdb-server/LICENSE +21 -0
  49. package/dist/create/server-source/crates/feltdb-server/README.md +12 -1
  50. package/dist/create/server-source/crates/feltdb-server/benches/query_shape_observer.rs +136 -0
  51. package/dist/create/server-source/crates/feltdb-server/src/app_state.rs +3 -0
  52. package/dist/create/server-source/crates/feltdb-server/src/backup.rs +6 -2
  53. package/dist/create/server-source/crates/feltdb-server/src/lib.rs +21 -0
  54. package/dist/create/server-source/crates/feltdb-server/src/main.rs +75 -8
  55. package/dist/create/server-source/crates/feltdb-server/src/query_shape.rs +1137 -0
  56. package/dist/create/server-source/crates/feltdb-server/tests/fixtures/query-shape-trace.expected.json +300 -0
  57. package/dist/create/server-source/crates/feltdb-server/tests/fixtures/query-shape-trace.json +25 -0
  58. package/dist/create/server-source/crates/feltdb-server/tests/query_shape_trace.rs +128 -0
  59. package/dist/create/server-source/crates/feltdb-server/tests/rust_client.rs +683 -0
  60. package/dist/create/server-source/crates/feltdb-wasm/Cargo.toml +3 -1
  61. package/dist/create/template/default-project/README.md +12 -7
  62. package/dist/create/template/default-project/src/pages/Dashboard.tsx +1 -1
  63. package/dist/create/template/dot-feltdb-README.md +3 -3
  64. package/dist/db.d.ts.map +1 -1
  65. package/dist/db.js +43 -17
  66. package/dist/development-runtime-bridge.d.ts.map +1 -1
  67. package/dist/development-runtime-bridge.js +22 -1
  68. package/dist/embedded-transaction.d.ts +75 -8
  69. package/dist/embedded-transaction.d.ts.map +1 -1
  70. package/dist/embedded-transaction.js +124 -18
  71. package/dist/error-codes.d.ts +2 -0
  72. package/dist/error-codes.d.ts.map +1 -1
  73. package/dist/error-codes.js +2 -0
  74. package/dist/feltdb.d.ts +1 -11
  75. package/dist/feltdb.d.ts.map +1 -1
  76. package/dist/file-db.d.ts +6 -0
  77. package/dist/file-db.d.ts.map +1 -1
  78. package/dist/file-db.js +43 -11
  79. package/dist/index-core.d.ts +1 -0
  80. package/dist/index-core.d.ts.map +1 -1
  81. package/dist/index-core.js +1 -0
  82. package/dist/indexeddb-db.d.ts.map +1 -1
  83. package/dist/indexeddb-db.js +65 -41
  84. package/dist/memory-db.d.ts.map +1 -1
  85. package/dist/memory-db.js +29 -8
  86. package/dist/studio/{KeyManagementPanel-DZuSeWBK.js → KeyManagementPanel-D5FMvvU9.js} +1 -0
  87. package/dist/studio/app.d.ts.map +1 -1
  88. package/dist/studio/components/GlobalSearch.d.ts.map +1 -1
  89. package/dist/studio/components/KeyManagementPanel.d.ts.map +1 -1
  90. package/dist/studio/components/KeyManagementPanel.js +1 -1
  91. package/dist/studio/components/RouteErrorBoundary.d.ts +5 -0
  92. package/dist/studio/components/RouteErrorBoundary.d.ts.map +1 -0
  93. package/dist/studio/components/index.js +2 -2
  94. package/dist/studio/{components-BHTKlUgT.js → components-B4eKIUN5.js} +3 -2
  95. package/dist/studio/control-plane/Agents.d.ts.map +1 -1
  96. package/dist/studio/control-plane/Data.d.ts.map +1 -1
  97. package/dist/studio/control-plane/Instance.d.ts.map +1 -1
  98. package/dist/studio/control-plane/Operations.d.ts.map +1 -1
  99. package/dist/studio/control-plane/Overview.d.ts.map +1 -1
  100. package/dist/studio/control-plane/Schema.d.ts.map +1 -1
  101. package/dist/studio/control-plane/State.d.ts +11 -0
  102. package/dist/studio/control-plane/State.d.ts.map +1 -1
  103. package/dist/studio/control-plane/context.d.ts +4 -1
  104. package/dist/studio/control-plane/context.d.ts.map +1 -1
  105. package/dist/studio/control-plane/index.d.ts +1 -1
  106. package/dist/studio/control-plane/index.d.ts.map +1 -1
  107. package/dist/studio/control-plane/index.js +2 -2
  108. package/dist/studio/control-plane/primitives.d.ts +22 -2
  109. package/dist/studio/control-plane/primitives.d.ts.map +1 -1
  110. package/dist/studio/control-plane-fxMcJn74.js +4173 -0
  111. package/dist/studio/index.js +307 -235
  112. package/dist/studio/studio.css +1 -1
  113. package/dist/studio/utils/control-plane-api.d.ts.map +1 -1
  114. package/dist/studio/utils/control-plane-api.js +4 -3
  115. package/dist/studio/utils/service-api.d.ts.map +1 -1
  116. package/dist/studio/utils/service-api.js +5 -4
  117. package/dist/studio-app/assets/{feltdb_wasm-DYfWAV0E.js → feltdb_wasm-BatwwogY.js} +1 -1
  118. package/dist/studio-app/assets/feltdb_wasm_bg-BX0newOr.wasm +0 -0
  119. package/dist/studio-app/assets/index-CiC8VY-a.css +1 -0
  120. package/dist/studio-app/assets/index-DoVvbIay.js +30 -0
  121. package/dist/studio-app/index.html +2 -2
  122. package/dist/telemetry.d.ts +1 -0
  123. package/dist/telemetry.d.ts.map +1 -1
  124. package/dist/telemetry.js +4 -3
  125. package/dist/transaction-identity.d.ts +62 -0
  126. package/dist/transaction-identity.d.ts.map +1 -0
  127. package/dist/transaction-identity.js +138 -0
  128. package/dist/transaction.d.ts +50 -5
  129. package/dist/transaction.d.ts.map +1 -1
  130. package/dist/transaction.js +28 -0
  131. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  132. package/dist/wasm/package.json +1 -1
  133. package/package.json +2 -2
  134. package/dist/create/server-source/crates/feltdb-wasm/test.db +0 -0
  135. package/dist/studio/control-plane-DP8ljTDO.js +0 -3207
  136. package/dist/studio-app/assets/feltdb_wasm_bg-DHiOUhoQ.wasm +0 -0
  137. package/dist/studio-app/assets/index-6f6KVx5R.js +0 -30
  138. package/dist/studio-app/assets/index-BrsF-kWL.css +0 -1
@@ -1,18 +1,84 @@
1
- import { C as e, E as t, S as n, T as r, _ as i, a, b as ee, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as te, r as g, s as _, t as v, u as y, v as b, w as x, x as S, y as C } from "./components-BHTKlUgT.js";
2
- import { ServiceApiError as w, StudioServiceApi as T, isSecretField as E, resolveStudioApplicationId as D, safeDisplayValue as O, serviceApiErrorMessage as k } from "./utils/service-api.js";
3
- import { StudioProposalApi as A, proposalErrorMessage as j, proposalSections as M } from "./utils/proposal-api.js";
4
- import { t as N } from "./KeyManagementPanel-DZuSeWBK.js";
5
- import { CapabilitySet as P, ControlPlaneApi as F, ControlPlaneError as ne, controlPlaneErrorMessage as re, formatStatePath as ie } from "./utils/control-plane-api.js";
6
- import { A as I, C as ae, D as oe, E as se, M as ce, O as le, S as ue, T as de, _ as fe, a as pe, b as me, c as L, d as R, f as z, g as he, h as B, i as V, j as ge, k as _e, l as ve, m as H, n as U, o as W, p as G, r as K, s as ye, t as q, u as be, v as xe, w as Se, x as Ce, y as we } from "./control-plane-DP8ljTDO.js";
7
- import { ManagedInstanceUtil as Te } from "./utils/managed-instance.js";
8
- import { ManagedInstancePanel as Ee } from "./components/ManagedInstancePanel.js";
9
- import { capitalize as De, fetchDashboardStats as Oe, fetchDiagnostics as ke, fetchPeers as Ae, fetchProvenance as je, formatBytes as Me, formatReference as Ne, formatRelativeTime as Pe, formatTime as Fe, searchReferences as Ie } from "./utils/index.js";
10
- import { useEffect as J, useState as Y } from "react";
11
- import { BrowserRouter as Le, Link as X, Route as Z, Routes as Re } from "react-router-dom";
12
- import { Fragment as ze, jsx as Q, jsxs as $ } from "react/jsx-runtime";
13
- import { parseFlowSpec as Be } from "@feltdb/core";
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as ee, n as E, o as D, p as O, r as k, s as te, t as A, u as j, v as M, w as N, x as ne, y as re } from "./control-plane-fxMcJn74.js";
2
+ import { C as P, E as ie, S as ae, T as oe, _ as F, a as se, b as I, c as ce, d as le, f as L, g as R, h as z, i as ue, l as B, m as V, n as de, o as fe, p as H, r as pe, s as me, t as he, u as U, v as W, w as ge, x as _e, y as G } from "./components-B4eKIUN5.js";
3
+ import { ServiceApiError as ve, StudioServiceApi as ye, isSecretField as be, resolveStudioApplicationId as xe, safeDisplayValue as Se, serviceApiErrorMessage as Ce } from "./utils/service-api.js";
4
+ import { StudioProposalApi as we, proposalErrorMessage as Te, proposalSections as Ee } from "./utils/proposal-api.js";
5
+ import { t as K } from "./KeyManagementPanel-D5FMvvU9.js";
6
+ import { CapabilitySet as De, ControlPlaneApi as Oe, ControlPlaneError as ke, controlPlaneErrorMessage as Ae, formatStatePath as je } from "./utils/control-plane-api.js";
7
+ import { ManagedInstanceUtil as Me } from "./utils/managed-instance.js";
8
+ import { ManagedInstancePanel as Ne } from "./components/ManagedInstancePanel.js";
9
+ import { capitalize as Pe, fetchDashboardStats as Fe, fetchDiagnostics as Ie, fetchPeers as Le, fetchProvenance as Re, formatBytes as ze, formatReference as Be, formatRelativeTime as Ve, formatTime as He, searchReferences as Ue } from "./utils/index.js";
10
+ import We, { useEffect as q, useRef as Ge, useState as J } from "react";
11
+ import { BrowserRouter as Ke, Route as Y, Routes as qe, useLocation as X, useNavigate as Je } from "react-router-dom";
12
+ import { Fragment as Ye, jsx as Z, jsxs as Q } from "react/jsx-runtime";
13
+ import { parseFlowSpec as Xe } from "@feltdb/core";
14
+ //#region vendor/stack-ui/core/src/dom.js
15
+ function $(e, t) {
16
+ let n = t || document;
17
+ if (e == null || e === !1 || e === !0) return n.createDocumentFragment();
18
+ if (typeof e == "string" || typeof e == "number") return n.createTextNode(String(e));
19
+ if (Array.isArray(e)) {
20
+ let t = n.createDocumentFragment();
21
+ for (let r of e) t.appendChild($(r, n));
22
+ return t;
23
+ }
24
+ if (d(e)) {
25
+ let t = n.createElement(e.t);
26
+ for (let [n, r] of Object.entries(e.a)) r != null && r !== !1 && t.setAttribute(n, r === !0 ? "" : String(r));
27
+ for (let [n, r] of Object.entries(e.on || {})) t.addEventListener(n, r);
28
+ for (let r of e.c) t.appendChild($(r, n));
29
+ return t;
30
+ }
31
+ if (e && typeof e.nodeType == "number") return e;
32
+ throw TypeError("toDom: unsupported child");
33
+ }
34
+ function Ze(e, t) {
35
+ let n = (t || document).getElementById(String(e || "stack-main").replace(/[^A-Za-z0-9_-]/g, "-"));
36
+ n && typeof n.focus == "function" && n.focus({ preventScroll: !0 });
37
+ }
38
+ Object.freeze(Object.fromEntries(Object.entries(o).map(([e, t]) => [e, (e, n) => $(t(e || {}), n)])));
39
+ //#endregion
40
+ //#region src/components/RouteErrorBoundary.tsx
41
+ var Qe = class extends We.Component {
42
+ constructor(...e) {
43
+ super(...e), this.state = {};
44
+ }
45
+ static getDerivedStateFromError(e) {
46
+ return { error: e };
47
+ }
48
+ componentDidCatch(e, t) {
49
+ console.error(`Studio screen failed to render (${this.props.routeKey}):`, e, t.componentStack);
50
+ }
51
+ render() {
52
+ let { error: e } = this.state;
53
+ return e ? /* @__PURE__ */ Q("section", {
54
+ role: "alert",
55
+ className: "cp-notice",
56
+ children: [
57
+ /* @__PURE__ */ Z("h2", { children: "This screen could not be displayed" }),
58
+ /* @__PURE__ */ Z("p", { children: e.message || "An unexpected error occurred while rendering this screen." }),
59
+ /* @__PURE__ */ Z("p", {
60
+ className: "cp-muted",
61
+ children: "The rest of Studio is unaffected. Choose another screen from the navigation, or reload to try again."
62
+ }),
63
+ /* @__PURE__ */ Z("button", {
64
+ className: "btn btn-ghost",
65
+ onClick: () => this.setState({ error: void 0 }),
66
+ children: "Try again"
67
+ })
68
+ ]
69
+ }) : this.props.children;
70
+ }
71
+ };
72
+ function $e({ children: e }) {
73
+ let { pathname: t } = X();
74
+ return /* @__PURE__ */ Z(Qe, {
75
+ routeKey: t,
76
+ children: e
77
+ }, t);
78
+ }
79
+ //#endregion
14
80
  //#region src/app.tsx
15
- function Ve(e) {
81
+ function et(e) {
16
82
  return e.explicitAuthority ? {
17
83
  source: "explicit-authority",
18
84
  authorityUrl: e.explicitAuthority
@@ -27,13 +93,13 @@ function Ve(e) {
27
93
  authorityUrl: ""
28
94
  };
29
95
  }
30
- function He({ registration: e }) {
31
- return /* @__PURE__ */ $("div", {
96
+ function tt({ registration: e }) {
97
+ return /* @__PURE__ */ Q("div", {
32
98
  className: "runtime-notice",
33
99
  children: ["Application connection: ", e ? `Connected ✓${e.namespace ? ` (namespace ${e.namespace})` : ""}` : "Not connected"]
34
100
  });
35
101
  }
36
- var Ue = [
102
+ var nt = [
37
103
  {
38
104
  path: "/overview",
39
105
  label: "Overview"
@@ -79,51 +145,48 @@ var Ue = [
79
145
  label: "Developer"
80
146
  }
81
147
  ];
82
- function We({ db: t, remoteUrl: n = "", token: r = "", namespace: a = "default", deploymentRuntime: o = "browser", applicationUrl: s = "", applicationId: d = "", environment: m = "production", developmentSession: h, managedPublish: g, sourceSync: _, onConnect: v }) {
83
- let [x, S] = Y(null), w = e(t || null, a), [T, E] = Y([]), [D, O] = Y([]), [k, A] = Y(0), [j, M] = Y(), P = (e) => ({
84
- pathname: e,
85
- search: window.location.search
86
- });
87
- J(() => {
88
- let e = !0;
89
- return fetch("/_feltdb/project", { cache: "no-store" }).then(async (t) => {
90
- if (!t.ok) throw Error("No project model endpoint");
91
- let n = await t.json();
92
- e && S(Be(n.source));
148
+ function rt({ db: e, remoteUrl: t = "", token: n = "", namespace: r = "default", deploymentRuntime: i = "browser", applicationUrl: a = "", applicationId: o = "", environment: s = "production", developmentSession: l, managedPublish: u, sourceSync: d, onConnect: f }) {
149
+ let [p, h] = J(null), g = P(e || null, r), [v, y] = J([]), [C, w] = J([]), [T, te] = J(0), [j, M] = J();
150
+ q(() => {
151
+ let t = !0;
152
+ return fetch("/_feltdb/project", { cache: "no-store" }).then(async (e) => {
153
+ if (!e.ok) throw Error("No project model endpoint");
154
+ let n = await e.json();
155
+ t && h(Xe(n.source));
93
156
  }).catch(async () => {
94
- let n = t ? await t.collection("_flow_apps").all() : [];
95
- e && n[0]?.spec && S(n[0].spec);
157
+ let n = e ? await e.collection("_flow_apps").all() : [];
158
+ t && n[0]?.spec && h(n[0].spec);
96
159
  }), () => {
97
- e = !1;
160
+ t = !1;
98
161
  };
99
- }, [t]), J(() => {
100
- if (!h?.sessionId) return;
162
+ }, [e]), q(() => {
163
+ if (!l?.sessionId) return;
101
164
  let e = !0, t = () => void fetch("/_feltdb/runtime", { cache: "no-store" }).then((e) => e.ok ? e.json() : { runtimes: [] }).then((t) => {
102
- e && E(t.runtimes || []);
165
+ e && y(t.runtimes || []);
103
166
  }).catch(() => {
104
- e && E([]);
167
+ e && y([]);
105
168
  });
106
169
  t();
107
170
  let n = window.setInterval(t, 2e3);
108
171
  return () => {
109
172
  e = !1, window.clearInterval(n);
110
173
  };
111
- }, [h?.sessionId]), J(() => {
112
- let e = T[0]?.runtimeInstanceId;
174
+ }, [l?.sessionId]), q(() => {
175
+ let e = v[0]?.runtimeInstanceId;
113
176
  if (!e) {
114
- O([]);
177
+ w([]);
115
178
  return;
116
179
  }
117
180
  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) => {
118
- t && (n = e.nextCursor ?? n, A(e.dropped || 0), O((t) => [...t, ...e.observations || []].slice(-200)));
181
+ t && (n = e.nextCursor ?? n, te(e.dropped || 0), w((t) => [...t, ...e.observations || []].slice(-200)));
119
182
  }).catch(() => void 0);
120
183
  r();
121
184
  let i = window.setInterval(r, 1e3);
122
185
  return () => {
123
186
  t = !1, window.clearInterval(i);
124
187
  };
125
- }, [T[0]?.runtimeInstanceId]);
126
- let F = (e, t) => {
188
+ }, [v[0]?.runtimeInstanceId]);
189
+ let N = (e, t) => {
127
190
  M({
128
191
  collection: e,
129
192
  id: t
@@ -131,284 +194,293 @@ function We({ db: t, remoteUrl: n = "", token: r = "", namespace: a = "default",
131
194
  let n = window.location.search;
132
195
  window.history.pushState({}, "", `/data${n}`), window.dispatchEvent(new PopStateEvent("popstate"));
133
196
  };
134
- return /* @__PURE__ */ Q(I, {
197
+ return /* @__PURE__ */ Z(c, {
135
198
  options: {
136
- baseUrl: n,
137
- token: r,
138
- applicationId: d,
139
- environment: m
199
+ baseUrl: t,
200
+ token: n,
201
+ applicationId: o,
202
+ environment: s
140
203
  },
141
- children: /* @__PURE__ */ Q(Le, { children: /* @__PURE__ */ $("div", {
142
- className: "studio-app",
143
- children: [/* @__PURE__ */ $("nav", {
144
- className: "studio-nav",
145
- children: [
146
- /* @__PURE__ */ $("div", {
147
- className: "nav-header",
148
- children: [/* @__PURE__ */ Q("h1", { children: "FeltDB Studio" }), w && /* @__PURE__ */ Q("div", {
149
- className: "instance-info",
150
- children: w.namespace
151
- })]
152
- }),
153
- /* @__PURE__ */ Q("div", {
154
- className: "nav-search",
155
- children: /* @__PURE__ */ Q(l, {
156
- db: t,
157
- model: x
158
- })
159
- }),
160
- /* @__PURE__ */ $("ul", {
161
- className: "nav-menu",
162
- children: [
163
- /* @__PURE__ */ Q("li", {
164
- className: "nav-section",
165
- children: "Operate"
166
- }),
167
- Ue.map((e) => /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
168
- to: P(e.path),
169
- children: e.label
170
- }) }, e.path)),
171
- /* @__PURE__ */ Q("li", {
172
- className: "nav-section",
173
- children: "Design"
174
- }),
175
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
176
- to: P("/"),
177
- children: "Application"
178
- }) }),
179
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
180
- to: P("/capabilities"),
181
- children: "Capabilities"
182
- }) }),
183
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
184
- to: P("/contract"),
185
- children: "Contract"
186
- }) }),
187
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
188
- to: P("/policies"),
189
- children: "Policies"
190
- }) }),
191
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
192
- to: P("/workflows"),
193
- children: "Workflows"
194
- }) }),
195
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
196
- to: P("/agent-definitions"),
197
- children: "Agent definitions"
198
- }) }),
199
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
200
- to: P("/modules"),
201
- children: "Modules"
202
- }) }),
203
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
204
- to: P("/proposals"),
205
- children: "Proposals"
206
- }) }),
207
- h?.sessionId && /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
208
- to: P("/activity"),
209
- children: "Live Activity"
210
- }) }),
211
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
212
- to: P("/executions"),
213
- children: "Executions"
214
- }) }),
215
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
216
- to: P("/connection"),
217
- children: "Connection"
218
- }) }),
219
- /* @__PURE__ */ Q("li", { children: /* @__PURE__ */ Q(X, {
220
- to: P("/api-keys"),
221
- children: "API Keys"
222
- }) })
223
- ]
224
- })
225
- ]
226
- }), /* @__PURE__ */ $("main", {
204
+ runtime: i,
205
+ children: /* @__PURE__ */ Z(Ke, { children: /* @__PURE__ */ Z(at, {
206
+ namespace: g?.namespace,
207
+ liveActivity: !!l?.sessionId,
208
+ search: /* @__PURE__ */ Z(R, {
209
+ db: e,
210
+ model: p
211
+ }),
212
+ children: /* @__PURE__ */ Q("div", {
227
213
  className: "studio-content",
228
- children: [h?.sessionId && /* @__PURE__ */ Q(He, { registration: T[0] }), /* @__PURE__ */ $(Re, { children: [
229
- /* @__PURE__ */ Q(Z, {
214
+ children: [l?.sessionId && /* @__PURE__ */ Z(tt, { registration: v[0] }), /* @__PURE__ */ Z($e, { children: /* @__PURE__ */ Q(qe, { children: [
215
+ /* @__PURE__ */ Z(Y, {
230
216
  path: "/overview",
231
- element: /* @__PURE__ */ Q(B, {})
217
+ element: /* @__PURE__ */ Z(m, {})
232
218
  }),
233
- /* @__PURE__ */ Q(Z, {
219
+ /* @__PURE__ */ Z(Y, {
234
220
  path: "/data",
235
- element: /* @__PURE__ */ Q(H, {
221
+ element: /* @__PURE__ */ Z(b, {
236
222
  focus: j,
237
223
  onFocusHandled: () => M(void 0)
238
224
  })
239
225
  }),
240
- /* @__PURE__ */ Q(Z, {
226
+ /* @__PURE__ */ Z(Y, {
241
227
  path: "/schema",
242
- element: /* @__PURE__ */ Q(G, {})
228
+ element: /* @__PURE__ */ Z(x, {})
243
229
  }),
244
- /* @__PURE__ */ Q(Z, {
230
+ /* @__PURE__ */ Z(Y, {
245
231
  path: "/agents",
246
- element: /* @__PURE__ */ Q(z, { onOpenRecord: F })
232
+ element: /* @__PURE__ */ Z(ee, { onOpenRecord: N })
247
233
  }),
248
- /* @__PURE__ */ Q(Z, {
234
+ /* @__PURE__ */ Z(Y, {
249
235
  path: "/state",
250
- element: /* @__PURE__ */ Q(R, {})
236
+ element: /* @__PURE__ */ Z(O, {})
251
237
  }),
252
- /* @__PURE__ */ Q(Z, {
238
+ /* @__PURE__ */ Z(Y, {
253
239
  path: "/operations",
254
- element: /* @__PURE__ */ Q(L, { onOpenRecord: F })
240
+ element: /* @__PURE__ */ Z(_, { onOpenRecord: N })
255
241
  }),
256
- /* @__PURE__ */ Q(Z, {
242
+ /* @__PURE__ */ Z(Y, {
257
243
  path: "/replication",
258
- element: /* @__PURE__ */ Q(V, {})
244
+ element: /* @__PURE__ */ Z(S, {})
259
245
  }),
260
- /* @__PURE__ */ Q(Z, {
246
+ /* @__PURE__ */ Z(Y, {
261
247
  path: "/applications",
262
- element: /* @__PURE__ */ Q(q, {})
248
+ element: /* @__PURE__ */ Z(A, {})
263
249
  }),
264
- /* @__PURE__ */ Q(Z, {
250
+ /* @__PURE__ */ Z(Y, {
265
251
  path: "/monitoring",
266
- element: /* @__PURE__ */ Q(K, {})
252
+ element: /* @__PURE__ */ Z(k, {})
267
253
  }),
268
- /* @__PURE__ */ Q(Z, {
254
+ /* @__PURE__ */ Z(Y, {
269
255
  path: "/settings",
270
- element: /* @__PURE__ */ Q(W, {})
256
+ element: /* @__PURE__ */ Z(D, {})
271
257
  }),
272
- /* @__PURE__ */ Q(Z, {
258
+ /* @__PURE__ */ Z(Y, {
273
259
  path: "/developer",
274
- element: /* @__PURE__ */ Q(U, {})
260
+ element: /* @__PURE__ */ Z(E, {})
275
261
  }),
276
- /* @__PURE__ */ Q(Z, {
262
+ /* @__PURE__ */ Z(Y, {
277
263
  path: "/",
278
- element: /* @__PURE__ */ $(ze, { children: [/* @__PURE__ */ Q(p, {
279
- configuration: _,
264
+ element: /* @__PURE__ */ Q(Ye, { children: [/* @__PURE__ */ Z(V, {
265
+ configuration: d,
280
266
  onApplied: () => window.location.reload()
281
- }), /* @__PURE__ */ Q(u, {
282
- db: t,
283
- namespace: a,
284
- projectSpec: x,
285
- managedPublish: g,
286
- onSpecChange: S
267
+ }), /* @__PURE__ */ Z(z, {
268
+ db: e,
269
+ namespace: r,
270
+ projectSpec: p,
271
+ managedPublish: u,
272
+ onSpecChange: h
287
273
  })] })
288
274
  }),
289
- /* @__PURE__ */ Q(Z, {
275
+ /* @__PURE__ */ Z(Y, {
290
276
  path: "/capabilities",
291
- element: /* @__PURE__ */ Q(f, {
292
- db: t,
293
- model: x
277
+ element: /* @__PURE__ */ Z(B, {
278
+ db: e,
279
+ model: p
294
280
  })
295
281
  }),
296
- /* @__PURE__ */ Q(Z, {
282
+ /* @__PURE__ */ Z(Y, {
297
283
  path: "/contract",
298
- element: /* @__PURE__ */ Q(y, {
299
- model: x,
284
+ element: /* @__PURE__ */ Z(U, {
285
+ model: p,
300
286
  section: "schema"
301
287
  })
302
288
  }),
303
- /* @__PURE__ */ Q(Z, {
289
+ /* @__PURE__ */ Z(Y, {
304
290
  path: "/policies",
305
- element: /* @__PURE__ */ Q(y, {
306
- model: x,
291
+ element: /* @__PURE__ */ Z(U, {
292
+ model: p,
307
293
  section: "policies"
308
294
  })
309
295
  }),
310
- /* @__PURE__ */ Q(Z, {
296
+ /* @__PURE__ */ Z(Y, {
311
297
  path: "/workflows",
312
- element: /* @__PURE__ */ Q(C, {
313
- db: t,
314
- model: x
298
+ element: /* @__PURE__ */ Z(G, {
299
+ db: e,
300
+ model: p
315
301
  })
316
302
  }),
317
- /* @__PURE__ */ Q(Z, {
303
+ /* @__PURE__ */ Z(Y, {
318
304
  path: "/agent-definitions",
319
- element: /* @__PURE__ */ Q(b, {
320
- db: t,
321
- model: x
305
+ element: /* @__PURE__ */ Z(W, {
306
+ db: e,
307
+ model: p
322
308
  })
323
309
  }),
324
- /* @__PURE__ */ Q(Z, {
310
+ /* @__PURE__ */ Z(Y, {
325
311
  path: "/modules",
326
- element: /* @__PURE__ */ Q(c, { model: x })
312
+ element: /* @__PURE__ */ Z(L, { model: p })
327
313
  }),
328
- /* @__PURE__ */ Q(Z, {
314
+ /* @__PURE__ */ Z(Y, {
329
315
  path: "/executions",
330
- element: /* @__PURE__ */ Q(ee, {
331
- db: t,
332
- model: x
316
+ element: /* @__PURE__ */ Z(I, {
317
+ db: e,
318
+ model: p
333
319
  })
334
320
  }),
335
- /* @__PURE__ */ Q(Z, {
321
+ /* @__PURE__ */ Z(Y, {
336
322
  path: "/proposals",
337
- element: d ? /* @__PURE__ */ Q(te, {
338
- serviceUrl: n,
339
- token: r,
340
- applicationId: d,
341
- environment: m,
342
- applicationName: x?.app,
343
- sourceSync: _
344
- }) : /* @__PURE__ */ Q("div", {
323
+ element: o ? /* @__PURE__ */ Z(H, {
324
+ serviceUrl: t,
325
+ token: n,
326
+ applicationId: o,
327
+ environment: s,
328
+ applicationName: p?.app,
329
+ sourceSync: d
330
+ }) : /* @__PURE__ */ Z("div", {
345
331
  className: "model-empty",
346
332
  children: "No active application is selected."
347
333
  })
348
334
  }),
349
- /* @__PURE__ */ Q(Z, {
335
+ /* @__PURE__ */ Z(Y, {
350
336
  path: "/activity",
351
- element: /* @__PURE__ */ $("div", {
337
+ element: /* @__PURE__ */ Q("div", {
352
338
  className: "runtime-activity",
353
339
  children: [
354
- /* @__PURE__ */ Q("h1", { children: "Live Activity" }),
355
- /* @__PURE__ */ $("p", { children: [
356
- D.some((e) => Date.now() - e.timestamp < 5e3) ? "Active" : "Idle",
340
+ /* @__PURE__ */ Z("h1", { children: "Live Activity" }),
341
+ /* @__PURE__ */ Q("p", { children: [
342
+ C.some((e) => Date.now() - e.timestamp < 5e3) ? "Active" : "Idle",
357
343
  " · FeltDB client instance ",
358
- T[0]?.runtimeInstanceId || "not connected"
344
+ v[0]?.runtimeInstanceId || "not connected"
359
345
  ] }),
360
- k > 0 && /* @__PURE__ */ $("p", {
346
+ T > 0 && /* @__PURE__ */ Q("p", {
361
347
  className: "runtime-notice",
362
348
  children: [
363
349
  "Observation is incomplete: ",
364
- k,
350
+ T,
365
351
  " events dropped."
366
352
  ]
367
353
  }),
368
- /* @__PURE__ */ $("table", { children: [/* @__PURE__ */ Q("thead", { children: /* @__PURE__ */ $("tr", { children: [
369
- /* @__PURE__ */ Q("th", { children: "Time" }),
370
- /* @__PURE__ */ Q("th", { children: "Operation" }),
371
- /* @__PURE__ */ Q("th", { children: "Collection" }),
372
- /* @__PURE__ */ Q("th", { children: "Status" }),
373
- /* @__PURE__ */ Q("th", { children: "Duration" })
374
- ] }) }), /* @__PURE__ */ Q("tbody", { children: [...D].reverse().map((e) => /* @__PURE__ */ $("tr", { children: [
375
- /* @__PURE__ */ Q("td", { children: new Date(e.timestamp).toLocaleTimeString() }),
376
- /* @__PURE__ */ Q("td", { children: e.operation?.type }),
377
- /* @__PURE__ */ Q("td", { children: e.operation?.collection || "—" }),
378
- /* @__PURE__ */ Q("td", { children: e.status }),
379
- /* @__PURE__ */ Q("td", { children: e.durationMs === void 0 ? "—" : `${e.durationMs} ms` })
354
+ /* @__PURE__ */ Q("table", { children: [/* @__PURE__ */ Z("thead", { children: /* @__PURE__ */ Q("tr", { children: [
355
+ /* @__PURE__ */ Z("th", { children: "Time" }),
356
+ /* @__PURE__ */ Z("th", { children: "Operation" }),
357
+ /* @__PURE__ */ Z("th", { children: "Collection" }),
358
+ /* @__PURE__ */ Z("th", { children: "Status" }),
359
+ /* @__PURE__ */ Z("th", { children: "Duration" })
360
+ ] }) }), /* @__PURE__ */ Z("tbody", { children: [...C].reverse().map((e) => /* @__PURE__ */ Q("tr", { children: [
361
+ /* @__PURE__ */ Z("td", { children: new Date(e.timestamp).toLocaleTimeString() }),
362
+ /* @__PURE__ */ Z("td", { children: e.operation?.type }),
363
+ /* @__PURE__ */ Z("td", { children: e.operation?.collection || "—" }),
364
+ /* @__PURE__ */ Z("td", { children: e.status }),
365
+ /* @__PURE__ */ Z("td", { children: e.durationMs === void 0 ? "—" : `${e.durationMs} ms` })
380
366
  ] }, e.cursor || e.eventId)) })] })
381
367
  ]
382
368
  })
383
369
  }),
384
- /* @__PURE__ */ Q(Z, {
370
+ /* @__PURE__ */ Z(Y, {
385
371
  path: "/connection",
386
- element: /* @__PURE__ */ Q(i, {
387
- db: t,
388
- remoteUrl: n,
389
- token: r,
390
- applicationUrl: s,
391
- feltDBRuntime: o,
392
- authorityUrl: h?.authorityUrl || n,
393
- onConnect: v
372
+ element: /* @__PURE__ */ Z(F, {
373
+ db: e,
374
+ remoteUrl: t,
375
+ token: n,
376
+ applicationUrl: a,
377
+ feltDBRuntime: i,
378
+ authorityUrl: l?.authorityUrl || t,
379
+ onConnect: f
394
380
  })
395
381
  }),
396
- /* @__PURE__ */ Q(Z, {
382
+ /* @__PURE__ */ Z(Y, {
397
383
  path: "/api-keys",
398
- element: /* @__PURE__ */ $("div", {
384
+ element: /* @__PURE__ */ Q("div", {
399
385
  style: { padding: "2rem" },
400
- children: [/* @__PURE__ */ Q("h1", { children: "API Key Management" }), /* @__PURE__ */ Q(N, {
401
- apiUrl: n,
402
- token: r,
403
- namespace: a,
386
+ children: [/* @__PURE__ */ Z("h1", { children: "API Key Management" }), /* @__PURE__ */ Z(K, {
387
+ apiUrl: t,
388
+ token: n,
389
+ namespace: r,
404
390
  onConfigure: () => window.location.assign("/connection")
405
391
  })]
406
392
  })
407
393
  })
408
- ] })]
409
- })]
394
+ ] }) })]
395
+ })
410
396
  }) })
411
397
  });
412
398
  }
399
+ var it = [
400
+ {
401
+ path: "/",
402
+ label: "Application"
403
+ },
404
+ {
405
+ path: "/capabilities",
406
+ label: "Capabilities"
407
+ },
408
+ {
409
+ path: "/contract",
410
+ label: "Contract"
411
+ },
412
+ {
413
+ path: "/policies",
414
+ label: "Policies"
415
+ },
416
+ {
417
+ path: "/workflows",
418
+ label: "Workflows"
419
+ },
420
+ {
421
+ path: "/agent-definitions",
422
+ label: "Agent definitions"
423
+ },
424
+ {
425
+ path: "/modules",
426
+ label: "Modules"
427
+ },
428
+ {
429
+ path: "/proposals",
430
+ label: "Proposals"
431
+ },
432
+ {
433
+ path: "/activity",
434
+ label: "Live Activity",
435
+ live: !0
436
+ },
437
+ {
438
+ path: "/executions",
439
+ label: "Executions"
440
+ },
441
+ {
442
+ path: "/connection",
443
+ label: "Connection"
444
+ },
445
+ {
446
+ path: "/api-keys",
447
+ label: "API Keys"
448
+ }
449
+ ];
450
+ function at({ namespace: e, liveActivity: t, search: n, children: r }) {
451
+ let i = X(), o = Je(), s = Ge(!0);
452
+ q(() => {
453
+ if (s.current) {
454
+ s.current = !1;
455
+ return;
456
+ }
457
+ Ze("studio-main");
458
+ }, [i.pathname]);
459
+ let c = (e) => (t, n) => ({
460
+ id: t.path,
461
+ label: t.label,
462
+ href: `${t.path}${i.search}`,
463
+ group: e,
464
+ order: n,
465
+ current: i.pathname === t.path
466
+ });
467
+ return /* @__PURE__ */ Z(a, {
468
+ product: {
469
+ name: "FeltDB Studio",
470
+ homeHref: `/overview${i.search}`,
471
+ mark: "F"
472
+ },
473
+ mainId: "studio-main",
474
+ context: e ? /* @__PURE__ */ Z("span", {
475
+ className: "instance-info",
476
+ title: "Namespace",
477
+ children: e
478
+ }) : void 0,
479
+ search: n,
480
+ navigation: [...nt.map(c("Operate")), ...it.filter((e) => !e.live || t).map(c("Design"))],
481
+ onNavigate: (e) => o(e),
482
+ children: r
483
+ });
484
+ }
413
485
  //#endregion
414
- export { b as AgentExplorer, z as Agents, He as ApplicationConnectionNotice, u as ApplicationDesigner, q as Applications, p as AskFeltDB, f as CapabilityExplorer, P as CapabilitySet, he as Capable, g as ConflictExplorer, y as ContractInspector, F as ControlPlaneApi, ne as ControlPlaneError, I as ControlPlaneProvider, H as DataBrowser, U as Developer, fe as Empty, ee as ExecutionViewer, xe as Failure, l as GlobalSearch, v as HealthCenter, we as Identity, B as InstanceOverview, me as Json, N as KeyManagementPanel, Ce as Loading, Ee as ManagedInstancePanel, Te as ManagedInstanceUtil, c as ModuleExplorer, K as Monitoring, L as OperationsConsole, a as OperationsExplorer, o as OverviewDashboard, ue as Page, ae as PartialNotice, Se as Path, d as PeerMap, te as ProposalBrowser, m as ProvenanceViewer, h as ReferenceExplorer, V as Replication, pe as ReplicationHealthUnavailable, G as SchemaExplorer, w as ServiceApiError, W as Settings, i as SettingsPanel, de as Stat, _ as StateExplorer, R as StateWorkbench, se as StatusPill, We as StudioApp, A as StudioProposalApi, T as StudioServiceApi, oe as Tabs, le as Timestamp, ve as TransactionObservabilityUnavailable, _e as Unavailable, C as WorkflowVisualizer, De as capitalize, re as controlPlaneErrorMessage, s as dataCollectionLocation, Oe as fetchDashboardStats, ke as fetchDiagnostics, Ae as fetchPeers, je as fetchProvenance, Me as formatBytes, Ne as formatReference, Pe as formatRelativeTime, ie as formatStatePath, Fe as formatTime, E as isSecretField, be as operationsAvailability, j as proposalErrorMessage, M as proposalSections, ye as replicationAvailability, D as resolveStudioApplicationId, Ve as resolveStudioConnection, O as safeDisplayValue, Ie as searchReferences, k as serviceApiErrorMessage, S as useCollection, ge as useControlPlane, ce as useControlPlaneResource, n as useDashboardStats, e as useFeltDB, x as usePeers, r as useProvenance, t as useRuntimeDiagnostics };
486
+ export { W as AgentExplorer, ee as Agents, tt as ApplicationConnectionNotice, z as ApplicationDesigner, A as Applications, V as AskFeltDB, M as BrowserRuntimeNotice, B as CapabilityExplorer, De as CapabilitySet, re as Capable, v as CommittedRevision, pe as ConflictExplorer, U as ContractInspector, Oe as ControlPlaneApi, ke as ControlPlaneError, c as ControlPlaneProvider, b as DataBrowser, E as Developer, g as Empty, I as ExecutionViewer, ne as Failure, R as GlobalSearch, he as HealthCenter, y as INTEGRITY_CHECK, f as Identity, m as InstanceOverview, t as Json, K as KeyManagementPanel, N as Loading, Ne as ManagedInstancePanel, Me as ManagedInstanceUtil, L as ModuleExplorer, k as Monitoring, _ as OperationsConsole, se as OperationsExplorer, ce as OverviewDashboard, p as Page, r as PartialNotice, n as Path, ue as PeerMap, H as ProposalBrowser, de as ProvenanceViewer, fe as ReferenceExplorer, S as Replication, h as ReplicationHealthUnavailable, x as SchemaExplorer, ve as ServiceApiError, D as Settings, F as SettingsPanel, l as Stat, me as StateExplorer, O as StateWorkbench, w as StatusPill, rt as StudioApp, we as StudioProposalApi, ye as StudioServiceApi, e as Tabs, C as Timestamp, T as TransactionObservabilityUnavailable, s as Unavailable, G as WorkflowVisualizer, Pe as capitalize, Ae as controlPlaneErrorMessage, le as dataCollectionLocation, Fe as fetchDashboardStats, Ie as fetchDiagnostics, Le as fetchPeers, Re as fetchProvenance, ze as formatBytes, Be as formatReference, Ve as formatRelativeTime, je as formatStatePath, He as formatTime, be as isSecretField, j as operationsAvailability, Te as proposalErrorMessage, Ee as proposalSections, te as replicationAvailability, xe as resolveStudioApplicationId, et as resolveStudioConnection, Se as safeDisplayValue, Ue as searchReferences, Ce as serviceApiErrorMessage, _e as useCollection, u as useControlPlane, i as useControlPlaneResource, ae as useDashboardStats, P as useFeltDB, ge as usePeers, oe as useProvenance, ie as useRuntimeDiagnostics };