agent-afk 5.299.4 → 5.299.6

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.
Files changed (32) hide show
  1. package/dist/agent/tools/dispatcher.batch-process.d.ts +2 -0
  2. package/dist/agent/tools/dispatcher.d.ts +1 -0
  3. package/dist/agent/tools/dispatcher.execute-batch.d.ts +2 -0
  4. package/dist/agent/tools/strategy-nudge.d.ts +27 -0
  5. package/dist/agent/trace/events.d.ts +2 -0
  6. package/dist/agent/trace/events.session-phase.d.ts +2 -0
  7. package/dist/agent/trace/receipt.d.ts +2 -1
  8. package/dist/agent/trace/types.session-phase.d.ts +1 -1
  9. package/dist/bundled-plugins/awa-bundled/skills/ship/SKILL.md +34 -0
  10. package/dist/cli/_lib/testing/virtual-screen.csi.d.ts +0 -2
  11. package/dist/cli/permission-mode-cycle.d.ts +3 -0
  12. package/dist/cli/terminal-compositor.archived-reveal.d.ts +18 -0
  13. package/dist/cli/terminal-compositor.content-hug.d.ts +4 -2
  14. package/dist/cli/terminal-compositor.d.ts +2 -0
  15. package/dist/cli/terminal-compositor.frame.d.ts +1 -0
  16. package/dist/cli/terminal-compositor.frame.layout.d.ts +1 -1
  17. package/dist/cli/terminal-compositor.frame.position.d.ts +1 -1
  18. package/dist/cli/terminal-compositor.input-dispatch.d.ts +1 -0
  19. package/dist/cli/terminal-compositor.mode-notice.d.ts +14 -0
  20. package/dist/cli/terminal-compositor.reset.d.ts +1 -0
  21. package/dist/cli.mjs +436 -428
  22. package/dist/index.mjs +161 -157
  23. package/dist/service/index.d.ts +1 -1
  24. package/dist/service/types.d.ts +2 -1
  25. package/dist/service/windows/argv.d.ts +8 -0
  26. package/dist/service/windows/install.d.ts +9 -0
  27. package/dist/service/windows/manager.d.ts +2 -0
  28. package/dist/service/windows/paths.d.ts +7 -0
  29. package/dist/service/windows/status.d.ts +7 -0
  30. package/dist/service/windows/task-xml.d.ts +9 -0
  31. package/dist/telegram.mjs +206 -201
  32. package/package.json +1 -1
@@ -4,6 +4,7 @@ import type { SubagentExecutor } from './subagent-executor.js';
4
4
  import type { Batch } from './dispatch-batching.js';
5
5
  import type { TraceSink } from '../trace/index.js';
6
6
  import type { ToolHealthMonitor } from './tool-health-monitor.js';
