@agentsky/sky 3.34.0 → 3.35.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.
@@ -4,7 +4,7 @@ import {
4
4
  apiToken,
5
5
  configPath,
6
6
  currentUniverse
7
- } from "./chunk-EG7PA52K.js";
7
+ } from "./chunk-YMDQ7YUQ.js";
8
8
 
9
9
  // src/api.ts
10
10
  import { createWriteStream, writeFileSync } from "fs";
@@ -151,7 +151,7 @@ async function resolveSessionRef(ref) {
151
151
  return agent.defaultSessionId;
152
152
  }
153
153
  async function* streamEvents(sessionId, signal) {
154
- const { parseSseStream } = await import("./src-JTHBN3IV.js");
154
+ const { parseSseStream } = await import("./src-G35C34F3.js");
155
155
  const res = await fetch(
156
156
  `${apiBase()}/sessions/${encodeURIComponent(sessionId)}/stream`,
157
157
  {
@@ -38,7 +38,7 @@ function currentUniverse() {
38
38
  }
39
39
 
40
40
  // src/version.ts
41
- var CLI_VERSION = "3.34.0";
41
+ var CLI_VERSION = "3.35.0";
42
42
  var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
43
43
 
44
44
  export {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  uploadFile,
16
16
  uploadLargeFile,
17
17
  writeResponseFile
18
- } from "./chunk-6IVMEGJO.js";
18
+ } from "./chunk-K2JUOHAG.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-EG7PA52K.js";
29
+ } from "./chunk-YMDQ7YUQ.js";
30
30
  import {
31
31
  AGENT_TYPES,
32
32
  MODEL_SUBSCRIPTION_PLAN_PHRASE,
@@ -48,7 +48,7 @@ import {
48
48
  skillRefSchema,
49
49
  splitMcpServers,
50
50
  supersededBy
51
- } from "./chunk-VFN3NGC6.js";
51
+ } from "./chunk-MFAJNKUH.js";
52
52
  import "./chunk-MLKGABMK.js";
53
53
 
54
54
  // src/artifact-lifecycle.ts
@@ -86,6 +86,11 @@ function listAdoptedArtifacts(options) {
86
86
  for (const [key, value] of Object.entries(selected)) if (value !== void 0) query.set(key, String(value));
87
87
  return api("GET", `/artifacts?${query}`);
88
88
  }
89
+ function pageBackendOperation(operation, artifact2, cents) {
90
+ const path2 = `/artifacts/${seg(artifact2)}/page-backend`;
91
+ if (operation === "get") return api("GET", path2);
92
+ return api("PATCH", path2, operation === "confirm" ? { confirm_spends_owner_credits: true } : { spend_limit_cents: external_exports.coerce.number().int().min(0).max(1e6).parse(cents) });
93
+ }
89
94
  function registerArtifactLifecycleCommands(artifact2) {
90
95
  artifact2.command("list-adopted").description("list canonical owner files; execution origin selects private generated meeting notes with read-only bodies").option("--origin <origin>", "consumer_adopted (default) or execution; execution notes are private and generated-body read-only").option("--limit <number>", "page size, 1 to 50").option("--cursor <cursor>", "exact prior opaque cursor").option("--q <text>", "name search, at most 120 characters").option("--visibility <visibility>", "all, only_me or public").option("--scope <scope>", "all, mine or workspace:<64-hex workspace key>").option("--folder <folder>", "artifacts or meetings").option("--kind <kind>", "design_system").action(async (options) => output(await listAdoptedArtifacts(options)));
91
96
  artifact2.command("inspect <id>").description("read task, adopted owner or private execution identity/history; execution task_id=null, run_id, can_edit=false, separate can_discuss").action(async (target2) => output(await api("GET", `/artifacts/${seg(target2)}`)));
@@ -7113,8 +7118,8 @@ async function exportArtifact(id2, options = {}) {
7113
7118
  async function convertArtifactToPage(id2, input) {
7114
7119
  return api("POST", `/artifacts/${encodeURIComponent(id2)}/conversions`, { to: "page", base_version: input.baseVersion, ...input.requestId ? { request_id: input.requestId } : {} });
7115
7120
  }
7116
- async function shareArtifact(id2, enabled) {
7117
- return (await api("POST", `/artifacts/${encodeURIComponent(id2)}/share`, { enabled })).share_url;
7121
+ async function shareArtifact(id2, enabled, confirmSpendsOwnerCredits) {
7122
+ return (await api("POST", `/artifacts/${encodeURIComponent(id2)}/share`, { enabled, ...confirmSpendsOwnerCredits ? { confirm_spends_owner_credits: true } : {} })).share_url;
7118
7123
  }
7119
7124
  async function renameArtifact(id2, name) {
7120
7125
  return (await api("PATCH", `/artifacts/${encodeURIComponent(id2)}`, { name })).artifact;
@@ -10829,12 +10834,22 @@ artifact.command("convert <id>").description("make a Markdown, Word or PDF artif
10829
10834
  if (loss) console.log(loss);
10830
10835
  })
10831
10836
  );
10832
- artifact.command("share <id>").description("turn on a public link anyone can open; --off turns it off (the old link stops working)").option("--off", "stop sharing").action(
10837
+ artifact.command("share <id>").description("turn on a public link anyone can open; --off turns it off (the old link stops working)").option("--off", "stop sharing").option("--confirm-spends-owner-credits", "for a page whose agentsky.json names agents or APIs: agree that anyone who opens the link uses your credits").action(
10833
10838
  run(async (id2, opts) => {
10834
- const url = await shareArtifact(id2, !opts.off);
10839
+ const url = await shareArtifact(id2, !opts.off, opts.confirmSpendsOwnerCredits);
10835
10840
  console.log(url ?? `Stopped sharing ${id2}`);
10836
10841
  })
10837
10842
  );
10843
+ var artifactPage = artifact.command("page").description("what a published page with an agentsky.json can spend");
10844
+ artifactPage.command("get <id>").description("whether its link spends your credits, what a message can cost, its limit and what it has spent").action(run(async (id2) => {
10845
+ console.log(JSON.stringify(await pageBackendOperation("get", id2), null, 2));
10846
+ }));
10847
+ artifactPage.command("limit <id> <cents>").description("set the most the page may spend, in US cents").action(run(async (id2, cents) => {
10848
+ console.log(JSON.stringify(await pageBackendOperation("limit", id2, cents), null, 2));
10849
+ }));
10850
+ artifactPage.command("confirm <id>").description("agree that anyone who opens this page's link uses your credits").action(run(async (id2) => {
10851
+ console.log(JSON.stringify(await pageBackendOperation("confirm", id2), null, 2));
10852
+ }));
10838
10853
  artifact.command("comments <id>").description("read private discussion, add feedback, or resolve/reopen a root thread").option("--text <text>", "comment text").option("--base <version>", "the artifact version you read").option("--reply <id>", "reply to this comment in the same artifact and version").option("--resolve <id>", "resolve this root thread; requires --base and --state-version").option("--reopen <id>", "reopen this root thread; requires --base and --state-version").option("--state-version <version>", "the root's resolution.version, or 0 when absent").action(run(async (id2, opts) => {
10839
10854
  console.log(JSON.stringify(await artifactCommentsOperation(id2, opts), null, 2));
10840
10855
  }));
@@ -12226,7 +12241,7 @@ harness.command("connect").description("run an ACP agent (the command after --)
12226
12241
  }));
12227
12242
  var traceCmd = program.command("trace").description("correlate this machine's agent work with the cloud sessions it starts (metadata only unless you choose content)");
12228
12243
  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) => {
12229
- const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-LAMM6QJG.js");
12244
+ const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-HJXL5J7P.js");
12230
12245
  if (readState()) throw new Error("a trace is already running here \u2014 `sky trace stop` it first");
12231
12246
  const scopes = parseContentScopes(opts.capture);
12232
12247
  const chosen = chosenPaths(opts.file ?? [], opts.dir ?? []);
@@ -12261,7 +12276,7 @@ traceCmd.command("start").description("start a trace: a grant for this machine,
12261
12276
  }));
