@superpanel-sdk/runtime 0.2.2 → 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.
Files changed (274) hide show
  1. package/README.md +28 -8
  2. package/dist/builder/codegen/emit.d.ts +29 -11
  3. package/dist/builder/codegen/emit.js +328 -61
  4. package/dist/builder/codegen/generate.d.ts +21 -0
  5. package/dist/builder/codegen/generate.js +152 -20
  6. package/dist/builder/company-import-graph.d.ts +2 -0
  7. package/dist/builder/company-import-graph.js +40 -8
  8. package/dist/builder/company-imports.d.ts +24 -0
  9. package/dist/builder/company-imports.js +114 -0
  10. package/dist/builder/compile/compile-sequence.d.ts +59 -8
  11. package/dist/builder/compile/compile-sequence.js +279 -77
  12. package/dist/builder/compile/function-code.d.ts +12 -2
  13. package/dist/builder/compile/function-code.js +87 -39
  14. package/dist/builder/compile/registry.d.ts +7 -3
  15. package/dist/builder/compile/registry.js +24 -23
  16. package/dist/builder/load.d.ts +70 -10
  17. package/dist/builder/load.js +250 -61
  18. package/dist/builder/paths.d.ts +3 -0
  19. package/dist/builder/paths.js +16 -0
  20. package/dist/builder/schedules.d.ts +23 -0
  21. package/dist/builder/schedules.js +102 -0
  22. package/dist/builder/slot-schema-validation.d.ts +4 -0
  23. package/dist/builder/slot-schema-validation.js +10 -0
  24. package/dist/builder/typecheck.d.ts +8 -0
  25. package/dist/builder/typecheck.js +105 -0
  26. package/dist/builder/types.d.ts +91 -19
  27. package/dist/builder/types.js +2 -1
  28. package/dist/cli/auth/auth.d.ts +37 -0
  29. package/dist/cli/auth/auth.js +211 -0
  30. package/dist/cli/auth/backend-url.d.ts +5 -0
  31. package/dist/cli/auth/backend-url.js +25 -0
  32. package/dist/cli/auth/clipboard.d.ts +9 -0
  33. package/dist/cli/auth/clipboard.js +38 -0
  34. package/dist/cli/auth/http.d.ts +20 -0
  35. package/dist/cli/auth/http.js +27 -0
  36. package/dist/cli/auth/index.d.ts +10 -0
  37. package/dist/cli/auth/index.js +27 -0
  38. package/dist/cli/auth/progress.d.ts +12 -0
  39. package/dist/cli/auth/progress.js +15 -0
  40. package/dist/cli/auth/serve-login.d.ts +8 -0
  41. package/dist/cli/auth/serve-login.js +24 -0
  42. package/dist/cli/compile/index.js +3 -0
  43. package/dist/cli/config.d.ts +10 -0
  44. package/dist/cli/config.js +52 -0
  45. package/dist/cli/index.js +28 -8
  46. package/dist/cli/serve/index.d.ts +73 -3
  47. package/dist/cli/serve/index.js +410 -113
  48. package/dist/cli/type-gen/index.js +9 -8
  49. package/dist/compiler.d.ts +7 -0
  50. package/dist/compiler.js +7 -0
  51. package/dist/compute-host/compute-host.d.ts +15 -23
  52. package/dist/compute-host/compute-host.js +25 -28
  53. package/dist/compute-host/index.d.ts +2 -2
  54. package/dist/compute-host/index.js +1 -1
  55. package/dist/compute-host/source-compute-host.d.ts +11 -9
  56. package/dist/compute-host/source-compute-host.js +50 -31
  57. package/dist/core/case-orchestrator/contact-hours.d.ts +50 -0
  58. package/dist/core/case-orchestrator/contact-hours.js +108 -0
  59. package/dist/core/case-orchestrator/follow-ups.d.ts +31 -0
  60. package/dist/core/case-orchestrator/follow-ups.js +103 -0
  61. package/dist/core/case-orchestrator/index.d.ts +6 -0
  62. package/dist/core/case-orchestrator/index.js +6 -0
  63. package/dist/core/case-orchestrator/render.d.ts +75 -0
  64. package/dist/core/case-orchestrator/render.js +239 -0
  65. package/dist/core/case-orchestrator/time.d.ts +11 -0
  66. package/dist/core/case-orchestrator/time.js +29 -0
  67. package/dist/core/case-orchestrator/tools.d.ts +29 -0
  68. package/dist/core/case-orchestrator/tools.js +31 -0
  69. package/dist/core/case-orchestrator/types.d.ts +753 -0
  70. package/dist/core/case-orchestrator/types.js +46 -0
  71. package/dist/core/case-orchestrator/validate.d.ts +11 -0
  72. package/dist/core/case-orchestrator/validate.js +63 -0
  73. package/dist/core/context/call.d.ts +291 -0
  74. package/dist/core/context/call.js +94 -0
  75. package/dist/core/context/channels.d.ts +60 -0
  76. package/dist/core/context/channels.js +35 -0
  77. package/dist/core/context/contact.d.ts +96 -6
  78. package/dist/core/context/contact.js +48 -2
  79. package/dist/core/context/email-message.d.ts +159 -0
  80. package/dist/core/context/email-message.js +59 -0
  81. package/dist/core/context/email.d.ts +97 -0
  82. package/dist/core/context/email.js +91 -0
  83. package/dist/core/context/exchanges.d.ts +142 -0
  84. package/dist/core/context/exchanges.js +63 -0
  85. package/dist/core/context/instances.d.ts +278 -0
  86. package/dist/core/context/instances.js +123 -0
  87. package/dist/core/context/kv.d.ts +113 -0
  88. package/dist/core/context/kv.js +60 -0
  89. package/dist/core/context/platform-registry.d.ts +509 -4
  90. package/dist/core/context/platform-registry.js +14 -2
  91. package/dist/core/context/platform.d.ts +2 -1
  92. package/dist/core/context/sms.d.ts +147 -0
  93. package/dist/core/context/sms.js +57 -0
  94. package/dist/core/context/types.d.ts +51 -30
  95. package/dist/core/context/types.js +1 -7
  96. package/dist/core/conversation/index.d.ts +31 -0
  97. package/dist/core/conversation/index.js +14 -0
  98. package/dist/core/functions/define/bind.d.ts +25 -0
  99. package/dist/core/functions/define/bind.js +14 -0
  100. package/dist/core/functions/define/case.d.ts +9 -0
  101. package/dist/core/functions/define/case.js +13 -0
  102. package/dist/core/functions/define/events.d.ts +20 -0
  103. package/dist/core/functions/define/events.js +21 -0
  104. package/dist/core/functions/define/no-case.d.ts +4 -0
  105. package/dist/core/functions/define/no-case.js +9 -0
  106. package/dist/core/functions/events.d.ts +247 -0
  107. package/dist/core/functions/events.js +32 -0
  108. package/dist/core/functions/func-ref.d.ts +11 -2
  109. package/dist/core/functions/schedules.d.ts +51 -0
  110. package/dist/core/functions/schedules.js +20 -0
  111. package/dist/core/functions/types.d.ts +62 -51
  112. package/dist/core/functions/types.js +6 -1
  113. package/dist/core/office-hours/index.d.ts +39 -0
  114. package/dist/core/office-hours/index.js +187 -0
  115. package/dist/core/page/define.d.ts +834 -0
  116. package/dist/core/page/define.js +477 -0
  117. package/dist/core/page/ops.d.ts +58 -0
  118. package/dist/core/page/ops.js +220 -0
  119. package/dist/core/page/render.d.ts +253 -0
  120. package/dist/core/page/render.js +840 -0
  121. package/dist/core/page/time-format.d.ts +19 -0
  122. package/dist/core/page/time-format.js +41 -0
  123. package/dist/core/page/timeline.d.ts +40 -0
  124. package/dist/core/page/timeline.js +2 -0
  125. package/dist/core/page/typed.d.ts +642 -0
  126. package/dist/core/page/typed.js +2 -0
  127. package/dist/core/page/workspace.d.ts +33 -0
  128. package/dist/core/page/workspace.js +231 -0
  129. package/dist/core/party/index.d.ts +3 -0
  130. package/dist/core/party/index.js +3 -0
  131. package/dist/core/party/schema.d.ts +137 -0
  132. package/dist/core/party/schema.js +80 -0
  133. package/dist/core/party/types.d.ts +40 -0
  134. package/dist/core/party/types.js +15 -0
  135. package/dist/core/sequence/define.d.ts +57 -0
  136. package/dist/core/sequence/define.js +10 -0
  137. package/dist/core/sequence/index.d.ts +63 -0
  138. package/dist/core/sequence/index.js +231 -0
  139. package/dist/core/slot/binding.d.ts +40 -0
  140. package/dist/core/slot/binding.js +2 -0
  141. package/dist/core/slot/company-metadata.d.ts +113 -0
  142. package/dist/core/slot/company-metadata.js +563 -0
  143. package/dist/core/slot/compile-schema.d.ts +19 -13
  144. package/dist/core/slot/compile-schema.js +51 -248
  145. package/dist/core/slot/contact-timezone.d.ts +110 -0
  146. package/dist/core/slot/contact-timezone.js +186 -0
  147. package/dist/core/slot/field.d.ts +2 -24
  148. package/dist/core/slot/field.js +0 -69
  149. package/dist/core/slot/id-ref.d.ts +17 -2
  150. package/dist/core/slot/id-ref.js +16 -8
  151. package/dist/core/slot/index.d.ts +12 -13
  152. package/dist/core/slot/index.js +11 -12
  153. package/dist/core/slot/naming.d.ts +15 -0
  154. package/dist/core/slot/naming.js +96 -0
  155. package/dist/core/slot/platform-fields.d.ts +119 -0
  156. package/dist/core/slot/platform-fields.js +121 -0
  157. package/dist/core/slot/ref.d.ts +16 -0
  158. package/dist/core/slot/ref.js +14 -0
  159. package/dist/core/slot/row.d.ts +2 -9
  160. package/dist/core/slot/row.js +13 -23
  161. package/dist/core/slot/schema-compat.d.ts +16 -0
  162. package/dist/core/slot/schema-compat.js +112 -0
  163. package/dist/core/slot/schema.d.ts +409 -76
  164. package/dist/core/slot/schema.js +178 -10
  165. package/dist/core/slot/types.d.ts +27 -92
  166. package/dist/core/slot/value.d.ts +26 -3
  167. package/dist/core/slot/value.js +89 -57
  168. package/dist/dev-overlay/protocol.d.ts +41 -8
  169. package/dist/fn-context/build-context.d.ts +3 -1
  170. package/dist/fn-context/build-context.js +20 -10
  171. package/dist/fn-context/fake/empty-api.js +9 -28
  172. package/dist/fn-context/fake/index.d.ts +11 -4
  173. package/dist/fn-context/fake/index.js +27 -2
  174. package/dist/fn-context/fn-params.d.ts +6 -0
  175. package/dist/fn-context/fn-params.js +13 -0
  176. package/dist/fn-context/index.d.ts +5 -5
  177. package/dist/fn-context/index.js +4 -4
  178. package/dist/fn-context/log.js +2 -2
  179. package/dist/fn-context/make-ctx.d.ts +11 -0
  180. package/dist/fn-context/make-ctx.js +18 -8
  181. package/dist/fn-context/rpc/case-orchestrator-tools.d.ts +24 -0
  182. package/dist/fn-context/rpc/case-orchestrator-tools.js +13 -0
  183. package/dist/fn-context/rpc/index.d.ts +3 -1
  184. package/dist/fn-context/rpc/index.js +3 -1
  185. package/dist/fn-context/rpc/integration/index.d.ts +4 -4
  186. package/dist/fn-context/rpc/integration/index.js +1 -1
  187. package/dist/fn-context/rpc/integration/list-surfaces.d.ts +21 -0
  188. package/dist/fn-context/rpc/integration/{list-bindings.js → list-surfaces.js} +4 -4
  189. package/dist/fn-context/rpc/platform.d.ts +2 -2
  190. package/dist/fn-context/rpc/platform.js +1 -1
  191. package/dist/fn-context/rpc/records.d.ts +78 -0
  192. package/dist/fn-context/rpc/records.js +26 -0
  193. package/dist/fn-context/rpc/trpc-client.d.ts +2 -2
  194. package/dist/fn-context/rpc/trpc-client.js +89 -5
  195. package/dist/fn-context/rpc/trpc-init.d.ts +2 -2
  196. package/dist/fn-context/rpc/trpc-router-factory.d.ts +49 -3
  197. package/dist/fn-context/rpc/trpc-router-factory.js +2 -0
  198. package/dist/fn-context/run-scope.d.ts +4 -0
  199. package/dist/fn-context/run-scope.js +9 -0
  200. package/dist/fn-context/types.d.ts +36 -3
  201. package/dist/index.d.ts +37 -46
  202. package/dist/index.js +33 -33
  203. package/dist/logger.d.ts +7 -0
  204. package/dist/logger.js +41 -0
  205. package/dist/platform.d.ts +76 -0
  206. package/dist/platform.js +56 -0
  207. package/dist/voice-service/actions.d.ts +71 -4
  208. package/dist/voice-service/types.d.ts +42 -2
  209. package/dist/worker.d.ts +10 -0
  210. package/dist/worker.js +10 -0
  211. package/package.json +38 -19
  212. package/dist/builder/compile/compile-agenda.d.ts +0 -15
  213. package/dist/builder/compile/compile-agenda.js +0 -59
  214. package/dist/builder/merge.d.ts +0 -4
  215. package/dist/builder/merge.js +0 -19
  216. package/dist/core/context/db.d.ts +0 -69
  217. package/dist/core/context/db.js +0 -44
  218. package/dist/core/context/docusign.d.ts +0 -134
  219. package/dist/core/context/docusign.js +0 -108
  220. package/dist/core/context/filevine.d.ts +0 -323
  221. package/dist/core/context/filevine.js +0 -254
  222. package/dist/core/context/http.d.ts +0 -9
  223. package/dist/core/context/http.js +0 -4
  224. package/dist/core/context/hubspot.d.ts +0 -250
  225. package/dist/core/context/hubspot.js +0 -191
  226. package/dist/core/context/twilio.d.ts +0 -50
  227. package/dist/core/context/twilio.js +0 -42
  228. package/dist/core/functions/define/case-context.d.ts +0 -14
  229. package/dist/core/functions/define/case-context.js +0 -15
  230. package/dist/core/functions/define/compute.d.ts +0 -7
  231. package/dist/core/functions/define/compute.js +0 -17
  232. package/dist/core/functions/define/custom.d.ts +0 -4
  233. package/dist/core/functions/define/custom.js +0 -8
  234. package/dist/core/functions/define/system.d.ts +0 -7
  235. package/dist/core/functions/define/system.js +0 -12
  236. package/dist/core/slot/deps.d.ts +0 -15
  237. package/dist/core/slot/deps.js +0 -88
  238. package/dist/core/slot/derived.d.ts +0 -32
  239. package/dist/core/slot/derived.js +0 -115
  240. package/dist/core/slot/platform-session-fields.d.ts +0 -38
  241. package/dist/core/slot/platform-session-fields.js +0 -48
  242. package/dist/core/slot/sf-schema.d.ts +0 -23
  243. package/dist/core/slot/sf-schema.js +0 -125
  244. package/dist/core/slot/sf-validate.d.ts +0 -14
  245. package/dist/core/slot/sf-validate.js +0 -132
  246. package/dist/core/slot/snapshot.d.ts +0 -18
  247. package/dist/core/slot/snapshot.js +0 -138
  248. package/dist/core/slot/write.d.ts +0 -41
  249. package/dist/core/slot/write.js +0 -319
  250. package/dist/core/stage/builders.d.ts +0 -36
  251. package/dist/core/stage/builders.js +0 -28
  252. package/dist/core/stage/condition.d.ts +0 -17
  253. package/dist/core/stage/condition.js +0 -198
  254. package/dist/core/stage/drive.d.ts +0 -43
  255. package/dist/core/stage/drive.js +0 -77
  256. package/dist/core/stage/finish-when.d.ts +0 -20
  257. package/dist/core/stage/finish-when.js +0 -82
  258. package/dist/core/stage/flatten.d.ts +0 -27
  259. package/dist/core/stage/flatten.js +0 -464
  260. package/dist/core/stage/index.d.ts +0 -11
  261. package/dist/core/stage/index.js +0 -10
  262. package/dist/core/stage/simulate.d.ts +0 -24
  263. package/dist/core/stage/simulate.js +0 -33
  264. package/dist/core/stage/transfer-fields.d.ts +0 -14
  265. package/dist/core/stage/transfer-fields.js +0 -88
  266. package/dist/core/stage/types.d.ts +0 -177
  267. package/dist/core/stage/types.js +0 -2
  268. package/dist/core/stage/validate.d.ts +0 -11
  269. package/dist/core/stage/validate.js +0 -226
  270. package/dist/core/stage/walk.d.ts +0 -34
  271. package/dist/core/stage/walk.js +0 -96
  272. package/dist/fn-context/rpc/integration/list-bindings.d.ts +0 -21
  273. package/dist/fn-context/system-args.d.ts +0 -6
  274. package/dist/fn-context/system-args.js +0 -14
