@superpanel-sdk/runtime 0.5.0 → 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 (189) hide show
  1. package/README.md +3 -3
  2. package/dist/builder/codegen/emit.d.ts +5 -10
  3. package/dist/builder/codegen/emit.js +100 -106
  4. package/dist/builder/codegen/generate.d.ts +3 -5
  5. package/dist/builder/codegen/generate.js +13 -32
  6. package/dist/builder/company-imports.d.ts +5 -0
  7. package/dist/builder/company-imports.js +9 -1
  8. package/dist/builder/compile/compile-sequence.d.ts +13 -11
  9. package/dist/builder/compile/compile-sequence.js +135 -83
  10. package/dist/builder/compile/function-code.d.ts +15 -9
  11. package/dist/builder/compile/function-code.js +59 -29
  12. package/dist/builder/compile/registry.d.ts +4 -4
  13. package/dist/builder/compile/registry.js +14 -12
  14. package/dist/builder/errors.d.ts +9 -0
  15. package/dist/builder/errors.js +17 -0
  16. package/dist/builder/function-params.d.ts +10 -0
  17. package/dist/builder/function-params.js +203 -0
  18. package/dist/builder/load.d.ts +17 -17
  19. package/dist/builder/load.js +27 -25
  20. package/dist/builder/paths.d.ts +6 -1
  21. package/dist/builder/paths.js +16 -2
  22. package/dist/builder/schedules.d.ts +9 -7
  23. package/dist/builder/schedules.js +20 -21
  24. package/dist/builder/typecheck.d.ts +1 -1
  25. package/dist/builder/typecheck.js +3 -6
  26. package/dist/builder/types.d.ts +41 -5
  27. package/dist/builder/types.js +19 -0
  28. package/dist/cli/calls/index.d.ts +177 -0
  29. package/dist/cli/calls/index.js +96 -0
  30. package/dist/cli/debug/index.d.ts +31 -0
  31. package/dist/cli/debug/index.js +119 -0
  32. package/dist/cli/exec/index.d.ts +39 -0
  33. package/dist/cli/exec/index.js +138 -0
  34. package/dist/cli/exec/session.d.ts +48 -0
  35. package/dist/cli/exec/session.js +82 -0
  36. package/dist/cli/exec/trace.d.ts +18 -0
  37. package/dist/cli/exec/trace.js +52 -0
  38. package/dist/cli/index.js +84 -1
  39. package/dist/cli/logs/index.d.ts +47 -0
  40. package/dist/cli/logs/index.js +113 -0
  41. package/dist/cli/mobile/index.d.ts +12 -0
  42. package/dist/cli/mobile/index.js +405 -0
  43. package/dist/cli/serve/index.d.ts +40 -4
  44. package/dist/cli/serve/index.js +167 -28
  45. package/dist/cli/turns/index.d.ts +105 -0
  46. package/dist/cli/turns/index.js +128 -0
  47. package/dist/cli/turns/run.d.ts +13 -0
  48. package/dist/cli/turns/run.js +57 -0
  49. package/dist/cli/turns/shadow.d.ts +112 -0
  50. package/dist/cli/turns/shadow.js +54 -0
  51. package/dist/cli/type-gen/index.js +0 -1
  52. package/dist/compute-host/compute-host.d.ts +5 -6
  53. package/dist/compute-host/compute-host.js +4 -13
  54. package/dist/compute-host/source-compute-host.d.ts +5 -7
  55. package/dist/compute-host/source-compute-host.js +12 -33
  56. package/dist/core/case-orchestrator/contact-hours.d.ts +26 -6
  57. package/dist/core/case-orchestrator/contact-hours.js +27 -8
  58. package/dist/core/case-orchestrator/index.d.ts +1 -4
  59. package/dist/core/case-orchestrator/index.js +1 -4
  60. package/dist/core/case-orchestrator/render.d.ts +1 -1
  61. package/dist/core/case-orchestrator/render.js +15 -10
  62. package/dist/core/case-orchestrator/types.d.ts +83 -128
  63. package/dist/core/case-orchestrator/types.js +0 -4
  64. package/dist/core/context/email-message.d.ts +40 -1
  65. package/dist/core/context/email-message.js +27 -0
  66. package/dist/core/context/email.d.ts +13 -1
  67. package/dist/core/context/email.js +2 -3
  68. package/dist/core/context/exchanges.d.ts +25 -0
  69. package/dist/core/context/exchanges.js +25 -7
  70. package/dist/core/context/instances.d.ts +31 -2
  71. package/dist/core/context/instances.js +18 -4
  72. package/dist/core/context/platform-registry.d.ts +35 -0
  73. package/dist/core/context/sms.d.ts +30 -0
  74. package/dist/core/context/sms.js +20 -0
  75. package/dist/core/context/types.d.ts +29 -1
  76. package/dist/core/conversation/index.d.ts +58 -4
  77. package/dist/core/conversation/index.js +123 -4
  78. package/dist/core/functions/errors.d.ts +74 -0
  79. package/dist/core/functions/errors.js +26 -0
  80. package/dist/core/functions/events.d.ts +23 -78
  81. package/dist/core/functions/events.js +8 -17
  82. package/dist/core/functions/schedules.d.ts +9 -10
  83. package/dist/core/functions/schedules.js +2 -2
  84. package/dist/core/functions/types.d.ts +17 -72
  85. package/dist/core/functions/types.js +1 -9
  86. package/dist/core/page/define.d.ts +230 -160
  87. package/dist/core/page/define.js +145 -104
  88. package/dist/core/page/envelope.d.ts +55 -0
  89. package/dist/core/page/envelope.js +4 -0
  90. package/dist/core/page/fns.d.ts +448 -0
  91. package/dist/core/page/fns.js +539 -0
  92. package/dist/core/page/memory-reader.d.ts +27 -0
  93. package/dist/core/page/memory-reader.js +299 -0
  94. package/dist/core/page/page-host.d.ts +20 -0
  95. package/dist/core/page/page-host.js +57 -0
  96. package/dist/core/page/records-query.d.ts +234 -0
  97. package/dist/core/page/records-query.js +780 -0
  98. package/dist/core/page/render.d.ts +67 -25
  99. package/dist/core/page/render.js +492 -272
  100. package/dist/core/page/sandbox.d.ts +85 -0
  101. package/dist/core/page/sandbox.js +357 -0
  102. package/dist/core/page/time-format.d.ts +27 -0
  103. package/dist/core/page/time-format.js +84 -0
  104. package/dist/core/page/typed.d.ts +165 -159
  105. package/dist/core/page/workspace.d.ts +25 -1
  106. package/dist/core/page/workspace.js +48 -13
  107. package/dist/core/party/schema.d.ts +74 -3
  108. package/dist/core/party/schema.js +39 -6
  109. package/dist/core/party/types.d.ts +8 -13
  110. package/dist/core/sequence/define.d.ts +1 -2
  111. package/dist/core/slot/company-metadata.d.ts +11 -22
  112. package/dist/core/slot/company-metadata.js +12 -39
  113. package/dist/core/slot/compile-schema.js +6 -6
  114. package/dist/core/slot/field.d.ts +1 -2
  115. package/dist/core/slot/field.js +0 -2
  116. package/dist/core/slot/index.d.ts +3 -3
  117. package/dist/core/slot/index.js +3 -3
  118. package/dist/core/slot/naming.d.ts +1 -1
  119. package/dist/core/slot/naming.js +1 -1
  120. package/dist/core/slot/platform-fields.d.ts +4 -4
  121. package/dist/core/slot/platform-fields.js +5 -5
  122. package/dist/core/slot/schema-compat.d.ts +8 -7
  123. package/dist/core/slot/schema-compat.js +22 -31
  124. package/dist/core/slot/schema.d.ts +3 -59
  125. package/dist/core/slot/schema.js +0 -15
  126. package/dist/core/slot/types.d.ts +4 -10
  127. package/dist/core/slot/value.d.ts +2 -0
  128. package/dist/core/slot/value.js +6 -2
  129. package/dist/dev-overlay/protocol.d.ts +38 -5
  130. package/dist/fn-context/build-context.js +10 -4
  131. package/dist/fn-context/fake/index.d.ts +2 -0
  132. package/dist/fn-context/fake/index.js +5 -3
  133. package/dist/fn-context/fn-params.d.ts +2 -5
  134. package/dist/fn-context/fn-params.js +6 -9
  135. package/dist/fn-context/index.d.ts +1 -1
  136. package/dist/fn-context/make-ctx.js +5 -4
  137. package/dist/fn-context/rpc/case-orchestrator-tools.d.ts +11 -3
  138. package/dist/fn-context/rpc/case-orchestrator-tools.js +0 -1
  139. package/dist/fn-context/rpc/errors.d.ts +13 -0
  140. package/dist/fn-context/rpc/errors.js +22 -0
  141. package/dist/fn-context/rpc/index.d.ts +1 -1
  142. package/dist/fn-context/rpc/index.js +1 -1
  143. package/dist/fn-context/rpc/integration/index.d.ts +11 -1
  144. package/dist/fn-context/rpc/log.d.ts +11 -1
  145. package/dist/fn-context/rpc/platform.d.ts +11 -1
  146. package/dist/fn-context/rpc/records.d.ts +13 -6
  147. package/dist/fn-context/rpc/records.js +2 -4
  148. package/dist/fn-context/rpc/trpc-client.d.ts +42 -0
  149. package/dist/fn-context/rpc/trpc-client.js +151 -22
  150. package/dist/fn-context/rpc/trpc-init.d.ts +19 -1
  151. package/dist/fn-context/rpc/trpc-init.js +10 -4
  152. package/dist/fn-context/rpc/trpc-router-factory.d.ts +66 -8
  153. package/dist/fn-context/run-scope.js +1 -1
  154. package/dist/fn-context/types.d.ts +20 -6
  155. package/dist/index.d.ts +11 -12
  156. package/dist/index.js +5 -8
  157. package/dist/logger.d.ts +4 -0
  158. package/dist/logger.js +8 -0
  159. package/dist/platform.d.ts +32 -33
  160. package/dist/platform.js +23 -22
  161. package/dist/testing-compile-child.d.ts +2 -0
  162. package/dist/testing-compile-child.js +20 -0
  163. package/dist/testing.d.ts +368 -0
  164. package/dist/testing.js +439 -0
  165. package/dist/voice-service/actions.d.ts +12 -35
  166. package/dist/voice-service/index.d.ts +2 -0
  167. package/dist/voice-service/index.js +2 -0
  168. package/dist/voice-service/protocol.d.ts +604 -0
  169. package/dist/voice-service/protocol.js +67 -0
  170. package/dist/voice-service/types.d.ts +16 -6
  171. package/dist/worker.d.ts +2 -1
  172. package/dist/worker.js +2 -1
  173. package/package.json +20 -16
  174. package/dist/core/case-orchestrator/follow-ups.d.ts +0 -31
  175. package/dist/core/case-orchestrator/follow-ups.js +0 -103
  176. package/dist/core/case-orchestrator/tools.d.ts +0 -29
  177. package/dist/core/case-orchestrator/tools.js +0 -31
  178. package/dist/core/case-orchestrator/validate.d.ts +0 -11
  179. package/dist/core/case-orchestrator/validate.js +0 -63
  180. package/dist/core/functions/define/bind.d.ts +0 -25
  181. package/dist/core/functions/define/bind.js +0 -14
  182. package/dist/core/functions/define/case.d.ts +0 -9
  183. package/dist/core/functions/define/case.js +0 -13
  184. package/dist/core/functions/define/events.d.ts +0 -20
  185. package/dist/core/functions/define/events.js +0 -21
  186. package/dist/core/functions/define/no-case.d.ts +0 -4
  187. package/dist/core/functions/define/no-case.js +0 -9
  188. package/dist/core/functions/func-ref.d.ts +0 -25
  189. package/dist/core/functions/func-ref.js +0 -20
