flyspace-cli 0.1.21 → 0.1.27

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.
@@ -0,0 +1,39 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
2
+ <g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)" fill="#5052f2" stroke="none">
3
+ <path d="M8237 8664 c-4 -4 -7 -16 -7 -27 0 -12 -5 -34 -10 -51 -6 -17 -26
4
+ -83 -45 -146 -19 -63 -40 -133 -47 -155 -7 -24 -34 -62 -68 -96 -47 -47 -67
5
+ -59 -140 -83 -75 -25 -198 -60 -298 -86 -19 -4 -36 -11 -39 -13 -9 -10 8 -27
6
+ 26 -27 10 0 41 -7 67 -15 27 -8 96 -29 154 -46 153 -47 200 -70 246 -122 42
7
+ -48 75 -135 129 -342 43 -164 48 -165 85 -20 42 165 96 314 127 354 47 60 173
8
+ 113 408 173 136 35 133 40 -50 88 -174 46 -292 93 -332 132 -18 18 -44 55 -57
9
+ 83 -26 55 -109 321 -118 379 -3 21 -20 31 -31 20z m31 -87 c6 -6 14 -26 17
10
+ -42 9 -38 52 -176 73 -235 24 -69 68 -127 117 -155 47 -28 205 -85 295 -106
11
+ 64 -15 90 -33 72 -51 -6 -6 -64 -26 -129 -45 -186 -53 -262 -91 -307 -153 -32
12
+ -43 -105 -245 -121 -332 -16 -83 -51 -64 -79 42 -61 226 -101 308 -173 353
13
+ -43 27 -239 95 -320 112 -17 3 -37 13 -44 21 -19 23 5 39 86 59 83 21 223 68
14
+ 263 89 70 36 115 113 162 276 12 41 25 85 31 98 5 13 9 31 9 40 0 18 18 42 31
15
+ 42 4 0 11 -6 17 -13z M7855 7619 c-47 -30 -225 -105 -353 -150 -477 -165
16
+ -1133 -275 -1907 -320 -104 -6 -529 -13 -942 -16 -600 -4 -753 -8 -753 -18 0
17
+ -7 -39 -134 -86 -281 -47 -148 -120 -375 -161 -504 -41 -129 -110 -345 -153
18
+ -480 -43 -135 -146 -461 -230 -725 -83 -264 -194 -615 -247 -780 -52 -165
19
+ -122 -385 -155 -490 -32 -104 -90 -287 -128 -405 -70 -220 -343 -1081 -431
20
+ -1361 -27 -86 -49 -159 -49 -162 0 -3 70 42 155 101 425 294 601 415 1085 746
21
+ 135 93 255 178 267 190 13 13 39 76 66 161 163 506 297 933 297 943 0 15 -19
22
+ 15 -175 -3 -132 -16 -306 -53 -369 -79 -30 -12 -37 -12 -46 -1 -32 38 307 194
23
+ 550 254 47 11 172 37 279 56 308 56 496 109 746 210 590 238 1142 654 1519
24
+ 1144 31 41 54 76 52 78 -3 3 -19 -5 -35 -17 -80 -56 -353 -163 -571 -224 -341
25
+ -94 -821 -160 -1355 -185 -131 -6 -173 -5 -184 4 -11 11 2 60 78 295 50 155
26
+ 91 287 91 292 0 26 -350 -19 -508 -65 -65 -19 -84 -21 -92 -11 -14 15 16 37
27
+ 125 91 202 101 443 169 720 203 334 40 559 83 813 156 749 213 1424 617 1948
28
+ 1166 115 121 190 208 177 207 -4 0 -21 -9 -38 -20z"/>
29
+ </g>
30
+ <g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)" fill="#9da7fe" stroke="none">
31
+ <path d="M8247 8640 c-4 -8 -13 -40 -21 -70 -8 -30 -22 -77 -30 -105 -8 -27
32
+ -21 -73 -29 -100 -33 -119 -84 -197 -151 -232 -42 -22 -156 -60 -261 -88 -50
33
+ -13 -104 -29 -120 -35 l-30 -12 65 -19 c36 -11 83 -24 105 -31 102 -29 223
34
+ -73 258 -95 75 -47 113 -129 182 -388 14 -55 29 -107 32 -115 3 -8 16 26 28
35
+ 75 43 169 97 319 131 365 30 41 54 58 151 103 18 8 102 35 188 59 85 23 155
36
+ 46 155 49 0 3 -42 16 -92 28 -129 32 -281 85 -333 116 -47 27 -93 86 -114 145
37
+ -27 75 -81 257 -101 335 -5 21 -9 25 -13 15z"/>
38
+ </g>
39
+ </svg>
Binary file
@@ -267,7 +267,7 @@ function stopAutomationRegistryPolling() {
267
267
  // ../api/src/channels.ts
268
268
  import { existsSync as existsSync2, mkdirSync, realpathSync, statSync } from "fs";
269
269
  import { homedir } from "os";
270
- import { isAbsolute, resolve as resolve2, sep } from "path";
270
+ import { isAbsolute, relative, resolve as resolve2, sep } from "path";
271
271
  function isLogicalCwd(p) {
272
272
  return /^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/.test(p);
273
273
  }
@@ -287,9 +287,11 @@ function resolveLogicalCwd(p) {
287
287
  const root = workspaceRoots.get(slug);
288
288
  return root ? resolve2(root, name) : resolve2(logicalRoot(), p);
289
289
  }
290
+ function isUnderLogicalRoot(cwd) {
291
+ return [logicalRoot(), ...workspaceRoots.values()].some((r) => cwd.startsWith(r + sep));
292
+ }
290
293
  function ensureLogicalCwdDir(cwd) {
291
- const roots = [logicalRoot(), ...workspaceRoots.values()];
292
- if (!roots.some((r) => cwd.startsWith(r + sep)) || existsSync2(cwd)) return;
294
+ if (!isUnderLogicalRoot(cwd) || existsSync2(cwd)) return;
293
295
  mkdirSync(cwd, { recursive: true });
294
296
  }
295
297
  function expandPath(p) {
@@ -558,6 +560,8 @@ async function assertCwdInWorkspace(profile, cwd) {
558
560
  }
559
561
  return cwd;
560
562
  }
563
+ const logical = relative(logicalRoot(), cwd).split(sep).join("/");
564
+ if (isLogicalCwd(logical)) return assertCwdInWorkspace(profile, logical);
561
565
  const { data, error } = await getSupabaseClient().from("workspaces").select("slug, root_path");
562
566
  if (error) throw new Error(error.message);
563
567
  const workspaces = data ?? [];
@@ -600,6 +604,10 @@ async function updateChannelById(id, patch) {
600
604
  if (existing?.isDefault && (patch.visibility === "private" || patch.archivedAt || patch.isDefault === false || patch.name !== void 0 && patch.name.trim() !== existing.name)) {
601
605
  throw new DefaultChannelError();
602
606
  }
607
+ if (patch.cwd !== void 0 && existing && patch.cwd === existing.cwd) {
608
+ const { cwd: _unchanged, ...rest } = patch;
609
+ patch = rest;
610
+ }
603
611
  if (patch.cwd !== void 0) {
604
612
  patch = { ...patch, cwd: await assertCwdInWorkspace(existing?.profile ?? getProfile(), patch.cwd) };
605
613
  }
@@ -655,6 +663,9 @@ async function upsertChannelByAgentName(input) {
655
663
  { onConflict: "profile,agent_name" }
656
664
  ).select().single();
657
665
  if (error) throw new Error(error.message);
666
+ if (data.profile !== getProfile()) {
667
+ throw new Error(`agent DM upsert for ${input.agentName} resolved to another workspace's channel`);
668
+ }
658
669
  await refreshChannelRegistry();
659
670
  return rowToChannel(data);
660
671
  }
@@ -2555,7 +2566,8 @@ function rowToMembership(row) {
2555
2566
  status: row["status"],
2556
2567
  invitedAt: row["invited_at"],
2557
2568
  acceptedAt: row["accepted_at"] ?? null,
2558
- memoryAutoPaused: row["memory_auto_paused"] === true
2569
+ memoryAutoPaused: row["memory_auto_paused"] === true,
2570
+ isSupport: row["is_support"] === true
2559
2571
  };
2560
2572
  }
