flyspace-cli 0.1.64 → 0.1.66

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.
@@ -30,7 +30,7 @@ import {
30
30
  sweepScratchDir,
31
31
  uploadLocalImages,
32
32
  useHostDbWithoutCredentials
33
- } from "./chunk-O7OYNQND.js";
33
+ } from "./chunk-KPZOOR73.js";
34
34
 
35
35
  // ../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js
36
36
  var require_delayed_stream = __commonJS({
@@ -17878,11 +17878,6 @@ var require_dist = __commonJS({
17878
17878
  // src/index.ts
17879
17879
  import { execFile as execFile2, spawn as spawn6 } from "child_process";
17880
17880
 
17881
- // src/companion/index.ts
17882
- import { mkdtempSync, rmSync as rmSync2 } from "fs";
17883
- import { tmpdir } from "os";
17884
- import { join as join5 } from "path";
17885
-
17886
17881
  // ../api/src/channels.ts
17887
17882
  import { createHash } from "crypto";
17888
17883
  import { existsSync, mkdirSync, realpathSync, statSync } from "fs";
@@ -17924,6 +17919,37 @@ function resolveOwnPersona(channelId) {
17924
17919
  const channel = channelId ? findChannel(channelId) : void 0;
17925
17920
  return workspaceOwnPersona.has(channel?.profile ?? getProfile());
17926
17921
  }
17922
+ var workspaceAgentDefaults = /* @__PURE__ */ new Map();
17923
+ async function refreshWorkspaceAgentDefaults() {
17924
+ const { data, error } = await getSupabaseClient().from("workspaces").select("slug, default_model, default_effort");
17925
+ if (error) return;
17926
+ workspaceAgentDefaults = new Map(
17927
+ (data ?? []).map((w) => [
17928
+ w.slug,
17929
+ {
17930
+ model: typeof w.default_model === "string" && w.default_model.trim() ? w.default_model.trim() : void 0,
17931
+ effort: typeof w.default_effort === "string" && isEffort(w.default_effort) ? w.default_effort : void 0
17932
+ }
17933
+ ])
17934
+ );
17935
+ }
17936
+ function workspaceAgentDefault(profile = getProfile()) {
17937
+ return workspaceAgentDefaults.get(profile) ?? {};
17938
+ }
17939
+ function displayCwd(cwd, hostHome) {
17940
+ const logical = isLogicalCwd(cwd) ? cwd : toLogicalCwd(cwd);
17941
+ let path = cwd;
17942
+ if (isLogicalCwd(logical)) {
17943
+ const [slug, name] = logical.split("/");
17944
+ const root = workspaceRoots.get(slug);
17945
+ path = root ? `${root.replace(/[/\\]+$/, "")}/${name}` : `~/Flyspace/${logical}`;
17946
+ }
17947
+ const home = hostHome?.replace(/[/\\]+$/, "");
17948
+ if (home && (path === home || path.startsWith(`${home}/`) || path.startsWith(`${home}\\`))) {
17949
+ return `~${path.slice(home.length)}`;
17950
+ }
17951
+ return path.replace(/^\/(Users|home)\/[^/]+/, "~").replace(/^\/root(?=\/|$)/, "~").replace(/^[A-Za-z]:\\Users\\[^\\]+/, "~");
17952
+ }
17927
17953
  async function refreshWorkspacePermissionModes() {
17928
17954
  const { data, error } = await getSupabaseClient().from("workspaces").select("slug, permission_mode");
17929
17955
  if (error) return;
@@ -18046,7 +18072,8 @@ async function refreshChannelRegistry() {
18046
18072
  refreshWorkspaceRoots(),
18047
18073
  refreshWorkspacePermissionModes(),
18048
18074
  refreshWorkspaceOwnPersona(),
18049
- refreshWorkspaceAutoContinueLimits()
18075
+ refreshWorkspaceAutoContinueLimits(),
18076
+ refreshWorkspaceAgentDefaults()
18050
18077
  ]);
18051
18078
  if (JSON.stringify([...workspaceRoots]) !== rootsBefore) lastSnapshot = void 0;
18052
18079
  const { data, error } = await getSupabaseClient().from("channels").select("*").order("position", { ascending: true });
@@ -18424,6 +18451,28 @@ async function ensureMemberDmChannel(a, b) {
18424
18451
  }
18425
18452
  }
18426
18453
 
18454
+ // src/dashboard/channel-destroy-sweep.ts
18455
+ function watchDestroyedChannels(store) {
18456
+ let known = new Set(getChannelRegistry().map((c) => c.id));
18457
+ return onChannelRegistryChange(() => {
18458
+ const now = new Set(getChannelRegistry().map((c) => c.id));
18459
+ if (now.size === 0) return;
18460
+ for (const id of known) {
18461
+ if (now.has(id)) continue;
18462
+ const removed = store.forgetChannel(id);
18463
+ console.log(
18464
+ `[channels] channel ${id} destroyed: forgot ${removed} cached row(s), local folder untouched`
18465
+ );
18466
+ }
18467
+ known = now;
18468
+ });
18469
+ }
18470
+
18471
+ // src/companion/index.ts
18472
+ import { mkdtempSync, rmSync as rmSync2 } from "fs";
18473
+ import { tmpdir } from "os";
18474
+ import { join as join5 } from "path";
18475
+
18427
18476
  // ../api/src/dashboard/auth-context.ts
18428
18477
  import { HTTPException } from "hono/http-exception";
18429
18478
  import { isAuthApiError, isAuthRetryableFetchError } from "@supabase/supabase-js";
@@ -18556,10 +18605,17 @@ function sessionUserId(cookies) {
18556
18605
  }
18557
18606
  }
18558
18607
  var isScoped = (name) => name.startsWith(SCOPE_MARK);
18608
+ var isSession = (c) => SESSION_NAME.test(c.name);
18609
+ function hasCorruptSession(cookies) {
18610
+ const session = cookies.filter((c) => isSession(c) && c.value !== "");
18611
+ return session.length > 0 && sessionUserId(session) === null;
18612
+ }
18559
18613
  function readScopedCookies(all, label) {
18560
18614
  const prefix = scopePrefix(label);
18561
18615
  const own = all.filter((c) => c.name.startsWith(prefix)).map((c) => ({ name: c.name.slice(prefix.length), value: c.value }));
18562
- return own.length ? own : all.filter((c) => !isScoped(c.name));
18616
+ if (own.length && !hasCorruptSession(own)) return own;
18617
+ const shared = all.filter((c) => !isScoped(c.name));
18618
+ return hasCorruptSession(shared) ? shared.filter((c) => !isSession(c)) : shared;
18563
18619
  }
18564
18620
  function routeCookieWrites(all, label, writes) {
18565
18621
  const prefix = scopePrefix(label);
@@ -18986,6 +19042,14 @@ async function setWorkspaceOwnPersona(workspaceId, enabled) {
18986
19042
  const { error } = await getSupabaseClient().from("workspaces").update({ own_persona: enabled }).eq("id", workspaceId);
18987
19043
  if (error) throw new Error(`setWorkspaceOwnPersona(${workspaceId}): ${error.message}`);
18988
19044
  }
19045
+ async function setWorkspaceAgentDefaults(workspaceId, patch) {
19046
+ const row = {};
19047
+ if (patch.defaultModel !== void 0) row["default_model"] = patch.defaultModel;
19048
+ if (patch.defaultEffort !== void 0) row["default_effort"] = patch.defaultEffort;
19049
+ if (!Object.keys(row).length) return;
19050
+ const { error } = await getSupabaseClient().from("workspaces").update(row).eq("id", workspaceId);
19051
+ if (error) throw new Error(`setWorkspaceAgentDefaults(${workspaceId}): ${error.message}`);
19052
+ }
18989
19053
  async function setWorkspacePermissionMode(workspaceId, mode) {
18990
19054
  const { error } = await getSupabaseClient().from("workspaces").update({ permission_mode: mode }).eq("id", workspaceId);
18991
19055
  if (error) throw new Error(`setWorkspacePermissionMode(${workspaceId}): ${error.message}`);
@@ -19000,6 +19064,105 @@ async function setAgentPaused(workspaceId, paused) {
19000
19064
  if (error) throw new Error(`setAgentPaused(${workspaceId}): ${error.message}`);
19001
19065
  }
19002
19066
 
19067
+ // ../api/src/store/support-store.ts
19068
+ var SUPPORT_HANDLE = "flyspace-support";
19069
+ async function logSupportAction(entry) {
19070
+ const { error } = await getSupabaseClient().from("support_access_log").insert({
19071
+ workspace_id: entry.workspaceId,
19072
+ staff_user_id: entry.staffUserId,
19073
+ staff_email: entry.staffEmail,
19074
+ action: entry.action,
19075
+ detail: entry.detail ?? null
19076
+ });
19077
+ if (error) throw new Error(`logSupportAction(${entry.action}): ${error.message}`);
19078
+ }
19079
+ async function listSupportWorkspaceIds(userId) {
19080
+ const { data, error } = await getSupabaseClient().from("memberships").select("workspace_id").eq("user_id", userId).eq("is_support", true);
19081
+ if (error) throw new Error(`listSupportWorkspaceIds: ${error.message}`);
19082
+ return new Set((data ?? []).map((r) => r.workspace_id));
19083
+ }
19084
+ async function grantSupportMembership(params) {
19085
+ const db = getSupabaseClient();
19086
+ const { data: existing, error: readError } = await db.from("memberships").select("is_support").eq("workspace_id", params.workspaceId).eq("user_id", params.userId).maybeSingle();
19087
+ if (readError) throw new Error(`grantSupportMembership: ${readError.message}`);
19088
+ if (existing) {
19089
+ if (existing.is_support === true) return "existing";
19090
+ throw new Error("already a regular member of this workspace");
19091
+ }
19092
+ const { data: taken } = await db.from("memberships").select("id").eq("workspace_id", params.workspaceId).eq("handle", SUPPORT_HANDLE).maybeSingle();
19093
+ const handle = taken ? `${SUPPORT_HANDLE}-${params.userId.slice(0, 8)}` : SUPPORT_HANDLE;
19094
+ const { error } = await db.from("memberships").insert({
19095
+ workspace_id: params.workspaceId,
19096
+ user_id: params.userId,
19097
+ email: params.email,
19098
+ handle,
19099
+ role: "admin",
19100
+ status: "active",
19101
+ is_support: true,
19102
+ accepted_at: (/* @__PURE__ */ new Date()).toISOString()
19103
+ });
19104
+ if (error) throw new Error(`grantSupportMembership: ${error.message}`);
19105
+ return "granted";
19106
+ }
19107
+ async function revokeSupportMembership(workspaceId, userId) {
19108
+ const { data, error } = await getSupabaseClient().from("memberships").delete().eq("workspace_id", workspaceId).eq("user_id", userId).eq("is_support", true).select("id");
19109
+ if (error) throw new Error(`revokeSupportMembership: ${error.message}`);
19110
+ return (data ?? []).length > 0;
19111
+ }
19112
+ async function listSupportLog(filter) {
19113
+ let query = getSupabaseClient().from("support_access_log").select("*").order("created_at", { ascending: false }).limit(Math.min(filter.limit ?? 200, 1e3));
19114
+ if (filter.workspaceId) query = query.eq("workspace_id", filter.workspaceId);
19115
+ const { data, error } = await query;
19116
+ if (error) throw new Error(`listSupportLog: ${error.message}`);
19117
+ return (data ?? []).map((r) => ({
19118
+ id: r.id,
19119
+ workspaceId: r.workspace_id,
19120
+ staffUserId: r.staff_user_id,
19121
+ staffEmail: r.staff_email,
19122
+ action: r.action,
19123
+ detail: r.detail ?? null,
19124
+ createdAt: r.created_at
19125
+ }));
19126
+ }
19127
+ var SUPPORT_GRANT_HOURS = [1, 24, 168, 720, 0];
19128
+ var SUPPORT_GRANT_FOREVER = "9999-12-31T00:00:00.000Z";
19129
+ async function getActiveSupportGrant(workspaceId) {
19130
+ const { data, error } = await getSupabaseClient().from("support_access_grants").select("id, granted_by_email, reason, expires_at, created_at").eq("workspace_id", workspaceId).is("revoked_at", null).gt("expires_at", (/* @__PURE__ */ new Date()).toISOString()).order("expires_at", { ascending: false }).limit(1).maybeSingle();
19131
+ if (error) throw new Error(`getActiveSupportGrant: ${error.message}`);
19132
+ if (!data) return null;
19133
+ return {
19134
+ id: data.id,
19135
+ grantedByEmail: data.granted_by_email,
19136
+ reason: data.reason ?? null,
19137
+ expiresAt: data.expires_at,
19138
+ createdAt: data.created_at
19139
+ };
19140
+ }
19141
+ async function createSupportGrant(params) {
19142
+ await revokeSupportGrants(params.workspaceId, params.userId);
19143
+ const expiresAt = params.hours === 0 ? SUPPORT_GRANT_FOREVER : new Date(Date.now() + params.hours * 36e5).toISOString();
19144
+ const { data, error } = await getSupabaseClient().from("support_access_grants").insert({
19145
+ workspace_id: params.workspaceId,
19146
+ granted_by: params.userId,
19147
+ granted_by_email: params.email,
19148
+ reason: params.reason ?? null,
19149
+ expires_at: expiresAt
19150
+ }).select("id, granted_by_email, reason, expires_at, created_at").single();
19151
+ if (error) throw new Error(`createSupportGrant: ${error.message}`);
19152
+ return {
19153
+ id: data.id,
19154
+ grantedByEmail: data.granted_by_email,
19155
+ reason: data.reason ?? null,
19156
+ expiresAt: data.expires_at,
19157
+ createdAt: data.created_at
19158
+ };
19159
+ }
19160
+ async function revokeSupportGrants(workspaceId, userId) {
19161
+ const { data, error } = await getSupabaseClient().from("support_access_grants").update({ revoked_at: (/* @__PURE__ */ new Date()).toISOString(), revoked_by: userId }).eq("workspace_id", workspaceId).is("revoked_at", null).gt("expires_at", (/* @__PURE__ */ new Date()).toISOString()).select("id");
19162
+ if (error) throw new Error(`revokeSupportGrants: ${error.message}`);
19163
+ return (data ?? []).length;
19164
+ }
19165
+
19003
19166
  // ../api/src/dashboard/auth-context.ts
19004
19167
  function onboardingPending(ctx) {
19005
19168
  const pending = [];
@@ -19080,6 +19243,7 @@ async function resolveAuthContextUncached(c) {
19080
19243
  if (!workspace) return null;
19081
19244
  const membership = await getMembershipByEmail(workspace.id, user.email);
19082
19245
  if (!membership) return null;
19246
+ if (membership.isSupport && !await getActiveSupportGrant(workspace.id)) return null;
19083
19247
  if (membership.status === "invited") {
19084
19248
  await activateMembership(workspace.id, user.email);
19085
19249
  }
@@ -21822,6 +21986,12 @@ var featureFlags = {
21822
21986
  title: "Columns view",
21823
21987
  description: "A third view next to Rounds and Board: pin up to 6 threads from any channel and read them side by side as full-height columns. Desktop only; pins are kept in this browser.",
21824
21988
  stage: "beta"
21989
+ },
21990
+ "voice-guide": {
21991
+ title: "Voice guide",
21992
+ description: "Support walks you through the UI: a Show me button under @support answers that opens the right page and spotlights what to click, and later a Talk mode that answers out loud. Speech is sent to OpenAI.",
21993
+ stage: "beta",
21994
+ operatorOnly: true
21825
21995
  }
21826
21996
  };
21827
21997
  var featureFlagIds = Object.keys(featureFlags);
@@ -23505,12 +23675,14 @@ async function runAutomation(opts) {
23505
23675
 
23506
23676
  // src/automations/script-runner.ts
23507
23677
  import { spawn as spawn3 } from "child_process";
23678
+ import { accessSync, constants } from "fs";
23508
23679
  var DEFAULT_TIMEOUT_MS = 12e4;
23509
23680
  var KILL_GRACE_MS3 = 5e3;
23510
23681
  function runScriptAutomation(opts) {
23511
23682
  const { name, script, cwd, timeoutMs = DEFAULT_TIMEOUT_MS } = opts;
23512
23683
  return new Promise((resolve8, reject) => {
23513
- const child = spawn3("/bin/bash", [script], { cwd, env: resolveMiseEnv(cwd), stdio: ["ignore", "pipe", "pipe"] });
23684
+ const [cmd, args] = isExecutable(script) ? [script, []] : ["/bin/bash", [script]];
23685
+ const child = spawn3(cmd, args, { cwd, env: resolveMiseEnv(cwd), stdio: ["ignore", "pipe", "pipe"] });
23514
23686
  let stdout = "";
23515
23687
  let stderr = "";
23516
23688
  let timedOut = false;
@@ -23549,6 +23721,14 @@ function runScriptAutomation(opts) {
23549
23721
  });
23550
23722
  });
23551
23723
  }
23724
+ function isExecutable(path) {
23725
+ try {
23726
+ accessSync(path, constants.X_OK);
23727
+ return true;
23728
+ } catch {
23729
+ return false;
23730
+ }
23731
+ }
23552
23732
 
23553
23733
  // ../api/src/automations/manager.ts
23554
23734
  function findInChannels(name) {
@@ -24355,8 +24535,9 @@ function buildFilesPromptSection(result) {
24355
24535
  const parts = [];
24356
24536
  if (result.succeeded.length > 0) {
24357
24537
  const list = result.succeeded.map((f) => `- ${f.path} (${f.name}, ${f.mimetype})`).join("\n");
24538
+ const pdfHint = result.succeeded.some((f) => f.mimetype === "application/pdf") ? '\nFor a PDF over 10 pages, Read it in chunks with the `pages` parameter (max 20 pages per call, e.g. "1-20", "21-40"), or convert it with `pdftotext`. Never give up because it is too large.' : "";
24358
24539
  parts.push(`[attached files \u2014 use the Read tool to view them]
24359
- ${list}`);
24540
+ ${list}${pdfHint}`);
24360
24541
  }
24361
24542
  if (result.skipped.length > 0) {
24362
24543
  const list = result.skipped.map((f) => `- ${f.name}${f.mimetype ? ` (${f.mimetype})` : ""} \u2014 ${f.reason}`).join("\n");
@@ -25505,7 +25686,7 @@ async function withMcpConfig(profile, connectionIds, fn, extraServers = {}) {
25505
25686
 
25506
25687
  // ../api/src/version.ts
25507
25688
  import { readFileSync as readFileSync8 } from "fs";
25508
- var CLI_VERSION = true ? "0.1.64" : devVersion();
25689
+ var CLI_VERSION = true ? "0.1.66" : devVersion();
25509
25690
  function isOlderVersion(a, b) {
25510
25691
  const parse2 = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
25511
25692
  const [pa, pb] = [parse2(a), parse2(b)];
@@ -26070,9 +26251,11 @@ function defaultClaudeCwd() {
26070
26251
  return profileEnv("CLAUDE_CWD") ?? process.cwd();
26071
26252
  }
26072
26253
  function defaultModel() {
26073
- return cachedProfileConfig()?.agentModel || profileEnv("CUSTIE_MODEL")?.trim() || "sonnet";
26254
+ return cachedProfileConfig()?.agentModel || workspaceAgentDefault().model || profileEnv("CUSTIE_MODEL")?.trim() || "sonnet";
26074
26255
  }
26075
26256
  function defaultEffort() {
26257
+ const stored = workspaceAgentDefault().effort;
26258
+ if (stored) return stored;
26076
26259
  const raw = profileEnv("CUSTIE_EFFORT")?.trim().toLowerCase();
26077
26260
  return raw && isEffort(raw) ? raw : void 0;
26078
26261
  }
@@ -29137,7 +29320,34 @@ function isDevHost(c) {
29137
29320
  );
29138
29321
  }
29139
29322
 
29323
+ // ../api/src/dashboard/admin-middleware.ts
29324
+ function platformAdminEmails() {
29325
+ const raw = process.env["PLATFORM_ADMIN_EMAILS"] ?? "";
29326
+ return new Set(
29327
+ raw.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean)
29328
+ );
29329
+ }
29330
+ var requirePlatformOperator = async (c, next) => {
29331
+ const supabase = createRequestSupabaseClient(c);
29332
+ const {
29333
+ data: { user }
29334
+ } = await supabase.auth.getUser();
29335
+ if (!user?.email) return c.json({ error: "not signed in" }, 401);
29336
+ const email = user.email.trim().toLowerCase();
29337
+ if (!platformAdminEmails().has(email)) {
29338
+ return c.json({ error: "platform operator access required" }, 403);
29339
+ }
29340
+ c.set("platformOperator", { userId: user.id, email });
29341
+ return next();
29342
+ };
29343
+
29140
29344
  // ../api/src/dashboard/feature-flags-routes.ts
29345
+ function isOperator(auth) {
29346
+ return platformAdminEmails().has(auth.email.toLowerCase());
29347
+ }
29348
+ function isOperatorOnly(id) {
29349
+ return featureFlags[id].operatorOnly === true;
29350
+ }
29141
29351
  async function isFeatureEnabled(c, flagId) {
29142
29352
  const auth = c.get("auth");
29143
29353
  const enabled = await listEnabledFeatureFlags(auth.workspaceId);
@@ -29149,7 +29359,7 @@ function createFeatureFlagsRouter() {
29149
29359
  const auth = c.get("auth");
29150
29360
  const devHost = isDevHost(c);
29151
29361
  const flags = resolveFeatureFlags(await listEnabledFeatureFlags(auth.workspaceId), devHost);
29152
- const labs = featureFlagIds.filter((id) => isFeatureVisible(featureFlags[id].stage, devHost)).map((id) => ({ id, ...featureFlags[id], enabled: flags[id] }));
29362
+ const labs = featureFlagIds.filter((id) => isFeatureVisible(featureFlags[id].stage, devHost)).filter((id) => !isOperatorOnly(id) || isOperator(auth)).map((id) => ({ id, ...featureFlags[id], enabled: flags[id] }));
29153
29363
  return c.json({ flags, labs });
29154
29364
  });
29155
29365
  const toggle = async (c, enabled) => {
@@ -29157,6 +29367,9 @@ function createFeatureFlagsRouter() {
29157
29367
  if (auth.role !== "admin") return c.json({ error: "admin access required" }, 403);
29158
29368
  const flagId = c.req.param("flagId") ?? "";
29159
29369
  if (!isFeatureFlagId(flagId)) return c.json({ error: "unknown feature flag" }, 404);
29370
+ if (isOperatorOnly(flagId) && !isOperator(auth)) {
29371
+ return c.json({ error: "unknown feature flag" }, 404);
29372
+ }
29160
29373
  const stage = featureFlags[flagId].stage;
29161
29374
  if (stage !== "setting" && !isFeatureVisible(stage, isDevHost(c))) {
29162
29375
  return c.json({ error: "this feature flag cannot be changed here" }, 403);
@@ -31227,7 +31440,6 @@ var SETTINGS_SECTIONS = [
31227
31440
  "activity",
31228
31441
  "channels",
31229
31442
  "domain",
31230
- "workspaces",
31231
31443
  "usage",
31232
31444
  "sessions",
31233
31445
  "mcp-servers",
@@ -32791,6 +33003,10 @@ ${msg.body}` : expandSkillCommand(channelConfig.claudeConfigDir, channelConfig.c
32791
33003
  args: ["mcp", "threads"],
32792
33004
  env: {
32793
33005
  FLYSPACE_THREADS_WORKSPACE: channelConfig.profile,
33006
+ ...channelConfig.permissionThread ? {
33007
+ FLYSPACE_THREAD_ID: channelConfig.permissionThread.threadId,
33008
+ FLYSPACE_CHANNEL_ID: channelConfig.permissionThread.channelId
33009
+ } : {},
32794
33010
  ...channelConfig.requesterHandle ? { FLYSPACE_REQUESTER_HANDLE: channelConfig.requesterHandle } : {}
32795
33011
  }
32796
33012
  },
@@ -35308,6 +35524,7 @@ async function startServer() {
35308
35524
  const caffeinate = startCaffeinate();
35309
35525
  const config = loadConfig();
35310
35526
  const store = new SessionStore(paths.DB_FILE);
35527
+ watchDestroyedChannels(store);
35311
35528
  const runStore = new AutomationRunStore(paths.DB_FILE);
35312
35529
  installUsageRecording();
35313
35530
  const stopRunSync = databaseReachable() ? startAutomationRunSync(runStore, getProfile(), {
@@ -35375,6 +35592,7 @@ export {
35375
35592
  useLocalCache,
35376
35593
  isPermissionMode,
35377
35594
  isLogicalCwd,
35595
+ displayCwd,
35378
35596
  isUnderLogicalRoot,
35379
35597
  expandPath,
35380
35598
  canSeeChannel,
@@ -35445,9 +35663,19 @@ export {
35445
35663
  setWorkspaceAutoContinueLimit,
35446
35664
  getWorkspaceOwnPersona,
35447
35665
  setWorkspaceOwnPersona,
35666
+ setWorkspaceAgentDefaults,
35448
35667
  setWorkspacePermissionMode,
35449
35668
  getAgentPaused,
35450
35669
  setAgentPaused,
35670
+ logSupportAction,
35671
+ listSupportWorkspaceIds,
35672
+ grantSupportMembership,
35673
+ revokeSupportMembership,
35674
+ listSupportLog,
35675
+ SUPPORT_GRANT_HOURS,
35676
+ getActiveSupportGrant,
35677
+ createSupportGrant,
35678
+ revokeSupportGrants,
35451
35679
  onboardingPending,
35452
35680
  invalidateAuthContextCache,
35453
35681
  SUPPORT_AVATAR_URL,
@@ -35620,6 +35848,8 @@ export {
35620
35848
  workspaceHostname,
35621
35849
  trustedHost,
35622
35850
  isDevHost,
35851
+ platformAdminEmails,
35852
+ requirePlatformOperator,
35623
35853
  isFeatureEnabled,
35624
35854
  createFeatureFlagsRouter,
35625
35855
  PLATE,
@@ -221,23 +221,18 @@ import { existsSync as existsSync2 } from "fs";
221
221
  import { resolve as resolve2 } from "path";
222
222
 
223
223
  // ../api/src/effort.ts
224
- var EFFORT_LEVELS = ["low", "medium", "high", "max"];
224
+ var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
225
225
  function isEffort(value) {
226
226
  return EFFORT_LEVELS.includes(value);
227
227
  }
228
- var CLAUDE_EFFORT = {
229
- low: "low",
230
- medium: "medium",
231
- high: "xhigh",
232
- max: "max"
233
- };
234
228
  function resolveClaudeEffort(effort) {
235
- return CLAUDE_EFFORT[effort];
229
+ return effort;
236
230
  }
237
231
  var CODEX_EFFORT = {
238
232
  low: "low",
239
233
  medium: "medium",
240
234
  high: "high",
235
+ xhigh: "high",
241
236
  max: "high"
242
237
  };
243
238
  function resolveCodexEffort(effort) {
@@ -551,6 +546,17 @@ var SessionStore = class {
551
546
  const result = this.db.prepare("DELETE FROM sessions WHERE channel_id = ?").run(channelId);
552
547
  return result.changes;
553
548
  }
549
+ /**
550
+ * Drop every cached row (sessions and `!model`/`!effort` overrides) for a
551
+ * channel that was destroyed in the cloud. Only SQLite rows: the channel's
552
+ * folder and the CLI transcripts on disk are never touched.
553
+ */
554
+ forgetChannel(channelId) {
555
+ let removed = 0;
556
+ for (const table of ["sessions", "model_overrides", "effort_overrides"])
557
+ removed += this.db.prepare(`DELETE FROM ${table} WHERE channel_id = ?`).run(channelId).changes;
558
+ return removed;
559
+ }
554
560
  /**
555
561
  * Re-key a single thread's rows onto a different channel. `sessions`,
556
562
  * `model_overrides` and `effort_overrides` are all keyed by (channel_id,
@@ -8,7 +8,7 @@ import {
8
8
  loadEnvFiles,
9
9
  readHostEndpoint,
10
10
  useHostDbWithoutCredentials
11
- } from "./chunk-O7OYNQND.js";
11
+ } from "./chunk-KPZOOR73.js";
12
12
 
13
13
  // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
14
14
  var external_exports = {};
@@ -14625,6 +14625,30 @@ var shareDocAction = defineContract({
14625
14625
  }),
14626
14626
  output: external_exports.object({ url: external_exports.string() })
14627
14627
  });
14628
+ var docPath = id.refine(
14629
+ (p) => !p.startsWith("/") && !p.startsWith("\\") && !/^[a-z]:/i.test(p) && !p.split(/[\\/]/).includes(".."),
14630
+ { message: "path must be relative to the channel folder, without .." }
14631
+ );
14632
+ var openDocAction = defineContract({
14633
+ name: "open_doc",
14634
+ description: "Open a channel doc in the Docs pane of the requester's Flyspace web UI. Use it when you want the user to see a file you created, edited or are referring to, instead of only naming its path. Only the person who sent the message you are answering sees it open.",
14635
+ effect: "write",
14636
+ input: external_exports.object({
14637
+ channel_id: id.describe("The channel the doc belongs to."),
14638
+ path: docPath.describe("Doc path relative to the channel folder, e.g. docs/plan.md."),
14639
+ line: external_exports.number().int().positive().optional().describe("Optional 1-based line to scroll to.")
14640
+ }),
14641
+ output: external_exports.object({ opened: external_exports.boolean() })
14642
+ });
14643
+ var setUiZoomAction = defineContract({
14644
+ name: "set_ui_zoom",
14645
+ description: "Set the whole-UI zoom (display size, same as the View menu's Aa slider) in the requester's Flyspace web UI. Use when the user asks to make text or the UI bigger or smaller. Only the person who sent the message you are answering is affected.",
14646
+ effect: "write",
14647
+ input: external_exports.object({
14648
+ percent: external_exports.number().int().min(80).max(200).describe("Zoom level in percent, 80 to 200, in steps of 10 (e.g. 150).")
14649
+ }),
14650
+ output: external_exports.object({ zoom: external_exports.number() })
14651
+ });
14628
14652
  var listAutoUpdateSharesAction = defineContract({
14629
14653
  name: "list_auto_update_shares",
14630
14654
  description: "Internal: lists the published docs set to auto-update in this Host's workspaces. Polled by the Host itself; never call it directly.",
@@ -14661,6 +14685,8 @@ var ACTIONS = [
14661
14685
  postReplyAction,
14662
14686
  moveThreadAction,
14663
14687
  shareDocAction,
14688
+ openDocAction,
14689
+ setUiZoomAction,
14664
14690
  listAutoUpdateSharesAction,
14665
14691
  requestPermissionAction,
14666
14692
  checkPermissionAction
@@ -14799,6 +14825,8 @@ export {
14799
14825
  postReplyAction,
14800
14826
  moveThreadAction,
14801
14827
  shareDocAction,
14828
+ openDocAction,
14829
+ setUiZoomAction,
14802
14830
  listAutoUpdateSharesAction,
14803
14831
  requestPermissionAction,
14804
14832
  checkPermissionAction,