@wirecat/cli-core 0.545.0 → 0.546.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 +76 -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/messages-command.js +2 -19
- 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/stored.js +56 -3
- package/dist/cli/messenger/topics-command.js +1 -1
- 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 +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- 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/index.d.ts +5 -1
- package/dist/services/index.js +5 -1
- package/dist/services/message-resolution.d.ts +4 -1
- package/dist/services/message-resolution.js +19 -3
- package/dist/services/messages.js +15 -13
- package/dist/services/money-words.d.ts +3 -0
- package/dist/services/money-words.js +5 -0
- package/dist/services/questions.d.ts +7 -2
- package/dist/services/questions.js +13 -4
- 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/store/sqlite/evidence-sources.js +2 -2
- package/dist/store/sqlite/identities.js +1 -1
- package/dist/store/sqlite/knowledge.js +7 -2
- package/dist/store/sqlite/notes.js +4 -4
- package/dist/store/sqlite/things.d.ts +0 -1
- package/dist/store/sqlite/things.js +25 -24
- package/package.json +1 -1
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.546.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",
|