2561
2573
  var WORKSPACE_CACHE_TTL_MS = 6e4;
@@ -2563,13 +2575,14 @@ var workspaceCache = /* @__PURE__ */ new Map();
2563
2575
  async function getWorkspaceBySlug(slug) {
2564
2576
  const cached = workspaceCache.get(slug);
2565
2577
  if (cached && cached.expiresAt > Date.now()) return cached.workspace;
2566
- const { data, error } = await getSupabaseClient().from("workspaces").select("id, slug, agent_connected_at, projects_setup_at").eq("slug", slug).maybeSingle();
2578
+ const { data, error } = await getSupabaseClient().from("workspaces").select("id, slug, agent_connected_at, projects_setup_at, plan").eq("slug", slug).maybeSingle();
2567
2579
  if (error) throw new Error(`getWorkspaceBySlug(${slug}): ${error.message}`);
2568
2580
  const workspace = data ? {
2569
2581
  id: data.id,
2570
2582
  slug: data.slug,
2571
2583
  agentConnectedAt: data.agent_connected_at,
2572
- projectsSetupAt: data.projects_setup_at
2584
+ projectsSetupAt: data.projects_setup_at,
2585
+ plan: data.plan ?? null
2573
2586
  } : null;
2574
2587
  workspaceCache.set(slug, { workspace, expiresAt: Date.now() + WORKSPACE_CACHE_TTL_MS });
2575
2588
  return workspace;
@@ -8943,7 +8956,7 @@ export {
8943
8956
  refreshAutomationRegistry,
8944
8957
  startAutomationRegistryPolling,
8945
8958
  isLogicalCwd,
8946
- resolveLogicalCwd,
8959
+ isUnderLogicalRoot,
8947
8960
  ensureLogicalCwdDir,
8948
8961
  expandPath,
8949
8962
  canSeeChannel,