@agent-native/dispatch 0.40.13 → 0.40.14-nightly-20261006033736

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 (38) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/actions/provider-api-register.d.ts +10 -10
  3. package/dist/components/connected-app-card.d.ts.map +1 -1
  4. package/dist/components/connected-app-card.js +23 -4
  5. package/dist/components/connected-app-card.js.map +1 -1
  6. package/dist/components/layout/Layout.d.ts.map +1 -1
  7. package/dist/components/layout/Layout.js +116 -60
  8. package/dist/components/layout/Layout.js.map +1 -1
  9. package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -1
  10. package/dist/components/layout/workspace-apps-rail.js +35 -9
  11. package/dist/components/layout/workspace-apps-rail.js.map +1 -1
  12. package/dist/lib/other-apps.d.ts +1 -0
  13. package/dist/lib/other-apps.d.ts.map +1 -1
  14. package/dist/lib/other-apps.js +29 -1
  15. package/dist/lib/other-apps.js.map +1 -1
  16. package/dist/lib/workspace-apps.d.ts +2 -1
  17. package/dist/lib/workspace-apps.d.ts.map +1 -1
  18. package/dist/lib/workspace-apps.js +15 -5
  19. package/dist/lib/workspace-apps.js.map +1 -1
  20. package/dist/routes/pages/apps.d.ts.map +1 -1
  21. package/dist/routes/pages/apps.js +17 -4
  22. package/dist/routes/pages/apps.js.map +1 -1
  23. package/dist/server/plugins/auth.js +2 -2
  24. package/dist/server/plugins/auth.js.map +1 -1
  25. package/package.json +4 -4
  26. package/src/components/connected-app-card.spec.tsx +100 -0
  27. package/src/components/connected-app-card.tsx +38 -9
  28. package/src/components/layout/Layout.spec.tsx +397 -6
  29. package/src/components/layout/Layout.tsx +173 -85
  30. package/src/components/layout/workspace-apps-rail.spec.tsx +69 -7
  31. package/src/components/layout/workspace-apps-rail.tsx +49 -7
  32. package/src/lib/other-apps.spec.ts +84 -2
  33. package/src/lib/other-apps.ts +39 -1
  34. package/src/lib/workspace-apps.spec.ts +53 -0
  35. package/src/lib/workspace-apps.ts +15 -7
  36. package/src/routes/pages/apps.spec.tsx +132 -0
  37. package/src/routes/pages/apps.tsx +46 -10
  38. package/src/server/plugins/auth.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @agent-native/dispatch
2
2
 
3
+ ## 0.40.14-nightly-20261006033736
4
+
5
+ ### Patch Changes
6
+
7
+ - 42355e4: Dispatch shows configured first-party apps in its launchers by default.
8
+ - c8fa837: Render hosted sign-in pages on the server, blur the signup form panel backdrop, and use the shared Calendar wave across signup pages and the homepage hero.
9
+ - Updated dependencies [a983e22]
10
+ - Updated dependencies [c442bae]
11
+ - Updated dependencies [053539c]
12
+ - Updated dependencies [a652cbc]
13
+ - Updated dependencies [f649ae6]
14
+ - Updated dependencies [ae80a65]
15
+ - Updated dependencies [84e173d]
16
+ - Updated dependencies [1313fe1]
17
+ - Updated dependencies [edc7f35]
18
+ - Updated dependencies [053539c]
19
+ - Updated dependencies [3347175]
20
+ - Updated dependencies [4522907]
21
+ - Updated dependencies [7109d2c]
22
+ - Updated dependencies [c8fa837]
23
+ - Updated dependencies [84e173d]
24
+ - Updated dependencies [a88e431]
25
+ - Updated dependencies [8283661]
26
+ - @agent-native/toolkit@0.202.0-nightly-20261006033736
27
+ - @agent-native/core@0.202.0-nightly-20261006033736
28
+
3
29
  ## 0.40.13
4
30
 
5
31
  ### Patch Changes
@@ -47,9 +47,8 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
47
47
  notes?: string | undefined;
48
48
  scope?: "org" | "user" | undefined;
