@agent-native/dispatch 0.43.0-nightly-20261120212328 → 0.43.7
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.
- package/CHANGELOG.md +194 -174
- package/dist/actions/ask_app.d.ts +3 -0
- package/dist/actions/ask_app.js +7 -2
- package/dist/actions/ask_app.js.map +1 -1
- package/dist/actions/ask_app_status.d.ts +3 -0
- package/dist/actions/ask_app_status.js +5 -1
- package/dist/actions/ask_app_status.js.map +1 -1
- package/dist/actions/call_app_action.d.ts +1 -0
- package/dist/actions/call_app_action.js +21 -5
- package/dist/actions/call_app_action.js.map +1 -1
- package/dist/actions/create_embed_session.d.ts +3 -2
- package/dist/actions/create_embed_session.js +4 -2
- package/dist/actions/create_embed_session.js.map +1 -1
- package/dist/actions/create_workspace_app_embed_session.d.ts +3 -2
- package/dist/actions/create_workspace_app_embed_session.js +3 -1
- package/dist/actions/create_workspace_app_embed_session.js.map +1 -1
- package/dist/actions/delete-destination.d.ts +12 -12
- package/dist/actions/execute-action-suggestion.d.ts +44 -0
- package/dist/actions/execute-action-suggestion.d.ts.map +1 -0
- package/dist/actions/execute-action-suggestion.js +148 -0
- package/dist/actions/execute-action-suggestion.js.map +1 -0
- package/dist/actions/import-agent.d.ts +13 -13
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +5 -1
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/list-connected-agents.js +3 -2
- package/dist/actions/list-connected-agents.js.map +1 -1
- package/dist/actions/list-workspace-connections.d.ts +1 -0
- package/dist/actions/list-workspace-connections.d.ts.map +1 -1
- package/dist/actions/list_app_actions.js +1 -1
- package/dist/actions/list_app_actions.js.map +1 -1
- package/dist/actions/list_apps.d.ts +2 -0
- package/dist/actions/list_apps.js +11 -3
- package/dist/actions/list_apps.js.map +1 -1
- package/dist/actions/navigate.js +1 -0
- package/dist/actions/navigate.js.map +1 -1
- package/dist/actions/open_app.d.ts +4 -0
- package/dist/actions/open_app.js +14 -6
- package/dist/actions/open_app.js.map +1 -1
- package/dist/actions/propose-action-suggestions.d.ts +45 -0
- package/dist/actions/propose-action-suggestions.d.ts.map +1 -0
- package/dist/actions/propose-action-suggestions.js +32 -0
- package/dist/actions/propose-action-suggestions.js.map +1 -0
- package/dist/actions/provider-api-register.d.ts +12 -12
- package/dist/actions/read_view.js +1 -1
- package/dist/actions/read_view.js.map +1 -1
- package/dist/actions/remember-pointer.js +1 -1
- package/dist/actions/remember-pointer.js.map +1 -1
- package/dist/actions/resolve-pointer.js +1 -1
- package/dist/actions/resolve-pointer.js.map +1 -1
- package/dist/actions/route-app-intent.d.ts +6 -0
- package/dist/actions/route-app-intent.js +79 -5
- package/dist/actions/route-app-intent.js.map +1 -1
- package/dist/actions/send-code-agent-remote-command.js +4 -0
- package/dist/actions/send-code-agent-remote-command.js.map +1 -1
- package/dist/actions/start-workspace-app-creation.js +1 -1
- package/dist/actions/start-workspace-app-creation.js.map +1 -1
- package/dist/actions/upsert-destination.d.ts +12 -12
- package/dist/actions/view-screen.d.ts +12 -1
- package/dist/actions/view-screen.js +53 -5
- package/dist/actions/view-screen.js.map +1 -1
- package/dist/components/chat-action-suggestions.d.ts +8 -0
- package/dist/components/chat-action-suggestions.d.ts.map +1 -0
- package/dist/components/chat-action-suggestions.js +191 -0
- package/dist/components/chat-action-suggestions.js.map +1 -0
- package/dist/components/chat-home-apps.d.ts.map +1 -1
- package/dist/components/chat-home-apps.js +1 -1
- package/dist/components/chat-home-apps.js.map +1 -1
- package/dist/components/google-broker-settings-group.d.ts +2 -0
- package/dist/components/google-broker-settings-group.d.ts.map +1 -0
- package/dist/components/google-broker-settings-group.js +53 -0
- package/dist/components/google-broker-settings-group.js.map +1 -0
- package/dist/components/layout/Layout.d.ts +4 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +246 -69
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/messaging-setup-panel.d.ts.map +1 -1
- package/dist/components/messaging-setup-panel.js +47 -15
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/components/workspace-app-host.d.ts +27 -4
- package/dist/components/workspace-app-host.d.ts.map +1 -1
- package/dist/components/workspace-app-host.js +355 -74
- package/dist/components/workspace-app-host.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/db/google-broker-admission.d.ts +36 -0
- package/dist/db/google-broker-admission.d.ts.map +1 -0
- package/dist/db/google-broker-admission.js +129 -0
- package/dist/db/google-broker-admission.js.map +1 -0
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +42 -0
- package/dist/db/migrations.js.map +1 -1
- package/dist/lib/action-suggestions.d.ts +20 -0
- package/dist/lib/action-suggestions.d.ts.map +1 -0
- package/dist/lib/action-suggestions.js +219 -0
- package/dist/lib/action-suggestions.js.map +1 -0
- package/dist/lib/chat-first-app-route.d.ts +11 -5
- package/dist/lib/chat-first-app-route.d.ts.map +1 -1
- package/dist/lib/chat-first-app-route.js +9 -5
- package/dist/lib/chat-first-app-route.js.map +1 -1
- package/dist/lib/chat-first-pane.d.ts +25 -1
- package/dist/lib/chat-first-pane.d.ts.map +1 -1
- package/dist/lib/chat-first-pane.js +67 -1
- package/dist/lib/chat-first-pane.js.map +1 -1
- package/dist/lib/data-intent.d.ts +3 -0
- package/dist/lib/data-intent.d.ts.map +1 -0
- package/dist/lib/data-intent.js +14 -0
- package/dist/lib/data-intent.js.map +1 -0
- package/dist/lib/dispatch-app-identity.d.ts +10 -0
- package/dist/lib/dispatch-app-identity.d.ts.map +1 -0
- package/dist/lib/dispatch-app-identity.js +18 -0
- package/dist/lib/dispatch-app-identity.js.map +1 -0
- package/dist/lib/other-apps.d.ts +15 -0
- package/dist/lib/other-apps.d.ts.map +1 -1
- package/dist/lib/other-apps.js +31 -0
- package/dist/lib/other-apps.js.map +1 -1
- package/dist/lib/workspace-app-frame-view.d.ts +15 -0
- package/dist/lib/workspace-app-frame-view.d.ts.map +1 -0
- package/dist/lib/workspace-app-frame-view.js +72 -0
- package/dist/lib/workspace-app-frame-view.js.map +1 -0
- package/dist/lib/workspace-apps.d.ts +5 -0
- package/dist/lib/workspace-apps.d.ts.map +1 -1
- package/dist/lib/workspace-apps.js +85 -23
- package/dist/lib/workspace-apps.js.map +1 -1
- package/dist/lib/workspace-apps.test.js +6 -0
- package/dist/lib/workspace-apps.test.js.map +1 -1
- package/dist/routes/pages/_index.d.ts +2 -2
- package/dist/routes/pages/chat.d.ts.map +1 -1
- package/dist/routes/pages/chat.js +33 -2
- package/dist/routes/pages/chat.js.map +1 -1
- package/dist/routes/pages/settings-page.d.ts +1 -1
- package/dist/routes/pages/settings-page.d.ts.map +1 -1
- package/dist/routes/pages/settings-page.js +3 -2
- package/dist/routes/pages/settings-page.js.map +1 -1
- package/dist/server/index.d.ts +4 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +5 -5
- package/dist/server/index.js.map +1 -1
- package/dist/server/lib/action-suggestions.d.ts +41 -0
- package/dist/server/lib/action-suggestions.d.ts.map +1 -0
- package/dist/server/lib/action-suggestions.js +94 -0
- package/dist/server/lib/action-suggestions.js.map +1 -0
- package/dist/server/lib/app-action-result.d.ts +5 -0
- package/dist/server/lib/app-action-result.d.ts.map +1 -1
- package/dist/server/lib/app-action-result.js +7 -0
- package/dist/server/lib/app-action-result.js.map +1 -1
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +63 -13
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/dist/server/lib/curated-workspace-templates.d.ts.map +1 -1
- package/dist/server/lib/curated-workspace-templates.js +3 -0
- package/dist/server/lib/curated-workspace-templates.js.map +1 -1
- package/dist/server/lib/dispatch-config.d.ts +5 -0
- package/dist/server/lib/dispatch-config.d.ts.map +1 -0
- package/dist/server/lib/dispatch-config.js +11 -0
- package/dist/server/lib/dispatch-config.js.map +1 -0
- package/dist/server/lib/dispatch-pane-context.d.ts +11 -0
- package/dist/server/lib/dispatch-pane-context.d.ts.map +1 -0
- package/dist/server/lib/dispatch-pane-context.js +35 -0
- package/dist/server/lib/dispatch-pane-context.js.map +1 -0
- package/dist/server/lib/google-broker-provider.d.ts +41 -0
- package/dist/server/lib/google-broker-provider.d.ts.map +1 -0
- package/dist/server/lib/google-broker-provider.js +96 -0
- package/dist/server/lib/google-broker-provider.js.map +1 -0
- package/dist/server/lib/google-broker-rpc.d.ts +26 -0
- package/dist/server/lib/google-broker-rpc.d.ts.map +1 -0
- package/dist/server/lib/google-broker-rpc.js +52 -0
- package/dist/server/lib/google-broker-rpc.js.map +1 -0
- package/dist/server/lib/hosted-apps-settings.d.ts.map +1 -1
- package/dist/server/lib/hosted-apps-settings.js +4 -0
- package/dist/server/lib/hosted-apps-settings.js.map +1 -1
- package/dist/server/lib/mcp-app-discovery.d.ts +17 -0
- package/dist/server/lib/mcp-app-discovery.d.ts.map +1 -0
- package/dist/server/lib/mcp-app-discovery.js +231 -0
- package/dist/server/lib/mcp-app-discovery.js.map +1 -0
- package/dist/server/lib/mcp-gateway.d.ts +64 -21
- package/dist/server/lib/mcp-gateway.d.ts.map +1 -1
- package/dist/server/lib/mcp-gateway.js +730 -88
- package/dist/server/lib/mcp-gateway.js.map +1 -1
- package/dist/server/plugins/agent-chat.js +9 -7
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/dist/server/plugins/auth.d.ts.map +1 -1
- package/dist/server/plugins/auth.js +1 -0
- package/dist/server/plugins/auth.js.map +1 -1
- package/dist/server/plugins/db.d.ts.map +1 -1
- package/dist/server/plugins/db.js +0 -46
- package/dist/server/plugins/db.js.map +1 -1
- package/dist/server/plugins/integrations.d.ts.map +1 -1
- package/dist/server/plugins/integrations.js +4 -1
- package/dist/server/plugins/integrations.js.map +1 -1
- package/dist/shared/chat-first-pane.d.ts +24 -0
- package/dist/shared/chat-first-pane.d.ts.map +1 -1
- package/dist/shared/chat-first-pane.js +34 -0
- package/dist/shared/chat-first-pane.js.map +1 -1
- package/dist/shared/labs.d.ts +1 -0
- package/dist/shared/labs.d.ts.map +1 -1
- package/dist/shared/labs.js +7 -0
- package/dist/shared/labs.js.map +1 -1
- package/package.json +7 -6
- package/src/actions/action-suggestions.spec.ts +342 -0
- package/src/actions/app_actions.spec.ts +103 -0
- package/src/actions/ask_app.ts +9 -2
- package/src/actions/ask_app_status.ts +12 -1
- package/src/actions/call_app_action.ts +28 -8
- package/src/actions/create_embed_session.ts +8 -2
- package/src/actions/create_workspace_app_embed_session.ts +6 -1
- package/src/actions/execute-action-suggestion.ts +177 -0
- package/src/actions/index.spec.ts +6 -3
- package/src/actions/index.ts +5 -1
- package/src/actions/list-connected-agents.spec.ts +26 -1
- package/src/actions/list-connected-agents.ts +7 -4
- package/src/actions/list_app_actions.ts +1 -1
- package/src/actions/list_apps.spec.ts +58 -22
- package/src/actions/list_apps.ts +12 -5
- package/src/actions/navigate.ts +1 -0
- package/src/actions/open_app.spec.ts +17 -1
- package/src/actions/open_app.ts +21 -8
- package/src/actions/propose-action-suggestions.ts +42 -0
- package/src/actions/read_view.ts +1 -1
- package/src/actions/remember-pointer.ts +1 -1
- package/src/actions/resolve-pointer.ts +1 -1
- package/src/actions/route-app-intent.spec.ts +234 -5
- package/src/actions/route-app-intent.ts +89 -4
- package/src/actions/send-code-agent-remote-command.spec.ts +40 -0
- package/src/actions/send-code-agent-remote-command.ts +5 -0
- package/src/actions/start-workspace-app-creation.ts +1 -1
- package/src/actions/view-screen.bundle.spec.ts +15 -2
- package/src/actions/view-screen.spec.ts +81 -3
- package/src/actions/view-screen.ts +60 -4
- package/src/components/chat-action-suggestions.spec.tsx +362 -0
- package/src/components/chat-action-suggestions.tsx +432 -0
- package/src/components/chat-home-apps.spec.tsx +19 -0
- package/src/components/chat-home-apps.tsx +0 -1
- package/src/components/google-broker-settings-group.tsx +186 -0
- package/src/components/layout/Layout.spec.tsx +419 -28
- package/src/components/layout/Layout.tsx +304 -66
- package/src/components/messaging-setup-panel.spec.tsx +278 -4
- package/src/components/messaging-setup-panel.tsx +82 -19
- package/src/components/workspace-app-card.spec.tsx +79 -10
- package/src/components/workspace-app-chat-rail.spec.tsx +81 -3
- package/src/components/workspace-app-host.spec.tsx +269 -16
- package/src/components/workspace-app-host.tsx +464 -87
- package/src/config.ts +5 -0
- package/src/db/google-broker-admission.ts +160 -0
- package/src/db/migrations.spec.ts +165 -2
- package/src/db/migrations.ts +43 -1
- package/src/lib/action-suggestions.ts +267 -0
- package/src/lib/chat-first-app-route.spec.ts +15 -2
- package/src/lib/chat-first-app-route.ts +19 -7
- package/src/lib/chat-first-pane.spec.ts +71 -0
- package/src/lib/chat-first-pane.ts +101 -4
- package/src/lib/data-intent.spec.ts +21 -0
- package/src/lib/data-intent.ts +13 -0
- package/src/lib/dispatch-app-identity.ts +40 -0
- package/src/lib/other-apps.spec.ts +110 -1
- package/src/lib/other-apps.ts +41 -0
- package/src/lib/workspace-app-frame-view.spec.ts +13 -0
- package/src/lib/workspace-app-frame-view.ts +98 -0
- package/src/lib/workspace-apps.spec.ts +101 -0
- package/src/lib/workspace-apps.test.ts +18 -0
- package/src/lib/workspace-apps.ts +102 -24
- package/src/routes/pages/chat.spec.tsx +92 -1
- package/src/routes/pages/chat.tsx +41 -2
- package/src/routes/pages/settings-page.tsx +22 -17
- package/src/routes/pages/settings.spec.tsx +4 -0
- package/src/server/index.ts +6 -6
- package/src/server/lib/action-suggestions.ts +122 -0
- package/src/server/lib/app-action-result.ts +8 -0
- package/src/server/lib/app-creation-store.spec.ts +251 -0
- package/src/server/lib/app-creation-store.ts +72 -12
- package/src/server/lib/community-apps.spec.ts +19 -1
- package/src/server/lib/curated-workspace-templates.spec.ts +12 -0
- package/src/server/lib/curated-workspace-templates.ts +2 -0
- package/src/server/lib/dispatch-config.ts +15 -0
- package/src/server/lib/dispatch-pane-context.spec.ts +54 -0
- package/src/server/lib/dispatch-pane-context.ts +54 -0
- package/src/server/lib/google-broker-provider.ts +121 -0
- package/src/server/lib/google-broker-rpc.spec.ts +95 -0
- package/src/server/lib/google-broker-rpc.ts +107 -0
- package/src/server/lib/hosted-apps-settings.ts +4 -0
- package/src/server/lib/mcp-app-discovery.ts +318 -0
- package/src/server/lib/mcp-gateway.spec.ts +2252 -524
- package/src/server/lib/mcp-gateway.ts +1044 -181
- package/src/server/plugins/agent-chat.direct-mcp.spec.ts +84 -5
- package/src/server/plugins/agent-chat.ts +9 -7
- package/src/server/plugins/auth.spec.ts +5 -1
- package/src/server/plugins/auth.ts +1 -0
- package/src/server/plugins/db.ts +0 -51
- package/src/server/plugins/integrations.ts +4 -1
- package/src/shared/chat-first-pane.spec.ts +36 -0
- package/src/shared/chat-first-pane.ts +55 -0
- package/src/shared/labs.ts +8 -0
- package/src/server/plugins/agent-chat.spec.ts +0 -206
- package/src/server/plugins/integrations.spec.ts +0 -60
|
@@ -41,6 +41,7 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
|
41
41
|
scopes: readonly string[];
|
|
42
42
|
requiredScopes?: readonly string[];
|
|
43
43
|
};
|
|
44
|
+
personalOAuth?: import("@agent-native/core/connections").WorkspaceConnectionProvider["oauth"];
|
|
44
45
|
readiness: import("@agent-native/core/workspace-connections").WorkspaceConnectionProviderReadiness;
|
|
45
46
|
rawProviderApi: {
|
|
46
47
|
available: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-workspace-connections.d.ts","sourceRoot":"","sources":["../../src/actions/list-workspace-connections.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACpC,MAAM,gCAAgC,CAAC;AA2BxC,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AASF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,gBAAgB,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,KAAK,uBAAuB,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,CAAC;;;;;;;;;QAsOrE,WAAW;YACT,MAAM;YACN,SAAS
|
|
1
|
+
{"version":3,"file":"list-workspace-connections.d.ts","sourceRoot":"","sources":["../../src/actions/list-workspace-connections.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACpC,MAAM,gCAAgC,CAAC;AA2BxC,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AASF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,gBAAgB,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,KAAK,uBAAuB,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,CAAC;;;;;;;;;QAsOrE,WAAW;YACT,MAAM;YACN,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASX,SAAS;QACT,WAAW;QACX,MAAM;QACN,iBAAiB;QAEjB,sBAAsB;QAGtB,cAAc"}
|
|
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core/action";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { listGrantedDispatchMcpAppActions } from "../server/lib/mcp-gateway.js";
|
|
4
4
|
export default defineAction({
|
|
5
|
-
description: "List the actions a granted app
|
|
5
|
+
description: "List the actions exposed by a granted app (such as reading inbox messages, creating drafts, or managing events) as names and brief descriptions. Optional `names` filters the response to full input schemas for specific actions.",
|
|
6
6
|
schema: z.object({
|
|
7
7
|
app: z.string().describe("Granted app id, e.g. mail or calendar."),
|
|
8
8
|
names: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_app_actions.js","sourceRoot":"","sources":["../../src/actions/list_app_actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAEhF,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"list_app_actions.js","sourceRoot":"","sources":["../../src/actions/list_app_actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAEhF,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,oOAAoO;IACtO,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAClE,KAAK,EAAE,CAAC;aACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CAAC,gDAAgD,CAAC;KAC9D,CAAC;IACF,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CACd,CAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;YACvB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;YACzD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SACjC,CAAC,CACH;KACF,CAAC;IACF,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9B,GAAG;QACH,OAAO,EAAE,MAAM,gCAAgC,CAAC,GAAG,EAAE,KAAK,CAAC;KAC5D,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport { listGrantedDispatchMcpAppActions } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"List the actions exposed by a granted app (such as reading inbox messages, creating drafts, or managing events) as names and brief descriptions. Optional `names` filters the response to full input schemas for specific actions.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n names: z\n .array(z.string())\n .optional()\n .describe(\"Action names to return full input schemas for.\"),\n }),\n outputSchema: z.object({\n app: z.string(),\n actions: z.array(\n z.object({\n name: z.string(),\n description: z.string(),\n inputSchema: z.record(z.string(), z.unknown()).optional(),\n readOnly: z.boolean().optional(),\n }),\n ),\n }),\n readOnly: true,\n parallelSafe: true,\n run: async ({ app, names }) => ({\n app,\n actions: await listGrantedDispatchMcpAppActions(app, names),\n }),\n});\n"]}
|
|
@@ -6,9 +6,11 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<Rec
|
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|
|
8
8
|
url: string;
|
|
9
|
+
aliases?: string[] | undefined;
|
|
9
10
|
running: boolean;
|
|
10
11
|
source: string;
|
|
11
12
|
}[];
|
|
13
|
+
degradedSources: import("../server/lib/mcp-app-discovery.js").DispatchMcpDegradedSource[];
|
|
12
14
|
message: string;
|
|
13
15
|
}>;
|
|
14
16
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core/action";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { hideHostedAppsWhenOff } from "../server/lib/hosted-apps-settings.js";
|
|
4
|
-
import {
|
|
4
|
+
import { listGrantedDispatchMcpAppsWithStatus } from "../server/lib/mcp-gateway.js";
|
|
5
5
|
export default defineAction({
|
|
6
6
|
description: 'List the apps this Dispatch MCP gateway can route to, including "dispatch" itself for Dispatch-owned pages such as extensions. The result is filtered by Dispatch\'s MCP app access policy, and leaves out Agent-Native.com hosted apps while the organization hides them.',
|
|
7
7
|
schema: z.object({}),
|
|
@@ -9,12 +9,14 @@ export default defineAction({
|
|
|
9
9
|
readOnly: true,
|
|
10
10
|
parallelSafe: true,
|
|
11
11
|
run: async () => {
|
|
12
|
-
const apps = await
|
|
12
|
+
const { apps: granted, degradedSources } = await listGrantedDispatchMcpAppsWithStatus();
|
|
13
|
+
const apps = await hideHostedAppsWhenOff(granted);
|
|
13
14
|
const appSummaries = apps.map((app) => ({
|
|
14
15
|
id: app.id,
|
|
15
16
|
name: app.name,
|
|
16
17
|
description: app.description,
|
|
17
18
|
url: app.url,
|
|
19
|
+
...(app.aliases?.length ? { aliases: app.aliases } : {}),
|
|
18
20
|
running: true,
|
|
19
21
|
source: "dispatch-mcp-grant",
|
|
20
22
|
}));
|
|
@@ -22,8 +24,14 @@ export default defineAction({
|
|
|
22
24
|
workspace: true,
|
|
23
25
|
gateway: "dispatch",
|
|
24
26
|
apps: appSummaries,
|
|
27
|
+
degradedSources,
|
|
25
28
|
message: JSON.stringify({
|
|
26
|
-
apps: appSummaries.map(({ id, name }) => ({
|
|
29
|
+
apps: appSummaries.map(({ id, name, aliases }) => ({
|
|
30
|
+
id,
|
|
31
|
+
name,
|
|
32
|
+
...(aliases?.length ? { aliases } : {}),
|
|
33
|
+
})),
|
|
34
|
+
...(degradedSources.length ? { degradedSources } : {}),
|
|
27
35
|
}),
|
|
28
36
|
};
|
|
29
37
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_apps.js","sourceRoot":"","sources":["../../src/actions/list_apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list_apps.js","sourceRoot":"","sources":["../../src/actions/list_apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,oCAAoC,EAAE,MAAM,8BAA8B,CAAC;AAEpF,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,4QAA4Q;IAC9Q,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,KAAK,IAAI,EAAE;QACd,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,GACtC,MAAM,oCAAoC,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACtC,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,oBAAoB;SAC7B,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,UAAU;YACnB,IAAI,EAAE,YAAY;YAClB,eAAe;YACf,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;gBACtB,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;oBACjD,EAAE;oBACF,IAAI;oBACJ,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACxC,CAAC,CAAC;gBACH,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvD,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport { hideHostedAppsWhenOff } from \"../server/lib/hosted-apps-settings.js\";\nimport { listGrantedDispatchMcpAppsWithStatus } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n 'List the apps this Dispatch MCP gateway can route to, including \"dispatch\" itself for Dispatch-owned pages such as extensions. The result is filtered by Dispatch\\'s MCP app access policy, and leaves out Agent-Native.com hosted apps while the organization hides them.',\n schema: z.object({}),\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n run: async () => {\n const { apps: granted, degradedSources } =\n await listGrantedDispatchMcpAppsWithStatus();\n const apps = await hideHostedAppsWhenOff(granted);\n const appSummaries = apps.map((app) => ({\n id: app.id,\n name: app.name,\n description: app.description,\n url: app.url,\n ...(app.aliases?.length ? { aliases: app.aliases } : {}),\n running: true,\n source: \"dispatch-mcp-grant\",\n }));\n return {\n workspace: true,\n gateway: \"dispatch\",\n apps: appSummaries,\n degradedSources,\n message: JSON.stringify({\n apps: appSummaries.map(({ id, name, aliases }) => ({\n id,\n name,\n ...(aliases?.length ? { aliases } : {}),\n })),\n ...(degradedSources.length ? { degradedSources } : {}),\n }),\n };\n },\n});\n"]}
|
package/dist/actions/navigate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigate.js","sourceRoot":"","sources":["../../src/actions/navigate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,gMAAgM;IAClM,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,yXAAyX,CAC1X;QACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC/D,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0CAA0C,CAAC;QACvD,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,OAAO,4DAA4D,CAAC;QACtE,CAAC;QACD,MAAM,GAAG,GAA2B,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;aAC/B,IAAI,QAAQ;YAAE,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC;QACrC,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACpC,IAAI,QAAQ;YAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACtC,MAAM,0BAA0B,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,iBAAiB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,eAAe,QAAQ,EAAE,EAAE,CAAC;IAChF,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport {\n navigationIntentSchema,\n writeAppStateForCurrentTab,\n} from \"@agent-native/core/application-state\";\nimport { z } from \"zod\";\n\nexport default defineAction({\n description:\n \"Navigate the UI to a specific view or path. Use threadId to open a specific chat thread on the chat route. Writes a navigate command to application state which the UI reads and auto-deletes.\",\n schema: z.object({\n view: z\n .string()\n .optional()\n .describe(\n \"Named dispatch view to navigate to. Built-in views include chat, overview, apps, operations (or monitoring, observability, database), metrics, new-app, vault, integrations, messaging, workspace, agents, connected-agents, destinations, identities, approvals, automations, audit, thread-debug, dreams, and team. Generated Dispatch extension tabs can also use their nav item id.\",\n ),\n path: z.string().optional().describe(\"URL path to navigate to\"),\n threadId: z\n .string()\n .optional()\n .describe(\"Chat thread ID to open on the chat route\"),\n intent: navigationIntentSchema,\n }),\n http: false,\n run: async (args) => {\n const threadId = args.threadId?.trim();\n if (!args.view && !args.path && !threadId) {\n return \"Error: At least --view, --path, or --threadId is required.\";\n }\n const nav: Record<string, string> = {};\n if (args.view) nav.view = args.view;\n else if (threadId) nav.view = \"chat\";\n if (args.path) nav.path = args.path;\n if (threadId) nav.threadId = threadId;\n await writeAppStateForCurrentTab(\"navigate\", nav);\n return `Navigating to ${args.view || args.path || `chat thread ${threadId}`}`;\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"navigate.js","sourceRoot":"","sources":["../../src/actions/navigate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,gMAAgM;IAClM,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,yXAAyX,CAC1X;QACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC/D,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0CAA0C,CAAC;QACvD,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,QAAQ;IACjB,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,OAAO,4DAA4D,CAAC;QACtE,CAAC;QACD,MAAM,GAAG,GAA2B,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;aAC/B,IAAI,QAAQ;YAAE,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC;QACrC,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACpC,IAAI,QAAQ;YAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACtC,MAAM,0BAA0B,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,iBAAiB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,eAAe,QAAQ,EAAE,EAAE,CAAC;IAChF,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport {\n navigationIntentSchema,\n writeAppStateForCurrentTab,\n} from \"@agent-native/core/application-state\";\nimport { z } from \"zod\";\n\nexport default defineAction({\n description:\n \"Navigate the UI to a specific view or path. Use threadId to open a specific chat thread on the chat route. Writes a navigate command to application state which the UI reads and auto-deletes.\",\n schema: z.object({\n view: z\n .string()\n .optional()\n .describe(\n \"Named dispatch view to navigate to. Built-in views include chat, overview, apps, operations (or monitoring, observability, database), metrics, new-app, vault, integrations, messaging, workspace, agents, connected-agents, destinations, identities, approvals, automations, audit, thread-debug, dreams, and team. Generated Dispatch extension tabs can also use their nav item id.\",\n ),\n path: z.string().optional().describe(\"URL path to navigate to\"),\n threadId: z\n .string()\n .optional()\n .describe(\"Chat thread ID to open on the chat route\"),\n intent: navigationIntentSchema,\n }),\n http: false,\n mcpTool: \"search\",\n run: async (args) => {\n const threadId = args.threadId?.trim();\n if (!args.view && !args.path && !threadId) {\n return \"Error: At least --view, --path, or --threadId is required.\";\n }\n const nav: Record<string, string> = {};\n if (args.view) nav.view = args.view;\n else if (threadId) nav.view = \"chat\";\n if (args.path) nav.path = args.path;\n if (threadId) nav.threadId = threadId;\n await writeAppStateForCurrentTab(\"navigate\", nav);\n return `Navigating to ${args.view || args.path || `chat thread ${threadId}`}`;\n },\n});\n"]}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
2
2
|
app?: string | undefined;
|
|
3
3
|
intent?: string | undefined;
|
|
4
|
+
screen?: string | undefined;
|
|
4
5
|
view?: string | undefined;
|
|
5
6
|
path?: string | undefined;
|
|
6
7
|
params?: Record<string, string | number | boolean> | undefined;
|
|
8
|
+
focus?: boolean | undefined;
|
|
7
9
|
embed?: boolean | undefined;
|
|
8
10
|
chrome?: "full" | "minimal" | undefined;
|
|
9
11
|
}, {
|
|
10
12
|
app: string;
|
|
13
|
+
screen?: string;
|
|
11
14
|
view?: string;
|
|
12
15
|
path?: string;
|
|
13
16
|
url: string;
|
|
17
|
+
focus?: boolean;
|
|
14
18
|
embed?: boolean;
|
|
15
19
|
chrome?: "full" | "minimal";
|
|
16
20
|
embedStartUrl?: string;
|
package/dist/actions/open_app.js
CHANGED
|
@@ -18,6 +18,10 @@ const openAppSchema = z.object({
|
|
|
18
18
|
.max(4000)
|
|
19
19
|
.optional()
|
|
20
20
|
.describe("What the user wants to see, in their words (for example: my unread email from Dana). Used to pick the app when app is not given; app wins when both are set."),
|
|
21
|
+
screen: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Declared manifest screen id to resolve with params, e.g. deck or thread."),
|
|
21
25
|
view: z.string().optional().describe("Target view in the app, e.g. inbox."),
|
|
22
26
|
path: z
|
|
23
27
|
.string()
|
|
@@ -27,6 +31,10 @@ const openAppSchema = z.object({
|
|
|
27
31
|
.record(z.string(), deepLinkParam)
|
|
28
32
|
.optional()
|
|
29
33
|
.describe("Optional record-focus or filter params."),
|
|
34
|
+
focus: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Explicitly transfer foreground pane focus when another app was already committed during this turn."),
|
|
30
38
|
embed: z
|
|
31
39
|
.boolean()
|
|
32
40
|
.optional()
|
|
@@ -111,7 +119,7 @@ async function pickAppForIntent(intent, ctx) {
|
|
|
111
119
|
return routed.app;
|
|
112
120
|
}
|
|
113
121
|
export default defineAction({
|
|
114
|
-
description: "
|
|
122
|
+
description: "Return a registered app route for the host to open beside the conversation to show a view or item such as mail, a draft, a calendar view, a chart, a dashboard, a document, or a record. Accepts an `app` id or a natural-language `intent` to select a matching granted app.",
|
|
115
123
|
schema: openAppSchema,
|
|
116
124
|
http: { method: "GET" },
|
|
117
125
|
readOnly: true,
|
|
@@ -130,11 +138,11 @@ export default defineAction({
|
|
|
130
138
|
app = await pickAppForIntent(intent, ctx);
|
|
131
139
|
}
|
|
132
140
|
const normalized = { ...normalizedArgs, app };
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
const result = ctx?.caller === "tool"
|
|
142
|
+
? await openGrantedDispatchMcpApp(normalized, { prefetchEmbed: true })
|
|
143
|
+
: await openGrantedDispatchMcpApp(normalized.embed == null && ctx?.caller === "mcp"
|
|
144
|
+
? { ...normalized, embed: true }
|
|
145
|
+
: normalized);
|
|
138
146
|
const targetApp = normalizeTrackingDimension(result.app) ?? result.app;
|
|
139
147
|
if (targetApp !== "dispatch") {
|
|
140
148
|
track("cross_app_used", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open_app.js","sourceRoot":"","sources":["../../src/actions/open_app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,iCAAiC,GAGlC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,gCAAgC,EACh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["import {\n defineAction,\n embedApp,\n MCP_APP_REQUEST_ORIGIN_CSP_SOURCE,\n type ActionMcpAppCsp,\n type ActionMcpAppCspBuilder,\n} from \"@agent-native/core\";\nimport { fail } from \"@agent-native/core/action\";\nimport { normalizeTrackingDimension } from \"@agent-native/core/shared\";\nimport { track } from \"@agent-native/core/tracking\";\nimport { z } from \"zod\";\n\nimport {\n listGrantedDispatchMcpAppOrigins,\n openGrantedDispatchMcpApp,\n} from \"../server/lib/mcp-gateway.js\";\nimport routeAppIntent from \"./route-app-intent.js\";\n\nconst deepLinkParam = z.union([z.string(), z.number(), z.boolean()]);\nconst openAppSchema = z.object({\n app: z\n .string()\n .optional()\n .describe(\n 'Granted app id, e.g. mail or calendar. Use \"dispatch\" for Dispatch-owned pages such as /extensions. Leave it out and pass intent to let Dispatch pick the app.',\n ),\n intent: z\n .string()\n .trim()\n .min(1)\n .max(4000)\n .optional()\n .describe(\n \"What the user wants to see, in their words (for example: my unread email from Dana). Used to pick the app when app is not given; app wins when both are set.\",\n ),\n view: z.string().optional().describe(\"Target view in the app, e.g. inbox.\"),\n path: z\n .string()\n .optional()\n .describe(\n 'Optional route within the target app, e.g. /adhoc/q2 or /chart?panel=... . Omit both view and path to open the app\\'s home. Dispatch extension routes such as /extensions/<id>/<slug> belong to app \"dispatch\".',\n ),\n params: z\n .record(z.string(), deepLinkParam)\n .optional()\n .describe(\"Optional record-focus or filter params.\"),\n embed: z\n .boolean()\n .optional()\n .describe(\n \"Render the app or focused route/component inline in MCP Apps when supported.\",\n ),\n chrome: z\n .enum([\"full\", \"minimal\"])\n .optional()\n .describe(\"Embed chrome preference for compatible app routes.\"),\n});\n\ntype OpenAppArgs = z.infer<typeof openAppSchema>;\n\nfunction normalizeOpenAppArgs(args: OpenAppArgs): OpenAppArgs {\n if (!args.params) return args;\n\n const params = { ...args.params };\n const embedded = params.embed;\n const chrome = params.chrome;\n let changed = false;\n\n let normalizedEmbed = args.embed;\n if (normalizedEmbed == null) {\n if (embedded === true || embedded === \"true\") {\n normalizedEmbed = true;\n changed = true;\n } else if (embedded === false || embedded === \"false\") {\n normalizedEmbed = false;\n changed = true;\n }\n }\n if (\n embedded === true ||\n embedded === false ||\n embedded === \"true\" ||\n embedded === \"false\"\n ) {\n delete params.embed;\n changed = true;\n }\n\n let normalizedChrome = args.chrome;\n if (normalizedChrome == null && (chrome === \"full\" || chrome === \"minimal\")) {\n normalizedChrome = chrome;\n changed = true;\n }\n if (chrome === \"full\" || chrome === \"minimal\") {\n delete params.chrome;\n changed = true;\n }\n\n if (!changed) return args;\n return {\n ...args,\n params: Object.keys(params).length ? params : undefined,\n ...(normalizedEmbed == null ? {} : { embed: normalizedEmbed }),\n ...(normalizedChrome == null ? {} : { chrome: normalizedChrome }),\n };\n}\n\nconst localDevFrameSources = [\"http://localhost:*\", \"http://127.0.0.1:*\"];\n\nconst dispatchOpenAppCsp: ActionMcpAppCspBuilder = async (\n ctx,\n): Promise<ActionMcpAppCsp> => {\n const appOrigins = (await listGrantedDispatchMcpAppOrigins()).filter(\n (origin) => !ctx.requestOrigin || origin !== ctx.requestOrigin,\n );\n const routeSources = [\n MCP_APP_REQUEST_ORIGIN_CSP_SOURCE,\n ...appOrigins,\n ...localDevFrameSources,\n ];\n return {\n connectDomains: [\"https://esm.sh\", ...routeSources],\n resourceDomains: [\"https://esm.sh\", ...routeSources],\n frameDomains: routeSources,\n baseUriDomains: routeSources,\n };\n};\n\nconst openAppResource = embedApp({\n title: \"Open app\",\n description: \"Render the requested granted app route inline.\",\n iframeTitle: \"Dispatch MCP app\",\n openLabel: \"Open app\",\n});\n\nasync function pickAppForIntent(\n intent: string,\n ctx: Parameters<typeof routeAppIntent.run>[1],\n): Promise<string> {\n const routed = await routeAppIntent.run({ text: intent }, ctx);\n if (routed.status !== \"ok\") {\n fail(\n `open_app could not pick an app for that intent (${routed.reason}). Pass app explicitly; list_apps shows the choices.`,\n { errorCode: \"app_not_resolved\", statusCode: 422 },\n );\n }\n if (routed.app === \"none\") {\n fail(\n \"That request needs no app on screen. Answer in chat, or pass app explicitly to open one.\",\n { errorCode: \"no_app_needed\", statusCode: 422 },\n );\n }\n return routed.app;\n}\n\nexport default defineAction({\n description:\n \"Show a found or created mail, event, document, or record when viewing it is the useful result. Pass app (or just intent, in the user's words, to let Dispatch pick the app). Returns a registered app route for the chat client to open beside the conversation.\",\n schema: openAppSchema,\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n opensAnotherAppEmbed: true,\n run: async (args, ctx) => {\n const { intent, ...normalizedArgs } = normalizeOpenAppArgs(args);\n let app = normalizedArgs.app?.trim();\n if (!app) {\n if (!intent) {\n fail(\"open_app needs an app, or an intent to pick one.\", {\n errorCode: \"app_required\",\n statusCode: 400,\n });\n }\n app = await pickAppForIntent(intent, ctx);\n }\n const normalized = { ...normalizedArgs, app };\n // An MCP host shows the app from the session the target app mints, so\n // ask for one unless the caller opted out.\n const result = await openGrantedDispatchMcpApp(\n normalized.embed == null && ctx?.caller === \"mcp\"\n ? { ...normalized, embed: true }\n : normalized,\n );\n const targetApp = normalizeTrackingDimension(result.app) ?? result.app;\n if (targetApp !== \"dispatch\") {\n track(\n \"cross_app_used\",\n {\n app_name: \"dispatch\",\n template_name: \"dispatch\",\n source_app: \"dispatch\",\n target_app: targetApp,\n output_type: \"app_route\",\n },\n ctx,\n );\n }\n // The gateway echoes only `embed: true`; the MCP server reads an explicit\n // `false` to open no panel.\n return normalized.embed === false ? { ...result, embed: false } : result;\n },\n link: ({ result }) => {\n if (!result || typeof result !== \"object\") return null;\n const r = result as { url?: string; app?: string; view?: string };\n if (!r.url) return null;\n return {\n url: r.url,\n label: `Open ${r.app ?? \"app\"}`,\n view: r.view,\n };\n },\n mcpApp: {\n compactCatalog: true,\n resource: {\n ...openAppResource,\n csp: dispatchOpenAppCsp,\n },\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"open_app.js","sourceRoot":"","sources":["../../src/actions/open_app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL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AAC,CAAC,CAAC,MAAM,CAAC;IAC3E,CAAC;IACD,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACvD,MAAM,CAAC,GAAG,MAAuD,CAAC;QAClE,IAAI,CAAC,CAAC,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC;QACxB,OAAO;YACL,GAAG,EAAE,CAAC,CAAC,GAAG;YACV,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,KAAK,EAAE;YAC/B,IAAI,EAAE,CAAC,CAAC,IAAI;SACb,CAAC;IACJ,CAAC;IACD,MAAM,EAAE;QACN,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACR,GAAG,eAAe;YAClB,GAAG,EAAE,kBAAkB;SACxB;KACF;CACF,CAAC,CAAC","sourcesContent":["import {\n defineAction,\n embedApp,\n MCP_APP_REQUEST_ORIGIN_CSP_SOURCE,\n type ActionMcpAppCsp,\n type ActionMcpAppCspBuilder,\n} from \"@agent-native/core\";\nimport { fail } from \"@agent-native/core/action\";\nimport { normalizeTrackingDimension } from \"@agent-native/core/shared\";\nimport { track } from \"@agent-native/core/tracking\";\nimport { z } from \"zod\";\n\nimport {\n listGrantedDispatchMcpAppOrigins,\n openGrantedDispatchMcpApp,\n} from \"../server/lib/mcp-gateway.js\";\nimport routeAppIntent from \"./route-app-intent.js\";\n\nconst deepLinkParam = z.union([z.string(), z.number(), z.boolean()]);\nconst openAppSchema = z.object({\n app: z\n .string()\n .optional()\n .describe(\n 'Granted app id, e.g. mail or calendar. Use \"dispatch\" for Dispatch-owned pages such as /extensions. Leave it out and pass intent to let Dispatch pick the app.',\n ),\n intent: z\n .string()\n .trim()\n .min(1)\n .max(4000)\n .optional()\n .describe(\n \"What the user wants to see, in their words (for example: my unread email from Dana). Used to pick the app when app is not given; app wins when both are set.\",\n ),\n screen: z\n .string()\n .optional()\n .describe(\n \"Declared manifest screen id to resolve with params, e.g. deck or thread.\",\n ),\n view: z.string().optional().describe(\"Target view in the app, e.g. inbox.\"),\n path: z\n .string()\n .optional()\n .describe(\n 'Optional route within the target app, e.g. /adhoc/q2 or /chart?panel=... . Omit both view and path to open the app\\'s home. Dispatch extension routes such as /extensions/<id>/<slug> belong to app \"dispatch\".',\n ),\n params: z\n .record(z.string(), deepLinkParam)\n .optional()\n .describe(\"Optional record-focus or filter params.\"),\n focus: z\n .boolean()\n .optional()\n .describe(\n \"Explicitly transfer foreground pane focus when another app was already committed during this turn.\",\n ),\n embed: z\n .boolean()\n .optional()\n .describe(\n \"Render the app or focused route/component inline in MCP Apps when supported.\",\n ),\n chrome: z\n .enum([\"full\", \"minimal\"])\n .optional()\n .describe(\"Embed chrome preference for compatible app routes.\"),\n});\n\ntype OpenAppArgs = z.infer<typeof openAppSchema>;\n\nfunction normalizeOpenAppArgs(args: OpenAppArgs): OpenAppArgs {\n if (!args.params) return args;\n\n const params = { ...args.params };\n const embedded = params.embed;\n const chrome = params.chrome;\n let changed = false;\n\n let normalizedEmbed = args.embed;\n if (normalizedEmbed == null) {\n if (embedded === true || embedded === \"true\") {\n normalizedEmbed = true;\n changed = true;\n } else if (embedded === false || embedded === \"false\") {\n normalizedEmbed = false;\n changed = true;\n }\n }\n if (\n embedded === true ||\n embedded === false ||\n embedded === \"true\" ||\n embedded === \"false\"\n ) {\n delete params.embed;\n changed = true;\n }\n\n let normalizedChrome = args.chrome;\n if (normalizedChrome == null && (chrome === \"full\" || chrome === \"minimal\")) {\n normalizedChrome = chrome;\n changed = true;\n }\n if (chrome === \"full\" || chrome === \"minimal\") {\n delete params.chrome;\n changed = true;\n }\n\n if (!changed) return args;\n return {\n ...args,\n params: Object.keys(params).length ? params : undefined,\n ...(normalizedEmbed == null ? {} : { embed: normalizedEmbed }),\n ...(normalizedChrome == null ? {} : { chrome: normalizedChrome }),\n };\n}\n\nconst localDevFrameSources = [\"http://localhost:*\", \"http://127.0.0.1:*\"];\n\nconst dispatchOpenAppCsp: ActionMcpAppCspBuilder = async (\n ctx,\n): Promise<ActionMcpAppCsp> => {\n const appOrigins = (await listGrantedDispatchMcpAppOrigins()).filter(\n (origin) => !ctx.requestOrigin || origin !== ctx.requestOrigin,\n );\n const routeSources = [\n MCP_APP_REQUEST_ORIGIN_CSP_SOURCE,\n ...appOrigins,\n ...localDevFrameSources,\n ];\n return {\n connectDomains: [\"https://esm.sh\", ...routeSources],\n resourceDomains: [\"https://esm.sh\", ...routeSources],\n frameDomains: routeSources,\n baseUriDomains: routeSources,\n };\n};\n\nconst openAppResource = embedApp({\n title: \"Open app\",\n description: \"Render the requested granted app route inline.\",\n iframeTitle: \"Dispatch MCP app\",\n openLabel: \"Open app\",\n});\n\nasync function pickAppForIntent(\n intent: string,\n ctx: Parameters<typeof routeAppIntent.run>[1],\n): Promise<string> {\n const routed = await routeAppIntent.run({ text: intent }, ctx);\n if (routed.status !== \"ok\") {\n fail(\n `open_app could not pick an app for that intent (${routed.reason}). Pass app explicitly; list_apps shows the choices.`,\n { errorCode: \"app_not_resolved\", statusCode: 422 },\n );\n }\n if (routed.app === \"none\") {\n fail(\n \"That request needs no app on screen. Answer in chat, or pass app explicitly to open one.\",\n { errorCode: \"no_app_needed\", statusCode: 422 },\n );\n }\n return routed.app;\n}\n\nexport default defineAction({\n description:\n \"Return a registered app route for the host to open beside the conversation to show a view or item such as mail, a draft, a calendar view, a chart, a dashboard, a document, or a record. Accepts an `app` id or a natural-language `intent` to select a matching granted app.\",\n schema: openAppSchema,\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n opensAnotherAppEmbed: true,\n run: async (args, ctx) => {\n const { intent, ...normalizedArgs } = normalizeOpenAppArgs(args);\n let app = normalizedArgs.app?.trim();\n if (!app) {\n if (!intent) {\n fail(\"open_app needs an app, or an intent to pick one.\", {\n errorCode: \"app_required\",\n statusCode: 400,\n });\n }\n app = await pickAppForIntent(intent, ctx);\n }\n const normalized = { ...normalizedArgs, app };\n const result =\n ctx?.caller === \"tool\"\n ? await openGrantedDispatchMcpApp(normalized, { prefetchEmbed: true })\n : await openGrantedDispatchMcpApp(\n normalized.embed == null && ctx?.caller === \"mcp\"\n ? { ...normalized, embed: true }\n : normalized,\n );\n const targetApp = normalizeTrackingDimension(result.app) ?? result.app;\n if (targetApp !== \"dispatch\") {\n track(\n \"cross_app_used\",\n {\n app_name: \"dispatch\",\n template_name: \"dispatch\",\n source_app: \"dispatch\",\n target_app: targetApp,\n output_type: \"app_route\",\n },\n ctx,\n );\n }\n // The gateway echoes only `embed: true`; the MCP server reads an explicit\n // `false` to open no panel.\n return normalized.embed === false ? { ...result, embed: false } : result;\n },\n link: ({ result }) => {\n if (!result || typeof result !== \"object\") return null;\n const r = result as { url?: string; app?: string; view?: string };\n if (!r.url) return null;\n return {\n url: r.url,\n label: `Open ${r.app ?? \"app\"}`,\n view: r.view,\n };\n },\n mcpApp: {\n compactCatalog: true,\n resource: {\n ...openAppResource,\n csp: dispatchOpenAppCsp,\n },\n },\n});\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
2
|
+
suggestions: {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: "automation" | "create-app" | "customize-app" | "filter" | "saved-view";
|
|
5
|
+
trigger: "ai-narrowing" | "cross-app-workflow" | "missing-control" | "new-domain" | "repeated-query";
|
|
6
|
+
label: string;
|
|
7
|
+
rationale: string;
|
|
8
|
+
appId: string;
|
|
9
|
+
execution: {
|
|
10
|
+
type: "action";
|
|
11
|
+
action: string;
|
|
12
|
+
params: Record<string, unknown>;
|
|
13
|
+
} | {
|
|
14
|
+
type: "customize";
|
|
15
|
+
targetAppId: string;
|
|
16
|
+
editSpec: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "create-app";
|
|
19
|
+
domainSpec: string;
|
|
20
|
+
};
|
|
21
|
+
}[];
|
|
22
|
+
}, {
|
|
23
|
+
suggestions: {
|
|
24
|
+
id: string;
|
|
25
|
+
kind: "automation" | "create-app" | "customize-app" | "filter" | "saved-view";
|
|
26
|
+
trigger: "ai-narrowing" | "cross-app-workflow" | "missing-control" | "new-domain" | "repeated-query";
|
|
27
|
+
label: string;
|
|
28
|
+
rationale: string;
|
|
29
|
+
appId: string;
|
|
30
|
+
execution: {
|
|
31
|
+
type: "action";
|
|
32
|
+
action: string;
|
|
33
|
+
params: Record<string, unknown>;
|
|
34
|
+
} | {
|
|
35
|
+
type: "customize";
|
|
36
|
+
targetAppId: string;
|
|
37
|
+
editSpec: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "create-app";
|
|
40
|
+
domainSpec: string;
|
|
41
|
+
};
|
|
42
|
+
}[];
|
|
43
|
+
}>;
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=propose-action-suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-action-suggestions.d.ts","sourceRoot":"","sources":["../../src/actions/propose-action-suggestions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MAX_ACTION_SUGGESTIONS_PER_TURN, } from "@agent-native/agentkit/protocol";
|
|
2
|
+
import { defineAction } from "@agent-native/core/action";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { uniqueActionSuggestions } from "../lib/action-suggestions.js";
|
|
5
|
+
import { actionSuggestionSchema, canOfferActionSuggestion, } from "../server/lib/action-suggestions.js";
|
|
6
|
+
export default defineAction({
|
|
7
|
+
description: "Offer up to two concrete, optional next actions in the current chat turn. Use only work that would benefit the user and that the user has not already asked you to perform. For an app action, use the exact app ID and action name from the granted app catalog and supply its actual inputs. For a persistent workflow that no installed app fits, use kind create-app, trigger new-domain, and appId dispatch. Suggestions take effect only after the user selects one.",
|
|
8
|
+
schema: z.object({
|
|
9
|
+
suggestions: z
|
|
10
|
+
.array(actionSuggestionSchema)
|
|
11
|
+
.max(MAX_ACTION_SUGGESTIONS_PER_TURN),
|
|
12
|
+
}),
|
|
13
|
+
outputSchema: z.object({
|
|
14
|
+
suggestions: z
|
|
15
|
+
.array(actionSuggestionSchema)
|
|
16
|
+
.max(MAX_ACTION_SUGGESTIONS_PER_TURN),
|
|
17
|
+
}),
|
|
18
|
+
readOnly: true,
|
|
19
|
+
http: false,
|
|
20
|
+
mcpTool: false,
|
|
21
|
+
run: async ({ suggestions }) => {
|
|
22
|
+
const candidates = uniqueActionSuggestions(suggestions);
|
|
23
|
+
const available = await Promise.allSettled(candidates.map(canOfferActionSuggestion));
|
|
24
|
+
return {
|
|
25
|
+
suggestions: candidates.filter((_, index) => {
|
|
26
|
+
const result = available.at(index);
|
|
27
|
+
return result?.status === "fulfilled" && result.value;
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=propose-action-suggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-action-suggestions.js","sourceRoot":"","sources":["../../src/actions/propose-action-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAE7C,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,4cAA4c;IAC9c,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,sBAAsB,CAAC;aAC7B,GAAG,CAAC,+BAA+B,CAAC;KACxC,CAAC;IACF,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,sBAAsB,CAAC;aAC7B,GAAG,CAAC,+BAA+B,CAAC;KACxC,CAAC;IACF,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,KAAK;IACd,GAAG,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAmC,EAAE;QAC9D,MAAM,UAAU,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,UAAU,CACxC,UAAU,CAAC,GAAG,CAAC,wBAAwB,CAAC,CACzC,CAAC;QACF,OAAO;YACL,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;gBACnC,OAAO,MAAM,EAAE,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,KAAK,CAAC;YACxD,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import {\n MAX_ACTION_SUGGESTIONS_PER_TURN,\n type ActionSuggestionResult,\n} from \"@agent-native/agentkit/protocol\";\nimport { defineAction } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport { uniqueActionSuggestions } from \"../lib/action-suggestions.js\";\nimport {\n actionSuggestionSchema,\n canOfferActionSuggestion,\n} from \"../server/lib/action-suggestions.js\";\n\nexport default defineAction({\n description:\n \"Offer up to two concrete, optional next actions in the current chat turn. Use only work that would benefit the user and that the user has not already asked you to perform. For an app action, use the exact app ID and action name from the granted app catalog and supply its actual inputs. For a persistent workflow that no installed app fits, use kind create-app, trigger new-domain, and appId dispatch. Suggestions take effect only after the user selects one.\",\n schema: z.object({\n suggestions: z\n .array(actionSuggestionSchema)\n .max(MAX_ACTION_SUGGESTIONS_PER_TURN),\n }),\n outputSchema: z.object({\n suggestions: z\n .array(actionSuggestionSchema)\n .max(MAX_ACTION_SUGGESTIONS_PER_TURN),\n }),\n readOnly: true,\n http: false,\n mcpTool: false,\n run: async ({ suggestions }): Promise<ActionSuggestionResult> => {\n const candidates = uniqueActionSuggestions(suggestions);\n const available = await Promise.allSettled(\n candidates.map(canOfferActionSuggestion),\n );\n return {\n suggestions: candidates.filter((_, index) => {\n const result = available.at(index);\n return result?.status === \"fulfilled\" && result.value;\n }),\n };\n },\n});\n"]}
|
|
@@ -48,9 +48,9 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
48
48
|
scope?: "org" | "user" | undefined;
|
|
49
49
|
}, {
|
|
50
50
|
provider?: undefined;
|
|
51
|
-
id?: undefined;
|
|
52
51
|
message?: undefined;
|
|
53
|
-
|
|
52
|
+
deleted?: undefined;
|
|
53
|
+
id?: undefined;
|
|
54
54
|
providers: {
|
|
55
55
|
id: string;
|
|
56
56
|
label: string;
|
|
@@ -61,35 +61,35 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
61
61
|
updatedAt: number;
|
|
62
62
|
}[];
|
|
63
63
|
count: number;
|
|
64
|
-
|
|
64
|
+
found?: undefined;
|
|
65
65
|
registered?: undefined;
|
|
66
66
|
label?: undefined;
|
|
67
67
|
} | {
|
|
68
|
-
id?: undefined;
|
|
69
|
-
count?: undefined;
|
|
70
68
|
message?: undefined;
|
|
69
|
+
count?: undefined;
|
|
70
|
+
deleted?: undefined;
|
|
71
|
+
id?: undefined;
|
|
71
72
|
providers?: undefined;
|
|
72
73
|
found: boolean;
|
|
73
74
|
provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
|
|
74
|
-
deleted?: undefined;
|
|
75
75
|
registered?: undefined;
|
|
76
76
|
label?: undefined;
|
|
77
77
|
} | {
|
|
78
78
|
provider?: undefined;
|
|
79
|
-
count?: undefined;
|
|
80
79
|
message?: undefined;
|
|
80
|
+
count?: undefined;
|
|
81
|
+
deleted?: undefined;
|
|
81
82
|
providers?: undefined;
|
|
82
83
|
found: boolean;
|
|
83
84
|
id: string;
|
|
84
|
-
deleted?: undefined;
|
|
85
85
|
registered?: undefined;
|
|
86
86
|
label?: undefined;
|
|
87
87
|
} | {
|
|
88
88
|
provider?: undefined;
|
|
89
|
-
count?: undefined;
|
|
90
89
|
message?: undefined;
|
|
91
|
-
|
|
90
|
+
count?: undefined;
|
|
92
91
|
providers?: undefined;
|
|
92
|
+
found?: undefined;
|
|
93
93
|
deleted: boolean;
|
|
94
94
|
id: string;
|
|
95
95
|
registered?: undefined;
|
|
@@ -97,9 +97,9 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
97
97
|
} | {
|
|
98
98
|
provider?: undefined;
|
|
99
99
|
count?: undefined;
|
|
100
|
-
found?: undefined;
|
|
101
|
-
providers?: undefined;
|
|
102
100
|
deleted?: undefined;
|
|
101
|
+
providers?: undefined;
|
|
102
|
+
found?: undefined;
|
|
103
103
|
registered: boolean;
|
|
104
104
|
id: string;
|
|
105
105
|
label: string;
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { appActionErrorCode, appActionResultText, } from "../server/lib/app-action-result.js";
|
|
4
4
|
import { callGrantedDispatchMcpAppAction } from "../server/lib/mcp-gateway.js";
|
|
5
5
|
export default defineAction({
|
|
6
|
-
description: "Read
|
|
6
|
+
description: "Read the current view state in the active tab of a granted app, including the open screen, selection, and any open composer or unsaved draft edits.",
|
|
7
7
|
schema: z.object({
|
|
8
8
|
app: z.string().describe("Granted app id, e.g. mail or calendar."),
|
|
9
9
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_view.js","sourceRoot":"","sources":["../../src/actions/read_view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,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,CAAC;YAC3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACjD,CAAC;QACD,IAAI,IAAa,CAAC;QAClB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,iDAAiD,EAAE;gBACtD,SAAS,EAAE,iBAAiB;gBAC5B,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction, fail } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport {\n appActionErrorCode,\n appActionResultText,\n} from \"../server/lib/app-action-result.js\";\nimport { callGrantedDispatchMcpAppAction } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Read the current view state in the active tab of a granted app, including the open screen, selection, and any open composer or unsaved draft edits.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n }),\n outputSchema: z.object({ app: z.string(), view: z.unknown() }),\n readOnly: true,\n parallelSafe: true,\n run: async ({ app }) => {\n const result = await callGrantedDispatchMcpAppAction(\n app,\n \"view-screen\",\n {},\n );\n const text = appActionResultText(result);\n if (result.isError === true) {\n fail(text || \"The app could not report its current view.\", {\n errorCode: appActionErrorCode(text) ?? \"view_unavailable\",\n statusCode: 502,\n });\n }\n if (result.structuredContent !== undefined) {\n return { app, view: result.structuredContent };\n }\n let view: unknown;\n try {\n view = JSON.parse(text);\n } catch {\n fail(\"The app returned a view that could not be read.\", {\n errorCode: \"view_unreadable\",\n statusCode: 502,\n });\n }\n return { app, view };\n },\n});\n"]}
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { authorizeDispatchAdmin } from "../server/lib/app-roles.js";
|
|
5
5
|
import { rememberPointer } from "../server/lib/pointers-store.js";
|
|
6
6
|
export default defineAction({
|
|
7
|
-
description: '
|
|
7
|
+
description: 'Save a user-defined alias (such as "todo list") pointing to a specific workspace app object (such as a doc, deck, or board) by app id and object id or URL.',
|
|
8
8
|
schema: z
|
|
9
9
|
.object({
|
|
10
10
|
alias: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remember-pointer.js","sourceRoot":"","sources":["../../src/actions/remember-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT
|
|
1
|
+
{"version":3,"file":"remember-pointer.js","sourceRoot":"","sources":["../../src/actions/remember-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,6JAA6J;IAC/J,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,EAAE,CAAC;aACP,QAAQ,CAAC,2CAA2C,CAAC;QACx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K,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK;gBACR,IAAI,CAAC,kDAAkD,EAAE;oBACvD,SAAS,EAAE,eAAe;oBAC1B,UAAU,EAAE,GAAG;iBAChB,CAAC,CAAC;YACL,MAAM,sBAAsB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,eAAe,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction, fail } from \"@agent-native/core/action\";\nimport {\n getRequestOrgId,\n getRequestUserEmail,\n} from \"@agent-native/core/server\";\nimport { z } from \"zod\";\n\nimport { authorizeDispatchAdmin } from \"../server/lib/app-roles.js\";\nimport { rememberPointer } from \"../server/lib/pointers-store.js\";\n\nexport default defineAction({\n description:\n 'Save a user-defined alias (such as \"todo list\") pointing to a specific workspace app object (such as a doc, deck, or board) by app id and object id or URL.',\n schema: z\n .object({\n alias: z\n .string()\n .trim()\n .min(1)\n .max(80)\n .describe('What the user calls it, e.g. \"todo list\".'),\n appId: z\n .string()\n .trim()\n .min(1)\n .max(200)\n .describe(\"Id of the workspace app that owns the object.\"),\n objectId: z.string().trim().max(500).optional(),\n url: z.string().trim().max(2000).optional(),\n scope: z\n .enum([\"user\", \"org\"])\n .default(\"user\")\n .describe(\n '\"user\" (default) is private to this user; \"org\" is shared with the organization and needs an administrator.',\n ),\n })\n .refine((value) => value.objectId || value.url, {\n message: \"Give an objectId or a url.\",\n }),\n outputSchema: z.object({ alias: z.string(), path: z.string() }),\n mcpAnnotations: {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: false,\n },\n mcpTool: true,\n run: async (args, ctx) => {\n const owner = getRequestUserEmail();\n if (!owner)\n fail(\"no_authenticated_user\", {\n errorCode: \"unauthenticated\",\n statusCode: 401,\n });\n const orgId = getRequestOrgId() ?? null;\n if (args.scope === \"org\") {\n if (!orgId)\n fail(\"Organization scope needs an active organization.\", {\n errorCode: \"invalid_input\",\n statusCode: 400,\n });\n await authorizeDispatchAdmin(args, ctx);\n }\n return rememberPointer({ ...args, owner, orgId });\n },\n});\n"]}
|
|
@@ -3,7 +3,7 @@ import { getRequestOrgId, getRequestUserEmail, } from "@agent-native/core/server
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { listPointers, matchPointer } from "../server/lib/pointers-store.js";
|
|
5
5
|
export default defineAction({
|
|
6
|
-
description: 'Look up whether
|
|
6
|
+
description: 'Look up whether a text query matches a user-saved pointer alias (for example, "my todo list" mapped to a specific document). Returns the matched alias, app id, and object id or URL when found.',
|
|
7
7
|
schema: z.object({
|
|
8
8
|
text: z.string().trim().min(1).max(4000).describe("The user's request."),
|
|
9
9
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-pointer.js","sourceRoot":"","sources":["../../src/actions/resolve-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE7E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"resolve-pointer.js","sourceRoot":"","sources":["../../src/actions/resolve-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE7E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,kMAAkM;IACpM,MA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AO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport {\n getRequestOrgId,\n getRequestUserEmail,\n} from \"@agent-native/core/server\";\nimport { z } from \"zod\";\n\nimport { listPointers, matchPointer } from \"../server/lib/pointers-store.js\";\n\nexport default defineAction({\n description:\n 'Look up whether a text query matches a user-saved pointer alias (for example, \"my todo list\" mapped to a specific document). Returns the matched alias, app id, and object id or URL when found.',\n schema: z.object({\n text: z.string().trim().min(1).max(4000).describe(\"The user's request.\"),\n }),\n outputSchema: z.union([\n z.object({\n match: z.literal(true),\n alias: z.string(),\n appId: z.string(),\n objectId: z.string().optional(),\n url: z.string().optional(),\n }),\n z.object({ match: z.literal(false) }),\n ]),\n mcpAnnotations: {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n },\n readOnly: true,\n parallelSafe: true,\n mcpTool: true,\n run: async ({ text }) => {\n const owner = getRequestUserEmail();\n if (!owner) return { match: false as const };\n const pointer = matchPointer(\n text,\n await listPointers(owner, getRequestOrgId()),\n );\n if (!pointer) return { match: false as const };\n return {\n match: true as const,\n alias: pointer.alias,\n appId: pointer.appId,\n ...(pointer.objectId ? { objectId: pointer.objectId } : {}),\n ...(pointer.url ? { url: pointer.url } : {}),\n };\n },\n});\n"]}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
2
2
|
text: string;
|
|
3
3
|
openApp?: string | undefined;
|
|
4
|
+
openPath?: string | undefined;
|
|
5
|
+
selection?: string | undefined;
|
|
4
6
|
previousTurn?: string | Record<string, unknown> | undefined;
|
|
5
7
|
}, {
|
|
6
8
|
status: "ok";
|
|
7
9
|
app: string;
|
|
10
|
+
confidence: number;
|
|
11
|
+
explicit?: true | undefined;
|
|
12
|
+
screen?: "home" | undefined;
|
|
13
|
+
params?: Record<string, string> | undefined;
|
|
8
14
|
provider: string;
|
|
9
15
|
model: string;
|
|
10
16
|
cached: boolean;
|