@hasna/assistants 1.1.52 → 1.1.54

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/index.js CHANGED
@@ -616,8 +616,6 @@ async function ensureConfigDir(sessionId, baseDir) {
616
616
  const dirs = [
617
617
  mkdir2(configDir, { recursive: true }),
618
618
  mkdir2(join(configDir, "logs"), { recursive: true }),
619
- mkdir2(join(configDir, "assistants"), { recursive: true }),
620
- mkdir2(join(configDir, "migration"), { recursive: true }),
621
619
  mkdir2(join(configDir, "temp"), { recursive: true }),
622
620
  mkdir2(join(configDir, "messages"), { recursive: true }),
623
621
  mkdir2(join(configDir, "backups"), { recursive: true })
@@ -21587,14 +21585,9 @@ function initAssistantsDir(basePath) {
21587
21585
  const dirs = [
21588
21586
  baseDir,
21589
21587
  join11(baseDir, "logs"),
21590
- join11(baseDir, "assistants"),
21591
- join11(baseDir, "shared", "skills"),
21592
- join11(baseDir, "commands"),
21593
21588
  join11(baseDir, "temp"),
21594
- join11(baseDir, "heartbeats"),
21595
- join11(baseDir, "state"),
21596
- join11(baseDir, "energy"),
21597
- join11(baseDir, "migration")
21589
+ join11(baseDir, "messages"),
21590
+ join11(baseDir, "backups")
21598
21591
  ];
21599
21592
  for (const dir of dirs) {
21600
21593
  if (!existsSync8(dir)) {
@@ -22104,6 +22097,7 @@ function rowToSession(row) {
22104
22097
  suggestions: [],
22105
22098
  verificationResult: {
22106
22099
  goalsMet: result === "pass",
22100
+ goalsAnalysis: [],
22107
22101
  reason: "",
22108
22102
  suggestions: []
22109
22103
  },
@@ -89090,7 +89084,7 @@ Not a git repository or git not available.
89090
89084
  context.setProjectContext(projectContext);
89091
89085
  }
89092
89086
  }
89093
- var VERSION2 = "1.1.52";
89087
+ var VERSION2 = "1.1.54";
89094
89088
  var init_builtin = __esm(async () => {
89095
89089
  init_src2();
89096
89090
  init_context3();
@@ -94234,65 +94228,38 @@ var init_recovery = __esm(async () => {
94234
94228
  });
94235
94229
 
94236
94230
  // packages/core/src/heartbeat/finder.ts
94237
- import { existsSync as existsSync20, readdirSync as readdirSync7, readFileSync as readFileSync10 } from "fs";
94238
- import { join as join26 } from "path";
94239
94231
  function findRecoverableSessions(staleThresholdMs = 120000, maxAgeMs = 24 * 60 * 60 * 1000, baseDir) {
94240
- const configDir = baseDir ?? getConfigDir();
94241
- const heartbeatsDir = join26(configDir, "heartbeats");
94242
- const stateDir = join26(configDir, "state");
94243
- const sessionsDir = join26(configDir, "sessions");
94244
94232
  const recoverableSessions = [];
94245
- if (!existsSync20(heartbeatsDir)) {
94233
+ let db;
94234
+ try {
94235
+ db = getDatabase();
94236
+ } catch {
94246
94237
  return recoverableSessions;
94247
94238
  }
94248
94239
  const now2 = Date.now();
94249
- const heartbeatFiles = readdirSync7(heartbeatsDir).filter((f) => f.endsWith(".json"));
94250
- for (const file of heartbeatFiles) {
94251
- const sessionId = file.replace(".json", "");
94252
- const heartbeatPath = join26(heartbeatsDir, file);
94253
- const statePath = join26(stateDir, `${sessionId}.json`);
94254
- const sessionPath = join26(sessionsDir, `${sessionId}.json`);
94240
+ const cutoffIso = new Date(now2 - maxAgeMs).toISOString();
94241
+ const rows = db.query("SELECT session_id, heartbeat, context, timestamp FROM heartbeat_state WHERE timestamp > ?").all(cutoffIso);
94242
+ for (const row of rows) {
94255
94243
  try {
94256
- const heartbeatContent = readFileSync10(heartbeatPath, "utf-8");
94257
- const heartbeat = JSON.parse(heartbeatContent);
94244
+ const heartbeat = JSON.parse(row.heartbeat);
94245
+ const context = JSON.parse(row.context);
94258
94246
  const heartbeatAge = now2 - new Date(heartbeat.timestamp).getTime();
94259
94247
  if (heartbeatAge < staleThresholdMs) {
94260
94248
  continue;
94261
94249
  }
94262
- let state = null;
94263
- if (existsSync20(statePath)) {
94264
- const stateContent = readFileSync10(statePath, "utf-8");
94265
- state = JSON.parse(stateContent);
94266
- }
94267
- if (state) {
94268
- const stateAge = now2 - new Date(state.timestamp).getTime();
94269
- if (stateAge > maxAgeMs) {
94270
- continue;
94271
- }
94272
- }
94250
+ const state = {
94251
+ sessionId: row.session_id,
94252
+ heartbeat,
94253
+ context,
94254
+ timestamp: row.timestamp
94255
+ };
94273
94256
  let messageCount = 0;
94274
- let cwd = state?.context?.cwd || process.cwd();
94275
- if (existsSync20(sessionPath)) {
94276
- try {
94277
- const sessionContent = readFileSync10(sessionPath, "utf-8");
94278
- const sessionData = JSON.parse(sessionContent);
94279
- messageCount = sessionData.messages?.length || 0;
94280
- cwd = sessionData.cwd || cwd;
94281
- } catch {}
94282
- }
94283
- if (!state && messageCount === 0) {
94284
- continue;
94285
- }
94257
+ const cwd = context.cwd || process.cwd();
94286
94258
  recoverableSessions.push({
94287
- sessionId,
94259
+ sessionId: row.session_id,
94288
94260
  heartbeat,
94289
- state: state || {
94290
- sessionId,
94291
- heartbeat,
94292
- context: { cwd },
94293
- timestamp: heartbeat.timestamp
94294
- },
94295
- sessionPath,
94261
+ state,
94262
+ sessionPath: "",
94296
94263
  cwd,
94297
94264
  lastActivity: new Date(heartbeat.lastActivity || heartbeat.timestamp),
94298
94265
  messageCount
@@ -94305,23 +94272,13 @@ function findRecoverableSessions(staleThresholdMs = 120000, maxAgeMs = 24 * 60 *
94305
94272
  return recoverableSessions;
94306
94273
  }
94307
94274
  function clearRecoveryState(sessionId, baseDir) {
94308
- const configDir = baseDir ?? getConfigDir();
94309
- const heartbeatPath = join26(configDir, "heartbeats", `${sessionId}.json`);
94310
- const statePath = join26(configDir, "state", `${sessionId}.json`);
94311
- const { unlinkSync: unlinkSync3 } = __require("fs");
94312
- try {
94313
- if (existsSync20(heartbeatPath)) {
94314
- unlinkSync3(heartbeatPath);
94315
- }
94316
- } catch {}
94317
94275
  try {
94318
- if (existsSync20(statePath)) {
94319
- unlinkSync3(statePath);
94320
- }
94276
+ const db = getDatabase();
94277
+ db.prepare("DELETE FROM heartbeat_state WHERE session_id = ?").run(sessionId);
94321
94278
  } catch {}
94322
94279
  }
94323
94280
  var init_finder = __esm(async () => {
94324
- await init_config();
94281
+ await init_database();
94325
94282
  });
94326
94283
 
94327
94284
  // packages/core/src/heartbeat/conventions.ts
@@ -94444,12 +94401,12 @@ var init_watchdog = __esm(async () => {
94444
94401
  });
94445
94402
 
94446
94403
  // packages/core/src/heartbeat/install-skills.ts
94447
- import { join as join27 } from "path";
94404
+ import { join as join26 } from "path";
94448
94405
  import { homedir as homedir16 } from "os";
94449
94406
  async function writeSkillIfNeeded(dir, skillName, content) {
94450
94407
  const { mkdir: mkdir7, writeFile: writeFile5, readFile: readFile6 } = await import("fs/promises");
94451
- const skillDir = join27(dir, `skill-${skillName}`);
94452
- const skillFile = join27(skillDir, "SKILL.md");
94408
+ const skillDir = join26(dir, `skill-${skillName}`);
94409
+ const skillFile = join26(skillDir, "SKILL.md");
94453
94410
  await mkdir7(skillDir, { recursive: true });
94454
94411
  try {
94455
94412
  const existing = await readFile6(skillFile, "utf-8");
@@ -94468,8 +94425,8 @@ async function writeSkillIfNeeded(dir, skillName, content) {
94468
94425
  }
94469
94426
  }
94470
94427
  async function installHeartbeatSkills() {
94471
- const baseDir = process.env.ASSISTANTS_DIR || join27(homedir16(), ".assistants");
94472
- const sharedSkillsDir = join27(baseDir, "shared", "skills");
94428
+ const baseDir = process.env.ASSISTANTS_DIR || join26(homedir16(), ".assistants");
94429
+ const sharedSkillsDir = join26(baseDir, "shared", "skills");
94473
94430
  const installed = [];
94474
94431
  const results = await Promise.all([
94475
94432
  writeSkillIfNeeded(sharedSkillsDir, "main-loop", MAIN_LOOP_SKILL),
@@ -94830,8 +94787,8 @@ var init_llm_response = __esm(() => {
94830
94787
  // packages/core/src/voice/tts.ts
94831
94788
  import { spawnSync as spawnSync2 } from "child_process";
94832
94789
  import { tmpdir as tmpdir2 } from "os";
94833
- import { join as join28 } from "path";
94834
- import { readFileSync as readFileSync11, unlinkSync as unlinkSync3 } from "fs";
94790
+ import { join as join27 } from "path";
94791
+ import { readFileSync as readFileSync10, unlinkSync as unlinkSync3 } from "fs";
94835
94792
 
94836
94793
  class ElevenLabsTTS {
94837
94794
  apiKey;
@@ -94935,7 +94892,7 @@ class SystemTTS {
94935
94892
  if (!say) {
94936
94893
  throw new Error('System TTS not available: missing "say" command.');
94937
94894
  }
94938
- const output = join28(tmpdir2(), `assistants-tts-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.aiff`);
94895
+ const output = join27(tmpdir2(), `assistants-tts-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.aiff`);
94939
94896
  const args = [];
94940
94897
  if (this.voiceId) {
94941
94898
  args.push("-v", this.voiceId);
@@ -94948,7 +94905,7 @@ class SystemTTS {
94948
94905
  if (result.status !== 0) {
94949
94906
  throw new Error(`System TTS failed: ${result.stderr || "unknown error"}`);
94950
94907
  }
94951
- const audio = readFileSync11(output);
94908
+ const audio = readFileSync10(output);
94952
94909
  unlinkSync3(output);
94953
94910
  return {
94954
94911
  audio: audio.buffer.slice(audio.byteOffset, audio.byteOffset + audio.byteLength),
@@ -94957,7 +94914,7 @@ class SystemTTS {
94957
94914
  }
94958
94915
  const espeak = findExecutable("espeak") || findExecutable("espeak-ng");
94959
94916
  if (espeak) {
94960
- const output = join28(tmpdir2(), `assistants-tts-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.wav`);
94917
+ const output = join27(tmpdir2(), `assistants-tts-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.wav`);
94961
94918
  const args = ["-w", output];
94962
94919
  if (this.voiceId) {
94963
94920
  args.push("-v", this.voiceId);
@@ -94970,7 +94927,7 @@ class SystemTTS {
94970
94927
  if (result.status !== 0) {
94971
94928
  throw new Error(`System TTS failed: ${result.stderr || "unknown error"}`);
94972
94929
  }
94973
- const audio = readFileSync11(output);
94930
+ const audio = readFileSync10(output);
94974
94931
  unlinkSync3(output);
94975
94932
  return {
94976
94933
  audio: audio.buffer.slice(audio.byteOffset, audio.byteOffset + audio.byteLength),
@@ -94987,7 +94944,7 @@ var init_tts = __esm(() => {
94987
94944
  // packages/core/src/voice/player.ts
94988
94945
  import { spawn as spawn2 } from "child_process";
94989
94946
  import { tmpdir as tmpdir3 } from "os";
94990
- import { join as join29 } from "path";
94947
+ import { join as join28 } from "path";
94991
94948
  import { unlink as unlink2, writeFileSync as writeFileSync10, appendFileSync as appendFileSync3 } from "fs";
94992
94949
 
94993
94950
  class AudioPlayer {
@@ -94995,7 +94952,7 @@ class AudioPlayer {
94995
94952
  playing = false;
94996
94953
  async play(audio, options = {}) {
94997
94954
  const format = options.format ?? "mp3";
94998
- const tempFile = join29(tmpdir3(), `assistants-audio-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.${format}`);
94955
+ const tempFile = join28(tmpdir3(), `assistants-audio-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.${format}`);
94999
94956
  writeFileSync10(tempFile, Buffer.from(audio));
95000
94957
  const player = this.resolvePlayer(format);
95001
94958
  if (!player) {
@@ -95023,7 +94980,7 @@ class AudioPlayer {
95023
94980
  }
95024
94981
  async playStream(chunks, options = {}) {
95025
94982
  const format = options.format ?? "mp3";
95026
- const tempFile = join29(tmpdir3(), `assistants-stream-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.${format}`);
94983
+ const tempFile = join28(tmpdir3(), `assistants-stream-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.${format}`);
95027
94984
  writeFileSync10(tempFile, Buffer.alloc(0));
95028
94985
  for await (const chunk of chunks) {
95029
94986
  appendFileSync3(tempFile, Buffer.from(chunk));
@@ -95092,8 +95049,8 @@ var init_player = __esm(() => {
95092
95049
  // packages/core/src/voice/recorder.ts
95093
95050
  import { spawn as spawn3 } from "child_process";
95094
95051
  import { tmpdir as tmpdir4 } from "os";
95095
- import { join as join30 } from "path";
95096
- import { readFileSync as readFileSync12, existsSync as existsSync21, unlink as unlink3 } from "fs";
95052
+ import { join as join29 } from "path";
95053
+ import { readFileSync as readFileSync11, existsSync as existsSync20, unlink as unlink3 } from "fs";
95097
95054
 
95098
95055
  class AudioRecorder {
95099
95056
  currentProcess = null;
@@ -95106,7 +95063,7 @@ class AudioRecorder {
95106
95063
  const duration = options.durationSeconds ?? 5;
95107
95064
  const sampleRate = options.sampleRate ?? 16000;
95108
95065
  const channels = options.channels ?? 1;
95109
- const output = join30(tmpdir4(), `assistants-record-${Date.now()}.wav`);
95066
+ const output = join29(tmpdir4(), `assistants-record-${Date.now()}.wav`);
95110
95067
  this.currentOutputPath = output;
95111
95068
  this.stoppedIntentionally = false;
95112
95069
  const recorder = this.resolveRecorder(sampleRate, channels, duration, output);
@@ -95128,11 +95085,11 @@ class AudioRecorder {
95128
95085
  reject(error3);
95129
95086
  });
95130
95087
  });
95131
- if (!existsSync21(output)) {
95088
+ if (!existsSync20(output)) {
95132
95089
  this.currentOutputPath = null;
95133
95090
  return new ArrayBuffer(0);
95134
95091
  }
95135
- const data = readFileSync12(output);
95092
+ const data = readFileSync11(output);
95136
95093
  unlink3(output, () => {});
95137
95094
  this.currentOutputPath = null;
95138
95095
  return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
@@ -95144,7 +95101,7 @@ class AudioRecorder {
95144
95101
  const sampleRate = options.sampleRate ?? 16000;
95145
95102
  const channels = options.channels ?? 1;
95146
95103
  const maxDuration = options.durationSeconds ?? 30;
95147
- const output = join30(tmpdir4(), `assistants-record-${Date.now()}.wav`);
95104
+ const output = join29(tmpdir4(), `assistants-record-${Date.now()}.wav`);
95148
95105
  this.currentOutputPath = output;
95149
95106
  this.stoppedIntentionally = false;
95150
95107
  const recorder = this.resolveVadRecorder(sampleRate, channels, maxDuration, output);
@@ -95166,11 +95123,11 @@ class AudioRecorder {
95166
95123
  reject(error3);
95167
95124
  });
95168
95125
  });
95169
- if (!existsSync21(output)) {
95126
+ if (!existsSync20(output)) {
95170
95127
  this.currentOutputPath = null;
95171
95128
  return new ArrayBuffer(0);
95172
95129
  }
95173
- const data = readFileSync12(output);
95130
+ const data = readFileSync11(output);
95174
95131
  unlink3(output, () => {});
95175
95132
  this.currentOutputPath = null;
95176
95133
  return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
@@ -95554,9 +95511,9 @@ var init_manager4 = __esm(() => {
95554
95511
  init_recorder();
95555
95512
  });
95556
95513
  // packages/core/src/identity/identity-manager.ts
95557
- import { existsSync as existsSync22 } from "fs";
95514
+ import { existsSync as existsSync21 } from "fs";
95558
95515
  import { mkdir as mkdir7, readFile as readFile6, writeFile as writeFile5, rm as rm2 } from "fs/promises";
95559
- import { join as join31 } from "path";
95516
+ import { join as join30 } from "path";
95560
95517
  function isValidId3(id) {
95561
95518
  return typeof id === "string" && id.length > 0 && SAFE_ID_PATTERN4.test(id);
95562
95519
  }
@@ -95577,20 +95534,20 @@ class IdentityManager {
95577
95534
  this.basePath = basePath;
95578
95535
  }
95579
95536
  get identitiesRoot() {
95580
- return join31(this.basePath, "assistants", this.assistantId, "identities");
95537
+ return join30(this.basePath, "assistants", this.assistantId, "identities");
95581
95538
  }
95582
95539
  get indexPath() {
95583
- return join31(this.identitiesRoot, "index.json");
95540
+ return join30(this.identitiesRoot, "index.json");
95584
95541
  }
95585
95542
  get activePath() {
95586
- return join31(this.identitiesRoot, "active.json");
95543
+ return join30(this.identitiesRoot, "active.json");
95587
95544
  }
95588
95545
  identityPath(id) {
95589
95546
  validateId(id, "identityId");
95590
- return join31(this.identitiesRoot, `${id}.json`);
95547
+ return join30(this.identitiesRoot, `${id}.json`);
95591
95548
  }
95592
95549
  assistantConfigPath() {
95593
- return join31(this.basePath, "assistants", this.assistantId, "config.json");
95550
+ return join30(this.basePath, "assistants", this.assistantId, "config.json");
95594
95551
  }
95595
95552
  async initialize() {
95596
95553
  await mkdir7(this.identitiesRoot, { recursive: true });
@@ -95716,7 +95673,7 @@ class IdentityManager {
95716
95673
  `);
95717
95674
  }
95718
95675
  async readIndex() {
95719
- if (!existsSync22(this.indexPath)) {
95676
+ if (!existsSync21(this.indexPath)) {
95720
95677
  return { identities: [] };
95721
95678
  }
95722
95679
  try {
@@ -95742,7 +95699,7 @@ class IdentityManager {
95742
95699
  }
95743
95700
  async readIdentity(id) {
95744
95701
  const path3 = this.identityPath(id);
95745
- if (!existsSync22(path3))
95702
+ if (!existsSync21(path3))
95746
95703
  return null;
95747
95704
  try {
95748
95705
  const raw = await readFile6(path3, "utf-8");
@@ -95756,7 +95713,7 @@ class IdentityManager {
95756
95713
  await writeFile5(this.identityPath(identity.id), JSON.stringify(identity, null, 2));
95757
95714
  }
95758
95715
  async readActive() {
95759
- if (!existsSync22(this.activePath))
95716
+ if (!existsSync21(this.activePath))
95760
95717
  return null;
95761
95718
  try {
95762
95719
  const raw = await readFile6(this.activePath, "utf-8");
@@ -95775,7 +95732,7 @@ class IdentityManager {
95775
95732
  await writeFile5(this.activePath, JSON.stringify({ id }, null, 2));
95776
95733
  }
95777
95734
  async loadAssistant() {
95778
- if (!existsSync22(this.assistantConfigPath()))
95735
+ if (!existsSync21(this.assistantConfigPath()))
95779
95736
  return null;
95780
95737
  try {
95781
95738
  const raw = await readFile6(this.assistantConfigPath(), "utf-8");
@@ -123477,7 +123434,7 @@ var require_signin = __commonJS((exports) => {
123477
123434
  import { createHash as createHash4, createPrivateKey, createPublicKey, sign } from "crypto";
123478
123435
  import { promises as fs2 } from "fs";
123479
123436
  import { homedir as homedir17 } from "os";
123480
- import { dirname as dirname13, join as join32 } from "path";
123437
+ import { dirname as dirname13, join as join31 } from "path";
123481
123438
  var import_property_provider18, import_protocol_http11, import_shared_ini_file_loader6, LoginCredentialsFetcher;
123482
123439
  var init_LoginCredentialsFetcher = __esm(() => {
123483
123440
  import_property_provider18 = __toESM(require_dist_cjs17(), 1);
@@ -123637,10 +123594,10 @@ var init_LoginCredentialsFetcher = __esm(() => {
123637
123594
  await fs2.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
123638
123595
  }
123639
123596
  getTokenFilePath() {
123640
- const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join32(homedir17(), ".aws", "login", "cache");
123597
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join31(homedir17(), ".aws", "login", "cache");
123641
123598
  const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
123642
123599
  const loginSessionSha256 = createHash4("sha256").update(loginSessionBytes).digest("hex");
123643
- return join32(directory, `${loginSessionSha256}.json`);
123600
+ return join31(directory, `${loginSessionSha256}.json`);
123644
123601
  }
123645
123602
  derToRawSignature(derSignature) {
123646
123603
  let offset = 2;
@@ -123946,7 +123903,7 @@ var fromWebToken = (init) => async (awsIdentityProperties) => {
123946
123903
  };
123947
123904
 
123948
123905
  // node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.972.5/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
123949
- import { readFileSync as readFileSync13 } from "fs";
123906
+ import { readFileSync as readFileSync12 } from "fs";
123950
123907
  var import_client17, import_property_provider21, import_shared_ini_file_loader10, ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE", ENV_ROLE_ARN = "AWS_ROLE_ARN", ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME", fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
123951
123908
  init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
123952
123909
  const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
@@ -123959,7 +123916,7 @@ var import_client17, import_property_provider21, import_shared_ini_file_loader10
123959
123916
  }
123960
123917
  const credentials = await fromWebToken({
123961
123918
  ...init,
123962
- webIdentityToken: import_shared_ini_file_loader10.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync13(webIdentityTokenFile, { encoding: "ascii" }),
123919
+ webIdentityToken: import_shared_ini_file_loader10.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync12(webIdentityTokenFile, { encoding: "ascii" }),
123963
123920
  roleArn,
123964
123921
  roleSessionName
123965
123922
  })(awsIdentityProperties);
@@ -128295,7 +128252,7 @@ var init_s3_client = __esm(() => {
128295
128252
  });
128296
128253
 
128297
128254
  // packages/core/src/inbox/storage/local-cache.ts
128298
- import { join as join33, basename as basename6 } from "path";
128255
+ import { join as join32, basename as basename6 } from "path";
128299
128256
  import { mkdir as mkdir8, readFile as readFile8, writeFile as writeFile7, rm as rm3, readdir, stat as stat4 } from "fs/promises";
128300
128257
  import { createHash as createHash5 } from "crypto";
128301
128258
  function isValidAssistantId(id) {
@@ -128336,15 +128293,15 @@ class LocalInboxCache {
128336
128293
  validateAssistantId(options.assistantId);
128337
128294
  this.assistantId = options.assistantId;
128338
128295
  this.basePath = options.basePath;
128339
- this.cacheDir = join33(this.basePath, this.assistantId);
128296
+ this.cacheDir = join32(this.basePath, this.assistantId);
128340
128297
  this.injectedDb = options.db;
128341
128298
  }
128342
128299
  db() {
128343
128300
  return getDb12(this.injectedDb);
128344
128301
  }
128345
128302
  async ensureDirectories() {
128346
- await mkdir8(join33(this.cacheDir, "emails"), { recursive: true });
128347
- await mkdir8(join33(this.cacheDir, "attachments"), { recursive: true });
128303
+ await mkdir8(join32(this.cacheDir, "emails"), { recursive: true });
128304
+ await mkdir8(join32(this.cacheDir, "attachments"), { recursive: true });
128348
128305
  }
128349
128306
  async loadIndex() {
128350
128307
  const rows = this.db().query("SELECT * FROM inbox_cache WHERE assistant_id = ? ORDER BY date DESC").all(this.assistantId);
@@ -128372,7 +128329,7 @@ class LocalInboxCache {
128372
128329
  throw new Error(`Failed to create safe filename for email ID: "${email.id}"`);
128373
128330
  }
128374
128331
  await this.ensureDirectories();
128375
- const emailPath = join33(this.cacheDir, "emails", `${filename}.json`);
128332
+ const emailPath = join32(this.cacheDir, "emails", `${filename}.json`);
128376
128333
  await writeFile7(emailPath, JSON.stringify(email, null, 2));
128377
128334
  const existing = this.db().query("SELECT * FROM inbox_cache WHERE id = ? AND assistant_id = ?").get(email.id, this.assistantId);
128378
128335
  if (existing) {
@@ -128391,7 +128348,7 @@ class LocalInboxCache {
128391
128348
  if (!isValidMappedFilename(filename))
128392
128349
  return null;
128393
128350
  try {
128394
- const emailPath = join33(this.cacheDir, "emails", `${filename}.json`);
128351
+ const emailPath = join32(this.cacheDir, "emails", `${filename}.json`);
128395
128352
  const content = await readFile8(emailPath, "utf-8");
128396
128353
  return JSON.parse(content);
128397
128354
  } catch {
@@ -128443,9 +128400,9 @@ class LocalInboxCache {
128443
128400
  if (!safeFilename) {
128444
128401
  throw new Error("Invalid attachment filename");
128445
128402
  }
128446
- const attachmentDir = join33(this.cacheDir, "attachments", emailFilename);
128403
+ const attachmentDir = join32(this.cacheDir, "attachments", emailFilename);
128447
128404
  await mkdir8(attachmentDir, { recursive: true });
128448
- const attachmentPath = join33(attachmentDir, safeFilename);
128405
+ const attachmentPath = join32(attachmentDir, safeFilename);
128449
128406
  await writeFile7(attachmentPath, content);
128450
128407
  return attachmentPath;
128451
128408
  }
@@ -128459,7 +128416,7 @@ class LocalInboxCache {
128459
128416
  return null;
128460
128417
  }
128461
128418
  try {
128462
- const attachmentPath = join33(this.cacheDir, "attachments", emailFilename, safeFilename);
128419
+ const attachmentPath = join32(this.cacheDir, "attachments", emailFilename, safeFilename);
128463
128420
  await stat4(attachmentPath);
128464
128421
  return attachmentPath;
128465
128422
  } catch {
@@ -128482,10 +128439,10 @@ class LocalInboxCache {
128482
128439
  const filename = row.filename || emailIdToFilename(row.id);
128483
128440
  if (isValidMappedFilename(filename)) {
128484
128441
  try {
128485
- await rm3(join33(this.cacheDir, "emails", `${filename}.json`));
128442
+ await rm3(join32(this.cacheDir, "emails", `${filename}.json`));
128486
128443
  } catch {}
128487
128444
  try {
128488
- await rm3(join33(this.cacheDir, "attachments", filename), { recursive: true });
128445
+ await rm3(join32(this.cacheDir, "attachments", filename), { recursive: true });
128489
128446
  } catch {}
128490
128447
  }
128491
128448
  }
@@ -128497,20 +128454,20 @@ class LocalInboxCache {
128497
128454
  async getCacheSize() {
128498
128455
  let totalSize = 0;
128499
128456
  try {
128500
- const emailsDir = join33(this.cacheDir, "emails");
128457
+ const emailsDir = join32(this.cacheDir, "emails");
128501
128458
  const files = await readdir(emailsDir);
128502
128459
  for (const file of files) {
128503
- const fileStat = await stat4(join33(emailsDir, file));
128460
+ const fileStat = await stat4(join32(emailsDir, file));
128504
128461
  totalSize += fileStat.size;
128505
128462
  }
128506
128463
  } catch {}
128507
128464
  try {
128508
- const attachmentsDir = join33(this.cacheDir, "attachments");
128465
+ const attachmentsDir = join32(this.cacheDir, "attachments");
128509
128466
  const dirs = await readdir(attachmentsDir);
128510
128467
  for (const dir of dirs) {
128511
- const files = await readdir(join33(attachmentsDir, dir));
128468
+ const files = await readdir(join32(attachmentsDir, dir));
128512
128469
  for (const file of files) {
128513
- const fileStat = await stat4(join33(attachmentsDir, dir, file));
128470
+ const fileStat = await stat4(join32(attachmentsDir, dir, file));
128514
128471
  totalSize += fileStat.size;
128515
128472
  }
128516
128473
  }
@@ -146747,8 +146704,8 @@ function many(p4) {
146747
146704
  function many1(p4) {
146748
146705
  return ab2(p4, many(p4), (head, tail) => [head, ...tail]);
146749
146706
  }
146750
- function ab2(pa, pb, join34) {
146751
- return (data, i4) => mapOuter(pa(data, i4), (ma) => mapInner(pb(data, ma.position), (vb, j4) => join34(ma.value, vb, data, i4, j4)));
146707
+ function ab2(pa, pb, join33) {
146708
+ return (data, i4) => mapOuter(pa(data, i4), (ma) => mapInner(pb(data, ma.position), (vb, j4) => join33(ma.value, vb, data, i4, j4)));
146752
146709
  }
146753
146710
  function left(pa, pb) {
146754
146711
  return ab2(pa, pb, (va) => va);
@@ -146756,8 +146713,8 @@ function left(pa, pb) {
146756
146713
  function right(pa, pb) {
146757
146714
  return ab2(pa, pb, (va, vb) => vb);
146758
146715
  }
146759
- function abc(pa, pb, pc, join34) {
146760
- return (data, i4) => mapOuter(pa(data, i4), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j4) => join34(ma.value, mb.value, vc, data, i4, j4))));
146716
+ function abc(pa, pb, pc, join33) {
146717
+ return (data, i4) => mapOuter(pa(data, i4), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j4) => join33(ma.value, mb.value, vc, data, i4, j4))));
146761
146718
  }
146762
146719
  function middle(pa, pb, pc) {
146763
146720
  return abc(pa, pb, pc, (ra, rb) => rb);
@@ -170344,7 +170301,7 @@ var init_providers = __esm(() => {
170344
170301
  });
170345
170302
 
170346
170303
  // packages/core/src/inbox/inbox-manager.ts
170347
- import { join as join34 } from "path";
170304
+ import { join as join33 } from "path";
170348
170305
 
170349
170306
  class InboxManager {
170350
170307
  assistantId;
@@ -170518,7 +170475,7 @@ class InboxManager {
170518
170475
  }
170519
170476
  }
170520
170477
  function createInboxManager(assistantId, assistantName, config, configDir) {
170521
- const basePath = join34(configDir, "messages");
170478
+ const basePath = join33(configDir, "messages");
170522
170479
  return new InboxManager({
170523
170480
  assistantId,
170524
170481
  assistantName,
@@ -174542,8 +174499,8 @@ var init_local_storage = __esm(async () => {
174542
174499
  });
174543
174500
 
174544
174501
  // packages/core/src/messages/watcher.ts
174545
- import { watch, existsSync as existsSync23, readdirSync as readdirSync8 } from "fs";
174546
- import { join as join35 } from "path";
174502
+ import { watch, existsSync as existsSync22, readdirSync as readdirSync7 } from "fs";
174503
+ import { join as join34 } from "path";
174547
174504
 
174548
174505
  class InboxWatcher {
174549
174506
  assistantId;
@@ -174555,14 +174512,14 @@ class InboxWatcher {
174555
174512
  constructor(assistantId, basePath) {
174556
174513
  this.assistantId = assistantId;
174557
174514
  const base = basePath || getMessagesBasePath();
174558
- this.inboxPath = join35(base, assistantId, "messages");
174515
+ this.inboxPath = join34(base, assistantId, "messages");
174559
174516
  }
174560
174517
  start() {
174561
174518
  if (this.running)
174562
174519
  return;
174563
174520
  this.running = true;
174564
174521
  this.snapshotExisting();
174565
- if (!existsSync23(this.inboxPath)) {
174522
+ if (!existsSync22(this.inboxPath)) {
174566
174523
  this.pollForDirectory();
174567
174524
  return;
174568
174525
  }
@@ -174587,8 +174544,8 @@ class InboxWatcher {
174587
174544
  }
174588
174545
  snapshotExisting() {
174589
174546
  try {
174590
- if (existsSync23(this.inboxPath)) {
174591
- const files = readdirSync8(this.inboxPath);
174547
+ if (existsSync22(this.inboxPath)) {
174548
+ const files = readdirSync7(this.inboxPath);
174592
174549
  for (const file of files) {
174593
174550
  if (file.endsWith(".json")) {
174594
174551
  this.knownFiles.add(file);
@@ -174630,7 +174587,7 @@ class InboxWatcher {
174630
174587
  clearInterval(interval);
174631
174588
  return;
174632
174589
  }
174633
- if (existsSync23(this.inboxPath)) {
174590
+ if (existsSync22(this.inboxPath)) {
174634
174591
  clearInterval(interval);
174635
174592
  this.snapshotExisting();
174636
174593
  this.startWatching();
@@ -175532,8 +175489,8 @@ var init_local_storage2 = __esm(async () => {
175532
175489
  });
175533
175490
 
175534
175491
  // packages/core/src/webhooks/watcher.ts
175535
- import { watch as watch2, existsSync as existsSync24, readdirSync as readdirSync9 } from "fs";
175536
- import { join as join36 } from "path";
175492
+ import { watch as watch2, existsSync as existsSync23, readdirSync as readdirSync8 } from "fs";
175493
+ import { join as join35 } from "path";
175537
175494
 
175538
175495
  class WebhookEventWatcher {
175539
175496
  basePath;
@@ -175545,13 +175502,13 @@ class WebhookEventWatcher {
175545
175502
  directoryWatcher = null;
175546
175503
  constructor(basePath) {
175547
175504
  this.basePath = basePath || getWebhooksBasePath();
175548
- this.eventsPath = join36(this.basePath, "events");
175505
+ this.eventsPath = join35(this.basePath, "events");
175549
175506
  }
175550
175507
  start() {
175551
175508
  if (this.running)
175552
175509
  return;
175553
175510
  this.running = true;
175554
- if (!existsSync24(this.eventsPath)) {
175511
+ if (!existsSync23(this.eventsPath)) {
175555
175512
  this.pollForDirectory();
175556
175513
  return;
175557
175514
  }
@@ -175584,8 +175541,8 @@ class WebhookEventWatcher {
175584
175541
  this.directoryWatcher = watch2(this.eventsPath, (eventType, filename) => {
175585
175542
  if (!filename || eventType !== "rename")
175586
175543
  return;
175587
- const dirPath = join36(this.eventsPath, filename);
175588
- if (existsSync24(dirPath) && !this.watchers.has(filename)) {
175544
+ const dirPath = join35(this.eventsPath, filename);
175545
+ if (existsSync23(dirPath) && !this.watchers.has(filename)) {
175589
175546
  this.watchWebhookDir(filename);
175590
175547
  }
175591
175548
  });
@@ -175601,7 +175558,7 @@ class WebhookEventWatcher {
175601
175558
  });
175602
175559
  } catch {}
175603
175560
  try {
175604
- const dirs = readdirSync9(this.eventsPath);
175561
+ const dirs = readdirSync8(this.eventsPath);
175605
175562
  for (const dir of dirs) {
175606
175563
  this.watchWebhookDir(dir);
175607
175564
  }
@@ -175610,12 +175567,12 @@ class WebhookEventWatcher {
175610
175567
  watchWebhookDir(webhookId) {
175611
175568
  if (this.watchers.has(webhookId))
175612
175569
  return;
175613
- const dirPath = join36(this.eventsPath, webhookId);
175614
- if (!existsSync24(dirPath))
175570
+ const dirPath = join35(this.eventsPath, webhookId);
175571
+ if (!existsSync23(dirPath))
175615
175572
  return;
175616
175573
  const known = new Set;
175617
175574
  try {
175618
- const files = readdirSync9(dirPath);
175575
+ const files = readdirSync8(dirPath);
175619
175576
  for (const file of files) {
175620
175577
  if (file.endsWith(".json") && file !== "index.json") {
175621
175578
  known.add(file);
@@ -175655,7 +175612,7 @@ class WebhookEventWatcher {
175655
175612
  clearInterval(interval);
175656
175613
  return;
175657
175614
  }
175658
- if (existsSync24(this.eventsPath)) {
175615
+ if (existsSync23(this.eventsPath)) {
175659
175616
  clearInterval(interval);
175660
175617
  this.startWatchingAll();
175661
175618
  }
@@ -176977,15 +176934,15 @@ import { spawn as spawn4 } from "child_process";
176977
176934
  import { createInterface } from "readline";
176978
176935
  import * as fs4 from "fs";
176979
176936
  import { stat as statPromise, open as open2 } from "fs/promises";
176980
- import { join as join37 } from "path";
176937
+ import { join as join36 } from "path";
176981
176938
  import { homedir as homedir18 } from "os";
176982
176939
  import { dirname as dirname14, join as join210 } from "path";
176983
176940
  import { cwd } from "process";
176984
176941
  import { realpathSync as realpathSync2 } from "fs";
176985
176942
  import { randomUUID as randomUUID2 } from "crypto";
176986
176943
  import { randomUUID as randomUUID22 } from "crypto";
176987
- import { appendFileSync as appendFileSync22, existsSync as existsSync26, mkdirSync as mkdirSync22 } from "fs";
176988
- import { join as join38 } from "path";
176944
+ import { appendFileSync as appendFileSync22, existsSync as existsSync25, mkdirSync as mkdirSync22 } from "fs";
176945
+ import { join as join37 } from "path";
176989
176946
  import { randomUUID as randomUUID3 } from "crypto";
176990
176947
  import { join as join42 } from "path";
176991
176948
  import { fileURLToPath } from "url";
@@ -177262,7 +177219,7 @@ function shouldShowDebugMessage(message, filter) {
177262
177219
  return shouldShowDebugCategories(categories, filter);
177263
177220
  }
177264
177221
  function getClaudeConfigHomeDir() {
177265
- return process.env.CLAUDE_CONFIG_DIR ?? join37(homedir18(), ".claude");
177222
+ return process.env.CLAUDE_CONFIG_DIR ?? join36(homedir18(), ".claude");
177266
177223
  }
177267
177224
  function isEnvTruthy(envVar) {
177268
177225
  if (!envVar)
@@ -177539,9 +177496,9 @@ function getOrCreateDebugFile() {
177539
177496
  if (!process.env.DEBUG_CLAUDE_AGENT_SDK) {
177540
177497
  return null;
177541
177498
  }
177542
- const debugDir = join38(getClaudeConfigHomeDir(), "debug");
177543
- debugFilePath = join38(debugDir, `sdk-${randomUUID22()}.txt`);
177544
- if (!existsSync26(debugDir)) {
177499
+ const debugDir = join37(getClaudeConfigHomeDir(), "debug");
177500
+ debugFilePath = join37(debugDir, `sdk-${randomUUID22()}.txt`);
177501
+ if (!existsSync25(debugDir)) {
177545
177502
  mkdirSync22(debugDir, { recursive: true });
177546
177503
  }
177547
177504
  process.stderr.write(`SDK debug logs: ${debugFilePath}
@@ -206205,7 +206162,7 @@ function createSelfAwarenessToolExecutors(context) {
206205
206162
  workspace_map: async (input) => {
206206
206163
  const { readdir: readdir2, stat: stat5, access } = await import("fs/promises");
206207
206164
  const { execSync } = await import("child_process");
206208
- const { join: join39, basename: basename7 } = await import("path");
206165
+ const { join: join38, basename: basename7 } = await import("path");
206209
206166
  const depth = input.depth ?? 3;
206210
206167
  const includeGitStatus = input.include_git_status !== false;
206211
206168
  const includeRecentFiles = input.include_recent_files !== false;
@@ -206251,7 +206208,7 @@ function createSelfAwarenessToolExecutors(context) {
206251
206208
  break;
206252
206209
  }
206253
206210
  if (entry.isDirectory()) {
206254
- const children2 = await buildTree(join39(dir, entry.name), currentDepth + 1);
206211
+ const children2 = await buildTree(join38(dir, entry.name), currentDepth + 1);
206255
206212
  nodes.push({
206256
206213
  name: entry.name,
206257
206214
  type: "directory",
@@ -206277,7 +206234,7 @@ function createSelfAwarenessToolExecutors(context) {
206277
206234
  };
206278
206235
  if (includeGitStatus) {
206279
206236
  try {
206280
- await access(join39(cwd2, ".git"));
206237
+ await access(join38(cwd2, ".git"));
206281
206238
  gitStatus.isRepo = true;
206282
206239
  try {
206283
206240
  const branch = execSync("git branch --show-current", { cwd: cwd2, encoding: "utf-8" }).trim();
@@ -206308,7 +206265,7 @@ function createSelfAwarenessToolExecutors(context) {
206308
206265
  for (const entry of entries) {
206309
206266
  if (shouldIgnore(entry.name))
206310
206267
  continue;
206311
- const fullPath = join39(dir, entry.name);
206268
+ const fullPath = join38(dir, entry.name);
206312
206269
  const relPath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
206313
206270
  if (entry.isFile()) {
206314
206271
  try {
@@ -206342,12 +206299,12 @@ function createSelfAwarenessToolExecutors(context) {
206342
206299
  let projectName = basename7(cwd2);
206343
206300
  for (const indicator of projectIndicators) {
206344
206301
  try {
206345
- await access(join39(cwd2, indicator.file));
206302
+ await access(join38(cwd2, indicator.file));
206346
206303
  projectType = indicator.type;
206347
206304
  if (indicator.file === "package.json") {
206348
206305
  try {
206349
206306
  const { readFile: readFile9 } = await import("fs/promises");
206350
- const pkg = JSON.parse(await readFile9(join39(cwd2, indicator.file), "utf-8"));
206307
+ const pkg = JSON.parse(await readFile9(join38(cwd2, indicator.file), "utf-8"));
206351
206308
  projectName = pkg.name || projectName;
206352
206309
  } catch {}
206353
206310
  }
@@ -211129,7 +211086,6 @@ var init_capabilities2 = __esm(async () => {
211129
211086
  });
211130
211087
 
211131
211088
  // packages/core/src/agent/loop.ts
211132
- import { join as join39 } from "path";
211133
211089
  function parseErrorCode(message) {
211134
211090
  const index = message.indexOf(":");
211135
211091
  if (index === -1)
@@ -213845,8 +213801,8 @@ Current state: ${voiceState.enabled ? "enabled" : "disabled"}, STT: ${voiceState
213845
213801
  return null;
213846
213802
  const intervalMs = Math.max(1000, config2.heartbeat?.intervalMs ?? 15000);
213847
213803
  const staleThresholdMs = Math.max(intervalMs * 2, config2.heartbeat?.staleThresholdMs ?? 120000);
213848
- const persistPath = config2.heartbeat?.persistPath ?? join39(this.storageDir, "heartbeats", `${this.sessionId}.json`);
213849
- const historyPath = config2.heartbeat?.historyPath ?? join39(this.storageDir, "heartbeats", "runs", `${this.sessionId}.jsonl`);
213804
+ const persistPath = config2.heartbeat?.persistPath ?? `<db>:heartbeat_state:${this.sessionId}`;
213805
+ const historyPath = config2.heartbeat?.historyPath ?? `<db>:heartbeat_history:${this.sessionId}`;
213850
213806
  return {
213851
213807
  intervalMs,
213852
213808
  staleThresholdMs,
@@ -214227,9 +214183,9 @@ class StatsTracker {
214227
214183
  }
214228
214184
 
214229
214185
  // packages/core/src/tools/connector-index.ts
214230
- import { join as join41, dirname as dirname15 } from "path";
214186
+ import { join as join38, dirname as dirname15 } from "path";
214231
214187
  import { homedir as homedir19 } from "os";
214232
- import { existsSync as existsSync27, mkdirSync as mkdirSync15, writeFileSync as writeFileSync11, readFileSync as readFileSync15 } from "fs";
214188
+ import { existsSync as existsSync26, mkdirSync as mkdirSync15, writeFileSync as writeFileSync11, readFileSync as readFileSync14 } from "fs";
214233
214189
  var TAG_KEYWORDS, INDEX_VERSION = 1, INDEX_TTL_MS, ConnectorIndex;
214234
214190
  var init_connector_index = __esm(() => {
214235
214191
  TAG_KEYWORDS = {
@@ -214266,15 +214222,15 @@ var init_connector_index = __esm(() => {
214266
214222
  return envHome && envHome.trim().length > 0 ? envHome : homedir19();
214267
214223
  }
214268
214224
  getCachePath() {
214269
- return join41(this.getHomeDir(), ".assistants", "cache", "connector-index.json");
214225
+ return join38(this.getHomeDir(), ".assistants", "cache", "connector-index.json");
214270
214226
  }
214271
214227
  loadDiskCache() {
214272
214228
  ConnectorIndex.indexLoaded = true;
214273
214229
  try {
214274
214230
  const cachePath = this.getCachePath();
214275
- if (!existsSync27(cachePath))
214231
+ if (!existsSync26(cachePath))
214276
214232
  return;
214277
- const data = JSON.parse(readFileSync15(cachePath, "utf-8"));
214233
+ const data = JSON.parse(readFileSync14(cachePath, "utf-8"));
214278
214234
  if (data.version !== INDEX_VERSION)
214279
214235
  return;
214280
214236
  if (Date.now() - data.timestamp > INDEX_TTL_MS)
@@ -214289,7 +214245,7 @@ var init_connector_index = __esm(() => {
214289
214245
  try {
214290
214246
  const cachePath = this.getCachePath();
214291
214247
  const cacheDir = dirname15(cachePath);
214292
- if (!existsSync27(cacheDir)) {
214248
+ if (!existsSync26(cacheDir)) {
214293
214249
  mkdirSync15(cacheDir, { recursive: true });
214294
214250
  }
214295
214251
  const data = {
@@ -214869,16 +214825,16 @@ var init_interviews = __esm(async () => {
214869
214825
  });
214870
214826
 
214871
214827
  // packages/core/src/memory/sessions.ts
214872
- import { join as join43, dirname as dirname16 } from "path";
214873
- import { existsSync as existsSync29, mkdirSync as mkdirSync16 } from "fs";
214828
+ import { join as join40, dirname as dirname16 } from "path";
214829
+ import { existsSync as existsSync28, mkdirSync as mkdirSync16 } from "fs";
214874
214830
 
214875
214831
  class SessionManager {
214876
214832
  db;
214877
214833
  constructor(dbPath, assistantId) {
214878
214834
  const baseDir = getConfigDir();
214879
- const path4 = dbPath || (assistantId ? join43(baseDir, "assistants", assistantId, "memory.db") : join43(baseDir, "memory.db"));
214835
+ const path4 = dbPath || (assistantId ? join40(baseDir, "assistants", assistantId, "memory.db") : join40(baseDir, "memory.db"));
214880
214836
  const dir = dirname16(path4);
214881
- if (!existsSync29(dir)) {
214837
+ if (!existsSync28(dir)) {
214882
214838
  mkdirSync16(dir, { recursive: true });
214883
214839
  }
214884
214840
  const runtime = getRuntime();
@@ -214992,9 +214948,9 @@ var init_sessions4 = __esm(async () => {
214992
214948
  ]);
214993
214949
  });
214994
214950
  // packages/core/src/migration/validators.ts
214995
- import { existsSync as existsSync30 } from "fs";
214951
+ import { existsSync as existsSync29 } from "fs";
214996
214952
  function assertNoExistingTarget(targetPath) {
214997
- if (existsSync30(targetPath)) {
214953
+ if (existsSync29(targetPath)) {
214998
214954
  throw new Error(`Target already exists at ${targetPath}`);
214999
214955
  }
215000
214956
  }
@@ -233747,7 +233703,7 @@ var require_filesystem = __commonJS((exports, module) => {
233747
233703
  var LDD_PATH = "/usr/bin/ldd";
233748
233704
  var SELF_PATH = "/proc/self/exe";
233749
233705
  var MAX_LENGTH = 2048;
233750
- var readFileSync17 = (path4) => {
233706
+ var readFileSync16 = (path4) => {
233751
233707
  const fd = fs7.openSync(path4, "r");
233752
233708
  const buffer = Buffer.alloc(MAX_LENGTH);
233753
233709
  const bytesRead = fs7.readSync(fd, buffer, 0, MAX_LENGTH, 0);
@@ -233770,7 +233726,7 @@ var require_filesystem = __commonJS((exports, module) => {
233770
233726
  module.exports = {
233771
233727
  LDD_PATH,
233772
233728
  SELF_PATH,
233773
- readFileSync: readFileSync17,
233729
+ readFileSync: readFileSync16,
233774
233730
  readFile: readFile9
233775
233731
  };
233776
233732
  });
@@ -233813,7 +233769,7 @@ var require_elf = __commonJS((exports, module) => {
233813
233769
  var require_detect_libc = __commonJS((exports, module) => {
233814
233770
  var childProcess = __require("child_process");
233815
233771
  var { isLinux: isLinux2, getReport } = require_process();
233816
- var { LDD_PATH, SELF_PATH, readFile: readFile9, readFileSync: readFileSync17 } = require_filesystem();
233772
+ var { LDD_PATH, SELF_PATH, readFile: readFile9, readFileSync: readFileSync16 } = require_filesystem();
233817
233773
  var { interpreterPath } = require_elf();
233818
233774
  var cachedFamilyInterpreter;
233819
233775
  var cachedFamilyFilesystem;
@@ -233904,7 +233860,7 @@ var require_detect_libc = __commonJS((exports, module) => {
233904
233860
  }
233905
233861
  cachedFamilyFilesystem = null;
233906
233862
  try {
233907
- const lddContent = readFileSync17(LDD_PATH);
233863
+ const lddContent = readFileSync16(LDD_PATH);
233908
233864
  cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
233909
233865
  } catch (e6) {}
233910
233866
  return cachedFamilyFilesystem;
@@ -233927,7 +233883,7 @@ var require_detect_libc = __commonJS((exports, module) => {
233927
233883
  }
233928
233884
  cachedFamilyInterpreter = null;
233929
233885
  try {
233930
- const selfContent = readFileSync17(SELF_PATH);
233886
+ const selfContent = readFileSync16(SELF_PATH);
233931
233887
  const path4 = interpreterPath(selfContent);
233932
233888
  cachedFamilyInterpreter = familyFromInterpreterPath(path4);
233933
233889
  } catch (e6) {}
@@ -233989,7 +233945,7 @@ var require_detect_libc = __commonJS((exports, module) => {
233989
233945
  }
233990
233946
  cachedVersionFilesystem = null;
233991
233947
  try {
233992
- const lddContent = readFileSync17(LDD_PATH);
233948
+ const lddContent = readFileSync16(LDD_PATH);
233993
233949
  const versionMatch = lddContent.match(RE_GLIBC_VERSION);
233994
233950
  if (versionMatch) {
233995
233951
  cachedVersionFilesystem = versionMatch[1];
@@ -255286,7 +255242,7 @@ await __promiseAll([
255286
255242
  ]);
255287
255243
  var import_react84 = __toESM(require_react(), 1);
255288
255244
  import { spawn as spawn6 } from "child_process";
255289
- import { join as join46 } from "path";
255245
+ import { join as join43 } from "path";
255290
255246
  import { homedir as homedir20 } from "os";
255291
255247
 
255292
255248
  // packages/terminal/src/components/Input.tsx
@@ -259284,65 +259240,76 @@ function ProcessingIndicator({
259284
259240
  init_src2();
259285
259241
  await init_build2();
259286
259242
  var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
259243
+ var MINI_LOGO = [
259244
+ " \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588",
259245
+ "\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 ",
259246
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588",
259247
+ "\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588",
259248
+ "\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588"
259249
+ ];
259250
+ var COLORS = ["#7dd3fc", "#38bdf8", "#0ea5e9", "#0284c7", "#0369a1"];
259287
259251
  function WelcomeBanner({ version: version5, model, directory }) {
259288
259252
  const homeDir = process.env.HOME || "";
259289
259253
  const displayDir = homeDir && directory.startsWith(homeDir) ? "~" + directory.slice(homeDir.length) : directory;
259290
259254
  const displayModel = getModelDisplayName(model);
259255
+ const isWide2 = (process.stdout.columns || 80) >= 82;
259291
259256
  return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259292
259257
  flexDirection: "column",
259293
259258
  marginBottom: 1,
259294
259259
  children: [
259295
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259260
+ isWide2 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259261
+ flexDirection: "column",
259262
+ marginBottom: 0,
259296
259263
  children: [
259297
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259298
- color: "cyan",
259299
- bold: true,
259300
- children: ">"
259301
- }, undefined, false, undefined, this),
259302
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259303
- color: "cyan",
259304
- bold: true,
259305
- children: "_ "
259306
- }, undefined, false, undefined, this),
259307
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259308
- bold: true,
259309
- children: "Hasna Assistants"
259310
- }, undefined, false, undefined, this),
259264
+ MINI_LOGO.map((line, i5) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259265
+ color: COLORS[i5],
259266
+ children: line
259267
+ }, i5, false, undefined, this)),
259311
259268
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259312
259269
  dimColor: true,
259313
- children: [
259314
- " (v",
259315
- version5,
259316
- ")"
259317
- ]
259318
- }, undefined, true, undefined, this)
259270
+ children: " by "
259271
+ }, undefined, false, undefined, this)
259319
259272
  ]
259320
- }, undefined, true, undefined, this),
259321
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259322
- marginTop: 1,
259273
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259274
+ marginBottom: 0,
259323
259275
  children: [
259324
259276
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259325
- dimColor: true,
259326
- children: "model: "
259327
- }, undefined, false, undefined, this),
259328
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259329
- children: displayModel
259277
+ color: "#0ea5e9",
259278
+ bold: true,
259279
+ children: "assistants"
259330
259280
  }, undefined, false, undefined, this),
259331
259281
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259332
259282
  dimColor: true,
259333
- children: " /model to change"
259283
+ children: " by hasna"
259334
259284
  }, undefined, false, undefined, this)
259335
259285
  ]
259336
259286
  }, undefined, true, undefined, this),
259337
259287
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
259288
+ marginTop: 0,
259338
259289
  children: [
259339
259290
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259340
259291
  dimColor: true,
259341
- children: "directory: "
259342
- }, undefined, false, undefined, this),
259292
+ children: [
259293
+ "v",
259294
+ version5,
259295
+ " "
259296
+ ]
259297
+ }, undefined, true, undefined, this),
259343
259298
  /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259344
- children: displayDir
259345
- }, undefined, false, undefined, this)
259299
+ dimColor: true,
259300
+ children: [
259301
+ " ",
259302
+ displayModel,
259303
+ " "
259304
+ ]
259305
+ }, undefined, true, undefined, this),
259306
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text3, {
259307
+ dimColor: true,
259308
+ children: [
259309
+ " ",
259310
+ displayDir
259311
+ ]
259312
+ }, undefined, true, undefined, this)
259346
259313
  ]
259347
259314
  }, undefined, true, undefined, this)
259348
259315
  ]
@@ -260223,6 +260190,7 @@ function InterviewPanel({
260223
260190
  await init_build2();
260224
260191
  var import_react45 = __toESM(require_react(), 1);
260225
260192
  var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
260193
+ var VISIBLE_COUNT = 5;
260226
260194
  function formatTimeAgo3(date3) {
260227
260195
  const seconds = Math.floor((Date.now() - date3.getTime()) / 1000);
260228
260196
  if (seconds < 60)
@@ -260264,15 +260232,6 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260264
260232
  setSelectedIndex((prev) => prev === totalItems - 1 ? 0 : prev + 1);
260265
260233
  return;
260266
260234
  }
260267
- const num = parseInt(input, 10);
260268
- if (!isNaN(num) && num >= 1 && num <= sessions.length) {
260269
- setSelectedIndex(num);
260270
- return;
260271
- }
260272
- if (input === "s" || input === "S" || input === "0") {
260273
- setSelectedIndex(0);
260274
- return;
260275
- }
260276
260235
  if (key.return) {
260277
260236
  if (selectedIndex === 0) {
260278
260237
  onStartFresh();
@@ -260286,6 +260245,28 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260286
260245
  return;
260287
260246
  }
260288
260247
  });
260248
+ const { visibleSessions, startIdx, showUpArrow, showDownArrow } = import_react45.useMemo(() => {
260249
+ const sessionSelectedIdx = selectedIndex - 1;
260250
+ const sessionCount = sessions.length;
260251
+ if (sessionCount <= VISIBLE_COUNT) {
260252
+ return {
260253
+ visibleSessions: sessions.map((s6, i5) => ({ session: s6, originalIndex: i5 })),
260254
+ startIdx: 0,
260255
+ showUpArrow: false,
260256
+ showDownArrow: false
260257
+ };
260258
+ }
260259
+ let start = Math.max(0, sessionSelectedIdx - Math.floor(VISIBLE_COUNT / 2));
260260
+ start = Math.min(start, sessionCount - VISIBLE_COUNT);
260261
+ start = Math.max(0, start);
260262
+ const visible = sessions.slice(start, start + VISIBLE_COUNT).map((s6, i5) => ({ session: s6, originalIndex: start + i5 }));
260263
+ return {
260264
+ visibleSessions: visible,
260265
+ startIdx: start,
260266
+ showUpArrow: start > 0,
260267
+ showDownArrow: start + VISIBLE_COUNT < sessionCount
260268
+ };
260269
+ }, [sessions, selectedIndex]);
260289
260270
  const selectedSessionIndex = selectedIndex - 1;
260290
260271
  return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
260291
260272
  flexDirection: "column",
@@ -260297,7 +260278,7 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260297
260278
  children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260298
260279
  color: "yellow",
260299
260280
  bold: true,
260300
- children: "Session Recovery Available"
260281
+ children: "Session Recovery"
260301
260282
  }, undefined, false, undefined, this)
260302
260283
  }, undefined, false, undefined, this),
260303
260284
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
@@ -260308,7 +260289,7 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260308
260289
  sessions.length,
260309
260290
  " recoverable session",
260310
260291
  sessions.length !== 1 ? "s" : "",
260311
- " found. Select one to resume or start fresh."
260292
+ " found."
260312
260293
  ]
260313
260294
  }, undefined, true, undefined, this)
260314
260295
  }, undefined, false, undefined, this),
@@ -260339,12 +260320,22 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260339
260320
  children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
260340
260321
  }, undefined, false, undefined, this)
260341
260322
  }, undefined, false, undefined, this),
260342
- sessions.map((session, index) => {
260343
- const isSelected = index === selectedSessionIndex;
260323
+ showUpArrow && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
260324
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260325
+ dimColor: true,
260326
+ children: [
260327
+ " \u2191 ",
260328
+ startIdx,
260329
+ " more above"
260330
+ ]
260331
+ }, undefined, true, undefined, this)
260332
+ }, undefined, false, undefined, this),
260333
+ visibleSessions.map(({ session, originalIndex }) => {
260334
+ const isSelected = originalIndex === selectedSessionIndex;
260344
260335
  const stateLabel = getStateLabel(session.heartbeat.state);
260345
260336
  const timeAgo = formatTimeAgo3(session.lastActivity);
260346
260337
  const cwdDisplay = truncatePath(session.cwd, 30);
260347
- const msgCount = session.messageCount > 0 ? ` \u2022 ${session.messageCount} msgs` : "";
260338
+ const msgCount = session.messageCount > 0 ? ` ${session.messageCount} msgs` : "";
260348
260339
  return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
260349
260340
  paddingY: 0,
260350
260341
  children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
@@ -260352,8 +260343,6 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260352
260343
  children: [
260353
260344
  isSelected ? "\u25B6" : " ",
260354
260345
  " ",
260355
- index + 1,
260356
- ". ",
260357
260346
  cwdDisplay,
260358
260347
  msgCount,
260359
260348
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
@@ -260369,7 +260358,17 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260369
260358
  ]
260370
260359
  }, undefined, true, undefined, this)
260371
260360
  }, session.sessionId, false, undefined, this);
260372
- })
260361
+ }),
260362
+ showDownArrow && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
260363
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260364
+ dimColor: true,
260365
+ children: [
260366
+ " \u2193 ",
260367
+ sessions.length - startIdx - VISIBLE_COUNT,
260368
+ " more below"
260369
+ ]
260370
+ }, undefined, true, undefined, this)
260371
+ }, undefined, false, undefined, this)
260373
260372
  ]
260374
260373
  }, undefined, true, undefined, this),
260375
260374
  selectedSessionIndex >= 0 && selectedSessionIndex < sessions.length && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
@@ -260378,11 +260377,11 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260378
260377
  children: [
260379
260378
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260380
260379
  dimColor: true,
260381
- children: "Selected session details:"
260380
+ children: "Selected:"
260382
260381
  }, undefined, false, undefined, this),
260383
260382
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260384
260383
  children: [
260385
- " Directory: ",
260384
+ " ",
260386
260385
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260387
260386
  color: "cyan",
260388
260387
  children: sessions[selectedSessionIndex].cwd
@@ -260391,33 +260390,19 @@ function RecoveryPanel({ sessions, onRecover, onStartFresh }) {
260391
260390
  }, undefined, true, undefined, this),
260392
260391
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260393
260392
  children: [
260394
- " Last activity: ",
260395
- formatTimeAgo3(sessions[selectedSessionIndex].lastActivity)
260396
- ]
260397
- }, undefined, true, undefined, this),
260398
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260399
- children: [
260400
- " State: ",
260393
+ " ",
260394
+ formatTimeAgo3(sessions[selectedSessionIndex].lastActivity),
260395
+ " \xB7 ",
260401
260396
  getStateLabel(sessions[selectedSessionIndex].heartbeat.state)
260402
260397
  ]
260403
- }, undefined, true, undefined, this),
260404
- sessions[selectedSessionIndex].messageCount > 0 && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260405
- children: [
260406
- " Messages: ",
260407
- sessions[selectedSessionIndex].messageCount
260408
- ]
260409
260398
  }, undefined, true, undefined, this)
260410
260399
  ]
260411
260400
  }, undefined, true, undefined, this),
260412
260401
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
260413
260402
  children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
260414
260403
  dimColor: true,
260415
- children: [
260416
- "\u2191/\u2193 navigate \u2022 Enter to select \u2022 Esc for fresh \u2022 1-",
260417
- Math.min(9, sessions.length),
260418
- " quick select"
260419
- ]
260420
- }, undefined, true, undefined, this)
260404
+ children: "\u2191/\u2193 navigate \xB7 Enter select \xB7 Esc fresh start"
260405
+ }, undefined, false, undefined, this)
260421
260406
  }, undefined, false, undefined, this)
260422
260407
  ]
260423
260408
  }, undefined, true, undefined, this);
@@ -274497,13 +274482,13 @@ function useTypewriter(text, speed = 30, active = true) {
274497
274482
 
274498
274483
  // packages/terminal/src/hooks/useGradientCycle.ts
274499
274484
  var import_react65 = __toESM(require_react(), 1);
274500
- var COLORS = ["cyan", "blue", "magenta", "red", "yellow", "green"];
274485
+ var COLORS2 = ["cyan", "blue", "magenta", "red", "yellow", "green"];
274501
274486
  function useGradientCycle(intervalMs = 800) {
274502
274487
  const [index, setIndex] = import_react65.useState(0);
274503
274488
  const timerRef = import_react65.useRef(null);
274504
274489
  import_react65.useEffect(() => {
274505
274490
  timerRef.current = setInterval(() => {
274506
- setIndex((prev) => (prev + 1) % COLORS.length);
274491
+ setIndex((prev) => (prev + 1) % COLORS2.length);
274507
274492
  }, intervalMs);
274508
274493
  return () => {
274509
274494
  if (timerRef.current) {
@@ -274512,7 +274497,7 @@ function useGradientCycle(intervalMs = 800) {
274512
274497
  }
274513
274498
  };
274514
274499
  }, [intervalMs]);
274515
- return COLORS[index];
274500
+ return COLORS2[index];
274516
274501
  }
274517
274502
 
274518
274503
  // packages/terminal/src/components/OnboardingPanel.tsx
@@ -274527,11 +274512,14 @@ var POPULAR_CONNECTORS = {
274527
274512
  github: { desc: "GitHub repos & issues", install: "bun add -g connect-github" },
274528
274513
  calendar: { desc: "Google Calendar", install: "bun add -g connect-calendar" }
274529
274514
  };
274530
- var ASCII_LOGO = ` _ ____ ____ ___ ____ _____ _ _ _ _____ ____
274531
- / \\ / ___/ ___|_ _/ ___|_ _|/ \\ | \\ | |_ _/ ___|
274532
- / _ \\ \\___ \\___ \\| |\\___ \\ | | / _ \\ | \\| | | | \\___ \\
274533
- / ___ \\ ___) |__) | | ___) || |/ ___ \\| |\\ | | | ___) |
274534
- /_/ \\_\\____/____/___|____/ |_/_/ \\_\\_| \\_| |_| |____/`;
274515
+ var LOGO_LINES = [
274516
+ " \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588",
274517
+ " \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 ",
274518
+ " \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588",
274519
+ " \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588",
274520
+ " \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588"
274521
+ ];
274522
+ var GRADIENT_COLORS = ["#7dd3fc", "#38bdf8", "#0ea5e9", "#0284c7", "#0369a1"];
274535
274523
  var COMPACT_LOGO = "ASSISTANTS";
274536
274524
  var INTRO_FEATURES = [
274537
274525
  "Chat with Claude AI directly in your terminal",
@@ -274885,16 +274873,31 @@ function OnboardingPanel({
274885
274873
  children: [
274886
274874
  /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
274887
274875
  marginTop: 1,
274888
- marginBottom: 1,
274876
+ marginBottom: 0,
274877
+ flexDirection: "column",
274889
274878
  children: isCompact ? /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text3, {
274890
274879
  bold: true,
274891
274880
  color: logoColor,
274892
274881
  children: COMPACT_LOGO
274893
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text3, {
274894
- color: logoColor,
274895
- children: ASCII_LOGO
274896
- }, undefined, false, undefined, this)
274882
+ }, undefined, false, undefined, this) : LOGO_LINES.map((line, i5) => /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text3, {
274883
+ color: GRADIENT_COLORS[i5] || GRADIENT_COLORS[GRADIENT_COLORS.length - 1],
274884
+ children: line
274885
+ }, i5, false, undefined, this))
274897
274886
  }, undefined, false, undefined, this),
274887
+ /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
274888
+ marginBottom: 1,
274889
+ children: [
274890
+ /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text3, {
274891
+ dimColor: true,
274892
+ children: " by "
274893
+ }, undefined, false, undefined, this),
274894
+ /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text3, {
274895
+ color: "#94a3b8",
274896
+ bold: true,
274897
+ children: "hasna"
274898
+ }, undefined, false, undefined, this)
274899
+ ]
274900
+ }, undefined, true, undefined, this),
274898
274901
  /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
274899
274902
  marginBottom: 1,
274900
274903
  children: [
@@ -285985,7 +285988,7 @@ await init_src3();
285985
285988
  // packages/terminal/src/lib/budgets.ts
285986
285989
  init_src2();
285987
285990
  await init_src3();
285988
- import { join as join45 } from "path";
285991
+ import { join as join41 } from "path";
285989
285992
  import { mkdir as mkdir9, readFile as readFile9, writeFile as writeFile8 } from "fs/promises";
285990
285993
  var PROFILES_FILE = "budgets.json";
285991
285994
  var SESSION_MAP_FILE = "budget-sessions.json";
@@ -286009,7 +286012,7 @@ async function writeJsonFile(path6, data) {
286009
286012
  }
286010
286013
  async function loadBudgetProfiles(baseDir, seedConfig) {
286011
286014
  await ensureDir(baseDir);
286012
- const path6 = join45(baseDir, PROFILES_FILE);
286015
+ const path6 = join41(baseDir, PROFILES_FILE);
286013
286016
  const data = await readJsonFile(path6);
286014
286017
  const profiles = Array.isArray(data?.profiles) ? data.profiles : [];
286015
286018
  if (profiles.length === 0) {
@@ -286029,7 +286032,7 @@ async function loadBudgetProfiles(baseDir, seedConfig) {
286029
286032
  }
286030
286033
  async function saveBudgetProfiles(baseDir, profiles) {
286031
286034
  await ensureDir(baseDir);
286032
- const path6 = join45(baseDir, PROFILES_FILE);
286035
+ const path6 = join41(baseDir, PROFILES_FILE);
286033
286036
  await writeJsonFile(path6, { profiles });
286034
286037
  }
286035
286038
  async function createBudgetProfile(baseDir, name2, config2, description) {
@@ -286067,13 +286070,13 @@ async function deleteBudgetProfile(baseDir, id) {
286067
286070
  }
286068
286071
  async function loadSessionBudgetMap(baseDir) {
286069
286072
  await ensureDir(baseDir);
286070
- const path6 = join45(baseDir, SESSION_MAP_FILE);
286073
+ const path6 = join41(baseDir, SESSION_MAP_FILE);
286071
286074
  const data = await readJsonFile(path6);
286072
286075
  return data || {};
286073
286076
  }
286074
286077
  async function saveSessionBudgetMap(baseDir, map2) {
286075
286078
  await ensureDir(baseDir);
286076
- const path6 = join45(baseDir, SESSION_MAP_FILE);
286079
+ const path6 = join41(baseDir, SESSION_MAP_FILE);
286077
286080
  await writeJsonFile(path6, map2);
286078
286081
  }
286079
286082
 
@@ -287692,13 +287695,13 @@ function App2({ cwd: cwd3, version: version5 }) {
287692
287695
  });
287693
287696
  }, [recoverableSessions, createSessionFromRecovery, workspaceBaseDir]);
287694
287697
  const handleOnboardingComplete = import_react84.useCallback(async (result) => {
287695
- const { existsSync: existsSync28, mkdirSync: mkdirSync17, readFileSync: readFileSync17, writeFileSync: writeFileSync12, appendFileSync: appendFileSync5 } = await import("fs");
287696
- const secretsPath = join46(homedir20(), ".secrets");
287698
+ const { existsSync: existsSync27, mkdirSync: mkdirSync17, readFileSync: readFileSync16, writeFileSync: writeFileSync12, appendFileSync: appendFileSync5 } = await import("fs");
287699
+ const secretsPath = join43(homedir20(), ".secrets");
287697
287700
  const providerInfo = getProviderInfo(result.provider);
287698
287701
  const envName = providerInfo?.apiKeyEnv || "ANTHROPIC_API_KEY";
287699
287702
  const keyExport = `export ${envName}="${result.apiKey}"`;
287700
- if (existsSync28(secretsPath)) {
287701
- const content = readFileSync17(secretsPath, "utf-8");
287703
+ if (existsSync27(secretsPath)) {
287704
+ const content = readFileSync16(secretsPath, "utf-8");
287702
287705
  if (content.includes(envName)) {
287703
287706
  const updated = content.replace(new RegExp(`^export ${envName}=.*$`, "m"), keyExport);
287704
287707
  writeFileSync12(secretsPath, updated, "utf-8");
@@ -287714,7 +287717,7 @@ function App2({ cwd: cwd3, version: version5 }) {
287714
287717
  for (const [name2, key] of Object.entries(result.connectorKeys)) {
287715
287718
  const envName2 = `${name2.toUpperCase()}_API_KEY`;
287716
287719
  const connKeyExport = `export ${envName2}="${key}"`;
287717
- const content = readFileSync17(secretsPath, "utf-8");
287720
+ const content = readFileSync16(secretsPath, "utf-8");
287718
287721
  if (content.includes(envName2)) {
287719
287722
  const updated = content.replace(new RegExp(`^export ${envName2}=.*$`, "m"), connKeyExport);
287720
287723
  writeFileSync12(secretsPath, updated, "utf-8");
@@ -287724,14 +287727,14 @@ function App2({ cwd: cwd3, version: version5 }) {
287724
287727
  }
287725
287728
  }
287726
287729
  const configDir = workspaceBaseDir || getConfigDir();
287727
- if (!existsSync28(configDir)) {
287730
+ if (!existsSync27(configDir)) {
287728
287731
  mkdirSync17(configDir, { recursive: true });
287729
287732
  }
287730
- const configPath = join46(configDir, "config.json");
287733
+ const configPath = join43(configDir, "config.json");
287731
287734
  let existingConfig = {};
287732
- if (existsSync28(configPath)) {
287735
+ if (existsSync27(configPath)) {
287733
287736
  try {
287734
- existingConfig = JSON.parse(readFileSync17(configPath, "utf-8"));
287737
+ existingConfig = JSON.parse(readFileSync16(configPath, "utf-8"));
287735
287738
  } catch {}
287736
287739
  }
287737
287740
  const newConfig = {
@@ -287773,14 +287776,14 @@ function App2({ cwd: cwd3, version: version5 }) {
287773
287776
  return;
287774
287777
  }
287775
287778
  try {
287776
- const configPath = join46(workspaceBaseDir || getConfigDir(), "config.json");
287777
- const { existsSync: existsSync28, readFileSync: readFileSync17 } = await import("fs");
287779
+ const configPath = join43(workspaceBaseDir || getConfigDir(), "config.json");
287780
+ const { existsSync: existsSync27, readFileSync: readFileSync16 } = await import("fs");
287778
287781
  let needsOnboarding = false;
287779
- if (!existsSync28(configPath)) {
287782
+ if (!existsSync27(configPath)) {
287780
287783
  needsOnboarding = true;
287781
287784
  } else {
287782
287785
  try {
287783
- const raw = readFileSync17(configPath, "utf-8");
287786
+ const raw = readFileSync16(configPath, "utf-8");
287784
287787
  const parsed = JSON.parse(raw);
287785
287788
  if (!parsed.onboardingCompleted) {
287786
287789
  needsOnboarding = true;
@@ -290893,7 +290896,7 @@ Interactive Mode:
290893
290896
  // packages/terminal/src/index.tsx
290894
290897
  var jsx_dev_runtime52 = __toESM(require_jsx_dev_runtime(), 1);
290895
290898
  setRuntime(bunRuntime);
290896
- var VERSION4 = "1.1.52";
290899
+ var VERSION4 = "1.1.54";
290897
290900
  var SYNC_START = "\x1B[?2026h";
290898
290901
  var SYNC_END = "\x1B[?2026l";
290899
290902
  function enableSynchronizedOutput() {
@@ -291012,4 +291015,4 @@ export {
291012
291015
  main
291013
291016
  };
291014
291017
 
291015
- //# debugId=51954E8A8CA1CA3F64756E2164756E21
291018
+ //# debugId=FC1EA89048010C4A64756E2164756E21