experimental-ash 0.55.3 → 0.57.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/CHANGELOG.md +30 -0
- package/LICENSE +202 -0
- package/dist/docs/internals/compiler-and-artifacts.md +1 -1
- package/dist/docs/internals/context.md +3 -3
- package/dist/docs/public/advanced/typescript-api.md +19 -0
- package/dist/docs/public/advanced/vercel-deployment.md +2 -1
- package/dist/docs/public/channels/github.md +145 -0
- package/dist/docs/public/channels/index.md +23 -2
- package/dist/docs/public/meta.json +1 -0
- package/dist/docs/public/onboarding.md +7 -5
- package/dist/docs/public/sandbox.md +18 -3
- package/dist/docs/public/subagents.mdx +7 -2
- package/dist/docs/public/tools.mdx +10 -2
- package/dist/skills/agent/SKILL.md +169 -0
- package/dist/skills/agent/references/deployment.md +35 -0
- package/dist/skills/agent/references/getting-started.md +58 -0
- package/dist/skills/agent/references/project-layout.md +35 -0
- package/dist/skills/agent/references/runtime-model.md +24 -0
- package/dist/skills/agent/references/skills.md +26 -0
- package/dist/skills/agent/scripts/add-to-existing-project.sh +12 -0
- package/dist/skills/agent/scripts/bootstrap-from-npm.sh +9 -0
- package/dist/skills/agent/scripts/verify-local-agent.sh +16 -0
- package/dist/skills/ash-add-agent/SKILL.md +166 -0
- package/dist/skills/ash-add-next/SKILL.md +137 -0
- package/dist/skills/framework/SKILL.md +93 -0
- package/dist/skills/framework/references/architecture.md +14 -0
- package/dist/skills/framework/references/discovery-and-compilation.md +15 -0
- package/dist/skills/framework/references/quality-gates.md +13 -0
- package/dist/skills/framework/references/runtime-model.md +12 -0
- package/dist/skills/framework/references/workspace-and-sandbox.md +25 -0
- package/dist/skills/framework/scripts/framework-review-checklist.sh +13 -0
- package/dist/skills/framework/scripts/run-framework-gates.sh +8 -0
- package/dist/src/client/output-schema.js +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +2 -0
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/manifest.d.ts +10 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +1 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/harness/code-mode.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +1 -0
- package/dist/src/harness/provider-tools.d.ts +7 -1
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.d.ts +2 -0
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +2 -1
- package/dist/src/internal/authored-definition/sandbox.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/packages/ash-scaffold/src/channels.js +2 -2
- package/dist/src/packages/ash-scaffold/src/steps/run-add-to-agent.js +1 -1
- package/dist/src/packages/ash-scaffold/src/web-template.js +2 -2
- package/dist/src/public/channels/github/api.d.ts +166 -0
- package/dist/src/public/channels/github/api.js +1 -0
- package/dist/src/public/channels/github/auth.d.ts +83 -0
- package/dist/src/public/channels/github/auth.js +2 -0
- package/dist/src/public/channels/github/binding.d.ts +49 -0
- package/dist/src/public/channels/github/binding.js +1 -0
- package/dist/src/public/channels/github/checkout.d.ts +48 -0
- package/dist/src/public/channels/github/checkout.js +1 -0
- package/dist/src/public/channels/github/constants.d.ts +2 -0
- package/dist/src/public/channels/github/constants.js +1 -0
- package/dist/src/public/channels/github/defaults.d.ts +21 -0
- package/dist/src/public/channels/github/defaults.js +3 -0
- package/dist/src/public/channels/github/dispatch.d.ts +34 -0
- package/dist/src/public/channels/github/dispatch.js +1 -0
- package/dist/src/public/channels/github/githubChannel.d.ts +109 -0
- package/dist/src/public/channels/github/githubChannel.js +1 -0
- package/dist/src/public/channels/github/inbound.d.ts +183 -0
- package/dist/src/public/channels/github/inbound.js +2 -0
- package/dist/src/public/channels/github/index.d.ts +9 -0
- package/dist/src/public/channels/github/index.js +1 -0
- package/dist/src/public/channels/github/limits.d.ts +4 -0
- package/dist/src/public/channels/github/limits.js +2 -0
- package/dist/src/public/channels/github/pr-context.d.ts +45 -0
- package/dist/src/public/channels/github/pr-context.js +5 -0
- package/dist/src/public/channels/github/state.d.ts +48 -0
- package/dist/src/public/channels/github/state.js +1 -0
- package/dist/src/public/channels/github/verify.d.ts +35 -0
- package/dist/src/public/channels/github/verify.js +1 -0
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +3 -3
- package/dist/src/public/definitions/tool.d.ts +21 -1
- package/dist/src/public/sandbox/index.d.ts +1 -1
- package/dist/src/public/tools/define-bash-tool.js +1 -1
- package/dist/src/public/tools/define-glob-tool.js +1 -1
- package/dist/src/public/tools/define-grep-tool.js +1 -1
- package/dist/src/public/tools/define-read-file-tool.js +1 -1
- package/dist/src/public/tools/define-write-file-tool.js +1 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +8 -0
- package/dist/src/runtime/connections/authorization-tokens.js +1 -1
- package/dist/src/runtime/connections/mcp-client.d.ts +14 -0
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/types.d.ts +1 -0
- package/dist/src/runtime/framework-tools/ask-question.d.ts +4 -0
- package/dist/src/runtime/framework-tools/ask-question.js +1 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +5 -0
- package/dist/src/runtime/framework-tools/bash.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +1 -0
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
- package/dist/src/runtime/framework-tools/final-output.js +1 -1
- package/dist/src/runtime/framework-tools/glob.d.ts +5 -0
- package/dist/src/runtime/framework-tools/glob.js +2 -2
- package/dist/src/runtime/framework-tools/grep.d.ts +5 -0
- package/dist/src/runtime/framework-tools/grep.js +2 -2
- package/dist/src/runtime/framework-tools/read-file.d.ts +5 -0
- package/dist/src/runtime/framework-tools/read-file.js +2 -2
- package/dist/src/runtime/framework-tools/skill.d.ts +2 -0
- package/dist/src/runtime/framework-tools/skill.js +1 -1
- package/dist/src/runtime/framework-tools/todo.d.ts +2 -0
- package/dist/src/runtime/framework-tools/todo.js +2 -2
- package/dist/src/runtime/framework-tools/web-fetch.d.ts +3 -0
- package/dist/src/runtime/framework-tools/web-fetch.js +2 -2
- package/dist/src/runtime/framework-tools/web-search.d.ts +17 -0
- package/dist/src/runtime/framework-tools/web-search.js +1 -1
- package/dist/src/runtime/framework-tools/write-file.d.ts +5 -0
- package/dist/src/runtime/framework-tools/write-file.js +2 -2
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/template-plan.d.ts +5 -0
- package/dist/src/runtime/sandbox/template-plan.js +1 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -2
- package/dist/src/shared/dynamic-tool-definition.d.ts +2 -1
- package/dist/src/shared/json-schema.d.ts +3 -1
- package/dist/src/shared/json-schema.js +1 -1
- package/dist/src/shared/sandbox-definition.d.ts +22 -2
- package/dist/src/shared/tool-definition.d.ts +10 -2
- package/package.json +25 -1
|
@@ -64,7 +64,11 @@ The AI SDK uses `inputSchema` to validate and transform model input (including Z
|
|
|
64
64
|
Ash accepts Zod, any Standard Schema, or a plain JSON Schema object. Zod and Standard Schema
|
|
65
65
|
definitions infer the `execute(input, ctx)` input type. Plain JSON Schema is accepted at runtime, but
|
|
66
66
|
TypeScript treats `input` as `Record<string, unknown>` because the schema does not carry a static
|
|
67
|
-
|
|
67
|
+
input type.
|
|
68
|
+
|
|
69
|
+
Add `outputSchema` when the tool returns structured data. It is optional, but code mode uses it to
|
|
70
|
+
type host-tool return values inside generated code. Zod and Standard Schema output schemas also type
|
|
71
|
+
the value returned from `execute`.
|
|
68
72
|
|
|
69
73
|
`agent/tools/lookup_customer.ts`
|
|
70
74
|
|
|
@@ -77,8 +81,12 @@ export default defineTool({
|
|
|
77
81
|
inputSchema: z.object({
|
|
78
82
|
customerId: z.string(),
|
|
79
83
|
}),
|
|
84
|
+
outputSchema: z.object({
|
|
85
|
+
customerId: z.string(),
|
|
86
|
+
status: z.enum(["active", "inactive"]),
|
|
87
|
+
}),
|
|
80
88
|
async execute(input) {
|
|
81
|
-
return { customerId: input.customerId };
|
|
89
|
+
return { customerId: input.customerId, status: "active" };
|
|
82
90
|
},
|
|
83
91
|
});
|
|
84
92
|
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ash-agent
|
|
3
|
+
description: Public Ash guide for app authors. Use when building Ash apps, writing user-facing docs/examples, explaining project layout, or helping someone deploy and operate an Ash project. Prefer authored-file guidance, minimal examples, and end-user implementation details.
|
|
4
|
+
metadata:
|
|
5
|
+
author: Ash repo
|
|
6
|
+
version: "0.0.1"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Use this skill for end-user Ash work.
|
|
10
|
+
|
|
11
|
+
## When to use this skill
|
|
12
|
+
|
|
13
|
+
Use this skill when the task is about how an app author uses Ash, including:
|
|
14
|
+
|
|
15
|
+
- building an Ash app
|
|
16
|
+
- writing or updating public docs and examples
|
|
17
|
+
- explaining agent layout and authoring slots
|
|
18
|
+
- teaching how skills, tools, the sandbox, channels, or subagents fit together
|
|
19
|
+
- showing how to install Ash from npm and get started locally
|
|
20
|
+
- helping someone deploy or operate an Ash app
|
|
21
|
+
|
|
22
|
+
If the task is mainly about Ash internals, compiler behavior, runtime plumbing, or implementation
|
|
23
|
+
constraints, load the `ash-framework` skill instead.
|
|
24
|
+
|
|
25
|
+
## How to use this skill
|
|
26
|
+
|
|
27
|
+
1. Start from the app author's point of view.
|
|
28
|
+
2. Read the bundled references before relying on memory.
|
|
29
|
+
3. Use the scripts in `scripts/` when they match the user's goal.
|
|
30
|
+
4. Keep guidance task-oriented, concrete, and minimal.
|
|
31
|
+
|
|
32
|
+
## Writing or updating public docs
|
|
33
|
+
|
|
34
|
+
The docs website at `apps/docs` renders two directories directly:
|
|
35
|
+
|
|
36
|
+
- `/docs/public` — polished public docs, manually ordered via
|
|
37
|
+
`/docs/public/meta.json`.
|
|
38
|
+
- `/research/active` — active design notes, mounted under `/docs/research`
|
|
39
|
+
and listed alphabetically with no meta.json.
|
|
40
|
+
|
|
41
|
+
Every markdown file in either directory that should render on the site
|
|
42
|
+
**must** have this shape:
|
|
43
|
+
|
|
44
|
+
```md
|
|
45
|
+
---
|
|
46
|
+
title: "Short page title"
|
|
47
|
+
description: "One-sentence summary of the page."
|
|
48
|
+
url: /custom/site/path # optional, /docs/public only; only if filename ≠ site URL
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
Body starts here. Do NOT repeat the title as an `# H1` in the body — the
|
|
52
|
+
site renders the frontmatter `title` as the page heading.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
After creating a new `/docs/public` page:
|
|
56
|
+
|
|
57
|
+
- Add its slug to `/docs/public/meta.json#pages` in the section that matches
|
|
58
|
+
its topic. The slug is the filename without the `.md` extension for root
|
|
59
|
+
files, or the folder name for subfolder groups. The trailing `"..."` token
|
|
60
|
+
auto-includes anything missing but gets placed at the bottom — put new
|
|
61
|
+
pages in the intended position explicitly.
|
|
62
|
+
|
|
63
|
+
New `/research/active` files need no meta.json work — the Research section
|
|
64
|
+
sorts alphabetically.
|
|
65
|
+
|
|
66
|
+
Files intentionally excluded from the site (the top-level `README.md` in
|
|
67
|
+
each directory, etc.) should have no frontmatter and be listed in the
|
|
68
|
+
EXCLUDES set of `scripts/check-docs.mjs`. `pnpm docs:check` validates every
|
|
69
|
+
other file in both directories.
|
|
70
|
+
|
|
71
|
+
## What Ash is
|
|
72
|
+
|
|
73
|
+
Ash is a filesystem-first framework for durable backend agents.
|
|
74
|
+
Authors define agents on disk with files like `instructions.md`, `skills/`, `tools/`, `sandbox/`,
|
|
75
|
+
`channels/`, `subagents/`, `schedules/`, and `agent.ts`.
|
|
76
|
+
|
|
77
|
+
## Core behavior to reinforce
|
|
78
|
+
|
|
79
|
+
- `instructions.md` is the always-on instructions prompt.
|
|
80
|
+
- `skills/` are on-demand procedures loaded only when relevant.
|
|
81
|
+
- `tools/` are typed executable integrations.
|
|
82
|
+
- each agent has exactly one sandbox; the workspace is the filesystem inside it.
|
|
83
|
+
- `sandbox/sandbox.ts` overrides the sandbox definition and `sandbox/workspace/` seeds files; both
|
|
84
|
+
are optional and the framework supplies a default.
|
|
85
|
+
- `channels/` are authored messaging-platform entrypoints and can seed durable context in
|
|
86
|
+
`onDeliver()`.
|
|
87
|
+
- `getSession()`, `getSandbox()`, and `getSkill()` are public authored runtime helpers.
|
|
88
|
+
- `getContext()`, `requireContext()`, `hasContext()`, `setContext()`, and `ensureContext()` are the
|
|
89
|
+
public unified context helpers.
|
|
90
|
+
- channel classes can declare `static readonly contextProviders = [...]` to derive live step-local
|
|
91
|
+
values from durable context.
|
|
92
|
+
- `SlackChannel` subclasses can override `handleInteraction(ctx, interaction)` for no-wake Slack UI
|
|
93
|
+
actions, use `getSlackThread()` for thread reads/posts, and call `editMessage(messageTs, renderable)`
|
|
94
|
+
to update Slack messages inline.
|
|
95
|
+
- `subagents/` are specialist child agents with separate runs.
|
|
96
|
+
- `schedules/` are recurring triggers.
|
|
97
|
+
- `agent.ts` is where model, name, metadata, build, compaction, and workspace preferences live.
|
|
98
|
+
- route auth and IP policy live on the HTTP channel layer, not in `agent.ts`.
|
|
99
|
+
|
|
100
|
+
## Preferred workflow
|
|
101
|
+
|
|
102
|
+
Read these bundled references in roughly this order:
|
|
103
|
+
|
|
104
|
+
1. `references/getting-started.md`
|
|
105
|
+
2. `references/project-layout.md`
|
|
106
|
+
3. `references/skills.md`
|
|
107
|
+
4. `references/runtime-model.md`
|
|
108
|
+
5. `references/deployment.md`
|
|
109
|
+
|
|
110
|
+
## How to explain Ash well
|
|
111
|
+
|
|
112
|
+
- lead with how to use Ash, not how Ash is implemented
|
|
113
|
+
- start with the authored filesystem shape and the smallest working path
|
|
114
|
+
- explain when to use each authored slot and show the file path where it lives
|
|
115
|
+
- use one minimal example before edge cases
|
|
116
|
+
- explain that skills are discovered first and loaded through the framework-owned `load_skill` tool
|
|
117
|
+
- explain current boundaries such as root-only `schedules/` when relevant
|
|
118
|
+
- mention the package name is `experimental-ash` while the framework and CLI are called Ash and `ash`
|
|
119
|
+
- note that route auth lives on channels and that `agent.ts` no longer owns it
|
|
120
|
+
- for Slack or custom channel examples, explain the two-step context pattern: `onDeliver()` writes
|
|
121
|
+
durable keys, then `static readonly contextProviders = [...]` rebuilds live per-step values
|
|
122
|
+
- for Slack UI interactions, explain that `handleInteraction(ctx, interaction)` is the subclass hook
|
|
123
|
+
for no-wake `block_actions`, `editMessage(messageTs, renderable)` edits messages inline,
|
|
124
|
+
`getSlackThread()` exposes thread reads/posts, and `SlackRenderable` is the authored output format
|
|
125
|
+
- point people to packaged references instead of assuming repo docs are available
|
|
126
|
+
|
|
127
|
+
Prefer feature-first framing like:
|
|
128
|
+
|
|
129
|
+
- "Use a tool when you need typed executable logic."
|
|
130
|
+
- "Use a sandbox when the model needs an isolated shell environment."
|
|
131
|
+
- "Use a skill when you want optional procedure guidance without bloating every turn."
|
|
132
|
+
|
|
133
|
+
Avoid starting with compiler, discovery, runtime, or harness internals unless the task truly requires them.
|
|
134
|
+
|
|
135
|
+
## Bundled scripts
|
|
136
|
+
|
|
137
|
+
Use these packaged scripts when helpful:
|
|
138
|
+
|
|
139
|
+
- `scripts/bootstrap-from-npm.sh` - scaffold a new Ash app from npm
|
|
140
|
+
- `scripts/add-to-existing-project.sh` - add Ash to an existing app
|
|
141
|
+
- `scripts/verify-local-agent.sh` - reminder of the common local verification commands
|
|
142
|
+
|
|
143
|
+
## Build, dev, and deployment expectations
|
|
144
|
+
|
|
145
|
+
- `ash info` validates the authored surface and inspects the resolved app contract.
|
|
146
|
+
- `ash build` compiles artifacts and builds the runtime host output.
|
|
147
|
+
- `ash dev` runs the local host and interactive REPL.
|
|
148
|
+
- stable runtime routes include `GET /.well-known/ash/v1/health`, `POST /.well-known/ash/v1/message`, and `GET /.well-known/ash/v1/runs/:runId/stream`
|
|
149
|
+
- channel webhooks follow `POST /.well-known/ash/v1/channels/<channelId>/webhook` when channels are configured
|
|
150
|
+
- recommend local development first, then Vercel deployment when shared durable hosting matters
|
|
151
|
+
|
|
152
|
+
## Supporting skills
|
|
153
|
+
|
|
154
|
+
When public Ash work touches adjacent systems, also load the relevant specialist skills:
|
|
155
|
+
|
|
156
|
+
- `ash-framework` for compiler, runtime, discovery, or artifact internals
|
|
157
|
+
- `ai-sdk` for AI SDK APIs, tool calling, and provider integration details
|
|
158
|
+
- `workflow` for durable orchestration behavior and step-boundary decisions
|
|
159
|
+
|
|
160
|
+
For deployment-heavy tasks, it can also help to install Vercel-maintained skills with `npx skills`
|
|
161
|
+
so the agent can pull in current deployment guidance.
|
|
162
|
+
|
|
163
|
+
## Completion checklist
|
|
164
|
+
|
|
165
|
+
- keep the answer user-facing and task-oriented
|
|
166
|
+
- if public behavior changes, update public docs too
|
|
167
|
+
- prefer packaged references and scripts over repo-only links
|
|
168
|
+
- run the expected quality gates before considering the work done
|
|
169
|
+
- ensure public API changes are documented and covered by tests
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Deployment Reference
|
|
2
|
+
|
|
3
|
+
Recommended posture:
|
|
4
|
+
|
|
5
|
+
1. develop locally
|
|
6
|
+
2. validate with build and checks
|
|
7
|
+
3. deploy to Vercel when you need shared durable hosting
|
|
8
|
+
|
|
9
|
+
## Common deployment flow
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
vercel login
|
|
13
|
+
vercel link
|
|
14
|
+
pnpm build
|
|
15
|
+
vercel
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Production deploy:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
vercel --prod
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Verify a deployment
|
|
25
|
+
|
|
26
|
+
- health route responds
|
|
27
|
+
- message route returns a `runId`
|
|
28
|
+
- run stream returns NDJSON lifecycle events
|
|
29
|
+
- any configured channel auth still succeeds in production
|
|
30
|
+
|
|
31
|
+
## Optional remote REPL
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ash dev https://<deployment-url>
|
|
35
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Getting Started Reference
|
|
2
|
+
|
|
3
|
+
Ash is a filesystem-first framework for durable backend agents.
|
|
4
|
+
|
|
5
|
+
## Install from npm
|
|
6
|
+
|
|
7
|
+
The framework is called Ash, the published npm package is `experimental-ash`,
|
|
8
|
+
and the scaffolder package is `create-experimental-ash-agent`.
|
|
9
|
+
|
|
10
|
+
Guided setup for a human (the wizard asks for each decision):
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm create experimental-ash-agent -i
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
When an AI agent sets Ash up on the user's behalf, the create flow is **headless
|
|
17
|
+
by default** — it takes flags (at minimum `<name>` and `--model`) and bails with
|
|
18
|
+
`--help` rather than prompting. Don't improvise it: follow the executable
|
|
19
|
+
**Onboarding** skill, which encodes model, channels (web/Slack), provisioning,
|
|
20
|
+
deploy, and the browser/OAuth handoffs:
|
|
21
|
+
|
|
22
|
+
- repo: `docs/public/onboarding.md`
|
|
23
|
+
- Markdown: https://ash.labs.vercel.dev/llms.mdx/onboarding
|
|
24
|
+
|
|
25
|
+
Slack is not a headless create channel. Scaffold/provision headlessly with
|
|
26
|
+
`--channels web`, then add Slack from the project directory with the interactive
|
|
27
|
+
channel setup:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ash channels add slack
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That setup uses Vercel Connect under the hood:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
vercel connect create slack --triggers --name <name>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add Ash to an existing app instead:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm add -D experimental-ash
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Smallest working path
|
|
46
|
+
|
|
47
|
+
1. scaffold or create a project
|
|
48
|
+
2. add `agent/instructions.md`
|
|
49
|
+
3. add `agent/agent.ts`
|
|
50
|
+
4. add one tool if runtime behavior is needed
|
|
51
|
+
5. run `pnpm dev`
|
|
52
|
+
|
|
53
|
+
## Important naming note
|
|
54
|
+
|
|
55
|
+
- framework name: Ash
|
|
56
|
+
- npm package name: `experimental-ash`
|
|
57
|
+
- scaffolder package: `create-experimental-ash-agent`
|
|
58
|
+
- CLI name: `ash`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Project Layout Reference
|
|
2
|
+
|
|
3
|
+
Recommended layout:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
my-agent/
|
|
7
|
+
├── package.json
|
|
8
|
+
├── tsconfig.json
|
|
9
|
+
└── agent/
|
|
10
|
+
├── agent.ts
|
|
11
|
+
├── instructions.md
|
|
12
|
+
├── skills/
|
|
13
|
+
├── lib/
|
|
14
|
+
├── sandbox/
|
|
15
|
+
├── tools/
|
|
16
|
+
├── channels/
|
|
17
|
+
├── schedules/
|
|
18
|
+
└── subagents/
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Slot guide
|
|
22
|
+
|
|
23
|
+
- `instructions.md` - base instructions prompt (the legacy `system.md` slot still works with a deprecation warning)
|
|
24
|
+
- `skills/` - on-demand procedures
|
|
25
|
+
- `tools/` - typed executable integrations
|
|
26
|
+
- `channels/` - HTTP or messaging entrypoints; `onDeliver()` writes durable context and static
|
|
27
|
+
`contextProviders` rebuild live step-local values when needed; Slack channels can override
|
|
28
|
+
`handleInteraction(...)` for no-wake UI actions
|
|
29
|
+
- `sandbox/` - the agent's single sandbox; optional `sandbox.ts` override and optional
|
|
30
|
+
`workspace/` seed files
|
|
31
|
+
- `subagents/` - specialist child agents (each carries its own independent `sandbox/`)
|
|
32
|
+
- `schedules/` - recurring jobs
|
|
33
|
+
- `agent.ts` - additive runtime config for model, name, metadata, build, compaction, and workspace
|
|
34
|
+
|
|
35
|
+
Prefer the nested `agent/` layout for new apps.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Runtime Model Reference
|
|
2
|
+
|
|
3
|
+
Key runtime ideas for app authors:
|
|
4
|
+
|
|
5
|
+
- `ash info` resolves and validates the authored surface
|
|
6
|
+
- `ash build` compiles artifacts and host output
|
|
7
|
+
- `ash dev` starts local development and the REPL
|
|
8
|
+
- `POST /.well-known/ash/v1/message` starts or resumes a run
|
|
9
|
+
- `GET /.well-known/ash/v1/runs/:runId/stream` streams lifecycle events
|
|
10
|
+
|
|
11
|
+
Important mental model:
|
|
12
|
+
|
|
13
|
+
- message execution is durable
|
|
14
|
+
- follow-up turns can resume the same run
|
|
15
|
+
- tools execute inside framework-owned runtime wrappers
|
|
16
|
+
- subagents run as child runs
|
|
17
|
+
- channels own auth, delivery policy, and per-turn context seeding
|
|
18
|
+
- `onDeliver()` can write durable serializable context before the step runs
|
|
19
|
+
- channel classes can declare `static readonly contextProviders = [...]` to rebuild live
|
|
20
|
+
non-serializable step-local values after `onDeliver()`
|
|
21
|
+
- Slack channels handle custom `block_actions` inline via `handleInteraction(ctx, interaction)` and
|
|
22
|
+
use `getSlackThread()` / `editMessage(messageTs, renderable)` for Slack-native reads and updates
|
|
23
|
+
- tools and other authored step code read those values through unified context helpers such as
|
|
24
|
+
`requireContext(...)`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Skills Reference
|
|
2
|
+
|
|
3
|
+
Skills are Ash's on-demand procedure layer.
|
|
4
|
+
|
|
5
|
+
## How skills work
|
|
6
|
+
|
|
7
|
+
1. Ash discovers skills under `skills/`.
|
|
8
|
+
2. The runtime advertises available skills to the model.
|
|
9
|
+
3. The runtime provides a framework-owned `load_skill` tool.
|
|
10
|
+
4. When the model activates a skill, that skill's instructions join the active turn context.
|
|
11
|
+
|
|
12
|
+
## Rules that matter
|
|
13
|
+
|
|
14
|
+
- flat skills can be simple markdown files under `skills/*.md`
|
|
15
|
+
- packaged skills live under `skills/<name>/SKILL.md`
|
|
16
|
+
- packaged `SKILL.md` files must include `name` and `description`
|
|
17
|
+
- tools remain visible whether or not a skill is activated
|
|
18
|
+
- the legacy `allowed-tools` field is not supported
|
|
19
|
+
- skills are loaded through the framework-owned `load_skill` tool
|
|
20
|
+
|
|
21
|
+
## When to use a skill
|
|
22
|
+
|
|
23
|
+
Use a skill for optional procedures, call-routing guidance, and repeatable workflows that should not
|
|
24
|
+
inflate every turn.
|
|
25
|
+
|
|
26
|
+
Do not use a skill for always-on identity or typed execution.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
cat <<'EOF'
|
|
5
|
+
Common local Ash verification commands:
|
|
6
|
+
|
|
7
|
+
ash info
|
|
8
|
+
ash build
|
|
9
|
+
pnpm dev
|
|
10
|
+
|
|
11
|
+
Optional durable run smoke test:
|
|
12
|
+
|
|
13
|
+
curl -X POST http://127.0.0.1:3000/.well-known/ash/v1/message \
|
|
14
|
+
-H 'content-type: application/json' \
|
|
15
|
+
-d '{"message":"Hello"}'
|
|
16
|
+
EOF
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ash-add-agent
|
|
3
|
+
description: Add an Ash agent to an existing Next.js app. Use when turning a Next app into a combined Next.js + Ash app.
|
|
4
|
+
doc:
|
|
5
|
+
title: Add Agent to Next.js
|
|
6
|
+
description: Add Ash to an existing Next.js app while keeping Next.js as the primary web app.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Add Ash to an existing Next.js app while keeping Next as the primary web app. Preserve existing Next config, scripts, aliases, and app files unless they conflict with Ash.
|
|
10
|
+
|
|
11
|
+
## Target
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
agent/
|
|
15
|
+
agent.ts
|
|
16
|
+
channels/
|
|
17
|
+
ash.ts
|
|
18
|
+
instructions.md
|
|
19
|
+
app/
|
|
20
|
+
next.config.ts
|
|
21
|
+
package.json
|
|
22
|
+
tsconfig.json
|
|
23
|
+
vercel.json # generated/updated by withAsh()
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
1. Install Ash:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add experimental-ash ai zod
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. Add the agent root:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
// agent/agent.ts
|
|
38
|
+
import { defineAgent } from "experimental-ash";
|
|
39
|
+
|
|
40
|
+
export default defineAgent({
|
|
41
|
+
model: "openai/gpt-5.4-mini",
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```md
|
|
46
|
+
<!-- agent/instructions.md -->
|
|
47
|
+
|
|
48
|
+
You are a helpful assistant running inside an Ash agent.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use the model requested by the user or the project standard.
|
|
52
|
+
|
|
53
|
+
3. Add the Ash HTTP channel:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// agent/channels/ash.ts
|
|
57
|
+
import { ashChannel } from "experimental-ash/channels/ash";
|
|
58
|
+
import { type AuthFn, localDev, vercelOidc } from "experimental-ash/channels/auth";
|
|
59
|
+
|
|
60
|
+
function exampleProductionAuth(): AuthFn<Request> {
|
|
61
|
+
return () => {
|
|
62
|
+
if (process.env.VERCEL_ENV === "production") {
|
|
63
|
+
throw new Error(
|
|
64
|
+
"Configure production auth in agent/channels/ash.ts (e.g. Auth.js or Clerk).",
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default ashChannel({
|
|
72
|
+
auth: [localDev(), vercelOidc(), exampleProductionAuth()],
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
An authored `agent/channels/ash.ts` replaces Ash's framework default `ash` channel. Keep `localDev()` for localhost and the REPL, keep `vercelOidc()` so Vercel services can reach the deployed agent, and replace `exampleProductionAuth()` with the app's real user auth before production. If the app already uses Auth.js, Clerk, or another session provider, wire it here instead of leaving the placeholder.
|
|
77
|
+
|
|
78
|
+
4. Merge package imports only when agent files use `#...` aliases:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"imports": {
|
|
83
|
+
"#*": "./agent/*",
|
|
84
|
+
"#evals/*": "./evals/*"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
5. Wrap `next.config.ts` with `withAsh()`:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import type { NextConfig } from "next";
|
|
93
|
+
import { withAsh } from "experimental-ash/next";
|
|
94
|
+
|
|
95
|
+
const nextConfig: NextConfig = {
|
|
96
|
+
// existing config
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default withAsh(nextConfig);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If config is already wrapped by other plugins, make `withAsh()` outermost:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
export default withAsh(withSomePlugin(nextConfig));
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If config is an async function, wrap the function export with `withAsh()` rather than rewriting its internals.
|
|
109
|
+
|
|
110
|
+
6. Keep Next as the main command and add Ash-specific scripts:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"scripts": {
|
|
115
|
+
"dev": "next dev",
|
|
116
|
+
"build": "next build",
|
|
117
|
+
"start": "next start",
|
|
118
|
+
"dev:ash": "ash dev",
|
|
119
|
+
"build:ash": "ash build",
|
|
120
|
+
"info:ash": "ash info",
|
|
121
|
+
"typecheck": "tsc --noEmit"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Keep an existing `typecheck` unless it excludes `agent/**/*.ts`.
|
|
127
|
+
|
|
128
|
+
7. Update `tsconfig.json` without clobbering existing aliases:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"include": [
|
|
133
|
+
"next-env.d.ts",
|
|
134
|
+
"**/*.ts",
|
|
135
|
+
"**/*.tsx",
|
|
136
|
+
".ash/**/*.d.ts",
|
|
137
|
+
".next/types/**/*.ts",
|
|
138
|
+
".next/dev/types/**/*.ts"
|
|
139
|
+
],
|
|
140
|
+
"compilerOptions": {
|
|
141
|
+
"paths": {
|
|
142
|
+
"@/*": ["./*"],
|
|
143
|
+
"#*": ["./agent/*"],
|
|
144
|
+
"#evals/*": ["./evals/*"]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Add `paths` only if the project uses those aliases.
|
|
151
|
+
|
|
152
|
+
8. Let `withAsh()` generate or update `vercel.json`.
|
|
153
|
+
|
|
154
|
+
After adding `withAsh()`, run `pnpm dev` or the relevant build command. Do not hand-author the Vercel services config unless generation fails or the user explicitly wants manual control. If `vercel.json` is created or changed, review and commit it.
|
|
155
|
+
|
|
156
|
+
## Verify
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pnpm install
|
|
160
|
+
pnpm dev
|
|
161
|
+
curl http://localhost:3000/ash/v1/health
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Use `pnpm info:ash` or `pnpm dev:ash` to inspect Ash directly.
|
|
165
|
+
|
|
166
|
+
If `agent/channels/ash.ts` throws in production, that is intentional until production auth is wired.
|