@buildaharness/aielia 0.3.7 → 0.3.8

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.
@@ -8,7 +8,7 @@ import { rename, stat, realpath, readdir, mkdir, unlink, writeFile, readFile } f
8
8
  import { homedir, tmpdir } from "node:os";
9
9
  import { fileURLToPath, pathToFileURL } from "node:url";
10
10
  import { OPENROUTER_DEFAULT_MODEL, OPENAI_DEFAULT_MODEL, ANTHROPIC_DEFAULT_MODEL, InMemoryReminderStore, FileSystemAdapter, FileSystemExperienceStore, defaultModelForBackend, LLMClient, OpenAICompatibleLLMClient, OPENROUTER_EXTRA_HEADERS, OPENROUTER_BASE_URL, OPENAI_BASE_URL, AnthropicLLMClient } from "@buildaharness/runtime";
11
- import { Y as buildClaudePrompt, bK as stripJsonCodeFence, bo as recallToolEnabled, aZ as lexicalOffEnvValue, a as ALREADY_STAGED_ACTION_TOOL, bJ as stagedActionInput, bi as parseClaudeCliOutput, bL as stripMcpToolPrefix, bp as redactUrlCredentials, b5 as memoryStatusChecks, bh as normalizePlanNodes, P as PROVIDER_SETUP, a4 as cleanApiKey, _ as checkApiKeyFormat, ag as envOverridesFromProcessEnv, bs as resolveConfig, bH as shouldLaunchTuiApp, n as DEFAULT_TUI_MODE, T as applyLayerSettings, bF as sanitizeLayerChoices, bQ as testApiKey, bT as validateConfig, ao as findInvalidNumericSettings, c as ConfigValidationError, aH as formatSpendCapStatus, aU as isPlanGraphEnabled, bM as stripTerminalControls, B as PersonalAssistant, aR as isGoalGraphSuggestEnabled, aQ as isGoalGraphEnabled, bn as planToSnapshot, X as braveSearch, a8 as createSmtpSender, a7 as createResendSender, aW as isQuitCommand, y as LiveSteeringChannel, aE as formatNextSteps, $ as classifyError, b8 as nodeToLayer, L as LAYER_DISPLAY_NAME, b7 as nodeDisplayName, ai as estimateCostUsd, aq as formatConfigListing, aP as isConfigKey, C as CONFIG_KEYS, E as ENV_VAR_FOR_CONFIG_KEY, bj as parseConfigValue, d as ConfigValueParseError, as as formatDoctorReport, ar as formatCostSummary, au as formatGoalGraphState, aG as formatSearchResults, az as formatMemoryHistory, aC as formatMemoryStatus, aB as formatMemoryPendingOutcome, ax as formatMemoryArchive, aK as formatUndoLogListing, ab as defaultExportFilename, aJ as formatTranscriptMarkdown, aI as formatStatus, av as formatHelp, r as LAYER_ORDER, aw as formatLayerListing, bU as withLayerChoice, x as LayerSettingError, aA as formatMemoryInjection, Z as buildWhyChain, t as LAYER_SHORT_CODE, ac as defaultMemoryExportFilename, ay as formatMemoryExport, b4 as memoryAuditLogEnabled, aD as formatMemorySummary } from "./provider-setup-wX2IBw2X.js";
11
+ import { Y as buildClaudePrompt, bK as stripJsonCodeFence, bo as recallToolEnabled, aZ as lexicalOffEnvValue, a as ALREADY_STAGED_ACTION_TOOL, bJ as stagedActionInput, bi as parseClaudeCliOutput, bL as stripMcpToolPrefix, bp as redactUrlCredentials, b5 as memoryStatusChecks, bh as normalizePlanNodes, P as PROVIDER_SETUP, a4 as cleanApiKey, _ as checkApiKeyFormat, ag as envOverridesFromProcessEnv, bs as resolveConfig, bH as shouldLaunchTuiApp, n as DEFAULT_TUI_MODE, T as applyLayerSettings, bF as sanitizeLayerChoices, bQ as testApiKey, bT as validateConfig, ao as findInvalidNumericSettings, c as ConfigValidationError, aH as formatSpendCapStatus, aU as isPlanGraphEnabled, B as PersonalAssistant, aR as isGoalGraphSuggestEnabled, bM as stripTerminalControls, aQ as isGoalGraphEnabled, bn as planToSnapshot, X as braveSearch, a8 as createSmtpSender, a7 as createResendSender, aW as isQuitCommand, y as LiveSteeringChannel, aE as formatNextSteps, $ as classifyError, b8 as nodeToLayer, L as LAYER_DISPLAY_NAME, b7 as nodeDisplayName, ai as estimateCostUsd, aq as formatConfigListing, aP as isConfigKey, C as CONFIG_KEYS, E as ENV_VAR_FOR_CONFIG_KEY, bj as parseConfigValue, d as ConfigValueParseError, as as formatDoctorReport, ar as formatCostSummary, au as formatGoalGraphState, aG as formatSearchResults, az as formatMemoryHistory, aC as formatMemoryStatus, aB as formatMemoryPendingOutcome, ax as formatMemoryArchive, aK as formatUndoLogListing, ab as defaultExportFilename, aJ as formatTranscriptMarkdown, aI as formatStatus, av as formatHelp, r as LAYER_ORDER, aw as formatLayerListing, bU as withLayerChoice, x as LayerSettingError, aA as formatMemoryInjection, Z as buildWhyChain, t as LAYER_SHORT_CODE, ac as defaultMemoryExportFilename, ay as formatMemoryExport, b4 as memoryAuditLogEnabled, aD as formatMemorySummary } from "./provider-setup-wX2IBw2X.js";
12
12
  import { spawn } from "node:child_process";
