@takemo101/mikan 0.0.4 → 0.0.5

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 (3) hide show
  1. package/README.md +2 -2
  2. package/dist/bin.js +23 -78
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -18,7 +18,7 @@ mikan is currently built for Bun-based execution. The npm package installs the `
18
18
  - **Markdown source of truth**: each Issue is a file such as `.mikan/ready/MIK-001.md`.
19
19
  - **Primitive CLI commands**: `init`, `add`, `list`, `show`, `update`, `move`, `append`, `github`, `tui`, `watch`, `mcp`, `skills`.
20
20
  - **Keyboard TUI**: board-first flow with detail view, Note modal, Move shortcuts, and Archive confirmation.
21
- - **MCP server**: stdio tools for agents: `get_board`, `list_issues`, `get_issue`, `create_issue`, `update_issue`, `move_issue`, `append_issue`, `mirror_issue_to_github`, `push_github_mirror`.
21
+ - **MCP server**: stdio tools for agents: `get_board`, `list_issues`, `get_issue`, `create_issue`, `update_issue`, `move_issue`, `append_issue`, `mirror_issue_to_github`.
22
22
  - **GitHub Mirror**: explicit one-way publication from local Markdown Issues to GitHub Issues.
23
23
  - **Agent setup**: register the MCP server or install agent guidance for common AI agents.
24
24
  - **Watch hooks**: optional local automation on Status entry/transition.
@@ -49,7 +49,7 @@ The option changes only how many Columns are visible at once; it never changes c
49
49
 
50
50
  ## GitHub Mirror
51
51
 
52
- GitHub Mirror is one-way publication from local Markdown Issues to GitHub Issues. Configure `github.repo`, run `gh auth login`, then use `mikan github mirror`, `mikan github push`, the TUI `g` action, or MCP Mirror tools. The full manual is at <https://takemo101.github.io/mikan/github-mirror>.
52
+ GitHub Mirror is one-way publication from local Markdown Issues to GitHub Issues. Configure `github.repo`, run `gh auth login`, then use `mikan github mirror`, the TUI `g` action, or the MCP Mirror tool. The full manual is at <https://takemo101.github.io/mikan/github-mirror>.
53
53
 
54
54
  ## Agent setup
55
55
 
package/dist/bin.js CHANGED
@@ -100741,7 +100741,7 @@ function urlFromResponse(response, repo, number4, fallback) {
100741
100741
  return fallback ?? `https://github.com/${repo}/issues/${number4}`;
100742
100742
  }
100743
100743
  function utcNow2(now) {
100744
- return (now ?? (() => new Date))().toISOString().replace(".000Z", "Z");
100744
+ return (now ?? (() => new Date))().toISOString().replace(/\.\d{3}Z$/, "Z");
100745
100745
  }
