agent-afk 5.318.8 → 5.318.10
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/journal/index.d.ts +1 -1
- package/dist/agent/journal/journal-file.d.ts +7 -5
- package/dist/agent/journal/types.d.ts +5 -1
- package/dist/agent/journal/writer.d.ts +3 -5
- package/dist/agent/providers/openai-compatible/query/dispatch-append.emit.d.ts +1 -2
- package/dist/agent/providers/openai-compatible/query/dispatch-append.parse-errors.d.ts +5 -0
- package/dist/agent/providers/openai-compatible/responses-translate.d.ts +8 -0
- package/dist/agent/tools/git-read.policy.d.ts +19 -0
- package/dist/agent/tools/handlers/git-read.d.ts +8 -0
- package/dist/agent/tools/readonly-git-surface.d.ts +8 -0
- package/dist/agent/tools/schemas.git-read.d.ts +2 -0
- package/dist/agent/trace/events.d.ts +2 -0
- package/dist/agent/trace/events.session-phase.d.ts +1 -0
- package/dist/agent/trace/pending-writes.d.ts +2 -0
- package/dist/agent/trace/types.session-phase.d.ts +1 -0
- package/dist/agent/trace/writer.d.ts +2 -0
- package/dist/cli.mjs +458 -454
- package/dist/config/env.d.ts +8 -0
- package/dist/config/env.misc.d.ts +8 -0
- package/dist/index.mjs +213 -212
- package/dist/telegram.mjs +238 -237
- package/dist/whatif/args.conflicts.d.ts +8 -0
- package/dist/whatif/args.usage.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export { JournalSync, type SyncOptions } from './sync.js';
|
|
3
3
|
export { JournalProvenance } from './provenance.js';
|
|
4
|
-
export { createMessageJournal, isMessageJournalDisabled, type CreateMessageJournalOptions } from './writer.js';
|
|
4
|
+
export { createMessageJournal, isMessageJournalDisabled, type CreateMessageJournalOptions, type JournalMeta } from './writer.js';
|
|
5
5
|
export { findToolResult, foldJournal, hydrateMessages, journalExists, listSubagentJournals, loadJournalFold, loadJournalMessages, readJournalRecords, type FoldResult, type JournalLocator, } from './reader.js';
|
|
6
6
|
export { findToolResultAsync, journalExistsAsync } from './reader.async.js';
|
|
7
7
|
export { forkJournal } from './fork.js';
|
|
@@ -2,13 +2,15 @@ import { type OnceReporter } from './append-queue.js';
|
|
|
2
2
|
import type { BlobStore } from './blobs.js';
|
|
3
3
|
import { type JournalRecordInput } from './types.js';
|
|
4
4
|
export declare const MAX_BUFFERED_RECORDS = 10000;
|
|
5
|
+
export interface JournalMeta {
|
|
6
|
+
provider?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
afkVersion?: string;
|
|
10
|
+
}
|
|
5
11
|
export interface JournalSessionShared {
|
|
6
12
|
getSessionId: () => string | undefined;
|
|
7
|
-
meta:
|
|
8
|
-
provider?: string;
|
|
9
|
-
model?: string;
|
|
10
|
-
cwd?: string;
|
|
11
|
-
};
|
|
13
|
+
meta: JournalMeta;
|
|
12
14
|
blobs: BlobStore;
|
|
13
15
|
report: OnceReporter;
|
|
14
16
|
}
|
|
@@ -96,6 +96,7 @@ export type JournalRecord = (RecordBase & {
|
|
|
96
96
|
provider?: string;
|
|
97
97
|
model?: string;
|
|
98
98
|
cwd?: string;
|
|
99
|
+
afkVersion?: string;
|
|
99
100
|
forkedFrom?: {
|
|
100
101
|
sessionId: string;
|
|
101
102
|
length: number;
|
|
@@ -126,7 +127,10 @@ export interface MessageJournal {
|
|
|
126
127
|
append(index: number, message: JournalMessage): void;
|
|
127
128
|
truncate(length: number, reason?: JournalTruncateReason): void;
|
|
128
129
|
mark(label: JournalMarkLabel, detail?: Record<string, unknown>): void;
|
|
129
|
-
forSubagent(subagentId: string
|
|
130
|
+
forSubagent(subagentId: string, childMeta?: {
|
|
131
|
+
model?: string;
|
|
132
|
+
provider?: string;
|
|
133
|
+
}): MessageJournal;
|
|
130
134
|
flush(): Promise<void>;
|
|
131
135
|
close(): Promise<void>;
|
|
132
136
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { type JournalMeta } from './journal-file.js';
|
|
1
2
|
import type { MessageJournal } from './types.js';
|
|
2
3
|
export { isMessageJournalDisabled } from './noop.js';
|
|
4
|
+
export type { JournalMeta } from './journal-file.js';
|
|
3
5
|
export interface CreateMessageJournalOptions {
|
|
4
6
|
getSessionId: () => string | undefined;
|
|
5
|
-
meta?:
|
|
6
|
-
provider?: string;
|
|
7
|
-
model?: string;
|
|
8
|
-
cwd?: string;
|
|
9
|
-
};
|
|
7
|
+
meta?: JournalMeta;
|
|
10
8
|
}
|
|
11
9
|
export declare function createMessageJournal(opts: CreateMessageJournalOptions): MessageJournal;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { TraceSink } from '../../../trace/index.js';
|
|
2
2
|
import type { ProviderEvent } from '../../../provider.js';
|
|
3
3
|
import type { ToolCall, ToolResult } from '../../anthropic-direct/types.js';
|
|
4
|
-
export declare function emitDispatchedToolOutputs({ calls, dispatcherResults,
|
|
4
|
+
export declare function emitDispatchedToolOutputs({ calls, dispatcherResults, startTimes, traceWriter, subagentId, sessionId, results, }: {
|
|
5
5
|
calls: readonly ToolCall[];
|
|
6
6
|
dispatcherResults: ToolResult[];
|
|
7
|
-
parseErrors: Map<string, string>;
|
|
8
7
|
startTimes: Map<string, number>;
|
|
9
8
|
traceWriter: TraceSink | undefined;
|
|
10
9
|
subagentId: string | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ToolCall, ToolResult } from '../../anthropic-direct/types.js';
|
|
2
|
+
import type { AccumulatedToolCall } from '../translate.js';
|
|
3
|
+
export declare function parseErrorResult(name: string, diagnostic: string, argumentsLost: boolean): ToolResult;
|
|
4
|
+
export declare function dispatchableCalls(calls: readonly ToolCall[], parseErrors: ReadonlyMap<string, string>): ToolCall[];
|
|
5
|
+
export declare function mergeUndispatchedResults(calls: readonly ToolCall[], accumulated: readonly AccumulatedToolCall[], parseErrors: ReadonlyMap<string, string>, dispatchedResults: readonly ToolResult[]): ToolResult[];
|
|
@@ -31,8 +31,16 @@ export interface ResponsesStreamEvent {
|
|
|
31
31
|
code?: string;
|
|
32
32
|
message?: string;
|
|
33
33
|
} | null;
|
|
34
|
+
output?: ResponsesOutputItem[];
|
|
34
35
|
};
|
|
35
36
|
code?: string | null;
|
|
36
37
|
message?: string;
|
|
37
38
|
}
|
|
39
|
+
export interface ResponsesOutputItem {
|
|
40
|
+
type?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
call_id?: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
arguments?: string;
|
|
45
|
+
}
|
|
38
46
|
export declare function translateResponsesEvent(event: ResponsesStreamEvent, state: StreamState, sessionId: string): Generator<ProviderEvent>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const GIT_READ_SUBCOMMANDS: readonly ["status", "log", "diff", "show", "grep", "tag", "branch", "blame", "ls-files", "rev-parse"];
|
|
2
|
+
export type GitReadSubcommand = (typeof GIT_READ_SUBCOMMANDS)[number];
|
|
3
|
+
export interface GitReadRequest {
|
|
4
|
+
subcommand: unknown;
|
|
5
|
+
args?: unknown;
|
|
6
|
+
paths?: unknown;
|
|
7
|
+
pattern?: unknown;
|
|
8
|
+
}
|
|
9
|
+
export type GitReadPlan = {
|
|
10
|
+
ok: true;
|
|
11
|
+
argv: string[];
|
|
12
|
+
} | {
|
|
13
|
+
ok: false;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function confinePathspec(cwd: string, p: string): string | {
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function planGitRead(req: GitReadRequest, cwd: string): GitReadPlan;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolHandler } from '../types.js';
|
|
2
|
+
export declare const GIT_READ_DEFAULT_MAX_BYTES: number;
|
|
3
|
+
export declare const GIT_READ_MAX_BYTES_CEILING: number;
|
|
4
|
+
export declare const GIT_READ_GLOBAL_ARGS: readonly string[];
|
|
5
|
+
export declare function buildGitReadEnv(contextEnv: Record<string, string> | undefined): Record<string, string | undefined>;
|
|
6
|
+
export declare function boundOutput(text: string, maxBytes: number): string;
|
|
7
|
+
export declare function createGitReadHandler(cwd?: string): ToolHandler;
|
|
8
|
+
export declare const gitReadHandler: ToolHandler;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolPermissionConfig } from './permissions.js';
|
|
2
|
+
import type { AnthropicToolDef } from './types.js';
|
|
3
|
+
export declare const GIT_READ_TOOL_NAME = "git_read";
|
|
4
|
+
export declare function isReadOnlyGitToolEnabled(): boolean;
|
|
5
|
+
export declare function swapBashForGitRead(tools: readonly string[]): string[];
|
|
6
|
+
export declare function applyReadOnlyGitPermissions(permissions: ToolPermissionConfig | undefined, readOnlyBash: boolean | undefined): ToolPermissionConfig | undefined;
|
|
7
|
+
export declare const READONLY_BASH_DISABLED_REASON: string;
|
|
8
|
+
export declare function readOnlyGitSchemas(): AnthropicToolDef[];
|
|
@@ -675,6 +675,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
675
675
|
}>>;
|
|
676
676
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
677
677
|
priorSessionId: z.ZodOptional<z.ZodString>;
|
|
678
|
+
afkVersion: z.ZodOptional<z.ZodString>;
|
|
678
679
|
}, z.core.$strip>;
|
|
679
680
|
}, z.core.$strip>], "kind">;
|
|
680
681
|
export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1109,6 +1110,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1109
1110
|
}>>;
|
|
1110
1111
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
1111
1112
|
priorSessionId: z.ZodOptional<z.ZodString>;
|
|
1113
|
+
afkVersion: z.ZodOptional<z.ZodString>;
|
|
1112
1114
|
}, z.core.$strip>;
|
|
1113
1115
|
}, z.core.$strip>, z.ZodObject<{
|
|
1114
1116
|
ts: z.ZodString;
|
|
@@ -16,6 +16,7 @@ export declare class NdjsonTraceWriter implements TraceWriter {
|
|
|
16
16
|
private readonly tracePath;
|
|
17
17
|
private seq;
|
|
18
18
|
private sealed;
|
|
19
|
+
private sealing;
|
|
19
20
|
private sealRecordPersisted;
|
|
20
21
|
private fh;
|
|
21
22
|
private writeQueue;
|
|
@@ -35,6 +36,7 @@ export declare class NdjsonTraceWriter implements TraceWriter {
|
|
|
35
36
|
export declare class InMemoryTraceWriter implements TraceWriter {
|
|
36
37
|
private seq;
|
|
37
38
|
private sealed;
|
|
39
|
+
private sealing;
|
|
38
40
|
private readonly _events;
|
|
39
41
|
get events(): readonly TraceEvent[];
|
|
40
42
|
write(event: TraceEventInput): Promise<void>;
|