@scout9/app 1.0.0-alpha.0.1.93 → 1.0.0-alpha.0.1.95

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/index.cjs CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-83755281.cjs");
5
+ var index = require("./index-ea1273a0.cjs");
6
+ var dev = require("./dev-ecdbe765.cjs");
6
7
  var spirits = require("./spirits-32395ac4.cjs");
7
- require('node:readline');
8
8
  require('fs');
9
9
  require('events');
10
10
  require('path');
@@ -14,9 +14,6 @@ require('util');
14
14
  require('assert');
15
15
  require('buffer');
16
16
  require('zlib');
17
- require('url');
18
- require('fs/promises');
19
- require('string_decoder');
20
17
  require('node:fs');
21
18
  require('node:fs/promises');
22
19
  require('node:path');
@@ -26,172 +23,77 @@ require('node:https');
26
23
  require('node:zlib');
27
24
  require('node:stream');
28
25
  require('node:buffer');
26
+ require('string_decoder');
27
+ require('node:util');
28
+ require('node:net');
29
+ require('node:readline');
30
+ require('node:os');
31
+ require('fs/promises');
29
32
  require('http');
30
33
  require('https');
34
+ require('url');
31
35
  require('tty');
32
36
  require('os');
33
37
  require('crypto');
34
38
  require('node:process');
35
- require('node:os');
36
- require('node:util');
37
- require('node:net');
38
- require('node:vm');
39
-
40
- var MacroGlobals = /*#__PURE__*/function () {
41
- function MacroGlobals() {
42
- spirits._classCallCheck(this, MacroGlobals);
43
- }
44
- spirits._createClass(MacroGlobals, null, [{
45
- key: "$convo",
46
- value: function $convo() {
47
- var _globalThis$SCOUT;
48
- var $convo = globalThis === null || globalThis === void 0 || (_globalThis$SCOUT = globalThis.SCOUT9) === null || _globalThis$SCOUT === void 0 ? void 0 : _globalThis$SCOUT.$convo;
49
- if (!$convo) {
50
- throw new Error("$convo not found in runtime context, ".concat(spirits._classStaticPrivateFieldSpecGet(MacroGlobals, MacroGlobals, _hint)));
51
- }
52
- return $convo;
53
- }
54
- }]);
55
- return MacroGlobals;
56
- }();
57
- var _hint = {
58
- writable: true,
59
- value: "make sure the context is properly instantiated before running workflow."
60
- };
61
-
62
- function handleAxiosResponse(res) {
63
- if (res.status === 200) {
64
- return res.data;
65
- } else {
66
- throw new Error("".concat(res.status, " ").concat(res.statusText));
67
- }
68
- }
69
39
 
70
- /**
71
- * The `did` macro takes a given prompt and infers a binary `true` or `false` result in relation to the prompt's subject actor and the prompt's inquiry.
72
- * @param {string} prompt
73
- * @return {Promise<boolean>}
74
- */
75
- function did(_x) {
76
- return _did.apply(this, arguments);
77
- }
78
40
 
