@arbidocs/blocks 0.4.127 → 0.4.129

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 (115) hide show
  1. package/README.md +21 -7
  2. package/dist/{StreamedArtifactEditor-EEYAXJ4H.cjs → StreamedArtifactEditor-TQAND4H5.cjs} +6 -5
  3. package/dist/StreamedArtifactEditor-TQAND4H5.cjs.map +1 -0
  4. package/dist/{StreamedArtifactEditor-TDATDYD2.js → StreamedArtifactEditor-XQNANTWM.js} +4 -3
  5. package/dist/StreamedArtifactEditor-XQNANTWM.js.map +1 -0
  6. package/dist/agents/index.cjs +213 -213
  7. package/dist/agents/index.js +2 -2
  8. package/dist/artifacts/ArtifactCodeView.d.ts +6 -0
  9. package/dist/artifacts/ArtifactPreview.d.ts +22 -0
  10. package/dist/artifacts/index.cjs +50 -21
  11. package/dist/artifacts/index.d.ts +3 -0
  12. package/dist/artifacts/index.js +2 -1
  13. package/dist/artifacts/sandbox-policy.d.ts +34 -0
  14. package/dist/artifacts/sandboxDocument.d.ts +7 -0
  15. package/dist/calendar/index.cjs +156 -243
  16. package/dist/calendar/index.cjs.map +1 -1
  17. package/dist/calendar/index.js +8 -151
  18. package/dist/calendar/index.js.map +1 -1
  19. package/dist/chat/index.cjs +90 -73
  20. package/dist/chat/index.d.ts +1 -0
  21. package/dist/chat/index.js +3 -2
  22. package/dist/chat/open-document.d.ts +66 -0
  23. package/dist/{chunk-INW76PEL.cjs → chunk-2YV7FBLO.cjs} +175 -2
  24. package/dist/chunk-2YV7FBLO.cjs.map +1 -0
  25. package/dist/{chunk-DZI7WOUD.cjs → chunk-3BJLNKOB.cjs} +6 -2
  26. package/dist/chunk-3BJLNKOB.cjs.map +1 -0
  27. package/dist/{chunk-KELGOCJA.js → chunk-65S53MZK.js} +174 -5
  28. package/dist/chunk-65S53MZK.js.map +1 -0
  29. package/dist/{chunk-T6I6ZCBE.js → chunk-6BTCDKCK.js} +6 -3
  30. package/dist/chunk-6BTCDKCK.js.map +1 -0
  31. package/dist/{chunk-ZLRQ5K77.cjs → chunk-7423V6RM.cjs} +6 -3
  32. package/dist/chunk-7423V6RM.cjs.map +1 -0
  33. package/dist/{chunk-6Z72CXZR.js → chunk-CJBN5HIS.js} +6 -2
  34. package/dist/chunk-CJBN5HIS.js.map +1 -0
  35. package/dist/{chunk-XFKF3WRN.cjs → chunk-DZYAAL4H.cjs} +2 -2
  36. package/dist/{chunk-XFKF3WRN.cjs.map → chunk-DZYAAL4H.cjs.map} +1 -1
  37. package/dist/chunk-GYCQ3FNL.js +60 -0
  38. package/dist/chunk-GYCQ3FNL.js.map +1 -0
  39. package/dist/{chunk-UUXKB3WQ.js → chunk-H2KQ6OSU.js} +2 -2
  40. package/dist/{chunk-UUXKB3WQ.js.map → chunk-H2KQ6OSU.js.map} +1 -1
  41. package/dist/{chunk-T2CVFK2I.js → chunk-HSFLEVZY.js} +3 -3
  42. package/dist/{chunk-T2CVFK2I.js.map → chunk-HSFLEVZY.js.map} +1 -1
  43. package/dist/{chunk-MCPRNDOJ.cjs → chunk-JLTXVW25.cjs} +3 -3
  44. package/dist/{chunk-MCPRNDOJ.cjs.map → chunk-JLTXVW25.cjs.map} +1 -1
  45. package/dist/chunk-NS4JD2VR.js +22 -0
  46. package/dist/chunk-NS4JD2VR.js.map +1 -0
  47. package/dist/chunk-SWQX6CTT.cjs +65 -0
  48. package/dist/chunk-SWQX6CTT.cjs.map +1 -0
  49. package/dist/chunk-TGJNPKST.js +153 -0
  50. package/dist/chunk-TGJNPKST.js.map +1 -0
  51. package/dist/chunk-TGWTLNXW.cjs +177 -0
  52. package/dist/chunk-TGWTLNXW.cjs.map +1 -0
  53. package/dist/chunk-VG24E4JJ.cjs +26 -0
  54. package/dist/chunk-VG24E4JJ.cjs.map +1 -0
  55. package/dist/components/DroppableContainer.d.ts +6 -0
  56. package/dist/components/GridRowNavigator.d.ts +29 -0
  57. package/dist/components/LoadingIndicator.d.ts +21 -0
  58. package/dist/components/RowNavigatorControls.d.ts +29 -0
  59. package/dist/components/SharedCell.d.ts +27 -0
  60. package/dist/connect/docx.cjs +4 -3
  61. package/dist/connect/docx.cjs.map +1 -1
  62. package/dist/connect/docx.js +3 -2
  63. package/dist/connect/docx.js.map +1 -1
  64. package/dist/connect/index.cjs +22 -20
  65. package/dist/connect/index.cjs.map +1 -1
  66. package/dist/connect/index.js +12 -10
  67. package/dist/connect/index.js.map +1 -1
  68. package/dist/connection/mail/types.d.ts +2 -6
  69. package/dist/facts/index.cjs +5 -23
  70. package/dist/facts/index.cjs.map +1 -1
  71. package/dist/facts/index.d.ts +0 -1
  72. package/dist/facts/index.js +6 -22
  73. package/dist/facts/index.js.map +1 -1
  74. package/dist/index.cjs +616 -417
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.d.ts +5 -0
  77. package/dist/index.js +189 -11
  78. package/dist/index.js.map +1 -1
  79. package/dist/sandboxDocument-JLEETIWW.js +71 -0
  80. package/dist/sandboxDocument-JLEETIWW.js.map +1 -0
  81. package/dist/sandboxDocument-WQUNODSC.cjs +76 -0
  82. package/dist/sandboxDocument-WQUNODSC.cjs.map +1 -0
  83. package/dist/settings/DraggableHeader.d.ts +10 -0
  84. package/dist/settings/FilterChip.d.ts +15 -0
  85. package/dist/settings/MessageJsonTree.d.ts +7 -0
  86. package/dist/settings/index.cjs +248 -5
  87. package/dist/settings/index.cjs.map +1 -1
  88. package/dist/settings/index.d.ts +3 -0
  89. package/dist/settings/index.js +247 -7
  90. package/dist/settings/index.js.map +1 -1
  91. package/dist/settings/message-schema-hints.d.ts +19 -0
  92. package/dist/studio/index.cjs +3 -2
  93. package/dist/studio/index.cjs.map +1 -1
  94. package/dist/studio/index.js +2 -1
  95. package/dist/studio/index.js.map +1 -1
  96. package/dist/workflow-canvas/index.cjs +9 -9
  97. package/dist/workflow-canvas/index.js +2 -2
  98. package/dist/workspaces/index.cjs +39 -0
  99. package/dist/workspaces/index.cjs.map +1 -1
  100. package/dist/workspaces/index.d.ts +1 -0
  101. package/dist/workspaces/index.js +36 -1
  102. package/dist/workspaces/index.js.map +1 -1
  103. package/dist/workspaces/workspace-type.d.ts +29 -0
  104. package/node_modules/@arbidocs/coedit/package.json +1 -1
  105. package/package.json +6 -5
  106. package/src/docx/README.md +7 -3
  107. package/dist/StreamedArtifactEditor-EEYAXJ4H.cjs.map +0 -1
  108. package/dist/StreamedArtifactEditor-TDATDYD2.js.map +0 -1
  109. package/dist/chunk-6Z72CXZR.js.map +0 -1
  110. package/dist/chunk-DZI7WOUD.cjs.map +0 -1
  111. package/dist/chunk-INW76PEL.cjs.map +0 -1
  112. package/dist/chunk-KELGOCJA.js.map +0 -1
  113. package/dist/chunk-T6I6ZCBE.js.map +0 -1
  114. package/dist/chunk-ZLRQ5K77.cjs.map +0 -1
  115. package/dist/facts/timezone.d.ts +0 -4
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/artifacts/sandboxDocument.ts"],"names":["ARTIFACT_MESSAGE_TAG","ARTIFACT_CSP","transform"],"mappings":";;;;;;AAsBA,IAAM,aAAA,GAAgB,CAAA;AAAA,QAAA,EACZ,IAAA,CAAK,SAAA,CAAUA,sCAAoB,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAA,CAAA;AAS9C,SAAS,eAAe,SAAA,EAA2B;AACjD,EAAA,OACE,CAAA,qGAAA,EACuDC,8BAAY,CAAA,8EAAA,EAExD,aAAa,YAAY,SAAS,CAAA,aAAA,CAAA;AAEjD;AAIA,IAAM,mBAAA,GACJ,qJAAA;AAEK,SAAS,wBAAA,CAAyB,QAAgB,OAAA,EAAkC;AAEzF,EAAA,MAAM,OAAO,MAAA,CAAO,OAAA;AAAA,IAClB,mBAAA;AAAA,IACA,MAAM,CAAA,QAAA,EAAW,qBAAA,CAAsB,OAAA,CAAQ,QAAQ,CAAC,CAAA,SAAA;AAAA,GAC1D;AACA,EAAA,OAAO,cAAA,CAAe,EAAE,CAAA,GAAI,IAAA;AAC9B;AAGO,SAAS,qBAAqB,MAAA,EAAwB;AAC3D,EAAA,IAAI;AACF,IAAA,OAAOC,kBAAU,MAAA,EAAQ;AAAA,MACvB,UAAA,EAAY,CAAC,KAAA,EAAO,SAAS,CAAA;AAAA,MAC7B,UAAA,EAAY,SAAA;AAAA,MACZ,UAAA,EAAY;AAAA,KACb,CAAA,CAAE,IAAA;AAAA,EACL,SAAS,GAAA,EAAK;AACZ,IAAA,MAAM,UAAU,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG,CAAA;AAC/D,IAAA,MAAM,IAAI,MAAM,CAAA,kCAAA,EAAqC,OAAO,IAAI,EAAE,KAAA,EAAO,KAAK,CAAA;AAAA,EAChF;AACF;AAGA,SAAS,sBAAsB,IAAA,EAAsB;AACnD,EAAA,OAAO,KAAK,OAAA,CAAQ,aAAA,EAAe,YAAY,CAAA,CAAE,OAAA,CAAQ,SAAS,QAAQ,CAAA;AAC5E;AAGA,SAAS,eAAe,QAAA,EAA0B;AAChD,EAAA,OAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOP,qBAAA,CAAsB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAA,CAAA;AAUjC;AAEO,SAAS,yBAAA,CAA0B,QAAgB,OAAA,EAAkC;AAC1F,EAAA,MAAM,QAAA,GAAW,qBAAqB,MAAM,CAAA;AAC5C,EAAA,MAAM,IAAA,GACJ,CAAA,QAAA,EAAW,qBAAA,CAAsB,OAAA,CAAQ,KAAK,CAAC,CAAA,iBAAA,EACpC,qBAAA,CAAsB,OAAA,CAAQ,QAAQ,CAAC,CAAA,iEAAA,CAAA;AAEpD,EAAA,OAAO,eAAe,IAAI,CAAA,GAAI,CAAA,6BAAA,EAAgC,cAAA,CAAe,QAAQ,CAAC,CAAA,SAAA,CAAA;AACxF;AAEO,SAAS,oBAAA,CACd,IAAA,EACA,MAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO,IAAA,KAAS,UACZ,yBAAA,CAA0B,MAAA,EAAQ,OAAO,CAAA,GACzC,wBAAA,CAAyB,QAAQ,OAAO,CAAA;AAC9C","file":"sandboxDocument-WQUNODSC.cjs","sourcesContent":["/**\n * Builds the document that runs inside the artifact preview iframe.\n *\n * Threat model: artifact code is written by an LLM from untrusted input and runs in\n * the user's browser next to a decrypted session. It must never reach the app.\n * Layers (each independently sufficient for the main risks):\n * 1. The iframe is sandboxed with `allow-scripts` ONLY. No `allow-same-origin`, so the\n * frame gets an opaque origin: no access to the parent DOM, cookies, localStorage,\n * IndexedDB or the in-memory session. No popups, forms, top navigation or downloads.\n * 2. A Content-Security-Policy with `connect-src 'none'` and no remote sources: the\n * artifact cannot fetch, open sockets, load remote scripts/images/fonts or exfiltrate.\n * 3. JSX is compiled in the app (sucrase = text transform only), so the sandbox never\n * needs a compiler and compile errors surface in the app UI.\n *\n * The security prefix is PREPENDED to artifact HTML, never spliced into it, so a crafted\n * comment or `<head>` in the artifact cannot move the CSP out of effect.\n */\nimport { transform } from 'sucrase'\nimport type { ArtifactPreviewKind } from '@arbidocs/react/artifacts'\nimport { ARTIFACT_CSP, ARTIFACT_MESSAGE_TAG, type ArtifactRuntime } from './sandbox-policy'\n\n// Forwards console output and uncaught errors to the app. Runs first, before artifact code.\nconst BRIDGE_SCRIPT = `(function(){\nvar TAG=${JSON.stringify(ARTIFACT_MESSAGE_TAG)};\nfunction send(m){m[TAG]=true;try{parent.postMessage(m,'*')}catch(e){}}\nfunction str(v){if(typeof v==='string')return v;if(v instanceof Error)return v.stack||v.message;try{return JSON.stringify(v)}catch(e){return String(v)}}\n['log','info','warn','error'].forEach(function(l){var o=console[l];console[l]=function(){var a=[].slice.call(arguments);send({type:'console',level:l,text:a.map(str).join(' ')});try{o.apply(console,a)}catch(e){}}});\nwindow.addEventListener('error',function(e){send({type:'error',text:(e.message||'Error')+(e.lineno?' (line '+e.lineno+')':'')})});\nwindow.addEventListener('unhandledrejection',function(e){send({type:'error',text:'Unhandled promise rejection: '+str(e.reason)})});\nwindow.__arbiArtifactSend=send;\n})();`\n\nfunction securityPrefix(extraHead: string): string {\n return (\n '<!doctype html><html><head><meta charset=\"utf-8\">' +\n `<meta http-equiv=\"Content-Security-Policy\" content=\"${ARTIFACT_CSP}\">` +\n '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">' +\n `<script>${BRIDGE_SCRIPT}</script>${extraHead}</head><body>`\n )\n}\n\n// Models often include the Tailwind CDN script; there is no network in the sandbox, so replace the\n// whole element with the bundled copy.\nconst TAILWIND_CDN_SCRIPT =\n /<script\\b[^>]*\\bsrc\\s*=\\s*[\"']https?:\\/\\/(?:cdn\\.tailwindcss\\.com|cdn\\.jsdelivr\\.net\\/npm\\/@tailwindcss\\/browser)[^\"']*[\"'][^>]*>\\s*<\\/script\\s*>/gi\n\nexport function buildHtmlSandboxDocument(source: string, runtime: ArtifactRuntime): string {\n // A replacer function, not a string: the runtime contains `$` sequences that String.replace would expand.\n const body = source.replace(\n TAILWIND_CDN_SCRIPT,\n () => `<script>${escapeForInlineScript(runtime.tailwind)}</script>`\n )\n return securityPrefix('') + body\n}\n\n/** Compiles an artifact's JSX file to plain JS (CommonJS), or throws with a readable message. */\nexport function compileReactArtifact(source: string): string {\n try {\n return transform(source, {\n transforms: ['jsx', 'imports'],\n jsxRuntime: 'classic',\n production: true,\n }).code\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n throw new Error(`Could not compile this component: ${message}`, { cause: err })\n }\n}\n\n/** Keeps code from terminating an inline <script> or opening an HTML comment. */\nfunction escapeForInlineScript(code: string): string {\n return code.replace(/<\\/script/gi, '<\\\\/script').replace(/<!--/g, '<\\\\!--')\n}\n\n// Runs compiled artifact code with a tiny CommonJS shim and mounts its default export.\nfunction reactBootstrap(compiled: string): string {\n return `(function(){\nvar send=window.__arbiArtifactSend||function(){};\nvar available={'react':window.React,'react-dom':window.ReactDOM,'react-dom/client':window.ReactDOMClient};\nfunction req(name){if(Object.prototype.hasOwnProperty.call(available,name))return available[name];throw new Error('Module \"'+name+'\" is not available in artifacts. Only \"react\" and \"react-dom\" can be imported.')}\nvar module={exports:{}};var exports=module.exports;\ntry{\n(function(require,module,exports){\n${escapeForInlineScript(compiled)}\n})(req,module,exports);\nvar App=(module.exports&&module.exports.default)||module.exports;\nif(typeof App!=='function')throw new Error('The artifact must export a React component with \"export default\".');\nvar React=window.React;\nvar Boundary=class extends React.Component{constructor(p){super(p);this.state={e:null}}static getDerivedStateFromError(e){return{e:e}}componentDidCatch(e){send({type:'error',text:String(e&&e.stack||e)})}render(){if(this.state.e)return React.createElement('pre',{style:{color:'#b91c1c',padding:'16px',whiteSpace:'pre-wrap',font:'13px/1.5 ui-monospace,monospace'}},String(this.state.e&&this.state.e.message||this.state.e));return this.props.children}};\nwindow.ReactDOMClient.createRoot(document.getElementById('root')).render(React.createElement(Boundary,null,React.createElement(App)));\nsend({type:'ready'});\n}catch(e){send({type:'error',text:String(e&&e.message||e)})}\n})();`\n}\n\nexport function buildReactSandboxDocument(source: string, runtime: ArtifactRuntime): string {\n const compiled = compileReactArtifact(source)\n const head =\n `<script>${escapeForInlineScript(runtime.react)}</script>` +\n `<script>${escapeForInlineScript(runtime.tailwind)}</script>` +\n '<style>html,body,#root{min-height:100%;margin:0}</style>'\n return securityPrefix(head) + `<div id=\"root\"></div><script>${reactBootstrap(compiled)}</script>`\n}\n\nexport function buildSandboxDocument(\n kind: ArtifactPreviewKind,\n source: string,\n runtime: ArtifactRuntime\n): string {\n return kind === 'react'\n ? buildReactSandboxDocument(source, runtime)\n : buildHtmlSandboxDocument(source, runtime)\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Wrapper that makes a header region draggable for FloatingPanel,
3
+ * while ignoring clicks on interactive elements (buttons, inputs, tabs, etc.).
4
+ */
5
+ import React from 'react';
6
+ export interface DraggableHeaderProps {
7
+ onDragStart?: (e: React.MouseEvent) => void;
8
+ children: React.ReactNode;
9
+ }
10
+ export declare function DraggableHeader({ onDragStart, children }: DraggableHeaderProps): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { TriState } from './TriStateFilterMenu';
3
+ export interface FilterChipProps {
4
+ label: string;
5
+ state: TriState;
6
+ icon?: ReactNode;
7
+ /** When provided, renders a colored pill identical to Labels column */
8
+ color?: string;
9
+ onDismiss?: () => void;
10
+ /** The dismiss button's accessible name (default "Remove <label>"). */
11
+ dismissLabel?: string;
12
+ className?: string;
13
+ testId?: string;
14
+ }
15
+ export declare function FilterChip({ label, state, icon, color, onDismiss, dismissLabel, className, testId, }: FilterChipProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MessageJsonTree: the JsonTree with the ARBI message schema hints (field names, ids, timestamps
3
+ * of a message and its tool outputs), for a "message details" view.
4
+ */
5
+ import { type JsonTreeProps } from './JsonTree';
6
+ export type MessageJsonTreeProps = Omit<JsonTreeProps, 'resolveHint' | 'formatValue'>;
7
+ export declare function MessageJsonTree(props: MessageJsonTreeProps): import("react").JSX.Element;
@@ -145,6 +145,22 @@ function FloatingPanel({
145
145
  }
146
146
  );
147
147
  }
