@cursor/july 0.1.82 → 0.1.84
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/README.md +2 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.BEHVaPKt.js → app.kqdC1N7p.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BqhvUA76.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.D2-5PKih.js → VPLocalSearchBox.DXDE2WgG.js} +1 -1
- package/dist/docs/assets/chunks/{theme.uNqJ4MUO.js → theme.DFYqbyta.js} +2 -2
- package/dist/docs/assets/{guides_cloud-runtime.md.V5igN4Sq.js → guides_cloud-runtime.md.CbklWfzh.js} +1 -1
- package/dist/docs/assets/{guides_cloud-runtime.md.V5igN4Sq.lean.js → guides_cloud-runtime.md.CbklWfzh.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.BZnEKfEc.js → reference_agent-config.md.CTWp4DnU.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.B_jHN7JL.js → reference_skills.md.BRF2nDv9.js} +2 -2
- package/dist/docs/assets/{reference_skills.md.B_jHN7JL.lean.js → reference_skills.md.BRF2nDv9.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.KgmmaCgw.js +1 -0
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +3 -3
- package/dist/docs/evals.html +3 -3
- package/dist/docs/example-agents/approval-buddy.html +3 -3
- package/dist/docs/example-agents/benny.html +3 -3
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +3 -3
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +3 -3
- package/dist/docs/example-agents/security-reviewer.html +3 -3
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +5 -5
- package/dist/docs/guides/convert-automation.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/mcp-oauth.html +3 -3
- package/dist/docs/guides/opentelemetry.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +3 -3
- package/dist/docs/quickstart.html +3 -3
- package/dist/docs/reference/agent-config.html +5 -5
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +3 -3
- package/dist/docs/reference/skills.html +5 -5
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/templates/agentic-owners.html +3 -3
- package/dist/docs/templates/demo.html +3 -3
- package/dist/docs/templates/pr-autofixer.html +3 -3
- package/dist/docs/templates/security-reviewer.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/files-backends/cursor-hosted.d.ts +6 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +19 -0
- package/dist/files.d.ts +14 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +14 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +17 -2
- package/dist/internal/event-mapper.d.ts +7 -1
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +8 -8
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -1
- package/dist/internal/mcp-endpoint.js +9 -0
- package/dist/internal/prompt-context.d.ts +4 -1
- package/dist/internal/prompt-context.d.ts.map +1 -1
- package/dist/internal/prompt-context.js +20 -2
- package/dist/internal/review-comments.js +15 -7
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +6 -9
- package/dist/internal/session-engine.d.ts +36 -2
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +143 -52
- package/dist/internal/skills-sync.d.ts +7 -5
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +9 -7
- package/dist/internal/tool-policy.d.ts +50 -0
- package/dist/internal/tool-policy.d.ts.map +1 -0
- package/dist/internal/tool-policy.js +51 -0
- package/dist/playground/assets/{index-CkuIrhg4.js → index-Cspgk9jC.js} +45 -45
- package/dist/playground/index.html +1 -1
- package/dist/tools.d.ts +16 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +72 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/guides/cloud-runtime.md +6 -1
- package/docs/reference/agent-config.md +6 -5
- package/docs/reference/skills.md +12 -3
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
- package/skills/framework-map/SKILL.md +2 -1
- package/src/files-backends/cursor-hosted.ts +21 -0
- package/src/files.ts +21 -2
- package/src/internal/discovery.ts +21 -1
- package/src/internal/event-mapper.ts +10 -1
- package/src/internal/http-channel.ts +1 -0
- package/src/internal/mcp-endpoint.ts +9 -0
- package/src/internal/prompt-context.ts +25 -2
- package/src/internal/review-comments.ts +17 -7
- package/src/internal/sdk-runner.ts +10 -11
- package/src/internal/session-engine.ts +174 -39
- package/src/internal/skills-sync.ts +10 -7
- package/src/internal/tool-policy.ts +92 -0
- package/src/tools.ts +19 -0
- package/src/types.ts +78 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.Vvio4stV.js +0 -1
- package/dist/docs/assets/troubleshooting.md.DQ-hYuZT.js +0 -1
- /package/dist/docs/assets/{reference_agent-config.md.BZnEKfEc.lean.js → reference_agent-config.md.CTWp4DnU.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.DQ-hYuZT.lean.js → troubleshooting.md.KgmmaCgw.lean.js} +0 -0
package/src/tools.ts
CHANGED
|
@@ -59,6 +59,7 @@ import type {
|
|
|
59
59
|
JsonSchemaObject,
|
|
60
60
|
ToolContext,
|
|
61
61
|
ToolDefinition,
|
|
62
|
+
ToolEffectDeclaration,
|
|
62
63
|
ToolExecuteResult,
|
|
63
64
|
ToolNeedsApproval,
|
|
64
65
|
} from "./types.js";
|
|
@@ -70,6 +71,8 @@ export type {
|
|
|
70
71
|
ToolConfig,
|
|
71
72
|
ToolContext,
|
|
72
73
|
ToolDefinition,
|
|
74
|
+
ToolEffect,
|
|
75
|
+
ToolEffectDeclaration,
|
|
73
76
|
ToolExecuteResult,
|
|
74
77
|
ToolExecution,
|
|
75
78
|
ToolNeedsApproval,
|
|
@@ -91,6 +94,15 @@ type ServerToolConfig<TSchema> = {
|
|
|
91
94
|
*/
|
|
92
95
|
outputSchema?: z.ZodTypeAny | JsonSchemaObject;
|
|
93
96
|
needsApproval?: ToolNeedsApproval<ToolInput<TSchema>>;
|
|
97
|
+
/**
|
|
98
|
+
* Whether this tool changes anything outside the session. Undeclared means
|
|
99
|
+
* write, so a dry-run session answers it instead of running it.
|
|
100
|
+
*/
|
|
101
|
+
effect?: ToolEffectDeclaration<ToolInput<TSchema>>;
|
|
102
|
+
/** What a `"write"` tool returns in a dry-run session. */
|
|
103
|
+
dryRunResult?:
|
|
104
|
+
| ToolExecuteResult
|
|
105
|
+
| ((input: ToolInput<TSchema>) => ToolExecuteResult);
|
|
94
106
|
execute: (
|
|
95
107
|
input: ToolInput<TSchema>,
|
|
96
108
|
ctx: ToolContext
|
|
@@ -112,6 +124,13 @@ type AgentToolConfig<TSchema> = {
|
|
|
112
124
|
execute?: never;
|
|
113
125
|
/** Human-in-the-loop approvals are only supported for server tools. */
|
|
114
126
|
needsApproval?: never;
|
|
127
|
+
/**
|
|
128
|
+
* Agent tools run inside the harness, not through the host's tool path, so
|
|
129
|
+
* a dry run cannot answer them. Classify the work as a server tool if it
|
|
130
|
+
* needs to be dry-runnable.
|
|
131
|
+
*/
|
|
132
|
+
effect?: never;
|
|
133
|
+
dryRunResult?: never;
|
|
115
134
|
};
|
|
116
135
|
|
|
117
136
|
/**
|
package/src/types.ts
CHANGED
|
@@ -867,6 +867,35 @@ export type ToolNeedsApproval<TInput> =
|
|
|
867
867
|
| boolean
|
|
868
868
|
| ((input: TInput) => boolean | Promise<boolean>);
|
|
869
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Whether invoking a tool can change anything outside this session.
|
|
872
|
+
*
|
|
873
|
+
* `"read"` cannot, by construction — a query, a file read, a listing.
|
|
874
|
+
* `"write"` changes something a person or another agent will later see: an
|
|
875
|
+
* external system (a comment, a message, a ticket) or shared storage another
|
|
876
|
+
* session reads back.
|
|
877
|
+
*
|
|
878
|
+
* This is what {@link SendMessageOptions.dryRun} enforces. In a dry-run
|
|
879
|
+
* session a write is answered by the host and never executed, while reads run
|
|
880
|
+
* for real — so an agent can be run against real data to see what it *would*
|
|
881
|
+
* have done.
|
|
882
|
+
*
|
|
883
|
+
* A tool that declares nothing is treated as a write: a dry run promises
|
|
884
|
+
* "nothing outside this session changed", which it cannot promise about a tool
|
|
885
|
+
* it knows nothing about. An unannotated tool is therefore useless in a dry
|
|
886
|
+
* run.
|
|
887
|
+
*/
|
|
888
|
+
export type ToolEffect = "read" | "write";
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* A tool's declared {@link ToolEffect} — fixed, or decided per call from
|
|
892
|
+
* validated input for tools that read or write depending on their arguments
|
|
893
|
+
* (an HTTP request keyed on method, a SQL tool keyed on statement).
|
|
894
|
+
*/
|
|
895
|
+
export type ToolEffectDeclaration<TInput> =
|
|
896
|
+
| ToolEffect
|
|
897
|
+
| ((input: TInput) => ToolEffect);
|
|
898
|
+
|
|
870
899
|
export interface ToolConfig<TInput> {
|
|
871
900
|
description: string;
|
|
872
901
|
/**
|
|
@@ -895,6 +924,20 @@ export interface ToolConfig<TInput> {
|
|
|
895
924
|
* `execution: "server"` tools on the local runtime.
|
|
896
925
|
*/
|
|
897
926
|
needsApproval?: ToolNeedsApproval<TInput>;
|
|
927
|
+
/**
|
|
928
|
+
* Whether this tool changes anything outside the session. Undeclared means
|
|
929
|
+
* write, so a dry run stubs it — see {@link ToolEffect}.
|
|
930
|
+
*/
|
|
931
|
+
effect?: ToolEffectDeclaration<TInput>;
|
|
932
|
+
/**
|
|
933
|
+
* What a write tool returns in a dry-run session instead of executing.
|
|
934
|
+
*
|
|
935
|
+
* Omit for a tool whose result the caller only acknowledges. Supply one when
|
|
936
|
+
* the result is read structurally — a caller that uses `result.revision`
|
|
937
|
+
* breaks on a bare string — so a dry run stays on the same path production
|
|
938
|
+
* takes. Ignored unless {@link effect} resolves to `"write"`.
|
|
939
|
+
*/
|
|
940
|
+
dryRunResult?: ToolExecuteResult | ((input: TInput) => ToolExecuteResult);
|
|
898
941
|
/**
|
|
899
942
|
* In-process implementation. Required when {@link execution} is
|
|
900
943
|
* `"server"` (the default); ignored for `"agent"` tools.
|
|
@@ -918,6 +961,10 @@ export interface ToolDefinition extends BrandedDefinition<"tool"> {
|
|
|
918
961
|
readonly inputSchema?: z.ZodTypeAny | JsonSchemaObject;
|
|
919
962
|
readonly outputSchema?: z.ZodTypeAny | JsonSchemaObject;
|
|
920
963
|
readonly needsApproval?: ToolNeedsApproval<never>;
|
|
964
|
+
readonly effect?: ToolEffectDeclaration<never>;
|
|
965
|
+
readonly dryRunResult?:
|
|
966
|
+
| ToolExecuteResult
|
|
967
|
+
| ((input: never) => ToolExecuteResult);
|
|
921
968
|
readonly execute?: (
|
|
922
969
|
input: never,
|
|
923
970
|
ctx: ToolContext
|
|
@@ -1349,6 +1396,13 @@ export type SessionEventPayload =
|
|
|
1349
1396
|
toolName: string;
|
|
1350
1397
|
output?: unknown;
|
|
1351
1398
|
isError: boolean;
|
|
1399
|
+
/**
|
|
1400
|
+
* The tool never ran: a write answered by the host in a `dryRun`
|
|
1401
|
+
* session. `actions.requested` still carries the arguments the model
|
|
1402
|
+
* chose, so this is the marker that separates "what it would have
|
|
1403
|
+
* done" from a real effect when reading a trajectory.
|
|
1404
|
+
*/
|
|
1405
|
+
stubbed?: true;
|
|
1352
1406
|
parentCallId?: string;
|
|
1353
1407
|
};
|
|
1354
1408
|
}
|
|
@@ -1451,6 +1505,8 @@ export interface SessionInfo {
|
|
|
1451
1505
|
mode: SessionMode;
|
|
1452
1506
|
/** Omit / `"live"` for production traffic; `"eval"` for eval harness sessions. */
|
|
1453
1507
|
purpose?: SessionPurpose;
|
|
1508
|
+
/** True when write-classified tool calls are answered by the host. */
|
|
1509
|
+
dryRun?: boolean;
|
|
1454
1510
|
auth: AuthContext | null;
|
|
1455
1511
|
title?: string;
|
|
1456
1512
|
/**
|
|
@@ -1483,6 +1539,8 @@ export interface SessionRecord {
|
|
|
1483
1539
|
* Older records omit this (treated as `"live"`).
|
|
1484
1540
|
*/
|
|
1485
1541
|
purpose?: SessionPurpose;
|
|
1542
|
+
/** Frozen at create from {@link SendMessageOptions.dryRun}. */
|
|
1543
|
+
dryRun?: boolean;
|
|
1486
1544
|
/**
|
|
1487
1545
|
* Denormalized sticky A/B arms (mirrors durable `ab.assigned` events) so
|
|
1488
1546
|
* the agent loop / tools can read arms without re-folding the log. Source
|
|
@@ -1657,6 +1715,15 @@ export interface SendMessageOptions {
|
|
|
1657
1715
|
* (`defineAB`) so regression runs do not mix into live metrics.
|
|
1658
1716
|
*/
|
|
1659
1717
|
purpose?: SessionPurpose;
|
|
1718
|
+
/**
|
|
1719
|
+
* Answer every write-classified tool call from the host instead of running
|
|
1720
|
+
* it, for this session's whole life (create only — a follow-up cannot clear
|
|
1721
|
+
* it, so a session that starts as a rehearsal stays one).
|
|
1722
|
+
*
|
|
1723
|
+
* Reads execute, writes are answered and recorded, and the arguments the
|
|
1724
|
+
* model chose stay on the session log as the record of the intended action.
|
|
1725
|
+
*/
|
|
1726
|
+
dryRun?: boolean;
|
|
1660
1727
|
/**
|
|
1661
1728
|
* Absolute directory used as the local harness `cwd` for this session.
|
|
1662
1729
|
* On create, sets the session workspace. On resume (continuation hit),
|
|
@@ -2506,6 +2573,12 @@ export interface DiscoveredTool {
|
|
|
2506
2573
|
* predicate). Runtime evaluation still runs the predicate per call.
|
|
2507
2574
|
*/
|
|
2508
2575
|
needsApproval: boolean;
|
|
2576
|
+
/**
|
|
2577
|
+
* The tool's declared {@link ToolEffect} when it declares one statically, or
|
|
2578
|
+
* `"dynamic"` when it declares a predicate resolved per call. Absent when it
|
|
2579
|
+
* declares nothing, which a dry run treats as a write.
|
|
2580
|
+
*/
|
|
2581
|
+
effect?: ToolEffect | "dynamic";
|
|
2509
2582
|
/**
|
|
2510
2583
|
* Agent tools: script body materialized under
|
|
2511
2584
|
* `.agent-serve/tools/<name>.sh`.
|
|
@@ -2769,6 +2842,11 @@ export interface RunnerTurnRequest {
|
|
|
2769
2842
|
runtime: AgentRuntime;
|
|
2770
2843
|
/** Cloud options when {@link runtime} is `"cloud"`. */
|
|
2771
2844
|
cloud?: AgentCloudOptions;
|
|
2845
|
+
/**
|
|
2846
|
+
* defineAgent directory slug for personal-key cloud creates. Injected
|
|
2847
|
+
* by the engine — not part of authored {@link AgentCloudOptions}.
|
|
2848
|
+
*/
|
|
2849
|
+
agentServeAgent?: string;
|
|
2772
2850
|
/** In-process tools, already bound to the session's tool context. */
|
|
2773
2851
|
customTools: Record<string, SDKCustomTool>;
|
|
2774
2852
|
/** MCP servers from `agent/mcp-connections/`. */
|