@leitwerk-dev/showcase-processes 0.3.1 → 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 +6 -25
- package/dist/file-external.d.ts +2 -22
- package/dist/file-external.d.ts.map +1 -1
- package/dist/filesystem-watcher.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -721
- package/dist/index.js.map +1 -1
- package/dist/process-definition.d.ts +2 -14
- package/dist/process-definition.d.ts.map +1 -1
- package/dist/testing/harness.d.ts +2 -38
- package/dist/testing/harness.d.ts.map +1 -1
- package/dist/ui/manifest.json +0 -12
- package/package.json +4 -4
- package/src/file-external.ts +6 -253
- package/src/filesystem-watcher.ts +4 -3
- package/src/index.ts +15 -36
- package/src/process-definition.ts +54 -606
- package/src/testing/harness.ts +7 -68
- package/src/ui/manifest.json +0 -12
- package/dist/trigger-files.d.ts +0 -15
- package/dist/trigger-files.d.ts.map +0 -1
- package/dist/turns/external-complete.d.ts +0 -11
- package/dist/turns/external-complete.d.ts.map +0 -1
- package/dist/turns/run-single-prompt.d.ts +0 -14
- package/dist/turns/run-single-prompt.d.ts.map +0 -1
- package/dist/ui/assets/leaf-outcome-element.js +0 -245
- package/dist/ui/assets/leaf-outcome-element.js.map +0 -1
- package/dist/ui/leaf-outcome-element.d.ts +0 -2
- package/dist/ui/leaf-outcome-element.d.ts.map +0 -1
- package/src/trigger-files.ts +0 -47
- package/src/turns/external-complete.ts +0 -12
- package/src/turns/run-single-prompt.ts +0 -76
- package/src/ui/leaf-outcome-element.ts +0 -95
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
escapeLeafOutcomeHtml,
|
|
3
|
-
LeafOutcomeCustomElement,
|
|
4
|
-
} from "@leitwerk-dev/process-sdk/leaf-outcome-renderer";
|
|
5
|
-
|
|
6
|
-
interface SinglePromptLeafOutcomePayload {
|
|
7
|
-
prompt?: unknown;
|
|
8
|
-
markdown?: unknown;
|
|
9
|
-
leafEntryId?: unknown;
|
|
10
|
-
turnRecordId?: unknown;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const TAG_NAME = "o2-showcase-processes-leaf-outcome";
|
|
14
|
-
|
|
15
|
-
class SinglePromptLeafOutcomeElement extends LeafOutcomeCustomElement<SinglePromptLeafOutcomePayload> {
|
|
16
|
-
protected renderContent(): void {
|
|
17
|
-
if (!this.canRender()) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const runtime = this.runtime;
|
|
21
|
-
if (!runtime) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const payload = this.payload;
|
|
25
|
-
const markdown = typeof payload?.markdown === "string" ? payload.markdown.trim() : "";
|
|
26
|
-
if (!markdown) {
|
|
27
|
-
this.emitError(
|
|
28
|
-
"missing_markdown_payload",
|
|
29
|
-
"The selected-leaf snapshot payload did not include markdown content.",
|
|
30
|
-
);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const prompt = typeof payload?.prompt === "string" ? payload.prompt.trim() : "";
|
|
34
|
-
const relativeTime =
|
|
35
|
-
this.meta && typeof this.meta.createdAt === "string"
|
|
36
|
-
? runtime.formatRelativeTime(this.meta.createdAt)
|
|
37
|
-
: null;
|
|
38
|
-
const promptMarkup = prompt ? `<p class="prompt">${escapeLeafOutcomeHtml(prompt)}</p>` : "";
|
|
39
|
-
const metaMarkup = relativeTime
|
|
40
|
-
? `<p class="meta">Captured ${escapeLeafOutcomeHtml(relativeTime)}</p>`
|
|
41
|
-
: "";
|
|
42
|
-
this.shadowRootRef.innerHTML = `
|
|
43
|
-
<style>
|
|
44
|
-
:host {
|
|
45
|
-
display: block;
|
|
46
|
-
color: var(--o2-text, #1f2933);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.wrap {
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
gap: var(--o2-space-md, 12px);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.prompt,
|
|
56
|
-
.meta {
|
|
57
|
-
margin: 0;
|
|
58
|
-
font-size: 12px;
|
|
59
|
-
line-height: 1.5;
|
|
60
|
-
color: var(--o2-text-muted, #667085);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.prompt {
|
|
64
|
-
padding: var(--o2-space-sm, 8px) 0;
|
|
65
|
-
border-top: 1px solid color-mix(in srgb, var(--o2-border, #ddd4c8) 78%, white 22%);
|
|
66
|
-
border-bottom: 1px solid color-mix(in srgb, var(--o2-border, #ddd4c8) 54%, white 46%);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.markdown {
|
|
70
|
-
color: var(--o2-text, #1f2933);
|
|
71
|
-
font-size: 14px;
|
|
72
|
-
line-height: 1.65;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.markdown :where(*:first-child) {
|
|
76
|
-
margin-top: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.markdown :where(*:last-child) {
|
|
80
|
-
margin-bottom: 0;
|
|
81
|
-
}
|
|
82
|
-
</style>
|
|
83
|
-
<article class="wrap" data-renderer="showcase-processes-leaf-outcome">
|
|
84
|
-
${promptMarkup}
|
|
85
|
-
<div class="markdown">${runtime.markdown.render(markdown)}</div>
|
|
86
|
-
${metaMarkup}
|
|
87
|
-
</article>
|
|
88
|
-
`;
|
|
89
|
-
this.emitReady();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (!customElements.get(TAG_NAME)) {
|
|
94
|
-
customElements.define(TAG_NAME, SinglePromptLeafOutcomeElement);
|
|
95
|
-
}
|