@leitwerk-dev/worker 0.1.0 → 0.1.2
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/{chunk-N5HLJDWA.js → chunk-VLKOJANI.js} +3 -2
- package/dist/chunk-VLKOJANI.js.map +1 -0
- package/dist/index.d.ts +283 -7
- package/dist/index.js +32 -5
- package/dist/index.js.map +1 -1
- package/dist/worker-entry.d.ts +2 -2
- package/dist/worker-entry.js +8 -4
- package/dist/worker-entry.js.map +1 -1
- package/package.json +7 -7
- package/src/runtime/adapters.ts +4 -0
- package/src/runtime/index.ts +2 -1
- package/dist/automatic-turn-executor.d.ts +0 -28
- package/dist/automatic-turn-executor.d.ts.map +0 -1
- package/dist/automatic-turn-executor.js +0 -58
- package/dist/automatic-turn-executor.js.map +0 -1
- package/dist/chunk-N5HLJDWA.js.map +0 -1
- package/dist/diagnostics.d.ts +0 -23
- package/dist/diagnostics.d.ts.map +0 -1
- package/dist/diagnostics.js +0 -51
- package/dist/diagnostics.js.map +0 -1
- package/dist/entry-runtime.d.ts +0 -24
- package/dist/entry-runtime.d.ts.map +0 -1
- package/dist/entry-runtime.js +0 -160
- package/dist/entry-runtime.js.map +0 -1
- package/dist/event-translator.d.ts +0 -8
- package/dist/event-translator.d.ts.map +0 -1
- package/dist/event-translator.js +0 -12
- package/dist/event-translator.js.map +0 -1
- package/dist/extension-entry-roots.d.ts +0 -7
- package/dist/extension-entry-roots.d.ts.map +0 -1
- package/dist/extension-entry-roots.js +0 -41
- package/dist/extension-entry-roots.js.map +0 -1
- package/dist/identified-pi-entry.d.ts +0 -56
- package/dist/identified-pi-entry.d.ts.map +0 -1
- package/dist/identified-pi-entry.js +0 -125
- package/dist/identified-pi-entry.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/input-consumer.d.ts +0 -24
- package/dist/input-consumer.d.ts.map +0 -1
- package/dist/input-consumer.js +0 -34
- package/dist/input-consumer.js.map +0 -1
- package/dist/ipc.d.ts +0 -22
- package/dist/ipc.d.ts.map +0 -1
- package/dist/ipc.js +0 -192
- package/dist/ipc.js.map +0 -1
- package/dist/logical-prompt-runner.d.ts +0 -49
- package/dist/logical-prompt-runner.d.ts.map +0 -1
- package/dist/logical-prompt-runner.js +0 -225
- package/dist/logical-prompt-runner.js.map +0 -1
- package/dist/managed-pi-agent-dir.d.ts +0 -13
- package/dist/managed-pi-agent-dir.d.ts.map +0 -1
- package/dist/managed-pi-agent-dir.js +0 -66
- package/dist/managed-pi-agent-dir.js.map +0 -1
- package/dist/managed-pi-bootstrap.d.ts +0 -24
- package/dist/managed-pi-bootstrap.d.ts.map +0 -1
- package/dist/managed-pi-bootstrap.js +0 -135
- package/dist/managed-pi-bootstrap.js.map +0 -1
- package/dist/missing-tool-recovery-runner.d.ts +0 -23
- package/dist/missing-tool-recovery-runner.d.ts.map +0 -1
- package/dist/missing-tool-recovery-runner.js +0 -73
- package/dist/missing-tool-recovery-runner.js.map +0 -1
- package/dist/pi-adapter.d.ts +0 -134
- package/dist/pi-adapter.d.ts.map +0 -1
- package/dist/pi-adapter.js +0 -1648
- package/dist/pi-adapter.js.map +0 -1
- package/dist/pi-branch-guard.d.ts +0 -39
- package/dist/pi-branch-guard.d.ts.map +0 -1
- package/dist/pi-branch-guard.js +0 -75
- package/dist/pi-branch-guard.js.map +0 -1
- package/dist/pi-event-reporter.d.ts +0 -15
- package/dist/pi-event-reporter.d.ts.map +0 -1
- package/dist/pi-event-reporter.js +0 -136
- package/dist/pi-event-reporter.js.map +0 -1
- package/dist/pi-resource-bundle.d.ts +0 -12
- package/dist/pi-resource-bundle.d.ts.map +0 -1
- package/dist/pi-resource-bundle.js +0 -58
- package/dist/pi-resource-bundle.js.map +0 -1
- package/dist/pre-turn-targeted-inputs.d.ts +0 -44
- package/dist/pre-turn-targeted-inputs.d.ts.map +0 -1
- package/dist/pre-turn-targeted-inputs.js +0 -101
- package/dist/pre-turn-targeted-inputs.js.map +0 -1
- package/dist/prompt-guards.d.ts +0 -52
- package/dist/prompt-guards.d.ts.map +0 -1
- package/dist/prompt-guards.js +0 -318
- package/dist/prompt-guards.js.map +0 -1
- package/dist/question-bridge.d.ts +0 -16
- package/dist/question-bridge.d.ts.map +0 -1
- package/dist/question-bridge.js +0 -55
- package/dist/question-bridge.js.map +0 -1
- package/dist/question-tool.d.ts +0 -14
- package/dist/question-tool.d.ts.map +0 -1
- package/dist/question-tool.js +0 -54
- package/dist/question-tool.js.map +0 -1
- package/dist/resource-loader-factory.d.ts +0 -11
- package/dist/resource-loader-factory.d.ts.map +0 -1
- package/dist/resource-loader-factory.js +0 -87
- package/dist/resource-loader-factory.js.map +0 -1
- package/dist/result-image-upload.d.ts +0 -14
- package/dist/result-image-upload.d.ts.map +0 -1
- package/dist/result-image-upload.js +0 -183
- package/dist/result-image-upload.js.map +0 -1
- package/dist/runtime/adapters.d.ts +0 -48
- package/dist/runtime/adapters.d.ts.map +0 -1
- package/dist/runtime/adapters.js +0 -15
- package/dist/runtime/adapters.js.map +0 -1
- package/dist/runtime/bootstrap-session.d.ts +0 -95
- package/dist/runtime/bootstrap-session.d.ts.map +0 -1
- package/dist/runtime/bootstrap-session.js +0 -198
- package/dist/runtime/bootstrap-session.js.map +0 -1
- package/dist/runtime/bootstrap.d.ts +0 -81
- package/dist/runtime/bootstrap.d.ts.map +0 -1
- package/dist/runtime/bootstrap.js +0 -440
- package/dist/runtime/bootstrap.js.map +0 -1
- package/dist/runtime/failure-policy.d.ts +0 -79
- package/dist/runtime/failure-policy.d.ts.map +0 -1
- package/dist/runtime/failure-policy.js +0 -182
- package/dist/runtime/failure-policy.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -9
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -326
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/lifecycle-reducer.d.ts +0 -328
- package/dist/runtime/lifecycle-reducer.d.ts.map +0 -1
- package/dist/runtime/lifecycle-reducer.js +0 -1100
- package/dist/runtime/lifecycle-reducer.js.map +0 -1
- package/dist/runtime/llm-turn-execution.d.ts +0 -42
- package/dist/runtime/llm-turn-execution.d.ts.map +0 -1
- package/dist/runtime/llm-turn-execution.js +0 -472
- package/dist/runtime/llm-turn-execution.js.map +0 -1
- package/dist/runtime/settings.d.ts +0 -11
- package/dist/runtime/settings.d.ts.map +0 -1
- package/dist/runtime/settings.js +0 -23
- package/dist/runtime/settings.js.map +0 -1
- package/dist/runtime/snapshot-policy.d.ts +0 -11
- package/dist/runtime/snapshot-policy.d.ts.map +0 -1
- package/dist/runtime/snapshot-policy.js +0 -16
- package/dist/runtime/snapshot-policy.js.map +0 -1
- package/dist/runtime/turn-execution.d.ts +0 -49
- package/dist/runtime/turn-execution.d.ts.map +0 -1
- package/dist/runtime/turn-execution.js +0 -120
- package/dist/runtime/turn-execution.js.map +0 -1
- package/dist/session-snapshot-exchange.d.ts +0 -39
- package/dist/session-snapshot-exchange.d.ts.map +0 -1
- package/dist/session-snapshot-exchange.js +0 -102
- package/dist/session-snapshot-exchange.js.map +0 -1
- package/dist/test-helpers/fake-websocket.d.ts +0 -16
- package/dist/test-helpers/fake-websocket.d.ts.map +0 -1
- package/dist/test-helpers/fake-websocket.js +0 -40
- package/dist/test-helpers/fake-websocket.js.map +0 -1
- package/dist/test-helpers/ipc-harness.d.ts +0 -11
- package/dist/test-helpers/ipc-harness.d.ts.map +0 -1
- package/dist/test-helpers/ipc-harness.js +0 -17
- package/dist/test-helpers/ipc-harness.js.map +0 -1
- package/dist/test-helpers/worker-message-builders.d.ts +0 -21
- package/dist/test-helpers/worker-message-builders.d.ts.map +0 -1
- package/dist/test-helpers/worker-message-builders.js +0 -62
- package/dist/test-helpers/worker-message-builders.js.map +0 -1
- package/dist/turn-continuation.d.ts +0 -28
- package/dist/turn-continuation.d.ts.map +0 -1
- package/dist/turn-continuation.js +0 -80
- package/dist/turn-continuation.js.map +0 -1
- package/dist/turn-execution-error.d.ts +0 -39
- package/dist/turn-execution-error.d.ts.map +0 -1
- package/dist/turn-execution-error.js +0 -64
- package/dist/turn-execution-error.js.map +0 -1
- package/dist/turn-execution-result.d.ts +0 -35
- package/dist/turn-execution-result.d.ts.map +0 -1
- package/dist/turn-execution-result.js +0 -21
- package/dist/turn-execution-result.js.map +0 -1
- package/dist/turn-outcome-tool-session.d.ts +0 -50
- package/dist/turn-outcome-tool-session.d.ts.map +0 -1
- package/dist/turn-outcome-tool-session.js +0 -209
- package/dist/turn-outcome-tool-session.js.map +0 -1
- package/dist/turn-record-id.d.ts +0 -3
- package/dist/turn-record-id.d.ts.map +0 -1
- package/dist/turn-record-id.js +0 -10
- package/dist/turn-record-id.js.map +0 -1
- package/dist/turn-result-markdown.d.ts +0 -74
- package/dist/turn-result-markdown.d.ts.map +0 -1
- package/dist/turn-result-markdown.js +0 -263
- package/dist/turn-result-markdown.js.map +0 -1
- package/dist/turn-tree-strategy.d.ts +0 -29
- package/dist/turn-tree-strategy.d.ts.map +0 -1
- package/dist/turn-tree-strategy.js +0 -80
- package/dist/turn-tree-strategy.js.map +0 -1
- package/dist/worker-entry.d.ts.map +0 -1
- package/dist/worker-http.d.ts +0 -2
- package/dist/worker-http.d.ts.map +0 -1
- package/dist/worker-http.js +0 -9
- package/dist/worker-http.js.map +0 -1
- package/dist/worker-ipc-reporter.d.ts +0 -29
- package/dist/worker-ipc-reporter.d.ts.map +0 -1
- package/dist/worker-ipc-reporter.js +0 -58
- package/dist/worker-ipc-reporter.js.map +0 -1
- package/dist/worker-payloads.d.ts +0 -10
- package/dist/worker-payloads.d.ts.map +0 -1
- package/dist/worker-payloads.js +0 -66
- package/dist/worker-payloads.js.map +0 -1
- package/dist/worker-start-payload.d.ts +0 -7
- package/dist/worker-start-payload.d.ts.map +0 -1
- package/dist/worker-start-payload.js +0 -5
- package/dist/worker-start-payload.js.map +0 -1
- package/dist/workspace/manifest.d.ts +0 -35
- package/dist/workspace/manifest.d.ts.map +0 -1
- package/dist/workspace/manifest.js +0 -79
- package/dist/workspace/manifest.js.map +0 -1
- package/dist/workspace/node-run-root-git-ops.d.ts +0 -17
- package/dist/workspace/node-run-root-git-ops.d.ts.map +0 -1
- package/dist/workspace/node-run-root-git-ops.js +0 -96
- package/dist/workspace/node-run-root-git-ops.js.map +0 -1
- package/dist/workspace/resource-aggregator.d.ts +0 -15
- package/dist/workspace/resource-aggregator.d.ts.map +0 -1
- package/dist/workspace/resource-aggregator.js +0 -39
- package/dist/workspace/resource-aggregator.js.map +0 -1
- package/dist/workspace/run-root.d.ts +0 -52
- package/dist/workspace/run-root.d.ts.map +0 -1
- package/dist/workspace/run-root.js +0 -209
- package/dist/workspace/run-root.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,283 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
|
|
1
|
+
import { ResolvedWorkerProcess, ExtensionCatalog } from '@leitwerk-dev/extension-runtime';
|
|
2
|
+
import { PiEvent, PiSessionDiagnostic, PiTreeEntry, PiTreeHandle, PiRunDetails, PiTreeNode, PiPromptOptions, PiTurnExecutionResult, PiCustomMessageInput, PiEventHandler, PiSessionDiagnosticHandler, PiCustomTool, EventBus, WorkerExtensionAPI } from '@leitwerk-dev/process-sdk';
|
|
3
|
+
export { PiCustomTool, PiEvent, PiEventHandler, PiEventType, PiPromptOptions, PiRunDetails, PiSessionDiagnostic, PiSessionDiagnosticHandler, PiSessionDiagnosticLevel, PiTreeEntry, PiTreeHandle, PiTreeNode, PiTurnExecutionResult } from '@leitwerk-dev/process-sdk';
|
|
4
|
+
import * as _leitwerk_dev_worker_protocol from '@leitwerk-dev/worker-protocol';
|
|
5
|
+
import { WorkerToServerMessage, ServerToWorkerMessage, PiResourceManifest } from '@leitwerk-dev/worker-protocol';
|
|
6
|
+
export { ExtractedPiResourceFile, PiResourceBundle, PiResourceFile, createCanonicalPiResourceBundle, sha256Digest, validateResourceRelativePath, verifyCanonicalPiResourceBundle } from '@leitwerk-dev/worker-protocol';
|
|
7
|
+
import { AgentSession, AgentSessionEvent } from '@earendil-works/pi-coding-agent';
|
|
8
|
+
import { ConfigSnapshot } from '@leitwerk-dev/protocol';
|
|
9
|
+
|
|
10
|
+
interface WorkerIpc {
|
|
11
|
+
send(message: WorkerToServerMessage): void;
|
|
12
|
+
onMessage(handler: (message: ServerToWorkerMessage) => void): void;
|
|
13
|
+
onError(handler: (error: Error) => void): void;
|
|
14
|
+
onConnect?(handler: () => void): void;
|
|
15
|
+
start(): void;
|
|
16
|
+
stop(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare function resolveManagedPiAgentDir(input: {
|
|
20
|
+
agentDirRoot: string;
|
|
21
|
+
instanceId: string;
|
|
22
|
+
startOrLeaseId: string;
|
|
23
|
+
}): string;
|
|
24
|
+
interface DeclaredCredentialFile {
|
|
25
|
+
path: string;
|
|
26
|
+
content: string | Uint8Array;
|
|
27
|
+
}
|
|
28
|
+
/** Atomically writes declared credential files inside an existing managed directory. */
|
|
29
|
+
declare function writeManagedPiCredentialFiles(agentDir: string, files: readonly DeclaredCredentialFile[]): Promise<void>;
|
|
30
|
+
|
|
31
|
+
type ManagedPiResourceManifest = PiResourceManifest;
|
|
32
|
+
|
|
33
|
+
interface PiTreeHandleOptions {
|
|
34
|
+
instanceId: string;
|
|
35
|
+
treeFile: string;
|
|
36
|
+
workspaceRoot: string;
|
|
37
|
+
sessionCwd?: string;
|
|
38
|
+
resume: boolean;
|
|
39
|
+
agentDir?: string;
|
|
40
|
+
configSnapshot?: ConfigSnapshot;
|
|
41
|
+
modelProfileId?: string | null;
|
|
42
|
+
piConfig?: {
|
|
43
|
+
systemPrompt?: string;
|
|
44
|
+
appendSystemPrompt?: string;
|
|
45
|
+
availableToolNames: string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface PiManagedBootstrapOptions {
|
|
49
|
+
agentDir: string;
|
|
50
|
+
workspaceRoot: string;
|
|
51
|
+
sessionCwd: string;
|
|
52
|
+
configSnapshot: ConfigSnapshot;
|
|
53
|
+
piConfig: PiTreeHandleOptions["piConfig"];
|
|
54
|
+
manifest: ManagedPiResourceManifest;
|
|
55
|
+
expectedModel: {
|
|
56
|
+
providerId: string;
|
|
57
|
+
modelId: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface PiManagedBootstrapResult {
|
|
61
|
+
loadedResourceIds: string[];
|
|
62
|
+
loadedAgentsFiles: Array<{
|
|
63
|
+
path: string;
|
|
64
|
+
sizeBytes: number;
|
|
65
|
+
}>;
|
|
66
|
+
loadedSkillFiles: Array<{
|
|
67
|
+
name: string;
|
|
68
|
+
path: string;
|
|
69
|
+
}>;
|
|
70
|
+
resolvedModel: {
|
|
71
|
+
providerId: string;
|
|
72
|
+
modelId: string;
|
|
73
|
+
};
|
|
74
|
+
diagnostics: string[];
|
|
75
|
+
}
|
|
76
|
+
interface PiTreeHandleFactory {
|
|
77
|
+
prepareManagedBootstrap(opts: PiManagedBootstrapOptions): Promise<PiManagedBootstrapResult>;
|
|
78
|
+
inspectPrimaryTree(opts: PiTreePlanningOptions): Promise<PiTreePlanningSnapshot>;
|
|
79
|
+
createPrimaryTreeHandle(opts: PiTreeHandleOptions): Promise<PiTreeHandle>;
|
|
80
|
+
}
|
|
81
|
+
interface PiTreePlanningOptions {
|
|
82
|
+
treeFile: string;
|
|
83
|
+
sessionCwd: string;
|
|
84
|
+
}
|
|
85
|
+
interface PiTreePlanningSnapshot {
|
|
86
|
+
currentLeafId: string | null;
|
|
87
|
+
entries: readonly Pick<PiTreeEntry, "id" | "parentId">[];
|
|
88
|
+
}
|
|
89
|
+
interface AgentSessionEventTranslation {
|
|
90
|
+
piEvents: PiEvent[];
|
|
91
|
+
diagnostics: PiSessionDiagnostic[];
|
|
92
|
+
}
|
|
93
|
+
declare function doesPiEventResetInactivity(event: PiEvent): boolean;
|
|
94
|
+
declare function translateAgentSessionEventEnvelope(event: AgentSessionEvent, state: {
|
|
95
|
+
currentTurnId: string | null;
|
|
96
|
+
turnSequence: number;
|
|
97
|
+
}): AgentSessionEventTranslation;
|
|
98
|
+
declare class SdkPiTreeHandle implements PiTreeHandle {
|
|
99
|
+
private readonly session;
|
|
100
|
+
readonly sessionId: string;
|
|
101
|
+
readonly treeFile: string;
|
|
102
|
+
readonly isResumed: boolean;
|
|
103
|
+
private readonly eventState;
|
|
104
|
+
private readonly eventHandlers;
|
|
105
|
+
private readonly diagnosticHandlers;
|
|
106
|
+
private sessionUnsubscribe;
|
|
107
|
+
private continuationRetryAbortController;
|
|
108
|
+
private readonly availableToolNames;
|
|
109
|
+
private readonly runDetails;
|
|
110
|
+
constructor(session: AgentSession, options: {
|
|
111
|
+
treeFile: string;
|
|
112
|
+
isResumed: boolean;
|
|
113
|
+
availableToolNames: string[];
|
|
114
|
+
runDetails: PiRunDetails;
|
|
115
|
+
});
|
|
116
|
+
getRunDetails(): PiRunDetails;
|
|
117
|
+
getLeafId(): string | null;
|
|
118
|
+
getEntry(id: string): PiTreeEntry | undefined;
|
|
119
|
+
getBranch(fromId?: string): PiTreeEntry[];
|
|
120
|
+
getChildren(parentId: string): PiTreeEntry[];
|
|
121
|
+
getTree(): PiTreeNode[];
|
|
122
|
+
branch(entryId: string): Promise<void>;
|
|
123
|
+
branchFromRoot(): Promise<void>;
|
|
124
|
+
resetLeaf(): Promise<void>;
|
|
125
|
+
compact(customInstructions?: string, details?: unknown): Promise<unknown>;
|
|
126
|
+
private withToolConfiguration;
|
|
127
|
+
/**
|
|
128
|
+
* Pi 0.81 has no public session-level continue API. Mirror its public retry
|
|
129
|
+
* contract for a retained prompt leaf without calling private session methods.
|
|
130
|
+
*/
|
|
131
|
+
private runRetryAwareContinuation;
|
|
132
|
+
private createExecutionBranchSnapshot;
|
|
133
|
+
private captureTurnExecutionResult;
|
|
134
|
+
private executePrompt;
|
|
135
|
+
prompt(text: string, options?: PiPromptOptions): Promise<PiTurnExecutionResult>;
|
|
136
|
+
promptLiteral(text: string, options?: PiPromptOptions): Promise<PiTurnExecutionResult>;
|
|
137
|
+
promptCustom(input: PiCustomMessageInput, options?: PiPromptOptions): Promise<PiTurnExecutionResult>;
|
|
138
|
+
continueTurn(options?: PiPromptOptions): Promise<PiTurnExecutionResult>;
|
|
139
|
+
appendCustomMessage(input: PiCustomMessageInput): Promise<string>;
|
|
140
|
+
steer(text: string): Promise<void>;
|
|
141
|
+
abortTurn(): Promise<void>;
|
|
142
|
+
subscribe(handler: PiEventHandler): () => void;
|
|
143
|
+
subscribeDiagnostics(handler: PiSessionDiagnosticHandler): () => void;
|
|
144
|
+
private ensureSessionSubscription;
|
|
145
|
+
private emitSessionEvent;
|
|
146
|
+
private releaseSessionSubscriptionIfIdle;
|
|
147
|
+
private emitSubscribedEvent;
|
|
148
|
+
private emitSubscribedDiagnostic;
|
|
149
|
+
close(): Promise<void>;
|
|
150
|
+
}
|
|
151
|
+
declare class SdkPiTreeHandleFactory implements PiTreeHandleFactory {
|
|
152
|
+
private readonly preparedServices;
|
|
153
|
+
prepareManagedBootstrap(opts: PiManagedBootstrapOptions): Promise<PiManagedBootstrapResult>;
|
|
154
|
+
inspectPrimaryTree(opts: PiTreePlanningOptions): Promise<PiTreePlanningSnapshot>;
|
|
155
|
+
createPrimaryTreeHandle(opts: PiTreeHandleOptions): Promise<PiTreeHandle>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
type PromptGuardTimer = ReturnType<typeof setTimeout>;
|
|
159
|
+
interface PromptGuardScheduler {
|
|
160
|
+
setTimeout(handler: () => void, delayMs: number): PromptGuardTimer;
|
|
161
|
+
clearTimeout(timer: PromptGuardTimer): void;
|
|
162
|
+
sleep(delayMs: number): Promise<void>;
|
|
163
|
+
now(): Date;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type SessionSnapshotUploadResult = {
|
|
167
|
+
kind: "disabled";
|
|
168
|
+
} | {
|
|
169
|
+
kind: "missing";
|
|
170
|
+
} | {
|
|
171
|
+
kind: "empty";
|
|
172
|
+
} | {
|
|
173
|
+
kind: "uploaded";
|
|
174
|
+
bytes: number;
|
|
175
|
+
};
|
|
176
|
+
interface WorkerSessionSnapshotUploadMetadata {
|
|
177
|
+
turnRecordId?: string | null;
|
|
178
|
+
}
|
|
179
|
+
interface WorkerSessionSnapshotExchange {
|
|
180
|
+
uploadSnapshot(treeFile: string, reason: string, metadata?: WorkerSessionSnapshotUploadMetadata): Promise<SessionSnapshotUploadResult>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface GitOps {
|
|
184
|
+
clone(repoLocator: string, targetDir: string): Promise<void>;
|
|
185
|
+
checkout(repoDir: string, branch: string): Promise<void>;
|
|
186
|
+
createBranch(repoDir: string, branchName: string, startPoint: string): Promise<void>;
|
|
187
|
+
branchExists(repoDir: string, branchName: string): Promise<boolean>;
|
|
188
|
+
getHeadSha(repoDir: string): Promise<string>;
|
|
189
|
+
readFile(repoDir: string, filePath: string): Promise<string | null>;
|
|
190
|
+
listFiles(repoDir: string, pattern: string): Promise<string[]>;
|
|
191
|
+
}
|
|
192
|
+
type RunRootGitOps = GitOps & {
|
|
193
|
+
writeFile(repoDir: string, filePath: string, content: string): Promise<void>;
|
|
194
|
+
configureRepositoryCredentials?(credentials: readonly _leitwerk_dev_worker_protocol.WorkerGitSshCredential[]): void;
|
|
195
|
+
cleanupRepositoryCredentials?(): void;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
interface CredentialRefreshDescriptor {
|
|
199
|
+
agentDir: string;
|
|
200
|
+
declaredCredentialPaths: readonly string[];
|
|
201
|
+
providerId: string;
|
|
202
|
+
revision: number;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
interface WorkerRuntimeScheduler extends PromptGuardScheduler {
|
|
206
|
+
sleep(delayMs: number): Promise<void>;
|
|
207
|
+
now(): Date;
|
|
208
|
+
}
|
|
209
|
+
declare const nodeWorkerRuntimeScheduler: WorkerRuntimeScheduler;
|
|
210
|
+
interface WorkerRuntimeConfig {
|
|
211
|
+
instanceId: string;
|
|
212
|
+
workerId: string;
|
|
213
|
+
heartbeatIntervalMs?: number;
|
|
214
|
+
turnMaxDurationMs?: number;
|
|
215
|
+
turnInactivityTimeoutMs?: number;
|
|
216
|
+
turnAbortGracePeriodMs?: number;
|
|
217
|
+
}
|
|
218
|
+
interface ResultImageToolFactory {
|
|
219
|
+
create(input: {
|
|
220
|
+
workspaceRoot?: string;
|
|
221
|
+
instanceId: string;
|
|
222
|
+
turnRecordId: string;
|
|
223
|
+
}): PiCustomTool | null;
|
|
224
|
+
}
|
|
225
|
+
interface WorkerRuntimeAdapters {
|
|
226
|
+
transport: WorkerIpc;
|
|
227
|
+
sessionSnapshots: WorkerSessionSnapshotExchange;
|
|
228
|
+
resultImageTools: ResultImageToolFactory;
|
|
229
|
+
piFactory: PiTreeHandleFactory;
|
|
230
|
+
gitOps: RunRootGitOps;
|
|
231
|
+
scheduler: WorkerRuntimeScheduler;
|
|
232
|
+
exit(code: number): void;
|
|
233
|
+
stderr?: NodeJS.WritableStream;
|
|
234
|
+
extensionEvents?: EventBus;
|
|
235
|
+
sampleCredentials?: (descriptor: CredentialRefreshDescriptor) => Promise<{
|
|
236
|
+
values: Record<string, string>;
|
|
237
|
+
fingerprint: string;
|
|
238
|
+
}>;
|
|
239
|
+
resolveWorkerProcess?: (processId: string, opts?: {
|
|
240
|
+
paramsJson?: string | null;
|
|
241
|
+
stateJson?: string | null;
|
|
242
|
+
}) => Promise<ResolvedWorkerProcess | undefined> | ResolvedWorkerProcess | undefined;
|
|
243
|
+
}
|
|
244
|
+
interface WorkerRuntimeOptions {
|
|
245
|
+
config: WorkerRuntimeConfig;
|
|
246
|
+
adapters: WorkerRuntimeAdapters;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface WorkerRuntime {
|
|
250
|
+
start(): Promise<void>;
|
|
251
|
+
stop(reason: string): Promise<void>;
|
|
252
|
+
}
|
|
253
|
+
/** One non-reentrant driver around the pure runtime reducer. */
|
|
254
|
+
declare function createWorkerRuntime(options: WorkerRuntimeOptions): WorkerRuntime;
|
|
255
|
+
|
|
256
|
+
interface WorkerEntryRuntimeOverrides extends Partial<WorkerRuntimeConfig> {
|
|
257
|
+
piFactory?: PiTreeHandleFactory;
|
|
258
|
+
gitOps?: RunRootGitOps;
|
|
259
|
+
transport?: WorkerIpc;
|
|
260
|
+
sessionSnapshots?: WorkerSessionSnapshotExchange;
|
|
261
|
+
resultImageTools?: WorkerRuntimeAdapters["resultImageTools"];
|
|
262
|
+
scheduler?: WorkerRuntimeScheduler;
|
|
263
|
+
stderr?: NodeJS.WritableStream;
|
|
264
|
+
env?: NodeJS.ProcessEnv;
|
|
265
|
+
exit?: (code: number) => void;
|
|
266
|
+
extensionEvents?: WorkerRuntimeAdapters["extensionEvents"];
|
|
267
|
+
resolveWorkerProcess?: WorkerRuntimeAdapters["resolveWorkerProcess"];
|
|
268
|
+
extensionCatalog?: ExtensionCatalog | Promise<ExtensionCatalog>;
|
|
269
|
+
workerExtensionApi?: WorkerExtensionAPI;
|
|
270
|
+
}
|
|
271
|
+
declare function createWorkerEntryRuntime(overrides?: WorkerEntryRuntimeOverrides): WorkerRuntime;
|
|
272
|
+
|
|
273
|
+
/** Extracts a verified bundle into an empty staging directory, then atomically publishes it. */
|
|
274
|
+
declare function materializeCanonicalPiResourceBundle(input: {
|
|
275
|
+
bundle: Uint8Array;
|
|
276
|
+
digest: string;
|
|
277
|
+
targetDir: string;
|
|
278
|
+
}): Promise<{
|
|
279
|
+
targetDir: string;
|
|
280
|
+
reused: boolean;
|
|
281
|
+
}>;
|
|
282
|
+
|
|
283
|
+
export { type AgentSessionEventTranslation, type DeclaredCredentialFile, type PiManagedBootstrapOptions, type PiManagedBootstrapResult, type PiTreeHandleFactory, type PiTreeHandleOptions, type PiTreePlanningOptions, type PiTreePlanningSnapshot, type ResultImageToolFactory, SdkPiTreeHandle, SdkPiTreeHandleFactory, type WorkerRuntime, type WorkerRuntimeAdapters, type WorkerRuntimeConfig, type WorkerRuntimeOptions, type WorkerRuntimeScheduler, createWorkerEntryRuntime, createWorkerRuntime, doesPiEventResetInactivity, materializeCanonicalPiResourceBundle, nodeWorkerRuntimeScheduler, resolveManagedPiAgentDir, translateAgentSessionEventEnvelope, writeManagedPiCredentialFiles };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
SdkPiTreeHandle,
|
|
3
|
+
SdkPiTreeHandleFactory,
|
|
4
|
+
createCanonicalPiResourceBundle,
|
|
5
|
+
createWorkerEntryRuntime,
|
|
6
|
+
createWorkerRuntime,
|
|
7
|
+
doesPiEventResetInactivity,
|
|
8
|
+
materializeCanonicalPiResourceBundle,
|
|
9
|
+
nodeWorkerRuntimeScheduler,
|
|
10
|
+
resolveManagedPiAgentDir,
|
|
11
|
+
sha256Digest,
|
|
12
|
+
translateAgentSessionEventEnvelope,
|
|
13
|
+
validateResourceRelativePath,
|
|
14
|
+
verifyCanonicalPiResourceBundle,
|
|
15
|
+
writeManagedPiCredentialFiles
|
|
16
|
+
} from "./chunk-VLKOJANI.js";
|
|
17
|
+
export {
|
|
18
|
+
SdkPiTreeHandle,
|
|
19
|
+
SdkPiTreeHandleFactory,
|
|
20
|
+
createCanonicalPiResourceBundle,
|
|
21
|
+
createWorkerEntryRuntime,
|
|
22
|
+
createWorkerRuntime,
|
|
23
|
+
doesPiEventResetInactivity,
|
|
24
|
+
materializeCanonicalPiResourceBundle,
|
|
25
|
+
nodeWorkerRuntimeScheduler,
|
|
26
|
+
resolveManagedPiAgentDir,
|
|
27
|
+
sha256Digest,
|
|
28
|
+
translateAgentSessionEventEnvelope,
|
|
29
|
+
validateResourceRelativePath,
|
|
30
|
+
verifyCanonicalPiResourceBundle,
|
|
31
|
+
writeManagedPiCredentialFiles
|
|
32
|
+
};
|
|
6
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/worker-entry.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/worker-entry.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createWorkerEntryRuntime
|
|
3
|
+
} from "./chunk-VLKOJANI.js";
|
|
4
|
+
|
|
5
|
+
// src/worker-entry.ts
|
|
6
|
+
var runtime = createWorkerEntryRuntime();
|
|
3
7
|
void runtime.start().catch((e) => {
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
console.error(e);
|
|
9
|
+
process.exit(1);
|
|
6
10
|
});
|
|
7
11
|
//# sourceMappingURL=worker-entry.js.map
|
package/dist/worker-entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/worker-entry.ts"],"sourcesContent":["import { createWorkerEntryRuntime } from \"./entry-runtime.js\";\n\nconst runtime = createWorkerEntryRuntime();\n\nvoid runtime.start().catch((e) => {\n\tconsole.error(e);\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;AAEA,IAAM,UAAU,yBAAyB;AAEzC,KAAK,QAAQ,MAAM,EAAE,MAAM,CAAC,MAAM;AACjC,UAAQ,MAAM,CAAC;AACf,UAAQ,KAAK,CAAC;AACf,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leitwerk-dev/worker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/leitwerk-dev/leitwerk.git",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@earendil-works/pi-ai": "^0.81.1",
|
|
27
27
|
"@earendil-works/pi-coding-agent": "^0.81.1",
|
|
28
|
-
"@leitwerk-dev/domain": "0.1.
|
|
29
|
-
"@leitwerk-dev/extension-runtime": "0.1.
|
|
30
|
-
"@leitwerk-dev/process-sdk": "0.1.
|
|
31
|
-
"@leitwerk-dev/protocol": "0.1.
|
|
32
|
-
"@leitwerk-dev/watcher-utils": "0.1.
|
|
33
|
-
"@leitwerk-dev/worker-protocol": "0.1.
|
|
28
|
+
"@leitwerk-dev/domain": "0.1.2",
|
|
29
|
+
"@leitwerk-dev/extension-runtime": "0.1.2",
|
|
30
|
+
"@leitwerk-dev/process-sdk": "0.1.2",
|
|
31
|
+
"@leitwerk-dev/protocol": "0.1.2",
|
|
32
|
+
"@leitwerk-dev/watcher-utils": "0.1.2",
|
|
33
|
+
"@leitwerk-dev/worker-protocol": "0.1.2",
|
|
34
34
|
"execa": "^9.6.1",
|
|
35
35
|
"fast-glob": "^3.3.3",
|
|
36
36
|
"valibot": "^1.3.1"
|
package/src/runtime/adapters.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { PiTreeHandleFactory } from "../pi-adapter.js";
|
|
|
5
5
|
import type { PromptGuardScheduler, PromptGuardTimer } from "../prompt-guards.js";
|
|
6
6
|
import type { WorkerSessionSnapshotExchange } from "../session-snapshot-exchange.js";
|
|
7
7
|
import type { RunRootGitOps } from "../workspace/run-root.js";
|
|
8
|
+
import type { CredentialRefreshDescriptor } from "./bootstrap-session.js";
|
|
8
9
|
|
|
9
10
|
export type WorkerRuntimeTimer = PromptGuardTimer;
|
|
10
11
|
|
|
@@ -55,6 +56,9 @@ export interface WorkerRuntimeAdapters {
|
|
|
55
56
|
exit(code: number): void;
|
|
56
57
|
stderr?: NodeJS.WritableStream;
|
|
57
58
|
extensionEvents?: EventBus;
|
|
59
|
+
sampleCredentials?: (
|
|
60
|
+
descriptor: CredentialRefreshDescriptor,
|
|
61
|
+
) => Promise<{ values: Record<string, string>; fingerprint: string }>;
|
|
58
62
|
resolveWorkerProcess?: (
|
|
59
63
|
processId: string,
|
|
60
64
|
opts?: { paramsJson?: string | null; stateJson?: string | null },
|
package/src/runtime/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export interface WorkerRuntime {
|
|
|
36
36
|
/** One non-reentrant driver around the pure runtime reducer. */
|
|
37
37
|
export function createWorkerRuntime(options: WorkerRuntimeOptions): WorkerRuntime {
|
|
38
38
|
const { config, adapters } = options;
|
|
39
|
+
const sampleCredentials = adapters.sampleCredentials ?? sampleCredentialFiles;
|
|
39
40
|
const ipc: WorkerIpc = adapters.transport;
|
|
40
41
|
const queue: WorkerRuntimeEvent[] = [];
|
|
41
42
|
const timers = new Map<WorkerTimerName, WorkerRuntimeTimer>();
|
|
@@ -237,7 +238,7 @@ export function createWorkerRuntime(options: WorkerRuntimeOptions): WorkerRuntim
|
|
|
237
238
|
);
|
|
238
239
|
return;
|
|
239
240
|
case "sample_credentials":
|
|
240
|
-
void
|
|
241
|
+
void sampleCredentials(command.descriptor)
|
|
241
242
|
.then((sample) =>
|
|
242
243
|
complete({
|
|
243
244
|
kind: "credential_sampled",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ProcessInstance } from "@leitwerk-dev/domain";
|
|
2
|
-
import type { PiTreeHandle } from "./pi-adapter.js";
|
|
3
|
-
import { TurnExecutionFailure, type TurnExecutionMeta } from "./turn-execution-result.js";
|
|
4
|
-
export interface AutomaticTurnResult {
|
|
5
|
-
turnId: string;
|
|
6
|
-
outcome: string;
|
|
7
|
-
params: Record<string, unknown>;
|
|
8
|
-
meta: TurnExecutionMeta;
|
|
9
|
-
}
|
|
10
|
-
export interface AutomaticTurnExecutor {
|
|
11
|
-
readonly turnRecordId: string;
|
|
12
|
-
readonly result: AutomaticTurnResult | null;
|
|
13
|
-
complete<TOutcome extends string>(input: {
|
|
14
|
-
outcome: TOutcome;
|
|
15
|
-
params?: Record<string, unknown>;
|
|
16
|
-
markdown?: string | null;
|
|
17
|
-
}): Promise<void>;
|
|
18
|
-
failure(error: unknown): TurnExecutionFailure;
|
|
19
|
-
assertCompletedUnlessParked(parked: boolean): void;
|
|
20
|
-
}
|
|
21
|
-
export declare function createAutomaticTurnExecutor(input: {
|
|
22
|
-
currentTurnId: string;
|
|
23
|
-
processSnapshot: Pick<ProcessInstance, "selectedTurnId">;
|
|
24
|
-
acceptedTurnRecordId: string | null;
|
|
25
|
-
state: unknown;
|
|
26
|
-
piHandle: PiTreeHandle | null;
|
|
27
|
-
}): AutomaticTurnExecutor;
|
|
28
|
-
//# sourceMappingURL=automatic-turn-executor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automatic-turn-executor.d.ts","sourceRoot":"","sources":["../src/automatic-turn-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK1F,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,EAAE,iBAAiB,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;QACxC,OAAO,EAAE,QAAQ,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAAC;IAC9C,2BAA2B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACnD;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;IACzD,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;CAC9B,GAAG,qBAAqB,CAoExB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { classifyRuntimeError, TurnExecutionError } from "./turn-execution-error.js";
|
|
2
|
-
import { TurnExecutionFailure } from "./turn-execution-result.js";
|
|
3
|
-
import { resolveTurnRecordIdForExecution } from "./turn-record-id.js";
|
|
4
|
-
import { resolveRootEntryIdFromHandle } from "./turn-tree-strategy.js";
|
|
5
|
-
import { readProcessSemanticEntryRefs } from "./worker-payloads.js";
|
|
6
|
-
export function createAutomaticTurnExecutor(input) {
|
|
7
|
-
const turnType = "automatic";
|
|
8
|
-
const pathType = "primary";
|
|
9
|
-
const turnRecordId = resolveTurnRecordIdForExecution(input.processSnapshot, input.currentTurnId, input.acceptedTurnRecordId);
|
|
10
|
-
let result = null;
|
|
11
|
-
const failure = (error) => {
|
|
12
|
-
const classified = classifyRuntimeError(error);
|
|
13
|
-
const turnError = error instanceof TurnExecutionError
|
|
14
|
-
? error
|
|
15
|
-
: new TurnExecutionError(input.currentTurnId, classified.errorClass, classified.message);
|
|
16
|
-
return new TurnExecutionFailure({
|
|
17
|
-
turnRecordId,
|
|
18
|
-
turnId: input.currentTurnId,
|
|
19
|
-
turnType,
|
|
20
|
-
pathType,
|
|
21
|
-
failure: turnError,
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
turnRecordId,
|
|
26
|
-
get result() {
|
|
27
|
-
return result;
|
|
28
|
-
},
|
|
29
|
-
async complete(completeInput) {
|
|
30
|
-
if (result) {
|
|
31
|
-
throw new TurnExecutionError(input.currentTurnId, "protocol_error", `Automatic turn '${input.currentTurnId}' completed more than once`);
|
|
32
|
-
}
|
|
33
|
-
result = {
|
|
34
|
-
turnId: input.currentTurnId,
|
|
35
|
-
outcome: completeInput.outcome,
|
|
36
|
-
params: completeInput.params ?? {},
|
|
37
|
-
meta: {
|
|
38
|
-
turnRecordId,
|
|
39
|
-
turnType,
|
|
40
|
-
pathType,
|
|
41
|
-
forkPiEntryId: null,
|
|
42
|
-
resultPiEntryId: null,
|
|
43
|
-
turnResultMarkdown: completeInput.markdown ?? null,
|
|
44
|
-
rootEntryId: input.piHandle
|
|
45
|
-
? resolveRootEntryIdFromHandle(input.piHandle)
|
|
46
|
-
: (readProcessSemanticEntryRefs(input.state)?.rootEntry?.entryId ?? null),
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
failure,
|
|
51
|
-
assertCompletedUnlessParked(parked) {
|
|
52
|
-
if (!result && !parked) {
|
|
53
|
-
throw failure(new TurnExecutionError(input.currentTurnId, "protocol_error", `Automatic turn '${input.currentTurnId}' returned without calling run.complete()`));
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=automatic-turn-executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automatic-turn-executor.js","sourceRoot":"","sources":["../src/automatic-turn-executor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAA0B,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAqBpE,MAAM,UAAU,2BAA2B,CAAC,KAM3C;IACA,MAAM,QAAQ,GAAoB,WAAW,CAAC;IAC9C,MAAM,QAAQ,GAA8B,SAAS,CAAC;IACtD,MAAM,YAAY,GAAG,+BAA+B,CACnD,KAAK,CAAC,eAAe,EACrB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,oBAAoB,CAC1B,CAAC;IACF,IAAI,MAAM,GAA+B,IAAI,CAAC;IAE9C,MAAM,OAAO,GAAG,CAAC,KAAc,EAAwB,EAAE;QACxD,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,SAAS,GACd,KAAK,YAAY,kBAAkB;YAClC,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;QAC3F,OAAO,IAAI,oBAAoB,CAAC;YAC/B,YAAY;YACZ,MAAM,EAAE,KAAK,CAAC,aAAa;YAC3B,QAAQ;YACR,QAAQ;YACR,OAAO,EAAE,SAAS;SAClB,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;QACZ,IAAI,MAAM;YACT,OAAO,MAAM,CAAC;QACf,CAAC;QACD,KAAK,CAAC,QAAQ,CAAC,aAAa;YAC3B,IAAI,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,kBAAkB,CAC3B,KAAK,CAAC,aAAa,EACnB,gBAAgB,EAChB,mBAAmB,KAAK,CAAC,aAAa,4BAA4B,CAClE,CAAC;YACH,CAAC;YACD,MAAM,GAAG;gBACR,MAAM,EAAE,KAAK,CAAC,aAAa;gBAC3B,OAAO,EAAE,aAAa,CAAC,OAAO;gBAC9B,MAAM,EAAE,aAAa,CAAC,MAAM,IAAI,EAAE;gBAClC,IAAI,EAAE;oBACL,YAAY;oBACZ,QAAQ;oBACR,QAAQ;oBACR,aAAa,EAAE,IAAI;oBACnB,eAAe,EAAE,IAAI;oBACrB,kBAAkB,EAAE,aAAa,CAAC,QAAQ,IAAI,IAAI;oBAClD,WAAW,EAAE,KAAK,CAAC,QAAQ;wBAC1B,CAAC,CAAC,4BAA4B,CAAC,KAAK,CAAC,QAAQ,CAAC;wBAC9C,CAAC,CAAC,CAAC,4BAA4B,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,IAAI,IAAI,CAAC;iBAC1E;aACD,CAAC;QACH,CAAC;QACD,OAAO;QACP,2BAA2B,CAAC,MAAM;YACjC,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACxB,MAAM,OAAO,CACZ,IAAI,kBAAkB,CACrB,KAAK,CAAC,aAAa,EACnB,gBAAgB,EAChB,mBAAmB,KAAK,CAAC,aAAa,2CAA2C,CACjF,CACD,CAAC;YACH,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|