@wirecat/cli-core 0.632.0 → 0.634.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 (43) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/background/daily-archive-timer.d.ts +1 -1
  3. package/dist/cli/messenger/archive-commands.js +4 -1
  4. package/dist/cli/messenger/store-import-command.d.ts +4 -0
  5. package/dist/cli/messenger/store-import-command.js +166 -0
  6. package/dist/cli/messenger/stored.d.ts +7 -1
  7. package/dist/cli/messenger/stored.js +1 -1
  8. package/dist/domain/relation-role-labels.d.ts +10 -0
  9. package/dist/domain/relation-role-labels.js +40 -0
  10. package/dist/domain/relations.d.ts +7 -0
  11. package/dist/domain/relations.js +10 -0
  12. package/dist/entities/index.d.ts +17 -2
  13. package/dist/entities/index.js +3 -2
  14. package/dist/entities/store-maintenance.d.ts +16 -0
  15. package/dist/entities/store-maintenance.js +10 -0
  16. package/dist/index.d.ts +2 -1
  17. package/dist/index.js +2 -1
  18. package/dist/sends/permissions.js +1 -0
  19. package/dist/services/index.d.ts +1 -0
  20. package/dist/services/index.js +1 -0
  21. package/dist/services/metadata.d.ts +1 -1
  22. package/dist/services/project-activity.d.ts +45 -0
  23. package/dist/services/project-activity.js +76 -0
  24. package/dist/services/project-status/index.d.ts +11 -1
  25. package/dist/services/project-status/index.js +3 -3
  26. package/dist/store/exports.d.ts +1 -0
  27. package/dist/store/index.d.ts +2 -2
  28. package/dist/store/messages.d.ts +13 -0
  29. package/dist/store/messages.js +7 -0
  30. package/dist/store/path.d.ts +3 -0
  31. package/dist/store/path.js +25 -6
  32. package/dist/store/sqlite/chat-activity-counts.d.ts +19 -0
  33. package/dist/store/sqlite/chat-activity-counts.js +26 -0
  34. package/dist/store/sqlite/person-doubts.d.ts +10 -0
  35. package/dist/store/sqlite/person-doubts.js +10 -8
  36. package/dist/store/sqlite/relation-list.d.ts +3 -1
  37. package/dist/store/sqlite/relation-list.js +16 -9
  38. package/dist/store/sqlite/relation-roles.d.ts +4 -0
  39. package/dist/store/sqlite/relation-roles.js +19 -5
  40. package/dist/store/sqlite/reply-times.d.ts +2 -0
  41. package/dist/store/sqlite/reply-times.js +2 -1
  42. package/package.json +1 -1
  43. package/parity.json +3 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,37 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
5
5
  minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
6
6
  shape of this file.
7
7
 
8
+ ## 0.634.0 — 10.11.2026
9
+
10
+ ### Added
11
+
12
+ - **A role list for ties between people and organizations, and role labels in three languages.** `related-to` between
13
+ a person or an organization and another is offered the new `related` list: `colleague`, `adviser`, `investor`,
14
+ `mentor`, `family`, `friend`, plus the owner's own (`knowledge.addRole("related", …)`). It is offered, not enforced:
15
+ any other word is still stored and reads as `custom`. Buying and partnering stay the kinds `customer-of` and
16
+ `partner-of`. Each built-in role of every list carries `labels` (`en`, `ru`, `es`, exported as `ROLE_LABELS`), and
17
+ each row of `listRelations` says in `roleList` which list its role is offered from, so an app shows a picker with
18
+ "add a new role" instead of a text field.
19
+ - **`projectActivity` says how busy every project's linked chats were, in one call.** For each of the owner's
20
+ projects: how many chats are linked to it or its child projects (every confirmed link, any purpose, no chat
21
+ limit; `partial` when some child projects were too deep or too many to read), how many of them are muted now, the messages and the owner's own in a window by when they
22
+ were sent, the newest message, and the busiest chats; muted chats are left out of the counts. A page at a time,
23
+ busiest first, optionally only some accounts. The store read under it, `MessagesStore.chatActivityCounts`, reads
24
+ each chat's window once.
25
+ - **`PersonDoubt.moves`**: the fix of each doubt as data (`{ op: "unmerge", merge }` or
26
+ `{ op: "unlink", identities }`), one per `fix` command, so an app runs it without parsing a command line.
27
+
28
+ ## 0.633.0 — 10.11.2026
29
+
30
+ ### Added
31
+
32
+ - **`<tool> <profile> store import <file.json>` loads made-up chats, people and messages into a test store**, for
33
+ WireCat Desktop's sandbox: Search and Analytics get messenger data without anyone signing in. The file is the
34
+ adapter kit's `Seed` shape plus `"synthetic": true` (the format: the API reference, "Made-up data for a test store");
35
+ it is written as a pushed sync writes, so the same file twice adds nothing and a changed message is updated in
36
+ place. Without `--yes` it only says what it would load. It refuses a file not marked synthetic, the owner's real
37
+ store (whatever `HOME` says), and a profile recorded as another account. New permission key `store.import`, `ask`.
38
+
8
39
  ## 0.632.0 — 10.11.2026
