@agent-native/core 0.101.7 → 0.101.11

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 (219) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +28 -0
  3. package/corpus/core/docs/content/deployment.mdx +9 -7
  4. package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +9 -7
  5. package/corpus/core/docs/content/locales/de-DE/deployment.mdx +9 -7
  6. package/corpus/core/docs/content/locales/es-ES/deployment.mdx +9 -7
  7. package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +9 -7
  8. package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +9 -7
  9. package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +9 -7
  10. package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +9 -7
  11. package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +9 -7
  12. package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +9 -7
  13. package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +9 -7
  14. package/corpus/core/package.json +1 -1
  15. package/corpus/core/src/a2a/client.ts +23 -1
  16. package/corpus/core/src/a2a/handlers.ts +65 -1
  17. package/corpus/core/src/a2a/server.ts +124 -0
  18. package/corpus/core/src/a2a/task-store.ts +253 -0
  19. package/corpus/core/src/a2a/types.ts +26 -0
  20. package/corpus/core/src/agent/production-agent.ts +5 -2
  21. package/corpus/core/src/client/review/ReviewCommentComposer.tsx +9 -1
  22. package/corpus/core/src/client/review/ReviewThreadPanel.tsx +17 -2
  23. package/corpus/core/src/client/settings/SettingsPanel.tsx +41 -21
  24. package/corpus/core/src/client/settings/useBuilderStatus.ts +28 -9
  25. package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +2 -7
  26. package/corpus/core/src/mcp/builtin-tools.ts +25 -1
  27. package/corpus/core/src/scripts/call-agent.ts +22 -3
  28. package/corpus/core/src/server/agent-chat-plugin.ts +86 -1
  29. package/corpus/core/src/server/auth.ts +25 -1
  30. package/corpus/core/src/server/builder-browser.ts +353 -1
  31. package/corpus/core/src/server/core-routes-plugin.ts +601 -223
  32. package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +25 -0
  33. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +80 -1
  34. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +28 -3
  35. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +5 -1
  36. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +30 -3
  37. package/corpus/templates/calendar/app/components/calendar/OutOfOfficeEvent.tsx +196 -0
  38. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +115 -1
  39. package/corpus/templates/calendar/app/lib/out-of-office.ts +45 -0
  40. package/corpus/templates/calendar/changelog/2026-07-14-out-of-office-blocks-now-sit-behind-meetings-and-event-stack.md +6 -0
  41. package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +23 -0
  42. package/corpus/templates/content/AGENTS.md +3 -2
  43. package/corpus/templates/content/actions/_builder-cms-intent-lookup.ts +87 -0
  44. package/corpus/templates/content/actions/_builder-cms-read-client.ts +173 -25
  45. package/corpus/templates/content/actions/_builder-cms-source-adapter.ts +1 -0
  46. package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +427 -18
  47. package/corpus/templates/content/actions/_builder-cms-write-client.ts +17 -73
  48. package/corpus/templates/content/actions/_builder-cms-write-settings.ts +27 -7
  49. package/corpus/templates/content/actions/_builder-source-execution-claim.ts +124 -0
  50. package/corpus/templates/content/actions/_builder-source-execution-preservation.ts +21 -0
  51. package/corpus/templates/content/actions/_builder-source-timings.ts +57 -0
  52. package/corpus/templates/content/actions/_database-source-utils.ts +1041 -154
  53. package/corpus/templates/content/actions/_database-utils.ts +89 -12
  54. package/corpus/templates/content/actions/_preview-document-draft.ts +31 -0
  55. package/corpus/templates/content/actions/cancel-prepared-builder-source-update.ts +309 -0
  56. package/corpus/templates/content/actions/execute-builder-source-batch.ts +120 -49
  57. package/corpus/templates/content/actions/execute-builder-source-execution.ts +608 -264
  58. package/corpus/templates/content/actions/get-preview-document-draft.ts +26 -0
  59. package/corpus/templates/content/actions/materialize-builder-required-fields.ts +550 -0
  60. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +112 -65
  61. package/corpus/templates/content/actions/prepare-builder-source-review.ts +463 -170
  62. package/corpus/templates/content/actions/preview-builder-source-review.ts +99 -0
  63. package/corpus/templates/content/actions/set-content-database-source-write-mode.ts +2 -2
  64. package/corpus/templates/content/actions/update-preview-document-draft.ts +153 -0
  65. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +27 -15
  66. package/corpus/templates/content/app/components/editor/MathRenderer.tsx +43 -0
  67. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +260 -4
  68. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +57 -5
  69. package/corpus/templates/content/app/components/editor/body-hydration.ts +27 -0
  70. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2353 -576
  71. package/corpus/templates/content/app/components/editor/database/settings.tsx +13 -10
  72. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +358 -75
  73. package/corpus/templates/content/app/components/editor/extensions/NotionExtensions.tsx +78 -0
  74. package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +124 -29
  75. package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +2 -0
  76. package/corpus/templates/content/app/global.css +71 -1
  77. package/corpus/templates/content/app/hooks/use-content-database.ts +68 -0
  78. package/corpus/templates/content/app/hooks/use-documents.ts +53 -4
  79. package/corpus/templates/content/app/i18n/zh-TW.ts +38 -0
  80. package/corpus/templates/content/app/i18n-data.ts +450 -0
  81. package/corpus/templates/content/app/root.tsx +2 -0
  82. package/corpus/templates/content/changelog/2026-07-10-builder-backed-preview-edits-are-preserved-when-article-bodi.md +6 -0
  83. package/corpus/templates/content/changelog/2026-07-10-builder-cms-sources-can-now-be-enabled-for-guarded-staged-or.md +6 -0
  84. package/corpus/templates/content/changelog/2026-07-13-builder-connection-setup-is-now-available-directly-from-conn.md +6 -0
  85. package/corpus/templates/content/changelog/2026-07-13-builder-reviews-now-hide-already-applied-writes-detect-nativ.md +6 -0
  86. package/corpus/templates/content/changelog/2026-07-13-required-builder-publishing-fields-can-now-be-added-directly.md +6 -0
  87. package/corpus/templates/content/changelog/2026-07-13-you-can-now-cancel-a-prepared-builder-update-safely-before-i.md +6 -0
  88. package/corpus/templates/content/changelog/2026-07-14-builder-account-connection-now-remains-available-when-branch.md +6 -0
  89. package/corpus/templates/content/changelog/2026-07-14-builder-backed-articles-now-preserve-fifth-and-sixth-level-h.md +6 -0
  90. package/corpus/templates/content/changelog/2026-07-14-builder-sources-now-review-and-publish-rich-article-updates-.md +6 -0
  91. package/corpus/templates/content/changelog/2026-07-14-builder-writes-now-stop-retries-when-reconciliation-is-needed.md +6 -0
  92. package/corpus/templates/content/changelog/2026-07-14-file-and-media-links-now-validate-before-saving.md +6 -0
  93. package/corpus/templates/content/changelog/2026-07-14-latex-equations-render-in-documents-public-pages-and-exports.md +6 -0
  94. package/corpus/templates/content/package.json +1 -0
  95. package/corpus/templates/content/parity/matrix.md +27 -25
  96. package/corpus/templates/content/parity/matrix.ts +50 -2
  97. package/corpus/templates/content/server/db/schema.ts +47 -0
  98. package/corpus/templates/content/server/plugins/auth.ts +1 -0
  99. package/corpus/templates/content/server/plugins/db.ts +53 -0
  100. package/corpus/templates/content/shared/api.ts +70 -1
  101. package/corpus/templates/content/shared/builder-mdx.ts +705 -15
  102. package/corpus/templates/content/shared/document-export.ts +296 -25
  103. package/corpus/templates/content/shared/inline-math.ts +128 -0
  104. package/corpus/templates/content/shared/math-rendering.ts +50 -0
  105. package/corpus/templates/content/shared/nfm.ts +20 -17
  106. package/corpus/templates/content/vite.config.ts +0 -1
  107. package/corpus/templates/design/app/components/design/ReadOnlyDesignBanner.tsx +52 -7
  108. package/corpus/templates/design/app/components/design/ReviewCommentsPanel.tsx +36 -4
  109. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +4 -1
  110. package/corpus/templates/design/app/i18n/ar-SA.ts +1 -0
  111. package/corpus/templates/design/app/i18n/de-DE.ts +1 -0
  112. package/corpus/templates/design/app/i18n/en-US.ts +1 -0
  113. package/corpus/templates/design/app/i18n/es-ES.ts +1 -0
  114. package/corpus/templates/design/app/i18n/fr-FR.ts +1 -0
  115. package/corpus/templates/design/app/i18n/hi-IN.ts +1 -0
  116. package/corpus/templates/design/app/i18n/ja-JP.ts +1 -0
  117. package/corpus/templates/design/app/i18n/ko-KR.ts +1 -0
  118. package/corpus/templates/design/app/i18n/pt-BR.ts +1 -0
  119. package/corpus/templates/design/app/i18n/zh-CN.ts +1 -0
  120. package/corpus/templates/design/app/i18n/zh-TW.ts +1 -0
  121. package/corpus/templates/design/app/pages/design-editor/selection-state.ts +8 -0
  122. package/corpus/templates/design/app/pages/design-editor/tool-state.ts +11 -0
  123. package/corpus/templates/design/changelog/2026-07-14-reviewers-can-now-pin-comments-from-the-canvas-toolbar-targe.md +6 -0
  124. package/corpus/templates/design/changelog/2026-07-15-viewer-comment-controls-now-sit-inside-the-read-only-notice-.md +6 -0
  125. package/corpus/templates/design/shared/review-anchor.ts +48 -0
  126. package/corpus/templates/mail/.agents/skills/email-drafts/SKILL.md +17 -0
  127. package/corpus/templates/mail/AGENTS.md +21 -19
  128. package/corpus/templates/mail/actions/create-attachment-upload.ts +49 -0
  129. package/corpus/templates/mail/changelog/2026-07-14-connected-agents-can-now-securely-upload-local-files-for-mai.md +6 -0
  130. package/corpus/templates/mail/server/handlers/media.ts +84 -61
  131. package/corpus/templates/mail/server/lib/attachment-upload-ticket.ts +234 -0
  132. package/corpus/templates/mail/server/lib/mail-connector-catalog.ts +8 -4
  133. package/corpus/templates/mail/server/lib/media-upload.ts +114 -0
  134. package/corpus/templates/mail/server/plugins/auth.ts +9 -1
  135. package/corpus/templates/mail/server/routes/api/media/attachment-upload/[uploadId].put.ts +1 -0
  136. package/corpus/templates/plan/server/plan-mdx.ts +53 -7
  137. package/dist/a2a/client.d.ts +5 -1
  138. package/dist/a2a/client.d.ts.map +1 -1
  139. package/dist/a2a/client.js +18 -1
  140. package/dist/a2a/client.js.map +1 -1
  141. package/dist/a2a/handlers.d.ts.map +1 -1
  142. package/dist/a2a/handlers.js +57 -8
  143. package/dist/a2a/handlers.js.map +1 -1
  144. package/dist/a2a/server.d.ts.map +1 -1
  145. package/dist/a2a/server.js +87 -1
  146. package/dist/a2a/server.js.map +1 -1
  147. package/dist/a2a/task-store.d.ts +27 -0
  148. package/dist/a2a/task-store.d.ts.map +1 -1
  149. package/dist/a2a/task-store.js +216 -0
  150. package/dist/a2a/task-store.js.map +1 -1
  151. package/dist/a2a/types.d.ts +24 -0
  152. package/dist/a2a/types.d.ts.map +1 -1
  153. package/dist/a2a/types.js.map +1 -1
  154. package/dist/agent/production-agent.d.ts +1 -0
  155. package/dist/agent/production-agent.d.ts.map +1 -1
  156. package/dist/agent/production-agent.js +5 -2
  157. package/dist/agent/production-agent.js.map +1 -1
  158. package/dist/client/review/ReviewCommentComposer.d.ts +2 -1
  159. package/dist/client/review/ReviewCommentComposer.d.ts.map +1 -1
  160. package/dist/client/review/ReviewCommentComposer.js +3 -3
  161. package/dist/client/review/ReviewCommentComposer.js.map +1 -1
  162. package/dist/client/review/ReviewThreadPanel.d.ts +9 -1
  163. package/dist/client/review/ReviewThreadPanel.d.ts.map +1 -1
  164. package/dist/client/review/ReviewThreadPanel.js +6 -4
  165. package/dist/client/review/ReviewThreadPanel.js.map +1 -1
  166. package/dist/client/settings/SettingsPanel.d.ts +3 -0
  167. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  168. package/dist/client/settings/SettingsPanel.js +11 -4
  169. package/dist/client/settings/SettingsPanel.js.map +1 -1
  170. package/dist/client/settings/useBuilderStatus.d.ts +8 -4
  171. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  172. package/dist/client/settings/useBuilderStatus.js +19 -6
  173. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  174. package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -1
  175. package/dist/client/setup-connections/BuilderConnectCard.js +2 -5
  176. package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -1
  177. package/dist/collab/awareness.d.ts +2 -2
  178. package/dist/collab/awareness.d.ts.map +1 -1
  179. package/dist/collab/struct-routes.d.ts +1 -1
  180. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  181. package/dist/mcp/builtin-tools.d.ts.map +1 -1
  182. package/dist/mcp/builtin-tools.js +22 -3
  183. package/dist/mcp/builtin-tools.js.map +1 -1
  184. package/dist/notifications/routes.d.ts +3 -3
  185. package/dist/resources/handlers.d.ts +2 -2
  186. package/dist/scripts/call-agent.d.ts +1 -1
  187. package/dist/scripts/call-agent.d.ts.map +1 -1
  188. package/dist/scripts/call-agent.js +19 -1
  189. package/dist/scripts/call-agent.js.map +1 -1
  190. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  191. package/dist/server/agent-chat-plugin.js +71 -2
  192. package/dist/server/agent-chat-plugin.js.map +1 -1
  193. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  194. package/dist/server/auth.d.ts +1 -0
  195. package/dist/server/auth.d.ts.map +1 -1
  196. package/dist/server/auth.js +19 -2
  197. package/dist/server/auth.js.map +1 -1
  198. package/dist/server/builder-browser.d.ts +78 -0
  199. package/dist/server/builder-browser.d.ts.map +1 -1
  200. package/dist/server/builder-browser.js +246 -1
  201. package/dist/server/builder-browser.js.map +1 -1
  202. package/dist/server/core-routes-plugin.d.ts +41 -0
  203. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  204. package/dist/server/core-routes-plugin.js +260 -14
  205. package/dist/server/core-routes-plugin.js.map +1 -1
  206. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +25 -0
  207. package/docs/content/deployment.mdx +9 -7
  208. package/docs/content/locales/ar-SA/deployment.mdx +9 -7
  209. package/docs/content/locales/de-DE/deployment.mdx +9 -7
  210. package/docs/content/locales/es-ES/deployment.mdx +9 -7
  211. package/docs/content/locales/fr-FR/deployment.mdx +9 -7
  212. package/docs/content/locales/hi-IN/deployment.mdx +9 -7
  213. package/docs/content/locales/ja-JP/deployment.mdx +9 -7
  214. package/docs/content/locales/ko-KR/deployment.mdx +9 -7
  215. package/docs/content/locales/pt-BR/deployment.mdx +9 -7
  216. package/docs/content/locales/zh-CN/deployment.mdx +9 -7
  217. package/docs/content/locales/zh-TW/deployment.mdx +9 -7
  218. package/package.json +2 -2
  219. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +25 -0
