@agentsky/sky 3.39.0 → 3.41.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  USER_AGENT
3
- } from "./chunk-SC5RAJVJ.js";
3
+ } from "./chunk-RX2J4TS6.js";
4
4
  import {
5
5
  apiBase,
6
6
  apiToken,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MLKGABMK.js";
4
4
 
5
5
  // src/version.ts
6
- var CLI_VERSION = "3.39.0";
6
+ var CLI_VERSION = "3.41.0";
7
7
  var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
8
8
 
9
9
  // ../../packages/spec/src/catalog-models.ts
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  uploadFile,
16
16
  uploadLargeFile,
17
17
  writeResponseFile
18
- } from "./chunk-7A3BLBKU.js";
18
+ } from "./chunk-GSRLZKDU.js";
19
19
  import {
20
20
  AGENT_TYPES,
21
21
  CLI_VERSION,
@@ -41,7 +41,7 @@ import {
41
41
  splitMcpServers,
42
42
  storeSkillRefSchema,
43
43
  supersededBy
44
- } from "./chunk-SC5RAJVJ.js";
44
+ } from "./chunk-RX2J4TS6.js";
45
45
  import {
46
46
  apiBase,
47
47
  apiToken,
@@ -13573,6 +13573,16 @@ timeline.command("resume").description("start recording your work again on every
13573
13573
  console.log(renderTimelinePause(answer.paused));
13574
13574
  })
13575
13575
  );
13576
+ var graph = program.command("graph").description("the graph over the work log: any object, what it is linked to, the decisions about it and the questions still open");
13577
+ graph.command("show <ref>").description("one node by its address <type>:<id>: same-as addresses, stated relationships, neighbours, decisions, open questions and latest events").action(run(async (ref) => {
13578
+ console.log(JSON.stringify(await api("GET", `/graph?ref=${encodeURIComponent(ref)}`), null, 2));
13579
+ }));
13580
+ graph.command("questions").description("the open questions about relationships nobody has settled").option("--limit <n>", "questions to return (1-200)").action(run(async (opts) => {
13581
+ console.log(JSON.stringify(await api("GET", `/graph/questions${opts.limit ? `?limit=${encodeURIComponent(opts.limit)}` : ""}`), null, 2));
13582
+ }));
13583
+ graph.command("answer <question> <choice>").description("answer one open question: yes or no for a guess; an option's address, or all, for relationships that disagree").option("--note <text>", "why").action(run(async (question, choice, opts) => {
13584
+ console.log(JSON.stringify(await api("POST", `/graph/questions/${encodeURIComponent(question)}/answer`, { choice, ...opts.note ? { note: opts.note } : {} }), null, 2));
13585
+ }));
13576
13586
  var events = program.command("events").description("the work graph log: everything that happened in a task, a session or your own work");
