@wirecat/cli-memo 0.7.1 → 0.9.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.
Files changed (75) hide show
  1. package/README.md +50 -10
  2. package/dist/actions/actions.d.ts +11 -0
  3. package/dist/actions/actions.d.ts.map +1 -0
  4. package/dist/actions/actions.js +23 -0
  5. package/dist/actions/actions.js.map +1 -0
  6. package/dist/actions/command.d.ts +4 -0
  7. package/dist/actions/command.d.ts.map +1 -0
  8. package/dist/actions/command.js +53 -0
  9. package/dist/actions/command.js.map +1 -0
  10. package/dist/agents/command.d.ts +4 -0
  11. package/dist/agents/command.d.ts.map +1 -0
  12. package/dist/agents/command.js +22 -0
  13. package/dist/agents/command.js.map +1 -0
  14. package/dist/mail/import.d.ts +3 -3
  15. package/dist/mail/import.d.ts.map +1 -1
  16. package/dist/mail/import.js +89 -98
  17. package/dist/mail/import.js.map +1 -1
  18. package/dist/mcp/command.d.ts +4 -0
  19. package/dist/mcp/command.d.ts.map +1 -0
  20. package/dist/mcp/command.js +17 -0
  21. package/dist/mcp/command.js.map +1 -0
  22. package/dist/mcp/server.d.ts +17 -0
  23. package/dist/mcp/server.d.ts.map +1 -0
  24. package/dist/mcp/server.js +149 -0
  25. package/dist/mcp/server.js.map +1 -0
  26. package/dist/memories/command.d.ts +4 -0
  27. package/dist/memories/command.d.ts.map +1 -0
  28. package/dist/memories/command.js +68 -0
  29. package/dist/memories/command.js.map +1 -0
  30. package/dist/memories/memories.d.ts +11 -0
  31. package/dist/memories/memories.d.ts.map +1 -0
  32. package/dist/memories/memories.js +11 -0
  33. package/dist/memories/memories.js.map +1 -0
  34. package/dist/notes/command.js +1 -1
  35. package/dist/notes/command.js.map +1 -1
  36. package/dist/notes/embed.d.ts +6 -0
  37. package/dist/notes/embed.d.ts.map +1 -1
  38. package/dist/notes/embed.js +19 -1
  39. package/dist/notes/embed.js.map +1 -1
  40. package/dist/people/subject.js +1 -1
  41. package/dist/people/subject.js.map +1 -1
  42. package/dist/program.d.ts.map +1 -1
  43. package/dist/program.js +8 -0
  44. package/dist/program.js.map +1 -1
  45. package/dist/records/run.d.ts +5 -0
  46. package/dist/records/run.d.ts.map +1 -0
  47. package/dist/records/run.js +17 -0
  48. package/dist/records/run.js.map +1 -0
  49. package/dist/search/command.d.ts.map +1 -1
  50. package/dist/search/command.js +7 -2
  51. package/dist/search/command.js.map +1 -1
  52. package/dist/store/gone.d.ts +5 -1
  53. package/dist/store/gone.d.ts.map +1 -1
  54. package/dist/store/gone.js +7 -5
  55. package/dist/store/gone.js.map +1 -1
  56. package/dist/store/held.d.ts +13 -0
  57. package/dist/store/held.d.ts.map +1 -0
  58. package/dist/store/held.js +21 -0
  59. package/dist/store/held.js.map +1 -0
  60. package/dist/store/scope.d.ts +1 -0
  61. package/dist/store/scope.d.ts.map +1 -1
  62. package/dist/store/scope.js +2 -2
  63. package/dist/store/scope.js.map +1 -1
  64. package/dist/tags/command.d.ts.map +1 -1
  65. package/dist/tags/command.js +5 -3
  66. package/dist/tags/command.js.map +1 -1
  67. package/dist/tasks/command.d.ts.map +1 -1
  68. package/dist/tasks/command.js +2 -1
  69. package/dist/tasks/command.js.map +1 -1
  70. package/dist/tasks/context.d.ts.map +1 -1
  71. package/dist/tasks/context.js +2 -1
  72. package/dist/tasks/context.js.map +1 -1
  73. package/dist/version.d.ts +1 -1
  74. package/dist/version.js +1 -1
  75. package/package.json +5 -2
package/README.md CHANGED
@@ -77,8 +77,12 @@ holds; `linked` counts what the notes found link to, with each person's name. Fo
77
77
  `notes show` takes `note:<id>` or a file in a configured folder, and answers with the note's tags, its