49
49
  }, {
50
- message?: undefined;
51
50
  id?: undefined;
52
- provider?: undefined;
51
+ message?: undefined;
53
52
  deleted?: undefined;
54
53
  providers: {
55
54
  id: string;
@@ -61,44 +60,45 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
61
60
  updatedAt: number;
62
61
  }[];
63
62
  count: number;
63
+ provider?: undefined;
64
64
  found?: undefined;
65
65
  registered?: undefined;
66
66
  label?: undefined;
67
67
  } | {
68
- message?: undefined;
69
68
  id?: undefined;
69
+ count?: undefined;
70
+ message?: undefined;
70
71
  deleted?: undefined;
71
72
  providers?: undefined;
72
- count?: undefined;
73
73
  found: boolean;
74
74
  provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
75
75
  registered?: undefined;
76
76
  label?: undefined;
77
77
  } | {
78
+ count?: undefined;
78
79
  message?: undefined;
79
- provider?: undefined;
80
80
  deleted?: undefined;
81
81
  providers?: undefined;
82
- count?: undefined;
82
+ provider?: undefined;
83
83
  found: boolean;
84
84
  id: string;
85
85
  registered?: undefined;
86
86
  label?: undefined;
87
87
  } | {
88
+ count?: undefined;
88
89
  message?: undefined;
89
- provider?: undefined;
90
90
  providers?: undefined;
91
- count?: undefined;
91
+ provider?: undefined;
92
92
  found?: undefined;
93
93
  deleted: boolean;
94
94
  id: string;
95
95
  registered?: undefined;
96
96
  label?: undefined;
97
97
  } | {
98
- provider?: undefined;
98
+ count?: undefined;
99
99
  deleted?: undefined;
100
100
  providers?: undefined;
101
- count?: undefined;
101
+ provider?: undefined;
102
102
  found?: undefined;
103
103
  registered: boolean;
104
104
  id: string;
@@ -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,mDAyBA"}
1
+ {"version":3,"file":"connected-app-card.d.ts","sourceRoot":"","sources":["../../src/components/connected-app-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAS7D,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,GACV,EAAE;IACD,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,mDAiDA"}
@@ -1,13 +1,32 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { withBuilderUtmTrackingParams } from "@agent-native/core/shared/builder-link-tracking";
3
+ import { navigateToWorkspaceApp, shouldOpenWorkspaceAppInTopWindow, } from "../lib/workspace-apps.js";
3
4
  import { AppIcon } from "./app-icon.js";
4
5
  import { AppListRow } from "./app-list-row.js";
5
6
  import { AppOpenActions } from "./app-open-actions.js";
6
7
  export function ConnectedAppCard({ app, className, }) {
7
8
  const launchUrl = app.homeUrl ?? app.url;
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
- campaign: "product",
10
- content: "dispatch_app",
11
- }), rel: "noopener noreferrer", showNewTabOption: true })] }));
9
+ const trackedLaunchUrl = withBuilderUtmTrackingParams(launchUrl, {
10
+ campaign: "product",
11
+ content: "dispatch_app",
12
+ });
13
+ const handleActionClick = (event) => {
14
+ if (event.button !== 0 ||
15
+ event.metaKey ||
16
+ event.ctrlKey ||
17
+ event.shiftKey ||
18
+ event.altKey) {
19
+ return;
20
+ }
21
+ const anchor = event.target instanceof Element ? event.target.closest("a") : null;
22
+ if (!anchor ||
23
+ anchor.target === "_blank" ||
24
+ !shouldOpenWorkspaceAppInTopWindow()) {
25
+ return;
26
+ }
27
+ if (navigateToWorkspaceApp(anchor.href))
28
+ event.preventDefault();
29
+ };
30
+ 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("div", { className: "flex shrink-0", onClickCapture: handleActionClick, children: _jsx(AppOpenActions, { name: app.name, href: trackedLaunchUrl, rel: "noopener noreferrer", showNewTabOption: true }) })] }));
12
31
  }
