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.
- package/README.md +2 -5
- package/dist/cli-fast.js +69 -46
- package/dist/cli.js +882 -450
- package/dist/daemon-binaries/acp-worker.js.version +1 -1
- 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 +930 -498
- package/dist/web/static/assets/{OfficePreview-C8OMbtiq.js → OfficePreview-DcPiG7nq.js} +2 -2
- package/dist/web/static/assets/{docx-preview-hDgtrOpv.js → docx-preview-BWSwr6o8.js} +1 -1
- package/dist/web/static/assets/index-1mQq6abn.css +32 -0
- package/dist/web/static/assets/{index-CPHXL-wy.js → index-A2G2h66W.js} +1 -1
- package/dist/web/static/assets/{index-B2-N8jTH.js → index-BWTJQD8q.js} +1 -1
- package/dist/web/static/assets/{index-CBHRNnCk.js → index-BcxyDA3F.js} +1 -1
- package/dist/web/static/assets/{index-EowLf_Xf.js → index-CEldo7Tq.js} +1 -1
- package/dist/web/static/assets/{index-KY36bfpA.js → index-CYY_N36O.js} +1 -1
- package/dist/web/static/assets/{index-ph8Hxff-.js → index-CakB6vm_.js} +1 -1
- package/dist/web/static/assets/{index-D81YKipC.js → index-Ch4LQw8-.js} +1 -1
- package/dist/web/static/assets/{index-BAb6UVet.js → index-CnmikCRj.js} +1 -1
- package/dist/web/static/assets/{index-Caj09uf7.js → index-CtytO7Ce.js} +1 -1
- package/dist/web/static/assets/{index-gv-TJwHT.js → index-CvUyfkEn.js} +1 -1
- package/dist/web/static/assets/{index-D1uUk0AQ.js → index-Cw6d8sbx.js} +289 -289
- package/dist/web/static/assets/{index-CWIydpPr.js → index-DK9AxMTA.js} +1 -1
- package/dist/web/static/assets/{index-DtRt21Zi.js → index-DPeOcZuH.js} +1 -1
- package/dist/web/static/assets/{index-nRBC-NJN.js → index-DUWox7Cm.js} +1 -1
- package/dist/web/static/assets/{index-bfZj1PAc.js → index-Zb9B6znf.js} +1 -1
- package/dist/web/static/assets/{index-C5-vT4kT.js → index-a6-uB8ph.js} +1 -1
- package/dist/web/static/assets/{index-VcSnwuHG.js → index-aAfs_cWd.js} +1 -1
- package/dist/web/static/assets/{index-B35fidy6.js → index-xpwLXfWl.js} +1 -1
- package/dist/web/static/assets/{jszip.min-DyrlNEg4.js → jszip.min-BXx8_j4Y.js} +1 -1
- package/dist/web/static/assets/{pptx-preview.es-DjND6y6O.js → pptx-preview.es-ByVfeUXp.js} +1 -1
- package/dist/web/static/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/static/assets/index-Btn4AoIy.css +0 -32
|
@@ -816,7 +816,7 @@ var init_fs = __esm({
|
|
|
816
816
|
});
|
|
817
817
|
|
|
818
818
|
// src/core/types.ts
|
|
819
|
-
var VALID_PRIORITIES, PIN_TIER_POLICY, SESSION_MODELS, SESSION_MODEL_CLI_MAP, VALID_SESSION_MODEL_IDS, SESSION_EFFORT_IDS, VALID_SESSION_EFFORT_IDS, SESSION_MODES, SESSION_MODE_IDS, VALID_SESSION_MODE_IDS, SESSION_MODE_CLI_MAP, SESSION_MODE_LABELS
|
|
819
|
+
var VALID_PRIORITIES, PIN_TIER_POLICY, SESSION_MODELS, SESSION_MODEL_CLI_MAP, VALID_SESSION_MODEL_IDS, SESSION_EFFORT_IDS, VALID_SESSION_EFFORT_IDS, SESSION_MODES, SESSION_MODE_IDS, VALID_SESSION_MODE_IDS, SESSION_MODE_CLI_MAP, SESSION_MODE_LABELS;
|
|
820
820
|
var init_types = __esm({
|
|
821
821
|
"src/core/types.ts"() {
|
|
822
822
|
"use strict";
|
|
@@ -868,7 +868,6 @@ var init_types = __esm({
|
|
|
868
868
|
VALID_SESSION_MODE_IDS = new Set(SESSION_MODE_IDS);
|
|
869
869
|
SESSION_MODE_CLI_MAP = Object.fromEntries(SESSION_MODES.map((m) => [m.id, m.cli]));
|
|
870
870
|
SESSION_MODE_LABELS = Object.fromEntries(SESSION_MODES.map((m) => [m.id, m.label]));
|
|
871
|
-
DEFAULT_AGENT_ENGINE_PROVIDER = "claude-code";
|
|
872
871
|
}
|
|
873
872
|
});
|
|
874
873
|
|
|
@@ -1386,10 +1385,32 @@ var init_model_catalog = __esm({
|
|
|
1386
1385
|
}
|
|
1387
1386
|
});
|
|
1388
1387
|
|
|
1389
|
-
// src/core/
|
|
1390
|
-
import
|
|
1391
|
-
import
|
|
1388
|
+
// src/core/claude-cli-detect.ts
|
|
1389
|
+
import { execFileSync } from "child_process";
|
|
1390
|
+
import fs5 from "fs";
|
|
1392
1391
|
import os3 from "os";
|
|
1392
|
+
import path6 from "path";
|
|
1393
|
+
var _CLAUDE_CREDENTIALS_HOME;
|
|
1394
|
+
var init_claude_cli_detect = __esm({
|
|
1395
|
+
"src/core/claude-cli-detect.ts"() {
|
|
1396
|
+
"use strict";
|
|
1397
|
+
init_constants();
|
|
1398
|
+
_CLAUDE_CREDENTIALS_HOME = os3.homedir();
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
// src/agent/providers/default-provider.ts
|
|
1403
|
+
var init_default_provider = __esm({
|
|
1404
|
+
"src/agent/providers/default-provider.ts"() {
|
|
1405
|
+
"use strict";
|
|
1406
|
+
init_claude_cli_detect();
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
|
|
1410
|
+
// src/core/ssh-config-scanner.ts
|
|
1411
|
+
import fs6 from "fs/promises";
|
|
1412
|
+
import path7 from "path";
|
|
1413
|
+
import os4 from "os";
|
|
1393
1414
|
function isGitServerHost(h) {
|
|
1394
1415
|
if (h.user === "git") return true;
|
|
1395
1416
|
const gitPrefix = /^(git|github|gitlab|bitbucket|codecommit|ssh\.github)\./i;
|
|
@@ -1405,10 +1426,10 @@ function shortLabelForFqdn(hostname) {
|
|
|
1405
1426
|
return `${first.slice(0, 12)}\u2026${first.slice(-8)}`;
|
|
1406
1427
|
}
|
|
1407
1428
|
async function scanSshConfig(configPath) {
|
|
1408
|
-
const sshConfigPath = configPath ??
|
|
1429
|
+
const sshConfigPath = configPath ?? path7.join(os4.homedir(), ".ssh", "config");
|
|
1409
1430
|
let mtimeMs2;
|
|
1410
1431
|
try {
|
|
1411
|
-
mtimeMs2 = (await
|
|
1432
|
+
mtimeMs2 = (await fs6.stat(sshConfigPath)).mtimeMs;
|
|
1412
1433
|
} catch {
|
|
1413
1434
|
return /* @__PURE__ */ new Map();
|
|
1414
1435
|
}
|
|
@@ -1421,7 +1442,7 @@ async function scanSshConfig(configPath) {
|
|
|
1421
1442
|
async function parseSshConfigFile(sshConfigPath) {
|
|
1422
1443
|
const discovered = /* @__PURE__ */ new Map();
|
|
1423
1444
|
try {
|
|
1424
|
-
const content = await
|
|
1445
|
+
const content = await fs6.readFile(sshConfigPath, "utf-8");
|
|
1425
1446
|
const lines = content.split("\n");
|
|
1426
1447
|
let currentHost = null;
|
|
1427
1448
|
for (const rawLine of lines) {
|
|
@@ -1508,7 +1529,7 @@ var init_ssh_config_scanner = __esm({
|
|
|
1508
1529
|
});
|
|
1509
1530
|
|
|
1510
1531
|
// src/core/config-manager.ts
|
|
1511
|
-
import
|
|
1532
|
+
import fs7 from "fs/promises";
|
|
1512
1533
|
import yaml from "js-yaml";
|
|
1513
1534
|
function migrateConfigToProjectOnly(config) {
|
|
1514
1535
|
let changed = false;
|
|
@@ -1581,13 +1602,13 @@ function migrateConfigToProjectOnly(config) {
|
|
|
1581
1602
|
}
|
|
1582
1603
|
async function readRawConfigContent() {
|
|
1583
1604
|
try {
|
|
1584
|
-
const primary = await
|
|
1605
|
+
const primary = await fs7.readFile(CONFIG_FILE, "utf-8");
|
|
1585
1606
|
if (primary.trim()) return primary;
|
|
1586
1607
|
throw new Error("config.yaml is empty");
|
|
1587
1608
|
} catch (primaryErr) {
|
|
1588
1609
|
let backup;
|
|
1589
1610
|
try {
|
|
1590
|
-
backup = await
|
|
1611
|
+
backup = await fs7.readFile(CONFIG_BACKUP_FILE, "utf-8");
|
|
1591
1612
|
} catch {
|
|
1592
1613
|
return null;
|
|
1593
1614
|
}
|
|
@@ -1597,7 +1618,7 @@ async function readRawConfigContent() {
|
|
|
1597
1618
|
backup: CONFIG_BACKUP_FILE
|
|
1598
1619
|
});
|
|
1599
1620
|
try {
|
|
1600
|
-
await
|
|
1621
|
+
await fs7.writeFile(CONFIG_FILE, backup, "utf-8");
|
|
1601
1622
|
} catch {
|
|
1602
1623
|
}
|
|
1603
1624
|
return backup;
|
|
@@ -1606,10 +1627,10 @@ async function readRawConfigContent() {
|
|
|
1606
1627
|
async function writeFileAtomic2(filePath, content) {
|
|
1607
1628
|
const tmp = `${filePath}.tmp-${process.pid}-${Date.now().toString(36)}`;
|
|
1608
1629
|
try {
|
|
1609
|
-
await
|
|
1610
|
-
await
|
|
1630
|
+
await fs7.writeFile(tmp, content, "utf-8");
|
|
1631
|
+
await fs7.rename(tmp, filePath);
|
|
1611
1632
|
} catch (err) {
|
|
1612
|
-
await
|
|
1633
|
+
await fs7.rm(tmp, { force: true }).catch(() => {
|
|
1613
1634
|
});
|
|
1614
1635
|
throw err;
|
|
1615
1636
|
}
|
|
@@ -1743,7 +1764,7 @@ async function seedConfigDefaults() {
|
|
|
1743
1764
|
const config = await getConfig();
|
|
1744
1765
|
let needsWrite = false;
|
|
1745
1766
|
try {
|
|
1746
|
-
const raw = await
|
|
1767
|
+
const raw = await fs7.readFile(CONFIG_FILE, "utf-8");
|
|
1747
1768
|
if (!raw.includes("available_models")) {
|
|
1748
1769
|
needsWrite = true;
|
|
1749
1770
|
}
|
|
@@ -1771,6 +1792,7 @@ var init_config_manager = __esm({
|
|
|
1771
1792
|
init_constants();
|
|
1772
1793
|
init_types();
|
|
1773
1794
|
init_model_catalog();
|
|
1795
|
+
init_default_provider();
|
|
1774
1796
|
init_ssh_config_scanner();
|
|
1775
1797
|
DEFAULT_CONFIG = {
|
|
1776
1798
|
version: 1,
|
|
@@ -1782,12 +1804,12 @@ var init_config_manager = __esm({
|
|
|
1782
1804
|
// so this never re-routes an established setup.
|
|
1783
1805
|
defaults: { priority: "none", platform: "local" },
|
|
1784
1806
|
provider: { type: "claude-code" },
|
|
1785
|
-
// Which ENGINE answers a Personal AI chat turn
|
|
1786
|
-
//
|
|
1787
|
-
//
|
|
1788
|
-
//
|
|
1789
|
-
//
|
|
1790
|
-
agent: {
|
|
1807
|
+
// Which ENGINE answers a Personal AI chat turn is NOT defaulted here: it follows
|
|
1808
|
+
// the AI provider (Settings → AI Provider) — see resolveAgentEngineProvider().
|
|
1809
|
+
// getConfig() spreads the parsed file OVER these defaults at the TOP level, so
|
|
1810
|
+
// anything put in this object is dropped by any config.yaml with an `agent:`
|
|
1811
|
+
// section; the resolver is what actually applies the rule.
|
|
1812
|
+
agent: {}
|
|
1791
1813
|
};
|
|
1792
1814
|
CONFIG_BACKUP_FILE = `${CONFIG_FILE}.bak`;
|
|
1793
1815
|
writeLock = Promise.resolve();
|
|
@@ -1892,7 +1914,7 @@ var init_format = __esm({
|
|
|
1892
1914
|
// src/utils/file-ops.ts
|
|
1893
1915
|
import crypto4 from "crypto";
|
|
1894
1916
|
import fsp4 from "fs/promises";
|
|
1895
|
-
import
|
|
1917
|
+
import path8 from "path";
|
|
1896
1918
|
var MAX_READ_SIZE;
|
|
1897
1919
|
var init_file_ops = __esm({
|
|
1898
1920
|
"src/utils/file-ops.ts"() {
|
|
@@ -1903,17 +1925,17 @@ var init_file_ops = __esm({
|
|
|
1903
1925
|
});
|
|
1904
1926
|
|
|
1905
1927
|
// src/core/memory-file.ts
|
|
1906
|
-
import
|
|
1907
|
-
import
|
|
1928
|
+
import fs8 from "fs";
|
|
1929
|
+
import path9 from "path";
|
|
1908
1930
|
function resolveMemoryPath(agentId) {
|
|
1909
1931
|
if (!agentId || agentId === "general") return MEMORY_FILE;
|
|
1910
|
-
return
|
|
1932
|
+
return path9.join(agentMemoryDir(agentId), "MEMORY.md");
|
|
1911
1933
|
}
|
|
1912
1934
|
function ensureMemoryFile(agentId) {
|
|
1913
1935
|
const filePath = resolveMemoryPath(agentId);
|
|
1914
|
-
if (
|
|
1915
|
-
|
|
1916
|
-
|
|
1936
|
+
if (fs8.existsSync(filePath)) return;
|
|
1937
|
+
fs8.mkdirSync(path9.dirname(filePath), { recursive: true });
|
|
1938
|
+
fs8.writeFileSync(filePath, DEFAULT_TEMPLATE, "utf-8");
|
|
1917
1939
|
}
|
|
1918
1940
|
var DEFAULT_TEMPLATE;
|
|
1919
1941
|
var init_memory_file = __esm({
|
|
@@ -1933,15 +1955,15 @@ description: >
|
|
|
1933
1955
|
|
|
1934
1956
|
// src/core/tmp-sweep.ts
|
|
1935
1957
|
import fsp5 from "fs/promises";
|
|
1936
|
-
import
|
|
1958
|
+
import path10 from "path";
|
|
1937
1959
|
function sweepDirs() {
|
|
1938
1960
|
return [
|
|
1939
1961
|
WALNUT_HOME,
|
|
1940
1962
|
SYNC_DIR,
|
|
1941
|
-
|
|
1942
|
-
|
|
1963
|
+
path10.join(WALNUT_HOME, "sessions"),
|
|
1964
|
+
path10.join(WALNUT_HOME, "sessions", "transcripts"),
|
|
1943
1965
|
TASKS_DIR,
|
|
1944
|
-
|
|
1966
|
+
path10.join(TASKS_DIR, "outbox"),
|
|
1945
1967
|
CONVERSATIONS_DIR,
|
|
1946
1968
|
MEMORY_DIR,
|
|
1947
1969
|
DAILY_DIR,
|
|
@@ -1962,7 +1984,7 @@ async function sweepOrphanAtomicTmpFiles() {
|
|
|
1962
1984
|
const entries = await fsp5.readdir(dir, { withFileTypes: true });
|
|
1963
1985
|
for (const entry of entries) {
|
|
1964
1986
|
if (!entry.isFile() || !ORPHAN_RE.test(entry.name)) continue;
|
|
1965
|
-
const full =
|
|
1987
|
+
const full = path10.join(dir, entry.name);
|
|
1966
1988
|
try {
|
|
1967
1989
|
const st = await fsp5.stat(full);
|
|
1968
1990
|
if (st.mtimeMs > cutoff) continue;
|
|
@@ -1995,10 +2017,10 @@ var init_tmp_sweep = __esm({
|
|
|
1995
2017
|
|
|
1996
2018
|
// src/core/init.ts
|
|
1997
2019
|
import fsp6 from "fs/promises";
|
|
1998
|
-
import
|
|
2020
|
+
import fs9 from "fs";
|
|
1999
2021
|
async function migrateLegacyMemoryFile() {
|
|
2000
2022
|
try {
|
|
2001
|
-
if (
|
|
2023
|
+
if (fs9.existsSync(LEGACY_MEMORY_FILE) && !fs9.existsSync(MEMORY_FILE)) {
|
|
2002
2024
|
await fsp6.rename(LEGACY_MEMORY_FILE, MEMORY_FILE);
|
|
2003
2025
|
log.memory.info("Migrated MEMORY.md into memory/ folder", { from: LEGACY_MEMORY_FILE, to: MEMORY_FILE });
|
|
2004
2026
|
}
|
|
@@ -2499,15 +2521,15 @@ var init_integration_registry = __esm({
|
|
|
2499
2521
|
|
|
2500
2522
|
// src/core/task-db.ts
|
|
2501
2523
|
import Database from "better-sqlite3";
|
|
2502
|
-
import
|
|
2503
|
-
import
|
|
2524
|
+
import fs10 from "fs";
|
|
2525
|
+
import path11 from "path";
|
|
2504
2526
|
import yaml2 from "js-yaml";
|
|
2505
2527
|
function getDb() {
|
|
2506
2528
|
if (db) return db;
|
|
2507
2529
|
if (initAttempted) throw initError;
|
|
2508
2530
|
initAttempted = true;
|
|
2509
2531
|
try {
|
|
2510
|
-
|
|
2532
|
+
fs10.mkdirSync(path11.dirname(TASK_DB_PATH), { recursive: true });
|
|
2511
2533
|
const handle = new Database(TASK_DB_PATH);
|
|
2512
2534
|
handle.pragma("journal_mode = WAL");
|
|
2513
2535
|
handle.pragma("busy_timeout = 5000");
|
|
@@ -2725,8 +2747,8 @@ function migrateToProjectOnly(handle) {
|
|
|
2725
2747
|
}
|
|
2726
2748
|
try {
|
|
2727
2749
|
handle.pragma("wal_checkpoint(TRUNCATE)");
|
|
2728
|
-
if (!
|
|
2729
|
-
|
|
2750
|
+
if (!fs10.existsSync(TASK_DB_PRE_V5_BACKUP_PATH)) {
|
|
2751
|
+
fs10.copyFileSync(TASK_DB_PATH, TASK_DB_PRE_V5_BACKUP_PATH);
|
|
2730
2752
|
log.task.info("task-db v5: wrote pre-migration backup", { path: TASK_DB_PRE_V5_BACKUP_PATH });
|
|
2731
2753
|
}
|
|
2732
2754
|
} catch (err) {
|
|
@@ -3153,7 +3175,7 @@ var init_task_db = __esm({
|
|
|
3153
3175
|
init_constants();
|
|
3154
3176
|
init_logging();
|
|
3155
3177
|
init_phase();
|
|
3156
|
-
TASK_DB_PATH =
|
|
3178
|
+
TASK_DB_PATH = path11.join(TASKS_DIR, "tasks.sqlite");
|
|
3157
3179
|
EXPLICIT_TASK_COLUMNS = [
|
|
3158
3180
|
"id",
|
|
3159
3181
|
"title",
|
|
@@ -3314,8 +3336,8 @@ var init_task_db = __esm({
|
|
|
3314
3336
|
});
|
|
3315
3337
|
|
|
3316
3338
|
// src/core/task-db-migration.ts
|
|
3317
|
-
import
|
|
3318
|
-
import
|
|
3339
|
+
import fs11 from "fs";
|
|
3340
|
+
import path12 from "path";
|
|
3319
3341
|
import yaml3 from "js-yaml";
|
|
3320
3342
|
async function runMigrationIfNeeded() {
|
|
3321
3343
|
const db2 = getDb();
|
|
@@ -3326,7 +3348,7 @@ async function runMigrationIfNeeded() {
|
|
|
3326
3348
|
if (existing.n > 0) {
|
|
3327
3349
|
return { migrated: false, count: existing.n };
|
|
3328
3350
|
}
|
|
3329
|
-
if (!
|
|
3351
|
+
if (!fs11.existsSync(TASKS_FILE)) {
|
|
3330
3352
|
return { migrated: false, count: 0 };
|
|
3331
3353
|
}
|
|
3332
3354
|
const store = await readJsonFile(TASKS_FILE, { version: 1, tasks: [] });
|
|
@@ -3483,9 +3505,9 @@ async function runMigrationIfNeeded() {
|
|
|
3483
3505
|
}
|
|
3484
3506
|
const after = db2.prepare("SELECT COUNT(*) AS n FROM tasks").get();
|
|
3485
3507
|
const count = after.n;
|
|
3486
|
-
const backupPath =
|
|
3508
|
+
const backupPath = path12.join(path12.dirname(TASKS_FILE), "tasks.json.migrated-from-json.backup");
|
|
3487
3509
|
try {
|
|
3488
|
-
|
|
3510
|
+
fs11.copyFileSync(TASKS_FILE, backupPath);
|
|
3489
3511
|
} catch (err) {
|
|
3490
3512
|
log.task.warn("task-db migration: backup copy failed (non-fatal)", {
|
|
3491
3513
|
path: backupPath,
|
|
@@ -3509,9 +3531,9 @@ var init_task_db_migration = __esm({
|
|
|
3509
3531
|
});
|
|
3510
3532
|
|
|
3511
3533
|
// src/core/memory-dir-migration.ts
|
|
3512
|
-
import
|
|
3534
|
+
import fs12 from "fs";
|
|
3513
3535
|
import fsp7 from "fs/promises";
|
|
3514
|
-
import
|
|
3536
|
+
import path13 from "path";
|
|
3515
3537
|
function bodyOf(content) {
|
|
3516
3538
|
const fm = content.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);
|
|
3517
3539
|
return fm ? content.slice(fm[0].length) : content;
|
|
@@ -3529,7 +3551,7 @@ ${legacyBody}
|
|
|
3529
3551
|
}
|
|
3530
3552
|
function mtimeMs(file) {
|
|
3531
3553
|
try {
|
|
3532
|
-
return
|
|
3554
|
+
return fs12.statSync(file).mtimeMs;
|
|
3533
3555
|
} catch {
|
|
3534
3556
|
return 0;
|
|
3535
3557
|
}
|
|
@@ -3538,24 +3560,24 @@ function findCandidates(root) {
|
|
|
3538
3560
|
const out = [];
|
|
3539
3561
|
let level1;
|
|
3540
3562
|
try {
|
|
3541
|
-
level1 =
|
|
3563
|
+
level1 = fs12.readdirSync(root, { withFileTypes: true });
|
|
3542
3564
|
} catch {
|
|
3543
3565
|
return out;
|
|
3544
3566
|
}
|
|
3545
3567
|
for (const cat of level1) {
|
|
3546
3568
|
if (!cat.isDirectory()) continue;
|
|
3547
|
-
const catDir =
|
|
3548
|
-
if (
|
|
3569
|
+
const catDir = path13.join(root, cat.name);
|
|
3570
|
+
if (fs12.existsSync(path13.join(catDir, MEMORY_FILE_NAME))) continue;
|
|
3549
3571
|
let level2;
|
|
3550
3572
|
try {
|
|
3551
|
-
level2 =
|
|
3573
|
+
level2 = fs12.readdirSync(catDir, { withFileTypes: true });
|
|
3552
3574
|
} catch {
|
|
3553
3575
|
continue;
|
|
3554
3576
|
}
|
|
3555
3577
|
for (const proj of level2) {
|
|
3556
3578
|
if (!proj.isDirectory()) continue;
|
|
3557
|
-
const sourceDir =
|
|
3558
|
-
if (!
|
|
3579
|
+
const sourceDir = path13.join(catDir, proj.name);
|
|
3580
|
+
if (!fs12.existsSync(path13.join(sourceDir, MEMORY_FILE_NAME))) continue;
|
|
3559
3581
|
out.push({ category: cat.name, project: proj.name, sourceDir });
|
|
3560
3582
|
}
|
|
3561
3583
|
}
|
|
@@ -3569,11 +3591,11 @@ async function drainDir(from, to) {
|
|
|
3569
3591
|
return;
|
|
3570
3592
|
}
|
|
3571
3593
|
for (const name of entries) {
|
|
3572
|
-
const target =
|
|
3573
|
-
if (
|
|
3574
|
-
await fsp7.rename(
|
|
3594
|
+
const target = path13.join(to, name);
|
|
3595
|
+
if (fs12.existsSync(target)) continue;
|
|
3596
|
+
await fsp7.rename(path13.join(from, name), target).catch((err) => {
|
|
3575
3597
|
log.memory.warn("memory-dir migration: entry move failed", {
|
|
3576
|
-
from:
|
|
3598
|
+
from: path13.join(from, name),
|
|
3577
3599
|
to: target,
|
|
3578
3600
|
error: String(err)
|
|
3579
3601
|
});
|
|
@@ -3585,23 +3607,23 @@ async function drainDir(from, to) {
|
|
|
3585
3607
|
async function migrateProjectMemoryDirs() {
|
|
3586
3608
|
const result = { ran: false, moved: 0, merged: 0 };
|
|
3587
3609
|
try {
|
|
3588
|
-
if (!
|
|
3589
|
-
if (
|
|
3610
|
+
if (!fs12.existsSync(PROJECTS_MEMORY_DIR)) return result;
|
|
3611
|
+
if (fs12.existsSync(MEMORY_DIR_MIGRATION_MARKER)) return result;
|
|
3590
3612
|
result.ran = true;
|
|
3591
3613
|
const candidates = findCandidates(PROJECTS_MEMORY_DIR);
|
|
3592
3614
|
const touchedCategories = new Set(candidates.map((c) => c.category));
|
|
3593
3615
|
for (const c of candidates) {
|
|
3594
|
-
const targetDir =
|
|
3616
|
+
const targetDir = path13.join(PROJECTS_MEMORY_DIR, c.project);
|
|
3595
3617
|
const label = `${c.category}/${c.project}`;
|
|
3596
3618
|
try {
|
|
3597
|
-
if (!
|
|
3619
|
+
if (!fs12.existsSync(targetDir)) {
|
|
3598
3620
|
await fsp7.rename(c.sourceDir, targetDir);
|
|
3599
3621
|
result.moved += 1;
|
|
3600
3622
|
continue;
|
|
3601
3623
|
}
|
|
3602
|
-
const sourceMem =
|
|
3603
|
-
const targetMem =
|
|
3604
|
-
if (!
|
|
3624
|
+
const sourceMem = path13.join(c.sourceDir, MEMORY_FILE_NAME);
|
|
3625
|
+
const targetMem = path13.join(targetDir, MEMORY_FILE_NAME);
|
|
3626
|
+
if (!fs12.existsSync(targetMem)) {
|
|
3605
3627
|
await fsp7.rename(sourceMem, targetMem);
|
|
3606
3628
|
await drainDir(c.sourceDir, targetDir);
|
|
3607
3629
|
result.moved += 1;
|
|
@@ -3623,7 +3645,7 @@ async function migrateProjectMemoryDirs() {
|
|
|
3623
3645
|
}
|
|
3624
3646
|
}
|
|
3625
3647
|
for (const cat of touchedCategories) {
|
|
3626
|
-
await fsp7.rmdir(
|
|
3648
|
+
await fsp7.rmdir(path13.join(PROJECTS_MEMORY_DIR, cat)).catch(() => {
|
|
3627
3649
|
});
|
|
3628
3650
|
}
|
|
3629
3651
|
await fsp7.writeFile(
|
|
@@ -3651,7 +3673,7 @@ var init_memory_dir_migration = __esm({
|
|
|
3651
3673
|
"use strict";
|
|
3652
3674
|
init_constants();
|
|
3653
3675
|
init_logging();
|
|
3654
|
-
MEMORY_DIR_MIGRATION_MARKER =
|
|
3676
|
+
MEMORY_DIR_MIGRATION_MARKER = path13.join(PROJECTS_MEMORY_DIR, ".migrated-project-only");
|
|
3655
3677
|
MEMORY_FILE_NAME = "MEMORY.md";
|
|
3656
3678
|
}
|
|
3657
3679
|
});
|
|
@@ -4212,7 +4234,7 @@ __export(microsoft_todo_exports, {
|
|
|
4212
4234
|
});
|
|
4213
4235
|
import * as msal from "@azure/msal-node";
|
|
4214
4236
|
import https from "https";
|
|
4215
|
-
import
|
|
4237
|
+
import path14 from "path";
|
|
4216
4238
|
function getMsTodoConfig(config) {
|
|
4217
4239
|
return config.plugins?.["ms-todo"];
|
|
4218
4240
|
}
|
|
@@ -5431,8 +5453,8 @@ var init_microsoft_todo = __esm({
|
|
|
5431
5453
|
init_format();
|
|
5432
5454
|
init_task_manager();
|
|
5433
5455
|
init_task_remote_links();
|
|
5434
|
-
TOKENS_FILE =
|
|
5435
|
-
DELTA_FILE =
|
|
5456
|
+
TOKENS_FILE = path14.join(SYNC_DIR, "ms-todo-tokens.json");
|
|
5457
|
+
DELTA_FILE = path14.join(SYNC_DIR, "ms-todo-delta.json");
|
|
5436
5458
|
GRAPH_BASE = "https://graph.microsoft.com/v1.0";
|
|
5437
5459
|
SCOPES = ["Tasks.ReadWrite"];
|
|
5438
5460
|
PRIORITY_TO_IMPORTANCE = {
|