open-walnut 0.4.2 → 0.4.4
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/README.md +1 -1
- package/dist/cli.js +247 -245
- package/dist/integrations/calendar/index.js +42 -36
- package/dist/integrations/jira/index.js +100 -78
- package/dist/integrations/ms-todo/index.js +94 -72
- package/dist/web/server.js +295 -293
- package/dist/web/static/assets/{OfficePreview-CEHO0xkd.js → OfficePreview-BlfHJAnI.js} +2 -2
- package/dist/web/static/assets/{docx-preview-CuZwjAMS.js → docx-preview-Cxj6saWk.js} +1 -1
- package/dist/web/static/assets/{index-ccs5s80D.js → index-7Z89132A.js} +1 -1
- package/dist/web/static/assets/{index-DLjK8dGE.js → index-8m4fXWae.js} +1 -1
- package/dist/web/static/assets/{index-BFF_G72i.js → index-B5OE08Hi.js} +276 -276
- package/dist/web/static/assets/{index-DR-LSqAg.js → index-BX-Q5nDs.js} +1 -1
- package/dist/web/static/assets/{index-DXtp_ZWh.js → index-BcvUZ0V6.js} +1 -1
- package/dist/web/static/assets/{index-D1dpOEzW.js → index-Bg08t19u.js} +1 -1
- package/dist/web/static/assets/{index-BRLxNhyy.js → index-BrQxDmgD.js} +1 -1
- package/dist/web/static/assets/{index-DtRwkh8J.js → index-C-ZIMUgb.js} +1 -1
- package/dist/web/static/assets/{index-DrWzb338.js → index-CJsj6NRK.js} +1 -1
- package/dist/web/static/assets/{index-unnPilnK.js → index-CPLhHJLE.js} +1 -1
- package/dist/web/static/assets/index-Cqfkxb49.css +32 -0
- package/dist/web/static/assets/{index-BBjg7m-_.js → index-DESxqmea.js} +1 -1
- package/dist/web/static/assets/{index-0MyC-yGG.js → index-Db4kYRIN.js} +1 -1
- package/dist/web/static/assets/{index-DOXm2Aye.js → index-Dmxn8BJB.js} +1 -1
- package/dist/web/static/assets/{index-C2YGUYGS.js → index-HOURQwyW.js} +1 -1
- package/dist/web/static/assets/{index-Bqg4_WEG.js → index-QcYRs4hO.js} +1 -1
- package/dist/web/static/assets/{index-DAOPV34I.js → index-i813E9y_.js} +1 -1
- package/dist/web/static/assets/{index-D9qPPm7h.js → index-ntIs-QCy.js} +1 -1
- package/dist/web/static/assets/{index-mWEwJcqw.js → index-qbtGSfLJ.js} +1 -1
- package/dist/web/static/assets/{jszip.min-DYFwy4PE.js → jszip.min-CjTDoW5q.js} +1 -1
- package/dist/web/static/assets/{pptx-preview.es-eu2nX9JC.js → pptx-preview.es-CW9hHNwC.js} +1 -1
- package/dist/web/static/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/static/assets/index-DeYCGmOR.css +0 -32
|
@@ -705,7 +705,7 @@ var EventBus = class {
|
|
|
705
705
|
var bus = new EventBus();
|
|
706
706
|
|
|
707
707
|
// src/core/config-manager.ts
|
|
708
|
-
import
|
|
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/
|
|
1249
|
-
import
|
|
1250
|
-
import
|
|
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 ??
|
|
1274
|
+
const sshConfigPath = configPath ?? path4.join(os3.homedir(), ".ssh", "config");
|
|
1269
1275
|
let mtimeMs;
|
|
1270
1276
|
try {
|
|
1271
|
-
mtimeMs = (await
|
|
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
|
|
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
|
|
1374
|
-
//
|
|
1375
|
-
//
|
|
1376
|
-
//
|
|
1377
|
-
//
|
|
1378
|
-
agent: {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1546
|
+
import fs6 from "fs";
|
|
1541
1547
|
import fsp2 from "fs/promises";
|
|
1542
|
-
import
|
|
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 =
|
|
1553
|
+
const here = path5.dirname(fileURLToPath2(import.meta.url));
|
|
1548
1554
|
const candidates = [
|
|
1549
|
-
|
|
1555
|
+
path5.resolve(here, `data/${file}`),
|
|
1550
1556
|
// dist/cli.js → dist/data
|
|
1551
|
-
|
|
1552
|
-
|
|
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 (
|
|
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
|
|
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 =
|
|
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
|
|
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 (!
|
|
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 =
|
|
1598
|
+
const dir = path5.join(WALNUT_HOME, "cache");
|
|
1593
1599
|
let entries;
|
|
1594
1600
|
try {
|
|
1595
|
-
entries =
|
|
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 =
|
|
1611
|
+
const bin = path5.join(dir, entry);
|
|
1606
1612
|
try {
|
|
1607
|
-
if (!
|
|
1608
|
-
|
|
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 (!
|
|
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(
|
|
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 =
|
|
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",
|