kanbo-cli 0.1.1 → 0.1.2

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.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_manifest = require("./manifest-wdwFSquz.cjs");
2
+ const require_manifest = require("./manifest-CmiuDqH-.cjs");
3
3
  const require_migrations_path = require("./migrations-path-CZxVOgeD.cjs");
4
4
  //#region src/ops/board-copy.ts
5
5
  /** Nothing copied — what a move that had nothing to move reports. */
@@ -1,4 +1,4 @@
1
- import { $ as formatActivityIssueReference, A as createBoardOps, B as serializeEntryRules, C as BINDING_FILE_PATH, D as writeBinding, E as readProjectBinding, F as ENTRY_RULE_DESCRIPTIONS, G as TRACKED_FIELDS, H as runBoardWrite, I as UNMET_ENTRY_RULE_REASONS, J as currentUnixSeconds, K as diffFieldChanges, L as evaluateEntryRules, M as parseExternalSessionRef, N as pullRequestFactKeys, O as maskDatabaseUrl, P as ENTRY_RULES, Q as commentAuthorReference, R as readChecklist, S as cardDisplayTitle, T as readBinding, U as DEFAULT_STATUSES, V as readChangeSeq, W as normalizeStatusName, X as activityText, Y as activityKindOrder, Z as activityToken, a as BOARD_ERROR_RESPONSES, at as normalizeCommentAuthorKind, b as DEFAULT_BOARD_FILE_PATH, ct as nextIssueIdentity, dt as readIssuePrefix, et as formatPlainActivityValue, i as KANBO_TOOL_NAMES, it as isOutsideWriter, j as formatExternalSessionRef, k as maskDatabaseUrls, lt as nextIssueNumber, n as buildCapabilitiesManifest, nt as parseActivityStringArray, ot as toIssueView, q as BOARD_ACTOR, r as KANBO_TOOL_CLI_EQUIVALENTS, rt as readSystemCommentKind, st as formatIssueId, t as CAPABILITIES_MANIFEST_VERSION, tt as isEmptyActivityValue, ut as nextIssueOrder, w as ignoreBoardFile, x as renderCapabilitiesMarkdown, z as readEntryRules } from "./manifest-DfOBqo-Q.mjs";
1
+ import { $ as commentAuthorReference, A as maskDatabaseUrls, B as readEntryRules, C as cardDisplayTitle, D as readProjectBinding, E as readBinding, F as ENTRY_RULES, G as normalizeStatusName, H as readChangeSeq, I as ENTRY_RULE_DESCRIPTIONS, J as BOARD_ACTOR, K as TRACKED_FIELDS, L as UNMET_ENTRY_RULE_REASONS, M as formatExternalSessionRef, N as parseExternalSessionRef, O as writeBinding, P as pullRequestFactKeys, Q as activityToken, R as evaluateEntryRules, S as renderCapabilitiesMarkdown, T as ignoreBoardFile, U as runBoardWrite, V as serializeEntryRules, W as DEFAULT_STATUSES, X as activityKindOrder, Y as currentUnixSeconds, Z as activityText, a as BOARD_ERROR_RESPONSES, at as isOutsideWriter, ct as formatIssueId, dt as nextIssueOrder, et as formatActivityIssueReference, ft as readIssuePrefix, i as KANBO_TOOL_NAMES, it as readSystemCommentKind, j as createBoardOps, k as maskDatabaseUrl, lt as nextIssueIdentity, n as buildCapabilitiesManifest, nt as isEmptyActivityValue, ot as normalizeCommentAuthorKind, q as diffFieldChanges, r as KANBO_TOOL_CLI_EQUIVALENTS, rt as parseActivityStringArray, st as toIssueView, t as CAPABILITIES_MANIFEST_VERSION, tt as formatPlainActivityValue, ut as nextIssueNumber, w as BINDING_FILE_PATH, x as DEFAULT_BOARD_FILE_PATH, z as readChecklist } from "./manifest-NRhhhOkC.mjs";
2
2
  import { a as BoardError } from "./migrations-path-Ciwan537.mjs";