148
+ var INTERACTIVE_SELECTOR = 'button, input, select, a, [role="tab"], [role="radio"]';
149
+ function DraggableHeader({ onDragStart, children }) {
150
+ return /* @__PURE__ */ jsxRuntime.jsx(
151
+ "div",
152
+ {
153
+ className: "flex-shrink-0",
154
+ onMouseDown: onDragStart ? (e) => {
155
+ const target = e.target;
156
+ if (target.closest(INTERACTIVE_SELECTOR)) return;
157
+ onDragStart(e);
158
+ } : void 0,
159
+ style: onDragStart ? { cursor: "move" } : void 0,
160
+ children
161
+ }
162
+ );
163
+ }
148
164
  function PanelFrame({ testId, className, children }) {
149
165
  return /* @__PURE__ */ jsxRuntime.jsx(
150
166
  "div",
@@ -675,7 +691,7 @@ function JsonTree({
675
691
  level = 0,
676
692
  path = [],
677
693
  resolveHint,
678
- formatValue
694
+ formatValue: formatValue2
679
695
  }) {
680
696
  const [isExpanded, setIsExpanded] = react.useState(defaultExpanded || level < 2);
681
697
  const [copied, setCopied] = react.useState(false);
@@ -703,7 +719,7 @@ function JsonTree({
703
719
  const isArray = Array.isArray(data);
704
720
  const isObject = typeof data === "object" && data !== null && !isArray;
705
721
  if (!isObject && !isArray) {
706
- const displayValue = hint && formatValue ? formatValue(data, hint) : plainValue(data);
722
+ const displayValue = hint && formatValue2 ? formatValue2(data, hint) : plainValue(data);
707
723
  return /* @__PURE__ */ jsxRuntime.jsxs(
708
724
  "div",
709
725
  {
@@ -783,13 +799,179 @@ function JsonTree({
783
799
  level: level + 1,
784
800
  path: currentPath,
785
801
  resolveHint,
786
- formatValue
802
+ formatValue: formatValue2
787
803
  },
788
804
  key
789
805
  );
790
806
  }) })
791
807
  ] });
792
808
  }
