@voiceflow/sdk-runtime 1.3.3 → 1.4.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 (113) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/cjs/runtime/runtime.interface.d.ts +5 -67
  3. package/build/cjs/runtime/runtime.interface.d.ts.map +1 -1
  4. package/build/cjs/runtime/runtime.interface.js +4 -29
  5. package/build/cjs/runtime/runtime.service.auth.d.ts +1 -0
  6. package/build/cjs/runtime/runtime.service.auth.d.ts.map +1 -1
  7. package/build/cjs/runtime/runtime.service.auth.js +4 -0
  8. package/build/cjs/runtime/runtime.service.d.ts +3 -0
  9. package/build/cjs/runtime/runtime.service.d.ts.map +1 -1
  10. package/build/cjs/runtime/runtime.service.public.d.ts +3 -0
  11. package/build/cjs/runtime/runtime.service.public.d.ts.map +1 -1
  12. package/build/cjs/runtime/runtime.service.public.js +9 -0
  13. package/build/cjs/sdk/sdk.service.d.ts +2 -6
  14. package/build/cjs/sdk/sdk.service.d.ts.map +1 -1
  15. package/build/cjs/sdk/sdk.service.js +2 -5
  16. package/build/cjs/trace/components/card.component.d.ts +7 -2
  17. package/build/cjs/trace/components/card.component.d.ts.map +1 -1
  18. package/build/cjs/trace/components/cardV2.component.d.ts +3 -0
  19. package/build/cjs/trace/components/cardV2.component.d.ts.map +1 -0
  20. package/build/cjs/trace/components/cardV2.component.js +6 -0
  21. package/build/cjs/trace/components/choice.component.d.ts +2 -2
  22. package/build/cjs/trace/components/choice.component.d.ts.map +1 -1
  23. package/build/cjs/trace/components/choice.component.js +2 -1
  24. package/build/cjs/trace/components/end.component.d.ts +2 -2
  25. package/build/cjs/trace/components/end.component.d.ts.map +1 -1
  26. package/build/cjs/trace/components/end.component.js +2 -1
  27. package/build/cjs/trace/components/index.d.ts +1 -1
  28. package/build/cjs/trace/components/index.d.ts.map +1 -1
  29. package/build/cjs/trace/components/index.js +1 -1
  30. package/build/cjs/trace/components/speak.component.d.ts +2 -2
  31. package/build/cjs/trace/components/speak.component.d.ts.map +1 -1
  32. package/build/cjs/trace/components/speak.component.js +2 -1
  33. package/build/cjs/trace/components/stream.component.d.ts +2 -2
  34. package/build/cjs/trace/components/stream.component.d.ts.map +1 -1
  35. package/build/cjs/trace/components/stream.component.js +2 -1
  36. package/build/cjs/trace/components/text.component.d.ts +2 -2
  37. package/build/cjs/trace/components/text.component.d.ts.map +1 -1
  38. package/build/cjs/trace/components/text.component.js +2 -1
  39. package/build/cjs/trace/components/visual.component.d.ts +4 -2
  40. package/build/cjs/trace/components/visual.component.d.ts.map +1 -1
  41. package/build/cjs/trace/components/visual.component.js +2 -1
  42. package/build/cjs/trace/trace.component.d.ts +5 -5
  43. package/build/cjs/trace/trace.component.d.ts.map +1 -1
  44. package/build/cjs/trace/trace.interface.d.ts +6 -6
  45. package/build/cjs/trace/trace.interface.d.ts.map +1 -1
  46. package/build/esm/runtime/runtime.interface.d.ts +5 -67
  47. package/build/esm/runtime/runtime.interface.d.ts.map +1 -1
  48. package/build/esm/runtime/runtime.interface.js +3 -21
  49. package/build/esm/runtime/runtime.service.auth.d.ts +1 -0
  50. package/build/esm/runtime/runtime.service.auth.d.ts.map +1 -1
  51. package/build/esm/runtime/runtime.service.auth.js +4 -0
  52. package/build/esm/runtime/runtime.service.d.ts +3 -0
  53. package/build/esm/runtime/runtime.service.d.ts.map +1 -1
  54. package/build/esm/runtime/runtime.service.public.d.ts +3 -0
  55. package/build/esm/runtime/runtime.service.public.d.ts.map +1 -1
  56. package/build/esm/runtime/runtime.service.public.js +9 -0
  57. package/build/esm/sdk/sdk.service.d.ts +2 -6
  58. package/build/esm/sdk/sdk.service.d.ts.map +1 -1
  59. package/build/esm/sdk/sdk.service.js +3 -6
  60. package/build/esm/trace/components/card.component.d.ts +7 -2
  61. package/build/esm/trace/components/card.component.d.ts.map +1 -1
  62. package/build/esm/trace/components/cardV2.component.d.ts +3 -0
  63. package/build/esm/trace/components/cardV2.component.d.ts.map +1 -0
  64. package/build/esm/trace/components/cardV2.component.js +3 -0
  65. package/build/esm/trace/components/choice.component.d.ts +2 -2
  66. package/build/esm/trace/components/choice.component.d.ts.map +1 -1
  67. package/build/esm/trace/components/choice.component.js +2 -1
  68. package/build/esm/trace/components/end.component.d.ts +2 -2
  69. package/build/esm/trace/components/end.component.d.ts.map +1 -1
  70. package/build/esm/trace/components/end.component.js +2 -1
  71. package/build/esm/trace/components/index.d.ts +1 -1
  72. package/build/esm/trace/components/index.d.ts.map +1 -1
  73. package/build/esm/trace/components/index.js +1 -1
  74. package/build/esm/trace/components/speak.component.d.ts +2 -2
  75. package/build/esm/trace/components/speak.component.d.ts.map +1 -1
  76. package/build/esm/trace/components/speak.component.js +2 -1
  77. package/build/esm/trace/components/stream.component.d.ts +2 -2
  78. package/build/esm/trace/components/stream.component.d.ts.map +1 -1
  79. package/build/esm/trace/components/stream.component.js +2 -1
  80. package/build/esm/trace/components/text.component.d.ts +2 -2
  81. package/build/esm/trace/components/text.component.d.ts.map +1 -1
  82. package/build/esm/trace/components/text.component.js +2 -1
  83. package/build/esm/trace/components/visual.component.d.ts +4 -2
  84. package/build/esm/trace/components/visual.component.d.ts.map +1 -1
  85. package/build/esm/trace/components/visual.component.js +2 -1
  86. package/build/esm/trace/trace.component.d.ts +5 -5
  87. package/build/esm/trace/trace.component.d.ts.map +1 -1
  88. package/build/esm/trace/trace.interface.d.ts +6 -6
  89. package/build/esm/trace/trace.interface.d.ts.map +1 -1
  90. package/package.json +3 -3
  91. package/src/runtime/runtime.interface.ts +7 -102
  92. package/src/runtime/runtime.service.auth.ts +5 -0
  93. package/src/runtime/runtime.service.public.ts +11 -0
  94. package/src/runtime/runtime.service.ts +2 -0
  95. package/src/sdk/sdk.service.ts +4 -13
  96. package/src/trace/components/card.component.ts +2 -2
  97. package/src/trace/components/cardV2.component.ts +5 -0
  98. package/src/trace/components/choice.component.ts +2 -2
  99. package/src/trace/components/end.component.ts +2 -2
  100. package/src/trace/components/index.ts +1 -1
  101. package/src/trace/components/speak.component.ts +2 -2
  102. package/src/trace/components/stream.component.ts +2 -2
  103. package/src/trace/components/text.component.ts +2 -2
  104. package/src/trace/components/visual.component.ts +6 -2
  105. package/src/trace/trace.component.ts +6 -8
  106. package/src/trace/trace.interface.ts +7 -7
  107. package/build/cjs/trace/components/payload.component.d.ts +0 -3
  108. package/build/cjs/trace/components/payload.component.d.ts.map +0 -1
  109. package/build/cjs/trace/components/payload.component.js +0 -5
  110. package/build/esm/trace/components/payload.component.d.ts +0 -3
  111. package/build/esm/trace/components/payload.component.d.ts.map +0 -1
  112. package/build/esm/trace/components/payload.component.js +0 -2
  113. package/src/trace/components/payload.component.ts +0 -5
