fleetlens 1.0.2 → 1.0.3
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/app/apps/web/.next/BUILD_ID +1 -1
- package/app/apps/web/.next/build-manifest.json +3 -3
- package/app/apps/web/.next/prerender-manifest.json +3 -3
- package/app/apps/web/.next/server/app/_global-error.html +1 -1
- package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/agent/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/events/route.js +3 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/events/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/messages/route.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/messages/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/route.js +3 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/stop/route.js +3 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/stop/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/route.js +3 -1
- package/app/apps/web/.next/server/app/api/agent/chats/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/index/route.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/mcp/route.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/mcp/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/suggestions/route.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/suggestions/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/ask/route.js +1 -1
- package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month-index/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week-index/route.js +1 -1
- package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/pdf/[key]/route.js +1 -1
- package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/projects/open-folder/route.js +1 -1
- package/app/apps/web/.next/server/app/api/projects/open-folder/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/credentials/route.js +1 -1
- package/app/apps/web/.next/server/app/api/settings/credentials/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/route.js +1 -1
- package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/team/onboarding/start/route.js +1 -1
- package/app/apps/web/.next/server/app/api/team/onboarding/start/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/team/sync-projects/route.js +1 -1
- package/app/apps/web/.next/server/app/api/team/sync-projects/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/onboarding/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__038-.1r._.js → [root-of-the-server]__0-09rjv._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0_5tf-2._.js → [root-of-the-server]__01oercw._.js} +5 -5
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__02.51sr._.js +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__057w7kr._.js +28 -0
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0pirsh0._.js → [root-of-the-server]__07b5796._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__02puo0u._.js → [root-of-the-server]__07xaqv3._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__06xto5z._.js → [root-of-the-server]__08c24et._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0mvl0qn._.js → [root-of-the-server]__08m2h38._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0mx_9mb._.js → [root-of-the-server]__0c7ght_._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__12iid50._.js → [root-of-the-server]__0l5i8nk._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__04g-b-m._.js → [root-of-the-server]__0mcer3z._.js} +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0o9lsie._.js +30 -0
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0367vbv._.js → [root-of-the-server]__0ozooam._.js} +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0uf_ch4._.js +28 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0uiom2m._.js +28 -0
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__096_llw._.js → [root-of-the-server]__0usaajs._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__06irs4z._.js → [root-of-the-server]__0zyh554._.js} +2 -2
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0gvw6dk._.js → [root-of-the-server]__0~4wgaf._.js} +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0~~bpcw._.js +3 -0
- package/app/apps/web/.next/server/chunks/{[root-of-the-server]__01~cgp8._.js → [root-of-the-server]__10.g-w1._.js} +2 -2
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__12vjv4c._.js +28 -0
- package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +19 -19
- package/app/apps/web/.next/server/chunks/ssr/_0k8yioi._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
- package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/app/apps/web/.next/server/middleware-manifest.json +5 -5
- package/app/apps/web/.next/server/pages/500.html +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next/static/chunks/0ntt~a0712~pv.js +14 -0
- package/app/apps/web/app/api/ask/route.ts +8 -2
- package/app/apps/web/lib/agent/run.ts +11 -2
- package/app/apps/web/lib/changelog-data.generated.ts +1 -1
- package/app/apps/web/package.json +1 -1
- package/app/apps/web/tsconfig.tsbuildinfo +1 -1
- package/dist/daemon-worker.js +104 -55
- package/dist/index.js +174 -113
- package/menubar/Fleetlens.app/Contents/Info.plist +2 -2
- package/menubar/Fleetlens.app/Contents/MacOS/FleetlensMenubar +0 -0
- package/package.json +1 -1
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__02faosk._.js +0 -30
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__02petpy._.js +0 -3
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__09cgmam._.js +0 -28
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0tk8p3d._.js +0 -28
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0u6pamj._.js +0 -28
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__12jomao._.js +0 -28
- package/app/apps/web/.next/static/chunks/0dqhn7-3.038l.js +0 -14
- /package/app/apps/web/.next/static/{zyhoVMC9iNC5vofPFRY6z → Shk_TH0B6lHs9cBZekkf5}/_buildManifest.js +0 -0
- /package/app/apps/web/.next/static/{zyhoVMC9iNC5vofPFRY6z → Shk_TH0B6lHs9cBZekkf5}/_clientMiddlewareManifest.js +0 -0
- /package/app/apps/web/.next/static/{zyhoVMC9iNC5vofPFRY6z → Shk_TH0B6lHs9cBZekkf5}/_ssgManifest.js +0 -0
package/dist/daemon-worker.js
CHANGED
|
@@ -6863,9 +6863,9 @@ var init_file_probe = __esm({
|
|
|
6863
6863
|
// src/pid.ts
|
|
6864
6864
|
import { readFileSync as readFileSync21, writeFileSync as writeFileSync15, mkdirSync as mkdirSync14, unlinkSync as unlinkSync5 } from "node:fs";
|
|
6865
6865
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
6866
|
-
import { dirname as
|
|
6866
|
+
import { dirname as dirname13 } from "node:path";
|
|
6867
6867
|
function writePid(filePath, pid, port, version) {
|
|
6868
|
-
mkdirSync14(
|
|
6868
|
+
mkdirSync14(dirname13(filePath), { recursive: true });
|
|
6869
6869
|
let content = String(pid);
|
|
6870
6870
|
if (port != null) {
|
|
6871
6871
|
content += `:${port}`;
|
|
@@ -6929,13 +6929,13 @@ var init_pid = __esm({
|
|
|
6929
6929
|
|
|
6930
6930
|
// src/server.ts
|
|
6931
6931
|
import { spawn as spawn3 } from "node:child_process";
|
|
6932
|
-
import { join as
|
|
6932
|
+
import { join as join14, dirname as dirname14 } from "node:path";
|
|
6933
6933
|
import { fileURLToPath } from "node:url";
|
|
6934
|
-
import { existsSync as
|
|
6935
|
-
import { homedir as
|
|
6934
|
+
import { existsSync as existsSync20, realpathSync as realpathSync3, readFileSync as readFileSync22 } from "node:fs";
|
|
6935
|
+
import { homedir as homedir7 } from "node:os";
|
|
6936
6936
|
function appDir() {
|
|
6937
|
-
const here =
|
|
6938
|
-
return
|
|
6937
|
+
const here = dirname14(fileURLToPath(import.meta.url));
|
|
6938
|
+
return join14(here, "..", "app", "apps", "web");
|
|
6939
6939
|
}
|
|
6940
6940
|
function cliBinRealPath() {
|
|
6941
6941
|
const argv1 = process.argv[1] ?? "";
|
|
@@ -6947,11 +6947,11 @@ function cliBinRealPath() {
|
|
|
6947
6947
|
}
|
|
6948
6948
|
function onDiskVersion() {
|
|
6949
6949
|
try {
|
|
6950
|
-
const here =
|
|
6951
|
-
const pkg = JSON.parse(readFileSync22(
|
|
6952
|
-
return pkg.version ?? "1.0.
|
|
6950
|
+
const here = dirname14(fileURLToPath(import.meta.url));
|
|
6951
|
+
const pkg = JSON.parse(readFileSync22(join14(here, "..", "package.json"), "utf8"));
|
|
6952
|
+
return pkg.version ?? "1.0.3";
|
|
6953
6953
|
} catch {
|
|
6954
|
-
return "1.0.
|
|
6954
|
+
return "1.0.3";
|
|
6955
6955
|
}
|
|
6956
6956
|
}
|
|
6957
6957
|
function getServerStatus() {
|
|
@@ -6964,15 +6964,15 @@ function getServerStatus() {
|
|
|
6964
6964
|
}
|
|
6965
6965
|
async function startServer(opts = {}) {
|
|
6966
6966
|
const port = opts.port ?? (parseInt(process.env.CCLENS_PORT ?? "", 10) || DEFAULT_PORT);
|
|
6967
|
-
const serverJs =
|
|
6968
|
-
if (!
|
|
6967
|
+
const serverJs = join14(appDir(), "server.js");
|
|
6968
|
+
if (!existsSync20(serverJs)) {
|
|
6969
6969
|
throw new Error(`Server not found at ${serverJs}. Reinstall with: npm install -g fleetlens`);
|
|
6970
6970
|
}
|
|
6971
6971
|
const portInUse = await checkPort(port);
|
|
6972
6972
|
if (portInUse) {
|
|
6973
6973
|
throw new Error(`Port ${port} is in use. Use --port to specify a different port.`);
|
|
6974
6974
|
}
|
|
6975
|
-
const dataDir =
|
|
6975
|
+
const dataDir = join14(homedir7(), ".claude", "projects");
|
|
6976
6976
|
const child = spawn3(process.execPath, [serverJs], {
|
|
6977
6977
|
detached: true,
|
|
6978
6978
|
stdio: "ignore",
|
|
@@ -7055,8 +7055,8 @@ var init_server = __esm({
|
|
|
7055
7055
|
|
|
7056
7056
|
// src/daemon-worker.ts
|
|
7057
7057
|
import { spawn as spawn4 } from "node:child_process";
|
|
7058
|
-
import { closeSync, existsSync as
|
|
7059
|
-
import { dirname as
|
|
7058
|
+
import { closeSync, existsSync as existsSync21, mkdirSync as mkdirSync15, openSync, readFileSync as readFileSync23, writeFileSync as writeFileSync16 } from "node:fs";
|
|
7059
|
+
import { dirname as dirname15, join as join15 } from "node:path";
|
|
7060
7060
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7061
7061
|
|
|
7062
7062
|
// src/usage/token.ts
|
|
@@ -9304,7 +9304,7 @@ function buildIngestPayload(inputs) {
|
|
|
9304
9304
|
return {
|
|
9305
9305
|
ingestId: randomUUID(),
|
|
9306
9306
|
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9307
|
-
cliVersion: "1.0.
|
|
9307
|
+
cliVersion: "1.0.3",
|
|
9308
9308
|
...richRollup || inputs.enrichedExtras || inputs.artifactSignals ? { schemaVersion: RICH_ROLLUP_SCHEMA_VERSION } : {},
|
|
9309
9309
|
...inputs.rollup ? { dailyRollup: inputs.rollup } : {},
|
|
9310
9310
|
...richRollup ? { richRollup } : {},
|
|
@@ -14577,14 +14577,56 @@ var ENRICHMENT_SYSTEM_PROMPT = SYSTEM_PROMPT;
|
|
|
14577
14577
|
// ../entries/dist/llm-runner.js
|
|
14578
14578
|
init_fs();
|
|
14579
14579
|
import { spawn as spawn2 } from "node:child_process";
|
|
14580
|
-
import { mkdirSync as mkdirSync11, appendFileSync as appendFileSync5, writeFileSync as writeFileSync12, existsSync as
|
|
14581
|
-
import { join as
|
|
14580
|
+
import { mkdirSync as mkdirSync11, appendFileSync as appendFileSync5, writeFileSync as writeFileSync12, existsSync as existsSync16 } from "node:fs";
|
|
14581
|
+
import { join as join13 } from "node:path";
|
|
14582
14582
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
14583
14583
|
|
|
14584
|
-
// ../entries/dist/
|
|
14585
|
-
import {
|
|
14586
|
-
import { join as join11 } from "node:path";
|
|
14584
|
+
// ../entries/dist/claude-bin.js
|
|
14585
|
+
import { existsSync as existsSync14 } from "node:fs";
|
|
14586
|
+
import { join as join11, dirname as dirname11, delimiter } from "node:path";
|
|
14587
14587
|
import { homedir as homedir5 } from "node:os";
|
|
14588
|
+
function resolveClaudeBin(opts = {}) {
|
|
14589
|
+
const env = opts.env ?? process.env;
|
|
14590
|
+
const home = opts.home ?? homedir5();
|
|
14591
|
+
const execPath = opts.execPath ?? process.execPath;
|
|
14592
|
+
const exists = opts.exists ?? existsSync14;
|
|
14593
|
+
for (const dir of (env.PATH ?? "").split(delimiter)) {
|
|
14594
|
+
if (!dir)
|
|
14595
|
+
continue;
|
|
14596
|
+
const onPath = join11(dir, "claude");
|
|
14597
|
+
if (exists(onPath))
|
|
14598
|
+
return onPath;
|
|
14599
|
+
}
|
|
14600
|
+
return [
|
|
14601
|
+
join11(home, ".local", "bin", "claude"),
|
|
14602
|
+
// native installer
|
|
14603
|
+
join11(home, ".claude", "local", "claude"),
|
|
14604
|
+
// legacy local install
|
|
14605
|
+
join11(dirname11(execPath), "claude"),
|
|
14606
|
+
// npm -g, beside the node running us
|
|
14607
|
+
"/opt/homebrew/bin/claude",
|
|
14608
|
+
"/usr/local/bin/claude"
|
|
14609
|
+
].find(exists);
|
|
14610
|
+
}
|
|
14611
|
+
function claudeSpawnEnv(bin, env = process.env, execPath = process.execPath) {
|
|
14612
|
+
const parts = (env.PATH ?? "").split(delimiter).filter(Boolean);
|
|
14613
|
+
for (const dir of [dirname11(execPath), dirname11(bin)]) {
|
|
14614
|
+
if (!parts.includes(dir))
|
|
14615
|
+
parts.unshift(dir);
|
|
14616
|
+
}
|
|
14617
|
+
return { ...env, PATH: parts.join(delimiter) };
|
|
14618
|
+
}
|
|
14619
|
+
var ClaudeBinNotFoundError = class extends Error {
|
|
14620
|
+
constructor() {
|
|
14621
|
+
super("claude CLI not found. Looked on PATH and in ~/.local/bin, ~/.claude/local, the npm global bin, homebrew, and /usr/local/bin. Install it, or if Fleetlens was started at login, restart it from a terminal: fleetlens stop && fleetlens start");
|
|
14622
|
+
this.name = "ClaudeBinNotFoundError";
|
|
14623
|
+
}
|
|
14624
|
+
};
|
|
14625
|
+
|
|
14626
|
+
// ../entries/dist/tmux-runner.js
|
|
14627
|
+
import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync11, existsSync as existsSync15, readdirSync as readdirSync5, realpathSync as realpathSync2, readFileSync as readFileSync17, unlinkSync as unlinkSync3, renameSync as renameSync5 } from "node:fs";
|
|
14628
|
+
import { join as join12 } from "node:path";
|
|
14629
|
+
import { homedir as homedir6 } from "node:os";
|
|
14588
14630
|
import { spawnSync } from "node:child_process";
|
|
14589
14631
|
var TmuxUnavailableError = class extends Error {
|
|
14590
14632
|
constructor(message) {
|
|
@@ -14607,18 +14649,18 @@ function which(bin) {
|
|
|
14607
14649
|
function tmuxRunnerAvailable() {
|
|
14608
14650
|
if (!which("tmux"))
|
|
14609
14651
|
return { ok: false, reason: "tmux not on PATH" };
|
|
14610
|
-
if (!
|
|
14611
|
-
return { ok: false, reason: "claude not
|
|
14652
|
+
if (!resolveClaudeBin())
|
|
14653
|
+
return { ok: false, reason: "claude CLI not found" };
|
|
14612
14654
|
return { ok: true };
|
|
14613
14655
|
}
|
|
14614
14656
|
function runtimeCwd() {
|
|
14615
|
-
const dir =
|
|
14616
|
-
if (!
|
|
14657
|
+
const dir = join12(homedir6(), ".cclens", "runtime");
|
|
14658
|
+
if (!existsSync15(dir))
|
|
14617
14659
|
mkdirSync10(dir, { recursive: true });
|
|
14618
14660
|
return realpathSync2(dir);
|
|
14619
14661
|
}
|
|
14620
14662
|
function ensureRuntimeCwdTrusted(cwd) {
|
|
14621
|
-
const cfgPath =
|
|
14663
|
+
const cfgPath = join12(homedir6(), ".claude.json");
|
|
14622
14664
|
let cfg;
|
|
14623
14665
|
try {
|
|
14624
14666
|
cfg = JSON.parse(readFileSync17(cfgPath, "utf8"));
|
|
@@ -14655,18 +14697,18 @@ async function runClaudeUnderTmuxImpl(args) {
|
|
|
14655
14697
|
const tmuxBin = args.tmuxBin ?? which("tmux");
|
|
14656
14698
|
if (!tmuxBin)
|
|
14657
14699
|
throw new TmuxUnavailableError("tmux not on PATH");
|
|
14658
|
-
const claudeBin = args.claudeBin ??
|
|
14700
|
+
const claudeBin = args.claudeBin ?? resolveClaudeBin();
|
|
14659
14701
|
if (!claudeBin)
|
|
14660
|
-
throw new TmuxUnavailableError("claude not
|
|
14702
|
+
throw new TmuxUnavailableError("claude CLI not found");
|
|
14661
14703
|
if (args.signal?.aborted)
|
|
14662
14704
|
throw new TmuxRunError("aborted before spawn");
|
|
14663
14705
|
const cwd = runtimeCwd();
|
|
14664
14706
|
ensureRuntimeCwdTrusted(cwd);
|
|
14665
14707
|
const runId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
14666
14708
|
const sessionName = `cclens-${runId}`;
|
|
14667
|
-
const systemFile =
|
|
14668
|
-
const userFile =
|
|
14669
|
-
const wrapper =
|
|
14709
|
+
const systemFile = join12(cwd, `system-${runId}.txt`);
|
|
14710
|
+
const userFile = join12(cwd, `user-${runId}.txt`);
|
|
14711
|
+
const wrapper = join12(cwd, `run-${runId}.sh`);
|
|
14670
14712
|
writeFileSync11(systemFile, args.systemPrompt);
|
|
14671
14713
|
writeFileSync11(userFile, args.reminder ? `${args.userPrompt}
|
|
14672
14714
|
|
|
@@ -14745,7 +14787,7 @@ function num(v) {
|
|
|
14745
14787
|
function sleep(ms) {
|
|
14746
14788
|
return new Promise((r) => setTimeout(r, ms));
|
|
14747
14789
|
}
|
|
14748
|
-
var PROJECTS_ROOT = () =>
|
|
14790
|
+
var PROJECTS_ROOT = () => join12(homedir6(), ".claude", "projects");
|
|
14749
14791
|
function snapshotAllTranscripts() {
|
|
14750
14792
|
const out = /* @__PURE__ */ new Set();
|
|
14751
14793
|
const root = PROJECTS_ROOT();
|
|
@@ -14756,7 +14798,7 @@ function snapshotAllTranscripts() {
|
|
|
14756
14798
|
return out;
|
|
14757
14799
|
}
|
|
14758
14800
|
for (const sub of subs) {
|
|
14759
|
-
const dir =
|
|
14801
|
+
const dir = join12(root, sub);
|
|
14760
14802
|
let files;
|
|
14761
14803
|
try {
|
|
14762
14804
|
files = readdirSync5(dir);
|
|
@@ -14765,7 +14807,7 @@ function snapshotAllTranscripts() {
|
|
|
14765
14807
|
}
|
|
14766
14808
|
for (const f of files) {
|
|
14767
14809
|
if (f.endsWith(".jsonl"))
|
|
14768
|
-
out.add(
|
|
14810
|
+
out.add(join12(dir, f));
|
|
14769
14811
|
}
|
|
14770
14812
|
}
|
|
14771
14813
|
return out;
|
|
@@ -14806,7 +14848,7 @@ async function discoverTranscript(targetCwd, existingBefore, startMs, timeoutMs,
|
|
|
14806
14848
|
subs = [];
|
|
14807
14849
|
}
|
|
14808
14850
|
for (const sub of subs) {
|
|
14809
|
-
const dir =
|
|
14851
|
+
const dir = join12(root, sub);
|
|
14810
14852
|
let files;
|
|
14811
14853
|
try {
|
|
14812
14854
|
files = readdirSync5(dir);
|
|
@@ -14816,7 +14858,7 @@ async function discoverTranscript(targetCwd, existingBefore, startMs, timeoutMs,
|
|
|
14816
14858
|
for (const f of files) {
|
|
14817
14859
|
if (!f.endsWith(".jsonl"))
|
|
14818
14860
|
continue;
|
|
14819
|
-
const full =
|
|
14861
|
+
const full = join12(dir, f);
|
|
14820
14862
|
if (existingBefore.has(full))
|
|
14821
14863
|
continue;
|
|
14822
14864
|
if (readJsonlCwd(full) === targetCwd)
|
|
@@ -14890,7 +14932,7 @@ function cleanup(cwd, runId, tmuxBin, sessionName, transcriptPath) {
|
|
|
14890
14932
|
}
|
|
14891
14933
|
for (const f of [`system-${runId}.txt`, `user-${runId}.txt`, `run-${runId}.sh`]) {
|
|
14892
14934
|
try {
|
|
14893
|
-
unlinkSync3(
|
|
14935
|
+
unlinkSync3(join12(cwd, f));
|
|
14894
14936
|
} catch {
|
|
14895
14937
|
}
|
|
14896
14938
|
}
|
|
@@ -14905,7 +14947,7 @@ function shellEscape(s) {
|
|
|
14905
14947
|
// ../entries/dist/llm-runner.js
|
|
14906
14948
|
var RUNS_DIR = cclensPath("llm-runs");
|
|
14907
14949
|
function ensureRunsDir() {
|
|
14908
|
-
if (!
|
|
14950
|
+
if (!existsSync16(RUNS_DIR)) {
|
|
14909
14951
|
try {
|
|
14910
14952
|
mkdirSync11(RUNS_DIR, { recursive: true });
|
|
14911
14953
|
} catch {
|
|
@@ -14934,7 +14976,7 @@ function newRunId(kind) {
|
|
|
14934
14976
|
return `${ts}_${kind}_${short}`;
|
|
14935
14977
|
}
|
|
14936
14978
|
function tracePath(runId) {
|
|
14937
|
-
return
|
|
14979
|
+
return join13(RUNS_DIR, `${runId}.jsonl`);
|
|
14938
14980
|
}
|
|
14939
14981
|
function safeAppend(path11, line) {
|
|
14940
14982
|
try {
|
|
@@ -15077,7 +15119,14 @@ function runClaudePrintMode(args) {
|
|
|
15077
15119
|
"--append-system-prompt",
|
|
15078
15120
|
args.systemPrompt
|
|
15079
15121
|
];
|
|
15080
|
-
const
|
|
15122
|
+
const claudeBin = resolveClaudeBin();
|
|
15123
|
+
if (!claudeBin) {
|
|
15124
|
+
const err = new ClaudeBinNotFoundError();
|
|
15125
|
+
safeAppend(trace, JSON.stringify({ _meta: { type: "spawn_error", run_id: runId, ts: (/* @__PURE__ */ new Date()).toISOString(), error: err.message } }) + "\n");
|
|
15126
|
+
reject(err);
|
|
15127
|
+
return;
|
|
15128
|
+
}
|
|
15129
|
+
const proc = spawn2(claudeBin, claudeArgs, { stdio: ["pipe", "pipe", "pipe"], env: claudeSpawnEnv(claudeBin) });
|
|
15081
15130
|
safeAppend(trace, JSON.stringify({ _meta: { type: "spawned", run_id: runId, pid: proc.pid } }) + "\n");
|
|
15082
15131
|
const stdinPayload = args.reminder ? `${args.userPrompt}
|
|
15083
15132
|
|
|
@@ -15333,8 +15382,8 @@ function applyEnrichmentError(entry, errorMessage, model, costUsd, generatedAt,
|
|
|
15333
15382
|
|
|
15334
15383
|
// ../entries/dist/budget.js
|
|
15335
15384
|
init_fs();
|
|
15336
|
-
import { appendFileSync as appendFileSync6, readFileSync as readFileSync18, existsSync as
|
|
15337
|
-
import { dirname as
|
|
15385
|
+
import { appendFileSync as appendFileSync6, readFileSync as readFileSync18, existsSync as existsSync17, mkdirSync as mkdirSync12 } from "node:fs";
|
|
15386
|
+
import { dirname as dirname12 } from "node:path";
|
|
15338
15387
|
var spendPathCached = null;
|
|
15339
15388
|
function spendPath() {
|
|
15340
15389
|
if (spendPathCached)
|
|
@@ -15344,12 +15393,12 @@ function spendPath() {
|
|
|
15344
15393
|
}
|
|
15345
15394
|
function appendSpend(record) {
|
|
15346
15395
|
const p = spendPath();
|
|
15347
|
-
mkdirSync12(
|
|
15396
|
+
mkdirSync12(dirname12(p), { recursive: true });
|
|
15348
15397
|
appendFileSync6(p, JSON.stringify(record) + "\n", { encoding: "utf8" });
|
|
15349
15398
|
}
|
|
15350
15399
|
function monthToDateSpend(now = /* @__PURE__ */ new Date()) {
|
|
15351
15400
|
const p = spendPath();
|
|
15352
|
-
if (!
|
|
15401
|
+
if (!existsSync17(p))
|
|
15353
15402
|
return 0;
|
|
15354
15403
|
const year = now.getUTCFullYear();
|
|
15355
15404
|
const month = now.getUTCMonth();
|
|
@@ -15376,7 +15425,7 @@ function monthToDateSpend(now = /* @__PURE__ */ new Date()) {
|
|
|
15376
15425
|
|
|
15377
15426
|
// ../entries/dist/pipeline-lock.js
|
|
15378
15427
|
init_fs();
|
|
15379
|
-
import { writeFileSync as writeFileSync13, unlinkSync as unlinkSync4, existsSync as
|
|
15428
|
+
import { writeFileSync as writeFileSync13, unlinkSync as unlinkSync4, existsSync as existsSync18, readFileSync as readFileSync19, statSync as statSync7 } from "node:fs";
|
|
15380
15429
|
var STALE_MS2 = 60 * 1e3;
|
|
15381
15430
|
var HEARTBEAT_MS = 30 * 1e3;
|
|
15382
15431
|
var lockPathCached = null;
|
|
@@ -15422,7 +15471,7 @@ function pidAlive(pid) {
|
|
|
15422
15471
|
}
|
|
15423
15472
|
function interactiveLockFresh(nowMs) {
|
|
15424
15473
|
const p = lockPath();
|
|
15425
|
-
if (!
|
|
15474
|
+
if (!existsSync18(p))
|
|
15426
15475
|
return false;
|
|
15427
15476
|
try {
|
|
15428
15477
|
const mtime = statSync7(p).mtimeMs;
|
|
@@ -15443,7 +15492,7 @@ function interactiveLockFresh(nowMs) {
|
|
|
15443
15492
|
var THIRTY_MIN_MS = 30 * 60 * 1e3;
|
|
15444
15493
|
|
|
15445
15494
|
// ../entries/dist/settings.js
|
|
15446
|
-
import { readFileSync as readFileSync20, writeFileSync as writeFileSync14, renameSync as renameSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync13, existsSync as
|
|
15495
|
+
import { readFileSync as readFileSync20, writeFileSync as writeFileSync14, renameSync as renameSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync13, existsSync as existsSync19 } from "node:fs";
|
|
15447
15496
|
init_fs();
|
|
15448
15497
|
var DEFAULT_SETTINGS = {
|
|
15449
15498
|
ai_features: {
|
|
@@ -15475,7 +15524,7 @@ function fromDisk(d) {
|
|
|
15475
15524
|
}
|
|
15476
15525
|
function readSettings() {
|
|
15477
15526
|
const p = settingsPath();
|
|
15478
|
-
if (!
|
|
15527
|
+
if (!existsSync19(p))
|
|
15479
15528
|
return DEFAULT_SETTINGS;
|
|
15480
15529
|
try {
|
|
15481
15530
|
const raw = readFileSync20(p, "utf8");
|
|
@@ -18238,14 +18287,14 @@ async function getUpdateAvailability() {
|
|
|
18238
18287
|
if (isDevMode()) return null;
|
|
18239
18288
|
const latest = await fetchLatestVersion();
|
|
18240
18289
|
if (latest === null) return {
|
|
18241
|
-
current: "1.0.
|
|
18290
|
+
current: "1.0.3",
|
|
18242
18291
|
latest: null,
|
|
18243
18292
|
updateAvailable: false
|
|
18244
18293
|
};
|
|
18245
18294
|
return {
|
|
18246
|
-
current: "1.0.
|
|
18295
|
+
current: "1.0.3",
|
|
18247
18296
|
latest,
|
|
18248
|
-
updateAvailable: shouldUpdate("1.0.
|
|
18297
|
+
updateAvailable: shouldUpdate("1.0.3", latest)
|
|
18249
18298
|
};
|
|
18250
18299
|
}
|
|
18251
18300
|
|
|
@@ -18297,7 +18346,7 @@ var WATCHDOG_INTERVAL_MS = 5 * 1e3;
|
|
|
18297
18346
|
var AUTO_UPDATE_INTERVAL_MS = 6 * 60 * 60 * 1e3;
|
|
18298
18347
|
var SERVER_HEALTH_INTERVAL_MS = 60 * 1e3;
|
|
18299
18348
|
var SERVER_HEALTH_TIMEOUT_MS = 10 * 1e3;
|
|
18300
|
-
mkdirSync15(
|
|
18349
|
+
mkdirSync15(dirname15(USAGE_LOG3), { recursive: true });
|
|
18301
18350
|
function log2(level, message) {
|
|
18302
18351
|
appendDaemonLogLine(level, message);
|
|
18303
18352
|
}
|
|
@@ -18357,7 +18406,7 @@ function nextUpdateCheckFromState(nowMs) {
|
|
|
18357
18406
|
}
|
|
18358
18407
|
var nextUpdateCheckAtMs = nextUpdateCheckFromState(Date.now());
|
|
18359
18408
|
function cliEntryPath() {
|
|
18360
|
-
return
|
|
18409
|
+
return join15(dirname15(fileURLToPath2(import.meta.url)), "index.js");
|
|
18361
18410
|
}
|
|
18362
18411
|
async function runDaemonUpdateCheck() {
|
|
18363
18412
|
if (process.env.FLEETLENS_DAEMON_AUTO_UPDATE === "0") {
|
|
@@ -18389,7 +18438,7 @@ async function runDaemonUpdateCheck() {
|
|
|
18389
18438
|
return;
|
|
18390
18439
|
}
|
|
18391
18440
|
const entry = cliEntryPath();
|
|
18392
|
-
if (!
|
|
18441
|
+
if (!existsSync21(entry)) {
|
|
18393
18442
|
log2("warn", `update check found ${availability.latest}, but CLI entry is missing at ${entry}`);
|
|
18394
18443
|
return;
|
|
18395
18444
|
}
|