@cursor/july 0.1.103 → 0.1.104
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/channels/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +41 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +39 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +4 -0
- package/dist/channels/github/progress.d.ts +22 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/github/progress.js +32 -5
- package/dist/channels/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +37 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/types.js +1 -0
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DW9pXkpL.js → app.DbMWUyGb.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.Bqsulb9K.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CdEIUwDg.js → VPLocalSearchBox.DcNeTh9o.js} +1 -1
- package/dist/docs/assets/chunks/{theme.YZMHgPgg.js → theme.DMjhY3gl.js} +2 -2
- package/dist/docs/assets/{guides_github.md.DKYiT9do.js → guides_github.md.c0gdGJ-D.js} +1 -1
- package/dist/docs/assets/{guides_github.md.DKYiT9do.lean.js → guides_github.md.c0gdGJ-D.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.Dz8Cnudp.js → reference_channels.md.DBGcaB7m.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Dz8Cnudp.lean.js → reference_channels.md.DBGcaB7m.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/filesystem.md +376 -0
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +5 -0
- 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 +4 -4
- package/dist/docs/llms-full.txt +406 -0
- package/dist/docs/llms.txt +1 -0
- 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 +6 -6
- package/dist/docs/reference/channels.md +20 -0
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.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/result.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 +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +4 -4
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +4 -4
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/filesystem.d.ts +440 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1694 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/continuation-channel.d.ts +4 -2
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +21 -12
- package/dist/internal/continuation-identity.d.ts +13 -5
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +74 -35
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +80 -8
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +3 -0
- package/dist/internal/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +175 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +213 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +212 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +618 -0
- package/dist/internal/filesystem/walk.d.ts +74 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +339 -0
- package/dist/internal/guest-network.d.ts +5 -2
- package/dist/internal/guest-network.d.ts.map +1 -1
- package/dist/internal/guest-network.js +7 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +12 -2
- package/dist/internal/sdk-runner.d.ts +1 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +3 -1
- package/dist/internal/session-engine.d.ts +22 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +362 -40
- package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -0
- package/dist/playground/assets/{index-59KvgREd.js → index-8YiozU89.js} +38 -38
- package/dist/playground/index.html +1 -1
- package/dist/types.d.ts +51 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/design/filesystem.md +376 -0
- package/docs/guides/github.md +5 -0
- package/docs/reference/channels.md +20 -0
- package/package.json +16 -2
- package/src/channels/change-monitors/change-monitors-channel.ts +62 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +44 -0
- package/src/channels/github/defaults.ts +4 -0
- package/src/channels/github/progress.ts +76 -10
- package/src/channels/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +51 -0
- package/src/channels/issues/types.ts +41 -0
- package/src/filesystem.ts +2074 -0
- package/src/index.ts +28 -0
- package/src/internal/continuation-channel.ts +29 -12
- package/src/internal/continuation-identity.ts +122 -37
- package/src/internal/discovery/agent.ts +87 -1
- package/src/internal/discovery/info.ts +3 -0
- package/src/internal/factory-resource-channel.ts +122 -0
- package/src/internal/filesystem/errors.ts +220 -0
- package/src/internal/filesystem/format.ts +276 -0
- package/src/internal/filesystem/merge.ts +195 -0
- package/src/internal/filesystem/scratch.ts +255 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +821 -0
- package/src/internal/filesystem/walk.ts +369 -0
- package/src/internal/guest-network.ts +8 -2
- package/src/internal/hosted-delivery.ts +18 -1
- package/src/internal/sdk-runner.ts +4 -0
- package/src/internal/session-engine.ts +439 -29
- package/src/internal/testing/factory-resource-fixtures.ts +85 -0
- package/src/types.ts +49 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +0 -1
|
@@ -28,6 +28,27 @@ export interface GitHubProgressPhaseCopy {
|
|
|
28
28
|
export interface GitHubCommitStatusProgress extends GitHubProgressPhaseCopy {
|
|
29
29
|
/** Check run name (unique per check in the merge box). */
|
|
30
30
|
context: string;
|
|
31
|
+
/**
|
|
32
|
+
* Check Details URL for this session. When it resolves, it is written as
|
|
33
|
+
* `details_url` and (with {@link summaryLinkText}) appended to the summary.
|
|
34
|
+
*/
|
|
35
|
+
detailsUrl?: (sessionId: string) => string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* `output.title` source. `"phase"` (default) uses the pending/success/
|
|
38
|
+
* failure copy. `"context"` uses the check name — the dashboard automation
|
|
39
|
+
* shape (`Cursor Security Agent: …`).
|
|
40
|
+
*/
|
|
41
|
+
outputTitle?: "phase" | "context";
|
|
42
|
+
/**
|
|
43
|
+
* Markdown link label appended to the summary when {@link detailsUrl}
|
|
44
|
+
* resolves, e.g. `"View agent"`.
|
|
45
|
+
*/
|
|
46
|
+
summaryLinkText?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Conclusion for the failure phase. Default `"failure"`. Use `"neutral"`
|
|
49
|
+
* when a red merge-box check must not gate merge (findings live on the PR).
|
|
50
|
+
*/
|
|
51
|
+
failureConclusion?: "failure" | "neutral";
|
|
31
52
|
}
|
|
32
53
|
|
|
33
54
|
export type GitHubBannerProgress = GitHubProgressPhaseCopy;
|
|
@@ -125,6 +146,7 @@ function progressLabel(
|
|
|
125
146
|
*/
|
|
126
147
|
export async function applyGitHubProgress(input: {
|
|
127
148
|
phase: GitHubProgressPhase;
|
|
149
|
+
sessionId?: string;
|
|
128
150
|
channel: { state: GitHubChannelState };
|
|
129
151
|
options: GitHubProgressOptions;
|
|
130
152
|
}): Promise<void> {
|
|
@@ -139,6 +161,7 @@ export async function applyGitHubProgress(input: {
|
|
|
139
161
|
tasks.push(
|
|
140
162
|
postProgressCheckRun({
|
|
141
163
|
phase: input.phase,
|
|
164
|
+
sessionId: input.sessionId,
|
|
142
165
|
channel: input.channel,
|
|
143
166
|
options: input.options,
|
|
144
167
|
commitStatus,
|
|
@@ -159,8 +182,35 @@ export async function applyGitHubProgress(input: {
|
|
|
159
182
|
await Promise.all(tasks);
|
|
160
183
|
}
|
|
161
184
|
|
|
185
|
+
function resolveProgressDetailsUrl(input: {
|
|
186
|
+
sessionId: string | undefined;
|
|
187
|
+
commitStatus: GitHubCommitStatusProgress;
|
|
188
|
+
}): string | undefined {
|
|
189
|
+
if (
|
|
190
|
+
input.sessionId === undefined ||
|
|
191
|
+
input.commitStatus.detailsUrl === undefined
|
|
192
|
+
) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
const url = input.commitStatus.detailsUrl(input.sessionId)?.trim();
|
|
196
|
+
return url === "" ? undefined : url;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function appendSummaryLink(
|
|
200
|
+
summary: string,
|
|
201
|
+
detailsUrl?: string,
|
|
202
|
+
linkText?: string
|
|
203
|
+
): string {
|
|
204
|
+
const label = linkText?.trim();
|
|
205
|
+
if (detailsUrl === undefined || label === undefined || label === "") {
|
|
206
|
+
return summary;
|
|
207
|
+
}
|
|
208
|
+
return `${summary}\n\n[${label}](${detailsUrl})`;
|
|
209
|
+
}
|
|
210
|
+
|
|
162
211
|
async function postProgressCheckRun(input: {
|
|
163
212
|
phase: GitHubProgressPhase;
|
|
213
|
+
sessionId?: string;
|
|
164
214
|
channel: { state: GitHubChannelState };
|
|
165
215
|
options: GitHubProgressOptions;
|
|
166
216
|
commitStatus: GitHubCommitStatusProgress;
|
|
@@ -175,17 +225,32 @@ async function postProgressCheckRun(input: {
|
|
|
175
225
|
return;
|
|
176
226
|
}
|
|
177
227
|
const sha = state.headSha;
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
228
|
+
const phaseCopy = progressPhaseCopy({
|
|
229
|
+
copy: input.commitStatus,
|
|
230
|
+
phase: input.phase,
|
|
231
|
+
label: progressLabel(input.options, input.commitStatus.context),
|
|
232
|
+
});
|
|
233
|
+
const title = clipStatusDescription(
|
|
234
|
+
input.commitStatus.outputTitle === "context"
|
|
235
|
+
? input.commitStatus.context
|
|
236
|
+
: phaseCopy
|
|
184
237
|
);
|
|
238
|
+
const detailsUrl = resolveProgressDetailsUrl({
|
|
239
|
+
sessionId: input.sessionId,
|
|
240
|
+
commitStatus: input.commitStatus,
|
|
241
|
+
});
|
|
185
242
|
const write: GitHubCheckRunWriteInput = {
|
|
186
243
|
name: input.commitStatus.context,
|
|
187
|
-
...checkRunPhaseFields(input.phase),
|
|
188
|
-
|
|
244
|
+
...checkRunPhaseFields(input.phase, input.commitStatus.failureConclusion),
|
|
245
|
+
...(detailsUrl === undefined ? {} : { detailsUrl }),
|
|
246
|
+
output: {
|
|
247
|
+
title,
|
|
248
|
+
summary: appendSummaryLink(
|
|
249
|
+
phaseCopy,
|
|
250
|
+
detailsUrl,
|
|
251
|
+
input.commitStatus.summaryLinkText
|
|
252
|
+
),
|
|
253
|
+
},
|
|
189
254
|
};
|
|
190
255
|
const resource = {
|
|
191
256
|
api: input.options.api,
|
|
@@ -249,14 +314,15 @@ function shouldRecreateCheckRun(
|
|
|
249
314
|
}
|
|
250
315
|
|
|
251
316
|
function checkRunPhaseFields(
|
|
252
|
-
phase: GitHubProgressPhase
|
|
317
|
+
phase: GitHubProgressPhase,
|
|
318
|
+
failureConclusion: "failure" | "neutral" = "failure"
|
|
253
319
|
): Pick<GitHubCheckRunWriteInput, "conclusion" | "status"> {
|
|
254
320
|
if (phase === "pending") {
|
|
255
321
|
return { status: "in_progress" };
|
|
256
322
|
}
|
|
257
323
|
return {
|
|
258
324
|
status: "completed",
|
|
259
|
-
conclusion: phase === "success" ? "success" :
|
|
325
|
+
conclusion: phase === "success" ? "success" : failureConclusion,
|
|
260
326
|
};
|
|
261
327
|
}
|
|
262
328
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createFactoryResourceChannel } from "../../internal/factory-resource-channel.js";
|
|
3
|
+
import type { ChannelDefinition } from "../../types.js";
|
|
4
|
+
import {
|
|
5
|
+
ISSUE_CREATED_EVENT_TYPE,
|
|
6
|
+
type IssueCreatedEvent,
|
|
7
|
+
type IssuesChannelOptions,
|
|
8
|
+
} from "./types.js";
|
|
9
|
+
|
|
10
|
+
const issueResourceSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
name: z.string().min(1),
|
|
13
|
+
title: z.string().min(1),
|
|
14
|
+
body: z.string().min(1),
|
|
15
|
+
state: z
|
|
16
|
+
.enum(["STATE_UNSPECIFIED", "STATE_OPEN", "STATE_CLOSED"])
|
|
17
|
+
.optional(),
|
|
18
|
+
createTime: z.string().min(1).optional(),
|
|
19
|
+
updateTime: z.string().min(1).optional(),
|
|
20
|
+
path: z.string().optional(),
|
|
21
|
+
etag: z.string().optional(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
24
|
+
|
|
25
|
+
const issueCreatedEventSchema: z.ZodType<IssueCreatedEvent> = z.object({
|
|
26
|
+
eventId: z.string().min(1),
|
|
27
|
+
eventType: z.literal(ISSUE_CREATED_EVENT_TYPE),
|
|
28
|
+
teamId: z.string().min(1),
|
|
29
|
+
occurredAtMs: z.number().int().nonnegative(),
|
|
30
|
+
issue: issueResourceSchema,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const pack = createFactoryResourceChannel({
|
|
34
|
+
kind: "issues",
|
|
35
|
+
eventTypes: [ISSUE_CREATED_EVENT_TYPE],
|
|
36
|
+
eventSchema: issueCreatedEventSchema,
|
|
37
|
+
replayDescription: "Replay a Factory issue-created event.",
|
|
38
|
+
invalidError: "invalid issue event",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function issuesChannel(
|
|
42
|
+
options: IssuesChannelOptions
|
|
43
|
+
): ChannelDefinition {
|
|
44
|
+
return pack.channel(options);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getIssuesChannelOptions(
|
|
48
|
+
definition: object
|
|
49
|
+
): IssuesChannelOptions | undefined {
|
|
50
|
+
return pack.getOptions(definition);
|
|
51
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ContinuationIdentity } from "../../internal/continuation-identity.js";
|
|
2
|
+
import type { ChannelDefinition, ChannelHandlerArgs } from "../../types.js";
|
|
3
|
+
|
|
4
|
+
export const ISSUE_CREATED_EVENT_TYPE = "issue.created" as const;
|
|
5
|
+
|
|
6
|
+
export type IssueCreatedEventType = typeof ISSUE_CREATED_EVENT_TYPE;
|
|
7
|
+
|
|
8
|
+
export type IssueState = "STATE_UNSPECIFIED" | "STATE_OPEN" | "STATE_CLOSED";
|
|
9
|
+
|
|
10
|
+
/** Factory Issue JSON (camelCase proto JSON). */
|
|
11
|
+
export type IssueResource = {
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
state?: IssueState;
|
|
16
|
+
createTime?: string;
|
|
17
|
+
updateTime?: string;
|
|
18
|
+
path?: string;
|
|
19
|
+
etag?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Factory `issue.created` for every Issue create. */
|
|
23
|
+
export type IssueCreatedEvent = {
|
|
24
|
+
eventId: string;
|
|
25
|
+
eventType: IssueCreatedEventType;
|
|
26
|
+
teamId: string;
|
|
27
|
+
occurredAtMs: number;
|
|
28
|
+
issue: IssueResource;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type IssuesChannelOptions = {
|
|
32
|
+
onEvent: (
|
|
33
|
+
event: IssueCreatedEvent,
|
|
34
|
+
args: ChannelHandlerArgs
|
|
35
|
+
) => Promise<unknown> | unknown;
|
|
36
|
+
continuation?: ContinuationIdentity;
|
|
37
|
+
path?: string;
|
|
38
|
+
auth?: ChannelDefinition["auth"];
|
|
39
|
+
onStart?: ChannelDefinition["onStart"];
|
|
40
|
+
onStop?: ChannelDefinition["onStop"];
|
|
41
|
+
};
|