@agent-native/dispatch 0.40.41-same-host-mcp-20261027-20261027081850 → 0.40.41

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 (30) hide show
  1. package/CHANGELOG.md +28 -10
  2. package/dist/actions/provider-api-register.d.ts +11 -11
  3. package/dist/actions/upsert-destination.d.ts +12 -12
  4. package/dist/components/action-query-error.d.ts.map +1 -1
  5. package/dist/components/action-query-error.js +8 -0
  6. package/dist/components/action-query-error.js.map +1 -1
  7. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  8. package/dist/server/lib/app-creation-store.js +48 -3
  9. package/dist/server/lib/app-creation-store.js.map +1 -1
  10. package/dist/server/lib/mcp-gateway.d.ts +8 -0
  11. package/dist/server/lib/mcp-gateway.d.ts.map +1 -1
  12. package/dist/server/lib/mcp-gateway.js +71 -11
  13. package/dist/server/lib/mcp-gateway.js.map +1 -1
  14. package/dist/server/lib/workspace-app-chat-proxy.d.ts +6 -5
  15. package/dist/server/lib/workspace-app-chat-proxy.d.ts.map +1 -1
  16. package/dist/server/lib/workspace-app-chat-proxy.js +78 -11
  17. package/dist/server/lib/workspace-app-chat-proxy.js.map +1 -1
  18. package/dist/server/plugins/agent-chat.js +1 -0
  19. package/dist/server/plugins/agent-chat.js.map +1 -1
  20. package/package.json +3 -3
  21. package/src/components/action-query-error.spec.tsx +37 -0
  22. package/src/components/action-query-error.tsx +11 -0
  23. package/src/server/lib/app-creation-store.spec.ts +101 -1
  24. package/src/server/lib/app-creation-store.ts +65 -4
  25. package/src/server/lib/mcp-gateway.spec.ts +135 -1
  26. package/src/server/lib/mcp-gateway.ts +122 -22
  27. package/src/server/lib/workspace-app-chat-proxy.spec.ts +309 -5
  28. package/src/server/lib/workspace-app-chat-proxy.ts +123 -25
  29. package/src/server/plugins/agent-chat.spec.ts +1 -0
  30. package/src/server/plugins/agent-chat.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,50 +1,75 @@
1
1
  # @agent-native/dispatch
2
2
 
3
- ## 0.40.41-same-host-mcp-20261027-20261027081850
3
+ ## 0.40.41
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 778e2d2: Use mounted app MCP endpoints when Dispatch shares the app host.
7
+ - 3e6443d: Use mounted app MCP endpoints when Dispatch shares the app host.
8
8
  - 64b6332: Route Workspace app links through Dispatch's nested app route so child pages resolve on mounted deployments.
9
9
  - 1fe5d77: Support member-scoped MCP identity delegation and preserve Workspace app deep links through flat route shells.
10
10
  - e086032: Apps that Dispatch creates keep first-run onboarding off in development, like the first-party templates, so a local run opens straight into the app.
11
11
  - e548712: Embed a workspace app by its own path when its registry `url` is this Dispatch's page for it. The embed request was rejected and the fallback framed Dispatch inside Dispatch, so apps with a home page of `/` rendered blank and apps with another home page returned 404.
12
12
  - 0ab7e59: Chat history row menus in the Dispatch sidebar now use text-only menu items that join arrow-key navigation and typeahead, so Copy session ID and Watch session are reachable from the keyboard. Archiving a chat from that menu is no longer styled as a destructive action, since archived chats can be restored.
