@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.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/did-resolver-registry.d.ts +15 -0
- package/dist/lib/did-resolver-registry.js +9 -0
- package/dist/lib/engine-agents.d.ts +71 -0
- package/dist/lib/engine-agents.js +835 -0
- package/dist/lib/engine-coding-agent.d.ts +17 -0
- package/dist/lib/engine-coding-agent.js +890 -0
- package/dist/lib/engine-helpers.d.ts +10 -0
- package/dist/lib/engine-helpers.js +319 -0
- package/dist/lib/engine-loaders.d.ts +5 -0
- package/dist/lib/engine-loaders.js +241 -0
- package/dist/lib/engine-orchestrator.d.ts +46 -0
- package/dist/lib/engine-orchestrator.js +1491 -0
- package/dist/lib/engine-primitives.d.ts +141 -0
- package/dist/lib/engine-primitives.js +748 -0
- package/dist/lib/orchestrate-engine.d.ts +14 -1
- package/dist/lib/orchestrate-engine.js +26 -4333
- package/dist/lib/plumber/extractor.d.ts +18 -0
- package/dist/lib/plumber/extractor.js +213 -0
- package/dist/lib/plumber/fixer.d.ts +75 -0
- package/dist/lib/plumber/fixer.js +165 -0
- package/dist/lib/plumber/index.d.ts +3 -0
- package/dist/lib/plumber/index.js +3 -0
- package/dist/lib/plumber/patcher.d.ts +44 -0
- package/dist/lib/plumber/patcher.js +210 -0
- package/dist/lib/preamble-provider-registry.d.ts +12 -0
- package/dist/lib/preamble-provider-registry.js +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -60,5 +60,8 @@ export { CTOApprovalResult, requestCTOApproval, batchCTOReview } from './lib/cto
|
|
|
60
60
|
export * from './lib/citizen-score-contract';
|
|
61
61
|
export * from './lib/citizen-score-registry';
|
|
62
62
|
export * from './lib/sovereign-agent-factory';
|
|
63
|
+
export * from './lib/did-resolver-registry';
|
|
64
|
+
export * from './lib/preamble-provider-registry';
|
|
63
65
|
export { runOrchestrator } from './lib/orchestrate-engine';
|
|
66
|
+
export type { OrchestratorConfig, SpawnGate, SpawnGateResult, AgentSpawnSpec, } from './lib/orchestrate-engine';
|
|
64
67
|
export { runSprintCycle, SprintRunnerOpts } from './lib/sprint-runner-engine';
|
package/dist/index.js
CHANGED
|
@@ -173,6 +173,9 @@ __exportStar(require("./lib/citizen-score-registry"), exports);
|
|
|
173
173
|
__exportStar(require("./lib/sovereign-agent-factory"), exports);
|
|
174
174
|
// TICKET-215 Wave D split step 2: engine + sprint-runner entry points.
|
|
175
175
|
// Inject seams via kognai-bootstrap (side-effect import) before calling.
|
|
176
|
+
// TICKET-226 A1: template-carried polity seams (DID resolution + constitutional preamble).
|
|
177
|
+
__exportStar(require("./lib/did-resolver-registry"), exports);
|
|
178
|
+
__exportStar(require("./lib/preamble-provider-registry"), exports);
|
|
176
179
|
var orchestrate_engine_1 = require("./lib/orchestrate-engine");
|
|
177
180
|
Object.defineProperty(exports, "runOrchestrator", { enumerable: true, get: function () { return orchestrate_engine_1.runOrchestrator; } });
|
|
178
181
|
var sprint_runner_engine_1 = require("./lib/sprint-runner-engine");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DID resolver seam — TICKET-226 Phase A1 (template-carried polity extraction).
|
|
3
|
+
*
|
|
4
|
+
* How an agent ROLE maps to a DID is a product concern, not an engine concern
|
|
5
|
+
* (the core is template-agnostic — TICKET-215). This seam lets a consuming
|
|
6
|
+
* template override DID resolution. OPTIONAL override: if no resolver is set the
|
|
7
|
+
* engine keeps its existing inline behavior, so adding this is NON-BREAKING.
|
|
8
|
+
* Phase A2 injects Kognai's citizenship-backed resolver; Phase A3 removes the
|
|
9
|
+
* engine's inline default.
|
|
10
|
+
*/
|
|
11
|
+
export type DidResolver = (role: string) => string;
|
|
12
|
+
/** Inject a product-specific DID resolver (e.g. Kognai citizenship → did:kognai). */
|
|
13
|
+
export declare function setDidResolver(fn: DidResolver): void;
|
|
14
|
+
/** The injected resolver, or null if the engine should use its inline default. */
|
|
15
|
+
export declare function getDidResolver(): DidResolver | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setDidResolver = setDidResolver;
|
|
4
|
+
exports.getDidResolver = getDidResolver;
|
|
5
|
+
let _resolver = null;
|
|
6
|
+
/** Inject a product-specific DID resolver (e.g. Kognai citizenship → did:kognai). */
|
|
7
|
+
function setDidResolver(fn) { _resolver = fn; }
|
|
8
|
+
/** The injected resolver, or null if the engine should use its inline default. */
|
|
9
|
+
function getDidResolver() { return _resolver; }
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AgentTask, ReviewResult, CTOProposal, CTOReport } from './orchestrate-engine';
|
|
2
|
+
export declare class SupervisorAgent {
|
|
3
|
+
private systemPrompt;
|
|
4
|
+
constructor();
|
|
5
|
+
reviewTask(task: AgentTask, files: string[]): Promise<ReviewResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare class Supervisor2Agent {
|
|
8
|
+
private systemPrompt;
|
|
9
|
+
constructor();
|
|
10
|
+
reviewTask(task: AgentTask, files: string[]): Promise<ReviewResult>;
|
|
11
|
+
}
|
|
12
|
+
export interface DualReviewResult {
|
|
13
|
+
finalReview: ReviewResult;
|
|
14
|
+
review1: ReviewResult;
|
|
15
|
+
review2: ReviewResult;
|
|
16
|
+
consensus: boolean;
|
|
17
|
+
escalatedToCEO: boolean;
|
|
18
|
+
ceoDecision?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function reconcileSupervisorReviews(review1: ReviewResult, review2: ReviewResult, task: AgentTask, ceo: CEOAgent): Promise<DualReviewResult>;
|
|
21
|
+
export declare class CEOAgent {
|
|
22
|
+
private systemPrompt;
|
|
23
|
+
constructor();
|
|
24
|
+
reviewSprintProgress(tasks: AgentTask[]): Promise<string>;
|
|
25
|
+
resolveReviewConflict(task: AgentTask, approvalReview: ReviewResult, rejectionReview: ReviewResult, approver: string, rejecter: string): Promise<string>;
|
|
26
|
+
reviewCTOProposals(ctoReport: CTOReport): Promise<string>;
|
|
27
|
+
generateDailyReport(tasks: AgentTask[], stats: {
|
|
28
|
+
tasksExecuted: number;
|
|
29
|
+
approved: number;
|
|
30
|
+
rejected: number;
|
|
31
|
+
conflicts?: number;
|
|
32
|
+
escalations?: number;
|
|
33
|
+
}, ctoReport: string, ctoDecisions: string): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export declare class CTODataCollector {
|
|
36
|
+
collect(): string;
|
|
37
|
+
}
|
|
38
|
+
export declare class CTOAgent {
|
|
39
|
+
private systemPrompt;
|
|
40
|
+
private dataCollector;
|
|
41
|
+
constructor();
|
|
42
|
+
analyze(): Promise<CTOReport>;
|
|
43
|
+
/**
|
|
44
|
+
* Post-sprint analysis: autonomous retrospective that runs after every sprint.
|
|
45
|
+
* Analyzes sprint results, detects failure patterns, and saves a report.
|
|
46
|
+
* This runs the CTO techwatch `post-sprint-analysis` watch type.
|
|
47
|
+
*/
|
|
48
|
+
postSprintAnalysis(tasks: any[], stats: any): Promise<string>;
|
|
49
|
+
}
|
|
50
|
+
export interface AgentSpawnSpec {
|
|
51
|
+
name: string;
|
|
52
|
+
role: string;
|
|
53
|
+
llm: 'minimax' | 'anthropic';
|
|
54
|
+
trigger: string;
|
|
55
|
+
prompt_summary: string;
|
|
56
|
+
}
|
|
57
|
+
export interface SpawnGateResult {
|
|
58
|
+
approved: boolean;
|
|
59
|
+
/** Human-readable reason when not approved (rejected or pending). */
|
|
60
|
+
rejection_reason?: string;
|
|
61
|
+
/** True when the spawn is suspended awaiting an out-of-band (e.g. human) approval. */
|
|
62
|
+
pending_approval?: boolean;
|
|
63
|
+
/** Optional one-line audit string logged on an approved decision. */
|
|
64
|
+
audit?: string;
|
|
65
|
+
}
|
|
66
|
+
export type SpawnGate = (spec: AgentSpawnSpec) => SpawnGateResult;
|
|
67
|
+
export declare class AgentCreator {
|
|
68
|
+
private readonly spawnGate?;
|
|
69
|
+
constructor(spawnGate?: SpawnGate | undefined);
|
|
70
|
+
createAgent(spec: NonNullable<CTOProposal['agent_spec']>): string;
|
|
71
|
+
}
|