13577
13587
  events.command("search").description("events in time order; --object sha256:<hex> finds every event that touched those exact bytes, in any thread").option("--task <id>", "a task (its root session id)").option("--session <id>", "one session").option("--object <type:id>", "e.g. sha256:<hex>, artifact:<id>, chat_message:<id>").option("--kind <kind>", "e.g. session.message, taskfile.version_created, result.obtained").option("--from <iso>", "inclusive lower time bound").option("--to <iso>", "exclusive upper time bound").option("--cursor <cursor>", "continue a previous page").option("--limit <n>", "events per page (default 100, at most 500)").option("--json", "print the API's answer as JSON").action(
13578
13588
  run(async (opts) => {
@@ -13881,7 +13891,7 @@ hookRule.command("set").description("replace the entire ordered list of workspac
13881
13891
  })
13882
13892
  );
13883
13893
  var ruleCommand = program.command("rule").description("every rule of every kind (tool, spend, call count, capability, plugin, hook, Sky) in one place");
13884
- ruleCommand.command("list").description("the rules you may see, with their kind, scope and where they are kept").option("--kind <kind>", "tool_call, spend_cap, call_count, capability, plugin, hook or sky").option("--session <id>", "also this session's own rules").option("--json", "print as JSON").action(
13894
+ ruleCommand.command("list").description("the rules you may see, with their kind, scope and where they are kept").option("--kind <kind>", "tool_call, spend_cap, call_count, capability, plugin, hook, sky, permission or role").option("--session <id>", "also this session's own rules").option("--json", "print as JSON").action(
13885
13895
  run(async (opts) => {
13886
13896
  const query = new URLSearchParams({ ...opts.kind ? { kind: opts.kind } : {}, ...opts.session ? { session_id: opts.session } : {} }).toString();
13887
13897
  const data = await api("GET", `/rules${query ? `?${query}` : ""}`);
@@ -13893,7 +13903,7 @@ ruleCommand.command("list").description("the rules you may see, with their kind,
13893
13903
  console.log(`store: ${data.rollout.map((entry2) => `${entry2.decision}=${entry2.mode}`).join(" ")}`);
13894
13904
  })
13895
13905
  );
13896
- ruleCommand.command("add").description("add a rule: --kind and --config JSON (the kind's own configuration)").requiredOption("--kind <kind>", "tool_call, spend_cap, call_count, capability, hook, sky or permission").requiredOption("--config <json>", `the kind's configuration, e.g. '{"action":"deny","matcher":"Bash"}' or '{"target":"tool.buy_credit","permission":"deny"}'`).option("--name <name>", "a name for it").option("--session <id>", "a rule for this session only").option("--person", "a permission of your own, rather than the workspace's").option("--agent <id>", "a permission for one agent's sessions; a looser one holds once the workspace's owner or an admin adds it").action(
13906
+ ruleCommand.command("add").description("add a rule: --kind and --config JSON (the kind's own configuration)").requiredOption("--kind <kind>", "tool_call, spend_cap, call_count, capability, hook, sky, permission or role").requiredOption("--config <json>", `the kind's configuration, e.g. '{"action":"deny","matcher":"Bash"}' or '{"target":"tool.buy_credit","permission":"deny"}' or '{"action":"keys.manage","roles":["admin","member"]}'`).option("--name <name>", "a name for it").option("--session <id>", "a rule for this session only").option("--person", "a permission of your own, rather than the workspace's").option("--agent <id>", "a permission for one agent's sessions; a looser one holds once the workspace's owner or an admin adds it").action(
13897
13907
  run(async (opts) => {
13898
13908
  const body = { kind: opts.kind, config: JSON.parse(opts.config), ...opts.name ? { name: opts.name } : {}, ...opts.session ? { scope: { type: "session", id: opts.session } } : opts.agent ? { scope: { type: "agent", id: opts.agent } } : opts.person ? { scope: { type: "person" } } : {} };
13899
13909
  console.log(JSON.stringify(await api("POST", "/rules", body), null, 2));
@@ -13917,6 +13927,20 @@ ruleCommand.command("set <id>").description("change a rule: --on, --off, --name
13917
13927
  console.log(JSON.stringify(await api("PATCH", `/rules/${encodeURIComponent(id3)}`, body), null, 2));
13918
13928
  })
13919
13929
  );
13930
+ ruleCommand.command("history").description("who changed which rule, newest first, with the rule before and after").option("--rule <id>", "one rule's changes only").option("--limit <n>", "how many, 1 to 200 (50 when left out)").option("--json", "print as JSON, with each rule before and after").action(
13931
+ run(async (opts) => {
13932
+ const query = new URLSearchParams({ ...opts.rule ? { rule_id: opts.rule } : {}, ...opts.limit ? { limit: opts.limit } : {} }).toString();
13933
+ const data = await api("GET", `/rules/history${query ? `?${query}` : ""}`);
13934
+ if (opts.json) {
13935
+ console.log(JSON.stringify(data, null, 2));
13936
+ return;
13937
+ }
13938
+ for (const change of data.changes) console.log(`${change.id} ${change.at} ${change.kind.padEnd(12)} ${change.payload.rule.kind.padEnd(11)} ${change.payload.rule.scope.type.padEnd(9)} ${change.payload.rule.id} by ${change.actor.user_id ?? change.actor.session_id ?? change.actor.kind}${change.payload.undoes ? ` (undoes ${change.payload.undoes})` : ""}`);
13939
+ })
13940
+ );
13941
+ ruleCommand.command("undo <change>").description("put a rule back as it was before one change (its id from: sky rule history)").action(run(async (change) => {
13942
+ console.log(JSON.stringify(await api("POST", `/rules/history/${encodeURIComponent(change)}/undo`), null, 2));
13943
+ }));
13920
13944
  ruleCommand.command("rm <id>").description("remove a rule").action(run(async (id3) => {
13921
13945
  console.log(JSON.stringify(await api("DELETE", `/rules/${encodeURIComponent(id3)}`), null, 2));
13922
13946
  }));
@@ -14657,7 +14681,7 @@ harness.command("connect").description("run an ACP agent (the command after --)
14657
14681
  }));
14658
14682
  var traceCmd = program.command("trace").description("correlate this machine's agent work with the cloud sessions it starts (metadata only unless you choose content)");
14659
14683
  traceCmd.command("start").description("start a trace: a grant for this machine, a root span, and the spool the hooks write to").option("--name <name>", "a name for the task").option("--source <source>", "how this machine reports itself", "claude-code").option("--hooks [settings]", "also install the Claude Code hooks (default: ./.claude/settings.local.json)").option("--capture <scopes>", "also send content, redacted on this machine first: any of prompts,tool_output,files").option("--file <path>", "a file the files scope may send (repeatable)", collect).option("--dir <path>", "a folder whose files the files scope may send when a file tool touches them (repeatable)", collect).action(run(async (opts) => {
14660
- const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-PB2LPQCZ.js");
14684
+ const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-BR7H3O7X.js");
14661
14685
  if (readState()) throw new Error("a trace is already running here \u2014 `sky trace stop` it first");
14662
14686
  const scopes = parseContentScopes(opts.capture);
14663
14687
  const chosen = chosenPaths(opts.file ?? [], opts.dir ?? []);
@@ -14692,7 +14716,7 @@ traceCmd.command("start").description("start a trace: a grant for this machine,
14692
14716
  }));
14693
14717
  traceCmd.command("hook").description("record one Claude Code hook event read from stdin (run by the installed hooks; never fails, prints nothing)").action(async () => {
14694
14718
  try {
14695
- const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-PB2LPQCZ.js");
14719
+ const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-BR7H3O7X.js");
14696
14720
  const chunks = [];
14697
14721
  for await (const chunk of process.stdin) chunks.push(chunk);
14698
14722
  const input = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
@@ -14705,14 +14729,14 @@ traceCmd.command("hook").description("record one Claude Code hook event read fro
14705
14729
  }
14706
14730
  });
14707
14731
  traceCmd.command("flush").description("send what the spool holds, retrying with backoff").action(run(async () => {
14708
- const { readState, flush, grantSender } = await import("./trace-PB2LPQCZ.js");
14732
+ const { readState, flush, grantSender } = await import("./trace-BR7H3O7X.js");
14709
14733
  const state = readState();
14710
14734
  if (!state) throw new Error("no trace is running here");
14711
14735
  const outcome = await flush(grantSender(state), { attempts: 4 });
14712
14736
  console.log(`sent ${outcome.sent}, refused ${outcome.refused}, given up ${outcome.expired}, still pending ${outcome.pending}${outcome.stopped ? ` (stopped: ${outcome.stopped})` : ""}`);
14713
14737
  }));
14714
14738
  traceCmd.command("status").description("the running trace and its spool").action(run(async () => {
14715
- const { readState, spoolStatus } = await import("./trace-PB2LPQCZ.js");
14739
+ const { readState, spoolStatus } = await import("./trace-BR7H3O7X.js");
14716
14740
  const state = readState();
14717
14741
  if (!state) {
14718
14742
  console.log("No trace is running here.");
@@ -14722,7 +14746,7 @@ traceCmd.command("status").description("the running trace and its spool").action
14722
14746
  console.log(`${state.trace_id} as ${state.source}: ${spool.pending} pending, ${spool.dropped_full} dropped (spool full), ${spool.dropped_expired} given up, ${spool.refused} refused`);
14723
14747
  }));
14724
14748
  traceCmd.command("show [id]").description("the trace bundle: spans, the sessions they reach, cost counted once per session").option("--json", "print the bundle as JSON").action(run(async (id3, opts) => {
14725
- const { readState } = await import("./trace-PB2LPQCZ.js");
14749
+ const { readState } = await import("./trace-BR7H3O7X.js");
14726
14750
  const ref = id3 ?? readState()?.trace_id;
14727
14751
  if (!ref) throw new Error("name a trace, or start one here");
14728
14752
  const bundle = await api("GET", `/traces/${ref}`);
@@ -14749,7 +14773,7 @@ traceCmd.command("show [id]").description("the trace bundle: spans, the sessions
14749
14773
  for (const gap of bundle.gaps) console.log(` gap: ${gap.span_id} ${gap.reason}`);
14750
14774
  }));
14751
14775
  traceCmd.command("stop").description("end the root span, send what is left, and revoke this machine's grant").action(run(async () => {
14752
- const { readState, record, flush, grantSender, clearState } = await import("./trace-PB2LPQCZ.js");
14776
+ const { readState, record, flush, grantSender, clearState } = await import("./trace-BR7H3O7X.js");
14753
14777
  const state = readState();
14754
14778
  if (!state) throw new Error("no trace is running here");
14755
14779
  if (state.root_span) record(() => [{ span_id: state.root_span, kind: "end", outcome: "completed" }]);
@@ -14762,7 +14786,7 @@ var recordCmd = traceCmd.command("record").description("record every Claude Code
14762
14786
  const { homedir: homedir13 } = await import("os");
14763
14787
  const { join: join25 } = await import("path");
14764
14788
  const vault2 = await import("./trace-vault-IUNYRVGZ.js");
14765
- const { installClaudeHooks, uninstallClaudeHooks } = await import("./trace-PB2LPQCZ.js");
14789
+ const { installClaudeHooks, uninstallClaudeHooks } = await import("./trace-BR7H3O7X.js");
14766
14790
  const command = "sky trace record hook";
14767
14791
  const config = vault2.loadVaultConfig();
14768
14792
  const settings = resolve13(opts.settings ?? config.settings ?? join25(process.env.CLAUDE_CONFIG_DIR ?? join25(homedir13(), ".claude"), "settings.json"));
@@ -14827,7 +14851,7 @@ recordCmd.command("seal <session-dir>").description("seal the cut segments of on
14827
14851
  }
14828
14852
  });
14829
14853
  traceCmd.command("sync [payload]").description("upload this machine's agent sessions (Claude Code, Codex, Cursor, Gemini CLI and every other agent `--agents` lists) to the matching workspace's trace library, redacted here first").option("--enable", "turn sync on for this machine").option("--disable", "turn sync off; nothing more is uploaded").option("--route <match=workspace>", "send sessions whose folder path contains <match> to <workspace> (repeatable; replaces the saved rules)", collect).option("--default <workspace>", "where a session no rule matches goes").option("--keep-local", "keep sessions no rule matches on this machine (the default)").option("--session <ref>", "only this session: its id or transcript path (repeatable)", collect).option("--import <export>", "add a downloaded cloud export (claude.ai, ChatGPT, Gemini, Grok, DeepSeek \u2026: its .zip, folder or file) so sync uploads it (repeatable)", collect).option("--agents", "list the agents sync reads and which are on this machine").option("--full", "re-read every session, not only files that changed").option("--limit <n>", "at most this many changed sessions this run", (v) => Number.parseInt(v, 10)).option("--dry-run", "show what would be uploaded without uploading").option("--hook", "run from a Claude Code SessionEnd hook or Codex notify: upload that session in the background and return at once").option("--install-schedule", "also sweep every 15 minutes (macOS launchd)").option("--status", "what sync has done on this machine").option("--quiet", "print only failures").action(async (payload, opts) => {
14830
- const lib = await import("./trace-library-EOEW45OX.js");
14854
+ const lib = await import("./trace-library-VPTUWWSA.js");
14831
14855
  if (opts.hook) {
14832
14856
  try {
14833
14857
  let raw = payload ?? "";
@@ -14938,7 +14962,7 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
14938
14962
  });
14939
14963
  traceCmd.command("mac <machine>").description("which workspace's trace library one of your Macs fills; the AgentSky Mac app uploads that Mac's agent sessions there, redacted on the Mac first, exactly as `sky trace sync` would (machine ids: `sky api GET /desktop/machines`)").option("--on", "send this Mac's sessions to --workspace (or the current workspace), moving them from any other").option("--off", "stop this Mac's uploads to --workspace (or the current workspace)").option("--workspace <slug>", "the workspace to turn on or off (default: the current one)").option("--json", "print the answer as JSON").action(run(async (machine, opts) => {
14940
14964
  if (opts.on && opts.off) throw new Error("choose --on or --off");
14941
- const { libraryRequest } = await import("./trace-library-EOEW45OX.js");
14965
+ const { libraryRequest } = await import("./trace-library-VPTUWWSA.js");
14942
14966
  const workspace2 = opts.workspace ?? currentUniverse();
14943
14967
  if (!workspace2) throw new Error("name a workspace with --workspace");
14944
14968
  const answer = opts.on || opts.off ? await libraryRequest("PUT", `/trace-library/devices/${encodeURIComponent(machine)}`, workspace2, { enabled: Boolean(opts.on) }) : await libraryRequest("GET", `/trace-library/devices/${encodeURIComponent(machine)}`, workspace2);
@@ -14955,7 +14979,7 @@ traceCmd.command("search <query...>").description("search every session in a wor
14955
14979
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
14956
14980
  }));
14957
14981
  traceCmd.command("library").description("list the sessions in a workspace's trace library, most recently updated first").option("--workspace <slug>", "the workspace (default: the current one)").option("--limit <n>", "how many", (v) => Number.parseInt(v, 10), 20).option("--json", "print the page as JSON").action(run(async (opts) => {
14958
- const { libraryRequest } = await import("./trace-library-EOEW45OX.js");
14982
+ const { libraryRequest } = await import("./trace-library-VPTUWWSA.js");
14959
14983
  const workspace2 = opts.workspace ?? currentUniverse();
14960
14984
  if (!workspace2) throw new Error("name a workspace with --workspace");
14961
14985
  const page = await libraryRequest("GET", `/trace-library?limit=${opts.limit}`, workspace2);
@@ -2,7 +2,7 @@ import {
2
2
  TRACE_CONTENT_SCOPES,
3
3
  USER_AGENT,
4
4
  redactTraceText
5
- } from "./chunk-SC5RAJVJ.js";
5
+ } from "./chunk-RX2J4TS6.js";
6
6
  import {
7
7
  configPath
8
8
  } from "./chunk-XHZJG3QT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ApiError,
3
3
  uploadLargeFile
4
- } from "./chunk-7A3BLBKU.js";
4
+ } from "./chunk-GSRLZKDU.js";
5
5
  import {
6
6
  SessionSourceCollector,
7
7
  USER_AGENT,
@@ -9,7 +9,7 @@ import {
9
9
  publicRemote,
10
10
  redactLine,
11
11
  redactTraceText
12
- } from "./chunk-SC5RAJVJ.js";
12
+ } from "./chunk-RX2J4TS6.js";
13
13
  import {
14
14
  apiBase,
15
15
  apiToken
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/sky",
3
- "version": "3.39.0",
3
+ "version": "3.41.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",