13
+ - Release all public npm packages with a patch version bump.
14
+ - 12a91c6: Show MCP approval reviews inside the app, in its own theme and components. When a signed-in reader opens a review link, an app that opts in now sends them to its home page, with the grant id in the URL fragment (`#mcpApproval=<id>`). The fragment survives the redirects that apps' home routes often make. `AppProviders` then shows the review in place of the app: who the call reaches, every argument, times in the reader's time zone, the client that asked and when it was connected, and a warning when the identical call already ran. It leads with who asks and for what ("Claude Code wants to create event"), and after a decision it keeps one line naming the request. Email addresses wrap only after their "@", never inside a name. Approve and Deny go through the same framework route and token as before, and a decision whose answer is lost is checked against the grant's state before the review says it wasn't saved. At a pending or approved review's deadline, the review asks the server for its state, timing the deadline on the server's clock, so a device clock that runs fast or slow doesn't end the review early or leave it showing "approved" late. The review is shown only in a top-level window, never under `sessionBypass`, on a public page or in another app's document. It sits outside the phone hand-off and first-run onboarding. Sign-in still happens at the link itself, so the link works after sign-in. An app whose shell renders `AppProviders` opts in with `createAgentChatPlugin({ mcp: { appApprovalPage: true } })`, or `appApprovalPage: true` on `mountMCP`; every bundled template and Dispatch do. Without it, a review link keeps the framework's plain page, which works in any app. In an app whose custom authentication has no `getBrowserSession` hook, the review says the app can't confirm the reader's sign-in instead of asking them to sign in, and the route's `401` carries `reason: "sign-in-unavailable"` to tell the two apart. The review's JSON now includes `locale` and `servedAt`, and `@agent-native/core/client/mcp-approval` exports the browser helpers that read and decide a review. On every approval surface (this page, the plain page and the in-client form), a field the summary already shows is left out of the field list but kept in the details: the call's one recipient argument when it holds only addresses (a call that names people under several, such as `to` and `bcc`, keeps each, so the reader sees who is copied how), and a time zone that a time in the summary already shows. A value the schema lists as a choice, including a boolean, reads in words (its `oneOf` or `anyOf` title, or else the enum value split into words, so `externalOnly` reads "External only", while a value that isn't an identifier, such as `America/New_York`, stays as written), and a time zone field reads by name ("Pacific Time"). A time whose zone shares the reader's offset but is another zone, such as London and Lagos in October, also shows the call's own time, naming its zone in full ("United Kingdom Time"), since that zone's own row is left out. `mountMCP` refuses `appApprovalPage` with a route prefix other than `/_agent-native`, the only one the app's review reads.
13
15
  - f635856: Allow Dispatch to pair with the next Core prerelease series.
16
+ - a6e38cf: Preserve trusted request origins and mounted app paths when proxying embedded Workspace chat.
17
+ - 91ec685: A failed session lookup now answers a retryable 503 (`session_unavailable`) instead of the 401 a signed-out visitor gets, and is reported once with its real cause and the request id. The failed-request packet now carries the request id of the request it ran in. Dispatch's "Couldn't load data" card shows that id, and a workspace gateway read that fails now logs its cause, the gateway's own request id and elapsed time, and a gateway that does not answer in time reports `workspace_gateway_timeout` instead of `workspace_gateway_unavailable`.
14
18
  - f635856: Preserve app-only visibility when Dispatch overrides the built-in embed helper so Workspace app sessions reach their iframe without exposing the one-time ticket to the model.
15
19
  - 2e8f454: Compile with `noImplicitOverride` and `noFallthroughCasesInSwitch`, and, where the code already passes them, `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes`. Optional fields that legitimately hold `undefined` are now typed `T | undefined`. No runtime behavior changes.
16
20
  - 62b1459: Fix embedded workspace app chats on path-mounted deployments.
21
+ - Updated dependencies [94dab1c]
17
22
  - Updated dependencies [0ab7e59]
18
23
  - Updated dependencies [f717042]
19
24
  - Updated dependencies [0ab7e59]
25
+ - Updated dependencies [9a61c1d]
20
26
  - Updated dependencies [0ab7e59]
21
27
  - Updated dependencies [0ab7e59]
28
+ - Updated dependencies [99c97eb]
22
29
  - Updated dependencies [0ab7e59]
23
30
  - Updated dependencies [0ab7e59]
31
+ - Updated dependencies [9c559ff]
32
+ - Updated dependencies [9fd95b5]
33
+ - Updated dependencies [2938b17]
24
34
  - Updated dependencies [0ab7e59]
35
+ - Updated dependencies [0c8b261]
36
+ - Updated dependencies [cc341a4]
37
+ - Updated dependencies [180ecbe]
25
38
  - Updated dependencies [0ab7e59]
26
39
  - Updated dependencies [723fac2]
27
40
  - Updated dependencies [0ab7e59]
28
41
  - Updated dependencies [c2a6e7e]
42
+ - Updated dependencies [656b02e]
43
+ - Updated dependencies [1cd201c]
29
44
  - Updated dependencies [c2a6e7e]
30
45
  - Updated dependencies [bdfea6d]
46
+ - Updated dependencies [4173583]
47
+ - Updated dependencies [4173583]
31
48
  - Updated dependencies [369ceab]
32
49
  - Updated dependencies [d569c61]
33
50
  - Updated dependencies [e086032]
34
51
  - Updated dependencies [ee67a21]
35
52
  - Updated dependencies [ef8111a]
36
53
  - Updated dependencies [0ab7e59]
54
+ - Updated dependencies
37
55
  - Updated dependencies [7199312]
56
+ - Updated dependencies [12a91c6]
38
57
  - Updated dependencies [8254996]
39
58
  - Updated dependencies [0ab7e59]
40
59
  - Updated dependencies [f20824d]
60
+ - Updated dependencies [ef46f92]
61
+ - Updated dependencies [b14bed7]
62
+ - Updated dependencies [f83c054]
41
63
  - Updated dependencies [0ab7e59]
42
64
  - Updated dependencies [a9c0fa9]
43
65
  - Updated dependencies [eaa780a]
66
+ - Updated dependencies [d9cfcd4]
44
67
  - Updated dependencies [82efd47]
45
68
  - Updated dependencies [0ab7e59]
46
69
  - Updated dependencies [2e8f454]
47
- - @agent-native/toolkit@0.221.0-same-host-mcp-20261027-20261027081850
70
+ - Updated dependencies [90395b3]
71
+ - Updated dependencies [7ee0542]
72
+ - @agent-native/toolkit@0.221.0
48
73
 
49
74
  ## 0.40.40
50
75
 
@@ -1390,11 +1415,4 @@
1390
1415
 
1391
1416
  - 8e51925: Fix Electron chat feedback around app visibility, local development tools, and run recovery.
1392
1417
 
1393
- ## 0.30.4
1394
-
1395
- ### Patch Changes
1396
-
1397
- - Updated dependencies [fc85cb2]
1398
- - @agent-native/toolkit@0.16.7
1399
-
1400
1418
  For the full list of releases, see the [changelog archive](./changelog/archive/CHANGELOG.md).
@@ -47,9 +47,10 @@ 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
51
  deleted?: undefined;
52
+ provider?: undefined;
53
+ message?: undefined;
53
54
  providers: {
54
55
  id: string;
55
56
  label: string;
@@ -60,35 +61,34 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
60
61
  updatedAt: number;
61
62
  }[];
62
63
  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;
70
69
  deleted?: undefined;
71
- providers?: undefined;
72
70
  count?: undefined;
71
+ message?: undefined;
72
+ providers?: 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
- message?: undefined;
79
78
  deleted?: undefined;
80
- providers?: undefined;
81
- count?: undefined;
82
79
  provider?: undefined;
80
+ count?: undefined;
81
+ message?: undefined;
82
+ providers?: undefined;
83
83
  found: boolean;
84
84
  id: string;
85
85
  registered?: undefined;
86
86
  label?: undefined;
87
87
  } | {
88
+ provider?: undefined;
89
+ count?: undefined;
88
90
  message?: undefined;
89
91
  providers?: undefined;
90
- count?: undefined;
91
- provider?: undefined;
92
92
  found?: undefined;
93
93
  deleted: boolean;
94
94
  id: string;
@@ -96,9 +96,9 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
96
96
  label?: undefined;
97
97
  } | {
98
98
  deleted?: undefined;
99
- providers?: undefined;
100
- count?: undefined;
101
99
  provider?: undefined;
100
+ count?: undefined;
101
+ providers?: undefined;
102
102
  found?: undefined;
103
103
  registered: boolean;
104
104
  id: string;
@@ -6,6 +6,18 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
6
6
  threadRef?: string | undefined;
7
7
  notes?: string | undefined;
8
8
  }, {
9
+ id: string;
10
+ ownerEmail: string;
11
+ orgId: string | null;
12
+ name: string;
13
+ platform: string;
14
+ destination: string;
15
+ threadRef: string | null;
16
+ notes: string | null;
17
+ createdBy: string;
18
+ createdAt: number;
19
+ updatedAt: number;
20
+ } | {
9
21
  id: string;
10
22
  ownerEmail: string;
11
23
  orgId: string | null;
@@ -22,18 +34,6 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
22
34
  reviewedAt: number | null;
23
35
  createdAt: number;
24
36
  updatedAt: number;
25
- } | {
26
- id: string;
27
- ownerEmail: string;
28
- orgId: string | null;
29
- name: string;
30
- platform: string;
31
- destination: string;
32
- threadRef: string | null;
33
- notes: string | null;
34
- createdBy: string;
35
- createdAt: number;
36
- updatedAt: number;
37
37
  }>;
