experimental-ash 0.7.1 → 0.7.3
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/docs/external-agent-protocol.md +5 -5
- package/dist/docs/internals/README.md +8 -8
- package/dist/docs/internals/context.md +1 -1
- package/dist/docs/internals/hooks.md +5 -5
- package/dist/docs/internals/message-runtime.md +6 -6
- package/dist/docs/public/README.md +22 -22
- package/dist/docs/public/agent-ts.md +21 -17
- package/dist/docs/public/auth-and-route-protection.md +13 -13
- package/dist/docs/public/channels/README.md +16 -13
- package/dist/docs/public/cli-build-and-debugging.md +3 -3
- package/dist/docs/public/connections.md +5 -5
- package/dist/docs/public/context-control.md +8 -8
- package/dist/docs/public/evals.md +3 -3
- package/dist/docs/public/getting-started.md +5 -5
- package/dist/docs/public/hooks.md +4 -4
- package/dist/docs/public/human-in-the-loop.md +3 -3
- package/dist/docs/public/instrumentation.md +4 -3
- package/dist/docs/public/project-layout.md +11 -11
- package/dist/docs/public/runs-and-streaming.md +3 -3
- package/dist/docs/public/sandbox.md +3 -3
- package/dist/docs/public/session-context.md +10 -6
- package/dist/docs/public/skills.md +5 -3
- package/dist/docs/public/subagents.md +2 -2
- package/dist/docs/public/tools.md +4 -5
- package/dist/docs/public/typescript-api.md +12 -12
- package/dist/docs/public/vercel-deployment.md +4 -4
- package/dist/docs/public/workspace.md +3 -3
- package/dist/src/channel/compiled-channel.d.ts +4 -2
- package/dist/src/channel/schedule.d.ts +11 -23
- package/dist/src/channel/schedule.js +18 -19
- package/dist/src/chunks/{dev-authored-source-watcher-CYsfBiYM.js → dev-authored-source-watcher-Druw92QN.js} +1 -1
- package/dist/src/chunks/{host-CsF9KDv8.js → host-CQ7AZID3.js} +2 -2
- package/dist/src/chunks/{paths-DvimrhJF.js → paths-DQbfjCIS.js} +25 -25
- package/dist/src/chunks/{prewarm-DdHk68ib.js → prewarm-CcphIXc0.js} +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +4 -4
- package/dist/src/compiler/normalize-channel.js +9 -22
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/channel.d.ts +7 -9
- package/dist/src/internal/authored-definition/channel.js +9 -33
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +5 -3
- package/dist/src/internal/nitro/routes/channel-dispatch.js +8 -5
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +3 -4
- package/dist/src/internal/nitro/routes/schedule-task.js +5 -7
- package/dist/src/public/channels/{http.d.ts → ash.d.ts} +2 -2
- package/dist/src/public/channels/{http.js → ash.js} +2 -2
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -63
- package/dist/src/public/definitions/channel.js +0 -16
- package/dist/src/public/definitions/defineChannel.d.ts +7 -4
- package/dist/src/runtime/framework-channels/index.d.ts +1 -1
- package/dist/src/runtime/framework-channels/index.js +7 -7
- package/dist/src/runtime/resolve-channel.d.ts +9 -4
- package/dist/src/runtime/resolve-channel.js +21 -28
- package/dist/src/runtime/types.d.ts +13 -8
- package/package.json +5 -5
- package/dist/src/compiler/channel-url.d.ts +0 -5
- package/dist/src/compiler/channel-url.js +0 -14
|
@@ -183,16 +183,16 @@ Current behavior:
|
|
|
183
183
|
- Token-backed auth uses `Bearer ...`.
|
|
184
184
|
- There is no second per-run ownership check after route auth succeeds.
|
|
185
185
|
|
|
186
|
-
## Overriding The
|
|
186
|
+
## Overriding The Ash Channel
|
|
187
187
|
|
|
188
|
-
The framework ships a default
|
|
189
|
-
auth or behavior, create `agent/channels/
|
|
188
|
+
The framework ships a default channel named `"ash"` that implements this protocol. To override its
|
|
189
|
+
auth or behavior, create `agent/channels/ash.ts`:
|
|
190
190
|
|
|
191
191
|
```ts
|
|
192
|
-
import {
|
|
192
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
193
193
|
import { none } from "experimental-ash/channels/auth";
|
|
194
194
|
|
|
195
|
-
export default
|
|
195
|
+
export default ashChannel({ auth: none() });
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
App-author channels take precedence over framework defaults by name.
|
|
@@ -24,11 +24,11 @@ If you want the shortest path through the architecture, read these in order:
|
|
|
24
24
|
|
|
25
25
|
## Guides
|
|
26
26
|
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
27
|
+
- [Ash Architecture](../../ARCHITECTURE.md) — the repo-level architecture map
|
|
28
|
+
- [Core Beliefs](./core-beliefs.md) — the principles behind Ash's architecture rules
|
|
29
|
+
- [Mechanical Invariants](./mechanical-invariants.md) — detailed constraints that should become lints or structural tests
|
|
30
|
+
- [Unified Context](./context.md) — the unified context system
|
|
31
|
+
- [Compiler and Artifacts](./compiler-and-artifacts.md) — how authored files become `.ash/` artifacts
|
|
32
|
+
- [Discovery](./discovery.md) — how the framework finds authored sources
|
|
33
|
+
- [Message Runtime](./message-runtime.md) — the HTTP surface and runtime execution
|
|
34
|
+
- [Testing](./testing.md) — test tiers and helpers
|
|
@@ -79,7 +79,7 @@ Framework providers use a superset `FrameworkContextProvider` that also receives
|
|
|
79
79
|
|
|
80
80
|
Authored hook lifecycle dispatch (`lifecycle.session`, `lifecycle.turn`)
|
|
81
81
|
runs inside step (4)'s ALS scope, before the harness step. See
|
|
82
|
-
[
|
|
82
|
+
[Hooks](./hooks.md) for the full pipeline and the
|
|
83
83
|
`SessionPreparedKey` flag's failure semantics.
|
|
84
84
|
|
|
85
85
|
## Channel Context
|
|
@@ -7,7 +7,7 @@ hooks answer the runtime.
|
|
|
7
7
|
This page explains the discovery → compile → resolve → dispatch pipeline
|
|
8
8
|
and the runtime contract every authored hook handler relies on. The
|
|
9
9
|
end-user-facing reference lives at
|
|
10
|
-
[
|
|
10
|
+
[Hooks](../public/hooks.md).
|
|
11
11
|
|
|
12
12
|
## Architectural Rationale
|
|
13
13
|
|
|
@@ -196,7 +196,7 @@ documented expectations:
|
|
|
196
196
|
|
|
197
197
|
## Related Pages
|
|
198
198
|
|
|
199
|
-
- [
|
|
200
|
-
- [
|
|
201
|
-
- [
|
|
202
|
-
- [
|
|
199
|
+
- [Hooks](../public/hooks.md) — author-facing reference
|
|
200
|
+
- [Discovery](./discovery.md) — discovery layout and the unified slot walker
|
|
201
|
+
- [Unified Context](./context.md) — `AshContext` surface shared by hooks
|
|
202
|
+
- [Message Runtime](./message-runtime.md) — runtime stream events
|
|
@@ -23,10 +23,10 @@ Follow-up: `POST /ash/v1/session/:sessionId` with `{ "continuationToken": "...",
|
|
|
23
23
|
|
|
24
24
|
`sessionId` is the stream handle. `continuationToken` is the resume handle. They are different contracts.
|
|
25
25
|
|
|
26
|
-
## Overriding The
|
|
26
|
+
## Overriding The Ash Channel
|
|
27
27
|
|
|
28
|
-
The framework ships a default
|
|
29
|
-
create `agent/channels/
|
|
28
|
+
The framework ships a default channel named `"ash"` that implements the routes above. To override it,
|
|
29
|
+
create `agent/channels/ash.ts` — app-author channels take precedence over
|
|
30
30
|
framework defaults by name.
|
|
31
31
|
|
|
32
32
|
## Stream
|
|
@@ -48,7 +48,7 @@ step.completed → turn.completed → session.waiting / session.completed
|
|
|
48
48
|
Failure variants: `step.failed`, `turn.failed`, `session.failed`.
|
|
49
49
|
A thrown `lifecycle.session` hook produces a terminal `session.failed`;
|
|
50
50
|
a thrown `lifecycle.turn` hook produces a recoverable `turn.failed`
|
|
51
|
-
cascade. See [
|
|
51
|
+
cascade. See [Hooks](./hooks.md).
|
|
52
52
|
|
|
53
53
|
`message.appended` and `reasoning.appended` carry both delta and cumulative text. `step.completed.data.finishReason` mirrors the model-step outcome (`tool-calls` means the turn continues).
|
|
54
54
|
|
|
@@ -56,7 +56,7 @@ Delegated subagents use a split stream: parent gets `subagent.called` / `subagen
|
|
|
56
56
|
|
|
57
57
|
## Auth
|
|
58
58
|
|
|
59
|
-
The `AuthFn` passed to `
|
|
59
|
+
The `AuthFn` passed to `ashChannel(...)` is the HTTP auth gate. `auth` is required at route definition time — use `none()` for explicitly anonymous routes. An `AuthFn` returns a session auth context to accept, `null` for 401, or `undefined` for anonymous passthrough.
|
|
60
60
|
|
|
61
61
|
The runtime stores both `auth.current` and `auth.initiator`. Follow-up messages may replace `auth.current` without rewriting the initiator.
|
|
62
62
|
|
|
@@ -64,4 +64,4 @@ The runtime stores both `auth.current` and `auth.initiator`. Follow-up messages
|
|
|
64
64
|
|
|
65
65
|
The runtime owns stream plumbing; the channel owns delivery policy. The runtime calls `channel.onEvent(event)` for each lifecycle event — the channel may transform it or perform platform side effects. The harness emits events without knowing the transport.
|
|
66
66
|
|
|
67
|
-
Authored stream-event hooks fan out alongside `callAdapterEventHandler` from the same `HarnessEmitFn` composer (`workflow-steps.ts` and `continuous-runtime.ts`). Hook errors propagate through the emit composer and are caught by the existing harness error path, which emits the recoverable `turn.failed` cascade. See [
|
|
67
|
+
Authored stream-event hooks fan out alongside `callAdapterEventHandler` from the same `HarnessEmitFn` composer (`workflow-steps.ts` and `continuous-runtime.ts`). Hook errors propagate through the emit composer and are caught by the existing harness error path, which emits the recoverable `turn.failed` cascade. See [Hooks](./hooks.md).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This folder is for app authors using Ash as a framework.
|
|
4
4
|
|
|
5
5
|
If you want to understand how to build agents with Ash, start here. If you want to understand how
|
|
6
|
-
the framework is implemented internally, read [
|
|
6
|
+
the framework is implemented internally, read [Internals](../internals/README.md).
|
|
7
7
|
|
|
8
8
|
Important naming note:
|
|
9
9
|
|
|
@@ -15,26 +15,26 @@ Important naming note:
|
|
|
15
15
|
|
|
16
16
|
Read in this order:
|
|
17
17
|
|
|
18
|
-
1. [
|
|
19
|
-
2. [
|
|
20
|
-
3. [agent
|
|
21
|
-
4. [
|
|
22
|
-
5. [
|
|
23
|
-
6. [
|
|
24
|
-
7. [
|
|
25
|
-
8. [
|
|
26
|
-
9. [
|
|
27
|
-
10. [
|
|
28
|
-
11. [
|
|
29
|
-
12. [
|
|
30
|
-
13. [
|
|
31
|
-
14. [
|
|
32
|
-
15. [
|
|
33
|
-
16. [
|
|
34
|
-
17. [
|
|
35
|
-
18. [
|
|
36
|
-
19. [
|
|
37
|
-
20. [
|
|
18
|
+
1. [Getting Started](./getting-started.md)
|
|
19
|
+
2. [Project Layout](./project-layout.md)
|
|
20
|
+
3. [`agent.ts`](./agent-ts.md)
|
|
21
|
+
4. [TypeScript API](./typescript-api.md)
|
|
22
|
+
5. [Context Control](./context-control.md)
|
|
23
|
+
6. [Skills](./skills.md)
|
|
24
|
+
7. [Tools](./tools.md)
|
|
25
|
+
8. [Connections](./connections.md)
|
|
26
|
+
9. [Workspace](./workspace.md)
|
|
27
|
+
10. [Sandboxes](./sandbox.md)
|
|
28
|
+
11. [Channels](./channels/README.md)
|
|
29
|
+
12. [Human In The Loop](./human-in-the-loop.md)
|
|
30
|
+
13. [Session Context](./session-context.md)
|
|
31
|
+
14. [Sessions And Streaming](./runs-and-streaming.md)
|
|
32
|
+
15. [Subagents](./subagents.md)
|
|
33
|
+
16. [Schedules](./schedules.md)
|
|
34
|
+
17. [Evals](./evals.md)
|
|
35
|
+
18. [Auth And Route Protection](./auth-and-route-protection.md)
|
|
36
|
+
19. [Vercel Deployment](./vercel-deployment.md)
|
|
37
|
+
20. [CLI, Build, And Debugging](./cli-build-and-debugging.md)
|
|
38
38
|
|
|
39
39
|
## The Public Mental Model
|
|
40
40
|
|
|
@@ -88,4 +88,4 @@ That is why Ash exposes two identifiers:
|
|
|
88
88
|
|
|
89
89
|
- Minimal end-to-end example: [`../../apps/weather-agent`](../../apps/weather-agent)
|
|
90
90
|
- Public API source of truth: [`../../packages/ash/src/public/index.ts`](../../packages/ash/src/public/index.ts)
|
|
91
|
-
- Framework internals: [
|
|
91
|
+
- Framework internals: [Internals](../internals/README.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "agent.ts"
|
|
3
|
-
description: "Configure your agent with agent.ts: model,
|
|
3
|
+
description: "Configure your agent with agent.ts: model, metadata, and runtime options."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
`agent.ts` is the additive runtime config entrypoint for an Ash agent.
|
|
@@ -13,7 +13,6 @@ Put instructions in `instructions.md`. Put runtime settings in `agent.ts`.
|
|
|
13
13
|
import { defineAgent } from "experimental-ash";
|
|
14
14
|
|
|
15
15
|
export default defineAgent({
|
|
16
|
-
name: "support-agent",
|
|
17
16
|
model: "openai/gpt-5.4-mini",
|
|
18
17
|
metadata: {
|
|
19
18
|
team: "support",
|
|
@@ -33,7 +32,6 @@ export default defineAgent({
|
|
|
33
32
|
Use `agent.ts` for:
|
|
34
33
|
|
|
35
34
|
- model selection
|
|
36
|
-
- stable agent name
|
|
37
35
|
- metadata you want preserved in runtime traces
|
|
38
36
|
- human-in-the-loop policy
|
|
39
37
|
- hosted-build packaging controls
|
|
@@ -41,7 +39,7 @@ Use `agent.ts` for:
|
|
|
41
39
|
- provider-specific model options
|
|
42
40
|
|
|
43
41
|
For OpenTelemetry configuration, use `instrumentation.ts` instead. See
|
|
44
|
-
[`instrumentation.
|
|
42
|
+
[`instrumentation.ts`](./instrumentation.md).
|
|
45
43
|
|
|
46
44
|
Do not use `agent.ts` for long-form instructions. Put those in `instructions.md` (or `instructions.ts`) and
|
|
47
45
|
`skills/`.
|
|
@@ -94,14 +92,21 @@ export default defineAgent({
|
|
|
94
92
|
});
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
##
|
|
95
|
+
## Agent Identity
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
The agent's name is derived at compile time from the filesystem layout:
|
|
98
|
+
|
|
99
|
+
- A root agent (its `agent.ts` sits at the app root or directly under `agent/`) takes its name
|
|
100
|
+
from the enclosing `package.json`'s `name` field.
|
|
101
|
+
- A nested agent takes its name from its own directory (e.g. `subagents/researcher/agent.ts` →
|
|
102
|
+
`"researcher"`).
|
|
103
|
+
|
|
104
|
+
## `metadata`
|
|
100
105
|
|
|
101
106
|
`metadata` is a simple string map for app-owned labels that should travel with the resolved agent
|
|
102
107
|
definition and related runtime metadata.
|
|
103
108
|
|
|
104
|
-
Use
|
|
109
|
+
Use it for environment labels or ownership metadata. Avoid secrets here.
|
|
105
110
|
|
|
106
111
|
## `build`
|
|
107
112
|
|
|
@@ -123,7 +128,7 @@ server output instead of being bundled.
|
|
|
123
128
|
- `model` optionally overrides the model used for compaction summaries
|
|
124
129
|
|
|
125
130
|
The shared per-run workspace is configured on the sandbox, not on `agent.ts`. See
|
|
126
|
-
[
|
|
131
|
+
[Workspace](./workspace.md) and [Sandboxes](./sandbox.md).
|
|
127
132
|
|
|
128
133
|
## `humanInTheLoop`
|
|
129
134
|
|
|
@@ -147,13 +152,13 @@ Supported fields:
|
|
|
147
152
|
Use `require-approval` when the default should be "ask first". Use `auto-allow` when the default
|
|
148
153
|
should be "run immediately" and only a few named tools should still require approval.
|
|
149
154
|
|
|
150
|
-
See [
|
|
155
|
+
See [Human In The Loop](./human-in-the-loop.md) for the runtime flow, `input.requested`
|
|
151
156
|
events, and HTTP response payloads.
|
|
152
157
|
|
|
153
158
|
## Telemetry
|
|
154
159
|
|
|
155
160
|
OpenTelemetry tracing is configured in `agent/instrumentation.ts`, not in `agent.ts`. See
|
|
156
|
-
[`instrumentation.
|
|
161
|
+
[`instrumentation.ts`](./instrumentation.md) for setup.
|
|
157
162
|
|
|
158
163
|
## Route Auth And Network Policy
|
|
159
164
|
|
|
@@ -161,8 +166,8 @@ OpenTelemetry tracing is configured in `agent/instrumentation.ts`, not in `agent
|
|
|
161
166
|
|
|
162
167
|
Those concerns live on the HTTP channel layer instead. See:
|
|
163
168
|
|
|
164
|
-
- [
|
|
165
|
-
- [
|
|
169
|
+
- [Auth And Route Protection](./auth-and-route-protection.md)
|
|
170
|
+
- [Channels](./channels/README.md)
|
|
166
171
|
|
|
167
172
|
## A Good Default
|
|
168
173
|
|
|
@@ -172,7 +177,6 @@ For many apps, `agent.ts` stays small:
|
|
|
172
177
|
import { defineAgent } from "experimental-ash";
|
|
173
178
|
|
|
174
179
|
export default defineAgent({
|
|
175
|
-
name: "weather-agent",
|
|
176
180
|
model: "openai/gpt-5.4-mini",
|
|
177
181
|
});
|
|
178
182
|
```
|
|
@@ -181,7 +185,7 @@ That is enough to start. Add build and compaction settings only when you need th
|
|
|
181
185
|
|
|
182
186
|
## What To Read Next
|
|
183
187
|
|
|
184
|
-
- [
|
|
185
|
-
- [
|
|
186
|
-
- [
|
|
187
|
-
- [
|
|
188
|
+
- [Context Control](./context-control.md)
|
|
189
|
+
- [Human In The Loop](./human-in-the-loop.md)
|
|
190
|
+
- [Workspace](./workspace.md)
|
|
191
|
+
- [Auth And Route Protection](./auth-and-route-protection.md)
|
|
@@ -17,29 +17,29 @@ These settings apply to:
|
|
|
17
17
|
|
|
18
18
|
## The Main API
|
|
19
19
|
|
|
20
|
-
To override the
|
|
20
|
+
To override the Ash channel's auth, create `agent/channels/ash.ts`:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
|
-
// agent/channels/
|
|
24
|
-
import {
|
|
23
|
+
// agent/channels/ash.ts
|
|
24
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
25
25
|
import { vercelOidc } from "experimental-ash/channels/auth";
|
|
26
26
|
|
|
27
|
-
export default
|
|
27
|
+
export default ashChannel({
|
|
28
28
|
auth: vercelOidc(),
|
|
29
29
|
});
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
The framework ships a default
|
|
33
|
-
`agent/channels/
|
|
32
|
+
The framework ships a default channel named `"ash"` that implements the routes above. Creating
|
|
33
|
+
`agent/channels/ash.ts` overrides it — app-author channels take precedence
|
|
34
34
|
over framework defaults by name.
|
|
35
35
|
|
|
36
36
|
For open routes, use `none()` explicitly:
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
|
-
import {
|
|
39
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
40
40
|
import { none } from "experimental-ash/channels/auth";
|
|
41
41
|
|
|
42
|
-
export default
|
|
42
|
+
export default ashChannel({
|
|
43
43
|
auth: none(),
|
|
44
44
|
});
|
|
45
45
|
```
|
|
@@ -127,10 +127,10 @@ In practice that means:
|
|
|
127
127
|
## Example: Basic Auth Request
|
|
128
128
|
|
|
129
129
|
```ts
|
|
130
|
-
import {
|
|
130
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
131
131
|
import { httpBasic } from "experimental-ash/channels/auth";
|
|
132
132
|
|
|
133
|
-
export default
|
|
133
|
+
export default ashChannel({
|
|
134
134
|
auth: httpBasic({
|
|
135
135
|
username: "ops",
|
|
136
136
|
password: process.env.ROUTE_AUTH_BASIC_PASSWORD,
|
|
@@ -140,6 +140,6 @@ export default httpChannel({
|
|
|
140
140
|
|
|
141
141
|
## What To Read Next
|
|
142
142
|
|
|
143
|
-
- [`agent
|
|
144
|
-
- [
|
|
145
|
-
- [
|
|
143
|
+
- [`agent.ts`](./agent-ts.md)
|
|
144
|
+
- [Session Context](./session-context.md)
|
|
145
|
+
- [Vercel Deployment](./vercel-deployment.md)
|
|
@@ -20,7 +20,7 @@ persistence.
|
|
|
20
20
|
|
|
21
21
|
Ash ships the public HTTP protocol as channels:
|
|
22
22
|
|
|
23
|
-
- `
|
|
23
|
+
- `ashChannel({ auth })` for the built-in Ash protocol channel
|
|
24
24
|
|
|
25
25
|
Ash also supports authored channels under `agent/channels/` for platform-specific integrations such
|
|
26
26
|
as Slack or custom webhooks.
|
|
@@ -86,20 +86,23 @@ helpers. Each route handler receives the raw `Request` and a helpers object:
|
|
|
86
86
|
Event handlers like `"message.completed"` are declared under the `events` key on the config object.
|
|
87
87
|
They receive `(eventData, ctx)` where `ctx` carries platform handles and `ctx.session`.
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## The Ash Channel
|
|
90
90
|
|
|
91
|
-
The framework ships
|
|
91
|
+
The framework ships its canonical session protocol on `experimental-ash/channels/ash`:
|
|
92
92
|
|
|
93
|
-
- `
|
|
93
|
+
- `ashChannel({ auth })`
|
|
94
|
+
|
|
95
|
+
This is the channel the Ash dev client and any deployed-agent SDK talk to — it mounts the routes
|
|
96
|
+
under `/ash/v1/session*` documented in [Ash External Agent Protocol](../../external-agent-protocol.md).
|
|
94
97
|
|
|
95
98
|
It requires an auth function. Use `experimental-ash/channels/auth` for the common helpers such as
|
|
96
99
|
`vercelOidc()`, `httpBasic()`, and `none()`.
|
|
97
100
|
|
|
98
101
|
```ts
|
|
99
|
-
import {
|
|
102
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
100
103
|
import { vercelOidc } from "experimental-ash/channels/auth";
|
|
101
104
|
|
|
102
|
-
export default
|
|
105
|
+
export default ashChannel({
|
|
103
106
|
auth: vercelOidc(),
|
|
104
107
|
});
|
|
105
108
|
```
|
|
@@ -205,7 +208,7 @@ Each compiles down to the one below it:
|
|
|
205
208
|
- `slackChannel(config)` -> `defineChannel` + Chat SDK setup + typed event dispatch
|
|
206
209
|
- `defineChannel` -> the primitive
|
|
207
210
|
|
|
208
|
-
For a Slack app backed by Vercel Connex, see [
|
|
211
|
+
For a Slack app backed by Vercel Connex, see [Slack channel setup](./slack.md) to create the Connex client
|
|
209
212
|
and channel file.
|
|
210
213
|
|
|
211
214
|
## File Uploads
|
|
@@ -248,9 +251,9 @@ at send time.
|
|
|
248
251
|
|
|
249
252
|
## What To Read Next
|
|
250
253
|
|
|
251
|
-
- [
|
|
252
|
-
- [
|
|
253
|
-
- [
|
|
254
|
-
- [
|
|
255
|
-
- [
|
|
256
|
-
- [
|
|
254
|
+
- [Slack channel setup](./slack.md)
|
|
255
|
+
- [Channel attachments](./attachments.md)
|
|
256
|
+
- [Project Layout](../project-layout.md)
|
|
257
|
+
- [TypeScript API](../typescript-api.md)
|
|
258
|
+
- [Auth And Route Protection](../auth-and-route-protection.md)
|
|
259
|
+
- [Ash External Agent Protocol](../../external-agent-protocol.md)
|
|
@@ -80,6 +80,6 @@ When something is wrong:
|
|
|
80
80
|
|
|
81
81
|
## What To Read Next
|
|
82
82
|
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
83
|
+
- [Project Layout](./project-layout.md)
|
|
84
|
+
- [Sessions And Streaming](./runs-and-streaming.md)
|
|
85
|
+
- [TypeScript API](./typescript-api.md)
|
|
@@ -124,7 +124,7 @@ when it needs a different cache and principal model:
|
|
|
124
124
|
(status pages, shared dashboards, system bots).
|
|
125
125
|
|
|
126
126
|
Ash resolves the active principal before every authorization call. See
|
|
127
|
-
[
|
|
127
|
+
[Session Context](./session-context.md) for how the principal flows through the runtime.
|
|
128
128
|
|
|
129
129
|
## Headers
|
|
130
130
|
|
|
@@ -157,7 +157,7 @@ export default defineMcpClientConnection({
|
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
`never()` allows all calls, `once()` requires approval the first time per session, `always()`
|
|
160
|
-
requires approval every time. See [
|
|
160
|
+
requires approval every time. See [Human In The Loop](./human-in-the-loop.md) for the approval
|
|
161
161
|
runtime.
|
|
162
162
|
|
|
163
163
|
## Tool Filters
|
|
@@ -177,6 +177,6 @@ Tools that don't pass the filter are silently excluded from `connection_search`.
|
|
|
177
177
|
|
|
178
178
|
## What To Read Next
|
|
179
179
|
|
|
180
|
-
- [
|
|
181
|
-
- [
|
|
182
|
-
- [
|
|
180
|
+
- [Tools](./tools.md) — authored tools live alongside connection-provided tools.
|
|
181
|
+
- [Human In The Loop](./human-in-the-loop.md) — interactive consent and approval runtime.
|
|
182
|
+
- [Session Context](./session-context.md) — how the active principal flows through the runtime.
|
|
@@ -88,7 +88,7 @@ prompt.
|
|
|
88
88
|
- flat markdown skills may omit frontmatter
|
|
89
89
|
- tools stay visible whether or not a skill is activated
|
|
90
90
|
|
|
91
|
-
See [
|
|
91
|
+
See [Skills](./skills.md) for the full authoring model and install notes.
|
|
92
92
|
|
|
93
93
|
## 4. Put Runtime Files In The Workspace, Not The Prompt
|
|
94
94
|
|
|
@@ -102,7 +102,7 @@ Today that mainly means:
|
|
|
102
102
|
- skill files are available under the active runtime workspace root
|
|
103
103
|
- the model can inspect them with the shared `bash` tool
|
|
104
104
|
|
|
105
|
-
See [
|
|
105
|
+
See [Workspace](./workspace.md) and [Sandboxes](./sandbox.md).
|
|
106
106
|
|
|
107
107
|
## 5. Delegate To A Specialist With A Subagent
|
|
108
108
|
|
|
@@ -115,7 +115,7 @@ Subagents are a context-control tool too:
|
|
|
115
115
|
- they can have their own tools and their own sandbox
|
|
116
116
|
- they run inside their own delegated subagent context instead of extending the root agent inline
|
|
117
117
|
|
|
118
|
-
See [
|
|
118
|
+
See [Subagents](./subagents.md).
|
|
119
119
|
|
|
120
120
|
## Choosing The Right Lever
|
|
121
121
|
|
|
@@ -139,8 +139,8 @@ For most agents:
|
|
|
139
139
|
|
|
140
140
|
## What To Read Next
|
|
141
141
|
|
|
142
|
-
- [
|
|
143
|
-
- [
|
|
144
|
-
- [
|
|
145
|
-
- [
|
|
146
|
-
- [
|
|
142
|
+
- [Tools](./tools.md)
|
|
143
|
+
- [Hooks](./hooks.md)
|
|
144
|
+
- [Skills](./skills.md)
|
|
145
|
+
- [Workspace](./workspace.md)
|
|
146
|
+
- [Subagents](./subagents.md)
|
|
@@ -287,6 +287,6 @@ For most apps:
|
|
|
287
287
|
|
|
288
288
|
## What To Read Next
|
|
289
289
|
|
|
290
|
-
- [
|
|
291
|
-
- [
|
|
292
|
-
- [
|
|
290
|
+
- [TypeScript API](./typescript-api.md)
|
|
291
|
+
- [Tools](./tools.md)
|
|
292
|
+
- [Sessions And Streaming](./runs-and-streaming.md)
|
|
@@ -157,8 +157,8 @@ curl -X POST http://127.0.0.1:3000/ash/v1/session/<sessionId> \
|
|
|
157
157
|
|
|
158
158
|
## What To Read Next
|
|
159
159
|
|
|
160
|
-
- [
|
|
161
|
-
- [`agent
|
|
162
|
-
- [
|
|
163
|
-
- [
|
|
164
|
-
- [
|
|
160
|
+
- [Project Layout](./project-layout.md) for every supported authored slot
|
|
161
|
+
- [`agent.ts`](./agent-ts.md) for runtime config
|
|
162
|
+
- [Skills](./skills.md) for on-demand procedures
|
|
163
|
+
- [Tools](./tools.md) for typed integrations
|
|
164
|
+
- [Sessions And Streaming](./runs-and-streaming.md) for the durable session model
|
|
@@ -230,7 +230,7 @@ when both are registered.
|
|
|
230
230
|
|
|
231
231
|
## What to read next
|
|
232
232
|
|
|
233
|
-
- [
|
|
234
|
-
- [
|
|
235
|
-
- [
|
|
236
|
-
- [
|
|
233
|
+
- [Tools](./tools.md)
|
|
234
|
+
- [Context Control](./context-control.md)
|
|
235
|
+
- [Sessions And Streaming](./runs-and-streaming.md)
|
|
236
|
+
- [Session Context](./session-context.md)
|
|
@@ -249,6 +249,6 @@ If you press `Escape` and then send a normal message, the pending requests are i
|
|
|
249
249
|
|
|
250
250
|
## What To Read Next
|
|
251
251
|
|
|
252
|
-
- [`agent
|
|
253
|
-
- [
|
|
254
|
-
- [
|
|
252
|
+
- [`agent.ts`](./agent-ts.md)
|
|
253
|
+
- [Tools](./tools.md)
|
|
254
|
+
- [Sessions And Streaming](./runs-and-streaming.md)
|
|
@@ -36,7 +36,8 @@ telemetry -- there is no separate `isEnabled` toggle.
|
|
|
36
36
|
|
|
37
37
|
The `setup` callback is invoked by the framework at server startup with the resolved agent name. Use
|
|
38
38
|
it to register your OTel provider (e.g. `registerOTel` from `@vercel/otel`). The
|
|
39
|
-
`context.agentName`
|
|
39
|
+
`context.agentName` is derived from the agent's filesystem path at compile time, so you never need
|
|
40
|
+
to hard-code a service name.
|
|
40
41
|
|
|
41
42
|
Any OTel-compatible backend works (Braintrust, Honeycomb, Datadog, Jaeger). Install the exporter
|
|
42
43
|
package you need and configure it in the callback.
|
|
@@ -73,5 +74,5 @@ calls and tool executions are traced automatically. Session context (`ash.versio
|
|
|
73
74
|
|
|
74
75
|
## What To Read Next
|
|
75
76
|
|
|
76
|
-
- [`agent
|
|
77
|
-
- [
|
|
77
|
+
- [`agent.ts`](./agent-ts.md)
|
|
78
|
+
- [Project Layout](./project-layout.md)
|
|
@@ -34,11 +34,11 @@ my-agent/
|
|
|
34
34
|
| Path | Purpose | Notes |
|
|
35
35
|
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
36
36
|
| `instructions.md` or `instructions.ts` | Base instructions prompt | Exactly one instructions prompt is expected. Module-backed sources execute once at build time; the resulting markdown is baked into the compiled manifest. The legacy `system.{md,ts,...}` slot is still discovered with a deprecation warning. |
|
|
37
|
-
| `agent.ts` | Runtime config | Model,
|
|
37
|
+
| `agent.ts` | Runtime config | Model, metadata, workspace, build, compaction |
|
|
38
38
|
| `instrumentation.ts` | Telemetry config | OTel exporter setup and AI SDK span settings; auto-discovered and run before agent code |
|
|
39
39
|
| `channels/` | HTTP or messaging entrypoints | Root-only today |
|
|
40
40
|
| `connections/` | External service connections (MCP) | Each file defines one connection; name derived from filename |
|
|
41
|
-
| `hooks/` | Lifecycle and stream-event subscribers | Module-backed only. Recursive directories supported. See [
|
|
41
|
+
| `hooks/` | Lifecycle and stream-event subscribers | Module-backed only. Recursive directories supported. See [Hooks](./hooks.md). |
|
|
42
42
|
| `skills/` | On-demand procedures and capability packs | Flat markdown, module-backed skills, or packaged skills |
|
|
43
43
|
| `lib/` | Shared authored helper code | Import-only source, not mounted into the workspace |
|
|
44
44
|
| `sandbox/` or `sandbox.ts` | The agent's single sandbox. Use top-level `sandbox.ts` for a definition-only override; use `sandbox/sandbox.ts` + optional `sandbox/workspace/**` when you also want seeded files. Framework default applies when neither is authored. | Supported on the root agent and local subagents |
|
|
@@ -135,7 +135,7 @@ the sandbox workspace today:
|
|
|
135
135
|
- skill files under `skills/` are seeded into `/workspace/skills/...`
|
|
136
136
|
- files under `agent/sandbox/workspace/` are mirrored into `/workspace/...` at session bootstrap
|
|
137
137
|
|
|
138
|
-
See [
|
|
138
|
+
See [Sandboxes](./sandbox.md#seeding-workspace-files) for the convention.
|
|
139
139
|
|
|
140
140
|
Important boundary:
|
|
141
141
|
|
|
@@ -155,15 +155,15 @@ Use:
|
|
|
155
155
|
- `channels/` for HTTP or messaging ingress and delivery
|
|
156
156
|
- `lib/` for shared helper modules imported by the slots above
|
|
157
157
|
|
|
158
|
-
See [
|
|
158
|
+
See [Connections](./connections.md) for the connection authorization shape, including the
|
|
159
159
|
`@vercel/connex/ash` helper for OAuth-backed connections.
|
|
160
160
|
|
|
161
161
|
## What To Read Next
|
|
162
162
|
|
|
163
|
-
- [`agent
|
|
164
|
-
- [
|
|
165
|
-
- [
|
|
166
|
-
- [
|
|
167
|
-
- [
|
|
168
|
-
- [
|
|
169
|
-
- [
|
|
163
|
+
- [`agent.ts`](./agent-ts.md)
|
|
164
|
+
- [Context Control](./context-control.md)
|
|
165
|
+
- [Connections](./connections.md)
|
|
166
|
+
- [Hooks](./hooks.md)
|
|
167
|
+
- [Skills](./skills.md)
|
|
168
|
+
- [Tools](./tools.md)
|
|
169
|
+
- [Channels](./channels/README.md)
|
|
@@ -108,6 +108,6 @@ Important behavior:
|
|
|
108
108
|
|
|
109
109
|
## What To Read Next
|
|
110
110
|
|
|
111
|
-
- [
|
|
112
|
-
- [
|
|
113
|
-
- [
|
|
111
|
+
- [Session Context](./session-context.md)
|
|
112
|
+
- [Subagents](./subagents.md)
|
|
113
|
+
- [Schedules](./schedules.md)
|
|
@@ -375,6 +375,6 @@ Important behavior:
|
|
|
375
375
|
|
|
376
376
|
## What To Read Next
|
|
377
377
|
|
|
378
|
-
- [
|
|
379
|
-
- [
|
|
380
|
-
- [
|
|
378
|
+
- [Tools](./tools.md)
|
|
379
|
+
- [Workspace](./workspace.md)
|
|
380
|
+
- [Session Context](./session-context.md)
|