syntaur 0.35.0 → 0.37.0
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/.claude-plugin/plugin.json +1 -1
- package/dashboard/dist/assets/{_basePickBy-BBDt2N1-.js → _basePickBy-Lh5zj1Jj.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-CX9QmA6j.js → _baseUniq-BPE2VzD5.js} +1 -1
- package/dashboard/dist/assets/{arc-CQ6470MS.js → arc-Dwo5A96L.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-q_340vb1.js → architectureDiagram-2XIMDMQ5-DHodinbk.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-DDcJVm3I.js → blockDiagram-WCTKOSBZ-BLEdeDZc.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-Bu7rCnPq.js → c4Diagram-IC4MRINW-BfxPDVhZ.js} +1 -1
- package/dashboard/dist/assets/channel-DRq7WAAN.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-D4mCzHM1.js → chunk-4BX2VUAB-lXhiTmN8.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-qZy5S9aK.js → chunk-55IACEB6-DcKyd5Ft.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-CP-aSp5R.js → chunk-FMBD7UC4-DaSQh-4I.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-Bjd2-Jbp.js → chunk-JSJVCQXG-BqCGk1hk.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-BHALK3O8.js → chunk-KX2RTZJC-x2UQCnir.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-EJgFAbBI.js → chunk-NQ4KR5QH-BaGs3F7c.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-LIJprKdb.js → chunk-QZHKN3VN-02sy1j1c.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-Bp9peutH.js → chunk-WL4C6EOR-DAzsQa_k.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-gwr79r0-.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-gwr79r0-.js +1 -0
- package/dashboard/dist/assets/clone-DihopI50.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-D2Khnalp.js → cose-bilkent-S5V4N54A-Bg5NoB5J.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-A7FKInZZ.js → dagre-KLK3FWXG-od18VoAX.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-CpCC84EE.js → diagram-E7M64L7V-BcS3Wt7S.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-UN3agGn6.js → diagram-IFDJBPK2-BgvMefc3.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-r7USVjRa.js → diagram-P4PSJMXO-DyzaWQJj.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-BqjWbP4d.js → erDiagram-INFDFZHY-BwxxYmWr.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-D3_hInoz.js → flowDiagram-PKNHOUZH-DwdUtKt0.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-Dzf0OcUQ.js → ganttDiagram-A5KZAMGK-BY36vHAR.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-DDVNfYsD.js → gitGraphDiagram-K3NZZRJ6-B1L2Nu_u.js} +1 -1
- package/dashboard/dist/assets/{graph-XQCpDL3e.js → graph-NYqxiaDD.js} +1 -1
- package/dashboard/dist/assets/{index-DTGG1F6E.js → index-B1LQxjk-.js} +2 -2
- package/dashboard/dist/assets/{index-BlO8cOgL.css → index-CZjjsaMH.css} +1 -1
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-Bn7xCldX.js → infoDiagram-LFFYTUFH-D8FSBl4v.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-BMaPOOT_.js → ishikawaDiagram-PHBUUO56-CIWtKNZw.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-CfYBwIWr.js → journeyDiagram-4ABVD52K-BgVDNTtB.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-DQoSgSWy.js → kanban-definition-K7BYSVSG-DUSPe43F.js} +1 -1
- package/dashboard/dist/assets/{layout-CFxopkD1.js → layout-DwVUSb2n.js} +1 -1
- package/dashboard/dist/assets/{linear-q1lde7uY.js → linear-C9DPjTIP.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-CclSNuh7.js → mermaid.core-CX2hHqD6.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-C_XHOwF9.js → mindmap-definition-YRQLILUH-CnqWo4vp.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-C8xZgEA3.js → pieDiagram-SKSYHLDU-BPsLJdMx.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-JZOm4MlZ.js → quadrantDiagram-337W2JSQ-Z57GbRCK.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-0o-kjUyz.js → requirementDiagram-Z7DCOOCP-BwP8mAaA.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-BQVypVuO.js → sankeyDiagram-WA2Y5GQK-CL4ioe3f.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-eHOgK4bp.js → sequenceDiagram-2WXFIKYE-BptD7Vjw.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-D08VAF0t.js → stateDiagram-RAJIS63D-Cp5RX2Hq.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-DdqWNlkA.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-BGqUaDJh.js → timeline-definition-YZTLITO2-dJrKqTxK.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-DDilTqSL.js → treemap-KZPCXAKY-CVyLDZfF.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-CGMFf3rB.js → vennDiagram-LZ73GAT5-5VumRCNt.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-DxpH1jvd.js → xychartDiagram-JWTSCODW-BkmoL9vw.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +170 -105
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/platforms/claude-code/.claude-plugin/plugin.json +1 -1
- package/platforms/claude-code/hooks/session-start.sh +47 -0
- package/platforms/codex/.codex-plugin/plugin.json +1 -1
- package/platforms/hermes/plugins/syntaur/__pycache__/__init__.cpython-312.pyc +0 -0
- package/platforms/hermes/plugins/syntaur/__pycache__/boundary.cpython-312.pyc +0 -0
- package/dashboard/dist/assets/channel-C1JmUAYK.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-CL5uYMtW.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-CL5uYMtW.js +0 -1
- package/dashboard/dist/assets/clone-BGt3nn5b.js +0 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-9uffSM-p.js +0 -1
package/dist/index.js
CHANGED
|
@@ -5382,8 +5382,8 @@ async function migrateFromMarkdown(projectsDir2) {
|
|
|
5382
5382
|
return allSessions.length;
|
|
5383
5383
|
}
|
|
5384
5384
|
async function parseMarkdownSessionsIndex(filePath, projectSlug) {
|
|
5385
|
-
const { readFile:
|
|
5386
|
-
const raw2 = await
|
|
5385
|
+
const { readFile: readFile65 } = await import("fs/promises");
|
|
5386
|
+
const raw2 = await readFile65(filePath, "utf-8");
|
|
5387
5387
|
const sessions = [];
|
|
5388
5388
|
const lines = raw2.split("\n");
|
|
5389
5389
|
let inTable = false;
|
|
@@ -16925,7 +16925,7 @@ function createTodosRouter(todosDir2, broadcast, projectsDir2) {
|
|
|
16925
16925
|
try {
|
|
16926
16926
|
const { archivePath: archivePath2 } = await Promise.resolve().then(() => (init_parser2(), parser_exports));
|
|
16927
16927
|
const { resolve: resolve87 } = await import("path");
|
|
16928
|
-
const { readFile:
|
|
16928
|
+
const { readFile: readFile65 } = await import("fs/promises");
|
|
16929
16929
|
const { writeFileForce: writeFileForce2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
16930
16930
|
const workspace = getWorkspaceParam(req.params.workspace);
|
|
16931
16931
|
const outcome = await wsLock(workspace, async () => {
|
|
@@ -16944,7 +16944,7 @@ function createTodosRouter(todosDir2, broadcast, projectsDir2) {
|
|
|
16944
16944
|
await ensureDir(resolve87(todosDir2, "archive"));
|
|
16945
16945
|
let archContent = "";
|
|
16946
16946
|
if (await fileExists(archFile)) {
|
|
16947
|
-
archContent = await
|
|
16947
|
+
archContent = await readFile65(archFile, "utf-8");
|
|
16948
16948
|
archContent = archContent.trimEnd() + "\n\n";
|
|
16949
16949
|
} else {
|
|
16950
16950
|
archContent = `---
|
|
@@ -17233,7 +17233,7 @@ workspace: ${workspace}
|
|
|
17233
17233
|
const { readConfig: readConfig3 } = await Promise.resolve().then(() => (init_config2(), config_exports));
|
|
17234
17234
|
const { assignmentsDir: assignmentsDirFn } = await Promise.resolve().then(() => (init_paths(), paths_exports));
|
|
17235
17235
|
const { fileExists: fileExists2, writeFileForce: writeFileForce2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
17236
|
-
const { readFile:
|
|
17236
|
+
const { readFile: readFile65 } = await import("fs/promises");
|
|
17237
17237
|
const { appendTodosToAssignmentBody: appendTodosToAssignmentBody2, touchAssignmentUpdated: touchAssignmentUpdated2 } = await Promise.resolve().then(() => (init_assignment_todos(), assignment_todos_exports));
|
|
17238
17238
|
const { nowTimestamp: nowTimestamp3 } = await Promise.resolve().then(() => (init_timestamp(), timestamp_exports));
|
|
17239
17239
|
let assignmentRef;
|
|
@@ -17254,7 +17254,7 @@ workspace: ${workspace}
|
|
|
17254
17254
|
}
|
|
17255
17255
|
const assignmentMdPath2 = resolvePath2(assignmentDir, "assignment.md");
|
|
17256
17256
|
if (!await fileExists2(assignmentMdPath2)) return { error: `Target assignment not found: ${assignmentMdPath2}` };
|
|
17257
|
-
let content = await
|
|
17257
|
+
let content = await readFile65(assignmentMdPath2, "utf-8");
|
|
17258
17258
|
content = appendTodosToAssignmentBody2(
|
|
17259
17259
|
content,
|
|
17260
17260
|
items.map((it) => ({
|
|
@@ -21238,6 +21238,12 @@ async function getConfiguredOrLegacyManagedPluginDir(pluginKind) {
|
|
|
21238
21238
|
}
|
|
21239
21239
|
return null;
|
|
21240
21240
|
}
|
|
21241
|
+
async function readManagedInstallVersion(pluginKind) {
|
|
21242
|
+
const dir = await getConfiguredOrLegacyManagedPluginDir(pluginKind);
|
|
21243
|
+
if (!dir) return null;
|
|
21244
|
+
const metadata = await readInstallMetadata(dir);
|
|
21245
|
+
return metadata?.packageVersion ?? null;
|
|
21246
|
+
}
|
|
21241
21247
|
async function getConfiguredOrLegacyMarketplacePath() {
|
|
21242
21248
|
const config = await readConfig();
|
|
21243
21249
|
if (config.integrations.codexMarketplacePath) {
|
|
@@ -22278,7 +22284,7 @@ function normalizeSlashes(p) {
|
|
|
22278
22284
|
}
|
|
22279
22285
|
function detectInstallKind(scriptUrl, opts = {}) {
|
|
22280
22286
|
const realpath3 = opts.realpath ?? realpathSync.native;
|
|
22281
|
-
const
|
|
22287
|
+
const readFile65 = opts.readFile ?? ((p) => readFileSync(p, "utf-8"));
|
|
22282
22288
|
const ua = opts.envUserAgent !== void 0 ? opts.envUserAgent : process.env.npm_config_user_agent ?? "";
|
|
22283
22289
|
const resolved = resolveScriptPath(scriptUrl, realpath3);
|
|
22284
22290
|
if (resolved === null) {
|
|
@@ -22299,7 +22305,7 @@ function detectInstallKind(scriptUrl, opts = {}) {
|
|
|
22299
22305
|
const pkgJsonPath = join5(dir, "package.json");
|
|
22300
22306
|
let raw2;
|
|
22301
22307
|
try {
|
|
22302
|
-
raw2 =
|
|
22308
|
+
raw2 = readFile65(pkgJsonPath);
|
|
22303
22309
|
} catch {
|
|
22304
22310
|
const parent2 = dirname12(dir);
|
|
22305
22311
|
if (parent2 === dir) break;
|
|
@@ -25865,12 +25871,12 @@ function describeScope(scope) {
|
|
|
25865
25871
|
}
|
|
25866
25872
|
async function injectPromotedTodos(assignmentDir, todos, scopeLabel) {
|
|
25867
25873
|
const { resolve: resolvePath2 } = await import("path");
|
|
25868
|
-
const { readFile:
|
|
25874
|
+
const { readFile: readFile65 } = await import("fs/promises");
|
|
25869
25875
|
const { writeFileForce: writeFileForce2 } = await Promise.resolve().then(() => (init_fs(), fs_exports));
|
|
25870
25876
|
const { appendTodosToAssignmentBody: appendTodosToAssignmentBody2, touchAssignmentUpdated: touchAssignmentUpdated2 } = await Promise.resolve().then(() => (init_assignment_todos(), assignment_todos_exports));
|
|
25871
25877
|
const { nowTimestamp: nowTimestamp3 } = await Promise.resolve().then(() => (init_timestamp(), timestamp_exports));
|
|
25872
25878
|
const assignmentMdPath2 = resolvePath2(assignmentDir, "assignment.md");
|
|
25873
|
-
let content = await
|
|
25879
|
+
let content = await readFile65(assignmentMdPath2, "utf-8");
|
|
25874
25880
|
content = appendTodosToAssignmentBody2(
|
|
25875
25881
|
content,
|
|
25876
25882
|
todos.map((t) => ({
|
|
@@ -26002,8 +26008,8 @@ async function moveTodo(id, options) {
|
|
|
26002
26008
|
throw new Error(`Plan directory already exists at target: ${newPlanDir}; refusing to move.`);
|
|
26003
26009
|
}
|
|
26004
26010
|
const { rename: rename11, mkdir: mkdir12 } = await import("fs/promises");
|
|
26005
|
-
const { dirname:
|
|
26006
|
-
await mkdir12(
|
|
26011
|
+
const { dirname: dirname26 } = await import("path");
|
|
26012
|
+
await mkdir12(dirname26(newPlanDir), { recursive: true });
|
|
26007
26013
|
await rename11(item.planDir, newPlanDir);
|
|
26008
26014
|
item.planDir = newPlanDir;
|
|
26009
26015
|
}
|
|
@@ -26120,13 +26126,13 @@ backupCommand.command("config").description("Show or update backup configuration
|
|
|
26120
26126
|
|
|
26121
26127
|
// src/commands/doctor.ts
|
|
26122
26128
|
import { Command as Command4 } from "commander";
|
|
26123
|
-
import { readFile as
|
|
26129
|
+
import { readFile as readFile47 } from "fs/promises";
|
|
26124
26130
|
import { isAbsolute as isAbsolute11, resolve as resolve69 } from "path";
|
|
26125
26131
|
|
|
26126
26132
|
// src/utils/doctor/index.ts
|
|
26127
|
-
import { fileURLToPath as
|
|
26128
|
-
import { readFile as
|
|
26129
|
-
import { dirname as
|
|
26133
|
+
import { fileURLToPath as fileURLToPath12 } from "url";
|
|
26134
|
+
import { readFile as readFile46 } from "fs/promises";
|
|
26135
|
+
import { dirname as dirname22, join as join15 } from "path";
|
|
26130
26136
|
|
|
26131
26137
|
// src/utils/doctor/context.ts
|
|
26132
26138
|
init_config2();
|
|
@@ -28699,6 +28705,64 @@ var bundleChecks = [
|
|
|
28699
28705
|
staleWorktree
|
|
28700
28706
|
];
|
|
28701
28707
|
|
|
28708
|
+
// src/utils/doctor/checks/plugin.ts
|
|
28709
|
+
import { readFile as readFile45 } from "fs/promises";
|
|
28710
|
+
import { dirname as dirname21, join as join14 } from "path";
|
|
28711
|
+
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
28712
|
+
var CATEGORY13 = "plugin";
|
|
28713
|
+
var PLUGIN_KINDS = ["claude", "codex"];
|
|
28714
|
+
async function readCliVersion() {
|
|
28715
|
+
try {
|
|
28716
|
+
let dir = dirname21(fileURLToPath11(import.meta.url));
|
|
28717
|
+
for (let i = 0; i < 8; i += 1) {
|
|
28718
|
+
try {
|
|
28719
|
+
const parsed = JSON.parse(await readFile45(join14(dir, "package.json"), "utf-8"));
|
|
28720
|
+
if (typeof parsed.version === "string" && parsed.version.length > 0) return parsed.version;
|
|
28721
|
+
} catch {
|
|
28722
|
+
}
|
|
28723
|
+
dir = dirname21(dir);
|
|
28724
|
+
}
|
|
28725
|
+
} catch {
|
|
28726
|
+
}
|
|
28727
|
+
return null;
|
|
28728
|
+
}
|
|
28729
|
+
var versionDrift = {
|
|
28730
|
+
id: "plugin.version-drift",
|
|
28731
|
+
category: CATEGORY13,
|
|
28732
|
+
title: "Installed plugin matches the CLI version",
|
|
28733
|
+
async run() {
|
|
28734
|
+
const cliVersion2 = await readCliVersion();
|
|
28735
|
+
return Promise.all(
|
|
28736
|
+
PLUGIN_KINDS.map(async (kind) => {
|
|
28737
|
+
const base = { id: this.id, category: this.category, title: this.title, affected: [kind], autoFixable: false };
|
|
28738
|
+
const label = getPluginDisplayName(kind);
|
|
28739
|
+
const installed = await readManagedInstallVersion(kind);
|
|
28740
|
+
if (installed === null) {
|
|
28741
|
+
return { ...base, status: "skipped", detail: `no managed ${label} install` };
|
|
28742
|
+
}
|
|
28743
|
+
if (!cliVersion2) {
|
|
28744
|
+
return { ...base, status: "skipped", detail: "could not read the running CLI version" };
|
|
28745
|
+
}
|
|
28746
|
+
if (installed === cliVersion2) {
|
|
28747
|
+
return { ...base, status: "pass", detail: `${label} ${installed} matches CLI` };
|
|
28748
|
+
}
|
|
28749
|
+
const command = `${getPluginInstallCommand(kind)} --force`;
|
|
28750
|
+
return {
|
|
28751
|
+
...base,
|
|
28752
|
+
status: "warn",
|
|
28753
|
+
detail: `installed ${label} v${installed} differs from CLI v${cliVersion2}`,
|
|
28754
|
+
remediation: {
|
|
28755
|
+
kind: "manual",
|
|
28756
|
+
suggestion: `Re-run \`${command}\` to refresh the ${label}`,
|
|
28757
|
+
command
|
|
28758
|
+
}
|
|
28759
|
+
};
|
|
28760
|
+
})
|
|
28761
|
+
);
|
|
28762
|
+
}
|
|
28763
|
+
};
|
|
28764
|
+
var pluginChecks = [versionDrift];
|
|
28765
|
+
|
|
28702
28766
|
// src/utils/doctor/registry.ts
|
|
28703
28767
|
function allChecks() {
|
|
28704
28768
|
return [
|
|
@@ -28713,7 +28777,8 @@ function allChecks() {
|
|
|
28713
28777
|
...terminalChecks,
|
|
28714
28778
|
...skillsChecks,
|
|
28715
28779
|
...crossAgentChecks,
|
|
28716
|
-
...bundleChecks
|
|
28780
|
+
...bundleChecks,
|
|
28781
|
+
...pluginChecks
|
|
28717
28782
|
];
|
|
28718
28783
|
}
|
|
28719
28784
|
|
|
@@ -28795,15 +28860,15 @@ async function finalize(checks) {
|
|
|
28795
28860
|
}
|
|
28796
28861
|
async function readVersion() {
|
|
28797
28862
|
try {
|
|
28798
|
-
const here =
|
|
28799
|
-
let dir =
|
|
28863
|
+
const here = fileURLToPath12(import.meta.url);
|
|
28864
|
+
let dir = dirname22(here);
|
|
28800
28865
|
for (let i = 0; i < 6; i++) {
|
|
28801
28866
|
try {
|
|
28802
|
-
const raw2 = await
|
|
28867
|
+
const raw2 = await readFile46(join15(dir, "package.json"), "utf-8");
|
|
28803
28868
|
const parsed = JSON.parse(raw2);
|
|
28804
28869
|
return typeof parsed.version === "string" ? parsed.version : null;
|
|
28805
28870
|
} catch {
|
|
28806
|
-
dir =
|
|
28871
|
+
dir = dirname22(dir);
|
|
28807
28872
|
}
|
|
28808
28873
|
}
|
|
28809
28874
|
return null;
|
|
@@ -28909,7 +28974,7 @@ async function validateAssignmentFile(inputPath, cwd = process.cwd()) {
|
|
|
28909
28974
|
}
|
|
28910
28975
|
let content;
|
|
28911
28976
|
try {
|
|
28912
|
-
content = await
|
|
28977
|
+
content = await readFile47(absolute, "utf-8");
|
|
28913
28978
|
} catch (err2) {
|
|
28914
28979
|
return {
|
|
28915
28980
|
ok: false,
|
|
@@ -29234,7 +29299,7 @@ init_timestamp();
|
|
|
29234
29299
|
init_assignment_resolver();
|
|
29235
29300
|
init_templates();
|
|
29236
29301
|
import { resolve as resolve70 } from "path";
|
|
29237
|
-
import { readFile as
|
|
29302
|
+
import { readFile as readFile48 } from "fs/promises";
|
|
29238
29303
|
function shortId() {
|
|
29239
29304
|
return generateId().split("-")[0];
|
|
29240
29305
|
}
|
|
@@ -29280,7 +29345,7 @@ async function commentCommand(target, text, options = {}) {
|
|
|
29280
29345
|
let currentContent;
|
|
29281
29346
|
let currentCount = 0;
|
|
29282
29347
|
if (await fileExists(commentsPath)) {
|
|
29283
|
-
currentContent = await
|
|
29348
|
+
currentContent = await readFile48(commentsPath, "utf-8");
|
|
29284
29349
|
const countMatch = currentContent.match(/^entryCount:\s*(\d+)/m);
|
|
29285
29350
|
if (countMatch) currentCount = parseInt(countMatch[1], 10);
|
|
29286
29351
|
} else {
|
|
@@ -29314,7 +29379,7 @@ ${entry}`;
|
|
|
29314
29379
|
}
|
|
29315
29380
|
|
|
29316
29381
|
// src/commands/capture.ts
|
|
29317
|
-
import { resolve as resolve74, relative as relative4, dirname as
|
|
29382
|
+
import { resolve as resolve74, relative as relative4, dirname as dirname23 } from "path";
|
|
29318
29383
|
import { copyFile as copyFile3, mkdir as mkdir11, realpath as realpath2, rm as rm13, stat as stat9, writeFile as writeFile15 } from "fs/promises";
|
|
29319
29384
|
import { existsSync as existsSync6 } from "fs";
|
|
29320
29385
|
|
|
@@ -29326,7 +29391,7 @@ init_slug();
|
|
|
29326
29391
|
init_assignment_resolver();
|
|
29327
29392
|
init_parser();
|
|
29328
29393
|
import { resolve as resolve71 } from "path";
|
|
29329
|
-
import { readFile as
|
|
29394
|
+
import { readFile as readFile49 } from "fs/promises";
|
|
29330
29395
|
var AssignmentTargetError = class extends Error {
|
|
29331
29396
|
};
|
|
29332
29397
|
function classifyContext(ctx) {
|
|
@@ -29341,7 +29406,7 @@ async function readAssignmentFrontmatterId(assignmentDir) {
|
|
|
29341
29406
|
const path = resolve71(assignmentDir, "assignment.md");
|
|
29342
29407
|
if (!await fileExists(path)) return null;
|
|
29343
29408
|
try {
|
|
29344
|
-
const content = await
|
|
29409
|
+
const content = await readFile49(path, "utf-8");
|
|
29345
29410
|
const [fm] = extractFrontmatter(content);
|
|
29346
29411
|
return getField(fm, "id");
|
|
29347
29412
|
} catch {
|
|
@@ -29352,7 +29417,7 @@ async function readContextJson(cwd) {
|
|
|
29352
29417
|
const path = resolve71(cwd, ".syntaur", "context.json");
|
|
29353
29418
|
if (!await fileExists(path)) return null;
|
|
29354
29419
|
try {
|
|
29355
|
-
const raw2 = await
|
|
29420
|
+
const raw2 = await readFile49(path, "utf-8");
|
|
29356
29421
|
return JSON.parse(raw2);
|
|
29357
29422
|
} catch {
|
|
29358
29423
|
return null;
|
|
@@ -29479,7 +29544,7 @@ init_fs();
|
|
|
29479
29544
|
import { spawn as spawn7 } from "child_process";
|
|
29480
29545
|
import { mkdtemp as mkdtemp2, rm as rm9, stat as stat7 } from "fs/promises";
|
|
29481
29546
|
import { tmpdir as tmpdir3 } from "os";
|
|
29482
|
-
import { join as
|
|
29547
|
+
import { join as join16 } from "path";
|
|
29483
29548
|
function argsFor(mode, pngPath) {
|
|
29484
29549
|
switch (mode) {
|
|
29485
29550
|
case "interactive":
|
|
@@ -29512,8 +29577,8 @@ async function captureScreenshot(mode) {
|
|
|
29512
29577
|
"screencapture is only available on macOS. Use --file <path> to attach an existing image."
|
|
29513
29578
|
);
|
|
29514
29579
|
}
|
|
29515
|
-
const tmpDir = await mkdtemp2(
|
|
29516
|
-
const pngPath =
|
|
29580
|
+
const tmpDir = await mkdtemp2(join16(tmpdir3(), "syntaur-screenshot-"));
|
|
29581
|
+
const pngPath = join16(tmpDir, "shot.png");
|
|
29517
29582
|
const cleanup = async () => {
|
|
29518
29583
|
await rm9(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
29519
29584
|
});
|
|
@@ -29551,9 +29616,9 @@ async function captureScreenshot(mode) {
|
|
|
29551
29616
|
|
|
29552
29617
|
// src/utils/asciinema.ts
|
|
29553
29618
|
import { spawn as spawn8 } from "child_process";
|
|
29554
|
-
import { mkdtemp as mkdtemp3, readFile as
|
|
29619
|
+
import { mkdtemp as mkdtemp3, readFile as readFile50, rm as rm10 } from "fs/promises";
|
|
29555
29620
|
import { tmpdir as tmpdir4 } from "os";
|
|
29556
|
-
import { join as
|
|
29621
|
+
import { join as join17 } from "path";
|
|
29557
29622
|
var SAFE_RE = /^[A-Za-z0-9_@%+=:,./-]+$/;
|
|
29558
29623
|
function shellQuote2(s) {
|
|
29559
29624
|
if (s.length === 0) return `''`;
|
|
@@ -29590,8 +29655,8 @@ function runAsciinema(args, stdio) {
|
|
|
29590
29655
|
});
|
|
29591
29656
|
}
|
|
29592
29657
|
async function captureAsciinema(opts) {
|
|
29593
|
-
const tmpDir = await mkdtemp3(
|
|
29594
|
-
const castPath =
|
|
29658
|
+
const tmpDir = await mkdtemp3(join17(tmpdir4(), "syntaur-asciinema-"));
|
|
29659
|
+
const castPath = join17(tmpDir, "session.cast");
|
|
29595
29660
|
const cleanup = async () => {
|
|
29596
29661
|
await rm10(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
29597
29662
|
});
|
|
@@ -29614,7 +29679,7 @@ async function captureAsciinema(opts) {
|
|
|
29614
29679
|
}
|
|
29615
29680
|
throw err2;
|
|
29616
29681
|
}
|
|
29617
|
-
const text = await
|
|
29682
|
+
const text = await readFile50(castPath, "utf8").catch(() => null);
|
|
29618
29683
|
if (text === null) {
|
|
29619
29684
|
throw new Error(
|
|
29620
29685
|
`asciinema produced no cast file at ${castPath} (exit ${exitCode}). Try running 'asciinema rec ${castPath}' directly to diagnose.`
|
|
@@ -29642,9 +29707,9 @@ async function captureAsciinema(opts) {
|
|
|
29642
29707
|
// src/utils/recording.ts
|
|
29643
29708
|
init_paths();
|
|
29644
29709
|
import { spawn as spawn9 } from "child_process";
|
|
29645
|
-
import { mkdir as mkdir10, mkdtemp as mkdtemp4, open as open3, readFile as
|
|
29710
|
+
import { mkdir as mkdir10, mkdtemp as mkdtemp4, open as open3, readFile as readFile51, rm as rm11, stat as stat8, unlink as unlink10, writeFile as writeFile14 } from "fs/promises";
|
|
29646
29711
|
import { tmpdir as tmpdir5 } from "os";
|
|
29647
|
-
import { join as
|
|
29712
|
+
import { join as join18, resolve as resolve72 } from "path";
|
|
29648
29713
|
import { setTimeout as sleep } from "timers/promises";
|
|
29649
29714
|
function sigintPollIntervalMs() {
|
|
29650
29715
|
const raw2 = process.env.SYNTAUR_RECORDING_POLL_INTERVAL_MS;
|
|
@@ -29716,7 +29781,7 @@ async function acquirePidfile(pidfile) {
|
|
|
29716
29781
|
} catch (err2) {
|
|
29717
29782
|
if (err2.code !== "EEXIST") throw err2;
|
|
29718
29783
|
if (attempt === 1) throw err2;
|
|
29719
|
-
const existing = (await
|
|
29784
|
+
const existing = (await readFile51(pidfile, "utf-8").catch(() => "")).trim();
|
|
29720
29785
|
if (existing.startsWith(STARTING_SENTINEL_PREFIX)) {
|
|
29721
29786
|
const parentPidRaw = existing.slice(STARTING_SENTINEL_PREFIX.length);
|
|
29722
29787
|
const parentPid = Number.parseInt(parentPidRaw, 10);
|
|
@@ -29769,8 +29834,8 @@ async function startRecording(input4) {
|
|
|
29769
29834
|
let acquiredPid = null;
|
|
29770
29835
|
try {
|
|
29771
29836
|
logHandle = await open3(log, "w");
|
|
29772
|
-
tmpDir = await mkdtemp4(
|
|
29773
|
-
const mp4Path =
|
|
29837
|
+
tmpDir = await mkdtemp4(join18(tmpdir5(), "syntaur-recording-"));
|
|
29838
|
+
const mp4Path = join18(tmpDir, "recording.mp4");
|
|
29774
29839
|
let child;
|
|
29775
29840
|
try {
|
|
29776
29841
|
child = spawn9("ffmpeg", ffmpegArgs(input4.device, input4.fps, mp4Path), {
|
|
@@ -29818,7 +29883,7 @@ async function startRecording(input4) {
|
|
|
29818
29883
|
logHandle = null;
|
|
29819
29884
|
if (warmupMs > 0) await sleep(warmupMs);
|
|
29820
29885
|
if (!await isProcessAlive(pid)) {
|
|
29821
|
-
const tail = await
|
|
29886
|
+
const tail = await readFile51(log, "utf-8").then((s) => s.split("\n").slice(-20).join("\n")).catch(() => "");
|
|
29822
29887
|
acquiredPid = null;
|
|
29823
29888
|
throw new Error(
|
|
29824
29889
|
`ffmpeg exited during startup \u2014 likely macOS Screen Recording permission missing. Grant access to your terminal in System Settings \u2192 Privacy & Security \u2192 Screen Recording, then retry. Log: ${log}
|
|
@@ -29875,7 +29940,7 @@ ${tail}`
|
|
|
29875
29940
|
async function stopRecording() {
|
|
29876
29941
|
const pidfile = pidfilePath();
|
|
29877
29942
|
const sidecar = sidecarPath();
|
|
29878
|
-
const pidRaw = await
|
|
29943
|
+
const pidRaw = await readFile51(pidfile, "utf-8").catch(() => null);
|
|
29879
29944
|
if (pidRaw === null) {
|
|
29880
29945
|
throw new Error(
|
|
29881
29946
|
`No active recording found (no pidfile at ${pidfile}). Did you run --start?`
|
|
@@ -29885,7 +29950,7 @@ async function stopRecording() {
|
|
|
29885
29950
|
if (!Number.isInteger(pid) || pid <= 0) {
|
|
29886
29951
|
throw new Error(`Pidfile at ${pidfile} is corrupt (got "${pidRaw}").`);
|
|
29887
29952
|
}
|
|
29888
|
-
const sidecarRaw = await
|
|
29953
|
+
const sidecarRaw = await readFile51(sidecar, "utf-8").catch(() => null);
|
|
29889
29954
|
if (sidecarRaw === null) {
|
|
29890
29955
|
throw new Error(
|
|
29891
29956
|
`No recording sidecar at ${sidecar}. The recording state is inconsistent \u2014 delete ${pidfile} and re-run --start.`
|
|
@@ -30018,9 +30083,9 @@ function listArtifactsByAssignment(assignmentId) {
|
|
|
30018
30083
|
|
|
30019
30084
|
// src/utils/transcribers/elevenlabs.ts
|
|
30020
30085
|
import { spawn as spawn10 } from "child_process";
|
|
30021
|
-
import { mkdtemp as mkdtemp5, readFile as
|
|
30086
|
+
import { mkdtemp as mkdtemp5, readFile as readFile52, rm as rm12 } from "fs/promises";
|
|
30022
30087
|
import { tmpdir as tmpdir6 } from "os";
|
|
30023
|
-
import { join as
|
|
30088
|
+
import { join as join19 } from "path";
|
|
30024
30089
|
var SCRIBE_URL = "https://api.elevenlabs.io/v1/speech-to-text";
|
|
30025
30090
|
var NO_AUDIO_MARKERS = [
|
|
30026
30091
|
"Stream map '0:a:0' matches no streams",
|
|
@@ -30082,7 +30147,7 @@ async function extractAudio(videoAbsPath, wavOut) {
|
|
|
30082
30147
|
throw new TranscribeFfmpegError(`ffmpeg failed (exit ${result.code}): ${tail}`);
|
|
30083
30148
|
}
|
|
30084
30149
|
async function callScribe(wavPath, apiKey, opts) {
|
|
30085
|
-
const audio = await
|
|
30150
|
+
const audio = await readFile52(wavPath);
|
|
30086
30151
|
const form = new FormData();
|
|
30087
30152
|
form.set("file", new Blob([new Uint8Array(audio)], { type: "audio/wav" }), "audio.wav");
|
|
30088
30153
|
form.set("model_id", "scribe_v1");
|
|
@@ -30110,8 +30175,8 @@ var elevenLabsScribe = {
|
|
|
30110
30175
|
"ELEVENLABS_API_KEY is not set. Export it (e.g. `export ELEVENLABS_API_KEY=\u2026`) and re-run. A config-file slot will land later."
|
|
30111
30176
|
);
|
|
30112
30177
|
}
|
|
30113
|
-
const tmp = await mkdtemp5(
|
|
30114
|
-
const wav =
|
|
30178
|
+
const tmp = await mkdtemp5(join19(tmpdir6(), "syntaur-transcribe-"));
|
|
30179
|
+
const wav = join19(tmp, "audio.wav");
|
|
30115
30180
|
try {
|
|
30116
30181
|
await extractAudio(videoAbsPath, wav);
|
|
30117
30182
|
return await callScribe(wav, apiKey, opts);
|
|
@@ -30385,7 +30450,7 @@ async function captureCommand(target, options = {}) {
|
|
|
30385
30450
|
criterionIndex = sidecar.criterionIndex;
|
|
30386
30451
|
stopNote = sidecar.note;
|
|
30387
30452
|
resolvedSource = mp4Path;
|
|
30388
|
-
const mp4TmpDir =
|
|
30453
|
+
const mp4TmpDir = dirname23(mp4Path);
|
|
30389
30454
|
shelloutCleanup = async () => {
|
|
30390
30455
|
await rm13(mp4TmpDir, { recursive: true, force: true }).catch(() => {
|
|
30391
30456
|
});
|
|
@@ -30547,8 +30612,8 @@ async function captureCommand(target, options = {}) {
|
|
|
30547
30612
|
|
|
30548
30613
|
// src/commands/proof.ts
|
|
30549
30614
|
import { Command as Command6 } from "commander";
|
|
30550
|
-
import { readFile as
|
|
30551
|
-
import { resolve as resolve75, relative as relative5, isAbsolute as isAbsolute12, dirname as
|
|
30615
|
+
import { readFile as readFile53, writeFile as writeFile16, rename as rename10, stat as stat10 } from "fs/promises";
|
|
30616
|
+
import { resolve as resolve75, relative as relative5, isAbsolute as isAbsolute12, dirname as dirname24 } from "path";
|
|
30552
30617
|
import { randomBytes as randomBytes4 } from "crypto";
|
|
30553
30618
|
|
|
30554
30619
|
// src/utils/acceptance-criteria-parse.ts
|
|
@@ -30792,7 +30857,7 @@ async function readAssignmentMeta(assignmentDir) {
|
|
|
30792
30857
|
if (!await fileExists(path)) {
|
|
30793
30858
|
return { title: "", body: "" };
|
|
30794
30859
|
}
|
|
30795
|
-
const content = await
|
|
30860
|
+
const content = await readFile53(path, "utf-8");
|
|
30796
30861
|
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
|
|
30797
30862
|
let title = "";
|
|
30798
30863
|
if (fmMatch) {
|
|
@@ -30854,7 +30919,7 @@ async function loadInlineFiles(rows, assignmentDir) {
|
|
|
30854
30919
|
continue;
|
|
30855
30920
|
}
|
|
30856
30921
|
try {
|
|
30857
|
-
out.set(r.file_path, await
|
|
30922
|
+
out.set(r.file_path, await readFile53(abs, "utf-8"));
|
|
30858
30923
|
} catch {
|
|
30859
30924
|
out.set(r.file_path, null);
|
|
30860
30925
|
}
|
|
@@ -30867,13 +30932,13 @@ async function loadTranscriptSidecars(rows, assignmentDir) {
|
|
|
30867
30932
|
for (const r of rows) {
|
|
30868
30933
|
if (r.kind !== "video" || !r.file_path) continue;
|
|
30869
30934
|
const videoAbs = resolve75(assignmentDir, r.file_path);
|
|
30870
|
-
const sidecar = resolve75(
|
|
30935
|
+
const sidecar = resolve75(dirname24(videoAbs), `${r.id}.transcript.md`);
|
|
30871
30936
|
if (!isWithin(proofRoot, sidecar)) continue;
|
|
30872
30937
|
if (!await fileExists(sidecar)) continue;
|
|
30873
30938
|
const st = await stat10(sidecar);
|
|
30874
30939
|
if (st.size > INLINE_TEXT_LIMIT_BYTES) continue;
|
|
30875
30940
|
try {
|
|
30876
|
-
out.set(r.id, await
|
|
30941
|
+
out.set(r.id, await readFile53(sidecar, "utf-8"));
|
|
30877
30942
|
} catch {
|
|
30878
30943
|
}
|
|
30879
30944
|
}
|
|
@@ -31632,7 +31697,7 @@ function isoToCcusageDate(iso) {
|
|
|
31632
31697
|
// src/usage/cwd-extractor.ts
|
|
31633
31698
|
init_paths();
|
|
31634
31699
|
import { open as open4, readdir as readdir26, stat as stat11 } from "fs/promises";
|
|
31635
|
-
import { join as
|
|
31700
|
+
import { join as join20 } from "path";
|
|
31636
31701
|
import { homedir as homedir12 } from "os";
|
|
31637
31702
|
var SCAN_LINE_CAP = 50;
|
|
31638
31703
|
var TAIL_READ_BYTES = 8 * 1024;
|
|
@@ -31709,12 +31774,12 @@ async function* walkClaudeProjects(opts = {}) {
|
|
|
31709
31774
|
const dirs = await listDirSafe(root);
|
|
31710
31775
|
for (const dirent of dirs) {
|
|
31711
31776
|
if (!dirent.isDirectory) continue;
|
|
31712
|
-
const dirPath =
|
|
31777
|
+
const dirPath = join20(root, dirent.name);
|
|
31713
31778
|
const files = await listDirSafe(dirPath);
|
|
31714
31779
|
let cachedCwd = null;
|
|
31715
31780
|
for (const f of files) {
|
|
31716
31781
|
if (!f.isFile || !f.name.endsWith(".jsonl")) continue;
|
|
31717
|
-
const filePath =
|
|
31782
|
+
const filePath = join20(dirPath, f.name);
|
|
31718
31783
|
if (opts.sinceMtimeMs !== void 0) {
|
|
31719
31784
|
const mtime = await mtimeMs(filePath);
|
|
31720
31785
|
if (mtime !== null && mtime < opts.sinceMtimeMs) continue;
|
|
@@ -31751,8 +31816,8 @@ function resolveCodexSessionsRoot(override) {
|
|
|
31751
31816
|
const fromSessionsEnv = process.env.CODEX_SESSIONS_DIR;
|
|
31752
31817
|
if (fromSessionsEnv && fromSessionsEnv.length > 0) return expandHome(fromSessionsEnv);
|
|
31753
31818
|
const fromHomeEnv = process.env.CODEX_HOME;
|
|
31754
|
-
if (fromHomeEnv && fromHomeEnv.length > 0) return
|
|
31755
|
-
return
|
|
31819
|
+
if (fromHomeEnv && fromHomeEnv.length > 0) return join20(expandHome(fromHomeEnv), "sessions");
|
|
31820
|
+
return join20(homedir12(), ".codex", "sessions");
|
|
31756
31821
|
}
|
|
31757
31822
|
async function listDirSafe(path) {
|
|
31758
31823
|
try {
|
|
@@ -31772,7 +31837,7 @@ async function* walkJsonlRecursive(root) {
|
|
|
31772
31837
|
const current = stack.pop();
|
|
31773
31838
|
const entries = await listDirSafe(current);
|
|
31774
31839
|
for (const e of entries) {
|
|
31775
|
-
const full =
|
|
31840
|
+
const full = join20(current, e.name);
|
|
31776
31841
|
if (e.isDirectory) {
|
|
31777
31842
|
stack.push(full);
|
|
31778
31843
|
} else if (e.isFile && e.name.endsWith(".jsonl")) {
|
|
@@ -32112,7 +32177,7 @@ init_timestamp();
|
|
|
32112
32177
|
init_assignment_resolver();
|
|
32113
32178
|
init_assignment_todos();
|
|
32114
32179
|
import { resolve as resolve76 } from "path";
|
|
32115
|
-
import { readFile as
|
|
32180
|
+
import { readFile as readFile54 } from "fs/promises";
|
|
32116
32181
|
async function requestCommand(target, text, options = {}) {
|
|
32117
32182
|
if (!text || !text.trim()) {
|
|
32118
32183
|
throw new Error("Request text cannot be empty.");
|
|
@@ -32143,7 +32208,7 @@ async function requestCommand(target, text, options = {}) {
|
|
|
32143
32208
|
throw new Error(`assignment.md not found at ${assignmentMdPath2}`);
|
|
32144
32209
|
}
|
|
32145
32210
|
const source = options.from ?? process.env.SYNTAUR_ASSIGNMENT ?? "unknown";
|
|
32146
|
-
let content = await
|
|
32211
|
+
let content = await readFile54(assignmentMdPath2, "utf-8");
|
|
32147
32212
|
content = appendTodosToAssignmentBody(content, [
|
|
32148
32213
|
{ description: `${text.trim()} (from: ${source})` }
|
|
32149
32214
|
]);
|
|
@@ -32157,13 +32222,13 @@ init_fs();
|
|
|
32157
32222
|
init_paths();
|
|
32158
32223
|
init_config2();
|
|
32159
32224
|
import { Command as Command9 } from "commander";
|
|
32160
|
-
import { readFile as
|
|
32225
|
+
import { readFile as readFile55, readdir as readdir27 } from "fs/promises";
|
|
32161
32226
|
import { resolve as resolve77 } from "path";
|
|
32162
32227
|
async function readContextAssignmentDir(cwd) {
|
|
32163
32228
|
const path = resolve77(cwd, ".syntaur", "context.json");
|
|
32164
32229
|
if (!await fileExists(path)) return null;
|
|
32165
32230
|
try {
|
|
32166
|
-
const raw2 = await
|
|
32231
|
+
const raw2 = await readFile55(path, "utf-8");
|
|
32167
32232
|
const ctx = JSON.parse(raw2);
|
|
32168
32233
|
if (typeof ctx.assignmentDir === "string" && ctx.assignmentDir.length > 0) {
|
|
32169
32234
|
return ctx.assignmentDir;
|
|
@@ -32385,7 +32450,7 @@ async function runPlanCreate(options) {
|
|
|
32385
32450
|
"plan.md already exists. Use --force to overwrite, or `syntaur plan version` to create the next version."
|
|
32386
32451
|
);
|
|
32387
32452
|
}
|
|
32388
|
-
const assignmentMd = await
|
|
32453
|
+
const assignmentMd = await readFile55(assignmentMdPath2, "utf-8");
|
|
32389
32454
|
const slugMatch = assignmentMd.match(/^slug:\s*(.+?)\s*$/m);
|
|
32390
32455
|
const slug = slugMatch ? slugMatch[1].trim() : assignmentDir.split("/").pop() ?? "";
|
|
32391
32456
|
await writeFileForce(planPath, buildInitialPlanStub(slug));
|
|
@@ -32421,11 +32486,11 @@ async function runPlanVersion(options) {
|
|
|
32421
32486
|
if (await fileExists(newPath) && !options.force) {
|
|
32422
32487
|
throw new Error(`${next.fileName} already exists. Use --force to overwrite.`);
|
|
32423
32488
|
}
|
|
32424
|
-
const assignmentMd = await
|
|
32489
|
+
const assignmentMd = await readFile55(assignmentMdPath2, "utf-8");
|
|
32425
32490
|
const slugMatch = assignmentMd.match(/^slug:\s*(.+?)\s*$/m);
|
|
32426
32491
|
const slug = slugMatch ? slugMatch[1].trim() : assignmentDir.split("/").pop() ?? "";
|
|
32427
32492
|
const oldPlanPath = resolve77(assignmentDir, current.fileName);
|
|
32428
|
-
const oldPlanContent = await
|
|
32493
|
+
const oldPlanContent = await readFile55(oldPlanPath, "utf-8");
|
|
32429
32494
|
const oldBody = oldPlanContent.replace(/^---[\s\S]*?\n---\n?/, "");
|
|
32430
32495
|
const carriedTodos = extractUncheckedTodos(oldBody);
|
|
32431
32496
|
const stub = buildNewPlanStub({
|
|
@@ -32473,14 +32538,14 @@ init_paths();
|
|
|
32473
32538
|
init_config2();
|
|
32474
32539
|
init_timestamp();
|
|
32475
32540
|
import { Command as Command10 } from "commander";
|
|
32476
|
-
import { readFile as
|
|
32541
|
+
import { readFile as readFile56, readdir as readdir28, stat as stat12 } from "fs/promises";
|
|
32477
32542
|
import { resolve as resolve78 } from "path";
|
|
32478
32543
|
|
|
32479
32544
|
// src/utils/session-id.ts
|
|
32480
32545
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
32481
32546
|
import { mkdirSync as mkdirSync3, readFileSync as readFileSync2, statSync as statSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
32482
32547
|
import { homedir as homedir13 } from "os";
|
|
32483
|
-
import { dirname as
|
|
32548
|
+
import { dirname as dirname25, join as join21 } from "path";
|
|
32484
32549
|
var SESSION_ID_ENV_VARS = [
|
|
32485
32550
|
"CLAUDE_CODE_SESSION_ID",
|
|
32486
32551
|
"OPENCODE_SESSION_ID",
|
|
@@ -32512,7 +32577,7 @@ function defaultStatMtimeMs(path) {
|
|
|
32512
32577
|
}
|
|
32513
32578
|
function readRuntimeMarker(pid, dir) {
|
|
32514
32579
|
if (!Number.isInteger(pid) || pid <= 0) return null;
|
|
32515
|
-
const path =
|
|
32580
|
+
const path = join21(dir, `${pid}.json`);
|
|
32516
32581
|
try {
|
|
32517
32582
|
const parsed = JSON.parse(readFileSync2(path, "utf8"));
|
|
32518
32583
|
if (parsed && typeof parsed === "object" && typeof parsed.sessionId === "string" && parsed.sessionId.length > 0) {
|
|
@@ -32571,8 +32636,8 @@ async function resolveOwnSessionId(opts = {}, deps = {}) {
|
|
|
32571
32636
|
const sideChannel = await resolveSideChannelSessionId(opts, deps);
|
|
32572
32637
|
if (sideChannel) return sideChannel;
|
|
32573
32638
|
const home2 = deps.homeDir ?? homedir13();
|
|
32574
|
-
const claudeSessionsDir = deps.claudeSessionsDir ??
|
|
32575
|
-
const runtimeSessionsDir = deps.runtimeSessionsDir ??
|
|
32639
|
+
const claudeSessionsDir = deps.claudeSessionsDir ?? join21(home2, ".claude", "sessions");
|
|
32640
|
+
const runtimeSessionsDir = deps.runtimeSessionsDir ?? join21(home2, ".syntaur", "runtime", "sessions");
|
|
32576
32641
|
const startPid = deps.startPid ?? process.ppid;
|
|
32577
32642
|
const fromMarker = resolveFromAncestorMarkers(
|
|
32578
32643
|
startPid,
|
|
@@ -32596,7 +32661,7 @@ async function readContext(cwd) {
|
|
|
32596
32661
|
const path = resolve78(cwd, ".syntaur", "context.json");
|
|
32597
32662
|
if (!await fileExists(path)) return null;
|
|
32598
32663
|
try {
|
|
32599
|
-
const raw2 = await
|
|
32664
|
+
const raw2 = await readFile56(path, "utf-8");
|
|
32600
32665
|
return JSON.parse(raw2);
|
|
32601
32666
|
} catch {
|
|
32602
32667
|
return null;
|
|
@@ -32621,7 +32686,7 @@ async function findLatestSessionSummary(assignmentDir) {
|
|
|
32621
32686
|
async function findOpenHandoff(assignmentDir) {
|
|
32622
32687
|
const handoffPath = resolve78(assignmentDir, "handoff.md");
|
|
32623
32688
|
if (!await fileExists(handoffPath)) return null;
|
|
32624
|
-
const content = await
|
|
32689
|
+
const content = await readFile56(handoffPath, "utf-8");
|
|
32625
32690
|
const body = content.replace(/^---[\s\S]*?\n---\n?/, "").trim();
|
|
32626
32691
|
if (body.length === 0) return null;
|
|
32627
32692
|
if (/^<!--[\s\S]*-->$/.test(body)) return null;
|
|
@@ -32781,13 +32846,13 @@ async function runSessionSave(options, cwd = process.cwd(), body) {
|
|
|
32781
32846
|
const now = nowTimestamp();
|
|
32782
32847
|
let created = now;
|
|
32783
32848
|
if (await fileExists(summaryPath)) {
|
|
32784
|
-
const existing = await
|
|
32849
|
+
const existing = await readFile56(summaryPath, "utf-8");
|
|
32785
32850
|
created = extractCreated(existing) ?? now;
|
|
32786
32851
|
}
|
|
32787
32852
|
let sectionBody = body;
|
|
32788
32853
|
if (sectionBody === void 0) {
|
|
32789
32854
|
if (options.fromFile) {
|
|
32790
|
-
sectionBody = await
|
|
32855
|
+
sectionBody = await readFile56(resolve78(cwd, options.fromFile), "utf-8");
|
|
32791
32856
|
} else {
|
|
32792
32857
|
sectionBody = await readStdin();
|
|
32793
32858
|
}
|
|
@@ -32847,13 +32912,13 @@ init_config2();
|
|
|
32847
32912
|
init_timestamp();
|
|
32848
32913
|
init_frontmatter();
|
|
32849
32914
|
import { Command as Command11 } from "commander";
|
|
32850
|
-
import { readFile as
|
|
32915
|
+
import { readFile as readFile57 } from "fs/promises";
|
|
32851
32916
|
import { resolve as resolve79 } from "path";
|
|
32852
32917
|
async function readContext2(cwd) {
|
|
32853
32918
|
const path = resolve79(cwd, ".syntaur", "context.json");
|
|
32854
32919
|
if (!await fileExists(path)) return null;
|
|
32855
32920
|
try {
|
|
32856
|
-
return JSON.parse(await
|
|
32921
|
+
return JSON.parse(await readFile57(path, "utf-8"));
|
|
32857
32922
|
} catch {
|
|
32858
32923
|
return null;
|
|
32859
32924
|
}
|
|
@@ -32908,7 +32973,7 @@ async function runWorktreeRemove(options, cwd = process.cwd()) {
|
|
|
32908
32973
|
if (!await fileExists(assignmentPath)) {
|
|
32909
32974
|
throw new Error(`Assignment file not found: ${assignmentPath}`);
|
|
32910
32975
|
}
|
|
32911
|
-
const original = await
|
|
32976
|
+
const original = await readFile57(assignmentPath, "utf-8");
|
|
32912
32977
|
const fm = parseAssignmentFrontmatter(original);
|
|
32913
32978
|
const repository = options.repository ?? fm.workspace.repository ?? void 0;
|
|
32914
32979
|
const worktreePath = fm.workspace.worktreePath ?? void 0;
|
|
@@ -33008,12 +33073,12 @@ init_fs();
|
|
|
33008
33073
|
init_slug();
|
|
33009
33074
|
import { Command as Command12 } from "commander";
|
|
33010
33075
|
import { resolve as resolve81 } from "path";
|
|
33011
|
-
import { readFile as
|
|
33076
|
+
import { readFile as readFile59, readdir as readdir30, rm as rm14 } from "fs/promises";
|
|
33012
33077
|
|
|
33013
33078
|
// src/utils/project-indexes.ts
|
|
33014
33079
|
init_parser();
|
|
33015
33080
|
init_fs();
|
|
33016
|
-
import { readdir as readdir29, readFile as
|
|
33081
|
+
import { readdir as readdir29, readFile as readFile58 } from "fs/promises";
|
|
33017
33082
|
import { resolve as resolve80 } from "path";
|
|
33018
33083
|
function nowIso3() {
|
|
33019
33084
|
return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
@@ -33049,7 +33114,7 @@ async function rebuildResourcesIndex(projectDir) {
|
|
|
33049
33114
|
lines.push("| Name | Category | Source | Related Assignments | Updated |");
|
|
33050
33115
|
lines.push("|------|----------|--------|---------------------|---------|");
|
|
33051
33116
|
for (const fileName of files) {
|
|
33052
|
-
const content = await
|
|
33117
|
+
const content = await readFile58(resolve80(dir, fileName), "utf-8");
|
|
33053
33118
|
const parsed = parseResource(content);
|
|
33054
33119
|
const slugBase = fileName.replace(/\.md$/, "");
|
|
33055
33120
|
const name = parsed.name || slugBase;
|
|
@@ -33080,7 +33145,7 @@ async function rebuildMemoriesIndex(projectDir) {
|
|
|
33080
33145
|
lines.push("| Name | Source | Scope | Source Assignment | Updated |");
|
|
33081
33146
|
lines.push("|------|--------|-------|-------------------|---------|");
|
|
33082
33147
|
for (const fileName of files) {
|
|
33083
|
-
const content = await
|
|
33148
|
+
const content = await readFile58(resolve80(dir, fileName), "utf-8");
|
|
33084
33149
|
const parsed = parseMemory(content);
|
|
33085
33150
|
const slugBase = fileName.replace(/\.md$/, "");
|
|
33086
33151
|
const name = parsed.name || slugBase;
|
|
@@ -33195,7 +33260,7 @@ async function runResourceList(project) {
|
|
|
33195
33260
|
const slugs = await listResourceSlugs(projectDir);
|
|
33196
33261
|
const out = [];
|
|
33197
33262
|
for (const slug of slugs) {
|
|
33198
|
-
const parsed = parseResource(await
|
|
33263
|
+
const parsed = parseResource(await readFile59(resolve81(projectDir, "resources", `${slug}.md`), "utf-8"));
|
|
33199
33264
|
out.push({ slug, name: parsed.name, category: parsed.category, source: parsed.source, updated: parsed.updated });
|
|
33200
33265
|
}
|
|
33201
33266
|
return out;
|
|
@@ -33204,7 +33269,7 @@ async function runResourceShow(project, slug) {
|
|
|
33204
33269
|
const projectDir = await resolveProjectDir(project);
|
|
33205
33270
|
const filePath = resolve81(projectDir, "resources", `${slug}.md`);
|
|
33206
33271
|
if (!await fileExists(filePath)) throw new Error(`Resource "${slug}" not found in project "${project}".`);
|
|
33207
|
-
const parsed = parseResource(await
|
|
33272
|
+
const parsed = parseResource(await readFile59(filePath, "utf-8"));
|
|
33208
33273
|
return {
|
|
33209
33274
|
slug,
|
|
33210
33275
|
name: parsed.name,
|
|
@@ -33225,7 +33290,7 @@ async function runResourceUpdate(slug, options) {
|
|
|
33225
33290
|
if (options.name === void 0 && options.source === void 0 && options.category === void 0 && options.relatedAssignments === void 0) {
|
|
33226
33291
|
throw new Error("Provide at least one of --name, --source, --category, --related-assignments.");
|
|
33227
33292
|
}
|
|
33228
|
-
const original = await
|
|
33293
|
+
const original = await readFile59(filePath, "utf-8");
|
|
33229
33294
|
const content = editResourceFrontmatter(original, {
|
|
33230
33295
|
name: options.name,
|
|
33231
33296
|
category: options.category,
|
|
@@ -33322,7 +33387,7 @@ init_fs();
|
|
|
33322
33387
|
init_slug();
|
|
33323
33388
|
import { Command as Command13 } from "commander";
|
|
33324
33389
|
import { resolve as resolve82 } from "path";
|
|
33325
|
-
import { readFile as
|
|
33390
|
+
import { readFile as readFile60, readdir as readdir31, rm as rm15 } from "fs/promises";
|
|
33326
33391
|
init_parser();
|
|
33327
33392
|
function nowIso5() {
|
|
33328
33393
|
return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
@@ -33428,7 +33493,7 @@ async function runMemoryList(project) {
|
|
|
33428
33493
|
const slugs = await listMemorySlugs(projectDir);
|
|
33429
33494
|
const out = [];
|
|
33430
33495
|
for (const slug of slugs) {
|
|
33431
|
-
const parsed = parseMemory(await
|
|
33496
|
+
const parsed = parseMemory(await readFile60(resolve82(projectDir, "memories", `${slug}.md`), "utf-8"));
|
|
33432
33497
|
out.push({ slug, name: parsed.name, scope: parsed.scope, source: parsed.source, updated: parsed.updated });
|
|
33433
33498
|
}
|
|
33434
33499
|
return out;
|
|
@@ -33437,7 +33502,7 @@ async function runMemoryShow(project, slug) {
|
|
|
33437
33502
|
const projectDir = await resolveProjectDir2(project);
|
|
33438
33503
|
const filePath = resolve82(projectDir, "memories", `${slug}.md`);
|
|
33439
33504
|
if (!await fileExists(filePath)) throw new Error(`Memory "${slug}" not found in project "${project}".`);
|
|
33440
|
-
const parsed = parseMemory(await
|
|
33505
|
+
const parsed = parseMemory(await readFile60(filePath, "utf-8"));
|
|
33441
33506
|
return {
|
|
33442
33507
|
slug,
|
|
33443
33508
|
name: parsed.name,
|
|
@@ -33461,7 +33526,7 @@ async function runMemoryUpdate(slug, options) {
|
|
|
33461
33526
|
"Provide at least one of --name, --source, --scope, --source-assignment, --related-assignments."
|
|
33462
33527
|
);
|
|
33463
33528
|
}
|
|
33464
|
-
const original = await
|
|
33529
|
+
const original = await readFile60(filePath, "utf-8");
|
|
33465
33530
|
const content = editMemoryFrontmatter(original, {
|
|
33466
33531
|
name: options.name,
|
|
33467
33532
|
source: options.source,
|
|
@@ -33560,7 +33625,7 @@ init_paths();
|
|
|
33560
33625
|
init_fs();
|
|
33561
33626
|
init_frontmatter();
|
|
33562
33627
|
import { Command as Command14 } from "commander";
|
|
33563
|
-
import { readFile as
|
|
33628
|
+
import { readFile as readFile61 } from "fs/promises";
|
|
33564
33629
|
import { resolve as resolve83 } from "path";
|
|
33565
33630
|
var AGE_PATTERN = /^(\d+)([dhwm])$/i;
|
|
33566
33631
|
function parseAgeToCutoff(age) {
|
|
@@ -33594,7 +33659,7 @@ async function loadTags(item) {
|
|
|
33594
33659
|
const path = assignmentMdPath(item);
|
|
33595
33660
|
if (!await fileExists(path)) return [];
|
|
33596
33661
|
try {
|
|
33597
|
-
const content = await
|
|
33662
|
+
const content = await readFile61(path, "utf-8");
|
|
33598
33663
|
return parseAssignmentFrontmatter(content).tags;
|
|
33599
33664
|
} catch {
|
|
33600
33665
|
return [];
|
|
@@ -34023,7 +34088,7 @@ init_fs();
|
|
|
34023
34088
|
init_timestamp();
|
|
34024
34089
|
init_frontmatter();
|
|
34025
34090
|
import { Command as Command16 } from "commander";
|
|
34026
|
-
import { readFile as
|
|
34091
|
+
import { readFile as readFile62 } from "fs/promises";
|
|
34027
34092
|
import { resolve as resolve84 } from "path";
|
|
34028
34093
|
async function scanDirs() {
|
|
34029
34094
|
const config = await readConfig();
|
|
@@ -34039,7 +34104,7 @@ function configPath() {
|
|
|
34039
34104
|
async function readStatusBlock() {
|
|
34040
34105
|
const p = configPath();
|
|
34041
34106
|
if (!await fileExists(p)) return null;
|
|
34042
|
-
const content = await
|
|
34107
|
+
const content = await readFile62(p, "utf-8");
|
|
34043
34108
|
return parseStatusConfig(content);
|
|
34044
34109
|
}
|
|
34045
34110
|
async function requireStatusBlock() {
|
|
@@ -34288,7 +34353,7 @@ async function runStatusRename(id, opts) {
|
|
|
34288
34353
|
printBlockDiff(before, after);
|
|
34289
34354
|
const now2 = nowTimestamp();
|
|
34290
34355
|
for (const a of affected) {
|
|
34291
|
-
const original = await
|
|
34356
|
+
const original = await readFile62(a.path, "utf-8");
|
|
34292
34357
|
const rewritten = updateAssignmentFile(original, { status: newId, updated: now2 });
|
|
34293
34358
|
console.log(`
|
|
34294
34359
|
--- ${a.display}/assignment.md`);
|
|
@@ -34299,9 +34364,9 @@ async function runStatusRename(id, opts) {
|
|
|
34299
34364
|
}
|
|
34300
34365
|
const cfgPath = configPath();
|
|
34301
34366
|
const buffers = /* @__PURE__ */ new Map();
|
|
34302
|
-
buffers.set(cfgPath, await fileExists(cfgPath) ? await
|
|
34367
|
+
buffers.set(cfgPath, await fileExists(cfgPath) ? await readFile62(cfgPath, "utf-8") : "");
|
|
34303
34368
|
for (const a of affected) {
|
|
34304
|
-
buffers.set(a.path, await
|
|
34369
|
+
buffers.set(a.path, await readFile62(a.path, "utf-8"));
|
|
34305
34370
|
}
|
|
34306
34371
|
const now = nowTimestamp();
|
|
34307
34372
|
try {
|
|
@@ -34481,13 +34546,13 @@ init_config2();
|
|
|
34481
34546
|
init_timestamp();
|
|
34482
34547
|
init_frontmatter();
|
|
34483
34548
|
import { Command as Command17 } from "commander";
|
|
34484
|
-
import { readFile as
|
|
34549
|
+
import { readFile as readFile63 } from "fs/promises";
|
|
34485
34550
|
import { resolve as resolve85 } from "path";
|
|
34486
34551
|
async function readContext3(cwd) {
|
|
34487
34552
|
const path = resolve85(cwd, ".syntaur", "context.json");
|
|
34488
34553
|
if (!await fileExists(path)) return null;
|
|
34489
34554
|
try {
|
|
34490
|
-
return JSON.parse(await
|
|
34555
|
+
return JSON.parse(await readFile63(path, "utf-8"));
|
|
34491
34556
|
} catch {
|
|
34492
34557
|
return null;
|
|
34493
34558
|
}
|
|
@@ -34538,7 +34603,7 @@ async function runWorkspaceSet(options, cwd = process.cwd()) {
|
|
|
34538
34603
|
${pre.errors.map((e) => ` - ${e}`).join("\n")}`
|
|
34539
34604
|
);
|
|
34540
34605
|
}
|
|
34541
|
-
const original = await
|
|
34606
|
+
const original = await readFile63(path, "utf-8");
|
|
34542
34607
|
let next = updateAssignmentWorkspace(original, partial);
|
|
34543
34608
|
next = updateAssignmentFile(next, { updated: nowTimestamp() });
|
|
34544
34609
|
await writeFileForce(path, next);
|
|
@@ -34575,13 +34640,13 @@ init_config2();
|
|
|
34575
34640
|
init_timestamp();
|
|
34576
34641
|
init_templates();
|
|
34577
34642
|
import { Command as Command18 } from "commander";
|
|
34578
|
-
import { readFile as
|
|
34643
|
+
import { readFile as readFile64 } from "fs/promises";
|
|
34579
34644
|
import { resolve as resolve86 } from "path";
|
|
34580
34645
|
async function readContext4(cwd) {
|
|
34581
34646
|
const path = resolve86(cwd, ".syntaur", "context.json");
|
|
34582
34647
|
if (!await fileExists(path)) return null;
|
|
34583
34648
|
try {
|
|
34584
|
-
return JSON.parse(await
|
|
34649
|
+
return JSON.parse(await readFile64(path, "utf-8"));
|
|
34585
34650
|
} catch {
|
|
34586
34651
|
return null;
|
|
34587
34652
|
}
|
|
@@ -34662,7 +34727,7 @@ async function runProgressLog(text, options, cwd = process.cwd()) {
|
|
|
34662
34727
|
}
|
|
34663
34728
|
const path = resolve86(dir, "progress.md");
|
|
34664
34729
|
const now = nowTimestamp();
|
|
34665
|
-
const content = await fileExists(path) ? await
|
|
34730
|
+
const content = await fileExists(path) ? await readFile64(path, "utf-8") : renderProgress({ assignment: slug, timestamp: now });
|
|
34666
34731
|
const next = appendProgressEntry(content, text, now);
|
|
34667
34732
|
await writeFileForce(path, next);
|
|
34668
34733
|
return path;
|