@threadbase-sh/streamer 1.55.3 → 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/cli.cjs CHANGED
@@ -6249,6 +6249,12 @@ var init_feature_flags = __esm({
6249
6249
  default: false,
6250
6250
  env: "THREADBASE_FEATURE_LIVE_ACTIVITY_PUSH"
6251
6251
  },
6252
+ {
6253
+ id: "e2ee",
6254
+ 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.",
6255
+ default: false,
6256
+ env: "THREADBASE_FEATURE_E2EE"
6257
+ },
6252
6258
  {
6253
6259
  id: "ptyHost",
6254
6260
  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.",
@@ -108227,7 +108233,7 @@ function createScreen() {
108227
108233
  function stripAnsi(str) {
108228
108234
  return str.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").replace(/\x1b\][^\x07]*\x07/g, "");
108229
108235
  }
108230
- var import_headless, PTY_COLS, PTY_ROWS, SCREEN_SCROLLBACK, pty;
108236
+ var import_headless, PTY_COLS, PTY_ROWS, SCREEN_SCROLLBACK, REPLAY_MAX_LINES, pty;
108231
108237
  var init_pty_shared = __esm({
108232
108238
  "src/pty-shared.ts"() {
108233
108239
  "use strict";
@@ -108235,6 +108241,7 @@ var init_pty_shared = __esm({
108235
108241
  PTY_COLS = 120;
108236
108242
  PTY_ROWS = 40;
108237
108243
  SCREEN_SCROLLBACK = 1e3;
108244
+ REPLAY_MAX_LINES = SCREEN_SCROLLBACK + PTY_ROWS;
108238
108245
  pty = null;
108239
108246
  }
108240
108247
  });
@@ -135774,6 +135781,25 @@ function describePushCapability(liveActivityEnabled, env = process.env) {
135774
135781
  liveActivityReason: describeMissingApnsCredentials(env) ?? "APNs credentials are set but the push token store is unavailable, so Live Activity push is disabled."
135775
135782
  };
135776
135783
  }
135784
+ var E2EE_PROTOCOL_VERSION = 1;
135785
+ var E2EE_SUPPORTED = false;
135786
+ function describeE2eeCapability(flagEnabled) {
135787
+ const enabled = E2EE_SUPPORTED && flagEnabled;
135788
+ const base = {
135789
+ supported: E2EE_SUPPORTED,
135790
+ enabled,
135791
+ version: E2EE_PROTOCOL_VERSION,
135792
+ required: false
135793
+ };
135794
+ if (enabled) return base;
135795
+ return {
135796
+ ...base,
135797
+ // Always says why, including when `supported` is false. An operator who set
135798
+ // the flag and saw nothing happen has exactly one question, and a field that
135799
+ // goes absent in the case they hit is the field not answering it.
135800
+ 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"
135801
+ };
135802
+ }
135777
135803
  var identityKeyFailureLogged = false;
135778
135804
  function describeServerIdentityKey() {
135779
135805
  try {
@@ -135828,7 +135854,11 @@ var createMiscRoutes = (deps) => {
135828
135854
  // learn it without re-scanning. Additive: absent means a server with no
135829
135855
  // readable identity key, which a client must read as "cannot verify this
135830
135856
  // server" — never as a reason to fail the rest of this response.
135831
- serverIdentityKey: describeServerIdentityKey()
135857
+ serverIdentityKey: describeServerIdentityKey(),
135858
+ // Whether to encrypt to this server. Additive, same contract as `push`:
135859
+ // absent means an older server, which a client must read as "unknown" and
135860
+ // resolve as today's plaintext path — never as a reason to fail.
135861
+ e2ee: describeE2eeCapability(deps.featureFlagsConfig().values.e2ee)
135832
135862
  });
135833
135863
  });
135834
135864
  app.get("/api/profiles", (c) => c.json([]));
@@ -149858,6 +149888,7 @@ function handleListProjects(url2, res) {
149858
149888
 
149859
149889
  // src/server-wiring.ts
149860
149890
  init_logger();
149891
+ init_pty_shared();
149861
149892
  init_capabilities();
149862
149893
  function wsAllows(principal, required2) {
149863
149894
  return principal === null || hasCapability(principal, required2);
@@ -150173,7 +150204,7 @@ function createApiDeps(deps) {
150173
150204
  }
150174
150205
  deps.addSessionSubscriber(msg.sessionId, ws2);
150175
150206
  if (deps.ptyManager.hasSession(msg.sessionId)) {
150176
- const lines = await deps.ptyManager.getOutputLines(msg.sessionId, 200);
150207
+ const lines = await deps.ptyManager.getOutputLines(msg.sessionId, REPLAY_MAX_LINES);
150177
150208
  const userMessages = deps.ptyManager.getInputHistory(msg.sessionId);
150178
150209
  ws2.send(
150179
150210
  JSON.stringify({