@buildaharness/aielia 0.3.6 → 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.
package/README.md CHANGED
@@ -794,7 +794,7 @@ keychain — so treat that file accordingly. When
794
794
  `ASSISTANT_MODEL`/`/config set model` isn't set, each backend falls back to the
795
795
  current-generation default id exported from `@buildaharness/runtime`'s
796
796
  `model-defaults.ts` (`openai` → `gpt-5-mini`, `openrouter` →
797
- `anthropic/claude-sonnet-5`, `anthropic` and `proxy` → `claude-sonnet-5`).
797
+ `deepseek/deepseek-v4-flash`, `anthropic` and `proxy` → `claude-sonnet-5`).
798
798
 
799
799
  Transcript, learned experience, reminders, and any in-flight turn's checkpoint
800
800
  persist as real files under `~/.buildaharness/personal-assistant/`
@@ -881,7 +881,7 @@ mode flags take `enabled`/`disabled`):
881
881
  | `askMode` (`ASSISTANT_ASK_MODE`) | `disabled` | See "Clarifying questions" |
882
882
  | `planMode` (`ASSISTANT_PLAN_MODE`) | `legacy` | `gated` or `legacy` plan rollout |
883
883
  | `ambiguityGuardMode` (`ASSISTANT_AMBIGUITY_GUARD`) | `disabled` | Ambiguity guard |
884
- | `tuiMode` (`ASSISTANT_TUI`) | `disabled` | Full-screen terminal UI (Ink); only on a real TTY |
884
+ | `tuiMode` (`ASSISTANT_TUI`) | `enabled` | Full-screen terminal UI (Ink); only on a real TTY |
885
885
  | `updateCheck` (`ASSISTANT_UPDATE_CHECK`) | `enabled` | Passive update check |
886
886
  | `activeProject` (`ASSISTANT_ACTIVE_PROJECT`) | none | Project new project-scoped facts are tagged with (`/project`) |
887
887
  | `goalGraphMode`, `goalGraphSuggestMode` (`ASSISTANT_GOAL_GRAPH`, `ASSISTANT_GOAL_GRAPH_SUGGEST`) | `enabled` in the CLI | Goal tree, steering and next-step options |
@@ -7,8 +7,8 @@ import { createInterface } from "node:readline";
7
7
  import { rename, stat, realpath, readdir, mkdir, unlink, writeFile, readFile } from "node:fs/promises";
8
8
  import { homedir, tmpdir } from "node:os";
9
9
  import { fileURLToPath, pathToFileURL } from "node:url";
10
- import { OPENROUTER_DEFAULT_MODEL, OPENAI_DEFAULT_MODEL, ANTHROPIC_DEFAULT_MODEL, InMemoryReminderStore, FileSystemAdapter, FileSystemExperienceStore, LLMClient, OpenAICompatibleLLMClient, OPENROUTER_EXTRA_HEADERS, OPENROUTER_BASE_URL, OPENAI_BASE_URL, AnthropicLLMClient } from "@buildaharness/runtime";
11
- import { X as buildClaudePrompt, bJ as stripJsonCodeFence, bn as recallToolEnabled, aY as lexicalOffEnvValue, a as ALREADY_STAGED_ACTION_TOOL, bI as stagedActionInput, bh as parseClaudeCliOutput, bK as stripMcpToolPrefix, bo as redactUrlCredentials, b4 as memoryStatusChecks, bg as normalizePlanNodes, P as PROVIDER_SETUP, a3 as cleanApiKey, Z as checkApiKeyFormat, af as envOverridesFromProcessEnv, br as resolveConfig, bG as shouldLaunchTuiApp, Q as applyLayerSettings, bE as sanitizeLayerChoices, bP as testApiKey, bS as validateConfig, an as findInvalidNumericSettings, c as ConfigValidationError, aG as formatSpendCapStatus, aT as isPlanGraphEnabled, bL as stripTerminalControls, z as PersonalAssistant, aQ as isGoalGraphSuggestEnabled, aP as isGoalGraphEnabled, bm as planToSnapshot, V as braveSearch, a7 as createSmtpSender, a6 as createResendSender, aV as isQuitCommand, x as LiveSteeringChannel, aD as formatNextSteps, _ as classifyError, b7 as nodeToLayer, L as LAYER_DISPLAY_NAME, b6 as nodeDisplayName, ah as estimateCostUsd, ap as formatConfigListing, aO as isConfigKey, C as CONFIG_KEYS, E as ENV_VAR_FOR_CONFIG_KEY, bi as parseConfigValue, d as ConfigValueParseError, ar as formatDoctorReport, aq as formatCostSummary, at as formatGoalGraphState, aF as formatSearchResults, ay as formatMemoryHistory, aB as formatMemoryStatus, aA as formatMemoryPendingOutcome, aw as formatMemoryArchive, aJ as formatUndoLogListing, aa as defaultExportFilename, aI as formatTranscriptMarkdown, aH as formatStatus, au as formatHelp, q as LAYER_ORDER, av as formatLayerListing, bT as withLayerChoice, w as LayerSettingError, az as formatMemoryInjection, Y as buildWhyChain, s as LAYER_SHORT_CODE, ab as defaultMemoryExportFilename, ax as formatMemoryExport, b3 as memoryAuditLogEnabled, aC as formatMemorySummary } from "./provider-setup-CV3S_TAS.js";
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, 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.6";
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
  }
