@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 +2 -2
- package/dist/{bin-BYRl4xXM.js → bin-DETwedpj.js} +35 -18
- package/dist/bin-DETwedpj.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/index.js +127 -127
- package/dist/{provider-setup-CV3S_TAS.js → provider-setup-wX2IBw2X.js} +152 -151
- package/dist/{provider-setup-CV3S_TAS.js.map → provider-setup-wX2IBw2X.js.map} +1 -1
- package/dist/{tui-app-CJq6YaiP.js → tui-app-CcxiwZyM.js} +11 -3
- package/dist/{tui-app-CJq6YaiP.js.map → tui-app-CcxiwZyM.js.map} +1 -1
- package/dist/tui-mode-flag.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/dist/bin-BYRl4xXM.js.map +0 -1
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
|
-
`
|
|
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`) | `
|
|
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 {
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
|
3627
|
-
|
|
3628
|
-
const
|
|
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"}
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
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
|
-
|
|
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 ??
|
|
4958
|
-
const { runTuiApp } = await import("./tui-app-
|
|
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-
|
|
5002
|
+
//# sourceMappingURL=bin-DETwedpj.js.map
|