9
40
 
10
41
  ### Added
@@ -24,12 +24,12 @@ export interface DailyArchiveTimerInput {
24
24
  }
25
25
  export declare const dailyArchiveTimer: (input: DailyArchiveTimerInput) => DailyArchiveTimer;
26
26
  export declare const manageDailyArchiveTimer: (plan: DailyArchiveTimer, action: "install" | "start" | "stop" | "status" | "uninstall", system: Pick<ServerSystem, "platform" | "run">, env: NodeJS.ProcessEnv, signal?: AbortSignal) => Promise<{
27
- action?: undefined;
28
27
  name: string;
29
28
  installed: boolean;
30
29
  active: boolean;
31
30
  servicePath: string;
32
31
  timerPath: string;
32
+ action?: undefined;
33
33
  } | {
34
34
  active?: undefined;
35
35
  name: string;
@@ -20,6 +20,7 @@ import { gapsCommand } from "./gaps-command.js";
20
20
  import { historyLimitGaps } from "./history-gaps.js";
21
21
  import { messageItems } from "./message-items.js";
22
22
  import { ENCRYPT_OPTION, passwordOf } from "./password.js";
23
+ import { storeImportCommand } from "./store-import-command.js";
23
24
  import { storeMaintenanceCommands } from "./store-maintenance-command.js";
24
25
  /** `store`: the local store of messages — what it holds, filling it, reading it out, and looking after the file. */
25
26
  export const storeCommand = (messenger) => {
@@ -30,7 +31,8 @@ export const storeCommand = (messenger) => {
30
31
  .addCommand(gapsCommand(messenger))
31
32
  .addCommand(jobsCommand(messenger))
32
33
  .addCommand(exportCommand(messenger))
33
- .addCommand(clearCommand(messenger));
34
+ .addCommand(clearCommand(messenger))
35
+ .addCommand(storeImportCommand(messenger));
34
36
  for (const command of storeMaintenanceCommands(messenger))
35
37
  store.addCommand(command);
36
38
  const examples = {
@@ -43,6 +45,7 @@ export const storeCommand = (messenger) => {
43
45
  export: '"Book club" --output ./messages.jsonl',
44
46
  "gaps show": '"Book club"',
45
47
  "gaps repair": '"Book club" --limit 100',
48
+ import: "./synthetic-chats.json --yes",
46
49
  info: "",
47
50
  "jobs cancel": "job-101",
48
51
  "jobs clear": "",
@@ -0,0 +1,4 @@
1
+ import { Command } from "commander";
2
+ import { type Messenger } from "./context.js";
3
+ /** `store import` — made-up chats, people and messages into a test or sandbox store, through the sync's own writes. */
4
+ export declare const storeImportCommand: (messenger: Messenger) => Command;
@@ -0,0 +1,166 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { CliError } from "@wirecat/cli-base";
3
+ import { annotate } from "@wirecat/cli-base/commands";
4
+ import { Command } from "commander";
5
+ import * as v from "valibot";
6
+ import { accountHome, inOwnerFolder, storePath } from "../../store/path.js";
7
+ import { openStore } from "../../store/store.js";
8
+ import { changesStore, LOCAL_WRITE } from "../effects.js";
9
+ import { itemOf, renderAnswer, snakeKeys } from "../envelope.js";
10
+ import { accountFileFor, recalledAccount, rememberAccount } from "./accounts.js";
11
+ import { messengerContext } from "./context.js";
12
+ import { fill } from "./stored.js";
13
+ const id = v.pipe(v.string(), v.nonEmpty());
14
+ const time = v.pipe(v.string(), v.isoTimestamp(), v.transform((at) => new Date(at).toISOString()));
15
+ const name = v.nullish(v.string(), null);
16
+ const person = v.object({ id, name, username: name });
17
+ /** The adapter kit's `Seed` (`src/kit/seed.ts`) as a file: what a sync would have read, with the defaults filled in. */
18
+ const importFile = v.object({
19
+ synthetic: v.literal(true),
20
+ account: person,
21
+ people: v.optional(v.array(person), []),
22
+ chats: v.array(v.object({
23
+ id,
24
+ title: name,
25
+ kind: v.picklist(["dialog", "group", "channel", "saved", "unknown"]),
26
+ unreadCount: v.nullish(v.pipe(v.number(), v.integer(), v.minValue(0)), null),
27
+ lastMessageAt: v.nullish(time, null),
28
+ participantsCount: v.nullish(v.pipe(v.number(), v.integer(), v.minValue(0)), null),
29
+ })),
30
+ members: v.optional(v.record(v.string(), v.array(person)), {}),
31
+ messages: v.optional(v.array(v.object({
32
+ id,
33
+ chatId: id,
34
+ senderId: v.nullish(id, null),
35
+ senderName: name,
36
+ timestamp: time,
37
+ editedAt: v.nullish(time, null),
38
+ text: v.string(),
39
+ outgoing: v.optional(v.boolean()),
40
+ replyToId: v.optional(id),
41
+ })), []),
42
+ });
43
+ const readImport = (path) => {
44
+ let raw;
45
+ try {
46
+ raw = JSON.parse(readFileSync(path, "utf8"));
47
+ }
48
+ catch {
49
+ // The parser's message quotes the file, which may be anything its caller can read.
50
+ throw new CliError("validation_error", `cannot read ${path} as JSON`);
51
+ }
52
+ if (raw?.synthetic !== true)
53
+ throw new CliError("validation_error", `${path} does not say "synthetic": true — store import loads made-up test data only, never a real account's`);
54
+ const parsed = v.safeParse(importFile, raw);
55
+ if (!parsed.success) {
56
+ const issue = parsed.issues[0];
57
+ const at = v.getDotPath(issue) ?? "the file";
58
+ throw new CliError("validation_error", `${path}: ${at}: expected ${issue.expected ?? "another value"}`);
59
+ }
60
+ const file = parsed.output;
61
+ const chats = new Set(file.chats.map((chat) => chat.id));
62
+ for (const message of file.messages)
63
+ if (!chats.has(message.chatId))
64
+ throw new CliError("validation_error", `${path}: message ${message.id} names chat ${message.chatId}, not in chats`);
65
+ for (const chatId of Object.keys(file.members))
66
+ if (!chats.has(chatId))
67
+ throw new CliError("validation_error", `${path}: members name chat ${chatId}, not in chats`);
68
+ return file;
69
+ };
70
+ const messagesOf = (file) => file.messages.map(({ outgoing, ...message }) => ({
71
+ ...message,
72
+ outgoing: outgoing === undefined ? message.senderId === file.account.id : outgoing,
73
+ attachments: [],
74
+ replyTo: null,
75
+ forwardedFrom: null,
76
+ reactions: null,
77
+ }));
78
+ /** A chat's newest message stands in for its `lastMessageAt` when the file leaves it out, as a chat list would say. */
79
+ const chatsOf = (file, messages) => {
80
+ const newest = new Map();
81
+ for (const { chatId, timestamp } of messages)
82
+ if ((newest.get(chatId) ?? "") < timestamp)
83
+ newest.set(chatId, timestamp);
84
+ return file.chats.map((chat) => ({ ...chat, lastMessageAt: chat.lastMessageAt ?? newest.get(chat.id) ?? null }));
85
+ };
86
+ const heldCounts = async (store, key) => ({
87
+ chats: await store.chats.countChats(key),
88
+ messages: (await store.chats.chatStats(key)).reduce((sum, chat) => sum + chat.messages, 0),
89
+ });
90
+ const refuseOwnerFolders = (messenger, profile, env, target) => {
91
+ const home = accountHome();
92
+ const ownState = home !== undefined &&
93
+ accountFileFor(messenger.app, profile, env) === accountFileFor(messenger.app, profile, { HOME: home });
94
+ if (!inOwnerFolder(target, home) && !ownState)
95
+ return;
96
+ throw new CliError("permission_error", `store import writes made-up data, and ${ownState ? `profile ${profile}'s state` : target} is the owner's real ` +
97
+ "one — run it in a sandbox (WireCat Desktop's bin/sandbox), with HOME, MESSAGING_STORE and the tool's state " +
98
+ "folder of its own");
99
+ };
100
+ /** `store import` — made-up chats, people and messages into a test or sandbox store, through the sync's own writes. */
101
+ export const storeImportCommand = (messenger) => changesStore(annotate(new Command("import"), { output: { entity: "store_import" }, effects: LOCAL_WRITE })
102
+ .summary("load made-up chats, people and messages from a file into a test or sandbox store")
103
+ .description('load a JSON file marked "synthetic": true (account, people, chats, members, messages) into this profile\'s ' +
104
+ "account in the local store, as a sync would save them; the same file twice adds nothing and a changed " +
105
+ "message is updated in place. Refuses the owner's real store. Without --yes, says what it would load and " +
106
+ "changes nothing")
107
+ .argument("<file>", "the JSON file to load")
108
+ .action(async function (path) {
109
+ const context = messengerContext(this, messenger);
110
+ const { profile, env } = context;
111
+ const { command } = messenger.app;
112
+ const file = readImport(path);
113
+ const target = storePath(env);
114
+ refuseOwnerFolders(messenger, profile, env, target);
115
+ if (!context.settings.profilesHere.includes(profile))
116
+ throw new CliError("not_found", `no profile named "${profile}" — make it first with \`${command} ${profile} config set …\``);
117
+ const key = { provider: messenger.provider, account: file.account.id };
118
+ const remembered = recalledAccount(messenger.app, messenger.provider, profile, env);
119
+ if (remembered && remembered.account !== key.account)
120
+ throw new CliError("validation_error", `profile ${profile} is account ${remembered.account}, and ${path} is account ${key.account} — ` +
121
+ "import it into a profile of its own");
122
+ const messages = messagesOf(file);
123
+ const chats = chatsOf(file, messages);
124
+ const people = [...file.people, ...Object.values(file.members).flat()];
125
+ // Over MCP an `ask` write goes ahead (NEED-773): nobody is there to add --yes.
126
+ const yes = this.optsWithGlobals().yes === true || context.agent;
127
+ const planned = {
128
+ store: target,
129
+ profile,
130
+ account: key.account,
131
+ file: { chats: chats.length, people: new Set(people.map((one) => one.id)).size, messages: messages.length },
132
+ };
133
+ if (!yes) {
134
+ context.renderer.note(`would load ${messages.length} messages in ${chats.length} chats into ${target} as profile ${profile} ` +
135
+ `(account ${key.account}); nothing changed — add --yes to load them`);
136
+ renderAnswer(this, context, itemOf(snakeKeys({ ...planned, imported: false })));
137
+ return;
138
+ }
139
+ const answer = await context.run(async () => {
140
+ const store = await openStore({ env, command, version: messenger.app.version });
141
+ try {
142
+ const mapped = (await store.accounts.profiles())[command]?.[profile];
143
+ if (mapped && (mapped.provider !== key.provider || mapped.account !== key.account))
144
+ throw new CliError("validation_error", `the store has profile ${profile} as account ${mapped.account}, and ${path} is account ` +
145
+ `${key.account} — import it into a profile of its own`);
146
+ const before = await heldCounts(store, key);
147
+ await store.accounts.saveAccount(key, { name: file.account.name });
148
+ await store.accounts.saveProfile(command, profile, key);
149
+ rememberAccount(messenger.app, profile, key.account, env);
150
+ await store.people.savePeople(key, [file.account, ...people]);
151
+ await fill(store, key, { chats, messages });
152
+ for (const [chatId, members] of Object.entries(file.members))
153
+ await store.roster.saveMembers(key, chatId, members.map((member) => member.id));
154
+ const after = await heldCounts(store, key);
155
+ return {
156
+ ...planned,
157
+ imported: true,
158
+ added: { chats: after.chats - before.chats, messages: after.messages - before.messages },
159
+ };
160
+ }
161
+ finally {
162
+ await store.close();
163
+ }
164
+ });
165
+ renderAnswer(this, context, itemOf(snakeKeys(answer)));
166
+ }));
@@ -1,5 +1,5 @@
1
1
  import type { Id } from "../../domain/models.js";
2
- import { type MessengerAdapter } from "../../ports/messenger.js";
2
+ import { type HistoryBatch, type MessengerAdapter } from "../../ports/messenger.js";
3
3
  import type { MessengerTraits } from "../../ports/traits.js";
4
4
  import type { EventSink, Warn } from "../../runs/events.js";
5
5
  import { type HistoryLimits } from "../../services/history-limits.js";
@@ -56,3 +56,9 @@ export interface Saving {
56
56
  * known to be whole, and `saveMembers` replaces the list.
57
57
  */
58
58
  export declare const stored: (messenger: MessengerAdapter, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing, closing, namesFromStore, recipientIds, countsUnread, historyLimits, command, }: Saving) => MessengerAdapter;
59
+ /**
60
+ * A pushed batch as the store keeps it. No `markChatsLeft`: a push names some chats, never all of them.
61
+ * No `seenAt`: a pushed snapshot may be older than a deletion this store already holds. A chat's votes and stars go
62
+ * in the transaction of its messages, after them, so a message in the batch is held, or known deleted, before them.
63
+ */
64
+ export declare const fill: (store: MessageStore, account: AccountKey, batch: HistoryBatch) => Promise<void>;
@@ -606,7 +606,7 @@ const onlyRekeys = (batch) => Object.entries(batch).every(([part, items]) => (pa
606
606
  * No `seenAt`: a pushed snapshot may be older than a deletion this store already holds. A chat's votes and stars go
607
607
  * in the transaction of its messages, after them, so a message in the batch is held, or known deleted, before them.
608
608
  */
609
- const fill = async (store, account, batch) => {
609
+ export const fill = async (store, account, batch) => {
610
610
  if (batch.chats?.length)
611
611
  await store.chats.saveChats(account, batch.chats);
612
612
  if (batch.people?.length)
@@ -0,0 +1,10 @@
1
+ import type { ROLE_LISTS, RoleList } from "./relations.js";
2
+ export interface RoleLabels {
3
+ en: string;
4
+ ru: string;
5
+ es: string;
6
+ }
7
+ /** Keyed by list: a deal's `owner` is the one responsible for it, an organization's is the one who owns it. */
8
+ export declare const ROLE_LABELS: {
9
+ [L in RoleList]: Record<(typeof ROLE_LISTS)[L][number], RoleLabels>;
10
+ };
@@ -0,0 +1,40 @@
1
+ const label = (en, ru, es) => ({ en, ru, es });
2
+ /** Keyed by list: a deal's `owner` is the one responsible for it, an organization's is the one who owns it. */
3
+ export const ROLE_LABELS = {
4
+ organization: {
5
+ employee: label("Employee", "Сотрудник", "Empleado"),
6
+ contractor: label("Contractor", "Подрядчик", "Contratista"),
7
+ founder: label("Founder", "Основатель", "Fundador"),
8
+ owner: label("Owner", "Владелец", "Propietario"),
9
+ manager: label("Manager", "Руководитель", "Directivo"),
10
+ adviser: label("Adviser", "Советник", "Asesor"),
11
+ contact: label("Contact", "Контакт", "Contacto"),
12
+ },
13
+ project: {
14
+ owner: label("Owner", "Владелец", "Propietario"),
15
+ manager: label("Manager", "Руководитель", "Directivo"),
16
+ contributor: label("Contributor", "Участник", "Colaborador"),
17
+ "client-contact": label("Client contact", "Контакт клиента", "Contacto del cliente"),
18
+ approver: label("Approver", "Согласующий", "Aprobador"),
19
+ },
20
+ deal: {
21
+ owner: label("Responsible", "Ответственный", "Responsable"),
22
+ contact: label("Contact", "Контакт", "Contacto"),
23
+ "decision-maker": label("Decision-maker", "Принимает решение", "Responsable de decidir"),
24
+ influencer: label("Influencer", "Влияет на решение", "Influye en la decisión"),
25
+ },
26
+ contract: {
27
+ customer: label("Customer", "Заказчик", "Cliente"),
28
+ supplier: label("Supplier", "Поставщик", "Proveedor"),
29
+ signatory: label("Signatory", "Подписант", "Firmante"),
30
+ guarantor: label("Guarantor", "Поручитель", "Garante"),
31
+ },
32
+ related: {
33
+ colleague: label("Colleague", "Коллега", "Colega"),
34
+ adviser: label("Adviser", "Советник", "Asesor"),
35
+ investor: label("Investor", "Инвестор", "Inversor"),
36
+ mentor: label("Mentor", "Наставник", "Mentor"),
37
+ family: label("Family", "Семья", "Familia"),
38
+ friend: label("Friend", "Друг", "Amigo"),
39
+ },
40
+ };
@@ -3,6 +3,12 @@ export declare const ORGANIZATION_ROLES: readonly ["employee", "contractor", "fo
3
3
  export declare const PROJECT_ROLES: readonly ["owner", "manager", "contributor", "client-contact", "approver"];
4
4
  /** A contract party's part; a party the list cannot name has none, never a catch-all `other`. */
5
5
  export declare const CONTRACT_ROLES: readonly ["customer", "supplier", "signatory", "guarantor"];
6
+ /**
7
+ * What a person or an organization is to another on `related-to`, offered so the same tie reads the same way. Unlike
8
+ * the other lists it is not enforced: roles written before it, and words a source reports, stay. Buying and partnering
9
+ * are the kinds `customer-of` and `partner-of`, so they are not roles here.
10
+ */
11
+ export declare const RELATED_ROLES: readonly ["colleague", "adviser", "investor", "mentor", "family", "friend"];
6
12
  /** How much the owner deals with a person on a project himself, not how active the person is; absent is unknown. */
7
13
  export declare const ENGAGEMENT_LEVELS: readonly ["none", "low", "medium", "high"];
8
14
  export type Engagement = (typeof ENGAGEMENT_LEVELS)[number];
@@ -85,6 +91,7 @@ export declare const ROLE_LISTS: {
85
91
  readonly project: readonly ["owner", "manager", "contributor", "client-contact", "approver"];
86
92
  readonly deal: readonly ["owner", "contact", "decision-maker", "influencer"];
87
93
  readonly contract: readonly ["customer", "supplier", "signatory", "guarantor"];
94
+ readonly related: readonly ["colleague", "adviser", "investor", "mentor", "family", "friend"];
88
95
  };
89
96
  export type RoleList = keyof typeof ROLE_LISTS;
90
97
  /** Which list a relationship's role comes from, or `undefined` where a role is free text. */
@@ -13,6 +13,12 @@ export const ORGANIZATION_ROLES = [
13
13
  export const PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
14
14
  /** A contract party's part; a party the list cannot name has none, never a catch-all `other`. */
15
15
  export const CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
16
+ /**
17
+ * What a person or an organization is to another on `related-to`, offered so the same tie reads the same way. Unlike
18
+ * the other lists it is not enforced: roles written before it, and words a source reports, stay. Buying and partnering
19
+ * are the kinds `customer-of` and `partner-of`, so they are not roles here.
20
+ */
21
+ export const RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
16
22
  /** How much the owner deals with a person on a project himself, not how active the person is; absent is unknown. */
17
23
  export const ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
18
24
  export const isEngagement = (value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value);
@@ -74,6 +80,7 @@ export const checkEnds = (kind, from, to) => {
74
80
  throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
75
81
  return spec;
76
82
  };
83
+ const isParty = (type) => type === "person" || type === "organization";
77
84
  /**
78
85
  * The roles a relationship takes, or `undefined` for free text. A member's list is the organization's or the
79
86
  * project's only when the member is a person: a chat's or a sub-project's role was never one of them.
@@ -90,9 +97,12 @@ export const ROLE_LISTS = {
90
97
  project: PROJECT_ROLES,
91
98
  deal: DEAL_ROLES,
92
99
  contract: CONTRACT_ROLES,
100
+ related: RELATED_ROLES,
93
101
  };
94
102
  /** Which list a relationship's role comes from, or `undefined` where a role is free text. */
95
103
  export const roleListOf = (kind, from, to) => {
104
+ if (kind === "related-to" && isParty(from) && isParty(to))
105
+ return "related";
96
106
  const roles = rolesOf(kind, from, to);
97
107
  return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
98
108
  };
@@ -76,7 +76,7 @@ import { responseTimes, waitingChats } from "./reply-stats.js";
76
76
  import { retention } from "./retention.js";
77
77
  import { savedSearch, searchHistoryClear } from "./saved-search.js";
78
78
  import { sendAttempt } from "./send-attempt.js";
79
- import { storeBackup, storeCheck, storeCopyRemoval, storeDecrypt, storeInfo, storeMigration, storeReindex, storeRepair, storeReset, storeRestore } from "./store-maintenance.js";
79
+ import { storeBackup, storeCheck, storeCopyRemoval, storeDecrypt, storeImport, storeInfo, storeMigration, storeReindex, storeRepair, storeReset, storeRestore } from "./store-maintenance.js";
80
80
  import { chatCoverage, storeChatStatus, storeClear, storeExport, storeGapPlan, storeGapRepair, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry } from "./store-records.js";
81
81
  import { storeTable } from "./store-table.js";
82
82
  import { automaticTags, tagChange } from "./tag-change.js";
@@ -91,7 +91,7 @@ import { topic } from "./topic.js";
91
91
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
92
92
  * is the target, not a description of today's output.
93
93
  */
94
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
94
+ export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
95
95
  export declare const ENTITIES: {
96
96
  readonly meeting_ingestion: v.StrictObjectSchema<{
97
97
  readonly meetings: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -9851,6 +9851,21 @@ export declare const ENTITIES: {
9851
9851
  }, undefined>, undefined>;
9852
9852
  readonly schema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9853
9853
  }, undefined>], undefined>;
9854
+ readonly store_import: v.StrictObjectSchema<{
9855
+ readonly store: v.StringSchema<undefined>;
9856
+ readonly profile: v.StringSchema<undefined>;
9857
+ readonly account: v.StringSchema<undefined>;
9858
+ readonly imported: v.BooleanSchema<undefined>;
9859
+ readonly file: v.StrictObjectSchema<{
9860
+ readonly chats: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9861
+ readonly people: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9862
+ readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9863
+ }, undefined>;
9864
+ readonly added: v.OptionalSchema<v.StrictObjectSchema<{
9865
+ readonly chats: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9866
+ readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9867
+ }, undefined>, undefined>;
9868
+ }, undefined>;
9854
9869
  readonly store_repair: v.UnionSchema<[v.StrictObjectSchema<{
9855
9870
  readonly path: v.StringSchema<undefined>;
9856
9871
  readonly exists: v.LiteralSchema<false, undefined>;
@@ -85,7 +85,7 @@ import { responseTimes, waitingChats } from "./reply-stats.js";
85
85
  import { retention } from "./retention.js";
86
86
  import { savedSearch, searchHistoryClear } from "./saved-search.js";
87
87
  import { sendAttempt } from "./send-attempt.js";
88
- import { storeBackup, storeCheck, storeCopyRemoval, storeDecrypt, storeInfo, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, } from "./store-maintenance.js";
88
+ import { storeBackup, storeCheck, storeCopyRemoval, storeDecrypt, storeImport, storeInfo, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, } from "./store-maintenance.js";
89
89
  import { chatCoverage, storeChatStatus, storeClear, storeExport, storeGapPlan, storeGapRepair, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, syncProgress, } from "./store-records.js";
90
90
  import { storeTable } from "./store-table.js";
91
91
  import { automaticTags, tagChange } from "./tag-change.js";
@@ -100,7 +100,7 @@ import { topic } from "./topic.js";
100
100
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
101
101
  * is the target, not a description of today's output.
102
102
  */
103
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
103
+ export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
104
104
  export const ENTITIES = {
105
105
  sync_progress: syncProgress,
106
106
  deal,
@@ -327,6 +327,7 @@ export const ENTITIES = {
327
327
  store_decrypt: storeDecrypt,
328
328
  store_restore: storeRestore,
329
329
  store_reset: storeReset,
330
+ store_import: storeImport,
330
331
  store_repair: storeRepair,
331
332
  store_copy_removal: storeCopyRemoval,
332
333
  store_table: storeTable,
@@ -362,6 +362,22 @@ export declare const storeRestore: v.UnionSchema<[v.StrictObjectSchema<{
362
362
  readonly rebuilt: v.ArraySchema<v.StringSchema<undefined>, undefined>;
363
363
  readonly foreign_key_violations: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
364
364
  }, undefined>], undefined>;
365
+ /** Made-up data for a test store: what the file holds and, once loaded, what it added to the account. */
366
+ export declare const storeImport: v.StrictObjectSchema<{
367
+ readonly store: v.StringSchema<undefined>;
368
+ readonly profile: v.StringSchema<undefined>;
369
+ readonly account: v.StringSchema<undefined>;
370
+ readonly imported: v.BooleanSchema<undefined>;
371
+ readonly file: v.StrictObjectSchema<{
372
+ readonly chats: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
373
+ readonly people: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
374
+ readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
375
+ }, undefined>;
376
+ readonly added: v.OptionalSchema<v.StrictObjectSchema<{
377
+ readonly chats: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
378
+ readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
379
+ }, undefined>, undefined>;
380
+ }, undefined>;
365
381
  export declare const storeReset: v.UnionSchema<[v.StrictObjectSchema<{
366
382
  readonly path: v.StringSchema<undefined>;
367
383
  readonly exists: v.LiteralSchema<false, undefined>;
@@ -174,6 +174,16 @@ export const storeRestore = v.union([
174
174
  foreign_key_violations: count,
175
175
  }),
176
176
  ]);
177
+ const importCounts = v.strictObject({ chats: count, messages: count });
178
+ /** Made-up data for a test store: what the file holds and, once loaded, what it added to the account. */
179
+ export const storeImport = v.strictObject({
180
+ store: text,
181
+ profile: text,
182
+ account: text,
183
+ imported: v.boolean(),
184
+ file: v.strictObject({ chats: count, people: count, messages: count }),
185
+ added: v.optional(importCounts),
186
+ });
177
187
  export const storeReset = v.union([
178
188
  v.strictObject({ ...absent.entries, reset: v.literal(false) }),
179
189
  v.strictObject({
package/dist/index.d.ts CHANGED
@@ -24,7 +24,8 @@ export { rankingOptions } from "./domain/rankings-options.js";
24
24
  export { type EnvelopeOptions, type EnvelopeRecord, type EnvelopeSource, envelopeOfJsonl, envelopeOfText, type IngestError, RECORD_ENTITY_TYPES, RECORD_OPERATIONS, RECORDS_ENVELOPE_SCHEMA, RECORDS_SCHEMA_VERSION, type RecordEntityType, type RecordOperation, type RecordRelation, type RecordsEnvelope, } from "./domain/records.js";
25
25
  export { type ColumnShape, envelopeOfCsv, recordColumns, recordTemplate, TABLE_RECORD_TYPES, type TableColumn, type TableEnvelope, TableError, type TablePlace, } from "./domain/records-table.js";
26
26
  export { canonicalReference, formatReference, looksLikeReference, parseReference, REF_KINDS, type Reference, type RefKindName, type RefKindSpec, } from "./domain/references.js";
27
- export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, type Engagement, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, type RelationKind, ROLE_LISTS, type RoleList, rolesOf, STANDINGS, type Standing, standingOf, usableLink, } from "./domain/relations.js";
27
+ export { ROLE_LABELS, type RoleLabels } from "./domain/relation-role-labels.js";
28
+ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, type Engagement, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATED_ROLES, RELATION_KINDS, RELATIONS, type RelationKind, ROLE_LISTS, type RoleList, rolesOf, STANDINGS, type Standing, standingOf, usableLink, } from "./domain/relations.js";
28
29
  export { normalizeTag, TAG_TYPES, type TagType } from "./domain/tags.js";
29
30
  export { envelopeOfVcard, isVcard, type VcardIssue, type VcardOptions } from "./domain/vcard.js";
30
31
  export { type AppErrors, DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
package/dist/index.js CHANGED
@@ -19,7 +19,8 @@ export { rankingOptions } from "./domain/rankings-options.js";
19
19
  export { envelopeOfJsonl, envelopeOfText, RECORD_ENTITY_TYPES, RECORD_OPERATIONS, RECORDS_ENVELOPE_SCHEMA, RECORDS_SCHEMA_VERSION, } from "./domain/records.js";
20
20
  export { envelopeOfCsv, recordColumns, recordTemplate, TABLE_RECORD_TYPES, TableError, } from "./domain/records-table.js";
21
21
  export { canonicalReference, formatReference, looksLikeReference, parseReference, REF_KINDS, } from "./domain/references.js";
22
- export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, ROLE_LISTS, rolesOf, STANDINGS, standingOf, usableLink, } from "./domain/relations.js";
22
+ export { ROLE_LABELS } from "./domain/relation-role-labels.js";
23
+ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATED_ROLES, RELATION_KINDS, RELATIONS, ROLE_LISTS, rolesOf, STANDINGS, standingOf, usableLink, } from "./domain/relations.js";
23
24
  export { normalizeTag, TAG_TYPES } from "./domain/tags.js";
24
25
  export { envelopeOfVcard, isVcard } from "./domain/vcard.js";
25
26
  export { DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
@@ -24,6 +24,7 @@ export const DEFAULT_PERMISSIONS = {
24
24
  "store.migrate": "ask",
25
25
  "store.repair": "ask",
26
26
  "store.reset": "ask",
27
+ "store.import": "ask",
27
28
  "store.clear": "ask",
28
29
  "store.decrypt": "ask",
29
30
  "store.copies.delete": "ask",
@@ -15,6 +15,7 @@ export type { MoveMediaArchiveOptions } from "./media-archive-move.js";
15
15
  export { moveMediaArchive } from "./media-archive-move.js";
16
16
  export { type DownloadedModel, downloadImageModel, downloadTextModel, type ModelDownloadOptions, } from "./model-downloads.js";
17
17
  export { MONEY_DONE, MONEY_REQUEST, MONEY_WORDS, moneyClassesOf, PROMISE } from "./money-words.js";
18
+ export { type ProjectActivities, type ProjectActivity, type ProjectActivityChat, type ProjectActivityInput, projectActivity, } from "./project-activity.js";
18
19
  export type { ProjectChatFetcher, ProjectChatFetchProgress, ProjectChatFetchRequest, ProjectEvidenceContext, ProjectEvidenceItem, ProjectEvidencePerson, ProjectGathering, ProjectGatheringPorts, ProjectGatheringStop, ProjectIndexCatchUp, } from "./project-gathering.js";
19
20
  export { gatherProjectEvidence } from "./project-gathering.js";
20
21
  export type { ProjectNeighbour, ProjectNeighbourReader } from "./project-gathering-around.js";
@@ -11,6 +11,7 @@ export { archiveMedia, checkMediaArchive } from "./media-archive.js";
11
11
  export { moveMediaArchive } from "./media-archive-move.js";
12
12
  export { downloadImageModel, downloadTextModel, } from "./model-downloads.js";
13
13
  export { MONEY_DONE, MONEY_REQUEST, MONEY_WORDS, moneyClassesOf, PROMISE } from "./money-words.js";
14
+ export { projectActivity, } from "./project-activity.js";
14
15
  export { gatherProjectEvidence } from "./project-gathering.js";
15
16
  export { documentPassage, storedMessageNeighbours, storedNeighbours } from "./project-gathering-around.js";
16
17
  export { findEvidenceMentions } from "./project-gathering-mentions.js";
@@ -14,12 +14,12 @@ export declare const metadataService: (deps: ServiceDeps) => {
14
14
  dryRun?: boolean;
15
15
  }) => Promise<{
16
16
  items: ({
17
- error?: undefined;
18
17
  chatId: string;
19
18
  tags: import("../domain/channel-tags.js").ChannelTagMatch[];
20
19
  algorithm: string;
21
20
  fetchedAt: string | null;
22
21
  source: string;
22
+ error?: undefined;
23
23
  } | {
24
24
  tags?: undefined;
25
25
  algorithm?: undefined;