809
+
810
+ // src/settings/message-schema-hints.ts
811
+ var messageFieldHints = {
812
+ role: {
813
+ displayName: "Role",
814
+ formatType: "enum",
815
+ description: "Message role (user, assistant, or system)"
816
+ },
817
+ content: {
818
+ displayName: "Content",
819
+ formatType: "long-string",
820
+ description: "Message content text"
821
+ },
822
+ created_at: {
823
+ displayName: "Created At",
824
+ formatType: "timestamp",
825
+ description: "Message creation timestamp"
826
+ },
827
+ external_id: {
828
+ displayName: "Message ID",
829
+ formatType: "id",
830
+ description: "External message identifier"
831
+ },
832
+ conversation_ext_id: {
833
+ displayName: "Conversation ID",
834
+ formatType: "id",
835
+ description: "Parent conversation identifier"
836
+ },
837
+ parent_message_ext_id: {
838
+ displayName: "Parent Message ID",
839
+ formatType: "id",
840
+ description: "Parent message identifier (null for first message)"
841
+ },
842
+ created_by_ext_id: {
843
+ displayName: "Created By",
844
+ formatType: "id",
845
+ description: "User who created this message"
846
+ },
847
+ config_ext_id: {
848
+ displayName: "Config ID",
849
+ formatType: "id",
850
+ description: "Configuration used for this message"
851
+ },
852
+ shared: {
853
+ displayName: "Shared",
854
+ formatType: "boolean",
855
+ description: "Whether message is shared"
856
+ },
857
+ tools: {
858
+ displayName: "Tools",
859
+ formatType: "json",
860
+ description: "Tool outputs (citations, retrieval, trace)"
861
+ },
862
+ meta: {
863
+ displayName: "Metadata",
864
+ formatType: "json",
865
+ description: "Additional metadata"
866
+ }
867
+ };
868
+ var traceToolFieldHints = {
869
+ name: {
870
+ displayName: "Tool Name",
871
+ formatType: "enum",
872
+ description: "Execution trace tool"
873
+ },
874
+ description: {
875
+ displayName: "Description",
876
+ formatType: "string",
877
+ description: "Tool description"
878
+ },
879
+ trace_id: {
880
+ displayName: "Trace ID",
881
+ formatType: "id",
882
+ description: "Unique trace identifier"
883
+ },
884
+ start_time: {
885
+ displayName: "Start Time",
886
+ formatType: "timestamp",
887
+ description: "When execution started"
888
+ },
889
+ duration_seconds: {
890
+ displayName: "Duration (seconds)",
891
+ formatType: "number",
892
+ description: "Total execution time"
893
+ },
894
+ steps: {
895
+ displayName: "Execution Steps",
896
+ formatType: "json",
897
+ description: "Full execution trace with all steps"
898
+ }
899
+ };
900
+ var citationToolFieldHints = {
901
+ name: {
902
+ displayName: "Tool Name",
903
+ formatType: "enum",
904
+ description: "Model citation tool"
905
+ },
906
+ tool_responses: {
907
+ displayName: "Citations",
908
+ formatType: "json",
909
+ description: "Citation data mapped by citation number"
910
+ }
911
+ };
912
+ function getFieldHint(path, fieldName) {
913
+ if (path.length === 1 && path[0] === "message") {
914
+ return messageFieldHints[fieldName] || null;
915
+ }
916
+ if (path.length >= 3 && path[0] === "message" && path[1] === "tools" && path[2] === "trace") {
917
+ return traceToolFieldHints[fieldName] || null;
918
+ }
919
+ if (path.length >= 3 && path[0] === "message" && path[1] === "tools" && path[2] === "model_citations") {
920
+ return citationToolFieldHints[fieldName] || null;
921
+ }
922
+ if (fieldName === "external_id" || fieldName.endsWith("_ext_id")) {
923
+ return { formatType: "id", displayName: fieldName.replace(/_/g, " ") };
924
+ }
925
+ if (fieldName === "created_at" || fieldName === "updated_at" || fieldName.endsWith("_at")) {
926
+ return { formatType: "timestamp", displayName: fieldName.replace(/_/g, " ") };
927
+ }
928
+ if (fieldName.includes("time") && !fieldName.includes("duration")) {
929
+ return { formatType: "timestamp" };
930
+ }
931
+ if (fieldName.includes("duration")) {
932
+ return { formatType: "number", description: "Duration in seconds" };
933
+ }
934
+ if (path.length >= 2 && path[path.length - 2] === "tools" && fieldName === "trace") {
935
+ return {
936
+ displayName: "\u{1F50D} Execution Trace",
937
+ formatType: "json",
938
+ description: "Complete execution trace with all steps and timing"
939
+ };
940
+ }
941
+ return null;
942
+ }
943
+ function formatValue(value, hint) {
944
+ if (value === null) return "null";
945
+ if (value === void 0) return "undefined";
946
+ if (hint?.formatType === "timestamp" && typeof value === "string") {
947
+ try {
948
+ const date = new Date(value);
949
+ if (!isNaN(date.getTime())) {
950
+ return `${date.toLocaleString()} (${value})`;
951
+ }
952
+ } catch {
953
+ }
954
+ }
955
+ if (hint?.formatType === "timestamp" && typeof value === "number") {
956
+ const date = new Date(value * 1e3);
957
+ return `${date.toLocaleString()} (${value})`;
958
+ }
959
+ if (hint?.formatType === "id" && typeof value === "string") {
960
+ if (value.length > 20) {
961
+ return `${value.substring(0, 16)}...${value.substring(value.length - 4)}`;
962
+ }
963
+ }
964
+ if (typeof value === "string") {
965
+ if (value.length > 100) {
966
+ return `"${value.substring(0, 97)}..." (${value.length} chars)`;
967
+ }
968
+ return `"${value}"`;
969
+ }
970
+ return String(value);
971
+ }
972
+ function MessageJsonTree(props) {
973
+ return /* @__PURE__ */ jsxRuntime.jsx(JsonTree, { ...props, resolveHint: getFieldHint, formatValue });
974
+ }
793
975
  var DEFAULT_TIPS_EDITOR_LABELS = {
794
976
  titleList: "Edit tips",
795
977
  titleNew: "New tip",
@@ -1310,6 +1492,64 @@ function SyncFolderStatus({
1310
1492
  }
1311
1493
  );
1312
1494
  }
