open-walnut 0.4.1 → 0.4.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.
Files changed (34) hide show
  1. package/README.md +2 -5
  2. package/dist/cli-fast.js +69 -46
  3. package/dist/cli.js +882 -450
  4. package/dist/daemon-binaries/acp-worker.js.version +1 -1
  5. package/dist/integrations/calendar/index.js +42 -36
  6. package/dist/integrations/jira/index.js +100 -78
  7. package/dist/integrations/ms-todo/index.js +94 -72
  8. package/dist/web/server.js +930 -498
  9. package/dist/web/static/assets/{OfficePreview-C8OMbtiq.js → OfficePreview-DcPiG7nq.js} +2 -2
  10. package/dist/web/static/assets/{docx-preview-hDgtrOpv.js → docx-preview-BWSwr6o8.js} +1 -1
  11. package/dist/web/static/assets/index-1mQq6abn.css +32 -0
  12. package/dist/web/static/assets/{index-CPHXL-wy.js → index-A2G2h66W.js} +1 -1
  13. package/dist/web/static/assets/{index-B2-N8jTH.js → index-BWTJQD8q.js} +1 -1
  14. package/dist/web/static/assets/{index-CBHRNnCk.js → index-BcxyDA3F.js} +1 -1
  15. package/dist/web/static/assets/{index-EowLf_Xf.js → index-CEldo7Tq.js} +1 -1
  16. package/dist/web/static/assets/{index-KY36bfpA.js → index-CYY_N36O.js} +1 -1
  17. package/dist/web/static/assets/{index-ph8Hxff-.js → index-CakB6vm_.js} +1 -1
  18. package/dist/web/static/assets/{index-D81YKipC.js → index-Ch4LQw8-.js} +1 -1
  19. package/dist/web/static/assets/{index-BAb6UVet.js → index-CnmikCRj.js} +1 -1
  20. package/dist/web/static/assets/{index-Caj09uf7.js → index-CtytO7Ce.js} +1 -1
  21. package/dist/web/static/assets/{index-gv-TJwHT.js → index-CvUyfkEn.js} +1 -1
  22. package/dist/web/static/assets/{index-D1uUk0AQ.js → index-Cw6d8sbx.js} +289 -289
  23. package/dist/web/static/assets/{index-CWIydpPr.js → index-DK9AxMTA.js} +1 -1
  24. package/dist/web/static/assets/{index-DtRt21Zi.js → index-DPeOcZuH.js} +1 -1
  25. package/dist/web/static/assets/{index-nRBC-NJN.js → index-DUWox7Cm.js} +1 -1
  26. package/dist/web/static/assets/{index-bfZj1PAc.js → index-Zb9B6znf.js} +1 -1
  27. package/dist/web/static/assets/{index-C5-vT4kT.js → index-a6-uB8ph.js} +1 -1
  28. package/dist/web/static/assets/{index-VcSnwuHG.js → index-aAfs_cWd.js} +1 -1
  29. package/dist/web/static/assets/{index-B35fidy6.js → index-xpwLXfWl.js} +1 -1
  30. package/dist/web/static/assets/{jszip.min-DyrlNEg4.js → jszip.min-BXx8_j4Y.js} +1 -1
  31. package/dist/web/static/assets/{pptx-preview.es-DjND6y6O.js → pptx-preview.es-ByVfeUXp.js} +1 -1
  32. package/dist/web/static/index.html +2 -2
  33. package/package.json +1 -1
  34. package/dist/web/static/assets/index-Btn4AoIy.css +0 -32
