@autorag/librarian 2.11.0 → 2.12.0
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/NOTICE +6 -0
- package/README.md +7 -4
- package/dist/agent/agent.d.ts +64 -1
- package/dist/agent/answer-citations.d.ts +34 -2
- package/dist/agent/answer-guidelines.d.ts +2 -2
- package/dist/agent/ask-user.d.ts +8 -0
- package/dist/agent/automation-tool.d.ts +45 -0
- package/dist/agent/citation-links.d.ts +23 -0
- package/dist/agent/citation-numbers.d.ts +68 -0
- package/dist/agent/citation-relevance.d.ts +37 -0
- package/dist/agent/conversation-queries.d.ts +31 -0
- package/dist/agent/convert-tool.d.ts +28 -0
- package/dist/agent/evidence-persistence.d.ts +17 -11
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/intent-tracing.d.ts +33 -0
- package/dist/agent/permission-gate.d.ts +78 -0
- package/dist/agent/permission-judgment.d.ts +72 -0
- package/dist/agent/permission-paths.d.ts +23 -0
- package/dist/agent/query-routing.d.ts +14 -17
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/agent/self-config.d.ts +2 -0
- package/dist/agent/user-requests.d.ts +52 -0
- package/dist/automation/config.d.ts +48 -0
- package/dist/automation/daemon.d.ts +31 -0
- package/dist/automation/dispatch.d.ts +13 -0
- package/dist/automation/run-agent.d.ts +22 -0
- package/dist/automation/run.d.ts +32 -0
- package/dist/automation/service.d.ts +61 -0
- package/dist/cli/commands/automate.d.ts +2 -0
- package/dist/cli/config.d.ts +21 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +8336 -4254
- package/dist/cli/open-target.d.ts +9 -0
- package/dist/cli/setup.d.ts +12 -0
- package/dist/convert/cli.d.ts +77 -0
- package/dist/convert/index.d.ts +4 -0
- package/dist/convert/installer.d.ts +84 -0
- package/dist/convert/matrix.d.ts +27 -0
- package/dist/convert/relate.d.ts +30 -0
- package/dist/core.js +32002 -28171
- package/dist/datasource/connector-timeouts.d.ts +6 -2
- package/dist/datasource/crawler-types.d.ts +1 -1
- package/dist/datasource/skills/lazykatok/types.d.ts +2 -2
- package/dist/datasource/skills/mailcrawl/types.d.ts +1 -1
- package/dist/dupey/cli.d.ts +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32047 -28192
- package/dist/mcp/index.js +32054 -28223
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/profiles/agent-factory.d.ts +60 -0
- package/dist/profiles/automation-profiles.d.ts +25 -0
- package/dist/profiles/loop-guard.d.ts +23 -0
- package/dist/profiles/retrieval-tools.d.ts +24 -0
- package/dist/profiles/session-model.d.ts +69 -0
- package/dist/profiles.d.ts +13 -0
- package/dist/profiles.js +34739 -0
- package/dist/retrieval/rerank.d.ts +6 -0
- package/package.json +8 -2
- package/skills/autorag/SKILL.md +73 -2
- package/skills/autorag-setup/SKILL.md +8 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* Intent tracing: every tool the model can call also takes a short `i` argument, one line saying
|
|
4
|
+
* what that call is for. The text is shown while the model works (pi's `Working` loader in the TUI,
|
|
5
|
+
* `progress` events of `searchDocumentsStream` for the CLI and the desktop app), so a long search
|
|
6
|
+
* says what it is doing without the model writing separate progress notes.
|
|
7
|
+
*
|
|
8
|
+
* Pi has no such feature; this mirrors oh-my-pi's. The field exists only on the wire: it is added to
|
|
9
|
+
* the tool declarations of each model request and removed again before the tool validates and runs,
|
|
10
|
+
* so no tool ever sees it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const INTENT_FIELD = "i";
|
|
13
|
+
/** The text to show for a model-written intent, or `undefined` when it is not a usable label. */
|
|
14
|
+
export declare function normalizeIntent(value: unknown): string | undefined;
|
|
15
|
+
/** The intent of the last tool call in an assistant message that carries one, or `undefined`. */
|
|
16
|
+
export declare function intentOfMessage(message: {
|
|
17
|
+
readonly role?: string;
|
|
18
|
+
readonly content?: unknown;
|
|
19
|
+
}): string | undefined;
|
|
20
|
+
/** Whether the tool schema already has its own `i` parameter, which then belongs to the tool. */
|
|
21
|
+
export declare function schemaDefinesIntent(schema: unknown): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The wire schema of a tool with the required `i` field first. A schema that is not an object, that
|
|
24
|
+
* already defines `i`, or that rejects unknown properties comes back unchanged: the tool would
|
|
25
|
+
* refuse the field once the model filled it in.
|
|
26
|
+
*/
|
|
27
|
+
export declare function withIntentField(schema: unknown): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* Wires intent tracing into a pi session: declares `i` on every tool, takes it off the arguments
|
|
30
|
+
* before the tool runs, and, when the session has a terminal UI, shows the newest intent as the
|
|
31
|
+
* working message. Register it in every session whose model calls AutoRAG's tools.
|
|
32
|
+
*/
|
|
33
|
+
export declare function registerIntentTracing(pi: ExtensionAPI): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { JevJudge } from "./jev-extension.js";
|
|
3
|
+
import { type PermissionKind } from "./permission-judgment.js";
|
|
4
|
+
import { type UserRequestLog } from "./user-requests.js";
|
|
5
|
+
export { AUTO_APPROVE_MIN_CONFIDENCE, DEFAULT_MAX_STATE_CHARS, PERMISSION_GATE_QUESTION_ID, } from "./permission-judgment.js";
|
|
6
|
+
/**
|
|
7
|
+
* How much the agent may do to the user's files without asking.
|
|
8
|
+
*
|
|
9
|
+
* - `full`: no gate; the agent does everything on its own, and Jev is never asked.
|
|
10
|
+
* - `ask`: every `bash`, `write`, `edit`, and saved automation is put to the user. Jev is not used.
|
|
11
|
+
* - `auto` (default): Jev classifies each of those calls first. One it finds safe runs; one it flags is approved
|
|
12
|
+
* by Jev when the user's request clearly covers it, and only what Jev will not approve confidently reaches
|
|
13
|
+
* the user.
|
|
14
|
+
*/
|
|
15
|
+
export type PermissionMode = "full" | "ask" | "auto";
|
|
16
|
+
/** Order Shift+Tab cycles through. */
|
|
17
|
+
export declare const PERMISSION_MODES: readonly PermissionMode[];
|
|
18
|
+
/** Mode a fresh interactive or CLI session starts in. */
|
|
19
|
+
export declare const DEFAULT_PERMISSION_MODE: PermissionMode;
|
|
20
|
+
export declare function parsePermissionMode(value: unknown): PermissionMode | undefined;
|
|
21
|
+
export declare function cyclePermissionMode(mode: PermissionMode): PermissionMode;
|
|
22
|
+
type ModeListener = (mode: PermissionMode) => void;
|
|
23
|
+
/** What a session grant covers: one category of change, every call Jev could not classify, or (`ask`) every call. */
|
|
24
|
+
export type GrantKey = PermissionKind | "unclassified" | "all";
|
|
25
|
+
/**
|
|
26
|
+
* Session-wide permission state: the mode, and what the user allowed for the rest of the session. One
|
|
27
|
+
* controller is shared by every pi session of an agent.
|
|
28
|
+
*/
|
|
29
|
+
export declare class PermissionController {
|
|
30
|
+
private current;
|
|
31
|
+
private readonly listeners;
|
|
32
|
+
private readonly granted;
|
|
33
|
+
private readonly created;
|
|
34
|
+
constructor(mode?: PermissionMode);
|
|
35
|
+
get mode(): PermissionMode;
|
|
36
|
+
/** Switches mode. Session grants end with the mode they were given in. */
|
|
37
|
+
set(mode: PermissionMode): void;
|
|
38
|
+
cycle(): PermissionMode;
|
|
39
|
+
subscribe(listener: ModeListener): () => void;
|
|
40
|
+
isGranted(key: GrantKey): boolean;
|
|
41
|
+
grant(keys: readonly GrantKey[]): void;
|
|
42
|
+
/** Records paths a successful call brought into existence: the agent's own files, not the user's originals. */
|
|
43
|
+
markCreated(paths: readonly string[]): void;
|
|
44
|
+
/** Whether the agent created this path, or a folder it lies in, earlier in this session. */
|
|
45
|
+
isCreated(path: string): boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface PermissionGateOptions {
|
|
48
|
+
readonly controller: PermissionController;
|
|
49
|
+
/**
|
|
50
|
+
* Jev, which classifies every gated call. Without one the gate cannot classify, so in `ask` and `auto` it
|
|
51
|
+
* asks the user about every `bash`, `write`, and `edit` call.
|
|
52
|
+
*/
|
|
53
|
+
readonly judge?: JevJudge;
|
|
54
|
+
/**
|
|
55
|
+
* What the user has said in this conversation: the first question, every follow-up, every steer. Jev judges
|
|
56
|
+
* the call against all of it. The host feeds it from the user's own input, so AutoRAG's internal phase
|
|
57
|
+
* prompts are never in it.
|
|
58
|
+
*/
|
|
59
|
+
readonly requests?: UserRequestLog;
|
|
60
|
+
/** Cap on the state shown to Jev, in characters. Default: Jev's context ceiling with a safety margin. */
|
|
61
|
+
readonly maxStateChars?: number;
|
|
62
|
+
/** Files the agent may always write and edit without Jev being asked (the config its self-configuration turn edits). */
|
|
63
|
+
readonly trustedPaths?: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
/** Appended to the system prompt while a gate is active, so the model stays on the happy path. */
|
|
66
|
+
export declare const PERMISSION_PROMPT_ADDENDUM: string;
|
|
67
|
+
/** `ask` addendum: the user sees every call, so the model should batch work and still not refuse requests. */
|
|
68
|
+
export declare const ASK_PROMPT_ADDENDUM: string;
|
|
69
|
+
/**
|
|
70
|
+
* pi extension that gates what the agent does to existing files.
|
|
71
|
+
*
|
|
72
|
+
* Every `bash`, `write`, `edit`, and `manage_automations save` call is gated (reads, searches, and other tools
|
|
73
|
+
* never touch originals and are not asked about). In `ask` each one is put to the user. In `auto` Jev
|
|
74
|
+
* classifies it first: a call it finds safe runs, one it flags is approved by Jev when the user's request
|
|
75
|
+
* clearly covers it, and otherwise put to the user. Shift+Tab and `/permissions` switch the mode; the footer
|
|
76
|
+
* shows it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createPermissionGate(options: PermissionGateOptions): ExtensionFactory;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { SessionEntry } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { JevJudge } from "./jev-extension.js";
|
|
3
|
+
import { type ProposedCall } from "./permission-paths.js";
|
|
4
|
+
import { type UserRequest } from "./user-requests.js";
|
|
5
|
+
/**
|
|
6
|
+
* What a tool call does to the user's existing files, as Jev judges it. A call can be several at once
|
|
7
|
+
* (`mkdir x && mv a x/ && rm b` is a move and a delete).
|
|
8
|
+
*
|
|
9
|
+
* `unclear` is for code whose effect cannot be told from what is shown: an unseen script file, `make clean`,
|
|
10
|
+
* an encoded command. It is asked about like any other category.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PERMISSION_KINDS: readonly ["delete", "move", "rename", "overwrite", "edit", "unclear"];
|
|
13
|
+
export type PermissionKind = (typeof PERMISSION_KINDS)[number];
|
|
14
|
+
export declare function permissionKindQuestionId(kind: PermissionKind): string;
|
|
15
|
+
/** Jev question id of the "may this run without asking?" check that `auto` mode adds to the same batch. */
|
|
16
|
+
export declare const PERMISSION_GATE_QUESTION_ID = "permission_gate";
|
|
17
|
+
/** Jev must be at least this sure before `auto` skips the user. Stricter than jev-use's own 0.5 default. */
|
|
18
|
+
export declare const AUTO_APPROVE_MIN_CONFIDENCE = 0.8;
|
|
19
|
+
/**
|
|
20
|
+
* Largest state the gate shows Jev, in characters. jev-use hands every question back ("oversized") once the
|
|
21
|
+
* state passes {@link DEFAULT_MAX_STATE_TOKENS} estimated tokens (about 4 characters each), and then the gate
|
|
22
|
+
* could not classify anything. The ceiling is read from jev-use so it cannot drift, and 10% is left for
|
|
23
|
+
* jev-use's own estimate being rough.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_MAX_STATE_CHARS: number;
|
|
26
|
+
/** The tool calls the gate classifies. Everything else (reads, searches, MCP tools) never touches originals. */
|
|
27
|
+
export declare function isGatedCall(toolName: string, input: Readonly<Record<string, unknown>>): boolean;
|
|
28
|
+
/** One line (or the command) naming what a call does, for the approval dialog and the notice. */
|
|
29
|
+
export declare function summarizeCall(call: ProposedCall): string;
|
|
30
|
+
/** The earlier calls of this session that ran and succeeded, oldest first. */
|
|
31
|
+
export declare function successfulCalls(branch: readonly SessionEntry[]): ProposedCall[];
|
|
32
|
+
export interface JudgedState {
|
|
33
|
+
readonly call: ProposedCall;
|
|
34
|
+
readonly requests: readonly UserRequest[];
|
|
35
|
+
readonly history: readonly ProposedCall[];
|
|
36
|
+
readonly maxStateChars: number;
|
|
37
|
+
/** Whether the agent itself brought this path into existence earlier in the session. */
|
|
38
|
+
readonly isCreated?: (path: string) => boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The state Jev judges, within `maxStateChars`: how to judge, what the user said, what the agent already did,
|
|
42
|
+
* and the call itself. The call and the history are cut first (the call to 40% of the budget, the history to
|
|
43
|
+
* 20%, each keeping the start and end), and the conversation gets whatever is left, so the whole stays under
|
|
44
|
+
* the ceiling however long any one part is.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildJudgedState({ call, requests, history, maxStateChars, isCreated }: JudgedState): string;
|
|
47
|
+
export interface FlaggedKind {
|
|
48
|
+
readonly kind: PermissionKind;
|
|
49
|
+
/** Jev's probability that the call is in this category; undefined when Jev was unsure and gave none. */
|
|
50
|
+
readonly probability: number | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface Approval {
|
|
53
|
+
readonly approved: boolean;
|
|
54
|
+
/** Why not, when it was not approved. */
|
|
55
|
+
readonly why: string;
|
|
56
|
+
}
|
|
57
|
+
/** Jev's reading of one call, or the reason it could not give one. */
|
|
58
|
+
export type Classification = {
|
|
59
|
+
readonly status: "classified";
|
|
60
|
+
readonly flagged: readonly FlaggedKind[];
|
|
61
|
+
readonly approval: Approval;
|
|
62
|
+
} | {
|
|
63
|
+
readonly status: "failed";
|
|
64
|
+
readonly why: string;
|
|
65
|
+
};
|
|
66
|
+
export type ClassifyOptions = JudgedState;
|
|
67
|
+
/**
|
|
68
|
+
* Asks Jev what `options.call` does to existing files, in one batched request. Never throws: no answer
|
|
69
|
+
* (unreachable, timed out, oversized, a missing verdict) is a `failed` classification, and the gate then
|
|
70
|
+
* asks the user instead of letting the call through.
|
|
71
|
+
*/
|
|
72
|
+
export declare function classifyCall(judge: JevJudge, options: ClassifyOptions): Promise<Classification>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A tool call the gate is about to judge. */
|
|
2
|
+
export interface ProposedCall {
|
|
3
|
+
readonly tool: string;
|
|
4
|
+
readonly input: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly cwd: string;
|
|
6
|
+
}
|
|
7
|
+
/** `raw` as an absolute path: relative to `cwd`, with `~` expanded. */
|
|
8
|
+
export declare function resolveToolPath(raw: string, cwd: string): string;
|
|
9
|
+
export interface NamedPath {
|
|
10
|
+
readonly path: string;
|
|
11
|
+
/**
|
|
12
|
+
* True when the word is certainly a path (absolute, `~/`, `./`, `../`, a file name with an extension) or
|
|
13
|
+
* names something that exists. A plain word that exists nowhere (`fresh` in `mkdir fresh`) is only a
|
|
14
|
+
* candidate: the gate watches whether the call brings it into existence, and shows it to Jev only then.
|
|
15
|
+
*/
|
|
16
|
+
readonly always: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The paths a call names, for the facts Jev is shown (does each exist, did the agent make it). This does not
|
|
20
|
+
* decide anything and does not understand the command: it picks out the words that look like paths. A word it
|
|
21
|
+
* misses is a fact Jev lacks; a word it wrongly takes is a harmless "does not exist" line.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pathsNamedBy(call: ProposedCall): NamedPath[];
|
|
@@ -6,11 +6,17 @@ import type { JevJudge } from "./jev-extension.js";
|
|
|
6
6
|
* Local retrieval runs first; web search is left to the agent after the fast
|
|
7
7
|
* answer, when local evidence falls short.
|
|
8
8
|
* - `direct`: intrinsic knowledge or small talk the model answers on its own.
|
|
9
|
+
* - `organize`: the user wants files or folders acted on — move, rename in
|
|
10
|
+
* bulk, rename by content, convert, sort, tidy — rather than information
|
|
11
|
+
* found. No retrieval and no verification: one tool-capable turn does it.
|
|
12
|
+
* - `extra`: none of the other branches (committing code, opening a pull
|
|
13
|
+
* request, running a build, any other task for the agent's tools). The Jev
|
|
14
|
+
* gate is skipped: no retrieval, no verification, tools stay available.
|
|
9
15
|
* - `config`: the user wants to inspect or change AutoRAG's own settings
|
|
10
16
|
* (model, providers, datasources). Offered only when the host enables
|
|
11
17
|
* agent self-configuration.
|
|
12
18
|
*/
|
|
13
|
-
export type QueryRoute = "local" | "direct" | "config";
|
|
19
|
+
export type QueryRoute = "local" | "direct" | "organize" | "extra" | "config";
|
|
14
20
|
/** Jev question id of the intrinsic-knowledge / local branch. */
|
|
15
21
|
export declare const QUERY_ROUTE_QUESTION_ID = "route";
|
|
16
22
|
/** Jev question id of the "does this need decomposition?" check. */
|
|
@@ -23,15 +29,6 @@ export declare const FALLBACK_QUERY_ROUTE: QueryRoute;
|
|
|
23
29
|
export declare const DECOMPOSE_PROBABILITY_THRESHOLD = 0.5;
|
|
24
30
|
/** A `noul` probability at or above this sends the fast answer on to verification. */
|
|
25
31
|
export declare const FOLLOW_UP_PROBABILITY_THRESHOLD = 0.5;
|
|
26
|
-
/**
|
|
27
|
-
* Minimum Jev branch probability required to leave local search. A `direct`
|
|
28
|
-
* branch at or below this floor — or one Jev reported without a probability —
|
|
29
|
-
* keeps the run on local search, the corpus-grounded default.
|
|
30
|
-
* Without the floor a weakly-favored `direct` verdict (observed at p 0.57-0.63
|
|
31
|
-
* on personal-corpus questions) skips retrieval entirely and answers from
|
|
32
|
-
* general knowledge, so the caller loses the evidence the question depends on.
|
|
33
|
-
*/
|
|
34
|
-
export declare const NON_LOCAL_ROUTE_PROBABILITY_THRESHOLD = 0.75;
|
|
35
32
|
/** A `noul` probability at or above this searches that datasource before the fast answer. */
|
|
36
33
|
export declare const DATASOURCE_PROBABILITY_THRESHOLD = 0.5;
|
|
37
34
|
/** Jev question id of the "search this datasource?" check for one datasource. */
|
|
@@ -52,11 +49,11 @@ export interface FollowUpDecision {
|
|
|
52
49
|
*/
|
|
53
50
|
export declare function needsFollowUp(judge: JevJudge, query: string, answer: string): Promise<FollowUpDecision>;
|
|
54
51
|
export interface QueryRouteDecision {
|
|
55
|
-
/** Most probable branch; {@link FALLBACK_QUERY_ROUTE} when Jev gave none
|
|
52
|
+
/** Most probable branch; {@link FALLBACK_QUERY_ROUTE} when Jev gave none. */
|
|
56
53
|
readonly route: QueryRoute;
|
|
57
|
-
/** True when Jev judged the question needs decomposition (
|
|
54
|
+
/** True when Jev judged the question needs decomposition (only ever for `local`). */
|
|
58
55
|
readonly decompose: boolean;
|
|
59
|
-
/** Probability Jev gave the winning branch
|
|
56
|
+
/** Probability Jev gave the winning branch; absent when Jev reported none. */
|
|
60
57
|
readonly routeProbability?: number;
|
|
61
58
|
/** Jev's P(decomposition needed), when it answered. */
|
|
62
59
|
readonly decomposeProbability?: number;
|
|
@@ -69,10 +66,10 @@ export interface RouteQueryOptions {
|
|
|
69
66
|
}
|
|
70
67
|
/**
|
|
71
68
|
* Ask Jev, in one batched call about the user question, which branch answers
|
|
72
|
-
* it and whether it needs decomposition.
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
69
|
+
* it and whether it needs decomposition. The most probable branch wins, with
|
|
70
|
+
* no confidence floor. Never throws: a missing credential, an unreachable
|
|
71
|
+
* backend, or an unusable verdict falls back to a single local search, with
|
|
72
|
+
* the reason recorded.
|
|
76
73
|
*/
|
|
77
74
|
export declare function routeQuery(judge: JevJudge, query: string, options?: RouteQueryOptions): Promise<QueryRouteDecision>;
|
|
78
75
|
/** One configured datasource Jev may send the question to. */
|
|
@@ -9,7 +9,7 @@ export type SearchDocumentDiagnosticSeverity = "info" | "warning" | "error";
|
|
|
9
9
|
* (#21/#22) does not require another source-breaking type change; codes not yet
|
|
10
10
|
* emitted are still valid members.
|
|
11
11
|
*/
|
|
12
|
-
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-staging-excluded" | "minsync-file-skipped" | "minsync-sync-failed" | "minsync-lock-held" | "embedder-unavailable" | "embedding-identity-mismatch" | "lexical-tokenizer-unavailable" | "parser-skipped" | "parser-failed" | "parser-crashed" | "source-vanished" | "source-unreadable" | "source-read-failed" | "mirror-write-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "search-root-unavailable" | "mass-delete-suppressed" | "walk-truncated" | "directory-unreadable" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "no-final-answer" | "model-request-failed" | "tool-call-burst" | "query-routed" | "query-route-fallback" | "query-decomposition-failed" | "follow-up-skipped" | "follow-up-check-fallback" | "datasources-selected" | "datasource-selection-fallback" | "citation-without-result" | "evidence-judged" | "evidence-judgment-fallback" | "memory-search-fallback" | "self-config-unavailable" | "self-config-rolled-back" | "embedding-unavailable";
|
|
12
|
+
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-staging-excluded" | "minsync-file-skipped" | "minsync-sync-failed" | "minsync-lock-held" | "embedder-unavailable" | "embedding-identity-mismatch" | "lexical-tokenizer-unavailable" | "parser-skipped" | "parser-failed" | "parser-crashed" | "source-vanished" | "source-unreadable" | "source-read-failed" | "mirror-write-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "search-root-unavailable" | "mass-delete-suppressed" | "walk-truncated" | "directory-unreadable" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "no-final-answer" | "model-request-failed" | "tool-call-burst" | "query-routed" | "query-route-fallback" | "query-decomposition-failed" | "follow-up-skipped" | "follow-up-check-fallback" | "datasources-selected" | "datasource-selection-fallback" | "citation-without-result" | "citation-irrelevant" | "citation-relevance-fallback" | "evidence-judged" | "evidence-judgment-fallback" | "memory-search-fallback" | "self-config-unavailable" | "self-config-rolled-back" | "embedding-unavailable";
|
|
13
13
|
export interface SearchDocumentDiagnostic {
|
|
14
14
|
readonly code: SearchDocumentDiagnosticCode;
|
|
15
15
|
readonly severity: SearchDocumentDiagnosticSeverity;
|
|
@@ -21,6 +21,8 @@ export interface SelfConfigPromptInput {
|
|
|
21
21
|
readonly configPath: string;
|
|
22
22
|
readonly agentDir: string;
|
|
23
23
|
readonly skill: string;
|
|
24
|
+
/** True when `manage_automations` is available: file-triggered automations are then in scope. */
|
|
25
|
+
readonly automations?: boolean;
|
|
24
26
|
}
|
|
25
27
|
/** The config file's current text, or `undefined` when it does not exist. */
|
|
26
28
|
export declare function snapshotConfigFile(configPath: string): string | undefined;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/** Custom session entry type under which a conversation persists what the user said. */
|
|
3
|
+
export declare const USER_REQUEST_ENTRY_TYPE = "autorag.user-request";
|
|
4
|
+
/**
|
|
5
|
+
* `request`: a new question or a follow-up. `steer`: a correction typed while a search runs, which
|
|
6
|
+
* adjusts the request it interrupts rather than starting a new one.
|
|
7
|
+
*/
|
|
8
|
+
export type UserRequestKind = "request" | "steer";
|
|
9
|
+
export interface UserRequest {
|
|
10
|
+
readonly text: string;
|
|
11
|
+
readonly kind: UserRequestKind;
|
|
12
|
+
}
|
|
13
|
+
type SaveEntry = (request: UserRequest) => void;
|
|
14
|
+
/**
|
|
15
|
+
* What the user has said in this conversation, in order, exactly as typed: the first question, every
|
|
16
|
+
* follow-up, every steer. AutoRAG's own phase prompts (fast answer, verification, direct answer, steer
|
|
17
|
+
* continuation) never enter it, because it is fed where the user's words arrive, not from the transcript.
|
|
18
|
+
*
|
|
19
|
+
* It is not truncated here. Whoever consumes it fits it to its own limit.
|
|
20
|
+
*/
|
|
21
|
+
export declare class UserRequestLog {
|
|
22
|
+
private items;
|
|
23
|
+
private save;
|
|
24
|
+
record(text: string, kind?: UserRequestKind): void;
|
|
25
|
+
entries(): readonly UserRequest[];
|
|
26
|
+
/** Forgets everything: a new conversation. */
|
|
27
|
+
reset(): void;
|
|
28
|
+
/** Replaces the log with a conversation read back from a session. */
|
|
29
|
+
restore(requests: readonly UserRequest[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* Where each recorded message is saved. Returns a detach that only unplugs this saver: a session that
|
|
32
|
+
* shut down late must not unplug the one that replaced it. Detached, the log is in-memory only.
|
|
33
|
+
*/
|
|
34
|
+
attach(save: SaveEntry): () => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* pi extension that keeps the conversation's {@link UserRequestLog} in the session file, next to the
|
|
38
|
+
* transcript. Starting, resuming, forking, or navigating the session tree rebuilds the log from the branch
|
|
39
|
+
* now in view, so `/new` begins empty and `/resume` brings the earlier requests back.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createUserRequestPersistence(log: UserRequestLog): ExtensionFactory;
|
|
42
|
+
/** `text` cut to `max` characters by dropping its middle, so both what it starts with and ends with survive. */
|
|
43
|
+
export declare function cutMiddle(text: string, max: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* The conversation as the Jev gate reads it: every user message in order, verbatim and numbered, with
|
|
46
|
+
* corrections marked. Nothing is shortened while it fits in `maxChars`. Over that, the opening request and
|
|
47
|
+
* the newest messages stay and the middle is dropped with a count (the numbering shows where), because the
|
|
48
|
+
* first message says what the user came for and the last ones say where they ended up. Only when even
|
|
49
|
+
* those two do not fit is a single message cut, in the middle.
|
|
50
|
+
*/
|
|
51
|
+
export declare function renderUserRequests(requests: readonly UserRequest[], maxChars: number): string;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type AutomationEventType = "create" | "update" | "delete";
|
|
2
|
+
export declare const AUTOMATION_EVENT_TYPES: readonly AutomationEventType[];
|
|
3
|
+
export interface AutomationEvent {
|
|
4
|
+
readonly type: AutomationEventType;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
}
|
|
7
|
+
/** Which retrieval tools an agent rule's session is offered; retrieval memory is never connected. */
|
|
8
|
+
export interface AutomationAgentRetrieval {
|
|
9
|
+
readonly searchAll: boolean;
|
|
10
|
+
readonly datasources: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** What an agent rule runs: a registered agent profile, spawned in-process on each batch of events. */
|
|
13
|
+
export interface AutomationAgent {
|
|
14
|
+
readonly profile: string;
|
|
15
|
+
readonly task: string;
|
|
16
|
+
readonly retrieval: AutomationAgentRetrieval;
|
|
17
|
+
}
|
|
18
|
+
/** A rule runs exactly one of `run` (a command) or `agent` (a profile session). */
|
|
19
|
+
export interface Automation {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly paths: readonly string[];
|
|
22
|
+
readonly events: readonly AutomationEventType[];
|
|
23
|
+
readonly include: readonly string[];
|
|
24
|
+
readonly exclude: readonly string[];
|
|
25
|
+
readonly run?: readonly string[];
|
|
26
|
+
readonly agent?: AutomationAgent;
|
|
27
|
+
readonly appendFiles: boolean;
|
|
28
|
+
readonly debounceMs: number;
|
|
29
|
+
readonly timeoutMs: number;
|
|
30
|
+
}
|
|
31
|
+
export declare const DEFAULT_DEBOUNCE_MS = 1000;
|
|
32
|
+
export declare const DEFAULT_TIMEOUT_MS = 600000;
|
|
33
|
+
export declare const DEFAULT_EXCLUDES: readonly string[];
|
|
34
|
+
export declare class AutomationConfigError extends Error {
|
|
35
|
+
constructor(message: string);
|
|
36
|
+
}
|
|
37
|
+
export declare function automationsConfigPath(env?: NodeJS.ProcessEnv): string;
|
|
38
|
+
export declare function parseAutomations(raw: unknown, env?: NodeJS.ProcessEnv): Automation[];
|
|
39
|
+
export declare function loadAutomations(configPath?: string, env?: NodeJS.ProcessEnv): Automation[];
|
|
40
|
+
/**
|
|
41
|
+
* Insert or replace the rule with `id`, keeping every other rule as written. The
|
|
42
|
+
* whole file is validated before it is written, so an invalid rule never lands
|
|
43
|
+
* on disk and the running daemon never reloads a broken file.
|
|
44
|
+
*/
|
|
45
|
+
export declare function saveAutomation(configPath: string, id: string, rule: Readonly<Record<string, unknown>>, env?: NodeJS.ProcessEnv): Automation;
|
|
46
|
+
export declare function deleteAutomation(configPath: string, id: string): void;
|
|
47
|
+
export declare function matchesAutomationPath(automation: Automation, watchedRoot: string, filePath: string): boolean;
|
|
48
|
+
export declare function matchesAutomation(automation: Automation, watchedRoot: string, event: AutomationEvent): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Automation, type AutomationEvent } from "./config.js";
|
|
2
|
+
import type { AutomationRunRecord } from "./run.js";
|
|
3
|
+
export declare const DEFAULT_MAX_RUNS_PER_MINUTE = 20;
|
|
4
|
+
/** An agent run costs model calls, so a rule that starts agents trips the self-trigger breaker sooner. */
|
|
5
|
+
export declare const DEFAULT_MAX_AGENT_RUNS_PER_MINUTE = 6;
|
|
6
|
+
export interface AutomationSubscription {
|
|
7
|
+
unsubscribe(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export type AutomationWatcherBackend = (dir: string, onEvents: (events: readonly AutomationEvent[]) => void, onError?: (error: Error) => void) => Promise<AutomationSubscription>;
|
|
10
|
+
export type AutomationRunner = (automation: Automation, events: readonly AutomationEvent[]) => Promise<AutomationRunRecord>;
|
|
11
|
+
export interface AutomationDaemonOptions {
|
|
12
|
+
readonly home?: string;
|
|
13
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
14
|
+
readonly selfCommand?: readonly string[];
|
|
15
|
+
readonly watcher?: AutomationWatcherBackend;
|
|
16
|
+
readonly runner?: AutomationRunner;
|
|
17
|
+
readonly maxRunsPerMinute?: number;
|
|
18
|
+
readonly watchConfigFile?: boolean;
|
|
19
|
+
readonly onRun?: (automation: Automation, record: AutomationRunRecord) => void;
|
|
20
|
+
readonly onError?: (message: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface AutomationDaemonHandle {
|
|
23
|
+
reload(): Promise<void>;
|
|
24
|
+
stop(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare class AutomationDaemonAlreadyRunningError extends Error {
|
|
27
|
+
constructor(home: string);
|
|
28
|
+
}
|
|
29
|
+
export declare function automationDaemonLockPath(home?: string): string;
|
|
30
|
+
export declare function isAutomationDaemonRunning(home?: string): boolean;
|
|
31
|
+
export declare function startAutomationDaemon(options?: AutomationDaemonOptions): Promise<AutomationDaemonHandle>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Automation, AutomationEvent } from "./config.js";
|
|
2
|
+
import { type AutomationRunRecord, type RunAutomationOptions } from "./run.js";
|
|
3
|
+
import { type RunAgentAutomationOptions } from "./run-agent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Agent runs the process may have in flight at once, across every rule. A run
|
|
6
|
+
* holds a model session and, with retrieval tools, the configured indexes, so
|
|
7
|
+
* rules wait their turn instead of running in parallel. Events that arrive
|
|
8
|
+
* while a rule waits stay in its pending batch and are handled together.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AGENT_RUN_CONCURRENCY = 1;
|
|
11
|
+
export type RunRuleOptions = RunAutomationOptions & RunAgentAutomationOptions;
|
|
12
|
+
/** Run one rule: its command, or its agent profile. The single entry for the daemon, the CLI and the tool. */
|
|
13
|
+
export declare function runRule(automation: Automation, events: readonly AutomationEvent[], options?: RunRuleOptions): Promise<AutomationRunRecord>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AgentProfile, type ProfileModel } from "../profiles/agent-factory.js";
|
|
2
|
+
import type { Automation, AutomationEvent } from "./config.js";
|
|
3
|
+
import { type AutomationRunRecord } from "./run.js";
|
|
4
|
+
export interface RunAgentAutomationOptions {
|
|
5
|
+
readonly home?: string;
|
|
6
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
7
|
+
/** pi's agent dir (the shared credential store); defaults to pi's own. */
|
|
8
|
+
readonly agentDir?: string;
|
|
9
|
+
/** Resolves the model the session runs on; defaults to the AutoRAG agent's configured model. */
|
|
10
|
+
readonly resolveModel?: (cwd: string) => Promise<ProfileModel>;
|
|
11
|
+
}
|
|
12
|
+
/** The profile an agent rule runs, with the loop guard appended. A profile cannot leave the guard out. */
|
|
13
|
+
export declare function buildAutomationProfile(automation: Automation): AgentProfile;
|
|
14
|
+
/** The user message of a run: one `type: path` line per changed file, capped like `appendFiles`. */
|
|
15
|
+
export declare function eventsPrompt(events: readonly AutomationEvent[]): string;
|
|
16
|
+
/**
|
|
17
|
+
* Run an agent rule: spawn its profile as an in-memory pi session, hand it the
|
|
18
|
+
* changed files, and wait for its final reply. The session never touches
|
|
19
|
+
* AutoRAG's retrieval memory; retrieval tools, when the rule asks for them, run
|
|
20
|
+
* against a throwaway memory file.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runAgentAutomation(automation: Automation, events: readonly AutomationEvent[], options?: RunAgentAutomationOptions): Promise<AutomationRunRecord>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Automation, AutomationEvent } from "./config.js";
|
|
2
|
+
export declare const AUTOMATION_MAX_APPEND_FILES = 100;
|
|
3
|
+
export interface AutomationRunRecord {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly startedAt: string;
|
|
6
|
+
readonly durationMs: number;
|
|
7
|
+
readonly eventCount: number;
|
|
8
|
+
readonly filesOverflow: boolean;
|
|
9
|
+
readonly exitCode: number | null;
|
|
10
|
+
readonly signal: NodeJS.Signals | null;
|
|
11
|
+
readonly timedOut: boolean;
|
|
12
|
+
readonly stdout: string;
|
|
13
|
+
readonly stderr: string;
|
|
14
|
+
readonly error?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RunAutomationOptions {
|
|
17
|
+
readonly home?: string;
|
|
18
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
19
|
+
/** Override `[nodePath, cliEntry]` used when `run[0] === "autorag"`. */
|
|
20
|
+
readonly selfCommand?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function automationLogPath(home: string | undefined, id: string): string;
|
|
23
|
+
export declare function appendAutomationRunLog(home: string, record: AutomationRunRecord): void;
|
|
24
|
+
export declare function readLastAutomationRun(home: string, id: string): AutomationRunRecord | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `[runtime, cliEntry]` for this AutoRAG install, found by walking up from this
|
|
27
|
+
* module to the package root. `process.argv[1]` is not used: inside the MCP
|
|
28
|
+
* server or a library host it is not the AutoRAG CLI. Bundled installs run
|
|
29
|
+
* `dist/cli/index.js`; a source checkout without a build runs the TypeScript entry.
|
|
30
|
+
*/
|
|
31
|
+
export declare function autoragCliCommand(): readonly string[];
|
|
32
|
+
export declare function runAutomation(automation: Automation, events: readonly AutomationEvent[], options?: RunAutomationOptions): Promise<AutomationRunRecord>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type Automation } from "./config.js";
|
|
2
|
+
import { type AutomationRunRecord } from "./run.js";
|
|
3
|
+
export interface AutomationServiceSpec {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly nodePath: string;
|
|
6
|
+
readonly cliEntry: string;
|
|
7
|
+
readonly envFilePath: string;
|
|
8
|
+
readonly logPath: string;
|
|
9
|
+
readonly home: string;
|
|
10
|
+
readonly pathEnv: string;
|
|
11
|
+
readonly configPath?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AutomationServiceDescriptor {
|
|
14
|
+
readonly platform: NodeJS.Platform;
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly definitionPath: string;
|
|
17
|
+
readonly envFilePath: string;
|
|
18
|
+
readonly logPath: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ServiceExecResult {
|
|
21
|
+
readonly code: number;
|
|
22
|
+
readonly stdout: string;
|
|
23
|
+
readonly stderr: string;
|
|
24
|
+
}
|
|
25
|
+
export type ServiceCommandExec = (cmd: string, args: readonly string[]) => Promise<ServiceExecResult>;
|
|
26
|
+
export interface AutomationServiceOptions {
|
|
27
|
+
readonly platform?: NodeJS.Platform;
|
|
28
|
+
readonly home?: string;
|
|
29
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
30
|
+
readonly selfCommand?: readonly string[];
|
|
31
|
+
readonly exec?: ServiceCommandExec;
|
|
32
|
+
/** How long install waits for the daemon to hold its lock. Default 15000. */
|
|
33
|
+
readonly waitForRunningMs?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface AutomationServiceInstallResult extends AutomationServiceDescriptor {
|
|
36
|
+
/** Whether the daemon was observed running before install returned. */
|
|
37
|
+
readonly running: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface AutomationStatusEntry extends Automation {
|
|
40
|
+
readonly lastRun?: AutomationRunRecord;
|
|
41
|
+
}
|
|
42
|
+
export interface AutomationStatusReport {
|
|
43
|
+
readonly service: {
|
|
44
|
+
readonly platform: NodeJS.Platform;
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly definitionPath: string;
|
|
47
|
+
readonly logPath: string;
|
|
48
|
+
readonly installed: boolean;
|
|
49
|
+
readonly running: boolean;
|
|
50
|
+
};
|
|
51
|
+
readonly configPath: string;
|
|
52
|
+
readonly configError?: string;
|
|
53
|
+
readonly automations: readonly AutomationStatusEntry[];
|
|
54
|
+
}
|
|
55
|
+
export declare function automationServiceDescriptor(options?: AutomationServiceOptions): AutomationServiceDescriptor;
|
|
56
|
+
export declare function renderLaunchdPlist(spec: AutomationServiceSpec): string;
|
|
57
|
+
export declare function renderSystemdUnit(spec: AutomationServiceSpec): string;
|
|
58
|
+
export declare function renderWindowsTaskXml(spec: AutomationServiceSpec): string;
|
|
59
|
+
export declare function installAutomationService(options?: AutomationServiceOptions): Promise<AutomationServiceInstallResult>;
|
|
60
|
+
export declare function uninstallAutomationService(options?: AutomationServiceOptions): Promise<AutomationServiceDescriptor>;
|
|
61
|
+
export declare function getAutomationStatus(options?: AutomationServiceOptions): AutomationStatusReport;
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
|
3
3
|
import type { AutoRAGAgentOptions, AutoRAGRefreshLimits, AutoRAGRetrievalLimits } from "../agent/agent.js";
|
|
4
4
|
import type { JevBackendName } from "../agent/jev-extension.js";
|
|
5
5
|
import { type LoadLocalAutoRAGModelOptions } from "../agent/local-model.js";
|
|
6
|
+
import { type PermissionMode } from "../agent/permission-gate.js";
|
|
6
7
|
import type { DecompositionModel } from "../agent/query-decomposition.js";
|
|
7
8
|
import { type DatasourcesConfig } from "../datasource/skills/factory.js";
|
|
8
9
|
import type { EnsureMinSyncBinaryOptions, MinSyncEmbedderConfig } from "../minsync/index.js";
|
|
@@ -169,6 +170,11 @@ export interface CliConfig {
|
|
|
169
170
|
* agent's own model decompose.
|
|
170
171
|
*/
|
|
171
172
|
queryDecomposition?: QueryDecompositionConfig | false;
|
|
173
|
+
/**
|
|
174
|
+
* Approval gate for file changes by the agent: `auto` (default for the TUI: Jev first, user as fallback; `full` for `search` and a bridged TUI), `ask`
|
|
175
|
+
* (the user approves every file-capable call, Jev unused), or `full` (no gate). `--permission-mode` and `AUTORAG_PERMISSION_MODE` override the file.
|
|
176
|
+
*/
|
|
177
|
+
permissionMode?: PermissionMode;
|
|
172
178
|
/** Post-merge reranking. Absent ⇒ reranking disabled. `false` disables it. */
|
|
173
179
|
rerank?: RerankConfig | false;
|
|
174
180
|
parserOptions?: Record<string, unknown>;
|
|
@@ -178,6 +184,16 @@ export interface CliConfig {
|
|
|
178
184
|
timeoutMs?: number;
|
|
179
185
|
};
|
|
180
186
|
excludeExactDuplicates?: boolean;
|
|
187
|
+
/** Filee command line behind the `convert_files` tool. `enabled: false` removes the conversion tools. */
|
|
188
|
+
filee?: {
|
|
189
|
+
enabled?: boolean;
|
|
190
|
+
binaryPath?: string;
|
|
191
|
+
/** Download the pinned filee-cli into `<AUTORAG_HOME>/tools` when none is found. Default true. */
|
|
192
|
+
autoInstall?: boolean;
|
|
193
|
+
timeoutMs?: number;
|
|
194
|
+
/** Folder for Filee's own settings and engines (`FILEE_DATA_DIR`); default is Filee's per-user folder. */
|
|
195
|
+
dataDir?: string;
|
|
196
|
+
};
|
|
181
197
|
/** Absolute or workspace-relative files/directories omitted from local indexing. */
|
|
182
198
|
excludePaths?: string[];
|
|
183
199
|
/** Hard caps on retrieval, baseline prefetch, and model-facing candidate lists. */
|
|
@@ -192,6 +208,11 @@ export interface ResolveConfigInput {
|
|
|
192
208
|
env?: NodeJS.ProcessEnv;
|
|
193
209
|
cwd?: string;
|
|
194
210
|
readOnly?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Mode when no flag, environment variable, or config file sets one. Commands that run with nobody to approve
|
|
213
|
+
* (`search`) or through a remote bridge pass `full`; the interactive TUI leaves it to the default (`auto`).
|
|
214
|
+
*/
|
|
215
|
+
defaultPermissionMode?: PermissionMode;
|
|
195
216
|
}
|
|
196
217
|
export interface ResolvedConfigPath {
|
|
197
218
|
configPath: string;
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "lite", "models", "update-check"];
|
|
2
|
+
declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "lite", "models", "update-check", "automate"];
|
|
3
3
|
type CommandName = (typeof COMMANDS)[number];
|
|
4
4
|
export type { CommandName };
|
|
5
5
|
interface ParsedArgs {
|