@4pm/cli 1.5.11 → 1.5.14-hotfix

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/dist/index.js +29 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28323,14 +28323,14 @@ function defaultProfileConfig() {
28323
28323
  webBlockedCommands: ["quit", "config"],
28324
28324
  // Shared AI memory (ADR-0245) — off by default (opt-in; costs a compaction call per turn).
28325
28325
  aiMemoryEnabled: false,
28326
- aiMemoryBudgetChars: 6e3
28326
+ aiMemoryBudgetChars: 1e3
28327
28327
  };
28328
28328
  }
28329
28329
  function resolveMemoryConfig(config) {
28330
28330
  const mode = config.projectAiMemoryMode ?? "inherit";
28331
28331
  const enabled = mode === "on" ? true : mode === "off" ? false : config.aiMemoryEnabled ?? false;
28332
28332
  const projectBudget = config.projectAiMemoryBudgetChars ?? 0;
28333
- const budgetChars = projectBudget > 0 ? projectBudget : config.aiMemoryBudgetChars ?? 6e3;
28333
+ const budgetChars = projectBudget > 0 ? projectBudget : config.aiMemoryBudgetChars ?? 1e3;
28334
28334
  return { enabled, budgetChars };
28335
28335
  }
28336
28336
  function resolveIdleAutoClearMinutes(config) {
@@ -33760,6 +33760,10 @@ var WsChannels = {
33760
33760
  // server → cli: the project was deleted ⇒ delete the physic folder; the cli keeps
33761
33761
  // its pairing and goes idle (ADR-0068).
33762
33762
  PHYSIC_DELETE: "physic.delete",
33763
+ // server → cli (ADR-0256): a project's token settings were saved ⇒ push the fresh knobs to every
33764
+ // serving cli so a change (e.g. aiRunTimeoutSec) applies on the next run, not only after a
33765
+ // reconnect. `ws_token` seeds these on connect; this channel only carries updates.
33766
+ PROJECT_TOKENS: "project.tokens",
33763
33767
  // command lifecycle
33764
33768
  COMMAND_ANNOUNCE: "command.announce",
33765
33769
  // console transcript sync (ADR-0150): the cli streams its authoritative SessionBus
@@ -38067,6 +38071,23 @@ var WsClient = class {
38067
38071
  this.physicRoot = null;
38068
38072
  break;
38069
38073
  }
38074
+ case WsChannels.PROJECT_TOKENS: {
38075
+ const tokens = payload;
38076
+ writeProfileConfig(this.context.profileDir, {
38077
+ sessionSwitchPct: tokens.sessionSwitchPct ?? 0,
38078
+ perPromptTokenLimit: tokens.perPromptTokenLimit ?? 0,
38079
+ projectAiRunTimeoutSec: tokens.aiRunTimeoutSec ?? 0,
38080
+ projectAutoClearIdleMinutes: tokens.autoClearIdleMinutes ?? 0,
38081
+ projectAiMemoryMode: tokens.memory?.mode ?? "inherit",
38082
+ projectAiMemoryBudgetChars: tokens.memory?.budgetChars ?? 0
38083
+ });
38084
+ this.restrictToFolder = tokens.restrictToFolder === true;
38085
+ logger.info("project.tokens.applied", {
38086
+ aiRunTimeoutSec: tokens.aiRunTimeoutSec ?? 0,
38087
+ autoClearIdleMinutes: tokens.autoClearIdleMinutes ?? 0
38088
+ });
38089
+ break;
38090
+ }
38070
38091
  case WsChannels.COMMAND_DISPATCH: {
38071
38092
  const dispatch = payload;
38072
38093
  if (this.handledCommands.has(dispatch.commandId)) {
@@ -39242,6 +39263,7 @@ ${guardedPrompt}`;
39242
39263
  sendMachineStatus() {
39243
39264
  const config = readProfileConfig(this.context.profileDir);
39244
39265
  const physicPath = config.physicPath ?? null;
39266
+ const aiProfileCount = Array.isArray(config.aiProfiles) ? config.aiProfiles.length : (config.claudeHome?.length ?? 0) + (config.codexHome?.length ?? 0) + (config.antigravityHome?.length ?? 0);
39245
39267
  this.send(WsChannels.MACHINE_STATUS, {
39246
39268
  status: "online",
39247
39269
  projects: [],
@@ -39249,7 +39271,11 @@ ${guardedPrompt}`;
39249
39271
  physicPath,
39250
39272
  physicPathExists: physicPath ? existsSync13(physicPath) : void 0,
39251
39273
  // Real coarse state (ADR-0152): !paused and a recent tick (was hard-coded false).
39252
- autonomousRunning: physicPath ? isAutonomousRunning(physicPath) : false
39274
+ autonomousRunning: physicPath ? isAutonomousRunning(physicPath) : false,
39275
+ // The machine-user AI-run limit (0 = unlimited) + profile count so a dispatch can resolve the
39276
+ // effective timeout and derive the SSE reply windows server-side (ADR-0256).
39277
+ aiRunTimeoutSec: config.aiRunTimeoutSec ?? 0,
39278
+ aiProfileCount
39253
39279
  });
39254
39280
  }
39255
39281
  /** Heartbeat every 30s: ping + periodically re-report machine.status. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4pm/cli",
3
- "version": "1.5.11",
3
+ "version": "1.5.14-hotfix",
4
4
  "private": false,
5
5
  "description": "4PM CLI — drives Claude/Codex CLIs on AI worker machines (Node + TypeScript)",
6
6
  "license": "LicenseRef-4PM-Source-Available",