1495
+ function FilterChip({
1496
+ label,
1497
+ state,
1498
+ icon,
1499
+ color,
1500
+ onDismiss,
1501
+ dismissLabel,
1502
+ className,
1503
+ testId
1504
+ }) {
1505
+ const isExclude = state === "exclude";
1506
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1507
+ "span",
1508
+ {
1509
+ className: ui.cn(
1510
+ "inline-flex items-center gap-1 text-xs font-medium rounded px-1.5 py-0.5 flex-shrink-0 border",
1511
+ isExclude ? "bg-background text-red-text border-red-text" : "bg-primary text-white border-primary",
1512
+ className
1513
+ ),
1514
+ "data-state": state,
1515
+ "data-testid": testId,
1516
+ children: [
1517
+ color ? (
1518
+ /* Filled square for include; empty square for exclude */
1519
+ isExclude ? /* @__PURE__ */ jsxRuntime.jsx(
1520
+ "span",
1521
+ {
1522
+ className: "w-3.5 h-3.5 rounded flex-shrink-0 border-2",
1523
+ style: { borderColor: color }
1524
+ }
1525
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1526
+ "span",
1527
+ {
1528
+ className: "w-3.5 h-3.5 rounded flex items-center justify-center flex-shrink-0",
1529
+ style: { backgroundColor: color },
1530
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-2.5 h-2.5 text-white", strokeWidth: 3 })
1531
+ }
1532
+ )
1533
+ ) : icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-none", children: icon }),
1534
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate max-w-[80px]", title: label, children: [
1535
+ isExclude && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-70 mr-0.5", children: "Not" }),
1536
+ label
1537
+ ] }),
1538
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
1539
+ "button",
1540
+ {
1541
+ type: "button",
1542
+ onClick: onDismiss,
1543
+ "aria-label": dismissLabel ?? `Remove ${label}`,
1544
+ className: "flex-none ml-0.5 opacity-70 hover:opacity-100",
1545
+ "data-testid": testId ? `${testId}-remove` : void 0,
1546
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3", strokeWidth: 2.5 })
1547
+ }
1548
+ )
1549
+ ]
1550
+ }
1551
+ );
1552
+ }
1313
1553
  var planBadgeVariants = classVarianceAuthority.cva(
1314
1554
  "inline-flex flex-shrink-0 items-center rounded-full border font-semibold leading-none",
1315
1555
  {
@@ -2468,7 +2708,7 @@ function UsageLineChart({
2468
2708
  dates,
2469
2709
  series,
2470
2710
  formatDate,
2471
- formatValue,
2711
+ formatValue: formatValue2,
2472
2712
  emptyLabel,
2473
2713
  labels
2474
2714
  }) {
@@ -2582,7 +2822,7 @@ function UsageLineChart({
2582
2822
  s.key,
2583
2823
  ":"
2584
2824
  ] }),
2585
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium tabular-nums", children: formatValue(s.values[hoverIdx]) })
2825
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium tabular-nums", children: formatValue2(s.values[hoverIdx]) })
2586
2826
  ] }, s.key))