@@ -9,10 +9,11 @@ export interface ReviewCommentComposerProps {
9
9
  placeholder?: string;
10
10
  commentLabel?: string;
11
11
  agentLabel?: string;
12
+ contextLabel?: string;
12
13
  autoFocus?: boolean;
13
14
  submitOnEnter?: boolean;
14
15
  onEscape?: () => void;
15
16
  className?: string;
16
17
  }
17
- export declare function ReviewCommentComposer({ value, onChange, onSubmit, submittingTarget, disabled, showAgentAction, placeholder, commentLabel, agentLabel, autoFocus, submitOnEnter, onEscape, className, }: ReviewCommentComposerProps): import("react").JSX.Element;
18
+ export declare function ReviewCommentComposer({ value, onChange, onSubmit, submittingTarget, disabled, showAgentAction, placeholder, commentLabel, agentLabel, contextLabel, autoFocus, submitOnEnter, onEscape, className, }: ReviewCommentComposerProps): import("react").JSX.Element;
18
19
  //# sourceMappingURL=ReviewCommentComposer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewCommentComposer.d.ts","sourceRoot":"","sources":["../../../src/client/review/ReviewCommentComposer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IA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AU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,gBAAuB,EACvB,QAAgB,EAChB,eAAuB,EACvB,WAAgC,EAChC,YAAwB,EACxB,UAA4B,EAC5B,YAAY,EACZ,SAAiB,EACjB,aAAqB,EACrB,QAAQ,EACR,SAAS,GACV,EAAE,0BAA0B,+BA2E5B"}
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from "@agent-native/toolkit/ui/button";
3
3
  import { Spinner } from "@agent-native/toolkit/ui/spinner";
4
4
  import { Textarea } from "@agent-native/toolkit/ui/textarea";
5
- import { IconMessageCircle, IconSend } from "@tabler/icons-react";
5
+ import { IconFocus2, IconMessageCircle, IconSend } from "@tabler/icons-react";
6
6
  import { cn } from "../utils.js";
