@superpanel-sdk/runtime 0.2.3 → 0.7.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 (319) hide show
  1. package/README.md +30 -10
  2. package/dist/builder/codegen/emit.d.ts +25 -12
  3. package/dist/builder/codegen/emit.js +339 -78
  4. package/dist/builder/codegen/generate.d.ts +21 -2
  5. package/dist/builder/codegen/generate.js +147 -34
  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 +29 -0
  9. package/dist/builder/company-imports.js +122 -0
  10. package/dist/builder/compile/compile-sequence.d.ts +61 -8
  11. package/dist/builder/compile/compile-sequence.js +334 -80
  12. package/dist/builder/compile/function-code.d.ts +19 -3
  13. package/dist/builder/compile/function-code.js +123 -45
  14. package/dist/builder/compile/registry.d.ts +7 -3
  15. package/dist/builder/compile/registry.js +30 -27
  16. package/dist/builder/errors.d.ts +9 -0
  17. package/dist/builder/errors.js +17 -0
  18. package/dist/builder/function-params.d.ts +10 -0
  19. package/dist/builder/function-params.js +203 -0
  20. package/dist/builder/load.d.ts +70 -10
  21. package/dist/builder/load.js +258 -67
  22. package/dist/builder/paths.d.ts +9 -1
  23. package/dist/builder/paths.js +32 -2
  24. package/dist/builder/schedules.d.ts +25 -0
  25. package/dist/builder/schedules.js +101 -0
  26. package/dist/builder/slot-schema-validation.d.ts +4 -0
  27. package/dist/builder/slot-schema-validation.js +10 -0
  28. package/dist/builder/typecheck.d.ts +8 -0
  29. package/dist/builder/typecheck.js +102 -0
  30. package/dist/builder/types.d.ts +127 -19
  31. package/dist/builder/types.js +21 -1
  32. package/dist/cli/auth/auth.d.ts +37 -0
  33. package/dist/cli/auth/auth.js +211 -0
  34. package/dist/cli/auth/backend-url.d.ts +5 -0
  35. package/dist/cli/auth/backend-url.js +25 -0
  36. package/dist/cli/auth/clipboard.d.ts +9 -0
  37. package/dist/cli/auth/clipboard.js +38 -0
  38. package/dist/cli/auth/http.d.ts +20 -0
  39. package/dist/cli/auth/http.js +27 -0
  40. package/dist/cli/auth/index.d.ts +10 -0
  41. package/dist/cli/auth/index.js +27 -0
  42. package/dist/cli/auth/progress.d.ts +12 -0
  43. package/dist/cli/auth/progress.js +15 -0
  44. package/dist/cli/auth/serve-login.d.ts +8 -0
  45. package/dist/cli/auth/serve-login.js +24 -0
  46. package/dist/cli/calls/index.d.ts +177 -0
  47. package/dist/cli/calls/index.js +96 -0
  48. package/dist/cli/compile/index.js +3 -0
  49. package/dist/cli/config.d.ts +10 -0
  50. package/dist/cli/config.js +52 -0
  51. package/dist/cli/debug/index.d.ts +31 -0
  52. package/dist/cli/debug/index.js +119 -0
  53. package/dist/cli/exec/index.d.ts +39 -0
  54. package/dist/cli/exec/index.js +138 -0
  55. package/dist/cli/exec/session.d.ts +48 -0
  56. package/dist/cli/exec/session.js +82 -0
  57. package/dist/cli/exec/trace.d.ts +18 -0
  58. package/dist/cli/exec/trace.js +52 -0
  59. package/dist/cli/index.js +112 -9
  60. package/dist/cli/logs/index.d.ts +47 -0
  61. package/dist/cli/logs/index.js +113 -0
  62. package/dist/cli/mobile/index.d.ts +12 -0
  63. package/dist/cli/mobile/index.js +405 -0
  64. package/dist/cli/serve/index.d.ts +109 -3
  65. package/dist/cli/serve/index.js +506 -118
  66. package/dist/cli/turns/index.d.ts +105 -0
  67. package/dist/cli/turns/index.js +128 -0
  68. package/dist/cli/turns/run.d.ts +13 -0
  69. package/dist/cli/turns/run.js +57 -0
  70. package/dist/cli/turns/shadow.d.ts +112 -0
  71. package/dist/cli/turns/shadow.js +54 -0
  72. package/dist/cli/type-gen/index.js +9 -9
  73. package/dist/compiler.d.ts +7 -0
  74. package/dist/compiler.js +7 -0
  75. package/dist/compute-host/compute-host.d.ts +14 -23
  76. package/dist/compute-host/compute-host.js +18 -30
  77. package/dist/compute-host/index.d.ts +2 -4
  78. package/dist/compute-host/index.js +1 -2
  79. package/dist/compute-host/source-compute-host.d.ts +10 -10
  80. package/dist/compute-host/source-compute-host.js +33 -40
  81. package/dist/core/case-orchestrator/contact-hours.d.ts +70 -0
  82. package/dist/core/case-orchestrator/contact-hours.js +127 -0
  83. package/dist/core/case-orchestrator/index.d.ts +3 -0
  84. package/dist/core/case-orchestrator/index.js +3 -0
  85. package/dist/core/case-orchestrator/render.d.ts +75 -0
  86. package/dist/core/case-orchestrator/render.js +244 -0
  87. package/dist/core/case-orchestrator/time.d.ts +11 -0
  88. package/dist/core/case-orchestrator/time.js +29 -0
  89. package/dist/core/case-orchestrator/types.d.ts +708 -0
  90. package/dist/core/case-orchestrator/types.js +42 -0
  91. package/dist/core/context/call.d.ts +291 -0
  92. package/dist/core/context/call.js +94 -0
  93. package/dist/core/context/channels.d.ts +60 -0
  94. package/dist/core/context/channels.js +35 -0
  95. package/dist/core/context/contact.d.ts +96 -6
  96. package/dist/core/context/contact.js +48 -2
  97. package/dist/core/context/email-message.d.ts +198 -0
  98. package/dist/core/context/email-message.js +86 -0
  99. package/dist/core/context/email.d.ts +109 -0
  100. package/dist/core/context/email.js +90 -0
  101. package/dist/core/context/exchanges.d.ts +167 -0
  102. package/dist/core/context/exchanges.js +81 -0
  103. package/dist/core/context/instances.d.ts +307 -0
  104. package/dist/core/context/instances.js +137 -0
  105. package/dist/core/context/kv.d.ts +113 -0
  106. package/dist/core/context/kv.js +60 -0
  107. package/dist/core/context/platform-registry.d.ts +544 -4
  108. package/dist/core/context/platform-registry.js +14 -2
  109. package/dist/core/context/platform.d.ts +2 -1
  110. package/dist/core/context/sms.d.ts +177 -0
  111. package/dist/core/context/sms.js +77 -0
  112. package/dist/core/context/types.d.ts +79 -48
  113. package/dist/core/context/types.js +1 -7
  114. package/dist/core/conversation/index.d.ts +85 -0
  115. package/dist/core/conversation/index.js +133 -0
  116. package/dist/core/functions/errors.d.ts +74 -0
  117. package/dist/core/functions/errors.js +26 -0
  118. package/dist/core/functions/events.d.ts +192 -0
  119. package/dist/core/functions/events.js +23 -0
  120. package/dist/core/functions/schedules.d.ts +50 -0
  121. package/dist/core/functions/schedules.js +20 -0
  122. package/dist/core/functions/types.d.ts +29 -73
  123. package/dist/core/functions/types.js +1 -4
  124. package/dist/core/office-hours/index.d.ts +39 -0
  125. package/dist/core/office-hours/index.js +187 -0
  126. package/dist/core/page/define.d.ts +904 -0
  127. package/dist/core/page/define.js +518 -0
  128. package/dist/core/page/envelope.d.ts +55 -0
  129. package/dist/core/page/envelope.js +4 -0
  130. package/dist/core/page/fns.d.ts +448 -0
  131. package/dist/core/page/fns.js +539 -0
  132. package/dist/core/page/memory-reader.d.ts +27 -0
  133. package/dist/core/page/memory-reader.js +299 -0
  134. package/dist/core/page/ops.d.ts +58 -0
  135. package/dist/core/page/ops.js +220 -0
  136. package/dist/core/page/page-host.d.ts +20 -0
  137. package/dist/core/page/page-host.js +57 -0
  138. package/dist/core/page/records-query.d.ts +234 -0
  139. package/dist/core/page/records-query.js +780 -0
  140. package/dist/core/page/render.d.ts +295 -0
  141. package/dist/core/page/render.js +1060 -0
  142. package/dist/core/page/sandbox.d.ts +85 -0
  143. package/dist/core/page/sandbox.js +357 -0
  144. package/dist/core/page/time-format.d.ts +46 -0
  145. package/dist/core/page/time-format.js +125 -0
  146. package/dist/core/page/timeline.d.ts +40 -0
  147. package/dist/core/page/timeline.js +2 -0
  148. package/dist/core/page/typed.d.ts +648 -0
  149. package/dist/core/page/typed.js +2 -0
  150. package/dist/core/page/workspace.d.ts +57 -0
  151. package/dist/core/page/workspace.js +266 -0
  152. package/dist/core/party/index.d.ts +3 -0
  153. package/dist/core/party/index.js +3 -0
  154. package/dist/core/party/schema.d.ts +208 -0
  155. package/dist/core/party/schema.js +113 -0
  156. package/dist/core/party/types.d.ts +35 -0
  157. package/dist/core/party/types.js +15 -0
  158. package/dist/core/sequence/define.d.ts +56 -0
  159. package/dist/core/sequence/define.js +10 -0
  160. package/dist/core/sequence/index.d.ts +63 -0
  161. package/dist/core/sequence/index.js +231 -0
  162. package/dist/core/slot/binding.d.ts +40 -0
  163. package/dist/core/slot/binding.js +2 -0
  164. package/dist/core/slot/company-metadata.d.ts +102 -0
  165. package/dist/core/slot/company-metadata.js +536 -0
  166. package/dist/core/slot/compile-schema.d.ts +19 -13
  167. package/dist/core/slot/compile-schema.js +51 -248
  168. package/dist/core/slot/contact-timezone.d.ts +110 -0
  169. package/dist/core/slot/contact-timezone.js +186 -0
  170. package/dist/core/slot/field.d.ts +2 -25
  171. package/dist/core/slot/field.js +0 -71
  172. package/dist/core/slot/id-ref.d.ts +17 -2
  173. package/dist/core/slot/id-ref.js +16 -8
  174. package/dist/core/slot/index.d.ts +12 -13
  175. package/dist/core/slot/index.js +11 -12
  176. package/dist/core/slot/naming.d.ts +15 -0
  177. package/dist/core/slot/naming.js +96 -0
  178. package/dist/core/slot/platform-fields.d.ts +119 -0
  179. package/dist/core/slot/platform-fields.js +121 -0
  180. package/dist/core/slot/ref.d.ts +16 -0
  181. package/dist/core/slot/ref.js +14 -0
  182. package/dist/core/slot/row.d.ts +2 -9
  183. package/dist/core/slot/row.js +13 -23
  184. package/dist/core/slot/schema-compat.d.ts +17 -0
  185. package/dist/core/slot/schema-compat.js +103 -0
  186. package/dist/core/slot/schema.d.ts +353 -76
  187. package/dist/core/slot/schema.js +163 -10
  188. package/dist/core/slot/types.d.ts +30 -103
  189. package/dist/core/slot/value.d.ts +28 -3
  190. package/dist/core/slot/value.js +93 -57
  191. package/dist/dev-overlay/protocol.d.ts +74 -8
  192. package/dist/fn-context/build-context.d.ts +3 -1
  193. package/dist/fn-context/build-context.js +26 -10
  194. package/dist/fn-context/fake/empty-api.js +9 -28
  195. package/dist/fn-context/fake/index.d.ts +13 -4
  196. package/dist/fn-context/fake/index.js +29 -2
  197. package/dist/fn-context/fn-params.d.ts +3 -0
  198. package/dist/fn-context/fn-params.js +10 -0
  199. package/dist/fn-context/index.d.ts +5 -5
  200. package/dist/fn-context/index.js +4 -4
  201. package/dist/fn-context/log.js +2 -2
  202. package/dist/fn-context/make-ctx.d.ts +11 -0
  203. package/dist/fn-context/make-ctx.js +20 -9
  204. package/dist/fn-context/rpc/case-orchestrator-tools.d.ts +32 -0
  205. package/dist/fn-context/rpc/case-orchestrator-tools.js +12 -0
  206. package/dist/fn-context/rpc/errors.d.ts +13 -0
  207. package/dist/fn-context/rpc/errors.js +22 -0
  208. package/dist/fn-context/rpc/index.d.ts +4 -2
  209. package/dist/fn-context/rpc/index.js +4 -2
  210. package/dist/fn-context/rpc/integration/index.d.ts +15 -5
  211. package/dist/fn-context/rpc/integration/index.js +1 -1
  212. package/dist/fn-context/rpc/integration/list-surfaces.d.ts +21 -0
  213. package/dist/fn-context/rpc/integration/{list-bindings.js → list-surfaces.js} +4 -4
  214. package/dist/fn-context/rpc/log.d.ts +11 -1
  215. package/dist/fn-context/rpc/platform.d.ts +13 -3
  216. package/dist/fn-context/rpc/platform.js +1 -1
  217. package/dist/fn-context/rpc/records.d.ts +85 -0
  218. package/dist/fn-context/rpc/records.js +24 -0
  219. package/dist/fn-context/rpc/trpc-client.d.ts +44 -2
  220. package/dist/fn-context/rpc/trpc-client.js +222 -12
  221. package/dist/fn-context/rpc/trpc-init.d.ts +21 -3
  222. package/dist/fn-context/rpc/trpc-init.js +10 -4
  223. package/dist/fn-context/rpc/trpc-router-factory.d.ts +111 -7
  224. package/dist/fn-context/rpc/trpc-router-factory.js +2 -0
  225. package/dist/fn-context/run-scope.d.ts +4 -0
  226. package/dist/fn-context/run-scope.js +9 -0
  227. package/dist/fn-context/types.d.ts +52 -5
  228. package/dist/index.d.ts +36 -46
  229. package/dist/index.js +30 -33
  230. package/dist/logger.d.ts +11 -0
  231. package/dist/logger.js +49 -0
  232. package/dist/platform.d.ts +75 -0
  233. package/dist/platform.js +57 -0
  234. package/dist/testing-compile-child.d.ts +2 -0
  235. package/dist/testing-compile-child.js +20 -0
  236. package/dist/testing.d.ts +368 -0
  237. package/dist/testing.js +439 -0
  238. package/dist/voice-service/actions.d.ts +50 -6
  239. package/dist/voice-service/index.d.ts +2 -0
  240. package/dist/voice-service/index.js +2 -0
  241. package/dist/voice-service/protocol.d.ts +604 -0
  242. package/dist/voice-service/protocol.js +67 -0
  243. package/dist/voice-service/types.d.ts +55 -8
  244. package/dist/worker.d.ts +11 -0
  245. package/dist/worker.js +11 -0
  246. package/package.json +38 -15
  247. package/dist/builder/compile/compile-agenda.d.ts +0 -15
  248. package/dist/builder/compile/compile-agenda.js +0 -64
  249. package/dist/builder/merge.d.ts +0 -4
  250. package/dist/builder/merge.js +0 -19
  251. package/dist/compute-host/read-only-cache.d.ts +0 -20
  252. package/dist/compute-host/read-only-cache.js +0 -61
  253. package/dist/core/context/db.d.ts +0 -69
  254. package/dist/core/context/db.js +0 -44
  255. package/dist/core/context/docusign.d.ts +0 -134
  256. package/dist/core/context/docusign.js +0 -108
  257. package/dist/core/context/filevine.d.ts +0 -323
  258. package/dist/core/context/filevine.js +0 -254
  259. package/dist/core/context/http.d.ts +0 -9
  260. package/dist/core/context/http.js +0 -4
  261. package/dist/core/context/hubspot.d.ts +0 -250
  262. package/dist/core/context/hubspot.js +0 -191
  263. package/dist/core/context/twilio.d.ts +0 -50
  264. package/dist/core/context/twilio.js +0 -42
  265. package/dist/core/functions/define/case-context.d.ts +0 -14
  266. package/dist/core/functions/define/case-context.js +0 -15
  267. package/dist/core/functions/define/compute.d.ts +0 -7
  268. package/dist/core/functions/define/compute.js +0 -17
  269. package/dist/core/functions/define/custom.d.ts +0 -4
  270. package/dist/core/functions/define/custom.js +0 -8
  271. package/dist/core/functions/define/system.d.ts +0 -7
  272. package/dist/core/functions/define/system.js +0 -12
  273. package/dist/core/functions/func-ref.d.ts +0 -16
  274. package/dist/core/functions/func-ref.js +0 -20
  275. package/dist/core/slot/deps.d.ts +0 -15
  276. package/dist/core/slot/deps.js +0 -88
  277. package/dist/core/slot/derived.d.ts +0 -32
  278. package/dist/core/slot/derived.js +0 -115
  279. package/dist/core/slot/platform-session-fields.d.ts +0 -38
  280. package/dist/core/slot/platform-session-fields.js +0 -48
  281. package/dist/core/slot/sf-schema.d.ts +0 -23
  282. package/dist/core/slot/sf-schema.js +0 -125
  283. package/dist/core/slot/sf-validate.d.ts +0 -14
  284. package/dist/core/slot/sf-validate.js +0 -132
  285. package/dist/core/slot/snapshot.d.ts +0 -18
  286. package/dist/core/slot/snapshot.js +0 -138
  287. package/dist/core/slot/write.d.ts +0 -48
  288. package/dist/core/slot/write.js +0 -426
  289. package/dist/core/stage/builders.d.ts +0 -54
  290. package/dist/core/stage/builders.js +0 -31
  291. package/dist/core/stage/condition.d.ts +0 -17
  292. package/dist/core/stage/condition.js +0 -198
  293. package/dist/core/stage/drive.d.ts +0 -43
  294. package/dist/core/stage/drive.js +0 -78
  295. package/dist/core/stage/finish-when.d.ts +0 -20
  296. package/dist/core/stage/finish-when.js +0 -82
  297. package/dist/core/stage/flatten.d.ts +0 -27
  298. package/dist/core/stage/flatten.js +0 -466
  299. package/dist/core/stage/index.d.ts +0 -15
  300. package/dist/core/stage/index.js +0 -13
  301. package/dist/core/stage/interrupts.d.ts +0 -28
  302. package/dist/core/stage/interrupts.js +0 -120
  303. package/dist/core/stage/ivr-fields.d.ts +0 -9
  304. package/dist/core/stage/ivr-fields.js +0 -75
  305. package/dist/core/stage/simulate.d.ts +0 -24
  306. package/dist/core/stage/simulate.js +0 -33
  307. package/dist/core/stage/transfer-fields.d.ts +0 -19
  308. package/dist/core/stage/transfer-fields.js +0 -129
  309. package/dist/core/stage/transfer-spec.d.ts +0 -48
  310. package/dist/core/stage/transfer-spec.js +0 -113
  311. package/dist/core/stage/types.d.ts +0 -208
  312. package/dist/core/stage/types.js +0 -2
  313. package/dist/core/stage/validate.d.ts +0 -11
  314. package/dist/core/stage/validate.js +0 -330
  315. package/dist/core/stage/walk.d.ts +0 -39
  316. package/dist/core/stage/walk.js +0 -119
  317. package/dist/fn-context/rpc/integration/list-bindings.d.ts +0 -21
  318. package/dist/fn-context/system-args.d.ts +0 -6
  319. package/dist/fn-context/system-args.js +0 -14
