@agent-native/dispatch 0.24.0 → 0.24.3

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 (165) hide show
  1. package/dist/actions/provider-api-register.d.ts +12 -12
  2. package/dist/components/admin-navigation.d.ts.map +1 -1
  3. package/dist/components/admin-navigation.js +21 -5
  4. package/dist/components/admin-navigation.js.map +1 -1
  5. package/dist/components/agents-panel.d.ts.map +1 -1
  6. package/dist/components/agents-panel.js +7 -2
  7. package/dist/components/agents-panel.js.map +1 -1
  8. package/dist/components/app-list-row.d.ts +1 -1
  9. package/dist/components/app-list-row.d.ts.map +1 -1
  10. package/dist/components/app-list-row.js +1 -1
  11. package/dist/components/app-list-row.js.map +1 -1
  12. package/dist/components/app-open-actions.d.ts +1 -17
  13. package/dist/components/app-open-actions.d.ts.map +1 -1
  14. package/dist/components/app-open-actions.js +1 -20
  15. package/dist/components/app-open-actions.js.map +1 -1
  16. package/dist/components/app-row-settings.d.ts +6 -0
  17. package/dist/components/app-row-settings.d.ts.map +1 -0
  18. package/dist/components/app-row-settings.js +11 -0
  19. package/dist/components/app-row-settings.js.map +1 -0
  20. package/dist/components/automation-run-history-dialog.d.ts.map +1 -1
  21. package/dist/components/automation-run-history-dialog.js +3 -2
  22. package/dist/components/automation-run-history-dialog.js.map +1 -1
  23. package/dist/components/connected-app-card.d.ts.map +1 -1
  24. package/dist/components/connected-app-card.js +1 -1
  25. package/dist/components/connected-app-card.js.map +1 -1
  26. package/dist/components/create-app-popover.js +2 -2
  27. package/dist/components/create-app-popover.js.map +1 -1
  28. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  29. package/dist/components/dispatch-control-plane.js +23 -7
  30. package/dist/components/dispatch-control-plane.js.map +1 -1
  31. package/dist/components/dispatch-shell.d.ts.map +1 -1
  32. package/dist/components/dispatch-shell.js +5 -1
  33. package/dist/components/dispatch-shell.js.map +1 -1
  34. package/dist/components/docs-link.d.ts +16 -0
  35. package/dist/components/docs-link.d.ts.map +1 -0
  36. package/dist/components/docs-link.js +34 -0
  37. package/dist/components/docs-link.js.map +1 -0
  38. package/dist/components/layout/Layout.d.ts +1 -0
  39. package/dist/components/layout/Layout.d.ts.map +1 -1
  40. package/dist/components/layout/Layout.js +37 -28
  41. package/dist/components/layout/Layout.js.map +1 -1
  42. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  43. package/dist/components/messaging-setup-panel.js +3 -2
  44. package/dist/components/messaging-setup-panel.js.map +1 -1
  45. package/dist/components/usage-alerts-panel.d.ts +11 -0
  46. package/dist/components/usage-alerts-panel.d.ts.map +1 -0
  47. package/dist/components/usage-alerts-panel.js +125 -0
  48. package/dist/components/usage-alerts-panel.js.map +1 -0
  49. package/dist/components/workspace-app-card.d.ts +3 -1
  50. package/dist/components/workspace-app-card.d.ts.map +1 -1
  51. package/dist/components/workspace-app-card.js +70 -29
  52. package/dist/components/workspace-app-card.js.map +1 -1
  53. package/dist/components/workspace-app-search.d.ts +10 -0
  54. package/dist/components/workspace-app-search.d.ts.map +1 -0
  55. package/dist/components/workspace-app-search.js +27 -0
  56. package/dist/components/workspace-app-search.js.map +1 -0
  57. package/dist/components/workspace-resource-effective-stack.d.ts.map +1 -1
  58. package/dist/components/workspace-resource-effective-stack.js +3 -2
  59. package/dist/components/workspace-resource-effective-stack.js.map +1 -1
  60. package/dist/components/workspace-template-card.d.ts.map +1 -1
  61. package/dist/components/workspace-template-card.js +2 -1
  62. package/dist/components/workspace-template-card.js.map +1 -1
  63. package/dist/lib/workspace-app-layout.d.ts +19 -0
  64. package/dist/lib/workspace-app-layout.d.ts.map +1 -0
  65. package/dist/lib/workspace-app-layout.js +75 -0
  66. package/dist/lib/workspace-app-layout.js.map +1 -0
  67. package/dist/lib/workspace-apps.d.ts +10 -0
  68. package/dist/lib/workspace-apps.d.ts.map +1 -1
  69. package/dist/lib/workspace-apps.js +59 -0
  70. package/dist/lib/workspace-apps.js.map +1 -1
  71. package/dist/lib/workspace-apps.test.js +18 -1
  72. package/dist/lib/workspace-apps.test.js.map +1 -1
  73. package/dist/routes/pages/$appId.d.ts.map +1 -1
  74. package/dist/routes/pages/$appId.js +4 -2
  75. package/dist/routes/pages/$appId.js.map +1 -1
  76. package/dist/routes/pages/agents.d.ts.map +1 -1
  77. package/dist/routes/pages/agents.js +2 -3
  78. package/dist/routes/pages/agents.js.map +1 -1
  79. package/dist/routes/pages/apps.$appId.d.ts.map +1 -1
  80. package/dist/routes/pages/apps.$appId.js +8 -3
  81. package/dist/routes/pages/apps.$appId.js.map +1 -1
  82. package/dist/routes/pages/apps.d.ts.map +1 -1
  83. package/dist/routes/pages/apps.js +31 -16
  84. package/dist/routes/pages/apps.js.map +1 -1
  85. package/dist/routes/pages/audit.d.ts.map +1 -1
  86. package/dist/routes/pages/audit.js +2 -1
  87. package/dist/routes/pages/audit.js.map +1 -1
  88. package/dist/routes/pages/dreams.d.ts.map +1 -1
  89. package/dist/routes/pages/dreams.js +14 -18
  90. package/dist/routes/pages/dreams.js.map +1 -1
  91. package/dist/routes/pages/integrations.d.ts.map +1 -1
  92. package/dist/routes/pages/integrations.js +51 -14
  93. package/dist/routes/pages/integrations.js.map +1 -1
  94. package/dist/routes/pages/metrics.d.ts.map +1 -1
  95. package/dist/routes/pages/metrics.js +4 -1
  96. package/dist/routes/pages/metrics.js.map +1 -1
  97. package/dist/routes/pages/operations.js +1 -1
  98. package/dist/routes/pages/operations.js.map +1 -1
  99. package/dist/routes/pages/settings.d.ts.map +1 -1
  100. package/dist/routes/pages/settings.js +7 -2
  101. package/dist/routes/pages/settings.js.map +1 -1
  102. package/dist/routes/pages/thread-debug.d.ts.map +1 -1
  103. package/dist/routes/pages/thread-debug.js +5 -8
  104. package/dist/routes/pages/thread-debug.js.map +1 -1
  105. package/dist/routes/pages/vault.d.ts.map +1 -1
  106. package/dist/routes/pages/vault.js +1 -1
  107. package/dist/routes/pages/vault.js.map +1 -1
  108. package/dist/routes/pages/workspace.d.ts.map +1 -1
  109. package/dist/routes/pages/workspace.js +13 -10
  110. package/dist/routes/pages/workspace.js.map +1 -1
  111. package/dist/server/index.d.ts.map +1 -1
  112. package/dist/server/index.js +3 -0
  113. package/dist/server/index.js.map +1 -1
  114. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  115. package/dist/server/lib/app-creation-store.js +12 -52
  116. package/dist/server/lib/app-creation-store.js.map +1 -1
  117. package/dist/shared/app-roles.d.ts +9 -0
  118. package/dist/shared/app-roles.d.ts.map +1 -0
  119. package/dist/shared/app-roles.js +7 -0
  120. package/dist/shared/app-roles.js.map +1 -0
  121. package/package.json +4 -3
  122. package/src/components/admin-navigation.tsx +57 -11
  123. package/src/components/agents-panel.tsx +54 -29
  124. package/src/components/app-list-row.tsx +1 -2
  125. package/src/components/app-open-actions.tsx +5 -114
  126. package/src/components/app-row-settings.tsx +54 -0
  127. package/src/components/automation-run-history-dialog.tsx +8 -4
  128. package/src/components/connected-app-card.tsx +0 -1
  129. package/src/components/create-app-popover.spec.tsx +1 -1
  130. package/src/components/create-app-popover.tsx +2 -2
  131. package/src/components/dispatch-control-plane.spec.tsx +36 -2
  132. package/src/components/dispatch-control-plane.tsx +83 -27
  133. package/src/components/dispatch-shell.tsx +7 -1
  134. package/src/components/docs-link.tsx +52 -0
  135. package/src/components/layout/Layout.spec.tsx +10 -0
  136. package/src/components/layout/Layout.tsx +50 -23
  137. package/src/components/messaging-setup-panel.tsx +10 -3
  138. package/src/components/usage-alerts-panel.tsx +445 -0
  139. package/src/components/workspace-app-card.spec.tsx +130 -9
  140. package/src/components/workspace-app-card.tsx +128 -71
  141. package/src/components/workspace-app-search.tsx +96 -0
  142. package/src/components/workspace-resource-effective-stack.tsx +10 -5
  143. package/src/components/workspace-template-card.spec.tsx +52 -23
  144. package/src/components/workspace-template-card.tsx +7 -10
  145. package/src/lib/workspace-app-layout.spec.ts +47 -0
  146. package/src/lib/workspace-app-layout.ts +121 -0
  147. package/src/lib/workspace-apps.test.ts +45 -1
  148. package/src/lib/workspace-apps.ts +72 -0
  149. package/src/routes/pages/$appId.tsx +3 -6
  150. package/src/routes/pages/agents.tsx +6 -3
  151. package/src/routes/pages/apps.$appId.tsx +6 -6
  152. package/src/routes/pages/apps.tsx +116 -62
  153. package/src/routes/pages/audit.tsx +28 -8
  154. package/src/routes/pages/dreams.tsx +92 -142
  155. package/src/routes/pages/integrations.tsx +147 -68
  156. package/src/routes/pages/metrics.tsx +8 -0
  157. package/src/routes/pages/operations.tsx +2 -2
  158. package/src/routes/pages/settings.tsx +14 -9
  159. package/src/routes/pages/thread-debug.tsx +18 -36
  160. package/src/routes/pages/vault.tsx +7 -2
  161. package/src/routes/pages/workspace.tsx +92 -56
  162. package/src/server/index.ts +4 -0
  163. package/src/server/lib/app-creation-store.spec.ts +90 -43
  164. package/src/server/lib/app-creation-store.ts +15 -61
  165. package/src/shared/app-roles.ts +8 -0