100746
100746
  function formatGhFailure(error51) {
100747
100747
  return `GitHub Mirror requires the gh CLI. Install gh and run \`gh auth login\`. ${errorMessage(error51)}`;
@@ -107008,7 +107008,7 @@ function installMcpServerForAgent(agent, options = {}) {
107008
107008
  // ../mcp/src/skills/shared.ts
107009
107009
  var skillDocument = `---
107010
107010
  name: mikan
107011
- description: mikan is a local-first Issue board for AI-assisted development. Use it to read the board; create, update, move, and append to Issues; and explicitly publish GitHub Mirrors through the mikan MCP tools. Trigger when the user wants to see the board, add or change an Issue, move an Issue to another Status, record a Report or Note, publish or push a GitHub Mirror, or decide what to work on next.
107011
+ description: mikan is a local-first Issue board for AI-assisted development. Use it to read the board; create, update, move, and append to Issues; and explicitly publish GitHub Mirrors through the mikan MCP tools. Trigger when the user wants to see the board, add or change an Issue, move an Issue to another Status, record a Report or Note, publish a GitHub Mirror, or decide what to work on next.
107012
107012
  ---
107013
107013
 
107014
107014
  # mikan
@@ -107025,8 +107025,7 @@ directly:
107025
107025
  - \`update_issue\` \u2014 update an Issue's title, labels, dependencies, or body.
107026
107026
  - \`move_issue\` \u2014 move an Issue to another Status, including \`blocked\` and \`completed\`.
107027
107027
  - \`append_issue\` \u2014 append a Report (with a source) or a Note to an Issue.
107028
- - \`mirror_issue_to_github\` \u2014 explicit external-publication operation that creates or updates the GitHub Issue mirror for one local Issue.
107029
- - \`push_github_mirror\` \u2014 explicit external-publication operation that updates an already-mirrored Issue; it must not create a new GitHub Issue.
107028
+ - \`mirror_issue_to_github\` \u2014 explicit external-publication operation that creates the GitHub Issue mirror when missing or updates it when it already exists.
107030
107029
 
107031
107030
  GitHub Mirror is one-way: mikan Markdown remains the source of truth, and GitHub
107032
107031
  Issues are external mirrors only. Do not import GitHub Issues or treat GitHub as
@@ -107266,21 +107265,6 @@ async function mirrorIssueToGitHubTool(args, runtime = {}) {
107266
107265
  return coreError(result.error.kind, result.error.message);
107267
107266
  return ok(result.value);
107268
107267
  }
107269
- async function pushGitHubMirrorTool(args, runtime = {}) {
107270
- const loaded = load(runtime.cwd);
107271
- if (!loaded.ok)
107272
- return loaded;
107273
- const pushGitHubMirror2 = runtime.githubMirror?.pushGitHubMirror ?? pushGitHubMirror;
107274
- const result = await pushGitHubMirror2({
107275
- projectRoot: loaded.value.projectRoot,
107276
- config: loaded.value.config,
107277
- id: args.id,
107278
- now: runtime.now
107279
- });
107280
- if (!result.ok)
107281
- return coreError(result.error.kind, result.error.message);
107282
- return ok(result.value);
107283
- }
107284
107268
  function createMikanMcpCli(runtime = {}) {
107285
107269
  return exports_Cli.create("mikan", {
107286
107270
  description: "mikan local Issue board MCP server"
@@ -107340,10 +107324,6 @@ function createMikanMcpCli(runtime = {}) {
107340
107324
  description: "Explicit external-publication operation: create or update the GitHub Issue mirror for one local mikan Issue. Markdown remains source of truth.",
107341
107325
  args: exports_external.object({ id: exports_external.string() }),
107342
107326
  run: async (context) => forIncur(context, await mirrorIssueToGitHubTool(context.args, runtime))
107343
- }).command("push_github_mirror", {
107344
- description: "Explicit external-publication operation: push one already-mirrored mikan Issue to its GitHub Issue mirror. Does not create a new GitHub Issue.",
107345
- args: exports_external.object({ id: exports_external.string() }),
107346
- run: async (context) => forIncur(context, await pushGitHubMirrorTool(context.args, runtime))
107347
107327
  });
107348
107328
  }
107349
107329
  async function startMcpServer(runtime = {}) {
@@ -108028,6 +108008,14 @@ function moveSelection(model, selection, direction, options = {}) {
108028
108008
  const cardIndex = clamp(direction === "up" ? selection.cardIndex - 1 : direction === "down" ? selection.cardIndex + 1 : Math.min(selection.cardIndex, maxCardIndex), 0, maxCardIndex);
108029
108009
  return { ...selection, columnIndex, cardIndex };
108030
108010
  }
108011
+ function beginGitHubMirrorSubmission(selection) {
108012
+ return {
108013
+ ...selection,
108014
+ githubConfirmOpen: false,
108015
+ githubBusy: true,
108016
+ message: "GitHub mirror running..."
108017
+ };
108018
+ }
108031
108019
  function getMoveTargets(model, selection) {
108032
108020
  const currentStatus = model.columns[selection.columnIndex]?.id;
108033
108021
  return model.columns.filter((column) => column.id !== currentStatus).map((column) => ({ id: column.id, title: column.title }));
@@ -108814,7 +108802,7 @@ async function launchTui(options = {}) {
108814
108802
  if (githubBusyRef.current)
108815
108803
  return;
108816
108804
  githubBusyRef.current = true;
108817
- setSelection((current) => ({ ...current, githubBusy: true }));
108805
+ setSelection((current) => beginGitHubMirrorSubmission(current));
108818
108806
  (async () => {
108819
108807
  try {
108820
108808
  const result = await confirmSelectedIssueGitHubMirror({
@@ -108885,7 +108873,10 @@ async function launchTui(options = {}) {
108885
108873
  if (githubBusyRef.current)
108886
108874
  return;
108887
108875
  githubBusyRef.current = true;
108888
- setSelection((current) => ({ ...current, githubBusy: true }));
108876
+ const card = model.columns[selection.columnIndex]?.cards[selection.cardIndex];
108877
+ if (card?.githubIssue) {
108878
+ setSelection((current) => beginGitHubMirrorSubmission(current));
108879
+ }
108889
108880
  (async () => {
108890
108881
  try {
108891
108882
  const result = await beginSelectedIssueGitHubMirror({
@@ -108959,7 +108950,7 @@ var commandOptions = {
108959
108950
  { name: "body", short: "b", value: true },
108960
108951
  { name: "source", short: "s", value: true }
108961
108952
  ],
108962
- github: [{ name: "all", value: false }],
108953
+ github: [],
108963
108954
  mcp: [
108964
108955
  { name: "agent", short: "a", value: true },
108965
108956
  { name: "no-global", value: false },
@@ -109219,7 +109210,7 @@ function recordGitHubMirrorPushFailure(projectRoot, issueId, message, options) {
109219
109210
  appendHookFailure(projectRoot, {
109220
109211
  timestamp: utcNow3(options.now),
109221
109212
  issue_id: issueId,
109222
- command: `github push ${issueId}`,
109213
+ command: `github auto-push ${issueId}`,
109223
109214
  exit_code: 1,
109224
109215
  error: message
109225
109216
  });
@@ -109372,8 +109363,7 @@ async function runGithub(cwd, parsed, options) {
109372
109363
  const subcommand2 = parsed.positionals[0];
109373
109364
  const id = parsed.positionals[1];
109374
109365
  const operations = options.githubMirror ?? {
109375
- mirrorIssueToGitHub,
109376
- pushGitHubMirror
109366
+ mirrorIssueToGitHub
109377
109367
  };
109378
109368
  const loaded = loadProjectConfig(cwd);
109379
109369
  if (!loaded.ok)
@@ -109388,48 +109378,7 @@ async function runGithub(cwd, parsed, options) {
109388
109378
  now: options.now
109389
109379
  }), "mirrored");
109390
109380
  }
109391
- if (subcommand2 === "push") {
109392
- if (parsed.flags.has("all")) {
109393
- const board = scanBoard({
109394
- projectRoot: loaded.value.projectRoot,
109395
- config: loaded.value.config,
109396
- includeArchived: true
109397
- });
109398
- if (!board.ok)
109399
- return fail2(board.error.message);
109400
- const mirroredIssues = board.value.columns.flatMap((column) => column.issues).filter((issue2) => issue2.issue.githubIssue).map((issue2) => String(issue2.issue.id));
109401
- const outputs = [];
109402
- const warnings = [];
109403
- for (const issueId of mirroredIssues) {
109404
- const result = await operations.pushGitHubMirror({
109405
- projectRoot: loaded.value.projectRoot,
109406
- config: loaded.value.config,
109407
- id: issueId,
109408
- now: options.now
109409
- });
109410
- if (!result.ok)
109411
- return fail2(result.error.message);
109412
- outputs.push(formatGitHubMirrorSuccess(result.value, "pushed"));
109413
- warnings.push(...result.value.warnings);
109414
- }
109415
- return {
109416
- exitCode: 0,
109417
- stdout: outputs.length > 0 ? `${outputs.join(`
109418
- `)}
109419
- ` : "",
109420
- stderr: formatGitHubMirrorWarnings(warnings)
109421
- };
109422
- }
109423
- if (!id)
109424
- return fail2("Usage: mikan github push <issue-id>|--all");
109425
- return formatGitHubMirrorCliResult(await operations.pushGitHubMirror({
109426
- projectRoot: loaded.value.projectRoot,
109427
- config: loaded.value.config,
109428
- id,
109429
- now: options.now
109430
- }), "pushed");
109431
- }
109432
- return fail2("Usage: mikan github <mirror|push> ...");
109381
+ return fail2("Usage: mikan github mirror <issue-id>");
109433
109382
  }
109434
109383
  async function runWatch(cwd, parsed, options) {
109435
109384
  const lines = [];
@@ -109438,7 +109387,7 @@ async function runWatch(cwd, parsed, options) {
109438
109387
  cwd,
109439
109388
  quiet: parsed.flags.has("quiet"),
109440
109389
  githubPush: parsed.flags.has("github-push"),
109441
- githubMirror: options.githubMirror ? { pushGitHubMirror: options.githubMirror.pushGitHubMirror } : undefined,
109390
+ githubMirror: options.githubMirror?.pushGitHubMirror ? { pushGitHubMirror: options.githubMirror.pushGitHubMirror } : undefined,
109442
109391
  logger: (line) => lines.push(line),
109443
109392
  errorLogger: (line) => errors4.push(line)
109444
109393
  });
@@ -109676,7 +109625,7 @@ Commands:
109676
109625
  update Update Issue title, labels, or body
109677
109626
  move Move an Issue to another Status
109678
109627
  append Append Markdown to an Issue section
109679
- github Create or push GitHub Mirrors
109628
+ github Create or update GitHub Mirrors
109680
109629
  tui Open the read-only board
109681
109630
  watch Run the polling watcher
109682
109631
  mcp Start the stdio MCP server
@@ -109769,22 +109718,18 @@ Options:
109769
109718
  -h, --help Show this help
109770
109719
  `;
109771
109720
  case "github":
109772
- return `Create or push one-way GitHub Mirrors.
109721
+ return `Create or update one-way GitHub Mirrors.
109773
109722
 
109774
109723
  Usage:
109775
109724
  mikan github mirror <issue-id>
109776
- mikan github push <issue-id>
109777
- mikan github push --all
109778
109725
 
109779
109726
  Options:
109780
- --all With push: update every Issue that already has github_issue
109781
109727
  -h, --help Show this help
109782
109728
 
109783
109729
  Notes:
109784
109730
  Configure github.repo in .mikan/config.yaml first.
109785
109731
  GitHub Mirror uses the gh CLI; install gh and run gh auth login.
109786
109732
  mirror creates a GitHub Issue when github_issue is absent and updates it when present.
109787
- push requires an existing github_issue; push --all never creates new GitHub Issues.
109788
109733
  `;
109789
109734
  case "tui":
109790
109735
  return `Open the read-only board.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takemo101/mikan",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {