pi-harness-runtime 1.1.430 → 1.1.431
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/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/packages/notification/adapters/email-adapter.ts +0 -126
- package/packages/notification/adapters/ntfy-adapter.ts +0 -100
- package/packages/notification/adapters/telegram-adapter.ts +0 -107
- package/packages/notification/adapters/webhook-adapter.ts +0 -75
- package/packages/notification/base-adapter.ts +0 -75
- package/packages/notification/index.ts +0 -51
- package/packages/notification/notification-center.ts +0 -286
- package/packages/notification/types.ts +0 -89
- package/packages/quota-manager/index.ts +0 -28
- package/packages/quota-manager/quota-manager.ts +0 -339
- package/packages/quota-manager/tui-usage-monitor.ts +0 -355
- package/packages/types/src/ai-providers.d.ts +0 -36
- package/packages/types/src/runtime-types.d.ts +0 -418
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Provider Registry
|
|
3
|
-
*
|
|
4
|
-
* Centralized, canonical list of known AI/LLM providers used as keys across
|
|
5
|
-
* mirror.json, quota tracking, TUI signal parsing, and footer display.
|
|
6
|
-
*
|
|
7
|
-
* Adding a new provider = add ONE entry here + update the places that
|
|
8
|
-
* need per-provider behaviour (scraper, TUI parser, footer, etc.).
|
|
9
|
-
*
|
|
10
|
-
* Provider ids are lowercase internal keys.
|
|
11
|
-
* Labels are human-readable display strings.
|
|
12
|
-
*/
|
|
13
|
-
export declare const KNOWN_AI_PROVIDERS: readonly ["minimax", "openai", "anthropic", "glm", "openrouter", "openai-codex", "deepseek", "gemini", "kimi"];
|
|
14
|
-
export type KnownAiProvider = (typeof KNOWN_AI_PROVIDERS)[number];
|
|
15
|
-
/** Human-readable display labels (used in footer, notifications). */
|
|
16
|
-
export declare const PROVIDER_LABELS: Record<string, string>;
|
|
17
|
-
/**
|
|
18
|
-
* Providers that support continuous quota scraping via cookie/browser automation.
|
|
19
|
-
* Only MiniMax is currently supported here.
|
|
20
|
-
*/
|
|
21
|
-
export declare const SCRAPEABLE_PROVIDERS: KnownAiProvider[];
|
|
22
|
-
/**
|
|
23
|
-
* Providers that report quota via TUI signal capture (one-shot on limit hit).
|
|
24
|
-
* These do NOT have a continuous scraping path.
|
|
25
|
-
*/
|
|
26
|
-
export declare const TUI_SIGNAL_PROVIDERS: KnownAiProvider[];
|
|
27
|
-
/**
|
|
28
|
-
* Check if a provider id is a known AI provider.
|
|
29
|
-
*/
|
|
30
|
-
export declare function isKnownAiProvider(id: string): id is KnownAiProvider;
|
|
31
|
-
/**
|
|
32
|
-
* Get the display label for a provider id.
|
|
33
|
-
* Falls back to the id itself if unknown.
|
|
34
|
-
*/
|
|
35
|
-
export declare function getProviderLabel(id: string): string;
|
|
36
|
-
//# sourceMappingURL=ai-providers.d.ts.map
|
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
export type JobStatus = "created" | "planning" | "queued" | "running" | "testing" | "e2e_testing" | "reviewing" | "repairing" | "paused_quota" | "waiting_human" | "blocked" | "ready_for_client" | "archived" | "cancelled";
|
|
2
|
-
export type TaskStatus = "pending" | "ready" | "running" | "testing" | "reviewing" | "done" | "failed" | "blocked";
|
|
3
|
-
export type ProviderState = "available" | "limited" | "exhausted" | "disabled" | "unknown";
|
|
4
|
-
export interface RuntimeTask {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
description: string;
|
|
8
|
-
status: TaskStatus;
|
|
9
|
-
assignedProvider?: string;
|
|
10
|
-
worktreePath?: string;
|
|
11
|
-
acceptanceCriteria?: string[];
|
|
12
|
-
/** Task instructions (used by LoopRuntime for compactable message content) */
|
|
13
|
-
instructions?: string;
|
|
14
|
-
/** Tools available for this task */
|
|
15
|
-
tools?: Array<{
|
|
16
|
-
name: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
input_schema?: Record<string, unknown>;
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
21
|
-
export interface RuntimeCheckpoint {
|
|
22
|
-
version: number;
|
|
23
|
-
jobId: string;
|
|
24
|
-
status: JobStatus;
|
|
25
|
-
requirement: string;
|
|
26
|
-
currentTaskId?: string;
|
|
27
|
-
provider?: string;
|
|
28
|
-
resumeAt?: string;
|
|
29
|
-
lastError?: string;
|
|
30
|
-
/** Provider that caused a quota pause (e.g. "minimax"). */
|
|
31
|
-
quotaProvider?: string;
|
|
32
|
-
/** Limit type that triggered the pause ("tokens" | "context_window" | etc.). */
|
|
33
|
-
quotaLimitType?: string;
|
|
34
|
-
createdAt: string;
|
|
35
|
-
updatedAt: string;
|
|
36
|
-
/** Loop iteration at checkpoint (used by LoopRuntime for resume) */
|
|
37
|
-
iteration?: number;
|
|
38
|
-
/** Task ID being executed at checkpoint */
|
|
39
|
-
taskId?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface RuntimeEvent {
|
|
42
|
-
ts: string;
|
|
43
|
-
jobId: string;
|
|
44
|
-
type: string;
|
|
45
|
-
message: string;
|
|
46
|
-
data?: Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
export interface RuntimeContext {
|
|
49
|
-
jobId: string;
|
|
50
|
-
requirement: string;
|
|
51
|
-
tasks: RuntimeTask[];
|
|
52
|
-
providerStates: Record<string, ProviderState>;
|
|
53
|
-
}
|
|
54
|
-
export interface ProviderSelection {
|
|
55
|
-
providerId: string;
|
|
56
|
-
reason: string;
|
|
57
|
-
}
|
|
58
|
-
export interface TaskNode {
|
|
59
|
-
id: string;
|
|
60
|
-
title: string;
|
|
61
|
-
description: string;
|
|
62
|
-
status: TaskStatus;
|
|
63
|
-
dependencies: string[];
|
|
64
|
-
dependents: string[];
|
|
65
|
-
assignedAgent?: string;
|
|
66
|
-
worktreePath?: string;
|
|
67
|
-
acceptanceCriteria?: string[];
|
|
68
|
-
retryCount?: number;
|
|
69
|
-
maxRetries?: number;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
updatedAt: string;
|
|
72
|
-
}
|
|
73
|
-
export interface TaskGraph {
|
|
74
|
-
jobId: string;
|
|
75
|
-
nodes: Record<string, TaskNode>;
|
|
76
|
-
topologicalOrder: string[];
|
|
77
|
-
}
|
|
78
|
-
export interface BlackboardRecord {
|
|
79
|
-
jobId: string;
|
|
80
|
-
status: JobStatus;
|
|
81
|
-
nextAction?: NextAction;
|
|
82
|
-
tasks: TaskGraph;
|
|
83
|
-
agentRegistry: AgentRegistry;
|
|
84
|
-
reports: Record<string, AgentReport>;
|
|
85
|
-
locks: Record<string, LockInfo>;
|
|
86
|
-
updatedAt: string;
|
|
87
|
-
}
|
|
88
|
-
export interface NextAction {
|
|
89
|
-
taskId?: string;
|
|
90
|
-
agentId?: string;
|
|
91
|
-
instruction: string;
|
|
92
|
-
priority: "high" | "normal" | "low";
|
|
93
|
-
createdAt: string;
|
|
94
|
-
expiresAt?: string;
|
|
95
|
-
}
|
|
96
|
-
export interface AgentRegistry {
|
|
97
|
-
agents: Record<string, AgentInfo>;
|
|
98
|
-
}
|
|
99
|
-
export interface AgentInfo {
|
|
100
|
-
id: string;
|
|
101
|
-
name: string;
|
|
102
|
-
provider: string;
|
|
103
|
-
model?: string;
|
|
104
|
-
status: "idle" | "working" | "waiting" | "failed";
|
|
105
|
-
currentTaskId?: string;
|
|
106
|
-
startedAt?: string;
|
|
107
|
-
lastHeartbeat?: string;
|
|
108
|
-
}
|
|
109
|
-
export interface AgentReport {
|
|
110
|
-
agentId: string;
|
|
111
|
-
taskId: string;
|
|
112
|
-
status: "success" | "failure" | "partial";
|
|
113
|
-
summary: string;
|
|
114
|
-
filesChanged?: string[];
|
|
115
|
-
testsRun?: number;
|
|
116
|
-
testsPassed?: number;
|
|
117
|
-
testsFailed?: number;
|
|
118
|
-
createdAt: string;
|
|
119
|
-
}
|
|
120
|
-
export interface LockInfo {
|
|
121
|
-
taskId: string;
|
|
122
|
-
agentId: string;
|
|
123
|
-
acquiredAt: string;
|
|
124
|
-
expiresAt?: string;
|
|
125
|
-
}
|
|
126
|
-
export interface ContextWindowUpdate {
|
|
127
|
-
provider: string;
|
|
128
|
-
model: string;
|
|
129
|
-
maxTokens: number;
|
|
130
|
-
usedTokens: number;
|
|
131
|
-
}
|
|
132
|
-
export interface ContextWindowStats {
|
|
133
|
-
provider: string;
|
|
134
|
-
model: string;
|
|
135
|
-
maxTokens: number;
|
|
136
|
-
usedTokens: number;
|
|
137
|
-
availableTokens: number;
|
|
138
|
-
utilizationPct: number;
|
|
139
|
-
}
|
|
140
|
-
export interface ContextWindowConfig {
|
|
141
|
-
warningThreshold: number;
|
|
142
|
-
criticalThreshold: number;
|
|
143
|
-
strategy: "truncate" | "summarize" | "split";
|
|
144
|
-
}
|
|
145
|
-
export interface QuotaSignal {
|
|
146
|
-
provider: string;
|
|
147
|
-
windowType: "5h" | "daily" | "weekly" | "monthly";
|
|
148
|
-
usedPct: number;
|
|
149
|
-
remainingPct: number;
|
|
150
|
-
resetsAt?: string;
|
|
151
|
-
exhausted: boolean;
|
|
152
|
-
source: "api_response" | "provider_status" | "playwright" | "local_estimate" | "tui_message";
|
|
153
|
-
capturedAt: string;
|
|
154
|
-
retryAfterMs?: number;
|
|
155
|
-
}
|
|
156
|
-
export interface QuotaState {
|
|
157
|
-
provider: string;
|
|
158
|
-
available: boolean;
|
|
159
|
-
limited: boolean;
|
|
160
|
-
exhausted: boolean;
|
|
161
|
-
signals: QuotaSignal[];
|
|
162
|
-
nextAvailableAt?: string;
|
|
163
|
-
}
|
|
164
|
-
export interface ProviderConfig {
|
|
165
|
-
id: string;
|
|
166
|
-
name: string;
|
|
167
|
-
apiKey?: string;
|
|
168
|
-
baseUrl?: string;
|
|
169
|
-
models: string[];
|
|
170
|
-
capabilities: ProviderCapability[];
|
|
171
|
-
rateLimits: RateLimitConfig;
|
|
172
|
-
}
|
|
173
|
-
export type ProviderCapability = "code" | "review" | "plan" | "test" | "e2e" | "refactor" | "analysis" | "debug";
|
|
174
|
-
export interface RateLimitConfig {
|
|
175
|
-
requestsPerMinute?: number;
|
|
176
|
-
tokensPerMinute?: number;
|
|
177
|
-
tokensPerDay?: number;
|
|
178
|
-
concurrentRequests?: number;
|
|
179
|
-
}
|
|
180
|
-
export interface ProviderResponse {
|
|
181
|
-
content: string;
|
|
182
|
-
usage?: {
|
|
183
|
-
input: number;
|
|
184
|
-
output: number;
|
|
185
|
-
cacheRead?: number;
|
|
186
|
-
cacheWrite?: number;
|
|
187
|
-
cost?: number;
|
|
188
|
-
};
|
|
189
|
-
model?: string;
|
|
190
|
-
finishReason?: "stop" | "length" | "content_filter" | "error";
|
|
191
|
-
error?: string;
|
|
192
|
-
}
|
|
193
|
-
export interface ProviderRequest {
|
|
194
|
-
model: string;
|
|
195
|
-
messages: ProviderMessage[];
|
|
196
|
-
temperature?: number;
|
|
197
|
-
maxTokens?: number;
|
|
198
|
-
stop?: string[];
|
|
199
|
-
}
|
|
200
|
-
export interface ProviderMessage {
|
|
201
|
-
role: "system" | "user" | "assistant";
|
|
202
|
-
content: string;
|
|
203
|
-
}
|
|
204
|
-
export interface HandoffContext {
|
|
205
|
-
jobId: string;
|
|
206
|
-
taskId: string;
|
|
207
|
-
fromAgent: string;
|
|
208
|
-
toAgent: string;
|
|
209
|
-
sharedFiles: string[];
|
|
210
|
-
taskHistory: HandoffEvent[];
|
|
211
|
-
summary: string;
|
|
212
|
-
}
|
|
213
|
-
export interface HandoffEvent {
|
|
214
|
-
ts: string;
|
|
215
|
-
agentId: string;
|
|
216
|
-
action: string;
|
|
217
|
-
result?: string;
|
|
218
|
-
}
|
|
219
|
-
export type ProjectType = "frappe_erpnext" | "frappe_spa" | "nextjs" | "react_vite" | "django" | "laravel" | "generic_web" | "unknown";
|
|
220
|
-
export interface ProjectDetection {
|
|
221
|
-
projectType: ProjectType;
|
|
222
|
-
confidence: number;
|
|
223
|
-
signals: string[];
|
|
224
|
-
recommendedSeedStrategy: SeedStrategy;
|
|
225
|
-
recommendedE2EStrategy: E2EStrategy;
|
|
226
|
-
framework?: string;
|
|
227
|
-
version?: string;
|
|
228
|
-
}
|
|
229
|
-
export type SeedStrategy = "frappe_doc_insert" | "frappe_site_seed" | "nextjs_factory" | "react_factory" | "django_fixture" | "laravel_factory" | "generic_sql";
|
|
230
|
-
export type E2EStrategy = "bench_site_browser_flow" | "next_dev_server_flow" | "vite_dev_server_flow" | "django_test_client_flow" | "laravel_dusk_flow" | "generic_playwright_flow";
|
|
231
|
-
export interface E2EScenario {
|
|
232
|
-
id: string;
|
|
233
|
-
name: string;
|
|
234
|
-
description: string;
|
|
235
|
-
steps: E2EStep[];
|
|
236
|
-
required: boolean;
|
|
237
|
-
tags?: string[];
|
|
238
|
-
}
|
|
239
|
-
export interface E2EStep {
|
|
240
|
-
action: "navigate" | "click" | "type" | "wait" | "screenshot" | "assert" | "hover" | "select" | "upload";
|
|
241
|
-
selector?: string;
|
|
242
|
-
value?: string;
|
|
243
|
-
timeout?: number;
|
|
244
|
-
assertCondition?: string;
|
|
245
|
-
}
|
|
246
|
-
export interface E2EResult {
|
|
247
|
-
scenarioId: string;
|
|
248
|
-
status: "passed" | "failed" | "skipped" | "error";
|
|
249
|
-
duration: number;
|
|
250
|
-
stepsExecuted: number;
|
|
251
|
-
stepsPassed: number;
|
|
252
|
-
stepsFailed: number;
|
|
253
|
-
screenshotPath?: string;
|
|
254
|
-
tracePath?: string;
|
|
255
|
-
videoPath?: string;
|
|
256
|
-
errorMessage?: string;
|
|
257
|
-
failedStep?: number;
|
|
258
|
-
executedAt: string;
|
|
259
|
-
}
|
|
260
|
-
export interface E2EReport {
|
|
261
|
-
jobId: string;
|
|
262
|
-
scenarios: E2EScenario[];
|
|
263
|
-
results: E2EResult[];
|
|
264
|
-
summary: {
|
|
265
|
-
total: number;
|
|
266
|
-
passed: number;
|
|
267
|
-
failed: number;
|
|
268
|
-
skipped: number;
|
|
269
|
-
duration: number;
|
|
270
|
-
};
|
|
271
|
-
createdAt: string;
|
|
272
|
-
}
|
|
273
|
-
export interface RepairTask {
|
|
274
|
-
id: string;
|
|
275
|
-
originalTaskId: string;
|
|
276
|
-
failureType: FailureType;
|
|
277
|
-
description: string;
|
|
278
|
-
attemptedFixes: AttemptedFix[];
|
|
279
|
-
status: "pending" | "in_progress" | "resolved" | "escalated";
|
|
280
|
-
retryPolicy: RetryPolicy;
|
|
281
|
-
createdAt: string;
|
|
282
|
-
resolvedAt?: string;
|
|
283
|
-
}
|
|
284
|
-
export type FailureType = "test_failure" | "e2e_failure" | "build_error" | "runtime_error" | "lint_error" | "type_error" | "quota_exhausted" | "provider_error" | "unknown";
|
|
285
|
-
export interface AttemptedFix {
|
|
286
|
-
attempt: number;
|
|
287
|
-
description: string;
|
|
288
|
-
success: boolean;
|
|
289
|
-
output?: string;
|
|
290
|
-
timestamp: string;
|
|
291
|
-
}
|
|
292
|
-
export interface RetryPolicy {
|
|
293
|
-
maxRetries: number;
|
|
294
|
-
backoffMs: number;
|
|
295
|
-
backoffMultiplier: number;
|
|
296
|
-
escalationAfter?: number;
|
|
297
|
-
}
|
|
298
|
-
export interface WorktreeInfo {
|
|
299
|
-
name: string;
|
|
300
|
-
path: string;
|
|
301
|
-
branch: string;
|
|
302
|
-
jobId?: string;
|
|
303
|
-
taskId?: string;
|
|
304
|
-
createdAt: string;
|
|
305
|
-
status: "active" | "merged" | "abandoned";
|
|
306
|
-
}
|
|
307
|
-
export interface LoopConfig {
|
|
308
|
-
jobId: string;
|
|
309
|
-
requirement: string;
|
|
310
|
-
providerPolicy?: {
|
|
311
|
-
plannerProvider: string;
|
|
312
|
-
codeProviders: string[];
|
|
313
|
-
reviewProvider: string;
|
|
314
|
-
fallbackProviders: string[];
|
|
315
|
-
};
|
|
316
|
-
maxIterations?: number;
|
|
317
|
-
checkpointInterval?: number;
|
|
318
|
-
autoCheckpoint?: boolean;
|
|
319
|
-
pauseOnQuota?: boolean;
|
|
320
|
-
maxRepairAttempts?: number;
|
|
321
|
-
}
|
|
322
|
-
export interface LoopState {
|
|
323
|
-
jobId: string;
|
|
324
|
-
iteration: number;
|
|
325
|
-
currentTaskId?: string | null;
|
|
326
|
-
status: JobStatus;
|
|
327
|
-
lastActivity?: string;
|
|
328
|
-
lastCheckpoint?: RuntimeCheckpoint | null;
|
|
329
|
-
}
|
|
330
|
-
/** Why a compact was triggered */
|
|
331
|
-
export type CompactTriggerReason = "token_threshold" | "manual" | "output_limit" | "quota_exceeded" | "error";
|
|
332
|
-
/** A single tool-call result that can be microcompacted */
|
|
333
|
-
export interface CompactableToolResult {
|
|
334
|
-
id: string;
|
|
335
|
-
name: string;
|
|
336
|
-
timestamp: number;
|
|
337
|
-
tokens: number;
|
|
338
|
-
content: string;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* A message in the compactable conversation history.
|
|
342
|
-
* System-role messages are used as compact boundaries.
|
|
343
|
-
*/
|
|
344
|
-
export interface CompactableMessage {
|
|
345
|
-
role: "user" | "assistant" | "system";
|
|
346
|
-
content: string;
|
|
347
|
-
timestamp: number;
|
|
348
|
-
toolResults?: CompactableToolResult[];
|
|
349
|
-
/** Arbitrary per-message metadata (e.g. model, usage stats) */
|
|
350
|
-
metadata?: Record<string, unknown>;
|
|
351
|
-
}
|
|
352
|
-
/** Return type of every LLM invocation */
|
|
353
|
-
export interface InvokeResult {
|
|
354
|
-
success: boolean;
|
|
355
|
-
output?: string;
|
|
356
|
-
error?: string;
|
|
357
|
-
finishReason?: "stop" | "length" | "content_filter";
|
|
358
|
-
usage?: {
|
|
359
|
-
inputTokens: number;
|
|
360
|
-
outputTokens: number;
|
|
361
|
-
totalTokens: number;
|
|
362
|
-
};
|
|
363
|
-
/** The model that generated this result (used for cost tracking) */
|
|
364
|
-
model?: string;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Options passed when invoking the LLM through CompactOrchestrator.
|
|
368
|
-
* The orchestrator injects microcompact / full compact around this call.
|
|
369
|
-
*/
|
|
370
|
-
export interface InvokeWithCompactOptions {
|
|
371
|
-
messages: CompactableMessage[];
|
|
372
|
-
model: string;
|
|
373
|
-
systemPrompt?: string;
|
|
374
|
-
maxOutputTokens: number;
|
|
375
|
-
tools?: Array<{
|
|
376
|
-
name: string;
|
|
377
|
-
description?: string;
|
|
378
|
-
input_schema?: Record<string, unknown>;
|
|
379
|
-
}>;
|
|
380
|
-
/**
|
|
381
|
-
* The actual LLM invoke function.
|
|
382
|
-
* When provided in opts, the orchestrator uses it directly.
|
|
383
|
-
* Otherwise the orchestrator falls back to callbacks.invokeAgent.
|
|
384
|
-
*/
|
|
385
|
-
invokeAgent?: (opts: InvokeWithCompactOptions) => Promise<InvokeResult>;
|
|
386
|
-
}
|
|
387
|
-
/** What the orchestrator emits after a full compact */
|
|
388
|
-
export interface CompactResult {
|
|
389
|
-
trigger: CompactTriggerReason;
|
|
390
|
-
beforeTokens: number;
|
|
391
|
-
afterTokens: number;
|
|
392
|
-
messagesCompacted: number;
|
|
393
|
-
summary?: string;
|
|
394
|
-
}
|
|
395
|
-
/** What the orchestrator emits as its final return value */
|
|
396
|
-
export interface OrchestratedInvokeResult extends InvokeResult {
|
|
397
|
-
compactResult?: CompactResult;
|
|
398
|
-
continueMessage?: string;
|
|
399
|
-
}
|
|
400
|
-
/** Callbacks the harness provides to CompactOrchestrator */
|
|
401
|
-
export interface CompactOrchestratorCallbacks {
|
|
402
|
-
/** Called after every successful compaction with the result */
|
|
403
|
-
onCheckpoint?: (result: CompactResult) => void;
|
|
404
|
-
/** Called when a quota event occurs */
|
|
405
|
-
onQuotaEvent?: (event: "paused" | "resumed" | "exhausted", provider?: string) => void;
|
|
406
|
-
/**
|
|
407
|
-
* Summarize messages via a forked agent.
|
|
408
|
-
* Used by runFullCompact() instead of the main conversation.
|
|
409
|
-
* Until RFC-0028 is fully wired, falls back to heuristic truncation.
|
|
410
|
-
*/
|
|
411
|
-
summarizeViaForkedAgent?: (messages: CompactableMessage[], reason: CompactTriggerReason) => Promise<{
|
|
412
|
-
summary: string;
|
|
413
|
-
droppedCount: number;
|
|
414
|
-
}>;
|
|
415
|
-
}
|
|
416
|
-
export { KNOWN_AI_PROVIDERS, PROVIDER_LABELS, SCRAPEABLE_PROVIDERS, TUI_SIGNAL_PROVIDERS, isKnownAiProvider, getProviderLabel, } from "./ai-providers.js";
|
|
417
|
-
export type { KnownAiProvider } from "./ai-providers.js";
|
|
418
|
-
//# sourceMappingURL=runtime-types.d.ts.map
|