13
13
  import { createServer, connect } from "node:net";
14
14
  import { createRequire } from "node:module";
@@ -129,7 +129,7 @@ function createNodeFsBackend() {
129
129
  }
130
130
  };
131
131
  }
132
- const CLI_VERSION = "0.3.7";
132
+ const CLI_VERSION = "0.3.8";
133
133
  function seaCacheDir(version, home = homedir()) {
134
134
  return join(home, ".buildaharness", "personal-assistant", "sea-cache", version);
135
135
  }
@@ -3552,7 +3552,6 @@ async function buildAssistant(config, { backend, dataDir, remindersFile }) {
3552
3552
  });
3553
3553
  }
3554
3554
  async function runCli(options = {}) {
3555
- printSafe("Aielia is alpha software — expect rough edges and breaking changes. It uses AI models and can make mistakes; verify anything important.\n");
3556
3555
  const dataDir = options.dataDir ?? defaultDataDir;
3557
3556
  const configStore = options.configStore ?? defaultConfigStore;
3558
3557
  const backend = options.backend ?? defaultBackend;
@@ -3620,21 +3619,34 @@ Fix it by setting the missing value (in the config file under ${dataDir}, or via
3620
3619
  openai: OPENAI_DEFAULT_MODEL,
3621
3620
  openrouter: OPENROUTER_DEFAULT_MODEL
3622
3621
  };
3623
- printSafe(`backend: ${config.llmBackend} (${config.model ?? backendDisplayModel[config.llmBackend]})`);
3622
+ const backendLine = `${config.llmBackend} · ${config.model ?? backendDisplayModel[config.llmBackend]}`;
3624
3623
  const enabledCapabilities = [];
3625
3624
  if (config.enableWeb) enabledCapabilities.push("web search/fetch (brave)");
3626
3625
  if (config.enableShell) enabledCapabilities.push(`shell commands (${config.dangerouslySkipPermissions ? "NOT approval-gated" : "approval-gated"})`);
3627
- const capabilitySuffix = enabledCapabilities.length > 0 ? ` — enabled: ${enabledCapabilities.join(", ")}` : "";
3628
- const dangerBanner = config.dangerouslySkipPermissions ? "\n⚠ dangerouslySkipPermissions is ON — every approval prompt (risky messages, file writes, shell commands) is skipped automatically.\n" : "";
3629
- const nonInteractiveBanner = nonInteractiveApprovalMode === "decline" ? "\nASSISTANT_NON_INTERACTIVE_APPROVAL=decline is set — every approval prompt auto-declines.\n" : "";
3626
+ const capabilityRow = enabledCapabilities.length > 0 ? `
3627
+ tools ${enabledCapabilities.join(", ")}` : "";
3628
+ const dangerBanner = config.dangerouslySkipPermissions ? "\n ⚠ dangerouslySkipPermissions is ON — every approval prompt is skipped automatically." : "";
3629
+ const nonInteractiveBanner = nonInteractiveApprovalMode === "decline" ? "\n ⚠ ASSISTANT_NON_INTERACTIVE_APPROVAL=decline — every approval prompt auto-declines." : "";
3630
3630
  const startupUndoLogEntries = await assistant.listUndoLogEntries();
3631
3631
  const undoableFromBefore = startupUndoLogEntries.filter((e) => e.undoable).length;
3632
3632
  const undoBanner = undoableFromBefore > 0 ? `
3633
- ${undoableFromBefore} action${undoableFromBefore === 1 ? "" : "s"} from earlier sessions ${undoableFromBefore === 1 ? "is" : "are"} still revertible — see /undo-action.
3634
- ` : "";
3635
- printSafe(`Aielia — your personal assistant on the 11-layer harness, one turn at a time. Ctrl+C to exit.${capabilitySuffix}
3636
- ${dangerBanner}${nonInteractiveBanner}${undoBanner}`);
3637
- printSafe("Type /help to see all commands, /config to view settings.\n");
3633
+ undo ${undoableFromBefore} earlier action${undoableFromBefore === 1 ? "" : "s"} can be reverted with /undo-action` : "";
3634
+ const startupSpend = await assistant.getSpendState("cli");
3635
+ const fmtUsage = (input, output, cost) => `↑${input.toLocaleString()} ↓${output.toLocaleString()} tokens (~$${cost.toFixed(4)})`;
3636
+ const totalUsageRow = `
3637
+ total ${fmtUsage(startupSpend.cumulativeInputTokens, startupSpend.cumulativeOutputTokens, startupSpend.cumulativeCostUsd)} across all sessions`;
3638
+ printSafe(
3639
+ [
3640
+ `Aielia v${CLI_VERSION}`,
3641
+ "Your personal assistant, one turn at a time.",
3642
+ " ",
3643
+ ` backend ${backendLine}${capabilityRow}${undoBanner}${totalUsageRow}${dangerBanner}${nonInteractiveBanner}`,
3644
+ " ",
3645
+ " /help commands /config settings Ctrl+C exit",
3646
+ " Alpha software: it can make mistakes, so verify anything important.",
3647
+ " "
3648
+ ].join("\n")
3649
+ );
3638
3650
  void assistant.proposeMemoryConsolidation("cli").catch(() => void 0);
3639
3651
  rl.prompt();
3640
3652
  let lastTrace;
@@ -4912,7 +4924,11 @@ ${assistant.getActiveProject() || "(none)"}
4912
4924
  indicators.push(`Model: ${config.model ?? backendDisplayModel[config.llmBackend]}`);
4913
4925
  const spendState = await assistant.getSpendState("cli");
4914
4926
  indicators.push(
4915
- `↑${spendState.cumulativeInputTokens.toLocaleString()} ↓${spendState.cumulativeOutputTokens.toLocaleString()} tokens (~$${spendState.cumulativeCostUsd.toFixed(4)})`
4927
+ `This session: ${fmtUsage(
4928
+ spendState.cumulativeInputTokens - startupSpend.cumulativeInputTokens,
4929
+ spendState.cumulativeOutputTokens - startupSpend.cumulativeOutputTokens,
4930
+ spendState.cumulativeCostUsd - startupSpend.cumulativeCostUsd
4931
+ )}`
4916
4932
  );
4917
4933
  const spendCapLine = formatSpendCapStatus(spendState, { sessionCostLimitUsd: config.sessionCostLimitUsd, sessionCallLimit: config.sessionCallLimit });
4918
4934
  if (spendCapLine) indicators.push(spendCapLine);
@@ -4956,7 +4972,7 @@ async function mainInner(argv) {
4956
4972
  });
4957
4973
  }
4958
4974
  if (shouldLaunchTuiApp(config.tuiMode ?? DEFAULT_TUI_MODE, Boolean(process.stdout.isTTY), Boolean(process.stdin.isTTY))) {
4959
- const { runTuiApp } = await import("./tui-app-C0J6HRzv.js");
4975
+ const { runTuiApp } = await import("./tui-app-CcxiwZyM.js");
4960
4976
  await runTuiApp();
4961
4977
  return;
4962
4978
  }
@@ -4983,4 +4999,4 @@ export {
4983
4999
  sanitizeLabel as s,
4984
5000
  toLines as t
4985
5001
  };
4986
- //# sourceMappingURL=bin-C_hgDdSf.js.map
5002
+ //# sourceMappingURL=bin-DETwedpj.js.map