@aui.io/aui-client 1.2.34 → 1.2.36

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 (67) hide show
  1. package/README.md +36 -50
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/controllerApi/client/Client.d.ts +20 -13
  4. package/dist/cjs/api/resources/controllerApi/client/Client.js +45 -35
  5. package/dist/cjs/api/resources/controllerApi/client/requests/ExternalWidgetRenderRequest.d.ts +21 -0
  6. package/dist/cjs/api/resources/controllerApi/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/types/OptionsSearchSelfReviewMethod.d.ts +0 -2
  8. package/dist/cjs/api/types/OptionsSearchSelfReviewMethod.js +0 -2
  9. package/dist/cjs/api/types/TaskParameter.d.ts +2 -2
  10. package/dist/cjs/api/types/TraceDecisionParamsCheck.d.ts +4 -1
  11. package/dist/cjs/api/types/TraceDecisionRuleTriggered.d.ts +1 -1
  12. package/dist/cjs/api/types/TraceDecisionToolTextResponse.d.ts +0 -1
  13. package/dist/cjs/api/types/TraceParamsCheckStatus.d.ts +2 -1
  14. package/dist/cjs/api/types/TraceParamsCheckStatus.js +2 -1
  15. package/dist/cjs/api/types/TraceRuleAction.d.ts +4 -1
  16. package/dist/cjs/api/types/TraceRuleAction.js +4 -1
  17. package/dist/cjs/api/types/TraceRuleMissingInfo.d.ts +10 -0
  18. package/dist/cjs/api/types/TraceRuleParamsMissing.d.ts +6 -1
  19. package/dist/cjs/api/types/WidgetRenderResponse.d.ts +3 -0
  20. package/dist/cjs/api/types/index.d.ts +2 -5
  21. package/dist/cjs/api/types/index.js +2 -5
  22. package/dist/cjs/version.d.ts +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/esm/Client.mjs +2 -2
  25. package/dist/esm/api/resources/controllerApi/client/Client.d.mts +20 -13
  26. package/dist/esm/api/resources/controllerApi/client/Client.mjs +45 -35
  27. package/dist/esm/api/resources/controllerApi/client/requests/ExternalWidgetRenderRequest.d.mts +21 -0
  28. package/dist/esm/api/resources/controllerApi/client/requests/index.d.mts +1 -0
  29. package/dist/esm/api/types/OptionsSearchSelfReviewMethod.d.mts +0 -2
  30. package/dist/esm/api/types/OptionsSearchSelfReviewMethod.mjs +0 -2
  31. package/dist/esm/api/types/TaskParameter.d.mts +2 -2
  32. package/dist/esm/api/types/TraceDecisionParamsCheck.d.mts +4 -1
  33. package/dist/esm/api/types/TraceDecisionRuleTriggered.d.mts +1 -1
  34. package/dist/esm/api/types/TraceDecisionToolTextResponse.d.mts +0 -1
  35. package/dist/esm/api/types/TraceParamsCheckStatus.d.mts +2 -1
  36. package/dist/esm/api/types/TraceParamsCheckStatus.mjs +2 -1
  37. package/dist/esm/api/types/TraceRuleAction.d.mts +4 -1
  38. package/dist/esm/api/types/TraceRuleAction.mjs +4 -1
  39. package/dist/esm/api/types/TraceRuleMissingInfo.d.mts +10 -0
  40. package/dist/esm/api/types/TraceRuleParamsMissing.d.mts +6 -1
  41. package/dist/esm/api/types/WidgetRenderResponse.d.mts +3 -0
  42. package/dist/esm/api/types/index.d.mts +2 -5
  43. package/dist/esm/api/types/index.mjs +2 -5
  44. package/dist/esm/version.d.mts +1 -1
  45. package/dist/esm/version.mjs +1 -1
  46. package/package.json +1 -1
  47. package/reference.md +44 -30
  48. package/dist/cjs/api/types/TaskParameterObjectNestedParam.d.ts +0 -7
  49. package/dist/cjs/api/types/TaskParameterObjectValue.d.ts +0 -6
  50. package/dist/cjs/api/types/TaskParameterObjectValueItem.d.ts +0 -4
  51. package/dist/cjs/api/types/WorkflowMetadata.d.ts +0 -7
  52. package/dist/cjs/api/types/WorkflowMetadata.js +0 -3
  53. package/dist/cjs/api/types/WorkflowsMetadataResponse.d.ts +0 -4
  54. package/dist/cjs/api/types/WorkflowsMetadataResponse.js +0 -3
  55. package/dist/esm/api/types/TaskParameterObjectNestedParam.d.mts +0 -7
  56. package/dist/esm/api/types/TaskParameterObjectValue.d.mts +0 -6
  57. package/dist/esm/api/types/TaskParameterObjectValueItem.d.mts +0 -4
  58. package/dist/esm/api/types/WorkflowMetadata.d.mts +0 -7
  59. package/dist/esm/api/types/WorkflowMetadata.mjs +0 -2
  60. package/dist/esm/api/types/WorkflowsMetadataResponse.d.mts +0 -4
  61. package/dist/esm/api/types/WorkflowsMetadataResponse.mjs +0 -2
  62. /package/dist/cjs/api/{types/TaskParameterObjectNestedParam.js → resources/controllerApi/client/requests/ExternalWidgetRenderRequest.js} +0 -0
  63. /package/dist/cjs/api/types/{TaskParameterObjectValue.js → TraceRuleMissingInfo.js} +0 -0
  64. /package/dist/cjs/api/types/{TaskParameterObjectValueItem.js → WidgetRenderResponse.js} +0 -0
  65. /package/dist/esm/api/{types/TaskParameterObjectNestedParam.mjs → resources/controllerApi/client/requests/ExternalWidgetRenderRequest.mjs} +0 -0
  66. /package/dist/esm/api/types/{TaskParameterObjectValue.mjs → TraceRuleMissingInfo.mjs} +0 -0
  67. /package/dist/esm/api/types/{TaskParameterObjectValueItem.mjs → WidgetRenderResponse.mjs} +0 -0
