@feltdb/core 0.12.1 → 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 (112) hide show
  1. package/dist/build-identity.json +13 -4
  2. package/dist/cli/commands.js +88 -43
  3. package/dist/collection.d.ts +41 -4
  4. package/dist/collection.d.ts.map +1 -1
  5. package/dist/collection.js +116 -47
  6. package/dist/composition.d.ts.map +1 -1
  7. package/dist/composition.js +11 -1
  8. package/dist/create/build-identity.json +13 -4
  9. package/dist/create/cli.js +3 -3
  10. package/dist/create/create.js +17 -19
  11. package/dist/create/package-versions.js +1 -1
  12. package/dist/create/server-source/Cargo.lock +18 -3
  13. package/dist/create/server-source/Cargo.toml +4 -2
  14. package/dist/create/server-source/crates/feltdb/Cargo.toml +20 -0
  15. package/dist/create/server-source/crates/feltdb/LICENSE +21 -0
  16. package/dist/create/server-source/crates/feltdb/README.md +75 -0
  17. package/dist/create/server-source/crates/feltdb/src/agent_state.rs +320 -0
  18. package/dist/create/server-source/crates/feltdb/src/agent_transition_contract.rs +1545 -0
  19. package/dist/create/server-source/crates/feltdb/src/authority.rs +145 -15
  20. package/dist/create/server-source/crates/feltdb/src/lib.rs +227 -23
  21. package/dist/create/server-source/crates/feltdb/src/state_model.rs +1 -5
  22. package/dist/create/server-source/crates/feltdb/tests/agent_state_native.rs +1188 -0
  23. package/dist/create/server-source/crates/feltdb/tests/agent_transition_contract_conformance.rs +2884 -0
  24. package/dist/create/server-source/crates/feltdb/tests/authority_transaction_identity.rs +534 -0
  25. package/dist/create/server-source/crates/feltdb/tests/fixtures/agent_transition_corpus.json +23340 -0
  26. package/dist/create/server-source/crates/feltdb-client/Cargo.toml +29 -0
  27. package/dist/create/server-source/crates/feltdb-client/LICENSE +21 -0
  28. package/dist/create/server-source/crates/feltdb-client/README.md +70 -0
  29. package/dist/create/server-source/crates/feltdb-client/src/application.rs +527 -0
  30. package/dist/create/server-source/crates/feltdb-client/src/authority.rs +679 -0
  31. package/dist/create/server-source/crates/feltdb-client/src/control.rs +292 -0
  32. package/dist/create/server-source/crates/feltdb-client/src/error.rs +227 -0
  33. package/dist/create/server-source/crates/feltdb-client/src/events.rs +146 -0
  34. package/dist/create/server-source/crates/feltdb-client/src/lib.rs +466 -0
  35. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/README.md +4 -0
  36. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/private-ca.pem +20 -0
  37. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/server-key.pem +28 -0
  38. package/dist/create/server-source/crates/feltdb-client/tests/fixtures/server.pem +20 -0
  39. package/dist/create/server-source/crates/feltdb-client/tests/private_ca.rs +95 -0
  40. package/dist/create/server-source/crates/feltdb-server/Cargo.toml +20 -1
  41. package/dist/create/server-source/crates/feltdb-server/LICENSE +21 -0
  42. package/dist/create/server-source/crates/feltdb-server/README.md +12 -1
  43. package/dist/create/server-source/crates/feltdb-server/src/backup.rs +6 -2
  44. package/dist/create/server-source/crates/feltdb-server/src/lib.rs +20 -0
  45. package/dist/create/server-source/crates/feltdb-server/src/main.rs +1 -3
  46. package/dist/create/server-source/crates/feltdb-server/tests/rust_client.rs +683 -0
  47. package/dist/create/server-source/crates/feltdb-wasm/Cargo.toml +3 -1
  48. package/dist/create/template/default-project/README.md +12 -7
  49. package/dist/create/template/default-project/src/pages/Dashboard.tsx +1 -1
  50. package/dist/create/template/dot-feltdb-README.md +3 -3
  51. package/dist/db.d.ts.map +1 -1
  52. package/dist/db.js +43 -17
  53. package/dist/development-runtime-bridge.d.ts.map +1 -1
  54. package/dist/development-runtime-bridge.js +22 -1
  55. package/dist/embedded-transaction.d.ts +75 -8
  56. package/dist/embedded-transaction.d.ts.map +1 -1
  57. package/dist/embedded-transaction.js +124 -18
  58. package/dist/error-codes.d.ts +2 -0
  59. package/dist/error-codes.d.ts.map +1 -1
  60. package/dist/error-codes.js +2 -0
  61. package/dist/feltdb.d.ts +1 -11
  62. package/dist/feltdb.d.ts.map +1 -1
  63. package/dist/file-db.d.ts +6 -0
  64. package/dist/file-db.d.ts.map +1 -1
  65. package/dist/file-db.js +43 -11
  66. package/dist/indexeddb-db.d.ts.map +1 -1
  67. package/dist/indexeddb-db.js +65 -41
  68. package/dist/memory-db.d.ts.map +1 -1
  69. package/dist/memory-db.js +29 -8
  70. package/dist/studio/{KeyManagementPanel-DZuSeWBK.js → KeyManagementPanel-D5FMvvU9.js} +1 -0
  71. package/dist/studio/app.d.ts.map +1 -1
  72. package/dist/studio/components/KeyManagementPanel.d.ts.map +1 -1
  73. package/dist/studio/components/KeyManagementPanel.js +1 -1
  74. package/dist/studio/components/RouteErrorBoundary.d.ts +5 -0
  75. package/dist/studio/components/RouteErrorBoundary.d.ts.map +1 -0
  76. package/dist/studio/components/index.js +2 -2
  77. package/dist/studio/{components-Bivm2lX6.js → components-B4eKIUN5.js} +1 -1
  78. package/dist/studio/control-plane/Agents.d.ts.map +1 -1
  79. package/dist/studio/control-plane/Data.d.ts.map +1 -1
  80. package/dist/studio/control-plane/Instance.d.ts.map +1 -1
  81. package/dist/studio/control-plane/Overview.d.ts.map +1 -1
  82. package/dist/studio/control-plane/Schema.d.ts.map +1 -1
  83. package/dist/studio/control-plane/context.d.ts +4 -1
  84. package/dist/studio/control-plane/context.d.ts.map +1 -1
  85. package/dist/studio/control-plane/index.js +2 -2
  86. package/dist/studio/control-plane/primitives.d.ts +8 -0
  87. package/dist/studio/control-plane/primitives.d.ts.map +1 -1
  88. package/dist/studio/{control-plane-CLm69XwX.js → control-plane-fxMcJn74.js} +1371 -1319
  89. package/dist/studio/index.js +146 -105
  90. package/dist/studio/utils/control-plane-api.d.ts.map +1 -1
  91. package/dist/studio/utils/control-plane-api.js +4 -3
  92. package/dist/studio/utils/service-api.d.ts.map +1 -1
  93. package/dist/studio/utils/service-api.js +5 -4
  94. package/dist/studio-app/assets/{feltdb_wasm-DACcD-zs.js → feltdb_wasm-BatwwogY.js} +1 -1
  95. package/dist/studio-app/assets/feltdb_wasm_bg-BX0newOr.wasm +0 -0
  96. package/dist/studio-app/assets/index-DoVvbIay.js +30 -0
  97. package/dist/studio-app/index.html +1 -1
  98. package/dist/telemetry.d.ts +1 -0
  99. package/dist/telemetry.d.ts.map +1 -1
  100. package/dist/telemetry.js +4 -3
  101. package/dist/transaction-identity.d.ts +62 -0
  102. package/dist/transaction-identity.d.ts.map +1 -0
  103. package/dist/transaction-identity.js +138 -0
  104. package/dist/transaction.d.ts +50 -5
  105. package/dist/transaction.d.ts.map +1 -1
  106. package/dist/transaction.js +28 -0
  107. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  108. package/dist/wasm/package.json +1 -1
  109. package/package.json +1 -1
  110. package/dist/create/server-source/crates/feltdb-wasm/test.db +0 -0
  111. package/dist/studio-app/assets/feltdb_wasm_bg-BejThWID.wasm +0 -0
  112. package/dist/studio-app/assets/index-CoZaxnlm.js +0 -30
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FeltDB Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -5,7 +5,18 @@ second state store: every HTTP mutation calls `FeltDb::insert`, `FeltDb::update`
5
5
  `FeltDb::delete`, producing the same operations, vector-clock updates, durable log entries, and
