chainlesschain 0.37.12 → 0.40.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/package.json +3 -2
- package/src/commands/agent.js +7 -1
- package/src/commands/ask.js +24 -9
- package/src/commands/chat.js +7 -1
- package/src/commands/cli-anything.js +266 -0
- package/src/commands/compliance.js +216 -0
- package/src/commands/dao.js +312 -0
- package/src/commands/dlp.js +278 -0
- package/src/commands/evomap.js +558 -0
- package/src/commands/hardening.js +230 -0
- package/src/commands/matrix.js +168 -0
- package/src/commands/nostr.js +185 -0
- package/src/commands/pqc.js +162 -0
- package/src/commands/scim.js +218 -0
- package/src/commands/serve.js +109 -0
- package/src/commands/siem.js +156 -0
- package/src/commands/social.js +480 -0
- package/src/commands/terraform.js +148 -0
- package/src/constants.js +1 -0
- package/src/index.js +60 -0
- package/src/lib/autonomous-agent.js +487 -0
- package/src/lib/cli-anything-bridge.js +379 -0
- package/src/lib/cli-context-engineering.js +472 -0
- package/src/lib/compliance-manager.js +290 -0
- package/src/lib/content-recommender.js +205 -0
- package/src/lib/dao-governance.js +296 -0
- package/src/lib/dlp-engine.js +304 -0
- package/src/lib/evomap-client.js +135 -0
- package/src/lib/evomap-federation.js +240 -0
- package/src/lib/evomap-governance.js +250 -0
- package/src/lib/evomap-manager.js +227 -0
- package/src/lib/git-integration.js +1 -1
- package/src/lib/hardening-manager.js +275 -0
- package/src/lib/llm-providers.js +14 -1
- package/src/lib/matrix-bridge.js +196 -0
- package/src/lib/nostr-bridge.js +195 -0
- package/src/lib/permanent-memory.js +370 -0
- package/src/lib/plan-mode.js +211 -0
- package/src/lib/pqc-manager.js +196 -0
- package/src/lib/scim-manager.js +212 -0
- package/src/lib/session-manager.js +38 -0
- package/src/lib/siem-exporter.js +137 -0
- package/src/lib/social-manager.js +283 -0
- package/src/lib/task-model-selector.js +232 -0
- package/src/lib/terraform-manager.js +201 -0
- package/src/lib/ws-server.js +474 -0
- package/src/repl/agent-repl.js +796 -41
- package/src/repl/chat-repl.js +14 -6
package/src/repl/chat-repl.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import readline from "readline";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
import { logger } from "../lib/logger.js";
|
|
14
|
+
import { BUILT_IN_PROVIDERS } from "../lib/llm-providers.js";
|
|
14
15
|
|
|
15
16
|
const SLASH_COMMANDS = {
|
|
16
17
|
"/exit": "Exit the chat",
|
|
@@ -128,7 +129,7 @@ export async function startChatRepl(options = {}) {
|
|
|
128
129
|
let model = options.model || "qwen2:7b";
|
|
129
130
|
let provider = options.provider || "ollama";
|
|
130
131
|
const baseUrl = options.baseUrl || "http://localhost:11434";
|
|
131
|
-
const apiKey = options.apiKey ||
|
|
132
|
+
const apiKey = options.apiKey || null;
|
|
132
133
|
|
|
133
134
|
const messages = [];
|
|
134
135
|
|
|
@@ -236,14 +237,21 @@ export async function startChatRepl(options = {}) {
|
|
|
236
237
|
|
|
237
238
|
if (provider === "ollama") {
|
|
238
239
|
response = await streamOllama(messages, model, baseUrl, onToken);
|
|
239
|
-
} else
|
|
240
|
+
} else {
|
|
241
|
+
// OpenAI-compatible providers (openai, volcengine, deepseek, dashscope, mistral, gemini, anthropic-proxy)
|
|
242
|
+
const providerDef = BUILT_IN_PROVIDERS[provider];
|
|
240
243
|
const url =
|
|
241
244
|
baseUrl !== "http://localhost:11434"
|
|
242
245
|
? baseUrl
|
|
243
|
-
: "https://api.openai.com/v1";
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
: providerDef?.baseUrl || "https://api.openai.com/v1";
|
|
247
|
+
const key =
|
|
248
|
+
apiKey ||
|
|
249
|
+
(providerDef?.apiKeyEnv ? process.env[providerDef.apiKeyEnv] : null);
|
|
250
|
+
if (!key)
|
|
251
|
+
throw new Error(
|
|
252
|
+
`API key required for ${provider} (set ${providerDef?.apiKeyEnv || "API key"})`,
|
|
253
|
+
);
|
|
254
|
+
response = await streamOpenAI(messages, model, url, key, onToken);
|
|
247
255
|
}
|
|
248
256
|
|
|
249
257
|
process.stdout.write("\n\n");
|