@agentsky/sky 2.25.0 → 2.26.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.
@@ -3,7 +3,7 @@ import {
3
3
  apiBase,
4
4
  apiToken,
5
5
  currentUniverse
6
- } from "./chunk-LPUGEMCV.js";
6
+ } from "./chunk-UZ7KWRQH.js";
7
7
 
8
8
  // src/api.ts
9
9
  import { createWriteStream, writeFileSync } from "fs";
@@ -148,7 +148,7 @@ async function resolveSessionRef(ref) {
148
148
  return agent.defaultSessionId;
149
149
  }
150
150
  async function* streamEvents(sessionId, signal) {
151
- const { parseSseStream } = await import("./src-BMXKAMOB.js");
151
+ const { parseSseStream } = await import("./src-OBSBFTDB.js");
152
152
  const res = await fetch(
153
153
  `${apiBase()}/sessions/${encodeURIComponent(sessionId)}/stream`,
154
154
  {
@@ -38,7 +38,7 @@ function currentUniverse() {
38
38
  }
39
39
 
40
40
  // src/version.ts
41
- var CLI_VERSION = "2.25.0";
41
+ var CLI_VERSION = "2.26.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
@@ -11,7 +11,7 @@ import {
11
11
  streamEvents,
12
12
  uploadFile,
13
13
  writeResponseFile
14
- } from "./chunk-QROAAJN2.js";
14
+ } from "./chunk-K3LB4K2C.js";
15
15
  import {
16
16
  CLI_VERSION,
17
17
  USER_AGENT,
@@ -22,7 +22,7 @@ import {
22
22
  currentUniverse,
23
23
  loadConfig,
24
24
  saveConfig
25
- } from "./chunk-LPUGEMCV.js";
25
+ } from "./chunk-UZ7KWRQH.js";
26
26
  import {
27
27
  AGENT_TYPES,
28
28
  MODEL_SUBSCRIPTION_PLAN_PHRASE,
@@ -44,7 +44,7 @@ import {
44
44
  skillRefSchema,
45
45
  splitMcpServers,
46
46
  supersededBy
47
- } from "./chunk-D3WG4BMK.js";
47
+ } from "./chunk-CJBZVPDF.js";
48
48
  import "./chunk-MLKGABMK.js";
49
49
 
50
50
  // src/index.ts
@@ -2651,6 +2651,13 @@ current revision, supported access and real available members. The reference
2651
2651
  can name a Drive file (including an uploaded meeting note), task file, memory
2652
2652
  note, skill file, agent user instructions (\`{kind:"agent_prompt",agentId}\`), saved artifact or platform artifact. Only the user-authored AGENTS.md is shared; system instructions and credentials are never included. \`workspace\` names the
2653
2653
  audience workspace, never a storage move or the connection's default.
2654
+ For a DesignSystem file, use \`platform_artifact\` with the exact full native
2655
+ manifest \`path\`: its actual \`root\` plus an \`editable_files\` path, or the
2656
+ native document reader's \`libraryRef\`. Do not guess a folder prefix or use
2657
+ an editor's relative transport path. Omitting \`path\` shares the entire
2658
+ artifact entry. A token reads only its original file; it cannot select a
2659
+ sibling with a query parameter. Editable DesignSystem files save through
2660
+ that system's versioned writer, including derived files and republishing.
2654
2661
  \`share_library_file\` changes only the requested workspace/member grants;
2655
2662
  \`publish_library_file\` enables or disables a public view-only link while
2656
2663
  preserving other grants. Both read first and merge against the current
@@ -5567,6 +5574,13 @@ async function saveDesignTokens(id, baseVersion, tokens, note) {
5567
5574
  ...note ? { note } : {}
5568
5575
  })).artifact;
5569
5576
  }
5577
+ async function saveDesignSystemFile(id, path, baseVersion, change, note) {
5578
+ return (await api("PUT", `/artifacts/${encodeURIComponent(id)}/design-system/files/${path.split("/").map(encodeURIComponent).join("/")}`, {
5579
+ base_version: baseVersion,
5580
+ ...change,
5581
+ ...note ? { note } : {}
5582
+ })).artifact;
5583
+ }
5570
5584
  function fileTableFrom(dir) {
5571
5585
  const files2 = {};
5572
5586
  const walk = (current) => {
@@ -7080,9 +7094,10 @@ plugins.command("list").description("the workspace's installed plugins and the s
7080
7094
  for (const p of list) console.log(`${p.name} ${p.skills.length} skill${p.skills.length === 1 ? "" : "s"}: ${p.skills.map((s) => s.displayName.split("/").pop()).join(", ")}`);
7081
7095
  })
7082
7096
  );
7083
- plugins.command("install <source>").description("install or update a plugin: github:owner/repo[/path][@ref] or a github.com URL").option("--json", "print the result as JSON").action(
7097
+ plugins.command("install <source>").description("install or update a plugin: github:owner/repo[/path][@ref] or a github.com URL").option("--mcp-token <server=token...>", "a bearer token for one of the plugin's remote MCP servers (repeatable)").option("--json", "print the result as JSON").action(
7084
7098
  run(async (source, opts) => {
7085
- const result = await api("POST", "/plugins", { source });
7099
+ const mcp_tokens = Object.fromEntries((opts.mcpToken ?? []).map((pair) => [pair.slice(0, pair.indexOf("=")), pair.slice(pair.indexOf("=") + 1)]).filter(([k, v]) => k && v));
7100
+ const result = await api("POST", "/plugins", { source, ...Object.keys(mcp_tokens).length ? { mcp_tokens } : {} });
7086
7101
  if (opts.json) return void console.log(JSON.stringify(result));
7087
7102
  console.log(`Installed ${result.plugin.name}${result.plugin.version ? ` ${result.plugin.version}` : ""} from ${result.plugin.source}: ${result.skills.length} skill(s), on for every new session.`);
7088
7103
  for (const c of result.connectors) {
@@ -7099,6 +7114,51 @@ plugins.command("rm <name>").description("remove a plugin's skills (a skill a se
7099
7114
  console.log(`Removed ${result.name}: ${result.parts.map((p) => `${p.part} ${p.result.replace("_", " ")}`).join(", ")}`);
7100
7115
  })
7101
7116
  );
7117
+ for (const [verb, enabled] of [["enable", true], ["disable", false]]) {
7118
+ plugins.command(`${verb} <name>`).description(enabled ? "switch a plugin back on: its skills attach to new sessions again" : "switch a plugin off: its skills stop attaching to new sessions and plugin sessions refuse to start").action(
7119
+ run(async (name) => {
7120
+ await api("PATCH", `/plugins/${encodeURIComponent(name)}`, { enabled });
7121
+ console.log(`${name} is ${enabled ? "on" : "off"}.`);
7122
+ })
7123
+ );
7124
+ }
7125
+ plugins.command("run <name> <message>").description("start a plugin session: only that plugin's skills and MCP servers, and connected apps limited to the ones it declared").option("--agent <id>", "the agent to run (default: the workspace's Sky)").option("--json", "print the created session as JSON").action(
7126
+ run(async (name, message2, opts) => {
7127
+ const session2 = await api("POST", `/plugins/${encodeURIComponent(name)}/sessions`, { message: message2, ...opts.agent ? { agent: opts.agent } : {} });
7128
+ if (opts.json) return void console.log(JSON.stringify(session2));
7129
+ console.log(`Started ${session2.id} for ${name}. Follow it: sky session read ${session2.id} --wait`);
7130
+ })
7131
+ );
7132
+ plugins.command("policy <name> <policy>").description("workspace owners and admins: recommended | default | blocked | none (default installs it now)").option("--source <source>", "where a default plugin installs from (github:owner/repo[/path][@ref])").action(
7133
+ run(async (name, policy2, opts) => {
7134
+ const value = policy2 === "none" ? null : policy2;
7135
+ const result = await api("PUT", `/plugins/${encodeURIComponent(name)}/policy`, { policy: value, ...opts.source ? { source: opts.source } : {} });
7136
+ console.log(`${result.name}: ${result.policy ?? "no policy"}${result.installed ? " (installed)" : ""}`);
7137
+ })
7138
+ );
7139
+ var market = plugins.command("market").description("Claude Code marketplaces the workspace lists plugins from");
7140
+ market.command("list").description("every plugin the workspace's marketplaces list, with its install source, policy and whether it is installed").option("--json", "print the marketplaces as JSON").action(
7141
+ run(async (opts) => {
7142
+ const { marketplaces } = await api("GET", "/plugins/marketplaces");
7143
+ if (opts.json) return void console.log(JSON.stringify(marketplaces));
7144
+ for (const m of marketplaces) {
7145
+ console.log(`${m.name} (${m.source})${m.error ? `: ${m.error}` : ""}`);
7146
+ for (const p of m.plugins) console.log(` ${p.installed ? "\u25CF" : "\u25CB"} ${p.name}${p.policy ? ` [${p.policy}]` : ""} ${p.source ?? "(not on GitHub)"} ${p.description.slice(0, 80)}`);
7147
+ }
7148
+ })
7149
+ );
7150
+ market.command("add <source>").description("workspace owners and admins: list plugins from a folder holding .claude-plugin/marketplace.json").action(
7151
+ run(async (source) => {
7152
+ const m = await api("POST", "/plugins/marketplaces", { source });
7153
+ console.log(`Added ${m.name} (${m.source}): ${m.plugins.length} plugins.`);
7154
+ })
7155
+ );
7156
+ market.command("rm <source>").description("workspace owners and admins: stop listing a marketplace (installed plugins stay)").action(
7157
+ run(async (source) => {
7158
+ await api("DELETE", `/plugins/marketplaces?source=${encodeURIComponent(source)}`);
7159
+ console.log(`Removed ${source}.`);
7160
+ })
7161
+ );
7102
7162
  var skills = program.command("skills").description("the workspace's skill store: upload a skill, then attach it to an agent (sky skills attach, or [[skills]] in agent.toml)");
7103
7163
  skills.command("upload <dir>").description("upload a skill directory (SKILL.md at its root) as a new skill").option("--name <name>", "display name (default: the directory's name)").option("--json", "print the stored skill as JSON").action(
7104
7164
  run(async (dir, opts) => {
@@ -7285,6 +7345,13 @@ designSystem.command("tokens <id> <file>").description("save a tokens.json file
7285
7345
  console.log(renderArtifact(await saveDesignTokens(id, opts.base, tokens, opts.note)));
7286
7346
  })
7287
7347
  );
7348
+ designSystem.command("write <id> <path> [file]").description("save one of the system's editable files (path such as project/README.md) from a local file as its next version, or put back an earlier version's copy with --restore").requiredOption("--base <version>", "the version the file was edited from", (value) => Number(value)).option("--restore <version>", "restore the file as it was in this version instead of reading [file]", (value) => Number(value)).option("--note <note>", "one line saying what changed").action(
7349
+ run(async (id, path, file, opts) => {
7350
+ if (file === void 0 === (opts.restore === void 0)) throw Error("Give a local [file] to save, or --restore <version>.");
7351
+ const change = opts.restore === void 0 ? { content: readFileSync20(resolve9(file), "utf8") } : { restore_version: opts.restore };
7352
+ console.log(renderArtifact(await saveDesignSystemFile(id, path, opts.base, change, opts.note)));
7353
+ })
7354
+ );
7288
7355
  designSystem.command("comments <id>").description("read design-system comments, or add one with --text and --base").option("--text <text>", "comment to add").option("--target <target>", "overview, color:<name> or component:<name>", "overview").option("--base <version>", "the version you viewed", Number).action(run(async (id, opts) => {
7289
7356
  if (opts.text !== void 0 && (!Number.isInteger(opts.base) || opts.base < 1)) throw Error("Adding a comment requires --base <version>.");
7290
7357
  console.log(JSON.stringify(await designComments(id, opts.text === void 0 ? void 0 : { text: opts.text, target: opts.target, base_version: opts.base }), null, 2));
@@ -7673,7 +7740,7 @@ memory.command("edit <index> <text...>").description("replace entry <index>").ac
7673
7740
  memory.command("rm <index>").description("remove entry <index>").action(run(async (index) => writeMemory({ op: "remove", index: memoryIndex(index) })));
7674
7741
  memory.command("clear").description("remove every entry").action(run(async () => writeMemory({ op: "clear" })));
7675
7742
  var context = program.command("context").description("search everything you can open in the workspace, and read a hit");
7676
- context.command("search <words...>").description('plain words, "exact phrase" or /regex/ (every matching line, like grep); follow --cursor for more').option("--scope <folder>", "memory/, chats, traces, outputs/, files/, meetings/, skills/<name>/, agents/ or docs/ (default everything)").option("--limit <n>", "hits per page (default 20)").option("--cursor <cursor>", "continue a previous search").option("--since <iso>", "inclusive lower time bound").option("--until <iso>", "exclusive upper time bound").option("--json", "print the API's answer as JSON").action(
7743
+ context.command("search <words...>").description('plain words, "exact phrase" or /regex/ (every matching line, like grep); follow --cursor for more').option("--scope <folder>", "memory/, chats, traces, artifacts/, files/, meetings/, skills/<name>/, agents/ or docs/ (default everything)").option("--limit <n>", "hits per page (default 20)").option("--cursor <cursor>", "continue a previous search").option("--since <iso>", "inclusive lower time bound").option("--until <iso>", "exclusive upper time bound").option("--json", "print the API's answer as JSON").action(
7677
7744
  run(async (words, opts) => {
7678
7745
  const page = await searchContext(words.join(" "), opts);
7679
7746
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
@@ -8306,7 +8373,7 @@ harness.command("connect").description("run an ACP agent (the command after --)
8306
8373
  }));
8307
8374
  var traceCmd = program.command("trace").description("correlate this machine's agent work with the cloud sessions it starts (metadata only unless you choose content)");
8308
8375
  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) => {
8309
- const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-HV4E2BPX.js");
8376
+ const { readState, writeState, record, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-OPRHOP2E.js");
8310
8377
  if (readState()) throw new Error("a trace is already running here \u2014 `sky trace stop` it first");
8311
8378
  const scopes = parseContentScopes(opts.capture);
8312
8379
  const chosen = chosenPaths(opts.file ?? [], opts.dir ?? []);
@@ -8341,7 +8408,7 @@ traceCmd.command("start").description("start a trace: a grant for this machine,
8341
8408
  }));
8342
8409
  traceCmd.command("hook").description("record one Claude Code hook event read from stdin (run by the installed hooks; never fails, prints nothing)").action(async () => {
8343
8410
  try {
8344
- const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-HV4E2BPX.js");
8411
+ const { readState, record, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-OPRHOP2E.js");
8345
8412
  const chunks = [];
8346
8413
  for await (const chunk of process.stdin) chunks.push(chunk);
8347
8414
  const input = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
@@ -8354,14 +8421,14 @@ traceCmd.command("hook").description("record one Claude Code hook event read fro
8354
8421
  }
8355
8422
  });
8356
8423
  traceCmd.command("flush").description("send what the spool holds, retrying with backoff").action(run(async () => {
8357
- const { readState, flush, grantSender } = await import("./trace-HV4E2BPX.js");
8424
+ const { readState, flush, grantSender } = await import("./trace-OPRHOP2E.js");
8358
8425
  const state = readState();
8359
8426
  if (!state) throw new Error("no trace is running here");
8360
8427
  const outcome = await flush(grantSender(state), { attempts: 4 });
8361
8428
  console.log(`sent ${outcome.sent}, refused ${outcome.refused}, given up ${outcome.expired}, still pending ${outcome.pending}${outcome.stopped ? ` (stopped: ${outcome.stopped})` : ""}`);
8362
8429
  }));
8363
8430
  traceCmd.command("status").description("the running trace and its spool").action(run(async () => {
8364
- const { readState, spoolStatus } = await import("./trace-HV4E2BPX.js");
8431
+ const { readState, spoolStatus } = await import("./trace-OPRHOP2E.js");
8365
8432
  const state = readState();
8366
8433
  if (!state) {
8367
8434
  console.log("No trace is running here.");
@@ -8371,7 +8438,7 @@ traceCmd.command("status").description("the running trace and its spool").action
8371
8438
  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`);
8372
8439
  }));
