@wirecat/cli-core 0.545.0 → 0.547.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 +228 -0
- package/dist/calendar/busy.js +4 -1
- package/dist/calendar/cli/answers.d.ts +31 -0
- package/dist/calendar/cli/answers.js +8 -0
- package/dist/calendar/cli/index.d.ts +6 -0
- package/dist/calendar/cli/index.js +43 -4
- package/dist/calendar/cli/remind.js +2 -1
- package/dist/calendar/expand.d.ts +17 -0
- package/dist/calendar/expand.js +340 -0
- package/dist/calendar/feeds.d.ts +96 -0
- package/dist/calendar/feeds.js +324 -0
- package/dist/calendar/ics.d.ts +15 -4
- package/dist/calendar/ics.js +18 -7
- package/dist/calendar/index.d.ts +3 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/server-search.js +3 -1
- package/dist/calendar/writes.js +15 -4
- package/dist/cli/after-dashes.d.ts +16 -0
- package/dist/cli/after-dashes.js +41 -0
- package/dist/cli/bot/context.d.ts +1 -1
- package/dist/cli/bot/context.js +9 -1
- package/dist/cli/bot/messages.js +2 -0
- package/dist/cli/bot/setup.js +1 -0
- package/dist/cli/contract-templates.js +2 -2
- package/dist/cli/entry.d.ts +2 -0
- package/dist/cli/entry.js +3 -2
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/messenger/admin-commands.js +5 -1
- package/dist/cli/messenger/admin-contacts-command.js +5 -1
- package/dist/cli/messenger/admin-folders-command.js +5 -1
- package/dist/cli/messenger/complete-command.js +1 -0
- package/dist/cli/messenger/history-query.d.ts +10 -4
- package/dist/cli/messenger/history-query.js +87 -31
- package/dist/cli/messenger/messages-command.js +12 -23
- package/dist/cli/messenger/messages-comments-command.js +4 -2
- package/dist/cli/messenger/messages-edit-command.js +1 -0
- package/dist/cli/messenger/messages-press-command.js +1 -0
- package/dist/cli/messenger/messages-send-command.js +1 -0
- package/dist/cli/messenger/observed.js +2 -2
- package/dist/cli/messenger/polls-command.js +1 -0
- package/dist/cli/messenger/private-people-command.js +5 -1
- package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
- package/dist/cli/messenger/stored.js +56 -3
- package/dist/cli/messenger/topics-command.js +1 -1
- package/dist/cli/option-hints.d.ts +6 -0
- package/dist/cli/option-hints.js +15 -0
- package/dist/cli/program.js +17 -6
- package/dist/cli/schedule/schedule-command.js +1 -0
- package/dist/domain/message-link.d.ts +3 -0
- package/dist/domain/message-link.js +9 -14
- package/dist/domain/money-words.d.ts +11 -0
- package/dist/domain/money-words.js +38 -0
- package/dist/domain/providers.d.ts +2 -0
- package/dist/domain/providers.js +15 -3
- package/dist/domain/ref-arguments.d.ts +31 -0
- package/dist/domain/ref-arguments.js +79 -0
- package/dist/domain/references.d.ts +20 -2
- package/dist/domain/references.js +132 -47
- package/dist/errors/reasons.js +31 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mail/cli/index.js +4 -4
- package/dist/mail/index.d.ts +2 -0
- package/dist/mail/index.js +2 -0
- package/dist/mail/partial.d.ts +34 -0
- package/dist/mail/partial.js +94 -0
- package/dist/mail/server-search.js +17 -9
- package/dist/mail/source.d.ts +13 -2
- package/dist/mail/source.js +7 -1
- package/dist/mail/sync-types.d.ts +112 -0
- package/dist/mail/sync-types.js +1 -0
- package/dist/mail/sync.d.ts +4 -106
- package/dist/mail/sync.js +49 -4
- package/dist/mail/testing/fake.d.ts +3 -1
- package/dist/mail/testing/fake.js +10 -2
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/oauth/client-file.d.ts +14 -0
- package/dist/oauth/client-file.js +28 -0
- package/dist/oauth/index.d.ts +1 -0
- package/dist/oauth/index.js +1 -0
- package/dist/ports/messenger.d.ts +3 -2
- package/dist/resolve.d.ts +3 -1
- package/dist/resolve.js +8 -0
- package/dist/search/task-signature.d.ts +5 -1
- package/dist/search/task-signature.js +27 -9
- package/dist/services/agenda.d.ts +5 -0
- package/dist/services/agenda.js +3 -1
- package/dist/services/deps.d.ts +0 -2
- package/dist/services/deps.js +0 -2
- package/dist/services/documents/ingestion.js +1 -1
- package/dist/services/documents/knowledge.d.ts +10 -6
- package/dist/services/documents/knowledge.js +25 -11
- package/dist/services/index.d.ts +6 -1
- package/dist/services/index.js +6 -1
- package/dist/services/message-resolution.d.ts +4 -1
- package/dist/services/message-resolution.js +19 -3
- package/dist/services/messages.d.ts +2 -0
- package/dist/services/messages.js +40 -36
- package/dist/services/money-words.d.ts +3 -0
- package/dist/services/money-words.js +5 -0
- package/dist/services/proposal-tasks.d.ts +3 -2
- package/dist/services/proposal-tasks.js +5 -2
- package/dist/services/proposals/ids.d.ts +5 -0
- package/dist/services/proposals/ids.js +43 -0
- package/dist/services/proposals/index.d.ts +3 -0
- package/dist/services/proposals/index.js +2 -0
- package/dist/services/proposals/kinds/action.d.ts +7 -0
- package/dist/services/proposals/kinds/action.js +45 -0
- package/dist/services/proposals/kinds/fact.d.ts +4 -0
- package/dist/services/proposals/kinds/fact.js +43 -0
- package/dist/services/proposals/kinds/findings.d.ts +7 -0
- package/dist/services/proposals/kinds/findings.js +75 -0
- package/dist/services/proposals/kinds/key-document.d.ts +9 -0
- package/dist/services/proposals/kinds/key-document.js +75 -0
- package/dist/services/proposals/kinds/memory.d.ts +4 -0
- package/dist/services/proposals/kinds/memory.js +42 -0
- package/dist/services/proposals/kinds/relationship.d.ts +10 -0
- package/dist/services/proposals/kinds/relationship.js +82 -0
- package/dist/services/proposals/kinds/shared.d.ts +25 -0
- package/dist/services/proposals/kinds/shared.js +49 -0
- package/dist/services/proposals/registry.d.ts +9 -0
- package/dist/services/proposals/registry.js +129 -0
- package/dist/services/proposals/types.d.ts +85 -0
- package/dist/services/proposals/types.js +1 -0
- package/dist/services/questions.d.ts +7 -2
- package/dist/services/questions.js +13 -4
- package/dist/services/server-search.d.ts +7 -4
- package/dist/services/server-search.js +5 -2
- package/dist/services/stored-project-gathering.d.ts +9 -0
- package/dist/services/stored-project-gathering.js +9 -4
- package/dist/services/task-categories.d.ts +2 -0
- package/dist/services/task-categories.js +19 -8
- package/dist/services/tasks.js +8 -4
- package/dist/store/decisions.d.ts +65 -0
- package/dist/store/decisions.js +55 -0
- package/dist/store/evidence-findings.d.ts +6 -6
- package/dist/store/index.d.ts +4 -3
- package/dist/store/index.js +2 -1
- package/dist/store/meeting-findings.d.ts +2 -0
- package/dist/store/messages.d.ts +4 -9
- package/dist/store/sqlite/actors.d.ts +13 -2
- package/dist/store/sqlite/actors.js +24 -1
- package/dist/store/sqlite/email-locations.d.ts +16 -0
- package/dist/store/sqlite/email-locations.js +26 -0
- package/dist/store/sqlite/emails.d.ts +6 -2
- package/dist/store/sqlite/emails.js +2 -1
- package/dist/store/sqlite/evidence-findings.js +13 -3
- package/dist/store/sqlite/evidence-sources.js +2 -2
- package/dist/store/sqlite/facts.d.ts +16 -8
- package/dist/store/sqlite/facts.js +48 -15
- package/dist/store/sqlite/findings-core.d.ts +2 -1
- package/dist/store/sqlite/findings-core.js +4 -4
- package/dist/store/sqlite/identities.js +1 -1
- package/dist/store/sqlite/knowledge.d.ts +43 -7
- package/dist/store/sqlite/knowledge.js +62 -17
- package/dist/store/sqlite/meeting-findings.js +6 -6
- package/dist/store/sqlite/memories.d.ts +12 -8
- package/dist/store/sqlite/memories.js +33 -10
- package/dist/store/sqlite/notes.d.ts +5 -1
- package/dist/store/sqlite/notes.js +22 -6
- package/dist/store/sqlite/open-store.d.ts +4 -1
- package/dist/store/sqlite/open-store.js +8 -2
- package/dist/store/sqlite/open.d.ts +3 -0
- package/dist/store/sqlite/proposed-actions.d.ts +21 -8
- package/dist/store/sqlite/proposed-actions.js +29 -9
- package/dist/store/sqlite/reads.d.ts +13 -2
- package/dist/store/sqlite/reads.js +8 -4
- package/dist/store/sqlite/relation-proposals.d.ts +34 -0
- package/dist/store/sqlite/relation-proposals.js +114 -0
- package/dist/store/sqlite/things.d.ts +0 -1
- package/dist/store/sqlite/things.js +25 -24
- package/dist/store/store.d.ts +3 -0
- package/dist/store/store.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { assertMayDecide, deciderAuthor } from "../decisions.js";
|
|
3
|
+
import { actorOfOrigin, botNamed, ownerPerson } from "./actors.js";
|
|
4
|
+
import { insertLink, linkOf } from "./notes.js";
|
|
5
|
+
import { proposalOperationsOver, proposerOfAction } from "./proposed-actions.js";
|
|
6
|
+
import { thingOf } from "./things.js";
|
|
7
|
+
import { write } from "./transaction.js";
|
|
8
|
+
/** `relationship` proposals in `proposed_actions`: an agent's or a rule's, and the rejected ones a scan skips. */
|
|
9
|
+
export const relationProposalsOver = (context) => {
|
|
10
|
+
const { database, now } = context;
|
|
11
|
+
const operations = proposalOperationsOver(context);
|
|
12
|
+
/** The rejected `relationship` proposal a removed link leaves behind, so a scan never proposes it again. */
|
|
13
|
+
const rejected = (link, by, reason) => {
|
|
14
|
+
const at = now();
|
|
15
|
+
const proposed = link.confirmed ? ownerPerson(database) : actorOfOrigin(database, "agent");
|
|
16
|
+
const decided = by === "owner" ? ownerPerson(database) : botNamed(database, by.bot, at);
|
|
17
|
+
const why = [
|
|
18
|
+
`${link.confirmed ? "removed" : "rejected"} by ${by === "owner" ? "the owner" : `agent:${by.bot}`}`,
|
|
19
|
+
by === "owner" ? undefined : by.reason.trim(),
|
|
20
|
+
reason?.trim() || undefined,
|
|
21
|
+
].filter(Boolean);
|
|
22
|
+
const from = thingOf(database, link.from);
|
|
23
|
+
database
|
|
24
|
+
.prepare("INSERT INTO proposed_actions (kind, target_type, target_id, payload, reason, status, proposed_by_type, " +
|
|
25
|
+
"proposed_by_id, decided_by_type, decided_by_id, decided_at, result, created_at, updated_at) " +
|
|
26
|
+
"VALUES ('relationship', ?, ?, ?, ?, 'rejected', ?, ?, ?, ?, ?, ?, ?, ?)")
|
|
27
|
+
.run(from?.type ?? null, from?.id ?? null, JSON.stringify({ from: link.from, to: link.to, kind: link.kind, ...(link.role ? { role: link.role } : {}) }), link.evidence, proposed.type, proposed.id, decided.type, decided.id, at, JSON.stringify({ reason: why.join(": "), link: link.id }), at, at);
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
/** The same pending pair returns the proposal already held. */
|
|
31
|
+
propose: (from, input, by) => {
|
|
32
|
+
const evidence = input.evidence ?? [];
|
|
33
|
+
if (!Array.isArray(evidence) || evidence.length > 5 || evidence.some((ref) => typeof ref !== "string"))
|
|
34
|
+
throw new CliError("validation_error", "a relationship proposal cites up to 5 references");
|
|
35
|
+
return write(database, () => {
|
|
36
|
+
const held = database
|
|
37
|
+
.prepare("SELECT id FROM proposed_actions WHERE kind='relationship' AND status='proposed' AND target_type=? AND target_id=? " +
|
|
38
|
+
"AND json_extract(payload,'$.to')=? AND json_extract(payload,'$.kind')=? ORDER BY id LIMIT 1")
|
|
39
|
+
.get(from.type, from.id, input.to, input.kind);
|
|
40
|
+
if (held)
|
|
41
|
+
return operations.get(String(held.id));
|
|
42
|
+
return operations.propose({
|
|
43
|
+
kind: "relationship",
|
|
44
|
+
by,
|
|
45
|
+
target: input.from,
|
|
46
|
+
payload: {
|
|
47
|
+
from: input.from,
|
|
48
|
+
to: input.to,
|
|
49
|
+
kind: input.kind,
|
|
50
|
+
...(input.role === undefined ? {} : { role: input.role }),
|
|
51
|
+
evidence,
|
|
52
|
+
},
|
|
53
|
+
...(input.reason === undefined ? {} : { reason: input.reason }),
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
rejected: (link, by, reason) => rejected(link, by, reason),
|
|
58
|
+
/**
|
|
59
|
+
* Decides a stored `relationship` or `key_document` proposal in one transaction: the confirmed link and the
|
|
60
|
+
* decision land together or not at all.
|
|
61
|
+
*/
|
|
62
|
+
decideProposal: (id, decision) => write(database, () => {
|
|
63
|
+
const proposal = operations.get(id);
|
|
64
|
+
if (proposal.kind !== "relationship" && proposal.kind !== "key_document")
|
|
65
|
+
throw new CliError("validation_error", `${id} is a ${proposal.kind} proposal, not a link`);
|
|
66
|
+
assertMayDecide({ id, proposedBy: proposerOfAction(proposal) }, decision.by, context.decisions);
|
|
67
|
+
const author = deciderAuthor(decision.by);
|
|
68
|
+
const reason = decision.reason?.trim() || undefined;
|
|
69
|
+
if (!decision.confirm)
|
|
70
|
+
return { proposal: operations.reject(id, author, reason === undefined ? undefined : { reason }), link: null };
|
|
71
|
+
const payload = proposal.payload;
|
|
72
|
+
const key = proposal.kind === "key_document";
|
|
73
|
+
const link = insertLink(context, {
|
|
74
|
+
from: String(key ? payload.ref : payload.from),
|
|
75
|
+
to: String(key ? payload.project : payload.to),
|
|
76
|
+
kind: key ? "related-to" : (payload.kind ?? "member-of"),
|
|
77
|
+
...(key ? { role: "key" } : payload.role === undefined ? {} : { role: payload.role }),
|
|
78
|
+
...(proposal.reason === null ? {} : { evidence: proposal.reason }),
|
|
79
|
+
...decidedOrigin(decision.by),
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
proposal: operations.approve(id, { link: link.id, ...(reason === undefined ? {} : { reason }) }, author),
|
|
83
|
+
link,
|
|
84
|
+
};
|
|
85
|
+
}),
|
|
86
|
+
/** Decides an unconfirmed link written before proposals were stored; only the owner may, as its author is unknown. */
|
|
87
|
+
decideLink: (id, decision) => write(database, () => {
|
|
88
|
+
const row = /^\d+$/.test(id)
|
|
89
|
+
? database.prepare("SELECT * FROM links WHERE id = ? AND confirmed = 0").get(Number(id))
|
|
90
|
+
: undefined;
|
|
91
|
+
if (!row)
|
|
92
|
+
throw new CliError("not_found", `no suggested link ${id}`);
|
|
93
|
+
assertMayDecide({ id: `link:${id}`, proposedBy: { type: "unknown" } }, decision.by, context.decisions);
|
|
94
|
+
const link = linkOf(database, row);
|
|
95
|
+
if (!decision.confirm) {
|
|
96
|
+
rejected(link, decision.by, decision.reason);
|
|
97
|
+
database.prepare("DELETE FROM links WHERE id = ?").run(Number(id));
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
database
|
|
101
|
+
.prepare("UPDATE links SET confirmed=1, source='owner', author='owner', updated_at=? WHERE id=?")
|
|
102
|
+
.run(now(), Number(id));
|
|
103
|
+
return linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(Number(id)));
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
/** A link an agent confirmed for the owner says so in its provenance. */
|
|
108
|
+
const decidedOrigin = (by) => by === "owner"
|
|
109
|
+
? { origin: "owner" }
|
|
110
|
+
: {
|
|
111
|
+
origin: "suggested",
|
|
112
|
+
confirmed: true,
|
|
113
|
+
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`,
|
|
114
|
+
};
|
|
@@ -24,4 +24,3 @@ export declare const stateOfThing: (database: CacheDatabase, thing: Thing | unde
|
|
|
24
24
|
export declare const taskRowOf: (database: CacheDatabase, id: string) => number | undefined;
|
|
25
25
|
/** The package's id for a task row: the reverse of `taskRowOf`. */
|
|
26
26
|
export declare const taskIdOf: (database: CacheDatabase, rowId: number) => string | undefined;
|
|
27
|
-
export declare const canonicalThingReference: (reference: string) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatLocator } from "../../domain/locator.js";
|
|
2
2
|
import { filesAccountSql } from "../../domain/providers.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { formatReference, parseReference } from "../../domain/references.js";
|
|
4
|
+
import { formatMeetingReference } from "../../meetings/index.js";
|
|
5
5
|
import { ENTITY_TABLES, isEntityType } from "./entity-types.js";
|
|
6
6
|
/** A pointer as a row holds it. An unknown type is not refused on read: `store check` reports it. */
|
|
7
7
|
export const storedThing = (type, id) => ({ type: String(type), id: Number(id) });
|
|
@@ -16,6 +16,7 @@ const REFERABLE = {
|
|
|
16
16
|
memory: { tombstone: true },
|
|
17
17
|
fact: { tombstone: true },
|
|
18
18
|
bot: { tombstone: false },
|
|
19
|
+
event: { tombstone: true },
|
|
19
20
|
message: { tombstone: true },
|
|
20
21
|
email: { tombstone: true },
|
|
21
22
|
email_thread: { tombstone: true },
|
|
@@ -30,30 +31,11 @@ const storeId = (text) => (/^[1-9]\d{0,15}$/.test(text) ? Number(text) : undefin
|
|
|
30
31
|
* `messages.db` (a ULID, an `entity:`) is simply not found: it is never guessed at.
|
|
31
32
|
*/
|
|
32
33
|
export const thingOf = (database, reference) => {
|
|
33
|
-
if (typeof reference === "string" && reference.trim().startsWith("meeting:")) {
|
|
34
|
-
const parsed = parseMeetingReference(reference);
|
|
35
|
-
const meeting = database
|
|
36
|
-
.prepare("SELECT id FROM meetings WHERE id=? AND account_id=? AND deleted_at IS NULL")
|
|
37
|
-
.get(parsed.meetingId, parsed.accountId);
|
|
38
|
-
if (!meeting)
|
|
39
|
-
return undefined;
|
|
40
|
-
if (parsed.transcriptId === undefined)
|
|
41
|
-
return { type: "meeting", id: parsed.meetingId };
|
|
42
|
-
const transcript = database
|
|
43
|
-
.prepare("SELECT id FROM meeting_transcripts WHERE id=? AND meeting_id=? AND deleted_at IS NULL")
|
|
44
|
-
.get(parsed.transcriptId, parsed.meetingId);
|
|
45
|
-
if (!transcript)
|
|
46
|
-
return undefined;
|
|
47
|
-
if (parsed.cuePosition === undefined)
|
|
48
|
-
return { type: "meeting_transcript", id: parsed.transcriptId };
|
|
49
|
-
const row = database
|
|
50
|
-
.prepare("SELECT id FROM meeting_transcript_rows WHERE meeting_transcript_id=? AND position=?")
|
|
51
|
-
.get(parsed.transcriptId, parsed.cuePosition);
|
|
52
|
-
return row ? { type: "meeting_transcript_row", id: Number(row.id) } : undefined;
|
|
53
|
-
}
|
|
54
34
|
const parsed = typeof reference === "string" ? parseReference(reference) : reference;
|
|
55
35
|
const found = (type, row) => row ? { type, id: Number(row.id) } : undefined;
|
|
56
36
|
switch (parsed.type) {
|
|
37
|
+
case "meeting":
|
|
38
|
+
return meetingThingOf(database, parsed);
|
|
57
39
|
case "message":
|
|
58
40
|
return ((parsed.provider === "email" ? emailOf(database, parsed.account, parsed.chat, parsed.message) : undefined) ??
|
|
59
41
|
found("message", database
|
|
@@ -90,6 +72,26 @@ export const thingOf = (database, reference) => {
|
|
|
90
72
|
}
|
|
91
73
|
}
|
|
92
74
|
};
|
|
75
|
+
const meetingThingOf = (database, parsed) => {
|
|
76
|
+
const meeting = database
|
|
77
|
+
.prepare("SELECT id FROM meetings WHERE id=? AND account_id=? AND deleted_at IS NULL")
|
|
78
|
+
.get(parsed.meetingId, parsed.accountId);
|
|
79
|
+
if (!meeting)
|
|
80
|
+
return undefined;
|
|
81
|
+
if (parsed.transcriptId === undefined)
|
|
82
|
+
return { type: "meeting", id: parsed.meetingId };
|
|
83
|
+
const transcript = database
|
|
84
|
+
.prepare("SELECT id FROM meeting_transcripts WHERE id=? AND meeting_id=? AND deleted_at IS NULL")
|
|
85
|
+
.get(parsed.transcriptId, parsed.meetingId);
|
|
86
|
+
if (!transcript)
|
|
87
|
+
return undefined;
|
|
88
|
+
if (parsed.cuePosition === undefined)
|
|
89
|
+
return { type: "meeting_transcript", id: parsed.transcriptId };
|
|
90
|
+
const row = database
|
|
91
|
+
.prepare("SELECT id FROM meeting_transcript_rows WHERE meeting_transcript_id=? AND position=?")
|
|
92
|
+
.get(parsed.transcriptId, parsed.cuePosition);
|
|
93
|
+
return row ? { type: "meeting_transcript_row", id: Number(row.id) } : undefined;
|
|
94
|
+
};
|
|
93
95
|
/** Mail that memo saved before it wrote the mail tables is still messages, so the caller falls back to them. */
|
|
94
96
|
export const emailOf = (database, account, thread, email) => {
|
|
95
97
|
const row = database
|
|
@@ -237,4 +239,3 @@ export const taskIdOf = (database, rowId) => {
|
|
|
237
239
|
const row = database.prepare("SELECT key, package_id AS id FROM tasks WHERE id = ?").get(rowId);
|
|
238
240
|
return row ? String(row.id ?? row.key) : undefined;
|
|
239
241
|
};
|
|
240
|
-
export const canonicalThingReference = (reference) => reference.trim().startsWith("meeting:") ? canonicalMeetingReference(reference) : canonicalReference(reference);
|
package/dist/store/store.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type AttachmentsStore } from "./attachments.js";
|
|
|
6
6
|
import { type ChatsStore } from "./chats.js";
|
|
7
7
|
import { type ConversationsStore } from "./conversations.js";
|
|
8
8
|
import { type CountersStore } from "./counters.js";
|
|
9
|
+
import { type DecisionPolicy } from "./decisions.js";
|
|
9
10
|
import type { EvidenceFindingsStore } from "./evidence-findings.js";
|
|
10
11
|
import type { MeetingFindingsStore } from "./meeting-findings.js";
|
|
11
12
|
import { type MentionsStore } from "./mentions.js";
|
|
@@ -95,6 +96,8 @@ export interface MessageStore {
|
|
|
95
96
|
readonly memories: MemoriesStore;
|
|
96
97
|
/** What an agent wants done outside the store, waiting for the owner's approval. */
|
|
97
98
|
readonly proposedActions: ProposedActionsStore;
|
|
99
|
+
/** Who may decide proposals, fixed when the store was opened; the store's decide methods and the registry read it. */
|
|
100
|
+
readonly decisionPolicy: DecisionPolicy;
|
|
98
101
|
/** One row per tool an agent called, never its arguments. */
|
|
99
102
|
readonly agentActions: AgentActionsStore;
|
|
100
103
|
/** Meetings and calendar events: the port `src/meetings/` defines. */
|
package/dist/store/store.js
CHANGED
|
@@ -4,6 +4,7 @@ import { accountAttachmentsOver, attachmentsStoreOver, } from "./attachments.js"
|
|
|
4
4
|
import { chatsStoreOver } from "./chats.js";
|
|
5
5
|
import { conversationsStoreOver } from "./conversations.js";
|
|
6
6
|
import { accountCountersOver, countersStoreOver } from "./counters.js";
|
|
7
|
+
import { DEFAULT_DECISION_POLICY } from "./decisions.js";
|
|
7
8
|
import { accountMentionsOver, mentionsStoreOver } from "./mentions.js";
|
|
8
9
|
import { accountMessagesOver, messagesStoreOver } from "./messages.js";
|
|
9
10
|
import { accountPeopleOver, peopleStoreOver } from "./people.js";
|
|
@@ -207,6 +208,7 @@ const storeOver = (context) => {
|
|
|
207
208
|
get memories() {
|
|
208
209
|
return memories();
|
|
209
210
|
},
|
|
211
|
+
decisionPolicy: context.decisions ?? DEFAULT_DECISION_POLICY,
|
|
210
212
|
get proposedActions() {
|
|
211
213
|
return proposedActions();
|
|
212
214
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.547.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|