@agentsky/sky 3.44.0 → 3.45.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,5 +1,5 @@
1
1
  // src/version.ts
2
- var CLI_VERSION = "3.44.0";
2
+ var CLI_VERSION = "3.45.0";
3
3
  var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
4
4
 
5
5
  export {
@@ -21766,7 +21766,7 @@ var DECLARED = [
21766
21766
  core("browser-use", "write", "Web browser", "A browser your agents drive, with the logins you gave it.", { owns: ["session.browser.", "session.browser_handoff.", "browser_profile.", "session.runtime.driveBrowser", "session.runtime.handOffBrowser", "session.runtime.askBrowserTakeover", "session.runtime.finishBrowserTakeover"], exports: ["session.browser.read", "session.browser.stop", "session.browser.hand_back", "browser_profile.site.remove", "session.runtime.finishBrowserTakeover"] }),
21767
21767
  core("email", "write", "Send email", "Your agents send email from the workspace's address and read what they sent.", { owns: ["email.", "session.runtime.sendEmail"], exports: ["email.list"] }),
21768
21768
  core("signing", "write", "E-signature", "Your agents send documents for signature and track who has signed.", { owns: ["signing."], exports: ["signing.list", "signing.read", "signing.document"] }),
21769
- { id: TASK_COLLECTION_PLUGIN_ID, kind: "capability", tier: "write", contract: PREINSTALLED_CONTRACT, ships: "preinstalled", tools: ["list_reflection_proposals", "decide_reflection_proposal", "rollback_reflection_proposal"], exports: ["tool.list_reflection_proposals", "tool.rollback_reflection_proposal"], name: "Task collection", description: "Keeps a record of how your agents' work went. After a task that took corrections, it shows you the standards it learned from them and keeps the ones you agree to." },
21769
+ { id: TASK_COLLECTION_PLUGIN_ID, kind: "capability", tier: "write", contract: PREINSTALLED_CONTRACT, ships: "preinstalled", tools: ["list_reflection_proposals", "decide_reflection_proposal", "settle_skill_conflict", "rollback_reflection_proposal"], exports: ["tool.list_reflection_proposals", "tool.rollback_reflection_proposal"], name: "Task collection", description: "Keeps a record of how your agents' work went. After a task that took corrections, it shows you the standards it learned from them and keeps the ones you agree to." },
21770
21770
  { id: "mac:computer-use", kind: "device", tier: "device", contract: PREINSTALLED_CONTRACT, ships: "core", name: "Computer use", description: "Agents see and click on your Mac", devicePlugin: "computer-use" },
21771
21771
  view("story", "Story", "What happened in a chat, step by step, in the right panel.", ["task-story"], ["story"]),
21772
21772
  view("background-tasks", "Runs of this chat", "The helpers an agent started and where each one stands.", ["subagents"], ["background_tasks"]),
@@ -23837,9 +23837,13 @@ var connectionSupportSchema = external_exports.object({
23837
23837
 
23838
23838
  // ../../packages/spec/src/question.ts
23839
23839
  var QUESTION_REQUEST_KINDS = ["connect_app", "connect_account", "spend", "start", "browser_handoff", "reflection", "confirm", "plugin_off"];
23840
+ var MAX_QUESTION_CHANGES = 4;
23841
+ var QUESTION_CHANGE_CHARS = 12e3;
23840
23842
  var questionSchema = external_exports.object({
23841
23843
  requestId: external_exports.string().min(1),
23842
23844
  question: external_exports.string().trim().min(1),
23845
+ /** Why it is asked, in a sentence or two. Shown under the question, folded; the question itself stays one short line. */
23846
+ detail: external_exports.string().trim().min(1).max(1e3).optional(),
23843
23847
  options: external_exports.array(
23844
23848
  external_exports.object({
23845
23849
  id: external_exports.string().min(1),
@@ -23868,7 +23872,14 @@ var questionSchema = external_exports.object({
23868
23872
  * requests rather than an agent's free question. Absent on an ordinary question. */
23869
23873
  kind: external_exports.enum(QUESTION_REQUEST_KINDS).optional(),
23870
23874
  /** What the request is about: the app to connect for `connect_app`, the vendor for `connect_account`, the agent's handle for `spend`, the rule that asks for `start`, the site the agent's browser is on for `browser_handoff`, the skill or lesson a finished task suggests changing for `reflection`, the tool an agent's held call is to for `confirm`, the plugin id to turn on for `plugin_off`. */
23871
- subject: external_exports.string().trim().min(1).max(200).optional()
23875
+ subject: external_exports.string().trim().min(1).max(200).optional(),
23876
+ /** For `reflection`: what each change would write, as the text it replaces and the text it writes, so the card shows
23877
+ * the diff before anyone approves. `path` names what changes, as the person reads it. */
23878
+ changes: external_exports.array(external_exports.object({
23879
+ path: external_exports.string().trim().min(1).max(300),
23880
+ old_string: external_exports.string().max(QUESTION_CHANGE_CHARS),
23881
+ new_string: external_exports.string().max(QUESTION_CHANGE_CHARS)
23882
+ })).max(MAX_QUESTION_CHANGES).optional()
23872
23883
  }).superRefine((value, context) => {
23873
23884
  if (value.input && value.kind) context.addIssue({ code: "custom", message: "File input cannot be combined with a platform request kind." });
23874
23885
  if (new Set(value.options.map((option) => option.id)).size !== value.options.length) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  installClaudeHooks
3
- } from "./chunk-KTSUD2BU.js";
3
+ } from "./chunk-UHEJFBZJ.js";
4
4
  import {
5
5
  IncompleteSourceCaptureError,
6
6
  SOURCE_CAPTURE_VERSION,
@@ -16,23 +16,23 @@ import {
16
16
  savePendingSource,
17
17
  stillExcluded,
18
18
  writePrivateJson
19
- } from "./chunk-UJ7IXSJX.js";
19
+ } from "./chunk-YYDO5WB5.js";
20
20
  import {
21
21
  SessionSourceCollector,
22
22
  publicRemote,
23
23
  redactTraceText
24
- } from "./chunk-BIZJ4VZL.js";
24
+ } from "./chunk-AM6GOGA6.js";
25
25
  import {
26
26
  ApiError,
27
27
  api
28
- } from "./chunk-W2WEEVIM.js";
28
+ } from "./chunk-WLTOVOTW.js";
29
29
  import {
30
30
  loadLocalSkillState,
31
31
  revisionAt
32
- } from "./chunk-ZVNQJPMS.js";
32
+ } from "./chunk-WSQZHRE4.js";
33
33
  import {
34
34
  USER_AGENT
35
- } from "./chunk-CXRMG3HQ.js";
35
+ } from "./chunk-7DFFA6GA.js";
36
36
  import {
37
37
  apiBase,
38
38
  apiToken,
@@ -1540,6 +1540,13 @@ function uploadBody(session, sha256, device) {
1540
1540
  outside_conversation: session.conversation.flatMap((inside, index) => inside ? [] : [index])
1541
1541
  };
1542
1542
  }
1543
+ function spanOf(body) {
1544
+ const moment = (value) => typeof value === "string" && Number.isFinite(Date.parse(value)) ? value : null;
1545
+ return { started_at: moment(body.started_at), ended_at: moment(body.ended_at) };
1546
+ }
1547
+ function capturePaused(error) {
1548
+ return error instanceof ApiError && error.status === 423 && error.code === "timeline_paused";
1549
+ }
1543
1550
  function lockPath() {
1544
1551
  return join4(skyDir(), "trace-sync.lock");
1545
1552
  }
@@ -1620,7 +1627,7 @@ async function runSync(config, options) {
1620
1627
  const state = readJson2(statePath2(), { sessions: {} });
1621
1628
  const full = options.full || !state.lastFullAt || Date.now() - Date.parse(state.lastFullAt) > FULL_SWEEP_MS;
1622
1629
  const device = config.device ?? hostname();
1623
- const report = { scanned: 0, changed: 0, uploaded: 0, unchanged: 0, local: 0, owned: 0, empty: 0, sessions: 0, excluded: 0, failed: 0, results: 0, legacySources: 0, byWorkspace: {}, errors: [] };
1630
+ const report = { scanned: 0, changed: 0, uploaded: 0, unchanged: 0, local: 0, owned: 0, empty: 0, sessions: 0, excluded: 0, paused: 0, failed: 0, results: 0, legacySources: 0, byWorkspace: {}, errors: [] };
1624
1631
  const results = readJson2(resultsStatePath(), { read: [], saved: [] });
1625
1632
  const saveResults = async (local, workspace, sessionId, cwd) => {
1626
1633
  if (!sessionHarness(local.harness)) return;
@@ -1664,6 +1671,34 @@ async function runSync(config, options) {
1664
1671
  const collectorFailed = (error) => fail("other agents: unreadable", error);
1665
1672
  let discovered;
1666
1673
  const discover = async () => discovered ??= await discoverSessions(collectorFailed);
1674
+ const dropPaused = (item, local, workspace) => {
1675
+ report.paused++;
1676
+ record(local, { workspace, status: "paused" });
1677
+ writePrivateJson(statePath2(), state);
1678
+ removePendingSource(item);
1679
+ restored.set(key(local), local.signature);
1680
+ };
1681
+ const sendAcrossPause = async (item, local, workspace, sha256) => {
1682
+ const { work_objects: _objects, outside_conversation: outside, title: _title, ...previewBody } = item.manifest.body;
1683
+ const saved = await libraryRequest("PUT", `/trace-library/${local.harness}/${encodeURIComponent(local.sessionId)}`, workspace, { ...previewBody, sha256 });
1684
+ if (saved.status !== "withheld" && config.sessions !== false && sessionHarness(local.harness)) {
1685
+ const body = previewBody;
1686
+ const left = new Set(outside ?? []);
1687
+ const session = await saveTraceSession(libraryRequest, {
1688
+ harness: local.harness,
1689
+ sessionId: local.sessionId,
1690
+ workspace,
1691
+ body: { ...body, messages: body.messages.filter((_, index) => !left.has(index)) },
1692
+ skills: loadLocalSkillState()
1693
+ });
1694
+ if (session.status === "saved") report.sessions++;
1695
+ }
1696
+ if (!results.read.includes(key(local))) {
1697
+ results.read.push(key(local));
1698
+ writePrivateJson(resultsStatePath(), results);
1699
+ }
1700
+ dropPaused(item, local, workspace);
1701
+ };
1667
1702
  const send = async (item) => {
1668
1703
  const { workspace } = item.manifest;
1669
1704
  let capturing = false;
@@ -1699,12 +1734,16 @@ async function runSync(config, options) {
1699
1734
  }
1700
1735
  if (item.manifest.stage !== "ready") completePendingCapture(item, source);
1701
1736
  const statuses = await libraryRequest("POST", "/trace-library/check", workspace, {
1702
- sessions: [{ harness: local.harness, session_id: local.sessionId, sha256: source.sha256 }]
1737
+ sessions: [{ harness: local.harness, session_id: local.sessionId, sha256: source.sha256, span: spanOf(item.manifest.body) }]
1703
1738
  });
1704
1739
  if (statuses.sessions[0]?.status === "owned") {
1705
1740
  report.owned++;
1706
1741
  throw new Error("Another member owns this source; pending archive retained.");
1707
1742
  }
1743
+ if (statuses.sessions[0]?.status === "paused") {
1744
+ await sendAcrossPause(item, local, workspace, source.sha256);
1745
+ return;
1746
+ }
1708
1747
  if (item.manifest.fileId) await verifyPendingFile(item, source);
1709
1748
  else {
1710
1749
  const file = await uploadLargeFile(source.path, "application/x-ndjson", void 0, () => {
@@ -1763,6 +1802,10 @@ async function runSync(config, options) {
1763
1802
  report.uploaded++;
1764
1803
  report.byWorkspace[workspace] = (report.byWorkspace[workspace] ?? 0) + 1;
1765
1804
  } catch (error) {
1805
+ if (!capturing && capturePaused(error)) {
1806
+ dropPaused(item, local, workspace);
1807
+ return;
1808
+ }
1766
1809
  if (capturing) unreadable.add(key(local));
1767
1810
  else blocked = true;
1768
1811
  fail(`${key(local)} \u2192 ${workspace}`, error);
@@ -1829,7 +1872,11 @@ async function runSync(config, options) {
1829
1872
  const directory = mkdtempSync(join4(skyDir(), "trace-dry-run-"));
1830
1873
  try {
1831
1874
  const source2 = await captureTraceSource(local, directory, { workspace: prepared.workspace, apiBase: endpoint });
1832
- const checked = await libraryRequest("POST", "/trace-library/check", prepared.workspace, { sessions: [{ harness: local.harness, session_id: local.sessionId, sha256: source2.sha256 }] });
1875
+ const checked = await libraryRequest("POST", "/trace-library/check", prepared.workspace, { sessions: [{ harness: local.harness, session_id: local.sessionId, sha256: source2.sha256, span: spanOf(prepared.body) }] });
1876
+ if (checked.sessions[0]?.status === "paused") {
1877
+ report.paused++;
1878
+ return;
1879
+ }
1833
1880
  if (checked.sessions[0]?.status === "owned") {
1834
1881
  report.owned++;
1835
1882
  return;
@@ -1851,7 +1898,8 @@ async function runSync(config, options) {
1851
1898
  completePendingCapture(item, source);
1852
1899
  ready.push(item);
1853
1900
  } catch (error) {
1854
- fail(`${key(local)}: source capture failed`, error);
1901
+ if (capturePaused(error)) report.paused++;
1902
+ else fail(`${key(local)}: source capture failed`, error);
1855
1903
  }
1856
1904
  });
1857
1905
  await pool(ready, UPLOAD_CONCURRENCY, send);
@@ -1957,6 +2005,8 @@ export {
1957
2005
  repoRemote,
1958
2006
  routeSession,
1959
2007
  libraryRequest,
2008
+ spanOf,
2009
+ capturePaused,
1960
2010
  syncTraces,
1961
2011
  hookSessionRef,
1962
2012
  LAUNCHD_LABEL,
@@ -2,11 +2,11 @@ import {
2
2
  MCP_SERVER_NAME,
3
3
  withoutSettingsBlock,
4
4
  withoutTomlServer
5
- } from "./chunk-BCSZO4BR.js";
5
+ } from "./chunk-OYSSK6GS.js";
6
6
  import {
7
7
  ApiError,
8
8
  api
9
- } from "./chunk-W2WEEVIM.js";
9
+ } from "./chunk-WLTOVOTW.js";
10
10
  import {
11
11
  configPath,
12
12
  currentUniverse
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CLI_VERSION
3
- } from "./chunk-CXRMG3HQ.js";
3
+ } from "./chunk-7DFFA6GA.js";
4
4
 
5
5
  // src/skill.ts
6
6
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  api
3
- } from "./chunk-W2WEEVIM.js";
3
+ } from "./chunk-WLTOVOTW.js";
4
4
  import {
5
5
  SKILL_NAME
6
- } from "./chunk-F6V2GGMP.js";
6
+ } from "./chunk-OBRH43HE.js";
7
7
  import {
8
8
  configPath
9
9
  } from "./chunk-XHZJG3QT.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  lastUploads,
3
3
  loadSyncConfig
4
- } from "./chunk-3FQZZNQP.js";
4
+ } from "./chunk-EO32DG3Z.js";
5
5
  import {
6
6
  CAPTURE_HOOK_ARGS,
7
7
  SetupJournal,
8
8
  isCaptureCommand,
9
9
  workspaceSlug
10
- } from "./chunk-EBCVJDIL.js";
10
+ } from "./chunk-MXIAK52Z.js";
11
11
  import {
12
12
  cachedSettingsBlock,
13
13
  detectClaudeApp,
@@ -24,18 +24,18 @@ import {
24
24
  settingsBlockState,
25
25
  systemCommandRunner,
26
26
  writeSettingsBlocks
27
- } from "./chunk-BCSZO4BR.js";
27
+ } from "./chunk-OYSSK6GS.js";
28
28
  import {
29
29
  ApiError,
30
30
  api
31
- } from "./chunk-W2WEEVIM.js";
31
+ } from "./chunk-WLTOVOTW.js";
32
32
  import {
33
33
  installSkill,
34
34
  skillState
35
- } from "./chunk-F6V2GGMP.js";
35
+ } from "./chunk-OBRH43HE.js";
36
36
  import {
37
37
  CLI_VERSION
38
- } from "./chunk-CXRMG3HQ.js";
38
+ } from "./chunk-7DFFA6GA.js";
39
39
  import {
40
40
  apiBase,
41
41
  apiToken,
@@ -1915,7 +1915,7 @@ ${raw}` : `${line}
1915
1915
  return { trigger: "codex_notify", outcome: "installed", path };
1916
1916
  }
1917
1917
  async function installSchedule(opts) {
1918
- const lib = await import("./trace-library-WE3C5OBP.js");
1918
+ const lib = await import("./trace-library-CRCV5JDF.js");
1919
1919
  if ((opts.platform ?? process.platform) !== "darwin") {
1920
1920
  return { trigger: "schedule", outcome: "skipped", detail: "the 15-minute sweep is macOS only; on Linux add `*/15 * * * * sky trace sync --quiet` to your crontab. The hooks still capture each session" };
1921
1921
  }
@@ -1938,7 +1938,7 @@ async function installSchedule(opts) {
1938
1938
  return { trigger: "schedule", outcome: "installed", path };
1939
1939
  }
1940
1940
  async function installCapture(opts) {
1941
- const lib = await import("./trace-library-WE3C5OBP.js");
1941
+ const lib = await import("./trace-library-CRCV5JDF.js");
1942
1942
  const config = lib.loadSyncConfig();
1943
1943
  if (!config.enabled && config.enabledAt) return { sync: "off", triggers: [] };
1944
1944
  const configFile = lib.syncConfigPath();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  TRACE_CONTENT_SCOPES,
3
3
  redactTraceText
4
- } from "./chunk-BIZJ4VZL.js";
4
+ } from "./chunk-AM6GOGA6.js";
5
5
  import {
6
6
  USER_AGENT
7
- } from "./chunk-CXRMG3HQ.js";
7
+ } from "./chunk-7DFFA6GA.js";
8
8
  import {
9
9
  configPath
10
10
  } from "./chunk-XHZJG3QT.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  USER_AGENT
3
- } from "./chunk-CXRMG3HQ.js";
3
+ } from "./chunk-7DFFA6GA.js";
4
4
  import {
5
5
  apiBase,
6
6
  apiToken,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SKILL_MARKER,
3
3
  SKILL_NAME
4
- } from "./chunk-F6V2GGMP.js";
4
+ } from "./chunk-OBRH43HE.js";
5
5
  import {
6
6
  CLI_VERSION
7
- } from "./chunk-CXRMG3HQ.js";
7
+ } from "./chunk-7DFFA6GA.js";
8
8
  import {
9
9
  configPath
10
10
  } from "./chunk-XHZJG3QT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  UnsafeImportError,