7
+ import { type StrategyNudger } from './strategy-nudge.js';
7
8
  export interface IndexedCall {
8
9
  call: ToolCall;
9
10
  originalIndex: number;
@@ -17,6 +18,7 @@ export interface BatchExecDeps {
17
18
  maxConcurrentSafeCalls: number;
18
19
  onActivity?: (activeIds: readonly string[]) => void;
19
20
  toolHealthMonitor: ToolHealthMonitor;
21
+ strategyNudger: StrategyNudger;
20
22
  traceWriter: TraceSink | undefined;
21
23
  }
22
24
  export declare function reconcileOutcomes(settled: PromiseSettledResult<{
@@ -78,6 +78,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
78
78
  private readonly gateState;
79
79
  private readonly repeatFailureGuard;
80
80
  private readonly toolHealthMonitor;
81
+ private readonly strategyNudger;
81
82
  private readonly grantManager;
82
83
  constructor(opts: SessionToolDispatcherOptions);
83
84
  private get handlerContext();
@@ -6,6 +6,7 @@ import type { RepeatFailureGuard } from './repeat-failure-guard.js';
6
6
  import type { SubagentExecutor } from './subagent-executor.js';
7
7
  import type { ConcurrencyClassifier } from './types.js';
8
8
  import type { ToolHealthMonitor } from './tool-health-monitor.js';
9
+ import type { StrategyNudger } from './strategy-nudge.js';
9
10
  export interface ExecuteBatchDeps {
10
11
  execute: (call: ToolCall) => Promise<ToolResult>;
11
12
  classifier: ConcurrencyClassifier;
@@ -20,5 +21,6 @@ export interface ExecuteBatchDeps {
20
21
  gateDeps: () => PreDispatchGateDeps;
21
22
  traceWriter: TraceSink | undefined;
22
23
  toolHealthMonitor: ToolHealthMonitor;
24
+ strategyNudger: StrategyNudger;
23
25
  }
24
26
  export declare function executeBatchImpl(calls: ToolCall[], deps: ExecuteBatchDeps, onActivity?: ToolActivityReporter): Promise<ToolResult[]>;
@@ -0,0 +1,27 @@
1
+ import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
2
+ import type { TraceSink } from '../trace/index.js';
3
+ export declare const STRATEGY_NUDGE_THRESHOLD = 2;
4
+ export declare const STRATEGY_NUDGE_WINDOW = 20;
5
+ export declare const STRATEGY_NUDGE_TOOLS: ReadonlySet<string>;
6
+ export declare function findErrorLine(content: string): string | null;
7
+ export declare function normalizeErrorLine(line: string): string;
8
+ export declare function errorSignature(result: ToolResult): {
9
+ signature: string;
10
+ line: string;
11
+ } | null;
12
+ export interface StrategyNudgeVerdict {
13
+ readonly tool: string;
14
+ readonly line: string;
15
+ readonly occurrences: number;
16
+ readonly distinctCalls: boolean;
17
+ readonly notice: string;
18
+ }
19
+ export declare class StrategyNudger {
20
+ private readonly signatures;
21
+ private readonly fired;
22
+ private clock;
23
+ observe(call: ToolCall, result: ToolResult): StrategyNudgeVerdict | null;
24
+ occurrencesFor(result: ToolResult): number;
25
+ private evictOverflow;
26
+ }
27
+ export declare function applyStrategyNudge(nudger: StrategyNudger, traceWriter: TraceSink | undefined, call: ToolCall, result: ToolResult): ToolResult;
@@ -770,6 +770,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
770
770
  connection_retry: "connection_retry";
771
771
  usage_notice: "usage_notice";
772
772
  tool_degraded: "tool_degraded";
773
+ strategy_nudge_fired: "strategy_nudge_fired";
773
774
  stop_inject_dropped: "stop_inject_dropped";
774
775
  stop_hook_continuation: "stop_hook_continuation";
775
776
  stop_hook_cap_reached: "stop_hook_cap_reached";
@@ -1178,6 +1179,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1178
1179
  connection_retry: "connection_retry";
1179
1180
  usage_notice: "usage_notice";
1180
1181
  tool_degraded: "tool_degraded";
1182
+ strategy_nudge_fired: "strategy_nudge_fired";
1181
1183
  stop_inject_dropped: "stop_inject_dropped";
1182
1184
  stop_hook_continuation: "stop_hook_continuation";
1183
1185
  stop_hook_cap_reached: "stop_hook_cap_reached";
@@ -32,6 +32,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
32
32
  connection_retry: "connection_retry";
33
33
  usage_notice: "usage_notice";
34
34
  tool_degraded: "tool_degraded";
35
+ strategy_nudge_fired: "strategy_nudge_fired";
35
36
  stop_inject_dropped: "stop_inject_dropped";
36
37
  stop_hook_continuation: "stop_hook_continuation";
37
38
  stop_hook_cap_reached: "stop_hook_cap_reached";
@@ -70,6 +71,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
70
71
  connection_retry: "connection_retry";
71
72
  usage_notice: "usage_notice";
72
73
  tool_degraded: "tool_degraded";
74
+ strategy_nudge_fired: "strategy_nudge_fired";
73
75
  stop_inject_dropped: "stop_inject_dropped";
74
76
  stop_hook_continuation: "stop_hook_continuation";
75
77
  stop_hook_cap_reached: "stop_hook_cap_reached";
@@ -1,6 +1,7 @@
1
- export { renderReceiptMarkdown } from './receipt.render.js';
1
+ import { renderReceiptMarkdown } from './receipt.render.js';
2
2
  import type { HookHandler } from '../hooks.js';
3
3
  import { type ClosureReason, type ToolFailureClass, type TraceEvent, type TraceEventKind } from './types.js';
4
+ export { renderReceiptMarkdown };
4
5
  export declare const RECEIPT_SCHEMA_VERSION: 1;
5
6
  export interface ReceiptToolFailure {
6
7
  toolUseId: string;
@@ -1,4 +1,4 @@
1
- export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'usage_notice' | 'tool_degraded' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached';
1
+ export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached';
2
2
  export interface SessionPhasePayload {
3
3
  phase: SessionPhaseName;
4
4
  durationMs?: number;
@@ -72,6 +72,33 @@ Going through a file keeps backticks, `$(...)`, and quotes in the message litera
72
72
 
73
73
  Never `--amend` (creates a new commit each time). Never bypass hooks (`--no-verify`).
74
74
 
75
+ **Phase 4.5 — Orchestrator-owned pre-push re-check (mandatory).**
76
+ Record `git rev-parse HEAD` (the SHA you are about to push). Then run each gate below **yourself** as a fresh process — never accept a sub-agent's self-reported result as a gate outcome.
77
+
78
+ Detect and run these three gate classes against the current tree:
79
+
80
+ 1. **Tests** — same detection order as Phase 2 (`scripts.test` in `package.json`, `pytest`, `cargo test`, `go test ./...`, `Makefile test` target). If Phase 2 ran successfully **and** HEAD has not moved since (compare the recorded SHA), you may reuse the Phase 2 result and record it as `REUSED (HEAD unchanged)` — but you must still run typecheck and lint fresh.
81
+
82
+ 2. **Typecheck** — detect in order:
83
+ - `package.json` → `scripts.typecheck` if present
84
+ - `package.json` → `scripts.lint` when it invokes `tsc` (e.g. `tsc --noEmit`) — run it as-is
85
+ - `pyproject.toml` / `setup.cfg` → `mypy` if configured
86
+ - `Cargo.toml` → `cargo check`
87
+ - If none detected → record as `SKIPPED: no typecheck command detected`
88
+
89
+ 3. **Lint** — detect in order:
90
+ - `package.json` → `scripts.lint` if present and not already used for typecheck above
91
+ - `.eslintrc*` / `eslint.config.*` → `eslint .` (or the project's lint invocation)
92
+ - `Makefile` → `lint` target
93
+ - If none detected → record as `SKIPPED: no lint command detected`
94
+
95
+ **For each gate:** run the command as-is (no added flags such as `--strict`). Capture exit code and a brief excerpt of the output.
96
+
97
+ - Any **non-zero exit** → **abort**; do not push. Surface the verbatim failing output and recommend `/diagnose` or `/heal`. Cap any in-skill repair attempt at **two passes**; if still failing after two passes, emit `BLOCKED` and stop — do not loop indefinitely.
98
+ - A gate that cannot be detected → record as `SKIPPED: <reason>`. Never record a skipped gate as passed.
99
+
100
+ Record all results (command, exit code, HEAD SHA, SKIPPED reason if applicable) for inclusion in the Phase 7 PR body.
101
+
75
102
  **Phase 5 — Push.**
76
103
  - **Assertion (before any push):** `git rev-parse --abbrev-ref HEAD` must NOT equal the default branch. If it does, abort with the same error as Phase 1 — Branch lock was violated somewhere upstream.
77
104
  - Upstream unset → `git push -u origin <branch>`
@@ -100,6 +127,13 @@ Structure:
100
127
  - <command>: <passed/failed + counts>
101
128
  <repeat per test invocation>
102
129
 
130
+ ## Pre-push re-check (HEAD <sha>)
131
+ | Gate | Command | Exit | Result |
132
+ |------------|-------------------------------|------|---------------------------------|
133
+ | Tests | <command or "REUSED"> | <N> | passed / failed / REUSED (HEAD unchanged) |
134
+ | Typecheck | <command> | <N> | passed / failed / SKIPPED: <reason> |
135
+ | Lint | <command> | <N> | passed / failed / SKIPPED: <reason> |
136
+
103
137
  ## Verification
104
138
  <if --verify ran: per-claim verdict + evidence>
105
139
  <if skipped: "No adversarial verify requested (diff under threshold).">
@@ -12,8 +12,6 @@ export interface CsiHost {
12
12
  scrollback: string[];
13
13
  clampRow(r: number): number;
14
14
  clampCol(c: number): number;
15
- lineAt(row: number): string;
16
- scrollRegionUp(): void;
17
15
  }
18
16
  export declare function normalizeCsiParams(raw: number[]): number[];
19
17
  export declare function eraseCursorToEndOfLine(host: CsiHost): void;
@@ -1,3 +1,6 @@
1
1
  import type { SlashContext } from './slash/types.js';
2
2
  export declare const PERMISSION_CYCLE: readonly ["default", "plan", "bypassPermissions"];
3
+ type CycleMode = (typeof PERMISSION_CYCLE)[number];
4
+ export declare function cycleCopy(mode: CycleMode): string;
3
5
  export declare function cyclePermissionMode(ctx: SlashContext): Promise<void>;
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { FramePlacementMode } from './terminal-compositor.types.js';
2
+ interface RevealHost {
3
+ placementMode?: FramePlacementMode;
4
+ committedBand: string[];
5
+ committedBandArchivedPrefix?: number;
6
+ pendingContentRows?: number | null;
7
+ anchorRow?: number;
8
+ stdout?: NodeJS.WriteStream;
9
+ }
10
+ export declare function resetArchivedReveal(self: RevealHost, projectedPrefix?: number): void;
11
+ export declare function hiddenArchivedRows(self: RevealHost, geometry?: {
12
+ physicalRows: number;
13
+ absoluteBottom: number;
14
+ }, projection?: {
15
+ length: number;
16
+ prefix: number;
17
+ }): number;
18
+ export {};
@@ -3,11 +3,13 @@ export interface ContentHugHost {
3
3
  placementMode: FramePlacementMode;
4
4
  anchorRow: number | undefined;
5
5
  committedBand: string[];
6
+ committedBandArchivedPrefix?: number;
7
+ stdout?: NodeJS.WriteStream;
6
8
  pendingContentRows: number | null;
7
9
  lastMeasuredFrameBottom: number;
8
10
  bandGeometryStale: boolean;
9
11
  }
10
- export declare function contentHugAnchor(self: Pick<ContentHugHost, 'anchorRow' | 'committedBand' | 'pendingContentRows'>): number;
12
+ export declare function contentHugAnchor(self: Pick<ContentHugHost, 'anchorRow' | 'committedBand' | 'pendingContentRows' | 'placementMode' | 'committedBandArchivedPrefix' | 'stdout'>, physicalRows?: number, absoluteBottom?: number): number;
11
13
  export declare function contentHugSlack(self: ContentHugHost, absoluteBottom: number): number;
12
14
  export declare function contentHugTargetBottom(anchor: number, physicalRows: number, absoluteBottom: number): number;
13
15
  export declare function postCommitPlacementMode(self: {
@@ -34,4 +36,4 @@ export declare function contentHugFrameSettled(self: {
34
36
  export declare function phase2PendingContentRows(self: {
35
37
  placementMode: FramePlacementMode;
36
38
  } & Parameters<typeof projectedBandLength>[0], geo: Parameters<typeof projectedBandLength>[1], route: Parameters<typeof projectedBandLength>[2]): number | null;
37
- export declare function contentHugBandReserve(self: Pick<ContentHugHost, 'placementMode' | 'committedBand'>, rows: number): number;
39
+ export declare function contentHugBandReserve(self: Pick<ContentHugHost, 'placementMode' | 'committedBand' | 'committedBandArchivedPrefix' | 'stdout'>, rows: number): number;
@@ -42,6 +42,7 @@ export declare class TerminalCompositor {
42
42
  pasteRegistry: Map<string, string>;
43
43
  clipboardInFlight: boolean;
44
44
  clipboardFailureMsg: string | null;
45
+ modeNotice: string | null;
45
46
  inputMode: CompositorInputMode;
46
47
  pickerController: PickerController | null;
47
48
  pickerSavedMode: CompositorInputMode;
@@ -155,6 +156,7 @@ export declare class TerminalCompositor {
155
156
  dismissPromptGhost(): boolean;
156
157
  renderDropdownRows(): string[];
157
158
  renderHintRow(): string | null;
159
+ setModeNotice(text: string | null): boolean;
158
160
  repaint(): void;
159
161
  scheduleRepaint(): void;
160
162
  flushPendingRepaint(): void;
@@ -20,6 +20,7 @@ export interface FrameHost {
20
20
  readonly spinnerController: SpinnerController;
21
21
  attachments: ImageAttachment[];
22
22
  clipboardFailureMsg: string | null;
23
+ modeNotice: string | null;
23
24
  committedBand: string[];
24
25
  committedBandMeta: BandRowMeta[];
25
26
  committedBandTopRow: number;
@@ -10,7 +10,7 @@ export interface ChromeRows {
10
10
  }
11
11
  export declare function gatherChromeRows(overlay: string, spinnerController: SpinnerController, attachments: ImageAttachment[], clipboardFailureMsgRef: {
12
12
  value: string | null;
13
- }, cols: number): ChromeRows;
13
+ }, cols: number, modeNotice?: string | null): ChromeRows;
14
14
  export interface ViewportLayout {
15
15
  maxLines: number;
16
16
  gapRows: number;
@@ -4,4 +4,4 @@ export interface FramePosition {
4
4
  targetBottomRow: number;
5
5
  physicalRows: number;
6
6
  }
7
- export declare function computeFramePosition(frame: string, frameLines: string[], absoluteBottom: number, placementMode: FramePlacementMode, anchorRow: number | undefined, logUpdate: LogUpdateFn, hugAnchor?: number): FramePosition;
7
+ export declare function computeFramePosition(frame: string, frameLines: string[], absoluteBottom: number, placementMode: FramePlacementMode, anchorRow: number | undefined, logUpdate: LogUpdateFn, hugAnchor?: number | ((physicalRows: number) => number)): FramePosition;
@@ -26,6 +26,7 @@ export interface KeyDispatchHost {
26
26
  readonly pasteRegistry: Map<string, string>;
27
27
  clipboardInFlight: boolean;
28
28
  clipboardFailureMsg: string | null;
29
+ modeNotice: string | null;
29
30
  attachments: ImageAttachment[];
30
31
  readonly autocompleteState?: AutocompleteState;
31
32
  readonly activeGhost: string | null;
@@ -0,0 +1,14 @@
1
+ export interface ModeNoticeHost {
2
+ armed: boolean;
3
+ modeNotice: string | null;
4
+ repaint(): void;
5
+ }
6
+ export interface ModeNoticeKeyHost {
7
+ modeNotice: string | null;
8
+ scheduleRepaint(): void;
9
+ }
10
+ export declare function setModeNotice(self: ModeNoticeHost, text: string | null): boolean;
11
+ export declare function clearModeNoticeOnKey(self: ModeNoticeKeyHost, key: {
12
+ name?: string;
13
+ shift?: boolean;
14
+ } | undefined): void;
@@ -38,6 +38,7 @@ export interface ResetStateHost {
38
38
  pasteStartCursor: number;
39
39
  readonly pasteRegistry: Map<string, string>;
40
40
  clipboardFailureMsg: string | null;
41
+ modeNotice: string | null;
41
42
  readonly autocompleteState?: AutocompleteState;
42
43
  resizeUnsub: (() => void) | null;
43
44
  resizeImmediateUnsub: (() => void) | null;