package/dist/index.d.ts CHANGED
@@ -11,21 +11,20 @@
11
11
  * `superpanel-platform` condition.
12
12
  */
13
13
  export { defineSequence, defineVariables, json, type JsonVariableType, type SequenceDefinition, type VariableDecl, type VariableDecls, type VariablesOf, } from './core/sequence/define.js';
14
- export { defineCaseFunc } from './core/functions/define/case.js';
15
- export { defineNoCaseFunc } from './core/functions/define/no-case.js';
16
- export { bindDefines, type BoundDefines } from './core/functions/define/bind.js';
17
- export { defineEvents, defineWebhook } from './core/functions/define/events.js';
18
14
  export { defineSchedules, type Schedules } from './core/functions/schedules.js';
19
- export type { FunctionCtx } from './core/functions/types.js';
20
- export type { WebhookHandler } from './core/functions/events.js';
21
- export { choose, createRow, defineAction, definePage, deleteRow, end, field, refField, lastActionRun, perform, runFunction, schemaField, tried, type PageChannel, type PageFaqEntry, type PageRuns, } from './core/page/define.js';
22
- export type { Id, RowOf, TypedDb, TypedPageContext, TypedPageModule, TypedReadDb, } from './core/page/typed.js';
23
- export { followUps } from './core/case-orchestrator/follow-ups.js';
15
+ export type { Ctx } from './core/functions/types.js';
16
+ export type { EventHandlers, WebhookHandler } from './core/functions/events.js';
17
+ export type { CodeErrorEvent, OnError } from './core/functions/errors.js';
18
+ export { PlatformUnavailableError } from './core/functions/errors.js';
19
+ export { choose, definePage, lastActionRun, tried, type PageChannel, type PageFaqEntry, type PageRuns, } from './core/page/define.js';
20
+ /** A fixed line said to the customer, per language (66 §2). */
21
+ export type { Spoken, SpokenTag } from './core/conversation/index.js';
22
+ export { announce, backgroundTransfer, block, button, cancelFollowUp, coldTransfer, convertTime, createRow, data, deleteRow, doNow, end, field, functionHandles, actionHandles, keypad, list, page, pressKeypad, refField, run, scheduleFollowUp, text, toolbox, voicemail, warmTransfer, type Action, type BlockNode, type ButtonNode, type DataNode, type DoNode, type FieldNode, type FunctionHandle, type ListNode, type PageActionHandle, type PageContent, type PageItem, type PageNode, type TextNode, type Tool, type ToolboxNode, } from './core/page/fns.js';
23
+ export type { Email, Id, IsoDate, IsoDateTime, Phone, TimeOfDay, RowOf, TypedActionContext, TypedDb, TypedPageContext, TypedPageModule, TypedPageFns, FunctionHandles, ActionHandles, PageResult, TypedReadDb, } from './core/page/typed.js';
24
24
  export { render } from './core/case-orchestrator/render.js';
25
- export { tools } from './core/case-orchestrator/tools.js';
26
- export type { CaseActivity, CaseInput, CaseOrchestrator, CaseOrchestratorContacts, ContactActionView, RunTrigger, ScheduledActionView, } from './core/case-orchestrator/types.js';
25
+ export type { CaseActivity, CaseOrchestrator, CaseOrchestratorArgs, ContactActionView, RunTrigger, ScheduledActionView, } from './core/case-orchestrator/types.js';
27
26
  export type { CompanyResolve, Resolve } from './core/party/types.js';
28
- export { contactScheduleHours, everyDay, nextContactTime, withinContactHours, type ContactHours, type ContactHoursRange, type ContactHoursWeekday, } from './core/case-orchestrator/contact-hours.js';
27
+ export { contactScheduleHours, everyDay, nextContactTime, withinContactHours, type ContactHours, type ContactHoursIgnore, type ContactHoursRange, type ContactHoursWeekday, } from './core/case-orchestrator/contact-hours.js';
29
28
  export { randomTimeBetween } from './core/case-orchestrator/time.js';
30
29
  export { contactTimezone } from './core/slot/contact-timezone.js';
31
30
  export type { OfficeHours } from './core/office-hours/index.js';
package/dist/index.js CHANGED
@@ -12,18 +12,15 @@
12
12
  */
13
13
  // Sequence declarations: `index.ts`, `variables.ts`.
14
14
  export { defineSequence, defineVariables, json, } from './core/sequence/define.js';
15
- // Functions, events, the webhook and schedules (the sequence's `__gen` binds them to its tables).
16
- export { defineCaseFunc } from './core/functions/define/case.js';
17
- export { defineNoCaseFunc } from './core/functions/define/no-case.js';
18
- export { bindDefines } from './core/functions/define/bind.js';
19
- export { defineEvents, defineWebhook } from './core/functions/define/events.js';
15
+ // Functions, events, the webhook and schedules (`__gen` binds them to the company's tables).
20
16
  export { defineSchedules } from './core/functions/schedules.js';
17
+ export { PlatformUnavailableError } from './core/functions/errors.js';
21
18
  // The page (the sequence's `__gen` binds them to its tables).
