@agentsky/sky 3.48.2 → 3.49.1
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-A45NGV2Q.js → chunk-4O5BYMBY.js} +2 -2
- package/dist/chunk-BKNZQZZD.js +857 -0
- package/dist/{chunk-UJS4JIE2.js → chunk-EIIYZVDB.js} +10 -10
- package/dist/{chunk-ZF2P6PKM.js → chunk-GITJNXCT.js} +2 -2
- package/dist/{chunk-OJ5ERABF.js → chunk-IO2N34S2.js} +1 -1
- package/dist/{chunk-FVIPGI3E.js → chunk-J5Y3GBFE.js} +5 -5
- package/dist/{chunk-ZRV3UUW5.js → chunk-KAUYD6LR.js} +1 -1
- package/dist/{chunk-NAIYHS6Q.js → chunk-ONI4XI52.js} +2 -1
- package/dist/{chunk-PGX3AGCZ.js → chunk-OPV2FXUQ.js} +1 -1
- package/dist/{chunk-CV2ZRIF7.js → chunk-PO4BEXQ7.js} +4 -4
- package/dist/chunk-TGU7T4O7.js +1363 -0
- package/dist/{chunk-6D36IT7T.js → chunk-UZ7DE7B4.js} +2 -2
- package/dist/{chunk-RKMMLSGJ.js → chunk-WOTYAQGN.js} +1 -1
- package/dist/{chunk-W24YSGH4.js → chunk-X77A5HMO.js} +7 -856
- package/dist/{chunk-NJPIE762.js → chunk-YHO5UDFS.js} +43 -24
- package/dist/chunk-YO2XUCCF.js +30 -0
- package/dist/{compute-AERPKXJ3.js → compute-XAJFVSFL.js} +2 -2
- package/dist/{compute-report-CTT4WBSQ.js → compute-report-GKDPX4XS.js} +15 -13
- package/dist/grok-bot-export-7LSTXWJW.js +57 -0
- package/dist/index.js +603 -1770
- package/dist/{local-skills-E56TR7O6.js → local-skills-MTVILHBQ.js} +3 -3
- package/dist/{local-skills-run-TST44QSA.js → local-skills-run-DPAEXDNS.js} +9 -9
- package/dist/{mcp-register-HDOVT4QT.js → mcp-register-W7EVHT6T.js} +3 -3
- package/dist/{mcp-serve-2LBAEAJX.js → mcp-serve-QTQXSRME.js} +6 -6
- package/dist/{trace-S2XZC75N.js → trace-CMWC4LFX.js} +4 -3
- package/dist/{trace-exclusions-JEGMUPWQ.js → trace-exclusions-2KLVHVSW.js} +3 -2
- package/dist/trace-handoff-CD5LOS7B.js +116 -0
- package/dist/{trace-library-HN5TU5EJ.js → trace-library-XVUYQB5X.js} +14 -8
- package/dist/trace-privacy-DU3TL5EO.js +11 -0
- package/package.json +1 -1
- package/vendor/trace-collect/SOURCE.json +2 -1
- package/vendor/trace-collect/sources/_pii.mjs +56 -0
- package/vendor/trace-collect/sources/grok-bot.mjs +180 -0
- package/vendor/trace-collect/sources/index.mjs +4 -2
- package/vendor/trace-collect/sources/muse-agent.mjs +95 -0
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ApiError,
|
|
3
|
-
api
|
|
4
|
-
} from "./chunk-NAIYHS6Q.js";
|
|
5
|
-
import {
|
|
6
|
-
installClaudeHooks
|
|
7
|
-
} from "./chunk-FVIPGI3E.js";
|
|
8
|
-
import {
|
|
9
|
-
loadLocalSkillState,
|
|
10
|
-
revisionAt
|
|
11
|
-
} from "./chunk-ZF2P6PKM.js";
|
|
12
|
-
import {
|
|
13
|
-
apiBase,
|
|
14
|
-
apiToken,
|
|
15
|
-
configPath
|
|
16
|
-
} from "./chunk-XHZJG3QT.js";
|
|
17
|
-
import {
|
|
18
|
-
USER_AGENT
|
|
19
|
-
} from "./chunk-ZRV3UUW5.js";
|
|
20
1
|
import {
|
|
21
2
|
IncompleteSourceCaptureError,
|
|
22
3
|
SOURCE_CAPTURE_VERSION,
|
|
@@ -32,12 +13,34 @@ import {
|
|
|
32
13
|
savePendingSource,
|
|
33
14
|
stillExcluded,
|
|
34
15
|
writePrivateJson
|
|
35
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IO2N34S2.js";
|
|
17
|
+
import {
|
|
18
|
+
ApiError,
|
|
19
|
+
api
|
|
20
|
+
} from "./chunk-ONI4XI52.js";
|
|
21
|
+
import {
|
|
22
|
+
privateHold
|
|
23
|
+
} from "./chunk-YO2XUCCF.js";
|
|
24
|
+
import {
|
|
25
|
+
installClaudeHooks
|
|
26
|
+
} from "./chunk-J5Y3GBFE.js";
|
|
36
27
|
import {
|
|
37
28
|
SessionSourceCollector,
|
|
38
29
|
publicRemote,
|
|
39
30
|
redactTraceText
|
|
40
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-X77A5HMO.js";
|
|
32
|
+
import {
|
|
33
|
+
loadLocalSkillState,
|
|
34
|
+
revisionAt
|
|
35
|
+
} from "./chunk-GITJNXCT.js";
|
|
36
|
+
import {
|
|
37
|
+
apiBase,
|
|
38
|
+
apiToken,
|
|
39
|
+
configPath
|
|
40
|
+
} from "./chunk-XHZJG3QT.js";
|
|
41
|
+
import {
|
|
42
|
+
USER_AGENT
|
|
43
|
+
} from "./chunk-KAUYD6LR.js";
|
|
41
44
|
|
|
42
45
|
// src/trace-library.ts
|
|
43
46
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -1023,6 +1026,12 @@ async function traceCollector() {
|
|
|
1023
1026
|
]).then(([collector, sink]) => ({ collector, sink }));
|
|
1024
1027
|
return collectorModules;
|
|
1025
1028
|
}
|
|
1029
|
+
function collectorDir() {
|
|
1030
|
+
return join4(dirname5(fileURLToPath(import.meta.url)), "..", "vendor", "trace-collect");
|
|
1031
|
+
}
|
|
1032
|
+
async function collectorStore() {
|
|
1033
|
+
return (await traceCollector()).collector.STORE;
|
|
1034
|
+
}
|
|
1026
1035
|
function collectorHarness(harness) {
|
|
1027
1036
|
return COLLECTOR_HARNESS[harness] ?? harness.replace(/[^a-z0-9_-]/g, "_").slice(0, 40);
|
|
1028
1037
|
}
|
|
@@ -1039,7 +1048,7 @@ async function importExport(input) {
|
|
|
1039
1048
|
const { collector } = await traceCollector();
|
|
1040
1049
|
const result = await collector.importFile(input);
|
|
1041
1050
|
if (result.error) throw new Error(result.error);
|
|
1042
|
-
return { agent: result.name ?? result.id ?? "export", sessions: result.total ?? 0 };
|
|
1051
|
+
return { agent: result.name ?? result.id ?? "export", sessions: result.total ?? 0, sensitive: result.sensitive ?? 0, findings: result.findings ?? {} };
|
|
1043
1052
|
}
|
|
1044
1053
|
function signatureOf(files) {
|
|
1045
1054
|
const parts = [];
|
|
@@ -1628,7 +1637,7 @@ async function runSync(config, options) {
|
|
|
1628
1637
|
const state = readJson2(statePath2(), { sessions: {} });
|
|
1629
1638
|
const full = options.full || !state.lastFullAt || Date.now() - Date.parse(state.lastFullAt) > FULL_SWEEP_MS;
|
|
1630
1639
|
const device = config.device ?? hostname();
|
|
1631
|
-
const report = { scanned: 0, changed: 0, uploaded: 0, unchanged: 0, local: 0, owned: 0, empty: 0, sessions: 0, excluded: 0, paused: 0, failed: 0, results: 0, legacySources: 0, byWorkspace: {}, errors: [] };
|
|
1640
|
+
const report = { scanned: 0, changed: 0, uploaded: 0, unchanged: 0, local: 0, owned: 0, empty: 0, sessions: 0, excluded: 0, paused: 0, failed: 0, results: 0, legacySources: 0, held: 0, byWorkspace: {}, errors: [] };
|
|
1632
1641
|
const results = readJson2(resultsStatePath(), { read: [], saved: [] });
|
|
1633
1642
|
const saveResults = async (local, workspace, sessionId, cwd) => {
|
|
1634
1643
|
if (!sessionHarness(local.harness)) return;
|
|
@@ -1642,7 +1651,7 @@ async function runSync(config, options) {
|
|
|
1642
1651
|
}
|
|
1643
1652
|
};
|
|
1644
1653
|
const key = (s) => `${s.harness}:${s.sessionId}`;
|
|
1645
|
-
const selected = (s) => !options.only?.length || options.only.includes(s.sessionId) || s.files.some((file) => options.only.includes(file));
|
|
1654
|
+
const selected = (s) => (!options.agents?.length || options.agents.includes(s.harness)) && (!options.only?.length || options.only.includes(s.sessionId) || s.files.some((file) => options.only.includes(file)));
|
|
1646
1655
|
const record = (s, value) => {
|
|
1647
1656
|
state.sessions[key(s)] = { captureVersion: SOURCE_CAPTURE_VERSION, signature: s.signature, at: (/* @__PURE__ */ new Date()).toISOString(), ...value };
|
|
1648
1657
|
};
|
|
@@ -1854,6 +1863,14 @@ async function runSync(config, options) {
|
|
|
1854
1863
|
record(local, { workspace: null, status: "local" });
|
|
1855
1864
|
return null;
|
|
1856
1865
|
}
|
|
1866
|
+
const hold = privateHold(local.trace, workspace2, config, options.allowSharedPrivate);
|
|
1867
|
+
if (hold) {
|
|
1868
|
+
report.held++;
|
|
1869
|
+
report.local++;
|
|
1870
|
+
report.errors.push(hold);
|
|
1871
|
+
record(local, { workspace: null, status: "local" });
|
|
1872
|
+
return null;
|
|
1873
|
+
}
|
|
1857
1874
|
scrubber ??= (await traceCollector()).collector.scrubberFor();
|
|
1858
1875
|
return { workspace: workspace2, body: await collectorBody(local.trace, device, scrubber) };
|
|
1859
1876
|
}
|
|
@@ -1997,6 +2014,8 @@ export {
|
|
|
1997
2014
|
lastUploads,
|
|
1998
2015
|
loadSyncConfig,
|
|
1999
2016
|
saveSyncConfig,
|
|
2017
|
+
collectorDir,
|
|
2018
|
+
collectorStore,
|
|
2000
2019
|
collectorHarness,
|
|
2001
2020
|
sourceFolders,
|
|
2002
2021
|
supportedAgents,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/trace-privacy.ts
|
|
2
|
+
var LABELS = {
|
|
3
|
+
passport_immigration: "passport / immigration",
|
|
4
|
+
medical: "medical",
|
|
5
|
+
insurance: "insurance",
|
|
6
|
+
phone: "phone numbers",
|
|
7
|
+
address: "addresses",
|
|
8
|
+
government_id: "government ids",
|
|
9
|
+
financial: "financial"
|
|
10
|
+
};
|
|
11
|
+
function describeFindings(report) {
|
|
12
|
+
const entries = Object.entries(report?.findings ?? {}).sort((a, b) => b[1] - a[1]);
|
|
13
|
+
return entries.map(([category, count]) => `${LABELS[category] ?? category} \xD7${count}`).join(", ");
|
|
14
|
+
}
|
|
15
|
+
function isPrivate(trace) {
|
|
16
|
+
return trace.sensitive === true || trace.privacy?.sensitive === true;
|
|
17
|
+
}
|
|
18
|
+
function privateHold(trace, workspace, config, allowShared = false) {
|
|
19
|
+
if (!isPrivate(trace) || allowShared) return null;
|
|
20
|
+
if (config.personal && workspace === config.personal) return null;
|
|
21
|
+
const found = describeFindings(trace.privacy);
|
|
22
|
+
const where = config.personal ? `${workspace} is not your personal workspace (${config.personal})` : "no personal workspace is set (sky trace sync --personal <workspace>)";
|
|
23
|
+
return `${trace.harness}/${trace.session_id} holds personal data${found ? ` (${found})` : ""} and ${where}; kept on this computer. --allow-shared-private overrides.`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
describeFindings,
|
|
28
|
+
isPrivate,
|
|
29
|
+
privateHold
|
|
30
|
+
};
|
|
@@ -10,21 +10,23 @@ import {
|
|
|
10
10
|
reportComputer,
|
|
11
11
|
savedMachineKey,
|
|
12
12
|
upkeepComputer
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-EIIYZVDB.js";
|
|
14
|
+
import "./chunk-YHO5UDFS.js";
|
|
15
|
+
import "./chunk-IO2N34S2.js";
|
|
16
|
+
import "./chunk-UZ7DE7B4.js";
|
|
17
|
+
import "./chunk-PO4BEXQ7.js";
|
|
18
|
+
import "./chunk-4O5BYMBY.js";
|
|
19
|
+
import "./chunk-ONI4XI52.js";
|
|
20
|
+
import "./chunk-WOTYAQGN.js";
|
|
20
21
|
import "./chunk-2H4W5ZKZ.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-YO2XUCCF.js";
|
|
23
|
+
import "./chunk-J5Y3GBFE.js";
|
|
24
|
+
import "./chunk-X77A5HMO.js";
|
|
25
|
+
import "./chunk-BKNZQZZD.js";
|
|
26
|
+
import "./chunk-GITJNXCT.js";
|
|
27
|
+
import "./chunk-OPV2FXUQ.js";
|
|
24
28
|
import "./chunk-XHZJG3QT.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-OJ5ERABF.js";
|
|
27
|
-
import "./chunk-W24YSGH4.js";
|
|
29
|
+
import "./chunk-KAUYD6LR.js";
|
|
28
30
|
import "./chunk-MLKGABMK.js";
|
|
29
31
|
export {
|
|
30
32
|
MCP_ENTRY,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./chunk-MLKGABMK.js";
|
|
2
|
+
|
|
3
|
+
// src/grok-bot-export.ts
|
|
4
|
+
import { mkdirSync, writeFileSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
var stamp = (iso) => iso && Number.isFinite(Date.parse(iso)) ? `${new Date(iso).toISOString().slice(0, 19).replace("T", " ")} UTC` : null;
|
|
7
|
+
function grokBotRows(trace) {
|
|
8
|
+
const rows = [];
|
|
9
|
+
const base = { session_id: trace.session_id, session_title: trace.title ?? trace.session_id, source: `handoff from ${trace.harness}` };
|
|
10
|
+
let n = 0;
|
|
11
|
+
const push = (row) => rows.push({ ...base, entry_id: `h${n}`, seq: n++, tool_name: null, args: null, result_summary: null, text: null, ...row });
|
|
12
|
+
for (const m of trace.messages) {
|
|
13
|
+
const timestamp = stamp(m.ts);
|
|
14
|
+
if (m.role === "user") push({ role: "user", timestamp, text: m.text ?? "" });
|
|
15
|
+
else if (m.role === "assistant") {
|
|
16
|
+
const calls = m.tool_calls ?? [];
|
|
17
|
+
if (m.text || !calls.length) push({ role: "assistant", timestamp, text: m.text ?? "" });
|
|
18
|
+
for (const call of calls) push({ role: "assistant", timestamp, tool_name: call.name, args: call.input ?? {}, text: null });
|
|
19
|
+
} else if (m.role === "tool") push({ role: "tool", timestamp, tool_name: m.tool_name ?? "tool", result_summary: m.text ?? "" });
|
|
20
|
+
}
|
|
21
|
+
return rows;
|
|
22
|
+
}
|
|
23
|
+
function writeGrokBotExport(traces, dir, from) {
|
|
24
|
+
mkdirSync(join(dir, "sessions"), { recursive: true, mode: 448 });
|
|
25
|
+
const sessions = [];
|
|
26
|
+
const files = [];
|
|
27
|
+
let total = 0;
|
|
28
|
+
for (const trace of traces) {
|
|
29
|
+
const rows = grokBotRows(trace);
|
|
30
|
+
const file = `${trace.session_id.replace(/[^\w.-]+/g, "_")}.jsonl`;
|
|
31
|
+
writeFileSync(join(dir, "sessions", file), rows.map((r) => JSON.stringify(r)).join("\n") + "\n", { mode: 384 });
|
|
32
|
+
files.push(file);
|
|
33
|
+
total += rows.length;
|
|
34
|
+
const count = (role) => rows.filter((r) => r.role === role).length;
|
|
35
|
+
sessions.push({
|
|
36
|
+
id: trace.session_id,
|
|
37
|
+
file,
|
|
38
|
+
title: trace.title ?? trace.session_id,
|
|
39
|
+
kind: "handoff",
|
|
40
|
+
source: `${trace.harness} session, converted by sky trace handoff`,
|
|
41
|
+
message_count: rows.length,
|
|
42
|
+
user_count: count("user"),
|
|
43
|
+
assistant_count: count("assistant"),
|
|
44
|
+
tool_count: rows.filter((r) => r.tool_name).length,
|
|
45
|
+
first_timestamp: stamp(trace.started_at),
|
|
46
|
+
last_timestamp: stamp(trace.ended_at),
|
|
47
|
+
notes: `Reasoning was not carried. Every user, assistant and tool message of the ${trace.harness} session is here in order.`
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const manifest = join(dir, "manifest.json");
|
|
51
|
+
writeFileSync(manifest, JSON.stringify({ agent_id: `handoff-${from}`, agent_name: "AgentSky handoff", sessions, extra: { from } }, null, 2), { mode: 384 });
|
|
52
|
+
return { manifest, files, rows: total };
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
grokBotRows,
|
|
56
|
+
writeGrokBotExport
|
|
57
|
+
};
|