@agentsky/sky 3.48.2 → 3.49.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.
Files changed (35) hide show
  1. package/dist/{chunk-W24YSGH4.js → chunk-2YUZZ5VG.js} +7 -856
  2. package/dist/{chunk-ZRV3UUW5.js → chunk-6LRSRXQI.js} +1 -1
  3. package/dist/{chunk-PGX3AGCZ.js → chunk-7JFTEJ7B.js} +1 -1
  4. package/dist/chunk-BKNZQZZD.js +857 -0
  5. package/dist/{chunk-RKMMLSGJ.js → chunk-CK7N635F.js} +1 -1
  6. package/dist/{chunk-NAIYHS6Q.js → chunk-HFWHVU72.js} +2 -1
  7. package/dist/{chunk-A45NGV2Q.js → chunk-HGL7TLNA.js} +2 -2
  8. package/dist/{chunk-ZF2P6PKM.js → chunk-HNUY5PBQ.js} +2 -2
  9. package/dist/{chunk-OJ5ERABF.js → chunk-IO2N34S2.js} +1 -1
  10. package/dist/{chunk-UJS4JIE2.js → chunk-JMGVHVOS.js} +10 -10
  11. package/dist/{chunk-CV2ZRIF7.js → chunk-QTE5OMZY.js} +4 -4
  12. package/dist/{chunk-FVIPGI3E.js → chunk-RVI7ZWR2.js} +5 -5
  13. package/dist/chunk-TGU7T4O7.js +1363 -0
  14. package/dist/{chunk-NJPIE762.js → chunk-UYBKORXA.js} +43 -24
  15. package/dist/chunk-YO2XUCCF.js +30 -0
  16. package/dist/{chunk-6D36IT7T.js → chunk-ZOXE2XNH.js} +2 -2
  17. package/dist/{compute-AERPKXJ3.js → compute-4MMGFJGE.js} +2 -2
  18. package/dist/{compute-report-CTT4WBSQ.js → compute-report-LIMMRQY3.js} +15 -13
  19. package/dist/grok-bot-export-7LSTXWJW.js +57 -0
  20. package/dist/index.js +599 -1770
  21. package/dist/{local-skills-E56TR7O6.js → local-skills-5LJST7EP.js} +3 -3
  22. package/dist/{local-skills-run-TST44QSA.js → local-skills-run-6SZJQSVF.js} +9 -9
  23. package/dist/{mcp-register-HDOVT4QT.js → mcp-register-XY4MR3ZZ.js} +3 -3
  24. package/dist/{mcp-serve-2LBAEAJX.js → mcp-serve-QROKKUJV.js} +6 -6
  25. package/dist/{trace-S2XZC75N.js → trace-SJZ25T35.js} +4 -3
  26. package/dist/{trace-exclusions-JEGMUPWQ.js → trace-exclusions-IC6OA2ND.js} +3 -2
  27. package/dist/trace-handoff-CD5LOS7B.js +116 -0
  28. package/dist/{trace-library-HN5TU5EJ.js → trace-library-V23TEXG4.js} +14 -8
  29. package/dist/trace-privacy-DU3TL5EO.js +11 -0
  30. package/package.json +1 -1
  31. package/vendor/trace-collect/SOURCE.json +2 -1
  32. package/vendor/trace-collect/sources/_pii.mjs +56 -0
  33. package/vendor/trace-collect/sources/grok-bot.mjs +180 -0
  34. package/vendor/trace-collect/sources/index.mjs +4 -2
  35. 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-OJ5ERABF.js";
16
+ } from "./chunk-IO2N34S2.js";
17
+ import {
18
+ ApiError,
19
+ api
20
+ } from "./chunk-HFWHVU72.js";
21
+ import {
22
+ privateHold
23
+ } from "./chunk-YO2XUCCF.js";
24
+ import {
25
+ installClaudeHooks
26
+ } from "./chunk-RVI7ZWR2.js";
36
27
  import {
37
28
  SessionSourceCollector,
38
29
  publicRemote,
39
30
  redactTraceText
40
- } from "./chunk-W24YSGH4.js";
31
+ } from "./chunk-2YUZZ5VG.js";
32
+ import {
33
+ loadLocalSkillState,
34
+ revisionAt
35
+ } from "./chunk-HNUY5PBQ.js";
36
+ import {
37
+ apiBase,
38
+ apiToken,
39
+ configPath
40
+ } from "./chunk-XHZJG3QT.js";
41
+ import {
42
+ USER_AGENT
43
+ } from "./chunk-6LRSRXQI.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
+ };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  withoutSettingsBlock
3
- } from "./chunk-A45NGV2Q.js";
3
+ } from "./chunk-HGL7TLNA.js";
4
4
  import {
5
5
  MCP_SERVER_NAME,
6
6
  withoutTomlServer
7
- } from "./chunk-RKMMLSGJ.js";
7
+ } from "./chunk-CK7N635F.js";
8
8
  import {
9
9
  configPath
10
10
  } from "./chunk-XHZJG3QT.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  api
3
- } from "./chunk-NAIYHS6Q.js";
3
+ } from "./chunk-HFWHVU72.js";
4
4
  import "./chunk-XHZJG3QT.js";
5
- import "./chunk-ZRV3UUW5.js";
5
+ import "./chunk-6LRSRXQI.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
 
8
8
  // src/compute.ts
@@ -10,21 +10,23 @@ import {
10
10
  reportComputer,
11
11
  savedMachineKey,
12
12
  upkeepComputer
13
- } from "./chunk-UJS4JIE2.js";
14
- import "./chunk-NJPIE762.js";
15
- import "./chunk-6D36IT7T.js";
16
- import "./chunk-CV2ZRIF7.js";
17
- import "./chunk-A45NGV2Q.js";
18
- import "./chunk-NAIYHS6Q.js";
19
- import "./chunk-RKMMLSGJ.js";
13
+ } from "./chunk-JMGVHVOS.js";
14
+ import "./chunk-UYBKORXA.js";
15
+ import "./chunk-IO2N34S2.js";
16
+ import "./chunk-ZOXE2XNH.js";
17
+ import "./chunk-QTE5OMZY.js";
18
+ import "./chunk-HGL7TLNA.js";
19
+ import "./chunk-HFWHVU72.js";
20
+ import "./chunk-CK7N635F.js";
20
21
  import "./chunk-2H4W5ZKZ.js";
21
- import "./chunk-FVIPGI3E.js";
22
- import "./chunk-ZF2P6PKM.js";
23
- import "./chunk-PGX3AGCZ.js";
22
+ import "./chunk-YO2XUCCF.js";
23
+ import "./chunk-RVI7ZWR2.js";
24
+ import "./chunk-2YUZZ5VG.js";
25
+ import "./chunk-BKNZQZZD.js";
26
+ import "./chunk-HNUY5PBQ.js";
27
+ import "./chunk-7JFTEJ7B.js";
24
28
  import "./chunk-XHZJG3QT.js";
25
- import "./chunk-ZRV3UUW5.js";
26
- import "./chunk-OJ5ERABF.js";
27
- import "./chunk-W24YSGH4.js";
29
+ import "./chunk-6LRSRXQI.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
+ };