@@ -1,17 +1,185 @@
1
- /** Reserved row-identity field name. Authors should not invent another. */
1
+ import { z } from 'zod';
2
+ export const SCALAR_DATA_TYPES = [
3
+ 'string',
4
+ 'text',
5
+ 'phone',
6
+ 'email',
7
+ 'number',
8
+ 'boolean',
9
+ 'date',
10
+ 'datetime',
11
+ 'time',
12
+ 'select',
13
+ 'multi_select',
14
+ ];
15
+ /** The types that take `options` (27 §2–§3). */
16
+ export const OPTION_DATA_TYPES = new Set(['select', 'multi_select']);
17
+ const dataTypeSchema = z.enum([...SCALAR_DATA_TYPES, 'contact_schedule']);
18
+ /** Field keys derived fields used; they were removed (13-data-model-v1 §21) and are reported when found. */
19
+ export const REMOVED_DERIVED_KEYS = ['derived', 'dependsOn', 'computeFn'];
20
+ /** A field's `source`, removed (19-page-writable-cells): a page decides what the AI may write. */
21
+ export const REMOVED_SOURCE_KEY = 'source';
22
+ /**
23
+ * A field's `nullable`, removed: no write ever checked it. Every field starts empty and can be
24
+ * cleared; a page's `required` says when one must be filled, and the platform keeps a row's id and
25
+ * parent itself.
26
+ */
27
+ export const REMOVED_NULLABLE_KEY = 'nullable';
28
+ /**
29
+ * A field's `enum`, removed (27 §2): a field of a known set of values is a `select` (or `multi_select`)
30
+ * with `options`.
31
+ */
32
+ export const REMOVED_ENUM_KEY = 'enum';
33
+ /**
34
+ * A field's `identifier`, removed: nothing found a contact by it. Who a conversation is with is the
35
+ * repo's `resolve` to decide; `ctx.api.contact.find` and clearing a contact use `phone` and `email`.
36
+ */
37
+ export const REMOVED_IDENTIFIER_KEY = 'identifier';
38
+ /** Every row's id: the platform's, on every table; a schema does not write it. */
2
39
  export const ROW_ID_FIELD = 'id';