package/README.md CHANGED
@@ -271,15 +271,16 @@ Submit a new message to an existing task (non-streaming).
271
271
 
272
272
  ```typescript
273
273
  const messageResponse = await client.controllerApi.sendMessage({
274
- task_id: string, // Task identifier
275
- text: string, // Message text
276
- is_external_api?: boolean, // Optional: mark as external API call
277
- context?: { // Optional: additional context
274
+ task_id: string, // Task identifier
275
+ text: string, // Message text
276
+ is_external_api?: boolean, // Optional: mark as external API call
277
+ include_trace_info?: boolean, // Optional: include trace/debug info in response (NEW)
278
+ context?: { // Optional: additional context
278
279
  url?: string,
279
280
  lead_details?: Record<string, any>,
280
281
  welcome_message?: string
281
282
  },
282
- agent_variables?: Record<string, unknown> // Optional: custom agent variables (NEW in v1.2.28)
283
+ agent_variables?: Record<string, unknown> // Optional: custom agent variables
283
284
  });
284
285
 
285
286
  // Returns: Message - Complete agent response with optional product cards
@@ -325,35 +326,29 @@ const metadata = await client.controllerApi.getProductMetadata({
325
326
  // Returns: Record<string, any> - Product metadata object
326
327
  ```
327
328
 
328
- #### `getAgentContext(request)` - Get Agent Context (NEW in v1.2.28)
329
- Retrieve the agent's context configuration including parameters, entities, and static context.
329
+ #### `getTraceInfo(taskId, messageId)` - Get Trace Info (NEW)
330
+ Retrieve trace/debug information for a specific message. Useful for debugging agent responses and understanding the processing pipeline.
330
331
 
331
332
  ```typescript
332
- const agentContext = await client.controllerApi.getAgentContext({
333
- task_id: 'your-task-id',
334
- query: 'test context'
335
- });
333
+ const traceInfo = await client.controllerApi.getTraceInfo('your-task-id', 'your-message-id');
336
334
 
337
- // Returns: CreateTopicRequestBody - Agent context with:
338
- // - title: string
339
- // - params: TaskParameter[]
340
- // - entities: TaskTopicEntity[]
341
- // - static_context: string
335
+ // Returns: Record<string, any> - Trace information object
342
336
  ```
343
337
 
344
338
  **Example:**
345
339
 