7
- export function ReviewCommentComposer({ value, onChange, onSubmit, submittingTarget = null, disabled = false, showAgentAction = false, placeholder = "Add a comment...", commentLabel = "Comment", agentLabel = "Send to agent", autoFocus = false, submitOnEnter = false, onEscape, className, }) {
7
+ export function ReviewCommentComposer({ value, onChange, onSubmit, submittingTarget = null, disabled = false, showAgentAction = false, placeholder = "Add a comment...", commentLabel = "Comment", agentLabel = "Send to agent", contextLabel, autoFocus = false, submitOnEnter = false, onEscape, className, }) {
8
8
  const canSubmit = Boolean(value.trim()) && !disabled;
9
9
  const submit = (resolutionTarget) => {
10
10
  if (!canSubmit)
@@ -14,7 +14,7 @@ export function ReviewCommentComposer({ value, onChange, onSubmit, submittingTar
14
14
  return (_jsxs("form", { className: cn("@container/review", className), onSubmit: (event) => {
15
15
  event.preventDefault();
16
16
  submit("human");
17
- }, children: [_jsx(Textarea, { autoFocus: autoFocus, value: value, disabled: disabled, onChange: (event) => onChange(event.currentTarget.value), placeholder: placeholder, className: "min-h-16 resize-none text-sm", onKeyDown: (event) => {
17
+ }, children: [contextLabel ? (_jsxs("div", { className: "mb-2 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx(IconFocus2, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: contextLabel })] })) : null, _jsx(Textarea, { autoFocus: autoFocus, value: value, disabled: disabled, onChange: (event) => onChange(event.currentTarget.value), placeholder: placeholder, className: "min-h-16 resize-none text-sm", onKeyDown: (event) => {
18
18
  if (event.key === "Escape" && onEscape) {
19
19
  event.stopPropagation();
20
20
  event.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewCommentComposer.js","sourceRoot":"","sources":["../../../src/client/review/ReviewCommentComposer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAkBjC,MAAM,UAAU,qBAAqB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,gBAAgB,GAAG,IAAI,EACvB,QAAQ,GAAG,KAAK,EAChB,eAAe,GAAG,KAAK,EACvB,WAAW,GAAG,kBAAkB,EAChC,YAAY,GAAG,SAAS,EACxB,UAAU,GAAG,eAAe,EAC5B,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,KAAK,EACrB,QAAQ,EACR,SAAS,GACkB;IAC3B,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI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AAC,CAAC,CAAC,CAC9B,KAAC,OAAO,IAAC,SAAS,EAAC,UAAU,GAAG,CACjC,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAAC,SAAS,EAAC,UAAU,GAAG,CAC3C,EACD,eAAM,SAAS,EAAC,UAAU,YAAE,YAAY,GAAQ,IACzC,EACR,eAAe,CAAC,CAAC,CAAC,CACjB,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAE,CAAC,SAAS,EACpB,SAAS,EAAC,+CAA+C,EACzD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,aAE7B,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CAC9B,KAAC,OAAO,IAAC,SAAS,EAAC,UAAU,GAAG,CACjC,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,GAAG,CAClC,EACD,eAAM,SAAS,EAAC,UAAU,YAAE,UAAU,GAAQ,IACvC,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,IACD,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport { Spinner } from \"@agent-native/toolkit/ui/spinner\";\nimport { Textarea } from \"@agent-native/toolkit/ui/textarea\";\nimport { IconMessageCircle, IconSend } from \"@tabler/icons-react\";\n\nimport type { ReviewResolutionTarget } from \"../../review/types.js\";\nimport { cn } from \"../utils.js\";\n\nexport interface ReviewCommentComposerProps {\n value: string;\n onChange: (value: string) => void;\n onSubmit: (resolutionTarget: ReviewResolutionTarget) => void;\n submittingTarget?: ReviewResolutionTarget | null;\n disabled?: boolean;\n showAgentAction?: boolean;\n placeholder?: string;\n commentLabel?: string;\n agentLabel?: string;\n autoFocus?: boolean;\n submitOnEnter?: boolean;\n onEscape?: () => void;\n className?: string;\n}\n\nexport function ReviewCommentComposer({\n value,\n onChange,\n onSubmit,\n submittingTarget = null,\n disabled = false,\n showAgentAction = false,\n placeholder = \"Add a comment...\",\n commentLabel = \"Comment\",\n agentLabel = \"Send to agent\",\n autoFocus = false,\n submitOnEnter = false,\n onEscape,\n className,\n}: ReviewCommentComposerProps) {\n const canSubmit = Boolean(value.trim()) && !disabled;\n const submit = (resolutionTarget: ReviewResolutionTarget) => {\n if (!canSubmit) return;\n onSubmit(resolutionTarget);\n };\n\n return (\n <form\n className={cn(\"@container/review\", className)}\n onSubmit={(event) => {\n event.preventDefault();\n submit(\"human\");\n }}\n >\n <Textarea\n autoFocus={autoFocus}\n value={value}\n disabled={disabled}\n onChange={(event) => onChange(event.currentTarget.value)}\n placeholder={placeholder}\n className=\"min-h-16 resize-none text-sm\"\n onKeyDown={(event) => {\n if (event.key === \"Escape\" && onEscape) {\n event.stopPropagation();\n event.preventDefault();\n onEscape();\n return;\n }\n if (submitOnEnter && event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n submit(\"human\");\n }\n }}\n />\n <div className=\"mt-2 flex flex-col items-stretch justify-end gap-2 @2xs/review:flex-row @2xs/review:items-center\">\n <Button\n type=\"submit\"\n size=\"sm\"\n disabled={!canSubmit}\n className=\"h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto\"\n >\n {submittingTarget === \"human\" ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconMessageCircle className=\"size-3.5\" />\n )}\n <span className=\"truncate\">{commentLabel}</span>\n </Button>\n {showAgentAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!canSubmit}\n className=\"h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto\"\n onClick={() => submit(\"agent\")}\n >\n {submittingTarget === \"agent\" ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconSend className=\"size-3.5\" />\n )}\n <span className=\"truncate\">{agentLabel}</span>\n </Button>\n ) : null}\n </div>\n </form>\n );\n}\n"]}
1
+ {"version":3,"file":"ReviewCommentComposer.js","sour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,SAAS,EACjB,QAAQ,EAAE,CAAC,SAAS,EACpB,SAAS,EAAC,+CAA+C,EACzD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,aAE7B,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CAC9B,KAAC,OAAO,IAAC,SAAS,EAAC,UAAU,GAAG,CACjC,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,GAAG,CAClC,EACD,eAAM,SAAS,EAAC,UAAU,YAAE,UAAU,GAAQ,IACvC,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,IACD,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport { Spinner } from \"@agent-native/toolkit/ui/spinner\";\nimport { Textarea } from \"@agent-native/toolkit/ui/textarea\";\nimport { IconFocus2, IconMessageCircle, IconSend } from \"@tabler/icons-react\";\n\nimport type { ReviewResolutionTarget } from \"../../review/types.js\";\nimport { cn } from \"../utils.js\";\n\nexport interface ReviewCommentComposerProps {\n value: string;\n onChange: (value: string) => void;\n onSubmit: (resolutionTarget: ReviewResolutionTarget) => void;\n submittingTarget?: ReviewResolutionTarget | null;\n disabled?: boolean;\n showAgentAction?: boolean;\n placeholder?: string;\n commentLabel?: string;\n agentLabel?: string;\n contextLabel?: string;\n autoFocus?: boolean;\n submitOnEnter?: boolean;\n onEscape?: () => void;\n className?: string;\n}\n\nexport function ReviewCommentComposer({\n value,\n onChange,\n onSubmit,\n submittingTarget = null,\n disabled = false,\n showAgentAction = false,\n placeholder = \"Add a comment...\",\n commentLabel = \"Comment\",\n agentLabel = \"Send to agent\",\n contextLabel,\n autoFocus = false,\n submitOnEnter = false,\n onEscape,\n className,\n}: ReviewCommentComposerProps) {\n const canSubmit = Boolean(value.trim()) && !disabled;\n const submit = (resolutionTarget: ReviewResolutionTarget) => {\n if (!canSubmit) return;\n onSubmit(resolutionTarget);\n };\n\n return (\n <form\n className={cn(\"@container/review\", className)}\n onSubmit={(event) => {\n event.preventDefault();\n submit(\"human\");\n }}\n >\n {contextLabel ? (\n <div className=\"mb-2 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground\">\n <IconFocus2 className=\"size-3.5 shrink-0\" />\n <span className=\"truncate\">{contextLabel}</span>\n </div>\n ) : null}\n <Textarea\n autoFocus={autoFocus}\n value={value}\n disabled={disabled}\n onChange={(event) => onChange(event.currentTarget.value)}\n placeholder={placeholder}\n className=\"min-h-16 resize-none text-sm\"\n onKeyDown={(event) => {\n if (event.key === \"Escape\" && onEscape) {\n event.stopPropagation();\n event.preventDefault();\n onEscape();\n return;\n }\n if (submitOnEnter && event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n submit(\"human\");\n }\n }}\n />\n <div className=\"mt-2 flex flex-col items-stretch justify-end gap-2 @2xs/review:flex-row @2xs/review:items-center\">\n <Button\n type=\"submit\"\n size=\"sm\"\n disabled={!canSubmit}\n className=\"h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto\"\n >\n {submittingTarget === \"human\" ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconMessageCircle className=\"size-3.5\" />\n )}\n <span className=\"truncate\">{commentLabel}</span>\n </Button>\n {showAgentAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!canSubmit}\n className=\"h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto\"\n onClick={() => submit(\"agent\")}\n >\n {submittingTarget === \"agent\" ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconSend className=\"size-3.5\" />\n )}\n <span className=\"truncate\">{agentLabel}</span>\n </Button>\n ) : null}\n </div>\n </form>\n );\n}\n"]}
@@ -10,6 +10,14 @@ export interface ReviewThreadPanelProps {
10
10
  resourceType: string;
11
11
  resourceId: string;
12
12
  targetId?: string | null;
13
+ /** Persist new comments against this target while targetId continues to filter the list. */
14
+ composerTargetId?: string | null;
15
+ /** Optional element/point anchor attached to new comments from the composer. */
16
+ composerAnchor?: unknown | null;
17
+ /** Host metadata attached to new comments from the composer. */
18
+ composerMetadata?: Record<string, unknown>;
19
+ /** Visible label describing the element currently targeted by the composer. */
20
+ composerContextLabel?: string;
13
21
  title?: string;
14
22
  className?: string;
15
23
  includeResolved?: boolean;
@@ -42,6 +50,6 @@ export interface ReviewThreadPanelProps {
42
50
  composerCommentLabel?: string;
43
51
  composerAgentLabel?: string;
44
52
  }
45
- export declare function ReviewThreadPanel({ resourceType, resourceId, targetId, title, className, includeResolved, showComposer, showHeader, variant, placeholder, emptyState, loadingLabel, replyLabel, replyPlaceholder, cancelReplyLabel, resolveLabel, deleteLabel, moreActionsLabel, resolvedLabel, reviewerLabel, onSelectThread, onCommentCreated, canReply, canResolve, canDeleteComment, renderThreadActions, showComposerTargetPicker, composerCommentLabel, composerAgentLabel, }: ReviewThreadPanelProps): import("react").JSX.Element;
53
+ export declare function ReviewThreadPanel({ resourceType, resourceId, targetId, composerTargetId, composerAnchor, composerMetadata, composerContextLabel, title, className, includeResolved, showComposer, showHeader, variant, placeholder, emptyState, loadingLabel, replyLabel, replyPlaceholder, cancelReplyLabel, resolveLabel, deleteLabel, moreActionsLabel, resolvedLabel, reviewerLabel, onSelectThread, onCommentCreated, canReply, canResolve, canDeleteComment, renderThreadActions, showComposerTargetPicker, composerCommentLabel, composerAgentLabel, }: ReviewThreadPanelProps): import("react").JSX.Element;
46
54
  export declare function buildReviewThreads(comments: ReviewComment[]): ReviewThread[];
47
55
  //# sourceMappingURL=ReviewThreadPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewThreadPanel.d.ts","sourceRoot":"","sources":["../../../src/client/review/ReviewThreadPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAa/B,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,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C;IAClC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,SAAS,CAAC;IAC1D,gFAAgF;IAChF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAgB,EAChB,SAAS,EACT,eAAsB,EACtB,YAAmB,EACnB,UAAiB,EACjB,OAAgB,EAChB,WAAgC,EAChC,UAAsC,EACtC,YAAiC,EACjC,UAAoB,EACpB,gBAA6B,EAC7B,gBAAiC,EACjC,YAAwB,EACxB,WAA8B,EAC9B,gBAAiC,EACjC,aAA0B,EAC1B,aAA0B,EAC1B,cAAc,EACd,gBAAgB,EAChB,QAAgB,EAChB,UAAkB,EAClB,gBAAwB,EACxB,mBAAmB,EACnB,wBAAgC,EAChC,oBAAgC,EAChC,kBAAoC,GACrC,EAAE,sBAAsB,+BAyTxB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAkB5E"}
1
+ {"version":3,"file":"ReviewThreadPanel.d.ts","sourceRoot":"","sources":["../../../src/client/review/ReviewThreadPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAa/B,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,CAAC,CAAC,MAA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C,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,SAAS,CAAC;IAC1D,gFAAgF;IAChF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,KAAgB,EAChB,SAAS,EACT,eAAsB,EACtB,YAAmB,EACnB,UAAiB,EACjB,OAAgB,EAChB,WAAgC,EAChC,UAAsC,EACtC,YAAiC,EACjC,UAAoB,EACpB,gBAA6B,EAC7B,gBAAiC,EACjC,YAAwB,EACxB,WAA8B,EAC9B,gBAAiC,EACjC,aAA0B,EAC1B,aAA0B,EAC1B,cAAc,EACd,gBAAgB,EAChB,QAAgB,EAChB,UAAkB,EAClB,gBAAwB,EACxB,mBAAmB,EACnB,wBAAgC,EAChC,oBAAgC,EAChC,kBAAoC,GACrC,EAAE,sBAAsB,+BA4TxB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAkB5E"}
@@ -12,7 +12,7 @@ import { cn } from "../utils.js";
12
12
  import { ReviewCommentComposer } from "./ReviewCommentComposer.js";
13
13
  import { ReviewStatusBadge } from "./ReviewStatusBadge.js";
14
14
  import { useCreateReviewComment, useDeleteReviewComment, useReplyReviewComment, useResolveReviewThread, useReviewComments, } from "./use-review.js";
15
- export function ReviewThreadPanel({ resourceType, resourceId, targetId, title = "Review", className, includeResolved = true, showComposer = true, showHeader = true, variant = "card", placeholder = "Add a comment...", emptyState = "No review comments yet.", loadingLabel = "Loading comments", replyLabel = "Reply", replyPlaceholder = "Reply...", cancelReplyLabel = "Cancel reply", resolveLabel = "Resolve", deleteLabel = "Delete comment", moreActionsLabel = "More actions", resolvedLabel = "Resolved", reviewerLabel = "Reviewer", onSelectThread, onCommentCreated, canReply = false, canResolve = false, canDeleteComment = false, renderThreadActions, showComposerTargetPicker = false, composerCommentLabel = "Comment", composerAgentLabel = "Send to agent", }) {
15
+ export function ReviewThreadPanel({ resourceType, resourceId, targetId, composerTargetId, composerAnchor, composerMetadata, composerContextLabel, title = "Review", className, includeResolved = true, showComposer = true, showHeader = true, variant = "card", placeholder = "Add a comment...", emptyState = "No review comments yet.", loadingLabel = "Loading comments", replyLabel = "Reply", replyPlaceholder = "Reply...", cancelReplyLabel = "Cancel reply", resolveLabel = "Resolve", deleteLabel = "Delete comment", moreActionsLabel = "More actions", resolvedLabel = "Resolved", reviewerLabel = "Reviewer", onSelectThread, onCommentCreated, canReply = false, canResolve = false, canDeleteComment = false, renderThreadActions, showComposerTargetPicker = false, composerCommentLabel = "Comment", composerAgentLabel = "Send to agent", }) {
16
16
  const [draft, setDraft] = useState("");
17
17
  const [submittingTarget, setSubmittingTarget] = useState(null);
18
18
  const [replyingThreadId, setReplyingThreadId] = useState(null);
@@ -37,9 +37,11 @@ export function ReviewThreadPanel({ resourceType, resourceId, targetId, title =
37
37
  createComment.mutate({
38
38
  resourceType,
39
39
  resourceId,
40
- targetId,
40
+ targetId: composerTargetId === undefined ? targetId : composerTargetId,
41
+ ...(composerAnchor !== undefined ? { anchor: composerAnchor } : {}),
42
+ ...(composerMetadata ? { metadata: composerMetadata } : {}),
41
43
  body,
42
- ...(showComposerTargetPicker ? { resolutionTarget } : {}),
44
+ resolutionTarget: showComposerTargetPicker ? resolutionTarget : "human",
43
45
  }, {
44
46
  onSuccess: (comment) => {
45
47
  setDraft("");
@@ -50,7 +52,7 @@ export function ReviewThreadPanel({ resourceType, resourceId, targetId, title =
50
52
  };
51
53
  return (_jsxs("section", { className: cn("@container/review overflow-hidden text-card-foreground", variant === "card"
52
54
  ? "rounded-lg border border-border bg-card"
53
- : "bg-transparent", className), children: [showHeader ? (_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border px-3 py-2.5", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconMessageCircle, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("h2", { className: "truncate text-sm font-medium", children: title })] }), _jsx(ReviewStatusBadge, { status: comments.data?.reviewStatus?.status, className: "shrink-0" })] })) : null, showComposer ? (_jsx(ReviewCommentComposer, { className: "border-b border-border px-3 py-3", value: draft, onChange: setDraft, onSubmit: submitDraft, submittingTarget: submittingTarget, disabled: createComment.isPending, showAgentAction: showComposerTargetPicker, placeholder: placeholder, commentLabel: composerCommentLabel, agentLabel: composerAgentLabel })) : null, _jsx("div", { className: "divide-y divide-border", children: comments.isLoading ? (_jsxs("div", { className: "flex flex-col gap-3 px-3 py-4", "aria-label": loadingLabel, children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(Skeleton, { className: "size-7 rounded-full" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [_jsx(Skeleton, { className: "h-3 w-2/5" }), _jsx(Skeleton, { className: "h-3 w-4/5" })] })] }), _jsx(Skeleton, { className: "h-8 w-full" })] })) : threads.length ? (threads.map((thread) => {
55
+ : "bg-transparent", className), children: [showHeader ? (_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border px-3 py-2.5", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconMessageCircle, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("h2", { className: "truncate text-sm font-medium", children: title })] }), _jsx(ReviewStatusBadge, { status: comments.data?.reviewStatus?.status, className: "shrink-0" })] })) : null, showComposer ? (_jsx(ReviewCommentComposer, { className: "border-b border-border px-3 py-3", value: draft, onChange: setDraft, onSubmit: submitDraft, submittingTarget: submittingTarget, disabled: createComment.isPending, showAgentAction: showComposerTargetPicker, placeholder: placeholder, commentLabel: composerCommentLabel, agentLabel: composerAgentLabel, contextLabel: composerContextLabel })) : null, _jsx("div", { className: "divide-y divide-border", children: comments.isLoading ? (_jsxs("div", { className: "flex flex-col gap-3 px-3 py-4", "aria-label": loadingLabel, children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(Skeleton, { className: "size-7 rounded-full" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [_jsx(Skeleton, { className: "h-3 w-2/5" }), _jsx(Skeleton, { className: "h-3 w-4/5" })] })] }), _jsx(Skeleton, { className: "h-8 w-full" })] })) : threads.length ? (threads.map((thread) => {
54
56
  const replyDraft = replyDrafts[thread.root.id] ?? "";
55
57
  const replying = replyingThreadId === thread.root.threadId;
56
58
  const threadIsOpen = thread.root.status === "open";
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewThreadPanel.js","sourceRoot":"","sources":["../../../src/client/review/ReviewThreadPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,KAA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avatar, AvatarFallback } from \"@agent-native/toolkit/ui/avatar\";\nimport { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@agent-native/toolkit/ui/dropdown-menu\";\nimport { Input } from \"@agent-native/toolkit/ui/input\";\nimport { Skeleton } from \"@agent-native/toolkit/ui/skeleton\";\nimport { Spinner } from \"@agent-native/toolkit/ui/spinner\";\nimport {\n IconCircleCheck,\n IconDots,\n IconMessageCircle,\n IconSend,\n IconTrash,\n IconX,\n} from \"@tabler/icons-react\";\nimport { useMemo, useState, type ReactNode } from \"react\";\n\nimport type {\n ReviewComment,\n ReviewResolutionTarget,\n} from \"../../review/types.js\";\nimport { useFormatters } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport { ReviewCommentComposer } from \"./ReviewCommentComposer.js\";\nimport { ReviewStatusBadge } from \"./ReviewStatusBadge.js\";\nimport {\n useCreateReviewComment,\n useDeleteReviewComment,\n useReplyReviewComment,\n useResolveReviewThread,\n useReviewComments,\n} from \"./use-review.js\";\n\nexport interface ReviewThread {\n root: ReviewComment;\n replies: ReviewComment[];\n}\n\nexport type ReviewThreadCapability =\n | boolean\n | ((thread: ReviewThread) => boolean);\n\nexport type ReviewCommentCapability =\n | boolean\n | ((comment: ReviewComment, thread: ReviewThread) => boolean);\n\nexport interface ReviewThreadPanelProps {\n resourceType: string;\n resourceId: string;\n targetId?: string | null;\n title?: string;\n className?: string;\n includeResolved?: boolean;\n showComposer?: boolean;\n showHeader?: boolean;\n variant?: \"card\" | \"plain\";\n placeholder?: string;\n emptyState?: string;\n loadingLabel?: string;\n replyLabel?: string;\n replyPlaceholder?: string;\n cancelReplyLabel?: string;\n resolveLabel?: string;\n deleteLabel?: string;\n moreActionsLabel?: string;\n resolvedLabel?: string;\n reviewerLabel?: string;\n onSelectThread?: (thread: ReviewThread) => void;\n onCommentCreated?: (comment: ReviewComment) => void;\n /** Allow signed-in commenters to reply. Omitted capabilities fail closed. */\n canReply?: ReviewThreadCapability;\n /** Allow editors to resolve a thread. Omitted capabilities fail closed. */\n canResolve?: ReviewThreadCapability;\n /** Allow deletion only for comments the caller has authorized. */\n canDeleteComment?: ReviewCommentCapability;\n /** Extra per-thread controls rendered next to reply/resolve/delete. */\n renderThreadActions?: (thread: ReviewThread) => ReactNode;\n /** Show a separate agent-submit action when the host supports agent routing. */\n showComposerTargetPicker?: boolean;\n composerCommentLabel?: string;\n composerAgentLabel?: string;\n}\n\nexport function ReviewThreadPanel({\n resourceType,\n resourceId,\n targetId,\n title = \"Review\",\n className,\n includeResolved = true,\n showComposer = true,\n showHeader = true,\n variant = \"card\",\n placeholder = \"Add a comment...\",\n emptyState = \"No review comments yet.\",\n loadingLabel = \"Loading comments\",\n replyLabel = \"Reply\",\n replyPlaceholder = \"Reply...\",\n cancelReplyLabel = \"Cancel reply\",\n resolveLabel = \"Resolve\",\n deleteLabel = \"Delete comment\",\n moreActionsLabel = \"More actions\",\n resolvedLabel = \"Resolved\",\n reviewerLabel = \"Reviewer\",\n onSelectThread,\n onCommentCreated,\n canReply = false,\n canResolve = false,\n canDeleteComment = false,\n renderThreadActions,\n showComposerTargetPicker = false,\n composerCommentLabel = \"Comment\",\n composerAgentLabel = \"Send to agent\",\n}: ReviewThreadPanelProps) {\n const [draft, setDraft] = useState(\"\");\n const [submittingTarget, setSubmittingTarget] =\n useState<ReviewResolutionTarget | null>(null);\n const [replyingThreadId, setReplyingThreadId] = useState<string | null>(null);\n const [replyDrafts, setReplyDrafts] = useState<Record<string, string>>({});\n const { formatDate } = useFormatters();\n const comments = useReviewComments({\n resourceType,\n resourceId,\n targetId,\n includeResolved,\n });\n const createComment = useCreateReviewComment();\n const replyComment = useReplyReviewComment();\n const resolveThread = useResolveReviewThread();\n const deleteComment = useDeleteReviewComment();\n const threads = useMemo(\n () => buildReviewThreads(comments.data?.comments ?? []),\n [comments.data?.comments],\n );\n\n const submitDraft = (resolutionTarget: ReviewResolutionTarget) => {\n const body = draft.trim();\n if (!body || createComment.isPending) return;\n setSubmittingTarget(resolutionTarget);\n createComment.mutate(\n {\n resourceType,\n resourceId,\n targetId,\n body,\n ...(showComposerTargetPicker ? { resolutionTarget } : {}),\n },\n {\n onSuccess: (comment) => {\n setDraft(\"\");\n onCommentCreated?.(comment);\n },\n onSettled: () => setSubmittingTarget(null),\n },\n );\n };\n\n return (\n <section\n className={cn(\n \"@container/review overflow-hidden text-card-foreground\",\n variant === \"card\"\n ? \"rounded-lg border border-border bg-card\"\n : \"bg-transparent\",\n className,\n )}\n >\n {showHeader ? (\n <div className=\"flex items-center justify-between gap-3 border-b border-border px-3 py-2.5\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconMessageCircle className=\"size-4 shrink-0 text-muted-foreground\" />\n <h2 className=\"truncate text-sm font-medium\">{title}</h2>\n </div>\n <ReviewStatusBadge\n status={comments.data?.reviewStatus?.status}\n className=\"shrink-0\"\n />\n </div>\n ) : null}\n\n {showComposer ? (\n <ReviewCommentComposer\n className=\"border-b border-border px-3 py-3\"\n value={draft}\n onChange={setDraft}\n onSubmit={submitDraft}\n submittingTarget={submittingTarget}\n disabled={createComment.isPending}\n showAgentAction={showComposerTargetPicker}\n placeholder={placeholder}\n commentLabel={composerCommentLabel}\n agentLabel={composerAgentLabel}\n />\n ) : null}\n\n <div className=\"divide-y divide-border\">\n {comments.isLoading ? (\n <div\n className=\"flex flex-col gap-3 px-3 py-4\"\n aria-label={loadingLabel}\n >\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-7 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-2/5\" />\n <Skeleton className=\"h-3 w-4/5\" />\n </div>\n </div>\n <Skeleton className=\"h-8 w-full\" />\n </div>\n ) : threads.length ? (\n threads.map((thread) => {\n const replyDraft = replyDrafts[thread.root.id] ?? \"\";\n const replying = replyingThreadId === thread.root.threadId;\n const threadIsOpen = thread.root.status === \"open\";\n const replyAllowed =\n threadIsOpen && capabilityAllowsThread(canReply, thread);\n const resolveAllowed =\n threadIsOpen && capabilityAllowsThread(canResolve, thread);\n const deleteAllowed = capabilityAllowsComment(\n canDeleteComment,\n thread.root,\n thread,\n );\n const threadActions = renderThreadActions?.(thread);\n const hasActions =\n replyAllowed ||\n resolveAllowed ||\n deleteAllowed ||\n Boolean(threadActions);\n return (\n <article\n key={thread.root.threadId}\n className={cn(\n \"group/thread px-3 py-3 transition-colors\",\n onSelectThread && \"cursor-pointer hover:bg-muted/30\",\n )}\n onClick={() => onSelectThread?.(thread)}\n >\n <CommentBubble\n comment={thread.root}\n resolvedLabel={resolvedLabel}\n reviewerLabel={reviewerLabel}\n formatDate={formatDate}\n />\n {thread.replies.length ? (\n <div className=\"ms-3 mt-3 flex flex-col gap-3 border-s border-border ps-3\">\n {thread.replies.map((reply) => (\n <CommentBubble\n key={reply.id}\n comment={reply}\n compact\n resolvedLabel={resolvedLabel}\n reviewerLabel={reviewerLabel}\n formatDate={formatDate}\n />\n ))}\n </div>\n ) : null}\n\n {replying && replyAllowed ? (\n <form\n className=\"mt-3 flex min-w-0 items-center gap-1.5\"\n onClick={(event) => event.stopPropagation()}\n onSubmit={(event) => {\n event.preventDefault();\n const body = replyDraft.trim();\n if (!body || replyComment.isPending) return;\n replyComment.mutate(\n {\n resourceType,\n resourceId,\n commentId: thread.root.id,\n body,\n },\n {\n onSuccess: () => {\n setReplyDrafts((current) => ({\n ...current,\n [thread.root.id]: \"\",\n }));\n setReplyingThreadId(null);\n },\n },\n );\n }}\n >\n <Input\n autoFocus\n value={replyDraft}\n onChange={(event) =>\n setReplyDrafts((current) => ({\n ...current,\n [thread.root.id]: event.currentTarget.value,\n }))\n }\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n setReplyingThreadId(null);\n }\n }}\n placeholder={replyPlaceholder}\n className=\"h-8 min-w-0 flex-1 text-sm\"\n />\n <Button\n type=\"submit\"\n size=\"icon\"\n variant=\"outline\"\n className=\"size-8 shrink-0\"\n disabled={!replyDraft.trim() || replyComment.isPending}\n aria-label={replyLabel}\n >\n {replyComment.isPending ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconSend className=\"size-3.5\" />\n )}\n </Button>\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-8 shrink-0\"\n aria-label={cancelReplyLabel}\n onClick={() => setReplyingThreadId(null)}\n >\n <IconX className=\"size-3.5\" />\n </Button>\n </form>\n ) : hasActions ? (\n <div\n className=\"mt-2.5 flex min-w-0 items-center gap-0.5\"\n onClick={(event) => event.stopPropagation()}\n >\n {replyAllowed ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 min-w-0 gap-1.5 px-1.5 text-xs @xs/review:px-2\"\n aria-label={replyLabel}\n onClick={() =>\n setReplyingThreadId(thread.root.threadId)\n }\n >\n <IconMessageCircle className=\"size-3.5\" />\n <span className=\"hidden @2xs/review:inline\">\n {replyLabel}\n </span>\n </Button>\n ) : null}\n <div className=\"ms-auto flex min-w-0 items-center gap-0.5\">\n {threadActions}\n {resolveAllowed ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 min-w-0 gap-1.5 px-1.5 text-xs @xs/review:px-2\"\n disabled={resolveThread.isPending}\n aria-label={resolveLabel}\n onClick={() =>\n resolveThread.mutate({\n resourceType,\n resourceId,\n threadId: thread.root.threadId,\n })\n }\n >\n {resolveThread.isPending ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconCircleCheck className=\"size-3.5\" />\n )}\n <span className=\"hidden @xs/review:inline\">\n {resolveLabel}\n </span>\n </Button>\n ) : null}\n {deleteAllowed ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-7 shrink-0\"\n aria-label={moreActionsLabel}\n >\n <IconDots className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-44\">\n <DropdownMenuItem\n disabled={deleteComment.isPending}\n className=\"text-destructive focus:text-destructive\"\n onSelect={() =>\n deleteComment.mutate({\n resourceType,\n resourceId,\n commentId: thread.root.id,\n })\n }\n >\n <IconTrash className=\"size-4\" />\n {deleteLabel}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n </div>\n ) : null}\n </article>\n );\n })\n ) : (\n <div className=\"px-4 py-8 text-center text-sm text-muted-foreground\">\n {emptyState}\n </div>\n )}\n </div>\n </section>\n );\n}\n\nexport function buildReviewThreads(comments: ReviewComment[]): ReviewThread[] {\n const roots: ReviewComment[] = [];\n const replies = new Map<string, ReviewComment[]>();\n\n for (const comment of comments) {\n if (!comment.parentCommentId || comment.parentCommentId === comment.id) {\n roots.push(comment);\n continue;\n }\n const list = replies.get(comment.threadId) ?? [];\n list.push(comment);\n replies.set(comment.threadId, list);\n }\n\n return roots.map((root) => ({\n root,\n replies: replies.get(root.threadId) ?? [],\n }));\n}\n\nfunction CommentBubble({\n comment,\n compact = false,\n resolvedLabel,\n reviewerLabel,\n formatDate,\n}: {\n comment: ReviewComment;\n compact?: boolean;\n resolvedLabel: string;\n reviewerLabel: string;\n formatDate: ReturnType<typeof useFormatters>[\"formatDate\"];\n}) {\n const author = comment.authorName ?? comment.authorEmail ?? reviewerLabel;\n const resolutionNote =\n comment.status === \"resolved\" ? getReviewResolutionNote(comment) : null;\n const bodyIsResolutionNote =\n resolutionNote !== null &&\n resolutionNote === comment.body.trim() &&\n isResolutionNoteMetadata(comment.metadata);\n return (\n <div className=\"flex min-w-0 items-start gap-2.5\">\n <Avatar className={compact ? \"size-5\" : \"size-7\"}>\n <AvatarFallback className=\"text-[10px] font-semibold text-muted-foreground\">\n {authorInitials(author)}\n </AvatarFallback>\n </Avatar>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate text-sm font-medium\">{author}</span>\n <time\n className=\"shrink-0 text-[11px] text-muted-foreground\"\n dateTime={comment.createdAt}\n >\n {formatCommentDate(comment.createdAt, formatDate)}\n </time>\n {comment.status === \"resolved\" ? (\n <span className=\"hidden shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground @xs/review:inline-flex\">\n {resolvedLabel}\n </span>\n ) : null}\n </div>\n {!bodyIsResolutionNote ? (\n <p\n className={cn(\n \"mt-1 whitespace-pre-wrap break-words text-foreground\",\n compact ? \"text-xs leading-5\" : \"text-sm leading-5\",\n )}\n >\n {comment.body}\n </p>\n ) : null}\n {resolutionNote ? (\n <div\n className=\"mt-1.5 flex min-w-0 items-start gap-1.5 rounded-md bg-muted/60 px-2 py-1.5 text-muted-foreground\"\n aria-label={resolvedLabel}\n >\n <IconCircleCheck className=\"mt-0.5 size-3.5 shrink-0\" />\n <p className=\"min-w-0 whitespace-pre-wrap break-words text-xs leading-4\">\n {resolutionNote}\n </p>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\nfunction capabilityAllowsThread(\n capability: ReviewThreadCapability,\n thread: ReviewThread,\n): boolean {\n return typeof capability === \"function\" ? capability(thread) : capability;\n}\n\nfunction capabilityAllowsComment(\n capability: ReviewCommentCapability,\n comment: ReviewComment,\n thread: ReviewThread,\n): boolean {\n return typeof capability === \"function\"\n ? capability(comment, thread)\n : capability;\n}\n\nfunction getReviewResolutionNote(comment: ReviewComment): string | null {\n const direct = comment.resolutionNote;\n const metadata = comment.metadata;\n const nestedResolution = metadata?.resolution;\n const nestedNote =\n isRecord(nestedResolution) && typeof nestedResolution.note === \"string\"\n ? nestedResolution.note\n : null;\n const metadataNote =\n typeof metadata?.resolutionNote === \"string\"\n ? metadata.resolutionNote\n : typeof metadata?.resolvedNote === \"string\"\n ? metadata.resolvedNote\n : isResolutionNoteMetadata(metadata) &&\n typeof metadata?.note === \"string\"\n ? metadata.note\n : isResolutionNoteMetadata(metadata)\n ? comment.body\n : null;\n const candidate =\n typeof direct === \"string\" ? direct : (metadataNote ?? nestedNote);\n const normalized = candidate?.trim();\n return normalized || null;\n}\n\nfunction isResolutionNoteMetadata(\n metadata: Record<string, unknown> | null,\n): boolean {\n const marker = metadata?.type ?? metadata?.kind;\n return (\n marker === \"resolution\" ||\n marker === \"resolution_note\" ||\n marker === \"resolution-note\"\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction authorInitials(value: string): string {\n const normalized = value.split(\"@\")[0]?.trim() ?? \"\";\n const parts = normalized.split(/[\\s._+-]+/).filter(Boolean);\n const initials = parts\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase())\n .join(\"\");\n return initials || \"R\";\n}\n\nfunction formatCommentDate(\n value: string,\n formatDate: ReturnType<typeof useFormatters>[\"formatDate\"],\n): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return value;\n const now = new Date();\n const sameDay =\n date.getFullYear() === now.getFullYear() &&\n date.getMonth() === now.getMonth() &&\n date.getDate() === now.getDate();\n if (sameDay) {\n return formatDate(date, { hour: \"numeric\", minute: \"2-digit\" });\n }\n if (date.getFullYear() === now.getFullYear()) {\n return formatDate(date, { month: \"short\", day: \"numeric\" });\n }\n return formatDate(date, {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n"]}
1
+ {"version":3,"file":"ReviewThreadPanel.js","sourceRoot":"","sources":["../../../src/client/review/ReviewThreadPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC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AClC,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;IACnC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7C,OAAO,UAAU,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,EAAE;QACtB,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Avatar, AvatarFallback } from \"@agent-native/toolkit/ui/avatar\";\nimport { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@agent-native/toolkit/ui/dropdown-menu\";\nimport { Input } from \"@agent-native/toolkit/ui/input\";\nimport { Skeleton } from \"@agent-native/toolkit/ui/skeleton\";\nimport { Spinner } from \"@agent-native/toolkit/ui/spinner\";\nimport {\n IconCircleCheck,\n IconDots,\n IconMessageCircle,\n IconSend,\n IconTrash,\n IconX,\n} from \"@tabler/icons-react\";\nimport { useMemo, useState, type ReactNode } from \"react\";\n\nimport type {\n ReviewComment,\n ReviewResolutionTarget,\n} from \"../../review/types.js\";\nimport { useFormatters } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport { ReviewCommentComposer } from \"./ReviewCommentComposer.js\";\nimport { ReviewStatusBadge } from \"./ReviewStatusBadge.js\";\nimport {\n useCreateReviewComment,\n useDeleteReviewComment,\n useReplyReviewComment,\n useResolveReviewThread,\n useReviewComments,\n} from \"./use-review.js\";\n\nexport interface ReviewThread {\n root: ReviewComment;\n replies: ReviewComment[];\n}\n\nexport type ReviewThreadCapability =\n | boolean\n | ((thread: ReviewThread) => boolean);\n\nexport type ReviewCommentCapability =\n | boolean\n | ((comment: ReviewComment, thread: ReviewThread) => boolean);\n\nexport interface ReviewThreadPanelProps {\n resourceType: string;\n resourceId: string;\n targetId?: string | null;\n /** Persist new comments against this target while targetId continues to filter the list. */\n composerTargetId?: string | null;\n /** Optional element/point anchor attached to new comments from the composer. */\n composerAnchor?: unknown | null;\n /** Host metadata attached to new comments from the composer. */\n composerMetadata?: Record<string, unknown>;\n /** Visible label describing the element currently targeted by the composer. */\n composerContextLabel?: string;\n title?: string;\n className?: string;\n includeResolved?: boolean;\n showComposer?: boolean;\n showHeader?: boolean;\n variant?: \"card\" | \"plain\";\n placeholder?: string;\n emptyState?: string;\n loadingLabel?: string;\n replyLabel?: string;\n replyPlaceholder?: string;\n cancelReplyLabel?: string;\n resolveLabel?: string;\n deleteLabel?: string;\n moreActionsLabel?: string;\n resolvedLabel?: string;\n reviewerLabel?: string;\n onSelectThread?: (thread: ReviewThread) => void;\n onCommentCreated?: (comment: ReviewComment) => void;\n /** Allow signed-in commenters to reply. Omitted capabilities fail closed. */\n canReply?: ReviewThreadCapability;\n /** Allow editors to resolve a thread. Omitted capabilities fail closed. */\n canResolve?: ReviewThreadCapability;\n /** Allow deletion only for comments the caller has authorized. */\n canDeleteComment?: ReviewCommentCapability;\n /** Extra per-thread controls rendered next to reply/resolve/delete. */\n renderThreadActions?: (thread: ReviewThread) => ReactNode;\n /** Show a separate agent-submit action when the host supports agent routing. */\n showComposerTargetPicker?: boolean;\n composerCommentLabel?: string;\n composerAgentLabel?: string;\n}\n\nexport function ReviewThreadPanel({\n resourceType,\n resourceId,\n targetId,\n composerTargetId,\n composerAnchor,\n composerMetadata,\n composerContextLabel,\n title = \"Review\",\n className,\n includeResolved = true,\n showComposer = true,\n showHeader = true,\n variant = \"card\",\n placeholder = \"Add a comment...\",\n emptyState = \"No review comments yet.\",\n loadingLabel = \"Loading comments\",\n replyLabel = \"Reply\",\n replyPlaceholder = \"Reply...\",\n cancelReplyLabel = \"Cancel reply\",\n resolveLabel = \"Resolve\",\n deleteLabel = \"Delete comment\",\n moreActionsLabel = \"More actions\",\n resolvedLabel = \"Resolved\",\n reviewerLabel = \"Reviewer\",\n onSelectThread,\n onCommentCreated,\n canReply = false,\n canResolve = false,\n canDeleteComment = false,\n renderThreadActions,\n showComposerTargetPicker = false,\n composerCommentLabel = \"Comment\",\n composerAgentLabel = \"Send to agent\",\n}: ReviewThreadPanelProps) {\n const [draft, setDraft] = useState(\"\");\n const [submittingTarget, setSubmittingTarget] =\n useState<ReviewResolutionTarget | null>(null);\n const [replyingThreadId, setReplyingThreadId] = useState<string | null>(null);\n const [replyDrafts, setReplyDrafts] = useState<Record<string, string>>({});\n const { formatDate } = useFormatters();\n const comments = useReviewComments({\n resourceType,\n resourceId,\n targetId,\n includeResolved,\n });\n const createComment = useCreateReviewComment();\n const replyComment = useReplyReviewComment();\n const resolveThread = useResolveReviewThread();\n const deleteComment = useDeleteReviewComment();\n const threads = useMemo(\n () => buildReviewThreads(comments.data?.comments ?? []),\n [comments.data?.comments],\n );\n\n const submitDraft = (resolutionTarget: ReviewResolutionTarget) => {\n const body = draft.trim();\n if (!body || createComment.isPending) return;\n setSubmittingTarget(resolutionTarget);\n createComment.mutate(\n {\n resourceType,\n resourceId,\n targetId: composerTargetId === undefined ? targetId : composerTargetId,\n ...(composerAnchor !== undefined ? { anchor: composerAnchor } : {}),\n ...(composerMetadata ? { metadata: composerMetadata } : {}),\n body,\n resolutionTarget: showComposerTargetPicker ? resolutionTarget : \"human\",\n },\n {\n onSuccess: (comment) => {\n setDraft(\"\");\n onCommentCreated?.(comment);\n },\n onSettled: () => setSubmittingTarget(null),\n },\n );\n };\n\n return (\n <section\n className={cn(\n \"@container/review overflow-hidden text-card-foreground\",\n variant === \"card\"\n ? \"rounded-lg border border-border bg-card\"\n : \"bg-transparent\",\n className,\n )}\n >\n {showHeader ? (\n <div className=\"flex items-center justify-between gap-3 border-b border-border px-3 py-2.5\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconMessageCircle className=\"size-4 shrink-0 text-muted-foreground\" />\n <h2 className=\"truncate text-sm font-medium\">{title}</h2>\n </div>\n <ReviewStatusBadge\n status={comments.data?.reviewStatus?.status}\n className=\"shrink-0\"\n />\n </div>\n ) : null}\n\n {showComposer ? (\n <ReviewCommentComposer\n className=\"border-b border-border px-3 py-3\"\n value={draft}\n onChange={setDraft}\n onSubmit={submitDraft}\n submittingTarget={submittingTarget}\n disabled={createComment.isPending}\n showAgentAction={showComposerTargetPicker}\n placeholder={placeholder}\n commentLabel={composerCommentLabel}\n agentLabel={composerAgentLabel}\n contextLabel={composerContextLabel}\n />\n ) : null}\n\n <div className=\"divide-y divide-border\">\n {comments.isLoading ? (\n <div\n className=\"flex flex-col gap-3 px-3 py-4\"\n aria-label={loadingLabel}\n >\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-7 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-2/5\" />\n <Skeleton className=\"h-3 w-4/5\" />\n </div>\n </div>\n <Skeleton className=\"h-8 w-full\" />\n </div>\n ) : threads.length ? (\n threads.map((thread) => {\n const replyDraft = replyDrafts[thread.root.id] ?? \"\";\n const replying = replyingThreadId === thread.root.threadId;\n const threadIsOpen = thread.root.status === \"open\";\n const replyAllowed =\n threadIsOpen && capabilityAllowsThread(canReply, thread);\n const resolveAllowed =\n threadIsOpen && capabilityAllowsThread(canResolve, thread);\n const deleteAllowed = capabilityAllowsComment(\n canDeleteComment,\n thread.root,\n thread,\n );\n const threadActions = renderThreadActions?.(thread);\n const hasActions =\n replyAllowed ||\n resolveAllowed ||\n deleteAllowed ||\n Boolean(threadActions);\n return (\n <article\n key={thread.root.threadId}\n className={cn(\n \"group/thread px-3 py-3 transition-colors\",\n onSelectThread && \"cursor-pointer hover:bg-muted/30\",\n )}\n onClick={() => onSelectThread?.(thread)}\n >\n <CommentBubble\n comment={thread.root}\n resolvedLabel={resolvedLabel}\n reviewerLabel={reviewerLabel}\n formatDate={formatDate}\n />\n {thread.replies.length ? (\n <div className=\"ms-3 mt-3 flex flex-col gap-3 border-s border-border ps-3\">\n {thread.replies.map((reply) => (\n <CommentBubble\n key={reply.id}\n comment={reply}\n compact\n resolvedLabel={resolvedLabel}\n reviewerLabel={reviewerLabel}\n formatDate={formatDate}\n />\n ))}\n </div>\n ) : null}\n\n {replying && replyAllowed ? (\n <form\n className=\"mt-3 flex min-w-0 items-center gap-1.5\"\n onClick={(event) => event.stopPropagation()}\n onSubmit={(event) => {\n event.preventDefault();\n const body = replyDraft.trim();\n if (!body || replyComment.isPending) return;\n replyComment.mutate(\n {\n resourceType,\n resourceId,\n commentId: thread.root.id,\n body,\n },\n {\n onSuccess: () => {\n setReplyDrafts((current) => ({\n ...current,\n [thread.root.id]: \"\",\n }));\n setReplyingThreadId(null);\n },\n },\n );\n }}\n >\n <Input\n autoFocus\n value={replyDraft}\n onChange={(event) =>\n setReplyDrafts((current) => ({\n ...current,\n [thread.root.id]: event.currentTarget.value,\n }))\n }\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n setReplyingThreadId(null);\n }\n }}\n placeholder={replyPlaceholder}\n className=\"h-8 min-w-0 flex-1 text-sm\"\n />\n <Button\n type=\"submit\"\n size=\"icon\"\n variant=\"outline\"\n className=\"size-8 shrink-0\"\n disabled={!replyDraft.trim() || replyComment.isPending}\n aria-label={replyLabel}\n >\n {replyComment.isPending ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconSend className=\"size-3.5\" />\n )}\n </Button>\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-8 shrink-0\"\n aria-label={cancelReplyLabel}\n onClick={() => setReplyingThreadId(null)}\n >\n <IconX className=\"size-3.5\" />\n </Button>\n </form>\n ) : hasActions ? (\n <div\n className=\"mt-2.5 flex min-w-0 items-center gap-0.5\"\n onClick={(event) => event.stopPropagation()}\n >\n {replyAllowed ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 min-w-0 gap-1.5 px-1.5 text-xs @xs/review:px-2\"\n aria-label={replyLabel}\n onClick={() =>\n setReplyingThreadId(thread.root.threadId)\n }\n >\n <IconMessageCircle className=\"size-3.5\" />\n <span className=\"hidden @2xs/review:inline\">\n {replyLabel}\n </span>\n </Button>\n ) : null}\n <div className=\"ms-auto flex min-w-0 items-center gap-0.5\">\n {threadActions}\n {resolveAllowed ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 min-w-0 gap-1.5 px-1.5 text-xs @xs/review:px-2\"\n disabled={resolveThread.isPending}\n aria-label={resolveLabel}\n onClick={() =>\n resolveThread.mutate({\n resourceType,\n resourceId,\n threadId: thread.root.threadId,\n })\n }\n >\n {resolveThread.isPending ? (\n <Spinner className=\"size-3.5\" />\n ) : (\n <IconCircleCheck className=\"size-3.5\" />\n )}\n <span className=\"hidden @xs/review:inline\">\n {resolveLabel}\n </span>\n </Button>\n ) : null}\n {deleteAllowed ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-7 shrink-0\"\n aria-label={moreActionsLabel}\n >\n <IconDots className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-44\">\n <DropdownMenuItem\n disabled={deleteComment.isPending}\n className=\"text-destructive focus:text-destructive\"\n onSelect={() =>\n deleteComment.mutate({\n resourceType,\n resourceId,\n commentId: thread.root.id,\n })\n }\n >\n <IconTrash className=\"size-4\" />\n {deleteLabel}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n </div>\n ) : null}\n </article>\n );\n })\n ) : (\n <div className=\"px-4 py-8 text-center text-sm text-muted-foreground\">\n {emptyState}\n </div>\n )}\n </div>\n </section>\n );\n}\n\nexport function buildReviewThreads(comments: ReviewComment[]): ReviewThread[] {\n const roots: ReviewComment[] = [];\n const replies = new Map<string, ReviewComment[]>();\n\n for (const comment of comments) {\n if (!comment.parentCommentId || comment.parentCommentId === comment.id) {\n roots.push(comment);\n continue;\n }\n const list = replies.get(comment.threadId) ?? [];\n list.push(comment);\n replies.set(comment.threadId, list);\n }\n\n return roots.map((root) => ({\n root,\n replies: replies.get(root.threadId) ?? [],\n }));\n}\n\nfunction CommentBubble({\n comment,\n compact = false,\n resolvedLabel,\n reviewerLabel,\n formatDate,\n}: {\n comment: ReviewComment;\n compact?: boolean;\n resolvedLabel: string;\n reviewerLabel: string;\n formatDate: ReturnType<typeof useFormatters>[\"formatDate\"];\n}) {\n const author = comment.authorName ?? comment.authorEmail ?? reviewerLabel;\n const resolutionNote =\n comment.status === \"resolved\" ? getReviewResolutionNote(comment) : null;\n const bodyIsResolutionNote =\n resolutionNote !== null &&\n resolutionNote === comment.body.trim() &&\n isResolutionNoteMetadata(comment.metadata);\n return (\n <div className=\"flex min-w-0 items-start gap-2.5\">\n <Avatar className={compact ? \"size-5\" : \"size-7\"}>\n <AvatarFallback className=\"text-[10px] font-semibold text-muted-foreground\">\n {authorInitials(author)}\n </AvatarFallback>\n </Avatar>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate text-sm font-medium\">{author}</span>\n <time\n className=\"shrink-0 text-[11px] text-muted-foreground\"\n dateTime={comment.createdAt}\n >\n {formatCommentDate(comment.createdAt, formatDate)}\n </time>\n {comment.status === \"resolved\" ? (\n <span className=\"hidden shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground @xs/review:inline-flex\">\n {resolvedLabel}\n </span>\n ) : null}\n </div>\n {!bodyIsResolutionNote ? (\n <p\n className={cn(\n \"mt-1 whitespace-pre-wrap break-words text-foreground\",\n compact ? \"text-xs leading-5\" : \"text-sm leading-5\",\n )}\n >\n {comment.body}\n </p>\n ) : null}\n {resolutionNote ? (\n <div\n className=\"mt-1.5 flex min-w-0 items-start gap-1.5 rounded-md bg-muted/60 px-2 py-1.5 text-muted-foreground\"\n aria-label={resolvedLabel}\n >\n <IconCircleCheck className=\"mt-0.5 size-3.5 shrink-0\" />\n <p className=\"min-w-0 whitespace-pre-wrap break-words text-xs leading-4\">\n {resolutionNote}\n </p>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\nfunction capabilityAllowsThread(\n capability: ReviewThreadCapability,\n thread: ReviewThread,\n): boolean {\n return typeof capability === \"function\" ? capability(thread) : capability;\n}\n\nfunction capabilityAllowsComment(\n capability: ReviewCommentCapability,\n comment: ReviewComment,\n thread: ReviewThread,\n): boolean {\n return typeof capability === \"function\"\n ? capability(comment, thread)\n : capability;\n}\n\nfunction getReviewResolutionNote(comment: ReviewComment): string | null {\n const direct = comment.resolutionNote;\n const metadata = comment.metadata;\n const nestedResolution = metadata?.resolution;\n const nestedNote =\n isRecord(nestedResolution) && typeof nestedResolution.note === \"string\"\n ? nestedResolution.note\n : null;\n const metadataNote =\n typeof metadata?.resolutionNote === \"string\"\n ? metadata.resolutionNote\n : typeof metadata?.resolvedNote === \"string\"\n ? metadata.resolvedNote\n : isResolutionNoteMetadata(metadata) &&\n typeof metadata?.note === \"string\"\n ? metadata.note\n : isResolutionNoteMetadata(metadata)\n ? comment.body\n : null;\n const candidate =\n typeof direct === \"string\" ? direct : (metadataNote ?? nestedNote);\n const normalized = candidate?.trim();\n return normalized || null;\n}\n\nfunction isResolutionNoteMetadata(\n metadata: Record<string, unknown> | null,\n): boolean {\n const marker = metadata?.type ?? metadata?.kind;\n return (\n marker === \"resolution\" ||\n marker === \"resolution_note\" ||\n marker === \"resolution-note\"\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction authorInitials(value: string): string {\n const normalized = value.split(\"@\")[0]?.trim() ?? \"\";\n const parts = normalized.split(/[\\s._+-]+/).filter(Boolean);\n const initials = parts\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase())\n .join(\"\");\n return initials || \"R\";\n}\n\nfunction formatCommentDate(\n value: string,\n formatDate: ReturnType<typeof useFormatters>[\"formatDate\"],\n): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return value;\n const now = new Date();\n const sameDay =\n date.getFullYear() === now.getFullYear() &&\n date.getMonth() === now.getMonth() &&\n date.getDate() === now.getDate();\n if (sameDay) {\n return formatDate(date, { hour: \"numeric\", minute: \"2-digit\" });\n }\n if (date.getFullYear() === now.getFullYear()) {\n return formatDate(date, { month: \"short\", day: \"numeric\" });\n }\n return formatDate(date, {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n"]}
@@ -18,5 +18,8 @@ export interface SettingsPanelProps {
18
18
  sectionRequestKey?: number;
19
19
  }
20
20
  export declare function SettingsPanel(props: SettingsPanelProps): React.JSX.Element;
21
+ export declare function ConnectionsSettingsContent({ settingsPanelProps, }: {
22
+ settingsPanelProps: SettingsPanelProps;
23
+ }): React.JSX.Element;
21
24
  export declare function useAgentSettingsTabs(): SettingsTabItem[];
22
25
  //# sourceMappingURL=SettingsPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAQN,MAAM,OAAO,CAAC;AAoCf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwoB7D,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB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B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAqvBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAEtD;AAED,wBAAgB,0BAA0B,CAAC,EACzC,kBAAkB,GACnB,EAAE;IACD,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,qBAcA;AAED,wBAAgB,oBAAoB,IAAI,eAAe,EAAE,CAyExD"}
@@ -8,6 +8,7 @@ import { agentNativePath } from "../api-path.js";
8
8
  import { BuilderBMark } from "../builder-mark.js";
9
9
  import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
10
10
  import { TeamPage } from "../org/TeamPage.js";
11
+ import { BuilderConnectCard } from "../setup-connections/BuilderConnectCard.js";
11
12
  import { callAction } from "../use-action.js";
12
13
  import { uploadAvatar, useAvatarUrl } from "../use-avatar.js";
13
14
  import { useDevMode } from "../use-dev-mode.js";
@@ -987,8 +988,10 @@ function AccountSectionInner({ open, onToggle, }) {
987
988
  };
988
989
  return (_jsx(SettingsSection, { id: settingsSectionDomId("account"), icon: _jsx(IconUserCircle, { size: 14 }), title: "Account", subtitle: "Your profile photo and signed-in identity.", open: open, onToggle: onToggle, children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: cn("flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-accent font-semibold text-muted-foreground", isPage ? "h-14 w-14 text-[15px]" : "h-12 w-12 text-[13px]"), children: avatarUrl ? (_jsx("img", { src: avatarUrl, alt: "", className: "h-full w-full object-cover" })) : (initials) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: cn("truncate font-medium text-foreground", isPage ? "text-sm" : "text-[12px]"), children: isLoading ? "Loading..." : displayName }), email && (_jsx("p", { className: cn("truncate text-muted-foreground", subTextClass(isPage)), children: email })), status === "saved" && (_jsx("p", { className: cn("mt-1 text-green-600 dark:text-green-400", subTextClass(isPage)), children: "Photo updated" })), status === "error" && (_jsx("p", { className: cn("mt-1 text-destructive", subTextClass(isPage)), children: "Could not update photo" }))] }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleAvatarChange }), _jsx("button", { type: "button", disabled: !email || uploading, onClick: () => fileInputRef.current?.click(), className: cn(pillButtonClass(isPage, "outline"), "shrink-0 justify-center"), children: uploading ? "Uploading..." : "Change photo" })] }) }));
989
990
  }
990
- function SettingsPanelContent({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, initialSection, sectionRequestKey, sections = ALL_SETTINGS_SECTIONS, showCapabilityStrip = true, className, surface = "sidebar", }) {
991
- const { status: builder, loading: builderLoading } = useBuilderStatus();
991
+ function SettingsPanelContent({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, initialSection, sectionRequestKey, sections = ALL_SETTINGS_SECTIONS, showCapabilityStrip = true, className, surface = "sidebar", builderConnectionOwnedExternally = false, }) {
992
+ const { status: builder, loading: builderLoading } = useBuilderStatus({
993
+ enabled: !builderConnectionOwnedExternally,
994
+ });
992
995
  const connected = builder?.configured ?? false;
993
996
  const connectUrl = builder?.cliAuthUrl ?? builder?.connectUrl;
994
997
  const orgName = builder?.orgName;
@@ -996,6 +999,7 @@ function SettingsPanelContent({ isDevMode, onToggleDevMode, showDevToggle, devAp
996
999
  const credentialSource = builder?.credentialSource;
997
1000
  const builderBranchesAvailable = !!builder?.builderEnabled;
998
1001
  const builderFlow = useBuilderConnectFlow({
1002
+ enabled: !builderConnectionOwnedExternally,
999
1003
  popupUrl: connectUrl,
1000
1004
  trackingSource: "settings_panel_builder_card",
1001
1005
  });
@@ -1066,11 +1070,14 @@ function SettingsPanelContent({ isDevMode, onToggleDevMode, showDevToggle, devAp
1066
1070
  const nextIsDev = next === "development";
1067
1071
  if (nextIsDev !== isDevMode)
1068
1072
  onToggleDevMode();
1069
- } })) })), showCapabilityStrip && (_jsx(CapabilityStatusStrip, { isDevMode: isDevMode, builderConnected: connected, builderLoading: builderLoading, builderBranchesAvailable: builderBranchesAvailable, onOpenLlm: () => openSettingsSection("llm", true) })), shouldShowSection("account") && (_jsx(AccountSectionInner, { open: openSection === "account", onToggle: () => toggle("account") })), shouldShowSection("llm") && (_jsx(LLMSectionInner, { builderFlow: builderFlow, builderLoading: builderLoading, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, open: openSection === "llm", onToggle: () => toggle("llm") })), shouldShowSection("app-models") && (_jsx(AppModelDefaultsSectionInner, { open: openSection === "app-models", onToggle: () => toggle("app-models") })), shouldShowSection("limits") && (_jsx(AgentLimitsSectionInner, { open: openSection === "limits", onToggle: () => toggle("limits") })), shouldShowSection("voice") && (_jsx(SettingsSection, { id: settingsSectionDomId("voice"), icon: _jsx(IconMicrophone, { size: 14 }), title: "Voice Transcription", subtitle: "How the composer microphone turns your voice into text.", open: openSection === "voice", onToggle: () => toggle("voice"), children: _jsx(VoiceTranscriptionSection, {}) })), shouldShowSection("demo-mode") && (_jsx(SettingsSection, { id: settingsSectionDomId("demo-mode"), icon: _jsx(IconEyeOff, { size: 14 }), title: "Demo mode", subtitle: "Replace displayed emails with realistic fake data in this browser and reshape supported charts for presentations. Backend, MCP, and agent results stay real and access-scoped.", open: openSection === "demo-mode", onToggle: () => toggle("demo-mode"), children: _jsx(DemoModeSection, {}) })), shouldShowSection("automations") && (_jsx(SettingsSection, { id: settingsSectionDomId("automations"), icon: _jsx(IconBolt, { size: 14 }), title: "Automations", subtitle: "Event-triggered and scheduled automations.", open: openSection === "automations", onToggle: () => toggle("automations"), children: _jsx(AutomationsSection, {}) })), shouldShowSection("secrets") && (_jsx(SettingsSection, { id: settingsSectionDomId("secrets"), icon: _jsx(IconKey, { size: 14 }), title: "API Keys & Connections", subtitle: "Service credentials and automation keys.", open: openSection === "secrets", onToggle: () => toggle("secrets"), children: _jsx(SecretsSection, { focusKey: focusSecretKey }) })), shouldShowSection("hosting") && (_jsx(SettingsSection, { id: settingsSectionDomId("hosting"), icon: _jsx(IconCloud, { size: 14 }), title: "Hosting", subtitle: "Deploy your app to the cloud.", connected: connected, open: openSection === "hosting", onToggle: () => toggle("hosting"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "hosting_settings", trackingFlow: "hosting" }), _jsx(ManualSetupCard, { hint: "Deploy manually to Netlify, Vercel, Cloudflare, or any Nitro-supported target.", docsUrl: "https://www.builder.io/c/docs/agent-native-deployment", dim: connected })] }) })), shouldShowSection("database") && (_jsx(SettingsSection, { id: settingsSectionDomId("database"), icon: _jsx(IconDatabase, { size: 14 }), title: "Database", subtitle: "Connect a cloud database for persistent storage.", connected: connected, open: openSection === "database", onToggle: () => toggle("database"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "database_settings", trackingFlow: "database" }), _jsx(ManualSetupCard, { hint: "Set DATABASE_URL in your .env to connect Neon, Supabase, Turso, any Postgres/SQLite database, or local PGlite with pglite:./data/pglite.", docsUrl: "https://www.builder.io/c/docs/agent-native-database", dim: connected })] }) })), shouldShowSection("uploads") && (_jsx(SettingsSection, { id: settingsSectionDomId("uploads"), icon: _jsx(IconUpload, { size: 14 }), title: "File uploads", subtitle: "Where user-uploaded files (avatars, chat attachments) are stored.", connected: connected, open: openSection === "uploads", onToggle: () => toggle("uploads"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "file_upload_settings", trackingFlow: "file_upload" }), _jsx(ManualSetupCard, { hint: "Without a provider, files are stored as base64 in your database. Fine for dev, not recommended for production.", docsUrl: "https://www.builder.io/c/docs/agent-native-file-uploads", dim: connected })] }) })), shouldShowSection("auth") && (_jsx(SettingsSection, { id: settingsSectionDomId("auth"), icon: _jsx(IconShield, { size: 14 }), title: "Authentication", subtitle: "Set up user authentication and access control.", connected: connected, open: openSection === "auth", onToggle: () => toggle("auth"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "auth_settings", trackingFlow: "auth" }), _jsx(ManualSetupCard, { hint: "Configure Better Auth with BETTER_AUTH_SECRET and optional Google/GitHub OAuth providers.", docsUrl: "https://www.builder.io/c/docs/agent-native-authentication", dim: connected })] }) })), shouldShowSection("email") && (_jsx(EmailSectionInner, { open: openSection === "email", onToggle: () => toggle("email") })), shouldShowSection("browser") && (_jsx(SettingsSection, { id: settingsSectionDomId("browser"), icon: _jsx(IconBrowser, { size: 14 }), title: "Browser Automation", subtitle: "Let agents control a real browser for web tasks.", connected: connected, open: openSection === "browser", onToggle: () => toggle("browser"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "browser_settings", trackingFlow: "browser_automation" }) })), builderBranchesAvailable && shouldShowSection("background") && (_jsx(SettingsSection, { id: settingsSectionDomId("background"), icon: _jsx(IconGitBranch, { size: 14 }), title: "Background Agent", subtitle: "Make code changes from production mode via Builder.", connected: connected, open: openSection === "background", onToggle: () => toggle("background"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "background_agent_settings", trackingFlow: "background_agent" }) })), shouldShowSection("integrations") && (_jsx(SettingsSection, { id: settingsSectionDomId("integrations"), icon: _jsx(IconPlugConnected, { size: 14 }), title: "Integrations", subtitle: "Connect messaging platforms and external services.", open: openSection === "integrations", onToggle: () => toggle("integrations"), children: _jsx(Suspense, { fallback: null, children: _jsx(IntegrationsPanel, {}) }) })), shouldShowSection("usage") && (_jsx(SettingsSection, { id: settingsSectionDomId("usage"), icon: _jsx(IconCoin, { size: 14 }), title: "Usage", subtitle: "Track token consumption and estimated cost \u2014 broken down by chat, automations, and background jobs.", open: openSection === "usage", onToggle: () => toggle("usage"), children: _jsx(UsageSection, {}) })), shouldShowSection("a2a") && (_jsx(SettingsSection, { id: settingsSectionDomId("a2a"), icon: _jsx(IconTopologyRing2, { size: 14 }), title: "Connected Agents (A2A)", subtitle: "Manage remote agents connected via the A2A protocol.", open: openSection === "a2a", onToggle: () => toggle("a2a"), children: _jsx(AgentsSection, {}) }))] }) }));
1073
+ } })) })), showCapabilityStrip && (_jsx(CapabilityStatusStrip, { isDevMode: isDevMode, builderConnected: connected, builderLoading: builderLoading, builderBranchesAvailable: builderBranchesAvailable, onOpenLlm: () => openSettingsSection("llm", true) })), shouldShowSection("account") && (_jsx(AccountSectionInner, { open: openSection === "account", onToggle: () => toggle("account") })), shouldShowSection("llm") && (_jsx(LLMSectionInner, { builderFlow: builderFlow, builderLoading: builderLoading, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, open: openSection === "llm", onToggle: () => toggle("llm") })), shouldShowSection("app-models") && (_jsx(AppModelDefaultsSectionInner, { open: openSection === "app-models", onToggle: () => toggle("app-models") })), shouldShowSection("limits") && (_jsx(AgentLimitsSectionInner, { open: openSection === "limits", onToggle: () => toggle("limits") })), shouldShowSection("voice") && (_jsx(SettingsSection, { id: settingsSectionDomId("voice"), icon: _jsx(IconMicrophone, { size: 14 }), title: "Voice Transcription", subtitle: "How the composer microphone turns your voice into text.", open: openSection === "voice", onToggle: () => toggle("voice"), children: _jsx(VoiceTranscriptionSection, {}) })), shouldShowSection("demo-mode") && (_jsx(SettingsSection, { id: settingsSectionDomId("demo-mode"), icon: _jsx(IconEyeOff, { size: 14 }), title: "Demo mode", subtitle: "Replace displayed emails with realistic fake data in this browser and reshape supported charts for presentations. Backend, MCP, and agent results stay real and access-scoped.", open: openSection === "demo-mode", onToggle: () => toggle("demo-mode"), children: _jsx(DemoModeSection, {}) })), shouldShowSection("automations") && (_jsx(SettingsSection, { id: settingsSectionDomId("automations"), icon: _jsx(IconBolt, { size: 14 }), title: "Automations", subtitle: "Event-triggered and scheduled automations.", open: openSection === "automations", onToggle: () => toggle("automations"), children: _jsx(AutomationsSection, {}) })), shouldShowSection("secrets") && (_jsx(SettingsSection, { id: settingsSectionDomId("secrets"), icon: _jsx(IconKey, { size: 14 }), title: "API Keys & Connections", subtitle: "Service credentials and automation keys.", open: openSection === "secrets", onToggle: () => toggle("secrets"), children: _jsx(SecretsSection, { focusKey: focusSecretKey }) })), shouldShowSection("hosting") && (_jsx(SettingsSection, { id: settingsSectionDomId("hosting"), icon: _jsx(IconCloud, { size: 14 }), title: "Hosting", subtitle: "Deploy your app to the cloud.", connected: connected, open: openSection === "hosting", onToggle: () => toggle("hosting"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "hosting_settings", trackingFlow: "hosting" }), _jsx(ManualSetupCard, { hint: "Deploy manually to Netlify, Vercel, Cloudflare, or any Nitro-supported target.", docsUrl: "https://www.builder.io/c/docs/agent-native-deployment", dim: connected })] }) })), shouldShowSection("database") && (_jsx(SettingsSection, { id: settingsSectionDomId("database"), icon: _jsx(IconDatabase, { size: 14 }), title: "Database", subtitle: "Connect a cloud database for persistent storage.", connected: connected, open: openSection === "database", onToggle: () => toggle("database"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "database_settings", trackingFlow: "database" }), _jsx(ManualSetupCard, { hint: "Set DATABASE_URL in your .env to connect Neon, Supabase, Turso, any Postgres/SQLite database, or local PGlite with pglite:./data/pglite.", docsUrl: "https://www.builder.io/c/docs/agent-native-database", dim: connected })] }) })), shouldShowSection("uploads") && (_jsx(SettingsSection, { id: settingsSectionDomId("uploads"), icon: _jsx(IconUpload, { size: 14 }), title: "File uploads", subtitle: "Where user-uploaded files (avatars, chat attachments) are stored.", connected: connected, open: openSection === "uploads", onToggle: () => toggle("uploads"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "file_upload_settings", trackingFlow: "file_upload" }), _jsx(ManualSetupCard, { hint: "Without a provider, files are stored as base64 in your database. Fine for dev, not recommended for production.", docsUrl: "https://www.builder.io/c/docs/agent-native-file-uploads", dim: connected })] }) })), shouldShowSection("auth") && (_jsx(SettingsSection, { id: settingsSectionDomId("auth"), icon: _jsx(IconShield, { size: 14 }), title: "Authentication", subtitle: "Set up user authentication and access control.", connected: connected, open: openSection === "auth", onToggle: () => toggle("auth"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "auth_settings", trackingFlow: "auth" }), _jsx(ManualSetupCard, { hint: "Configure Better Auth with BETTER_AUTH_SECRET and optional Google/GitHub OAuth providers.", docsUrl: "https://www.builder.io/c/docs/agent-native-authentication", dim: connected })] }) })), shouldShowSection("email") && (_jsx(EmailSectionInner, { open: openSection === "email", onToggle: () => toggle("email") })), shouldShowSection("browser") && (_jsx(SettingsSection, { id: settingsSectionDomId("browser"), icon: _jsx(IconBrowser, { size: 14 }), title: "Browser Automation", subtitle: "Let agents control a real browser for web tasks.", connected: builderConnectionOwnedExternally ? undefined : connected, open: openSection === "browser", onToggle: () => toggle("browser"), children: !builderConnectionOwnedExternally ? (_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "browser_settings", trackingFlow: "browser_automation" })) : null })), builderBranchesAvailable && shouldShowSection("background") && (_jsx(SettingsSection, { id: settingsSectionDomId("background"), icon: _jsx(IconGitBranch, { size: 14 }), title: "Background Agent", subtitle: "Make code changes from production mode via Builder.", connected: connected, open: openSection === "background", onToggle: () => toggle("background"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, trackingSource: "background_agent_settings", trackingFlow: "background_agent" }) })), shouldShowSection("integrations") && (_jsx(SettingsSection, { id: settingsSectionDomId("integrations"), icon: _jsx(IconPlugConnected, { size: 14 }), title: "Integrations", subtitle: "Connect messaging platforms and external services.", open: openSection === "integrations", onToggle: () => toggle("integrations"), children: _jsx(Suspense, { fallback: null, children: _jsx(IntegrationsPanel, {}) }) })), shouldShowSection("usage") && (_jsx(SettingsSection, { id: settingsSectionDomId("usage"), icon: _jsx(IconCoin, { size: 14 }), title: "Usage", subtitle: "Track token consumption and estimated cost \u2014 broken down by chat, automations, and background jobs.", open: openSection === "usage", onToggle: () => toggle("usage"), children: _jsx(UsageSection, {}) })), shouldShowSection("a2a") && (_jsx(SettingsSection, { id: settingsSectionDomId("a2a"), icon: _jsx(IconTopologyRing2, { size: 14 }), title: "Connected Agents (A2A)", subtitle: "Manage remote agents connected via the A2A protocol.", open: openSection === "a2a", onToggle: () => toggle("a2a"), children: _jsx(AgentsSection, {}) }))] }) }));
1070
1074
  }
