@axiom-lattice/react-sdk 4.3.0 → 4.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 (65) hide show
  1. package/dist/{AgentDetailSideApp-TI7723CK.mjs → AgentDetailSideApp-RW6B3BGT.mjs} +7 -7
  2. package/dist/AgentGovernanceWorkbench-OXGHJNFL.mjs +19 -0
  3. package/dist/{MessageGraph-ES3P4VLY.mjs → MessageGraph-BVP2M3TM.mjs} +3 -3
  4. package/dist/{ReactChart-6AYFMCMD.mjs → ReactChart-3XHMWXL6.mjs} +3 -3
  5. package/dist/{TasksSideApp-7R42CIFG.mjs → TasksSideApp-MLG7XUQA.mjs} +4 -4
  6. package/dist/{TeamWorkspace-JQ762PEX.mjs → TeamWorkspace-IENL2T4X.mjs} +3 -3
  7. package/dist/{TopologyRuntimeView-OJ35YYVM.mjs → TopologyRuntimeView-B5TVUTAB.mjs} +4 -4
  8. package/dist/{WorkflowAutomationView-3AS77NKN.mjs → WorkflowAutomationView-ZKTUYMPU.mjs} +6 -6
  9. package/dist/{chunk-4FI66ZJ3.mjs → chunk-2NCNDHTI.mjs} +2 -2
  10. package/dist/{chunk-ENLK3ODS.mjs → chunk-3JNBTKKB.mjs} +2 -2
  11. package/dist/{chunk-2ZK7AUQW.mjs → chunk-ADZRYRP6.mjs} +9 -5
  12. package/dist/chunk-ADZRYRP6.mjs.map +1 -0
  13. package/dist/{chunk-4SVLWYLW.mjs → chunk-AJLGOGUB.mjs} +2 -2
  14. package/dist/{chunk-NSGSGYM7.mjs → chunk-HLVE2SB7.mjs} +48 -1
  15. package/dist/chunk-HLVE2SB7.mjs.map +1 -0
  16. package/dist/{chunk-YUV4WO25.mjs → chunk-N5VEHSQU.mjs} +160 -69
  17. package/dist/chunk-N5VEHSQU.mjs.map +1 -0
  18. package/dist/{chunk-3NR7UAPT.mjs → chunk-ORTSDZD4.mjs} +26 -44
  19. package/dist/chunk-ORTSDZD4.mjs.map +1 -0
  20. package/dist/{chunk-DBTFQUSQ.mjs → chunk-XE2ZIE2L.mjs} +4 -4
  21. package/dist/{embed-page-AgentDetailSideApp-PSRQVFNR.js → embed-page-AgentDetailSideApp-2BDEWFQ6.js} +1 -1
  22. package/dist/embed-page-AgentGovernanceWorkbench-WG7E3G5T.js +5 -0
  23. package/dist/{embed-page-MessageGraph-PDNQ67T4.js → embed-page-MessageGraph-5SWPEQ4V.js} +1 -1
  24. package/dist/{embed-page-ReactChart-25KAFLQ3.js → embed-page-ReactChart-ZYWRXIMC.js} +1 -1
  25. package/dist/{embed-page-TasksSideApp-DLH5LRMS.js → embed-page-TasksSideApp-X6255GEF.js} +1 -1
  26. package/dist/{embed-page-TeamWorkspace-2WJJWF25.js → embed-page-TeamWorkspace-XNZM7AV7.js} +1 -1
  27. package/dist/{embed-page-TopologyRuntimeView-WDQRHDMO.js → embed-page-TopologyRuntimeView-DGSHSTIU.js} +1 -1
  28. package/dist/{embed-page-WorkflowAutomationView-BAMJ2WVB.js → embed-page-WorkflowAutomationView-BHIRIWV3.js} +1 -1
  29. package/dist/embed-page-chunk-DEDTYRZE.js +245 -0
  30. package/dist/{embed-page-chunk-XVUA7UHE.js → embed-page-chunk-HEO7X7LH.js} +1 -1
  31. package/dist/{embed-page-chunk-TL2AYM76.js → embed-page-chunk-JMZ7OODN.js} +1 -1
  32. package/dist/{embed-page-chunk-OBM5EUWZ.js → embed-page-chunk-SPC4BYNU.js} +192 -192
  33. package/dist/{embed-page-chunk-LOXLXZNP.js → embed-page-chunk-XUXEGF3S.js} +1 -1
  34. package/dist/{embed-page-chunk-MQDYZS3S.js → embed-page-chunk-YCX5YZRP.js} +1 -1
  35. package/dist/embed-page.js +1 -1
  36. package/dist/index.d.mts +27 -1
  37. package/dist/index.d.ts +27 -1
  38. package/dist/index.js +2029 -1890
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs +13 -8
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/web-app.js +48 -3
  43. package/dist/web-app.js.map +1 -1
  44. package/dist/web-app.mjs +5 -4
  45. package/dist/web-app.mjs.map +1 -1
  46. package/package.json +3 -3
  47. package/dist/AgentGovernanceWorkbench-2MPAB6UF.mjs +0 -19
  48. package/dist/chunk-2ZK7AUQW.mjs.map +0 -1
  49. package/dist/chunk-3NR7UAPT.mjs.map +0 -1
  50. package/dist/chunk-NSGSGYM7.mjs.map +0 -1
  51. package/dist/chunk-YUV4WO25.mjs.map +0 -1
  52. package/dist/embed-page-AgentGovernanceWorkbench-UPQHJZD7.js +0 -5
  53. package/dist/embed-page-chunk-SSC7ANWV.js +0 -245
  54. /package/dist/{AgentDetailSideApp-TI7723CK.mjs.map → AgentDetailSideApp-RW6B3BGT.mjs.map} +0 -0
  55. /package/dist/{AgentGovernanceWorkbench-2MPAB6UF.mjs.map → AgentGovernanceWorkbench-OXGHJNFL.mjs.map} +0 -0
  56. /package/dist/{MessageGraph-ES3P4VLY.mjs.map → MessageGraph-BVP2M3TM.mjs.map} +0 -0
  57. /package/dist/{ReactChart-6AYFMCMD.mjs.map → ReactChart-3XHMWXL6.mjs.map} +0 -0
  58. /package/dist/{TasksSideApp-7R42CIFG.mjs.map → TasksSideApp-MLG7XUQA.mjs.map} +0 -0
  59. /package/dist/{TeamWorkspace-JQ762PEX.mjs.map → TeamWorkspace-IENL2T4X.mjs.map} +0 -0
  60. /package/dist/{TopologyRuntimeView-OJ35YYVM.mjs.map → TopologyRuntimeView-B5TVUTAB.mjs.map} +0 -0
  61. /package/dist/{WorkflowAutomationView-3AS77NKN.mjs.map → WorkflowAutomationView-ZKTUYMPU.mjs.map} +0 -0
  62. /package/dist/{chunk-4FI66ZJ3.mjs.map → chunk-2NCNDHTI.mjs.map} +0 -0
  63. /package/dist/{chunk-ENLK3ODS.mjs.map → chunk-3JNBTKKB.mjs.map} +0 -0
  64. /package/dist/{chunk-4SVLWYLW.mjs.map → chunk-AJLGOGUB.mjs.map} +0 -0
  65. /package/dist/{chunk-DBTFQUSQ.mjs.map → chunk-XE2ZIE2L.mjs.map} +0 -0
