@hizliemre/horse-code 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/{app-5FXHE7GX.js → app-4WN37LZ3.js} +65 -37
  2. package/dist/{chunk-UEWVVN5L.js → chunk-27F44PBD.js} +196 -1126
  3. package/dist/{chunk-XYZVZPAY.js → chunk-2WXG35EM.js} +19 -15
  4. package/dist/{chunk-LNW557IO.js → chunk-372X5HHU.js} +2 -2
  5. package/dist/{chunk-YPZP7LYL.js → chunk-3ACDNDCG.js} +1 -1
  6. package/dist/{chunk-XEGQT5EN.js → chunk-4M6LXNG2.js} +1 -1
  7. package/dist/{chunk-6OSEQOYY.js → chunk-6S4WWQMN.js} +2 -2
  8. package/dist/{chunk-LLL7QWXB.js → chunk-BFIZMM4G.js} +6 -6
  9. package/dist/chunk-CYLPQWIF.js +214 -0
  10. package/dist/{chunk-AE36LLL2.js → chunk-JLWQCA7B.js} +2 -209
  11. package/dist/{run-P6ZYL5JL.js → chunk-QJYVZPLG.js} +133 -389
  12. package/dist/{chunk-UGESK765.js → chunk-UTHLEW5V.js} +1 -1
  13. package/dist/chunk-YULQ4URQ.js +1220 -0
  14. package/dist/{chunk-KAGKX2YT.js → chunk-ZPJP2VH5.js} +10 -1
  15. package/dist/cli.js +254 -66
  16. package/dist/{fix-ONLA45HD.js → fix-QCL5AITT.js} +9 -8
  17. package/dist/{ongoing-WHYXPW24.js → ongoing-6NUSPSCV.js} +3 -2
  18. package/dist/{project-graph-5HNPRFQG.js → project-graph-OGIM2B33.js} +1 -1
  19. package/dist/run-V5ZLZ3LS.js +274 -0
  20. package/dist/{save-skills-ZW5GY6KV.js → save-skills-NPKTYNAF.js} +2 -2
  21. package/dist/{trace-X6TU3AG6.js → trace-UVMZZRA5.js} +1 -1
  22. package/dist/{trace-adopt-URECQWJV.js → trace-adopt-7HWELJFE.js} +1 -1
  23. package/dist/{trace-run-7U4WJZ3V.js → trace-run-CZWEZ4R6.js} +8 -4
  24. package/dist/{triage-FCYHD2AQ.js → triage-IFCVL5MA.js} +7 -6
  25. package/dist/{verify-LC57A6H2.js → verify-HWZBTK5X.js} +15 -12
  26. package/package.json +1 -1
  27. package/dist/chunk-MRZVA5JB.js +0 -163
  28. package/dist/{chunk-EAF22QIG.js → chunk-JR2JLRE3.js} +3 -3
@@ -10,18 +10,32 @@ import {
10
10
  restoreTerminal,
11
11
  runJob,
12
12
  sttySane
13
- } from "./chunk-XYZVZPAY.js";
13
+ } from "./chunk-2WXG35EM.js";
14
14
  import "./chunk-M2RKCIGV.js";
15
+ import {
16
+ RoleFitness,
17
+ asChoice,
18
+ describeUnfinished,
19
+ toSlug,
20
+ unfinishedSessions
21
+ } from "./chunk-27F44PBD.js";
22
+ import "./chunk-QF4MP6BS.js";
23
+ import "./chunk-UTHLEW5V.js";
24
+ import "./chunk-ZSQ24YDJ.js";
25
+ import {
26
+ saveRoleSkills
27
+ } from "./chunk-JR2JLRE3.js";
28
+ import {
29
+ objectField,
30
+ patchConfig
31
+ } from "./chunk-H2FDGPVW.js";
15
32
  import {
16
33
  DURABLE_ROLES,
17
34
  REQUIRED_ROLES,
18
35
  ROLE_PROFILES,
19
- RoleFitness,
20
36
  adjustRoleModels,
21
- asChoice,
22
37
  capabilityScore,
23
38
  cliFor,
24
- describeUnfinished,
25
39
  effortFor,
26
40
  filterModelsForRole,
27
41
  isKnownModel,
@@ -29,29 +43,18 @@ import {
29
43
  mostCapable,
30
44
  newestPrimary,
31
45
  sourceOf,
32
- strongestPrimary,
33
- toSlug,
34
- unfinishedSessions
35
- } from "./chunk-UEWVVN5L.js";
36
- import "./chunk-QF4MP6BS.js";
37
- import "./chunk-UGESK765.js";
38
- import "./chunk-ZSQ24YDJ.js";
39
- import {
40
- saveRoleSkills
41
- } from "./chunk-EAF22QIG.js";
46
+ strongestPrimary
47
+ } from "./chunk-YULQ4URQ.js";
42
48
  import "./chunk-G45RWL7S.js";
