@agent-native/dispatch 0.24.0 → 0.24.2

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 (161) 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/app-list-row.d.ts +1 -1
  6. package/dist/components/app-list-row.d.ts.map +1 -1
  7. package/dist/components/app-list-row.js +1 -1
  8. package/dist/components/app-list-row.js.map +1 -1
  9. package/dist/components/app-open-actions.d.ts +1 -17
  10. package/dist/components/app-open-actions.d.ts.map +1 -1
  11. package/dist/components/app-open-actions.js +1 -20
  12. package/dist/components/app-open-actions.js.map +1 -1
  13. package/dist/components/app-row-settings.d.ts +6 -0
  14. package/dist/components/app-row-settings.d.ts.map +1 -0
  15. package/dist/components/app-row-settings.js +11 -0
  16. package/dist/components/app-row-settings.js.map +1 -0
  17. package/dist/components/automation-run-history-dialog.d.ts.map +1 -1
  18. package/dist/components/automation-run-history-dialog.js +3 -2
  19. package/dist/components/automation-run-history-dialog.js.map +1 -1
  20. package/dist/components/connected-app-card.d.ts.map +1 -1
  21. package/dist/components/connected-app-card.js +1 -1
  22. package/dist/components/connected-app-card.js.map +1 -1
  23. package/dist/components/create-app-popover.js +2 -2
  24. package/dist/components/create-app-popover.js.map +1 -1
  25. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  26. package/dist/components/dispatch-control-plane.js +23 -7
  27. package/dist/components/dispatch-control-plane.js.map +1 -1
  28. package/dist/components/dispatch-shell.d.ts.map +1 -1
  29. package/dist/components/dispatch-shell.js +5 -1
  30. package/dist/components/dispatch-shell.js.map +1 -1
  31. package/dist/components/docs-link.d.ts +16 -0
  32. package/dist/components/docs-link.d.ts.map +1 -0
  33. package/dist/components/docs-link.js +34 -0
  34. package/dist/components/docs-link.js.map +1 -0
  35. package/dist/components/layout/Layout.d.ts +1 -0
  36. package/dist/components/layout/Layout.d.ts.map +1 -1
  37. package/dist/components/layout/Layout.js +37 -28
  38. package/dist/components/layout/Layout.js.map +1 -1
  39. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  40. package/dist/components/messaging-setup-panel.js +3 -2
  41. package/dist/components/messaging-setup-panel.js.map +1 -1
  42. package/dist/components/usage-alerts-panel.d.ts +11 -0
  43. package/dist/components/usage-alerts-panel.d.ts.map +1 -0
  44. package/dist/components/usage-alerts-panel.js +125 -0
  45. package/dist/components/usage-alerts-panel.js.map +1 -0
  46. package/dist/components/workspace-app-card.d.ts +3 -1
  47. package/dist/components/workspace-app-card.d.ts.map +1 -1
  48. package/dist/components/workspace-app-card.js +70 -29
  49. package/dist/components/workspace-app-card.js.map +1 -1
  50. package/dist/components/workspace-app-search.d.ts +10 -0
  51. package/dist/components/workspace-app-search.d.ts.map +1 -0
  52. package/dist/components/workspace-app-search.js +27 -0
  53. package/dist/components/workspace-app-search.js.map +1 -0
  54. package/dist/components/workspace-resource-effective-stack.d.ts.map +1 -1
  55. package/dist/components/workspace-resource-effective-stack.js +3 -2
  56. package/dist/components/workspace-resource-effective-stack.js.map +1 -1
  57. package/dist/components/workspace-template-card.d.ts.map +1 -1
  58. package/dist/components/workspace-template-card.js +2 -1
  59. package/dist/components/workspace-template-card.js.map +1 -1
  60. package/dist/lib/workspace-app-layout.d.ts +19 -0
  61. package/dist/lib/workspace-app-layout.d.ts.map +1 -0
  62. package/dist/lib/workspace-app-layout.js +75 -0
  63. package/dist/lib/workspace-app-layout.js.map +1 -0
  64. package/dist/lib/workspace-apps.d.ts +10 -0
  65. package/dist/lib/workspace-apps.d.ts.map +1 -1
  66. package/dist/lib/workspace-apps.js +59 -0
  67. package/dist/lib/workspace-apps.js.map +1 -1
  68. package/dist/lib/workspace-apps.test.js +18 -1
  69. package/dist/lib/workspace-apps.test.js.map +1 -1
  70. package/dist/routes/pages/$appId.d.ts.map +1 -1
  71. package/dist/routes/pages/$appId.js +4 -2
  72. package/dist/routes/pages/$appId.js.map +1 -1
  73. package/dist/routes/pages/agents.d.ts.map +1 -1
  74. package/dist/routes/pages/agents.js +2 -3
  75. package/dist/routes/pages/agents.js.map +1 -1
  76. package/dist/routes/pages/apps.$appId.d.ts.map +1 -1
  77. package/dist/routes/pages/apps.$appId.js +8 -3
  78. package/dist/routes/pages/apps.$appId.js.map +1 -1
  79. package/dist/routes/pages/apps.d.ts.map +1 -1
  80. package/dist/routes/pages/apps.js +31 -16
  81. package/dist/routes/pages/apps.js.map +1 -1
  82. package/dist/routes/pages/audit.d.ts.map +1 -1
  83. package/dist/routes/pages/audit.js +2 -1
  84. package/dist/routes/pages/audit.js.map +1 -1
  85. package/dist/routes/pages/dreams.d.ts.map +1 -1
  86. package/dist/routes/pages/dreams.js +14 -18
  87. package/dist/routes/pages/dreams.js.map +1 -1
  88. package/dist/routes/pages/integrations.d.ts.map +1 -1
  89. package/dist/routes/pages/integrations.js +51 -14
  90. package/dist/routes/pages/integrations.js.map +1 -1
  91. package/dist/routes/pages/metrics.d.ts.map +1 -1
  92. package/dist/routes/pages/metrics.js +4 -1
  93. package/dist/routes/pages/metrics.js.map +1 -1
  94. package/dist/routes/pages/operations.js +1 -1
  95. package/dist/routes/pages/operations.js.map +1 -1
  96. package/dist/routes/pages/settings.d.ts.map +1 -1
  97. package/dist/routes/pages/settings.js +7 -2
  98. package/dist/routes/pages/settings.js.map +1 -1
  99. package/dist/routes/pages/thread-debug.d.ts.map +1 -1
  100. package/dist/routes/pages/thread-debug.js +5 -8
  101. package/dist/routes/pages/thread-debug.js.map +1 -1
  102. package/dist/routes/pages/vault.d.ts.map +1 -1
  103. package/dist/routes/pages/vault.js +1 -1
  104. package/dist/routes/pages/vault.js.map +1 -1
  105. package/dist/routes/pages/workspace.d.ts.map +1 -1
  106. package/dist/routes/pages/workspace.js +13 -10
  107. package/dist/routes/pages/workspace.js.map +1 -1
  108. package/dist/server/index.d.ts.map +1 -1
  109. package/dist/server/index.js +3 -0
  110. package/dist/server/index.js.map +1 -1
  111. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  112. package/dist/server/lib/app-creation-store.js +12 -52
  113. package/dist/server/lib/app-creation-store.js.map +1 -1
  114. package/dist/shared/app-roles.d.ts +9 -0
  115. package/dist/shared/app-roles.d.ts.map +1 -0
  116. package/dist/shared/app-roles.js +7 -0
  117. package/dist/shared/app-roles.js.map +1 -0
  118. package/package.json +4 -3
  119. package/src/components/admin-navigation.tsx +57 -11
  120. package/src/components/app-list-row.tsx +1 -2
  121. package/src/components/app-open-actions.tsx +5 -114
  122. package/src/components/app-row-settings.tsx +54 -0
  123. package/src/components/automation-run-history-dialog.tsx +8 -4
  124. package/src/components/connected-app-card.tsx +0 -1
  125. package/src/components/create-app-popover.spec.tsx +1 -1
  126. package/src/components/create-app-popover.tsx +2 -2
  127. package/src/components/dispatch-control-plane.spec.tsx +36 -2
  128. package/src/components/dispatch-control-plane.tsx +83 -27
  129. package/src/components/dispatch-shell.tsx +7 -1
  130. package/src/components/docs-link.tsx +52 -0
  131. package/src/components/layout/Layout.spec.tsx +10 -0
  132. package/src/components/layout/Layout.tsx +50 -23
  133. package/src/components/messaging-setup-panel.tsx +10 -3
  134. package/src/components/usage-alerts-panel.tsx +445 -0
  135. package/src/components/workspace-app-card.spec.tsx +130 -9
  136. package/src/components/workspace-app-card.tsx +128 -71
  137. package/src/components/workspace-app-search.tsx +96 -0
  138. package/src/components/workspace-resource-effective-stack.tsx +10 -5
  139. package/src/components/workspace-template-card.spec.tsx +52 -23
  140. package/src/components/workspace-template-card.tsx +7 -10
  141. package/src/lib/workspace-app-layout.spec.ts +47 -0
  142. package/src/lib/workspace-app-layout.ts +121 -0
  143. package/src/lib/workspace-apps.test.ts +45 -1
  144. package/src/lib/workspace-apps.ts +72 -0
  145. package/src/routes/pages/$appId.tsx +3 -6
  146. package/src/routes/pages/agents.tsx +6 -3
  147. package/src/routes/pages/apps.$appId.tsx +6 -6
  148. package/src/routes/pages/apps.tsx +116 -62
  149. package/src/routes/pages/audit.tsx +28 -8
  150. package/src/routes/pages/dreams.tsx +92 -142
  151. package/src/routes/pages/integrations.tsx +147 -68
  152. package/src/routes/pages/metrics.tsx +8 -0
  153. package/src/routes/pages/operations.tsx +2 -2
  154. package/src/routes/pages/settings.tsx +14 -9
  155. package/src/routes/pages/thread-debug.tsx +18 -36
  156. package/src/routes/pages/vault.tsx +7 -2
  157. package/src/routes/pages/workspace.tsx +92 -56
  158. package/src/server/index.ts +4 -0
  159. package/src/server/lib/app-creation-store.spec.ts +90 -43
  160. package/src/server/lib/app-creation-store.ts +15 -61
  161. package/src/shared/app-roles.ts +8 -0
