@cursor/july 0.1.79 → 0.1.82
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 +0 -12
- package/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +8 -1
- package/dist/channels/github/cursor-account.d.ts +28 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +60 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +29 -1
- package/dist/channels/github/types.d.ts +8 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +32 -10
- package/dist/channels/origin/types.d.ts +7 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/cursor-account.d.ts.map +1 -1
- package/dist/channels/slack/cursor-account.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +3 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +18 -18
- package/dist/channels/slack/interactive.d.ts +2 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +4 -16
- package/dist/channels/slack/slack-channel.d.ts +1 -1
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +21 -10
- package/dist/channels/slack/types.d.ts +7 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +4 -0
- package/dist/continuation.d.ts +20 -0
- package/dist/continuation.d.ts.map +1 -0
- package/dist/continuation.js +18 -0
- package/dist/files.d.ts +9 -3
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +9 -3
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/internal/continuation-channel.d.ts +29 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -0
- package/dist/internal/continuation-channel.js +88 -0
- package/dist/internal/continuation-identity.d.ts +95 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +445 -0
- package/dist/internal/deploy-manifest.d.ts +12 -2
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +15 -7
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +32 -5
- package/dist/internal/review-comments.d.ts +37 -7
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +209 -10
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +117 -55
- package/dist/internal/session-engine.d.ts +24 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +104 -34
- package/dist/internal/session-store.d.ts.map +1 -1
- package/dist/internal/session-store.js +6 -0
- package/dist/internal/skills-sync.d.ts +25 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +96 -0
- package/dist/playground/assets/{index-DJzcIeGt.css → index-ChETdG-_.css} +1 -1
- package/dist/playground/assets/{index-K3Sxyx0I.js → index-CkuIrhg4.js} +3 -3
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channels/github/api.ts +8 -0
- package/src/channels/github/cursor-account.ts +76 -0
- package/src/channels/github/github-channel.ts +52 -1
- package/src/channels/github/types.ts +8 -0
- package/src/channels/origin/origin-channel.ts +48 -10
- package/src/channels/origin/types.ts +7 -0
- package/src/channels/slack/cursor-account.ts +1 -0
- package/src/channels/slack/dispatch.ts +44 -2
- package/src/channels/slack/interactive.ts +5 -0
- package/src/channels/slack/slack-channel.ts +23 -2
- package/src/channels/slack/types.ts +7 -0
- package/src/channels.ts +7 -0
- package/src/continuation.ts +49 -0
- package/src/files.ts +10 -3
- package/src/index.ts +30 -1
- package/src/internal/continuation-channel.ts +129 -0
- package/src/internal/continuation-identity.ts +597 -0
- package/src/internal/deploy-manifest.ts +36 -3
- package/src/internal/discovery.ts +40 -2
- package/src/internal/review-comments.ts +257 -16
- package/src/internal/server.ts +146 -68
- package/src/internal/session-engine.ts +132 -37
- package/src/internal/session-store.ts +6 -0
- package/src/internal/skills-sync.ts +107 -0
- package/src/types.ts +55 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync authored skills into the deployment's Agent Store so cloud-runtime
|
|
3
|
+
* turns discover them natively. The engine writes through the hosted sink
|
|
4
|
+
* at store-root `skills/<name>/…`; the cloud VM is launched with
|
|
5
|
+
* `--agent-store-skills-dir /cursor/stores/deployment/skills` and walks that
|
|
6
|
+
* directory the same way it walks a user store.
|
|
7
|
+
*/
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
import { readFile } from "node:fs/promises";
|
|
18
|
+
import { posix } from "node:path";
|
|
19
|
+
import { agentStoreKeys, FileConflictError } from "../files.js";
|
|
20
|
+
import { STORAGE_KEY_ROOT } from "../storage.js";
|
|
21
|
+
import { buildSkillMd } from "./workspace.js";
|
|
22
|
+
/** Pre-native layout. Deleted on every sync so a rolled-forward deploy does not leave undiscoverable copies. */
|
|
23
|
+
function legacySkillsPrefix(agent) {
|
|
24
|
+
return `${STORAGE_KEY_ROOT}/${agent}/skills/`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Mirror the agent's skills onto the store: write every SKILL.md (with the
|
|
28
|
+
* same generated frontmatter local materialization uses) plus sibling files,
|
|
29
|
+
* and delete keys no authored skill claims so redeploys drop removed skills.
|
|
30
|
+
*
|
|
31
|
+
* Everything loads and validates before the store is touched, and writes
|
|
32
|
+
* land before stale deletes, so a failed sync never leaves a gap a
|
|
33
|
+
* concurrent cloud reader could see.
|
|
34
|
+
*/
|
|
35
|
+
export function syncSkillsToStore(args) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const desired = new Map();
|
|
38
|
+
for (const skill of args.skills) {
|
|
39
|
+
const key = (relPath) => agentStoreKeys.skillFile(skill.name, relPath);
|
|
40
|
+
desired.set(key("SKILL.md"), Buffer.from(buildSkillMd(skill), "utf8"));
|
|
41
|
+
for (const [relPath, source] of Object.entries(skill.files)) {
|
|
42
|
+
desired.set(key(storeRelPath(relPath)), yield sourceBytes(source));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
yield Promise.all([...desired].map(([key, body]) => putLastWriterWins(args.sink, key, body)));
|
|
46
|
+
const [existing, leftover] = yield Promise.all([
|
|
47
|
+
args.sink.list(agentStoreKeys.skillsPrefix()),
|
|
48
|
+
args.sink.list(legacySkillsPrefix(args.agentName)),
|
|
49
|
+
]);
|
|
50
|
+
yield Promise.all([...existing.filter((entry) => !desired.has(entry.key)), ...leftover].map((entry) => args.sink.delete(entry.key)));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Same refusals as local materialization's `resolveInside`: a rel that
|
|
55
|
+
* escapes the skill directory or would not round-trip through the FUSE
|
|
56
|
+
* mount (`..`, `.`, `//`, absolute) fails the sync, exactly as it fails a
|
|
57
|
+
* local turn's workspace write. Backslashes are refused too — the store
|
|
58
|
+
* normalizes `\` to `/` on write, so the stored key would differ from the
|
|
59
|
+
* desired one and the stale pass would delete the file it just wrote.
|
|
60
|
+
*/
|
|
61
|
+
function storeRelPath(relPath) {
|
|
62
|
+
if (relPath.includes("\0") ||
|
|
63
|
+
relPath.includes("\\") ||
|
|
64
|
+
posix.isAbsolute(relPath) ||
|
|
65
|
+
relPath.endsWith("/") ||
|
|
66
|
+
relPath.split("/").some((seg) => seg === ".." || seg === ".") ||
|
|
67
|
+
posix.normalize(relPath) !== relPath) {
|
|
68
|
+
throw new Error(`Refusing skill file path "${relPath}" (must be a normalized relative path)`);
|
|
69
|
+
}
|
|
70
|
+
return relPath;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Last writer wins. A raced conditional put (dual engine pods during a
|
|
74
|
+
* deploy rollover) clears the sink's cached etag, so one retry re-learns
|
|
75
|
+
* the current version and lands.
|
|
76
|
+
*/
|
|
77
|
+
function putLastWriterWins(sink, key, body) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
try {
|
|
80
|
+
yield sink.put(key, body);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (!(error instanceof FileConflictError)) {
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
yield sink.put(key, body);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function sourceBytes(source) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
return "contents" in source
|
|
93
|
+
? Buffer.from(source.contents, "utf8")
|
|
94
|
+
: readFile(source.sourcePath);
|
|
95
|
+
});
|
|
96
|
+
}
|