13
32
  //# 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,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"]}
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;AAI/F,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,uBAAuB,CAAC;AAC/B,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;IACzC,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gBAAgB,EACtB,GAAG,EAAC,qBAAqB,EACzB,gBAAgB,SAChB,GACE,IACK,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\nimport type { MouseEvent } from \"react\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport {\n navigateToWorkspaceApp,\n shouldOpenWorkspaceAppInTopWindow,\n} from \"../lib/workspace-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 const trackedLaunchUrl = withBuilderUtmTrackingParams(launchUrl, {\n campaign: \"product\",\n content: \"dispatch_app\",\n });\n const handleActionClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n ) {\n return;\n }\n const anchor =\n event.target instanceof Element ? event.target.closest(\"a\") : null;\n if (\n !anchor ||\n anchor.target === \"_blank\" ||\n !shouldOpenWorkspaceAppInTopWindow()\n ) {\n return;\n }\n if (navigateToWorkspaceApp(anchor.href)) event.preventDefault();\n };\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 <div className=\"flex shrink-0\" onClickCapture={handleActionClick}>\n <AppOpenActions\n name={app.name}\n href={trackedLaunchUrl}\n rel=\"noopener noreferrer\"\n showNewTabOption\n />\n </div>\n </AppListRow>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/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AAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE,aAAa,CAAC;CACrB,GAAG,SAAS,CAuCZ;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,mBAAmB,mDAMhD"}
@@ -20,9 +20,10 @@ import { createContext, useEffect, useMemo, useRef, useState, useContext, useCal
20
20
  import { Link, useLocation, useNavigate } from "react-router";
21
21
  import { toast } from "sonner";
22
22
  import { useIsMobile } from "../../hooks/use-mobile.js";
23
+ import { filterBuiltInApps, } from "../../lib/other-apps.js";
23
24
  import { cn } from "../../lib/utils.js";
24
25
  import { normalizeWorkspaceAppLayout } from "../../lib/workspace-app-layout.js";
25
- import { isDispatchWorkspaceAppId, isPathMountedWorkspaceApp, isWorkspaceAppVisibleInDefaultLaunchers, isWorkspaceSsoApp, navigateToWorkspaceApp, shouldOpenWorkspaceAppInTopWindow, workspaceAppIdFromRoute, workspaceAppDirectHref, workspaceAppDirectLaunchHref, workspaceAppRoute, workspaceAppTargetPath, } from "../../lib/workspace-apps.js";
26
+ import { isDispatchWorkspaceAppId, isPathMountedWorkspaceApp, isWorkspaceAppVisibleInDefaultLaunchers, isWorkspaceSsoApp, mergeChatFirstWorkspaceApps, navigateToWorkspaceApp, shouldOpenWorkspaceAppInTopWindow, workspaceAppIdFromRoute, workspaceAppDirectHref, workspaceAppDirectLaunchHref, workspaceAppRoute, workspaceAppTargetPath, } from "../../lib/workspace-apps.js";
26
27
  import { CHAT_FIRST_PANE_STATE_KEY } from "../../shared/chat-first-pane.js";
27
28
  import { AppIcon } from "../app-icon.js";
28
29
  import { CreateAppPopover } from "../create-app-popover.js";
@@ -696,13 +697,28 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
696
697
  enabled: shouldQueryChatFirstApps(isChatRoute, chatFirstMode) ||
697
698
  workspaceAppRouteActive,
698
699
  });
