@dotobokuri/fleet-console 1.26.2 → 1.28.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.
Files changed (66) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +1 -0
  3. package/dist/cli.mjs +35386 -32937
  4. package/dist/client/assets/{_baseUniq-tUJy1-kT.js → _baseUniq-0TpVlb56.js} +1 -1
  5. package/dist/client/assets/{arc-CGw4Qvmn.js → arc-BIRhKPNZ.js} +1 -1
  6. package/dist/client/assets/{architectureDiagram-Q4EWVU46-2k-upKST.js → architectureDiagram-Q4EWVU46-CJzkivmk.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-DXYQGD6D-B6tV45QW.js → blockDiagram-DXYQGD6D-PkVBy6UB.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-AHTNJAMY-Cvz-gvmw.js → c4Diagram-AHTNJAMY-TOO0Zc07.js} +1 -1
  9. package/dist/client/assets/channel-CqmujVSi.js +1 -0
  10. package/dist/client/assets/{chunk-4BX2VUAB-D1HAKsna.js → chunk-4BX2VUAB-Ugm2Ht26.js} +1 -1
  11. package/dist/client/assets/{chunk-4TB4RGXK-CPQ1WwIY.js → chunk-4TB4RGXK-Byfwafb_.js} +1 -1
  12. package/dist/client/assets/{chunk-55IACEB6-EBDrBpcM.js → chunk-55IACEB6-2I_nwtuS.js} +1 -1
  13. package/dist/client/assets/{chunk-EDXVE4YY-DXkVIMxQ.js → chunk-EDXVE4YY-JYP41aJo.js} +1 -1
  14. package/dist/client/assets/{chunk-FMBD7UC4-Hh-pXKlX.js → chunk-FMBD7UC4-Duh-U1jY.js} +1 -1
  15. package/dist/client/assets/{chunk-OYMX7WX6-BTKoQCZt.js → chunk-OYMX7WX6-64cqkTOO.js} +1 -1
  16. package/dist/client/assets/{chunk-QZHKN3VN-t_NFg8Nt.js → chunk-QZHKN3VN-engflZJB.js} +1 -1
  17. package/dist/client/assets/{chunk-YZCP3GAM-CbbNY-Y7.js → chunk-YZCP3GAM-BwnK_1vX.js} +1 -1
  18. package/dist/client/assets/classDiagram-6PBFFD2Q-DLXkYur6.js +1 -0
  19. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DLXkYur6.js +1 -0
  20. package/dist/client/assets/clone-KonJWRw9.js +1 -0
  21. package/dist/client/assets/{cose-bilkent-S5V4N54A-ClR8SWe0.js → cose-bilkent-S5V4N54A-D43_BnnE.js} +1 -1
  22. package/dist/client/assets/{dagre-KV5264BT-CkHFxgvb.js → dagre-KV5264BT-Wh_p74YO.js} +1 -1
  23. package/dist/client/assets/{diagram-5BDNPKRD-sq8RZZQY.js → diagram-5BDNPKRD-BNcxA6wC.js} +1 -1
  24. package/dist/client/assets/{diagram-G4DWMVQ6-C6HCLzDf.js → diagram-G4DWMVQ6-HQdA06kX.js} +1 -1
  25. package/dist/client/assets/{diagram-MMDJMWI5-BI9jyS0c.js → diagram-MMDJMWI5-DlMdX_ng.js} +1 -1
  26. package/dist/client/assets/{diagram-TYMM5635-BfWdzF7z.js → diagram-TYMM5635-C1hKAjZD.js} +1 -1
  27. package/dist/client/assets/{erDiagram-SMLLAGMA-Cw8mj3en.js → erDiagram-SMLLAGMA-CsSiuv9G.js} +1 -1
  28. package/dist/client/assets/{flowDiagram-DWJPFMVM-DXiFqtKz.js → flowDiagram-DWJPFMVM-DfjQ3Ug9.js} +1 -1
  29. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-CFNR4A1x.js → ganttDiagram-T4ZO3ILL-B0QHKePg.js} +1 -1
  30. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-vYNjJsh8.js → gitGraphDiagram-UUTBAWPF-_zejoqTH.js} +1 -1
  31. package/dist/client/assets/{graph-CGkhzltD.js → graph-Dr6IPcji.js} +1 -1
  32. package/dist/client/assets/index-CsmxZ8UQ.js +453 -0
  33. package/dist/client/assets/index-DC8tBAf_.css +1 -0
  34. package/dist/client/assets/{infoDiagram-42DDH7IO-C4lcu1mS.js → infoDiagram-42DDH7IO-dhruAwPt.js} +1 -1
  35. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-D2E79gEK.js → ishikawaDiagram-UXIWVN3A-DPoZZiH0.js} +1 -1
  36. package/dist/client/assets/{journeyDiagram-VCZTEJTY-CMJAA45g.js → journeyDiagram-VCZTEJTY-DQk8gmrd.js} +1 -1
  37. package/dist/client/assets/{kanban-definition-6JOO6SKY-BYnBQou2.js → kanban-definition-6JOO6SKY-B9rOgVFq.js} +1 -1
  38. package/dist/client/assets/{layout-CyfFEQ40.js → layout-D54BXsv2.js} +1 -1
  39. package/dist/client/assets/{linear-C2wjQAuy.js → linear-DJxG7kFF.js} +1 -1
  40. package/dist/client/assets/{mermaid.core-CKMZH6J-.js → mermaid.core-BBFWA-zA.js} +4 -4
  41. package/dist/client/assets/{min-B0B_lTwc.js → min-Dv_aLAYb.js} +1 -1
  42. package/dist/client/assets/{mindmap-definition-QFDTVHPH-DDP_qkv3.js → mindmap-definition-QFDTVHPH-Dv5woCon.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-DEJITSTG-Cknm2rtj.js → pieDiagram-DEJITSTG-B_V_vCG8.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-DZARSnQm.js → quadrantDiagram-34T5L4WZ-QHqq3tFD.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-MS252O5E-Bm_GIARG.js → requirementDiagram-MS252O5E-BhPhfMzK.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-XADWPNL6-BUCr78fU.js → sankeyDiagram-XADWPNL6-D2-ZsaS_.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-FGHM5R23-Coq-jYr8.js → sequenceDiagram-FGHM5R23-Di0qgM3v.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-FHFEXIEX-CIZCg5tw.js → stateDiagram-FHFEXIEX-BAuqrwY8.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DhNebJyd.js +1 -0
  50. package/dist/client/assets/{timeline-definition-GMOUNBTQ-CxRr-mP_.js → timeline-definition-GMOUNBTQ-BcMGkC6T.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-DHZGUBPP-CWWV2O4a.js → vennDiagram-DHZGUBPP-C9dkwyKX.js} +1 -1
  52. package/dist/client/assets/{wardley-RL74JXVD-CwkNZigV.js → wardley-RL74JXVD-BLLCncPa.js} +1 -1
  53. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-CMF3BkPH.js → wardleyDiagram-NUSXRM2D-Yb9mlL0_.js} +1 -1
  54. package/dist/client/assets/{xychartDiagram-5P7HB3ND-C1MudNRb.js → xychartDiagram-5P7HB3ND-BAHLdje7.js} +1 -1
  55. package/dist/client/index.html +2 -2
  56. package/dist/fleet-plugins/{diff → repository}/routes.mjs +148 -22
  57. package/dist/fleet-plugins/skills/routes.mjs +41 -0
  58. package/dist/fleet-plugins/terminal/routes.mjs +4659 -984
  59. package/package.json +3 -2
  60. package/dist/client/assets/channel-CwKYdtaM.js +0 -1
  61. package/dist/client/assets/classDiagram-6PBFFD2Q-BMulJ6hF.js +0 -1
  62. package/dist/client/assets/classDiagram-v2-HSJHXN6E-BMulJ6hF.js +0 -1
  63. package/dist/client/assets/clone-D76WC0Bz.js +0 -1
  64. package/dist/client/assets/index-BmhFrtGr.css +0 -1
  65. package/dist/client/assets/index-CZYuPH8_.js +0 -395
  66. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-I40ud2eo.js +0 -1
