agent-afk 5.337.0 → 5.338.1
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/background-registry.mark-terminal.d.ts +1 -1
- package/dist/agent/background-registry.types.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query-options.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-turn-driver.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/request-types.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/turn-driver.d.ts +1 -0
- package/dist/agent/session/model-slots.d.ts +2 -0
- package/dist/agent/session/session-meta.d.ts +13 -0
- package/dist/agent/session/slot-credentials.d.ts +1 -0
- package/dist/agent/trace/receipt.d.ts +5 -1
- package/dist/agent/trace/receipt.journal.d.ts +10 -0
- package/dist/agent/trace/types.session-phase.d.ts +1 -1
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/cli/commands/interactive/mascot-bar.d.ts +1 -0
- package/dist/cli/session-store.d.ts +1 -0
- package/dist/cli.mjs +478 -476
- package/dist/config/endpoint-semaphore.d.ts +9 -0
- package/dist/config/env.d.ts +35 -0
- package/dist/config/env.debug.d.ts +7 -0
- package/dist/config/env.model-slot-concurrency.d.ts +29 -0
- package/dist/improve/propose/template-engine.templates-density.d.ts +2 -0
- package/dist/index.mjs +392 -388
- package/dist/paths.journal.d.ts +1 -0
- package/dist/telegram.mjs +404 -404
- package/package.json +2 -1
|
@@ -9,7 +9,7 @@ export interface MarkTerminalJob {
|
|
|
9
9
|
startedAt: number;
|
|
10
10
|
endedAt?: number;
|
|
11
11
|
result?: SubagentResult;
|
|
12
|
-
provenance: 'user' | 'model';
|
|
12
|
+
provenance: 'user' | 'model' | 'user-backgrounded';
|
|
13
13
|
parentSessionId?: string;
|
|
14
14
|
cancelSource?: 'explicit' | 'cascade';
|
|
15
15
|
modelCancelReason?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SubagentResult } from './subagent.js';
|
|
2
2
|
export type BackgroundJobStatus = 'running' | 'completed' | 'failed' | 'cancelled';
|
|
3
|
-
export type BackgroundJobProvenance = 'model' | 'user';
|
|
3
|
+
export type BackgroundJobProvenance = 'model' | 'user' | 'user-backgrounded';
|
|
4
4
|
export interface BackgroundJob {
|
|
5
5
|
readonly jobId: string;
|
|
6
6
|
readonly provenance: BackgroundJobProvenance;
|
|
@@ -34,6 +34,7 @@ export interface AnthropicDirectQueryOptions {
|
|
|
34
34
|
rawEffort?: import('../../types/sdk-types.js').EffortLevel;
|
|
35
35
|
temperature?: number;
|
|
36
36
|
baseUrl?: string;
|
|
37
|
+
endpointConcurrency?: number;
|
|
37
38
|
maxToolUseIterations?: number;
|
|
38
39
|
softDeadlineMs?: number;
|
|
39
40
|
traceWriter?: import('../../trace/index.js').TraceSink;
|
|
@@ -18,6 +18,7 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
|
|
|
18
18
|
private readonly launchModel;
|
|
19
19
|
private readonly temperature?;
|
|
20
20
|
private readonly baseUrl?;
|
|
21
|
+
private readonly endpointConcurrency?;
|
|
21
22
|
private readonly maxToolUseIterations?;
|
|
22
23
|
private readonly softDeadlineMs?;
|
|
23
24
|
private readonly traceWriter?;
|
|
@@ -18,6 +18,7 @@ export interface TurnDriverContext {
|
|
|
18
18
|
readonly temperature: number | undefined;
|
|
19
19
|
readonly thinkingBlockBinding: import('./types.js').RunTurnInput['thinkingBlockBinding'] | undefined;
|
|
20
20
|
readonly baseUrl: string | undefined;
|
|
21
|
+
readonly endpointConcurrency: number | undefined;
|
|
21
22
|
readonly maxToolUseIterations: number | undefined;
|
|
22
23
|
readonly softDeadlineMs: number | undefined;
|
|
23
24
|
readonly traceWriter: import('../../trace/index.js').TraceSink | undefined;
|
|
@@ -7,6 +7,7 @@ import type { OpenAIMessage } from '../messages.js';
|
|
|
7
7
|
import type { OpenAIJournalWiring } from './journal-wiring.js';
|
|
8
8
|
import type { AgentConfig } from '../../../types/config-types.js';
|
|
9
9
|
import type { OpenAIAuthResolution } from '../auth.js';
|
|
10
|
+
export declare const INCOMPLETE_MARKER = "Context capacity exhausted. Partial tool outputs are journaled; resume from saved work.";
|
|
10
11
|
export interface TurnDriverContext extends IterationContext, FinishTurnContext {
|
|
11
12
|
readonly abort: AbortCoordinator;
|
|
12
13
|
readonly toolDispatcher: ToolDispatcher | undefined;
|
|
@@ -9,6 +9,7 @@ export interface ModelSlotBinding {
|
|
|
9
9
|
apiKey?: string;
|
|
10
10
|
contextWindow?: number;
|
|
11
11
|
maxOutputTokens?: number;
|
|
12
|
+
maxConcurrency?: number;
|
|
12
13
|
}
|
|
13
14
|
export type ModelSlots = Record<SlotName, ModelSlotBinding>;
|
|
14
15
|
export declare const CLAUDE_HAIKU_ID = "claude-haiku-5-5";
|
|
@@ -29,6 +30,7 @@ export { OPENAI_MODEL_HINTS } from './model-slots.hints.js';
|
|
|
29
30
|
export declare const MODEL_ALIASES_HINT: readonly string[];
|
|
30
31
|
export declare function setSlotBindings(bindings: ModelSlots | undefined): void;
|
|
31
32
|
export declare function resetSlotBindings(): void;
|
|
33
|
+
export declare const MAX_SLOT_CONCURRENCY = 32;
|
|
32
34
|
export declare function computeSlotBindings(fileOverrides?: Partial<Record<SlotName, ModelSlotBinding>>): ModelSlots;
|
|
33
35
|
export declare function getSlotBindings(override?: ModelSlots): ModelSlots;
|
|
34
36
|
export declare function slotForInput(input: string, bindings?: ModelSlots): SlotName | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SessionMeta {
|
|
2
|
+
v: 1;
|
|
3
|
+
sessionId: string;
|
|
4
|
+
model: string;
|
|
5
|
+
cwd?: string;
|
|
6
|
+
traceLabel?: string | null;
|
|
7
|
+
surface?: string;
|
|
8
|
+
provider?: string;
|
|
9
|
+
startedAt?: number;
|
|
10
|
+
afkVersion?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function writeSessionMeta(meta: SessionMeta): Promise<void>;
|
|
13
|
+
export declare function readSessionMeta(sessionId: string): SessionMeta | null;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { renderReceiptMarkdown } from './receipt.render.js';
|
|
2
2
|
import type { HookHandler } from '../hooks.js';
|
|
3
3
|
import { type CostTokens, type SessionCostSource } from './cost.js';
|
|
4
|
+
import { type JournalSummary } from './receipt.journal.js';
|
|
4
5
|
import { type ClosureReason, type ToolFailureClass, type TraceEvent, type TraceEventKind } from './types.js';
|
|
5
6
|
export { renderReceiptMarkdown };
|
|
6
|
-
export
|
|
7
|
+
export { extractJournalSummary, type JournalSummary } from './receipt.journal.js';
|
|
8
|
+
export declare const RECEIPT_SCHEMA_VERSION: 2;
|
|
7
9
|
export interface ReceiptToolFailure {
|
|
8
10
|
toolUseId: string;
|
|
9
11
|
name: string;
|
|
@@ -66,6 +68,7 @@ export interface RunReceipt {
|
|
|
66
68
|
humanReviewRequired: boolean;
|
|
67
69
|
humanReviewReasons: string[];
|
|
68
70
|
limitations: string[];
|
|
71
|
+
journalSummary?: JournalSummary;
|
|
69
72
|
}
|
|
70
73
|
export interface ReceiptMeta {
|
|
71
74
|
tracePath: string;
|
|
@@ -73,6 +76,7 @@ export interface ReceiptMeta {
|
|
|
73
76
|
sessionId?: string;
|
|
74
77
|
endReason?: string;
|
|
75
78
|
now?: Date;
|
|
79
|
+
journalSummary?: JournalSummary;
|
|
76
80
|
}
|
|
77
81
|
export declare function parseTraceJsonl(raw: string): TraceEvent[];
|
|
78
82
|
export declare function receiptPathsFor(tracePath: string): {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JournalMessage } from '../journal/types.js';
|
|
2
|
+
export interface JournalSummary {
|
|
3
|
+
firstUserMessage?: string;
|
|
4
|
+
lastAssistantMessage?: string;
|
|
5
|
+
toolNames: string[];
|
|
6
|
+
toolUseCount: number;
|
|
7
|
+
messageCount: number;
|
|
8
|
+
textRedacted?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function extractJournalSummary(messages: JournalMessage[] | null, textDisabled: boolean): JournalSummary | undefined;
|
|
@@ -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' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | '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' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'billing_settled' | 'subagent_model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded';
|
|
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' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | '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' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded';
|
|
2
2
|
export interface SessionPhasePayload {
|
|
3
3
|
phase: SessionPhaseName;
|
|
4
4
|
durationMs?: number;
|