699
- const chatFirstWorkspaceApps = useMemo(() => (chatFirstAppsQuery.data ?? []).filter((app) => app.status !== "pending" &&
700
- app.archived !== true &&
701
- isWorkspaceAppVisibleInDefaultLaunchers(app)), [chatFirstAppsQuery.data]);
700
+ const chatFirstConnectedAppsQuery = useActionQuery("list-connected-agents", {}, { enabled: shouldQueryChatFirstApps(isChatRoute, chatFirstMode) });
701
+ const chatFirstBuiltinApps = useMemo(() => filterBuiltInApps(chatFirstConnectedAppsQuery.data ?? [], chatFirstAppsQuery.data ?? []), [chatFirstAppsQuery.data, chatFirstConnectedAppsQuery.data]);
702
+ const chatFirstEnabledBuiltinAppIds = useMemo(() => chatFirstBuiltinApps.map((app) => app.id), [chatFirstBuiltinApps]);
703
+ const chatFirstWorkspaceAppsLoading = chatFirstAppsQuery.isLoading;
704
+ const chatFirstConnectedAppsLoading = chatFirstConnectedAppsQuery.isLoading;
705
+ const chatFirstAppsLoading = chatFirstWorkspaceAppsLoading || chatFirstConnectedAppsLoading;
706
+ const chatFirstAppsFailed = chatFirstAppsQuery.isError;
707
+ const chatFirstAppsError = chatFirstAppsQuery.error ?? chatFirstConnectedAppsQuery.error;
708
+ const chatFirstResolvableApps = useMemo(() => mergeChatFirstWorkspaceApps(chatFirstAppsQuery.data, chatFirstEnabledBuiltinAppIds, chatFirstBuiltinApps.map((app) => ({
709
+ id: app.id,
710
+ name: app.name,
711
+ description: app.description,
712
+ url: app.homeUrl?.trim() || app.url,
713
+ source: "builtin",
714
+ }))).filter((app) => app.status !== "pending" && app.archived !== true), [
715
+ chatFirstAppsQuery.data,
716
+ chatFirstBuiltinApps,
717
+ chatFirstEnabledBuiltinAppIds,
718
+ ]);
719
+ const chatFirstWorkspaceApps = useMemo(() => chatFirstResolvableApps.filter(isWorkspaceAppVisibleInDefaultLaunchers), [chatFirstResolvableApps]);
702
720
  const chatFirstAppRegistrations = useMemo(() => {
703
- return (chatFirstAppsQuery.data ?? [])
704
- .filter((app) => app.status !== "pending" && app.archived !== true)
705
- .map((app) => ({
721
+ return chatFirstResolvableApps.map((app) => ({
706
722
  id: app.id,
707
723
  name: app.name,
708
724
  source: app.source ?? "workspace",
@@ -711,7 +727,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
711
727
  homePath: app.homePath,
712
728
  enabled: true,
713
729
  }));
714
- }, [chatFirstAppsQuery.data]);
730
+ }, [chatFirstResolvableApps]);
715
731
  const chatFirstAppItems = useMemo(() => chatFirstWorkspaceApps.map((app) => ({
716
732
  id: app.id,
717
733
  name: app.name,
@@ -721,6 +737,12 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
721
737
  if (isDispatchWorkspaceAppId(app.id))
722
738
  return;
723
739
  const registration = chatFirstAppRegistrations.find((candidate) => candidate.id.toLowerCase() === app.id.toLowerCase());
740
+ if (registration?.source === "builtin") {
741
+ const directHref = workspaceAppDirectHref(registration, workspaceAppTargetPath(registration));
742
+ if (directHref)
743
+ navigateToWorkspaceApp(directHref);
744
+ return;
745
+ }
724
746
  const hasWorkspaceRoute = Boolean(registration?.path?.trim());
725
747
  if (!hasWorkspaceRoute) {
726
748
  if (registration) {
@@ -743,20 +765,24 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
743
765
  }, [chatFirstAppRegistrations, navigate]);
744
766
  const chatHomeAppLauncher = useMemo(() => ({
745
767
  workspaceApps: chatFirstWorkspaceApps,
746
- isLoading: chatFirstAppsQuery.isLoading,
747
- error: chatFirstAppsQuery.isError ? chatFirstAppsQuery.error : undefined,
768
+ isLoading: chatFirstAppsLoading,
769
+ error: chatFirstAppsError,
748
770
  openApp: openChatFirstApp,
749
- retry: () => void chatFirstAppsQuery.refetch(),
771
+ retry: () => {
772
+ void chatFirstAppsQuery.refetch();
773
+ void chatFirstConnectedAppsQuery.refetch();
774
+ },
750
775
  }), [
751
- chatFirstAppsQuery.error,
752
- chatFirstAppsQuery.isError,
753
- chatFirstAppsQuery.isLoading,
776
+ chatFirstAppsError,
777
+ chatFirstAppsLoading,
754
778
  chatFirstAppsQuery.refetch,
779
+ chatFirstConnectedAppsQuery.refetch,
755
780
  chatFirstWorkspaceApps,
756
781
  openChatFirstApp,
757
782
  ]);
758
783
  const chatFirstCopy = useMemo(() => createDispatchChatFirstCopy(t), [t]);
759
784
  const [chatFirstPane, setChatFirstPane] = useState(null);
785
+ const [pendingChatFirstPaneRestore, setPendingChatFirstPaneRestore] = useState(null);
760
786
  const [chatFirstNotice, setChatFirstNotice] = useState(null);
761
787
  const chatFirstSessionWatch = useChatFirstSessionWatch();
762
788
  const chatFirstSurfaceTabs = useChatFirstSurfaceTabs(chatFirstSurfaceScope);
@@ -895,23 +921,28 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
895
921
  });
896
922
  }, [chatFirstSurfaceTabsStore, persistChatFirstPane]);
897
923
  const resolveChatFirstOpenApp = useCallback((detail) => {
898
- if (chatFirstAppsQuery.isLoading) {
899
- pendingChatFirstOpenAppRef.current = detail;
900
- return;
901
- }
902
- if (chatFirstAppsQuery.isError) {
903
- pendingChatFirstOpenAppRef.current = null;
904
- setChatFirstNotice("Workspace apps could not be loaded, so the requested app was not opened.");
905
- return;
906
- }
907
924
  const resolution = resolveChatFirstAppTarget(detail, chatFirstAppRegistrations, {
908
925
  currentOrigin: typeof window === "undefined" ? undefined : window.location.origin,
909
926
  });
910
- pendingChatFirstOpenAppRef.current = null;
911
927
  if (resolution.status === "unresolved") {
928
+ if (chatFirstWorkspaceAppsLoading ||
929
+ (resolution.reason === "unknown-app" && chatFirstConnectedAppsLoading)) {
930
+ pendingChatFirstOpenAppRef.current = detail;
931
+ return;
932
+ }
933
+ if (chatFirstConnectedAppsQuery.isError) {
934
+ pendingChatFirstOpenAppRef.current = detail;
935
+ return;
936
+ }
937
+ pendingChatFirstOpenAppRef.current = null;
938
+ if (chatFirstAppsFailed) {
939
+ setChatFirstNotice("Workspace apps could not be loaded, so the requested app was not opened.");
940
+ return;
941
+ }
912
942
  setChatFirstNotice(chatFirstResolutionMessage(resolution.reason));
913
943
  return;
914
944
  }
945
+ pendingChatFirstOpenAppRef.current = null;
915
946
  if (isDispatchWorkspaceAppId(resolution.target.appId)) {
916
947
  closeChatFirstSessionWatch();
917
948
  chatFirstSurfaceTabsStore.closeAll();
@@ -925,8 +956,10 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
925
956
  openChatFirstPane(resolution.target);
926
957
  }, [
927
958
  chatFirstAppRegistrations,
928
- chatFirstAppsQuery.isError,
929
- chatFirstAppsQuery.isLoading,
959
+ chatFirstAppsFailed,
960
+ chatFirstWorkspaceAppsLoading,
961
+ chatFirstConnectedAppsLoading,
962
+ chatFirstConnectedAppsQuery.isError,
930
963
  chatFirstSurfaceTabsStore,
931
964
  openChatFirstPane,
932
965
  navigate,
@@ -984,6 +1017,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
984
1017
  chatFirstSurfaceTabsStore.closeAll();
985
1018
  setChatFirstNotice(null);
986
1019
  pendingChatFirstOpenAppRef.current = null;
1020
+ setPendingChatFirstPaneRestore(null);
987
1021
  chatFirstPaneHydratedRef.current = false;
988
1022
  return;
989
1023
  }
@@ -1001,11 +1035,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1001
1035
  resolveChatFirstOpenBrowser,
1002
1036
  ]);
1003
1037
  useEffect(() => {
1004
- if (!chatFirstMode ||
1005
- !isChatRoute ||
1006
- chatFirstPaneHydratedRef.current ||
1007
- chatFirstAppsQuery.isLoading ||
1008
- chatFirstAppsQuery.isError) {
1038
+ if (!chatFirstMode || !isChatRoute || chatFirstPaneHydratedRef.current) {
1009
1039
  return;
1010
1040
  }
1011
1041
  chatFirstPaneHydratedRef.current = true;
@@ -1016,21 +1046,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1016
1046
  .then((value) => {
1017
1047
  if (!active)
1018
1048
  return;
1019
- const persisted = persistedChatFirstPane(value);
1020
- if (!persisted)
1021
- return;
1022
- const resolution = resolveChatFirstAppTarget({
1023
- app: persisted.appId,
1024
- path: persisted.path,
1025
- view: persisted.view,
1026
- }, chatFirstAppRegistrations, {
1027
- currentOrigin: typeof window === "undefined"
1028
- ? undefined
1029
- : window.location.origin,
1030
- });
1031
- if (resolution.status === "ready") {
1032
- openChatFirstPane(resolution.target, persisted.placement);
1033
- }
1049
+ setPendingChatFirstPaneRestore(persistedChatFirstPane(value));
1034
1050
  })
1035
1051
  .catch(() => {
1036
1052
  if (active) {
@@ -1040,14 +1056,46 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1040
1056
  return () => {
1041
1057
  active = false;
1042
1058
  };
1059
+ }, [chatFirstMode, chatFirstPane, chatFirstSurfaceScope, isChatRoute]);
1060
+ useEffect(() => {
1061
+ if (!chatFirstMode || !isChatRoute || !pendingChatFirstPaneRestore)
1062
+ return;
1063
+ if (chatFirstPane) {
1064
+ setPendingChatFirstPaneRestore(null);
1065
+ return;
1066
+ }
1067
+ const resolution = resolveChatFirstAppTarget({
1068
+ app: pendingChatFirstPaneRestore.appId,
1069
+ path: pendingChatFirstPaneRestore.path,
1070
+ view: pendingChatFirstPaneRestore.view,
1071
+ }, chatFirstAppRegistrations, {
1072
+ currentOrigin: typeof window === "undefined" ? undefined : window.location.origin,
1073
+ });
1074
+ if (resolution.status === "ready") {
1075
+ setPendingChatFirstPaneRestore(null);
1076
+ openChatFirstPane(resolution.target, pendingChatFirstPaneRestore.placement);
1077
+ return;
1078
+ }
1079
+ if (chatFirstWorkspaceAppsLoading ||
1080
+ (resolution.status === "unresolved" &&
1081
+ resolution.reason === "unknown-app" &&
1082
+ chatFirstConnectedAppsLoading) ||
1083
+ chatFirstAppsFailed ||
1084
+ chatFirstConnectedAppsQuery.isError) {
1085
+ return;
1086
+ }
1087
+ setPendingChatFirstPaneRestore(null);
1043
1088
  }, [
1044
- chatFirstAppsQuery.isError,
1045
- chatFirstAppsQuery.isLoading,
1089
+ chatFirstAppsFailed,
1046
1090
  chatFirstAppRegistrations,
1091
+ chatFirstWorkspaceAppsLoading,
1092
+ chatFirstConnectedAppsLoading,
1093
+ chatFirstConnectedAppsQuery.isError,
1047
1094
  chatFirstMode,
1048
1095
  chatFirstPane,
1049
1096
  isChatRoute,
1050
1097
  openChatFirstPane,
1098
+ pendingChatFirstPaneRestore,
1051
1099
  ]);
1052
1100
  useEffect(() => {
1053
1101
  if (previousChatFirstSurfaceScopeRef.current === chatFirstSurfaceScope) {
@@ -1057,6 +1105,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1057
1105
  persistChatFirstPane(null);
1058
1106
  setChatFirstNotice(null);
1059
1107
  pendingChatFirstOpenAppRef.current = null;
1108
+ setPendingChatFirstPaneRestore(null);
1060
1109
  chatFirstPaneHydratedRef.current = true;
1061
1110
  chatFirstSurfaceTabsStore.closeAll();
1062
1111
  setChatFirstSurfacePanelOpen(false);
@@ -1100,13 +1149,16 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1100
1149
  }, [activeChatFirstSurfaceTab, chatFirstSessionWatch.target]);
1101
1150
  useEffect(() => {
1102
1151
  const pending = pendingChatFirstOpenAppRef.current;
1103
- if (!pending || chatFirstAppsQuery.isLoading)
1152
+ if (!pending)
1104
1153
  return;
1105
1154
  resolveChatFirstOpenApp(pending);
1106
1155
  }, [
1107
1156
  chatFirstAppsQuery.data,
1108
- chatFirstAppsQuery.isError,
1109
- chatFirstAppsQuery.isLoading,
1157
+ chatFirstAppsFailed,
1158
+ chatFirstWorkspaceAppsLoading,
1159
+ chatFirstConnectedAppsLoading,
1160
+ chatFirstConnectedAppsQuery.data,
1161
+ chatFirstConnectedAppsQuery.isError,
1110
1162
  resolveChatFirstOpenApp,
1111
1163
  ]);
1112
1164
  useEffect(() => {
@@ -1237,7 +1289,8 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1237
1289
  return renderChatFirstAppSurfaceTab({
1238
1290
  registration,
1239
1291
  embedPath: tab.path ?? registration?.path ?? "/",
1240
- loading: chatFirstAppsQuery.isLoading,
1292
+ loading: !registration &&
1293
+ (chatFirstWorkspaceAppsLoading || chatFirstConnectedAppsLoading),
1241
1294
  isMobileSurface,
1242
1295
  copy: chatFirstCopy,
1243
1296
  });
@@ -1268,7 +1321,8 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1268
1321
  chatFirstAgentsQuery.error,
1269
1322
  chatFirstAgentsQuery.isError,
1270
1323
  chatFirstAgentsQuery.isLoading,
1271
- chatFirstAppsQuery.isLoading,
1324
+ chatFirstWorkspaceAppsLoading,
1325
+ chatFirstConnectedAppsLoading,
1272
1326
  chatFirstCopy,
1273
1327
  chatFirstSessionWatch.target,
1274
1328
  chatFirstSurfaceTabs.activeTabId,
@@ -1337,9 +1391,7 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1337
1391
  const content = isChatRoute ? (_jsx("div", { className: cn("agent-layout-main-surface flex h-full min-w-0 flex-1 overflow-hidden", chatFirstMode && "dispatch-chat-first-surface"), children: chatFirstAppTakesMain ? (_jsx("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden", "data-dispatch-chat-first-main-app": true, children: chatFirstSurfaceContent })) : (_jsxs(_Fragment, { children: [appContent, chatFirstMode &&
1338
1392
  chatFirstHasActiveChat &&
1339
1393
  chatFirstSurfacePanel.open ? (_jsxs(ChatFirstSurfacePanel, { width: chatFirstSurfaceResize.width, onResizePointerDown: chatFirstSurfaceResize.onPointerDown, copy: chatFirstCopy, children: [chatFirstSurfaceTabsBar, chatFirstSurfaceContent] })) : null] })) })) : workspaceAppRouteActive ? null : isWorkspaceAppRoute ? (appContent) : (_jsx(AgentSidebar, { position: "right", defaultOpen: false, agentPageHref: agentPageHref, chatViewTransition: true, storageKey: "dispatch", openOnChatRunning: chatHomeHandoffActive, onFullscreenRequest: openAskAgentFullscreen, emptyStateText: t("dispatch.sidebar.emptyAgentText"), suggestions: sidebarSuggestions, children: appContent }));
1340
- return (_jsx(DispatchExtensionsContext.Provider, { value: extensions, children: _jsx(DispatchWorkspaceAppLauncherContext.Provider, { value: chatHomeAppLauncher, children: _jsx(HeaderActionsProvider, { children: _jsxs("div", { className: "agent-layout-shell flex h-screen w-full overflow-hidden bg-background", children: [isRedesignedSettingsRoute ? null : (_jsx("aside", { "data-collapsed": sidebarCollapsed ? "true" : "false", className: cn("agent-layout-left-drawer hidden shrink-0 flex-col border-e !border-e-sidebar-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out lg:flex", sidebarCollapsed ? "w-14" : "w-[260px]"), children: _jsx(NavContent, { extensions: extensions, brandName: brandName, brandIcon: brandIcon, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded, collapsed: sidebarCollapsed, chatFirstAppLayout: chatFirstAppLayout, onChatFirstAppLayoutChange: persistChatFirstAppLayout, chatFirstApps: chatFirstAppItems, chatFirstAppsLoading: chatFirstAppsQuery.isLoading, chatFirstAppsError: chatFirstAppsQuery.isError
1341
- ? chatFirstCopy("appsLoadError")
1342
- : null, chatFirstActiveAppId: chatFirstActiveAppId, chatFirstActivePrimaryTab: chatFirstActivePrimaryTab, onChatFirstNewChat: () => {
1394
+ return (_jsx(DispatchExtensionsContext.Provider, { value: extensions, children: _jsx(DispatchWorkspaceAppLauncherContext.Provider, { value: chatHomeAppLauncher, children: _jsx(HeaderActionsProvider, { children: _jsxs("div", { className: "agent-layout-shell flex h-screen w-full overflow-hidden bg-background", children: [isRedesignedSettingsRoute ? null : (_jsx("aside", { "data-collapsed": sidebarCollapsed ? "true" : "false", className: cn("agent-layout-left-drawer hidden shrink-0 flex-col border-e !border-e-sidebar-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out lg:flex", sidebarCollapsed ? "w-14" : "w-[260px]"), children: _jsx(NavContent, { extensions: extensions, brandName: brandName, brandIcon: brandIcon, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded, collapsed: sidebarCollapsed, chatFirstAppLayout: chatFirstAppLayout, onChatFirstAppLayoutChange: persistChatFirstAppLayout, chatFirstApps: chatFirstAppItems, chatFirstAppsLoading: chatFirstAppsLoading, chatFirstAppsError: chatFirstAppsError ? chatFirstCopy("appsLoadError") : null, chatFirstActiveAppId: chatFirstActiveAppId, chatFirstActivePrimaryTab: chatFirstActivePrimaryTab, onChatFirstNewChat: () => {
1343
1395
  closeChatFirstSessionWatch();
1344
1396
  chatFirstSurfaceTabsStore.closeAll();
1345
1397
  setChatFirstSurfacePanelOpen(false);
@@ -1348,12 +1400,16 @@ function DispatchLayout({ children, extensions, agentPageHref, brandName, brandI
1348
1400
  return;
1349
1401
  setSidebarCollapsed(true);
1350
1402
  openChatFirstApp(app);
1351
- }, onChatFirstAppsRetry: () => void chatFirstAppsQuery.refetch(), collapsible: true, onCollapsedChange: setSidebarCollapsed }) })), _jsx(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: _jsxs(SheetContent, { side: "left", className: "w-72 bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", children: [_jsx(SheetTitle, { className: "sr-only", children: t("dispatch.nav.navigation") }), _jsx(SheetDescription, { className: "sr-only", children: t("dispatch.nav.navigationDescription") }), _jsx("div", { className: "flex h-full w-full flex-col", children: _jsx(NavContent, { extensions: extensions, brandName: brandName, brandIcon: brandIcon, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded, collapsed: false, chatFirstAppLayout: chatFirstAppLayout, onChatFirstAppLayoutChange: persistChatFirstAppLayout, chatFirstApps: chatFirstAppItems, chatFirstAppsLoading: chatFirstAppsQuery.isLoading, chatFirstAppsError: chatFirstAppsQuery.isError
1352
- ? chatFirstCopy("appsLoadError")
1353
- : null, chatFirstActiveAppId: chatFirstActiveAppId, chatFirstActivePrimaryTab: chatFirstActivePrimaryTab, onChatFirstNewChat: () => {
1403
+ }, onChatFirstAppsRetry: () => {
1404
+ void chatFirstAppsQuery.refetch();
1405
+ void chatFirstConnectedAppsQuery.refetch();
1406
+ }, collapsible: true, onCollapsedChange: setSidebarCollapsed }) })), _jsx(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: _jsxs(SheetContent, { side: "left", className: "w-72 bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", children: [_jsx(SheetTitle, { className: "sr-only", children: t("dispatch.nav.navigation") }), _jsx(SheetDescription, { className: "sr-only", children: t("dispatch.nav.navigationDescription") }), _jsx("div", { className: "flex h-full w-full flex-col", children: _jsx(NavContent, { extensions: extensions, brandName: brandName, brandIcon: brandIcon, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded, collapsed: false, chatFirstAppLayout: chatFirstAppLayout, onChatFirstAppLayoutChange: persistChatFirstAppLayout, chatFirstApps: chatFirstAppItems, chatFirstAppsLoading: chatFirstAppsLoading, chatFirstAppsError: chatFirstAppsError ? chatFirstCopy("appsLoadError") : null, chatFirstActiveAppId: chatFirstActiveAppId, chatFirstActivePrimaryTab: chatFirstActivePrimaryTab, onChatFirstNewChat: () => {
1354
1407
  closeChatFirstSessionWatch();
1355
1408
  chatFirstSurfaceTabsStore.closeAll();
1356
1409
  setChatFirstSurfacePanelOpen(false);
1357
- }, onChatFirstAppOpen: openChatFirstApp, onChatFirstAppsRetry: () => void chatFirstAppsQuery.refetch(), onNavigate: () => setMobileOpen(false) }) })] }) }), _jsxs("div", { className: "relative min-w-0 flex-1 overflow-hidden", children: [content, workspaceAppContent] })] }) }) }) }));
1410
+ }, onChatFirstAppOpen: openChatFirstApp, onChatFirstAppsRetry: () => {
1411
+ void chatFirstAppsQuery.refetch();
1412
+ void chatFirstConnectedAppsQuery.refetch();
1413
+ }, onNavigate: () => setMobileOpen(false) }) })] }) }), _jsxs("div", { className: "relative min-w-0 flex-1 overflow-hidden", children: [content, workspaceAppContent] })] }) }) }) }));
1358
1414
  }
1359
1415
  //# sourceMappingURL=Layout.js.map