@threadbase-sh/streamer 1.55.4 → 1.56.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.
package/dist/index.cjs CHANGED
@@ -516,6 +516,12 @@ var FEATURE_FLAGS = [
516
516
  default: false,
517
517
  env: "THREADBASE_FEATURE_LIVE_ACTIVITY_PUSH"
518
518
  },
519
+ {
520
+ id: "e2ee",
521
+ description: "Application-layer encryption between a paired device and this server, independent of TLS, so a tunnel or a LAN observer on the path carries ciphertext. Off by default: it is negotiated per device, never forced, because released mobile builds cannot be force-updated and a server that demanded it would break every one of them.",
522
+ default: false,
523
+ env: "THREADBASE_FEATURE_E2EE"
524
+ },
519
525
  {
520
526
  id: "ptyHost",
521
527
  description: "Keep live PTYs in a separate host process so a streamer restart can reconnect without restarting the agents. Off by default until cross-platform behavior is qualified.",
@@ -5787,6 +5793,25 @@ function describePushCapability(liveActivityEnabled, env = process.env) {
5787
5793
  liveActivityReason: describeMissingApnsCredentials(env) ?? "APNs credentials are set but the push token store is unavailable, so Live Activity push is disabled."
5788
5794
  };
5789
5795
  }
5796
+ var E2EE_PROTOCOL_VERSION = 1;
5797
+ var E2EE_SUPPORTED = false;
5798
+ function describeE2eeCapability(flagEnabled) {
5799
+ const enabled = E2EE_SUPPORTED && flagEnabled;
5800
+ const base = {
5801
+ supported: E2EE_SUPPORTED,
5802
+ enabled,
5803
+ version: E2EE_PROTOCOL_VERSION,
5804
+ required: false
5805
+ };
5806
+ if (enabled) return base;
5807
+ return {
5808
+ ...base,
5809
+ // Always says why, including when `supported` is false. An operator who set
5810
+ // the flag and saw nothing happen has exactly one question, and a field that
5811
+ // goes absent in the case they hit is the field not answering it.
5812
+ reason: E2EE_SUPPORTED ? "disabled by the e2ee feature flag \u2014 set THREADBASE_FEATURE_E2EE=1, --feature e2ee=true, or feature_flags: in server.yaml" : "this build carries the capability negotiation but not yet the handshake it gates"
5813
+ };
5814
+ }
5790
5815
  var identityKeyFailureLogged = false;
5791
5816
  function describeServerIdentityKey() {
5792
5817
  try {
@@ -5841,7 +5866,11 @@ var createMiscRoutes = (deps) => {
5841
5866
  // learn it without re-scanning. Additive: absent means a server with no
5842
5867
  // readable identity key, which a client must read as "cannot verify this
5843
5868
  // server" — never as a reason to fail the rest of this response.
5844
- serverIdentityKey: describeServerIdentityKey()
5869
+ serverIdentityKey: describeServerIdentityKey(),
5870
+ // Whether to encrypt to this server. Additive, same contract as `push`:
5871
+ // absent means an older server, which a client must read as "unknown" and
5872
+ // resolve as today's plaintext path — never as a reason to fail.
5873
+ e2ee: describeE2eeCapability(deps.featureFlagsConfig().values.e2ee)
5845
5874
  });
5846
5875
  });
5847
5876
  app.get("/api/profiles", (c) => c.json([]));