@threadbase-sh/streamer 1.50.0 → 1.52.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 +22 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +22 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -6227,6 +6227,12 @@ var init_feature_flags = __esm({
|
|
|
6227
6227
|
default: true,
|
|
6228
6228
|
env: "THREADBASE_FEATURE_SESSION_REHYDRATION"
|
|
6229
6229
|
},
|
|
6230
|
+
{
|
|
6231
|
+
id: "liveActivityPush",
|
|
6232
|
+
description: "Drive iOS Live Activity surfaces for running sessions. Off by default: the streamer half needs an APNs p8 and a registered push-to-start token, and without both, mobile falls back to starting the activity locally \u2014 which freezes the moment the app backgrounds and expires silently after ~8h. Mobile reads this flag and skips its local path too, so one switch turns the whole surface off.",
|
|
6233
|
+
default: false,
|
|
6234
|
+
env: "THREADBASE_FEATURE_LIVE_ACTIVITY_PUSH"
|
|
6235
|
+
},
|
|
6230
6236
|
{
|
|
6231
6237
|
id: "ptyHost",
|
|
6232
6238
|
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.",
|
|
@@ -143539,6 +143545,10 @@ async function listDirectories(absolutePath) {
|
|
|
143539
143545
|
const entries = await (0, import_promises11.readdir)(absolutePath, { withFileTypes: true });
|
|
143540
143546
|
return entries.filter((e) => e.isDirectory()).map((e) => ({ name: e.name })).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
143541
143547
|
}
|
|
143548
|
+
async function listFiles(absolutePath) {
|
|
143549
|
+
const entries = await (0, import_promises11.readdir)(absolutePath, { withFileTypes: true });
|
|
143550
|
+
return entries.filter((e) => e.isFile()).map((e) => ({ name: e.name })).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
143551
|
+
}
|
|
143542
143552
|
async function createDirectory(parentAbsolutePath, name) {
|
|
143543
143553
|
if (name.includes("/") || name.includes("\\") || name === ".." || name === ".") {
|
|
143544
143554
|
throw new Error("Invalid directory name");
|
|
@@ -149557,6 +149567,13 @@ var StreamerServer = class {
|
|
|
149557
149567
|
* on disk; neither it nor any device token is ever logged.
|
|
149558
149568
|
*/
|
|
149559
149569
|
initLiveActivityPush(pushRepo) {
|
|
149570
|
+
if (!this.featureFlags.liveActivityPush) {
|
|
149571
|
+
this.log.info(
|
|
149572
|
+
"Live Activity push is disabled by the liveActivityPush feature flag. Enable it with THREADBASE_FEATURE_LIVE_ACTIVITY_PUSH=1, --feature liveActivityPush=true, or feature_flags: in server.yaml.",
|
|
149573
|
+
{ event: "live_activity.disabled" }
|
|
149574
|
+
);
|
|
149575
|
+
return;
|
|
149576
|
+
}
|
|
149560
149577
|
const creds = readApnsCredentialsFromEnv();
|
|
149561
149578
|
if (!creds) {
|
|
149562
149579
|
const why = describeMissingApnsCredentials();
|
|
@@ -153114,8 +153131,11 @@ var StreamerServer = class {
|
|
|
153114
153131
|
const relativePath = url2.searchParams.get("path") ?? "";
|
|
153115
153132
|
try {
|
|
153116
153133
|
const resolved = await resolveBrowsePath(this.browseRoot, relativePath);
|
|
153117
|
-
const directories = await
|
|
153118
|
-
|
|
153134
|
+
const [directories, files] = await Promise.all([
|
|
153135
|
+
listDirectories(resolved),
|
|
153136
|
+
listFiles(resolved)
|
|
153137
|
+
]);
|
|
153138
|
+
json2(res, 200, { path: relativePath, directories, files });
|
|
153119
153139
|
} catch (err) {
|
|
153120
153140
|
const message = err instanceof Error ? err.message : "Browse failed";
|
|
153121
153141
|
if (err instanceof BrowsePathNotFoundError) {
|