package/dist/web-app.js CHANGED
@@ -407,6 +407,51 @@ function isAbortError2(error) {
407
407
  return typeof error === "object" && error !== null && "name" in error && error.name === "AbortError";
408
408
  }
409
409
 
410
+ // src/utils/errorMessage.ts
411
+ var WRAPPER_PREFIXES = [
412
+ /^Error in middleware\s+(?:"[^"]*"|'[^']*'|[^:]+)\s*:\s*/,
413
+ /^Caused by:\s*/i,
414
+ /^Error:\s*/i
415
+ ];
416
+ function isMessageCarrier(value) {
417
+ return typeof value === "object" && value !== null && typeof value.message === "string";
418
+ }
419
+ function rootErrorMessage(message) {
420
+ if (typeof message !== "string" || message.length === 0) {
421
+ return message;
422
+ }
423
+ const trimmed = message.trim();
424
+ let current = trimmed;
425
+ let stripped = true;
426
+ while (stripped) {
427
+ stripped = false;
428
+ for (const prefix of WRAPPER_PREFIXES) {
429
+ const next = current.replace(prefix, "");
430
+ if (next !== current) {
431
+ current = next.trim();
432
+ stripped = true;
433
+ break;
434
+ }
435
+ }
436
+ }
437
+ return current.length > 0 ? current : trimmed;
438
+ }
439
+ function formatErrorMessage(error, fallback = "") {
440
+ let raw;
441
+ if (error instanceof Error) {
442
+ raw = error.message;
443
+ } else if (typeof error === "string") {
444
+ raw = error;
445
+ } else if (isMessageCarrier(error)) {
446
+ raw = error.message;
447
+ } else if (error === null || error === void 0) {
448
+ raw = "";
449
+ } else {
450
+ raw = String(error);
451
+ }
452
+ return rootErrorMessage(raw) || fallback;
453
+ }
454
+
410
455
  // src/integrations/web-app/state/agentWebAppReducer.ts
411
456
  var initialAgentWebAppState = {
412
457
  bootstrap: null,
@@ -845,7 +890,7 @@ function ScopedAgentWebAppProvider({ gatewayUrl, webAppId, identity, children, o
845
890
  await input.run((event) => {
846
891
  if (event.type === "error") {
847
892
  if (input.generation === generationRef.current && input.streamGeneration === streamGenerationRef.current) {
848
- eventError = new AgentWebAppRuntimeClientError(event.error.code, event.error.message, event.error.retryable);
893
+ eventError = new AgentWebAppRuntimeClientError(event.error.code, formatErrorMessage(event.error.message, "Stream error"), event.error.retryable);
849
894
  }
850
895
  return;
851
896
  }
@@ -1080,7 +1125,7 @@ var import_react9 = require("react");
1080
1125
 
1081
1126
  // src/integrations/web-app/components/widget-utils.ts
1082
1127
  function widgetErrorMessage(error) {
1083
- return error instanceof Error ? error.message : "Request failed";
1128
+ return formatErrorMessage(error, "Request failed");
1084
1129
  }
1085
1130
 
1086
1131
  // src/integrations/web-app/components/WidgetAttachments.tsx
@@ -1219,7 +1264,7 @@ function useReviewDecision(onSubmit) {
1219
1264
  // src/integrations/web-app/components/WidgetInterruptView.tsx
1220
1265
  var import_jsx_runtime4 = require("react/jsx-runtime");
1221
1266
  function errorMessage(error) {
1222
- return error instanceof Error ? error.message : "Unable to submit review";
1267
+ return formatErrorMessage(error, "Unable to submit review");
1223
1268
  }
1224
1269
  function WidgetInterruptView({ interrupt, onSubmit, className, approveLabel = "Approve", rejectLabel = "Reject", feedbackLabel = "Feedback", disabled = false }) {
1225
1270
  const review = useReviewDecision(async (decision, feedback) => {