3
3
  redactLine
4
- } from "./chunk-BIZJ4VZL.js";
4
+ } from "./chunk-AM6GOGA6.js";
5
5
 
6
6
  // src/trace-exclusions.ts
7
7
  import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  api
3
- } from "./chunk-W2WEEVIM.js";
4
- import "./chunk-CXRMG3HQ.js";
3
+ } from "./chunk-WLTOVOTW.js";
4
+ import "./chunk-7DFFA6GA.js";
5
5
  import "./chunk-XHZJG3QT.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
 
@@ -8,17 +8,17 @@ import {
8
8
  repairComputer,
9
9
  reportComputer,
10
10
  upkeepComputer
11
- } from "./chunk-HGLVOMHL.js";
12
- import "./chunk-3FQZZNQP.js";
13
- import "./chunk-KTSUD2BU.js";
14
- import "./chunk-UJ7IXSJX.js";
15
- import "./chunk-BIZJ4VZL.js";
16
- import "./chunk-EBCVJDIL.js";
17
- import "./chunk-BCSZO4BR.js";
18
- import "./chunk-W2WEEVIM.js";
19
- import "./chunk-ZVNQJPMS.js";
20
- import "./chunk-F6V2GGMP.js";
21
- import "./chunk-CXRMG3HQ.js";
11
+ } from "./chunk-TPDNO2LM.js";
12
+ import "./chunk-EO32DG3Z.js";
13
+ import "./chunk-UHEJFBZJ.js";
14
+ import "./chunk-YYDO5WB5.js";
15
+ import "./chunk-AM6GOGA6.js";
16
+ import "./chunk-MXIAK52Z.js";
17
+ import "./chunk-OYSSK6GS.js";
18
+ import "./chunk-WLTOVOTW.js";
19
+ import "./chunk-WSQZHRE4.js";
20
+ import "./chunk-OBRH43HE.js";
21
+ import "./chunk-7DFFA6GA.js";
22
22
  import "./chunk-XHZJG3QT.js";
