@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/dist/{dev-332ccb5a.cjs → dev-5c6f5d76.cjs} +323 -153
- package/dist/{index-2d62ac36.cjs → index-45f6ee5e.cjs} +16 -10
- package/dist/index.cjs +5 -4
- package/dist/{macros-e4105c56.cjs → macros-2f21c706.cjs} +8 -1
- package/dist/{multipart-parser-948d98ce.cjs → multipart-parser-bac8efc8.cjs} +4 -4
- package/dist/schemas.cjs +3 -1
- package/dist/{spirits-5c9243a1.cjs → spirits-2ab4d673.cjs} +14 -2
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +3 -3
- package/package.json +3 -3
- package/src/core/config/commands.js +41 -0
- package/src/core/config/index.js +4 -1
- package/src/core/templates/app.js +466 -76
- package/src/exports.js +1 -0
- package/src/public.d.ts +5 -2
- package/src/runtime/macros/builder.js +6 -3
- package/src/runtime/schemas/conversation.js +1 -0
- package/src/runtime/schemas/workflow.js +7 -0
- package/src/testing-tools/dev.js +371 -360
- package/src/testing-tools/spirits.js +2 -2
- package/types/index.d.ts +625 -618
- package/types/index.d.ts.map +4 -1
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) => {
|
|
@@ -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()),
|