@agent-native/dispatch 0.13.12 → 0.14.0

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 (74) hide show
  1. package/dist/actions/delete-destination.d.ts +12 -12
  2. package/dist/actions/provider-api-audit.d.ts +7 -0
  3. package/dist/actions/provider-api-audit.d.ts.map +1 -0
  4. package/dist/actions/provider-api-audit.js +74 -0
  5. package/dist/actions/provider-api-audit.js.map +1 -0
  6. package/dist/actions/provider-api-catalog.d.ts +1 -1
  7. package/dist/actions/provider-api-request.js +10 -0
  8. package/dist/actions/provider-api-request.js.map +1 -1
  9. package/dist/actions/send-platform-message.d.ts +1 -0
  10. package/dist/actions/send-platform-message.js +43 -22
  11. package/dist/actions/send-platform-message.js.map +1 -1
  12. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  13. package/dist/components/dispatch-control-plane.js +1 -1
  14. package/dist/components/dispatch-control-plane.js.map +1 -1
  15. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  16. package/dist/components/messaging-setup-panel.js +203 -127
  17. package/dist/components/messaging-setup-panel.js.map +1 -1
  18. package/dist/hooks/use-navigation-state.d.ts.map +1 -1
  19. package/dist/hooks/use-navigation-state.js +1 -2
  20. package/dist/hooks/use-navigation-state.js.map +1 -1
  21. package/dist/routes/pages/$appId.d.ts.map +1 -1
  22. package/dist/routes/pages/$appId.js +3 -1
  23. package/dist/routes/pages/$appId.js.map +1 -1
  24. package/dist/routes/pages/apps.$appId.d.ts.map +1 -1
  25. package/dist/routes/pages/apps.$appId.js +2 -2
  26. package/dist/routes/pages/apps.$appId.js.map +1 -1
  27. package/dist/routes/pages/apps.d.ts.map +1 -1
  28. package/dist/routes/pages/apps.js +1 -3
  29. package/dist/routes/pages/apps.js.map +1 -1
  30. package/dist/routes/pages/messaging.js +1 -1
  31. package/dist/routes/pages/messaging.js.map +1 -1
  32. package/dist/routes/pages/team.js +1 -1
  33. package/dist/routes/pages/team.js.map +1 -1
  34. package/dist/server/lib/dispatch-integrations.d.ts +7 -1
  35. package/dist/server/lib/dispatch-integrations.d.ts.map +1 -1
  36. package/dist/server/lib/dispatch-integrations.js +178 -8
  37. package/dist/server/lib/dispatch-integrations.js.map +1 -1
  38. package/dist/server/lib/dispatch-routing.d.ts +6 -0
  39. package/dist/server/lib/dispatch-routing.d.ts.map +1 -0
  40. package/dist/server/lib/dispatch-routing.js +30 -0
  41. package/dist/server/lib/dispatch-routing.js.map +1 -0
  42. package/dist/server/lib/env-config.d.ts.map +1 -1
  43. package/dist/server/lib/env-config.js +50 -0
  44. package/dist/server/lib/env-config.js.map +1 -1
  45. package/dist/server/lib/onboarding-steps.d.ts.map +1 -1
  46. package/dist/server/lib/onboarding-steps.js +25 -0
  47. package/dist/server/lib/onboarding-steps.js.map +1 -1
  48. package/dist/server/lib/provider-api.d.ts +2 -2
  49. package/dist/server/lib/provider-api.d.ts.map +1 -1
  50. package/dist/server/plugins/integrations.d.ts.map +1 -1
  51. package/dist/server/plugins/integrations.js +5 -2
  52. package/dist/server/plugins/integrations.js.map +1 -1
  53. package/package.json +2 -2
  54. package/src/actions/provider-api-audit.spec.ts +52 -0
  55. package/src/actions/provider-api-audit.ts +88 -0
  56. package/src/actions/provider-api-request.ts +10 -0
  57. package/src/actions/send-platform-message.spec.ts +108 -0
  58. package/src/actions/send-platform-message.ts +73 -25
  59. package/src/components/dispatch-control-plane.tsx +1 -5
  60. package/src/components/messaging-setup-panel.spec.tsx +191 -0
  61. package/src/components/messaging-setup-panel.tsx +472 -193
  62. package/src/hooks/use-navigation-state.ts +1 -2
  63. package/src/routes/pages/$appId.tsx +3 -5
  64. package/src/routes/pages/apps.$appId.tsx +3 -7
  65. package/src/routes/pages/apps.tsx +0 -3
  66. package/src/routes/pages/messaging.tsx +1 -1
  67. package/src/routes/pages/team.tsx +1 -1
  68. package/src/server/lib/dispatch-integrations.spec.ts +113 -0
  69. package/src/server/lib/dispatch-integrations.ts +239 -6
  70. package/src/server/lib/dispatch-routing.spec.ts +42 -0
  71. package/src/server/lib/dispatch-routing.ts +42 -0
  72. package/src/server/lib/env-config.ts +50 -0
  73. package/src/server/lib/onboarding-steps.ts +32 -0
  74. package/src/server/plugins/integrations.ts +5 -2
@@ -4,6 +4,16 @@ export const envKeys: EnvKeyConfig[] = [
4
4
  {
5
5
  key: "SLACK_BOT_TOKEN",
6
6
  label: "Slack bot token",
7
+ required: false,
8
+ },
9
+ {
10
+ key: "SLACK_CLIENT_ID",
11
+ label: "Slack OAuth client ID",
12
+ required: true,
13
+ },
14
+ {
15
+ key: "SLACK_CLIENT_SECRET",
16
+ label: "Slack OAuth client secret",
7
17
  required: true,
8
18
  },
9
19
  {
@@ -16,6 +26,41 @@ export const envKeys: EnvKeyConfig[] = [
16
26
  label: "Telegram bot token",
17
27
  required: true,
18
28
  },
29
+ {
30
+ key: "TELEGRAM_WEBHOOK_SECRET",
31
+ label: "Telegram webhook secret",
32
+ required: true,
33
+ },
34
+ {
35
+ key: "MICROSOFT_TEAMS_APP_ID",
36
+ label: "Microsoft Bot app ID",
37
+ required: false,
38
+ },
39
+ {
40
+ key: "MICROSOFT_TEAMS_APP_PASSWORD",
41
+ label: "Microsoft Bot client secret",
42
+ required: false,
43
+ },
44
+ {
45
+ key: "MICROSOFT_TEAMS_APP_TENANT_ID",
46
+ label: "Microsoft Bot tenant ID",
47
+ required: false,
48
+ },
49
+ {
50
+ key: "MICROSOFT_TEAMS_ALLOWED_TENANT_IDS",
51
+ label: "Allowed Microsoft Teams tenant IDs",
52
+ required: false,
53
+ },
54
+ {
55
+ key: "DISCORD_APPLICATION_ID",
56
+ label: "Discord application ID",
57
+ required: false,
58
+ },
59
+ {
60
+ key: "DISCORD_PUBLIC_KEY",
61
+ label: "Discord public key",
62
+ required: false,
63
+ },
19
64
  {
20
65
  key: "EMAIL_AGENT_ADDRESS",
21
66
  label: "Agent email address",
@@ -41,6 +86,11 @@ export const envKeys: EnvKeyConfig[] = [
41
86
  label: "WhatsApp phone number ID",
42
87
  required: false,
43
88
  },
89
+ {
90
+ key: "WHATSAPP_APP_SECRET",
91
+ label: "WhatsApp app secret",
92
+ required: false,
93
+ },
44
94
  {
45
95
  key: "PYLON_API_KEY",
46
96
  label: "Pylon API key",
@@ -9,7 +9,12 @@
9
9
  * their first workspace app first.
10
10
  */
11
11
 
12
+ import { listIntegrationInstallations } from "@agent-native/core/integrations";
12
13
  import { registerOnboardingStep } from "@agent-native/core/onboarding";
14
+ import {
15
+ getRequestOrgId,
16
+ getRequestUserEmail,
17
+ } from "@agent-native/core/server/request-context";
13
18
 
14
19
  import { listWorkspaceApps } from "./app-creation-store.js";
15
20
 
@@ -47,4 +52,31 @@ export function registerDispatchOnboardingSteps(): void {
47
52
  }
48
53
  },
49
54
  });
55
+
56
+ registerOnboardingStep({
57
+ id: "dispatch:connect-slack-workspace",
58
+ title: "Connect a Slack workspace",
59
+ description:
60
+ "Install Agent Native with OAuth, then configure channel identities and access policies.",
61
+ order: 60,
62
+ required: false,
63
+ methods: [
64
+ {
65
+ id: "open-messaging",
66
+ kind: "link",
67
+ primary: true,
68
+ label: "Open Messaging",
69
+ payload: { url: "/messaging", external: false },
70
+ },
71
+ ],
72
+ isComplete: async () => {
73
+ const userEmail = getRequestUserEmail();
74
+ if (!userEmail) return false;
75
+ const rows = await listIntegrationInstallations(
76
+ { userEmail, orgId: getRequestOrgId() ?? null },
77
+ "slack",
78
+ ).catch(() => []);
79
+ return rows.some((row) => row.status === "connected");
80
+ },
81
+ });
50
82
  }
@@ -4,7 +4,7 @@ import { dispatchActions } from "../../actions/index.js";
4
4
  import { getDispatchConfig } from "../index.js";
5
5
  import {
6
6
  beforeDispatchProcess,
7
- resolveDispatchOwner,
7
+ resolveDispatchExecutionContext,
8
8
  } from "../lib/dispatch-integrations.js";
9
9
 
10
10
  const dispatchIntegrationActions = {
@@ -32,6 +32,9 @@ Default posture:
32
32
 
33
33
  When a user asks for something:
34
34
  - If it belongs to analytics, content, slides, clips, assets, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
35
+ - Synthetic uptime, health-check, and URL-availability monitors belong to Analytics, even when the monitored target is another app such as Clips. Delegate creation to Analytics and relay its exact monitor URL. Dispatch-native recurring jobs are for reminders, digests, and agent workflows, not HTTP uptime probes.
36
+ - Route by the requested artifact type, not by organization-specific names stored in code. For structured records, databases, tables, queues, boards, and intake forms, resolve the owning app and canonical destination from loaded workspace instructions/resources plus discovered app capabilities; do not assume Content, a database ID, schema, owner, or required fields. Visual designs, mockups, wireframes, screens, and interfaces belong to Design. A trusted Required target agent hint in integration context is authoritative.
37
+ - When delegating structured intake to the resolved owning app, preserve the exact Source thread URL and the workspace instruction context, inspect the destination's current required fields, ask only for missing values, submit once, verify the saved record, and return the exact link.
35
38
  - In messaging integrations, use call-agent for cross-app delegation; do not use ask_app.
36
39
  - After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.
37
40
  - Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.
@@ -62,7 +65,7 @@ const dispatchIntegrationsPlugin = async (nitroApp: any) => {
62
65
  const plugin = createIntegrationsPlugin({
63
66
  appId: "dispatch",
64
67
  actions: dispatchIntegrationActions,
65
- resolveOwner: resolveDispatchOwner,
68
+ resolveExecutionContext: resolveDispatchExecutionContext,
66
69
  beforeProcess: beforeDispatchProcess,
67
70
  systemPrompt,
68
71
  // Inherit the framework default (claude-sonnet-4-6 from