@@ -1,4 +1,5 @@
1
- import { BaseRequest } from '@voiceflow/base-types';
1
+ import { BaseRequest, Trace } from '@voiceflow/base-types';
2
+ export { Trace } from '@voiceflow/base-types';
2
3
  declare type FetchFn = (...parameters: any[]) => Promise<any>;
3
4
  export interface RuntimeOptions<V = AuthVerify | PublicVerify> {
4
5
  url: string;
@@ -26,7 +27,7 @@ export interface RuntimeInteractRequest {
26
27
  export interface RuntimeInteractResponse {
27
28
  state: RuntimeState;
28
29
  request: RuntimeAction;
29
- trace: RuntimeTrace[];
30
+ trace: Trace.AnyTrace[];
30
31
  }
31
32
  export declare type RuntimeAction = BaseRequest.TextRequest | BaseRequest.LaunchRequest | BaseRequest.IntentRequest | BaseRequest.ActionRequest | BaseRequest.GeneralRequest | BaseRequest.BaseRequest<unknown>;
32
33
  export declare const isRuntimeAction: (value: unknown) => value is RuntimeAction;
@@ -49,75 +50,12 @@ export interface RuntimeState {
49
50
  storage: Record<string, any>;
50
51
  variables: Record<string, any>;
51
52
  }
52
- export declare const RuntimeTraceTypeSet: Set<"speak" | "text" | "choice" | "card" | "visual" | "audio" | "payload" | "stream" | "end">;
53
- export declare type RuntimeTraceType = typeof RuntimeTraceTypeSet extends Set<infer K> ? K : never;
54
- export declare const isRuntimeTraceType: (value: unknown) => value is "speak" | "text" | "choice" | "card" | "visual" | "audio" | "payload" | "stream" | "end";
55
- export interface RuntimeTrace<T extends RuntimeTraceType = RuntimeTraceType, P = unknown> {
56
- type: T;
57
- payload: P;
58
- }
59
- export declare const isRuntimeTrace: (value: unknown) => value is RuntimeTrace<"speak" | "text" | "choice" | "card" | "visual" | "audio" | "payload" | "stream" | "end", unknown>;
60
- export interface CardTracePayload {
61
- card: {
62
- type: string;
63
- title: string;
64
- text: string;
65
- image?: {
66
- largeImageUrl: string;
67
- alt: string;
68
- };
69
- };
70
- }
71
- export declare type CardTrace = RuntimeTrace<'card', CardTracePayload>;
72
- export declare const isCardTrace: (value: unknown) => value is CardTrace;
73
- export declare type ChoiceTrace = RuntimeTrace<'choice', ChoiceTracePayload>;
74
- export interface ChoiceTracePayload {
75
- buttons: {
76
- name: string;
77
- }[];
78
- }
79
- export declare const isChoiceTrace: (value: unknown) => value is ChoiceTrace;
80
- export interface PayloadTracePayload {
81
- data: any;
82
- }
83
- export declare type EndTrace = RuntimeTrace<'end'>;
84
- export declare const isEndTrace: (value: unknown) => value is EndTrace;
85
- export declare type PayloadTrace = RuntimeTrace<'payload', PayloadTracePayload>;
86
- export declare const isPayloadTrace: (value: unknown) => value is PayloadTrace;
87
- export interface SpeakTracePayload {
88
- voice?: string;
89
- src?: string;
90
- message: string;
91
- type: 'speak' | 'audio';
92
- }
93
- export declare type SpeakTrace = RuntimeTrace<'speak', SpeakTracePayload>;
94
- export declare const isSpeakTrace: (value: unknown) => value is SpeakTrace;
95
- export interface TextTracePayload {
96
- message: string;
97
- }
98
- export declare type TextTrace = RuntimeTrace<'text', TextTracePayload>;
99
- export declare const isTextTrace: (value: unknown) => value is TextTrace;
100
- export interface VisualTracePayload {
101
- image: string;
102
- }
103
- export declare type VisualTrace = RuntimeTrace<'visual', VisualTracePayload>;
104
- export declare const isVisualTrace: (value: unknown) => value is VisualTrace;
105
- export interface StreamTracePayload {
106
- src: string;
107
- loop: boolean;
108
- description?: string;
109
- title?: string;
110
- iconImage?: string;
111
- backgroundImage?: string;
112
- action: string;
113
- }
114
- export declare type StreamTrace = RuntimeTrace<'stream', StreamTracePayload>;
115
- export declare const isStreamTrace: (value: unknown) => value is StreamTrace;
53
+ export declare const isRuntimeTraceType: (value: unknown) => value is Trace.TraceType;
54
+ export declare const isRuntimeTrace: (value: unknown) => value is Trace.BaseTraceFrame<any, import("@voiceflow/base-types/build/cjs/node/utils").BaseTraceFramePath<import("@voiceflow/base-types/build/cjs/node/utils").BaseEvent>>;
116
55
  export interface RuntimeHttpRequest {
117
56
  method?: string;
118
57
  params?: URLSearchParams;
119
58
  body?: any;
120
59
  headers?: HeadersInit;
121
60
  }
122
- export {};
123
61
  //# sourceMappingURL=runtime.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.interface.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,aAAK,OAAO,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEtD,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,UAAU,GAAG,YAAY;IAC3D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC;IAEV;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,YACtB,eAAe,QAAQ,UAAU,GAAG,YAAY,CAAC,CAAC,0CAG5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,YACxB,eAAe,QAAQ,UAAU,GAAG,YAAY,CAAC,CAAC,4CAG5D,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,aAAa,CAAC;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mB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,YAAY,GAAG,WAAW,CAAC,aAAa,CAAC;AACrD,oBAAY,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC;AACjD,eAAO,MAAM,UAAU,gCAA0B,CAAC;AAElD,eAAO,MAAM,kBAAkB,YAAa,YAAY,oBAAoB,KAAG,YAAY,aAGzF,CAAC;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,UAAW,OAAO,6BACoC,CAAC;AAEtF,eAAO,MAAM,cAAc,UAAW,OAAO,gLAGJ,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB"}
@@ -1,4 +1,5 @@
1
- import { BaseRequest } from '@voiceflow/base-types';
1
+ import { BaseRequest, Trace } from '@voiceflow/base-types';
2
+ export { Trace } from '@voiceflow/base-types';
2
3
  export const isAuthRuntimeOptions = (options) => {
3
4
  return !!options?.verify?.authorization;
4
5
  };
@@ -11,26 +12,7 @@ export const createIntentAction = (payload) => ({
11
12
  type: ActionType.INTENT,
12
13
  payload,
13
14
  });
14
- export const RuntimeTraceTypeSet = new Set([
15
- 'speak',
16
- 'text',
17
- 'choice',
18
- 'card',
19
- 'visual',
20
- 'audio',
21
- 'payload',
22
- 'stream',
23
- 'end',
24
- ]);
25
- export const isRuntimeTraceType = (value) => typeof value === 'string' && RuntimeTraceTypeSet.has(value);
15
+ export const isRuntimeTraceType = (value) => typeof value === 'string' && Object.values(Trace.TraceType).includes(value);
26
16
  export const isRuntimeTrace = (value) => typeof value === 'object' &&
27
17
  Object.prototype.hasOwnProperty.call(value, 'type') &&
28
18
  isRuntimeTraceType(value.type);
29
- export const isCardTrace = (value) => isRuntimeTrace(value) && value.type === 'card';
30
- export const isChoiceTrace = (value) => isRuntimeTrace(value) && value.type === 'choice';
31
- export const isEndTrace = (value) => isRuntimeTrace(value) && value.type === 'end';
32
- export const isPayloadTrace = (value) => isRuntimeTrace(value) && value.type === 'payload';
33
- export const isSpeakTrace = (value) => isRuntimeTrace(value) && value.type === 'speak';
34
- export const isTextTrace = (value) => isRuntimeTrace(value) && value.type === 'text';
35
- export const isVisualTrace = (value) => isRuntimeTrace(value) && value.type === 'visual';
36
- export const isStreamTrace = (value) => isRuntimeTrace(value) && value.type === 'stream';
@@ -4,5 +4,6 @@ export declare class AuthRuntimeService extends RuntimeService {
4
4
  private readonly authorization;
5
5
  constructor(options: RuntimeOptions<AuthVerify>);
6
6
  interact(request: RuntimeInteractRequest): Promise<RuntimeInteractResponse>;
7
+ getPublishing(): Promise<{}>;
7
8
  }
8
9
  //# sourceMappingURL=runtime.service.auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAazF"}
1
+ {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAe3E,aAAa;CAG3B"}
@@ -16,4 +16,8 @@ export class AuthRuntimeService extends RuntimeService {
16
16
  params: new URLSearchParams({ verbose: 'true' }),
17
17
  });
18
18
  }
19
+ // TODO: expose authenticated publishing
20
+ async getPublishing() {
21
+ return {};
22
+ }
19
23
  }