6
6
  reactive events as an embedded mutation.
7
7
 
8
- Run it with:
8
+ Install it from crates.io (any Rust 1.96+ toolchain):
9
+
10
+ ```sh
11
+ cargo install feltdb-server --locked
12
+ feltdb-server --host 127.0.0.1 --port 7700 --namespace my-app --data ./data/feltdb.log
13
+ ```
14
+
15
+ The command line and the HTTP API are the supported contract. The library half of this crate exposes
16
+ the server's building blocks without a compatibility promise; for embedded state in your own process
17
+ depend on [`feltdb`](https://crates.io/crates/feltdb) instead.
18
+
19
+ From a checkout of the repository, run it with:
9
20
 
10
21
  ```sh
11
22
  cargo run -p feltdb-server -- \
@@ -411,11 +411,15 @@ fn copy_source(
411
411
  if let Some(parent) = destination.parent() {
412
412
  fs::create_dir_all(parent)?;
413
413
  }
414
- fs::copy(source, destination)?;
414
+ // Record what was copied, not what the source measured before the
415
+ // copy. An online backup copies files the server is still appending
416
+ // to (the audit log): a length taken from the source before copying
417
+ // would disagree with the copy's hash and fail verification.
418
+ let copied = fs::copy(source, destination)?;
415
419
  sync_file(destination)?;
416
420
  entries.push(BackupEntry {
417
421
  path: relative.into(),
418
- bytes: metadata.len(),
422
+ bytes: copied,
419
423
  sha256: hash_file(destination)?,
420
424
  });
421
425
  }
@@ -1,3 +1,23 @@
1
+ //! # feltdb-server
2
+ //!
3
+ //! The FeltDB server: the managed FeltDB authority over HTTP. Install and run it with
4
+ //!
5
+ //! ```sh
6
+ //! cargo install feltdb-server --locked
7
+ //! feltdb-server --host 127.0.0.1 --port 7700 --namespace my-app --data ./data/feltdb.log
8
+ //! ```
9
+ //!
10
+ //! Its supported contract is the binary's command line and its HTTP API (`feltdb.public.substrate@1.0`
11
+ //! and the `/v1` Service API, specified in the repository's
12
+ //! [`docs/reference/public-api.md`](https://github.com/rkendel1/flow_db/blob/main/docs/reference/public-api.md)).
13
+ //!
14
+ //! The modules below are the server's building blocks. They are public so the binary and the
15
+ //! repository's tests can use them, and **no compatibility promise covers them**: any release may
16
+ //! change them. For embedded state in your own process, depend on [`feltdb`] directly; it is
17
+ //! re-exported here at the exact version this server is built against.
18
+
19
+ pub use feltdb;
20
+
1
21
  pub mod app_state;
2
22
  pub mod application_contract;
3
23
  pub mod artifacts;
@@ -14293,9 +14293,7 @@ async fn commit_transaction(
14293
14293
  FlowError::CapabilityError(message) if message.starts_with("INVALID_READ_SET:") => {
14294
14294
  ApiError(StatusCode::BAD_REQUEST, message)
14295
14295
  }
14296
- FlowError::CapabilityError(message)
14297
- if message.starts_with("TRANSACTION_ID_PAYLOAD_MISMATCH:") =>
14298
- {
14296
+ FlowError::TransactionIdPayloadMismatch { .. } => {
14299
14297
  ApiError::structured(
14300
14298
  StatusCode::CONFLICT,
14301
14299
  json!({