pinsay-cli 0.11.0 → 0.11.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/README.md +6 -0
- package/dist/cli.js +21 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,12 @@ Full guides: https://pinsay.dev/docs/ · Issues: https://github.com/moamen-ui/pi
|
|
|
62
62
|
|
|
63
63
|
## Changelog
|
|
64
64
|
|
|
65
|
+
### 0.11.1
|
|
66
|
+
|
|
67
|
+
- MCP tools: passing the old `id` argument now says it was renamed to `number` instead of a generic error.
|
|
68
|
+
- `pinsay_reply` returns the comment `number` with the `replyId`.
|
|
69
|
+
- `--help` exit-code legend: exit 4 also covers "comment not found".
|
|
70
|
+
|
|
65
71
|
### 0.11.0
|
|
66
72
|
|
|
67
73
|
- Comments are numbered per project: `#1`, `#2`, … in `list`, `get`, `status`, `apply`, `reply` and the dashboard. Pass that number (or `--number`); the internal id is no longer accepted, and `get --id` is removed.
|
package/dist/cli.js
CHANGED
|
@@ -392,7 +392,7 @@ var init_build_constants = __esm({
|
|
|
392
392
|
"src/build-constants.ts"() {
|
|
393
393
|
"use strict";
|
|
394
394
|
BUILD_DEFAULT_SERVER = true ? "https://app.pinsay.dev" : "https://app.pinsay.dev";
|
|
395
|
-
BUILD_CLI_VERSION = true ? "0.11.
|
|
395
|
+
BUILD_CLI_VERSION = true ? "0.11.1" : "0.0.0-dev";
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
|
|
@@ -2459,7 +2459,13 @@ function parseCommentNumber(input) {
|
|
|
2459
2459
|
const n = Number(s);
|
|
2460
2460
|
return Number.isSafeInteger(n) ? n : null;
|
|
2461
2461
|
}
|
|
2462
|
-
function invalidNumberMessage(input) {
|
|
2462
|
+
function invalidNumberMessage(input, legacyId) {
|
|
2463
|
+
if (input === void 0 || input === null) {
|
|
2464
|
+
if (legacyId !== void 0 && legacyId !== null) {
|
|
2465
|
+
return `"id" was renamed: pass "number", the comment's #number in this project (see pinsay_list_comments).`;
|
|
2466
|
+
}
|
|
2467
|
+
return `Missing comment number: pass "number", the comment's #number in this project (see pinsay_list_comments).`;
|
|
2468
|
+
}
|
|
2463
2469
|
return `Invalid comment number: ${String(input)}. Expected a number like 12 or #12.`;
|
|
2464
2470
|
}
|
|
2465
2471
|
async function fetchCommentByNumber(server, token, project, number) {
|
|
@@ -13902,7 +13908,7 @@ var TOOL_PINSAY_COMMIT_AND_MARK = {
|
|
|
13902
13908
|
};
|
|
13903
13909
|
var TOOL_PINSAY_REPLY = {
|
|
13904
13910
|
name: "pinsay_reply",
|
|
13905
|
-
description: `Post a reply on a comment, visible to its author and the other stakeholders, with tool/model attribution. Does not change the comment's status; to close a comment out with a reply, use pinsay_mark_applied or pinsay_commit_and_mark. Returns {replyId}. ${MODELS_NOTICE} ${UNTRUSTED_NOTICE}`,
|
|
13911
|
+
description: `Post a reply on a comment, visible to its author and the other stakeholders, with tool/model attribution. Does not change the comment's status; to close a comment out with a reply, use pinsay_mark_applied or pinsay_commit_and_mark. Returns {number, replyId}. ${MODELS_NOTICE} ${UNTRUSTED_NOTICE}`,
|
|
13906
13912
|
inputSchema: {
|
|
13907
13913
|
type: "object",
|
|
13908
13914
|
properties: {
|
|
@@ -14262,7 +14268,7 @@ async function handleGetQueue(args, ctx) {
|
|
|
14262
14268
|
async function handleGetComment(args, ctx) {
|
|
14263
14269
|
const number = parseCommentNumber(args?.number);
|
|
14264
14270
|
if (number === null) {
|
|
14265
|
-
throw mcpError("forbidden", invalidNumberMessage(args?.number));
|
|
14271
|
+
throw mcpError("forbidden", invalidNumberMessage(args?.number, args?.id));
|
|
14266
14272
|
}
|
|
14267
14273
|
let id;
|
|
14268
14274
|
try {
|
|
@@ -14299,7 +14305,7 @@ async function handleMarkApplied(args, ctx) {
|
|
|
14299
14305
|
const number = parseCommentNumber(args?.number);
|
|
14300
14306
|
const reply = args?.reply;
|
|
14301
14307
|
if (number === null) {
|
|
14302
|
-
throw mcpError("forbidden", invalidNumberMessage(args?.number));
|
|
14308
|
+
throw mcpError("forbidden", invalidNumberMessage(args?.number, args?.id));
|
|
14303
14309
|
}
|
|
14304
14310
|
if (typeof reply !== "string") {
|
|
14305
14311
|
throw mcpError("forbidden", "number and reply are required");
|
|
@@ -14342,6 +14348,9 @@ async function handleCommitAndMark(args, ctx) {
|
|
|
14342
14348
|
const numbers = args?.numbers;
|
|
14343
14349
|
const reply = args?.reply;
|
|
14344
14350
|
const files = args?.files;
|
|
14351
|
+
if (numbers === void 0 || numbers === null) {
|
|
14352
|
+
throw mcpError("forbidden", invalidNumberMessage(void 0, args?.ids ?? args?.id));
|
|
14353
|
+
}
|
|
14345
14354
|
const tool = args?.tool || ctx.configAiTool;
|
|
14346
14355
|
const models = parseModelsArgs(args);
|
|
14347
14356
|
if (!Array.isArray(numbers) || numbers.length === 0 || typeof reply !== "string") {
|
|
@@ -14548,7 +14557,7 @@ async function handleReply(args, ctx) {
|
|
|
14548
14557
|
const number = parseCommentNumber(args?.number);
|
|
14549
14558
|
const body = args?.body;
|
|
14550
14559
|
if (number === null) {
|
|
14551
|
-
throw mcpError("forbidden", invalidNumberMessage(args?.number));
|
|
14560
|
+
throw mcpError("forbidden", invalidNumberMessage(args?.number, args?.id));
|
|
14552
14561
|
}
|
|
14553
14562
|
if (typeof body !== "string") {
|
|
14554
14563
|
throw mcpError("forbidden", "number and body are required");
|
|
@@ -14570,13 +14579,13 @@ async function handleReply(args, ctx) {
|
|
|
14570
14579
|
body: { body, aiTool: tool || void 0, ...modelsBody(models) },
|
|
14571
14580
|
token: ctx.token
|
|
14572
14581
|
});
|
|
14573
|
-
return { replyId: res?.id ?? res?.data?.id ?? null };
|
|
14582
|
+
return { number, replyId: res?.id ?? res?.data?.id ?? null };
|
|
14574
14583
|
}
|
|
14575
14584
|
async function handleSetStatus(args, ctx) {
|
|
14576
14585
|
const number = parseCommentNumber(args?.number);
|
|
14577
14586
|
const statusStr = String(args?.status || "").toLowerCase();
|
|
14578
14587
|
if (number === null) {
|
|
14579
|
-
throw mcpError("forbidden", invalidNumberMessage(args?.number));
|
|
14588
|
+
throw mcpError("forbidden", invalidNumberMessage(args?.number, args?.id));
|
|
14580
14589
|
}
|
|
14581
14590
|
if (!statusStr) {
|
|
14582
14591
|
throw mcpError("forbidden", "number and status are required");
|
|
@@ -15168,7 +15177,7 @@ Tools
|
|
|
15168
15177
|
|
|
15169
15178
|
Run npx pinsay-cli <command> --help for examples.
|
|
15170
15179
|
Flags: --no-color No colours or styling (also NO_COLOR=1)
|
|
15171
|
-
Exit codes: 0 ok \xB7 1 error \xB7 2 bad usage / paused workspace \xB7 3 key or permission \xB7 4 can't reach PinSay \xB7 5 CLI too old`;
|
|
15180
|
+
Exit codes: 0 ok \xB7 1 error \xB7 2 bad usage / paused workspace \xB7 3 key or permission \xB7 4 can't reach PinSay, or comment not found \xB7 5 CLI too old`;
|
|
15172
15181
|
var HELP_TEXTS = {
|
|
15173
15182
|
init: {
|
|
15174
15183
|
purpose: "Set up this repo (sign in, project, skills)",
|
|
@@ -15422,7 +15431,8 @@ var HELP_TEXTS = {
|
|
|
15422
15431
|
],
|
|
15423
15432
|
notes: [
|
|
15424
15433
|
"Exit codes: 0 ok \xB7 1 error \xB7 2 bad usage / paused workspace",
|
|
15425
|
-
" 3 key or permission \xB7 4 can't reach PinSay
|
|
15434
|
+
" 3 key or permission \xB7 4 can't reach PinSay, or comment not found",
|
|
15435
|
+
" 5 CLI too old"
|
|
15426
15436
|
]
|
|
15427
15437
|
},
|
|
15428
15438
|
reply: {
|
|
@@ -15462,7 +15472,7 @@ var HELP_TEXTS = {
|
|
|
15462
15472
|
],
|
|
15463
15473
|
notes: [
|
|
15464
15474
|
"Exit codes: 0 ok \xB7 1 a check failed \xB7 3 key or permission",
|
|
15465
|
-
" 4 can't reach PinSay \xB7 5 CLI too old"
|
|
15475
|
+
" 4 can't reach PinSay, or comment not found \xB7 5 CLI too old"
|
|
15466
15476
|
]
|
|
15467
15477
|
},
|
|
15468
15478
|
update: {
|
package/package.json
CHANGED