@@ -3,6 +3,9 @@ export declare abstract class RuntimeService {
3
3
  private readonly options;
4
4
  private readonly fetch;
5
5
  constructor(options: RuntimeOptions);
6
+ abstract getPublishing(request: {
7
+ versionID?: string;
8
+ }): Promise<Record<string, unknown>>;
6
9
  abstract interact(request: RuntimeInteractRequest): Promise<Partial<RuntimeInteractResponse> & Pick<RuntimeInteractResponse, 'trace'>>;
7
10
  protected send<T>(path: string, args?: RuntimeHttpRequest): Promise<T>;
8
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,8BAAsB,cAAc;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEZ,OAAO,EAAE,cAAc;aAO3C,QAAQ,CACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;cAErE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBjF"}
1
+ {"version":3,"file":"runtime.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,8BAAsB,cAAc;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEZ,OAAO,EAAE,cAAc;aAO3C,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAEhF,QAAQ,CACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;cAErE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBjF"}
@@ -4,5 +4,8 @@ export declare class PublicRuntimeService extends RuntimeService {
4
4
  private readonly projectID;
5
5
  constructor(options: RuntimeOptions<PublicVerify>);
6
6
  interact(request: RuntimeInteractRequest): Promise<Pick<RuntimeInteractResponse, 'trace'>>;
7
+ getPublishing(request: {
8
+ versionID?: string;
9
+ }): Promise<Record<string, unknown>>;
7
10
  }
8
11
  //# sourceMappingURL=runtime.service.public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;CAcxG"}
1
+ {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAe1F,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAU9F"}
@@ -14,4 +14,13 @@ export class PublicRuntimeService extends RuntimeService {
14
14
  },
15
15
  });
