@roarkanalytics/sdk-mcp 4.44.2 → 4.44.6
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 +28 -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 +251 -0
- package/directory-output-schemas.js.map +1 -0
- package/directory-output-schemas.mjs +248 -0
- package/directory-output-schemas.mjs.map +1 -0
- package/directory-tools.d.mts +2 -0
- package/directory-tools.d.mts.map +1 -1
- package/directory-tools.d.ts +2 -0
- package/directory-tools.d.ts.map +1 -1
- package/directory-tools.js +253 -115
- package/directory-tools.js.map +1 -1
- package/directory-tools.mjs +252 -114
- package/directory-tools.mjs.map +1 -1
- package/docs-search-tool.d.mts +10 -3
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +10 -3
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +36 -6
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +34 -5
- 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 +29 -3
- package/options.js.map +1 -1
- package/options.mjs +27 -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 +318 -0
- package/src/directory-tools.ts +291 -99
- package/src/docs-search-tool.ts +42 -6
- package/src/http.ts +9 -7
- package/src/oauth.ts +28 -1
- package/src/options.ts +30 -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.mjs
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// The local code-execution server stays on `execute`. This file is not generated.
|
|
10
10
|
import { APIError } from '@roarkanalytics/sdk';
|
|
11
11
|
import { asErrorResult, asTextContentResult, } from "./types.mjs";
|
|
12
|
+
import { directoryOutputSchemas } from "./directory-output-schemas.mjs";
|
|
12
13
|
/**
|
|
13
14
|
* Server instructions for the directory surface.
|
|
14
15
|
*
|
|
@@ -88,8 +89,11 @@ const CALL_STATUSES = ['RINGING', 'IN_PROGRESS', 'ENDED'];
|
|
|
88
89
|
const CALL_SORT_FIELDS = ['createdAt', 'startedAt', 'endedAt', 'duration', 'title', 'status'];
|
|
89
90
|
const SORT_DIRECTIONS = ['asc', 'desc'];
|
|
90
91
|
/** GET /v1/call rejects a non-UUID in `agentId` and in `properties[agent_id][eq]`. */
|
|
91
|
-
const
|
|
92
|
+
const UUID_SOURCE = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
|
|
93
|
+
const UUID_PATTERN = new RegExp(`^${UUID_SOURCE}$`);
|
|
92
94
|
const MAX_AGENT_IDS = 100;
|
|
95
|
+
/** The rule `optionalAgentIds` enforces, as a JSON Schema pattern: 1 to MAX_AGENT_IDS comma-separated UUIDs. */
|
|
96
|
+
export const AGENT_IDS_PATTERN = `^${UUID_SOURCE}(,${UUID_SOURCE}){0,${MAX_AGENT_IDS - 1}}$`;
|
|
93
97
|
const MAX_PROPERTY_FILTERS = 20;
|
|
94
98
|
const FLOW_TYPES = ['SCRIPTED', 'IMPROV', 'VOICEMAIL'];
|
|
95
99
|
const TRANSCRIPT_SOURCES = [
|
|
@@ -103,30 +107,39 @@ class ToolInputError extends Error {
|
|
|
103
107
|
this.name = 'ToolInputError';
|
|
104
108
|
}
|
|
105
109
|
}
|
|
110
|
+
// Every tool talks only to the Roark API, so openWorldHint is false, except
|
|
111
|
+
// run_simulation, which places phone calls to the agent under test.
|
|
106
112
|
const readAnnotations = (title) => ({
|
|
107
113
|
title,
|
|
108
114
|
readOnlyHint: true,
|
|
109
115
|
destructiveHint: false,
|
|
116
|
+
idempotentHint: true,
|
|
117
|
+
openWorldHint: false,
|
|
110
118
|
});
|
|
111
|
-
|
|
119
|
+
// Each write creates a new record, so repeating a call is not idempotent.
|
|
120
|
+
const writeAnnotations = (title, { openWorld = false } = {}) => ({
|
|
112
121
|
title,
|
|
113
122
|
readOnlyHint: false,
|
|
114
123
|
destructiveHint: true,
|
|
124
|
+
idempotentHint: false,
|
|
125
|
+
openWorldHint: openWorld,
|
|
115
126
|
});
|
|
116
127
|
const projectProperty = {
|
|
117
128
|
type: 'string',
|
|
118
129
|
description: 'Roark project id. Required when this connection is not already pinned to one project. list_projects returns the ids this credential can use.',
|
|
119
130
|
};
|
|
120
|
-
|
|
131
|
+
/** `after` and `limit`, with the page size the endpoint uses when `limit` is omitted. */
|
|
132
|
+
const paging = (defaultLimit) => ({
|
|
121
133
|
after: {
|
|
122
134
|
type: 'string',
|
|
123
|
-
description: '
|
|
135
|
+
description: 'Paging cursor: pass pagination.nextCursor from the previous response to get the next page. Omit for the first page.',
|
|
124
136
|
},
|
|
125
137
|
limit: {
|
|
126
138
|
type: 'number',
|
|
127
|
-
description:
|
|
139
|
+
description: `Page size: the most rows one response returns. When omitted, the API returns up to ${defaultLimit}.`,
|
|
128
140
|
},
|
|
129
|
-
};
|
|
141
|
+
});
|
|
142
|
+
const pagingProperties = paging(20);
|
|
130
143
|
const objectSchema = (properties, required) => ({
|
|
131
144
|
type: 'object',
|
|
132
145
|
properties,
|
|
@@ -331,9 +344,17 @@ const callListQuery = (args) => omitUndefined({
|
|
|
331
344
|
after: optionalString(args, 'after'),
|
|
332
345
|
limit: optionalLimit(args),
|
|
333
346
|
});
|
|
347
|
+
// Every tool declares an outputSchema, so the response body is also returned as
|
|
348
|
+
// structuredContent. The JSON text stays for clients that read only content.
|
|
334
349
|
const callApi = async (fn) => {
|
|
335
350
|
try {
|
|
336
|
-
|
|
351
|
+
const result = await fn();
|
|
352
|
+
// A tool with an outputSchema must return structuredContent, which is an object. The API
|
|
353
|
+
// always answers with { data, ... }; anything else is reported rather than sent unstructured.
|
|
354
|
+
if (!isRecord(result)) {
|
|
355
|
+
return asErrorResult(`Unexpected response from the Roark API: ${JSON.stringify(result) ?? 'empty'}`);
|
|
356
|
+
}
|
|
357
|
+
return { ...asTextContentResult(result), structuredContent: result };
|
|
337
358
|
}
|
|
338
359
|
catch (error) {
|
|
339
360
|
if (error instanceof ToolInputError || error instanceof APIError || error instanceof Error) {
|
|
@@ -343,22 +364,26 @@ const callApi = async (fn) => {
|
|
|
343
364
|
}
|
|
344
365
|
};
|
|
345
366
|
const handler = (fn) => async ({ reqContext, args, }) => callApi(() => fn(reqContext, args ?? {}));
|
|
346
|
-
const defineTool = (name, title, description, inputSchema, annotations, metadata, fn) => ({
|
|
367
|
+
const defineTool = (name, title, description, inputSchema, outputSchema, annotations, metadata, fn) => ({
|
|
347
368
|
metadata,
|
|
348
369
|
tool: {
|
|
349
370
|
name,
|
|
350
371
|
title,
|
|
351
372
|
description,
|
|
352
373
|
inputSchema,
|
|
374
|
+
outputSchema,
|
|
353
375
|
annotations,
|
|
354
376
|
},
|
|
355
377
|
handler: handler(fn),
|
|
356
378
|
});
|
|
357
379
|
const endpointSchema = {
|
|
358
380
|
type: 'object',
|
|
359
|
-
description: 'An agent endpoint
|
|
381
|
+
description: 'An agent endpoint the run tests.',
|
|
360
382
|
properties: {
|
|
361
|
-
id: {
|
|
383
|
+
id: {
|
|
384
|
+
type: 'string',
|
|
385
|
+
description: 'Agent endpoint id, from list_agent_endpoints or create_agent_endpoint.',
|
|
386
|
+
},
|
|
362
387
|
},
|
|
363
388
|
required: ['id'],
|
|
364
389
|
};
|
|
@@ -366,8 +391,11 @@ const metricRefSchema = {
|
|
|
366
391
|
type: 'object',
|
|
367
392
|
description: 'A metric to score, by id or by slug.',
|
|
368
393
|
properties: {
|
|
369
|
-
id: { type: 'string', description: 'Metric definition id.' },
|
|
370
|
-
slug: {
|
|
394
|
+
id: { type: 'string', description: 'Metric definition id, from list_metric_definitions.' },
|
|
395
|
+
slug: {
|
|
396
|
+
type: 'string',
|
|
397
|
+
description: 'Metric slug, from list_metric_definitions. Use instead of id.',
|
|
398
|
+
},
|
|
371
399
|
},
|
|
372
400
|
};
|
|
373
401
|
// A {{variable}} name to value map. The API takes string values only.
|
|
@@ -378,30 +406,50 @@ const stringMapSchema = (description) => ({
|
|
|
378
406
|
});
|
|
379
407
|
const flowAttachmentSchema = {
|
|
380
408
|
type: 'object',
|
|
381
|
-
description: 'A customer flow to include.
|
|
409
|
+
description: 'A customer flow to include. Name it by id or slug, and set happyPath, edgeCases, or both.',
|
|
382
410
|
properties: {
|
|
383
|
-
id: {
|
|
384
|
-
|
|
385
|
-
|
|
411
|
+
id: {
|
|
412
|
+
type: 'string',
|
|
413
|
+
description: 'Customer flow id, from list_customer_flows or create_customer_flow.',
|
|
414
|
+
},
|
|
415
|
+
slug: {
|
|
416
|
+
type: 'string',
|
|
417
|
+
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.',
|
|
418
|
+
},
|
|
419
|
+
happyPath: {
|
|
420
|
+
type: 'boolean',
|
|
421
|
+
description: "true runs the flow's happy path, the conversation going as intended. It is resolved when the run starts, so it follows the flow as it is then.",
|
|
422
|
+
},
|
|
386
423
|
edgeCases: {
|
|
387
424
|
type: ['string', 'array'],
|
|
388
|
-
description: 'The string ALL runs every edge case. An array runs only the listed edge cases, each named by id or slug.',
|
|
425
|
+
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.',
|
|
389
426
|
items: {
|
|
390
427
|
type: 'object',
|
|
391
428
|
properties: {
|
|
392
|
-
id: {
|
|
393
|
-
|
|
429
|
+
id: {
|
|
430
|
+
type: 'string',
|
|
431
|
+
description: "Edge case id, from the flow's edgeCases in list_customer_flows.",
|
|
432
|
+
},
|
|
433
|
+
slug: {
|
|
434
|
+
type: 'string',
|
|
435
|
+
description: 'Stable slug of an edge case Roark provides, matched within this flow. Used instead of id.',
|
|
436
|
+
},
|
|
394
437
|
personaOverrideId: {
|
|
395
438
|
type: 'string',
|
|
396
|
-
description: 'Persona id to
|
|
439
|
+
description: 'Persona id, from list_personas, to run this edge case as instead of its own persona.',
|
|
397
440
|
},
|
|
398
|
-
variables: stringMapSchema('Values for this edge case only.'),
|
|
441
|
+
variables: stringMapSchema('Values for the {{variables}} in this edge case only, as variable name to string value.'),
|
|
399
442
|
},
|
|
400
443
|
},
|
|
401
444
|
},
|
|
402
|
-
personaOverrideId: {
|
|
445
|
+
personaOverrideId: {
|
|
446
|
+
type: 'string',
|
|
447
|
+
description: 'Persona id, from list_personas, to run everything in this flow as instead of its own persona.',
|
|
448
|
+
},
|
|
403
449
|
},
|
|
404
450
|
};
|
|
451
|
+
const callIdDescription = 'Roark call id, from list_calls.';
|
|
452
|
+
const directionDescription = 'INBOUND: the simulated caller phones the agent. OUTBOUND: the agent places the call to the simulated caller.';
|
|
405
453
|
const buildRunBody = (args) => {
|
|
406
454
|
const hasPlanId = args['planId'] !== undefined;
|
|
407
455
|
const hasPlan = args['plan'] !== undefined;
|
|
@@ -555,50 +603,63 @@ const buildEndpointBody = (args) => {
|
|
|
555
603
|
*/
|
|
556
604
|
export function directoryTools() {
|
|
557
605
|
return [
|
|
558
|
-
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()),
|
|
559
|
-
defineTool('list_agents', 'List agents', 'Lists voice and chat agents in a Roark project. Returns each agent id, name, custom id, and description.', objectSchema({
|
|
606
|
+
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({}), directoryOutputSchemas.listProjects, readAnnotations('List projects'), readMeta('project', '/v1/projects'), async (reqContext) => reqContext.client.project.list()),
|
|
607
|
+
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({
|
|
560
608
|
project: projectProperty,
|
|
561
|
-
searchText: {
|
|
609
|
+
searchText: {
|
|
610
|
+
type: 'string',
|
|
611
|
+
description: 'Text to match against agent names and descriptions. When omitted, every agent is listed.',
|
|
612
|
+
},
|
|
562
613
|
...pagingProperties,
|
|
563
|
-
}), readAnnotations('List agents'), readMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.list(omitUndefined({
|
|
614
|
+
}), directoryOutputSchemas.listAgents, readAnnotations('List agents'), readMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.list(omitUndefined({
|
|
564
615
|
searchText: optionalString(args, 'searchText'),
|
|
565
616
|
after: optionalString(args, 'after'),
|
|
566
617
|
limit: optionalLimit(args),
|
|
567
618
|
}))),
|
|
568
|
-
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({
|
|
619
|
+
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({
|
|
569
620
|
project: projectProperty,
|
|
570
|
-
agentId: {
|
|
571
|
-
|
|
621
|
+
agentId: {
|
|
622
|
+
type: 'string',
|
|
623
|
+
description: "Agent id, from list_agents, to list only that agent's endpoints. When omitted, endpoints for every agent are listed.",
|
|
624
|
+
},
|
|
625
|
+
searchText: {
|
|
626
|
+
type: 'string',
|
|
627
|
+
description: 'Text to match against the endpoint address, such as a phone number, or its environment name.',
|
|
628
|
+
},
|
|
572
629
|
...pagingProperties,
|
|
573
|
-
}), readAnnotations('List agent endpoints'), readMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.list(omitUndefined({
|
|
630
|
+
}), directoryOutputSchemas.listAgentEndpoints, readAnnotations('List agent endpoints'), readMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.list(omitUndefined({
|
|
574
631
|
agentId: optionalString(args, 'agentId'),
|
|
575
632
|
searchText: optionalString(args, 'searchText'),
|
|
576
633
|
after: optionalString(args, 'after'),
|
|
577
634
|
limit: optionalLimit(args),
|
|
578
635
|
}))),
|
|
579
|
-
defineTool('list_calls', 'List calls', 'Lists calls in a Roark project,
|
|
580
|
-
'agentId is one agent UUID, or up to 100 comma-separated UUIDs with no spaces. ' +
|
|
581
|
-
'properties filters with one operator per name: eq is a case-insensitive exact match, and exists checks whether the property is set. ' +
|
|
582
|
-
"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. " +
|
|
583
|
-
'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({
|
|
636
|
+
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.', objectSchema({
|
|
584
637
|
project: projectProperty,
|
|
585
|
-
searchText: {
|
|
586
|
-
|
|
638
|
+
searchText: {
|
|
639
|
+
type: 'string',
|
|
640
|
+
description: 'Text to match against call titles, summaries, and transcripts.',
|
|
641
|
+
},
|
|
642
|
+
status: {
|
|
643
|
+
type: 'string',
|
|
644
|
+
enum: [...CALL_STATUSES],
|
|
645
|
+
description: 'Where the calls are in their lifecycle: RINGING has not connected yet, IN_PROGRESS is live, ENDED has finished. When omitted, calls in every state are listed.',
|
|
646
|
+
},
|
|
587
647
|
agentId: {
|
|
588
648
|
type: 'string',
|
|
589
|
-
|
|
649
|
+
pattern: AGENT_IDS_PATTERN,
|
|
650
|
+
description: 'Agents whose calls to list, by id from list_agents. A call matches when any of them took part. Separate several ids with commas.',
|
|
590
651
|
},
|
|
591
652
|
properties: {
|
|
592
653
|
type: 'object',
|
|
593
|
-
description: "
|
|
654
|
+
description: "Call property filters, keyed by property name, at most 20. Each entry sets eq or exists, not both. 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 set on the call.",
|
|
594
655
|
additionalProperties: {
|
|
595
656
|
type: 'object',
|
|
596
|
-
description: '
|
|
657
|
+
description: 'One filter: eq or exists.',
|
|
597
658
|
properties: {
|
|
598
|
-
eq: { type: 'string', description: '
|
|
659
|
+
eq: { type: 'string', description: 'Value the property must equal, ignoring case.' },
|
|
599
660
|
exists: {
|
|
600
661
|
type: 'boolean',
|
|
601
|
-
description: 'true
|
|
662
|
+
description: 'true lists calls that have the property set. false lists calls that do not.',
|
|
602
663
|
},
|
|
603
664
|
},
|
|
604
665
|
},
|
|
@@ -606,35 +667,37 @@ export function directoryTools() {
|
|
|
606
667
|
sortBy: {
|
|
607
668
|
type: 'string',
|
|
608
669
|
enum: [...CALL_SORT_FIELDS],
|
|
609
|
-
|
|
670
|
+
default: 'createdAt',
|
|
671
|
+
description: 'What orders the results: when the call was created, started, or ended, how long it lasted, its title, or its status.',
|
|
610
672
|
},
|
|
611
673
|
sortDirection: {
|
|
612
674
|
type: 'string',
|
|
613
675
|
enum: [...SORT_DIRECTIONS],
|
|
614
|
-
|
|
676
|
+
default: 'desc',
|
|
677
|
+
description: 'asc puts the earliest or smallest first, desc the latest or largest.',
|
|
615
678
|
},
|
|
616
679
|
simulationRunPlanJobId: {
|
|
617
680
|
type: 'string',
|
|
618
|
-
description: '
|
|
681
|
+
description: 'Simulation run id, the simulationRunPlanJobId that run_simulation returns, to list only the calls that run placed.',
|
|
619
682
|
},
|
|
620
683
|
...pagingProperties,
|
|
621
|
-
}), readAnnotations('List calls'), readMeta('call', '/v1/call'), async (reqContext, args) => scopedClient(reqContext, args).call.list(callListQuery(args))),
|
|
684
|
+
}), directoryOutputSchemas.listCalls, readAnnotations('List calls'), readMeta('call', '/v1/call'), async (reqContext, args) => scopedClient(reqContext, args).call.list(callListQuery(args))),
|
|
622
685
|
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({
|
|
623
686
|
project: projectProperty,
|
|
624
|
-
callId: { type: 'string', description:
|
|
625
|
-
}, ['callId']), readAnnotations('Get call'), readMeta('call', '/v1/call/{callId}'), async (reqContext, args) => scopedClient(reqContext, args).call.getByID(requireString(args, 'callId'))),
|
|
626
|
-
defineTool('get_call_transcript', 'Get call transcript', 'Returns the transcript of one call in a Roark project:
|
|
687
|
+
callId: { type: 'string', description: callIdDescription },
|
|
688
|
+
}, ['callId']), directoryOutputSchemas.getCall, readAnnotations('Get call'), readMeta('call', '/v1/call/{callId}'), async (reqContext, args) => scopedClient(reqContext, args).call.getByID(requireString(args, 'callId'))),
|
|
689
|
+
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({
|
|
627
690
|
project: projectProperty,
|
|
628
|
-
callId: { type: 'string', description:
|
|
691
|
+
callId: { type: 'string', description: callIdDescription },
|
|
629
692
|
source: {
|
|
630
693
|
type: 'string',
|
|
631
694
|
enum: [...TRANSCRIPT_SOURCES],
|
|
632
|
-
description: '
|
|
695
|
+
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.',
|
|
633
696
|
},
|
|
634
|
-
}, ['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) }))),
|
|
635
|
-
defineTool('list_call_metrics', 'List call metrics', 'Returns the metric scores recorded for one call in a Roark project
|
|
697
|
+
}, ['callId']), 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) }))),
|
|
698
|
+
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({
|
|
636
699
|
project: projectProperty,
|
|
637
|
-
callId: { type: 'string', description:
|
|
700
|
+
callId: { type: 'string', description: callIdDescription },
|
|
638
701
|
flatten: {
|
|
639
702
|
type: 'string',
|
|
640
703
|
description: 'true returns one row per score. Any other value, or omitting it, groups scores by metric.',
|
|
@@ -642,13 +705,13 @@ export function directoryTools() {
|
|
|
642
705
|
status: {
|
|
643
706
|
type: 'string',
|
|
644
707
|
enum: ['success', 'all'],
|
|
645
|
-
description: 'success returns computed scores. all also returns
|
|
708
|
+
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.',
|
|
646
709
|
},
|
|
647
|
-
}, ['callId']), readAnnotations('List call metrics'), readMeta('call', '/v1/call/{callId}/metrics'), async (reqContext, args) => scopedClient(reqContext, args).call.listMetrics(requireString(args, 'callId'), omitUndefined({
|
|
710
|
+
}, ['callId']), directoryOutputSchemas.listCallMetrics, readAnnotations('List call metrics'), readMeta('call', '/v1/call/{callId}/metrics'), async (reqContext, args) => scopedClient(reqContext, args).call.listMetrics(requireString(args, 'callId'), omitUndefined({
|
|
648
711
|
flatten: optionalString(args, 'flatten'),
|
|
649
712
|
status: optionalEnum(args, 'status', ['success', 'all']),
|
|
650
713
|
}))),
|
|
651
|
-
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, ...
|
|
714
|
+
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) }), 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) }))),
|
|
652
715
|
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({
|
|
653
716
|
project: projectProperty,
|
|
654
717
|
jobId: {
|
|
@@ -659,102 +722,140 @@ export function directoryTools() {
|
|
|
659
722
|
type: 'string',
|
|
660
723
|
description: 'Another simulation run id to compare against. When omitted, the API compares with the previous settled run of the same plan.',
|
|
661
724
|
},
|
|
662
|
-
}, ['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') }))),
|
|
663
|
-
defineTool('list_personas', 'List personas', 'Lists simulated caller personas in a Roark project. Returns each persona id, name, language, accent, and gender.', objectSchema({
|
|
725
|
+
}, ['jobId']), 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') }))),
|
|
726
|
+
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({
|
|
664
727
|
project: projectProperty,
|
|
665
|
-
searchText: {
|
|
728
|
+
searchText: {
|
|
729
|
+
type: 'string',
|
|
730
|
+
description: 'Text to match against persona names and descriptions. When omitted, every persona is listed.',
|
|
731
|
+
},
|
|
666
732
|
...pagingProperties,
|
|
667
|
-
}), readAnnotations('List personas'), readMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.list(omitUndefined({
|
|
733
|
+
}), directoryOutputSchemas.listPersonas, readAnnotations('List personas'), readMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.list(omitUndefined({
|
|
668
734
|
searchText: optionalString(args, 'searchText'),
|
|
669
735
|
after: optionalString(args, 'after'),
|
|
670
736
|
limit: optionalLimit(args),
|
|
671
737
|
}))),
|
|
672
|
-
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
|
|
738
|
+
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({
|
|
673
739
|
project: projectProperty,
|
|
674
|
-
searchText: {
|
|
675
|
-
|
|
740
|
+
searchText: {
|
|
741
|
+
type: 'string',
|
|
742
|
+
description: 'Text to match against flow titles. When omitted, flows are not filtered by title.',
|
|
743
|
+
},
|
|
744
|
+
type: {
|
|
745
|
+
type: 'string',
|
|
746
|
+
enum: [...FLOW_TYPES],
|
|
747
|
+
description: 'How the simulated caller behaves. IMPROV gives the caller a goal to improvise around, SCRIPTED follows an exact step graph, and VOICEMAIL plays a voicemail greeting to test the message the agent leaves. When omitted, flows of every type are listed.',
|
|
748
|
+
},
|
|
676
749
|
includeSystem: {
|
|
677
750
|
type: 'string',
|
|
678
751
|
enum: ['true', 'false'],
|
|
679
|
-
description: 'true
|
|
752
|
+
description: 'true also lists flows Roark provides. false, or omitting it, lists only flows made in the project.',
|
|
680
753
|
},
|
|
681
754
|
...pagingProperties,
|
|
682
|
-
}), readAnnotations('List customer flows'), readMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.list(omitUndefined({
|
|
755
|
+
}), directoryOutputSchemas.listCustomerFlows, readAnnotations('List customer flows'), readMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.list(omitUndefined({
|
|
683
756
|
searchText: optionalString(args, 'searchText'),
|
|
684
757
|
type: optionalEnum(args, 'type', FLOW_TYPES),
|
|
685
758
|
includeSystem: optionalEnum(args, 'includeSystem', ['true', 'false']),
|
|
686
759
|
after: optionalString(args, 'after'),
|
|
687
760
|
limit: optionalLimit(args),
|
|
688
761
|
}))),
|
|
689
|
-
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) }))),
|
|
690
|
-
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({
|
|
762
|
+
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 }), 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) }))),
|
|
763
|
+
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({
|
|
691
764
|
project: projectProperty,
|
|
692
|
-
name: {
|
|
765
|
+
name: {
|
|
766
|
+
type: 'string',
|
|
767
|
+
description: 'Display name for the agent, shown in Roark and returned by list_agents.',
|
|
768
|
+
},
|
|
693
769
|
description: { type: 'string', description: 'What the agent does.' },
|
|
694
|
-
customId: {
|
|
695
|
-
|
|
770
|
+
customId: {
|
|
771
|
+
type: 'string',
|
|
772
|
+
description: 'Your own identifier for the agent, such as its id in your platform. Unique in the project.',
|
|
773
|
+
},
|
|
774
|
+
}, ['name']), directoryOutputSchemas.createAgent, writeAnnotations('Create agent'), writeMeta('agent', '/v1/agent'), async (reqContext, args) => scopedClient(reqContext, args).agent.create({
|
|
696
775
|
name: requireString(args, 'name'),
|
|
697
776
|
...omitUndefined({
|
|
698
777
|
description: optionalString(args, 'description'),
|
|
699
778
|
customId: optionalString(args, 'customId'),
|
|
700
779
|
}),
|
|
701
780
|
})),
|
|
702
|
-
defineTool('create_agent_endpoint', 'Create agent endpoint', 'Creates a phone endpoint for an agent in a Roark project.
|
|
781
|
+
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({
|
|
703
782
|
project: projectProperty,
|
|
704
783
|
agentId: { type: 'string', description: 'Agent id from list_agents or create_agent.' },
|
|
705
|
-
value: {
|
|
784
|
+
value: {
|
|
785
|
+
type: 'string',
|
|
786
|
+
description: "The agent's phone number in E.164 form, such as +14155550123.",
|
|
787
|
+
},
|
|
706
788
|
direction: {
|
|
707
789
|
type: 'string',
|
|
708
790
|
enum: [...ENDPOINT_DIRECTIONS],
|
|
709
|
-
description: 'Which way calls
|
|
791
|
+
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.',
|
|
792
|
+
},
|
|
793
|
+
environment: {
|
|
794
|
+
type: 'string',
|
|
795
|
+
description: 'Environment label for the endpoint, such as production or staging. When omitted, production.',
|
|
710
796
|
},
|
|
711
|
-
environment: { type: 'string', description: 'Environment name. The API default is production.' },
|
|
712
797
|
outboundDialType: {
|
|
713
798
|
type: 'string',
|
|
714
799
|
enum: ['NONE', 'HTTP_REQUEST'],
|
|
715
|
-
description: 'How Roark
|
|
800
|
+
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.',
|
|
716
801
|
},
|
|
717
802
|
outboundDialHttpRequestDefinitionId: {
|
|
718
803
|
type: 'string',
|
|
719
|
-
description: 'HTTP request definition
|
|
804
|
+
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.',
|
|
720
805
|
},
|
|
721
|
-
}, ['agentId', 'value', 'direction']), writeAnnotations('Create agent endpoint'), writeMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.create(buildEndpointBody(args))),
|
|
722
|
-
defineTool('create_persona', 'Create persona', 'Creates a simulated caller persona in a Roark project.
|
|
806
|
+
}, ['agentId', 'value', 'direction']), directoryOutputSchemas.createAgentEndpoint, writeAnnotations('Create agent endpoint'), writeMeta('agentEndpoint', '/v1/agent/endpoint'), async (reqContext, args) => scopedClient(reqContext, args).agentEndpoint.create(buildEndpointBody(args))),
|
|
807
|
+
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. Returns the created persona; pass its id as personaOverrideId to create_customer_flow to use it.', objectSchema({
|
|
723
808
|
project: projectProperty,
|
|
724
809
|
name: { type: 'string', description: 'Name the caller uses in conversation.' },
|
|
725
|
-
language: {
|
|
726
|
-
|
|
810
|
+
language: {
|
|
811
|
+
type: 'string',
|
|
812
|
+
enum: [...LANGUAGES],
|
|
813
|
+
description: 'The language the simulated caller speaks, as an ISO 639-1 code: EN is English, ES Spanish.',
|
|
814
|
+
},
|
|
815
|
+
accent: { type: 'string', enum: [...ACCENTS], description: 'Accent the caller speaks with.' },
|
|
727
816
|
gender: { type: 'string', enum: [...GENDERS], description: 'Gender the persona is voiced with.' },
|
|
728
817
|
age: {
|
|
729
818
|
type: 'string',
|
|
730
819
|
enum: [...AGES],
|
|
731
|
-
|
|
820
|
+
default: 'ADULT',
|
|
821
|
+
description: 'How old the caller sounds.',
|
|
732
822
|
},
|
|
733
823
|
baseEmotion: {
|
|
734
824
|
type: 'string',
|
|
735
825
|
enum: [...EMOTIONS],
|
|
736
|
-
|
|
826
|
+
default: 'NEUTRAL',
|
|
827
|
+
description: 'The emotional state the simulated caller brings to the call.',
|
|
737
828
|
},
|
|
738
829
|
backstoryPrompt: {
|
|
739
830
|
type: 'string',
|
|
740
831
|
description: 'Background and behavior the simulated caller plays.',
|
|
741
832
|
},
|
|
742
|
-
description: {
|
|
743
|
-
|
|
744
|
-
|
|
833
|
+
description: {
|
|
834
|
+
type: 'string',
|
|
835
|
+
description: 'Short summary of the persona, to tell it apart from others in the project.',
|
|
836
|
+
},
|
|
837
|
+
}, ['name', 'language', 'accent', 'gender']), directoryOutputSchemas.createPersona, writeAnnotations('Create persona'), writeMeta('simulationPersona', '/v1/persona'), async (reqContext, args) => scopedClient(reqContext, args).simulationPersona.create(buildPersonaBody(args))),
|
|
838
|
+
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({
|
|
745
839
|
project: projectProperty,
|
|
746
|
-
title: {
|
|
840
|
+
title: {
|
|
841
|
+
type: 'string',
|
|
842
|
+
description: 'Name for the flow, shown in Roark and returned by list_customer_flows.',
|
|
843
|
+
},
|
|
747
844
|
description: { type: 'string', description: 'What the conversation covers.' },
|
|
748
845
|
agentIds: {
|
|
749
846
|
type: 'array',
|
|
750
847
|
items: { type: 'string' },
|
|
751
|
-
|
|
848
|
+
minItems: 1,
|
|
849
|
+
description: 'Ids of the agents this flow tests, from list_agents or create_agent.',
|
|
752
850
|
},
|
|
753
851
|
happyPath: {
|
|
754
852
|
type: 'object',
|
|
755
853
|
description: 'The way the conversation is meant to go.',
|
|
756
854
|
properties: {
|
|
757
|
-
title: {
|
|
855
|
+
title: {
|
|
856
|
+
type: 'string',
|
|
857
|
+
description: 'Name for the happy path, the run where the conversation goes as intended.',
|
|
858
|
+
},
|
|
758
859
|
prompt: { type: 'string', description: 'What the simulated caller is trying to do.' },
|
|
759
860
|
personaOverrideId: {
|
|
760
861
|
type: 'string',
|
|
@@ -773,72 +874,109 @@ export function directoryTools() {
|
|
|
773
874
|
items: {
|
|
774
875
|
type: 'object',
|
|
775
876
|
properties: {
|
|
776
|
-
title: { type: 'string' },
|
|
777
|
-
prompt: {
|
|
778
|
-
|
|
779
|
-
|
|
877
|
+
title: { type: 'string', description: 'Name for this edge case.' },
|
|
878
|
+
prompt: {
|
|
879
|
+
type: 'string',
|
|
880
|
+
description: 'What the simulated caller is trying to do in this edge case.',
|
|
881
|
+
},
|
|
882
|
+
personaOverrideId: {
|
|
883
|
+
type: 'string',
|
|
884
|
+
description: 'Persona id from list_personas or create_persona. When omitted, the happy path persona.',
|
|
885
|
+
},
|
|
886
|
+
environmentId: {
|
|
887
|
+
type: 'string',
|
|
888
|
+
description: 'Environment id from list_simulation_environments. When omitted, the happy path environment.',
|
|
889
|
+
},
|
|
780
890
|
},
|
|
781
891
|
required: ['title'],
|
|
782
892
|
},
|
|
783
893
|
},
|
|
784
|
-
}, ['title', 'agentIds', 'happyPath']), writeAnnotations('Create customer flow'), writeMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.create(buildFlowBody(args))),
|
|
785
|
-
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({
|
|
894
|
+
}, ['title', 'agentIds', 'happyPath']), directoryOutputSchemas.createCustomerFlow, writeAnnotations('Create customer flow'), writeMeta('customerFlow', '/v1/customer-flow'), async (reqContext, args) => scopedClient(reqContext, args).customerFlow.create(buildFlowBody(args))),
|
|
895
|
+
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({
|
|
786
896
|
project: projectProperty,
|
|
787
|
-
planId: {
|
|
897
|
+
planId: {
|
|
898
|
+
type: 'string',
|
|
899
|
+
description: 'A saved run plan to run again, with its own endpoints, flows, and metrics: the simulationRunPlanId of a run started with saveAsPlan true.',
|
|
900
|
+
},
|
|
788
901
|
plan: {
|
|
789
902
|
type: 'object',
|
|
790
903
|
description: 'Inline plan to run once. Requires agentEndpoints, direction, and maxSimulationDurationSeconds.',
|
|
791
904
|
properties: {
|
|
792
|
-
name: {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
905
|
+
name: {
|
|
906
|
+
type: 'string',
|
|
907
|
+
description: 'Name for the plan. When omitted, one is generated from the date. Needed for saveAsPlan.',
|
|
908
|
+
},
|
|
909
|
+
description: { type: 'string', description: 'Note on what the plan tests.' },
|
|
910
|
+
direction: { type: 'string', enum: [...DIRECTIONS], description: directionDescription },
|
|
911
|
+
agentEndpoints: {
|
|
912
|
+
type: 'array',
|
|
913
|
+
items: endpointSchema,
|
|
914
|
+
description: 'The agent endpoints the run tests.',
|
|
915
|
+
},
|
|
796
916
|
metrics: {
|
|
797
917
|
type: 'array',
|
|
798
918
|
items: metricRefSchema,
|
|
799
919
|
description: 'Metrics to score, by id or slug.',
|
|
800
920
|
},
|
|
801
|
-
flows: {
|
|
802
|
-
|
|
921
|
+
flows: {
|
|
922
|
+
type: 'array',
|
|
923
|
+
items: flowAttachmentSchema,
|
|
924
|
+
description: 'Customer flows to run, and which of their happy paths and edge cases.',
|
|
925
|
+
},
|
|
926
|
+
maxSimulationDurationSeconds: {
|
|
927
|
+
type: 'number',
|
|
928
|
+
description: 'Longest one simulated call may last, in seconds.',
|
|
929
|
+
},
|
|
803
930
|
iterationCount: {
|
|
804
931
|
type: 'number',
|
|
805
|
-
description: '
|
|
932
|
+
description: 'Times each test case runs. When omitted, 1.',
|
|
806
933
|
},
|
|
807
934
|
maxConcurrentJobs: {
|
|
808
935
|
type: 'number',
|
|
809
|
-
description: 'How many calls run at once.
|
|
936
|
+
description: 'How many calls run at once. When omitted, 5.',
|
|
810
937
|
},
|
|
811
938
|
executionMode: {
|
|
812
939
|
type: 'string',
|
|
813
940
|
enum: ['PARALLEL', 'SEQUENTIAL_SAME_RUN_PLAN', 'SEQUENTIAL_PROJECT'],
|
|
941
|
+
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.',
|
|
814
942
|
},
|
|
815
943
|
},
|
|
816
944
|
required: ['agentEndpoints', 'direction', 'maxSimulationDurationSeconds'],
|
|
817
945
|
},
|
|
818
946
|
template: {
|
|
819
947
|
type: 'string',
|
|
820
|
-
description: '
|
|
948
|
+
description: 'Name of a built-in Roark template, such as health-check. GET /v1/simulation/template lists them.',
|
|
821
949
|
},
|
|
822
950
|
agentEndpoints: {
|
|
823
951
|
type: 'array',
|
|
824
952
|
items: endpointSchema,
|
|
825
|
-
description: '
|
|
953
|
+
description: 'For a template run: the agent endpoints it tests. A template run fails without it.',
|
|
954
|
+
},
|
|
955
|
+
direction: {
|
|
956
|
+
type: 'string',
|
|
957
|
+
enum: [...DIRECTIONS],
|
|
958
|
+
description: `For a template run, where it is required. ${directionDescription}`,
|
|
826
959
|
},
|
|
827
|
-
direction: { type: 'string', enum: [...DIRECTIONS], description: 'Required with template.' },
|
|
828
960
|
flows: {
|
|
829
961
|
type: 'array',
|
|
830
962
|
items: flowAttachmentSchema,
|
|
831
|
-
description: '
|
|
963
|
+
description: 'For a template run: the flows to run. Needed when the template has no flows of its own; otherwise they replace its flows.',
|
|
964
|
+
},
|
|
965
|
+
iterationCount: {
|
|
966
|
+
type: 'number',
|
|
967
|
+
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.",
|
|
968
|
+
},
|
|
969
|
+
maxSimulationDurationSeconds: {
|
|
970
|
+
type: 'number',
|
|
971
|
+
description: "For a template run: longest one simulated call may last, in seconds. When omitted, the template's default.",
|
|
832
972
|
},
|
|
833
|
-
iterationCount: { type: 'number' },
|
|
834
|
-
maxSimulationDurationSeconds: { type: 'number' },
|
|
835
973
|
saveAsPlan: {
|
|
836
974
|
type: 'boolean',
|
|
837
975
|
description: 'When plan is set, true keeps the plan so it can be run again by planId. Requires plan.name.',
|
|
838
976
|
},
|
|
839
977
|
variables: {
|
|
840
978
|
type: ['object', 'array'],
|
|
841
|
-
description: '
|
|
979
|
+
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).',
|
|
842
980
|
additionalProperties: { type: 'string' },
|
|
843
981
|
items: {
|
|
844
982
|
type: 'object',
|
|
@@ -848,14 +986,14 @@ export function directoryTools() {
|
|
|
848
986
|
happyPath: { type: 'boolean', description: "Narrow to the flow's happy path." },
|
|
849
987
|
scenarioId: {
|
|
850
988
|
type: 'string',
|
|
851
|
-
description: 'Scenario id the values apply to,
|
|
989
|
+
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.',
|
|
852
990
|
},
|
|
853
|
-
variables: stringMapSchema('The values to apply.'),
|
|
991
|
+
variables: stringMapSchema('The values to apply, as variable name to string value.'),
|
|
854
992
|
},
|
|
855
993
|
required: ['variables'],
|
|
856
994
|
},
|
|
857
995
|
},
|
|
858
|
-
}), writeAnnotations('Run simulation'), writeMeta('simulation', '/v1/simulation/run'), async (reqContext, args) => scopedClient(reqContext, args).simulation.run(buildRunBody(args))),
|
|
996
|
+
}), directoryOutputSchemas.runSimulation, writeAnnotations('Run simulation', { openWorld: true }), writeMeta('simulation', '/v1/simulation/run'), async (reqContext, args) => scopedClient(reqContext, args).simulation.run(buildRunBody(args))),
|
|
859
997
|
];
|
|
860
998
|
}
|
|
861
999
|
//# sourceMappingURL=directory-tools.mjs.map
|