@p-sw/brainbox 0.1.0 → 0.1.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5319 -0
- package/package.json +10 -4
- package/scripts/smoke_providers.ts +0 -176
- package/src/brain/index.ts +0 -936
- package/src/brain/manager.ts +0 -144
- package/src/brain/memory.ts +0 -99
- package/src/brain/messageHistory.ts +0 -26
- package/src/brain/schedule.ts +0 -11
- package/src/brain/types.ts +0 -26
- package/src/channel/base.ts +0 -527
- package/src/channel/discord.ts +0 -227
- package/src/channel/telegram.ts +0 -150
- package/src/commands/auth.tsx +0 -306
- package/src/commands/brain.ts +0 -119
- package/src/commands/daemon/commands.ts +0 -56
- package/src/commands/daemon/pairingCommand.ts +0 -15
- package/src/commands/daemon/restartCommand.ts +0 -17
- package/src/commands/daemon.ts +0 -168
- package/src/commands/index.ts +0 -16
- package/src/commands/model.tsx +0 -138
- package/src/commands/onboard.tsx +0 -473
- package/src/commands/pairing.ts +0 -32
- package/src/commands/restart.ts +0 -24
- package/src/config/file/auth.ts +0 -105
- package/src/config/file/root.ts +0 -37
- package/src/config/index.ts +0 -21
- package/src/config/loader.ts +0 -115
- package/src/index.ts +0 -61
- package/src/provider/index.ts +0 -122
- package/src/provider/llm.ts +0 -191
- package/src/provider/promptLoader.ts +0 -36
- package/src/provider/providers/302ai.ts +0 -17
- package/src/provider/providers/MiniMax.ts +0 -17
- package/src/provider/providers/anthropic.ts +0 -257
- package/src/provider/providers/azure_cognitive.ts +0 -40
- package/src/provider/providers/azure_openai.ts +0 -49
- package/src/provider/providers/baseten.ts +0 -17
- package/src/provider/providers/bedrock.ts +0 -312
- package/src/provider/providers/cerebras.ts +0 -17
- package/src/provider/providers/cloudflare_gateway.ts +0 -34
- package/src/provider/providers/cloudflare_workers.ts +0 -178
- package/src/provider/providers/copilot.ts +0 -22
- package/src/provider/providers/cortecs.ts +0 -17
- package/src/provider/providers/deepinfra.ts +0 -17
- package/src/provider/providers/deepseek.ts +0 -17
- package/src/provider/providers/digitalocean.ts +0 -17
- package/src/provider/providers/fireworks.ts +0 -17
- package/src/provider/providers/gitlab_duo.ts +0 -184
- package/src/provider/providers/gmi.ts +0 -17
- package/src/provider/providers/groq.ts +0 -17
- package/src/provider/providers/helicone.ts +0 -17
- package/src/provider/providers/huggingface.ts +0 -17
- package/src/provider/providers/ionet.ts +0 -17
- package/src/provider/providers/llamacpp.ts +0 -17
- package/src/provider/providers/llmgateway.ts +0 -17
- package/src/provider/providers/lmstudio.ts +0 -17
- package/src/provider/providers/mistral.ts +0 -17
- package/src/provider/providers/moonshot.ts +0 -17
- package/src/provider/providers/nebius.ts +0 -17
- package/src/provider/providers/nvidia.ts +0 -17
- package/src/provider/providers/ollama.ts +0 -17
- package/src/provider/providers/ollama_cloud.ts +0 -17
- package/src/provider/providers/openai.ts +0 -17
- package/src/provider/providers/openai_compatible.ts +0 -293
- package/src/provider/providers/openrouter.ts +0 -175
- package/src/provider/providers/ovhcloud.ts +0 -17
- package/src/provider/providers/sap_aicore.ts +0 -22
- package/src/provider/providers/scaleway.ts +0 -17
- package/src/provider/providers/snowflake_cortex.ts +0 -207
- package/src/provider/providers/stackit.ts +0 -17
- package/src/provider/providers/together.ts +0 -17
- package/src/provider/providers/venice.ts +0 -17
- package/src/provider/providers/vercel.ts +0 -17
- package/src/provider/providers/vertex.ts +0 -229
- package/src/provider/providers/xai.ts +0 -17
- package/src/provider/providers/zai.ts +0 -17
- package/src/provider/providers/zenmux.ts +0 -17
- package/src/provider/schema.ts +0 -143
- package/src/ui/TextInput.tsx +0 -114
- package/src/utils/daemonClient.ts +0 -85
- package/src/utils/logger.ts +0 -204
- package/tsconfig.json +0 -34
- /package/{prompts → dist/prompts}/daily_schedule.md +0 -0
- /package/{prompts → dist/prompts}/memoir.md +0 -0
- /package/{prompts → dist/prompts}/monthly_schedule.md +0 -0
- /package/{prompts → dist/prompts}/objectifier.md +0 -0
- /package/{prompts → dist/prompts}/persona_base_system_prompt.md +0 -0
- /package/{prompts → dist/prompts}/persona_base_system_prompt_fixed.md +0 -0
- /package/{prompts → dist/prompts}/persona_init.md +0 -0
- /package/{prompts → dist/prompts}/schedule_availability.md +0 -0
- /package/{prompts → dist/prompts}/send_message.md +0 -0
- /package/{prompts → dist/prompts}/start_conversation.md +0 -0
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p-sw/brainbox",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"module": "
|
|
3
|
+
"version": "0.1.2-alpha.0",
|
|
4
|
+
"module": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
|
-
"brainbox": "./
|
|
8
|
+
"brainbox": "./dist/index.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
11
|
"cli": "bun run src/index.ts",
|
|
11
|
-
"format": "bun run prettier 'src/**/*.ts' -w"
|
|
12
|
+
"format": "bun run prettier 'src/**/*.ts' -w",
|
|
13
|
+
"build": "rm -rf dist && bun build ./src/index.ts --outdir dist --target node --packages external && cp -r prompts dist/prompts && chmod +x dist/index.js",
|
|
14
|
+
"prepack": "bun run build"
|
|
12
15
|
},
|
|
13
16
|
"devDependencies": {
|
|
14
17
|
"@types/node": "^25.9.1"
|
|
@@ -31,6 +34,9 @@
|
|
|
31
34
|
"yaml": "^2.9.0",
|
|
32
35
|
"zod": "^4.4.3"
|
|
33
36
|
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
34
40
|
"author": {
|
|
35
41
|
"name": "Shinwoo PARK",
|
|
36
42
|
"email": "shinwoo.park@psw.kr",
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
// Smoke test: verify every provider can be constructed and exposes the right
|
|
2
|
-
// providerName + models fields. Runs offline (no network).
|
|
3
|
-
import type { LLMExecutor as LLMExecutorType } from "../src/provider/llm";
|
|
4
|
-
import { LLMExecutor } from "../src/provider/llm";
|
|
5
|
-
import { OpenRouterExecutor } from "../src/provider/providers/openrouter";
|
|
6
|
-
import { OpenAIExecutor } from "../src/provider/providers/openai";
|
|
7
|
-
import { MistralExecutor } from "../src/provider/providers/mistral";
|
|
8
|
-
import { DeepSeekExecutor } from "../src/provider/providers/deepseek";
|
|
9
|
-
import { GroqExecutor } from "../src/provider/providers/groq";
|
|
10
|
-
import { CerebrasExecutor } from "../src/provider/providers/cerebras";
|
|
11
|
-
import { FireworksExecutor } from "../src/provider/providers/fireworks";
|
|
12
|
-
import { TogetherExecutor } from "../src/provider/providers/together";
|
|
13
|
-
import { XAIExecutor } from "../src/provider/providers/xai";
|
|
14
|
-
import { MoonshotExecutor } from "../src/provider/providers/moonshot";
|
|
15
|
-
import { NvidiaExecutor } from "../src/provider/providers/nvidia";
|
|
16
|
-
import { DeepInfraExecutor } from "../src/provider/providers/deepinfra";
|
|
17
|
-
import { Ai302Executor } from "../src/provider/providers/302ai";
|
|
18
|
-
import { DigitalOceanExecutor } from "../src/provider/providers/digitalocean";
|
|
19
|
-
import { HeliconeExecutor } from "../src/provider/providers/helicone";
|
|
20
|
-
import { ScalewayExecutor } from "../src/provider/providers/scaleway";
|
|
21
|
-
import { VeniceExecutor } from "../src/provider/providers/venice";
|
|
22
|
-
import { NebiusExecutor } from "../src/provider/providers/nebius";
|
|
23
|
-
import { OvhCloudExecutor } from "../src/provider/providers/ovhcloud";
|
|
24
|
-
import { StackitExecutor } from "../src/provider/providers/stackit";
|
|
25
|
-
import { GmiExecutor } from "../src/provider/providers/gmi";
|
|
26
|
-
import { ZaiExecutor } from "../src/provider/providers/zai";
|
|
27
|
-
import { ZenMuxExecutor } from "../src/provider/providers/zenmux";
|
|
28
|
-
import { MiniMaxExecutor } from "../src/provider/providers/MiniMax";
|
|
29
|
-
import { IoNetExecutor } from "../src/provider/providers/ionet";
|
|
30
|
-
import { BasetenExecutor } from "../src/provider/providers/baseten";
|
|
31
|
-
import { CortecsExecutor } from "../src/provider/providers/cortecs";
|
|
32
|
-
import { HuggingFaceExecutor } from "../src/provider/providers/huggingface";
|
|
33
|
-
import { LmStudioExecutor } from "../src/provider/providers/lmstudio";
|
|
34
|
-
import { OllamaExecutor } from "../src/provider/providers/ollama";
|
|
35
|
-
import { OllamaCloudExecutor } from "../src/provider/providers/ollama_cloud";
|
|
36
|
-
import { LlamaCppExecutor } from "../src/provider/providers/llamacpp";
|
|
37
|
-
import { VercelExecutor } from "../src/provider/providers/vercel";
|
|
38
|
-
import { LlmGatewayExecutor } from "../src/provider/providers/llmgateway";
|
|
39
|
-
import { CloudflareGatewayExecutor } from "../src/provider/providers/cloudflare_gateway";
|
|
40
|
-
import { CloudflareWorkersExecutor } from "../src/provider/providers/cloudflare_workers";
|
|
41
|
-
import { SapAiCoreExecutor } from "../src/provider/providers/sap_aicore";
|
|
42
|
-
import { AzureOpenAIExecutor } from "../src/provider/providers/azure_openai";
|
|
43
|
-
import { AzureCognitiveExecutor } from "../src/provider/providers/azure_cognitive";
|
|
44
|
-
import { AnthropicExecutor } from "../src/provider/providers/anthropic";
|
|
45
|
-
import { BedrockExecutor } from "../src/provider/providers/bedrock";
|
|
46
|
-
import { VertexExecutor } from "../src/provider/providers/vertex";
|
|
47
|
-
import { CopilotExecutor } from "../src/provider/providers/copilot";
|
|
48
|
-
import { GitLabDuoExecutor } from "../src/provider/providers/gitlab_duo";
|
|
49
|
-
import { SnowflakeCortexExecutor } from "../src/provider/providers/snowflake_cortex";
|
|
50
|
-
|
|
51
|
-
type Ctor = new (opts: {
|
|
52
|
-
apiKey: string;
|
|
53
|
-
conversationModel: string;
|
|
54
|
-
identityModel: string;
|
|
55
|
-
auth?: Record<string, unknown>;
|
|
56
|
-
}) => LLMExecutorType;
|
|
57
|
-
|
|
58
|
-
const entries: Array<[string, Ctor]> = [
|
|
59
|
-
["openrouter", OpenRouterExecutor],
|
|
60
|
-
["openai", OpenAIExecutor],
|
|
61
|
-
["mistral", MistralExecutor],
|
|
62
|
-
["deepseek", DeepSeekExecutor],
|
|
63
|
-
["groq", GroqExecutor],
|
|
64
|
-
["cerebras", CerebrasExecutor],
|
|
65
|
-
["fireworks", FireworksExecutor],
|
|
66
|
-
["together", TogetherExecutor],
|
|
67
|
-
["xai", XAIExecutor],
|
|
68
|
-
["moonshot", MoonshotExecutor],
|
|
69
|
-
["nvidia", NvidiaExecutor],
|
|
70
|
-
["deepinfra", DeepInfraExecutor],
|
|
71
|
-
["302ai", Ai302Executor],
|
|
72
|
-
["digitalocean", DigitalOceanExecutor],
|
|
73
|
-
["helicone", HeliconeExecutor],
|
|
74
|
-
["scaleway", ScalewayExecutor],
|
|
75
|
-
["venice", VeniceExecutor],
|
|
76
|
-
["nebius", NebiusExecutor],
|
|
77
|
-
["ovhcloud", OvhCloudExecutor],
|
|
78
|
-
["stackit", StackitExecutor],
|
|
79
|
-
["gmi", GmiExecutor],
|
|
80
|
-
["zai", ZaiExecutor],
|
|
81
|
-
["zenmux", ZenMuxExecutor],
|
|
82
|
-
["MiniMax", MiniMaxExecutor],
|
|
83
|
-
["ionet", IoNetExecutor],
|
|
84
|
-
["baseten", BasetenExecutor],
|
|
85
|
-
["cortecs", CortecsExecutor],
|
|
86
|
-
["huggingface", HuggingFaceExecutor],
|
|
87
|
-
["lmstudio", LmStudioExecutor],
|
|
88
|
-
["ollama", OllamaExecutor],
|
|
89
|
-
["ollama-cloud", OllamaCloudExecutor],
|
|
90
|
-
["llamacpp", LlamaCppExecutor],
|
|
91
|
-
["vercel", VercelExecutor],
|
|
92
|
-
["llmgateway", LlmGatewayExecutor],
|
|
93
|
-
["cloudflare-gateway", CloudflareGatewayExecutor],
|
|
94
|
-
["cloudflare-workers", CloudflareWorkersExecutor],
|
|
95
|
-
["sap-aicore", SapAiCoreExecutor],
|
|
96
|
-
["azure-openai", AzureOpenAIExecutor],
|
|
97
|
-
["azure-cognitive", AzureCognitiveExecutor],
|
|
98
|
-
["anthropic", AnthropicExecutor],
|
|
99
|
-
["bedrock", BedrockExecutor],
|
|
100
|
-
["vertex", VertexExecutor],
|
|
101
|
-
["copilot", CopilotExecutor],
|
|
102
|
-
["gitlab-duo", GitLabDuoExecutor],
|
|
103
|
-
["snowflake-cortex", SnowflakeCortexExecutor],
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
const authExtras: Record<string, unknown> = {
|
|
107
|
-
accountId: "acct",
|
|
108
|
-
gatewayId: "gw",
|
|
109
|
-
region: "us-east-1",
|
|
110
|
-
project: "proj",
|
|
111
|
-
resource: "res",
|
|
112
|
-
apiVersion: "2024-08-01-preview",
|
|
113
|
-
baseURL: "https://example.com",
|
|
114
|
-
account: "acct",
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
let failed = 0;
|
|
118
|
-
for (const [name, ctor] of entries) {
|
|
119
|
-
const instance = new ctor({
|
|
120
|
-
apiKey: "test-key",
|
|
121
|
-
conversationModel: "conv-model",
|
|
122
|
-
identityModel: "id-model",
|
|
123
|
-
auth: authExtras,
|
|
124
|
-
});
|
|
125
|
-
if (instance.providerName !== name) {
|
|
126
|
-
console.error(`MISMATCH for ${name}: got ${instance.providerName}`);
|
|
127
|
-
failed++;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
if (
|
|
131
|
-
instance.models.conversation !== "conv-model" ||
|
|
132
|
-
instance.models.identity !== "id-model"
|
|
133
|
-
) {
|
|
134
|
-
console.error(`MODELS MISMATCH for ${name}:`, instance.models);
|
|
135
|
-
failed++;
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (
|
|
139
|
-
typeof instance.call !== "function" ||
|
|
140
|
-
typeof instance.chatWithTools !== "function"
|
|
141
|
-
) {
|
|
142
|
-
console.error(`MISSING METHODS for ${name}`);
|
|
143
|
-
failed++;
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (failed > 0) {
|
|
149
|
-
console.error(`FAILED ${failed}/${entries.length}`);
|
|
150
|
-
process.exit(1);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
console.log(`OK: ${entries.length} providers instantiate cleanly`);
|
|
154
|
-
|
|
155
|
-
// ponytail: instead of importing the index (which calls init() and exits on
|
|
156
|
-
// bad config), walk the same list and verify the export names in
|
|
157
|
-
// src/provider/index.ts statically. This is a static check on the source
|
|
158
|
-
// string of the file — if a new provider is added to `entries` but not to
|
|
159
|
-
// the index's register() call, this fails.
|
|
160
|
-
import { readFileSync } from "fs";
|
|
161
|
-
import { join } from "path";
|
|
162
|
-
const indexPath = join(import.meta.dir, "..", "src", "provider", "index.ts");
|
|
163
|
-
const indexSrc = readFileSync(indexPath, "utf8");
|
|
164
|
-
const notRegistered: string[] = [];
|
|
165
|
-
for (const [name] of entries) {
|
|
166
|
-
if (!indexSrc.includes(`register("${name}"`)) {
|
|
167
|
-
notRegistered.push(name);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (notRegistered.length > 0) {
|
|
171
|
-
console.error("NOT REGISTERED in provider/index.ts:", notRegistered);
|
|
172
|
-
process.exit(1);
|
|
173
|
-
}
|
|
174
|
-
console.log(`OK: ${entries.length} providers registered in provider/index.ts`);
|
|
175
|
-
|
|
176
|
-
void LLMExecutor;
|