16
16
  }
17
+ async getPublishing(request) {
18
+ const { versionID } = request;
19
+ return this.send(`public/${this.projectID}/publishing`, {
20
+ method: 'GET',
21
+ headers: {
22
+ ...(versionID ? { versionID } : {}),
23
+ },
24
+ });
25
+ }
17
26
  }
@@ -1,4 +1,4 @@
1
- import type { IntentActionPayload, RuntimeInteractRequest } from '../runtime/index.js';
1
+ import type { RuntimeInteractRequest, RuntimeService } from '../runtime/index.js';
2
2
  import type { TraceDeclaration } from '../trace/trace.interface.js';
3
3
  import type { VoiceflowRuntimeOptions } from './sdk.interface.js';
4
4
  export declare class VoiceflowRuntime<T> {
@@ -7,10 +7,6 @@ export declare class VoiceflowRuntime<T> {
7
7
  constructor(options: VoiceflowRuntimeOptions<T>);
8
8
  registerStep(step: TraceDeclaration<T, any>): this;
9
9
  interact(context: T, request: RuntimeInteractRequest): Promise<T>;
10
- intent(request: {
11
- context: T;
12
- sessionID: string;
13
- payload: IntentActionPayload;
14
- }): Promise<T>;
10
+ getPublishing(...options: Parameters<RuntimeService['getPublishing']>): Promise<Record<string, unknown>>;
15
11
  }
16
12
  //# sourceMappingURL=sdk.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.service.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAkB,MAAM,WAAW,CAAC;AAQ7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;gBAErB,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAY/C,YAAY,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC;IAKrC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKvE,MAAM,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,CAAC,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC;CAMpG"}
1
+ {"version":3,"file":"sdk.service.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;gBAErB,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAY/C,YAAY,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC;IAKrC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjE,aAAa,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;CAGnF"}
@@ -1,4 +1,4 @@
1
- import { AuthRuntimeService, createIntentAction, isAuthRuntimeOptions, isPublicRuntimeOptions, PublicRuntimeService, } from '../runtime/index.js';
1
+ import { AuthRuntimeService, isAuthRuntimeOptions, isPublicRuntimeOptions, PublicRuntimeService } from '../runtime/index.js';
2
2
  import { TraceService } from '../trace/trace.service.js';
3
3
  export class VoiceflowRuntime {
4
4
  constructor(options) {
@@ -21,10 +21,7 @@ export class VoiceflowRuntime {
21
21
  const response = await this.runtime.interact(request);
22
22
  return this.trace.processTrace(context, response);
23
23
  }
24
- intent(request) {
25
- return this.interact(request.context, {
26
- action: createIntentAction(request.payload),
27
- sessionID: request.sessionID,
28
- });
24
+ async getPublishing(...options) {
25
+ return this.runtime.getPublishing(...options);
29
26
  }
30
27
  }
@@ -1,3 +1,8 @@
1
- import type { CardTrace } from '../../runtime/runtime.interface.js';
2
- export declare const CardTraceComponent: import("../trace.component.js").TraceComponentOverload<CardTrace>;
1
+ import type { BaseNode } from '@voiceflow/base-types';
2
+ export declare const CardTraceComponent: import("../trace.component.js").TraceComponentOverload<{
3
+ type: 'card';
4
+ payload: {
5
+ card: BaseNode.Card.Card;
6
+ };
7
+ }>;
3
8
  //# sourceMappingURL=card.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/card.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAIhE,eAAO,MAAM,kBAAkB,mEAA0C,CAAC"}
1
+ {"version":3,"file":"card.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/card.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,eAAO,MAAM,kBAAkB;UAAgC,MAAM;aAAW;QAAE,IAAI,EAAE,SAAS,IAAI,CAAC,IAAI,CAAA;KAAE;EAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const CardV2TraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.CardV2>;
3
+ //# sourceMappingURL=cardV2.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardV2.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/cardV2.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,oBAAoB,sEAA8D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ import { createTraceComponent } from '../trace.component.js';
3
+ export const CardV2TraceComponent = createTraceComponent(Trace.TraceType.CARD_V2);
@@ -1,3 +1,3 @@
1
- import type { ChoiceTrace } from '../../runtime/runtime.interface.js';
2
- export declare const ChoiceTraceComponent: import("../trace.component.js").TraceComponentOverload<ChoiceTrace>;
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const ChoiceTraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.Choice>;
3
3
  //# sourceMappingURL=choice.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"choice.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/choice.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,eAAO,MAAM,oBAAoB,qEAA8C,CAAC"}
1
+ {"version":3,"file":"choice.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/choice.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,oBAAoB,sEAA6D,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const ChoiceTraceComponent = createTraceComponent('choice');
3
+ export const ChoiceTraceComponent = createTraceComponent(Trace.TraceType.CHOICE);
@@ -1,3 +1,3 @@
1
- import type { EndTrace } from '../../runtime/runtime.interface.js';
2
- export declare const EndTraceComponent: import("../trace.component.js").TraceComponentOverload<EndTrace>;
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const EndTraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.End>;
3
3
  //# sourceMappingURL=end.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"end.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/end.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI/D,eAAO,MAAM,iBAAiB,kEAAwC,CAAC"}
1
+ {"version":3,"file":"end.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/end.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,iBAAiB,mEAAuD,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const EndTraceComponent = createTraceComponent('end');
3
+ export const EndTraceComponent = createTraceComponent(Trace.TraceType.END);
@@ -1,7 +1,7 @@
1
1
  export * from './card.component.js';
2
+ export * from './cardV2.component.js';
2
3
  export * from './choice.component.js';
3
4
  export * from './end.component.js';
4
- export * from './payload.component.js';
5
5
  export * from './speak.component.js';
6
6
  export * from './stream.component.js';
7
7
  export * from './text.component.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export * from './card.component.js';
2
+ export * from './cardV2.component.js';
2
3
  export * from './choice.component.js';
3
4
  export * from './end.component.js';
4
- export * from './payload.component.js';
5
5
  export * from './speak.component.js';
6
6
  export * from './stream.component.js';
7
7
  export * from './text.component.js';
@@ -1,3 +1,3 @@
1
- import type { SpeakTrace } from '../../runtime/runtime.interface.js';
2
- export declare const SpeakTraceComponent: import("../trace.component.js").TraceComponentOverload<SpeakTrace>;
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const SpeakTraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.Speak>;
3
3
  //# sourceMappingURL=speak.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"speak.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/speak.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAIjE,eAAO,MAAM,mBAAmB,oEAA4C,CAAC"}
1
+ {"version":3,"file":"speak.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/speak.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,mBAAmB,qEAA2D,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const SpeakTraceComponent = createTraceComponent('speak');
3
+ export const SpeakTraceComponent = createTraceComponent(Trace.TraceType.SPEAK);
@@ -1,3 +1,3 @@
1
- import type { StreamTrace } from '../../runtime/runtime.interface.js';
2
- export declare const StreamTraceComponent: import("../trace.component.js").TraceComponentOverload<StreamTrace>;
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const StreamTraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.Stream>;
3
3
  //# sourceMappingURL=stream.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/stream.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,eAAO,MAAM,oBAAoB,qEAA8C,CAAC"}
1
+ {"version":3,"file":"stream.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/stream.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,oBAAoB,sEAA6D,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const StreamTraceComponent = createTraceComponent('stream');
3
+ export const StreamTraceComponent = createTraceComponent(Trace.TraceType.STREAM);
@@ -1,3 +1,3 @@
1
- import type { TextTrace } from '../../runtime/runtime.interface.js';
2
- export declare const TextTraceComponent: import("../trace.component.js").TraceComponentOverload<TextTrace>;
1
+ import { Trace } from '../../runtime/runtime.interface.js';
2
+ export declare const TextTraceComponent: import("../trace.component.js").TraceComponentOverload<Trace.Text>;
3
3
  //# sourceMappingURL=text.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/text.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAIhE,eAAO,MAAM,kBAAkB,mEAA0C,CAAC"}
1
+ {"version":3,"file":"text.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/text.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAIvD,eAAO,MAAM,kBAAkB,oEAAyD,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const TextTraceComponent = createTraceComponent('text');
3
+ export const TextTraceComponent = createTraceComponent(Trace.TraceType.TEXT);
@@ -1,3 +1,5 @@
1
- import type { VisualTrace } from '../../runtime/runtime.interface.js';
2
- export declare const VisualTraceComponent: import("../trace.component.js").TraceComponentOverload<VisualTrace>;
1
+ import type { BaseNode } from '@voiceflow/base-types';
2
+ export declare const VisualTraceComponent: import("../trace.component.js").TraceComponentOverload<BaseNode.Visual.TraceFrame & {
3
+ payload: BaseNode.Visual.ImageStepData;
4
+ }>;
3
5
  //# sourceMappingURL=visual.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/visual.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,eAAO,MAAM,oBAAoB,qEAA8C,CAAC"}
1
+ {"version":3,"file":"visual.component.d.ts","sourceRoot":"","sources":["../../../../src/trace/components/visual.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,eAAO,MAAM,oBAAoB;aAAkD,SAAS,MAAM,CAAC,aAAa;EAE/G,CAAC"}
@@ -1,2 +1,3 @@
1
+ import { Trace } from '../../runtime/runtime.interface.js';
1
2
  import { createTraceComponent } from '../trace.component.js';
2
- export const VisualTraceComponent = createTraceComponent('visual');
3
+ export const VisualTraceComponent = createTraceComponent(Trace.TraceType.VISUAL);
@@ -1,8 +1,8 @@
1
- import type { RuntimeTrace } from '../runtime/runtime.interface.js';
1
+ import type { Trace } from '../runtime/runtime.interface.js';
2
2
  import type { TraceAccumulator, TraceDeclaration } from './trace.interface.js';
3
- export interface TraceComponentOverload<Trace extends RuntimeTrace> {
4
- <Context>(declaration: TraceDeclaration<Context, Trace>): Required<TraceDeclaration<Context, Trace>>;
5
- <Context>(handle: TraceAccumulator<Context, Trace>): Required<TraceDeclaration<Context, Trace>>;
3
+ export interface TraceComponentOverload<T extends Trace.BaseTraceFrame> {
4
+ <Context>(declaration: TraceDeclaration<Context, T>): Required<TraceDeclaration<Context, T>>;
5
+ <Context>(handle: TraceAccumulator<Context, T>): Required<TraceDeclaration<Context, T>>;
6
6
  }
7
- export declare const createTraceComponent: <Trace extends RuntimeTrace<"speak" | "text" | "choice" | "card" | "visual" | "audio" | "payload" | "stream" | "end", unknown>>(type: Trace["type"]) => TraceComponentOverload<Trace>;
7
+ export declare const createTraceComponent: <T extends Trace.BaseTraceFrame<any, import("@voiceflow/base-types/build/cjs/node/utils/trace.js").BaseTraceFramePath<import("@voiceflow/base-types/build/cjs/node/utils/event.js").BaseEvent>>>(type: T["type"]) => TraceComponentOverload<T>;
8
8
  //# sourceMappingURL=trace.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace.component.d.ts","sourceRoot":"","sources":["../../../src/trace/trace.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,MAAM,WAAW,sBAAsB,CAAC,KAAK,SAAS,YAAY;IAChE,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IACrG,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CACjG;AAED,eAAO,MAAM,oBAAoB,uLAa9B,CAAC"}
1
+ {"version":3,"file":"trace.component.d.ts","sourceRoot":"","sources":["../../../src/trace/trace.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,KAAK,CAAC,cAAc;IACpE,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CACzF;AAED,eAAO,MAAM,oBAAoB,gPAW9B,CAAC"}
@@ -1,14 +1,14 @@
1
- import type { RuntimeTrace } from '../runtime/runtime.interface.js';
1
+ import type { Trace } from '../runtime/runtime.interface.js';
2
2
  export interface TraceOptions<T> {
3
3
  traces?: TraceDeclaration<T, any>[];
4
4
  }
5
- export interface TraceDeclaration<Context, Trace extends RuntimeTrace> {
6
- canHandle: TraceCanHandle<Trace>;
7
- handle: TraceAccumulator<Context, Trace>;
5
+ export interface TraceDeclaration<Context, T extends Trace.BaseTraceFrame> {
6
+ canHandle: TraceCanHandle<T>;
7
+ handle: TraceAccumulator<Context, T>;
8
8
  }
9
- export declare type TraceCanHandle<Trace extends RuntimeTrace> = (trace: Trace) => boolean;
9
+ export declare type TraceCanHandle<T extends Trace.BaseTraceFrame> = (trace: T) => boolean;
10
10
  export interface TraceHandlerMeta<Context> {
11
11
  context: Context;
12
12
  }
13
- export declare type TraceAccumulator<Context, Trace extends RuntimeTrace> = (meta: TraceHandlerMeta<Context>, trace: Trace) => Context;
13
+ export declare type TraceAccumulator<Context, T extends Trace.BaseTraceFrame> = (meta: TraceHandlerMeta<Context>, trace: T) => Context;
14
14
  //# sourceMappingURL=trace.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace.interface.d.ts","sourceRoot":"","sources":["../../../src/trace/trace.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB,CAAC,OAAO,EAAE,KAAK,SAAS,YAAY;IACnE,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;CAC1C;AAED,oBAAY,cAAc,CAAC,KAAK,SAAS,YAAY,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;AAEnF,MAAM,WAAW,gBAAgB,CAAC,OAAO;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oBAAY,gBAAgB,CAAC,OAAO,EAAE,KAAK,SAAS,YAAY,IAAI,CAClE,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,KAAK,KACT,OAAO,CAAC"}
1
+ {"version":3,"file":"trace.interface.d.ts","sourceRoot":"","sources":["../../../src/trace/trace.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB,CAAC,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,cAAc;IACvE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;CACtC;AAED,oBAAY,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;AAEnF,MAAM,WAAW,gBAAgB,CAAC,OAAO;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oBAAY,gBAAgB,CAAC,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,cAAc,IAAI,CACtE,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,CAAC,KACL,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/sdk-runtime",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./build/esm/main.js",
@@ -30,7 +30,7 @@
30
30
  "extends": "@voiceflow-meta/eslint-config"
31
31
  },
32
32
  "dependencies": {
33
- "@voiceflow/base-types": "2.69.0",
33
+ "@voiceflow/base-types": "2.71.0",
34
34
  "http-errors": "2.0.0"
35
35
  },
36
36
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "d5cd8e3043d310678aa4be236b4ad61c7f4e424a"
45
+ "gitHead": "a6c44287444c051b1fc979d94fc2075c49c426ca"
46
46
  }