@alan-ai-hq/agent-manager-darwin-arm64 0.1.140 → 0.1.142

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.
Files changed (2) hide show
  1. package/alan-agent.cjs +72 -25
  2. package/package.json +1 -1
package/alan-agent.cjs CHANGED
@@ -24717,25 +24717,65 @@ function pageNode(node2) {
24717
24717
  children: node2.children.map(pageNode)
24718
24718
  };
24719
24719
  }
24720
- function compactConversationMessageTurns(turns, keepNewestEntries) {
24720
+ function rendersBesideSteps(update) {
24721
+ const meta3 = isRecord8(update._meta) ? update._meta : {};
24722
+ return parsedFromRawOutput(update) || meta3["alan.dev/subagentLauncher"] !== void 0 || meta3["alan.dev/backgroundTask"] !== void 0;
24723
+ }
24724
+ function diffWithoutText(block) {
24725
+ const inner = isRecord8(block) && block.type === "content" ? block.content : block;
24726
+ if (!isRecord8(inner) || inner.type !== "diff")
24727
+ return null;
24728
+ const path4 = typeof inner.path === "string" ? { path: inner.path } : {};
24729
+ const stub = { type: "diff", ...path4 };
24730
+ return isRecord8(block) && block.type === "content" ? { ...block, content: stub } : stub;
24731
+ }
24732
+ function stepSummary(node2) {
24733
+ const update = node2.event.update;
24734
+ const children = node2.children.map(stepSummary);
24735
+ if (update.sessionUpdate === "terminal_update") {
24736
+ const { output: _output, ...rest2 } = update;
24737
+ return { ...node2, event: { ...node2.event, update: rest2 }, children };
24738
+ }
24739
+ if (update.sessionUpdate !== "tool_call_update" || rendersBesideSteps(update))
24740
+ return { ...node2, children };
24741
+ const { content, rawOutput: _rawOutput, ...rest } = update;
24742
+ const diffs = (Array.isArray(content) ? content : []).map(diffWithoutText).filter((block) => block !== null);
24743
+ return {
24744
+ ...node2,
24745
+ event: { ...node2.event, update: diffs.length > 0 ? { ...rest, content: diffs } : rest },
24746
+ children
24747
+ };
24748
+ }
24749
+ function withStepSummaries(turn, ordinal) {
24750
+ if (turn.activity.state !== "idle")
24751
+ return turn;
24752
+ return {
24753
+ ...turn,
24754
+ ordinal,
24755
+ working: turn.working.map((node2) => node2.key === turn.final?.key ? node2 : stepSummary(node2)),
24756
+ stepOutputsOmitted: true
24757
+ };
24758
+ }
24759
+ function compactDisplayTurn(displayTurn) {
24760
+ const working = displayTurn.working.map(pageNode);
24761
+ if (!displayTurn.final)
24762
+ return { ...displayTurn, working };
24763
+ return {
24764
+ ...displayTurn,
24765
+ working: working.map((node2) => node2.key === displayTurn.final?.key ? {
24766
+ ...node2,
24767
+ children: [],
24768
+ event: { ...node2.event, update: { ...node2.event.update, content: [] } }
24769
+ } : node2),
24770
+ final: pageNode(displayTurn.final)
24771
+ };
24772
+ }
24773
+ function compactConversationMessageTurns(turns, keepNewestEntries, includeStepOutputs = true) {
24721
24774
  return turns.map((turn, index) => ({
24722
24775
  ...turn,
24723
24776
  display: turn.display.map((displayTurn) => {
24724
- const working = displayTurn.working.map(pageNode);
24725
- if (!displayTurn.final)
24726
- return { ...displayTurn, working };
24727
- return {
24728
- ...displayTurn,
24729
- working: working.map((node2) => node2.key === displayTurn.final?.key ? {
24730
- ...node2,
24731
- children: [],
24732
- event: {
24733
- ...node2.event,
24734
- update: { ...node2.event.update, content: [] }
24735
- }
24736
- } : node2),
24737
- final: pageNode(displayTurn.final)
24738
- };
24777
+ const compacted = compactDisplayTurn(displayTurn);
24778
+ return includeStepOutputs ? compacted : withStepSummaries(compacted, turn.ordinal);
24739
24779
  }),
24740
24780
  state: {
24741
24781
  ...turn.state,
@@ -54179,7 +54219,7 @@ var require_websocket_server = __commonJS({
54179
54219
  // package.json
54180
54220
  var package_default = {
54181
54221
  name: "@alan-ai-hq/agent-manager",
54182
- version: "0.1.140",
54222
+ version: "0.1.142",
54183
54223
  private: true,
54184
54224
  type: "module",
54185
54225
  description: "Alan machine runtime (alan-agent): identity, link, reconciler, session holders, run log, uploader, local API",
@@ -58354,6 +58394,7 @@ async function writeDefinition(path4, contents, mode = 420) {
58354
58394
  await (0, import_promises21.mkdir)((0, import_node_path18.dirname)(path4), { recursive: true });
58355
58395
  const staged = `${path4}.${process.pid}.tmp`;
58356
58396
  await (0, import_promises21.writeFile)(staged, contents, { mode });
58397
+ await (0, import_promises21.chmod)(staged, mode);
58357
58398
  await (0, import_promises21.rename)(staged, path4);
58358
58399
  return true;
58359
58400
  }
@@ -58607,7 +58648,7 @@ function xdgAutostartManager(host, profile) {
58607
58648
  const scriptChanged = await writeDefinition(
58608
58649
  files.script,
58609
58650
  renderSupervisorScript(spec, files),
58610
- 493
58651
+ 448
58611
58652
  );
58612
58653
  const entryChanged = await writeDefinition(files.entry, renderAutostartEntry(spec, files));
58613
58654
  const changed = scriptChanged || entryChanged;
@@ -66269,7 +66310,8 @@ function conversationQuery(query) {
66269
66310
  return {
66270
66311
  limit: String(query.limit),
66271
66312
  ...query.before ? { before: query.before } : {},
66272
- ...query.runtimeId ? { runtimeId: query.runtimeId } : {}
66313
+ ...query.runtimeId ? { runtimeId: query.runtimeId } : {},
66314
+ ...query.includeStepOutputs === false ? { includeStepOutputs: "false" } : {}
66273
66315
  };
66274
66316
  }
66275
66317
  function conversationUpdate(event) {
@@ -71658,7 +71700,7 @@ async function projectLocalRun(runsDir, runId, conversationId, ordinal) {
71658
71700
  _promise2 && await _promise2;
71659
71701
  }
71660
71702
  }
71661
- async function readLocalConversationMessages(runsDir, conversationId, limit, before, projection) {
71703
+ async function readLocalConversationMessages(runsDir, conversationId, limit, before, projection, includeStepOutputs = true) {
71662
71704
  const coverage = await readConversationIndexCoverage(runsDir, conversationId);
71663
71705
  if (coverage === null || before !== void 0 && before <= coverage.lowestOrdinal) return null;
71664
71706
  const indexed = (await readConversationRunIndex(runsDir, conversationId, before, limit + 1)).filter((entry) => entry.ordinal >= coverage.lowestOrdinal);
@@ -71681,7 +71723,7 @@ async function readLocalConversationMessages(runsDir, conversationId, limit, bef
71681
71723
  if (completeTurns.length === 0) return null;
71682
71724
  const oldestOrdinal = selected[completeTurns.length - 1].ordinal;
71683
71725
  return {
71684
- turns: compactConversationMessageTurns(completeTurns, before === void 0),
71726
+ turns: compactConversationMessageTurns(completeTurns, before === void 0, includeStepOutputs),
71685
71727
  before: oldestOrdinal === 0 ? null : String(oldestOrdinal),
71686
71728
  revision: `local-${selected[0].runId}`,
71687
71729
  streamCursor: ""
@@ -71757,7 +71799,7 @@ async function writeChangedTurn(writer, runId, read) {
71757
71799
  dataLines: [data]
71758
71800
  });
71759
71801
  }
71760
- async function streamLocalConversationMessages(deps, conversationId, limit, frames, res, signal) {
71802
+ async function streamLocalConversationMessages(deps, conversationId, limit, frames, includeStepOutputs, res, signal) {
71761
71803
  var _stack = [];
71762
71804
  try {
71763
71805
  const bell = { pending: /* @__PURE__ */ new Set(), wake: void 0 };
@@ -71788,7 +71830,8 @@ async function streamLocalConversationMessages(deps, conversationId, limit, fram
71788
71830
  conversationId,
71789
71831
  limit,
71790
71832
  void 0,
71791
- slot.current ?? void 0
71833
+ slot.current ?? void 0,
71834
+ includeStepOutputs
71792
71835
  );
71793
71836
  if (!page) {
71794
71837
  sendError(res, 404, "not_found", "This computer has no complete local page");
@@ -72024,7 +72067,8 @@ var conversationMessagesQuerySchema = external_exports.object({
72024
72067
  limit: external_exports.coerce.number().int().min(1).max(100).default(10),
72025
72068
  before: external_exports.coerce.number().int().nonnegative().optional(),
72026
72069
  runtimeId: external_exports.string().uuid().optional(),
72027
- frames: external_exports.enum(["turn", "patch"]).default("turn")
72070
+ frames: external_exports.enum(["turn", "patch"]).default("turn"),
72071
+ includeStepOutputs: external_exports.enum(["true", "false"]).default("true")
72028
72072
  });
72029
72073
  var emptyBodySchema = external_exports.object({});
72030
72074
  function activeRunIds(runs) {
@@ -72268,6 +72312,7 @@ async function routeConversationMessages(deps, request2, conversationMatch) {
72268
72312
  conversationId.data,
72269
72313
  query.data.limit,
72270
72314
  query.data.frames,
72315
+ query.data.includeStepOutputs === "true",
72271
72316
  request2.res,
72272
72317
  request2.signal
72273
72318
  );
@@ -72275,7 +72320,9 @@ async function routeConversationMessages(deps, request2, conversationMatch) {
72275
72320
  deps.runsDir,
72276
72321
  conversationId.data,
72277
72322
  query.data.limit,
72278
- query.data.before
72323
+ query.data.before,
72324
+ void 0,
72325
+ query.data.includeStepOutputs === "true"
72279
72326
  );
72280
72327
  if (page === null) {
72281
72328
  sendError(request2.res, 404, "not_found", "This computer has no complete local page");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alan-ai-hq/agent-manager-darwin-arm64",
3
- "version": "0.1.140",
3
+ "version": "0.1.142",
4
4
  "description": "Alan machine runtime (alan-agent) for one platform: the official Node.js binary, the runtime bundle and its launcher. Installed by @alan-ai-hq/agent-manager.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://tryalan.ai",