agent-afk 5.254.4 → 5.255.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.
@@ -0,0 +1,9 @@
1
+ export declare function expandCwd(rawCwd: string): string;
2
+ export declare function validateScheduleCwd(rawCwd: string): {
3
+ ok: true;
4
+ resolved: string;
5
+ } | {
6
+ ok: false;
7
+ error: string;
8
+ };
9
+ export declare function checkTaskCwdAtRuntime(cwd: string): string | undefined;
@@ -4,6 +4,7 @@ export interface ScheduledTaskConfig {
4
4
  name: string;
5
5
  command: string;
6
6
  cron: string;
7
+ cwd?: string;
7
8
  executor?: Exclude<TaskExecutor, 'builtin'>;
8
9
  trigger?: 'cron' | 'sessionstart' | 'both';
9
10
  enabled: boolean;
@@ -8,6 +8,7 @@ export interface DaemonSpawnOptions {
8
8
  sessionConfig?: Partial<AgentConfig>;
9
9
  sessionFactory?: (config: AgentConfig, ownedTraceWriter?: TraceWriter) => AgentSession;
10
10
  trigger?: 'cron' | 'sessionstart' | 'pull';
11
+ taskCwd?: string;
11
12
  }
12
13
  export declare function daemonTraceLabel(taskId: string): string;
13
14
  export declare function spawnDaemonSession(taskId: string, options: DaemonSpawnOptions): Promise<{
@@ -7,4 +7,5 @@ export declare function runShellTask(task: {
7
7
  taskId: string;
8
8
  command: string;
9
9
  cronExpression?: string;
10
+ cwd?: string;
10
11
  }, trigger: TelemetryTrigger, options: ShellTaskOptions): Promise<TelemetryRecord>;
@@ -11,5 +11,6 @@ export interface ScheduledTask {
11
11
  debounceMs?: number;
12
12
  notifyOn?: 'failure' | 'always' | 'never';
13
13
  notifyChat?: number | string;
14
+ cwd?: string;
14
15
  }
15
16
  export declare function validateScheduledTask(task: ScheduledTask): void;
@@ -6,6 +6,7 @@ export interface FastModeContext {
6
6
  providerFamily: string;
7
7
  hasCustomEndpoint: boolean;
8
8
  executionPath: FastExecutionPath;
9
+ modelEligible?: boolean;
9
10
  }
10
11
  export type FastModeStatus = Readonly<{
11
12
  preference: FastModePreference;
@@ -13,6 +14,7 @@ export type FastModeStatus = Readonly<{
13
14
  reason?: FastModeInactiveReason;
14
15
  }>;
15
16
  export type FastTurnDecision = FastModeStatus;
17
+ export declare const OPENAI_FAST_MODEL_FALLBACK: RegExp;
16
18
  export declare function resolveFastModeStatus(preference: FastModePreference, context: FastModeContext): FastModeStatus;
17
19
  export declare class FastModeController {
18
20
  private preference;
@@ -71,7 +71,7 @@ export type ProviderEvent = {
71
71
  } | {
72
72
  type: 'notice';
73
73
  text: string;
74
- kind: 'truncation' | 'refusal';
74
+ kind: 'truncation' | 'refusal' | 'fast-tier';
75
75
  sessionId?: string;
76
76
  } | {
77
77
  type: 'tool.use.start';
@@ -28,6 +28,7 @@ export interface OpenAICompatibleProviderOptions extends ChildSessionOptions {
28
28
  tools?: ToolDispatcher;
29
29
  mcpManager?: import('../../mcp/index.js').McpManager;
30
30
  customTools?: import('../../tools/custom-tool.js').CustomToolDef[];
31
+ fastModeController?: import('../../fast-mode.js').FastModeController;
31
32
  }
32
33
  export declare class OpenAICompatibleProvider implements ModelProvider {
33
34
  readonly name = "openai-compatible";
@@ -0,0 +1,16 @@
1
+ export interface CatalogModel {
2
+ slug: string;
3
+ service_tiers?: Array<{
4
+ id: string;
5
+ name?: string;
6
+ description?: string;
7
+ }>;
8
+ default_service_tier?: string;
9
+ }
10
+ export interface CatalogReaderDeps {
11
+ homedir?: () => string;
12
+ readFile?: (path: string) => string | null;
13
+ }
14
+ export declare function resetCatalogCache(): void;
15
+ export declare function loadModelsCatalog(deps?: CatalogReaderDeps): Map<string, CatalogModel>;
16
+ export declare function isCatalogModelPriorityEligible(modelSlug: string, deps?: CatalogReaderDeps): boolean | undefined;
@@ -5,3 +5,4 @@ export interface ModelPricing {
5
5
  }
6
6
  export declare const MODEL_PRICING: ReadonlyMap<string, ModelPricing>;
7
7
  export declare function deriveCallCostUsd(model: string, inputTokens: number, outputTokens: number, cachedInputTokens?: number): number | undefined;
8
+ export declare function deriveCallCostUsdWithTier(model: string, inputTokens: number, outputTokens: number, cachedInputTokens?: number, confirmedPriorityTier?: boolean): number | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function chatGptClaudeModelError(model: string): Error;
2
+ export declare function clarifyResponsesError(err: unknown, isChatGptBackend: boolean, model: string): Error;
@@ -0,0 +1,6 @@
1
+ import type { FastModeController, FastTurnDecision } from '../../../fast-mode.js';
2
+ export declare function snapshotFastDecision(controller: FastModeController | undefined, model: string, hasCustomEndpoint: boolean): FastTurnDecision | undefined;
3
+ export declare function isFastModeServiceTierError(error: unknown): boolean;
4
+ export declare function extractResponsesServiceTier(responseObj: Record<string, unknown> | null | undefined): string | undefined;
5
+ export declare function extractChatCompletionsServiceTier(chunk: Record<string, unknown> | null | undefined): string | undefined;
6
+ export declare function makeFastModeMismatchWarning(fast: boolean, appliedTier: string | undefined): string | undefined;
@@ -0,0 +1,26 @@
1
+ import type { FastModeController } from '../../../fast-mode.js';
2
+ import type { ProviderEvent } from '../../../provider.js';
3
+ export declare const OPENAI_FAST_SERVICE_TIER = "priority";
4
+ export declare function isCustomOpenAIEndpoint(baseURL: string | undefined): boolean;
5
+ export interface FastTierOptions {
6
+ controller: FastModeController;
7
+ hasCustomEndpoint: boolean;
8
+ }
9
+ export declare class FastTierSession {
10
+ private readonly opts;
11
+ private rejected;
12
+ private warned;
13
+ private turnFast;
14
+ private appliedTier;
15
+ private pendingNotice;
16
+ constructor(opts: FastTierOptions | undefined);
17
+ beginTurn(model: string): boolean;
18
+ get active(): boolean;
19
+ create<T>(body: Record<string, unknown>, call: (b: Record<string, unknown>) => Promise<T>): Promise<T>;
20
+ observeResponsesEvent(event: unknown): void;
21
+ observeChatChunk(chunk: unknown): void;
22
+ confirmedFast(): boolean;
23
+ drainNotice(sessionId: string): Generator<ProviderEvent>;
24
+ private recordApplied;
25
+ private queueNotice;
26
+ }
@@ -4,6 +4,7 @@ import type { ProviderQuery, ProviderEvent, ProviderUserTurn, ProviderContextUsa
4
4
  import { type OpenAIAuthResolution, type AuthResolverDeps } from './auth.js';
5
5
  import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
6
6
  import { resolveReasoningEffort } from './query/model-params.js';
7
+ import { type FastTierOptions } from './query/fast-tier-session.js';
7
8
  export { __setRetryBaseDelay } from './query/retry.js';
8
9
  export { __setOpenAIClientFactory } from './query/client.js';
9
10
  export type { OpenAIClientFactory } from './query/client.js';
@@ -23,6 +24,7 @@ export interface OpenAICompatibleQueryOptions {
23
24
  mcpManager?: import('../../mcp/index.js').McpManager;
24
25
  useResponsesApi?: boolean;
25
26
  traceWriter?: TraceSink;
27
+ fastTier?: FastTierOptions;
26
28
  }
27
29
  export declare class OpenAICompatibleQuery implements ProviderQuery {
28
30
  private readonly client;
@@ -35,6 +37,7 @@ export declare class OpenAICompatibleQuery implements ProviderQuery {
35
37
  private readonly wireMode;
36
38
  private readonly useOpenAIPricing;
37
39
  private readonly traceWriter;
40
+ private readonly fastTier;
38
41
  private priorTurns;
39
42
  private currentModel;
40
43
  private currentPermissionMode;
@@ -49,7 +52,6 @@ export declare class OpenAICompatibleQuery implements ProviderQuery {
49
52
  private runTurn;
50
53
  private _runTurnInner;
51
54
  private finishTurn;
52
- private clarifyResponsesError;
53
55
  private runIteration;
54
56
  private dispatchAndAppend;
55
57
  interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
@@ -80,4 +82,5 @@ export declare function buildQueryFromConfig(config: AgentConfig, promptStream:
80
82
  useResponsesApi?: boolean;
81
83
  authDeps?: AuthResolverDeps;
82
84
  sessionIdOverride?: string;
85
+ fastTier?: FastTierOptions;
83
86
  }): OpenAICompatibleQuery;
@@ -48,6 +48,6 @@ export interface AccumulatedToolCall {
48
48
  }
49
49
  export declare function createStreamState(): StreamState;
50
50
  export declare function translateChunk(chunk: OpenAIChunk, state: StreamState, sessionId: string): Generator<ProviderEvent>;
51
- export declare function usageFromState(state: StreamState, model?: string): ProviderUsage;
51
+ export declare function usageFromState(state: StreamState, model?: string, confirmedPriorityTier?: boolean): ProviderUsage;
52
52
  export declare function finalizedToolCalls(state: StreamState): AccumulatedToolCall[];
53
53
  export declare function isToolCallStop(state: StreamState): boolean;
@@ -71,7 +71,7 @@ export type OutputEvent = {
71
71
  } | {
72
72
  type: 'notice';
73
73
  text: string;
74
- kind: 'truncation' | 'refusal';
74
+ kind: 'truncation' | 'refusal' | 'fast-tier';
75
75
  } | {
76
76
  type: 'tool-activity';
77
77
  activeCount: number;
@@ -22,6 +22,7 @@ export interface ResetStateHost {
22
22
  hasCommitted: boolean;
23
23
  placementMode: FramePlacementMode;
24
24
  commitInFlight: boolean;
25
+ pendingContentRows: number | null;
25
26
  pendingResizeErase: {
26
27
  top: number;
27
28
  bottom: number;