8373
8440
  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 (id, opts) => {
8374
- const { readState } = await import("./trace-HV4E2BPX.js");
8441
+ const { readState } = await import("./trace-OPRHOP2E.js");
8375
8442
  const ref = id ?? readState()?.trace_id;
8376
8443
  if (!ref) throw new Error("name a trace, or start one here");
8377
8444
  const bundle = await api("GET", `/traces/${ref}`);
@@ -8398,7 +8465,7 @@ traceCmd.command("show [id]").description("the trace bundle: spans, the sessions
8398
8465
  for (const gap of bundle.gaps) console.log(` gap: ${gap.span_id} ${gap.reason}`);
8399
8466
  }));
8400
8467
  traceCmd.command("stop").description("end the root span, send what is left, and revoke this machine's grant").action(run(async () => {
8401
- const { readState, record, flush, grantSender, clearState } = await import("./trace-HV4E2BPX.js");
8468
+ const { readState, record, flush, grantSender, clearState } = await import("./trace-OPRHOP2E.js");
8402
8469
  const state = readState();
8403
8470
  if (!state) throw new Error("no trace is running here");
8404
8471
  if (state.root_span) record(() => [{ span_id: state.root_span, kind: "end", outcome: "completed" }]);
@@ -8408,7 +8475,7 @@ traceCmd.command("stop").description("end the root span, send what is left, and
8408
8475
  console.log(`Stopped ${state.trace_id}${outcome.pending ? ` (${outcome.pending} events could not be sent)` : ""}`);
8409
8476
  }));
8410
8477
  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) => {
8411
- const lib = await import("./trace-library-HJWI7KM7.js");
8478
+ const lib = await import("./trace-library-SB7QYAU5.js");
8412
8479
  if (opts.hook) {
8413
8480
  try {
8414
8481
  let raw = payload ?? "";
@@ -8523,7 +8590,7 @@ traceCmd.command("search <query...>").description("search every session in a wor
8523
8590
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
8524
8591
  }));
8525
8592
  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) => {
8526
- const { libraryRequest } = await import("./trace-library-HJWI7KM7.js");
8593
+ const { libraryRequest } = await import("./trace-library-SB7QYAU5.js");
8527
8594
  const workspace2 = opts.workspace ?? currentUniverse();
8528
8595
  if (!workspace2) throw new Error("name a workspace with --workspace");
8529
8596
  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-D3WG4BMK.js";
5
+ } from "./chunk-CJBZVPDF.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-LPUGEMCV.js";
4
+ } from "./chunk-UZ7KWRQH.js";
5
5
  import {
6
6
  TRACE_CONTENT_SCOPES,
7
7
  redactTraceText
8
- } from "./chunk-D3WG4BMK.js";
8
+ } from "./chunk-CJBZVPDF.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
 
11
11
  // src/trace.ts
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  ApiError
3
- } from "./chunk-QROAAJN2.js";
3
+ } from "./chunk-K3LB4K2C.js";
4
4
  import {
5
5
  USER_AGENT,
6
6
  apiBase,
7
7
  apiToken
8
- } from "./chunk-LPUGEMCV.js";
8
+ } from "./chunk-UZ7KWRQH.js";
9
9
  import {
10
10
  SessionSourceCollector,
11
11
  publicRemote,
12
12
  redactTraceText
13
- } from "./chunk-D3WG4BMK.js";
13
+ } from "./chunk-CJBZVPDF.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // src/trace-library.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/sky",
3
- "version": "2.25.0",
3
+ "version": "2.26.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",
File without changes