78
78
  links, its backlinks and, for a PDF or sheet, where its text came from.
79
79
 
80
- `search all` searches messages, imported mail and native notes together. Use `search messages`,
81
- `search mail`, or `search notes` for one resource; `search notes --type internal|file` narrows note kinds.
80
+ `search all` searches messages, imported mail and native notes together, and nothing else: not people,
81
+ memories, projects, organizations or decisions. Use it when you do not know where something was written. When
82
+ you know the kind, its own search reads it with every field: `search mail` takes `from:`, `to:`, `cc:`, `bcc:`,
83
+ `subject:` and `mailbox:` (a folder or Gmail label); `search messages`, `search notes`; `search notes --type
84
+ internal|file` narrows note kinds. An empty answer means those three hold nothing that matches: try the kind's
85
+ own search, looser words, or `tg search conversations` to find mail and messages by meaning.
82
86
  `search all` includes a separate `tasks` list for open work linked to matching sources. Results identify source
83
87
  kind/account and skipped-resource coverage; a query using a field only messages have (`from:`, `after:`)
84
88
  searches the messages and says the notes were not searched. Missing hits do not prove that an event
@@ -114,6 +118,38 @@ shared-domain proposals for direct email contacts. Proposals retain rule provena
114
118
  unconfirmed; they do not enter confirmed person context. `relationships confirm <id>` records your
115
119
  explicit acceptance. Common free-mail domains are excluded from this heuristic.
116
120
 
121
+ ## Memories, proposed actions and the agent log
122
+
123
+ ```sh
124
+ memo memories add 'Bob Sample prefers Friday meetings' --kind preference --scope work --evidence note:NOTE_ID
125
+ memo memories list --status proposed
126
+ memo memories confirm memory:MEMORY_ID
127
+ memo actions propose reply --reason 'asked twice' --provider telegram --payload '{"text":"Friday works"}'
128
+ memo actions approve ACTION_ID
129
+ memo agents log --agent memo-mcp --limit 20
130
+ ```
131
+
132
+ A memory is a summary, digest, fact or preference with its evidence (any stored reference) and a scope,
133
+ `personal` or `work`. One you write is confirmed at once; an agent's waits as `proposed` until you
134
+ `confirm` it, and `stale` marks one whose evidence no longer holds. `memories search` finds the words in
135
+ them.
136
+
137
+ A proposed action is what an agent wants done in one account: a reply, a ban, an invitation. Nothing is ever
138
+ sent. `actions approve` makes it a task in that account's inbox, so it shows in `memo tasks list`, and the
139
+ proposal remembers the task; `actions reject` closes it. `actions list --status` filters them.
140
+
141
+ `memo agents log` lists what agents did through the MCP servers that share the store, newest first: the
142
+ agent, the tool, its tier, the outcome and the times, never the arguments.
143
+
144
+ `memo mcp` serves the same to an agent over MCP, on stdin and stdout: `memories_add`, `memories_list`,
145
+ `memories_show`, `memories_search`, `actions_propose`, `actions_list`, `actions_show` and `agents_log`. An
146
+ agent's memories and proposals are its own (`memo-mcp`) and wait for you; it cannot confirm, approve or
147
+ reject. Every call goes into the agent log.
148
+
149
+ ```json
150
+ { "mcpServers": { "memo": { "command": "memo", "args": ["mcp"] } } }
151
+ ```
152
+
117
153
  ## Local task reminders
118
154
 
119
155
  ```sh
@@ -238,19 +274,21 @@ message/thread identities across folder moves and UID resets. Mail without Messa
238
274
  UIDVALIDITY/folder/UID fallback, which can change after a move/reset. Configured folders are listed
239
275
  completely before deletion checks; a changed folder scope skips deletion for that run.
240
276
 
241
- Imports index changed threads with the shared bounded pipeline and report the proven date/folder
242
- window, resumable indexing and missing models. No thread is called globally complete on the basis
243
- of one window. CC/BCC headers are retained when available. Readable attachments become separate source
244
- entries linked to their parent/part; extraction failures are reported. After installing an optional
245
- engine, use `memo mail import --retry-attachments` to reread a bounded batch of stored messages.
277
+ Imports report the proven date/folder window. No thread is called globally complete on the basis of one
278
+ window. To, CC and BCC are kept. A readable attachment's text is kept with its email and searched with it
279
+ (`content:`, `filename:`); extraction failures are reported. After installing an optional engine, use
280
+ `memo mail import --retry-attachments` to reread a bounded batch of stored mail. Mail in the mail tables is
281
+ searched by words, not yet by meaning.
246
282
 
247
283
  ```sh
