@leitwerk-dev/server 0.1.6 → 0.1.8
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/dist/app.d.ts.map +1 -1
- package/dist/app.js +31 -40
- package/dist/app.js.map +1 -1
- package/dist/auth/auth-client.d.ts +25 -0
- package/dist/auth/auth-client.d.ts.map +1 -0
- package/dist/auth/auth-client.js +19 -0
- package/dist/auth/auth-client.js.map +1 -0
- package/dist/auth/auth-config.d.ts +8 -2
- package/dist/auth/auth-config.d.ts.map +1 -1
- package/dist/auth/auth-config.js +17 -7
- package/dist/auth/auth-config.js.map +1 -1
- package/dist/auth/auth-service.d.ts +2 -0
- package/dist/auth/auth-service.d.ts.map +1 -1
- package/dist/auth/auth-service.js +9 -5
- package/dist/auth/auth-service.js.map +1 -1
- package/dist/auth/auth-test-helpers.js +2 -2
- package/dist/auth/auth-test-helpers.js.map +1 -1
- package/dist/auth/github-oauth-client.d.ts +20 -0
- package/dist/auth/github-oauth-client.d.ts.map +1 -0
- package/dist/auth/github-oauth-client.js +79 -0
- package/dist/auth/github-oauth-client.js.map +1 -0
- package/dist/auth/oidc-client.d.ts +4 -4
- package/dist/{chunk-G4PCN46L.js → chunk-ES5RBLAT.js} +47 -99
- package/dist/chunk-ES5RBLAT.js.map +1 -0
- package/dist/{chunk-KVHAK5UR.js → chunk-UC3OOEQ3.js} +527 -410
- package/dist/chunk-UC3OOEQ3.js.map +1 -0
- package/dist/config/config-loader.d.ts.map +1 -1
- package/dist/config/config-loader.js +21 -89
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-types.d.ts +18 -3
- package/dist/config/config-types.d.ts.map +1 -1
- package/dist/domain-logic/outcome-tools.d.ts +2 -2
- package/dist/domain-logic/outcome-tools.d.ts.map +1 -1
- package/dist/domain-logic/outcome-tools.js +1 -1
- package/dist/domain-logic/outcome-tools.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integration-tool-registry.d.ts +23 -0
- package/dist/integration-tool-registry.d.ts.map +1 -0
- package/dist/integration-tool-registry.js +140 -0
- package/dist/integration-tool-registry.js.map +1 -0
- package/dist/model-providers/builtin-server-adapter.d.ts.map +1 -1
- package/dist/model-providers/builtin-server-adapter.js +10 -2
- package/dist/model-providers/builtin-server-adapter.js.map +1 -1
- package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
- package/dist/process-ui-snapshot-presenter.js +0 -2
- package/dist/process-ui-snapshot-presenter.js.map +1 -1
- package/dist/process-watcher-registry.d.ts +3 -31
- package/dist/process-watcher-registry.d.ts.map +1 -1
- package/dist/process-watcher-registry.js +96 -97
- package/dist/process-watcher-registry.js.map +1 -1
- package/dist/routes/watchers.d.ts.map +1 -1
- package/dist/routes/watchers.js +14 -50
- package/dist/routes/watchers.js.map +1 -1
- package/dist/semantic-state-json.d.ts +1 -2
- package/dist/semantic-state-json.d.ts.map +1 -1
- package/dist/semantic-state-json.js +1 -2
- package/dist/semantic-state-json.js.map +1 -1
- package/dist/supervisor/ipc-handler.d.ts +4 -1
- package/dist/supervisor/ipc-handler.d.ts.map +1 -1
- package/dist/supervisor/ipc-handler.js +18 -0
- package/dist/supervisor/ipc-handler.js.map +1 -1
- package/dist/supervisor/worker-start-payload-builder.d.ts +5 -4
- package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
- package/dist/supervisor/worker-start-payload-builder.js +9 -0
- package/dist/supervisor/worker-start-payload-builder.js.map +1 -1
- package/dist/supervisor/worker-supervisor.d.ts +4 -5
- package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
- package/dist/supervisor/worker-supervisor.js +6 -0
- package/dist/supervisor/worker-supervisor.js.map +1 -1
- package/dist/test-helpers/fake-worker-supervisor.d.ts.map +1 -1
- package/dist/test-helpers/fake-worker-supervisor.js +1 -0
- package/dist/test-helpers/fake-worker-supervisor.js.map +1 -1
- package/dist/test-helpers/ipc-handler-harness.d.ts +1 -0
- package/dist/test-helpers/ipc-handler-harness.d.ts.map +1 -1
- package/dist/test-helpers/ipc-handler-harness.js +4 -3
- package/dist/test-helpers/ipc-handler-harness.js.map +1 -1
- package/dist/test-helpers/process-fixtures.js +3 -3
- package/dist/test-helpers/process-fixtures.js.map +1 -1
- package/dist/{writes-irEq9SlA.d.ts → writes-CVXLCYce.d.ts} +61 -13
- package/package.json +10 -10
- package/src/app.ts +37 -44
- package/src/auth/auth-client.ts +40 -0
- package/src/auth/auth-config.ts +34 -9
- package/src/auth/auth-service.ts +11 -5
- package/src/auth/auth-test-helpers.ts +2 -2
- package/src/auth/github-oauth-client.ts +111 -0
- package/src/auth/oidc-client.ts +5 -5
- package/src/config/config-loader.ts +42 -103
- package/src/config/config-types.ts +21 -3
- package/src/domain-logic/outcome-tools.ts +3 -3
- package/src/index.ts +1 -4
- package/src/integration-tool-registry.ts +186 -0
- package/src/model-providers/builtin-server-adapter.ts +10 -2
- package/src/process-ui-snapshot-presenter.ts +0 -2
- package/src/process-watcher-registry.ts +124 -167
- package/src/routes/watchers.ts +14 -50
- package/src/semantic-state-json.ts +0 -2
- package/src/supervisor/ipc-handler.ts +35 -0
- package/src/supervisor/worker-start-payload-builder.ts +21 -1
- package/src/supervisor/worker-supervisor.ts +14 -4
- package/src/test-helpers/fake-worker-supervisor.ts +1 -0
- package/src/test-helpers/ipc-handler-harness.ts +7 -3
- package/src/test-helpers/process-fixtures.ts +3 -3
- package/dist/chunk-G4PCN46L.js.map +0 -1
- package/dist/chunk-KVHAK5UR.js.map +0 -1
- package/dist/domain-logic/idempotency.d.ts +0 -3
- package/dist/domain-logic/idempotency.d.ts.map +0 -1
- package/dist/domain-logic/idempotency.js +0 -3
- package/dist/domain-logic/idempotency.js.map +0 -1
- package/dist/domain-logic/index.d.ts +0 -7
- package/dist/domain-logic/index.d.ts.map +0 -1
- package/dist/domain-logic/index.js +0 -6
- package/dist/domain-logic/index.js.map +0 -1
- package/dist/domain-logic/input-sequencer.d.ts +0 -16
- package/dist/domain-logic/input-sequencer.d.ts.map +0 -1
- package/dist/domain-logic/input-sequencer.js +0 -2
- package/dist/domain-logic/input-sequencer.js.map +0 -1
- package/dist/domain-logic/string-normalize.d.ts +0 -2
- package/dist/domain-logic/string-normalize.d.ts.map +0 -1
- package/dist/domain-logic/string-normalize.js +0 -2
- package/dist/domain-logic/string-normalize.js.map +0 -1
- package/dist/filesystem-process-watchers.d.ts +0 -22
- package/dist/filesystem-process-watchers.d.ts.map +0 -1
- package/dist/filesystem-process-watchers.js +0 -79
- package/dist/filesystem-process-watchers.js.map +0 -1
- package/dist/test-helpers/in-process-worker.d.ts +0 -2
- package/dist/test-helpers/in-process-worker.d.ts.map +0 -1
- package/dist/test-helpers/in-process-worker.js +0 -2
- package/dist/test-helpers/in-process-worker.js.map +0 -1
- package/dist/test-helpers/leaf-outcome-fixtures.d.ts +0 -37
- package/dist/test-helpers/leaf-outcome-fixtures.d.ts.map +0 -1
- package/dist/test-helpers/leaf-outcome-fixtures.js +0 -81
- package/dist/test-helpers/leaf-outcome-fixtures.js.map +0 -1
- package/src/domain-logic/idempotency.ts +0 -3
- package/src/domain-logic/index.ts +0 -31
- package/src/domain-logic/input-sequencer.ts +0 -18
- package/src/domain-logic/string-normalize.ts +0 -1
- package/src/filesystem-process-watchers.ts +0 -147
- package/src/test-helpers/in-process-worker.ts +0 -2
- package/src/test-helpers/leaf-outcome-fixtures.ts +0 -140
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Codec,
|
|
3
|
-
ExtensionProcessDefinition,
|
|
4
|
-
LeitwerkExtensionModule,
|
|
5
|
-
LlmTurnDefinition,
|
|
6
|
-
ProcessLeafOutcomeDefinition,
|
|
7
|
-
StructuralProcessState,
|
|
8
|
-
} from "@leitwerk-dev/process-sdk";
|
|
9
|
-
import { defineProcess, llmTurn } from "@leitwerk-dev/process-sdk";
|
|
10
|
-
import {
|
|
11
|
-
createStructuralProcessState,
|
|
12
|
-
createStructuralStateJson,
|
|
13
|
-
structuralProcessStateCodec,
|
|
14
|
-
} from "./structural-process-fixtures.js";
|
|
15
|
-
|
|
16
|
-
export const leafOutcomePromptParamsCodec: Codec<{ prompt: string }> = {
|
|
17
|
-
parse(value) {
|
|
18
|
-
const record = typeof value === "object" && value !== null ? value : {};
|
|
19
|
-
return {
|
|
20
|
-
prompt:
|
|
21
|
-
typeof (record as { prompt?: unknown }).prompt === "string"
|
|
22
|
-
? (record as { prompt: string }).prompt
|
|
23
|
-
: "",
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
serialize(value) {
|
|
27
|
-
return value;
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const leafOutcomeStructuralStateCodec: Codec<StructuralProcessState> =
|
|
32
|
-
structuralProcessStateCodec;
|
|
33
|
-
|
|
34
|
-
type LeafOutcomeResultSemanticRef = NonNullable<
|
|
35
|
-
LlmTurnDefinition<"completed">["resultSemanticRef"]
|
|
36
|
-
>;
|
|
37
|
-
|
|
38
|
-
export interface CreateLeafOutcomeCaptureTurnOptions {
|
|
39
|
-
description?: string;
|
|
40
|
-
branchType?: LlmTurnDefinition<"completed">["branchType"];
|
|
41
|
-
context?: LlmTurnDefinition<"completed">["context"];
|
|
42
|
-
promptText?: string;
|
|
43
|
-
resultSemanticRef?: LeafOutcomeResultSemanticRef;
|
|
44
|
-
turnResultMarkdown?: LlmTurnDefinition<"completed">["turnResultMarkdown"];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function createLeafOutcomeCaptureTurn(
|
|
48
|
-
turnId: string,
|
|
49
|
-
options: CreateLeafOutcomeCaptureTurnOptions = {},
|
|
50
|
-
): LlmTurnDefinition<"completed", { prompt: string }, StructuralProcessState> {
|
|
51
|
-
return llmTurn<{ prompt: string }, StructuralProcessState, "completed">({
|
|
52
|
-
description: options.description ?? "Produce a captured leaf outcome",
|
|
53
|
-
availableTools: [],
|
|
54
|
-
completionMode: "turn_end",
|
|
55
|
-
branchType: options.branchType ?? "primary",
|
|
56
|
-
context: options.context ?? "fresh",
|
|
57
|
-
prompt: async () => options.promptText ?? turnId,
|
|
58
|
-
outcomes: {},
|
|
59
|
-
turnEnd: {
|
|
60
|
-
outcome: "completed",
|
|
61
|
-
params: {},
|
|
62
|
-
complete: true,
|
|
63
|
-
},
|
|
64
|
-
...(options.turnResultMarkdown ? { turnResultMarkdown: options.turnResultMarkdown } : {}),
|
|
65
|
-
resultSemanticRef: options.resultSemanticRef ?? "plan",
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface CreateLeafOutcomeTestProcessDefinitionOptions {
|
|
70
|
-
displayName?: string;
|
|
71
|
-
resultSemanticRef?: LeafOutcomeResultSemanticRef;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function createLeafOutcomeTestProcessDefinition(
|
|
75
|
-
processId: string,
|
|
76
|
-
rendererId: string,
|
|
77
|
-
turnId: string,
|
|
78
|
-
capture: ProcessLeafOutcomeDefinition<{ prompt: string }, StructuralProcessState>["capture"],
|
|
79
|
-
options: CreateLeafOutcomeTestProcessDefinitionOptions = {},
|
|
80
|
-
): ExtensionProcessDefinition<{ prompt: string }, StructuralProcessState> {
|
|
81
|
-
return defineProcess({
|
|
82
|
-
id: processId,
|
|
83
|
-
displayName: options.displayName ?? processId,
|
|
84
|
-
entry: turnId,
|
|
85
|
-
turns: {
|
|
86
|
-
[turnId]: createLeafOutcomeCaptureTurn(turnId, {
|
|
87
|
-
resultSemanticRef: options.resultSemanticRef ?? "plan",
|
|
88
|
-
}),
|
|
89
|
-
},
|
|
90
|
-
paramsCodec: leafOutcomePromptParamsCodec,
|
|
91
|
-
stateCodec: leafOutcomeStructuralStateCodec,
|
|
92
|
-
initialState() {
|
|
93
|
-
return createStructuralProcessState();
|
|
94
|
-
},
|
|
95
|
-
worker(api) {
|
|
96
|
-
api.start(turnId);
|
|
97
|
-
},
|
|
98
|
-
ui(api) {
|
|
99
|
-
api.leafOutcome({
|
|
100
|
-
rendererId,
|
|
101
|
-
capture,
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface CreateLeafOutcomeTestExtensionModuleOptions {
|
|
108
|
-
manifestId?: string;
|
|
109
|
-
manifestVersion?: string;
|
|
110
|
-
turn?: CreateLeafOutcomeCaptureTurnOptions;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function createLeafOutcomeTestExtensionModule(
|
|
114
|
-
processDef: ExtensionProcessDefinition<{ prompt: string }, StructuralProcessState>,
|
|
115
|
-
_turnId: string,
|
|
116
|
-
options: CreateLeafOutcomeTestExtensionModuleOptions = {},
|
|
117
|
-
): LeitwerkExtensionModule {
|
|
118
|
-
return {
|
|
119
|
-
manifest: {
|
|
120
|
-
id: options.manifestId ?? `${processDef.id}-test`,
|
|
121
|
-
version: options.manifestVersion ?? "0.1.0",
|
|
122
|
-
},
|
|
123
|
-
setupCatalog(api) {
|
|
124
|
-
api.registerProcess(processDef);
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function createLeafOutcomeBaseStateJson(
|
|
130
|
-
rootEntryId: string,
|
|
131
|
-
overrides: Partial<StructuralProcessState["semanticEntryRefs"]> = {},
|
|
132
|
-
): string {
|
|
133
|
-
return createStructuralStateJson({
|
|
134
|
-
semanticEntryRefs: {
|
|
135
|
-
rootEntry: { entryId: rootEntryId, turnRecordId: null },
|
|
136
|
-
currentPrimaryPathLeaf: { entryId: rootEntryId, turnRecordId: null },
|
|
137
|
-
...overrides,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
}
|