40
+ /**
41
+ * What every row has besides its fields, the platform's (never a field of a schema): its `id`, when
42
+ * it was created and when it was last written (ISO 8601). A read can filter and order by them.
43
+ */
44
+ export const ROW_SYSTEM_KEYS = ['id', 'createdAt', 'updatedAt'];
45
+ /** The row's times: `createdAt`, `updatedAt`. */
46
+ export const ROW_TIME_KEYS = ['createdAt', 'updatedAt'];
47
+ export function isRowTimeKey(key) {
48
+ return ROW_TIME_KEYS.includes(key);
49
+ }
50
+ /** The definition of every row's `id` (added by the platform to every table and the session). */
3
51
  export const idFieldCore = {
4
- derived: false,
5
52
  label: 'Id',
6
53
  dataType: 'string',
7
- source: 'system',
8
54
  extraction: 'Row identity',
9
- enum: null,
10
- nullable: false,
11
- };
12
- /** Unified row id. Write `id: idField` on every table. */
13
- export const idField = {
14
- ...idFieldCore,
15
- identifier: null,
16
55
  };
56
+ export const normalFieldCoreSchema = z
57
+ .object({
58
+ label: z.string(),
59
+ dataType: dataTypeSchema,
60
+ extraction: z.string(),
61
+ options: z.array(z.string()).optional(),
62
+ })
63
+ .strict();
64
+ export const tableRefSchema = z
65
+ .object({
66
+ table: z.string().min(1),
67
+ kind: z.enum(['parent', 'lookup']),
68
+ relatedName: z.string().optional(),
69
+ })
70
+ .strict();
71
+ export const companyNormalFieldDefSchema = normalFieldCoreSchema
72
+ .extend({
73
+ ref: tableRefSchema.optional(),
74
+ unique: z.literal(true).optional(),
75
+ deprecated: z.boolean().optional(),
76
+ })
77
+ .strict();
78
+ const localTime = /^(?:[01]\d|2[0-3]):[0-5]\d$/;
79
+ const localEndTime = /^(?:(?:[01]\d|2[0-3]):[0-5]\d|24:00)$/;
80
+ const localDate = /^\d{4}-\d{2}-\d{2}$/;
81
+ export const localTimeRangeSchema = z
82
+ .object({ start: z.string().regex(localTime), end: z.string().regex(localEndTime) })
83
+ .strict()
84
+ .refine((range) => range.start < range.end, { message: 'start must be before end' });
85
+ export const weekdaySchema = z.enum(['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']);
86
+ function validateWindows(windows, ctx) {
87
+ for (let index = 1; index < windows.length; index += 1) {
88
+ const previous = windows[index - 1];
89
+ const current = windows[index];
90
+ if (current.start < previous.start) {
91
+ ctx.addIssue({ code: 'custom', path: [index], message: 'windows must be sorted by start time' });
92
+ }
93
+ else if (current.start < previous.end) {
94
+ ctx.addIssue({ code: 'custom', path: [index], message: 'windows must not overlap' });
95
+ }
96
+ }
97
+ }
98
+ const windowsSchema = z.array(localTimeRangeSchema).superRefine(validateWindows);
99
+ const weeklySchema = z
100
+ .object({
101
+ mon: windowsSchema,
102
+ tue: windowsSchema,
103
+ wed: windowsSchema,
104
+ thu: windowsSchema,
105
+ fri: windowsSchema,
106
+ sat: windowsSchema,
107
+ sun: windowsSchema,
108
+ })
109
+ .strict();
110
+ function isValidLocalDate(value) {
111
+ if (!localDate.test(value))
112
+ return false;
113
+ const [year, month, day] = value.split('-').map(Number);
114
+ const date = new Date(Date.UTC(year, month - 1, day));
115
+ return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
116
+ }
117
+ export const contactScheduleValueSchema = z
118
+ .object({
119
+ weekly: weeklySchema.nullable(),
120
+ dateOverrides: z.array(z
121
+ .object({
122
+ dates: z.array(z.string().refine(isValidLocalDate, 'expected a valid YYYY-MM-DD date')).min(1),
123
+ windows: windowsSchema,
124
+ })
125
+ .strict()),
126
+ })
127
+ .strict()
128
+ .superRefine((schedule, ctx) => {
129
+ const seen = new Set();
130
+ schedule.dateOverrides.forEach((override, overrideIndex) => {
131
+ override.dates.forEach((date, dateIndex) => {
132
+ if (seen.has(date)) {
133
+ ctx.addIssue({
134
+ code: 'custom',
135
+ path: ['dateOverrides', overrideIndex, 'dates', dateIndex],
136
+ message: 'each override date may appear only once',
137
+ });
138
+ }
139
+ seen.add(date);
140
+ });
141
+ });
142
+ });
143
+ export const companyFieldDefSchema = companyNormalFieldDefSchema;
144
+ export const companyTableDefSchema = z
145
+ .object({
146
+ label: z.string(),
147
+ description: z.string(),
148
+ fields: z.record(z.string(), companyFieldDefSchema),
149
+ })
150
+ .strict();
151
+ export const companySchemaSchema = z
152
+ .record(z.string().min(1), companyTableDefSchema)
153
+ .refine((schema) => Object.keys(schema).length > 0, {
154
+ message: 'company schema must define at least one table',
155
+ });
156
+ /** A company with no `schema/session.ts`: sessions have no fields. */
157
+ export const EMPTY_SESSION_SCHEMA = { fields: {} };
158
+ export const sessionFieldDefSchema = normalFieldCoreSchema
159
+ .extend({
160
+ dataType: z.enum(SCALAR_DATA_TYPES),
161
+ deprecated: z.boolean().optional(),
162
+ })
163
+ .strict();
164
+ export const sessionSchemaSchema = z
165
+ .object({ fields: z.record(z.string().min(1), sessionFieldDefSchema) })
166
+ .strict();
167
+ export const compiledCompanyMetadataSchema = z
168
+ .object({
169
+ /**
170
+ * The whole company schema of the build: every table and field, without sequence overlays.
171
+ * Prod keeps it additive-only (01-slot-db §2.3).
172
+ */
173
+ tables: companySchemaSchema,
174
+ /** The session fields (`schema/session.ts`), additive-only like the tables. */
175
+ session: sessionSchemaSchema,
176
+ })
177
+ .strict()
178
+ .refine((metadata) => !!metadata.tables.contact, {
179
+ message: 'company metadata must define the contact table',
180
+ path: ['tables', 'contact'],
181
+ });
182
+ export function isCompanySchema(value) {
183
+ return companySchemaSchema.safeParse(value).success;
184
+ }
17
185
  //# sourceMappingURL=schema.js.map
