@cursor/july 0.1.55 → 0.1.62
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 +30 -23
- package/dist/channels/github/github-channel.d.ts +13 -1
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +81 -16
- package/dist/channels/github/types.d.ts +29 -1
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/cursor-account.d.ts +22 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -0
- package/dist/channels/origin/cursor-account.js +35 -0
- package/dist/channels/origin/events.d.ts +10 -0
- package/dist/channels/origin/events.d.ts.map +1 -0
- package/dist/channels/origin/events.js +27 -0
- package/dist/channels/origin/index.d.ts +29 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +28 -0
- package/dist/channels/origin/origin-channel.d.ts +68 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -0
- package/dist/channels/origin/origin-channel.js +567 -0
- package/dist/channels/origin/origin-webhook.d.ts +38 -0
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
- package/dist/channels/origin/origin-webhook.js +151 -0
- package/dist/channels/origin/types.d.ts +152 -0
- package/dist/channels/origin/types.d.ts.map +1 -0
- package/dist/channels/origin/types.js +1 -0
- package/dist/channels/slack/doctor.d.ts +17 -1
- package/dist/channels/slack/doctor.d.ts.map +1 -1
- package/dist/channels/slack/doctor.js +186 -10
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CVQxhV85.js → app.B-biogkN.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.5ozYNf74.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.QAPzJjql.js → VPLocalSearchBox.DZqKtFZS.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CSxTCOFu.js → theme.BwC5zP2r.js} +2 -2
- package/dist/docs/assets/{example-agents_fsd.md.DPz9ezO4.js → example-agents_fsd.md.ZeGEpAw_.js} +2 -2
- package/dist/docs/assets/{example-agents_fsd.md.DPz9ezO4.lean.js → example-agents_fsd.md.ZeGEpAw_.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_security-reviewer.md.Dkf1gyo6.js → example-agents_security-reviewer.md.DBL1TwtP.js} +2 -2
- package/dist/docs/assets/{example-agents_security-reviewer.md.Dkf1gyo6.lean.js → example-agents_security-reviewer.md.DBL1TwtP.lean.js} +1 -1
- package/dist/docs/assets/guides_convert-automation.md.BhMzTkE5.js +12 -0
- package/dist/docs/assets/guides_convert-automation.md.BhMzTkE5.lean.js +1 -0
- package/dist/docs/assets/{guides_github.md.B8QKtIpw.js → guides_github.md.CLLQJKRB.js} +4 -4
- package/dist/docs/assets/{guides_github.md.B8QKtIpw.lean.js → guides_github.md.CLLQJKRB.lean.js} +1 -1
- package/dist/docs/assets/index.md.DhRHS_-L.js +5 -0
- package/dist/docs/assets/{index.md.COeoSkcF.lean.js → index.md.DhRHS_-L.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.D_CCfG8R.js → reference_cli.md.Cl14Jfo3.js} +8 -2
- package/dist/docs/assets/{reference_cli.md.D_CCfG8R.lean.js → reference_cli.md.Cl14Jfo3.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.CrWSA0Ko.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.mkc3B_ZW.lean.js → scaffolding-agents.md.CrWSA0Ko.lean.js} +1 -1
- package/dist/docs/assets/templates_agentic-owners.md.BkTLORaU.js +14 -0
- package/dist/docs/assets/templates_agentic-owners.md.BkTLORaU.lean.js +1 -0
- package/dist/docs/assets/templates_demo.md.Bgd6MBaZ.js +4 -0
- package/dist/docs/assets/templates_demo.md.Bgd6MBaZ.lean.js +1 -0
- package/dist/docs/assets/templates_pr-autofixer.md.DcmoeUNZ.js +8 -0
- package/dist/docs/assets/templates_pr-autofixer.md.DcmoeUNZ.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.C0yIUaYs.js +2 -0
- package/dist/docs/assets/templates_security-reviewer.md.C0yIUaYs.lean.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- 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 +4 -4
- package/dist/docs/example-agents/bugbot.html +4 -4
- 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 +5 -5
- package/dist/docs/example-agents/index.html +4 -4
- package/dist/docs/example-agents/knowledge-base.html +4 -4
- package/dist/docs/example-agents/oncall.html +4 -4
- package/dist/docs/example-agents/security-reviewer.html +5 -5
- 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/convert-automation.html +36 -0
- package/dist/docs/guides/github.html +7 -7
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.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 +6 -6
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +12 -6
- 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/prompt.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 +5 -5
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +38 -0
- package/dist/docs/templates/demo.html +28 -0
- package/dist/docs/templates/pr-autofixer.html +32 -0
- package/dist/docs/templates/security-reviewer.html +26 -0
- package/dist/docs/templates/triage.html +5 -5
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/internal/cli-ax.d.ts +2 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +20 -0
- package/dist/internal/cli-slack.d.ts +2 -0
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +11 -2
- package/dist/internal/cursor-event-relay.d.ts +64 -12
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +138 -26
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +11 -2
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +1 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +33 -6
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
- package/dist/internal/handleAgentServeTrigger.js +97 -19
- package/dist/internal/init-interview.d.ts +67 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +300 -0
- package/dist/internal/init-project.d.ts +4 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +40 -16
- package/dist/internal/mcp-endpoint.d.ts +7 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +7 -0
- package/dist/internal/mcp-oauth.d.ts +0 -4
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +0 -4
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +160 -58
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +20 -21
- package/dist/internal/session-links.d.ts +14 -0
- package/dist/internal/session-links.d.ts.map +1 -0
- package/dist/internal/session-links.js +69 -0
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +1 -0
- package/dist/playground/assets/index-B4rcOgeP.css +1 -0
- package/dist/playground/assets/{index-0oqXUkrR.js → index-DXcY42Jv.js} +42 -42
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +19 -12
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +15 -0
- package/docs/example-agents/fsd.md +3 -0
- package/docs/example-agents/security-reviewer.md +3 -0
- package/docs/guides/convert-automation.md +176 -0
- package/docs/guides/github.md +6 -2
- package/docs/reference/cli.md +34 -10
- package/docs/scaffolding-agents.md +3 -0
- package/docs/templates/agentic-owners.md +97 -0
- package/docs/templates/demo.md +84 -0
- package/docs/templates/pr-autofixer.md +136 -0
- package/docs/templates/security-reviewer.md +89 -0
- package/package.json +9 -1
- package/skills/github/SKILL.md +6 -6
- package/src/bin/agent-serve.ts +13 -6
- package/src/channels/github/github-channel.ts +113 -20
- package/src/channels/github/types.ts +33 -0
- package/src/channels/origin/cursor-account.ts +64 -0
- package/src/channels/origin/events.ts +41 -0
- package/src/channels/origin/index.ts +29 -0
- package/src/channels/origin/origin-channel.ts +784 -0
- package/src/channels/origin/origin-webhook.ts +202 -0
- package/src/channels/origin/types.ts +186 -0
- package/src/channels/slack/doctor.ts +218 -5
- package/src/index.ts +3 -1
- package/src/internal/cli-ax.ts +23 -0
- package/src/internal/cli-slack.ts +11 -1
- package/src/internal/cursor-event-relay.ts +201 -32
- package/src/internal/discovery.ts +15 -5
- package/src/internal/distribution.ts +1 -0
- package/src/internal/handleAgentServeTrigger.ts +129 -19
- package/src/internal/init-interview.ts +384 -0
- package/src/internal/init-project.ts +70 -15
- package/src/internal/mcp-endpoint.ts +7 -0
- package/src/internal/mcp-oauth.ts +0 -4
- package/src/internal/server.ts +190 -60
- package/src/internal/session-engine.ts +5 -21
- package/src/internal/session-links.ts +88 -0
- package/src/internal/sessions-client.ts +1 -0
- package/src/types.ts +19 -12
- package/templates/agentic-owners/README.md +73 -0
- package/templates/agentic-owners/agent/agent.ts +15 -0
- package/templates/agentic-owners/agent/channels/github.ts +85 -0
- package/templates/agentic-owners/agent/instructions.md +34 -0
- package/templates/agentic-owners/agent/lib/config.ts +13 -0
- package/templates/agentic-owners/agent/lib/github.ts +241 -0
- package/templates/agentic-owners/agent/lib/owners/README.md +50 -0
- package/templates/agentic-owners/agent/lib/owners/constants.ts +22 -0
- package/templates/agentic-owners/agent/lib/owners/decision.ts +485 -0
- package/templates/agentic-owners/agent/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/agent/lib/owners/match.ts +177 -0
- package/templates/agentic-owners/agent/lib/owners/matching.ts +95 -0
- package/templates/agentic-owners/agent/lib/owners/parse.ts +589 -0
- package/templates/agentic-owners/agent/lib/owners/policyMode.ts +65 -0
- package/templates/agentic-owners/agent/lib/owners/prompt.ts +66 -0
- package/templates/agentic-owners/agent/lib/owners/prompts/base-review.md +105 -0
- package/templates/agentic-owners/agent/lib/owners/types.ts +45 -0
- package/templates/agentic-owners/agent/lib/review.ts +777 -0
- package/templates/agentic-owners/agent/tools/record_review.ts +69 -0
- package/templates/agentic-owners/evals/evals.config.ts +5 -0
- package/templates/agentic-owners/evals/owners.eval.ts +116 -0
- package/templates/agentic-owners/package.json +20 -0
- package/templates/agentic-owners/tsconfig.json +12 -0
- package/templates/demo/README.md +33 -0
- package/templates/demo/agent/agent.ts +15 -0
- package/templates/demo/agent/channels/github.ts +50 -0
- package/templates/demo/agent/channels/queue.ts +30 -0
- package/templates/demo/agent/instructions.md +8 -0
- package/templates/demo/agent/lib/collect.ts +78 -0
- package/templates/demo/agent/tools/record_demo.ts +40 -0
- package/templates/demo/evals/demo.eval.ts +33 -0
- package/templates/demo/evals/evals.config.ts +5 -0
- package/templates/demo/package.json +18 -0
- package/templates/demo/tsconfig.json +12 -0
- package/templates/pr-autofixer/README.md +44 -0
- package/templates/pr-autofixer/agent/agent.ts +22 -0
- package/templates/pr-autofixer/agent/channels/drive.ts +40 -0
- package/templates/pr-autofixer/agent/channels/github.ts +167 -0
- package/templates/pr-autofixer/agent/channels/slack.ts +17 -0
- package/templates/pr-autofixer/agent/hooks/bind-agent.ts +19 -0
- package/templates/pr-autofixer/agent/instructions.md +83 -0
- package/templates/pr-autofixer/agent/lib/affinity.ts +33 -0
- package/templates/pr-autofixer/agent/lib/drive-schemas.ts +15 -0
- package/templates/pr-autofixer/agent/lib/drive.ts +79 -0
- package/templates/pr-autofixer/agent/lib/merge-watch.ts +123 -0
- package/templates/pr-autofixer/agent/lib/pr-state.ts +54 -0
- package/templates/pr-autofixer/agent/lib/repos.ts +19 -0
- package/templates/pr-autofixer/agent/lib/start-drive.ts +122 -0
- package/templates/pr-autofixer/agent/lib/webhook-buffer.ts +225 -0
- package/templates/pr-autofixer/agent/lib/webhook-routing.ts +231 -0
- package/templates/pr-autofixer/agent/storage.ts +7 -0
- package/templates/pr-autofixer/agent/tools/drive_pr.ts +22 -0
- package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
- package/templates/pr-autofixer/evals/evals.config.ts +5 -0
- package/templates/pr-autofixer/init.json +25 -0
- package/templates/pr-autofixer/package.json +18 -0
- package/templates/pr-autofixer/tsconfig.json +12 -0
- package/templates/security-reviewer/README.md +31 -0
- package/templates/security-reviewer/agent/agent.ts +15 -0
- package/templates/security-reviewer/agent/channels/github.ts +46 -0
- package/templates/security-reviewer/agent/instructions.md +22 -0
- package/templates/security-reviewer/agent/lib/repos.ts +5 -0
- package/templates/security-reviewer/agent/tools/post_findings.ts +72 -0
- package/templates/security-reviewer/evals/evals.config.ts +5 -0
- package/templates/security-reviewer/evals/review.eval.ts +53 -0
- package/templates/security-reviewer/init.json +25 -0
- package/templates/security-reviewer/package.json +18 -0
- package/templates/security-reviewer/tsconfig.json +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BFpWSo6D.js +0 -1
- package/dist/docs/assets/index.md.COeoSkcF.js +0 -5
- package/dist/docs/assets/scaffolding-agents.md.mkc3B_ZW.js +0 -1
- package/dist/playground/assets/index-tHCjJxv4.css +0 -1
package/dist/bin/agent-serve.js
CHANGED
|
@@ -73,7 +73,7 @@ Usage:
|
|
|
73
73
|
${CLI} trajectory --events <file.ndjson> [--text]
|
|
74
74
|
${CLI} call <tool> [--input <json>] [--dir <path> | --url <baseUrl> | --prod]
|
|
75
75
|
[--session <id>] [--slug <slug>] [--team <id>]
|
|
76
|
-
${CLI} init [dir] [--template <name>] [--json]
|
|
76
|
+
${CLI} init [dir] [--template <name>] [--var id=value]... [--json]
|
|
77
77
|
${CLI} convert-automation <url> [--dir <path>] [--json]
|
|
78
78
|
${CLI} install-skills [--print] [--json]
|
|
79
79
|
${CLI} mcp --prod [--slug <slug>] [--team <id>] [--dir <path>]
|
|
@@ -163,9 +163,10 @@ Commands:
|
|
|
163
163
|
via POST /v1/tools/:toolName. --session runs it inside an
|
|
164
164
|
existing session and records it on that session's event stream.
|
|
165
165
|
init Scaffold a project (skipping existing files), npm install,
|
|
166
|
-
run login when unsigned, then print next steps.
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
run login when unsigned, then print next steps. Templates
|
|
167
|
+
with init.json interview on a TTY; --var answers without a
|
|
168
|
+
prompt. --json is machine-readable and never blocks on
|
|
169
|
+
login. No directory: print the setup guide.
|
|
169
170
|
convert-automation
|
|
170
171
|
Export a Cursor Automation into an agentkit project. <url> is
|
|
171
172
|
the dashboard URL (…/automations/<uuid> or
|
|
@@ -415,8 +416,8 @@ function writeStdout(text) {
|
|
|
415
416
|
}
|
|
416
417
|
function main(argv) {
|
|
417
418
|
return __awaiter(this, void 0, void 0, function* () {
|
|
418
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
419
|
-
var
|
|
419
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
420
|
+
var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
420
421
|
const [command, ...restIn] = argv;
|
|
421
422
|
if (command === undefined ||
|
|
422
423
|
command === "help" ||
|
|
@@ -442,6 +443,7 @@ function main(argv) {
|
|
|
442
443
|
options: {
|
|
443
444
|
dir: { type: "string", default: "." },
|
|
444
445
|
template: { type: "string" },
|
|
446
|
+
var: { type: "string", multiple: true },
|
|
445
447
|
port: { type: "string" },
|
|
446
448
|
host: { type: "string" },
|
|
447
449
|
mode: { type: "string" },
|
|
@@ -501,7 +503,7 @@ function main(argv) {
|
|
|
501
503
|
org: { type: "string" },
|
|
502
504
|
"cursor-events": { type: "boolean", default: false },
|
|
503
505
|
secret: { type: "string" },
|
|
504
|
-
channel: { type: "string" },
|
|
506
|
+
channel: { type: "string", multiple: true },
|
|
505
507
|
install: { type: "boolean", default: false },
|
|
506
508
|
action: { type: "string" },
|
|
507
509
|
conclusion: { type: "string" },
|
|
@@ -525,7 +527,7 @@ function main(argv) {
|
|
|
525
527
|
"max-concurrency": { type: "string" },
|
|
526
528
|
},
|
|
527
529
|
});
|
|
528
|
-
const dir = (
|
|
530
|
+
const dir = (_j = values.dir) !== null && _j !== void 0 ? _j : ".";
|
|
529
531
|
// Best-effort, cached, and silent on failure. `update` does its own fresh
|
|
530
532
|
// lookup, --json runs stay quiet for machine consumers, and `mcp` skips it
|
|
531
533
|
// so MCP client spawns stay fast (stdout there is the protocol wire).
|
|
@@ -550,6 +552,7 @@ function main(argv) {
|
|
|
550
552
|
prefix: values.prefix,
|
|
551
553
|
noPrefix: values["no-prefix"],
|
|
552
554
|
channelPosts: values["channel-posts"],
|
|
555
|
+
channels: values.channel,
|
|
553
556
|
slackTeam: values["slack-team"],
|
|
554
557
|
prod: values.prod,
|
|
555
558
|
team: values.team,
|
|
@@ -573,14 +576,16 @@ function main(argv) {
|
|
|
573
576
|
return cmdGithub(positionals[0], {
|
|
574
577
|
dir,
|
|
575
578
|
slug: values.slug,
|
|
576
|
-
channel
|
|
579
|
+
// `--channel` is repeatable for `slack doctor`; the github
|
|
580
|
+
// subcommands target a single channel, so the last one wins.
|
|
581
|
+
channel: (_a = values.channel) === null || _a === void 0 ? void 0 : _a.at(-1),
|
|
577
582
|
host: values.host,
|
|
578
583
|
port,
|
|
579
584
|
url: values.url,
|
|
580
585
|
events: values.events,
|
|
581
586
|
// `--repo` is repeatable for `serve --cursor-events`; the github
|
|
582
587
|
// subcommands target a single repo, so the last one wins.
|
|
583
|
-
repo: (
|
|
588
|
+
repo: (_b = values.repo) === null || _b === void 0 ? void 0 : _b.at(-1),
|
|
584
589
|
org: values.org,
|
|
585
590
|
secret: values.secret,
|
|
586
591
|
install: values.install,
|
|
@@ -599,6 +604,7 @@ function main(argv) {
|
|
|
599
604
|
dir,
|
|
600
605
|
initTarget: positionals[0],
|
|
601
606
|
template: values.template,
|
|
607
|
+
vars: values.var,
|
|
602
608
|
json: values.json,
|
|
603
609
|
});
|
|
604
610
|
}
|
|
@@ -660,7 +666,7 @@ function main(argv) {
|
|
|
660
666
|
case "deploy": {
|
|
661
667
|
// `--repo` is repeatable for `serve --cursor-events`; deploy targets a
|
|
662
668
|
// single source repo, so the last one wins.
|
|
663
|
-
const repo = (
|
|
669
|
+
const repo = (_c = values.repo) === null || _c === void 0 ? void 0 : _c.at(-1);
|
|
664
670
|
return cmdDeploy(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, deployOptionsFromValues(values)), { dir }), (values.slug === undefined ? {} : { slug: values.slug })), { all: values.all === true }), (repo === undefined ? {} : { repo })), (values.ref === undefined ? {} : { ref: values.ref })), (values.path === undefined ? {} : { path: values.path })), (values["cursor-events-repo"] === undefined
|
|
665
671
|
? {}
|
|
666
672
|
: { cursorEventsRepos: values["cursor-events-repo"] })), (values["allow-domain"] === undefined
|
|
@@ -704,7 +710,7 @@ function main(argv) {
|
|
|
704
710
|
return cmdRun(axFromOptions({
|
|
705
711
|
dir,
|
|
706
712
|
messages,
|
|
707
|
-
sessionId: (
|
|
713
|
+
sessionId: (_k = values["session-id"]) !== null && _k !== void 0 ? _k : values.session,
|
|
708
714
|
continuationToken: values["continuation-token"],
|
|
709
715
|
events: values["no-events"]
|
|
710
716
|
? false
|
|
@@ -728,7 +734,7 @@ function main(argv) {
|
|
|
728
734
|
dir,
|
|
729
735
|
toolName: positionals[0],
|
|
730
736
|
toolInput: values.input,
|
|
731
|
-
sessionId: (
|
|
737
|
+
sessionId: (_l = values["session-id"]) !== null && _l !== void 0 ? _l : values.session,
|
|
732
738
|
url: values.url,
|
|
733
739
|
prod: values.prod,
|
|
734
740
|
team: values.team,
|
|
@@ -813,7 +819,7 @@ function main(argv) {
|
|
|
813
819
|
team: values.team,
|
|
814
820
|
apiKey: values["api-key"],
|
|
815
821
|
slug: values.slug,
|
|
816
|
-
sessionId: (
|
|
822
|
+
sessionId: (_m = values["session-id"]) !== null && _m !== void 0 ? _m : values.session,
|
|
817
823
|
resume: values.resume,
|
|
818
824
|
continuationToken: values["continuation-token"],
|
|
819
825
|
bearerToken: values["bearer-token"],
|
|
@@ -833,7 +839,7 @@ function main(argv) {
|
|
|
833
839
|
slug: values.slug,
|
|
834
840
|
// Positional wins; --session is accepted as a redundant alias.
|
|
835
841
|
// No id → resume previous (cmdResume sets resume: true).
|
|
836
|
-
sessionId: (
|
|
842
|
+
sessionId: (_p = (_o = positionals[0]) !== null && _o !== void 0 ? _o : values["session-id"]) !== null && _p !== void 0 ? _p : values.session,
|
|
837
843
|
continuationToken: values["continuation-token"],
|
|
838
844
|
bearerToken: values["bearer-token"],
|
|
839
845
|
json: values.json,
|
|
@@ -882,7 +888,7 @@ function main(argv) {
|
|
|
882
888
|
}));
|
|
883
889
|
}
|
|
884
890
|
case "cost": {
|
|
885
|
-
return cmdCost((
|
|
891
|
+
return cmdCost((_r = (_q = positionals[0]) !== null && _q !== void 0 ? _q : values["session-id"]) !== null && _r !== void 0 ? _r : values.session, axFromOptions({
|
|
886
892
|
dir,
|
|
887
893
|
url: values.url,
|
|
888
894
|
prod: values.prod,
|
|
@@ -902,7 +908,7 @@ function main(argv) {
|
|
|
902
908
|
apiKey: values["api-key"],
|
|
903
909
|
slug: values.slug,
|
|
904
910
|
bearerToken: values["bearer-token"],
|
|
905
|
-
sessionId: (
|
|
911
|
+
sessionId: (_s = values["session-id"]) !== null && _s !== void 0 ? _s : values.session,
|
|
906
912
|
print: values.print,
|
|
907
913
|
}));
|
|
908
914
|
}
|
|
@@ -936,7 +942,7 @@ function main(argv) {
|
|
|
936
942
|
case "info": {
|
|
937
943
|
const mounts = yield loadMounts(dir);
|
|
938
944
|
if (values.json) {
|
|
939
|
-
const payload = mounts.length === 1 && ((
|
|
945
|
+
const payload = mounts.length === 1 && ((_d = mounts[0]) === null || _d === void 0 ? void 0 : _d.slug) === ""
|
|
940
946
|
? projectInfo(mounts[0].project)
|
|
941
947
|
: {
|
|
942
948
|
agents: mounts.map(({ slug, project }) => (Object.assign({ slug }, projectInfo(project)))),
|
|
@@ -944,7 +950,7 @@ function main(argv) {
|
|
|
944
950
|
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
945
951
|
return 0;
|
|
946
952
|
}
|
|
947
|
-
if (mounts.length > 1 || ((
|
|
953
|
+
if (mounts.length > 1 || ((_e = mounts[0]) === null || _e === void 0 ? void 0 : _e.slug) !== "") {
|
|
948
954
|
process.stdout.write(`${mounts.length} agents under ${dir}:\n\n`);
|
|
949
955
|
for (const { slug, project } of mounts) {
|
|
950
956
|
const info = projectInfo(project);
|
|
@@ -953,7 +959,7 @@ function main(argv) {
|
|
|
953
959
|
const anyError = mounts.some((m) => m.project.diagnostics.some((d) => d.severity === "error"));
|
|
954
960
|
return anyError ? 1 : 0;
|
|
955
961
|
}
|
|
956
|
-
const project = (
|
|
962
|
+
const project = (_f = mounts[0]) === null || _f === void 0 ? void 0 : _f.project;
|
|
957
963
|
const info = projectInfo(project);
|
|
958
964
|
const lines = [];
|
|
959
965
|
lines.push(`agent: ${info.name}`);
|
|
@@ -970,8 +976,8 @@ function main(argv) {
|
|
|
970
976
|
"(events only)"}`)));
|
|
971
977
|
lines.push(section("schedules", info.schedules.map((s) => `${s.name} (${s.cron}, ${s.kind})`)));
|
|
972
978
|
lines.push(section("hooks", info.hooks));
|
|
973
|
-
lines.push(section("hosting egress domains", (
|
|
974
|
-
lines.push(section("hosting secret names", (
|
|
979
|
+
lines.push(section("hosting egress domains", (_t = (_g = info.hosting) === null || _g === void 0 ? void 0 : _g.egressDomains) !== null && _t !== void 0 ? _t : []));
|
|
980
|
+
lines.push(section("hosting secret names", (_u = (_h = info.hosting) === null || _h === void 0 ? void 0 : _h.secretNames) !== null && _u !== void 0 ? _u : []));
|
|
975
981
|
if (info.diagnostics.length > 0) {
|
|
976
982
|
lines.push(`\ndiagnostics:\n${formatDiagnostics(info.diagnostics)}`);
|
|
977
983
|
}
|
|
@@ -1040,7 +1046,7 @@ function main(argv) {
|
|
|
1040
1046
|
publicUrl: values["public-url"],
|
|
1041
1047
|
cloudToolsUrl: values["cloud-tools-url"],
|
|
1042
1048
|
cursorEvents: values["cursor-events"] === true
|
|
1043
|
-
? { repos: (
|
|
1049
|
+
? { repos: (_v = values.repo) !== null && _v !== void 0 ? _v : [] }
|
|
1044
1050
|
: undefined,
|
|
1045
1051
|
// Soft boot logs (GitHub auth, etc.) stay secondary to the banner.
|
|
1046
1052
|
logger: (line) => {
|
|
@@ -1151,6 +1157,7 @@ function axFromOptions(partial) {
|
|
|
1151
1157
|
tags: partial.tags,
|
|
1152
1158
|
evalIds: partial.evalIds,
|
|
1153
1159
|
initTarget: partial.initTarget,
|
|
1160
|
+
vars: partial.vars,
|
|
1154
1161
|
toolName: partial.toolName,
|
|
1155
1162
|
toolInput: partial.toolInput,
|
|
1156
1163
|
url: partial.url,
|
|
@@ -6,13 +6,25 @@ import type { GitHubChannelOptions, GitHubComment, GitHubCredentialValue, GitHub
|
|
|
6
6
|
* thread handles are attached. {@link enrichEventContext} adds `github`,
|
|
7
7
|
* `thread`, and `host` to make a full {@link GitHubEventContext} for hooks.
|
|
8
8
|
*/
|
|
9
|
-
type GitHubParsedContext = Omit<GitHubEventContext, "github" | "thread" | "host" | "artifacts">;
|
|
9
|
+
type GitHubParsedContext = Omit<GitHubEventContext, "github" | "thread" | "host" | "artifacts" | "payload">;
|
|
10
10
|
/**
|
|
11
11
|
* Derive the turn's auth from the actor that triggered the delivery — the
|
|
12
12
|
* standard `{ auth: defaultGitHubAuth(ctx) }` dispatch from an inbound hook.
|
|
13
13
|
*/
|
|
14
14
|
export declare function defaultGitHubAuth(ctx: GitHubParsedContext): AuthContext;
|
|
15
15
|
export declare function githubContinuationKey(ctx: GitHubParsedContext): string;
|
|
16
|
+
export interface GitHubPullRequestRef {
|
|
17
|
+
owner: string;
|
|
18
|
+
repo: string;
|
|
19
|
+
number: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse a pull-request continuation key minted by
|
|
23
|
+
* {@link githubContinuationKey} back into its repo + number. Undefined for
|
|
24
|
+
* issue keys and non-GitHub sessions — lets a server tool recover which PR
|
|
25
|
+
* its session is pinned to without trusting model-provided identifiers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseGitHubPrContinuationKey(key: string): GitHubPullRequestRef | undefined;
|
|
16
28
|
/** @deprecated Prefer {@link githubContinuationKey}. */
|
|
17
29
|
export declare function githubPullRequestContinuationKey(ctx: GitHubParsedContext): string;
|
|
18
30
|
export declare function defaultGitHubTitle(ctx: GitHubParsedContext): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,WAAW,EACX,iBAAiB,EAEjB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EAKpB,aAAa,EAEb,qBAAqB,EAErB,kBAAkB,EAGlB,sBAAsB,EAMtB,kBAAkB,EAClB,UAAU,EAEX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,kBAAkB,EAClB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"github-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/github/github-channel.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,WAAW,EACX,iBAAiB,EAEjB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EAKpB,aAAa,EAEb,qBAAqB,EAErB,kBAAkB,EAGlB,sBAAsB,EAMtB,kBAAkB,EAClB,UAAU,EAEX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,kBAAkB,EAClB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CACvD,CAAC;AAqFF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,GAAG,WAAW,CA2BvE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAGtE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAg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|
76
76
|
}),
|
|
77
77
|
}),
|
|
78
|
+
changes: z
|
|
79
|
+
.object({
|
|
80
|
+
base: z
|
|
81
|
+
.object({
|
|
82
|
+
ref: z.object({ from: z.string().min(1).optional() }).optional(),
|
|
83
|
+
})
|
|
84
|
+
.optional(),
|
|
85
|
+
})
|
|
86
|
+
.nullable()
|
|
87
|
+
.optional(),
|
|
78
88
|
sender: senderSchema,
|
|
79
89
|
installation: installationSchema,
|
|
80
90
|
label: z
|
|
@@ -111,6 +121,23 @@ export function githubContinuationKey(ctx) {
|
|
|
111
121
|
const kind = ctx.conversation.kind === "issue" ? "github-issue" : "github-pr";
|
|
112
122
|
return `${kind}:${ctx.repository.fullName}#${ctx.conversation.number}`;
|
|
113
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Parse a pull-request continuation key minted by
|
|
126
|
+
* {@link githubContinuationKey} back into its repo + number. Undefined for
|
|
127
|
+
* issue keys and non-GitHub sessions — lets a server tool recover which PR
|
|
128
|
+
* its session is pinned to without trusting model-provided identifiers.
|
|
129
|
+
*/
|
|
130
|
+
export function parseGitHubPrContinuationKey(key) {
|
|
131
|
+
const match = /^github-pr:([^/#\s]+)\/([^#\s]+)#(\d+)$/.exec(key);
|
|
132
|
+
if (match === null) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
owner: match[1],
|
|
137
|
+
repo: match[2],
|
|
138
|
+
number: Number(match[3]),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
114
141
|
/** @deprecated Prefer {@link githubContinuationKey}. */
|
|
115
142
|
export function githubPullRequestContinuationKey(ctx) {
|
|
116
143
|
return githubContinuationKey(ctx);
|
|
@@ -195,8 +222,8 @@ export function extractGitHubCommentTrigger(args) {
|
|
|
195
222
|
return { message: stripped };
|
|
196
223
|
}
|
|
197
224
|
export function parseGitHubPullRequestEvent(args) {
|
|
198
|
-
var _a, _b, _c;
|
|
199
|
-
var
|
|
225
|
+
var _a, _b, _c, _d, _e, _f;
|
|
226
|
+
var _g;
|
|
200
227
|
const parsed = githubPullRequestPayloadSchema.safeParse(args.payload);
|
|
201
228
|
if (!parsed.success) {
|
|
202
229
|
return null;
|
|
@@ -210,14 +237,16 @@ export function parseGitHubPullRequestEvent(args) {
|
|
|
210
237
|
number: payload.pull_request.number,
|
|
211
238
|
url: payload.pull_request.html_url,
|
|
212
239
|
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
213
|
-
const pullRequest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ action: payload.action, number: payload.pull_request.number, url: payload.pull_request.html_url, title: payload.pull_request.title }, (payload.pull_request.body === undefined ||
|
|
240
|
+
const pullRequest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ action: payload.action, number: payload.pull_request.number, url: payload.pull_request.html_url, title: payload.pull_request.title }, (payload.pull_request.body === undefined ||
|
|
214
241
|
payload.pull_request.body === null
|
|
215
242
|
? {}
|
|
216
243
|
: { body: payload.pull_request.body })), { headRef: payload.pull_request.head.ref, headSha: payload.pull_request.head.sha, baseRef: payload.pull_request.base.ref }), (payload.pull_request.base.sha === undefined
|
|
217
244
|
? {}
|
|
218
|
-
: { baseSha: payload.pull_request.base.sha })),
|
|
245
|
+
: { baseSha: payload.pull_request.base.sha })), (((_d = (_c = (_b = payload.changes) === null || _b === void 0 ? void 0 : _b.base) === null || _c === void 0 ? void 0 : _c.ref) === null || _d === void 0 ? void 0 : _d.from) === undefined
|
|
246
|
+
? {}
|
|
247
|
+
: { baseRefChangedFrom: payload.changes.base.ref.from })), { draft: (_g = payload.pull_request.draft) !== null && _g !== void 0 ? _g : false, merged: payload.pull_request.merged === true }), (((_e = payload.pull_request.user) === null || _e === void 0 ? void 0 : _e.login) === undefined
|
|
219
248
|
? {}
|
|
220
|
-
: { authorLogin: payload.pull_request.user.login })), (((
|
|
249
|
+
: { authorLogin: payload.pull_request.user.login })), (((_f = payload.label) === null || _f === void 0 ? void 0 : _f.name) === undefined
|
|
221
250
|
? {}
|
|
222
251
|
: { label: { name: payload.label.name } }));
|
|
223
252
|
return { ctx, pullRequest };
|
|
@@ -541,6 +570,7 @@ function handlePullRequest(input) {
|
|
|
541
570
|
const ctx = enrichEventContext({
|
|
542
571
|
bindingConfig: input.bindingConfig,
|
|
543
572
|
ctx: parsed.ctx,
|
|
573
|
+
payload: input.payload,
|
|
544
574
|
bindingState: binding,
|
|
545
575
|
installationId,
|
|
546
576
|
host: input.args.host,
|
|
@@ -610,6 +640,7 @@ function handleIssueComment(input) {
|
|
|
610
640
|
const ctx = enrichEventContext({
|
|
611
641
|
bindingConfig: input.bindingConfig,
|
|
612
642
|
ctx: parsed.ctx,
|
|
643
|
+
payload: input.payload,
|
|
613
644
|
bindingState: binding,
|
|
614
645
|
installationId,
|
|
615
646
|
host: input.args.host,
|
|
@@ -681,6 +712,7 @@ function handleReviewComment(input) {
|
|
|
681
712
|
const ctx = enrichEventContext({
|
|
682
713
|
bindingConfig: input.bindingConfig,
|
|
683
714
|
ctx: parsed.ctx,
|
|
715
|
+
payload: input.payload,
|
|
684
716
|
bindingState: binding,
|
|
685
717
|
installationId,
|
|
686
718
|
host: input.args.host,
|
|
@@ -749,6 +781,7 @@ function handleIssue(input) {
|
|
|
749
781
|
const ctx = enrichEventContext({
|
|
750
782
|
bindingConfig: input.bindingConfig,
|
|
751
783
|
ctx: parsed.ctx,
|
|
784
|
+
payload: input.payload,
|
|
752
785
|
bindingState: binding,
|
|
753
786
|
installationId,
|
|
754
787
|
host: input.args.host,
|
|
@@ -800,6 +833,7 @@ function handleCheckSuite(input) {
|
|
|
800
833
|
const dispatch = yield input.options.onCheckSuite(enrichCiContext({
|
|
801
834
|
bindingConfig: input.bindingConfig,
|
|
802
835
|
ctx: parsed.unanchoredCtx,
|
|
836
|
+
payload: input.payload,
|
|
803
837
|
installationId,
|
|
804
838
|
host: input.args.host,
|
|
805
839
|
artifacts: input.args.artifacts,
|
|
@@ -824,6 +858,7 @@ function handleCheckSuite(input) {
|
|
|
824
858
|
const ctx = enrichEventContext({
|
|
825
859
|
bindingConfig: input.bindingConfig,
|
|
826
860
|
ctx: parsed.ctx,
|
|
861
|
+
payload: input.payload,
|
|
827
862
|
bindingState: binding,
|
|
828
863
|
installationId,
|
|
829
864
|
host: input.args.host,
|
|
@@ -876,6 +911,7 @@ function handleCheckRun(input) {
|
|
|
876
911
|
const dispatch = yield input.options.onCheckRun(enrichCiContext({
|
|
877
912
|
bindingConfig: input.bindingConfig,
|
|
878
913
|
ctx: parsed.unanchoredCtx,
|
|
914
|
+
payload: input.payload,
|
|
879
915
|
installationId,
|
|
880
916
|
host: input.args.host,
|
|
881
917
|
artifacts: input.args.artifacts,
|
|
@@ -900,6 +936,7 @@ function handleCheckRun(input) {
|
|
|
900
936
|
const ctx = enrichEventContext({
|
|
901
937
|
bindingConfig: input.bindingConfig,
|
|
902
938
|
ctx: parsed.ctx,
|
|
939
|
+
payload: input.payload,
|
|
903
940
|
bindingState: binding,
|
|
904
941
|
installationId,
|
|
905
942
|
host: input.args.host,
|
|
@@ -952,6 +989,7 @@ function handleWorkflowRun(input) {
|
|
|
952
989
|
const dispatch = yield input.options.onWorkflowRun(enrichCiContext({
|
|
953
990
|
bindingConfig: input.bindingConfig,
|
|
954
991
|
ctx: parsed.unanchoredCtx,
|
|
992
|
+
payload: input.payload,
|
|
955
993
|
installationId,
|
|
956
994
|
host: input.args.host,
|
|
957
995
|
artifacts: input.args.artifacts,
|
|
@@ -976,6 +1014,7 @@ function handleWorkflowRun(input) {
|
|
|
976
1014
|
const ctx = enrichEventContext({
|
|
977
1015
|
bindingConfig: input.bindingConfig,
|
|
978
1016
|
ctx: parsed.ctx,
|
|
1017
|
+
payload: input.payload,
|
|
979
1018
|
bindingState: binding,
|
|
980
1019
|
installationId,
|
|
981
1020
|
host: input.args.host,
|
|
@@ -1035,6 +1074,7 @@ function handleStatus(input) {
|
|
|
1035
1074
|
const ctx = enrichEventContext({
|
|
1036
1075
|
bindingConfig: input.bindingConfig,
|
|
1037
1076
|
ctx: parsed.ctx,
|
|
1077
|
+
payload: input.payload,
|
|
1038
1078
|
bindingState: binding,
|
|
1039
1079
|
installationId,
|
|
1040
1080
|
host: input.args.host,
|
|
@@ -1102,6 +1142,7 @@ function handleGenericEvent(input) {
|
|
|
1102
1142
|
const ctx = enrichEventContext({
|
|
1103
1143
|
bindingConfig: input.bindingConfig,
|
|
1104
1144
|
ctx: parsed.ctx,
|
|
1145
|
+
payload: input.payload,
|
|
1105
1146
|
bindingState: binding,
|
|
1106
1147
|
installationId,
|
|
1107
1148
|
host: input.args.host,
|
|
@@ -1138,10 +1179,22 @@ function handleGenericEvent(input) {
|
|
|
1138
1179
|
}
|
|
1139
1180
|
function startTurn(input) {
|
|
1140
1181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1141
|
-
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
|
|
1182
|
+
const files = input.dispatch.workspaceFiles;
|
|
1183
|
+
const lazy = typeof files === "function";
|
|
1184
|
+
const sendTurn = () => __awaiter(this, void 0, void 0, function* () {
|
|
1185
|
+
var _a;
|
|
1186
|
+
const workspaceFiles = lazy ? yield files() : files;
|
|
1187
|
+
return input.args.send(input.message, Object.assign(Object.assign(Object.assign({ auth: input.dispatch.auth, continuationToken: githubContinuationKey(input.ctx), title: (_a = input.dispatch.title) !== null && _a !== void 0 ? _a : defaultGitHubTitle(input.ctx) }, (input.cloud === undefined ? {} : { cloud: input.cloud })), (workspaceFiles === undefined ? {} : { workspaceFiles })), { state: input.state,
|
|
1188
|
+
// Resume must refresh headSha / refs without wiping sticky banner id.
|
|
1189
|
+
refreshState: input.state }));
|
|
1190
|
+
});
|
|
1191
|
+
if (lazy) {
|
|
1192
|
+
scheduleAfterAck(input.args, () => __awaiter(this, void 0, void 0, function* () {
|
|
1193
|
+
yield sendTurn();
|
|
1194
|
+
}));
|
|
1195
|
+
return Response.json({ ok: true, dispatched: true, mode: "turn" }, { status: 202 });
|
|
1196
|
+
}
|
|
1197
|
+
const session = yield sendTurn();
|
|
1145
1198
|
return Response.json({
|
|
1146
1199
|
ok: true,
|
|
1147
1200
|
sessionId: session.id,
|
|
@@ -1150,16 +1203,27 @@ function startTurn(input) {
|
|
|
1150
1203
|
});
|
|
1151
1204
|
});
|
|
1152
1205
|
}
|
|
1153
|
-
function
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1206
|
+
function reportBackgroundFailure(error) {
|
|
1207
|
+
var _a;
|
|
1208
|
+
const detail = error instanceof Error ? ((_a = error.stack) !== null && _a !== void 0 ? _a : error.message) : String(error);
|
|
1209
|
+
console.error(`[github] background dispatch failed: ${detail}`);
|
|
1210
|
+
}
|
|
1211
|
+
function scheduleAfterAck(args, work) {
|
|
1212
|
+
// Defer past the current turn so the 202 can flush before work starts
|
|
1213
|
+
// (and so tests can assert scheduling without racing microtasks).
|
|
1214
|
+
args.waitUntil(new Promise((resolve) => {
|
|
1157
1215
|
setImmediate(() => {
|
|
1158
1216
|
Promise.resolve()
|
|
1159
|
-
.then(
|
|
1160
|
-
.then(() => resolve(),
|
|
1217
|
+
.then(work)
|
|
1218
|
+
.then(() => resolve(), (error) => {
|
|
1219
|
+
reportBackgroundFailure(error);
|
|
1220
|
+
resolve();
|
|
1221
|
+
});
|
|
1161
1222
|
});
|
|
1162
1223
|
}));
|
|
1224
|
+
}
|
|
1225
|
+
function acknowledgeTask(args, dispatch, extra) {
|
|
1226
|
+
scheduleAfterAck(args, dispatch.task);
|
|
1163
1227
|
return Response.json(Object.assign({ ok: true, dispatched: true, mode: "task" }, extra), { status: 202 });
|
|
1164
1228
|
}
|
|
1165
1229
|
function skipped(reason, extra = {}) {
|
|
@@ -1699,7 +1763,7 @@ function enrichEventContext(input) {
|
|
|
1699
1763
|
config: input.bindingConfig,
|
|
1700
1764
|
state: input.bindingState,
|
|
1701
1765
|
});
|
|
1702
|
-
return Object.assign(Object.assign(Object.assign({}, input.ctx), (input.installationId === undefined
|
|
1766
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, input.ctx), { payload: input.payload }), (input.installationId === undefined
|
|
1703
1767
|
? {}
|
|
1704
1768
|
: { installationId: input.installationId })), { github,
|
|
1705
1769
|
thread, host: input.host, artifacts: input.artifacts });
|
|
@@ -1722,6 +1786,7 @@ function enrichCiContext(input) {
|
|
|
1722
1786
|
ctx: input.ctx,
|
|
1723
1787
|
bindingState: binding,
|
|
1724
1788
|
installationId: input.installationId,
|
|
1789
|
+
payload: input.payload,
|
|
1725
1790
|
host: input.host,
|
|
1726
1791
|
artifacts: input.artifacts,
|
|
1727
1792
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentCloudOptions, ArtifactsApi, AuthContext, AuthPolicy, ChannelEventHandlers, ChannelStartArgs, HostContext } from "../../types.js";
|
|
1
|
+
import type { AgentCloudOptions, ArtifactsApi, AuthContext, AuthPolicy, ChannelEventHandlers, ChannelStartArgs, HostContext, SendMessageOptions } from "../../types.js";
|
|
2
2
|
import type { GitHubApiOptions } from "./api.js";
|
|
3
3
|
import type { GitHubHandle, GitHubThread } from "./binding.js";
|
|
4
4
|
import type { GitHubProgressConfig } from "./progress.js";
|
|
@@ -104,6 +104,17 @@ export type GitHubPullRequestPayload = {
|
|
|
104
104
|
sha?: string;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Present on `edited` deliveries; `changes.base.ref.from` carries the
|
|
109
|
+
* previous base branch when the PR was retargeted.
|
|
110
|
+
*/
|
|
111
|
+
changes?: {
|
|
112
|
+
base?: {
|
|
113
|
+
ref?: {
|
|
114
|
+
from?: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
} | null;
|
|
107
118
|
sender?: {
|
|
108
119
|
login?: string;
|
|
109
120
|
id?: number;
|
|
@@ -128,6 +139,13 @@ export interface GitHubPullRequestEvent {
|
|
|
128
139
|
headSha: string;
|
|
129
140
|
baseRef: string;
|
|
130
141
|
baseSha?: string;
|
|
142
|
+
/**
|
|
143
|
+
* On `edited` deliveries where the PR base was retargeted, the previous
|
|
144
|
+
* base branch (`changes.base.ref.from`). Undefined for every other edit
|
|
145
|
+
* (title / body), so `action === "edited" && baseRefChangedFrom` gates
|
|
146
|
+
* base-retarget handling without waking on prose edits.
|
|
147
|
+
*/
|
|
148
|
+
baseRefChangedFrom?: string;
|
|
131
149
|
draft: boolean;
|
|
132
150
|
/** True when the PR was merged (from the webhook payload). */
|
|
133
151
|
merged: boolean;
|
|
@@ -246,6 +264,8 @@ export interface GitHubEventContext {
|
|
|
246
264
|
sender?: GitHubUser;
|
|
247
265
|
/** Installation id from the webhook payload, when present. */
|
|
248
266
|
installationId?: number;
|
|
267
|
+
/** Verified webhook body for this delivery. */
|
|
268
|
+
payload: unknown;
|
|
249
269
|
/** Authenticated GitHub helpers (`getOctokit`, `request`, `createStatus`). */
|
|
250
270
|
github: GitHubHandle;
|
|
251
271
|
/** Post / react on the conversation thread. */
|
|
@@ -263,6 +283,8 @@ export interface GitHubEventContext {
|
|
|
263
283
|
* to ignore the delivery instead.
|
|
264
284
|
*/
|
|
265
285
|
export type GitHubDispatch = GitHubTurnDispatch | GitHubTaskDispatch;
|
|
286
|
+
/** Files seeded into the session workspace before the turn. */
|
|
287
|
+
export type GitHubWorkspaceFiles = NonNullable<SendMessageOptions["workspaceFiles"]>;
|
|
266
288
|
/** Start (or resume) a model turn for the event. */
|
|
267
289
|
export interface GitHubTurnDispatch {
|
|
268
290
|
/** Who the turn runs as. Use `defaultGitHubAuth(ctx)` to derive it from the actor. */
|
|
@@ -273,6 +295,12 @@ export interface GitHubTurnDispatch {
|
|
|
273
295
|
message?: string;
|
|
274
296
|
/** Optional session title override. */
|
|
275
297
|
title?: string;
|
|
298
|
+
/**
|
|
299
|
+
* Seeded into the session workspace before the turn (`send`'s
|
|
300
|
+
* `workspaceFiles`). A function runs after the webhook is
|
|
301
|
+
* acknowledged (202) so fetch I/O can outlive GitHub's ~10s window.
|
|
302
|
+
*/
|
|
303
|
+
workspaceFiles?: GitHubWorkspaceFiles | (() => GitHubWorkspaceFiles | undefined | Promise<GitHubWorkspaceFiles | undefined>);
|
|
276
304
|
}
|
|
277
305
|
/**
|
|
278
306
|
* Run a host-side handler for the event instead of a model turn. The task
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channels/github/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channels/github/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,0EAA0E;AAC1E,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,CAAC,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,qBAAqB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AAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,iEAAiE;IACjE,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,kEAAkE;IAClE,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;IACjE,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor-account mode for Origin channels.
|
|
3
|
+
*
|
|
4
|
+
* Origin identity is the signed-in Cursor user (no third-party OAuth). The
|
|
5
|
+
* channel declares repos at definition time; the serve host subscribes
|
|
6
|
+
* `/v0/scm-events` with `provider: "origin"` as that user. Unlike GitHub,
|
|
7
|
+
* there is no installation token to mint — outbound Origin API calls already
|
|
8
|
+
* authenticate as the Cursor principal.
|
|
9
|
+
*/
|
|
10
|
+
import type { OriginChannelOptions } from "./types.js";
|
|
11
|
+
export declare const CURSOR_ORIGIN_MAX_REPOS = 20;
|
|
12
|
+
export interface CursorOriginRepoScope {
|
|
13
|
+
repos: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface OriginCursorAccountRuntime {
|
|
16
|
+
options: OriginChannelOptions;
|
|
17
|
+
scope: CursorOriginRepoScope | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function parseCursorOriginRepoScope(values: readonly string[]): CursorOriginRepoScope;
|
|
20
|
+
export declare function registerOriginCursorAccountRuntime(definition: object, runtime: OriginCursorAccountRuntime): void;
|
|
21
|
+
export declare function getOriginCursorAccountRuntime(definition: object): OriginCursorAccountRuntime | undefined;
|
|
22
|
+
//# sourceMappingURL=cursor-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-account.d.ts","sourceRoot":"","sources":["../../../src/channels/origin/cursor-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAG1C,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1C;AAID,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,qBAAqB,CAsBvB;AAED,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,0BAA0B,GAClC,IAAI,CAEN;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GACjB,0BAA0B,GAAG,SAAS,CAExC"}
|