12262
12277
  traceCmd.command("hook").description("record one Claude Code hook event read from stdin (run by the installed hooks; never fails, prints nothing)").action(async () => {
12263
12278
  try {
12264
- const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-LAMM6QJG.js");
12279
+ const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-HJXL5J7P.js");
12265
12280
  const chunks = [];
12266
12281
  for await (const chunk of process.stdin) chunks.push(chunk);
12267
12282
  const input = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
@@ -12274,14 +12289,14 @@ traceCmd.command("hook").description("record one Claude Code hook event read fro
12274
12289
  }
12275
12290
  });
12276
12291
  traceCmd.command("flush").description("send what the spool holds, retrying with backoff").action(run(async () => {
12277
- const { readState, flush, grantSender } = await import("./trace-LAMM6QJG.js");
12292
+ const { readState, flush, grantSender } = await import("./trace-HJXL5J7P.js");
12278
12293
  const state = readState();
12279
12294
  if (!state) throw new Error("no trace is running here");
12280
12295
  const outcome = await flush(grantSender(state), { attempts: 4 });
12281
12296
  console.log(`sent ${outcome.sent}, refused ${outcome.refused}, given up ${outcome.expired}, still pending ${outcome.pending}${outcome.stopped ? ` (stopped: ${outcome.stopped})` : ""}`);
12282
12297
  }));
12283
12298
  traceCmd.command("status").description("the running trace and its spool").action(run(async () => {
12284
- const { readState, spoolStatus } = await import("./trace-LAMM6QJG.js");
12299
+ const { readState, spoolStatus } = await import("./trace-HJXL5J7P.js");
12285
12300
  const state = readState();
12286
12301
  if (!state) {
12287
12302
  console.log("No trace is running here.");
@@ -12291,7 +12306,7 @@ traceCmd.command("status").description("the running trace and its spool").action
12291
12306
  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`);
12292
12307
  }));
12293
12308
  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) => {
12294
- const { readState } = await import("./trace-LAMM6QJG.js");
12309
+ const { readState } = await import("./trace-HJXL5J7P.js");
12295
12310
  const ref = id2 ?? readState()?.trace_id;
12296
12311
  if (!ref) throw new Error("name a trace, or start one here");
12297
12312
  const bundle = await api("GET", `/traces/${ref}`);
@@ -12318,7 +12333,7 @@ traceCmd.command("show [id]").description("the trace bundle: spans, the sessions
12318
12333
  for (const gap of bundle.gaps) console.log(` gap: ${gap.span_id} ${gap.reason}`);
12319
12334
  }));
12320
12335
  traceCmd.command("stop").description("end the root span, send what is left, and revoke this machine's grant").action(run(async () => {
12321
- const { readState, record, flush, grantSender, clearState } = await import("./trace-LAMM6QJG.js");
12336
+ const { readState, record, flush, grantSender, clearState } = await import("./trace-HJXL5J7P.js");
12322
12337
  const state = readState();
12323
12338
  if (!state) throw new Error("no trace is running here");
12324
12339
  if (state.root_span) record(() => [{ span_id: state.root_span, kind: "end", outcome: "completed" }]);
@@ -12328,7 +12343,7 @@ traceCmd.command("stop").description("end the root span, send what is left, and
12328
12343
  console.log(`Stopped ${state.trace_id}${outcome.pending ? ` (${outcome.pending} events could not be sent)` : ""}`);
12329
12344
  }));
12330
12345
  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) => {
12331
- const lib = await import("./trace-library-AFHVFATX.js");
12346
+ const lib = await import("./trace-library-6TVUHNST.js");
12332
12347
  if (opts.hook) {
12333
12348
  try {
12334
12349
  let raw = payload ?? "";
@@ -12444,7 +12459,7 @@ traceCmd.command("search <query...>").description("search every session in a wor
12444
12459
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
12445
12460
  }));
12446
12461
  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) => {
12447
- const { libraryRequest } = await import("./trace-library-AFHVFATX.js");
12462
+ const { libraryRequest } = await import("./trace-library-6TVUHNST.js");
12448
12463
  const workspace2 = opts.workspace ?? currentUniverse();
12449
12464
  if (!workspace2) throw new Error("name a workspace with --workspace");
12450
12465
  const page = await libraryRequest("GET", `/trace-library?limit=${opts.limit}`, workspace2);
@@ -2,7 +2,7 @@ import {
2
2
  admittedInputScopeSchema,
3
3
  external_exports,
4
4
  messagePartSchema
5
- } from "./chunk-VFN3NGC6.js";
5
+ } from "./chunk-MFAJNKUH.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
 
8
8
  // ../../packages/chat/src/stream.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  USER_AGENT,
3
3
  configPath
4
- } from "./chunk-EG7PA52K.js";
4
+ } from "./chunk-YMDQ7YUQ.js";
5
5
  import {
6
6
  TRACE_CONTENT_SCOPES,
7
7
  redactTraceText
8
- } from "./chunk-VFN3NGC6.js";
8
+ } from "./chunk-MFAJNKUH.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
 
11
11
  // src/trace.ts
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ApiError,
3
3
  uploadLargeFile
4
- } from "./chunk-6IVMEGJO.js";
4
+ } from "./chunk-K2JUOHAG.js";
5
5
  import {
6
6
  USER_AGENT,
7
7
  apiBase,
8
8
  apiToken
9
- } from "./chunk-EG7PA52K.js";
9
+ } from "./chunk-YMDQ7YUQ.js";
10
10
  import {
11
11
  SessionSourceCollector,
12
12
  UnsafeImportError,
13
13
  publicRemote,
14
14
  redactLine,
15
15
  redactTraceText
16
- } from "./chunk-VFN3NGC6.js";
16
+ } from "./chunk-MFAJNKUH.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
 
19
19
  // src/trace-library.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/sky",
3
- "version": "3.34.0",
3
+ "version": "3.35.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",
@@ -19,7 +19,6 @@
19
19
  "dev": "tsx src/index.ts",
20
20
  "build": "tsup src/index.ts --format esm --target node20 --clean",
21
21
  "test": "vitest run",
22
- "sync:served-skill": "tsx scripts/sync-served-skill.ts",
23
22
  "typecheck": "tsc --noEmit"
24
23
  },
25
24
  "dependencies": {
File without changes