@ggui-ai/ui-gen 0.26.0 → 0.27.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/dist/{adapter-BJwn74rx.d.ts → adapter-h4_V69LI.d.ts} +1 -1
- package/dist/adapters/base.d.ts +6 -1
- package/dist/adapters/base.js.map +1 -1
- package/dist/adapters/generation-dispatch.d.ts +2 -2
- package/dist/adapters/generation-dispatch.js +61 -10
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +36 -14
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +4 -4
- package/dist/advanced/index.js +94 -19
- package/dist/advanced/index.js.map +1 -1
- package/dist/boilerplate.js +4 -6
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +1 -7
- package/dist/check/index.js +50 -4
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-N4gRXpcL.d.ts → create-ui-generator-BrZHF0cf.d.ts} +2 -2
- package/dist/{dispatch-BUoXRj_r.d.ts → dispatch-B07TI30d.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +3 -3
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +1 -1
- package/dist/evaluation/index.d.ts +22 -12
- package/dist/evaluation/index.js +36 -10
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +3 -3
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +4 -6
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js +1 -4
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +2 -2
- package/dist/harness/runtime.d.ts +1 -1
- package/dist/harness/runtime.js +6 -7
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js +4 -6
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +94 -19
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +1 -1
- package/dist/{types-public-B7wn4ce5.d.ts → types-public-h8IMnYuh.d.ts} +4 -0
- package/dist/{visual-evaluator-C9L-o6ap.d.ts → visual-evaluator-C2strxqD.d.ts} +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +12 -12
- package/src/adapters/base.ts +6 -1
- package/src/adapters/claude/message-parser.ts +5 -6
- package/src/adapters/claude/sdk-tool-pins.ts +44 -0
- package/src/adapters/claude/sdk.ts +3 -3
- package/src/adapters/claude/source-capture.ts +20 -0
- package/src/boilerplate/system-prompt.ts +3 -2
- package/src/check/run-tier0.ts +61 -0
- package/src/design-system-docs.ts +2 -1
- package/src/evaluation/criteria/resolve.ts +19 -1
- package/src/evaluation/loop.ts +25 -4
- package/src/evaluation/message-parsing.ts +11 -12
- package/src/evaluation/types-public.ts +4 -0
- package/src/taught-tokens.ts +5 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as CriteriaSelection, h as CriteriaContext, C as CriteriaAnswerCounts, s as VisionFinishReason, k as CriteriaBlock } from '../types-public-
|
|
2
|
-
export { A as AxisCheck, a as AxisCheckInput, t as CRITERIA, n as CanvasHostPresentation, j as CanvasJudgeRecord, l as CanvasPresentationOutcome, u as CanvasVisualSummary, v as ContractFeedbackRecord, w as CriterionCoverage, x as CriterionRunStatus, D as DEFAULT_QUALITY_CONFIG, y as EvalCategory, z as EvalCriterion, E as EvalIssue, B as EvalOutcome, e as EvalResult, q as EvalTier, H as HostInlineFrame, F as HostPresentationIgnoredReason, G as LLM_EVAL_STATIC_CRITERIA, I as Priority, Q as QualityConfig, K as QualityMode, o as VisualEvalSummary, M as buildCodingCriteriaSummary, N as criteriaFor, O as getActionableIssues, S as getCriteriaByPriority, T as getCriterionById, U as getLLMCriteria, W as isBlocked, m as matches, X as notApplicableCoverage, Y as priorityForIssue } from '../types-public-
|
|
1
|
+
import { r as CriteriaSelection, h as CriteriaContext, C as CriteriaAnswerCounts, s as VisionFinishReason, k as CriteriaBlock } from '../types-public-h8IMnYuh.js';
|
|
2
|
+
export { A as AxisCheck, a as AxisCheckInput, t as CRITERIA, n as CanvasHostPresentation, j as CanvasJudgeRecord, l as CanvasPresentationOutcome, u as CanvasVisualSummary, v as ContractFeedbackRecord, w as CriterionCoverage, x as CriterionRunStatus, D as DEFAULT_QUALITY_CONFIG, y as EvalCategory, z as EvalCriterion, E as EvalIssue, B as EvalOutcome, e as EvalResult, q as EvalTier, H as HostInlineFrame, F as HostPresentationIgnoredReason, G as LLM_EVAL_STATIC_CRITERIA, I as Priority, Q as QualityConfig, K as QualityMode, o as VisualEvalSummary, M as buildCodingCriteriaSummary, N as criteriaFor, O as getActionableIssues, S as getCriteriaByPriority, T as getCriterionById, U as getLLMCriteria, W as isBlocked, m as matches, X as notApplicableCoverage, Y as priorityForIssue } from '../types-public-h8IMnYuh.js';
|
|
3
3
|
import * as _anthropic_ai_claude_agent_sdk from '@anthropic-ai/claude-agent-sdk';
|
|
4
4
|
import { McpServerConfig } from '@anthropic-ai/claude-agent-sdk';
|
|
5
5
|
import { EvaluationContext, EvaluationConfig, QualityMetadata, EvaluationResult, EvaluationIssue, CriteriaAnswer } from './types.js';
|
|
6
6
|
export { DEFAULT_EVAL_MAX_ROUNDS, DimensionScores, MAX_EVAL_ROUNDS_HARD_LIMIT } from './types.js';
|
|
7
|
-
export { R as RunAxisChecksInput, r as runAxisChecks } from '../dispatch-
|
|
8
|
-
import { E as EdgeVerdict, a as EdgeBlock, C as CriteriaCallTokens } from '../visual-evaluator-
|
|
9
|
-
export { b as CARD_HEIGHT_EXPRESSION, c as CONTENT_HEIGHT_EXPRESSION, d as CanvasFitPolicy, e as CanvasVisualResult, f as CaptureMode, g as ChromiumProvider, h as CriteriaContextInput, i as CriteriaContextSources, j as EDGE_TOLERANCE_PX, k as EdgeOffset, H as HOST_COLOUR_PATTERN, l as HOST_FRAME_BOUNDS, J as JUDGE_GROUND_MARGIN_PX, m as JUDGE_INK_INSET_PX, n as JudgeDesignIdentity, N as NaturalCaptureOptions, S as ScreenshotAttempt, o as ScreenshotBrowser, p as ScreenshotClip, q as ScreenshotDeps, r as ScreenshotLauncher, s as ScreenshotPage, t as StoredCaptureInput, u as StoredCaptureOutcome, v as StoredCaptureVerdict, w as VISUAL_EVAL_PROMPT, x as VISUAL_JUDGE_MAX_OUTPUT_TOKENS, y as VISUAL_JUDGE_PROMPT_DIGEST, z as VISUAL_JUDGE_PROMPT_VERSION, A as VisualEvalConfig, B as VisualEvalContext, D as VisualEvalDeps, F as VisualEvalDetailed, G as VisualEvalOutcome, I as VisualEvaluationResult, V as VisualLegTokens, K as callMultimodalLLM, L as canvasBlankIssue, M as canvasFitPolicy, O as canvasOverflowIssue, P as captureScreenshot, Q as captureScreenshotDetailed, R as chromaOfCssTokens, T as criteriaContextFor, U as designTreeSha256, W as judgeDesignIdentity, X as judgeEdges, Y as judgeStoredCapture, Z as resetJudgeDesignIdentityCache, _ as resolveDesignPackageDir, $ as resolveLaunchOptions, a0 as runVisualEval, a1 as runVisualEvaluation, a2 as runVisualEvaluationDetailed, a3 as summarizeVisualResult } from '../visual-evaluator-
|
|
7
|
+
export { R as RunAxisChecksInput, r as runAxisChecks } from '../dispatch-B07TI30d.js';
|
|
8
|
+
import { E as EdgeVerdict, a as EdgeBlock, C as CriteriaCallTokens } from '../visual-evaluator-C2strxqD.js';
|
|
9
|
+
export { b as CARD_HEIGHT_EXPRESSION, c as CONTENT_HEIGHT_EXPRESSION, d as CanvasFitPolicy, e as CanvasVisualResult, f as CaptureMode, g as ChromiumProvider, h as CriteriaContextInput, i as CriteriaContextSources, j as EDGE_TOLERANCE_PX, k as EdgeOffset, H as HOST_COLOUR_PATTERN, l as HOST_FRAME_BOUNDS, J as JUDGE_GROUND_MARGIN_PX, m as JUDGE_INK_INSET_PX, n as JudgeDesignIdentity, N as NaturalCaptureOptions, S as ScreenshotAttempt, o as ScreenshotBrowser, p as ScreenshotClip, q as ScreenshotDeps, r as ScreenshotLauncher, s as ScreenshotPage, t as StoredCaptureInput, u as StoredCaptureOutcome, v as StoredCaptureVerdict, w as VISUAL_EVAL_PROMPT, x as VISUAL_JUDGE_MAX_OUTPUT_TOKENS, y as VISUAL_JUDGE_PROMPT_DIGEST, z as VISUAL_JUDGE_PROMPT_VERSION, A as VisualEvalConfig, B as VisualEvalContext, D as VisualEvalDeps, F as VisualEvalDetailed, G as VisualEvalOutcome, I as VisualEvaluationResult, V as VisualLegTokens, K as callMultimodalLLM, L as canvasBlankIssue, M as canvasFitPolicy, O as canvasOverflowIssue, P as captureScreenshot, Q as captureScreenshotDetailed, R as chromaOfCssTokens, T as criteriaContextFor, U as designTreeSha256, W as judgeDesignIdentity, X as judgeEdges, Y as judgeStoredCapture, Z as resetJudgeDesignIdentityCache, _ as resolveDesignPackageDir, $ as resolveLaunchOptions, a0 as runVisualEval, a1 as runVisualEvaluation, a2 as runVisualEvaluationDetailed, a3 as summarizeVisualResult } from '../visual-evaluator-C2strxqD.js';
|
|
10
10
|
export { b as CANVAS_BREAKPOINTS, c as CANVAS_CLASSES, d as CANVAS_DESCRIPTORS, e as CANVAS_VIEWPORTS, C as CanvasClass, f as CanvasDescriptor, g as CanvasDisplayMode, a as CanvasViewport, j as canvasDisplayModeForShell, k as canvasForRendering, l as canvasForViewportWidth, m as describeCanvas } from '../design-mode-DGWN_Gkm.js';
|
|
11
11
|
import { AppTheme } from '@ggui-ai/protocol';
|
|
12
12
|
import { C as CriteriaBank } from '../bank-Ctdp3FUA.js';
|
|
@@ -43,8 +43,13 @@ interface EvaluationLoopOptions {
|
|
|
43
43
|
cwd?: string;
|
|
44
44
|
/** MCP servers available to the fix agent */
|
|
45
45
|
mcpServers?: Record<string, McpServerConfig>;
|
|
46
|
-
/**
|
|
46
|
+
/** Tool names to approve. Absent → every tool of every server in `mcpServers` (ggui#1714). */
|
|
47
47
|
allowedTools?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* CLI built-in tools to offer the fix agent (e.g. `['Write']`). Default: none.
|
|
50
|
+
* An explicit opt-in: a built-in that writes or executes acts on the host (ggui#1714).
|
|
51
|
+
*/
|
|
52
|
+
builtinTools?: readonly string[];
|
|
48
53
|
/** LLM model for fix rounds */
|
|
49
54
|
model?: string;
|
|
50
55
|
/** Environment variables (includes BYOK credentials) */
|
|
@@ -167,13 +172,14 @@ declare function extractEvalResult(messages: SdkMessage[]): EvaluationResult | u
|
|
|
167
172
|
*/
|
|
168
173
|
declare function extractCompiledCodeFromMessage(message: SdkMessage): string | undefined;
|
|
169
174
|
/**
|
|
170
|
-
* Extract source code from an assistant's
|
|
175
|
+
* Extract source code from an assistant message's tool_use blocks.
|
|
171
176
|
*
|
|
172
|
-
*
|
|
173
|
-
* the `input.content
|
|
174
|
-
*
|
|
177
|
+
* Reads the bridged compile tool (`*__compile_component`, `input.code`)
|
|
178
|
+
* and the CLI's `Write` (`input.content`, offered only by opt-in), by the
|
|
179
|
+
* one rule in `adapters/claude/source-capture.ts` (ggui#1714). If several
|
|
180
|
+
* calls carry source, returns the last one (the final version).
|
|
175
181
|
*
|
|
176
|
-
* Used by: loop.ts
|
|
182
|
+
* Used by: loop.ts
|
|
177
183
|
*/
|
|
178
184
|
declare function extractSourceCodeFromMessage(message: SdkMessage): string | undefined;
|
|
179
185
|
/**
|
|
@@ -183,7 +189,7 @@ declare function extractSourceCodeFromMessage(message: SdkMessage): string | und
|
|
|
183
189
|
*/
|
|
184
190
|
declare function extractCompiledCode(messages: SdkMessage[]): string | undefined;
|
|
185
191
|
/**
|
|
186
|
-
* Scan all messages for the last sourceCode
|
|
192
|
+
* Scan all messages for the last sourceCode a tool_use carried.
|
|
187
193
|
*
|
|
188
194
|
* Convenience wrapper for tests and one-shot extraction.
|
|
189
195
|
*/
|
|
@@ -282,6 +288,8 @@ interface CriteriaMeasurements {
|
|
|
282
288
|
* `null` when the probe ran and failed.
|
|
283
289
|
*/
|
|
284
290
|
readonly edge?: EdgeVerdict | null;
|
|
291
|
+
/** ggui#1711 — the capture includes a state after an action ran. Absent = no (every capture today). */
|
|
292
|
+
readonly postActionCapture?: boolean;
|
|
285
293
|
}
|
|
286
294
|
declare function resolveCriteriaBlock(args: {
|
|
287
295
|
readonly bank: CriteriaBank;
|
|
@@ -314,6 +322,8 @@ interface CriteriaJudgeInputs {
|
|
|
314
322
|
readonly frame?: CriteriaJudgeFrame;
|
|
315
323
|
/** JSON text of the props the card was rendered with; bounded by {@link CRITERIA_PROPS_MAX_CHARS}. */
|
|
316
324
|
readonly propsJson?: string;
|
|
325
|
+
/** ggui#1711 — the capture includes a post-action state; absent = no, and rows needing one are not asked. */
|
|
326
|
+
readonly postActionCapture?: boolean;
|
|
317
327
|
}
|
|
318
328
|
/** The judge's prompt block for the selected `judge` rows; empty when none is selected. */
|
|
319
329
|
declare function buildCriteriaJudgeBlock(bank: CriteriaBank, selected: CriteriaSelectionResult, inputs?: CriteriaJudgeInputs): string;
|
package/dist/evaluation/index.js
CHANGED
|
@@ -415,6 +415,13 @@ function buildCodingCriteriaSummary(designMode = "constrained") {
|
|
|
415
415
|
}
|
|
416
416
|
return lines.join("\n");
|
|
417
417
|
}
|
|
418
|
+
|
|
419
|
+
// src/adapters/claude/sdk-tool-pins.ts
|
|
420
|
+
function sdkToolPins(input) {
|
|
421
|
+
const builtins = [...input.builtinTools ?? []];
|
|
422
|
+
const approved = input.allowedTools !== void 0 ? [...input.allowedTools] : Object.keys(input.mcpServers ?? {}).map((name) => `mcp__${name}`);
|
|
423
|
+
return { tools: builtins, settingSources: [], allowedTools: [...approved, ...builtins] };
|
|
424
|
+
}
|
|
418
425
|
function createAnthropicClient(rawKey) {
|
|
419
426
|
if (rawKey === void 0) {
|
|
420
427
|
return new Anthropic({
|
|
@@ -2347,6 +2354,16 @@ function getDefaultEvalModel(provider) {
|
|
|
2347
2354
|
}
|
|
2348
2355
|
}
|
|
2349
2356
|
|
|
2357
|
+
// src/adapters/claude/source-capture.ts
|
|
2358
|
+
var COMPILE_TOOL_SUFFIX = "__compile_component";
|
|
2359
|
+
function sourceCodeFromToolUse(name, input) {
|
|
2360
|
+
if (typeof name !== "string") return void 0;
|
|
2361
|
+
const field2 = name === "Write" ? "content" : name.endsWith(COMPILE_TOOL_SUFFIX) ? "code" : void 0;
|
|
2362
|
+
if (field2 === void 0 || typeof input !== "object" || input === null) return void 0;
|
|
2363
|
+
const value = Reflect.get(input, field2);
|
|
2364
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2350
2367
|
// src/evaluation/message-parsing.ts
|
|
2351
2368
|
function extractToolResultTexts(message) {
|
|
2352
2369
|
if (message.type !== "user") return [];
|
|
@@ -2416,12 +2433,9 @@ function extractSourceCodeFromMessage(message) {
|
|
|
2416
2433
|
const content = betaMessage?.content;
|
|
2417
2434
|
if (!Array.isArray(content)) return void 0;
|
|
2418
2435
|
for (const block of content) {
|
|
2419
|
-
if (block.type
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
sourceCode = input.content;
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2436
|
+
if (block.type !== "tool_use") continue;
|
|
2437
|
+
const value = sourceCodeFromToolUse(block.name, block.input);
|
|
2438
|
+
if (value !== void 0) sourceCode = value;
|
|
2425
2439
|
}
|
|
2426
2440
|
return sourceCode;
|
|
2427
2441
|
}
|
|
@@ -2540,6 +2554,12 @@ async function runEvaluationLoop(options) {
|
|
|
2540
2554
|
let currentSourceCode = context.sourceCode;
|
|
2541
2555
|
let round2 = 0;
|
|
2542
2556
|
const maxRounds = Math.min(config.maxRounds ?? 3, MAX_EVAL_ROUNDS_HARD_LIMIT);
|
|
2557
|
+
const offersATool = Object.keys(generatorOptions?.mcpServers ?? {}).length > 0 || (generatorOptions?.builtinTools?.length ?? 0) > 0;
|
|
2558
|
+
if (maxRounds > 1 && !offersATool) {
|
|
2559
|
+
throw new Error(
|
|
2560
|
+
"runEvaluationLoop: a fix round needs a tool that can return code \u2014 pass generatorOptions.mcpServers (e.g. a server with compile_component) or opt into a built-in with generatorOptions.builtinTools (e.g. ['Write'])."
|
|
2561
|
+
);
|
|
2562
|
+
}
|
|
2543
2563
|
while (round2 < maxRounds) {
|
|
2544
2564
|
round2++;
|
|
2545
2565
|
onProgress?.({ type: "evaluating", round: round2 });
|
|
@@ -2579,12 +2599,15 @@ async function runEvaluationLoop(options) {
|
|
|
2579
2599
|
maxTurns: 15,
|
|
2580
2600
|
maxBudgetUsd: config.maxBudgetPerFix,
|
|
2581
2601
|
env,
|
|
2582
|
-
permissionMode: "bypassPermissions",
|
|
2583
|
-
allowDangerouslySkipPermissions: true,
|
|
2584
2602
|
...cliPath && { pathToClaudeCodeExecutable: cliPath },
|
|
2585
2603
|
...generatorOptions?.cwd && { cwd: generatorOptions.cwd },
|
|
2586
2604
|
...generatorOptions?.mcpServers && { mcpServers: generatorOptions.mcpServers },
|
|
2587
|
-
|
|
2605
|
+
// ggui#1714 — no CLI built-ins unless asked for, no host settings, no permission bypass.
|
|
2606
|
+
...sdkToolPins({
|
|
2607
|
+
mcpServers: generatorOptions?.mcpServers,
|
|
2608
|
+
allowedTools: generatorOptions?.allowedTools,
|
|
2609
|
+
builtinTools: generatorOptions?.builtinTools
|
|
2610
|
+
}),
|
|
2588
2611
|
...generatorOptions?.model && { model: generatorOptions.model },
|
|
2589
2612
|
...generatorOptions?.stderr && { stderr: generatorOptions.stderr }
|
|
2590
2613
|
}
|
|
@@ -4719,6 +4742,8 @@ var INSTRUMENT_BY_ID = {
|
|
|
4719
4742
|
var INSTRUMENT_BESIDE_JUDGE = {
|
|
4720
4743
|
"space.edge": "edge"
|
|
4721
4744
|
};
|
|
4745
|
+
var REQUIRES_POST_ACTION_CAPTURE = /* @__PURE__ */ new Set(["state.feedback"]);
|
|
4746
|
+
var NO_POST_ACTION = "not evaluated: no post-action capture";
|
|
4722
4747
|
function besideRead(kind, m) {
|
|
4723
4748
|
if (m.edge === void 0) return { verdict: "n/a", evidence: "not measured: this capture had no page to read" };
|
|
4724
4749
|
if (m.edge === null) return { verdict: "n/a", evidence: "edge probe failed on this capture" };
|
|
@@ -4744,6 +4769,7 @@ function instrumentRead(kind, m) {
|
|
|
4744
4769
|
return { verdict: "n/a", evidence: `fill ${m.inkRatio.toFixed(3)} reported; no floor ruled` };
|
|
4745
4770
|
}
|
|
4746
4771
|
function readRow(row, answers, m, unansweredReason) {
|
|
4772
|
+
if (row.evaluation === "judge" && REQUIRES_POST_ACTION_CAPTURE.has(row.id) && m.postActionCapture !== true) return { verdict: "n/a", evidence: NO_POST_ACTION };
|
|
4747
4773
|
if (row.evaluation === "judge") return majority(row.id, answers, unansweredReason);
|
|
4748
4774
|
if (row.evaluation === "human") return { verdict: "n/a", evidence: `reader's column (status ${row.status})` };
|
|
4749
4775
|
if (row.status !== "live") return { verdict: "n/a", evidence: `not implemented (status ${row.status})` };
|
|
@@ -4803,7 +4829,7 @@ ${text}
|
|
|
4803
4829
|
}
|
|
4804
4830
|
function buildCriteriaJudgeBlock(bank, selected, inputs = {}) {
|
|
4805
4831
|
const byId = new Map(bankRows(bank).map((r) => [r.id, r]));
|
|
4806
|
-
const asked = selected.selection.map((s) => byId.get(s.id)).filter((r) => r !== void 0 && r.evaluation === "judge");
|
|
4832
|
+
const asked = selected.selection.map((s) => byId.get(s.id)).filter((r) => r !== void 0 && r.evaluation === "judge").filter((r) => inputs.postActionCapture === true || !REQUIRES_POST_ACTION_CAPTURE.has(r.id));
|
|
4807
4833
|
if (asked.length === 0) return "";
|
|
4808
4834
|
const lines = asked.map((r) => `- ${r.id} (${r.severity}): ${r.text} Evidence must name: ${r.evidence}`);
|
|
4809
4835
|
return "## Criteria \u2014 answer each one from the FRAME only\nRead these off the screenshot. Never infer them from the request, the styling profile or any direction text above.\n" + (inputs.frame !== void 0 ? `${criteriaFrameLine(inputs.frame)}
|