@superpanel-sdk/runtime 0.2.2 → 0.2.3

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 (39) hide show
  1. package/dist/builder/compile/compile-agenda.js +9 -4
  2. package/dist/cli/serve/index.js +60 -12
  3. package/dist/compute-host/index.d.ts +2 -0
  4. package/dist/compute-host/index.js +1 -0
  5. package/dist/compute-host/read-only-cache.d.ts +20 -0
  6. package/dist/compute-host/read-only-cache.js +61 -0
  7. package/dist/compute-host/source-compute-host.js +7 -2
  8. package/dist/core/context/types.d.ts +19 -1
  9. package/dist/core/functions/define/custom.d.ts +1 -1
  10. package/dist/core/functions/types.d.ts +4 -4
  11. package/dist/core/slot/index.d.ts +1 -1
  12. package/dist/core/slot/index.js +1 -1
  13. package/dist/core/slot/types.d.ts +2 -0
  14. package/dist/core/slot/write.d.ts +8 -1
  15. package/dist/core/slot/write.js +145 -38
  16. package/dist/core/stage/builders.d.ts +23 -5
  17. package/dist/core/stage/builders.js +3 -0
  18. package/dist/core/stage/drive.d.ts +1 -1
  19. package/dist/core/stage/drive.js +9 -8
  20. package/dist/core/stage/flatten.js +13 -11
  21. package/dist/core/stage/index.d.ts +8 -4
  22. package/dist/core/stage/index.js +5 -2
  23. package/dist/core/stage/interrupts.d.ts +28 -0
  24. package/dist/core/stage/interrupts.js +120 -0
  25. package/dist/core/stage/ivr-fields.d.ts +9 -0
  26. package/dist/core/stage/ivr-fields.js +75 -0
  27. package/dist/core/stage/transfer-fields.d.ts +6 -1
  28. package/dist/core/stage/transfer-fields.js +44 -3
  29. package/dist/core/stage/transfer-spec.d.ts +48 -0
  30. package/dist/core/stage/transfer-spec.js +113 -0
  31. package/dist/core/stage/types.d.ts +45 -14
  32. package/dist/core/stage/validate.js +105 -1
  33. package/dist/core/stage/walk.d.ts +5 -0
  34. package/dist/core/stage/walk.js +33 -10
  35. package/dist/fn-context/rpc/trpc-client.js +3 -0
  36. package/dist/index.d.ts +4 -4
  37. package/dist/index.js +2 -2
  38. package/dist/voice-service/types.d.ts +3 -0
  39. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { evaluateWhen } from './finish-when.js';
2
+ import { ivrAttempted } from './ivr-fields.js';
2
3
  function startsWithGroup(groupPath, prefix) {
3
4
  if (prefix.length === 0)
4
5
  return true;
@@ -6,7 +7,7 @@ function startsWithGroup(groupPath, prefix) {
6
7
  return false;
7
8
  return prefix.every((id, i) => groupPath[i] === id);
8
9
  }
9
- async function consider(item, snapshot, compute, skip, via, skipped, decisions) {
10
+ async function consider(item, snapshot, compute, skip, via, skipped, decisions, stats) {
10
11
  if (skip.has(item.placementId)) {
11
12
  skipped.push({ placementId: item.placementId, blockId: item.id, reason: 'skipped' });
12
13
  decisions.push({
@@ -19,6 +20,7 @@ async function consider(item, snapshot, compute, skip, via, skipped, decisions)
19
20
  });
20
21
  return 'skip';
21
22
  }
23
+ stats.evals += 1;
22
24
  const applies = await evaluateWhen(item.applyWhen, snapshot, compute);
23
25
  if (!applies.pass) {
24
26
  skipped.push({ placementId: item.placementId, blockId: item.id, reason: 'folded' });
@@ -32,6 +34,19 @@ async function consider(item, snapshot, compute, skip, via, skipped, decisions)
32
34
  });
33
35
  return 'fold';
34
36
  }
37
+ if (item.kind === 'ivr' && ivrAttempted(item, snapshot)) {
38
+ skipped.push({ placementId: item.placementId, blockId: item.id, reason: 'done' });
39
+ decisions.push({
40
+ placementId: item.placementId,
41
+ blockId: item.id,
42
+ status: 'done',
43
+ via,
44
+ applyWhen: true,
45
+ finishWhen: true,
46
+ });
47
+ return 'done';
48
+ }
49
+ stats.evals += 1;
35
50
  const finished = await evaluateWhen(item.finishWhen, snapshot, compute);
36
51
  if (finished.done) {
37
52
  skipped.push({ placementId: item.placementId, blockId: item.id, reason: 'done' });
@@ -55,40 +70,48 @@ async function consider(item, snapshot, compute, skip, via, skipped, decisions)
55
70
  });
