@agentsky/sky 3.45.0 → 3.47.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.
Files changed (26) hide show
  1. package/agent-plugins/plugins/meetings/.codex-plugin/plugin.json +1 -1
  2. package/agent-plugins/plugins/meetings/skills/agentsky-meetings/SKILL.md +2 -2
  3. package/dist/{chunk-7DFFA6GA.js → chunk-BIWRJ65N.js} +1 -1
  4. package/dist/{chunk-WSQZHRE4.js → chunk-C3RW65GZ.js} +2 -2
  5. package/dist/{chunk-WLTOVOTW.js → chunk-DAVMU66H.js} +1 -1
  6. package/dist/{chunk-TPDNO2LM.js → chunk-FDR6JOIJ.js} +53 -16
  7. package/dist/{chunk-UHEJFBZJ.js → chunk-IZCS7FH3.js} +5 -5
  8. package/dist/{chunk-OBRH43HE.js → chunk-LMYRAGDR.js} +10 -5
  9. package/dist/chunk-MSEGJ7V5.js +214 -0
  10. package/dist/{chunk-YYDO5WB5.js → chunk-OJ5ERABF.js} +1 -1
  11. package/dist/{chunk-OYSSK6GS.js → chunk-SJIBWHJU.js} +229 -19
  12. package/dist/{chunk-AM6GOGA6.js → chunk-W24YSGH4.js} +368 -73
  13. package/dist/{chunk-EO32DG3Z.js → chunk-Y7JBA7AC.js} +21 -19
  14. package/dist/{chunk-MXIAK52Z.js → chunk-YUZWSDVE.js} +16 -177
  15. package/dist/{compute-OZ4TQBKO.js → compute-FAXL7DAK.js} +2 -2
  16. package/dist/compute-report-XQJSIK6B.js +39 -0
  17. package/dist/index.js +1324 -862
  18. package/dist/{local-skills-E45ZCYGY.js → local-skills-DRZH2R3Q.js} +3 -3
  19. package/dist/{local-skills-run-3CCDHJ6Q.js → local-skills-run-MH2TI2UC.js} +11 -11
  20. package/dist/mcp-serve-JJD6JGYS.js +16 -0
  21. package/dist/{trace-IRBLGOPZ.js → trace-RMYKGACV.js} +3 -3
  22. package/dist/{trace-exclusions-SMBZES3R.js → trace-exclusions-JEGMUPWQ.js} +2 -2
  23. package/dist/{trace-library-CRCV5JDF.js → trace-library-QLCECTIS.js} +10 -8
  24. package/package.json +2 -2
  25. package/dist/compute-report-SGDLKR22.js +0 -34
  26. package/dist/mcp-serve-DXL7IMSU.js +0 -103
@@ -1,6 +1,22 @@
1
+ import {
2
+ ApiError,
3
+ api
4
+ } from "./chunk-DAVMU66H.js";
1
5
  import {
2
6
  installClaudeHooks
3
- } from "./chunk-UHEJFBZJ.js";
7
+ } from "./chunk-IZCS7FH3.js";
8
+ import {
9
+ loadLocalSkillState,
10
+ revisionAt
11
+ } from "./chunk-C3RW65GZ.js";
12
+ import {
13
+ USER_AGENT
14
+ } from "./chunk-BIWRJ65N.js";
15
+ import {
16
+ apiBase,
17
+ apiToken,
18
+ configPath
19
+ } from "./chunk-XHZJG3QT.js";
4
20
  import {
5
21
  IncompleteSourceCaptureError,
6
22
  SOURCE_CAPTURE_VERSION,
@@ -16,28 +32,12 @@ import {
16
32
  savePendingSource,
17
33
  stillExcluded,
18
34
  writePrivateJson
19
- } from "./chunk-YYDO5WB5.js";
35
+ } from "./chunk-OJ5ERABF.js";
20
36
  import {
21
37
  SessionSourceCollector,
22
38
  publicRemote,
23
39
  redactTraceText
24
- } from "./chunk-AM6GOGA6.js";
25
- import {
26
- ApiError,
27
- api
28
- } from "./chunk-WLTOVOTW.js";
29
- import {
30
- loadLocalSkillState,
31
- revisionAt
32
- } from "./chunk-WSQZHRE4.js";
33
- import {
34
- USER_AGENT
35
- } from "./chunk-7DFFA6GA.js";
36
- import {
37
- apiBase,
38
- apiToken,
39
- configPath
40
- } from "./chunk-XHZJG3QT.js";
40
+ } from "./chunk-W24YSGH4.js";
41
41
 
42
42
  // src/trace-library.ts
43
43
  import { createHash as createHash3 } from "crypto";