22
- export { choose, createRow, defineAction, definePage, deleteRow, end, field, refField, lastActionRun, perform, runFunction, schemaField, tried, } from './core/page/define.js';
19
+ export { choose, definePage, lastActionRun, tried, } from './core/page/define.js';
20
+ // The page in functions (76): nodes, actions, page actions, tools (`__gen` binds the table-bound ones).
21
+ export { announce, backgroundTransfer, block, button, cancelFollowUp, coldTransfer, convertTime, createRow, data, deleteRow, doNow, end, field, functionHandles, actionHandles, keypad, list, page, pressKeypad, refField, run, scheduleFollowUp, text, toolbox, voicemail, warmTransfer, } from './core/page/fns.js';
23
22
  // The Orchestrator.
24
- export { followUps } from './core/case-orchestrator/follow-ups.js';
25
23
  export { render } from './core/case-orchestrator/render.js';
26
- export { tools } from './core/case-orchestrator/tools.js';
27
24
  // When a contact may be reached, and in which time zone.
28
25
  export { contactScheduleHours, everyDay, nextContactTime, withinContactHours, } from './core/case-orchestrator/contact-hours.js';
29
26
  export { randomTimeBetween } from './core/case-orchestrator/time.js';
package/dist/logger.d.ts CHANGED
@@ -1,7 +1,11 @@
1
+ type LogLevel = 'INFO' | 'WARN' | 'ERROR';
2
+ /** The least level the runtime's own lines are written at: `exec` keeps the RPC's routine lines out of a snippet's output. */
3
+ export declare function setRuntimeLogLevel(level: LogLevel): void;
1
4
  export declare function getLogger(tags?: readonly string[]): {
2
5
  log(...args: unknown[]): void;
3
6
  info(...args: unknown[]): void;
4
7
  warn(...args: unknown[]): void;
5
8
  error(...args: unknown[]): void;
6
9
  };
10
+ export {};
7
11
  //# sourceMappingURL=logger.d.ts.map
package/dist/logger.js CHANGED
@@ -12,7 +12,15 @@ function formatArgument(value) {
12
12
  return '[unserializable]';
13
13
  }
14
14
  }