56
71
  return 'hit';
57
72
  }
58
- async function firstHit(items, snapshot, compute, skip, via, skipped, decisions, considered) {
73
+ async function firstHit(items, snapshot, compute, skip, via, skipped, decisions, considered, stats) {
59
74
  for (const item of items) {
60
75
  if (considered.has(item.placementId))
61
76
  continue;
62
77
  considered.add(item.placementId);
63
- if ((await consider(item, snapshot, compute, skip, via, skipped, decisions)) === 'hit') {
78
+ if ((await consider(item, snapshot, compute, skip, via, skipped, decisions, stats)) === 'hit') {
64
79
  return item;
65
80
  }
66
81
  }
67
82
  return null;
68
83
  }
69
84
  export async function walkAgenda(items, snapshot, options = {}) {
85
+ const started = Date.now();
70
86
  const skip = options.skipPlacementIds ?? new Set();
71
87
  const skipped = [];
72
88
  const decisions = [];
73
89
  const considered = new Set();
90
+ const stats = { evals: 0 };
74
91
  const currentId = options.currentPlacementId ?? null;
92
+ const finish = (hit, reason) => ({
93
+ hit,
94
+ reason,
95
+ skipped,
96
+ decisions,
97
+ stats: { durationMs: Date.now() - started, evals: stats.evals },
98
+ });
75
99
  if (currentId) {
76
100
  const current = items.find((item) => item.placementId === currentId);
77
101
  if (current && current.groupPath.length > 0) {
78
102
  for (let depth = current.groupPath.length; depth >= 1; depth--) {
79
103
  const prefix = current.groupPath.slice(0, depth);
80
104
  const groupItems = items.filter((item) => startsWithGroup(item.groupPath, prefix));
81
- const hit = await firstHit(groupItems, snapshot, options.compute, skip, 'sticky', skipped, decisions, considered);
82
- if (hit) {
83
- return { hit, reason: 'sticky', skipped, decisions };
84
- }
105
+ const hit = await firstHit(groupItems, snapshot, options.compute, skip, 'sticky', skipped, decisions, considered, stats);
106
+ if (hit)
107
+ return finish(hit, 'sticky');
85
108
  }
86
109
  }
87
110
  }
88
- const hit = await firstHit(items, snapshot, options.compute, skip, 'scan', skipped, decisions, considered);
111
+ const hit = await firstHit(items, snapshot, options.compute, skip, 'scan', skipped, decisions, considered, stats);
89
112
  if (hit)
90
- return { hit, reason: 'scan', skipped, decisions };
91
- return { hit: null, reason: 'complete', skipped, decisions };
113
+ return finish(hit, 'scan');
114
+ return finish(null, 'complete');
92
115
  }
93
116
  export async function unresolvedFinishWhenFields(item, snapshot, compute) {
94
117
  return (await evaluateWhen(item.finishWhen, snapshot, compute)).failedFields;
@@ -103,7 +103,10 @@ export function createRpcApiHost(options) {
103
103
  return {
104
104
  async buildApi(_run) {
105
105
  const c = getClient(options.baseUrl);
106
+ const started = Date.now();
107
+ console.log(`[rpc timing] integration.listBindings start url=${options.baseUrl}`);
106
108
  const metas = await rpcSafe(c.integration.listBindings.query());
109
+ console.log(`[rpc timing] integration.listBindings ok ${Date.now() - started}ms count=${metas.length}`);
107
110
  return {
108
111
  ...buildPlatformApis(c),
109
112
  integration: buildSurfaces(c, metas),
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { idRef } from './core/slot/id-ref.js';
5
5
  export type { HubspotApi, HubspotAssociationListOutput, HubspotCreateContactInput, HubspotCreateContactOutput, HubspotCreateDealInput, HubspotCreateDealOutput, HubspotCreateNoteInput, HubspotCreateTaskInput, HubspotEngagementOutput, HubspotGetAssociatedContactsInput, HubspotGetAssociatedDealsInput, HubspotGetContactInput, HubspotGetContactOutput, HubspotGetCrmUrlInput, HubspotGetCrmUrlOutput, HubspotGetDealInput, HubspotGetDealOutput, HubspotGetOwnerInput, HubspotGetOwnerOutput, HubspotLogCallInput, HubspotLogEmailInput, HubspotLogSmsInput, HubspotRecord, HubspotSearchContactsInput, HubspotSearchContactsOutput, HubspotService, HubspotUpdateContactInput, HubspotUpdateContactOutput, HubspotUpdateDealInput, HubspotUpdateDealOutput, HubspotUpsertContactInput, HubspotUpsertContactOutput, } from './core/context/hubspot.js';
6
6
  export type { DocusignApi, DocusignCreateEnvelopeFromTemplateInput, DocusignCreateEnvelopeFromTemplateOutput, DocusignCreateRecipientViewFromTemplateInput, DocusignCreateRecipientViewFromTemplateOutput, DocusignEnvelopeIdInput, DocusignGetEnvelopeRecipientsOutput, DocusignGetEnvelopeSigningStatusOutput, DocusignGetEnvelopeStatusOutput, DocusignListRecentEnvelopesInput, DocusignListRecentEnvelopesOutput, DocusignListTemplatesOutput, DocusignRecentEnvelope, DocusignRecipient, DocusignSearchEnvelopesByEmailInput, DocusignSearchEnvelopesByEmailOutput, DocusignService, } from './core/context/docusign.js';
7
7
  export type { FilevineAddHashtagToProjectInput, FilevineAddHashtagToProjectOutput, FilevineApi, FilevineCollectionItemInput, FilevineCommentOutput, FilevineCreateCommentInput, FilevineCreateContactInput, FilevineCreateContactOutput, FilevineCreateNoteInput, FilevineCreateNoteWithCommentInput, FilevineCreateNoteWithCommentOutput, FilevineCreateProjectCollectionItemInput, FilevineCreateProjectCollectionItemOutput, FilevineCreateProjectInput, FilevineCreateProjectOutput, FilevineDeleteProjectCollectionItemInput, FilevineDeleteProjectCollectionItemOutput, FilevineFolder, FilevineGetAssociatedProjectsInput, FilevineGetAssociatedProjectsOutput, FilevineGetContactInput, FilevineGetContactOutput, FilevineGetCrmUrlInput, FilevineGetCrmUrlOutput, FilevineGetProjectCollectionItemInput, FilevineGetProjectCollectionItemOutput, FilevineGetProjectCollectionItemsInput, FilevineGetProjectCollectionItemsOutput, FilevineGetProjectFoldersInput, FilevineGetProjectFoldersOutput, FilevineGetProjectInput, FilevineGetProjectOutput, FilevineLogCallInput, FilevineLogEmailInput, FilevineLogSmsInput, FilevineNoteOutput, FilevineProperties, FilevineRecord, FilevineSearchContactsInput, FilevineSearchContactsOutput, FilevineService, FilevineUpdateContactInput, FilevineUpdateContactOutput, FilevineUpdateProjectCollectionItemInput, FilevineUpdateProjectCollectionItemOutput, FilevineUpdateProjectInput, FilevineUpdateProjectOutput, FilevineUploadDocumentInput, FilevineUploadDocumentOutput, } from './core/context/filevine.js';
8
- export type { CaseContext, ContactApi, BoundIntegrationMeta, EnvApi, EnvService, FieldState, HttpApi, IntegrationAccountFields, IntegrationApi, IntegrationStub, IntegrationSurfaceKey, IntegrationTarget, TwilioApi, TwilioCreateCallInput, TwilioCreateCallOutput, TwilioIncomingNumber, TwilioListIncomingNumbersOutput, TwilioSendSmsInput, TwilioSendSmsOutput, TwilioService, Logger, MakeCtxOverrides, Slots, SystemContext, Writes, } from './core/context/types.js';
8
+ export type { CaseContext, ContactApi, BoundIntegrationMeta, EnvApi, EnvService, FieldState, HttpApi, IntegrationAccountFields, IntegrationApi, IntegrationStub, IntegrationSurfaceKey, IntegrationTarget, TwilioApi, TwilioCreateCallInput, TwilioCreateCallOutput, TwilioIncomingNumber, TwilioListIncomingNumbersOutput, TwilioSendSmsInput, TwilioSendSmsOutput, TwilioService, Logger, MakeCtxOverrides, Slots, SystemContext, FieldWrites, RowWrite, StructuredWrites, Writes, } from './core/context/types.js';
9
9
  export { CONTACT_PAGE_LIMIT_MAX, contactListInput, contactListOutput, contactMockService, contactSummary, contactSurface, type ContactListParams, type ContactListResult, type ContactSummary, } from './core/context/contact.js';
10
10
  export { dbDelInput, dbDelOutput, dbGetInput, dbGetOutput, dbMockService, dbSetInput, dbSetOutput, dbSurface, KV_KEY_MAX, KV_TTL_SECONDS_MAX, KV_VALUE_MAX, type DbApi, type DbDelInput, type DbDelOutput, type DbGetInput, type DbGetOutput, type DbSetInput, type DbSetOutput, } from './core/context/db.js';
11
11
  export { bindEnvService, envMockService, readEnvGet } from './core/context/env.js';
@@ -39,9 +39,9 @@ export { defineCustomFunc } from './core/functions/define/custom.js';
39
39
  export { defineSystemFunc } from './core/functions/define/system.js';
40
40
  export { mergeEffectiveSchema } from './builder/merge.js';
41
41
  export { emitCaseContextSource, emitSlotsSource } from './builder/codegen/emit.js';
42
- export { affectedDerivedFields, applyFieldPatch, applyFieldPatchAndRecompute, applySlotFilling, applySlotFillingAndRecompute, applyWrites, applyWritesAndRecompute, buildDependencyGraph, buildFieldCatalog, buildSlotFillingJsonSchema, cloneSnapshot, commitFieldWrite, compiledTableEntries, compileSlotSchema, emptyFieldValue, emptyMultiRow, emptySlotRow, fieldChanged, formatFieldPath, getCompiledTable, getFieldState, getFieldValue, getLastThreeValues, getRowField, getSingleField, getSnapshotTable, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, isSnapshotSingleRow, isValidDataTypeValue, listConversationFields, makeFieldValue, markAskedUnknown, parseFieldPath, recomputeDerived, requireFieldPath, rowValueEntries, slotFieldEntries, slotFieldNames, snapshotFrom, toEffectiveSchema, toHistoryEntry, validateBareValue, validateExtractedField, validateFieldRefs, validateSlotFillingOutput, } from './core/slot/index.js';
42
+ export { affectedDerivedFields, applyFieldPatch, applyFieldPatchAndRecompute, applySlotFilling, applySlotFillingAndRecompute, applyWrites, applyWritesAndRecompute, buildDependencyGraph, buildFieldCatalog, buildSlotFillingJsonSchema, cloneSnapshot, commitFieldWrite, compiledTableEntries, compileSlotSchema, emptyFieldValue, emptyMultiRow, emptySlotRow, fieldChanged, formatFieldPath, getCompiledTable, getFieldState, getFieldValue, getLastThreeValues, getRowField, getSingleField, getSnapshotTable, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, isSnapshotSingleRow, isValidDataTypeValue, listConversationFields, makeFieldValue, markAskedUnknown, isRowWrite, isStructuredWrites, normalizeWrites, parseFieldPath, recomputeDerived, requireFieldPath, rowValueEntries, slotFieldEntries, slotFieldNames, snapshotFrom, toEffectiveSchema, toHistoryEntry, validateBareValue, validateExtractedField, validateFieldRefs, validateSlotFillingOutput, } from './core/slot/index.js';
43
43
  export type { ApplySlotFillingOptions, DependencyGraphResult, FieldPatchInput, FieldPath, ParsedFieldPath, RecomputeOptions, SfSchemaOptions, SlotRow, SnapshotSeed, ValidateSlotFillingOptions, } from './core/slot/index.js';
44
- export type { ActionBlock, ActionNode, AgendaBlock, AgendaConfig, AgendaHeader, AgendaTree, ApplyWhen, AuthoringNode, AuthoringWhen, BranchNode, Channel, CompiledActionBlock, CompiledAgenda, CompiledAgendaBlock, CompiledTopicBlock, CompiledTransferBlock, CompiledWhen, Condition, ConditionEval, FirstMessage, FinishWhen, FinishWhenEval, FlatActionItem, FlatAgendaItem, FlatNodePlacement, FlatTopicItem, FlatTransferItem, FlattenOptions, FlattenResult, Interrupt, SequenceAgendas, JsonRulesCondition, NodePlacement, OnNoProgress, OtherwiseSentinel, Placement, SectionNode, SectionPlacement, SimulateResult, SimulatedItem, SimulatedItemStatus, SwitchOnNode, TopicBlock, TopicNode, TransferBlock, TransferNode, ValidateAgendaOptions, WalkDecision, WalkHitReason, WalkOptions, WalkResult, WalkSkip, WalkSkipReason, When, WhenEval, AdvanceResult, StageDriveHooks, StageDriveResult, StageDriveState, } from './core/stage/index.js';
45
- export { DEFAULT_MAX_ACTIONS_PER_TURN, LAST_TRANSFER_RESULT_FIELD, action, advanceAgenda, agenda, andCompiledWhen, branch, collectJsonRulesFacts, collectTransferBlocks, compileAuthoringWhen, compileFinishWhen, compileWhen, driveAgenda, evaluateFinishWhen, evaluateJsonRules, evaluateWhen, extractBlocksFromTree, extractTemplateFields, finishWhenFields, flattenAgendaConfig, flattenAgendaPlacements, flattenAgendaTree, isAgendaTree, isSequenceAgendas, isOtherwise, jsonRules, looksLikeJsonRules, normalizeJsonRules, normalizeSequenceAgendas, notAnyWhen, otherwise, parseJsonRules, registerTransferSessionFields, section, simulateAgenda, switchOn, topic, transfer, transferFieldKey, transferResultField, transferWrites, treeToPlacements, unresolvedFinishWhenFields, validateCompiledAgenda, walkAgenda, watchdogHint, whenFields, } from './core/stage/index.js';
44
+ export type { ActionBlock, ActionNode, AgendaBlock, AgendaConfig, AgendaHeader, AgendaTree, ApplyWhen, AuthoringNode, AuthoringWhen, BranchNode, Channel, CompiledActionBlock, CompiledAgenda, CompiledAgendaBlock, CompiledTopicBlock, CompiledIvrBlock, CompiledTransferBlock, CompiledWhen, Condition, ConditionEval, FirstMessage, FinishWhen, FinishWhenEval, FlatActionItem, FlatAgendaItem, FlatIvrItem, FlatNodePlacement, FlatTopicItem, FlatTransferItem, DtmfResult, IvrAttemptResult, IvrBlock, IvrDigit, IvrFallbackAction, IvrNode, FlattenOptions, FlattenResult, Interrupt, SpokenLanguage, SequenceAgendas, JsonRulesCondition, NodePlacement, OnNoProgress, OtherwiseSentinel, Placement, SectionNode, SectionPlacement, SimulateResult, SimulatedItem, SimulatedItemStatus, SwitchOnNode, TopicBlock, TopicNode, TransferArguments, TransferBlock, TransferCallerIdShown, TransferConfirmKey, TransferConfirmMethod, TransferDial, TransferFallbackAction, TransferInterruptAction, TransferMode, TransferNode, TransferSay, ValidateAgendaOptions, WalkDecision, WalkHitReason, WalkOptions, WalkResult, WalkSkip, WalkStats, WalkSkipReason, When, WhenEval, AdvanceResult, StageDriveHooks, StageDriveResult, StageDriveState, } from './core/stage/index.js';
45
+ export { DEFAULT_MAX_ACTIONS_PER_TURN, CASE_LAST_TRANSFER_AT, CASE_LAST_TRANSFER_RESULT, CASE_TRANSFER_ATTEMPT_COUNT, E164_NUMBER, LAST_TRANSFER_RESULT_FIELD, CONTACT_LANGUAGE_FIELD, getContactLang, inboundIvrCollect, ivrAttempted, ivrOf, ivrResultField, languageFieldOf, RESERVED_INTERRUPT_TOOL_NAMES, SIP_URI, action, advanceAgenda, agenda, andCompiledWhen, branch, collectJsonRulesFacts, collectTransferBlocks, collectTransferInterruptHeaders, compileAuthoringWhen, compileFinishWhen, compileWhen, driveAgenda, evaluateFinishWhen, evaluateJsonRules, evaluateWhen, extractBlocksFromTree, extractTemplateFields, finishWhenFields, flattenAgendaConfig, flattenAgendaPlacements, flattenAgendaTree, headerHasTransferInterrupt, ivr, interpolateFromSnapshot, interpolateTemplate, isTransferDestinationLiteral, isAgendaTree, isSequenceAgendas, isOtherwise, isSpokenLanguage, jsonRules, looksLikeJsonRules, normalizeJsonRules, normalizeSequenceAgendas, notAnyWhen, otherwise, parseJsonRules, registerIvrSessionFields, collectIvrBlocks, registerTransferSessionFields, resolveTransferArguments, resolveTransferDestinations, resolveTransferSay, section, simulateAgenda, switchOn, topic, transfer, transferArgumentsJson, transferFieldKey, transferResultField, transferWrites, validateTransferDestinations, treeToPlacements, unresolvedFinishWhenFields, validateCompiledAgenda, validateInterrupts, walkAgenda, watchdogHint, whenFields, } from './core/stage/index.js';
46
46
  export * from './voice-service/index.js';
47
47
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ export { defineCustomFunc } from './core/functions/define/custom.js';
28
28
  export { defineSystemFunc } from './core/functions/define/system.js';
29
29
  export { mergeEffectiveSchema } from './builder/merge.js';
30
30
  export { emitCaseContextSource, emitSlotsSource } from './builder/codegen/emit.js';
31
- export { affectedDerivedFields, applyFieldPatch, applyFieldPatchAndRecompute, applySlotFilling, applySlotFillingAndRecompute, applyWrites, applyWritesAndRecompute, buildDependencyGraph, buildFieldCatalog, buildSlotFillingJsonSchema, cloneSnapshot, commitFieldWrite, compiledTableEntries, compileSlotSchema, emptyFieldValue, emptyMultiRow, emptySlotRow, fieldChanged, formatFieldPath, getCompiledTable, getFieldState, getFieldValue, getLastThreeValues, getRowField, getSingleField, getSnapshotTable, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, isSnapshotSingleRow, isValidDataTypeValue, listConversationFields, makeFieldValue, markAskedUnknown, parseFieldPath, recomputeDerived, requireFieldPath, rowValueEntries, slotFieldEntries, slotFieldNames, snapshotFrom, toEffectiveSchema, toHistoryEntry, validateBareValue, validateExtractedField, validateFieldRefs, validateSlotFillingOutput, } from './core/slot/index.js';
32
- export { DEFAULT_MAX_ACTIONS_PER_TURN, LAST_TRANSFER_RESULT_FIELD, action, advanceAgenda, agenda, andCompiledWhen, branch, collectJsonRulesFacts, collectTransferBlocks, compileAuthoringWhen, compileFinishWhen, compileWhen, driveAgenda, evaluateFinishWhen, evaluateJsonRules, evaluateWhen, extractBlocksFromTree, extractTemplateFields, finishWhenFields, flattenAgendaConfig, flattenAgendaPlacements, flattenAgendaTree, isAgendaTree, isSequenceAgendas, isOtherwise, jsonRules, looksLikeJsonRules, normalizeJsonRules, normalizeSequenceAgendas, notAnyWhen, otherwise, parseJsonRules, registerTransferSessionFields, section, simulateAgenda, switchOn, topic, transfer, transferFieldKey, transferResultField, transferWrites, treeToPlacements, unresolvedFinishWhenFields, validateCompiledAgenda, walkAgenda, watchdogHint, whenFields, } from './core/stage/index.js';
31
+ export { affectedDerivedFields, applyFieldPatch, applyFieldPatchAndRecompute, applySlotFilling, applySlotFillingAndRecompute, applyWrites, applyWritesAndRecompute, buildDependencyGraph, buildFieldCatalog, buildSlotFillingJsonSchema, cloneSnapshot, commitFieldWrite, compiledTableEntries, compileSlotSchema, emptyFieldValue, emptyMultiRow, emptySlotRow, fieldChanged, formatFieldPath, getCompiledTable, getFieldState, getFieldValue, getLastThreeValues, getRowField, getSingleField, getSnapshotTable, isFieldValue, isReservedTableName, isResolved, isRowIdField, mintRowId, SNAPSHOT_CURRENT_KEY, isSnapshotSingleRow, isValidDataTypeValue, listConversationFields, makeFieldValue, markAskedUnknown, isRowWrite, isStructuredWrites, normalizeWrites, parseFieldPath, recomputeDerived, requireFieldPath, rowValueEntries, slotFieldEntries, slotFieldNames, snapshotFrom, toEffectiveSchema, toHistoryEntry, validateBareValue, validateExtractedField, validateFieldRefs, validateSlotFillingOutput, } from './core/slot/index.js';
32
+ export { DEFAULT_MAX_ACTIONS_PER_TURN, CASE_LAST_TRANSFER_AT, CASE_LAST_TRANSFER_RESULT, CASE_TRANSFER_ATTEMPT_COUNT, E164_NUMBER, LAST_TRANSFER_RESULT_FIELD, CONTACT_LANGUAGE_FIELD, getContactLang, inboundIvrCollect, ivrAttempted, ivrOf, ivrResultField, languageFieldOf, RESERVED_INTERRUPT_TOOL_NAMES, SIP_URI, action, advanceAgenda, agenda, andCompiledWhen, branch, collectJsonRulesFacts, collectTransferBlocks, collectTransferInterruptHeaders, compileAuthoringWhen, compileFinishWhen, compileWhen, driveAgenda, evaluateFinishWhen, evaluateJsonRules, evaluateWhen, extractBlocksFromTree, extractTemplateFields, finishWhenFields, flattenAgendaConfig, flattenAgendaPlacements, flattenAgendaTree, headerHasTransferInterrupt, ivr, interpolateFromSnapshot, interpolateTemplate, isTransferDestinationLiteral, isAgendaTree, isSequenceAgendas, isOtherwise, isSpokenLanguage, jsonRules, looksLikeJsonRules, normalizeJsonRules, normalizeSequenceAgendas, notAnyWhen, otherwise, parseJsonRules, registerIvrSessionFields, collectIvrBlocks, registerTransferSessionFields, resolveTransferArguments, resolveTransferDestinations, resolveTransferSay, section, simulateAgenda, switchOn, topic, transfer, transferArgumentsJson, transferFieldKey, transferResultField, transferWrites, validateTransferDestinations, treeToPlacements, unresolvedFinishWhenFields, validateCompiledAgenda, validateInterrupts, walkAgenda, watchdogHint, whenFields, } from './core/stage/index.js';
33
33
  export * from './voice-service/index.js';
34
34
  //# sourceMappingURL=index.js.map
@@ -369,6 +369,9 @@ export interface FieldCollectConfig extends LoopConfirmConfig {
369
369
  unsuccessSayText: string | null;
370
370
  validateDigits: DtmfDigit[];
371
371
  digitsValueMap: Record<string, string>;
372
+ finishOnKey?: DtmfDigit;
373
+ minDigits?: number;
374
+ maxDigits?: number;
372
375
  }
373
376
  export interface WarmTransferSession {
374
377
  conferenceName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superpanel-sdk/runtime",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Slot + Stage runtime: schema, writes, derived recompute, agenda compile/walk/simulate",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",