79
- /**
80
- * The `context` macro, similar to the `did` macro, takes a natural statement and checks the entire conversation state and extracts or infers a metadata composition result.
81
- * @param {string} prompt
82
- * @param {import('@scout9/admin').CaptureContextRequestExamples} [examples]
83
- * @return {Promise<import('@scout9/admin').CaptureContext200Response>}
84
- */
85
- function _did() {
86
- _did = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee(prompt) {
87
- var convoId, _yield$Scout9Api$did$, value;
88
- return spirits._regeneratorRuntime().wrap(function _callee$(_context2) {
89
- while (1) switch (_context2.prev = _context2.next) {
90
- case 0:
91
- convoId = MacroGlobals.$convo();
92
- _context2.next = 3;
93
- return new exports$1.build.Scout9Api(new exports$1.build.Configuration({
94
- apiKey: process.env.SCOUT9_API_KEY
95
- })).did({
96
- prompt: prompt,
97
- convoId: convoId
98
- }).then(handleAxiosResponse);
99
- case 3:
100
- _yield$Scout9Api$did$ = _context2.sent;
101
- value = _yield$Scout9Api$did$.value;
102
- return _context2.abrupt("return", value);
103
- case 6:
104
- case "end":
105
- return _context2.stop();
106
- }
107
- }, _callee);
108
- }));
109
- return _did.apply(this, arguments);
110
- }
111
- function context(_x2, _x3) {
112
- return _context.apply(this, arguments);
113
- }
114
- function _context() {
115
- _context = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee2(prompt, examples) {
116
- var convoId;
117
- return spirits._regeneratorRuntime().wrap(function _callee2$(_context3) {
118
- while (1) switch (_context3.prev = _context3.next) {
119
- case 0:
120
- convoId = MacroGlobals.$convo();
121
- _context3.next = 3;
122
- return new exports$1.build.Scout9Api(new exports$1.build.Configuration({
123
- apiKey: process.env.SCOUT9_API_KEY
124
- })).captureContext({
125
- prompt: prompt,
126
- examples: examples,
127
- convoId: convoId
128
- }).then(handleAxiosResponse);
129
- case 3:
130
- return _context3.abrupt("return", _context3.sent);
131
- case 4:
132
- case "end":
133
- return _context3.stop();
134
- }
135
- }, _callee2);
136
- }));
137
- return _context.apply(this, arguments);
138
- }
139
41
 
