@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
@@ -0,0 +1,95 @@
1
+ // Muse agent (Meta's local coding/assistant agent, /Applications/Muse.app): a different product from the Muse chat
2
+ // cloud export that muse.mjs reads. It keeps sessions under ~/.local/share/muse/sessions; each has a projection
3
+ // journal at .msp-view-g12/<session id>/journal-00000000.bin that is a binary container holding JSON-RPC records
4
+ // ({"method":"item/completed","params":{"item":{...}}}). This reads the completed items of every session: user
5
+ // messages, agent messages, tool calls with their visible output. Reasoning, reminder children and token usage are
6
+ // left out; session.jsonl keeps only ids and status, so the journal is the one place the words survive.
7
+
8
+ import fs from "node:fs";
9
+ import path from "node:path";
10
+ import { FORMAT } from "../normalize.mjs";
11
+ import { privacyReport } from "./_pii.mjs";
12
+
13
+ const decoder = new JSONDecoder();
14
+ function JSONDecoder() {
15
+ return { decode(text, at) { let depth = 0, inString = false, escaped = false; for (let i = at; i < text.length; i++) { const c = text[i]; if (inString) { if (escaped) escaped = false; else if (c === "\\") escaped = true; else if (c === '"') inString = false; continue; } if (c === '"') inString = true; else if (c === "{") depth++; else if (c === "}" && --depth === 0) return { end: i + 1, value: JSON.parse(text.slice(at, i + 1)) }; } throw new Error("unterminated"); } };
16
+ }
17
+
18
+ /** The completed items of one journal, last revision of each item, in time order. */
19
+ export function journalItems(buffer) {
20
+ const text = buffer.toString("utf8");
21
+ const items = new Map();
22
+ const marker = '{"method":"item/completed"';
23
+ let at = text.indexOf(marker);
24
+ while (at >= 0) {
25
+ let next = at + marker.length;
26
+ try {
27
+ const { end, value } = decoder.decode(text, at);
28
+ next = end;
29
+ const item = value?.params?.item;
30
+ if (item?.itemId && (!items.has(item.itemId) || Number(item.revision) >= Number(items.get(item.itemId).revision))) items.set(item.itemId, item);
31
+ } catch { /* a record cut by the container framing */ }
32
+ at = text.indexOf(marker, next);
33
+ }
34
+ return [...items.values()].sort((a, b) => String(a.recordedAt).localeCompare(String(b.recordedAt)));
35
+ }
36
+
37
+ const parse = (s) => { try { return JSON.parse(s); } catch { return s ?? {}; } };
38
+
39
+ export function museAgentMessages(items) {
40
+ const messages = [];
41
+ for (const item of items) {
42
+ const ts = item.recordedAt || undefined;
43
+ if (item.kind === "userMessage" && item.text) messages.push({ role: "user", ts, text: String(item.text) });
44
+ else if (item.kind === "agentMessage" && item.text) messages.push({ role: "assistant", ts, text: String(item.text) });
45
+ else if (item.kind === "toolCall") {
46
+ const call = { id: String(item.callId || item.itemId), name: String(item.tool || "tool"), input: parse(item.args) };
47
+ messages.push({ role: "assistant", ts, text: "", tool_calls: [call] });
48
+ if (item.visibleOutput !== undefined) messages.push({ role: "tool", ts, tool_use_id: call.id, tool_name: call.name, is_error: item.status === "failed", text: typeof item.visibleOutput === "string" ? item.visibleOutput : JSON.stringify(item.visibleOutput) });
49
+ }
50
+ }
51
+ return messages;
52
+ }
53
+
54
+ function sessionMeta(root, id) {
55
+ const sessions = path.dirname(root);
56
+ let model = "", cwd = "";
57
+ try {
58
+ for (const year of fs.readdirSync(sessions)) for (const month of fs.readdirSync(path.join(sessions, year))) for (const day of fs.readdirSync(path.join(sessions, year, month))) {
59
+ const file = path.join(sessions, year, month, day, id, "session.jsonl");
60
+ if (!fs.existsSync(file)) continue;
61
+ const head = fs.readFileSync(file, "utf8").slice(0, 60000);
62
+ model = /"model_id":"([^"]+)"/.exec(head)?.[1] ?? "";
63
+ cwd = /"workspace_root":"([^"]+)"/.exec(head)?.[1] ?? "";
64
+ return { model, cwd };
65
+ }
66
+ } catch { /* the session folder is optional */ }
67
+ return { model, cwd };
68
+ }
69
+
70
+ export function* museAgentSessions(root) {
71
+ for (const id of fs.readdirSync(root)) {
72
+ const journal = path.join(root, id, "journal-00000000.bin");
73
+ if (!fs.existsSync(journal)) continue;
74
+ const messages = museAgentMessages(journalItems(fs.readFileSync(journal)));
75
+ if (!messages.some((m) => m.role === "user") || !messages.some((m) => m.role === "assistant")) continue;
76
+ const stamps = messages.map((m) => m.ts).filter(Boolean).sort();
77
+ const first = messages.find((m) => m.role === "user");
78
+ const meta = sessionMeta(root, id);
79
+ const privacy = privacyReport(messages);
80
+ yield {
81
+ format: FORMAT, harness: "muse-agent", model: meta.model, session_id: `muse-agent-${id}`, title: String(first.text).split("\n")[0].slice(0, 120),
82
+ started_at: stamps[0] ?? null, ended_at: stamps.at(-1) ?? null, cwd: meta.cwd, source: "muse-agent-journal",
83
+ source_gaps: ["Read from the completed items of Muse's projection journal: reasoning, reminder sub-sessions and token usage are not carried."],
84
+ sensitive: privacy.sensitive, privacy, messages,
85
+ };
86
+ }
87
+ }
88
+
89
+ export default {
90
+ id: "muse-agent",
91
+ name: "Muse agent (Meta, local)",
92
+ kind: "local",
93
+ roots: (home) => [path.join(home, ".local", "share", "muse", "sessions", ".msp-view-g12")],
94
+ *collect(root) { yield* museAgentSessions(root); },
95
+ };