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

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 +70 -24
  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.141",
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",
@@ -66269,7 +66309,8 @@ function conversationQuery(query) {
66269
66309
  return {
66270
66310
  limit: String(query.limit),
66271
66311
  ...query.before ? { before: query.before } : {},
66272
- ...query.runtimeId ? { runtimeId: query.runtimeId } : {}
66312
+ ...query.runtimeId ? { runtimeId: query.runtimeId } : {},
66313
+ ...query.includeStepOutputs === false ? { includeStepOutputs: "false" } : {}
66273
66314
  };
66274
66315
  }
66275
66316
  function conversationUpdate(event) {
@@ -71658,7 +71699,7 @@ async function projectLocalRun(runsDir, runId, conversationId, ordinal) {
71658
71699
  _promise2 && await _promise2;
71659
71700
  }
71660
71701
  }
71661
- async function readLocalConversationMessages(runsDir, conversationId, limit, before, projection) {
71702
+ async function readLocalConversationMessages(runsDir, conversationId, limit, before, projection, includeStepOutputs = true) {
71662
71703
  const coverage = await readConversationIndexCoverage(runsDir, conversationId);
71663
71704
  if (coverage === null || before !== void 0 && before <= coverage.lowestOrdinal) return null;
71664
71705
  const indexed = (await readConversationRunIndex(runsDir, conversationId, before, limit + 1)).filter((entry) => entry.ordinal >= coverage.lowestOrdinal);
@@ -71681,7 +71722,7 @@ async function readLocalConversationMessages(runsDir, conversationId, limit, bef
71681
71722
  if (completeTurns.length === 0) return null;
71682
71723
  const oldestOrdinal = selected[completeTurns.length - 1].ordinal;
71683
71724
  return {
71684
- turns: compactConversationMessageTurns(completeTurns, before === void 0),
71725
+ turns: compactConversationMessageTurns(completeTurns, before === void 0, includeStepOutputs),
71685
71726
  before: oldestOrdinal === 0 ? null : String(oldestOrdinal),
71686
71727
  revision: `local-${selected[0].runId}`,
71687
71728
  streamCursor: ""
@@ -71757,7 +71798,7 @@ async function writeChangedTurn(writer, runId, read) {
71757
71798
  dataLines: [data]
71758
71799
  });
71759
71800
  }
71760
- async function streamLocalConversationMessages(deps, conversationId, limit, frames, res, signal) {
71801
+ async function streamLocalConversationMessages(deps, conversationId, limit, frames, includeStepOutputs, res, signal) {
71761
71802
  var _stack = [];
71762
71803
  try {
71763
71804
  const bell = { pending: /* @__PURE__ */ new Set(), wake: void 0 };
@@ -71788,7 +71829,8 @@ async function streamLocalConversationMessages(deps, conversationId, limit, fram
71788
71829
  conversationId,
71789
71830
  limit,
71790
71831
  void 0,
71791
- slot.current ?? void 0
71832
+ slot.current ?? void 0,
71833
+ includeStepOutputs
71792
71834
  );
71793
71835
  if (!page) {
71794
71836
  sendError(res, 404, "not_found", "This computer has no complete local page");
@@ -72024,7 +72066,8 @@ var conversationMessagesQuerySchema = external_exports.object({
72024
72066
  limit: external_exports.coerce.number().int().min(1).max(100).default(10),
72025
72067
  before: external_exports.coerce.number().int().nonnegative().optional(),
72026
72068
  runtimeId: external_exports.string().uuid().optional(),
72027
- frames: external_exports.enum(["turn", "patch"]).default("turn")
72069
+ frames: external_exports.enum(["turn", "patch"]).default("turn"),
72070
+ includeStepOutputs: external_exports.enum(["true", "false"]).default("true")
72028
72071
  });
72029
72072
  var emptyBodySchema = external_exports.object({});
72030
72073
  function activeRunIds(runs) {
@@ -72268,6 +72311,7 @@ async function routeConversationMessages(deps, request2, conversationMatch) {
72268
72311
  conversationId.data,
72269
72312
  query.data.limit,
72270
72313
  query.data.frames,
72314
+ query.data.includeStepOutputs === "true",
72271
72315
  request2.res,
72272
72316
  request2.signal
72273
72317
  );
@@ -72275,7 +72319,9 @@ async function routeConversationMessages(deps, request2, conversationMatch) {
72275
72319
  deps.runsDir,
72276
72320
  conversationId.data,
72277
72321
  query.data.limit,
72278
- query.data.before
72322
+ query.data.before,
72323
+ void 0,
72324
+ query.data.includeStepOutputs === "true"
72279
72325
  );
72280
72326
  if (page === null) {
72281
72327
  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.141",
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",