140
- exports.ContextExampleSchema = exports$1.ContextExampleSchema;
141
- exports.ContextExampleWithTrainingDataSchema = exports$1.ContextExampleWithTrainingDataSchema;
142
- exports.ConversationContext = exports$1.ConversationContext;
143
- exports.ConversationSchema = exports$1.ConversationSchema;
144
- exports.EventResponse = exports$1.EventResponse;
145
- exports.FollowupBaseSchema = exports$1.FollowupBaseSchema;
146
- exports.FollowupSchema = exports$1.FollowupSchema;
147
- exports.ForwardSchema = exports$1.ForwardSchema;
148
- exports.InstructionObjectSchema = exports$1.InstructionObjectSchema;
149
- exports.InstructionSchema = exports$1.InstructionSchema;
150
- exports.IntentWorkflowEventSchema = exports$1.IntentWorkflowEventSchema;
151
- exports.MessageSchema = exports$1.MessageSchema;
152
- exports.Scout9ProjectBuildConfigSchema = exports$1.Scout9ProjectBuildConfigSchema;
153
- exports.Scout9ProjectConfigSchema = exports$1.Scout9ProjectConfigSchema;
154
- exports.Scout9Test = exports$1.Scout9Test;
155
- exports.WorkflowConfigurationSchema = exports$1.WorkflowConfigurationSchema;
156
- exports.WorkflowEventSchema = exports$1.WorkflowEventSchema;
157
- exports.WorkflowFunctionSchema = exports$1.WorkflowFunctionSchema;
158
- exports.WorkflowResponseMessage = exports$1.WorkflowResponseMessage;
159
- exports.WorkflowResponseMessageApiRequest = exports$1.WorkflowResponseMessageApiRequest;
160
- exports.WorkflowResponseMessageApiResponse = exports$1.WorkflowResponseMessageApiResponse;
161
- exports.WorkflowResponseSchema = exports$1.WorkflowResponseSchema;
162
- exports.WorkflowResponseSlotBaseSchema = exports$1.WorkflowResponseSlotBaseSchema;
163
- exports.WorkflowResponseSlotSchema = exports$1.WorkflowResponseSlotSchema;
164
- exports.WorkflowsConfigurationSchema = exports$1.WorkflowsConfigurationSchema;
165
- exports.agentBaseConfigurationSchema = exports$1.agentBaseConfigurationSchema;
166
- exports.agentConfigurationSchema = exports$1.agentConfigurationSchema;
167
- exports.agentsBaseConfigurationSchema = exports$1.agentsBaseConfigurationSchema;
168
- exports.agentsConfigurationSchema = exports$1.agentsConfigurationSchema;
169
- exports.apiFunctionSchema = exports$1.apiFunctionSchema;
170
- exports.createMockAgent = exports$1.createMockAgent;
171
- exports.createMockConversation = exports$1.createMockConversation;
172
- exports.createMockCustomer = exports$1.createMockCustomer;
173
- exports.createMockMessage = exports$1.createMockMessage;
174
- exports.createMockWorkflowEvent = exports$1.createMockWorkflowEvent;
175
- exports.customerSchema = exports$1.customerSchema;
176
- exports.customerValueSchema = exports$1.customerValueSchema;
177
- exports.deleteApiFunctionSchema = exports$1.deleteApiFunctionSchema;
178
- exports.entitiesRootConfigurationSchema = exports$1.entitiesRootConfigurationSchema;
179
- exports.entitiesRootProjectConfigurationSchema = exports$1.entitiesRootProjectConfigurationSchema;
180
- exports.entityApiConfigurationSchema = exports$1.entityApiConfigurationSchema;
181
- exports.entityConfigurationSchema = exports$1.entityConfigurationSchema;
182
- exports.entityRootProjectConfigurationSchema = exports$1.entityRootProjectConfigurationSchema;
183
- exports.eventResponseSchema = exports$1.eventResponseSchema;
184
- exports.forward = exports$1.forward;
185
- exports.getApiFunctionSchema = exports$1.getApiFunctionSchema;
186
- exports.instruct = exports$1.instruct;
187
- exports.json = exports$1.json;
188
- exports.patchApiFunctionSchema = exports$1.patchApiFunctionSchema;
189
- exports.postApiFunctionSchema = exports$1.postApiFunctionSchema;
190
- exports.putApiFunctionSchema = exports$1.putApiFunctionSchema;
191
- exports.queryApiFunctionSchema = exports$1.queryApiFunctionSchema;
192
- exports.reply = exports$1.reply;
193
- exports.run = exports$1.run;
194
- exports.sendEvent = exports$1.sendEvent;
42
+ exports.context = index.context;
43
+ exports.did = index.did;
44
+ exports.json = index.json;
45
+ exports.run = index.run;
46
+ exports.sendEvent = index.sendEvent;
47
+ exports.ContextExampleSchema = dev.ContextExampleSchema;
48
+ exports.ContextExampleWithTrainingDataSchema = dev.ContextExampleWithTrainingDataSchema;
49
+ exports.ConversationContext = dev.ConversationContext;
50
+ exports.ConversationSchema = dev.ConversationSchema;
51
+ exports.EventResponse = dev.EventResponse;
52
+ exports.FollowupBaseSchema = dev.FollowupBaseSchema;
53
+ exports.FollowupSchema = dev.FollowupSchema;
54
+ exports.ForwardSchema = dev.ForwardSchema;
55
+ exports.InstructionObjectSchema = dev.InstructionObjectSchema;
56
+ exports.InstructionSchema = dev.InstructionSchema;
57
+ exports.IntentWorkflowEventSchema = dev.IntentWorkflowEventSchema;
58
+ exports.MessageSchema = dev.MessageSchema;
59
+ exports.Scout9ProjectBuildConfigSchema = dev.Scout9ProjectBuildConfigSchema;
60
+ exports.Scout9ProjectConfigSchema = dev.Scout9ProjectConfigSchema;
61
+ exports.Scout9Test = dev.Scout9Test;
62
+ exports.WorkflowConfigurationSchema = dev.WorkflowConfigurationSchema;
63
+ exports.WorkflowEventSchema = dev.WorkflowEventSchema;
64
+ exports.WorkflowFunctionSchema = dev.WorkflowFunctionSchema;
65
+ exports.WorkflowResponseMessage = dev.WorkflowResponseMessage;
66
+ exports.WorkflowResponseMessageApiRequest = dev.WorkflowResponseMessageApiRequest;
67
+ exports.WorkflowResponseMessageApiResponse = dev.WorkflowResponseMessageApiResponse;
68
+ exports.WorkflowResponseSchema = dev.WorkflowResponseSchema;
69
+ exports.WorkflowResponseSlotBaseSchema = dev.WorkflowResponseSlotBaseSchema;
70
+ exports.WorkflowResponseSlotSchema = dev.WorkflowResponseSlotSchema;
71
+ exports.WorkflowsConfigurationSchema = dev.WorkflowsConfigurationSchema;
72
+ exports.agentBaseConfigurationSchema = dev.agentBaseConfigurationSchema;
73
+ exports.agentConfigurationSchema = dev.agentConfigurationSchema;
74
+ exports.agentsBaseConfigurationSchema = dev.agentsBaseConfigurationSchema;
75
+ exports.agentsConfigurationSchema = dev.agentsConfigurationSchema;
76
+ exports.apiFunctionSchema = dev.apiFunctionSchema;
77
+ exports.createMockAgent = dev.createMockAgent;
78
+ exports.createMockConversation = dev.createMockConversation;
79
+ exports.createMockCustomer = dev.createMockCustomer;
80
+ exports.createMockMessage = dev.createMockMessage;
81
+ exports.createMockWorkflowEvent = dev.createMockWorkflowEvent;
82
+ exports.customerSchema = dev.customerSchema;
83
+ exports.customerValueSchema = dev.customerValueSchema;
84
+ exports.deleteApiFunctionSchema = dev.deleteApiFunctionSchema;
85
+ exports.entitiesRootConfigurationSchema = dev.entitiesRootConfigurationSchema;
86
+ exports.entitiesRootProjectConfigurationSchema = dev.entitiesRootProjectConfigurationSchema;
87
+ exports.entityApiConfigurationSchema = dev.entityApiConfigurationSchema;
88
+ exports.entityConfigurationSchema = dev.entityConfigurationSchema;
89
+ exports.entityRootProjectConfigurationSchema = dev.entityRootProjectConfigurationSchema;
90
+ exports.eventResponseSchema = dev.eventResponseSchema;
91
+ exports.forward = dev.forward;
92
+ exports.getApiFunctionSchema = dev.getApiFunctionSchema;
93
+ exports.instruct = dev.instruct;
94
+ exports.patchApiFunctionSchema = dev.patchApiFunctionSchema;
95
+ exports.postApiFunctionSchema = dev.postApiFunctionSchema;
96
+ exports.putApiFunctionSchema = dev.putApiFunctionSchema;
97
+ exports.queryApiFunctionSchema = dev.queryApiFunctionSchema;
98
+ exports.reply = dev.reply;
195
99
  exports.Spirits = spirits.Spirits;
