@kognai/orchestrator-core 0.1.1 → 0.1.3

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.
@@ -0,0 +1,141 @@
1
+ export declare let _globalTokensThisRun: number;
2
+ export declare function recordModelCall(provider: string, model: string, input_tokens: number, output_tokens: number, cost_usd: number): void;
3
+ export declare function getModelsUsedReport(): Record<string, {
4
+ provider: string;
5
+ calls: number;
6
+ input_tokens: number;
7
+ output_tokens: number;
8
+ tokens: number;
9
+ cost_usd: number;
10
+ }>;
11
+ export declare function getTotalCostUsd(): number;
12
+ import type { ClawRouterV2Request } from './model-router-contract';
13
+ export declare const routeCall: (req: ClawRouterV2Request) => Promise<import("./model-router-contract").ClawRouterV2Response>;
14
+ export declare const getDailyCostDigest: () => import("./model-router-contract").DailyCostDigest;
15
+ import type { SupervisorGrade } from './citizen-score-contract';
16
+ /**
17
+ * Wire a supervisor's review into the SCORE protocol for the citizen that
18
+ * authored the task. No-op for agents not in the citizens registry yet
19
+ * (founding agents — CEO/sup/sherlock — aren't backfilled). Caller passes
20
+ * the agent slug; we look up the citizen record + DID.
21
+ */
22
+ export declare function recordScoreForCitizen(agent_name: string, sprint_id: string, task_id: string, grade: SupervisorGrade | undefined, path: 'approved-path' | 'rejected-path'): void;
23
+ export declare const SOVEREIGN_MODE: boolean;
24
+ export interface AgentTask {
25
+ id: string;
26
+ agent: string;
27
+ type: 'feature' | 'bugfix' | 'review' | 'test';
28
+ priority: 'critical' | 'high' | 'medium' | 'low';
29
+ dependencies: string[];
30
+ context: string;
31
+ deliverables: {
32
+ code?: string[];
33
+ tests?: string[];
34
+ docs?: string[];
35
+ };
36
+ status: 'pending' | 'in_progress' | 'review' | 'approved' | 'rejected' | 'done' | 'skipped';
37
+ output?: {
38
+ files: string[];
39
+ commit: string;
40
+ model: string;
41
+ review?: ReviewResult;
42
+ };
43
+ task_target?: 'local' | 'cloud-code' | 'cloud-exec' | 'cloud-post';
44
+ task_type?: string;
45
+ execution_id?: string;
46
+ queued_at?: string;
47
+ executed_at?: string;
48
+ execution_source?: string;
49
+ }
50
+ export interface ReviewResult {
51
+ verdict: 'APPROVED' | 'REJECTED' | 'CHANGES_REQUESTED';
52
+ score: number;
53
+ grade?: 'A' | 'B' | 'C' | 'D' | 'F';
54
+ score_rationale?: string;
55
+ summary: string;
56
+ issues: Array<{
57
+ severity: string;
58
+ file: string;
59
+ description: string;
60
+ }>;
61
+ strengths: string[];
62
+ }
63
+ export declare function normalizeReview(raw: any): ReviewResult;
64
+ export interface CTOProposal {
65
+ id: string;
66
+ title: string;
67
+ category: 'cost_optimization' | 'new_feature' | 'new_agent' | 'process_change' | 'architecture' | 'tooling';
68
+ description: string;
69
+ estimated_impact: string;
70
+ risk_level: 'low' | 'medium' | 'high';
71
+ implementation_steps: string[];
72
+ agent_spec?: {
73
+ name: string;
74
+ role: string;
75
+ llm: 'minimax' | 'anthropic';
76
+ trigger: string;
77
+ prompt_summary: string;
78
+ };
79
+ }
80
+ export interface CTOReport {
81
+ summary: string;
82
+ proposals: CTOProposal[];
83
+ metrics_reviewed: string[];
84
+ }
85
+ interface LLMResponse {
86
+ choices: Array<{
87
+ message: {
88
+ content: string;
89
+ };
90
+ }>;
91
+ usage?: {
92
+ total_tokens: number;
93
+ input_tokens?: number;
94
+ output_tokens?: number;
95
+ };
96
+ base_resp?: {
97
+ status_code: number;
98
+ status_msg: string;
99
+ };
100
+ provider?: string;
101
+ model?: string;
102
+ cost_usd?: number;
103
+ }
104
+ export declare const c: {
105
+ reset: string;
106
+ bold: string;
107
+ red: string;
108
+ green: string;
109
+ yellow: string;
110
+ blue: string;
111
+ magenta: string;
112
+ cyan: string;
113
+ gray: string;
114
+ };
115
+ export declare function log(color: string, msg: string): void;
116
+ export declare function safeResetLastCommit(taskId: string, agentName: string | undefined, taskType: string | undefined, indent?: string): boolean;
117
+ /**
118
+ * Unified LLM gateway — routes ALL calls through ClawRouter v2.0.
119
+ * Legacy provider parameter is mapped to ClawRouter tier/complexity:
120
+ * - 'ollama' / 'local' → T0-T2 (local Ollama, $0)
121
+ * - 'clawrouter' → T2.5 EXEC (cloud gateway)
122
+ * - 'anthropic' (Sonnet) → T3 APEX (constitutional decisions only)
123
+ * - 'anthropic' (Haiku) → T2.5 EXEC
124
+ * - 'openai' → T2.5 EXEC
125
+ * - 'minimax' → T2.5 EXEC (via ClawRouter)
126
+ *
127
+ * NOTE: The provider parameter is retained for backward compatibility but
128
+ * ALL routing decisions are made by ClawRouter v2.0. No direct API calls.
129
+ */
130
+ export declare function callLLM(provider: 'minimax' | 'anthropic' | 'openai' | 'ollama' | 'clawrouter', model: string, systemPrompt: string, userPrompt: string, timeoutMs?: number, agentId?: string, taskType?: string): Promise<LLMResponse>;
131
+ export declare function callAnthropicCached(model: string, systemPrompt: string, userPrompt: string, timeoutMs: number): Promise<LLMResponse>;
132
+ export declare function compressContext(context: string): Promise<string>;
133
+ export declare function localQAGate(_task: AgentTask, fileContents: Array<{
134
+ path: string;
135
+ content: string;
136
+ }>): Promise<{
137
+ pass: boolean;
138
+ reason: string;
139
+ }>;
140
+ export declare function httpPost(url: string, headers: Record<string, string>, body: string, timeoutMs: number): Promise<any>;
141
+ export {};