@@ -49,7 +49,7 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
49
49
  }, {
50
50
  id?: undefined;
51
51
  deleted?: undefined;
52
- message?: undefined;
52
+ provider?: undefined;
53
53
  providers: {
54
54
  id: string;
55
55
  label: string;
@@ -60,45 +60,45 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
60
60
  updatedAt: number;
61
61
  }[];
62
62
  count: number;
63
- provider?: undefined;
64
63
  found?: undefined;
65
64
  registered?: undefined;
66
65
  label?: undefined;
66
+ message?: undefined;
67
67
  } | {
68
- count?: undefined;
69
68
  id?: undefined;
70
69
  deleted?: undefined;
71
- message?: undefined;
72
70
  providers?: undefined;
71
+ count?: undefined;
73
72
  found: boolean;
74
73
  provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
75
74
  registered?: undefined;
76
75
  label?: undefined;
76
+ message?: undefined;
77
77
  } | {
78
- count?: undefined;
79
78
  deleted?: undefined;
80
- message?: undefined;
81
- providers?: undefined;
82
79
  provider?: undefined;
80
+ providers?: undefined;
81
+ count?: undefined;
83
82
  found: boolean;
84
83
  id: string;
85
84
  registered?: undefined;
86
85
  label?: undefined;
87
- } | {
88
- count?: undefined;
89
86
  message?: undefined;
90
- providers?: undefined;
87
+ } | {
91
88
  provider?: undefined;
89
+ providers?: undefined;
90
+ count?: undefined;
92
91
  found?: undefined;
93
92
  deleted: boolean;
94
93
  id: string;
95
94
  registered?: undefined;
96
95
  label?: undefined;
96
+ message?: undefined;
97
97
  } | {
98
- count?: undefined;
99
98
  deleted?: undefined;
100
- providers?: undefined;
101
99
  provider?: undefined;
100
+ providers?: undefined;
101
+ count?: undefined;
102
102
  found?: undefined;
103
103
  registered: boolean;
104
104
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"admin-navigation.d.ts","sourceRoot":"","sources":["../../src/components/admin-navigation.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CACnC;AAED,QAAA,MAAM,yBAAyB,EAAE,SAAS,aAAa,EAoItD,CAAC;AAwCF,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,mDAmDA;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,wBAAgB,iBAAiB,IAAI,SAAS,aAAa,EAAE,CAiB5D"}
1
+ {"version":3,"file":"admin-navigation.d.ts","sourceRoot":"","sources":["../../src/components/admin-navigation.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CACnC;AAED,QAAA,MAAM,yBAAyB,EAAE,SAAS,aAAa,EAoItD,CAAC;AAwCF,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,mDA8FA;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,wBAAgB,iBAAiB,IAAI,SAAS,aAAa,EAAE,CAiB5D"}
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useT } from "@agent-native/core/client/i18n";
3
- import { IconActivity, IconArrowUpRight, IconBrain, IconBrandTelegram, IconChartBar, IconFingerprint, IconHistory, IconKey, IconLayersSubtract, IconMail, IconMessages, IconPlugConnected, IconPuzzle, IconSettingsAutomation, IconShield, IconShieldCheck, } from "@tabler/icons-react";
3
+ import { IconActivity, IconArrowUpRight, IconBrain, IconBrandTelegram, IconChartBar, IconFingerprint, IconHistory, IconKey, IconLayersSubtract, IconMail, IconMessages, IconPlugConnected, IconPuzzle, IconSettingsAutomation, IconShield, IconShieldCheck, IconSearch, IconX, } from "@tabler/icons-react";
4
+ import { useMemo, useState } from "react";
4
5
  import { NavLink } from "react-router";
5
6
  import { cn } from "../lib/utils.js";
7
+ import { DISPATCH_DOCS, DocsLink } from "./docs-link.js";
6
8
  import { useDispatchExtensions } from "./layout/Layout.js";
7
9
  const BUILT_IN_ADMIN_NAV_GROUPS = [
8
10
  {
@@ -152,11 +154,25 @@ function AdminNavLink({ item, onNavigate, }) {
152
154
  export function AdminShell({ children, onNavigate, }) {
153
155
  const t = useT();
154
156
  const groups = useAdminNavGroups();
155
- return (_jsxs("div", { className: "grid min-w-0 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)]", "data-dispatch-admin-shell": true, children: [_jsxs("aside", { className: "min-w-0 border-b pb-5 lg:sticky lg:top-2 lg:self-start lg:border-b-0 lg:border-e lg:pe-6", children: [_jsxs("div", { className: "px-2", children: [_jsx("div", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: t("dispatch.nav.admin", { defaultValue: "Admin" }) }), _jsx("p", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: t("dispatch.pages.adminDescription", {
156
- defaultValue: "Workspace controls and operations",
157
- }) })] }), _jsx("nav", { "aria-label": t("dispatch.pages.adminNavigation", {
157
+ const [query, setQuery] = useState("");
158
+ const normalizedQuery = query.trim().toLowerCase();
159
+ const visibleGroups = useMemo(() => groups
160
+ .map((group) => ({
161
+ ...group,
162
+ items: group.items.filter((item) => {
163
+ if (!normalizedQuery)
164
+ return true;
165
+ const label = itemLabel(t, item).toLowerCase();
166
+ return `${label} ${group.label.toLowerCase()}`.includes(normalizedQuery);
167
+ }),
168
+ }))
169
+ .filter((group) => group.items.length > 0), [groups, normalizedQuery, t]);
170
+ return (_jsxs("div", { className: "grid min-w-0 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)]", "data-dispatch-admin-shell": true, children: [_jsxs("aside", { className: "min-w-0 border-b pb-5 lg:sticky lg:top-2 lg:self-start lg:border-b-0", children: [_jsxs("div", { className: "flex items-center gap-1 px-2", children: [_jsxs("div", { className: "relative min-w-0 flex-1", children: [_jsx(IconSearch, { className: "pointer-events-none absolute start-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { type: "search", value: query, onChange: (event) => setQuery(event.target.value), onKeyDown: (event) => {
171
+ if (event.key === "Escape")
172
+ setQuery("");
173
+ }, placeholder: "Search admin", "aria-label": "Search admin", className: "h-8 w-full rounded-md border border-border bg-background ps-8 pe-7 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/30 focus:ring-2 focus:ring-accent/40" }), query ? (_jsx("button", { type: "button", onClick: () => setQuery(""), "aria-label": "Clear admin search", className: "absolute end-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:bg-accent/60 hover:text-foreground", children: _jsx(IconX, { className: "size-3.5" }) })) : null] }), _jsx(DocsLink, { href: DISPATCH_DOCS.dispatch, label: "Open Dispatch admin documentation" })] }), _jsxs("nav", { "aria-label": t("dispatch.pages.adminNavigation", {
158
174
  defaultValue: "Admin navigation",
159
- }), className: "mt-5 space-y-5", children: groups.map((group) => (_jsxs("section", { children: [_jsx("h2", { className: "px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70", children: t(group.labelKey, { defaultValue: group.label }) }), _jsx("ul", { className: "mt-1 space-y-0.5", children: group.items.map((item) => (_jsx(AdminNavLink, { item: item, onNavigate: onNavigate }, item.id))) })] }, group.id))) })] }), _jsx("section", { className: "min-w-0", "data-dispatch-admin-content": true, children: children })] }));
175
+ }), className: "mt-5 space-y-5", children: [visibleGroups.map((group) => (_jsxs("section", { children: [_jsx("h2", { className: "px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70", children: t(group.labelKey, { defaultValue: group.label }) }), _jsx("ul", { className: "mt-1 space-y-0.5", children: group.items.map((item) => (_jsx(AdminNavLink, { item: item, onNavigate: onNavigate }, item.id))) })] }, group.id))), visibleGroups.length === 0 ? (_jsx("p", { className: "px-2 py-6 text-center text-xs text-muted-foreground", children: "No matching admin pages" })) : null] })] }), _jsx("section", { className: "min-w-0", "data-dispatch-admin-content": true, children: children })] }));
160
176
  }
161
177
  export { BUILT_IN_ADMIN_NAV_GROUPS };
162
178
  export function useAdminNavGroups() {
@@ -1 +1 @@
1
- {"version":3,"file":"admin-navigation.js","sourceRoot":"","sources":["../../src/components/admin-navigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,kBAA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AAC,MAAM,CACxD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,YAAY,CACxC,CAAC;IAEF,OAAO,cAAc,CAAC,MAAM;QAC1B,CAAC,CAAC;YACE,GAAG,yBAAyB;YAC5B;gBACE,EAAE,EAAE,sBAAsB;gBAC1B,KAAK,EAAE,sBAAsB;gBAC7B,QAAQ,EAAE,yCAAyC;gBACnD,KAAK,EAAE,cAAc;aACtB;SACF;QACH,CAAC,CAAC,yBAAyB,CAAC;AAChC,CAAC","sourcesContent":["import { useT } from \"@agent-native/core/client/i18n\";\nimport {\n IconActivity,\n IconArrowUpRight,\n IconBrain,\n IconBrandTelegram,\n IconChartBar,\n IconFingerprint,\n IconHistory,\n IconKey,\n IconLayersSubtract,\n IconMail,\n IconMessages,\n IconPlugConnected,\n IconPuzzle,\n IconSettingsAutomation,\n IconShield,\n IconShieldCheck,\n} from \"@tabler/icons-react\";\nimport { type ReactNode } from \"react\";\nimport { NavLink } from \"react-router\";\n\nimport { cn } from \"../lib/utils\";\nimport { useDispatchExtensions, type DispatchNavItem } from \"./layout/Layout\";\n\nexport interface AdminNavGroup {\n id: string;\n label: string;\n labelKey: string;\n items: readonly DispatchNavItem[];\n}\n\nconst BUILT_IN_ADMIN_NAV_GROUPS: readonly AdminNavGroup[] = [\n {\n id: \"workspace\",\n label: \"Workspace\",\n labelKey: \"dispatch.pages.adminWorkspace\",\n items: [\n {\n id: \"admin-overview\",\n to: \"/admin\",\n label: \"Overview\",\n icon: IconShield,\n },\n {\n id: \"admin-resources\",\n to: \"/admin/workspace\",\n label: \"Resources\",\n icon: IconLayersSubtract,\n },\n ],\n },\n {\n id: \"operations\",\n label: \"Operations\",\n labelKey: \"dispatch.pages.adminOperations\",\n items: [\n {\n id: \"operations\",\n to: \"/admin/operations\",\n label: \"Operations\",\n icon: IconActivity,\n },\n {\n id: \"metrics\",\n to: \"/admin/metrics\",\n label: \"Metrics\",\n icon: IconChartBar,\n },\n {\n id: \"audit\",\n to: \"/admin/audit\",\n label: \"Audit\",\n icon: IconHistory,\n },\n {\n id: \"thread-debug\",\n to: \"/admin/thread-debug\",\n label: \"Thread Debug\",\n icon: IconMessages,\n },\n ],\n },\n {\n id: \"automation\",\n label: \"Automation & delivery\",\n labelKey: \"dispatch.pages.adminAutomation\",\n items: [\n {\n id: \"automations\",\n to: \"/admin/automations\",\n label: \"Automations\",\n icon: IconSettingsAutomation,\n },\n {\n id: \"approvals\",\n to: \"/admin/approvals\",\n label: \"Approvals\",\n icon: IconShieldCheck,\n },\n {\n id: \"destinations\",\n to: \"/admin/destinations\",\n label: \"Destinations\",\n icon: IconArrowUpRight,\n },\n {\n id: \"transactional-email\",\n to: \"/admin/transactional-email\",\n label: \"Transactional email\",\n icon: IconMail,\n },\n ],\n },\n {\n id: \"connections\",\n label: \"Connections\",\n labelKey: \"dispatch.pages.adminConnections\",\n items: [\n {\n id: \"integrations\",\n to: \"/admin/integrations\",\n label: \"Integrations\",\n icon: IconPuzzle,\n },\n {\n id: \"vault\",\n to: \"/admin/vault\",\n label: \"Vault\",\n icon: IconKey,\n },\n {\n id: \"messaging\",\n to: \"/admin/messaging\",\n label: \"Messaging\",\n icon: IconBrandTelegram,\n },\n {\n id: \"identities\",\n to: \"/admin/identities\",\n label: \"Identities\",\n icon: IconFingerprint,\n },\n ],\n },\n {\n id: \"agent-platform\",\n label: \"Agent platform\",\n labelKey: \"dispatch.pages.adminAgentPlatform\",\n items: [\n {\n id: \"agents\",\n to: \"/admin/agents\",\n label: \"Agents\",\n icon: IconPlugConnected,\n },\n {\n id: \"dreams\",\n to: \"/admin/dreams\",\n label: \"Dreams\",\n icon: IconBrain,\n },\n ],\n },\n];\n\nfunction itemLabel(t: ReturnType<typeof useT>, item: DispatchNavItem) {\n return t(`dispatch.nav.${item.id}`, { defaultValue: item.label });\n}\n\nfunction AdminNavLink({\n item,\n onNavigate,\n}: {\n item: DispatchNavItem;\n onNavigate?: () => void;\n}) {\n const t = useT();\n const to = item.adminTo ?? item.to;\n const label = itemLabel(t, item);\n const Icon = item.icon;\n\n return (\n <li>\n <NavLink\n to={to}\n end={item.id === \"admin-overview\"}\n onClick={onNavigate}\n className={({ isActive }) =>\n cn(\n \"flex min-h-8 items-center gap-2 rounded-md px-2 text-sm transition-colors\",\n isActive\n ? \"bg-accent font-medium text-accent-foreground\"\n : \"text-muted-foreground hover:bg-accent/60 hover:text-foreground\",\n )\n }\n >\n {Icon ? <Icon size={15} className=\"shrink-0\" /> : null}\n <span className=\"truncate\">{label}</span>\n </NavLink>\n </li>\n );\n}\n\nexport function AdminShell({\n children,\n onNavigate,\n}: {\n children: ReactNode;\n onNavigate?: () => void;\n}) {\n const t = useT();\n const groups = useAdminNavGroups();\n\n return (\n <div\n className=\"grid min-w-0 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)]\"\n data-dispatch-admin-shell\n >\n <aside className=\"min-w-0 border-b pb-5 lg:sticky lg:top-2 lg:self-start lg:border-b-0 lg:border-e lg:pe-6\">\n <div className=\"px-2\">\n <div className=\"text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">\n {t(\"dispatch.nav.admin\", { defaultValue: \"Admin\" })}\n </div>\n <p className=\"mt-1 text-xs leading-5 text-muted-foreground\">\n {t(\"dispatch.pages.adminDescription\", {\n defaultValue: \"Workspace controls and operations\",\n })}\n </p>\n </div>\n\n <nav\n aria-label={t(\"dispatch.pages.adminNavigation\", {\n defaultValue: \"Admin navigation\",\n })}\n className=\"mt-5 space-y-5\"\n >\n {groups.map((group) => (\n <section key={group.id}>\n <h2 className=\"px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70\">\n {t(group.labelKey, { defaultValue: group.label })}\n </h2>\n <ul className=\"mt-1 space-y-0.5\">\n {group.items.map((item) => (\n <AdminNavLink\n key={item.id}\n item={item}\n onNavigate={onNavigate}\n />\n ))}\n </ul>\n </section>\n ))}\n </nav>\n </aside>\n\n <section className=\"min-w-0\" data-dispatch-admin-content>\n {children}\n </section>\n </div>\n );\n}\n\nexport { BUILT_IN_ADMIN_NAV_GROUPS };\n\nexport function useAdminNavGroups(): readonly AdminNavGroup[] {\n const extensions = useDispatchExtensions();\n const extensionItems = (extensions?.navItems ?? []).filter(\n (item) => item.section === \"operations\",\n );\n\n return extensionItems.length\n ? [\n ...BUILT_IN_ADMIN_NAV_GROUPS,\n {\n id: \"workspace-extensions\",\n label: \"Workspace extensions\",\n labelKey: \"dispatch.pages.adminWorkspaceExtensions\",\n items: extensionItems,\n },\n ]\n : BUILT_IN_ADMIN_NAV_GROUPS;\n}\n"]}
1
+ {"version":3,"file":"admin-navigation.js","sourceRoot":"","sources":["../../src/components/admin-navigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,UAAU,EACV,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iBAAiB,CAAC;AAS9E,MAAM,yBAAyB,GAA6B;IAC1D;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,gBAAgB;gBACpB,EAAE,EAAE,QAAQ;gBACZ,KAAK,EAAE,UAAU;gBACjB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,QAAQ,EAAE,yCAAyC;gBACnD,KAAK,EAAE,cAAc;aACtB;SACF;QACH,CAAC,CAAC,yBAAyB,CAAC;AAChC,CAAC","sourcesContent":["import { useT } from \"@agent-native/core/client/i18n\";\nimport {\n IconActivity,\n IconArrowUpRight,\n IconBrain,\n IconBrandTelegram,\n IconChartBar,\n IconFingerprint,\n IconHistory,\n IconKey,\n IconLayersSubtract,\n IconMail,\n IconMessages,\n IconPlugConnected,\n IconPuzzle,\n IconSettingsAutomation,\n IconShield,\n IconShieldCheck,\n IconSearch,\n IconX,\n} from \"@tabler/icons-react\";\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { NavLink } from \"react-router\";\n\nimport { cn } from \"../lib/utils\";\nimport { DISPATCH_DOCS, DocsLink } from \"./docs-link\";\nimport { useDispatchExtensions, type DispatchNavItem } from \"./layout/Layout\";\n\nexport interface AdminNavGroup {\n id: string;\n label: string;\n labelKey: string;\n items: readonly DispatchNavItem[];\n}\n\nconst BUILT_IN_ADMIN_NAV_GROUPS: readonly AdminNavGroup[] = [\n {\n id: \"workspace\",\n label: \"Workspace\",\n labelKey: \"dispatch.pages.adminWorkspace\",\n items: [\n {\n id: \"admin-overview\",\n to: \"/admin\",\n label: \"Overview\",\n icon: IconShield,\n },\n {\n id: \"admin-resources\",\n to: \"/admin/workspace\",\n label: \"Resources\",\n icon: IconLayersSubtract,\n },\n ],\n },\n {\n id: \"operations\",\n label: \"Operations\",\n labelKey: \"dispatch.pages.adminOperations\",\n items: [\n {\n id: \"operations\",\n to: \"/admin/operations\",\n label: \"Operations\",\n icon: IconActivity,\n },\n {\n id: \"metrics\",\n to: \"/admin/metrics\",\n label: \"Metrics\",\n icon: IconChartBar,\n },\n {\n id: \"audit\",\n to: \"/admin/audit\",\n label: \"Audit\",\n icon: IconHistory,\n },\n {\n id: \"thread-debug\",\n to: \"/admin/thread-debug\",\n label: \"Thread Debug\",\n icon: IconMessages,\n },\n ],\n },\n {\n id: \"automation\",\n label: \"Automation & delivery\",\n labelKey: \"dispatch.pages.adminAutomation\",\n items: [\n {\n id: \"automations\",\n to: \"/admin/automations\",\n label: \"Automations\",\n icon: IconSettingsAutomation,\n },\n {\n id: \"approvals\",\n to: \"/admin/approvals\",\n label: \"Approvals\",\n icon: IconShieldCheck,\n },\n {\n id: \"destinations\",\n to: \"/admin/destinations\",\n label: \"Destinations\",\n icon: IconArrowUpRight,\n },\n {\n id: \"transactional-email\",\n to: \"/admin/transactional-email\",\n label: \"Transactional email\",\n icon: IconMail,\n },\n ],\n },\n {\n id: \"connections\",\n label: \"Connections\",\n labelKey: \"dispatch.pages.adminConnections\",\n items: [\n {\n id: \"integrations\",\n to: \"/admin/integrations\",\n label: \"Integrations\",\n icon: IconPuzzle,\n },\n {\n id: \"vault\",\n to: \"/admin/vault\",\n label: \"Vault\",\n icon: IconKey,\n },\n {\n id: \"messaging\",\n to: \"/admin/messaging\",\n label: \"Messaging\",\n icon: IconBrandTelegram,\n },\n {\n id: \"identities\",\n to: \"/admin/identities\",\n label: \"Identities\",\n icon: IconFingerprint,\n },\n ],\n },\n {\n id: \"agent-platform\",\n label: \"Agent platform\",\n labelKey: \"dispatch.pages.adminAgentPlatform\",\n items: [\n {\n id: \"agents\",\n to: \"/admin/agents\",\n label: \"Agents\",\n icon: IconPlugConnected,\n },\n {\n id: \"dreams\",\n to: \"/admin/dreams\",\n label: \"Dreams\",\n icon: IconBrain,\n },\n ],\n },\n];\n\nfunction itemLabel(t: ReturnType<typeof useT>, item: DispatchNavItem) {\n return t(`dispatch.nav.${item.id}`, { defaultValue: item.label });\n}\n\nfunction AdminNavLink({\n item,\n onNavigate,\n}: {\n item: DispatchNavItem;\n onNavigate?: () => void;\n}) {\n const t = useT();\n const to = item.adminTo ?? item.to;\n const label = itemLabel(t, item);\n const Icon = item.icon;\n\n return (\n <li>\n <NavLink\n to={to}\n end={item.id === \"admin-overview\"}\n onClick={onNavigate}\n className={({ isActive }) =>\n cn(\n \"flex min-h-8 items-center gap-2 rounded-md px-2 text-sm transition-colors\",\n isActive\n ? \"bg-accent font-medium text-accent-foreground\"\n : \"text-muted-foreground hover:bg-accent/60 hover:text-foreground\",\n )\n }\n >\n {Icon ? <Icon size={15} className=\"shrink-0\" /> : null}\n <span className=\"truncate\">{label}</span>\n </NavLink>\n </li>\n );\n}\n\nexport function AdminShell({\n children,\n onNavigate,\n}: {\n children: ReactNode;\n onNavigate?: () => void;\n}) {\n const t = useT();\n const groups = useAdminNavGroups();\n const [query, setQuery] = useState(\"\");\n const normalizedQuery = query.trim().toLowerCase();\n const visibleGroups = useMemo(\n () =>\n groups\n .map((group) => ({\n ...group,\n items: group.items.filter((item) => {\n if (!normalizedQuery) return true;\n const label = itemLabel(t, item).toLowerCase();\n return `${label} ${group.label.toLowerCase()}`.includes(\n normalizedQuery,\n );\n }),\n }))\n .filter((group) => group.items.length > 0),\n [groups, normalizedQuery, t],\n );\n\n return (\n <div\n className=\"grid min-w-0 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)]\"\n data-dispatch-admin-shell\n >\n <aside className=\"min-w-0 border-b pb-5 lg:sticky lg:top-2 lg:self-start lg:border-b-0\">\n <div className=\"flex items-center gap-1 px-2\">\n <div className=\"relative min-w-0 flex-1\">\n <IconSearch className=\"pointer-events-none absolute start-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n <input\n type=\"search\"\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") setQuery(\"\");\n }}\n placeholder=\"Search admin\"\n aria-label=\"Search admin\"\n className=\"h-8 w-full rounded-md border border-border bg-background ps-8 pe-7 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/30 focus:ring-2 focus:ring-accent/40\"\n />\n {query ? (\n <button\n type=\"button\"\n onClick={() => setQuery(\"\")}\n aria-label=\"Clear admin search\"\n className=\"absolute end-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:bg-accent/60 hover:text-foreground\"\n >\n <IconX className=\"size-3.5\" />\n </button>\n ) : null}\n </div>\n <DocsLink\n href={DISPATCH_DOCS.dispatch}\n label=\"Open Dispatch admin documentation\"\n />\n </div>\n\n <nav\n aria-label={t(\"dispatch.pages.adminNavigation\", {\n defaultValue: \"Admin navigation\",\n })}\n className=\"mt-5 space-y-5\"\n >\n {visibleGroups.map((group) => (\n <section key={group.id}>\n <h2 className=\"px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70\">\n {t(group.labelKey, { defaultValue: group.label })}\n </h2>\n <ul className=\"mt-1 space-y-0.5\">\n {group.items.map((item) => (\n <AdminNavLink\n key={item.id}\n item={item}\n onNavigate={onNavigate}\n />\n ))}\n </ul>\n </section>\n ))}\n {visibleGroups.length === 0 ? (\n <p className=\"px-2 py-6 text-center text-xs text-muted-foreground\">\n No matching admin pages\n </p>\n ) : null}\n </nav>\n </aside>\n\n <section className=\"min-w-0\" data-dispatch-admin-content>\n {children}\n </section>\n </div>\n );\n}\n\nexport { BUILT_IN_ADMIN_NAV_GROUPS };\n\nexport function useAdminNavGroups(): readonly AdminNavGroup[] {\n const extensions = useDispatchExtensions();\n const extensionItems = (extensions?.navItems ?? []).filter(\n (item) => item.section === \"operations\",\n );\n\n return extensionItems.length\n ? [\n ...BUILT_IN_ADMIN_NAV_GROUPS,\n {\n id: \"workspace-extensions\",\n label: \"Workspace extensions\",\n labelKey: \"dispatch.pages.adminWorkspaceExtensions\",\n items: extensionItems,\n },\n ]\n : BUILT_IN_ADMIN_NAV_GROUPS;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- export declare const APP_LIST_GRID_CLASS = "mx-auto w-full max-w-[1000px] xl:grid xl:grid-cols-2 xl:gap-3 xl:overflow-visible xl:rounded-none xl:bg-transparent";
2
+ export declare const APP_LIST_GRID_CLASS = "w-full xl:grid xl:grid-cols-2 xl:gap-3";
3
3
  export declare const APP_LIST_GRID_ROW_CLASS = "xl:rounded-2xl xl:border xl:border-transparent xl:bg-card xl:transition-[background-color,border-color] xl:hover:border-border xl:focus-within:border-ring/50";
4
4
  export declare function AppList({ children, className, }: {
5
5
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"app-list-row.d.ts","sourceRoot":"","sources":["../../src/components/app-list-row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,eAAO,MAAM,mBAAmB,wHACuF,CAAC;AACxH,eAAO,MAAM,uBAAuB,kKAC6H,CAAC;AAElK,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAMA;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAWA"}
1
+ {"version":3,"file":"app-list-row.d.ts","sourceRoot":"","sources":["../../src/components/app-list-row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,eAAO,MAAM,mBAAmB,2CAA2C,CAAC;AAC5E,eAAO,MAAM,uBAAuB,kKAC6H,CAAC;AAElK,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAMA;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAWA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../lib/utils.js";
3
- export const APP_LIST_GRID_CLASS = "mx-auto w-full max-w-[1000px] xl:grid xl:grid-cols-2 xl:gap-3 xl:overflow-visible xl:rounded-none xl:bg-transparent";
3
+ export const APP_LIST_GRID_CLASS = "w-full xl:grid xl:grid-cols-2 xl:gap-3";
4
4
  export const APP_LIST_GRID_ROW_CLASS = "xl:rounded-2xl xl:border xl:border-transparent xl:bg-card xl:transition-[background-color,border-color] xl:hover:border-border xl:focus-within:border-ring/50";
5
5
  export function AppList({ children, className, }) {
6
6
  return (_jsx("div", { className: cn("overflow-hidden rounded-2xl bg-card", className), children: children }));
@@ -1 +1 @@
1
- {"version":3,"file":"app-list-row.js","sourceRoot":"","sources":["../../src/components/app-list-row.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,qHAAqH,CAAC;AACxH,MAAM,CAAC,MAAM,uBAAuB,GAClC,+JAA+J,CAAC;AAElK,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,YACjE,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,kKAAkK,EAClK,SAAS,CACV,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nexport const APP_LIST_GRID_CLASS =\n \"mx-auto w-full max-w-[1000px] xl:grid xl:grid-cols-2 xl:gap-3 xl:overflow-visible xl:rounded-none xl:bg-transparent\";\nexport const APP_LIST_GRID_ROW_CLASS =\n \"xl:rounded-2xl xl:border xl:border-transparent xl:bg-card xl:transition-[background-color,border-color] xl:hover:border-border xl:focus-within:border-ring/50\";\n\nexport function AppList({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div className={cn(\"overflow-hidden rounded-2xl bg-card\", className)}>\n {children}\n </div>\n );\n}\n\nexport function AppListRow({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"group flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0 transition-[background-color,border-color] hover:bg-muted/30 focus-within:bg-muted/30\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"app-list-row.js","sourceRoot":"","sources":["../../src/components/app-list-row.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAAG,wCAAwC,CAAC;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAClC,+JAA+J,CAAC;AAElK,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,YACjE,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,kKAAkK,EAClK,SAAS,CACV,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nexport const APP_LIST_GRID_CLASS = \"w-full xl:grid xl:grid-cols-2 xl:gap-3\";\nexport const APP_LIST_GRID_ROW_CLASS =\n \"xl:rounded-2xl xl:border xl:border-transparent xl:bg-card xl:transition-[background-color,border-color] xl:hover:border-border xl:focus-within:border-ring/50\";\n\nexport function AppList({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div className={cn(\"overflow-hidden rounded-2xl bg-card\", className)}>\n {children}\n </div>\n );\n}\n\nexport function AppListRow({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"group flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0 transition-[background-color,border-color] hover:bg-muted/30 focus-within:bg-muted/30\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n"]}
@@ -1,18 +1,2 @@
1
- export interface AppOpenActionLabels {
2
- addApp: string;
3
- openApp: string;
4
- openInline: string;
5
- openInNewTab: string;
6
- }
7
- export declare function AppOpenActions({ name, href, target, rel, labels: labelOverrides, onAddApp, onOpenInline, showInlineOption, showNewTabOption, }: {
8
- name: string;
9
- href: string | null;
10
- target?: "_blank";
11
- rel?: string;
12
- labels?: Partial<AppOpenActionLabels>;
13
- onAddApp?: () => void;
14
- onOpenInline?: () => void;
15
- showInlineOption?: boolean;
16
- showNewTabOption?: boolean;
17
- }): import("node_modules/@types/react").JSX.Element;
1
+ export { AppOpenActions, type AppOpenActionLabels, type AppOpenActionMenuItem, } from "@agent-native/core/client/chat-first";
18
2
  //# sourceMappingURL=app-open-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-open-actions.d.ts","sourceRoot":"","sources":["../../src/components/app-open-actions.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AASD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,YAAY,EACZ,gBAAwB,EACxB,gBAAwB,GACzB,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,mDAqEA"}
1
+ {"version":3,"file":"app-open-actions.d.ts","sourceRoot":"","sources":["../../src/components/app-open-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,sCAAsC,CAAC"}
@@ -1,21 +1,2 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { IconChevronDown, IconPlus } from "@tabler/icons-react";
3
- import { Button } from "./ui/button.js";
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./ui/dropdown-menu.js";
5
- const DEFAULT_LABELS = {
6
- addApp: "Add app",
7
- openApp: "Open app",
8
- openInline: "Open inline",
9
- openInNewTab: "Open in new tab",
10
- };
11
- export function AppOpenActions({ name, href, target, rel, labels: labelOverrides, onAddApp, onOpenInline, showInlineOption = false, showNewTabOption = false, }) {
12
- const labels = { ...DEFAULT_LABELS, ...labelOverrides };
13
- const canOfferNewTab = showNewTabOption && target !== "_blank";
14
- const hasMenu = Boolean(onAddApp) ||
15
- (Boolean(href) && (showInlineOption || canOfferNewTab));
16
- if (!href && !hasMenu) {
17
- return (_jsx(Button, { size: "sm", variant: "outline", disabled: true, children: labels.openApp }));
18
- }
19
- return (_jsxs("div", { className: "flex shrink-0 overflow-hidden rounded-md border border-border focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", children: [_jsx(Button, { asChild: Boolean(href), size: "sm", variant: "outline", className: "rounded-none border-0 border-e border-border", disabled: !href, children: href ? (_jsx("a", { href: href, target: target, rel: rel, children: labels.openApp })) : (_jsx("span", { children: labels.openApp })) }), hasMenu ? (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", size: "sm", variant: "outline", className: "size-9 rounded-none border-0 p-0", "aria-label": `Open options for ${name}`, children: _jsx(IconChevronDown, { size: 15 }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "min-w-40", children: [onAddApp ? (_jsxs(DropdownMenuItem, { onSelect: onAddApp, children: [_jsx(IconPlus, { size: 14, className: "mr-2" }), labels.addApp] })) : null, showInlineOption && href ? (_jsx(DropdownMenuItem, { onSelect: onOpenInline, children: labels.openInline })) : null, canOfferNewTab && href ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsx("a", { href: href, target: "_blank", rel: "noreferrer", children: labels.openInNewTab }) })) : null] })] })) : null] }));
20
- }
1
+ export { AppOpenActions, } from "@agent-native/core/client/chat-first";
21
2
  //# sourceMappingURL=app-open-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-open-actions.js","sourceRoot":"","sources":["../../src/components/app-open-actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAS5B,MAAM,cAAc,GAAwB;IAC1C,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,YAAY,EACZ,gBAAgB,GAAG,KAAK,EACxB,gBAAgB,GAAG,KAAK,GAWzB;IACC,MAAM,MA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,CAAC,CAAC,CAAC,CACV,MAAC,gBAAgB,IAAC,QAAQ,EAAE,QAAQ,aAClC,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,GAAG,EACtC,MAAM,CAAC,MAAM,IACG,CACpB,CAAC,CAAC,CAAC,IAAI,EACP,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,CAC1B,KAAC,gBAAgB,IAAC,QAAQ,EAAE,YAAY,YACrC,MAAM,CAAC,UAAU,GACD,CACpB,CAAC,CAAC,CAAC,IAAI,EACP,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,CACxB,KAAC,gBAAgB,IAAC,OAAO,kBACvB,YAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,YAC5C,MAAM,CAAC,YAAY,GAClB,GACa,CACpB,CAAC,CAAC,CAAC,IAAI,IACY,IACT,CAChB,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { IconChevronDown, IconPlus } from \"@tabler/icons-react\";\n\nimport { Button } from \"./ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\n\nexport interface AppOpenActionLabels {\n addApp: string;\n openApp: string;\n openInline: string;\n openInNewTab: string;\n}\n\nconst DEFAULT_LABELS: AppOpenActionLabels = {\n addApp: \"Add app\",\n openApp: \"Open app\",\n openInline: \"Open inline\",\n openInNewTab: \"Open in new tab\",\n};\n\nexport function AppOpenActions({\n name,\n href,\n target,\n rel,\n labels: labelOverrides,\n onAddApp,\n onOpenInline,\n showInlineOption = false,\n showNewTabOption = false,\n}: {\n name: string;\n href: string | null;\n target?: \"_blank\";\n rel?: string;\n labels?: Partial<AppOpenActionLabels>;\n onAddApp?: () => void;\n onOpenInline?: () => void;\n showInlineOption?: boolean;\n showNewTabOption?: boolean;\n}) {\n const labels = { ...DEFAULT_LABELS, ...labelOverrides };\n const canOfferNewTab = showNewTabOption && target !== \"_blank\";\n const hasMenu =\n Boolean(onAddApp) ||\n (Boolean(href) && (showInlineOption || canOfferNewTab));\n\n if (!href && !hasMenu) {\n return (\n <Button size=\"sm\" variant=\"outline\" disabled>\n {labels.openApp}\n </Button>\n );\n }\n\n return (\n <div className=\"flex shrink-0 overflow-hidden rounded-md border border-border focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2\">\n <Button\n asChild={Boolean(href)}\n size=\"sm\"\n variant=\"outline\"\n className=\"rounded-none border-0 border-e border-border\"\n disabled={!href}\n >\n {href ? (\n <a href={href} target={target} rel={rel}>\n {labels.openApp}\n </a>\n ) : (\n <span>{labels.openApp}</span>\n )}\n </Button>\n {hasMenu ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n className=\"size-9 rounded-none border-0 p-0\"\n aria-label={`Open options for ${name}`}\n >\n <IconChevronDown size={15} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"min-w-40\">\n {onAddApp ? (\n <DropdownMenuItem onSelect={onAddApp}>\n <IconPlus size={14} className=\"mr-2\" />\n {labels.addApp}\n </DropdownMenuItem>\n ) : null}\n {showInlineOption && href ? (\n <DropdownMenuItem onSelect={onOpenInline}>\n {labels.openInline}\n </DropdownMenuItem>\n ) : null}\n {canOfferNewTab && href ? (\n <DropdownMenuItem asChild>\n <a href={href} target=\"_blank\" rel=\"noreferrer\">\n {labels.openInNewTab}\n </a>\n </DropdownMenuItem>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"app-open-actions.js","sourceRoot":"","sources":["../../src/components/app-open-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAGf,MAAM,sCAAsC,CAAC","sourcesContent":["export {\n AppOpenActions,\n type AppOpenActionLabels,\n type AppOpenActionMenuItem,\n} from \"@agent-native/core/client/chat-first\";\n"]}
@@ -0,0 +1,6 @@
1
+ export declare function AppRowSettings({ name, addAppLabel, onAddApp, }: {
2
+ name: string;
3
+ addAppLabel?: string;
4
+ onAddApp: () => void;
5
+ }): import("node_modules/@types/react").JSX.Element;
6
+ //# sourceMappingURL=app-row-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-row-settings.d.ts","sourceRoot":"","sources":["../../src/components/app-row-settings.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,WAAuB,EACvB,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,mDA8BA"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { APP_ACTION_MENU_CONTENT_CLASS } from "@agent-native/core/client/chat-first";
3
+ import { IconPlus, IconSettings } from "@tabler/icons-react";
4
+ import { Button } from "./ui/button.js";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./ui/dropdown-menu.js";
6
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip.js";
7
+ const APP_ROW_ACTION_CLASS = "size-7 rounded-md p-0 text-muted-foreground transition-[background-color,color] hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-foreground";
8
+ export function AppRowSettings({ name, addAppLabel = "Add app", onAddApp, }) {
9
+ return (_jsxs(DropdownMenu, { children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", "aria-label": `Settings for ${name}`, className: APP_ROW_ACTION_CLASS, children: _jsx(IconSettings, { size: 15 }) }) }) }), _jsx(TooltipContent, { children: "App settings" })] }), _jsx(DropdownMenuContent, { align: "end", className: APP_ACTION_MENU_CONTENT_CLASS, children: _jsxs(DropdownMenuItem, { onSelect: onAddApp, children: [_jsx(IconPlus, { size: 14, "aria-hidden": "true" }), addAppLabel] }) })] }));
10
+ }
11
+ //# sourceMappingURL=app-row-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-row-settings.js","sourceRoot":"","sources":["../../src/components/app-row-settings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,oBAAoB,GACxB,6PAA6P,CAAC;AAEhQ,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,EACJ,WAAW,GAAG,SAAS,EACvB,QAAQ,GAKT;IACC,OAAO,CACL,MAAC,YAAY,eACX,MAAC,OAAO,eACN,KAAC,cAAc,IAAC,OAAO,kBACrB,KAAC,mBAAmB,IAAC,OAAO,kBAC1B,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,IAAI,gBACG,gBAAgB,IAAI,EAAE,EAClC,SAAS,EAAE,oBAAoB,YAE/B,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,GACnB,GACW,GACP,EACjB,KAAC,cAAc,+BAA8B,IACrC,EACV,KAAC,mBAAmB,IAClB,KAAK,EAAC,KAAK,EACX,SAAS,EAAE,6BAA6B,YAExC,MAAC,gBAAgB,IAAC,QAAQ,EAAE,QAAQ,aAClC,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,EACxC,WAAW,IACK,GACC,IACT,CAChB,CAAC;AACJ,CAAC","sourcesContent":["import { APP_ACTION_MENU_CONTENT_CLASS } from \"@agent-native/core/client/chat-first\";\nimport { IconPlus, IconSettings } from \"@tabler/icons-react\";\n\nimport { Button } from \"./ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./ui/tooltip\";\n\nconst APP_ROW_ACTION_CLASS =\n \"size-7 rounded-md p-0 text-muted-foreground transition-[background-color,color] hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-foreground\";\n\nexport function AppRowSettings({\n name,\n addAppLabel = \"Add app\",\n onAddApp,\n}: {\n name: string;\n addAppLabel?: string;\n onAddApp: () => void;\n}) {\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`Settings for ${name}`}\n className={APP_ROW_ACTION_CLASS}\n >\n <IconSettings size={15} />\n </Button>\n </DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent>App settings</TooltipContent>\n </Tooltip>\n <DropdownMenuContent\n align=\"end\"\n className={APP_ACTION_MENU_CONTENT_CLASS}\n >\n <DropdownMenuItem onSelect={onAddApp}>\n <IconPlus size={14} aria-hidden=\"true\" />\n {addAppLabel}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"automation-run-history-dialog.d.ts","sourceRoot":"","sources":["../../src/components/automation-run-history-dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAqBjE,UAAU,+BAA+B;IACvC,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAgCD,wBAAgB,0BAA0B,CAAC,EACzC,UAAU,EACV,IAAI,EACJ,YAAY,GACb,EAAE,+BAA+B,mDAwKjC"}
1
+ {"version":3,"file":"automation-run-history-dialog.d.ts","sourceRoot":"","sources":["../../src/components/automation-run-history-dialog.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAsBjE,UAAU,+BAA+B;IACvC,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAgCD,wBAAgB,0BAA0B,CAAC,EACzC,UAAU,EACV,IAAI,EACJ,YAAY,GACb,EAAE,+BAA+B,mDA4KjC"}
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useActionQuery } from "@agent-native/core/client/hooks";
3
- import { IconAlertTriangle, IconClock, IconExternalLink, IconLoader2, } from "@tabler/icons-react";
3
+ import { IconAlertTriangle, IconClock, IconExternalLink, } from "@tabler/icons-react";
4
4
  import { Link } from "react-router";
5
5
  import { automationScopeLabel, automationTarget, } from "../lib/automation-display.js";
6
6
  import { ActionQueryError } from "./action-query-error.js";
7
7
  import { Badge } from "./ui/badge.js";
8
8
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./ui/dialog.js";
9
+ import { Skeleton } from "./ui/skeleton.js";
9
10
  function runStatusVariant(status) {
10
11
  if (status === "error")
11
12
  return "destructive";
@@ -53,7 +54,7 @@ export function AutomationRunHistoryDialog({ automation, open, onOpenChange, })
53
54
  : "Execution history" })] }), automation ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-3 rounded-lg border bg-muted/20 p-3 text-sm", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Status" }), _jsx("div", { className: "mt-1 font-medium", children: automation.lastStatus ??
54
55
  (automation.enabled ? "ready" : "paused") })] }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Last check" }), _jsx("div", { className: "mt-1 font-medium", children: automation.lastCheck
55
56
  ? formatTimestamp(new Date(automation.lastCheck).getTime())
56
- : "Not recorded" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Created by" }), _jsx("div", { className: "mt-1 break-words font-medium", children: automation.createdBy ?? "Unknown" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Timezone" }), _jsx("div", { className: "mt-1 font-medium", children: automation.timezone ?? "Account default" })] })] }), automation.lastError ? (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3", children: [_jsx(IconAlertTriangle, { className: "mt-0.5 size-4 shrink-0 text-destructive" }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-sm font-medium text-destructive", children: "Latest scheduler result" }), _jsx("p", { className: "mt-1 break-words text-sm text-muted-foreground", children: automation.lastError })] })] })) : null, _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Past runs" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Only executions that actually started appear here. Blocked or skipped scheduler checks are shown above, not as fake runs." })] }), runs.length > 0 ? (_jsxs(Badge, { variant: "outline", children: [runs.length, " shown"] })) : null] }), _jsx("div", { className: "mt-3", children: runsQuery.isLoading ? (_jsxs("div", { className: "flex items-center gap-2 rounded-lg border p-4 text-sm text-muted-foreground", children: [_jsx(IconLoader2, { className: "size-4 animate-spin" }), "Loading run history..."] })) : runsQuery.isError ? (_jsx(ActionQueryError, { error: runsQuery.error, onRetry: () => void runsQuery.refetch() })) : runs.length === 0 ? (_jsx("div", { className: "rounded-lg border border-dashed p-4 text-sm text-muted-foreground", children: "This automation has not recorded an execution yet. If it is enabled but shows no runs, inspect the latest scheduler result and last check above." })) : (_jsx("ul", { className: "divide-y rounded-lg border", children: runs.map((run) => {
57
+ : "Not recorded" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Created by" }), _jsx("div", { className: "mt-1 break-words font-medium", children: automation.createdBy ?? "Unknown" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-[11px] uppercase tracking-wide text-muted-foreground", children: "Timezone" }), _jsx("div", { className: "mt-1 font-medium", children: automation.timezone ?? "Account default" })] })] }), automation.lastError ? (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3", children: [_jsx(IconAlertTriangle, { className: "mt-0.5 size-4 shrink-0 text-destructive" }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-sm font-medium text-destructive", children: "Latest scheduler result" }), _jsx("p", { className: "mt-1 break-words text-sm text-muted-foreground", children: automation.lastError })] })] })) : null, _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Past runs" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Only executions that actually started appear here. Blocked or skipped scheduler checks are shown above, not as fake runs." })] }), runs.length > 0 ? (_jsxs(Badge, { variant: "outline", children: [runs.length, " shown"] })) : null] }), _jsx("div", { className: "mt-3", children: runsQuery.isLoading ? (_jsx("div", { className: "space-y-3 rounded-lg border p-4", children: Array.from({ length: 3 }).map((_, index) => (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-4 w-2/3" }), _jsx(Skeleton, { className: "h-3 w-1/2" })] }, index))) })) : runsQuery.isError ? (_jsx(ActionQueryError, { error: runsQuery.error, onRetry: () => void runsQuery.refetch() })) : runs.length === 0 ? (_jsx("div", { className: "rounded-lg border border-dashed p-4 text-sm text-muted-foreground", children: "This automation has not recorded an execution yet. If it is enabled but shows no runs, inspect the latest scheduler result and last check above." })) : (_jsx("ul", { className: "divide-y rounded-lg border", children: runs.map((run) => {
57
58
  const debugPath = runDebugPath(run);
58
59
  const duration = formatDuration(run);
59
60
  return (_jsxs("li", { className: "space-y-2 p-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [_jsx(Badge, { variant: runStatusVariant(run.status), children: run.status }), _jsx("span", { className: "text-muted-foreground", children: formatTimestamp(run.startedAt) }), duration ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(IconClock, { className: "size-3.5" }), duration] })) : null, debugPath ? (_jsxs(Link, { to: debugPath, className: "ml-auto inline-flex items-center gap-1 text-xs font-medium text-foreground underline-offset-4 hover:underline", children: [_jsx(IconExternalLink, { className: "size-3.5" }), "Open debug"] })) : null] }), run.error ? (_jsx("p", { className: "break-words text-sm text-destructive", children: run.error })) : null] }, run.id));
@@ -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,sBAAs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C,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 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,CAA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"@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", }) {