43
- import {
44
- objectField,
45
- patchConfig
46
- } from "./chunk-H2FDGPVW.js";
47
- import "./chunk-MRZVA5JB.js";
48
49
  import "./chunk-LPQU436C.js";
49
50
  import {
50
51
  memoryNote,
51
52
  memoryState,
52
53
  walkFiles
53
- } from "./chunk-LLL7QWXB.js";
54
+ } from "./chunk-BFIZMM4G.js";
54
55
  import "./chunk-63E73TGI.js";
56
+ import "./chunk-CYLPQWIF.js";
57
+ import "./chunk-6S4WWQMN.js";
55
58
  import {
56
59
  estimateFreezeSeconds,
57
60
  fmtDuration,
@@ -61,15 +64,14 @@ import {
61
64
  stripThinking,
62
65
  telemetry,
63
66
  writeHeapSnapshot
64
- } from "./chunk-AE36LLL2.js";
65
- import "./chunk-6OSEQOYY.js";
67
+ } from "./chunk-JLWQCA7B.js";
66
68
  import {
67
69
  traceRootRel
68
- } from "./chunk-KAGKX2YT.js";
70
+ } from "./chunk-ZPJP2VH5.js";
69
71
  import {
70
72
  buildProjectGraph,
71
73
  graphStatus
72
- } from "./chunk-XEGQT5EN.js";
74
+ } from "./chunk-4M6LXNG2.js";
73
75
  import {
74
76
  writeAtomic
75
77
  } from "./chunk-6W4UH2BQ.js";
@@ -1739,6 +1741,7 @@ var COMMANDS = [
1739
1741
  { name: "/memories", desc: "List remembered facts (/forget N to remove)" },
1740
1742
  { name: "/forget", desc: "Forget a remembered fact (/forget N)" },
1741
1743
  { name: "/mcp", desc: "Connected MCP servers (/mcp add <url|command> installs one and verifies it)" },
1744
+ { name: "/init", desc: "Set this project up for horse-code \u2014 commit the knowledge, keep the derived files out" },
1742
1745
  { name: "/models", desc: "Models each connected subscription serves, and which ones a role is running" },
1743
1746
  { name: "/sources", desc: "Show your connected model sources (/sources refresh re-detects)" },
1744
1747
  { name: "/migrate", desc: "Bring a project from Claude Code / Codex / Cursor into horse-code (rules, memory, skills)" },
@@ -3169,7 +3172,7 @@ function ViewportLines({ lines, height }) {
3169
3172
  lines.map((line, i) => /* @__PURE__ */ jsx4(Text4, { children: line.length === 0 ? " " : line.map((s, j) => /* @__PURE__ */ jsx4(Text4, { color: s.color, backgroundColor: s.backgroundColor, bold: s.bold, italic: s.italic, dimColor: s.dim, children: s.text }, j)) }, i))
3170
3173
  ] });
3171
3174
  }
3172
- function App({ controller, fullscreen = false, model, coachModel, refinerModel, listModels, setModel, setRoleModel, listRoles, adjustRoles, modelsPanel, listSessions, resumeSession, listPins, addPin, removePin, listMemories, addMemory, removeMemory, listMcp, sourcesInfo, refreshSources, listSkills, updateSkills, addSkill, graphStatus: graphStatus2, buildGraph, planTraces, runTraces, cleanWorktrees, migrate, continueFromClaude, addMcp, answerByTheWay, telemetryPath, parallel, setParallel, permMode, setPermMode, cancelJob, onExit }) {
3175
+ function App({ controller, fullscreen = false, model, coachModel, refinerModel, listModels, setModel, setRoleModel, listRoles, adjustRoles, modelsPanel, initProject, listSessions, resumeSession, listPins, addPin, removePin, listMemories, addMemory, removeMemory, listMcp, sourcesInfo, refreshSources, listSkills, updateSkills, addSkill, graphStatus: graphStatus2, buildGraph, planTraces, runTraces, cleanWorktrees, migrate, continueFromClaude, addMcp, answerByTheWay, telemetryPath, parallel, setParallel, permMode, setPermMode, cancelJob, onExit }) {
3173
3176
  const [state, setState] = useState3(controller.getState());
3174
3177
  useEffect3(() => controller.subscribe(() => setState(controller.getState())), [controller]);
3175
3178
  const { stdout } = useStdout();
@@ -3625,6 +3628,27 @@ ${rows.join("\n")}
3625
3628
 
3626
3629
  _\`/mcp add <url|command>\` to install another._`);
3627
3630
  };