2587
2827
  ] })
2588
2828
  ] });
@@ -3814,9 +4054,11 @@ exports.DEFAULT_USAGE_PROPORTION_BAR_LABELS = DEFAULT_USAGE_PROPORTION_BAR_LABEL
3814
4054
  exports.DEFAULT_WELCOME_DIALOG_LABELS = DEFAULT_WELCOME_DIALOG_LABELS;
3815
4055
  exports.DEFAULT_WORK_OFFLINE_LABELS = DEFAULT_WORK_OFFLINE_LABELS;
3816
4056
  exports.DailyCapField = DailyCapField;
4057
+ exports.DraggableHeader = DraggableHeader;
3817
4058
  exports.EmailWorkspaceDialogView = EmailWorkspaceDialogView;
3818
4059
  exports.ErrorDialogView = ErrorDialogView;
3819
4060
  exports.FIRM_POOL_MAX_TOP_UP = FIRM_POOL_MAX_TOP_UP;
4061
+ exports.FilterChip = FilterChip;
3820
4062
  exports.FirmPoolSection = FirmPoolSection;
3821
4063
  exports.FloatingPanel = FloatingPanel;
3822
4064
  exports.InlineNameEditor = InlineNameEditor;
@@ -3824,6 +4066,7 @@ exports.InviteContactsDialog = InviteContactsDialog;
3824
4066
  exports.InvoicesDialog = InvoicesDialog;
3825
4067
  exports.JsonTree = JsonTree;
3826
4068
  exports.MemberProjectRow = MemberProjectRow;
4069
+ exports.MessageJsonTree = MessageJsonTree;
3827
4070
  exports.ModelProviderLabel = ModelProviderLabel;
3828
4071
  exports.ModelSelectionSection = ModelSelectionSection;
3829
4072
  exports.PanelActionsRow = PanelActionsRow;