flyspace-cli 0.1.25 → 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.
- package/dist/{chunk-B5NWSWAM.js → chunk-6YFDWUNF.js} +10 -5
- package/dist/cli.js +74 -48
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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 ?? [];
|
|
@@ -2562,7 +2566,8 @@ function rowToMembership(row) {
|
|
|
2562
2566
|
status: row["status"],
|
|
2563
2567
|
invitedAt: row["invited_at"],
|
|
2564
2568
|
acceptedAt: row["accepted_at"] ?? null,
|
|
2565
|
-
memoryAutoPaused: row["memory_auto_paused"] === true
|
|
2569
|
+
memoryAutoPaused: row["memory_auto_paused"] === true,
|
|
2570
|
+
isSupport: row["is_support"] === true
|
|
2566
2571
|
};
|
|
2567
2572
|
}
|
|
2568
2573
|
var WORKSPACE_CACHE_TTL_MS = 6e4;
|
|
@@ -8951,7 +8956,7 @@ export {
|
|
|
8951
8956
|
refreshAutomationRegistry,
|
|
8952
8957
|
startAutomationRegistryPolling,
|
|
8953
8958
|
isLogicalCwd,
|
|
8954
|
-
|
|
8959
|
+
isUnderLogicalRoot,
|
|
8955
8960
|
ensureLogicalCwdDir,
|
|
8956
8961
|
expandPath,
|
|
8957
8962
|
canSeeChannel,
|
package/dist/cli.js
CHANGED
|
@@ -89,6 +89,7 @@ import {
|
|
|
89
89
|
isLockedPlan,
|
|
90
90
|
isLogicalCwd,
|
|
91
91
|
isMemoryType,
|
|
92
|
+
isUnderLogicalRoot,
|
|
92
93
|
isUuid,
|
|
93
94
|
isValidSkillName,
|
|
94
95
|
lastRunsForWorkspace,
|
|
@@ -140,7 +141,6 @@ import {
|
|
|
140
141
|
resolveChannelPrompt,
|
|
141
142
|
resolveCwd,
|
|
142
143
|
resolveFeatureFlags,
|
|
143
|
-
resolveLogicalCwd,
|
|
144
144
|
resolveSelectedOutputStyle,
|
|
145
145
|
resolveUserId,
|
|
146
146
|
runAutomation,
|
|
@@ -184,7 +184,7 @@ import {
|
|
|
184
184
|
warnOnBrokenChannelCwds,
|
|
185
185
|
workspaceSkillsDir,
|
|
186
186
|
writeSkillFile
|
|
187
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-6YFDWUNF.js";
|
|
188
188
|
import {
|
|
189
189
|
firstReplyBody,
|
|
190
190
|
getThread,
|
|
@@ -831,8 +831,8 @@ function flyspaceHome(entry = process.argv[1]) {
|
|
|
831
831
|
if (at <= 0) return void 0;
|
|
832
832
|
const npmPrefix = cliPath.slice(0, at);
|
|
833
833
|
if (basename(npmPrefix) !== "cli") return void 0;
|
|
834
|
-
const
|
|
835
|
-
return existsSync3(join4(
|
|
834
|
+
const home2 = dirname3(npmPrefix);
|
|
835
|
+
return existsSync3(join4(home2, "bin", "flyspace")) && existsSync3(join4(home2, "node", "bin", "node")) ? home2 : void 0;
|
|
836
836
|
}
|
|
837
837
|
function serviceLabel(profile) {
|
|
838
838
|
return profile === DEFAULT_PROFILE ? "ai.flyspace" : `ai.flyspace.${profile}`;
|
|
@@ -976,8 +976,8 @@ function detectClaudeBinDir() {
|
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
function detectNodeBinDir() {
|
|
979
|
-
const
|
|
980
|
-
return
|
|
979
|
+
const home2 = flyspaceHome();
|
|
980
|
+
return home2 ? join5(home2, "node", "bin") : dirname4(process.execPath);
|
|
981
981
|
}
|
|
982
982
|
function nodeShimDirs() {
|
|
983
983
|
return [join5(homedir2(), ".local", "share", "mise", "shims"), join5(homedir2(), ".asdf", "shims")].filter(
|
|
@@ -985,8 +985,8 @@ function nodeShimDirs() {
|
|
|
985
985
|
);
|
|
986
986
|
}
|
|
987
987
|
function detectCustieBin() {
|
|
988
|
-
const
|
|
989
|
-
if (
|
|
988
|
+
const home2 = flyspaceHome();
|
|
989
|
+
if (home2) return join5(home2, "bin", "flyspace");
|
|
990
990
|
const argv1 = process.argv[1];
|
|
991
991
|
if (argv1) {
|
|
992
992
|
return resolve2(argv1);
|
|
@@ -1317,8 +1317,8 @@ function codexTrustedPaths() {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
function isExcluded(path) {
|
|
1320
|
-
const
|
|
1321
|
-
if (path ===
|
|
1320
|
+
const home2 = homedir3();
|
|
1321
|
+
if (path === home2 || path === "/") return true;
|
|
1322
1322
|
if (path === "/tmp" || path.startsWith("/tmp/")) return true;
|
|
1323
1323
|
if (path === "/private/tmp" || path.startsWith("/private/tmp/")) return true;
|
|
1324
1324
|
const root = flyspaceRoot();
|
|
@@ -1330,10 +1330,10 @@ function isExcluded(path) {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
function gitRepos() {
|
|
1333
|
-
const
|
|
1333
|
+
const home2 = homedir3();
|
|
1334
1334
|
const found = [];
|
|
1335
1335
|
for (const rootName of GIT_SCAN_ROOTS) {
|
|
1336
|
-
const root = join7(
|
|
1336
|
+
const root = join7(home2, rootName);
|
|
1337
1337
|
let entries2;
|
|
1338
1338
|
try {
|
|
1339
1339
|
entries2 = readdirSync2(root, { withFileTypes: true });
|
|
@@ -1785,7 +1785,7 @@ async function runAuthCmd(args) {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
1787
|
// ../api/src/version.ts
|
|
1788
|
-
var CLI_VERSION = true ? "0.1.
|
|
1788
|
+
var CLI_VERSION = true ? "0.1.27" : null;
|
|
1789
1789
|
function isOlderVersion(a, b) {
|
|
1790
1790
|
const parse = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
|
|
1791
1791
|
const [pa, pb] = [parse(a), parse(b)];
|
|
@@ -1793,6 +1793,19 @@ function isOlderVersion(a, b) {
|
|
|
1793
1793
|
for (let i = 0; i < 3; i++) if (pa[i] !== pb[i]) return pa[i] < pb[i];
|
|
1794
1794
|
return false;
|
|
1795
1795
|
}
|
|
1796
|
+
var LATEST_TTL_MS = 60 * 6e4;
|
|
1797
|
+
var latest = null;
|
|
1798
|
+
async function latestCliVersion() {
|
|
1799
|
+
if (latest && Date.now() - latest.at < LATEST_TTL_MS) return latest.version;
|
|
1800
|
+
let version = null;
|
|
1801
|
+
try {
|
|
1802
|
+
const res = await fetch("https://registry.npmjs.org/flyspace-cli/latest", { signal: AbortSignal.timeout(5e3) });
|
|
1803
|
+
if (res.ok) version = (await res.json()).version ?? null;
|
|
1804
|
+
} catch {
|
|
1805
|
+
}
|
|
1806
|
+
latest = { version, at: Date.now() };
|
|
1807
|
+
return version;
|
|
1808
|
+
}
|
|
1796
1809
|
|
|
1797
1810
|
// src/commands/setup.ts
|
|
1798
1811
|
var BOLD2 = "\x1B[1m";
|
|
@@ -1831,14 +1844,14 @@ async function servedWorkspaces() {
|
|
|
1831
1844
|
}
|
|
1832
1845
|
function checkLatestVersion() {
|
|
1833
1846
|
if (!CLI_VERSION) return true;
|
|
1834
|
-
let
|
|
1847
|
+
let latest2 = "";
|
|
1835
1848
|
try {
|
|
1836
|
-
|
|
1849
|
+
latest2 = execSync4(`npm view ${"flyspace-cli"} version`, { encoding: "utf-8", stdio: "pipe", timeout: 1e4 }).trim();
|
|
1837
1850
|
} catch {
|
|
1838
1851
|
return true;
|
|
1839
1852
|
}
|
|
1840
|
-
if (!
|
|
1841
|
-
bad(`flyspace ${CLI_VERSION} is out of date (latest ${
|
|
1853
|
+
if (!latest2 || !isOlderVersion(CLI_VERSION, latest2)) return true;
|
|
1854
|
+
bad(`flyspace ${CLI_VERSION} is out of date (latest ${latest2}) ${DIM2}run: flyspace upgrade${RESET2}`);
|
|
1842
1855
|
return false;
|
|
1843
1856
|
}
|
|
1844
1857
|
function loginArgs(args) {
|
|
@@ -2351,24 +2364,24 @@ function npmInstallCommand() {
|
|
|
2351
2364
|
return `npm install ${global} --ignore-scripts ${"flyspace-cli"}@latest && npm rebuild ${global} better-sqlite3`;
|
|
2352
2365
|
}
|
|
2353
2366
|
function npmEnv() {
|
|
2354
|
-
const
|
|
2355
|
-
return
|
|
2367
|
+
const home2 = flyspaceHome();
|
|
2368
|
+
return home2 ? { ...process.env, PATH: `${join11(home2, "node", "bin")}:${process.env.PATH ?? ""}` } : process.env;
|
|
2356
2369
|
}
|
|
2357
2370
|
async function runUpgrade() {
|
|
2358
|
-
const current = "0.1.
|
|
2371
|
+
const current = "0.1.27";
|
|
2359
2372
|
console.log(`Current version: ${current}`);
|
|
2360
2373
|
console.log("Checking for updates...\n");
|
|
2361
2374
|
try {
|
|
2362
|
-
const
|
|
2363
|
-
if (
|
|
2375
|
+
const latest2 = execSync6(`npm view ${"flyspace-cli"} version`, { encoding: "utf-8", env: npmEnv() }).trim();
|
|
2376
|
+
if (latest2 === current) {
|
|
2364
2377
|
console.log(`Already on the latest version (${current}).`);
|
|
2365
2378
|
return;
|
|
2366
2379
|
}
|
|
2367
|
-
console.log(`New version available: ${
|
|
2380
|
+
console.log(`New version available: ${latest2}`);
|
|
2368
2381
|
console.log("Upgrading...\n");
|
|
2369
2382
|
execSync6(npmInstallCommand(), { stdio: "inherit", env: npmEnv() });
|
|
2370
2383
|
console.log(`
|
|
2371
|
-
Upgraded from ${current} to ${
|
|
2384
|
+
Upgraded from ${current} to ${latest2}.`);
|
|
2372
2385
|
restartInstalledProfiles();
|
|
2373
2386
|
console.log("\nReload your shell to use the new version:");
|
|
2374
2387
|
console.log(" source ~/.zshrc # or source ~/.bashrc");
|
|
@@ -5038,7 +5051,7 @@ async function channelHistory(client2, nameOrId, args) {
|
|
|
5038
5051
|
const limit = parseInt(getArg2(args, "--limit") ?? "100", 10);
|
|
5039
5052
|
const isToday = args.includes("--today");
|
|
5040
5053
|
let oldest = getArg2(args, "--oldest");
|
|
5041
|
-
let
|
|
5054
|
+
let latest2 = getArg2(args, "--latest");
|
|
5042
5055
|
if (isToday) {
|
|
5043
5056
|
const now = /* @__PURE__ */ new Date();
|
|
5044
5057
|
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
@@ -5048,7 +5061,7 @@ async function channelHistory(client2, nameOrId, args) {
|
|
|
5048
5061
|
channel: channelId,
|
|
5049
5062
|
limit,
|
|
5050
5063
|
...oldest ? { oldest } : {},
|
|
5051
|
-
...
|
|
5064
|
+
...latest2 ? { latest: latest2 } : {}
|
|
5052
5065
|
});
|
|
5053
5066
|
const messages = (result.messages ?? []).reverse();
|
|
5054
5067
|
if (!messages.length) {
|
|
@@ -9968,8 +9981,8 @@ function createChatRouter(agent = {}) {
|
|
|
9968
9981
|
const { data: reply, error: error2 } = await supabase.from("thread_replies").update({ body, edited_at: (/* @__PURE__ */ new Date()).toISOString() }).eq("id", replyId).select().single();
|
|
9969
9982
|
if (error2) return c.json({ error: error2.message }, 500);
|
|
9970
9983
|
if (isHumanAuthor(author)) {
|
|
9971
|
-
const { data:
|
|
9972
|
-
if (
|
|
9984
|
+
const { data: latest2 } = await supabase.from("thread_replies").select("id").eq("thread_id", existing.thread_id).is("archived_at", null).order("created_at", { ascending: false }).limit(1).maybeSingle();
|
|
9985
|
+
if (latest2?.id === replyId) {
|
|
9973
9986
|
await Promise.resolve(regenerateAgentRun?.(existing.thread_id, replyId)).catch(() => {
|
|
9974
9987
|
});
|
|
9975
9988
|
}
|
|
@@ -10931,7 +10944,7 @@ function createDocShareWriteRouter(agent = {}) {
|
|
|
10931
10944
|
case "host-outdated":
|
|
10932
10945
|
return c.json(
|
|
10933
10946
|
{
|
|
10934
|
-
error: "The Host machine runs an older Flyspace version that cannot publish docs. Update it
|
|
10947
|
+
error: "The Host machine runs an older Flyspace version that cannot publish docs. Update it by running `flyspace upgrade` on that machine, then try again."
|
|
10935
10948
|
},
|
|
10936
10949
|
503
|
|
10937
10950
|
);
|
|
@@ -11429,7 +11442,7 @@ function createMembersRouter() {
|
|
|
11429
11442
|
members.get("/", async (c) => {
|
|
11430
11443
|
const ctx = await resolveAuthContext(c);
|
|
11431
11444
|
if (ctx?.role !== "admin") return c.json({ error: "admin access required" }, 403);
|
|
11432
|
-
const list = await listMemberships(ctx.workspaceId);
|
|
11445
|
+
const list = (await listMemberships(ctx.workspaceId)).filter((m) => !m.isSupport);
|
|
11433
11446
|
const members2 = await Promise.all(
|
|
11434
11447
|
list.map(async (m) => {
|
|
11435
11448
|
const { data } = await getSupabaseClient().auth.admin.getUserById(m.userId);
|
|
@@ -11457,7 +11470,9 @@ function createMembersRouter() {
|
|
|
11457
11470
|
members.get("/directory", async (c) => {
|
|
11458
11471
|
const ctx = await resolveAuthContext(c);
|
|
11459
11472
|
if (!ctx) return c.json({ error: "unauthorized" }, 401);
|
|
11460
|
-
const list = (await listMemberships(ctx.workspaceId)).filter(
|
|
11473
|
+
const list = (await listMemberships(ctx.workspaceId)).filter(
|
|
11474
|
+
(m) => m.status === "active" && !m.isSupport
|
|
11475
|
+
);
|
|
11461
11476
|
const directory = await Promise.all(
|
|
11462
11477
|
list.map(async (m) => {
|
|
11463
11478
|
const { data } = await getSupabaseClient().auth.admin.getUserById(m.userId);
|
|
@@ -12898,9 +12913,9 @@ async function threadUsageForWorkspace(workspace, threadTs) {
|
|
|
12898
12913
|
return { totals: totalsOf(rows), byModel: groupBy(rows, (r) => r.model ?? "unknown") };
|
|
12899
12914
|
}
|
|
12900
12915
|
async function sessionUsageForThreads(workspace, threadTsList) {
|
|
12901
|
-
const
|
|
12916
|
+
const latest2 = /* @__PURE__ */ new Map();
|
|
12902
12917
|
const totals = /* @__PURE__ */ new Map();
|
|
12903
|
-
if (threadTsList.length === 0) return { latest, totals };
|
|
12918
|
+
if (threadTsList.length === 0) return { latest: latest2, totals };
|
|
12904
12919
|
const rows = await fetchUsageRows(workspace, { threadTsIn: threadTsList });
|
|
12905
12920
|
const latestAt = /* @__PURE__ */ new Map();
|
|
12906
12921
|
for (const row of rows) {
|
|
@@ -12909,7 +12924,7 @@ async function sessionUsageForThreads(workspace, threadTsList) {
|
|
|
12909
12924
|
const seenAt = latestAt.get(row.thread_ts);
|
|
12910
12925
|
if (seenAt && seenAt >= row.ran_at) continue;
|
|
12911
12926
|
latestAt.set(row.thread_ts, row.ran_at);
|
|
12912
|
-
|
|
12927
|
+
latest2.set(row.thread_ts, {
|
|
12913
12928
|
model: row.model ?? void 0,
|
|
12914
12929
|
numTurns: row.num_turns ?? void 0,
|
|
12915
12930
|
inputTokens: row.input_tokens,
|
|
@@ -12918,7 +12933,7 @@ async function sessionUsageForThreads(workspace, threadTsList) {
|
|
|
12918
12933
|
label: row.label ?? void 0
|
|
12919
12934
|
});
|
|
12920
12935
|
}
|
|
12921
|
-
return { latest, totals };
|
|
12936
|
+
return { latest: latest2, totals };
|
|
12922
12937
|
}
|
|
12923
12938
|
|
|
12924
12939
|
// ../api/src/dashboard/usage-report.ts
|
|
@@ -13470,7 +13485,7 @@ function createOnboardingRouter(agent) {
|
|
|
13470
13485
|
trialing: billing?.planStatus === "trialing",
|
|
13471
13486
|
hostConnected: !!ctx.agentConnectedAt,
|
|
13472
13487
|
channels: getProfileChannelRegistry().filter((ch) => !ch.isDefault && !ch.dmKey && !ch.agentName && !ch.archivedAt).map((ch) => ch.name),
|
|
13473
|
-
memberCount: members.length
|
|
13488
|
+
memberCount: members.filter((m) => !m.isSupport).length
|
|
13474
13489
|
});
|
|
13475
13490
|
const again = await supabase.from("thread_replies").select("id").eq("thread_id", threadId).limit(1).maybeSingle();
|
|
13476
13491
|
if (again.data) return c.json(done);
|
|
@@ -13605,7 +13620,10 @@ function registerDataRoutes(api, agent = {}) {
|
|
|
13605
13620
|
}
|
|
13606
13621
|
const auth = c.get("auth");
|
|
13607
13622
|
const paused = await getAgentPaused(auth.workspaceId);
|
|
13608
|
-
|
|
13623
|
+
const cliVersion = agent.getHostCliVersion?.(getProfile()) ?? null;
|
|
13624
|
+
const latest2 = cliVersion ? await latestCliVersion() : null;
|
|
13625
|
+
const outdated = !!(cliVersion && latest2 && isOlderVersion(cliVersion, latest2));
|
|
13626
|
+
return c.json({ online: !paused, cliVersion, ...outdated ? { latestCliVersion: latest2 } : {} });
|
|
13609
13627
|
});
|
|
13610
13628
|
api.get("/channels", async (c) => {
|
|
13611
13629
|
const auth = c.get("auth");
|
|
@@ -13842,17 +13860,17 @@ function registerDataRoutes(api, agent = {}) {
|
|
|
13842
13860
|
api.get("/sessions", async (c) => {
|
|
13843
13861
|
const raw = await agent.listSessions?.() ?? [];
|
|
13844
13862
|
const threadTsList = raw.map((s) => s.threadTs);
|
|
13845
|
-
let
|
|
13863
|
+
let latest2;
|
|
13846
13864
|
let totals;
|
|
13847
13865
|
try {
|
|
13848
|
-
({ latest, totals } = await sessionUsageForThreads(getProfile(), threadTsList));
|
|
13866
|
+
({ latest: latest2, totals } = await sessionUsageForThreads(getProfile(), threadTsList));
|
|
13849
13867
|
} catch {
|
|
13850
|
-
|
|
13868
|
+
latest2 = /* @__PURE__ */ new Map();
|
|
13851
13869
|
totals = /* @__PURE__ */ new Map();
|
|
13852
13870
|
const usageStore = existsSync19(paths.DB_FILE) ? getLocalCache().openUsageStore(paths.DB_FILE) : null;
|
|
13853
13871
|
if (usageStore) {
|
|
13854
13872
|
try {
|
|
13855
|
-
|
|
13873
|
+
latest2 = usageStore.latestByThread(threadTsList);
|
|
13856
13874
|
totals = usageStore.totalsByThread(threadTsList);
|
|
13857
13875
|
} finally {
|
|
13858
13876
|
usageStore.close();
|
|
@@ -13861,7 +13879,7 @@ function registerDataRoutes(api, agent = {}) {
|
|
|
13861
13879
|
}
|
|
13862
13880
|
const threadLinks = await resolveThreadLinks(raw);
|
|
13863
13881
|
const sessions2 = raw.map((s) => {
|
|
13864
|
-
const run4 =
|
|
13882
|
+
const run4 = latest2.get(s.threadTs);
|
|
13865
13883
|
const turns = run4?.numTurns ?? 1;
|
|
13866
13884
|
const total = run4 ? run4.inputTokens + run4.cacheReadTokens + run4.cacheCreationTokens : void 0;
|
|
13867
13885
|
const link = s.channelId.startsWith("chat:") ? threadLinks.chat.get(s.threadTs) : threadLinks.external.get(`${s.channelId}:${s.threadTs}`);
|
|
@@ -14494,7 +14512,8 @@ function coerceMemberEmails(raw) {
|
|
|
14494
14512
|
return raw.filter((v) => typeof v === "string").map((v) => v.trim().toLowerCase()).filter(Boolean);
|
|
14495
14513
|
}
|
|
14496
14514
|
function ensureCwdDir(cwd) {
|
|
14497
|
-
const expanded =
|
|
14515
|
+
const expanded = expandPath(cwd);
|
|
14516
|
+
if (isLogicalCwd(cwd) || isUnderLogicalRoot(expanded)) return;
|
|
14498
14517
|
if (!existsSync21(expanded)) mkdirSync10(expanded, { recursive: true });
|
|
14499
14518
|
}
|
|
14500
14519
|
function toResponse3(channel) {
|
|
@@ -15755,12 +15774,12 @@ var RETRY_DELAY_MS = 3e3;
|
|
|
15755
15774
|
var MISSED_MESSAGE_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
15756
15775
|
var MISSED_MESSAGE_THREAD_LIMIT = 100;
|
|
15757
15776
|
var delay = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
15758
|
-
function stripPathPrefixes(label2, roots,
|
|
15777
|
+
function stripPathPrefixes(label2, roots, home2 = homedir9()) {
|
|
15759
15778
|
let out = label2;
|
|
15760
15779
|
for (const root of roots) {
|
|
15761
15780
|
if (root) out = out.replaceAll(`${root.replace(/\/+$/, "")}/`, "");
|
|
15762
15781
|
}
|
|
15763
|
-
if (
|
|
15782
|
+
if (home2) out = out.replaceAll(`${home2.replace(/\/+$/, "")}/`, "~/");
|
|
15764
15783
|
return out;
|
|
15765
15784
|
}
|
|
15766
15785
|
var ChatAgent = class {
|
|
@@ -18069,9 +18088,9 @@ function claudeAccount() {
|
|
|
18069
18088
|
}
|
|
18070
18089
|
}
|
|
18071
18090
|
function codexAccount() {
|
|
18072
|
-
const
|
|
18091
|
+
const home2 = process.env["CODEX_HOME"]?.trim() || join24(homedir10(), ".codex");
|
|
18073
18092
|
try {
|
|
18074
|
-
const auth = JSON.parse(readFileSync21(join24(
|
|
18093
|
+
const auth = JSON.parse(readFileSync21(join24(home2, "auth.json"), "utf8"));
|
|
18075
18094
|
const payload = auth.tokens?.id_token?.split(".")[1];
|
|
18076
18095
|
if (!payload) return void 0;
|
|
18077
18096
|
const claims = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
|
|
@@ -19494,6 +19513,13 @@ async function runReconcileCmd(args) {
|
|
|
19494
19513
|
}
|
|
19495
19514
|
|
|
19496
19515
|
// src/cli.ts
|
|
19516
|
+
import { join as join29 } from "path";
|
|
19517
|
+
var home = flyspaceHome();
|
|
19518
|
+
if (home) {
|
|
19519
|
+
const bin = join29(home, "bin");
|
|
19520
|
+
const path = process.env.PATH ?? "";
|
|
19521
|
+
if (!path.split(":").includes(bin)) process.env.PATH = path ? `${bin}:${path}` : bin;
|
|
19522
|
+
}
|
|
19497
19523
|
var XERO_USAGE = false ? " xero Connect to Xero and expose it as an MCP server\n" : "";
|
|
19498
19524
|
var USAGE9 = `
|
|
19499
19525
|
Usage: flyspace <command> [options]
|
|
@@ -19628,7 +19654,7 @@ async function main() {
|
|
|
19628
19654
|
break;
|
|
19629
19655
|
case "-v":
|
|
19630
19656
|
case "--version":
|
|
19631
|
-
printRaw("0.1.
|
|
19657
|
+
printRaw("0.1.27");
|
|
19632
19658
|
break;
|
|
19633
19659
|
case "-h":
|
|
19634
19660
|
case "--help":
|
package/dist/index.js
CHANGED