priiisk 0.1.20 → 0.1.21

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.
@@ -22394,13 +22394,13 @@ var require_headers = __commonJS({
22394
22394
  return headersList.sortedMap;
22395
22395
  }
22396
22396
  const headers = [];
22397
- const names = headersList.toSortedArray();
22397
+ const names2 = headersList.toSortedArray();
22398
22398
  const cookies = headersList.cookies;
22399
22399
  if (cookies === null || cookies.length === 1) {
22400
- return headersList.sortedMap = names;
22400
+ return headersList.sortedMap = names2;
22401
22401
  }
22402
- for (let i = 0; i < names.length; ++i) {
22403
- const { 0: name, 1: value5 } = names[i];
22402
+ for (let i = 0; i < names2.length; ++i) {
22403
+ const { 0: name, 1: value5 } = names2[i];
22404
22404
  if (name === "set-cookie") {
22405
22405
  for (let j = 0; j < cookies.length; ++j) {
22406
22406
  headers.push([name, cookies[j]]);
@@ -29363,10 +29363,10 @@ var require_code = __commonJS({
29363
29363
  }
29364
29364
  get names() {
29365
29365
  var _a3;
29366
- return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names, c) => {
29366
+ return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names2, c) => {
29367
29367
  if (c instanceof Name)
29368
- names[c.str] = (names[c.str] || 0) + 1;
29369
- return names;
29368
+ names2[c.str] = (names2[c.str] || 0) + 1;
29369
+ return names2;
29370
29370
  }, {});
29371
29371
  }
29372
29372
  };
@@ -29692,11 +29692,11 @@ var require_codegen = __commonJS({
29692
29692
  const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
29693
29693
  return `${varKind} ${this.name}${rhs};` + _n;
29694
29694
  }
29695
- optimizeNames(names, constants3) {
29696
- if (!names[this.name.str])
29695
+ optimizeNames(names2, constants3) {
29696
+ if (!names2[this.name.str])
29697
29697
  return;
29698
29698
  if (this.rhs)
29699
- this.rhs = optimizeExpr(this.rhs, names, constants3);
29699
+ this.rhs = optimizeExpr(this.rhs, names2, constants3);
29700
29700
  return this;
29701
29701
  }
29702
29702
  get names() {
@@ -29713,15 +29713,15 @@ var require_codegen = __commonJS({
29713
29713
  render({ _n }) {
29714
29714
  return `${this.lhs} = ${this.rhs};` + _n;
29715
29715
  }
29716
- optimizeNames(names, constants3) {
29717
- if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
29716
+ optimizeNames(names2, constants3) {
29717
+ if (this.lhs instanceof code_1.Name && !names2[this.lhs.str] && !this.sideEffects)
29718
29718
  return;
29719
- this.rhs = optimizeExpr(this.rhs, names, constants3);
29719
+ this.rhs = optimizeExpr(this.rhs, names2, constants3);
29720
29720
  return this;
29721
29721
  }
29722
29722
  get names() {
29723
- const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
29724
- return addExprNames(names, this.rhs);
29723
+ const names2 = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
29724
+ return addExprNames(names2, this.rhs);
29725
29725
  }
29726
29726
  };
29727
29727
  var AssignOp = class extends Assign {
@@ -29777,8 +29777,8 @@ var require_codegen = __commonJS({
29777
29777
  optimizeNodes() {
29778
29778
  return `${this.code}` ? this : void 0;
29779
29779
  }
29780
- optimizeNames(names, constants3) {
29781
- this.code = optimizeExpr(this.code, names, constants3);
29780
+ optimizeNames(names2, constants3) {
29781
+ this.code = optimizeExpr(this.code, names2, constants3);
29782
29782
  return this;
29783
29783
  }
29784
29784
  get names() {
@@ -29807,20 +29807,20 @@ var require_codegen = __commonJS({
29807
29807
  }
29808
29808
  return nodes.length > 0 ? this : void 0;
29809
29809
  }
29810
- optimizeNames(names, constants3) {
29810
+ optimizeNames(names2, constants3) {
29811
29811
  const { nodes } = this;
29812
29812
  let i = nodes.length;
29813
29813
  while (i--) {
29814
29814
  const n = nodes[i];
29815
- if (n.optimizeNames(names, constants3))
29815
+ if (n.optimizeNames(names2, constants3))
29816
29816
  continue;
29817
- subtractNames(names, n.names);
29817
+ subtractNames(names2, n.names);
29818
29818
  nodes.splice(i, 1);
29819
29819
  }
29820
29820
  return nodes.length > 0 ? this : void 0;
29821
29821
  }
29822
29822
  get names() {
29823
- return this.nodes.reduce((names, n) => addNames(names, n.names), {});
29823
+ return this.nodes.reduce((names2, n) => addNames(names2, n.names), {});
29824
29824
  }
29825
29825
  };
29826
29826
  var BlockNode = class extends ParentNode2 {
@@ -29865,20 +29865,20 @@ var require_codegen = __commonJS({
29865
29865
  return void 0;
29866
29866
  return this;
29867
29867
  }
29868
- optimizeNames(names, constants3) {
29868
+ optimizeNames(names2, constants3) {
29869
29869
  var _a3;
29870
- this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants3);
29871
- if (!(super.optimizeNames(names, constants3) || this.else))
29870
+ this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names2, constants3);
29871
+ if (!(super.optimizeNames(names2, constants3) || this.else))
29872
29872
  return;
29873
- this.condition = optimizeExpr(this.condition, names, constants3);
29873
+ this.condition = optimizeExpr(this.condition, names2, constants3);
29874
29874
  return this;
29875
29875
  }
29876
29876
  get names() {
29877
- const names = super.names;
29878
- addExprNames(names, this.condition);
29877
+ const names2 = super.names;
29878
+ addExprNames(names2, this.condition);
29879
29879
  if (this.else)
29880
- addNames(names, this.else.names);
29881
- return names;
29880
+ addNames(names2, this.else.names);
29881
+ return names2;
29882
29882
  }
29883
29883
  };
29884
29884
  If.kind = "if";
@@ -29893,10 +29893,10 @@ var require_codegen = __commonJS({
29893
29893
  render(opts) {
29894
29894
  return `for(${this.iteration})` + super.render(opts);
29895
29895
  }
29896
- optimizeNames(names, constants3) {
29897
- if (!super.optimizeNames(names, constants3))
29896
+ optimizeNames(names2, constants3) {
29897
+ if (!super.optimizeNames(names2, constants3))
29898
29898
  return;
29899
- this.iteration = optimizeExpr(this.iteration, names, constants3);
29899
+ this.iteration = optimizeExpr(this.iteration, names2, constants3);
29900
29900
  return this;
29901
29901
  }
29902
29902
  get names() {
@@ -29917,8 +29917,8 @@ var require_codegen = __commonJS({
29917
29917
  return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
29918
29918
  }
29919
29919
  get names() {
29920
- const names = addExprNames(super.names, this.from);
29921
- return addExprNames(names, this.to);
29920
+ const names2 = addExprNames(super.names, this.from);
29921
+ return addExprNames(names2, this.to);
29922
29922
  }
29923
29923
  };
29924
29924
  var ForIter = class extends For {
@@ -29932,10 +29932,10 @@ var require_codegen = __commonJS({
29932
29932
  render(opts) {
29933
29933
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
29934
29934
  }
29935
- optimizeNames(names, constants3) {
29936
- if (!super.optimizeNames(names, constants3))
29935
+ optimizeNames(names2, constants3) {
29936
+ if (!super.optimizeNames(names2, constants3))
29937
29937
  return;
29938
- this.iterable = optimizeExpr(this.iterable, names, constants3);
29938
+ this.iterable = optimizeExpr(this.iterable, names2, constants3);
29939
29939
  return this;
29940
29940
  }
29941
29941
  get names() {
@@ -29977,20 +29977,20 @@ var require_codegen = __commonJS({
29977
29977
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
29978
29978
  return this;
29979
29979
  }
29980
- optimizeNames(names, constants3) {
29980
+ optimizeNames(names2, constants3) {
29981
29981
  var _a3, _b;
29982
- super.optimizeNames(names, constants3);
29983
- (_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants3);
29984
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants3);
29982
+ super.optimizeNames(names2, constants3);
29983
+ (_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names2, constants3);
29984
+ (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names2, constants3);
29985
29985
  return this;
29986
29986
  }
29987
29987
  get names() {
29988
- const names = super.names;
29988
+ const names2 = super.names;
29989
29989
  if (this.catch)
29990
- addNames(names, this.catch.names);
29990
+ addNames(names2, this.catch.names);
29991
29991
  if (this.finally)
29992
- addNames(names, this.finally.names);
29993
- return names;
29992
+ addNames(names2, this.finally.names);
29993
+ return names2;
29994
29994
  }
29995
29995
  };
29996
29996
  var Catch = class extends BlockNode {
@@ -30274,15 +30274,15 @@ var require_codegen = __commonJS({
30274
30274
  }
30275
30275
  };
30276
30276
  exports.CodeGen = CodeGen;
30277
- function addNames(names, from) {
30277
+ function addNames(names2, from) {
30278
30278
  for (const n in from)
30279
- names[n] = (names[n] || 0) + (from[n] || 0);
30280
- return names;
30279
+ names2[n] = (names2[n] || 0) + (from[n] || 0);
30280
+ return names2;
30281
30281
  }
30282
- function addExprNames(names, from) {
30283
- return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
30282
+ function addExprNames(names2, from) {
30283
+ return from instanceof code_1._CodeOrName ? addNames(names2, from.names) : names2;
30284
30284
  }
30285
- function optimizeExpr(expr, names, constants3) {
30285
+ function optimizeExpr(expr, names2, constants3) {
30286
30286
  if (expr instanceof code_1.Name)
30287
30287
  return replaceName(expr);
30288
30288
  if (!canOptimize(expr))
@@ -30298,18 +30298,18 @@ var require_codegen = __commonJS({
30298
30298
  }, []));
30299
30299
  function replaceName(n) {
30300
30300
  const c = constants3[n.str];
30301
- if (c === void 0 || names[n.str] !== 1)
30301
+ if (c === void 0 || names2[n.str] !== 1)
30302
30302
  return n;
30303
- delete names[n.str];
30303
+ delete names2[n.str];
30304
30304
  return c;
30305
30305
  }
30306
30306
  function canOptimize(e) {
30307
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants3[c.str] !== void 0);
30307
+ return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names2[c.str] === 1 && constants3[c.str] !== void 0);
30308
30308
  }
30309
30309
  }
30310
- function subtractNames(names, from) {
30310
+ function subtractNames(names2, from) {
30311
30311
  for (const n in from)
30312
- names[n] = (names[n] || 0) - (from[n] || 0);
30312
+ names2[n] = (names2[n] || 0) - (from[n] || 0);
30313
30313
  }
30314
30314
  function not3(x) {
30315
30315
  return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par2(x)}`;
@@ -30507,7 +30507,7 @@ var require_names = __commonJS({
30507
30507
  "use strict";
30508
30508
  Object.defineProperty(exports, "__esModule", { value: true });
30509
30509
  var codegen_1 = require_codegen();
30510
- var names = {
30510
+ var names2 = {
30511
30511
  // validation function arguments
30512
30512
  data: new codegen_1.Name("data"),
30513
30513
  // data passed to validation function
@@ -30536,7 +30536,7 @@ var require_names = __commonJS({
30536
30536
  jsonLen: new codegen_1.Name("jsonLen"),
30537
30537
  jsonPart: new codegen_1.Name("jsonPart")
30538
30538
  };
30539
- exports.default = names;
30539
+ exports.default = names2;
30540
30540
  }
30541
30541
  });
30542
30542
 
@@ -62888,15 +62888,15 @@ var pick2 = (ast, keys6) => {
62888
62888
  switch (ast._tag) {
62889
62889
  case "TypeLiteral": {
62890
62890
  const pss = [];
62891
- const names = {};
62891
+ const names2 = {};
62892
62892
  for (const ps of ast.propertySignatures) {
62893
- names[ps.name] = null;
62893
+ names2[ps.name] = null;
62894
62894
  if (keys6.includes(ps.name)) {
62895
62895
  pss.push(ps);
62896
62896
  }
62897
62897
  }
62898
62898
  for (const key of keys6) {
62899
- if (!(key in names)) {
62899
+ if (!(key in names2)) {
62900
62900
  const ps = getTypeLiteralPropertySignature(ast, key);
62901
62901
  if (ps) {
62902
62902
  pss.push(ps);
@@ -79812,7 +79812,7 @@ var layerDotEnvAdd2 = layerDotEnvAdd;
79812
79812
  var layerDotEnv2 = layerDotEnv;
79813
79813
 
79814
79814
  // packages/config/src/loaders/mcpCredentials.ts
79815
- var loadReferencedMcpCredentials = (fs, names) => gen2(function* () {
79815
+ var loadReferencedMcpCredentials = (fs, names2) => gen2(function* () {
79816
79816
  const credentialsPath = yield* resolveCredentialsPath;
79817
79817
  const exists4 = yield* fs.exists(credentialsPath).pipe(
79818
79818
  mapError2(
@@ -79822,7 +79822,7 @@ var loadReferencedMcpCredentials = (fs, names) => gen2(function* () {
79822
79822
  })
79823
79823
  )
79824
79824
  );
79825
- if (!exists4 || names.length === 0) return {};
79825
+ if (!exists4 || names2.length === 0) return {};
79826
79826
  const provider = yield* PlatformConfigProvider_exports.fromDotEnv(credentialsPath).pipe(
79827
79827
  provideService2(FileSystem_exports.FileSystem, fs),
79828
79828
  mapError2(
@@ -79833,7 +79833,7 @@ var loadReferencedMcpCredentials = (fs, names) => gen2(function* () {
79833
79833
  )
79834
79834
  );
79835
79835
  return yield* forEach9(
79836
- names,
79836
+ names2,
79837
79837
  (name) => gen2(function* () {
79838
79838
  const value5 = yield* string3(name).pipe(
79839
79839
  option4,
@@ -81153,6 +81153,32 @@ var resolveDirectTools = (config3, role, override) => {
81153
81153
  return { tools, unknownBins };
81154
81154
  };
81155
81155
 
81156
+ // packages/config/src/resolvers/equipmentDescription.ts
81157
+ var names = (values4) => values4.length === 0 ? "none" : values4.join(", ");
81158
+ var mcpGrants = (equipment) => names(
81159
+ equipment.mcp.serverNames.map((serverName) => {
81160
+ const toolNames = equipment.mcp.toolNamesByServer?.[serverName];
81161
+ return toolNames === void 0 ? serverName : `${serverName} (${names(toolNames)})`;
81162
+ })
81163
+ );
81164
+ var equipmentDescriptionLines = (equipment, revision) => [
81165
+ `equipment r${String(revision)}: ${equipment.role ?? equipment.preset ?? "worker"}, ${equipment.readOnly ? "read-only" : "read/write"}`,
81166
+ `model: ${equipment.model ?? "default"}${equipment.thinkingLevel === void 0 ? "" : `, thinking ${equipment.thinkingLevel}`}`,
81167
+ `tools: ${names(
81168
+ [
81169
+ .../* @__PURE__ */ new Set([
81170
+ ...equipment.builtinTools,
81171
+ ...equipment.customToolNames.filter((name) => directToolBin(name) === void 0)
81172
+ ])
81173
+ ].sort()
81174
+ )}`,
81175
+ `direct: ${names(
81176
+ equipment.customToolNames.map((name) => directToolBin(name)).filter((bin) => bin !== void 0).sort()
81177
+ )}`,
81178
+ `mcp: ${mcpGrants(equipment)}`,
81179
+ `skills: ${names(equipment.skillNames)}`
81180
+ ];
81181
+
81156
81182
  // packages/config/src/resolvers/mcpConfigResolver.ts
81157
81183
  var dedupe4 = (items) => [...new Set(items)];
81158
81184
  var resolveServerNames = (config3, role, mcpOverride) => dedupe4(mcpOverride ?? (role !== void 0 ? config3?.roles?.[role]?.mcp ?? [] : []));
@@ -81177,11 +81203,11 @@ var collectEntryEnvRefs = (entry) => {
81177
81203
  const fromBearerTokenEnv = entry.bearerTokenEnv !== void 0 ? [entry.bearerTokenEnv] : [];
81178
81204
  return [...fromPatterns, ...fromBearerTokenEnv];
81179
81205
  };
81180
- var resolveNamedServers = (config3, names) => {
81206
+ var resolveNamedServers = (config3, names2) => {
81181
81207
  const catalog = config3?.mcpServers ?? {};
81182
81208
  const unknownServers = [];
81183
81209
  const servers = {};
81184
- for (const name of dedupe4(names)) {
81210
+ for (const name of dedupe4(names2)) {
81185
81211
  const entry = catalog[name];
81186
81212
  if (entry === void 0) unknownServers.push(name);
81187
81213
  else servers[name] = entry;
@@ -82127,7 +82153,7 @@ var HOST_BOOTSTRAP_ENVIRONMENT_NAMES = [
82127
82153
  ];
82128
82154
 
82129
82155
  // packages/camp-state/src/bootstrap/campHostVersion.ts
82130
- var PRIIISK_HOST_VERSION = "0.1.20";
82156
+ var PRIIISK_HOST_VERSION = "0.1.21";
82131
82157
 
82132
82158
  // packages/camp-state/src/bootstrap/campLaunch.ts
82133
82159
  var CampBootstrapError = class extends TaggedError("CampBootstrapError") {
@@ -86025,7 +86051,7 @@ var indexMcpTools = (revision, tools) => ({
86025
86051
  revision,
86026
86052
  tools: new Map(tools.map((tool) => [tool.name, tool]))
86027
86053
  });
86028
- var indexCustomTools = (revision, names) => ({ revision, names: new Set(names) });
86054
+ var indexCustomTools = (revision, names2) => ({ revision, names: new Set(names2) });
86029
86055
  var equippedHostTool = (equipped, tool) => ({
86030
86056
  ...tool,
86031
86057
  execute: async (toolCallId, parameters3, signal, onUpdate, context8) => {
@@ -86094,13 +86120,13 @@ var resolvePiSessionTools = (options2, runtime6, input, sessionRef, equipped, eq
86094
86120
  (metadata) => toPiToolDefinition(equippedMcpTool(equipped, metadata))
86095
86121
  )
86096
86122
  ];
86097
- const names = [
86123
+ const names2 = [
86098
86124
  ...input.equipment.builtinTools,
86099
86125
  ...hostTools.granted,
86100
86126
  ...input.mcpCatalog.map((metadata) => metadata.name).filter((name) => grantedMcp.has(name))
86101
86127
  ];
86102
86128
  const registered = customTools.map((tool) => tool.name);
86103
- return new Set(registered).size === registered.length ? succeed8({ customTools, names }) : fail9(toolsError(input, { reason: "duplicate_tool_name" }));
86129
+ return new Set(registered).size === registered.length ? succeed8({ customTools, names: names2 }) : fail9(toolsError(input, { reason: "duplicate_tool_name" }));
86104
86130
  })
86105
86131
  );
86106
86132
  };
@@ -98066,7 +98092,7 @@ var Client = class extends Protocol2 {
98066
98092
  };
98067
98093
 
98068
98094
  // packages/mcp-backend/src/connections/clientIdentity.ts
98069
- var backendVersion = "0.1.20";
98095
+ var backendVersion = "0.1.21";
98070
98096
 
98071
98097
  // packages/mcp-backend/src/connections/mcpFailure.ts
98072
98098
  var McpFailure = class extends TaggedError("McpFailure") {
@@ -99780,14 +99806,14 @@ var StreamableHTTPClientTransport = class {
99780
99806
  // packages/mcp-backend/src/secrets/secretResolution.ts
99781
99807
  var ENV_REFERENCE = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}|\$env:([A-Za-z_][A-Za-z0-9_]*)/g;
99782
99808
  var referencedEnvNames = (values4) => {
99783
- const names = /* @__PURE__ */ new Set();
99809
+ const names2 = /* @__PURE__ */ new Set();
99784
99810
  for (const value5 of values4) {
99785
99811
  for (const match16 of value5.matchAll(ENV_REFERENCE)) {
99786
99812
  const name = match16[1] ?? match16[2];
99787
- if (name !== void 0) names.add(name);
99813
+ if (name !== void 0) names2.add(name);
99788
99814
  }
99789
99815
  }
99790
- return names;
99816
+ return names2;
99791
99817
  };
99792
99818
  var interpolateEnv = (value5, secretEnv) => value5.replace(
99793
99819
  ENV_REFERENCE,
@@ -102610,6 +102636,7 @@ var makeInitialCampUiState = (snapshot, presentationNow = 0) => ({
102610
102636
  screen: CampUiScreen.camp,
102611
102637
  focusedSlotId: "roster",
102612
102638
  detailVisible: false,
102639
+ inventoryVisible: false,
102613
102640
  presentationNow,
102614
102641
  drafts: /* @__PURE__ */ new Map(),
102615
102642
  scrollOffsets: /* @__PURE__ */ new Map(),
@@ -102735,6 +102762,10 @@ var makeCampUiStore = (initial, presentationNow = 0) => gen2(function* () {
102735
102762
  if (state.detailVisible === detailVisible) return state;
102736
102763
  return { ...state, detailVisible };
102737
102764
  }),
102765
+ setInventoryVisible: (inventoryVisible) => updateState((state) => {
102766
+ if (state.inventoryVisible === inventoryVisible) return state;
102767
+ return { ...state, inventoryVisible };
102768
+ }),
102738
102769
  setDetailBlockExpanded: (blockId, expanded) => updateState((state) => ({
102739
102770
  ...state,
102740
102771
  expandedDetailBlockIds: updateCampUiStringSet(
@@ -102809,13 +102840,14 @@ var emptyCampUiComponent = {
102809
102840
  // packages/host-ui/src/composition/campUiSlots.ts
102810
102841
  var CampUiSlot = {
102811
102842
  campHeader: "camp-header",
102843
+ activity: "activity",
102844
+ equipment: "equipment",
102812
102845
  resources: "resources",
102813
102846
  roster: "roster",
102814
102847
  sessionHeader: "session-header",
102815
102848
  transcript: "transcript",
102816
102849
  composer: "composer",
102817
- campFooter: "camp-footer",
102818
- sessionFooter: "session-footer",
102850
+ footer: "footer",
102819
102851
  overlay: "overlay"
102820
102852
  };
102821
102853
  var CampUiContributionStrategy = {
@@ -102979,6 +103011,7 @@ var makeCampUiIntentHandler = (options2) => type2().pipe(
102979
103011
  }),
102980
103012
  SelectWorker: ({ workerId }) => options2.controller.selectWorker(workerId),
102981
103013
  SetDraft: ({ workerId, draft }) => options2.controller.setDraft(workerId, draft),
103014
+ SetInventoryVisible: ({ visible }) => options2.controller.setInventoryVisible(visible),
102982
103015
  SetScrollOffset: ({ workerId, offset }) => options2.controller.setScrollOffset(workerId, offset),
102983
103016
  SetTranscriptVisible: ({ visible }) => options2.controller.setDetailVisible(visible),
102984
103017
  Steer: ({ workerId, message }) => message.trim() === "" ? _void : options2.backend.steer({ workerId, message }).pipe(
@@ -103181,6 +103214,10 @@ var defaultCampUiLeftSectionSizes = {
103181
103214
  resources: { kind: CampUiSectionSizeKind.grow, weight: 1, minimumRows: 1 },
103182
103215
  workers: { kind: CampUiSectionSizeKind.grow, weight: 1, minimumRows: 1 }
103183
103216
  };
103217
+ var defaultCampUiRightSectionSizes = {
103218
+ activity: { kind: CampUiSectionSizeKind.grow, weight: 1, minimumRows: 2 },
103219
+ equipment: { kind: CampUiSectionSizeKind.fixed, rows: 7 }
103220
+ };
103184
103221
 
103185
103222
  // packages/host-ui/src/layout/campUiLayout.ts
103186
103223
  var CampUiLayoutMode = {
@@ -103195,10 +103232,18 @@ var leftSectionHeights = (bodyHeight, slots) => {
103195
103232
  const size14 = (slotId, fallback) => slots?.get(slotId)?.sectionSize ?? fallback;
103196
103233
  return allocateCampUiSectionRows(bodyHeight, [
103197
103234
  size14(CampUiSlot.campHeader, defaultCampUiLeftSectionSizes.camp),
103198
- size14(CampUiSlot.resources, defaultCampUiLeftSectionSizes.resources),
103199
103235
  size14(CampUiSlot.roster, defaultCampUiLeftSectionSizes.workers)
103200
103236
  ]);
103201
103237
  };
103238
+ var rightSectionHeights = (bodyHeight, width, slots) => {
103239
+ const minimumActivityRows = Math.min(units2(bodyHeight), 2);
103240
+ const fallback = defaultCampUiRightSectionSizes.equipment.rows;
103241
+ const preferred = units2(
103242
+ slots?.get(CampUiSlot.equipment)?.preferredRows?.(units2(width)) ?? fallback
103243
+ );
103244
+ const equipmentHeight = fixedRows(Math.max(0, bodyHeight - minimumActivityRows), preferred);
103245
+ return [Math.max(0, bodyHeight - equipmentHeight), equipmentHeight];
103246
+ };
103202
103247
  var composerHeight = (availableHeight, width, policy, slots) => {
103203
103248
  const maximum = units2(policy.composerMaximumHeight);
103204
103249
  const minimum = Math.min(maximum, units2(policy.composerMinimumHeight));
@@ -103212,7 +103257,7 @@ var makeNarrowFrame = (viewport, state, policy, slots) => {
103212
103257
  const bodyHeight = Math.max(0, viewport.height - footerHeight);
103213
103258
  const footerY = bodyHeight;
103214
103259
  const workerScreen = state.screen === CampUiScreen.worker && state.selectedWorkerId !== void 0;
103215
- const [campHeight = 0, resourcesHeight = 0, rosterHeight = 0] = workerScreen ? [] : leftSectionHeights(bodyHeight, slots);
103260
+ const [campHeight = 0, rosterHeight = 0] = workerScreen ? [] : leftSectionHeights(bodyHeight, slots);
103216
103261
  const sessionHeaderHeight = workerScreen ? fixedRows(bodyHeight, policy.sessionHeaderHeight) : 0;
103217
103262
  const inputHeight = workerScreen ? composerHeight(bodyHeight - sessionHeaderHeight, viewport.width, policy, slots) : 0;
103218
103263
  const transcriptHeight = workerScreen ? bodyHeight - sessionHeaderHeight - inputHeight : 0;
@@ -103221,8 +103266,7 @@ var makeNarrowFrame = (viewport, state, policy, slots) => {
103221
103266
  dividers: [],
103222
103267
  regions: compact2([
103223
103268
  region(CampUiSlot.campHeader, 0, 0, viewport.width, campHeight),
103224
- region(CampUiSlot.resources, 0, campHeight, viewport.width, resourcesHeight),
103225
- region(CampUiSlot.roster, 0, campHeight + resourcesHeight, viewport.width, rosterHeight),
103269
+ region(CampUiSlot.roster, 0, campHeight, viewport.width, rosterHeight),
103226
103270
  region(CampUiSlot.sessionHeader, 0, 0, viewport.width, sessionHeaderHeight),
103227
103271
  region(CampUiSlot.transcript, 0, sessionHeaderHeight, viewport.width, transcriptHeight),
103228
103272
  region(
@@ -103232,13 +103276,7 @@ var makeNarrowFrame = (viewport, state, policy, slots) => {
103232
103276
  viewport.width,
103233
103277
  inputHeight
103234
103278
  ),
103235
- region(
103236
- workerScreen ? CampUiSlot.sessionFooter : CampUiSlot.campFooter,
103237
- 0,
103238
- footerY,
103239
- viewport.width,
103240
- footerHeight
103241
- )
103279
+ region(CampUiSlot.footer, 0, footerY, viewport.width, footerHeight)
103242
103280
  ])
103243
103281
  };
103244
103282
  };
@@ -103272,6 +103310,11 @@ var makeWideFrame = (viewport, policy, slots) => {
103272
103310
  ]);
103273
103311
  const centerX2 = leftWidth + leftGap;
103274
103312
  const rightX = centerX2 + centerWidth + rightGap;
103313
+ const [activityHeight = 0, equipmentHeight = 0] = rightSectionHeights(
103314
+ bodyHeight,
103315
+ rightWidth,
103316
+ slots
103317
+ );
103275
103318
  const sessionHeaderHeight = fixedRows(bodyHeight, policy.sessionHeaderHeight);
103276
103319
  const inputHeight = composerHeight(bodyHeight - sessionHeaderHeight, centerWidth, policy, slots);
103277
103320
  const transcriptHeight = bodyHeight - sessionHeaderHeight - inputHeight;
@@ -103297,9 +103340,13 @@ var makeWideFrame = (viewport, policy, slots) => {
103297
103340
  centerWidth,
103298
103341
  inputHeight
103299
103342
  ),
103300
- region(CampUiSlot.resources, rightX, bodyY, rightWidth, bodyHeight),
103301
- region(CampUiSlot.campFooter, 0, footerY, leftWidth, footerHeight),
103302
- region(CampUiSlot.sessionFooter, centerX2, footerY, viewport.width - centerX2, footerHeight)
103343
+ region(CampUiSlot.activity, rightX, bodyY, rightWidth, activityHeight),
103344
+ region(CampUiSlot.equipment, rightX, bodyY + activityHeight, rightWidth, equipmentHeight),
103345
+ /*
103346
+ * One line across the whole width: two footers pinned to the corners split
103347
+ * along the track boundary and repeated what the worker cards already say.
103348
+ */
103349
+ region(CampUiSlot.footer, 0, footerY, viewport.width, footerHeight)
103303
103350
  ])
103304
103351
  };
103305
103352
  };
@@ -103392,7 +103439,6 @@ var jsonText = (value5) => {
103392
103439
  return String(value5);
103393
103440
  }
103394
103441
  };
103395
- var compactNumber = (value5) => new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 }).format(value5);
103396
103442
 
103397
103443
  // packages/host-ui/src/pi/shared/campUiVisual.ts
103398
103444
  var CampUiTone = {
@@ -103445,7 +103491,7 @@ var statePresentation = /* @__PURE__ */ new Map([
103445
103491
  ["idle", { tone: CampUiTone.neutral, glyph: CampUiGlyph.neutral }]
103446
103492
  ]);
103447
103493
  var styleCampUiTone = (tone, text4) => `${ansiByTone[tone]}${text4}\x1B[39m`;
103448
- var uniqueCampUiNames = (names) => [...new Set(names)].sort((left3, right3) => left3.localeCompare(right3));
103494
+ var uniqueCampUiNames = (names2) => [...new Set(names2)].sort((left3, right3) => left3.localeCompare(right3));
103449
103495
  var renderCampUiStatus = (label, tone, glyph = glyphByTone[tone]) => styleCampUiTone(tone, `${glyph} ${label}`);
103450
103496
  var renderCampUiState = (state) => {
103451
103497
  const presentation = statePresentation.get(state) ?? {
@@ -103793,50 +103839,12 @@ var makeCampUiComposerComponent = (context8, tui) => {
103793
103839
  import { getSelectListTheme as getSelectListTheme8 } from "@earendil-works/pi-coding-agent";
103794
103840
  import { Key as Key3, matchesKey as matchesKey2 } from "@earendil-works/pi-tui";
103795
103841
 
103796
- // packages/host-ui/src/pi/blocks/campUiEquipmentBlock.ts
103797
- import { getMarkdownTheme as getMarkdownTheme4, UserMessageComponent } from "@earendil-works/pi-coding-agent";
103798
- var escapeMarkdown = (value5) => value5.replaceAll(/([\\`*_[\]{}()#+.!|>])/gu, "\\$1");
103799
- var renderNames = (names) => names.length === 0 ? "none" : names.map(escapeMarkdown).join(", ");
103800
- var renderMcpServers = (equipment) => renderNames(
103801
- equipment.mcp.serverNames.map((serverName) => {
103802
- const toolNames = equipment.mcp.toolNamesByServer?.[serverName];
103803
- return toolNames === void 0 ? serverName : `${serverName} (${toolNames.join(", ")})`;
103804
- })
103805
- );
103806
- var equipmentMarkdown = (equipment) => {
103807
- const role = equipment.role ?? equipment.preset ?? "unknown";
103808
- const tools = [.../* @__PURE__ */ new Set([...equipment.builtinTools, ...equipment.customToolNames])].sort();
103809
- const lines3 = [
103810
- `**Equipment \xB7 ${escapeMarkdown(role)}**`,
103811
- "",
103812
- `- **Tools:** ${renderNames(tools)}`,
103813
- `- **MCP:** ${renderMcpServers(equipment)}`,
103814
- `- **Skills:** ${renderNames(equipment.skillNames)}`,
103815
- `- **Access:** ${equipment.readOnly ? "read-only" : "read/write"}`
103816
- ];
103817
- return lines3.join("\n");
103818
- };
103819
- var campUiEquipmentBlockRenderer = {
103820
- id: "role-equipment",
103821
- order: -100,
103822
- render: ({ worker, width }) => [
103823
- {
103824
- id: "role-equipment",
103825
- lines: new UserMessageComponent(
103826
- equipmentMarkdown(worker.snapshot.worker.equipment),
103827
- getMarkdownTheme4(),
103828
- 0
103829
- ).render(width)
103830
- }
103831
- ]
103832
- };
103833
-
103834
103842
  // packages/host-ui/src/pi/blocks/campUiTranscriptBlocks.ts
103835
- import { getMarkdownTheme as getMarkdownTheme7, UserMessageComponent as UserMessageComponent2 } from "@earendil-works/pi-coding-agent";
103843
+ import { getMarkdownTheme as getMarkdownTheme6, UserMessageComponent } from "@earendil-works/pi-coding-agent";
103836
103844
  import { Markdown as Markdown4 } from "@earendil-works/pi-tui";
103837
103845
 
103838
103846
  // packages/host-ui/src/pi/shared/campUiPanel.ts
103839
- import { getMarkdownTheme as getMarkdownTheme5, getSelectListTheme as getSelectListTheme5 } from "@earendil-works/pi-coding-agent";
103847
+ import { getMarkdownTheme as getMarkdownTheme4, getSelectListTheme as getSelectListTheme5 } from "@earendil-works/pi-coding-agent";
103840
103848
  import { truncateToWidth as truncateToWidth3, visibleWidth as visibleWidth2 } from "@earendil-works/pi-tui";
103841
103849
  var rule = (start5, label, width, borderColor, labelColor) => {
103842
103850
  const prefix = `${borderColor(`${start5}\u2500 `)}${labelColor(label)}${borderColor(" ")}`;
@@ -103845,7 +103853,7 @@ var rule = (start5, label, width, borderColor, labelColor) => {
103845
103853
  };
103846
103854
  var renderCampUiPanel = (label, body, width) => {
103847
103855
  if (width <= 0) return [];
103848
- const borderColor = getMarkdownTheme5().codeBlockBorder;
103856
+ const borderColor = getMarkdownTheme4().codeBlockBorder;
103849
103857
  const labelColor = getSelectListTheme5().selectedText;
103850
103858
  if (width === 1) {
103851
103859
  return [borderColor("\u2502"), ...body.map(() => borderColor("\u2502")), borderColor("\u2570")];
@@ -103985,7 +103993,7 @@ var renderCampUiExploredGroup = (reads, width, expanded) => {
103985
103993
 
103986
103994
  // packages/host-ui/src/pi/blocks/campUiToolResult.ts
103987
103995
  import {
103988
- getMarkdownTheme as getMarkdownTheme6,
103996
+ getMarkdownTheme as getMarkdownTheme5,
103989
103997
  getSelectListTheme as getSelectListTheme7,
103990
103998
  truncateToVisualLines
103991
103999
  } from "@earendil-works/pi-coding-agent";
@@ -104056,13 +104064,13 @@ var renderCampUiToolResult = (result, width, expanded) => {
104056
104064
  ]);
104057
104065
  }
104058
104066
  const content = toolResultContent(result, true);
104059
- const lines3 = content === "" ? [] : new Markdown3(content, 0, 0, getMarkdownTheme6()).render(boundedWidth);
104067
+ const lines3 = content === "" ? [] : new Markdown3(content, 0, 0, getMarkdownTheme5()).render(boundedWidth);
104060
104068
  return keep([
104061
104069
  ...lines3,
104062
104070
  ...result.errorMessage === void 0 ? [] : [getSelectListTheme7().noMatch(`Error: ${result.errorMessage}`)],
104063
104071
  ...result.toolResultDetails === void 0 ? [] : [
104064
104072
  getSelectListTheme7().description("Details"),
104065
- ...new Markdown3(jsonText(result.toolResultDetails), 0, 0, getMarkdownTheme6()).render(
104073
+ ...new Markdown3(jsonText(result.toolResultDetails), 0, 0, getMarkdownTheme5()).render(
104066
104074
  boundedWidth
104067
104075
  )
104068
104076
  ],
@@ -104109,7 +104117,7 @@ var renderMessage = (message, width) => {
104109
104117
  ] : [];
104110
104118
  return [
104111
104119
  ...attribution,
104112
- ...new UserMessageComponent2(markdown2, getMarkdownTheme7(), 0).render(width)
104120
+ ...new UserMessageComponent(markdown2, getMarkdownTheme6(), 0).render(width)
104113
104121
  ];
104114
104122
  }
104115
104123
  if (message.role === "assistant") {
@@ -104123,11 +104131,11 @@ var renderMessage = (message, width) => {
104123
104131
  const suffix = message.errorMessage === void 0 ? "" : `
104124
104132
 
104125
104133
  Error: ${message.errorMessage}`;
104126
- return new Markdown4(`${prefix}${markdown}${suffix}`, 0, 0, getMarkdownTheme7()).render(width);
104134
+ return new Markdown4(`${prefix}${markdown}${suffix}`, 0, 0, getMarkdownTheme6()).render(width);
104127
104135
  };
104128
- var renderMarkdown = (markdown, width) => new Markdown4(markdown, 0, 0, getMarkdownTheme7()).render(Math.max(1, width));
104129
- var firstStringArgument = (parameters3, names) => {
104130
- for (const name of names) {
104136
+ var renderMarkdown = (markdown, width) => new Markdown4(markdown, 0, 0, getMarkdownTheme6()).render(Math.max(1, width));
104137
+ var firstStringArgument = (parameters3, names2) => {
104138
+ for (const name of names2) {
104131
104139
  const value5 = parameters3[name];
104132
104140
  if (typeof value5 === "string" && value5.trim() !== "") return value5;
104133
104141
  }
@@ -104280,7 +104288,6 @@ var campUiTranscriptBlockRenderer = {
104280
104288
 
104281
104289
  // packages/host-ui/src/pi/blocks/campUiDetail.ts
104282
104290
  var defaultCampUiDetailBlockRenderers = [
104283
- campUiEquipmentBlockRenderer,
104284
104291
  campUiTranscriptBlockRenderer,
104285
104292
  campUiPendingAskBlockRenderer
104286
104293
  ];
@@ -104419,9 +104426,169 @@ var makeCampUiDetailComponent = (context8, registry2 = defaultCampUiDetailBlockR
104419
104426
  };
104420
104427
  };
104421
104428
 
104422
- // packages/host-ui/src/pi/layout/campUiChrome.ts
104429
+ // packages/host-ui/src/pi/layout/campUiActivity.ts
104423
104430
  import { getSelectListTheme as getSelectListTheme9 } from "@earendil-works/pi-coding-agent";
104424
- import { truncateToWidth as truncateToWidth4, visibleWidth as visibleWidth3 } from "@earendil-works/pi-tui";
104431
+ import { sliceByColumn, visibleWidth as visibleWidth3 } from "@earendil-works/pi-tui";
104432
+ var CampUiActivityAccess = {
104433
+ read: "read",
104434
+ edit: "edit",
104435
+ write: "write"
104436
+ };
104437
+ var accessByTool = /* @__PURE__ */ new Map([
104438
+ ["read", CampUiActivityAccess.read],
104439
+ ["edit", CampUiActivityAccess.edit],
104440
+ ["write", CampUiActivityAccess.write]
104441
+ ]);
104442
+ var accessRank = {
104443
+ read: 0,
104444
+ edit: 1,
104445
+ write: 2
104446
+ };
104447
+ var filePathArgument = (parameters3) => {
104448
+ for (const name of ["path", "file_path"]) {
104449
+ const value5 = parameters3[name];
104450
+ if (typeof value5 === "string" && value5.trim() !== "") return value5.trim();
104451
+ }
104452
+ return void 0;
104453
+ };
104454
+ var splitPath2 = (path) => {
104455
+ const separator = path.lastIndexOf("/");
104456
+ if (separator < 0) return { directory: ".", name: path };
104457
+ if (separator === 0) return { directory: "/", name: path.slice(1) || path };
104458
+ return { directory: path.slice(0, separator), name: path.slice(separator + 1) || path };
104459
+ };
104460
+ var collectCampUiActivityTree = (transcript) => {
104461
+ const directories = /* @__PURE__ */ new Map();
104462
+ const nodes = /* @__PURE__ */ new Map();
104463
+ for (const message of transcript) {
104464
+ for (const content of message.content) {
104465
+ if (content.kind !== "tool-call") continue;
104466
+ const access3 = accessByTool.get(content.toolName);
104467
+ if (access3 === void 0) continue;
104468
+ const path = filePathArgument(content.arguments);
104469
+ if (path === void 0) continue;
104470
+ const existing = nodes.get(path);
104471
+ if (existing !== void 0) {
104472
+ existing.count += 1;
104473
+ if (accessRank[access3] > accessRank[existing.access]) existing.access = access3;
104474
+ continue;
104475
+ }
104476
+ const { directory, name } = splitPath2(path);
104477
+ const node = { path, directory, name, access: access3, count: 1 };
104478
+ nodes.set(path, node);
104479
+ const group2 = directories.get(directory) ?? { path: directory, nodes: [] };
104480
+ if (!directories.has(directory)) directories.set(directory, group2);
104481
+ group2.nodes.push(node);
104482
+ }
104483
+ }
104484
+ return [...directories.values()].map((directory) => ({
104485
+ path: directory.path,
104486
+ nodes: directory.nodes.map((node) => ({ ...node }))
104487
+ }));
104488
+ };
104489
+ var CAMP_UI_ACTIVITY_MAX_VISIBLE_PATHS = 12;
104490
+ var ACTIVITY_COLUMNS_PER_VISIBLE_PATH = 4;
104491
+ var flattenedNodes = (tree) => tree.flatMap((directory) => directory.nodes);
104492
+ var renderedRowCount = (tree, selected, hidden) => {
104493
+ const directories = tree.filter(
104494
+ (directory) => directory.nodes.some((node) => selected.has(node))
104495
+ ).length;
104496
+ return selected.size + directories + (hidden > 0 ? 1 : 0);
104497
+ };
104498
+ var selectVisibleNodes2 = (tree, width, height) => {
104499
+ const nodes = flattenedNodes(tree);
104500
+ const selected = /* @__PURE__ */ new Set();
104501
+ const widthBudget = Math.max(
104502
+ 1,
104503
+ Math.floor(Math.max(0, width) / ACTIVITY_COLUMNS_PER_VISIBLE_PATH)
104504
+ );
104505
+ const nodeBudget = Math.min(CAMP_UI_ACTIVITY_MAX_VISIBLE_PATHS, widthBudget);
104506
+ const mutations = nodes.filter((node) => node.access !== CampUiActivityAccess.read);
104507
+ const reads = nodes.filter((node) => node.access === CampUiActivityAccess.read);
104508
+ const addVisible = (node) => {
104509
+ if (selected.size >= nodeBudget) return;
104510
+ const candidate = new Set(selected).add(node);
104511
+ const hidden = nodes.length - candidate.size;
104512
+ if (renderedRowCount(tree, candidate, hidden) <= Math.max(0, height)) selected.add(node);
104513
+ };
104514
+ for (const node of mutations) addVisible(node);
104515
+ if (mutations.some((node) => !selected.has(node))) return selected;
104516
+ for (const node of reads) addVisible(node);
104517
+ return selected;
104518
+ };
104519
+ var shortenTail = (value5, width) => {
104520
+ const available = Math.max(0, Math.floor(width));
104521
+ const valueWidth = visibleWidth3(value5);
104522
+ if (valueWidth <= available) return value5;
104523
+ if (available <= 0) return "";
104524
+ if (available === 1) return "\u2026";
104525
+ return `\u2026${sliceByColumn(value5, valueWidth - available + 1, available - 1, true)}`;
104526
+ };
104527
+ var accessPresentation = {
104528
+ read: { label: "read", glyph: "r", tone: CampUiTone.neutral },
104529
+ edit: { label: "edited", glyph: "~", tone: CampUiTone.attention },
104530
+ write: { label: "created", glyph: "+", tone: CampUiTone.success }
104531
+ };
104532
+ var nodeLine2 = (node, last5, width) => {
104533
+ const theme = getSelectListTheme9();
104534
+ const presentation = accessPresentation[node.access];
104535
+ const count4 = node.count > 1 ? ` \xD7${String(node.count)}` : "";
104536
+ const suffix = ` \xB7 ${presentation.label}${count4}`;
104537
+ const branch = last5 ? "\u2514\u2500" : "\u251C\u2500";
104538
+ const nameWidth = Math.max(1, width - visibleWidth3(`${branch} ${presentation.glyph} ${suffix}`));
104539
+ const name = shortenTail(node.name, nameWidth);
104540
+ return fitCampUiLine(
104541
+ `${theme.description(branch)} ${renderCampUiStatus(name, presentation.tone, presentation.glyph)}${theme.description(suffix)}`,
104542
+ width
104543
+ );
104544
+ };
104545
+ var hiddenSummary = (nodes) => {
104546
+ const parts2 = Object.values(CampUiActivityAccess).flatMap((access3) => {
104547
+ const count4 = nodes.filter((node) => node.access === access3).length;
104548
+ if (count4 === 0) return [];
104549
+ const label = accessPresentation[access3].label;
104550
+ return [`${String(count4)} ${label} ${count4 === 1 ? "path" : "paths"}`];
104551
+ });
104552
+ return `... ${parts2.join(" \xB7 ")} hidden`;
104553
+ };
104554
+ var renderCampUiActivityTree = (transcript, width, height) => {
104555
+ const theme = getSelectListTheme9();
104556
+ const tree = collectCampUiActivityTree(transcript);
104557
+ const nodes = flattenedNodes(tree);
104558
+ if (height <= 0) return [];
104559
+ if (nodes.length === 0) return [fitCampUiLine(theme.description("no file activity"), width)];
104560
+ const selected = selectVisibleNodes2(tree, width, height);
104561
+ const lines3 = [];
104562
+ for (const directory of tree) {
104563
+ const visible = directory.nodes.filter((node) => selected.has(node));
104564
+ if (visible.length === 0) continue;
104565
+ lines3.push(fitCampUiLine(theme.description(shortenTail(directory.path, width)), width));
104566
+ visible.forEach((node, index) => {
104567
+ lines3.push(nodeLine2(node, index === visible.length - 1, width));
104568
+ });
104569
+ }
104570
+ const hidden = nodes.filter((node) => !selected.has(node));
104571
+ if (hidden.length > 0) {
104572
+ lines3.push(fitCampUiLine(theme.description(hiddenSummary(hidden)), width));
104573
+ }
104574
+ return lines3;
104575
+ };
104576
+ var makeCampUiActivity = (context8) => ({
104577
+ render: (viewport) => {
104578
+ const model = context8.readModel();
104579
+ const workerId = model.state.selectedWorkerId;
104580
+ const worker = workerId === void 0 ? void 0 : findCampUiWorker(model.snapshot, workerId);
104581
+ return renderCampUiActivityTree(
104582
+ worker?.snapshot.session?.transcript ?? [],
104583
+ viewport.width,
104584
+ viewport.height
104585
+ );
104586
+ }
104587
+ });
104588
+
104589
+ // packages/host-ui/src/pi/layout/campUiChrome.ts
104590
+ import { getSelectListTheme as getSelectListTheme10 } from "@earendil-works/pi-coding-agent";
104591
+ import { truncateToWidth as truncateToWidth4, visibleWidth as visibleWidth4 } from "@earendil-works/pi-tui";
104425
104592
 
104426
104593
  // packages/host-ui/src/pi/shared/campUiPulse.ts
104427
104594
  var BRAILLE_BASE = 10240;
@@ -104513,7 +104680,7 @@ var campUiLevelMarkerText = (level, color) => level === CampUiLevel.resting ? le
104513
104680
  var makeCampUiCampHeader = (context8) => ({
104514
104681
  render: (viewport) => {
104515
104682
  const snapshot = context8.readModel().snapshot;
104516
- const theme = getSelectListTheme9();
104683
+ const theme = getSelectListTheme10();
104517
104684
  const mode = snapshot.placement === "external" ? "agentless" : "foreman";
104518
104685
  return [
104519
104686
  fitCampUiLine(theme.description(snapshot.displayName), viewport.width),
@@ -104534,7 +104701,7 @@ var rosterWidths = (width) => {
104534
104701
  };
104535
104702
  var rightColumn = (text4, width) => {
104536
104703
  const fitted = truncateToWidth4(text4, width);
104537
- return `${" ".repeat(Math.max(0, width - visibleWidth3(fitted)))}${fitted}`;
104704
+ return `${" ".repeat(Math.max(0, width - visibleWidth4(fitted)))}${fitted}`;
104538
104705
  };
104539
104706
  var pulseSamples = (timestamps, sampleCount, now2) => {
104540
104707
  if (sampleCount <= 0) return [];
@@ -104564,13 +104731,13 @@ var usageText = (entry, width) => {
104564
104731
  const cache = usage?.latestCacheHitRate === void 0 ? usage === void 0 || usage.tokens.total === 0 ? "n/a" : "n/r" : percentText(usage.latestCacheHitRate);
104565
104732
  const cost = usage === void 0 ? "\u2014" : `$${usage.cost.toFixed(3)}`;
104566
104733
  const full = `${context8} ${cache} ${cost}`;
104567
- if (visibleWidth3(full) <= width || usage === void 0) return full;
104734
+ if (visibleWidth4(full) <= width || usage === void 0) return full;
104568
104735
  const compactCost = `$${usage.cost.toFixed(2).replace(/^0/u, "")}`;
104569
104736
  return `${context8}${cache}${compactCost}`;
104570
104737
  };
104571
104738
  var stateText = (state, duration5, width) => {
104572
104739
  const full = `${state} ${duration5}`;
104573
- return visibleWidth3(full) <= width ? full : state;
104740
+ return visibleWidth4(full) <= width ? full : state;
104574
104741
  };
104575
104742
  var modelText = (entry) => {
104576
104743
  const model = entry.snapshot.session?.usage?.model ?? entry.snapshot.worker.equipment.model;
@@ -104651,7 +104818,7 @@ var makeCampUiRoster = (context8) => ({
104651
104818
  const model = context8.readModel();
104652
104819
  const external = model.snapshot.placement === CampUiPlacement.external;
104653
104820
  if (model.snapshot.workers.length === 0 && !external) {
104654
- return [getSelectListTheme9().description("No workers")];
104821
+ return [getSelectListTheme10().description("No workers")];
104655
104822
  }
104656
104823
  const controller = external ? renderExternalControllerCard(model.snapshot.controllerConnected, viewport.width) : [];
104657
104824
  const workers = model.snapshot.workers.flatMap((entry) => {
@@ -104686,7 +104853,7 @@ var makeCampUiRoster = (context8) => ({
104686
104853
  var makeCampUiSessionHeader = (context8) => ({
104687
104854
  render: (viewport) => {
104688
104855
  const model = context8.readModel();
104689
- const theme = getSelectListTheme9();
104856
+ const theme = getSelectListTheme10();
104690
104857
  const workerId = model.state.selectedWorkerId;
104691
104858
  if (workerId === void 0) {
104692
104859
  return [fitCampUiLine(theme.description("Select a worker"), viewport.width)];
@@ -104707,29 +104874,63 @@ var makeCampUiSessionHeader = (context8) => ({
104707
104874
  ] : []
104708
104875
  });
104709
104876
 
104710
- // packages/host-ui/src/pi/layout/campUiFooter.ts
104711
- import { getMarkdownTheme as getMarkdownTheme8, getSelectListTheme as getSelectListTheme10 } from "@earendil-works/pi-coding-agent";
104712
- var aggregateCampUsage = (workers) => {
104713
- const usages = workers.flatMap(
104714
- (worker) => worker.snapshot.session?.usage === void 0 ? [] : [worker.snapshot.session.usage]
104877
+ // packages/host-ui/src/pi/layout/campUiEquipment.ts
104878
+ import { getSelectListTheme as getSelectListTheme11 } from "@earendil-works/pi-coding-agent";
104879
+ import { wrapTextWithAnsi } from "@earendil-works/pi-tui";
104880
+ var fullEquipmentLines = (equipment, revision, width) => {
104881
+ if (width <= 0) return [];
104882
+ const theme = getSelectListTheme11();
104883
+ return equipmentDescriptionLines(equipment, revision).flatMap(
104884
+ (line) => wrapTextWithAnsi(theme.description(line), width).map(
104885
+ (wrapped) => fitCampUiLine(wrapped, width)
104886
+ )
104887
+ );
104888
+ };
104889
+ var renderCampUiEquipment = (equipment, revision, width, height) => {
104890
+ const lines3 = fullEquipmentLines(equipment, revision, width);
104891
+ const available = Math.max(0, Math.floor(height));
104892
+ if (available === 0 || lines3.length === 0) return [];
104893
+ if (lines3.length <= available) return lines3;
104894
+ const shown = lines3.slice(0, Math.max(0, available - 1));
104895
+ const hidden = lines3.length - shown.length;
104896
+ const summary5 = getSelectListTheme11().description(
104897
+ `... ${String(hidden)} equipment ${hidden === 1 ? "line" : "lines"} hidden`
104715
104898
  );
104899
+ return [...shown, fitCampUiLine(summary5, width)];
104900
+ };
104901
+ var makeCampUiEquipment = (context8) => {
104902
+ const selectedWorker = () => {
104903
+ const model = context8.readModel();
104904
+ const workerId = model.state.selectedWorkerId;
104905
+ return workerId === void 0 ? void 0 : findCampUiWorker(model.snapshot, workerId);
104906
+ };
104907
+ const fullLines = (width) => {
104908
+ const worker = selectedWorker();
104909
+ return worker === void 0 ? [fitCampUiLine(getSelectListTheme11().description("no worker selected"), width)] : fullEquipmentLines(
104910
+ worker.snapshot.worker.equipment,
104911
+ worker.snapshot.worker.equipmentVersion,
104912
+ width
104913
+ );
104914
+ };
104716
104915
  return {
104717
- cost: usages.reduce((total, usage) => total + usage.cost, 0),
104718
- reportedWorkers: usages.length,
104719
- tokens: usages.reduce((total, usage) => total + usage.tokens.total, 0),
104720
- totalWorkers: workers.length
104916
+ preferredRows: (width) => fullLines(width).length,
104917
+ render: (viewport) => {
104918
+ const worker = selectedWorker();
104919
+ if (worker === void 0) return fullLines(viewport.width).slice(0, viewport.height);
104920
+ return renderCampUiEquipment(
104921
+ worker.snapshot.worker.equipment,
104922
+ worker.snapshot.worker.equipmentVersion,
104923
+ viewport.width,
104924
+ viewport.height
104925
+ );
104926
+ }
104721
104927
  };
104722
104928
  };
104723
- var aggregateUsageText = (usage) => {
104724
- const partial4 = usage.reportedWorkers < usage.totalWorkers;
104725
- const coverage = partial4 ? ` \xB7 ${usage.reportedWorkers}/${usage.totalWorkers} reported` : "";
104726
- if (usage.totalWorkers > 0 && usage.reportedWorkers === 0) {
104727
- return `tokens unknown \xB7 cost unknown${coverage}`;
104728
- }
104729
- const lowerBound = partial4 ? "\u2265" : "";
104730
- return `\u2193 ${lowerBound}${compactNumber(usage.tokens)} tokens \xB7 ${lowerBound}$${usage.cost.toFixed(3)}${coverage}`;
104731
- };
104732
- var footerDivider = (width) => fitCampUiLine(getMarkdownTheme8().codeBlockBorder("\u2500".repeat(width)), width);
104929
+
104930
+ // packages/host-ui/src/pi/layout/campUiFooter.ts
104931
+ import { getMarkdownTheme as getMarkdownTheme7, getSelectListTheme as getSelectListTheme12 } from "@earendil-works/pi-coding-agent";
104932
+ import { sliceByColumn as sliceByColumn2, visibleWidth as visibleWidth5 } from "@earendil-works/pi-tui";
104933
+ var footerDivider = (width) => fitCampUiLine(getMarkdownTheme7().codeBlockBorder("\u2500".repeat(width)), width);
104733
104934
  var retryText = (retryAt, attempt, now2) => {
104734
104935
  if (retryAt === void 0) return attempt === void 0 ? "" : `attempt ${String(attempt)}`;
104735
104936
  const seconds2 = Math.max(0, Math.ceil((retryAt - now2) / 1e3));
@@ -104740,56 +104941,73 @@ var diagnosticText = (value5) => {
104740
104941
  const normalized = value5?.replaceAll(/\s+/gu, " ").trim();
104741
104942
  return normalized === "" ? void 0 : normalized;
104742
104943
  };
104743
- var makeCampUiCampFooter = (context8) => ({
104944
+ var workerCountText = (workers) => {
104945
+ if (workers.length === 0) return "no workers";
104946
+ const working = workers.filter(
104947
+ (worker) => worker.snapshot.worker.state === CampWorkerState.running
104948
+ ).length;
104949
+ const waiting = workers.filter((worker) => worker.asks.some(isPendingAsk)).length;
104950
+ const parts2 = [
104951
+ `${String(workers.length)} ${workers.length === 1 ? "worker" : "workers"}`,
104952
+ ...working === 0 ? [] : [`${String(working)} working`],
104953
+ ...waiting === 0 ? [] : [`${String(waiting)} waiting`]
104954
+ ];
104955
+ return parts2.join(" \xB7 ");
104956
+ };
104957
+ var isPendingAsk = (ask) => ask.state === "pending";
104958
+ var shortenPath = (value5, width) => {
104959
+ const available = Math.max(0, Math.floor(width));
104960
+ if (available <= 0) return "";
104961
+ if (visibleWidth5(value5) <= available) return value5;
104962
+ if (available === 1) return "\u2026";
104963
+ const kept = available - 1;
104964
+ return `\u2026${sliceByColumn2(value5, visibleWidth5(value5) - kept, kept, true)}`;
104965
+ };
104966
+ var makeCampUiFooter = (context8) => ({
104744
104967
  render: (viewport) => {
104745
104968
  const model = context8.readModel();
104746
- const theme = getSelectListTheme10();
104747
- const health = model.snapshot.health;
104748
- const usage = aggregateUsageText(aggregateCampUsage(model.snapshot.workers));
104969
+ const theme = getSelectListTheme12();
104970
+ const snapshot = model.snapshot;
104971
+ const health = snapshot.health;
104749
104972
  const actionError = diagnosticText(model.state.lastActionError);
104750
104973
  const healthSummary = diagnosticText(health.message);
104751
104974
  const healthMessage = health.code === void 0 ? healthSummary : healthSummary === void 0 ? health.code : `${health.code} \xB7 ${healthSummary}`;
104752
104975
  const healthTone = health.status === CampUiHealthStatus.failed ? CampUiTone.error : CampUiTone.attention;
104753
- const diagnostic = actionError !== void 0 ? `${renderCampUiStatus("action error", CampUiTone.error)} ${theme.description(`\xB7 ${actionError}`)}` : healthMessage !== void 0 ? styleCampUiTone(healthTone, healthMessage) : health.status === CampUiHealthStatus.ready ? "" : renderCampUiStatus(health.status, healthTone);
104754
104976
  const retry5 = retryText(health.retryAt, health.attempt, model.state.presentationNow);
104755
- return [
104756
- footerDivider(viewport.width),
104757
- joinCampUiColumns(diagnostic, theme.description(usage), viewport.width),
104758
- fitCampUiLine(retry5 === "" ? "" : theme.description(retry5), viewport.width)
104977
+ const diagnostic = actionError !== void 0 ? `${renderCampUiStatus("action error", CampUiTone.error)} ${theme.description(`\xB7 ${actionError}`)}` : healthMessage !== void 0 ? styleCampUiTone(healthTone, healthMessage) : health.status === CampUiHealthStatus.ready ? "" : renderCampUiStatus(health.status, healthTone);
104978
+ const branch = snapshot.projectBranch === null ? "" : ` \xB7 ${snapshot.projectBranch}`;
104979
+ const version2 = `v${snapshot.hostVersion}`;
104980
+ const candidates = [
104981
+ { right: [workerCountText(snapshot.workers), version2, retry5], branch },
104982
+ { right: [workerCountText(snapshot.workers), version2], branch },
104983
+ { right: [version2], branch },
104984
+ { right: [version2], branch: "" }
104759
104985
  ];
104760
- }
104761
- });
104762
- var makeCampUiSessionFooter = (context8) => ({
104763
- render: (viewport) => {
104764
- const model = context8.readModel();
104765
- const theme = getSelectListTheme10();
104766
- const workerId = model.state.selectedWorkerId;
104767
- const worker = workerId === void 0 ? void 0 : findCampUiWorker(model.snapshot, workerId);
104768
- const usage = worker?.snapshot.session?.usage;
104769
- const tokenText = usage === void 0 ? "tokens unknown" : `\u2193 ${compactNumber(usage.tokens.total)} tokens`;
104770
- const costText = usage === void 0 ? "cost unknown" : `$${usage.cost.toFixed(3)}`;
104771
- const cacheText = usage?.latestCacheHitRate === void 0 ? usage === void 0 || usage.tokens.total === 0 ? "cache n/a" : "cache not reported" : `cache ${usage.latestCacheHitRate.toFixed(0)}%`;
104772
- const contextText = usage?.context?.percent === null || usage?.context?.percent === void 0 ? "context unknown" : `context ${usage.context.percent.toFixed(0)}%`;
104773
- const modelText2 = usage?.model ?? worker?.snapshot.worker.equipment.model ?? "model unknown";
104774
- const thinking = worker?.snapshot.session?.thinkingLevel ?? worker?.snapshot.worker.equipment.thinkingLevel ?? "unknown";
104775
- const identity4 = worker === void 0 ? theme.description("worker not selected") : `${theme.selectedText(worker.snapshot.worker.alias ?? worker.snapshot.worker.id.slice(0, 8))} ${theme.description(`\xB7 ${worker.snapshot.worker.cwd}`)}`;
104776
- const branch = worker === void 0 || model.snapshot.projectBranch === null ? "" : theme.description(`branch ${model.snapshot.projectBranch}`);
104986
+ const MINIMUM_PATH_COLUMNS = 8;
104987
+ const chosen = candidates.find((candidate) => {
104988
+ const rightWidth = visibleWidth5(candidate.right.filter((part) => part !== "").join(" \xB7 "));
104989
+ const room = viewport.width - rightWidth - 3 - visibleWidth5(candidate.branch);
104990
+ return room >= MINIMUM_PATH_COLUMNS;
104991
+ }) ?? candidates[candidates.length - 1];
104992
+ const right3 = (chosen ?? candidates[0])?.right.filter((part) => part !== "").join(" \xB7 ") ?? "";
104993
+ const chosenBranch = chosen?.branch ?? "";
104994
+ const leftBudget = Math.max(0, viewport.width - visibleWidth5(right3) - 3);
104995
+ const path = shortenPath(
104996
+ snapshot.projectScope,
104997
+ Math.max(0, leftBudget - visibleWidth5(chosenBranch))
104998
+ );
104999
+ const left3 = diagnostic === "" ? theme.description(`${path}${chosenBranch}`) : `${diagnostic} ${theme.description(`\xB7 ${path}${chosenBranch}`)}`;
104777
105000
  return [
104778
105001
  footerDivider(viewport.width),
104779
- branch === "" ? fitCampUiLine(identity4, viewport.width) : joinCampUiColumns(identity4, branch, viewport.width),
104780
- joinCampUiColumns(
104781
- theme.description(`${tokenText} \xB7 ${costText} \xB7 ${cacheText} \xB7 ${contextText}`),
104782
- theme.description(`${modelText2} \xB7 effort ${thinking}`),
104783
- viewport.width
104784
- )
105002
+ joinCampUiColumns(left3, theme.description(right3), viewport.width)
104785
105003
  ];
104786
105004
  }
104787
105005
  });
104788
105006
 
104789
105007
  // packages/host-ui/src/pi/layout/campUiResources.ts
104790
- import { getSelectListTheme as getSelectListTheme11 } from "@earendil-works/pi-coding-agent";
105008
+ import { getSelectListTheme as getSelectListTheme13 } from "@earendil-works/pi-coding-agent";
104791
105009
  var renderResourceTree = (label, value5, tone, width) => {
104792
- const theme = getSelectListTheme11();
105010
+ const theme = getSelectListTheme13();
104793
105011
  const lines3 = [
104794
105012
  theme.description(label),
104795
105013
  `${theme.description("\u2514\u2500")} ${renderCampUiStatus(value5, tone)}`
@@ -104797,6 +105015,7 @@ var renderResourceTree = (label, value5, tone, width) => {
104797
105015
  return lines3.map((line) => fitCampUiLine(line, width));
104798
105016
  };
104799
105017
  var makeCampUiResources = (context8) => ({
105018
+ preferredRows: () => 10,
104800
105019
  render: (viewport) => {
104801
105020
  const model = context8.readModel();
104802
105021
  const snapshot = model.snapshot;
@@ -104807,8 +105026,8 @@ var makeCampUiResources = (context8) => ({
104807
105026
  const partial4 = !inventory.complete;
104808
105027
  const resourceText = (items) => {
104809
105028
  if (!resourcesReported) return "not reported";
104810
- const names = uniqueCampUiNames(items.map((item) => item.name));
104811
- const value5 = names.length === 0 ? "none loaded" : names.join(", ");
105029
+ const names2 = uniqueCampUiNames(items.map((item) => item.name));
105030
+ const value5 = names2.length === 0 ? "none loaded" : names2.join(", ");
104812
105031
  return partial4 ? `${value5} \xB7 partial` : value5;
104813
105032
  };
104814
105033
  const mcpNames = uniqueCampUiNames(equipment.flatMap((item) => item.mcp.serverNames));
@@ -104830,27 +105049,29 @@ var makeCampUiResources = (context8) => ({
104830
105049
  ...missingMcpHealth ? ["health not reported"] : []
104831
105050
  ];
104832
105051
  const mcpText = !equipmentReported ? "not reported" : mcpNames.length === 0 ? "none configured" : `${mcpNames.join(", ")}${mcpNotes.length === 0 ? "" : ` \xB7 ${mcpNotes.join(", ")}`}`;
104833
- return [
105052
+ const contentWidth = Math.max(1, viewport.width - 2);
105053
+ const body = [
104834
105054
  ...renderResourceTree(
104835
105055
  "Context",
104836
105056
  resourceText(inventory.contextFiles),
104837
105057
  inventory.contextFiles.length > 0 ? CampUiTone.success : CampUiTone.neutral,
104838
- viewport.width
105058
+ contentWidth
104839
105059
  ),
104840
105060
  ...renderResourceTree(
104841
105061
  "Extensions",
104842
105062
  resourceText(inventory.extensions),
104843
105063
  inventory.extensions.length > 0 ? CampUiTone.success : CampUiTone.neutral,
104844
- viewport.width
105064
+ contentWidth
104845
105065
  ),
104846
105066
  ...renderResourceTree(
104847
105067
  "Skills",
104848
105068
  resourceText(inventory.skills),
104849
105069
  inventory.skills.length > 0 ? CampUiTone.success : CampUiTone.neutral,
104850
- viewport.width
105070
+ contentWidth
104851
105071
  ),
104852
- ...renderResourceTree("MCP", mcpText, mcpTone, viewport.width)
105072
+ ...renderResourceTree("MCP", mcpText, mcpTone, contentWidth)
104853
105073
  ];
105074
+ return renderCampUiPanel("Camp inventory \xB7 Esc to close", body, viewport.width);
104854
105075
  }
104855
105076
  });
104856
105077
 
@@ -104862,9 +105083,14 @@ var makeDefaultCampUiContributions = (tui, detailBlocks) => [
104862
105083
  mount: (context8) => succeed8(makeCampUiCampHeader(context8))
104863
105084
  },
104864
105085
  {
104865
- id: "default-resources",
104866
- slotId: CampUiSlot.resources,
104867
- mount: (context8) => succeed8(makeCampUiResources(context8))
105086
+ id: "default-activity",
105087
+ slotId: CampUiSlot.activity,
105088
+ mount: (context8) => succeed8(makeCampUiActivity(context8))
105089
+ },
105090
+ {
105091
+ id: "default-equipment",
105092
+ slotId: CampUiSlot.equipment,
105093
+ mount: (context8) => succeed8(makeCampUiEquipment(context8))
104868
105094
  },
104869
105095
  {
104870
105096
  id: "default-roster",
@@ -104887,29 +105113,29 @@ var makeDefaultCampUiContributions = (tui, detailBlocks) => [
104887
105113
  mount: (context8) => succeed8(makeCampUiComposerComponent(context8, tui))
104888
105114
  },
104889
105115
  {
104890
- id: "default-camp-footer",
104891
- slotId: CampUiSlot.campFooter,
104892
- mount: (context8) => succeed8(makeCampUiCampFooter(context8))
105116
+ id: "default-footer",
105117
+ slotId: CampUiSlot.footer,
105118
+ mount: (context8) => succeed8(makeCampUiFooter(context8))
104893
105119
  },
104894
105120
  {
104895
- id: "default-session-footer",
104896
- slotId: CampUiSlot.sessionFooter,
104897
- mount: (context8) => succeed8(makeCampUiSessionFooter(context8))
105121
+ id: "default-inventory-overlay",
105122
+ slotId: CampUiSlot.overlay,
105123
+ mount: (context8) => succeed8(makeCampUiResources(context8))
104898
105124
  }
104899
105125
  ];
104900
105126
 
104901
105127
  // packages/host-ui/src/pi/layout/campUiSection.ts
104902
- import { getMarkdownTheme as getMarkdownTheme9, getSelectListTheme as getSelectListTheme12 } from "@earendil-works/pi-coding-agent";
104903
- import { visibleWidth as visibleWidth4 } from "@earendil-works/pi-tui";
105128
+ import { getMarkdownTheme as getMarkdownTheme8, getSelectListTheme as getSelectListTheme14 } from "@earendil-works/pi-coding-agent";
105129
+ import { visibleWidth as visibleWidth6 } from "@earendil-works/pi-tui";
104904
105130
  var renderHeader = (header, width) => {
104905
- const theme = getMarkdownTheme9();
104906
- const selectTheme = getSelectListTheme12();
105131
+ const theme = getMarkdownTheme8();
105132
+ const selectTheme = getSelectListTheme14();
104907
105133
  const rule2 = header.focused === true ? selectTheme.selectedPrefix : theme.codeBlockBorder;
104908
105134
  const title = header.focused === true ? selectTheme.selectedText : theme.heading;
104909
105135
  const ruleCharacter = header.focused === true ? "\u2501" : "\u2500";
104910
105136
  const detail = header.detail === void 0 ? "" : ` ${selectTheme.description(header.detail)}`;
104911
105137
  const label = `${rule2(ruleCharacter.repeat(2))} ${title(header.title)}${detail} `;
104912
- const ruleWidth = Math.max(0, width - visibleWidth4(label));
105138
+ const ruleWidth = Math.max(0, width - visibleWidth6(label));
104913
105139
  return fitCampUiLine(`${label}${rule2(ruleCharacter.repeat(ruleWidth))}`, width);
104914
105140
  };
104915
105141
  var makeCampUiSection = (options2) => {
@@ -104921,6 +105147,7 @@ var makeCampUiSection = (options2) => {
104921
105147
  const disposableComponents = components.some((component) => component.dispose !== void 0);
104922
105148
  return {
104923
105149
  sectionSize: options2.size,
105150
+ ...options2.preferredRows === void 0 ? {} : { preferredRows: options2.preferredRows },
104924
105151
  ...components.some((component) => component.focusable === true) ? { focusable: true } : {},
104925
105152
  render: (viewport) => {
104926
105153
  if (viewport.height <= 0) {
@@ -104991,18 +105218,33 @@ var decorateDefaultCampUiSections = (context8, slots) => {
104991
105218
  })
104992
105219
  );
104993
105220
  decorated.set(
104994
- CampUiSlot.resources,
105221
+ CampUiSlot.activity,
104995
105222
  makeCampUiSection({
104996
- header: () => ({ title: "Resources" }),
104997
- size: defaultCampUiLeftSectionSizes.resources,
105223
+ header: () => ({ title: "Activity" }),
105224
+ size: defaultCampUiRightSectionSizes.activity,
104998
105225
  children: [
104999
105226
  {
105000
- component: component(CampUiSlot.resources),
105227
+ component: component(CampUiSlot.activity),
105001
105228
  size: { kind: CampUiSectionSizeKind.grow, weight: 1 }
105002
105229
  }
105003
105230
  ]
105004
105231
  })
105005
105232
  );
105233
+ const equipment = component(CampUiSlot.equipment);
105234
+ decorated.set(
105235
+ CampUiSlot.equipment,
105236
+ makeCampUiSection({
105237
+ header: () => ({ title: "Equipment" }),
105238
+ size: defaultCampUiRightSectionSizes.equipment,
105239
+ children: [
105240
+ {
105241
+ component: equipment,
105242
+ size: { kind: CampUiSectionSizeKind.grow, weight: 1 }
105243
+ }
105244
+ ],
105245
+ preferredRows: (width) => 1 + (equipment.preferredRows?.(width) ?? defaultCampUiRightSectionSizes.equipment.rows - 1)
105246
+ })
105247
+ );
105006
105248
  decorated.set(
105007
105249
  CampUiSlot.roster,
105008
105250
  makeCampUiSection({
@@ -105028,7 +105270,7 @@ import { initTheme } from "@earendil-works/pi-coding-agent";
105028
105270
  import { ProcessTerminal, TUI } from "@earendil-works/pi-tui";
105029
105271
 
105030
105272
  // packages/host-ui/src/pi/piCampUiRoot.ts
105031
- import { getMarkdownTheme as getMarkdownTheme10 } from "@earendil-works/pi-coding-agent";
105273
+ import { getMarkdownTheme as getMarkdownTheme9 } from "@earendil-works/pi-coding-agent";
105032
105274
  import { Key as Key4, matchesKey as matchesKey3 } from "@earendil-works/pi-tui";
105033
105275
 
105034
105276
  // packages/host-ui/src/pi/runtime/campUiPointerInput.ts
@@ -105157,7 +105399,7 @@ var PiCampUiRoot = class {
105157
105399
  segments.push({
105158
105400
  x: divider.x,
105159
105401
  width: 1,
105160
- text: getMarkdownTheme10().codeBlockBorder("\u2502")
105402
+ text: getMarkdownTheme9().codeBlockBorder("\u2502")
105161
105403
  });
105162
105404
  }
105163
105405
  }
@@ -105204,6 +105446,14 @@ var PiCampUiRoot = class {
105204
105446
  if (focusedSlotId !== model.state.focusedSlotId) {
105205
105447
  this.context.emit(CampUiIntents.FocusSlot({ slotId: focusedSlotId }));
105206
105448
  }
105449
+ if (model.state.inventoryVisible && matchesKey3(input, Key4.escape)) {
105450
+ this.context.emit(CampUiIntents.SetInventoryVisible({ visible: false }));
105451
+ return;
105452
+ }
105453
+ if (focusedSlotId !== CampUiSlot.composer && input === "i") {
105454
+ this.context.emit(CampUiIntents.SetInventoryVisible({ visible: true }));
105455
+ return;
105456
+ }
105207
105457
  if (this.slots.get(focusedSlotId)?.handleInput?.(input) === true) return;
105208
105458
  if (matchesKey3(input, Key4.escape)) {
105209
105459
  if (focusedSlotId === CampUiSlot.composer) {
@@ -105289,19 +105539,67 @@ var PiCampUiRoot = class {
105289
105539
  }
105290
105540
  };
105291
105541
 
105542
+ // packages/host-ui/src/pi/runtime/campUiFrameScheduler.ts
105543
+ var DEFAULT_MINIMUM_INTERVAL_MS = 1e3;
105544
+ var DEFAULT_MAXIMUM_INTERVAL_MS = 8e3;
105545
+ var DEFAULT_EXPENSIVE_FRAME_MS = 120;
105546
+ var CAMP_UI_REDUCED_MOTION_ENV = "PRIIISK_REDUCED_MOTION";
105547
+ var campUiReducedMotionFromEnv = (environment2) => {
105548
+ const value5 = environment2[CAMP_UI_REDUCED_MOTION_ENV]?.trim().toLowerCase();
105549
+ return value5 !== void 0 && value5 !== "" && value5 !== "0" && value5 !== "false";
105550
+ };
105551
+ var makeCampUiFrameScheduler = (options2 = {}) => gen2(function* () {
105552
+ const minimum = Math.max(
105553
+ 1,
105554
+ Math.floor(options2.minimumIntervalMs ?? DEFAULT_MINIMUM_INTERVAL_MS)
105555
+ );
105556
+ const maximum = Math.max(
105557
+ minimum,
105558
+ Math.floor(options2.maximumIntervalMs ?? DEFAULT_MAXIMUM_INTERVAL_MS)
105559
+ );
105560
+ const expensive = Math.max(
105561
+ 1,
105562
+ Math.floor(options2.expensiveFrameMs ?? DEFAULT_EXPENSIVE_FRAME_MS)
105563
+ );
105564
+ const reducedMotion = options2.reducedMotion === true;
105565
+ const pending3 = yield* make25(false);
105566
+ const interval = yield* make25(minimum);
105567
+ return {
105568
+ request: reducedMotion ? _void : set5(pending3, true),
105569
+ intervalMs: get11(interval),
105570
+ run: (frame) => reducedMotion ? never3 : forever3(
105571
+ gen2(function* () {
105572
+ yield* sleep4(millis(yield* get11(interval)));
105573
+ const requested = yield* getAndSet2(pending3, false);
105574
+ if (!requested) return;
105575
+ const startedAt = yield* currentTimeMillis2;
105576
+ yield* frame;
105577
+ const cost = (yield* currentTimeMillis2) - startedAt;
105578
+ yield* update3(
105579
+ interval,
105580
+ (current2) => cost > expensive ? Math.min(maximum, current2 * 2) : Math.max(minimum, Math.floor(current2 / 2))
105581
+ );
105582
+ })
105583
+ )
105584
+ };
105585
+ });
105586
+
105292
105587
  // packages/host-ui/src/pi/runtime/campUiPresentationClock.ts
105293
105588
  var hasPendingCampUiAsk = (model) => model.snapshot.workers.some(
105294
105589
  (worker) => worker.asks.some((ask) => ask.state === CampAskState.pending)
105295
105590
  );
105296
- var runCampUiPresentationClock = (readModel, controller) => forever3(
105297
- sleep4("1 second").pipe(
105298
- zipRight3(
105299
- suspend4(
105300
- () => hasPendingCampUiAsk(readModel()) ? currentTimeMillis2.pipe(flatMap10(controller.setPresentationNow)) : _void
105301
- )
105302
- )
105303
- )
105304
- );
105591
+ var runCampUiPresentationClock = (readModel, controller, scheduler2) => gen2(function* () {
105592
+ const frames = scheduler2 ?? (yield* makeCampUiFrameScheduler({
105593
+ reducedMotion: campUiReducedMotionFromEnv(process.env)
105594
+ }));
105595
+ const advance = suspend4(
105596
+ () => hasPendingCampUiAsk(readModel()) ? currentTimeMillis2.pipe(flatMap10(controller.setPresentationNow)) : _void
105597
+ );
105598
+ return yield* zipRight3(
105599
+ frames.request,
105600
+ frames.run(zipRight3(advance, frames.request))
105601
+ );
105602
+ });
105305
105603
 
105306
105604
  // packages/host-ui/src/pi/runtime/campUiSubscriptionRetry.ts
105307
105605
  var CAMP_UI_SUBSCRIPTION_MAX_RETRIES = 4;
@@ -105419,6 +105717,22 @@ var mountPiCampUi = (options2) => gen2(function* () {
105419
105717
  );
105420
105718
  tui.addChild(root);
105421
105719
  tui.setFocus(root);
105720
+ const inventory = slots.get(CampUiSlot.overlay);
105721
+ const inventoryOverlay = inventory === void 0 ? void 0 : tui.showOverlay(
105722
+ {
105723
+ render: (width) => [
105724
+ ...inventory.render({ width, height: Math.max(0, terminal.rows) })
105725
+ ],
105726
+ invalidate: () => inventory.invalidate?.()
105727
+ },
105728
+ {
105729
+ width: "60%",
105730
+ minWidth: 36,
105731
+ margin: 1,
105732
+ visible: () => current2.state.inventoryVisible,
105733
+ nonCapturing: true
105734
+ }
105735
+ );
105422
105736
  yield* sync4(() => {
105423
105737
  terminal.setTitle(initial.displayName);
105424
105738
  terminal.clearScreen();
@@ -105435,6 +105749,9 @@ var mountPiCampUi = (options2) => gen2(function* () {
105435
105749
  )
105436
105750
  )
105437
105751
  );
105752
+ if (inventoryOverlay !== void 0) {
105753
+ yield* addFinalizer3(() => sync4(() => inventoryOverlay.hide()));
105754
+ }
105438
105755
  yield* forkScoped2(
105439
105756
  gen2(function* () {
105440
105757
  for (let attempt = 0; attempt < 25; attempt += 1) {
@@ -105512,7 +105829,7 @@ var mountPiCampUi = (options2) => gen2(function* () {
105512
105829
  });
105513
105830
 
105514
105831
  // packages/host-ui/src/pi/run-selector/campRunSelector.ts
105515
- import { getMarkdownTheme as getMarkdownTheme11, getSelectListTheme as getSelectListTheme13, initTheme as initTheme2 } from "@earendil-works/pi-coding-agent";
105832
+ import { getMarkdownTheme as getMarkdownTheme10, getSelectListTheme as getSelectListTheme15, initTheme as initTheme2 } from "@earendil-works/pi-coding-agent";
105516
105833
  import {
105517
105834
  Key as Key5,
105518
105835
  matchesKey as matchesKey4,
@@ -105599,6 +105916,7 @@ var makeHostCampUiSnapshot = (options2, revision, activityRevisions) => gen2(fun
105599
105916
  return {
105600
105917
  displayName: `priiisk-camp-${options2.project.name.replaceAll(/[^a-zA-Z0-9_-]+/gu, "-")}-${options2.project.hash.slice(0, 5)}`,
105601
105918
  projectScope: options2.project.cwd,
105919
+ hostVersion: PRIIISK_HOST_VERSION,
105602
105920
  generation: options2.runtime.generation,
105603
105921
  revision: nextRevision,
105604
105922
  placement: options2.placement ?? CampUiPlacement.external,