23
23
  import "./chunk-MLKGABMK.js";
24
24
  export {
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  skyCommand,
17
17
  takeBack,
18
18
  waitForAnswer
19
- } from "./chunk-HGLVOMHL.js";
19
+ } from "./chunk-TPDNO2LM.js";
20
20
  import {
21
21
  SINGLE_REQUEST_MAX_BYTES,
22
22
  codexThreadName,
@@ -29,9 +29,9 @@ import {
29
29
  transfer,
30
30
  uploadLargeFile,
31
31
  workspaceState
32
- } from "./chunk-3FQZZNQP.js";
33
- import "./chunk-KTSUD2BU.js";
34
- import "./chunk-UJ7IXSJX.js";
32
+ } from "./chunk-EO32DG3Z.js";
33
+ import "./chunk-UHEJFBZJ.js";
34
+ import "./chunk-YYDO5WB5.js";
35
35
  import {
36
36
  AGENT_TYPES,
37
37
  MODEL_SUBSCRIPTION_PLAN_PHRASE,
@@ -56,7 +56,7 @@ import {
56
56
  storeSkillRefSchema,
57
57
  supersededBy,
58
58
  unsafeNumberSpans
59
- } from "./chunk-BIZJ4VZL.js";
59
+ } from "./chunk-AM6GOGA6.js";
60
60
  import {
61
61
  SetupJournal,
62
62
  TOKEN_ENV,
@@ -81,7 +81,7 @@ import {
81
81
  withdrawInvite,
82
82
  workspaceSlug,
83
83
  writeShellEnv
84
- } from "./chunk-EBCVJDIL.js";
84
+ } from "./chunk-MXIAK52Z.js";
85
85
  import {
86
86
  detectClaudeApp,
87
87
  detectHermes,
@@ -98,7 +98,7 @@ import {
98
98
  systemCommandRunner,
99
99
  withoutSettingsBlock,
100
100
  writeSettingsBlocks
101
- } from "./chunk-BCSZO4BR.js";
101
+ } from "./chunk-OYSSK6GS.js";
102
102
  import {
103
103
  ApiError,
104
104
  api,
@@ -112,21 +112,21 @@ import {
112
112
  streamEvents,
113
113
  uploadFile,
114
114
  writeResponseFile
115
- } from "./chunk-W2WEEVIM.js";
115
+ } from "./chunk-WLTOVOTW.js";
116
116
  import {
117
117
  skillTargets,
118
118
  syncLocalSkills
119
- } from "./chunk-ZVNQJPMS.js";
119
+ } from "./chunk-WSQZHRE4.js";
120
120
  import {
121
121
  SKILL_NAME,
122
122
  installSkill,
123
123
  isInstalledSkill,
124
124
  skillPaths
125
- } from "./chunk-F6V2GGMP.js";
125
+ } from "./chunk-OBRH43HE.js";
126
126
  import {
127
127
  CLI_VERSION,
128
128
  USER_AGENT
129
- } from "./chunk-CXRMG3HQ.js";
129
+ } from "./chunk-7DFFA6GA.js";
130
130
  import {
131
131
  apiBase,
132
132
  apiToken,
@@ -3878,7 +3878,7 @@ async function setUp(opts, journal) {
3878
3878
  const workspace2 = engines.length && (has("skill") || has("capture")) ? await workspaceSlug().catch(() => null) : null;
3879
3879
  let install = false;
3880
3880
  if (engines.length && (has("skill") || has("capture") || has("plugins"))) {
3881
- const captureNoticeLines = has("capture") && workspace2 ? captureNotice(workspace2, await (await import("./trace-library-WE3C5OBP.js")).sourceFolders()) : [];
3881
+ const captureNoticeLines = has("capture") && workspace2 ? captureNotice(workspace2, await (await import("./trace-library-CRCV5JDF.js")).sourceFolders()) : [];
3882
3882
  if (interactive) for (const line2 of captureNoticeLines) console.log(line2);
3883
3883
  install = await agreed(installQuestion(engines.map((engine) => engine.name), { capture: captureNoticeLines.length > 0 }));
3884
3884
  if (!interactive && captureNoticeLines.length) captureNotices = captureNoticeLines;
@@ -3913,9 +3913,9 @@ async function setUp(opts, journal) {
3913
3913
  for (const client of mcpOnly) registerMcp(client);
3914
3914
  if (token) {
3915
3915
  try {
3916
- const { localSkillWorkspace } = await import("./local-skills-run-OYPW36ZG.js");
3916
+ const { localSkillWorkspace } = await import("./local-skills-run-3CCDHJ6Q.js");
3917
3917
  const workspace3 = await localSkillWorkspace();
3918
- const { libraryRequest } = await import("./trace-library-WE3C5OBP.js");
3918
+ const { libraryRequest } = await import("./trace-library-CRCV5JDF.js");
3919
3919
  const local = await syncLocalSkills({
3920
3920
  workspace: workspace3,
3921
3921
  targets: skillTargets(agents, hermes?.root ?? null),
@@ -4613,12 +4613,17 @@ function editGoalBody(opts) {
4613
4613
  function dollars2(cents) {
4614
4614
  return `$${(Number(cents) / 100).toFixed(2)}`;
4615
4615
  }
4616
+ function driverLine(goal2) {
4617
+ if (goal2.driver) return `driven by: ${goal2.driver.name ?? goal2.driver.id} (${goal2.driver.kind}), stated ${goal2.driver.stated_at}`;
4618
+ return "driven by: nobody is named";
4619
+ }
4616
4620
  function renderGoal(goal2) {
4617
4621
  if (!goal2) return 'No goal. Set one: sky goal set <session> "<objective>"';
4618
4622
  const lines2 = [];
4619
4623
  const state = goal2.status === "stopped" && goal2.stop_reason ? `stopped (${goal2.stop_reason})` : goal2.status;
4620
4624
  lines2.push(`${goal2.id} ${state} iteration ${goal2.iteration}/${goal2.max_iterations}`);
4621
4625
  lines2.push(`objective: ${goal2.objective}`);
4626
+ if (goal2.driver !== void 0) lines2.push(driverLine(goal2));
4622
4627
  const spend = goal2.max_spend ? `${dollars2(goal2.consumed_spend.amount)} of ${dollars2(goal2.max_spend.amount)}` : dollars2(goal2.consumed_spend.amount);
4623
4628
  const tokens = goal2.max_tokens === null ? `${goal2.consumed_tokens}` : `${goal2.consumed_tokens} of ${goal2.max_tokens}`;
4624
4629
  lines2.push(`spent: ${spend} tokens: ${tokens}${goal2.deadline_at ? ` deadline: ${goal2.deadline_at}` : ""}`);
@@ -4994,7 +4999,11 @@ name = "${name}"
4994
4999
  # skillId = "skill_..."
4995
5000
 
4996
5001
  prompt = """
4997
- You are ${name}, a helpful long-lived agent.
5002
+ You are ${name}. Your first sentence is the one job you do.
5003
+
5004
+ You do not take a second job, narrate your progress, or message anyone when there is nothing to report.
5005
+
5006
+ How: do the work, then say the result, a blocker only the person can clear, or that a commitment was missed. Otherwise stay quiet.
4998
5007
  """
4999
5008
  `
5000
5009
  );
@@ -8824,6 +8833,7 @@ async function listAsks(query) {
8824
8833
  if (query.source) params.set("source_id", query.source);
8825
8834
  if (query.limit) params.set("limit", query.limit);
8826
8835
  if (query.cursor) params.set("cursor", query.cursor);
8836
+ if (query.direction) params.set("direction", query.direction);
8827
8837
  return api("GET", `/asks${params.size ? `?${params}` : ""}`);
8828
8838
  }
8829
8839
  async function answerAsk(id3, opts) {
@@ -8838,8 +8848,11 @@ function renderAsk(ask3) {
8838
8848
  const choices = ask3.answer.options.length ? ` (${ask3.answer.options.map((option) => `${option.id}: ${option.label}`).join(", ")})` : "";
8839
8849
  const by = ask3.answer.answered_by === "person" ? ", only you, in the app" : "";
8840
8850
  const why = ask3.why ? ` \u2014 ${ask3.why}` : "";
8851
+ const member = (end) => end.name ?? (end.kind === "person" ? "you" : end.kind);
8852
+ const ends = ask3.from && ask3.to ? `
8853
+ ${member(ask3.from)} \u2192 ${member(ask3.to)} ${ask3.direction}, waits on ${member(ask3.waits_on === "from" ? ask3.from : ask3.to)}` : "";
8841
8854
  return `${ask3.who.name}: ${ask3.need}${why}
8842
- ${ask3.id} [${ask3.answer.label}${by}]${choices}`;
8855
+ ${ask3.id} [${ask3.answer.label}${by}]${choices}${ends}`;
8843
8856
  }
8844
8857
  function renderAnswered(result) {
8845
8858
  return [result.answered, result.session_id, result.url].filter(Boolean).join(" ");
@@ -11437,7 +11450,7 @@ skills.command("mine").description("your own skills, which follow you to every w
11437
11450
  );
11438
11451
  skills.command("local").description("the skills sky installed in this computer's engines (Claude Code, Codex, Cursor, Grok, Hermes), with each one's revision, layer and pin").option("--json", "print as JSON").action(
11439
11452
  run2(async (opts) => {
11440
- const { loadLocalSkillState } = await import("./local-skills-HHTAWGYV.js");
11453
+ const { loadLocalSkillState } = await import("./local-skills-E45ZCYGY.js");
11441
11454
  const state = loadLocalSkillState();
11442
11455
  if (opts.json) return void console.log(JSON.stringify(state, null, 2));
11443
11456
  const names = Object.keys(state.skills).sort();
@@ -11453,7 +11466,7 @@ skills.command("local").description("the skills sky installed in this computer's
11453
11466
  );
11454
11467
  skills.command("sync").description("install the workspace's skills and your own skills and changes in this computer's engines now; capture does this every 15 minutes").option("--workspace <slug>", "the workspace whose skills to install (default: where capture sends sessions, else your default)").option("--dry-run", "show what would change without writing").option("--json", "print the result as JSON").action(
11455
11468
  run2(async (opts) => {
11456
- const { describeLocalSkills, refreshLocalSkills } = await import("./local-skills-run-OYPW36ZG.js");
11469
+ const { describeLocalSkills, refreshLocalSkills } = await import("./local-skills-run-3CCDHJ6Q.js");
11457
11470
  const result = await refreshLocalSkills({ workspace: opts.workspace, dryRun: opts.dryRun });
11458
11471
  if (opts.json) return void console.log(JSON.stringify(result, null, 2));
11459
11472
  if (!result.checked) return void console.log("no engine that reads skills is installed on this computer");
@@ -11464,14 +11477,14 @@ ${lines2.join("\n")}` : `Skills from ${result.workspace} are current.`);
11464
11477
  );
11465
11478
  skills.command("pin <name>").description("keep a skill installed on this computer at the revision it has now; syncs leave it until you unpin it").action(
11466
11479
  run2(async (name) => {
11467
- const { pinLocalSkill } = await import("./local-skills-HHTAWGYV.js");
11480
+ const { pinLocalSkill } = await import("./local-skills-E45ZCYGY.js");
11468
11481
  const pinned = pinLocalSkill(name);
11469
11482
  console.log(`${name} stays at ${pinned.revision_id} on this computer`);
11470
11483
  })
11471
11484
  );
11472
11485
  skills.command("unpin <name>").description("let a pinned skill follow its updates again from the next sync").action(
11473
11486
  run2(async (name) => {
11474
- const { unpinLocalSkill } = await import("./local-skills-HHTAWGYV.js");
11487
+ const { unpinLocalSkill } = await import("./local-skills-E45ZCYGY.js");
11475
11488
  console.log(unpinLocalSkill(name) ? `${name} follows its updates again` : `${name} was not pinned`);
11476
11489
  })
11477
11490
  );
@@ -11532,8 +11545,7 @@ skills.command("usage").description("view and miss counts per skill name in this
11532
11545
  }
11533
11546
  })
11534
11547
  );
11535
- async function decideReflection(id3, verb) {
11536
- const { reflection_proposal: p } = await api("POST", `/reflection_proposals/${encodeURIComponent(id3)}/${verb}`);
11548
+ function printDecision({ reflection_proposal: p }) {
11537
11549
  console.log(`${p.id} ${p.status}`);
11538
11550
  }
11539
11551
  var routing = program.command("routing").description("who a question or piece of work goes to, and under which rules");
@@ -11564,15 +11576,26 @@ reflections.command("list").description("the workspace's proposals, newest first
11564
11576
  if (opts.json) return void console.log(JSON.stringify(list, null, 2));
11565
11577
  if (!list.length) return void console.log(`no ${opts.status} proposals`);
11566
11578
  for (const p of list) {
11567
- const target2 = p.kind === "save_lesson" ? p.path : p.kind === "create_skill" ? `new skill ${p.payload.name}` : `skill ${p.target_skill_id}`;
11579
+ const target2 = p.kind === "save_lesson" ? p.path : p.kind === "create_skill" ? `new skill ${p.payload.name}` : p.kind === "flag_conflict" || p.kind === "merge_skills" ? `skills ${p.payload.keep} and ${p.payload.drop}` : `skill ${p.target_skill_id}`;
11568
11580
  console.log(`${p.id} ${p.kind} ${target2} from ${p.session_id}
11569
11581
  ${p.payload.why ?? ""}`);
11570
11582
  }
11571
11583
  })
11572
11584
  );
11573
- reflections.command("approve <id>").description("write the proposal through the skill or memory store").action(run2(async (id3) => decideReflection(id3, "approve")));
11574
- reflections.command("reject <id>").description("decline the proposal; nothing is written").action(run2(async (id3) => decideReflection(id3, "reject")));
11575
- reflections.command("rollback <id>").description("undo an automatic skill change, restoring the previous version").action(run2(async (id3) => decideReflection(id3, "rollback")));
11585
+ reflections.command("approve <id>").description("write the proposal through the skill or memory store").action(run2(async (id3) => printDecision(await api("POST", `/reflection_proposals/${encodeURIComponent(id3)}/approve`))));
11586
+ reflections.command("reject <id>").description("decline the proposal; nothing is written").action(run2(async (id3) => printDecision(await api("POST", `/reflection_proposals/${encodeURIComponent(id3)}/reject`))));
11587
+ reflections.command("settle <id>").description("settle a conflict between two skills: keep one, keep both with narrower when-to-use, or merge; owner or admin").requiredOption("--action <action>", "keep_one, narrow or merge").option("--keep <skill>", "the skill id to keep (keep_one, merge)").option("--when-to-use <skill=text...>", "a skill id and its narrower description (narrow); defaults to what the review suggested").option("--skill-md <file>", "the merged SKILL.md (merge); defaults to what the review wrote").action(
11588
+ run2(async (id3, opts) => {
11589
+ const whenToUse = opts.whenToUse?.length ? Object.fromEntries(opts.whenToUse.map((entry) => {
11590
+ const at = entry.indexOf("=");
11591
+ if (at < 1) throw new Error(`--when-to-use takes <skill id>=<text>, not "${entry}"`);
11592
+ return [entry.slice(0, at), entry.slice(at + 1)];
11593
+ })) : void 0;
11594
+ const body = { action: opts.action, ...opts.keep ? { keep: opts.keep } : {}, ...whenToUse ? { when_to_use: whenToUse } : {}, ...opts.skillMd ? { skill_md: readFileSync26(opts.skillMd, "utf8") } : {} };
11595
+ printDecision(await api("POST", `/reflection_proposals/${encodeURIComponent(id3)}/settle`, body));
11596
+ })
11597
+ );
11598
+ reflections.command("rollback <id>").description("undo an automatic skill change or a settled conflict, restoring what was there before").action(run2(async (id3) => printDecision(await api("POST", `/reflection_proposals/${encodeURIComponent(id3)}/rollback`))));
11576
11599
  var library = program.command("library").description("your artifact Library on agentsky.dev: files and sites your agents saved or you uploaded");
11577
11600
  library.command("list").description("your Library, newest first").option("--search <text>", "only names that match").option("--cursor <cursor>", "the next page").option("--json", "print as JSON").action(
11578
11601
  run2(async (opts) => {
@@ -11671,7 +11694,7 @@ tracking.command("show <board>").description("one board's items").option("--json
11671
11694
  console.log(renderBoard(found.board));
11672
11695
  for (const item of found.items) console.log(renderItem2(item));
11673
11696
  }));
11674
- tracking.command("set <board> <item>").description("state where an item stands; it reads as stated until the routine checks it").option("--title <title>", "the outcome in plain words; needed for a new item").option("--stage <stage>", "planned, in_progress, awaiting_merge, merged or live; needed for a new item").option("--lane <lane>", "the product or area").option("--now <text>", "where it stands").option("--gap <text>", "what is missing").option("--owner <name>", "who has it").option("--ask <text>", "with --needs-you: the one thing the person must do").option("--needs-you", "only the person can move it").option("--no-needs-you", "the person no longer needs to act").option("--stuck", "no live owner or trigger is moving it").option("--no-stuck", "it is moving again").option("--link <label=url...>", "https links, as label=url").action(run2(async (board, item, opts) => {
11697
+ tracking.command("set <board> <item>").description("state where an item stands; it reads as stated until the routine checks it").option("--title <title>", "the outcome in plain words; needed for a new item").option("--stage <stage>", "planned, in_progress, awaiting_merge, merged, deployed or live; needed for a new item").option("--lane <lane>", "the product or area").option("--now <text>", "where it stands").option("--gap <text>", "what is missing").option("--owner <name>", "who has it").option("--ask <text>", "with --needs-you: the one thing the person must do").option("--needs-you", "only the person can move it").option("--no-needs-you", "the person no longer needs to act").option("--stuck", "no live owner or trigger is moving it").option("--no-stuck", "it is moving again").option("--link <label=url...>", "https links, as label=url").action(run2(async (board, item, opts) => {
11675
11698
  console.log(renderItem2((await setTrackingItem(board, item, opts)).item));
11676
11699
  }));
11677
11700
  tracking.command("remove <board> <item>").description("take an item off the board").action(run2(async (board, item) => {
@@ -11708,7 +11731,7 @@ items.command("propose <documentId> <title>").description("offer work on a docum
11708
11731
  })
11709
11732
  );
11710
11733
  var asks = program.command("asks").description("asks: everything waiting on you, one each, and answering one from here");
11711
- asks.command("list").description("what waits on you: who is waiting, what is needed, and how to answer").option("--kind <kind...>", "only these kinds, such as question, spend or failure").option("--source <id>", "only this session's or document's asks").option("--limit <n>", "up to 100").option("--cursor <cursor>", "next_cursor from the previous page; repeat the same filters").option("--json", "print as JSON").action(
11734
+ asks.command("list").description("what waits on you: who is waiting, what is needed, and how to answer").option("--kind <kind...>", "only these kinds, such as question, spend or failure").option("--source <id>", "only this session's or document's asks").option("--limit <n>", "up to 100").option("--cursor <cursor>", "next_cursor from the previous page; repeat the same filters").option("--direction <direction>", "name both ends of each ask: incoming, outgoing or all").option("--json", "print as JSON").action(
11712
11735
  run2(async (opts) => {
11713
11736
  const page = await listAsks(opts);
11714
11737
  if (opts.json) {
@@ -12153,6 +12176,30 @@ skyManager.command("progress").description("what every thread is doing, one sent
12153
12176
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderProgressPage(page));
12154
12177
  })
12155
12178
  );
12179
+ var LADDER_WORDS = { merged: "merged", deployed: "deployed", live: "checked live", closed: "stable" };
12180
+ skyManager.command("autopilot").description("what your agents carry: each change on the ladder merged \u2192 deployed \u2192 checked live \u2192 stable, open waits, decisions made for you today, and what only you can do").option("--json", "print the API's answer as JSON").action(
12181
+ run2(async (opts) => {
12182
+ const answer = await api("GET", "/sky/autopilot");
12183
+ if (opts.json) return void console.log(JSON.stringify(answer, null, 2));
12184
+ const lines2 = [];
12185
+ lines2.push(`Needs you (${answer.needs_you.length + answer.work.filter((item) => item.needs_you).length})`);
12186
+ for (const ask3 of answer.needs_you) lines2.push(` ${ask3.session_title ?? "Session"}: ${ask3.question} ${ask3.link}`);
12187
+ for (const item of answer.work.filter((entry) => entry.needs_you)) lines2.push(` ${item.title}: ${item.ask}`);
12188
+ lines2.push(`Work (${answer.work.length})`);
12189
+ for (const item of answer.work) lines2.push(` [${LADDER_WORDS[item.stage] ?? item.stage}${item.evidence === "verified" ? "" : ", stated"}] ${item.title}${item.now ? ` \u2014 ${item.now}` : ""}`);
12190
+ lines2.push(`Waiting (${answer.waits.length})`);
12191
+ for (const wait of answer.waits) lines2.push(` ${wait.session_title ?? "Session"}: ${wait.what}${wait.last_seen ? ` (${wait.last_seen})` : ""}`);
12192
+ lines2.push(`Decided for you today (${answer.decisions.length}); veto with: sky manager veto <id>`);
12193
+ for (const decision of answer.decisions) lines2.push(` ${decision.id}${decision.status === "vetoed" ? " (vetoed)" : ""}: ${decision.what} \u2014 ${decision.why}`);
12194
+ console.log(lines2.join("\n"));
12195
+ })
12196
+ );
12197
+ skyManager.command("veto <decision>").description("veto a decision an agent made for you; its session is told to undo it").action(
12198
+ run2(async (decision) => {
12199
+ const answer = await api("POST", `/sky/decisions/${encodeURIComponent(decision)}/veto`);
12200
+ console.log(`Vetoed ${answer.decision.id}: ${answer.decision.what}${answer.delivered ? "" : " (the session could not be reached; the veto stands)"}`);
12201
+ })
12202
+ );
12156
12203
  skyManager.command("watching").description("list every open matter and when Sky looks next").option("--json", "print the raw list").action(
12157
12204
  run2(async (opts) => {
12158
12205
  const { follow_ups } = await api("GET", "/sky/follow-ups");
@@ -12267,6 +12314,19 @@ for (const [verb, method, suffix, blurb] of [
12267
12314
  })
12268
12315
  );
12269
12316
  }
12317
+ goal.command("drive <session>").description("say who is meant to carry the goal forward: the session's own agent, or a person; it changes no limit or permission").option("--person [user]", "a person drives: you, or the workspace member with this user id").action(
12318
+ run2(async (ref, opts) => {
12319
+ const body = opts.person === void 0 ? void 0 : { kind: "person", ...opts.person === true ? {} : { id: opts.person } };
12320
+ const { goal: changed } = await api("PUT", `/sessions/${encodeURIComponent(await resolveSessionRef(ref))}/goal/driver`, body);
12321
+ console.log(`${changed.id}: ${driverLine(changed)}`);
12322
+ })
12323
+ );
12324
+ goal.command("drive-end <session>").description("end the statement of who drives the goal; the goal itself is untouched and keeps running").action(
12325
+ run2(async (ref) => {
12326
+ const { goal: changed } = await api("DELETE", `/sessions/${encodeURIComponent(await resolveSessionRef(ref))}/goal/driver`);
12327
+ console.log(`${changed.id}: ${driverLine(changed)}`);
12328
+ })
12329
+ );
12270
12330
  catalog.command("show <handle>").description("what one agent does, and how to hire it").option("--json", "print the raw listing").action(
12271
12331
  run2(async (handle, opts) => {
12272
12332
  const agent2 = await showCatalogAgent(handle);
@@ -12983,22 +13043,22 @@ program.command("capabilities").description("deprecated: sky plugins list --view
12983
13043
  );
12984
13044
  var mcpCommand = program.command("mcp").description("the AgentSky MCP server on this computer");
12985
13045
  mcpCommand.command("serve").description("serve the AgentSky MCP server's short tool list over stdio, for a program that starts its servers itself (the Claude app's chat, as `sky setup` registers it); each request is sent with the token sky holds at that moment").action(run2(async () => {
12986
- const { serveMcp } = await import("./mcp-serve-EJ7YKBMM.js");
13046
+ const { serveMcp } = await import("./mcp-serve-DXL7IMSU.js");
12987
13047
  await serveMcp();
12988
13048
  }));
12989
13049
  var compute = program.command("compute").description("the computers you set up with sky: the engines on each and whether each has the workspace's plugins, skills, capture and settings (the Compute group in Settings)");
12990
13050
  compute.command("list", { isDefault: true }).description("every computer you set up with sky, newest report first, with what is not current on each engine").option("--json", "print the list as JSON").action(run2(async (opts) => {
12991
- const { listComputeMachines, renderMachines } = await import("./compute-KNUZU4AO.js");
13051
+ const { listComputeMachines, renderMachines } = await import("./compute-OZ4TQBKO.js");
12992
13052
  const machines = await listComputeMachines();
12993
13053
  console.log(opts.json ? JSON.stringify({ machines }, null, 2) : renderMachines(machines));
12994
13054
  }));
12995
13055
  compute.command("repair <machine>").description("ask one of your computers to put its AgentSky setup right on its next scheduled run").option("--json", "print the answer as JSON").action(run2(async (machine, opts) => {
12996
- const { requestRepair } = await import("./compute-KNUZU4AO.js");
13056
+ const { requestRepair } = await import("./compute-OZ4TQBKO.js");
12997
13057
  const answer = await requestRepair(machine);
12998
13058
  console.log(opts.json ? JSON.stringify({ machine: answer }, null, 2) : `${answer.name} repairs on its next run (at most 15 minutes while it is on).`);
12999
13059
  }));
13000
13060
  compute.command("remove <machine>").description("forget one of your computers; nothing on it changes (run `sky setup --remove` there to take AgentSky out)").action(run2(async (machine) => {
13001
- const { removeMachine } = await import("./compute-KNUZU4AO.js");
13061
+ const { removeMachine } = await import("./compute-OZ4TQBKO.js");
13002
13062
  await removeMachine(machine);
13003
13063
  console.log(`Forgot ${machine}. It reports again on its next run unless \`sky setup --remove\` ran there.`);
13004
13064
  }));
@@ -13656,7 +13716,7 @@ harness.command("connect").description("run an ACP agent (the command after --)
13656
13716
  }));
13657
13717
  var traceCmd = program.command("trace").description("correlate this machine's agent work with the cloud sessions it starts (metadata only unless you choose content)");
13658
13718
  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(run2(async (opts) => {
13659
- const { readState, writeState, record: record3, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-754MK5OE.js");
13719
+ const { readState, writeState, record: record3, installClaudeHooks, parseContentScopes, chosenPaths, fileEvent } = await import("./trace-IRBLGOPZ.js");
13660
13720
  if (readState()) throw new Error("a trace is already running here \u2014 `sky trace stop` it first");
13661
13721
  const scopes = parseContentScopes(opts.capture);
13662
13722
  const chosen = chosenPaths(opts.file ?? [], opts.dir ?? []);
@@ -13691,7 +13751,7 @@ traceCmd.command("start").description("start a trace: a grant for this machine,
13691
13751
  }));
13692
13752
  traceCmd.command("hook").description("record one Claude Code hook event read from stdin (run by the installed hooks; never fails, prints nothing)").action(async () => {
13693
13753
  try {
13694
- const { readState, record: record3, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-754MK5OE.js");
13754
+ const { readState, record: record3, flush, grantSender, eventsForClaudeHook, contentForClaudeHook, clearState } = await import("./trace-IRBLGOPZ.js");
13695
13755
  const chunks = [];
13696
13756
  for await (const chunk of process.stdin) chunks.push(chunk);
13697
13757
  const input = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
@@ -13704,14 +13764,14 @@ traceCmd.command("hook").description("record one Claude Code hook event read fro
13704
13764
  }
13705
13765
  });
13706
13766
  traceCmd.command("flush").description("send what the spool holds, retrying with backoff").action(run2(async () => {
13707
- const { readState, flush, grantSender } = await import("./trace-754MK5OE.js");
13767
+ const { readState, flush, grantSender } = await import("./trace-IRBLGOPZ.js");
13708
13768
  const state = readState();
13709
13769
  if (!state) throw new Error("no trace is running here");
13710
13770
  const outcome = await flush(grantSender(state), { attempts: 4 });
13711
13771
  console.log(`sent ${outcome.sent}, refused ${outcome.refused}, given up ${outcome.expired}, still pending ${outcome.pending}${outcome.stopped ? ` (stopped: ${outcome.stopped})` : ""}`);
13712
13772
  }));
13713
13773
  traceCmd.command("status").description("the running trace and its spool").action(run2(async () => {
13714
- const { readState, spoolStatus } = await import("./trace-754MK5OE.js");
13774
+ const { readState, spoolStatus } = await import("./trace-IRBLGOPZ.js");
13715
13775
  const state = readState();
13716
13776
  if (!state) {
13717
13777
  console.log("No trace is running here.");
@@ -13721,7 +13781,7 @@ traceCmd.command("status").description("the running trace and its spool").action
13721
13781
  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`);
13722
13782
  }));
13723
13783
  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(run2(async (id3, opts) => {
13724
- const { readState } = await import("./trace-754MK5OE.js");
13784
+ const { readState } = await import("./trace-IRBLGOPZ.js");
13725
13785
  const ref = id3 ?? readState()?.trace_id;
13726
13786
  if (!ref) throw new Error("name a trace, or start one here");
13727
13787
  const bundle = await api("GET", `/traces/${ref}`);
@@ -13748,7 +13808,7 @@ traceCmd.command("show [id]").description("the trace bundle: spans, the sessions
13748
13808
  for (const gap of bundle.gaps) console.log(` gap: ${gap.span_id} ${gap.reason}`);
13749
13809
  }));
13750
13810
  traceCmd.command("stop").description("end the root span, send what is left, and revoke this machine's grant").action(run2(async () => {
13751
- const { readState, record: record3, flush, grantSender, clearState } = await import("./trace-754MK5OE.js");
13811
+ const { readState, record: record3, flush, grantSender, clearState } = await import("./trace-IRBLGOPZ.js");
13752
13812
  const state = readState();
13753
13813
  if (!state) throw new Error("no trace is running here");
13754
13814
  if (state.root_span) record3(() => [{ span_id: state.root_span, kind: "end", outcome: "completed" }]);
@@ -13761,7 +13821,7 @@ var recordCmd = traceCmd.command("record").description("record every Claude Code
13761
13821
  const { homedir: homedir11 } = await import("os");
13762
13822
  const { join: join21 } = await import("path");
13763
13823
  const vault2 = await import("./trace-vault-IUNYRVGZ.js");
13764
- const { installClaudeHooks, uninstallClaudeHooks } = await import("./trace-754MK5OE.js");
13824
+ const { installClaudeHooks, uninstallClaudeHooks } = await import("./trace-IRBLGOPZ.js");
13765
13825
  const command = "sky trace record hook";
13766
13826
  const config = vault2.loadVaultConfig();
13767
13827
  const settings = resolve12(opts.settings ?? config.settings ?? join21(process.env.CLAUDE_CONFIG_DIR ?? join21(homedir11(), ".claude"), "settings.json"));
@@ -13826,7 +13886,7 @@ recordCmd.command("seal <session-dir>").description("seal the cut segments of on
13826
13886
  }
13827
13887
  });
13828
13888
  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("--exclude <folder>", "never upload a session that ran in <folder> or below it, to the library or as a session (repeatable; shared with the AgentSky Mac app when it is installed)", collect).option("--unexclude <folder>", "stop excluding <folder> (repeatable)", collect).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("--install-hooks", "also sync at the end of every Claude Code and Codex turn (their hook and notify settings)").option("--status", "what sync has done on this machine").option("--quiet", "print only failures").action(async (payload, opts) => {
13829
- const lib = await import("./trace-library-WE3C5OBP.js");
13889
+ const lib = await import("./trace-library-CRCV5JDF.js");
13830
13890
  if (opts.hook) {
13831
13891
  try {
13832
13892
  let raw = payload ?? "";
@@ -13851,7 +13911,7 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
13851
13911
  return;
13852
13912
  }
13853
13913
  if (opts.exclude || opts.unexclude) {
13854
- const { changeExclusions, macSettingsPath } = await import("./trace-exclusions-MYECULMA.js");
13914
+ const { changeExclusions, macSettingsPath } = await import("./trace-exclusions-SMBZES3R.js");
13855
13915
  const { dirname: dirname13 } = await import("path");
13856
13916
  const changed = changeExclusions(dirname13(lib.syncConfigPath()), { add: opts.exclude, remove: opts.unexclude });
13857
13917
  console.log(changed.exclusions.folders.length ? "Sync never uploads sessions that ran in:" : "No folder is excluded.");
@@ -13922,7 +13982,7 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
13922
13982
  }
13923
13983
  console.log(`Trace sync is ${config.enabled ? "on" : "off"}${config.enabledAt ? ` (since ${config.enabledAt})` : ""}. Last full sweep: ${state.lastFullAt ?? "never"}.`);
13924
13984
  for (const [label, count] of [...counts].sort((a, b) => b[1] - a[1])) console.log(` ${count} ${label}`);
13925
- const { loadExclusions } = await import("./trace-exclusions-MYECULMA.js");
13985
+ const { loadExclusions } = await import("./trace-exclusions-SMBZES3R.js");
13926
13986
  for (const folder of loadExclusions(join21(lib.syncConfigPath(), "..")).folders) console.log(` excluded: ${folder}`);
13927
13987
  return;
13928
13988
  }
@@ -13939,7 +13999,7 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
13939
13999
  return;
13940
14000
  }
13941
14001
  if (!opts.dryRun) {
13942
- const { describeLocalSkills, refreshLocalSkills } = await import("./local-skills-run-OYPW36ZG.js");
14002
+ const { describeLocalSkills, refreshLocalSkills } = await import("./local-skills-run-3CCDHJ6Q.js");
13943
14003
  try {
13944
14004
  const skills2 = await refreshLocalSkills({ hook: Boolean(opts.session?.length) });
13945
14005
  if (skills2 && !opts.quiet) for (const line2 of describeLocalSkills(skills2)) console.log(line2);
@@ -13950,11 +14010,11 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
13950
14010
  if (!opts.quiet || report.failed) {
13951
14011
  if (report.legacySources) console.log(`Kept ${report.legacySources} unbound legacy source archives locally; no ownership was inferred.`);
13952
14012
  const where = Object.entries(report.byWorkspace).map(([workspace2, count]) => `${count} \u2192 ${workspace2}`).join(", ");
13953
- console.log(`${opts.dryRun ? "Would upload" : "Uploaded"} ${report.uploaded}${where ? ` (${where})` : ""}; unchanged ${report.unchanged}; saved as sessions ${report.sessions}; excluded ${report.excluded}; kept local ${report.local}; empty ${report.empty}; another member's ${report.owned}; failed ${report.failed}. Scanned ${report.scanned}, ${report.changed} changed.`);
14013
+ console.log(`${opts.dryRun ? "Would upload" : "Uploaded"} ${report.uploaded}${where ? ` (${where})` : ""}; unchanged ${report.unchanged}; saved as sessions ${report.sessions}; excluded ${report.excluded}; left out as paused ${report.paused}; kept local ${report.local}; empty ${report.empty}; another member's ${report.owned}; failed ${report.failed}. Scanned ${report.scanned}, ${report.changed} changed.`);
13954
14014
  for (const error of report.errors.slice(0, 20)) console.error(` ${error}`);
13955
14015
  }
13956
14016
  if (!opts.session && !opts.dryRun) {
13957
- const { upkeepComputer } = await import("./compute-report-AT642XES.js");
14017
+ const { upkeepComputer } = await import("./compute-report-SGDLKR22.js");
13958
14018
  const said = await upkeepComputer().catch((error) => `AgentSky could not check this computer's setup: ${error instanceof Error ? error.message : String(error)}`);
13959
14019
  if (said) console.log(said);
13960
14020
  }
@@ -13963,7 +14023,7 @@ traceCmd.command("sync [payload]").description("upload this machine's agent sess
13963
14023
  });
13964
14024
  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(run2(async (machine, opts) => {
13965
14025
  if (opts.on && opts.off) throw new Error("choose --on or --off");
13966
- const { libraryRequest } = await import("./trace-library-WE3C5OBP.js");
14026
+ const { libraryRequest } = await import("./trace-library-CRCV5JDF.js");
13967
14027
  const workspace2 = opts.workspace ?? currentUniverse();
13968
14028
  if (!workspace2) throw new Error("name a workspace with --workspace");
13969
14029
  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);
@@ -13980,7 +14040,7 @@ traceCmd.command("search <query...>").description("search every session in a wor
13980
14040
  console.log(opts.json ? JSON.stringify(page, null, 2) : renderContextPage(page));
13981
14041
  }));
13982
14042
  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(run2(async (opts) => {
13983
- const { libraryRequest } = await import("./trace-library-WE3C5OBP.js");
14043
+ const { libraryRequest } = await import("./trace-library-CRCV5JDF.js");
13984
14044
  const workspace2 = opts.workspace ?? currentUniverse();
13985
14045
  if (!workspace2) throw new Error("name a workspace with --workspace");
13986
14046
  const page = await libraryRequest("GET", `/trace-library?limit=${opts.limit}`, workspace2);
@@ -9,9 +9,9 @@ import {
9
9
  skillTargets,
10
10
  syncLocalSkills,
11
11
  unpinLocalSkill
12
- } from "./chunk-ZVNQJPMS.js";
13
- import "./chunk-F6V2GGMP.js";
14
- import "./chunk-CXRMG3HQ.js";
12
+ } from "./chunk-WSQZHRE4.js";
13
+ import "./chunk-OBRH43HE.js";
14
+ import "./chunk-7DFFA6GA.js";
15
15
  import "./chunk-XHZJG3QT.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  SetupJournal,
3
3
  workspaceSlug
4
- } from "./chunk-EBCVJDIL.js";
4
+ } from "./chunk-MXIAK52Z.js";
5
5
  import {
6
6
  detectHermes,
7
7
  detectLocalAgents
8
- } from "./chunk-BCSZO4BR.js";
9
- import "./chunk-W2WEEVIM.js";
8
+ } from "./chunk-OYSSK6GS.js";
9
+ import "./chunk-WLTOVOTW.js";
10
10
  import {
11
11
  checkedWithin,
12
12
  skillTargets,
13
13
  syncLocalSkills
14
- } from "./chunk-ZVNQJPMS.js";
15
- import "./chunk-F6V2GGMP.js";
16
- import "./chunk-CXRMG3HQ.js";
14
+ } from "./chunk-WSQZHRE4.js";
15
+ import "./chunk-OBRH43HE.js";
16
+ import "./chunk-7DFFA6GA.js";
17
17
  import "./chunk-XHZJG3QT.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
 
@@ -21,7 +21,7 @@ import "./chunk-MLKGABMK.js";
21
21
  var HOOK_RECHECK_MS = 5 * 60 * 1e3;
22
22
  async function localSkillWorkspace(explicit) {
23
23
  if (explicit) return explicit;
24
- const { loadSyncConfig } = await import("./trace-library-WE3C5OBP.js");
24
+ const { loadSyncConfig } = await import("./trace-library-CRCV5JDF.js");
25
25
  return loadSyncConfig().fallback ?? await workspaceSlug();
26
26
  }
27
27
  async function refreshLocalSkills(opts = {}) {
@@ -30,7 +30,7 @@ async function refreshLocalSkills(opts = {}) {
30
30
  const targets = skillTargets(detectLocalAgents(), hermes?.root ?? null);
31
31
  const workspace = await localSkillWorkspace(opts.workspace);
32
32
  if (!targets.length) return { workspace, checked: false, skills: [] };
33
- const { libraryRequest } = await import("./trace-library-WE3C5OBP.js");
33
+ const { libraryRequest } = await import("./trace-library-CRCV5JDF.js");
34
34
  const journal = opts.dryRun ? void 0 : new SetupJournal();
35
35
  try {
36
36
  return await syncLocalSkills({ workspace, targets, journal, dryRun: opts.dryRun, request: (method, path, slug) => libraryRequest(method, path, slug) });
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  cachedSettingsBlock,
3
3
  mcpUrlFor
4
- } from "./chunk-BCSZO4BR.js";
5
- import "./chunk-W2WEEVIM.js";
6
- import "./chunk-F6V2GGMP.js";
4
+ } from "./chunk-OYSSK6GS.js";
5
+ import "./chunk-WLTOVOTW.js";
6
+ import "./chunk-OBRH43HE.js";
7
7
  import {
8
8
  USER_AGENT
9
- } from "./chunk-CXRMG3HQ.js";
9
+ } from "./chunk-7DFFA6GA.js";
10
10
  import {
11
11
  apiBase,
12
12
  apiToken
@@ -22,9 +22,9 @@ import {
22
22
  traceDir,
23
23
  uninstallClaudeHooks,
24
24
  writeState
25
- } from "./chunk-KTSUD2BU.js";
26
- import "./chunk-BIZJ4VZL.js";
27
- import "./chunk-CXRMG3HQ.js";
25
+ } from "./chunk-UHEJFBZJ.js";
26
+ import "./chunk-AM6GOGA6.js";
27
+ import "./chunk-7DFFA6GA.js";
28
28
  import "./chunk-XHZJG3QT.js";
29
29
  import "./chunk-MLKGABMK.js";
30
30
  export {
@@ -6,8 +6,8 @@ import {
6
6
  loadExclusions,
7
7
  macSettingsPath,
8
8
  stillExcluded
9
- } from "./chunk-UJ7IXSJX.js";
10
- import "./chunk-BIZJ4VZL.js";
9
+ } from "./chunk-YYDO5WB5.js";
10
+ import "./chunk-AM6GOGA6.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
13
13
  changeExclusions,
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  LAUNCHD_LABEL,
3
3
  SYNC_HOOK_COMMAND,
4
+ capturePaused,
4
5
  collectorBody,
5
6
  collectorHarness,
6
7
  discoverSessions,
@@ -22,23 +23,25 @@ import {
22
23
  saveSyncConfig,
23
24
  sessionDigest,
24
25
  sourceFolders,
26
+ spanOf,
25
27
  supportedAgents,
26
28
  syncConfigPath,
27
29
  syncDir,
28
30
  syncTraces
29
- } from "./chunk-3FQZZNQP.js";
30
- import "./chunk-KTSUD2BU.js";
31
- import "./chunk-UJ7IXSJX.js";
32
- import "./chunk-BIZJ4VZL.js";
33
- import "./chunk-W2WEEVIM.js";
34
- import "./chunk-ZVNQJPMS.js";
35
- import "./chunk-F6V2GGMP.js";
36
- import "./chunk-CXRMG3HQ.js";
31
+ } from "./chunk-EO32DG3Z.js";
32
+ import "./chunk-UHEJFBZJ.js";
33
+ import "./chunk-YYDO5WB5.js";
34
+ import "./chunk-AM6GOGA6.js";
35
+ import "./chunk-WLTOVOTW.js";
36
+ import "./chunk-WSQZHRE4.js";
37
+ import "./chunk-OBRH43HE.js";
38
+ import "./chunk-7DFFA6GA.js";
37
39
  import "./chunk-XHZJG3QT.js";
38
40
  import "./chunk-MLKGABMK.js";
39
41
  export {
40
42
  LAUNCHD_LABEL,
41
43
  SYNC_HOOK_COMMAND,
44
+ capturePaused,
42
45
  collectorBody,
43
46
  collectorHarness,
44
47
  discoverSessions,
@@ -60,6 +63,7 @@ export {
60
63
  saveSyncConfig,
61
64
  sessionDigest,
62
65
  sourceFolders,
66
+ spanOf,
63
67
  supportedAgents,
64
68
  syncConfigPath,
65
69
  syncDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/sky",
3
- "version": "3.44.0",
3
+ "version": "3.45.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",