@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,759 @@
|
|
|
1
|
+
import { Cli, z } from 'incur';
|
|
2
|
+
import { createHealthScaffoldResultSchema, hasHealthCommandDescriptor, healthEntityDescriptorByCommandName, healthListResultSchema, healthShowResultSchema, } from '@murphai/assistant-core/health-cli-descriptors';
|
|
3
|
+
import { registerAssistantCommands } from './commands/assistant.js';
|
|
4
|
+
import { registerAuditCommands } from './commands/audit.js';
|
|
5
|
+
import { registerDeviceCommands } from './commands/device.js';
|
|
6
|
+
import { registerDocumentCommands } from './commands/document.js';
|
|
7
|
+
import { registerEventCommands } from './commands/event.js';
|
|
8
|
+
import { registerExperimentCommands } from './commands/experiment.js';
|
|
9
|
+
import { registerInterventionCommands } from './commands/intervention.js';
|
|
10
|
+
import { registerExportCommands } from './commands/export.js';
|
|
11
|
+
import { createHealthUpsertResultSchema, registerHealthEntityCrudGroup, } from './commands/health-entity-command-registry.js';
|
|
12
|
+
import { registerInboxCommands } from './commands/inbox.js';
|
|
13
|
+
import { registerIntakeCommands } from './commands/intake.js';
|
|
14
|
+
import { registerJournalCommands } from './commands/journal.js';
|
|
15
|
+
import { registerMealCommands } from './commands/meal.js';
|
|
16
|
+
import { registerProfileCommands } from './commands/profile.js';
|
|
17
|
+
import { registerRecipeCommands } from './commands/recipe.js';
|
|
18
|
+
import { registerProviderCommands } from './commands/provider.js';
|
|
19
|
+
import { registerFoodCommands } from './commands/food.js';
|
|
20
|
+
import { registerResearchCommands } from './commands/research.js';
|
|
21
|
+
import { researchRunResultSchema } from './research-cli-contracts.js';
|
|
22
|
+
import { registerReadCommands } from './commands/read.js';
|
|
23
|
+
import { registerProtocolCommands } from './commands/protocol.js';
|
|
24
|
+
import { registerSamplesCommands } from './commands/samples.js';
|
|
25
|
+
import { registerSearchCommands } from './commands/search.js';
|
|
26
|
+
import { registerSupplementCommands } from './commands/supplement.js';
|
|
27
|
+
import { registerVaultCommands } from './commands/vault.js';
|
|
28
|
+
import { registerWorkoutCommands } from './commands/workout.js';
|
|
29
|
+
const genericHealthRootCommandNames = [
|
|
30
|
+
'goal',
|
|
31
|
+
'condition',
|
|
32
|
+
'allergy',
|
|
33
|
+
'history',
|
|
34
|
+
'blood-test',
|
|
35
|
+
'family',
|
|
36
|
+
'genetics',
|
|
37
|
+
];
|
|
38
|
+
function orderedUniqueStrings(values) {
|
|
39
|
+
const seen = new Set();
|
|
40
|
+
const uniqueValues = [];
|
|
41
|
+
for (const value of values) {
|
|
42
|
+
if (!seen.has(value)) {
|
|
43
|
+
seen.add(value);
|
|
44
|
+
uniqueValues.push(value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return uniqueValues;
|
|
48
|
+
}
|
|
49
|
+
function requireHealthCommandDescriptor(commandName) {
|
|
50
|
+
const descriptor = healthEntityDescriptorByCommandName.get(commandName);
|
|
51
|
+
if (!descriptor || !hasHealthCommandDescriptor(descriptor)) {
|
|
52
|
+
throw new Error(`No health command descriptor exists for "${commandName}".`);
|
|
53
|
+
}
|
|
54
|
+
return descriptor;
|
|
55
|
+
}
|
|
56
|
+
function createHealthLeafCommands(descriptor) {
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
path: [descriptor.command.commandName, 'list'],
|
|
60
|
+
description: descriptor.command.descriptions.list,
|
|
61
|
+
examples: descriptor.command.examples?.list,
|
|
62
|
+
hint: descriptor.command.hints?.list,
|
|
63
|
+
output: healthListResultSchema,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: [descriptor.command.commandName, 'scaffold'],
|
|
67
|
+
description: descriptor.command.descriptions.scaffold,
|
|
68
|
+
examples: descriptor.command.examples?.scaffold,
|
|
69
|
+
hint: descriptor.command.hints?.scaffold,
|
|
70
|
+
output: createHealthScaffoldResultSchema(descriptor.core.scaffoldNoun),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: [descriptor.command.commandName, 'show'],
|
|
74
|
+
description: descriptor.command.descriptions.show,
|
|
75
|
+
examples: descriptor.command.examples?.show,
|
|
76
|
+
hint: descriptor.command.hints?.show,
|
|
77
|
+
output: healthShowResultSchema,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: [descriptor.command.commandName, 'upsert'],
|
|
81
|
+
description: descriptor.command.descriptions.upsert,
|
|
82
|
+
examples: descriptor.command.examples?.upsert,
|
|
83
|
+
hint: descriptor.command.hints?.upsert,
|
|
84
|
+
output: createHealthUpsertResultSchema(descriptor),
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
function mergeDirectVaultServiceBindings(...bindings) {
|
|
89
|
+
const mergedBindings = {};
|
|
90
|
+
for (const binding of bindings) {
|
|
91
|
+
if (!binding) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
for (const [groupName, methodNames] of Object.entries(binding)) {
|
|
95
|
+
const existingMethodNames = mergedBindings[groupName] ?? [];
|
|
96
|
+
mergedBindings[groupName] = orderedUniqueStrings([
|
|
97
|
+
...existingMethodNames,
|
|
98
|
+
...methodNames,
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (Object.keys(mergedBindings).length === 0) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return mergedBindings;
|
|
106
|
+
}
|
|
107
|
+
function buildHealthCommandManifestDescriptor(input) {
|
|
108
|
+
const descriptor = requireHealthCommandDescriptor(input.commandName);
|
|
109
|
+
return {
|
|
110
|
+
id: `health:${input.commandName}`,
|
|
111
|
+
bindingMode: 'direct',
|
|
112
|
+
rootCommandNames: [input.commandName],
|
|
113
|
+
leafCommands: createHealthLeafCommands(descriptor),
|
|
114
|
+
directVaultServiceBindings: mergeDirectVaultServiceBindings({
|
|
115
|
+
core: [
|
|
116
|
+
descriptor.core.scaffoldServiceMethod,
|
|
117
|
+
descriptor.core.upsertServiceMethod,
|
|
118
|
+
],
|
|
119
|
+
query: [
|
|
120
|
+
descriptor.query.showServiceMethod,
|
|
121
|
+
descriptor.query.listServiceMethod,
|
|
122
|
+
],
|
|
123
|
+
}, input.additionalVaultServiceBindings),
|
|
124
|
+
register: input.register,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const genericHealthCommandDescriptors = genericHealthRootCommandNames.map((commandName) => buildHealthCommandManifestDescriptor({
|
|
128
|
+
commandName,
|
|
129
|
+
register({ cli, services }) {
|
|
130
|
+
registerHealthEntityCrudGroup(cli, services, commandName);
|
|
131
|
+
},
|
|
132
|
+
}));
|
|
133
|
+
export const vaultCliCommandDescriptors = [
|
|
134
|
+
{
|
|
135
|
+
id: 'vault',
|
|
136
|
+
bindingMode: 'direct',
|
|
137
|
+
rootCommandNames: ['init', 'validate', 'vault'],
|
|
138
|
+
directVaultServiceBindings: {
|
|
139
|
+
core: ['init', 'validate', 'updateVault', 'repairVault'],
|
|
140
|
+
query: ['showVault', 'showVaultPaths', 'showVaultStats'],
|
|
141
|
+
},
|
|
142
|
+
register({ cli, services }) {
|
|
143
|
+
registerVaultCommands(cli, services);
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'assistant',
|
|
148
|
+
bindingMode: 'indirect',
|
|
149
|
+
rootCommandNames: ['assistant', 'chat', 'run', 'status', 'doctor', 'stop'],
|
|
150
|
+
register({ cli, services, inboxServices }) {
|
|
151
|
+
registerAssistantCommands(cli, inboxServices, services);
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'audit',
|
|
156
|
+
bindingMode: 'none',
|
|
157
|
+
rootCommandNames: ['audit'],
|
|
158
|
+
register({ cli, services }) {
|
|
159
|
+
registerAuditCommands(cli, services);
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'document',
|
|
164
|
+
bindingMode: 'direct',
|
|
165
|
+
rootCommandNames: ['document'],
|
|
166
|
+
leafCommands: [
|
|
167
|
+
{
|
|
168
|
+
path: ['document', 'import'],
|
|
169
|
+
description: 'Import one document artifact as a canonical document event plus immutable raw artifacts.',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
path: ['document', 'show'],
|
|
173
|
+
description: 'Show one imported document by document id or canonical event id.',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
path: ['document', 'list'],
|
|
177
|
+
description: 'List imported document events within an optional date range.',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
path: ['document', 'manifest'],
|
|
181
|
+
description: 'Show the immutable raw-import manifest for one imported document.',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
path: ['document', 'edit'],
|
|
185
|
+
description: 'Edit one imported document event by merging a partial JSON patch or path assignments.',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
path: ['document', 'delete'],
|
|
189
|
+
description: 'Delete one imported document event while leaving immutable raw artifacts on disk.',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
directVaultServiceBindings: {
|
|
193
|
+
importers: ['importDocument'],
|
|
194
|
+
query: ['showDocument', 'listDocuments', 'showDocumentManifest'],
|
|
195
|
+
},
|
|
196
|
+
register({ cli, services }) {
|
|
197
|
+
registerDocumentCommands(cli, services);
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 'device',
|
|
202
|
+
bindingMode: 'direct',
|
|
203
|
+
rootCommandNames: ['device'],
|
|
204
|
+
directVaultServiceBindings: {
|
|
205
|
+
devices: [
|
|
206
|
+
'listProviders',
|
|
207
|
+
'connect',
|
|
208
|
+
'listAccounts',
|
|
209
|
+
'showAccount',
|
|
210
|
+
'reconcileAccount',
|
|
211
|
+
'disconnectAccount',
|
|
212
|
+
'daemonStatus',
|
|
213
|
+
'daemonStart',
|
|
214
|
+
'daemonStop',
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
register({ cli, services }) {
|
|
218
|
+
registerDeviceCommands(cli, services);
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 'meal',
|
|
223
|
+
bindingMode: 'none',
|
|
224
|
+
rootCommandNames: ['meal'],
|
|
225
|
+
leafCommands: [
|
|
226
|
+
{
|
|
227
|
+
path: ['meal', 'add'],
|
|
228
|
+
description: 'Record one meal from raw photo/audio artifacts or a freeform note.',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
path: ['meal', 'show'],
|
|
232
|
+
description: 'Show one meal by meal id or canonical event id.',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
path: ['meal', 'list'],
|
|
236
|
+
description: 'List meal events within an optional date range.',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
path: ['meal', 'manifest'],
|
|
240
|
+
description: 'Show the immutable raw-import manifest for one recorded meal.',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
path: ['meal', 'edit'],
|
|
244
|
+
description: 'Edit one meal event by merging a partial JSON patch or path assignments.',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
path: ['meal', 'delete'],
|
|
248
|
+
description: 'Delete one meal event while leaving immutable raw artifacts on disk.',
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
register({ cli, services }) {
|
|
252
|
+
registerMealCommands(cli, services);
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 'workout',
|
|
257
|
+
bindingMode: 'none',
|
|
258
|
+
rootCommandNames: ['workout'],
|
|
259
|
+
leafCommands: [
|
|
260
|
+
{
|
|
261
|
+
path: ['workout', 'add'],
|
|
262
|
+
description: 'Record one workout from a freeform note with lightweight structured inference.',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
path: ['workout', 'edit'],
|
|
266
|
+
description: 'Edit one saved workout activity event by merging a partial JSON patch or path assignments.',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
path: ['workout', 'delete'],
|
|
270
|
+
description: 'Delete one workout activity event.',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
path: ['workout', 'format', 'save'],
|
|
274
|
+
description: 'Save or update one reusable workout format from a name plus workout text.',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
path: ['workout', 'format', 'show'],
|
|
278
|
+
description: 'Show one saved workout format by name, slug, or id.',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
path: ['workout', 'format', 'list'],
|
|
282
|
+
description: 'List saved workout formats.',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
path: ['workout', 'format', 'log'],
|
|
286
|
+
description: 'Log one dated workout from a saved workout format through the same canonical event path as workout add.',
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
register({ cli, services }) {
|
|
290
|
+
registerWorkoutCommands(cli, services);
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: 'intervention',
|
|
295
|
+
bindingMode: 'none',
|
|
296
|
+
rootCommandNames: ['intervention'],
|
|
297
|
+
leafCommands: [
|
|
298
|
+
{
|
|
299
|
+
path: ['intervention', 'add'],
|
|
300
|
+
description: 'Record one intervention session from a freeform note with lightweight structured inference.',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
path: ['intervention', 'edit'],
|
|
304
|
+
description: 'Edit one saved intervention session event by merging a partial JSON patch or path assignments.',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
path: ['intervention', 'delete'],
|
|
308
|
+
description: 'Delete one intervention_session event.',
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
register({ cli, services }) {
|
|
312
|
+
registerInterventionCommands(cli, services);
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 'provider',
|
|
317
|
+
bindingMode: 'direct',
|
|
318
|
+
rootCommandNames: ['provider'],
|
|
319
|
+
leafCommands: [
|
|
320
|
+
{
|
|
321
|
+
path: ['provider', 'scaffold'],
|
|
322
|
+
description: 'Emit a provider payload template for `provider upsert`.',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
path: ['provider', 'show'],
|
|
326
|
+
description: 'Show one provider by canonical id or slug.',
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
path: ['provider', 'list'],
|
|
330
|
+
description: 'List provider records with an optional status filter.',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
path: ['provider', 'upsert'],
|
|
334
|
+
description: 'Create or update one provider Markdown record from a JSON payload file or stdin.',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
path: ['provider', 'edit'],
|
|
338
|
+
description: 'Edit one provider by merging a partial JSON patch or path assignments.',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
path: ['provider', 'delete'],
|
|
342
|
+
description: 'Delete one provider Markdown record.',
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
directVaultServiceBindings: {
|
|
346
|
+
core: ['scaffoldProvider', 'upsertProvider'],
|
|
347
|
+
query: ['showProvider', 'listProviders'],
|
|
348
|
+
},
|
|
349
|
+
register({ cli, services }) {
|
|
350
|
+
registerProviderCommands(cli, services);
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: 'recipe',
|
|
355
|
+
bindingMode: 'direct',
|
|
356
|
+
rootCommandNames: ['recipe'],
|
|
357
|
+
leafCommands: [
|
|
358
|
+
{
|
|
359
|
+
path: ['recipe', 'scaffold'],
|
|
360
|
+
description: 'Emit a recipe payload template for `recipe upsert`.',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
path: ['recipe', 'show'],
|
|
364
|
+
description: 'Show one recipe by canonical id or slug.',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
path: ['recipe', 'list'],
|
|
368
|
+
description: 'List recipe records with an optional status filter.',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
path: ['recipe', 'upsert'],
|
|
372
|
+
description: 'Create or update one recipe Markdown record from a JSON payload file or stdin.',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
path: ['recipe', 'edit'],
|
|
376
|
+
description: 'Edit one recipe by merging a partial JSON patch or path assignments.',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
path: ['recipe', 'delete'],
|
|
380
|
+
description: 'Delete one recipe Markdown record.',
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
directVaultServiceBindings: {
|
|
384
|
+
core: ['scaffoldRecipe', 'upsertRecipe'],
|
|
385
|
+
query: ['showRecipe', 'listRecipes'],
|
|
386
|
+
},
|
|
387
|
+
register({ cli, services }) {
|
|
388
|
+
registerRecipeCommands(cli, services);
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: 'food',
|
|
393
|
+
bindingMode: 'direct',
|
|
394
|
+
rootCommandNames: ['food'],
|
|
395
|
+
leafCommands: [
|
|
396
|
+
{
|
|
397
|
+
path: ['food', 'list'],
|
|
398
|
+
description: 'List food records with an optional status filter.',
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
path: ['food', 'scaffold'],
|
|
402
|
+
description: 'Emit a food payload template for `food upsert`.',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
path: ['food', 'show'],
|
|
406
|
+
description: 'Show one food by canonical id or slug.',
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
path: ['food', 'upsert'],
|
|
410
|
+
description: 'Create or update one food Markdown record from a JSON payload file or stdin.',
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
path: ['food', 'edit'],
|
|
414
|
+
description: 'Edit one food by merging a partial JSON patch or path assignments.',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
path: ['food', 'delete'],
|
|
418
|
+
description: 'Delete one remembered food Markdown record.',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
path: ['food', 'schedule'],
|
|
422
|
+
description: 'Schedule one remembered food for daily auto-log meal creation.',
|
|
423
|
+
},
|
|
424
|
+
],
|
|
425
|
+
directVaultServiceBindings: {
|
|
426
|
+
core: ['scaffoldFood', 'upsertFood', 'addDailyFood'],
|
|
427
|
+
query: ['showFood', 'listFoods'],
|
|
428
|
+
},
|
|
429
|
+
register({ cli, services }) {
|
|
430
|
+
registerFoodCommands(cli, services);
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: 'event',
|
|
435
|
+
bindingMode: 'direct',
|
|
436
|
+
rootCommandNames: ['event'],
|
|
437
|
+
leafCommands: [
|
|
438
|
+
{
|
|
439
|
+
path: ['event', 'list'],
|
|
440
|
+
description: 'List canonical event records with optional date, tag, and experiment filters.',
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
path: ['event', 'scaffold'],
|
|
444
|
+
description: 'Emit an event payload template for one supported canonical event kind.',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
path: ['event', 'show'],
|
|
448
|
+
description: 'Show one canonical event by event id.',
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
path: ['event', 'upsert'],
|
|
452
|
+
description: 'Create or update one canonical event from a JSON payload file or stdin.',
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
path: ['event', 'edit'],
|
|
456
|
+
description: 'Edit one canonical event by merging a partial JSON patch or path assignments.',
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
path: ['event', 'delete'],
|
|
460
|
+
description: 'Delete one canonical event by event id.',
|
|
461
|
+
},
|
|
462
|
+
],
|
|
463
|
+
directVaultServiceBindings: {
|
|
464
|
+
core: ['scaffoldEvent', 'upsertEvent'],
|
|
465
|
+
query: ['showEvent', 'listEvents'],
|
|
466
|
+
},
|
|
467
|
+
register({ cli, services }) {
|
|
468
|
+
registerEventCommands(cli, services);
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
id: 'samples',
|
|
473
|
+
bindingMode: 'direct',
|
|
474
|
+
rootCommandNames: ['samples'],
|
|
475
|
+
directVaultServiceBindings: {
|
|
476
|
+
core: ['addSamples'],
|
|
477
|
+
},
|
|
478
|
+
register({ cli, services }) {
|
|
479
|
+
registerSamplesCommands(cli, services);
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: 'experiment',
|
|
484
|
+
bindingMode: 'direct',
|
|
485
|
+
rootCommandNames: ['experiment'],
|
|
486
|
+
directVaultServiceBindings: {
|
|
487
|
+
core: [
|
|
488
|
+
'createExperiment',
|
|
489
|
+
'updateExperiment',
|
|
490
|
+
'checkpointExperiment',
|
|
491
|
+
'stopExperiment',
|
|
492
|
+
],
|
|
493
|
+
query: ['showExperiment', 'listExperiments'],
|
|
494
|
+
},
|
|
495
|
+
register({ cli, services }) {
|
|
496
|
+
registerExperimentCommands(cli, services);
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: 'journal',
|
|
501
|
+
bindingMode: 'direct',
|
|
502
|
+
rootCommandNames: ['journal'],
|
|
503
|
+
directVaultServiceBindings: {
|
|
504
|
+
core: [
|
|
505
|
+
'ensureJournal',
|
|
506
|
+
'appendJournal',
|
|
507
|
+
'linkJournalEvents',
|
|
508
|
+
'unlinkJournalEvents',
|
|
509
|
+
'linkJournalStreams',
|
|
510
|
+
'unlinkJournalStreams',
|
|
511
|
+
],
|
|
512
|
+
query: ['showJournal', 'listJournals'],
|
|
513
|
+
},
|
|
514
|
+
register({ cli, services }) {
|
|
515
|
+
registerJournalCommands(cli, services);
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
id: 'read',
|
|
520
|
+
bindingMode: 'direct',
|
|
521
|
+
rootCommandNames: ['show', 'list'],
|
|
522
|
+
directVaultServiceBindings: {
|
|
523
|
+
query: ['show', 'list'],
|
|
524
|
+
},
|
|
525
|
+
register({ cli, services }) {
|
|
526
|
+
registerReadCommands(cli, services);
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
id: 'search',
|
|
531
|
+
bindingMode: 'none',
|
|
532
|
+
rootCommandNames: ['search', 'timeline'],
|
|
533
|
+
register({ cli, services }) {
|
|
534
|
+
registerSearchCommands(cli, services);
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: 'research',
|
|
539
|
+
bindingMode: 'none',
|
|
540
|
+
rootCommandNames: ['research', 'deepthink'],
|
|
541
|
+
leafCommands: [
|
|
542
|
+
{
|
|
543
|
+
path: ['research'],
|
|
544
|
+
description: 'Run ChatGPT Deep Research through review:gpt, auto-send the staged prompt, wait for the response, and save the markdown note into research/ inside the vault. These runs commonly take 10 to 60 minutes.',
|
|
545
|
+
output: researchRunResultSchema,
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
path: ['deepthink'],
|
|
549
|
+
description: 'Run GPT Pro through review:gpt, auto-send the staged prompt, wait for the response, and save the markdown note into research/ inside the vault.',
|
|
550
|
+
output: researchRunResultSchema,
|
|
551
|
+
},
|
|
552
|
+
],
|
|
553
|
+
register({ cli }) {
|
|
554
|
+
registerResearchCommands(cli);
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: 'export',
|
|
559
|
+
bindingMode: 'direct',
|
|
560
|
+
rootCommandNames: ['export'],
|
|
561
|
+
directVaultServiceBindings: {
|
|
562
|
+
query: ['exportPack'],
|
|
563
|
+
},
|
|
564
|
+
register({ cli, services }) {
|
|
565
|
+
registerExportCommands(cli, services);
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
id: 'intake',
|
|
570
|
+
bindingMode: 'direct',
|
|
571
|
+
rootCommandNames: ['intake'],
|
|
572
|
+
directVaultServiceBindings: {
|
|
573
|
+
core: ['projectAssessment'],
|
|
574
|
+
query: ['show', 'list'],
|
|
575
|
+
},
|
|
576
|
+
register({ cli, services }) {
|
|
577
|
+
registerIntakeCommands(cli, services);
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
id: 'inbox',
|
|
582
|
+
bindingMode: 'direct',
|
|
583
|
+
rootCommandNames: ['inbox'],
|
|
584
|
+
directInboxServiceBindings: [
|
|
585
|
+
'init',
|
|
586
|
+
'bootstrap',
|
|
587
|
+
'setup',
|
|
588
|
+
'sourceAdd',
|
|
589
|
+
'sourceList',
|
|
590
|
+
'sourceRemove',
|
|
591
|
+
'doctor',
|
|
592
|
+
'parse',
|
|
593
|
+
'requeue',
|
|
594
|
+
'backfill',
|
|
595
|
+
'run',
|
|
596
|
+
'status',
|
|
597
|
+
'stop',
|
|
598
|
+
'list',
|
|
599
|
+
'show',
|
|
600
|
+
'search',
|
|
601
|
+
'listAttachments',
|
|
602
|
+
'showAttachment',
|
|
603
|
+
'showAttachmentStatus',
|
|
604
|
+
'parseAttachment',
|
|
605
|
+
'reparseAttachment',
|
|
606
|
+
'promoteMeal',
|
|
607
|
+
'promoteDocument',
|
|
608
|
+
'promoteJournal',
|
|
609
|
+
'promoteExperimentNote',
|
|
610
|
+
],
|
|
611
|
+
register({ cli, services, inboxServices }) {
|
|
612
|
+
registerInboxCommands(cli, inboxServices, services);
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
buildHealthCommandManifestDescriptor({
|
|
616
|
+
commandName: 'profile',
|
|
617
|
+
additionalVaultServiceBindings: {
|
|
618
|
+
core: ['rebuildCurrentProfile'],
|
|
619
|
+
},
|
|
620
|
+
register({ cli, services }) {
|
|
621
|
+
registerProfileCommands(cli, services);
|
|
622
|
+
},
|
|
623
|
+
}),
|
|
624
|
+
...genericHealthCommandDescriptors,
|
|
625
|
+
{
|
|
626
|
+
id: 'supplement',
|
|
627
|
+
bindingMode: 'direct',
|
|
628
|
+
rootCommandNames: ['supplement'],
|
|
629
|
+
leafCommands: [
|
|
630
|
+
{
|
|
631
|
+
path: ['supplement', 'list'],
|
|
632
|
+
description: 'List supplements through the health read model.',
|
|
633
|
+
output: healthListResultSchema,
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
path: ['supplement', 'scaffold'],
|
|
637
|
+
description: 'Emit a payload template for one supplement product.',
|
|
638
|
+
output: createHealthScaffoldResultSchema('supplement'),
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
path: ['supplement', 'show'],
|
|
642
|
+
description: 'Show one supplement by canonical id or slug.',
|
|
643
|
+
output: healthShowResultSchema,
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
path: ['supplement', 'upsert'],
|
|
647
|
+
description: 'Upsert one supplement from a JSON payload file or stdin.',
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
path: ['supplement', 'stop'],
|
|
651
|
+
description: 'Stop one supplement while preserving its canonical id.',
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
path: ['supplement', 'compound', 'list'],
|
|
655
|
+
description: 'List rolled-up supplement compounds across supplements.',
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
path: ['supplement', 'compound', 'show'],
|
|
659
|
+
description: 'Show one rolled-up supplement compound by name or lookup id.',
|
|
660
|
+
},
|
|
661
|
+
],
|
|
662
|
+
directVaultServiceBindings: {
|
|
663
|
+
core: ['scaffoldSupplement', 'upsertSupplement', 'stopSupplement'],
|
|
664
|
+
query: [
|
|
665
|
+
'showSupplement',
|
|
666
|
+
'listSupplements',
|
|
667
|
+
'showSupplementCompound',
|
|
668
|
+
'listSupplementCompounds',
|
|
669
|
+
],
|
|
670
|
+
},
|
|
671
|
+
register({ cli, services }) {
|
|
672
|
+
registerSupplementCommands(cli, services);
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
buildHealthCommandManifestDescriptor({
|
|
676
|
+
commandName: 'protocol',
|
|
677
|
+
additionalVaultServiceBindings: {
|
|
678
|
+
core: ['stopProtocol'],
|
|
679
|
+
},
|
|
680
|
+
register({ cli, services }) {
|
|
681
|
+
registerProtocolCommands(cli, services);
|
|
682
|
+
},
|
|
683
|
+
}),
|
|
684
|
+
];
|
|
685
|
+
function assertValidVaultCliCommandManifest(descriptors) {
|
|
686
|
+
const descriptorIds = orderedUniqueStrings(descriptors.map((descriptor) => descriptor.id));
|
|
687
|
+
if (descriptorIds.length !== descriptors.length) {
|
|
688
|
+
throw new Error('vaultCliCommandDescriptors contains duplicate descriptor ids.');
|
|
689
|
+
}
|
|
690
|
+
const rootCommandNames = orderedUniqueStrings(descriptors.flatMap((descriptor) => [...descriptor.rootCommandNames]));
|
|
691
|
+
const expectedRootCommandCount = descriptors.reduce((count, descriptor) => count + descriptor.rootCommandNames.length, 0);
|
|
692
|
+
if (rootCommandNames.length !== expectedRootCommandCount) {
|
|
693
|
+
throw new Error('vaultCliCommandDescriptors contains duplicate root command names.');
|
|
694
|
+
}
|
|
695
|
+
for (const descriptor of descriptors) {
|
|
696
|
+
if (descriptor.bindingMode !== 'direct') {
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
const directVaultServiceBindings = 'directVaultServiceBindings' in descriptor
|
|
700
|
+
? descriptor.directVaultServiceBindings
|
|
701
|
+
: undefined;
|
|
702
|
+
const directInboxServiceBindings = 'directInboxServiceBindings' in descriptor
|
|
703
|
+
? descriptor.directInboxServiceBindings
|
|
704
|
+
: undefined;
|
|
705
|
+
const hasVaultBindings = Object.keys(directVaultServiceBindings ?? {}).length > 0;
|
|
706
|
+
const hasInboxBindings = (directInboxServiceBindings?.length ?? 0) > 0;
|
|
707
|
+
if (!hasVaultBindings && !hasInboxBindings) {
|
|
708
|
+
throw new Error(`Descriptor "${descriptor.id}" is marked direct but declares no direct service bindings.`);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
assertValidVaultCliCommandManifest(vaultCliCommandDescriptors);
|
|
713
|
+
export function registerVaultCliCommandDescriptors(input) {
|
|
714
|
+
for (const descriptor of vaultCliCommandDescriptors) {
|
|
715
|
+
descriptor.register(input);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
export function collectVaultCliDescriptorRootCommandNames() {
|
|
719
|
+
return orderedUniqueStrings(vaultCliCommandDescriptors.flatMap((descriptor) => [...descriptor.rootCommandNames]));
|
|
720
|
+
}
|
|
721
|
+
export function collectVaultCliDirectServiceBindings() {
|
|
722
|
+
const vaultBindings = {
|
|
723
|
+
core: [],
|
|
724
|
+
importers: [],
|
|
725
|
+
query: [],
|
|
726
|
+
devices: [],
|
|
727
|
+
};
|
|
728
|
+
const inboxBindings = [];
|
|
729
|
+
for (const descriptor of vaultCliCommandDescriptors) {
|
|
730
|
+
if (descriptor.bindingMode !== 'direct') {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
const directVaultServiceBindings = 'directVaultServiceBindings' in descriptor
|
|
734
|
+
? descriptor.directVaultServiceBindings
|
|
735
|
+
: undefined;
|
|
736
|
+
for (const [groupName, methodNames] of Object.entries(directVaultServiceBindings ?? {})) {
|
|
737
|
+
vaultBindings[groupName] = orderedUniqueStrings([
|
|
738
|
+
...vaultBindings[groupName],
|
|
739
|
+
...methodNames,
|
|
740
|
+
]);
|
|
741
|
+
}
|
|
742
|
+
const directInboxServiceBindings = 'directInboxServiceBindings' in descriptor
|
|
743
|
+
? descriptor.directInboxServiceBindings
|
|
744
|
+
: undefined;
|
|
745
|
+
if (directInboxServiceBindings) {
|
|
746
|
+
inboxBindings.push(...directInboxServiceBindings);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
return {
|
|
750
|
+
inbox: orderedUniqueStrings(inboxBindings),
|
|
751
|
+
vault: {
|
|
752
|
+
core: vaultBindings.core,
|
|
753
|
+
importers: vaultBindings.importers,
|
|
754
|
+
query: vaultBindings.query,
|
|
755
|
+
devices: vaultBindings.devices,
|
|
756
|
+
},
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
//# sourceMappingURL=vault-cli-command-manifest.js.map
|