@@ -3506,7 +3506,8 @@ async function buildAssistant(config, { backend, dataDir, remindersFile }) {
3506
3506
  const llmClient = buildLlmClient(config, workspaceRoot, remindersFile);
3507
3507
  return PersonalAssistant.create({
3508
3508
  llmClient,
3509
- model: config.model,
3509
+ // Name the backend's real default when none is set, so spend tracking prices the model that actually runs (not the Anthropic default).
3510
+ model: config.model ?? defaultModelForBackend(config.llmBackend),
3510
3511
  // config.activeProject (set via /project <name>) overrides the default of "the workspace
3511
3512
  // I'm running in" — see PersonalAssistantOptions.activeProject's doc comment.
3512
3513
  activeProject: config.activeProject || workspaceRoot,
@@ -3551,7 +3552,6 @@ async function buildAssistant(config, { backend, dataDir, remindersFile }) {
3551
3552
  });
3552
3553
  }
3553
3554
  async function runCli(options = {}) {
3554
- printSafe("Aielia is alpha software — expect rough edges and breaking changes. It uses AI models and can make mistakes; verify anything important.\n");
3555
3555
  const dataDir = options.dataDir ?? defaultDataDir;
3556
3556
  const configStore = options.configStore ?? defaultConfigStore;
3557
3557
  const backend = options.backend ?? defaultBackend;
@@ -3619,21 +3619,34 @@ Fix it by setting the missing value (in the config file under ${dataDir}, or via
3619
3619
  openai: OPENAI_DEFAULT_MODEL,
3620
3620
  openrouter: OPENROUTER_DEFAULT_MODEL
3621
3621
  };
3622
- printSafe(`backend: ${config.llmBackend} (${config.model ?? backendDisplayModel[config.llmBackend]})`);
3622
+ const backendLine = `${config.llmBackend} · ${config.model ?? backendDisplayModel[config.llmBackend]}`;
3623
3623
  const enabledCapabilities = [];
3624
3624
  if (config.enableWeb) enabledCapabilities.push("web search/fetch (brave)");
3625
3625
  if (config.enableShell) enabledCapabilities.push(`shell commands (${config.dangerouslySkipPermissions ? "NOT approval-gated" : "approval-gated"})`);
3626
- const capabilitySuffix = enabledCapabilities.length > 0 ? ` — enabled: ${enabledCapabilities.join(", ")}` : "";
3627
- const dangerBanner = config.dangerouslySkipPermissions ? "\n⚠ dangerouslySkipPermissions is ON — every approval prompt (risky messages, file writes, shell commands) is skipped automatically.\n" : "";
3628
- 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." : "";
3629
3630
  const startupUndoLogEntries = await assistant.listUndoLogEntries();
3630
3631
  const undoableFromBefore = startupUndoLogEntries.filter((e) => e.undoable).length;
3631
3632
  const undoBanner = undoableFromBefore > 0 ? `
3632
- ${undoableFromBefore} action${undoableFromBefore === 1 ? "" : "s"} from earlier sessions ${undoableFromBefore === 1 ? "is" : "are"} still revertible — see /undo-action.
3633
- ` : "";
3634
- printSafe(`Aielia — your personal assistant on the 11-layer harness, one turn at a time. Ctrl+C to exit.${capabilitySuffix}
3635
- ${dangerBanner}${nonInteractiveBanner}${undoBanner}`);
3636
- 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
+ );
3637
3650
  void assistant.proposeMemoryConsolidation("cli").catch(() => void 0);
3638
3651
  rl.prompt();
3639
3652
  let lastTrace;
@@ -4911,7 +4924,11 @@ ${assistant.getActiveProject() || "(none)"}
4911
4924
  indicators.push(`Model: ${config.model ?? backendDisplayModel[config.llmBackend]}`);
4912
4925
  const spendState = await assistant.getSpendState("cli");
4913
4926
  indicators.push(
4914
- `↑${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
+ )}`
4915
4932
  );
4916
4933
  const spendCapLine = formatSpendCapStatus(spendState, { sessionCostLimitUsd: config.sessionCostLimitUsd, sessionCallLimit: config.sessionCallLimit });
4917
4934
  if (spendCapLine) indicators.push(spendCapLine);
@@ -4954,8 +4971,8 @@ async function mainInner(argv) {
4954
4971
  if (result == null ? void 0 : result.updateAvailable) console.log(updateAvailableNotice(result.latestVersion, CLI_VERSION, isSea));
4955
4972
  });
4956
4973
  }
4957
- if (shouldLaunchTuiApp(config.tuiMode ?? "disabled", Boolean(process.stdout.isTTY), Boolean(process.stdin.isTTY))) {
4958
- const { runTuiApp } = await import("./tui-app-CJq6YaiP.js");
4974
+ if (shouldLaunchTuiApp(config.tuiMode ?? DEFAULT_TUI_MODE, Boolean(process.stdout.isTTY), Boolean(process.stdin.isTTY))) {
4975
+ const { runTuiApp } = await import("./tui-app-CcxiwZyM.js");
4959
4976
  await runTuiApp();
4960
4977
  return;
4961
4978
  }
@@ -4982,4 +4999,4 @@ export {
4982
4999
  sanitizeLabel as s,
4983
5000
  toLines as t
4984
5001
  };
4985
- //# sourceMappingURL=bin-BYRl4xXM.js.map
5002
+ //# sourceMappingURL=bin-DETwedpj.js.map