@murphai/murph 0.1.1
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 +2009 -0
- package/LICENSE +674 -0
- package/README.md +97 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/assistant/automation/run-loop.d.ts +21 -0
- package/dist/assistant/automation/run-loop.d.ts.map +1 -0
- package/dist/assistant/automation/run-loop.js +31 -0
- package/dist/assistant/automation/run-loop.js.map +1 -0
- package/dist/assistant/automation.d.ts +10 -0
- package/dist/assistant/automation.d.ts.map +1 -0
- package/dist/assistant/automation.js +5 -0
- package/dist/assistant/automation.js.map +1 -0
- package/dist/assistant/cron.d.ts +19 -0
- package/dist/assistant/cron.d.ts.map +1 -0
- package/dist/assistant/cron.js +59 -0
- package/dist/assistant/cron.js.map +1 -0
- package/dist/assistant/doctor-security.d.ts +15 -0
- package/dist/assistant/doctor-security.d.ts.map +1 -0
- package/dist/assistant/doctor-security.js +172 -0
- package/dist/assistant/doctor-security.js.map +1 -0
- package/dist/assistant/doctor.d.ts +5 -0
- package/dist/assistant/doctor.d.ts.map +1 -0
- package/dist/assistant/doctor.js +527 -0
- package/dist/assistant/doctor.js.map +1 -0
- package/dist/assistant/outbox.d.ts +19 -0
- package/dist/assistant/outbox.d.ts.map +1 -0
- package/dist/assistant/outbox.js +28 -0
- package/dist/assistant/outbox.js.map +1 -0
- package/dist/assistant/provider-catalog.d.ts +61 -0
- package/dist/assistant/provider-catalog.d.ts.map +1 -0
- package/dist/assistant/provider-catalog.js +205 -0
- package/dist/assistant/provider-catalog.js.map +1 -0
- package/dist/assistant/service.d.ts +85 -0
- package/dist/assistant/service.d.ts.map +1 -0
- package/dist/assistant/service.js +26 -0
- package/dist/assistant/service.js.map +1 -0
- package/dist/assistant/status.d.ts +9 -0
- package/dist/assistant/status.d.ts.map +1 -0
- package/dist/assistant/status.js +16 -0
- package/dist/assistant/status.js.map +1 -0
- package/dist/assistant/stop.d.ts +20 -0
- package/dist/assistant/stop.d.ts.map +1 -0
- package/dist/assistant/stop.js +142 -0
- package/dist/assistant/stop.js.map +1 -0
- package/dist/assistant/store.d.ts +6 -0
- package/dist/assistant/store.d.ts.map +1 -0
- package/dist/assistant/store.js +21 -0
- package/dist/assistant/store.js.map +1 -0
- package/dist/assistant/ui/ink.d.ts +247 -0
- package/dist/assistant/ui/ink.d.ts.map +1 -0
- package/dist/assistant/ui/ink.js +2417 -0
- package/dist/assistant/ui/ink.js.map +1 -0
- package/dist/assistant/ui/theme.d.ts +64 -0
- package/dist/assistant/ui/theme.d.ts.map +1 -0
- package/dist/assistant/ui/theme.js +180 -0
- package/dist/assistant/ui/theme.js.map +1 -0
- package/dist/assistant/ui/view-model.d.ts +89 -0
- package/dist/assistant/ui/view-model.d.ts.map +1 -0
- package/dist/assistant/ui/view-model.js +298 -0
- package/dist/assistant/ui/view-model.js.map +1 -0
- package/dist/assistant-chat-ink.d.ts +2 -0
- package/dist/assistant-chat-ink.d.ts.map +1 -0
- package/dist/assistant-chat-ink.js +2 -0
- package/dist/assistant-chat-ink.js.map +1 -0
- package/dist/assistant-daemon-client.d.ts +81 -0
- package/dist/assistant-daemon-client.d.ts.map +1 -0
- package/dist/assistant-daemon-client.js +473 -0
- package/dist/assistant-daemon-client.js.map +1 -0
- package/dist/assistant-runtime.d.ts +25 -0
- package/dist/assistant-runtime.d.ts.map +1 -0
- package/dist/assistant-runtime.js +17 -0
- package/dist/assistant-runtime.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli-entry.d.ts +10 -0
- package/dist/cli-entry.d.ts.map +1 -0
- package/dist/cli-entry.js +127 -0
- package/dist/cli-entry.js.map +1 -0
- package/dist/commands/assistant.d.ts +5 -0
- package/dist/commands/assistant.d.ts.map +1 -0
- package/dist/commands/assistant.js +1663 -0
- package/dist/commands/assistant.js.map +1 -0
- package/dist/commands/audit-command-helpers.d.ts +15 -0
- package/dist/commands/audit-command-helpers.d.ts.map +1 -0
- package/dist/commands/audit-command-helpers.js +24 -0
- package/dist/commands/audit-command-helpers.js.map +1 -0
- package/dist/commands/audit.d.ts +4 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +107 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/device.d.ts +4 -0
- package/dist/commands/device.d.ts.map +1 -0
- package/dist/commands/device.js +177 -0
- package/dist/commands/device.js.map +1 -0
- package/dist/commands/document.d.ts +4 -0
- package/dist/commands/document.d.ts.map +1 -0
- package/dist/commands/document.js +117 -0
- package/dist/commands/document.js.map +1 -0
- package/dist/commands/event.d.ts +4 -0
- package/dist/commands/event.d.ts.map +1 -0
- package/dist/commands/event.js +136 -0
- package/dist/commands/event.js.map +1 -0
- package/dist/commands/experiment.d.ts +4 -0
- package/dist/commands/experiment.d.ts.map +1 -0
- package/dist/commands/experiment.js +140 -0
- package/dist/commands/experiment.js.map +1 -0
- package/dist/commands/export-intake-read-helpers.d.ts +150 -0
- package/dist/commands/export-intake-read-helpers.d.ts.map +1 -0
- package/dist/commands/export-intake-read-helpers.js +328 -0
- package/dist/commands/export-intake-read-helpers.js.map +1 -0
- package/dist/commands/export.d.ts +4 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +179 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/food.d.ts +4 -0
- package/dist/commands/food.d.ts.map +1 -0
- package/dist/commands/food.js +190 -0
- package/dist/commands/food.js.map +1 -0
- package/dist/commands/health-command-factory.d.ts +230 -0
- package/dist/commands/health-command-factory.d.ts.map +1 -0
- package/dist/commands/health-command-factory.js +551 -0
- package/dist/commands/health-command-factory.js.map +1 -0
- package/dist/commands/health-entity-command-registry.d.ts +27 -0
- package/dist/commands/health-entity-command-registry.d.ts.map +1 -0
- package/dist/commands/health-entity-command-registry.js +84 -0
- package/dist/commands/health-entity-command-registry.js.map +1 -0
- package/dist/commands/inbox.d.ts +5 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +841 -0
- package/dist/commands/inbox.js.map +1 -0
- package/dist/commands/intake.d.ts +4 -0
- package/dist/commands/intake.d.ts.map +1 -0
- package/dist/commands/intake.js +175 -0
- package/dist/commands/intake.js.map +1 -0
- package/dist/commands/intervention.d.ts +4 -0
- package/dist/commands/intervention.d.ts.map +1 -0
- package/dist/commands/intervention.js +122 -0
- package/dist/commands/intervention.js.map +1 -0
- package/dist/commands/journal.d.ts +12 -0
- package/dist/commands/journal.d.ts.map +1 -0
- package/dist/commands/journal.js +186 -0
- package/dist/commands/journal.js.map +1 -0
- package/dist/commands/meal.d.ts +4 -0
- package/dist/commands/meal.d.ts.map +1 -0
- package/dist/commands/meal.js +123 -0
- package/dist/commands/meal.js.map +1 -0
- package/dist/commands/profile.d.ts +4 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +62 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/protocol.d.ts +4 -0
- package/dist/commands/protocol.d.ts.map +1 -0
- package/dist/commands/protocol.js +79 -0
- package/dist/commands/protocol.js.map +1 -0
- package/dist/commands/provider.d.ts +4 -0
- package/dist/commands/provider.d.ts.map +1 -0
- package/dist/commands/provider.js +115 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/read.d.ts +4 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +55 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/recipe.d.ts +4 -0
- package/dist/commands/recipe.d.ts.map +1 -0
- package/dist/commands/recipe.js +116 -0
- package/dist/commands/recipe.js.map +1 -0
- package/dist/commands/record-mutation-command-helpers.d.ts +196 -0
- package/dist/commands/record-mutation-command-helpers.d.ts.map +1 -0
- package/dist/commands/record-mutation-command-helpers.js +150 -0
- package/dist/commands/record-mutation-command-helpers.js.map +1 -0
- package/dist/commands/research.d.ts +3 -0
- package/dist/commands/research.d.ts.map +1 -0
- package/dist/commands/research.js +104 -0
- package/dist/commands/research.js.map +1 -0
- package/dist/commands/sample-batch-command-helpers.d.ts +24 -0
- package/dist/commands/sample-batch-command-helpers.d.ts.map +1 -0
- package/dist/commands/sample-batch-command-helpers.js +99 -0
- package/dist/commands/sample-batch-command-helpers.js.map +1 -0
- package/dist/commands/sample-import-command-helpers.d.ts +24 -0
- package/dist/commands/sample-import-command-helpers.d.ts.map +1 -0
- package/dist/commands/sample-import-command-helpers.js +49 -0
- package/dist/commands/sample-import-command-helpers.js.map +1 -0
- package/dist/commands/sample-query-command-helpers.d.ts +11 -0
- package/dist/commands/sample-query-command-helpers.d.ts.map +1 -0
- package/dist/commands/sample-query-command-helpers.js +26 -0
- package/dist/commands/sample-query-command-helpers.js.map +1 -0
- package/dist/commands/samples.d.ts +4 -0
- package/dist/commands/samples.d.ts.map +1 -0
- package/dist/commands/samples.js +261 -0
- package/dist/commands/samples.js.map +1 -0
- package/dist/commands/search.d.ts +4 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +295 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/supplement.d.ts +4 -0
- package/dist/commands/supplement.d.ts.map +1 -0
- package/dist/commands/supplement.js +338 -0
- package/dist/commands/supplement.js.map +1 -0
- package/dist/commands/vault.d.ts +4 -0
- package/dist/commands/vault.d.ts.map +1 -0
- package/dist/commands/vault.js +164 -0
- package/dist/commands/vault.js.map +1 -0
- package/dist/commands/workout.d.ts +4 -0
- package/dist/commands/workout.d.ts.map +1 -0
- package/dist/commands/workout.js +284 -0
- package/dist/commands/workout.js.map +1 -0
- package/dist/incur.generated.d.ts +2164 -0
- package/dist/incur.generated.d.ts.map +1 -0
- package/dist/incur.generated.js +2 -0
- package/dist/incur.generated.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/research-cli-contracts.d.ts +22 -0
- package/dist/research-cli-contracts.d.ts.map +1 -0
- package/dist/research-cli-contracts.js +18 -0
- package/dist/research-cli-contracts.js.map +1 -0
- package/dist/research-runtime.d.ts +79 -0
- package/dist/research-runtime.d.ts.map +1 -0
- package/dist/research-runtime.js +351 -0
- package/dist/research-runtime.js.map +1 -0
- package/dist/run-terminal-logging.d.ts +12 -0
- package/dist/run-terminal-logging.d.ts.map +1 -0
- package/dist/run-terminal-logging.js +323 -0
- package/dist/run-terminal-logging.js.map +1 -0
- package/dist/setup-agentmail.d.ts +30 -0
- package/dist/setup-agentmail.d.ts.map +1 -0
- package/dist/setup-agentmail.js +136 -0
- package/dist/setup-agentmail.js.map +1 -0
- package/dist/setup-assistant-account.d.ts +29 -0
- package/dist/setup-assistant-account.d.ts.map +1 -0
- package/dist/setup-assistant-account.js +443 -0
- package/dist/setup-assistant-account.js.map +1 -0
- package/dist/setup-assistant.d.ts +34 -0
- package/dist/setup-assistant.d.ts.map +1 -0
- package/dist/setup-assistant.js +355 -0
- package/dist/setup-assistant.js.map +1 -0
- package/dist/setup-cli.d.ts +72 -0
- package/dist/setup-cli.d.ts.map +1 -0
- package/dist/setup-cli.js +387 -0
- package/dist/setup-cli.js.map +1 -0
- package/dist/setup-services/channels.d.ts +19 -0
- package/dist/setup-services/channels.d.ts.map +1 -0
- package/dist/setup-services/channels.js +721 -0
- package/dist/setup-services/channels.js.map +1 -0
- package/dist/setup-services/process.d.ts +18 -0
- package/dist/setup-services/process.d.ts.map +1 -0
- package/dist/setup-services/process.js +98 -0
- package/dist/setup-services/process.js.map +1 -0
- package/dist/setup-services/scheduled-updates.d.ts +9 -0
- package/dist/setup-services/scheduled-updates.d.ts.map +1 -0
- package/dist/setup-services/scheduled-updates.js +64 -0
- package/dist/setup-services/scheduled-updates.js.map +1 -0
- package/dist/setup-services/shell.d.ts +18 -0
- package/dist/setup-services/shell.d.ts.map +1 -0
- package/dist/setup-services/shell.js +447 -0
- package/dist/setup-services/shell.js.map +1 -0
- package/dist/setup-services/steps.d.ts +39 -0
- package/dist/setup-services/steps.d.ts.map +1 -0
- package/dist/setup-services/steps.js +86 -0
- package/dist/setup-services/steps.js.map +1 -0
- package/dist/setup-services/toolchain.d.ts +46 -0
- package/dist/setup-services/toolchain.d.ts.map +1 -0
- package/dist/setup-services/toolchain.js +232 -0
- package/dist/setup-services/toolchain.js.map +1 -0
- package/dist/setup-services.d.ts +44 -0
- package/dist/setup-services.d.ts.map +1 -0
- package/dist/setup-services.js +739 -0
- package/dist/setup-services.js.map +1 -0
- package/dist/setup-wizard.d.ts +101 -0
- package/dist/setup-wizard.d.ts.map +1 -0
- package/dist/setup-wizard.js +1458 -0
- package/dist/setup-wizard.js.map +1 -0
- package/dist/usecases/intervention.d.ts +63 -0
- package/dist/usecases/intervention.d.ts.map +1 -0
- package/dist/usecases/intervention.js +205 -0
- package/dist/usecases/intervention.js.map +1 -0
- package/dist/usecases/text-duration.d.ts +4 -0
- package/dist/usecases/text-duration.d.ts.map +1 -0
- package/dist/usecases/text-duration.js +63 -0
- package/dist/usecases/text-duration.js.map +1 -0
- package/dist/usecases/workout-format.d.ts +139 -0
- package/dist/usecases/workout-format.d.ts.map +1 -0
- package/dist/usecases/workout-format.js +445 -0
- package/dist/usecases/workout-format.js.map +1 -0
- package/dist/usecases/workout.d.ts +94 -0
- package/dist/usecases/workout.d.ts.map +1 -0
- package/dist/usecases/workout.js +411 -0
- package/dist/usecases/workout.js.map +1 -0
- package/dist/vault-cli-command-manifest.d.ts +562 -0
- package/dist/vault-cli-command-manifest.d.ts.map +1 -0
- package/dist/vault-cli-command-manifest.js +759 -0
- package/dist/vault-cli-command-manifest.js.map +1 -0
- package/dist/vault-cli.d.ts +6 -0
- package/dist/vault-cli.d.ts.map +1 -0
- package/dist/vault-cli.js +38 -0
- package/dist/vault-cli.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
import { Cli, z } from 'incur';
|
|
2
|
+
import { emptyArgsSchema, parseHeadersJsonOption, requestIdFromOptions, withBaseOptions, } from '@murphai/assistant-core/command-helpers';
|
|
3
|
+
import { inboxAttachmentListResultSchema, inboxAttachmentParseResultSchema, inboxAttachmentReparseResultSchema, inboxAttachmentShowResultSchema, inboxAttachmentStatusResultSchema, inboxBackfillResultSchema, inboxBootstrapResultSchema, inboxDaemonStateSchema, inboxDoctorResultSchema, inboxInitResultSchema, inboxListResultSchema, inboxParseResultSchema, inboxPromoteExperimentNoteResultSchema, inboxPromoteMealResultSchema, inboxPromoteDocumentResultSchema, inboxPromoteJournalResultSchema, inboxRequeueResultSchema, inboxRunResultSchema, inboxSearchResultSchema, inboxSetupResultSchema, inboxShowResultSchema, inboxSourceAddResultSchema, inboxSourceListResultSchema, inboxSourceRemoveResultSchema, inboxSourceValues, } from '@murphai/assistant-core/inbox-cli-contracts';
|
|
4
|
+
import { inboxModelBundleResultSchema, inboxModelRouteResultSchema, } from '@murphai/assistant-core/inbox-model-contracts';
|
|
5
|
+
import { materializeInboxModelBundle, routeInboxCaptureWithModel, } from '@murphai/assistant-core/inbox-model-harness';
|
|
6
|
+
import { formatForegroundLogLine, formatInboxRunEventForTerminal, resolveForegroundTerminalLogOptions, } from '../run-terminal-logging.js';
|
|
7
|
+
const inboxInitOptionFields = {
|
|
8
|
+
rebuild: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Rebuild the runtime index from raw inbox envelope files after initialization.'),
|
|
12
|
+
};
|
|
13
|
+
const inboxSetupOptionFields = {
|
|
14
|
+
ffmpegCommand: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Optional explicit ffmpeg command or path to persist.'),
|
|
19
|
+
pdftotextCommand: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Optional explicit pdftotext command or path to persist.'),
|
|
24
|
+
whisperCommand: z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1)
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Optional explicit whisper.cpp command or path to persist.'),
|
|
29
|
+
whisperModelPath: z
|
|
30
|
+
.string()
|
|
31
|
+
.min(1)
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Optional explicit whisper model path to persist.'),
|
|
34
|
+
};
|
|
35
|
+
export function registerInboxCommands(cli, services, vaultServices) {
|
|
36
|
+
const inbox = Cli.create('inbox', {
|
|
37
|
+
description: 'Inbox runtime setup, diagnostics, capture review, and daemon operations.',
|
|
38
|
+
});
|
|
39
|
+
const inboxPostInitCta = {
|
|
40
|
+
cta: {
|
|
41
|
+
description: 'Next:',
|
|
42
|
+
commands: [
|
|
43
|
+
{
|
|
44
|
+
command: 'vault-cli inbox source add imessage',
|
|
45
|
+
description: 'Add an iMessage connector.',
|
|
46
|
+
options: {
|
|
47
|
+
id: 'imessage:self',
|
|
48
|
+
account: 'self',
|
|
49
|
+
includeOwn: true,
|
|
50
|
+
vault: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
command: 'vault-cli inbox source add telegram',
|
|
55
|
+
description: 'Add a Telegram long-poll connector.',
|
|
56
|
+
options: {
|
|
57
|
+
id: 'telegram:bot',
|
|
58
|
+
account: 'bot',
|
|
59
|
+
vault: true,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
command: 'vault-cli inbox source add linq',
|
|
64
|
+
description: 'Add a Linq webhook connector.',
|
|
65
|
+
options: {
|
|
66
|
+
id: 'linq:default',
|
|
67
|
+
account: 'default',
|
|
68
|
+
vault: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
command: 'vault-cli inbox doctor',
|
|
73
|
+
description: 'Verify runtime setup before backfill.',
|
|
74
|
+
args: { sourceId: 'imessage:self' },
|
|
75
|
+
options: { vault: true },
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
command: 'vault-cli inbox backfill',
|
|
79
|
+
description: 'Import recent messages into the inbox runtime.',
|
|
80
|
+
options: { source: 'imessage:self', vault: true },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
command: 'vault-cli inbox run',
|
|
84
|
+
description: 'Start the foreground inbox daemon.',
|
|
85
|
+
options: { vault: true },
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
inbox.command('init', {
|
|
91
|
+
args: emptyArgsSchema,
|
|
92
|
+
description: 'Initialize local inbox runtime state under .runtime without mutating canonical vault records.',
|
|
93
|
+
examples: [
|
|
94
|
+
{
|
|
95
|
+
options: { vault: './vault' },
|
|
96
|
+
description: 'Create the inbox runtime config and SQLite database.',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
options: { vault: './vault', rebuild: true },
|
|
100
|
+
description: 'Rebuild the runtime index from existing raw inbox envelopes.',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
hint: 'Run this after `vault-cli init`; it creates only machine-local inbox runtime state.',
|
|
104
|
+
options: withBaseOptions(inboxInitOptionFields),
|
|
105
|
+
output: inboxInitResultSchema,
|
|
106
|
+
async run(context) {
|
|
107
|
+
const result = await services.init({
|
|
108
|
+
vault: context.options.vault,
|
|
109
|
+
requestId: requestIdFromOptions(context.options),
|
|
110
|
+
rebuild: context.options.rebuild,
|
|
111
|
+
});
|
|
112
|
+
return context.ok(result, inboxPostInitCta);
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
inbox.command('bootstrap', {
|
|
116
|
+
args: emptyArgsSchema,
|
|
117
|
+
description: 'Initialize local inbox runtime state and write parser toolchain config in one step.',
|
|
118
|
+
examples: [
|
|
119
|
+
{
|
|
120
|
+
options: { vault: './vault' },
|
|
121
|
+
description: 'Create local inbox runtime state and parser toolchain config together.',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
options: {
|
|
125
|
+
vault: './vault',
|
|
126
|
+
rebuild: true,
|
|
127
|
+
whisperCommand: '/usr/local/bin/whisper-cli',
|
|
128
|
+
whisperModelPath: './models/ggml-base.en.bin',
|
|
129
|
+
},
|
|
130
|
+
description: 'Rebuild runtime indexes while persisting explicit whisper.cpp command and model-path overrides.',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
hint: 'Use this for local-first inbox/parser bootstrap; it composes `inbox init` and `inbox setup` without mixing their flag sets.',
|
|
134
|
+
options: withBaseOptions({
|
|
135
|
+
...inboxInitOptionFields,
|
|
136
|
+
...inboxSetupOptionFields,
|
|
137
|
+
strict: z
|
|
138
|
+
.boolean()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe('Fail if bootstrap doctor finds blocking runtime issues or unavailable explicitly configured parser tools.'),
|
|
141
|
+
}),
|
|
142
|
+
output: inboxBootstrapResultSchema,
|
|
143
|
+
async run(context) {
|
|
144
|
+
const result = await services.bootstrap({
|
|
145
|
+
vault: context.options.vault,
|
|
146
|
+
requestId: requestIdFromOptions(context.options),
|
|
147
|
+
rebuild: context.options.rebuild,
|
|
148
|
+
ffmpegCommand: context.options.ffmpegCommand,
|
|
149
|
+
pdftotextCommand: context.options.pdftotextCommand,
|
|
150
|
+
whisperCommand: context.options.whisperCommand,
|
|
151
|
+
whisperModelPath: context.options.whisperModelPath,
|
|
152
|
+
strict: context.options.strict,
|
|
153
|
+
});
|
|
154
|
+
return context.ok(result, inboxPostInitCta);
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
inbox.command('setup', {
|
|
158
|
+
args: emptyArgsSchema,
|
|
159
|
+
description: 'Write parser toolchain config under .runtime/parsers and report discovered local tool availability.',
|
|
160
|
+
examples: [
|
|
161
|
+
{
|
|
162
|
+
options: { vault: './vault' },
|
|
163
|
+
description: 'Create or refresh the local parser toolchain config.',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
options: {
|
|
167
|
+
vault: './vault',
|
|
168
|
+
whisperCommand: '/usr/local/bin/whisper-cli',
|
|
169
|
+
whisperModelPath: './models/ggml-base.en.bin',
|
|
170
|
+
},
|
|
171
|
+
description: 'Persist explicit whisper.cpp command and model-path overrides.',
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
hint: 'This config is local runtime state only; it does not write canonical health records.',
|
|
175
|
+
options: withBaseOptions(inboxSetupOptionFields),
|
|
176
|
+
output: inboxSetupResultSchema,
|
|
177
|
+
async run(context) {
|
|
178
|
+
return services.setup({
|
|
179
|
+
vault: context.options.vault,
|
|
180
|
+
requestId: requestIdFromOptions(context.options),
|
|
181
|
+
ffmpegCommand: context.options.ffmpegCommand,
|
|
182
|
+
pdftotextCommand: context.options.pdftotextCommand,
|
|
183
|
+
whisperCommand: context.options.whisperCommand,
|
|
184
|
+
whisperModelPath: context.options.whisperModelPath,
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
const source = Cli.create('source', {
|
|
189
|
+
description: 'Manage machine-local inbox connector configuration.',
|
|
190
|
+
});
|
|
191
|
+
source.command('add', {
|
|
192
|
+
args: z.object({
|
|
193
|
+
source: z
|
|
194
|
+
.enum(inboxSourceValues)
|
|
195
|
+
.describe('Connector family to add.'),
|
|
196
|
+
}),
|
|
197
|
+
description: 'Add a connector configuration to the local inbox runtime config.',
|
|
198
|
+
examples: [
|
|
199
|
+
{
|
|
200
|
+
args: { source: 'imessage' },
|
|
201
|
+
options: {
|
|
202
|
+
id: 'imessage:self',
|
|
203
|
+
account: 'self',
|
|
204
|
+
includeOwn: true,
|
|
205
|
+
vault: './vault',
|
|
206
|
+
},
|
|
207
|
+
description: 'Configure an iMessage source for the local account.',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
args: { source: 'telegram' },
|
|
211
|
+
options: {
|
|
212
|
+
id: 'telegram:bot',
|
|
213
|
+
account: 'bot',
|
|
214
|
+
vault: './vault',
|
|
215
|
+
},
|
|
216
|
+
description: 'Configure a Telegram bot source for local long polling.',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
args: { source: 'linq' },
|
|
220
|
+
options: {
|
|
221
|
+
id: 'linq:default',
|
|
222
|
+
account: 'default',
|
|
223
|
+
linqWebhookPort: 8789,
|
|
224
|
+
linqWebhookPath: '/linq-webhook',
|
|
225
|
+
enableAutoReply: true,
|
|
226
|
+
vault: './vault',
|
|
227
|
+
},
|
|
228
|
+
description: 'Configure a Linq webhook connector so the local inbox daemon can receive inbound Linq messages and assistant replies can send back into the same direct chat.',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
args: { source: 'email' },
|
|
232
|
+
options: {
|
|
233
|
+
id: 'email:agentmail',
|
|
234
|
+
provision: true,
|
|
235
|
+
emailDisplayName: 'Murph',
|
|
236
|
+
enableAutoReply: true,
|
|
237
|
+
vault: './vault',
|
|
238
|
+
},
|
|
239
|
+
description: 'Provision an AgentMail inbox or recover a single existing inbox when create permission is unavailable, then configure email polling and assistant auto-reply.',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
hint: 'Use a stable runtime id such as `imessage:self`, `telegram:bot`, `linq:default`, or `email:agentmail`; each connector id must map to a unique source/account runtime namespace, while cursor state stays in SQLite.',
|
|
243
|
+
options: withBaseOptions({
|
|
244
|
+
id: z.string().min(1).describe('Runtime connector id.'),
|
|
245
|
+
account: z
|
|
246
|
+
.string()
|
|
247
|
+
.min(1)
|
|
248
|
+
.optional()
|
|
249
|
+
.describe('Optional account identity for the connector. Defaults to `self` for iMessage, `bot` for Telegram, and should be an AgentMail inbox id for email unless `--provision` is used; for AgentMail this is often the inbox id or inbox email address.'),
|
|
250
|
+
address: z
|
|
251
|
+
.string()
|
|
252
|
+
.min(1)
|
|
253
|
+
.optional()
|
|
254
|
+
.describe('Optional email address to associate with an existing AgentMail inbox connector.'),
|
|
255
|
+
includeOwn: z
|
|
256
|
+
.boolean()
|
|
257
|
+
.optional()
|
|
258
|
+
.describe('Include messages sent by the local account when supported.'),
|
|
259
|
+
backfillLimit: z
|
|
260
|
+
.number()
|
|
261
|
+
.int()
|
|
262
|
+
.positive()
|
|
263
|
+
.max(5000)
|
|
264
|
+
.default(500)
|
|
265
|
+
.describe('Default backfill limit for this connector.'),
|
|
266
|
+
provision: z
|
|
267
|
+
.boolean()
|
|
268
|
+
.optional()
|
|
269
|
+
.describe('Attempt to provision a new AgentMail inbox when adding an email connector. If create permission is unavailable but the API key can access exactly one existing inbox, Murph reuses that inbox automatically.'),
|
|
270
|
+
emailDisplayName: z
|
|
271
|
+
.string()
|
|
272
|
+
.min(1)
|
|
273
|
+
.optional()
|
|
274
|
+
.describe('Optional display name to use when provisioning a new AgentMail inbox.'),
|
|
275
|
+
emailUsername: z
|
|
276
|
+
.string()
|
|
277
|
+
.min(1)
|
|
278
|
+
.optional()
|
|
279
|
+
.describe('Optional mailbox username when provisioning a new AgentMail inbox.'),
|
|
280
|
+
emailDomain: z
|
|
281
|
+
.string()
|
|
282
|
+
.min(1)
|
|
283
|
+
.optional()
|
|
284
|
+
.describe('Optional AgentMail domain when provisioning a new AgentMail inbox.'),
|
|
285
|
+
emailClientId: z
|
|
286
|
+
.string()
|
|
287
|
+
.min(1)
|
|
288
|
+
.optional()
|
|
289
|
+
.describe('Optional AgentMail client id to associate when provisioning a new inbox.'),
|
|
290
|
+
linqWebhookHost: z
|
|
291
|
+
.string()
|
|
292
|
+
.min(1)
|
|
293
|
+
.optional()
|
|
294
|
+
.describe('Optional local bind host for the Linq webhook listener. Defaults to 0.0.0.0.'),
|
|
295
|
+
linqWebhookPath: z
|
|
296
|
+
.string()
|
|
297
|
+
.min(1)
|
|
298
|
+
.optional()
|
|
299
|
+
.describe('Optional local path for the Linq webhook listener. Defaults to /linq-webhook.'),
|
|
300
|
+
linqWebhookPort: z
|
|
301
|
+
.number()
|
|
302
|
+
.int()
|
|
303
|
+
.positive()
|
|
304
|
+
.max(65535)
|
|
305
|
+
.optional()
|
|
306
|
+
.describe('Optional local port for the Linq webhook listener. Defaults to 8789.'),
|
|
307
|
+
enableAutoReply: z
|
|
308
|
+
.boolean()
|
|
309
|
+
.optional()
|
|
310
|
+
.describe('Enable assistant auto-reply for this connector channel after the source is added.'),
|
|
311
|
+
}),
|
|
312
|
+
output: inboxSourceAddResultSchema,
|
|
313
|
+
async run(context) {
|
|
314
|
+
const result = await services.sourceAdd({
|
|
315
|
+
vault: context.options.vault,
|
|
316
|
+
requestId: requestIdFromOptions(context.options),
|
|
317
|
+
source: context.args.source,
|
|
318
|
+
id: context.options.id,
|
|
319
|
+
account: context.options.account,
|
|
320
|
+
address: context.options.address,
|
|
321
|
+
includeOwn: context.options.includeOwn,
|
|
322
|
+
backfillLimit: context.options.backfillLimit,
|
|
323
|
+
provision: context.options.provision,
|
|
324
|
+
emailDisplayName: context.options.emailDisplayName,
|
|
325
|
+
emailUsername: context.options.emailUsername,
|
|
326
|
+
emailDomain: context.options.emailDomain,
|
|
327
|
+
emailClientId: context.options.emailClientId,
|
|
328
|
+
linqWebhookHost: context.options.linqWebhookHost,
|
|
329
|
+
linqWebhookPath: context.options.linqWebhookPath,
|
|
330
|
+
linqWebhookPort: context.options.linqWebhookPort,
|
|
331
|
+
enableAutoReply: context.options.enableAutoReply,
|
|
332
|
+
});
|
|
333
|
+
const sourceAddCta = {
|
|
334
|
+
cta: {
|
|
335
|
+
description: 'Suggested commands:',
|
|
336
|
+
commands: [
|
|
337
|
+
{
|
|
338
|
+
command: 'vault-cli inbox doctor',
|
|
339
|
+
args: { sourceId: result.connector.id },
|
|
340
|
+
options: { vault: true },
|
|
341
|
+
description: 'Check connector readiness and local dependencies.',
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
command: 'vault-cli inbox backfill',
|
|
345
|
+
options: { source: result.connector.id, vault: true },
|
|
346
|
+
description: 'Backfill recent captures for this connector.',
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
return context.ok(result, sourceAddCta);
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
source.command('list', {
|
|
355
|
+
args: emptyArgsSchema,
|
|
356
|
+
description: 'List configured inbox connectors from the local runtime config.',
|
|
357
|
+
options: withBaseOptions(),
|
|
358
|
+
output: inboxSourceListResultSchema,
|
|
359
|
+
async run(context) {
|
|
360
|
+
return services.sourceList({
|
|
361
|
+
vault: context.options.vault,
|
|
362
|
+
requestId: requestIdFromOptions(context.options),
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
source.command('remove', {
|
|
367
|
+
args: z.object({
|
|
368
|
+
id: z.string().min(1).describe('Runtime connector id to remove.'),
|
|
369
|
+
}),
|
|
370
|
+
description: 'Remove a connector from the local inbox runtime config.',
|
|
371
|
+
options: withBaseOptions(),
|
|
372
|
+
output: inboxSourceRemoveResultSchema,
|
|
373
|
+
async run(context) {
|
|
374
|
+
return services.sourceRemove({
|
|
375
|
+
vault: context.options.vault,
|
|
376
|
+
requestId: requestIdFromOptions(context.options),
|
|
377
|
+
connectorId: context.args.id,
|
|
378
|
+
});
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
inbox.command(source);
|
|
382
|
+
inbox.command('doctor', {
|
|
383
|
+
args: z.object({
|
|
384
|
+
sourceId: z
|
|
385
|
+
.string()
|
|
386
|
+
.min(1)
|
|
387
|
+
.optional()
|
|
388
|
+
.describe('Optional runtime connector id to inspect deeply.'),
|
|
389
|
+
}),
|
|
390
|
+
description: 'Verify inbox runtime configuration, local dependencies, and connector readiness.',
|
|
391
|
+
examples: [
|
|
392
|
+
{
|
|
393
|
+
options: { vault: './vault' },
|
|
394
|
+
description: 'Check runtime config and SQLite availability.',
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
args: { sourceId: 'imessage:self' },
|
|
398
|
+
options: { vault: './vault' },
|
|
399
|
+
description: 'Run deep iMessage-specific checks for one connector.',
|
|
400
|
+
},
|
|
401
|
+
],
|
|
402
|
+
options: withBaseOptions(),
|
|
403
|
+
output: inboxDoctorResultSchema,
|
|
404
|
+
async run(context) {
|
|
405
|
+
return services.doctor({
|
|
406
|
+
vault: context.options.vault,
|
|
407
|
+
requestId: requestIdFromOptions(context.options),
|
|
408
|
+
sourceId: context.args.sourceId,
|
|
409
|
+
});
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
inbox.command('parse', {
|
|
413
|
+
args: emptyArgsSchema,
|
|
414
|
+
description: 'Drain queued attachment parse jobs with the local parser toolchain.',
|
|
415
|
+
options: withBaseOptions({
|
|
416
|
+
captureId: z
|
|
417
|
+
.string()
|
|
418
|
+
.min(1)
|
|
419
|
+
.optional()
|
|
420
|
+
.describe('Optional inbox capture id to scope the drain to one capture.'),
|
|
421
|
+
limit: z
|
|
422
|
+
.number()
|
|
423
|
+
.int()
|
|
424
|
+
.positive()
|
|
425
|
+
.max(200)
|
|
426
|
+
.optional()
|
|
427
|
+
.describe('Optional maximum number of parse jobs to run in this drain.'),
|
|
428
|
+
}),
|
|
429
|
+
output: inboxParseResultSchema,
|
|
430
|
+
async run(context) {
|
|
431
|
+
return services.parse({
|
|
432
|
+
vault: context.options.vault,
|
|
433
|
+
requestId: requestIdFromOptions(context.options),
|
|
434
|
+
captureId: context.options.captureId,
|
|
435
|
+
limit: context.options.limit,
|
|
436
|
+
});
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
inbox.command('requeue', {
|
|
440
|
+
args: emptyArgsSchema,
|
|
441
|
+
description: 'Reset failed or interrupted attachment parse jobs back to pending.',
|
|
442
|
+
options: withBaseOptions({
|
|
443
|
+
captureId: z
|
|
444
|
+
.string()
|
|
445
|
+
.min(1)
|
|
446
|
+
.optional()
|
|
447
|
+
.describe('Optional inbox capture id to scope the requeue.'),
|
|
448
|
+
attachmentId: z
|
|
449
|
+
.string()
|
|
450
|
+
.min(1)
|
|
451
|
+
.optional()
|
|
452
|
+
.describe('Optional inbox attachment id to scope the requeue.'),
|
|
453
|
+
state: z
|
|
454
|
+
.enum(['failed', 'running'])
|
|
455
|
+
.default('failed')
|
|
456
|
+
.describe('Runtime parse-job state to reset. Defaults to `failed`.'),
|
|
457
|
+
}),
|
|
458
|
+
output: inboxRequeueResultSchema,
|
|
459
|
+
async run(context) {
|
|
460
|
+
return services.requeue({
|
|
461
|
+
vault: context.options.vault,
|
|
462
|
+
requestId: requestIdFromOptions(context.options),
|
|
463
|
+
captureId: context.options.captureId,
|
|
464
|
+
attachmentId: context.options.attachmentId,
|
|
465
|
+
state: context.options.state,
|
|
466
|
+
});
|
|
467
|
+
},
|
|
468
|
+
});
|
|
469
|
+
inbox.command('backfill', {
|
|
470
|
+
args: emptyArgsSchema,
|
|
471
|
+
description: 'Backfill one configured inbox connector into the runtime and canonical raw inbox store.',
|
|
472
|
+
options: withBaseOptions({
|
|
473
|
+
source: z.string().min(1).describe('Runtime connector id to backfill.'),
|
|
474
|
+
limit: z
|
|
475
|
+
.number()
|
|
476
|
+
.int()
|
|
477
|
+
.positive()
|
|
478
|
+
.max(5000)
|
|
479
|
+
.optional()
|
|
480
|
+
.describe('Optional override backfill limit for this run.'),
|
|
481
|
+
parse: z
|
|
482
|
+
.boolean()
|
|
483
|
+
.optional()
|
|
484
|
+
.describe('Also drain parser jobs for each imported capture during this backfill run.'),
|
|
485
|
+
}),
|
|
486
|
+
output: inboxBackfillResultSchema,
|
|
487
|
+
async run(context) {
|
|
488
|
+
return services.backfill({
|
|
489
|
+
vault: context.options.vault,
|
|
490
|
+
requestId: requestIdFromOptions(context.options),
|
|
491
|
+
sourceId: context.options.source,
|
|
492
|
+
limit: context.options.limit,
|
|
493
|
+
parse: context.options.parse,
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
});
|
|
497
|
+
inbox.command('run', {
|
|
498
|
+
args: emptyArgsSchema,
|
|
499
|
+
description: 'Run all enabled inbox connectors in the foreground until stopped, auto-draining parser jobs for new captures.',
|
|
500
|
+
hint: 'Use `vault-cli inbox status` in another shell to inspect daemon state and `vault-cli inbox stop` to send SIGTERM.',
|
|
501
|
+
options: withBaseOptions(),
|
|
502
|
+
output: inboxRunResultSchema,
|
|
503
|
+
async run(context) {
|
|
504
|
+
const terminalLogOptions = resolveForegroundTerminalLogOptions(process.env);
|
|
505
|
+
return services.run({
|
|
506
|
+
vault: context.options.vault,
|
|
507
|
+
requestId: requestIdFromOptions(context.options),
|
|
508
|
+
}, {
|
|
509
|
+
onEvent(event) {
|
|
510
|
+
const message = formatInboxRunEventForTerminal(event, terminalLogOptions);
|
|
511
|
+
if (message) {
|
|
512
|
+
console.error(formatForegroundLogLine('inbox', message));
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
});
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
inbox.command('status', {
|
|
519
|
+
args: emptyArgsSchema,
|
|
520
|
+
description: 'Show the current local inbox daemon state.',
|
|
521
|
+
options: withBaseOptions(),
|
|
522
|
+
output: inboxDaemonStateSchema,
|
|
523
|
+
async run(context) {
|
|
524
|
+
return services.status({
|
|
525
|
+
vault: context.options.vault,
|
|
526
|
+
requestId: requestIdFromOptions(context.options),
|
|
527
|
+
});
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
inbox.command('stop', {
|
|
531
|
+
args: emptyArgsSchema,
|
|
532
|
+
description: 'Stop the currently running inbox daemon by signaling its recorded PID.',
|
|
533
|
+
options: withBaseOptions(),
|
|
534
|
+
output: inboxDaemonStateSchema,
|
|
535
|
+
async run(context) {
|
|
536
|
+
return services.stop({
|
|
537
|
+
vault: context.options.vault,
|
|
538
|
+
requestId: requestIdFromOptions(context.options),
|
|
539
|
+
});
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
inbox.command('list', {
|
|
543
|
+
args: emptyArgsSchema,
|
|
544
|
+
description: 'List captured inbox items from the local runtime index.',
|
|
545
|
+
options: withBaseOptions({
|
|
546
|
+
source: z
|
|
547
|
+
.string()
|
|
548
|
+
.min(1)
|
|
549
|
+
.optional()
|
|
550
|
+
.describe('Optional runtime connector id to filter by.'),
|
|
551
|
+
limit: z
|
|
552
|
+
.number()
|
|
553
|
+
.int()
|
|
554
|
+
.positive()
|
|
555
|
+
.max(200)
|
|
556
|
+
.default(50)
|
|
557
|
+
.describe('Maximum number of captures to return.'),
|
|
558
|
+
}),
|
|
559
|
+
output: inboxListResultSchema,
|
|
560
|
+
async run(context) {
|
|
561
|
+
return services.list({
|
|
562
|
+
vault: context.options.vault,
|
|
563
|
+
requestId: requestIdFromOptions(context.options),
|
|
564
|
+
sourceId: context.options.source,
|
|
565
|
+
limit: context.options.limit,
|
|
566
|
+
});
|
|
567
|
+
},
|
|
568
|
+
});
|
|
569
|
+
inbox.command('show', {
|
|
570
|
+
args: z.object({
|
|
571
|
+
captureId: z.string().min(1).describe('Inbox capture id to show.'),
|
|
572
|
+
}),
|
|
573
|
+
description: 'Show one captured inbox item with normalized metadata and stored attachment references.',
|
|
574
|
+
options: withBaseOptions(),
|
|
575
|
+
output: inboxShowResultSchema,
|
|
576
|
+
async run(context) {
|
|
577
|
+
return services.show({
|
|
578
|
+
vault: context.options.vault,
|
|
579
|
+
requestId: requestIdFromOptions(context.options),
|
|
580
|
+
captureId: context.args.captureId,
|
|
581
|
+
});
|
|
582
|
+
},
|
|
583
|
+
});
|
|
584
|
+
inbox.command('search', {
|
|
585
|
+
args: emptyArgsSchema,
|
|
586
|
+
description: 'Search captured inbox items using the local runtime FTS index.',
|
|
587
|
+
options: withBaseOptions({
|
|
588
|
+
text: z.string().min(1).describe('Search text to match.'),
|
|
589
|
+
source: z
|
|
590
|
+
.string()
|
|
591
|
+
.min(1)
|
|
592
|
+
.optional()
|
|
593
|
+
.describe('Optional runtime connector id to filter by.'),
|
|
594
|
+
limit: z
|
|
595
|
+
.number()
|
|
596
|
+
.int()
|
|
597
|
+
.positive()
|
|
598
|
+
.max(200)
|
|
599
|
+
.default(20)
|
|
600
|
+
.describe('Maximum number of hits to return.'),
|
|
601
|
+
}),
|
|
602
|
+
output: inboxSearchResultSchema,
|
|
603
|
+
async run(context) {
|
|
604
|
+
return services.search({
|
|
605
|
+
vault: context.options.vault,
|
|
606
|
+
requestId: requestIdFromOptions(context.options),
|
|
607
|
+
text: context.options.text,
|
|
608
|
+
sourceId: context.options.source,
|
|
609
|
+
limit: context.options.limit,
|
|
610
|
+
});
|
|
611
|
+
},
|
|
612
|
+
});
|
|
613
|
+
const attachment = Cli.create('attachment', {
|
|
614
|
+
description: 'Inspect stored inbox attachments and their runtime parse state.',
|
|
615
|
+
});
|
|
616
|
+
attachment.command('list', {
|
|
617
|
+
args: z.object({
|
|
618
|
+
captureId: z.string().min(1).describe('Inbox capture id to inspect.'),
|
|
619
|
+
}),
|
|
620
|
+
description: 'List stored attachments for one inbox capture.',
|
|
621
|
+
options: withBaseOptions(),
|
|
622
|
+
output: inboxAttachmentListResultSchema,
|
|
623
|
+
async run(context) {
|
|
624
|
+
return services.listAttachments({
|
|
625
|
+
vault: context.options.vault,
|
|
626
|
+
requestId: requestIdFromOptions(context.options),
|
|
627
|
+
captureId: context.args.captureId,
|
|
628
|
+
});
|
|
629
|
+
},
|
|
630
|
+
});
|
|
631
|
+
attachment.command('show', {
|
|
632
|
+
args: z.object({
|
|
633
|
+
attachmentId: z.string().min(1).describe('Inbox attachment id to inspect.'),
|
|
634
|
+
}),
|
|
635
|
+
description: 'Show one stored inbox attachment by its runtime attachment id.',
|
|
636
|
+
options: withBaseOptions(),
|
|
637
|
+
output: inboxAttachmentShowResultSchema,
|
|
638
|
+
async run(context) {
|
|
639
|
+
return services.showAttachment({
|
|
640
|
+
vault: context.options.vault,
|
|
641
|
+
requestId: requestIdFromOptions(context.options),
|
|
642
|
+
attachmentId: context.args.attachmentId,
|
|
643
|
+
});
|
|
644
|
+
},
|
|
645
|
+
});
|
|
646
|
+
attachment.command('show-status', {
|
|
647
|
+
args: z.object({
|
|
648
|
+
attachmentId: z.string().min(1).describe('Inbox attachment id to inspect.'),
|
|
649
|
+
}),
|
|
650
|
+
description: 'Show the current runtime parse status for one inbox attachment.',
|
|
651
|
+
options: withBaseOptions(),
|
|
652
|
+
output: inboxAttachmentStatusResultSchema,
|
|
653
|
+
async run(context) {
|
|
654
|
+
return services.showAttachmentStatus({
|
|
655
|
+
vault: context.options.vault,
|
|
656
|
+
requestId: requestIdFromOptions(context.options),
|
|
657
|
+
attachmentId: context.args.attachmentId,
|
|
658
|
+
});
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
attachment.command('parse', {
|
|
662
|
+
args: z.object({
|
|
663
|
+
attachmentId: z.string().min(1).describe('Inbox attachment id to parse now.'),
|
|
664
|
+
}),
|
|
665
|
+
description: 'Drain the current parse queue entry for one parseable inbox attachment.',
|
|
666
|
+
options: withBaseOptions(),
|
|
667
|
+
output: inboxAttachmentParseResultSchema,
|
|
668
|
+
async run(context) {
|
|
669
|
+
return services.parseAttachment({
|
|
670
|
+
vault: context.options.vault,
|
|
671
|
+
requestId: requestIdFromOptions(context.options),
|
|
672
|
+
attachmentId: context.args.attachmentId,
|
|
673
|
+
});
|
|
674
|
+
},
|
|
675
|
+
});
|
|
676
|
+
attachment.command('reparse', {
|
|
677
|
+
args: z.object({
|
|
678
|
+
attachmentId: z.string().min(1).describe('Inbox attachment id to requeue.'),
|
|
679
|
+
}),
|
|
680
|
+
description: 'Requeue the current runtime parse job for one parseable inbox attachment.',
|
|
681
|
+
options: withBaseOptions(),
|
|
682
|
+
output: inboxAttachmentReparseResultSchema,
|
|
683
|
+
async run(context) {
|
|
684
|
+
return services.reparseAttachment({
|
|
685
|
+
vault: context.options.vault,
|
|
686
|
+
requestId: requestIdFromOptions(context.options),
|
|
687
|
+
attachmentId: context.args.attachmentId,
|
|
688
|
+
});
|
|
689
|
+
},
|
|
690
|
+
});
|
|
691
|
+
inbox.command(attachment);
|
|
692
|
+
const promote = Cli.create('promote', {
|
|
693
|
+
description: 'Promote captured inbox items into canonical Murph records.',
|
|
694
|
+
});
|
|
695
|
+
promote.command('meal', {
|
|
696
|
+
args: z.object({
|
|
697
|
+
captureId: z.string().min(1).describe('Inbox capture id to promote.'),
|
|
698
|
+
}),
|
|
699
|
+
description: 'Promote one inbox capture with an image attachment into a canonical meal event.',
|
|
700
|
+
hint: 'The first stored image attachment becomes the meal photo; the first stored audio attachment becomes the optional audio note.',
|
|
701
|
+
options: withBaseOptions(),
|
|
702
|
+
output: inboxPromoteMealResultSchema,
|
|
703
|
+
async run(context) {
|
|
704
|
+
return services.promoteMeal({
|
|
705
|
+
vault: context.options.vault,
|
|
706
|
+
requestId: requestIdFromOptions(context.options),
|
|
707
|
+
captureId: context.args.captureId,
|
|
708
|
+
});
|
|
709
|
+
},
|
|
710
|
+
});
|
|
711
|
+
promote.command('document', {
|
|
712
|
+
args: z.object({
|
|
713
|
+
captureId: z.string().min(1).describe('Inbox capture id to promote.'),
|
|
714
|
+
}),
|
|
715
|
+
description: 'Promote one inbox capture with a stored document attachment into a canonical document import.',
|
|
716
|
+
options: withBaseOptions(),
|
|
717
|
+
output: inboxPromoteDocumentResultSchema,
|
|
718
|
+
async run(context) {
|
|
719
|
+
return services.promoteDocument({
|
|
720
|
+
vault: context.options.vault,
|
|
721
|
+
requestId: requestIdFromOptions(context.options),
|
|
722
|
+
captureId: context.args.captureId,
|
|
723
|
+
});
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
promote.command('journal', {
|
|
727
|
+
args: z.object({
|
|
728
|
+
captureId: z.string().min(1).describe('Inbox capture id to promote.'),
|
|
729
|
+
}),
|
|
730
|
+
description: 'Promote one inbox capture into the journal day for its occurred-at date using a stable, idempotent note block.',
|
|
731
|
+
options: withBaseOptions(),
|
|
732
|
+
output: inboxPromoteJournalResultSchema,
|
|
733
|
+
async run(context) {
|
|
734
|
+
return services.promoteJournal({
|
|
735
|
+
vault: context.options.vault,
|
|
736
|
+
requestId: requestIdFromOptions(context.options),
|
|
737
|
+
captureId: context.args.captureId,
|
|
738
|
+
});
|
|
739
|
+
},
|
|
740
|
+
});
|
|
741
|
+
promote.command('experiment-note', {
|
|
742
|
+
args: z.object({
|
|
743
|
+
captureId: z.string().min(1).describe('Inbox capture id to promote.'),
|
|
744
|
+
}),
|
|
745
|
+
description: 'Promote one inbox capture into a single unambiguous experiment page using an idempotent markdown note block.',
|
|
746
|
+
options: withBaseOptions(),
|
|
747
|
+
output: inboxPromoteExperimentNoteResultSchema,
|
|
748
|
+
async run(context) {
|
|
749
|
+
return services.promoteExperimentNote({
|
|
750
|
+
vault: context.options.vault,
|
|
751
|
+
requestId: requestIdFromOptions(context.options),
|
|
752
|
+
captureId: context.args.captureId,
|
|
753
|
+
});
|
|
754
|
+
},
|
|
755
|
+
});
|
|
756
|
+
inbox.command(promote);
|
|
757
|
+
const model = Cli.create('model', {
|
|
758
|
+
description: 'Build a normalized inbox bundle, attach supported routing images when available, and ask a Vercel AI SDK-backed model to choose canonical CLI actions.',
|
|
759
|
+
});
|
|
760
|
+
model.command('bundle', {
|
|
761
|
+
args: z.object({
|
|
762
|
+
captureId: z.string().min(1).describe('Inbox capture id to bundle.'),
|
|
763
|
+
}),
|
|
764
|
+
description: 'Materialize the normalized routing bundle for one inbox capture, including multimodal image-routing eligibility metadata.',
|
|
765
|
+
options: withBaseOptions(),
|
|
766
|
+
output: inboxModelBundleResultSchema,
|
|
767
|
+
async run(context) {
|
|
768
|
+
return materializeInboxModelBundle({
|
|
769
|
+
inboxServices: services,
|
|
770
|
+
requestId: requestIdFromOptions(context.options),
|
|
771
|
+
captureId: context.args.captureId,
|
|
772
|
+
vault: context.options.vault,
|
|
773
|
+
vaultServices,
|
|
774
|
+
});
|
|
775
|
+
},
|
|
776
|
+
});
|
|
777
|
+
model.command('route', {
|
|
778
|
+
args: z.object({
|
|
779
|
+
captureId: z.string().min(1).describe('Inbox capture id to route.'),
|
|
780
|
+
}),
|
|
781
|
+
description: 'Use the shared assistant model harness to generate a CLI action plan for one inbox capture.',
|
|
782
|
+
hint: 'Pass --baseUrl to target a local or other OpenAI-compatible endpoint; omit it to use the AI Gateway model string.',
|
|
783
|
+
options: withBaseOptions({
|
|
784
|
+
model: z
|
|
785
|
+
.string()
|
|
786
|
+
.min(1)
|
|
787
|
+
.describe('Model id to use, such as anthropic/claude-sonnet-4.5 or a local model id.'),
|
|
788
|
+
baseUrl: z
|
|
789
|
+
.string()
|
|
790
|
+
.min(1)
|
|
791
|
+
.optional()
|
|
792
|
+
.describe('Optional OpenAI-compatible base URL for local or custom model endpoints.'),
|
|
793
|
+
apiKey: z
|
|
794
|
+
.string()
|
|
795
|
+
.min(1)
|
|
796
|
+
.optional()
|
|
797
|
+
.describe('Optional explicit API key for OpenAI-compatible model endpoints.'),
|
|
798
|
+
apiKeyEnv: z
|
|
799
|
+
.string()
|
|
800
|
+
.min(1)
|
|
801
|
+
.optional()
|
|
802
|
+
.describe('Optional environment variable name that stores the API key.'),
|
|
803
|
+
providerName: z
|
|
804
|
+
.string()
|
|
805
|
+
.min(1)
|
|
806
|
+
.optional()
|
|
807
|
+
.describe('Optional stable provider label for OpenAI-compatible endpoints.'),
|
|
808
|
+
headersJson: z
|
|
809
|
+
.string()
|
|
810
|
+
.min(1)
|
|
811
|
+
.optional()
|
|
812
|
+
.describe('Optional JSON object of extra HTTP headers for OpenAI-compatible endpoints.'),
|
|
813
|
+
apply: z
|
|
814
|
+
.boolean()
|
|
815
|
+
.optional()
|
|
816
|
+
.describe('Execute the planned tool calls instead of previewing them.'),
|
|
817
|
+
}),
|
|
818
|
+
output: inboxModelRouteResultSchema,
|
|
819
|
+
async run(context) {
|
|
820
|
+
return routeInboxCaptureWithModel({
|
|
821
|
+
inboxServices: services,
|
|
822
|
+
requestId: requestIdFromOptions(context.options),
|
|
823
|
+
captureId: context.args.captureId,
|
|
824
|
+
vault: context.options.vault,
|
|
825
|
+
vaultServices,
|
|
826
|
+
apply: context.options.apply,
|
|
827
|
+
modelSpec: {
|
|
828
|
+
model: context.options.model,
|
|
829
|
+
baseUrl: context.options.baseUrl,
|
|
830
|
+
apiKey: context.options.apiKey,
|
|
831
|
+
apiKeyEnv: context.options.apiKeyEnv,
|
|
832
|
+
providerName: context.options.providerName,
|
|
833
|
+
headers: parseHeadersJsonOption(context.options.headersJson),
|
|
834
|
+
},
|
|
835
|
+
});
|
|
836
|
+
},
|
|
837
|
+
});
|
|
838
|
+
inbox.command(model);
|
|
839
|
+
cli.command(inbox);
|
|
840
|
+
}
|
|
841
|
+
//# sourceMappingURL=inbox.js.map
|