@agent-native/core 0.7.82 → 0.8.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.
- package/dist/action.js +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +8 -8
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +2 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +44 -18
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/create.d.ts +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +87 -19
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +12 -9
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +22 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts +3 -2
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +18 -14
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +254 -29
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-chat.d.ts +2 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +11 -2
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/builder-frame.d.ts +11 -0
- package/dist/client/builder-frame.d.ts.map +1 -1
- package/dist/client/builder-frame.js +40 -9
- package/dist/client/builder-frame.js.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.js +1 -1
- package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts +2 -0
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +3 -3
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +3 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +25 -13
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/types.d.ts +1 -1
- package/dist/client/composer/types.d.ts.map +1 -1
- package/dist/client/composer/types.js.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.d.ts +20 -0
- package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -0
- package/dist/client/{tools/EmbeddedTool.js → extensions/EmbeddedExtension.js} +41 -41
- package/dist/client/extensions/EmbeddedExtension.js.map +1 -0
- package/dist/client/extensions/ExtensionEditor.d.ts +5 -0
- package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionEditor.js +129 -0
- package/dist/client/extensions/ExtensionEditor.js.map +1 -0
- package/dist/client/{tools → extensions}/ExtensionSlot.d.ts +3 -3
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -0
- package/dist/client/{tools → extensions}/ExtensionSlot.js +14 -14
- package/dist/client/extensions/ExtensionSlot.js.map +1 -0
- package/dist/client/extensions/ExtensionViewer.d.ts +5 -0
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -0
- package/dist/client/{tools/ToolViewer.js → extensions/ExtensionViewer.js} +67 -65
- package/dist/client/extensions/ExtensionViewer.js.map +1 -0
- package/dist/client/extensions/ExtensionViewerPage.d.ts +2 -0
- package/dist/client/extensions/ExtensionViewerPage.d.ts.map +1 -0
- package/dist/client/{tools/ToolViewerPage.js → extensions/ExtensionViewerPage.js} +8 -8
- package/dist/client/extensions/ExtensionViewerPage.js.map +1 -0
- package/dist/client/extensions/ExtensionsListPage.d.ts +2 -0
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionsListPage.js +67 -0
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -0
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts +2 -0
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -0
- package/dist/client/{tools/ToolsSidebarSection.js → extensions/ExtensionsSidebarSection.js} +58 -58
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -0
- package/dist/client/{tools/tool-order.d.ts → extensions/extension-order.d.ts} +2 -2
- package/dist/client/extensions/extension-order.d.ts.map +1 -0
- package/dist/client/{tools/tool-order.js → extensions/extension-order.js} +3 -3
- package/dist/client/extensions/extension-order.js.map +1 -0
- package/dist/client/{tools → extensions}/iframe-bridge.d.ts +11 -11
- package/dist/client/extensions/iframe-bridge.d.ts.map +1 -0
- package/dist/client/{tools → extensions}/iframe-bridge.js +24 -24
- package/dist/client/extensions/iframe-bridge.js.map +1 -0
- package/dist/client/extensions/index.d.ts +14 -0
- package/dist/client/extensions/index.d.ts.map +1 -0
- package/dist/client/extensions/index.js +19 -0
- package/dist/client/extensions/index.js.map +1 -0
- package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +4 -1
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +2 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +87 -6
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/extensions/actions.d.ts +3 -0
- package/dist/extensions/actions.d.ts.map +1 -0
- package/dist/{tools → extensions}/actions.js +54 -51
- package/dist/extensions/actions.js.map +1 -0
- package/dist/{tools → extensions}/fetch-tool.d.ts +4 -0
- package/dist/extensions/fetch-tool.d.ts.map +1 -0
- package/dist/{tools → extensions}/fetch-tool.js +12 -7
- package/dist/extensions/fetch-tool.js.map +1 -0
- package/dist/extensions/html-shell.d.ts +56 -0
- package/dist/extensions/html-shell.d.ts.map +1 -0
- package/dist/{tools → extensions}/html-shell.js +101 -83
- package/dist/extensions/html-shell.js.map +1 -0
- package/dist/{tools → extensions}/proxy-security.d.ts +2 -2
- package/dist/extensions/proxy-security.d.ts.map +1 -0
- package/dist/{tools → extensions}/proxy-security.js +3 -3
- package/dist/extensions/proxy-security.js.map +1 -0
- package/dist/extensions/routes.d.ts +2 -0
- package/dist/extensions/routes.d.ts.map +1 -0
- package/dist/{tools → extensions}/routes.js +73 -69
- package/dist/extensions/routes.js.map +1 -0
- package/dist/{tools → extensions}/schema.d.ts +44 -38
- package/dist/extensions/schema.d.ts.map +1 -0
- package/dist/{tools → extensions}/schema.js +41 -34
- package/dist/extensions/schema.js.map +1 -0
- package/dist/extensions/slots/routes.d.ts +15 -0
- package/dist/extensions/slots/routes.d.ts.map +1 -0
- package/dist/{tools → extensions}/slots/routes.js +26 -26
- package/dist/extensions/slots/routes.js.map +1 -0
- package/dist/{tools → extensions}/slots/schema.d.ts +24 -21
- package/dist/extensions/slots/schema.d.ts.map +1 -0
- package/dist/extensions/slots/schema.js +79 -0
- package/dist/extensions/slots/schema.js.map +1 -0
- package/dist/extensions/slots/store.d.ts +66 -0
- package/dist/extensions/slots/store.d.ts.map +1 -0
- package/dist/extensions/slots/store.js +238 -0
- package/dist/extensions/slots/store.js.map +1 -0
- package/dist/extensions/store.d.ts +40 -0
- package/dist/extensions/store.d.ts.map +1 -0
- package/dist/{tools → extensions}/store.js +59 -54
- package/dist/extensions/store.js.map +1 -0
- package/dist/extensions/theme.d.ts.map +1 -0
- package/dist/extensions/theme.js.map +1 -0
- package/dist/{tools → extensions}/url-safety.d.ts +5 -3
- package/dist/extensions/url-safety.d.ts.map +1 -0
- package/dist/{tools → extensions}/url-safety.js +11 -4
- package/dist/extensions/url-safety.js.map +1 -0
- package/dist/server/action-discovery.d.ts +15 -0
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +45 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +12 -10
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts +5 -4
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +80 -28
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +15 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +65 -13
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts +3 -2
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +3 -2
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +15 -3
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/shared/workspace-app-id.d.ts +1 -1
- package/dist/shared/workspace-app-id.d.ts.map +1 -1
- package/dist/shared/workspace-app-id.js +5 -1
- package/dist/shared/workspace-app-id.js.map +1 -1
- package/dist/templates/workspace-root/README.md +5 -4
- package/dist/usage/store.d.ts +1 -1
- package/dist/usage/store.d.ts.map +1 -1
- package/dist/usage/store.js +1 -1
- package/dist/usage/store.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +17 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.md +10 -10
- package/docs/content/extensions.md +230 -0
- package/docs/content/key-concepts.md +2 -2
- package/docs/content/server.md +13 -13
- package/docs/content/sharing.md +2 -2
- package/docs/content/template-analytics.md +10 -0
- package/docs/content/template-calendar.md +10 -0
- package/docs/content/template-clips.md +10 -0
- package/docs/content/template-content.md +10 -0
- package/docs/content/template-dispatch.md +15 -0
- package/docs/content/template-forms.md +10 -0
- package/docs/content/template-mail.md +10 -0
- package/docs/content/template-slides.md +11 -1
- package/docs/content/template-starter.md +10 -0
- package/docs/content/template-video.md +10 -0
- package/docs/content/what-is-agent-native.md +1 -1
- package/package.json +22 -17
- package/src/templates/workspace-root/README.md +5 -4
- package/dist/client/tools/EmbeddedTool.d.ts +0 -20
- package/dist/client/tools/EmbeddedTool.d.ts.map +0 -1
- package/dist/client/tools/EmbeddedTool.js.map +0 -1
- package/dist/client/tools/ExtensionSlot.d.ts.map +0 -1
- package/dist/client/tools/ExtensionSlot.js.map +0 -1
- package/dist/client/tools/ToolEditor.d.ts +0 -5
- package/dist/client/tools/ToolEditor.d.ts.map +0 -1
- package/dist/client/tools/ToolEditor.js +0 -129
- package/dist/client/tools/ToolEditor.js.map +0 -1
- package/dist/client/tools/ToolViewer.d.ts +0 -5
- package/dist/client/tools/ToolViewer.d.ts.map +0 -1
- package/dist/client/tools/ToolViewer.js.map +0 -1
- package/dist/client/tools/ToolViewerPage.d.ts +0 -2
- package/dist/client/tools/ToolViewerPage.d.ts.map +0 -1
- package/dist/client/tools/ToolViewerPage.js.map +0 -1
- package/dist/client/tools/ToolsListPage.d.ts +0 -2
- package/dist/client/tools/ToolsListPage.d.ts.map +0 -1
- package/dist/client/tools/ToolsListPage.js +0 -67
- package/dist/client/tools/ToolsListPage.js.map +0 -1
- package/dist/client/tools/ToolsSidebarSection.d.ts +0 -2
- package/dist/client/tools/ToolsSidebarSection.d.ts.map +0 -1
- package/dist/client/tools/ToolsSidebarSection.js.map +0 -1
- package/dist/client/tools/iframe-bridge.d.ts.map +0 -1
- package/dist/client/tools/iframe-bridge.js.map +0 -1
- package/dist/client/tools/index.d.ts +0 -8
- package/dist/client/tools/index.d.ts.map +0 -1
- package/dist/client/tools/index.js +0 -8
- package/dist/client/tools/index.js.map +0 -1
- package/dist/client/tools/tool-order.d.ts.map +0 -1
- package/dist/client/tools/tool-order.js.map +0 -1
- package/dist/tools/actions.d.ts +0 -3
- package/dist/tools/actions.d.ts.map +0 -1
- package/dist/tools/actions.js.map +0 -1
- package/dist/tools/fetch-tool.d.ts.map +0 -1
- package/dist/tools/fetch-tool.js.map +0 -1
- package/dist/tools/html-shell.d.ts +0 -45
- package/dist/tools/html-shell.d.ts.map +0 -1
- package/dist/tools/html-shell.js.map +0 -1
- package/dist/tools/proxy-security.d.ts.map +0 -1
- package/dist/tools/proxy-security.js.map +0 -1
- package/dist/tools/routes.d.ts +0 -2
- package/dist/tools/routes.d.ts.map +0 -1
- package/dist/tools/routes.js.map +0 -1
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/schema.js.map +0 -1
- package/dist/tools/slots/routes.d.ts +0 -15
- package/dist/tools/slots/routes.d.ts.map +0 -1
- package/dist/tools/slots/routes.js.map +0 -1
- package/dist/tools/slots/schema.d.ts.map +0 -1
- package/dist/tools/slots/schema.js +0 -76
- package/dist/tools/slots/schema.js.map +0 -1
- package/dist/tools/slots/store.d.ts +0 -66
- package/dist/tools/slots/store.d.ts.map +0 -1
- package/dist/tools/slots/store.js +0 -227
- package/dist/tools/slots/store.js.map +0 -1
- package/dist/tools/store.d.ts +0 -40
- package/dist/tools/store.d.ts.map +0 -1
- package/dist/tools/store.js.map +0 -1
- package/dist/tools/theme.d.ts.map +0 -1
- package/dist/tools/theme.js.map +0 -1
- package/dist/tools/url-safety.d.ts.map +0 -1
- package/dist/tools/url-safety.js.map +0 -1
- package/docs/content/tools.md +0 -205
- /package/dist/{tools → extensions}/theme.d.ts +0 -0
- /package/dist/{tools → extensions}/theme.js +0 -0
package/docs/content/tools.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Tools"
|
|
3
|
-
description: "Lightweight interactive apps — dashboards, widgets, calculators, monitors — that the agent creates for you instantly, without changing your app's code."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Tools
|
|
7
|
-
|
|
8
|
-
Tools are lightweight interactive apps that live inside your agent-native app. Think dashboards, widgets, calculators, API monitors, data lookups — anything you'd otherwise build by hand.
|
|
9
|
-
|
|
10
|
-
The key difference from the rest of your app: **tools don't require code changes.** The agent creates and updates them at runtime, they're stored in the database, and they're ready to use immediately. No deploys, no builds, no pull requests.
|
|
11
|
-
|
|
12
|
-
## Tools vs. editing the app {#tools-vs-code}
|
|
13
|
-
|
|
14
|
-
Your agent-native app has a full codebase — React components, routes, actions, styles. When the agent edits that code, it's changing the app itself. That's powerful, but it requires a build step and a deploy.
|
|
15
|
-
|
|
16
|
-
Tools are different:
|
|
17
|
-
|
|
18
|
-
| | App code | Tools |
|
|
19
|
-
| --------------------- | --------------------------------------- | -------------------------------------------------- |
|
|
20
|
-
| **Created by** | Developer or agent editing source files | Agent or user, instantly from chat |
|
|
21
|
-
| **Stored in** | Git repository | Database |
|
|
22
|
-
| **Requires a build** | Yes | No |
|
|
23
|
-
| **Requires a deploy** | Yes | No |
|
|
24
|
-
| **Scope** | Part of the app for all users | Private by default, shareable |
|
|
25
|
-
| **Best for** | Core app features | Personal dashboards, utilities, quick integrations |
|
|
26
|
-
|
|
27
|
-
Use app code for features that are core to the product. Use tools for everything else — one-off utilities, personal dashboards, quick integrations, monitors, and things you want to spin up in seconds.
|
|
28
|
-
|
|
29
|
-
## When to build a tool vs. a template feature {#when-to-build}
|
|
30
|
-
|
|
31
|
-
A quick decision rubric:
|
|
32
|
-
|
|
33
|
-
**Build a tool when:**
|
|
34
|
-
|
|
35
|
-
- It's for one user or one team, not the whole product.
|
|
36
|
-
- It's a quick utility, dashboard, or widget you want now, not next sprint.
|
|
37
|
-
- No new database schema is needed (or per-tool key-value storage is enough).
|
|
38
|
-
- You want to ship it inside a single chat turn, no deploy.
|
|
39
|
-
|
|
40
|
-
**Add a template feature when:**
|
|
41
|
-
|
|
42
|
-
- Every user of the template should get it.
|
|
43
|
-
- It needs new SQL tables, migrations, or shared schema changes.
|
|
44
|
-
- The UI is complex enough to warrant React components, routes, and proper testing.
|
|
45
|
-
- It's part of the product surface — something you'd advertise on a landing page.
|
|
46
|
-
|
|
47
|
-
When in doubt, start as a tool. Promoting a tool to a template feature later is straightforward; rolling back a half-shipped product feature is not.
|
|
48
|
-
|
|
49
|
-
## Creating a tool {#creating}
|
|
50
|
-
|
|
51
|
-
### From the sidebar
|
|
52
|
-
|
|
53
|
-
Click the **+** button in the Tools section of the sidebar. Describe what you want in plain language — "a dashboard that shows my open GitHub PRs" — and the agent builds it for you.
|
|
54
|
-
|
|
55
|
-
### From chat
|
|
56
|
-
|
|
57
|
-
Just ask: "Create a tool that monitors our API health" or "Make me a calculator for shipping costs." The agent handles the rest.
|
|
58
|
-
|
|
59
|
-
### Updating a tool
|
|
60
|
-
|
|
61
|
-
Ask the agent: "Update my PR dashboard to also show draft PRs" or "Add a dark mode toggle to the weather widget." The agent makes surgical edits without regenerating the whole thing.
|
|
62
|
-
|
|
63
|
-
## What tools can do {#capabilities}
|
|
64
|
-
|
|
65
|
-
Tools are fully capable despite being lightweight. They can:
|
|
66
|
-
|
|
67
|
-
- **Call external APIs** — GitHub, Stripe, weather services, any REST API. Requests go through a secure server-side proxy that keeps your API keys safe.
|
|
68
|
-
- **Call your app's actions** — anything your agent can do, a tool can trigger.
|
|
69
|
-
- **Query your app's database** — read and write data directly.
|
|
70
|
-
- **Store their own data** — each tool has built-in persistent storage, no setup required. Save notes, preferences, cached results — whatever the tool needs.
|
|
71
|
-
- **Call any endpoint in your app** — hit custom API routes, webhooks, or internal services.
|
|
72
|
-
|
|
73
|
-
All of this works out of the box. No configuration, no new files, no schema changes.
|
|
74
|
-
|
|
75
|
-
## Layout defaults {#layout}
|
|
76
|
-
|
|
77
|
-
Tools render with modest canvas padding by default so simple widgets and dashboards do not hug the iframe edge. For full-bleed experiences such as maps, canvases, or custom editors, set `data-tool-layout="full-bleed"` or `data-tool-padding="none"` on the outermost element.
|
|
78
|
-
|
|
79
|
-
## Persistent storage {#persistent-storage}
|
|
80
|
-
|
|
81
|
-
Every tool has access to a built-in key-value store via the `toolData` helper. Data is automatically scoped per tool and per user — your data stays yours.
|
|
82
|
-
|
|
83
|
-
When you ask the agent to "add persistence" or "remember state" in a tool, it uses this built-in storage. No database tables to create, no migrations to run.
|
|
84
|
-
|
|
85
|
-
### Scopes
|
|
86
|
-
|
|
87
|
-
All `toolData` methods accept an optional `{ scope }` option:
|
|
88
|
-
|
|
89
|
-
- `'user'` (default) — private to the current user.
|
|
90
|
-
- `'org'` — shared across the user's organization.
|
|
91
|
-
- `'all'` — list/get only; returns both user-scoped and org-scoped items.
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
<script>
|
|
95
|
-
// Private to me
|
|
96
|
-
await toolData.set('notes', 'note-1', { title: 'My Note' });
|
|
97
|
-
|
|
98
|
-
// Shared with my org
|
|
99
|
-
await toolData.set('notes', 'team-note', { title: 'Team Note' }, { scope: 'org' });
|
|
100
|
-
|
|
101
|
-
// List my notes (default)
|
|
102
|
-
const mine = await toolData.list('notes');
|
|
103
|
-
|
|
104
|
-
// List both mine and the org's
|
|
105
|
-
const everything = await toolData.list('notes', { scope: 'all' });
|
|
106
|
-
</script>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## API keys and secrets {#secrets}
|
|
110
|
-
|
|
111
|
-
When a tool needs an API key (for GitHub, OpenAI, a weather service, etc.), the agent will tell you what's needed and where to get it. You add the key through the Settings UI in the agent sidebar.
|
|
112
|
-
|
|
113
|
-
Keys are encrypted and stored securely. Each key is restricted to specific domains — a GitHub token can only be sent to `api.github.com`, never anywhere else.
|
|
114
|
-
|
|
115
|
-
### Secrets in tools {#secrets-in-tools}
|
|
116
|
-
|
|
117
|
-
Tools reference secrets in `toolFetch()` calls using the `${keys.NAME}` template pattern. The proxy substitutes the encrypted value server-side; the actual key never reaches the browser.
|
|
118
|
-
|
|
119
|
-
```html
|
|
120
|
-
<script>
|
|
121
|
-
const res = await toolFetch('https://api.github.com/user', {
|
|
122
|
-
headers: {
|
|
123
|
-
Authorization: 'Bearer ${keys.GITHUB_TOKEN}',
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
</script>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
When a tool needs a one-off key, the agent can register an ad-hoc secret via `POST /_agent-native/secrets/adhoc` with a `urlAllowlist` that pins which domains the secret may be sent to. A request to any other host is rejected before the proxy fires. Combined with SSRF and private-network protections, this means a leaked tool can't exfiltrate secrets to an attacker-controlled URL.
|
|
130
|
-
|
|
131
|
-
## Sharing {#sharing}
|
|
132
|
-
|
|
133
|
-
Tools are **private by default** — only you can see and use a tool you create.
|
|
134
|
-
|
|
135
|
-
You can share tools with your team:
|
|
136
|
-
|
|
137
|
-
- **Org-visible** — everyone in your organization can use it.
|
|
138
|
-
- **Per-user sharing** — grant access to specific people as viewers, editors, or admins.
|
|
139
|
-
|
|
140
|
-
Shared tools have their own URLs, so you can link to them directly.
|
|
141
|
-
|
|
142
|
-
Under the hood, tools use the same ownable-resource model as the rest of the framework — `ownableColumns()` on the `tools` table and a standard `createSharesTable()` for grants. That means tools plug into the same share dialog, access checks, and audit surfaces as documents, decks, dashboards, and any other shareable resource. See [Security](/docs/security) for the full access model.
|
|
143
|
-
|
|
144
|
-
## Security {#security}
|
|
145
|
-
|
|
146
|
-
Tools run in a secure sandbox:
|
|
147
|
-
|
|
148
|
-
- **Isolated** — tools can't access your app's cookies, session, or page content.
|
|
149
|
-
- **API keys stay server-side** — secrets are injected by the server, never exposed to the browser.
|
|
150
|
-
- **Domain-restricted secrets** — each API key can only be sent to its approved domains.
|
|
151
|
-
- **Private network protection** — tools can't reach internal/private network addresses.
|
|
152
|
-
- **Authentication required** — only logged-in users can use tools.
|
|
153
|
-
|
|
154
|
-
## Tool API reference {#api-reference}
|
|
155
|
-
|
|
156
|
-
Every tool runs inside a sandboxed iframe with the following helpers injected on `window`. They are the complete surface area — anything else a tool needs has to go through one of these.
|
|
157
|
-
|
|
158
|
-
| Helper | Purpose | Example |
|
|
159
|
-
| ------------------------------------------- | ---------------------- | --------------------------------------------- |
|
|
160
|
-
| `toolData.set(collection, id, data, opts?)` | Persist data per-tool | `toolData.set('notes', id, { text: '...' })` |
|
|
161
|
-
| `toolData.list(collection, opts?)` | List persisted items | `toolData.list('notes', { scope: 'all' })` |
|
|
162
|
-
| `toolData.get(collection, id, opts?)` | Get a single item | `toolData.get('notes', 'note-1')` |
|
|
163
|
-
| `toolData.remove(collection, id, opts?)` | Delete persisted item | `toolData.remove('notes', 'note-1')` |
|
|
164
|
-
| `appAction(name, params)` | Call any app action | `appAction('list-emails', { view: 'inbox' })` |
|
|
165
|
-
| `dbQuery(sql, args)` | Read from SQL | `dbQuery('SELECT * FROM tools')` |
|
|
166
|
-
| `dbExec(sql, args)` | Write to SQL | `dbExec('INSERT INTO ...')` |
|
|
167
|
-
| `appFetch(path, options)` | Call any app endpoint | `appFetch('/api/settings')` |
|
|
168
|
-
| `toolFetch(url, options)` | External API via proxy | `toolFetch('https://api.github.com/...')` |
|
|
169
|
-
|
|
170
|
-
`appAction` is the preferred way to trigger app behavior — it routes through the same actions the agent and the frontend use, so authorization and access scoping happen automatically. Drop down to `dbQuery`/`dbExec` only when there's no action that fits.
|
|
171
|
-
|
|
172
|
-
### Routes {#routes}
|
|
173
|
-
|
|
174
|
-
The framework mounts the following endpoints under `/_agent-native/tools/`. Tools themselves rarely call these directly — they're useful when integrating tools with external scripts or custom UI.
|
|
175
|
-
|
|
176
|
-
| Method | Path | Purpose |
|
|
177
|
-
| ------ | --------------------------------- | -------------------------------------------- |
|
|
178
|
-
| GET | `/_agent-native/tools` | List tools (filtered by ownership + sharing) |
|
|
179
|
-
| POST | `/_agent-native/tools` | Create a tool |
|
|
180
|
-
| GET | `/_agent-native/tools/:id` | Get a single tool |
|
|
181
|
-
| PUT | `/_agent-native/tools/:id` | Update (supports `patches` for diffing) |
|
|
182
|
-
| DELETE | `/_agent-native/tools/:id` | Delete a tool |
|
|
183
|
-
| GET | `/_agent-native/tools/:id/render` | Render the iframe HTML |
|
|
184
|
-
| POST | `/_agent-native/tools/proxy` | Authenticated proxy with secret injection |
|
|
185
|
-
|
|
186
|
-
## Examples {#examples}
|
|
187
|
-
|
|
188
|
-
Here are some things people build as tools:
|
|
189
|
-
|
|
190
|
-
- **GitHub PR dashboard** — see open PRs, review status, and CI checks at a glance
|
|
191
|
-
- **API health monitor** — check if your services are up with a single click
|
|
192
|
-
- **Weather widget** — quick weather lookup for any city
|
|
193
|
-
- **Stripe payment lookup** — search recent payments and refunds
|
|
194
|
-
- **Database explorer** — browse and query your app's data
|
|
195
|
-
- **Shipping cost calculator** — compute rates based on weight and destination
|
|
196
|
-
- **Meeting notes summarizer** — paste notes, get action items
|
|
197
|
-
- **Social media scheduler** — draft and schedule posts across platforms
|
|
198
|
-
|
|
199
|
-
To create any of these, just describe what you want in the agent chat.
|
|
200
|
-
|
|
201
|
-
## What's next
|
|
202
|
-
|
|
203
|
-
- [**Actions**](/docs/actions) — the operations that tools (and the agent) can call
|
|
204
|
-
- [**Workspace**](/docs/workspace) — the broader workspace system tools live alongside
|
|
205
|
-
- [**Security**](/docs/security) — the framework's data scoping and access control
|
|
File without changes
|
|
File without changes
|