@@ -969,6 +969,7 @@ var backoffMs = (attempt) => Math.min(3e4, 1e3 * 2 ** attempt);
969
969
  function skyDir() {
970
970
  return process.env.SKY_CONFIG_DIR ?? join4(homedir4(), ".config", "sky");
971
971
  }
972
+ var SYNC_STATE_NAMES = ["trace-sync-state.json", "session-results.json", "trace-sync-codex-ids.json", "trace-pending", "trace-sync.lock"];
972
973
  function syncConfigPath() {
973
974
  return join4(skyDir(), "trace-sync.json");
974
975
  }
@@ -1987,6 +1988,7 @@ export {
1987
1988
  SINGLE_REQUEST_MAX_BYTES,
1988
1989
  transfer,
1989
1990
  uploadLargeFile,
1991
+ SYNC_STATE_NAMES,
1990
1992
  syncConfigPath,
1991
1993
  lastUploads,
1992
1994
  loadSyncConfig,
@@ -2,14 +2,9 @@ import {
2
2
  MCP_SERVER_NAME,
3
3
  withoutSettingsBlock,
4
4
  withoutTomlServer
5
- } from "./chunk-OYSSK6GS.js";
5
+ } from "./chunk-SJIBWHJU.js";
6
6
  import {
7
- ApiError,
8
- api
9
- } from "./chunk-WLTOVOTW.js";
10
- import {
11
- configPath,
12
- currentUniverse
7
+ configPath
13
8
  } from "./chunk-XHZJG3QT.js";
14
9
 
15
10
  // src/setup-journal.ts
@@ -138,6 +133,17 @@ var SetupJournal = class {
138
133
  this.createdDirs(path);
139
134
  this.data.owned.push(path);
140
135
  }
136
+ /** Whether setup created `path`: it did not exist the first time setup wrote it. */
137
+ created(path) {
138
+ return this.data.files[path]?.original === null || this.data.owned.includes(path);
139
+ }
140
+ /** Own a path whatever it holds now: only for what exists because of something setup created (capture's own state),
141
+ * or what a command setup ran created during the run. */
142
+ adopt(path) {
143
+ if (this.owns(path) || this.data.files[path]) return;
144
+ this.createdDirs(path);
145
+ this.data.owned.push(path);
146
+ }
141
147
  /** Whether `path` is, or lies inside, a path setup owns outright. */
