@takemo101/mikan 0.0.4 → 0.0.6

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 +49 -93
  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 = {}) {
@@ -107406,27 +107386,38 @@ function coreError(code, message) {
107406
107386
 
107407
107387
  // ../tui/src/index.ts
107408
107388
  var import_react20 = __toESM(require_react(), 1);
107409
- // ../tui/package.json
107389
+ // package.json
107410
107390
  var package_default = {
107411
- name: "@mikan/tui",
107412
- version: "0.0.3",
107413
- private: true,
107391
+ name: "@takemo101/mikan",
107392
+ version: "0.0.6",
107393
+ private: false,
107414
107394
  type: "module",
107415
- exports: {
107416
- ".": "./src/index.ts"
107395
+ bin: {
107396
+ mikan: "dist/bin.js"
107397
+ },
107398
+ repository: {
107399
+ type: "git",
107400
+ url: "https://github.com/takemo101/mikan"
107401
+ },
107402
+ files: [
107403
+ "dist"
107404
+ ],
107405
+ publishConfig: {
107406
+ access: "public"
107407
+ },
107408
+ optionalDependencies: {
107409
+ "@opentui/core-darwin-arm64": "0.3.0",
107410
+ "@opentui/core-darwin-x64": "0.3.0",
107411
+ "@opentui/core-linux-arm64": "0.3.0",
107412
+ "@opentui/core-linux-x64": "0.3.0",
107413
+ "@opentui/core-win32-arm64": "0.3.0",
107414
+ "@opentui/core-win32-x64": "0.3.0"
107417
107415
  },
107418
107416
  scripts: {
107419
- build: "tsc -p ../../tsconfig.json --noEmit",
107417
+ build: "bun run build:dist && tsc -p ../../tsconfig.json --noEmit",
107418
+ "build:dist": "bun build ./src/bin.ts --target=bun --outdir=./dist --entry-naming=bin.js",
107420
107419
  typecheck: "tsc -p ../../tsconfig.json --noEmit",
107421
107420
  test: "bun test"
107422
- },
107423
- dependencies: {
107424
- "@mikan/core": "workspace:*",
107425
- "@mikan/github": "workspace:*",
107426
- "@mikan/project-config": "workspace:*",
107427
- "@opentui/core": "latest",
107428
- "@opentui/react": "latest",
107429
- react: "latest"
107430
107421
  }
107431
107422
  };
107432
107423
 
@@ -108028,6 +108019,14 @@ function moveSelection(model, selection, direction, options = {}) {
108028
108019
  const cardIndex = clamp(direction === "up" ? selection.cardIndex - 1 : direction === "down" ? selection.cardIndex + 1 : Math.min(selection.cardIndex, maxCardIndex), 0, maxCardIndex);
108029
108020
  return { ...selection, columnIndex, cardIndex };
108030
108021
  }
108022
+ function beginGitHubMirrorSubmission(selection) {
108023
+ return {
108024
+ ...selection,
108025
+ githubConfirmOpen: false,
108026
+ githubBusy: true,
108027
+ message: "GitHub mirror running..."
108028
+ };
108029
+ }
108031
108030
  function getMoveTargets(model, selection) {
108032
108031
  const currentStatus = model.columns[selection.columnIndex]?.id;
108033
108032
  return model.columns.filter((column) => column.id !== currentStatus).map((column) => ({ id: column.id, title: column.title }));
@@ -108814,7 +108813,7 @@ async function launchTui(options = {}) {
108814
108813
  if (githubBusyRef.current)
108815
108814
  return;
108816
108815
  githubBusyRef.current = true;
108817
- setSelection((current) => ({ ...current, githubBusy: true }));
108816
+ setSelection((current) => beginGitHubMirrorSubmission(current));
108818
108817
  (async () => {
108819
108818
  try {
108820
108819
  const result = await confirmSelectedIssueGitHubMirror({
@@ -108885,7 +108884,10 @@ async function launchTui(options = {}) {
108885
108884
  if (githubBusyRef.current)
108886
108885
  return;
108887
108886
  githubBusyRef.current = true;
108888
- setSelection((current) => ({ ...current, githubBusy: true }));
108887
+ const card = model.columns[selection.columnIndex]?.cards[selection.cardIndex];
108888
+ if (card?.githubIssue) {
108889
+ setSelection((current) => beginGitHubMirrorSubmission(current));
108890
+ }
108889
108891
  (async () => {
108890
108892
  try {
108891
108893
  const result = await beginSelectedIssueGitHubMirror({
@@ -108959,7 +108961,7 @@ var commandOptions = {
108959
108961
  { name: "body", short: "b", value: true },
108960
108962
  { name: "source", short: "s", value: true }
108961
108963
  ],
108962
- github: [{ name: "all", value: false }],
108964
+ github: [],
108963
108965
  mcp: [
108964
108966
  { name: "agent", short: "a", value: true },
108965
108967
  { name: "no-global", value: false },
@@ -109219,7 +109221,7 @@ function recordGitHubMirrorPushFailure(projectRoot, issueId, message, options) {
109219
109221
  appendHookFailure(projectRoot, {
109220
109222
  timestamp: utcNow3(options.now),
109221
109223
  issue_id: issueId,
109222
- command: `github push ${issueId}`,
109224
+ command: `github auto-push ${issueId}`,
109223
109225
  exit_code: 1,
109224
109226
  error: message
109225
109227
  });
@@ -109372,8 +109374,7 @@ async function runGithub(cwd, parsed, options) {
109372
109374
  const subcommand2 = parsed.positionals[0];
109373
109375
  const id = parsed.positionals[1];
109374
109376
  const operations = options.githubMirror ?? {
109375
- mirrorIssueToGitHub,
109376
- pushGitHubMirror
109377
+ mirrorIssueToGitHub
109377
109378
  };
109378
109379
  const loaded = loadProjectConfig(cwd);
109379
109380
  if (!loaded.ok)
@@ -109388,48 +109389,7 @@ async function runGithub(cwd, parsed, options) {
109388
109389
  now: options.now
109389
109390
  }), "mirrored");
109390
109391
  }
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> ...");
109392
+ return fail2("Usage: mikan github mirror <issue-id>");
109433
109393
  }
109434
109394
  async function runWatch(cwd, parsed, options) {
109435
109395
  const lines = [];
@@ -109438,7 +109398,7 @@ async function runWatch(cwd, parsed, options) {
109438
109398
  cwd,
109439
109399
  quiet: parsed.flags.has("quiet"),
109440
109400
  githubPush: parsed.flags.has("github-push"),
109441
- githubMirror: options.githubMirror ? { pushGitHubMirror: options.githubMirror.pushGitHubMirror } : undefined,
109401
+ githubMirror: options.githubMirror?.pushGitHubMirror ? { pushGitHubMirror: options.githubMirror.pushGitHubMirror } : undefined,
109442
109402
  logger: (line) => lines.push(line),
109443
109403
  errorLogger: (line) => errors4.push(line)
109444
109404
  });
@@ -109676,7 +109636,7 @@ Commands:
109676
109636
  update Update Issue title, labels, or body
109677
109637
  move Move an Issue to another Status
109678
109638
  append Append Markdown to an Issue section
109679
- github Create or push GitHub Mirrors
109639
+ github Create or update GitHub Mirrors
109680
109640
  tui Open the read-only board
109681
109641
  watch Run the polling watcher
109682
109642
  mcp Start the stdio MCP server
@@ -109769,22 +109729,18 @@ Options:
109769
109729
  -h, --help Show this help
109770
109730
  `;
109771
109731
  case "github":
109772
- return `Create or push one-way GitHub Mirrors.
109732
+ return `Create or update one-way GitHub Mirrors.
109773
109733
 
109774
109734
  Usage:
109775
109735
  mikan github mirror <issue-id>
109776
- mikan github push <issue-id>
109777
- mikan github push --all
109778
109736
 
109779
109737
  Options:
109780
- --all With push: update every Issue that already has github_issue
109781
109738
  -h, --help Show this help
109782
109739
 
109783
109740
  Notes:
109784
109741
  Configure github.repo in .mikan/config.yaml first.
109785
109742
  GitHub Mirror uses the gh CLI; install gh and run gh auth login.
109786
109743
  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
109744
  `;
109789
109745
  case "tui":
109790
109746
  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.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {