@agent-native/dispatch 0.10.4 → 0.11.1
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/README.md +59 -96
- package/dist/actions/provider-api-catalog.d.ts +1 -0
- package/dist/actions/provider-api-catalog.d.ts.map +1 -1
- package/dist/actions/provider-api-docs.d.ts +15 -0
- package/dist/actions/provider-api-docs.d.ts.map +1 -1
- package/dist/actions/provider-api-docs.js +29 -0
- package/dist/actions/provider-api-docs.js.map +1 -1
- package/dist/server/lib/provider-api.d.ts +3 -4
- package/dist/server/lib/provider-api.d.ts.map +1 -1
- package/dist/server/lib/provider-api.js.map +1 -1
- package/dist/server/plugins/agent-chat.d.ts.map +1 -1
- package/dist/server/plugins/agent-chat.js +24 -0
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/package.json +11 -13
- package/src/actions/provider-api-docs.ts +39 -0
- package/src/server/lib/provider-api.ts +4 -5
- package/src/server/plugins/agent-chat.ts +25 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent-Native
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### Open-source framework for agentic applications you own.
|
|
4
4
|
|
|
5
5
|
Don't choose between rich user interfaces and autonomous agents. Every Agent-Native app is both.
|
|
6
6
|
|
|
@@ -16,19 +16,61 @@ The agent and the UI are equal citizens of the same system. Every action works b
|
|
|
16
16
|
- **Per-user workspace** — Skills, memory, instructions, sub-agents, and MCP servers — SQL-backed, customizable per user. Claude-Code-level flexibility, SaaS-grade economics.
|
|
17
17
|
- **Agents call agents** — Tag another agent from any app. They discover each other over A2A and take action across your stack.
|
|
18
18
|
- **Reusable integrations** — Connect a provider once in Dispatch, keep secret values in the vault, then grant apps like Brain, Analytics, Mail, and Dispatch access to the shared account metadata and credential refs.
|
|
19
|
+
- **Three shapes** — Build the same agent as a headless API, a rich chat experience, or a full application where agent and UI stay in sync.
|
|
19
20
|
- **Apps that improve themselves** — Your apps get better on their own. The agent can add features, fix bugs, and refine the UI over time.
|
|
20
21
|
- **Any database, any host** — Any SQL database Drizzle supports. Any hosting target Nitro supports. No lock-in.
|
|
21
|
-
- **
|
|
22
|
+
- **Bring the agent surface you need** — MCP-compatible hosts can call your apps, coding agents can install skills, native chat renders reusable app outputs, and BYO agent runtimes can stream into the Agent-Native chat shell.
|
|
23
|
+
|
|
24
|
+
## The framework for agent-native apps
|
|
25
|
+
|
|
26
|
+
Agent-Native is an open-source framework for building robust agents that can act inside real apps, not just chat next to them.
|
|
27
|
+
|
|
28
|
+
It gives you primitives for product-grade agentic software: shared actions, SQL-backed state, identity, tools, skills, jobs, observability, and UI surfaces that all work together.
|
|
29
|
+
|
|
30
|
+
Backend agnostic: bring your own database, hosting provider, model stack, and app code.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// One action powers UI, agent, HTTP, MCP, A2A, and CLI.
|
|
34
|
+
export default defineAction({
|
|
35
|
+
schema: z.object({
|
|
36
|
+
emailId: z.string(),
|
|
37
|
+
body: z.string(),
|
|
38
|
+
}),
|
|
39
|
+
run: async ({ emailId, body }) => {
|
|
40
|
+
await db.insert(replies).values({ emailId, body });
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- **Actions** — Define work once. Use it from UI, agent, API, MCP, A2A, and CLI.
|
|
46
|
+
- **Agent runtime** — Chat, tools, skills, memory, jobs, observability, and handoffs ship together.
|
|
47
|
+
- **Backend agnostic** — Plug in any Drizzle-supported SQL database and Nitro-compatible host.
|
|
48
|
+
|
|
49
|
+
## One agent, three product shapes
|
|
50
|
+
|
|
51
|
+
Agent-Native primitives let you choose how much UI to put around an agent without rebuilding the agent contract:
|
|
52
|
+
|
|
53
|
+
| Shape | What you ship | Same primitives underneath |
|
|
54
|
+
| ------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
55
|
+
| **Headless** | Call the agent and actions from code, CLI, HTTP, MCP, or A2A. | `defineAction`, auth, skills, memory, jobs, observability |
|
|
56
|
+
| **Rich chat** | A standalone or embedded chat with native tables, charts, approvals, setup flows, and tool results. | Shared chat runtime, BYO runtime adapters, action-declared native renderers |
|
|
57
|
+
| **Whole app** | A full SaaS/product UI where chat can start central, move to the sidebar, and stay synced with app state. | SQL state, actions, context awareness, deep links, live sync |
|
|
58
|
+
|
|
59
|
+
Protocols come with the framework instead of becoming separate integrations per feature. Today that means A2A, MCP, MCP Apps, standard remote MCP OAuth, MCP clients, HTTP/CLI action calls, native chat widgets, `AgentChatRuntime` adapters, standard OpenAI, AG-UI, Claude Agent SDK, and Vercel AI SDK chat runtime connectors, and deep links all hang off the same action surface. ACP is best understood as the coding-agent/editor interoperability protocol, not the general BYO app-chat runtime.
|
|
60
|
+
|
|
61
|
+
For the full decision guide — headless, rich chat on the built-in agent, rich chat on your own agent, embedded sidecar, or full app — see [Agent Surfaces](https://agent-native.com/docs/agent-surfaces).
|
|
62
|
+
|
|
63
|
+
To connect Claude, ChatGPT, Codex, Cursor, OpenCode, GitHub Copilot / VS Code, or another MCP host to your hosted app, see the [External Agents guide](https://agent-native.com/docs/external-agents).
|
|
22
64
|
|
|
23
65
|
## Try it with a skill
|
|
24
66
|
|
|
25
|
-
Don't want to scaffold a whole app yet? Add
|
|
67
|
+
Don't want to scaffold a whole app yet? Add visual planning and PR recaps to Claude Code, Codex, Cursor, Pi, OpenCode, GitHub Copilot / VS Code, and similar agents with one command:
|
|
26
68
|
|
|
27
69
|
```bash
|
|
28
70
|
npx @agent-native/core@latest skills add visual-plan
|
|
29
71
|
```
|
|
30
72
|
|
|
31
|
-
|
|
73
|
+
You get two slash commands that upgrade how your agent plans and reports its work:
|
|
32
74
|
|
|
33
75
|
- **`/visual-plan`** — before the agent writes code, it opens a structured, reviewable plan document instead of a wall of text: inline diagrams, UI wireframes and prototypes, file-by-file implementation maps, and annotations you can comment on and approve.
|
|
34
76
|
- **`/visual-recap`** — after changes land, it turns a PR or git diff into a high-altitude visual recap: schema, API, and file changes rendered as grounded before/after blocks with a shareable review link, instead of scrolling a raw diff.
|
|
@@ -37,30 +79,30 @@ See the **[Skills Guide](https://agent-native.com/docs/skills-guide#app-backed-s
|
|
|
37
79
|
|
|
38
80
|
## Templates
|
|
39
81
|
|
|
40
|
-
Start
|
|
82
|
+
Start with a full featured template. Each one is a complete, 100% free and open-source SaaS app — cloneable, not scaffolded — except you own the code and can customize everything.
|
|
41
83
|
|
|
42
84
|
<table>
|
|
43
85
|
<tr>
|
|
44
86
|
<td width="33%" align="center" valign="top">
|
|
45
87
|
|
|
46
|
-
**
|
|
88
|
+
**Calendar**
|
|
47
89
|
|
|
48
|
-
<a href="https://agent-native.com/templates/
|
|
90
|
+
<a href="https://agent-native.com/templates/calendar"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffb6c3b483ca24ab3b6c3a758aeceef4c?format=webp&width=800" alt="Calendar template" width="100%" /></a>
|
|
49
91
|
|
|
50
|
-
**Agent-Native
|
|
92
|
+
**Agent-Native Google Calendar, Calendly**
|
|
51
93
|
|
|
52
|
-
|
|
94
|
+
Manage events, sync with Google Calendar, and share a public booking page with AI scheduling.
|
|
53
95
|
|
|
54
96
|
</td>
|
|
55
97
|
<td width="33%" align="center" valign="top">
|
|
56
98
|
|
|
57
|
-
**
|
|
99
|
+
**Content**
|
|
58
100
|
|
|
59
|
-
<a href="https://agent-native.com/templates/
|
|
101
|
+
<a href="https://agent-native.com/templates/content"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F89bcfc6106304bfbaf8ec8a7ccd721eb?format=webp&width=800" alt="Content template" width="100%" /></a>
|
|
60
102
|
|
|
61
|
-
**
|
|
103
|
+
**Open-source Obsidian for MDX**
|
|
62
104
|
|
|
63
|
-
|
|
105
|
+
Edit local Markdown/MDX files, generate rich interactive custom blocks, and draft, rewrite, or publish with an agent.
|
|
64
106
|
|
|
65
107
|
</td>
|
|
66
108
|
<td width="33%" align="center" valign="top">
|
|
@@ -78,17 +120,6 @@ Install `/visual-plan` and `/visual-recap` so your coding agent can plan before
|
|
|
78
120
|
<tr>
|
|
79
121
|
<td width="33%" align="center" valign="top">
|
|
80
122
|
|
|
81
|
-
**Content**
|
|
82
|
-
|
|
83
|
-
<a href="https://agent-native.com/templates/content"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F89bcfc6106304bfbaf8ec8a7ccd721eb?format=webp&width=800" alt="Content template" width="100%" /></a>
|
|
84
|
-
|
|
85
|
-
**Agent-Native Notion, Google Docs**
|
|
86
|
-
|
|
87
|
-
Write and organize content with an agent that knows your brand and publishing workflow.
|
|
88
|
-
|
|
89
|
-
</td>
|
|
90
|
-
<td width="33%" align="center" valign="top">
|
|
91
|
-
|
|
92
123
|
**Slides**
|
|
93
124
|
|
|
94
125
|
<a href="https://agent-native.com/templates/slides"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F2c09b451d40c4a74a89a38d69170c2d8?format=webp&width=800" alt="Slides template" width="100%" /></a>
|
|
@@ -100,19 +131,6 @@ Generate and edit React-based presentations via prompt or point-and-click.
|
|
|
100
131
|
</td>
|
|
101
132
|
<td width="33%" align="center" valign="top">
|
|
102
133
|
|
|
103
|
-
**Video**
|
|
104
|
-
|
|
105
|
-
<a href="https://agent-native.com/templates/video"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F6b8bfcc18a1d4c47a491da3b2d4148a4?format=webp&width=800" alt="Video template" width="100%" /></a>
|
|
106
|
-
|
|
107
|
-
**Agent-Native video editing**
|
|
108
|
-
|
|
109
|
-
Create and edit Remotion video compositions with agent assistance.
|
|
110
|
-
|
|
111
|
-
</td>
|
|
112
|
-
</tr>
|
|
113
|
-
<tr>
|
|
114
|
-
<td width="33%" align="center" valign="top">
|
|
115
|
-
|
|
116
134
|
**Analytics**
|
|
117
135
|
|
|
118
136
|
<a href="https://agent-native.com/templates/analytics"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4933a80cc3134d7e874631f688be828a?format=webp&width=800" alt="Analytics template" width="100%" /></a>
|
|
@@ -132,73 +150,18 @@ Connect analytics data sources, prompt for real charts, and build reusable dashb
|
|
|
132
150
|
|
|
133
151
|
Record your screen with auto-transcripts, shareable links, and an agent that summarizes, captions, and edits clips on demand.
|
|
134
152
|
|
|
135
|
-
</td>
|
|
136
|
-
<td width="33%" align="center" valign="top">
|
|
137
|
-
|
|
138
|
-
**Design**
|
|
139
|
-
|
|
140
|
-
<a href="https://agent-native.com/templates/design"><img src="https://cdn.builder.io/api/v1/image/assets%2F348da13fcd8b414c87de9066196f7266%2F961bedb713a94463b834c1f2f4643bcf?format=webp&width=800" alt="Design template" width="100%" /></a>
|
|
141
|
-
|
|
142
|
-
**Agent-Native Figma, Canva**
|
|
143
|
-
|
|
144
|
-
Create and edit visual designs by prompt or by hand, with the agent as your co-designer.
|
|
145
|
-
|
|
146
|
-
</td>
|
|
147
|
-
</tr>
|
|
148
|
-
<tr>
|
|
149
|
-
<td width="33%" align="center" valign="top">
|
|
150
|
-
|
|
151
|
-
**Dispatch**
|
|
152
|
-
|
|
153
|
-
<a href="https://agent-native.com/templates/dispatch"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F104b3ad8d1dc461aa33ab9bff37a4482?format=webp&width=800" alt="Dispatch template" width="100%" /></a>
|
|
154
|
-
|
|
155
|
-
**Mission control for agent-native apps**
|
|
156
|
-
|
|
157
|
-
Message, manage, and delegate to agents from Slack, Telegram, or the web. Dispatch is also the control plane for vault secrets, reusable provider connections, app grants, routing, memory, and approvals.
|
|
158
|
-
|
|
159
|
-
</td>
|
|
160
|
-
<td width="33%" align="center" valign="top">
|
|
161
|
-
|
|
162
|
-
**Forms**
|
|
163
|
-
|
|
164
|
-
<a href="https://agent-native.com/templates/forms"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F190c3fabd51f4c1bba5aa4e091ad4e9b?format=webp&width=800" alt="Forms template" width="100%" /></a>
|
|
165
|
-
|
|
166
|
-
**Agent-Native Typeform**
|
|
167
|
-
|
|
168
|
-
Generate forms from a prompt, branch logic with the agent, and own every response in your own database.
|
|
169
|
-
|
|
170
|
-
</td>
|
|
171
|
-
<td width="33%" align="center" valign="top">
|
|
172
|
-
|
|
173
|
-
**Brain**
|
|
174
|
-
|
|
175
|
-
<a href="https://agent-native.com/templates/brain"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F9c9fe3b5b9494e33803cd3f494cba356?format=webp&width=800" alt="Brain template" width="100%" /></a>
|
|
176
|
-
|
|
177
|
-
**Agent-Native company memory**
|
|
178
|
-
|
|
179
|
-
Ask questions over cited company knowledge from approved Slack, meetings, transcripts, GitHub, and decisions.
|
|
180
|
-
|
|
181
|
-
</td>
|
|
182
|
-
</tr>
|
|
183
|
-
<tr>
|
|
184
|
-
<td width="33%" align="center" valign="top">
|
|
185
|
-
|
|
186
|
-
**Assets**
|
|
187
|
-
|
|
188
|
-
<a href="https://agent-native.com/templates/assets"><img src="https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F769092170a14474f998cbca47384f891?format=webp&width=800" alt="Assets template" width="100%" /></a>
|
|
189
|
-
|
|
190
|
-
**Agent-Native asset library**
|
|
191
|
-
|
|
192
|
-
Upload, organize, search, and generate on-brand image and video assets that other apps can reuse.
|
|
193
|
-
|
|
194
153
|
</td>
|
|
195
154
|
</tr>
|
|
196
155
|
</table>
|
|
197
156
|
|
|
198
157
|
Every template is a complete cloneable SaaS — fork it, customize it with the agent, own it. Try them with example data before connecting your own sources.
|
|
199
158
|
|
|
159
|
+
View the full template gallery at **[agent-native.com/templates](https://agent-native.com/templates)**.
|
|
160
|
+
|
|
200
161
|
## Quick Start
|
|
201
162
|
|
|
163
|
+
One command to fork a template and start building locally.
|
|
164
|
+
|
|
202
165
|
```bash
|
|
203
166
|
npx @agent-native/core@latest create my-platform
|
|
204
167
|
cd my-platform
|
|
@@ -15,6 +15,7 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
15
15
|
defaultHeaders: Record<string, string>;
|
|
16
16
|
examples: readonly import("@agent-native/core/provider-api").ProviderApiExample[];
|
|
17
17
|
notes: readonly string[];
|
|
18
|
+
corpusRecipes: readonly import("@agent-native/core/provider-api").ProviderApiCorpusRecipe[];
|
|
18
19
|
templateUses: readonly import("@agent-native/core").WorkspaceConnectionTemplateUse[];
|
|
19
20
|
}[];
|
|
20
21
|
guidance: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api-catalog.d.ts","sourceRoot":"","sources":["../../src/actions/provider-api-catalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider-api-catalog.d.ts","sourceRoot":"","sources":["../../src/actions/provider-api-catalog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,wBAqBG"}
|
|
@@ -2,6 +2,21 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
2
2
|
provider: string;
|
|
3
3
|
url?: string | undefined;
|
|
4
4
|
maxBytes?: unknown;
|
|
5
|
+
maxChars?: unknown;
|
|
6
|
+
responseMode?: "text" | "metadata" | "raw" | "links" | "auto" | "markdown" | "matches" | undefined;
|
|
7
|
+
extract?: "none" | "readability" | "all-visible" | undefined;
|
|
8
|
+
includeLinks?: unknown;
|
|
9
|
+
search?: {
|
|
10
|
+
query?: string | string[] | undefined;
|
|
11
|
+
queries?: string[] | undefined;
|
|
12
|
+
terms?: string[] | undefined;
|
|
13
|
+
regex?: string | undefined;
|
|
14
|
+
regexFlags?: string | undefined;
|
|
15
|
+
source?: "raw" | "extracted" | undefined;
|
|
16
|
+
maxMatches?: unknown;
|
|
17
|
+
contextChars?: unknown;
|
|
18
|
+
caseSensitive?: unknown;
|
|
19
|
+
} | undefined;
|
|
5
20
|
}, unknown>;
|
|
6
21
|
export default _default;
|
|
7
22
|
//# sourceMappingURL=provider-api-docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api-docs.d.ts","sourceRoot":"","sources":["../../src/actions/provider-api-docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider-api-docs.d.ts","sourceRoot":"","sources":["../../src/actions/provider-api-docs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,wBAmDG"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { fetchProviderApiDocs } from "../server/lib/provider-api.js";
|
|
4
|
+
const BooleanFromQuerySchema = z.preprocess((value) => (typeof value === "string" ? value === "true" : value), z.boolean());
|
|
5
|
+
const WebContentSearchSchema = z.object({
|
|
6
|
+
query: z.union([z.string(), z.array(z.string())]).optional(),
|
|
7
|
+
queries: z.array(z.string()).optional(),
|
|
8
|
+
terms: z.array(z.string()).optional(),
|
|
9
|
+
regex: z.string().optional(),
|
|
10
|
+
regexFlags: z.string().optional(),
|
|
11
|
+
source: z.enum(["extracted", "raw"]).optional(),
|
|
12
|
+
maxMatches: z.coerce.number().int().min(1).max(500).optional(),
|
|
13
|
+
contextChars: z.coerce.number().int().min(0).max(1_000).optional(),
|
|
14
|
+
caseSensitive: BooleanFromQuerySchema.optional(),
|
|
15
|
+
});
|
|
4
16
|
export default defineAction({
|
|
5
17
|
description: "Inspect provider API docs/spec metadata, or fetch ANY public API documentation page, OpenAPI spec, changelog, or web page. Registered docs/spec URLs from provider-api-catalog are curated starting points, but any public https/http URL is allowed. Use web-search to find documentation URLs first when uncertain, then fetch them here. SSRF guard still applies — private/internal addresses are blocked.",
|
|
6
18
|
schema: z.object({
|
|
@@ -20,6 +32,23 @@ export default defineAction({
|
|
|
20
32
|
.max(4 * 1024 * 1024)
|
|
21
33
|
.optional()
|
|
22
34
|
.describe("Maximum response bytes to read. Default 1MB, max 4MB."),
|
|
35
|
+
maxChars: z.coerce
|
|
36
|
+
.number()
|
|
37
|
+
.int()
|
|
38
|
+
.min(1)
|
|
39
|
+
.max(200_000)
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Maximum extracted content characters to return."),
|
|
42
|
+
responseMode: z
|
|
43
|
+
.enum(["auto", "raw", "text", "markdown", "links", "metadata", "matches"])
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("How to return fetched docs. Default auto extracts HTML to markdown; use matches with search for compact snippets."),
|
|
46
|
+
extract: z
|
|
47
|
+
.enum(["readability", "all-visible", "none"])
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("HTML extraction strategy. Default readability."),
|
|
50
|
+
includeLinks: BooleanFromQuerySchema.optional().describe("Include compact links from extracted HTML. Default true."),
|
|
51
|
+
search: WebContentSearchSchema.optional().describe("Optional post-fetch search over extracted content by default. Supports query, queries, terms, regex, source, maxMatches, and contextChars."),
|
|
23
52
|
}),
|
|
24
53
|
http: { method: "GET" },
|
|
25
54
|
readOnly: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api-docs.js","sourceRoot":"","sources":["../../src/actions/provider-api-docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,gZAAgZ;IAClZ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,sIAAsI,CACvI;QACH,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,GAAG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AE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;aACzE,QAAQ,EAAE;aACV,QAAQ,CACP,mHAAmH,CACpH;QACH,OAAO,EAAE,CAAC;aACP,IAAI,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;aAC5C,QAAQ,EAAE;aACV,QAAQ,CAAC,gDAAgD,CAAC;QAC7D,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACtD,0DAA0D,CAC3D;QACD,MAAM,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAChD,4IAA4I,CAC7I;KACF,CAAC;IACF,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\nimport { fetchProviderApiDocs } from \"../server/lib/provider-api.js\";\n\nconst BooleanFromQuerySchema = z.preprocess(\n (value) => (typeof value === \"string\" ? value === \"true\" : value),\n z.boolean(),\n);\nconst WebContentSearchSchema = z.object({\n query: z.union([z.string(), z.array(z.string())]).optional(),\n queries: z.array(z.string()).optional(),\n terms: z.array(z.string()).optional(),\n regex: z.string().optional(),\n regexFlags: z.string().optional(),\n source: z.enum([\"extracted\", \"raw\"]).optional(),\n maxMatches: z.coerce.number().int().min(1).max(500).optional(),\n contextChars: z.coerce.number().int().min(0).max(1_000).optional(),\n caseSensitive: BooleanFromQuerySchema.optional(),\n});\n\nexport default defineAction({\n description:\n \"Inspect provider API docs/spec metadata, or fetch ANY public API documentation page, OpenAPI spec, changelog, or web page. Registered docs/spec URLs from provider-api-catalog are curated starting points, but any public https/http URL is allowed. Use web-search to find documentation URLs first when uncertain, then fetch them here. SSRF guard still applies — private/internal addresses are blocked.\",\n schema: z.object({\n provider: z\n .string()\n .min(1)\n .describe(\n \"Provider whose API docs/spec to inspect. Can be a built-in provider id or a custom provider id registered via provider-api-register.\",\n ),\n url: z\n .string()\n .url()\n .optional()\n .describe(\n \"Optional URL to fetch. Can be any public https/http URL — API documentation pages, OpenAPI specs, changelogs, README files, etc. Registered docs/spec URLs from provider-api-catalog are curated starting points.\",\n ),\n maxBytes: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(4 * 1024 * 1024)\n .optional()\n .describe(\"Maximum response bytes to read. Default 1MB, max 4MB.\"),\n maxChars: z.coerce\n .number()\n .int()\n .min(1)\n .max(200_000)\n .optional()\n .describe(\"Maximum extracted content characters to return.\"),\n responseMode: z\n .enum([\"auto\", \"raw\", \"text\", \"markdown\", \"links\", \"metadata\", \"matches\"])\n .optional()\n .describe(\n \"How to return fetched docs. Default auto extracts HTML to markdown; use matches with search for compact snippets.\",\n ),\n extract: z\n .enum([\"readability\", \"all-visible\", \"none\"])\n .optional()\n .describe(\"HTML extraction strategy. Default readability.\"),\n includeLinks: BooleanFromQuerySchema.optional().describe(\n \"Include compact links from extracted HTML. Default true.\",\n ),\n search: WebContentSearchSchema.optional().describe(\n \"Optional post-fetch search over extracted content by default. Supports query, queries, terms, regex, source, maxMatches, and contextChars.\",\n ),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (args) => fetchProviderApiDocs(args),\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProviderApiId, type ProviderApiMethod, type ProviderApiRequestArgs } from "@agent-native/core/provider-api";
|
|
1
|
+
import { type ProviderApiDocsOptions, type ProviderApiId, type ProviderApiMethod, type ProviderApiRequestArgs } from "@agent-native/core/provider-api";
|
|
2
2
|
export declare const DISPATCH_APP_ID = "dispatch";
|
|
3
3
|
export declare const DISPATCH_PROVIDER_API_IDS: readonly ["amplitude", "apollo", "bigquery", "commonroom", "dataforseo", "ga4", "gcloud", "github", "gmail", "gong", "google_calendar", "google_drive", "granola", "grafana", "hubspot", "jira", "mixpanel", "notion", "posthog", "prometheus", "pylon", "sentry", "slack", "stripe", "twitter"];
|
|
4
4
|
export type DispatchProviderApiId = ProviderApiId;
|
|
@@ -17,12 +17,11 @@ export declare function listProviderApiCatalog(provider?: string): {
|
|
|
17
17
|
defaultHeaders: Record<string, string>;
|
|
18
18
|
examples: readonly import("@agent-native/core/provider-api").ProviderApiExample[];
|
|
19
19
|
notes: readonly string[];
|
|
20
|
+
corpusRecipes: readonly import("@agent-native/core/provider-api").ProviderApiCorpusRecipe[];
|
|
20
21
|
templateUses: readonly import("@agent-native/core").WorkspaceConnectionTemplateUse[];
|
|
21
22
|
}[] | Promise<unknown[]>;
|
|
22
|
-
export declare function fetchProviderApiDocs(options: {
|
|
23
|
+
export declare function fetchProviderApiDocs(options: ProviderApiDocsOptions & {
|
|
23
24
|
provider: string;
|
|
24
|
-
url?: string;
|
|
25
|
-
maxBytes?: number;
|
|
26
25
|
}): Promise<unknown>;
|
|
27
26
|
export declare function executeProviderApiRequest(args: ProviderApiRequestArgs): Promise<unknown>;
|
|
28
27
|
//# sourceMappingURL=provider-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api.d.ts","sourceRoot":"","sources":["../../../src/server/lib/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"provider-api.d.ts","sourceRoot":"","sources":["../../../src/server/lib/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,yBAAyB,kSAAmB,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,CAAC;AA0C1D,wBAAgB,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;yBAEvD;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,sBAAsB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,oBAGvD;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,sBAAsB,oBAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api.js","sourceRoot":"","sources":["../../../src/server/lib/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"provider-api.js","sourceRoot":"","sources":["../../../src/server/lib/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EAExB,mBAAmB,GAIpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AAI1D,SAAS,UAAU,CAAC,MAAc;IAChC,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,yBAAyB,MAAM,6CAA6C,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,OAAO,GAAG,wBAAwB,CAAC;IACvC,KAAK,EAAE,eAAe;IACtB,qBAAqB,EAAE,gBAAgB;IACvC,oBAAoB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IAClD,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;QACnC,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAC;QACpB,2DAA2D;QAC3D,MAA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,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAA4B;IACpE,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import {\n PROVIDER_API_IDS,\n createProviderApiRuntime,\n type ProviderApiDocsOptions,\n listCustomProviders,\n type ProviderApiId,\n type ProviderApiMethod,\n type ProviderApiRequestArgs,\n} from \"@agent-native/core/provider-api\";\nimport { getCredentialContext } from \"@agent-native/core/server\";\n\nexport const DISPATCH_APP_ID = \"dispatch\";\nexport const DISPATCH_PROVIDER_API_IDS = PROVIDER_API_IDS;\nexport type DispatchProviderApiId = ProviderApiId;\nexport type { ProviderApiMethod, ProviderApiRequestArgs };\n\nfunction requireCtx(action: string) {\n const ctx = getCredentialContext();\n if (!ctx) {\n throw new Error(\n `Dispatch provider API ${action} requires an authenticated request context.`,\n );\n }\n return ctx;\n}\n\nconst runtime = createProviderApiRuntime({\n appId: DISPATCH_APP_ID,\n localCredentialSource: \"dispatch_local\",\n getCredentialContext: () => requireCtx(\"requests\"),\n getCustomProviders: async () => {\n const ctx = getCredentialContext();\n if (!ctx) return [];\n // Load custom providers for both user scope and org scope.\n const results = await Promise.allSettled([\n listCustomProviders(\"user\", ctx.userEmail),\n ctx.orgId ? listCustomProviders(\"org\", ctx.orgId) : Promise.resolve([]),\n ]);\n const userProviders =\n results[0].status === \"fulfilled\" ? results[0].value : [];\n const orgProviders =\n results[1].status === \"fulfilled\" ? results[1].value : [];\n // Merge: user-scope providers take precedence over org-scope ones with the\n // same id, and neither can shadow a built-in id.\n const seen = new Set<string>(PROVIDER_API_IDS as unknown as string[]);\n const merged = [];\n for (const p of [...userProviders, ...orgProviders]) {\n if (!seen.has(p.id)) {\n seen.add(p.id);\n merged.push(p);\n }\n }\n return merged;\n },\n});\n\nexport function listProviderApiCatalog(provider?: string) {\n return runtime.listCatalog(provider);\n}\n\nexport function fetchProviderApiDocs(\n options: ProviderApiDocsOptions & { provider: string },\n) {\n return runtime.fetchDocs(options);\n}\n\nexport function executeProviderApiRequest(args: ProviderApiRequestArgs) {\n return runtime.executeRequest(args);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-chat.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"agent-chat.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":";AA4BA,wBAuCG"}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import { createAgentChatPlugin } from "@agent-native/core/server";
|
|
2
2
|
import { getOrgContext } from "@agent-native/core/org";
|
|
3
3
|
import { dispatchActions } from "../../actions/index.js";
|
|
4
|
+
const INITIAL_TOOL_NAMES = [
|
|
5
|
+
"view-screen",
|
|
6
|
+
"list-workspace-apps",
|
|
7
|
+
"list-connected-agents",
|
|
8
|
+
"ask_app",
|
|
9
|
+
"open_app",
|
|
10
|
+
"list-workspace-resources",
|
|
11
|
+
"create-workspace-resource",
|
|
12
|
+
"update-workspace-resource",
|
|
13
|
+
"list-vault-secrets",
|
|
14
|
+
"request-vault-secret",
|
|
15
|
+
"create-vault-secret",
|
|
16
|
+
"list-destinations",
|
|
17
|
+
"upsert-destination",
|
|
18
|
+
"list-dreams",
|
|
19
|
+
"start-workspace-app-creation",
|
|
20
|
+
"list-available-workspace-templates",
|
|
21
|
+
"provider-api-catalog",
|
|
22
|
+
"provider-api-docs",
|
|
23
|
+
"provider-api-request",
|
|
24
|
+
"query-staged-dataset",
|
|
25
|
+
"navigate",
|
|
26
|
+
];
|
|
4
27
|
export default createAgentChatPlugin({
|
|
5
28
|
appId: "dispatch",
|
|
29
|
+
initialToolNames: INITIAL_TOOL_NAMES,
|
|
6
30
|
// Without this, AGENT_ORG_ID is never set on agent action calls and every
|
|
7
31
|
// row written through the frontend (vault secrets, destinations, workspace
|
|
8
32
|
// resources) lands with org_id=NULL — breaking data isolation across orgs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,eAAe,qBAAqB,CAAC;IACnC,KAAK,EAAE,UAAU;IACjB,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,OAAO,EAAE,eAAe;IACxB,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE;IAC1C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;4EAuB4D;CAC3E,CAAC,CAAC","sourcesContent":["import { createAgentChatPlugin } from \"@agent-native/core/server\";\nimport { getOrgContext } from \"@agent-native/core/org\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n // Without this, AGENT_ORG_ID is never set on agent action calls and every\n // row written through the frontend (vault secrets, destinations, workspace\n // resources) lands with org_id=NULL — breaking data isolation across orgs.\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n // Read actions directly from the package's own action map rather than from\n // a build-time-generated `.generated/actions-registry.ts` (the latter is a\n // template-only construct that the Vite plugin emits next to actions/).\n actions: dispatchActions,\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A when another app owns the job.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.\n- If the starter template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.\n\nWhen a user asks for something like a digest, reminder, routing rule, or saved behavior:\n- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.\n- Keep responses concise and operational.\n- Avoid inventing integrations or destinations that are not configured yet.`,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,qBAAqB;IACrB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,oBAAoB;IACpB,sBAAsB;IACtB,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,aAAa;IACb,8BAA8B;IAC9B,oCAAoC;IACpC,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,UAAU;CACX,CAAC;AAEF,eAAe,qBAAqB,CAAC;IACnC,KAAK,EAAE,UAAU;IACjB,gBAAgB,EAAE,kBAAkB;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,OAAO,EAAE,eAAe;IACxB,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE;IAC1C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;4EAuB4D;CAC3E,CAAC,CAAC","sourcesContent":["import { createAgentChatPlugin } from \"@agent-native/core/server\";\nimport { getOrgContext } from \"@agent-native/core/org\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nconst INITIAL_TOOL_NAMES = [\n \"view-screen\",\n \"list-workspace-apps\",\n \"list-connected-agents\",\n \"ask_app\",\n \"open_app\",\n \"list-workspace-resources\",\n \"create-workspace-resource\",\n \"update-workspace-resource\",\n \"list-vault-secrets\",\n \"request-vault-secret\",\n \"create-vault-secret\",\n \"list-destinations\",\n \"upsert-destination\",\n \"list-dreams\",\n \"start-workspace-app-creation\",\n \"list-available-workspace-templates\",\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"query-staged-dataset\",\n \"navigate\",\n];\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n initialToolNames: INITIAL_TOOL_NAMES,\n // Without this, AGENT_ORG_ID is never set on agent action calls and every\n // row written through the frontend (vault secrets, destinations, workspace\n // resources) lands with org_id=NULL — breaking data isolation across orgs.\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n // Read actions directly from the package's own action map rather than from\n // a build-time-generated `.generated/actions-registry.ts` (the latter is a\n // template-only construct that the Vite plugin emits next to actions/).\n actions: dispatchActions,\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A when another app owns the job.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.\n- If the starter template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.\n\nWhen a user asks for something like a digest, reminder, routing rule, or saved behavior:\n- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.\n- Keep responses concise and operational.\n- Avoid inventing integrations or destinations that are not configured yet.`,\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/dispatch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,14 +34,6 @@
|
|
|
34
34
|
"dist",
|
|
35
35
|
"src"
|
|
36
36
|
],
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "tsc && tsc-alias --resolve-full-paths",
|
|
39
|
-
"dev": "tsc --watch & tsc-alias --watch --resolve-full-paths",
|
|
40
|
-
"typecheck": "tsc --noEmit",
|
|
41
|
-
"test": "vitest --run src --passWithNoTests",
|
|
42
|
-
"prepack": "npm run build && cp ../../README.md ./README.md",
|
|
43
|
-
"prepublishOnly": "npm run build"
|
|
44
|
-
},
|
|
45
37
|
"peerDependencies": {
|
|
46
38
|
"@agent-native/core": ">=0.8.0",
|
|
47
39
|
"react": ">=18",
|
|
@@ -97,7 +89,6 @@
|
|
|
97
89
|
"zod": "^4.3.6"
|
|
98
90
|
},
|
|
99
91
|
"devDependencies": {
|
|
100
|
-
"@agent-native/core": "workspace:*",
|
|
101
92
|
"@react-router/dev": "^7.16.0",
|
|
102
93
|
"@types/node": "^24.2.1",
|
|
103
94
|
"@types/react": "^19.2.14",
|
|
@@ -107,7 +98,14 @@
|
|
|
107
98
|
"react-router": "^7.16.0",
|
|
108
99
|
"tsc-alias": "^1.8.10",
|
|
109
100
|
"typescript": "^6.0.3",
|
|
110
|
-
"vite": "
|
|
111
|
-
"vitest": "^4.1.5"
|
|
101
|
+
"vite": "8.0.3",
|
|
102
|
+
"vitest": "^4.1.5",
|
|
103
|
+
"@agent-native/core": "0.58.4"
|
|
104
|
+
},
|
|
105
|
+
"scripts": {
|
|
106
|
+
"build": "tsc && tsc-alias --resolve-full-paths",
|
|
107
|
+
"dev": "tsc --watch & tsc-alias --watch --resolve-full-paths",
|
|
108
|
+
"typecheck": "tsc --noEmit",
|
|
109
|
+
"test": "vitest --run src --passWithNoTests"
|
|
112
110
|
}
|
|
113
|
-
}
|
|
111
|
+
}
|
|
@@ -2,6 +2,22 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { fetchProviderApiDocs } from "../server/lib/provider-api.js";
|
|
4
4
|
|
|
5
|
+
const BooleanFromQuerySchema = z.preprocess(
|
|
6
|
+
(value) => (typeof value === "string" ? value === "true" : value),
|
|
7
|
+
z.boolean(),
|
|
8
|
+
);
|
|
9
|
+
const WebContentSearchSchema = z.object({
|
|
10
|
+
query: z.union([z.string(), z.array(z.string())]).optional(),
|
|
11
|
+
queries: z.array(z.string()).optional(),
|
|
12
|
+
terms: z.array(z.string()).optional(),
|
|
13
|
+
regex: z.string().optional(),
|
|
14
|
+
regexFlags: z.string().optional(),
|
|
15
|
+
source: z.enum(["extracted", "raw"]).optional(),
|
|
16
|
+
maxMatches: z.coerce.number().int().min(1).max(500).optional(),
|
|
17
|
+
contextChars: z.coerce.number().int().min(0).max(1_000).optional(),
|
|
18
|
+
caseSensitive: BooleanFromQuerySchema.optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
5
21
|
export default defineAction({
|
|
6
22
|
description:
|
|
7
23
|
"Inspect provider API docs/spec metadata, or fetch ANY public API documentation page, OpenAPI spec, changelog, or web page. Registered docs/spec URLs from provider-api-catalog are curated starting points, but any public https/http URL is allowed. Use web-search to find documentation URLs first when uncertain, then fetch them here. SSRF guard still applies — private/internal addresses are blocked.",
|
|
@@ -26,6 +42,29 @@ export default defineAction({
|
|
|
26
42
|
.max(4 * 1024 * 1024)
|
|
27
43
|
.optional()
|
|
28
44
|
.describe("Maximum response bytes to read. Default 1MB, max 4MB."),
|
|
45
|
+
maxChars: z.coerce
|
|
46
|
+
.number()
|
|
47
|
+
.int()
|
|
48
|
+
.min(1)
|
|
49
|
+
.max(200_000)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Maximum extracted content characters to return."),
|
|
52
|
+
responseMode: z
|
|
53
|
+
.enum(["auto", "raw", "text", "markdown", "links", "metadata", "matches"])
|
|
54
|
+
.optional()
|
|
55
|
+
.describe(
|
|
56
|
+
"How to return fetched docs. Default auto extracts HTML to markdown; use matches with search for compact snippets.",
|
|
57
|
+
),
|
|
58
|
+
extract: z
|
|
59
|
+
.enum(["readability", "all-visible", "none"])
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("HTML extraction strategy. Default readability."),
|
|
62
|
+
includeLinks: BooleanFromQuerySchema.optional().describe(
|
|
63
|
+
"Include compact links from extracted HTML. Default true.",
|
|
64
|
+
),
|
|
65
|
+
search: WebContentSearchSchema.optional().describe(
|
|
66
|
+
"Optional post-fetch search over extracted content by default. Supports query, queries, terms, regex, source, maxMatches, and contextChars.",
|
|
67
|
+
),
|
|
29
68
|
}),
|
|
30
69
|
http: { method: "GET" },
|
|
31
70
|
readOnly: true,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PROVIDER_API_IDS,
|
|
3
3
|
createProviderApiRuntime,
|
|
4
|
+
type ProviderApiDocsOptions,
|
|
4
5
|
listCustomProviders,
|
|
5
6
|
type ProviderApiId,
|
|
6
7
|
type ProviderApiMethod,
|
|
@@ -57,11 +58,9 @@ export function listProviderApiCatalog(provider?: string) {
|
|
|
57
58
|
return runtime.listCatalog(provider);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
export function fetchProviderApiDocs(
|
|
61
|
-
provider: string
|
|
62
|
-
|
|
63
|
-
maxBytes?: number;
|
|
64
|
-
}) {
|
|
61
|
+
export function fetchProviderApiDocs(
|
|
62
|
+
options: ProviderApiDocsOptions & { provider: string },
|
|
63
|
+
) {
|
|
65
64
|
return runtime.fetchDocs(options);
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -2,8 +2,33 @@ import { createAgentChatPlugin } from "@agent-native/core/server";
|
|
|
2
2
|
import { getOrgContext } from "@agent-native/core/org";
|
|
3
3
|
import { dispatchActions } from "../../actions/index.js";
|
|
4
4
|
|
|
5
|
+
const INITIAL_TOOL_NAMES = [
|
|
6
|
+
"view-screen",
|
|
7
|
+
"list-workspace-apps",
|
|
8
|
+
"list-connected-agents",
|
|
9
|
+
"ask_app",
|
|
10
|
+
"open_app",
|
|
11
|
+
"list-workspace-resources",
|
|
12
|
+
"create-workspace-resource",
|
|
13
|
+
"update-workspace-resource",
|
|
14
|
+
"list-vault-secrets",
|
|
15
|
+
"request-vault-secret",
|
|
16
|
+
"create-vault-secret",
|
|
17
|
+
"list-destinations",
|
|
18
|
+
"upsert-destination",
|
|
19
|
+
"list-dreams",
|
|
20
|
+
"start-workspace-app-creation",
|
|
21
|
+
"list-available-workspace-templates",
|
|
22
|
+
"provider-api-catalog",
|
|
23
|
+
"provider-api-docs",
|
|
24
|
+
"provider-api-request",
|
|
25
|
+
"query-staged-dataset",
|
|
26
|
+
"navigate",
|
|
27
|
+
];
|
|
28
|
+
|
|
5
29
|
export default createAgentChatPlugin({
|
|
6
30
|
appId: "dispatch",
|
|
31
|
+
initialToolNames: INITIAL_TOOL_NAMES,
|
|
7
32
|
// Without this, AGENT_ORG_ID is never set on agent action calls and every
|
|
8
33
|
// row written through the frontend (vault secrets, destinations, workspace
|
|
9
34
|
// resources) lands with org_id=NULL — breaking data isolation across orgs.
|