196
- exports.context = context;
197
- exports.did = did;
@@ -2,38 +2,38 @@
2
2
 
3
3
  require('node:fs');
4
4
  require('node:path');
5
- var exports$1 = require("./exports-83755281.cjs");
5
+ var index = require("./index-ea1273a0.cjs");
6
6
  require("./spirits-32395ac4.cjs");
7
- require('node:readline');
8
- require('fs');
9
- require('events');
10
- require('path');
11
- require('constants');
12
- require('stream');
7
+ require("./dev-ecdbe765.cjs");
13
8
  require('util');
9
+ require('stream');
10
+ require('path');
11
+ require('http');
12
+ require('https');
13
+ require('url');
14
+ require('fs');
14
15
  require('assert');
15
- require('buffer');
16
+ require('tty');
17
+ require('os');
16
18
  require('zlib');
17
- require('url');
19
+ require('events');
20
+ require('crypto');
21
+ require('node:fs/promises');
18
22
  require('fs/promises');
19
23
  require('string_decoder');
20
- require('node:fs/promises');
24
+ require('node:readline');
25
+ require('node:process');
21
26
  require('node:url');
27
+ require('node:os');
28
+ require('constants');
29
+ require('buffer');
22
30
  require('node:http');
23
31
  require('node:https');
24
32
  require('node:zlib');
