@leitwerk-dev/example-processes 0.0.0-stage → 0.4.1
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 +33 -2
- package/dist/LICENSE +13 -0
- package/dist/file-external.d.ts +9 -0
- package/dist/file-external.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +337 -0
- package/dist/index.js.map +1 -0
- package/dist/process-definition.d.ts +20 -0
- package/dist/process-definition.d.ts.map +1 -0
- package/dist/testing/harness.d.ts +3 -0
- package/dist/testing/harness.d.ts.map +1 -0
- package/dist/ui/assets/leaf-outcome-element.js +245 -0
- package/dist/ui/assets/leaf-outcome-element.js.map +1 -0
- package/dist/ui/leaf-outcome-element.d.ts +2 -0
- package/dist/ui/leaf-outcome-element.d.ts.map +1 -0
- package/dist/ui/manifest.json +18 -0
- package/package.json +53 -5
- package/src/file-external.ts +18 -0
- package/src/index.ts +61 -0
- package/src/process-definition.ts +417 -0
- package/src/testing/harness.ts +45 -0
- package/src/ui/leaf-outcome-element.ts +95 -0
- package/src/ui/manifest.json +18 -0
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Example processes extension
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This extension provides Single Prompt, Single Prompt + Done Tool, Single Prompt + External Complete, and the three Kubernetes smoke processes. Poem Creator lives in [showcase-processes](../showcase-processes/README.md). Either extension can be loaded independently.
|
|
4
|
+
|
|
5
|
+
## Load
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
extension_loading:
|
|
9
|
+
sources:
|
|
10
|
+
- ./extensions/example-processes
|
|
11
|
+
|
|
12
|
+
extensions:
|
|
13
|
+
example-processes:
|
|
14
|
+
file_triggers:
|
|
15
|
+
complete_prompt_path: /tmp/complete-prompt
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
When upgrading from the combined showcase extension, add this source and move `file_triggers.complete_prompt_path` to the configuration above. Existing process, launcher, renderer, and external-source ids are retained. The renderer and external-source ids still use the `@leitwerk-dev/showcase-processes` prefix so persisted outcomes and armed completion files continue to resolve.
|
|
19
|
+
|
|
20
|
+
## Completion
|
|
21
|
+
|
|
22
|
+
Single Prompt completes when the assistant turn ends. Single Prompt + Done Tool requires the `done` outcome tool. Single Prompt + External Complete waits after the prompt until its configured completion file exists, then consumes the file after successful admission. A failed admission retains the file for a later poll.
|
|
23
|
+
|
|
24
|
+
Selected external sources carry their own poll interval. `file_triggers.poll_interval` remains a compatibility key.
|
|
25
|
+
|
|
26
|
+
The Kubernetes smoke processes exercise a deterministic worker step, specialized worker-image selection, and worker adoption across server restarts. Load this extension in the server and worker configuration used by the smoke scripts.
|
|
27
|
+
|
|
28
|
+
## Browser assets
|
|
29
|
+
|
|
30
|
+
The source lane loads `src/ui/manifest.json`; the dist lane loads the manifest and bundles under `dist/ui`. Run `npm run build:ext-ui` to build the browser assets.
|
|
31
|
+
|
|
32
|
+
## API support
|
|
33
|
+
|
|
34
|
+
The default export from `@leitwerk-dev/example-processes` is `@public`. See the [SDK compatibility policy](../../docs/process-sdk.md#api-compatibility).
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2026 Leitwerk contributors.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FileExternalInput } from "@leitwerk-dev/process-sdk";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare const FILE_EXTERNAL_PRESENCE_KIND = "@leitwerk-dev/showcase-processes.file.presence";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const fileExternal: {
|
|
6
|
+
/** @internal */
|
|
7
|
+
presence(input: FileExternalInput): import("@leitwerk-dev/process-sdk").ExternalActionSource<unknown, unknown, unknown, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=file-external.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-external.d.ts","sourceRoot":"","sources":["../src/file-external.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG7F,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,mDAAmD,CAAC;AAE5F,gBAAgB;AAChB,eAAO,MAAM,YAAY;IACxB,gBAAgB;oBACA,iBAAiB;CAQjC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,2BAA2B,CAAC;AA8BnC,cAAc;AACd,QAAA,MAAM,yBAAyB,EAAE,uBAuBhC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
coreHostCapabilities,
|
|
4
|
+
createFileExternalSourceProvider
|
|
5
|
+
} from "@leitwerk-dev/process-sdk";
|
|
6
|
+
|
|
7
|
+
// src/file-external.ts
|
|
8
|
+
import { defineFileExternalSource } from "@leitwerk-dev/process-sdk";
|
|
9
|
+
var FILE_EXTERNAL_PRESENCE_KIND = "@leitwerk-dev/showcase-processes.file.presence";
|
|
10
|
+
var fileExternal = {
|
|
11
|
+
/** @internal */
|
|
12
|
+
presence(input) {
|
|
13
|
+
return defineFileExternalSource(input, {
|
|
14
|
+
kind: FILE_EXTERNAL_PRESENCE_KIND,
|
|
15
|
+
label: `File present: ${input.path}`,
|
|
16
|
+
description: `Fires when ${input.path} exists`,
|
|
17
|
+
inputMode: "none"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/process-definition.ts
|
|
23
|
+
import { execFileSync } from "child_process";
|
|
24
|
+
import { setTimeout as delay } from "timers/promises";
|
|
25
|
+
import {
|
|
26
|
+
createEmptyStructuralProcessState,
|
|
27
|
+
flow,
|
|
28
|
+
structuralStateCodec
|
|
29
|
+
} from "@leitwerk-dev/process-sdk";
|
|
30
|
+
var promptProcessParamsCodec = {
|
|
31
|
+
parse(value) {
|
|
32
|
+
const record = typeof value === "object" && value !== null ? value : {};
|
|
33
|
+
return { prompt: typeof record.prompt === "string" ? record.prompt : "" };
|
|
34
|
+
},
|
|
35
|
+
serialize(value) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
function promptLaunchResolution(options) {
|
|
40
|
+
return {
|
|
41
|
+
resolveDefaults: () => ({ prompt: options.defaultPrompt?.() ?? "" }),
|
|
42
|
+
resolveLaunchConfig(input) {
|
|
43
|
+
const inputPrompt = typeof input.prompt === "string" ? input.prompt.trim() : "";
|
|
44
|
+
const prompt = inputPrompt || options.defaultPrompt?.().trim() || "";
|
|
45
|
+
if (!prompt) {
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
errors: [{ code: "required", fieldId: "prompt", message: "prompt is required" }]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
ok: true,
|
|
53
|
+
launchConfig: {
|
|
54
|
+
processId: options.processId,
|
|
55
|
+
params: { prompt },
|
|
56
|
+
titleSourceFields: [{ label: options.titleLabel ?? "Prompt", value: prompt }],
|
|
57
|
+
startTurnId: options.startTurnId
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function createMarkdownLeafOutcome(rendererId) {
|
|
64
|
+
return {
|
|
65
|
+
rendererId,
|
|
66
|
+
capture(ctx) {
|
|
67
|
+
const markdown = ctx.turnRecord?.turnResultMarkdown?.trim() ?? "";
|
|
68
|
+
return {
|
|
69
|
+
rendererId,
|
|
70
|
+
schemaVersion: 1,
|
|
71
|
+
props: {
|
|
72
|
+
prompt: ctx.params.prompt,
|
|
73
|
+
markdown: markdown.length > 0 ? markdown : null,
|
|
74
|
+
leafEntryId: ctx.leaf.entryId,
|
|
75
|
+
turnRecordId: ctx.leaf.turnRecordId
|
|
76
|
+
},
|
|
77
|
+
fallbackMarkdown: markdown.length > 0 ? markdown : null
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function promptProcess(processId, displayName, entry) {
|
|
83
|
+
return flow.process(processId).displayName(displayName).entry(entry).codecs({ params: promptProcessParamsCodec, state: structuralStateCodec }).initialState(createEmptyStructuralProcessState).ui(
|
|
84
|
+
(api) => api.leafOutcome(
|
|
85
|
+
createMarkdownLeafOutcome(`@leitwerk-dev/showcase-processes:${processId}.leaf_outcome`)
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function buildSinglePromptInstruction(promptText) {
|
|
90
|
+
return `Run the following one-shot operator prompt exactly once.
|
|
91
|
+
|
|
92
|
+
${promptText}`;
|
|
93
|
+
}
|
|
94
|
+
function buildSinglePromptWithToolInstruction(promptText) {
|
|
95
|
+
return `${buildSinglePromptInstruction(promptText)}
|
|
96
|
+
|
|
97
|
+
When you are done, call the done tool with a short summary of the result.`;
|
|
98
|
+
}
|
|
99
|
+
function promptTurn(turnId, instruction = buildSinglePromptInstruction) {
|
|
100
|
+
return flow.llm(turnId).description("Run Prompt").tools("read", "bash", "edit", "write").prompt((ctx) => instruction(ctx.params.prompt));
|
|
101
|
+
}
|
|
102
|
+
function promptLauncher(options) {
|
|
103
|
+
return {
|
|
104
|
+
id: options.launcherId,
|
|
105
|
+
label: options.displayName,
|
|
106
|
+
description: options.description,
|
|
107
|
+
visibility: "ui",
|
|
108
|
+
ui: {
|
|
109
|
+
card: { title: options.displayName, description: options.cardDescription },
|
|
110
|
+
launchConfigSchema: {
|
|
111
|
+
id: options.formId,
|
|
112
|
+
title: options.displayName,
|
|
113
|
+
fields: [
|
|
114
|
+
{
|
|
115
|
+
id: "prompt",
|
|
116
|
+
label: "Prompt",
|
|
117
|
+
kind: "textarea",
|
|
118
|
+
required: true,
|
|
119
|
+
placeholder: options.placeholder,
|
|
120
|
+
description: options.promptDescription
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
submitLabel: options.submitLabel ?? "Run Prompt"
|
|
124
|
+
},
|
|
125
|
+
...promptLaunchResolution(options)
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
var singlePromptProcess = promptProcess(
|
|
130
|
+
"single_prompt_process",
|
|
131
|
+
"Single Prompt",
|
|
132
|
+
"run_single_prompt"
|
|
133
|
+
).turn(promptTurn("run_single_prompt").end("completed").complete()).launcher(
|
|
134
|
+
promptLauncher({
|
|
135
|
+
processId: "single_prompt_process",
|
|
136
|
+
startTurnId: "run_single_prompt",
|
|
137
|
+
displayName: "Single Prompt",
|
|
138
|
+
launcherId: "single_prompt_process.single_prompt_ui",
|
|
139
|
+
formId: "single_prompt_form",
|
|
140
|
+
description: "Run one prompt and finish on turn end",
|
|
141
|
+
cardDescription: "Run a one-shot prompt. The shared launcher shell chooses the model configuration.",
|
|
142
|
+
placeholder: "Say hello.",
|
|
143
|
+
promptDescription: "The exact prompt sent to Pi for this one-shot run. This version finishes when the assistant turn ends normally."
|
|
144
|
+
})
|
|
145
|
+
).define();
|
|
146
|
+
var singlePromptWithToolProcess = promptProcess(
|
|
147
|
+
"single_prompt_with_tool_process",
|
|
148
|
+
"Single Prompt + Done Tool",
|
|
149
|
+
"run_single_prompt_with_tool"
|
|
150
|
+
).turn(
|
|
151
|
+
promptTurn("run_single_prompt_with_tool", buildSinglePromptWithToolInstruction).outcomeTool(
|
|
152
|
+
"done",
|
|
153
|
+
(tool) => tool.description("Mark the prompt run as complete").requiredString("summary", "Short summary of the result").complete()
|
|
154
|
+
)
|
|
155
|
+
).launcher(
|
|
156
|
+
promptLauncher({
|
|
157
|
+
processId: "single_prompt_with_tool_process",
|
|
158
|
+
startTurnId: "run_single_prompt_with_tool",
|
|
159
|
+
displayName: "Single Prompt + Done Tool",
|
|
160
|
+
launcherId: "single_prompt_with_tool_process.single_prompt_with_tool_ui",
|
|
161
|
+
formId: "single_prompt_with_tool_form",
|
|
162
|
+
description: "Run one prompt and require an explicit done tool",
|
|
163
|
+
cardDescription: "Run a one-shot prompt and force an explicit done tool call. The shared launcher shell chooses the model configuration.",
|
|
164
|
+
placeholder: "Say hello, then call the done tool with a short summary.",
|
|
165
|
+
promptDescription: "The exact prompt sent to Pi for this one-shot run. This version requires the explicit done outcome tool.",
|
|
166
|
+
submitLabel: "Run Prompt + Tool"
|
|
167
|
+
})
|
|
168
|
+
).define();
|
|
169
|
+
function defineK8sSmokeProcess(args) {
|
|
170
|
+
const processId = `${args.baseId}_process`;
|
|
171
|
+
const runTurnId = `${args.baseId}_run`;
|
|
172
|
+
const waitTurnId = `${args.baseId}_wait`;
|
|
173
|
+
const promptField = args.promptField;
|
|
174
|
+
const launchResolution = promptLaunchResolution({
|
|
175
|
+
processId,
|
|
176
|
+
startTurnId: runTurnId,
|
|
177
|
+
defaultPrompt: () => args.defaultPrompt,
|
|
178
|
+
titleLabel: "Smoke"
|
|
179
|
+
});
|
|
180
|
+
const runTurn = flow.automatic(runTurnId).description(args.runTurnDescription).run(async (ctx) => {
|
|
181
|
+
const result = await args.run(ctx);
|
|
182
|
+
return { outcome: "ready", ...result };
|
|
183
|
+
}).outcome("ready", (outcome) => {
|
|
184
|
+
outcome.description(args.outcomeDescription);
|
|
185
|
+
args.describeOutcome?.(outcome);
|
|
186
|
+
return outcome.to(waitTurnId);
|
|
187
|
+
});
|
|
188
|
+
const waitTurn = flow.human(waitTurnId).description(args.waitDescription);
|
|
189
|
+
if (args.waitCommentary) {
|
|
190
|
+
waitTurn.commentary(args.waitCommentary);
|
|
191
|
+
}
|
|
192
|
+
if (args.runAgain) {
|
|
193
|
+
const runAgain = args.runAgain;
|
|
194
|
+
waitTurn.action(
|
|
195
|
+
"run_again",
|
|
196
|
+
(action) => action.label(runAgain.label).description(runAgain.description).acceptanceState("neutral").to(runTurnId)
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
waitTurn.action(
|
|
200
|
+
"complete",
|
|
201
|
+
(action) => action.label(args.completeLabel).acceptanceState("accepted").complete()
|
|
202
|
+
);
|
|
203
|
+
return flow.process(processId).displayName(args.displayName).entry(runTurnId).codecs({ params: promptProcessParamsCodec, state: structuralStateCodec }).initialState(() => createEmptyStructuralProcessState()).turn(runTurn).turn(waitTurn).launcher({
|
|
204
|
+
id: `${processId}.${args.baseId}_ui`,
|
|
205
|
+
label: args.displayName,
|
|
206
|
+
description: args.launcherDescription,
|
|
207
|
+
visibility: "ui",
|
|
208
|
+
ui: {
|
|
209
|
+
card: { title: args.displayName, description: args.cardDescription },
|
|
210
|
+
launchConfigSchema: {
|
|
211
|
+
id: `${args.baseId}_form`,
|
|
212
|
+
title: args.displayName,
|
|
213
|
+
fields: promptField ? [{ id: "prompt", label: promptField.label, kind: "text", required: true }] : [],
|
|
214
|
+
submitLabel: args.submitLabel
|
|
215
|
+
},
|
|
216
|
+
...promptField ? { resolveDefaults: launchResolution.resolveDefaults } : {},
|
|
217
|
+
resolveLaunchConfig: (input) => launchResolution.resolveLaunchConfig(promptField ? input : {})
|
|
218
|
+
}
|
|
219
|
+
}).define();
|
|
220
|
+
}
|
|
221
|
+
var k8sSmokeProcess = defineK8sSmokeProcess({
|
|
222
|
+
baseId: "k8s_smoke",
|
|
223
|
+
displayName: "Kubernetes Smoke",
|
|
224
|
+
runTurnDescription: "Run a deterministic worker-side Kubernetes smoke step",
|
|
225
|
+
outcomeDescription: "The worker-side smoke step completed",
|
|
226
|
+
describeOutcome: (outcome) => outcome.string("prompt", "The smoke prompt"),
|
|
227
|
+
waitDescription: "Wait after the Kubernetes smoke worker step",
|
|
228
|
+
waitCommentary: "The smoke worker is idle; actions can respawn it on the retained PVC.",
|
|
229
|
+
runAgain: { label: "Run smoke again", description: "Select the worker-side smoke turn again." },
|
|
230
|
+
completeLabel: "Complete smoke",
|
|
231
|
+
launcherDescription: "Run a deterministic worker-backed Kubernetes smoke process",
|
|
232
|
+
cardDescription: "Creates a worker pod/PVC and then waits for a follow-up action.",
|
|
233
|
+
submitLabel: "Run smoke",
|
|
234
|
+
promptField: { label: "Smoke prompt" },
|
|
235
|
+
defaultPrompt: "kind smoke",
|
|
236
|
+
run: (ctx) => ({
|
|
237
|
+
params: { prompt: ctx.params.prompt },
|
|
238
|
+
markdown: `Kubernetes smoke worker ran: ${ctx.params.prompt}`
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
var k8sSmokeSpecializedProcess = defineK8sSmokeProcess({
|
|
242
|
+
baseId: "k8s_smoke_specialized",
|
|
243
|
+
displayName: "Kubernetes Specialized Smoke",
|
|
244
|
+
runTurnDescription: "Verify the specialized Kubernetes worker image tool path",
|
|
245
|
+
outcomeDescription: "The specialized image tool ran",
|
|
246
|
+
describeOutcome: (outcome) => outcome.requiredString("output", "Tool output"),
|
|
247
|
+
waitDescription: "Wait after specialized image verification",
|
|
248
|
+
waitCommentary: "The specialized Kubernetes image was selected and executed its smoke tool.",
|
|
249
|
+
completeLabel: "Complete specialized smoke",
|
|
250
|
+
launcherDescription: "Run a deterministic worker-backed process on the specialized smoke image",
|
|
251
|
+
cardDescription: "Validates runtime-profile image selection with a deterministic tool.",
|
|
252
|
+
submitLabel: "Run specialized smoke",
|
|
253
|
+
defaultPrompt: "specialized",
|
|
254
|
+
run: () => {
|
|
255
|
+
const output = execFileSync("leitwerk-specialized-tool", { encoding: "utf8" }).trim();
|
|
256
|
+
return { params: { output }, markdown: output };
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
var k8sSmokeLongProcess = defineK8sSmokeProcess({
|
|
260
|
+
baseId: "k8s_smoke_long",
|
|
261
|
+
displayName: "Kubernetes Long Smoke",
|
|
262
|
+
runTurnDescription: "Stay busy long enough for server restart adoption tests",
|
|
263
|
+
outcomeDescription: "The long smoke step completed",
|
|
264
|
+
waitDescription: "Wait after long smoke",
|
|
265
|
+
completeLabel: "Complete long smoke",
|
|
266
|
+
launcherDescription: "Run a long worker-backed process for server restart adoption tests",
|
|
267
|
+
cardDescription: "Keeps a worker pod busy while the server restarts.",
|
|
268
|
+
submitLabel: "Run long smoke",
|
|
269
|
+
defaultPrompt: "long",
|
|
270
|
+
run: async () => {
|
|
271
|
+
await delay(9e4);
|
|
272
|
+
return { params: {}, markdown: "long smoke completed" };
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
var externalPromptCompletionTurnId = "await_external_prompt_completion";
|
|
276
|
+
var singlePromptExternalCompleteProcess = promptProcess(
|
|
277
|
+
"single_prompt_external_complete_process",
|
|
278
|
+
"Single Prompt + External Complete",
|
|
279
|
+
"run_single_prompt"
|
|
280
|
+
).turn(promptTurn("run_single_prompt").end("completed").to(externalPromptCompletionTurnId)).turn(
|
|
281
|
+
flow.external(externalPromptCompletionTurnId).description("Wait for an external completion trigger after the single prompt finishes").from(
|
|
282
|
+
fileExternal.presence({
|
|
283
|
+
path: "/tmp/complete-prompt",
|
|
284
|
+
pollInterval: "1s",
|
|
285
|
+
consume: "delete"
|
|
286
|
+
})
|
|
287
|
+
).complete()
|
|
288
|
+
).launcher(
|
|
289
|
+
promptLauncher({
|
|
290
|
+
processId: "single_prompt_external_complete_process",
|
|
291
|
+
startTurnId: "run_single_prompt",
|
|
292
|
+
displayName: "Single Prompt + External Complete",
|
|
293
|
+
launcherId: "single_prompt_external_complete_process.single_prompt_external_complete_ui",
|
|
294
|
+
formId: "single_prompt_external_complete_form",
|
|
295
|
+
description: "Run one prompt, then wait for the external complete trigger file",
|
|
296
|
+
cardDescription: "Run a one-shot prompt, preserve its result in the chronicle, and finish only when the external completion trigger fires.",
|
|
297
|
+
placeholder: "Say hello, then wait for the external completion file.",
|
|
298
|
+
promptDescription: "The prompt runs once. After it finishes, the process waits for the configured prompt-complete trigger file (default: /tmp/complete-prompt)."
|
|
299
|
+
})
|
|
300
|
+
).define();
|
|
301
|
+
|
|
302
|
+
// src/index.ts
|
|
303
|
+
var manifest = {
|
|
304
|
+
/** @internal */
|
|
305
|
+
id: "example-processes",
|
|
306
|
+
/** @internal */
|
|
307
|
+
version: "0.1.0"
|
|
308
|
+
};
|
|
309
|
+
var exampleProcessesExtension = {
|
|
310
|
+
manifest,
|
|
311
|
+
setupCatalog(api) {
|
|
312
|
+
api.registerProcess(singlePromptProcess);
|
|
313
|
+
api.registerProcess(singlePromptWithToolProcess);
|
|
314
|
+
api.registerProcess(singlePromptExternalCompleteProcess);
|
|
315
|
+
api.registerProcess(k8sSmokeProcess);
|
|
316
|
+
api.registerProcess(k8sSmokeSpecializedProcess);
|
|
317
|
+
api.registerProcess(k8sSmokeLongProcess);
|
|
318
|
+
},
|
|
319
|
+
setupServer(api, rawConfig) {
|
|
320
|
+
const deps = api.get(coreHostCapabilities.serverSetup);
|
|
321
|
+
if (!deps || Array.isArray(deps)) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const config = rawConfig ?? {};
|
|
325
|
+
createFileExternalSourceProvider(deps, {
|
|
326
|
+
id: "example-file-external",
|
|
327
|
+
kind: FILE_EXTERNAL_PRESENCE_KIND,
|
|
328
|
+
inputMode: "none",
|
|
329
|
+
aliases: { "/tmp/complete-prompt": config.file_triggers?.complete_prompt_path }
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
var index_default = exampleProcessesExtension;
|
|
334
|
+
export {
|
|
335
|
+
index_default as default
|
|
336
|
+
};
|
|
337
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/file-external.ts","../src/process-definition.ts"],"sourcesContent":["import {\n\tcoreHostCapabilities,\n\tcreateFileExternalSourceProvider,\n\ttype LeitwerkExtensionModule,\n} from \"@leitwerk-dev/process-sdk\";\nimport { FILE_EXTERNAL_PRESENCE_KIND } from \"./file-external.js\";\nimport {\n\tk8sSmokeLongProcess,\n\tk8sSmokeProcess,\n\tk8sSmokeSpecializedProcess,\n\tsinglePromptExternalCompleteProcess,\n\tsinglePromptProcess,\n\tsinglePromptWithToolProcess,\n} from \"./process-definition.js\";\n\n/** @internal */\ninterface ExampleProcessesConfig {\n\t/** @internal */\n\tfile_triggers?: {\n\t\t/** @internal */\n\t\tpoll_interval?: string;\n\t\t/** @internal */\n\t\tcomplete_prompt_path?: string;\n\t};\n}\n\n/** @internal */\nconst manifest = {\n\t/** @internal */\n\tid: \"example-processes\",\n\t/** @internal */\n\tversion: \"0.1.0\",\n} as const;\n\n/** @public */\nconst exampleProcessesExtension: LeitwerkExtensionModule = {\n\tmanifest,\n\tsetupCatalog(api) {\n\t\tapi.registerProcess(singlePromptProcess);\n\t\tapi.registerProcess(singlePromptWithToolProcess);\n\t\tapi.registerProcess(singlePromptExternalCompleteProcess);\n\t\tapi.registerProcess(k8sSmokeProcess);\n\t\tapi.registerProcess(k8sSmokeSpecializedProcess);\n\t\tapi.registerProcess(k8sSmokeLongProcess);\n\t},\n\tsetupServer(api, rawConfig) {\n\t\tconst deps = api.get(coreHostCapabilities.serverSetup);\n\t\tif (!deps || Array.isArray(deps)) {\n\t\t\treturn;\n\t\t}\n\t\tconst config = (rawConfig ?? {}) as ExampleProcessesConfig;\n\t\tcreateFileExternalSourceProvider(deps, {\n\t\t\tid: \"example-file-external\",\n\t\t\tkind: FILE_EXTERNAL_PRESENCE_KIND,\n\t\t\tinputMode: \"none\",\n\t\t\taliases: { \"/tmp/complete-prompt\": config.file_triggers?.complete_prompt_path },\n\t\t});\n\t},\n};\n\nexport default exampleProcessesExtension;\n","import { defineFileExternalSource, type FileExternalInput } from \"@leitwerk-dev/process-sdk\";\n\n// Keep the persisted source kind stable when moving the process between extensions.\n/** @internal */\nexport const FILE_EXTERNAL_PRESENCE_KIND = \"@leitwerk-dev/showcase-processes.file.presence\";\n\n/** @internal */\nexport const fileExternal = {\n\t/** @internal */\n\tpresence(input: FileExternalInput) {\n\t\treturn defineFileExternalSource(input, {\n\t\t\tkind: FILE_EXTERNAL_PRESENCE_KIND,\n\t\t\tlabel: `File present: ${input.path}`,\n\t\t\tdescription: `Fires when ${input.path} exists`,\n\t\t\tinputMode: \"none\",\n\t\t});\n\t},\n};\n","import { execFileSync } from \"node:child_process\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport {\n\ttype AutomaticOutcomeBuilder,\n\ttype Codec,\n\tcreateEmptyStructuralProcessState,\n\ttype ExtensionProcessDefinition,\n\tflow,\n\ttype HumanFlowBuilder,\n\ttype ProcessLauncherDefinition,\n\ttype ProcessLeafOutcomeDefinition,\n\ttype StructuralProcessState,\n\tstructuralStateCodec,\n} from \"@leitwerk-dev/process-sdk\";\nimport { fileExternal } from \"./file-external.js\";\n\n/** @internal */\ninterface PromptProcessParams {\n\t/** @internal */\n\tprompt: string;\n}\n\nconst promptProcessParamsCodec: Codec<PromptProcessParams> = {\n\tparse(value) {\n\t\tconst record =\n\t\t\ttypeof value === \"object\" && value !== null ? (value as Record<string, unknown>) : {};\n\t\treturn { prompt: typeof record.prompt === \"string\" ? record.prompt : \"\" };\n\t},\n\tserialize(value) {\n\t\treturn value;\n\t},\n};\n\nfunction promptLaunchResolution(options: {\n\tprocessId: string;\n\tstartTurnId: string;\n\tdefaultPrompt?: () => string;\n\ttitleLabel?: string;\n}) {\n\treturn {\n\t\tresolveDefaults: () => ({ prompt: options.defaultPrompt?.() ?? \"\" }),\n\t\tresolveLaunchConfig(input: Record<string, unknown>) {\n\t\t\tconst inputPrompt = typeof input.prompt === \"string\" ? input.prompt.trim() : \"\";\n\t\t\tconst prompt = inputPrompt || options.defaultPrompt?.().trim() || \"\";\n\t\t\tif (!prompt) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false as const,\n\t\t\t\t\terrors: [{ code: \"required\", fieldId: \"prompt\", message: \"prompt is required\" }],\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: true as const,\n\t\t\t\tlaunchConfig: {\n\t\t\t\t\tprocessId: options.processId,\n\t\t\t\t\tparams: { prompt },\n\t\t\t\t\ttitleSourceFields: [{ label: options.titleLabel ?? \"Prompt\", value: prompt }],\n\t\t\t\t\tstartTurnId: options.startTurnId,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction createMarkdownLeafOutcome(rendererId: string) {\n\treturn {\n\t\trendererId,\n\t\tcapture(ctx) {\n\t\t\tconst markdown = ctx.turnRecord?.turnResultMarkdown?.trim() ?? \"\";\n\t\t\treturn {\n\t\t\t\trendererId,\n\t\t\t\tschemaVersion: 1,\n\t\t\t\tprops: {\n\t\t\t\t\tprompt: ctx.params.prompt,\n\t\t\t\t\tmarkdown: markdown.length > 0 ? markdown : null,\n\t\t\t\t\tleafEntryId: ctx.leaf.entryId,\n\t\t\t\t\tturnRecordId: ctx.leaf.turnRecordId,\n\t\t\t\t},\n\t\t\t\tfallbackMarkdown: markdown.length > 0 ? markdown : null,\n\t\t\t};\n\t\t},\n\t} satisfies ProcessLeafOutcomeDefinition<PromptProcessParams, StructuralProcessState>;\n}\n\nfunction promptProcess(processId: string, displayName: string, entry: string) {\n\treturn flow\n\t\t.process<PromptProcessParams, StructuralProcessState>(processId)\n\t\t.displayName(displayName)\n\t\t.entry(entry)\n\t\t.codecs({ params: promptProcessParamsCodec, state: structuralStateCodec })\n\t\t.initialState(createEmptyStructuralProcessState)\n\t\t.ui((api) =>\n\t\t\tapi.leafOutcome(\n\t\t\t\tcreateMarkdownLeafOutcome(`@leitwerk-dev/showcase-processes:${processId}.leaf_outcome`),\n\t\t\t),\n\t\t);\n}\n\nfunction buildSinglePromptInstruction(promptText: string): string {\n\treturn `Run the following one-shot operator prompt exactly once.\n\n${promptText}`;\n}\n\nfunction buildSinglePromptWithToolInstruction(promptText: string): string {\n\treturn `${buildSinglePromptInstruction(promptText)}\n\nWhen you are done, call the done tool with a short summary of the result.`;\n}\n\nfunction promptTurn(turnId: string, instruction = buildSinglePromptInstruction) {\n\treturn flow\n\t\t.llm<PromptProcessParams, StructuralProcessState>(turnId)\n\t\t.description(\"Run Prompt\")\n\t\t.tools(\"read\", \"bash\", \"edit\", \"write\")\n\t\t.prompt((ctx) => instruction(ctx.params.prompt));\n}\n\nfunction promptLauncher(options: {\n\tprocessId: string;\n\tstartTurnId: string;\n\tdisplayName: string;\n\tlauncherId: string;\n\tformId: string;\n\tdescription: string;\n\tcardDescription: string;\n\tplaceholder: string;\n\tpromptDescription: string;\n\tsubmitLabel?: string;\n}): ProcessLauncherDefinition<PromptProcessParams> {\n\treturn {\n\t\tid: options.launcherId,\n\t\tlabel: options.displayName,\n\t\tdescription: options.description,\n\t\tvisibility: \"ui\",\n\t\tui: {\n\t\t\tcard: { title: options.displayName, description: options.cardDescription },\n\t\t\tlaunchConfigSchema: {\n\t\t\t\tid: options.formId,\n\t\t\t\ttitle: options.displayName,\n\t\t\t\tfields: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"prompt\",\n\t\t\t\t\t\tlabel: \"Prompt\",\n\t\t\t\t\t\tkind: \"textarea\",\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tplaceholder: options.placeholder,\n\t\t\t\t\t\tdescription: options.promptDescription,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsubmitLabel: options.submitLabel ?? \"Run Prompt\",\n\t\t\t},\n\t\t\t...promptLaunchResolution(options),\n\t\t},\n\t};\n}\n\n/** @internal */\nexport const singlePromptProcess = promptProcess(\n\t\"single_prompt_process\",\n\t\"Single Prompt\",\n\t\"run_single_prompt\",\n)\n\t.turn(promptTurn(\"run_single_prompt\").end(\"completed\").complete())\n\t.launcher(\n\t\tpromptLauncher({\n\t\t\tprocessId: \"single_prompt_process\",\n\t\t\tstartTurnId: \"run_single_prompt\",\n\t\t\tdisplayName: \"Single Prompt\",\n\t\t\tlauncherId: \"single_prompt_process.single_prompt_ui\",\n\t\t\tformId: \"single_prompt_form\",\n\t\t\tdescription: \"Run one prompt and finish on turn end\",\n\t\t\tcardDescription:\n\t\t\t\t\"Run a one-shot prompt. The shared launcher shell chooses the model configuration.\",\n\t\t\tplaceholder: \"Say hello.\",\n\t\t\tpromptDescription:\n\t\t\t\t\"The exact prompt sent to Pi for this one-shot run. This version finishes when the assistant turn ends normally.\",\n\t\t}),\n\t)\n\t.define();\n\n/** @internal */\nexport const singlePromptWithToolProcess = promptProcess(\n\t\"single_prompt_with_tool_process\",\n\t\"Single Prompt + Done Tool\",\n\t\"run_single_prompt_with_tool\",\n)\n\t.turn(\n\t\tpromptTurn(\"run_single_prompt_with_tool\", buildSinglePromptWithToolInstruction).outcomeTool(\n\t\t\t\"done\",\n\t\t\t(tool) =>\n\t\t\t\ttool\n\t\t\t\t\t.description(\"Mark the prompt run as complete\")\n\t\t\t\t\t.requiredString(\"summary\", \"Short summary of the result\")\n\t\t\t\t\t.complete(),\n\t\t),\n\t)\n\t.launcher(\n\t\tpromptLauncher({\n\t\t\tprocessId: \"single_prompt_with_tool_process\",\n\t\t\tstartTurnId: \"run_single_prompt_with_tool\",\n\t\t\tdisplayName: \"Single Prompt + Done Tool\",\n\t\t\tlauncherId: \"single_prompt_with_tool_process.single_prompt_with_tool_ui\",\n\t\t\tformId: \"single_prompt_with_tool_form\",\n\t\t\tdescription: \"Run one prompt and require an explicit done tool\",\n\t\t\tcardDescription:\n\t\t\t\t\"Run a one-shot prompt and force an explicit done tool call. The shared launcher shell chooses the model configuration.\",\n\t\t\tplaceholder: \"Say hello, then call the done tool with a short summary.\",\n\t\t\tpromptDescription:\n\t\t\t\t\"The exact prompt sent to Pi for this one-shot run. This version requires the explicit done outcome tool.\",\n\t\t\tsubmitLabel: \"Run Prompt + Tool\",\n\t\t}),\n\t)\n\t.define();\n\ntype SmokeOutcomeBuilder = AutomaticOutcomeBuilder<PromptProcessParams, StructuralProcessState>;\ntype SmokeRunFn = (ctx: {\n\tparams: PromptProcessParams;\n}) =>\n\t| { params: Record<string, unknown>; markdown: string }\n\t| Promise<{ params: Record<string, unknown>; markdown: string }>;\n\n/**\n * Builds one of the Kubernetes smoke fixtures: an automatic worker run turn that\n * hands off to a wait turn with a `complete` action (and an optional `run_again`\n * action), plus a UI launcher. The three fixtures share this skeleton and differ\n * only in their ids, run body, and outcome parameter shape.\n */\nfunction defineK8sSmokeProcess(args: {\n\tbaseId: string;\n\tdisplayName: string;\n\trunTurnDescription: string;\n\toutcomeDescription: string;\n\tdescribeOutcome?: (outcome: SmokeOutcomeBuilder) => void;\n\twaitDescription: string;\n\twaitCommentary?: string;\n\trunAgain?: { label: string; description: string };\n\tcompleteLabel: string;\n\tlauncherDescription: string;\n\tcardDescription: string;\n\tsubmitLabel: string;\n\tpromptField?: { label: string };\n\tdefaultPrompt: string;\n\trun: SmokeRunFn;\n}): ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState> {\n\tconst processId = `${args.baseId}_process`;\n\tconst runTurnId = `${args.baseId}_run`;\n\tconst waitTurnId = `${args.baseId}_wait`;\n\tconst promptField = args.promptField;\n\tconst launchResolution = promptLaunchResolution({\n\t\tprocessId,\n\t\tstartTurnId: runTurnId,\n\t\tdefaultPrompt: () => args.defaultPrompt,\n\t\ttitleLabel: \"Smoke\",\n\t});\n\n\tconst runTurn = flow\n\t\t.automatic<PromptProcessParams, StructuralProcessState>(runTurnId)\n\t\t.description(args.runTurnDescription)\n\t\t.run(async (ctx) => {\n\t\t\tconst result = await args.run(ctx);\n\t\t\treturn { outcome: \"ready\" as const, ...result };\n\t\t})\n\t\t.outcome(\"ready\", (outcome) => {\n\t\t\toutcome.description(args.outcomeDescription);\n\t\t\targs.describeOutcome?.(outcome);\n\t\t\treturn outcome.to(waitTurnId);\n\t\t});\n\n\tconst waitTurn: HumanFlowBuilder<PromptProcessParams, StructuralProcessState> = flow\n\t\t.human<PromptProcessParams, StructuralProcessState>(waitTurnId)\n\t\t.description(args.waitDescription);\n\tif (args.waitCommentary) {\n\t\twaitTurn.commentary(args.waitCommentary);\n\t}\n\tif (args.runAgain) {\n\t\tconst runAgain = args.runAgain;\n\t\twaitTurn.action(\"run_again\", (action) =>\n\t\t\taction\n\t\t\t\t.label(runAgain.label)\n\t\t\t\t.description(runAgain.description)\n\t\t\t\t.acceptanceState(\"neutral\")\n\t\t\t\t.to(runTurnId),\n\t\t);\n\t}\n\twaitTurn.action(\"complete\", (action) =>\n\t\taction.label(args.completeLabel).acceptanceState(\"accepted\").complete(),\n\t);\n\n\treturn flow\n\t\t.process<PromptProcessParams, StructuralProcessState>(processId)\n\t\t.displayName(args.displayName)\n\t\t.entry(runTurnId)\n\t\t.codecs({ params: promptProcessParamsCodec, state: structuralStateCodec })\n\t\t.initialState(() => createEmptyStructuralProcessState())\n\t\t.turn(runTurn)\n\t\t.turn(waitTurn)\n\t\t.launcher({\n\t\t\tid: `${processId}.${args.baseId}_ui`,\n\t\t\tlabel: args.displayName,\n\t\t\tdescription: args.launcherDescription,\n\t\t\tvisibility: \"ui\",\n\t\t\tui: {\n\t\t\t\tcard: { title: args.displayName, description: args.cardDescription },\n\t\t\t\tlaunchConfigSchema: {\n\t\t\t\t\tid: `${args.baseId}_form`,\n\t\t\t\t\ttitle: args.displayName,\n\t\t\t\t\tfields: promptField\n\t\t\t\t\t\t? [{ id: \"prompt\", label: promptField.label, kind: \"text\", required: true }]\n\t\t\t\t\t\t: [],\n\t\t\t\t\tsubmitLabel: args.submitLabel,\n\t\t\t\t},\n\t\t\t\t...(promptField ? { resolveDefaults: launchResolution.resolveDefaults } : {}),\n\t\t\t\tresolveLaunchConfig: (input) =>\n\t\t\t\t\tlaunchResolution.resolveLaunchConfig(promptField ? input : {}),\n\t\t\t},\n\t\t})\n\t\t.define();\n}\n\n/** @internal */\nexport const k8sSmokeProcess = defineK8sSmokeProcess({\n\tbaseId: \"k8s_smoke\",\n\tdisplayName: \"Kubernetes Smoke\",\n\trunTurnDescription: \"Run a deterministic worker-side Kubernetes smoke step\",\n\toutcomeDescription: \"The worker-side smoke step completed\",\n\tdescribeOutcome: (outcome) => outcome.string(\"prompt\", \"The smoke prompt\"),\n\twaitDescription: \"Wait after the Kubernetes smoke worker step\",\n\twaitCommentary: \"The smoke worker is idle; actions can respawn it on the retained PVC.\",\n\trunAgain: { label: \"Run smoke again\", description: \"Select the worker-side smoke turn again.\" },\n\tcompleteLabel: \"Complete smoke\",\n\tlauncherDescription: \"Run a deterministic worker-backed Kubernetes smoke process\",\n\tcardDescription: \"Creates a worker pod/PVC and then waits for a follow-up action.\",\n\tsubmitLabel: \"Run smoke\",\n\tpromptField: { label: \"Smoke prompt\" },\n\tdefaultPrompt: \"kind smoke\",\n\trun: (ctx) => ({\n\t\tparams: { prompt: ctx.params.prompt },\n\t\tmarkdown: `Kubernetes smoke worker ran: ${ctx.params.prompt}`,\n\t}),\n});\n\n/** @internal */\nexport const k8sSmokeSpecializedProcess = defineK8sSmokeProcess({\n\tbaseId: \"k8s_smoke_specialized\",\n\tdisplayName: \"Kubernetes Specialized Smoke\",\n\trunTurnDescription: \"Verify the specialized Kubernetes worker image tool path\",\n\toutcomeDescription: \"The specialized image tool ran\",\n\tdescribeOutcome: (outcome) => outcome.requiredString(\"output\", \"Tool output\"),\n\twaitDescription: \"Wait after specialized image verification\",\n\twaitCommentary: \"The specialized Kubernetes image was selected and executed its smoke tool.\",\n\tcompleteLabel: \"Complete specialized smoke\",\n\tlauncherDescription: \"Run a deterministic worker-backed process on the specialized smoke image\",\n\tcardDescription: \"Validates runtime-profile image selection with a deterministic tool.\",\n\tsubmitLabel: \"Run specialized smoke\",\n\tdefaultPrompt: \"specialized\",\n\trun: () => {\n\t\tconst output = execFileSync(\"leitwerk-specialized-tool\", { encoding: \"utf8\" }).trim();\n\t\treturn { params: { output }, markdown: output };\n\t},\n});\n\n/** @internal */\nexport const k8sSmokeLongProcess = defineK8sSmokeProcess({\n\tbaseId: \"k8s_smoke_long\",\n\tdisplayName: \"Kubernetes Long Smoke\",\n\trunTurnDescription: \"Stay busy long enough for server restart adoption tests\",\n\toutcomeDescription: \"The long smoke step completed\",\n\twaitDescription: \"Wait after long smoke\",\n\tcompleteLabel: \"Complete long smoke\",\n\tlauncherDescription: \"Run a long worker-backed process for server restart adoption tests\",\n\tcardDescription: \"Keeps a worker pod busy while the server restarts.\",\n\tsubmitLabel: \"Run long smoke\",\n\tdefaultPrompt: \"long\",\n\trun: async () => {\n\t\tawait delay(90_000);\n\t\treturn { params: {}, markdown: \"long smoke completed\" };\n\t},\n});\n\nconst externalPromptCompletionTurnId = \"await_external_prompt_completion\";\n\n/** @internal */\nexport const singlePromptExternalCompleteProcess = promptProcess(\n\t\"single_prompt_external_complete_process\",\n\t\"Single Prompt + External Complete\",\n\t\"run_single_prompt\",\n)\n\t.turn(promptTurn(\"run_single_prompt\").end(\"completed\").to(externalPromptCompletionTurnId))\n\t.turn(\n\t\tflow\n\t\t\t.external<PromptProcessParams, StructuralProcessState>(externalPromptCompletionTurnId)\n\t\t\t.description(\"Wait for an external completion trigger after the single prompt finishes\")\n\t\t\t.from(\n\t\t\t\tfileExternal.presence({\n\t\t\t\t\tpath: \"/tmp/complete-prompt\",\n\t\t\t\t\tpollInterval: \"1s\",\n\t\t\t\t\tconsume: \"delete\",\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.complete(),\n\t)\n\t.launcher(\n\t\tpromptLauncher({\n\t\t\tprocessId: \"single_prompt_external_complete_process\",\n\t\t\tstartTurnId: \"run_single_prompt\",\n\t\t\tdisplayName: \"Single Prompt + External Complete\",\n\t\t\tlauncherId: \"single_prompt_external_complete_process.single_prompt_external_complete_ui\",\n\t\t\tformId: \"single_prompt_external_complete_form\",\n\t\t\tdescription: \"Run one prompt, then wait for the external complete trigger file\",\n\t\t\tcardDescription:\n\t\t\t\t\"Run a one-shot prompt, preserve its result in the chronicle, and finish only when the external completion trigger fires.\",\n\t\t\tplaceholder: \"Say hello, then wait for the external completion file.\",\n\t\t\tpromptDescription:\n\t\t\t\t\"The prompt runs once. After it finishes, the process waits for the configured prompt-complete trigger file (default: /tmp/complete-prompt).\",\n\t\t}),\n\t)\n\t.define();\n"],"mappings":";AAAA;AAAA,EACC;AAAA,EACA;AAAA,OAEM;;;ACJP,SAAS,gCAAwD;AAI1D,IAAM,8BAA8B;AAGpC,IAAM,eAAe;AAAA;AAAA,EAE3B,SAAS,OAA0B;AAClC,WAAO,yBAAyB,OAAO;AAAA,MACtC,MAAM;AAAA,MACN,OAAO,iBAAiB,MAAM,IAAI;AAAA,MAClC,aAAa,cAAc,MAAM,IAAI;AAAA,MACrC,WAAW;AAAA,IACZ,CAAC;AAAA,EACF;AACD;;;ACjBA,SAAS,oBAAoB;AAC7B,SAAS,cAAc,aAAa;AACpC;AAAA,EAGC;AAAA,EAEA;AAAA,EAKA;AAAA,OACM;AASP,IAAM,2BAAuD;AAAA,EAC5D,MAAM,OAAO;AACZ,UAAM,SACL,OAAO,UAAU,YAAY,UAAU,OAAQ,QAAoC,CAAC;AACrF,WAAO,EAAE,QAAQ,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS,GAAG;AAAA,EACzE;AAAA,EACA,UAAU,OAAO;AAChB,WAAO;AAAA,EACR;AACD;AAEA,SAAS,uBAAuB,SAK7B;AACF,SAAO;AAAA,IACN,iBAAiB,OAAO,EAAE,QAAQ,QAAQ,gBAAgB,KAAK,GAAG;AAAA,IAClE,oBAAoB,OAAgC;AACnD,YAAM,cAAc,OAAO,MAAM,WAAW,WAAW,MAAM,OAAO,KAAK,IAA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BAAmB,EAAE,IAAI,WAAW,EAAE,GAAG,8BAA8B,CAAC,EACxF;AAAA,EACA,KACE,SAAsD,8BAA8B,EACpF,YAAY,0EAA0E,EACtF;AAAA,IACA,aAAa,SAAS;AAAA,MACrB,MAAM;AAAA,MACN,cAAc;AAAA,MACd,SAAS;AAAA,IACV,CAAC;AAAA,EACF,EACC,SAAS;AACZ,EACC;AAAA,EACA,eAAe;AAAA,IACd,WAAW;AAAA,IACX,aAAa;AAAA,IACb,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,iBACC;AAAA,IACD,aAAa;AAAA,IACb,mBACC;AAAA,EACF,CAAC;AACF,EACC,OAAO;;;AFrYT,IAAM,WAAW;AAAA;AAAA,EAEhB,IAAI;AAAA;AAAA,EAEJ,SAAS;AACV;AAGA,IAAM,4BAAqD;AAAA,EAC1D;AAAA,EACA,aAAa,KAAK;AACjB,QAAI,gBAAgB,mBAAmB;AACvC,QAAI,gBAAgB,2BAA2B;AAC/C,QAAI,gBAAgB,mCAAmC;AACvD,QAAI,gBAAgB,eAAe;AACnC,QAAI,gBAAgB,0BAA0B;AAC9C,QAAI,gBAAgB,mBAAmB;AAAA,EACxC;AAAA,EACA,YAAY,KAAK,WAAW;AAC3B,UAAM,OAAO,IAAI,IAAI,qBAAqB,WAAW;AACrD,QAAI,CAAC,QAAQ,MAAM,QAAQ,IAAI,GAAG;AACjC;AAAA,IACD;AACA,UAAM,SAAU,aAAa,CAAC;AAC9B,qCAAiC,MAAM;AAAA,MACtC,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA,MACX,SAAS,EAAE,wBAAwB,OAAO,eAAe,qBAAqB;AAAA,IAC/E,CAAC;AAAA,EACF;AACD;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ExtensionProcessDefinition, type StructuralProcessState } from "@leitwerk-dev/process-sdk";
|
|
2
|
+
/** @internal */
|
|
3
|
+
interface PromptProcessParams {
|
|
4
|
+
/** @internal */
|
|
5
|
+
prompt: string;
|
|
6
|
+
}
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const singlePromptProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const singlePromptWithToolProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const k8sSmokeProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const k8sSmokeSpecializedProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const k8sSmokeLongProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const singlePromptExternalCompleteProcess: ExtensionProcessDefinition<PromptProcessParams, StructuralProcessState>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=process-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-definition.d.ts","sourceRoot":"","sources":["../src/process-definition.ts"],"names":[],"mappings":"AAEA,OAAO,EAIN,KAAK,0BAA0B,EAK/B,KAAK,sBAAsB,EAE3B,MAAM,2BAA2B,CAAC;AAGnC,gBAAgB;AAChB,UAAU,mBAAmB;IAC5B,gBAAgB;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAwID,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,yEAqBtB,CAAC;AAEX,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,yEA+B9B,CAAC;AA2GX,gBAAgB;AAChB,eAAO,MAAM,eAAe,yEAmB1B,CAAC;AAEH,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,yEAiBrC,CAAC;AAEH,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,yEAe9B,CAAC;AAIH,gBAAgB;AAChB,eAAO,MAAM,mCAAmC,yEAkCtC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ExtensionIntegrationHarnessOptions } from "@leitwerk-dev/test-support/integration";
|
|
2
|
+
export declare function createExampleHarness(options?: Partial<ExtensionIntegrationHarnessOptions>): Promise<import("@leitwerk-dev/test-support/integration").ExtensionIntegrationHarness>;
|
|
3
|
+
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/testing/harness.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,kCAAkC,EACvC,MAAM,wCAAwC,CAAC;AAGhD,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,OAAO,CAAC,kCAAkC,CAAM,yFAqC7F"}
|