15
+ const RANK = { INFO: 0, WARN: 1, ERROR: 2 };
16
+ let least = 'INFO';
17
+ /** The least level the runtime's own lines are written at: `exec` keeps the RPC's routine lines out of a snippet's output. */
18
+ export function setRuntimeLogLevel(level) {
19
+ least = level;
20
+ }
15
21
  function write(level, tags, args) {
22
+ if (RANK[level] < RANK[least])
23
+ return;
16
24
  const label = tags.length > 0 ? `[${tags.join(',')}] ` : '';
17
25
  const line = `${new Date().toISOString()} ${level.padEnd(5)} ${label}${args.map(formatArgument).join(' ')}`;
18
26
  if (level === 'ERROR')
@@ -5,71 +5,70 @@
5
5
  * compile child `./compiler`, which stay small. Platform-only: the package resolves `./platform` under the
6
6
  * `superpanel-platform` condition, so company code cannot import it.
7
7
  */
8
- export type { CompanyFieldDef, CompanyNormalFieldDef, CompiledCompanyMetadata, CompanySchema, CompanyTableDef, DataType, ContactSchedule, LocalTimeRange, ContactWeekday, ScalarDataType, NormalFieldCore, SessionDataType, SessionFieldDef, SessionSchema, TableRef, } from './core/slot/schema.js';
9
- export { ROW_ID_FIELD, ROW_SYSTEM_KEYS, ROW_TIME_KEYS, isRowTimeKey, type RowSystemKey, type RowTimeKey, idFieldCore, normalFieldCoreSchema, companyNormalFieldDefSchema, tableRefSchema, compiledCompanyMetadataSchema, companyFieldDefSchema, companyTableDefSchema, companySchemaSchema, contactScheduleValueSchema, localTimeRangeSchema, isCompanySchema, EMPTY_SESSION_SCHEMA, sessionFieldDefSchema, sessionSchemaSchema, } from './core/slot/schema.js';
10
- export { CONTACT_OPT_OUT_FIELDS, CONTACT_TABLE, LIMITS, POLICY_IDS, PLATFORM_CONTACT_FIELDS, PLATFORM_SESSION_FIELDS, PLATFORM_SESSION_SCHEMA, SESSION_TABLE, compileCompanyMetadata, sessionSchemaIssues, isCustomTable, isParentField, isRecordTable, parentOf, subjectTableIssues, compileCompanySchema, type CompileCompanyMetadataResult, type ResponsePolicyId, type SlotFillingPolicyId, type VoiceProfileId, } from './core/slot/company-metadata.js';
8
+ export type { CompanyFieldDef, CompanyNormalFieldDef, CompanySchema, CompanyTableDef, DataType, ContactSchedule, LocalTimeRange, ContactWeekday, ScalarDataType, NormalFieldCore, SessionDataType, SessionFieldDef, SessionSchema, TableRef, } from './core/slot/schema.js';
9
+ export { ROW_ID_FIELD, ROW_SYSTEM_KEYS, ROW_TIME_KEYS, isRowTimeKey, type RowSystemKey, type RowTimeKey, idFieldCore, normalFieldCoreSchema, companyNormalFieldDefSchema, tableRefSchema, companyFieldDefSchema, companyTableDefSchema, companySchemaSchema, contactScheduleValueSchema, localTimeRangeSchema, isCompanySchema, EMPTY_SESSION_SCHEMA, sessionFieldDefSchema, sessionSchemaSchema, } from './core/slot/schema.js';
10
+ export { CONTACT_OPT_OUT_FIELDS, CONTACT_TABLE, LIMITS, POLICY_IDS, PLATFORM_CONTACT_FIELDS, PLATFORM_SESSION_FIELDS, PLATFORM_SESSION_SCHEMA, SESSION_TABLE, validateCompanySchema, sessionSchemaIssues, isCustomTable, isParentField, isRecordTable, parentOf, subjectTableIssues, type ResponsePolicyId, type SlotFillingPolicyId, type VoiceProfileId, } from './core/slot/company-metadata.js';
11
11
  export { STATE_CODES, STATE_TIMEZONES, areaCodeTimezone, contactTimezone, knownTimezone, postalTimezone, stateCode, type StateCode, type TimezoneSource, } from './core/slot/contact-timezone.js';
12
12
  export { randomTimeBetween } from './core/case-orchestrator/time.js';
13
- export { contactHoursOn, contactScheduleHours, everyDay, nextContactTime, withinContactHours, type ContactHours, type ContactHoursRange, type ContactHoursWeekday, type ContactScheduleValue, } from './core/case-orchestrator/contact-hours.js';
13
+ export { contactHoursOn, contactScheduleHours, everyDay, nextContactTime, withinContactHours, type ContactHours, type ContactHoursIgnore, type ContactHoursRange, type ContactHoursWeekday, type ContactScheduleValue, } from './core/case-orchestrator/contact-hours.js';
14
14
  export { integrationSurfaceKeys } from './core/context/types.js';
15
15
  export { lookupRef, parentRef } from './core/slot/id-ref.js';
16
- export type { EmailApi, EmailAttachment, EmailGetAttachmentInput, EmailGetAttachmentOutput, EmailGetMessageInput, EmailGetMessageOutput, EmailListMessagesInput, EmailListMessagesOutput, EmailProvider, EmailSendEmailInput, EmailSendEmailOutput, EmailService, } from './core/context/email.js';
17
- export { emailGetAttachmentInput, emailGetAttachmentOutput, emailGetMessageInput, emailGetMessageOutput, emailListMessagesInput, emailListMessagesOutput, emailMockService, emailProvider, emailSendEmailInput, emailSendEmailOutput, } from './core/context/email.js';
16
+ export type { EmailApi, EmailAttachment, EmailGetAttachmentInput, EmailGetAttachmentOutput, EmailGetMessageInput, EmailGetMessageOutput, EmailListMessagesInput, EmailListMessagesOutput, EmailProvider, EmailProviderService, EmailSendEmailInput, EmailSendEmailOutput, EmailService, } from './core/context/email.js';
17
+ export { EMAIL_PLATFORM_ONLY_METHODS, emailGetAttachmentInput, emailGetAttachmentOutput, emailGetMessageInput, emailGetMessageOutput, emailListMessagesInput, emailListMessagesOutput, emailMockService, emailProvider, emailSendEmailInput, emailSendEmailOutput, } from './core/context/email.js';
18
18
  export type { ContactApi, IntegrationSurfaceMeta, EnvApi, EnvService, FieldState, IntegrationAccountFields, IntegrationApi, IntegrationStub, IntegrationSurfaceKey, IntegrationTarget, Logger, MakeCtxOverrides, SystemContext, } from './core/context/types.js';
19
19
  export { CALL_PAGE_LIMIT_MAX, callDirection, callGetInput, callGetOutput, callListInput, callListOutput, callMockService, callParticipant, callRecord, callSurface, callTranscriptInput, callTranscriptLine, callTranscriptOutput, type CallApi, type CallDirection, type CallListParams, type CallListResult, type CallParticipant, type CallRecord, type CallTranscript, type CallTranscriptLine, } from './core/context/call.js';
20
20
  export { CONTACT_PAGE_LIMIT_MAX, contactCreateInput, contactFindInput, contactFindOutput, contactListInput, contactListOutput, contactMockService, contactSummary, contactSurface, slotFieldValue, type ContactCreateParams, type ContactFindParams, type ContactFindResult, type ContactListParams, type ContactListResult, type ContactSummary, type SlotFieldValue, } from './core/context/contact.js';
21
- export { instanceCloseInput, instanceFindForContactInput, instanceIdInput, instanceListOutput, instanceNotifyInput, instanceNotifyOutput, instanceSetVariablesInput, instanceStartInput, instanceStartOutput, instanceSummary, instancesMockService, instancesSurface, type InstanceCloseParams, type InstanceFindForContactParams, type InstanceIdParams, type InstanceListResult, type InstanceNotifyParams, type InstanceNotifyResult, type InstanceSetVariablesParams, type InstanceStartParams, type InstanceStartResult, type InstanceSummary, type InstancesApi, } from './core/context/instances.js';
21
+ export { instanceCloseInput, instanceCloseOutput, instanceFindForContactInput, instanceIdInput, instanceListOutput, instanceNotifyInput, instanceNotifyOutput, instanceSetVariablesInput, instanceStartInput, instanceStartOutput, instanceSummary, instancesMockService, instancesSurface, type InstanceCloseParams, type InstanceCloseResult, type InstanceFindForContactParams, type InstanceIdParams, type InstanceListResult, type InstanceNotifyParams, type InstanceNotifyResult, type InstanceSetVariablesParams, type InstanceStartParams, type InstanceStartResult, type InstanceSummary, type InstancesApi, } from './core/context/instances.js';
22
22
  export { channelMailbox, channelPhoneNumber, channelsListInput, channelsListOutput, channelsMockService, channelsSurface, type ChannelMailbox, type ChannelPhoneNumber, type ChannelsApi, type ChannelsListParams, type ChannelsListResult, } from './core/context/channels.js';
23
23
  export { exchangeEmailThreadInput, exchangeEmailThreadOutput, exchangeLastInput, exchangeLastOutput, exchangeRef, exchangeSummary, exchangesMockService, exchangesSurface, type ExchangeRef, type ExchangeEmailThreadParams, type ExchangeEmailThreadResult, type ExchangeLastParams, type ExchangeLastResult, type ExchangeSummary, type ExchangesApi, } from './core/context/exchanges.js';
24
24
  export { SYSTEM_VARIABLES, compileVariables, defineSequence, defineVariables, isSystemVariable, json, readVariables, startVariables, variableValueIssue, variablesSize, variablesWriteIssues, type CompiledExperiments, type CompiledVariable, type CompiledVariables, type ExperimentDecl, type JsonVariableType, type SequenceDefinition, type SystemVariableName, type VariableDecl, type VariableDecls, type VariablesOf, } from './core/sequence/index.js';
25
- export { EMAIL_PAGE_LIMIT_MAX, emailDirection, emailGetInput, emailGetOutput, emailHistoryMockService, emailHistorySurface, emailListInput, emailListOutput, emailRecord, type EmailDirection, type EmailHistoryApi, type EmailListParams, type EmailListResult, type EmailRecord, } from './core/context/email-message.js';
25
+ export { EMAIL_PAGE_LIMIT_MAX, emailDirection, emailGetInput, emailGetOutput, emailHistoryMockService, emailHistorySurface, emailListInput, emailListOutput, emailRecord, emailSendInput, emailSendOutput, type EmailDirection, type EmailHistoryApi, type EmailListParams, type EmailListResult, type EmailRecord, type EmailSendParams, type EmailSendResult, } from './core/context/email-message.js';
26
26
  export { KV_KEY_MAX, KV_SCOPES, KV_TTL_SECONDS_MAX, KV_VALUE_MAX, kvDelInput, kvDelOutput, kvGetInput, kvGetOutput, kvMockService, kvScope, kvSetInput, kvSetOutput, kvSurface, type KvApi, type KvDelInput, type KvDelOutput, type KvGetInput, type KvGetOutput, type KvScope, type KvSetInput, type KvSetOutput, } from './core/context/kv.js';
27
27
  export { SMS_PAGE_LIMIT_MAX, smsDirection, smsGetInput, smsGetOutput, smsListInput, smsListOutput, smsMockService, smsRecord, smsSurface, type SmsApi, type SmsDirection, type SmsListParams, type SmsListResult, type SmsRecord, } from './core/context/sms.js';
28
28
  export { bindEnvService, envMockService, readEnvGet } from './core/context/env.js';
29
29
  export type { AnyPlatformSurface, PlatformApiShape, PlatformImpl, PlatformSurface } from './core/context/platform.js';
30
30
  export { platformSurfaces, type PlatformApis, type PlatformSurfaceKey } from './core/context/platform-registry.js';
31
- export type { CompiledSlotSchema, FieldHistoryEntry, FieldValue, MultiRowRecord, MultiRowTableData, RuntimeFieldDef, RuntimeTableDef, SingleRowTableData, SlotValue, UpdatedBy, ValidationIssue, ValidationResult, WriteSource, } from './core/slot/types.js';
32
- export type { FuncRef } from './core/functions/func-ref.js';
33
- export { resolveFuncName } from './core/functions/func-ref.js';
34
- export type { CompanyBuild, CompanyPart, RuntimePackageSource, SequenceBuild } from './builder/types.js';
35
- export { COMPANY_SCOPE } from './builder/types.js';
31
+ export type { CompiledSlotSchema, FieldValue, MultiRowRecord, MultiRowTableData, RuntimeFieldDef, RuntimeTableDef, SingleRowTableData, SlotValue, UpdatedBy, ValidationIssue, ValidationResult, WriteSource, } from './core/slot/types.js';
32
+ export type { CompanyBuild, CompanyPart, FunctionSourceMap, RuntimePackageSource, SequenceBuild, SourceMaps } from './builder/types.js';
33
+ export { COMPANY_SCOPE, CONTEXT_PAGE_FUNCTION, functionKey, functionScriptFile } from './builder/types.js';
36
34
  export { parseOfficeHours, resolveOfficeHours, type OfficeHours, type OfficeHoursSnapshot, type ParseOfficeHoursResult, type Weekday, type Window, } from './core/office-hours/index.js';
37
- export type { CaseFn, DefinedCaseFunc, DefinedCaseOrchestratorFunc, DefinedFunc, DefinedNoCaseFunc, FuncMap, FuncOptions, FuncRegistration, FunctionCtx, FunctionKind, FunctionRegistry, FunctionRegistryEntry, NoCaseFn, WorkerFunctionKind, } from './core/functions/types.js';
38
- export type { AnyEventHandlers, CallEndedEvent, CallEventBase, CallInboundEvent, CallOutboundEvent, EmailReceivedEvent, EmailEventBase, EmptyEvent, EmailSendRequestedEvent, ConversationHandoffEvent, EventHandler, EventHandlerParams, EventHandlers, SmsReceivedEvent, SmsEventBase, SmsSendRequestedEvent, SystemEventMap, SystemEventName, SystemEventPayload, WebhookEvent, WebhookHandler, WebhookOutcome, WebhookRequest, } from './core/functions/events.js';
39
- export { defineEvents, defineWebhook } from './core/functions/define/events.js';
40
- export { isSystemEventName, SYSTEM_EVENT_NAMES, SYSTEM_EVENTS, systemEventKind, WEBHOOK_RECEIVED_FUNCTION, webhookOutcome, } from './core/functions/events.js';
41
- export { defineSchedules, SCHEDULE_FUNCTION_PREFIX, SCHEDULES_MODULE, scheduleFunctionName, type ScheduleCtx, type ScheduleDefinition, type ScheduleManifest, type Schedules, type ScheduleTick, } from './core/functions/schedules.js';
35
+ export type { Ctx, FuncMap, FunctionRegistry, FunctionRegistryEntry, PlainFn } from './core/functions/types.js';
36
+ export type { AnyEventHandlers, CallEndedEvent, CallEventBase, CallInboundEvent, CallOutboundEvent, EmailReceivedEvent, EmailEventBase, EmailSendRequestedEvent, EventHandler, EventHandlerArgs, EventHandlers, SmsReceivedEvent, SmsEventBase, SmsSendRequestedEvent, SystemEventMap, SystemEventName, SystemEventPayload, WebhookEvent, WebhookHandler, WebhookOutcome, WebhookRequest, } from './core/functions/events.js';
37
+ export { isSystemEventName, SYSTEM_EVENT_NAMES, SYSTEM_EVENTS, WEBHOOK_RECEIVED_FUNCTION, webhookOutcome, } from './core/functions/events.js';
38
+ export { defineSchedules, SCHEDULE_FUNCTION_PREFIX, SCHEDULES_MODULE, scheduleFunctionName, type ScheduleDefinition, type ScheduleManifest, type Schedules, type ScheduleTick, } from './core/functions/schedules.js';
42
39
  export { parseSchedules, scheduleTimingIssue } from './builder/schedules.js';
43
- export { isWorkerFunctionKind, toFuncRegistrations, WORKER_FUNCTION_KINDS } from './core/functions/types.js';
40
+ export { ERROR_JSON_MAX_BYTES, ERRORS_MODULE, ON_ERROR_FUNCTION, PLATFORM_UNAVAILABLE_MESSAGE, PlatformUnavailableError, type CodeErrorEvent, type CodeErrorKind, type CodeErrorSourceType, type OnError, } from './core/functions/errors.js';
44
41
  export { toEventRegistry, toFunctionRegistry } from './builder/compile/registry.js';
45
42
  export { compileFunctionCode } from './builder/compile/function-code.js';
46
- export { COMPILE_CONCURRENCY, COMPILE_SEQUENCE_TIMEOUT_MS, compileAll, compileCompanyMetadataFromRepo, compileCompanyPart, compileRepo, compileSequence, compileSequenceBuild, runtimePackageSource, runtimePackageVersion, type CompileRepoEvent, type CompileRepoOptions, type CompileRepoSequenceResult, type CompileSequenceBuildResult, type CompileSequenceOptions, type CompileSequenceResult, } from './builder/compile/compile-sequence.js';
43
+ export { COMPILE_CONCURRENCY, COMPILE_SEQUENCE_TIMEOUT_MS, compileAll, compileCompanyPart, compileRepo, compileSequence, compileSequenceBuild, runtimePackageSource, runtimePackageVersion, type CompileRepoEvent, type CompileRepoOptions, type CompileRepoSequenceResult, type CompileSequenceOptions, type CompileSequenceResult, } from './builder/compile/compile-sequence.js';
47
44
  export { loadSequenceEvents, loadSequenceFunctions } from './builder/load.js';
48
45
  export { findTsModule } from './builder/paths.js';
49
46
  export type { OverlayClientMessage, OverlayExecuteMessage, OverlayExecuteResultMessage, OverlayAuthErrorMessage, OverlayAuthMessage, OverlayAuthOkMessage, OverlayMessage, OverlayNoticeMessage, OverlayPushMessage, OverlayReplacedMessage, OverlayServerMessage, } from './dev-overlay/protocol.js';
50
47
  export { encodeOverlayMessage, OVERLAY_REPLACED_CLOSE_CODE, parseOverlayMessage } from './dev-overlay/protocol.js';
51
- export { asCaseOrchestratorRun, buildActionContext, buildCaseOrchestratorContext, bindLogMeta, createFakeApiHost, defaultPlatformApis, emptyIntegration, createRpcApiHost, LOG_TAGS_HEADER, REQUEST_ID_HEADER, RUNTIME_VERSION_HEADER, encodeLogTagsHeader, formatRuntimeVersion, readLogTagsHeader, readRequestIdHeader, readRuntimeVersionHeader, makeCaseOrchestratorCtx, makeCtx, makeCtxAsync, noopLog, type ActionContext, type ActionDataSlice, type ApiHost, type CaseOrchestratorActionContext, type CaseOrchestratorApiHost, type CaseOrchestratorRunScope, type FakeApiHostOptions, type RunClaims, type RunScope, } from './fn-context/index.js';
52
- export { createAppRouter, createIntegrationRouter, createListSurfacesProcedure, createLogRouter, createPlatformRouter, createCaseOrchestratorToolsRouter, createRecordsRouter, isRpcCodedError, parseScriptInput, ScriptInputError, type AppRouter, type RpcCodedError, type RpcErrorCode, type IntegrationInvokeHandler, type LogEmitHandler, type PlatformInvokeHandler, type CaseOrchestratorToolInvokeHandler, type RecordsReadInput, type RecordsHandlers, type RecordsResult, type RecordsWriteInput, type RpcContext, } from './fn-context/rpc/index.js';
48
+ export { asCaseOrchestratorRun, buildActionContext, buildCaseOrchestratorContext, bindLogMeta, createFakeApiHost, defaultPlatformApis, emptyIntegration, createRpcApiHost, LOG_TAGS_HEADER, REQUEST_ID_HEADER, RUNTIME_VERSION_HEADER, encodeLogTagsHeader, formatRuntimeVersion, readLogTagsHeader, readRequestIdHeader, readRuntimeVersionHeader, makeCaseOrchestratorCtx, makeCtx, makeCtxAsync, noopLog, type ActionContext, type ActionDataSlice, type ApiGiven, type ApiHost, type CaseOrchestratorActionContext, type CaseOrchestratorApiHost, type CaseOrchestratorRunScope, type FakeApiHostOptions, type RunClaims, type RunScope, } from './fn-context/index.js';
49
+ export { createAppRouter, createIntegrationRouter, createListSurfacesProcedure, createLogRouter, createPlatformRouter, createCaseOrchestratorToolsRouter, createRecordsRouter, isRpcCodedError, parseScriptInput, reasonError, RpcReasonError, ScriptInputError, type AppRouter, type RpcCodedError, type RpcErrorCode, type IntegrationInvokeHandler, type LogEmitHandler, type PlatformInvokeHandler, type CaseOrchestratorToolInvokeHandler, type RecordsReadInput, type RecordsHandlers, type RecordsResult, type RecordsWriteInput, type RpcContext, } from './fn-context/rpc/index.js';
53
50
  export * from './compute-host/index.js';
54
51
  export type { BoundRow, Cell, CellBinding, CellRef, RowRef } from './core/slot/binding.js';
55
- export { announce, createRow, defineAction, definePage, deleteRow, emptyRuns, end, field, keypad, lastActionRun, pageEntry, perform, schemaField, transferTo, isSipUri, runFunction, messages, voicemail, type PageFarEnd, type VoicemailAction, pageFollowUps, choose, isChoose, refField, type RefFieldCell, type RefOption, type ChooseParam, type FunctionAction, type MessageAction, type FollowUpAction, type PageFollowUps, type PageTime, type MessageOptions, type PageMessages, tried, type PageActionRun, type ActionRunScope, type AnnounceAction, type ChannelAction, type DefinedPage, type EndAction, type KeypadAction, type PageChannel, type PageDefinition, type PageFunction, type PagePersona, type PageFollowUp, type PageFaq, type PageFaqEntry, type PageStart, checkPageStart, MAX_FAQ_ENTRIES, type PageRuns, type PageScheduledAction, type PerformAction, type TransferAction, type ActionContext as PageActionContext, type ActionParam, type ActionParameters, type CreateRowAction, type CustomAction, type DefinedAction, type DeleteRowAction, type FieldCell, type FieldOptions, type FindArgs, type Placeable, type SchemaFieldParam, type SchemaFieldOptions, type PageAction as PageScriptAction, type PageContext, type PageContextOf, type PageBaseContext, type PageCallCaps, type PagePreviousCall, type PageChannelCaps, type PageSmsMessage, type PageEmailMessage, PAGE_CHANNELS, type PageConversation, type PageHistory, type PageEntryArg, type PageRow as PageScriptRow, type Db, type ReadDb, type Slot, type SlotRef, type SlotState, type TableReader, type TableWriter, } from './core/page/define.js';
56
- export { actionKey, runKeyOf, fallbackPage, PageDocumentError, renderDocument, RowNames, type AutoAction, type BlockNode, type PageNode, type PageReads, type InputProperty, type InputSchema, type ReadSlot, type RenderDocumentInput, type RenderedAction, type RenderedCell, type RenderedPage as RenderedPageDocument, } from './core/page/render.js';
52
+ export { announceAction, createRowAction, definePage, deleteRowAction, emptyRuns, endAction, fieldCell, keypadAction, lastActionRun, pageEntry, transferTo, isSipUri, runFunction, voicemailAction, PAGE_TOOLS, type PageToolName, type ToolAction, type PageFarEnd, type PageHeard, type VoicemailAction, cancelFollowUpAction, followUpAction, choose, isChoose, refFieldCell, type RefFieldCell, type RefOption, type ChooseParam, type FunctionAction, type FollowUpAction, type CancelFollowUpAction, type PageTime, tried, type PageActionRun, type ActionRunScope, type AnnounceAction, type ChannelAction, type DefinedPage, type EndAction, type KeypadAction, type PageChannel, type PageDefinition, type PageFunction, type PagePersona, type PageNextStep, type PageFaq, type PageFaqEntry, type PageStart, checkPageStart, MAX_FAQ_ENTRIES, type PageRuns, type PageScheduledAction, type TransferAction, type ActionContext as PageActionContext, type ActionParam, type ActionParameters, type CreateRowAction, type CustomAction, type DeleteRowAction, type FieldCell, type FieldOptions, type FindArgs, type Placeable, type SchemaFieldParam, type PageAction as PageScriptAction, type PageContext, type PageContextOf, type PageBaseContext, type PageCallCaps, type PageCallPhase, type PagePreviousCall, type PageChannelCaps, type PageSmsMessage, type PageEmailMessage, PAGE_CHANNELS, type PageConversation, type PageHistory, type PageEntryArg, type PageRow as PageScriptRow, type Db, type ReadDb, type Slot, type SlotRef, type SlotState, type TableReader, type TableWriter, } from './core/page/define.js';
53
+ export { actionKey, runKeyOf, fallbackPage, PageDocumentError, pressedButton, renderDocument, RowNames, type AutoAction, type BlockNode, type PageNode, type PageReads, type InputProperty, type InputSchema, type ReadSlot, type RenderDocumentInput, type RenderedAction, type RenderedCell, type RenderedPage as RenderedPageDocument, } from './core/page/render.js';
54
+ export { announce, backgroundTransfer, block, button, cancelFollowUp, coldTransfer, convertTime, createRow, data, deleteRow, doNow, end, field, functionHandles, actionHandles, isNode, keypad, list, page, pressKeypad, refField, run, scheduleFollowUp, text, toFnPageResult, toolbox, voicemail, warmTransfer, type FunctionHandle, type PageActionHandle, type PageContent, type PageNode as PageFnNode, } from './core/page/fns.js';
55
+ export { isEnvelope, type Envelope, type EnvelopeNode, type EnvelopePage } from './core/page/envelope.js';
57
56
  export { TIMELINE_KINDS, type TimelineEntry, type TimelineKind, type TimelineWhere } from './core/page/timeline.js';
58
- export { blockAt, viewText, workspaceText, type WorkspaceNote, type WorkspaceTextOptions } from './core/page/workspace.js';
59
- export type { ArgsOf, CreateData, FindManyArgs, FindUniqueArgs, Id, IncludeArg, PageDocumentOf, PageFieldDesc, PageTablesDesc, RowOf, SchemaFieldPath, SelectArg, TypedActionContext, TypedActionParameters, TypedDefinedAction, TypedPageContext, TypedPageModule, TypedDb, TypedReadDb, TypedSchemaFieldParam, TypedSlot, UpdateData, Where, } from './core/page/typed.js';
57
+ export { blockAt, nextStepReference, viewText, workspaceText, type WorkspaceNote, type WorkspaceTextOptions } from './core/page/workspace.js';
58
+ export type { CreateData, FindManyArgs, FindUniqueArgs, Id, IncludeArg, PageFieldDesc, PageTablesDesc, RowOf, SelectArg, PageActionFn, TypedActionContext, TypedPageContext, TypedPageModule, TypedDb, TypedReadDb, TypedSlot, UpdateData, Where, } from './core/page/typed.js';
60
59
  export { resolvePageOps, type ActionOp, type DroppedOp, type OpenOp, type PageOp, type PageOpsAllowed, type ResolvedActionOp, type ResolvedOp, type ResolvedOpenOp, type ResolvedSlotOp, type SlotOp, } from './core/page/ops.js';
61
- export { defineCaseFunc } from './core/functions/define/case.js';
62
- export { defineNoCaseFunc } from './core/functions/define/no-case.js';
63
- export { bindDefines, type BoundDefines } from './core/functions/define/bind.js';
64
- export { emitCaseContextSource, emitSlotsSource } from './builder/codegen/emit.js';
65
- export { companyMetadataCompatibilityIssues, compiledTableEntries, compileSlotSchema, emptyFieldValue, formatFieldPath, getCompiledTable, getTableField, relationsOf, type TableRelation, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, DATE_VALUE_FORMAT, DATE_VALUE_PATTERN, DATETIME_VALUE_FORMAT, DATETIME_VALUE_PATTERN, isValidDataTypeValue, companyFieldToRuntime, makeFieldValue, parseFieldPath, refKind, refValueIssues, requireFieldPath, slotFieldEntries, slotFieldNames, validateBareValue, validateFieldRefs, } from './core/slot/index.js';
60
+ export { emitSlotsSource } from './builder/codegen/emit.js';
61
+ export { companySchemaCompatibilityIssues, compiledTableEntries, compileSlotSchema, emptyFieldValue, formatFieldPath, getCompiledTable, getTableField, relationsOf, type TableRelation, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, DATE_VALUE_FORMAT, DATE_VALUE_PATTERN, DATETIME_VALUE_FORMAT, DATETIME_VALUE_PATTERN, isValidDataTypeValue, companyFieldToRuntime, makeFieldValue, parseFieldPath, refKind, refValueIssues, requireFieldPath, slotFieldEntries, slotFieldNames, validateBareValue, validateFieldRefs, } from './core/slot/index.js';
66
62
  export type { RefKind } from './core/slot/index.js';
67
63
  export type { FieldPath, ParsedFieldPath, SlotRow, } from './core/slot/index.js';
68
- export { CHANNELS, isSpokenLanguage, SPOKEN_LANGUAGES, type Channel, type Direction, type ScheduledContactContext, type SpokenLanguage } from './core/conversation/index.js';
64
+ export { canonicalLanguage, CHANNELS, checkSpoken, CONTACT_LANGUAGES, fallbackSpoken, isContactLanguage, isSpokenLanguage, languageName, matchContactLanguage, matchSpokenLanguage, pickSpoken, SPOKEN_LANGUAGES, type Channel, type Direction, type ScheduledContactContext, type Spoken, type ContactLanguage, type SpokenLanguage, type SpokenTag, } from './core/conversation/index.js';
69
65
  export * from './core/case-orchestrator/index.js';
70
66
  export * from './core/party/index.js';
71
67
  export * from './voice-service/index.js';
72
- export { dayIn, formatTime, type FormatTimeOptions, type TimeStyle } from './core/page/time-format.js';
68
+ export { dayIn, formatTime, timeAt, timeParts, type FormatTimeOptions, type TimeParts, type TimeStyle } from './core/page/time-format.js';
69
+ export { CONSOLE_LINE_MAX_CHARS, CONSOLE_LINES_PER_RUN, CONSOLE_METHODS, DEFAULT_SANDBOX_LIMITS, runInSandbox, SandboxError, type ConsoleLevel, type ConsoleMethod, type ConsoleSink, type HostCall, type HostResult, type SandboxErrorKind, type SandboxInput, type SandboxLimits, type SandboxOutput, type SandboxStats, } from './core/page/sandbox.js';
70
+ export { asArray, checkListSizes, afterOf, COMBINATORS, findAnchors, indexConditions, indexedFieldsOf, indexOrder, indexValueOf, isPlainObject, isUuid, limitExceeded, matches, optionalCount, orderKeys, orderRows, pageRows, RECORDS_LIMITS, RecordsQueryError, refuseSearch, relatedKey, relationFilters, RELATION_INCLUDE_KEYS, selectFields, skipOf, startableConditions, tableIndexedFields, toSlot, unstartableWhy, WAY_BACK_FILTERS, wayBackFilters, type Anchor, type FindArgs as RecordsFindArgs, type IndexCondition, type IndexedField, type IndexOrder, type IndexValue, type MatchContext, type RecordsCall, type RecordsMethod, type RecordsQueryErrorCode, type RowOut, type SlotOut, type WhereInput, } from './core/page/records-query.js';
71
+ export { atCall, dayCall, DEFAULT_PAGE_ZONE, partsCall, timeCall, timeOfCaller } from './core/page/page-host.js';
73
72
  export * from './index.js';
74
73
  export * from './worker.js';
75
74
  export * from './compiler.js';
package/dist/platform.js CHANGED
@@ -1,54 +1,55 @@
1
- export { ROW_ID_FIELD, ROW_SYSTEM_KEYS, ROW_TIME_KEYS, isRowTimeKey, idFieldCore, normalFieldCoreSchema, companyNormalFieldDefSchema, tableRefSchema, compiledCompanyMetadataSchema, companyFieldDefSchema, companyTableDefSchema, companySchemaSchema, contactScheduleValueSchema, localTimeRangeSchema, isCompanySchema, EMPTY_SESSION_SCHEMA, sessionFieldDefSchema, sessionSchemaSchema, } from './core/slot/schema.js';
2
- export { CONTACT_OPT_OUT_FIELDS, CONTACT_TABLE, LIMITS, POLICY_IDS, PLATFORM_CONTACT_FIELDS, PLATFORM_SESSION_FIELDS, PLATFORM_SESSION_SCHEMA, SESSION_TABLE, compileCompanyMetadata, sessionSchemaIssues, isCustomTable, isParentField, isRecordTable, parentOf, subjectTableIssues, compileCompanySchema, } from './core/slot/company-metadata.js';
1
+ export { ROW_ID_FIELD, ROW_SYSTEM_KEYS, ROW_TIME_KEYS, isRowTimeKey, idFieldCore, normalFieldCoreSchema, companyNormalFieldDefSchema, tableRefSchema, companyFieldDefSchema, companyTableDefSchema, companySchemaSchema, contactScheduleValueSchema, localTimeRangeSchema, isCompanySchema, EMPTY_SESSION_SCHEMA, sessionFieldDefSchema, sessionSchemaSchema, } from './core/slot/schema.js';
2
+ export { CONTACT_OPT_OUT_FIELDS, CONTACT_TABLE, LIMITS, POLICY_IDS, PLATFORM_CONTACT_FIELDS, PLATFORM_SESSION_FIELDS, PLATFORM_SESSION_SCHEMA, SESSION_TABLE, validateCompanySchema, sessionSchemaIssues, isCustomTable, isParentField, isRecordTable, parentOf, subjectTableIssues, } from './core/slot/company-metadata.js';
3
3
  export { STATE_CODES, STATE_TIMEZONES, areaCodeTimezone, contactTimezone, knownTimezone, postalTimezone, stateCode, } from './core/slot/contact-timezone.js';
4
4
  export { randomTimeBetween } from './core/case-orchestrator/time.js';
5
5
  export { contactHoursOn, contactScheduleHours, everyDay, nextContactTime, withinContactHours, } from './core/case-orchestrator/contact-hours.js';
6
6
  export { integrationSurfaceKeys } from './core/context/types.js';
7
7
  export { lookupRef, parentRef } from './core/slot/id-ref.js';
8
- export { emailGetAttachmentInput, emailGetAttachmentOutput, emailGetMessageInput, emailGetMessageOutput, emailListMessagesInput, emailListMessagesOutput, emailMockService, emailProvider, emailSendEmailInput, emailSendEmailOutput, } from './core/context/email.js';
8
+ export { EMAIL_PLATFORM_ONLY_METHODS, emailGetAttachmentInput, emailGetAttachmentOutput, emailGetMessageInput, emailGetMessageOutput, emailListMessagesInput, emailListMessagesOutput, emailMockService, emailProvider, emailSendEmailInput, emailSendEmailOutput, } from './core/context/email.js';
9
9
  export { CALL_PAGE_LIMIT_MAX, callDirection, callGetInput, callGetOutput, callListInput, callListOutput, callMockService, callParticipant, callRecord, callSurface, callTranscriptInput, callTranscriptLine, callTranscriptOutput, } from './core/context/call.js';
10
10
  export { CONTACT_PAGE_LIMIT_MAX, contactCreateInput, contactFindInput, contactFindOutput, contactListInput, contactListOutput, contactMockService, contactSummary, contactSurface, slotFieldValue, } from './core/context/contact.js';
11
- export { instanceCloseInput, instanceFindForContactInput, instanceIdInput, instanceListOutput, instanceNotifyInput, instanceNotifyOutput, instanceSetVariablesInput, instanceStartInput, instanceStartOutput, instanceSummary, instancesMockService, instancesSurface, } from './core/context/instances.js';
11
+ export { instanceCloseInput, instanceCloseOutput, instanceFindForContactInput, instanceIdInput, instanceListOutput, instanceNotifyInput, instanceNotifyOutput, instanceSetVariablesInput, instanceStartInput, instanceStartOutput, instanceSummary, instancesMockService, instancesSurface, } from './core/context/instances.js';
12
12
  export { channelMailbox, channelPhoneNumber, channelsListInput, channelsListOutput, channelsMockService, channelsSurface, } from './core/context/channels.js';
13
13
  export { exchangeEmailThreadInput, exchangeEmailThreadOutput, exchangeLastInput, exchangeLastOutput, exchangeRef, exchangeSummary, exchangesMockService, exchangesSurface, } from './core/context/exchanges.js';
14
14
  export { SYSTEM_VARIABLES, compileVariables, defineSequence, defineVariables, isSystemVariable, json, readVariables, startVariables, variableValueIssue, variablesSize, variablesWriteIssues, } from './core/sequence/index.js';
15
- export { EMAIL_PAGE_LIMIT_MAX, emailDirection, emailGetInput, emailGetOutput, emailHistoryMockService, emailHistorySurface, emailListInput, emailListOutput, emailRecord, } from './core/context/email-message.js';
15
+ export { EMAIL_PAGE_LIMIT_MAX, emailDirection, emailGetInput, emailGetOutput, emailHistoryMockService, emailHistorySurface, emailListInput, emailListOutput, emailRecord, emailSendInput, emailSendOutput, } from './core/context/email-message.js';
16
16
  export { KV_KEY_MAX, KV_SCOPES, KV_TTL_SECONDS_MAX, KV_VALUE_MAX, kvDelInput, kvDelOutput, kvGetInput, kvGetOutput, kvMockService, kvScope, kvSetInput, kvSetOutput, kvSurface, } from './core/context/kv.js';
17
17
  export { SMS_PAGE_LIMIT_MAX, smsDirection, smsGetInput, smsGetOutput, smsListInput, smsListOutput, smsMockService, smsRecord, smsSurface, } from './core/context/sms.js';
18
18
  export { bindEnvService, envMockService, readEnvGet } from './core/context/env.js';
19
19
  export { platformSurfaces } from './core/context/platform-registry.js';
20
- export { resolveFuncName } from './core/functions/func-ref.js';
21
- export { COMPANY_SCOPE } from './builder/types.js';
20
+ export { COMPANY_SCOPE, CONTEXT_PAGE_FUNCTION, functionKey, functionScriptFile } from './builder/types.js';
22
21
  export { parseOfficeHours, resolveOfficeHours, } from './core/office-hours/index.js';
23
- export { defineEvents, defineWebhook } from './core/functions/define/events.js';
24
- export { isSystemEventName, SYSTEM_EVENT_NAMES, SYSTEM_EVENTS, systemEventKind, WEBHOOK_RECEIVED_FUNCTION, webhookOutcome, } from './core/functions/events.js';
22
+ export { isSystemEventName, SYSTEM_EVENT_NAMES, SYSTEM_EVENTS, WEBHOOK_RECEIVED_FUNCTION, webhookOutcome, } from './core/functions/events.js';
25
23
  export { defineSchedules, SCHEDULE_FUNCTION_PREFIX, SCHEDULES_MODULE, scheduleFunctionName, } from './core/functions/schedules.js';
26
24
  export { parseSchedules, scheduleTimingIssue } from './builder/schedules.js';
27
- export { isWorkerFunctionKind, toFuncRegistrations, WORKER_FUNCTION_KINDS } from './core/functions/types.js';
25
+ export { ERROR_JSON_MAX_BYTES, ERRORS_MODULE, ON_ERROR_FUNCTION, PLATFORM_UNAVAILABLE_MESSAGE, PlatformUnavailableError, } from './core/functions/errors.js';
28
26
  export { toEventRegistry, toFunctionRegistry } from './builder/compile/registry.js';
29
27
  export { compileFunctionCode } from './builder/compile/function-code.js';
30
- export { COMPILE_CONCURRENCY, COMPILE_SEQUENCE_TIMEOUT_MS, compileAll, compileCompanyMetadataFromRepo, compileCompanyPart, compileRepo, compileSequence, compileSequenceBuild, runtimePackageSource, runtimePackageVersion, } from './builder/compile/compile-sequence.js';
28
+ export { COMPILE_CONCURRENCY, COMPILE_SEQUENCE_TIMEOUT_MS, compileAll, compileCompanyPart, compileRepo, compileSequence, compileSequenceBuild, runtimePackageSource, runtimePackageVersion, } from './builder/compile/compile-sequence.js';
31
29
  export { loadSequenceEvents, loadSequenceFunctions } from './builder/load.js';
32
30
  export { findTsModule } from './builder/paths.js';
33
31
  export { encodeOverlayMessage, OVERLAY_REPLACED_CLOSE_CODE, parseOverlayMessage } from './dev-overlay/protocol.js';
34
32
  export { asCaseOrchestratorRun, buildActionContext, buildCaseOrchestratorContext, bindLogMeta, createFakeApiHost, defaultPlatformApis, emptyIntegration, createRpcApiHost, LOG_TAGS_HEADER, REQUEST_ID_HEADER, RUNTIME_VERSION_HEADER, encodeLogTagsHeader, formatRuntimeVersion, readLogTagsHeader, readRequestIdHeader, readRuntimeVersionHeader, makeCaseOrchestratorCtx, makeCtx, makeCtxAsync, noopLog, } from './fn-context/index.js';
35
- export { createAppRouter, createIntegrationRouter, createListSurfacesProcedure, createLogRouter, createPlatformRouter, createCaseOrchestratorToolsRouter, createRecordsRouter, isRpcCodedError, parseScriptInput, ScriptInputError, } from './fn-context/rpc/index.js';
33
+ export { createAppRouter, createIntegrationRouter, createListSurfacesProcedure, createLogRouter, createPlatformRouter, createCaseOrchestratorToolsRouter, createRecordsRouter, isRpcCodedError, parseScriptInput, reasonError, RpcReasonError, ScriptInputError, } from './fn-context/rpc/index.js';
36
34
  export * from './compute-host/index.js';
37
- export { announce, createRow, defineAction, definePage, deleteRow, emptyRuns, end, field, keypad, lastActionRun, pageEntry, perform, schemaField, transferTo, isSipUri, runFunction, messages, voicemail, pageFollowUps, choose, isChoose, refField, tried, checkPageStart, MAX_FAQ_ENTRIES, PAGE_CHANNELS, } from './core/page/define.js';
38
- export { actionKey, runKeyOf, fallbackPage, PageDocumentError, renderDocument, RowNames, } from './core/page/render.js';
35
+ export { announceAction, createRowAction, definePage, deleteRowAction, emptyRuns, endAction, fieldCell, keypadAction, lastActionRun, pageEntry, transferTo, isSipUri, runFunction, voicemailAction, PAGE_TOOLS, cancelFollowUpAction, followUpAction, choose, isChoose, refFieldCell, tried, checkPageStart, MAX_FAQ_ENTRIES, PAGE_CHANNELS, } from './core/page/define.js';
36
+ export { actionKey, runKeyOf, fallbackPage, PageDocumentError, pressedButton, renderDocument, RowNames, } from './core/page/render.js';
37
+ // The page in functions (76): the company API's, and what the platform and its tests read of them.
38
+ export { announce, backgroundTransfer, block, button, cancelFollowUp, coldTransfer, convertTime, createRow, data, deleteRow, doNow, end, field, functionHandles, actionHandles, isNode, keypad, list, page, pressKeypad, refField, run, scheduleFollowUp, text, toFnPageResult, toolbox, voicemail, warmTransfer, } from './core/page/fns.js';
39
+ export { isEnvelope } from './core/page/envelope.js';
39
40
  export { TIMELINE_KINDS } from './core/page/timeline.js';
40
- export { blockAt, viewText, workspaceText } from './core/page/workspace.js';
41
+ export { blockAt, nextStepReference, viewText, workspaceText } from './core/page/workspace.js';
41
42
  export { resolvePageOps, } from './core/page/ops.js';
42
- export { defineCaseFunc } from './core/functions/define/case.js';
43
- export { defineNoCaseFunc } from './core/functions/define/no-case.js';
44
- export { bindDefines } from './core/functions/define/bind.js';
45
- export { emitCaseContextSource, emitSlotsSource } from './builder/codegen/emit.js';
46
- export { companyMetadataCompatibilityIssues, compiledTableEntries, compileSlotSchema, emptyFieldValue, formatFieldPath, getCompiledTable, getTableField, relationsOf, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, DATE_VALUE_FORMAT, DATE_VALUE_PATTERN, DATETIME_VALUE_FORMAT, DATETIME_VALUE_PATTERN, isValidDataTypeValue, companyFieldToRuntime, makeFieldValue, parseFieldPath, refKind, refValueIssues, requireFieldPath, slotFieldEntries, slotFieldNames, validateBareValue, validateFieldRefs, } from './core/slot/index.js';
47
- export { CHANNELS, isSpokenLanguage, SPOKEN_LANGUAGES } from './core/conversation/index.js';
43
+ export { emitSlotsSource } from './builder/codegen/emit.js';
44
+ export { companySchemaCompatibilityIssues, compiledTableEntries, compileSlotSchema, emptyFieldValue, formatFieldPath, getCompiledTable, getTableField, relationsOf, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, DATE_VALUE_FORMAT, DATE_VALUE_PATTERN, DATETIME_VALUE_FORMAT, DATETIME_VALUE_PATTERN, isValidDataTypeValue, companyFieldToRuntime, makeFieldValue, parseFieldPath, refKind, refValueIssues, requireFieldPath, slotFieldEntries, slotFieldNames, validateBareValue, validateFieldRefs, } from './core/slot/index.js';
45
+ export { canonicalLanguage, CHANNELS, checkSpoken, CONTACT_LANGUAGES, fallbackSpoken, isContactLanguage, isSpokenLanguage, languageName, matchContactLanguage, matchSpokenLanguage, pickSpoken, SPOKEN_LANGUAGES, } from './core/conversation/index.js';
48
46
  export * from './core/case-orchestrator/index.js';
49
47
  export * from './core/party/index.js';
50
48
  export * from './voice-service/index.js';
51
- export { dayIn, formatTime } from './core/page/time-format.js';
49
+ export { dayIn, formatTime, timeAt, timeParts } from './core/page/time-format.js';
50
+ export { CONSOLE_LINE_MAX_CHARS, CONSOLE_LINES_PER_RUN, CONSOLE_METHODS, DEFAULT_SANDBOX_LIMITS, runInSandbox, SandboxError, } from './core/page/sandbox.js';
51
+ export { asArray, checkListSizes, afterOf, COMBINATORS, findAnchors, indexConditions, indexedFieldsOf, indexOrder, indexValueOf, isPlainObject, isUuid, limitExceeded, matches, optionalCount, orderKeys, orderRows, pageRows, RECORDS_LIMITS, RecordsQueryError, refuseSearch, relatedKey, relationFilters, RELATION_INCLUDE_KEYS, selectFields, skipOf, startableConditions, tableIndexedFields, toSlot, unstartableWhy, WAY_BACK_FILTERS, wayBackFilters, } from './core/page/records-query.js';
52
+ export { atCall, dayCall, DEFAULT_PAGE_ZONE, partsCall, timeCall, timeOfCaller } from './core/page/page-host.js';
52
53
  // The other entries in full, so this one holds them by construction (`package-entries.test.ts`).
53
54
  export * from './index.js';
54
55
  export * from './worker.js';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=testing-compile-child.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Compiles one sequence for the testing entry (`testing.ts`) in a process of its own, and sends back its
3
+ * build and compiled schema. Out of the test's process: the compile loads the company's code through its
4
+ * own import hooks, which would otherwise count in the test run's coverage and stay installed there.
5
+ *
6
+ * Run as `node testing-compile-child.js <repoRoot> <sequence>`; answers one IPC message.
7
+ */
8
+ import { compileSequence } from './builder/compile/compile-sequence.js';
9
+ const [repoRoot, sequence] = process.argv.slice(2);
10
+ async function main() {
11
+ try {
12
+ const { build, schema } = await compileSequence(repoRoot, sequence, { dryRun: true });
13
+ process.send({ ok: true, build, schema });
14
+ }
15
+ catch (error) {
16
+ process.send({ ok: false, error: error instanceof Error ? error.message : String(error) });
17
+ }
18
+ }
19
+ void main();
20
+ //# sourceMappingURL=testing-compile-child.js.map