346
340
  ```typescript
347
- // Get agent context to understand available parameters
348
- const context = await client.controllerApi.getAgentContext({
341
+ // First, send a message with trace info enabled
342
+ const message = await client.controllerApi.sendMessage({
349
343
  task_id: 'your-task-id',
350
- query: 'test context'
344
+ text: 'What products do you recommend?',
345
+ is_external_api: true,
346
+ include_trace_info: true
351
347
  });
352
348
 
353
- console.log('Agent Title:', context.title);
354
- console.log('Available Parameters:', context.params?.length);
355
- console.log('Entities:', context.entities?.length);
356
- console.log('Static Context:', context.static_context);
349
+ // Then retrieve the full trace info for that message
350
+ const traceInfo = await client.controllerApi.getTraceInfo('your-task-id', message.id);
351
+ console.log('Trace Info:', traceInfo);
357
352
  ```
358
353
 
359
354
  #### `getDirectFollowupSuggestions(taskId)` - Get Direct Followup Suggestions (NEW in v1.2.28)
@@ -626,7 +621,7 @@ sendContextualMessage('task-123', 'What do you recommend?', {
626
621
  });
627
622
  ```
628
623
 
629
- ### Get Agent Context (NEW in v1.2.28)
624
+ ### Get Trace Info (NEW)
630
625
 
631
626
  ```typescript
632
627
  import { ApolloClient } from '@aui.io/aui-client';
@@ -635,39 +630,30 @@ const client = new ApolloClient({
635
630
  networkApiKey: 'API_KEY_YOUR_KEY_HERE'
636
631
  });
637
632
 