@@ -1 +1 @@
1
- {"version":3,"file":"automation-run-history-dialog.js","sourceRoot":"","sources":["../../src/components/automation-run-history-dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAC;AAkBrB,SAAS,gBAAgB,CACvB,MAA+B;IAE/B,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,aAAa,CAAC;IAC7C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,S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\n IconAlertTriangle,\n IconClock,\n IconExternalLink,\n IconLoader2,\n} from \"@tabler/icons-react\";\nimport { Link } from \"react-router\";\n\nimport {\n automationScopeLabel,\n automationTarget,\n} from \"../lib/automation-display\";\nimport type { DispatchAutomationItem } from \"../lib/automations\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport { Badge } from \"./ui/badge\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"./ui/dialog\";\n\ninterface AutomationRun {\n id: string;\n runId: string | null;\n threadId: string | null;\n status: \"running\" | \"success\" | \"error\" | \"interrupted\";\n startedAt: number;\n finishedAt: number | null;\n error: string | null;\n}\n\ninterface AutomationRunHistoryDialogProps {\n automation: DispatchAutomationItem | null;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\nfunction runStatusVariant(\n status: AutomationRun[\"status\"],\n): \"default\" | \"destructive\" | \"outline\" {\n if (status === \"error\") return \"destructive\";\n if (status === \"success\") return \"default\";\n return \"outline\";\n}\n\nfunction formatTimestamp(value: number): string {\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? \"Unknown time\" : date.toLocaleString();\n}\n\nfunction formatDuration(run: AutomationRun): string | null {\n if (!run.finishedAt) return null;\n const seconds = Math.max(\n 0,\n Math.round((run.finishedAt - run.startedAt) / 1000),\n );\n return `${seconds}s`;\n}\n\nfunction runDebugPath(run: AutomationRun): string | null {\n const params = new URLSearchParams();\n if (run.runId) params.set(\"runId\", run.runId);\n else if (run.threadId) params.set(\"threadId\", run.threadId);\n else return null;\n return `/admin/thread-debug?${params.toString()}`;\n}\n\nexport function AutomationRunHistoryDialog({\n automation,\n open,\n onOpenChange,\n}: AutomationRunHistoryDialogProps) {\n const scope =\n automation?.scope === \"organization\" ||\n automation?.owner.startsWith(\"__organization__:\") ||\n automation?.owner === \"__shared__\"\n ? \"organization\"\n : \"personal\";\n const runsQuery = useActionQuery<AutomationRun[]>(\n \"list-automation-runs\",\n {\n name: automation?.name ?? \"\",\n scope,\n appId: automation?.appId ?? \"dispatch\",\n },\n {\n enabled: open && Boolean(automation),\n staleTime: 5_000,\n },\n );\n const runs = runsQuery.data ?? [];\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-h-[85vh] max-w-2xl overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>{automation?.name ?? \"Automation details\"}</DialogTitle>\n <DialogDescription>\n {automation\n ? `${automationTarget(automation)} · ${automationScopeLabel(automation)}`\n : \"Execution history\"}\n </DialogDescription>\n </DialogHeader>\n\n {automation ? (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-x-4 gap-y-3 rounded-lg border bg-muted/20 p-3 text-sm\">\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Status\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.lastStatus ??\n (automation.enabled ? \"ready\" : \"paused\")}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Last check\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.lastCheck\n ? formatTimestamp(new Date(automation.lastCheck).getTime())\n : \"Not recorded\"}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Created by\n </div>\n <div className=\"mt-1 break-words font-medium\">\n {automation.createdBy ?? \"Unknown\"}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Timezone\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.timezone ?? \"Account default\"}\n </div>\n </div>\n </div>\n\n {automation.lastError ? (\n <div className=\"flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3\">\n <IconAlertTriangle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-destructive\">\n Latest scheduler result\n </p>\n <p className=\"mt-1 break-words text-sm text-muted-foreground\">\n {automation.lastError}\n </p>\n </div>\n </div>\n ) : null}\n\n <div>\n <div className=\"flex items-center justify-between gap-3\">\n <div>\n <h3 className=\"text-sm font-semibold text-foreground\">\n Past runs\n </h3>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n Only executions that actually started appear here. Blocked\n or skipped scheduler checks are shown above, not as fake\n runs.\n </p>\n </div>\n {runs.length > 0 ? (\n <Badge variant=\"outline\">{runs.length} shown</Badge>\n ) : null}\n </div>\n\n <div className=\"mt-3\">\n {runsQuery.isLoading ? (\n <div className=\"flex items-center gap-2 rounded-lg border p-4 text-sm text-muted-foreground\">\n <IconLoader2 className=\"size-4 animate-spin\" />\n Loading run history...\n </div>\n ) : runsQuery.isError ? (\n <ActionQueryError\n error={runsQuery.error}\n onRetry={() => void runsQuery.refetch()}\n />\n ) : runs.length === 0 ? (\n <div className=\"rounded-lg border border-dashed p-4 text-sm text-muted-foreground\">\n This automation has not recorded an execution yet. If it is\n enabled but shows no runs, inspect the latest scheduler\n result and last check above.\n </div>\n ) : (\n <ul className=\"divide-y rounded-lg border\">\n {runs.map((run) => {\n const debugPath = runDebugPath(run);\n const duration = formatDuration(run);\n return (\n <li key={run.id} className=\"space-y-2 p-3\">\n <div className=\"flex flex-wrap items-center gap-2 text-sm\">\n <Badge variant={runStatusVariant(run.status)}>\n {run.status}\n </Badge>\n <span className=\"text-muted-foreground\">\n {formatTimestamp(run.startedAt)}\n </span>\n {duration ? (\n <span className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\">\n <IconClock className=\"size-3.5\" />\n {duration}\n </span>\n ) : null}\n {debugPath ? (\n <Link\n to={debugPath}\n className=\"ml-auto inline-flex items-center gap-1 text-xs font-medium text-foreground underline-offset-4 hover:underline\"\n >\n <IconExternalLink className=\"size-3.5\" />\n Open debug\n </Link>\n ) : null}\n </div>\n {run.error ? (\n <p className=\"break-words text-sm text-destructive\">\n {run.error}\n </p>\n ) : null}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </div>\n </div>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n}\n"]}
1
+ {"version":3,"file":"automation-run-history-dialog.js","sourceRoot":"","sources":["../../src/components/automation-run-history-dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAkBzC,SAAS,gBAAgB,CACvB,MAA+B;IAE/B,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,aAAa,CAAC;IAC7C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;AAC/E,CAAC;AAED,SAAS,cAAc,CAAC,GAAkB;IACxC,IAAI,CAAC,GAAG,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CACtB,CAAC,EACD,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,GA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AAG,cAAc,CAAC,GAAG,CAAC,CAAC;4CACrC,OAAO,CACL,cAAiB,SAAS,EAAC,eAAe,aACxC,eAAK,SAAS,EAAC,2CAA2C,aACxD,KAAC,KAAK,IAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,YACzC,GAAG,CAAC,MAAM,GACL,EACR,eAAM,SAAS,EAAC,uBAAuB,YACpC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,GAC1B,EACN,QAAQ,CAAC,CAAC,CAAC,CACV,gBAAM,SAAS,EAAC,8DAA8D,aAC5E,KAAC,SAAS,IAAC,SAAS,EAAC,UAAU,GAAG,EACjC,QAAQ,IACJ,CACR,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,MAAC,IAAI,IACH,EAAE,EAAE,SAAS,EACb,SAAS,EAAC,+GAA+G,aAEzH,KAAC,gBAAgB,IAAC,SAAS,EAAC,UAAU,GAAG,kBAEpC,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CACX,YAAG,SAAS,EAAC,sCAAsC,YAChD,GAAG,CAAC,KAAK,GACR,CACL,CAAC,CAAC,CAAC,IAAI,KA5BD,GAAG,CAAC,EAAE,CA6BV,CACN,CAAC;wCACJ,CAAC,CAAC,GACC,CACN,GACG,IACF,IACF,CACP,CAAC,CAAC,CAAC,IAAI,IACM,GACT,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport {\n IconAlertTriangle,\n IconClock,\n IconExternalLink,\n} from \"@tabler/icons-react\";\nimport { Link } from \"react-router\";\n\nimport {\n automationScopeLabel,\n automationTarget,\n} from \"../lib/automation-display\";\nimport type { DispatchAutomationItem } from \"../lib/automations\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport { Badge } from \"./ui/badge\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"./ui/dialog\";\nimport { Skeleton } from \"./ui/skeleton\";\n\ninterface AutomationRun {\n id: string;\n runId: string | null;\n threadId: string | null;\n status: \"running\" | \"success\" | \"error\" | \"interrupted\";\n startedAt: number;\n finishedAt: number | null;\n error: string | null;\n}\n\ninterface AutomationRunHistoryDialogProps {\n automation: DispatchAutomationItem | null;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\nfunction runStatusVariant(\n status: AutomationRun[\"status\"],\n): \"default\" | \"destructive\" | \"outline\" {\n if (status === \"error\") return \"destructive\";\n if (status === \"success\") return \"default\";\n return \"outline\";\n}\n\nfunction formatTimestamp(value: number): string {\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? \"Unknown time\" : date.toLocaleString();\n}\n\nfunction formatDuration(run: AutomationRun): string | null {\n if (!run.finishedAt) return null;\n const seconds = Math.max(\n 0,\n Math.round((run.finishedAt - run.startedAt) / 1000),\n );\n return `${seconds}s`;\n}\n\nfunction runDebugPath(run: AutomationRun): string | null {\n const params = new URLSearchParams();\n if (run.runId) params.set(\"runId\", run.runId);\n else if (run.threadId) params.set(\"threadId\", run.threadId);\n else return null;\n return `/admin/thread-debug?${params.toString()}`;\n}\n\nexport function AutomationRunHistoryDialog({\n automation,\n open,\n onOpenChange,\n}: AutomationRunHistoryDialogProps) {\n const scope =\n automation?.scope === \"organization\" ||\n automation?.owner.startsWith(\"__organization__:\") ||\n automation?.owner === \"__shared__\"\n ? \"organization\"\n : \"personal\";\n const runsQuery = useActionQuery<AutomationRun[]>(\n \"list-automation-runs\",\n {\n name: automation?.name ?? \"\",\n scope,\n appId: automation?.appId ?? \"dispatch\",\n },\n {\n enabled: open && Boolean(automation),\n staleTime: 5_000,\n },\n );\n const runs = runsQuery.data ?? [];\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-h-[85vh] max-w-2xl overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>{automation?.name ?? \"Automation details\"}</DialogTitle>\n <DialogDescription>\n {automation\n ? `${automationTarget(automation)} · ${automationScopeLabel(automation)}`\n : \"Execution history\"}\n </DialogDescription>\n </DialogHeader>\n\n {automation ? (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-x-4 gap-y-3 rounded-lg border bg-muted/20 p-3 text-sm\">\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Status\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.lastStatus ??\n (automation.enabled ? \"ready\" : \"paused\")}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Last check\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.lastCheck\n ? formatTimestamp(new Date(automation.lastCheck).getTime())\n : \"Not recorded\"}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Created by\n </div>\n <div className=\"mt-1 break-words font-medium\">\n {automation.createdBy ?? \"Unknown\"}\n </div>\n </div>\n <div>\n <div className=\"text-[11px] uppercase tracking-wide text-muted-foreground\">\n Timezone\n </div>\n <div className=\"mt-1 font-medium\">\n {automation.timezone ?? \"Account default\"}\n </div>\n </div>\n </div>\n\n {automation.lastError ? (\n <div className=\"flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3\">\n <IconAlertTriangle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-destructive\">\n Latest scheduler result\n </p>\n <p className=\"mt-1 break-words text-sm text-muted-foreground\">\n {automation.lastError}\n </p>\n </div>\n </div>\n ) : null}\n\n <div>\n <div className=\"flex items-center justify-between gap-3\">\n <div>\n <h3 className=\"text-sm font-semibold text-foreground\">\n Past runs\n </h3>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n Only executions that actually started appear here. Blocked\n or skipped scheduler checks are shown above, not as fake\n runs.\n </p>\n </div>\n {runs.length > 0 ? (\n <Badge variant=\"outline\">{runs.length} shown</Badge>\n ) : null}\n </div>\n\n <div className=\"mt-3\">\n {runsQuery.isLoading ? (\n <div className=\"space-y-3 rounded-lg border p-4\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"space-y-2\">\n <Skeleton className=\"h-4 w-2/3\" />\n <Skeleton className=\"h-3 w-1/2\" />\n </div>\n ))}\n </div>\n ) : runsQuery.isError ? (\n <ActionQueryError\n error={runsQuery.error}\n onRetry={() => void runsQuery.refetch()}\n />\n ) : runs.length === 0 ? (\n <div className=\"rounded-lg border border-dashed p-4 text-sm text-muted-foreground\">\n This automation has not recorded an execution yet. If it is\n enabled but shows no runs, inspect the latest scheduler\n result and last check above.\n </div>\n ) : (\n <ul className=\"divide-y rounded-lg border\">\n {runs.map((run) => {\n const debugPath = runDebugPath(run);\n const duration = formatDuration(run);\n return (\n <li key={run.id} className=\"space-y-2 p-3\">\n <div className=\"flex flex-wrap items-center gap-2 text-sm\">\n <Badge variant={runStatusVariant(run.status)}>\n {run.status}\n </Badge>\n <span className=\"text-muted-foreground\">\n {formatTimestamp(run.startedAt)}\n </span>\n {duration ? (\n <span className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\">\n <IconClock className=\"size-3.5\" />\n {duration}\n </span>\n ) : null}\n {debugPath ? (\n <Link\n to={debugPath}\n className=\"ml-auto inline-flex items-center gap-1 text-xs font-medium text-foreground underline-offset-4 hover:underline\"\n >\n <IconExternalLink className=\"size-3.5\" />\n Open debug\n </Link>\n ) : null}\n </div>\n {run.error ? (\n <p className=\"break-words text-sm text-destructive\">\n {run.error}\n </p>\n ) : null}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </div>\n </div>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"connected-app-card.d.ts","sourceRoot":"","sources":["../../src/components/connected-app-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK7D,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,GACV,EAAE;IACD,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDA0BA"}
1
+ {"version":3,"file":"connected-app-card.d.ts","sourceRoot":"","sources":["../../src/components/connected-app-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK7D,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,GACV,EAAE;IACD,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAyBA"}
@@ -8,6 +8,6 @@ export function ConnectedAppCard({ app, className, }) {
8
8
  return (_jsxs(AppListRow, { className: className, children: [_jsx(AppIcon, { id: app.id, name: app.name, color: app.color, size: "sm" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: app.name }), _jsx("div", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: app.description || app.url })] }), _jsx(AppOpenActions, { name: app.name, href: withBuilderUtmTrackingParams(launchUrl, {
9
9
  campaign: "product",
10
10
  content: "dispatch_app",
11
- }), target: "_blank", rel: "noopener noreferrer", showNewTabOption: true })] }));
11
+ }), rel: "noopener noreferrer", showNewTabOption: true })] }));
12
12
  }
