kanbo-cli 0.1.3 → 0.2.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.
- package/LICENSE +75 -21
- package/README.md +4 -2
- package/dist/cli.cjs +26 -46
- package/dist/cli.cjs.map +1 -1
- package/dist/lib/index.cjs +1 -259
- package/dist/lib/index.d.cts +15 -95
- package/dist/lib/index.d.mts +15 -95
- package/dist/lib/index.mjs +2 -256
- package/dist/lib/{manifest-BBJIrMw7.cjs → manifest-D9nCRtXM.cjs} +27 -47
- package/dist/lib/manifest-D9nCRtXM.cjs.map +1 -0
- package/dist/lib/{manifest-mkDJmxt2.mjs → manifest-DHV2fRdO.mjs} +27 -47
- package/dist/lib/manifest-DHV2fRdO.mjs.map +1 -0
- package/dist/lib/mcp/index.cjs +1 -1
- package/dist/lib/mcp/index.mjs +1 -1
- package/dist/lib/migrations-path-CZxVOgeD.cjs.map +1 -1
- package/dist/lib/migrations-path-Ciwan537.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/index.mjs.map +0 -1
- package/dist/lib/manifest-BBJIrMw7.cjs.map +0 -1
- package/dist/lib/manifest-mkDJmxt2.mjs.map +0 -1
|
@@ -1903,15 +1903,12 @@ async function approve(store, issueId, input, actor, scope) {
|
|
|
1903
1903
|
* leaves even says "returned by you".
|
|
1904
1904
|
*/
|
|
1905
1905
|
async function returnCard(store, issueId, input, actor, scope) {
|
|
1906
|
-
if (actor.kind !== "user") throw new BoardError("board_return_requires_user", {
|
|
1907
|
-
issueId,
|
|
1908
|
-
actorKind: actor.kind
|
|
1909
|
-
});
|
|
1910
1906
|
return await runBoardWrite(store, async ({ tx }) => {
|
|
1907
|
+
await ensureDefaultColumns(tx, (await requireCard$1(tx, issueId)).workspaceId, { tx });
|
|
1908
|
+
const target = await assertReturnable(tx, issueId, input, actor);
|
|
1911
1909
|
const card = await requireCard$1(tx, issueId);
|
|
1912
|
-
const columns = await ensureDefaultColumns(tx, card.workspaceId, { tx });
|
|
1913
1910
|
const updates = {
|
|
1914
|
-
statusId:
|
|
1911
|
+
statusId: target.id,
|
|
1915
1912
|
waitingFor: null,
|
|
1916
1913
|
updatedAt: currentUnixSeconds()
|
|
1917
1914
|
};
|
|
@@ -1932,6 +1929,27 @@ async function returnCard(store, issueId, input, actor, scope) {
|
|
|
1932
1929
|
};
|
|
1933
1930
|
}, scope);
|
|
1934
1931
|
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Every reason `returnCard` would refuse, asked on reads alone, and the column
|
|
1934
|
+
* the card would go back to when none applies.
|
|
1935
|
+
*
|
|
1936
|
+
* `returnCard` asks exactly this inside its write. A caller that has to undo
|
|
1937
|
+
* something of its own before the return — stop listening for the approval the
|
|
1938
|
+
* card is waiting on, say — asks it first, so a return the board refuses leaves
|
|
1939
|
+
* that untouched. The refusals are the same `BoardError` codes: an actor who is
|
|
1940
|
+
* not a person (`board_return_requires_user`), a card that is not there
|
|
1941
|
+
* (`issue_not_found`), a named column the workspace does not hold
|
|
1942
|
+
* (`issue_status_not_found`), and a card already in the first column with no
|
|
1943
|
+
* column named (`board_return_no_previous_column`).
|
|
1944
|
+
*/
|
|
1945
|
+
async function assertReturnable(store, issueId, input, actor) {
|
|
1946
|
+
if (actor.kind !== "user") throw new BoardError("board_return_requires_user", {
|
|
1947
|
+
issueId,
|
|
1948
|
+
actorKind: actor.kind
|
|
1949
|
+
});
|
|
1950
|
+
const card = await requireCard$1(store, issueId);
|
|
1951
|
+
return input.toStatusName ? await requireColumn(store, card.workspaceId, input.toStatusName) : previousColumn(await listColumns(store, card.workspaceId), card);
|
|
1952
|
+
}
|
|
1935
1953
|
/** Write a comment on the card, as the actor unless the caller names another author. */
|
|
1936
1954
|
async function addComment(store, input, actor, scope) {
|
|
1937
1955
|
return await runBoardWrite(store, async ({ tx }) => {
|
|
@@ -2809,6 +2827,7 @@ function createBoardOps(store) {
|
|
|
2809
2827
|
waitApproval: async (issueId, input, actor, scope) => await waitApproval(store, issueId, input, actor, scope),
|
|
2810
2828
|
approve: async (issueId, input, actor, scope) => await approve(store, issueId, input, actor, scope),
|
|
2811
2829
|
returnCard: async (issueId, input, actor, scope) => await returnCard(store, issueId, input, actor, scope),
|
|
2830
|
+
assertReturnable: async (issueId, input, actor) => await assertReturnable(store, issueId, input, actor),
|
|
2812
2831
|
readApproval: async (issueId) => await readApproval(store, issueId),
|
|
2813
2832
|
linkPullRequest: async (issueId, urlOrRef, actor, scope) => await linkPullRequest(store, issueId, urlOrRef, actor, scope),
|
|
2814
2833
|
unlinkPullRequest: async (issueId, linkId, actor, scope) => await unlinkPullRequest(store, issueId, linkId, actor, scope),
|
|
@@ -4311,7 +4330,7 @@ dirname(fileURLToPath(import.meta.url));
|
|
|
4311
4330
|
* `package.version`. A build carries it as a literal; running from source
|
|
4312
4331
|
* (tests, `tsx`) reads the package's own `package.json` instead.
|
|
4313
4332
|
*/
|
|
4314
|
-
const KANBO_PACKAGE_VERSION = "0.1
|
|
4333
|
+
const KANBO_PACKAGE_VERSION = "0.2.1";
|
|
4315
4334
|
//#endregion
|
|
4316
4335
|
//#region src/cli/failure.ts
|
|
4317
4336
|
/**
|
|
@@ -6997,21 +7016,6 @@ function sendBoardPage(response, pathname, assets) {
|
|
|
6997
7016
|
* reason turned around: the answer will be yes once the card meets them, and
|
|
6998
7017
|
* `details.unmet` says what is missing.
|
|
6999
7018
|
*
|
|
7000
|
-
* The five failures about where a board is kept read the same rule. A database
|
|
7001
|
-
* that holds no board this build can speak for is 409 — the setting is there,
|
|
7002
|
-
* the board behind it is not yet, and `board-storage prepare` is what settles
|
|
7003
|
-
* that — and one nobody could reach at all is 503, because nothing about the
|
|
7004
|
-
* request was wrong. A workspace naming no board at all is 404: the caller
|
|
7005
|
-
* asked about a setting that is not there. A board still holding cards when
|
|
7006
|
-
* somebody asks to point the workspace elsewhere is 409, because the answer
|
|
7007
|
-
* would have been yes on an empty board and `board-storage migrate` is what
|
|
7008
|
-
* makes it one. An operation naming cards from two different boards is 400: no
|
|
7009
|
-
* transaction reaches both, so the caller asked for something that cannot be
|
|
7010
|
-
* done. A copy that would land on a card number or a column name the target
|
|
7011
|
-
* already holds under a different id is 409 for the same reason the others
|
|
7012
|
-
* are: the answer would have been yes on a target that did not hold that
|
|
7013
|
-
* board, and `details.conflicts` names every value that clashed.
|
|
7014
|
-
*
|
|
7015
7019
|
* A failure may also be renamed here: the package names its codes after the
|
|
7016
7020
|
* board, while every error the `/issues` routes answer with is named after the
|
|
7017
7021
|
* issue, and a client matching on `issue_*` should not have to learn a second
|
|
@@ -7033,10 +7037,6 @@ const BOARD_ERROR_RESPONSES = {
|
|
|
7033
7037
|
message: "The card does not meet what that column asks for yet",
|
|
7034
7038
|
code: "issue_column_rules_unmet"
|
|
7035
7039
|
},
|
|
7036
|
-
board_copy_conflict: {
|
|
7037
|
-
status: 409,
|
|
7038
|
-
message: "That board already holds cards or columns of this workspace under the same numbers or names; nothing was copied"
|
|
7039
|
-
},
|
|
7040
7040
|
board_entry_rule_invalid: {
|
|
7041
7041
|
status: 400,
|
|
7042
7042
|
message: "Unknown column entry rule"
|
|
@@ -7045,10 +7045,6 @@ const BOARD_ERROR_RESPONSES = {
|
|
|
7045
7045
|
status: 400,
|
|
7046
7046
|
message: "Execution mode cannot change once the card has been launched"
|
|
7047
7047
|
},
|
|
7048
|
-
board_mixed_workspaces: {
|
|
7049
|
-
status: 400,
|
|
7050
|
-
message: "Those cards are not all on the same board"
|
|
7051
|
-
},
|
|
7052
7048
|
board_pull_request_invalid: {
|
|
7053
7049
|
status: 400,
|
|
7054
7050
|
message: "Not a GitHub pull request: give its URL or owner/repo#number"
|
|
@@ -7108,22 +7104,6 @@ const BOARD_ERROR_RESPONSES = {
|
|
|
7108
7104
|
status: 400,
|
|
7109
7105
|
message: "A sprint cannot start after it is due"
|
|
7110
7106
|
},
|
|
7111
|
-
board_storage_not_configured: {
|
|
7112
|
-
status: 404,
|
|
7113
|
-
message: "This workspace names no board storage"
|
|
7114
|
-
},
|
|
7115
|
-
board_storage_not_empty: {
|
|
7116
|
-
status: 409,
|
|
7117
|
-
message: "That board still holds cards of this workspace; move them with migrate before changing where the board is kept"
|
|
7118
|
-
},
|
|
7119
|
-
board_storage_not_prepared: {
|
|
7120
|
-
status: 409,
|
|
7121
|
-
message: "That board has not been prepared yet"
|
|
7122
|
-
},
|
|
7123
|
-
board_storage_unavailable: {
|
|
7124
|
-
status: 503,
|
|
7125
|
-
message: "That board could not be reached"
|
|
7126
|
-
},
|
|
7127
7107
|
issue_comment_delete_requires_user: {
|
|
7128
7108
|
status: 403,
|
|
7129
7109
|
message: "Only a person can delete a comment the board wrote"
|
|
@@ -8950,4 +8930,4 @@ function buildCapabilitiesManifest() {
|
|
|
8950
8930
|
//#endregion
|
|
8951
8931
|
export { commentAuthorReference as $, maskDatabaseUrls as A, readEntryRules as B, cardDisplayTitle as C, readProjectBinding as D, readBinding as E, ENTRY_RULES as F, normalizeStatusName as G, readChangeSeq as H, ENTRY_RULE_DESCRIPTIONS as I, BOARD_ACTOR as J, TRACKED_FIELDS as K, UNMET_ENTRY_RULE_REASONS as L, formatExternalSessionRef as M, parseExternalSessionRef as N, writeBinding as O, pullRequestFactKeys as P, activityToken as Q, evaluateEntryRules as R, renderCapabilitiesMarkdown as S, ignoreBoardFile as T, runBoardWrite as U, serializeEntryRules as V, DEFAULT_STATUSES as W, activityKindOrder as X, currentUnixSeconds as Y, activityText as Z, projectKanboPullRequest as _, BOARD_ERROR_RESPONSES as a, isOutsideWriter as at, projectKanboSubCard as b, registerKanboTools as c, formatIssueId as ct, KANBO_MCP_INSTRUCTIONS as d, nextIssueOrder as dt, formatActivityIssueReference as et, KANBO_CAPABILITIES_MARKDOWN_RESOURCE_URI as f, readIssuePrefix as ft, projectKanboColumn as g, projectKanboCard as h, KANBO_TOOL_NAMES as i, readSystemCommentKind as it, createBoardOps as j, maskDatabaseUrl as k, KANBO_TOOLS as l, nextIssueIdentity as lt, registerKanboCapabilitiesResources as m, buildCapabilitiesManifest as n, isEmptyActivityValue as nt, KANBO_MCP_SERVER_NAME as o, normalizeCommentAuthorKind as ot, KANBO_CAPABILITIES_RESOURCE_URI as p, diffFieldChanges as q, KANBO_TOOL_CLI_EQUIVALENTS as r, parseActivityStringArray as rt, createKanboMcpServer as s, toIssueView as st, CAPABILITIES_MANIFEST_VERSION as t, formatPlainActivityValue as tt, buildKanboTools as u, nextIssueNumber as ut, projectKanboRun as v, BINDING_FILE_PATH as w, DEFAULT_BOARD_FILE_PATH as x, projectKanboSprint as y, readChecklist as z };
|
|
8952
8932
|
|
|
8953
|
-
//# sourceMappingURL=manifest-
|
|
8933
|
+
//# sourceMappingURL=manifest-DHV2fRdO.mjs.map
|