agent-afk 5.108.0 → 5.108.2
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/dist/bundled-plugins/awa-bundled/skills/review/SKILL.md +13 -4
- package/dist/cli/commands/interactive/surface-setup.history-tracking.d.ts +5 -0
- package/dist/cli/commands/interactive/surface-setup.suggest-config.d.ts +25 -0
- package/dist/cli/input/slash-match.d.ts +13 -0
- package/dist/cli/input/suggest-prompt.d.ts +1 -0
- package/dist/cli/input/suggest-types.d.ts +1 -0
- package/dist/cli/input/trigger.d.ts +2 -0
- package/dist/cli/input/types.d.ts +1 -0
- package/dist/cli.mjs +659 -658
- package/dist/index.mjs +1 -1
- package/dist/telegram.mjs +1 -1
- package/dist/web-server/frontend/composer-value.d.ts +1 -0
- package/dist/web-server/frontend/composer-wiring.d.ts +7 -0
- package/dist/web-server/frontend/slash-autocomplete-render.d.ts +3 -0
- package/dist/web-server/frontend/slash-autocomplete.d.ts +39 -0
- package/dist/web-server/frontend/slash-highlight.d.ts +8 -0
- package/dist/web-server/routes.d.ts +5 -0
- package/dist/web-ui-assets/app.js +43 -43
- package/dist/web-ui-assets/approvals.css +45 -0
- package/dist/web-ui-assets/index.html +9 -1
- package/dist/web-ui-assets/styles.css +53 -48
- package/package.json +1 -1
|
@@ -42,6 +42,15 @@ The only shell permitted is **read-only inspection**: `git diff` / `git show` /
|
|
|
42
42
|
|
|
43
43
|
Never fabricate intent. When none is available the value is the literal `(none supplied)`; agents disclose its absence rather than guess.
|
|
44
44
|
|
|
45
|
+
**Pre-fetch file contents at reviewed ref (inline).** After capturing `reviewed_ref` and the diff, and before dispatching any Wave 1 agent, the orchestrator (which has Bash) pre-reads every changed file at the reviewed ref and bundles the results for injection into sub-agent prompts. This is required because Wave 1 and Wave 1.5 agents are `research-agent` instances with no shell — they cannot run `git show` themselves.
|
|
46
|
+
|
|
47
|
+
1. Extract the list of changed files from the diff: `git diff --name-only <base>..<reviewed-ref>` (or parse `--- a/<file>` / `+++ b/<file>` headers from a patch-file diff).
|
|
48
|
+
2. For each file, run `git show <reviewed-ref>:<file>` and capture the full output. If the command fails (file does not exist at that ref — e.g. the file was added and the ref predates it, or the ref is `unknown` for a patch-file input), skip that file and note it as `unavailable at ref`.
|
|
49
|
+
3. Bundle as a **`prefetched-files`** block: `[{ file, content, status: "ok"|"unavailable" }]`.
|
|
50
|
+
4. Include this block verbatim in every Wave 1 and Wave 1.5 agent prompt alongside the diff. Agents verify `file-state` citations against the injected content — they do **not** call `read_file` for ref-anchored verification (the working tree may be on a different branch).
|
|
51
|
+
|
|
52
|
+
When `reviewed_ref` is `unknown` (patch-file input), skip pre-fetch entirely and note `prefetched-files: none — patch-file input`. Agents fall back to `diff-context` citations only and tag any `file-state` citation `[UNVERIFIED: no live ref]`.
|
|
53
|
+
|
|
45
54
|
**Triage (inline).** From the resolved diff extract: change type (hotfix | feature | refactor | dep-bump | new-service), files changed, total lines changed, summary. Classify regime: `light` if ≤300 lines or change type is hotfix/dep-bump; `full` otherwise.
|
|
46
55
|
|
|
47
56
|
**Concurrency floor — declared, conditional, and enforced.** *Through synthesis*, a full-regime review peaks at **2 concurrent sub-agent sessions** (Wave 1's two dimension agents) and dispatches **3 in total** (Wave 1 ×2, then Wave 2 ×1, sequential). Wave 1.5 runs inline in the orchestrator and dispatches nothing. **No wave nests a child**: the sub-agents are shell-less by design, and nothing in this skill requires them to run a command, so none of them needs to nest a `git-investigator` to comply. If you add a requirement here that needs a shell, you have silently doubled this floor — put that requirement in Wave 1.5 instead.
|
|
@@ -54,10 +63,10 @@ Never fabricate intent. When none is available the value is the literal `(none s
|
|
|
54
63
|
|
|
55
64
|
Each agent receives: full diff + file tree + triage header + **reviewed ref (SHA)** + the **stated intent** (what the change is meant to accomplish, or `(none supplied)`), the severity rubric, **the `blocking` default table plus its overrides and assignment-order invariant**, and the finding schema. The blocking rules are not optional context: the finding schema mandates a `blocking` value per finding, so an agent that receives the schema without the table is being told to emit a field whose assignment rules it was never given.
|
|
56
65
|
|
|
57
|
-
**Citation requirement (enforced per agent).** Wave 1 agents cite from the diff and from
|
|
66
|
+
**Citation requirement (enforced per agent).** Wave 1 agents cite from the diff and from the **`prefetched-files` block injected by the orchestrator**. They do **not** call `read_file` for ref-anchored verification (the working tree may be on a different branch) and do **not** run git. Centralized verification runs in Wave 1.5, which checks every `blocking`/`critical`/`high` citation **and every `file-state` citation at any severity** against the same pre-fetched content, then drops fabricated ones. Each agent must:
|
|
58
67
|
1. State the reviewed ref it was given in each finding: `ref: <sha>`.
|
|
59
|
-
2. Classify every citation as `diff-context` (line visible in the diff hunk) or `file-state` (line in the post-merge file, not visible in the hunk).
|
|
60
|
-
3. Never paraphrase or reconstruct a line from memory. If the line is not visible in the diff, cite it as `file-state
|
|
68
|
+
2. Classify every citation as `diff-context` (line visible in the diff hunk) or `file-state` (line in the post-merge file, not visible in the hunk). For `file-state` citations, look up the line in the injected `prefetched-files` content. If the file's status is `unavailable` in the bundle, tag the citation `[UNVERIFIED: file unavailable at ref]` so Wave 1.5 knows it could not be pre-fetched.
|
|
69
|
+
3. Never paraphrase or reconstruct a line from memory. If the line is not visible in the diff and not present in the pre-fetched content, cite it as `file-state [UNVERIFIED: file unavailable at ref]` — do not invent the content.
|
|
61
70
|
|
|
62
71
|
**Invariant — why Wave 1 does not run git.** `research-agent` has no shell (`tools: Read, Grep, Glob, WebFetch, WebSearch, Agent(git-investigator)` — no `Bash`, and that single `Agent(...)` entry is the nesting path this rule closes), so a mandatory `git show` forces it to dispatch a nested `git-investigator` purely to run one command. That doubles the concurrent session count of *every* Wave 1 agent, and is the structural cause of the rate-limit cascade in #726. Ref-anchored verification is therefore performed once, centrally, by a shell-capable actor — never N times by shell-less ones. Do not reintroduce a per-agent re-read here.
|
|
63
72
|
|
|
@@ -85,7 +94,7 @@ This is the agent's first-line self-check; **Wave 1.5 Check B** independently re
|
|
|
85
94
|
|
|
86
95
|
**Wave 1.5 — Citation + absence-claim verification (INLINE — run by the orchestrator, dispatches nothing).** Run after Wave 1 returns, before Wave 2 synthesis. The orchestrator already holds exactly the read-only shell this verification needs (`git show` / `git diff` / `gh pr diff` / `grep` / `rg` — see the shell grant above), so running it inline costs **zero** additional sessions and zero nesting. A shell-less sub-agent here would have to nest a `git-investigator` to run the very commands the orchestrator can already run. Two independent checks:
|
|
87
96
|
|
|
88
|
-
**Check A — Citation verification.** Extracts (a) every `file:line` citation from any `blocking`, `critical`, or `high` finding, **and (b) every citation tagged `file-state` at any severity** — `medium`, `low`, and `nit` included — across all Wave 1 results. Both sets are checked, because Wave 1 never re-reads at the ref: an unverified `file-state` citation in a `low` finding is exactly as fabricable as one in a `high` finding, and quoting a line absent from the reviewed change is a defect at every tier. For each citation,
|
|
97
|
+
**Check A — Citation verification.** Extracts (a) every `file:line` citation from any `blocking`, `critical`, or `high` finding, **and (b) every citation tagged `file-state` at any severity** — `medium`, `low`, and `nit` included — across all Wave 1 results. Both sets are checked, because Wave 1 never re-reads at the ref independently: an unverified `file-state` citation in a `low` finding is exactly as fabricable as one in a `high` finding, and quoting a line absent from the reviewed change is a defect at every tier. For each citation, looks up the file in the **`prefetched-files` block** (already captured by the orchestrator before Wave 1 ran) and checks whether the quoted evidence snippet actually appears at that line — not in main, not in diff context alone. If the file's status is `unavailable` in the bundle, falls back to `git show <reviewed-ref>:<file>` (the orchestrator has shell). Classifies each citation as:
|
|
89
98
|
- `verified` — content matches what is actually at that line on the reviewed ref.
|
|
90
99
|
- `diff-only` — line appears in the diff hunk but no longer exists at the reviewed ref HEAD (e.g., deleted block). Finding must be downgraded: the issue may already be resolved.
|
|
91
100
|
- `fabricated` — line does not exist at the reviewed ref and was not in the diff hunk; the evidence snippet is unverifiable. Finding is **dropped** from the report.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InputSurface } from '../../input/input-surface.js';
|
|
2
|
+
import type { SuggestContext, SuggestEngine } from '../../input/suggest.js';
|
|
3
|
+
import type { HistorySubmissionTracker } from './surface-setup.history-tracking.js';
|
|
4
|
+
export interface SuggestCtxStats {
|
|
5
|
+
model: string | undefined;
|
|
6
|
+
cwd?: string | undefined;
|
|
7
|
+
turns: readonly {
|
|
8
|
+
user: string;
|
|
9
|
+
assistant: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare function buildSuggestConfig(opts: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
engine: SuggestEngine;
|
|
15
|
+
surface: InputSurface;
|
|
16
|
+
stats: SuggestCtxStats;
|
|
17
|
+
apiKey: string | undefined;
|
|
18
|
+
baseUrl: string | undefined;
|
|
19
|
+
historyTracker: HistorySubmissionTracker;
|
|
20
|
+
}): {
|
|
21
|
+
suggest: {
|
|
22
|
+
engine: SuggestEngine;
|
|
23
|
+
getContext: () => SuggestContext;
|
|
24
|
+
};
|
|
25
|
+
} | Record<string, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const MAX_SLASH_MATCHES = 20;
|
|
2
|
+
export interface CommandEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
summary?: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SlashCandidate {
|
|
8
|
+
value: string;
|
|
9
|
+
summary?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function isSubsequence(needle: string, haystack: string): boolean;
|
|
13
|
+
export declare function matchSlashCandidates(universe: readonly CommandEntry[], query: string, recentHistory?: readonly string[]): SlashCandidate[];
|
|
@@ -2,6 +2,7 @@ import type { CompleteRequest, SuggestContext } from './suggest-types.js';
|
|
|
2
2
|
export declare function buildPromptSuggestionSystem(): string;
|
|
3
3
|
export declare function buildPromptSuggestionUser(ctx: SuggestContext): string;
|
|
4
4
|
export declare function hasSuggestionGrounding(ctx: SuggestContext): boolean;
|
|
5
|
+
export declare function isEchoOfLastInput(suggestion: string, ctx: SuggestContext): boolean;
|
|
5
6
|
export declare function isValidPromptSuggestion(reply: string): boolean;
|
|
6
7
|
export declare function normalizePromptSuggestion(raw: string): string | null;
|
|
7
8
|
export type PromptCompleteRequest = CompleteRequest;
|
|
@@ -8,6 +8,7 @@ export interface SuggestContext {
|
|
|
8
8
|
getHistory(): string[];
|
|
9
9
|
getDropdownTopCandidate(buffer: string): string | null;
|
|
10
10
|
getTranscriptTail(): string;
|
|
11
|
+
lastSubmitted?: string;
|
|
11
12
|
getRecentCommands(): string[];
|
|
12
13
|
llmEnabled(): boolean;
|
|
13
14
|
promptSuggestEnabled?(): boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type CommandEntry } from './slash-match.js';
|
|
1
2
|
import type { Candidate, Trigger } from './types.js';
|
|
2
3
|
export declare function detectTrigger(buffer: string, cursorCol: number): Trigger | null;
|
|
3
4
|
export declare function filterSlashCandidates(query: string, recentHistory?: readonly string[]): Candidate[];
|
|
5
|
+
export declare function buildSlashUniverse(): CommandEntry[];
|
|
4
6
|
export interface FileDirent {
|
|
5
7
|
name: string;
|
|
6
8
|
isDirectory(): boolean;
|