infinicode 1.0.0 → 2.0.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.
- package/.opencode/plugins/home-logo-animation.tsx +120 -0
- package/.opencode/plugins/routing-mode-display.tsx +135 -0
- package/.opencode/themes/infinibot-gold.json +222 -0
- package/.opencode/tui.json +8 -0
- package/README.md +527 -75
- package/dist/ascii-video-animation.d.ts +2 -0
- package/dist/ascii-video-animation.js +243 -0
- package/dist/cli.js +195 -50
- package/dist/commands/console.d.ts +6 -0
- package/dist/commands/console.js +111 -0
- package/dist/commands/kernel-setup.d.ts +3 -0
- package/dist/commands/kernel-setup.js +303 -0
- package/dist/commands/mcp.d.ts +12 -0
- package/dist/commands/mcp.js +96 -0
- package/dist/commands/mission.d.ts +16 -0
- package/dist/commands/mission.js +301 -0
- package/dist/commands/models.d.ts +3 -1
- package/dist/commands/models.js +111 -55
- package/dist/commands/providers.d.ts +6 -0
- package/dist/commands/providers.js +95 -0
- package/dist/commands/run.d.ts +2 -1
- package/dist/commands/run.js +349 -59
- package/dist/commands/serve.d.ts +18 -0
- package/dist/commands/serve.js +127 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +77 -44
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +46 -30
- package/dist/commands/workers.d.ts +5 -0
- package/dist/commands/workers.js +103 -0
- package/dist/kernel/autonomy/goal-loop.d.ts +49 -0
- package/dist/kernel/autonomy/goal-loop.js +113 -0
- package/dist/kernel/autonomy/index.d.ts +8 -0
- package/dist/kernel/autonomy/index.js +7 -0
- package/dist/kernel/browser/browser-controller.d.ts +57 -0
- package/dist/kernel/browser/browser-controller.js +175 -0
- package/dist/kernel/checkpoint-engine.d.ts +17 -0
- package/dist/kernel/checkpoint-engine.js +128 -0
- package/dist/kernel/command-system.d.ts +37 -0
- package/dist/kernel/command-system.js +239 -0
- package/dist/kernel/config-schema.d.ts +53 -0
- package/dist/kernel/config-schema.js +36 -0
- package/dist/kernel/event-bus.d.ts +19 -0
- package/dist/kernel/event-bus.js +65 -0
- package/dist/kernel/federation/auto-update.d.ts +36 -0
- package/dist/kernel/federation/auto-update.js +57 -0
- package/dist/kernel/federation/compute-router.d.ts +27 -0
- package/dist/kernel/federation/compute-router.js +44 -0
- package/dist/kernel/federation/config-sync.d.ts +33 -0
- package/dist/kernel/federation/config-sync.js +37 -0
- package/dist/kernel/federation/discovery.d.ts +11 -0
- package/dist/kernel/federation/discovery.js +44 -0
- package/dist/kernel/federation/event-bridge.d.ts +30 -0
- package/dist/kernel/federation/event-bridge.js +61 -0
- package/dist/kernel/federation/federation-plugin.d.ts +24 -0
- package/dist/kernel/federation/federation-plugin.js +35 -0
- package/dist/kernel/federation/federation.d.ts +126 -0
- package/dist/kernel/federation/federation.js +335 -0
- package/dist/kernel/federation/index.d.ts +31 -0
- package/dist/kernel/federation/index.js +23 -0
- package/dist/kernel/federation/moltfed-adapter.d.ts +30 -0
- package/dist/kernel/federation/moltfed-adapter.js +52 -0
- package/dist/kernel/federation/moltfed-connector.d.ts +98 -0
- package/dist/kernel/federation/moltfed-connector.js +193 -0
- package/dist/kernel/federation/node-identity.d.ts +19 -0
- package/dist/kernel/federation/node-identity.js +86 -0
- package/dist/kernel/federation/peer-mesh.d.ts +46 -0
- package/dist/kernel/federation/peer-mesh.js +117 -0
- package/dist/kernel/federation/protocol.d.ts +20 -0
- package/dist/kernel/federation/protocol.js +61 -0
- package/dist/kernel/federation/role-context.d.ts +5 -0
- package/dist/kernel/federation/role-context.js +45 -0
- package/dist/kernel/federation/telemetry.d.ts +21 -0
- package/dist/kernel/federation/telemetry.js +138 -0
- package/dist/kernel/federation/transport-http.d.ts +44 -0
- package/dist/kernel/federation/transport-http.js +207 -0
- package/dist/kernel/federation/types.d.ts +212 -0
- package/dist/kernel/federation/types.js +3 -0
- package/dist/kernel/free-providers.d.ts +28 -0
- package/dist/kernel/free-providers.js +162 -0
- package/dist/kernel/frontend-scoring.d.ts +21 -0
- package/dist/kernel/frontend-scoring.js +125 -0
- package/dist/kernel/index.d.ts +63 -0
- package/dist/kernel/index.js +45 -0
- package/dist/kernel/kernel.d.ts +75 -0
- package/dist/kernel/kernel.js +223 -0
- package/dist/kernel/logger.d.ts +18 -0
- package/dist/kernel/logger.js +26 -0
- package/dist/kernel/mcp/index.d.ts +9 -0
- package/dist/kernel/mcp/index.js +8 -0
- package/dist/kernel/mcp/mcp-server.d.ts +27 -0
- package/dist/kernel/mcp/mcp-server.js +178 -0
- package/dist/kernel/mission-engine.d.ts +42 -0
- package/dist/kernel/mission-engine.js +160 -0
- package/dist/kernel/orchestrator.d.ts +51 -0
- package/dist/kernel/orchestrator.js +226 -0
- package/dist/kernel/plugin-manager.d.ts +28 -0
- package/dist/kernel/plugin-manager.js +76 -0
- package/dist/kernel/plugins/browser-plugin.d.ts +22 -0
- package/dist/kernel/plugins/browser-plugin.js +34 -0
- package/dist/kernel/plugins/dashboard-plugin.d.ts +17 -0
- package/dist/kernel/plugins/dashboard-plugin.js +72 -0
- package/dist/kernel/plugins/discord-plugin.d.ts +11 -0
- package/dist/kernel/plugins/discord-plugin.js +35 -0
- package/dist/kernel/plugins/metrics-plugin.d.ts +33 -0
- package/dist/kernel/plugins/metrics-plugin.js +86 -0
- package/dist/kernel/plugins/search-plugin.d.ts +17 -0
- package/dist/kernel/plugins/search-plugin.js +20 -0
- package/dist/kernel/plugins/slack-plugin.d.ts +11 -0
- package/dist/kernel/plugins/slack-plugin.js +35 -0
- package/dist/kernel/plugins/telegram-plugin.d.ts +20 -0
- package/dist/kernel/plugins/telegram-plugin.js +122 -0
- package/dist/kernel/policies.d.ts +33 -0
- package/dist/kernel/policies.js +105 -0
- package/dist/kernel/provider-discovery.d.ts +41 -0
- package/dist/kernel/provider-discovery.js +179 -0
- package/dist/kernel/provider-manager.d.ts +38 -0
- package/dist/kernel/provider-manager.js +206 -0
- package/dist/kernel/provider-url.d.ts +18 -0
- package/dist/kernel/provider-url.js +45 -0
- package/dist/kernel/providers/gemini-provider.d.ts +43 -0
- package/dist/kernel/providers/gemini-provider.js +203 -0
- package/dist/kernel/providers/ollama-provider.d.ts +44 -0
- package/dist/kernel/providers/ollama-provider.js +241 -0
- package/dist/kernel/providers/openai-compatible-provider.d.ts +43 -0
- package/dist/kernel/providers/openai-compatible-provider.js +233 -0
- package/dist/kernel/recovery-manager.d.ts +38 -0
- package/dist/kernel/recovery-manager.js +156 -0
- package/dist/kernel/router.d.ts +44 -0
- package/dist/kernel/router.js +222 -0
- package/dist/kernel/sample-missions.d.ts +11 -0
- package/dist/kernel/sample-missions.js +132 -0
- package/dist/kernel/scheduler.d.ts +30 -0
- package/dist/kernel/scheduler.js +147 -0
- package/dist/kernel/sdk/harness-sdk.d.ts +37 -0
- package/dist/kernel/sdk/harness-sdk.js +48 -0
- package/dist/kernel/sdk/plugin-sdk.d.ts +27 -0
- package/dist/kernel/sdk/plugin-sdk.js +40 -0
- package/dist/kernel/search/search-controller.d.ts +32 -0
- package/dist/kernel/search/search-controller.js +141 -0
- package/dist/kernel/setup.d.ts +13 -0
- package/dist/kernel/setup.js +59 -0
- package/dist/kernel/types.d.ts +479 -0
- package/dist/kernel/types.js +7 -0
- package/dist/kernel/verification-engine.d.ts +33 -0
- package/dist/kernel/verification-engine.js +287 -0
- package/dist/kernel/worker-runtime.d.ts +66 -0
- package/dist/kernel/worker-runtime.js +261 -0
- package/dist/kernel/workers/browser-worker.d.ts +6 -0
- package/dist/kernel/workers/browser-worker.js +92 -0
- package/dist/kernel/workers/builtin-workers.d.ts +20 -0
- package/dist/kernel/workers/builtin-workers.js +120 -0
- package/dist/kernel/workers/research-worker.d.ts +5 -0
- package/dist/kernel/workers/research-worker.js +90 -0
- package/dist/prompt-ascii-video-animation.d.ts +2 -0
- package/dist/prompt-ascii-video-animation.js +243 -0
- package/package.json +43 -9
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export const FREE_PROVIDERS = [
|
|
2
|
+
{
|
|
3
|
+
id: 'groq',
|
|
4
|
+
name: 'Groq',
|
|
5
|
+
baseURL: 'https://api.groq.com/openai',
|
|
6
|
+
keyUrl: 'https://console.groq.com/keys',
|
|
7
|
+
free: true,
|
|
8
|
+
recommended: {
|
|
9
|
+
coding: ['llama-3.3-70b-versatile', 'qwen-2.5-coder-32b'],
|
|
10
|
+
research: ['llama-3.3-70b-versatile'],
|
|
11
|
+
architecture: ['llama-3.3-70b-versatile'],
|
|
12
|
+
review: ['llama-3.3-70b-versatile'],
|
|
13
|
+
documentation: ['llama-3.3-70b-versatile', 'llama-3.1-8b-instant'],
|
|
14
|
+
translation: ['llama-3.3-70b-versatile'],
|
|
15
|
+
terminal: ['llama-3.3-70b-versatile'],
|
|
16
|
+
verification: ['llama-3.3-70b-versatile'],
|
|
17
|
+
},
|
|
18
|
+
knownModels: [
|
|
19
|
+
// maxRequestTokens ≈ free-tier TPM — far below context window; a request
|
|
20
|
+
// over this is rejected ("request too large") even though ctx is 128k.
|
|
21
|
+
{ id: 'llama-3.3-70b-versatile', name: 'Llama 3.3 70B', contextLength: 128_000, maxRequestTokens: 12_000, capabilities: ['reasoning', 'coding'], supportsFunctionCalling: true },
|
|
22
|
+
{ id: 'llama-3.1-8b-instant', name: 'Llama 3.1 8B Instant', contextLength: 128_000, maxRequestTokens: 6_000, capabilities: ['reasoning'], supportsFunctionCalling: true },
|
|
23
|
+
{ id: 'qwen-2.5-coder-32b', name: 'Qwen 2.5 Coder 32B', contextLength: 128_000, maxRequestTokens: 12_000, capabilities: ['coding', 'reasoning'], supportsFunctionCalling: true },
|
|
24
|
+
{ id: 'mixtral-8x7b-32768', name: 'Mixtral 8x7B', contextLength: 32_768, maxRequestTokens: 5_000, capabilities: ['reasoning'], supportsFunctionCalling: true },
|
|
25
|
+
],
|
|
26
|
+
notes: 'Fastest cloud inference. Free tier has low per-minute token limits (small requests only).',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'openrouter',
|
|
30
|
+
name: 'OpenRouter',
|
|
31
|
+
baseURL: 'https://openrouter.ai/api/v1',
|
|
32
|
+
keyUrl: 'https://openrouter.ai/keys',
|
|
33
|
+
free: true,
|
|
34
|
+
recommended: {
|
|
35
|
+
coding: ['qwen/qwen2.5-coder-32b-instruct:free', 'deepseek/deepseek-coder-v2:free'],
|
|
36
|
+
research: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
37
|
+
architecture: ['meta-llama/llama-3.3-70b-instruct:free', 'deepseek/deepseek-r1:free'],
|
|
38
|
+
review: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
39
|
+
documentation: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
40
|
+
translation: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
41
|
+
terminal: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
42
|
+
verification: ['meta-llama/llama-3.3-70b-instruct:free'],
|
|
43
|
+
vision: ['meta-llama/llama-3.2-90b-vision-instruct:free'],
|
|
44
|
+
},
|
|
45
|
+
knownModels: [
|
|
46
|
+
{ id: 'qwen/qwen2.5-coder-32b-instruct:free', name: 'Qwen 2.5 Coder 32B (free)', contextLength: 32_768, capabilities: ['coding', 'reasoning'] },
|
|
47
|
+
{ id: 'deepseek/deepseek-coder-v2:free', name: 'DeepSeek Coder V2 (free)', contextLength: 128_000, capabilities: ['coding', 'reasoning'] },
|
|
48
|
+
{ id: 'meta-llama/llama-3.3-70b-instruct:free', name: 'Llama 3.3 70B (free)', contextLength: 65_536, capabilities: ['reasoning'] },
|
|
49
|
+
{ id: 'deepseek/deepseek-r1:free', name: 'DeepSeek R1 (free)', contextLength: 128_000, capabilities: ['reasoning'] },
|
|
50
|
+
{ id: 'meta-llama/llama-3.2-90b-vision-instruct:free', name: 'Llama 3.2 90B Vision (free)', contextLength: 131_072, capabilities: ['vision', 'reasoning'], supportsVision: true },
|
|
51
|
+
],
|
|
52
|
+
notes: 'Aggregator — many free variants of leading models. Best variety for rotation.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'github',
|
|
56
|
+
name: 'GitHub Models',
|
|
57
|
+
baseURL: 'https://models.inference.ai.azure.com',
|
|
58
|
+
keyUrl: 'https://github.com/settings/tokens',
|
|
59
|
+
free: true,
|
|
60
|
+
recommended: {
|
|
61
|
+
coding: ['gpt-4o-mini', 'Mistral-large'],
|
|
62
|
+
research: ['gpt-4o-mini', 'Llama-3.3-70B-Instruct'],
|
|
63
|
+
architecture: ['gpt-4o', 'Llama-3.3-70B-Instruct'],
|
|
64
|
+
review: ['gpt-4o-mini'],
|
|
65
|
+
documentation: ['gpt-4o-mini'],
|
|
66
|
+
translation: ['gpt-4o-mini'],
|
|
67
|
+
terminal: ['gpt-4o-mini'],
|
|
68
|
+
verification: ['gpt-4o'],
|
|
69
|
+
vision: ['gpt-4o'],
|
|
70
|
+
},
|
|
71
|
+
knownModels: [
|
|
72
|
+
// GitHub Models free tier caps request size well below the context window.
|
|
73
|
+
{ id: 'gpt-4o', name: 'GPT-4o', contextLength: 128_000, maxRequestTokens: 8_000, capabilities: ['reasoning', 'coding', 'vision'], supportsVision: true },
|
|
74
|
+
{ id: 'gpt-4o-mini', name: 'GPT-4o mini', contextLength: 128_000, maxRequestTokens: 8_000, capabilities: ['reasoning', 'coding', 'vision'], supportsVision: true },
|
|
75
|
+
{ id: 'Mistral-large', name: 'Mistral Large', contextLength: 131_072, maxRequestTokens: 8_000, capabilities: ['reasoning', 'coding'] },
|
|
76
|
+
{ id: 'Llama-3.3-70B-Instruct', name: 'Llama 3.3 70B', contextLength: 131_072, capabilities: ['reasoning', 'coding'] },
|
|
77
|
+
],
|
|
78
|
+
notes: 'Use a GitHub Personal Access Token (no scopes needed). Free while in preview.',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'nvidia',
|
|
82
|
+
name: 'NVIDIA NIM',
|
|
83
|
+
baseURL: 'https://integrate.api.nvidia.com/v1',
|
|
84
|
+
keyUrl: 'https://build.nvidia.com',
|
|
85
|
+
free: true,
|
|
86
|
+
recommended: {
|
|
87
|
+
coding: ['qwen/qwen2.5-coder-32b-instruct', 'deepseek-ai/deepseek-coder-v2'],
|
|
88
|
+
research: ['meta/llama-3.3-70b-instruct'],
|
|
89
|
+
architecture: ['meta/llama-3.3-70b-instruct'],
|
|
90
|
+
review: ['meta/llama-3.3-70b-instruct'],
|
|
91
|
+
documentation: ['meta/llama-3.1-8b-instruct'],
|
|
92
|
+
translation: ['meta/llama-3.3-70b-instruct'],
|
|
93
|
+
terminal: ['meta/llama-3.1-8b-instruct'],
|
|
94
|
+
verification: ['meta/llama-3.3-70b-instruct'],
|
|
95
|
+
},
|
|
96
|
+
knownModels: [
|
|
97
|
+
{ id: 'meta/llama-3.3-70b-instruct', name: 'Llama 3.3 70B', contextLength: 256_000, capabilities: ['reasoning'] },
|
|
98
|
+
{ id: 'meta/llama-3.1-8b-instruct', name: 'Llama 3.1 8B', contextLength: 128_000, capabilities: ['reasoning'] },
|
|
99
|
+
{ id: 'qwen/qwen2.5-coder-32b-instruct', name: 'Qwen 2.5 Coder 32B', contextLength: 32_768, capabilities: ['coding', 'reasoning'] },
|
|
100
|
+
{ id: 'deepseek-ai/deepseek-coder-v2', name: 'DeepSeek Coder V2', contextLength: 128_000, capabilities: ['coding', 'reasoning'] },
|
|
101
|
+
],
|
|
102
|
+
notes: 'NVIDIA build.nvidia.com offers free NIM endpoints. 1000 req/month free tier.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'hf',
|
|
106
|
+
name: 'Hugging Face Inference',
|
|
107
|
+
// OpenAI-compatible router (the legacy api-inference.huggingface.co host no
|
|
108
|
+
// longer serves /v1/chat/completions).
|
|
109
|
+
baseURL: 'https://router.huggingface.co/v1',
|
|
110
|
+
keyUrl: 'https://huggingface.co/settings/tokens',
|
|
111
|
+
free: true,
|
|
112
|
+
recommended: {
|
|
113
|
+
coding: ['Qwen/Qwen2.5-Coder-32B-Instruct'],
|
|
114
|
+
research: ['meta-llama/Llama-3.3-70B-Instruct'],
|
|
115
|
+
documentation: ['meta-llama/Llama-3.1-8B-Instruct'],
|
|
116
|
+
translation: ['meta-llama/Llama-3.3-70B-Instruct'],
|
|
117
|
+
},
|
|
118
|
+
knownModels: [
|
|
119
|
+
{ id: 'Qwen/Qwen2.5-Coder-32B-Instruct', name: 'Qwen 2.5 Coder 32B', contextLength: 32_768, capabilities: ['coding', 'reasoning'] },
|
|
120
|
+
{ id: 'meta-llama/Llama-3.3-70B-Instruct', name: 'Llama 3.3 70B', contextLength: 131_072, capabilities: ['reasoning'] },
|
|
121
|
+
{ id: 'meta-llama/Llama-3.1-8B-Instruct', name: 'Llama 3.1 8B', contextLength: 128_000, capabilities: ['reasoning'] },
|
|
122
|
+
],
|
|
123
|
+
notes: 'HF Inference API. Free tier with rate limits. Best for fill-in coverage.',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'gemini',
|
|
127
|
+
name: 'Google Gemini',
|
|
128
|
+
baseURL: 'https://generativelanguage.googleapis.com/v1beta',
|
|
129
|
+
keyUrl: 'https://aistudio.google.com/app/apikey',
|
|
130
|
+
free: true,
|
|
131
|
+
recommended: {
|
|
132
|
+
coding: ['gemini-2.0-flash', 'gemini-1.5-pro'],
|
|
133
|
+
research: ['gemini-2.0-flash'],
|
|
134
|
+
architecture: ['gemini-1.5-pro'],
|
|
135
|
+
review: ['gemini-2.0-flash'],
|
|
136
|
+
documentation: ['gemini-2.0-flash'],
|
|
137
|
+
translation: ['gemini-2.0-flash'],
|
|
138
|
+
terminal: ['gemini-2.0-flash'],
|
|
139
|
+
verification: ['gemini-1.5-pro'],
|
|
140
|
+
vision: ['gemini-2.0-flash'],
|
|
141
|
+
},
|
|
142
|
+
knownModels: [
|
|
143
|
+
{ id: 'gemini-2.0-flash', name: 'Gemini 2.0 Flash', contextLength: 1_048_576, capabilities: ['reasoning', 'coding', 'vision'], supportsVision: true, supportsFunctionCalling: true },
|
|
144
|
+
{ id: 'gemini-1.5-pro', name: 'Gemini 1.5 Pro', contextLength: 2_097_152, capabilities: ['reasoning', 'coding', 'vision'], supportsVision: true, supportsFunctionCalling: true },
|
|
145
|
+
{ id: 'gemini-1.5-flash', name: 'Gemini 1.5 Flash', contextLength: 1_048_576, capabilities: ['reasoning', 'vision'], supportsVision: true, supportsFunctionCalling: true },
|
|
146
|
+
],
|
|
147
|
+
notes: 'Google Generative Language API. Free tier (15 RPM / 1500 RPD on Flash). Long context.',
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
export function getProviderPreset(id) {
|
|
151
|
+
return FREE_PROVIDERS.find(p => p.id === id);
|
|
152
|
+
}
|
|
153
|
+
export function toCloudProviderConfig(preset, apiKey) {
|
|
154
|
+
return {
|
|
155
|
+
id: preset.id,
|
|
156
|
+
name: preset.name,
|
|
157
|
+
baseURL: preset.baseURL,
|
|
158
|
+
apiKey: apiKey || undefined,
|
|
159
|
+
headerName: preset.headerName,
|
|
160
|
+
enabled: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenKernel — Frontend Quality Scoring
|
|
3
|
+
*
|
|
4
|
+
* A deterministic, reproducible rubric that scores generated frontend code
|
|
5
|
+
* (HTML/CSS/JS) 0–100 across the dimensions that make a frontend feel
|
|
6
|
+
* production-grade: design tokens, themes, component breadth, accessibility,
|
|
7
|
+
* responsiveness, animation, performance, and cleanliness (no placeholders,
|
|
8
|
+
* no banned frameworks).
|
|
9
|
+
*
|
|
10
|
+
* This is the reliable half of the hybrid scorer; the LLM judge adds the
|
|
11
|
+
* subjective visual/UX verdict on top. On a miss, `feedback` gives the next
|
|
12
|
+
* attempt concrete, targeted fixes so the recovery loop converges.
|
|
13
|
+
*/
|
|
14
|
+
import type { FrontendAcceptance, FrontendScore } from './types.js';
|
|
15
|
+
export declare const DEFAULT_FRONTEND_ACCEPTANCE: Required<Omit<FrontendAcceptance, 'bannedFrameworks'>> & {
|
|
16
|
+
bannedFrameworks: string[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Score frontend code against acceptance criteria. Pure and deterministic.
|
|
20
|
+
*/
|
|
21
|
+
export declare function scoreFrontend(code: string, acceptance?: FrontendAcceptance): FrontendScore;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export const DEFAULT_FRONTEND_ACCEPTANCE = {
|
|
2
|
+
threshold: 85,
|
|
3
|
+
minComponents: 40,
|
|
4
|
+
minThemes: 4,
|
|
5
|
+
minTokens: 40,
|
|
6
|
+
bannedFrameworks: ['react', 'vue', 'angular', 'tailwind', 'bootstrap', 'jquery', 'svelte'],
|
|
7
|
+
requireDesignTokens: true,
|
|
8
|
+
requireResponsive: true,
|
|
9
|
+
requireAnimation: true,
|
|
10
|
+
requireAccessibility: true,
|
|
11
|
+
noPlaceholders: true,
|
|
12
|
+
};
|
|
13
|
+
const PLACEHOLDER_PATTERNS = [
|
|
14
|
+
/\bTODO\b/i,
|
|
15
|
+
/\bFIXME\b/i,
|
|
16
|
+
/lorem\s+ipsum/i,
|
|
17
|
+
/placeholder\s+(?:text|content|here)/i,
|
|
18
|
+
/coming\s+soon/i,
|
|
19
|
+
/your\s+(?:content|text)\s+here/i,
|
|
20
|
+
/\bXXX\b/,
|
|
21
|
+
/\.\.\.\s*$/m, // trailing ellipsis lines (unfinished sections)
|
|
22
|
+
];
|
|
23
|
+
// Detect a real framework dependency, not an incidental word in prose.
|
|
24
|
+
function bannedFrameworkHits(code, banned) {
|
|
25
|
+
const lower = code.toLowerCase();
|
|
26
|
+
const hits = [];
|
|
27
|
+
for (const fw of banned) {
|
|
28
|
+
const patterns = [
|
|
29
|
+
new RegExp(`import[^;\\n]*['"\`][^'"\`]*${fw}[^'"\`]*['"\`]`, 'i'),
|
|
30
|
+
new RegExp(`from\\s+['"\`][^'"\`]*${fw}`, 'i'),
|
|
31
|
+
new RegExp(`(cdn|unpkg|jsdelivr)[^'"\`\\s]*${fw}`, 'i'),
|
|
32
|
+
new RegExp(`\\b${fw}\\.(min\\.)?(js|css)\\b`, 'i'),
|
|
33
|
+
];
|
|
34
|
+
// Tailwind is detectable by its utility classes even without an import.
|
|
35
|
+
if (fw === 'tailwind') {
|
|
36
|
+
patterns.push(/class\s*=\s*["'][^"']*\b(?:flex|grid|pt-\d|px-\d|text-(?:sm|lg|xl)|bg-\w+-\d{3})\b[^"']*\bhover:/i);
|
|
37
|
+
}
|
|
38
|
+
if (patterns.some(p => p.test(lower) || p.test(code)))
|
|
39
|
+
hits.push(fw);
|
|
40
|
+
}
|
|
41
|
+
return hits;
|
|
42
|
+
}
|
|
43
|
+
function distinct(re, code) {
|
|
44
|
+
const set = new Set();
|
|
45
|
+
let m;
|
|
46
|
+
const g = new RegExp(re.source, re.flags.includes('g') ? re.flags : re.flags + 'g');
|
|
47
|
+
while ((m = g.exec(code)) !== null) {
|
|
48
|
+
set.add((m[1] ?? m[0]).toLowerCase());
|
|
49
|
+
if (m.index === g.lastIndex)
|
|
50
|
+
g.lastIndex++;
|
|
51
|
+
}
|
|
52
|
+
return set.size;
|
|
53
|
+
}
|
|
54
|
+
function ratio(actual, target) {
|
|
55
|
+
if (target <= 0)
|
|
56
|
+
return 1;
|
|
57
|
+
return Math.max(0, Math.min(1, actual / target));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Score frontend code against acceptance criteria. Pure and deterministic.
|
|
61
|
+
*/
|
|
62
|
+
export function scoreFrontend(code, acceptance) {
|
|
63
|
+
const acc = { ...DEFAULT_FRONTEND_ACCEPTANCE, ...(acceptance ?? {}) };
|
|
64
|
+
const src = code ?? '';
|
|
65
|
+
const items = [];
|
|
66
|
+
const feedback = [];
|
|
67
|
+
const add = (name, weight, earnedRatio, detail, tip) => {
|
|
68
|
+
const earned = Math.round(weight * Math.max(0, Math.min(1, earnedRatio)) * 100) / 100;
|
|
69
|
+
items.push({ name, weight, earned, detail });
|
|
70
|
+
if (earnedRatio < 0.999 && tip)
|
|
71
|
+
feedback.push(tip);
|
|
72
|
+
};
|
|
73
|
+
// 1. Design tokens (CSS custom properties). 15
|
|
74
|
+
const tokens = distinct(/--[a-z][\w-]*/i, src);
|
|
75
|
+
add('design-tokens', 15, ratio(tokens, acc.minTokens), `${tokens} custom properties (target ${acc.minTokens})`, `Define more design tokens as CSS custom properties (--color-*, --space-*, --radius-*); found ${tokens}, need ~${acc.minTokens}.`);
|
|
76
|
+
// 2. Tokens actually used via var(). 5
|
|
77
|
+
const varUses = (src.match(/var\(\s*--/g) ?? []).length;
|
|
78
|
+
add('token-usage', 5, ratio(varUses, acc.minTokens), `${varUses} var(--…) usages`, `Consume tokens with var(--…) throughout components instead of hard-coded values.`);
|
|
79
|
+
// 3. Themes. 10
|
|
80
|
+
const themes = distinct(/\[data-theme=["']?([\w-]+)/i, src) + distinct(/\.theme-([\w-]+)/i, src);
|
|
81
|
+
add('themes', 10, ratio(themes, acc.minThemes), `${themes} theme selectors (target ${acc.minThemes})`, `Add more runtime themes via [data-theme="…"] blocks; found ${themes}, need ${acc.minThemes}.`);
|
|
82
|
+
// 4. Component breadth (distinct class selectors as a proxy). 15
|
|
83
|
+
const components = distinct(/\.([a-z][\w-]{2,})\s*(?=[.,:#\s{>])/i, src);
|
|
84
|
+
add('components', 15, ratio(components, acc.minComponents), `${components} distinct component classes (target ${acc.minComponents})`, `Increase reusable component coverage; ~${components} classes found, target ${acc.minComponents}.`);
|
|
85
|
+
// 5. Accessibility. 12
|
|
86
|
+
const a11ySignals = [
|
|
87
|
+
/\baria-[a-z]+=/i, /\brole=/i, /\balt=/i, /:focus-visible/i,
|
|
88
|
+
/<(nav|main|header|footer|section|button|label)\b/i, /tabindex=/i,
|
|
89
|
+
].filter(rx => rx.test(src)).length;
|
|
90
|
+
const a11y = a11ySignals / 6;
|
|
91
|
+
add('accessibility', 12, acc.requireAccessibility ? a11y : Math.max(a11y, 0.5), `${a11ySignals}/6 a11y signals`, `Improve accessibility: add ARIA attributes, roles, alt text, :focus-visible styles, and semantic elements.`);
|
|
92
|
+
// 6. Responsiveness. 8
|
|
93
|
+
const mediaQueries = (src.match(/@media/g) ?? []).length;
|
|
94
|
+
const fluid = /clamp\(|minmax\(|min\(|max\(/.test(src) ? 1 : 0;
|
|
95
|
+
const responsive = Math.min(1, mediaQueries / 3) * 0.7 + fluid * 0.3;
|
|
96
|
+
add('responsive', 8, acc.requireResponsive ? responsive : Math.max(responsive, 0.5), `${mediaQueries} @media, fluid=${!!fluid}`, `Add responsive breakpoints (@media) and fluid sizing (clamp/minmax).`);
|
|
97
|
+
// 7. Animation. 10
|
|
98
|
+
const keyframes = (src.match(/@keyframes/g) ?? []).length;
|
|
99
|
+
const transitions = /transition\s*:|animation\s*:/.test(src) ? 1 : 0;
|
|
100
|
+
const animation = Math.min(1, keyframes / 3) * 0.6 + transitions * 0.4;
|
|
101
|
+
add('animation', 10, acc.requireAnimation ? animation : Math.max(animation, 0.5), `${keyframes} @keyframes, transitions=${!!transitions}`, `Add an animation layer: @keyframes plus transition/animation on interactive states.`);
|
|
102
|
+
// 8. Performance hints. 5
|
|
103
|
+
const perfSignals = [
|
|
104
|
+
/will-change/i, /IntersectionObserver/i, /loading=["']lazy/i,
|
|
105
|
+
/requestAnimationFrame/i, /content-visibility/i,
|
|
106
|
+
].filter(rx => rx.test(src)).length;
|
|
107
|
+
add('performance', 5, Math.min(1, perfSignals / 3), `${perfSignals} perf hints`, `Add performance techniques: IntersectionObserver reveals, will-change, lazy loading, rAF-driven animation.`);
|
|
108
|
+
// 9. No placeholders (hard gate). 10
|
|
109
|
+
const placeholderHit = acc.noPlaceholders ? PLACEHOLDER_PATTERNS.find(p => p.test(src)) : undefined;
|
|
110
|
+
add('no-placeholders', 10, placeholderHit ? 0 : 1, placeholderHit ? `placeholder detected (${placeholderHit.source})` : 'no placeholders', `Remove placeholder/TODO/lorem content and finish every section with real content.`);
|
|
111
|
+
// 10. No banned frameworks (hard gate). 10
|
|
112
|
+
const fwHits = bannedFrameworkHits(src, acc.bannedFrameworks);
|
|
113
|
+
add('no-banned-frameworks', 10, fwHits.length ? 0 : 1, fwHits.length ? `banned framework(s): ${fwHits.join(', ')}` : 'framework-independent', `Remove framework dependencies (${fwHits.join(', ')}); build with vanilla HTML/CSS/JS only.`);
|
|
114
|
+
const score = Math.round(items.reduce((s, i) => s + i.earned, 0));
|
|
115
|
+
const threshold = acc.threshold;
|
|
116
|
+
// Hard gates: any placeholder or banned framework fails regardless of score.
|
|
117
|
+
const gateFailed = !!placeholderHit || fwHits.length > 0 || src.trim().length === 0;
|
|
118
|
+
const passed = !gateFailed && score >= threshold;
|
|
119
|
+
if (src.trim().length === 0)
|
|
120
|
+
feedback.unshift('Output is empty — produce the frontend code.');
|
|
121
|
+
if (!passed && feedback.length === 0) {
|
|
122
|
+
feedback.push(`Raise overall quality to reach ${threshold}/100 (currently ${score}).`);
|
|
123
|
+
}
|
|
124
|
+
return { score, passed, threshold, items, feedback };
|
|
125
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenKernel — Public API Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic AI execution kernel.
|
|
5
|
+
* Applications, harnesses, CLIs, bots all interact through this API.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export { Kernel, createKernel } from './kernel.js';
|
|
9
|
+
export type { KernelOptions } from './kernel.js';
|
|
10
|
+
export { EventBus } from './event-bus.js';
|
|
11
|
+
export { ProviderManager } from './provider-manager.js';
|
|
12
|
+
export { CapabilityRouter } from './router.js';
|
|
13
|
+
export { WorkerRuntime } from './worker-runtime.js';
|
|
14
|
+
export type { WorkerContext, WorkerExecuteFn, WorkerHandler } from './worker-runtime.js';
|
|
15
|
+
export { Scheduler } from './scheduler.js';
|
|
16
|
+
export { CheckpointEngine } from './checkpoint-engine.js';
|
|
17
|
+
export { MissionEngine } from './mission-engine.js';
|
|
18
|
+
export { Orchestrator } from './orchestrator.js';
|
|
19
|
+
export { PluginManager } from './plugin-manager.js';
|
|
20
|
+
export { PolicyEngine, PolicyPresets, POLICY_FACTORIES } from './policies.js';
|
|
21
|
+
export { VerificationEngine } from './verification-engine.js';
|
|
22
|
+
export type { VerificationEngineDeps } from './verification-engine.js';
|
|
23
|
+
export { RecoveryManager } from './recovery-manager.js';
|
|
24
|
+
export type { RecoveryManagerDeps, RecoveryContext } from './recovery-manager.js';
|
|
25
|
+
export { ConsoleLogger, SilentLogger } from './logger.js';
|
|
26
|
+
export { OllamaProvider } from './providers/ollama-provider.js';
|
|
27
|
+
export type { OllamaProviderOptions } from './providers/ollama-provider.js';
|
|
28
|
+
export { OpenAICompatibleProvider } from './providers/openai-compatible-provider.js';
|
|
29
|
+
export type { OpenAICompatibleOptions } from './providers/openai-compatible-provider.js';
|
|
30
|
+
export { GeminiProvider } from './providers/gemini-provider.js';
|
|
31
|
+
export type { GeminiProviderOptions } from './providers/gemini-provider.js';
|
|
32
|
+
export { ALL_BUILTIN_WORKERS, createResearchWorker, createCodingWorker, createArchitectureWorker, createReviewWorker, createDocumentationWorker, createTranslationWorker, createTerminalWorker, createVerificationWorker, createVisionWorker, createFrontendWorker, createBrowserWorker, } from './workers/builtin-workers.js';
|
|
33
|
+
export { KernelCommandRegistry, DEFAULT_COMMANDS } from './command-system.js';
|
|
34
|
+
export type { KernelCommand, CommandContext } from './command-system.js';
|
|
35
|
+
export * from './federation/index.js';
|
|
36
|
+
export { createMcpServer, serveMcpStdio } from './mcp/index.js';
|
|
37
|
+
export type { McpServerDeps } from './mcp/index.js';
|
|
38
|
+
export { GoalLoop } from './autonomy/index.js';
|
|
39
|
+
export type { Goal, GoalInput, GoalTrigger, GoalLoopDeps } from './autonomy/index.js';
|
|
40
|
+
export { scoreFrontend, DEFAULT_FRONTEND_ACCEPTANCE } from './frontend-scoring.js';
|
|
41
|
+
export { openAICompatBaseURL, openAICompatChatURL, openAICompatModelsURL } from './provider-url.js';
|
|
42
|
+
export { createTelegramPlugin } from './plugins/telegram-plugin.js';
|
|
43
|
+
export type { TelegramPluginOptions } from './plugins/telegram-plugin.js';
|
|
44
|
+
export { createDiscordPlugin } from './plugins/discord-plugin.js';
|
|
45
|
+
export type { DiscordPluginOptions } from './plugins/discord-plugin.js';
|
|
46
|
+
export { createSlackPlugin } from './plugins/slack-plugin.js';
|
|
47
|
+
export type { SlackPluginOptions } from './plugins/slack-plugin.js';
|
|
48
|
+
export { createBrowserPlugin } from './plugins/browser-plugin.js';
|
|
49
|
+
export type { BrowserPluginOptions } from './plugins/browser-plugin.js';
|
|
50
|
+
export { BrowserController } from './browser/browser-controller.js';
|
|
51
|
+
export type { BrowserAction, BrowserActionResult, BrowserControllerOptions } from './browser/browser-controller.js';
|
|
52
|
+
export { createSearchPlugin } from './plugins/search-plugin.js';
|
|
53
|
+
export type { SearchPluginOptions } from './plugins/search-plugin.js';
|
|
54
|
+
export { SearchController } from './search/search-controller.js';
|
|
55
|
+
export type { SearchOptions, SearchResult } from './search/search-controller.js';
|
|
56
|
+
export { createDashboardPlugin } from './plugins/dashboard-plugin.js';
|
|
57
|
+
export type { DashboardPluginOptions } from './plugins/dashboard-plugin.js';
|
|
58
|
+
export { createMetricsPlugin } from './plugins/metrics-plugin.js';
|
|
59
|
+
export type { MetricsSnapshot } from './plugins/metrics-plugin.js';
|
|
60
|
+
export { definePlugin } from './sdk/plugin-sdk.js';
|
|
61
|
+
export type { PluginBuilder } from './sdk/plugin-sdk.js';
|
|
62
|
+
export { mission, taskInput, browserTaskInput, researchTaskInput, frontendTaskInput } from './sdk/harness-sdk.js';
|
|
63
|
+
export type { MissionBuilder } from './sdk/harness-sdk.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenKernel — Public API Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic AI execution kernel.
|
|
5
|
+
* Applications, harnesses, CLIs, bots all interact through this API.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export { Kernel, createKernel } from './kernel.js';
|
|
9
|
+
export { EventBus } from './event-bus.js';
|
|
10
|
+
export { ProviderManager } from './provider-manager.js';
|
|
11
|
+
export { CapabilityRouter } from './router.js';
|
|
12
|
+
export { WorkerRuntime } from './worker-runtime.js';
|
|
13
|
+
export { Scheduler } from './scheduler.js';
|
|
14
|
+
export { CheckpointEngine } from './checkpoint-engine.js';
|
|
15
|
+
export { MissionEngine } from './mission-engine.js';
|
|
16
|
+
export { Orchestrator } from './orchestrator.js';
|
|
17
|
+
export { PluginManager } from './plugin-manager.js';
|
|
18
|
+
export { PolicyEngine, PolicyPresets, POLICY_FACTORIES } from './policies.js';
|
|
19
|
+
export { VerificationEngine } from './verification-engine.js';
|
|
20
|
+
export { RecoveryManager } from './recovery-manager.js';
|
|
21
|
+
export { ConsoleLogger, SilentLogger } from './logger.js';
|
|
22
|
+
export { OllamaProvider } from './providers/ollama-provider.js';
|
|
23
|
+
export { OpenAICompatibleProvider } from './providers/openai-compatible-provider.js';
|
|
24
|
+
export { GeminiProvider } from './providers/gemini-provider.js';
|
|
25
|
+
export { ALL_BUILTIN_WORKERS, createResearchWorker, createCodingWorker, createArchitectureWorker, createReviewWorker, createDocumentationWorker, createTranslationWorker, createTerminalWorker, createVerificationWorker, createVisionWorker, createFrontendWorker, createBrowserWorker, } from './workers/builtin-workers.js';
|
|
26
|
+
export { KernelCommandRegistry, DEFAULT_COMMANDS } from './command-system.js';
|
|
27
|
+
// Federation — neutral device mesh (peers, telemetry, config sync, MOLTFED interop)
|
|
28
|
+
export * from './federation/index.js';
|
|
29
|
+
// MCP — north-facing control surface (spawn/dispatch/role/voice/map over the mesh)
|
|
30
|
+
export { createMcpServer, serveMcpStdio } from './mcp/index.js';
|
|
31
|
+
// Autonomy — proactive unattended goal loop (interval/idle/once triggers)
|
|
32
|
+
export { GoalLoop } from './autonomy/index.js';
|
|
33
|
+
export { scoreFrontend, DEFAULT_FRONTEND_ACCEPTANCE } from './frontend-scoring.js';
|
|
34
|
+
export { openAICompatBaseURL, openAICompatChatURL, openAICompatModelsURL } from './provider-url.js';
|
|
35
|
+
export { createTelegramPlugin } from './plugins/telegram-plugin.js';
|
|
36
|
+
export { createDiscordPlugin } from './plugins/discord-plugin.js';
|
|
37
|
+
export { createSlackPlugin } from './plugins/slack-plugin.js';
|
|
38
|
+
export { createBrowserPlugin } from './plugins/browser-plugin.js';
|
|
39
|
+
export { BrowserController } from './browser/browser-controller.js';
|
|
40
|
+
export { createSearchPlugin } from './plugins/search-plugin.js';
|
|
41
|
+
export { SearchController } from './search/search-controller.js';
|
|
42
|
+
export { createDashboardPlugin } from './plugins/dashboard-plugin.js';
|
|
43
|
+
export { createMetricsPlugin } from './plugins/metrics-plugin.js';
|
|
44
|
+
export { definePlugin } from './sdk/plugin-sdk.js';
|
|
45
|
+
export { mission, taskInput, browserTaskInput, researchTaskInput, frontendTaskInput } from './sdk/harness-sdk.js';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenKernel — Public Kernel API
|
|
3
|
+
*
|
|
4
|
+
* kernel.execute() / pause() / resume() / cancel() / status()
|
|
5
|
+
* kernel.subscribe() / registerWorker() / registerProvider()
|
|
6
|
+
* kernel.registerPlugin() / registerPolicy()
|
|
7
|
+
*
|
|
8
|
+
* This is the single entry point. Harnesses, CLIs, n8n, bots all go through here.
|
|
9
|
+
*/
|
|
10
|
+
import { EventBus } from './event-bus.js';
|
|
11
|
+
import { ProviderManager } from './provider-manager.js';
|
|
12
|
+
import { CapabilityRouter } from './router.js';
|
|
13
|
+
import { WorkerRuntime } from './worker-runtime.js';
|
|
14
|
+
import { Scheduler } from './scheduler.js';
|
|
15
|
+
import { CheckpointEngine } from './checkpoint-engine.js';
|
|
16
|
+
import { MissionEngine } from './mission-engine.js';
|
|
17
|
+
import { Orchestrator } from './orchestrator.js';
|
|
18
|
+
import { PluginManager } from './plugin-manager.js';
|
|
19
|
+
import { PolicyEngine } from './policies.js';
|
|
20
|
+
import { VerificationEngine } from './verification-engine.js';
|
|
21
|
+
import { RecoveryManager } from './recovery-manager.js';
|
|
22
|
+
import { KernelCommandRegistry } from './command-system.js';
|
|
23
|
+
import type { CommandResult, EventHandler, KernelEvent, KernelEventType, KernelLike, Logger, Mission, MissionInput, Plugin, Policy, ProviderInterface, WorkerDefinition, MissionStatus } from './types.js';
|
|
24
|
+
export interface KernelOptions {
|
|
25
|
+
logger?: Logger;
|
|
26
|
+
storageDir?: string;
|
|
27
|
+
loadBuiltinWorkers?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class Kernel implements KernelLike {
|
|
30
|
+
readonly eventBus: EventBus;
|
|
31
|
+
readonly providerManager: ProviderManager;
|
|
32
|
+
readonly router: CapabilityRouter;
|
|
33
|
+
readonly workerRuntime: WorkerRuntime;
|
|
34
|
+
readonly scheduler: Scheduler;
|
|
35
|
+
readonly checkpoints: CheckpointEngine;
|
|
36
|
+
readonly missionEngine: MissionEngine;
|
|
37
|
+
readonly orchestrator: Orchestrator;
|
|
38
|
+
readonly plugins: PluginManager;
|
|
39
|
+
readonly policies: PolicyEngine;
|
|
40
|
+
readonly verification: VerificationEngine;
|
|
41
|
+
readonly recovery: RecoveryManager;
|
|
42
|
+
readonly logger: Logger;
|
|
43
|
+
/** Canonical OpenKernel slash-command surface (/status, /workers, /goal …). */
|
|
44
|
+
readonly commands: KernelCommandRegistry;
|
|
45
|
+
private missions;
|
|
46
|
+
constructor(options?: KernelOptions);
|
|
47
|
+
execute(input: MissionInput): Promise<Mission>;
|
|
48
|
+
pause(missionId: string): Promise<void>;
|
|
49
|
+
resume(missionId: string): Promise<Mission>;
|
|
50
|
+
cancel(missionId: string): Promise<void>;
|
|
51
|
+
status(missionId: string): Promise<MissionStatus>;
|
|
52
|
+
/**
|
|
53
|
+
* Execute a canonical OpenKernel slash-command (e.g. "/status", "/goal build X").
|
|
54
|
+
* The same registry backs the CLI console and the notification plugins.
|
|
55
|
+
*/
|
|
56
|
+
command(input: string): Promise<CommandResult>;
|
|
57
|
+
/** Reset a mission's failed/skipped tasks and re-run them. */
|
|
58
|
+
retry(missionId: string): Promise<Mission>;
|
|
59
|
+
subscribe(types: KernelEventType[], handler: EventHandler): () => void;
|
|
60
|
+
subscribeAll(handler: EventHandler): () => void;
|
|
61
|
+
registerWorker(definition: WorkerDefinition): void;
|
|
62
|
+
registerProvider(providerId: string, provider: ProviderInterface): void;
|
|
63
|
+
registerPlugin(plugin: Plugin): Promise<void>;
|
|
64
|
+
registerPolicy(policy: Policy): void;
|
|
65
|
+
/** Set the default policy used for routing when a mission doesn't specify one. */
|
|
66
|
+
setDefaultPolicy(name: Policy['name']): void;
|
|
67
|
+
getMission(missionId: string): Mission | undefined;
|
|
68
|
+
listMissions(): Mission[];
|
|
69
|
+
/** Emit a NOTIFICATION event that plugins (Telegram/Discord/Slack) can consume. */
|
|
70
|
+
notify(message: string, missionId?: string): void;
|
|
71
|
+
listPlugins(): Plugin[];
|
|
72
|
+
getEventHistory(): KernelEvent[];
|
|
73
|
+
destroy(): void;
|
|
74
|
+
}
|
|
75
|
+
export declare function createKernel(options?: KernelOptions): Kernel;
|