@cursor/july 0.1.4 → 0.1.6
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/ab.d.ts +8 -95
- package/dist/ab.d.ts.map +1 -1
- package/dist/ab.js +9 -150
- package/dist/bin/agent-serve.js +14 -6
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DF-Yx4OP.js → app.DMboGKUD.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.O6eP7QZr.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DSeJSudL.js → VPLocalSearchBox.DkEqEnJU.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DZVLTXOC.js → theme.ASugdMNm.js} +2 -2
- package/dist/docs/assets/deployment.md.BtfEsc9S.js +55 -0
- package/dist/docs/assets/deployment.md.BtfEsc9S.lean.js +1 -0
- package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.js +10 -0
- package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.lean.js +1 -0
- package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.js +7 -0
- package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.lean.js +1 -0
- package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.js +11 -0
- package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.lean.js +1 -0
- package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.js +8 -0
- package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.lean.js +1 -0
- package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.js +8 -0
- package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.lean.js +1 -0
- package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.js +23 -0
- package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.lean.js +1 -0
- package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.js +15 -0
- package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.lean.js +1 -0
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.js +2 -0
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.lean.js +1 -0
- package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.js +11 -0
- package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.lean.js +1 -0
- package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.js +19 -0
- package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.lean.js +1 -0
- package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.js +5 -0
- package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.lean.js +1 -0
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.js +24 -0
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.lean.js +1 -0
- package/dist/docs/assets/index.md.COiu-1jL.js +20 -0
- package/dist/docs/assets/{index.md.Cylk70gg.lean.js → index.md.COiu-1jL.lean.js} +1 -1
- package/dist/docs/assets/reference_cli.md.D189RBCH.js +60 -0
- package/dist/docs/assets/reference_cli.md.D189RBCH.lean.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +58 -17
- package/dist/docs/evals.html +4 -4
- package/dist/docs/example-agents/approval-buddy.html +34 -0
- package/dist/docs/example-agents/benny.html +31 -0
- package/dist/docs/example-agents/bugbot.html +35 -0
- package/dist/docs/example-agents/codebase-wiki.html +32 -0
- package/dist/docs/example-agents/codeowners-review.html +32 -0
- package/dist/docs/example-agents/concierge.html +47 -0
- package/dist/docs/example-agents/fsd.html +39 -0
- package/dist/docs/example-agents/index.html +26 -0
- package/dist/docs/example-agents/knowledge-base.html +35 -0
- package/dist/docs/example-agents/security-reviewer.html +43 -0
- package/dist/docs/example-agents/slack-agent.html +29 -0
- package/dist/docs/example-agents/weather-agent.html +48 -0
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +5 -5
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +7 -7
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +52 -30
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/evals.d.ts +4 -61
- package/dist/evals.d.ts.map +1 -1
- package/dist/evals.js +3 -66
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/ab-collector.d.ts +7 -5
- package/dist/internal/ab-collector.d.ts.map +1 -1
- package/dist/internal/ab-collector.js +3 -14
- package/dist/internal/ab-snapshot.d.ts +2 -4
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/cli-ax.d.ts +18 -3
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +80 -42
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +5 -2
- package/dist/internal/cursor-event-relay.d.ts +4 -1
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +6 -0
- package/dist/internal/cursor-relay-core.d.ts +36 -1
- package/dist/internal/cursor-relay-core.d.ts.map +1 -1
- package/dist/internal/cursor-relay-core.js +89 -8
- package/dist/internal/cursor-slack-relay.d.ts +2 -2
- package/dist/internal/cursor-slack-relay.d.ts.map +1 -1
- package/dist/internal/cursor-slack-relay.js +4 -0
- package/dist/internal/discovery.js +3 -3
- package/dist/internal/eval-run-store.d.ts +33 -30
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-run-store.js +84 -96
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +3 -2
- package/dist/internal/playground-proxy.d.ts +5 -5
- package/dist/internal/playground-proxy.js +3 -3
- package/dist/internal/resolve-prod-target.d.ts +30 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +74 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +5 -3
- package/dist/internal/session-engine.d.ts +1 -2
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +14 -31
- package/dist/internal/storage-coordinator.d.ts +16 -15
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +73 -80
- package/dist/playground/assets/cursor-icons-16-CQ50JpfO.woff2 +0 -0
- package/dist/playground/assets/index-7GJIUFQj.css +1 -0
- package/dist/playground/assets/index-mux9aj5P.js +319 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage.d.ts +51 -10
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +27 -10
- package/docs/README.md +34 -5
- package/docs/deployment.md +352 -149
- package/docs/example-agents/approval-buddy.md +270 -0
- package/docs/example-agents/benny.md +186 -0
- package/docs/example-agents/bugbot.md +231 -0
- package/docs/example-agents/codebase-wiki.md +174 -0
- package/docs/example-agents/codeowners-review.md +195 -0
- package/docs/example-agents/concierge.md +205 -0
- package/docs/example-agents/fsd.md +330 -0
- package/docs/example-agents/index.md +102 -0
- package/docs/example-agents/knowledge-base.md +171 -0
- package/docs/example-agents/security-reviewer.md +296 -0
- package/docs/example-agents/slack-agent.md +146 -0
- package/docs/example-agents/weather-agent.md +302 -0
- package/docs/reference/cli.md +546 -147
- package/package.json +1 -1
- package/src/ab.ts +9 -261
- package/src/bin/agent-serve.ts +14 -6
- package/src/evals.ts +4 -118
- package/src/index.ts +2 -0
- package/src/internal/ab-collector.ts +12 -22
- package/src/internal/ab-snapshot.ts +2 -4
- package/src/internal/cli-ax.ts +101 -45
- package/src/internal/cli-deploy.ts +5 -2
- package/src/internal/cursor-event-relay.ts +10 -1
- package/src/internal/cursor-relay-core.ts +115 -9
- package/src/internal/cursor-slack-relay.ts +6 -2
- package/src/internal/discovery.ts +2 -2
- package/src/internal/eval-run-store.ts +86 -100
- package/src/internal/init-project.ts +3 -2
- package/src/internal/playground-proxy.ts +5 -5
- package/src/internal/resolve-prod-target.ts +101 -3
- package/src/internal/server.ts +5 -3
- package/src/internal/session-engine.ts +9 -29
- package/src/internal/storage-coordinator.ts +109 -101
- package/src/storage.ts +79 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.0XrheBv2.js +0 -1
- package/dist/docs/assets/deployment.md.DTKwE15Z.js +0 -14
- package/dist/docs/assets/deployment.md.DTKwE15Z.lean.js +0 -1
- package/dist/docs/assets/index.md.Cylk70gg.js +0 -20
- package/dist/docs/assets/reference_cli.md.Bv6pOxcF.js +0 -38
- package/dist/docs/assets/reference_cli.md.Bv6pOxcF.lean.js +0 -1
- package/dist/internal/json-dir-store.d.ts +0 -32
- package/dist/internal/json-dir-store.d.ts.map +0 -1
- package/dist/internal/json-dir-store.js +0 -100
- package/dist/playground/assets/cursor-icons-outline-BxTT_FVJ.woff2 +0 -0
- package/dist/playground/assets/index-Ct_Usdm8.css +0 -1
- package/dist/playground/assets/index-Dsyb-Vaj.js +0 -319
- package/src/internal/json-dir-store.ts +0 -109
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Explore the full agentkit surface with a weather agent"
|
|
3
|
+
description: "Trace tools, MCP, channels, approvals, skills, subagents, schedules, hooks, A/B metrics, and evals through one local agent."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Explore the full agentkit surface with a weather agent
|
|
7
|
+
|
|
8
|
+
The weather agent is the broadest small example in the repository. It fetches
|
|
9
|
+
live conditions and forecasts, converts units through MCP, writes notes in a
|
|
10
|
+
session workspace, and pauses an alert tool for human approval. The same agent
|
|
11
|
+
also runs from HTTP, Slack, a schedule, and the MCP endpoint.
|
|
12
|
+
|
|
13
|
+
Use this project when you want to see how agentkit's filesystem pieces fit
|
|
14
|
+
together before you design a larger agent.
|
|
15
|
+
|
|
16
|
+
[Browse the weather agent source.](../../examples/weather-agent/)
|
|
17
|
+
|
|
18
|
+
## See every local runtime feature together
|
|
19
|
+
|
|
20
|
+
Most examples focus on one architecture. Weather agent puts the major local
|
|
21
|
+
runtime features side by side:
|
|
22
|
+
|
|
23
|
+
| Capability | Source | Role |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Root config and instructions | [`agent/agent.ts`](../../examples/weather-agent/agent/agent.ts), [`agent/instructions.md`](../../examples/weather-agent/agent/instructions.md) | Select the local runtime and route each request. |
|
|
26
|
+
| Server tools | [`agent/tools/`](../../examples/weather-agent/agent/tools/) | Fetch Open-Meteo data, call MCP, and model an approval-gated action. |
|
|
27
|
+
| Agent tool | [`save_weather_note.ts`](../../examples/weather-agent/agent/tools/save_weather_note.ts) | Run a Python script inside the session workspace. |
|
|
28
|
+
| Stdio MCP | [`units.ts`](../../examples/weather-agent/agent/mcp-connections/units.ts) | Expose conversion tools to the model, host tools, and channel handlers. |
|
|
29
|
+
| Custom HTTP | [`webhook.ts`](../../examples/weather-agent/agent/channels/webhook.ts) | Start a turn or call MCP without a model turn. |
|
|
30
|
+
| Slack | [`slack.ts`](../../examples/weather-agent/agent/channels/slack.ts), [`slack-app.ts`](../../examples/weather-agent/agent/channels/slack-app.ts) | Compare account-linked chat with a dedicated app offering approval buttons. |
|
|
31
|
+
| Skill and subagent | [`forecast.md`](../../examples/weather-agent/agent/skills/forecast.md), [`researcher/`](../../examples/weather-agent/agent/subagents/researcher/) | Load a procedure on demand or delegate broad research. |
|
|
32
|
+
| Schedule and hook | [`heartbeat.md`](../../examples/weather-agent/agent/schedules/heartbeat.md), [`audit.ts`](../../examples/weather-agent/agent/hooks/audit.ts) | Start recurring task sessions and observe completed turns. |
|
|
33
|
+
| A/B and evals | [`agent/ab.ts`](../../examples/weather-agent/agent/ab.ts), [`evals/`](../../examples/weather-agent/evals/) | Compare a sticky variant and protect tool routing with regression cases. |
|
|
34
|
+
|
|
35
|
+
## Follow one request
|
|
36
|
+
|
|
37
|
+
A current-weather question takes this path:
|
|
38
|
+
|
|
39
|
+
1. The built-in HTTP channel, Slack, or the custom `/report` route creates a
|
|
40
|
+
durable session.
|
|
41
|
+
2. `instructions.md` tells the model to call `get_weather` instead of
|
|
42
|
+
guessing.
|
|
43
|
+
3. The server tool geocodes the city, fetches Open-Meteo, validates the
|
|
44
|
+
response, and returns normalized fields.
|
|
45
|
+
4. The agent writes a short answer. Agentkit records every event in the
|
|
46
|
+
session stream.
|
|
47
|
+
5. The audit hook observes `turn.completed`. If the session joined the A/B
|
|
48
|
+
experiment, the collector updates its metrics too.
|
|
49
|
+
|
|
50
|
+
Forecasts route to `get_forecast`. Unit conversions route to
|
|
51
|
+
`convert_temperature`, which calls the `units` MCP server through
|
|
52
|
+
`ctx.host.mcp`. Climate history and broad comparisons route to the
|
|
53
|
+
`researcher` subagent.
|
|
54
|
+
|
|
55
|
+
## Prepare the example
|
|
56
|
+
|
|
57
|
+
You need:
|
|
58
|
+
|
|
59
|
+
- Node 22.13 or newer.
|
|
60
|
+
- An agent-runtime credential.
|
|
61
|
+
- Network access to Open-Meteo.
|
|
62
|
+
- Python 3 for `save_weather_note`.
|
|
63
|
+
|
|
64
|
+
The project mounts an account-linked Slack channel. Agentkit checks the
|
|
65
|
+
connection at startup, so sign in even when you plan to call a deterministic
|
|
66
|
+
tool.
|
|
67
|
+
|
|
68
|
+
The optional approval-enabled Slack app also needs:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
export WEATHER_AGENT_SLACK_BOT_TOKEN=xoxb-...
|
|
72
|
+
export WEATHER_AGENT_SLACK_APP_TOKEN=xapp-...
|
|
73
|
+
agentkit slack doctor --prefix WEATHER_AGENT
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Without those two tokens, the dedicated channel stays idle. The
|
|
77
|
+
account-linked channel still works.
|
|
78
|
+
|
|
79
|
+
## Inspect before running
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
agentkit validate --dir examples/weather-agent
|
|
83
|
+
agentkit info --dir examples/weather-agent --json
|
|
84
|
+
agentkit eval --dir examples/weather-agent --list
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The manifest should report five tools, one skill, one MCP connection, one
|
|
88
|
+
subagent, three authored channels, one schedule, one hook, and one A/B
|
|
89
|
+
experiment. The eval listing should report eight cases.
|
|
90
|
+
|
|
91
|
+
## Call the typed tools
|
|
92
|
+
|
|
93
|
+
Start with the current-weather server tool:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
agentkit call get_weather \
|
|
97
|
+
--dir examples/weather-agent \
|
|
98
|
+
--input '{"city":"New York City"}'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`defineTool` gives the input a Zod schema. Agentkit validates the JSON before
|
|
102
|
+
`execute` runs. The result includes the matched place, condition,
|
|
103
|
+
temperature, humidity, wind, gusts, and precipitation.
|
|
104
|
+
|
|
105
|
+
Try the forecast:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
agentkit call get_forecast \
|
|
109
|
+
--dir examples/weather-agent \
|
|
110
|
+
--input '{"city":"Lisbon","days":5}'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The tool accepts one to seven days. Shared Open-Meteo code lives under
|
|
114
|
+
`agent/lib/`, so agentkit imports it without discovering another tool.
|
|
115
|
+
|
|
116
|
+
## Compare server and agent execution
|
|
117
|
+
|
|
118
|
+
Most weather tools use the default `execution: "server"`. Their TypeScript
|
|
119
|
+
runs inside the serve host and can reach `ctx.host` services.
|
|
120
|
+
|
|
121
|
+
`save_weather_note` uses `execution: "agent"` instead. Agentkit materializes
|
|
122
|
+
its script into the agent environment. The script reads JSON from stdin and
|
|
123
|
+
appends to `weather-notes.md` in that session's workspace:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
agentkit run --dir examples/weather-agent \
|
|
127
|
+
--message "Save a note that Boston is cold and windy."
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Each session gets its own workspace. Saving a note doesn't edit the authored
|
|
131
|
+
example.
|
|
132
|
+
|
|
133
|
+
This split matters on cloud. Server tools are local-runtime only. For a cloud
|
|
134
|
+
turn, agentkit includes an agent tool's catalog and script body in the first
|
|
135
|
+
prompt. The cloud model writes and invokes the script in its VM; the serve
|
|
136
|
+
host doesn't materialize it there.
|
|
137
|
+
|
|
138
|
+
## Use one MCP connection in three places
|
|
139
|
+
|
|
140
|
+
`agent/mcp-connections/units.ts` starts a local stdio server. The filename
|
|
141
|
+
makes its server name `units`. Agentkit exposes it to:
|
|
142
|
+
|
|
143
|
+
- the model as MCP tools,
|
|
144
|
+
- server tools through `ctx.host.mcp`, and
|
|
145
|
+
- channel handlers through `host.mcp`.
|
|
146
|
+
|
|
147
|
+
`convert_temperature` demonstrates the server-tool path:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
agentkit call convert_temperature \
|
|
151
|
+
--dir examples/weather-agent \
|
|
152
|
+
--input '{"value":72,"from":"F"}'
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The custom channel demonstrates the handler path. Start the dev server:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
agentkit dev examples/weather-agent
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Then call MCP deterministically through `/convert`:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
curl -s -X POST \
|
|
165
|
+
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/convert \
|
|
166
|
+
-H 'content-type: application/json' \
|
|
167
|
+
-d '{"value":20,"from":"C"}'
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
No model chooses a tool in this route. The handler calls the MCP server and
|
|
171
|
+
returns its result.
|
|
172
|
+
|
|
173
|
+
## Keep conversation state in a custom channel
|
|
174
|
+
|
|
175
|
+
`POST /report` starts a model turn and waits for it:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
curl -s -X POST \
|
|
179
|
+
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
180
|
+
-H 'content-type: application/json' \
|
|
181
|
+
-d '{"message":"What is the weather in Paris?"}'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The response includes a `key`. Send it back on the next request to continue
|
|
185
|
+
the same session:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
curl -s -X POST \
|
|
189
|
+
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
190
|
+
-H 'content-type: application/json' \
|
|
191
|
+
-d '{"message":"How about tomorrow?","key":"<key>"}'
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
This is the custom-channel version of a continuation token. See
|
|
195
|
+
[webhooks and custom channels](../guides/webhooks.md) for route schemas,
|
|
196
|
+
authentication, and asynchronous handlers.
|
|
197
|
+
|
|
198
|
+
## Pause a tool for human approval
|
|
199
|
+
|
|
200
|
+
`post_weather_alert` sets `needsApproval: true`. Ask for an ops alert in the
|
|
201
|
+
playground and the model's tool call parks before `execute`:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
agentkit dev examples/weather-agent
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Open the printed playground URL, ask:
|
|
208
|
+
|
|
209
|
+
> Alert ops that severe weather is approaching Boston.
|
|
210
|
+
|
|
211
|
+
Approve or deny the call in the transcript. The dedicated Socket Mode Slack
|
|
212
|
+
channel can show the same buttons when `toolApprovals: true` and Slack
|
|
213
|
+
interactivity are configured.
|
|
214
|
+
|
|
215
|
+
The example tool returns a placeholder success object. It doesn't contact
|
|
216
|
+
Slack, PagerDuty, or an ops board. Replace its `execute` body with your own
|
|
217
|
+
sink before adapting it.
|
|
218
|
+
|
|
219
|
+
Use a model turn for this proof. A deterministic `agentkit call` runs the
|
|
220
|
+
tool body directly and doesn't demonstrate the parked approval flow.
|
|
221
|
+
|
|
222
|
+
## Load procedures and delegate research
|
|
223
|
+
|
|
224
|
+
The forecast skill gives the root agent an on-demand procedure. Agentkit
|
|
225
|
+
advertises the skill's description, then the harness loads its content when
|
|
226
|
+
the request matches.
|
|
227
|
+
|
|
228
|
+
The `researcher` directory is an SDK subagent. Its description tells the
|
|
229
|
+
parent when to delegate. It inherits the parent's execution surface, but
|
|
230
|
+
gets its own instructions:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
agentkit run --dir examples/weather-agent \
|
|
234
|
+
--message "Compare record summer temperatures across Paris, London, and Rome."
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Use a skill when the same agent needs a procedure. Use a subagent when the
|
|
238
|
+
parent should hand a bounded task to a specialist. The
|
|
239
|
+
[subagents reference](../reference/subagents.md) explains the current
|
|
240
|
+
inheritance limits.
|
|
241
|
+
|
|
242
|
+
## Trigger the schedule and inspect the hook
|
|
243
|
+
|
|
244
|
+
The heartbeat schedule runs at 09:00 UTC on weekdays. Automatic schedule
|
|
245
|
+
timers stay off under `--dev`, so dispatch it manually:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
curl -s -X POST \
|
|
249
|
+
http://127.0.0.1:3000/weather-agent/v1/dev/schedules/heartbeat
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
It creates a task session to check San Francisco, New York, and London.
|
|
253
|
+
The audit hook logs usage after each completed turn. Hooks observe recorded
|
|
254
|
+
events; their failures don't fail the turn.
|
|
255
|
+
|
|
256
|
+
## Measure variants and regressions
|
|
257
|
+
|
|
258
|
+
The `weather-tool-efficiency` A/B experiment assigns sessions by a sticky
|
|
259
|
+
hash:
|
|
260
|
+
|
|
261
|
+
- `control` returns current conditions in Fahrenheit.
|
|
262
|
+
- `treatment` adds a brief Celsius instruction and changes `get_weather` to
|
|
263
|
+
return Celsius fields.
|
|
264
|
+
|
|
265
|
+
Samples and aggregate snapshots persist under `.agent-serve/`. The treatment
|
|
266
|
+
only changes current conditions; `get_forecast` still returns Fahrenheit.
|
|
267
|
+
Treat the branch as an example of `ctx.session.abs`, not a complete unit
|
|
268
|
+
policy.
|
|
269
|
+
|
|
270
|
+
List and run the evals:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
agentkit eval --dir examples/weather-agent --list
|
|
274
|
+
agentkit eval --dir examples/weather-agent --json
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Six cases cover current weather and forecasts against live Open-Meteo. Two
|
|
278
|
+
more cover the local MCP converter and workspace note tool. Together they
|
|
279
|
+
test model routing, external data, host MCP, and agent-side execution.
|
|
280
|
+
|
|
281
|
+
## Turn the weather tour into your own agent
|
|
282
|
+
|
|
283
|
+
Keep the architecture and replace the domain:
|
|
284
|
+
|
|
285
|
+
- Swap Open-Meteo tools for your typed service clients.
|
|
286
|
+
- Keep deterministic transforms behind direct server tools or MCP.
|
|
287
|
+
- Use an agent tool only when code must run in the agent workspace.
|
|
288
|
+
- Gate side effects with `needsApproval`.
|
|
289
|
+
- Put reusable procedures in skills and narrow specialist work into
|
|
290
|
+
subagents.
|
|
291
|
+
- Add a channel only when the external surface needs its own identity,
|
|
292
|
+
continuation key, or delivery behavior.
|
|
293
|
+
|
|
294
|
+
## Where to go next
|
|
295
|
+
|
|
296
|
+
- [Tools](../reference/tools.md)
|
|
297
|
+
- [MCP connections](../reference/connections.md)
|
|
298
|
+
- [Human-in-the-loop approvals](../guides/human-in-the-loop.md)
|
|
299
|
+
- [Slack](../guides/slack.md)
|
|
300
|
+
- [Schedules and reminders](../reference/schedules.md)
|
|
301
|
+
- [Evals](../evals.md)
|
|
302
|
+
- [Live A/B metrics](../ab.md)
|