@@ -1,87 +1,58 @@
1
- import type { DataType } from './schema.js';
2
- import type { FieldPath } from './path.js';
1
+ import type { ContactSchedule, DataType, TableRef } from './schema.js';
3
2
  import type { FieldState } from '../context/types.js';
4
- export type UpdatedBy = 'slot-filling' | 'derived' | 'function' | 'human' | 'import' | 'platform';
3
+ export type UpdatedBy = 'slot-filling' | 'function' | 'human' | 'import' | 'platform';
5
4
  /** Prior generation archived into FieldValue.history (no reason — 01-slot-db §4.1). */
6
5
  export type FieldHistoryEntry = {
7
- value: string | number | boolean | null;
6
+ value: SlotValue;
8
7
  state: FieldState;
9
8
  at: number;
10
9
  by: UpdatedBy;
11
10
  };
12
11
  /** In-memory field envelope (01-slot-design §2 + 01-slot-db §4 history). */
13
12
  export type FieldValue = {
13
+ /**
14
+ * Dialogue evidence quote or write justification (`null` when the writer gave none: plain
15
+ * function / platform writes, row inserts, imports).
16
+ * Updating `reason` alone does not count as a C5 state/value change.
17
+ */
14
18
  reason: string | null;
15
- value: string | number | boolean | null;
19
+ /**
20
+ * Current value; always `null` when `state` is `'empty'` or `'declined'`. `'asked_unknown'` is
21
+ * `null` unless the field's extraction allows a coarse value; `'filled'` is non-null.
22
+ */
23
+ value: SlotValue;
16
24
  state: FieldState;
25
+ /** Epoch milliseconds of the last value/state change. */
17
26
  updatedAt: number;
18
27
  updatedBy: UpdatedBy;
19
28
  /** Past generations ascending; excludes current. Appended only on C5 change. */
20
29
  history: FieldHistoryEntry[];
21
30
  };