3
3
  //#region src/ops/board-copy.ts
4
4
  /** Nothing copied — what a move that had nothing to move reports. */
@@ -2314,32 +2314,61 @@ async function migrateCards(store, input) {
2314
2314
  };
2315
2315
  }
2316
2316
  //#endregion
2317
- //#region src/ops/prime.ts
2318
- /**
2319
- * The rules of this board, as an agent needs to hear them.
2317
+ //#region src/ops/agent-rules.ts
2318
+ /**
2319
+ * The sentences that tell an agent how to work this board, written once.
2320
+ *
2321
+ * Four surfaces say them: the text `kanbo prime` returns (`BOARD_RULES`), the
2322
+ * block `kanbo init` writes into a project's `CLAUDE.md` / `AGENTS.md`, the
2323
+ * `instructions` the `kanbo mcp` server sends when a client connects, and the
2324
+ * `kanbo_card_create` tool's description. Each surface adds its own way of
2325
+ * doing the thing — a command, a tool name — but the rule itself is read from
2326
+ * here, so the four cannot come to say different things.
2327
+ *
2328
+ * No sentence names a tool or a command: the same text reaches an agent holding
2329
+ * MCP tools, one with a command line, and one talking to a server over HTTP.
2330
+ */
2331
+ const MOVE_CARD_RULE = "You move the card between columns yourself, at the moment its real state changes. The board never moves a card for you.";
2332
+ const STATUS_LINE_RULE = "Write a status line at every step, including before and after anything long-running. One sentence, present tense, about what is happening right now.";
2333
+ const WAIT_FOR_PERSON_RULE = "When you need a person, mark the card as waiting for approval and end your turn. You will be told when the answer comes.";
2334
+ const PERSON_ONLY_RULE = "Only a person approves a card, and only a person takes one out of waiting. Never do either yourself.";
2335
+ const EXECUTION_MODE_RULE = "Each card says where it runs: `worktree` means a separate copy of the project, `main` means the project folder itself. Work in the mode the card names.";
2336
+ /** When to split a card at all — said on its own where the surface names the parent its own way. */
2337
+ const SUBTASK_WHEN_SENTENCE = "Create subtasks only when the person asks for them, or when a task has parts that can be done and checked separately (different stages, owners or pull requests); do not split small work you will finish in one go.";
2338
+ /** How to split one, with the way this surface names the parent card. */
2339
+ function subtaskSplitSentence(parentReference) {
2340
+ return `When you do split a card, make the parts subtasks of it (${parentReference}), not separate top-level cards.`;
2341
+ }
2342
+ const SUBTASK_RULE = `${SUBTASK_WHEN_SENTENCE} ${subtaskSplitSentence("the parent card's id")}`;
2343
+ const PULL_REQUEST_RULE = "Opened a pull request? Link it to the card. Its state and CI checks then reach the card as comments on their own — nothing else tells the board a pull request exists.";
2344
+ const OWN_SESSION_RULE = "Started the work yourself, not launched by an app that tracks the run for you? Say so when you start the run — `claude:<session id>` from Claude Code, `codex:<session id>` from Codex (the session id Codex prints) — so your own log of it can be found later.";
2345
+ /** Said by the `kanbo init` block and the MCP instructions, which name the comment command or tool beside it. */
2346
+ const COMMENT_RULE = "Findings, results, decisions and questions go on the card as comments.";
2347
+ /**
2348
+ * The rules of this board, as `kanbo prime` says them under its column list.
2320
2349
  *
2321
2350
  * They are about the board and nothing else. The board does not hand out a role, a
2322
2351
  * method or a pipeline — that belongs to the instructions the person wrote for
2323
2352
  * their own agent — so the list stops at what the board itself guarantees and
2324
- * expects. No tool is named either: the same text reaches an agent holding MCP
2325
- * tools, one with a command line, and one talking to a server over HTTP, and each
2326
- * of them already knows what it is holding.
2353
+ * expects.
2327
2354
  *
2328
- * Exported because it is also the source `buildCapabilitiesManifest` reads its
2329
- * `rules` from — one list, read by the prompt an agent sees and by the manifest
2330
- * an orchestrator reads about the board.
2355
+ * Also the source `buildCapabilitiesManifest` reads its `rules` from — one list,
2356
+ * read by the prompt an agent sees and by the manifest an orchestrator reads
2357
+ * about the board.
2331
2358
  */
