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,421 @@
|
|
|
1
|
+
import { readFileSync, existsSync, readdirSync, statSync } from "fs";
|
|
2
|
+
import { join, resolve, basename } from "path";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { AgentWorkflowSchema, CronWorkflowSchema, phaseSkillNames, intentToken, RESERVED_CONTROL_INTENTS, } from "lastlight-workflow-engine";
|
|
5
|
+
const DEFAULT_ROOT = resolve(".");
|
|
6
|
+
let layers = [makeLayer("built-in", DEFAULT_ROOT)];
|
|
7
|
+
let disabled = emptyDisabled();
|
|
8
|
+
const agentCache = new Map();
|
|
9
|
+
const cronCache = new Map();
|
|
10
|
+
const agentOrigins = new Map();
|
|
11
|
+
const cronOrigins = new Map();
|
|
12
|
+
let cachePopulated = false;
|
|
13
|
+
/**
|
|
14
|
+
* Bumped every time the asset layers change (reconfigure / cache clear). Lets
|
|
15
|
+
* downstream consumers that derive state from the workflow set — notably the
|
|
16
|
+
* classifier's composed prompt + intent vocabulary — cheaply detect staleness
|
|
17
|
+
* without a cross-layer import or a callback registry. Read via `getAssetVersion()`.
|
|
18
|
+
*/
|
|
19
|
+
let assetVersion = 0;
|
|
20
|
+
function emptyDisabled() {
|
|
21
|
+
return { workflows: [], crons: [], prompts: [], skills: [], agentContext: [] };
|
|
22
|
+
}
|
|
23
|
+
function mergeDisabled(value) {
|
|
24
|
+
return {
|
|
25
|
+
workflows: value?.workflows ?? [],
|
|
26
|
+
crons: value?.crons ?? [],
|
|
27
|
+
prompts: value?.prompts ?? [],
|
|
28
|
+
skills: value?.skills ?? [],
|
|
29
|
+
agentContext: value?.agentContext ?? [],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function existingDir(path) {
|
|
33
|
+
try {
|
|
34
|
+
return existsSync(path) && statSync(path).isDirectory();
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function makeLayer(name, rootOrWorkflowDir) {
|
|
41
|
+
const root = resolve(rootOrWorkflowDir);
|
|
42
|
+
const workflowRoot = join(root, "workflows");
|
|
43
|
+
return {
|
|
44
|
+
name,
|
|
45
|
+
root,
|
|
46
|
+
workflowRoot,
|
|
47
|
+
skillRoot: join(root, "skills"),
|
|
48
|
+
claudeSkillRoot: name === "built-in" || name === "legacy" ? join(root, ".claude/skills") : undefined,
|
|
49
|
+
agentContextRoot: join(root, "agent-context"),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Configure ordered asset layers. Built-ins load first; overlay wins by logical name. */
|
|
53
|
+
export function configureWorkflowAssets(config = {}) {
|
|
54
|
+
const builtInRoot = resolve(config.builtInRoot || DEFAULT_ROOT);
|
|
55
|
+
const next = [makeLayer("built-in", builtInRoot)];
|
|
56
|
+
if (config.overlayRoot)
|
|
57
|
+
next.push(makeLayer("overlay", config.overlayRoot));
|
|
58
|
+
layers = next;
|
|
59
|
+
disabled = mergeDisabled(config.disabled);
|
|
60
|
+
clearWorkflowCache();
|
|
61
|
+
}
|
|
62
|
+
/** Legacy wrapper used by older tests to point directly at a workflow directory. */
|
|
63
|
+
export function setWorkflowDir(dir) {
|
|
64
|
+
const workflowRoot = resolve(dir);
|
|
65
|
+
layers = [{
|
|
66
|
+
name: "legacy",
|
|
67
|
+
root: resolve("."),
|
|
68
|
+
workflowRoot,
|
|
69
|
+
skillRoot: resolve("skills"),
|
|
70
|
+
claudeSkillRoot: resolve(".claude/skills"),
|
|
71
|
+
agentContextRoot: resolve("agent-context"),
|
|
72
|
+
}];
|
|
73
|
+
disabled = emptyDisabled();
|
|
74
|
+
clearWorkflowCache();
|
|
75
|
+
}
|
|
76
|
+
export function clearWorkflowCache() {
|
|
77
|
+
agentCache.clear();
|
|
78
|
+
cronCache.clear();
|
|
79
|
+
agentOrigins.clear();
|
|
80
|
+
cronOrigins.clear();
|
|
81
|
+
cachePopulated = false;
|
|
82
|
+
assetVersion++;
|
|
83
|
+
}
|
|
84
|
+
/** Monotonic counter bumped on every asset-layer reconfigure / cache clear. */
|
|
85
|
+
export function getAssetVersion() {
|
|
86
|
+
return assetVersion;
|
|
87
|
+
}
|
|
88
|
+
function loadYamlFile(filePath) {
|
|
89
|
+
if (!existsSync(filePath))
|
|
90
|
+
throw new Error(`Workflow file not found: ${filePath}`);
|
|
91
|
+
const raw = readFileSync(filePath, "utf-8");
|
|
92
|
+
try {
|
|
93
|
+
return parseYaml(raw);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
97
|
+
throw new Error(`Failed to parse YAML in ${filePath}: ${msg}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function workflowFiles(dir) {
|
|
101
|
+
if (!existingDir(dir))
|
|
102
|
+
return [];
|
|
103
|
+
return readdirSync(dir)
|
|
104
|
+
.filter((f) => f.endsWith(".yaml") || f.endsWith(".yml"))
|
|
105
|
+
.sort();
|
|
106
|
+
}
|
|
107
|
+
function populateCache() {
|
|
108
|
+
if (cachePopulated)
|
|
109
|
+
return;
|
|
110
|
+
cachePopulated = true;
|
|
111
|
+
for (const layer of layers) {
|
|
112
|
+
const namesInLayer = new Set();
|
|
113
|
+
const cronNamesInLayer = new Set();
|
|
114
|
+
for (const file of workflowFiles(layer.workflowRoot)) {
|
|
115
|
+
const filePath = join(layer.workflowRoot, file);
|
|
116
|
+
const raw = loadYamlFile(filePath);
|
|
117
|
+
const kind = raw?.kind;
|
|
118
|
+
if (kind === "cron") {
|
|
119
|
+
const result = CronWorkflowSchema.safeParse(raw);
|
|
120
|
+
if (!result.success) {
|
|
121
|
+
throw new Error(`Invalid cron workflow in ${filePath}: ${JSON.stringify(result.error.format())}`);
|
|
122
|
+
}
|
|
123
|
+
if (cronNamesInLayer.has(result.data.name)) {
|
|
124
|
+
throw new Error(`Duplicate cron workflow name "${result.data.name}" in ${layer.name} layer`);
|
|
125
|
+
}
|
|
126
|
+
cronNamesInLayer.add(result.data.name);
|
|
127
|
+
if (!disabled.crons.includes(result.data.name) && !disabled.workflows.includes(result.data.workflow)) {
|
|
128
|
+
cronCache.set(result.data.name, result.data);
|
|
129
|
+
cronOrigins.set(result.data.name, { layer: layer.name, filePath });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const result = AgentWorkflowSchema.safeParse(raw);
|
|
134
|
+
if (!result.success) {
|
|
135
|
+
throw new Error(`Invalid workflow in ${filePath}: ${JSON.stringify(result.error.format())}`);
|
|
136
|
+
}
|
|
137
|
+
if (namesInLayer.has(result.data.name)) {
|
|
138
|
+
throw new Error(`Duplicate workflow name "${result.data.name}" in ${layer.name} layer`);
|
|
139
|
+
}
|
|
140
|
+
namesInLayer.add(result.data.name);
|
|
141
|
+
if (!disabled.workflows.includes(result.data.name)) {
|
|
142
|
+
agentCache.set(result.data.name, result.data);
|
|
143
|
+
agentOrigins.set(result.data.name, { layer: layer.name, filePath });
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
agentCache.delete(result.data.name);
|
|
147
|
+
agentOrigins.delete(result.data.name);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function getWorkflow(name) {
|
|
154
|
+
populateCache();
|
|
155
|
+
if (disabled.workflows.includes(name))
|
|
156
|
+
throw new Error(`Workflow is disabled: "${name}"`);
|
|
157
|
+
const cached = agentCache.get(name);
|
|
158
|
+
if (cached)
|
|
159
|
+
return cached;
|
|
160
|
+
throw new Error(`Workflow not found: "${name}" (looked in ${layers.map((l) => l.workflowRoot).join(", ")})`);
|
|
161
|
+
}
|
|
162
|
+
export function getCronWorkflows() {
|
|
163
|
+
populateCache();
|
|
164
|
+
return Array.from(cronCache.values());
|
|
165
|
+
}
|
|
166
|
+
export function listAgentWorkflows() {
|
|
167
|
+
populateCache();
|
|
168
|
+
return Array.from(agentCache.values());
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The enabled workflow that claims a given classifier intent via its
|
|
172
|
+
* `classification.intent`, if any. Backs the router's data-driven fallback: an
|
|
173
|
+
* intent the router's bespoke switch doesn't handle routes to its owning
|
|
174
|
+
* workflow. Returns undefined for control intents and unclaimed tokens.
|
|
175
|
+
*/
|
|
176
|
+
export function getWorkflowByIntent(intent) {
|
|
177
|
+
populateCache();
|
|
178
|
+
for (const def of agentCache.values()) {
|
|
179
|
+
if (def.classification?.intent === intent)
|
|
180
|
+
return def;
|
|
181
|
+
}
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
export function getWorkflowOrigin(name) {
|
|
185
|
+
populateCache();
|
|
186
|
+
return agentOrigins.get(name);
|
|
187
|
+
}
|
|
188
|
+
export function getCronWorkflowOrigin(name) {
|
|
189
|
+
populateCache();
|
|
190
|
+
return cronOrigins.get(name);
|
|
191
|
+
}
|
|
192
|
+
export function loadWorkflowYamlRaw(name) {
|
|
193
|
+
populateCache();
|
|
194
|
+
if (disabled.workflows.includes(name))
|
|
195
|
+
throw new Error(`Workflow is disabled: "${name}"`);
|
|
196
|
+
const origin = agentOrigins.get(name);
|
|
197
|
+
if (!origin)
|
|
198
|
+
throw new Error(`Workflow file not found for logical name: ${name}`);
|
|
199
|
+
return readFileSync(origin.filePath, "utf-8");
|
|
200
|
+
}
|
|
201
|
+
export function loadPromptTemplate(relativePath) {
|
|
202
|
+
const filePath = resolvePromptPath(relativePath);
|
|
203
|
+
return readFileSync(filePath, "utf-8");
|
|
204
|
+
}
|
|
205
|
+
function assertSafeRelative(relativePath, kind) {
|
|
206
|
+
if (!relativePath || relativePath.length === 0)
|
|
207
|
+
throw new Error(`${kind} path is empty`);
|
|
208
|
+
if (relativePath.startsWith("/") || relativePath.includes("\0")) {
|
|
209
|
+
throw new Error(`${kind} path is invalid: ${relativePath}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function isInside(filePath, root) {
|
|
213
|
+
const r = resolve(root);
|
|
214
|
+
const f = resolve(filePath);
|
|
215
|
+
return f === r || f.startsWith(r + "/");
|
|
216
|
+
}
|
|
217
|
+
export function resolvePromptPath(relativePath) {
|
|
218
|
+
assertSafeRelative(relativePath, "Prompt");
|
|
219
|
+
if (disabled.prompts.includes(relativePath) || disabled.prompts.includes(basename(relativePath))) {
|
|
220
|
+
throw new Error(`Prompt template is disabled: ${relativePath}`);
|
|
221
|
+
}
|
|
222
|
+
for (const layer of [...layers].reverse()) {
|
|
223
|
+
const filePath = resolve(layer.workflowRoot, relativePath);
|
|
224
|
+
if (!isInside(filePath, layer.workflowRoot))
|
|
225
|
+
throw new Error(`Prompt path escapes workflow directory: ${relativePath}`);
|
|
226
|
+
if (existsSync(filePath))
|
|
227
|
+
return filePath;
|
|
228
|
+
}
|
|
229
|
+
throw new Error(`Prompt template not found: ${relativePath}`);
|
|
230
|
+
}
|
|
231
|
+
export function loadSkillRaw(name) {
|
|
232
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name))
|
|
233
|
+
throw new Error(`Invalid skill name: ${name}`);
|
|
234
|
+
if (disabled.skills.includes(name))
|
|
235
|
+
throw new Error(`Skill is disabled: ${name}`);
|
|
236
|
+
for (const layer of [...layers].reverse()) {
|
|
237
|
+
const bases = [layer.skillRoot, layer.claudeSkillRoot].filter(Boolean);
|
|
238
|
+
for (const base of bases) {
|
|
239
|
+
const filePath = join(base, name, "SKILL.md");
|
|
240
|
+
if (!isInside(filePath, base))
|
|
241
|
+
throw new Error(`Skill path escapes skill directory: ${name}`);
|
|
242
|
+
if (existsSync(filePath))
|
|
243
|
+
return readFileSync(filePath, "utf-8");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
throw new Error(`Skill not found: skills/${name}/SKILL.md`);
|
|
247
|
+
}
|
|
248
|
+
export function loadSkillInstructions(name) {
|
|
249
|
+
return loadSkillRaw(name);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Resolve a list of skill names to their absolute directory paths.
|
|
253
|
+
* Each returned path is the skill folder root (containing `SKILL.md`
|
|
254
|
+
* plus any `scripts/`, `references/`, `assets/`) — not the .md file.
|
|
255
|
+
* The sandbox staging step in agent-executor uses these to symlink or
|
|
256
|
+
* copy the whole folder into the phase's bundle at
|
|
257
|
+
* `<workspaceRoot>/.lastlight-skills/<phase>/<name>/`.
|
|
258
|
+
* Layer-aware: overlay skills win over built-ins (same precedence and
|
|
259
|
+
* disabled-skill handling as `loadSkillRaw`).
|
|
260
|
+
*/
|
|
261
|
+
export function resolveSkillPaths(names) {
|
|
262
|
+
return names.map((name) => {
|
|
263
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
264
|
+
throw new Error(`Invalid skill name: ${name}`);
|
|
265
|
+
}
|
|
266
|
+
if (disabled.skills.includes(name)) {
|
|
267
|
+
throw new Error(`Skill is disabled: ${name}`);
|
|
268
|
+
}
|
|
269
|
+
for (const layer of [...layers].reverse()) {
|
|
270
|
+
const bases = [layer.skillRoot, layer.claudeSkillRoot].filter(Boolean);
|
|
271
|
+
for (const base of bases) {
|
|
272
|
+
const dir = join(base, name);
|
|
273
|
+
const skillFile = join(dir, "SKILL.md");
|
|
274
|
+
if (!isInside(skillFile, base))
|
|
275
|
+
throw new Error(`Skill path escapes skill directory: ${name}`);
|
|
276
|
+
if (existsSync(skillFile))
|
|
277
|
+
return dir;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
throw new Error(`Skill not found: skills/${name}/SKILL.md`);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Concatenate resolved agent-context/*.md with overlay filename replacement.
|
|
285
|
+
* Later layers replace earlier files by basename; disabled.agentContext removes
|
|
286
|
+
* either exact filenames (rules.md) or stem names (rules).
|
|
287
|
+
*/
|
|
288
|
+
export function loadAgentContext() {
|
|
289
|
+
const files = new Map();
|
|
290
|
+
for (const layer of layers) {
|
|
291
|
+
if (!existingDir(layer.agentContextRoot))
|
|
292
|
+
continue;
|
|
293
|
+
for (const f of readdirSync(layer.agentContextRoot).filter((n) => n.endsWith(".md")).sort()) {
|
|
294
|
+
files.set(f, join(layer.agentContextRoot, f));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
const disabledNames = new Set(disabled.agentContext.flatMap((n) => [n, n.endsWith(".md") ? n.slice(0, -3) : `${n}.md`]));
|
|
298
|
+
return Array.from(files.entries())
|
|
299
|
+
.filter(([name]) => !disabledNames.has(name) && !disabledNames.has(name.slice(0, -3)))
|
|
300
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
301
|
+
.map(([, filePath]) => readFileSync(filePath, "utf-8"))
|
|
302
|
+
.join("\n\n---\n\n");
|
|
303
|
+
}
|
|
304
|
+
const INTERNAL_ROUTE_TARGETS = {
|
|
305
|
+
"github.approval_response": new Set(["approval-response"]),
|
|
306
|
+
"github.issue_build": new Set(["github-orchestrator"]),
|
|
307
|
+
"github.explore_reply": new Set(["explore-reply"]),
|
|
308
|
+
"slack.approve": new Set(["approval-response"]),
|
|
309
|
+
"slack.reject": new Set(["approval-response"]),
|
|
310
|
+
"slack.reset": new Set(["chat-reset"]),
|
|
311
|
+
"slack.status": new Set(["status-report"]),
|
|
312
|
+
"slack.build": new Set(["github-orchestrator"]),
|
|
313
|
+
"slack.chat": new Set(["chat"]),
|
|
314
|
+
"slack.explore_reply": new Set(["explore-reply"]),
|
|
315
|
+
};
|
|
316
|
+
function validateRouteTargets(routes) {
|
|
317
|
+
if (!routes)
|
|
318
|
+
return;
|
|
319
|
+
for (const [surface, values] of Object.entries(routes)) {
|
|
320
|
+
for (const [routeName, target] of Object.entries(values)) {
|
|
321
|
+
const routeKey = `${surface}.${routeName}`;
|
|
322
|
+
if (target.includes("/") || target.includes(".."))
|
|
323
|
+
throw new Error(`Unsafe route target for ${routeKey}: ${target}`);
|
|
324
|
+
if (INTERNAL_ROUTE_TARGETS[routeKey]?.has(target))
|
|
325
|
+
continue;
|
|
326
|
+
if (agentCache.has(target))
|
|
327
|
+
continue;
|
|
328
|
+
if (disabled.workflows.includes(target)) {
|
|
329
|
+
throw new Error(`Route ${routeKey} targets disabled workflow: ${target}`);
|
|
330
|
+
}
|
|
331
|
+
throw new Error(`Route ${routeKey} targets missing workflow or internal handler: ${target}`);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
export function validateAssets(routes) {
|
|
336
|
+
populateCache();
|
|
337
|
+
for (const route of ["workflows", "crons"]) {
|
|
338
|
+
for (const name of disabled[route]) {
|
|
339
|
+
if (name.includes("/") || name.includes(".."))
|
|
340
|
+
throw new Error(`Unsafe disabled ${route} entry: ${name}`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// Every enabled cron must target a workflow that still exists (and isn't
|
|
344
|
+
// disabled) — otherwise the cron boots fine and only fails on first tick.
|
|
345
|
+
for (const [cronName, def] of cronCache) {
|
|
346
|
+
if (!agentCache.has(def.workflow)) {
|
|
347
|
+
throw new Error(`Cron "${cronName}" targets missing or disabled workflow: ${def.workflow}`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// Classifier `classification` blocks: each declared intent must be unique
|
|
351
|
+
// across workflows (two owners would make routing/parsing ambiguous), must
|
|
352
|
+
// not shadow a reserved control intent (approve/reject/status/reset/chat —
|
|
353
|
+
// the harness owns those), and its derived prompt token must be collision-free
|
|
354
|
+
// (e.g. `qa-test` and `qa_test` both → QATEST). A base classifier template
|
|
355
|
+
// must also exist to compose into. This runs at boot so a bad overlay fails
|
|
356
|
+
// fast instead of on the first classified event.
|
|
357
|
+
const controlIntents = new Set(RESERVED_CONTROL_INTENTS);
|
|
358
|
+
const intentOwner = new Map();
|
|
359
|
+
const tokenOwner = new Map();
|
|
360
|
+
let anyClassification = false;
|
|
361
|
+
for (const [wfName, def] of agentCache) {
|
|
362
|
+
const c = def.classification;
|
|
363
|
+
if (!c)
|
|
364
|
+
continue;
|
|
365
|
+
anyClassification = true;
|
|
366
|
+
if (controlIntents.has(c.intent)) {
|
|
367
|
+
throw new Error(`Workflow "${wfName}" classification.intent "${c.intent}" is a reserved control intent (${[...controlIntents].join(", ")})`);
|
|
368
|
+
}
|
|
369
|
+
const prevIntent = intentOwner.get(c.intent);
|
|
370
|
+
if (prevIntent) {
|
|
371
|
+
throw new Error(`Workflows "${prevIntent}" and "${wfName}" both claim classifier intent "${c.intent}" — an intent must have exactly one owning workflow`);
|
|
372
|
+
}
|
|
373
|
+
intentOwner.set(c.intent, wfName);
|
|
374
|
+
const token = intentToken(c.intent);
|
|
375
|
+
const prevToken = tokenOwner.get(token);
|
|
376
|
+
if (prevToken) {
|
|
377
|
+
throw new Error(`Workflows "${prevToken}" and "${wfName}" derive the same classifier token "${token}" from different intents — rename one classification.intent`);
|
|
378
|
+
}
|
|
379
|
+
tokenOwner.set(token, wfName);
|
|
380
|
+
}
|
|
381
|
+
if (anyClassification) {
|
|
382
|
+
try {
|
|
383
|
+
resolvePromptPath("prompts/classifier.md");
|
|
384
|
+
}
|
|
385
|
+
catch (err) {
|
|
386
|
+
throw new Error(`Classifier base template prompts/classifier.md: ${err.message}`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// Every enabled workflow's phase asset references (prompt templates and
|
|
390
|
+
// skills) must resolve now — so a missing/disabled overlay asset fails at
|
|
391
|
+
// startup instead of on the first event. Skip templated refs (containing
|
|
392
|
+
// "{{"), which can only be resolved at render time.
|
|
393
|
+
for (const [wfName, def] of agentCache) {
|
|
394
|
+
for (const phase of def.phases) {
|
|
395
|
+
const promptRefs = [
|
|
396
|
+
phase.prompt,
|
|
397
|
+
phase.loop?.on_request_changes.fix_prompt,
|
|
398
|
+
phase.loop?.on_request_changes.re_review_prompt,
|
|
399
|
+
].filter((p) => typeof p === "string" && p.length > 0 && !p.includes("{{"));
|
|
400
|
+
for (const ref of promptRefs) {
|
|
401
|
+
try {
|
|
402
|
+
resolvePromptPath(ref);
|
|
403
|
+
}
|
|
404
|
+
catch (err) {
|
|
405
|
+
throw new Error(`Workflow "${wfName}" phase "${phase.name}" prompt "${ref}": ${err.message}`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const skillNames = phaseSkillNames(phase).filter((n) => !n.includes("{{"));
|
|
409
|
+
if (skillNames.length) {
|
|
410
|
+
try {
|
|
411
|
+
resolveSkillPaths(skillNames);
|
|
412
|
+
}
|
|
413
|
+
catch (err) {
|
|
414
|
+
throw new Error(`Workflow "${wfName}" phase "${phase.name}" skills: ${err.message}`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
validateRouteTargets(routes);
|
|
420
|
+
}
|
|
421
|
+
//# sourceMappingURL=workflow-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-loader.js","sourceRoot":"","sources":["../src/workflow-loader.ts"],"names":[],"mappings":"AAA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AC,aAAa,MAAM,YAAY,KAAK,CAAC,IAAI,aAAc,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClG,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lastlight-shared",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Light modules shared by the Last Light CLI and lastlight-core — providers, oauth, overlay bootstrap/assets, core-pin, the workflow loader, and the config types it needs. No heavy runtime deps.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./providers": {
|
|
14
|
+
"types": "./dist/providers.d.ts",
|
|
15
|
+
"import": "./dist/providers.js"
|
|
16
|
+
},
|
|
17
|
+
"./oauth": {
|
|
18
|
+
"types": "./dist/oauth.d.ts",
|
|
19
|
+
"import": "./dist/oauth.js"
|
|
20
|
+
},
|
|
21
|
+
"./overlay-bootstrap": {
|
|
22
|
+
"types": "./dist/overlay-bootstrap.d.ts",
|
|
23
|
+
"import": "./dist/overlay-bootstrap.js"
|
|
24
|
+
},
|
|
25
|
+
"./overlay-assets": {
|
|
26
|
+
"types": "./dist/overlay-assets.d.ts",
|
|
27
|
+
"import": "./dist/overlay-assets.js"
|
|
28
|
+
},
|
|
29
|
+
"./core-pin": {
|
|
30
|
+
"types": "./dist/core-pin.d.ts",
|
|
31
|
+
"import": "./dist/core-pin.js"
|
|
32
|
+
},
|
|
33
|
+
"./workflow-loader": {
|
|
34
|
+
"types": "./dist/workflow-loader.d.ts",
|
|
35
|
+
"import": "./dist/workflow-loader.js"
|
|
36
|
+
},
|
|
37
|
+
"./config-types": {
|
|
38
|
+
"types": "./dist/config-types.d.ts",
|
|
39
|
+
"import": "./dist/config-types.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=22.12"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@clack/prompts": "^1.2.0",
|
|
52
|
+
"@earendil-works/pi-ai": "^0.79.8",
|
|
53
|
+
"chalk": "^5.6.2",
|
|
54
|
+
"yaml": "^2.8.3",
|
|
55
|
+
"lastlight-workflow-engine": "0.1.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^22.0.0",
|
|
59
|
+
"typescript": "^5.7.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsc -p tsconfig.json",
|
|
63
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
64
|
+
}
|
|
65
|
+
}
|