pi-quiver 6.14.0 → 6.14.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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ 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.2 - 2026-10-20
12
+
13
+ - `session-name`: the default naming prompt asks for a PR's referenced ticket in both the session name and tab label, for example `PR#123 for A-123`; user naming rules still override the built-ins.
14
+
15
+ ## v6.14.1 - 2026-10-19
16
+
17
+ - 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)
18
+
11
19
  ## v6.14.0 - 2026-10-19
12
20
 
13
21
  - `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)
@@ -2460,11 +2460,12 @@ var defaultUploadBytes = async (url, bytes, opts) => {
2460
2460
  }
2461
2461
  };
2462
2462
  var MAX_TEXT_LENGTH = 4e3;
2463
- function assertTextWithinLimit(text) {
2464
- if (text !== void 0 && text.length > MAX_TEXT_LENGTH) {
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 ${MAX_TEXT_LENGTH} limit; use thread_body for announcements or slack_upload for documents.`
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 (!(args.blocks && args.thread_ts !== void 0)) assertTextWithinLimit(args.text);
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")) assertTextWithinLimit(text);
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
  }
@@ -341,7 +341,7 @@ export function buildNamingPrompt(conversation: string, opts: PromptOptions = {}
341
341
  "- Describe the actual task, NOT the tool/skill/command used to start it.",
342
342
  "- Lead with an action verb (e.g. refine, fix, add, rework).",
343
343
  "- Preserve ticket/issue IDs (e.g. ABC-123, PROJ-42, #99) verbatim.",
344
- "- If the whole TAB would be just an ID, say what it is: PR 1234, issue 123, ticket ABC-123. Never reply with digits only.",
344
+ "- If the whole TAB would be just an ID, say what it is: PR 1234, issue 123, ticket ABC-123. Include the PR's referenced ticket in SESSION and TAB: PR#123 for A-123. Never reply with digits only.",
345
345
  "- No quotes, no trailing punctuation, plain ASCII.",
346
346
  ...rules.map((r) => `- ${r}`),
347
347
  "Example -> SESSION: Refine Linear Ticket ABC-123 / TAB: Refine ABC-123",
package/lib/slack-core.ts CHANGED
@@ -757,16 +757,15 @@ export interface MutationResult {
757
757
  detailTs?: string;
758
758
  }
759
759
 
760
- // Deliberately separate from SlackConfig.uploadThresholdChars (doc/specs/2026-08-29-gh-7-slack-extension.md
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 > MAX_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 ${MAX_TEXT_LENGTH} limit; use thread_body for announcements or slack_upload for documents.`,
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 (!(args.blocks && args.thread_ts !== undefined)) assertTextWithinLimit(args.text);
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.0",
3
+ "version": "6.14.2",
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",