13
13
  //# sourceMappingURL=connected-app-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connected-app-card.js","sourceRoot":"","sources":["../../src/components/connected-app-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAG/F,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,GAIV;IACC,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC;IAEzC,OAAO,CACL,MAAC,UAAU,IAAC,SAAS,EAAE,SAAS,aAC9B,KAAC,OAAO,IAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAC,IAAI,GAAG,EACnE,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cAAK,SAAS,EAAC,gDAAgD,YAC5D,GAAG,CAAC,IAAI,GACL,EACN,cAAK,SAAS,EAAC,+CAA+C,YAC3D,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,GAAG,GACvB,IACF,EACN,KAAC,cAAc,IACb,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,IAAI,EAAE,4BAA4B,CAAC,SAAS,EAAE;oBAC5C,QAAQ,EAAE,SAAS;oBACnB,OAAO,EAAE,cAAc;iBACxB,CAAC,EACF,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,gBAAgB,SAChB,IACS,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { AppIcon } from \"./app-icon\";\nimport { AppListRow } from \"./app-list-row\";\nimport { AppOpenActions } from \"./app-open-actions\";\n\nexport function ConnectedAppCard({\n app,\n className,\n}: {\n app: ConnectedAppSummary;\n className?: string;\n}) {\n const launchUrl = app.homeUrl ?? app.url;\n\n return (\n <AppListRow className={className}>\n <AppIcon id={app.id} name={app.name} color={app.color} size=\"sm\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </div>\n <div className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {app.description || app.url}\n </div>\n </div>\n <AppOpenActions\n name={app.name}\n href={withBuilderUtmTrackingParams(launchUrl, {\n campaign: \"product\",\n content: \"dispatch_app\",\n })}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n showNewTabOption\n />\n </AppListRow>\n );\n}\n"]}
1
+ {"version":3,"file":"connected-app-card.js","sourceRoot":"","sources":["../../src/components/connected-app-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAG/F,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,GAIV;IACC,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC;IAEzC,OAAO,CACL,MAAC,UAAU,IAAC,SAAS,EAAE,SAAS,aAC9B,KAAC,OAAO,IAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAC,IAAI,GAAG,EACnE,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cAAK,SAAS,EAAC,gDAAgD,YAC5D,GAAG,CAAC,IAAI,GACL,EACN,cAAK,SAAS,EAAC,+CAA+C,YAC3D,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,GAAG,GACvB,IACF,EACN,KAAC,cAAc,IACb,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,IAAI,EAAE,4BAA4B,CAAC,SAAS,EAAE;oBAC5C,QAAQ,EAAE,SAAS;oBACnB,OAAO,EAAE,cAAc;iBACxB,CAAC,EACF,GAAG,EAAC,qBAAqB,EACzB,gBAAgB,SAChB,IACS,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { AppIcon } from \"./app-icon\";\nimport { AppListRow } from \"./app-list-row\";\nimport { AppOpenActions } from \"./app-open-actions\";\n\nexport function ConnectedAppCard({\n app,\n className,\n}: {\n app: ConnectedAppSummary;\n className?: string;\n}) {\n const launchUrl = app.homeUrl ?? app.url;\n\n return (\n <AppListRow className={className}>\n <AppIcon id={app.id} name={app.name} color={app.color} size=\"sm\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </div>\n <div className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {app.description || app.url}\n </div>\n </div>\n <AppOpenActions\n name={app.name}\n href={withBuilderUtmTrackingParams(launchUrl, {\n campaign: \"product\",\n content: \"dispatch_app\",\n })}\n rel=\"noopener noreferrer\"\n showNewTabOption\n />\n </AppListRow>\n );\n}\n"]}
@@ -215,7 +215,7 @@ export function CreateAppFlow({ onClose, className = "", }) {
215
215
  const submitWithSelectedAccess = () => submit(prompt);
216
216
  const isCreatingBuilderBranch = isSubmitting && !isInBuilderFrame() && !isDevMode;
217
217
  if (branchUrl) {
218
- return (_jsxs("div", { className: `flex min-h-[260px] flex-col items-center justify-center gap-5 px-6 py-8 text-center ${className}`, children: [_jsx("span", { className: "flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary", children: _jsx(IconCheck, { className: "size-5", "aria-hidden": "true" }) }), _jsxs("div", { className: "space-y-2", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: "Your Builder branch is ready" }), _jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: "Continue building and editing your app in Builder." })] }), _jsx(Button, { asChild: true, className: "w-full sm:w-auto", children: _jsxs("a", { href: branchUrl, target: "_blank", rel: "noreferrer", children: ["Open Builder branch ", _jsx(IconArrowUpRight, { "aria-hidden": "true" })] }) })] }));
218
+ return (_jsxs("div", { className: `flex min-h-[260px] flex-col items-center justify-center gap-5 px-6 py-8 text-center ${className}`, children: [_jsx("span", { className: "flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary", children: _jsx(IconCheck, { className: "size-5", "aria-hidden": "true" }) }), _jsxs("div", { className: "space-y-2", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: "Your Builder branch is ready" }), _jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: "Continue building and editing your app in Builder." })] }), _jsx(Button, { asChild: true, className: "w-full sm:w-auto", children: _jsxs("a", { href: branchUrl, target: "_blank", rel: "noreferrer", children: ["Open in Builder ", _jsx(IconArrowUpRight, { "aria-hidden": "true" })] }) })] }));
219
219
  }
220
220
  if (isCreatingBuilderBranch) {
221
221
  return (_jsxs("div", { className: `flex min-h-[260px] flex-col items-center justify-center gap-4 px-6 py-8 text-center ${className}`, "aria-live": "polite", children: [_jsx(IconLoader2, { className: "size-7 animate-spin text-muted-foreground", "aria-hidden": "true" }), _jsxs("div", { className: "space-y-2", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: "Creating your Builder branch" }), _jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: "This usually takes a few seconds." })] })] }));
@@ -243,7 +243,7 @@ export function CreateAppFlow({ onClose, className = "", }) {
243
243
  : "Selected apps"] }), resource.description ? (_jsx("div", { className: "line-clamp-2", children: resource.description })) : null] })] })] }, resource.id));
244
244
  }))] }), _jsx("div", { className: "flex items-center justify-end gap-2", children: _jsxs(Button, { type: "button", size: "sm", onClick: submitWithSelectedAccess, disabled: !prompt.trim() || isSubmitting, children: [isSubmitting ? (_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" })) : (_jsx(IconPlus, { className: "h-3.5 w-3.5" })), "Create app"] }) }), !prompt.trim() ? (_jsx("p", { className: "px-1 text-[11px] text-muted-foreground/70", children: "Add a prompt on the previous step before creating the app." })) : null] })), statusMessage ? (_jsxs("div", { className: `flex flex-col gap-2 rounded-md border px-3 py-2 text-xs ${isErrorFailureReason(failureReason)
245
245
  ? "border-destructive/40 bg-destructive/10 text-destructive"
246
- : "border-border bg-muted/40 text-muted-foreground"}`, children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [isErrorFailureReason(failureReason) ? (_jsx(IconAlertTriangle, { className: "h-3.5 w-3.5 shrink-0" })) : null, _jsx("span", { children: statusMessage }), branchUrl ? (_jsxs("a", { href: branchUrl, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 font-medium text-foreground underline", children: ["Open branch ", _jsx(IconArrowUpRight, { className: "h-3 w-3" })] })) : null] }), failureReason === "builder-not-connected" ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => connectFlow.start(), disabled: connectFlow.connecting, className: "w-fit", children: connectFlow.connecting ? "Connecting..." : "Connect Builder" }), _jsxs("a", { href: LOCAL_APP_DOCS_URL, target: "_blank", rel: "noreferrer", "data-create-app-local-link": true, className: "inline-flex items-center gap-1 text-xs font-medium text-foreground underline underline-offset-2", children: ["Create locally ", _jsx(IconArrowUpRight, { className: "h-3 w-3" })] })] })) : null, failureReason === "credential-store-unavailable" ||
246
+ : "border-border bg-muted/40 text-muted-foreground"}`, children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [isErrorFailureReason(failureReason) ? (_jsx(IconAlertTriangle, { className: "h-3.5 w-3.5 shrink-0" })) : null, _jsx("span", { children: statusMessage }), branchUrl ? (_jsxs("a", { href: branchUrl, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 font-medium text-foreground underline", children: ["Open in Builder ", _jsx(IconArrowUpRight, { className: "h-3 w-3" })] })) : null] }), failureReason === "builder-not-connected" ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => connectFlow.start(), disabled: connectFlow.connecting, className: "w-fit", children: connectFlow.connecting ? "Connecting..." : "Connect Builder" }), _jsxs("a", { href: LOCAL_APP_DOCS_URL, target: "_blank", rel: "noreferrer", "data-create-app-local-link": true, className: "inline-flex items-center gap-1 text-xs font-medium text-foreground underline underline-offset-2", children: ["Create locally ", _jsx(IconArrowUpRight, { className: "h-3 w-3" })] })] })) : null, failureReason === "credential-store-unavailable" ||
247
247
  failureReason === "builder-error" ? (_jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: submitWithSelectedAccess, disabled: isSubmitting, className: "w-fit", children: "Try again" })) : null] })) : null] }));
248
248
  }
