@cursor/july 0.1.7 → 0.1.8
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/bin/agent-serve.js +31 -2
- package/dist/channels/slack/channel-watch.d.ts +6 -1
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +22 -1
- package/dist/channels/slack/cursor-account.d.ts +4 -0
- package/dist/channels/slack/cursor-account.d.ts.map +1 -1
- package/dist/channels/slack/cursor-account.js +12 -2
- package/dist/channels/slack/defaults.d.ts +10 -5
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +39 -17
- package/dist/channels/slack/dispatch.d.ts +18 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +141 -38
- package/dist/channels/slack/inbound.d.ts +13 -3
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +17 -9
- package/dist/channels/slack/index.d.ts +4 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +4 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +1 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +3 -0
- package/dist/channels/slack/nudge-carrier.d.ts +19 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +166 -0
- package/dist/channels/slack/nudge-store.d.ts +61 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +266 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +74 -25
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/thread-context.d.ts +81 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +470 -0
- package/dist/channels/slack/types.d.ts +27 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.COTN7wgo.js → app.BP8mAVMW.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DevOabKJ.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BW3TBdT0.js → VPLocalSearchBox.1FXIZbz8.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEJW0vE7.js → theme.Dm1R02v9.js} +2 -2
- package/dist/docs/assets/example-agents_index.md.CwtWu5ix.js +2 -0
- package/dist/docs/assets/{example-agents_index.md.CRqJlnIf.lean.js → example-agents_index.md.CwtWu5ix.lean.js} +1 -1
- package/dist/docs/assets/example-agents_oncall.md.BG_sUMly.js +10 -0
- package/dist/docs/assets/example-agents_oncall.md.BG_sUMly.lean.js +1 -0
- package/dist/docs/assets/{guides_slack.md.CCwqHvSV.js → guides_slack.md.FWale6Ip.js} +4 -3
- package/dist/docs/assets/{guides_slack.md.CCwqHvSV.lean.js → guides_slack.md.FWale6Ip.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DdjWabnN.js → reference_sessions.md.DLd6mvbv.js} +2 -2
- package/dist/docs/assets/{reference_sessions.md.DdjWabnN.lean.js → reference_sessions.md.DLd6mvbv.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.CVnInNiN.js → storage.md.Cu3MwM2a.js} +3 -2
- package/dist/docs/assets/{storage.md.CVnInNiN.lean.js → storage.md.Cu3MwM2a.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/example-agents/approval-buddy.html +4 -4
- package/dist/docs/example-agents/benny.html +5 -5
- package/dist/docs/example-agents/bugbot.html +5 -5
- package/dist/docs/example-agents/codebase-wiki.html +4 -4
- package/dist/docs/example-agents/codeowners-review.html +4 -4
- package/dist/docs/example-agents/concierge.html +4 -4
- package/dist/docs/example-agents/fsd.html +4 -4
- package/dist/docs/example-agents/index.html +6 -6
- package/dist/docs/example-agents/knowledge-base.html +4 -4
- package/dist/docs/example-agents/oncall.html +34 -0
- package/dist/docs/example-agents/security-reviewer.html +4 -4
- package/dist/docs/example-agents/slack-agent.html +4 -4
- package/dist/docs/example-agents/weather-agent.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- 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 +7 -6
- 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 +4 -4
- 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 +4 -4
- 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 +5 -5
- 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 +7 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/internal/cli-mcp.d.ts +64 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +570 -0
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +2 -0
- package/dist/internal/host-kv.d.ts +17 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +77 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +8 -0
- package/dist/internal/session-engine.d.ts +42 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +247 -51
- package/dist/internal/storage-coordinator.d.ts +18 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +43 -0
- package/dist/playground/assets/index-7GJIUFQj.css +1 -0
- package/dist/playground/assets/index-Bpr4Th4M.js +319 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +190 -0
- package/dist/storage-backends/postgres-kv.d.ts +77 -0
- package/dist/storage-backends/postgres-kv.d.ts.map +1 -0
- package/dist/storage-backends/postgres-kv.js +180 -0
- package/dist/storage.d.ts +10 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +10 -1
- package/dist/types.d.ts +79 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/example-agents/index.md +14 -9
- package/docs/example-agents/oncall.md +216 -0
- package/docs/guides/slack.md +11 -2
- package/docs/reference/sessions.md +13 -4
- package/docs/storage.md +27 -0
- package/package.json +15 -1
- package/skills/framework-map/SKILL.md +6 -4
- package/src/bin/agent-serve.ts +32 -2
- package/src/channels/slack/channel-watch.ts +28 -1
- package/src/channels/slack/cursor-account.ts +20 -0
- package/src/channels/slack/defaults.ts +51 -20
- package/src/channels/slack/dispatch.ts +215 -40
- package/src/channels/slack/inbound.ts +30 -10
- package/src/channels/slack/index.ts +4 -0
- package/src/channels/slack/live-delivery.ts +1 -0
- package/src/channels/slack/manifest.ts +3 -0
- package/src/channels/slack/nudge-carrier.ts +182 -0
- package/src/channels/slack/nudge-store.ts +308 -0
- package/src/channels/slack/slack-channel.ts +106 -31
- package/src/channels/slack/stop.ts +25 -0
- package/src/channels/slack/thread-context.ts +572 -0
- package/src/channels/slack/types.ts +27 -0
- package/src/internal/cli-mcp.ts +708 -0
- package/src/internal/distribution.ts +2 -0
- package/src/internal/host-kv.ts +85 -0
- package/src/internal/server.ts +31 -0
- package/src/internal/session-engine.ts +351 -50
- package/src/internal/storage-coordinator.ts +41 -0
- package/src/storage-backends/file-kv.ts +221 -0
- package/src/storage-backends/postgres-kv.ts +248 -0
- package/src/storage.ts +11 -1
- package/src/types.ts +83 -0
- package/dist/channels/slack/post-update-delivery.d.ts +0 -85
- package/dist/channels/slack/post-update-delivery.d.ts.map +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.B7UcKvIn.js +0 -1
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.js +0 -2
- package/dist/internal/json-dir-store.d.ts +0 -32
- package/dist/internal/json-dir-store.d.ts.map +0 -1
- package/dist/internal/persistence-coordinator.d.ts +0 -127
- package/dist/internal/persistence-coordinator.d.ts.map +0 -1
- package/dist/persistence.d.ts +0 -184
- package/dist/persistence.d.ts.map +0 -1
- package/dist/playground/assets/index-72vCOBWO.js +0 -86
- package/dist/playground/assets/index-BjnMwYoR.css +0 -1
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch prior Slack thread messages and format them for the model prompt.
|
|
3
|
+
*
|
|
4
|
+
* Cold-start mentions (`@agent what happened here?`) only carry the mention
|
|
5
|
+
* text; the parent alert / earlier replies live in `conversations.replies`.
|
|
6
|
+
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { callSlackApiSoft } from "./api.js";
|
|
17
|
+
import { slackTextToMarkdown } from "./inbound.js";
|
|
18
|
+
import { defaultSlackLog } from "./log.js";
|
|
19
|
+
/** Cap replies fetched from Slack (plus the parent). */
|
|
20
|
+
const DEFAULT_REPLY_LIMIT = 50;
|
|
21
|
+
/** Soft cap on the formatted block so we don't blow the prompt. */
|
|
22
|
+
const DEFAULT_MAX_CHARS = 12000;
|
|
23
|
+
/** Slack pages `conversations.replies` oldest-first; bound pagination. */
|
|
24
|
+
const REPLIES_PAGE_LIMIT = 200;
|
|
25
|
+
const REPLIES_MAX_PAGES = 5;
|
|
26
|
+
function excludeTimestampSet(excludeTs) {
|
|
27
|
+
if (excludeTs === undefined) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (typeof excludeTs === "string") {
|
|
31
|
+
return new Set([excludeTs]);
|
|
32
|
+
}
|
|
33
|
+
const set = new Set();
|
|
34
|
+
for (const ts of excludeTs) {
|
|
35
|
+
if (ts !== "") {
|
|
36
|
+
set.add(ts);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return set.size > 0 ? set : undefined;
|
|
40
|
+
}
|
|
41
|
+
/** Keep the thread root plus the newest replies when over the fetch cap. */
|
|
42
|
+
export function trimThreadMessagesForPrompt(messages, options) {
|
|
43
|
+
const exclude = excludeTimestampSet(options.excludeTs);
|
|
44
|
+
const filtered = messages.filter((message) => {
|
|
45
|
+
const ts = asString(message.ts);
|
|
46
|
+
if (ts === undefined || ts === "") {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
if (exclude !== undefined && exclude.has(ts)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return slackApiMessageBody(message).trim() !== "";
|
|
53
|
+
});
|
|
54
|
+
if (filtered.length <= options.limit) {
|
|
55
|
+
return filtered;
|
|
56
|
+
}
|
|
57
|
+
const parentIndex = filtered.findIndex((message) => asString(message.ts) === options.threadTs);
|
|
58
|
+
const parent = parentIndex >= 0 ? filtered[parentIndex] : undefined;
|
|
59
|
+
const withoutParent = parentIndex >= 0
|
|
60
|
+
? filtered.filter((_message, index) => index !== parentIndex)
|
|
61
|
+
: filtered;
|
|
62
|
+
const tail = withoutParent.slice(Math.max(0, withoutParent.length - (options.limit - (parent === undefined ? 0 : 1))));
|
|
63
|
+
if (parent === undefined) {
|
|
64
|
+
return tail;
|
|
65
|
+
}
|
|
66
|
+
if (tail.some((message) => asString(message.ts) === options.threadTs)) {
|
|
67
|
+
return tail;
|
|
68
|
+
}
|
|
69
|
+
return [parent, ...tail];
|
|
70
|
+
}
|
|
71
|
+
function asRecord(value) {
|
|
72
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
function asString(value) {
|
|
78
|
+
return typeof value === "string" ? value : undefined;
|
|
79
|
+
}
|
|
80
|
+
/** Pull readable text out of Slack attachment / Block Kit payloads. */
|
|
81
|
+
export function slackApiMessageBody(message) {
|
|
82
|
+
const parts = [];
|
|
83
|
+
const text = asString(message.text);
|
|
84
|
+
if (text !== undefined && text.trim() !== "") {
|
|
85
|
+
parts.push(text);
|
|
86
|
+
}
|
|
87
|
+
const attachments = Array.isArray(message.attachments)
|
|
88
|
+
? message.attachments
|
|
89
|
+
: [];
|
|
90
|
+
for (const attachment of attachments) {
|
|
91
|
+
const rec = asRecord(attachment);
|
|
92
|
+
if (rec === null) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
for (const key of [
|
|
96
|
+
"pretext",
|
|
97
|
+
"title",
|
|
98
|
+
"text",
|
|
99
|
+
"fallback",
|
|
100
|
+
"footer",
|
|
101
|
+
]) {
|
|
102
|
+
const value = asString(rec[key]);
|
|
103
|
+
if (value !== undefined && value.trim() !== "") {
|
|
104
|
+
parts.push(value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const titleLink = asString(rec.title_link);
|
|
108
|
+
if (titleLink !== undefined && titleLink.trim() !== "") {
|
|
109
|
+
parts.push(titleLink);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const blocks = Array.isArray(message.blocks) ? message.blocks : [];
|
|
113
|
+
for (const block of blocks) {
|
|
114
|
+
const rec = asRecord(block);
|
|
115
|
+
if (rec === null) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const blockText = asRecord(rec.text);
|
|
119
|
+
const blockTextValue = asString(blockText === null || blockText === void 0 ? void 0 : blockText.text);
|
|
120
|
+
if (blockTextValue !== undefined && blockTextValue.trim() !== "") {
|
|
121
|
+
parts.push(blockTextValue);
|
|
122
|
+
}
|
|
123
|
+
const fields = Array.isArray(rec.fields) ? rec.fields : [];
|
|
124
|
+
for (const field of fields) {
|
|
125
|
+
const fieldRec = asRecord(field);
|
|
126
|
+
const fieldText = asString(fieldRec === null || fieldRec === void 0 ? void 0 : fieldRec.text);
|
|
127
|
+
if (fieldText !== undefined && fieldText.trim() !== "") {
|
|
128
|
+
parts.push(fieldText);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Dedupe identical chunks (Datadog often repeats text/fallback across fields).
|
|
133
|
+
const seen = new Set();
|
|
134
|
+
const deduped = [];
|
|
135
|
+
for (const part of parts) {
|
|
136
|
+
const trimmed = part.trim();
|
|
137
|
+
if (trimmed === "" || seen.has(trimmed)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
seen.add(trimmed);
|
|
141
|
+
deduped.push(trimmed);
|
|
142
|
+
}
|
|
143
|
+
return deduped.join("\n");
|
|
144
|
+
}
|
|
145
|
+
function formatThreadEntry(message, role) {
|
|
146
|
+
var _a;
|
|
147
|
+
const ts = (_a = asString(message.ts)) !== null && _a !== void 0 ? _a : "?";
|
|
148
|
+
const userId = asString(message.user);
|
|
149
|
+
const botId = asString(message.bot_id);
|
|
150
|
+
const username = asString(message.username);
|
|
151
|
+
const who = userId !== undefined && userId !== ""
|
|
152
|
+
? userId
|
|
153
|
+
: botId !== undefined && botId !== ""
|
|
154
|
+
? `bot:${botId}${username !== undefined ? ` (${username})` : ""}`
|
|
155
|
+
: (username !== null && username !== void 0 ? username : "unknown");
|
|
156
|
+
const body = slackTextToMarkdown(slackApiMessageBody(message));
|
|
157
|
+
if (body === "") {
|
|
158
|
+
return `[${role}] ${who} @ ${ts}:\n(empty)`;
|
|
159
|
+
}
|
|
160
|
+
return `[${role}] ${who} @ ${ts}:\n${body}`;
|
|
161
|
+
}
|
|
162
|
+
function compareSlackTs(a, b) {
|
|
163
|
+
const [aSec = "0", aFrac = "0"] = a.split(".");
|
|
164
|
+
const [bSec = "0", bFrac = "0"] = b.split(".");
|
|
165
|
+
const zero = BigInt(0);
|
|
166
|
+
const sec = BigInt(aSec) - BigInt(bSec);
|
|
167
|
+
if (sec !== zero) {
|
|
168
|
+
return sec < zero ? -1 : 1;
|
|
169
|
+
}
|
|
170
|
+
const frac = BigInt(aFrac.padEnd(6, "0").slice(0, 6)) -
|
|
171
|
+
BigInt(bFrac.padEnd(6, "0").slice(0, 6));
|
|
172
|
+
if (frac === zero) {
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
return frac < zero ? -1 : 1;
|
|
176
|
+
}
|
|
177
|
+
/** True when `ts` is strictly after `afterTs`. */
|
|
178
|
+
export function isSlackTsAfter(ts, afterTs) {
|
|
179
|
+
return compareSlackTs(ts, afterTs) > 0;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Merge triggering messages (by ts) into a replies window when Slack lag
|
|
183
|
+
* omits them from `conversations.replies`.
|
|
184
|
+
*/
|
|
185
|
+
export function mergeThreadMessagesByTs(messages, extras) {
|
|
186
|
+
const byTs = new Map();
|
|
187
|
+
for (const message of messages) {
|
|
188
|
+
const ts = asString(message.ts);
|
|
189
|
+
if (ts !== undefined && ts !== "") {
|
|
190
|
+
byTs.set(ts, message);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
for (const extra of extras) {
|
|
194
|
+
const ts = asString(extra.ts);
|
|
195
|
+
if (ts === undefined || ts === "") {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (!byTs.has(ts)) {
|
|
199
|
+
byTs.set(ts, extra);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return [...byTs.values()].sort((a, b) => { var _a, _b; return compareSlackTs((_a = asString(a.ts)) !== null && _a !== void 0 ? _a : "0", (_b = asString(b.ts)) !== null && _b !== void 0 ? _b : "0"); });
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Latest bot-authored message ts in a thread (own posts), used as the warm
|
|
206
|
+
* delta watermark when channel state has not recorded one yet.
|
|
207
|
+
*/
|
|
208
|
+
export function findLastBotMessageTs(messages, options) {
|
|
209
|
+
const restrictToSelf = ((options === null || options === void 0 ? void 0 : options.botUserId) !== undefined && options.botUserId !== "") ||
|
|
210
|
+
((options === null || options === void 0 ? void 0 : options.botId) !== undefined && options.botId !== "");
|
|
211
|
+
let last;
|
|
212
|
+
for (const message of messages) {
|
|
213
|
+
const ts = asString(message.ts);
|
|
214
|
+
if (ts === undefined || ts === "") {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const userId = asString(message.user);
|
|
218
|
+
const botId = asString(message.bot_id);
|
|
219
|
+
const isBot = restrictToSelf
|
|
220
|
+
? ((options === null || options === void 0 ? void 0 : options.botUserId) !== undefined &&
|
|
221
|
+
options.botUserId !== "" &&
|
|
222
|
+
userId !== undefined &&
|
|
223
|
+
userId === options.botUserId) ||
|
|
224
|
+
((options === null || options === void 0 ? void 0 : options.botId) !== undefined &&
|
|
225
|
+
options.botId !== "" &&
|
|
226
|
+
botId !== undefined &&
|
|
227
|
+
botId === options.botId)
|
|
228
|
+
: message.subtype === "bot_message" ||
|
|
229
|
+
(botId !== undefined && botId !== "") ||
|
|
230
|
+
((options === null || options === void 0 ? void 0 : options.botUserId) !== undefined &&
|
|
231
|
+
userId !== undefined &&
|
|
232
|
+
userId === options.botUserId) ||
|
|
233
|
+
((options === null || options === void 0 ? void 0 : options.botId) !== undefined &&
|
|
234
|
+
botId !== undefined &&
|
|
235
|
+
botId === options.botId);
|
|
236
|
+
if (!isBot) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (last === undefined || isSlackTsAfter(ts, last)) {
|
|
240
|
+
last = ts;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return last;
|
|
244
|
+
}
|
|
245
|
+
/** Messages strictly after `afterTs`, excluding listed timestamps. */
|
|
246
|
+
export function selectThreadDeltaMessages(messages, options) {
|
|
247
|
+
var _a;
|
|
248
|
+
var _b;
|
|
249
|
+
const exclude = excludeTimestampSet(options.excludeTs);
|
|
250
|
+
const afterTs = (_b = (_a = options.afterTs) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "";
|
|
251
|
+
return messages.filter((message) => {
|
|
252
|
+
const ts = asString(message.ts);
|
|
253
|
+
if (ts === undefined || ts === "") {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
if (exclude !== undefined && exclude.has(ts)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
if (afterTs !== "" && !isSlackTsAfter(ts, afterTs)) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return slackApiMessageBody(message).trim() !== "";
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
export function formatSlackThreadContextBlock(messages, options) {
|
|
266
|
+
var _a;
|
|
267
|
+
const threadTs = options === null || options === void 0 ? void 0 : options.threadTs;
|
|
268
|
+
const maxChars = (_a = options === null || options === void 0 ? void 0 : options.maxChars) !== null && _a !== void 0 ? _a : DEFAULT_MAX_CHARS;
|
|
269
|
+
const prior = threadTs !== undefined && threadTs !== ""
|
|
270
|
+
? trimThreadMessagesForPrompt(messages, {
|
|
271
|
+
threadTs,
|
|
272
|
+
limit: DEFAULT_REPLY_LIMIT,
|
|
273
|
+
excludeTs: options === null || options === void 0 ? void 0 : options.excludeTs,
|
|
274
|
+
})
|
|
275
|
+
: messages.filter((message) => {
|
|
276
|
+
const ts = asString(message.ts);
|
|
277
|
+
if (ts === undefined || ts === "") {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
const exclude = excludeTimestampSet(options === null || options === void 0 ? void 0 : options.excludeTs);
|
|
281
|
+
if (exclude !== undefined && exclude.has(ts)) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
return slackApiMessageBody(message).trim() !== "";
|
|
285
|
+
});
|
|
286
|
+
if (prior.length === 0) {
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
const lines = ["<slack_thread>"];
|
|
290
|
+
for (let i = 0; i < prior.length; i++) {
|
|
291
|
+
const ts = asString(prior[i].ts);
|
|
292
|
+
const entryRole = threadTs !== undefined
|
|
293
|
+
? ts === threadTs
|
|
294
|
+
? "parent"
|
|
295
|
+
: "reply"
|
|
296
|
+
: i === 0
|
|
297
|
+
? "parent"
|
|
298
|
+
: "reply";
|
|
299
|
+
lines.push(formatThreadEntry(prior[i], entryRole));
|
|
300
|
+
lines.push("");
|
|
301
|
+
}
|
|
302
|
+
lines.push("</slack_thread>");
|
|
303
|
+
let block = lines.join("\n").trimEnd();
|
|
304
|
+
if (block.length > maxChars) {
|
|
305
|
+
block = `${block.slice(0, Math.max(0, maxChars - 80))}\n…(truncated; older thread content omitted)\n</slack_thread>`;
|
|
306
|
+
}
|
|
307
|
+
return block;
|
|
308
|
+
}
|
|
309
|
+
export function formatSlackThreadDeltaBlock(messages, options) {
|
|
310
|
+
var _a;
|
|
311
|
+
const maxChars = (_a = options === null || options === void 0 ? void 0 : options.maxChars) !== null && _a !== void 0 ? _a : DEFAULT_MAX_CHARS;
|
|
312
|
+
const delta = selectThreadDeltaMessages(messages, {
|
|
313
|
+
afterTs: options === null || options === void 0 ? void 0 : options.afterTs,
|
|
314
|
+
excludeTs: options === null || options === void 0 ? void 0 : options.excludeTs,
|
|
315
|
+
});
|
|
316
|
+
if (delta.length === 0) {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
const lines = [
|
|
320
|
+
"<slack_thread_delta>",
|
|
321
|
+
"Thread messages since your last post (or the latest new replies):",
|
|
322
|
+
"",
|
|
323
|
+
];
|
|
324
|
+
for (const message of delta) {
|
|
325
|
+
lines.push(formatThreadEntry(message, "reply"));
|
|
326
|
+
lines.push("");
|
|
327
|
+
}
|
|
328
|
+
lines.push("</slack_thread_delta>");
|
|
329
|
+
let block = lines.join("\n").trimEnd();
|
|
330
|
+
if (block.length > maxChars) {
|
|
331
|
+
block = `${block.slice(0, Math.max(0, maxChars - 80))}\n…(truncated)\n</slack_thread_delta>`;
|
|
332
|
+
}
|
|
333
|
+
return block;
|
|
334
|
+
}
|
|
335
|
+
function fetchThreadMessages(args) {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
const allMessages = [];
|
|
338
|
+
let cursor;
|
|
339
|
+
let exhaustedPageBudget = false;
|
|
340
|
+
try {
|
|
341
|
+
for (let page = 0; page < REPLIES_MAX_PAGES; page++) {
|
|
342
|
+
const result = yield callSlackApiSoft({
|
|
343
|
+
botToken: args.botToken,
|
|
344
|
+
operation: "conversations.replies",
|
|
345
|
+
body: Object.assign({ channel: args.channelId, ts: args.threadTs, limit: REPLIES_PAGE_LIMIT, inclusive: true }, (cursor === undefined ? {} : { cursor })),
|
|
346
|
+
});
|
|
347
|
+
if (!result.ok) {
|
|
348
|
+
args.log.warn("thread context fetch not-ok", {
|
|
349
|
+
channel: args.channelId,
|
|
350
|
+
thread_ts: args.threadTs,
|
|
351
|
+
error: result.error,
|
|
352
|
+
});
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
const pageMessages = Array.isArray(result.messages)
|
|
356
|
+
? result.messages
|
|
357
|
+
.map(asRecord)
|
|
358
|
+
.filter((m) => m !== null)
|
|
359
|
+
: [];
|
|
360
|
+
allMessages.push(...pageMessages);
|
|
361
|
+
const nextCursor = typeof result.response_metadata === "object" &&
|
|
362
|
+
result.response_metadata !== null &&
|
|
363
|
+
!Array.isArray(result.response_metadata)
|
|
364
|
+
? asString(result.response_metadata.next_cursor)
|
|
365
|
+
: undefined;
|
|
366
|
+
const hasMore = result.has_more === true;
|
|
367
|
+
cursor =
|
|
368
|
+
nextCursor !== undefined && nextCursor !== "" ? nextCursor : undefined;
|
|
369
|
+
if (!hasMore || cursor === undefined) {
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
if (page === REPLIES_MAX_PAGES - 1) {
|
|
373
|
+
exhaustedPageBudget = true;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
catch (error) {
|
|
378
|
+
args.log.warn("thread context fetch failed", {
|
|
379
|
+
channel: args.channelId,
|
|
380
|
+
thread_ts: args.threadTs,
|
|
381
|
+
error: error instanceof Error ? error.message : String(error),
|
|
382
|
+
});
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
if (exhaustedPageBudget) {
|
|
386
|
+
args.log.warn("thread context pagination budget exhausted", {
|
|
387
|
+
channel: args.channelId,
|
|
388
|
+
thread_ts: args.threadTs,
|
|
389
|
+
fetched: allMessages.length,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
return allMessages;
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Load prior messages in a Slack thread and return a prompt context block.
|
|
397
|
+
* Soft-fails (returns undefined) when credentials are missing or the API errors.
|
|
398
|
+
*/
|
|
399
|
+
export function loadSlackThreadContextBlock(args) {
|
|
400
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
+
var _a, _b;
|
|
402
|
+
const log = (_a = args.log) !== null && _a !== void 0 ? _a : defaultSlackLog;
|
|
403
|
+
if (args.botToken === undefined) {
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
if (args.channelId === "" || args.threadTs === "") {
|
|
407
|
+
return undefined;
|
|
408
|
+
}
|
|
409
|
+
const replyLimit = (_b = args.limit) !== null && _b !== void 0 ? _b : DEFAULT_REPLY_LIMIT;
|
|
410
|
+
const fetched = yield fetchThreadMessages({
|
|
411
|
+
botToken: args.botToken,
|
|
412
|
+
channelId: args.channelId,
|
|
413
|
+
threadTs: args.threadTs,
|
|
414
|
+
log,
|
|
415
|
+
});
|
|
416
|
+
if (fetched === undefined) {
|
|
417
|
+
return undefined;
|
|
418
|
+
}
|
|
419
|
+
const allMessages = args.mergeMessages === undefined || args.mergeMessages.length === 0
|
|
420
|
+
? fetched
|
|
421
|
+
: mergeThreadMessagesByTs(fetched, args.mergeMessages);
|
|
422
|
+
const trimmed = trimThreadMessagesForPrompt(allMessages, {
|
|
423
|
+
threadTs: args.threadTs,
|
|
424
|
+
limit: replyLimit,
|
|
425
|
+
excludeTs: args.excludeTs,
|
|
426
|
+
});
|
|
427
|
+
return formatSlackThreadContextBlock(trimmed, {
|
|
428
|
+
threadTs: args.threadTs,
|
|
429
|
+
maxChars: args.maxChars,
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Warm-turn delta: messages since the last bot post (or all new replies when
|
|
435
|
+
* the watermark is unknown), with optional merge-by-ts for the triggering ask.
|
|
436
|
+
*/
|
|
437
|
+
export function loadSlackThreadDeltaBlock(args) {
|
|
438
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
439
|
+
var _a;
|
|
440
|
+
const log = (_a = args.log) !== null && _a !== void 0 ? _a : defaultSlackLog;
|
|
441
|
+
if (args.botToken === undefined) {
|
|
442
|
+
return undefined;
|
|
443
|
+
}
|
|
444
|
+
if (args.channelId === "" || args.threadTs === "") {
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
447
|
+
const fetched = yield fetchThreadMessages({
|
|
448
|
+
botToken: args.botToken,
|
|
449
|
+
channelId: args.channelId,
|
|
450
|
+
threadTs: args.threadTs,
|
|
451
|
+
log,
|
|
452
|
+
});
|
|
453
|
+
if (fetched === undefined) {
|
|
454
|
+
return undefined;
|
|
455
|
+
}
|
|
456
|
+
const allMessages = args.mergeMessages === undefined || args.mergeMessages.length === 0
|
|
457
|
+
? fetched
|
|
458
|
+
: mergeThreadMessagesByTs(fetched, args.mergeMessages);
|
|
459
|
+
const afterTs = args.afterTs !== undefined && args.afterTs.trim() !== ""
|
|
460
|
+
? args.afterTs.trim()
|
|
461
|
+
: findLastBotMessageTs(allMessages, Object.assign(Object.assign({}, (args.botUserId === undefined
|
|
462
|
+
? {}
|
|
463
|
+
: { botUserId: args.botUserId })), (args.botId === undefined ? {} : { botId: args.botId })));
|
|
464
|
+
return formatSlackThreadDeltaBlock(allMessages, {
|
|
465
|
+
afterTs,
|
|
466
|
+
excludeTs: args.excludeTs,
|
|
467
|
+
maxChars: args.maxChars,
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
}
|
|
@@ -46,6 +46,11 @@ export interface SlackChannelState {
|
|
|
46
46
|
streamChannelId?: string | null;
|
|
47
47
|
/** Last cumulative text sent via appendStream (for incremental append). */
|
|
48
48
|
lastPostedText?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Slack message ts of the agent's last delivered reply in this thread.
|
|
51
|
+
* Warm turns use this as the `<slack_thread_delta>` watermark.
|
|
52
|
+
*/
|
|
53
|
+
lastBotMessageTs?: string | null;
|
|
49
54
|
/**
|
|
50
55
|
* When true, stream APIs failed for this session — use postMessage
|
|
51
56
|
* for the rest of the turn.
|
|
@@ -58,9 +63,12 @@ export interface SlackChannelState {
|
|
|
58
63
|
approvalMessageByCallId?: Record<string, string>;
|
|
59
64
|
}
|
|
60
65
|
export interface SlackAuthor {
|
|
66
|
+
/** Slack user id. Empty string for bot posts with no `user` field. */
|
|
61
67
|
userId: string;
|
|
62
68
|
userName?: string;
|
|
63
69
|
isBot: boolean;
|
|
70
|
+
/** Posting app's `bot_id` (`B…`) when the message is bot-authored. */
|
|
71
|
+
botId?: string;
|
|
64
72
|
}
|
|
65
73
|
export interface SlackMessage {
|
|
66
74
|
text: string;
|
|
@@ -106,6 +114,11 @@ export interface SlackDispatchDecision {
|
|
|
106
114
|
* cloud conversation (e.g. per-PR `bc-…` affinity).
|
|
107
115
|
*/
|
|
108
116
|
sdkAgentId?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Additional Slack message timestamps to omit from `<slack_thread>` hydration
|
|
119
|
+
* (e.g. every message in a coalesced batch already folded into `message`).
|
|
120
|
+
*/
|
|
121
|
+
excludeThreadTimestamps?: readonly string[];
|
|
109
122
|
}
|
|
110
123
|
export interface SlackSuggestedPrompt {
|
|
111
124
|
title: string;
|
|
@@ -161,6 +174,13 @@ export interface SlackChannelPostsOptions {
|
|
|
161
174
|
* the Cursor relay does not deliver edits/deletes.
|
|
162
175
|
*/
|
|
163
176
|
debounceMs?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Also dispatch bot-authored posts (alert feeds, webhook integrations,
|
|
179
|
+
* other agents posting notes). Defaults to `false` — human posts only.
|
|
180
|
+
* The watching bot's own posts are always dropped regardless (loop
|
|
181
|
+
* safety), matched by the app's `bot_id` / bot user id from `auth.test`.
|
|
182
|
+
*/
|
|
183
|
+
includeBotPosts?: boolean;
|
|
164
184
|
}
|
|
165
185
|
/**
|
|
166
186
|
* How the agent engages over Slack. Omitted entirely = mentions + DMs,
|
|
@@ -307,6 +327,13 @@ export interface SlackChannelOptions {
|
|
|
307
327
|
*/
|
|
308
328
|
suggestedPrompts?: SlackSuggestedPrompt[];
|
|
309
329
|
suggestedPromptsTitle?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Rotating `assistant.threads.setStatus` loading lines (Slack caps each
|
|
332
|
+
* entry at 50 chars). Defaults to Thinking… / Working on it… / Almost there….
|
|
333
|
+
*/
|
|
334
|
+
loadingMessages?: string[];
|
|
335
|
+
/** Optional teardown (e.g. stop example-local debouncers). Runs after Socket Mode stops. */
|
|
336
|
+
onStop?: () => void | Promise<void>;
|
|
310
337
|
}
|
|
311
338
|
export interface SlackManifestOptions {
|
|
312
339
|
/** Display name for the Slack app. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CACF,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrC;AAED,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAChC,iBAAiB,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;CACtD;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gBAAg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K,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D;AAED,wDAAwD;AACxD,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzD,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,CAAC,CAAC,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
package/dist/docs/404.html
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/docs/assets/style.Bj-IXa5W.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/docs/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/docs/assets/app.
|
|
12
|
+
<script type="module" src="/docs/assets/app.BP8mAVMW.js"></script>
|
|
13
13
|
<link rel="preload" href="/docs/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
|
14
14
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
15
15
|
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
|
19
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"BMCZ6Hd7\",\"building-with-agents.md\":\"CJCtZCyi\",\"concepts.md\":\"Cfb9b-k1\",\"deployment.md\":\"BtfEsc9S\",\"evals.md\":\"DAgEc_hL\",\"example-agents_approval-buddy.md\":\"8R5phXb5\",\"example-agents_benny.md\":\"B0gjhI-p\",\"example-agents_bugbot.md\":\"DelIdhxB\",\"example-agents_codebase-wiki.md\":\"DC6sgwn0\",\"example-agents_codeowners-review.md\":\"Ku_tG2RY\",\"example-agents_concierge.md\":\"4rQTSMXt\",\"example-agents_fsd.md\":\"CzgUrDfi\",\"example-agents_index.md\":\"
|
|
19
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"BMCZ6Hd7\",\"building-with-agents.md\":\"CJCtZCyi\",\"concepts.md\":\"Cfb9b-k1\",\"deployment.md\":\"BtfEsc9S\",\"evals.md\":\"DAgEc_hL\",\"example-agents_approval-buddy.md\":\"8R5phXb5\",\"example-agents_benny.md\":\"B0gjhI-p\",\"example-agents_bugbot.md\":\"DelIdhxB\",\"example-agents_codebase-wiki.md\":\"DC6sgwn0\",\"example-agents_codeowners-review.md\":\"Ku_tG2RY\",\"example-agents_concierge.md\":\"4rQTSMXt\",\"example-agents_fsd.md\":\"CzgUrDfi\",\"example-agents_index.md\":\"CwtWu5ix\",\"example-agents_knowledge-base.md\":\"BPJiVueF\",\"example-agents_oncall.md\":\"BG_sUMly\",\"example-agents_security-reviewer.md\":\"D2rtwDTO\",\"example-agents_slack-agent.md\":\"buLbgvBf\",\"example-agents_weather-agent.md\":\"C9Qv-W0o\",\"guides_agent-to-agent.md\":\"Bpzgq2Pq\",\"guides_cloud-runtime.md\":\"gVzabdQL\",\"guides_github.md\":\"DOOCpqsW\",\"guides_human-in-the-loop.md\":\"DlUqsp1S\",\"guides_slack.md\":\"FWale6Ip\",\"guides_webhooks.md\":\"B1EswtUu\",\"hillclimbing.md\":\"DHNast08\",\"index.md\":\"COiu-1jL\",\"quickstart.md\":\"BU6Iwi_9\",\"reference_agent-config.md\":\"DrW2JUM8\",\"reference_channels.md\":\"DdmiKgqf\",\"reference_cli.md\":\"D189RBCH\",\"reference_connections.md\":\"zaEYCLHT\",\"reference_hooks.md\":\"DyLVfE1O\",\"reference_http-api.md\":\"Dx_nmDG6\",\"reference_instructions.md\":\"CgoV-YEb\",\"reference_playground.md\":\"CPZhfYaO\",\"reference_project-layout.md\":\"Bd_CKtNS\",\"reference_schedules.md\":\"w_F2mXB6\",\"reference_sessions.md\":\"DLd6mvbv\",\"reference_skills.md\":\"B_jHN7JL\",\"reference_subagents.md\":\"zWAMNfi1\",\"reference_tools.md\":\"CqgJroI0\",\"scaffolding-agents.md\":\"C3pTrmoE\",\"storage.md\":\"Cu3MwM2a\",\"troubleshooting.md\":\"DkovjS7h\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"agentkit\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Examples\",\"link\":\"/example-agents/\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Cloud runtime\",\"link\":\"/guides/cloud-runtime\"}]},{\"text\":\"Example agents\",\"items\":[{\"text\":\"Choose an example\",\"link\":\"/example-agents/\"},{\"text\":\"Weather agent\",\"link\":\"/example-agents/weather-agent\"},{\"text\":\"Slack agent\",\"link\":\"/example-agents/slack-agent\"},{\"text\":\"Concierge\",\"link\":\"/example-agents/concierge\"},{\"text\":\"Playbook router\",\"link\":\"/example-agents/benny\"},{\"text\":\"Alert investigator\",\"link\":\"/example-agents/oncall\"},{\"text\":\"PR evidence reviewer\",\"link\":\"/example-agents/bugbot\"},{\"text\":\"Approval Buddy\",\"link\":\"/example-agents/approval-buddy\"},{\"text\":\"Security Reviewer\",\"link\":\"/example-agents/security-reviewer\"},{\"text\":\"Remote PR coordinator\",\"link\":\"/example-agents/fsd\"},{\"text\":\"Knowledge base\",\"link\":\"/example-agents/knowledge-base\"},{\"text\":\"Codebase wiki\",\"link\":\"/example-agents/codebase-wiki\"},{\"text\":\"Codeowners review\",\"link\":\"/example-agents/codeowners-review\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
20
20
|
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|