@mcoda/mswarm 0.1.57 → 0.1.61
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 +19 -0
- package/dist/codali-executor.d.ts +278 -0
- package/dist/codali-executor.d.ts.map +1 -0
- package/dist/codali-executor.js +243 -0
- package/dist/codali-executor.js.map +1 -0
- package/dist/runtime.d.ts +46 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +298 -30
- package/dist/runtime.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +66 -1
- package/dist/server.js.map +1 -1
- package/dist/vendor/codali/agents/AgentProtocol.d.ts +287 -0
- package/dist/vendor/codali/agents/AgentProtocol.d.ts.map +1 -0
- package/dist/vendor/codali/agents/AgentProtocol.js +365 -0
- package/dist/vendor/codali/agents/AgentResolver.d.ts +23 -0
- package/dist/vendor/codali/agents/AgentResolver.d.ts.map +1 -0
- package/dist/vendor/codali/agents/AgentResolver.js +77 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts +23 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts.map +1 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.js +287 -0
- package/dist/vendor/codali/cli/EvalCommand.d.ts +37 -0
- package/dist/vendor/codali/cli/EvalCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/EvalCommand.js +333 -0
- package/dist/vendor/codali/cli/FeedbackCommand.d.ts +22 -0
- package/dist/vendor/codali/cli/FeedbackCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/FeedbackCommand.js +163 -0
- package/dist/vendor/codali/cli/RunCommand.d.ts +78 -0
- package/dist/vendor/codali/cli/RunCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/RunCommand.js +2261 -0
- package/dist/vendor/codali/cli.d.ts +3 -0
- package/dist/vendor/codali/cli.d.ts.map +1 -0
- package/dist/vendor/codali/cli.js +109 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts +107 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.js +1726 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts +25 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.js +164 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.d.ts +76 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.js +1159 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.d.ts +91 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.js +4547 -0
- package/dist/vendor/codali/cognitive/ContextBudget.d.ts +19 -0
- package/dist/vendor/codali/cognitive/ContextBudget.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextBudget.js +35 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts +30 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.js +307 -0
- package/dist/vendor/codali/cognitive/ContextManager.d.ts +47 -0
- package/dist/vendor/codali/cognitive/ContextManager.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextManager.js +272 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.d.ts +18 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.js +53 -0
- package/dist/vendor/codali/cognitive/ContextSelector.d.ts +22 -0
- package/dist/vendor/codali/cognitive/ContextSelector.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSelector.js +431 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.d.ts +8 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.js +882 -0
- package/dist/vendor/codali/cognitive/ContextStore.d.ts +27 -0
- package/dist/vendor/codali/cognitive/ContextStore.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextStore.js +79 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts +16 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.js +45 -0
- package/dist/vendor/codali/cognitive/CostEstimator.d.ts +31 -0
- package/dist/vendor/codali/cognitive/CostEstimator.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/CostEstimator.js +66 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts +32 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.js +297 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.d.ts +9 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.js +75 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts +12 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.js +34 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts +33 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.js +159 -0
- package/dist/vendor/codali/cognitive/IntentSignals.d.ts +7 -0
- package/dist/vendor/codali/cognitive/IntentSignals.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/IntentSignals.js +285 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.d.ts +100 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.js +276 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts +64 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.js +287 -0
- package/dist/vendor/codali/cognitive/PatchApplier.d.ts +49 -0
- package/dist/vendor/codali/cognitive/PatchApplier.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchApplier.js +199 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts +35 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.js +100 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts +7 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.js +59 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts +17 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.js +131 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts +3 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.js +85 -0
- package/dist/vendor/codali/cognitive/Prompts.d.ts +15 -0
- package/dist/vendor/codali/cognitive/Prompts.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/Prompts.js +326 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.d.ts +16 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.js +24 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.d.ts +12 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.js +262 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts +13 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.js +125 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.d.ts +92 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.js +4804 -0
- package/dist/vendor/codali/cognitive/Types.d.ts +474 -0
- package/dist/vendor/codali/cognitive/Types.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/Types.js +7 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.d.ts +57 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.js +515 -0
- package/dist/vendor/codali/config/Config.d.ts +249 -0
- package/dist/vendor/codali/config/Config.d.ts.map +1 -0
- package/dist/vendor/codali/config/Config.js +200 -0
- package/dist/vendor/codali/config/ConfigLoader.d.ts +56 -0
- package/dist/vendor/codali/config/ConfigLoader.d.ts.map +1 -0
- package/dist/vendor/codali/config/ConfigLoader.js +1246 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts +158 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts.map +1 -0
- package/dist/vendor/codali/docdex/DocdexClient.js +785 -0
- package/dist/vendor/codali/eval/EvalRunner.d.ts +35 -0
- package/dist/vendor/codali/eval/EvalRunner.d.ts.map +1 -0
- package/dist/vendor/codali/eval/EvalRunner.js +38 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts +81 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts.map +1 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.js +371 -0
- package/dist/vendor/codali/eval/GateEvaluator.d.ts +31 -0
- package/dist/vendor/codali/eval/GateEvaluator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/GateEvaluator.js +134 -0
- package/dist/vendor/codali/eval/MetricTypes.d.ts +28 -0
- package/dist/vendor/codali/eval/MetricTypes.d.ts.map +1 -0
- package/dist/vendor/codali/eval/MetricTypes.js +1 -0
- package/dist/vendor/codali/eval/MetricsAggregator.d.ts +4 -0
- package/dist/vendor/codali/eval/MetricsAggregator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/MetricsAggregator.js +97 -0
- package/dist/vendor/codali/eval/RegressionComparator.d.ts +29 -0
- package/dist/vendor/codali/eval/RegressionComparator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/RegressionComparator.js +155 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.d.ts +52 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.js +229 -0
- package/dist/vendor/codali/eval/ReportSerializer.d.ts +32 -0
- package/dist/vendor/codali/eval/ReportSerializer.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportSerializer.js +33 -0
- package/dist/vendor/codali/eval/ReportStore.d.ts +18 -0
- package/dist/vendor/codali/eval/ReportStore.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportStore.js +96 -0
- package/dist/vendor/codali/eval/SuiteLoader.d.ts +12 -0
- package/dist/vendor/codali/eval/SuiteLoader.d.ts.map +1 -0
- package/dist/vendor/codali/eval/SuiteLoader.js +51 -0
- package/dist/vendor/codali/eval/SuiteSchema.d.ts +56 -0
- package/dist/vendor/codali/eval/SuiteSchema.d.ts.map +1 -0
- package/dist/vendor/codali/eval/SuiteSchema.js +357 -0
- package/dist/vendor/codali/index.d.ts +11 -0
- package/dist/vendor/codali/index.d.ts.map +1 -0
- package/dist/vendor/codali/index.js +5 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/CodexCliProvider.js +282 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.js +300 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.js +192 -0
- package/dist/vendor/codali/providers/ProviderRegistry.d.ts +12 -0
- package/dist/vendor/codali/providers/ProviderRegistry.d.ts.map +1 -0
- package/dist/vendor/codali/providers/ProviderRegistry.js +28 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts +81 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts.map +1 -0
- package/dist/vendor/codali/providers/ProviderTypes.js +1 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts +189 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.js +1435 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts +39 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.js +57 -0
- package/dist/vendor/codali/runtime/RunContext.d.ts +27 -0
- package/dist/vendor/codali/runtime/RunContext.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunContext.js +51 -0
- package/dist/vendor/codali/runtime/RunLogQuery.d.ts +48 -0
- package/dist/vendor/codali/runtime/RunLogQuery.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogQuery.js +36 -0
- package/dist/vendor/codali/runtime/RunLogReader.d.ts +19 -0
- package/dist/vendor/codali/runtime/RunLogReader.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogReader.js +361 -0
- package/dist/vendor/codali/runtime/RunLogger.d.ts +71 -0
- package/dist/vendor/codali/runtime/RunLogger.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogger.js +100 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts +117 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.js +299 -0
- package/dist/vendor/codali/runtime/Runner.d.ts +66 -0
- package/dist/vendor/codali/runtime/Runner.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/Runner.js +215 -0
- package/dist/vendor/codali/runtime/StoragePaths.d.ts +3 -0
- package/dist/vendor/codali/runtime/StoragePaths.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/StoragePaths.js +19 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.d.ts +30 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.js +141 -0
- package/dist/vendor/codali/session/InstructionLoader.d.ts +14 -0
- package/dist/vendor/codali/session/InstructionLoader.d.ts.map +1 -0
- package/dist/vendor/codali/session/InstructionLoader.js +107 -0
- package/dist/vendor/codali/session/SessionStore.d.ts +81 -0
- package/dist/vendor/codali/session/SessionStore.d.ts.map +1 -0
- package/dist/vendor/codali/session/SessionStore.js +244 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts +68 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts.map +1 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.js +150 -0
- package/dist/vendor/codali/tools/ToolRegistry.d.ts +9 -0
- package/dist/vendor/codali/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/vendor/codali/tools/ToolRegistry.js +293 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts +66 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts.map +1 -0
- package/dist/vendor/codali/tools/ToolTypes.js +40 -0
- package/dist/vendor/codali/tools/diff/DiffTool.d.ts +3 -0
- package/dist/vendor/codali/tools/diff/DiffTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/diff/DiffTool.js +34 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts +4 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.js +490 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts +3 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.js +141 -0
- package/dist/vendor/codali/tools/search/SearchTool.d.ts +3 -0
- package/dist/vendor/codali/tools/search/SearchTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/search/SearchTool.js +46 -0
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts +3 -0
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/shell/ShellTool.js +104 -0
- package/package.json +5 -3
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { AgentStatusPhase, Provider, ProviderMessage, ProviderUsage } from "../providers/ProviderTypes.js";
|
|
2
|
+
import { ToolRegistry } from "../tools/ToolRegistry.js";
|
|
3
|
+
import type { ToolContext, ToolDefinition } from "../tools/ToolTypes.js";
|
|
4
|
+
import type { RunLogger } from "./RunLogger.js";
|
|
5
|
+
export interface CodaliRuntimeWorkspace {
|
|
6
|
+
root: string;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CodaliRuntimeProviderInput {
|
|
10
|
+
name: "openai-compatible" | "ollama-remote" | "codex-cli" | string;
|
|
11
|
+
model: string;
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
timeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CodaliRuntimeDocdexInput {
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
repoRoot?: string;
|
|
20
|
+
repoId?: string;
|
|
21
|
+
dagSessionId?: string;
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
credentialSource?: "attached_mswarm_api_key" | string;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
allowedOperations?: string[];
|
|
26
|
+
capabilities?: Record<string, boolean | undefined>;
|
|
27
|
+
initialize?: boolean;
|
|
28
|
+
allowWeb?: boolean;
|
|
29
|
+
allowMemoryWrite?: boolean;
|
|
30
|
+
allowProfileWrite?: boolean;
|
|
31
|
+
allowIndexRebuild?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface CodaliRuntimeAgentInput {
|
|
34
|
+
slug: string;
|
|
35
|
+
adapter: string;
|
|
36
|
+
provider?: string;
|
|
37
|
+
model: string;
|
|
38
|
+
baseUrl?: string;
|
|
39
|
+
supportsTools?: boolean;
|
|
40
|
+
capabilities?: string[];
|
|
41
|
+
contextWindow?: number;
|
|
42
|
+
maxOutputTokens?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface CodaliRuntimePolicy {
|
|
45
|
+
allowWrites: boolean;
|
|
46
|
+
allowShell: boolean;
|
|
47
|
+
allowDestructiveOperations: boolean;
|
|
48
|
+
allowOutsideWorkspace: boolean;
|
|
49
|
+
allowedTools?: string[];
|
|
50
|
+
deniedTools?: string[];
|
|
51
|
+
maxSteps: number;
|
|
52
|
+
maxToolCalls: number;
|
|
53
|
+
maxTokens?: number;
|
|
54
|
+
timeoutMs: number;
|
|
55
|
+
mode: "tool_loop" | "protocol_loop" | "smart_pipeline" | "patch_json" | "freeform";
|
|
56
|
+
}
|
|
57
|
+
export interface CodaliRuntimeSubagentsInput {
|
|
58
|
+
enabled?: boolean;
|
|
59
|
+
maxParallel?: number;
|
|
60
|
+
maxSubagents?: number;
|
|
61
|
+
defaultTimeoutMs?: number;
|
|
62
|
+
allowWrites?: boolean;
|
|
63
|
+
defaultTools?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface CodaliRuntimeSessionInput {
|
|
66
|
+
id?: string;
|
|
67
|
+
storageDir?: string;
|
|
68
|
+
resume?: boolean;
|
|
69
|
+
compactOnFinish?: boolean;
|
|
70
|
+
loadInstructions?: boolean;
|
|
71
|
+
includeLocalInstructions?: boolean;
|
|
72
|
+
focusPaths?: string[];
|
|
73
|
+
}
|
|
74
|
+
export type CodaliRuntimeEvent = {
|
|
75
|
+
type: "status";
|
|
76
|
+
phase: AgentStatusPhase;
|
|
77
|
+
message?: string;
|
|
78
|
+
at: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: "token";
|
|
81
|
+
content: string;
|
|
82
|
+
at: string;
|
|
83
|
+
} | {
|
|
84
|
+
type: "tool_call";
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
args: unknown;
|
|
88
|
+
at: string;
|
|
89
|
+
} | {
|
|
90
|
+
type: "tool_result";
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
ok: boolean;
|
|
94
|
+
output: string;
|
|
95
|
+
errorCode?: string;
|
|
96
|
+
retryable?: boolean;
|
|
97
|
+
at: string;
|
|
98
|
+
} | {
|
|
99
|
+
type: "usage";
|
|
100
|
+
usage: ProviderUsage;
|
|
101
|
+
at: string;
|
|
102
|
+
} | {
|
|
103
|
+
type: "subagent_start";
|
|
104
|
+
id: string;
|
|
105
|
+
role: string;
|
|
106
|
+
goal: string;
|
|
107
|
+
at: string;
|
|
108
|
+
} | {
|
|
109
|
+
type: "subagent_result";
|
|
110
|
+
id: string;
|
|
111
|
+
role: string;
|
|
112
|
+
status: string;
|
|
113
|
+
summary: string;
|
|
114
|
+
at: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: "final";
|
|
117
|
+
content: string;
|
|
118
|
+
at: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: "error";
|
|
121
|
+
message: string;
|
|
122
|
+
code?: string;
|
|
123
|
+
retryable?: boolean;
|
|
124
|
+
at: string;
|
|
125
|
+
};
|
|
126
|
+
export interface CodaliRuntimeInput {
|
|
127
|
+
task: string;
|
|
128
|
+
messages?: ProviderMessage[];
|
|
129
|
+
workspace: CodaliRuntimeWorkspace;
|
|
130
|
+
provider: CodaliRuntimeProviderInput;
|
|
131
|
+
agent?: CodaliRuntimeAgentInput;
|
|
132
|
+
docdex?: CodaliRuntimeDocdexInput;
|
|
133
|
+
policy: CodaliRuntimePolicy;
|
|
134
|
+
response?: {
|
|
135
|
+
format?: "text" | "json" | "json_schema" | "gbnf";
|
|
136
|
+
schema?: Record<string, unknown>;
|
|
137
|
+
grammar?: string;
|
|
138
|
+
};
|
|
139
|
+
streaming?: {
|
|
140
|
+
enabled: boolean;
|
|
141
|
+
flushEveryMs?: number;
|
|
142
|
+
};
|
|
143
|
+
metadata?: {
|
|
144
|
+
jobId?: string;
|
|
145
|
+
requestId?: string;
|
|
146
|
+
tenantId?: string;
|
|
147
|
+
ownerUserId?: string;
|
|
148
|
+
apiKeyId?: string;
|
|
149
|
+
agentSlug?: string;
|
|
150
|
+
};
|
|
151
|
+
subagents?: CodaliRuntimeSubagentsInput;
|
|
152
|
+
session?: CodaliRuntimeSessionInput;
|
|
153
|
+
onEvent?: (event: CodaliRuntimeEvent) => void | Promise<void>;
|
|
154
|
+
providerInstance?: Provider;
|
|
155
|
+
toolRegistry?: ToolRegistry;
|
|
156
|
+
tools?: ToolDefinition[];
|
|
157
|
+
toolContext?: Partial<ToolContext>;
|
|
158
|
+
logger?: RunLogger;
|
|
159
|
+
}
|
|
160
|
+
export interface CodaliOpenAIChunkOptions {
|
|
161
|
+
id?: string;
|
|
162
|
+
requestId?: string;
|
|
163
|
+
model: string;
|
|
164
|
+
created?: number;
|
|
165
|
+
includeInternalEvents?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface CodaliRuntimeResult {
|
|
168
|
+
finalMessage: string;
|
|
169
|
+
messages: ProviderMessage[];
|
|
170
|
+
toolCallsExecuted: number;
|
|
171
|
+
usage?: ProviderUsage;
|
|
172
|
+
touchedFiles: string[];
|
|
173
|
+
warnings: string[];
|
|
174
|
+
events: CodaliRuntimeEvent[];
|
|
175
|
+
runId: string;
|
|
176
|
+
session?: {
|
|
177
|
+
id: string;
|
|
178
|
+
summaryRefs: string[];
|
|
179
|
+
instructionSources: string[];
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export declare const codaliEventToOpenAIChatCompletionChunk: (event: CodaliRuntimeEvent, options: CodaliOpenAIChunkOptions) => Record<string, unknown> | null;
|
|
183
|
+
export declare const codaliEventToOpenAISseData: (event: CodaliRuntimeEvent, options: CodaliOpenAIChunkOptions) => string | null;
|
|
184
|
+
export interface CodaliRuntime {
|
|
185
|
+
run(): Promise<CodaliRuntimeResult>;
|
|
186
|
+
}
|
|
187
|
+
export declare const createCodaliRuntime: (input: CodaliRuntimeInput) => CodaliRuntime;
|
|
188
|
+
export declare const runCodaliTask: (input: CodaliRuntimeInput) => Promise<CodaliRuntimeResult>;
|
|
189
|
+
//# sourceMappingURL=CodaliRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodaliRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/CodaliRuntime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EAER,eAAe,EAEf,aAAa,EACd,MAAM,+BAA+B,CAAC;AAWvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAS9F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,mBAAmB,GAAG,eAAe,GAAG,WAAW,GAAG,MAAM,CAAC;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CA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