@agentsky/sky 3.42.0 → 3.44.0
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/chunk-3FQZZNQP.js +1969 -0
- package/dist/chunk-BCSZO4BR.js +555 -0
- package/dist/{chunk-YY2ZSZDH.js → chunk-BIZJ4VZL.js} +8 -10
- package/dist/chunk-CXRMG3HQ.js +8 -0
- package/dist/chunk-EBCVJDIL.js +497 -0
- package/dist/chunk-F6V2GGMP.js +585 -0
- package/dist/chunk-HGLVOMHL.js +2124 -0
- package/dist/{trace-ZZLFGVWA.js → chunk-KTSUD2BU.js} +23 -21
- package/dist/chunk-UJ7IXSJX.js +404 -0
- package/dist/{chunk-ALJRHTMX.js → chunk-W2WEEVIM.js} +2 -108
- package/dist/chunk-ZVNQJPMS.js +193 -0
- package/dist/compute-KNUZU4AO.js +35 -0
- package/dist/compute-report-AT642XES.js +34 -0
- package/dist/index.js +5230 -7048
- package/dist/local-skills-HHTAWGYV.js +28 -0
- package/dist/local-skills-run-OYPW36ZG.js +52 -0
- package/dist/mcp-serve-EJ7YKBMM.js +103 -0
- package/dist/trace-754MK5OE.js +54 -0
- package/dist/trace-exclusions-MYECULMA.js +20 -0
- package/dist/trace-library-WE3C5OBP.js +67 -0
- package/package.json +2 -1
- package/dist/trace-library-536NQQJJ.js +0 -1396
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkedWithin,
|
|
3
|
+
installedMarker,
|
|
4
|
+
loadLocalSkillState,
|
|
5
|
+
localSkillStatePath,
|
|
6
|
+
pinLocalSkill,
|
|
7
|
+
revisionAt,
|
|
8
|
+
saveLocalSkillState,
|
|
9
|
+
skillTargets,
|
|
10
|
+
syncLocalSkills,
|
|
11
|
+
unpinLocalSkill
|
|
12
|
+
} from "./chunk-ZVNQJPMS.js";
|
|
13
|
+
import "./chunk-F6V2GGMP.js";
|
|
14
|
+
import "./chunk-CXRMG3HQ.js";
|
|
15
|
+
import "./chunk-XHZJG3QT.js";
|
|
16
|
+
import "./chunk-MLKGABMK.js";
|
|
17
|
+
export {
|
|
18
|
+
checkedWithin,
|
|
19
|
+
installedMarker,
|
|
20
|
+
loadLocalSkillState,
|
|
21
|
+
localSkillStatePath,
|
|
22
|
+
pinLocalSkill,
|
|
23
|
+
revisionAt,
|
|
24
|
+
saveLocalSkillState,
|
|
25
|
+
skillTargets,
|
|
26
|
+
syncLocalSkills,
|
|
27
|
+
unpinLocalSkill
|
|
28
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SetupJournal,
|
|
3
|
+
workspaceSlug
|
|
4
|
+
} from "./chunk-EBCVJDIL.js";
|
|
5
|
+
import {
|
|
6
|
+
detectHermes,
|
|
7
|
+
detectLocalAgents
|
|
8
|
+
} from "./chunk-BCSZO4BR.js";
|
|
9
|
+
import "./chunk-W2WEEVIM.js";
|
|
10
|
+
import {
|
|
11
|
+
checkedWithin,
|
|
12
|
+
skillTargets,
|
|
13
|
+
syncLocalSkills
|
|
14
|
+
} from "./chunk-ZVNQJPMS.js";
|
|
15
|
+
import "./chunk-F6V2GGMP.js";
|
|
16
|
+
import "./chunk-CXRMG3HQ.js";
|
|
17
|
+
import "./chunk-XHZJG3QT.js";
|
|
18
|
+
import "./chunk-MLKGABMK.js";
|
|
19
|
+
|
|
20
|
+
// src/local-skills-run.ts
|
|
21
|
+
var HOOK_RECHECK_MS = 5 * 60 * 1e3;
|
|
22
|
+
async function localSkillWorkspace(explicit) {
|
|
23
|
+
if (explicit) return explicit;
|
|
24
|
+
const { loadSyncConfig } = await import("./trace-library-WE3C5OBP.js");
|
|
25
|
+
return loadSyncConfig().fallback ?? await workspaceSlug();
|
|
26
|
+
}
|
|
27
|
+
async function refreshLocalSkills(opts = {}) {
|
|
28
|
+
if (opts.hook && checkedWithin(HOOK_RECHECK_MS)) return null;
|
|
29
|
+
const hermes = detectHermes();
|
|
30
|
+
const targets = skillTargets(detectLocalAgents(), hermes?.root ?? null);
|
|
31
|
+
const workspace = await localSkillWorkspace(opts.workspace);
|
|
32
|
+
if (!targets.length) return { workspace, checked: false, skills: [] };
|
|
33
|
+
const { libraryRequest } = await import("./trace-library-WE3C5OBP.js");
|
|
34
|
+
const journal = opts.dryRun ? void 0 : new SetupJournal();
|
|
35
|
+
try {
|
|
36
|
+
return await syncLocalSkills({ workspace, targets, journal, dryRun: opts.dryRun, request: (method, path, slug) => libraryRequest(method, path, slug) });
|
|
37
|
+
} finally {
|
|
38
|
+
journal?.save();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function describeLocalSkills(result) {
|
|
42
|
+
return result.skills.filter((skill) => skill.outcome !== "current").map((skill) => {
|
|
43
|
+
const layer = skill.layer === "personal" ? " (yours" + (skill.hides ? `, in place of the workspace's ${skill.name}` : "") + ")" : "";
|
|
44
|
+
return ` skill ${skill.name}${layer}: ${skill.outcome.replace("_", " ")}${skill.revision_id ? ` ${skill.revision_id}` : ""}${skill.detail ? ` \u2014 ${skill.detail}` : ""}`;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
HOOK_RECHECK_MS,
|
|
49
|
+
describeLocalSkills,
|
|
50
|
+
localSkillWorkspace,
|
|
51
|
+
refreshLocalSkills
|
|
52
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cachedSettingsBlock,
|
|
3
|
+
mcpUrlFor
|
|
4
|
+
} from "./chunk-BCSZO4BR.js";
|
|
5
|
+
import "./chunk-W2WEEVIM.js";
|
|
6
|
+
import "./chunk-F6V2GGMP.js";
|
|
7
|
+
import {
|
|
8
|
+
USER_AGENT
|
|
9
|
+
} from "./chunk-CXRMG3HQ.js";
|
|
10
|
+
import {
|
|
11
|
+
apiBase,
|
|
12
|
+
apiToken
|
|
13
|
+
} from "./chunk-XHZJG3QT.js";
|
|
14
|
+
import "./chunk-MLKGABMK.js";
|
|
15
|
+
|
|
16
|
+
// src/mcp-serve.ts
|
|
17
|
+
import { createInterface } from "readline";
|
|
18
|
+
var defaults = () => ({
|
|
19
|
+
fetch,
|
|
20
|
+
token: apiToken,
|
|
21
|
+
url: () => mcpUrlFor(apiBase(), "short"),
|
|
22
|
+
settings: cachedSettingsBlock,
|
|
23
|
+
write: (line) => process.stdout.write(`${line}
|
|
24
|
+
`)
|
|
25
|
+
});
|
|
26
|
+
function failure(id, message) {
|
|
27
|
+
return JSON.stringify({ jsonrpc: "2.0", id: id ?? null, error: { code: -32e3, message } });
|
|
28
|
+
}
|
|
29
|
+
function answersIn(body, type) {
|
|
30
|
+
const texts = type?.includes("text/event-stream") ? body.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trim()).filter(Boolean) : body.trim() ? [body] : [];
|
|
31
|
+
return texts.flatMap((text) => {
|
|
32
|
+
const parsed = JSON.parse(text);
|
|
33
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function forwardLine(line, deps = defaults(), protocol = {}) {
|
|
37
|
+
let message;
|
|
38
|
+
try {
|
|
39
|
+
message = JSON.parse(line);
|
|
40
|
+
} catch {
|
|
41
|
+
return deps.write(failure(null, "not a JSON-RPC message"));
|
|
42
|
+
}
|
|
43
|
+
const token = deps.token();
|
|
44
|
+
const expectsAnswer = message.id !== void 0 && message.id !== null;
|
|
45
|
+
if (!token) {
|
|
46
|
+
if (expectsAnswer) deps.write(failure(message.id, "sky is not signed in on this computer: run `sky auth login`"));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let response;
|
|
50
|
+
try {
|
|
51
|
+
response = await deps.fetch(deps.url(), {
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers: {
|
|
54
|
+
"user-agent": USER_AGENT,
|
|
55
|
+
authorization: `Bearer ${token}`,
|
|
56
|
+
"content-type": "application/json",
|
|
57
|
+
accept: "application/json, text/event-stream",
|
|
58
|
+
...protocol.version ? { "mcp-protocol-version": protocol.version } : {}
|
|
59
|
+
},
|
|
60
|
+
body: line
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (expectsAnswer) deps.write(failure(message.id, `AgentSky could not be reached: ${error instanceof Error ? error.message : String(error)}`));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const body = await response.text();
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
if (expectsAnswer) deps.write(failure(message.id, `AgentSky answered ${response.status}`));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
let answers;
|
|
72
|
+
try {
|
|
73
|
+
answers = answersIn(body, response.headers.get("content-type"));
|
|
74
|
+
} catch {
|
|
75
|
+
if (expectsAnswer) deps.write(failure(message.id, "AgentSky's answer was not JSON"));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
for (const answer of answers) {
|
|
79
|
+
if (message.method === "initialize" && answer.result) {
|
|
80
|
+
const version = answer.result.protocolVersion;
|
|
81
|
+
if (typeof version === "string") protocol.version = version;
|
|
82
|
+
const settings = deps.settings();
|
|
83
|
+
if (settings) answer.result.instructions = `${answer.result.instructions ?? ""}
|
|
84
|
+
|
|
85
|
+
${settings}`.trim();
|
|
86
|
+
}
|
|
87
|
+
deps.write(JSON.stringify(answer));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function serveMcp(deps = defaults()) {
|
|
91
|
+
const protocol = {};
|
|
92
|
+
const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
93
|
+
let queue = Promise.resolve();
|
|
94
|
+
for await (const line of lines) {
|
|
95
|
+
if (!line.trim()) continue;
|
|
96
|
+
queue = queue.then(() => forwardLine(line, deps, protocol));
|
|
97
|
+
}
|
|
98
|
+
await queue;
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
forwardLine,
|
|
102
|
+
serveMcp
|
|
103
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BATCH_MAX,
|
|
3
|
+
FinalRefusal,
|
|
4
|
+
RETRY_WINDOW_MS,
|
|
5
|
+
SPOOL_MAX_BYTES,
|
|
6
|
+
chosenPaths,
|
|
7
|
+
claudeHooksConfig,
|
|
8
|
+
clearState,
|
|
9
|
+
contentEvent,
|
|
10
|
+
contentForClaudeHook,
|
|
11
|
+
eventsForClaudeHook,
|
|
12
|
+
fileAllowed,
|
|
13
|
+
fileEvent,
|
|
14
|
+
flush,
|
|
15
|
+
grantSender,
|
|
16
|
+
installClaudeHooks,
|
|
17
|
+
parseContentScopes,
|
|
18
|
+
readState,
|
|
19
|
+
record,
|
|
20
|
+
spoolStatus,
|
|
21
|
+
stamp,
|
|
22
|
+
traceDir,
|
|
23
|
+
uninstallClaudeHooks,
|
|
24
|
+
writeState
|
|
25
|
+
} from "./chunk-KTSUD2BU.js";
|
|
26
|
+
import "./chunk-BIZJ4VZL.js";
|
|
27
|
+
import "./chunk-CXRMG3HQ.js";
|
|
28
|
+
import "./chunk-XHZJG3QT.js";
|
|
29
|
+
import "./chunk-MLKGABMK.js";
|
|
30
|
+
export {
|
|
31
|
+
BATCH_MAX,
|
|
32
|
+
FinalRefusal,
|
|
33
|
+
RETRY_WINDOW_MS,
|
|
34
|
+
SPOOL_MAX_BYTES,
|
|
35
|
+
chosenPaths,
|
|
36
|
+
claudeHooksConfig,
|
|
37
|
+
clearState,
|
|
38
|
+
contentEvent,
|
|
39
|
+
contentForClaudeHook,
|
|
40
|
+
eventsForClaudeHook,
|
|
41
|
+
fileAllowed,
|
|
42
|
+
fileEvent,
|
|
43
|
+
flush,
|
|
44
|
+
grantSender,
|
|
45
|
+
installClaudeHooks,
|
|
46
|
+
parseContentScopes,
|
|
47
|
+
readState,
|
|
48
|
+
record,
|
|
49
|
+
spoolStatus,
|
|
50
|
+
stamp,
|
|
51
|
+
traceDir,
|
|
52
|
+
uninstallClaudeHooks,
|
|
53
|
+
writeState
|
|
54
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
changeExclusions,
|
|
3
|
+
excludedBy,
|
|
4
|
+
folderOf,
|
|
5
|
+
inFolder,
|
|
6
|
+
loadExclusions,
|
|
7
|
+
macSettingsPath,
|
|
8
|
+
stillExcluded
|
|
9
|
+
} from "./chunk-UJ7IXSJX.js";
|
|
10
|
+
import "./chunk-BIZJ4VZL.js";
|
|
11
|
+
import "./chunk-MLKGABMK.js";
|
|
12
|
+
export {
|
|
13
|
+
changeExclusions,
|
|
14
|
+
excludedBy,
|
|
15
|
+
folderOf,
|
|
16
|
+
inFolder,
|
|
17
|
+
loadExclusions,
|
|
18
|
+
macSettingsPath,
|
|
19
|
+
stillExcluded
|
|
20
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LAUNCHD_LABEL,
|
|
3
|
+
SYNC_HOOK_COMMAND,
|
|
4
|
+
collectorBody,
|
|
5
|
+
collectorHarness,
|
|
6
|
+
discoverSessions,
|
|
7
|
+
hookSessionRef,
|
|
8
|
+
importExport,
|
|
9
|
+
installLaunchd,
|
|
10
|
+
installSyncHooks,
|
|
11
|
+
isTrivial,
|
|
12
|
+
lastUploads,
|
|
13
|
+
launchdPlist,
|
|
14
|
+
launchdPlistPath,
|
|
15
|
+
libraryRequest,
|
|
16
|
+
loadSyncConfig,
|
|
17
|
+
parseClaudeSession,
|
|
18
|
+
parseCodexSession,
|
|
19
|
+
projectOf,
|
|
20
|
+
repoRemote,
|
|
21
|
+
routeSession,
|
|
22
|
+
saveSyncConfig,
|
|
23
|
+
sessionDigest,
|
|
24
|
+
sourceFolders,
|
|
25
|
+
supportedAgents,
|
|
26
|
+
syncConfigPath,
|
|
27
|
+
syncDir,
|
|
28
|
+
syncTraces
|
|
29
|
+
} from "./chunk-3FQZZNQP.js";
|
|
30
|
+
import "./chunk-KTSUD2BU.js";
|
|
31
|
+
import "./chunk-UJ7IXSJX.js";
|
|
32
|
+
import "./chunk-BIZJ4VZL.js";
|
|
33
|
+
import "./chunk-W2WEEVIM.js";
|
|
34
|
+
import "./chunk-ZVNQJPMS.js";
|
|
35
|
+
import "./chunk-F6V2GGMP.js";
|
|
36
|
+
import "./chunk-CXRMG3HQ.js";
|
|
37
|
+
import "./chunk-XHZJG3QT.js";
|
|
38
|
+
import "./chunk-MLKGABMK.js";
|
|
39
|
+
export {
|
|
40
|
+
LAUNCHD_LABEL,
|
|
41
|
+
SYNC_HOOK_COMMAND,
|
|
42
|
+
collectorBody,
|
|
43
|
+
collectorHarness,
|
|
44
|
+
discoverSessions,
|
|
45
|
+
hookSessionRef,
|
|
46
|
+
importExport,
|
|
47
|
+
installLaunchd,
|
|
48
|
+
installSyncHooks,
|
|
49
|
+
isTrivial,
|
|
50
|
+
lastUploads,
|
|
51
|
+
launchdPlist,
|
|
52
|
+
launchdPlistPath,
|
|
53
|
+
libraryRequest,
|
|
54
|
+
loadSyncConfig,
|
|
55
|
+
parseClaudeSession,
|
|
56
|
+
parseCodexSession,
|
|
57
|
+
projectOf,
|
|
58
|
+
repoRemote,
|
|
59
|
+
routeSession,
|
|
60
|
+
saveSyncConfig,
|
|
61
|
+
sessionDigest,
|
|
62
|
+
sourceFolders,
|
|
63
|
+
supportedAgents,
|
|
64
|
+
syncConfigPath,
|
|
65
|
+
syncDir,
|
|
66
|
+
syncTraces
|
|
67
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentsky/sky",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"description": "sky \u2014 the AgentSky developer CLI: launch and talk to long-lived agents from your terminal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"zod": "4.5.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@agent/conversation": "*",
|
|
34
35
|
"@agent/spec": "*",
|
|
35
36
|
"@types/node": "^20",
|
|
36
37
|
"tsup": "^8.5.0",
|