38
38
  export default _default;
39
39
  //# sourceMappingURL=upsert-destination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-query-error.d.ts","sourceRoot":"","sources":["../../src/components/action-query-error.tsx"],"names":[],"mappings":"AAMA,UAAU,qBAAqB;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiCD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,GACV,EAAE,qBAAqB,mDAsBvB"}
1
+ {"version":3,"file":"action-query-error.d.ts","sourceRoot":"","sources":["../../src/components/action-query-error.tsx"],"names":[],"mappings":"AAMA,UAAU,qBAAqB;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4CD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,GACV,EAAE,qBAAqB,mDAsBvB"}
@@ -22,6 +22,14 @@ function actionQueryDiagnostic(error, queryName) {
22
22
  if (typeof code === "string" && /^[a-zA-Z0-9_.-]{1,80}$/.test(code)) {
23
23
  parts.push(code);
24
24
  }
25
+ // The id the server stamped on this response. It is on the server's log
26
+ // and error report for the same failure, so a screenshot is enough to find
27
+ // what went wrong.
28
+ const requestId = details.requestId;
29
+ if (typeof requestId === "string" &&
30
+ /^[a-zA-Z0-9_.-]{1,80}$/.test(requestId)) {
31
+ parts.push(`ref ${requestId}`);
32
+ }
25
33
  }
