@buildaharness/aielia 0.3.8 → 0.3.10
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/_memory-core-generated.d.ts +6 -0
- 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/assistant.d.ts +11 -0
- package/dist/{bin-DETwedpj.js → bin-Cz3FY6Ew.js} +144 -254
- package/dist/bin-Cz3FY6Ew.js.map +1 -0
- package/dist/claude-cli-llm-client.d.ts +2 -0
- package/dist/claude-cli-prompt.d.ts +7 -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/fact-repository.contract.d.ts +2 -0
- package/dist/fact-repository.d.ts +44 -0
- package/dist/file-tools-mcp-server.mjs +29 -0
- package/dist/goal-graph-store.d.ts +6 -0
- package/dist/harness-bridge.d.ts +5 -5
- package/dist/html-to-markdown.d.ts +11 -0
- package/dist/index.d.ts +98 -3
- package/dist/index.js +5003 -150
- package/dist/index.js.map +1 -1
- package/dist/layer-settings.d.ts +16 -3
- package/dist/llm-client-factory.d.ts +13 -0
- package/dist/memory-events.d.ts +177 -0
- package/dist/memory-service.d.ts +17 -0
- package/dist/model-pricing.d.ts +15 -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-DG8iYm_F.js} +14471 -13032
- package/dist/provider-setup-DG8iYm_F.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/scripted-llm-client.d.ts +1 -1
- package/dist/{tui-app-CcxiwZyM.js → tui-app-oWbIUcBW.js} +3 -3
- package/dist/{tui-app-CcxiwZyM.js.map → tui-app-oWbIUcBW.js.map} +1 -1
- package/dist/turn-abort.d.ts +5 -0
- 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/dist/web-fetch-core.d.ts +0 -14
- package/dist/writer/article-autosave.d.ts +12 -0
- package/dist/writer/article-change-summary.d.ts +28 -0
- package/dist/writer/article-claims.d.ts +49 -0
- package/dist/writer/article-comments.d.ts +20 -0
- package/dist/writer/article-consistency.d.ts +27 -0
- package/dist/writer/article-decorations.d.ts +23 -0
- package/dist/writer/article-dependencies.d.ts +44 -0
- package/dist/writer/article-draft.d.ts +23 -0
- package/dist/writer/article-edit-outline.d.ts +16 -0
- package/dist/writer/article-edit-suggest.d.ts +30 -0
- package/dist/writer/article-folder.d.ts +29 -0
- package/dist/writer/article-history.d.ts +73 -0
- package/dist/writer/article-ideas.d.ts +34 -0
- package/dist/writer/article-issues.d.ts +47 -0
- package/dist/writer/article-marks.d.ts +25 -0
- package/dist/writer/article-memory-store.d.ts +3 -0
- package/dist/writer/article-model.d.ts +1337 -0
- package/dist/writer/article-outline.d.ts +43 -0
- package/dist/writer/article-resolver.d.ts +55 -0
- package/dist/writer/article-revisions.d.ts +30 -0
- package/dist/writer/article-rules.d.ts +60 -0
- package/dist/writer/article-sections.d.ts +26 -0
- package/dist/writer/article-selection.d.ts +26 -0
- package/dist/writer/article-service.d.ts +542 -0
- package/dist/writer/article-source-links.d.ts +42 -0
- package/dist/writer/article-sources.d.ts +82 -0
- package/dist/writer/article-style-derive.d.ts +26 -0
- package/dist/writer/article-style.d.ts +31 -0
- package/dist/writer/article-suggestions.d.ts +33 -0
- package/dist/writer/article-support.d.ts +33 -0
- package/dist/writer/article-verify.d.ts +42 -0
- package/dist/writer/local-folder.d.ts +49 -0
- package/dist/writer/model-failure-hint.d.ts +7 -0
- package/dist/writer/repo-reader.d.ts +29 -0
- package/dist/writer/repo-search.d.ts +33 -0
- package/dist/writer/repo-verify-loop.d.ts +61 -0
- package/dist/writer/text-tool-calls.d.ts +11 -0
- package/dist/writer/work-progress.d.ts +51 -0
- package/dist/writer/write-activity.d.ts +61 -0
- package/dist/writer/write-models.d.ts +12 -0
- package/dist/writer/write-parameters.d.ts +31 -0
- package/dist/writer/write-permissions.d.ts +89 -0
- package/dist/writer/write-spend.d.ts +16 -0
- package/dist/writer/writer-chat-capture.d.ts +25 -0
- package/dist/writer/writer-chat-history.d.ts +17 -0
- package/dist/writer/writer-chat-state.d.ts +358 -0
- package/dist/writer/writer-chat-turn.d.ts +52 -0
- package/dist/writer/writer-intent.d.ts +20 -0
- package/package.json +3 -3
- package/dist/bin-DETwedpj.js.map +0 -1
- package/dist/provider-setup-wX2IBw2X.js.map +0 -1
package/README.md
CHANGED
|
@@ -670,8 +670,10 @@ Set `ASSISTANT_ENABLE_WEB=1` (plus `BRAVE_SEARCH_API_KEY`) to give the model
|
|
|
670
670
|
real `web_search`/`fetch_url` tools (no approval needed — see "Web access via
|
|
671
671
|
tools" above) and `ASSISTANT_ENABLE_SHELL=1` to give it a real, approval-gated
|
|
672
672
|
`run_shell_command` tool scoped to `ASSISTANT_WORKSPACE_DIR`. Both are off by
|
|
673
|
-
default
|
|
674
|
-
`
|
|
673
|
+
default. Every on/off variable (`ASSISTANT_ENABLE_WEB`, `ASSISTANT_ENABLE_SHELL`,
|
|
674
|
+
`ASSISTANT_ENABLE_EMAIL`, `ASSISTANT_DANGEROUSLY_SKIP_PERMISSIONS`) takes `1` or `true` for on and `0` or
|
|
675
|
+
`false` for off; any other value (`yes`, `True`) is treated as off, with a warning that names the variable
|
|
676
|
+
(a stray `ASSISTANT_ENABLE_SHELL=0` left in an env file does not enable it). Optional
|
|
675
677
|
`ASSISTANT_SHELL_TIMEOUT_MS` (default 30000) tunes the shell timeout:
|
|
676
678
|
|
|
677
679
|
```bash
|
|
@@ -944,9 +946,10 @@ ends the session.
|
|
|
944
946
|
| `/model [name]` | Show the active model, or switch it — a thin alias over `/config set model <name>` (see "Configuration" above); rejected the same way if `model` is pinned by `ASSISTANT_MODEL` |
|
|
945
947
|
| `/cost` | Show token usage for the last turn and the running session total |
|
|
946
948
|
| `/doctor` | Check proxy reachability (proxy backend) or the `claude` binary (claude-cli backend), plus workspace root and data dir health — no dedicated check yet for the anthropic/openai/openrouter backends, only the backend-agnostic checks run for those |
|
|
947
|
-
| `/why` | Explain the
|
|
949
|
+
| `/why` | Explain the last turn: confidence, whether the reply was checked against what was read, the layers that fired, and what memory the prompt held. The chat app (web and desktop) answers the same command with the same lines |
|
|
948
950
|
| `/layers` | Show all 11 harness layers: fired or skipped, and why, for the last turn. `/layers settings` lists the reasoning layers with their cost/evidence; `/layers on\|off\|reset <id>` changes a layer's persisted on/off choice (an operator-set `AUDIT_*` env flag wins and shows as pinned) |
|
|
949
951
|
| `/sources` | List files/URLs the last turn actually consulted |
|
|
952
|
+
| `/steps` | List the tool calls the last turn made, in order |
|
|
950
953
|
| `/plan` | Show the active structured plan's task status |
|
|
951
954
|
| `/plan sketch <request>` | One-shot, advisory plan sketch: no plan record, nothing staged, cannot execute |
|
|
952
955
|
| `/goals` | Review every known goal thread this session: status, tasks and visibility (freshly computed, carried over, done, suggested) |
|
|
@@ -1762,3 +1762,9 @@ export declare const INV16: {
|
|
|
1762
1762
|
readonly neverPromotable: readonly ["agent", "tool", "web"];
|
|
1763
1763
|
readonly neverReturnedTiers: readonly ["procedural", "commitment"];
|
|
1764
1764
|
};
|
|
1765
|
+
export declare const MEMORY_EVENT_STORE_KEY: "memory:events";
|
|
1766
|
+
export declare const MEMORY_EVENT_KEEP: 500;
|
|
1767
|
+
export declare const MEMORY_EVENT_KINDS: readonly ["promote", "decline", "correct", "contradict", "supersede", "retire", "forget", "expire", "restore", "recall"];
|
|
1768
|
+
export declare const MEMORY_REASON_CODES: readonly ["user_stated", "user_corrected", "user_confirmed", "user_rejected", "inferred_high_conf", "inferred_pending_confirmation", "inferred_low_conf_session_only", "conflicts_with_fact", "superseded_by_newer", "explicit_forget", "retention_expired", "gate_blocked_secret", "gate_blocked_instruction", "duplicate"];
|
|
1769
|
+
export declare const MEMORY_SOURCE_TYPES: readonly ["user_message", "assistant_message", "tool_result", "prior_fact", "user_command"];
|
|
1770
|
+
export declare const MEMORY_DECIDED_BY: readonly ["user", "classifier", "reviewer", "consolidation", "rule"];
|
|
@@ -51,6 +51,8 @@ export declare class ActionApprovalService {
|
|
|
51
51
|
}[];
|
|
52
52
|
/** Sessions in which a command got the network-containment refusal. */
|
|
53
53
|
private readonly networkDeniedSessions;
|
|
54
|
+
/** Per session: where in appliedActions the actions of the request now being approved begin (see resolvePendingActionOnce). */
|
|
55
|
+
private readonly chainStartBySession;
|
|
54
56
|
/** Pending-action ids currently being resolved (see resolvePendingAction). */
|
|
55
57
|
private readonly inFlightResolutions;
|
|
56
58
|
networkDenied(sessionId: string): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AskAnswer, AskQuestion, AskQuestionOption } from '@buildaharness/harness';
|
|
2
|
+
/**
|
|
3
|
+
* One question's in-progress answer, shared by the CLI's text prompt and AskQuestionCard.tsx. Kept
|
|
4
|
+
* separate from AskAnswer itself so a user can flip between picking an option and typing free text
|
|
5
|
+
* without losing whichever they touched last; draftToAnswer collapses it to the wire shape.
|
|
6
|
+
*/
|
|
7
|
+
export interface QuestionDraft {
|
|
8
|
+
selectedLabels: string[];
|
|
9
|
+
editText: string;
|
|
10
|
+
freeText: string;
|
|
11
|
+
/**
|
|
12
|
+
* Only the card sets this: it hides the note field without clearing the text, so `false` means "ignore
|
|
13
|
+
* editText". Left unset (the CLI, which only fills editText through its explicit `e<n>` command), a
|
|
14
|
+
* non-empty editText counts.
|
|
15
|
+
*/
|
|
16
|
+
showEdit?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function emptyDraft(): QuestionDraft;
|
|
19
|
+
/** Recommended option(s) first, stable otherwise, so the same question lists its options in the same order on every surface. */
|
|
20
|
+
export declare function orderedOptions(question: AskQuestion): AskQuestionOption[];
|
|
21
|
+
/** Collapses one question's draft into the wire AskAnswer shape, or null while still unanswered (INV-28). */
|
|
22
|
+
export declare function draftToAnswer(questionId: string, draft: QuestionDraft): AskAnswer | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PersonalAssistantOptions } from './assistant.js';
|
|
2
|
+
import { AssistantConfig } from './config.js';
|
|
3
|
+
/** Which of the config-derived options a surface passes at all. A surface that leaves one off gets PersonalAssistant's default for it. */
|
|
4
|
+
export interface AssistantFeatures {
|
|
5
|
+
spendCap: boolean;
|
|
6
|
+
ambiguityGuard: boolean;
|
|
7
|
+
/** Passes `config.activeProject`, falling back to `platform.workspaceRoot`. */
|
|
8
|
+
activeProject: boolean;
|
|
9
|
+
consolidateOnNewSession: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** What only the surface can supply: its LLM client, storage, tools and logging, plus which optional features it enables. */
|
|
12
|
+
export interface AssistantPlatform {
|
|
13
|
+
llmClient: NonNullable<PersonalAssistantOptions['llmClient']>;
|
|
14
|
+
memory?: PersonalAssistantOptions['memory'];
|
|
15
|
+
experienceStore?: PersonalAssistantOptions['experienceStore'];
|
|
16
|
+
checkpointStore?: PersonalAssistantOptions['checkpointStore'];
|
|
17
|
+
reminderStore?: PersonalAssistantOptions['reminderStore'];
|
|
18
|
+
fileTools?: PersonalAssistantOptions['fileTools'];
|
|
19
|
+
shellTools?: PersonalAssistantOptions['shellTools'];
|
|
20
|
+
webTools?: PersonalAssistantOptions['webTools'];
|
|
21
|
+
actionTools?: PersonalAssistantOptions['actionTools'];
|
|
22
|
+
onDebugLog?: PersonalAssistantOptions['onDebugLog'];
|
|
23
|
+
/** Default project when `config.activeProject` is unset (only used when `features.activeProject`). */
|
|
24
|
+
workspaceRoot?: string;
|
|
25
|
+
features: AssistantFeatures;
|
|
26
|
+
}
|
|
27
|
+
/** What each surface enables. The parity test snapshots the keys each preset passes. */
|
|
28
|
+
export declare const CLI_FEATURES: AssistantFeatures;
|
|
29
|
+
export declare const DESKTOP_FEATURES: AssistantFeatures;
|
|
30
|
+
export declare const WEB_FEATURES: AssistantFeatures;
|
|
31
|
+
/**
|
|
32
|
+
* The PersonalAssistant.create options derived from AssistantConfig, built once for every surface. Keys a
|
|
33
|
+
* surface leaves unset are omitted rather than passed as undefined, so PersonalAssistant's defaults apply.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildAssistantOptions(config: AssistantConfig, platform: AssistantPlatform): PersonalAssistantOptions;
|
|
@@ -93,7 +93,7 @@ export declare class AssistantSession {
|
|
|
93
93
|
}>;
|
|
94
94
|
/**
|
|
95
95
|
* Called once per successfully completed ('ok') turn — counts turns, not raw internal LLM
|
|
96
|
-
* calls (see SpendCapConfig's doc comment for why). Estimates cost the same way
|
|
96
|
+
* calls (see SpendCapConfig's doc comment for why). Estimates cost the same way turn-cost.ts's
|
|
97
97
|
* withCostEstimate does for a backend that doesn't report a real costUsd, so the cap enforces
|
|
98
98
|
* against the same number /cost displays, not a second cost model.
|
|
99
99
|
*
|
package/dist/assistant.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ import { WebToolsContext } from './web-tools.js';
|
|
|
6
6
|
import { ShellToolsContext } from './shell-tools.js';
|
|
7
7
|
import { ActionToolsContext } from './action-tools.js';
|
|
8
8
|
import { SpendCapConfig, SpendState } from './spend-cap.js';
|
|
9
|
+
import { WriterChatPort } from './writer/writer-chat-turn.js';
|
|
9
10
|
import { TraceEvent } from './trace-events.js';
|
|
10
11
|
import { AssistantToolStep } from './tool-step.js';
|
|
11
12
|
import { MemoryService, MemorySummary, MemoryExport, AuditEntry, MemoryStatus, MemoryInjection, ConsolidationOutcome } from './memory-service.js';
|
|
13
|
+
import { EventFilter, MemoryEvent } from './memory-events.js';
|
|
12
14
|
import { MemoryWriteMode } from './memory-governance.js';
|
|
13
15
|
import { ConsolidationProposal } from './memory-consolidation.js';
|
|
14
16
|
import { UserFact } from './fact-extraction.js';
|
|
@@ -233,6 +235,12 @@ export interface PersonalAssistantOptions {
|
|
|
233
235
|
* Off by default.
|
|
234
236
|
*/
|
|
235
237
|
dangerouslySkipPermissions?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Aielia Write (T13): when set, each writer message is read for reviewer comments, decisions and corrections to sources, the result is
|
|
240
|
+
* stored per article through this port (not per session), and the open items of the active article are added to the system prompt
|
|
241
|
+
* on every turn. Unset (every other caller) means none of this runs. See plans/aielia_write_article_model_plan.html, section 8.
|
|
242
|
+
*/
|
|
243
|
+
writerChat?: WriterChatPort;
|
|
236
244
|
/**
|
|
237
245
|
* Opt-in session spend/turn-count ceilings — see spend-cap.ts. Undefined by default, same as
|
|
238
246
|
* every other field here that changes behavior only when a caller sets it: no ceiling means
|
|
@@ -323,6 +331,7 @@ export declare class PersonalAssistant {
|
|
|
323
331
|
private readonly onTrace?;
|
|
324
332
|
private readonly onDebugLog?;
|
|
325
333
|
private readonly dangerouslySkipPermissions;
|
|
334
|
+
private readonly writerChat;
|
|
326
335
|
/** Whenever any of fileTools/webTools/shellTools is configured, `turn()` routes through AgentLoop instead of a single plain chat call — computed once here since it never changes for the lifetime of an instance. */
|
|
327
336
|
private readonly toolLoopWillRun;
|
|
328
337
|
/** R3 of the internal plan — mirrors the same flag HarnessBridge was given at construction, kept here too so runTurn can decide whether to defer the tool loop into a harness-driven proposer instead of precomputing draftReply. See PersonalAssistantOptions.oneLoopMode's doc comment. */
|
|
@@ -555,6 +564,8 @@ export declare class PersonalAssistant {
|
|
|
555
564
|
forgetFact(selector: string, sessionId: string, erase?: boolean): Promise<MemoryPendingOutcome>;
|
|
556
565
|
/** `/memory history` — the newest audit-log entries (M2). Empty unless `AUDIT_MEMORY_AUDIT_LOG` is on. */
|
|
557
566
|
memoryHistory(limit?: number): Promise<AuditEntry[]>;
|
|
567
|
+
/** `/memory history events [fact]` — transition events with reason and sources (`AUDIT_MEMORY_EVENTS`, default on). */
|
|
568
|
+
memoryEvents(limit?: number, filter?: EventFilter): Promise<MemoryEvent[]>;
|
|
558
569
|
/** `/memory undo <seq>` — restores the pre-image of one audit entry (M2). */
|
|
559
570
|
undoMemoryChange(selector: string, sessionId: string): Promise<{
|
|
560
571
|
ok: boolean;
|