@ggui-ai/ui-gen 0.22.0 → 0.23.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 +55 -17
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +3 -3
- package/dist/advanced/index.js +66 -18
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +37 -7
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +1 -0
- 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-BEkzEtNz.d.ts → create-ui-generator-D0kbWwln.d.ts} +1 -1
- package/dist/{dispatch-DJNpQ7DI.d.ts → dispatch-wxaIMwZt.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +3 -3
- package/dist/evaluation/axis-checks/index.js +19 -4
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +1 -1
- package/dist/evaluation/axis-checks/registry.js +19 -4
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +3 -3
- package/dist/evaluation/index.js +21 -6
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +4 -4
- package/dist/harness/check/runtime-render/index.js +26 -6
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +3 -2
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/result-types.d.ts +1 -1
- package/dist/harness/runtime.d.ts +1 -1
- package/dist/harness/runtime.js +2 -1
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +9 -5
- package/dist/harness/types-public.js +1 -0
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +55 -17
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +1 -1
- package/dist/{render-check-C0CqVceF.d.ts → render-check-Blwj8gB6.d.ts} +18 -0
- package/dist/tools/get-primitives-ts.d.ts +1 -1
- package/dist/tools/get-primitives-ts.js +1 -1
- package/dist/tools/get-primitives-ts.js.map +1 -1
- package/dist/{types-public-mM_-1Yk3.d.ts → types-public-Ow-tNtFE.d.ts} +26 -3
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +12 -12
- package/src/advanced/generator.ts +16 -1
- package/src/blueprint-validator.ts +21 -6
- package/src/boilerplate/hard-sections.ts +1 -0
- package/src/coding-agent/tools.ts +6 -1
- package/src/evaluation/axis-checks/checks/state-payload.ts +29 -4
- package/src/evaluation/types-public.ts +26 -2
- package/src/harness/check/runtime-render/adapter.ts +19 -0
- package/src/harness/check/runtime-render/render-check-host.ts +31 -9
- package/src/harness/check/runtime-render/render-check.ts +19 -0
- package/src/harness/coding/run-eval-round.ts +2 -0
- package/src/harness/llm-router.ts +3 -3
- package/src/harness/types-public.ts +9 -5
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/validation/primitives.ts +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'fs';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
+
import { loadavg, availableParallelism } from 'os';
|
|
3
4
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
5
|
import { runSandboxed } from '@ggui-ai/sandbox';
|
|
5
6
|
import { listContractGadgets, HOOK_NAME_RE } from '@ggui-ai/protocol';
|
|
@@ -72,10 +73,12 @@ function unverified(reason, t0) {
|
|
|
72
73
|
}
|
|
73
74
|
function mapSandboxResultToCheckResult(result, t0) {
|
|
74
75
|
if (result.outcome === "timeout") {
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
return {
|
|
77
|
+
ok: false,
|
|
78
|
+
issues: [],
|
|
79
|
+
incomplete: { kind: "timeout", elapsedMs: result.durationMs, boundMs: CHECK_TIMEOUT_MS },
|
|
80
|
+
stats: { actionsChecked: 0, streamsChecked: 0, renderMs: Date.now() - t0 }
|
|
81
|
+
};
|
|
79
82
|
}
|
|
80
83
|
if (result.outcome === "overflow-stdout" || result.outcome === "overflow-stderr") {
|
|
81
84
|
return failed(
|
|
@@ -126,6 +129,7 @@ async function runRenderCheckViaWorker(input) {
|
|
|
126
129
|
} catch (err) {
|
|
127
130
|
return unverified(err instanceof Error ? err.message : String(err), t0);
|
|
128
131
|
}
|
|
132
|
+
const loadAtStart = loadavg()[0] ?? 0;
|
|
129
133
|
const result = await runSandboxed({
|
|
130
134
|
command: spawn.command,
|
|
131
135
|
args: spawn.args,
|
|
@@ -138,7 +142,13 @@ async function runRenderCheckViaWorker(input) {
|
|
|
138
142
|
// default allowlist.
|
|
139
143
|
env: { NODE_ENV: process.env.NODE_ENV ?? "production" }
|
|
140
144
|
});
|
|
141
|
-
|
|
145
|
+
const hostLoad = {
|
|
146
|
+
start: loadAtStart,
|
|
147
|
+
end: loadavg()[0] ?? 0,
|
|
148
|
+
cores: availableParallelism()
|
|
149
|
+
};
|
|
150
|
+
const mapped = mapSandboxResultToCheckResult(result, t0);
|
|
151
|
+
return { ...mapped, stats: { ...mapped.stats, hostLoad } };
|
|
142
152
|
}
|
|
143
153
|
var CHECK_TIMEOUT_MS, CHECK_STDOUT_CAP, CHECK_NODE_HEAP_MB, WORKER_BASENAME;
|
|
144
154
|
var init_render_check_host = __esm({
|
|
@@ -1733,9 +1743,19 @@ var DEFAULT_RUNTIME_RENDER_CHECK = {
|
|
|
1733
1743
|
);
|
|
1734
1744
|
return { status: "infra-skipped", issues: [], reason: message };
|
|
1735
1745
|
}
|
|
1746
|
+
const hostLoad = result.stats.hostLoad;
|
|
1747
|
+
const load = hostLoad !== void 0 ? { hostLoad } : {};
|
|
1748
|
+
if (result.incomplete !== void 0) {
|
|
1749
|
+
const { elapsedMs, boundMs } = result.incomplete;
|
|
1750
|
+
const loadNote = hostLoad !== void 0 ? `; host load ${hostLoad.start.toFixed(1)} \u2192 ${hostLoad.end.toFixed(1)} on ${hostLoad.cores} CPUs` : "";
|
|
1751
|
+
const reason = `render check did not finish within ${boundMs} ms (stopped at ${elapsedMs} ms)${loadNote}`;
|
|
1752
|
+
console.warn(`[runtime-render] probe timed out \u2014 ${reason}`);
|
|
1753
|
+
return { status: "timed-out", issues: [], reason, elapsedMs, ...load };
|
|
1754
|
+
}
|
|
1736
1755
|
return {
|
|
1737
1756
|
status: "ran",
|
|
1738
|
-
issues: result.issues.map(toEvalIssue).filter((x) => x !== null)
|
|
1757
|
+
issues: result.issues.map(toEvalIssue).filter((x) => x !== null),
|
|
1758
|
+
...load
|
|
1739
1759
|
};
|
|
1740
1760
|
}
|
|
1741
1761
|
};
|
|
@@ -1863,6 +1883,16 @@ function toEvalIssue(issue) {
|
|
|
1863
1883
|
}
|
|
1864
1884
|
|
|
1865
1885
|
// src/blueprint-validator.ts
|
|
1886
|
+
function probeDidNotRunCode(status) {
|
|
1887
|
+
switch (status) {
|
|
1888
|
+
case "infra-skipped":
|
|
1889
|
+
return "runtime:probe-infra-failure";
|
|
1890
|
+
case "not-applicable":
|
|
1891
|
+
return "runtime:probe-not-applicable";
|
|
1892
|
+
case "timed-out":
|
|
1893
|
+
return "runtime:probe-timeout";
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1866
1896
|
function asContract(x) {
|
|
1867
1897
|
if (typeof x !== "object" || x === null) return void 0;
|
|
1868
1898
|
return x;
|
|
@@ -1972,7 +2002,7 @@ async function runtimeTier(input) {
|
|
|
1972
2002
|
warnings.push({
|
|
1973
2003
|
_kind: "warning",
|
|
1974
2004
|
tier: "runtime",
|
|
1975
|
-
code: outcome.status
|
|
2005
|
+
code: probeDidNotRunCode(outcome.status),
|
|
1976
2006
|
message: `Runtime probe did not run (${outcome.status}): ${outcome.reason ?? "no reason recorded"}`
|
|
1977
2007
|
});
|
|
1978
2008
|
return { errors, warnings };
|