249
249
  export function CreateAppPopover({ trigger, align = "center", }) {
@@ -1 +1 @@
1
- {"version":3,"file":"create-app-popover.js","sourceRoot":"","sources":["../../src/components/create-app-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,EACZ,OAAO,EACP,WAAW,EACX,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAkCvE,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,IAAkB;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AAG,QAAQ,GACM;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aACxC,KAAC,cAAc,IAAC,OAAO,kBACpB,OAAO,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,4MAA4M,YAEtN,gBAAM,SAAS,EAAC,gCAAgC,aAC9C,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,kBAEjB,GACA,CACV,GACc,EACjB,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,EACd,SAAS,EAAC,4DAA4D,YAEtE,KAAC,aAAa,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,GACjC,IACT,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { sendToAgentChat } from \"@agent-native/core/client/agent-chat\";\nimport { useDevMode } from \"@agent-native/core/client/agent-chat\";\nimport {\n agentNativePath,\n appBasePath,\n} from \"@agent-native/core/client/api-path\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { isInBuilderFrame } from \"@agent-native/core/client/host\";\nimport { useBuilderConnectFlow } from \"@agent-native/core/client/settings/useBuilderStatus\";\nimport {\n buildChatFirstAppCreationPrompt,\n getWorkspaceAppIdValidationError,\n titleFromChatFirstAppPrompt,\n} from \"@agent-native/core/shared\";\nimport {\n IconAlertTriangle,\n IconArrowLeft,\n IconArrowUpRight,\n IconBook,\n IconCheck,\n IconChevronDown,\n IconFileText,\n IconKey,\n IconLoader2,\n IconPlus,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\n\nimport { Button } from \"./ui/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./ui/popover\";\n\ninterface VaultSecretOption {\n id: string;\n name: string;\n credentialKey: string;\n provider?: string | null;\n description?: string | null;\n}\n\ninterface WorkspaceResourceOption {\n id: string;\n kind: \"skill\" | \"instruction\" | \"agent\" | \"knowledge\" | \"mcp-server\";\n name: string;\n description?: string | null;\n path: string;\n scope: \"all\" | \"selected\";\n updatedAt?: number;\n}\n\ntype VaultAccessMode = \"all-apps\" | \"manual\";\n\ninterface CreateAppPopoverProps {\n /**\n * Custom trigger element. Defaults to a dashed-border tile that matches the\n * apps grid empty state.\n */\n trigger?: ReactNode;\n /**\n * Override the popover alignment. Defaults to \"center\" with a 10px offset.\n */\n align?: \"start\" | \"center\" | \"end\";\n}\n\nasync function fetchJson(url: string, init?: RequestInit): Promise<any> {\n const res = await fetch(url, init);\n const data = await res.json().catch(() => null);\n if (!res.ok) {\n throw new Error(\n data?.error || data?.message || `Request failed ${res.status}`,\n );\n }\n return data;\n}\n\nfunction defaultDispatchBasePath(): string | null {\n const base = appBasePath();\n if (base === \"/dispatch\") return null;\n return null;\n}\n\nfunction actionUrl(basePath: string | null, action: string): string {\n const path = `/_agent-native/actions/${action}`;\n if (basePath === null) return agentNativePath(path);\n const normalized = basePath.replace(/\\/+$/, \"\");\n return `${normalized}${path}`;\n}\n\nconst ERROR_FAILURE_REASONS = new Set([\n \"builder-error\",\n \"builder-not-connected\",\n \"credential-store-unavailable\",\n \"settings-management-required\",\n]);\nconst LOCAL_APP_DOCS_URL =\n \"https://agent-native.com/docs/multi-app-workspace#adding-a-new-app\";\n\nfunction isErrorFailureReason(reason: string | null): boolean {\n return !!reason && ERROR_FAILURE_REASONS.has(reason);\n}\n\n/**\n * Inline two-step app-creation flow: prompt → optional access picker → submit.\n * Used both in the popover form and in the dedicated `/new-app` page so the\n * same UX shows up everywhere a teammate kicks off a new workspace app.\n */\nexport function CreateAppFlow({\n onClose,\n className = \"\",\n}: {\n onClose?: () => void;\n className?: string;\n}) {\n const [step, setStep] = useState<\"prompt\" | \"access\">(\"prompt\");\n const [prompt, setPrompt] = useState(\"\");\n const [selectedSecretIds, setSelectedSecretIds] = useState<string[]>([]);\n const [selectedResourceIds, setSelectedResourceIds] = useState<string[]>([]);\n const [secrets, setSecrets] = useState<VaultSecretOption[]>([]);\n const [resources, setResources] = useState<WorkspaceResourceOption[]>([]);\n const [vaultAccessMode, setVaultAccessMode] =\n useState<VaultAccessMode>(\"all-apps\");\n const [secretsError, setSecretsError] = useState<string | null>(null);\n const [resourcesError, setResourcesError] = useState<string | null>(null);\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [failureReason, setFailureReason] = useState<string | null>(null);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { isDevMode } = useDevMode();\n\n const basePath = useMemo(() => defaultDispatchBasePath(), []);\n\n // Enabled only while the connect CTA is on screen. Left always-on, the hook\n // would poll Builder status on every popover mount and fire onConnected on\n // its first status read for anyone already connected.\n const connectFlow = useBuilderConnectFlow({\n enabled: failureReason === \"builder-not-connected\",\n trackingSource: \"dispatch_create_app\",\n trackingFlow: \"create_app\",\n onConnected: () => {\n setFailureReason(null);\n setStatusMessage(\"Builder connected. Press Create app to try again.\");\n },\n });\n\n // Fetch access options eagerly so step 2 has them ready immediately.\n useEffect(() => {\n let cancelled = false;\n fetchJson(actionUrl(basePath, \"list-vault-secret-options\"))\n .then((data) => {\n if (cancelled) return;\n setSecrets(Array.isArray(data) ? data : []);\n setSecretsError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setSecrets([]);\n setSecretsError(err?.message || \"Could not load Dispatch keys\");\n });\n fetchJson(actionUrl(basePath, \"get-vault-access-settings\"))\n .then((data) => {\n if (cancelled) return;\n setVaultAccessMode(data?.mode === \"manual\" ? \"manual\" : \"all-apps\");\n })\n .catch(() => {\n if (cancelled) return;\n setVaultAccessMode(\"manual\");\n });\n fetchJson(actionUrl(basePath, \"list-workspace-resource-options\"))\n .then((data) => {\n if (cancelled) return;\n setResources(Array.isArray(data) ? data : []);\n setResourcesError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setResources([]);\n setResourcesError(err?.message || \"Could not load Dispatch resources\");\n });\n return () => {\n cancelled = true;\n };\n }, [basePath]);\n\n const selectedSecrets = useMemo(\n () => secrets.filter((s) => selectedSecretIds.includes(s.id)),\n [secrets, selectedSecretIds],\n );\n const selectedResources = useMemo(\n () => resources.filter((r) => selectedResourceIds.includes(r.id)),\n [resources, selectedResourceIds],\n );\n const selectedSecretLabel =\n vaultAccessMode === \"all-apps\"\n ? \"all keys\"\n : selectedSecretIds.length === 0\n ? \"no keys\"\n : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? \"\" : \"s\"}`;\n const selectedResourceLabel =\n selectedResourceIds.length === 0\n ? \"no resources\"\n : `${selectedResourceIds.length} resource${selectedResourceIds.length === 1 ? \"\" : \"s\"}`;\n const selectedAccessLabel = [selectedSecretLabel, selectedResourceLabel].join(\n \" · \",\n );\n\n function toggleSecret(id: string) {\n setSelectedSecretIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n function toggleResource(id: string) {\n setSelectedResourceIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n async function submit(rawPrompt: string) {\n const trimmed = rawPrompt.trim();\n if (!trimmed || isSubmitting) return;\n const appId = titleFromChatFirstAppPrompt(trimmed);\n const validationError = getWorkspaceAppIdValidationError(appId);\n if (validationError) {\n setStatusMessage(validationError);\n return;\n }\n\n const message = buildChatFirstAppCreationPrompt({\n appId,\n prompt: trimmed,\n selectedKeys:\n vaultAccessMode === \"manual\"\n ? selectedSecrets.map((s) => s.credentialKey)\n : [],\n selectedResources,\n vaultAccessMode,\n });\n setIsSubmitting(true);\n setStatusMessage(null);\n setBranchUrl(null);\n setFailureReason(null);\n\n try {\n if (isInBuilderFrame()) {\n sendToAgentChat({ message, submit: true, type: \"code\" });\n setStatusMessage(\"Sent to Builder chat.\");\n onClose?.();\n } else if (isDevMode) {\n sendToAgentChat({ message, submit: true, type: \"code\", newTab: true });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n const result = await fetchJson(\n actionUrl(basePath, \"start-workspace-app-creation\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n prompt: trimmed,\n appId,\n secretIds:\n vaultAccessMode === \"manual\" && selectedSecretIds.length > 0\n ? selectedSecretIds\n : [],\n resourceIds:\n selectedResourceIds.length > 0 ? selectedResourceIds : [],\n }),\n },\n );\n if (result?.mode === \"builder\") {\n setBranchUrl(result?.url || null);\n setStatusMessage(\"Builder branch created.\");\n } else if (result?.mode === \"local-agent\") {\n sendToAgentChat({\n message: result.prompt ?? message,\n submit: true,\n type: \"code\",\n newTab: true,\n reuseEmptyTab: true,\n });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n setStatusMessage(\n result?.message ||\n \"This requires a code change. Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like.\",\n );\n setFailureReason(\n result?.mode === \"builder-unavailable\" ? result.reason : null,\n );\n }\n }\n } catch (err: any) {\n setStatusMessage(err?.message || \"Could not start the new app flow.\");\n setFailureReason(null);\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const submitWithSelectedAccess = () => submit(prompt);\n const isCreatingBuilderBranch =\n isSubmitting && !isInBuilderFrame() && !isDevMode;\n\n if (branchUrl) {\n return (\n <div\n className={`flex min-h-[260px] flex-col items-center justify-center gap-5 px-6 py-8 text-center ${className}`}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary\">\n <IconCheck className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"space-y-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n Your Builder branch is ready\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n Continue building and editing your app in Builder.\n </p>\n </div>\n <Button asChild className=\"w-full sm:w-auto\">\n <a href={branchUrl} target=\"_blank\" rel=\"noreferrer\">\n Open Builder branch <IconArrowUpRight aria-hidden=\"true\" />\n </a>\n </Button>\n </div>\n );\n }\n\n if (isCreatingBuilderBranch) {\n return (\n <div\n className={`flex min-h-[260px] flex-col items-center justify-center gap-4 px-6 py-8 text-center ${className}`}\n aria-live=\"polite\"\n >\n <IconLoader2\n className=\"size-7 animate-spin text-muted-foreground\"\n aria-hidden=\"true\"\n />\n <div className=\"space-y-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n Creating your Builder branch\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n This usually takes a few seconds.\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`flex flex-col gap-3 ${className}`}>\n {step === \"prompt\" ? (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <p className=\"text-sm font-semibold text-foreground\">Create app</p>\n <button\n type=\"button\"\n onClick={() => setStep(\"access\")}\n className=\"inline-flex cursor-pointer items-center gap-1 rounded-md border border-border bg-background/40 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconKey size={11} />\n {selectedAccessLabel}\n </button>\n </div>\n <PromptComposer\n autoFocus\n disabled={isSubmitting}\n placeholder=\"Describe the app your teammate should be able to use...\"\n draftScope=\"dispatch:create-app\"\n preserveDraftOnSubmit\n onSubmit={(text) => {\n setPrompt(text);\n submit(text);\n }}\n />\n </>\n ) : (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <button\n type=\"button\"\n onClick={() => setStep(\"prompt\")}\n className=\"inline-flex cursor-pointer items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowLeft size={12} />\n Back\n </button>\n <span className=\"text-[11px] text-muted-foreground/70\">\n {selectedAccessLabel}\n </span>\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconKey size={12} />\n Dispatch keys\n </div>\n {vaultAccessMode === \"all-apps\" ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n Every saved Dispatch vault key is available to new apps.\n </p>\n ) : secretsError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {secretsError}\n </p>\n ) : secrets.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch vault keys found yet.\n </p>\n ) : (\n secrets.map((secret) => {\n const selected = selectedSecretIds.includes(secret.id);\n return (\n <div\n key={secret.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleSecret(secret.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">\n {secret.credentialKey}\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {selected\n ? \"Will be requested for this app\"\n : \"Click to request\"}\n </span>\n </span>\n </button>\n {(secret.provider || secret.name) && (\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Provider: {secret.provider || \"Not specified\"}\n </div>\n <div className=\"truncate\">Name: {secret.name}</div>\n </div>\n </details>\n )}\n </div>\n );\n })\n )}\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconBook size={12} />\n Resource packs\n </div>\n {resourcesError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {resourcesError}\n </p>\n ) : resources.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch resource packs found yet.\n </p>\n ) : (\n resources.map((resource) => {\n const selected = selectedResourceIds.includes(resource.id);\n return (\n <div\n key={resource.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleResource(resource.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <IconFileText className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground/70\" />\n <span className=\"block truncate font-medium\">\n {resource.name}\n </span>\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {resource.kind} · {resource.path}\n </span>\n </span>\n </button>\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Scope:{\" \"}\n {resource.scope === \"all\"\n ? \"All apps\"\n : \"Selected apps\"}\n </div>\n {resource.description ? (\n <div className=\"line-clamp-2\">\n {resource.description}\n </div>\n ) : null}\n </div>\n </details>\n </div>\n );\n })\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submitWithSelectedAccess}\n disabled={!prompt.trim() || isSubmitting}\n >\n {isSubmitting ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconPlus className=\"h-3.5 w-3.5\" />\n )}\n Create app\n </Button>\n </div>\n {!prompt.trim() ? (\n <p className=\"px-1 text-[11px] text-muted-foreground/70\">\n Add a prompt on the previous step before creating the app.\n </p>\n ) : null}\n </>\n )}\n\n {statusMessage ? (\n <div\n className={`flex flex-col gap-2 rounded-md border px-3 py-2 text-xs ${\n isErrorFailureReason(failureReason)\n ? \"border-destructive/40 bg-destructive/10 text-destructive\"\n : \"border-border bg-muted/40 text-muted-foreground\"\n }`}\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n {isErrorFailureReason(failureReason) ? (\n <IconAlertTriangle className=\"h-3.5 w-3.5 shrink-0\" />\n ) : null}\n <span>{statusMessage}</span>\n {branchUrl ? (\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 font-medium text-foreground underline\"\n >\n Open branch <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n ) : null}\n </div>\n {failureReason === \"builder-not-connected\" ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={() => connectFlow.start()}\n disabled={connectFlow.connecting}\n className=\"w-fit\"\n >\n {connectFlow.connecting ? \"Connecting...\" : \"Connect Builder\"}\n </Button>\n <a\n href={LOCAL_APP_DOCS_URL}\n target=\"_blank\"\n rel=\"noreferrer\"\n data-create-app-local-link\n className=\"inline-flex items-center gap-1 text-xs font-medium text-foreground underline underline-offset-2\"\n >\n Create locally <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n </div>\n ) : null}\n {failureReason === \"credential-store-unavailable\" ||\n failureReason === \"builder-error\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={submitWithSelectedAccess}\n disabled={isSubmitting}\n className=\"w-fit\"\n >\n Try again\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function CreateAppPopover({\n trigger,\n align = \"center\",\n}: CreateAppPopoverProps) {\n const [open, setOpen] = useState(false);\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {trigger ?? (\n <button\n type=\"button\"\n className=\"flex min-h-32 cursor-pointer items-center justify-center rounded-lg border border-dashed bg-card p-4 text-sm font-medium text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n <span className=\"inline-flex items-center gap-2\">\n <IconPlus size={16} />\n Create app\n </span>\n </button>\n )}\n </PopoverTrigger>\n <PopoverContent\n align={align}\n sideOffset={10}\n className=\"w-[calc(100vw-2rem)] rounded-xl p-3 shadow-xl sm:w-[460px]\"\n >\n <CreateAppFlow onClose={() => setOpen(false)} />\n </PopoverContent>\n </Popover>\n );\n}\n"]}
1
+ {"version":3,"file":"create-app-popover.js","sourceRoot":"","sources":["../../src/components/create-app-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EACL,eAAe,EACf,WAAW,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM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,SAAS,EAAC,iGAAiG,gCAE5F,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,GAAG,IACrD,IACA,CACP,CAAC,CAAC,CAAC,IAAI,EACP,aAAa,KAAK,8BAA8B;wBACjD,aAAa,KAAK,eAAe,CAAC,CAAC,CAAC,CAClC,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,OAAO,0BAGV,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,GAAG,QAAQ,GACM;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aACxC,KAAC,cAAc,IAAC,OAAO,kBACpB,OAAO,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,4MAA4M,YAEtN,gBAAM,SAAS,EAAC,gCAAgC,aAC9C,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,kBAEjB,GACA,CACV,GACc,EACjB,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,EACd,SAAS,EAAC,4DAA4D,YAEtE,KAAC,aAAa,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,GACjC,IACT,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { sendToAgentChat } from \"@agent-native/core/client/agent-chat\";\nimport { useDevMode } from \"@agent-native/core/client/agent-chat\";\nimport {\n agentNativePath,\n appBasePath,\n} from \"@agent-native/core/client/api-path\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { isInBuilderFrame } from \"@agent-native/core/client/host\";\nimport { useBuilderConnectFlow } from \"@agent-native/core/client/settings/useBuilderStatus\";\nimport {\n buildChatFirstAppCreationPrompt,\n getWorkspaceAppIdValidationError,\n titleFromChatFirstAppPrompt,\n} from \"@agent-native/core/shared\";\nimport {\n IconAlertTriangle,\n IconArrowLeft,\n IconArrowUpRight,\n IconBook,\n IconCheck,\n IconChevronDown,\n IconFileText,\n IconKey,\n IconLoader2,\n IconPlus,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\n\nimport { Button } from \"./ui/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./ui/popover\";\n\ninterface VaultSecretOption {\n id: string;\n name: string;\n credentialKey: string;\n provider?: string | null;\n description?: string | null;\n}\n\ninterface WorkspaceResourceOption {\n id: string;\n kind: \"skill\" | \"instruction\" | \"agent\" | \"knowledge\" | \"mcp-server\";\n name: string;\n description?: string | null;\n path: string;\n scope: \"all\" | \"selected\";\n updatedAt?: number;\n}\n\ntype VaultAccessMode = \"all-apps\" | \"manual\";\n\ninterface CreateAppPopoverProps {\n /**\n * Custom trigger element. Defaults to a dashed-border tile that matches the\n * apps grid empty state.\n */\n trigger?: ReactNode;\n /**\n * Override the popover alignment. Defaults to \"center\" with a 10px offset.\n */\n align?: \"start\" | \"center\" | \"end\";\n}\n\nasync function fetchJson(url: string, init?: RequestInit): Promise<any> {\n const res = await fetch(url, init);\n const data = await res.json().catch(() => null);\n if (!res.ok) {\n throw new Error(\n data?.error || data?.message || `Request failed ${res.status}`,\n );\n }\n return data;\n}\n\nfunction defaultDispatchBasePath(): string | null {\n const base = appBasePath();\n if (base === \"/dispatch\") return null;\n return null;\n}\n\nfunction actionUrl(basePath: string | null, action: string): string {\n const path = `/_agent-native/actions/${action}`;\n if (basePath === null) return agentNativePath(path);\n const normalized = basePath.replace(/\\/+$/, \"\");\n return `${normalized}${path}`;\n}\n\nconst ERROR_FAILURE_REASONS = new Set([\n \"builder-error\",\n \"builder-not-connected\",\n \"credential-store-unavailable\",\n \"settings-management-required\",\n]);\nconst LOCAL_APP_DOCS_URL =\n \"https://agent-native.com/docs/multi-app-workspace#adding-a-new-app\";\n\nfunction isErrorFailureReason(reason: string | null): boolean {\n return !!reason && ERROR_FAILURE_REASONS.has(reason);\n}\n\n/**\n * Inline two-step app-creation flow: prompt → optional access picker → submit.\n * Used both in the popover form and in the dedicated `/new-app` page so the\n * same UX shows up everywhere a teammate kicks off a new workspace app.\n */\nexport function CreateAppFlow({\n onClose,\n className = \"\",\n}: {\n onClose?: () => void;\n className?: string;\n}) {\n const [step, setStep] = useState<\"prompt\" | \"access\">(\"prompt\");\n const [prompt, setPrompt] = useState(\"\");\n const [selectedSecretIds, setSelectedSecretIds] = useState<string[]>([]);\n const [selectedResourceIds, setSelectedResourceIds] = useState<string[]>([]);\n const [secrets, setSecrets] = useState<VaultSecretOption[]>([]);\n const [resources, setResources] = useState<WorkspaceResourceOption[]>([]);\n const [vaultAccessMode, setVaultAccessMode] =\n useState<VaultAccessMode>(\"all-apps\");\n const [secretsError, setSecretsError] = useState<string | null>(null);\n const [resourcesError, setResourcesError] = useState<string | null>(null);\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [failureReason, setFailureReason] = useState<string | null>(null);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { isDevMode } = useDevMode();\n\n const basePath = useMemo(() => defaultDispatchBasePath(), []);\n\n // Enabled only while the connect CTA is on screen. Left always-on, the hook\n // would poll Builder status on every popover mount and fire onConnected on\n // its first status read for anyone already connected.\n const connectFlow = useBuilderConnectFlow({\n enabled: failureReason === \"builder-not-connected\",\n trackingSource: \"dispatch_create_app\",\n trackingFlow: \"create_app\",\n onConnected: () => {\n setFailureReason(null);\n setStatusMessage(\"Builder connected. Press Create app to try again.\");\n },\n });\n\n // Fetch access options eagerly so step 2 has them ready immediately.\n useEffect(() => {\n let cancelled = false;\n fetchJson(actionUrl(basePath, \"list-vault-secret-options\"))\n .then((data) => {\n if (cancelled) return;\n setSecrets(Array.isArray(data) ? data : []);\n setSecretsError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setSecrets([]);\n setSecretsError(err?.message || \"Could not load Dispatch keys\");\n });\n fetchJson(actionUrl(basePath, \"get-vault-access-settings\"))\n .then((data) => {\n if (cancelled) return;\n setVaultAccessMode(data?.mode === \"manual\" ? \"manual\" : \"all-apps\");\n })\n .catch(() => {\n if (cancelled) return;\n setVaultAccessMode(\"manual\");\n });\n fetchJson(actionUrl(basePath, \"list-workspace-resource-options\"))\n .then((data) => {\n if (cancelled) return;\n setResources(Array.isArray(data) ? data : []);\n setResourcesError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setResources([]);\n setResourcesError(err?.message || \"Could not load Dispatch resources\");\n });\n return () => {\n cancelled = true;\n };\n }, [basePath]);\n\n const selectedSecrets = useMemo(\n () => secrets.filter((s) => selectedSecretIds.includes(s.id)),\n [secrets, selectedSecretIds],\n );\n const selectedResources = useMemo(\n () => resources.filter((r) => selectedResourceIds.includes(r.id)),\n [resources, selectedResourceIds],\n );\n const selectedSecretLabel =\n vaultAccessMode === \"all-apps\"\n ? \"all keys\"\n : selectedSecretIds.length === 0\n ? \"no keys\"\n : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? \"\" : \"s\"}`;\n const selectedResourceLabel =\n selectedResourceIds.length === 0\n ? \"no resources\"\n : `${selectedResourceIds.length} resource${selectedResourceIds.length === 1 ? \"\" : \"s\"}`;\n const selectedAccessLabel = [selectedSecretLabel, selectedResourceLabel].join(\n \" · \",\n );\n\n function toggleSecret(id: string) {\n setSelectedSecretIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n function toggleResource(id: string) {\n setSelectedResourceIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n async function submit(rawPrompt: string) {\n const trimmed = rawPrompt.trim();\n if (!trimmed || isSubmitting) return;\n const appId = titleFromChatFirstAppPrompt(trimmed);\n const validationError = getWorkspaceAppIdValidationError(appId);\n if (validationError) {\n setStatusMessage(validationError);\n return;\n }\n\n const message = buildChatFirstAppCreationPrompt({\n appId,\n prompt: trimmed,\n selectedKeys:\n vaultAccessMode === \"manual\"\n ? selectedSecrets.map((s) => s.credentialKey)\n : [],\n selectedResources,\n vaultAccessMode,\n });\n setIsSubmitting(true);\n setStatusMessage(null);\n setBranchUrl(null);\n setFailureReason(null);\n\n try {\n if (isInBuilderFrame()) {\n sendToAgentChat({ message, submit: true, type: \"code\" });\n setStatusMessage(\"Sent to Builder chat.\");\n onClose?.();\n } else if (isDevMode) {\n sendToAgentChat({ message, submit: true, type: \"code\", newTab: true });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n const result = await fetchJson(\n actionUrl(basePath, \"start-workspace-app-creation\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n prompt: trimmed,\n appId,\n secretIds:\n vaultAccessMode === \"manual\" && selectedSecretIds.length > 0\n ? selectedSecretIds\n : [],\n resourceIds:\n selectedResourceIds.length > 0 ? selectedResourceIds : [],\n }),\n },\n );\n if (result?.mode === \"builder\") {\n setBranchUrl(result?.url || null);\n setStatusMessage(\"Builder branch created.\");\n } else if (result?.mode === \"local-agent\") {\n sendToAgentChat({\n message: result.prompt ?? message,\n submit: true,\n type: \"code\",\n newTab: true,\n reuseEmptyTab: true,\n });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n setStatusMessage(\n result?.message ||\n \"This requires a code change. Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like.\",\n );\n setFailureReason(\n result?.mode === \"builder-unavailable\" ? result.reason : null,\n );\n }\n }\n } catch (err: any) {\n setStatusMessage(err?.message || \"Could not start the new app flow.\");\n setFailureReason(null);\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const submitWithSelectedAccess = () => submit(prompt);\n const isCreatingBuilderBranch =\n isSubmitting && !isInBuilderFrame() && !isDevMode;\n\n if (branchUrl) {\n return (\n <div\n className={`flex min-h-[260px] flex-col items-center justify-center gap-5 px-6 py-8 text-center ${className}`}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary\">\n <IconCheck className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"space-y-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n Your Builder branch is ready\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n Continue building and editing your app in Builder.\n </p>\n </div>\n <Button asChild className=\"w-full sm:w-auto\">\n <a href={branchUrl} target=\"_blank\" rel=\"noreferrer\">\n Open in Builder <IconArrowUpRight aria-hidden=\"true\" />\n </a>\n </Button>\n </div>\n );\n }\n\n if (isCreatingBuilderBranch) {\n return (\n <div\n className={`flex min-h-[260px] flex-col items-center justify-center gap-4 px-6 py-8 text-center ${className}`}\n aria-live=\"polite\"\n >\n <IconLoader2\n className=\"size-7 animate-spin text-muted-foreground\"\n aria-hidden=\"true\"\n />\n <div className=\"space-y-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n Creating your Builder branch\n </h2>\n <p className=\"text-sm leading-6 text-muted-foreground\">\n This usually takes a few seconds.\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`flex flex-col gap-3 ${className}`}>\n {step === \"prompt\" ? (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <p className=\"text-sm font-semibold text-foreground\">Create app</p>\n <button\n type=\"button\"\n onClick={() => setStep(\"access\")}\n className=\"inline-flex cursor-pointer items-center gap-1 rounded-md border border-border bg-background/40 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconKey size={11} />\n {selectedAccessLabel}\n </button>\n </div>\n <PromptComposer\n autoFocus\n disabled={isSubmitting}\n placeholder=\"Describe the app your teammate should be able to use...\"\n draftScope=\"dispatch:create-app\"\n preserveDraftOnSubmit\n onSubmit={(text) => {\n setPrompt(text);\n submit(text);\n }}\n />\n </>\n ) : (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <button\n type=\"button\"\n onClick={() => setStep(\"prompt\")}\n className=\"inline-flex cursor-pointer items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowLeft size={12} />\n Back\n </button>\n <span className=\"text-[11px] text-muted-foreground/70\">\n {selectedAccessLabel}\n </span>\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconKey size={12} />\n Dispatch keys\n </div>\n {vaultAccessMode === \"all-apps\" ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n Every saved Dispatch vault key is available to new apps.\n </p>\n ) : secretsError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {secretsError}\n </p>\n ) : secrets.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch vault keys found yet.\n </p>\n ) : (\n secrets.map((secret) => {\n const selected = selectedSecretIds.includes(secret.id);\n return (\n <div\n key={secret.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleSecret(secret.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">\n {secret.credentialKey}\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {selected\n ? \"Will be requested for this app\"\n : \"Click to request\"}\n </span>\n </span>\n </button>\n {(secret.provider || secret.name) && (\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Provider: {secret.provider || \"Not specified\"}\n </div>\n <div className=\"truncate\">Name: {secret.name}</div>\n </div>\n </details>\n )}\n </div>\n );\n })\n )}\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconBook size={12} />\n Resource packs\n </div>\n {resourcesError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {resourcesError}\n </p>\n ) : resources.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch resource packs found yet.\n </p>\n ) : (\n resources.map((resource) => {\n const selected = selectedResourceIds.includes(resource.id);\n return (\n <div\n key={resource.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleResource(resource.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <IconFileText className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground/70\" />\n <span className=\"block truncate font-medium\">\n {resource.name}\n </span>\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {resource.kind} · {resource.path}\n </span>\n </span>\n </button>\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Scope:{\" \"}\n {resource.scope === \"all\"\n ? \"All apps\"\n : \"Selected apps\"}\n </div>\n {resource.description ? (\n <div className=\"line-clamp-2\">\n {resource.description}\n </div>\n ) : null}\n </div>\n </details>\n </div>\n );\n })\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submitWithSelectedAccess}\n disabled={!prompt.trim() || isSubmitting}\n >\n {isSubmitting ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconPlus className=\"h-3.5 w-3.5\" />\n )}\n Create app\n </Button>\n </div>\n {!prompt.trim() ? (\n <p className=\"px-1 text-[11px] text-muted-foreground/70\">\n Add a prompt on the previous step before creating the app.\n </p>\n ) : null}\n </>\n )}\n\n {statusMessage ? (\n <div\n className={`flex flex-col gap-2 rounded-md border px-3 py-2 text-xs ${\n isErrorFailureReason(failureReason)\n ? \"border-destructive/40 bg-destructive/10 text-destructive\"\n : \"border-border bg-muted/40 text-muted-foreground\"\n }`}\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n {isErrorFailureReason(failureReason) ? (\n <IconAlertTriangle className=\"h-3.5 w-3.5 shrink-0\" />\n ) : null}\n <span>{statusMessage}</span>\n {branchUrl ? (\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 font-medium text-foreground underline\"\n >\n Open in Builder <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n ) : null}\n </div>\n {failureReason === \"builder-not-connected\" ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={() => connectFlow.start()}\n disabled={connectFlow.connecting}\n className=\"w-fit\"\n >\n {connectFlow.connecting ? \"Connecting...\" : \"Connect Builder\"}\n </Button>\n <a\n href={LOCAL_APP_DOCS_URL}\n target=\"_blank\"\n rel=\"noreferrer\"\n data-create-app-local-link\n className=\"inline-flex items-center gap-1 text-xs font-medium text-foreground underline underline-offset-2\"\n >\n Create locally <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n </div>\n ) : null}\n {failureReason === \"credential-store-unavailable\" ||\n failureReason === \"builder-error\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n onClick={submitWithSelectedAccess}\n disabled={isSubmitting}\n className=\"w-fit\"\n >\n Try again\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function CreateAppPopover({\n trigger,\n align = \"center\",\n}: CreateAppPopoverProps) {\n const [open, setOpen] = useState(false);\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {trigger ?? (\n <button\n type=\"button\"\n className=\"flex min-h-32 cursor-pointer items-center justify-center rounded-lg border border-dashed bg-card p-4 text-sm font-medium text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n <span className=\"inline-flex items-center gap-2\">\n <IconPlus size={16} />\n Create app\n </span>\n </button>\n )}\n </PopoverTrigger>\n <PopoverContent\n align={align}\n sideOffset={10}\n className=\"w-[calc(100vw-2rem)] rounded-xl p-3 shadow-xl sm:w-[460px]\"\n >\n <CreateAppFlow onClose={() => setOpen(false)} />\n </PopoverContent>\n </Popover>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch-control-plane.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":"AA+TA,wBAAgB,oBAAoB,oDAwCnC"}
1
+ {"version":3,"file":"dispatch-control-plane.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":"AAuXA,wBAAgB,oBAAoB,oDAwCnC"}
@@ -7,6 +7,7 @@ import { IconChevronDown, IconClockHour4, IconPlus } from "@tabler/icons-react";
7
7
  import { useState } from "react";
8
8
  import { Link, useNavigate } from "react-router";
9
9
  import { cn } from "../lib/utils.js";
10
+ import { orderWorkspaceApps, useWorkspaceAppLayout, workspaceAppMatchesQuery, } from "../lib/workspace-app-layout.js";
10
11
  import { isWorkspaceAppVisibleInDefaultLaunchers, } from "../lib/workspace-apps.js";
11
12
  import { ActionQueryError } from "./action-query-error.js";
12
13
  import { APP_LIST_GRID_CLASS, AppList, APP_LIST_GRID_ROW_CLASS, } from "./app-list-row.js";
@@ -17,6 +18,7 @@ import { Button } from "./ui/button.js";
17
18
  import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "./ui/collapsible.js";
18
19
  import { Skeleton } from "./ui/skeleton.js";
19
20
  import { WorkspaceAppCard } from "./workspace-app-card.js";
21
+ import { WorkspaceAppSearch, WorkspaceAppSearchEmpty, } from "./workspace-app-search.js";
20
22
  function SectionHeader({ title, action, }) {
21
23
  return (_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-3", children: [_jsx("h2", { className: "truncate text-sm font-semibold text-foreground", children: title }), action ? _jsx("div", { className: "shrink-0", children: action }) : null] }));
22
24
  }
@@ -25,9 +27,6 @@ function CommandPanel() {
25
27
  const { availableModels, isLoading: modelListLoading, onEffortChange, onModelChange, selectedEffort, selectedEngine, selectedModel, } = useChatModels({ storageKey: "dispatch" });
26
28
  const navigate = useNavigate();
27
29
  const promptSuggestions = [
28
- t("dispatch.pages.suggestionWorkspaceHealth", {
29
- defaultValue: "Summarize the current workspace health",
30
- }),
31
30
  t("dispatch.pages.suggestionOnboardingApp", {
32
31
  defaultValue: "Create an app for onboarding requests",
33
32
  }),
@@ -62,27 +61,44 @@ function CommandPanel() {
62
61
  function AppsPanel({ apps, isLoading, connectedApps, connectedAppsError, connectedAppsLoading, onRetryConnectedApps, curatedTemplates, curatedTemplatesError, curatedTemplatesLoading, onRetryCuratedTemplates, }) {
63
62
  const t = useT();
64
63
  const [showPending, setShowPending] = useState(false);
64
+ const [searchQuery, setSearchQuery] = useState("");
65
+ const { layout, persistenceError, togglePinned } = useWorkspaceAppLayout();
65
66
  const visibleApps = apps.filter((app) => isWorkspaceAppVisibleInDefaultLaunchers(app) && !app.archived);
66
67
  const activeApps = visibleApps.filter((app) => app.status !== "pending");
67
68
  const pendingApps = visibleApps.filter((app) => app.status === "pending");
69
+ const orderedActiveApps = orderWorkspaceApps(activeApps, layout);
70
+ const orderedPendingApps = orderWorkspaceApps(pendingApps, layout);
71
+ const filteredActiveApps = orderedActiveApps.filter((app) => workspaceAppMatchesQuery(app, searchQuery));
72
+ const filteredPendingApps = orderedPendingApps.filter((app) => workspaceAppMatchesQuery(app, searchQuery));
73
+ const hasSearchResults = filteredActiveApps.length > 0 || filteredPendingApps.length > 0;
68
74
  const otherAppEntries = mergeOtherAppEntries({
69
75
  templates: curatedTemplates,
70
76
  connectedApps,
71
77
  workspaceApps: apps,
72
78
  });
73
79
  const showSkeletons = isLoading && activeApps.length === 0 && pendingApps.length === 0;
74
- return (_jsxs("section", { className: "mx-auto flex w-full max-w-[1000px] flex-col gap-3", children: [_jsx(SectionHeader, { title: "Apps", action: _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/apps", children: "View all" }) }), _jsx(CreateAppPopover, { align: "end", trigger: _jsxs(Button, { variant: "ghost", size: "sm", className: "gap-1.5", children: [_jsx(IconPlus, { size: 14 }), t("dispatch.pages.newApp", { defaultValue: "New" })] }) })] }) }), showSkeletons ? (_jsx(OverviewAppsSkeleton, {})) : (_jsx(_Fragment, { children: _jsxs(AppList, { className: APP_LIST_GRID_CLASS, children: [activeApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: APP_LIST_GRID_ROW_CLASS }, app.id))), activeApps.length === 0 &&
80
+ return (_jsxs("section", { className: "mx-auto flex w-full max-w-[1000px] flex-col gap-3", children: [_jsx(SectionHeader, { title: "Apps", action: _jsxs("div", { className: "flex min-w-0 flex-wrap items-center justify-end gap-1.5", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsx(Link, { to: "/apps", className: "text-muted-foreground", children: "View all" }) }), !showSkeletons && visibleApps.length > 0 ? (_jsx(WorkspaceAppSearch, { className: "w-[220px]", query: searchQuery, onQueryChange: setSearchQuery })) : null, _jsx(CreateAppPopover, { align: "end", trigger: _jsxs(Button, { variant: "default", size: "sm", className: "gap-1.5", children: [_jsx(IconPlus, { size: 14 }), t("dispatch.pages.newApp", { defaultValue: "New" })] }) })] }) }), !showSkeletons && visibleApps.length > 0 && persistenceError ? (_jsx("p", { className: "text-xs text-muted-foreground", role: "status", children: persistenceError === "both"
81
+ ? t("dispatch.pages.appPinSaveFailed", {
82
+ defaultValue: "App pins could not be saved.",
83
+ })
84
+ : t("dispatch.pages.appPinSavedLocally", {
85
+ defaultValue: "App pins are saved on this device only.",
86
+ }) })) : null, showSkeletons ? (_jsx(OverviewAppsSkeleton, {})) : searchQuery.trim() && !hasSearchResults ? (_jsx(WorkspaceAppSearchEmpty, { query: searchQuery, onClear: () => setSearchQuery("") })) : (_jsx(_Fragment, { children: _jsxs(AppList, { className: APP_LIST_GRID_CLASS, children: [filteredActiveApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: APP_LIST_GRID_ROW_CLASS, isPinned: layout.pinnedIds.includes(app.id), onTogglePinned: () => togglePinned(app.id) }, app.id))), filteredActiveApps.length === 0 &&
87
+ !searchQuery.trim() &&
75
88
  otherAppEntries.length === 0 &&
76
89
  !curatedTemplatesLoading &&
77
90
  !connectedAppsLoading &&
78
91
  !curatedTemplatesError &&
79
92
  !connectedAppsError ? (_jsx("p", { className: "px-4 py-3 text-sm text-muted-foreground", children: t("dispatch.pages.noApps", {
80
93
  defaultValue: "No apps yet.",
81
- }) })) : null, _jsx(OtherAppsSection, { templates: curatedTemplates, connectedApps: connectedApps, workspaceApps: apps, templatesLoading: curatedTemplatesLoading, connectedAppsLoading: connectedAppsLoading, templatesError: curatedTemplatesError, connectedAppsError: connectedAppsError, onRetryTemplates: onRetryCuratedTemplates, onRetryConnectedApps: onRetryConnectedApps, heading: null, embeddedInList: true })] }) })), pendingApps.length > 0 ? (_jsx(Collapsible, { open: showPending, onOpenChange: setShowPending, children: _jsxs("div", { className: "space-y-3 border-t pt-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconClockHour4, { size: 15, className: "shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h3", { className: "text-xs font-semibold text-foreground", children: t("dispatch.pages.pendingApps") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.pendingAppsDescription", {
94
+ }) })) : null, !searchQuery.trim() ? (_jsx(OtherAppsSection, { templates: curatedTemplates, connectedApps: connectedApps, workspaceApps: apps, templatesLoading: curatedTemplatesLoading, connectedAppsLoading: connectedAppsLoading, templatesError: curatedTemplatesError, connectedAppsError: connectedAppsError, onRetryTemplates: onRetryCuratedTemplates, onRetryConnectedApps: onRetryConnectedApps, heading: null, embeddedInList: true })) : null] }) })), pendingApps.length > 0 &&
95
+ (!searchQuery.trim() || filteredPendingApps.length > 0) ? (_jsx(Collapsible, { open: showPending || Boolean(searchQuery.trim()), onOpenChange: setShowPending, children: _jsxs("div", { className: "space-y-3 border-t pt-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconClockHour4, { size: 15, className: "shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h3", { className: "text-xs font-semibold text-foreground", children: t("dispatch.pages.pendingApps") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.pendingAppsDescription", {
82
96
  count: pendingApps.length,
83
- }) })] })] }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "h-7 gap-1.5 px-2 text-xs", children: [showPending
97
+ }) })] })] }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "h-7 gap-1.5 px-2 text-xs", children: [showPending || Boolean(searchQuery.trim())
84
98
  ? t("dispatch.pages.hidePendingApps")
85
- : t("dispatch.pages.showPendingApps"), _jsx(IconChevronDown, { size: 13, className: showPending ? "rotate-180" : undefined })] }) })] }), _jsx(CollapsibleContent, { children: _jsx(AppList, { className: APP_LIST_GRID_CLASS, children: pendingApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: APP_LIST_GRID_ROW_CLASS }, app.id))) }) })] }) })) : null] }));
99
+ : t("dispatch.pages.showPendingApps"), _jsx(IconChevronDown, { size: 13, className: showPending || searchQuery.trim()
100
+ ? "rotate-180"
101
+ : undefined })] }) })] }), _jsx(CollapsibleContent, { children: _jsx(AppList, { className: APP_LIST_GRID_CLASS, children: filteredPendingApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: APP_LIST_GRID_ROW_CLASS }, app.id))) }) })] }) })) : null] }));
86
102
  }
