gnosys 5.11.4 → 5.12.2
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/dist/cli.js +377 -5162
- package/dist/index.js +542 -244
- package/dist/lib/addCommand.d.ts +9 -0
- package/dist/lib/addCommand.js +102 -0
- package/dist/lib/addStructuredCommand.d.ts +16 -0
- package/dist/lib/addStructuredCommand.js +103 -0
- package/dist/lib/ambiguityCommand.d.ts +4 -0
- package/dist/lib/ambiguityCommand.js +36 -0
- package/dist/lib/apiKeyVault.d.ts +78 -0
- package/dist/lib/apiKeyVault.js +447 -0
- package/dist/lib/archive.js +0 -2
- package/dist/lib/askCommand.d.ts +13 -0
- package/dist/lib/askCommand.js +145 -0
- package/dist/lib/attachCommand.d.ts +17 -0
- package/dist/lib/attachCommand.js +66 -0
- package/dist/lib/attachments.d.ts +43 -2
- package/dist/lib/attachments.js +81 -2
- package/dist/lib/audioExtract.js +4 -1
- package/dist/lib/auditCommand.d.ts +7 -0
- package/dist/lib/auditCommand.js +27 -0
- package/dist/lib/backupCommand.d.ts +6 -0
- package/dist/lib/backupCommand.js +54 -0
- package/dist/lib/bootstrapCommand.d.ts +15 -0
- package/dist/lib/bootstrapCommand.js +51 -0
- package/dist/lib/briefingCommand.d.ts +7 -0
- package/dist/lib/briefingCommand.js +92 -0
- package/dist/lib/centralizeCommand.d.ts +5 -0
- package/dist/lib/centralizeCommand.js +16 -0
- package/dist/lib/chat/choose.js +2 -2
- package/dist/lib/chatCommand.d.ts +12 -0
- package/dist/lib/chatCommand.js +46 -0
- package/dist/lib/checkCommand.d.ts +4 -0
- package/dist/lib/checkCommand.js +133 -0
- package/dist/lib/clientReadOverlay.d.ts +27 -0
- package/dist/lib/clientReadOverlay.js +76 -0
- package/dist/lib/clientReadResolve.d.ts +32 -0
- package/dist/lib/clientReadResolve.js +84 -0
- package/dist/lib/commitContextCommand.d.ts +9 -0
- package/dist/lib/commitContextCommand.js +142 -0
- package/dist/lib/config.d.ts +41 -48
- package/dist/lib/config.js +58 -57
- package/dist/lib/configCommand.d.ts +10 -0
- package/dist/lib/configCommand.js +321 -0
- package/dist/lib/connectCommand.d.ts +8 -0
- package/dist/lib/connectCommand.js +19 -0
- package/dist/lib/db.d.ts +68 -1
- package/dist/lib/db.js +385 -120
- package/dist/lib/dbWrite.d.ts +1 -1
- package/dist/lib/dearchiveCommand.d.ts +7 -0
- package/dist/lib/dearchiveCommand.js +41 -0
- package/dist/lib/discoverCommand.d.ts +9 -0
- package/dist/lib/discoverCommand.js +87 -0
- package/dist/lib/doctorCommand.d.ts +6 -0
- package/dist/lib/doctorCommand.js +256 -0
- package/dist/lib/docxExtract.js +1 -1
- package/dist/lib/dream.d.ts +50 -2
- package/dist/lib/dream.js +324 -30
- package/dist/lib/dreamCommand.d.ts +10 -0
- package/dist/lib/dreamCommand.js +195 -0
- package/dist/lib/dreamLaunchd.d.ts +2 -0
- package/dist/lib/dreamLaunchd.js +72 -0
- package/dist/lib/dreamLogCommand.d.ts +10 -0
- package/dist/lib/dreamLogCommand.js +58 -0
- package/dist/lib/dreamReport.d.ts +7 -0
- package/dist/lib/dreamReport.js +114 -0
- package/dist/lib/dreamRunLog.d.ts +121 -0
- package/dist/lib/dreamRunLog.js +234 -0
- package/dist/lib/embeddings.js +3 -3
- package/dist/lib/exportCommand.d.ts +18 -0
- package/dist/lib/exportCommand.js +101 -0
- package/dist/lib/exportProject.d.ts +3 -2
- package/dist/lib/exportProject.js +2 -1
- package/dist/lib/federated.js +1 -1
- package/dist/lib/fsearchCommand.d.ts +8 -0
- package/dist/lib/fsearchCommand.js +44 -0
- package/dist/lib/graphCommand.d.ts +4 -0
- package/dist/lib/graphCommand.js +68 -0
- package/dist/lib/helperGenerateCommand.d.ts +5 -0
- package/dist/lib/helperGenerateCommand.js +27 -0
- package/dist/lib/historyCommand.d.ts +5 -0
- package/dist/lib/historyCommand.js +51 -0
- package/dist/lib/hybridSearchCommand.d.ts +12 -0
- package/dist/lib/hybridSearchCommand.js +95 -0
- package/dist/lib/importCommand.d.ts +16 -0
- package/dist/lib/importCommand.js +89 -0
- package/dist/lib/importProject.js +2 -1
- package/dist/lib/importProjectCommand.d.ts +6 -0
- package/dist/lib/importProjectCommand.js +43 -0
- package/dist/lib/ingestCommand.d.ts +13 -0
- package/dist/lib/ingestCommand.js +95 -0
- package/dist/lib/installOutput.d.ts +36 -0
- package/dist/lib/installOutput.js +55 -0
- package/dist/lib/lensCommand.d.ts +20 -0
- package/dist/lib/lensCommand.js +61 -0
- package/dist/lib/lensing.d.ts +1 -0
- package/dist/lib/lensing.js +50 -9
- package/dist/lib/linksCommand.d.ts +7 -0
- package/dist/lib/linksCommand.js +48 -0
- package/dist/lib/listCommand.d.ts +8 -0
- package/dist/lib/listCommand.js +74 -0
- package/dist/lib/llm.d.ts +1 -1
- package/dist/lib/llm.js +27 -9
- package/dist/lib/localDiskCheck.d.ts +17 -0
- package/dist/lib/localDiskCheck.js +54 -0
- package/dist/lib/lock.d.ts +1 -1
- package/dist/lib/lock.js +5 -3
- package/dist/lib/machineConfig.d.ts +11 -1
- package/dist/lib/machineConfig.js +16 -0
- package/dist/lib/machineRegistry.d.ts +61 -0
- package/dist/lib/machineRegistry.js +80 -0
- package/dist/lib/maintainCommand.d.ts +8 -0
- package/dist/lib/maintainCommand.js +34 -0
- package/dist/lib/masterLease.d.ts +20 -0
- package/dist/lib/masterLease.js +68 -0
- package/dist/lib/migrate.js +0 -1
- package/dist/lib/migrateCommand.d.ts +7 -0
- package/dist/lib/migrateCommand.js +158 -0
- package/dist/lib/migrateDbCommand.d.ts +9 -0
- package/dist/lib/migrateDbCommand.js +94 -0
- package/dist/lib/modelValidation.d.ts +5 -0
- package/dist/lib/modelValidation.js +27 -0
- package/dist/lib/multimodalIngest.js +1 -1
- package/dist/lib/openrouterTiers.d.ts +29 -0
- package/dist/lib/openrouterTiers.js +113 -0
- package/dist/lib/platform.d.ts +0 -6
- package/dist/lib/platform.js +0 -28
- package/dist/lib/prefCommand.d.ts +10 -0
- package/dist/lib/prefCommand.js +118 -0
- package/dist/lib/projectsCommand.d.ts +8 -0
- package/dist/lib/projectsCommand.js +131 -0
- package/dist/lib/readCommand.d.ts +7 -0
- package/dist/lib/readCommand.js +63 -0
- package/dist/lib/recall.d.ts +3 -0
- package/dist/lib/recall.js +19 -4
- package/dist/lib/recallCommand.d.ts +11 -0
- package/dist/lib/recallCommand.js +112 -0
- package/dist/lib/reflectCommand.d.ts +8 -0
- package/dist/lib/reflectCommand.js +61 -0
- package/dist/lib/reindexCommand.d.ts +4 -0
- package/dist/lib/reindexCommand.js +34 -0
- package/dist/lib/reindexGraphCommand.d.ts +4 -0
- package/dist/lib/reindexGraphCommand.js +12 -0
- package/dist/lib/reinforceCommand.d.ts +8 -0
- package/dist/lib/reinforceCommand.js +40 -0
- package/dist/lib/remote.d.ts +5 -1
- package/dist/lib/remote.js +5 -1
- package/dist/lib/remoteWizard.d.ts +24 -5
- package/dist/lib/remoteWizard.js +308 -319
- package/dist/lib/restoreCommand.d.ts +5 -0
- package/dist/lib/restoreCommand.js +35 -0
- package/dist/lib/rulesGen.d.ts +8 -0
- package/dist/lib/rulesGen.js +16 -0
- package/dist/lib/sandboxStartCommand.d.ts +6 -0
- package/dist/lib/sandboxStartCommand.js +25 -0
- package/dist/lib/sandboxStatusCommand.d.ts +4 -0
- package/dist/lib/sandboxStatusCommand.js +24 -0
- package/dist/lib/sandboxStopCommand.d.ts +4 -0
- package/dist/lib/sandboxStopCommand.js +21 -0
- package/dist/lib/search.d.ts +0 -2
- package/dist/lib/search.js +0 -7
- package/dist/lib/searchCommand.d.ts +9 -0
- package/dist/lib/searchCommand.js +90 -0
- package/dist/lib/semanticSearchCommand.d.ts +8 -0
- package/dist/lib/semanticSearchCommand.js +52 -0
- package/dist/lib/setup/configSetRender.js +2 -0
- package/dist/lib/setup/providerGlyphs.d.ts +19 -0
- package/dist/lib/setup/providerGlyphs.js +42 -0
- package/dist/lib/setup/remoteRender.d.ts +31 -1
- package/dist/lib/setup/remoteRender.js +95 -4
- package/dist/lib/setup/sections/providers.d.ts +17 -0
- package/dist/lib/setup/sections/providers.js +307 -0
- package/dist/lib/setup/sections/routing.d.ts +2 -6
- package/dist/lib/setup/sections/routing.js +67 -82
- package/dist/lib/setup/sections/taskRoutingEditor.d.ts +13 -0
- package/dist/lib/setup/sections/taskRoutingEditor.js +139 -0
- package/dist/lib/setup/summary.d.ts +9 -0
- package/dist/lib/setup/summary.js +51 -37
- package/dist/lib/setup/ui/header.js +0 -1
- package/dist/lib/setup.d.ts +105 -15
- package/dist/lib/setup.js +747 -287
- package/dist/lib/setupKeys.d.ts +42 -0
- package/dist/lib/setupKeys.js +564 -0
- package/dist/lib/setupRemoteCommand.d.ts +4 -0
- package/dist/lib/setupRemoteCommand.js +28 -0
- package/dist/lib/setupRemotePullCommand.d.ts +5 -0
- package/dist/lib/setupRemotePullCommand.js +52 -0
- package/dist/lib/setupRemotePushCommand.d.ts +5 -0
- package/dist/lib/setupRemotePushCommand.js +57 -0
- package/dist/lib/setupRemoteResolveCommand.d.ts +4 -0
- package/dist/lib/setupRemoteResolveCommand.js +48 -0
- package/dist/lib/setupRemoteStatusCommand.d.ts +4 -0
- package/dist/lib/setupRemoteStatusCommand.js +73 -0
- package/dist/lib/setupRemoteSyncCommand.d.ts +6 -0
- package/dist/lib/setupRemoteSyncCommand.js +65 -0
- package/dist/lib/setupSyncProjectsCommand.d.ts +4 -0
- package/dist/lib/setupSyncProjectsCommand.js +292 -0
- package/dist/lib/staleCommand.d.ts +8 -0
- package/dist/lib/staleCommand.js +34 -0
- package/dist/lib/statsCommand.d.ts +6 -0
- package/dist/lib/statsCommand.js +142 -0
- package/dist/lib/statusCommand.d.ts +18 -0
- package/dist/lib/statusCommand.js +250 -0
- package/dist/lib/storesCommand.d.ts +2 -0
- package/dist/lib/storesCommand.js +4 -0
- package/dist/lib/syncClient.d.ts +41 -0
- package/dist/lib/syncClient.js +234 -0
- package/dist/lib/syncCommand.d.ts +6 -0
- package/dist/lib/syncCommand.js +57 -0
- package/dist/lib/syncDoctorCommand.d.ts +5 -0
- package/dist/lib/syncDoctorCommand.js +100 -0
- package/dist/lib/syncIngest.d.ts +30 -0
- package/dist/lib/syncIngest.js +175 -0
- package/dist/lib/syncIngestLaunchd.d.ts +8 -0
- package/dist/lib/syncIngestLaunchd.js +93 -0
- package/dist/lib/syncIngestStartup.d.ts +5 -0
- package/dist/lib/syncIngestStartup.js +29 -0
- package/dist/lib/syncIngestSystemd.d.ts +10 -0
- package/dist/lib/syncIngestSystemd.js +97 -0
- package/dist/lib/syncIngestTimer.d.ts +8 -0
- package/dist/lib/syncIngestTimer.js +27 -0
- package/dist/lib/syncIngestTimerCommand.d.ts +7 -0
- package/dist/lib/syncIngestTimerCommand.js +83 -0
- package/dist/lib/syncLock.d.ts +6 -0
- package/dist/lib/syncLock.js +74 -0
- package/dist/lib/syncSnapshot.d.ts +32 -0
- package/dist/lib/syncSnapshot.js +188 -0
- package/dist/lib/syncStaging.d.ts +79 -0
- package/dist/lib/syncStaging.js +237 -0
- package/dist/lib/tagsAddCommand.d.ts +8 -0
- package/dist/lib/tagsAddCommand.js +18 -0
- package/dist/lib/tagsCommand.d.ts +4 -0
- package/dist/lib/tagsCommand.js +16 -0
- package/dist/lib/timelineCommand.d.ts +7 -0
- package/dist/lib/timelineCommand.js +49 -0
- package/dist/lib/traceCommand.d.ts +6 -0
- package/dist/lib/traceCommand.js +39 -0
- package/dist/lib/traverseCommand.d.ts +6 -0
- package/dist/lib/traverseCommand.js +58 -0
- package/dist/lib/updateCommand.d.ts +13 -0
- package/dist/lib/updateCommand.js +67 -0
- package/dist/lib/updateStatusCommand.d.ts +5 -0
- package/dist/lib/updateStatusCommand.js +38 -0
- package/dist/lib/webAddCommand.d.ts +8 -0
- package/dist/lib/webAddCommand.js +55 -0
- package/dist/lib/webBuildCommand.d.ts +10 -0
- package/dist/lib/webBuildCommand.js +65 -0
- package/dist/lib/webBuildIndexCommand.d.ts +8 -0
- package/dist/lib/webBuildIndexCommand.js +37 -0
- package/dist/lib/webIndex.js +0 -1
- package/dist/lib/webIngestCommand.d.ts +11 -0
- package/dist/lib/webIngestCommand.js +51 -0
- package/dist/lib/webInitCommand.d.ts +9 -0
- package/dist/lib/webInitCommand.js +167 -0
- package/dist/lib/webRemoveCommand.d.ts +5 -0
- package/dist/lib/webRemoveCommand.js +41 -0
- package/dist/lib/webStatusCommand.d.ts +5 -0
- package/dist/lib/webStatusCommand.js +94 -0
- package/dist/lib/webUpdateCommand.d.ts +7 -0
- package/dist/lib/webUpdateCommand.js +72 -0
- package/dist/lib/workingSetCommand.d.ts +6 -0
- package/dist/lib/workingSetCommand.js +37 -0
- package/dist/sandbox/client.js +1 -1
- package/dist/sandbox/manager.js +1 -14
- package/dist/sandbox/server.js +3 -5
- package/package.json +6 -2
package/dist/lib/config.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare const LLMProviderEnum: z.ZodEnum<{
|
|
|
11
11
|
lmstudio: "lmstudio";
|
|
12
12
|
xai: "xai";
|
|
13
13
|
mistral: "mistral";
|
|
14
|
+
openrouter: "openrouter";
|
|
14
15
|
custom: "custom";
|
|
15
16
|
}>;
|
|
16
17
|
export type LLMProviderName = z.infer<typeof LLMProviderEnum>;
|
|
@@ -26,6 +27,7 @@ declare const DreamConfigSchema: z.ZodObject<{
|
|
|
26
27
|
lmstudio: "lmstudio";
|
|
27
28
|
xai: "xai";
|
|
28
29
|
mistral: "mistral";
|
|
30
|
+
openrouter: "openrouter";
|
|
29
31
|
custom: "custom";
|
|
30
32
|
}>>;
|
|
31
33
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -33,6 +35,14 @@ declare const DreamConfigSchema: z.ZodObject<{
|
|
|
33
35
|
generateSummaries: z.ZodDefault<z.ZodBoolean>;
|
|
34
36
|
discoverRelationships: z.ZodDefault<z.ZodBoolean>;
|
|
35
37
|
minMemories: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
schedule: z.ZodDefault<z.ZodObject<{
|
|
39
|
+
startHour: z.ZodDefault<z.ZodNumber>;
|
|
40
|
+
endHour: z.ZodDefault<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
systemIdleMinutes: z.ZodDefault<z.ZodNumber>;
|
|
43
|
+
minNewMemoriesToDream: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
minHoursBetweenRuns: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
maxLLMCallsPerRun: z.ZodDefault<z.ZodNumber>;
|
|
36
46
|
}, z.core.$strip>;
|
|
37
47
|
export type DreamConfig = z.infer<typeof DreamConfigSchema>;
|
|
38
48
|
declare const RecallConfigSchema: z.ZodObject<{
|
|
@@ -41,52 +51,6 @@ declare const RecallConfigSchema: z.ZodObject<{
|
|
|
41
51
|
minRelevance: z.ZodDefault<z.ZodNumber>;
|
|
42
52
|
}, z.core.$strip>;
|
|
43
53
|
export type RecallConfig = z.infer<typeof RecallConfigSchema>;
|
|
44
|
-
declare const ChatConfigSchema: z.ZodObject<{
|
|
45
|
-
toolsEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
-
autoSummarizeAfterTurns: z.ZodDefault<z.ZodNumber>;
|
|
47
|
-
systemPromptPrefix: z.ZodDefault<z.ZodString>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
export type ChatConfig = z.infer<typeof ChatConfigSchema>;
|
|
50
|
-
declare const MultimodalConfigSchema: z.ZodObject<{
|
|
51
|
-
transcriptionProvider: z.ZodDefault<z.ZodEnum<{
|
|
52
|
-
groq: "groq";
|
|
53
|
-
openai: "openai";
|
|
54
|
-
local: "local";
|
|
55
|
-
}>>;
|
|
56
|
-
whisperModel: z.ZodDefault<z.ZodString>;
|
|
57
|
-
visionProvider: z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
anthropic: "anthropic";
|
|
59
|
-
ollama: "ollama";
|
|
60
|
-
groq: "groq";
|
|
61
|
-
openai: "openai";
|
|
62
|
-
lmstudio: "lmstudio";
|
|
63
|
-
xai: "xai";
|
|
64
|
-
mistral: "mistral";
|
|
65
|
-
custom: "custom";
|
|
66
|
-
}>>;
|
|
67
|
-
visionModel: z.ZodOptional<z.ZodString>;
|
|
68
|
-
chunkSize: z.ZodDefault<z.ZodNumber>;
|
|
69
|
-
maxFileSizeMb: z.ZodDefault<z.ZodNumber>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
export type MultimodalConfig = z.infer<typeof MultimodalConfigSchema>;
|
|
72
|
-
declare const WebConfigSchema: z.ZodObject<{
|
|
73
|
-
source: z.ZodDefault<z.ZodEnum<{
|
|
74
|
-
sitemap: "sitemap";
|
|
75
|
-
directory: "directory";
|
|
76
|
-
urls: "urls";
|
|
77
|
-
}>>;
|
|
78
|
-
sitemapUrl: z.ZodOptional<z.ZodString>;
|
|
79
|
-
contentDir: z.ZodOptional<z.ZodString>;
|
|
80
|
-
urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
-
outputDir: z.ZodDefault<z.ZodString>;
|
|
82
|
-
exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
83
|
-
categories: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
84
|
-
llmEnrich: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
-
prune: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
87
|
-
crawlDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
export type WebConfig = z.infer<typeof WebConfigSchema>;
|
|
90
54
|
export declare const GnosysConfigSchema: z.ZodObject<{
|
|
91
55
|
llm: z.ZodDefault<z.ZodObject<{
|
|
92
56
|
defaultProvider: z.ZodDefault<z.ZodEnum<{
|
|
@@ -97,6 +61,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
97
61
|
lmstudio: "lmstudio";
|
|
98
62
|
xai: "xai";
|
|
99
63
|
mistral: "mistral";
|
|
64
|
+
openrouter: "openrouter";
|
|
100
65
|
custom: "custom";
|
|
101
66
|
}>>;
|
|
102
67
|
anthropic: z.ZodDefault<z.ZodObject<{
|
|
@@ -128,6 +93,11 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
128
93
|
model: z.ZodDefault<z.ZodString>;
|
|
129
94
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
130
95
|
}, z.core.$strip>>;
|
|
96
|
+
openrouter: z.ZodDefault<z.ZodObject<{
|
|
97
|
+
model: z.ZodDefault<z.ZodString>;
|
|
98
|
+
baseUrl: z.ZodDefault<z.ZodString>;
|
|
99
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
131
101
|
custom: z.ZodOptional<z.ZodObject<{
|
|
132
102
|
model: z.ZodString;
|
|
133
103
|
baseUrl: z.ZodString;
|
|
@@ -144,6 +114,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
144
114
|
lmstudio: "lmstudio";
|
|
145
115
|
xai: "xai";
|
|
146
116
|
mistral: "mistral";
|
|
117
|
+
openrouter: "openrouter";
|
|
147
118
|
custom: "custom";
|
|
148
119
|
}>;
|
|
149
120
|
model: z.ZodString;
|
|
@@ -157,6 +128,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
157
128
|
lmstudio: "lmstudio";
|
|
158
129
|
xai: "xai";
|
|
159
130
|
mistral: "mistral";
|
|
131
|
+
openrouter: "openrouter";
|
|
160
132
|
custom: "custom";
|
|
161
133
|
}>;
|
|
162
134
|
model: z.ZodString;
|
|
@@ -170,6 +142,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
170
142
|
lmstudio: "lmstudio";
|
|
171
143
|
xai: "xai";
|
|
172
144
|
mistral: "mistral";
|
|
145
|
+
openrouter: "openrouter";
|
|
173
146
|
custom: "custom";
|
|
174
147
|
}>;
|
|
175
148
|
model: z.ZodString;
|
|
@@ -183,6 +156,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
183
156
|
lmstudio: "lmstudio";
|
|
184
157
|
xai: "xai";
|
|
185
158
|
mistral: "mistral";
|
|
159
|
+
openrouter: "openrouter";
|
|
186
160
|
custom: "custom";
|
|
187
161
|
}>;
|
|
188
162
|
model: z.ZodString;
|
|
@@ -196,6 +170,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
196
170
|
lmstudio: "lmstudio";
|
|
197
171
|
xai: "xai";
|
|
198
172
|
mistral: "mistral";
|
|
173
|
+
openrouter: "openrouter";
|
|
199
174
|
custom: "custom";
|
|
200
175
|
}>;
|
|
201
176
|
model: z.ZodString;
|
|
@@ -247,6 +222,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
247
222
|
lmstudio: "lmstudio";
|
|
248
223
|
xai: "xai";
|
|
249
224
|
mistral: "mistral";
|
|
225
|
+
openrouter: "openrouter";
|
|
250
226
|
custom: "custom";
|
|
251
227
|
}>>;
|
|
252
228
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -254,6 +230,14 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
254
230
|
generateSummaries: z.ZodDefault<z.ZodBoolean>;
|
|
255
231
|
discoverRelationships: z.ZodDefault<z.ZodBoolean>;
|
|
256
232
|
minMemories: z.ZodDefault<z.ZodNumber>;
|
|
233
|
+
schedule: z.ZodDefault<z.ZodObject<{
|
|
234
|
+
startHour: z.ZodDefault<z.ZodNumber>;
|
|
235
|
+
endHour: z.ZodDefault<z.ZodNumber>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
systemIdleMinutes: z.ZodDefault<z.ZodNumber>;
|
|
238
|
+
minNewMemoriesToDream: z.ZodDefault<z.ZodNumber>;
|
|
239
|
+
minHoursBetweenRuns: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
maxLLMCallsPerRun: z.ZodDefault<z.ZodNumber>;
|
|
257
241
|
}, z.core.$strip>>;
|
|
258
242
|
chat: z.ZodDefault<z.ZodObject<{
|
|
259
243
|
toolsEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -275,6 +259,7 @@ export declare const GnosysConfigSchema: z.ZodObject<{
|
|
|
275
259
|
lmstudio: "lmstudio";
|
|
276
260
|
xai: "xai";
|
|
277
261
|
mistral: "mistral";
|
|
262
|
+
openrouter: "openrouter";
|
|
278
263
|
custom: "custom";
|
|
279
264
|
}>>;
|
|
280
265
|
visionModel: z.ZodOptional<z.ZodString>;
|
|
@@ -314,11 +299,11 @@ export declare function resolveTaskModel(config: GnosysConfig, task: "structurin
|
|
|
314
299
|
*/
|
|
315
300
|
export declare function getProviderModel(config: GnosysConfig, provider: LLMProviderName): string;
|
|
316
301
|
/**
|
|
317
|
-
* Get the Groq API key
|
|
302
|
+
* Get the Groq API key (global → provider → legacy env).
|
|
318
303
|
*/
|
|
319
304
|
export declare function getGroqApiKey(config: GnosysConfig): string | undefined;
|
|
320
305
|
/**
|
|
321
|
-
* Get the OpenAI API key
|
|
306
|
+
* Get the OpenAI API key (global → provider → legacy env).
|
|
322
307
|
*/
|
|
323
308
|
export declare function getOpenAIApiKey(config: GnosysConfig): string | undefined;
|
|
324
309
|
/**
|
|
@@ -345,6 +330,14 @@ export declare function getXAIApiKey(config: GnosysConfig): string | undefined;
|
|
|
345
330
|
* Get the Mistral API key, checking config first then env var.
|
|
346
331
|
*/
|
|
347
332
|
export declare function getMistralApiKey(config: GnosysConfig): string | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Get the OpenRouter API key, checking config first then env var.
|
|
335
|
+
*/
|
|
336
|
+
export declare function getOpenRouterApiKey(config: GnosysConfig): string | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* Get the OpenRouter API base URL from config.
|
|
339
|
+
*/
|
|
340
|
+
export declare function getOpenRouterBaseUrl(config: GnosysConfig): string;
|
|
348
341
|
/**
|
|
349
342
|
* Get the Custom provider API key, checking config first then env var.
|
|
350
343
|
*/
|
package/dist/lib/config.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import fs from "fs/promises";
|
|
7
7
|
import path from "path";
|
|
8
|
-
import { execSync } from "child_process";
|
|
9
8
|
import { getGnosysHome } from "./paths.js";
|
|
10
9
|
import { atomicWriteFile } from "./atomicWrite.js";
|
|
10
|
+
import { getApiKeyForProviderFromConfig, } from "./apiKeyVault.js";
|
|
11
11
|
// ─── LLM Provider Schemas ───────────────────────────────────────────────
|
|
12
|
-
const LLMProviderEnum = z.enum(["anthropic", "ollama", "groq", "openai", "lmstudio", "xai", "mistral", "custom"]);
|
|
12
|
+
const LLMProviderEnum = z.enum(["anthropic", "ollama", "groq", "openai", "lmstudio", "xai", "mistral", "openrouter", "custom"]);
|
|
13
13
|
const AnthropicConfigSchema = z.object({
|
|
14
14
|
model: z.string().default("claude-sonnet-4-6"),
|
|
15
15
|
apiKey: z.string().optional(), // Falls back to ANTHROPIC_API_KEY env var
|
|
@@ -39,6 +39,11 @@ const MistralConfigSchema = z.object({
|
|
|
39
39
|
model: z.string().default("mistral-small-4"),
|
|
40
40
|
apiKey: z.string().optional(),
|
|
41
41
|
});
|
|
42
|
+
const OpenRouterConfigSchema = z.object({
|
|
43
|
+
model: z.string().default("nvidia/nemotron-3-super-120b-a12b:free"),
|
|
44
|
+
baseUrl: z.string().default("https://openrouter.ai/api/v1"),
|
|
45
|
+
apiKey: z.string().optional(),
|
|
46
|
+
});
|
|
42
47
|
const CustomConfigSchema = z.object({
|
|
43
48
|
model: z.string(),
|
|
44
49
|
baseUrl: z.string(),
|
|
@@ -57,6 +62,10 @@ const LLMConfigSchema = z.object({
|
|
|
57
62
|
lmstudio: LMStudioConfigSchema.default({ model: "default", baseUrl: "http://localhost:1234/v1" }),
|
|
58
63
|
xai: XAIConfigSchema.default({ model: "grok-4.20" }),
|
|
59
64
|
mistral: MistralConfigSchema.default({ model: "mistral-small-4" }),
|
|
65
|
+
openrouter: OpenRouterConfigSchema.default({
|
|
66
|
+
model: "nvidia/nemotron-3-super-120b-a12b:free",
|
|
67
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
68
|
+
}),
|
|
60
69
|
custom: CustomConfigSchema.optional(),
|
|
61
70
|
});
|
|
62
71
|
const TaskModelsSchema = z.object({
|
|
@@ -96,6 +105,19 @@ const DreamConfigSchema = z.object({
|
|
|
96
105
|
discoverRelationships: z.boolean().default(true),
|
|
97
106
|
/** Min memory count before dream mode activates */
|
|
98
107
|
minMemories: z.number().int().min(1).default(10),
|
|
108
|
+
/** Night-only launch window for scheduled Dream runs. Hours are local 0-23. */
|
|
109
|
+
schedule: z.object({
|
|
110
|
+
startHour: z.number().int().min(0).max(23).default(2),
|
|
111
|
+
endHour: z.number().int().min(0).max(23).default(5),
|
|
112
|
+
}).default({ startHour: 2, endHour: 5 }),
|
|
113
|
+
/** Required real machine idle time before scheduled Dream can run. */
|
|
114
|
+
systemIdleMinutes: z.number().int().min(1).default(30),
|
|
115
|
+
/** Minimum new or changed memories since the last successful run. */
|
|
116
|
+
minNewMemoriesToDream: z.number().int().min(0).default(10),
|
|
117
|
+
/** Cooldown between scheduled Dream runs. */
|
|
118
|
+
minHoursBetweenRuns: z.number().int().min(0).default(20),
|
|
119
|
+
/** Hard cap on paid LLM calls in a single Dream run. */
|
|
120
|
+
maxLLMCallsPerRun: z.number().int().min(0).default(12),
|
|
99
121
|
});
|
|
100
122
|
// ─── Recall Schema ─────────────────────────────────────────────────────
|
|
101
123
|
const RecallConfigSchema = z.object({
|
|
@@ -177,6 +199,7 @@ export const GnosysConfigSchema = z.object({
|
|
|
177
199
|
lmstudio: { model: "default", baseUrl: "http://localhost:1234/v1" },
|
|
178
200
|
xai: { model: "grok-4.20" },
|
|
179
201
|
mistral: { model: "mistral-small-4" },
|
|
202
|
+
openrouter: { model: "nvidia/nemotron-3-super-120b-a12b:free", baseUrl: "https://openrouter.ai/api/v1" },
|
|
180
203
|
}),
|
|
181
204
|
/** Task-specific model overrides */
|
|
182
205
|
taskModels: TaskModelsSchema.default({}),
|
|
@@ -227,6 +250,11 @@ export const GnosysConfigSchema = z.object({
|
|
|
227
250
|
generateSummaries: true,
|
|
228
251
|
discoverRelationships: true,
|
|
229
252
|
minMemories: 10,
|
|
253
|
+
schedule: { startHour: 2, endHour: 5 },
|
|
254
|
+
systemIdleMinutes: 30,
|
|
255
|
+
minNewMemoriesToDream: 10,
|
|
256
|
+
minHoursBetweenRuns: 20,
|
|
257
|
+
maxLLMCallsPerRun: 12,
|
|
230
258
|
}),
|
|
231
259
|
/** Chat TUI — interactive chat configuration (v5.8.0) */
|
|
232
260
|
chat: ChatConfigSchema.default({
|
|
@@ -282,67 +310,22 @@ export function getProviderModel(config, provider) {
|
|
|
282
310
|
case "lmstudio": return config.llm.lmstudio.model;
|
|
283
311
|
case "xai": return config.llm.xai.model;
|
|
284
312
|
case "mistral": return config.llm.mistral.model;
|
|
313
|
+
case "openrouter": return config.llm.openrouter.model;
|
|
285
314
|
case "custom": return config.llm.custom?.model || "";
|
|
286
315
|
default: return config.llm.anthropic.model;
|
|
287
316
|
}
|
|
288
317
|
}
|
|
289
318
|
/**
|
|
290
|
-
*
|
|
291
|
-
* 1. Config (gnosys.json)
|
|
292
|
-
* 2. GNOSYS_<PROVIDER>_KEY env var (new convention)
|
|
293
|
-
* 3. macOS Keychain (if on macOS)
|
|
294
|
-
* 4. Legacy env var (ANTHROPIC_API_KEY, etc.)
|
|
295
|
-
* 5. ~/.config/gnosys/.env (read at startup)
|
|
296
|
-
*/
|
|
297
|
-
function resolveApiKey(configKey, gnosysEnvVar, legacyEnvVar) {
|
|
298
|
-
// 1. Config value
|
|
299
|
-
if (configKey)
|
|
300
|
-
return configKey;
|
|
301
|
-
// 2. New GNOSYS_*_KEY env var
|
|
302
|
-
if (process.env[gnosysEnvVar])
|
|
303
|
-
return process.env[gnosysEnvVar];
|
|
304
|
-
// Skip keychain lookups inside vitest — test env can't differentiate
|
|
305
|
-
// a real keychain entry from a stubbed env var, so tests asserting "no
|
|
306
|
-
// key configured" leak the developer's actual keys.
|
|
307
|
-
const inTest = !!process.env.VITEST;
|
|
308
|
-
// 3. macOS Keychain
|
|
309
|
-
if (!inTest && process.platform === "darwin") {
|
|
310
|
-
try {
|
|
311
|
-
const result = execSync(`security find-generic-password -a "$USER" -s "${gnosysEnvVar}" -w 2>/dev/null`, { stdio: "pipe", encoding: "utf-8", timeout: 2000 }).trim();
|
|
312
|
-
if (result)
|
|
313
|
-
return result;
|
|
314
|
-
}
|
|
315
|
-
catch {
|
|
316
|
-
// Not in keychain — fall through
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
// 4. Linux GNOME Keyring (secret-tool)
|
|
320
|
-
if (!inTest && process.platform === "linux") {
|
|
321
|
-
try {
|
|
322
|
-
const result = execSync(`secret-tool lookup service gnosys account ${gnosysEnvVar} 2>/dev/null`, { stdio: "pipe", encoding: "utf-8", timeout: 2000 }).trim();
|
|
323
|
-
if (result)
|
|
324
|
-
return result;
|
|
325
|
-
}
|
|
326
|
-
catch {
|
|
327
|
-
// secret-tool not installed or no entry — fall through
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
// 5. Legacy env var
|
|
331
|
-
if (legacyEnvVar && process.env[legacyEnvVar])
|
|
332
|
-
return process.env[legacyEnvVar];
|
|
333
|
-
return undefined;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Get the Groq API key, checking config first then env var.
|
|
319
|
+
* Get the Groq API key (global → provider → legacy env).
|
|
337
320
|
*/
|
|
338
321
|
export function getGroqApiKey(config) {
|
|
339
|
-
return
|
|
322
|
+
return getApiKeyForProviderFromConfig(config, "groq");
|
|
340
323
|
}
|
|
341
324
|
/**
|
|
342
|
-
* Get the OpenAI API key
|
|
325
|
+
* Get the OpenAI API key (global → provider → legacy env).
|
|
343
326
|
*/
|
|
344
327
|
export function getOpenAIApiKey(config) {
|
|
345
|
-
return
|
|
328
|
+
return getApiKeyForProviderFromConfig(config, "openai");
|
|
346
329
|
}
|
|
347
330
|
/**
|
|
348
331
|
* Get the OpenAI base URL from config.
|
|
@@ -360,7 +343,7 @@ export function getLMStudioBaseUrl(config) {
|
|
|
360
343
|
* Get the Anthropic API key, checking config first then env var.
|
|
361
344
|
*/
|
|
362
345
|
export function getAnthropicApiKey(config) {
|
|
363
|
-
return
|
|
346
|
+
return getApiKeyForProviderFromConfig(config, "anthropic");
|
|
364
347
|
}
|
|
365
348
|
/**
|
|
366
349
|
* Get the Ollama base URL from config.
|
|
@@ -372,19 +355,31 @@ export function getOllamaBaseUrl(config) {
|
|
|
372
355
|
* Get the xAI API key, checking config first then env var.
|
|
373
356
|
*/
|
|
374
357
|
export function getXAIApiKey(config) {
|
|
375
|
-
return
|
|
358
|
+
return getApiKeyForProviderFromConfig(config, "xai");
|
|
376
359
|
}
|
|
377
360
|
/**
|
|
378
361
|
* Get the Mistral API key, checking config first then env var.
|
|
379
362
|
*/
|
|
380
363
|
export function getMistralApiKey(config) {
|
|
381
|
-
return
|
|
364
|
+
return getApiKeyForProviderFromConfig(config, "mistral");
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Get the OpenRouter API key, checking config first then env var.
|
|
368
|
+
*/
|
|
369
|
+
export function getOpenRouterApiKey(config) {
|
|
370
|
+
return getApiKeyForProviderFromConfig(config, "openrouter");
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Get the OpenRouter API base URL from config.
|
|
374
|
+
*/
|
|
375
|
+
export function getOpenRouterBaseUrl(config) {
|
|
376
|
+
return config.llm.openrouter.baseUrl;
|
|
382
377
|
}
|
|
383
378
|
/**
|
|
384
379
|
* Get the Custom provider API key, checking config first then env var.
|
|
385
380
|
*/
|
|
386
381
|
export function getCustomApiKey(config) {
|
|
387
|
-
return
|
|
382
|
+
return getApiKeyForProviderFromConfig(config, "custom");
|
|
388
383
|
}
|
|
389
384
|
// ─── Migration ───────────────────────────────────────────────────────────
|
|
390
385
|
/**
|
|
@@ -578,6 +573,10 @@ export function generateConfigTemplate() {
|
|
|
578
573
|
lmstudio: { model: "default", baseUrl: "http://localhost:1234/v1" },
|
|
579
574
|
xai: { model: "grok-4.20" },
|
|
580
575
|
mistral: { model: "mistral-small-4" },
|
|
576
|
+
openrouter: {
|
|
577
|
+
model: "nvidia/nemotron-3-super-120b-a12b:free",
|
|
578
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
579
|
+
},
|
|
581
580
|
},
|
|
582
581
|
taskModels: {},
|
|
583
582
|
bulkIngestionBatchSize: 500,
|
|
@@ -617,4 +616,6 @@ export function generateConfigTemplate() {
|
|
|
617
616
|
/**
|
|
618
617
|
* All supported provider names.
|
|
619
618
|
*/
|
|
620
|
-
export const ALL_PROVIDERS = [
|
|
619
|
+
export const ALL_PROVIDERS = [
|
|
620
|
+
"anthropic", "ollama", "groq", "openai", "lmstudio", "xai", "mistral", "openrouter", "custom",
|
|
621
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GnosysResolver } from "./resolver.js";
|
|
2
|
+
type GetResolver = () => Promise<GnosysResolver>;
|
|
3
|
+
export declare function runConfigShowCommand(getResolver: GetResolver, opts: {
|
|
4
|
+
json?: boolean;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
export declare function runConfigSetCommand(getResolver: GetResolver, key: string, value: string, extra: string[]): Promise<void>;
|
|
7
|
+
export declare function runConfigInitCommand(getResolver: GetResolver, opts: {
|
|
8
|
+
force?: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
export {};
|