@agentsky/sky 3.31.0 → 3.32.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.
@@ -38,7 +38,7 @@ function currentUniverse() {
38
38
  }
39
39
 
40
40
  // src/version.ts
41
- var CLI_VERSION = "3.31.0";
41
+ var CLI_VERSION = "3.32.0";
42
42
  var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
43
43
 
44
44
  export {
@@ -4,7 +4,7 @@ import {
4
4
  apiToken,
5
5
  configPath,
6
6
  currentUniverse
7
- } from "./chunk-IPQQGK5R.js";
7
+ } from "./chunk-NAZDAGN3.js";
8
8
 
9
9
  // src/api.ts
10
10
  import { createWriteStream, writeFileSync } from "fs";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  uploadFile,
16
16
  uploadLargeFile,
17
17
  writeResponseFile
18
- } from "./chunk-X7F2NGND.js";
18
+ } from "./chunk-TEHISHVI.js";
19
19
  import {
20
20
  CLI_VERSION,
21
21
  USER_AGENT,
@@ -26,7 +26,7 @@ import {
26
26
  currentUniverse,
27
27
  loadConfig,
28
28
  saveConfig
29
- } from "./chunk-IPQQGK5R.js";
29
+ } from "./chunk-NAZDAGN3.js";
30
30
  import {
31
31
  AGENT_TYPES,
32
32
  MODEL_SUBSCRIPTION_PLAN_PHRASE,
@@ -3598,7 +3598,8 @@ it, and name its path in the brief.
3598
3598
  3. Put the pieces together.
3599
3599
  4. If the person should be able to open or share the result, \`publish_artifact\`
3600
3600
  the files; \`share_artifact\` only when they asked for a link. To change a
3601
- published file, \`save_artifact_file\` against the \`base_version\` you read.
3601
+ published file, \`save_artifact_file\` against the \`base_version\` you read;
3602
+ \`update_artifact\` renames one and \`copy_artifact\` copies one version of it.
3602
3603
  \`export_artifact\` hands a result over in any format its \`export_formats\`
3603
3604
  lists, and \`import_artifact\` brings in a file or a public page as a result.
3604
3605
  5. \`stop_session\` every agent you no longer need.
@@ -7115,6 +7116,17 @@ async function convertArtifactToPage(id2, input) {
7115
7116
  async function shareArtifact(id2, enabled) {
7116
7117
  return (await api("POST", `/artifacts/${encodeURIComponent(id2)}/share`, { enabled })).share_url;
7117
7118
  }
7119
+ async function renameArtifact(id2, name) {
7120
+ return (await api("PATCH", `/artifacts/${encodeURIComponent(id2)}`, { name })).artifact;
7121
+ }
7122
+ async function copyArtifact(id2, input) {
7123
+ return (await api("POST", `/artifacts/${encodeURIComponent(id2)}/copy`, {
7124
+ ...input.name ? { name: input.name } : {},
7125
+ ...input.version ? { version: input.version } : {},
7126
+ ...input.taskId ? { task_id: input.taskId } : {},
7127
+ request_id: input.requestId ?? crypto.randomUUID()
7128
+ })).artifact;
7129
+ }
7118
7130
  async function deleteArtifact(id2) {
7119
7131
  await api("DELETE", `/artifacts/${encodeURIComponent(id2)}`);
7120
7132
  }
@@ -10781,6 +10793,12 @@ artifact.command("save <id> <path>").description("save one file as the artifact'
10781
10793
  })));
10782
10794
  })
10783
10795
  );
10796
+ artifact.command("update <id>").description("rename an artifact; its links, versions and files stay").requiredOption("--name <name>", "the new name").action(run(async (id2, opts) => {
10797
+ console.log(renderArtifact(await renameArtifact(id2, opts.name)));
10798
+ }));
10799
+ artifact.command("copy <id>").description("copy one version into a new artifact with its own files and no public link").option("--name <name>", "the copy's name").option("--artifact-version <version>", "the version to copy; the current one by default").option("--task <task>", "the task the copy lands in, in any workspace you can act in; the source's own by default").option("--request-id <id>", "send the same value when retrying").action(run(async (id2, opts) => {
10800
+ console.log(renderArtifact(await copyArtifact(id2, { name: opts.name, version: opts.artifactVersion ? Number(opts.artifactVersion) : void 0, taskId: opts.task, requestId: opts.requestId })));
10801
+ }));
10784
10802
  artifact.command("import [file]").description("bring in a file or, with --url, a public web page as a new artifact; its original is version 1's file").option("--url <url>", "a public https page to snapshot").option("--name <name>", "the artifact's name (default: the file's name or the page's title)").option("--task <task>", "the task whose folder holds it (default: your own imports folder)").option("--request-id <id>", "send the same value when retrying").action(
10785
10803
  run(async (file, opts) => {
10786
10804
  if (Boolean(file) === Boolean(opts.url)) throw new Error("name a file or --url");
@@ -12198,7 +12216,7 @@ harness.command("connect").description("run an ACP agent (the command after --)
12198
12216
  }));
12199
12217
  var traceCmd = program.command("trace").description("correlate this machine's agent work with the cloud sessions it starts (metadata only unless you choose content)");
12200
12218
  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) => {
12201
- const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-ZEGIAQYW.js");
12219
+ const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-RWZOZ27K.js");
12202
12220
  if (readState()) throw new Error("a trace is already running here \u2014 `sky trace stop` it first");
12203
12221
  const scopes = parseContentScopes(opts.capture);
12204
12222
  const chosen = chosenPaths(opts.file ?? [], opts.dir ?? []);
@@ -12233,7 +12251,7 @@ traceCmd.command("start").description("start a trace: a grant for this machine,
12233
12251
  }));
12234
12252
  traceCmd.command("hook").description("record one Claude Code hook event read from stdin (run by the installed hooks; never fails, prints nothing)").action(async () => {
12235
12253
  try {
12236
- const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-ZEGIAQYW.js");
12254
+ const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-RWZOZ27K.js");
12237
12255
  const chunks = [];
12238
12256
  for await (const chunk of process.stdin) chunks.push(chunk);
12239
12257
  const input = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
@@ -12246,14 +12264,14 @@ traceCmd.command("hook").description("record one Claude Code hook event read fro
12246
12264
  }
12247
12265
  });
12248
12266
  traceCmd.command("flush").description("send what the spool holds, retrying with backoff").action(run(async () => {
12249
- const { readState, flush, grantSender } = await import("./trace-ZEGIAQYW.js");
12267
+ const { readState, flush, grantSender } = await import("./trace-RWZOZ27K.js");
12250
12268
  const state = readState();
12251
12269
  if (!state) throw new Error("no trace is running here");
12252
12270
  const outcome = await flush(grantSender(state), { attempts: 4 });
12253
12271
  console.log(`sent ${outcome.sent}, refused ${outcome.refused}, given up ${outcome.expired}, still pending ${outcome.pending}${outcome.stopped ? ` (stopped: ${outcome.stopped})` : ""}`);
12254
12272
  }));
12255
12273
  traceCmd.command("status").description("the running trace and its spool").action(run(async () => {
12256
- const { readState, spoolStatus } = await import("./trace-ZEGIAQYW.js");
12274
+ const { readState, spoolStatus } = await import("./trace-RWZOZ27K.js");
12257
12275
  const state = readState();
12258
12276
  if (!state) {
12259
12277
  console.log("No trace is running here.");
@@ -12263,7 +12281,7 @@ traceCmd.command("status").description("the running trace and its spool").action
12263
12281
  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`);
