@cursor/july 0.1.73 → 0.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -8
- package/dist/bin/agent-serve.js +7 -5
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.CdbcFD8T.js → app.BETd-WqU.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DM5INS71.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.D_NKImM7.js → VPLocalSearchBox.wEaGEmV9.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CMvz7cu9.js → theme.DNDicFOP.js} +2 -2
- package/dist/docs/assets/{reference_cli.md.Cl14Jfo3.js → reference_cli.md.TAaYU8br.js} +3 -3
- package/dist/docs/assets/{reference_cli.md.Cl14Jfo3.lean.js → reference_cli.md.TAaYU8br.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.CiGsJ1aw.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.CrWSA0Ko.lean.js → scaffolding-agents.md.CiGsJ1aw.lean.js} +1 -1
- 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 +3 -3
- 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 +3 -3
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +6 -6
- 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 +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +5 -5
- 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 +3 -3
- package/dist/internal/cli-skills.d.ts +4 -2
- package/dist/internal/cli-skills.d.ts.map +1 -1
- package/dist/internal/cli-skills.js +8 -3
- package/dist/internal/install-cursor-skills.d.ts +71 -16
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +160 -48
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +6 -2
- package/dist/playground/assets/index-D_8I9TM0.js +85 -0
- package/dist/playground/assets/index-M3nSMc6_.css +1 -0
- package/dist/playground/index.html +2 -2
- package/docs/reference/cli.md +16 -8
- package/docs/scaffolding-agents.md +14 -6
- package/package.json +3 -1
- package/scripts/install-cursor-skills.mjs +36 -0
- package/skills/ab/SKILL.md +1 -1
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +1 -1
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/bin/agent-serve.ts +7 -5
- package/src/internal/cli-skills.ts +10 -2
- package/src/internal/install-cursor-skills.ts +204 -49
- package/src/internal/sdk-runner.ts +6 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +0 -1
- package/dist/docs/assets/scaffolding-agents.md.CrWSA0Ko.js +0 -1
- package/dist/playground/assets/index-77uhu5Kr.css +0 -1
- package/dist/playground/assets/index-D4buox4m.js +0 -85
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-skills.d.ts","sourceRoot":"","sources":["../../src/internal/cli-skills.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cli-skills.d.ts","sourceRoot":"","sources":["../../src/internal/cli-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `install-skills` — install the package's coding-agent skills into
|
|
3
|
-
* `~/.cursor/skills/
|
|
3
|
+
* `~/.cursor/skills/agentsdk/` without running `init`.
|
|
4
4
|
*
|
|
5
5
|
* Never prompts: running the command is the confirmation. The interactive
|
|
6
|
-
* offer lives in `init`.
|
|
6
|
+
* offer lives in `init`. Consumer `npm install` / `npx` copies the same
|
|
7
|
+
* skills in postinstall (with `alwaysApply: true` so Cursor injects them);
|
|
8
|
+
* this command refreshes them without reinstalling.
|
|
7
9
|
*/
|
|
8
10
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
11
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -15,7 +17,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
17
|
});
|
|
16
18
|
};
|
|
17
19
|
import { CLI_COMMAND_NAME } from "./distribution.js";
|
|
18
|
-
import { formatSkillInstall, installCursorSkills, planSkillInstall, } from "./install-cursor-skills.js";
|
|
20
|
+
import { formatSkillInstall, installCursorSkills, LEGACY_CURSOR_SKILLS_NAMESPACE, planSkillInstall, } from "./install-cursor-skills.js";
|
|
19
21
|
import { stdoutPalette } from "./terminal-style.js";
|
|
20
22
|
export function cmdInstallSkills() {
|
|
21
23
|
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
@@ -67,6 +69,9 @@ function previewBlock(plan) {
|
|
|
67
69
|
if (plan.orphans.length > 0) {
|
|
68
70
|
lines.push(` removes: ${plan.orphans.join(", ")}`);
|
|
69
71
|
}
|
|
72
|
+
if (plan.hasLegacyNamespace) {
|
|
73
|
+
lines.push(` removes: ${LEGACY_CURSOR_SKILLS_NAMESPACE}/ (legacy namespace)`);
|
|
74
|
+
}
|
|
70
75
|
lines.push(` location: ${plan.directory}`);
|
|
71
76
|
return `${lines.join("\n")}\n`;
|
|
72
77
|
}
|
|
@@ -1,35 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Offer to install the package's coding-agent skills into the user's
|
|
3
|
-
* personal Cursor skills dir under `~/.cursor/skills/
|
|
3
|
+
* personal Cursor skills dir under `~/.cursor/skills/agentsdk/<skill>/`.
|
|
4
4
|
*
|
|
5
|
-
* Cursor walks `~/.cursor/skills` recursively, so the `
|
|
5
|
+
* Cursor walks `~/.cursor/skills` recursively, so the `agentsdk/` folder is
|
|
6
6
|
* only organizational — identity comes from the leaf folder that holds
|
|
7
|
-
* SKILL.md.
|
|
7
|
+
* SKILL.md. Installed copies get `alwaysApply: true` so Cursor injects the
|
|
8
|
+
* skill body as a global rule instead of leaving it as an on-demand catalog
|
|
9
|
+
* entry. Skipped for `--json` / non-TTY hosts.
|
|
10
|
+
*
|
|
11
|
+
* Consumer installs (`npm install` / `npx` of `@cursor/july`) also copy
|
|
12
|
+
* these skills from a postinstall hook. That path never prompts and never
|
|
13
|
+
* fails the package install. The monorepo source checkout is not a consumer
|
|
14
|
+
* install, so `pnpm install` in everysphere does not overwrite `~/.cursor`.
|
|
8
15
|
*/
|
|
9
16
|
/** Category folder under ~/.cursor/skills (Cursor discovers nested skills). */
|
|
10
|
-
export declare const CURSOR_SKILLS_NAMESPACE = "
|
|
17
|
+
export declare const CURSOR_SKILLS_NAMESPACE = "agentsdk";
|
|
18
|
+
/** Pre-rename install folder. Install deletes this so `/agentkit-*` rows disappear. */
|
|
19
|
+
export declare const LEGACY_CURSOR_SKILLS_NAMESPACE = "agentkit";
|
|
11
20
|
/** How long the `init` offer waits for an answer before skipping the install. */
|
|
12
21
|
export declare const SKILL_PROMPT_TIMEOUT_MS = 45000;
|
|
22
|
+
/**
|
|
23
|
+
* Override the resolved `~/.cursor/skills` directory (not the user home).
|
|
24
|
+
* Used by the postinstall hook in tests and publish smoke.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CURSOR_JULY_SKILLS_HOME_ENV = "CURSOR_JULY_SKILLS_HOME";
|
|
27
|
+
/** Set to `1` to skip the postinstall skill copy. */
|
|
28
|
+
export declare const CURSOR_JULY_SKIP_SKILL_INSTALL_ENV = "CURSOR_JULY_SKIP_SKILL_INSTALL";
|
|
13
29
|
export interface PackageSkill {
|
|
14
|
-
/** Frontmatter `name` (e.g.
|
|
30
|
+
/** Frontmatter `name` (e.g. agentsdk-create-agent). */
|
|
15
31
|
name: string;
|
|
16
|
-
/** Leaf install directory under
|
|
32
|
+
/** Leaf install directory under agentsdk/ (e.g. create-agent). */
|
|
17
33
|
leafDir: string;
|
|
18
34
|
/** Absolute path to the source skill directory in the package. */
|
|
19
35
|
sourceDir: string;
|
|
20
36
|
}
|
|
21
37
|
export declare function cursorSkillsHome(home?: string): string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
/**
|
|
39
|
+
* True when this package root is an installed copy under `node_modules`
|
|
40
|
+
* (npm, pnpm, yarn, npx, global), not the everysphere source checkout.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isConsumerPackageInstall(packageRoot: string): boolean;
|
|
43
|
+
/** `~/.cursor/skills/agentsdk` — where package skills are installed. */
|
|
44
|
+
export declare function agentsdkCursorSkillsDir(skillsHome?: string): string;
|
|
45
|
+
/** Pre-rename `~/.cursor/skills/agentkit`. */
|
|
46
|
+
export declare function legacyAgentkitCursorSkillsDir(skillsHome?: string): string;
|
|
47
|
+
/** Absolute install path for one skill: `…/agentsdk/<leafDir>`. */
|
|
25
48
|
export declare function skillInstallPath(skill: Pick<PackageSkill, "leafDir">, skillsHome?: string): string;
|
|
26
49
|
/**
|
|
27
50
|
* Skills shipped next to the running package. Uses the frontmatter `name`
|
|
28
|
-
* when present, otherwise `
|
|
51
|
+
* when present, otherwise `agentsdk-<dir>`.
|
|
29
52
|
*/
|
|
30
53
|
export declare function listShippedPackageSkills(packageRoot?: string): Promise<PackageSkill[]>;
|
|
31
54
|
/**
|
|
32
|
-
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/
|
|
55
|
+
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/agentsdk/.
|
|
33
56
|
* Install still overwrites every shipped skill when the user confirms — this
|
|
34
57
|
* helper is for messaging (fresh install vs update).
|
|
35
58
|
*/
|
|
@@ -42,20 +65,27 @@ export interface SkillInstallResult {
|
|
|
42
65
|
installed: string[];
|
|
43
66
|
/** Leaf dirs deleted because the package no longer ships them. */
|
|
44
67
|
removed: string[];
|
|
68
|
+
/** True when leftover `~/.cursor/skills/agentkit` was deleted. */
|
|
69
|
+
removedLegacyNamespace: boolean;
|
|
45
70
|
}
|
|
46
71
|
/**
|
|
47
|
-
* Copy each skill directory into `skillsHome/
|
|
72
|
+
* Copy each skill directory into `skillsHome/agentsdk/<leafDir>/`.
|
|
48
73
|
* Always overwrites so a package upgrade refreshes local Cursor skills.
|
|
49
|
-
* Strips monorepo-only frontmatter
|
|
74
|
+
* Strips monorepo-only frontmatter, sets `alwaysApply: true` so Cursor
|
|
75
|
+
* loads the body into context, and removes leaf dirs no longer shipped.
|
|
76
|
+
* Also deletes leftover `skillsHome/agentkit/` from the previous namespace.
|
|
50
77
|
*/
|
|
51
78
|
export declare function installCursorSkills(skills: readonly PackageSkill[], skillsHome?: string): Promise<SkillInstallResult>;
|
|
52
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Drop monorepo `paths` globs, set `alwaysApply: true` so Cursor injects the
|
|
81
|
+
* body as a global rule, and fix package doc links for ~/.cursor installs.
|
|
82
|
+
*/
|
|
53
83
|
export declare function prepareSkillMarkdownForCursorInstall(content: string): string;
|
|
54
84
|
export interface SkillInstallPlan {
|
|
55
85
|
shipped: PackageSkill[];
|
|
56
86
|
/** Resolved `~/.cursor/skills`, to install into. */
|
|
57
87
|
skillsHome: string;
|
|
58
|
-
/** Install target: `<skillsHome>/
|
|
88
|
+
/** Install target: `<skillsHome>/agentsdk`. */
|
|
59
89
|
directory: string;
|
|
60
90
|
/** Leaf dirs the package ships. */
|
|
61
91
|
leaves: string[];
|
|
@@ -63,6 +93,8 @@ export interface SkillInstallPlan {
|
|
|
63
93
|
firstInstall: boolean;
|
|
64
94
|
/** Installed leaf dirs the package dropped; installing deletes them. */
|
|
65
95
|
orphans: string[];
|
|
96
|
+
/** True when leftover `skillsHome/agentkit` still exists. */
|
|
97
|
+
hasLegacyNamespace: boolean;
|
|
66
98
|
}
|
|
67
99
|
/** What an install would do, for the offer and for `install-skills`. */
|
|
68
100
|
export declare function planSkillInstall(options?: {
|
|
@@ -71,6 +103,29 @@ export declare function planSkillInstall(options?: {
|
|
|
71
103
|
}): Promise<SkillInstallPlan>;
|
|
72
104
|
/** `Installed 9 Agent SDK skills`, what it dropped, and where it went. */
|
|
73
105
|
export declare function formatSkillInstall(plan: SkillInstallPlan, result: SkillInstallResult): string;
|
|
106
|
+
export type PackageInstallSkillSyncResult = {
|
|
107
|
+
status: "installed";
|
|
108
|
+
installed: string[];
|
|
109
|
+
removed: string[];
|
|
110
|
+
} | {
|
|
111
|
+
status: "skipped";
|
|
112
|
+
reason: "opt-out" | "not-consumer" | "no-skills" | "error";
|
|
113
|
+
};
|
|
114
|
+
export interface SyncCursorSkillsOnPackageInstallOptions {
|
|
115
|
+
packageRoot?: string;
|
|
116
|
+
skillsHome?: string;
|
|
117
|
+
env?: NodeJS.ProcessEnv;
|
|
118
|
+
/** Override the node_modules consumer check. */
|
|
119
|
+
consumer?: boolean;
|
|
120
|
+
out?: (text: string) => void;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Copy shipped coding-agent skills into ~/.cursor/skills/agentsdk during a
|
|
124
|
+
* consumer `npm install` / `npx`. Never throws: a failed copy must not fail
|
|
125
|
+
* the package install. No-op in the monorepo source tree and when
|
|
126
|
+
* `CURSOR_JULY_SKIP_SKILL_INSTALL=1`.
|
|
127
|
+
*/
|
|
128
|
+
export declare function syncCursorSkillsOnPackageInstall(options?: SyncCursorSkillsOnPackageInstallOptions): Promise<PackageInstallSkillSyncResult>;
|
|
74
129
|
export interface OfferInstallCursorSkillsOptions {
|
|
75
130
|
/** Skip when false (non-TTY / `--json`). */
|
|
76
131
|
interactive?: boolean;
|
|
@@ -82,7 +137,7 @@ export interface OfferInstallCursorSkillsOptions {
|
|
|
82
137
|
}
|
|
83
138
|
/**
|
|
84
139
|
* On a TTY, offer to install/update every shipped package skill into
|
|
85
|
-
* ~/.cursor/skills/
|
|
140
|
+
* ~/.cursor/skills/agentsdk (always overwriting). No-op when non-interactive
|
|
86
141
|
* or the package ships no skills. An unanswered prompt skips the install
|
|
87
142
|
* rather than blocking the caller — see `SKILL_PROMPT_TIMEOUT_MS`.
|
|
88
143
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,uFAAuF;AACvF,eAAO,MAAM,8BAA8B,aAAa,CAAC;AAEzD,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE,qDAAqD;AACrD,eAAO,MAAM,kCAAkC,mCACb,CAAC;AAEnC,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,kE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,+BAA+B;IAC9C,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAC7D,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAkEpD;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAsB9B"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Offer to install the package's coding-agent skills into the user's
|
|
3
|
-
* personal Cursor skills dir under `~/.cursor/skills/
|
|
3
|
+
* personal Cursor skills dir under `~/.cursor/skills/agentsdk/<skill>/`.
|
|
4
4
|
*
|
|
5
|
-
* Cursor walks `~/.cursor/skills` recursively, so the `
|
|
5
|
+
* Cursor walks `~/.cursor/skills` recursively, so the `agentsdk/` folder is
|
|
6
6
|
* only organizational — identity comes from the leaf folder that holds
|
|
7
|
-
* SKILL.md.
|
|
7
|
+
* SKILL.md. Installed copies get `alwaysApply: true` so Cursor injects the
|
|
8
|
+
* skill body as a global rule instead of leaving it as an on-demand catalog
|
|
9
|
+
* entry. Skipped for `--json` / non-TTY hosts.
|
|
10
|
+
*
|
|
11
|
+
* Consumer installs (`npm install` / `npx` of `@cursor/july`) also copy
|
|
12
|
+
* these skills from a postinstall hook. That path never prompts and never
|
|
13
|
+
* fails the package install. The monorepo source checkout is not a consumer
|
|
14
|
+
* install, so `pnpm install` in everysphere does not overwrite `~/.cursor`.
|
|
8
15
|
*/
|
|
9
16
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
17
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -19,40 +26,67 @@ import { access, chmod, cp, mkdir, readdir, readFile, rm, stat, writeFile, } fro
|
|
|
19
26
|
import { homedir } from "node:os";
|
|
20
27
|
import { join } from "node:path";
|
|
21
28
|
import { CLI_COMMAND_NAME, packageRootDir } from "./distribution.js";
|
|
29
|
+
import { parseFrontmatter } from "./frontmatter.js";
|
|
22
30
|
import { stdoutPalette } from "./terminal-style.js";
|
|
23
31
|
/** Monorepo-only skill; excluded from the published package. */
|
|
24
32
|
const SKIP_SKILL_DIRS = new Set(["operate"]);
|
|
25
33
|
/** Category folder under ~/.cursor/skills (Cursor discovers nested skills). */
|
|
26
|
-
export const CURSOR_SKILLS_NAMESPACE = "
|
|
34
|
+
export const CURSOR_SKILLS_NAMESPACE = "agentsdk";
|
|
35
|
+
/** Pre-rename install folder. Install deletes this so `/agentkit-*` rows disappear. */
|
|
36
|
+
export const LEGACY_CURSOR_SKILLS_NAMESPACE = "agentkit";
|
|
27
37
|
/** How long the `init` offer waits for an answer before skipping the install. */
|
|
28
38
|
export const SKILL_PROMPT_TIMEOUT_MS = 45000;
|
|
39
|
+
/**
|
|
40
|
+
* Override the resolved `~/.cursor/skills` directory (not the user home).
|
|
41
|
+
* Used by the postinstall hook in tests and publish smoke.
|
|
42
|
+
*/
|
|
43
|
+
export const CURSOR_JULY_SKILLS_HOME_ENV = "CURSOR_JULY_SKILLS_HOME";
|
|
44
|
+
/** Set to `1` to skip the postinstall skill copy. */
|
|
45
|
+
export const CURSOR_JULY_SKIP_SKILL_INSTALL_ENV = "CURSOR_JULY_SKIP_SKILL_INSTALL";
|
|
29
46
|
export function cursorSkillsHome(home) {
|
|
30
47
|
var _a;
|
|
31
|
-
if (home
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
if (home !== undefined) {
|
|
49
|
+
return join(home.trim() === "" ? homedir() : home, ".cursor", "skills");
|
|
50
|
+
}
|
|
51
|
+
const override = (_a = process.env[CURSOR_JULY_SKILLS_HOME_ENV]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
52
|
+
if (override !== undefined && override !== "") {
|
|
53
|
+
return override;
|
|
54
|
+
}
|
|
55
|
+
return join(homedir(), ".cursor", "skills");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* True when this package root is an installed copy under `node_modules`
|
|
59
|
+
* (npm, pnpm, yarn, npx, global), not the everysphere source checkout.
|
|
60
|
+
*/
|
|
61
|
+
export function isConsumerPackageInstall(packageRoot) {
|
|
62
|
+
// Segment check only — split on both separators so a Windows path still
|
|
63
|
+
// matches when this runs (or is tested) on POSIX. Do not rewrite the path.
|
|
64
|
+
return packageRoot.split(/[\\/]/).includes("node_modules");
|
|
34
65
|
}
|
|
35
|
-
/** `~/.cursor/skills/
|
|
36
|
-
export function
|
|
66
|
+
/** `~/.cursor/skills/agentsdk` — where package skills are installed. */
|
|
67
|
+
export function agentsdkCursorSkillsDir(skillsHome = cursorSkillsHome()) {
|
|
37
68
|
return join(skillsHome, CURSOR_SKILLS_NAMESPACE);
|
|
38
69
|
}
|
|
39
|
-
/**
|
|
70
|
+
/** Pre-rename `~/.cursor/skills/agentkit`. */
|
|
71
|
+
export function legacyAgentkitCursorSkillsDir(skillsHome = cursorSkillsHome()) {
|
|
72
|
+
return join(skillsHome, LEGACY_CURSOR_SKILLS_NAMESPACE);
|
|
73
|
+
}
|
|
74
|
+
/** Absolute install path for one skill: `…/agentsdk/<leafDir>`. */
|
|
40
75
|
export function skillInstallPath(skill, skillsHome = cursorSkillsHome()) {
|
|
41
|
-
return join(
|
|
76
|
+
return join(agentsdkCursorSkillsDir(skillsHome), skill.leafDir);
|
|
42
77
|
}
|
|
43
78
|
/**
|
|
44
79
|
* Skills shipped next to the running package. Uses the frontmatter `name`
|
|
45
|
-
* when present, otherwise `
|
|
80
|
+
* when present, otherwise `agentsdk-<dir>`.
|
|
46
81
|
*/
|
|
47
82
|
export function listShippedPackageSkills() {
|
|
48
83
|
return __awaiter(this, arguments, void 0, function* (packageRoot = packageRootDir()) {
|
|
49
|
-
var _a;
|
|
50
84
|
const skillsRoot = join(packageRoot, "skills");
|
|
51
85
|
let entries;
|
|
52
86
|
try {
|
|
53
87
|
entries = yield readdir(skillsRoot, { withFileTypes: true });
|
|
54
88
|
}
|
|
55
|
-
catch (
|
|
89
|
+
catch (_a) {
|
|
56
90
|
return [];
|
|
57
91
|
}
|
|
58
92
|
const skills = [];
|
|
@@ -65,11 +99,12 @@ export function listShippedPackageSkills() {
|
|
|
65
99
|
try {
|
|
66
100
|
yield access(skillMd);
|
|
67
101
|
}
|
|
68
|
-
catch (
|
|
102
|
+
catch (_b) {
|
|
69
103
|
continue;
|
|
70
104
|
}
|
|
71
105
|
const raw = yield readFile(skillMd, "utf8");
|
|
72
|
-
const name = (
|
|
106
|
+
const name = parseFrontmatter(raw).data.name ||
|
|
107
|
+
`${CURSOR_SKILLS_NAMESPACE}-${entry.name}`;
|
|
73
108
|
skills.push({ name, leafDir: entry.name, sourceDir });
|
|
74
109
|
}
|
|
75
110
|
skills.sort((a, b) => a.leafDir.localeCompare(b.leafDir));
|
|
@@ -77,7 +112,7 @@ export function listShippedPackageSkills() {
|
|
|
77
112
|
});
|
|
78
113
|
}
|
|
79
114
|
/**
|
|
80
|
-
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/
|
|
115
|
+
* Skills that do not yet have a SKILL.md under ~/.cursor/skills/agentsdk/.
|
|
81
116
|
* Install still overwrites every shipped skill when the user confirms — this
|
|
82
117
|
* helper is for messaging (fresh install vs update).
|
|
83
118
|
*/
|
|
@@ -99,13 +134,15 @@ export function findMissingCursorSkills(options) {
|
|
|
99
134
|
});
|
|
100
135
|
}
|
|
101
136
|
/**
|
|
102
|
-
* Copy each skill directory into `skillsHome/
|
|
137
|
+
* Copy each skill directory into `skillsHome/agentsdk/<leafDir>/`.
|
|
103
138
|
* Always overwrites so a package upgrade refreshes local Cursor skills.
|
|
104
|
-
* Strips monorepo-only frontmatter
|
|
139
|
+
* Strips monorepo-only frontmatter, sets `alwaysApply: true` so Cursor
|
|
140
|
+
* loads the body into context, and removes leaf dirs no longer shipped.
|
|
141
|
+
* Also deletes leftover `skillsHome/agentkit/` from the previous namespace.
|
|
105
142
|
*/
|
|
106
143
|
export function installCursorSkills(skills_1) {
|
|
107
144
|
return __awaiter(this, arguments, void 0, function* (skills, skillsHome = cursorSkillsHome()) {
|
|
108
|
-
const namespaceDir =
|
|
145
|
+
const namespaceDir = agentsdkCursorSkillsDir(skillsHome);
|
|
109
146
|
yield mkdir(namespaceDir, { recursive: true });
|
|
110
147
|
const removed = yield orphanLeaves(namespaceDir, skills);
|
|
111
148
|
for (const leaf of removed) {
|
|
@@ -128,7 +165,8 @@ export function installCursorSkills(skills_1) {
|
|
|
128
165
|
}
|
|
129
166
|
installed.push(skill.leafDir);
|
|
130
167
|
}
|
|
131
|
-
|
|
168
|
+
const removedLegacyNamespace = yield removeLegacyCursorSkillsNamespace(skillsHome);
|
|
169
|
+
return { installed, removed, removedLegacyNamespace };
|
|
132
170
|
});
|
|
133
171
|
}
|
|
134
172
|
function makeTreeWritable(root) {
|
|
@@ -171,14 +209,42 @@ function orphanLeaves(namespaceDir, skills) {
|
|
|
171
209
|
.map((entry) => entry.name);
|
|
172
210
|
});
|
|
173
211
|
}
|
|
174
|
-
/** Drop
|
|
212
|
+
/** Drop leftover `skillsHome/agentkit` from the previous install namespace. */
|
|
213
|
+
function removeLegacyCursorSkillsNamespace(skillsHome) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const legacyDir = legacyAgentkitCursorSkillsDir(skillsHome);
|
|
216
|
+
try {
|
|
217
|
+
yield stat(legacyDir);
|
|
218
|
+
}
|
|
219
|
+
catch (_a) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
yield rm(legacyDir, { recursive: true, force: true });
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function hasLegacyCursorSkillsNamespace(skillsHome) {
|
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
try {
|
|
229
|
+
yield stat(legacyAgentkitCursorSkillsDir(skillsHome));
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
catch (_a) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Drop monorepo `paths` globs, set `alwaysApply: true` so Cursor injects the
|
|
239
|
+
* body as a global rule, and fix package doc links for ~/.cursor installs.
|
|
240
|
+
*/
|
|
175
241
|
export function prepareSkillMarkdownForCursorInstall(content) {
|
|
176
242
|
var _a;
|
|
177
243
|
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content);
|
|
178
244
|
if (match === null) {
|
|
179
245
|
return content;
|
|
180
246
|
}
|
|
181
|
-
const frontmatter = stripPathsFromFrontmatter((_a = match[1]) !== null && _a !== void 0 ? _a : "");
|
|
247
|
+
const frontmatter = withAlwaysApply(stripPathsFromFrontmatter((_a = match[1]) !== null && _a !== void 0 ? _a : ""));
|
|
182
248
|
const body = content.slice(match[0].length);
|
|
183
249
|
const adjustedBody = body.replace(/\[`docs\/([^`]+)`\]\(\.\.\/\.\.\/docs\/[^)]+\)/g, "docs/$1 in the @cursor/july package");
|
|
184
250
|
return `---\n${frontmatter.trimEnd()}\n---${adjustedBody}`;
|
|
@@ -201,24 +267,42 @@ function stripPathsFromFrontmatter(frontmatter) {
|
|
|
201
267
|
}
|
|
202
268
|
return out.join("\n");
|
|
203
269
|
}
|
|
270
|
+
/** Cursor loads `alwaysApply: true` skills as global rules, not catalog rows. */
|
|
271
|
+
function withAlwaysApply(frontmatter) {
|
|
272
|
+
const without = frontmatter
|
|
273
|
+
.split(/\r?\n/)
|
|
274
|
+
.filter((line) => !/^\s*alwaysApply\s*:/.test(line))
|
|
275
|
+
.join("\n")
|
|
276
|
+
.replace(/\n+$/, "");
|
|
277
|
+
if (without === "") {
|
|
278
|
+
return "alwaysApply: true";
|
|
279
|
+
}
|
|
280
|
+
return `${without}\nalwaysApply: true`;
|
|
281
|
+
}
|
|
204
282
|
/** What an install would do, for the offer and for `install-skills`. */
|
|
205
283
|
export function planSkillInstall(options) {
|
|
206
284
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
285
|
var _a;
|
|
208
286
|
const skillsHome = (_a = options === null || options === void 0 ? void 0 : options.skillsHome) !== null && _a !== void 0 ? _a : cursorSkillsHome();
|
|
209
|
-
const directory =
|
|
287
|
+
const directory = agentsdkCursorSkillsDir(skillsHome);
|
|
210
288
|
const shipped = yield listShippedPackageSkills(options === null || options === void 0 ? void 0 : options.packageRoot);
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
289
|
+
const present = yield Promise.all(shipped.map((skill) => __awaiter(this, void 0, void 0, function* () {
|
|
290
|
+
try {
|
|
291
|
+
yield access(join(skillInstallPath(skill, skillsHome), "SKILL.md"));
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
catch (_a) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
})));
|
|
215
298
|
return {
|
|
216
299
|
shipped,
|
|
217
300
|
skillsHome,
|
|
218
301
|
directory,
|
|
219
302
|
leaves: shipped.map((skill) => skill.leafDir),
|
|
220
|
-
firstInstall:
|
|
303
|
+
firstInstall: present.every((isPresent) => !isPresent),
|
|
221
304
|
orphans: yield orphanLeaves(directory, shipped),
|
|
305
|
+
hasLegacyNamespace: yield hasLegacyCursorSkillsNamespace(skillsHome),
|
|
222
306
|
};
|
|
223
307
|
});
|
|
224
308
|
}
|
|
@@ -230,12 +314,55 @@ export function formatSkillInstall(plan, result) {
|
|
|
230
314
|
if (result.removed.length > 0) {
|
|
231
315
|
lines.push(` removed: ${result.removed.join(", ")}`);
|
|
232
316
|
}
|
|
317
|
+
if (result.removedLegacyNamespace) {
|
|
318
|
+
lines.push(` removed: ${legacyAgentkitCursorSkillsDir(plan.skillsHome)} (legacy namespace)`);
|
|
319
|
+
}
|
|
233
320
|
lines.push(` location: ${plan.directory}`);
|
|
234
321
|
return `${lines.join("\n")}\n`;
|
|
235
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Copy shipped coding-agent skills into ~/.cursor/skills/agentsdk during a
|
|
325
|
+
* consumer `npm install` / `npx`. Never throws: a failed copy must not fail
|
|
326
|
+
* the package install. No-op in the monorepo source tree and when
|
|
327
|
+
* `CURSOR_JULY_SKIP_SKILL_INSTALL=1`.
|
|
328
|
+
*/
|
|
329
|
+
export function syncCursorSkillsOnPackageInstall() {
|
|
330
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
331
|
+
var _a, _b, _c, _d;
|
|
332
|
+
try {
|
|
333
|
+
const env = (_a = options.env) !== null && _a !== void 0 ? _a : process.env;
|
|
334
|
+
if (env[CURSOR_JULY_SKIP_SKILL_INSTALL_ENV] === "1") {
|
|
335
|
+
return { status: "skipped", reason: "opt-out" };
|
|
336
|
+
}
|
|
337
|
+
const packageRoot = (_b = options.packageRoot) !== null && _b !== void 0 ? _b : packageRootDir();
|
|
338
|
+
const consumer = (_c = options.consumer) !== null && _c !== void 0 ? _c : isConsumerPackageInstall(packageRoot);
|
|
339
|
+
if (!consumer) {
|
|
340
|
+
return { status: "skipped", reason: "not-consumer" };
|
|
341
|
+
}
|
|
342
|
+
const plan = yield planSkillInstall({
|
|
343
|
+
packageRoot,
|
|
344
|
+
skillsHome: options.skillsHome,
|
|
345
|
+
});
|
|
346
|
+
if (plan.shipped.length === 0) {
|
|
347
|
+
return { status: "skipped", reason: "no-skills" };
|
|
348
|
+
}
|
|
349
|
+
const result = yield installCursorSkills(plan.shipped, plan.skillsHome);
|
|
350
|
+
const out = (_d = options.out) !== null && _d !== void 0 ? _d : ((text) => process.stderr.write(text));
|
|
351
|
+
out(formatSkillInstall(plan, result));
|
|
352
|
+
return {
|
|
353
|
+
status: "installed",
|
|
354
|
+
installed: result.installed,
|
|
355
|
+
removed: result.removed,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
catch (_e) {
|
|
359
|
+
return { status: "skipped", reason: "error" };
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
236
363
|
/**
|
|
237
364
|
* On a TTY, offer to install/update every shipped package skill into
|
|
238
|
-
* ~/.cursor/skills/
|
|
365
|
+
* ~/.cursor/skills/agentsdk (always overwriting). No-op when non-interactive
|
|
239
366
|
* or the package ships no skills. An unanswered prompt skips the install
|
|
240
367
|
* rather than blocking the caller — see `SKILL_PROMPT_TIMEOUT_MS`.
|
|
241
368
|
*/
|
|
@@ -265,6 +392,9 @@ export function offerInstallCursorSkills() {
|
|
|
265
392
|
if (plan.orphans.length > 0) {
|
|
266
393
|
out(c.dim(` (deletes ${plan.orphans.join(", ")})\n`));
|
|
267
394
|
}
|
|
395
|
+
if (plan.hasLegacyNamespace) {
|
|
396
|
+
out(c.dim(` (deletes leftover ${legacyAgentkitCursorSkillsDir(plan.skillsHome)})\n`));
|
|
397
|
+
}
|
|
268
398
|
const confirm = (_c = options.confirm) !== null && _c !== void 0 ? _c : ((q) => promptYesNo(q, {
|
|
269
399
|
defaultYes: true,
|
|
270
400
|
out,
|
|
@@ -285,24 +415,6 @@ export function offerInstallCursorSkills() {
|
|
|
285
415
|
return { installed: result.installed, skipped: false };
|
|
286
416
|
});
|
|
287
417
|
}
|
|
288
|
-
function parseSkillName(skillMd) {
|
|
289
|
-
var _a;
|
|
290
|
-
var _b;
|
|
291
|
-
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(skillMd);
|
|
292
|
-
if (match === null) {
|
|
293
|
-
return undefined;
|
|
294
|
-
}
|
|
295
|
-
const nameLine = /^name:\s*(.+)\s*$/m.exec((_b = match[1]) !== null && _b !== void 0 ? _b : "");
|
|
296
|
-
if (nameLine === null) {
|
|
297
|
-
return undefined;
|
|
298
|
-
}
|
|
299
|
-
const raw = (_a = nameLine[1]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
300
|
-
if (raw === undefined || raw === "") {
|
|
301
|
-
return undefined;
|
|
302
|
-
}
|
|
303
|
-
// Strip optional quotes around the YAML scalar.
|
|
304
|
-
return raw.replace(/^["']|["']$/g, "");
|
|
305
|
-
}
|
|
306
418
|
/**
|
|
307
419
|
* Ask a yes/no question. Resolves `undefined` when the answer never comes —
|
|
308
420
|
* the prompt timed out, or stdin closed on an empty line.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-runner.d.ts","sourceRoot":"","sources":["../../src/internal/sdk-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"sdk-runner.d.ts","sourceRoot":"","sources":["../../src/internal/sdk-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AAGrB,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1D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AAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkC;IAElE,YAA6B,OAAO,GAAE,sBAA2B,EAShE;IAEK,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CA+B9D;YAEa,cAAc;IA2G5B;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAepE;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAY7B;IAED,OAAO,CAAC,QAAQ;IA0BhB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;IAmB1B;;;OAGG;YACW,iBAAiB;YAuBjB,SAAS;YAOT,cAAc;YA6Bd,cAAc;IA6C5B,OAAO,CAAC,QAAQ;CAajB;AAED,4EAA4E;AAC5E,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAMT;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CAQpE;AAwGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,CAExE"}
|
|
@@ -15,7 +15,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
import { mkdir } from "node:fs/promises";
|
|
18
|
-
import { Agent, Cursor, createAgentPlatform,
|
|
18
|
+
import { Agent, Cursor, createAgentPlatform, } from "@cursor/sdk";
|
|
19
|
+
import { SqliteLocalAgentStore } from "@cursor/sdk/sqlite";
|
|
19
20
|
import { DEFAULT_MODEL, } from "../types.js";
|
|
20
21
|
import { mapSdkTokenUsage, usageTokenSum } from "./cloud-turn-cost.js";
|
|
21
22
|
/**
|
|
@@ -399,7 +400,10 @@ export class CursorSdkRunner {
|
|
|
399
400
|
getStore(stateDir) {
|
|
400
401
|
let storePromise = this.stores.get(stateDir);
|
|
401
402
|
if (storePromise === undefined) {
|
|
402
|
-
storePromise = mkdir(stateDir, { recursive: true }).then(() =>
|
|
403
|
+
storePromise = mkdir(stateDir, { recursive: true }).then(() => SqliteLocalAgentStore.open({
|
|
404
|
+
stateRoot: stateDir,
|
|
405
|
+
workspaceRef: stateDir,
|
|
406
|
+
}));
|
|
403
407
|
this.stores.set(stateDir, storePromise);
|
|
404
408
|
}
|
|
405
409
|
return storePromise;
|