@feltdb/core 0.12.2 → 0.15.0

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 (126) hide show
  1. package/dist/agent-runtime.d.ts +64 -2
  2. package/dist/agent-runtime.d.ts.map +1 -1
  3. package/dist/agent-runtime.js +121 -11
  4. package/dist/agent-state.d.ts +48 -0
  5. package/dist/agent-state.d.ts.map +1 -1
  6. package/dist/agent-state.js +174 -12
  7. package/dist/agent.d.ts +10 -1
  8. package/dist/agent.d.ts.map +1 -1
  9. package/dist/agent.js +10 -1
  10. package/dist/build-identity.json +4 -4
  11. package/dist/cli/commands.js +34 -7
  12. package/dist/cli/workspace-integration.js +8 -0
  13. package/dist/collection.d.ts +3 -1
  14. package/dist/collection.d.ts.map +1 -1
  15. package/dist/collection.js +30 -8
  16. package/dist/create/build-identity.json +4 -4
  17. package/dist/create/cli.js +47 -38
  18. package/dist/create/create.js +21 -8
  19. package/dist/create/package-versions.js +1 -1
  20. package/dist/create/server-source/Cargo.lock +6 -6
  21. package/dist/create/server-source/Cargo.toml +1 -1
  22. package/dist/create/server-source/crates/feltdb/src/lib.rs +126 -35
  23. package/dist/create/server-source/crates/feltdb/src/state_contract.rs +162 -53
  24. package/dist/create/server-source/crates/feltdb/src/worker_mesh.rs +341 -2
  25. package/dist/create/server-source/crates/feltdb/src/workload.rs +2094 -126
  26. package/dist/create/server-source/crates/feltdb/tests/production_readiness_contract.rs +18 -12
  27. package/dist/create/server-source/crates/feltdb/tests/workload_envelope_contract.rs +17 -5
  28. package/dist/create/server-source/crates/feltdb-client/Cargo.toml +1 -1
  29. package/dist/create/server-source/crates/feltdb-server/Cargo.toml +1 -1
  30. package/dist/create/server-source/crates/feltdb-server/README.md +6 -1
  31. package/dist/create/server-source/crates/feltdb-server/src/agent_execution.rs +511 -0
  32. package/dist/create/server-source/crates/feltdb-server/src/app_state.rs +9 -1
  33. package/dist/create/server-source/crates/feltdb-server/src/auth.rs +113 -25
  34. package/dist/create/server-source/crates/feltdb-server/src/backup.rs +4 -0
  35. package/dist/create/server-source/crates/feltdb-server/src/console_accounts.rs +1009 -0
  36. package/dist/create/server-source/crates/feltdb-server/src/control_authorization.rs +441 -0
  37. package/dist/create/server-source/crates/feltdb-server/src/identity.rs +68 -6
  38. package/dist/create/server-source/crates/feltdb-server/src/key_management.rs +355 -23
  39. package/dist/create/server-source/crates/feltdb-server/src/lib.rs +4 -0
  40. package/dist/create/server-source/crates/feltdb-server/src/main.rs +1740 -236
  41. package/dist/create/server-source/crates/feltdb-server/src/redaction.rs +208 -0
  42. package/dist/create/server-source/crates/feltdb-server/src/tenancy.rs +198 -19
  43. package/dist/create/server-source/crates/feltdb-server/tests/transaction_precondition_contract.rs +403 -0
  44. package/dist/create/setup-summary.js +40 -0
  45. package/dist/db.d.ts +91 -10
  46. package/dist/db.d.ts.map +1 -1
  47. package/dist/db.js +170 -31
  48. package/dist/deployment.d.ts +19 -0
  49. package/dist/deployment.d.ts.map +1 -1
  50. package/dist/deployment.js +38 -2
  51. package/dist/development-runtime-bridge.d.ts +20 -0
  52. package/dist/development-runtime-bridge.d.ts.map +1 -1
  53. package/dist/development-runtime-bridge.js +61 -12
  54. package/dist/embedded-query.d.ts.map +1 -1
  55. package/dist/embedded-query.js +5 -4
  56. package/dist/embedded-transaction.d.ts +8 -4
  57. package/dist/embedded-transaction.d.ts.map +1 -1
  58. package/dist/embedded-transaction.js +55 -19
  59. package/dist/error-codes.d.ts +31 -2
  60. package/dist/error-codes.d.ts.map +1 -1
  61. package/dist/error-codes.js +41 -2
  62. package/dist/feltdb.d.ts +7 -0
  63. package/dist/feltdb.d.ts.map +1 -1
  64. package/dist/file-db.d.ts +27 -0
  65. package/dist/file-db.d.ts.map +1 -1
  66. package/dist/file-db.js +145 -7
  67. package/dist/http-client.d.ts +11 -3
  68. package/dist/http-client.d.ts.map +1 -1
  69. package/dist/http-client.js +27 -14
  70. package/dist/http-db.d.ts +40 -1
  71. package/dist/http-db.d.ts.map +1 -1
  72. package/dist/http-db.js +285 -58
  73. package/dist/index.js +1 -1
  74. package/dist/local-state-lock.d.ts +34 -0
  75. package/dist/local-state-lock.d.ts.map +1 -0
  76. package/dist/local-state-lock.js +225 -0
  77. package/dist/reactive-graph.d.ts +0 -3
  78. package/dist/reactive-graph.d.ts.map +1 -1
  79. package/dist/reactive-graph.js +11 -1
  80. package/dist/runtime-registry.d.ts +7 -2
  81. package/dist/runtime-registry.d.ts.map +1 -1
  82. package/dist/runtime-registry.js +2 -2
  83. package/dist/studio/{KeyManagementPanel-D5FMvvU9.js → KeyManagementPanel-skUNnKRw.js} +36 -29
  84. package/dist/studio/app.d.ts +8 -1
  85. package/dist/studio/app.d.ts.map +1 -1
  86. package/dist/studio/components/KeyManagementPanel.d.ts.map +1 -1
  87. package/dist/studio/components/KeyManagementPanel.js +1 -1
  88. package/dist/studio/components/index.js +2 -2
  89. package/dist/studio/{components-B4eKIUN5.js → components-CJmzntBi.js} +8 -7
  90. package/dist/studio/control-plane/Data.d.ts.map +1 -1
  91. package/dist/studio/control-plane/Instance.d.ts +4 -1
  92. package/dist/studio/control-plane/Instance.d.ts.map +1 -1
  93. package/dist/studio/control-plane/Operations.d.ts +4 -1
  94. package/dist/studio/control-plane/Operations.d.ts.map +1 -1
  95. package/dist/studio/control-plane/index.js +2 -2
  96. package/dist/studio/control-plane/primitives.d.ts +16 -0
  97. package/dist/studio/control-plane/primitives.d.ts.map +1 -1
  98. package/dist/studio/{control-plane-fxMcJn74.js → control-plane-CaBA7Rgv.js} +448 -424
  99. package/dist/studio/index.d.ts +1 -0
  100. package/dist/studio/index.d.ts.map +1 -1
  101. package/dist/studio/index.js +384 -247
  102. package/dist/studio/navigation.d.ts +57 -0
  103. package/dist/studio/navigation.d.ts.map +1 -0
  104. package/dist/studio/studio.css +1 -1
  105. package/dist/studio/utils/control-plane-api.d.ts +2 -0
  106. package/dist/studio/utils/control-plane-api.d.ts.map +1 -1
  107. package/dist/studio/utils/control-plane-api.js +5 -1
  108. package/dist/studio-app/assets/{feltdb_wasm-BatwwogY.js → feltdb_wasm-BjM1ylL3.js} +1 -1
  109. package/dist/studio-app/assets/feltdb_wasm_bg-TseJn2Ax.wasm +0 -0
  110. package/dist/studio-app/assets/index-1wd0uKua.js +30 -0
  111. package/dist/studio-app/assets/{index-CiC8VY-a.css → index-vi21oEQa.css} +1 -1
  112. package/dist/studio-app/index.html +2 -2
  113. package/dist/transaction.d.ts +27 -11
  114. package/dist/transaction.d.ts.map +1 -1
  115. package/dist/transaction.js +20 -14
  116. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  117. package/dist/wasm/package.json +1 -1
  118. package/dist/workload.d.ts +31 -3
  119. package/dist/workload.d.ts.map +1 -1
  120. package/dist/workload.js +28 -3
  121. package/dist/workspace/local-development-authority.d.ts +19 -0
  122. package/dist/workspace/local-development-authority.d.ts.map +1 -1
  123. package/dist/workspace/local-development-authority.js +335 -15
  124. package/package.json +1 -1
  125. package/dist/studio-app/assets/feltdb_wasm_bg-BX0newOr.wasm +0 -0
  126. package/dist/studio-app/assets/index-DoVvbIay.js +0 -30
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Exclusive ownership of a local state directory.
3
+ *
4
+ * The local file runtime is safe for several processes at the level of a
5
+ * single commit (each mutation takes `state.lock`). An application usually
6
+ * wants more: that no *other* process opens its state at all, because two
7
+ * application processes over one directory each believe they are the only
8
+ * writer of their caches, schedules, and in-process subscriptions.
9
+ *
10
+ * `acquire` creates `owner.lock` in the directory with `O_EXCL` and records
11
+ * the holder (`pid`, `host`, a random token). A second process finds it and is
12
+ * refused with `LocalStateLockedError`. Handles in the same process share the
13
+ * lock and the last `release` removes it; process exit removes it too.
14
+ *
15
+ * A lock whose holder is gone is recoverable: when the recorded host is this
16
+ * host and `process.kill(pid, 0)` reports no such process, the lock is taken
17
+ * over. The takeover renames the old lock aside and checks it is the one that
18
+ * was judged stale before deleting it, so two processes recovering the same
19
+ * stale lock cannot both win. A lock recorded by another host, or one that
20
+ * cannot be read, is never judged stale (it is refused, and the error names
21
+ * the file to remove by hand). A lock records its directory's real path, so a
22
+ * lock copied with the directory (a backup, an upgrade's verification copy)
23
+ * does not hold the copy.
24
+ *
25
+ * This is not authority state: it holds no data, and removing it never
26
+ * changes what the store contains.
27
+ */
28
+ import * as nodeFs from 'fs';
29
+ import * as nodeOs from 'os';
30
+ import * as nodePath from 'path';
31
+ import { LocalStateLockedError } from './error-codes.js';
32
+ export const LOCAL_STATE_LOCK_FILE = 'owner.lock';
33
+ const FORMAT = 'feltdb.local-owner-lock@1';
34
+ /** Locks this process holds, by lock path. */
35
+ const held = new Map();
36
+ let exitHookInstalled = false;
37
+ function randomToken() {
38
+ return globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
39
+ }
40
+ function readRecord(path) {
41
+ let text;
42
+ try {
43
+ text = nodeFs.readFileSync(path, 'utf8');
44
+ }
45
+ catch (error) {
46
+ return error.code === 'ENOENT' ? 'missing' : 'unreadable';
47
+ }
48
+ try {
49
+ const value = JSON.parse(text);
50
+ return value && typeof value === 'object' ? value : 'unreadable';
51
+ }
52
+ catch {
53
+ return 'unreadable';
54
+ }
55
+ }
56
+ /** True only when the holder is provably gone. */
57
+ function holderIsGone(record) {
58
+ if (typeof record.pid !== 'number' || !Number.isInteger(record.pid) || record.pid < 1)
59
+ return false;
60
+ if (record.host !== nodeOs.hostname())
61
+ return false;
62
+ try {
63
+ process.kill(record.pid, 0);
64
+ return false;
65
+ }
66
+ catch (error) {
67
+ // EPERM: the process exists but belongs to another user.
68
+ return error.code === 'ESRCH';
69
+ }
70
+ }
71
+ function installExitHook() {
72
+ if (exitHookInstalled || typeof process?.once !== 'function')
73
+ return;
74
+ exitHookInstalled = true;
75
+ process.once('exit', () => {
76
+ for (const lock of held.values())
77
+ removeIfOurs(lock.path, lock.token);
78
+ held.clear();
79
+ });
80
+ }
81
+ function removeIfOurs(path, token) {
82
+ const record = readRecord(path);
83
+ if (typeof record === 'object' && record.token === token) {
84
+ try {
85
+ nodeFs.unlinkSync(path);
86
+ }
87
+ catch { /* already gone */ }
88
+ }
89
+ }
90
+ /** Write a new lock file, or return false when one exists. */
91
+ function tryCreate(path, record) {
92
+ let fd;
93
+ try {
94
+ fd = nodeFs.openSync(path, 'wx', 0o600);
95
+ }
96
+ catch (error) {
97
+ if (error.code === 'EEXIST')
98
+ return false;
99
+ throw error;
100
+ }
101
+ try {
102
+ nodeFs.writeFileSync(fd, JSON.stringify(record));
103
+ nodeFs.fsyncSync(fd);
104
+ }
105
+ finally {
106
+ nodeFs.closeSync(fd);
107
+ }
108
+ return true;
109
+ }
110
+ /**
111
+ * Move a stale lock out of the way, but only the exact lock judged stale.
112
+ * Returns true when the path is now free to create.
113
+ */
114
+ function removeStale(path, stale) {
115
+ const aside = `${path}.stale-${process.pid}-${randomToken()}`;
116
+ try {
117
+ nodeFs.renameSync(path, aside);
118
+ }
119
+ catch (error) {
120
+ // Someone else removed it first: the path is free (or about to be taken).
121
+ return error.code === 'ENOENT';
122
+ }
123
+ const moved = readRecord(aside);
124
+ if (typeof moved === 'object' && moved.token === stale.token && moved.pid === stale.pid) {
125
+ try {
126
+ nodeFs.unlinkSync(aside);
127
+ }
128
+ catch { /* best effort */ }
129
+ return true;
130
+ }
131
+ // We moved a fresh lock another process had just created. Put it back if
132
+ // nothing has replaced it; if something has, leave ours aside and refuse.
133
+ try {
134
+ nodeFs.linkSync(aside, path);
135
+ }
136
+ catch {
137
+ /* the path was taken again; the next attempt reads it */
138
+ }
139
+ try {
140
+ nodeFs.unlinkSync(aside);
141
+ }
142
+ catch { /* best effort */ }
143
+ return false;
144
+ }
145
+ /**
146
+ * Take exclusive ownership of `directory` for this process.
147
+ * Throws `LocalStateLockedError` when another live process holds it.
148
+ */
149
+ export function acquireLocalStateLock(directory) {
150
+ // The real path: two spellings of one directory (a symlink, a relative
151
+ // path) must find the same lock and the same holder.
152
+ let real = directory;
153
+ try {
154
+ real = nodeFs.realpathSync(directory);
155
+ }
156
+ catch { /* not created yet: the caller creates it */ }
157
+ const path = nodePath.join(real, LOCAL_STATE_LOCK_FILE);
158
+ const mine = held.get(path);
159
+ if (mine) {
160
+ mine.count += 1;
161
+ return once(() => release(path));
162
+ }
163
+ const record = {
164
+ format: FORMAT,
165
+ directory: real,
166
+ pid: process.pid,
167
+ host: nodeOs.hostname(),
168
+ token: randomToken(),
169
+ acquiredAt: new Date().toISOString(),
170
+ };
171
+ for (let attempt = 0; attempt < 5; attempt += 1) {
172
+ if (tryCreate(path, record)) {
173
+ held.set(path, { token: record.token, path, count: 1 });
174
+ installExitHook();
175
+ return once(() => release(path));
176
+ }
177
+ const existing = readRecord(path);
178
+ if (existing === 'missing')
179
+ continue;
180
+ if (existing === 'unreadable') {
181
+ throw new LocalStateLockedError(path, {}, 'The lock file could not be read, so its holder cannot be judged gone.');
182
+ }
183
+ if (typeof existing.directory === 'string' && existing.directory !== real) {
184
+ // Copied along with the directory (a backup, a verification copy): it
185
+ // names its original directory, not this one, so nobody holds this one.
186
+ if (removeStale(path, existing))
187
+ continue;
188
+ }
189
+ else if (existing.pid === process.pid && existing.host === nodeOs.hostname()) {
190
+ // Left by an earlier run that had this pid (a restarted container), or
191
+ // by this process before a release that never happened. Either way no
192
+ // other process holds it: take it over.
193
+ if (removeStale(path, existing))
194
+ continue;
195
+ }
196
+ else if (holderIsGone(existing)) {
197
+ if (removeStale(path, existing))
198
+ continue;
199
+ }
200
+ else {
201
+ throw new LocalStateLockedError(path, { pid: existing.pid, host: existing.host, acquiredAt: existing.acquiredAt }, existing.host && existing.host !== nodeOs.hostname()
202
+ ? 'It was locked from another host, so this process cannot tell whether that holder is still running.'
203
+ : undefined);
204
+ }
205
+ }
206
+ const last = readRecord(path);
207
+ throw new LocalStateLockedError(path, typeof last === 'object' ? { pid: last.pid, host: last.host, acquiredAt: last.acquiredAt } : {}, 'Another process kept taking the lock while this one tried to recover it.');
208
+ }
209
+ function release(path) {
210
+ const mine = held.get(path);
211
+ if (!mine)
212
+ return;
213
+ mine.count -= 1;
214
+ if (mine.count > 0)
215
+ return;
216
+ held.delete(path);
217
+ removeIfOurs(path, mine.token);
218
+ }
219
+ function once(action) {
220
+ let done = false;
221
+ return () => { if (!done) {
222
+ done = true;
223
+ action();
224
+ } };
225
+ }
@@ -4,9 +4,6 @@
4
4
  * Tracks relationships between collections (base → derived → further derived)
5
5
  * and propagates mutations automatically without polling.
6
6
  */
7
- /**
8
- * Represents a change in the collection
9
- */
10
7
  export interface CollectionChange<T> {
11
8
  type: 'insert' | 'update' | 'delete';
12
9
  key: string;
@@ -1 +1 @@
1
- {"version":3,"file":"reactive-graph.d.ts","sourceRoot":"","sources":["../src/reactive-graph.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAClC,qEAAqE;IACrE,OAAO,CAAC,YAAY,CAAuC;IAE3D,4DAA4D;IAC5D,OAAO,CAAC,WAAW,CAAwF;IAE3G,oEAAoE;IACpE,OAAO,CAAC,aAAa,CAAmD;IAExE;;OAEG;IACH,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAO/E;;OAEG;IACH,SAAS,CACP,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAChE,MAAM,IAAI;IAgBb;;OAEG;IACG,UAAU,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,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CAAC,GAChE,MAAM,IAAI;IAgBb;;OAEG;IACG,UAAU,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BvF;;OAEG;IACH,gBAAgB,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAAE;IAKlE;;OAEG;IACH,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAIhD;;OAEG;IACH,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IAIlD;;OAEG;IACH,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO;IAK9C;;OAEG;IACH,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE;CAIhD;AAKD;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,uBAAuB,CAKpE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
@@ -4,6 +4,11 @@
4
4
  * Tracks relationships between collections (base → derived → further derived)
5
5
  * and propagates mutations automatically without polling.
6
6
  */
7
+ /**
8
+ * Represents a change in the collection
9
+ */
10
+ /** Recent changes kept per collection for differential updates. */
11
+ const RECENT_CHANGE_LIMIT = 256;
7
12
  /**
8
13
  * Tracks dependencies between collections and propagates changes
9
14
  */
@@ -48,7 +53,12 @@ export class ReactiveDependencyGraph {
48
53
  if (!this.recentChanges.has(collectionName)) {
49
54
  this.recentChanges.set(collectionName, []);
50
55
  }
51
- this.recentChanges.get(collectionName).push(change);
56
+ const recent = this.recentChanges.get(collectionName);
57
+ recent.push(change);
58
+ // A differential-update window, not a history: FeltDB's history is the
59
+ // authority's. Bounded so a long-lived process does not grow without end.
60
+ if (recent.length > RECENT_CHANGE_LIMIT)
61
+ recent.splice(0, recent.length - RECENT_CHANGE_LIMIT);
52
62
  // Notify subscribers of this collection
53
63
  const subscribers = this.subscribers.get(collectionName);
54
64
  if (subscribers) {
@@ -12,8 +12,13 @@
12
12
  * lets a browser application import `@feltdb/core` at all.
13
13
  */
14
14
  import type { JsDb } from './feltdb.js';
15
+ /** Options `createFeltDB` passes through to a platform runtime. */
16
+ export interface RuntimeFactoryOptions {
17
+ /** Local file runtime: how the state directory is opened. */
18
+ access?: 'shared' | 'exclusive';
19
+ }
15
20
  /** Builds a runtime from the option that selected it. */
16
- export type RuntimeFactory = (target: string) => JsDb;
21
+ export type RuntimeFactory = (target: string, options?: RuntimeFactoryOptions) => JsDb;
17
22
  /**
18
23
  * Make a runtime available to `createFeltDB`.
19
24
  *
@@ -28,5 +33,5 @@ export declare function resolveRuntime(name: string): RuntimeFactory | undefined
28
33
  * because "cannot resolve fs" is not an actionable error for someone who just
29
34
  * wants a database in a browser.
30
35
  */
31
- export declare function requireRuntime(name: string, target: string, guidance: string): JsDb;
36
+ export declare function requireRuntime(name: string, target: string, guidance: string, options?: RuntimeFactoryOptions): JsDb;
32
37
  //# sourceMappingURL=runtime-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-registry.d.ts","sourceRoot":"","sources":["../src/runtime-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAItD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAE3E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAInF"}
1
+ {"version":3,"file":"runtime-registry.d.ts","sourceRoot":"","sources":["../src/runtime-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CACjC;AAED,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAIvF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAE3E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAIpH"}
@@ -30,9 +30,9 @@ export function resolveRuntime(name) {
30
30
  * because "cannot resolve fs" is not an actionable error for someone who just
31
31
  * wants a database in a browser.
32
32
  */
33
- export function requireRuntime(name, target, guidance) {
33
+ export function requireRuntime(name, target, guidance, options) {
34
34
  const factory = resolveRuntime(name);
35
35
  if (!factory)
36
36
  throw new Error(guidance);
37
- return factory(target);
37
+ return factory(target, options);
38
38
  }
@@ -29,11 +29,11 @@ var a = {
29
29
  revokeBtn: "_revokeBtn_1cbba_250",
30
30
  info: "_info_1cbba_265"
31
31
  }, o = ({ apiUrl: o, token: s, namespace: c = "app-store-sherpa", onConfigure: l }) => {
32
- let [u, d] = t([]), [f, p] = t(!0), [m, h] = t(null), [g, _] = t(!1), [v, y] = t(null), [b, x] = t(""), [S, C] = t([
32
+ let [u, d] = t([]), [f, p] = t(!0), [m, h] = t(null), [g, _] = t(!1), [v, y] = t(null), [b, x] = t(""), [S, C] = t(!1), [w, T] = t([
33
33
  "state:read",
34
34
  "state:write",
35
35
  "events:read"
36
- ]), w = [
36
+ ]), E = [
37
37
  "state:read",
38
38
  "state:write",
39
39
  "events:read",
@@ -41,7 +41,7 @@ var a = {
41
41
  "backup:restore",
42
42
  "admin:logs",
43
43
  "admin:restart"
44
- ], T = [
44
+ ], D = [
45
45
  "state:read",
46
46
  "state:write",
47
47
  "events:read",
@@ -51,9 +51,9 @@ var a = {
51
51
  "admin:restart"
52
52
  ];
53
53
  e(() => {
54
- E();
54
+ O();
55
55
  }, [o, s]);
56
- let E = async () => {
56
+ let O = async () => {
57
57
  try {
58
58
  if (p(!0), h(null), !o) {
59
59
  h("A server or managed API URL is not configured."), p(!1);
@@ -65,8 +65,11 @@ var a = {
65
65
  });
66
66
  if (e.status === 401) throw Error("Unauthorized: Invalid or expired API token");
67
67
  if (e.status === 403) throw Error("Forbidden: Your account does not have permission to manage API keys");
68
- if (e.status === 404) throw Error("This authority does not offer API key management. The local development authority has no keys to list; a managed or self-hosted instance does.");
69
- if (!e.ok) throw Error(`Failed to fetch keys: ${e.status} ${e.statusText}`);
68
+ if (e.status === 404) {
69
+ C(!0), d([]);
70
+ return;
71
+ }
72
+ if (C(!1), !e.ok) throw Error(`Failed to fetch keys: ${e.status} ${e.statusText}`);
70
73
  let t = await e.json();
71
74
  d(t.tokens || []);
72
75
  } catch (e) {
@@ -75,7 +78,7 @@ var a = {
75
78
  } finally {
76
79
  p(!1);
77
80
  }
78
- }, D = async (e) => {
81
+ }, k = async (e) => {
79
82
  e.preventDefault();
80
83
  try {
81
84
  let e = await fetch(`${o}/api/keys`, {
@@ -87,7 +90,7 @@ var a = {
87
90
  body: JSON.stringify({
88
91
  id: b || `key-${Date.now()}`,
89
92
  namespace: c,
90
- scopes: S.length > 0 ? S : T
93
+ scopes: w.length > 0 ? w : D
91
94
  }),
92
95
  signal: AbortSignal.timeout(1e4)
93
96
  });
@@ -95,12 +98,12 @@ var a = {
95
98
  if (e.status === 409) throw Error("A key with this name already exists");
96
99
  if (!e.ok) throw Error(`Failed to create key: ${e.status} ${e.statusText}`);
97
100
  let t = await e.json();
98
- j(t.secret), x(""), C(T), _(!1), await E();
101
+ N(t.secret), x(""), T(D), _(!1), await O();
99
102
  } catch (e) {
100
103
  let t = e instanceof TypeError ? "Connection error: Unable to reach the API server" : e instanceof Error ? e.message : "Failed to create key";
101
104
  h(t), console.error("Error creating API key:", e);
102
105
  }
103
- }, O = async (e) => {
106
+ }, A = async (e) => {
104
107
  if (confirm(`Revoke key "${e}"? This cannot be undone.`)) try {
105
108
  let t = await fetch(`${o}/api/keys/${e}`, {
106
109
  method: "DELETE",
@@ -110,28 +113,32 @@ var a = {
110
113
  if (t.status === 404) throw Error("Key not found");
111
114
  if (t.status === 401) throw Error("Unauthorized: Invalid or expired API token");
112
115
  if (!t.ok) throw Error(`Failed to revoke key: ${t.status} ${t.statusText}`);
113
- await E();
116
+ await O();
114
117
  } catch (e) {
115
118
  let t = e instanceof TypeError ? "Connection error: Unable to reach the API server" : e instanceof Error ? e.message : "Failed to revoke key";
116
119
  h(t), console.error("Error revoking API key:", e);
117
120
  }
118
- }, k = (e, t) => {
121
+ }, j = (e, t) => {
119
122
  navigator.clipboard.writeText(e), y(t), setTimeout(() => y(null), 2e3);
120
- }, [A, j] = t(null);
123
+ }, [M, N] = t(null);
121
124
  return f ? /* @__PURE__ */ r("div", {
122
125
  className: a.panel,
123
126
  children: "Loading keys..."
124
127
  }) : /* @__PURE__ */ i("div", {
125
128
  className: a.panel,
126
129
  children: [
127
- /* @__PURE__ */ i("div", {
130
+ /* @__PURE__ */ r("div", {
128
131
  className: a.header,
129
- children: [/* @__PURE__ */ r("h2", { children: "API Key Management" }), /* @__PURE__ */ r("button", {
132
+ children: !S && o && /* @__PURE__ */ r("button", {
130
133
  className: a.createButton,
131
134
  onClick: () => _(!g),
132
- disabled: !o,
133
135
  children: g ? "✕ Cancel" : "+ New Key"
134
- })]
136
+ })
137
+ }),
138
+ S && /* @__PURE__ */ i("div", {
139
+ className: a.info,
140
+ "data-availability": "unsupported",
141
+ children: [/* @__PURE__ */ r("strong", { children: "This instance does not issue API keys." }), /* @__PURE__ */ r("p", { children: "The local development authority is unauthenticated and loopback-only, so there are no keys to create or list. A self-hosted or managed FeltDB server issues them." })]
135
142
  }),
136
143
  m && /* @__PURE__ */ i("div", {
137
144
  className: a.error,
@@ -155,7 +162,7 @@ var a = {
155
162
  ]
156
163
  }),
157
164
  /* @__PURE__ */ r("button", {
158
- onClick: () => E(),
165
+ onClick: () => O(),
159
166
  style: {
160
167
  marginTop: "8px",
161
168
  padding: "4px 12px",
@@ -178,19 +185,19 @@ var a = {
178
185
  children: "Open connection settings"
179
186
  })]
180
187
  }),
181
- A && /* @__PURE__ */ i("div", {
188
+ M && /* @__PURE__ */ i("div", {
182
189
  className: a.info,
183
190
  children: [
184
191
  /* @__PURE__ */ r("strong", { children: "New secret — copy it now; it will not be shown again." }),
185
- /* @__PURE__ */ r("code", { children: A }),
192
+ /* @__PURE__ */ r("code", { children: M }),
186
193
  /* @__PURE__ */ r("button", {
187
- onClick: () => k(A, "created"),
194
+ onClick: () => j(M, "created"),
188
195
  children: v === "created" ? "✓ Copied" : "Copy secret"
189
196
  })
190
197
  ]
191
198
  }),
192
- g && /* @__PURE__ */ i("form", {
193
- onSubmit: D,
199
+ g && !S && /* @__PURE__ */ i("form", {
200
+ onSubmit: k,
194
201
  className: a.createForm,
195
202
  children: [
196
203
  /* @__PURE__ */ i("div", {
@@ -206,13 +213,13 @@ var a = {
206
213
  className: a.formGroup,
207
214
  children: [/* @__PURE__ */ r("label", { children: "Scopes" }), /* @__PURE__ */ r("div", {
208
215
  className: a.scopeList,
209
- children: w.map((e) => /* @__PURE__ */ i("label", {
216
+ children: E.map((e) => /* @__PURE__ */ i("label", {
210
217
  className: a.scopeCheckbox,
211
218
  children: [/* @__PURE__ */ r("input", {
212
219
  type: "checkbox",
213
- checked: S.includes(e),
220
+ checked: w.includes(e),
214
221
  onChange: (t) => {
215
- t.target.checked ? C([...S, e]) : C(S.filter((t) => t !== e));
222
+ t.target.checked ? T([...w, e]) : T(w.filter((t) => t !== e));
216
223
  }
217
224
  }), e]
218
225
  }, e))
@@ -225,7 +232,7 @@ var a = {
225
232
  })
226
233
  ]
227
234
  }),
228
- u.length === 0 ? /* @__PURE__ */ r("div", {
235
+ S ? null : u.length === 0 ? /* @__PURE__ */ r("div", {
229
236
  className: a.empty,
230
237
  children: "No API keys configured. Create one to get started."
231
238
  }) : /* @__PURE__ */ r("div", {
@@ -260,7 +267,7 @@ var a = {
260
267
  className: a.keyActions,
261
268
  children: /* @__PURE__ */ r("button", {
262
269
  className: a.revokeBtn,
263
- onClick: () => O(e.id),
270
+ onClick: () => A(e.id),
264
271
  disabled: e.revoked,
265
272
  children: "Revoke"
266
273
  })
@@ -20,6 +20,13 @@ export interface ApplicationConnectionNoticeProps {
20
20
  registration?: {
21
21
  namespace?: string;
22
22
  };
23
+ /**
24
+ * Whether Studio could ask the development session at all. `unreachable`
25
+ * means the session did not answer, which says nothing about the
26
+ * application; without a registration it otherwise reads as waiting.
27
+ */
28
+ session?: 'reachable' | 'unreachable';
29
+ applicationUrl?: string;
23
30
  }
24
31
  export type StudioConnectionResolution = {
25
32
  source: 'explicit-authority' | 'configured-authority';
@@ -38,7 +45,7 @@ export declare function resolveStudioConnection(input: {
38
45
  }): StudioConnectionResolution;
39
46
  /** A registration proves the application is connected; it does not identify
40
47
  * the JavaScript environment in which the application itself executes. */
41
- export declare function ApplicationConnectionNotice({ registration }: ApplicationConnectionNoticeProps): React.JSX.Element;
48
+ export declare function ApplicationConnectionNotice({ registration, session, applicationUrl }: ApplicationConnectionNoticeProps): React.JSX.Element;
42
49
  export declare function StudioApp({ db, remoteUrl, token, namespace, deploymentRuntime, applicationUrl, applicationId, environment, developmentSession, managedPublish, sourceSync, onConnect }: StudioAppProps): React.JSX.Element;
43
50
  export default St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,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,SAAc,EAAE,KAAU,EAAE,SAAqB,EAAE,iBAA6B,EAAE,cAAmB,EAAE,aAAkB,EAAE,WAA0B,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,cAAc,qBAqIjQ;AAiED,eAAe,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyManagementPanel.d.ts","sourceRoot":"","sources":["../../src/components/KeyManagementPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAWnD,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAmUhE,CAAC"}
1
+ {"version":3,"file":"KeyManagementPanel.d.ts","sourceRoot":"","sources":["../../src/components/KeyManagementPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAWnD,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAgVhE,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../KeyManagementPanel-D5FMvvU9.js";
1
+ import { t as e } from "../KeyManagementPanel-skUNnKRw.js";
2
2
  export { e as KeyManagementPanel };
@@ -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, y } from "../components-B4eKIUN5.js";
2
- import { t as b } from "../KeyManagementPanel-D5FMvvU9.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, y } from "../components-CJmzntBi.js";
2
+ import { t as b } from "../KeyManagementPanel-skUNnKRw.js";
3
3
  import { ManagedInstancePanel as x } from "./ManagedInstancePanel.js";
4
4
  export { v as AgentExplorer, s as ApplicationDesigner, u as AskFeltDB, l as CapabilityExplorer, m as ConflictExplorer, _ as ContractInspector, n as ExecutionViewer, o as GlobalSearch, g as HealthCenter, b as KeyManagementPanel, x as ManagedInstancePanel, a as ModuleExplorer, t as OperationsExplorer, r as OverviewDashboard, c as PeerMap, p as ProposalBrowser, d as ProvenanceViewer, f as ReferenceExplorer, e as SettingsPanel, h as StateExplorer, y as WorkflowVisualizer, i as dataCollectionLocation };
@@ -1,6 +1,6 @@
1
1
  import { ServiceApiError as e, StudioServiceApi as t, safeDisplayValue as n, serviceApiErrorMessage as r } from "./utils/service-api.js";
2
2
  import { StudioProposalApi as i, proposalErrorMessage as a, proposalSections as o } from "./utils/proposal-api.js";
3
- import "./KeyManagementPanel-D5FMvvU9.js";
3
+ import "./KeyManagementPanel-skUNnKRw.js";
4
4
  import "./components/ManagedInstancePanel.js";
5
5
  import s, { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
6
6
  import { Link as p } from "react-router-dom";
@@ -227,7 +227,7 @@ function M({ model: e }) {
227
227
  children: [/* @__PURE__ */ g("header", { children: [
228
228
  /* @__PURE__ */ h("span", {
229
229
  className: "eyebrow",
230
- children: "Design"
230
+ children: "Build"
231
231
  }),
232
232
  /* @__PURE__ */ h("h1", { children: "Workflows" }),
233
233
  /* @__PURE__ */ h("p", { children: "Durable state transitions declared by the application model." })
@@ -271,7 +271,7 @@ function N({ model: e }) {
271
271
  children: [/* @__PURE__ */ g("header", { children: [
272
272
  /* @__PURE__ */ h("span", {
273
273
  className: "eyebrow",
274
- children: "Design"
274
+ children: "Build"
275
275
  }),
276
276
  /* @__PURE__ */ h("h1", { children: "Agents" }),
277
277
  /* @__PURE__ */ h("p", { children: "Autonomous participants whose authority and workflows are part of the model." })
@@ -308,7 +308,7 @@ function F({ db: e, remoteUrl: t = "", token: n = "", applicationUrl: r = "", fe
308
308
  c(t), d(n);
309
309
  }, [t, n]), /* @__PURE__ */ g("div", {
310
310
  className: "settings-panel",
311
- children: [/* @__PURE__ */ h("h2", { children: "Settings" }), /* @__PURE__ */ g("div", {
311
+ children: [/* @__PURE__ */ h("h1", { children: "Connection" }), /* @__PURE__ */ g("div", {
312
312
  className: "settings-content",
313
313
  children: [
314
314
  /* @__PURE__ */ h("h3", { children: "Application" }),
@@ -649,7 +649,8 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
649
649
  namespace: V.namespace.trim() || t,
650
650
  server: {
651
651
  url: V.url.trim().replace(/\/$/, ""),
652
- token: V.token
652
+ token: V.token,
653
+ operatorConsole: !0
653
654
  }
654
655
  });
655
656
  try {
@@ -1990,7 +1991,7 @@ function ie({ model: e, section: t }) {
1990
1991
  className: "studio-model-page",
1991
1992
  children: [/* @__PURE__ */ g("header", { children: [/* @__PURE__ */ h("span", {
1992
1993
  className: "eyebrow",
1993
- children: "Contract"
1994
+ children: "Build"
1994
1995
  }), /* @__PURE__ */ h("h1", { children: t === "schema" ? "Schema" : "Policies" })] }), t === "schema" ? e.collections.map((e) => /* @__PURE__ */ g("article", {
1995
1996
  className: "studio-card",
1996
1997
  children: [
@@ -2020,7 +2021,7 @@ function Y({ model: e }) {
2020
2021
  /* @__PURE__ */ g("header", { children: [
2021
2022
  /* @__PURE__ */ h("span", {
2022
2023
  className: "eyebrow",
2023
- children: "Design"
2024
+ children: "Build"
2024
2025
  }),
2025
2026
  /* @__PURE__ */ h("h1", { children: "Capabilities" }),
2026
2027
  /* @__PURE__ */ g("p", { children: [
@@ -1 +1 @@
1
- {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../src/control-plane/Data.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AA+PjD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,qBAiSjI;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../src/control-plane/Data.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AA+PjD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,qBAoSjI;AAED,eAAe,WAAW,CAAC"}
@@ -8,7 +8,10 @@ export declare function replicationAvailability(input: {
8
8
  healthError: string;
9
9
  hasHealth: boolean;
10
10
  }): ReplicationAvailability;
11
- export declare function ReplicationHealthUnavailable(): React.JSX.Element;
11
+ /** `reason` is the instance's own explanation, shown whenever it gives one. */
12
+ export declare function ReplicationHealthUnavailable({ reason }?: {
13
+ reason?: string;
14
+ }): React.JSX.Element;
12
15
  export declare function Replication(): React.JSX.Element;
13
16
  export declare function Applications(): React.JSX.Element;
14
17
  export declare function Monitoring(): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../../src/control-plane/Instance.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,uBAAuB,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AED,wBAAgB,SAAS,sBA8CxB"}
@@ -1,7 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  export type OperationsAvailability = 'loading' | 'connection-failure' | 'unsupported' | 'supported';
3
3
  export declare function operationsAvailability(loading: boolean, error: string, capabilityStatus: string): OperationsAvailability;
4
- export declare function TransactionObservabilityUnavailable(): React.JSX.Element;
4
+ /** `reason` is the instance's own explanation, shown whenever it gives one. */
5
+ export declare function TransactionObservabilityUnavailable({ reason }?: {
6
+ reason?: string;
7
+ }): React.JSX.Element;
5
8
  export declare function OperationsConsole({ onOpenRecord }: {
6
9
  onOpenRecord: (collection: string, id: string) => void;
7
10
  }): React.JSX.Element;