@ggui-ai/ui-gen 0.28.0 → 0.29.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-h4_V69LI.d.ts → adapter-DLQ-5COm.d.ts} +1 -1
- package/dist/adapters/base.js +2 -27
- package/dist/adapters/base.js.map +1 -1
- package/dist/adapters/generation-dispatch.d.ts +14 -6
- package/dist/adapters/generation-dispatch.js +40 -19260
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +25 -3561
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/types.js +2 -9
- package/dist/adapters/types.js.map +1 -1
- package/dist/advanced/index.d.ts +13 -12
- package/dist/advanced/index.js +63 -21954
- package/dist/advanced/index.js.map +1 -1
- package/dist/{bank-Ctdp3FUA.d.ts → bank-LWaiAtaA.d.ts} +1 -1
- package/dist/blueprint-validator.js +6 -2301
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.d.ts +3 -2
- package/dist/boilerplate.js +6 -1867
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +3 -2
- package/dist/check/index.js +6 -1923
- package/dist/check/index.js.map +1 -1
- package/dist/chunk-33B3BAWS.js +24 -0
- package/dist/chunk-33B3BAWS.js.map +1 -0
- package/dist/chunk-3HSGA6NI.js +591 -0
- package/dist/chunk-3HSGA6NI.js.map +1 -0
- package/dist/chunk-3NNNGNTO.js +1707 -0
- package/dist/chunk-3NNNGNTO.js.map +1 -0
- package/dist/chunk-3T2HMTON.js +79 -0
- package/dist/chunk-3T2HMTON.js.map +1 -0
- package/dist/chunk-3ZSSDV3L.js +123 -0
- package/dist/chunk-3ZSSDV3L.js.map +1 -0
- package/dist/chunk-4MBR5GA3.js +99 -0
- package/dist/chunk-4MBR5GA3.js.map +1 -0
- package/dist/chunk-56NJFD55.js +337 -0
- package/dist/chunk-56NJFD55.js.map +1 -0
- package/dist/chunk-5AGTY555.js +26 -0
- package/dist/chunk-5AGTY555.js.map +1 -0
- package/dist/chunk-5EJM7EGY.js +115 -0
- package/dist/chunk-5EJM7EGY.js.map +1 -0
- package/dist/chunk-5KXCQLLR.js +529 -0
- package/dist/chunk-5KXCQLLR.js.map +1 -0
- package/dist/chunk-5VBXHVEH.js +171 -0
- package/dist/chunk-5VBXHVEH.js.map +1 -0
- package/dist/chunk-6KDDEING.js +515 -0
- package/dist/chunk-6KDDEING.js.map +1 -0
- package/dist/chunk-6VDRWAP6.js +123 -0
- package/dist/chunk-6VDRWAP6.js.map +1 -0
- package/dist/chunk-732IBFEJ.js +2400 -0
- package/dist/chunk-732IBFEJ.js.map +1 -0
- package/dist/chunk-73AURS3I.js +46 -0
- package/dist/chunk-73AURS3I.js.map +1 -0
- package/dist/chunk-77H5SKLX.js +8 -0
- package/dist/chunk-77H5SKLX.js.map +1 -0
- package/dist/chunk-7QE3AHLE.js +35 -0
- package/dist/chunk-7QE3AHLE.js.map +1 -0
- package/dist/chunk-A375NNWN.js +11 -0
- package/dist/chunk-A375NNWN.js.map +1 -0
- package/dist/chunk-AOU33EFS.js +140 -0
- package/dist/chunk-AOU33EFS.js.map +1 -0
- package/dist/chunk-BA4QYA6E.js +461 -0
- package/dist/chunk-BA4QYA6E.js.map +1 -0
- package/dist/chunk-DBP764GL.js +3 -0
- package/dist/chunk-DBP764GL.js.map +1 -0
- package/dist/chunk-DUU3ZJDQ.js +41 -0
- package/dist/chunk-DUU3ZJDQ.js.map +1 -0
- package/dist/chunk-DXKRBXNU.js +30 -0
- package/dist/chunk-DXKRBXNU.js.map +1 -0
- package/dist/chunk-FB7OEEAH.js +1467 -0
- package/dist/chunk-FB7OEEAH.js.map +1 -0
- package/dist/chunk-FLRNMZV2.js +18 -0
- package/dist/chunk-FLRNMZV2.js.map +1 -0
- package/dist/chunk-FWJIMKFZ.js +2032 -0
- package/dist/chunk-FWJIMKFZ.js.map +1 -0
- package/dist/chunk-FXRHWYIQ.js +163 -0
- package/dist/chunk-FXRHWYIQ.js.map +1 -0
- package/dist/chunk-G3PMV62Z.js +33 -0
- package/dist/chunk-G3PMV62Z.js.map +1 -0
- package/dist/chunk-GAJI7Y3P.js +13 -0
- package/dist/chunk-GAJI7Y3P.js.map +1 -0
- package/dist/chunk-GYINWMPR.js +2052 -0
- package/dist/chunk-GYINWMPR.js.map +1 -0
- package/dist/chunk-HD6ABIK7.js +484 -0
- package/dist/chunk-HD6ABIK7.js.map +1 -0
- package/dist/chunk-HDQVHYO6.js +100 -0
- package/dist/chunk-HDQVHYO6.js.map +1 -0
- package/dist/chunk-IHUT3SIW.js +7 -0
- package/dist/chunk-IHUT3SIW.js.map +1 -0
- package/dist/chunk-JDH5EGNZ.js +126 -0
- package/dist/chunk-JDH5EGNZ.js.map +1 -0
- package/dist/chunk-JMD4RGSV.js +37 -0
- package/dist/chunk-JMD4RGSV.js.map +1 -0
- package/dist/chunk-KJWGZL5B.js +33 -0
- package/dist/chunk-KJWGZL5B.js.map +1 -0
- package/dist/chunk-MKMDQFZ7.js +86 -0
- package/dist/chunk-MKMDQFZ7.js.map +1 -0
- package/dist/chunk-NF6JUZWF.js +85 -0
- package/dist/chunk-NF6JUZWF.js.map +1 -0
- package/dist/chunk-O2YC6XDC.js +1933 -0
- package/dist/chunk-O2YC6XDC.js.map +1 -0
- package/dist/chunk-OVLH5ICV.js +29 -0
- package/dist/chunk-OVLH5ICV.js.map +1 -0
- package/dist/chunk-PBOYHGSD.js +106 -0
- package/dist/chunk-PBOYHGSD.js.map +1 -0
- package/dist/chunk-PJFH7QWA.js +81 -0
- package/dist/chunk-PJFH7QWA.js.map +1 -0
- package/dist/chunk-PUH4CXGZ.js +284 -0
- package/dist/chunk-PUH4CXGZ.js.map +1 -0
- package/dist/chunk-QLXXPGTV.js +18 -0
- package/dist/chunk-QLXXPGTV.js.map +1 -0
- package/dist/chunk-R5GIGPW2.js +2845 -0
- package/dist/chunk-R5GIGPW2.js.map +1 -0
- package/dist/chunk-RH4IUSTO.js +83 -0
- package/dist/chunk-RH4IUSTO.js.map +1 -0
- package/dist/chunk-S2GVXKKY.js +153 -0
- package/dist/chunk-S2GVXKKY.js.map +1 -0
- package/dist/chunk-TVHGKFJS.js +58 -0
- package/dist/chunk-TVHGKFJS.js.map +1 -0
- package/dist/chunk-U7GALWLG.js +66 -0
- package/dist/chunk-U7GALWLG.js.map +1 -0
- package/dist/chunk-VTC263LT.js +256 -0
- package/dist/chunk-VTC263LT.js.map +1 -0
- package/dist/chunk-WEOXFEVE.js +739 -0
- package/dist/chunk-WEOXFEVE.js.map +1 -0
- package/dist/chunk-WYHP46LT.js +28 -0
- package/dist/chunk-WYHP46LT.js.map +1 -0
- package/dist/chunk-XGLO5LGG.js +274 -0
- package/dist/chunk-XGLO5LGG.js.map +1 -0
- package/dist/chunk-XRBCRKA2.js +29 -0
- package/dist/chunk-XRBCRKA2.js.map +1 -0
- package/dist/chunk-XW7ADFFV.js +340 -0
- package/dist/chunk-XW7ADFFV.js.map +1 -0
- package/dist/chunk-YIQ42IUX.js +34 -0
- package/dist/chunk-YIQ42IUX.js.map +1 -0
- package/dist/chunk-YJZTUY7B.js +101 -0
- package/dist/chunk-YJZTUY7B.js.map +1 -0
- package/dist/chunk-Z3CXME3K.js +107 -0
- package/dist/chunk-Z3CXME3K.js.map +1 -0
- package/dist/classifier/index.js +2 -527
- package/dist/classifier/index.js.map +1 -1
- package/dist/client-JBPCXU7W.js +4 -0
- package/dist/client-JBPCXU7W.js.map +1 -0
- package/dist/compose.js +3 -367
- package/dist/compose.js.map +1 -1
- package/dist/cost-tracker-HHGQ4FTW.js +67 -0
- package/dist/cost-tracker-HHGQ4FTW.js.map +1 -0
- package/dist/{create-ui-generator-BrZHF0cf.d.ts → create-ui-generator-BY-WeaPi.d.ts} +3 -3
- package/dist/{design-mode-DGWN_Gkm.d.ts → design-mode-XyOQmzE0.d.ts} +4 -3
- package/dist/{dispatch-B07TI30d.d.ts → dispatch-8LzTddKw.d.ts} +3 -2
- package/dist/dist-UALN6ZVB.js +543 -0
- package/dist/dist-UALN6ZVB.js.map +1 -0
- package/dist/dupe-break-X6K7QFIS.js +4 -0
- package/dist/dupe-break-X6K7QFIS.js.map +1 -0
- package/dist/evaluation/axis-checks/index.d.ts +5 -4
- package/dist/evaluation/axis-checks/index.js +6 -1914
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +3 -2
- package/dist/evaluation/axis-checks/registry.js +3 -1844
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +49 -132
- package/dist/evaluation/index.js +302 -6466
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +3 -2
- package/dist/evaluation/types.js +2 -5
- package/dist/evaluation/types.js.map +1 -1
- package/dist/fragments/index.js +2 -338
- package/dist/fragments/index.js.map +1 -1
- package/dist/{generate-tSO_shQ0.d.ts → generate-DQ4ci90s.d.ts} +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +35 -15
- package/dist/harness/check/runtime-render/index.js +6 -2390
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.js +4 -1739
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.d.ts +3 -2
- package/dist/harness/index.js +23 -5126
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/llm-trace-sink.js +2 -24
- package/dist/harness/llm-trace-sink.js.map +1 -1
- package/dist/harness/prompts.d.ts +2 -2
- package/dist/harness/prompts.js +8 -324
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +6 -5
- package/dist/harness/result-types.js +2 -0
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +22 -5
- package/dist/harness/runtime.js +10 -2313
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +3 -2
- package/dist/harness/types-public.js +16 -2954
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +3 -2
- package/dist/harness/validator-trace-sink.js +2 -26
- package/dist/harness/validator-trace-sink.js.map +1 -1
- package/dist/hash.js +2 -39
- package/dist/hash.js.map +1 -1
- package/dist/hashline-5OKREIRM.js +4 -0
- package/dist/hashline-5OKREIRM.js.map +1 -0
- package/dist/index.d.ts +50 -11
- package/dist/index.js +57 -22015
- package/dist/index.js.map +1 -1
- package/dist/llm-evaluator-PN3WFCS4.js +653 -0
- package/dist/llm-evaluator-PN3WFCS4.js.map +1 -0
- package/dist/magic-string.es-2NZTC4GZ.js +1307 -0
- package/dist/magic-string.es-2NZTC4GZ.js.map +1 -0
- package/dist/patch.d.ts +3 -2
- package/dist/patch.js +2 -56
- package/dist/patch.js.map +1 -1
- package/dist/policy-VCYKGSAC.js +5 -0
- package/dist/policy-VCYKGSAC.js.map +1 -0
- package/dist/policy.js +2 -35
- package/dist/policy.js.map +1 -1
- package/dist/primitive-index-2OF6F4TZ.js +131 -0
- package/dist/primitive-index-2OF6F4TZ.js.map +1 -0
- package/dist/primitive-slice-WTMBLYFJ.js +235 -0
- package/dist/primitive-slice-WTMBLYFJ.js.map +1 -0
- package/dist/{prompts-BhNUuRoZ.d.ts → prompts-CLZGywMP.d.ts} +1 -1
- package/dist/provider-adapter-contract.js +10407 -14204
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/provider-adapter.js +2 -44
- package/dist/provider-adapter.js.map +1 -1
- package/dist/providers/index.d.ts +89 -1
- package/dist/providers/index.js +115 -44
- package/dist/providers/index.js.map +1 -1
- package/dist/raw-C6KBH5I3.js +141 -0
- package/dist/raw-C6KBH5I3.js.map +1 -0
- package/dist/raw-FXSBXQTZ.js +7 -0
- package/dist/raw-FXSBXQTZ.js.map +1 -0
- package/dist/raw-MURDUPGK.js +8 -0
- package/dist/raw-MURDUPGK.js.map +1 -0
- package/dist/raw-T3GW3UVX.js +8 -0
- package/dist/raw-T3GW3UVX.js.map +1 -0
- package/dist/render-check-host-ZNIS6BJ5.js +5 -0
- package/dist/render-check-host-ZNIS6BJ5.js.map +1 -0
- package/dist/sdk-4JNSDNSR.js +6 -0
- package/dist/sdk-4JNSDNSR.js.map +1 -0
- package/dist/sdk-DIVJMHCX.js +7 -0
- package/dist/sdk-DIVJMHCX.js.map +1 -0
- package/dist/sdk-QRJOCRTS.js +7 -0
- package/dist/sdk-QRJOCRTS.js.map +1 -0
- package/dist/tag-balance-CTHCTRJ7.js +123 -0
- package/dist/tag-balance-CTHCTRJ7.js.map +1 -0
- package/dist/tools/get-primitives-ts.d.ts +1 -1
- package/dist/tools/get-primitives-ts.js +3 -1
- package/dist/tools/get-primitives-ts.js.map +1 -1
- package/dist/tools/render-check-worker.js +3 -40
- package/dist/tools/render-check-worker.js.map +1 -1
- package/dist/{types-public-h8IMnYuh.d.ts → types-public-hYlrerZh.d.ts} +35 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +3 -498
- package/dist/validation/index.js.map +1 -1
- package/dist/{visual-evaluator-C2strxqD.d.ts → visual-evaluator-KskajxD5.d.ts} +14 -4
- package/dist/visual-evaluator-TGEXYQTP.js +12 -0
- package/dist/visual-evaluator-TGEXYQTP.js.map +1 -0
- package/dist/workflows.d.ts +3 -2
- package/dist/workflows.js +2 -151
- package/dist/workflows.js.map +1 -1
- package/package.json +20 -16
- package/src/adapters/claude/sdk.ts +4 -2
- package/src/adapters/claude/tool-bridge.ts +2 -1
- package/src/adapters/generation-dispatch.ts +9 -0
- package/src/adapters/openai/raw.ts +4 -0
- package/src/adapters/openai/sdk.ts +6 -1
- package/src/adapters/openai/tokens.ts +21 -7
- package/src/adapters/tool-bridge.ts +1 -1
- package/src/adapters/tools.ts +1 -1
- package/src/advanced/feedback.ts +1 -2
- package/src/advanced/generator.ts +4 -3
- package/src/boilerplate/free-design-prompt.ts +7 -0
- package/src/boilerplate/generate.ts +18 -5
- package/src/boilerplate/hard-sections.ts +8 -3
- package/src/boilerplate/react-hooks.ts +56 -0
- package/src/boilerplate/system-prompt.ts +12 -3
- package/src/check/run-tier0.ts +233 -8
- package/src/check/type-checker.ts +128 -16
- package/src/coding-agent/tools.ts +26 -3
- package/src/design-mode.ts +4 -9
- package/src/evaluation/axis-checks/checks/state-merge.ts +2 -4
- package/src/evaluation/axis-checks/checks/state-payload.ts +1 -28
- package/src/evaluation/axis-checks/checks/tint.ts +197 -0
- package/src/evaluation/axis-checks/helpers.ts +121 -0
- package/src/evaluation/axis-checks/registry.ts +2 -0
- package/src/evaluation/criteria/__fixtures__/edge-v2-draw2.json +4629 -0
- package/src/evaluation/criteria/bank.ts +1 -1
- package/src/evaluation/criteria/edge-instruments.ts +14 -0
- package/src/evaluation/criteria/edge-probe-v2.ts +352 -0
- package/src/evaluation/criteria/edge-v2.ts +242 -0
- package/src/evaluation/criteria/resolve.ts +24 -5
- package/src/evaluation/index.ts +3 -5
- package/src/evaluation/mcp-server.ts +0 -50
- package/src/evaluation/types-public.ts +6 -1
- package/src/evaluation/visual-evaluator.ts +161 -30
- package/src/harness/check/runtime-render/index.ts +28 -4
- package/src/harness/check/runtime-render/render-check.ts +20 -21
- package/src/harness/claude-agent-sdk-loader.ts +93 -0
- package/src/harness/claude-code-login-query.ts +1 -1
- package/src/harness/coding/generate-task-runner.ts +1 -0
- package/src/harness/coding/run-coding-turn.ts +3 -0
- package/src/harness/coding/run-eval-round.ts +9 -0
- package/src/harness/llm-router.ts +50 -2
- package/src/harness/runtime.ts +17 -0
- package/src/index.ts +9 -0
- package/src/providers/anthropic-tool-call.ts +263 -0
- package/src/providers/index.ts +13 -0
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools/render-check.ts +4 -4
- package/src/validation/primitives.ts +2 -1
- package/src/evaluation/loop.ts +0 -218
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function setLlmTraceSink(sink) {
|
|
4
|
-
activeSink = sink;
|
|
5
|
-
}
|
|
6
|
-
function getLlmTraceSink() {
|
|
7
|
-
return activeSink;
|
|
8
|
-
}
|
|
9
|
-
function emitLlmTraceEvent(event) {
|
|
10
|
-
const sink = activeSink;
|
|
11
|
-
if (!sink) return;
|
|
12
|
-
try {
|
|
13
|
-
sink.emit(event);
|
|
14
|
-
} catch {
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function summarizeTools(tools) {
|
|
18
|
-
return tools.map((t) => ({ name: t.name, description: t.description }));
|
|
19
|
-
}
|
|
20
|
-
function newLlmTraceId() {
|
|
21
|
-
return Date.now().toString(36) + Math.random().toString(36).slice(2, 10);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { emitLlmTraceEvent, getLlmTraceSink, newLlmTraceId, setLlmTraceSink, summarizeTools };
|
|
1
|
+
export { emitLlmTraceEvent, getLlmTraceSink, newLlmTraceId, setLlmTraceSink, summarizeTools } from '../chunk-5AGTY555.js';
|
|
2
|
+
import '../chunk-G3PMV62Z.js';
|
|
25
3
|
//# sourceMappingURL=llm-trace-sink.js.map
|
|
26
4
|
//# sourceMappingURL=llm-trace-sink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"llm-trace-sink.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { R as RenderingContext, b as buildContractsContext, a as buildRenderingContext, i as injectContracts, e as injectRenderingContext } from '../prompts-
|
|
1
|
+
export { R as RenderingContext, b as buildContractsContext, a as buildRenderingContext, i as injectContracts, e as injectRenderingContext } from '../prompts-CLZGywMP.js';
|
|
2
2
|
import '@ggui-ai/protocol';
|
|
3
|
-
import '
|
|
3
|
+
import '@ggui-ai/design/rendering';
|
package/dist/harness/prompts.js
CHANGED
|
@@ -1,326 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// src/boilerplate/json-schema-ts.ts
|
|
10
|
-
function jsonSchemaTypeToTs(schema) {
|
|
11
|
-
const unionMembers = schema.oneOf ?? schema.anyOf;
|
|
12
|
-
if (unionMembers?.length) {
|
|
13
|
-
const types = [...new Set(unionMembers.map((s) => jsonSchemaTypeToTs(s)))];
|
|
14
|
-
return types.length === 1 ? types[0] : types.join(" | ");
|
|
15
|
-
}
|
|
16
|
-
if (schema.const !== void 0) {
|
|
17
|
-
return typeof schema.const === "string" ? `'${schema.const}'` : String(schema.const);
|
|
18
|
-
}
|
|
19
|
-
if (schema.enum?.length) {
|
|
20
|
-
return schema.enum.map((v) => typeof v === "string" ? `'${v}'` : String(v)).join(" | ");
|
|
21
|
-
}
|
|
22
|
-
if (Array.isArray(schema.type)) {
|
|
23
|
-
const { nullable: _nullable, ...rest } = schema;
|
|
24
|
-
const members = [...new Set(schema.type)].map(
|
|
25
|
-
(member) => jsonSchemaTypeToTs({ ...rest, type: member })
|
|
26
|
-
);
|
|
27
|
-
const unique = [...new Set(members)];
|
|
28
|
-
if (schema.nullable && !unique.includes("null")) unique.push("null");
|
|
29
|
-
return unique.join(" | ");
|
|
30
|
-
}
|
|
31
|
-
let result;
|
|
32
|
-
switch (schema.type) {
|
|
33
|
-
case "string":
|
|
34
|
-
result = "string";
|
|
35
|
-
break;
|
|
36
|
-
case "number":
|
|
37
|
-
case "integer":
|
|
38
|
-
result = "number";
|
|
39
|
-
break;
|
|
40
|
-
case "boolean":
|
|
41
|
-
result = "boolean";
|
|
42
|
-
break;
|
|
43
|
-
case "null":
|
|
44
|
-
return "null";
|
|
45
|
-
case "array": {
|
|
46
|
-
if (schema.items) {
|
|
47
|
-
const itemType = jsonSchemaTypeToTs(schema.items);
|
|
48
|
-
const itemsDeclareObject = Array.isArray(schema.items.type) ? schema.items.type.includes("object") : schema.items.type === "object";
|
|
49
|
-
result = itemsDeclareObject && schema.items.properties ? `Array<${itemType}>` : itemType.includes("|") ? `(${itemType})[]` : `${itemType}[]`;
|
|
50
|
-
} else {
|
|
51
|
-
result = "unknown[]";
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case "object": {
|
|
56
|
-
if (schema.properties) {
|
|
57
|
-
const required = schema.required ?? [];
|
|
58
|
-
const fields = Object.entries(schema.properties).map(([key, prop]) => {
|
|
59
|
-
const opt = !required.includes(key);
|
|
60
|
-
return `${key}${opt ? "?" : ""}: ${jsonSchemaTypeToTs(prop)}`;
|
|
61
|
-
}).join("; ");
|
|
62
|
-
result = `{ ${fields} }`;
|
|
63
|
-
} else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
64
|
-
result = `Record<string, ${jsonSchemaTypeToTs(schema.additionalProperties)}>`;
|
|
65
|
-
} else {
|
|
66
|
-
result = "Record<string, unknown>";
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
default:
|
|
71
|
-
result = "unknown";
|
|
72
|
-
}
|
|
73
|
-
if (schema.nullable && result !== "unknown") {
|
|
74
|
-
return `${result} | null`;
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// src/check/contract-validation.ts
|
|
80
|
-
function propsSpecToTypeScript(spec, indent = 2) {
|
|
81
|
-
const pad = " ".repeat(indent);
|
|
82
|
-
const lines = [];
|
|
83
|
-
for (const [propName, entry] of Object.entries(spec.properties)) {
|
|
84
|
-
if (entry.description) {
|
|
85
|
-
lines.push(`${pad}/** ${entry.description} */`);
|
|
86
|
-
}
|
|
87
|
-
const optional = !entry.required;
|
|
88
|
-
const tsType = jsonSchemaTypeToTs(entry.schema);
|
|
89
|
-
const defaultStr = entry.default !== void 0 ? ` // default: ${JSON.stringify(entry.default)}` : "";
|
|
90
|
-
lines.push(`${pad}${propName}${optional ? "?" : ""}: ${tsType};${defaultStr}`);
|
|
91
|
-
if (entry.example !== void 0) {
|
|
92
|
-
const exampleStr = JSON.stringify(entry.example, null, 2).split("\n").map((l, i) => i === 0 ? `${pad}// Example: ${l}` : `${pad}// ${l}`).join("\n");
|
|
93
|
-
lines.push(exampleStr);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return `{
|
|
97
|
-
${lines.join("\n")}
|
|
98
|
-
}`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/check/type-checker.ts
|
|
102
|
-
({
|
|
103
|
-
target: ts3.ScriptTarget.ES2020,
|
|
104
|
-
module: ts3.ModuleKind.ESNext,
|
|
105
|
-
// Classic React JSX mode. The synthetic prefix (SYNTHETIC_PREFIX)
|
|
106
|
-
// supplies `import React from 'react'` plus a `declare global` JSX
|
|
107
|
-
// namespace shim: `@types/react` v19 removed the *global* `JSX`
|
|
108
|
-
// namespace (it lives at `React.JSX` now), which classic mode needs
|
|
109
|
-
// for `JSX.IntrinsicElements` and the `key`/`ref` carve-out. Without
|
|
110
|
-
// the shim, `<div>` degrades to `any` and every typed component
|
|
111
|
-
// falsely rejects the intrinsic `key` prop.
|
|
112
|
-
jsx: ts3.JsxEmit.React,
|
|
113
|
-
moduleResolution: ts3.ModuleResolutionKind.Bundler});
|
|
114
|
-
var NOT_YET_TAUGHT_TOKENS = /* @__PURE__ */ new Set([]);
|
|
115
|
-
consumedTokenManifest.filter(
|
|
116
|
-
(token) => !NOT_YET_TAUGHT_TOKENS.has(token)
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
// src/check/run-tier0.ts
|
|
120
|
-
new Set(consumedTokenManifest);
|
|
121
|
-
|
|
122
|
-
// src/contract-context.ts
|
|
123
|
-
var SHELL_HINTS = {
|
|
124
|
-
chat: `**Chat Shell \u2014 Inline card in scrolling conversation**
|
|
125
|
-
- Container: width varies (60-80% of viewport), height: auto (natural content height)
|
|
126
|
-
- Chrome: parent provides card border + shadow + rounded corners \u2014 do NOT add your own box-shadow or outer border-radius
|
|
127
|
-
- Sizing: target 300-600px natural height. Do NOT use min-height: 100vh. No full-viewport designs.
|
|
128
|
-
- Padding: use var(--ggui-spacing-2) for inner elements, var(--ggui-spacing-4) for sections. Tight.
|
|
129
|
-
- Scrolling: parent scrolls (chat feed) \u2014 component should NOT have internal scroll
|
|
130
|
-
- Layout: single column, compact. No sidebar. Stack everything vertically.
|
|
131
|
-
- Width: the root is width: 100% (fills the bubble) \u2014 never cap the ROOT. A prose column inside it carries the reading cap (<Container maxWidth="sm">), which is inert at bubble width; the chips or buttons that answer the prose sit in a Container of the same maxWidth, so they share its left edge.`,
|
|
132
|
-
fullscreen: `**Fullscreen Shell \u2014 Takes over entire viewport**
|
|
133
|
-
- Container: the whole viewport, edge to edge \u2014 the frame stretches your root to its full height (you never set a viewport height yourself)
|
|
134
|
-
- Chrome: NONE \u2014 your component IS the entire UI. You own all visual chrome.
|
|
135
|
-
- Sizing: size to content; to fill a parent that has a height use height: 100% or flex: 1. NEVER min-height: 100vh / 100dvh \u2014 the frame already stretches the root, and a viewport height only fights it (tier-0 fail).
|
|
136
|
-
- Padding: component owns ALL padding. Use var(--ggui-spacing-6) or larger for breathing room.
|
|
137
|
-
- Scrolling: component manages its own scroll if content exceeds viewport (overflow-y: auto)
|
|
138
|
-
- Layout: can use multi-column, sidebars, headers/footers. Full creative control.
|
|
139
|
-
- Navigation: swipe left/right between pages is handled by the shell \u2014 don't implement it.
|
|
140
|
-
- DO NOT add outer margins or max-width containers. Fill the space.`,
|
|
141
|
-
partial: `**Partial Shell \u2014 Embedded panel in a larger page**
|
|
142
|
-
- Container: width constrained by parent (could be 400px sidebar or 800px main area)
|
|
143
|
-
- Chrome: parent may or may not have border \u2014 add your own Card/shadow if needed
|
|
144
|
-
- Sizing: width: 100% to fill parent. Use max-width if you want to center content.
|
|
145
|
-
- Padding: use standard spacing (var(--ggui-spacing-4) to var(--ggui-spacing-6))
|
|
146
|
-
- Scrolling: can scroll internally (overflow-y: auto) \u2014 parent does NOT scroll for you
|
|
147
|
-
- Layout: responsive within the container. Flex-wrap for variable parent widths.
|
|
148
|
-
- Context: other UI around you (nav, sidebar) \u2014 don't duplicate page-level chrome.`
|
|
149
|
-
};
|
|
150
|
-
var DEVICE_HINTS = {
|
|
151
|
-
mobile: `**Mobile:** Single column. Touch targets 44px+. Compact padding. Stack all sections vertically.`,
|
|
152
|
-
tablet: `**Tablet:** 1-2 columns adaptive. Medium touch targets. Side-by-side where space allows.`,
|
|
153
|
-
desktop: `**Desktop:** Multi-column. Hover states. Dense layouts. Keyboard shortcuts. Pointer interactions.`,
|
|
154
|
-
spatial: `**Spatial:** Fixed-size floating panel (~600x400). High contrast. Large text. No hover (gaze/hand input).`
|
|
155
|
-
};
|
|
156
|
-
function buildRenderingContext(ctx) {
|
|
157
|
-
const parts = [
|
|
158
|
-
"## Rendering Context",
|
|
159
|
-
`- Device: ${ctx.device}`,
|
|
160
|
-
ctx.viewport ? `- Viewport: ${ctx.viewport.width}\xD7${ctx.viewport.height}px` : "",
|
|
161
|
-
`- Shell: ${ctx.shell}`,
|
|
162
|
-
"",
|
|
163
|
-
DEVICE_HINTS[ctx.device] || "",
|
|
164
|
-
SHELL_HINTS[ctx.shell] || ""
|
|
165
|
-
].filter(Boolean);
|
|
166
|
-
return parts.join("\n");
|
|
167
|
-
}
|
|
168
|
-
function injectRenderingContext(userPrompt, rendering) {
|
|
169
|
-
if (!rendering) return userPrompt;
|
|
170
|
-
return userPrompt + "\n\n" + buildRenderingContext(rendering);
|
|
171
|
-
}
|
|
172
|
-
function buildContractsContext(contract, appGadgets) {
|
|
173
|
-
const parts = [];
|
|
174
|
-
if (contract.propsSpec) {
|
|
175
|
-
const propsSpec = contract.propsSpec;
|
|
176
|
-
const requiredFields = Object.entries(propsSpec.properties || {}).filter(([, e]) => e.required).map(([k]) => k);
|
|
177
|
-
const optionalFields = Object.entries(propsSpec.properties || {}).filter(([, e]) => !e.required).map(([k]) => k);
|
|
178
|
-
const tsInterface = propsSpecToTypeScript(propsSpec);
|
|
179
|
-
const fieldInfo = [];
|
|
180
|
-
if (requiredFields.length > 0) fieldInfo.push(`Required: ${requiredFields.join(", ")}`);
|
|
181
|
-
if (optionalFields.length > 0) fieldInfo.push(`Optional: ${optionalFields.join(", ")}`);
|
|
182
|
-
parts.push(
|
|
183
|
-
`## Props Contract (MUST use these exact prop names and types)
|
|
184
|
-
|
|
185
|
-
` + (fieldInfo.length > 0 ? fieldInfo.join("\n") + "\n\n" : "") + `\`\`\`typescript
|
|
186
|
-
interface Props ${tsInterface}
|
|
187
|
-
\`\`\``
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
if (contract.actionSpec && Object.keys(contract.actionSpec).length > 0) {
|
|
191
|
-
const actions = Object.entries(contract.actionSpec).map(([id, entry]) => {
|
|
192
|
-
let line = ` - ${id}: "${entry.label ?? id}"${entry.description ? ` \u2014 ${entry.description}` : ""}`;
|
|
193
|
-
if (entry.example !== void 0) {
|
|
194
|
-
line += `
|
|
195
|
-
Example payload: \`${JSON.stringify(entry.example)}\``;
|
|
196
|
-
}
|
|
197
|
-
if (entry.nextStep) {
|
|
198
|
-
line += `
|
|
199
|
-
Next-step hint: agent intends to call \`${entry.nextStep}\``;
|
|
200
|
-
}
|
|
201
|
-
if (entry.confirm === true) {
|
|
202
|
-
line += `
|
|
203
|
-
Author flag: \`confirm\` \u2014 the author marked this action as one to confirm with the user before it fires.`;
|
|
204
|
-
}
|
|
205
|
-
return line;
|
|
206
|
-
}).join("\n");
|
|
207
|
-
parts.push(`## Action Contract (wire these callbacks)
|
|
208
|
-
${actions}`);
|
|
209
|
-
}
|
|
210
|
-
if (contract.streamSpec && Object.keys(contract.streamSpec).length > 0) {
|
|
211
|
-
const channels = Object.entries(contract.streamSpec).map(([name, entry]) => {
|
|
212
|
-
const bits = [` - ${name}`];
|
|
213
|
-
if (entry.description) bits.push(`\u2014 ${entry.description}`);
|
|
214
|
-
if (entry.source?.tool) {
|
|
215
|
-
bits.push(`(source tool: \`${entry.source.tool}\`)`);
|
|
216
|
-
}
|
|
217
|
-
return bits.join(" ");
|
|
218
|
-
}).join("\n");
|
|
219
|
-
parts.push(
|
|
220
|
-
`## Stream Contract (real-time channels via \`useStream(name)\`)
|
|
221
|
-
${channels}
|
|
222
|
-
|
|
223
|
-
Payload schemas:
|
|
224
|
-
\`\`\`json
|
|
225
|
-
${JSON.stringify(contract.streamSpec, null, 2)}
|
|
226
|
-
\`\`\``
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
const agentTools = contract.agentCapabilities?.tools;
|
|
230
|
-
if (agentTools && Object.keys(agentTools).length > 0) {
|
|
231
|
-
const tools = Object.entries(agentTools).map(([name, entry]) => {
|
|
232
|
-
const bits = [` - **\`${name}\`**`];
|
|
233
|
-
if (entry.toolInfo?.description) bits.push(`\u2014 ${entry.toolInfo.description}`);
|
|
234
|
-
if (entry.usage) bits.push(`(usage: ${entry.usage})`);
|
|
235
|
-
return bits.join(" ");
|
|
236
|
-
}).join("\n");
|
|
237
|
-
parts.push(
|
|
238
|
-
`## AgentTools Catalog (tools the contract references)
|
|
239
|
-
${tools}
|
|
240
|
-
|
|
241
|
-
These are referenced via \`actionSpec[*].nextStep\` (the tool the agent SHOULD call next after the action fires) and \`streamSpec[*].source.tool\` (the tool feeding a channel). The agent OWNS the call \u2014 your component does not invoke these directly.
|
|
242
|
-
|
|
243
|
-
Schemas:
|
|
244
|
-
\`\`\`json
|
|
245
|
-
${JSON.stringify(agentTools, null, 2)}
|
|
246
|
-
\`\`\``
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
const clientCapabilities = contract.clientCapabilities?.gadgets;
|
|
250
|
-
const gadgetUses = listContractGadgets(contract);
|
|
251
|
-
if (gadgetUses.length > 0) {
|
|
252
|
-
const caps = gadgetUses.map((use) => {
|
|
253
|
-
const bits = [` - **\`${use.name}\`**`];
|
|
254
|
-
bits.push(
|
|
255
|
-
HOOK_NAME_RE.test(use.name) ? `via direct-imported hook \`${use.name}\` from \`${use.package}\` (call it)` : `via direct-imported component \`<${use.name} />\` from \`${use.package}\` (render as JSX)`
|
|
256
|
-
);
|
|
257
|
-
if (use.description) bits.push(`\u2014 ${use.description}`);
|
|
258
|
-
return bits.join(" ");
|
|
259
|
-
}).join("\n");
|
|
260
|
-
parts.push(
|
|
261
|
-
`## ClientCapabilities Contract (browser-capability gadgets the UI mounts)
|
|
262
|
-
${caps}
|
|
263
|
-
|
|
264
|
-
Hook entries are imported + called; component entries are imported + rendered as JSX. Capability values reach the agent only when the UI threads them into an actionSpec payload or contextSpec slot.
|
|
265
|
-
|
|
266
|
-
Declarations:
|
|
267
|
-
\`\`\`json
|
|
268
|
-
${JSON.stringify(clientCapabilities, null, 2)}
|
|
269
|
-
\`\`\``
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
const uiRequirements = [];
|
|
273
|
-
if (contract.propsSpec?.properties) {
|
|
274
|
-
for (const [name, entry] of Object.entries(contract.propsSpec.properties)) {
|
|
275
|
-
const required = entry.required === true;
|
|
276
|
-
if (required) {
|
|
277
|
-
uiRequirements.push(
|
|
278
|
-
`- **Required prop \`${name}\`** must appear somewhere in rendered DOM (display the value, or use it to drive a label/aria/key).`
|
|
279
|
-
);
|
|
280
|
-
} else {
|
|
281
|
-
uiRequirements.push(
|
|
282
|
-
`- **Optional prop \`${name}\`** may be ABSENT at runtime \u2014 the component must render without it (guard the access or apply its default) and must display it when it IS provided.`
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
if (contract.actionSpec) {
|
|
288
|
-
for (const [name, entry] of Object.entries(contract.actionSpec)) {
|
|
289
|
-
const label = entry.label ?? name;
|
|
290
|
-
uiRequirements.push(
|
|
291
|
-
`- **Action \`${name}\`** ("${label}") needs an interactive control that fires it (Button click, form submit, key press, etc.).`
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
if (contract.streamSpec) {
|
|
296
|
-
for (const name of Object.keys(contract.streamSpec)) {
|
|
297
|
-
uiRequirements.push(
|
|
298
|
-
`- **Stream \`${name}\`** must mirror into local state via \`useEffect\` and render the resulting state \u2014 \`useStream\` alone never re-renders the DOM.`
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
for (const use of gadgetUses) {
|
|
303
|
-
const exportName = use.name;
|
|
304
|
-
const pkg = use.package;
|
|
305
|
-
uiRequirements.push(
|
|
306
|
-
HOOK_NAME_RE.test(exportName) ? `- **ClientCapability \`${exportName}\`** \u2014 the boilerplate has direct-imported \`${exportName}\` from \`${pkg}\` above a \`// DO NOT EDIT\` banner; keep that import, call \`${exportName}\` inside the component, and thread the resulting value into a context slot or action payload if the agent needs to observe it.` : `- **ClientCapability \`${exportName}\`** \u2014 the boilerplate has direct-imported \`${exportName}\` from \`${pkg}\` above a \`// DO NOT EDIT\` banner; keep that import and RENDER \`<${exportName} \u2026 />\` as a JSX element in the tree you return.`
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
if (uiRequirements.length > 0) {
|
|
310
|
-
parts.push(
|
|
311
|
-
`## Required UI Surfaces (derived from contract \u2014 every surface below MUST have visible UI, eval will fail if any is missing)
|
|
312
|
-
` + uiRequirements.join("\n")
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
return parts.join("\n\n");
|
|
316
|
-
}
|
|
317
|
-
function injectContracts(userPrompt, contract, appGadgets) {
|
|
318
|
-
if (!contract) return userPrompt;
|
|
319
|
-
const ctx = buildContractsContext(contract);
|
|
320
|
-
if (!ctx) return userPrompt;
|
|
321
|
-
return userPrompt + "\n\n" + ctx;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export { buildContractsContext, buildRenderingContext, injectContracts, injectRenderingContext };
|
|
1
|
+
export { buildContractsContext, buildRenderingContext, injectContracts, injectRenderingContext } from '../chunk-VTC263LT.js';
|
|
2
|
+
import '../chunk-FWJIMKFZ.js';
|
|
3
|
+
import '../chunk-33B3BAWS.js';
|
|
4
|
+
import '../chunk-Z3CXME3K.js';
|
|
5
|
+
import '../chunk-NF6JUZWF.js';
|
|
6
|
+
import '../chunk-PUH4CXGZ.js';
|
|
7
|
+
import '../chunk-3T2HMTON.js';
|
|
8
|
+
import '../chunk-G3PMV62Z.js';
|
|
325
9
|
//# sourceMappingURL=prompts.js.map
|
|
326
10
|
//# sourceMappingURL=prompts.js.map
|