lastlight-shared 0.1.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/LICENSE +21 -0
- package/dist/config-types.d.ts +17 -0
- package/dist/config-types.js +8 -0
- package/dist/config-types.js.map +1 -0
- package/dist/core-pin.d.ts +16 -0
- package/dist/core-pin.js +85 -0
- package/dist/core-pin.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/oauth.d.ts +43 -0
- package/dist/oauth.js +103 -0
- package/dist/oauth.js.map +1 -0
- package/dist/overlay-assets.d.ts +20 -0
- package/dist/overlay-assets.js +114 -0
- package/dist/overlay-assets.js.map +1 -0
- package/dist/overlay-bootstrap.d.ts +44 -0
- package/dist/overlay-bootstrap.js +304 -0
- package/dist/overlay-bootstrap.js.map +1 -0
- package/dist/providers.d.ts +125 -0
- package/dist/providers.js +279 -0
- package/dist/providers.js.map +1 -0
- package/dist/workflow-loader.d.ts +53 -0
- package/dist/workflow-loader.js +421 -0
- package/dist/workflow-loader.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider registry — single source of truth for the LLM providers Last Light
|
|
3
|
+
* knows how to wire end-to-end.
|
|
4
|
+
*
|
|
5
|
+
* pi-ai (`@earendil-works/pi-ai`) is provider-agnostic and supports 15+
|
|
6
|
+
* providers out of the box. Of those, only a subset is "wizard-able" here:
|
|
7
|
+
* they authenticate with a single API-key env var and expose a stable
|
|
8
|
+
* endpoint reachable from the sandbox egress firewall. Excluded are the
|
|
9
|
+
* OAuth-only providers (`openai-codex`, `github-copilot`), the multi-env
|
|
10
|
+
* Ambient-cred ones (`amazon-bedrock`, `google-vertex`, `azure-openai-*`,
|
|
11
|
+
* `cloudflare-*`), and the regional-CN variants.
|
|
12
|
+
*
|
|
13
|
+
* This registry is consumed by:
|
|
14
|
+
* - `src/engine/llm.ts` — the cheap one-shot helper used by the
|
|
15
|
+
* prompt screener + intent classifier. It builds requests for the
|
|
16
|
+
* `openai-completions` family (which is most wizard-able providers —
|
|
17
|
+
* Google and Mistral are routed through their OpenAI-compatible
|
|
18
|
+
* endpoints) and the `anthropic-messages` family (Kimi for Coding,
|
|
19
|
+
* MiniMax, Anthropic itself).
|
|
20
|
+
* - `src/engine/agent-executor.ts` — forwards each provider's env var
|
|
21
|
+
* into the sandbox so agentic-pi can auth.
|
|
22
|
+
* - `src/sandbox/egress-allowlist.ts` — the SNI/firewall allowlist is
|
|
23
|
+
* seeded from each provider's `host`.
|
|
24
|
+
* - `src/cli/setup.ts` — the install wizard's step-4 provider picker.
|
|
25
|
+
*
|
|
26
|
+
* Keep this list aligned with pi-ai's provider registry. When pi-ai adds a
|
|
27
|
+
* new provider that we want to surface, add an entry here and everything
|
|
28
|
+
* else (forwarding, egress, wizard UI) follows automatically.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The registry. Order matters — `defaultFastModel()` in `llm.ts` selects
|
|
32
|
+
* a fast model by iterating this list and picking the first provider
|
|
33
|
+
* whose env var is present. Always keep Anthropic first (best raw-latency
|
|
34
|
+
* cheap helper) then OpenAI then OpenRouter, then the rest grouped by
|
|
35
|
+
* families so the array is easy to scan.
|
|
36
|
+
*/
|
|
37
|
+
export const PROVIDERS = [
|
|
38
|
+
// ── Anthropic-messages family ───────────────────────────────────────
|
|
39
|
+
{
|
|
40
|
+
prefix: "anthropic",
|
|
41
|
+
displayName: "Anthropic",
|
|
42
|
+
envKey: "ANTHROPIC_API_KEY",
|
|
43
|
+
baseUrl: "https://api.anthropic.com/v1",
|
|
44
|
+
api: "anthropic-messages",
|
|
45
|
+
host: "anthropic.com",
|
|
46
|
+
fastModel: "claude-haiku-4-5-20251001",
|
|
47
|
+
sampleModel: "claude-sonnet-4-6",
|
|
48
|
+
keyPrefix: "sk-ant-",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
prefix: "kimi-coding",
|
|
52
|
+
displayName: "Kimi for Coding (Moonshot)",
|
|
53
|
+
envKey: "KIMI_API_KEY",
|
|
54
|
+
baseUrl: "https://api.kimi.com/coding",
|
|
55
|
+
api: "anthropic-messages",
|
|
56
|
+
host: "kimi.com",
|
|
57
|
+
fastModel: "kimi-latest",
|
|
58
|
+
sampleModel: "kimi-latest",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
prefix: "minimax",
|
|
62
|
+
displayName: "MiniMax",
|
|
63
|
+
envKey: "MINIMAX_API_KEY",
|
|
64
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
65
|
+
api: "anthropic-messages",
|
|
66
|
+
host: "minimax.io",
|
|
67
|
+
fastModel: "MiniMax-M1",
|
|
68
|
+
sampleModel: "MiniMax-M2",
|
|
69
|
+
},
|
|
70
|
+
// ── OpenAI-completions family — first-party OpenAI ──────────────────
|
|
71
|
+
{
|
|
72
|
+
prefix: "openai",
|
|
73
|
+
displayName: "OpenAI",
|
|
74
|
+
envKey: "OPENAI_API_KEY",
|
|
75
|
+
baseUrl: "https://api.openai.com/v1",
|
|
76
|
+
api: "openai-completions",
|
|
77
|
+
host: "openai.com",
|
|
78
|
+
fastModel: "gpt-5.4-mini",
|
|
79
|
+
sampleModel: "gpt-5.5",
|
|
80
|
+
maxTokensField: "max_completion_tokens",
|
|
81
|
+
keyPrefix: "sk-",
|
|
82
|
+
},
|
|
83
|
+
// ── Google Gemini — routed through Google's OpenAI-compatible endpoint ──
|
|
84
|
+
{
|
|
85
|
+
prefix: "google",
|
|
86
|
+
displayName: "Google AI Studio (Gemini)",
|
|
87
|
+
envKey: "GEMINI_API_KEY",
|
|
88
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
89
|
+
api: "openai-completions",
|
|
90
|
+
host: "generativelanguage.googleapis.com",
|
|
91
|
+
fastModel: "gemini-2.5-flash",
|
|
92
|
+
sampleModel: "gemini-2.5-pro",
|
|
93
|
+
keyPrefix: "AIza",
|
|
94
|
+
},
|
|
95
|
+
// ── Mistral — Mistral exposes an OpenAI-compatible path ──────────────
|
|
96
|
+
{
|
|
97
|
+
prefix: "mistral",
|
|
98
|
+
displayName: "Mistral",
|
|
99
|
+
envKey: "MISTRAL_API_KEY",
|
|
100
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
101
|
+
api: "openai-completions",
|
|
102
|
+
host: "mistral.ai",
|
|
103
|
+
fastModel: "mistral-small-latest",
|
|
104
|
+
sampleModel: "mistral-large-latest",
|
|
105
|
+
},
|
|
106
|
+
// ── OpenAI-compatible inference specialists ──────────────────────────
|
|
107
|
+
{
|
|
108
|
+
prefix: "groq",
|
|
109
|
+
displayName: "Groq",
|
|
110
|
+
envKey: "GROQ_API_KEY",
|
|
111
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
112
|
+
api: "openai-completions",
|
|
113
|
+
host: "groq.com",
|
|
114
|
+
fastModel: "llama-3.3-70b-versatile",
|
|
115
|
+
sampleModel: "llama-3.3-70b-versatile",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
prefix: "cerebras",
|
|
119
|
+
displayName: "Cerebras",
|
|
120
|
+
envKey: "CEREBRAS_API_KEY",
|
|
121
|
+
baseUrl: "https://api.cerebras.ai/v1",
|
|
122
|
+
api: "openai-completions",
|
|
123
|
+
host: "cerebras.ai",
|
|
124
|
+
fastModel: "llama-3.3-70b",
|
|
125
|
+
sampleModel: "llama-3.3-70b",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
prefix: "xai",
|
|
129
|
+
displayName: "xAI (Grok)",
|
|
130
|
+
envKey: "XAI_API_KEY",
|
|
131
|
+
baseUrl: "https://api.x.ai/v1",
|
|
132
|
+
api: "openai-completions",
|
|
133
|
+
host: "x.ai",
|
|
134
|
+
fastModel: "grok-3-mini",
|
|
135
|
+
sampleModel: "grok-4",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
prefix: "huggingface",
|
|
139
|
+
displayName: "Hugging Face",
|
|
140
|
+
envKey: "HF_TOKEN",
|
|
141
|
+
baseUrl: "https://router.huggingface.co/v1",
|
|
142
|
+
api: "openai-completions",
|
|
143
|
+
host: "huggingface.co",
|
|
144
|
+
fastModel: "meta-llama/Llama-3.3-70B-Instruct",
|
|
145
|
+
sampleModel: "meta-llama/Llama-3.3-70B-Instruct",
|
|
146
|
+
keyPrefix: "hf_",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
prefix: "moonshotai",
|
|
150
|
+
displayName: "Moonshot AI",
|
|
151
|
+
envKey: "MOONSHOT_API_KEY",
|
|
152
|
+
baseUrl: "https://api.moonshot.ai/v1",
|
|
153
|
+
api: "openai-completions",
|
|
154
|
+
host: "moonshot.ai",
|
|
155
|
+
fastModel: "kimi-k2",
|
|
156
|
+
sampleModel: "kimi-k2",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
prefix: "nvidia",
|
|
160
|
+
displayName: "NVIDIA NIM",
|
|
161
|
+
envKey: "NVIDIA_API_KEY",
|
|
162
|
+
baseUrl: "https://integrate.api.nvidia.com/v1",
|
|
163
|
+
api: "openai-completions",
|
|
164
|
+
host: "integrate.api.nvidia.com",
|
|
165
|
+
fastModel: "meta/llama-3.3-70b-instruct",
|
|
166
|
+
sampleModel: "meta/llama-3.3-70b-instruct",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
prefix: "fireworks",
|
|
170
|
+
displayName: "Fireworks",
|
|
171
|
+
envKey: "FIREWORKS_API_KEY",
|
|
172
|
+
baseUrl: "https://api.fireworks.ai/inference/v1",
|
|
173
|
+
api: "openai-completions",
|
|
174
|
+
host: "fireworks.ai",
|
|
175
|
+
fastModel: "accounts/fireworks/models/llama-v3p3-70b-instruct",
|
|
176
|
+
sampleModel: "accounts/fireworks/models/llama-v3p3-70b-instruct",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
prefix: "together",
|
|
180
|
+
displayName: "Together",
|
|
181
|
+
envKey: "TOGETHER_API_KEY",
|
|
182
|
+
baseUrl: "https://api.together.ai/v1",
|
|
183
|
+
api: "openai-completions",
|
|
184
|
+
host: "together.ai",
|
|
185
|
+
fastModel: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
186
|
+
sampleModel: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
prefix: "deepseek",
|
|
190
|
+
displayName: "DeepSeek",
|
|
191
|
+
envKey: "DEEPSEEK_API_KEY",
|
|
192
|
+
baseUrl: "https://api.deepseek.com/v1",
|
|
193
|
+
api: "openai-completions",
|
|
194
|
+
host: "deepseek.com",
|
|
195
|
+
fastModel: "deepseek-chat",
|
|
196
|
+
sampleModel: "deepseek-chat",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
prefix: "zai",
|
|
200
|
+
displayName: "Z.AI (GLM)",
|
|
201
|
+
envKey: "ZAI_API_KEY",
|
|
202
|
+
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
203
|
+
api: "openai-completions",
|
|
204
|
+
host: "z.ai",
|
|
205
|
+
fastModel: "glm-4.6",
|
|
206
|
+
sampleModel: "glm-4.6",
|
|
207
|
+
},
|
|
208
|
+
// ── OpenRouter — aggregator (take any pi.dev-listed model via one key) ──
|
|
209
|
+
{
|
|
210
|
+
prefix: "openrouter",
|
|
211
|
+
displayName: "OpenRouter (aggregator — Anthropic, Google, xAI, …)",
|
|
212
|
+
envKey: "OPENROUTER_API_KEY",
|
|
213
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
214
|
+
api: "openai-completions",
|
|
215
|
+
host: "openrouter.ai",
|
|
216
|
+
fastModel: "google/gemini-2.5-flash",
|
|
217
|
+
sampleModel: "anthropic/claude-sonnet-4.5",
|
|
218
|
+
preserveNestedModelId: true,
|
|
219
|
+
extraHeaders: {
|
|
220
|
+
"HTTP-Referer": "https://github.com/nearform/lastlight",
|
|
221
|
+
"X-Title": "Last Light",
|
|
222
|
+
},
|
|
223
|
+
keyPrefix: "sk-or-",
|
|
224
|
+
},
|
|
225
|
+
];
|
|
226
|
+
const PREFIX_INDEX = new Map(PROVIDERS.map((p) => [p.prefix, p]));
|
|
227
|
+
const ENV_INDEX = new Map(PROVIDERS.map((p) => [p.envKey, p]));
|
|
228
|
+
export function providerByPrefix(prefix) {
|
|
229
|
+
return PREFIX_INDEX.get(prefix.toLowerCase());
|
|
230
|
+
}
|
|
231
|
+
export function providerByEnvKey(envKey) {
|
|
232
|
+
return ENV_INDEX.get(envKey);
|
|
233
|
+
}
|
|
234
|
+
/** All the env var names a harness must forward to reach every registered provider. */
|
|
235
|
+
export const PROVIDER_ENV_KEYS = PROVIDERS.map((p) => p.envKey);
|
|
236
|
+
/** All the hosts the sandbox egress firewall must allowlist to reach these providers. */
|
|
237
|
+
export const PROVIDER_HOSTS = PROVIDERS.map((p) => p.host);
|
|
238
|
+
/**
|
|
239
|
+
* Default model spec shipped with the harness. Keep aligned with the
|
|
240
|
+
* `OPENCODE_MODEL` default in `config/default.yaml` and the wizard's
|
|
241
|
+
* initial provider selection.
|
|
242
|
+
*/
|
|
243
|
+
export const DEFAULT_PROVIDER = "anthropic";
|
|
244
|
+
export const DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
245
|
+
export const OAUTH_PROVIDERS = [
|
|
246
|
+
{
|
|
247
|
+
id: "openai-codex",
|
|
248
|
+
displayName: "ChatGPT Plus/Pro (Codex)",
|
|
249
|
+
modelPrefix: "openai-codex",
|
|
250
|
+
sampleModel: "openai-codex/gpt-5.4",
|
|
251
|
+
sandboxEnvVar: null, // chatgpt.com backend — no env route, chat-only
|
|
252
|
+
oauthOnly: true,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "anthropic",
|
|
256
|
+
displayName: "Anthropic (Claude Pro/Max)",
|
|
257
|
+
modelPrefix: "anthropic",
|
|
258
|
+
sampleModel: "anthropic/claude-sonnet-4-6",
|
|
259
|
+
sandboxEnvVar: "ANTHROPIC_OAUTH_TOKEN",
|
|
260
|
+
oauthOnly: false, // falls back to ANTHROPIC_API_KEY
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: "github-copilot",
|
|
264
|
+
displayName: "GitHub Copilot",
|
|
265
|
+
modelPrefix: "github-copilot",
|
|
266
|
+
sampleModel: "github-copilot/gpt-4o",
|
|
267
|
+
sandboxEnvVar: "COPILOT_GITHUB_TOKEN",
|
|
268
|
+
oauthOnly: true,
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
const OAUTH_PREFIX_INDEX = new Map(OAUTH_PROVIDERS.map((p) => [p.modelPrefix, p]));
|
|
272
|
+
const OAUTH_ID_INDEX = new Map(OAUTH_PROVIDERS.map((p) => [p.id, p]));
|
|
273
|
+
export function oauthProviderByModelPrefix(prefix) {
|
|
274
|
+
return OAUTH_PREFIX_INDEX.get(prefix);
|
|
275
|
+
}
|
|
276
|
+
export function oauthProviderById(id) {
|
|
277
|
+
return OAUTH_ID_INDEX.get(id);
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA0CH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAA4B;IAChD,uEAAuE;IACvE;QACE,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,WAAW;QACxB,MAAM,EAAE,mBAAmB;QAC3B,OAAO,EAAE,8BAA8B;QACvC,GAAG,EAAE,oBAAoB;QACzB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,2BAA2B;QACtC,WAAW,EAAE,mBAAmB;QAChC,SAAS,EAAE,SAAS;KACrB;IACD;QACE,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,4BAA4B;QACzC,MAAM,EAAE,cAAc;QACtB,OAAO,EAAE,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AAS,EAAE,KAAK,EAAE,kCAAkC;KACrD;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE,uBAAuB;QACpC,aAAa,EAAE,sBAAsB;QACrC,SAAS,EAAE,IAAI;KAChB;CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAChC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAC/C,CAAC;AACF,MAAM,cAAc,GAAG,IAAI,GAAG,CAC5B,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACtC,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,MAAc;IACvD,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,OAAO,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type AgentWorkflowDefinition, type CronWorkflowDefinition } from "lastlight-workflow-engine";
|
|
2
|
+
import type { DisabledConfig, RouteConfig } from "./config-types.js";
|
|
3
|
+
export interface WorkflowAssetConfig {
|
|
4
|
+
builtInRoot?: string;
|
|
5
|
+
overlayRoot?: string;
|
|
6
|
+
disabled?: Partial<DisabledConfig>;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkflowOrigin {
|
|
9
|
+
layer: string;
|
|
10
|
+
filePath: string;
|
|
11
|
+
}
|
|
12
|
+
/** Configure ordered asset layers. Built-ins load first; overlay wins by logical name. */
|
|
13
|
+
export declare function configureWorkflowAssets(config?: WorkflowAssetConfig): void;
|
|
14
|
+
/** Legacy wrapper used by older tests to point directly at a workflow directory. */
|
|
15
|
+
export declare function setWorkflowDir(dir: string): void;
|
|
16
|
+
export declare function clearWorkflowCache(): void;
|
|
17
|
+
/** Monotonic counter bumped on every asset-layer reconfigure / cache clear. */
|
|
18
|
+
export declare function getAssetVersion(): number;
|
|
19
|
+
export declare function getWorkflow(name: string): AgentWorkflowDefinition;
|
|
20
|
+
export declare function getCronWorkflows(): CronWorkflowDefinition[];
|
|
21
|
+
export declare function listAgentWorkflows(): AgentWorkflowDefinition[];
|
|
22
|
+
/**
|
|
23
|
+
* The enabled workflow that claims a given classifier intent via its
|
|
24
|
+
* `classification.intent`, if any. Backs the router's data-driven fallback: an
|
|
25
|
+
* intent the router's bespoke switch doesn't handle routes to its owning
|
|
26
|
+
* workflow. Returns undefined for control intents and unclaimed tokens.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getWorkflowByIntent(intent: string): AgentWorkflowDefinition | undefined;
|
|
29
|
+
export declare function getWorkflowOrigin(name: string): WorkflowOrigin | undefined;
|
|
30
|
+
export declare function getCronWorkflowOrigin(name: string): WorkflowOrigin | undefined;
|
|
31
|
+
export declare function loadWorkflowYamlRaw(name: string): string;
|
|
32
|
+
export declare function loadPromptTemplate(relativePath: string): string;
|
|
33
|
+
export declare function resolvePromptPath(relativePath: string): string;
|
|
34
|
+
export declare function loadSkillRaw(name: string): string;
|
|
35
|
+
export declare function loadSkillInstructions(name: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve a list of skill names to their absolute directory paths.
|
|
38
|
+
* Each returned path is the skill folder root (containing `SKILL.md`
|
|
39
|
+
* plus any `scripts/`, `references/`, `assets/`) — not the .md file.
|
|
40
|
+
* The sandbox staging step in agent-executor uses these to symlink or
|
|
41
|
+
* copy the whole folder into the phase's bundle at
|
|
42
|
+
* `<workspaceRoot>/.lastlight-skills/<phase>/<name>/`.
|
|
43
|
+
* Layer-aware: overlay skills win over built-ins (same precedence and
|
|
44
|
+
* disabled-skill handling as `loadSkillRaw`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveSkillPaths(names: readonly string[]): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Concatenate resolved agent-context/*.md with overlay filename replacement.
|
|
49
|
+
* Later layers replace earlier files by basename; disabled.agentContext removes
|
|
50
|
+
* either exact filenames (rules.md) or stem names (rules).
|
|
51
|
+
*/
|
|
52
|
+
export declare function loadAgentContext(): string;
|
|
53
|
+
export declare function validateAssets(routes?: RouteConfig): void;
|