agent-afk 5.337.0 → 5.339.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/background-registry.mark-terminal.d.ts +1 -1
- package/dist/agent/background-registry.types.d.ts +1 -1
- package/dist/agent/file-checkpoint/bash-checkpoint.d.ts +5 -0
- package/dist/agent/file-checkpoint/file-checkpoint.d.ts +6 -0
- package/dist/agent/file-checkpoint/git-snapshot.attrs.d.ts +9 -0
- package/dist/agent/file-checkpoint/git-snapshot.d.ts +49 -0
- package/dist/agent/file-checkpoint/git-snapshot.diff.d.ts +27 -0
- package/dist/agent/file-checkpoint/git-snapshot.exec.d.ts +34 -0
- package/dist/agent/file-checkpoint/git-snapshot.index.d.ts +6 -0
- package/dist/agent/file-checkpoint/rewind-plan.d.ts +1 -0
- package/dist/agent/file-checkpoint/turn-log.d.ts +9 -1
- package/dist/agent/hooks.d.ts +1 -0
- package/dist/agent/provider.d.ts +1 -0
- 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/providers/openai-compatible/system-prompt-wiring.d.ts +10 -0
- package/dist/agent/providers/shared/prompt-fragment-tokens.d.ts +23 -0
- package/dist/agent/risk-classifier.d.ts +1 -1
- package/dist/agent/session/model-slots.d.ts +2 -0
- package/dist/agent/session/session-meta.d.ts +14 -0
- package/dist/agent/session/slot-credentials.d.ts +1 -0
- package/dist/agent/trace/events.d.ts +5 -0
- package/dist/agent/trace/events.session-phase.d.ts +2 -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/agent/types/session-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/terminal-compositor.frame.lines.d.ts +1 -1
- package/dist/cli/terminal-compositor.types.d.ts +1 -0
- package/dist/cli.mjs +589 -582
- package/dist/config/endpoint-semaphore.d.ts +9 -0
- package/dist/config/env.d.ts +56 -0
- package/dist/config/env.debug.d.ts +7 -0
- package/dist/config/env.file-checkpoint.d.ts +21 -0
- package/dist/config/env.model-slot-concurrency.d.ts +29 -0
- package/dist/config/env.session-storage.d.ts +21 -0
- package/dist/improve/propose/template-engine.templates-density.d.ts +2 -0
- package/dist/index.mjs +443 -434
- package/dist/paths.checkpoint.d.ts +2 -0
- package/dist/paths.d.ts +1 -1
- package/dist/paths.journal.d.ts +1 -0
- package/dist/telegram.mjs +471 -466
- package/dist/utils/errors.d.ts +2 -0
- package/dist/web-server/fork-ledger.d.ts +1 -0
- 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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FileCheckpointRegistry } from './file-checkpoint.js';
|
|
2
|
+
export interface BashCheckpoint {
|
|
3
|
+
finish(partialReason?: string): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare function beginBashCheckpoint(registry: FileCheckpointRegistry | undefined, cwd: string, skipReason?: string, signal?: AbortSignal): Promise<BashCheckpoint>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export interface FileCheckpointRegistry {
|
|
2
2
|
snapshotFile(absPath: string): Promise<void>;
|
|
3
|
+
recordPriorState(absPath: string, prior: {
|
|
4
|
+
bytes: Buffer;
|
|
5
|
+
mode: number;
|
|
6
|
+
} | null): Promise<void>;
|
|
7
|
+
readonly sessionId: string;
|
|
8
|
+
readonly stateDir?: string;
|
|
3
9
|
readonly turnId: string;
|
|
4
10
|
touchedPaths(): string[];
|
|
5
11
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Failure, type GitCtx } from './git-snapshot.exec.js';
|
|
2
|
+
export declare function _setAttrSourceSupportForTests(value: boolean | undefined): void;
|
|
3
|
+
export declare function attrSourceSupported(ctx: GitCtx, cwd: string, emptyTree: string): Promise<boolean | null>;
|
|
4
|
+
export declare function hasConvertingAttribute(text: string): boolean;
|
|
5
|
+
export declare function findConverting(files: readonly string[]): Promise<string | null>;
|
|
6
|
+
export declare function workTreeAttributeFiles(ctx: GitCtx, repoRoot: string): Promise<string[] | Failure>;
|
|
7
|
+
export declare function globalAttributeFiles(ctx: GitCtx, cwd: string): Promise<string[]>;
|
|
8
|
+
export declare function systemAttributeFile(ctx: GitCtx, cwd: string): Promise<string | undefined>;
|
|
9
|
+
export declare function captureAttributeCheck(ctx: GitCtx, repoRoot: string, infoAttributes: string, supported: boolean): Promise<Failure | null>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export { MAX_BLOB_BYTES } from './git-snapshot.diff.js';
|
|
2
|
+
export type GitSnapshotFailure = 'not-git' | 'timeout' | 'unsafe-attributes' | 'error';
|
|
3
|
+
export interface CaptureOptions {
|
|
4
|
+
cwd: string;
|
|
5
|
+
objectDir: string;
|
|
6
|
+
indexFile: string;
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
}
|
|
9
|
+
export type CaptureResult = {
|
|
10
|
+
ok: true;
|
|
11
|
+
repoRoot: string;
|
|
12
|
+
tree: string;
|
|
13
|
+
partial?: string;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
reason: GitSnapshotFailure;
|
|
17
|
+
detail?: string;
|
|
18
|
+
};
|
|
19
|
+
export interface DiffOptions {
|
|
20
|
+
repoRoot: string;
|
|
21
|
+
objectDir: string;
|
|
22
|
+
before: string;
|
|
23
|
+
after: string;
|
|
24
|
+
maxFiles: number;
|
|
25
|
+
timeoutMs: number;
|
|
26
|
+
}
|
|
27
|
+
export interface TreeChange {
|
|
28
|
+
absPath: string;
|
|
29
|
+
prior: {
|
|
30
|
+
bytes: Buffer;
|
|
31
|
+
mode: number;
|
|
32
|
+
} | null;
|
|
33
|
+
}
|
|
34
|
+
export interface SkippedChange {
|
|
35
|
+
absPath: string;
|
|
36
|
+
reason: string;
|
|
37
|
+
}
|
|
38
|
+
export type DiffResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
changes: TreeChange[];
|
|
41
|
+
skipped: SkippedChange[];
|
|
42
|
+
truncated: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
ok: false;
|
|
45
|
+
reason: GitSnapshotFailure;
|
|
46
|
+
detail?: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function captureWorkspaceTree(options: CaptureOptions): Promise<CaptureResult>;
|
|
49
|
+
export declare function diffTrees(options: DiffOptions): Promise<DiffResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type GitCtx } from './git-snapshot.exec.js';
|
|
2
|
+
import type { DiffOptions, DiffResult } from './git-snapshot.js';
|
|
3
|
+
export interface RawEntry {
|
|
4
|
+
oldMode: string;
|
|
5
|
+
newMode: string;
|
|
6
|
+
oldSha: string;
|
|
7
|
+
status: string;
|
|
8
|
+
gitPath: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseRawDiff(buf: Buffer, onNonUtf8Path?: (rawPath: Buffer) => void): RawEntry[] | null;
|
|
11
|
+
export declare function toAbsPath(repoRoot: string, gitPath: string): string;
|
|
12
|
+
type Classified = {
|
|
13
|
+
kind: 'added';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'prior';
|
|
16
|
+
mode: number;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'skip';
|
|
19
|
+
reason: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function classifyEntry(e: RawEntry): Classified;
|
|
22
|
+
export declare function parseCatFileBatch(buf: Buffer, count: number): Buffer[] | null;
|
|
23
|
+
export declare const MAX_BLOB_BYTES: number;
|
|
24
|
+
export declare function _setMaxBlobBytesForTests(value: number | undefined): void;
|
|
25
|
+
export declare function parseBatchCheck(buf: Buffer, count: number): number[] | null;
|
|
26
|
+
export declare function diffWithCtx(options: DiffOptions, ctx: GitCtx): Promise<DiffResult>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GitSnapshotFailure } from './git-snapshot.js';
|
|
2
|
+
export type GitEnv = Record<string, string | undefined>;
|
|
3
|
+
export declare const GIT_SNAPSHOT_GLOBAL_ARGS: readonly string[];
|
|
4
|
+
export declare function snapshotArgs(hooksDir: string): string[];
|
|
5
|
+
export interface GitCtx {
|
|
6
|
+
args: readonly string[];
|
|
7
|
+
env: GitEnv;
|
|
8
|
+
deadline: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildSnapshotEnv(): GitEnv;
|
|
11
|
+
export interface GitRun {
|
|
12
|
+
code: number | null;
|
|
13
|
+
stdout: Buffer;
|
|
14
|
+
stderr: string;
|
|
15
|
+
timedOut: boolean;
|
|
16
|
+
spawnError?: NodeJS.ErrnoException;
|
|
17
|
+
}
|
|
18
|
+
export interface RunOptions {
|
|
19
|
+
cwd: string;
|
|
20
|
+
env: GitEnv;
|
|
21
|
+
deadline: number;
|
|
22
|
+
input?: Buffer | string;
|
|
23
|
+
}
|
|
24
|
+
export declare function runGit(args: readonly string[], opts: RunOptions): Promise<GitRun>;
|
|
25
|
+
export interface Failure {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: GitSnapshotFailure;
|
|
28
|
+
detail?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function classifyFailure(run: GitRun, what: string): Failure;
|
|
31
|
+
export declare function isOk(run: GitRun): boolean;
|
|
32
|
+
export declare function firstLine(s: string): string;
|
|
33
|
+
export declare function runIn(ctx: GitCtx, cwd: string, args: readonly string[], input?: string): Promise<GitRun>;
|
|
34
|
+
export declare function quoteAlternate(dir: string, sep?: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GitCtx } from './git-snapshot.exec.js';
|
|
2
|
+
export declare function withIndexLock<T>(indexFile: string, fn: () => Promise<T>): Promise<T>;
|
|
3
|
+
export declare function hasFlaggedEntries(lsFilesV: Buffer): boolean;
|
|
4
|
+
export declare function seedingSafe(ctx: GitCtx, repoRoot: string, infoAttributes: string): Promise<boolean>;
|
|
5
|
+
export declare function preparePrivateIndex(indexFile: string, repoRoot: string, seed: () => Promise<string | null>): Promise<void>;
|
|
6
|
+
export declare function discardPrivateIndex(indexFile: string): Promise<void>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export type PathHashes = Record<string, string | null>;
|
|
2
|
+
export type BashLogEntry = {
|
|
3
|
+
kind: 'bash';
|
|
4
|
+
turnId: string;
|
|
5
|
+
status: 'captured' | 'partial' | 'skipped';
|
|
6
|
+
reason?: string;
|
|
7
|
+
files?: number;
|
|
8
|
+
ts: number;
|
|
9
|
+
};
|
|
2
10
|
export type TurnLogEntry = {
|
|
3
11
|
kind: 'turn';
|
|
4
12
|
turnId: string;
|
|
@@ -12,7 +20,7 @@ export type TurnLogEntry = {
|
|
|
12
20
|
kind: 'restore';
|
|
13
21
|
paths: PathHashes;
|
|
14
22
|
ts: number;
|
|
15
|
-
};
|
|
23
|
+
} | BashLogEntry;
|
|
16
24
|
export declare function hashBytes(bytes: Buffer | null): string | null;
|
|
17
25
|
export declare function currentHash(absPath: string): string | null;
|
|
18
26
|
export declare function appendTurnLog(sessionId: string, entry: TurnLogEntry, stateDir?: string): boolean;
|
package/dist/agent/hooks.d.ts
CHANGED
package/dist/agent/provider.d.ts
CHANGED
|
@@ -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;
|
|
@@ -17,5 +17,15 @@ export interface SystemPromptWiringResult {
|
|
|
17
17
|
initialSystemPrompt: string;
|
|
18
18
|
rebuildAfterCwdChange: () => string;
|
|
19
19
|
systemPromptRebuildFactory: (base: string | undefined) => string;
|
|
20
|
+
stableFragments: {
|
|
21
|
+
toolBase: string;
|
|
22
|
+
userSystem: string | undefined;
|
|
23
|
+
memoryPrompt: string;
|
|
24
|
+
workspacePrompt: string;
|
|
25
|
+
hotMemory: string;
|
|
26
|
+
goalPrompt: string;
|
|
27
|
+
manifest: string;
|
|
28
|
+
agentTypeListing: string;
|
|
29
|
+
};
|
|
20
30
|
}
|
|
21
31
|
export declare function buildSystemPromptWiring(args: SystemPromptWiringArgs): SystemPromptWiringResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TraceSink } from '../../trace/writer.js';
|
|
2
|
+
export interface PromptFragments {
|
|
3
|
+
toolBase?: string;
|
|
4
|
+
userSystem?: string | null;
|
|
5
|
+
memoryPrompt?: string;
|
|
6
|
+
workspacePrompt?: string;
|
|
7
|
+
hotMemory?: string;
|
|
8
|
+
goalPrompt?: string;
|
|
9
|
+
environment?: string;
|
|
10
|
+
manifest?: string;
|
|
11
|
+
agentTypeListing?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function logFragmentTokens(traceWriter: TraceSink | undefined, fragments: PromptFragments): void;
|
|
14
|
+
export declare function logStablePartsTokens(traceWriter: TraceSink | undefined, parts: {
|
|
15
|
+
toolBase: string;
|
|
16
|
+
userSystem: string | null;
|
|
17
|
+
memoryPrompt: string;
|
|
18
|
+
workspacePrompt: string;
|
|
19
|
+
hotMemory: string;
|
|
20
|
+
goalPrompt?: string;
|
|
21
|
+
manifest: string;
|
|
22
|
+
agentTypeListing?: string;
|
|
23
|
+
}): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type RiskLevel = 'safe' | 'medium' | 'high';
|
|
2
|
-
export declare const RISK_CATEGORIES: readonly ["read-only", "bash-destructive", "bash-mutating", "bash-background", "workspace-write", "credential-path", "workspace-escape", "network-mutation", "schedule-mutation", "mcp-destructive", "mcp-unknown", "worktree-mutation", "browser-action", "remote-exec", "outbound-message", "unknown"];
|
|
2
|
+
export declare const RISK_CATEGORIES: readonly ["read-only", "bash-destructive", "bash-mutating", "bash-background", "workspace-write", "credential-path", "workspace-escape", "network-mutation", "schedule-mutation", "mcp-destructive", "mcp-unknown", "worktree-mutation", "browser-action", "remote-exec", "outbound-message", "release-boundary", "unknown"];
|
|
3
3
|
export type RiskCategory = (typeof RISK_CATEGORIES)[number];
|
|
4
4
|
export interface RiskVerdict {
|
|
5
5
|
level: RiskLevel;
|
|
@@ -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,14 @@
|
|
|
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
|
+
forkedFrom?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function writeSessionMeta(meta: SessionMeta): Promise<void>;
|
|
14
|
+
export declare function readSessionMeta(sessionId: string): SessionMeta | null;
|
|
@@ -135,6 +135,7 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
|
|
|
135
135
|
"browser-action": "browser-action";
|
|
136
136
|
"remote-exec": "remote-exec";
|
|
137
137
|
"outbound-message": "outbound-message";
|
|
138
|
+
"release-boundary": "release-boundary";
|
|
138
139
|
}>>;
|
|
139
140
|
}, z.core.$strip>;
|
|
140
141
|
export declare const HookSummaryPayloadSchema: z.ZodObject<{
|
|
@@ -412,6 +413,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
412
413
|
"browser-action": "browser-action";
|
|
413
414
|
"remote-exec": "remote-exec";
|
|
414
415
|
"outbound-message": "outbound-message";
|
|
416
|
+
"release-boundary": "release-boundary";
|
|
415
417
|
}>>;
|
|
416
418
|
}, z.core.$strip>;
|
|
417
419
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -758,6 +760,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
758
760
|
subagent_model_fallback: "subagent_model_fallback";
|
|
759
761
|
round_cap_notice_dropped: "round_cap_notice_dropped";
|
|
760
762
|
continuation_settle_degraded: "continuation_settle_degraded";
|
|
763
|
+
prompt_fragment_sizes: "prompt_fragment_sizes";
|
|
761
764
|
}>;
|
|
762
765
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
763
766
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -869,6 +872,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
869
872
|
"browser-action": "browser-action";
|
|
870
873
|
"remote-exec": "remote-exec";
|
|
871
874
|
"outbound-message": "outbound-message";
|
|
875
|
+
"release-boundary": "release-boundary";
|
|
872
876
|
}>>;
|
|
873
877
|
}, z.core.$strip>;
|
|
874
878
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1243,6 +1247,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1243
1247
|
subagent_model_fallback: "subagent_model_fallback";
|
|
1244
1248
|
round_cap_notice_dropped: "round_cap_notice_dropped";
|
|
1245
1249
|
continuation_settle_degraded: "continuation_settle_degraded";
|
|
1250
|
+
prompt_fragment_sizes: "prompt_fragment_sizes";
|
|
1246
1251
|
}>;
|
|
1247
1252
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1248
1253
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -54,6 +54,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
54
54
|
subagent_model_fallback: "subagent_model_fallback";
|
|
55
55
|
round_cap_notice_dropped: "round_cap_notice_dropped";
|
|
56
56
|
continuation_settle_degraded: "continuation_settle_degraded";
|
|
57
|
+
prompt_fragment_sizes: "prompt_fragment_sizes";
|
|
57
58
|
}>;
|
|
58
59
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
59
60
|
phase: z.ZodEnum<{
|
|
@@ -111,6 +112,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
111
112
|
subagent_model_fallback: "subagent_model_fallback";
|
|
112
113
|
round_cap_notice_dropped: "round_cap_notice_dropped";
|
|
113
114
|
continuation_settle_degraded: "continuation_settle_degraded";
|
|
115
|
+
prompt_fragment_sizes: "prompt_fragment_sizes";
|
|
114
116
|
}>;
|
|
115
117
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
116
118
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -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' | 'prompt_fragment_sizes';
|
|
2
2
|
export interface SessionPhasePayload {
|
|
3
3
|
phase: SessionPhaseName;
|
|
4
4
|
durationMs?: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChromeRows } from './terminal-compositor.frame.layout.js';
|
|
2
2
|
export declare function buildFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, dropdownRows: string[], hintRow: string | null, inputLine: string, margin?: string): string[];
|
|
3
|
-
export declare function buildPickerFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, pickerRows: string[], margin?: string): string[];
|
|
3
|
+
export declare function buildPickerFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, pickerRows: string[], margin?: string, bandWidth?: number): string[];
|