@scout9/app 1.0.0-alpha.0.4.8 → 1.0.0-alpha.0.5.0

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/src/exports.js CHANGED
@@ -2,6 +2,7 @@ import { Scout9Platform } from './platform.js';
2
2
  import { EventResponse } from './runtime/index.js';
3
3
 
4
4
  export { EventResponse } from './runtime/index.js';
5
+ export { ProgressLogger } from './utils/logger.js';
5
6
 
6
7
  export * from './testing-tools/index.js';
7
8
  export * from './runtime/client/index.js';
package/src/public.d.ts CHANGED
@@ -437,8 +437,6 @@ export type Customer = {
437
437
  state?: (string | null) | undefined;
438
438
  town?: (string | null) | undefined;
439
439
  joined?: (string | null) | undefined;
440
- stripe?: (string | null) | undefined;
441
- stripeDev?: (string | null) | undefined;
442
440
  } & {[key: string]: CustomerValue};
443
441
 
444
442
  export type EntityDefinition = {
@@ -571,6 +569,10 @@ export type WorkflowConfiguration = {
571
569
  entity: string;
572
570
  };
573
571
 
572
+ export type CommandConfiguration = {
573
+ entity: string;
574
+ path: string;
575
+ };
574
576
 
575
577
  export type Scout9ProjectConfig = {
576
578
  tag?: string | undefined;
@@ -618,6 +620,7 @@ export type Scout9ProjectBuildConfig = Scout9ProjectConfig & {
618
620
  persona?: AgentsConfiguration;
619
621
  entities: EntityRootProjectConfiguration[];
620
622
  workflows: WorkflowConfiguration[];
623
+ commands: CommandConfiguration[];
621
624
  };
622
625
 
623
626
  export type WorkflowEvent = {
@@ -44,7 +44,8 @@ export async function did(prompt) {
44
44
  const {value} = (await (new Scout9Api(new Configuration({apiKey: process.env.SCOUT9_API_KEY}))).did(processPayload({
45
45
  prompt,
46
46
  convoId,
47
- event
47
+ event,
48
+ cache: !event.context?.__no_cache
48
49
  }))
49
50
  .then(handleAxiosResponse)
50
51
  .catch((err) => {
@@ -76,7 +77,8 @@ export async function does(prompt, relation = 'customer') {
76
77
  prompt,
77
78
  convoId,
78
79
  role: relation,
79
- event
80
+ event,
81
+ cache: !event.context?.__no_cache
80
82
  })
81
83
  )
82
84
  .then(handleAxiosResponse)
@@ -122,7 +124,8 @@ export async function context(prompt, examples) {
122
124
  prompt,
123
125
  examples,
124
126
  convoId,
125
- event
127
+ event,
128
+ cache: !event.context?.__no_cache
126
129
  }))
127
130
  .then(handleAxiosResponse)
128
131
  .catch((err) => {
@@ -3,6 +3,7 @@ import { zId } from './utils.js';
3
3
 
4
4
  export const ConversationContext = z.record(
5
5
  z.union([
6
+ z.any(),
6
7
  z.string(),
7
8
  z.number(),
8
9
  z.boolean(),
@@ -117,6 +117,13 @@ export const WorkflowConfigurationSchema = z.object({
117
117
 
118
118
  export const WorkflowsConfigurationSchema = z.array(WorkflowConfigurationSchema);
119
119
 
120
+ export const CommandSchema = z.object({
121
+ path: z.string(),
122
+ entity: zId('Command ID', z.string())
123
+ });
124
+
125
+ export const CommandsSchema = z.array(CommandSchema);
126
+
120
127
  export const IntentWorkflowEventSchema = z.object({
121
128
  current: z.string().nullable(),
122
129
  flow: z.array(z.string()),