1071
1075
  export function SettingsPanel(props) {
1072
1076
  return _jsx(SettingsPanelContent, { ...props });
1073
1077
  }
1078
+ export function ConnectionsSettingsContent({ settingsPanelProps, }) {
1079
+ return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-4", children: [_jsx(BuilderConnectCard, { trackingSource: "settings_connections" }), _jsx(SettingsPanelContent, { ...settingsPanelProps, surface: "page", sections: CONNECTION_SETTINGS_SECTIONS, showCapabilityStrip: false, className: "w-full", builderConnectionOwnedExternally: true })] }));
1080
+ }
1074
1081
  export function useAgentSettingsTabs() {
1075
1082
  const { isDevMode, canToggle, setDevMode } = useDevMode();
1076
1083
  const baseProps = useMemo(() => ({
@@ -1103,7 +1110,7 @@ export function useAgentSettingsTabs() {
1103
1110
  ...connections,
1104
1111
  icon: IconPlugConnected,
1105
1112
  group: "agent",
1106
- content: (_jsx(SettingsPanelContent, { ...baseProps, surface: "page", sections: CONNECTION_SETTINGS_SECTIONS, showCapabilityStrip: false, className: "mx-auto w-full max-w-2xl" })),
1113
+ content: _jsx(ConnectionsSettingsContent, { settingsPanelProps: baseProps }),
1107
1114
  },
1108
1115
  {
1109
1116
  ...organization,