@roarkanalytics/sdk-mcp 4.44.1 → 4.44.4
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/CHANGELOG.md +21 -0
- package/client-headers.d.mts +2 -2
- package/client-headers.d.ts +2 -2
- package/client-headers.js +1 -1
- package/client-headers.mjs +1 -1
- package/directory-output-schemas.d.mts +139 -0
- package/directory-output-schemas.d.mts.map +1 -0
- package/directory-output-schemas.d.ts +139 -0
- package/directory-output-schemas.d.ts.map +1 -0
- package/directory-output-schemas.js +191 -0
- package/directory-output-schemas.js.map +1 -0
- package/directory-output-schemas.mjs +188 -0
- package/directory-output-schemas.mjs.map +1 -0
- package/directory-tools.d.mts.map +1 -1
- package/directory-tools.d.ts.map +1 -1
- package/directory-tools.js +261 -105
- package/directory-tools.js.map +1 -1
- package/directory-tools.mjs +261 -105
- package/directory-tools.mjs.map +1 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +6 -3
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +6 -3
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +8 -7
- package/http.js.map +1 -1
- package/http.mjs +9 -8
- package/http.mjs.map +1 -1
- package/oauth.d.mts +16 -1
- package/oauth.d.mts.map +1 -1
- package/oauth.d.ts +16 -1
- package/oauth.d.ts.map +1 -1
- package/oauth.js +24 -1
- package/oauth.js.map +1 -1
- package/oauth.mjs +22 -0
- package/oauth.mjs.map +1 -1
- package/options.d.mts +10 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +10 -0
- package/options.d.ts.map +1 -1
- package/options.js +28 -3
- package/options.js.map +1 -1
- package/options.mjs +26 -3
- package/options.mjs.map +1 -1
- package/package.json +11 -1
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +8 -1
- package/server.js.map +1 -1
- package/server.mjs +8 -1
- package/server.mjs.map +1 -1
- package/src/client-headers.ts +1 -1
- package/src/directory-output-schemas.ts +240 -0
- package/src/directory-tools.ts +298 -91
- package/src/docs-search-tool.ts +9 -3
- package/src/http.ts +9 -7
- package/src/oauth.ts +28 -1
- package/src/options.ts +27 -3
- package/src/server.ts +9 -1
- package/src/types.ts +1 -0
- package/types.d.mts +1 -0
- package/types.d.mts.map +1 -1
- package/types.d.ts +1 -0
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/types.mjs.map +1 -1
package/directory-tools.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.DIRECTORY_SERVER_INSTRUCTIONS = void 0;
|
|
|
13
13
|
exports.directoryTools = directoryTools;
|
|
14
14
|
const sdk_1 = require("@roarkanalytics/sdk");
|
|
15
15
|
const types_1 = require("./types.js");
|
|
16
|
+
const directory_output_schemas_1 = require("./directory-output-schemas.js");
|
|
16
17
|
/**
|
|
17
18
|
* Server instructions for the directory surface.
|
|
18
19
|
*
|
|
@@ -107,30 +108,39 @@ class ToolInputError extends Error {
|
|
|
107
108
|
this.name = 'ToolInputError';
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
// Every tool talks only to the Roark API, so openWorldHint is false, except
|
|
112
|
+
// run_simulation, which places phone calls to the agent under test.
|
|
110
113
|
const readAnnotations = (title) => ({
|
|
111
114
|
title,
|
|
112
115
|
readOnlyHint: true,
|
|
113
116
|
destructiveHint: false,
|
|
117
|
+
idempotentHint: true,
|
|
118
|
+
openWorldHint: false,
|
|
114
119
|
});
|
|
115
|
-
|
|
120
|
+
// Each write creates a new record, so repeating a call is not idempotent.
|
|
121
|
+
const writeAnnotations = (title, { openWorld = false } = {}) => ({
|
|
116
122
|
title,
|
|
117
123
|
readOnlyHint: false,
|
|
118
124
|
destructiveHint: true,
|
|
125
|
+
idempotentHint: false,
|
|
126
|
+
openWorldHint: openWorld,
|
|
119
127
|
});
|
|
120
128
|
const projectProperty = {
|
|
121
129
|
type: 'string',
|
|
122
130
|
description: 'Roark project id. Required when this connection is not already pinned to one project. list_projects returns the ids this credential can use.',
|
|
123
131
|
};
|
|
124
|
-
|
|
132
|
+
/** `after` and `limit`, with the page size the endpoint uses when `limit` is omitted. */
|
|
133
|
+
const paging = (defaultLimit) => ({
|
|
125
134
|
after: {
|
|
126
135
|
type: 'string',
|
|
127
|
-
description: '
|
|
136
|
+
description: 'Paging cursor: pass pagination.nextCursor from the previous response to get the next page. Omit for the first page.',
|
|
128
137
|
},
|
|
129
138
|
limit: {
|
|
130
139
|
type: 'number',
|
|
131
|
-
description:
|
|
140
|
+
description: `Page size: the most rows one response returns. When omitted, the API returns up to ${defaultLimit}.`,
|
|
132
141
|
},
|
|
133
|
-
};
|
|
142
|
+
});
|
|
143
|
+
const pagingProperties = paging(20);
|
|
134
144
|
const objectSchema = (properties, required) => ({
|
|
135
145
|
type: 'object',
|
|
136
146
|
properties,
|
|
@@ -335,9 +345,17 @@ const callListQuery = (args) => omitUndefined({
|
|
|
335
345
|
after: optionalString(args, 'after'),
|
|
336
346
|
limit: optionalLimit(args),
|
|
337
347
|
});
|
|
348
|
+
// Every tool declares an outputSchema, so the response body is also returned as
|
|
349
|
+
// structuredContent. The JSON text stays for clients that read only content.
|
|
338
350
|
const callApi = async (fn) => {
|
|
339
351
|
try {
|
|
340
|
-
|
|
352
|
+
const result = await fn();
|
|
353
|
+
// A tool with an outputSchema must return structuredContent, which is an object. The API
|
|
354
|
+
// always answers with { data, ... }; anything else is reported rather than sent unstructured.
|
|
355
|
+
if (!isRecord(result)) {
|
|
356
|
+
return (0, types_1.asErrorResult)(`Unexpected response from the Roark API: ${JSON.stringify(result) ?? 'empty'}`);
|
|
357
|
+
}
|
|
358
|
+
return { ...(0, types_1.asTextContentResult)(result), structuredContent: result };
|
|
341
359
|
}
|
|
342
360
|
catch (error) {
|
|
343
361
|
if (error instanceof ToolInputError || error instanceof sdk_1.APIError || error instanceof Error) {
|
|
@@ -347,22 +365,26 @@ const callApi = async (fn) => {
|
|
|
347
365
|
}
|
|
348
366
|
};
|
|
349
367
|
const handler = (fn) => async ({ reqContext, args, }) => callApi(() => fn(reqContext, args ?? {}));
|
|
350
|
-
const defineTool = (name, title, description, inputSchema, annotations, metadata, fn) => ({
|
|
368
|
+
const defineTool = (name, title, description, inputSchema, outputSchema, annotations, metadata, fn) => ({
|
|
351
369
|
metadata,
|
|
352
370
|
tool: {
|
|
353
371
|
name,
|
|
354
372
|
title,
|
|
355
373
|
description,
|
|
356
374
|
inputSchema,
|
|
375
|
+
outputSchema,
|
|
357
376
|
annotations,
|
|
358
377
|
},
|
|
359
378
|
handler: handler(fn),
|
|
360
379
|
});
|
|
361
380
|
const endpointSchema = {
|
|
362
381
|
type: 'object',
|
|
363
|
-
description: 'An agent endpoint
|
|
382
|
+
description: 'An agent endpoint the run tests.',
|
|
364
383
|
properties: {
|
|
365
|
-
id: {
|
|
384
|
+
id: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description: 'Agent endpoint id, from list_agent_endpoints or create_agent_endpoint.',
|
|
387
|
+
},
|
|
366
388
|
},
|
|
367
389
|
required: ['id'],
|
|
368
390
|
};
|
|
@@ -370,23 +392,62 @@ const metricRefSchema = {
|
|
|
370
392
|
type: 'object',
|
|
371
393
|
description: 'A metric to score, by id or by slug.',
|
|
372
394
|
properties: {
|
|
373
|
-
id: { type: 'string', description: 'Metric definition id.' },
|
|
374
|
-
slug: {
|
|
395
|
+
id: { type: 'string', description: 'Metric definition id, from list_metric_definitions.' },
|
|
396
|
+
slug: {
|
|
397
|
+
type: 'string',
|
|
398
|
+
description: 'Metric slug, from list_metric_definitions. Use instead of id.',
|
|
399
|
+
},
|
|
375
400
|
},
|
|
376
401
|
};
|
|
402
|
+
// A {{variable}} name to value map. The API takes string values only.
|
|
403
|
+
const stringMapSchema = (description) => ({
|
|
404
|
+
type: 'object',
|
|
405
|
+
description,
|
|
406
|
+
additionalProperties: { type: 'string' },
|
|
407
|
+
});
|
|
377
408
|
const flowAttachmentSchema = {
|
|
378
409
|
type: 'object',
|
|
379
|
-
description: 'A customer flow to include.
|
|
410
|
+
description: 'A customer flow to include. Name it by id or slug, and set happyPath, edgeCases, or both.',
|
|
380
411
|
properties: {
|
|
381
|
-
id: {
|
|
382
|
-
|
|
383
|
-
|
|
412
|
+
id: {
|
|
413
|
+
type: 'string',
|
|
414
|
+
description: 'Customer flow id, from list_customer_flows or create_customer_flow.',
|
|
415
|
+
},
|
|
416
|
+
slug: {
|
|
417
|
+
type: 'string',
|
|
418
|
+
description: 'Stable slug of a flow Roark provides, used instead of id. GET /v1/simulation/template lists them. Flows made in the project have no slug.',
|
|
419
|
+
},
|
|
420
|
+
happyPath: { type: 'boolean', description: 'true runs the flow happy path.' },
|
|
384
421
|
edgeCases: {
|
|
385
|
-
|
|
422
|
+
type: ['string', 'array'],
|
|
423
|
+
description: 'The string ALL runs every edge case the flow has when the run starts. An array runs only the listed edge cases, each named by id or slug.',
|
|
424
|
+
items: {
|
|
425
|
+
type: 'object',
|
|
426
|
+
properties: {
|
|
427
|
+
id: {
|
|
428
|
+
type: 'string',
|
|
429
|
+
description: "Edge case id, from the flow's edgeCases in list_customer_flows.",
|
|
430
|
+
},
|
|
431
|
+
slug: {
|
|
432
|
+
type: 'string',
|
|
433
|
+
description: 'Stable slug of an edge case Roark provides, matched within this flow. Used instead of id.',
|
|
434
|
+
},
|
|
435
|
+
personaOverrideId: {
|
|
436
|
+
type: 'string',
|
|
437
|
+
description: 'Persona id, from list_personas, to run this edge case as instead of its own persona.',
|
|
438
|
+
},
|
|
439
|
+
variables: stringMapSchema('Values for the {{variables}} in this edge case only, as variable name to string value.'),
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
personaOverrideId: {
|
|
444
|
+
type: 'string',
|
|
445
|
+
description: 'Persona id, from list_personas, to run everything in this flow as instead of its own persona.',
|
|
386
446
|
},
|
|
387
|
-
personaOverrideId: { type: 'string', description: 'Persona id to use for this attachment.' },
|
|
388
447
|
},
|
|
389
448
|
};
|
|
449
|
+
const callIdDescription = 'Roark call id, from list_calls.';
|
|
450
|
+
const directionDescription = 'INBOUND: the simulated caller phones the agent. OUTBOUND: the agent places the call to the simulated caller.';
|
|
390
451
|
const buildRunBody = (args) => {
|
|
391
452
|
const hasPlanId = args['planId'] !== undefined;
|
|
392
453
|
const hasPlan = args['plan'] !== undefined;
|
|
@@ -540,50 +601,63 @@ const buildEndpointBody = (args) => {
|
|
|
540
601
|
*/
|
|
541
602
|
function directoryTools() {
|
|
542
603
|
return [
|
|
543
|
-
defineTool('list_projects', 'List projects', 'Lists the Roark projects this credential can use, with the permissions it holds in each. Returns each project id, name, slug, and organization.', objectSchema({}), readAnnotations('List projects'), readMeta('project', '/v1/projects'), async (reqContext) => reqContext.client.project.list()),
|
|
544
|
-
defineTool('list_agents', 'List agents', 'Lists voice and chat agents in a Roark project. Returns each agent id, name, custom id, and description.', objectSchema({
|
|
604
|
+
defineTool('list_projects', 'List projects', 'Lists the Roark projects this credential can use, with the permissions it holds in each. Returns each project id, name, slug, and organization.', objectSchema({}), directory_output_schemas_1.directoryOutputSchemas.listProjects, readAnnotations('List projects'), readMeta('project', '/v1/projects'), async (reqContext) => reqContext.client.project.list()),
|
|
605
|
+
defineTool('list_agents', 'List agents', 'Lists voice and chat agents in a Roark project, every agent unless searchText narrows it. Returns each agent id, name, custom id, and description, one page at a time.', objectSchema({
|
|
545
606
|
project: projectProperty,
|
|
546
|
-
searchText: {
|
|
607
|
+
searchText: {
|
|
608
|
+
type: 'string',
|
|
609
|
+
description: 'Text to match against agent names and descriptions. When omitted, every agent is listed.',
|
|
610
|
+
},
|
|
547
611
|
...pagingProperties,
|
|
548
|
-
}), readAnnotations('List agents'), readMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.list(omitUndefined({
|
|
612
|
+
}), directory_output_schemas_1.directoryOutputSchemas.listAgents, readAnnotations('List agents'), readMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.list(omitUndefined({
|
|
549
613
|
searchText: optionalString(args, 'searchText'),
|
|
550
614
|
after: optionalString(args, 'after'),
|
|
551
615
|
limit: optionalLimit(args),
|
|
552
616
|
}))),
|
|
553
|
-
defineTool('list_agent_endpoints', 'List agent endpoints', 'Lists the endpoints Roark uses to reach agents in a project. Returns each endpoint id, agent id, direction, type, and address. A simulation runs against an endpoint id.', objectSchema({
|
|
617
|
+
defineTool('list_agent_endpoints', 'List agent endpoints', 'Lists the endpoints Roark uses to reach agents in a project: phone numbers and other transports. Returns each endpoint id, agent id, direction, type, and address. A simulation runs against an endpoint id.', objectSchema({
|
|
554
618
|
project: projectProperty,
|
|
555
|
-
agentId: {
|
|
556
|
-
|
|
619
|
+
agentId: {
|
|
620
|
+
type: 'string',
|
|
621
|
+
description: "Agent id, from list_agents, to list only that agent's endpoints. When omitted, endpoints for every agent are listed.",
|
|
622
|
+
},
|
|
623
|
+
searchText: {
|
|
624
|
+
type: 'string',
|
|
625
|
+
description: 'Text to match against the endpoint address, such as a phone number, or its environment name.',
|
|
626
|
+
},
|
|
557
627
|
...pagingProperties,
|
|
558
|
-
}), readAnnotations('List agent endpoints'), readMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.list(omitUndefined({
|
|
628
|
+
}), directory_output_schemas_1.directoryOutputSchemas.listAgentEndpoints, readAnnotations('List agent endpoints'), readMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.list(omitUndefined({
|
|
559
629
|
agentId: optionalString(args, 'agentId'),
|
|
560
630
|
searchText: optionalString(args, 'searchText'),
|
|
561
631
|
after: optionalString(args, 'after'),
|
|
562
632
|
limit: optionalLimit(args),
|
|
563
633
|
}))),
|
|
564
|
-
defineTool('list_calls', 'List calls', 'Lists calls in a Roark project,
|
|
565
|
-
|
|
566
|
-
'properties filters with one operator per name: eq is a case-insensitive exact match, and exists checks whether the property is set. ' +
|
|
567
|
-
"Built-in agent_name, also accepted as agentName, matches any participating agent's current name. Built-in agent_id matches one agent UUID. Any other name is a custom property. " +
|
|
568
|
-
'sortBy is createdAt (the default), startedAt, endedAt, duration, title, or status, and sortDirection is desc (the default) or asc. The filters and the sort apply together.', objectSchema({
|
|
634
|
+
defineTool('list_calls', 'List calls', 'Lists calls in a Roark project, simulated and live. Returns call ids, status, direction, and timestamps, without transcripts. Every filter and the sort apply together. ' +
|
|
635
|
+
"properties filters on call properties: eq matches a value, ignoring case, and exists checks whether the property is set. The built-in agent_name, also accepted as agentName, matches any participating agent's current name, and agent_id matches one agent id. Any other name is a custom property.", objectSchema({
|
|
569
636
|
project: projectProperty,
|
|
570
|
-
searchText: {
|
|
571
|
-
|
|
637
|
+
searchText: {
|
|
638
|
+
type: 'string',
|
|
639
|
+
description: 'Text to match against call titles, summaries, and transcripts.',
|
|
640
|
+
},
|
|
641
|
+
status: {
|
|
642
|
+
type: 'string',
|
|
643
|
+
enum: [...CALL_STATUSES],
|
|
644
|
+
description: 'Lifecycle state to list. When omitted, calls in every state are listed.',
|
|
645
|
+
},
|
|
572
646
|
agentId: {
|
|
573
647
|
type: 'string',
|
|
574
|
-
description: '
|
|
648
|
+
description: 'Agent ids, from list_agents, to list only calls those agents took part in. Several ids go comma-separated with no spaces, at most 100.',
|
|
575
649
|
},
|
|
576
650
|
properties: {
|
|
577
651
|
type: 'object',
|
|
578
|
-
description:
|
|
652
|
+
description: 'Call property filters, keyed by property name, at most 20. Each entry sets eq or exists, not both. agent_name (alias agentName) and agent_id are built in; any other name is a custom property set on the call.',
|
|
579
653
|
additionalProperties: {
|
|
580
654
|
type: 'object',
|
|
581
|
-
description: '
|
|
655
|
+
description: 'One filter: eq or exists.',
|
|
582
656
|
properties: {
|
|
583
|
-
eq: { type: 'string', description: '
|
|
657
|
+
eq: { type: 'string', description: 'Value the property must equal, ignoring case.' },
|
|
584
658
|
exists: {
|
|
585
659
|
type: 'boolean',
|
|
586
|
-
description: 'true
|
|
660
|
+
description: 'true lists calls that have the property set. false lists calls that do not.',
|
|
587
661
|
},
|
|
588
662
|
},
|
|
589
663
|
},
|
|
@@ -591,35 +665,35 @@ function directoryTools() {
|
|
|
591
665
|
sortBy: {
|
|
592
666
|
type: 'string',
|
|
593
667
|
enum: [...CALL_SORT_FIELDS],
|
|
594
|
-
description: '
|
|
668
|
+
description: 'Call field the results are ordered by. When omitted, createdAt.',
|
|
595
669
|
},
|
|
596
670
|
sortDirection: {
|
|
597
671
|
type: 'string',
|
|
598
672
|
enum: [...SORT_DIRECTIONS],
|
|
599
|
-
description: 'asc or
|
|
673
|
+
description: 'asc puts the earliest or smallest first, desc the latest or largest. When omitted, desc.',
|
|
600
674
|
},
|
|
601
675
|
simulationRunPlanJobId: {
|
|
602
676
|
type: 'string',
|
|
603
|
-
description: '
|
|
677
|
+
description: 'Simulation run id, the simulationRunPlanJobId that run_simulation returns, to list only the calls that run placed.',
|
|
604
678
|
},
|
|
605
679
|
...pagingProperties,
|
|
606
|
-
}), readAnnotations('List calls'), readMeta('call', '/v1/call'), async (reqContext, args) => scopedClient(reqContext, args).call.list(callListQuery(args))),
|
|
680
|
+
}), directory_output_schemas_1.directoryOutputSchemas.listCalls, readAnnotations('List calls'), readMeta('call', '/v1/call'), async (reqContext, args) => scopedClient(reqContext, args).call.list(callListQuery(args))),
|
|
607
681
|
defineTool('get_call', 'Get call', 'Returns one call in a Roark project by its id, including status, direction, timestamps, and summary. Does not include the transcript.', objectSchema({
|
|
608
682
|
project: projectProperty,
|
|
609
|
-
callId: { type: 'string', description:
|
|
610
|
-
}, ['callId']), readAnnotations('Get call'), readMeta('call', '/v1/call/{callId}'), async (reqContext, args) => scopedClient(reqContext, args).call.getByID(requireString(args, 'callId'))),
|
|
611
|
-
defineTool('get_call_transcript', 'Get call transcript', 'Returns the transcript of one call in a Roark project:
|
|
683
|
+
callId: { type: 'string', description: callIdDescription },
|
|
684
|
+
}, ['callId']), directory_output_schemas_1.directoryOutputSchemas.getCall, readAnnotations('Get call'), readMeta('call', '/v1/call/{callId}'), async (reqContext, args) => scopedClient(reqContext, args).call.getByID(requireString(args, 'callId'))),
|
|
685
|
+
defineTool('get_call_transcript', 'Get call transcript', 'Returns the transcript of one call in a Roark project: who took part, and the text of each turn with its timing.', objectSchema({
|
|
612
686
|
project: projectProperty,
|
|
613
|
-
callId: { type: 'string', description:
|
|
687
|
+
callId: { type: 'string', description: callIdDescription },
|
|
614
688
|
source: {
|
|
615
689
|
type: 'string',
|
|
616
690
|
enum: [...TRANSCRIPT_SOURCES],
|
|
617
|
-
description: '
|
|
691
|
+
description: 'Which transcription to return: Roark post-call transcription, or the one the simulated caller or your agent captured live. When omitted, the first available of CUSTOMER_AGENT_REALTIME, SIMULATION_AGENT_REALTIME, then ROARK_POST_CALL.',
|
|
618
692
|
},
|
|
619
|
-
}, ['callId']), readAnnotations('Get call transcript'), readMeta('call', '/v1/call/{callId}/transcript'), async (reqContext, args) => scopedClient(reqContext, args).call.getTranscript(requireString(args, 'callId'), omitUndefined({ source: optionalEnum(args, 'source', TRANSCRIPT_SOURCES) }))),
|
|
620
|
-
defineTool('list_call_metrics', 'List call metrics', 'Returns the metric scores recorded for one call in a Roark project
|
|
693
|
+
}, ['callId']), directory_output_schemas_1.directoryOutputSchemas.getCallTranscript, readAnnotations('Get call transcript'), readMeta('call', '/v1/call/{callId}/transcript'), async (reqContext, args) => scopedClient(reqContext, args).call.getTranscript(requireString(args, 'callId'), omitUndefined({ source: optionalEnum(args, 'source', TRANSCRIPT_SOURCES) }))),
|
|
694
|
+
defineTool('list_call_metrics', 'List call metrics', 'Returns the metric scores recorded for one call in a Roark project, grouped by metric unless flatten is true.', objectSchema({
|
|
621
695
|
project: projectProperty,
|
|
622
|
-
callId: { type: 'string', description:
|
|
696
|
+
callId: { type: 'string', description: callIdDescription },
|
|
623
697
|
flatten: {
|
|
624
698
|
type: 'string',
|
|
625
699
|
description: 'true returns one row per score. Any other value, or omitting it, groups scores by metric.',
|
|
@@ -627,13 +701,13 @@ function directoryTools() {
|
|
|
627
701
|
status: {
|
|
628
702
|
type: 'string',
|
|
629
703
|
enum: ['success', 'all'],
|
|
630
|
-
description: 'success returns computed scores. all also returns
|
|
704
|
+
description: 'success returns computed scores only. all also returns metrics with no value (not applicable, missing data, or an error), so a caller can tell a finished metric from one still computing. When omitted, success.',
|
|
631
705
|
},
|
|
632
|
-
}, ['callId']), readAnnotations('List call metrics'), readMeta('call', '/v1/call/{callId}/metrics'), async (reqContext, args) => scopedClient(reqContext, args).call.listMetrics(requireString(args, 'callId'), omitUndefined({
|
|
706
|
+
}, ['callId']), directory_output_schemas_1.directoryOutputSchemas.listCallMetrics, readAnnotations('List call metrics'), readMeta('call', '/v1/call/{callId}/metrics'), async (reqContext, args) => scopedClient(reqContext, args).call.listMetrics(requireString(args, 'callId'), omitUndefined({
|
|
633
707
|
flatten: optionalString(args, 'flatten'),
|
|
634
708
|
status: optionalEnum(args, 'status', ['success', 'all']),
|
|
635
709
|
}))),
|
|
636
|
-
defineTool('list_metric_definitions', 'List metric definitions', 'Lists the metrics a Roark project can score, including built-in and custom metrics. Returns each metric id, slug, name, and type.', objectSchema({ project: projectProperty, ...
|
|
710
|
+
defineTool('list_metric_definitions', 'List metric definitions', 'Lists the metrics a Roark project can score, including built-in and custom metrics. Returns each metric id, slug, name, and type.', objectSchema({ project: projectProperty, ...paging(500) }), directory_output_schemas_1.directoryOutputSchemas.listMetricDefinitions, readAnnotations('List metric definitions'), readMeta('metric', '/v1/metric/definitions'), async (reqContext, args) => scopedClient(reqContext, args).metric.listDefinitions(omitUndefined({ after: optionalString(args, 'after'), limit: optionalLimit(args) }))),
|
|
637
711
|
defineTool('get_simulation_results', 'Get simulation results', 'Returns the results of one simulation run in a Roark project: run status, score, pass or fail verdict, per-metric aggregates, and the checks on each simulated call. Counts include calls that have finished so far. The verdict is absent until the run ends.', objectSchema({
|
|
638
712
|
project: projectProperty,
|
|
639
713
|
jobId: {
|
|
@@ -644,102 +718,134 @@ function directoryTools() {
|
|
|
644
718
|
type: 'string',
|
|
645
719
|
description: 'Another simulation run id to compare against. When omitted, the API compares with the previous settled run of the same plan.',
|
|
646
720
|
},
|
|
647
|
-
}, ['jobId']), readAnnotations('Get simulation results'), readMeta('simulationRunPlanJob', '/v1/simulation/plan/job/{jobId}/results'), async (reqContext, args) => scopedClient(reqContext, args).simulationRunPlanJob.getResults(requireString(args, 'jobId'), omitUndefined({ compareToJobId: optionalString(args, 'compareToJobId') }))),
|
|
648
|
-
defineTool('list_personas', 'List personas', 'Lists simulated caller personas in a Roark project. Returns each persona id, name, language, accent, and gender.', objectSchema({
|
|
721
|
+
}, ['jobId']), directory_output_schemas_1.directoryOutputSchemas.getSimulationResults, readAnnotations('Get simulation results'), readMeta('simulationRunPlanJob', '/v1/simulation/plan/job/{jobId}/results'), async (reqContext, args) => scopedClient(reqContext, args).simulationRunPlanJob.getResults(requireString(args, 'jobId'), omitUndefined({ compareToJobId: optionalString(args, 'compareToJobId') }))),
|
|
722
|
+
defineTool('list_personas', 'List personas', 'Lists simulated caller personas in a Roark project, every persona unless searchText narrows it. Returns each persona id, name, language, accent, and gender, one page at a time.', objectSchema({
|
|
649
723
|
project: projectProperty,
|
|
650
|
-
searchText: {
|
|
724
|
+
searchText: {
|
|
725
|
+
type: 'string',
|
|
726
|
+
description: 'Text to match against persona names and descriptions. When omitted, every persona is listed.',
|
|
727
|
+
},
|
|
651
728
|
...pagingProperties,
|
|
652
|
-
}), readAnnotations('List personas'), readMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.list(omitUndefined({
|
|
729
|
+
}), directory_output_schemas_1.directoryOutputSchemas.listPersonas, readAnnotations('List personas'), readMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.list(omitUndefined({
|
|
653
730
|
searchText: optionalString(args, 'searchText'),
|
|
654
731
|
after: optionalString(args, 'after'),
|
|
655
732
|
limit: optionalLimit(args),
|
|
656
733
|
}))),
|
|
657
|
-
defineTool('list_customer_flows', 'List customer flows', 'Lists customer flows in a Roark project. A customer flow is the conversation scenario a simulated caller follows. Returns each flow id, title, and
|
|
734
|
+
defineTool('list_customer_flows', 'List customer flows', 'Lists customer flows in a Roark project. A customer flow is the conversation scenario a simulated caller follows. Returns each flow id, title, type, happy path, and edge cases. The step graph of a scripted flow is not included.', objectSchema({
|
|
658
735
|
project: projectProperty,
|
|
659
|
-
searchText: {
|
|
660
|
-
|
|
736
|
+
searchText: {
|
|
737
|
+
type: 'string',
|
|
738
|
+
description: 'Text to match against flow titles. When omitted, flows are not filtered by title.',
|
|
739
|
+
},
|
|
740
|
+
type: {
|
|
741
|
+
type: 'string',
|
|
742
|
+
enum: [...FLOW_TYPES],
|
|
743
|
+
description: 'Kind of flow to list. When omitted, flows of every kind are listed.',
|
|
744
|
+
},
|
|
661
745
|
includeSystem: {
|
|
662
746
|
type: 'string',
|
|
663
747
|
enum: ['true', 'false'],
|
|
664
|
-
description: 'true
|
|
748
|
+
description: 'true also lists flows Roark provides. false, or omitting it, lists only flows made in the project.',
|
|
665
749
|
},
|
|
666
750
|
...pagingProperties,
|
|
667
|
-
}), readAnnotations('List customer flows'), readMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.list(omitUndefined({
|
|
751
|
+
}), directory_output_schemas_1.directoryOutputSchemas.listCustomerFlows, readAnnotations('List customer flows'), readMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.list(omitUndefined({
|
|
668
752
|
searchText: optionalString(args, 'searchText'),
|
|
669
753
|
type: optionalEnum(args, 'type', FLOW_TYPES),
|
|
670
754
|
includeSystem: optionalEnum(args, 'includeSystem', ['true', 'false']),
|
|
671
755
|
after: optionalString(args, 'after'),
|
|
672
756
|
limit: optionalLimit(args),
|
|
673
757
|
}))),
|
|
674
|
-
defineTool('list_simulation_environments', 'List simulation environments', 'Lists call environments in a Roark project, including environments Roark provides. Returns each environment id, name, and background noise. Creating a customer flow requires an environment id.', objectSchema({ project: projectProperty, ...pagingProperties }), readAnnotations('List simulation environments'), readMeta('simulationEnvironment', '/v1/simulation/environment'), async (reqContext, args) => scopedClient(reqContext, args).simulationEnvironment.list(omitUndefined({ after: optionalString(args, 'after'), limit: optionalLimit(args) }))),
|
|
675
|
-
defineTool('create_agent', 'Create agent', 'Creates an agent in a Roark project. Requires a name. Returns the created agent, including its id. Does not create an endpoint.', objectSchema({
|
|
758
|
+
defineTool('list_simulation_environments', 'List simulation environments', 'Lists call environments in a Roark project, including environments Roark provides. Returns each environment id, name, and background noise. Creating a customer flow requires an environment id.', objectSchema({ project: projectProperty, ...pagingProperties }), directory_output_schemas_1.directoryOutputSchemas.listSimulationEnvironments, readAnnotations('List simulation environments'), readMeta('simulationEnvironment', '/v1/simulation/environment'), async (reqContext, args) => scopedClient(reqContext, args).simulationEnvironment.list(omitUndefined({ after: optionalString(args, 'after'), limit: optionalLimit(args) }))),
|
|
759
|
+
defineTool('create_agent', 'Create agent', 'Creates an agent in a Roark project. Each call adds a new agent. Requires a name. Returns the created agent, including its id. Does not create an endpoint; create_agent_endpoint does.', objectSchema({
|
|
676
760
|
project: projectProperty,
|
|
677
|
-
name: {
|
|
761
|
+
name: {
|
|
762
|
+
type: 'string',
|
|
763
|
+
description: 'Display name for the agent, shown in Roark and returned by list_agents.',
|
|
764
|
+
},
|
|
678
765
|
description: { type: 'string', description: 'What the agent does.' },
|
|
679
|
-
customId: {
|
|
680
|
-
|
|
766
|
+
customId: {
|
|
767
|
+
type: 'string',
|
|
768
|
+
description: 'Your own identifier for the agent, such as its id in your platform. Unique in the project.',
|
|
769
|
+
},
|
|
770
|
+
}, ['name']), directory_output_schemas_1.directoryOutputSchemas.createAgent, writeAnnotations('Create agent'), writeMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.create({
|
|
681
771
|
name: requireString(args, 'name'),
|
|
682
772
|
...omitUndefined({
|
|
683
773
|
description: optionalString(args, 'description'),
|
|
684
774
|
customId: optionalString(args, 'customId'),
|
|
685
775
|
}),
|
|
686
776
|
})),
|
|
687
|
-
defineTool('create_agent_endpoint', 'Create agent endpoint', 'Creates a phone endpoint for an agent in a Roark project.
|
|
777
|
+
defineTool('create_agent_endpoint', 'Create agent endpoint', 'Creates a phone endpoint for an agent in a Roark project. Each call adds a new endpoint; it places no calls itself. Simulations then call the agent on this number, or receive its calls. Phone is the only endpoint type this tool creates.', objectSchema({
|
|
688
778
|
project: projectProperty,
|
|
689
779
|
agentId: { type: 'string', description: 'Agent id from list_agents or create_agent.' },
|
|
690
|
-
value: {
|
|
780
|
+
value: {
|
|
781
|
+
type: 'string',
|
|
782
|
+
description: "The agent's phone number in E.164 form, such as +14155550123.",
|
|
783
|
+
},
|
|
691
784
|
direction: {
|
|
692
785
|
type: 'string',
|
|
693
786
|
enum: [...ENDPOINT_DIRECTIONS],
|
|
694
|
-
description: 'Which way calls
|
|
787
|
+
description: 'Which way calls travel on this number: INCOMING when callers reach the agent here, OUTGOING when the agent calls out from it, or both.',
|
|
788
|
+
},
|
|
789
|
+
environment: {
|
|
790
|
+
type: 'string',
|
|
791
|
+
description: 'Environment label for the endpoint, such as production or staging. When omitted, production.',
|
|
695
792
|
},
|
|
696
|
-
environment: { type: 'string', description: 'Environment name. The API default is production.' },
|
|
697
793
|
outboundDialType: {
|
|
698
794
|
type: 'string',
|
|
699
795
|
enum: ['NONE', 'HTTP_REQUEST'],
|
|
700
|
-
description: 'How Roark
|
|
796
|
+
description: 'How Roark starts an outbound simulation: HTTP_REQUEST sends an HTTP request to your platform to make the agent dial, NONE sends nothing. When omitted, NONE.',
|
|
701
797
|
},
|
|
702
798
|
outboundDialHttpRequestDefinitionId: {
|
|
703
799
|
type: 'string',
|
|
704
|
-
description: 'HTTP request definition
|
|
800
|
+
description: 'Id of the HTTP request definition Roark sends to make the agent dial, from GET /v1/http-request-definition. Required when outboundDialType is HTTP_REQUEST.',
|
|
705
801
|
},
|
|
706
|
-
}, ['agentId', 'value', 'direction']), writeAnnotations('Create agent endpoint'), writeMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.create(buildEndpointBody(args))),
|
|
707
|
-
defineTool('create_persona', 'Create persona', 'Creates a simulated caller persona in a Roark project. Requires a name, language, accent, and gender. Returns the created persona
|
|
802
|
+
}, ['agentId', 'value', 'direction']), directory_output_schemas_1.directoryOutputSchemas.createAgentEndpoint, writeAnnotations('Create agent endpoint'), writeMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.create(buildEndpointBody(args))),
|
|
803
|
+
defineTool('create_persona', 'Create persona', 'Creates a simulated caller persona in a Roark project. Each call adds a new persona, so repeating it creates a duplicate. It changes nothing else and places no calls. Requires a name, language, accent, and gender. Returns the created persona; pass its id as personaOverrideId to create_customer_flow to use it.', objectSchema({
|
|
708
804
|
project: projectProperty,
|
|
709
805
|
name: { type: 'string', description: 'Name the caller uses in conversation.' },
|
|
710
806
|
language: { type: 'string', enum: [...LANGUAGES], description: 'Primary spoken language.' },
|
|
711
|
-
accent: { type: 'string', enum: [...ACCENTS], description: 'Accent the
|
|
807
|
+
accent: { type: 'string', enum: [...ACCENTS], description: 'Accent the caller speaks with.' },
|
|
712
808
|
gender: { type: 'string', enum: [...GENDERS], description: 'Gender the persona is voiced with.' },
|
|
713
809
|
age: {
|
|
714
810
|
type: 'string',
|
|
715
811
|
enum: [...AGES],
|
|
716
|
-
description: 'How old the caller sounds.
|
|
812
|
+
description: 'How old the caller sounds. When omitted, ADULT.',
|
|
717
813
|
},
|
|
718
814
|
baseEmotion: {
|
|
719
815
|
type: 'string',
|
|
720
816
|
enum: [...EMOTIONS],
|
|
721
|
-
description: '
|
|
817
|
+
description: 'Mood the caller starts the conversation in. When omitted, NEUTRAL.',
|
|
722
818
|
},
|
|
723
819
|
backstoryPrompt: {
|
|
724
820
|
type: 'string',
|
|
725
821
|
description: 'Background and behavior the simulated caller plays.',
|
|
726
822
|
},
|
|
727
|
-
description: {
|
|
728
|
-
|
|
729
|
-
|
|
823
|
+
description: {
|
|
824
|
+
type: 'string',
|
|
825
|
+
description: 'Short summary of the persona, to tell it apart from others in the project.',
|
|
826
|
+
},
|
|
827
|
+
}, ['name', 'language', 'accent', 'gender']), directory_output_schemas_1.directoryOutputSchemas.createPersona, writeAnnotations('Create persona'), writeMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.create(buildPersonaBody(args))),
|
|
828
|
+
defineTool('create_customer_flow', 'Create customer flow', 'Creates an improv customer flow in a Roark project. A customer flow is the conversation scenario a simulated caller follows. Each call adds a new flow. Requires a title, at least one agent id, and a happy path with a title, a persona id, and an environment id. Returns the created flow, including its id. Scripted step graphs are not created by this tool.', objectSchema({
|
|
730
829
|
project: projectProperty,
|
|
731
|
-
title: {
|
|
830
|
+
title: {
|
|
831
|
+
type: 'string',
|
|
832
|
+
description: 'Name for the flow, shown in Roark and returned by list_customer_flows.',
|
|
833
|
+
},
|
|
732
834
|
description: { type: 'string', description: 'What the conversation covers.' },
|
|
733
835
|
agentIds: {
|
|
734
836
|
type: 'array',
|
|
735
837
|
items: { type: 'string' },
|
|
736
|
-
|
|
838
|
+
minItems: 1,
|
|
839
|
+
description: 'Ids of the agents this flow tests, from list_agents or create_agent.',
|
|
737
840
|
},
|
|
738
841
|
happyPath: {
|
|
739
842
|
type: 'object',
|
|
740
843
|
description: 'The way the conversation is meant to go.',
|
|
741
844
|
properties: {
|
|
742
|
-
title: {
|
|
845
|
+
title: {
|
|
846
|
+
type: 'string',
|
|
847
|
+
description: 'Name for the happy path, the run where the conversation goes as intended.',
|
|
848
|
+
},
|
|
743
849
|
prompt: { type: 'string', description: 'What the simulated caller is trying to do.' },
|
|
744
850
|
personaOverrideId: {
|
|
745
851
|
type: 'string',
|
|
@@ -758,73 +864,123 @@ function directoryTools() {
|
|
|
758
864
|
items: {
|
|
759
865
|
type: 'object',
|
|
760
866
|
properties: {
|
|
761
|
-
title: { type: 'string' },
|
|
762
|
-
prompt: {
|
|
763
|
-
|
|
764
|
-
|
|
867
|
+
title: { type: 'string', description: 'Name for this edge case.' },
|
|
868
|
+
prompt: {
|
|
869
|
+
type: 'string',
|
|
870
|
+
description: 'What the simulated caller is trying to do in this edge case.',
|
|
871
|
+
},
|
|
872
|
+
personaOverrideId: {
|
|
873
|
+
type: 'string',
|
|
874
|
+
description: 'Persona id from list_personas or create_persona. When omitted, the happy path persona.',
|
|
875
|
+
},
|
|
876
|
+
environmentId: {
|
|
877
|
+
type: 'string',
|
|
878
|
+
description: 'Environment id from list_simulation_environments. When omitted, the happy path environment.',
|
|
879
|
+
},
|
|
765
880
|
},
|
|
766
881
|
required: ['title'],
|
|
767
882
|
},
|
|
768
883
|
},
|
|
769
|
-
}, ['title', 'agentIds', 'happyPath']), writeAnnotations('Create customer flow'), writeMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.create(buildFlowBody(args))),
|
|
770
|
-
defineTool('run_simulation', 'Run simulation', 'Starts a simulation run in a Roark project and places simulated calls. Pass exactly one of planId (an existing plan), plan (an inline plan), or template (a built-in template name, with agentEndpoints and direction). Returns the run id and how many calls the run places. This spends simulation usage on the account.', objectSchema({
|
|
884
|
+
}, ['title', 'agentIds', 'happyPath']), directory_output_schemas_1.directoryOutputSchemas.createCustomerFlow, writeAnnotations('Create customer flow'), writeMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.create(buildFlowBody(args))),
|
|
885
|
+
defineTool('run_simulation', 'Run simulation', 'Starts a simulation run in a Roark project and places simulated calls to the agent. Pass exactly one of planId (an existing plan), plan (an inline plan), or template (a built-in template name, with agentEndpoints and direction). Returns the run id and how many calls the run places. This spends simulation usage on the account.', objectSchema({
|
|
771
886
|
project: projectProperty,
|
|
772
887
|
planId: { type: 'string', description: 'Id of a saved simulation plan to run.' },
|
|
773
888
|
plan: {
|
|
774
889
|
type: 'object',
|
|
775
890
|
description: 'Inline plan to run once. Requires agentEndpoints, direction, and maxSimulationDurationSeconds.',
|
|
776
891
|
properties: {
|
|
777
|
-
name: {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
892
|
+
name: {
|
|
893
|
+
type: 'string',
|
|
894
|
+
description: 'Name for the plan. When omitted, one is generated from the date. Needed for saveAsPlan.',
|
|
895
|
+
},
|
|
896
|
+
description: { type: 'string', description: 'Note on what the plan tests.' },
|
|
897
|
+
direction: { type: 'string', enum: [...DIRECTIONS], description: directionDescription },
|
|
898
|
+
agentEndpoints: {
|
|
899
|
+
type: 'array',
|
|
900
|
+
items: endpointSchema,
|
|
901
|
+
description: 'The agent endpoints the run tests.',
|
|
902
|
+
},
|
|
781
903
|
metrics: {
|
|
782
904
|
type: 'array',
|
|
783
905
|
items: metricRefSchema,
|
|
784
906
|
description: 'Metrics to score, by id or slug.',
|
|
785
907
|
},
|
|
786
|
-
flows: {
|
|
787
|
-
|
|
908
|
+
flows: {
|
|
909
|
+
type: 'array',
|
|
910
|
+
items: flowAttachmentSchema,
|
|
911
|
+
description: 'Customer flows to run, and which of their happy paths and edge cases.',
|
|
912
|
+
},
|
|
913
|
+
maxSimulationDurationSeconds: {
|
|
914
|
+
type: 'number',
|
|
915
|
+
description: 'Longest one simulated call may last, in seconds.',
|
|
916
|
+
},
|
|
788
917
|
iterationCount: {
|
|
789
918
|
type: 'number',
|
|
790
|
-
description: '
|
|
919
|
+
description: 'Times each test case runs. When omitted, 1.',
|
|
791
920
|
},
|
|
792
921
|
maxConcurrentJobs: {
|
|
793
922
|
type: 'number',
|
|
794
|
-
description: 'How many calls run at once.
|
|
923
|
+
description: 'How many calls run at once. When omitted, 5.',
|
|
795
924
|
},
|
|
796
925
|
executionMode: {
|
|
797
926
|
type: 'string',
|
|
798
927
|
enum: ['PARALLEL', 'SEQUENTIAL_SAME_RUN_PLAN', 'SEQUENTIAL_PROJECT'],
|
|
928
|
+
description: 'When the run starts relative to other runs. PARALLEL starts it at once. SEQUENTIAL_SAME_RUN_PLAN queues it while another run of the same plan is active. SEQUENTIAL_PROJECT queues it while any run in the project is active. When omitted, PARALLEL.',
|
|
799
929
|
},
|
|
800
930
|
},
|
|
801
931
|
required: ['agentEndpoints', 'direction', 'maxSimulationDurationSeconds'],
|
|
802
932
|
},
|
|
803
933
|
template: {
|
|
804
934
|
type: 'string',
|
|
805
|
-
description: '
|
|
935
|
+
description: 'Name of a built-in Roark template, such as health-check. GET /v1/simulation/template lists them.',
|
|
806
936
|
},
|
|
807
937
|
agentEndpoints: {
|
|
808
938
|
type: 'array',
|
|
809
939
|
items: endpointSchema,
|
|
810
|
-
description: '
|
|
940
|
+
description: 'For a template run: the agent endpoints it tests. A template run fails without it.',
|
|
941
|
+
},
|
|
942
|
+
direction: {
|
|
943
|
+
type: 'string',
|
|
944
|
+
enum: [...DIRECTIONS],
|
|
945
|
+
description: `For a template run, where it is required. ${directionDescription}`,
|
|
811
946
|
},
|
|
812
|
-
direction: { type: 'string', enum: [...DIRECTIONS], description: 'Required with template.' },
|
|
813
947
|
flows: {
|
|
814
948
|
type: 'array',
|
|
815
949
|
items: flowAttachmentSchema,
|
|
816
|
-
description: '
|
|
950
|
+
description: 'For a template run: the flows to run. Needed when the template has no flows of its own; otherwise they replace its flows.',
|
|
951
|
+
},
|
|
952
|
+
iterationCount: {
|
|
953
|
+
type: 'number',
|
|
954
|
+
description: "For a template run: times each test case runs. When omitted, 1, or the template's own count for a template that sweeps a property.",
|
|
955
|
+
},
|
|
956
|
+
maxSimulationDurationSeconds: {
|
|
957
|
+
type: 'number',
|
|
958
|
+
description: "For a template run: longest one simulated call may last, in seconds. When omitted, the template's default.",
|
|
817
959
|
},
|
|
818
|
-
iterationCount: { type: 'number' },
|
|
819
|
-
maxSimulationDurationSeconds: { type: 'number' },
|
|
820
960
|
saveAsPlan: {
|
|
821
961
|
type: 'boolean',
|
|
822
962
|
description: 'When plan is set, true keeps the plan so it can be run again by planId. Requires plan.name.',
|
|
823
963
|
},
|
|
824
964
|
variables: {
|
|
825
|
-
|
|
965
|
+
type: ['object', 'array'],
|
|
966
|
+
description: 'Values for the {{variables}} the run resolves. An object of name to string value applies to the whole run. An array applies values per flow (flowId, optionally narrowed by edgeCaseId or happyPath).',
|
|
967
|
+
additionalProperties: { type: 'string' },
|
|
968
|
+
items: {
|
|
969
|
+
type: 'object',
|
|
970
|
+
properties: {
|
|
971
|
+
flowId: { type: 'string', description: 'Customer flow id the values apply to.' },
|
|
972
|
+
edgeCaseId: { type: 'string', description: 'Narrow to one edge case of that flow.' },
|
|
973
|
+
happyPath: { type: 'boolean', description: "Narrow to the flow's happy path." },
|
|
974
|
+
scenarioId: {
|
|
975
|
+
type: 'string',
|
|
976
|
+
description: 'Deprecated. Scenario id the values apply to, for a saved plan built from scenarios rather than flows. Use flowId otherwise. Template runs refuse it.',
|
|
977
|
+
},
|
|
978
|
+
variables: stringMapSchema('The values to apply, as variable name to string value.'),
|
|
979
|
+
},
|
|
980
|
+
required: ['variables'],
|
|
981
|
+
},
|
|
826
982
|
},
|
|
827
|
-
}), writeAnnotations('Run simulation'), writeMeta('simulation', '/v1/simulation/run'), async (reqContext, args) => scopedClient(reqContext, args).simulation.run(buildRunBody(args))),
|
|
983
|
+
}), directory_output_schemas_1.directoryOutputSchemas.runSimulation, writeAnnotations('Run simulation', { openWorld: true }), writeMeta('simulation', '/v1/simulation/run'), async (reqContext, args) => scopedClient(reqContext, args).simulation.run(buildRunBody(args))),
|
|
828
984
|
];
|
|
829
985
|
}
|
|
830
986
|
//# sourceMappingURL=directory-tools.js.map
|