struere 0.14.6 → 0.14.8
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/bin/struere.js +77 -29
- package/dist/cli/commands/integration.d.ts.map +1 -1
- package/dist/cli/index.js +77 -29
- package/dist/cli/utils/__tests__/validator.test.d.ts +2 -0
- package/dist/cli/utils/__tests__/validator.test.d.ts.map +1 -0
- package/dist/cli/utils/integrations.d.ts +19 -0
- package/dist/cli/utils/integrations.d.ts.map +1 -1
- package/dist/cli/utils/validator.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/bin/struere.js
CHANGED
|
@@ -3202,6 +3202,31 @@ function validateResources(payload, resources) {
|
|
|
3202
3202
|
const warnings = [];
|
|
3203
3203
|
const errors = [];
|
|
3204
3204
|
const agentSlugs = new Set(payload.agents.map((a) => a.slug));
|
|
3205
|
+
for (const agent of payload.agents) {
|
|
3206
|
+
if (!agent.systemPrompt || !agent.systemPrompt.trim()) {
|
|
3207
|
+
errors.push(`Agent "${agent.name}" (slug: ${agent.slug}) has no system prompt. Every agent needs a system prompt \u2014 see https://docs.struere.dev/sdk/define-agent`);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
for (const agent of payload.agents) {
|
|
3211
|
+
if (!agent.tools?.includes("voice.call"))
|
|
3212
|
+
continue;
|
|
3213
|
+
const prompt = agent.systemPrompt || "";
|
|
3214
|
+
const mentionsLiteralAgentSlug = /\bagentSlug\b|\bagent_slug\b/i.test(prompt);
|
|
3215
|
+
const mentionsKnownAgentSlug = [...agentSlugs].some((s) => s !== agent.slug && prompt.includes(s));
|
|
3216
|
+
if (!mentionsLiteralAgentSlug && !mentionsKnownAgentSlug) {
|
|
3217
|
+
errors.push(`Agent "${agent.name}" uses voice.call but its system prompt doesn't reference any agentSlug. The LLM has no instruction on which agent to spawn \u2014 calls will fall back to a vanilla model with no script. Reference the target slug literally in the prompt (e.g. 'Call voice.call with agentSlug: "voice-foo"'). See https://docs.struere.dev/integrations/voice-cookbook#why-agentslug-is-mandatory`);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
if (payload.routers) {
|
|
3221
|
+
for (const router of payload.routers) {
|
|
3222
|
+
if (router.voiceConfig && !router.voiceConfig.auditorAgent) {
|
|
3223
|
+
errors.push(`Router "${router.name}" has voiceConfig but is missing auditorAgent. The runtime requires this field even though the SDK type marks it optional. Set auditorAgent to a valid agent slug (can self-reference for single-agent setups). See https://docs.struere.dev/integrations/voice for details`);
|
|
3224
|
+
}
|
|
3225
|
+
if (router.voiceConfig?.auditorAgent && !agentSlugs.has(router.voiceConfig.auditorAgent)) {
|
|
3226
|
+
errors.push(`Router "${router.name}" references unknown auditorAgent "${router.voiceConfig.auditorAgent}". See https://docs.struere.dev/integrations/voice`);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3205
3230
|
if (payload.routers) {
|
|
3206
3231
|
for (const router of payload.routers) {
|
|
3207
3232
|
for (const agentRef of router.agents) {
|
|
@@ -7296,11 +7321,11 @@ async function listIntegrationConfigs(env) {
|
|
|
7296
7321
|
async function setIntegrationStatus(provider, env, status) {
|
|
7297
7322
|
return convexMutation4("integrations:setConfigStatus", { provider, environment: env, status });
|
|
7298
7323
|
}
|
|
7299
|
-
async function
|
|
7300
|
-
return convexMutation4("voiceConnections:
|
|
7324
|
+
async function createVoiceConnectionWithAssignment(args) {
|
|
7325
|
+
return convexMutation4("voiceConnections:createConnectionWithAssignment", args);
|
|
7301
7326
|
}
|
|
7302
|
-
async function
|
|
7303
|
-
return convexMutation4("voiceConnections:
|
|
7327
|
+
async function removeVoiceConnectionByPhone(args) {
|
|
7328
|
+
return convexMutation4("voiceConnections:removeConnectionByPhone", args);
|
|
7304
7329
|
}
|
|
7305
7330
|
|
|
7306
7331
|
// src/cli/commands/integration.ts
|
|
@@ -7414,7 +7439,7 @@ function buildConfigFromOpts(provider, opts) {
|
|
|
7414
7439
|
}
|
|
7415
7440
|
return null;
|
|
7416
7441
|
}
|
|
7417
|
-
var integrationCommand = new Command17("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend, flow)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--api-url <url>", "API URL (flow)").option("--api-key <key>", "API key (flow)").option("--secret-key <secret>", "Secret key (flow)").option("--return-url <url>", "Return URL after payment (flow)").option("--account-sid <sid>", "Twilio Account SID (twilio)").option("--auth-token <token>", "Twilio Auth Token (twilio)").option("--phone-number <number>", "Twilio phone number in E.164 format (twilio)").option("--router <slug>", "Router slug to assign to phone number (twilio)").option("--agent <slug>", "Agent slug to assign to phone number (twilio)").option("--test", "Test the connection after saving").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
7442
|
+
var integrationCommand = new Command17("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend, flow)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--api-url <url>", "API URL (flow)").option("--api-key <key>", "API key (flow)").option("--secret-key <secret>", "Secret key (flow)").option("--return-url <url>", "Return URL after payment (flow)").option("--account-sid <sid>", "Twilio Account SID (twilio)").option("--auth-token <token>", "Twilio Auth Token (twilio)").option("--phone-number <number>", "Twilio phone number in E.164 format (twilio)").option("--router <slug>", "Router slug to assign to phone number (twilio)").option("--agent <slug>", "Agent slug to assign to phone number (twilio)").option("--test", "Test the connection after saving").option("--remove-phone <number>", "Disconnect a single phone number's voice connection (does not remove Twilio credentials)").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
7418
7443
|
await ensureAuth4();
|
|
7419
7444
|
const env = opts.env;
|
|
7420
7445
|
const out = opts.json ? createSilentOutput() : createOutput();
|
|
@@ -7458,6 +7483,36 @@ var integrationCommand = new Command17("integration").description("Manage integr
|
|
|
7458
7483
|
console.log(` ${chalk19.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
7459
7484
|
process.exit(1);
|
|
7460
7485
|
}
|
|
7486
|
+
if (opts.removePhone) {
|
|
7487
|
+
if (provider !== "twilio") {
|
|
7488
|
+
out.fail(`--remove-phone is only supported for twilio`);
|
|
7489
|
+
process.exit(1);
|
|
7490
|
+
}
|
|
7491
|
+
const phoneNumber = String(opts.removePhone).trim();
|
|
7492
|
+
if (!/^\+[1-9]\d{6,14}$/.test(phoneNumber)) {
|
|
7493
|
+
out.fail(`Invalid phone number: ${phoneNumber}`);
|
|
7494
|
+
console.log(` ${chalk19.gray("Expected E.164 format, e.g. +14155551234")}`);
|
|
7495
|
+
process.exit(1);
|
|
7496
|
+
}
|
|
7497
|
+
out.start(`Removing voice connection for ${phoneNumber}`);
|
|
7498
|
+
const { data, error } = await removeVoiceConnectionByPhone({
|
|
7499
|
+
environment: env,
|
|
7500
|
+
twilioPhoneNumber: phoneNumber
|
|
7501
|
+
});
|
|
7502
|
+
if (error) {
|
|
7503
|
+
out.fail(`Failed to remove voice connection`);
|
|
7504
|
+
out.error(error);
|
|
7505
|
+
process.exit(1);
|
|
7506
|
+
}
|
|
7507
|
+
const result = data;
|
|
7508
|
+
if (result?.removed) {
|
|
7509
|
+
out.succeed(`Removed voice connection for ${phoneNumber}`);
|
|
7510
|
+
} else {
|
|
7511
|
+
out.info(`No active voice connection found for ${phoneNumber}`);
|
|
7512
|
+
}
|
|
7513
|
+
console.log();
|
|
7514
|
+
return;
|
|
7515
|
+
}
|
|
7461
7516
|
if (opts.remove) {
|
|
7462
7517
|
if (!opts.yes && isInteractive()) {
|
|
7463
7518
|
const confirmed = await confirm7({
|
|
@@ -7516,34 +7571,27 @@ var integrationCommand = new Command17("integration").description("Manage integr
|
|
|
7516
7571
|
if (provider === "twilio" && opts.phoneNumber) {
|
|
7517
7572
|
const phoneNumber = opts.phoneNumber.startsWith("+") ? opts.phoneNumber : `+${opts.phoneNumber}`;
|
|
7518
7573
|
out.start(`Adding voice connection for ${phoneNumber}`);
|
|
7519
|
-
const
|
|
7574
|
+
const createArgs = {
|
|
7575
|
+
environment: env,
|
|
7520
7576
|
twilioAccountSid: config.accountSid,
|
|
7521
7577
|
twilioPhoneNumber: phoneNumber,
|
|
7522
|
-
label: `Twilio ${phoneNumber}
|
|
7523
|
-
|
|
7524
|
-
|
|
7578
|
+
label: `Twilio ${phoneNumber}`
|
|
7579
|
+
};
|
|
7580
|
+
if (opts.router)
|
|
7581
|
+
createArgs.routerSlug = opts.router;
|
|
7582
|
+
if (opts.agent)
|
|
7583
|
+
createArgs.agentSlug = opts.agent;
|
|
7584
|
+
const { error: connError } = await createVoiceConnectionWithAssignment(createArgs);
|
|
7525
7585
|
if (connError) {
|
|
7526
7586
|
out.fail(`Failed to create voice connection`);
|
|
7527
7587
|
out.error(connError);
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
if (opts.router)
|
|
7536
|
-
assignArgs.routerSlug = opts.router;
|
|
7537
|
-
if (opts.agent)
|
|
7538
|
-
assignArgs.agentSlug = opts.agent;
|
|
7539
|
-
const { error: assignError } = await setVoicePhoneAgent(assignArgs);
|
|
7540
|
-
if (assignError) {
|
|
7541
|
-
out.fail(`Failed to assign`);
|
|
7542
|
-
out.error(assignError);
|
|
7543
|
-
} else {
|
|
7544
|
-
out.succeed(`Assigned to ${opts.router ? `router: ${opts.router}` : `agent: ${opts.agent}`}`);
|
|
7545
|
-
}
|
|
7546
|
-
}
|
|
7588
|
+
process.exit(1);
|
|
7589
|
+
}
|
|
7590
|
+
out.succeed(`Voice connection created for ${phoneNumber}`);
|
|
7591
|
+
if (opts.router || opts.agent) {
|
|
7592
|
+
const slug = opts.router ?? opts.agent;
|
|
7593
|
+
const kind = opts.router ? "router" : "agent";
|
|
7594
|
+
out.info(`Assigned to ${kind}: ${slug}`);
|
|
7547
7595
|
}
|
|
7548
7596
|
}
|
|
7549
7597
|
if (opts.test) {
|
|
@@ -11083,7 +11131,7 @@ keysCommand.command("revoke <id-or-prefix>").description("Revoke an API key (del
|
|
|
11083
11131
|
// package.json
|
|
11084
11132
|
var package_default = {
|
|
11085
11133
|
name: "struere",
|
|
11086
|
-
version: "0.14.
|
|
11134
|
+
version: "0.14.8",
|
|
11087
11135
|
description: "Build, test, and deploy AI agents",
|
|
11088
11136
|
keywords: [
|
|
11089
11137
|
"ai",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiInC,eAAO,MAAM,kBAAkB,SAqT3B,CAAA"}
|
package/dist/cli/index.js
CHANGED
|
@@ -3202,6 +3202,31 @@ function validateResources(payload, resources) {
|
|
|
3202
3202
|
const warnings = [];
|
|
3203
3203
|
const errors = [];
|
|
3204
3204
|
const agentSlugs = new Set(payload.agents.map((a) => a.slug));
|
|
3205
|
+
for (const agent of payload.agents) {
|
|
3206
|
+
if (!agent.systemPrompt || !agent.systemPrompt.trim()) {
|
|
3207
|
+
errors.push(`Agent "${agent.name}" (slug: ${agent.slug}) has no system prompt. Every agent needs a system prompt \u2014 see https://docs.struere.dev/sdk/define-agent`);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
for (const agent of payload.agents) {
|
|
3211
|
+
if (!agent.tools?.includes("voice.call"))
|
|
3212
|
+
continue;
|
|
3213
|
+
const prompt = agent.systemPrompt || "";
|
|
3214
|
+
const mentionsLiteralAgentSlug = /\bagentSlug\b|\bagent_slug\b/i.test(prompt);
|
|
3215
|
+
const mentionsKnownAgentSlug = [...agentSlugs].some((s) => s !== agent.slug && prompt.includes(s));
|
|
3216
|
+
if (!mentionsLiteralAgentSlug && !mentionsKnownAgentSlug) {
|
|
3217
|
+
errors.push(`Agent "${agent.name}" uses voice.call but its system prompt doesn't reference any agentSlug. The LLM has no instruction on which agent to spawn \u2014 calls will fall back to a vanilla model with no script. Reference the target slug literally in the prompt (e.g. 'Call voice.call with agentSlug: "voice-foo"'). See https://docs.struere.dev/integrations/voice-cookbook#why-agentslug-is-mandatory`);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
if (payload.routers) {
|
|
3221
|
+
for (const router of payload.routers) {
|
|
3222
|
+
if (router.voiceConfig && !router.voiceConfig.auditorAgent) {
|
|
3223
|
+
errors.push(`Router "${router.name}" has voiceConfig but is missing auditorAgent. The runtime requires this field even though the SDK type marks it optional. Set auditorAgent to a valid agent slug (can self-reference for single-agent setups). See https://docs.struere.dev/integrations/voice for details`);
|
|
3224
|
+
}
|
|
3225
|
+
if (router.voiceConfig?.auditorAgent && !agentSlugs.has(router.voiceConfig.auditorAgent)) {
|
|
3226
|
+
errors.push(`Router "${router.name}" references unknown auditorAgent "${router.voiceConfig.auditorAgent}". See https://docs.struere.dev/integrations/voice`);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3205
3230
|
if (payload.routers) {
|
|
3206
3231
|
for (const router of payload.routers) {
|
|
3207
3232
|
for (const agentRef of router.agents) {
|
|
@@ -7296,11 +7321,11 @@ async function listIntegrationConfigs(env) {
|
|
|
7296
7321
|
async function setIntegrationStatus(provider, env, status) {
|
|
7297
7322
|
return convexMutation4("integrations:setConfigStatus", { provider, environment: env, status });
|
|
7298
7323
|
}
|
|
7299
|
-
async function
|
|
7300
|
-
return convexMutation4("voiceConnections:
|
|
7324
|
+
async function createVoiceConnectionWithAssignment(args) {
|
|
7325
|
+
return convexMutation4("voiceConnections:createConnectionWithAssignment", args);
|
|
7301
7326
|
}
|
|
7302
|
-
async function
|
|
7303
|
-
return convexMutation4("voiceConnections:
|
|
7327
|
+
async function removeVoiceConnectionByPhone(args) {
|
|
7328
|
+
return convexMutation4("voiceConnections:removeConnectionByPhone", args);
|
|
7304
7329
|
}
|
|
7305
7330
|
|
|
7306
7331
|
// src/cli/commands/integration.ts
|
|
@@ -7414,7 +7439,7 @@ function buildConfigFromOpts(provider, opts) {
|
|
|
7414
7439
|
}
|
|
7415
7440
|
return null;
|
|
7416
7441
|
}
|
|
7417
|
-
var integrationCommand = new Command17("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend, flow)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--api-url <url>", "API URL (flow)").option("--api-key <key>", "API key (flow)").option("--secret-key <secret>", "Secret key (flow)").option("--return-url <url>", "Return URL after payment (flow)").option("--account-sid <sid>", "Twilio Account SID (twilio)").option("--auth-token <token>", "Twilio Auth Token (twilio)").option("--phone-number <number>", "Twilio phone number in E.164 format (twilio)").option("--router <slug>", "Router slug to assign to phone number (twilio)").option("--agent <slug>", "Agent slug to assign to phone number (twilio)").option("--test", "Test the connection after saving").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
7442
|
+
var integrationCommand = new Command17("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend, flow)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--api-url <url>", "API URL (flow)").option("--api-key <key>", "API key (flow)").option("--secret-key <secret>", "Secret key (flow)").option("--return-url <url>", "Return URL after payment (flow)").option("--account-sid <sid>", "Twilio Account SID (twilio)").option("--auth-token <token>", "Twilio Auth Token (twilio)").option("--phone-number <number>", "Twilio phone number in E.164 format (twilio)").option("--router <slug>", "Router slug to assign to phone number (twilio)").option("--agent <slug>", "Agent slug to assign to phone number (twilio)").option("--test", "Test the connection after saving").option("--remove-phone <number>", "Disconnect a single phone number's voice connection (does not remove Twilio credentials)").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
7418
7443
|
await ensureAuth4();
|
|
7419
7444
|
const env = opts.env;
|
|
7420
7445
|
const out = opts.json ? createSilentOutput() : createOutput();
|
|
@@ -7458,6 +7483,36 @@ var integrationCommand = new Command17("integration").description("Manage integr
|
|
|
7458
7483
|
console.log(` ${chalk19.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
7459
7484
|
process.exit(1);
|
|
7460
7485
|
}
|
|
7486
|
+
if (opts.removePhone) {
|
|
7487
|
+
if (provider !== "twilio") {
|
|
7488
|
+
out.fail(`--remove-phone is only supported for twilio`);
|
|
7489
|
+
process.exit(1);
|
|
7490
|
+
}
|
|
7491
|
+
const phoneNumber = String(opts.removePhone).trim();
|
|
7492
|
+
if (!/^\+[1-9]\d{6,14}$/.test(phoneNumber)) {
|
|
7493
|
+
out.fail(`Invalid phone number: ${phoneNumber}`);
|
|
7494
|
+
console.log(` ${chalk19.gray("Expected E.164 format, e.g. +14155551234")}`);
|
|
7495
|
+
process.exit(1);
|
|
7496
|
+
}
|
|
7497
|
+
out.start(`Removing voice connection for ${phoneNumber}`);
|
|
7498
|
+
const { data, error } = await removeVoiceConnectionByPhone({
|
|
7499
|
+
environment: env,
|
|
7500
|
+
twilioPhoneNumber: phoneNumber
|
|
7501
|
+
});
|
|
7502
|
+
if (error) {
|
|
7503
|
+
out.fail(`Failed to remove voice connection`);
|
|
7504
|
+
out.error(error);
|
|
7505
|
+
process.exit(1);
|
|
7506
|
+
}
|
|
7507
|
+
const result = data;
|
|
7508
|
+
if (result?.removed) {
|
|
7509
|
+
out.succeed(`Removed voice connection for ${phoneNumber}`);
|
|
7510
|
+
} else {
|
|
7511
|
+
out.info(`No active voice connection found for ${phoneNumber}`);
|
|
7512
|
+
}
|
|
7513
|
+
console.log();
|
|
7514
|
+
return;
|
|
7515
|
+
}
|
|
7461
7516
|
if (opts.remove) {
|
|
7462
7517
|
if (!opts.yes && isInteractive()) {
|
|
7463
7518
|
const confirmed = await confirm7({
|
|
@@ -7516,34 +7571,27 @@ var integrationCommand = new Command17("integration").description("Manage integr
|
|
|
7516
7571
|
if (provider === "twilio" && opts.phoneNumber) {
|
|
7517
7572
|
const phoneNumber = opts.phoneNumber.startsWith("+") ? opts.phoneNumber : `+${opts.phoneNumber}`;
|
|
7518
7573
|
out.start(`Adding voice connection for ${phoneNumber}`);
|
|
7519
|
-
const
|
|
7574
|
+
const createArgs = {
|
|
7575
|
+
environment: env,
|
|
7520
7576
|
twilioAccountSid: config.accountSid,
|
|
7521
7577
|
twilioPhoneNumber: phoneNumber,
|
|
7522
|
-
label: `Twilio ${phoneNumber}
|
|
7523
|
-
|
|
7524
|
-
|
|
7578
|
+
label: `Twilio ${phoneNumber}`
|
|
7579
|
+
};
|
|
7580
|
+
if (opts.router)
|
|
7581
|
+
createArgs.routerSlug = opts.router;
|
|
7582
|
+
if (opts.agent)
|
|
7583
|
+
createArgs.agentSlug = opts.agent;
|
|
7584
|
+
const { error: connError } = await createVoiceConnectionWithAssignment(createArgs);
|
|
7525
7585
|
if (connError) {
|
|
7526
7586
|
out.fail(`Failed to create voice connection`);
|
|
7527
7587
|
out.error(connError);
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
if (opts.router)
|
|
7536
|
-
assignArgs.routerSlug = opts.router;
|
|
7537
|
-
if (opts.agent)
|
|
7538
|
-
assignArgs.agentSlug = opts.agent;
|
|
7539
|
-
const { error: assignError } = await setVoicePhoneAgent(assignArgs);
|
|
7540
|
-
if (assignError) {
|
|
7541
|
-
out.fail(`Failed to assign`);
|
|
7542
|
-
out.error(assignError);
|
|
7543
|
-
} else {
|
|
7544
|
-
out.succeed(`Assigned to ${opts.router ? `router: ${opts.router}` : `agent: ${opts.agent}`}`);
|
|
7545
|
-
}
|
|
7546
|
-
}
|
|
7588
|
+
process.exit(1);
|
|
7589
|
+
}
|
|
7590
|
+
out.succeed(`Voice connection created for ${phoneNumber}`);
|
|
7591
|
+
if (opts.router || opts.agent) {
|
|
7592
|
+
const slug = opts.router ?? opts.agent;
|
|
7593
|
+
const kind = opts.router ? "router" : "agent";
|
|
7594
|
+
out.info(`Assigned to ${kind}: ${slug}`);
|
|
7547
7595
|
}
|
|
7548
7596
|
}
|
|
7549
7597
|
if (opts.test) {
|
|
@@ -11083,7 +11131,7 @@ keysCommand.command("revoke <id-or-prefix>").description("Revoke an API key (del
|
|
|
11083
11131
|
// package.json
|
|
11084
11132
|
var package_default = {
|
|
11085
11133
|
name: "struere",
|
|
11086
|
-
version: "0.14.
|
|
11134
|
+
version: "0.14.8",
|
|
11087
11135
|
description: "Build, test, and deploy AI agents",
|
|
11088
11136
|
keywords: [
|
|
11089
11137
|
"ai",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/utils/__tests__/validator.test.ts"],"names":[],"mappings":""}
|
|
@@ -40,9 +40,28 @@ export declare function setVoicePhoneAgent(args: {
|
|
|
40
40
|
data?: unknown;
|
|
41
41
|
error?: string;
|
|
42
42
|
}>;
|
|
43
|
+
export declare function createVoiceConnectionWithAssignment(args: {
|
|
44
|
+
environment: Environment;
|
|
45
|
+
twilioAccountSid: string;
|
|
46
|
+
twilioPhoneNumber: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
phoneNumberSid?: string;
|
|
49
|
+
routerSlug?: string;
|
|
50
|
+
agentSlug?: string;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
data?: unknown;
|
|
53
|
+
error?: string;
|
|
54
|
+
}>;
|
|
43
55
|
export declare function listVoiceConnections(): Promise<{
|
|
44
56
|
data?: unknown;
|
|
45
57
|
error?: string;
|
|
46
58
|
}>;
|
|
59
|
+
export declare function removeVoiceConnectionByPhone(args: {
|
|
60
|
+
environment: Environment;
|
|
61
|
+
twilioPhoneNumber: string;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
data?: unknown;
|
|
64
|
+
error?: string;
|
|
65
|
+
}>;
|
|
47
66
|
export {};
|
|
48
67
|
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/integrations.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,aAAa,GAAG,YAAY,CAAA;AAkG/C,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW;WAhGa,OAAO;YAAU,MAAM;GAkGhH;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;WApEpB,OAAO;YAAU,MAAM;GAsEnH;AAED,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW;WAxCS,OAAO;YAAU,MAA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,CAAA;CAC1B;WA5H4F,OAAO;YAAU,MAAM;GA8HnH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAWD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,eAAe,GACzB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAWD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,eAAe,GACzB,gBAAgB,CAuGlB"}
|