142
148
  owns(path) {
143
149
  return this.data.owned.some((owned) => path === owned || path.startsWith(`${owned}${sep}`));
@@ -268,8 +274,8 @@ function withoutJsonServer(text) {
268
274
  }
269
275
  if (!config?.mcpServers || !(MCP_SERVER_NAME in config.mcpServers)) return text;
270
276
  delete config.mcpServers[MCP_SERVER_NAME];
271
- return `${JSON.stringify(config, null, 2)}
272
- `;
277
+ const indent = /^[{[]\r?\n([ \t]+)/.exec(text)?.[1] ?? 2;
278
+ return `${JSON.stringify(config, null, indent)}${text.endsWith("\n") ? "\n" : ""}`;
273
279
  }
274
280
  function withoutTomlServerText(text) {
275
281
  const rest = withoutTomlServer(text, MCP_SERVER_NAME);
@@ -319,155 +325,6 @@ var ENTRY_REMOVERS = {
319
325
  settings_block: withoutSettingsBlock
320
326
  };
321
327
 
322
- // src/workspace.ts
323
- import { createInterface } from "readline";
324
- var KINDS = ["TOOL_CALL", "SPEND_CAP", "CALL_COUNT", "CAPABILITY"];
325
- async function workspaceSlug(explicit) {
326
- if (explicit) return explicit;
327
- const current = currentUniverse();
328
- if (current) return current;
329
- return (await api("GET", "/whoami")).universe.slug;
330
- }
331
- var workspacePath = (slug) => `/universes/${encodeURIComponent(slug)}`;
332
- async function listMembers(slug, page = {}) {
333
- const query = new URLSearchParams({ ...page.limit ? { limit: page.limit } : {}, ...page.cursor ? { cursor: page.cursor } : {} }).toString();
334
- return api("GET", `${workspacePath(slug)}/members${query ? `?${query}` : ""}`);
335
- }
336
- function findMember(members, ref) {
337
- const needle = ref.toLowerCase();
338
- const found = members.find((m) => m.user_id === ref || m.email?.toLowerCase() === needle);
339
- if (!found) throw new ApiError(404, "not_found", `no member ${ref} in this workspace`);
340
- return found;
341
- }
342
- function inviteBody(emails, options) {
343
- if (options.role && options.role !== "admin" && options.role !== "member") {
344
- throw new ApiError(400, "invalid_request", "--role is admin or member");
345
- }
346
- return {
347
- emails,
348
- ...options.role ? { role: options.role } : {},
349
- ...options.sendEmail ? { send_email: true } : {}
350
- };
351
- }
352
- async function invite(slug, emails, options) {
353
- return api("POST", `${workspacePath(slug)}/invites`, inviteBody(emails, options));
354
- }
355
- async function withdrawInvite(slug, inviteId) {
356
- await api("DELETE", `${workspacePath(slug)}/invites/${encodeURIComponent(inviteId)}`);
357
- }
358
- async function setRole(slug, memberRef, role) {
359
- if (role !== "admin" && role !== "member") throw new ApiError(400, "invalid_request", "a role is admin or member");
360
- const member = findMember((await listMembers(slug)).members, memberRef);
361
- await api("PATCH", `${workspacePath(slug)}/members/${encodeURIComponent(member.user_id)}`, { role });
362
- return member;
363
- }
364
- async function removeMember(slug, memberRef) {
365
- if (memberRef === "me") {
366
- await leaveWorkspace(slug);
367
- return null;
368
- }
369
- const member = findMember((await listMembers(slug)).members, memberRef);
370
- await api("DELETE", `${workspacePath(slug)}/members/${encodeURIComponent(member.user_id)}`);
371
- return member;
372
- }
373
- async function leaveWorkspace(slug) {
374
- await api("DELETE", `${workspacePath(slug)}/members/me`);
375
- }
376
- async function joinWorkspace(token) {
377
- return (await api("POST", `/invites/${encodeURIComponent(token)}`)).workspace;
378
- }
379
- function renderMembers(page) {
380
- const lines = page.members.map((m) => `${m.role.padEnd(6)} ${m.email ?? m.user_id}${m.name ? ` (${m.name})` : ""} ${m.user_id}`);
381
- for (const i of page.invites) lines.push(`invited ${i.email} as ${i.role} by ${i.invited_by} until ${i.expires_at.slice(0, 10)} ${i.id}`);
382
- if (page.next_cursor) lines.push(`more: --cursor ${page.next_cursor}`);
383
- return lines;
384
- }
385
- function policyRuleBody(options) {
386
- const kind = options.kind.toUpperCase().replace(/-/g, "_");
387
- if (!KINDS.includes(kind)) throw new ApiError(400, "invalid_request", `--kind is one of ${KINDS.join(", ")}`);
388
- let config;
389
- try {
390
- config = JSON.parse(options.config);
391
- } catch {
392
- throw new ApiError(400, "invalid_request", "--config must be a JSON object");
393
- }
394
- if (!config || typeof config !== "object" || Array.isArray(config)) {
395
- throw new ApiError(400, "invalid_request", "--config must be a JSON object");
396
- }
397
- const position = options.position === void 0 ? void 0 : Number(options.position);
398
- if (position !== void 0 && !Number.isInteger(position)) throw new ApiError(400, "invalid_request", "--position is a whole number");
399
- return {
400
- name: options.name,
401
- kind,
402
- config,
403
- ...position !== void 0 ? { position } : {},
404
- ...options.disabled ? { enabled: false } : {}
405
- };
406
- }
407
- var policiesPath = (scope) => "session" in scope ? `/sessions/${encodeURIComponent(scope.session)}/policies` : `${workspacePath(scope.slug)}/policies`;
408
- async function listPolicies(scope, effective = false) {
409
- if (effective && "session" in scope) return api("GET", `/sessions/${encodeURIComponent(scope.session)}/effective-policy`);
410
- return api("GET", policiesPath(scope));
411
- }
412
- async function addPolicy(scope, options) {
413
- return (await api("POST", policiesPath(scope), policyRuleBody(options))).rule;
414
- }
415
- async function setPolicyEnabled(scope, ruleId, enabled) {
416
- return (await api("PATCH", `${policiesPath(scope)}/${encodeURIComponent(ruleId)}`, { enabled })).rule;
417
- }
418
- async function removePolicy(scope, ruleId) {
419
- await api("DELETE", `${policiesPath(scope)}/${encodeURIComponent(ruleId)}`);
420
- }
421
- function renderPolicy(rule) {
422
- const state = rule.enabled ? "on " : "off";
423
- return `${state} ${rule.layer.padEnd(9)} ${rule.kind.padEnd(10)} ${rule.name} ${JSON.stringify(rule.config)} ${rule.id}`;
424
- }
425
- var REMOVED_KINDS = [
426
- ["sessions", "sessions and their transcripts"],
427
- ["agents", "agents"],
428
- ["artifacts", "artifacts"],
429
- ["files", "task files"],
430
- ["memory_stores", "memory stores"],
431
- ["routines", "routines"],
432
- ["channels", "channel connections"],
433
- ["webhooks", "webhooks"],
434
- ["api_keys", "API keys"],
435
- ["vaults", "vaults"],
436
- ["skills", "skills"],
437
- ["environments", "environments"],
438
- ["connections", "connected apps"],
439
- ["traces", "uploaded traces"],
440
- ["members", "other members"],
441
- ["invites", "pending invitations"]
442
- ];
443
- async function deletionPreview(slug) {
444
- return api("GET", `/universes/${encodeURIComponent(slug)}/deletion`);
445
- }
446
- function renderDeletionPreview(preview) {
447
- if (!preview.can_delete) return [`${preview.workspace.slug} cannot be deleted:`, ...preview.blockers.map((b) => ` ${b.message}`)];
448
- const lines = [`Deleting ${preview.workspace.slug} (${preview.workspace.name}) permanently removes:`];
449
- const removed = REMOVED_KINDS.filter(([key]) => (preview.removes[key] ?? 0) > 0);
450
- for (const [key, label] of removed) lines.push(` ${preview.removes[key]} ${label}`);
451
- if (!removed.length) lines.push(" nothing: the workspace is empty");
452
- const running = preview.removes.running_sessions ?? 0;
453
- if (running) lines.push(`${running} running session${running === 1 ? " is" : "s are"} stopped first.`);
454
- if (preview.wallet) lines.push(`$${(preview.wallet.balance_micros / 1e6).toFixed(2)} in its wallet goes back to ${preview.wallet.returns_to ?? "you"}.`);
455
- lines.push("This cannot be undone.");
456
- return lines;
457
- }
458
- async function deleteWorkspace(slug) {
459
- return (await api("DELETE", `/universes/${encodeURIComponent(slug)}`)).deleted;
460
- }
461
- function typedConfirmation(slug) {
462
- return new Promise((done) => {
463
- const rl = createInterface({ input: process.stdin, output: process.stdout });
464
- rl.question(`Type ${slug} to delete it: `, (answer) => {
465
- rl.close();
466
- done(answer.trim() === slug);
467
- });
468
- });
469
- }
470
-
471
328
  export {
472
329
  TOKEN_ENV,
473
330
  shellEnvFiles,
@@ -475,23 +332,5 @@ export {
475
332
  writeShellEnv,
476
333
  SetupJournal,
477
334
  CAPTURE_HOOK_ARGS,
478
- isCaptureCommand,
479
- workspaceSlug,
480
- listMembers,
481
- invite,
482
- withdrawInvite,
483
- setRole,
484
- removeMember,
485
- leaveWorkspace,
486
- joinWorkspace,
487
- renderMembers,
488
- listPolicies,
489
- addPolicy,
490
- setPolicyEnabled,
491
- removePolicy,
492
- renderPolicy,
493
- deletionPreview,
494
- renderDeletionPreview,
495
- deleteWorkspace,
496
- typedConfirmation
335
+ isCaptureCommand
497
336
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  api
3
- } from "./chunk-WLTOVOTW.js";
4
- import "./chunk-7DFFA6GA.js";
3
+ } from "./chunk-DAVMU66H.js";
4
+ import "./chunk-BIWRJ65N.js";
5
5
  import "./chunk-XHZJG3QT.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
 
@@ -0,0 +1,39 @@
1
+ import {
2
+ MCP_ENTRY,
3
+ computerClients,
4
+ computerReport,
5
+ describeRepair,
6
+ engineReports,
7
+ forgetComputer,
8
+ machineKey,
9
+ repairComputer,
10
+ reportComputer,
11
+ savedMachineKey,
12
+ upkeepComputer
13
+ } from "./chunk-FDR6JOIJ.js";
14
+ import "./chunk-YUZWSDVE.js";
15
+ import "./chunk-MSEGJ7V5.js";
16
+ import "./chunk-SJIBWHJU.js";
17
+ import "./chunk-Y7JBA7AC.js";
18
+ import "./chunk-DAVMU66H.js";
19
+ import "./chunk-IZCS7FH3.js";
20
+ import "./chunk-C3RW65GZ.js";
21
+ import "./chunk-LMYRAGDR.js";
22
+ import "./chunk-BIWRJ65N.js";
23
+ import "./chunk-XHZJG3QT.js";
24
+ import "./chunk-OJ5ERABF.js";
25
+ import "./chunk-W24YSGH4.js";
26
+ import "./chunk-MLKGABMK.js";
27
+ export {
28
+ MCP_ENTRY,
29
+ computerClients,
30
+ computerReport,
31
+ describeRepair,
32
+ engineReports,
33
+ forgetComputer,
34
+ machineKey,
35
+ repairComputer,
36
+ reportComputer,
37
+ savedMachineKey,
38
+ upkeepComputer
39
+ };