22
- /** One history append produced by a write batch (for platform write_log). */
23
- export type HistoryAppend = {
24
- path: FieldPath;
25
- entry: FieldHistoryEntry;
26
- };
27
- export type ExtractedField = {
28
- reason: string;
29
- value: string | number | boolean | null;
30
- state: 'filled' | 'asked_unknown' | 'declined';
31
- };
32
- export type SingleRowProjection = Record<string, ExtractedField>;
33
- export type MultiRowProjection = Array<{
34
- rowKey: string;
35
- fields: Record<string, ExtractedField>;
36
- }>;
37
- export type SlotFillingOutput = Record<string, SingleRowProjection | MultiRowProjection>;
38
- export type RuntimeNormalFieldDef = {
39
- derived: false;
31
+ export type SlotValue = string | number | boolean | string[] | ContactSchedule | null;
32
+ export type RuntimeFieldDef = {
40
33
  label: string;
34
+ /** Sequence-specific field meaning shown to slot-filling consumers. */
35
+ description?: string;
41
36
  dataType: DataType;
42
- source: 'conversation' | 'system';
43
37
  extraction: string;
44
- enum: Array<string | number> | null;
45
- nullable: boolean;
46
- identifier: null | {
47
- kind: 'phone' | 'email';
48
- };
49
- ref: null | {
50
- table: string;
51
- };
38
+ /** A `select` / `multi_select` field's choices; null on every other type. */
39
+ options: string[] | null;
40
+ ref: null | TableRef;
41
+ /** No two rows of the table hold the same value (18-record-search-index §4.5). */
42
+ unique?: true;
52
43
  deprecated?: boolean;
53
44
  };
54
- export type RuntimeDerivedFieldDef = {
55
- derived: true;
56
- label: string;
57
- dataType: DataType;
58
- dependsOn: FieldPath[];
59
- computeFn: string;
60
- deprecated?: boolean;
61
- };
62
- export type RuntimeFieldDef = RuntimeNormalFieldDef | RuntimeDerivedFieldDef;
63
45
  export type RuntimeTableDef = {
64
46
  label: string;
65
- rows: 'single' | 'multi';
66
47
  description: string;
67
48
  fields: Record<string, RuntimeFieldDef>;
68
49
  };
69
50
  /**
70
- * Compiled schema: one key per table, plus derived graph.
71
- * `derivedOrder` / `reverseDeps` are reserved and cannot be table names.
51
+ * Compiled schema: one key per table. Builds compiled before V1.16 also carry `derivedOrder` /
52
+ * `reverseDeps` (always empty there); those names stay reserved and are skipped when reading.
72
53
  */
73
54
  export type CompiledSlotSchema = {
74
- /** Derived fields in topological order (dependencies first). */
75
- derivedOrder: FieldPath[];
76
- /** `table.field` → derived fields that list it in dependsOn. */
77
- reverseDeps: Record<FieldPath, FieldPath[]>;
78
- [table: string]: RuntimeTableDef | FieldPath[] | Record<FieldPath, FieldPath[]>;
79
- };
80
- export type SlotCurrent = {
81
- contactId: string;
82
- caseContactId: string;
83
- caseFileId: string;
84
- sessionId: string | null;
55
+ [table: string]: RuntimeTableDef;
85
56
  };
86
57
  export type SingleRowTableData = {
87
58
  id: string;
@@ -93,15 +64,6 @@ export type MultiRowRecord = {
93
64
  [field: string]: FieldValue | string;
94
65
  };
95
66
  export type MultiRowTableData = MultiRowRecord[];
96
- export type TableData = SingleRowTableData | MultiRowTableData;
97
- /**
98
- * Runtime snapshot: `current` plus one key per table.
99
- * `current` is reserved and cannot be a table name.
100
- */
101
- export type RuntimeSlotsSnapshot = {
102
- current?: SlotCurrent;
103
- [table: string]: TableData | SlotCurrent | undefined;
104
- };
105
67
  export type ValidationIssue = {
106
68
  code: string;
107
69
  message: string;
@@ -113,32 +75,5 @@ export type ValidationResult = {
113
75
  ok: false;
114
76
  issues: ValidationIssue[];
115
77
  };
116
- export type WriteSource = Exclude<UpdatedBy, 'derived'>;
117
- export type ApplyWritesOptions = {
118
- source: WriteSource;
119
- now?: number;
120
- /** When true (default for function/platform), only `source: system` normals. */
121
- systemOnly?: boolean;
122
- };
123
- export type ApplyWritesResult = {
124
- snapshot: RuntimeSlotsSnapshot;
125
- changed: FieldPath[];
126
- /** Previous generations archived into field envelopes this batch. */
127
- history: HistoryAppend[];
128
- };
129
- export type RecomputeResult = {
130
- snapshot: RuntimeSlotsSnapshot;
131
- changed: FieldPath[];
132
- history: HistoryAppend[];
133
- };
134
- export type SlotFillingValidateResult = {
135
- ok: true;
136
- accepted: SlotFillingOutput;
137
- /** Fields that failed type/enum checks — caller may re-extract. */
138
- rejected: FieldPath[];
139
- } | {
140
- ok: false;
141
- reason: 'stale-version' | 'invalid-shape';
142
- issues: ValidationIssue[];
143
- };
78
+ export type WriteSource = UpdatedBy;
144
79
  //# sourceMappingURL=types.d.ts.map
@@ -1,9 +1,32 @@
1
1
  import type { DataType } from './schema.js';
2
- import type { ExtractedField, RuntimeFieldDef, RuntimeNormalFieldDef, ValidationIssue } from './types.js';
2
+ import type { RuntimeFieldDef, ValidationIssue } from './types.js';
3
+ /** date values slot filling must write. Partial precision is the coarse form C3 still accepts. */
4
+ export declare const DATE_VALUE_PATTERN: string;
5
+ export declare const DATE_VALUE_FORMAT = "YYYY, YYYY-MM, or YYYY-MM-DD";
6
+ /** ISO-8601 datetime with a timezone offset or Z. */
7
+ export declare const DATETIME_VALUE_PATTERN: string;
8
+ export declare const DATETIME_VALUE_FORMAT = "ISO-8601 datetime with a timezone offset or Z";
9
+ /** A time of day (27 §4): `HH:mm`, 24-hour, `00:00`–`23:59`. */
10
+ export declare const TIME_VALUE_PATTERN: string;
11
+ export declare const TIME_VALUE_FORMAT = "a time of day HH:mm, 24-hour (15:30)";
12
+ /**
13
+ * A `phone` value as stored: E.164, any country, with an extension in RFC 3966 form when there is one
14
+ * (`+14155550123;ext=123`). The write entry converts what it is given first.
15
+ */
16
+ export declare const PHONE_VALUE_PATTERN: string;
17
+ /** An `email` value as stored: lower-cased (the write entry lower-cases what it is given first). */
18
+ export declare const EMAIL_VALUE_PATTERN: string;
19
+ /** Characters of a string, as Postgres and people count them (a surrogate pair is one). */
20
+ export declare function stringChars(value: string): number;
21
+ /** UTF-8 bytes of a string. */
22
+ export declare function utf8Bytes(value: string): number;
23
+ /** What a value of `dataType` must look like, for messages. */
24
+ export declare function dataTypeFormat(dataType: DataType): string;
3
25
  export declare function isValidDataTypeValue(dataType: DataType, value: unknown): boolean;
4
- export declare function validateExtractedField(field: RuntimeNormalFieldDef, extracted: ExtractedField, path: string): ValidationIssue[];
5
- /** Validate a bare write value for a normal or derived field. */
26
+ /** Validate a bare write value for a field. */
6
27
  export declare function validateBareValue(field: RuntimeFieldDef, value: unknown, path: string, options?: {
7
28
  allowNull?: boolean;
8
29
  }): ValidationIssue[];
30
+ /** What of a `select` / `multi_select` value is not one of the field's options; empty for any other field. */
31
+ export declare function optionsOutside(field: Pick<RuntimeFieldDef, 'options'>, value: unknown): unknown[];
9
32
  //# sourceMappingURL=value.d.ts.map
@@ -1,12 +1,75 @@
1
- const DATE_RE = /^\d{4}(-\d{2}(-\d{2})?)?$/;
2
- // ISO-8601 datetime with timezone offset or Z
3
- const DATETIME_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
1
+ import { LIMITS } from './company-metadata.js';
2
+ import { contactScheduleValueSchema } from './schema.js';
3
+ /** date values slot filling must write. Partial precision is the coarse form C3 still accepts. */
4
+ export const DATE_VALUE_PATTERN = String.raw `^\d{4}(-\d{2}(-\d{2})?)?$`;
5
+ export const DATE_VALUE_FORMAT = 'YYYY, YYYY-MM, or YYYY-MM-DD';
6
+ /** ISO-8601 datetime with a timezone offset or Z. */
7
+ export const DATETIME_VALUE_PATTERN = String.raw `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$`;
8
+ export const DATETIME_VALUE_FORMAT = 'ISO-8601 datetime with a timezone offset or Z';
9
+ /** A time of day (27 §4): `HH:mm`, 24-hour, `00:00`–`23:59`. */
10
+ export const TIME_VALUE_PATTERN = String.raw `^(?:[01]\d|2[0-3]):[0-5]\d$`;
11
+ export const TIME_VALUE_FORMAT = 'a time of day HH:mm, 24-hour (15:30)';
12
+ /**
13
+ * A `phone` value as stored: E.164, any country, with an extension in RFC 3966 form when there is one
14
+ * (`+14155550123;ext=123`). The write entry converts what it is given first.
15
+ */
16
+ export const PHONE_VALUE_PATTERN = String.raw `^\+[1-9]\d{6,14}(;ext=\d{1,10})?$`;
17
+ /** An `email` value as stored: lower-cased (the write entry lower-cases what it is given first). */
18
+ export const EMAIL_VALUE_PATTERN = String.raw `^[^\sA-Z@]+@[^\sA-Z@]+\.[^\sA-Z@]+$`;
19
+ const DATE_RE = new RegExp(DATE_VALUE_PATTERN);
20
+ const DATETIME_RE = new RegExp(DATETIME_VALUE_PATTERN);
21
+ const TIME_RE = new RegExp(TIME_VALUE_PATTERN);
22
+ const PHONE_RE = new RegExp(PHONE_VALUE_PATTERN);
23
+ const EMAIL_RE = new RegExp(EMAIL_VALUE_PATTERN);
24
+ const utf8 = new TextEncoder();
25
+ /** Characters of a string, as Postgres and people count them (a surrogate pair is one). */
26
+ export function stringChars(value) {
27
+ let count = 0;
28
+ for (const _ of value)
29
+ count += 1;
30
+ return count;
31
+ }
32
+ /** UTF-8 bytes of a string. */
33
+ export function utf8Bytes(value) {
34
+ return utf8.encode(value).length;
35
+ }
36
+ /** What a value of `dataType` must look like, for messages. */
37
+ export function dataTypeFormat(dataType) {
38
+ switch (dataType) {
39
+ case 'string':
40
+ return `a string of at most ${LIMITS.stringChars} characters (use text for longer)`;
41
+ case 'text':
42
+ return `a string of at most ${LIMITS.textBytes} bytes`;
43
+ case 'phone':
44
+ return 'a phone number, any country (stored as E.164, e.g. +14155550123; with an extension +14155550123;ext=12)';
45
+ case 'email':
46
+ return 'an email address';
47
+ case 'date':
48
+ return DATE_VALUE_FORMAT;
49
+ case 'datetime':
50
+ return DATETIME_VALUE_FORMAT;
51
+ case 'time':
52
+ return TIME_VALUE_FORMAT;
53
+ case 'select':
54
+ return 'one of its options';
55
+ case 'multi_select':
56
+ return 'a list of its options ([] for none of them)';
57
+ default:
58
+ return dataType;
59
+ }
60
+ }
4
61
  export function isValidDataTypeValue(dataType, value) {
5
62
  if (value === null)
6
63
  return true;
7
64
  switch (dataType) {
8
65
  case 'string':
9
- return typeof value === 'string';
66
+ return typeof value === 'string' && stringChars(value) <= LIMITS.stringChars;
67
+ case 'text':
68
+ return typeof value === 'string' && utf8Bytes(value) <= LIMITS.textBytes;
69
+ case 'phone':
70
+ return typeof value === 'string' && PHONE_RE.test(value);
71
+ case 'email':
72
+ return typeof value === 'string' && EMAIL_RE.test(value);
10
73
  case 'number':
11
74
  return typeof value === 'number' && Number.isFinite(value);
12
75
  case 'boolean':
@@ -15,61 +78,22 @@ export function isValidDataTypeValue(dataType, value) {
15
78
  return typeof value === 'string' && DATE_RE.test(value);
16
79
  case 'datetime':
17
80
  return typeof value === 'string' && DATETIME_RE.test(value);
81
+ case 'time':
82
+ return typeof value === 'string' && TIME_RE.test(value);
83
+ case 'select':
84
+ return typeof value === 'string';
85
+ case 'multi_select':
86
+ return Array.isArray(value) && value.every((item) => typeof item === 'string');
87
+ case 'contact_schedule':
88
+ return contactScheduleValueSchema.safeParse(value).success;
18
89
  }
19
90
  }
20
- export function validateExtractedField(field, extracted, path) {
21
- const issues = [];
22
- if (typeof extracted.reason !== 'string' || extracted.reason.length === 0) {
23
- issues.push({
24
- code: 'missing-reason',
25
- message: 'Extracted field requires a non-empty reason',
26
- path,
27
- });
28
- }
29
- if (extracted.state !== 'filled' && extracted.state !== 'asked_unknown' && extracted.state !== 'declined') {
30
- issues.push({
31
- code: 'invalid-state',
32
- message: `Invalid extracted state: ${String(extracted.state)}`,
33
- path,
34
- });
35
- return issues;
36
- }
37
- if (extracted.state === 'declined' && extracted.value !== null) {
38
- issues.push({
39
- code: 'declined-non-null',
40
- message: 'declined fields must have value null',
41
- path,
42
- });
43
- }
44
- if (extracted.state === 'filled' && extracted.value === null && !field.nullable) {
45
- issues.push({
46
- code: 'filled-null',
47
- message: 'filled requires non-null value unless nullable: true',
48
- path,
49
- });
50
- }
51
- if (extracted.value !== null && !isValidDataTypeValue(field.dataType, extracted.value)) {
52
- issues.push({
53
- code: 'type-mismatch',
54
- message: `value does not match dataType ${field.dataType}`,
55
- path,
56
- });
57
- }
58
- if (extracted.value !== null && field.enum && !field.enum.includes(extracted.value)) {
59
- issues.push({
60
- code: 'enum-mismatch',
61
- message: `value ${String(extracted.value)} not in enum`,
62
- path,
63
- });
64
- }
65
- return issues;
66
- }
67
- /** Validate a bare write value for a normal or derived field. */
91
+ /** Validate a bare write value for a field. */
68
92
  export function validateBareValue(field, value, path, options = {}) {
69
93
  const issues = [];
70
94
  const allowNull = options.allowNull ?? true;
71
95
  if (value === null || value === undefined) {
72
- if (!allowNull && !(field.derived === false && field.nullable)) {
96
+ if (!allowNull) {
73
97
  issues.push({
74
98
  code: 'null-not-allowed',
75
99
  message: 'null is not allowed for this field',
@@ -81,17 +105,25 @@ export function validateBareValue(field, value, path, options = {}) {
81
105
  if (!isValidDataTypeValue(field.dataType, value)) {
82
106
  issues.push({
83
107
  code: 'type-mismatch',
84
- message: `value does not match dataType ${field.dataType}`,
108
+ message: `value does not match dataType ${field.dataType}: expected ${dataTypeFormat(field.dataType)}`,
85
109
  path,
86
110
  });
87
111
  }
88
- if (!field.derived && field.enum && !field.enum.includes(value)) {
112
+ const outside = optionsOutside(field, value);
113
+ if (outside.length > 0) {
89
114
  issues.push({
90
- code: 'enum-mismatch',
91
- message: `value ${String(value)} not in enum`,
115
+ code: 'not-an-option',
116
+ message: `${outside.map((v) => JSON.stringify(v)).join(', ')} not one of the options (${field.options.join(', ')})`,
92
117
  path,
93
118
  });
94
119
  }
95
120
  return issues;
96
121
  }
122
+ /** What of a `select` / `multi_select` value is not one of the field's options; empty for any other field. */
123
+ export function optionsOutside(field, value) {
124
+ if (!field.options)
125
+ return [];
126
+ const items = Array.isArray(value) ? value : [value];
127
+ return items.filter((item) => !field.options.includes(item));
128
+ }
97
129
  //# sourceMappingURL=value.js.map
@@ -1,10 +1,17 @@
1
1
  import type { ActionDataSlice } from '../fn-context/types.js';
2
- import type { SequenceBuild } from '../builder/types.js';
2
+ import type { CompanyBuild } from '../builder/types.js';
3
+ import type { CompiledCompanyMetadata } from '../core/slot/schema.js';
4
+ import type { ComputeInvocation } from '../compute-host/compute-host.js';
5
+ /**
6
+ * Serve takes the whole environment (22-sequence-as-business-unit §6): while a session holds it, every
7
+ * sequence there runs the local repository's code, and one with no local directory has none.
8
+ */
3
9
  export type OverlayAuthMessage = {
4
10
  type: 'auth';
5
- apiKey: string;
6
- companyId: string;
7
- names?: string[];
11
+ /** Browser-issued, serve-scoped token. */
12
+ token: string;
13
+ /** Required environment id. */
14
+ environment?: string;
8
15
  };
9
16
  export type OverlayAuthOkMessage = {
10
17
  type: 'auth.ok';
@@ -12,23 +19,49 @@ export type OverlayAuthOkMessage = {
12
19
  export type OverlayAuthErrorMessage = {
13
20
  type: 'auth.error';
14
21
  error: string;
22
+ /**
23
+ * No default on the sending side — every send site picks one explicitly (see gateway-state.ts's
24
+ * `rejectAuth` and gateway-connection.ts's `failAuth`), so a future call site can't silently
25
+ * inherit the wrong one. The CLI (`toOverlayError` in packages/runtime/src/cli/serve/index.ts)
26
+ * maps each code to how it reacts.
27
+ * `authorization`: the serve token is invalid/expired, or a heartbeat found the user's access to
28
+ * the company was revoked — re-authenticate and retry.
29
+ * `unavailable`: a transient condition (infra hiccup, an unexpected internal error, a lease that
30
+ * was just replaced) — retry with backoff, no user action needed.
31
+ * `request`: the request itself is permanently invalid (missing or unknown environment, prod) —
32
+ * retrying the same request will never succeed; stop and tell the user.
33
+ */
34
+ code: 'authorization' | 'unavailable' | 'request';
15
35
  };
36
+ /** Another serve took the environment: this session ends. */
16
37
  export type OverlayReplacedMessage = {
17
38
  type: 'replaced';
18
39
  };
19
40
  export declare const OVERLAY_REPLACED_CLOSE_CODE = 4000;
41
+ /**
42
+ * Informational only: the session keeps serving. Sent e.g. when the pushed company schema is not
43
+ * backward compatible with this environment's or prod's live release.
44
+ */
45
+ export type OverlayNoticeMessage = {
46
+ type: 'notice';
47
+ message: string;
48
+ details: string[];
49
+ };
50
+ /** The local company build, every sequence of the repository; each push replaces the previous one. */
20
51
  export type OverlayPushMessage = {
21
52
  type: 'overlay';
22
- sequenceId: string;
23
53
  generation: number;
24
- build: SequenceBuild;
54
+ build: CompanyBuild;
55
+ /** Company metadata compiled from the local `schema/`; the backend uses it while serving. */
56
+ companyMetadata: CompiledCompanyMetadata;
25
57
  };
26
58
  export type OverlayExecuteMessage = {
27
59
  type: 'execute';
28
60
  requestId: string;
61
+ /** The sequence's directory name. */
29
62
  sequenceId: string;
30
63
  name: string;
31
- args?: unknown[];
64
+ invocation?: ComputeInvocation;
32
65
  data?: ActionDataSlice;
33
66
  runToken?: string;
34
67
  /** Logger request id for `ctx.api` RPC; not the overlay execute correlation id. */
@@ -48,7 +81,7 @@ export type OverlayExecuteResultMessage = {
48
81
  error: string;
49
82
  };
50
83
  export type OverlayClientMessage = OverlayAuthMessage | OverlayPushMessage | OverlayExecuteResultMessage;
51
- export type OverlayServerMessage = OverlayAuthOkMessage | OverlayAuthErrorMessage | OverlayReplacedMessage | OverlayExecuteMessage;
84
+ export type OverlayServerMessage = OverlayAuthOkMessage | OverlayAuthErrorMessage | OverlayReplacedMessage | OverlayExecuteMessage | OverlayNoticeMessage;
52
85
  export type OverlayMessage = OverlayClientMessage | OverlayServerMessage;
53
86
  export declare function encodeOverlayMessage(message: OverlayMessage): string;
54
87
  export declare function parseOverlayMessage(raw: string): OverlayMessage;
@@ -1,4 +1,4 @@
1
- import type { ActionContext, ActionDataSlice, ApiHost, RunScope } from './types.js';
1
+ import type { ActionContext, ActionDataSlice, ApiHost, CaseOrchestratorActionContext, CaseOrchestratorApiHost, RunScope } from './types.js';
2
2
  export type BuildActionContextOptions = {
3
3
  /** Defaults from `data.meta` when omitted. */
4
4
  run?: Partial<RunScope>;
@@ -8,4 +8,6 @@ export type BuildActionContextOptions = {
8
8
  * Shared by local unit, remote-fc, and (later) Worker-side invoke.
9
9
  */
10
10
  export declare function buildActionContext(data: ActionDataSlice, host: ApiHost, options?: BuildActionContextOptions): Promise<ActionContext>;
11
+ /** Assemble the `orchestrator` ctx (without `params`), its api from the host. */
12
+ export declare function buildCaseOrchestratorContext(data: ActionDataSlice, host: CaseOrchestratorApiHost, options?: BuildActionContextOptions): Promise<CaseOrchestratorActionContext>;
11
13
  //# sourceMappingURL=build-context.d.ts.map