87
103
  function OverviewAppsSkeleton() {
88
104
  return (_jsx(AppList, { className: APP_LIST_GRID_CLASS, children: Array.from({ length: 4 }).map((_, index) => (_jsxs("div", { className: cn("flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0", APP_LIST_GRID_ROW_CLASS), children: [_jsx(Skeleton, { className: "size-8 shrink-0 rounded-xl" }), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-2/3" })] }), _jsx(Skeleton, { className: "h-9 w-24 shrink-0 rounded-md" })] }, index))) }));
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch-control-plane.js","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mCAAmC,EACnC,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,uCAAuC,GAExC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,OAAO,EACP,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO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,kBAAkB,CAAC,IAAI,IAAI,EAAE,EAC5C,kBAAkB,EAAE,kBAAkB,CAAC,KAAK,EAC5C,oBAAoB,EAAE,kBAAkB,CAAC,SAAS,EAClD,oBAAoB,EAAE,GAAG,EAAE,CAAC,KAAK,kBAAkB,CAAC,OAAO,EAAE,EAC7D,gBAAgB,EAAE,qBAAqB,CAAC,IAAI,EAC5C,qBAAqB,EAAE,qBAAqB,CAAC,KAAK,EAClD,uBAAuB,EAAE,qBAAqB,CAAC,SAAS,EACxD,uBAAuB,EAAE,GAAG,EAAE,CAAC,KAAK,qBAAqB,CAAC,OAAO,EAAE,GACnE,CACH,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n navigateWithAgentChatViewTransition,\n useChatModels,\n} from \"@agent-native/core/client/agent-chat\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronDown, IconClockHour4, IconPlus } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { cn } from \"../lib/utils\";\nimport {\n isWorkspaceAppVisibleInDefaultLaunchers,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport {\n APP_LIST_GRID_CLASS,\n AppList,\n APP_LIST_GRID_ROW_CLASS,\n} from \"./app-list-row\";\nimport { CreateAppPopover } from \"./create-app-popover\";\nimport { useSetPageTitle } from \"./layout/HeaderActions\";\nimport { mergeOtherAppEntries, OtherAppsSection } from \"./other-apps-section\";\nimport { Button } from \"./ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"./ui/collapsible\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { WorkspaceAppCard } from \"./workspace-app-card\";\nimport type { CuratedWorkspaceTemplatesResult } from \"./workspace-template-card\";\n\nfunction SectionHeader({\n title,\n action,\n}: {\n title: string;\n action?: ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {title}\n </h2>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n );\n}\n\nfunction CommandPanel() {\n const t = useT();\n const {\n availableModels,\n isLoading: modelListLoading,\n onEffortChange,\n onModelChange,\n selectedEffort,\n selectedEngine,\n selectedModel,\n } = useChatModels({ storageKey: \"dispatch\" });\n const navigate = useNavigate();\n const promptSuggestions = [\n t(\"dispatch.pages.suggestionWorkspaceHealth\", {\n defaultValue: \"Summarize the current workspace health\",\n }),\n t(\"dispatch.pages.suggestionOnboardingApp\", {\n defaultValue: \"Create an app for onboarding requests\",\n }),\n t(\"dispatch.pages.suggestionAnalyticsAgents\", {\n defaultValue: \"Check which agents can help with analytics\",\n }),\n ];\n\n function send(message: string) {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n navigateWithAgentChatViewTransition(navigate, \"/chat\", {\n state: {\n dispatchPrompt: {\n id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n message: trimmed,\n selectedModel,\n selectedEngine,\n selectedEffort,\n },\n },\n });\n }\n\n return (\n <section className=\"flex flex-col\">\n <div className=\"mx-auto flex w-full max-w-[750px] flex-col pt-4 sm:pt-6\">\n <div className=\"mb-5 text-center\">\n <h2 className=\"text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n {t(\"dispatch.pages.chatAcrossApps\", {\n defaultValue: \"Chat across your apps\",\n })}\n </h2>\n <p className=\"mx-auto mt-2 max-w-xl text-sm leading-6 text-muted-foreground\">\n {t(\"dispatch.pages.chatAcrossAppsDescription\", {\n defaultValue:\n \"Route work, inspect status, or create something new from one place.\",\n })}\n </p>\n </div>\n <PromptComposer\n availableModels={availableModels}\n modelListLoading={modelListLoading}\n placeholder={t(\"dispatch.pages.overviewPromptPlaceholder\", {\n defaultValue: \"Ask Dispatch anything...\",\n })}\n selectedEffort={selectedEffort}\n selectedEngine={selectedEngine}\n selectedModel={selectedModel}\n rootClassName=\"bg-card\"\n onEffortChange={onEffortChange}\n onModelChange={onModelChange}\n onSubmit={(text) => send(text)}\n />\n <div className=\"mt-3 flex flex-wrap justify-center gap-2\">\n {promptSuggestions.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-md border border-transparent bg-muted/60 px-2.5 py-1.5 text-xs text-muted-foreground transition-[background-color,color] hover:bg-muted hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppsPanel({\n apps,\n isLoading,\n connectedApps,\n connectedAppsError,\n connectedAppsLoading,\n onRetryConnectedApps,\n curatedTemplates,\n curatedTemplatesError,\n curatedTemplatesLoading,\n onRetryCuratedTemplates,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n connectedApps: ConnectedAppSummary[];\n connectedAppsError?: Error | null;\n connectedAppsLoading: boolean;\n onRetryConnectedApps: () => void;\n curatedTemplates?: CuratedWorkspaceTemplatesResult;\n curatedTemplatesError?: Error | null;\n curatedTemplatesLoading: boolean;\n onRetryCuratedTemplates: () => void;\n}) {\n const t = useT();\n const [showPending, setShowPending] = useState(false);\n const visibleApps = apps.filter(\n (app) => isWorkspaceAppVisibleInDefaultLaunchers(app) && !app.archived,\n );\n const activeApps = visibleApps.filter((app) => app.status !== \"pending\");\n const pendingApps = visibleApps.filter((app) => app.status === \"pending\");\n const otherAppEntries = mergeOtherAppEntries({\n templates: curatedTemplates,\n connectedApps,\n workspaceApps: apps,\n });\n const showSkeletons =\n isLoading && activeApps.length === 0 && pendingApps.length === 0;\n\n return (\n <section className=\"mx-auto flex w-full max-w-[1000px] flex-col gap-3\">\n <SectionHeader\n title=\"Apps\"\n action={\n <div className=\"flex items-center gap-1.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/apps\">View all</Link>\n </Button>\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button variant=\"ghost\" size=\"sm\" className=\"gap-1.5\">\n <IconPlus size={14} />\n {t(\"dispatch.pages.newApp\", { defaultValue: \"New\" })}\n </Button>\n }\n />\n </div>\n }\n />\n {showSkeletons ? (\n <OverviewAppsSkeleton />\n ) : (\n <>\n <AppList className={APP_LIST_GRID_CLASS}>\n {activeApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n />\n ))}\n {activeApps.length === 0 &&\n otherAppEntries.length === 0 &&\n !curatedTemplatesLoading &&\n !connectedAppsLoading &&\n !curatedTemplatesError &&\n !connectedAppsError ? (\n <p className=\"px-4 py-3 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noApps\", {\n defaultValue: \"No apps yet.\",\n })}\n </p>\n ) : null}\n <OtherAppsSection\n templates={curatedTemplates}\n connectedApps={connectedApps}\n workspaceApps={apps}\n templatesLoading={curatedTemplatesLoading}\n connectedAppsLoading={connectedAppsLoading}\n templatesError={curatedTemplatesError}\n connectedAppsError={connectedAppsError}\n onRetryTemplates={onRetryCuratedTemplates}\n onRetryConnectedApps={onRetryConnectedApps}\n heading={null}\n embeddedInList\n />\n </AppList>\n </>\n )}\n {pendingApps.length > 0 ? (\n <Collapsible open={showPending} onOpenChange={setShowPending}>\n <div className=\"space-y-3 border-t pt-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconClockHour4\n size={15}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h3 className=\"text-xs font-semibold text-foreground\">\n {t(\"dispatch.pages.pendingApps\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.pendingAppsDescription\", {\n count: pendingApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 gap-1.5 px-2 text-xs\"\n >\n {showPending\n ? t(\"dispatch.pages.hidePendingApps\")\n : t(\"dispatch.pages.showPendingApps\")}\n <IconChevronDown\n size={13}\n className={showPending ? \"rotate-180\" : undefined}\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <AppList className={APP_LIST_GRID_CLASS}>\n {pendingApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n />\n ))}\n </AppList>\n </CollapsibleContent>\n </div>\n </Collapsible>\n ) : null}\n </section>\n );\n}\n\nfunction OverviewAppsSkeleton() {\n return (\n <AppList className={APP_LIST_GRID_CLASS}>\n {Array.from({ length: 4 }).map((_, index) => (\n <div\n key={index}\n className={cn(\n \"flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0\",\n APP_LIST_GRID_ROW_CLASS,\n )}\n >\n <Skeleton className=\"size-8 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n <Skeleton className=\"h-9 w-24 shrink-0 rounded-md\" />\n </div>\n ))}\n </AppList>\n );\n}\n\nexport function DispatchControlPlane() {\n useSetPageTitle(<span aria-hidden />);\n const appsQuery = useActionQuery<WorkspaceAppSummary[]>(\n \"list-workspace-apps\",\n { includeAgentCards: false, includeArchived: true },\n );\n const connectedAppsQuery = useActionQuery<ConnectedAppSummary[]>(\n \"list-connected-agents\",\n {},\n );\n const curatedTemplatesQuery = useActionQuery<CuratedWorkspaceTemplatesResult>(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: workspaceApps = [], isLoading: appsLoading } = appsQuery;\n\n return (\n <div className=\"flex flex-col gap-8\">\n <CommandPanel />\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : (\n <AppsPanel\n apps={workspaceApps ?? []}\n isLoading={appsLoading}\n connectedApps={connectedAppsQuery.data ?? []}\n connectedAppsError={connectedAppsQuery.error}\n connectedAppsLoading={connectedAppsQuery.isLoading}\n onRetryConnectedApps={() => void connectedAppsQuery.refetch()}\n curatedTemplates={curatedTemplatesQuery.data}\n curatedTemplatesError={curatedTemplatesQuery.error}\n curatedTemplatesLoading={curatedTemplatesQuery.isLoading}\n onRetryCuratedTemplates={() => void curatedTemplatesQuery.refetch()}\n />\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"dispatch-control-plane.js","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mCAAmC,EACnC,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uCAAuC,GAExC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,OAAO,EACP,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAA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AG,EAAE,CAAC,KAAK,qBAAqB,CAAC,OAAO,EAAE,GACnE,CACH,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n navigateWithAgentChatViewTransition,\n useChatModels,\n} from \"@agent-native/core/client/agent-chat\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronDown, IconClockHour4, IconPlus } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { cn } from \"../lib/utils\";\nimport {\n orderWorkspaceApps,\n useWorkspaceAppLayout,\n workspaceAppMatchesQuery,\n} from \"../lib/workspace-app-layout\";\nimport {\n isWorkspaceAppVisibleInDefaultLaunchers,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport {\n APP_LIST_GRID_CLASS,\n AppList,\n APP_LIST_GRID_ROW_CLASS,\n} from \"./app-list-row\";\nimport { CreateAppPopover } from \"./create-app-popover\";\nimport { useSetPageTitle } from \"./layout/HeaderActions\";\nimport { mergeOtherAppEntries, OtherAppsSection } from \"./other-apps-section\";\nimport { Button } from \"./ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"./ui/collapsible\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { WorkspaceAppCard } from \"./workspace-app-card\";\nimport {\n WorkspaceAppSearch,\n WorkspaceAppSearchEmpty,\n} from \"./workspace-app-search\";\nimport type { CuratedWorkspaceTemplatesResult } from \"./workspace-template-card\";\n\nfunction SectionHeader({\n title,\n action,\n}: {\n title: string;\n action?: ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {title}\n </h2>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n );\n}\n\nfunction CommandPanel() {\n const t = useT();\n const {\n availableModels,\n isLoading: modelListLoading,\n onEffortChange,\n onModelChange,\n selectedEffort,\n selectedEngine,\n selectedModel,\n } = useChatModels({ storageKey: \"dispatch\" });\n const navigate = useNavigate();\n const promptSuggestions = [\n t(\"dispatch.pages.suggestionOnboardingApp\", {\n defaultValue: \"Create an app for onboarding requests\",\n }),\n t(\"dispatch.pages.suggestionAnalyticsAgents\", {\n defaultValue: \"Check which agents can help with analytics\",\n }),\n ];\n\n function send(message: string) {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n navigateWithAgentChatViewTransition(navigate, \"/chat\", {\n state: {\n dispatchPrompt: {\n id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n message: trimmed,\n selectedModel,\n selectedEngine,\n selectedEffort,\n },\n },\n });\n }\n\n return (\n <section className=\"flex flex-col\">\n <div className=\"mx-auto flex w-full max-w-[750px] flex-col pt-4 sm:pt-6\">\n <div className=\"mb-5 text-center\">\n <h2 className=\"text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n {t(\"dispatch.pages.chatAcrossApps\", {\n defaultValue: \"Chat across your apps\",\n })}\n </h2>\n <p className=\"mx-auto mt-2 max-w-xl text-sm leading-6 text-muted-foreground\">\n {t(\"dispatch.pages.chatAcrossAppsDescription\", {\n defaultValue:\n \"Route work, inspect status, or create something new from one place.\",\n })}\n </p>\n </div>\n <PromptComposer\n availableModels={availableModels}\n modelListLoading={modelListLoading}\n placeholder={t(\"dispatch.pages.overviewPromptPlaceholder\", {\n defaultValue: \"Ask Dispatch anything...\",\n })}\n selectedEffort={selectedEffort}\n selectedEngine={selectedEngine}\n selectedModel={selectedModel}\n rootClassName=\"bg-card\"\n onEffortChange={onEffortChange}\n onModelChange={onModelChange}\n onSubmit={(text) => send(text)}\n />\n <div className=\"mt-3 flex flex-wrap justify-center gap-2\">\n {promptSuggestions.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-md border border-transparent bg-muted/60 px-2.5 py-1.5 text-xs text-muted-foreground transition-[background-color,color] hover:bg-muted hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppsPanel({\n apps,\n isLoading,\n connectedApps,\n connectedAppsError,\n connectedAppsLoading,\n onRetryConnectedApps,\n curatedTemplates,\n curatedTemplatesError,\n curatedTemplatesLoading,\n onRetryCuratedTemplates,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n connectedApps: ConnectedAppSummary[];\n connectedAppsError?: Error | null;\n connectedAppsLoading: boolean;\n onRetryConnectedApps: () => void;\n curatedTemplates?: CuratedWorkspaceTemplatesResult;\n curatedTemplatesError?: Error | null;\n curatedTemplatesLoading: boolean;\n onRetryCuratedTemplates: () => void;\n}) {\n const t = useT();\n const [showPending, setShowPending] = useState(false);\n const [searchQuery, setSearchQuery] = useState(\"\");\n const { layout, persistenceError, togglePinned } = useWorkspaceAppLayout();\n const visibleApps = apps.filter(\n (app) => isWorkspaceAppVisibleInDefaultLaunchers(app) && !app.archived,\n );\n const activeApps = visibleApps.filter((app) => app.status !== \"pending\");\n const pendingApps = visibleApps.filter((app) => app.status === \"pending\");\n const orderedActiveApps = orderWorkspaceApps(activeApps, layout);\n const orderedPendingApps = orderWorkspaceApps(pendingApps, layout);\n const filteredActiveApps = orderedActiveApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const filteredPendingApps = orderedPendingApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const hasSearchResults =\n filteredActiveApps.length > 0 || filteredPendingApps.length > 0;\n const otherAppEntries = mergeOtherAppEntries({\n templates: curatedTemplates,\n connectedApps,\n workspaceApps: apps,\n });\n const showSkeletons =\n isLoading && activeApps.length === 0 && pendingApps.length === 0;\n\n return (\n <section className=\"mx-auto flex w-full max-w-[1000px] flex-col gap-3\">\n <SectionHeader\n title=\"Apps\"\n action={\n <div className=\"flex min-w-0 flex-wrap items-center justify-end gap-1.5\">\n <Button variant=\"ghost\" size=\"sm\" asChild>\n <Link to=\"/apps\" className=\"text-muted-foreground\">\n View all\n </Link>\n </Button>\n {!showSkeletons && visibleApps.length > 0 ? (\n <WorkspaceAppSearch\n className=\"w-[220px]\"\n query={searchQuery}\n onQueryChange={setSearchQuery}\n />\n ) : null}\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button variant=\"default\" size=\"sm\" className=\"gap-1.5\">\n <IconPlus size={14} />\n {t(\"dispatch.pages.newApp\", { defaultValue: \"New\" })}\n </Button>\n }\n />\n </div>\n }\n />\n {!showSkeletons && visibleApps.length > 0 && persistenceError ? (\n <p className=\"text-xs text-muted-foreground\" role=\"status\">\n {persistenceError === \"both\"\n ? t(\"dispatch.pages.appPinSaveFailed\", {\n defaultValue: \"App pins could not be saved.\",\n })\n : t(\"dispatch.pages.appPinSavedLocally\", {\n defaultValue: \"App pins are saved on this device only.\",\n })}\n </p>\n ) : null}\n {showSkeletons ? (\n <OverviewAppsSkeleton />\n ) : searchQuery.trim() && !hasSearchResults ? (\n <WorkspaceAppSearchEmpty\n query={searchQuery}\n onClear={() => setSearchQuery(\"\")}\n />\n ) : (\n <>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredActiveApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n isPinned={layout.pinnedIds.includes(app.id)}\n onTogglePinned={() => togglePinned(app.id)}\n />\n ))}\n {filteredActiveApps.length === 0 &&\n !searchQuery.trim() &&\n otherAppEntries.length === 0 &&\n !curatedTemplatesLoading &&\n !connectedAppsLoading &&\n !curatedTemplatesError &&\n !connectedAppsError ? (\n <p className=\"px-4 py-3 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noApps\", {\n defaultValue: \"No apps yet.\",\n })}\n </p>\n ) : null}\n {!searchQuery.trim() ? (\n <OtherAppsSection\n templates={curatedTemplates}\n connectedApps={connectedApps}\n workspaceApps={apps}\n templatesLoading={curatedTemplatesLoading}\n connectedAppsLoading={connectedAppsLoading}\n templatesError={curatedTemplatesError}\n connectedAppsError={connectedAppsError}\n onRetryTemplates={onRetryCuratedTemplates}\n onRetryConnectedApps={onRetryConnectedApps}\n heading={null}\n embeddedInList\n />\n ) : null}\n </AppList>\n </>\n )}\n {pendingApps.length > 0 &&\n (!searchQuery.trim() || filteredPendingApps.length > 0) ? (\n <Collapsible\n open={showPending || Boolean(searchQuery.trim())}\n onOpenChange={setShowPending}\n >\n <div className=\"space-y-3 border-t pt-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconClockHour4\n size={15}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h3 className=\"text-xs font-semibold text-foreground\">\n {t(\"dispatch.pages.pendingApps\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.pendingAppsDescription\", {\n count: pendingApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 gap-1.5 px-2 text-xs\"\n >\n {showPending || Boolean(searchQuery.trim())\n ? t(\"dispatch.pages.hidePendingApps\")\n : t(\"dispatch.pages.showPendingApps\")}\n <IconChevronDown\n size={13}\n className={\n showPending || searchQuery.trim()\n ? \"rotate-180\"\n : undefined\n }\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredPendingApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n />\n ))}\n </AppList>\n </CollapsibleContent>\n </div>\n </Collapsible>\n ) : null}\n </section>\n );\n}\n\nfunction OverviewAppsSkeleton() {\n return (\n <AppList className={APP_LIST_GRID_CLASS}>\n {Array.from({ length: 4 }).map((_, index) => (\n <div\n key={index}\n className={cn(\n \"flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0\",\n APP_LIST_GRID_ROW_CLASS,\n )}\n >\n <Skeleton className=\"size-8 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n <Skeleton className=\"h-9 w-24 shrink-0 rounded-md\" />\n </div>\n ))}\n </AppList>\n );\n}\n\nexport function DispatchControlPlane() {\n useSetPageTitle(<span aria-hidden />);\n const appsQuery = useActionQuery<WorkspaceAppSummary[]>(\n \"list-workspace-apps\",\n { includeAgentCards: false, includeArchived: true },\n );\n const connectedAppsQuery = useActionQuery<ConnectedAppSummary[]>(\n \"list-connected-agents\",\n {},\n );\n const curatedTemplatesQuery = useActionQuery<CuratedWorkspaceTemplatesResult>(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: workspaceApps = [], isLoading: appsLoading } = appsQuery;\n\n return (\n <div className=\"flex flex-col gap-8\">\n <CommandPanel />\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : (\n <AppsPanel\n apps={workspaceApps ?? []}\n isLoading={appsLoading}\n connectedApps={connectedAppsQuery.data ?? []}\n connectedAppsError={connectedAppsQuery.error}\n connectedAppsLoading={connectedAppsQuery.isLoading}\n onRetryConnectedApps={() => void connectedAppsQuery.refetch()}\n curatedTemplates={curatedTemplatesQuery.data}\n curatedTemplatesError={curatedTemplatesQuery.error}\n curatedTemplatesLoading={curatedTemplatesQuery.isLoading}\n onRetryCuratedTemplates={() => void curatedTemplatesQuery.refetch()}\n />\n )}\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch-shell.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,mDA+BA"}
1
+ {"version":3,"file":"dispatch-shell.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,mDAmCA"}
@@ -1,6 +1,8 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useT } from "@agent-native/core/client/i18n";
3
3
  import { IconInfoCircle } from "@tabler/icons-react";
4
+ import { useLocation } from "react-router";
5
+ import { dispatchDocsHrefForPath, DocsLink } from "./docs-link.js";
4
6
  import { useSetPageTitle } from "./layout/HeaderActions.js";
5
7
  import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover.js";
6
8
  /**
@@ -11,7 +13,9 @@ import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover.js";
11
13
  */
12
14
  export function DispatchShell({ title, description, children, }) {
13
15
  const t = useT();
14
- useSetPageTitle(_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("h1", { className: "text-lg font-semibold tracking-tight truncate text-foreground", children: title }), description ? (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground cursor-pointer", "aria-label": t("dispatch.sidebar.aboutPage", { title }), children: _jsx(IconInfoCircle, { className: "h-3.5 w-3.5" }) }) }), _jsx(PopoverContent, { side: "bottom", align: "start", className: "max-w-72 text-xs leading-relaxed", children: description })] })) : null] }));
16
+ const location = useLocation();
17
+ const docsHref = dispatchDocsHrefForPath(location.pathname);
18
+ useSetPageTitle(_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx("h1", { className: "text-lg font-semibold tracking-tight truncate text-foreground", children: title }), docsHref ? (_jsx(DocsLink, { href: docsHref, label: `Open ${title} documentation` })) : description ? (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground cursor-pointer", "aria-label": t("dispatch.sidebar.aboutPage", { title }), children: _jsx(IconInfoCircle, { className: "h-3.5 w-3.5" }) }) }), _jsx(PopoverContent, { side: "bottom", align: "start", className: "max-w-72 text-xs leading-relaxed", children: description })] })) : null] }));
15
19
  return _jsx(_Fragment, { children: children });
16
20
  }
17
21
  //# sourceMappingURL=dispatch-shell.js.map