26
34
  return parts.length > 0 ? parts.join(" · ") : null;
27
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"action-query-error.js","sourceRoot":"","sources":["../../src/components/action-query-error.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,SAAS,qBAAqB,CAC5B,KAAc,EACd,SAA6B;IAE7B,MAAM,KAAK,GAAa,E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AC,UAAU,cAAE,CAAC,CAAC,+BAA+B,CAAC,GAAc,EAC7D,MAAC,gBAAgB,IAAC,SAAS,EAAC,mDAAmD,aAC7E,yBAAO,CAAC,CAAC,0CAA0C,CAAC,GAAQ,EAC3D,UAAU,CAAC,CAAC,CAAC,CACZ,eAAM,SAAS,EAAC,gDAAgD,YAC7D,UAAU,GACN,CACR,CAAC,CAAC,CAAC,IAAI,EACR,MAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,OAAO,aAChE,KAAC,WAAW,IAAC,SAAS,EAAC,QAAQ,GAAG,EACjC,CAAC,CAAC,yBAAyB,CAAC,IACtB,IACQ,IACb,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { useT } from \"@agent-native/core/client/i18n\";\nimport { IconAlertTriangle, IconRefresh } from \"@tabler/icons-react\";\n\nimport { Alert, AlertDescription, AlertTitle } from \"./ui/alert\";\nimport { Button } from \"./ui/button\";\n\ninterface ActionQueryErrorProps {\n error?: unknown;\n onRetry: () => unknown;\n className?: string;\n queryName?: string;\n}\n\nfunction actionQueryDiagnostic(\n error: unknown,\n queryName: string | undefined,\n): string | null {\n const parts: string[] = [];\n if (queryName) parts.push(queryName);\n\n if (error && typeof error === \"object\") {\n const details = error as Record<string, unknown>;\n const status =\n typeof details.statusCode === \"number\"\n ? details.statusCode\n : details.status;\n if (\n typeof status === \"number\" &&\n Number.isInteger(status) &&\n status >= 100 &&\n status <= 599\n ) {\n parts.push(`HTTP ${status}`);\n }\n\n const code = details.errorCode ?? details.code;\n if (typeof code === \"string\" && /^[a-zA-Z0-9_.-]{1,80}$/.test(code)) {\n parts.push(code);\n }\n }\n\n return parts.length > 0 ? parts.join(\" · \") : null;\n}\n\nexport function ActionQueryError({\n error,\n onRetry,\n className,\n queryName,\n}: ActionQueryErrorProps) {\n const t = useT();\n const diagnostic = actionQueryDiagnostic(error, queryName);\n\n return (\n <Alert variant=\"destructive\" className={className}>\n <IconAlertTriangle className=\"size-4\" />\n <AlertTitle>{t(\"dispatch.pages.dataLoadFailed\")}</AlertTitle>\n <AlertDescription className=\"flex flex-wrap items-center justify-between gap-3\">\n <span>{t(\"dispatch.pages.dataLoadFailedDescription\")}</span>\n {diagnostic ? (\n <code className=\"w-full break-all text-xs text-muted-foreground\">\n {diagnostic}\n </code>\n ) : null}\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <IconRefresh className=\"size-4\" />\n {t(\"dispatch.pages.tryAgain\")}\n </Button>\n </AlertDescription>\n </Alert>\n );\n}\n"]}
1
+ {"version":3,"file":"action-query-error.js","sourceRoot":"","sources":["../../src/components/action-query-error.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,SAAS,qBAAqB,CAC5B,KAAc,EACd,SAA6B;IAE7B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAErC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,KAAgC,CAAC;QACjD,MAAM,MAAM,GACV,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ;YACpC,CAAC,CAAC,OAAO,CAAC,UAAU;YACpB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,IACE,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;YACxB,MAAM,IAAI,GAAG;YACb,MAAM,IAAI,GAAG,EACb,CAAC;Y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C,gDAAgD,YAC7D,UAAU,GACN,CACR,CAAC,CAAC,CAAC,IAAI,EACR,MAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,OAAO,aAChE,KAAC,WAAW,IAAC,SAAS,EAAC,QAAQ,GAAG,EACjC,CAAC,CAAC,yBAAyB,CAAC,IACtB,IACQ,IACb,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { useT } from \"@agent-native/core/client/i18n\";\nimport { IconAlertTriangle, IconRefresh } from \"@tabler/icons-react\";\n\nimport { Alert, AlertDescription, AlertTitle } from \"./ui/alert\";\nimport { Button } from \"./ui/button\";\n\ninterface ActionQueryErrorProps {\n error?: unknown;\n onRetry: () => unknown;\n className?: string;\n queryName?: string;\n}\n\nfunction actionQueryDiagnostic(\n error: unknown,\n queryName: string | undefined,\n): string | null {\n const parts: string[] = [];\n if (queryName) parts.push(queryName);\n\n if (error && typeof error === \"object\") {\n const details = error as Record<string, unknown>;\n const status =\n typeof details.statusCode === \"number\"\n ? details.statusCode\n : details.status;\n if (\n typeof status === \"number\" &&\n Number.isInteger(status) &&\n status >= 100 &&\n status <= 599\n ) {\n parts.push(`HTTP ${status}`);\n }\n\n const code = details.errorCode ?? details.code;\n if (typeof code === \"string\" && /^[a-zA-Z0-9_.-]{1,80}$/.test(code)) {\n parts.push(code);\n }\n\n // The id the server stamped on this response. It is on the server's log\n // and error report for the same failure, so a screenshot is enough to find\n // what went wrong.\n const requestId = details.requestId;\n if (\n typeof requestId === \"string\" &&\n /^[a-zA-Z0-9_.-]{1,80}$/.test(requestId)\n ) {\n parts.push(`ref ${requestId}`);\n }\n }\n\n return parts.length > 0 ? parts.join(\" · \") : null;\n}\n\nexport function ActionQueryError({\n error,\n onRetry,\n className,\n queryName,\n}: ActionQueryErrorProps) {\n const t = useT();\n const diagnostic = actionQueryDiagnostic(error, queryName);\n\n return (\n <Alert variant=\"destructive\" className={className}>\n <IconAlertTriangle className=\"size-4\" />\n <AlertTitle>{t(\"dispatch.pages.dataLoadFailed\")}</AlertTitle>\n <AlertDescription className=\"flex flex-wrap items-center justify-between gap-3\">\n <span>{t(\"dispatch.pages.dataLoadFailedDescription\")}</span>\n {diagnostic ? (\n <code className=\"w-full break-all text-xs text-muted-foreground\">\n {diagnostic}\n </code>\n ) : null}\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <IconRefresh className=\"size-4\" />\n {t(\"dispatch.pages.tryAgain\")}\n </Button>\n </AlertDescription>\n </Alert>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"app-creation-store.d.ts","sourceRoot":"","sources":["../../../src/server/lib/app-creation-store.ts"],"names":[],"mappings":"AAwBA,OAAO,EAeL,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AA4InC,KAAK,oBAAoB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,KAAK,sBAAsB,GAAG,SAAS,GAAG,KAAK,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UA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B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,+BAA+B,GACvC,oCAAoC,GACpC,mCAAmC,GACnC,2BAA2B,GAC3B,2BAA2B,GAC3B,2BAA2B,GAC3B,wBAAwB,CAAC;AAE7B,wBAAsB,yBAAyB,CAAC,KAAK,EAAE;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAqQ3C"}
@@ -110,6 +110,36 @@ function warnWorkspaceAppsGatewayDenial(denial, source) {
110
110
  return;
111
111
  console.warn(`[dispatch] workspace apps gateway denied the registry read with HTTP ${denial.statusCode}; served the ${source} instead`);
112
112
  }
113
+ function noteWorkspaceAppsGatewayResponse(attempt, response) {
114
+ const requestId = response.headers.get("x-agent-native-request-id");
115
+ attempt.upstream = {
116
+ status: response.status,
117
+ ...(requestId ? { requestId } : {}),
118
+ };
119
+ }
120
+ // The action route returns a typed contract error without capturing it, so a
121
+ // refusal, a timeout and an outage would all read as one 503 with no trace.
122
+ // `upstreamRequestId` is the id the workspace stamped on its own answer: it
123
+ // opens that side's log for the same read.
124
+ function logWorkspaceAppsGatewayFailure(failure, attempt, cause) {
125
+ const requestId = getRequestContext()?.requestId;
126
+ console.warn("[dispatch] workspace apps gateway read failed:", {
127
+ errorCode: failure.errorCode,
128
+ status: failure.statusCode,
129
+ ...(requestId ? { requestId } : {}),
130
+ gateway: attempt.gateway,
131
+ elapsedMs: Date.now() - attempt.startedAt,
132
+ ...(attempt.upstream
133
+ ? {
134
+ upstreamStatus: attempt.upstream.status,
135
+ ...(attempt.upstream.requestId
136
+ ? { upstreamRequestId: attempt.upstream.requestId }
137
+ : {}),
138
+ }
139
+ : {}),
140
+ ...(cause === undefined ? {} : { cause: describeErrorWithCauses(cause) }),
141
+ });
142
+ }
113
143
  function readJson(file) {
114
144
  if (!fs.existsSync(file))
115
145
  return null;
@@ -1560,6 +1590,10 @@ async function readWorkspaceAppsFromGateway() {
1560
1590
  }
1561
1591
  const controller = new AbortController();
1562
1592
  const timeout = setTimeout(() => controller.abort(), WORKSPACE_APPS_GATEWAY_TIMEOUT_MS);
1593
+ const attempt = {
1594
+ startedAt: Date.now(),
1595
+ gateway: `${baseUrl.origin}${baseUrl.pathname.replace(/\/+$/, "")}`,
1596
+ };
1563
1597
  const gatewayUrl = (pathname) => {
1564
1598
  const url = new URL(baseUrl.toString());
1565
1599
  const basePath = url.pathname.replace(/\/+$/, "");
@@ -1604,6 +1638,7 @@ async function readWorkspaceAppsFromGateway() {
1604
1638
  ...protectedRedirect,
1605
1639
  signal: controller.signal,
1606
1640
  });
1641
+ noteWorkspaceAppsGatewayResponse(attempt, localResponse);
1607
1642
  if (localResponse.status === 401 || localResponse.status === 403) {
1608
1643
  throw new WorkspaceAppsGatewayAuthorizationError(localResponse.status, "workspace_gateway_rejected");
1609
1644
  }
@@ -1627,6 +1662,7 @@ async function readWorkspaceAppsFromGateway() {
1627
1662
  ...protectedRedirect,
1628
1663
  signal: controller.signal,
1629
1664
  });
1665
+ noteWorkspaceAppsGatewayResponse(attempt, actionResponse);
1630
1666
  if (actionResponse.status === 401 || actionResponse.status === 403) {
1631
1667
  throw new WorkspaceAppsGatewayAuthorizationError(actionResponse.status, "workspace_gateway_rejected");
1632
1668
  }
@@ -1641,12 +1677,21 @@ async function readWorkspaceAppsFromGateway() {
1641
1677
  return await readAppsResponse(actionResponse);
1642
1678
  }
1643
1679
  catch (error) {
1644
- if (error instanceof ActionContractError)
1680
+ if (error instanceof ActionContractError) {
1681
+ logWorkspaceAppsGatewayFailure(error, attempt, undefined);
1645
1682
  throw error;
1646
- throw new ActionContractError("Workspace apps gateway could not be reached.", {
1683
+ }
1684
+ const timedOut = controller.signal.aborted;
1685
+ const failure = new ActionContractError(timedOut
1686
+ ? "Workspace apps gateway did not answer in time."
1687
+ : "Workspace apps gateway could not be reached.", {
1647
1688
  statusCode: 503,
1648
- errorCode: "workspace_gateway_unavailable",
1689
+ errorCode: timedOut
1690
+ ? "workspace_gateway_timeout"
1691
+ : "workspace_gateway_unavailable",
1649
1692
  });
1693
+ logWorkspaceAppsGatewayFailure(failure, attempt, error);
1694
+ throw failure;
1650
1695
  }
1651
1696
  finally {
1652
1697
  clearTimeout(timeout);