@executioncontrolprotocol/harnesses-browser-coding 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/browser-coding-harness.d.ts +50 -0
- package/dist/browser-coding-harness.d.ts.map +1 -0
- package/dist/browser-coding-harness.js +76 -0
- package/dist/browser-coding-harness.js.map +1 -0
- package/dist/fluent-patch-hints.d.ts +18 -0
- package/dist/fluent-patch-hints.d.ts.map +1 -0
- package/dist/fluent-patch-hints.js +262 -0
- package/dist/fluent-patch-hints.js.map +1 -0
- package/dist/harness-coding-config.d.ts +45 -0
- package/dist/harness-coding-config.d.ts.map +1 -0
- package/dist/harness-coding-config.js +87 -0
- package/dist/harness-coding-config.js.map +1 -0
- package/dist/harness-ids.d.ts +6 -0
- package/dist/harness-ids.d.ts.map +1 -0
- package/dist/harness-ids.js +6 -0
- package/dist/harness-ids.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/intent-classification-coding.d.ts +8 -0
- package/dist/intent-classification-coding.d.ts.map +1 -0
- package/dist/intent-classification-coding.js +172 -0
- package/dist/intent-classification-coding.js.map +1 -0
- package/dist/prompts/build-coding-prompt.d.ts +11 -0
- package/dist/prompts/build-coding-prompt.d.ts.map +1 -0
- package/dist/prompts/build-coding-prompt.js +17 -0
- package/dist/prompts/build-coding-prompt.js.map +1 -0
- package/dist/prompts/coding-prompt-fixture-ids.d.ts +10 -0
- package/dist/prompts/coding-prompt-fixture-ids.d.ts.map +1 -0
- package/dist/prompts/coding-prompt-fixture-ids.js +8 -0
- package/dist/prompts/coding-prompt-fixture-ids.js.map +1 -0
- package/dist/prompts/fixtures-root.d.ts +5 -0
- package/dist/prompts/fixtures-root.d.ts.map +1 -0
- package/dist/prompts/fixtures-root.js +7 -0
- package/dist/prompts/fixtures-root.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +4 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/load-harness-prompt.browser.d.ts +4 -0
- package/dist/prompts/load-harness-prompt.browser.d.ts.map +1 -0
- package/dist/prompts/load-harness-prompt.browser.js +32 -0
- package/dist/prompts/load-harness-prompt.browser.js.map +1 -0
- package/dist/prompts/load-harness-prompt.d.ts +2 -0
- package/dist/prompts/load-harness-prompt.d.ts.map +1 -0
- package/dist/prompts/load-harness-prompt.js +2 -0
- package/dist/prompts/load-harness-prompt.js.map +1 -0
- package/dist/prompts/load-harness-prompt.node.d.ts +4 -0
- package/dist/prompts/load-harness-prompt.node.d.ts.map +1 -0
- package/dist/prompts/load-harness-prompt.node.js +20 -0
- package/dist/prompts/load-harness-prompt.node.js.map +1 -0
- package/dist/register.d.ts +5 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +14 -0
- package/dist/register.js.map +1 -0
- package/dist/workflow-assistant-coding.d.ts +9 -0
- package/dist/workflow-assistant-coding.d.ts.map +1 -0
- package/dist/workflow-assistant-coding.js +282 -0
- package/dist/workflow-assistant-coding.js.map +1 -0
- package/dist/workflow-authoring-coding.d.ts +9 -0
- package/dist/workflow-authoring-coding.d.ts.map +1 -0
- package/dist/workflow-authoring-coding.js +214 -0
- package/dist/workflow-authoring-coding.js.map +1 -0
- package/fixtures/eval-cases/assistant.cases.json +658 -0
- package/fixtures/eval-cases/intent.cases.json +587 -0
- package/fixtures/eval-cases/workflow-create.cases.json +493 -0
- package/fixtures/eval-cases/workflow-patch.cases.json +379 -0
- package/fixtures/harness-prompts/intent-classification-coding.prompt.json +56 -0
- package/fixtures/harness-prompts/workflow-assistant-coding.prompt.json +70 -0
- package/fixtures/harness-prompts/workflow-authoring-create-coding.prompt.json +42 -0
- package/fixtures/harness-prompts/workflow-authoring-patch-coding.prompt.json +50 -0
- package/fixtures/runs/completed-with-refs.json +18 -0
- package/fixtures/runs/failed-echo-step.json +29 -0
- package/fixtures/runs/running-pending.json +14 -0
- package/fixtures/workflows/echo-validate-reorder.json +26 -0
- package/fixtures/workflows/echo-workflow.json +20 -0
- package/fixtures/workflows/multi-cap-workflow.json +34 -0
- package/fixtures/workflows/two-step-chain.json +26 -0
- package/package.json +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,8BAA8B,EAC9B,6CAA6C,GAC9C,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BROWSER_CODING_HARNESS_ID, BROWSER_CODING_HARNESS_CAPABILITY, } from "./harness-ids.js";
|
|
2
|
+
export { HARNESS_TASKS, HARNESS_CODING_BINDING, HARNESS_CODING_REPAIR, HARNESS_CODING_TRACE, getHarnessCodingConfig, } from "./harness-coding-config.js";
|
|
3
|
+
export { registerBrowserCodingHarnesses, resetBrowserCodingHarnessRegistrationForTests, } from "./register.js";
|
|
4
|
+
export { CODING_PROMPT_FIXTURE_IDS, buildCodingRepairHint, buildCodingSystemPrompt, loadCodingHarnessPromptFixture, } from "./prompts/index.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,8BAA8B,EAC9B,6CAA6C,GAC9C,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,GAE/B,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HarnessCapabilityContext } from "@executioncontrolprotocol/core";
|
|
2
|
+
import { type HarnessEvaluateOutput } from "@executioncontrolprotocol/types";
|
|
3
|
+
/** Intent classification for Browser Coding harness. @category Harness */
|
|
4
|
+
export declare function invokeIntentClassificationCoding(input: {
|
|
5
|
+
message: string;
|
|
6
|
+
model?: string;
|
|
7
|
+
}, ctx: HarnessCapabilityContext<Record<string, unknown>>): Promise<HarnessEvaluateOutput>;
|
|
8
|
+
//# sourceMappingURL=intent-classification-coding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-classification-coding.d.ts","sourceRoot":"","sources":["../src/intent-classification-coding.ts"],"names":[],"mappings":"AACA,OAAO,EAaL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAKL,KAAK,qBAAqB,EAI3B,MAAM,iCAAiC,CAAA;AAmNxC,0EAA0E;AAC1E,wBAAsB,gCAAgC,CACpD,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1C,GAAG,EAAE,wBAAwB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACrD,OAAO,CAAC,qBAAqB,CAAC,CAEhC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { compileHarnessArtifactSource } from "@executioncontrolprotocol/core/compile";
|
|
2
|
+
import { callModelGenerate, collectModelOutputFeedback, collectValidationFeedback, defineHarness, formatEnvironmentSummaryLines, formatFeedbackForModel, HARNESS_OUTPUT_FORMAT_TYPESCRIPT, inferResponseFormatFromFormatter, isRepairFeedbackEcho, runModelRepairLoop, stripHarnessTypeScriptOutput, summarizeEnvironmentDescriptor, } from "@executioncontrolprotocol/core";
|
|
3
|
+
import { ECP_INTENT_SCHEMA, ECP_MODEL_GENERATE_INTERFACE, harnessEvaluateOutputSchema, LATEST_ECP_VERSION, } from "@executioncontrolprotocol/types";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { BROWSER_CODING_HARNESS_ID } from "./harness-ids.js";
|
|
6
|
+
import { buildCodingRepairHint, buildCodingSystemPrompt, CODING_PROMPT_FIXTURE_IDS, } from "./prompts/index.js";
|
|
7
|
+
const harnessConfigSchema = z.object({
|
|
8
|
+
promptFixture: z
|
|
9
|
+
.string()
|
|
10
|
+
.default(CODING_PROMPT_FIXTURE_IDS.INTENT_CLASSIFICATION),
|
|
11
|
+
system: z.string().optional(),
|
|
12
|
+
context: z
|
|
13
|
+
.object({
|
|
14
|
+
includeEnvironmentDescriptor: z.boolean().default(false),
|
|
15
|
+
includeEncodedDescriptor: z.boolean().default(false),
|
|
16
|
+
descriptorFormat: z.string().default("@executioncontrolprotocol/format-json"),
|
|
17
|
+
})
|
|
18
|
+
.default({}),
|
|
19
|
+
output: z
|
|
20
|
+
.object({
|
|
21
|
+
schema: z.string().default(ECP_INTENT_SCHEMA),
|
|
22
|
+
format: z.string().default(HARNESS_OUTPUT_FORMAT_TYPESCRIPT),
|
|
23
|
+
validate: z.boolean().default(true),
|
|
24
|
+
})
|
|
25
|
+
.default({}),
|
|
26
|
+
repair: z
|
|
27
|
+
.object({
|
|
28
|
+
enabled: z.boolean().default(true),
|
|
29
|
+
maxAttempts: z.number().default(1),
|
|
30
|
+
includeValidationErrors: z.boolean().default(true),
|
|
31
|
+
})
|
|
32
|
+
.default({}),
|
|
33
|
+
trace: z
|
|
34
|
+
.object({
|
|
35
|
+
includePrompt: z.boolean().default(false),
|
|
36
|
+
includeRawOutput: z.boolean().default(true),
|
|
37
|
+
includeValidation: z.boolean().default(true),
|
|
38
|
+
includeRepairAttempts: z.boolean().default(true),
|
|
39
|
+
})
|
|
40
|
+
.default({}),
|
|
41
|
+
});
|
|
42
|
+
const harnessInputSchema = z.object({
|
|
43
|
+
message: z.string(),
|
|
44
|
+
model: z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
const codingIntentHarness = defineHarness("@executioncontrolprotocol", "browser-coding-intent-classification")
|
|
47
|
+
.withConfig(harnessConfigSchema)
|
|
48
|
+
.withInput(harnessInputSchema)
|
|
49
|
+
.withOutput(harnessEvaluateOutputSchema)
|
|
50
|
+
.usesProviderInterface(ECP_MODEL_GENERATE_INTERFACE)
|
|
51
|
+
.withHandler(async (input, ctx) => {
|
|
52
|
+
const config = ctx.config;
|
|
53
|
+
const format = config.output.format;
|
|
54
|
+
const system = config.system ?? buildCodingSystemPrompt(config.promptFixture);
|
|
55
|
+
let environmentSummaryLines = "";
|
|
56
|
+
if (config.context.includeEnvironmentDescriptor) {
|
|
57
|
+
const descriptor = await ctx.ecp.describe();
|
|
58
|
+
const summary = summarizeEnvironmentDescriptor(descriptor);
|
|
59
|
+
environmentSummaryLines = formatEnvironmentSummaryLines(summary, {
|
|
60
|
+
format: "plain",
|
|
61
|
+
}).join("\n");
|
|
62
|
+
}
|
|
63
|
+
const buildPrompt = (repairText) => {
|
|
64
|
+
const lines = [`User message: ${input.message}`];
|
|
65
|
+
if (/^how\s+(?:does|do)\b/i.test(input.message.trim()) &&
|
|
66
|
+
/\bwork\b/i.test(input.message)) {
|
|
67
|
+
lines.push("Routing hint: how-does questions about ECP features -> intent faq (not workflow-patch).");
|
|
68
|
+
}
|
|
69
|
+
if (/^what is ecp\b/i.test(input.message.trim())) {
|
|
70
|
+
lines.push("Routing hint: definitional questions about ECP -> intent faq.");
|
|
71
|
+
}
|
|
72
|
+
if (environmentSummaryLines) {
|
|
73
|
+
lines.unshift("Environment capabilities:", environmentSummaryLines, "");
|
|
74
|
+
}
|
|
75
|
+
if (repairText) {
|
|
76
|
+
lines.push("Previous attempt failed. Fix and return corrected TypeScript only:", repairText, buildCodingRepairHint(config.promptFixture));
|
|
77
|
+
}
|
|
78
|
+
return lines.join("\n");
|
|
79
|
+
};
|
|
80
|
+
const maxAttempts = config.repair.enabled ? 1 + config.repair.maxAttempts : 1;
|
|
81
|
+
let lastPrompt = buildPrompt();
|
|
82
|
+
let validation = decodedValidationStub();
|
|
83
|
+
const loopResult = await runModelRepairLoop({
|
|
84
|
+
maxAttempts,
|
|
85
|
+
generate: async ({ attempt, priorFeedback }) => {
|
|
86
|
+
const repairText = attempt > 0 && config.repair.includeValidationErrors
|
|
87
|
+
? formatFeedbackForModel(priorFeedback)
|
|
88
|
+
: undefined;
|
|
89
|
+
lastPrompt = buildPrompt(repairText);
|
|
90
|
+
const generated = await callModelGenerate(ctx.uses, {
|
|
91
|
+
prompt: lastPrompt,
|
|
92
|
+
system,
|
|
93
|
+
model: input.model,
|
|
94
|
+
responseFormat: inferResponseFormatFromFormatter(format),
|
|
95
|
+
}, ctx.capabilityContext, format);
|
|
96
|
+
return { raw: stripHarnessTypeScriptOutput(generated.text) };
|
|
97
|
+
},
|
|
98
|
+
evaluate: async (raw, { attempt, priorFeedback }) => {
|
|
99
|
+
const feedback = [];
|
|
100
|
+
if (attempt > 0 &&
|
|
101
|
+
config.repair.includeValidationErrors &&
|
|
102
|
+
isRepairFeedbackEcho(raw, formatFeedbackForModel(priorFeedback))) {
|
|
103
|
+
return {
|
|
104
|
+
success: false,
|
|
105
|
+
feedback: [
|
|
106
|
+
collectModelOutputFeedback("Output echoed validation errors. Return only the intent TypeScript module."),
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const compiled = await compileHarnessArtifactSource({
|
|
111
|
+
source: raw,
|
|
112
|
+
filename: "intent.ts",
|
|
113
|
+
expectedSchema: ECP_INTENT_SCHEMA,
|
|
114
|
+
});
|
|
115
|
+
validation = compiled.validation ?? decodedValidationStub(!compiled.ok);
|
|
116
|
+
if (!compiled.ok || !compiled.artifact) {
|
|
117
|
+
const msg = compiled.compileErrors?.map((e) => e.message).join("; ") ?? "Compile failed";
|
|
118
|
+
feedback.push(collectModelOutputFeedback(msg));
|
|
119
|
+
if (validation.valid === false) {
|
|
120
|
+
feedback.push(collectValidationFeedback(validation));
|
|
121
|
+
}
|
|
122
|
+
return { success: false, feedback };
|
|
123
|
+
}
|
|
124
|
+
if (config.output.validate && validation.valid === false) {
|
|
125
|
+
feedback.push(collectValidationFeedback(validation));
|
|
126
|
+
return { success: false, feedback };
|
|
127
|
+
}
|
|
128
|
+
const intent = compiled.artifact.intent;
|
|
129
|
+
const msg = input.message.trim();
|
|
130
|
+
if (intent === "workflow-patch" &&
|
|
131
|
+
((/^how\s+(?:does|do)\b/i.test(msg) && /\bwork\b/i.test(msg)) ||
|
|
132
|
+
/^what is ecp\b/i.test(msg))) {
|
|
133
|
+
feedback.push(collectModelOutputFeedback("Use intent faq for how-does or what-is questions about ECP."));
|
|
134
|
+
return { success: false, feedback };
|
|
135
|
+
}
|
|
136
|
+
return { success: true, artifact: compiled.artifact, feedback };
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
const trace = {
|
|
140
|
+
harness: BROWSER_CODING_HARNESS_ID,
|
|
141
|
+
provider: ctx.uses,
|
|
142
|
+
model: input.model,
|
|
143
|
+
outputSchema: config.output.schema,
|
|
144
|
+
outputFormat: format,
|
|
145
|
+
decodeSucceeded: true,
|
|
146
|
+
validationSucceeded: validation.valid,
|
|
147
|
+
...(config.trace.includePrompt ? { prompt: lastPrompt } : {}),
|
|
148
|
+
...(config.trace.includeRawOutput ? { rawOutput: loopResult.raw } : {}),
|
|
149
|
+
...(config.trace.includeRepairAttempts ? { repairAttempts: loopResult.attempts } : {}),
|
|
150
|
+
};
|
|
151
|
+
return {
|
|
152
|
+
artifact: loopResult.artifact,
|
|
153
|
+
raw: loopResult.raw,
|
|
154
|
+
...(config.trace.includeValidation ? { validation } : {}),
|
|
155
|
+
trace,
|
|
156
|
+
};
|
|
157
|
+
})
|
|
158
|
+
.build();
|
|
159
|
+
function decodedValidationStub(valid = true) {
|
|
160
|
+
return {
|
|
161
|
+
schema: "@executioncontrolprotocol.validation.result",
|
|
162
|
+
version: LATEST_ECP_VERSION,
|
|
163
|
+
valid,
|
|
164
|
+
errors: [],
|
|
165
|
+
warnings: [],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** Intent classification for Browser Coding harness. @category Harness */
|
|
169
|
+
export async function invokeIntentClassificationCoding(input, ctx) {
|
|
170
|
+
return codingIntentHarness.handler(input, ctx);
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=intent-classification-coding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-classification-coding.js","sourceRoot":"","sources":["../src/intent-classification-coding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAA;AACrF,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,aAAa,EACb,6BAA6B,EAC7B,sBAAsB,EACtB,gCAAgC,EAChC,gCAAgC,EAChC,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,8BAA8B,GAE/B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,2BAA2B,EAC3B,kBAAkB,GAKnB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,y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AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,KAA0C,EAC1C,GAAsD;IAEtD,OAAO,mBAAmB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAmC,CAAA;AAClF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the system prompt for a Browser Coding harness prompt fixture id.
|
|
3
|
+
* @category Harness
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildCodingSystemPrompt(fixtureId: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Build repair-line text for a Browser Coding harness prompt fixture id.
|
|
8
|
+
* @category Harness
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildCodingRepairHint(fixtureId: string): string;
|
|
11
|
+
//# sourceMappingURL=build-coding-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-coding-prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/build-coding-prompt.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { buildRepairHintFromFixture, buildSystemPromptFromFixture, } from "@executioncontrolprotocol/core";
|
|
2
|
+
import { loadCodingHarnessPromptFixture } from "./load-harness-prompt.js";
|
|
3
|
+
/**
|
|
4
|
+
* Build the system prompt for a Browser Coding harness prompt fixture id.
|
|
5
|
+
* @category Harness
|
|
6
|
+
*/
|
|
7
|
+
export function buildCodingSystemPrompt(fixtureId) {
|
|
8
|
+
return buildSystemPromptFromFixture(loadCodingHarnessPromptFixture(fixtureId));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build repair-line text for a Browser Coding harness prompt fixture id.
|
|
12
|
+
* @category Harness
|
|
13
|
+
*/
|
|
14
|
+
export function buildCodingRepairHint(fixtureId) {
|
|
15
|
+
return buildRepairHintFromFixture(loadCodingHarnessPromptFixture(fixtureId));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=build-coding-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-coding-prompt.js","sourceRoot":"","sources":["../../src/prompts/build-coding-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AAEzE;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,OAAO,4BAA4B,CAAC,8BAA8B,CAAC,SAAS,CAAC,CAAC,CAAA;AAChF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACrD,OAAO,0BAA0B,CAAC,8BAA8B,CAAC,SAAS,CAAC,CAAC,CAAA;AAC9E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Browser Coding harness prompt fixture ids. @category Harness */
|
|
2
|
+
export declare const CODING_PROMPT_FIXTURE_IDS: {
|
|
3
|
+
readonly INTENT_CLASSIFICATION: "intent-classification-coding";
|
|
4
|
+
readonly WORKFLOW_AUTHORING_CREATE: "workflow-authoring-create-coding";
|
|
5
|
+
readonly WORKFLOW_AUTHORING_PATCH: "workflow-authoring-patch-coding";
|
|
6
|
+
readonly WORKFLOW_ASSISTANT: "workflow-assistant-coding";
|
|
7
|
+
};
|
|
8
|
+
/** Browser Coding harness prompt fixture id union. @category Harness */
|
|
9
|
+
export type CodingPromptFixtureId = (typeof CODING_PROMPT_FIXTURE_IDS)[keyof typeof CODING_PROMPT_FIXTURE_IDS];
|
|
10
|
+
//# sourceMappingURL=coding-prompt-fixture-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-prompt-fixture-ids.d.ts","sourceRoot":"","sources":["../../src/prompts/coding-prompt-fixture-ids.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAA;AAEV,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Browser Coding harness prompt fixture ids. @category Harness */
|
|
2
|
+
export const CODING_PROMPT_FIXTURE_IDS = {
|
|
3
|
+
INTENT_CLASSIFICATION: "intent-classification-coding",
|
|
4
|
+
WORKFLOW_AUTHORING_CREATE: "workflow-authoring-create-coding",
|
|
5
|
+
WORKFLOW_AUTHORING_PATCH: "workflow-authoring-patch-coding",
|
|
6
|
+
WORKFLOW_ASSISTANT: "workflow-assistant-coding",
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=coding-prompt-fixture-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-prompt-fixture-ids.js","sourceRoot":"","sources":["../../src/prompts/coding-prompt-fixture-ids.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,qBAAqB,EAAE,8BAA8B;IACrD,yBAAyB,EAAE,kCAAkC;IAC7D,wBAAwB,EAAE,iCAAiC;IAC3D,kBAAkB,EAAE,2BAA2B;CACvC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Package root for `@executioncontrolprotocol/harnesses-browser-coding`. @category Harness */
|
|
2
|
+
export declare const CODING_PACKAGE_ROOT: string;
|
|
3
|
+
/** Directory for Browser Coding harness prompt JSON fixtures. @category Harness */
|
|
4
|
+
export declare const CODING_HARNESS_PROMPTS_DIR: string;
|
|
5
|
+
//# sourceMappingURL=fixtures-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures-root.d.ts","sourceRoot":"","sources":["../../src/prompts/fixtures-root.ts"],"names":[],"mappings":"AAGA,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,QAG/B,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,QAA6D,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
/** Package root for `@executioncontrolprotocol/harnesses-browser-coding`. @category Harness */
|
|
4
|
+
export const CODING_PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
5
|
+
/** Directory for Browser Coding harness prompt JSON fixtures. @category Harness */
|
|
6
|
+
export const CODING_HARNESS_PROMPTS_DIR = path.join(CODING_PACKAGE_ROOT, "fixtures/harness-prompts");
|
|
7
|
+
//# sourceMappingURL=fixtures-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures-root.js","sourceRoot":"","sources":["../../src/prompts/fixtures-root.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAC7C,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC5C,OAAO,CACR,CAAA;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CODING_PROMPT_FIXTURE_IDS, type CodingPromptFixtureId } from "./coding-prompt-fixture-ids.js";
|
|
2
|
+
export { loadCodingHarnessPromptFixture } from "./load-harness-prompt.js";
|
|
3
|
+
export { buildCodingSystemPrompt, buildCodingRepairHint } from "./build-coding-prompt.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CODING_PROMPT_FIXTURE_IDS } from "./coding-prompt-fixture-ids.js";
|
|
2
|
+
export { loadCodingHarnessPromptFixture } from "./load-harness-prompt.js";
|
|
3
|
+
export { buildCodingSystemPrompt, buildCodingRepairHint } from "./build-coding-prompt.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAA8B,MAAM,gCAAgC,CAAA;AACtG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HarnessPromptFixture } from "@executioncontrolprotocol/core";
|
|
2
|
+
/** Load and validate a Browser Coding harness prompt fixture by id (browser bundle). @category Harness */
|
|
3
|
+
export declare function loadCodingHarnessPromptFixture(fixtureId: string): HarnessPromptFixture;
|
|
4
|
+
//# sourceMappingURL=load-harness-prompt.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.browser.d.ts","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAA;AA2BvC,0GAA0G;AAC1G,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAMtF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { harnessPromptFixtureSchema, } from "@executioncontrolprotocol/core";
|
|
2
|
+
function fixtureIdFromGlobKey(key) {
|
|
3
|
+
const normalized = key.replace(/\\/g, "/");
|
|
4
|
+
const fileName = normalized.split("/").pop() ?? normalized;
|
|
5
|
+
return fileName.replace(/\.prompt\.json$/, "");
|
|
6
|
+
}
|
|
7
|
+
function loadBrowserPromptFixtures() {
|
|
8
|
+
const modules = import.meta.glob("../../../fixtures/harness-prompts/*.prompt.json", {
|
|
9
|
+
eager: true,
|
|
10
|
+
import: "default",
|
|
11
|
+
});
|
|
12
|
+
const map = new Map();
|
|
13
|
+
for (const [key, raw] of Object.entries(modules)) {
|
|
14
|
+
const fixtureId = fixtureIdFromGlobKey(key);
|
|
15
|
+
const parsed = harnessPromptFixtureSchema.parse(raw);
|
|
16
|
+
if (parsed.id !== fixtureId) {
|
|
17
|
+
throw new Error(`Harness prompt fixture id mismatch: file ${fixtureId}, json id ${parsed.id}`);
|
|
18
|
+
}
|
|
19
|
+
map.set(fixtureId, parsed);
|
|
20
|
+
}
|
|
21
|
+
return map;
|
|
22
|
+
}
|
|
23
|
+
const promptFixtures = loadBrowserPromptFixtures();
|
|
24
|
+
/** Load and validate a Browser Coding harness prompt fixture by id (browser bundle). @category Harness */
|
|
25
|
+
export function loadCodingHarnessPromptFixture(fixtureId) {
|
|
26
|
+
const fixture = promptFixtures.get(fixtureId);
|
|
27
|
+
if (!fixture) {
|
|
28
|
+
throw new Error(`Harness prompt fixture not found: ${fixtureId}`);
|
|
29
|
+
}
|
|
30
|
+
return fixture;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=load-harness-prompt.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.browser.js","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AAEvC,SAAS,oBAAoB,CAAC,GAAW;IACvC,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,UAAU,CAAA;IAC1D,OAAO,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AAChD,CAAC;AAED,SAAS,yBAAyB;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iDAAiD,EAAE;QAClF,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,SAAS;KAClB,CAAyC,CAAA;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAgC,CAAA;IACnD,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;QAC3C,MAAM,MAAM,GAAG,0BAA0B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACpD,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,4CAA4C,SAAS,aAAa,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;QAChG,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC5B,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,cAAc,GAAG,yBAAyB,EAAE,CAAA;AAElD,0GAA0G;AAC1G,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qCAAqC,SAAS,EAAE,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,IAAI,8BAA8B,EAAE,MAAM,+BAA+B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.js","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,IAAI,8BAA8B,EAAE,MAAM,+BAA+B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HarnessPromptFixture } from "@executioncontrolprotocol/core";
|
|
2
|
+
/** Node-only Browser Coding harness prompt loader. @category Harness */
|
|
3
|
+
export declare function loadCodingHarnessPromptFixtureNode(fixtureId: string): HarnessPromptFixture;
|
|
4
|
+
//# sourceMappingURL=load-harness-prompt.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.node.d.ts","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.node.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAA;AAKvC,wEAAwE;AACxE,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAW1F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { harnessPromptFixtureSchema, } from "@executioncontrolprotocol/core";
|
|
4
|
+
import { CODING_HARNESS_PROMPTS_DIR } from "./fixtures-root.js";
|
|
5
|
+
const cache = new Map();
|
|
6
|
+
/** Node-only Browser Coding harness prompt loader. @category Harness */
|
|
7
|
+
export function loadCodingHarnessPromptFixtureNode(fixtureId) {
|
|
8
|
+
const cached = cache.get(fixtureId);
|
|
9
|
+
if (cached)
|
|
10
|
+
return cached;
|
|
11
|
+
const full = path.join(CODING_HARNESS_PROMPTS_DIR, `${fixtureId}.prompt.json`);
|
|
12
|
+
const raw = JSON.parse(readFileSync(full, "utf8"));
|
|
13
|
+
const parsed = harnessPromptFixtureSchema.parse(raw);
|
|
14
|
+
if (parsed.id !== fixtureId) {
|
|
15
|
+
throw new Error(`Harness prompt fixture id mismatch: file ${fixtureId}, json id ${parsed.id}`);
|
|
16
|
+
}
|
|
17
|
+
cache.set(fixtureId, parsed);
|
|
18
|
+
return parsed;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=load-harness-prompt.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-harness-prompt.node.js","sourceRoot":"","sources":["../../src/prompts/load-harness-prompt.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAE/D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgC,CAAA;AAErD,wEAAwE;AACxE,MAAM,UAAU,kCAAkC,CAAC,SAAiB;IAClE,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACnC,IAAI,MAAM;QAAE,OAAO,MAAM,CAAA;IACzB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,SAAS,cAAc,CAAC,CAAA;IAC9E,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY,CAAA;IAC7D,MAAM,MAAM,GAAG,0BAA0B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACpD,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,4CAA4C,SAAS,aAAa,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAChG,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Register Browser Coding harness in the global catalog. @category Harness */
|
|
2
|
+
export declare function registerBrowserCodingHarnesses(): void;
|
|
3
|
+
/** Reset harness registration (tests). @internal */
|
|
4
|
+
export declare function resetBrowserCodingHarnessRegistrationForTests(): void;
|
|
5
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,wBAAgB,8BAA8B,IAAI,IAAI,CAIrD;AAED,oDAAoD;AACpD,wBAAgB,6CAA6C,IAAI,IAAI,CAEpE"}
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { registerBrowserCodingHarness } from "./browser-coding-harness.js";
|
|
2
|
+
let registered = false;
|
|
3
|
+
/** Register Browser Coding harness in the global catalog. @category Harness */
|
|
4
|
+
export function registerBrowserCodingHarnesses() {
|
|
5
|
+
if (registered)
|
|
6
|
+
return;
|
|
7
|
+
registerBrowserCodingHarness();
|
|
8
|
+
registered = true;
|
|
9
|
+
}
|
|
10
|
+
/** Reset harness registration (tests). @internal */
|
|
11
|
+
export function resetBrowserCodingHarnessRegistrationForTests() {
|
|
12
|
+
registered = false;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE1E,IAAI,UAAU,GAAG,KAAK,CAAA;AAEtB,+EAA+E;AAC/E,MAAM,UAAU,8BAA8B;IAC5C,IAAI,UAAU;QAAE,OAAM;IACtB,4BAA4B,EAAE,CAAA;IAC9B,UAAU,GAAG,IAAI,CAAA;AACnB,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,6CAA6C;IAC3D,UAAU,GAAG,KAAK,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HarnessCapabilityContext } from "@executioncontrolprotocol/core";
|
|
2
|
+
import { type HarnessEvaluateOutput } from "@executioncontrolprotocol/types";
|
|
3
|
+
/** Workflow assistant for Browser Coding harness. @category Harness */
|
|
4
|
+
export declare function invokeWorkflowAssistantCoding(input: {
|
|
5
|
+
message: string;
|
|
6
|
+
runContext?: unknown;
|
|
7
|
+
model?: string;
|
|
8
|
+
}, ctx: HarnessCapabilityContext<Record<string, unknown>>): Promise<HarnessEvaluateOutput>;
|
|
9
|
+
//# sourceMappingURL=workflow-assistant-coding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-assistant-coding.d.ts","sourceRoot":"","sources":["../src/workflow-assistant-coding.ts"],"names":[],"mappings":"AACA,OAAO,EAiBL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAML,KAAK,qBAAqB,EAQ3B,MAAM,iCAAiC,CAAA;AA+VxC,uEAAuE;AACvE,wBAAsB,6BAA6B,CACjD,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,GAAG,EAAE,wBAAwB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACrD,OAAO,CAAC,qBAAqB,CAAC,CAEhC"}
|