@automagik/omni 2.260422.3 → 2.260422.5
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/commands/agents.d.ts.map +1 -1
- package/dist/commands/follow-up.d.ts.map +1 -1
- package/dist/commands/instances.d.ts.map +1 -1
- package/dist/commands/providers.d.ts +1 -1
- package/dist/commands/providers.d.ts.map +1 -1
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/index.js +157 -37
- package/dist/resolve.d.ts +36 -0
- package/dist/resolve.d.ts.map +1 -1
- package/dist/server/index.js +17592 -87059
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmJpC,wBAAgB,mBAAmB,IAAI,OAAO,CA2K7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"follow-up.d.ts","sourceRoot":"","sources":["../../src/commands/follow-up.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"follow-up.d.ts","sourceRoot":"","sources":["../../src/commands/follow-up.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,wBAAgB,qBAAqB,IAAI,OAAO,CAmE/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/commands/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0KpC,wBAAgB,sBAAsB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/commands/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0KpC,wBAAgB,sBAAsB,IAAI,OAAO,CA0pChD"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* omni providers create --name <name> --schema <schema> --base-url <url> [--api-key <key>]
|
|
7
7
|
* Claude Code: --project-path <path> [--max-turns <n>] [--permission-mode <mode>]
|
|
8
8
|
* OpenClaw: --default-agent-id <id>
|
|
9
|
-
*
|
|
9
|
+
* nats-genie: --agent-name <name> --target-agent <name> [--team-name <template>]
|
|
10
10
|
* omni providers update <id> [--name <name>] [--base-url <url>] [--api-key <key>] [--schema-config <json>]
|
|
11
11
|
* omni providers setup openclaw --gateway-url <url> --gateway-token <token> --agent-id <id>
|
|
12
12
|
* omni providers agents <id>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/commands/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/commands/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiUpC,wBAAgB,sBAAsB,IAAI,OAAO,CA6JhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/commands/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/commands/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,qBAAqB,IAAI,OAAO,CAmL/C"}
|
package/dist/index.js
CHANGED
|
@@ -113804,7 +113804,7 @@ import { fileURLToPath } from "url";
|
|
|
113804
113804
|
// package.json
|
|
113805
113805
|
var package_default = {
|
|
113806
113806
|
name: "@automagik/omni",
|
|
113807
|
-
version: "2.260422.
|
|
113807
|
+
version: "2.260422.5",
|
|
113808
113808
|
description: "LLM-optimized CLI for Omni",
|
|
113809
113809
|
type: "module",
|
|
113810
113810
|
bin: {
|
|
@@ -113824,19 +113824,19 @@ var package_default = {
|
|
|
113824
113824
|
test: "bun test",
|
|
113825
113825
|
"test:integration": "RUN_INTEGRATION_TESTS=1 bun test",
|
|
113826
113826
|
clean: "rm -rf dist db",
|
|
113827
|
-
"build:server": "bun build src/bundled-server-entry.ts --outdir dist/server --entry-naming 'index.[ext]' --asset-naming '[name].[ext]' --target bun --external @anthropic-ai/claude-agent-sdk --external @snazzah/davey --external libsodium-wrappers --external opusscript",
|
|
113827
|
+
"build:server": "bun build src/bundled-server-entry.ts --outdir dist/server --entry-naming 'index.[ext]' --asset-naming '[name].[ext]' --target bun --external @anthropic-ai/claude-agent-sdk --external @snazzah/davey --external libsodium-wrappers --external opusscript --external pdf-parse --external mammoth --external exceljs",
|
|
113828
113828
|
"build:migrations": "rm -rf db/drizzle && mkdir -p db && cp -r ../db/drizzle db/drizzle",
|
|
113829
113829
|
prepack: "bun run build && bun run build:server && bun run build:migrations"
|
|
113830
113830
|
},
|
|
113831
113831
|
dependencies: {
|
|
113832
113832
|
"@anthropic-ai/claude-agent-sdk": "^0.2.62",
|
|
113833
113833
|
"@sentry/bun": "^10.43.0",
|
|
113834
|
-
"@snazzah/davey": "^0.1.11",
|
|
113835
113834
|
chalk: "^5.4.0",
|
|
113836
113835
|
commander: "^13.1.0",
|
|
113837
|
-
|
|
113838
|
-
|
|
113836
|
+
exceljs: "^4.4.0",
|
|
113837
|
+
mammoth: "^1.8.0",
|
|
113839
113838
|
ora: "^8.1.1",
|
|
113839
|
+
"pdf-parse": "^1.1.1",
|
|
113840
113840
|
"qrcode-terminal": "^0.12.0"
|
|
113841
113841
|
},
|
|
113842
113842
|
devDependencies: {
|
|
@@ -114343,6 +114343,99 @@ ${ids}`);
|
|
|
114343
114343
|
}
|
|
114344
114344
|
error(`No batch job found matching "${input}"`);
|
|
114345
114345
|
}
|
|
114346
|
+
async function resolveProviderId(input) {
|
|
114347
|
+
if (UUID_RE.test(input))
|
|
114348
|
+
return input;
|
|
114349
|
+
const client = getClient();
|
|
114350
|
+
const providers = await client.providers.list({});
|
|
114351
|
+
if (/^[0-9a-f]{2,}$/i.test(input)) {
|
|
114352
|
+
const matches = providers.filter((p) => p.id.toLowerCase().startsWith(input.toLowerCase()));
|
|
114353
|
+
if (matches.length === 1)
|
|
114354
|
+
return matches[0].id;
|
|
114355
|
+
if (matches.length > 1) {
|
|
114356
|
+
const names = matches.map((p) => ` ${p.id.slice(0, 8)} ${p.name}`).join(`
|
|
114357
|
+
`);
|
|
114358
|
+
error(`Ambiguous ID prefix "${input}" matches ${matches.length} providers:
|
|
114359
|
+
${names}`);
|
|
114360
|
+
}
|
|
114361
|
+
}
|
|
114362
|
+
const lower = input.toLowerCase();
|
|
114363
|
+
const exactName = providers.find((p) => p.name.toLowerCase() === lower);
|
|
114364
|
+
if (exactName)
|
|
114365
|
+
return exactName.id;
|
|
114366
|
+
const nameMatches = providers.filter((p) => p.name.toLowerCase().includes(lower));
|
|
114367
|
+
if (nameMatches.length === 1)
|
|
114368
|
+
return nameMatches[0].id;
|
|
114369
|
+
if (nameMatches.length > 1) {
|
|
114370
|
+
const names = nameMatches.map((p) => ` ${p.id.slice(0, 8)} ${p.name}`).join(`
|
|
114371
|
+
`);
|
|
114372
|
+
error(`Ambiguous name "${input}" matches ${nameMatches.length} providers:
|
|
114373
|
+
${names}`);
|
|
114374
|
+
}
|
|
114375
|
+
error(`No provider found matching "${input}"`);
|
|
114376
|
+
}
|
|
114377
|
+
async function resolveAgentId(input) {
|
|
114378
|
+
if (UUID_RE.test(input))
|
|
114379
|
+
return input;
|
|
114380
|
+
const client = getClient();
|
|
114381
|
+
const { items: agents } = await client.agents.list({});
|
|
114382
|
+
if (/^[0-9a-f]{2,}$/i.test(input)) {
|
|
114383
|
+
const matches = agents.filter((a) => a.id.toLowerCase().startsWith(input.toLowerCase()));
|
|
114384
|
+
if (matches.length === 1)
|
|
114385
|
+
return matches[0].id;
|
|
114386
|
+
if (matches.length > 1) {
|
|
114387
|
+
const names = matches.map((a) => ` ${a.id.slice(0, 8)} ${a.name}`).join(`
|
|
114388
|
+
`);
|
|
114389
|
+
error(`Ambiguous ID prefix "${input}" matches ${matches.length} agents:
|
|
114390
|
+
${names}`);
|
|
114391
|
+
}
|
|
114392
|
+
}
|
|
114393
|
+
const lower = input.toLowerCase();
|
|
114394
|
+
const exactName = agents.find((a) => a.name.toLowerCase() === lower);
|
|
114395
|
+
if (exactName)
|
|
114396
|
+
return exactName.id;
|
|
114397
|
+
const nameMatches = agents.filter((a) => a.name.toLowerCase().includes(lower));
|
|
114398
|
+
if (nameMatches.length === 1)
|
|
114399
|
+
return nameMatches[0].id;
|
|
114400
|
+
if (nameMatches.length > 1) {
|
|
114401
|
+
const names = nameMatches.map((a) => ` ${a.id.slice(0, 8)} ${a.name}`).join(`
|
|
114402
|
+
`);
|
|
114403
|
+
error(`Ambiguous name "${input}" matches ${nameMatches.length} agents:
|
|
114404
|
+
${names}`);
|
|
114405
|
+
}
|
|
114406
|
+
error(`No agent found matching "${input}"`);
|
|
114407
|
+
}
|
|
114408
|
+
async function resolveWebhookId(input) {
|
|
114409
|
+
if (UUID_RE.test(input))
|
|
114410
|
+
return input;
|
|
114411
|
+
const client = getClient();
|
|
114412
|
+
const sources = await client.webhooks.listSources({});
|
|
114413
|
+
if (/^[0-9a-f]{2,}$/i.test(input)) {
|
|
114414
|
+
const matches = sources.filter((w) => w.id.toLowerCase().startsWith(input.toLowerCase()));
|
|
114415
|
+
if (matches.length === 1)
|
|
114416
|
+
return matches[0].id;
|
|
114417
|
+
if (matches.length > 1) {
|
|
114418
|
+
const names = matches.map((w) => ` ${w.id.slice(0, 8)} ${w.name}`).join(`
|
|
114419
|
+
`);
|
|
114420
|
+
error(`Ambiguous ID prefix "${input}" matches ${matches.length} webhook sources:
|
|
114421
|
+
${names}`);
|
|
114422
|
+
}
|
|
114423
|
+
}
|
|
114424
|
+
const lower = input.toLowerCase();
|
|
114425
|
+
const exactName = sources.find((w) => w.name.toLowerCase() === lower);
|
|
114426
|
+
if (exactName)
|
|
114427
|
+
return exactName.id;
|
|
114428
|
+
const nameMatches = sources.filter((w) => w.name.toLowerCase().includes(lower));
|
|
114429
|
+
if (nameMatches.length === 1)
|
|
114430
|
+
return nameMatches[0].id;
|
|
114431
|
+
if (nameMatches.length > 1) {
|
|
114432
|
+
const names = nameMatches.map((w) => ` ${w.id.slice(0, 8)} ${w.name}`).join(`
|
|
114433
|
+
`);
|
|
114434
|
+
error(`Ambiguous name "${input}" matches ${nameMatches.length} webhook sources:
|
|
114435
|
+
${names}`);
|
|
114436
|
+
}
|
|
114437
|
+
error(`No webhook source found matching "${input}"`);
|
|
114438
|
+
}
|
|
114346
114439
|
async function resolveRouteId(instanceId, input) {
|
|
114347
114440
|
if (UUID_RE.test(input))
|
|
114348
114441
|
return input;
|
|
@@ -114678,9 +114771,10 @@ function createAgentsCommand() {
|
|
|
114678
114771
|
}
|
|
114679
114772
|
});
|
|
114680
114773
|
agents.command("get <id>").description("Get agent details").action(async (id) => {
|
|
114774
|
+
const resolvedId = await resolveAgentId(id);
|
|
114681
114775
|
const client = getClient();
|
|
114682
114776
|
try {
|
|
114683
|
-
const agent = await client.agents.get(
|
|
114777
|
+
const agent = await client.agents.get(resolvedId);
|
|
114684
114778
|
data(agent);
|
|
114685
114779
|
} catch (err) {
|
|
114686
114780
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
@@ -114703,10 +114797,11 @@ function createAgentsCommand() {
|
|
|
114703
114797
|
if (options.configPath !== undefined)
|
|
114704
114798
|
body.configPath = options.configPath;
|
|
114705
114799
|
const parsedMetadata = parseMetadataJson(options.metadata);
|
|
114800
|
+
const resolvedId = await resolveAgentId(id);
|
|
114706
114801
|
const client = getClient();
|
|
114707
114802
|
try {
|
|
114708
114803
|
if (parsedMetadata !== undefined || options.providerAgentId !== undefined) {
|
|
114709
|
-
const existing = await client.agents.get(
|
|
114804
|
+
const existing = await client.agents.get(resolvedId);
|
|
114710
114805
|
const existingMetadata = existing.metadata ?? {};
|
|
114711
114806
|
const merged = { ...existingMetadata, ...parsedMetadata ?? {} };
|
|
114712
114807
|
if (options.providerAgentId !== undefined)
|
|
@@ -114716,7 +114811,7 @@ function createAgentsCommand() {
|
|
|
114716
114811
|
if (Object.keys(body).length === 0) {
|
|
114717
114812
|
error("No fields to update. Pass at least one of --name, --model, --provider, --agent-provider, --type, --active, --inactive, --config-path, --metadata, --provider-agent-id.");
|
|
114718
114813
|
}
|
|
114719
|
-
const agent = await client.agents.update(
|
|
114814
|
+
const agent = await client.agents.update(resolvedId, body);
|
|
114720
114815
|
data(agent);
|
|
114721
114816
|
} catch (err) {
|
|
114722
114817
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
@@ -114724,10 +114819,11 @@ function createAgentsCommand() {
|
|
|
114724
114819
|
}
|
|
114725
114820
|
});
|
|
114726
114821
|
agents.command("delete <id>").description("Delete an agent (soft-delete, sets inactive)").action(async (id) => {
|
|
114822
|
+
const resolvedId = await resolveAgentId(id);
|
|
114727
114823
|
const client = getClient();
|
|
114728
114824
|
try {
|
|
114729
|
-
await client.agents.delete(
|
|
114730
|
-
success(`Agent ${
|
|
114825
|
+
await client.agents.delete(resolvedId);
|
|
114826
|
+
success(`Agent ${resolvedId} deleted.`);
|
|
114731
114827
|
} catch (err) {
|
|
114732
114828
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
114733
114829
|
error(`Failed to delete agent: ${message}`, undefined, 3);
|
|
@@ -119464,6 +119560,13 @@ function assertScope(scope) {
|
|
|
119464
119560
|
error(`Invalid scope: ${scope}. Expected one of: ${VALID_SCOPES.join(", ")}`);
|
|
119465
119561
|
}
|
|
119466
119562
|
}
|
|
119563
|
+
async function resolveScopedId(scope, id) {
|
|
119564
|
+
if (scope === "agents")
|
|
119565
|
+
return resolveAgentId(id);
|
|
119566
|
+
if (scope === "instances")
|
|
119567
|
+
return resolveInstanceId(id);
|
|
119568
|
+
return resolveChatId(id);
|
|
119569
|
+
}
|
|
119467
119570
|
function readJsonArg(raw2) {
|
|
119468
119571
|
let body = raw2;
|
|
119469
119572
|
if (body === "-") {
|
|
@@ -119482,9 +119585,10 @@ function createFollowUpCommand() {
|
|
|
119482
119585
|
const cmd = new Command("follow-up").description("Idle-chat follow-up config (agents/instances/chats). Closest scope wins at runtime.");
|
|
119483
119586
|
cmd.command("get <scope> <id>").description("Read follow-up config at a scope (agents|instances|chats).").action(async (scope, id) => {
|
|
119484
119587
|
assertScope(scope);
|
|
119588
|
+
const resolvedId = await resolveScopedId(scope, id);
|
|
119485
119589
|
const client = getClient();
|
|
119486
119590
|
try {
|
|
119487
|
-
const data2 = scope === "agents" ? await client.followUp.getAgent(
|
|
119591
|
+
const data2 = scope === "agents" ? await client.followUp.getAgent(resolvedId) : scope === "instances" ? await client.followUp.getInstance(resolvedId) : await client.followUp.getChat(resolvedId);
|
|
119488
119592
|
data(data2);
|
|
119489
119593
|
} catch (err) {
|
|
119490
119594
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
@@ -119494,10 +119598,11 @@ function createFollowUpCommand() {
|
|
|
119494
119598
|
cmd.command("set <scope> <id> <json>").description("Write follow-up config at a scope. <json> can be a literal, `@path`, or `-` for stdin.").action(async (scope, id, json) => {
|
|
119495
119599
|
assertScope(scope);
|
|
119496
119600
|
const config = readJsonArg(json);
|
|
119601
|
+
const resolvedId = await resolveScopedId(scope, id);
|
|
119497
119602
|
const client = getClient();
|
|
119498
119603
|
try {
|
|
119499
|
-
const data2 = scope === "agents" ? await client.followUp.setAgent(
|
|
119500
|
-
success(`Follow-up config set on ${scope.slice(0, -1)} ${
|
|
119604
|
+
const data2 = scope === "agents" ? await client.followUp.setAgent(resolvedId, config) : scope === "instances" ? await client.followUp.setInstance(resolvedId, config) : await client.followUp.setChat(resolvedId, config);
|
|
119605
|
+
success(`Follow-up config set on ${scope.slice(0, -1)} ${resolvedId}.`, data2);
|
|
119501
119606
|
} catch (err) {
|
|
119502
119607
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
119503
119608
|
error(`Failed to set ${scope} follow-up: ${message}`, undefined, 3);
|
|
@@ -119505,15 +119610,16 @@ function createFollowUpCommand() {
|
|
|
119505
119610
|
});
|
|
119506
119611
|
cmd.command("unset <scope> <id>").description("Clear the override at a scope so broader scopes apply.").action(async (scope, id) => {
|
|
119507
119612
|
assertScope(scope);
|
|
119613
|
+
const resolvedId = await resolveScopedId(scope, id);
|
|
119508
119614
|
const client = getClient();
|
|
119509
119615
|
try {
|
|
119510
119616
|
if (scope === "agents")
|
|
119511
|
-
await client.followUp.unsetAgent(
|
|
119617
|
+
await client.followUp.unsetAgent(resolvedId);
|
|
119512
119618
|
else if (scope === "instances")
|
|
119513
|
-
await client.followUp.unsetInstance(
|
|
119619
|
+
await client.followUp.unsetInstance(resolvedId);
|
|
119514
119620
|
else
|
|
119515
|
-
await client.followUp.unsetChat(
|
|
119516
|
-
success(`Follow-up config cleared on ${scope.slice(0, -1)} ${
|
|
119621
|
+
await client.followUp.unsetChat(resolvedId);
|
|
119622
|
+
success(`Follow-up config cleared on ${scope.slice(0, -1)} ${resolvedId}.`);
|
|
119517
119623
|
} catch (err) {
|
|
119518
119624
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
119519
119625
|
error(`Failed to unset ${scope} follow-up: ${message}`, undefined, 3);
|
|
@@ -120207,7 +120313,7 @@ function createInstancesCommand() {
|
|
|
120207
120313
|
error(`Failed to get instance: ${message}`, undefined, 3);
|
|
120208
120314
|
}
|
|
120209
120315
|
});
|
|
120210
|
-
instances.command("create").description("Create a new instance (supports all API fields)").requiredOption("--name <name>", "Instance name").requiredOption("--channel <type>", `Channel type (${VALID_CHANNELS2.join(", ")})`).option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear)').option("--agent-provider <id>", "Agent provider ID").option("--agent <id>", "Agent ID").option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v) => Number.parseInt(v, 10)).option("--agent-stream-mode", "Enable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--enable-auto-split", "Split responses on double newlines").option("--no-enable-auto-split", "Disable auto-split").option("--message-format-mode <mode>", "Format mode: convert or passthrough").option("--debounce-mode <mode>", "Debounce mode: disabled, fixed, or randomized").option("--debounce-min <ms>", "Minimum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-max <ms>", "Maximum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-restart-on-typing", "Restart debounce timer on typing").option("--debounce-group <ms>", "Group chat debounce in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-mode <mode>", "Split delay mode: disabled, fixed, or randomized").option("--split-delay-fixed <ms>", "Fixed delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-min <ms>", "Minimum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-max <ms>", "Maximum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--agent-gate", "Enable LLM response gate").option("--agent-gate-model <model>", "Model for response gate").option("--agent-gate-prompt <prompt>", "Custom gate prompt").option("--tts-voice <id>", "ElevenLabs voice ID").option("--tts-model <id>", "ElevenLabs model ID").option("--access-mode <mode>", "Access mode: disabled, blocklist, or allowlist").option("--reaction-ack <mode>", "Reaction ack mode (on|off)").option("--reaction-ack-emoji <json>", "Per-channel emoji map as JSON").option("--ack-timeout <ms>", "Ack timeout in milliseconds", (v) => Number.parseInt(v, 10)).option("--agent-stalled-timeout-ms <ms>", "Idle threshold in ms before the internal turn.stalled event fires (no channel message is ever sent)", (v) => Number.parseInt(v, 10)).option("--token <token>", "Generic bot token (auto-resolves to channel-specific field)").option("--telegram-token <token>", "Telegram bot token").option("--discord-token <token>", "Discord bot token").option("--slack-bot-token <token>", "Slack bot token").option("--slack-app-token <token>", "Slack app token").option("--gupshup-callback-url <url>", "Gupshup Custom Integration callback URL").option("--gupshup-auth-token <token>", "Gupshup Custom Integration auth token").option("--gupshup-event-id <id>", "Gupshup event ID (default: nx_omni_agent_reply)").option("--gupshup-webhook-verify-token <token>", "Gupshup webhook verify token").option("--bridge-tmux-session <name>", 'Tmux session name the genie bridge spawns into for this instance (propagated as GENIE_TMUX_SESSION via NATS). Use "null" to clear.').option("--is-default", "Set as default instance for channel").action(async (options) => {
|
|
120316
|
+
instances.command("create").description("Create a new instance (supports all API fields)").requiredOption("--name <name>", "Instance name").requiredOption("--channel <type>", `Channel type (${VALID_CHANNELS2.join(", ")})`).option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear). When set without --reply-filter-mode, reply filter defaults to {mode:"all", onDm:true} so messages are dispatched instead of silently dropped (omni#443).').option("--agent-provider <id>", "Agent provider ID").option("--agent <id>", "Agent ID").option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v) => Number.parseInt(v, 10)).option("--agent-stream-mode", "Enable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--enable-auto-split", "Split responses on double newlines").option("--no-enable-auto-split", "Disable auto-split").option("--message-format-mode <mode>", "Format mode: convert or passthrough").option("--debounce-mode <mode>", "Debounce mode: disabled, fixed, or randomized").option("--debounce-min <ms>", "Minimum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-max <ms>", "Maximum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-restart-on-typing", "Restart debounce timer on typing").option("--debounce-group <ms>", "Group chat debounce in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-mode <mode>", "Split delay mode: disabled, fixed, or randomized").option("--split-delay-fixed <ms>", "Fixed delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-min <ms>", "Minimum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-max <ms>", "Maximum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--agent-gate", "Enable LLM response gate").option("--agent-gate-model <model>", "Model for response gate").option("--agent-gate-prompt <prompt>", "Custom gate prompt").option("--tts-voice <id>", "ElevenLabs voice ID").option("--tts-model <id>", "ElevenLabs model ID").option("--access-mode <mode>", "Access mode: disabled, blocklist, or allowlist").option("--reaction-ack <mode>", "Reaction ack mode (on|off)").option("--reaction-ack-emoji <json>", "Per-channel emoji map as JSON").option("--ack-timeout <ms>", "Ack timeout in milliseconds", (v) => Number.parseInt(v, 10)).option("--agent-stalled-timeout-ms <ms>", "Idle threshold in ms before the internal turn.stalled event fires (no channel message is ever sent)", (v) => Number.parseInt(v, 10)).option("--token <token>", "Generic bot token (auto-resolves to channel-specific field)").option("--telegram-token <token>", "Telegram bot token").option("--discord-token <token>", "Discord bot token").option("--slack-bot-token <token>", "Slack bot token").option("--slack-app-token <token>", "Slack app token").option("--gupshup-callback-url <url>", "Gupshup Custom Integration callback URL").option("--gupshup-auth-token <token>", "Gupshup Custom Integration auth token").option("--gupshup-event-id <id>", "Gupshup event ID (default: nx_omni_agent_reply)").option("--gupshup-webhook-verify-token <token>", "Gupshup webhook verify token").option("--bridge-tmux-session <name>", 'Tmux session name the genie bridge spawns into for this instance (propagated as GENIE_TMUX_SESSION via NATS). Use "null" to clear.').option("--is-default", "Set as default instance for channel").action(async (options) => {
|
|
120211
120317
|
const channel = options.channel;
|
|
120212
120318
|
if (!VALID_CHANNELS2.includes(channel)) {
|
|
120213
120319
|
error(`Invalid channel: ${channel}`, { validChannels: VALID_CHANNELS2 });
|
|
@@ -120468,7 +120574,7 @@ function createInstancesCommand() {
|
|
|
120468
120574
|
throw new Error(err?.error?.message ?? `HTTP ${response.status}`);
|
|
120469
120575
|
}
|
|
120470
120576
|
}
|
|
120471
|
-
instances.command("update <id>").description("Update an instance (supports all API fields)").option("--name <name>", "Instance name").option("--is-default", "Set as default instance for channel").option("--no-is-default", "Unset as default instance for channel").option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear)').option("--agent-provider <id>", 'Agent provider ID (use "null" to clear)').option("--agent <id>", 'Agent ID (use "null" to clear)').option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v) => Number.parseInt(v, 10)).option("--agent-stream-mode", "Enable streaming responses").option("--no-agent-stream-mode", "Disable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs (requires --reply-filter-mode filtered)").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--clear-reply-filter", "Remove reply filter (set to null)").option("--enable-auto-split", "Split responses on double newlines").option("--no-enable-auto-split", "Disable auto-split").option("--message-format-mode <mode>", "Format mode: convert or passthrough").option("--debounce-mode <mode>", "Debounce mode: disabled, fixed, or randomized").option("--debounce-min <ms>", "Minimum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-max <ms>", "Maximum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-restart-on-typing", "Restart debounce timer on typing").option("--no-debounce-restart-on-typing", "Do not restart debounce on typing").option("--debounce-group <ms>", 'Group chat debounce in ms (use "null" to inherit)', (v) => v === "null" ? null : Number.parseInt(v, 10)).option("--split-delay-mode <mode>", "Split delay mode: disabled, fixed, or randomized").option("--split-delay-fixed <ms>", "Fixed delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-min <ms>", "Minimum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-max <ms>", "Maximum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--agent-gate", "Enable LLM response gate").option("--no-agent-gate", "Disable LLM response gate").option("--agent-gate-model <model>", 'Model for response gate (use "null" for default)').option("--agent-gate-prompt <prompt>", 'Custom gate prompt (use "null" for default)').option("--tts-voice <id>", 'ElevenLabs voice ID (use "null" to clear)').option("--tts-model <id>", 'ElevenLabs model ID (use "null" to clear)').option("--access-mode <mode>", "Access mode: disabled, blocklist, or allowlist").option("--reaction-ack <mode>", "Reaction ack mode (on|off)").option("--reaction-ack-emoji <json>", "Per-channel emoji map as JSON").option("--ack-timeout <ms>", "Ack timeout in milliseconds", (v) => Number.parseInt(v, 10)).option("--agent-stalled-timeout-ms <ms>", "Idle threshold in ms before the internal turn.stalled event fires (no channel message is ever sent)", (v) => Number.parseInt(v, 10)).option("--token <token>", "Generic bot token (auto-resolves to channel-specific field)").option("--telegram-token <token>", 'Telegram bot token (use "null" to clear)').option("--discord-token <token>", 'Discord bot token (use "null" to clear)').option("--slack-bot-token <token>", 'Slack bot token (use "null" to clear)').option("--slack-app-token <token>", 'Slack app token (use "null" to clear)').option("--trigger-events <events>", 'Trigger events (comma-separated, use "null" to clear)').option("--profile-name <name>", "Update WhatsApp display name (push name)").option("--bridge-tmux-session <name>", 'Tmux session name the genie bridge spawns into for this instance (propagated as GENIE_TMUX_SESSION via NATS). Use "null" to clear.').action(async (rawId, options) => {
|
|
120577
|
+
instances.command("update <id>").description("Update an instance (supports all API fields)").option("--name <name>", "Instance name").option("--is-default", "Set as default instance for channel").option("--no-is-default", "Unset as default instance for channel").option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear). When assigning an agent on an instance with no reply filter, the filter defaults to {mode:"all", onDm:true} so messages are dispatched instead of silently dropped (omni#443).').option("--agent-provider <id>", 'Agent provider ID (use "null" to clear)').option("--agent <id>", 'Agent ID (use "null" to clear)').option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v) => Number.parseInt(v, 10)).option("--agent-stream-mode", "Enable streaming responses").option("--no-agent-stream-mode", "Disable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs (requires --reply-filter-mode filtered)").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--clear-reply-filter", "Remove reply filter (set to null)").option("--enable-auto-split", "Split responses on double newlines").option("--no-enable-auto-split", "Disable auto-split").option("--message-format-mode <mode>", "Format mode: convert or passthrough").option("--debounce-mode <mode>", "Debounce mode: disabled, fixed, or randomized").option("--debounce-min <ms>", "Minimum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-max <ms>", "Maximum debounce delay in ms", (v) => Number.parseInt(v, 10)).option("--debounce-restart-on-typing", "Restart debounce timer on typing").option("--no-debounce-restart-on-typing", "Do not restart debounce on typing").option("--debounce-group <ms>", 'Group chat debounce in ms (use "null" to inherit)', (v) => v === "null" ? null : Number.parseInt(v, 10)).option("--split-delay-mode <mode>", "Split delay mode: disabled, fixed, or randomized").option("--split-delay-fixed <ms>", "Fixed delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-min <ms>", "Minimum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--split-delay-max <ms>", "Maximum delay between split chunks in ms", (v) => Number.parseInt(v, 10)).option("--agent-gate", "Enable LLM response gate").option("--no-agent-gate", "Disable LLM response gate").option("--agent-gate-model <model>", 'Model for response gate (use "null" for default)').option("--agent-gate-prompt <prompt>", 'Custom gate prompt (use "null" for default)').option("--tts-voice <id>", 'ElevenLabs voice ID (use "null" to clear)').option("--tts-model <id>", 'ElevenLabs model ID (use "null" to clear)').option("--access-mode <mode>", "Access mode: disabled, blocklist, or allowlist").option("--reaction-ack <mode>", "Reaction ack mode (on|off)").option("--reaction-ack-emoji <json>", "Per-channel emoji map as JSON").option("--ack-timeout <ms>", "Ack timeout in milliseconds", (v) => Number.parseInt(v, 10)).option("--agent-stalled-timeout-ms <ms>", "Idle threshold in ms before the internal turn.stalled event fires (no channel message is ever sent)", (v) => Number.parseInt(v, 10)).option("--token <token>", "Generic bot token (auto-resolves to channel-specific field)").option("--telegram-token <token>", 'Telegram bot token (use "null" to clear)').option("--discord-token <token>", 'Discord bot token (use "null" to clear)').option("--slack-bot-token <token>", 'Slack bot token (use "null" to clear)').option("--slack-app-token <token>", 'Slack app token (use "null" to clear)').option("--trigger-events <events>", 'Trigger events (comma-separated, use "null" to clear)').option("--profile-name <name>", "Update WhatsApp display name (push name)").option("--bridge-tmux-session <name>", 'Tmux session name the genie bridge spawns into for this instance (propagated as GENIE_TMUX_SESSION via NATS). Use "null" to clear.').action(async (rawId, options) => {
|
|
120472
120578
|
const client = getClient();
|
|
120473
120579
|
try {
|
|
120474
120580
|
const id = await resolveInstanceId(rawId);
|
|
@@ -122990,9 +123096,9 @@ Example: omni providers create --schema openclaw --default-agent-id sofia ...`;
|
|
|
122990
123096
|
return `Claude Code providers require --project-path.
|
|
122991
123097
|
Example: omni providers create --name "My Project" --schema claude-code --base-url http://localhost:8882 --project-path /home/user/myproject`;
|
|
122992
123098
|
}
|
|
122993
|
-
if (options.schema === "genie" && (!options.agentName || !options.targetAgent)) {
|
|
122994
|
-
return `
|
|
122995
|
-
Example: omni providers create --name "My Genie" --schema genie --base-url "file:///home/user/.claude/teams" --agent-name omni --target-agent team-lead --team-name "workspace-{chat_id}"`;
|
|
123099
|
+
if (options.schema === "nats-genie" && (!options.agentName || !options.targetAgent)) {
|
|
123100
|
+
return `nats-genie providers require --agent-name and --target-agent.
|
|
123101
|
+
Example: omni providers create --name "My Nats Genie" --schema nats-genie --base-url "file:///home/user/.claude/teams" --agent-name omni --target-agent team-lead --team-name "workspace-{chat_id}"`;
|
|
122996
123102
|
}
|
|
122997
123103
|
return null;
|
|
122998
123104
|
}
|
|
@@ -123018,6 +123124,10 @@ function buildNatsGenieConfig(options) {
|
|
|
123018
123124
|
const config2 = {};
|
|
123019
123125
|
if (options.agentName)
|
|
123020
123126
|
config2.agentName = options.agentName;
|
|
123127
|
+
if (options.targetAgent)
|
|
123128
|
+
config2.targetAgent = options.targetAgent;
|
|
123129
|
+
if (options.teamName)
|
|
123130
|
+
config2.teamName = options.teamName;
|
|
123021
123131
|
return config2;
|
|
123022
123132
|
}
|
|
123023
123133
|
function buildSchemaConfig(options) {
|
|
@@ -123113,9 +123223,10 @@ async function handleList3(options) {
|
|
|
123113
123223
|
}
|
|
123114
123224
|
}
|
|
123115
123225
|
async function handleGet2(id) {
|
|
123226
|
+
const resolvedId = await resolveProviderId(id);
|
|
123116
123227
|
const client = getClient();
|
|
123117
123228
|
try {
|
|
123118
|
-
const provider = await client.providers.get(
|
|
123229
|
+
const provider = await client.providers.get(resolvedId);
|
|
123119
123230
|
data(provider);
|
|
123120
123231
|
} catch (err2) {
|
|
123121
123232
|
const message2 = err2 instanceof Error ? err2.message : "Unknown error";
|
|
@@ -123152,9 +123263,10 @@ Next steps:`);
|
|
|
123152
123263
|
}
|
|
123153
123264
|
}
|
|
123154
123265
|
async function handleTest(id) {
|
|
123266
|
+
const resolvedId = await resolveProviderId(id);
|
|
123155
123267
|
const client = getClient();
|
|
123156
123268
|
try {
|
|
123157
|
-
const result = await client.providers.checkHealth(
|
|
123269
|
+
const result = await client.providers.checkHealth(resolvedId);
|
|
123158
123270
|
if (result.healthy) {
|
|
123159
123271
|
success(`Provider is healthy (latency: ${result.latency}ms)`);
|
|
123160
123272
|
} else {
|
|
@@ -123177,14 +123289,15 @@ async function handleUpdate2(id, options) {
|
|
|
123177
123289
|
error("No fields to update. Provide at least one option.");
|
|
123178
123290
|
return;
|
|
123179
123291
|
}
|
|
123292
|
+
const resolvedId = await resolveProviderId(id);
|
|
123180
123293
|
const client = getClient();
|
|
123181
123294
|
try {
|
|
123182
123295
|
if (body.schemaConfig && !options.schemaConfig) {
|
|
123183
|
-
const existing = await client.providers.get(
|
|
123296
|
+
const existing = await client.providers.get(resolvedId);
|
|
123184
123297
|
const existingConfig = existing.schemaConfig ?? {};
|
|
123185
123298
|
body.schemaConfig = { ...existingConfig, ...body.schemaConfig };
|
|
123186
123299
|
}
|
|
123187
|
-
const provider = await client.providers.update(
|
|
123300
|
+
const provider = await client.providers.update(resolvedId, body);
|
|
123188
123301
|
success(`Updated provider: ${provider.id}`);
|
|
123189
123302
|
data(provider);
|
|
123190
123303
|
} catch (err2) {
|
|
@@ -123197,10 +123310,11 @@ async function handleDelete2(id, options) {
|
|
|
123197
123310
|
warn(`This will delete provider ${id}. Use --force to confirm.`);
|
|
123198
123311
|
return;
|
|
123199
123312
|
}
|
|
123313
|
+
const resolvedId = await resolveProviderId(id);
|
|
123200
123314
|
const client = getClient();
|
|
123201
123315
|
try {
|
|
123202
|
-
await client.providers.delete(
|
|
123203
|
-
success(`Deleted provider: ${
|
|
123316
|
+
await client.providers.delete(resolvedId);
|
|
123317
|
+
success(`Deleted provider: ${resolvedId}`);
|
|
123204
123318
|
} catch (err2) {
|
|
123205
123319
|
const message2 = err2 instanceof Error ? err2.message : "Unknown error";
|
|
123206
123320
|
error(`Failed to delete provider: ${message2}`);
|
|
@@ -123211,12 +123325,13 @@ function createProvidersCommand() {
|
|
|
123211
123325
|
providers2.addCommand(createSetupCommand());
|
|
123212
123326
|
providers2.command("list").description("List available providers").option("--active", "Show only active providers").action(handleList3);
|
|
123213
123327
|
providers2.command("get <id>").description("Get provider details").action(handleGet2);
|
|
123214
|
-
providers2.command("create").description("Create a new AI provider").requiredOption("--name <name>", "Provider name (unique)").requiredOption("--schema <schema>", `Provider schema (${VALID_SCHEMAS.join(", ")})`).requiredOption("--base-url <url>", "API base URL (ws:// or wss:// for openclaw)").option("--api-key <key>", "API key (optional for claude-code if using env ANTHROPIC_API_KEY)").option("--description <desc>", "Provider description").option("--timeout <seconds>", "Default timeout in seconds", Number.parseInt, 60).option("--stream", "Enable streaming by default").option("--default-agent-id <agentId>", "Default agent ID (required for openclaw)").option("--project-path <path>", "Project directory path (required for claude-code)").option("--max-turns <number>", "Max conversation turns (claude-code)", Number.parseInt).option("--permission-mode <mode>", "Permission mode: default, acceptEdits, bypassPermissions, plan (claude-code)").option("--model <model>", "Model override (claude-code)").option("--system-prompt <prompt>", "System prompt prepended to agent (claude-code)").option("--agent-name <name>", 'Agent identity / "from" field (required for genie)').option("--target-agent <name>", "Target agent inbox to deliver to (required for genie)").option("--team-name <template>", "Team name template, supports {chat_id}, {thread_id}, {sender_id} (genie, default: omni-{chat_id})").action(handleCreate3);
|
|
123328
|
+
providers2.command("create").description("Create a new AI provider").requiredOption("--name <name>", "Provider name (unique)").requiredOption("--schema <schema>", `Provider schema (${VALID_SCHEMAS.join(", ")})`).requiredOption("--base-url <url>", "API base URL (ws:// or wss:// for openclaw)").option("--api-key <key>", "API key (optional for claude-code if using env ANTHROPIC_API_KEY)").option("--description <desc>", "Provider description").option("--timeout <seconds>", "Default timeout in seconds", Number.parseInt, 60).option("--stream", "Enable streaming by default").option("--default-agent-id <agentId>", "Default agent ID (required for openclaw)").option("--project-path <path>", "Project directory path (required for claude-code)").option("--max-turns <number>", "Max conversation turns (claude-code)", Number.parseInt).option("--permission-mode <mode>", "Permission mode: default, acceptEdits, bypassPermissions, plan (claude-code)").option("--model <model>", "Model override (claude-code)").option("--system-prompt <prompt>", "System prompt prepended to agent (claude-code)").option("--agent-name <name>", 'Agent identity / "from" field (required for nats-genie)').option("--target-agent <name>", "Target agent inbox to deliver to (required for nats-genie)").option("--team-name <template>", "Team name template, supports {chat_id}, {thread_id}, {sender_id} (nats-genie, default: omni-{chat_id})").action(handleCreate3);
|
|
123215
123329
|
providers2.command("test <id>").description("Test provider health").action(handleTest);
|
|
123216
123330
|
providers2.command("agents <id>").description("List agents from provider (Agno)").action(async (id) => {
|
|
123331
|
+
const resolvedId = await resolveProviderId(id);
|
|
123217
123332
|
const client = getClient();
|
|
123218
123333
|
try {
|
|
123219
|
-
const agents2 = await client.providers.listAgents(
|
|
123334
|
+
const agents2 = await client.providers.listAgents(resolvedId);
|
|
123220
123335
|
const items = agents2.map((a2) => ({
|
|
123221
123336
|
id: a2.agent_id,
|
|
123222
123337
|
name: a2.name,
|
|
@@ -123230,9 +123345,10 @@ function createProvidersCommand() {
|
|
|
123230
123345
|
}
|
|
123231
123346
|
});
|
|
123232
123347
|
providers2.command("teams <id>").description("List teams from provider (Agno)").action(async (id) => {
|
|
123348
|
+
const resolvedId = await resolveProviderId(id);
|
|
123233
123349
|
const client = getClient();
|
|
123234
123350
|
try {
|
|
123235
|
-
const teams = await client.providers.listTeams(
|
|
123351
|
+
const teams = await client.providers.listTeams(resolvedId);
|
|
123236
123352
|
const items = teams.map((t) => ({
|
|
123237
123353
|
id: t.team_id,
|
|
123238
123354
|
name: t.name,
|
|
@@ -123247,9 +123363,10 @@ function createProvidersCommand() {
|
|
|
123247
123363
|
}
|
|
123248
123364
|
});
|
|
123249
123365
|
providers2.command("workflows <id>").description("List workflows from provider (Agno)").action(async (id) => {
|
|
123366
|
+
const resolvedId = await resolveProviderId(id);
|
|
123250
123367
|
const client = getClient();
|
|
123251
123368
|
try {
|
|
123252
|
-
const workflows = await client.providers.listWorkflows(
|
|
123369
|
+
const workflows = await client.providers.listWorkflows(resolvedId);
|
|
123253
123370
|
const items = workflows.map((w) => ({
|
|
123254
123371
|
id: w.workflow_id,
|
|
123255
123372
|
name: w.name,
|
|
@@ -123261,7 +123378,7 @@ function createProvidersCommand() {
|
|
|
123261
123378
|
error(`Failed to list workflows: ${message2}`);
|
|
123262
123379
|
}
|
|
123263
123380
|
});
|
|
123264
|
-
providers2.command("update <id>").description("Update a provider").option("--name <name>", "Provider name").option("--base-url <url>", "API base URL").option("--api-key <key>", "API key").option("--description <desc>", "Provider description").option("--timeout <seconds>", "Default timeout in seconds", Number.parseInt).option("--stream", "Enable streaming by default").option("--no-stream", "Disable streaming by default").option("--active", "Set provider active").option("--no-active", "Set provider inactive").option("--agent-name <name>", "Agent identity (genie)").option("--target-agent <name>", "Target agent inbox (genie)").option("--team-name <template>", "Team name template (genie)").option("--project-path <path>", "Project directory path (claude-code)").option("--max-turns <number>", "Max conversation turns (claude-code)", Number.parseInt).option("--permission-mode <mode>", "Permission mode (claude-code)").option("--model <model>", "Model override (claude-code)").option("--system-prompt <prompt>", "System prompt (claude-code)").option("--schema-config <json>", "Raw schemaConfig as JSON (overrides individual schema flags)").action(handleUpdate2);
|
|
123381
|
+
providers2.command("update <id>").description("Update a provider").option("--name <name>", "Provider name").option("--base-url <url>", "API base URL").option("--api-key <key>", "API key").option("--description <desc>", "Provider description").option("--timeout <seconds>", "Default timeout in seconds", Number.parseInt).option("--stream", "Enable streaming by default").option("--no-stream", "Disable streaming by default").option("--active", "Set provider active").option("--no-active", "Set provider inactive").option("--agent-name <name>", "Agent identity (nats-genie)").option("--target-agent <name>", "Target agent inbox (nats-genie)").option("--team-name <template>", "Team name template (nats-genie)").option("--project-path <path>", "Project directory path (claude-code)").option("--max-turns <number>", "Max conversation turns (claude-code)", Number.parseInt).option("--permission-mode <mode>", "Permission mode (claude-code)").option("--model <model>", "Model override (claude-code)").option("--system-prompt <prompt>", "System prompt (claude-code)").option("--schema-config <json>", "Raw schemaConfig as JSON (overrides individual schema flags)").action(handleUpdate2);
|
|
123265
123382
|
providers2.command("delete <id>").description("Delete a provider").option("--force", "Skip confirmation").action(handleDelete2);
|
|
123266
123383
|
return providers2;
|
|
123267
123384
|
}
|
|
@@ -125304,9 +125421,10 @@ function createWebhooksCommand() {
|
|
|
125304
125421
|
}
|
|
125305
125422
|
});
|
|
125306
125423
|
webhooks.command("get <id>").description("Get webhook source details").action(async (id) => {
|
|
125424
|
+
const resolvedId = await resolveWebhookId(id);
|
|
125307
125425
|
const client = getClient();
|
|
125308
125426
|
try {
|
|
125309
|
-
const source = await client.webhooks.getSource(
|
|
125427
|
+
const source = await client.webhooks.getSource(resolvedId);
|
|
125310
125428
|
data(source);
|
|
125311
125429
|
} catch (err2) {
|
|
125312
125430
|
const message2 = err2 instanceof Error ? err2.message : "Unknown error";
|
|
@@ -125341,6 +125459,7 @@ function createWebhooksCommand() {
|
|
|
125341
125459
|
}
|
|
125342
125460
|
});
|
|
125343
125461
|
webhooks.command("update <id>").description("Update a webhook source").option("--name <name>", "New name").option("--description <desc>", "New description").option("--enable", "Enable the webhook").option("--disable", "Disable the webhook").action(async (id, options3) => {
|
|
125462
|
+
const resolvedId = await resolveWebhookId(id);
|
|
125344
125463
|
const client = getClient();
|
|
125345
125464
|
try {
|
|
125346
125465
|
const updates = {};
|
|
@@ -125352,7 +125471,7 @@ function createWebhooksCommand() {
|
|
|
125352
125471
|
updates.enabled = true;
|
|
125353
125472
|
if (options3.disable)
|
|
125354
125473
|
updates.enabled = false;
|
|
125355
|
-
const source = await client.webhooks.updateSource(
|
|
125474
|
+
const source = await client.webhooks.updateSource(resolvedId, updates);
|
|
125356
125475
|
success(`Webhook source updated: ${source.id}`, {
|
|
125357
125476
|
id: source.id,
|
|
125358
125477
|
name: source.name,
|
|
@@ -125364,10 +125483,11 @@ function createWebhooksCommand() {
|
|
|
125364
125483
|
}
|
|
125365
125484
|
});
|
|
125366
125485
|
webhooks.command("delete <id>").description("Delete a webhook source").action(async (id) => {
|
|
125486
|
+
const resolvedId = await resolveWebhookId(id);
|
|
125367
125487
|
const client = getClient();
|
|
125368
125488
|
try {
|
|
125369
|
-
await client.webhooks.deleteSource(
|
|
125370
|
-
success(`Webhook source deleted: ${
|
|
125489
|
+
await client.webhooks.deleteSource(resolvedId);
|
|
125490
|
+
success(`Webhook source deleted: ${resolvedId}`);
|
|
125371
125491
|
} catch (err2) {
|
|
125372
125492
|
const message2 = err2 instanceof Error ? err2.message : "Unknown error";
|
|
125373
125493
|
error(`Failed to delete webhook source: ${message2}`);
|
package/dist/resolve.d.ts
CHANGED
|
@@ -97,6 +97,42 @@ export declare function resolveAutomationId(input: string): Promise<string>;
|
|
|
97
97
|
* Exits with error if no match or ambiguous.
|
|
98
98
|
*/
|
|
99
99
|
export declare function resolveBatchJobId(input: string): Promise<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Resolve a provider identifier to a UUID.
|
|
102
|
+
*
|
|
103
|
+
* Matches in order:
|
|
104
|
+
* 1. Exact UUID match (skip API call)
|
|
105
|
+
* 2. UUID prefix match (minimum 2 hex chars)
|
|
106
|
+
* 3. Exact name match (case-insensitive)
|
|
107
|
+
* 4. Name substring match (case-insensitive)
|
|
108
|
+
*
|
|
109
|
+
* Exits with error if no match or ambiguous.
|
|
110
|
+
*/
|
|
111
|
+
export declare function resolveProviderId(input: string): Promise<string>;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve an agent identifier to a UUID.
|
|
114
|
+
*
|
|
115
|
+
* Matches in order:
|
|
116
|
+
* 1. Exact UUID match (skip API call)
|
|
117
|
+
* 2. UUID prefix match (minimum 2 hex chars)
|
|
118
|
+
* 3. Exact name match (case-insensitive)
|
|
119
|
+
* 4. Name substring match (case-insensitive)
|
|
120
|
+
*
|
|
121
|
+
* Exits with error if no match or ambiguous.
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveAgentId(input: string): Promise<string>;
|
|
124
|
+
/**
|
|
125
|
+
* Resolve a webhook source identifier to a UUID.
|
|
126
|
+
*
|
|
127
|
+
* Matches in order:
|
|
128
|
+
* 1. Exact UUID match (skip API call)
|
|
129
|
+
* 2. UUID prefix match (minimum 2 hex chars)
|
|
130
|
+
* 3. Exact name match (case-insensitive)
|
|
131
|
+
* 4. Name substring match (case-insensitive)
|
|
132
|
+
*
|
|
133
|
+
* Exits with error if no match or ambiguous.
|
|
134
|
+
*/
|
|
135
|
+
export declare function resolveWebhookId(input: string): Promise<string>;
|
|
100
136
|
/**
|
|
101
137
|
* Resolve an agent route identifier to a UUID.
|
|
102
138
|
*
|
package/dist/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlE;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYrE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCtF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BxE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBtE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBvF"}
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlE;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYrE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCtF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BxE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BnE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBvF"}
|