@wirecat/cli-core 0.618.0 → 0.619.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 +339 -1
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES +3 -0
- package/dist/background/daily-archive-timer.d.ts +1 -1
- package/dist/background/deliver.d.ts +5 -2
- package/dist/background/deliver.js +30 -12
- package/dist/background/report/render.d.ts +3 -1
- package/dist/background/report/render.js +3 -1
- package/dist/calendar/cli/answers.d.ts +1 -0
- package/dist/calendar/cli/answers.js +6 -1
- package/dist/calendar/cli/index.js +2 -14
- package/dist/calendar/cli/people-link.d.ts +3 -0
- package/dist/calendar/cli/people-link.js +23 -0
- package/dist/calendar/index.d.ts +1 -1
- package/dist/calendar/index.js +1 -1
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/cli/base-stages-command.d.ts +22 -0
- package/dist/cli/base-stages-command.js +174 -0
- package/dist/cli/command-runs.d.ts +2 -0
- package/dist/cli/command-runs.js +3 -1
- package/dist/cli/config-command.js +6 -1
- package/dist/cli/context.js +1 -0
- package/dist/cli/group-lock.d.ts +42 -0
- package/dist/cli/group-lock.js +130 -0
- package/dist/cli/index.d.ts +7 -2
- package/dist/cli/index.js +7 -2
- package/dist/cli/messenger/backfill-command.js +27 -15
- package/dist/cli/messenger/contacts-command.js +10 -3
- package/dist/cli/messenger/context.js +1 -0
- package/dist/cli/messenger/doctor-command.js +3 -1
- package/dist/cli/messenger/models-command.js +1 -1
- package/dist/cli/messenger/store-maintenance-command.d.ts +22 -2
- package/dist/cli/messenger/store-maintenance-command.js +9 -4
- package/dist/cli/model-catalogue-command.d.ts +3 -1
- package/dist/cli/model-catalogue-command.js +46 -2
- package/dist/cli/profile.d.ts +8 -0
- package/dist/cli/profile.js +25 -0
- package/dist/cli/program.js +2 -0
- package/dist/cli/runs/search-query.d.ts +1 -1
- package/dist/cli/runs/search-query.js +4 -0
- package/dist/cli/runs/search.d.ts +5 -1
- package/dist/cli/runs/search.js +12 -1
- package/dist/cli/search-left-out.d.ts +6 -1
- package/dist/cli/search-left-out.js +9 -4
- package/dist/cli/settings.d.ts +8 -0
- package/dist/cli/settings.js +17 -2
- package/dist/cli/shared-command-exports.d.ts +16 -0
- package/dist/cli/store-recover.d.ts +3 -3
- package/dist/cli/store-recover.js +26 -26
- package/dist/cli/store-settings.d.ts +2 -0
- package/dist/cli/store-settings.js +37 -9
- package/dist/crm/cli/index.js +38 -6
- package/dist/crm/group-hint.d.ts +8 -0
- package/dist/crm/group-hint.js +13 -0
- package/dist/crm/source.d.ts +12 -1
- package/dist/crm/sync.d.ts +31 -2
- package/dist/crm/sync.js +110 -3
- package/dist/crm/testing/acme-scenario.d.ts +40 -0
- package/dist/crm/testing/acme-scenario.js +170 -0
- package/dist/crm/testing/index.d.ts +1 -0
- package/dist/crm/testing/index.js +1 -0
- package/dist/crm/testing/source-contract.js +12 -0
- package/dist/crm/testing/source.d.ts +2 -0
- package/dist/crm/testing/source.js +1 -0
- package/dist/domain/addresses.d.ts +13 -0
- package/dist/domain/addresses.js +63 -0
- package/dist/domain/categories.d.ts +3 -0
- package/dist/domain/categories.js +2 -0
- package/dist/domain/crm.d.ts +23 -0
- package/dist/domain/crm.js +7 -0
- package/dist/domain/mentions.d.ts +2 -12
- package/dist/domain/mentions.js +2 -19
- package/dist/domain/orders.d.ts +8 -1
- package/dist/domain/orders.js +6 -2
- package/dist/domain/phones.d.ts +26 -0
- package/dist/domain/phones.js +48 -0
- package/dist/domain/record-types.d.ts +1 -1
- package/dist/domain/record-types.js +1 -0
- package/dist/domain/records.d.ts +5 -0
- package/dist/domain/ref-summaries.d.ts +39 -0
- package/dist/domain/ref-summaries.js +51 -3
- package/dist/domain/relations.d.ts +12 -2
- package/dist/domain/relations.js +14 -3
- package/dist/domain/vcard.d.ts +2 -2
- package/dist/domain/vcard.js +4 -10
- package/dist/embeddings/models.d.ts +11 -3
- package/dist/embeddings/models.js +28 -4
- package/dist/entities/business-context.d.ts +149 -0
- package/dist/entities/business-context.js +192 -0
- package/dist/entities/contact-activity.d.ts +2 -0
- package/dist/entities/contact-activity.js +7 -1
- package/dist/entities/contact-context.d.ts +157 -0
- package/dist/entities/contact-context.js +2 -0
- package/dist/entities/deal.d.ts +10 -0
- package/dist/entities/deal.js +2 -0
- package/dist/entities/index.d.ts +23 -3
- package/dist/entities/index.js +5 -0
- package/dist/entities/mention.d.ts +4 -3
- package/dist/entities/mention.js +2 -1
- package/dist/entities/message-transfer.d.ts +4 -2
- package/dist/entities/message-transfer.js +2 -2
- package/dist/entities/model.d.ts +2 -2
- package/dist/entities/model.js +1 -1
- package/dist/entities/relationship.d.ts +4 -0
- package/dist/entities/relationship.js +4 -0
- package/dist/errors/reasons.js +37 -4
- package/dist/fetch/page.js +2 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/meetings/context-store.d.ts +2 -0
- package/dist/meetings/findings-rules.d.ts +4 -0
- package/dist/meetings/findings-rules.js +5 -2
- package/dist/meetings/result-items.d.ts +1 -0
- package/dist/meetings/result-items.js +1 -0
- package/dist/models/index.js +22 -5
- package/dist/runs/events.d.ts +11 -1
- package/dist/runs/events.js +3 -1
- package/dist/runs/log-attributes.js +4 -0
- package/dist/runs/log-events.js +2 -0
- package/dist/runs/recording.d.ts +3 -0
- package/dist/runs/recording.js +36 -12
- package/dist/runs/run.d.ts +12 -3
- package/dist/runs/run.js +32 -13
- package/dist/search/account-list.d.ts +6 -0
- package/dist/search/account-list.js +9 -3
- package/dist/search/groups.d.ts +68 -0
- package/dist/search/groups.js +172 -0
- package/dist/services/account-groups.d.ts +28 -0
- package/dist/services/account-groups.js +89 -0
- package/dist/services/archive.d.ts +7 -1
- package/dist/services/archive.js +19 -3
- package/dist/services/business-context.d.ts +113 -0
- package/dist/services/business-context.js +156 -0
- package/dist/services/communications.d.ts +50 -0
- package/dist/services/communications.js +140 -0
- package/dist/services/deal-context.d.ts +90 -0
- package/dist/services/deal-context.js +131 -0
- package/dist/services/deps.d.ts +2 -0
- package/dist/services/enrichment.d.ts +7 -2
- package/dist/services/enrichment.js +46 -5
- package/dist/services/events-search.js +2 -1
- package/dist/services/group-guard.d.ts +28 -0
- package/dist/services/group-guard.js +131 -0
- package/dist/services/index.d.ts +15 -2
- package/dist/services/index.js +9 -2
- package/dist/services/ingest.d.ts +12 -0
- package/dist/services/ingest.js +4 -0
- package/dist/services/meaning-model.d.ts +7 -0
- package/dist/services/meaning-model.js +20 -0
- package/dist/services/meeting-context.d.ts +6 -1
- package/dist/services/meeting-context.js +12 -5
- package/dist/services/message-resolution.js +2 -3
- package/dist/services/messages-meaning.js +4 -5
- package/dist/services/messages-search.d.ts +5 -1
- package/dist/services/messages-search.js +1 -1
- package/dist/services/model-downloads.d.ts +1 -1
- package/dist/services/model-downloads.js +6 -4
- package/dist/services/money-context.d.ts +73 -0
- package/dist/services/money-context.js +77 -0
- package/dist/services/notes-search.d.ts +4 -1
- package/dist/services/notes-search.js +19 -7
- package/dist/services/organization-context.d.ts +80 -0
- package/dist/services/organization-context.js +154 -0
- package/dist/services/people.d.ts +22 -6
- package/dist/services/people.js +38 -8
- package/dist/services/person-business.d.ts +43 -0
- package/dist/services/person-business.js +67 -0
- package/dist/services/person-context.d.ts +9 -1
- package/dist/services/person-context.js +5 -3
- package/dist/services/proposals/kinds/identity-link.d.ts +4 -0
- package/dist/services/proposals/kinds/identity-link.js +48 -0
- package/dist/services/proposals/kinds/orders.js +1 -1
- package/dist/services/proposals/registry.js +2 -0
- package/dist/services/search-kind.d.ts +12 -5
- package/dist/services/search-kind.js +49 -10
- package/dist/services/text-model-choice.js +1 -1
- package/dist/store/accounts.d.ts +18 -0
- package/dist/store/accounts.js +18 -3
- package/dist/store/damage.d.ts +43 -10
- package/dist/store/damage.js +119 -36
- package/dist/store/decisions.js +3 -1
- package/dist/store/evidence-findings.d.ts +14 -0
- package/dist/store/evidence-findings.js +2 -0
- package/dist/store/exports.d.ts +2 -1
- package/dist/store/identity-links.d.ts +92 -0
- package/dist/store/identity-links.js +6 -0
- package/dist/store/index.d.ts +11 -5
- package/dist/store/index.js +5 -2
- package/dist/store/journal.d.ts +10 -0
- package/dist/store/journal.js +33 -0
- package/dist/store/marks.d.ts +19 -1
- package/dist/store/marks.js +23 -1
- package/dist/store/people.d.ts +22 -0
- package/dist/store/people.js +15 -1
- package/dist/store/sqlite/accounts.js +2 -0
- package/dist/store/sqlite/base-stages.d.ts +122 -0
- package/dist/store/sqlite/base-stages.js +443 -0
- package/dist/store/sqlite/base-suggest.d.ts +13 -0
- package/dist/store/sqlite/base-suggest.js +62 -0
- package/dist/store/sqlite/business-contracts.js +10 -1
- package/dist/store/sqlite/crm-settings.d.ts +12 -2
- package/dist/store/sqlite/crm-settings.js +56 -13
- package/dist/store/sqlite/crm.d.ts +13 -1
- package/dist/store/sqlite/crm.js +20 -4
- package/dist/store/sqlite/deals.d.ts +33 -0
- package/dist/store/sqlite/deals.js +42 -4
- package/dist/store/sqlite/decision-requests.js +7 -3
- package/dist/store/sqlite/email-index.js +8 -4
- package/dist/store/sqlite/evidence-findings.js +29 -5
- package/dist/store/sqlite/findings-core.js +4 -2
- package/dist/store/sqlite/identity-link-rows.d.ts +50 -0
- package/dist/store/sqlite/identity-link-rows.js +146 -0
- package/dist/store/sqlite/identity-proposals.d.ts +53 -0
- package/dist/store/sqlite/identity-proposals.js +234 -0
- package/dist/store/sqlite/knowledge.js +2 -2
- package/dist/store/sqlite/link-kinds.d.ts +1 -0
- package/dist/store/sqlite/link-kinds.js +1 -0
- package/dist/store/sqlite/link-row.d.ts +6 -0
- package/dist/store/sqlite/link-row.js +35 -0
- package/dist/store/sqlite/link-source.d.ts +10 -0
- package/dist/store/sqlite/link-source.js +16 -0
- package/dist/store/sqlite/manifest.js +1 -0
- package/dist/store/sqlite/meeting-context-links.js +9 -6
- package/dist/store/sqlite/memories.js +9 -7
- package/dist/store/sqlite/mentions.d.ts +4 -1
- package/dist/store/sqlite/mentions.js +14 -9
- package/dist/store/sqlite/migrations.generated.js +8 -0
- package/dist/store/sqlite/notes.d.ts +1 -2
- package/dist/store/sqlite/notes.js +4 -29
- package/dist/store/sqlite/open-store.js +3 -0
- package/dist/store/sqlite/open.js +11 -2
- package/dist/store/sqlite/orders.d.ts +2 -0
- package/dist/store/sqlite/orders.js +9 -3
- package/dist/store/sqlite/organization-categories.d.ts +18 -0
- package/dist/store/sqlite/organization-categories.js +34 -0
- package/dist/store/sqlite/organizations.d.ts +5 -1
- package/dist/store/sqlite/organizations.js +14 -4
- package/dist/store/sqlite/person-links.d.ts +19 -4
- package/dist/store/sqlite/person-links.js +49 -11
- package/dist/store/sqlite/person-match-scan.d.ts +13 -0
- package/dist/store/sqlite/person-match-scan.js +251 -0
- package/dist/store/sqlite/person-matcher.d.ts +16 -0
- package/dist/store/sqlite/person-matcher.js +32 -0
- package/dist/store/sqlite/proposed-actions.js +6 -0
- package/dist/store/sqlite/record-matching.d.ts +2 -8
- package/dist/store/sqlite/record-matching.js +8 -40
- package/dist/store/sqlite/record-projectors-phone.js +2 -1
- package/dist/store/sqlite/record-relationships.d.ts +52 -0
- package/dist/store/sqlite/record-relationships.js +243 -0
- package/dist/store/sqlite/record-run.d.ts +5 -0
- package/dist/store/sqlite/record-run.js +62 -2
- package/dist/store/sqlite/record-writes.d.ts +1 -1
- package/dist/store/sqlite/record-writes.js +4 -2
- package/dist/store/sqlite/records.js +27 -2
- package/dist/store/sqlite/ref-accounts.d.ts +13 -0
- package/dist/store/sqlite/ref-accounts.js +117 -0
- package/dist/store/sqlite/ref-summaries.js +5 -1
- package/dist/store/sqlite/relation-list.d.ts +4 -1
- package/dist/store/sqlite/relation-list.js +18 -2
- package/dist/store/sqlite/relation-proposals.d.ts +6 -0
- package/dist/store/sqlite/relation-proposals.js +3 -0
- package/dist/store/sqlite/relation-roles.js +12 -6
- package/dist/store/sqlite/reported-relations.d.ts +11 -1
- package/dist/store/sqlite/reported-relations.js +59 -18
- package/dist/store/sqlite/schema.d.ts +32 -0
- package/dist/store/sqlite/schema.js +3 -0
- package/dist/store/sqlite/transaction.js +11 -1
- package/dist/store/store.d.ts +3 -0
- package/dist/store/store.js +5 -0
- package/dist/store/write-events.d.ts +18 -0
- package/dist/store/write-events.js +88 -0
- package/package.json +3 -3
- package/parity.json +11 -4
- package/schemas/records-envelope.v1.schema.json +3 -0
|
@@ -3,9 +3,14 @@ import type { AccountKey, AccountsStore, MessageStore } from "../store/store.js"
|
|
|
3
3
|
export type MeetingContextServiceStore = Pick<MessageStore, "meetings" | "notes" | "knowledge" | "memories" | "facts"> & {
|
|
4
4
|
accounts: Pick<AccountsStore, "storedAccount">;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Reuses the owner's records; scoped meeting references are checked again by each native write. `author` says who
|
|
8
|
+
* runs it: an agent's participant link, memory and fact wait for the owner as proposals. Left out, the run is taken
|
|
9
|
+
* for an agent's, so a caller that never said who runs it cannot write as the owner.
|
|
10
|
+
*/
|
|
7
11
|
export declare const createMeetingContextService: (store: MeetingContextServiceStore, input: AccountKey, options?: {
|
|
8
12
|
now?: () => number;
|
|
13
|
+
author?: "owner" | "agent";
|
|
9
14
|
}) => Promise<{
|
|
10
15
|
scope: Readonly<import("../meetings/provider.js").MeetingProviderScope>;
|
|
11
16
|
accountId: number;
|
|
@@ -10,9 +10,16 @@ const checkCancelled = (signal) => {
|
|
|
10
10
|
const timeout = signal.reason instanceof Error && signal.reason.name === "TimeoutError";
|
|
11
11
|
throw new CliError(timeout ? "timeout" : "cancelled", "meeting context was interrupted");
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Reuses the owner's records; scoped meeting references are checked again by each native write. `author` says who
|
|
15
|
+
* runs it: an agent's participant link, memory and fact wait for the owner as proposals. Left out, the run is taken
|
|
16
|
+
* for an agent's, so a caller that never said who runs it cannot write as the owner.
|
|
17
|
+
*/
|
|
14
18
|
export const createMeetingContextService = async (store, input, options = {}) => {
|
|
15
19
|
const now = options.now ?? Date.now;
|
|
20
|
+
const author = options.author ?? "agent";
|
|
21
|
+
// An agent's memory or fact waits as proposed, as the memory and fact stores keep any agent's.
|
|
22
|
+
const writer = author === "owner" ? "owner" : { bot: "agent" };
|
|
16
23
|
const scope = snapshotMeetingScope(input);
|
|
17
24
|
const key = Object.freeze({ ...scope, ...(input.scope === undefined ? {} : { scope: input.scope }) });
|
|
18
25
|
const account = await store.accounts.storedAccount(key);
|
|
@@ -59,8 +66,8 @@ export const createMeetingContextService = async (store, input, options = {}) =>
|
|
|
59
66
|
scope: change.scope,
|
|
60
67
|
evidence: meetingReferences(change.evidence),
|
|
61
68
|
subject: change.subject === undefined ? reference : meetingReferences([change.subject])[0],
|
|
62
|
-
status: "confirmed",
|
|
63
|
-
author:
|
|
69
|
+
status: writer === "owner" ? "confirmed" : "proposed",
|
|
70
|
+
author: writer,
|
|
64
71
|
});
|
|
65
72
|
case "fact.add":
|
|
66
73
|
return store.facts.add({
|
|
@@ -69,7 +76,7 @@ export const createMeetingContextService = async (store, input, options = {}) =>
|
|
|
69
76
|
scope: change.scope,
|
|
70
77
|
evidence: meetingReferences(change.evidence),
|
|
71
78
|
subject: change.subject === undefined ? reference : meetingReferences([change.subject])[0],
|
|
72
|
-
by:
|
|
79
|
+
by: writer,
|
|
73
80
|
});
|
|
74
81
|
case "event.link":
|
|
75
82
|
return store.meetings.linkMeetingEvent({
|
|
@@ -87,7 +94,7 @@ export const createMeetingContextService = async (store, input, options = {}) =>
|
|
|
87
94
|
participantId: change.participantId,
|
|
88
95
|
personUid: change.personUid,
|
|
89
96
|
now: now(),
|
|
90
|
-
author
|
|
97
|
+
author,
|
|
91
98
|
...(change.expectedPersonUid === undefined ? {} : { expectedPersonUid: change.expectedPersonUid }),
|
|
92
99
|
...(change.targetAccountIds === undefined ? {} : { targetAccountIds: change.targetAccountIds }),
|
|
93
100
|
...(operation.signal ? { signal: operation.signal } : {}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliError, singleLine } from "@wirecat/cli-base";
|
|
2
2
|
import { chatReferenceOf, ensureAccount } from "../domain/ref-arguments.js";
|
|
3
|
+
import { profilesOn } from "../domain/ref-summaries.js";
|
|
3
4
|
import { isId, pickChat, pickPerson } from "../resolve.js";
|
|
4
5
|
import { codeOf } from "../sends/guarded.js";
|
|
5
6
|
import { nothingStored } from "./deps.js";
|
|
@@ -78,9 +79,7 @@ const leftIn = ({ items }) => items.some((one) => one.membershipState === "left"
|
|
|
78
79
|
export const profilesOnAccount = (store, app, provider) => async (account) => {
|
|
79
80
|
if (app === undefined)
|
|
80
81
|
return undefined;
|
|
81
|
-
return
|
|
82
|
-
.filter(([, key]) => key.provider === provider && key.account === account)
|
|
83
|
-
.map(([name]) => name);
|
|
82
|
+
return profilesOn(await store.accounts.profiles(), app, { provider, account });
|
|
84
83
|
};
|
|
85
84
|
/** `left` is given where a left chat is refused; it lets a numeric id the store does not hold through as typed. */
|
|
86
85
|
const chatIdAmong = async (messenger, reference, account, { held, renamed, left, profilesOn, }) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { parseLucene } from "@wirecat/cli-base/query";
|
|
3
|
-
import { chosenTextModel } from "../embeddings/models.js";
|
|
4
3
|
import { meaningWords } from "../search/lucene/meaning-parts.js";
|
|
5
4
|
import { validateFields } from "../search/lucene/registry.js";
|
|
6
5
|
import { SEARCH_QUERY } from "../search/lucene/types.js";
|
|
7
6
|
import { questionLookup, questionText } from "../search/question-plan.js";
|
|
8
7
|
import { embeddingTarget, withEmbedder } from "./embeddings-maintenance.js";
|
|
8
|
+
import { meaningModel } from "./meaning-model.js";
|
|
9
9
|
import { MEANING_DEPTH } from "./messages-discovery.js";
|
|
10
10
|
import { plainWords } from "./pictures.js";
|
|
11
11
|
// The text notes embed: `search all` compares cosines across sources, so all must embed one text (IDEA-249).
|
|
@@ -27,14 +27,13 @@ const meaningText = (question) => {
|
|
|
27
27
|
* on disk and vectors exist — never a download, never a remote model — and any failure leaves the words alone.
|
|
28
28
|
*/
|
|
29
29
|
export const meaningLane = (deps) => async (question, accounts, shared, within) => {
|
|
30
|
-
const
|
|
31
|
-
const target = embeddingTarget(deps,
|
|
30
|
+
const store = await deps.store();
|
|
31
|
+
const target = embeddingTarget(deps, await meaningModel(store, deps.env));
|
|
32
32
|
const skipped = (reason, step) => ({
|
|
33
33
|
skipped: { reason, model: target.id, ...(step ? { step } : {}) },
|
|
34
34
|
});
|
|
35
35
|
if (!target.installed)
|
|
36
36
|
return skipped(`${target.id} is not downloaded`, "models.download");
|
|
37
|
-
const store = await deps.store();
|
|
38
37
|
const ready = [];
|
|
39
38
|
const without = [];
|
|
40
39
|
// Mail keeps its vectors by thread, not by message: its accounts are read through the mail store.
|
|
@@ -83,7 +82,7 @@ export const meaningLane = (deps) => async (question, accounts, shared, within)
|
|
|
83
82
|
if (shared && !deps.embedders)
|
|
84
83
|
await lookUp(await shared.get(target.key, () => target.open()));
|
|
85
84
|
else
|
|
86
|
-
await withEmbedder(deps, target,
|
|
85
|
+
await withEmbedder(deps, target, target.id, {}, lookUp);
|
|
87
86
|
}
|
|
88
87
|
if (ranked.length === 0 && without.length === accounts.length)
|
|
89
88
|
return skipped("no message has a vector yet", "conversations.rebuild");
|
|
@@ -102,6 +102,8 @@ export interface Prepared {
|
|
|
102
102
|
}
|
|
103
103
|
export declare const prepareLucene: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger: Partial<Pick<MessengerTraits, "savedChatId" | "app">> & {
|
|
104
104
|
messageStars?: boolean;
|
|
105
|
+
/** The run's environment, where a group lock is read (WC-ACCT-13). */
|
|
106
|
+
env?: NodeJS.ProcessEnv;
|
|
105
107
|
}) => Promise<Prepared>;
|
|
106
108
|
/**
|
|
107
109
|
* The stemmer a search with stemmed words runs with. While the stems are built, or chosen by a newer
|
|
@@ -118,7 +120,9 @@ export declare const coverageOf: (store: MessageStore, { scopeAccounts, selected
|
|
|
118
120
|
completeness: (ChatCompleteness & AccountKey)[];
|
|
119
121
|
coverage: SearchCoverage;
|
|
120
122
|
}>;
|
|
121
|
-
export declare const searchLucene: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger?: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">>
|
|
123
|
+
export declare const searchLucene: (store: MessageStore, account: AccountKey, request: SearchQuery, messenger?: Partial<Pick<MessengerTraits, "savedChatId" | "app" | "history" | "provider">> & {
|
|
124
|
+
env?: NodeJS.ProcessEnv;
|
|
125
|
+
}) => Promise<SearchFound>;
|
|
122
126
|
/**
|
|
123
127
|
* How many messages the query matches, mail included, each counted no further than `cap + 1`; `undefined` when only
|
|
124
128
|
* the search itself could tell.
|
|
@@ -60,7 +60,7 @@ export const prepareLucene = async (store, account, request, messenger) => {
|
|
|
60
60
|
const sources = positiveSources(ast.root).map((value) => sourceOf("in:", value, providers));
|
|
61
61
|
for (const leaf of leaves.filter(({ field }) => field === "in"))
|
|
62
62
|
sourceOf("in:", leaf.value, providers);
|
|
63
|
-
const listed = await listedAccounts(store, account, request.source, messenger.app, request.kind);
|
|
63
|
+
const listed = await listedAccounts(store, account, request.source, messenger.app, request.kind, messenger.env);
|
|
64
64
|
const source = request.source === undefined || listed ? undefined : sourceOf("--source", request.source, providers);
|
|
65
65
|
if (request.accounts !== undefined && (request.source !== undefined || sources.length > 0))
|
|
66
66
|
throw new CliError("validation_error", "this search reads the accounts it was given — not with in: or --source");
|
|
@@ -15,7 +15,7 @@ export interface DownloadedModel<M> {
|
|
|
15
15
|
* The text embedding model into the shared models folder, checked against the sha256 this version expects and
|
|
16
16
|
* loaded once on a word. Nothing is downloaded when it is already there; it is still loaded.
|
|
17
17
|
*/
|
|
18
|
-
export declare const downloadTextModel: (id: string, { env, progress, bytes
|
|
18
|
+
export declare const downloadTextModel: (id: string, { env, progress, bytes }: ModelDownloadOptions & {
|
|
19
19
|
acceptTerms?: boolean;
|
|
20
20
|
}) => Promise<DownloadedModel<TextModel>>;
|
|
21
21
|
/** A reranker, the same way as {@link downloadTextModel}, into the same folder. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { CliError } from "@wirecat/cli-base";
|
|
2
4
|
import { isTextModelInstalled, placedText, textModelsDirectory } from "../embeddings/embed.js";
|
|
3
5
|
import { rerankModel, textModel } from "../embeddings/models.js";
|
|
@@ -21,16 +23,16 @@ const nativeRuntime = async ({ env, progress = () => { } }) => {
|
|
|
21
23
|
* The text embedding model into the shared models folder, checked against the sha256 this version expects and
|
|
22
24
|
* loaded once on a word. Nothing is downloaded when it is already there; it is still loaded.
|
|
23
25
|
*/
|
|
24
|
-
export const downloadTextModel = async (id, { env, progress = () => { }, bytes
|
|
26
|
+
export const downloadTextModel = async (id, { env, progress = () => { }, bytes }) => {
|
|
25
27
|
const model = textModel(id, env);
|
|
26
|
-
if (model.terms && !acceptTerms) {
|
|
27
|
-
throw new CliError("validation_error", `${model.id} comes under the ${model.licence} (${model.terms}): read them, then run this again with --accept-terms`);
|
|
28
|
-
}
|
|
29
28
|
const directory = textModelsDirectory(env);
|
|
30
29
|
if (!isTextModelInstalled(model, directory)) {
|
|
31
30
|
progress(`${model.id}: ${megabytes(bytesOf(model))} from Hugging Face`);
|
|
32
31
|
await installFiles(placedText(model, directory), { progress, ...(bytes ? { bytes } : {}) });
|
|
33
32
|
}
|
|
33
|
+
// The licence asks for a notice with each copy, not for a click: it is kept beside the files.
|
|
34
|
+
if (model.notice)
|
|
35
|
+
writeFileSync(join(directory, model.id, "NOTICE"), `${model.notice}\n`);
|
|
34
36
|
await nativeRuntime({ env, progress });
|
|
35
37
|
progress(`${model.id}: loading it once to check it works`);
|
|
36
38
|
const { openEmbedder } = await import("../embeddings/embed.js");
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { FinancePayment, Invoice, Order } from "../store/index.js";
|
|
2
|
+
import { type Section } from "./business-context.js";
|
|
3
|
+
/** How a row reached the context: through the project, or as the organization's own invoice or payment. */
|
|
4
|
+
export type LinkedBy = "project" | "counterparty";
|
|
5
|
+
export interface InvoiceLine {
|
|
6
|
+
ref: string;
|
|
7
|
+
title: string;
|
|
8
|
+
direction: Invoice["direction"];
|
|
9
|
+
/** As stored: an invoice is paid only by confirmed payments allocated to it. */
|
|
10
|
+
status: Invoice["status"];
|
|
11
|
+
/** Only confirmed rows are totalled; a proposed one is listed and waits for the owner. */
|
|
12
|
+
review: Invoice["review"];
|
|
13
|
+
currency: string;
|
|
14
|
+
total: string;
|
|
15
|
+
open: string;
|
|
16
|
+
dueDate: string | null;
|
|
17
|
+
linkedBy: LinkedBy[];
|
|
18
|
+
}
|
|
19
|
+
export interface PaymentLine {
|
|
20
|
+
ref: string;
|
|
21
|
+
title: string;
|
|
22
|
+
direction: FinancePayment["direction"];
|
|
23
|
+
review: FinancePayment["review"];
|
|
24
|
+
currency: string;
|
|
25
|
+
amount: string;
|
|
26
|
+
date: string;
|
|
27
|
+
linkedBy: LinkedBy[];
|
|
28
|
+
}
|
|
29
|
+
export interface OrderLine {
|
|
30
|
+
ref: string;
|
|
31
|
+
title: string;
|
|
32
|
+
status: Order["status"];
|
|
33
|
+
review: Order["review"];
|
|
34
|
+
currency: string | null;
|
|
35
|
+
total: string | null;
|
|
36
|
+
/** The organization is the order's customer or its supplier. */
|
|
37
|
+
side: "customer" | "supplier";
|
|
38
|
+
}
|
|
39
|
+
/** Confirmed rows summed per status (or direction) and currency: nothing is converted. */
|
|
40
|
+
export interface FinanceTotal {
|
|
41
|
+
status: string;
|
|
42
|
+
currency: string;
|
|
43
|
+
rows: number;
|
|
44
|
+
total: string;
|
|
45
|
+
/** Of invoices: still owed. */
|
|
46
|
+
open?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface MoneySection {
|
|
49
|
+
invoices: Section<InvoiceLine>;
|
|
50
|
+
payments: Section<PaymentLine>;
|
|
51
|
+
orders?: Section<OrderLine>;
|
|
52
|
+
totals: {
|
|
53
|
+
invoices: FinanceTotal[];
|
|
54
|
+
payments: FinanceTotal[];
|
|
55
|
+
};
|
|
56
|
+
/** Invoices and payments still proposed, of every row read: listed, never totalled. */
|
|
57
|
+
unconfirmed: number;
|
|
58
|
+
/** `false` when a read stopped at the store's page: the totals may leave rows out. */
|
|
59
|
+
complete: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Invoices and payments as the finance store holds them, totalled per status and currency. A payment is never
|
|
63
|
+
* inferred from an invoice, nor an invoice's state from a deal's stage: only what the store records.
|
|
64
|
+
*/
|
|
65
|
+
export declare const moneyOf: (rows: {
|
|
66
|
+
invoices: [Invoice, LinkedBy][];
|
|
67
|
+
payments: [FinancePayment, LinkedBy][];
|
|
68
|
+
orders?: OrderLine[];
|
|
69
|
+
}, limit: number, next: {
|
|
70
|
+
invoices: string | null;
|
|
71
|
+
payments: string | null;
|
|
72
|
+
orders?: string | null;
|
|
73
|
+
}, complete: boolean) => MoneySection;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { formatDecimal, minorUnits, scaleOf } from "../domain/money.js";
|
|
2
|
+
import { sectionOf } from "./business-context.js";
|
|
3
|
+
const invoiceLine = (invoice, linkedBy) => ({
|
|
4
|
+
ref: invoice.ref,
|
|
5
|
+
title: invoice.title,
|
|
6
|
+
direction: invoice.direction,
|
|
7
|
+
status: invoice.status,
|
|
8
|
+
review: invoice.review,
|
|
9
|
+
currency: invoice.currency,
|
|
10
|
+
total: invoice.total,
|
|
11
|
+
open: invoice.open,
|
|
12
|
+
dueDate: invoice.dueDate,
|
|
13
|
+
linkedBy: [linkedBy],
|
|
14
|
+
});
|
|
15
|
+
const paymentLine = (payment, linkedBy) => ({
|
|
16
|
+
ref: payment.ref,
|
|
17
|
+
title: payment.title,
|
|
18
|
+
direction: payment.direction,
|
|
19
|
+
review: payment.review,
|
|
20
|
+
currency: payment.currency,
|
|
21
|
+
amount: payment.amount,
|
|
22
|
+
date: payment.date,
|
|
23
|
+
linkedBy: [linkedBy],
|
|
24
|
+
});
|
|
25
|
+
/** Each row once, with every way it was reached. */
|
|
26
|
+
const merged = (rows) => {
|
|
27
|
+
const byRef = new Map();
|
|
28
|
+
for (const row of rows) {
|
|
29
|
+
const held = byRef.get(row.ref);
|
|
30
|
+
if (!held)
|
|
31
|
+
byRef.set(row.ref, { ...row, linkedBy: [...row.linkedBy] });
|
|
32
|
+
else
|
|
33
|
+
for (const way of row.linkedBy)
|
|
34
|
+
if (!held.linkedBy.includes(way))
|
|
35
|
+
held.linkedBy.push(way);
|
|
36
|
+
}
|
|
37
|
+
return [...byRef.values()];
|
|
38
|
+
};
|
|
39
|
+
const totalled = (rows) => {
|
|
40
|
+
const totals = new Map();
|
|
41
|
+
for (const row of rows) {
|
|
42
|
+
if (!row.confirmed)
|
|
43
|
+
continue;
|
|
44
|
+
const key = `${row.status}|${row.currency}`;
|
|
45
|
+
const held = totals.get(key) ?? { status: row.status, currency: row.currency, rows: 0, units: 0 };
|
|
46
|
+
held.rows += 1;
|
|
47
|
+
held.units += minorUnits(row.amount, row.currency);
|
|
48
|
+
if (row.open !== undefined)
|
|
49
|
+
held.open = (held.open ?? 0) + minorUnits(row.open, row.currency);
|
|
50
|
+
totals.set(key, held);
|
|
51
|
+
}
|
|
52
|
+
return [...totals.values()].map(({ units, open, ...total }) => ({
|
|
53
|
+
...total,
|
|
54
|
+
total: formatDecimal(units, scaleOf(total.currency)),
|
|
55
|
+
...(open === undefined ? {} : { open: formatDecimal(open, scaleOf(total.currency)) }),
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Invoices and payments as the finance store holds them, totalled per status and currency. A payment is never
|
|
60
|
+
* inferred from an invoice, nor an invoice's state from a deal's stage: only what the store records.
|
|
61
|
+
*/
|
|
62
|
+
export const moneyOf = (rows, limit, next, complete) => {
|
|
63
|
+
const invoices = merged(rows.invoices.map(([invoice, way]) => invoiceLine(invoice, way)));
|
|
64
|
+
const payments = merged(rows.payments.map(([payment, way]) => paymentLine(payment, way)));
|
|
65
|
+
const more = { more: !complete };
|
|
66
|
+
return {
|
|
67
|
+
invoices: sectionOf(invoices, limit, next.invoices, more),
|
|
68
|
+
payments: sectionOf(payments, limit, next.payments, more),
|
|
69
|
+
...(rows.orders === undefined ? {} : { orders: sectionOf(rows.orders, limit, next.orders ?? null, more) }),
|
|
70
|
+
totals: {
|
|
71
|
+
invoices: totalled(invoices.map((one) => ({ ...one, amount: one.total, confirmed: one.review === "confirmed" }))),
|
|
72
|
+
payments: totalled(payments.map((one) => ({ ...one, status: one.direction, confirmed: one.review === "confirmed" }))),
|
|
73
|
+
},
|
|
74
|
+
unconfirmed: [...invoices, ...payments].filter((one) => one.review !== "confirmed").length,
|
|
75
|
+
complete,
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -61,11 +61,13 @@ export interface NotesEmbedded {
|
|
|
61
61
|
/** Chunks still without a vector, when `maxChunks` stopped the run, or records still to enrich. */
|
|
62
62
|
left: boolean;
|
|
63
63
|
/** What the owner's enrichment did first; absent when it is off. */
|
|
64
|
+
/** The run, or `failed` with no counts when enrichment threw before it could count. */
|
|
64
65
|
enrichment?: Exclude<EnrichRun, {
|
|
65
66
|
status: "off";
|
|
66
67
|
}> | {
|
|
67
68
|
status: "failed";
|
|
68
69
|
reason: string;
|
|
70
|
+
reason_id: "enrichment.error";
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
export declare const localModel: (choice: string | undefined, env: NodeJS.ProcessEnv | undefined, command: string | undefined) => {
|
|
@@ -217,8 +219,9 @@ export interface NotesFoundOf extends NotesFound {
|
|
|
217
219
|
* `search notes` with `--source`: the notes accounts the list names — `notes:internal`, `notes:<folder id>`, `notes`
|
|
218
220
|
* — and every entry naming none of them in `skipped`. Without a list, every notes account `type` leaves in.
|
|
219
221
|
*/
|
|
220
|
-
export declare const searchNotesOf: (store: MessageStore, account: AccountKey, text: string, { accounts: list, app, ...query }: Omit<NotesQuery, "folderIds" | "withInternal"> & {
|
|
222
|
+
export declare const searchNotesOf: (store: MessageStore, account: AccountKey, text: string, { accounts: list, app, env, ...query }: Omit<NotesQuery, "folderIds" | "withInternal"> & {
|
|
221
223
|
accounts?: string;
|
|
222
224
|
app?: AppIdentity;
|
|
225
|
+
env?: NodeJS.ProcessEnv;
|
|
223
226
|
}) => Promise<NotesFoundOf>;
|
|
224
227
|
export {};
|
|
@@ -5,7 +5,8 @@ import { normalizeTag } from "../domain/tags.js";
|
|
|
5
5
|
import { defaultThreads, isTextModelInstalled, openEmbedder, textModelsDirectory, } from "../embeddings/embed.js";
|
|
6
6
|
import { chosenTextModel, meaningFloor, textModel, vectorModelKey } from "../embeddings/models.js";
|
|
7
7
|
import { DEFAULT_IMAGE_MODEL, imageModel } from "../images/picture/models.js";
|
|
8
|
-
import { entriesOfList, fitting } from "../search/account-list.js";
|
|
8
|
+
import { entriesOfList, fitting, sourceOf } from "../search/account-list.js";
|
|
9
|
+
import { OWNER_NOTES } from "../search/groups.js";
|
|
9
10
|
import { fieldsOfQuery as fieldsOf, meaningWords } from "../search/lucene/meaning-parts.js";
|
|
10
11
|
import { plainQuery } from "../search/lucene/plain.js";
|
|
11
12
|
import { validateFields } from "../search/lucene/registry.js";
|
|
@@ -17,9 +18,10 @@ import { TOTAL_CAP, totalOf } from "../search/total.js";
|
|
|
17
18
|
import { openPictureEmbedderFor } from "./document-pictures.js";
|
|
18
19
|
import { documentSource } from "./document-source.js";
|
|
19
20
|
import { enrichRecords } from "./enrichment.js";
|
|
21
|
+
import { meaningModel } from "./meaning-model.js";
|
|
20
22
|
import { plainQueryWords, titleQuery, titleTiers } from "./notes-title-tier.js";
|
|
21
23
|
import { PICTURE_FLOOR, plainWords } from "./pictures.js";
|
|
22
|
-
import { listContextOf } from "./search-kind.js";
|
|
24
|
+
import { groupLockOf, listContextOf } from "./search-kind.js";
|
|
23
25
|
/**
|
|
24
26
|
* Text in the query language messages use, parsed for a store search: `date:` read in `timezone`, and the store's
|
|
25
27
|
* stemmer when a word is stemmed.
|
|
@@ -139,7 +141,11 @@ const enrichedFirst = async (store, types, options, embed) => {
|
|
|
139
141
|
enrichment = run;
|
|
140
142
|
}
|
|
141
143
|
catch (error) {
|
|
142
|
-
enrichment = {
|
|
144
|
+
enrichment = {
|
|
145
|
+
status: "failed",
|
|
146
|
+
reason: error instanceof Error ? error.message : "enrichment failed",
|
|
147
|
+
reason_id: "enrichment.error",
|
|
148
|
+
};
|
|
143
149
|
}
|
|
144
150
|
let embedded;
|
|
145
151
|
try {
|
|
@@ -175,7 +181,7 @@ export const nearestNotes = async (store, query, options) => {
|
|
|
175
181
|
const queryVector = async (store, query, { model: choice, folderIds, withInternal, source, env, threads, command, embedders }) => {
|
|
176
182
|
if (!query.trim())
|
|
177
183
|
throw new CliError("validation_error", "say what to find in the notes");
|
|
178
|
-
const { model, directory, key } = localModel(choice, env, command);
|
|
184
|
+
const { model, directory, key } = localModel(choice ?? (await meaningModel(store, env)), env, command);
|
|
179
185
|
const scope = {
|
|
180
186
|
...(folderIds ? { folderIds } : {}),
|
|
181
187
|
...(withInternal ? { withInternal: true } : {}),
|
|
@@ -556,7 +562,7 @@ export const notesScopeOf = (accounts) => {
|
|
|
556
562
|
* `search notes` with `--source`: the notes accounts the list names — `notes:internal`, `notes:<folder id>`, `notes`
|
|
557
563
|
* — and every entry naming none of them in `skipped`. Without a list, every notes account `type` leaves in.
|
|
558
564
|
*/
|
|
559
|
-
export const searchNotesOf = async (store, account, text, { accounts: list, app, ...query }) => {
|
|
565
|
+
export const searchNotesOf = async (store, account, text, { accounts: list, app, env, ...query }) => {
|
|
560
566
|
text = plainQuery(text);
|
|
561
567
|
const own = app?.command ?? query.command;
|
|
562
568
|
const what = `${own === undefined ? "" : `${own} `}search notes`;
|
|
@@ -566,9 +572,15 @@ export const searchNotesOf = async (store, account, text, { accounts: list, app,
|
|
|
566
572
|
...(await store.notes.documentsAccounts()).map(({ id }) => ({ provider: "notes", account: id })),
|
|
567
573
|
...[await store.notes.addedAccount()].flatMap((added) => (added ? [{ provider: "notes", account: added.id }] : [])),
|
|
568
574
|
];
|
|
569
|
-
const
|
|
575
|
+
const lock = groupLockOf(app, env);
|
|
576
|
+
const typedScope = list ?? (lock === undefined ? undefined : `group:${lock}`);
|
|
577
|
+
// memo's own notes are the owner's, so a group reads them beside its folders (WC-ACCT-13).
|
|
578
|
+
const notesScope = typedScope !== undefined && /(^|,)\s*group:/i.test(typedScope)
|
|
579
|
+
? `${typedScope},${sourceOf(OWNER_NOTES)}`
|
|
580
|
+
: typedScope;
|
|
581
|
+
const named = notesScope === undefined
|
|
570
582
|
? { accounts: held, skipped: [] }
|
|
571
|
-
: fitting(entriesOfList(
|
|
583
|
+
: fitting(entriesOfList(notesScope, await listContextOf(store, account, app, undefined, env)), ["notes", "documents"], what);
|
|
572
584
|
const source = query.source ?? noteSourceOfQuery(text).source;
|
|
573
585
|
const typed = named.accounts.filter(({ account }) => source === undefined || (account === INTERNAL_NOTES) === (source === "internal"));
|
|
574
586
|
if (!typed.length && list !== undefined)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type DealKind } from "../domain/deals.js";
|
|
2
|
+
import type { AccountKey, Deal, MessageStore, Organization } from "../store/index.js";
|
|
3
|
+
import { type Category, type Coverage, type Related, type Section } from "./business-context.js";
|
|
4
|
+
import { type Communications } from "./communications.js";
|
|
5
|
+
import { type MoneySection } from "./money-context.js";
|
|
6
|
+
export interface DealLine {
|
|
7
|
+
ref: string;
|
|
8
|
+
kind: Deal["kind"];
|
|
9
|
+
title: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
stage: string;
|
|
12
|
+
status: Deal["status"];
|
|
13
|
+
currency: string | null;
|
|
14
|
+
amount: string | null;
|
|
15
|
+
closeDate: string | null;
|
|
16
|
+
project: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectLine {
|
|
19
|
+
ref: string;
|
|
20
|
+
name: string;
|
|
21
|
+
/** It names the organization, or one of its deals does. */
|
|
22
|
+
via: ("organization" | "deal")[];
|
|
23
|
+
}
|
|
24
|
+
export interface TaskLine {
|
|
25
|
+
ref: string;
|
|
26
|
+
key: string;
|
|
27
|
+
title: string;
|
|
28
|
+
status: string;
|
|
29
|
+
project: string;
|
|
30
|
+
dueAt: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface OrganizationContext {
|
|
33
|
+
organization: Organization & {
|
|
34
|
+
own: boolean;
|
|
35
|
+
};
|
|
36
|
+
categories: Category[];
|
|
37
|
+
/** Its members, each once with every role and the standing of each; the current ones first. */
|
|
38
|
+
people: Section<Related>;
|
|
39
|
+
/** Who is its customer. */
|
|
40
|
+
customers: Section<Related>;
|
|
41
|
+
/** Whom it is a customer of: "supplier of", read backwards. */
|
|
42
|
+
suppliers: Section<Related>;
|
|
43
|
+
partners: Section<Related>;
|
|
44
|
+
projects: Section<ProjectLine>;
|
|
45
|
+
/** Open deals and leads it is the client of. */
|
|
46
|
+
deals: Section<DealLine>;
|
|
47
|
+
money: MoneySection;
|
|
48
|
+
/** Counts only, through its own people other than the owner, in the accounts read. */
|
|
49
|
+
communications: Communications["counts"] & {
|
|
50
|
+
hasMore: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Open tasks of its projects. */
|
|
53
|
+
tasks: Section<TaskLine>;
|
|
54
|
+
coverage: Coverage;
|
|
55
|
+
}
|
|
56
|
+
export interface OrganizationContextOptions {
|
|
57
|
+
/** The accounts read: a CRM's relationships and deals, and its people's messages, mail and events. */
|
|
58
|
+
accounts?: AccountKey[];
|
|
59
|
+
/** Items per section. */
|
|
60
|
+
limit?: number;
|
|
61
|
+
/** The kinds the profile denies: none of their rows, titles or counts is answered. */
|
|
62
|
+
deniedKinds?: readonly DealKind[];
|
|
63
|
+
}
|
|
64
|
+
export declare const dealLine: (deal: Deal) => DealLine;
|
|
65
|
+
/** Open tasks of these projects, the soonest due first, and the command that lists them when it is one project's. */
|
|
66
|
+
export declare const openTasksOf: (store: MessageStore, projects: {
|
|
67
|
+
ref: string;
|
|
68
|
+
key: string;
|
|
69
|
+
}[]) => Promise<{
|
|
70
|
+
tasks: TaskLine[];
|
|
71
|
+
full: boolean;
|
|
72
|
+
next: string | null;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* One answer about an organization from the store: its people, its customers, suppliers and partners, projects,
|
|
76
|
+
* open deals, money and how much the owner talks with its people. Every relationship says its standing; a source
|
|
77
|
+
* nobody confirmed is `reported`, one that stopped is `ended`, one waiting for the owner `proposed`. A CRM's rows
|
|
78
|
+
* outside `accounts` are left out, and `coverage` names that CRM.
|
|
79
|
+
*/
|
|
80
|
+
export declare const organizationContext: (store: MessageStore, reference: string, { accounts, limit, deniedKinds }?: OrganizationContextOptions) => Promise<OrganizationContext>;
|