@cursor/july 0.1.1 → 0.1.2
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/AGENTS.md +24 -2
- package/README.md +25 -15
- package/dist/bin/agent-serve.js +101 -12
- package/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +31 -14
- package/dist/channels/github/cursor-account.d.ts +43 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +95 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +46 -9
- package/dist/channels/github/index.d.ts +2 -2
- package/dist/channels/github/index.js +2 -2
- package/dist/channels/github/types.d.ts +17 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.d.ts +8 -2
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +8 -0
- package/dist/channels/slack/types.d.ts +24 -3
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/types.js +15 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +8 -8
- package/dist/docs/assets/{ab.md.COdXkces.js → ab.md.BMCZ6Hd7.js} +3 -3
- package/dist/docs/assets/{ab.md.COdXkces.lean.js → ab.md.BMCZ6Hd7.lean.js} +1 -1
- package/dist/docs/assets/{app.DqfFEmJd.js → app.Oje4vhlk.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.zwQ9RCQ7.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BaLEdS15.js → VPLocalSearchBox.H5XZ2zCB.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CZRvu_0q.js → theme.CTR_TuaE.js} +2 -2
- package/dist/docs/assets/{deployment.md.Dx1TYNk5.js → deployment.md.DTKwE15Z.js} +3 -3
- package/dist/docs/assets/{deployment.md.Dx1TYNk5.lean.js → deployment.md.DTKwE15Z.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.DPZ_MAnI.js → evals.md.DAgEc_hL.js} +3 -3
- package/dist/docs/assets/{guides_agent-to-agent.md.CrtrsySy.js → guides_agent-to-agent.md.Bpzgq2Pq.js} +1 -1
- package/dist/docs/assets/{guides_cloud-runtime.md.CYlNMTNp.js → guides_cloud-runtime.md.gVzabdQL.js} +1 -1
- package/dist/docs/assets/{guides_github.md.DwbKhCeS.js → guides_github.md.DOOCpqsW.js} +11 -4
- package/dist/docs/assets/{guides_github.md.DwbKhCeS.lean.js → guides_github.md.DOOCpqsW.lean.js} +1 -1
- package/dist/docs/assets/{guides_human-in-the-loop.md.Dvuctx7s.js → guides_human-in-the-loop.md.DlUqsp1S.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.bv41fHfW.js → guides_slack.md.CCwqHvSV.js} +4 -4
- package/dist/docs/assets/{guides_slack.md.bv41fHfW.lean.js → guides_slack.md.CCwqHvSV.lean.js} +1 -1
- package/dist/docs/assets/{guides_webhooks.md.hFTik3lf.js → guides_webhooks.md.B1EswtUu.js} +2 -2
- package/dist/docs/assets/index.md.m81y7TY7.js +20 -0
- package/dist/docs/assets/{index.md.BPKcj5AI.lean.js → index.md.m81y7TY7.lean.js} +1 -1
- package/dist/docs/assets/quickstart.md.CfU8_uTC.js +192 -0
- package/dist/docs/assets/quickstart.md.CfU8_uTC.lean.js +1 -0
- package/dist/docs/assets/{reference_agent-config.md.Bpd7HQwf.js → reference_agent-config.md.DrW2JUM8.js} +4 -4
- package/dist/docs/assets/{reference_agent-config.md.Bpd7HQwf.lean.js → reference_agent-config.md.DrW2JUM8.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.D7JTR03W.js → reference_channels.md.DdmiKgqf.js} +4 -4
- package/dist/docs/assets/{reference_channels.md.D7JTR03W.lean.js → reference_channels.md.DdmiKgqf.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.C3vNH_DE.js → reference_connections.md.zaEYCLHT.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.BCEc3MyM.js → reference_hooks.md.DyLVfE1O.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.BCEc3MyM.lean.js → reference_hooks.md.DyLVfE1O.lean.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.DBAahtdz.js → reference_http-api.md.Dx_nmDG6.js} +1 -1
- package/dist/docs/assets/{reference_instructions.md.BC05LEQ8.js → reference_instructions.md.CgoV-YEb.js} +9 -7
- package/dist/docs/assets/{reference_instructions.md.BC05LEQ8.lean.js → reference_instructions.md.CgoV-YEb.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.D7qijxLk.js → reference_schedules.md.w_F2mXB6.js} +2 -2
- package/dist/docs/assets/{reference_skills.md.VQnlBT3Q.js → reference_skills.md.B_jHN7JL.js} +3 -3
- package/dist/docs/assets/{reference_skills.md.VQnlBT3Q.lean.js → reference_skills.md.B_jHN7JL.lean.js} +1 -1
- package/dist/docs/assets/{reference_subagents.md.CIRAVcPK.js → reference_subagents.md.zWAMNfi1.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.DF5kwlt0.js → reference_tools.md.CqgJroI0.js} +2 -2
- package/dist/docs/assets/scaffolding-agents.md.C3pTrmoE.js +1 -0
- package/dist/docs/assets/scaffolding-agents.md.C3pTrmoE.lean.js +1 -0
- package/dist/docs/assets/storage.md.CVnInNiN.js +17 -0
- package/dist/docs/assets/storage.md.CVnInNiN.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 +7 -7
- package/dist/docs/evals.html +7 -7
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/cloud-runtime.html +5 -5
- package/dist/docs/guides/github.html +14 -7
- package/dist/docs/guides/human-in-the-loop.html +6 -6
- package/dist/docs/guides/slack.html +8 -8
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +5 -5
- package/dist/docs/index.html +7 -7
- package/dist/docs/quickstart.html +180 -23
- package/dist/docs/reference/agent-config.html +7 -7
- package/dist/docs/reference/channels.html +8 -8
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +5 -5
- package/dist/docs/reference/hooks.html +5 -5
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/instructions.html +13 -11
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/schedules.html +7 -7
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/tools.html +7 -7
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/storage.html +41 -0
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/cli-deploy.d.ts +52 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +731 -0
- package/dist/internal/cursor/backend-client.d.ts +10 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +79 -1
- package/dist/internal/cursor/github-credentials.d.ts +44 -0
- package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
- package/dist/internal/cursor/github-credentials.js +195 -0
- package/dist/internal/deploy-client.d.ts +176 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +375 -0
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +73 -5
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +1 -0
- package/dist/internal/eval-run-store.d.ts +22 -3
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-run-store.js +37 -19
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
- package/dist/internal/handleAgentServeTrigger.js +10 -12
- package/dist/internal/host-platforms.d.ts +7 -2
- package/dist/internal/host-platforms.d.ts.map +1 -1
- package/dist/internal/host-platforms.js +15 -10
- package/dist/internal/hosting.d.ts +37 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +67 -0
- package/dist/internal/reminder-runner.d.ts +7 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +50 -6
- package/dist/internal/reminder-store.d.ts +2 -0
- package/dist/internal/reminder-store.d.ts.map +1 -1
- package/dist/internal/reminder-store.js +18 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +173 -42
- package/dist/internal/session-engine.d.ts +49 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +246 -17
- package/dist/internal/storage-coordinator.d.ts +139 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +499 -0
- package/dist/playground/assets/cursor-icons-outline-BxTT_FVJ.woff2 +0 -0
- package/dist/playground/assets/index-B1Qc9h2u.css +1 -0
- package/dist/playground/assets/{index-FlWjhg3x.js → index-CpDYCj8W.js} +42 -42
- package/dist/playground/index.html +2 -2
- package/dist/storage.d.ts +204 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +153 -0
- package/dist/types.d.ts +44 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +3 -2
- package/docs/guides/github.md +43 -8
- package/docs/guides/slack.md +1 -1
- package/docs/quickstart.md +329 -51
- package/docs/reference/instructions.md +8 -6
- package/docs/scaffolding-agents.md +1 -1
- package/docs/storage.md +98 -0
- package/package.json +8 -1
- package/skills/github/SKILL.md +9 -1
- package/src/bin/agent-serve.ts +139 -0
- package/src/channels/github/api.ts +42 -23
- package/src/channels/github/cursor-account.ts +165 -0
- package/src/channels/github/github-channel.ts +66 -6
- package/src/channels/github/index.ts +2 -2
- package/src/channels/github/types.ts +19 -0
- package/src/channels/slack/slack-channel.ts +17 -3
- package/src/channels/slack/types.ts +44 -3
- package/src/index.ts +13 -0
- package/src/internal/cli-deploy.ts +940 -0
- package/src/internal/cursor/backend-client.ts +103 -1
- package/src/internal/cursor/github-credentials.ts +248 -0
- package/src/internal/deploy-client.ts +591 -0
- package/src/internal/discovery.ts +88 -1
- package/src/internal/distribution.ts +1 -0
- package/src/internal/eval-run-store.ts +48 -19
- package/src/internal/handleAgentServeTrigger.ts +10 -12
- package/src/internal/host-platforms.ts +28 -11
- package/src/internal/hosting.ts +77 -0
- package/src/internal/reminder-runner.ts +50 -6
- package/src/internal/reminder-store.ts +21 -0
- package/src/internal/server.ts +213 -27
- package/src/internal/session-engine.ts +285 -7
- package/src/internal/storage-coordinator.ts +615 -0
- package/src/storage.ts +325 -0
- package/src/types.ts +40 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.CcVk1uKq.js +0 -1
- package/dist/docs/assets/index.md.BPKcj5AI.js +0 -20
- package/dist/docs/assets/quickstart.md.tVPiGK_L.js +0 -35
- package/dist/docs/assets/quickstart.md.tVPiGK_L.lean.js +0 -1
- package/dist/docs/assets/scaffolding-agents.md.CyYfWGdc.js +0 -1
- package/dist/docs/assets/scaffolding-agents.md.CyYfWGdc.lean.js +0 -1
- package/dist/playground/assets/cursor-icons-outline-oY2V_mvK.woff2 +0 -0
- package/dist/playground/assets/index-1K-hG-7p.css +0 -1
- /package/dist/docs/assets/{evals.md.DPZ_MAnI.lean.js → evals.md.DAgEc_hL.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.CrtrsySy.lean.js → guides_agent-to-agent.md.Bpzgq2Pq.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.CYlNMTNp.lean.js → guides_cloud-runtime.md.gVzabdQL.lean.js} +0 -0
- /package/dist/docs/assets/{guides_human-in-the-loop.md.Dvuctx7s.lean.js → guides_human-in-the-loop.md.DlUqsp1S.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.hFTik3lf.lean.js → guides_webhooks.md.B1EswtUu.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.C3vNH_DE.lean.js → reference_connections.md.zaEYCLHT.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.DBAahtdz.lean.js → reference_http-api.md.Dx_nmDG6.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.D7qijxLk.lean.js → reference_schedules.md.w_F2mXB6.lean.js} +0 -0
- /package/dist/docs/assets/{reference_subagents.md.CIRAVcPK.lean.js → reference_subagents.md.zWAMNfi1.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.DF5kwlt0.lean.js → reference_tools.md.CqgJroI0.lean.js} +0 -0
package/dist/internal/server.js
CHANGED
|
@@ -35,12 +35,15 @@ import { Buffer } from "node:buffer";
|
|
|
35
35
|
import { once } from "node:events";
|
|
36
36
|
import { createServer, } from "node:http";
|
|
37
37
|
import { join } from "node:path";
|
|
38
|
+
import { createCursorAccountGithubTokenResolver, getGithubCursorAccountRuntime, parseCursorGithubRepoScope, resolveCursorGithubPermissions, } from "../channels/github/cursor-account.js";
|
|
38
39
|
import { findGitHubChannelTargets } from "../channels/github/forward.js";
|
|
39
40
|
import { dispatchCursorSlackEnvelope, getSlackCursorAccountRuntime, } from "../channels/slack/cursor-account.js";
|
|
41
|
+
import { assertSlackCursorAgentName } from "../channels/slack/types.js";
|
|
40
42
|
import { allowAll, bearerAuth, localDevStrict } from "../channels.js";
|
|
41
43
|
import { CursorAccountMcpBridge, collectCursorAccountConnections, cursorAccountMcpPath, } from "./cursor/account-mcp.js";
|
|
42
44
|
import { CursorBackendClient } from "./cursor/backend-client.js";
|
|
43
45
|
import { cursorBackendUrl, resolveApiKey, SIGN_IN_HINT, } from "./cursor/credentials.js";
|
|
46
|
+
import { CursorGithubCredentialProvider } from "./cursor/github-credentials.js";
|
|
44
47
|
import { CursorEventRelay, formatCursorScmEventLog, scmMetadataToGitHubPayload, } from "./cursor-event-relay.js";
|
|
45
48
|
import { CursorSlackRelay, createCursorSlackApiCaller, formatCursorSlackEventLog, } from "./cursor-slack-relay.js";
|
|
46
49
|
import { formatDiagnostics, hasErrorDiagnostics, projectInfo, } from "./discovery.js";
|
|
@@ -48,7 +51,7 @@ import { packageVersion } from "./distribution.js";
|
|
|
48
51
|
import { docsSiteExists, ensureDocsSiteBundle, renderDocsFile, } from "./docs-site.js";
|
|
49
52
|
import { EvalRunConflictError, EvalRunEmptyError, EvalRunStore, } from "./eval-run-store.js";
|
|
50
53
|
import { collectGitHubTriggerTargets, handleAgentServeTrigger, } from "./handleAgentServeTrigger.js";
|
|
51
|
-
import { warmupHostGitHubAuth } from "./host-platforms.js";
|
|
54
|
+
import { createHostPlatforms, warmupHostGitHubAuth } from "./host-platforms.js";
|
|
52
55
|
import { buildHttpChannelRoutes, errorResponse, jsonResponse, readJsonObject, requireSessionOwner, } from "./http-channel.js";
|
|
53
56
|
import { validateToolInput } from "./json-schema.js";
|
|
54
57
|
import { createLogRing } from "./log-ring.js";
|
|
@@ -72,9 +75,9 @@ const MAX_BODY_BYTES = 32 * 1024 * 1024;
|
|
|
72
75
|
*/
|
|
73
76
|
export function startServer(mounts_1) {
|
|
74
77
|
return __awaiter(this, arguments, void 0, function* (mounts, options = {}) {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
80
|
+
var _r;
|
|
78
81
|
if (mounts.length === 0) {
|
|
79
82
|
throw new Error("startServer requires at least one agent mount");
|
|
80
83
|
}
|
|
@@ -86,31 +89,70 @@ export function startServer(mounts_1) {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
const logRing = createLogRing({ capacity: 2000 });
|
|
89
|
-
const logger = logRing.wrap((
|
|
90
|
-
const dev = (
|
|
91
|
-
const playground = (
|
|
92
|
-
const runSchedules = (
|
|
93
|
-
const runReminders = (
|
|
92
|
+
const logger = logRing.wrap((_d = options.logger) !== null && _d !== void 0 ? _d : ((line) => console.log(line)));
|
|
93
|
+
const dev = (_e = options.dev) !== null && _e !== void 0 ? _e : false;
|
|
94
|
+
const playground = (_f = options.playground) !== null && _f !== void 0 ? _f : true;
|
|
95
|
+
const runSchedules = (_g = options.schedules) !== null && _g !== void 0 ? _g : !dev;
|
|
96
|
+
const runReminders = (_h = options.reminders) !== null && _h !== void 0 ? _h : !dev;
|
|
94
97
|
// Identify this process to the Cursor backend as agentkit (the SDK reads
|
|
95
98
|
// this when building its client-version header) so the internal-only
|
|
96
99
|
// agentkit_enabled gate applies to every turn.
|
|
97
|
-
(
|
|
100
|
+
(_j = (_r = process.env).CURSOR_AGENTKIT_VERSION) !== null && _j !== void 0 ? _j : (_r.CURSOR_AGENTKIT_VERSION = packageVersion());
|
|
101
|
+
const cursorGithubTargets = collectCursorGithubTargets(mounts);
|
|
102
|
+
const cursorGithubConfig = resolveCursorGithubEventConfig({
|
|
103
|
+
configured: options.cursorEvents,
|
|
104
|
+
targets: cursorGithubTargets,
|
|
105
|
+
});
|
|
106
|
+
const effectiveCursorEvents = cursorGithubConfig.cursorEvents;
|
|
98
107
|
// One resolution for every Cursor credential consumer (SDK runner, account
|
|
99
|
-
// MCP bridge, SCM event relay): explicit option →
|
|
100
|
-
// `agent-serve login`.
|
|
108
|
+
// MCP bridge, SCM event relay, GitHub credentials): explicit option →
|
|
109
|
+
// CURSOR_API_KEY → stored `agent-serve login`.
|
|
101
110
|
const accountKey = yield resolveApiKey(options.apiKey === undefined ? {} : { apiKey: options.apiKey });
|
|
102
111
|
// The SCM relay reads the event stream as the signed-in user, so
|
|
103
112
|
// `cursorEvents` cannot work signed out. Require the credential before any
|
|
104
113
|
// slow or stateful startup work (playground build, channel onStart, cron).
|
|
105
|
-
const cursorEventsAuth =
|
|
114
|
+
const cursorEventsAuth = effectiveCursorEvents === undefined
|
|
106
115
|
? undefined
|
|
107
|
-
: requireCursorEventsAuth(
|
|
116
|
+
: requireCursorEventsAuth(effectiveCursorEvents, accountKey);
|
|
117
|
+
let cursorGithubCredentials;
|
|
118
|
+
if (cursorGithubConfig.scope !== undefined) {
|
|
119
|
+
if (cursorEventsAuth === undefined) {
|
|
120
|
+
throw new Error("githubChannel({ cursorAccount: true }) could not resolve Cursor event authentication.");
|
|
121
|
+
}
|
|
122
|
+
if (options.allowAnonymous === true) {
|
|
123
|
+
throw new Error("githubChannel({ cursorAccount: true }) cannot be served with --allow-anonymous because admitted callers could use the signed-in account's GitHub access.");
|
|
124
|
+
}
|
|
125
|
+
if (cursorGithubConfig.scope.permissions === "contents-write") {
|
|
126
|
+
logger('[agent-serve] warning: Cursor GitHub credentials include contents:write — the host holds a push-capable token shared with model-driven tools and untrusted webhook content; prefer permissions: "pr-write" unless this agent must push code');
|
|
127
|
+
}
|
|
128
|
+
const provider = new CursorGithubCredentialProvider({
|
|
129
|
+
client: new CursorBackendClient({
|
|
130
|
+
backendUrl: cursorEventsAuth.baseUrl,
|
|
131
|
+
apiKey: cursorEventsAuth.apiKey,
|
|
132
|
+
logger,
|
|
133
|
+
}),
|
|
134
|
+
scope: cursorGithubConfig.scope,
|
|
135
|
+
logger,
|
|
136
|
+
});
|
|
137
|
+
cursorGithubCredentials = provider;
|
|
138
|
+
for (const target of cursorGithubTargets) {
|
|
139
|
+
target.accountRuntime.credentials.bind(() => provider.getToken());
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const resolvedCursorGithubCredentials = cursorGithubCredentials;
|
|
143
|
+
const hostPlatforms = createHostPlatforms(resolvedCursorGithubCredentials === undefined
|
|
144
|
+
? {}
|
|
145
|
+
: {
|
|
146
|
+
githubCredentials: {
|
|
147
|
+
token: createCursorAccountGithubTokenResolver(() => resolvedCursorGithubCredentials.getToken()),
|
|
148
|
+
},
|
|
149
|
+
});
|
|
108
150
|
if (playground) {
|
|
109
151
|
// Auto-build dist/playground when missing (monorepo / source checkout).
|
|
110
152
|
// Published installs already ship the bundle; vite may be absent there.
|
|
111
153
|
yield ensurePlaygroundBundle(logger);
|
|
112
154
|
}
|
|
113
|
-
const docsSite = (
|
|
155
|
+
const docsSite = (_k = options.docs) !== null && _k !== void 0 ? _k : true;
|
|
114
156
|
if (docsSite) {
|
|
115
157
|
// Same pattern for the documentation site at /docs.
|
|
116
158
|
yield ensureDocsSiteBundle(logger);
|
|
@@ -118,7 +160,7 @@ export function startServer(mounts_1) {
|
|
|
118
160
|
if (options.allowAnonymous === true) {
|
|
119
161
|
logger("[agent-serve] warning: --allow-anonymous admits every HTTP caller as the same principal; use only on a trusted network (e.g. Tailscale) and prefer --bearer-token for shared hosts");
|
|
120
162
|
}
|
|
121
|
-
const runner = (
|
|
163
|
+
const runner = (_l = options.runner) !== null && _l !== void 0 ? _l : new CursorSdkRunner(accountKey === undefined ? {} : { apiKey: accountKey.apiKey });
|
|
122
164
|
const router = new Router();
|
|
123
165
|
const runtimes = [];
|
|
124
166
|
const channelStopHooks = [];
|
|
@@ -155,18 +197,36 @@ export function startServer(mounts_1) {
|
|
|
155
197
|
}
|
|
156
198
|
for (const { slug, project } of mounts) {
|
|
157
199
|
// Each agent gets an isolated state root so their sessions never mix.
|
|
158
|
-
const baseStateRoot = (
|
|
200
|
+
const baseStateRoot = (_m = options.stateRoot) !== null && _m !== void 0 ? _m : join(project.rootDir, ".agent-serve");
|
|
159
201
|
const stateRoot = slug === "" ? baseStateRoot : join(baseStateRoot, slug);
|
|
160
|
-
const engine = new SessionEngine({
|
|
202
|
+
const engine = new SessionEngine({
|
|
203
|
+
project,
|
|
204
|
+
stateRoot,
|
|
205
|
+
runner,
|
|
206
|
+
logger,
|
|
207
|
+
platforms: hostPlatforms,
|
|
208
|
+
});
|
|
209
|
+
// Rehydrate sessions from the authored storage sink before any
|
|
210
|
+
// channel or route can address them (continuation tokens must resolve).
|
|
211
|
+
yield engine.restoreStoredSessions();
|
|
161
212
|
if (!githubAuthWarmed) {
|
|
162
213
|
// Soft ambient GitHub auth check before channel onStart (which may call
|
|
163
214
|
// host.github). Missing auth is a warning only — serve still starts.
|
|
164
|
-
yield warmupHostGitHubAuth({ logger, github: engine.host.github }
|
|
215
|
+
yield warmupHostGitHubAuth(Object.assign({ logger, github: engine.host.github }, (cursorGithubCredentials === undefined
|
|
216
|
+
? {}
|
|
217
|
+
: { authSource: "cursor-account" })));
|
|
165
218
|
githubAuthWarmed = true;
|
|
166
219
|
}
|
|
167
220
|
const scheduleRunner = new ScheduleRunner(engine, project, logger);
|
|
168
221
|
const reminderRunner = new ReminderRunner(engine, logger);
|
|
169
|
-
const evalRuns = new EvalRunStore(project.rootDir, logger
|
|
222
|
+
const evalRuns = new EvalRunStore(project.rootDir, logger,
|
|
223
|
+
// defineStorage fallback for playground eval history; explicit
|
|
224
|
+
// `evals.config.ts` persistRuns still wins inside the store.
|
|
225
|
+
(_b = engine.storage) === null || _b === void 0 ? void 0 : _b.asEvalRunPersistence());
|
|
226
|
+
// Eval history restores with the same startup step as sessions (reads
|
|
227
|
+
// also hydrate lazily, but doing it here surfaces store problems at
|
|
228
|
+
// boot and makes /v1/dev/evals complete from the first request).
|
|
229
|
+
yield evalRuns.hydrate();
|
|
170
230
|
engine.setReminders({
|
|
171
231
|
create: (input) => reminderRunner.create(input),
|
|
172
232
|
list: (filter) => reminderRunner.list(filter),
|
|
@@ -217,7 +277,7 @@ export function startServer(mounts_1) {
|
|
|
217
277
|
}
|
|
218
278
|
catch (error) {
|
|
219
279
|
logger(`[agent-serve] channel "${channel.id}" onStart failed: ${error instanceof Error
|
|
220
|
-
? ((
|
|
280
|
+
? ((_o = error.stack) !== null && _o !== void 0 ? _o : error.message)
|
|
221
281
|
: String(error)}`);
|
|
222
282
|
}
|
|
223
283
|
}
|
|
@@ -338,14 +398,6 @@ export function startServer(mounts_1) {
|
|
|
338
398
|
? {}
|
|
339
399
|
: { publicUrl: options.publicUrl })));
|
|
340
400
|
}
|
|
341
|
-
// Cursor SCM events relay (opt-in: serve({ cursorEvents }) / --cursor-events).
|
|
342
|
-
const cursorEventRelay = startCursorEventRelay({
|
|
343
|
-
options,
|
|
344
|
-
mounts,
|
|
345
|
-
auth: cursorEventsAuth,
|
|
346
|
-
logger,
|
|
347
|
-
collectTriggerTargets,
|
|
348
|
-
});
|
|
349
401
|
// Cursor Slack relay: automatic when a mounted agent authored
|
|
350
402
|
// `slackChannel({ cursorAccount: true })`. Inbound rides the account's
|
|
351
403
|
// Slack connection (`/v0/slack-events`); the classic Socket-Mode path is
|
|
@@ -356,13 +408,38 @@ export function startServer(mounts_1) {
|
|
|
356
408
|
accountKey,
|
|
357
409
|
logger,
|
|
358
410
|
});
|
|
411
|
+
try {
|
|
412
|
+
yield cursorGithubCredentials === null || cursorGithubCredentials === void 0 ? void 0 : cursorGithubCredentials.start();
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
yield cursorSlackRelay === null || cursorSlackRelay === void 0 ? void 0 : cursorSlackRelay.stop();
|
|
416
|
+
throw error;
|
|
417
|
+
}
|
|
418
|
+
// Cursor SCM events relay (opt-in: serve({ cursorEvents }) / --cursor-events).
|
|
419
|
+
const cursorEventRelay = startCursorEventRelay({
|
|
420
|
+
config: effectiveCursorEvents,
|
|
421
|
+
stateRoot: options.stateRoot,
|
|
422
|
+
mounts,
|
|
423
|
+
auth: cursorEventsAuth,
|
|
424
|
+
logger,
|
|
425
|
+
collectTriggerTargets,
|
|
426
|
+
cursorAccountOnly: options.cursorEvents === undefined && cursorGithubTargets.length > 0,
|
|
427
|
+
});
|
|
359
428
|
const server = createServer((req, res) => {
|
|
360
429
|
void handleRequest(router, req, res, logger);
|
|
361
430
|
});
|
|
362
|
-
const host = (
|
|
363
|
-
const port = (
|
|
364
|
-
|
|
365
|
-
|
|
431
|
+
const host = (_p = options.host) !== null && _p !== void 0 ? _p : "127.0.0.1";
|
|
432
|
+
const port = (_q = options.port) !== null && _q !== void 0 ? _q : 3000;
|
|
433
|
+
try {
|
|
434
|
+
server.listen(port, host);
|
|
435
|
+
yield once(server, "listening");
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
yield cursorEventRelay === null || cursorEventRelay === void 0 ? void 0 : cursorEventRelay.stop();
|
|
439
|
+
yield cursorSlackRelay === null || cursorSlackRelay === void 0 ? void 0 : cursorSlackRelay.stop();
|
|
440
|
+
cursorGithubCredentials === null || cursorGithubCredentials === void 0 ? void 0 : cursorGithubCredentials.stop();
|
|
441
|
+
throw error;
|
|
442
|
+
}
|
|
366
443
|
const address = server.address();
|
|
367
444
|
const displayHost = host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;
|
|
368
445
|
const url = `http://${displayHost}:${address.port}`;
|
|
@@ -411,7 +488,7 @@ export function startServer(mounts_1) {
|
|
|
411
488
|
const handle = {
|
|
412
489
|
url,
|
|
413
490
|
port: address.port,
|
|
414
|
-
project: (
|
|
491
|
+
project: (_c = runtimes[0]) === null || _c === void 0 ? void 0 : _c.project,
|
|
415
492
|
agents,
|
|
416
493
|
dispatchSchedule: (name, slug) => {
|
|
417
494
|
var _a;
|
|
@@ -494,7 +571,12 @@ export function startServer(mounts_1) {
|
|
|
494
571
|
}
|
|
495
572
|
server.close();
|
|
496
573
|
server.closeAllConnections();
|
|
497
|
-
|
|
574
|
+
try {
|
|
575
|
+
yield Promise.all(runtimes.map((runtime) => runtime.engine.close()));
|
|
576
|
+
}
|
|
577
|
+
finally {
|
|
578
|
+
cursorGithubCredentials === null || cursorGithubCredentials === void 0 ? void 0 : cursorGithubCredentials.stop();
|
|
579
|
+
}
|
|
498
580
|
}),
|
|
499
581
|
};
|
|
500
582
|
if ((playgroundDev === null || playgroundDev === void 0 ? void 0 : playgroundDev.url) !== undefined) {
|
|
@@ -972,9 +1054,8 @@ function requireCursorEventsAuth(config, accountKey) {
|
|
|
972
1054
|
*/
|
|
973
1055
|
function startCursorEventRelay(input) {
|
|
974
1056
|
var _a;
|
|
975
|
-
var _b
|
|
976
|
-
const {
|
|
977
|
-
const config = options.cursorEvents;
|
|
1057
|
+
var _b;
|
|
1058
|
+
const { config, stateRoot, mounts, auth, logger, collectTriggerTargets } = input;
|
|
978
1059
|
if (config === undefined || auth === undefined) {
|
|
979
1060
|
return undefined;
|
|
980
1061
|
}
|
|
@@ -989,7 +1070,7 @@ function startCursorEventRelay(input) {
|
|
|
989
1070
|
logger("[agent-serve] cursor-events: no mounted agent declares a github channel; relay disabled");
|
|
990
1071
|
return undefined;
|
|
991
1072
|
}
|
|
992
|
-
const baseStateRoot =
|
|
1073
|
+
const baseStateRoot = stateRoot !== null && stateRoot !== void 0 ? stateRoot : join((_b = (_a = mounts[0]) === null || _a === void 0 ? void 0 : _a.project.rootDir) !== null && _b !== void 0 ? _b : process.cwd(), ".agent-serve");
|
|
993
1074
|
const relay = new CursorEventRelay({
|
|
994
1075
|
baseUrl: auth.baseUrl,
|
|
995
1076
|
apiKey: auth.apiKey,
|
|
@@ -1002,12 +1083,23 @@ function startCursorEventRelay(input) {
|
|
|
1002
1083
|
dispatch: (event) => __awaiter(this, void 0, void 0, function* () {
|
|
1003
1084
|
if (event.provider !== "github")
|
|
1004
1085
|
return;
|
|
1086
|
+
const targets = collectTriggerTargets().filter((target) => {
|
|
1087
|
+
const cursorAccount = target.options.cursorAccount;
|
|
1088
|
+
if (input.cursorAccountOnly &&
|
|
1089
|
+
cursorAccount !== true &&
|
|
1090
|
+
typeof cursorAccount !== "object") {
|
|
1091
|
+
return false;
|
|
1092
|
+
}
|
|
1093
|
+
return typeof cursorAccount !== "object"
|
|
1094
|
+
? true
|
|
1095
|
+
: cursorAccount.repos.some((repo) => repo.toLowerCase() === event.repo.toLowerCase());
|
|
1096
|
+
});
|
|
1005
1097
|
const result = yield handleAgentServeTrigger({
|
|
1006
1098
|
type: "github",
|
|
1007
1099
|
bodyText: JSON.stringify(scmMetadataToGitHubPayload(event)),
|
|
1008
1100
|
eventName: event.eventName,
|
|
1009
1101
|
deliveryId: event.deliveryId,
|
|
1010
|
-
targets
|
|
1102
|
+
targets,
|
|
1011
1103
|
});
|
|
1012
1104
|
const outcomes = result.targets
|
|
1013
1105
|
.map((target) => `${target.slug || "default"}:${target.status}`)
|
|
@@ -1019,13 +1111,51 @@ function startCursorEventRelay(input) {
|
|
|
1019
1111
|
logger(`[agent-serve] cursor-events: relaying ${events.length} event kind(s) for ${repos.join(", ")} from ${auth.baseUrl}`);
|
|
1020
1112
|
return relay;
|
|
1021
1113
|
}
|
|
1022
|
-
|
|
1114
|
+
function collectCursorGithubTargets(mounts) {
|
|
1115
|
+
const targets = [];
|
|
1116
|
+
for (const mount of mounts) {
|
|
1117
|
+
for (const channel of mount.project.channels) {
|
|
1118
|
+
const accountRuntime = getGithubCursorAccountRuntime(channel.definition);
|
|
1119
|
+
if (accountRuntime !== undefined) {
|
|
1120
|
+
targets.push({
|
|
1121
|
+
slug: mount.slug,
|
|
1122
|
+
channelId: channel.id,
|
|
1123
|
+
accountRuntime,
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
return targets;
|
|
1129
|
+
}
|
|
1130
|
+
function resolveCursorGithubEventConfig(input) {
|
|
1131
|
+
var _a;
|
|
1132
|
+
var _b;
|
|
1133
|
+
if (input.targets.length === 0) {
|
|
1134
|
+
return { cursorEvents: input.configured, scope: undefined };
|
|
1135
|
+
}
|
|
1136
|
+
const repos = [
|
|
1137
|
+
...((_b = (_a = input.configured) === null || _a === void 0 ? void 0 : _a.repos) !== null && _b !== void 0 ? _b : []),
|
|
1138
|
+
...input.targets.flatMap((target) => { var _a; var _b; return [
|
|
1139
|
+
...((_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.repos) !== null && _b !== void 0 ? _b : []),
|
|
1140
|
+
]; }),
|
|
1141
|
+
];
|
|
1142
|
+
const permissions = resolveCursorGithubPermissions(input.targets.map((target) => { var _a; var _b; return (_b = (_a = target.accountRuntime.scope) === null || _a === void 0 ? void 0 : _a.permissions) !== null && _b !== void 0 ? _b : "pr-write"; }));
|
|
1143
|
+
const scope = parseCursorGithubRepoScope(repos, permissions);
|
|
1144
|
+
return {
|
|
1145
|
+
cursorEvents: Object.assign(Object.assign({}, input.configured), { repos: [...scope.repos] }),
|
|
1146
|
+
scope,
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* `weather-agent` → `WeatherAgent` (single-token Cursor Slack handle).
|
|
1151
|
+
* Must not contain whitespace — see {@link assertSlackCursorAgentName}.
|
|
1152
|
+
*/
|
|
1023
1153
|
function slackAgentNameFromSlug(slug) {
|
|
1024
1154
|
return slug
|
|
1025
1155
|
.split(/[-_\s]+/)
|
|
1026
1156
|
.filter((word) => word.length > 0)
|
|
1027
1157
|
.map((word) => word[0].toUpperCase() + word.slice(1))
|
|
1028
|
-
.join("
|
|
1158
|
+
.join("");
|
|
1029
1159
|
}
|
|
1030
1160
|
/**
|
|
1031
1161
|
* Mounted Slack channels riding the Cursor account connection
|
|
@@ -1047,6 +1177,7 @@ function collectCursorSlackTargets(runtimes) {
|
|
|
1047
1177
|
if (agentName === "") {
|
|
1048
1178
|
throw new Error(`slackChannel({ cursorAccount: true }) on agent "${runtime.slug || runtime.project.name}" resolved an empty agent name; set agentName.`);
|
|
1049
1179
|
}
|
|
1180
|
+
assertSlackCursorAgentName(agentName);
|
|
1050
1181
|
const nameKey = agentName.toLowerCase();
|
|
1051
1182
|
const existing = byName.get(nameKey);
|
|
1052
1183
|
if (existing !== undefined) {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { type AgentProject, type ApprovalDecision, type AuthContext, type CallToolOptions, type ChannelDefinition, type ChannelSession, type HostContext, type HttpChannelDefinition, type PendingApproval, type ReceiveInput, type SendMessageOptions, type SessionEvent, type SessionInfo, type SessionRecord, type SessionSummary, type ToolCallOutcome, type TurnOutcome } from "../types.js";
|
|
10
10
|
import { type ABSnapshot } from "./ab-snapshot.js";
|
|
11
|
+
import { type HostPlatforms } from "./host-platforms.js";
|
|
11
12
|
import type { AgentRunner } from "./sdk-runner.js";
|
|
12
13
|
import { SessionStore } from "./session-store.js";
|
|
14
|
+
import { StorageCoordinator } from "./storage-coordinator.js";
|
|
13
15
|
export declare const HTTP_CHANNEL_ID = "http";
|
|
14
16
|
export declare const SCHEDULE_CHANNEL_PREFIX = "schedule:";
|
|
15
17
|
export declare class SessionBusyError extends Error {
|
|
@@ -48,6 +50,7 @@ export interface SessionEngineOptions {
|
|
|
48
50
|
stateRoot: string;
|
|
49
51
|
runner: AgentRunner;
|
|
50
52
|
logger?: (line: string) => void;
|
|
53
|
+
platforms?: HostPlatforms;
|
|
51
54
|
}
|
|
52
55
|
/**
|
|
53
56
|
* A connection the serve host resolved once it was listening — a **peer**
|
|
@@ -80,6 +83,18 @@ export declare class SessionEngine {
|
|
|
80
83
|
readonly project: AgentProject;
|
|
81
84
|
readonly stateRoot: string;
|
|
82
85
|
readonly sessions: SessionStore;
|
|
86
|
+
/**
|
|
87
|
+
* Runtime for `agent/storage.ts` (`defineStorage`), when
|
|
88
|
+
* authored. All durable state changes funnel through it (session
|
|
89
|
+
* records, event chunks, A/B samples/snapshots); the eval run store
|
|
90
|
+
* attaches via {@link StorageCoordinator.asEvalRunPersistence} at
|
|
91
|
+
* serve start.
|
|
92
|
+
*/
|
|
93
|
+
readonly storage: StorageCoordinator | undefined;
|
|
94
|
+
/** In-flight lazy restores, deduped per channel + continuation key. */
|
|
95
|
+
private readonly restoreInFlight;
|
|
96
|
+
/** Once-per-process cache for the A/B snapshot backfill (see abSnapshot). */
|
|
97
|
+
private restoredAbSnapshot;
|
|
83
98
|
private readonly runner;
|
|
84
99
|
private readonly logger;
|
|
85
100
|
private readonly logs;
|
|
@@ -280,6 +295,40 @@ export declare class SessionEngine {
|
|
|
280
295
|
private initialChannelState;
|
|
281
296
|
/** Serialized, immutable record updates (latest-wins per session). */
|
|
282
297
|
private updateRecord;
|
|
298
|
+
/**
|
|
299
|
+
* Restore sessions from the authored storage sink. Called once at
|
|
300
|
+
* serve start, before channels accept traffic: any persisted session
|
|
301
|
+
* missing from the local `--state-root` is materialized there — events
|
|
302
|
+
* as `events.ndjson`, record as `session.json` — after which every
|
|
303
|
+
* existing read path (continuation lookup, event replay/streams, A/B
|
|
304
|
+
* fold hydration) works unchanged. Local state always wins over the
|
|
305
|
+
* sink, so restarts on the same host are no-ops.
|
|
306
|
+
*
|
|
307
|
+
* Failures are logged and skipped; a broken store (including rows that
|
|
308
|
+
* violate the SessionRecord shape) never blocks serve start.
|
|
309
|
+
*/
|
|
310
|
+
restoreStoredSessions(): Promise<void>;
|
|
311
|
+
private runBulkRestore;
|
|
312
|
+
/**
|
|
313
|
+
* Lazy restore: a continuation lookup missed locally, so ask the sink
|
|
314
|
+
* for that one session and materialize it before resuming. Disk grows
|
|
315
|
+
* with sessions that are actually resumed, not with history.
|
|
316
|
+
*
|
|
317
|
+
* Concurrent misses for the same key (webhook redeliveries, retries)
|
|
318
|
+
* share one in-flight restore — a second materialization racing the
|
|
319
|
+
* first resumed turn could truncate events the turn already appended.
|
|
320
|
+
* Sink errors propagate and fail the send (see
|
|
321
|
+
* {@link StorageCoordinator.getSessionByContinuation}).
|
|
322
|
+
*/
|
|
323
|
+
private restoreSessionByContinuation;
|
|
324
|
+
private loadAndMaterializeByContinuation;
|
|
325
|
+
/**
|
|
326
|
+
* Write one restored session to the local state root. Events land on
|
|
327
|
+
* disk before the record: a session becomes visible (and addressable via
|
|
328
|
+
* its continuation key) only with its full stream in place, and the
|
|
329
|
+
* lazily opened event log hydrates from this file.
|
|
330
|
+
*/
|
|
331
|
+
private materializeSession;
|
|
283
332
|
trackBackground(promise: Promise<unknown>): void;
|
|
284
333
|
/** Drain running turns, dispatches, and pending writes, then dispose. */
|
|
285
334
|
close(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-engine.d.ts","sourceRoot":"","sources":["../../src/internal/session-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,EACL,KAAK,Y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