agent-afk 5.270.1 → 5.270.2
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/README.md +1 -1
- package/dist/agent/facets/derive.d.ts +4 -1
- package/dist/agent/facets/index.d.ts +1 -1
- package/dist/agent/facets/journal-adapter.d.ts +7 -0
- package/dist/agent/facets/parallel-dispatch.d.ts +4 -0
- package/dist/agent/facets/schema.d.ts +14 -1
- package/dist/agent/providers/openai-compatible/messages.d.ts +9 -0
- package/dist/agent/providers/openai-compatible/query/repair-orphan-tool-calls.d.ts +2 -0
- package/dist/cli.mjs +356 -340
- package/dist/index.mjs +144 -144
- package/dist/telegram.mjs +169 -169
- package/dist/whatif/mde.d.ts +7 -0
- package/dist/whatif/run.d.ts +6 -1
- package/dist/whatif/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ afk chat "hello" # first real conversation
|
|
|
30
30
|
|
|
31
31
|
That's it. You're in.
|
|
32
32
|
|
|
33
|
-
**Using pnpm?** `pnpm add -g agent-afk` works, but pnpm 10 blocks build scripts by default and
|
|
33
|
+
**Using pnpm?** `pnpm add -g agent-afk` works, but pnpm 10 blocks build scripts by default and skips `postinstall` (with an easy-to-miss warning — see [#2199](https://github.com/griffinwork40/agent-afk/issues/2199)). Run `pnpm approve-builds -g` after install to approve the hook, or use `npm install -g agent-afk` instead. If an `afk daemon` is already running and pnpm skipped the hook, restart it manually with `afk service restart daemon` — on macOS the hook restarts the daemon automatically when it runs, but on Linux you must always run this command after an upgrade even when the hook ran.
|
|
34
34
|
|
|
35
35
|
**Try without installing:** `npx agent-afk chat "hello"` runs a one-shot turn with zero global install.
|
|
36
36
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { type SessionFacet, type StoredSessionInput } from './schema.js';
|
|
1
|
+
import { type SessionFacet, type StoredSessionInput, type SubagentToolSummary, type ToolEventInput } from './schema.js';
|
|
2
2
|
export interface DeriveOptions {
|
|
3
3
|
sourceSessionPath?: string;
|
|
4
4
|
sourceSessionMtimeMs?: number;
|
|
5
5
|
derivedAt?: Date;
|
|
6
|
+
journalEvents?: ToolEventInput[];
|
|
7
|
+
subagentBreakdown?: SubagentToolSummary[];
|
|
6
8
|
}
|
|
9
|
+
export declare function dedupeToolEvents(events: ToolEventInput[]): ToolEventInput[];
|
|
7
10
|
export declare function deriveSessionFacet(session: StoredSessionInput, options?: DeriveOptions): SessionFacet;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutcomeSchema, SubagentPersistenceSchema, SubagentInvocationSchema, WorldChangesSchema, TokenBreakdownSchema, ParallelDispatchStatsSchema, YieldTrackingSchema, type SessionFacet, type StoredSessionInput, type ToolEventInput, type FacetOutcome, type SubagentInvocation, type WorldChanges, type TokenBreakdown, type ParallelDispatchStats, type YieldTracking, } from './schema.js';
|
|
1
|
+
export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutcomeSchema, SubagentPersistenceSchema, SubagentInvocationSchema, SubagentToolSummarySchema, WorldChangesSchema, TokenBreakdownSchema, ParallelDispatchStatsSchema, YieldTrackingSchema, type SessionFacet, type StoredSessionInput, type ToolEventInput, type FacetOutcome, type SubagentInvocation, type SubagentToolSummary, type WorldChanges, type TokenBreakdown, type ParallelDispatchStats, type YieldTracking, } from './schema.js';
|
|
2
2
|
export { deriveSessionFacet, type DeriveOptions } from './derive.js';
|
|
3
3
|
export { getOrDeriveFacet, loadStoredSession, listSessionIds, type FacetStoreOptions, } from './store.js';
|
|
4
4
|
export { createFacetSessionEndHook } from './session-end-hook.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SubagentToolSummary, ToolEventInput } from './schema.js';
|
|
2
|
+
import type { JournalRecord } from '../journal/types.js';
|
|
3
|
+
export interface JournalAdapterOptions {
|
|
4
|
+
resultTextCap?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function journalRecordsToToolEvents(records: readonly JournalRecord[], options?: JournalAdapterOptions): ToolEventInput[];
|
|
7
|
+
export declare function summarizeSubagentJournal(subagentId: string, records: readonly JournalRecord[]): SubagentToolSummary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const FACET_VERSION =
|
|
2
|
+
export declare const FACET_VERSION = 6;
|
|
3
3
|
export declare const ToolEventInputSchema: z.ZodObject<{
|
|
4
4
|
toolName: z.ZodString;
|
|
5
5
|
toolUseId: z.ZodOptional<z.ZodString>;
|
|
@@ -101,6 +101,13 @@ export declare const YieldTrackingSchema: z.ZodObject<{
|
|
|
101
101
|
pr_merged: z.ZodNullable<z.ZodBoolean>;
|
|
102
102
|
}, z.core.$strip>;
|
|
103
103
|
export type YieldTracking = z.infer<typeof YieldTrackingSchema>;
|
|
104
|
+
export declare const SubagentToolSummarySchema: z.ZodObject<{
|
|
105
|
+
subagent_id: z.ZodString;
|
|
106
|
+
tool_calls: z.ZodNumber;
|
|
107
|
+
tool_errors: z.ZodNumber;
|
|
108
|
+
tool_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type SubagentToolSummary = z.infer<typeof SubagentToolSummarySchema>;
|
|
104
111
|
export declare const SessionFacetSchema: z.ZodObject<{
|
|
105
112
|
facet_version: z.ZodNumber;
|
|
106
113
|
session_id: z.ZodString;
|
|
@@ -178,6 +185,12 @@ export declare const SessionFacetSchema: z.ZodObject<{
|
|
|
178
185
|
}, z.core.$strip>;
|
|
179
186
|
decisions: z.ZodArray<z.ZodString>;
|
|
180
187
|
evidence_pointers: z.ZodArray<z.ZodString>;
|
|
188
|
+
subagent_breakdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
189
|
+
subagent_id: z.ZodString;
|
|
190
|
+
tool_calls: z.ZodNumber;
|
|
191
|
+
tool_errors: z.ZodNumber;
|
|
192
|
+
tool_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>>>;
|
|
181
194
|
}, z.core.$loose>;
|
|
182
195
|
export type SessionFacet = z.infer<typeof SessionFacetSchema>;
|
|
183
196
|
export type SubagentInvocation = z.infer<typeof SubagentInvocationSchema>;
|
|
@@ -16,6 +16,15 @@ export interface OpenAIMessage {
|
|
|
16
16
|
content: string | OpenAIContentPart[];
|
|
17
17
|
tool_call_id?: string;
|
|
18
18
|
reasoning_content?: string;
|
|
19
|
+
tool_calls?: OpenAIToolCall[];
|
|
20
|
+
}
|
|
21
|
+
export interface OpenAIToolCall {
|
|
22
|
+
id: string;
|
|
23
|
+
type: 'function' | string;
|
|
24
|
+
function: {
|
|
25
|
+
name: string;
|
|
26
|
+
arguments: string;
|
|
27
|
+
};
|
|
19
28
|
}
|
|
20
29
|
export declare function imageOmittedNotice(model: string | undefined, count: number): string;
|
|
21
30
|
export declare function flattenUserContent(content: ProviderUserTurn['content'], model?: string): string;
|