2332
2359
  const BOARD_RULES = [
2333
- "You move the card between columns yourself, at the moment its real state changes. The board never moves a card for you.",
2334
- "Write a status line at every step, including before and after anything long-running. One sentence, present tense, about what is happening right now.",
2335
- "When you need a person, mark the card as waiting for approval and end your turn. You will be told when the answer comes.",
2336
- "Only a person approves a card, and only a person takes one out of waiting. Never do either yourself.",
2337
- "Each card says where it runs: `worktree` means a separate copy of the project, `main` means the project folder itself. Work in the mode the card names.",
2338
- "Create subtasks only when the person asks for them, or when a task has parts that can be done and checked separately (different stages, owners or pull requests); do not split small work you will finish in one go. When you do split a card, make the parts subtasks of it (the parent card's id), not separate top-level cards.",
2339
- "Opened a pull request? Link it to the card. Its state and CI checks then reach the card as comments on their own — nothing else tells the board a pull request exists.",
2340
- "Started the work yourself, not launched by an app that tracks the run for you? Say so when you start the run — `claude:<session id>` from Claude Code, `codex:<session id>` from Codex (the session id Codex prints) — so your own log of it can be found later.",
2360
+ MOVE_CARD_RULE,
2361
+ STATUS_LINE_RULE,
2362
+ WAIT_FOR_PERSON_RULE,
2363
+ PERSON_ONLY_RULE,
2364
+ EXECUTION_MODE_RULE,
2365
+ SUBTASK_RULE,
2366
+ PULL_REQUEST_RULE,
2367
+ OWN_SESSION_RULE,
2341
2368
  "Read the column descriptions above before moving a card, and do all of this through the board tools or commands you have — a statement in your reply changes nothing."
2342
2369
  ];
2370
+ //#endregion
2371
+ //#region src/ops/prime.ts
2343
2372
  /**
2344
2373
  * What the board tells an agent about itself: the columns it has, what each one
2345
2374
  * means, and how a card is expected to travel across them.
@@ -4357,7 +4386,8 @@ const CODEX_TABLE_PATTERN = new RegExp(String.raw`^\s*\[\s*mcp_servers\s*\.\s*(?
4357
4386
  *
4358
4387
  * It says what to run and when, and nothing about how to do the work: the
4359
4388
  * method is the person's own instructions to their agent, and the board only
4360
- * insists on the part that keeps the card honest.
4389
+ * insists on the part that keeps the card honest. The rules are the sentences
4390
+ * `ops/agent-rules.ts` holds for every surface, with the command beside each.
4361
4391
  */
