agent-afk 5.332.0 → 5.334.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/dist/agent/daemon.read-body.d.ts +2 -0
- package/dist/agent/memory/estimate-tokens.d.ts +1 -0
- package/dist/agent/memory/index.d.ts +2 -1
- package/dist/agent/memory/memory-store.d.ts +2 -1
- package/dist/agent/outcomes/combine-v2.d.ts +1 -0
- package/dist/agent/outcomes/relabel-job.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/auth-retry-tier.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/complete-wire.d.ts +0 -1
- package/dist/agent/session/accounting-accumulator.d.ts +4 -0
- package/dist/agent/session/model-slots.d.ts +4 -4
- package/dist/agent/session/model-slots.hints.d.ts +1 -1
- package/dist/agent/session/model-slots.output-override.d.ts +1 -0
- package/dist/cli/_lib/stream-renderer-contexts.d.ts +2 -0
- package/dist/cli/_lib/stream-renderer-lifecycle.d.ts +2 -0
- package/dist/cli/_lib/stream-renderer-options.d.ts +2 -0
- package/dist/cli/_lib/stream-renderer-process.d.ts +2 -0
- package/dist/cli/_lib/stream-renderer-source.d.ts +1 -0
- package/dist/cli/_lib/stream-renderer-subagent.d.ts +2 -0
- package/dist/cli/_lib/stream-renderer.d.ts +1 -0
- package/dist/cli/commands/interactive/shared.d.ts +1 -0
- package/dist/cli/commands/interactive/tool-lane.d.ts +2 -0
- package/dist/cli/commands/interactive/tool-lane.queries.d.ts +1 -0
- package/dist/cli/config/afk-md-tier.d.ts +6 -0
- package/dist/cli/config/types.d.ts +1 -0
- package/dist/cli/slash/commands/afk-md/targets.d.ts +1 -1
- package/dist/cli.mjs +426 -422
- package/dist/config/env.d.ts +49 -28
- package/dist/config/env.model-tiers.d.ts +19 -28
- package/dist/config/env.model-tiers.suggest.d.ts +31 -0
- package/dist/improve/eval-run/contracts.d.ts +1 -0
- package/dist/index.mjs +368 -364
- package/dist/telegram.mjs +381 -377
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function estimateTokens(text: string): number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { MemoryStore
|
|
1
|
+
export { MemoryStore } from './memory-store.js';
|
|
2
|
+
export { estimateTokens } from './estimate-tokens.js';
|
|
2
3
|
export { loadHotMemory, injectHotMemory } from './memory-loader.js';
|
|
3
4
|
export { injectGoalPrompt } from '../goals/inject.js';
|
|
4
5
|
export { createMemorySessionEndHook, createChildMemoryHotBlockHook } from './memory-hooks.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { estimateTokens } from './estimate-tokens.js';
|
|
1
2
|
import type { AccessStats, Fact, NewFact, SearchOpts, MemorySearchResult, SessionRecord, NewSession, Procedure, SessionOutcome } from './types.js';
|
|
2
3
|
export declare const HOT_SOFT_WARN_RATIO = 0.8;
|
|
3
|
-
export
|
|
4
|
+
export { estimateTokens };
|
|
4
5
|
export interface HotUsage {
|
|
5
6
|
chars: number;
|
|
6
7
|
tokens: number;
|
|
@@ -13,5 +13,6 @@ export interface CombinerV2Result {
|
|
|
13
13
|
basis?: 'proven' | 'no_bad_signals';
|
|
14
14
|
}
|
|
15
15
|
export declare function effectiveSeverity(vote: Vote): VoteSeverity;
|
|
16
|
+
export declare function collapseSingleCountVotes(votes: Vote[]): Vote[];
|
|
16
17
|
export declare function computeConfidenceV2(label: OutcomeLabel, votes: Vote[]): number;
|
|
17
18
|
export declare function combineV2(input: CombinerV2Input): CombinerV2Result;
|
|
@@ -2,4 +2,5 @@ import type { ProviderEvent } from '../../../provider.js';
|
|
|
2
2
|
import type { RunTurnInput } from '../types.js';
|
|
3
3
|
import type { RetryTierContext } from './retry-context.js';
|
|
4
4
|
export declare function isRetryableAuth(ctx: RetryTierContext, error: Error): boolean;
|
|
5
|
+
export declare function isRefreshablePermissionDenied(ctx: RetryTierContext, error: Error): boolean;
|
|
5
6
|
export declare function turnWithAuthRetry(ctx: RetryTierContext, runInput: RunTurnInput, isClosed: () => boolean): AsyncGenerator<ProviderEvent, void, void>;
|
|
@@ -11,5 +11,4 @@ export interface CompleteWireClientOptions {
|
|
|
11
11
|
fetch: typeof globalThis.fetch;
|
|
12
12
|
}
|
|
13
13
|
export type CompleteWireClientFactory = (opts: CompleteWireClientOptions) => OpenAI;
|
|
14
|
-
export declare function completeWithWire(input: OpenAIOneShotInput, clientFactory?: CompleteWireClientFactory, authDeps?: AuthResolverDeps): Promise<string>;
|
|
15
14
|
export declare function completeWithWireWithStop(input: OpenAIOneShotInput, clientFactory?: CompleteWireClientFactory, authDeps?: AuthResolverDeps): Promise<ProviderCompleteResult>;
|
|
@@ -13,6 +13,8 @@ export interface AccountingSnapshot {
|
|
|
13
13
|
subagentCompletedCount: number;
|
|
14
14
|
subagentRunningTokens: Readonly<TokenCounters>;
|
|
15
15
|
subagentRunningCostUsd: number;
|
|
16
|
+
lifetimeSessionCostUsd: number;
|
|
17
|
+
lifetimeSubagentCostUsd: number;
|
|
16
18
|
sessionBilling?: BillingRollupSnapshot;
|
|
17
19
|
subagentBilling?: BillingRollupSnapshot;
|
|
18
20
|
}
|
|
@@ -27,6 +29,8 @@ export declare class AccountingAccumulator {
|
|
|
27
29
|
private subagentCompletedCount;
|
|
28
30
|
private subagentRunningTokens;
|
|
29
31
|
private subagentRunningCostUsd;
|
|
32
|
+
private lifetimeSessionCostUsd;
|
|
33
|
+
private lifetimeSubagentCostUsd;
|
|
30
34
|
private readonly sessionBilling;
|
|
31
35
|
private readonly subagentBilling;
|
|
32
36
|
reset(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type SlotName = 'local' | 'small' | 'medium' | 'large';
|
|
1
|
+
export type SlotName = 'local' | 'small' | 'medium' | 'large' | 'subagent';
|
|
2
2
|
export declare const SLOT_NAMES: readonly SlotName[];
|
|
3
3
|
export type SlotProvider = 'anthropic' | 'openai' | 'chatgpt-oauth' | 'xai' | 'xai-oauth';
|
|
4
4
|
export interface ModelSlotBinding {
|
|
@@ -25,7 +25,8 @@ export declare const GPT_TERRA_ID = "gpt-5.6-terra";
|
|
|
25
25
|
export declare const DEFAULT_SLOT_BINDINGS: ModelSlots;
|
|
26
26
|
export declare const AUTO_SENTINEL = "auto";
|
|
27
27
|
export declare const DIRECT_MODEL_ALIASES: Readonly<Record<string, string>>;
|
|
28
|
-
export { OPENAI_MODEL_HINTS
|
|
28
|
+
export { OPENAI_MODEL_HINTS } from './model-slots.hints.js';
|
|
29
|
+
export declare const MODEL_ALIASES_HINT: readonly string[];
|
|
29
30
|
export declare function setSlotBindings(bindings: ModelSlots | undefined): void;
|
|
30
31
|
export declare function resetSlotBindings(): void;
|
|
31
32
|
export declare function computeSlotBindings(fileOverrides?: Partial<Record<SlotName, ModelSlotBinding>>): ModelSlots;
|
|
@@ -37,6 +38,5 @@ export declare function unconfiguredSlotError(input: string | undefined, binding
|
|
|
37
38
|
export declare function parseModelsConfig(raw: unknown): Partial<Record<SlotName, ModelSlotBinding>>;
|
|
38
39
|
export { coerceSlotBindingInput } from './model-slots.coerce.js';
|
|
39
40
|
export declare const MAX_CONTEXT_WINDOW_OVERRIDE = 10000000;
|
|
40
|
-
export
|
|
41
|
-
export { maxOutputTokensOverrideFor } from './model-slots.output-override.js';
|
|
41
|
+
export { maxOutputTokensOverrideFor, contextWindowOverrideFor } from './model-slots.output-override.js';
|
|
42
42
|
export declare function _resetJsonStringSlotWarnings(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const OPENAI_MODEL_HINTS: readonly string[];
|
|
2
|
-
export declare
|
|
2
|
+
export declare function getModelAliasesHint(): readonly string[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ModelSlots } from './model-slots.js';
|
|
2
2
|
export declare function maxOutputTokensOverrideFor(concreteId: string, bindings?: ModelSlots): number | undefined;
|
|
3
|
+
export declare function contextWindowOverrideFor(concreteId: string, bindings?: ModelSlots): number | undefined;
|
|
@@ -12,6 +12,7 @@ import type { CommitCoordinator } from './commit-coordinator.js';
|
|
|
12
12
|
import type { SourceState } from './stream-renderer-source.js';
|
|
13
13
|
import type { ChildActivityTracker } from './child-activity-select.js';
|
|
14
14
|
import type { ThoughtSummaryHold } from './thought-summary-hold.js';
|
|
15
|
+
import type { CompletionWriter } from '../commands/interactive/shared.js';
|
|
15
16
|
export declare function makeOrchestratorCtx(args: {
|
|
16
17
|
out: Writer;
|
|
17
18
|
isTTY: boolean;
|
|
@@ -39,6 +40,7 @@ export declare function makeSubagentCtx(args: {
|
|
|
39
40
|
streamingMarkdown: Map<string, StreamingMarkdownRenderer>;
|
|
40
41
|
thinkingMode: 'off' | 'summary' | 'live' | 'digest';
|
|
41
42
|
orchestratorCtx: OrchestratorCtx;
|
|
43
|
+
completionWriter?: CompletionWriter;
|
|
42
44
|
}): SubagentCtx;
|
|
43
45
|
export declare function resolveParentSyntheticId(args: {
|
|
44
46
|
parentId: string | undefined;
|
|
@@ -9,6 +9,8 @@ import type { StreamingMarkdownRenderer } from '../markdown-stream.js';
|
|
|
9
9
|
import type { Writer } from '../slash/types.js';
|
|
10
10
|
import type { ProgressEvent } from '../../agent/types.js';
|
|
11
11
|
import { type TtfbTickCtx } from './stream-renderer-ttfb.js';
|
|
12
|
+
export declare const WAITING_LABEL_PREFIX = " \u00B7 waiting ";
|
|
13
|
+
export declare const AWAITING_LABEL_PREFIX = " \u00B7 awaiting ";
|
|
12
14
|
export interface LifecycleContext extends TtfbTickCtx {
|
|
13
15
|
compositor: TerminalCompositor | null;
|
|
14
16
|
overlayComposer: OverlayComposer | null;
|
|
@@ -3,9 +3,11 @@ import type { IHistoryRing } from '../input/types.js';
|
|
|
3
3
|
import type { AutocompleteState } from '../input/autocomplete-state.js';
|
|
4
4
|
import type { TerminalCompositor } from '../terminal-compositor.js';
|
|
5
5
|
import type { PreviewDiffRef } from '../../agent/tools/hooks/edit-preview-hook.js';
|
|
6
|
+
import type { CompletionWriter } from '../commands/interactive/shared.js';
|
|
6
7
|
export interface StreamRendererOptions {
|
|
7
8
|
skillIdentity?: import('./skill-identity-format.js').SkillIdentity;
|
|
8
9
|
out: Writer;
|
|
10
|
+
completionWriter?: CompletionWriter;
|
|
9
11
|
thinkingMode?: 'off' | 'summary' | 'live' | 'digest';
|
|
10
12
|
onCancel?: () => void;
|
|
11
13
|
onBackground?: () => void;
|
|
@@ -10,6 +10,7 @@ import type { CommitCoordinator } from './commit-coordinator.js';
|
|
|
10
10
|
import type { ChildActivityTracker } from './child-activity-select.js';
|
|
11
11
|
import type { InFlightToolTracker } from '../input/work-derived-verb.js';
|
|
12
12
|
import type { OrchestratorCtx } from './stream-renderer-orchestrator.js';
|
|
13
|
+
import type { CompletionWriter } from '../commands/interactive/shared.js';
|
|
13
14
|
import type { LoopStage, StageSignals } from '../commands/interactive/loop-stage.js';
|
|
14
15
|
import { type SourceState } from './stream-renderer-source.js';
|
|
15
16
|
export interface ProcessCtx {
|
|
@@ -34,5 +35,6 @@ export interface ProcessCtx {
|
|
|
34
35
|
activeSkillName: string | undefined;
|
|
35
36
|
onStageChange: ((stage: LoopStage, signals?: StageSignals) => void) | undefined;
|
|
36
37
|
buildOrchestratorCtx: () => OrchestratorCtx;
|
|
38
|
+
completionWriter?: CompletionWriter;
|
|
37
39
|
}
|
|
38
40
|
export declare function processEvent(ctx: ProcessCtx, event: OutputEvent, meta?: SubagentProgressMeta): void;
|
|
@@ -3,6 +3,7 @@ import type { SourceState } from './stream-renderer-source.js';
|
|
|
3
3
|
import type { TerminalCompositor } from '../terminal-compositor.js';
|
|
4
4
|
import type { ToolLane } from '../commands/interactive/tool-lane.js';
|
|
5
5
|
import type { Writer } from '../slash/types.js';
|
|
6
|
+
import type { CompletionWriter } from '../commands/interactive/shared.js';
|
|
6
7
|
import type { CardSpec } from '../render.js';
|
|
7
8
|
import { StreamingMarkdownRenderer } from '../markdown-stream.js';
|
|
8
9
|
import type { OrchestratorCtx } from './stream-renderer-orchestrator.js';
|
|
@@ -12,6 +13,7 @@ export interface SubagentCtx {
|
|
|
12
13
|
compositor: TerminalCompositor | null;
|
|
13
14
|
toolLane: ToolLane;
|
|
14
15
|
out: Writer;
|
|
16
|
+
completionWriter?: CompletionWriter;
|
|
15
17
|
streamingMarkdown: Map<string, StreamingMarkdownRenderer>;
|
|
16
18
|
thinkingMode: 'off' | 'summary' | 'live' | 'digest';
|
|
17
19
|
orchestratorCtx?: OrchestratorCtx;
|
|
@@ -45,6 +45,7 @@ export declare class StreamRenderer {
|
|
|
45
45
|
private ttfbDone;
|
|
46
46
|
private lastTtfbAnnotation;
|
|
47
47
|
private readonly addPreviewDiffRef;
|
|
48
|
+
private completionWriter;
|
|
48
49
|
readonly sink: (event: OutputEvent, meta?: SubagentProgressMeta) => void;
|
|
49
50
|
constructor(opts: StreamRendererOptions);
|
|
50
51
|
arm(): Promise<void>;
|
|
@@ -108,6 +108,7 @@ export interface CompletionWriter {
|
|
|
108
108
|
fn: (line: string) => void;
|
|
109
109
|
idleFn: (line: string) => void;
|
|
110
110
|
suppressSubagentCompletion?: boolean;
|
|
111
|
+
renderedSubagentIds?: Set<string>;
|
|
111
112
|
}
|
|
112
113
|
export interface TurnHandles {
|
|
113
114
|
setInFlight(v: boolean): void;
|
|
@@ -20,6 +20,8 @@ export declare class ToolLane {
|
|
|
20
20
|
compactScrollback: boolean;
|
|
21
21
|
addStart(toolUseId: string, toolName: string, toolInput: string): void;
|
|
22
22
|
addStartWithAgentContext(toolUseId: string, toolName: string, toolInput: string, agentContext: string | undefined, maxWidth?: number): void;
|
|
23
|
+
annotateIfPresent(toolUseId: string, toolName: string, toolInput: string): boolean;
|
|
24
|
+
countLiveChildAgents(parentId: string): number;
|
|
23
25
|
mergeAgentLabel(parentToolUseId: string, label: string, maxWidth?: number): boolean;
|
|
24
26
|
setSkillIdentity(toolUseId: string, identity: SkillIdentity): void;
|
|
25
27
|
setAgentContext(toolUseId: string, agentContext: string | undefined): void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { Entry } from './tool-lane-render.js';
|
|
2
2
|
export declare function trailingCompletedRootToolName(entries: ReadonlyMap<string, Entry>, order: readonly string[]): string | undefined;
|
|
3
|
+
export declare function liveChildAgentCount(entries: ReadonlyMap<string, Entry>, parentId: string): number;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
export declare const OVERLAY_TOKEN_WARN_THRESHOLD = 10000;
|
|
1
2
|
export interface AfkMdResult {
|
|
2
3
|
content: string;
|
|
3
4
|
paths: string[];
|
|
5
|
+
estimatedTokens: number;
|
|
4
6
|
}
|
|
7
|
+
export declare function _resetAfkMdSizeWarnCache(): void;
|
|
8
|
+
export declare function deferAfkMdSizeWarnings(): void;
|
|
9
|
+
export declare function flushDeferredAfkMdSizeWarnings(): void;
|
|
5
10
|
export declare function resetAfkMdCache(): void;
|
|
11
|
+
export declare function warnIfAfkMdOversize(result: AfkMdResult): void;
|
|
6
12
|
export declare function loadAfkMd(cwd?: string): AfkMdResult | null;
|
|
@@ -9,7 +9,7 @@ export interface AfkMdTarget {
|
|
|
9
9
|
blank: boolean;
|
|
10
10
|
duplicate: boolean;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export { OVERLAY_TOKEN_WARN_THRESHOLD as OVERLAY_TOKEN_WARN_THRESHOLD } from '../../../config/afk-md-tier.js';
|
|
13
13
|
export declare function resolveTargets(cwd?: string): AfkMdTarget[];
|
|
14
14
|
export declare function targetFor(scope: AfkMdScope, cwd?: string): AfkMdTarget;
|
|
15
15
|
export declare function contributes(t: AfkMdTarget): boolean;
|