pi-quiver 6.14.0 → 6.14.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/CHANGELOG.md +4 -0
- package/dist/bin/pi-quiver.js +12 -7
- package/lib/slack-core.ts +11 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,10 @@ Published to npm as `pi-quiver` (`pi install npm:pi-quiver`). Pushing a
|
|
|
8
8
|
via OIDC trusted publishing. The release helper at
|
|
9
9
|
`.agents/skills/release/scripts/release.sh` cuts the tag; CI publishes.
|
|
10
10
|
|
|
11
|
+
## v6.14.1 - 2026-10-19
|
|
12
|
+
|
|
13
|
+
- Bot-identity `pi-quiver slack post|dm|reply` accepts text up to Slack's 40,000-unit hard limit; the 4000 headline limit stays for user announce posts. (#30)
|
|
14
|
+
|
|
11
15
|
## v6.14.0 - 2026-10-19
|
|
12
16
|
|
|
13
17
|
- `pi-quiver slack`: adds `post`, `reply`, `dm`, and full-document `canvas` replacement through the shared Slack core, with user/bot credentials, headline-plus-thread detail, multi-line bot posts, `--no-unfurl`, DM `--blocks-file`, env-only `--token-from-env`, network-free `--dry-run`, and one-line results including structured exit-4 `error=` codes for retry safety. Claude Code and CI use the CLI directly; no Slack plugin skill ships. (#30)
|
package/dist/bin/pi-quiver.js
CHANGED
|
@@ -2460,11 +2460,12 @@ var defaultUploadBytes = async (url, bytes, opts) => {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
};
|
|
2462
2462
|
var MAX_TEXT_LENGTH = 4e3;
|
|
2463
|
-
|
|
2464
|
-
|
|
2463
|
+
var SLACK_TEXT_HARD_LIMIT = 4e4;
|
|
2464
|
+
function assertTextWithinLimit(text, limit = MAX_TEXT_LENGTH) {
|
|
2465
|
+
if (text !== void 0 && text.length > limit) {
|
|
2465
2466
|
throw new SlackError(
|
|
2466
2467
|
"text_too_long",
|
|
2467
|
-
`text is ${text.length} UTF-16 code units, over the ${
|
|
2468
|
+
`text is ${text.length} UTF-16 code units, over the ${limit} limit; use thread_body for announcements or slack_upload for documents.`
|
|
2468
2469
|
);
|
|
2469
2470
|
}
|
|
2470
2471
|
}
|
|
@@ -2485,7 +2486,8 @@ async function withPermalink(deps, channel, ts) {
|
|
|
2485
2486
|
}
|
|
2486
2487
|
}
|
|
2487
2488
|
async function postPlain(args, deps) {
|
|
2488
|
-
if (
|
|
2489
|
+
if (deps.identity === "bot") assertTextWithinLimit(args.text, SLACK_TEXT_HARD_LIMIT);
|
|
2490
|
+
else if (!(args.blocks && args.thread_ts !== void 0)) assertTextWithinLimit(args.text);
|
|
2489
2491
|
const params = { channel: args.channel };
|
|
2490
2492
|
if (args.text !== void 0) params.text = args.text;
|
|
2491
2493
|
if (args.blocks !== void 0) params.blocks = args.blocks;
|
|
@@ -2681,6 +2683,7 @@ async function announce(args, deps) {
|
|
|
2681
2683
|
return { channel, ts, permalink, warning, detailTs };
|
|
2682
2684
|
}
|
|
2683
2685
|
async function postMessage(args, deps) {
|
|
2686
|
+
if (deps.identity === "bot" && args.thread_body === void 0) return postPlain(args, deps);
|
|
2684
2687
|
if (args.thread_body !== void 0 && args.thread_ts === void 0) {
|
|
2685
2688
|
return announce(
|
|
2686
2689
|
{ channel: args.channel, text: args.text ?? "", thread_body: args.thread_body, blocks: args.blocks },
|
|
@@ -2941,7 +2944,9 @@ async function runSlack(parsed, deps) {
|
|
|
2941
2944
|
}
|
|
2942
2945
|
if (parsed.sub === "post" && parsed.as === "user") assertHeadline(text ?? "");
|
|
2943
2946
|
if (parsed.sub !== "canvas" && !text) throw new Error("text must not be empty");
|
|
2944
|
-
if (parsed.dryRun && (parsed.sub === "post" || parsed.sub === "dm"))
|
|
2947
|
+
if (parsed.dryRun && (parsed.sub === "post" || parsed.sub === "dm" || parsed.sub === "reply" && parsed.as === "bot")) {
|
|
2948
|
+
assertTextWithinLimit(text, parsed.as === "bot" ? SLACK_TEXT_HARD_LIMIT : MAX_TEXT_LENGTH);
|
|
2949
|
+
}
|
|
2945
2950
|
} catch (err) {
|
|
2946
2951
|
stderr(`usage: ${err instanceof Error ? err.message : String(err)}
|
|
2947
2952
|
${USAGE}
|
|
@@ -2990,7 +2995,7 @@ ${USAGE}
|
|
|
2990
2995
|
channel = id;
|
|
2991
2996
|
}
|
|
2992
2997
|
const unfurl = parsed.noUnfurl ? { unfurl_links: false, unfurl_media: false } : {};
|
|
2993
|
-
const coreDeps = { apiCall: trackedApiCall, uploadBytes: deps.uploadBytes, token, thresholdChars: cfg.uploadThresholdChars };
|
|
2998
|
+
const coreDeps = { apiCall: trackedApiCall, uploadBytes: deps.uploadBytes, token, identity: parsed.as, thresholdChars: cfg.uploadThresholdChars };
|
|
2994
2999
|
let result;
|
|
2995
3000
|
if (parsed.sub === "post" && parsed.as === "bot" && /\r?\n/.test(text) && detail !== void 0) {
|
|
2996
3001
|
const parent = await postMessage({ channel, text, ...unfurl }, coreDeps);
|
|
@@ -3016,7 +3021,7 @@ ${USAGE}
|
|
|
3016
3021
|
};
|
|
3017
3022
|
let child;
|
|
3018
3023
|
try {
|
|
3019
|
-
child = await postMessage({ channel: parent.channel, text: detail, thread_ts: parent.ts, ...blocks !== void 0 ? { blocks } : {}, ...unfurl }, { ...coreDeps, apiCall: detailApiCall, uploadBytes: detailUploadBytes });
|
|
3024
|
+
child = await postMessage({ channel: parent.channel, text: detail, thread_ts: parent.ts, ...blocks !== void 0 ? { blocks } : {}, ...unfurl }, { ...coreDeps, identity: void 0, apiCall: detailApiCall, uploadBytes: detailUploadBytes });
|
|
3020
3025
|
} catch (error) {
|
|
3021
3026
|
throw error instanceof SlackError && error.code === "detail_failed" && detailFailure ? detailFailure.error : error;
|
|
3022
3027
|
}
|
package/lib/slack-core.ts
CHANGED
|
@@ -757,16 +757,15 @@ export interface MutationResult {
|
|
|
757
757
|
detailTs?: string;
|
|
758
758
|
}
|
|
759
759
|
|
|
760
|
-
//
|
|
761
|
-
// Announce protocol): this is a fixed hard error for plain text/headline; uploadThresholdChars is a
|
|
762
|
-
// configurable cutoff that only gates thread_body -> upload in the announce protocol.
|
|
760
|
+
// Headline discipline is separate from Slack's hard ceiling and the configurable upload threshold.
|
|
763
761
|
export const MAX_TEXT_LENGTH = 4_000;
|
|
762
|
+
export const SLACK_TEXT_HARD_LIMIT = 40_000;
|
|
764
763
|
|
|
765
|
-
export function assertTextWithinLimit(text: string | undefined): void {
|
|
766
|
-
if (text !== undefined && text.length >
|
|
764
|
+
export function assertTextWithinLimit(text: string | undefined, limit = MAX_TEXT_LENGTH): void {
|
|
765
|
+
if (text !== undefined && text.length > limit) {
|
|
767
766
|
throw new SlackError(
|
|
768
767
|
"text_too_long",
|
|
769
|
-
`text is ${text.length} UTF-16 code units, over the ${
|
|
768
|
+
`text is ${text.length} UTF-16 code units, over the ${limit} limit; use thread_body for announcements or slack_upload for documents.`,
|
|
770
769
|
);
|
|
771
770
|
}
|
|
772
771
|
}
|
|
@@ -798,9 +797,10 @@ export async function postPlain(
|
|
|
798
797
|
unfurl_links?: boolean;
|
|
799
798
|
unfurl_media?: boolean;
|
|
800
799
|
},
|
|
801
|
-
deps: CoreDeps,
|
|
800
|
+
deps: CoreDeps & { identity?: "user" | "bot" },
|
|
802
801
|
): Promise<MutationResult> {
|
|
803
|
-
if (
|
|
802
|
+
if (deps.identity === "bot") assertTextWithinLimit(args.text, SLACK_TEXT_HARD_LIMIT);
|
|
803
|
+
else if (!(args.blocks && args.thread_ts !== undefined)) assertTextWithinLimit(args.text);
|
|
804
804
|
|
|
805
805
|
const params: Record<string, unknown> = { channel: args.channel };
|
|
806
806
|
if (args.text !== undefined) params.text = args.text;
|
|
@@ -1194,8 +1194,10 @@ export async function postMessage(
|
|
|
1194
1194
|
unfurl_links?: boolean;
|
|
1195
1195
|
unfurl_media?: boolean;
|
|
1196
1196
|
},
|
|
1197
|
-
deps: CoreDeps & { uploadBytes: UploadBytes; thresholdChars: number; persist?: (body: string, format?: "md" | "json") => string },
|
|
1197
|
+
deps: CoreDeps & { identity?: "user" | "bot"; uploadBytes: UploadBytes; thresholdChars: number; persist?: (body: string, format?: "md" | "json") => string },
|
|
1198
1198
|
): Promise<MutationResult | AnnounceResult> {
|
|
1199
|
+
if (deps.identity === "bot" && args.thread_body === undefined) return postPlain(args, deps);
|
|
1200
|
+
|
|
1199
1201
|
if (args.thread_body !== undefined && args.thread_ts === undefined) {
|
|
1200
1202
|
return announce(
|
|
1201
1203
|
{ channel: args.channel, text: args.text ?? "", thread_body: args.thread_body, blocks: args.blocks },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-quiver",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.1",
|
|
4
4
|
"description": "Personal pack of Pi coding-agent extensions: context-safe fetch, doc_to_md PDF/DOCX/PPTX-to-Markdown conversion, session naming, a themed ASCII startup header, Opus 4.8 fast mode, and a provider-stall watchdog.",
|
|
5
5
|
"author": "Jacek Juraszek",
|
|
6
6
|
"license": "MIT",
|