@@ -8,12 +8,12 @@ import fs from 'fs/promises';
8
8
  function definePlugin(definition) {
9
9
  return definition;
10
10
  }
11
- function registerRouter(ctx, path4, handler) {
12
- ctx.registerRouter(normalizePath(path4), handler);
11
+ function registerRouter(ctx, path5, handler) {
12
+ ctx.registerRouter(normalizePath(path5), handler);
13
13
  }
14
- function normalizePath(path4) {
15
- if (path4.length === 0 || path4 === "/") return "/";
16
- return path4;
14
+ function normalizePath(path5) {
15
+ if (path5.length === 0 || path5 === "/") return "/";
16
+ return path5;
17
17
  }
18
18
 
19
19
  // ../../packages/core-process/src/hidden.ts
@@ -21,7 +21,7 @@ function withHidden(options) {
21
21
  return { ...options ?? {}, windowsHide: true };
22
22
  }
23
23
 
24
- // ../fleet-plugins/diff/server/git-executor.ts
24
+ // ../fleet-plugins/repository/server/git-executor.ts
25
25
  var GitExecutorError = class extends Error {
26
26
  code;
27
27
  exitCode;
@@ -173,7 +173,7 @@ async function resolveGitCwd(theaterPath, rawSubPath) {
173
173
  if (realSub !== realTheater && !realSub.startsWith(norm)) return null;
174
174
  return { gitCwd: resolvedSub };
175
175
  }
176
- async function handleDiffChanged(req, res, ctx) {
176
+ async function handleRepositoryChanged(req, res, ctx) {
177
177
  if (req.method !== "POST") {
178
178
  ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
179
179
  return;
@@ -242,7 +242,7 @@ async function handleDiffChanged(req, res, ctx) {
242
242
  throw error;
243
243
  }
244
244
  }
245
- async function handleDiffFile(req, res, ctx) {
245
+ async function handleRepositoryFile(req, res, ctx) {
246
246
  if (req.method !== "POST") {
247
247
  ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
248
248
  return;
@@ -345,7 +345,7 @@ async function handleDiffFile(req, res, ctx) {
345
345
  }
346
346
  }
347
347
 
348
- // ../fleet-plugins/diff/server/commit.ts
348
+ // ../fleet-plugins/repository/server/commit.ts
349
349
  var REF_RE = /^[0-9a-f]{7,40}$/i;
350
350
  function isPlainObject2(value) {
351
351
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -366,7 +366,7 @@ function parseCommitMeta(output) {
366
366
  parents: rawParents.split(" ").filter(Boolean).map((full) => ({ full, short: full.slice(0, 9) }))
367
367
  };
368
368
  }
369
- async function handleDiffCommit(req, res, ctx) {
369
+ async function handleRepositoryCommit(req, res, ctx) {
370
370
  if (req.method !== "POST") {
371
371
  ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
372
372
  return;
@@ -442,7 +442,7 @@ function resolveLiteralFilePath(gitCwd, rawPath) {
442
442
  function literalPathspec2(relativePath) {
443
443
  return `:(literal)${relativePath}`;
444
444
  }
445
- async function handleDiffCommitFile(req, res, ctx) {
445
+ async function handleRepositoryCommitFile(req, res, ctx) {
446
446
  if (req.method !== "POST") {
447
447
  ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
448
448
  return;
@@ -500,17 +500,22 @@ async function handleDiffCommitFile(req, res, ctx) {
500
500
  }
501
501
  }
502
502
  var WORKTREE_SHA_RE = /^[0-9a-f]{40}$/;
503
+ var CANONICAL_REF_RE = /^refs\/(?:heads|remotes|tags)\//;
504
+ var REF_METACHAR_RE = /[~^:?*\[\\\s\x00-\x1f\x7f]/;
503
505
  function isPlainObject4(value) {
504
506
  return typeof value === "object" && value !== null && !Array.isArray(value);
505
507
  }
508
+ function isCanonicalRepositoryRef(ref) {
509
+ return CANONICAL_REF_RE.test(ref) && !ref.startsWith("-") && !ref.includes("..") && !ref.includes("//") && !REF_METACHAR_RE.test(ref) && !ref.includes("@{") && !ref.endsWith("/") && !ref.endsWith(".") && !ref.split("/").some((part) => part.startsWith(".") || part.endsWith(".lock"));
510
+ }
506
511
  function parseLogOutput(stdout) {
507
512
  if (!stdout.trim()) return [];
508
513
  const commits = [];
509
514
  for (const chunk of stdout.split("")) {
510
515
  const trimmed = chunk.trimStart();
511
516
  if (!trimmed) continue;
512
- const lines = trimmed.split("\n");
513
- const firstLine = lines[0] ?? "";
517
+ const lines2 = trimmed.split("\n");
518
+ const firstLine = lines2[0] ?? "";
514
519
  const fields = firstLine.split("\0");
515
520
  const fullHash = fields[0] ?? "";
516
521
  const shortHash = fields[1] ?? "";
@@ -608,7 +613,7 @@ async function readCurrentWorktreePath(gitCwd) {
608
613
  throw error;
609
614
  }
610
615
  }
611
- async function handleDiffLog(req, res, ctx) {
616
+ async function handleRepositoryLog(req, res, ctx) {
612
617
  if (req.method !== "POST") {
613
618
  ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
614
619
  return;
@@ -639,7 +644,13 @@ async function handleDiffLog(req, res, ctx) {
639
644
  return;
640
645
  }
641
646
  const { gitCwd } = cwdResult;
647
+ const requestedRef = body.ref;
648
+ if (requestedRef !== void 0 && (typeof requestedRef !== "string" || !isCanonicalRepositoryRef(requestedRef))) {
649
+ ctx.host.http.writeJson(res, 400, { error: "invalid_ref" });
650
+ return;
651
+ }
642
652
  try {
653
+ const resolvedRef = typeof requestedRef === "string" ? (await runGit(["rev-parse", "--verify", "--end-of-options", `${requestedRef}^{commit}`], { cwd: gitCwd })).stdout.trim() : null;
643
654
  const [worktrees, currentWorktreePath, headRevList] = await Promise.all([
644
655
  runGit(["worktree", "list", "--porcelain"], { cwd: gitCwd }),
645
656
  readCurrentWorktreePath(gitCwd),
@@ -648,7 +659,7 @@ async function handleDiffLog(req, res, ctx) {
648
659
  const checkouts = await parseWorktreePorcelain(worktrees.stdout, currentWorktreePath);
649
660
  const worktreeRevs = [...new Set(checkouts.map((checkout) => checkout.sha))].filter((sha) => WORKTREE_SHA_RE.test(sha) && !/^0+$/.test(sha));
650
661
  const headRevs = headRevList ? ["HEAD"] : [];
651
- const result = await runGit(
662
+ const result = resolvedRef ? await runGit(["log", resolvedRef, "--date-order", "-n", "200", "--relative", "--decorate=full", "--pretty=format:%x1e%H%x00%h%x00%s%x00%an%x00%ar%x00%at%x00%D%x00%P", "--", "."], { cwd: gitCwd }) : await runGit(
652
663
  // --all은 refs/stash·refs/notes까지 그래프에 유입시키므로 브랜치/태그/원격 + 현재 HEAD + 워크트리 HEAD로 한정한다
653
664
  ["log", "--branches", "--tags", "--remotes", "--date-order", "-n", "200", "--relative", "--decorate=full", "--pretty=format:%x1e%H%x00%h%x00%s%x00%an%x00%ar%x00%at%x00%D%x00%P", ...headRevs, ...worktreeRevs, "--", "."],
654
665
  { cwd: gitCwd }
@@ -657,6 +668,10 @@ async function handleDiffLog(req, res, ctx) {
657
668
  ctx.host.http.writeJson(res, 200, { commits, checkouts, ...result.truncated ? { truncated: true } : {} });
658
669
  } catch (error) {
659
670
  if (error instanceof GitExecutorError) {
671
+ if (requestedRef !== void 0 && error.code === "non_zero_exit") {
672
+ ctx.host.http.writeJson(res, 400, { error: "invalid_ref" });
673
+ return;
674
+ }
660
675
  if (error.code === "no_git_repo") {
661
676
  ctx.host.http.writeJson(res, 200, { commits: [], checkouts: [] });
662
677
  return;
@@ -675,29 +690,140 @@ async function handleDiffLog(req, res, ctx) {
675
690
  throw error;
676
691
  }
677
692
  }
693
+ function isObject(value) {
694
+ return typeof value === "object" && value !== null && !Array.isArray(value);
695
+ }
696
+ function lines(stdout) {
697
+ return stdout.split("\n").map((line) => line.trim()).filter(Boolean);
698
+ }
699
+ function parseRefItems(stdout, current) {
700
+ return lines(stdout).flatMap((line) => {
701
+ const [ref, label] = line.split("\0");
702
+ return ref && label ? [{ ref, label, current: ref === current }] : [];
703
+ });
704
+ }
705
+ async function readCurrentWorktreePath2(gitCwd) {
706
+ try {
707
+ return (await runGit(["rev-parse", "--show-toplevel"], { cwd: gitCwd })).stdout.trim();
708
+ } catch (error) {
709
+ if (error instanceof GitExecutorError) return "";
710
+ throw error;
711
+ }
712
+ }
713
+ async function readStashes(gitCwd) {
714
+ try {
715
+ return (await runGit(["stash", "list", "--format=%gd%x00%s"], { cwd: gitCwd })).stdout;
716
+ } catch (error) {
717
+ if (error instanceof GitExecutorError) return "";
718
+ throw error;
719
+ }
720
+ }
721
+ async function parseWorktrees(stdout, currentWorktreePath, theaterPath, deps = {}) {
722
+ const records = stdout.split("\n\n").map((record) => record.split("\n"));
723
+ const realpath = deps.realpath ?? fs.realpath;
724
+ const normalizedCurrent = currentWorktreePath ? await realpath(currentWorktreePath).catch(() => currentWorktreePath) : "";
725
+ const realTheaterPath = await realpath(theaterPath).catch(() => null);
726
+ return Promise.all(records.flatMap((record) => {
727
+ const rawPath = record.find((line) => line.startsWith("worktree "))?.slice(9);
728
+ if (!rawPath) return [];
729
+ const branchRef = record.find((line) => line.startsWith("branch "))?.slice(7) ?? null;
730
+ const branch = branchRef?.startsWith("refs/heads/") ? branchRef.slice(11) : null;
731
+ return [{ rawPath, name: path2.basename(rawPath) || "worktree", branch }];
732
+ }).map(async ({ rawPath, ...item }) => {
733
+ const realWorktreePath = await realpath(rawPath).catch(() => null);
734
+ const currentPath = realWorktreePath ?? rawPath;
735
+ const contextRelPath = realTheaterPath !== null && realWorktreePath !== null && isWithinTheater(realWorktreePath, realTheaterPath) ? path2.relative(realTheaterPath, realWorktreePath).split(path2.sep).join("/") : null;
736
+ return { ...item, current: normalizedCurrent !== "" && currentPath === normalizedCurrent, contextRelPath };
737
+ }));
738
+ }
739
+ function isWithinTheater(candidate, theaterPath) {
740
+ const normalizedTheaterPath = theaterPath.endsWith(path2.sep) ? theaterPath : `${theaterPath}${path2.sep}`;
741
+ return candidate === theaterPath || candidate.startsWith(normalizedTheaterPath);
742
+ }
743
+ async function handleRepositoryRefs(req, res, ctx) {
744
+ if (req.method !== "POST") {
745
+ ctx.host.http.writeJson(res, 405, { error: "Method not allowed" });
746
+ return;
747
+ }
748
+ if (!ctx.host.security.isTerminalAuthorized(req)) {
749
+ ctx.host.http.writeJson(res, 401, { error: "unauthorized" });
750
+ return;
751
+ }
752
+ const body = await ctx.host.http.readJsonBody(req);
753
+ if (!isObject(body) || typeof body.theaterId !== "string") {
754
+ ctx.host.http.writeJson(res, 400, { error: "invalid_request" });
755
+ return;
756
+ }
757
+ const theaterPath = ctx.host.paths.resolveTheaterPath(body.theaterId);
758
+ if (!theaterPath) {
759
+ ctx.host.http.writeJson(res, 404, { error: "theater_not_found" });
760
+ return;
761
+ }
762
+ const resolved = await resolveGitCwd(theaterPath, typeof body.subPath === "string" ? body.subPath : "");
763
+ if (!resolved) {
764
+ ctx.host.http.writeJson(res, 403, { error: "path_outside_theater" });
765
+ return;
766
+ }
767
+ try {
768
+ const [head, local, remote, tags, stashes, worktrees] = await Promise.all([
769
+ runGit(["symbolic-ref", "--quiet", "HEAD"], { cwd: resolved.gitCwd, allowExitCodes: [1] }),
770
+ runGit(["for-each-ref", "--format=%(refname)%00%(refname:short)", "refs/heads"], { cwd: resolved.gitCwd }),
771
+ runGit(["for-each-ref", "--format=%(refname)%00%(refname:short)", "refs/remotes"], { cwd: resolved.gitCwd }),
772
+ runGit(["for-each-ref", "--format=%(refname)%00%(refname:short)", "refs/tags"], { cwd: resolved.gitCwd }),
773
+ readStashes(resolved.gitCwd),
774
+ runGit(["worktree", "list", "--porcelain"], { cwd: resolved.gitCwd })
775
+ ]);
776
+ const current = head.stdout.trim();
777
+ const currentWorktreePath = await readCurrentWorktreePath2(resolved.gitCwd);
778
+ ctx.host.http.writeJson(res, 200, {
779
+ branches: parseRefItems(local.stdout, current),
780
+ remotes: parseRefItems(remote.stdout, current),
781
+ tags: parseRefItems(tags.stdout, current),
782
+ stashes: lines(stashes).map((line) => {
783
+ const [name, subject = ""] = line.split("\0");
784
+ return { name, subject };
785
+ }),
786
+ worktrees: await parseWorktrees(worktrees.stdout, currentWorktreePath, theaterPath)
787
+ });
788
+ } catch (error) {
789
+ if (error instanceof GitExecutorError && error.code === "no_git_repo") {
790
+ ctx.host.http.writeJson(res, 200, { branches: [], remotes: [], tags: [], stashes: [], worktrees: [] });
791
+ return;
792
+ }
793
+ if (error instanceof GitExecutorError && error.code === "git_unavailable") {
794
+ ctx.host.http.writeJson(res, 422, { error: error.code });
795
+ return;
796
+ }
797
+ ctx.host.http.writeJson(res, 500, { error: "git_failed" });
798
+ }
799
+ }
678
800
 
679
- // ../fleet-plugins/diff/routes.ts
801
+ // ../fleet-plugins/repository/routes.ts
680
802
  var routes_default = definePlugin({
681
- id: "diff",
803
+ id: "repository",
682
804
  register(ctx) {
683
805
  registerRouter(ctx, "changed", async ({ req, res }) => {
684
- await handleDiffChanged(req, res, ctx);
806
+ await handleRepositoryChanged(req, res, ctx);
685
807
  return true;
686
808
  });
687
809
  registerRouter(ctx, "file", async ({ req, res }) => {
688
- await handleDiffFile(req, res, ctx);
810
+ await handleRepositoryFile(req, res, ctx);
689
811
  return true;
690
812
  });
691
813
  registerRouter(ctx, "log", async ({ req, res }) => {
692
- await handleDiffLog(req, res, ctx);
814
+ await handleRepositoryLog(req, res, ctx);
815
+ return true;
816
+ });
817
+ registerRouter(ctx, "refs", async ({ req, res }) => {
818
+ await handleRepositoryRefs(req, res, ctx);
693
819
  return true;
694
820
  });
695
821
  registerRouter(ctx, "commit", async ({ req, res }) => {
696
- await handleDiffCommit(req, res, ctx);
822
+ await handleRepositoryCommit(req, res, ctx);
697
823
  return true;
698
824
  });
699
825
  registerRouter(ctx, "commit-file", async ({ req, res }) => {
700
- await handleDiffCommitFile(req, res, ctx);
826
+ await handleRepositoryCommitFile(req, res, ctx);
701
827
  return true;
702
828
  });
703
829
  }
@@ -16402,6 +16402,21 @@ var models_default = {
16402
16402
  { modelId: "claude-opus-4-8[1m]", name: "Claude Opus 4.8 [1M]", effort: { supported: true, levels: ["low", "medium", "high", "xhigh", "max"], default: "high" } }
16403
16403
  ]
16404
16404
  },
16405
+ "claude-kimi": {
16406
+ name: "Kimi via Claude Code",
16407
+ defaultModel: "kimi-for-coding",
16408
+ models: [
16409
+ { modelId: "kimi-for-coding", name: "Kimi for Coding", description: "Available on every Kimi Code membership tier (262K context)", effort: { supported: false } },
16410
+ { modelId: "k3", name: "Kimi K3", description: "Available on Moderato and higher tiers (262K context)", effort: { supported: true, levels: ["max"], default: "max" } },
16411
+ { modelId: "k3[1m]", name: "Kimi K3 [1M]", description: "Available on Allegretto and higher tiers (1M context)", effort: { supported: true, levels: ["max"], default: "max" } },
16412
+ { modelId: "kimi-for-coding-highspeed", name: "Kimi for Coding Highspeed", description: "Available on Allegretto and higher tiers (262K context)", effort: { supported: false } }
16413
+ ],
16414
+ modelsMapping: {
16415
+ haiku: "kimi-for-coding",
16416
+ sonnet: "kimi-for-coding",
16417
+ opus: "kimi-for-coding"
16418
+ }
16419
+ },
16405
16420
  codex: {
16406
16421
  name: "Codex",
16407
16422
  defaultModel: "gpt-5.6-sol",
@@ -16554,6 +16569,32 @@ var CLI_BACKENDS = {
16554
16569
  usesNpxBridge: true,
16555
16570
  defaultMaxTokens: 16384
16556
16571
  },
16572
+ "claude-kimi": {
16573
+ id: "claude-kimi",
16574
+ cliCommand: "claude",
16575
+ protocol: "acp",
16576
+ authRequired: true,
16577
+ npxPackage: "@agentclientprotocol/claude-agent-acp@0.33.1",
16578
+ modes: [
16579
+ { id: "default", label: "Default" },
16580
+ { id: "plan", label: "Plan" },
16581
+ { id: "bypassPermissions", label: "YOLO" }
16582
+ ],
16583
+ supportsSessionClose: true,
16584
+ supportsSessionLoad: true,
16585
+ requiresModelAtSpawn: false,
16586
+ usesNpxBridge: true,
16587
+ defaultMaxTokens: 262144,
16588
+ defaultEnv: {
16589
+ ANTHROPIC_BASE_URL: "https://api.kimi.com/coding/",
16590
+ ANTHROPIC_MODEL: "kimi-for-coding",
16591
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: "kimi-for-coding",
16592
+ ANTHROPIC_DEFAULT_SONNET_MODEL: "kimi-for-coding",
16593
+ ANTHROPIC_DEFAULT_OPUS_MODEL: "kimi-for-coding",
16594
+ CLAUDE_CODE_SUBAGENT_MODEL: "kimi-for-coding",
16595
+ API_TIMEOUT_MS: "3000000"
16596
+ }
16597
+ },
16557
16598
  codex: {
16558
16599
  id: "codex",
16559
16600
  cliCommand: "codex",