248
284
  memo mail import --since 2026-09-01
249
285
  ```
250
286
 
251
287
  Reads a Gmail account's All Mail through [Himalaya](https://github.com/pimalaya/himalaya) into the
252
- shared message store as provider `email`: one chat per Gmail thread, the mailbox address as the
253
- account, senders and recipients as people. Messenger search and person context then see mail too.
288
+ shared store's mail tables: one thread per Gmail thread, each folder a mailbox, the mailbox address as
289
+ the account, senders and recipients as people. `search mail`, `search all`, `ask`, person context and tags
290
+ see it. Mail an import before 0.8.0 saved as messages stays searchable; an email imported again is listed
291
+ once.
254
292
 
255
293
  - Read only: the mailbox is opened read-only, nothing is sent, and no mail is marked read.
256
294
  - Run it again any time: what is stored is skipped; `--max` (default 200) bounds the new mails read
@@ -298,7 +336,9 @@ tg search mail 'tag:follow-up'
298
336
  A note is labelled by its reference (`--note note:<id>`, or `document:<id>` for a file in a notes
299
337
  folder), an email or messenger message by its full `msg:` locator, a mail thread or chat by its exact id
300
338
  and account. A person, organization, project or task is labelled by `--person`, `--organization`,
301
- `--project` or `--task`, with no account; a contact names its account. `--folder` with an id from
339
+ `--project` or `--task`, with no account; a contact names its account, and so does a meeting:
340
+ `--meeting <id> --provider <provider> --account <account>`, the meeting's id in the store. A note about a
341
+ meeting names it as `meeting:<account id>/<meeting id>` in `memo notes add --about`. `--folder` with an id from
302
342
  `memo folders list`, and `--path` for one subfolder, labels every note under it at any depth. Tags use 1–32 letters a–z, digits or hyphens; case is ignored.
303
343
  Adding an existing tag or removing an absent one leaves it unchanged.
304
344
 
@@ -0,0 +1,11 @@
1
+ import type { Author, MessageStore, ProposedAction } from "@wirecat/cli-messaging/store";
2
+ import { type AccountScope } from "../store/scope.js";
3
+ export interface NewProposal extends AccountScope {
4
+ kind: string;
5
+ reason: string;
6
+ target?: string;
7
+ payload?: string;
8
+ }
9
+ /** The account is the one that would act, and the task the proposal becomes on approval lands in its inbox. */
10
+ export declare const propose: (store: MessageStore, proposal: NewProposal, by: Author) => Promise<ProposedAction>;
11
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/actions/actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACxF,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,mBAAmB,CAAA;AAEpE,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,+GAA+G;AAC/G,eAAO,MAAM,OAAO,UAAiB,YAAY,YAAY,WAAW,MAAM,MAAM,KAAG,OAAO,CAAC,cAAc,CAiB5G,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { CliError } from "@wirecat/cli-core";
2
+ import { selectAccount } from "../store/scope.js";
3
+ /** The account is the one that would act, and the task the proposal becomes on approval lands in its inbox. */
4
+ export const propose = async (store, proposal, by) => {
5
+ let payload;
6
+ if (proposal.payload !== undefined) {
7
+ try {
8
+ payload = JSON.parse(proposal.payload);
9
+ }
10
+ catch {
11
+ throw new CliError("validation_error", '--payload is JSON, such as {"text":"Friday works"}');
12
+ }
13
+ }
14
+ return store.proposedActions.propose({
15
+ kind: proposal.kind,
16
+ by,
17
+ account: await selectAccount(store, proposal),
18
+ reason: proposal.reason,
19
+ ...(proposal.target === undefined ? {} : { target: proposal.target }),
20
+ ...(payload === undefined ? {} : { payload }),
21
+ });
22
+ };
23
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/actions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAA;AASpE,+GAA+G;AAC/G,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,KAAmB,EAAE,QAAqB,EAAE,EAAU,EAA2B,EAAE;IAC/G,IAAI,OAAgB,CAAA;IACpB,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,oDAAoD,CAAC,CAAA;QAC9F,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC;QACnC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,EAAE;QACF,OAAO,EAAE,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC7C,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrE,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;KAC9C,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Streams } from "@wirecat/cli-core";
2
+ import type { Command } from "commander";
3
+ export declare const actionsCommand: (program: Command, streams: Streams, env: NodeJS.ProcessEnv) => void;
4
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/actions/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,eAAO,MAAM,cAAc,YAAa,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,UAAU,KAAG,IAuD3F,CAAA"}
@@ -0,0 +1,53 @@
1
+ import { approveAsTask } from "@wirecat/cli-messaging/services";
2
+ import { PROPOSAL_STATUSES } from "@wirecat/cli-messaging/store";
3
+ import { oneOf, positive } from "../options.js";
4
+ import { answering } from "../records/run.js";
5
+ import { propose } from "./actions.js";
6
+ export const actionsCommand = (program, streams, env) => {
7
+ const run = answering(streams, env);
8
+ const actions = program
9
+ .command("actions")
10
+ .description("What an agent proposes to do; approving one makes it your task, nothing is sent");
11
+ actions
12
+ .command("propose")
13
+ .description("Propose an action, such as a reply or a ban, in the account that would act")
14
+ .argument("<kind>", "a lower-case word: reply, send, ban, mute, pin, invite, create_task, …")
15
+ .requiredOption("--reason <text>", "why it should be done")
16
+ .requiredOption("--provider <provider>", "the provider of the account that would act")
17
+ .option("--account <account>", "the account that would act, when the provider has several")
18
+ .option("--target <ref>", "what it acts on: msg:, chat:, contact:, person:, task:, …")
19
+ .option("--payload <json>", "what to do, as JSON, such as the reply's text")
20
+ .option("--json", "print JSON")
21
+ .action((kind, options) => run(options.json, (store) => propose(store, { ...options, kind }, "owner")));
22
+ actions
23
+ .command("list")
24
+ .description("Proposed actions, newest first")
25
+ .option("--status <status>", PROPOSAL_STATUSES.join(", "), oneOf(PROPOSAL_STATUSES))
26
+ .option("--limit <n>", "most actions, up to 500", positive, 100)
27
+ .option("--json", "print JSON")
28
+ .action((options) => run(options.json, async (store) => ({
29
+ items: await store.proposedActions.list({
30
+ limit: options.limit,
31
+ ...(options.status === undefined ? {} : { status: options.status }),
32
+ }),
33
+ })));
34
+ actions
35
+ .command("show")
36
+ .description("One proposed action, with its payload")
37
+ .argument("<id>")
38
+ .option("--json", "print JSON")
39
+ .action((id, options) => run(options.json, (store) => store.proposedActions.get(id)));
40
+ actions
41
+ .command("approve")
42
+ .description("Approve it: it becomes a task in the account that would act; nothing is sent")
43
+ .argument("<id>")
44
+ .option("--json", "print JSON")
45
+ .action((id, options) => run(options.json, (store) => approveAsTask(store, id)));
46
+ actions
47
+ .command("reject")
48
+ .description("Reject it; nothing is done")
49
+ .argument("<id>")
50
+ .option("--json", "print JSON")
51
+ .action((id, options) => run(options.json, (store) => store.proposedActions.reject(id)));
52
+ };
53
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/actions/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAuB,MAAM,8BAA8B,CAAA;AAErF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE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QAAQ,EAAE,YAAY,CAAC;SAC9B,MAAM,CAAC,CAAC,EAAU,EAAE,OAA2B,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACxH,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Streams } from "@wirecat/cli-core";
2
+ import type { Command } from "commander";
3
+ export declare const agentsCommand: (program: Command, streams: Streams, env: NodeJS.ProcessEnv) => void;
4
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/agents/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,eAAO,MAAM,aAAa,YAAa,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,UAAU,KAAG,IAoB1F,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { positive } from "../options.js";
2
+ import { answering } from "../records/run.js";
3
+ export const agentsCommand = (program, streams, env) => {
4
+ const run = answering(streams, env);
5
+ program
6
+ .command("agents")
7
+ .description("What agents did through the MCP servers that share the store")
8
+ .command("log")
9
+ .description("One row per tool call, newest first: agent, tool, tier, outcome and times, never its arguments")
10
+ .option("--tool <name>", "only this tool")
11
+ .option("--agent <name>", "only this agent, such as tg-mcp or memo-mcp")
12
+ .option("--limit <n>", "most rows, up to 500", positive, 100)
13
+ .option("--json", "print JSON")
14
+ .action((options) => run(options.json, async (store) => ({
15
+ items: await store.agentActions.list({
16
+ ...(options.tool === undefined ? {} : { tool: options.tool }),
17
+ ...(options.agent === undefined ? {} : { agent: options.agent }),
18
+ limit: options.limit,
19
+ }),
20
+ })));
21
+ };
22
+ //# sourceMappingURL=command.js.map
@@ -0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,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { type LoadEngine } from "@wirecat/cli-messaging/documents";
2
2
  import type { MessageStore } from "@wirecat/cli-messaging/store";
3
- import { embedChanged, type NotesEmbedded } from "../notes/embed.js";
3
+ import { embedChanged, embedMailChunks, type NotesEmbedded } from "../notes/embed.js";
4
4
  import type { Himalaya } from "./himalaya.js";
5
5
  export interface MailAccount {
6
6
  /** The account's name in Himalaya's config. */
@@ -34,10 +34,9 @@ export interface ImportResult {
34
34
  message: string;
35
35
  part: number;
36
36
  status: string;
37
- locatorId?: string;
38
37
  }[];
39
38
  }
40
- export declare const importMail: ({ store, run, account, since, max, now, env, embed, loadEngine, retryAttachments, indexThreads, }: {
39
+ export declare const importMail: ({ store, run, account, since, max, now, env, embed, loadEngine, retryAttachments, indexThreads, embedMail, }: {
41
40
  store: MessageStore;
42
41
  run: Himalaya;
43
42
  account: MailAccount;
@@ -49,5 +48,6 @@ export declare const importMail: ({ store, run, account, since, max, now, env, e
49
48
  loadEngine?: LoadEngine;
50
49
  retryAttachments?: boolean;
51
50
  indexThreads?: typeof embedChanged;
51
+ embedMail?: typeof embedMailChunks;
52
52
  }) => Promise<ImportResult>;
53
53
  //# sourceMappingURL=import.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/mail/import.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAC7F,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OA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AAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAClE;AASD,eAAO,MAAM,UAAU,iHAapB;IACD,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,QAAQ,CAAA;IACb,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,IAAI,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,YAAY,CAAA;IAClC,SAAS,CAAC,EAAE,OAAO,eAAe,CAAA;CACnC,KAAG,OAAO,CAAC,YAAY,CA6KvB,CAAA"}
@@ -1,17 +1,17 @@
1
1
  import { extractText, importEngine } from "@wirecat/cli-messaging/documents";
2
- import { embedChanged } from "../notes/embed.js";
3
- import { dropMissing } from "../store/gone.js";
2
+ import { embedChanged, embedMailChunks } from "../notes/embed.js";
3
+ import { dropMissing, tooManyGone } from "../store/gone.js";
4
4
  import { listAllMail, listImapMail } from "./gmail.js";
5
5
  import { parseMail } from "./parse.js";
6
6
  const DAY = 86_400_000;
7
7
  /** IMAP's SINCE counts whole days in the server's zone, so the window's first days are not trusted. */
8
8
  const EDGE = 2 * DAY;
9
- const ANY = /[\s\S]?/;
10
- const titleOf = (subject) => subject?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null;
11
- export const importMail = async ({ store, run, account, since, max = 200, now = Date.now, env, embed = false, loadEngine = importEngine, retryAttachments = false, indexThreads = embedChanged, }) => {
9
+ const MAX_ATTACHMENT_TEXT = 200_000;
10
+ const addressOf = ({ email, name }) => ({ address: email, name });
11
+ export const importMail = async ({ store, run, account, since, max = 200, now = Date.now, env, embed = false, loadEngine = importEngine, retryAttachments = false, indexThreads = embedChanged, embedMail = embedMailChunks, }) => {
12
12
  const startedAt = now();
13
13
  const key = { provider: "email", account: account.address.toLowerCase() };
14
- await store.saveAccount(key, { name: account.address });
14
+ const accountId = await store.saveAccount(key, { name: account.address });
15
15
  const folders = account.folders ?? [account.mode === "imap" ? "INBOX" : "[Gmail]/All Mail"];
16
16
  if (folders.length < 1 || folders.length > 50)
17
17
  throw new Error("select 1–50 mail folders");
@@ -25,8 +25,6 @@ export const importMail = async ({ store, run, account, since, max = 200, now =
25
25
  scopeFolder: folder,
26
26
  }))));
27
27
  const listed = [...new Map(collected.map((item) => [item.messageId, item])).values()].sort((a, b) => b.receivedAt.localeCompare(a.receivedAt));
28
- const changed = new Set();
29
- const attachments = [];
30
28
  const present = new Set(listed.map(({ messageId }) => messageId));
31
29
  const foundFolders = new Map();
32
30
  for (const item of collected) {
@@ -34,19 +32,39 @@ export const importMail = async ({ store, run, account, since, max = 200, now =
34
32
  current.add(item.scopeFolder ?? item.folder ?? folders[0]);
35
33
  foundFolders.set(item.messageId, current);
36
34
  }
37
- for (const [id, found] of foundFolders) {
38
- const earlier = await store.syncState(key, `mail_message_folders:${id}`);
39
- const kept = earlier === undefined ? [] : JSON.parse(earlier.value).filter((folder) => !folders.includes(folder));
40
- await store.setSyncState(key, `mail_message_folders:${id}`, JSON.stringify([...new Set([...kept, ...found])]));
35
+ const mailbox = (folder) => ({ externalId: folder, name: folder, kind: null });
36
+ const allMailOnly = account.mode !== "imap" && folders.length === 1 && folders[0] === "[Gmail]/All Mail";
37
+ // Deletions are proved against the mailboxes as stored before this scan moves anything.
38
+ const scope = JSON.stringify({ mode: account.mode ?? "gmail", folders: [...folders].sort() });
39
+ const previousScope = await store.syncState(key, "mail_folder_scope");
40
+ const windowStart = new Date(since.getTime() + EDGE);
41
+ let deleted = 0;
42
+ let skipped;
43
+ if (previousScope !== undefined && previousScope.value !== scope)
44
+ skipped = "folder scope changed; missing mail is not proven deleted";
45
+ else {
46
+ const candidates = (await store.mail.emails({ accountId, since: windowStart.getTime() })).filter(({ mailboxes }) => mailboxes.length ? mailboxes.every(({ externalId }) => folders.includes(externalId)) : allMailOnly);
47
+ const gone = candidates.filter(({ externalId }) => !present.has(externalId)).map(({ externalId }) => externalId);
48
+ skipped = tooManyGone(gone.length, candidates.length);
49
+ if (!skipped && gone.length)
50
+ deleted = await store.mail.markDeleted(accountId, gone, startedAt);
51
+ // Mail an earlier import saved as messages keeps the rule it was saved under until those rows are removed.
52
+ const older = await dropMissing(store, key, { has: (id) => present.has(id.replace(/:attachment:\d+$/, "")) }, windowStart.toISOString(), async ({ id }) => {
53
+ const membership = await store.syncState(key, `mail_message_folders:${id.replace(/:attachment:\d+$/, "")}`);
54
+ if (membership === undefined)
55
+ return allMailOnly;
56
+ return JSON.parse(membership.value).every((folder) => folders.includes(folder));
57
+ });
58
+ deleted += older.deleted;
59
+ skipped ??= older.skipped;
41
60
  }
61
+ await store.mail.setMailboxes(accountId, folders.map(mailbox), new Map([...foundFolders].map(([id, found]) => [id, [...found]])), startedAt);
62
+ const attachments = [];
42
63
  let saved = 0;
43
64
  let alreadyStored = 0;
44
65
  let read = 0;
45
66
  for (const item of listed) {
46
- if (!retryAttachments && (await store.message(key, item.messageId, { chatId: item.threadId })) !== undefined) {
47
- const children = await store.syncState(key, `mail_attachments:${item.messageId}`);
48
- for (const id of children === undefined ? [] : JSON.parse(children.value))
49
- present.add(id);
67
+ if (!retryAttachments && (await store.mail.email(accountId, item.messageId)) !== null) {
50
68
  alreadyStored++;
51
69
  continue;
52
70
  }
@@ -54,97 +72,70 @@ export const importMail = async ({ store, run, account, since, max = 200, now =
54
72
  break;
55
73
  read++;
56
74
  const mail = parseMail(await run(["--json", "message", "read", "-a", account.name, "-m", item.folder ?? "archive", item.uid]));
57
- const people = [mail.from, ...mail.to, ...mail.bcc].filter((person) => person !== null);
58
- const known = (await store.members(key, item.threadId)).map(({ id }) => id);
59
- const members = [...new Set([...known, ...people.map(({ email }) => email)])];
60
- const newest = (await store.find({ account: key, chatId: item.threadId, pattern: ANY, limit: 1 })).items[0]
61
- ?.timestamp;
62
- // Saving a chat replaces its fields, so an older message read later must not move the time back.
63
- const lastMessageAt = newest !== undefined && newest > item.receivedAt ? newest : item.receivedAt;
64
- await store.applyDelta(key, {
65
- chats: [
66
- {
67
- id: item.threadId,
68
- title: titleOf(mail.subject),
69
- kind: members.length > 2 ? "group" : "dialog",
70
- unreadCount: null,
71
- lastMessageAt,
72
- participantsCount: members.length,
73
- },
74
- ],
75
- people: people.map(({ email, name }) => ({ id: email, name })),
76
- members: new Map([[item.threadId, members]]),
77
- });
78
- const message = {
79
- id: item.messageId,
80
- chatId: item.threadId,
81
- senderId: mail.from?.email ?? null,
82
- senderName: mail.from?.name ?? null,
83
- timestamp: item.receivedAt,
84
- editedAt: null,
85
- text: [mail.subject, mail.text].filter(Boolean).join("\n\n"),
86
- outgoing: mail.from === null ? null : mail.from.email === key.account,
87
- attachments: mail.attachments.map((part) => ({
88
- kind: "file",
89
- name: part.name,
90
- ...(part.mime === null ? {} : { mime: part.mime }),
91
- ...(part.bytes === null ? {} : { size: part.bytes.byteLength }),
92
- providerRef: { message: item.messageId, part: part.id },
93
- })),
94
- providerMetadata: {
95
- emailHeaders: { cc: mail.cc.map((address) => address.email), bcc: mail.bcc.map((address) => address.email) },
96
- },
97
- replyTo: null,
98
- forwardedFrom: null,
99
- reactions: null,
100
- };
101
- await store.saveMessages(key, item.threadId, [message], { via: "himalaya", seenAt: startedAt });
102
- const children = [];
103
- for (const part of mail.attachments) {
75
+ const files = [];
76
+ for (const [position, part] of mail.attachments.entries()) {
104
77
  const extraction = part.bytes === null
105
78
  ? { status: "unavailable" }
106
79
  : await extractText(part.bytes, { kind: "file", name: part.name, mime: part.mime, path: part.name }, loadEngine);
107
- if (extraction.status !== "extracted") {
108
- attachments.push({ message: item.messageId, part: part.id, status: extraction.status });
109
- continue;
110
- }
111
- const id = `${item.messageId}:attachment:${part.id}`;
112
- await store.saveMessages(key, item.threadId, [
80
+ attachments.push({ message: item.messageId, part: part.id, status: extraction.status });
81
+ const extracted = extraction.status === "extracted" ? extraction : undefined;
82
+ files.push({
83
+ position,
84
+ kind: "file",
85
+ mime: part.mime,
86
+ name: part.name,
87
+ title: null,
88
+ url: null,
89
+ size: part.bytes === null ? null : part.bytes.byteLength,
90
+ width: null,
91
+ height: null,
92
+ duration: null,
93
+ providerRef: { message: item.messageId, part: part.id },
94
+ localPath: null,
95
+ text: extracted ? extracted.text.slice(0, MAX_ATTACHMENT_TEXT) : null,
96
+ normalizedText: null,
97
+ extraction: extracted ? "text" : "failed",
98
+ extractor: extracted ? extracted.extractor : null,
99
+ extractionError: extracted ? null : extraction.status,
100
+ contentSha256: null,
101
+ extractedAt: startedAt,
102
+ });
103
+ }
104
+ await store.mail.saveThread({
105
+ accountId,
106
+ externalId: item.threadId,
107
+ now: startedAt,
108
+ emails: [
113
109
  {
114
- ...message,
115
- id,
116
- text: `${part.name}\n\n${extraction.text}`.slice(0, 200_000),
117
- attachments: [],
118
- providerMetadata: {
119
- emailAttachment: { message: item.messageId, part: part.id, extractor: extraction.extractor },
120
- },
110
+ externalId: item.messageId,
111
+ subject: mail.subject,
112
+ from: mail.from === null ? null : addressOf(mail.from),
113
+ to: mail.to.map(addressOf),
114
+ cc: mail.cc.map(addressOf),
115
+ bcc: mail.bcc.map(addressOf),
116
+ sentAt: null,
117
+ receivedAt: Date.parse(item.receivedAt),
118
+ bodyText: mail.text || null,
119
+ outgoing: mail.from === null ? null : mail.from.email === key.account,
120
+ mailboxes: [...(foundFolders.get(item.messageId) ?? [])].map(mailbox),
121
+ attachments: files,
121
122
  },
122
- ], { via: "himalaya", seenAt: startedAt });
123
- children.push(id);
124
- present.add(id);
125
- attachments.push({ message: item.messageId, part: part.id, status: "extracted", locatorId: id });
126
- }
127
- await store.setSyncState(key, `mail_attachments:${item.messageId}`, JSON.stringify(children));
123
+ ],
124
+ });
128
125
  saved++;
129
- changed.add(item.threadId);
130
126
  }
131
127
  const complete = listed.length - alreadyStored - saved === 0;
132
- const scope = JSON.stringify({ mode: account.mode ?? "gmail", folders: [...folders].sort() });
133
- const previousScope = await store.syncState(key, "mail_folder_scope");
134
- const { deleted, skipped } = previousScope !== undefined && previousScope.value !== scope
135
- ? { deleted: 0, skipped: "folder scope changed; missing mail is not proven deleted" }
136
- : await dropMissing(store, key, present, new Date(since.getTime() + EDGE).toISOString(), async ({ id }) => {
137
- const parent = id.replace(/:attachment:\d+$/, "");
138
- const membership = await store.syncState(key, `mail_message_folders:${parent}`);
139
- if (membership === undefined)
140
- return account.mode !== "imap" && folders.length === 1 && folders[0] === "[Gmail]/All Mail";
141
- return JSON.parse(membership.value).every((folder) => folders.includes(folder));
142
- });
143
128
  await store.setSyncState(key, "mail_folder_scope", scope);
144
- const indexed = await indexThreads(store, key, [...changed], {
145
- embed: embed && account.embed !== false,
146
- ...(env === undefined ? {} : { env }),
147
- });
129
+ const embedding = { embed: embed && account.embed !== false, ...(env === undefined ? {} : { env }) };
130
+ // Chats an earlier import saved as messages may still wait for vectors; the mail tables have their own.
131
+ const older = await indexThreads(store, key, [], embedding);
132
+ const mail = await embedMail(store, embedding);
133
+ const indexed = {
134
+ ...older,
135
+ chunks: older.chunks + mail.chunks,
136
+ left: older.left || mail.left,
137
+ ...(mail.notEmbedded === undefined ? {} : { notEmbedded: mail.notEmbedded }),
138
+ };
148
139
  const coverage = {
149
140
  folders,
150
141
  since: since.toISOString(),
@@ -1 +1 @@
1
- {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/mail/import.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAmB,MAAM,kCAAkC,CAAA;AAE7F,OAAO,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAA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ACxE,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK;QACL,aAAa;QACb,OAAO;QACP,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;KAChE,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Streams } from "@wirecat/cli-core";
2
+ import type { Command } from "commander";
3
+ export declare const mcpCommand: (program: Command, streams: Streams, env: NodeJS.ProcessEnv) => void;
4
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/mcp/command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGxC,eAAO,MAAM,UAAU,YAAa,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,UAAU,KAAG,IAavF,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { serveStdio } from "@modelcontextprotocol/server/stdio";
2
+ import { createMemoServer } from "./server.js";
3
+ export const mcpCommand = (program, streams, env) => {
4
+ program
5
+ .command("mcp")
6
+ .description("Serve memories, proposed actions and the agent log to an agent over MCP, on stdin and stdout")
7
+ .action(async () => {
8
+ serveStdio(() => createMemoServer(env), { onerror: (error) => streams.diagnostic(`mcp: ${error.message}`) });
9
+ await new Promise((resolve) => {
10
+ process.stdin.once("end", resolve);
11
+ process.stdin.once("close", resolve);
12
+ process.once("SIGINT", resolve);
13
+ process.once("SIGTERM", resolve);
14
+ });
15
+ });
16
+ };
17
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/mcp/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAG/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAE,OAAgB,EAAE,GAAsB,EAAQ,EAAE;IAC7F,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,8FAA8F,CAAC;SAC3G,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,UAAU,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;QAC5G,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAClC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YAClC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACpC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YAC/B,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACN,CAAC,CAAA"}