imsg-mcp 1.7.0 → 1.8.0

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
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and follows [Semantic Versioning](https://semver.org/).
5
5
 
6
+ # [1.8.0](https://github.com/george43g/imsg-mcp/compare/v1.7.0...v1.8.0) (2026-07-20)
7
+
8
+
9
+ ### Features
10
+
11
+ * **tui:** per-thread info / attachment drawer (press `i`) ([cbcf809](https://github.com/george43g/imsg-mcp/commit/cbcf80960207a081f5813a4982f94d927a2d7756))
12
+
6
13
  # [1.7.0](https://github.com/george43g/imsg-mcp/compare/v1.6.2...v1.7.0) (2026-07-20)
7
14
 
8
15
 
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import { createInterface } from "node:readline";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import { Command } from "commander";
6
6
  import { c as checkLocalAccess, f as formatAccessReport, J as IMPLEMENTED_TYPES, K as ANALYTIC_INFO, w as installShutdownHandlers, x as registerCleanup, L as looksLikeThreadSlug } from "./shutdown-CQ9wzrxA.js";
7
- import { A as APP_VERSION, t as toYaml } from "./meta-Lpz_PHJ5.js";
7
+ import { A as APP_VERSION, t as toYaml } from "./meta-DSkZz63Q.js";
8
8
  import { spawn } from "node:child_process";
9
9
  import { join, dirname } from "node:path";
10
10
  function distRoot() {
@@ -447,7 +447,7 @@ async function runExportCommand(target, opts) {
447
447
  const { homedir } = await import("node:os");
448
448
  const { dirname: dirname2, join: join2, isAbsolute, resolve } = await import("node:path");
449
449
  const { getContactsDbPaths, getImsgDbPath, getSlugsDbPath } = await import("./shutdown-CQ9wzrxA.js").then((n) => n.a0);
450
- const { IMessageDB } = await import("./imessage-db-Cid38QGT.js").then((n) => n.i);
450
+ const { IMessageDB } = await import("./imessage-db-BXrBHlvx.js").then((n) => n.i);
451
451
  const { streamExport } = await import("./exportStream-DgPVRZTZ.js");
452
452
  const { parseUserDate } = await import("./date-parse-DJXMfq3a.js");
453
453
  const format = normalizeFormat(opts.format ?? "md");
@@ -2804,6 +2804,51 @@ class IMessageDB {
2804
2804
  span.end({ count: out.length });
2805
2805
  return out;
2806
2806
  }
2807
+ /**
2808
+ * All attachments across EVERY merged leg of one conversation (newest first)
2809
+ * for the TUI per-thread info drawer. Unlike searchAttachments (single
2810
+ * chat_identifier), this resolves the conversation to all its chat ROWIDs
2811
+ * (resolveChatsForConversation) so the SMS and iMessage legs of a merged
2812
+ * identity are both covered. Excludes stickers and Apple plugin payloads.
2813
+ */
2814
+ listConversationAttachments(chatIdentifier, limit = 500) {
2815
+ const span = perf("listConversationAttachments");
2816
+ const chats = this.resolveChatsForConversation(chatIdentifier);
2817
+ if (chats.length === 0) {
2818
+ span.end({ returned: 0 });
2819
+ return [];
2820
+ }
2821
+ const placeholders = chats.map(() => "?").join(",");
2822
+ const lim = limit > 0 ? limit : 500;
2823
+ const sql = `
2824
+ SELECT DISTINCT
2825
+ a.ROWID as rowId,
2826
+ a.filename,
2827
+ a.mime_type,
2828
+ a.transfer_name,
2829
+ a.total_bytes,
2830
+ a.created_date
2831
+ FROM ${Tables.ATTACHMENT} a
2832
+ JOIN ${Tables.MESSAGE_ATTACHMENT_JOIN} maj ON a.ROWID = maj.attachment_id
2833
+ JOIN ${Tables.CHAT_MESSAGE_JOIN} cmj ON maj.message_id = cmj.message_id
2834
+ WHERE cmj.chat_id IN (${placeholders})
2835
+ AND a.is_sticker = 0
2836
+ AND (a.uti IS NULL OR a.uti NOT LIKE 'com.apple.messages.plugin%')
2837
+ ORDER BY a.created_date DESC
2838
+ LIMIT ?
2839
+ `;
2840
+ const rows = this.raw.prepare(sql).all(...chats.map((c) => c.ROWID), lim);
2841
+ const out = rows.map((r) => ({
2842
+ rowId: Number(r.rowId),
2843
+ filename: r.filename || "",
2844
+ mimeType: r.mime_type ?? null,
2845
+ transferName: r.transfer_name ?? null,
2846
+ totalBytes: Number(r.total_bytes) || 0,
2847
+ createdDate: macAutoTimestampToDate(Number(r.created_date)) ?? /* @__PURE__ */ new Date(0)
2848
+ }));
2849
+ span.end({ returned: out.length });
2850
+ return out;
2851
+ }
2807
2852
  /** Fetch a single attachment record by ROWID. */
2808
2853
  getAttachmentByRowId(rowId) {
2809
2854
  const row = this.raw.prepare(
@@ -2974,4 +3019,4 @@ export {
2974
3019
  normalizedPhoneVariants as n,
2975
3020
  rankFuzzy as r
2976
3021
  };
2977
- //# sourceMappingURL=imessage-db-Cid38QGT.js.map
3022
+ //# sourceMappingURL=imessage-db-BXrBHlvx.js.map