638
- async function exploreAgentCapabilities() {
633
+ async function debugAgentResponse(taskId: string) {
639
634
  try {
640
- // Get the agent's context configuration
641
- const context = await client.controllerApi.getAgentContext({
642
- task_id: 'your-task-id',
643
- query: 'test context'
635
+ // Send a message with trace info enabled
636
+ const message = await client.controllerApi.sendMessage({
637
+ task_id: taskId,
638
+ text: 'What products do you recommend?',
639
+ is_external_api: true,
640
+ include_trace_info: true
644
641
  });
645
-
646
- console.log('Agent Configuration:');
647
- console.log(' Title:', context.title);
648
- console.log(' Static Context:', context.static_context);
649
-
650
- // Explore available parameters
651
- if (context.params && context.params.length > 0) {
652
- console.log('\nAvailable Parameters:');
653
- context.params.forEach(param => {
654
- console.log(` - ${param.title}: ${param.param}`);
655
- });
656
- }
657
-
658
- // Explore entities
659
- if (context.entities && context.entities.length > 0) {
660
- console.log('\nConfigured Entities:', context.entities.length);
661
- }
662
-
663
- return context;
642
+
643
+ console.log('Agent Response:', message.text);
644
+
645
+ // Retrieve the full trace info for debugging
646
+ const traceInfo = await client.controllerApi.getTraceInfo(taskId, message.id);
647
+ console.log('Trace Info:', traceInfo);
648
+
649
+ return traceInfo;
664
650
  } catch (error) {
665
- console.error('Error getting agent context:', error);
651
+ console.error('Error getting trace info:', error);
666
652
  throw error;
667
653
  }
668
654
  }
669
655
 
670
- exploreAgentCapabilities();
656
+ debugAgentResponse('task-123');
671
657
  ```
672
658
 
673
659
  ### Get Direct Followup Suggestions (NEW in v1.2.28)
@@ -45,8 +45,8 @@ class ApolloClient {
45
45
  "x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
46
46
  "X-Fern-Language": "JavaScript",
47
47
  "X-Fern-SDK-Name": "@aui.io/aui-client",
48
- "X-Fern-SDK-Version": "1.2.34",
49
- "User-Agent": "@aui.io/aui-client/1.2.34",
48
+ "X-Fern-SDK-Version": "1.2.36",
49
+ "User-Agent": "@aui.io/aui-client/1.2.36",
50
50
  "X-Fern-Runtime": core.RUNTIME.type,
51
51
  "X-Fern-Runtime-Version": core.RUNTIME.version,
52
52
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -113,19 +113,6 @@ export declare class ControllerApi {
113
113
  */
114
114
  getDirectFollowupSuggestions(taskId: string, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.DirectFollowupSuggestionsResponse>;
115
115
  private __getDirectFollowupSuggestions;
116
- /**
117
- * Get metadata for all workflows available for the authenticated network.
118
- * Returns a lean version with essential workflow information.
119
- *
120
- * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
121
- *
122
- * @throws {@link Apollo.UnprocessableEntityError}
123
- *
124
- * @example
125
- * await client.controllerApi.getWorkflowsMetadata()
126
- */
127
- getWorkflowsMetadata(requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.WorkflowsMetadataResponse>;
128
- private __getWorkflowsMetadata;
129
116
  /**
130
117
  * @param {string} taskId
131
118
  * @param {string} messageId
@@ -156,4 +143,24 @@ export declare class ControllerApi {
156
143
  */
157
144
  startTextConversation(request: Apollo.TextConversationInitiateRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.TextConversationInitiateResponse>;
158
145
  private __startTextConversation;
146
+ /**
147
+ * Render a widget card from integration data. Authenticates via network API key.
148
+ *
149
+ * @param {Apollo.ExternalWidgetRenderRequest} request
150
+ * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
151
+ *
152
+ * @throws {@link Apollo.UnprocessableEntityError}
153
+ *
154
+ * @example
155
+ * await client.controllerApi.renderWidget({
156
+ * task_id: "task_id",
157
+ * integration_code: "integration_code",
158
+ * card_template_code: "card_template_code",
159
+ * variables: {
160
+ * "key": "value"
161
+ * }
162
+ * })
163
+ */
164
+ renderWidget(request: Apollo.ExternalWidgetRenderRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.WidgetRenderResponse>;
165
+ private __renderWidget;
159
166
  }
@@ -600,27 +600,26 @@ class ControllerApi {
600
600
  });
601
601
  }
602
602
  /**
603
- * Get metadata for all workflows available for the authenticated network.
604
- * Returns a lean version with essential workflow information.
605
- *
603
+ * @param {string} taskId
604
+ * @param {string} messageId
606
605
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
607
606
  *
608
607
  * @throws {@link Apollo.UnprocessableEntityError}
609
608
  *
610
609
  * @example
611
- * await client.controllerApi.getWorkflowsMetadata()
610
+ * await client.controllerApi.getTraceInfo("task_id", "message_id")
612
611
  */
613
- getWorkflowsMetadata(requestOptions) {
614
- return core.HttpResponsePromise.fromPromise(this.__getWorkflowsMetadata(requestOptions));
612
+ getTraceInfo(taskId, messageId, requestOptions) {
613
+ return core.HttpResponsePromise.fromPromise(this.__getTraceInfo(taskId, messageId, requestOptions));
615
614
  }
616
- __getWorkflowsMetadata(requestOptions) {
615
+ __getTraceInfo(taskId, messageId, requestOptions) {
617
616
  return __awaiter(this, void 0, void 0, function* () {
618
617
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
619
618
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
620
619
  "x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
621
620
  }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
622
621
  const _response = yield core.fetcher({
623
- url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/workflows/metadata"),
622
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `api/v1/external/tasks/${core.url.encodePathParam(taskId)}/messages/${core.url.encodePathParam(messageId)}/trace-info`),
624
623
  method: "GET",
625
624
  headers: _headers,
626
625
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -653,7 +652,7 @@ class ControllerApi {
653
652
  rawResponse: _response.rawResponse,
654
653
  });
655
654
  case "timeout":
656
- throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/workflows/metadata.");
655
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/tasks/{task_id}/messages/{message_id}/trace-info.");
657
656
  case "unknown":
658
657
  throw new errors.ApolloError({
659
658
  message: _response.error.errorMessage,
@@ -663,29 +662,38 @@ class ControllerApi {
663
662
  });
664
663
  }
665
664
  /**
666
- * @param {string} taskId
667
- * @param {string} messageId
665
+ * Start a text conversation (WhatsApp or SMS).
666
+ *
667
+ * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
668
+ *
669
+ * @param {Apollo.TextConversationInitiateRequest} request
668
670
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
669
671
  *
670
672
  * @throws {@link Apollo.UnprocessableEntityError}
671
673
  *
672
674
  * @example
673
- * await client.controllerApi.getTraceInfo("task_id", "message_id")
675
+ * await client.controllerApi.startTextConversation({
676
+ * phoneNumber: "phoneNumber",
677
+ * channel: "channel"
678
+ * })
674
679
  */
675
- getTraceInfo(taskId, messageId, requestOptions) {
676
- return core.HttpResponsePromise.fromPromise(this.__getTraceInfo(taskId, messageId, requestOptions));
680
+ startTextConversation(request, requestOptions) {
681
+ return core.HttpResponsePromise.fromPromise(this.__startTextConversation(request, requestOptions));
677
682
  }
678
- __getTraceInfo(taskId, messageId, requestOptions) {
683
+ __startTextConversation(request, requestOptions) {
679
684
  return __awaiter(this, void 0, void 0, function* () {
680
685
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
681
686
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
682
687
  "x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
683
688
  }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
684
689
  const _response = yield core.fetcher({
685
- url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `api/v1/external/tasks/${core.url.encodePathParam(taskId)}/messages/${core.url.encodePathParam(messageId)}/trace-info`),
686
- method: "GET",
690
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/text/conversation"),
691
+ method: "POST",
687
692
  headers: _headers,
693
+ contentType: "application/json",
688
694
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
695
+ requestType: "json",
696
+ body: request,
689
697
  timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
690
698
  maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
691
699
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -693,7 +701,10 @@ class ControllerApi {
693
701
  logging: this._options.logging,
694
702
  });
695
703
  if (_response.ok) {
696
- return { data: _response.body, rawResponse: _response.rawResponse };
704
+ return {
705
+ data: _response.body,
706
+ rawResponse: _response.rawResponse,
707
+ };
697
708
  }
698
709
  if (_response.error.reason === "status-code") {
699
710
  switch (_response.error.statusCode) {
@@ -715,7 +726,7 @@ class ControllerApi {
715
726
  rawResponse: _response.rawResponse,
716
727
  });
717
728
  case "timeout":
718
- throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/tasks/{task_id}/messages/{message_id}/trace-info.");
729
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/text/conversation.");
719
730
  case "unknown":
720
731
  throw new errors.ApolloError({
721
732
  message: _response.error.errorMessage,
@@ -725,32 +736,34 @@ class ControllerApi {
725
736
  });
726
737
  }
727
738
  /**
728
- * Start a text conversation (WhatsApp or SMS).
729
- *
730
- * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
739
+ * Render a widget card from integration data. Authenticates via network API key.
731
740
  *
732
- * @param {Apollo.TextConversationInitiateRequest} request
741
+ * @param {Apollo.ExternalWidgetRenderRequest} request
733
742
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
734
743
  *
735
744
  * @throws {@link Apollo.UnprocessableEntityError}
736
745
  *
737
746
  * @example
738
- * await client.controllerApi.startTextConversation({
739
- * phoneNumber: "phoneNumber",
740
- * channel: "channel"
747
+ * await client.controllerApi.renderWidget({
748
+ * task_id: "task_id",
749
+ * integration_code: "integration_code",
750
+ * card_template_code: "card_template_code",
751
+ * variables: {
752
+ * "key": "value"
753
+ * }
741
754
  * })
742
755
  */
743
- startTextConversation(request, requestOptions) {
744
- return core.HttpResponsePromise.fromPromise(this.__startTextConversation(request, requestOptions));
756
+ renderWidget(request, requestOptions) {
757
+ return core.HttpResponsePromise.fromPromise(this.__renderWidget(request, requestOptions));
745
758
  }
746
- __startTextConversation(request, requestOptions) {
759
+ __renderWidget(request, requestOptions) {
747
760
  return __awaiter(this, void 0, void 0, function* () {
748
761
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
749
762
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
750
763
  "x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
751
764
  }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
752
765
  const _response = yield core.fetcher({
753
- url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/text/conversation"),
766
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/widgets"),
754
767
  method: "POST",
755
768
  headers: _headers,
756
769
  contentType: "application/json",
@@ -764,10 +777,7 @@ class ControllerApi {
764
777
  logging: this._options.logging,
765
778
  });
766
779
  if (_response.ok) {
767
- return {
768
- data: _response.body,
769
- rawResponse: _response.rawResponse,
770
- };
780
+ return { data: _response.body, rawResponse: _response.rawResponse };
771
781
  }
772
782
  if (_response.error.reason === "status-code") {
773
783
  switch (_response.error.statusCode) {
@@ -789,7 +799,7 @@ class ControllerApi {
789
799
  rawResponse: _response.rawResponse,
790
800
  });
791
801
  case "timeout":
792
- throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/text/conversation.");
802
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/widgets.");
793
803
  case "unknown":
794
804
  throw new errors.ApolloError({
795
805
  message: _response.error.errorMessage,
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * task_id: "task_id",
5
+ * integration_code: "integration_code",
6
+ * card_template_code: "card_template_code",
7
+ * variables: {
8
+ * "key": "value"
9
+ * }
10
+ * }
11
+ */
12
+ export interface ExternalWidgetRenderRequest {
13
+ /** Task ID for looking up stored interaction data */
14
+ task_id: string;
15
+ /** Integration name/code (e.g., INVENTORY_SEARCH) */
16
+ integration_code: string;
17
+ /** Card template name for direct lookup */
18
+ card_template_code: string;
19
+ /** Key-value pairs matching integration settings.variables[].key */
20
+ variables: Record<string, unknown>;
21
+ }
@@ -1,4 +1,5 @@
1
1
  export type { CreateTaskRequest } from "./CreateTaskRequest.js";
2
+ export type { ExternalWidgetRenderRequest } from "./ExternalWidgetRenderRequest.js";
2
3
  export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.js";
3
4
  export type { ListUserTasksRequest } from "./ListUserTasksRequest.js";
4
5
  export type { SubmitMessageRequest } from "./SubmitMessageRequest.js";
@@ -2,8 +2,6 @@ export declare const OptionsSearchSelfReviewMethod: {
2
2
  readonly InventoryClassification: "INVENTORY_CLASSIFICATION";
3
3
  readonly Llm: "LLM";
4
4
  readonly LlmPerOption: "LLM_PER_OPTION";
5
- readonly CrossEncoderRanker: "CROSS_ENCODER_RANKER";
6
- readonly CohereRanker: "COHERE_RANKER";
7
5
  readonly ConstantScore: "CONSTANT_SCORE";
8
6
  readonly ParamMatching: "PARAM_MATCHING";
9
7
  };
@@ -6,8 +6,6 @@ exports.OptionsSearchSelfReviewMethod = {
6
6
  InventoryClassification: "INVENTORY_CLASSIFICATION",
7
7
  Llm: "LLM",
8
8
  LlmPerOption: "LLM_PER_OPTION",
9
- CrossEncoderRanker: "CROSS_ENCODER_RANKER",
10
- CohereRanker: "COHERE_RANKER",
11
9
  ConstantScore: "CONSTANT_SCORE",
12
10
  ParamMatching: "PARAM_MATCHING",
13
11
  };
@@ -14,9 +14,9 @@ export interface TaskParameter {
14
14
  code?: string;
15
15
  }
16
16
  export declare namespace TaskParameter {
17
- type Value = Apollo.TaskParameterValue | Apollo.TaskParameterRangeValue | Apollo.TaskParameterObjectValue;
17
+ type Value = Apollo.TaskParameterValue | Apollo.TaskParameterRangeValue;
18
18
  type ValueHistory = ValueHistory.Item[];
19
19
  namespace ValueHistory {
20
- type Item = Apollo.TaskParameterValue | Apollo.TaskParameterRangeValue | Apollo.TaskParameterObjectValue;
20
+ type Item = Apollo.TaskParameterValue | Apollo.TaskParameterRangeValue;
21
21
  }
22
22
  }
@@ -3,6 +3,9 @@ export interface TraceDecisionParamsCheck {
3
3
  type?: Apollo.TraceDecisionType;
4
4
  tool: string;
5
5
  status: Apollo.TraceParamsCheckStatus;
6
- missing_params?: string[];
6
+ /** Per mandatory (required) group; inner list = unfilled param codes for that group. */
7
+ required_missing_params_by_group?: string[][];
8
+ /** Per optional group; inner list = unfilled param codes for that group. */
9
+ optional_missing_params_by_group?: string[][];
7
10
  track_id?: string;
8
11
  }
@@ -6,5 +6,5 @@ export interface TraceDecisionRuleTriggered {
6
6
  track_id?: string;
7
7
  }
8
8
  export declare namespace TraceDecisionRuleTriggered {
9
- type Rule = Apollo.TraceRuleBase | Apollo.TraceRuleParamsMissing;
9
+ type Rule = Apollo.TraceRuleBase | Apollo.TraceRuleParamsMissing | Apollo.TraceRuleMissingInfo;
10
10
  }
@@ -7,5 +7,4 @@ export interface TraceDecisionToolTextResponse {
7
7
  track_id?: string;
8
8
  tone_of_voice?: string;
9
9
  brevity?: string;
10
- guideline?: string;
11
10
  }
@@ -1,8 +1,9 @@
1
- /** Schema: all_filled | missing_required | missing_optional_ask_once. */
1
+ /** Schema: all_filled | missing_required | missing_optional | missing_optional_and_required | missing_optional_ask_once. */
2
2
  export declare const TraceParamsCheckStatus: {
3
3
  readonly AllFilled: "all_filled";
4
4
  readonly MissingRequired: "missing_required";
5
5
  readonly MissingOptional: "missing_optional";
6
6
  readonly MissingOptionalAskOnce: "missing_optional_ask_once";
7
+ readonly MissingOptionalAndRequired: "missing_optional_and_required";
7
8
  };
8
9
  export type TraceParamsCheckStatus = (typeof TraceParamsCheckStatus)[keyof typeof TraceParamsCheckStatus];
@@ -2,10 +2,11 @@
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.TraceParamsCheckStatus = void 0;
5
- /** Schema: all_filled | missing_required | missing_optional_ask_once. */
5
+ /** Schema: all_filled | missing_required | missing_optional | missing_optional_and_required | missing_optional_ask_once. */
6
6
  exports.TraceParamsCheckStatus = {
7
7
  AllFilled: "all_filled",
8
8
  MissingRequired: "missing_required",
9
9
  MissingOptional: "missing_optional",
10
10
  MissingOptionalAskOnce: "missing_optional_ask_once",
11
+ MissingOptionalAndRequired: "missing_optional_and_required",
11
12
  };
@@ -3,7 +3,10 @@ export declare const TraceRuleAction: {
3
3
  readonly AddRequiredParam: "ADD_REQUIRED_PARAM";
4
4
  readonly AskAQuestion: "ASK_A_QUESTION";
5
5
  readonly Block: "BLOCK";
6
+ readonly PartialBlock: "PARTIAL_BLOCK";
6
7
  readonly Text: "TEXT";
7
- readonly ActivateAnotherTool: "ACTIVATE_ANOTHER_TOOL";
8
+ readonly BlockAndActivateAnotherTool: "BLOCK_AND_ACTIVATE_ANOTHER_TOOL";
9
+ readonly ActivateSubTool: "ACTIVATE_SUB_TOOL";
10
+ readonly Integration: "INTEGRATION";
8
11
  };
9
12
  export type TraceRuleAction = (typeof TraceRuleAction)[keyof typeof TraceRuleAction];
@@ -7,6 +7,9 @@ exports.TraceRuleAction = {
7
7
  AddRequiredParam: "ADD_REQUIRED_PARAM",
8
8
  AskAQuestion: "ASK_A_QUESTION",
9
9
  Block: "BLOCK",
10
+ PartialBlock: "PARTIAL_BLOCK",
10
11
  Text: "TEXT",
11
- ActivateAnotherTool: "ACTIVATE_ANOTHER_TOOL",
12
+ BlockAndActivateAnotherTool: "BLOCK_AND_ACTIVATE_ANOTHER_TOOL",
13
+ ActivateSubTool: "ACTIVATE_SUB_TOOL",
14
+ Integration: "INTEGRATION",
12
15
  };
@@ -0,0 +1,10 @@
1
+ import type * as Apollo from "../index.js";
2
+ export interface TraceRuleMissingInfo {
3
+ type: Apollo.TraceRuleType;
4
+ action?: Apollo.TraceRuleAction;
5
+ reason?: string;
6
+ params_added?: Record<string, unknown>;
7
+ excluded_entities?: string[];
8
+ code?: string;
9
+ required_missing_params_by_group?: string[][];
10
+ }
@@ -2,6 +2,11 @@ import type * as Apollo from "../index.js";
2
2
  export interface TraceRuleParamsMissing {
3
3
  type?: Apollo.TraceRuleType;
4
4
  action?: Apollo.TraceRuleAction;
5
- missing_params?: string[];
5
+ status: Apollo.TraceParamsCheckStatus;
6
+ /** Per mandatory group (workflow order); inner list = unfilled param codes. */
7
+ required_missing_params_by_group?: string[][];
8
+ /** Per optional group (workflow order); inner list = unfilled param codes. */
9
+ optional_missing_params_by_group?: string[][];
6
10
  reason?: string;
11
+ code?: string;
7
12
  }
@@ -0,0 +1,3 @@
1
+ export interface WidgetRenderResponse {
2
+ rendered_jsx: string;
3
+ }
@@ -32,9 +32,6 @@ export * from "./TaskInteractionOptionSelfReviewScore.js";
32
32
  export * from "./TaskInteractionOptionSelfReviewScoreLabel.js";
33
33
  export * from "./TaskInteractionOptionSelfReviewType.js";
34
34
  export * from "./TaskParameter.js";
35
- export * from "./TaskParameterObjectNestedParam.js";
36
- export * from "./TaskParameterObjectValue.js";
37
- export * from "./TaskParameterObjectValueItem.js";
38
35
  export * from "./TaskParameterRangeValue.js";
39
36
  export * from "./TaskParameterType.js";
40
37
  export * from "./TaskParameterValue.js";
@@ -75,6 +72,7 @@ export * from "./TraceResponseType.js";
75
72
  export * from "./TraceRestIntegration.js";
76
73
  export * from "./TraceRuleAction.js";
77
74
  export * from "./TraceRuleBase.js";
75
+ export * from "./TraceRuleMissingInfo.js";
78
76
  export * from "./TraceRuleParamsMissing.js";
79
77
  export * from "./TraceRuleType.js";
80
78
  export * from "./TraceSelfReviewEntity.js";
@@ -87,7 +85,6 @@ export * from "./TracSelfReviewSubEntity.js";
87
85
  export * from "./UserMessagePayload.js";
88
86
  export * from "./ValidationError.js";
89
87
  export * from "./VectorSearchTaskInteractionQaAnswerScoreLabel.js";
88
+ export * from "./WidgetRenderResponse.js";
90
89
  export * from "./WorkflowCheckStatus.js";
91
- export * from "./WorkflowMetadata.js";
92
- export * from "./WorkflowsMetadataResponse.js";
93
90
  export * from "./WsActor.js";
@@ -48,9 +48,6 @@ __exportStar(require("./TaskInteractionOptionSelfReviewScore.js"), exports);
48
48
  __exportStar(require("./TaskInteractionOptionSelfReviewScoreLabel.js"), exports);
49
49
  __exportStar(require("./TaskInteractionOptionSelfReviewType.js"), exports);
50
50
  __exportStar(require("./TaskParameter.js"), exports);
51
- __exportStar(require("./TaskParameterObjectNestedParam.js"), exports);
52
- __exportStar(require("./TaskParameterObjectValue.js"), exports);
53
- __exportStar(require("./TaskParameterObjectValueItem.js"), exports);
54
51
  __exportStar(require("./TaskParameterRangeValue.js"), exports);
55
52
  __exportStar(require("./TaskParameterType.js"), exports);
56
53
  __exportStar(require("./TaskParameterValue.js"), exports);
@@ -91,6 +88,7 @@ __exportStar(require("./TraceResponseType.js"), exports);
91
88
  __exportStar(require("./TraceRestIntegration.js"), exports);
92
89
  __exportStar(require("./TraceRuleAction.js"), exports);
93
90
  __exportStar(require("./TraceRuleBase.js"), exports);
91
+ __exportStar(require("./TraceRuleMissingInfo.js"), exports);
94
92
  __exportStar(require("./TraceRuleParamsMissing.js"), exports);
95
93
  __exportStar(require("./TraceRuleType.js"), exports);
96
94
  __exportStar(require("./TraceSelfReviewEntity.js"), exports);
@@ -103,7 +101,6 @@ __exportStar(require("./TracSelfReviewSubEntity.js"), exports);
103
101
  __exportStar(require("./UserMessagePayload.js"), exports);
104
102
  __exportStar(require("./ValidationError.js"), exports);
105
103
  __exportStar(require("./VectorSearchTaskInteractionQaAnswerScoreLabel.js"), exports);
104
+ __exportStar(require("./WidgetRenderResponse.js"), exports);
106
105
  __exportStar(require("./WorkflowCheckStatus.js"), exports);
107
- __exportStar(require("./WorkflowMetadata.js"), exports);
108
- __exportStar(require("./WorkflowsMetadataResponse.js"), exports);
109
106
  __exportStar(require("./WsActor.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.34";
1
+ export declare const SDK_VERSION = "1.2.36";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.2.34";
4
+ exports.SDK_VERSION = "1.2.36";
@@ -9,8 +9,8 @@ export class ApolloClient {
9
9
  "x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
10
10
  "X-Fern-Language": "JavaScript",
11
11
  "X-Fern-SDK-Name": "@aui.io/aui-client",
12
- "X-Fern-SDK-Version": "1.2.34",
13
- "User-Agent": "@aui.io/aui-client/1.2.34",
12
+ "X-Fern-SDK-Version": "1.2.36",
13
+ "User-Agent": "@aui.io/aui-client/1.2.36",
14
14
  "X-Fern-Runtime": core.RUNTIME.type,
15
15
  "X-Fern-Runtime-Version": core.RUNTIME.version,
16
16
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });