@buildaharness/aielia 0.3.8 → 0.3.9
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 +6 -3
- package/dist/action-approval-service.d.ts +2 -0
- package/dist/ask-draft.d.ts +22 -0
- package/dist/assistant-options.d.ts +35 -0
- package/dist/assistant-session.d.ts +1 -1
- package/dist/{bin-DETwedpj.js → bin-CCwDFxDe.js} +118 -247
- package/dist/bin-CCwDFxDe.js.map +1 -0
- package/dist/cli-config.d.ts +2 -2
- package/dist/cli-session.d.ts +2 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1 -1
- package/dist/commands.d.ts +32 -0
- package/dist/config-keys.d.ts +43 -0
- package/dist/doctor-checks.d.ts +1 -2
- package/dist/fact-extraction.d.ts +4 -0
- package/dist/goal-graph-store.d.ts +6 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +199 -148
- package/dist/index.js.map +1 -1
- package/dist/llm-client-factory.d.ts +13 -0
- package/dist/memory-service.d.ts +2 -0
- package/dist/model-pricing.d.ts +12 -9
- package/dist/node-display-names.d.ts +1 -1
- package/dist/project-command.d.ts +16 -0
- package/dist/{provider-setup-wX2IBw2X.js → provider-setup-Cy9dwqrd.js} +13504 -13034
- package/dist/provider-setup-Cy9dwqrd.js.map +1 -0
- package/dist/proxy-health.d.ts +8 -0
- package/dist/redact-url.d.ts +2 -0
- package/dist/reply-audit.d.ts +2 -0
- package/dist/response-service.d.ts +10 -0
- package/dist/run-explain.d.ts +58 -0
- package/dist/{tui-app-CcxiwZyM.js → tui-app-Dt72u8vZ.js} +3 -3
- package/dist/{tui-app-CcxiwZyM.js.map → tui-app-Dt72u8vZ.js.map} +1 -1
- package/dist/turn-cost.d.ts +12 -0
- package/dist/turn-presentation.d.ts +86 -0
- package/dist/undo-action-command.d.ts +12 -0
- package/dist/undo-plan.d.ts +13 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/bin-DETwedpj.js.map +0 -1
- package/dist/provider-setup-wX2IBw2X.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TokenUsage } from '@buildaharness/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a static-table cost estimate to a turn's usage. claude-cli (total_cost_usd) and openrouter
|
|
4
|
+
* (usage.cost) report a real dollar cost, and a real `costUsd` is never overwritten; every other
|
|
5
|
+
* case (proxy, anthropic, openai: token counts only) gets an approximate estimate, see model-pricing.ts.
|
|
6
|
+
* The model is `model`, else the backend's own default, else the Anthropic default. One function for the
|
|
7
|
+
* CLI's /cost, the apps' cost line and the spend cap, so they cannot disagree.
|
|
8
|
+
*/
|
|
9
|
+
export declare function withCostEstimate(usage: TokenUsage, { backend, model }: {
|
|
10
|
+
backend?: string;
|
|
11
|
+
model?: string;
|
|
12
|
+
}): TokenUsage;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AskQuestion } from '@buildaharness/harness';
|
|
2
|
+
import { AssistantTurnResult } from './assistant-types.js';
|
|
3
|
+
import { NextStepSuggestion } from './next-step-proposer.js';
|
|
4
|
+
/**
|
|
5
|
+
* What to show for a finished turn, decided once for every surface. The CLI prints it and chat-ui renders it as
|
|
6
|
+
* cards; neither re-reads the status branches of AssistantTurnResult. Hints are data, not formatted strings,
|
|
7
|
+
* because the CLI prints them inline and the apps render them as elements.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_APPROVAL_REASON = "This action needs approval.";
|
|
10
|
+
export declare const DEFAULT_ESCALATION_REASON = "Aielia halted and needs more information.";
|
|
11
|
+
export declare const DEFAULT_CLARIFICATION_REASON = "This request needs clarification.";
|
|
12
|
+
export declare const MISSING_PLAN_APPROVAL_ID_REASON = "A plan is awaiting approval, but its approval id is missing.";
|
|
13
|
+
type PendingActionKind = NonNullable<AssistantTurnResult['pendingActionKind']>;
|
|
14
|
+
/** Label and question for a staged action's approval. No kind means a plain write (the original, default pause). */
|
|
15
|
+
export declare function approvalLabels(kind: PendingActionKind | undefined): {
|
|
16
|
+
kindLabel: string;
|
|
17
|
+
promptText: string;
|
|
18
|
+
};
|
|
19
|
+
/** The "No harness trace" explanations for /why and /layers, one place so every surface words each case the same. */
|
|
20
|
+
export declare const NO_TRACE: {
|
|
21
|
+
readonly fastPath: "No harness trace — the last turn was a simple, self-contained question answered directly without activating the harness (fast path).";
|
|
22
|
+
readonly stagedAction: (kindLabel: string, resolution?: "approved" | "declined") => string;
|
|
23
|
+
readonly messageApproval: (resolution?: "approved" | "declined") => string;
|
|
24
|
+
readonly planApproval: (resolution?: "approved" | "declined", pendingHint?: string) => string;
|
|
25
|
+
readonly clarification: (unanswerableReason?: string) => string;
|
|
26
|
+
readonly escalated: (reason: string | undefined) => string;
|
|
27
|
+
readonly stopped: "No harness trace — the last turn was stopped before it finished.";
|
|
28
|
+
readonly failed: "No harness trace — the last turn failed with an error.";
|
|
29
|
+
};
|
|
30
|
+
export interface TurnHints {
|
|
31
|
+
/** Number of sources the turn consulted (shown as "N sources — /sources"). */
|
|
32
|
+
sourcesCount?: number;
|
|
33
|
+
/** Plan completion, 0–100, when a plan is active. */
|
|
34
|
+
planCompletionPct?: number;
|
|
35
|
+
contradictionNotice?: string;
|
|
36
|
+
reviewNotice?: string;
|
|
37
|
+
auditNotice?: string;
|
|
38
|
+
/** Set when a turn was paused part-way; appended after the streamed reply. */
|
|
39
|
+
pausedNote?: string;
|
|
40
|
+
nextSteps?: NextStepSuggestion[];
|
|
41
|
+
}
|
|
42
|
+
export type TurnPresentation = {
|
|
43
|
+
kind: 'reply';
|
|
44
|
+
text: string;
|
|
45
|
+
riskLevel?: AssistantTurnResult['riskLevel'];
|
|
46
|
+
hints: TurnHints;
|
|
47
|
+
noTraceReason?: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'approval';
|
|
50
|
+
/** 'action': a staged write/shell/email/batch/revert (resume with pendingActionId). 'message': the message-level risk gate. */
|
|
51
|
+
scope: 'action' | 'message';
|
|
52
|
+
reason: string;
|
|
53
|
+
riskLevel?: AssistantTurnResult['riskLevel'];
|
|
54
|
+
pendingActionId?: string;
|
|
55
|
+
pendingActionKind?: PendingActionKind;
|
|
56
|
+
kindLabel?: string;
|
|
57
|
+
promptText?: string;
|
|
58
|
+
noTraceReason: string;
|
|
59
|
+
} | {
|
|
60
|
+
kind: 'clarification';
|
|
61
|
+
questions: AskQuestion[];
|
|
62
|
+
pendingClarificationId: string;
|
|
63
|
+
riskLevel?: AssistantTurnResult['riskLevel'];
|
|
64
|
+
noTraceReason: string;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'plan_approval';
|
|
67
|
+
planApprovalId: string;
|
|
68
|
+
/** Absent when the harness staged a plan but did not hand over its tasks; a surface that needs them to render may treat that as an escalation. */
|
|
69
|
+
planApproval?: AssistantTurnResult['planApproval'];
|
|
70
|
+
reason?: string;
|
|
71
|
+
riskLevel?: AssistantTurnResult['riskLevel'];
|
|
72
|
+
noTraceReason: string;
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'escalation';
|
|
75
|
+
reason: string;
|
|
76
|
+
noTraceReason: string;
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'cancelled';
|
|
79
|
+
noTraceReason: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Maps a turn result to what every surface shows. `pendingActionId` on the *request* (a resumed staged action)
|
|
83
|
+
* is the surface's business, not this function's: a resumed turn's result is still presented as a reply.
|
|
84
|
+
*/
|
|
85
|
+
export declare function presentTurnResult(result: AssistantTurnResult): TurnPresentation;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/undo-action [id]` for every surface: no argument lists the revertible filesystem effects, an id stages a
|
|
3
|
+
* revert of that one (which then goes through the ordinary approval card or prompt). Pure: the surface calls the
|
|
4
|
+
* assistant and renders; this only decides which of the two was asked for.
|
|
5
|
+
*/
|
|
6
|
+
export type UndoActionCommand = {
|
|
7
|
+
kind: 'list';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'stage';
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseUndoActionCommand(args: readonly string[]): UndoActionCommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChatMessage } from '@buildaharness/runtime';
|
|
2
|
+
export type UndoPlan = {
|
|
3
|
+
nothingToUndo: true;
|
|
4
|
+
} | {
|
|
5
|
+
nothingToUndo: false;
|
|
6
|
+
wasPendingApproval: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* What /undo and the apps' Undo button must know from the transcript before calling undoLastTurn: an empty
|
|
10
|
+
* transcript has nothing to undo, and a transcript whose last message is not the assistant's is a turn still
|
|
11
|
+
* waiting for approval (no reply was appended). The notices shown to the user are each surface's own.
|
|
12
|
+
*/
|
|
13
|
+
export declare function planUndo(transcriptBefore: readonly ChatMessage[]): UndoPlan;
|
package/dist/version.d.ts
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* runtime (a bundled/SEA binary has no package.json beside it). `scripts/check-cli-version-sync.mjs`
|
|
4
4
|
* fails CI if this drifts from `package.json`'s `version` — bump both together.
|
|
5
5
|
*/
|
|
6
|
-
export declare const CLI_VERSION = "0.3.
|
|
6
|
+
export declare const CLI_VERSION = "0.3.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildaharness/aielia",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "An open-source AI agent you can hand real work to. Runs the full 11-layer Build A Harness every turn, controlling what it may do, believe and spend, and stages file writes, shell commands and email for your approval. CLI, browser, and desktop.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://myaielia.com",
|