@leitwerk-dev/showcase-processes 0.1.9 → 0.2.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/README.md +6 -0
- package/dist/file-external.d.ts +1 -1
- package/dist/file-external.d.ts.map +1 -1
- package/dist/filesystem-watcher.d.ts +3 -4
- package/dist/filesystem-watcher.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1248 -58
- package/dist/index.js.map +1 -1
- package/dist/poem-leaf-outcome.d.ts.map +1 -1
- package/dist/process-definition.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/file-external.ts +2 -2
- package/src/filesystem-watcher.ts +24 -57
- package/src/index.ts +2 -10
- package/src/poem-leaf-outcome.ts +3 -21
- package/src/process-definition.ts +52 -96
- package/dist/file-external.js +0 -198
- package/dist/file-external.js.map +0 -1
- package/dist/filesystem-watcher.js +0 -109
- package/dist/filesystem-watcher.js.map +0 -1
- package/dist/poem-leaf-outcome.js +0 -110
- package/dist/poem-leaf-outcome.js.map +0 -1
- package/dist/process-definition.js +0 -813
- package/dist/process-definition.js.map +0 -1
- package/dist/turns/external-complete.js +0 -6
- package/dist/turns/external-complete.js.map +0 -1
- package/dist/turns/poem-creator.js +0 -72
- package/dist/turns/poem-creator.js.map +0 -1
- package/dist/turns/run-single-prompt.js +0 -57
- package/dist/turns/run-single-prompt.js.map +0 -1
- package/dist/ui/leaf-outcome-element.js +0 -79
- package/dist/ui/leaf-outcome-element.js.map +0 -1
- package/dist/ui/poem-leaf-outcome-element.js +0 -171
- package/dist/ui/poem-leaf-outcome-element.js.map +0 -1
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type HumanFlowBuilder,
|
|
10
10
|
parseStructuralProcessState,
|
|
11
11
|
type StructuralProcessState,
|
|
12
|
+
structuralStateCodec,
|
|
12
13
|
} from "@leitwerk-dev/process-sdk";
|
|
13
14
|
import { fileExternal } from "./file-external.js";
|
|
14
15
|
import { filesystemWatcherSource } from "./filesystem-watcher.js";
|
|
@@ -58,15 +59,6 @@ const promptProcessParamsCodec: Codec<PromptProcessParams> = {
|
|
|
58
59
|
},
|
|
59
60
|
};
|
|
60
61
|
|
|
61
|
-
const structuralStateCodec: Codec<StructuralProcessState> = {
|
|
62
|
-
parse(value) {
|
|
63
|
-
return parseStructuralProcessState(value);
|
|
64
|
-
},
|
|
65
|
-
serialize(value) {
|
|
66
|
-
return value;
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
62
|
const poemCreatorStateCodec: Codec<PoemCreatorState> = {
|
|
71
63
|
parse(value) {
|
|
72
64
|
const structural = parseStructuralProcessState(value);
|
|
@@ -114,6 +106,30 @@ function buildPromptTitleSourceFields(prompt: string, label = "Prompt") {
|
|
|
114
106
|
return [{ label, value: prompt }] as const;
|
|
115
107
|
}
|
|
116
108
|
|
|
109
|
+
function promptLaunchResolution(options: {
|
|
110
|
+
processId: string;
|
|
111
|
+
startTurnId: string;
|
|
112
|
+
defaultPrompt?: () => string;
|
|
113
|
+
titleLabel?: string;
|
|
114
|
+
}) {
|
|
115
|
+
return {
|
|
116
|
+
resolveDefaults: () => ({ prompt: options.defaultPrompt?.() ?? "" }),
|
|
117
|
+
resolveLaunchConfig(input: Record<string, unknown>) {
|
|
118
|
+
const validated = validateLaunchInput(input, options.defaultPrompt?.());
|
|
119
|
+
if (!validated.ok) return validated;
|
|
120
|
+
return {
|
|
121
|
+
ok: true as const,
|
|
122
|
+
launchConfig: {
|
|
123
|
+
processId: options.processId,
|
|
124
|
+
params: { prompt: validated.prompt },
|
|
125
|
+
titleSourceFields: buildPromptTitleSourceFields(validated.prompt, options.titleLabel),
|
|
126
|
+
startTurnId: options.startTurnId,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
117
133
|
function clearReviewRefs(state: PoemCreatorState["semanticEntryRefs"]) {
|
|
118
134
|
return {
|
|
119
135
|
...state,
|
|
@@ -293,7 +309,7 @@ export const singlePromptProcess = flow
|
|
|
293
309
|
.turn(
|
|
294
310
|
flow
|
|
295
311
|
.llm<PromptProcessParams, StructuralProcessState>("run_single_prompt")
|
|
296
|
-
.description("Run
|
|
312
|
+
.description("Run Prompt")
|
|
297
313
|
.tools("read", "bash", "edit", "write")
|
|
298
314
|
.prompt(async (ctx) => buildSinglePromptInstruction(ctx.params.prompt))
|
|
299
315
|
.end("completed")
|
|
@@ -333,26 +349,10 @@ export const singlePromptProcess = flow
|
|
|
333
349
|
],
|
|
334
350
|
submitLabel: "Run Prompt",
|
|
335
351
|
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
},
|
|
341
|
-
resolveLaunchConfig(input) {
|
|
342
|
-
const validated = validateLaunchInput(input);
|
|
343
|
-
if (!validated.ok) {
|
|
344
|
-
return validated;
|
|
345
|
-
}
|
|
346
|
-
return {
|
|
347
|
-
ok: true,
|
|
348
|
-
launchConfig: {
|
|
349
|
-
processId: "single_prompt_process",
|
|
350
|
-
params: { prompt: validated.prompt },
|
|
351
|
-
titleSourceFields: buildPromptTitleSourceFields(validated.prompt),
|
|
352
|
-
startTurnId: "run_single_prompt",
|
|
353
|
-
},
|
|
354
|
-
};
|
|
355
|
-
},
|
|
352
|
+
...promptLaunchResolution({
|
|
353
|
+
processId: "single_prompt_process",
|
|
354
|
+
startTurnId: "run_single_prompt",
|
|
355
|
+
}),
|
|
356
356
|
},
|
|
357
357
|
})
|
|
358
358
|
.define();
|
|
@@ -369,7 +369,7 @@ export const singlePromptWithToolProcess = flow
|
|
|
369
369
|
.turn(
|
|
370
370
|
flow
|
|
371
371
|
.llm<PromptProcessParams, StructuralProcessState>("run_single_prompt_with_tool")
|
|
372
|
-
.description("Run
|
|
372
|
+
.description("Run Prompt")
|
|
373
373
|
.tools("read", "bash", "edit", "write")
|
|
374
374
|
.prompt(async (ctx) => buildSinglePromptWithToolInstruction(ctx.params.prompt))
|
|
375
375
|
.outcomeTool("done", (tool) =>
|
|
@@ -413,26 +413,10 @@ export const singlePromptWithToolProcess = flow
|
|
|
413
413
|
],
|
|
414
414
|
submitLabel: "Run Prompt + Tool",
|
|
415
415
|
},
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
resolveLaunchConfig(input) {
|
|
422
|
-
const validated = validateLaunchInput(input);
|
|
423
|
-
if (!validated.ok) {
|
|
424
|
-
return validated;
|
|
425
|
-
}
|
|
426
|
-
return {
|
|
427
|
-
ok: true,
|
|
428
|
-
launchConfig: {
|
|
429
|
-
processId: "single_prompt_with_tool_process",
|
|
430
|
-
params: { prompt: validated.prompt },
|
|
431
|
-
titleSourceFields: buildPromptTitleSourceFields(validated.prompt),
|
|
432
|
-
startTurnId: "run_single_prompt_with_tool",
|
|
433
|
-
},
|
|
434
|
-
};
|
|
435
|
-
},
|
|
416
|
+
...promptLaunchResolution({
|
|
417
|
+
processId: "single_prompt_with_tool_process",
|
|
418
|
+
startTurnId: "run_single_prompt_with_tool",
|
|
419
|
+
}),
|
|
436
420
|
},
|
|
437
421
|
})
|
|
438
422
|
.define();
|
|
@@ -644,7 +628,7 @@ export const singlePromptExternalCompleteProcess = flow
|
|
|
644
628
|
.turn(
|
|
645
629
|
flow
|
|
646
630
|
.llm<PromptProcessParams, StructuralProcessState>("run_single_prompt")
|
|
647
|
-
.description("Run
|
|
631
|
+
.description("Run Prompt")
|
|
648
632
|
.tools("read", "bash", "edit", "write")
|
|
649
633
|
.prompt(async (ctx) => buildSinglePromptInstruction(ctx.params.prompt))
|
|
650
634
|
.end("completed")
|
|
@@ -697,33 +681,17 @@ export const singlePromptExternalCompleteProcess = flow
|
|
|
697
681
|
],
|
|
698
682
|
submitLabel: "Run Prompt",
|
|
699
683
|
},
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
resolveLaunchConfig(input) {
|
|
706
|
-
const validated = validateLaunchInput(input);
|
|
707
|
-
if (!validated.ok) {
|
|
708
|
-
return validated;
|
|
709
|
-
}
|
|
710
|
-
return {
|
|
711
|
-
ok: true,
|
|
712
|
-
launchConfig: {
|
|
713
|
-
processId: "single_prompt_external_complete_process",
|
|
714
|
-
params: { prompt: validated.prompt },
|
|
715
|
-
titleSourceFields: buildPromptTitleSourceFields(validated.prompt),
|
|
716
|
-
startTurnId: "run_single_prompt",
|
|
717
|
-
},
|
|
718
|
-
};
|
|
719
|
-
},
|
|
684
|
+
...promptLaunchResolution({
|
|
685
|
+
processId: "single_prompt_external_complete_process",
|
|
686
|
+
startTurnId: "run_single_prompt",
|
|
687
|
+
}),
|
|
720
688
|
},
|
|
721
689
|
})
|
|
722
690
|
.define();
|
|
723
691
|
|
|
724
692
|
const poemDraftReviewSpec = flow
|
|
725
693
|
.human<PromptProcessParams, PoemCreatorState>(poemTurnIds.poemReview)
|
|
726
|
-
.description("
|
|
694
|
+
.description("Review")
|
|
727
695
|
.reviewProduct("poem-draft")
|
|
728
696
|
.notesFields([
|
|
729
697
|
{
|
|
@@ -786,7 +754,7 @@ const poemDraftReviewSpec = flow
|
|
|
786
754
|
|
|
787
755
|
const poemReviewFeedbackSpec = flow
|
|
788
756
|
.human<PromptProcessParams, PoemCreatorState>(poemTurnIds.poemReviewFeedback)
|
|
789
|
-
.description("
|
|
757
|
+
.description("Review Feedback")
|
|
790
758
|
.reviewProduct("message")
|
|
791
759
|
.notesFields([
|
|
792
760
|
{
|
|
@@ -850,7 +818,7 @@ export const poemCreatorProcess = flow
|
|
|
850
818
|
.turn(
|
|
851
819
|
flow
|
|
852
820
|
.llm<PromptProcessParams, PoemCreatorState>(poemTurnIds.draftPoem)
|
|
853
|
-
.description("Draft
|
|
821
|
+
.description("Draft Poem")
|
|
854
822
|
.fullPrimary()
|
|
855
823
|
.continueFromPrimaryLeaf()
|
|
856
824
|
.optionalConsume("message")
|
|
@@ -875,7 +843,7 @@ export const poemCreatorProcess = flow
|
|
|
875
843
|
.turn(
|
|
876
844
|
flow
|
|
877
845
|
.llm<PromptProcessParams, PoemCreatorState>(poemTurnIds.reviewPoemDraft)
|
|
878
|
-
.description("
|
|
846
|
+
.description("Assess Poem")
|
|
879
847
|
.rootBranchReview()
|
|
880
848
|
.continueFromReviewBranch()
|
|
881
849
|
.consume("poem-draft")
|
|
@@ -894,6 +862,7 @@ export const poemCreatorProcess = flow
|
|
|
894
862
|
.outcomeTool("no_issues", (tool) =>
|
|
895
863
|
tool
|
|
896
864
|
.description("The poem is ready to publish")
|
|
865
|
+
.resultSummary("summary")
|
|
897
866
|
.requiredString("summary", "Short confirmation summary")
|
|
898
867
|
.markdown("review", {
|
|
899
868
|
description: "Concise review opinion confirming the poem is ready",
|
|
@@ -912,6 +881,7 @@ export const poemCreatorProcess = flow
|
|
|
912
881
|
.outcomeTool("leave_feedback", (tool) =>
|
|
913
882
|
tool
|
|
914
883
|
.description("Leave concise feedback for the human reviewer")
|
|
884
|
+
.resultSummary("summary")
|
|
915
885
|
.requiredString("summary", "Short summary of the feedback")
|
|
916
886
|
.markdown("message", {
|
|
917
887
|
description: "Concise plain-text feedback describing what to improve",
|
|
@@ -966,26 +936,12 @@ export const poemCreatorProcess = flow
|
|
|
966
936
|
],
|
|
967
937
|
submitLabel: "Create Poem",
|
|
968
938
|
},
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
const validated = validateLaunchInput(input, buildDefaultPoemPrompt());
|
|
976
|
-
if (!validated.ok) {
|
|
977
|
-
return validated;
|
|
978
|
-
}
|
|
979
|
-
return {
|
|
980
|
-
ok: true,
|
|
981
|
-
launchConfig: {
|
|
982
|
-
processId: "poem_creator_process",
|
|
983
|
-
params: { prompt: validated.prompt },
|
|
984
|
-
titleSourceFields: buildPromptTitleSourceFields(validated.prompt, "Poem Prompt"),
|
|
985
|
-
startTurnId: poemTurnIds.draftPoem,
|
|
986
|
-
},
|
|
987
|
-
};
|
|
988
|
-
},
|
|
939
|
+
...promptLaunchResolution({
|
|
940
|
+
processId: "poem_creator_process",
|
|
941
|
+
startTurnId: poemTurnIds.draftPoem,
|
|
942
|
+
defaultPrompt: buildDefaultPoemPrompt,
|
|
943
|
+
titleLabel: "Poem Prompt",
|
|
944
|
+
}),
|
|
989
945
|
},
|
|
990
946
|
})
|
|
991
947
|
.watcher({
|
package/dist/file-external.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { consumeTriggerFile, createPollLoop, emptyPollResult, parseDurationMs, readTriggerFile, } from "@leitwerk-dev/watcher-utils";
|
|
2
|
-
export const FILE_EXTERNAL_PRESENCE_KIND = "@leitwerk-dev/showcase-processes.file.presence";
|
|
3
|
-
export const FILE_EXTERNAL_INSTRUCTION_KIND = "@leitwerk-dev/showcase-processes.file.instruction";
|
|
4
|
-
function normalizeConfig(input) {
|
|
5
|
-
return {
|
|
6
|
-
path: input.path,
|
|
7
|
-
pollInterval: input.pollInterval,
|
|
8
|
-
consume: input.consume,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function interpolateTemplate(template, values) {
|
|
12
|
-
return template.replace(/\{([a-zA-Z0-9_]+)\}/g, (match, key) => values[key] ?? match);
|
|
13
|
-
}
|
|
14
|
-
function resolveFileConfig(input, ctx) {
|
|
15
|
-
return {
|
|
16
|
-
...input,
|
|
17
|
-
path: interpolateTemplate(input.path, { instanceId: ctx.process.id }),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function fileLabel(kind, path) {
|
|
21
|
-
return kind === "presence" ? `File present: ${path}` : `File instruction: ${path}`;
|
|
22
|
-
}
|
|
23
|
-
export const fileExternal = {
|
|
24
|
-
presence(input) {
|
|
25
|
-
const config = normalizeConfig(input);
|
|
26
|
-
return {
|
|
27
|
-
kind: FILE_EXTERNAL_PRESENCE_KIND,
|
|
28
|
-
label: fileLabel("presence", config.path),
|
|
29
|
-
description: `Fires when ${config.path} exists`,
|
|
30
|
-
config,
|
|
31
|
-
inputMode: "none",
|
|
32
|
-
resolve(ctx) {
|
|
33
|
-
return resolveFileConfig(config, ctx);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
instruction(input) {
|
|
38
|
-
const config = normalizeConfig(input);
|
|
39
|
-
return {
|
|
40
|
-
kind: FILE_EXTERNAL_INSTRUCTION_KIND,
|
|
41
|
-
label: fileLabel("instruction", config.path),
|
|
42
|
-
description: `Reads ${config.path} as instruction text`,
|
|
43
|
-
config,
|
|
44
|
-
inputMode: "instruction",
|
|
45
|
-
resolve(ctx) {
|
|
46
|
-
return resolveFileConfig(config, ctx);
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
function parseFileConfig(value) {
|
|
52
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const record = value;
|
|
56
|
-
if (typeof record.path !== "string" || record.path.trim() === "") {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
path: record.path,
|
|
61
|
-
pollInterval: typeof record.pollInterval === "string" ? record.pollInterval : "1s",
|
|
62
|
-
consume: record.consume === "keep" ? "keep" : "delete",
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
async function maybeConsume(config) {
|
|
66
|
-
if (config.consume === "delete") {
|
|
67
|
-
await consumeTriggerFile(config.path);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function createDueTracker() {
|
|
71
|
-
const nextDueAtByKey = new Map();
|
|
72
|
-
return {
|
|
73
|
-
isDue(key, pollInterval, nowMs = Date.now()) {
|
|
74
|
-
const nextDueAt = nextDueAtByKey.get(key) ?? 0;
|
|
75
|
-
if (nextDueAt > nowMs) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
const intervalMs = parseDurationMs(pollInterval, 1_000);
|
|
79
|
-
nextDueAtByKey.set(key, nowMs + intervalMs);
|
|
80
|
-
return true;
|
|
81
|
-
},
|
|
82
|
-
prune(activeKeys) {
|
|
83
|
-
for (const key of [...nextDueAtByKey.keys()]) {
|
|
84
|
-
if (!activeKeys.has(key)) {
|
|
85
|
-
nextDueAtByKey.delete(key);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function resolveArmedFileConfig(armed, resolveAlias) {
|
|
92
|
-
const parsed = parseFileConfig(armed.resolved) ?? parseFileConfig(armed.source.config);
|
|
93
|
-
return parsed ? resolveAlias(parsed) : null;
|
|
94
|
-
}
|
|
95
|
-
async function pollArmedFileSource(armed, resolveConfig, isDue, activeKeys, result) {
|
|
96
|
-
const config = resolveArmedFileConfig(armed, resolveConfig);
|
|
97
|
-
if (!config) {
|
|
98
|
-
result.errors.push(`${armed.id}:invalid_config`);
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
const key = `${armed.instanceId}:${armed.id}`;
|
|
102
|
-
activeKeys.add(key);
|
|
103
|
-
if (!isDue(key, config.pollInterval)) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
const file = await readTriggerFile(config.path);
|
|
107
|
-
if (!file.exists) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
return { config, file };
|
|
111
|
-
}
|
|
112
|
-
async function firePresenceSources(deps, result, resolveConfig, isDue, activeKeys) {
|
|
113
|
-
for (const armed of deps.externalSources.listArmed(FILE_EXTERNAL_PRESENCE_KIND)) {
|
|
114
|
-
const target = await pollArmedFileSource(armed, resolveConfig, isDue, activeKeys, result);
|
|
115
|
-
if (!target) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
const { config } = target;
|
|
119
|
-
const fired = await deps.externalSources.fire({
|
|
120
|
-
instanceId: armed.instanceId,
|
|
121
|
-
armingId: armed.id,
|
|
122
|
-
event: { path: config.path, pollInterval: config.pollInterval },
|
|
123
|
-
mergeKey: config.path,
|
|
124
|
-
});
|
|
125
|
-
if (!fired.ok) {
|
|
126
|
-
result.errors.push(`${armed.id}:${fired.code ?? fired.error ?? "fire_failed"}`);
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
await maybeConsume(config);
|
|
130
|
-
result.created.push(armed.id);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
async function fireInstructionSources(deps, result, resolveConfig, isDue, activeKeys) {
|
|
134
|
-
for (const armed of deps.externalSources.listArmed(FILE_EXTERNAL_INSTRUCTION_KIND)) {
|
|
135
|
-
const target = await pollArmedFileSource(armed, resolveConfig, isDue, activeKeys, result);
|
|
136
|
-
if (!target) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
const { config, file } = target;
|
|
140
|
-
const instruction = file.content.trim();
|
|
141
|
-
if (!instruction) {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
const fired = await deps.externalSources.fire({
|
|
145
|
-
instanceId: armed.instanceId,
|
|
146
|
-
armingId: armed.id,
|
|
147
|
-
input: { instruction },
|
|
148
|
-
event: { path: config.path, pollInterval: config.pollInterval },
|
|
149
|
-
mergeKey: config.path,
|
|
150
|
-
});
|
|
151
|
-
if (!fired.ok) {
|
|
152
|
-
result.errors.push(`${armed.id}:${fired.code ?? fired.error ?? "fire_failed"}`);
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
await maybeConsume(config);
|
|
156
|
-
result.created.push(armed.id);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
export function createFileExternalSourceProvider(deps, aliases = {}) {
|
|
160
|
-
function applyAlias(config) {
|
|
161
|
-
const exact = aliases[config.path];
|
|
162
|
-
if (exact) {
|
|
163
|
-
return { ...config, path: exact };
|
|
164
|
-
}
|
|
165
|
-
for (const [template, replacement] of Object.entries(aliases)) {
|
|
166
|
-
if (!replacement || !template.includes("{instanceId}")) {
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
const [prefix, suffix = ""] = template.split("{instanceId}");
|
|
170
|
-
if (!prefix || !config.path.startsWith(prefix) || !config.path.endsWith(suffix)) {
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
const instanceId = config.path.slice(prefix.length, config.path.length - suffix.length);
|
|
174
|
-
return {
|
|
175
|
-
...config,
|
|
176
|
-
path: replacement.includes("{instanceId}")
|
|
177
|
-
? interpolateTemplate(replacement, { instanceId })
|
|
178
|
-
: replacement,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
return config;
|
|
182
|
-
}
|
|
183
|
-
const due = createDueTracker();
|
|
184
|
-
return createPollLoop({
|
|
185
|
-
pollInterval: () => "50ms",
|
|
186
|
-
isEnabled: () => true,
|
|
187
|
-
defaultIntervalMs: 50,
|
|
188
|
-
async pollOnce() {
|
|
189
|
-
const result = emptyPollResult();
|
|
190
|
-
const activeKeys = new Set();
|
|
191
|
-
await firePresenceSources(deps, result, applyAlias, due.isDue, activeKeys);
|
|
192
|
-
await fireInstructionSources(deps, result, applyAlias, due.isDue, activeKeys);
|
|
193
|
-
due.prune(activeKeys);
|
|
194
|
-
return result;
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
//# sourceMappingURL=file-external.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-external.js","sourceRoot":"","sources":["../src/file-external.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,eAAe,EAEf,eAAe,EACf,eAAe,GACf,MAAM,6BAA6B,CAAC;AAUrC,MAAM,CAAC,MAAM,2BAA2B,GAAG,gDAAgD,CAAC;AAC5F,MAAM,CAAC,MAAM,8BAA8B,GAAG,mDAAmD,CAAC;AAElG,SAAS,eAAe,CAAC,KAAwB;IAChD,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,O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B,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC;oBAClD,CAAC,CAAC,WAAW;aACd,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IACD,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,OAAO,cAAc,CAAC;QACrB,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM;QAC1B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI;QACrB,iBAAiB,EAAE,EAAE;QACrB,KAAK,CAAC,QAAQ;YACb,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;YACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;YACrC,MAAM,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAC3E,MAAM,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAC9E,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACtB,OAAO,MAAM,CAAC;QACf,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { defineProcessWatcherSource, parseProcessWatcherLaunchModelConfig, } from "@leitwerk-dev/process-sdk";
|
|
2
|
-
import { consumeTriggerFile, createPollLoop, emptyPollResult, parseDurationMs, readTriggerFile, } from "@leitwerk-dev/watcher-utils";
|
|
3
|
-
function record(value, subject) {
|
|
4
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
5
|
-
throw new Error(`${subject} must be an object`);
|
|
6
|
-
}
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
function nonEmptyString(value, path) {
|
|
10
|
-
if (typeof value !== "string" || value.trim() === "") {
|
|
11
|
-
throw new Error(`${path} must be a non-empty string`);
|
|
12
|
-
}
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
export const filesystemWatcherSource = defineProcessWatcherSource({
|
|
16
|
-
id: "@leitwerk-dev/showcase-processes.file",
|
|
17
|
-
label: "File",
|
|
18
|
-
parseConfig(raw) {
|
|
19
|
-
const config = record(raw, "watcher config");
|
|
20
|
-
if (config.type !== undefined && config.type !== "filesystem") {
|
|
21
|
-
throw new Error("type must be 'filesystem' when specified");
|
|
22
|
-
}
|
|
23
|
-
if (typeof config.enabled !== "boolean") {
|
|
24
|
-
throw new Error("enabled must be a boolean");
|
|
25
|
-
}
|
|
26
|
-
const pollInterval = nonEmptyString(config.poll_interval, "poll_interval");
|
|
27
|
-
if (parseDurationMs(pollInterval, -1, { allowHours: true }) <= 0) {
|
|
28
|
-
throw new Error("poll_interval must be a positive duration");
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
config: {
|
|
32
|
-
pollInterval,
|
|
33
|
-
filePath: nonEmptyString(config.file_path, "file_path"),
|
|
34
|
-
},
|
|
35
|
-
enabled: config.enabled,
|
|
36
|
-
launchModelConfig: parseProcessWatcherLaunchModelConfig(config.launch),
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
presentConfig(config) {
|
|
40
|
-
return {
|
|
41
|
-
targetSummary: `File ${config.filePath}`,
|
|
42
|
-
details: [
|
|
43
|
-
{ label: "File path", value: config.filePath, format: "code" },
|
|
44
|
-
{ label: "Poll interval", value: config.pollInterval },
|
|
45
|
-
],
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
export function createFilesystemWatcherProvider(deps, logger) {
|
|
50
|
-
const watchers = deps.processWatchers?.listBySource(filesystemWatcherSource) ?? [];
|
|
51
|
-
const loops = watchers.map((watcher) => createPollLoop({
|
|
52
|
-
pollInterval: () => watcher.config.pollInterval,
|
|
53
|
-
isEnabled: () => watcher.enabled,
|
|
54
|
-
defaultIntervalMs: 1_000,
|
|
55
|
-
async pollOnce() {
|
|
56
|
-
const result = emptyPollResult();
|
|
57
|
-
const file = await readTriggerFile(watcher.config.filePath);
|
|
58
|
-
if (!file.exists || file.content.trim() === "")
|
|
59
|
-
return result;
|
|
60
|
-
const resolved = await watcher.resolveLaunch({
|
|
61
|
-
filePath: watcher.config.filePath,
|
|
62
|
-
content: file.content.trim(),
|
|
63
|
-
});
|
|
64
|
-
if (!resolved) {
|
|
65
|
-
result.skipped.push(`${watcher.processId}:${watcher.watcherId}`);
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
const prepared = await deps.launchPlans.prepare(resolved, {
|
|
69
|
-
modelConfig: watcher.launchModelConfig,
|
|
70
|
-
invalidModelConfig: "omit",
|
|
71
|
-
});
|
|
72
|
-
if (!prepared.ok) {
|
|
73
|
-
result.errors.push(...prepared.errors.map((error) => `${watcher.processId}:${watcher.watcherId}:${error.code}`));
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
const created = await deps.processLaunches.createProcessFromLaunchPlan(prepared.launchPlan);
|
|
77
|
-
const durableProcess = created.ok
|
|
78
|
-
? created.process
|
|
79
|
-
: created.stage === "post_commit"
|
|
80
|
-
? created.process
|
|
81
|
-
: null;
|
|
82
|
-
if (durableProcess) {
|
|
83
|
-
await consumeTriggerFile(watcher.config.filePath);
|
|
84
|
-
result.created.push(durableProcess.id);
|
|
85
|
-
}
|
|
86
|
-
if (!created.ok) {
|
|
87
|
-
result.errors.push(`${watcher.processId}:${watcher.watcherId}:${created.status}:${String(created.body.error ?? "launch_failed")}`);
|
|
88
|
-
logger?.warn?.({
|
|
89
|
-
processId: watcher.processId,
|
|
90
|
-
watcherId: watcher.watcherId,
|
|
91
|
-
filePath: watcher.config.filePath,
|
|
92
|
-
status: created.status,
|
|
93
|
-
}, "File watcher launch failed");
|
|
94
|
-
}
|
|
95
|
-
return result;
|
|
96
|
-
},
|
|
97
|
-
}));
|
|
98
|
-
return {
|
|
99
|
-
start() {
|
|
100
|
-
for (const loop of loops)
|
|
101
|
-
loop.start();
|
|
102
|
-
},
|
|
103
|
-
stop() {
|
|
104
|
-
for (const loop of loops)
|
|
105
|
-
loop.stop();
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=filesystem-watcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-watcher.js","sourceRoot":"","sources":["../src/filesystem-watcher.ts"],"names":[],"mappings":"AACA,OAAO,EACN,0BAA0B,EAC1B,oCAAoC,GACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,GACf,MAAM,6BAA6B,CAAC;AAYrC,SAAS,MAAM,CAAC,KAAc,EAAE,OAAe;IAC9C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,oBAAoB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAgC,CAAC;AACzC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,IAAY;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,6BAA6B,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAG/D;IACD,EAAE,EAAE,uCAAuC;IAC3C,KAAK,EAAE,MAAM;IACb,WAAW,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,0C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