@anthropologies/claudestory 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +122 -72
- package/dist/index.d.ts +42 -42
- package/dist/mcp.js +69 -30
- package/package.json +1 -1
- package/src/skill/SKILL.md +40 -226
- package/src/skill/autonomous-mode.md +65 -0
- package/src/skill/setup-flow.md +581 -0
package/dist/cli.js
CHANGED
|
@@ -8327,24 +8327,64 @@ var init_stages = __esm({
|
|
|
8327
8327
|
}
|
|
8328
8328
|
});
|
|
8329
8329
|
|
|
8330
|
+
// src/autonomous/version-check.ts
|
|
8331
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
8332
|
+
import { join as join13, dirname as dirname4 } from "path";
|
|
8333
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
8334
|
+
function checkVersionMismatch(runningVersion, installedVersion) {
|
|
8335
|
+
if (!installedVersion) return null;
|
|
8336
|
+
if (runningVersion === "0.0.0-dev") return null;
|
|
8337
|
+
if (runningVersion === installedVersion) return null;
|
|
8338
|
+
return `claudestory MCP server is running v${runningVersion} but v${installedVersion} is installed. Restart Claude Code to load the updated version.`;
|
|
8339
|
+
}
|
|
8340
|
+
function getInstalledVersion() {
|
|
8341
|
+
try {
|
|
8342
|
+
const thisFile = fileURLToPath3(import.meta.url);
|
|
8343
|
+
const candidates = [
|
|
8344
|
+
join13(dirname4(thisFile), "..", "..", "package.json"),
|
|
8345
|
+
join13(dirname4(thisFile), "..", "package.json")
|
|
8346
|
+
];
|
|
8347
|
+
for (const candidate of candidates) {
|
|
8348
|
+
try {
|
|
8349
|
+
const raw = readFileSync6(candidate, "utf-8");
|
|
8350
|
+
const pkg = JSON.parse(raw);
|
|
8351
|
+
if (pkg.version) return pkg.version;
|
|
8352
|
+
} catch {
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
return null;
|
|
8356
|
+
} catch {
|
|
8357
|
+
return null;
|
|
8358
|
+
}
|
|
8359
|
+
}
|
|
8360
|
+
function getRunningVersion() {
|
|
8361
|
+
return "0.1.43";
|
|
8362
|
+
}
|
|
8363
|
+
var init_version_check = __esm({
|
|
8364
|
+
"src/autonomous/version-check.ts"() {
|
|
8365
|
+
"use strict";
|
|
8366
|
+
init_esm_shims();
|
|
8367
|
+
}
|
|
8368
|
+
});
|
|
8369
|
+
|
|
8330
8370
|
// src/autonomous/guide.ts
|
|
8331
|
-
import { readFileSync as
|
|
8332
|
-
import { join as
|
|
8371
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync3, readdirSync as readdirSync4 } from "fs";
|
|
8372
|
+
import { join as join14 } from "path";
|
|
8333
8373
|
function buildGuideRecommendOptions(root) {
|
|
8334
8374
|
const opts = {};
|
|
8335
8375
|
try {
|
|
8336
|
-
const handoversDir =
|
|
8376
|
+
const handoversDir = join14(root, ".story", "handovers");
|
|
8337
8377
|
const files = readdirSync4(handoversDir, "utf-8").filter((f) => f.endsWith(".md")).sort();
|
|
8338
8378
|
if (files.length > 0) {
|
|
8339
|
-
opts.latestHandoverContent =
|
|
8379
|
+
opts.latestHandoverContent = readFileSync7(join14(handoversDir, files[files.length - 1]), "utf-8");
|
|
8340
8380
|
}
|
|
8341
8381
|
} catch {
|
|
8342
8382
|
}
|
|
8343
8383
|
try {
|
|
8344
|
-
const snapshotsDir =
|
|
8384
|
+
const snapshotsDir = join14(root, ".story", "snapshots");
|
|
8345
8385
|
const snapFiles = readdirSync4(snapshotsDir, "utf-8").filter((f) => f.endsWith(".json")).sort();
|
|
8346
8386
|
if (snapFiles.length > 0) {
|
|
8347
|
-
const raw =
|
|
8387
|
+
const raw = readFileSync7(join14(snapshotsDir, snapFiles[snapFiles.length - 1]), "utf-8");
|
|
8348
8388
|
const snap = JSON.parse(raw);
|
|
8349
8389
|
if (snap.issues) {
|
|
8350
8390
|
opts.previousOpenIssueCount = snap.issues.filter((i) => i.status !== "resolved").length;
|
|
@@ -8531,6 +8571,7 @@ async function handleStart(root, args) {
|
|
|
8531
8571
|
for (const stale of staleSessions) {
|
|
8532
8572
|
writeSessionSync(stale.dir, { ...stale.state, status: "superseded" });
|
|
8533
8573
|
}
|
|
8574
|
+
const versionWarning = checkVersionMismatch(getRunningVersion(), getInstalledVersion());
|
|
8534
8575
|
const wsId = deriveWorkspaceId(root);
|
|
8535
8576
|
const mode = args.mode ?? "auto";
|
|
8536
8577
|
if (mode !== "auto" && !args.ticketId) {
|
|
@@ -8725,7 +8766,7 @@ Staged: ${stagedResult.data.join(", ")}`
|
|
|
8725
8766
|
}
|
|
8726
8767
|
}
|
|
8727
8768
|
const { state: projectState, warnings } = await loadProject(root);
|
|
8728
|
-
const handoversDir =
|
|
8769
|
+
const handoversDir = join14(root, ".story", "handovers");
|
|
8729
8770
|
const ctx = { state: projectState, warnings, root, handoversDir, format: "md" };
|
|
8730
8771
|
let handoverText = "";
|
|
8731
8772
|
try {
|
|
@@ -8742,7 +8783,7 @@ Staged: ${stagedResult.data.join(", ")}`
|
|
|
8742
8783
|
}
|
|
8743
8784
|
} catch {
|
|
8744
8785
|
}
|
|
8745
|
-
const rulesText = readFileSafe2(
|
|
8786
|
+
const rulesText = readFileSafe2(join14(root, "RULES.md"));
|
|
8746
8787
|
const lessonDigest = buildLessonDigest(projectState.lessons);
|
|
8747
8788
|
const digestParts = [
|
|
8748
8789
|
handoverText ? `## Recent Handovers
|
|
@@ -8758,7 +8799,7 @@ ${rulesText}` : "",
|
|
|
8758
8799
|
].filter(Boolean);
|
|
8759
8800
|
const digest = digestParts.join("\n\n---\n\n");
|
|
8760
8801
|
try {
|
|
8761
|
-
writeFileSync3(
|
|
8802
|
+
writeFileSync3(join14(dir, "context-digest.md"), digest, "utf-8");
|
|
8762
8803
|
} catch {
|
|
8763
8804
|
}
|
|
8764
8805
|
if (mode !== "auto" && args.ticketId) {
|
|
@@ -8950,7 +8991,8 @@ ${ticket.description}` : "",
|
|
|
8950
8991
|
"Do NOT use Claude Code's plan mode \u2014 write plans as markdown files.",
|
|
8951
8992
|
"Do NOT ask the user for confirmation or approval.",
|
|
8952
8993
|
"Do NOT stop or summarize between tickets \u2014 call autonomous_guide IMMEDIATELY.",
|
|
8953
|
-
"You are in autonomous mode \u2014 continue working until done."
|
|
8994
|
+
"You are in autonomous mode \u2014 continue working until done.",
|
|
8995
|
+
...versionWarning ? [`**Warning:** ${versionWarning}`] : []
|
|
8954
8996
|
],
|
|
8955
8997
|
transitionedFrom: "INIT"
|
|
8956
8998
|
});
|
|
@@ -9476,7 +9518,7 @@ function guideError(err) {
|
|
|
9476
9518
|
}
|
|
9477
9519
|
function readFileSafe2(path2) {
|
|
9478
9520
|
try {
|
|
9479
|
-
return
|
|
9521
|
+
return readFileSync7(path2, "utf-8");
|
|
9480
9522
|
} catch {
|
|
9481
9523
|
return "";
|
|
9482
9524
|
}
|
|
@@ -9502,6 +9544,7 @@ var init_guide = __esm({
|
|
|
9502
9544
|
init_snapshot();
|
|
9503
9545
|
init_queries();
|
|
9504
9546
|
init_recommend();
|
|
9547
|
+
init_version_check();
|
|
9505
9548
|
init_handover();
|
|
9506
9549
|
RECOVERY_MAPPING = {
|
|
9507
9550
|
PICK_TICKET: { state: "PICK_TICKET", resetPlan: false, resetCode: false },
|
|
@@ -9728,8 +9771,8 @@ var init_session_report_formatter = __esm({
|
|
|
9728
9771
|
});
|
|
9729
9772
|
|
|
9730
9773
|
// src/cli/commands/session-report.ts
|
|
9731
|
-
import { readFileSync as
|
|
9732
|
-
import { join as
|
|
9774
|
+
import { readFileSync as readFileSync8, existsSync as existsSync10 } from "fs";
|
|
9775
|
+
import { join as join15 } from "path";
|
|
9733
9776
|
async function handleSessionReport(sessionId, root, format = "md") {
|
|
9734
9777
|
if (!UUID_REGEX.test(sessionId)) {
|
|
9735
9778
|
return {
|
|
@@ -9748,7 +9791,7 @@ async function handleSessionReport(sessionId, root, format = "md") {
|
|
|
9748
9791
|
isError: true
|
|
9749
9792
|
};
|
|
9750
9793
|
}
|
|
9751
|
-
const statePath2 =
|
|
9794
|
+
const statePath2 = join15(dir, "state.json");
|
|
9752
9795
|
if (!existsSync10(statePath2)) {
|
|
9753
9796
|
return {
|
|
9754
9797
|
output: `Error: Session ${sessionId} corrupt \u2014 state.json missing.`,
|
|
@@ -9758,7 +9801,7 @@ async function handleSessionReport(sessionId, root, format = "md") {
|
|
|
9758
9801
|
};
|
|
9759
9802
|
}
|
|
9760
9803
|
try {
|
|
9761
|
-
const rawJson = JSON.parse(
|
|
9804
|
+
const rawJson = JSON.parse(readFileSync8(statePath2, "utf-8"));
|
|
9762
9805
|
if (rawJson && typeof rawJson === "object" && "schemaVersion" in rawJson && rawJson.schemaVersion !== CURRENT_SESSION_SCHEMA_VERSION) {
|
|
9763
9806
|
return {
|
|
9764
9807
|
output: `Error: Session ${sessionId} \u2014 unsupported session schema version ${rawJson.schemaVersion}.`,
|
|
@@ -9787,7 +9830,7 @@ async function handleSessionReport(sessionId, root, format = "md") {
|
|
|
9787
9830
|
const events = readEvents(dir);
|
|
9788
9831
|
let planContent = null;
|
|
9789
9832
|
try {
|
|
9790
|
-
planContent =
|
|
9833
|
+
planContent = readFileSync8(join15(dir, "plan.md"), "utf-8");
|
|
9791
9834
|
} catch {
|
|
9792
9835
|
}
|
|
9793
9836
|
let gitLog = null;
|
|
@@ -9816,7 +9859,7 @@ var init_session_report = __esm({
|
|
|
9816
9859
|
});
|
|
9817
9860
|
|
|
9818
9861
|
// src/cli/commands/phase.ts
|
|
9819
|
-
import { join as
|
|
9862
|
+
import { join as join16, resolve as resolve6 } from "path";
|
|
9820
9863
|
function validatePhaseId(id) {
|
|
9821
9864
|
if (id.length > PHASE_ID_MAX_LENGTH) {
|
|
9822
9865
|
throw new CliValidationError("invalid_input", `Phase ID "${id}" exceeds ${PHASE_ID_MAX_LENGTH} characters`);
|
|
@@ -10005,21 +10048,21 @@ async function handlePhaseDelete(id, reassign, format, root) {
|
|
|
10005
10048
|
const updated = { ...ticket, phase: reassign, order: maxOrder };
|
|
10006
10049
|
const parsed = TicketSchema.parse(updated);
|
|
10007
10050
|
const content = serializeJSON(parsed);
|
|
10008
|
-
const target =
|
|
10051
|
+
const target = join16(wrapDir, "tickets", `${parsed.id}.json`);
|
|
10009
10052
|
operations.push({ op: "write", target, content });
|
|
10010
10053
|
}
|
|
10011
10054
|
for (const issue of affectedIssues) {
|
|
10012
10055
|
const updated = { ...issue, phase: reassign };
|
|
10013
10056
|
const parsed = IssueSchema.parse(updated);
|
|
10014
10057
|
const content = serializeJSON(parsed);
|
|
10015
|
-
const target =
|
|
10058
|
+
const target = join16(wrapDir, "issues", `${parsed.id}.json`);
|
|
10016
10059
|
operations.push({ op: "write", target, content });
|
|
10017
10060
|
}
|
|
10018
10061
|
const newPhases = state.roadmap.phases.filter((p) => p.id !== id);
|
|
10019
10062
|
const newRoadmap = { ...state.roadmap, phases: newPhases };
|
|
10020
10063
|
const parsedRoadmap = RoadmapSchema.parse(newRoadmap);
|
|
10021
10064
|
const roadmapContent = serializeJSON(parsedRoadmap);
|
|
10022
|
-
const roadmapTarget =
|
|
10065
|
+
const roadmapTarget = join16(wrapDir, "roadmap.json");
|
|
10023
10066
|
operations.push({ op: "write", target: roadmapTarget, content: roadmapContent });
|
|
10024
10067
|
await runTransactionUnlocked(root, operations);
|
|
10025
10068
|
} else {
|
|
@@ -10052,14 +10095,14 @@ var init_phase = __esm({
|
|
|
10052
10095
|
|
|
10053
10096
|
// src/mcp/tools.ts
|
|
10054
10097
|
import { z as z10 } from "zod";
|
|
10055
|
-
import { join as
|
|
10098
|
+
import { join as join17 } from "path";
|
|
10056
10099
|
function formatMcpError(code, message) {
|
|
10057
10100
|
return `[${code}] ${message}`;
|
|
10058
10101
|
}
|
|
10059
10102
|
async function runMcpReadTool(pinnedRoot, handler) {
|
|
10060
10103
|
try {
|
|
10061
10104
|
const { state, warnings } = await loadProject(pinnedRoot);
|
|
10062
|
-
const handoversDir =
|
|
10105
|
+
const handoversDir = join17(pinnedRoot, ".story", "handovers");
|
|
10063
10106
|
const ctx = { state, warnings, root: pinnedRoot, handoversDir, format: "md" };
|
|
10064
10107
|
const result = await handler(ctx);
|
|
10065
10108
|
if (result.errorCode && INFRASTRUCTURE_ERROR_CODES.includes(result.errorCode)) {
|
|
@@ -10647,10 +10690,10 @@ var init_tools = __esm({
|
|
|
10647
10690
|
|
|
10648
10691
|
// src/core/init.ts
|
|
10649
10692
|
import { mkdir as mkdir4, stat as stat2, readFile as readFile4, writeFile as writeFile2 } from "fs/promises";
|
|
10650
|
-
import { join as
|
|
10693
|
+
import { join as join18, resolve as resolve7 } from "path";
|
|
10651
10694
|
async function initProject(root, options) {
|
|
10652
10695
|
const absRoot = resolve7(root);
|
|
10653
|
-
const wrapDir =
|
|
10696
|
+
const wrapDir = join18(absRoot, ".story");
|
|
10654
10697
|
let exists = false;
|
|
10655
10698
|
try {
|
|
10656
10699
|
const s = await stat2(wrapDir);
|
|
@@ -10670,11 +10713,11 @@ async function initProject(root, options) {
|
|
|
10670
10713
|
".story/ already exists. Use --force to overwrite config and roadmap."
|
|
10671
10714
|
);
|
|
10672
10715
|
}
|
|
10673
|
-
await mkdir4(
|
|
10674
|
-
await mkdir4(
|
|
10675
|
-
await mkdir4(
|
|
10676
|
-
await mkdir4(
|
|
10677
|
-
await mkdir4(
|
|
10716
|
+
await mkdir4(join18(wrapDir, "tickets"), { recursive: true });
|
|
10717
|
+
await mkdir4(join18(wrapDir, "issues"), { recursive: true });
|
|
10718
|
+
await mkdir4(join18(wrapDir, "handovers"), { recursive: true });
|
|
10719
|
+
await mkdir4(join18(wrapDir, "notes"), { recursive: true });
|
|
10720
|
+
await mkdir4(join18(wrapDir, "lessons"), { recursive: true });
|
|
10678
10721
|
const created = [
|
|
10679
10722
|
".story/config.json",
|
|
10680
10723
|
".story/roadmap.json",
|
|
@@ -10714,7 +10757,7 @@ async function initProject(root, options) {
|
|
|
10714
10757
|
};
|
|
10715
10758
|
await writeConfig(config, absRoot);
|
|
10716
10759
|
await writeRoadmap(roadmap, absRoot);
|
|
10717
|
-
const gitignorePath =
|
|
10760
|
+
const gitignorePath = join18(wrapDir, ".gitignore");
|
|
10718
10761
|
await ensureGitignoreEntries(gitignorePath, STORY_GITIGNORE_ENTRIES);
|
|
10719
10762
|
const warnings = [];
|
|
10720
10763
|
if (options.force && exists) {
|
|
@@ -10762,7 +10805,7 @@ var init_init = __esm({
|
|
|
10762
10805
|
// src/mcp/index.ts
|
|
10763
10806
|
var mcp_exports = {};
|
|
10764
10807
|
import { realpathSync as realpathSync2, existsSync as existsSync11 } from "fs";
|
|
10765
|
-
import { resolve as resolve8, join as
|
|
10808
|
+
import { resolve as resolve8, join as join19, isAbsolute } from "path";
|
|
10766
10809
|
import { z as z11 } from "zod";
|
|
10767
10810
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10768
10811
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -10777,7 +10820,7 @@ function tryDiscoverRoot() {
|
|
|
10777
10820
|
const resolved = resolve8(envRoot);
|
|
10778
10821
|
try {
|
|
10779
10822
|
const canonical = realpathSync2(resolved);
|
|
10780
|
-
if (existsSync11(
|
|
10823
|
+
if (existsSync11(join19(canonical, CONFIG_PATH2))) {
|
|
10781
10824
|
return canonical;
|
|
10782
10825
|
}
|
|
10783
10826
|
process.stderr.write(`Warning: No .story/config.json at ${canonical}
|
|
@@ -10880,7 +10923,7 @@ var init_mcp = __esm({
|
|
|
10880
10923
|
init_init();
|
|
10881
10924
|
ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
|
|
10882
10925
|
CONFIG_PATH2 = ".story/config.json";
|
|
10883
|
-
version = "0.1.
|
|
10926
|
+
version = "0.1.43";
|
|
10884
10927
|
main().catch((err) => {
|
|
10885
10928
|
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
|
|
10886
10929
|
`);
|
|
@@ -10916,7 +10959,7 @@ __export(run_exports, {
|
|
|
10916
10959
|
runReadCommand: () => runReadCommand,
|
|
10917
10960
|
writeOutput: () => writeOutput
|
|
10918
10961
|
});
|
|
10919
|
-
import { join as
|
|
10962
|
+
import { join as join20 } from "path";
|
|
10920
10963
|
function writeOutput(text) {
|
|
10921
10964
|
try {
|
|
10922
10965
|
process.stdout.write(text + "\n");
|
|
@@ -10944,7 +10987,7 @@ async function runReadCommand(format, handler) {
|
|
|
10944
10987
|
return;
|
|
10945
10988
|
}
|
|
10946
10989
|
const { state, warnings } = await loadProject(root);
|
|
10947
|
-
const handoversDir =
|
|
10990
|
+
const handoversDir = join20(root, ".story", "handovers");
|
|
10948
10991
|
const result = await handler({ state, warnings, root, handoversDir, format });
|
|
10949
10992
|
writeOutput(result.output);
|
|
10950
10993
|
let exitCode = result.exitCode ?? ExitCode.OK;
|
|
@@ -10979,7 +11022,7 @@ async function runDeleteCommand(format, force, handler) {
|
|
|
10979
11022
|
return;
|
|
10980
11023
|
}
|
|
10981
11024
|
const { state, warnings } = await loadProject(root);
|
|
10982
|
-
const handoversDir =
|
|
11025
|
+
const handoversDir = join20(root, ".story", "handovers");
|
|
10983
11026
|
if (!force && hasIntegrityWarnings(warnings)) {
|
|
10984
11027
|
writeOutput(
|
|
10985
11028
|
formatError(
|
|
@@ -11493,19 +11536,19 @@ __export(setup_skill_exports, {
|
|
|
11493
11536
|
});
|
|
11494
11537
|
import { mkdir as mkdir5, writeFile as writeFile3, readFile as readFile5, rm, rename as rename2, unlink as unlink3 } from "fs/promises";
|
|
11495
11538
|
import { existsSync as existsSync12 } from "fs";
|
|
11496
|
-
import { join as
|
|
11539
|
+
import { join as join21, dirname as dirname5 } from "path";
|
|
11497
11540
|
import { homedir } from "os";
|
|
11498
11541
|
import { execFileSync } from "child_process";
|
|
11499
|
-
import { fileURLToPath as
|
|
11542
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
11500
11543
|
function log(msg) {
|
|
11501
11544
|
process.stdout.write(msg + "\n");
|
|
11502
11545
|
}
|
|
11503
11546
|
function resolveSkillSourceDir() {
|
|
11504
|
-
const thisDir =
|
|
11505
|
-
const bundledPath =
|
|
11506
|
-
if (existsSync12(
|
|
11507
|
-
const sourcePath =
|
|
11508
|
-
if (existsSync12(
|
|
11547
|
+
const thisDir = dirname5(fileURLToPath4(import.meta.url));
|
|
11548
|
+
const bundledPath = join21(thisDir, "..", "src", "skill");
|
|
11549
|
+
if (existsSync12(join21(bundledPath, "SKILL.md"))) return bundledPath;
|
|
11550
|
+
const sourcePath = join21(thisDir, "..", "..", "skill");
|
|
11551
|
+
if (existsSync12(join21(sourcePath, "SKILL.md"))) return sourcePath;
|
|
11509
11552
|
throw new Error(
|
|
11510
11553
|
`Cannot find bundled skill files. Checked:
|
|
11511
11554
|
${bundledPath}
|
|
@@ -11518,7 +11561,7 @@ function isHookWithCommand(entry, command) {
|
|
|
11518
11561
|
return e.type === "command" && typeof e.command === "string" && e.command.trim() === command;
|
|
11519
11562
|
}
|
|
11520
11563
|
async function registerHook(hookType, hookEntry, settingsPath, matcher) {
|
|
11521
|
-
const path2 = settingsPath ??
|
|
11564
|
+
const path2 = settingsPath ?? join21(homedir(), ".claude", "settings.json");
|
|
11522
11565
|
let raw = "{}";
|
|
11523
11566
|
if (existsSync12(path2)) {
|
|
11524
11567
|
try {
|
|
@@ -11590,7 +11633,7 @@ async function registerHook(hookType, hookEntry, settingsPath, matcher) {
|
|
|
11590
11633
|
}
|
|
11591
11634
|
const tmpPath = `${path2}.${process.pid}.tmp`;
|
|
11592
11635
|
try {
|
|
11593
|
-
const dir =
|
|
11636
|
+
const dir = dirname5(path2);
|
|
11594
11637
|
await mkdir5(dir, { recursive: true });
|
|
11595
11638
|
await writeFile3(tmpPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
|
|
11596
11639
|
await rename2(tmpPath, path2);
|
|
@@ -11616,7 +11659,7 @@ async function registerStopHook(settingsPath) {
|
|
|
11616
11659
|
return registerHook("Stop", { type: "command", command: STOP_HOOK_COMMAND, async: true }, settingsPath);
|
|
11617
11660
|
}
|
|
11618
11661
|
async function removeHook(hookType, command, settingsPath) {
|
|
11619
|
-
const path2 = settingsPath ??
|
|
11662
|
+
const path2 = settingsPath ?? join21(homedir(), ".claude", "settings.json");
|
|
11620
11663
|
let raw = "{}";
|
|
11621
11664
|
if (existsSync12(path2)) {
|
|
11622
11665
|
try {
|
|
@@ -11648,7 +11691,7 @@ async function removeHook(hookType, command, settingsPath) {
|
|
|
11648
11691
|
if (!removed) return "not_found";
|
|
11649
11692
|
const tmpPath = `${path2}.${process.pid}.tmp`;
|
|
11650
11693
|
try {
|
|
11651
|
-
const dir =
|
|
11694
|
+
const dir = dirname5(path2);
|
|
11652
11695
|
await mkdir5(dir, { recursive: true });
|
|
11653
11696
|
await writeFile3(tmpPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
|
|
11654
11697
|
await rename2(tmpPath, path2);
|
|
@@ -11663,7 +11706,7 @@ async function removeHook(hookType, command, settingsPath) {
|
|
|
11663
11706
|
}
|
|
11664
11707
|
async function handleSetupSkill(options = {}) {
|
|
11665
11708
|
const { skipHooks = false } = options;
|
|
11666
|
-
const skillDir =
|
|
11709
|
+
const skillDir = join21(homedir(), ".claude", "skills", "story");
|
|
11667
11710
|
await mkdir5(skillDir, { recursive: true });
|
|
11668
11711
|
let srcSkillDir;
|
|
11669
11712
|
try {
|
|
@@ -11676,26 +11719,33 @@ async function handleSetupSkill(options = {}) {
|
|
|
11676
11719
|
process.exitCode = 1;
|
|
11677
11720
|
return;
|
|
11678
11721
|
}
|
|
11679
|
-
const oldPrimeDir =
|
|
11722
|
+
const oldPrimeDir = join21(homedir(), ".claude", "skills", "prime");
|
|
11680
11723
|
if (existsSync12(oldPrimeDir)) {
|
|
11681
11724
|
await rm(oldPrimeDir, { recursive: true, force: true });
|
|
11682
11725
|
log("Removed old /prime skill (migrated to /story)");
|
|
11683
11726
|
}
|
|
11684
|
-
const existed = existsSync12(
|
|
11685
|
-
const skillContent = await readFile5(
|
|
11686
|
-
await writeFile3(
|
|
11687
|
-
|
|
11688
|
-
const
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11727
|
+
const existed = existsSync12(join21(skillDir, "SKILL.md"));
|
|
11728
|
+
const skillContent = await readFile5(join21(srcSkillDir, "SKILL.md"), "utf-8");
|
|
11729
|
+
await writeFile3(join21(skillDir, "SKILL.md"), skillContent, "utf-8");
|
|
11730
|
+
const supportFiles = ["setup-flow.md", "autonomous-mode.md", "reference.md"];
|
|
11731
|
+
const writtenFiles = ["SKILL.md"];
|
|
11732
|
+
const missingFiles = [];
|
|
11733
|
+
for (const filename of supportFiles) {
|
|
11734
|
+
const srcPath = join21(srcSkillDir, filename);
|
|
11735
|
+
if (existsSync12(srcPath)) {
|
|
11736
|
+
const content = await readFile5(srcPath, "utf-8");
|
|
11737
|
+
await writeFile3(join21(skillDir, filename), content, "utf-8");
|
|
11738
|
+
writtenFiles.push(filename);
|
|
11739
|
+
} else {
|
|
11740
|
+
missingFiles.push(filename);
|
|
11741
|
+
}
|
|
11693
11742
|
}
|
|
11694
11743
|
log(`${existed ? "Updated" : "Installed"} /story skill at ${skillDir}/`);
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11744
|
+
log(` ${writtenFiles.join(" + ")} written`);
|
|
11745
|
+
if (missingFiles.length > 0) {
|
|
11746
|
+
process.stderr.write(`Warning: support file(s) not found in source: ${missingFiles.join(", ")}
|
|
11747
|
+
`);
|
|
11748
|
+
process.stderr.write(" This may indicate a corrupt installation. Try: npm install -g @anthropologies/claudestory\n");
|
|
11699
11749
|
}
|
|
11700
11750
|
let mcpRegistered = false;
|
|
11701
11751
|
let cliInPath = false;
|
|
@@ -11802,8 +11852,8 @@ var hook_status_exports = {};
|
|
|
11802
11852
|
__export(hook_status_exports, {
|
|
11803
11853
|
handleHookStatus: () => handleHookStatus
|
|
11804
11854
|
});
|
|
11805
|
-
import { readFileSync as
|
|
11806
|
-
import { join as
|
|
11855
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync4, renameSync as renameSync2, unlinkSync as unlinkSync4 } from "fs";
|
|
11856
|
+
import { join as join22 } from "path";
|
|
11807
11857
|
async function readStdinSilent() {
|
|
11808
11858
|
try {
|
|
11809
11859
|
const chunks = [];
|
|
@@ -11853,10 +11903,10 @@ function activePayload(session) {
|
|
|
11853
11903
|
};
|
|
11854
11904
|
}
|
|
11855
11905
|
function ensureGitignore(root) {
|
|
11856
|
-
const gitignorePath =
|
|
11906
|
+
const gitignorePath = join22(root, ".story", ".gitignore");
|
|
11857
11907
|
let existing = "";
|
|
11858
11908
|
try {
|
|
11859
|
-
existing =
|
|
11909
|
+
existing = readFileSync9(gitignorePath, "utf-8");
|
|
11860
11910
|
} catch {
|
|
11861
11911
|
}
|
|
11862
11912
|
const lines = existing.split("\n").map((l) => l.trim());
|
|
@@ -11872,7 +11922,7 @@ function ensureGitignore(root) {
|
|
|
11872
11922
|
}
|
|
11873
11923
|
function writeStatus(root, payload) {
|
|
11874
11924
|
ensureGitignore(root);
|
|
11875
|
-
const statusPath =
|
|
11925
|
+
const statusPath = join22(root, ".story", "status.json");
|
|
11876
11926
|
const content = JSON.stringify(payload, null, 2) + "\n";
|
|
11877
11927
|
atomicWriteSync(statusPath, content);
|
|
11878
11928
|
}
|
|
@@ -11931,8 +11981,8 @@ var config_update_exports = {};
|
|
|
11931
11981
|
__export(config_update_exports, {
|
|
11932
11982
|
handleConfigSetOverrides: () => handleConfigSetOverrides
|
|
11933
11983
|
});
|
|
11934
|
-
import { readFileSync as
|
|
11935
|
-
import { join as
|
|
11984
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
11985
|
+
import { join as join23 } from "path";
|
|
11936
11986
|
async function handleConfigSetOverrides(root, format, options) {
|
|
11937
11987
|
const { json: jsonArg, clear } = options;
|
|
11938
11988
|
if (!clear && !jsonArg) {
|
|
@@ -11960,8 +12010,8 @@ async function handleConfigSetOverrides(root, format, options) {
|
|
|
11960
12010
|
}
|
|
11961
12011
|
let resultOverrides = null;
|
|
11962
12012
|
await withProjectLock(root, { strict: false }, async () => {
|
|
11963
|
-
const configPath =
|
|
11964
|
-
const rawContent =
|
|
12013
|
+
const configPath = join23(root, ".story", "config.json");
|
|
12014
|
+
const rawContent = readFileSync10(configPath, "utf-8");
|
|
11965
12015
|
const raw = JSON.parse(rawContent);
|
|
11966
12016
|
if (clear) {
|
|
11967
12017
|
delete raw.recipeOverrides;
|
|
@@ -14304,7 +14354,7 @@ async function runCli() {
|
|
|
14304
14354
|
registerSessionCommand: registerSessionCommand2,
|
|
14305
14355
|
registerRepairCommand: registerRepairCommand2
|
|
14306
14356
|
} = await Promise.resolve().then(() => (init_register(), register_exports));
|
|
14307
|
-
const version2 = "0.1.
|
|
14357
|
+
const version2 = "0.1.43";
|
|
14308
14358
|
class HandledError extends Error {
|
|
14309
14359
|
constructor() {
|
|
14310
14360
|
super("HANDLED_ERROR");
|
package/dist/index.d.ts
CHANGED
|
@@ -1377,15 +1377,42 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1377
1377
|
file: z.ZodString;
|
|
1378
1378
|
message: z.ZodString;
|
|
1379
1379
|
}, "strip", z.ZodTypeAny, {
|
|
1380
|
-
message: string;
|
|
1381
1380
|
type: string;
|
|
1381
|
+
message: string;
|
|
1382
1382
|
file: string;
|
|
1383
1383
|
}, {
|
|
1384
|
-
message: string;
|
|
1385
1384
|
type: string;
|
|
1385
|
+
message: string;
|
|
1386
1386
|
file: string;
|
|
1387
1387
|
}>, "many">>;
|
|
1388
1388
|
}, "strip", z.ZodTypeAny, {
|
|
1389
|
+
version: 1;
|
|
1390
|
+
config: {
|
|
1391
|
+
version: number;
|
|
1392
|
+
type: string;
|
|
1393
|
+
language: string;
|
|
1394
|
+
project: string;
|
|
1395
|
+
features: {
|
|
1396
|
+
issues: boolean;
|
|
1397
|
+
tickets: boolean;
|
|
1398
|
+
handovers: boolean;
|
|
1399
|
+
roadmap: boolean;
|
|
1400
|
+
reviews: boolean;
|
|
1401
|
+
} & {
|
|
1402
|
+
[k: string]: unknown;
|
|
1403
|
+
};
|
|
1404
|
+
schemaVersion?: number | undefined;
|
|
1405
|
+
recipe?: string | undefined;
|
|
1406
|
+
recipeOverrides?: {
|
|
1407
|
+
maxTicketsPerSession?: number | undefined;
|
|
1408
|
+
compactThreshold?: string | undefined;
|
|
1409
|
+
reviewBackends?: string[] | undefined;
|
|
1410
|
+
handoverInterval?: number | undefined;
|
|
1411
|
+
stages?: Record<string, Record<string, unknown>> | undefined;
|
|
1412
|
+
} | undefined;
|
|
1413
|
+
} & {
|
|
1414
|
+
[k: string]: unknown;
|
|
1415
|
+
};
|
|
1389
1416
|
issues: z.objectOutputType<{
|
|
1390
1417
|
id: z.ZodString;
|
|
1391
1418
|
title: z.ZodString;
|
|
@@ -1422,8 +1449,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1422
1449
|
claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1423
1450
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1424
1451
|
roadmap: {
|
|
1425
|
-
title: string;
|
|
1426
1452
|
date: string;
|
|
1453
|
+
title: string;
|
|
1427
1454
|
phases: z.objectOutputType<{
|
|
1428
1455
|
id: z.ZodString;
|
|
1429
1456
|
label: z.ZodString;
|
|
@@ -1441,7 +1468,6 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1441
1468
|
} & {
|
|
1442
1469
|
[k: string]: unknown;
|
|
1443
1470
|
};
|
|
1444
|
-
version: 1;
|
|
1445
1471
|
project: string;
|
|
1446
1472
|
notes: z.objectOutputType<{
|
|
1447
1473
|
id: z.ZodString;
|
|
@@ -1467,11 +1493,19 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1467
1493
|
status: z.ZodEnum<["active", "deprecated", "superseded"]>;
|
|
1468
1494
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1469
1495
|
createdAt: string;
|
|
1470
|
-
|
|
1496
|
+
handoverFilenames: string[];
|
|
1497
|
+
warnings?: {
|
|
1471
1498
|
type: string;
|
|
1499
|
+
message: string;
|
|
1500
|
+
file: string;
|
|
1501
|
+
}[] | undefined;
|
|
1502
|
+
}, {
|
|
1503
|
+
version: 1;
|
|
1504
|
+
config: {
|
|
1472
1505
|
version: number;
|
|
1473
|
-
|
|
1506
|
+
type: string;
|
|
1474
1507
|
language: string;
|
|
1508
|
+
project: string;
|
|
1475
1509
|
features: {
|
|
1476
1510
|
issues: boolean;
|
|
1477
1511
|
tickets: boolean;
|
|
@@ -1493,13 +1527,6 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1493
1527
|
} & {
|
|
1494
1528
|
[k: string]: unknown;
|
|
1495
1529
|
};
|
|
1496
|
-
handoverFilenames: string[];
|
|
1497
|
-
warnings?: {
|
|
1498
|
-
message: string;
|
|
1499
|
-
type: string;
|
|
1500
|
-
file: string;
|
|
1501
|
-
}[] | undefined;
|
|
1502
|
-
}, {
|
|
1503
1530
|
issues: z.objectInputType<{
|
|
1504
1531
|
id: z.ZodString;
|
|
1505
1532
|
title: z.ZodString;
|
|
@@ -1536,8 +1563,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1536
1563
|
claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1537
1564
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1538
1565
|
roadmap: {
|
|
1539
|
-
title: string;
|
|
1540
1566
|
date: string;
|
|
1567
|
+
title: string;
|
|
1541
1568
|
phases: z.objectInputType<{
|
|
1542
1569
|
id: z.ZodString;
|
|
1543
1570
|
label: z.ZodString;
|
|
@@ -1555,35 +1582,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1555
1582
|
} & {
|
|
1556
1583
|
[k: string]: unknown;
|
|
1557
1584
|
};
|
|
1558
|
-
version: 1;
|
|
1559
1585
|
project: string;
|
|
1560
1586
|
createdAt: string;
|
|
1561
|
-
config: {
|
|
1562
|
-
type: string;
|
|
1563
|
-
version: number;
|
|
1564
|
-
project: string;
|
|
1565
|
-
language: string;
|
|
1566
|
-
features: {
|
|
1567
|
-
issues: boolean;
|
|
1568
|
-
tickets: boolean;
|
|
1569
|
-
handovers: boolean;
|
|
1570
|
-
roadmap: boolean;
|
|
1571
|
-
reviews: boolean;
|
|
1572
|
-
} & {
|
|
1573
|
-
[k: string]: unknown;
|
|
1574
|
-
};
|
|
1575
|
-
schemaVersion?: number | undefined;
|
|
1576
|
-
recipe?: string | undefined;
|
|
1577
|
-
recipeOverrides?: {
|
|
1578
|
-
maxTicketsPerSession?: number | undefined;
|
|
1579
|
-
compactThreshold?: string | undefined;
|
|
1580
|
-
reviewBackends?: string[] | undefined;
|
|
1581
|
-
handoverInterval?: number | undefined;
|
|
1582
|
-
stages?: Record<string, Record<string, unknown>> | undefined;
|
|
1583
|
-
} | undefined;
|
|
1584
|
-
} & {
|
|
1585
|
-
[k: string]: unknown;
|
|
1586
|
-
};
|
|
1587
1587
|
notes?: z.objectInputType<{
|
|
1588
1588
|
id: z.ZodString;
|
|
1589
1589
|
title: z.ZodNullable<z.ZodString>;
|
|
@@ -1608,8 +1608,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1608
1608
|
status: z.ZodEnum<["active", "deprecated", "superseded"]>;
|
|
1609
1609
|
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
1610
1610
|
warnings?: {
|
|
1611
|
-
message: string;
|
|
1612
1611
|
type: string;
|
|
1612
|
+
message: string;
|
|
1613
1613
|
file: string;
|
|
1614
1614
|
}[] | undefined;
|
|
1615
1615
|
handoverFilenames?: string[] | undefined;
|