@shadowob/connector 1.1.17 → 1.1.18
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/README.md +51 -2
- package/dist/cli.js +622 -128
- package/dist/index.cjs +78 -12
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +78 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
32
32
|
|
|
33
33
|
// src/cc-connect-fork.ts
|
|
34
34
|
var CC_CONNECT_FORK_REPO = "buggyblues/cc-connect";
|
|
35
|
-
var CC_CONNECT_FORK_REF = "
|
|
35
|
+
var CC_CONNECT_FORK_REF = "f382563cfebaef36c5d257461dfaf318161fe3ea";
|
|
36
36
|
var CC_CONNECT_FORK_SHORT_REF = CC_CONNECT_FORK_REF.slice(0, 7);
|
|
37
37
|
var CC_CONNECT_FORK_DOCS_URL = `https://github.com/${CC_CONNECT_FORK_REPO}/blob/main/docs/shadowob.md`;
|
|
38
38
|
|
|
@@ -228,9 +228,35 @@ var normalizeServerUrl = (value) => {
|
|
|
228
228
|
return trimmed.endsWith("/api") ? trimmed.slice(0, -4) : trimmed.replace(/\/$/, "");
|
|
229
229
|
};
|
|
230
230
|
var tokenOrPlaceholder = (token) => token.trim() || "<BUDDY_TOKEN>";
|
|
231
|
+
function normalizeModelProvider(input) {
|
|
232
|
+
const baseUrl = input.modelProvider?.baseUrl.trim();
|
|
233
|
+
const apiKey = input.modelProvider?.apiKey.trim();
|
|
234
|
+
const model = input.modelProvider?.model.trim();
|
|
235
|
+
if (!baseUrl || !apiKey || !model) return null;
|
|
236
|
+
return {
|
|
237
|
+
id: input.modelProvider?.id?.trim() || "shadow-official",
|
|
238
|
+
label: input.modelProvider?.label?.trim() || "Shadow official LLM proxy",
|
|
239
|
+
baseUrl,
|
|
240
|
+
apiKey,
|
|
241
|
+
model
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function modelProviderEnvLines(provider) {
|
|
245
|
+
if (!provider) return [];
|
|
246
|
+
return [
|
|
247
|
+
`OPENAI_COMPATIBLE_BASE_URL=${shellQuote(provider.baseUrl)}`,
|
|
248
|
+
`OPENAI_COMPATIBLE_API_KEY=${shellQuote(provider.apiKey)}`,
|
|
249
|
+
`OPENAI_COMPATIBLE_MODEL_ID=${shellQuote(provider.model)}`,
|
|
250
|
+
`SHADOW_MODEL_PROVIDER_ID=${shellQuote(provider.id ?? "shadow-official")}`
|
|
251
|
+
];
|
|
252
|
+
}
|
|
253
|
+
function modelProviderCapabilities(provider, capabilities) {
|
|
254
|
+
return provider ? [...capabilities, "officialModelProvider"] : capabilities;
|
|
255
|
+
}
|
|
231
256
|
function buildOpenClawPlan(input) {
|
|
232
257
|
const token = tokenOrPlaceholder(input.token);
|
|
233
258
|
const serverUrl = normalizeServerUrl(input.serverUrl);
|
|
259
|
+
const modelProvider = normalizeModelProvider(input);
|
|
234
260
|
const jsonConfig = JSON.stringify(
|
|
235
261
|
{
|
|
236
262
|
channels: {
|
|
@@ -238,7 +264,21 @@ function buildOpenClawPlan(input) {
|
|
|
238
264
|
token,
|
|
239
265
|
serverUrl
|
|
240
266
|
}
|
|
241
|
-
}
|
|
267
|
+
},
|
|
268
|
+
...modelProvider ? {
|
|
269
|
+
models: {
|
|
270
|
+
mode: "merge",
|
|
271
|
+
providers: {
|
|
272
|
+
[modelProvider.id ?? "shadow-official"]: {
|
|
273
|
+
api: "openai-completions",
|
|
274
|
+
apiKey: "${env:OPENAI_COMPATIBLE_API_KEY}",
|
|
275
|
+
baseUrl: modelProvider.baseUrl,
|
|
276
|
+
request: { allowPrivateNetwork: true },
|
|
277
|
+
models: [{ id: modelProvider.model, name: modelProvider.model }]
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
} : {}
|
|
242
282
|
},
|
|
243
283
|
null,
|
|
244
284
|
2
|
|
@@ -284,6 +324,7 @@ function buildOpenClawPlan(input) {
|
|
|
284
324
|
"",
|
|
285
325
|
`Preferred one-line setup: ${connectCommand}`,
|
|
286
326
|
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before applying the OpenClaw channel config.",
|
|
327
|
+
modelProvider ? `It also configures ${modelProvider.label ?? "Shadow official LLM proxy"} as an OpenAI-compatible model provider (${modelProvider.model}).` : "",
|
|
287
328
|
"",
|
|
288
329
|
"Run these steps in order:",
|
|
289
330
|
...commands.map((item, index) => `${index + 1}. ${item.command}`),
|
|
@@ -291,7 +332,7 @@ function buildOpenClawPlan(input) {
|
|
|
291
332
|
"Confirm each step and then verify the gateway is running."
|
|
292
333
|
].join("\n"),
|
|
293
334
|
docsUrl: "/product/index.html",
|
|
294
|
-
capabilities: [
|
|
335
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
295
336
|
"channelMessages",
|
|
296
337
|
"dms",
|
|
297
338
|
"threads",
|
|
@@ -312,18 +353,20 @@ function buildOpenClawPlan(input) {
|
|
|
312
353
|
"notifications",
|
|
313
354
|
"officialSkills",
|
|
314
355
|
"cronTasks"
|
|
315
|
-
]
|
|
356
|
+
])
|
|
316
357
|
};
|
|
317
358
|
}
|
|
318
359
|
function buildHermesPlan(input) {
|
|
319
360
|
const token = tokenOrPlaceholder(input.token);
|
|
320
361
|
const serverUrl = normalizeServerUrl(input.serverUrl);
|
|
362
|
+
const modelProvider = normalizeModelProvider(input);
|
|
321
363
|
const envBlock = [
|
|
322
364
|
`SHADOW_BASE_URL=${shellQuote(serverUrl)}`,
|
|
323
365
|
`SHADOW_TOKEN=${shellQuote(token)}`,
|
|
324
366
|
"SHADOW_ALLOW_ALL_USERS=true",
|
|
325
367
|
"SHADOW_HEARTBEAT_INTERVAL_SECONDS=30",
|
|
326
|
-
`SHADOW_SLASH_COMMANDS_JSON=${shellQuote("[]")}
|
|
368
|
+
`SHADOW_SLASH_COMMANDS_JSON=${shellQuote("[]")}`,
|
|
369
|
+
...modelProviderEnvLines(modelProvider)
|
|
327
370
|
].join("\n");
|
|
328
371
|
const yamlConfig = [
|
|
329
372
|
"plugins:",
|
|
@@ -340,7 +383,14 @@ function buildHermesPlan(input) {
|
|
|
340
383
|
" rest_only: false",
|
|
341
384
|
" catchup_minutes: 0",
|
|
342
385
|
" download_media: true",
|
|
343
|
-
" slash_commands: []"
|
|
386
|
+
" slash_commands: []",
|
|
387
|
+
...modelProvider ? [
|
|
388
|
+
"",
|
|
389
|
+
"model:",
|
|
390
|
+
` default: "${modelProvider.model}"`,
|
|
391
|
+
" provider: custom",
|
|
392
|
+
` base_url: "${modelProvider.baseUrl}"`
|
|
393
|
+
] : []
|
|
344
394
|
].join("\n");
|
|
345
395
|
const commands = [
|
|
346
396
|
{
|
|
@@ -384,10 +434,11 @@ function buildHermesPlan(input) {
|
|
|
384
434
|
`Buddy token: ${token}`,
|
|
385
435
|
"",
|
|
386
436
|
`Preferred one-line setup: ${connectCommand}`,
|
|
387
|
-
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before writing Hermes config. The plugin resolves the Buddy agent id and channel policy from Shadow at runtime."
|
|
437
|
+
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before writing Hermes config. The plugin resolves the Buddy agent id and channel policy from Shadow at runtime.",
|
|
438
|
+
modelProvider ? `It also configures Hermes custom model endpoint ${modelProvider.baseUrl} with model ${modelProvider.model}.` : ""
|
|
388
439
|
].join("\n"),
|
|
389
440
|
docsUrl: "https://hermes-agent.nousresearch.com/docs/user-guide/messaging",
|
|
390
|
-
capabilities: [
|
|
441
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
391
442
|
"channelMessages",
|
|
392
443
|
"dms",
|
|
393
444
|
"threads",
|
|
@@ -404,7 +455,7 @@ function buildHermesPlan(input) {
|
|
|
404
455
|
"shadowCliLogin",
|
|
405
456
|
"notifications",
|
|
406
457
|
"officialSkills"
|
|
407
|
-
]
|
|
458
|
+
])
|
|
408
459
|
};
|
|
409
460
|
}
|
|
410
461
|
function buildCcConnectPlan(input) {
|
|
@@ -413,6 +464,7 @@ function buildCcConnectPlan(input) {
|
|
|
413
464
|
const projectName = input.projectName?.trim() || DEFAULT_PROJECT_NAME;
|
|
414
465
|
const workDir = input.workDir?.trim() || DEFAULT_WORK_DIR;
|
|
415
466
|
const agentType = input.agentType?.trim() || DEFAULT_CC_AGENT;
|
|
467
|
+
const modelProvider = normalizeModelProvider(input);
|
|
416
468
|
const tomlConfig = [
|
|
417
469
|
'language = "zh"',
|
|
418
470
|
"",
|
|
@@ -424,6 +476,19 @@ function buildCcConnectPlan(input) {
|
|
|
424
476
|
"",
|
|
425
477
|
"[projects.agent.options]",
|
|
426
478
|
`work_dir = "${workDir}"`,
|
|
479
|
+
...modelProvider ? [
|
|
480
|
+
`provider = "${modelProvider.id ?? "shadow-official"}"`,
|
|
481
|
+
`model = "${modelProvider.model}"`,
|
|
482
|
+
"",
|
|
483
|
+
"[[projects.agent.providers]]",
|
|
484
|
+
`name = "${modelProvider.id ?? "shadow-official"}"`,
|
|
485
|
+
`api_key = "${modelProvider.apiKey}"`,
|
|
486
|
+
`base_url = "${modelProvider.baseUrl}"`,
|
|
487
|
+
`model = "${modelProvider.model}"`,
|
|
488
|
+
"",
|
|
489
|
+
"[[projects.agent.providers.models]]",
|
|
490
|
+
`model = "${modelProvider.model}"`
|
|
491
|
+
] : [],
|
|
427
492
|
"",
|
|
428
493
|
"[[projects.platforms]]",
|
|
429
494
|
'type = "shadowob"',
|
|
@@ -476,10 +541,11 @@ function buildCcConnectPlan(input) {
|
|
|
476
541
|
`Agent type: ${agentType}`,
|
|
477
542
|
"",
|
|
478
543
|
`Preferred one-line setup: ${startCommand}`,
|
|
479
|
-
`Install ${CC_CONNECT_FORK_REPO}@${CC_CONNECT_FORK_SHORT_REF}, install/configure the Shadow CLI and official Shadow skill files, add the TOML platform block, and start cc-connect
|
|
544
|
+
`Install ${CC_CONNECT_FORK_REPO}@${CC_CONNECT_FORK_SHORT_REF}, install/configure the Shadow CLI and official Shadow skill files, add the TOML platform block, and start cc-connect.`,
|
|
545
|
+
modelProvider ? `Configure ${modelProvider.label ?? "Shadow official LLM proxy"} as provider ${modelProvider.id ?? "shadow-official"} for ${agentType}.` : ""
|
|
480
546
|
].join("\n"),
|
|
481
547
|
docsUrl: CC_CONNECT_FORK_DOCS_URL,
|
|
482
|
-
capabilities: [
|
|
548
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
483
549
|
"channelMessages",
|
|
484
550
|
"dms",
|
|
485
551
|
"attachments",
|
|
@@ -494,7 +560,7 @@ function buildCcConnectPlan(input) {
|
|
|
494
560
|
"multiAgentBinding",
|
|
495
561
|
"shadowCliLogin",
|
|
496
562
|
"notifications"
|
|
497
|
-
]
|
|
563
|
+
])
|
|
498
564
|
};
|
|
499
565
|
}
|
|
500
566
|
function createConnectorPlan(input) {
|
package/dist/index.d.cts
CHANGED
|
@@ -30,6 +30,14 @@ interface ShadowConnectorInput {
|
|
|
30
30
|
workDir?: string;
|
|
31
31
|
projectName?: string;
|
|
32
32
|
agentType?: 'codex' | 'claudecode' | 'opencode' | 'gemini' | 'cursor' | string;
|
|
33
|
+
modelProvider?: ShadowConnectorModelProvider;
|
|
34
|
+
}
|
|
35
|
+
interface ShadowConnectorModelProvider {
|
|
36
|
+
id?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
baseUrl: string;
|
|
39
|
+
apiKey: string;
|
|
40
|
+
model: string;
|
|
33
41
|
}
|
|
34
42
|
interface ConnectorCommand {
|
|
35
43
|
label: string;
|
|
@@ -55,4 +63,4 @@ interface ConnectorPlan {
|
|
|
55
63
|
declare function createConnectorPlan(input: ShadowConnectorInput): ConnectorPlan;
|
|
56
64
|
declare function createConnectorPlans(input: Omit<ShadowConnectorInput, 'target'>): ConnectorPlan[];
|
|
57
65
|
|
|
58
|
-
export { CONNECTOR_RUNTIME_CATALOG, type ConnectorCommand, type ConnectorConfigBlock, type ConnectorPlan, type ConnectorRuntimeCatalogEntry, type ConnectorRuntimeId, type ConnectorRuntimeInstallSpec, type ConnectorRuntimeKind, type ConnectorRuntimePlatform, type ShadowConnectorInput, type ShadowConnectorTarget, connectorRuntimeById, connectorRuntimeCatalog, connectorRuntimeInstallCommand, connectorRuntimeInstallCommands, createConnectorPlan, createConnectorPlans };
|
|
66
|
+
export { CONNECTOR_RUNTIME_CATALOG, type ConnectorCommand, type ConnectorConfigBlock, type ConnectorPlan, type ConnectorRuntimeCatalogEntry, type ConnectorRuntimeId, type ConnectorRuntimeInstallSpec, type ConnectorRuntimeKind, type ConnectorRuntimePlatform, type ShadowConnectorInput, type ShadowConnectorModelProvider, type ShadowConnectorTarget, connectorRuntimeById, connectorRuntimeCatalog, connectorRuntimeInstallCommand, connectorRuntimeInstallCommands, createConnectorPlan, createConnectorPlans };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ interface ShadowConnectorInput {
|
|
|
30
30
|
workDir?: string;
|
|
31
31
|
projectName?: string;
|
|
32
32
|
agentType?: 'codex' | 'claudecode' | 'opencode' | 'gemini' | 'cursor' | string;
|
|
33
|
+
modelProvider?: ShadowConnectorModelProvider;
|
|
34
|
+
}
|
|
35
|
+
interface ShadowConnectorModelProvider {
|
|
36
|
+
id?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
baseUrl: string;
|
|
39
|
+
apiKey: string;
|
|
40
|
+
model: string;
|
|
33
41
|
}
|
|
34
42
|
interface ConnectorCommand {
|
|
35
43
|
label: string;
|
|
@@ -55,4 +63,4 @@ interface ConnectorPlan {
|
|
|
55
63
|
declare function createConnectorPlan(input: ShadowConnectorInput): ConnectorPlan;
|
|
56
64
|
declare function createConnectorPlans(input: Omit<ShadowConnectorInput, 'target'>): ConnectorPlan[];
|
|
57
65
|
|
|
58
|
-
export { CONNECTOR_RUNTIME_CATALOG, type ConnectorCommand, type ConnectorConfigBlock, type ConnectorPlan, type ConnectorRuntimeCatalogEntry, type ConnectorRuntimeId, type ConnectorRuntimeInstallSpec, type ConnectorRuntimeKind, type ConnectorRuntimePlatform, type ShadowConnectorInput, type ShadowConnectorTarget, connectorRuntimeById, connectorRuntimeCatalog, connectorRuntimeInstallCommand, connectorRuntimeInstallCommands, createConnectorPlan, createConnectorPlans };
|
|
66
|
+
export { CONNECTOR_RUNTIME_CATALOG, type ConnectorCommand, type ConnectorConfigBlock, type ConnectorPlan, type ConnectorRuntimeCatalogEntry, type ConnectorRuntimeId, type ConnectorRuntimeInstallSpec, type ConnectorRuntimeKind, type ConnectorRuntimePlatform, type ShadowConnectorInput, type ShadowConnectorModelProvider, type ShadowConnectorTarget, connectorRuntimeById, connectorRuntimeCatalog, connectorRuntimeInstallCommand, connectorRuntimeInstallCommands, createConnectorPlan, createConnectorPlans };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/cc-connect-fork.ts
|
|
2
2
|
var CC_CONNECT_FORK_REPO = "buggyblues/cc-connect";
|
|
3
|
-
var CC_CONNECT_FORK_REF = "
|
|
3
|
+
var CC_CONNECT_FORK_REF = "f382563cfebaef36c5d257461dfaf318161fe3ea";
|
|
4
4
|
var CC_CONNECT_FORK_SHORT_REF = CC_CONNECT_FORK_REF.slice(0, 7);
|
|
5
5
|
var CC_CONNECT_FORK_DOCS_URL = `https://github.com/${CC_CONNECT_FORK_REPO}/blob/main/docs/shadowob.md`;
|
|
6
6
|
|
|
@@ -196,9 +196,35 @@ var normalizeServerUrl = (value) => {
|
|
|
196
196
|
return trimmed.endsWith("/api") ? trimmed.slice(0, -4) : trimmed.replace(/\/$/, "");
|
|
197
197
|
};
|
|
198
198
|
var tokenOrPlaceholder = (token) => token.trim() || "<BUDDY_TOKEN>";
|
|
199
|
+
function normalizeModelProvider(input) {
|
|
200
|
+
const baseUrl = input.modelProvider?.baseUrl.trim();
|
|
201
|
+
const apiKey = input.modelProvider?.apiKey.trim();
|
|
202
|
+
const model = input.modelProvider?.model.trim();
|
|
203
|
+
if (!baseUrl || !apiKey || !model) return null;
|
|
204
|
+
return {
|
|
205
|
+
id: input.modelProvider?.id?.trim() || "shadow-official",
|
|
206
|
+
label: input.modelProvider?.label?.trim() || "Shadow official LLM proxy",
|
|
207
|
+
baseUrl,
|
|
208
|
+
apiKey,
|
|
209
|
+
model
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function modelProviderEnvLines(provider) {
|
|
213
|
+
if (!provider) return [];
|
|
214
|
+
return [
|
|
215
|
+
`OPENAI_COMPATIBLE_BASE_URL=${shellQuote(provider.baseUrl)}`,
|
|
216
|
+
`OPENAI_COMPATIBLE_API_KEY=${shellQuote(provider.apiKey)}`,
|
|
217
|
+
`OPENAI_COMPATIBLE_MODEL_ID=${shellQuote(provider.model)}`,
|
|
218
|
+
`SHADOW_MODEL_PROVIDER_ID=${shellQuote(provider.id ?? "shadow-official")}`
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
function modelProviderCapabilities(provider, capabilities) {
|
|
222
|
+
return provider ? [...capabilities, "officialModelProvider"] : capabilities;
|
|
223
|
+
}
|
|
199
224
|
function buildOpenClawPlan(input) {
|
|
200
225
|
const token = tokenOrPlaceholder(input.token);
|
|
201
226
|
const serverUrl = normalizeServerUrl(input.serverUrl);
|
|
227
|
+
const modelProvider = normalizeModelProvider(input);
|
|
202
228
|
const jsonConfig = JSON.stringify(
|
|
203
229
|
{
|
|
204
230
|
channels: {
|
|
@@ -206,7 +232,21 @@ function buildOpenClawPlan(input) {
|
|
|
206
232
|
token,
|
|
207
233
|
serverUrl
|
|
208
234
|
}
|
|
209
|
-
}
|
|
235
|
+
},
|
|
236
|
+
...modelProvider ? {
|
|
237
|
+
models: {
|
|
238
|
+
mode: "merge",
|
|
239
|
+
providers: {
|
|
240
|
+
[modelProvider.id ?? "shadow-official"]: {
|
|
241
|
+
api: "openai-completions",
|
|
242
|
+
apiKey: "${env:OPENAI_COMPATIBLE_API_KEY}",
|
|
243
|
+
baseUrl: modelProvider.baseUrl,
|
|
244
|
+
request: { allowPrivateNetwork: true },
|
|
245
|
+
models: [{ id: modelProvider.model, name: modelProvider.model }]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} : {}
|
|
210
250
|
},
|
|
211
251
|
null,
|
|
212
252
|
2
|
|
@@ -252,6 +292,7 @@ function buildOpenClawPlan(input) {
|
|
|
252
292
|
"",
|
|
253
293
|
`Preferred one-line setup: ${connectCommand}`,
|
|
254
294
|
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before applying the OpenClaw channel config.",
|
|
295
|
+
modelProvider ? `It also configures ${modelProvider.label ?? "Shadow official LLM proxy"} as an OpenAI-compatible model provider (${modelProvider.model}).` : "",
|
|
255
296
|
"",
|
|
256
297
|
"Run these steps in order:",
|
|
257
298
|
...commands.map((item, index) => `${index + 1}. ${item.command}`),
|
|
@@ -259,7 +300,7 @@ function buildOpenClawPlan(input) {
|
|
|
259
300
|
"Confirm each step and then verify the gateway is running."
|
|
260
301
|
].join("\n"),
|
|
261
302
|
docsUrl: "/product/index.html",
|
|
262
|
-
capabilities: [
|
|
303
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
263
304
|
"channelMessages",
|
|
264
305
|
"dms",
|
|
265
306
|
"threads",
|
|
@@ -280,18 +321,20 @@ function buildOpenClawPlan(input) {
|
|
|
280
321
|
"notifications",
|
|
281
322
|
"officialSkills",
|
|
282
323
|
"cronTasks"
|
|
283
|
-
]
|
|
324
|
+
])
|
|
284
325
|
};
|
|
285
326
|
}
|
|
286
327
|
function buildHermesPlan(input) {
|
|
287
328
|
const token = tokenOrPlaceholder(input.token);
|
|
288
329
|
const serverUrl = normalizeServerUrl(input.serverUrl);
|
|
330
|
+
const modelProvider = normalizeModelProvider(input);
|
|
289
331
|
const envBlock = [
|
|
290
332
|
`SHADOW_BASE_URL=${shellQuote(serverUrl)}`,
|
|
291
333
|
`SHADOW_TOKEN=${shellQuote(token)}`,
|
|
292
334
|
"SHADOW_ALLOW_ALL_USERS=true",
|
|
293
335
|
"SHADOW_HEARTBEAT_INTERVAL_SECONDS=30",
|
|
294
|
-
`SHADOW_SLASH_COMMANDS_JSON=${shellQuote("[]")}
|
|
336
|
+
`SHADOW_SLASH_COMMANDS_JSON=${shellQuote("[]")}`,
|
|
337
|
+
...modelProviderEnvLines(modelProvider)
|
|
295
338
|
].join("\n");
|
|
296
339
|
const yamlConfig = [
|
|
297
340
|
"plugins:",
|
|
@@ -308,7 +351,14 @@ function buildHermesPlan(input) {
|
|
|
308
351
|
" rest_only: false",
|
|
309
352
|
" catchup_minutes: 0",
|
|
310
353
|
" download_media: true",
|
|
311
|
-
" slash_commands: []"
|
|
354
|
+
" slash_commands: []",
|
|
355
|
+
...modelProvider ? [
|
|
356
|
+
"",
|
|
357
|
+
"model:",
|
|
358
|
+
` default: "${modelProvider.model}"`,
|
|
359
|
+
" provider: custom",
|
|
360
|
+
` base_url: "${modelProvider.baseUrl}"`
|
|
361
|
+
] : []
|
|
312
362
|
].join("\n");
|
|
313
363
|
const commands = [
|
|
314
364
|
{
|
|
@@ -352,10 +402,11 @@ function buildHermesPlan(input) {
|
|
|
352
402
|
`Buddy token: ${token}`,
|
|
353
403
|
"",
|
|
354
404
|
`Preferred one-line setup: ${connectCommand}`,
|
|
355
|
-
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before writing Hermes config. The plugin resolves the Buddy agent id and channel policy from Shadow at runtime."
|
|
405
|
+
"The connector installs/configures the Shadow CLI, official Shadow skill files, and the Buddy profile before writing Hermes config. The plugin resolves the Buddy agent id and channel policy from Shadow at runtime.",
|
|
406
|
+
modelProvider ? `It also configures Hermes custom model endpoint ${modelProvider.baseUrl} with model ${modelProvider.model}.` : ""
|
|
356
407
|
].join("\n"),
|
|
357
408
|
docsUrl: "https://hermes-agent.nousresearch.com/docs/user-guide/messaging",
|
|
358
|
-
capabilities: [
|
|
409
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
359
410
|
"channelMessages",
|
|
360
411
|
"dms",
|
|
361
412
|
"threads",
|
|
@@ -372,7 +423,7 @@ function buildHermesPlan(input) {
|
|
|
372
423
|
"shadowCliLogin",
|
|
373
424
|
"notifications",
|
|
374
425
|
"officialSkills"
|
|
375
|
-
]
|
|
426
|
+
])
|
|
376
427
|
};
|
|
377
428
|
}
|
|
378
429
|
function buildCcConnectPlan(input) {
|
|
@@ -381,6 +432,7 @@ function buildCcConnectPlan(input) {
|
|
|
381
432
|
const projectName = input.projectName?.trim() || DEFAULT_PROJECT_NAME;
|
|
382
433
|
const workDir = input.workDir?.trim() || DEFAULT_WORK_DIR;
|
|
383
434
|
const agentType = input.agentType?.trim() || DEFAULT_CC_AGENT;
|
|
435
|
+
const modelProvider = normalizeModelProvider(input);
|
|
384
436
|
const tomlConfig = [
|
|
385
437
|
'language = "zh"',
|
|
386
438
|
"",
|
|
@@ -392,6 +444,19 @@ function buildCcConnectPlan(input) {
|
|
|
392
444
|
"",
|
|
393
445
|
"[projects.agent.options]",
|
|
394
446
|
`work_dir = "${workDir}"`,
|
|
447
|
+
...modelProvider ? [
|
|
448
|
+
`provider = "${modelProvider.id ?? "shadow-official"}"`,
|
|
449
|
+
`model = "${modelProvider.model}"`,
|
|
450
|
+
"",
|
|
451
|
+
"[[projects.agent.providers]]",
|
|
452
|
+
`name = "${modelProvider.id ?? "shadow-official"}"`,
|
|
453
|
+
`api_key = "${modelProvider.apiKey}"`,
|
|
454
|
+
`base_url = "${modelProvider.baseUrl}"`,
|
|
455
|
+
`model = "${modelProvider.model}"`,
|
|
456
|
+
"",
|
|
457
|
+
"[[projects.agent.providers.models]]",
|
|
458
|
+
`model = "${modelProvider.model}"`
|
|
459
|
+
] : [],
|
|
395
460
|
"",
|
|
396
461
|
"[[projects.platforms]]",
|
|
397
462
|
'type = "shadowob"',
|
|
@@ -444,10 +509,11 @@ function buildCcConnectPlan(input) {
|
|
|
444
509
|
`Agent type: ${agentType}`,
|
|
445
510
|
"",
|
|
446
511
|
`Preferred one-line setup: ${startCommand}`,
|
|
447
|
-
`Install ${CC_CONNECT_FORK_REPO}@${CC_CONNECT_FORK_SHORT_REF}, install/configure the Shadow CLI and official Shadow skill files, add the TOML platform block, and start cc-connect
|
|
512
|
+
`Install ${CC_CONNECT_FORK_REPO}@${CC_CONNECT_FORK_SHORT_REF}, install/configure the Shadow CLI and official Shadow skill files, add the TOML platform block, and start cc-connect.`,
|
|
513
|
+
modelProvider ? `Configure ${modelProvider.label ?? "Shadow official LLM proxy"} as provider ${modelProvider.id ?? "shadow-official"} for ${agentType}.` : ""
|
|
448
514
|
].join("\n"),
|
|
449
515
|
docsUrl: CC_CONNECT_FORK_DOCS_URL,
|
|
450
|
-
capabilities: [
|
|
516
|
+
capabilities: modelProviderCapabilities(modelProvider, [
|
|
451
517
|
"channelMessages",
|
|
452
518
|
"dms",
|
|
453
519
|
"attachments",
|
|
@@ -462,7 +528,7 @@ function buildCcConnectPlan(input) {
|
|
|
462
528
|
"multiAgentBinding",
|
|
463
529
|
"shadowCliLogin",
|
|
464
530
|
"notifications"
|
|
465
|
-
]
|
|
531
|
+
])
|
|
466
532
|
};
|
|
467
533
|
}
|
|
468
534
|
function createConnectorPlan(input) {
|