@cursor/july 0.1.24 → 0.1.25
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 +0 -0
- package/dist/channels/github/instrument.d.ts +20 -0
- package/dist/channels/github/instrument.d.ts.map +1 -0
- package/dist/docs/404.html +1 -1
- package/dist/docs/ab.html +2 -2
- package/dist/docs/assets/{app.CvSGaAxk.js → app.DYcC9FY-.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BQTzJjR_.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.J1jJbCvs.js → VPLocalSearchBox.o4N_knTV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.C7vfzr7h.js → theme.DQ-njyo0.js} +2 -2
- package/dist/docs/building-with-agents.html +2 -2
- package/dist/docs/concepts.html +2 -2
- package/dist/docs/deployment.html +2 -2
- package/dist/docs/evals.html +2 -2
- package/dist/docs/example-agents/approval-buddy.html +2 -2
- package/dist/docs/example-agents/benny.html +2 -2
- package/dist/docs/example-agents/bugbot.html +2 -2
- package/dist/docs/example-agents/codebase-wiki.html +2 -2
- package/dist/docs/example-agents/codeowners-review.html +2 -2
- package/dist/docs/example-agents/concierge.html +2 -2
- package/dist/docs/example-agents/fsd.html +2 -2
- package/dist/docs/example-agents/index.html +2 -2
- package/dist/docs/example-agents/knowledge-base.html +2 -2
- package/dist/docs/example-agents/oncall.html +2 -2
- package/dist/docs/example-agents/security-reviewer.html +2 -2
- package/dist/docs/example-agents/slack-agent.html +2 -2
- package/dist/docs/example-agents/weather-agent.html +2 -2
- package/dist/docs/guides/agent-to-agent.html +2 -2
- package/dist/docs/guides/cloud-runtime.html +2 -2
- package/dist/docs/guides/github.html +2 -2
- package/dist/docs/guides/human-in-the-loop.html +2 -2
- package/dist/docs/guides/mcp-oauth.html +2 -2
- package/dist/docs/guides/slack.html +2 -2
- package/dist/docs/guides/webhooks.html +2 -2
- package/dist/docs/hillclimbing.html +2 -2
- package/dist/docs/index.html +2 -2
- package/dist/docs/quickstart.html +2 -2
- package/dist/docs/reference/agent-config.html +2 -2
- package/dist/docs/reference/channels.html +2 -2
- package/dist/docs/reference/cli.html +2 -2
- package/dist/docs/reference/connections.html +2 -2
- package/dist/docs/reference/hooks.html +2 -2
- package/dist/docs/reference/http-api.html +2 -2
- package/dist/docs/reference/instructions.html +2 -2
- package/dist/docs/reference/playground.html +2 -2
- package/dist/docs/reference/project-layout.html +2 -2
- package/dist/docs/reference/prompt.html +2 -2
- package/dist/docs/reference/schedules.html +2 -2
- package/dist/docs/reference/sessions.html +2 -2
- package/dist/docs/reference/skills.html +2 -2
- package/dist/docs/reference/subagents.html +2 -2
- package/dist/docs/reference/tools.html +2 -2
- package/dist/docs/scaffolding-agents.html +2 -2
- package/dist/docs/storage.html +2 -2
- package/dist/docs/troubleshooting.html +2 -2
- package/dist/internal/json-dir-store.d.ts +32 -0
- package/dist/internal/json-dir-store.d.ts.map +1 -0
- package/dist/internal/json-dir-store.js +100 -0
- package/dist/playground/assets/index-CjOQ4hN9.css +1 -0
- package/dist/playground/assets/{index-DTG9OsPV.js → index-DqXdAFGa.js} +41 -41
- package/dist/playground/index.html +2 -2
- package/package.json +31 -24
- package/src/artifacts.ts +78 -0
- package/src/bin/agent-serve.version.test.ts +64 -0
- package/src/channels/github/api.test.ts +64 -0
- package/src/channels/github/auth.test.ts +105 -0
- package/src/channels/github/cursor-account.test.ts +204 -0
- package/src/channels/github/forward.test.ts +457 -0
- package/src/channels/github/github.test.ts +943 -0
- package/src/channels/github/replay.test.ts +179 -0
- package/src/channels/slack/api.post-message.test.ts +148 -0
- package/src/channels/slack/approvals.test.ts +328 -0
- package/src/channels/slack/block-actions.test.ts +452 -0
- package/src/channels/slack/bot-mentions.test.ts +267 -0
- package/src/channels/slack/channel-watch.test.ts +363 -0
- package/src/channels/slack/cursor-account.test.ts +253 -0
- package/src/channels/slack/defaults.final-post.test.ts +182 -0
- package/src/channels/slack/dispatch.test.ts +795 -0
- package/src/channels/slack/eval-directive.test.ts +273 -0
- package/src/channels/slack/message-body.test.ts +54 -0
- package/src/channels/slack/nudge-store.test.ts +143 -0
- package/src/channels/slack/slack.test.ts +391 -0
- package/src/channels/slack/stop.test.ts +23 -0
- package/src/channels/slack/thread-context.test.ts +202 -0
- package/src/evals/assertions.test.ts +617 -0
- package/src/evals/assertions.ts +37 -1
- package/src/evals/expect.test.ts +144 -0
- package/src/evals/judge.test.ts +181 -0
- package/src/evals/loaders.test.ts +132 -0
- package/src/evals/matchers.test.ts +95 -0
- package/src/evals/reporters.test.ts +303 -0
- package/src/evals/run-facts.test.ts +259 -0
- package/src/evals.ts +1 -0
- package/src/index.ts +1 -0
- package/src/internal/ab-snapshot.test.ts +325 -0
- package/src/internal/approval-gate.test.ts +49 -0
- package/src/internal/approvals.integration.test.ts +383 -0
- package/src/internal/artifacts-store.test.ts +283 -0
- package/src/internal/artifacts-store.ts +290 -0
- package/src/internal/authored-loaders.test.ts +31 -0
- package/src/internal/builtin-tools/artifacts.test.ts +247 -0
- package/src/internal/builtin-tools/artifacts.ts +74 -0
- package/src/internal/builtin-tools/index.ts +21 -0
- package/src/internal/builtin-tools/reminders.test.ts +201 -0
- package/src/internal/channel-route-schema.test.ts +294 -0
- package/src/internal/chat-attach.test.ts +262 -0
- package/src/internal/cli-deploy.test.ts +1991 -0
- package/src/internal/cli-docs.test.ts +161 -0
- package/src/internal/cli-mcp.test.ts +789 -0
- package/src/internal/cli-skills.test.ts +133 -0
- package/src/internal/cli-slack.test.ts +1654 -0
- package/src/internal/cli-slack.ts +13 -4
- package/src/internal/cloud-merge.test.ts +74 -0
- package/src/internal/cron.test.ts +22 -0
- package/src/internal/cursor/account-mcp.test.ts +807 -0
- package/src/internal/cursor/backend-client.test.ts +591 -0
- package/src/internal/cursor/credentials.test.ts +351 -0
- package/src/internal/cursor/github-credentials.test.ts +136 -0
- package/src/internal/cursor-account-mcp-auth.test.ts +310 -0
- package/src/internal/cursor-account.integration.test.ts +441 -0
- package/src/internal/cursor-event-relay.test.ts +746 -0
- package/src/internal/cursor-github-credentials.integration.test.ts +271 -0
- package/src/internal/cursor-slack-relay.test.ts +525 -0
- package/src/internal/deploy-source.test.ts +111 -0
- package/src/internal/discovery.artifact-tool.test.ts +136 -0
- package/src/internal/discovery.artifacts.test.ts +119 -0
- package/src/internal/discovery.builtin-tools.test.ts +94 -0
- package/src/internal/discovery.concurrency.test.ts +60 -0
- package/src/internal/discovery.cursor-account.test.ts +133 -0
- package/src/internal/discovery.cwd.test.ts +83 -0
- package/src/internal/discovery.hosting.test.ts +80 -0
- package/src/internal/discovery.identity.test.ts +44 -0
- package/src/internal/discovery.ts +102 -1
- package/src/internal/distribution.ts +1 -0
- package/src/internal/docs-site.test.ts +66 -0
- package/src/internal/duration.test.ts +29 -0
- package/src/internal/eval-judge-model.test.ts +187 -0
- package/src/internal/eval-run-store.cancel.test.ts +142 -0
- package/src/internal/eval-run-store.storage.test.ts +211 -0
- package/src/internal/eval-runner.http.test.ts +403 -0
- package/src/internal/eval-runner.run.test.ts +928 -0
- package/src/internal/evals-client.test.ts +307 -0
- package/src/internal/event-mapper.test.ts +243 -0
- package/src/internal/github-fanout.test.ts +213 -0
- package/src/internal/handleAgentServeTrigger.test.ts +185 -0
- package/src/internal/host-kv.test.ts +82 -0
- package/src/internal/host-platforms.test.ts +126 -0
- package/src/internal/http-channel.test.ts +402 -0
- package/src/internal/init-project.test.ts +270 -0
- package/src/internal/install-cursor-skills.test.ts +262 -0
- package/src/internal/local-env.test.ts +120 -0
- package/src/internal/log-ring.test.ts +31 -0
- package/src/internal/logs-client.test.ts +350 -0
- package/src/internal/mcp-endpoint.test.ts +436 -0
- package/src/internal/mcp-host.test.ts +298 -0
- package/src/internal/mcp-oauth.test.ts +148 -0
- package/src/internal/net.test.ts +17 -0
- package/src/internal/peer-connections.test.ts +128 -0
- package/src/internal/peer-mcp.integration.test.ts +289 -0
- package/src/internal/playground/toolchain.test.ts +53 -0
- package/src/internal/playground-cli.test.ts +187 -0
- package/src/internal/playground-proxy.test.ts +376 -0
- package/src/internal/prompt-context.integration.test.ts +232 -0
- package/src/internal/prompt-context.test.ts +127 -0
- package/src/internal/reminder-runner.test.ts +390 -0
- package/src/internal/reminder-store.test.ts +53 -0
- package/src/internal/request-headers.test.ts +27 -0
- package/src/internal/resolve-prod-target.test.ts +787 -0
- package/src/internal/resolved-connections.test.ts +295 -0
- package/src/internal/router.test.ts +57 -0
- package/src/internal/sdk-runner.test.ts +290 -0
- package/src/internal/server.artifacts.test.ts +303 -0
- package/src/internal/server.ts +43 -0
- package/src/internal/session-engine.artifacts.test.ts +243 -0
- package/src/internal/session-engine.coalesce.test.ts +169 -0
- package/src/internal/session-engine.concurrency.test.ts +250 -0
- package/src/internal/session-engine.host-oauth-mcp.test.ts +110 -0
- package/src/internal/session-engine.interrupt.test.ts +577 -0
- package/src/internal/session-engine.storage.test.ts +547 -0
- package/src/internal/session-engine.ts +125 -0
- package/src/internal/session-urls.test.ts +28 -0
- package/src/internal/sessions-client.test.ts +518 -0
- package/src/internal/storage-coordinator.test.ts +517 -0
- package/src/internal/storage-coordinator.ts +62 -0
- package/src/internal/tool-call.test.ts +458 -0
- package/src/internal/tool-result.test.ts +52 -0
- package/src/internal/trajectory.approvals.test.ts +83 -0
- package/src/internal/trajectory.subagents.test.ts +198 -0
- package/src/internal/turn-governor.test.ts +137 -0
- package/src/internal/update-check.test.ts +485 -0
- package/src/internal/workspace.test.ts +207 -0
- package/src/storage-backends/cursor-hosted.test.ts +121 -0
- package/src/storage.ts +6 -0
- package/src/types.ts +134 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CL2Y0Zmh.js +0 -1
- package/dist/playground/assets/index-CidizGZv.css +0 -1
|
@@ -491,6 +491,16 @@ interface ConnectWaitTarget {
|
|
|
491
491
|
notConnectedAt?: string;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
+
/**
|
|
495
|
+
* Slack's team-scoped admin page listing pending app-install requests.
|
|
496
|
+
* Provisioned apps have no OAuth flow (no redirect URLs, install-from-Slack
|
|
497
|
+
* disabled), so the oauth_authorize_url Slack returns from
|
|
498
|
+
* apps.manifest.create dead-ends; approval happens here instead.
|
|
499
|
+
*/
|
|
500
|
+
function slackAppRequestsUrl(slackTeamId: string): string {
|
|
501
|
+
return `https://app.slack.com/apps-manage/${encodeURIComponent(slackTeamId)}/integrations/requests`;
|
|
502
|
+
}
|
|
503
|
+
|
|
494
504
|
/** "Name (T0123ABCD)", or the bare id when the backend has no name. */
|
|
495
505
|
function formatWorkspace(workspace: SlackConnectedWorkspace): string {
|
|
496
506
|
const name = workspace.slackTeamName ?? "";
|
|
@@ -719,6 +729,7 @@ export async function cmdSlackCreate(
|
|
|
719
729
|
const iconStatus = await applySlackCreateIcon(ctx, iconSource, result);
|
|
720
730
|
|
|
721
731
|
if (result.status === "pending_admin_approval") {
|
|
732
|
+
const approveUrl = slackAppRequestsUrl(workspace.slackTeamId);
|
|
722
733
|
if (ctx.json) {
|
|
723
734
|
ctx.out(
|
|
724
735
|
`${JSON.stringify(
|
|
@@ -729,7 +740,7 @@ export async function cmdSlackCreate(
|
|
|
729
740
|
slackTeamId: workspace.slackTeamId,
|
|
730
741
|
envKeys: target.envKeys,
|
|
731
742
|
wrote,
|
|
732
|
-
|
|
743
|
+
approveUrl,
|
|
733
744
|
iconStatus,
|
|
734
745
|
},
|
|
735
746
|
null,
|
|
@@ -739,9 +750,7 @@ export async function cmdSlackCreate(
|
|
|
739
750
|
} else {
|
|
740
751
|
ctx.err(
|
|
741
752
|
`The Slack app was created (app ${result.appId}), but installing it needs a Slack workspace-admin approval.\n` +
|
|
742
|
-
|
|
743
|
-
? ""
|
|
744
|
-
: `\n Approve it (or send this to a workspace admin):\n\n ${result.oauthAuthorizeUrl}\n\n`) +
|
|
753
|
+
`\n A workspace admin can approve it here:\n\n ${approveUrl}\n\n` +
|
|
745
754
|
`Once an admin approves the app, re-run \`${CLI} slack create\` to finish the install and mint the tokens.\n`
|
|
746
755
|
);
|
|
747
756
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { AgentCloudOptions } from "../types.js";
|
|
3
|
+
import { mergeCloudOptions, resolveSessionRuntime } from "./cloud-merge.js";
|
|
4
|
+
import { isServerMintedCloudAgentId } from "./sdk-runner.js";
|
|
5
|
+
|
|
6
|
+
describe("mergeCloudOptions", () => {
|
|
7
|
+
const base: AgentCloudOptions = {
|
|
8
|
+
env: { type: "cloud" },
|
|
9
|
+
autoCreatePR: false,
|
|
10
|
+
envVars: { A: "1", B: "2" },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
it("returns the other side when one is undefined", () => {
|
|
14
|
+
expect(mergeCloudOptions({ base, override: undefined })).toBe(base);
|
|
15
|
+
expect(mergeCloudOptions({ base: undefined, override: base })).toBe(base);
|
|
16
|
+
expect(
|
|
17
|
+
mergeCloudOptions({ base: undefined, override: undefined })
|
|
18
|
+
).toBeUndefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("lets the per-session override win on repos/env and deep-merges envVars", () => {
|
|
22
|
+
const merged = mergeCloudOptions({
|
|
23
|
+
base,
|
|
24
|
+
override: {
|
|
25
|
+
repos: [
|
|
26
|
+
{
|
|
27
|
+
url: "https://github.com/o/r",
|
|
28
|
+
prUrl: "https://github.com/o/r/pull/1",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
envVars: { B: "override", C: "3" },
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
expect(merged?.repos).toEqual([
|
|
35
|
+
{ url: "https://github.com/o/r", prUrl: "https://github.com/o/r/pull/1" },
|
|
36
|
+
]);
|
|
37
|
+
// Scalar base flags survive; envVars are deep-merged with override winning.
|
|
38
|
+
expect(merged?.autoCreatePR).toBe(false);
|
|
39
|
+
expect(merged?.envVars).toEqual({ A: "1", B: "override", C: "3" });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("resolveSessionRuntime", () => {
|
|
44
|
+
it("keeps the agent default when there is no cloud override", () => {
|
|
45
|
+
expect(
|
|
46
|
+
resolveSessionRuntime({
|
|
47
|
+
agentRuntime: "local",
|
|
48
|
+
cloudOverride: undefined,
|
|
49
|
+
})
|
|
50
|
+
).toBe("local");
|
|
51
|
+
expect(
|
|
52
|
+
resolveSessionRuntime({
|
|
53
|
+
agentRuntime: "cloud",
|
|
54
|
+
cloudOverride: undefined,
|
|
55
|
+
})
|
|
56
|
+
).toBe("cloud");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("forces cloud when a per-session cloud override is set", () => {
|
|
60
|
+
expect(
|
|
61
|
+
resolveSessionRuntime({
|
|
62
|
+
agentRuntime: "local",
|
|
63
|
+
cloudOverride: { env: { type: "cloud" } },
|
|
64
|
+
})
|
|
65
|
+
).toBe("cloud");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe("isServerMintedCloudAgentId", () => {
|
|
70
|
+
it("resumes bc- ids and treats other ids as creation seeds", () => {
|
|
71
|
+
expect(isServerMintedCloudAgentId("bc-2dd32425-da03")).toBe(true);
|
|
72
|
+
expect(isServerMintedCloudAgentId("ses_abc")).toBe(false);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { isValidCron, parseCron } from "./cron.js";
|
|
3
|
+
|
|
4
|
+
describe("parseCron (croner)", () => {
|
|
5
|
+
it("matches */5 on the five-minute mark", () => {
|
|
6
|
+
const cron = parseCron("*/5 * * * *");
|
|
7
|
+
expect(cron.matches(new Date("2026-07-09T18:55:00.000Z"))).toBe(true);
|
|
8
|
+
expect(cron.matches(new Date("2026-07-09T18:56:00.000Z"))).toBe(false);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("returns the next fire after a given time", () => {
|
|
12
|
+
const cron = parseCron("0 9 * * 1-5");
|
|
13
|
+
const next = cron.nextFire(new Date("2026-07-09T08:00:00.000Z")); // Thursday
|
|
14
|
+
expect(next.toISOString()).toBe("2026-07-09T09:00:00.000Z");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("rejects non-5-field expressions", () => {
|
|
18
|
+
expect(() => parseCron("* * * *")).toThrow(/5 fields/);
|
|
19
|
+
expect(isValidCron("0 9 * * 1-5")).toBe(true);
|
|
20
|
+
expect(isValidCron("not a cron")).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
});
|