3631
+ const doInit = async () => {
3632
+ if (!initProject) {
3633
+ controller.note("Project setup is not available.");
3634
+ return;
3635
+ }
3636
+ controller.note("Setting the project up\u2026");
3637
+ let report;
3638
+ try {
3639
+ report = await initProject();
3640
+ } catch (e) {
3641
+ controller.note(`init error: ${e instanceof Error ? e.message : String(e)}`);
3642
+ return;
3643
+ }
3644
+ controller.note(report.text);
3645
+ if (!report.canImport || !migrate) return;
3646
+ if (await controller.ask("Read these and import what they say?", { options: ["Import", "Skip"] }) !== "Import") {
3647
+ controller.note("Left alone. Run `/init` again, or `/migrate`, whenever you want them read.");
3648
+ return;
3649
+ }
3650
+ controller.note(await migrate(report.extra));
3651
+ };
3628
3652
  const doModels = () => {
3629
3653
  if (!modelsPanel) {
3630
3654
  controller.note("Models are not available.");
@@ -3909,6 +3933,7 @@ _\`/skills add <github-url>\` to install one \xB7 \`/skills update\` re-installs
3909
3933
  else if (c.name === "/remember") doRemember("");
3910
3934
  else if (c.name === "/forget") doForget("");
3911
3935
  else if (c.name === "/mcp") doMcp("");
3936
+ else if (c.name === "/init") void doInit();
3912
3937
  else if (c.name === "/models") doModels();
3913
3938
  else if (c.name === "/sources") doSources("");
3914
3939
  else if (c.name === "/skills") doSkills("");
@@ -5569,7 +5594,7 @@ Question: ${question}` }
5569
5594
  };