@@ -1 +1 @@
1
- walnut-daemon-dcf727398ab7
1
+ walnut-daemon-624e6e399db1
@@ -705,7 +705,7 @@ var EventBus = class {
705
705
  var bus = new EventBus();
706
706
 
707
707
  // src/core/config-manager.ts
708
- import fs4 from "fs/promises";
708
+ import fs5 from "fs/promises";
709
709
  import yaml from "js-yaml";
710
710
 
711
711
  // src/core/types.ts
@@ -735,7 +735,6 @@ var SESSION_MODE_IDS = SESSION_MODES.map((m) => m.id);
735
735
  var VALID_SESSION_MODE_IDS = new Set(SESSION_MODE_IDS);
736
736
  var SESSION_MODE_CLI_MAP = Object.fromEntries(SESSION_MODES.map((m) => [m.id, m.cli]));
737
737
  var SESSION_MODE_LABELS = Object.fromEntries(SESSION_MODES.map((m) => [m.id, m.label]));
738
- var DEFAULT_AGENT_ENGINE_PROVIDER = "claude-code";
739
738
 
740
739
  // src/agent/providers/model-catalog.ts
741
740
  var MODEL_CATALOG = {
@@ -1245,10 +1244,17 @@ var MODEL_CATALOG = {
1245
1244
  ]
1246
1245
  };
1247
1246
 
1248
- // src/core/ssh-config-scanner.ts
1249
- import fs3 from "fs/promises";
1250
- import path3 from "path";
1247
+ // src/core/claude-cli-detect.ts
1248
+ import { execFileSync } from "child_process";
1249
+ import fs3 from "fs";
1251
1250
  import os2 from "os";
1251
+ import path3 from "path";
1252
+ var _CLAUDE_CREDENTIALS_HOME = os2.homedir();
1253
+
1254
+ // src/core/ssh-config-scanner.ts
1255
+ import fs4 from "fs/promises";
1256
+ import path4 from "path";
1257
+ import os3 from "os";
1252
1258
  function isGitServerHost(h) {
1253
1259
  if (h.user === "git") return true;
1254
1260
  const gitPrefix = /^(git|github|gitlab|bitbucket|codecommit|ssh\.github)\./i;
@@ -1265,10 +1271,10 @@ function shortLabelForFqdn(hostname) {
1265
1271
  }
1266
1272
  var scanCache = /* @__PURE__ */ new Map();
1267
1273
  async function scanSshConfig(configPath) {
1268
- const sshConfigPath = configPath ?? path3.join(os2.homedir(), ".ssh", "config");
1274
+ const sshConfigPath = configPath ?? path4.join(os3.homedir(), ".ssh", "config");
1269
1275
  let mtimeMs;
1270
1276
  try {
1271
- mtimeMs = (await fs3.stat(sshConfigPath)).mtimeMs;
1277
+ mtimeMs = (await fs4.stat(sshConfigPath)).mtimeMs;
1272
1278
  } catch {
1273
1279
  return /* @__PURE__ */ new Map();
1274
1280
  }
@@ -1281,7 +1287,7 @@ async function scanSshConfig(configPath) {
1281
1287
  async function parseSshConfigFile(sshConfigPath) {
1282
1288
  const discovered = /* @__PURE__ */ new Map();
1283
1289
  try {
1284
- const content = await fs3.readFile(sshConfigPath, "utf-8");
1290
+ const content = await fs4.readFile(sshConfigPath, "utf-8");
1285
1291
  const lines = content.split("\n");
1286
1292
  let currentHost = null;
1287
1293
  for (const rawLine of lines) {
@@ -1370,12 +1376,12 @@ var DEFAULT_CONFIG = {
1370
1376
  // so this never re-routes an established setup.
1371
1377
  defaults: { priority: "none", platform: "local" },
1372
1378
  provider: { type: "claude-code" },
1373
- // Which ENGINE answers a Personal AI chat turn. 'walnut-agent' = today's in-process
1374
- // agent loop; 'claude-code' routes the turn into a lane-bound `claude` session.
1375
- // NOTE: getConfig() spreads the parsed file OVER these defaults at the TOP
1376
- // level, so a config.yaml with any `agent:` section replaces this whole object
1377
- // — resolveAgentEngineProvider() (below) is what actually applies the default.
1378
- agent: { provider: DEFAULT_AGENT_ENGINE_PROVIDER }
1379
+ // Which ENGINE answers a Personal AI chat turn is NOT defaulted here: it follows
1380
+ // the AI provider (Settings → AI Provider) — see resolveAgentEngineProvider().
1381
+ // getConfig() spreads the parsed file OVER these defaults at the TOP level, so
1382
+ // anything put in this object is dropped by any config.yaml with an `agent:`
1383
+ // section; the resolver is what actually applies the rule.
1384
+ agent: {}
1379
1385
  };
1380
1386
  function migrateConfigToProjectOnly(config) {
1381
1387
  let changed = false;
@@ -1449,13 +1455,13 @@ function migrateConfigToProjectOnly(config) {
1449
1455
  var CONFIG_BACKUP_FILE = `${CONFIG_FILE}.bak`;
1450
1456
  async function readRawConfigContent() {
1451
1457
  try {
1452
- const primary = await fs4.readFile(CONFIG_FILE, "utf-8");
1458
+ const primary = await fs5.readFile(CONFIG_FILE, "utf-8");
1453
1459
  if (primary.trim()) return primary;
1454
1460
  throw new Error("config.yaml is empty");
1455
1461
  } catch (primaryErr) {
1456
1462
  let backup;
1457
1463
  try {
1458
- backup = await fs4.readFile(CONFIG_BACKUP_FILE, "utf-8");
1464
+ backup = await fs5.readFile(CONFIG_BACKUP_FILE, "utf-8");
1459
1465
  } catch {
1460
1466
  return null;
1461
1467
  }
@@ -1465,7 +1471,7 @@ async function readRawConfigContent() {
1465
1471
  backup: CONFIG_BACKUP_FILE
1466
1472
  });
1467
1473
  try {
1468
- await fs4.writeFile(CONFIG_FILE, backup, "utf-8");
1474
+ await fs5.writeFile(CONFIG_FILE, backup, "utf-8");
1469
1475
  } catch {
1470
1476
  }
1471
1477
  return backup;
@@ -1537,26 +1543,26 @@ import { promisify } from "util";
1537
1543
  // src/core/helper-build.ts
1538
1544
  import { spawn } from "child_process";
1539
1545
  import { createHash } from "crypto";
1540
- import fs5 from "fs";
1546
+ import fs6 from "fs";
1541
1547
  import fsp2 from "fs/promises";
1542
- import path4 from "path";
1548
+ import path5 from "path";
1543
1549
  import { fileURLToPath as fileURLToPath2 } from "url";
1544
1550
  var builds = /* @__PURE__ */ new Map();
1545
1551
  var outcomes = /* @__PURE__ */ new Map();
1546
1552
  function helperSourcePath(file) {
1547
- const here = path4.dirname(fileURLToPath2(import.meta.url));
1553
+ const here = path5.dirname(fileURLToPath2(import.meta.url));
1548
1554
  const candidates = [
1549
- path4.resolve(here, `data/${file}`),
1555
+ path5.resolve(here, `data/${file}`),
1550
1556
  // dist/cli.js → dist/data
1551
- path4.resolve(here, `../data/${file}`),
1552
- path4.resolve(here, `../../data/${file}`)
1557
+ path5.resolve(here, `../data/${file}`),
1558
+ path5.resolve(here, `../../data/${file}`)
1553
1559
  // src/core/<sub> → src/data
1554
1560
  ];
1555
- for (const c of candidates) if (fs5.existsSync(c)) return c;
1561
+ for (const c of candidates) if (fs6.existsSync(c)) return c;
1556
1562
  return candidates[0];
1557
1563
  }
1558
1564
  function cachedBinPath(spec) {
1559
- return path4.join(WALNUT_HOME, "cache", `${spec.name}-${spec.version}`);
1565
+ return path5.join(WALNUT_HOME, "cache", `${spec.name}-${spec.version}`);
1560
1566
  }
1561
1567
  function fingerprintPath(spec) {
1562
1568
  return `${cachedBinPath(spec)}.srchash`;
@@ -1564,7 +1570,7 @@ function fingerprintPath(spec) {
1564
1570
  function sourceFingerprint(spec, srcPath) {
1565
1571
  let source;
1566
1572
  try {
1567
- source = fs5.readFileSync(srcPath);
1573
+ source = fs6.readFileSync(srcPath);
1568
1574
  } catch {
1569
1575
  return null;
1570
1576
  }
@@ -1572,13 +1578,13 @@ function sourceFingerprint(spec, srcPath) {
1572
1578
  }
1573
1579
  function readFingerprint(spec) {
1574
1580
  try {
1575
- return fs5.readFileSync(fingerprintPath(spec), "utf8").trim() || null;
1581
+ return fs6.readFileSync(fingerprintPath(spec), "utf8").trim() || null;
1576
1582
  } catch {
1577
1583
  return null;
1578
1584
  }
1579
1585
  }
1580
1586
  function helperCacheDecision(spec, srcPath) {
1581
- if (!fs5.existsSync(cachedBinPath(spec))) return "compile";
1587
+ if (!fs6.existsSync(cachedBinPath(spec))) return "compile";
1582
1588
  const fingerprint = sourceFingerprint(spec, srcPath);
1583
1589
  if (fingerprint === null) return "reuse";
1584
1590
  const stored = readFingerprint(spec);
@@ -1589,10 +1595,10 @@ function olderHelperGenerations(spec) {
1589
1595
  const current = /^v(\d+)$/.exec(spec.version);
1590
1596
  if (!current) return [];
1591
1597
  const currentN = Number(current[1]);
1592
- const dir = path4.join(WALNUT_HOME, "cache");
1598
+ const dir = path5.join(WALNUT_HOME, "cache");
1593
1599
  let entries;
1594
1600
  try {
1595
- entries = fs5.readdirSync(dir);
1601
+ entries = fs6.readdirSync(dir);
1596
1602
  } catch {
1597
1603
  return [];
1598
1604
  }
@@ -1602,10 +1608,10 @@ function olderHelperGenerations(spec) {
1602
1608
  if (!m) continue;
1603
1609
  const n = Number(m[1]);
1604
1610
  if (n >= currentN) continue;
1605
- const bin = path4.join(dir, entry);
1611
+ const bin = path5.join(dir, entry);
1606
1612
  try {
1607
- if (!fs5.statSync(bin).isFile()) continue;
1608
- fs5.accessSync(bin, fs5.constants.X_OK);
1613
+ if (!fs6.statSync(bin).isFile()) continue;
1614
+ fs6.accessSync(bin, fs6.constants.X_OK);
1609
1615
  } catch {
1610
1616
  continue;
1611
1617
  }
@@ -1645,17 +1651,17 @@ async function buildHelper(spec, sourceFile) {
1645
1651
  note: "an ad-hoc helper loses its macOS permission grant on rebuild; bump the version instead"
1646
1652
  });
1647
1653
  }
1648
- if (!fs5.existsSync(src)) {
1654
+ if (!fs6.existsSync(src)) {
1649
1655
  log.web.warn("helper source missing, feature disabled", { helper: spec.name, src });
1650
1656
  return { bin: null, reason: "compile_failed" };
1651
1657
  }
1652
- await fsp2.mkdir(path4.dirname(bin), { recursive: true });
1658
+ await fsp2.mkdir(path5.dirname(bin), { recursive: true });
1653
1659
  const args = ["-n", "10", "xcrun", "swiftc", "-O", "-o", "", src];
1654
1660
  const tmpBin = `${bin}.tmp-${process.pid}`;
1655
1661
  args[6] = tmpBin;
1656
1662
  let plistPath;
1657
1663
  if (spec.infoPlist) {
1658
- plistPath = path4.join(WALNUT_HOME, "cache", `${spec.name}-${spec.version}.plist`);
1664
+ plistPath = path5.join(WALNUT_HOME, "cache", `${spec.name}-${spec.version}.plist`);
1659
1665
  await fsp2.writeFile(plistPath, spec.infoPlist);
1660
1666
  args.push(
1661
1667
  "-Xlinker",