25
33
  require('node:stream');
26
34
  require('node:buffer');
27
- require('http');
28
- require('https');
29
- require('tty');
30
- require('os');
31
- require('crypto');
32
- require('node:process');
33
- require('node:os');
34
35
  require('node:util');
35
36
  require('node:net');
36
- require('node:vm');
37
37
 
38
38
  let s = 0;
39
39
  const S = {
@@ -348,7 +348,7 @@ async function toFormData(Body, ct) {
348
348
  let contentType;
349
349
  let filename;
350
350
  const entryChunks = [];
351
- const formData = new exports$1.FormData();
351
+ const formData = new index.FormData();
352
352
  const onPartData = ui8a => {
353
353
  entryValue += decoder.decode(ui8a, {
354
354
  stream: true
@@ -358,7 +358,7 @@ async function toFormData(Body, ct) {
358
358
  entryChunks.push(ui8a);
359
359
  };
360
360
  const appendFileToFormData = () => {
361
- const file = new exports$1.File(entryChunks, filename, {
361
+ const file = new index.File(entryChunks, filename, {
362
362
  type: contentType
363
363
  });
364
364
  formData.append(entryName, file);
@@ -2,47 +2,37 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-83755281.cjs");
5
+ var dev = require("./dev-ecdbe765.cjs");
6
6
  var spirits = require("./spirits-32395ac4.cjs");
7
- require('node:readline');
8
- require('fs');
9
- require('events');
10
- require('path');
11
- require('constants');
12
- require('stream');
13
7
  require('util');
14
- require('assert');
15
- require('buffer');
16
- require('zlib');
17
- require('url');
18
- require('fs/promises');
19
- require('string_decoder');
20
- require('node:fs');
21
- require('node:fs/promises');
22
- require('node:path');
23
- require('node:url');
24
- require('node:http');
25
- require('node:https');
26
- require('node:zlib');
27
- require('node:stream');
28
- require('node:buffer');
8
+ require('stream');
9
+ require('path');
29
10
  require('http');
30
11
  require('https');
12
+ require('url');
13
+ require('fs');
14
+ require('assert');
31
15
  require('tty');
32
16
  require('os');
17
+ require('zlib');
18
+ require('events');
33
19
  require('crypto');
20
+ require('node:fs');
21
+ require('node:path');
22
+ require('node:fs/promises');
23
+ require('fs/promises');
24
+ require('string_decoder');
25
+ require('node:readline');
34
26
  require('node:process');
27
+ require('node:url');
35
28
  require('node:os');
36
- require('node:util');
37
- require('node:net');
38
- require('node:vm');
39
29
 
40
30
 
41
31
 
42
- exports.Scout9Test = exports$1.Scout9Test;
43
- exports.createMockAgent = exports$1.createMockAgent;
44
- exports.createMockConversation = exports$1.createMockConversation;
45
- exports.createMockCustomer = exports$1.createMockCustomer;
46
- exports.createMockMessage = exports$1.createMockMessage;
47
- exports.createMockWorkflowEvent = exports$1.createMockWorkflowEvent;
32
+ exports.Scout9Test = dev.Scout9Test;
33
+ exports.createMockAgent = dev.createMockAgent;
34
+ exports.createMockConversation = dev.createMockConversation;
35
+ exports.createMockCustomer = dev.createMockCustomer;
36
+ exports.createMockMessage = dev.createMockMessage;
37
+ exports.createMockWorkflowEvent = dev.createMockWorkflowEvent;
48
38
  exports.Spirits = spirits.Spirits;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scout9/app",
3
- "version": "1.0.0-alpha.0.1.93",
3
+ "version": "1.0.0-alpha.0.1.95",
4
4
  "description": "Build and deploy your Scout9 app for SMS auto replies",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,3 +1,2 @@
1
- export * from './entry.js';
2
1
  export * from './client/index.js';
3
2
  export * from './macros/index.js';
@@ -2,7 +2,7 @@
2
2
  * Builder Macros
3
3
  * used to build and guide a application logic in relation to the Scout9 conversation state.
4
4
  */
5
- import { Configuration, Scout9Api } from '@scout9/admin';
5
+ import { Configuration, MacroContextResult, Scout9Api } from '@scout9/admin';
6
6
  import MacroGlobals from './globals.js';
7
7
 
8
8
  function handleAxiosResponse(res) {
@@ -30,14 +30,15 @@ export async function did(prompt) {
30
30
  * The `context` macro, similar to the `did` macro, takes a natural statement and checks the entire conversation state and extracts or infers a metadata composition result.
31
31
  * @param {string} prompt
32
32
  * @param {import('@scout9/admin').CaptureContextRequestExamples} [examples]
33
- * @return {Promise<import('@scout9/admin').CaptureContext200Response>}
33
+ * @return {Promise<import('@scout9/admin').MacroContextValue>}
34
34
  */
35
35
  export async function context(prompt, examples) {
36
36
  const convoId = MacroGlobals.$convo();
37
- return (await (new Scout9Api(new Configuration({apiKey: process.env.SCOUT9_API_KEY}))).captureContext({
37
+ const {value} = (await (new Scout9Api(new Configuration({apiKey: process.env.SCOUT9_API_KEY}))).captureContext({
38
38
  prompt,
39
39
  examples,
40
40
  convoId
41
41
  })
42
42
  .then(handleAxiosResponse));
43
+ return value;
43
44
  }
@@ -92,7 +92,7 @@ function EventMacros() {
92
92
  * @param {object} no - The object to process if the instruction is a string and the condition is not met.
93
93
  *
94
94
  * @overload
95
- * @param {(Array<import('zod').infer<typeof import('../runtime/client/workflow.js').WorkflowResponseSlotBaseSchema> & {keywords: string[]}>)} instruction
95
+ * @param {(Array<IWorkflowResponseSlotBase & {keywords: string[]}>)} instruction
96
96
  *
97
97
  * @return {EventMacros}
98
98
  */
@@ -213,8 +213,8 @@ function EventMacros() {
213
213
  return this;
214
214
  },
215
215
  /**
216
- *
217
- * @return {Array<(import('zod').infer<typeof import('../runtime/client/workflow.js').WorkflowResponseSlotSchema>)>}
216
+ * Returns event payload
217
+ * @return {Array<IWorkflowResponseSlot>}
218
218
  */
219
219
  toJSON(flush = true) {
220
220
  if (flush) {
package/types/index.d.ts CHANGED
@@ -20039,6 +20039,124 @@ declare module '@scout9/app' {
20039
20039
  body: Partial<RequestBody>;
20040
20040
  }) => Promise<EventResponse<Response>>;
20041
20041
  export type IDeleteApiFunction<Params, Response_1> = IApiFunction<Params, Response>;
20042
+ export function instruct(instruction: string, options?: {
20043
+ id?: string | undefined;
20044
+ persist?: string | undefined;
20045
+ } | undefined): typeof EventMacros;
20046
+ /**
20047
+ * This macro ends the conversation and forwards it the owner of the persona to manually handle the flow. If your app returns undefined or no event, then a default forward is generated.
20048
+ * @param message - the message to forward to owner of persona
20049
+ * */
20050
+ export function forward(message: string, options?: {
20051
+ mode?: "after-reply" | "immediately" | undefined;
20052
+ to?: string | undefined;
20053
+ } | undefined): any;
20054
+ /**
20055
+ * If a manual message must be sent, you can use the `reply` macro
20056
+ * @param message - the message to manually send to the user
20057
+ * */
20058
+ export function reply(message: string, options?: {
20059
+ scheduled?: string | Date | undefined;
20060
+ delay?: string | undefined;
20061
+ } | undefined): any;
20062
+ function EventMacros(): {
20063
+ /**
20064
+ * Sets context into the conversation context for later use
20065
+ * */
20066
+ upsert(updates: Record<string, any>): any;
20067
+ /**
20068
+ * Similar to `instruction` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20069
+ *
20070
+ * */
20071
+ /**
20072
+ * Similar to `instruction` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20073
+ *
20074
+ * */
20075
+ followup(options: Date | string): any;
20076
+ /**
20077
+ * Similar to `instruction` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20078
+ *
20079
+ * */
20080
+ /**
20081
+ * Similar to `instruction` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20082
+ *
20083
+ * */
20084
+ followup(options: {
20085
+ scheduled: Date | string;
20086
+ cancelIf?: Record<string, any> | undefined;
20087
+ literal?: boolean | undefined;
20088
+ overrideLock?: boolean | undefined;
20089
+ }): any;
20090
+ /**
20091
+ * Similar to `instruct` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20092
+ * */
20093
+ /**
20094
+ * Similar to `instruct` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20095
+ * */
20096
+ anticipate(instruction: string, yes: object, no: object): any;
20097
+ /**
20098
+ * Similar to `instruct` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20099
+ * */
20100
+ /**
20101
+ * Similar to `instruct` except that it requires a schedule time parameter that determines when to follow up (and is not an event output macro). This will fire another run job with a new insert system context message, if `options.literal` is set to true, it will be an appended agent message prior to running the workflow app.
20102
+ * */
20103
+ anticipate(instruction: (Array<IWorkflowResponseSlotBase & {
20104
+ keywords: string[];
20105
+ }>)): typeof EventMacros;
20106
+
20107
+ instruct(instruction: string, options?: {
20108
+ id?: string | undefined;
20109
+ persist?: string | undefined;
20110
+ } | undefined): typeof EventMacros;
20111
+ /**
20112
+ * If a manual message must be sent, you can use the `reply` macro
20113
+ * @param message - the message to manually send to the user
20114
+ * */
20115
+ reply(message: string, options?: {
20116
+ scheduled?: string | Date | undefined;
20117
+ delay?: string | undefined;
20118
+ } | undefined): any;
20119
+ /**
20120
+ * This macro ends the conversation and forwards it the owner of the persona to manually handle the flow. If your app returns undefined or no event, then a default forward is generated.
20121
+ * @param message - the message to forward to owner of persona
20122
+ * */
20123
+ forward(message: string, options?: {
20124
+ mode?: "after-reply" | "immediately" | undefined;
20125
+ to?: string | undefined;
20126
+ } | undefined): any;
20127
+ /**
20128
+ * Returns event payload
20129
+ * */
20130
+ toJSON(flush?: boolean): Array<IWorkflowResponseSlot>;
20131
+ };
20132
+ /**
20133
+ * The `did` macro takes a given prompt and infers a binary `true` or `false` result in relation to the prompt's subject actor and the prompt's inquiry.
20134
+ * */
20135
+ export function did(prompt: string): Promise<boolean>;
20136
+ /**
20137
+ * The `context` macro, similar to the `did` macro, takes a natural statement and checks the entire conversation state and extracts or infers a metadata composition result.
20138
+ * */
20139
+ export function context(prompt: string, examples?: any): Promise<import('@scout9/admin').MacroContextValue>;
20140
+ export const ContextExampleWithTrainingDataSchema: z.ZodObject<{
20141
+ input: z.ZodString;
20142
+ output: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
20143
+ }, "strip", z.ZodTypeAny, {
20144
+ input: string;
20145
+ output: Record<string, any>[];
20146
+ }, {
20147
+ input: string;
20148
+ output: Record<string, any>[];
20149
+ }>;
20150
+ export const ContextExampleSchema: z.ZodUnion<[z.ZodArray<z.ZodObject<{
20151
+ input: z.ZodString;
20152
+ output: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">;
20153
+ }, "strip", z.ZodTypeAny, {
20154
+ input: string;
20155
+ output: Record<string, any>[];
20156
+ }, {
20157
+ input: string;
20158
+ output: Record<string, any>[];
20159
+ }>, "many">, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">]>;
20042
20160
  }
20043
20161
 
20044
20162
  declare module '@scout9/app/spirits' {