@ggui-ai/ui-gen 0.21.0 → 0.22.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/adapters/generation-dispatch.d.ts +1 -1
- package/dist/adapters/generation-dispatch.js +198 -59
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +35 -10
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +381 -58
- package/dist/advanced/index.js.map +1 -1
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +1 -1
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-D7kOXNjJ.d.ts → create-ui-generator-BEkzEtNz.d.ts} +1 -1
- package/dist/{dispatch-DGvhmARp.d.ts → dispatch-DJNpQ7DI.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 +3 -3
- package/dist/evaluation/index.js +37 -20
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +34 -9
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js +1 -1
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +15 -2
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +1 -1
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +22 -6
- package/dist/index.js +381 -58
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +1 -1
- package/dist/{types-public-CzYqZclY.d.ts → types-public-mM_-1Yk3.d.ts} +16 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +12 -12
- package/src/adapters/claude/claude-code-login.ts +62 -7
- package/src/adapters/claude/sdk.ts +6 -5
- package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +7 -3
- package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +7 -3
- package/src/contract-context.ts +1 -1
- package/src/create-ui-generator.ts +30 -0
- package/src/evaluation/index.ts +1 -0
- package/src/evaluation/llm-evaluator.ts +40 -13
- package/src/evaluation/types-public.ts +16 -0
- package/src/evaluation/visual-evaluator.ts +9 -6
- package/src/generator-build.ts +158 -0
- package/src/harness/claude-code-login-query.ts +5 -4
- package/src/harness/coding/assemble-result.ts +8 -1
- package/src/harness/coding/generate-task-runner.ts +75 -36
- package/src/harness/coding/run-coding-turn.ts +9 -0
- package/src/harness/coding/run-eval-round.ts +160 -5
- package/src/harness/result-types.ts +14 -0
- package/src/index.ts +2 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as CanvasJudgeRecord, E as EvalIssue, V as VisualEvalSummary, d as VisualCoverage } from '../types-public-
|
|
2
|
-
export { A as AxisCheck, a as AxisCheckInput, e as CRITERIA, f as CanvasVisualSummary, g as
|
|
1
|
+
import { C as CanvasJudgeRecord, E as EvalIssue, V as VisualEvalSummary, d as VisualCoverage } from '../types-public-mM_-1Yk3.js';
|
|
2
|
+
export { A as AxisCheck, a as AxisCheckInput, e as CRITERIA, f as CanvasVisualSummary, g as ContractFeedbackRecord, h as CriterionCoverage, i as CriterionRunStatus, D as DEFAULT_QUALITY_CONFIG, j as EvalCategory, k as EvalCriterion, l as EvalOutcome, b as EvalResult, c as EvalTier, L as LLM_EVAL_STATIC_CRITERIA, P as Priority, Q as QualityConfig, n as QualityMode, o as buildCodingCriteriaSummary, p as criteriaFor, q as getActionableIssues, r as getCriteriaByPriority, s as getCriterionById, t as getLLMCriteria, u as isBlocked, m as matches, v as notApplicableCoverage, w as priorityForIssue } from '../types-public-mM_-1Yk3.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 } 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-
|
|
7
|
+
export { R as RunAxisChecksInput, r as runAxisChecks } from '../dispatch-DJNpQ7DI.js';
|
|
8
8
|
import { A as AgentConfig, L as LLMResponse } from '../llm-router-DwwUK1bz.js';
|
|
9
9
|
import { G as GenerationProfileInput } from '../styling-profile-CxfvV48g.js';
|
|
10
10
|
import { LaunchOptions } from 'puppeteer-core';
|
package/dist/evaluation/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { LUCIDE_ICON_NAMES, maxWidth } from '@ggui-ai/design';
|
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { build } from 'esbuild';
|
|
8
8
|
import { getCssTokens, composeThemeCss, fillFitRule } from '@ggui-ai/design/rendering';
|
|
9
|
-
import { readFileSync, readdirSync, statSync,
|
|
9
|
+
import { readFileSync, readdirSync, statSync, mkdtempSync, writeFileSync, rmSync, existsSync } from 'fs';
|
|
10
10
|
import { resolve, relative, dirname } from 'path';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
import { createRequire } from 'module';
|
|
@@ -427,17 +427,42 @@ function createAnthropicClient(rawKey) {
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
// src/adapters/claude/claude-code-login.ts
|
|
430
|
-
var
|
|
431
|
-
"
|
|
432
|
-
"
|
|
433
|
-
"
|
|
434
|
-
"
|
|
430
|
+
var LOGIN_CHILD_ENV_NAMES = [
|
|
431
|
+
"PATH",
|
|
432
|
+
"HOME",
|
|
433
|
+
"USER",
|
|
434
|
+
"LOGNAME",
|
|
435
|
+
"SHELL",
|
|
436
|
+
"TMPDIR",
|
|
437
|
+
"TMP",
|
|
438
|
+
"TEMP",
|
|
439
|
+
"TERM",
|
|
440
|
+
"TZ",
|
|
441
|
+
"LANG",
|
|
442
|
+
"CLAUDE_CONFIG_DIR",
|
|
443
|
+
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
444
|
+
"XDG_CONFIG_HOME",
|
|
445
|
+
"XDG_DATA_HOME",
|
|
446
|
+
"XDG_CACHE_HOME",
|
|
447
|
+
"XDG_STATE_HOME",
|
|
448
|
+
"XDG_RUNTIME_DIR",
|
|
449
|
+
"HTTPS_PROXY",
|
|
450
|
+
"https_proxy",
|
|
451
|
+
"HTTP_PROXY",
|
|
452
|
+
"http_proxy",
|
|
453
|
+
"NO_PROXY",
|
|
454
|
+
"no_proxy",
|
|
455
|
+
"ALL_PROXY",
|
|
456
|
+
"all_proxy",
|
|
457
|
+
"NODE_EXTRA_CA_CERTS",
|
|
458
|
+
"SSL_CERT_FILE",
|
|
459
|
+
"SSL_CERT_DIR"
|
|
435
460
|
];
|
|
436
|
-
|
|
461
|
+
var LOGIN_CHILD_ENV = new Set(LOGIN_CHILD_ENV_NAMES);
|
|
462
|
+
function loginChildEnv(env) {
|
|
437
463
|
const out = {};
|
|
438
|
-
const drop = new Set(PROVIDER_KEY_ENV_NAMES);
|
|
439
464
|
for (const [k, v] of Object.entries(env)) {
|
|
440
|
-
if (v !== void 0 &&
|
|
465
|
+
if (v !== void 0 && (LOGIN_CHILD_ENV.has(k) || k.startsWith("LC_"))) out[k] = v;
|
|
441
466
|
}
|
|
442
467
|
return out;
|
|
443
468
|
}
|
|
@@ -585,7 +610,7 @@ function buildLoginQueryOptions(params) {
|
|
|
585
610
|
systemPrompt: params.systemPrompt,
|
|
586
611
|
maxTurns: 1,
|
|
587
612
|
thinking: { type: "disabled" },
|
|
588
|
-
env:
|
|
613
|
+
env: loginChildEnv(params.env ?? process.env),
|
|
589
614
|
...claudeCodeLoginQueryOptions(),
|
|
590
615
|
...params.tools !== void 0 ? {
|
|
591
616
|
mcpServers: { [MCP_SERVER_NAME]: params.tools.server },
|
|
@@ -4573,8 +4598,7 @@ function resolveDesignPackageDir() {
|
|
|
4573
4598
|
}
|
|
4574
4599
|
}
|
|
4575
4600
|
async function bundleForRendering(compiledCode, sampleProps, designSrc = resolve(resolveDesignPackageDir(), "src")) {
|
|
4576
|
-
const tmpDir = resolve(tmpdir(), "ggui-visual-eval-"
|
|
4577
|
-
mkdirSync(tmpDir, { recursive: true });
|
|
4601
|
+
const tmpDir = mkdtempSync(resolve(tmpdir(), "ggui-visual-eval-"));
|
|
4578
4602
|
const componentFile = resolve(tmpDir, "component.tsx");
|
|
4579
4603
|
const entryFile = resolve(tmpDir, "entry.tsx");
|
|
4580
4604
|
const designPkgDir = resolve(designSrc, "..");
|
|
@@ -4649,14 +4673,7 @@ try {
|
|
|
4649
4673
|
});
|
|
4650
4674
|
return result.outputFiles[0]?.text ?? "";
|
|
4651
4675
|
} finally {
|
|
4652
|
-
|
|
4653
|
-
unlinkSync(entryFile);
|
|
4654
|
-
} catch {
|
|
4655
|
-
}
|
|
4656
|
-
try {
|
|
4657
|
-
unlinkSync(componentFile);
|
|
4658
|
-
} catch {
|
|
4659
|
-
}
|
|
4676
|
+
rmSync(tmpDir, { recursive: true, force: true });
|
|
4660
4677
|
}
|
|
4661
4678
|
}
|
|
4662
4679
|
function buildRenderHTML(bundledCode, cssTokens, fit) {
|