4362
4392
  const INSTRUCTION_BLOCK = [
4363
4393
  INSTRUCTION_START,
@@ -4366,12 +4396,13 @@ const INSTRUCTION_BLOCK = [
4366
4396
  "Work on this project is tracked on a kanbo board. Before starting a task run `kanbo prime` — it prints the board's columns and what each one means.",
4367
4397
  "",
4368
4398
  "- Take a card from `kanbo ready`.",
4369
- "- Move the card yourself (`kanbo card move <id> <column>`) — a card in the wrong column is a lie.",
4370
- "- Write a status line at every step (`kanbo card status-line <id> --text \"...\"`).",
4371
- "- Create subtasks only when the person asks for them, or when a task has parts that can be done and checked separately (different stages, owners or pull requests); do not split small work you will finish in one go. When you do split a card, make the parts subtasks of it (the parent card's id), not separate top-level cards. (`kanbo card create --description \"...\" --parent <id>`).",
4372
- "- Findings, decisions and questions go on the card (`kanbo card comment <id> --content \"...\"`).",
4373
- "- When you need a person, run `kanbo card wait-approval <id>` and end your turn. Never approve your own work, and never take a card out of a column where it is waiting for a person.",
4374
- "- Started the work yourself, not launched by an app that tracks the run? Pass your own session to `kanbo run start --session` — `claude:<session id>` from Claude Code, `codex:<session id>` from Codex (the session id Codex prints).",
4399
+ `- ${MOVE_CARD_RULE} (\`kanbo card move <id> <column>\`)`,
4400
+ `- ${STATUS_LINE_RULE} (\`kanbo card status-line <id> --text "..."\`)`,
4401
+ `- ${SUBTASK_RULE} (\`kanbo card create --description "..." --parent <id>\`)`,
4402
+ `- ${COMMENT_RULE} (\`kanbo card comment <id> --content "..."\`)`,
4403
+ `- ${WAIT_FOR_PERSON_RULE} (\`kanbo card wait-approval <id>\`)`,
4404
+ `- ${PERSON_ONLY_RULE}`,
4405
+ `- ${OWN_SESSION_RULE} (\`kanbo run start <id> --agent <name> --session <ref>\`)`,
4375
4406
  "- Run `kanbo capabilities` for the full list of tools, commands and rules.",
4376
4407
  INSTRUCTION_END
4377
4408
  ].join("\n");
@@ -5163,7 +5194,7 @@ async function createDbTransport(input) {
5163
5194
  * `package.version`. A build carries it as a literal; running from source
5164
5195
  * (tests, `tsx`) reads the package's own `package.json` instead.
5165
5196
  */
5166
- const KANBO_PACKAGE_VERSION = "0.1.1";
5197
+ const KANBO_PACKAGE_VERSION = "0.1.2";
5167
5198
  //#endregion
5168
5199
  //#region src/mcp/resources.ts
5169
5200
  /** The URI a client reads the manifest as JSON from. */
@@ -5204,6 +5235,36 @@ function registerKanboCapabilitiesResources(server) {
5204
5235
  }] }));
5205
5236
  }
5206
5237
  //#endregion
5238
+ //#region src/mcp/instructions.ts
5239
+ /** A tool name as the instructions print it — typed, so a renamed tool fails the build here. */
5240
+ function tool(name) {
5241
+ return `\`${name}\``;
5242
+ }
5243
+ /**
5244
+ * What `kanbo mcp` tells a client when it connects — the `instructions` of the
5245
+ * MCP initialize result, which a client hands its model before any tool is
5246
+ * called. An agent with nothing but this server connected learns from it how
5247
+ * to work the board, with no instruction file in the project.
5248
+ *
5249
+ * Static on purpose: it is sent before any board is resolved, so it says
5250
+ * nothing about columns — `kanbo_prime` returns those. The rules are the
5251
+ * sentences `ops/agent-rules.ts` holds for every surface, with the tool beside
5252
+ * each; the full manifest stays a resource.
5253
+ */
5254
+ const KANBO_MCP_INSTRUCTIONS = [
5255
+ "kanbo is a kanban board shared by people and agents; these tools read and change its cards.",
5256
+ "",
5257
+ `- At the start of a session call ${tool("kanbo_prime")} — it returns this board's columns and what each one means.`,
5258
+ `- Take work from ${tool("kanbo_ready")}.`,
5259
+ `- ${MOVE_CARD_RULE} (${tool("kanbo_card_move")})`,
5260
+ `- ${STATUS_LINE_RULE} (${tool("kanbo_status_line")})`,
5261
+ `- ${COMMENT_RULE} (${tool("kanbo_card_comment")})`,
5262
+ `- ${SUBTASK_RULE} (${tool("kanbo_card_create")} with \`parent\`)`,
5263
+ `- ${WAIT_FOR_PERSON_RULE} (${tool("kanbo_wait_approval")})`,
5264
+ `- ${PERSON_ONLY_RULE}`,
5265
+ `- Every tool, rule and canonical string: the resource \`${KANBO_CAPABILITIES_MARKDOWN_RESOURCE_URI}\`.`
5266
+ ].join("\n");
5267
+ //#endregion
5207
5268
  //#region src/mcp/tools/tool.ts
