agent-afk 5.240.2 → 5.241.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.
@@ -1,4 +1,4 @@
1
- export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutcomeSchema, SubagentPersistenceSchema, SubagentInvocationSchema, WorldChangesSchema, TokenBreakdownSchema, ParallelDispatchStatsSchema, type SessionFacet, type StoredSessionInput, type ToolEventInput, type FacetOutcome, type SubagentInvocation, type WorldChanges, type TokenBreakdown, type ParallelDispatchStats, } from './schema.js';
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';
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';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const FACET_VERSION = 4;
2
+ export declare const FACET_VERSION = 5;
3
3
  export declare const ToolEventInputSchema: z.ZodObject<{
4
4
  toolName: z.ZodString;
5
5
  toolUseId: z.ZodOptional<z.ZodString>;
@@ -27,6 +27,7 @@ export declare const StoredSessionInputSchema: z.ZodObject<{
27
27
  source: z.ZodOptional<z.ZodEnum<{
28
28
  cli: "cli";
29
29
  telegram: "telegram";
30
+ daemon: "daemon";
30
31
  web: "web";
31
32
  }>>;
32
33
  telegramChatId: z.ZodOptional<z.ZodNumber>;
@@ -94,12 +95,19 @@ export declare const ParallelDispatchStatsSchema: z.ZodObject<{
94
95
  ratio: z.ZodNullable<z.ZodNumber>;
95
96
  }, z.core.$strip>;
96
97
  export type ParallelDispatchStats = z.infer<typeof ParallelDispatchStatsSchema>;
98
+ export declare const YieldTrackingSchema: z.ZodObject<{
99
+ is_scheduled_session: z.ZodBoolean;
100
+ produced_pr: z.ZodNullable<z.ZodBoolean>;
101
+ pr_merged: z.ZodNullable<z.ZodBoolean>;
102
+ }, z.core.$strip>;
103
+ export type YieldTracking = z.infer<typeof YieldTrackingSchema>;
97
104
  export declare const SessionFacetSchema: z.ZodObject<{
98
105
  facet_version: z.ZodNumber;
99
106
  session_id: z.ZodString;
100
107
  source: z.ZodEnum<{
101
108
  cli: "cli";
102
109
  telegram: "telegram";
110
+ daemon: "daemon";
103
111
  web: "web";
104
112
  unknown: "unknown";
105
113
  }>;
@@ -163,6 +171,11 @@ export declare const SessionFacetSchema: z.ZodObject<{
163
171
  tool_turns: z.ZodNumber;
164
172
  ratio: z.ZodNullable<z.ZodNumber>;
165
173
  }, z.core.$strip>;
174
+ yield_tracking: z.ZodObject<{
175
+ is_scheduled_session: z.ZodBoolean;
176
+ produced_pr: z.ZodNullable<z.ZodBoolean>;
177
+ pr_merged: z.ZodNullable<z.ZodBoolean>;
178
+ }, z.core.$strip>;
166
179
  decisions: z.ZodArray<z.ZodString>;
167
180
  evidence_pointers: z.ZodArray<z.ZodString>;
168
181
  }, z.core.$loose>;
@@ -0,0 +1,11 @@
1
+ export type ExecFnYield = (file: string, args: string[], opts?: {
2
+ cwd?: string;
3
+ timeout?: number;
4
+ }) => Promise<{
5
+ stdout: string;
6
+ stderr: string;
7
+ }>;
8
+ export declare function getCurrentBranch(execFn: ExecFnYield, cwd?: string): Promise<string | null>;
9
+ export declare function queryPrState(execFn: ExecFnYield, branch: string, cwd?: string): Promise<'merged' | 'open' | 'closed' | 'none' | 'error'>;
10
+ export declare function patchYieldFields(sessionId: string, produced_pr: boolean, pr_merged: boolean | null, cacheDir?: string): void;
11
+ export declare function writeFacetYield(sessionId: string, execFn: ExecFnYield, cwd?: string): Promise<void>;
@@ -20,6 +20,7 @@ export interface SessionEndContext {
20
20
  reason?: string;
21
21
  parentSessionId?: string;
22
22
  tracePath?: string;
23
+ cwd?: string;
23
24
  }
24
25
  export interface SubagentStartContext {
25
26
  event: 'SubagentStart';
@@ -0,0 +1,6 @@
1
+ import type { AgentInfo, McpServerStatus, ModelInfo, SDKControlGetContextUsageResponse } from '../types.js';
2
+ import type { ProviderAgentInfo, ProviderContextUsage, ProviderModelInfo, ProviderMcpServerStatus } from '../provider.js';
3
+ export declare function toModelInfo(p: ProviderModelInfo): ModelInfo;
4
+ export declare function toAgentInfo(p: ProviderAgentInfo): AgentInfo;
5
+ export declare function toContextUsageResponse(p: ProviderContextUsage): SDKControlGetContextUsageResponse;
6
+ export declare function toMcpServerStatus(p: ProviderMcpServerStatus): McpServerStatus;