12264
12282
  }));
12265
12283
  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 (id2, opts) => {
12266
- const { readState } = await import("./trace-ZEGIAQYW.js");
12284
+ const { readState } = await import("./trace-RWZOZ27K.js");
12267
12285
  const ref = id2 ?? readState()?.trace_id;
12268
12286
  if (!ref) throw new Error("name a trace, or start one here");
12269
12287
  const bundle = await api("GET", `/traces/${ref}`);
@@ -12290,7 +12308,7 @@ traceCmd.command("show [id]").description("the trace bundle: spans, the sessions
12290
12308
  for (const gap of bundle.gaps) console.log(` gap: ${gap.span_id} ${gap.reason}`);
12291
12309
  }));
12292
12310
  traceCmd.command("stop").description("end the root span, send what is left, and revoke this machine's grant").action(run(async () => {
12293
- const { readState, record, flush, grantSender, clearState } = await import("./trace-ZEGIAQYW.js");
12311
+ const { readState, record, flush, grantSender, clearState } = await import("./trace-RWZOZ27K.js");
12294
12312
  const state = readState();
12295
12313
  if (!state) throw new Error("no trace is running here");
12296
12314
  if (state.root_span) record(() => [{ span_id: state.root_span, kind: "end", outcome: "completed" }]);
@@ -12300,7 +12318,7 @@ traceCmd.command("stop").description("end the root span, send what is left, and
12300
12318
  console.log(`Stopped ${state.trace_id}${outcome.pending ? ` (${outcome.pending} events could not be sent)` : ""}`);
12301
12319
  }));
12302
12320
  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) => {
12303
- const lib = await import("./trace-library-2PRHDUAK.js");
12321
+ const lib = await import("./trace-library-O3XHVVJ5.js");
12304
12322
  if (opts.hook) {
12305
12323
  try {
12306
12324
  let raw = payload ?? "";
@@ -12416,7 +12434,7 @@ traceCmd.command("search <query...>").description("search every session in a wor
12416
12434
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
12417
12435
  }));
12418
12436
  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) => {
12419
- const { libraryRequest } = await import("./trace-library-2PRHDUAK.js");
12437
+ const { libraryRequest } = await import("./trace-library-O3XHVVJ5.js");
12420
12438
  const workspace2 = opts.workspace ?? currentUniverse();
12421
12439
  if (!workspace2) throw new Error("name a workspace with --workspace");
12422
12440
  const page = await libraryRequest("GET", `/trace-library?limit=${opts.limit}`, workspace2);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USER_AGENT,
3
3
  configPath
4
- } from "./chunk-IPQQGK5R.js";
4
+ } from "./chunk-NAZDAGN3.js";
5
5
  import {
6
6
  TRACE_CONTENT_SCOPES,
7
7
  redactTraceText
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ApiError,
3
3
  uploadLargeFile
4
- } from "./chunk-X7F2NGND.js";
4
+ } from "./chunk-TEHISHVI.js";
5
5
  import {
6
6
  USER_AGENT,
7
7
  apiBase,
8
8
  apiToken
9
- } from "./chunk-IPQQGK5R.js";
9
+ } from "./chunk-NAZDAGN3.js";
10
10
  import {
11
11
  SessionSourceCollector,
12
12
  UnsafeImportError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/sky",
3
- "version": "3.31.0",
3
+ "version": "3.32.0",
4
4
  "description": "sky \u2014 the AgentSky developer CLI: launch and talk to long-lived agents from your terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",