@@ -0,0 +1,35 @@
1
+ import type { Ctx } from '../functions/types.js';
2
+ import type { PageTablesDesc } from '../page/typed.js';
3
+ import type { CompanyResolveInput, CompanyResolveResult, ResolveInput, ResolveResult } from './schema.js';
4
+ /**
5
+ * Who an inbound conversation goes to is decided in two steps (14-sequence-instance §18): the company
6
+ * repo's root `resolve.ts` picks the sequence, then that sequence's `sequences/<id>/resolve.ts` picks
7
+ * the instance of it (an active one, or a new one). Both export `resolve`.
8
+ */
9
+ export declare const RESOLVE_MODULE = "resolve";
10
+ /** Reserved export of `resolve.ts` and its name in the build's `functions`. */
11
+ export declare const RESOLVE_FUNCTION = "resolve";
12
+ /** `ctx.meta.entry` / RunScope entry of a `resolve` call. */
13
+ export declare const RESOLVE_ENTRY = "resolve";
14
+ /** The company `resolve.ts` compiled into every sequence's build, under this reserved name (§18.2). */
15
+ export declare const COMPANY_RESOLVE_FUNCTION = "companyResolve";
16
+ /** `ctx.meta.entry` / RunScope entry of a company `resolve` call. */
17
+ export declare const COMPANY_RESOLVE_ENTRY = "companyResolve";
18
+ /**
19
+ * The company `resolve.ts` (§18.2): `export const resolve: CompanyResolve = async (ctx, conversation) => …`. Runs for
20
+ * inbound calls, texts and emails only, before the sequence is known: returns `{ sequence }` (a name)
21
+ * or `{ decline: { reply? } }`. It reads with `ctx.api` like any function; the repository root's
22
+ * `__gen/` binds `D` to the company's tables, so `ctx.api.db` is typed.
23
+ */
24
+ export type CompanyResolve<D extends PageTablesDesc | undefined = undefined> = (ctx: Ctx<D>, conversation: CompanyResolveInput) => Promise<CompanyResolveResult>;
25
+ /**
26
+ * `sequences/<id>/resolve.ts`: `export const resolve: Resolve = async (ctx, conversation) => …`, with
27
+ * `Resolve` imported from the sequence's `__gen`. It finds and creates through `ctx.api.contact`, reads
28
+ * and writes records through `ctx.api.db`, finds instances through `ctx.api.instances` and exchanges
29
+ * through `ctx.api.exchanges`. The conversation in, `{ contactId,
30
+ * instanceId }` or `{ contactId, start }` out, on this sequence only. The platform gives it what is
31
+ * left of the time limit, checks the ids (an active instance of this sequence, a contact, a row of
32
+ * its subject table, all of this company and environment), and fails the conversation when not.
33
+ */
34
+ export type Resolve<D extends PageTablesDesc | undefined = undefined> = (ctx: Ctx<D>, conversation: ResolveInput) => Promise<ResolveResult>;
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Who an inbound conversation goes to is decided in two steps (14-sequence-instance §18): the company
3
+ * repo's root `resolve.ts` picks the sequence, then that sequence's `sequences/<id>/resolve.ts` picks
4
+ * the instance of it (an active one, or a new one). Both export `resolve`.
5
+ */
6
+ export const RESOLVE_MODULE = 'resolve';
7
+ /** Reserved export of `resolve.ts` and its name in the build's `functions`. */
8
+ export const RESOLVE_FUNCTION = 'resolve';
9
+ /** `ctx.meta.entry` / RunScope entry of a `resolve` call. */
10
+ export const RESOLVE_ENTRY = 'resolve';
11
+ /** The company `resolve.ts` compiled into every sequence's build, under this reserved name (§18.2). */
12
+ export const COMPANY_RESOLVE_FUNCTION = 'companyResolve';
13
+ /** `ctx.meta.entry` / RunScope entry of a company `resolve` call. */
14
+ export const COMPANY_RESOLVE_ENTRY = 'companyResolve';
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * What a sequence's `index.ts` and `variables.ts` declare with (14-sequence-instance §4.4–§4.5). Part of
3
+ * the company API (`src/index.ts`), so it imports nothing: the checks live in `./index.ts`.
4
+ */
5
+ /** `sequences/<id>/index.ts` default export. */
6
+ export type SequenceDefinition<S extends string = string> = {
7
+ /** `label`: the name people see; without it, the directory name, which is the sequence's name. */
8
+ meta?: {
9
+ label?: string;
10
+ };
11
+ /** The company table each run is about: one row of it is the instance's business root. */
12
+ subject: S;
13
+ };
14
+ export declare function defineSequence<const S extends string>(definition: SequenceDefinition<S>): SequenceDefinition<S>;
15
+ /** A JSON variable's marker; the type argument is only an editor hint (the platform checks it serializes). */
16
+ export type JsonVariableType<T = unknown> = {
17
+ readonly kind: 'json';
18
+ readonly __type?: T;
19
+ };
20
+ export declare function json<T = unknown>(): JsonVariableType<T>;
21
+ /** One run variable as declared. */
22
+ export type VariableDecl = {
23
+ options: readonly (string | number | boolean)[];
24
+ default?: string | number | boolean | null;
25
+ } | {
26
+ type: 'string';
27
+ default?: string | null;
28
+ } | {
29
+ type: 'number';
30
+ default?: number | null;
31
+ } | {
32
+ type: 'boolean';
33
+ default?: boolean | null;
34
+ } | {
35
+ type: JsonVariableType;
36
+ default?: unknown;
37
+ };
38
+ export type VariableDecls = Record<string, VariableDecl>;
39
+ export declare function defineVariables<const V extends VariableDecls>(variables: V): V;
40
+ type VariableValue<D> = D extends {
41
+ options: readonly (infer O)[];
42
+ } ? O : D extends {
43
+ type: 'string';
44
+ } ? string : D extends {
45
+ type: 'number';
46
+ } ? number : D extends {
47
+ type: 'boolean';
48
+ } ? boolean : D extends {
49
+ type: JsonVariableType<infer T>;
50
+ } ? T : never;
51
+ /** The values of a `defineVariables` declaration, by name (null when unset and without a default). */
52
+ export type VariablesOf<V> = {
53
+ [K in keyof V]: VariableValue<V[K]> | null;
54
+ };
55
+ export {};
56
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1,10 @@
1
+ export function defineSequence(definition) {
2
+ return definition;
3
+ }
4
+ export function json() {
5
+ return { kind: 'json' };
6
+ }
7
+ export function defineVariables(variables) {
8
+ return variables;
9
+ }
10
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1,63 @@
1
+ export { defineSequence, defineVariables, json, type JsonVariableType, type SequenceDefinition, type VariableDecl, type VariableDecls, type VariablesOf, } from './define.js';
2
+ /** One experiment: an enum variable and the share each of its values gets when a run does not set it. */
3
+ export type ExperimentDecl = {
4
+ variable: string;
5
+ split: Record<string, number>;
6
+ };
7
+ /** `SequenceBuild.variables`: every declared variable, normalized. */
8
+ export type CompiledVariable = {
9
+ type: 'enum';
10
+ options: Array<string | number | boolean>;
11
+ default: string | number | boolean | null;
12
+ } | {
13
+ type: 'string';
14
+ default: string | null;
15
+ } | {
16
+ type: 'number';
17
+ default: number | null;
18
+ } | {
19
+ type: 'boolean';
20
+ default: boolean | null;
21
+ } | {
22
+ type: 'json';
23
+ default: unknown;
24
+ };
25
+ export type CompiledVariables = Record<string, CompiledVariable>;
26
+ export type CompiledExperiments = Record<string, ExperimentDecl>;
27
+ /**
28
+ * Run variable names the platform reserves (14 §4.4). It reads `voice` when it opens a session;
29
+ * `responsePolicy` and `slotFillingPolicy` are reserved and not read yet. A sequence may leave them
30
+ * out (the platform default) or declare them as enums whose values the platform knows.
31
+ */
32
+ export declare const SYSTEM_VARIABLES: readonly ['responsePolicy', 'slotFillingPolicy', 'voice'];
33
+ export type SystemVariableName = (typeof SYSTEM_VARIABLES)[number];
34
+ export declare function isSystemVariable(name: string): name is SystemVariableName;
35
+ export type CompileVariablesResult = {
36
+ variables: CompiledVariables;
37
+ experiments: CompiledExperiments;
38
+ issues: string[];
39
+ };
40
+ /** Normalize and check a sequence's `variables.ts` (14 §4.4). */
41
+ export declare function compileVariables(declared: unknown, experiments: unknown): CompileVariablesResult;
42
+ /** Why `value` cannot be stored in the variable; null when it can. `null` always can (unset). */
43
+ export declare function variableValueIssue(name: string, variable: CompiledVariable | undefined, value: unknown): string | null;
44
+ /** Issues of a whole write of variables (unknown names, wrong types); empty when it may be stored. */
45
+ export declare function variablesWriteIssues(variables: CompiledVariables, values: Record<string, unknown>): string[];
46
+ /**
47
+ * The variables a new run starts with: every declared default, then the values given, then each
48
+ * experiment whose variable was not given assigns a value by `hash(instanceId + experiment)`, so the
49
+ * same instance always lands in the same group (14 §4.4). Returns the assigned groups too.
50
+ */
51
+ export declare function startVariables(instanceId: string, declared: CompiledVariables, experiments: CompiledExperiments, given: Record<string, unknown>): {
52
+ variables: Record<string, unknown>;
53
+ experiments: Record<string, string>;
54
+ };
55
+ /**
56
+ * The current value of each variable as a run reads it (14 §4.4 "sequence 版本变化"): a stored value
57
+ * the declaration no longer allows (a removed variable or option) falls back to the default.
58
+ * `onStale` hears each fallback. Stored values are not changed.
59
+ */
60
+ export declare function readVariables(declared: CompiledVariables, stored: Record<string, unknown>, onStale?: (name: string, value: unknown) => void): Record<string, unknown>;
61
+ /** Bytes of `variables` serialized: what {@link LIMITS.variablesBytes} bounds. */
62
+ export declare function variablesSize(variables: Record<string, unknown>): number;
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Sequence-level declarations (14-sequence-instance §4.4–§4.5): the business root a sequence runs
3
+ * about (`index.ts`: `defineSequence({ subject })`) and its run variables and experiments
4
+ * (`variables.ts`). Compiled into `SequenceBuild.subject` / `.variables` / `.experiments`; the
5
+ * platform validates writes and assigns experiments with the helpers here.
6
+ */
7
+ import { POLICY_IDS } from '../slot/company-metadata.js';
8
+ export { defineSequence, defineVariables, json, } from './define.js';
9
+ /**
10
+ * Run variable names the platform reserves (14 §4.4). It reads `voice` when it opens a session;
11
+ * `responsePolicy` and `slotFillingPolicy` are reserved and not read yet. A sequence may leave them
12
+ * out (the platform default) or declare them as enums whose values the platform knows.
13
+ */
14
+ export const SYSTEM_VARIABLES = ['responsePolicy', 'slotFillingPolicy', 'voice'];
15
+ export function isSystemVariable(name) {
16
+ return SYSTEM_VARIABLES.includes(name);
17
+ }
18
+ const VARIABLE_NAME = /^[a-zA-Z][a-zA-Z0-9_]{0,63}$/;
19
+ /** The values a system variable may take: the policy catalog. */
20
+ function systemVariableValues(name) {
21
+ switch (name) {
22
+ case 'responsePolicy':
23
+ return POLICY_IDS.response;
24
+ case 'slotFillingPolicy':
25
+ return POLICY_IDS.slotFilling;
26
+ case 'voice':
27
+ return POLICY_IDS.voice;
28
+ }
29
+ }
30
+ /** Normalize and check a sequence's `variables.ts` (14 §4.4). */
31
+ export function compileVariables(declared, experiments) {
32
+ const issues = [];
33
+ const variables = {};
34
+ const decls = declared && typeof declared === 'object' && !Array.isArray(declared) ? declared : {};
35
+ if (declared !== undefined && decls !== declared)
36
+ issues.push('variables must be an object of declarations');
37
+ for (const [name, raw] of Object.entries(decls)) {
38
+ if (!VARIABLE_NAME.test(name)) {
39
+ issues.push(`variable '${name}': a name is a letter then letters, digits or _ (at most 64)`);
40
+ continue;
41
+ }
42
+ const compiled = compileVariable(name, raw, issues);
43
+ if (!compiled)
44
+ continue;
45
+ if (isSystemVariable(name)) {
46
+ const allowed = systemVariableValues(name);
47
+ if (compiled.type !== 'enum') {
48
+ issues.push(`variable '${name}' is the platform's: declare it with options (one of ${allowed.join(', ') || 'none'})`);
49
+ continue;
50
+ }
51
+ const unknown = compiled.options.filter((value) => typeof value !== 'string' || !allowed.includes(value));
52
+ if (unknown.length > 0) {
53
+ issues.push(`variable '${name}': ${unknown.join(', ')} not one of ${allowed.join(', ') || '(none)'}`);
54
+ continue;
55
+ }
56
+ }
57
+ variables[name] = compiled;
58
+ }
59
+ const compiledExperiments = {};
60
+ const exps = experiments && typeof experiments === 'object' && !Array.isArray(experiments)
61
+ ? experiments
62
+ : {};
63
+ for (const [name, raw] of Object.entries(exps)) {
64
+ const exp = raw;
65
+ const variable = exp && typeof exp.variable === 'string' ? variables[exp.variable] : undefined;
66
+ if (!exp || typeof exp.variable !== 'string' || !variable) {
67
+ issues.push(`experiment '${name}': variable must name a declared variable`);
68
+ continue;
69
+ }
70
+ if (variable.type !== 'enum') {
71
+ issues.push(`experiment '${name}': only an enum variable (one declared with options) can be split`);
72
+ continue;
73
+ }
74
+ const split = exp.split && typeof exp.split === 'object' ? exp.split : {};
75
+ const entries = Object.entries(split);
76
+ const options = variable.options.map(String);
77
+ const bad = entries.filter(([value, share]) => !options.includes(value) || typeof share !== 'number' || share < 0);
78
+ if (entries.length === 0 || bad.length > 0 || entries.every(([, share]) => share === 0)) {
79
+ issues.push(`experiment '${name}': split gives non-negative shares to values of '${exp.variable}' (${options.join(', ')})`);
80
+ continue;
81
+ }
82
+ if (Object.values(compiledExperiments).some((other) => other.variable === exp.variable)) {
83
+ issues.push(`experiment '${name}': '${exp.variable}' is already split by another experiment`);
84
+ continue;
85
+ }
86
+ compiledExperiments[name] = { variable: exp.variable, split: Object.fromEntries(entries) };
87
+ }
88
+ return { variables, experiments: compiledExperiments, issues };
89
+ }
90
+ function compileVariable(name, raw, issues) {
91
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
92
+ issues.push(`variable '${name}': a declaration is an object ({ options } or { type })`);
93
+ return null;
94
+ }
95
+ const decl = raw;
96
+ const hasDefault = Object.hasOwn(decl, 'default') && decl.default !== undefined;
97
+ if (Array.isArray(decl.options)) {
98
+ const options = decl.options;
99
+ if (options.length === 0 || options.some((value) => !['string', 'number', 'boolean'].includes(typeof value))) {
100
+ issues.push(`variable '${name}': options are a non-empty list of strings, numbers or booleans`);
101
+ return null;
102
+ }
103
+ if (hasDefault && decl.default !== null && !options.includes(decl.default)) {
104
+ issues.push(`variable '${name}': default ${String(decl.default)} is not one of its options`);
105
+ return null;
106
+ }
107
+ return {
108
+ type: 'enum',
109
+ options: options,
110
+ default: hasDefault ? decl.default : null,
111
+ };
112
+ }
113
+ const type = decl.type;
114
+ if (type === 'string' || type === 'number' || type === 'boolean') {
115
+ if (hasDefault && decl.default !== null && typeof decl.default !== type) {
116
+ issues.push(`variable '${name}': default must be a ${type}`);
117
+ return null;
118
+ }
119
+ return { type, default: hasDefault ? decl.default : null };
120
+ }
121
+ if (type && typeof type === 'object' && type.kind === 'json') {
122
+ if (hasDefault && !serializes(decl.default)) {
123
+ issues.push(`variable '${name}': default must serialize as JSON`);
124
+ return null;
125
+ }
126
+ return { type: 'json', default: hasDefault ? decl.default : null };
127
+ }
128
+ issues.push(`variable '${name}': declare options, or type 'string' | 'number' | 'boolean' | json()`);
129
+ return null;
130
+ }
131
+ function serializes(value) {
132
+ try {
133
+ return JSON.stringify(value) !== undefined;
134
+ }
135
+ catch {
136
+ return false;
137
+ }
138
+ }
139
+ /** Why `value` cannot be stored in the variable; null when it can. `null` always can (unset). */
140
+ export function variableValueIssue(name, variable, value) {
141
+ if (!variable)
142
+ return `unknown variable '${name}' (declare it in variables.ts)`;
143
+ if (value === null)
144
+ return null;
145
+ switch (variable.type) {
146
+ case 'enum':
147
+ return variable.options.includes(value) ? null : `'${name}' must be one of ${variable.options.join(', ')}`;
148
+ case 'string':
149
+ case 'number':
150
+ case 'boolean':
151
+ return typeof value === variable.type ? null : `'${name}' must be a ${variable.type}`;
152
+ case 'json':
153
+ return value !== undefined && serializes(value) ? null : `'${name}' must serialize as JSON`;
154
+ }
155
+ }
156
+ /** Issues of a whole write of variables (unknown names, wrong types); empty when it may be stored. */
157
+ export function variablesWriteIssues(variables, values) {
158
+ return Object.entries(values)
159
+ .map(([name, value]) => variableValueIssue(name, variables[name], value))
160
+ .filter((issue) => issue !== null);
161
+ }
162
+ /**
163
+ * The variables a new run starts with: every declared default, then the values given, then each
164
+ * experiment whose variable was not given assigns a value by `hash(instanceId + experiment)`, so the
165
+ * same instance always lands in the same group (14 §4.4). Returns the assigned groups too.
166
+ */
167
+ export function startVariables(instanceId, declared, experiments, given) {
168
+ const variables = {};
169
+ for (const [name, variable] of Object.entries(declared)) {
170
+ if (variable.default !== null && variable.default !== undefined)
171
+ variables[name] = variable.default;
172
+ }
173
+ Object.assign(variables, given);
174
+ const assigned = {};
175
+ for (const [name, experiment] of Object.entries(experiments)) {
176
+ if (Object.hasOwn(given, experiment.variable))
177
+ continue;
178
+ const value = pickByShare(`${instanceId}:${name}`, experiment.split);
179
+ const variable = declared[experiment.variable];
180
+ // A split value is a string key; the variable's option may be a number or boolean.
181
+ const option = variable?.type === 'enum' ? (variable.options.find((candidate) => String(candidate) === value) ?? value) : value;
182
+ variables[experiment.variable] = option;
183
+ assigned[name] = value;
184
+ }
185
+ return { variables, experiments: assigned };
186
+ }
187
+ /**
188
+ * The current value of each variable as a run reads it (14 §4.4 "sequence 版本变化"): a stored value
189
+ * the declaration no longer allows (a removed variable or option) falls back to the default.
190
+ * `onStale` hears each fallback. Stored values are not changed.
191
+ */
192
+ export function readVariables(declared, stored, onStale) {
193
+ const out = {};
194
+ for (const [name, variable] of Object.entries(declared)) {
195
+ const has = Object.hasOwn(stored, name);
196
+ const value = has ? stored[name] : variable.default;
197
+ if (has && variableValueIssue(name, variable, value) !== null) {
198
+ onStale?.(name, value);
199
+ out[name] = variable.default ?? null;
200
+ continue;
201
+ }
202
+ out[name] = value ?? null;
203
+ }
204
+ for (const [name, value] of Object.entries(stored)) {
205
+ if (!Object.hasOwn(declared, name))
206
+ onStale?.(name, value);
207
+ }
208
+ return out;
209
+ }
210
+ /** Deterministic weighted pick: FNV-1a of `key` into the cumulative shares. */
211
+ function pickByShare(key, split) {
212
+ const entries = Object.entries(split).filter(([, share]) => share > 0);
213
+ const total = entries.reduce((sum, [, share]) => sum + share, 0);
214
+ let hash = 0x811c9dc5;
215
+ for (let i = 0; i < key.length; i += 1) {
216
+ hash ^= key.charCodeAt(i);
217
+ hash = Math.imul(hash, 0x01000193) >>> 0;
218
+ }
219
+ let point = (hash / 0x100000000) * total;
220
+ for (const [value, share] of entries) {
221
+ if (point < share)
222
+ return value;
223
+ point -= share;
224
+ }
225
+ return entries[entries.length - 1][0];
226
+ }
227
+ /** Bytes of `variables` serialized: what {@link LIMITS.variablesBytes} bounds. */
228
+ export function variablesSize(variables) {
229
+ return new TextEncoder().encode(JSON.stringify(variables)).length;
230
+ }
231
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,40 @@
1
+ import type { FieldState } from '../context/types.js';
2
+ /**
3
+ * Where a slot cell is stored, as the generated `Rows` type marks it: a cell's
4
+ * `(table, row id, field)` and a row's `(table, id)`.
5
+ */
6
+ /** Where a cell is stored: `(table, row id, field)`. */
7
+ export type CellRef<T extends string = string, F extends string = string> = {
8
+ table: T;
9
+ rowId: string;
10
+ field: F;
11
+ };
12
+ /** A row's binding: `(table, row id)`. */
13
+ export type RowRef<T extends string = string> = {
14
+ table: T;
15
+ id: string;
16
+ };
17
+ declare const cellMode: unique symbol;
18
+ declare const cellKind: unique symbol;
19
+ /**
20
+ * The binding part of a cell type: `ref`, and phantom marks codegen adds to every field of
21
+ * `Rows`. Mode `'rw'`: a page may open it with `field(...)`; `'ro'`: the row id
22
+ * or the parent, which no page opens (19-page-writable-cells). Kind `'ref'`: a ref field (another row's id), which a region never lists.
23
+ */
24
+ export type CellBinding<T extends string = string, F extends string = string, M extends 'rw' | 'ro' = 'rw' | 'ro', K extends 'value' | 'ref' = 'value' | 'ref'> = {
25
+ ref: CellRef<T, F>;
26
+ readonly [cellMode]?: M;
27
+ readonly [cellKind]?: K;
28
+ };
29
+ /** A slot cell as a view receives it: the value and state, and where it is stored. */
30
+ export type Cell<T extends string = string, F extends string = string, V = unknown, M extends 'rw' | 'ro' = 'rw' | 'ro'> = {
31
+ value: V;
32
+ state: FieldState;
33
+ } & CellBinding<T, F, M>;
34
+ /** A bound row as a view receives it. */
35
+ export type BoundRow = {
36
+ id: string;
37
+ $ref: RowRef<string>;
38
+ };
39
+ export {};
40
+ //# sourceMappingURL=binding.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binding.js.map
@@ -0,0 +1,102 @@
1
+ import type { CompanyFieldDef, CompanySchema, SessionSchema, TableRef } from './schema.js';
2
+ import type { ValidationIssue, ValidationResult } from './types.js';
3
+ export { PLATFORM_CONTACT_FIELDS, PLATFORM_SESSION_FIELDS } from './platform-fields.js';
4
+ /** The one table every company has: the only thing the platform contacts (14-sequence-instance §5). */
5
+ export declare const CONTACT_TABLE = "contact";
6
+ /** The conversation's table: its fields are the company's `schema/session.ts`; no company table has this name. */
7
+ export declare const SESSION_TABLE = "session";
8
+ export declare const CONTACT_OPT_OUT_FIELDS: readonly ['opted_out', 'call_opted_out', 'sms_opted_out', 'email_opted_out'];
9
+ /** Platform limits (14-sequence-instance §16.1). */
10
+ export declare const LIMITS: {
11
+ /** Longest parent chain: a table's parent's parent … at most this many hops to a table without one. */
12
+ readonly parentDepth: 5;
13
+ /** An instance's `variables`, serialized, bytes. */
14
+ readonly variablesBytes: number;
15
+ /** Company tables per company and environment (18-record-search-index §4.7). */
16
+ readonly tables: 100;
17
+ /** Fields per table, platform fields included. */
18
+ readonly fieldsPerTable: 300;
19
+ /** `options` of one `select` / `multi_select` field (a longer list is a table and a lookupRef). */
20
+ readonly options: 200;
21
+ /** Characters of one option: a short code, not a sentence (its meaning goes in `extraction`). */
22
+ readonly optionChars: 60;
23
+ /**
24
+ * A `string` value, UTF-8 bytes, as written and lower-cased: its index entries keep it whole, and a
25
+ * B-tree entry holds at most 2688 bytes of it; the rest is room for the entry's other columns (34 §2).
26
+ */
27
+ readonly stringBytes: 2500;
28
+ /** A `text` value, UTF-8 bytes: the storage's bound, not a business one (34 §2). */
29
+ readonly textBytes: number;
30
+ /** One row's stored data, serialized, UTF-8 bytes. */
31
+ readonly rowDataBytes: number;
32
+ };
33
+ /**
34
+ * The policy ids a run can name, per layer: the values of the platform's run variables
35
+ * `responsePolicy`, `slotFillingPolicy` and `voice` (14 §4.4). Customers write them, so an id is only
36
+ * ever added; removing or renaming one breaks the companies that use it.
37
+ */
38
+ export declare const POLICY_IDS: {
39
+ readonly response: readonly ['default'];
40
+ readonly slotFilling: readonly ['default'];
41
+ readonly voice: readonly ['default'];
42
+ };
43
+ export type ResponsePolicyId = (typeof POLICY_IDS.response)[number];
44
+ export type SlotFillingPolicyId = (typeof POLICY_IDS.slotFilling)[number];
45
+ export type VoiceProfileId = (typeof POLICY_IDS.voice)[number];
46
+ /** Session fields with the platform's only: what a company without fields of its own declares. */
47
+ export declare const PLATFORM_SESSION_SCHEMA: SessionSchema;
48
+ /** Each table's platform fields, with the name its issue codes use (`missing-platform-<name>-field`). */
49
+ export declare const PLATFORM_TABLE_FIELDS: Readonly<Record<string, {
50
+ name: string;
51
+ fields: Record<string, CompanyFieldDef>;
52
+ }>>;
53
+ /**
54
+ * A company table other than `contact`: one the company defines whole. Every company table (contact
55
+ * included) is stored as `Record` rows; `session` is the sequence's, stored on the session.
56
+ */
57
+ export declare function isCustomTable(tableName: string): boolean;
58
+ /** A table whose rows are `Record` rows: every company table, contact included. */
59
+ export declare function isRecordTable(tableName: string): boolean;
60
+ type FieldsOf = {
61
+ fields: Record<string, {
62
+ ref?: TableRef | null;
63
+ } | CompanyFieldDef>;
64
+ };
65
+ /** A table's parent: the field name and the table it points at; null when it has none. */
66
+ export declare function parentOf(table: FieldsOf | undefined): {
67
+ field: string;
68
+ table: string;
69
+ } | null;
70
+ /**
71
+ * Whether `fieldName` is the table's parent. Its value is the row's owner: filled by the platform or
72
+ * given once on insert, never written after, and stored as the row's parent edge in `RecordRef`, not
73
+ * in its data.
74
+ */
75
+ export declare function isParentField(table: FieldsOf | undefined, fieldName: string): boolean;
76
+ /**
77
+ * Why `schema/session.ts` is not a session schema (11-remove-sequence-schema §3.1): its fields are
78
+ * simple values, with no `ref` (the session is related to no other table).
79
+ */
80
+ export declare function sessionSchemaIssues(session: SessionSchema): ValidationIssue[];
81
+ /**
82
+ * Whether the company schema is one: its tables (`schema/index.ts`) and its session fields
83
+ * (`schema/session.ts`, the platform's only when the file is missing). `session` is reserved: no
84
+ * company table has the name. What a build stores is `compileSlotSchema`'s output.
85
+ */
86
+ export declare function validateCompanySchema(company: CompanySchema, session?: SessionSchema): ValidationResult;
87
+ /** The issue for a field that still names its `source` (19-page-writable-cells). */
88
+ export declare function sourceRemovedIssue(path: string, prefix?: string): ValidationIssue;
89
+ /** The issue for a field that still names `nullable`, which no write checked. */
90
+ export declare function nullableRemovedIssue(path: string, prefix?: string): ValidationIssue;
91
+ /** The issue for a field that still names `identifier`, which nothing used. */
92
+ export declare function identifierRemovedIssue(path: string, prefix?: string): ValidationIssue;
93
+ /**
94
+ * A field's choices (27 §2–§3): no `enum` (now a `select`); `options` on a `select` / `multi_select`
95
+ * only, and there required: 1 to `LIMITS.options` distinct short codes.
96
+ */
97
+ export declare function optionIssues(path: string, field: Record<string, unknown>, prefix?: string): ValidationIssue[];
98
+ /** The issue for a table that writes the row id, which is the platform's. */
99
+ export declare function idIsPlatformIssue(path: string): ValidationIssue;
100
+ /** The company table a sequence names as its business root, checked (14 §4.5). */
101
+ export declare function subjectTableIssues(company: CompanySchema, subject: unknown): ValidationIssue[];
102
+ //# sourceMappingURL=company-metadata.d.ts.map