5208
5269
  /**
5209
5270
  * Declare a tool: what it is called, what it takes, and the one thing it does.
@@ -5301,7 +5362,7 @@ const SUBTASK_SENTENCE = "To create a subtask (sub-card) under another card, pas
5301
5362
  const cardCreateTool = defineKanboTool({
5302
5363
  name: "kanbo_card_create",
5303
5364
  title: "Create a card",
5304
- description: `Put a new card on this board. ${SUBTASK_SENTENCE} Create subtasks only when the person asks for them, or when a task has parts that can be done and checked separately (different stages, owners or pull requests); do not split small work you will finish in one go. When you do split a card, make the parts subtasks of it (pass \`parent\`), not separate top-level cards.`,
5365
+ description: `Put a new card on this board. ${SUBTASK_SENTENCE} ${SUBTASK_WHEN_SENTENCE} ${subtaskSplitSentence("pass `parent`")}`,
5305
5366
  inputSchema: {
5306
5367
  title: zod.z.string().optional().describe("What the card is called. Leave it out and the card is titled with its own key; the description then says what the task is."),
5307
5368
  description: zod.z.string().optional().describe("What the card is about, spelled out for whoever picks it up."),
@@ -5573,12 +5634,15 @@ function registerKanboTools(server, transport, options) {
5573
5634
  * function: it documents its capabilities its own way, and adding a second
5574
5635
  * `kanbo://` resource namespace to an inventory that is not only the board's
5575
5636
  * is a decision for that server to make, not this one.
5637
+ *
5638
+ * For the same reason it alone sends `KANBO_MCP_INSTRUCTIONS` in the initialize
5639
+ * result: the instructions of a server that is only the board.
5576
5640
  */
5577
5641
  function createKanboMcpServer(transport, options) {
5578
5642
  const server = new _modelcontextprotocol_sdk_server_mcp_js.McpServer({
5579
5643
  name: KANBO_MCP_SERVER_NAME,
5580
5644
  version: KANBO_MCP_SERVER_VERSION
5581
- });
5645
+ }, { instructions: KANBO_MCP_INSTRUCTIONS });
5582
5646
  registerKanboTools(server, transport, options);
5583
5647
  registerKanboCapabilitiesResources(server);
5584
5648
  return server;
@@ -8027,6 +8091,12 @@ Object.defineProperty(exports, "KANBO_CAPABILITIES_RESOURCE_URI", {
8027
8091
  return KANBO_CAPABILITIES_RESOURCE_URI;
8028
8092
  }
8029
8093
  });
8094
+ Object.defineProperty(exports, "KANBO_MCP_INSTRUCTIONS", {
8095
+ enumerable: true,
8096
+ get: function() {
8097
+ return KANBO_MCP_INSTRUCTIONS;
8098
+ }
8099
+ });
8030
8100
  Object.defineProperty(exports, "KANBO_MCP_SERVER_NAME", {
8031
8101
  enumerable: true,
8032
8102
  get: function() {
@@ -8358,4 +8428,4 @@ Object.defineProperty(exports, "writeBinding", {
8358
8428
  }
8359
8429
  });
8360
8430
 
8361
- //# sourceMappingURL=manifest-wdwFSquz.cjs.map
8431
+ //# sourceMappingURL=manifest-CmiuDqH-.cjs.map