5570
5595
  const addMcp = async (input) => {
5571
5596
  const { parseCommand, parseConfigBlock, extractFromPage, verify } = await import("./install-O34KMWJB.js");
5572
- const { saveMcpServer } = await import("./save-skills-ZW5GY6KV.js");
5597
+ const { saveMcpServer } = await import("./save-skills-NPKTYNAF.js");
5573
5598
  let cand = parseCommand(input) ?? parseConfigBlock(input);
5574
5599
  if (!cand) {
5575
5600
  const url = input.trim();
@@ -5638,14 +5663,15 @@ _This project has no worktrees under \`.claude/worktrees\`._`}`);
5638
5663
  controller.note(`Could not continue from that worktree: ${e instanceof Error ? e.message : String(e)}`);
5639
5664
  }
5640
5665
  };
5641
- const migrate = async () => {
5666
+ const migrate = async (extra) => {
5642
5667
  if (!opts.memStore) return "Migration needs the memory store, which is not available in this session.";
5643
5668
  const progressLines = /* @__PURE__ */ new Map();
5644
- const { runMigration, describeResult } = await import("./run-P6ZYL5JL.js");
5669
+ const { runMigration, describeResult } = await import("./run-V5ZLZ3LS.js");
5645
5670
  const r = await runMigration({
5646
5671
  cwd: process.cwd(),
5647
5672
  home: homedir2(),
5648
5673
  provider: deps.provider,
5674
+ ...extra?.length ? { extra } : {},
5649
5675
  /**
5650
5676
  * The architect's whole CHAIN, not just its head.
5651
5677
  *
@@ -5720,12 +5746,13 @@ _Restart to pick them up in already-built prompts._` : `No role carries one perm
5720
5746
  };
5721
5747
  const refreshGraphIfStale = async () => {
5722
5748
  try {
5723
- const before = await graphStatus(process.cwd());
5749
+ const dir = await (opts.derivedDir?.() ?? Promise.resolve(process.cwd()));
5750
+ const before = await graphStatus(dir);
5724
5751
  if (before.built && !before.stale) return;
5725
5752
  const first = !before.built;
5726
5753
  controller.note(first ? `\u{1F9E0} Building the code graph for the first time \u2014 this reads the whole project, so it takes a few minutes. It runs once; after this, start-up only updates what changed.` : `\u{1F504} The code graph is out of date \u2014 updating it.`);
5727
5754
  controller.startBusy(first ? "building the code graph" : "updating the code graph");
5728
- const r = await buildProjectGraph(process.cwd());
5755
+ const r = await buildProjectGraph(dir);
5729
5756
  controller.endBusy();
5730
5757
  controller.note(r.ok ? `\u2705 Code graph ready \u2014 ${(r.nodes ?? 0).toLocaleString("en-US")} symbols, ${(r.edges ?? 0).toLocaleString("en-US")} relationships.` : `\u26A0\uFE0F The code graph could not be built: ${r.message}`);
5731
5758
  } catch {
@@ -5907,7 +5934,7 @@ _${saved ? `Saved to your config \u2014 future sessions start with these. ` : ""
5907
5934
  const cwd = process.cwd();
5908
5935
  const main = await recordedMainBranch(cwd) ?? await detectMainBranch(cwd, defaultGitRunner);
5909
5936
  if (!main) return;
5910
- const { ongoingWork, chooseOngoing } = await import("./ongoing-WHYXPW24.js");
5937
+ const { ongoingWork, chooseOngoing } = await import("./ongoing-6NUSPSCV.js");
5911
5938
  const open = await ongoingWork(defaultGitRunner, cwd, main);
5912
5939
  if (!open.length) return;
5913
5940
  const picked = await chooseOngoing(deps, read, open[0]?.language, open);
@@ -5926,11 +5953,11 @@ _${saved ? `Saved to your config \u2014 future sessions start with these. ` : ""
5926
5953
  })();
5927
5954
  void (async () => {
5928
5955
  try {
5929
- const { loadTraceIndex } = await import("./trace-X6TU3AG6.js");
5956
+ const { loadTraceIndex } = await import("./trace-UVMZZRA5.js");
5930
5957
  let index = await loadTraceIndex(process.cwd());
5931
5958
  startupExtra.traces = Object.keys(index.traces).length;
5932
5959
  paintSummary();
5933
- const { graphStatus: graphStatus2 } = await import("./project-graph-5HNPRFQG.js");
5960
+ const { graphStatus: graphStatus2 } = await import("./project-graph-OGIM2B33.js");
5934
5961
  const g = await graphStatus2(process.cwd());
5935
5962
  startupExtra.graph = { built: g.built, nodes: g.nodes, stale: g.stale };
5936
5963
  if (!g.built || g.stale) {
@@ -5939,11 +5966,11 @@ _${saved ? `Saved to your config \u2014 future sessions start with these. ` : ""
5939
5966
  const after = await graphStatus2(process.cwd());
5940
5967
  startupExtra.graph = { built: after.built, nodes: after.nodes, stale: after.stale };
5941
5968
  }
5942
- const g0 = await import("./project-graph-5HNPRFQG.js").then((m) => m.loadGraphSync(process.cwd()));
5969
+ const g0 = await import("./project-graph-OGIM2B33.js").then((m) => m.loadGraphSync(process.cwd()));
5943
5970
  if (g0) {
5944
5971
  const files = /* @__PURE__ */ new Set();
5945
5972
  for (const n of g0.nodes) if (n.source_file) files.add(n.source_file);
5946
- const { adoptDocs, indexAdoption, describeAdoption } = await import("./trace-adopt-URECQWJV.js");
5973
+ const { adoptDocs, indexAdoption, describeAdoption } = await import("./trace-adopt-7HWELJFE.js");
5947
5974
  const adoption = await adoptDocs(process.cwd(), files);
5948
5975
  const { readFile: readFile5 } = await import("fs/promises");
5949
5976
  const r = await indexAdoption(
@@ -5959,8 +5986,8 @@ _${saved ? `Saved to your config \u2014 future sessions start with these. ` : ""
5959
5986
  }
5960
5987
  startupExtra.traces = Object.keys(index.traces).length;
5961
5988
  paintSummary();
5962
- const { traceableFiles } = await import("./trace-run-7U4WJZ3V.js");
5963
- const { traceCoverage } = await import("./trace-X6TU3AG6.js");
5989
+ const { traceableFiles } = await import("./trace-run-CZWEZ4R6.js");
5990
+ const { traceCoverage } = await import("./trace-UVMZZRA5.js");
5964
5991
  startupExtra.coverage = await traceCoverage(process.cwd(), await traceableFiles(process.cwd()), index);
5965
5992
  paintSummary();
5966
5993
  } catch {
@@ -6077,6 +6104,7 @@ _${saved ? `Saved to your config \u2014 future sessions start with these. ` : ""
6077
6104
  listRoles,
6078
6105
  adjustRoles,
6079
6106
  modelsPanel: opts.modelsPanel,
6107
+ initProject: opts.initProject,
6080
6108
  listSkills: opts.listSkills,
6081
6109
  updateSkills: opts.updateSkills,
6082
6110
  addSkill: opts.addSkill,