@ggui-ai/ui-gen 0.13.0 → 0.15.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 +2 -2
- package/dist/adapters/generation-dispatch.js +192 -58
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +7 -9
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +3 -3
- package/dist/advanced/index.js +192 -58
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +2 -7
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +4 -4
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +1 -1
- package/dist/check/index.js +57 -16
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-CF0EL0Li.d.ts → create-ui-generator-D6TKuv9V.d.ts} +2 -2
- package/dist/{dispatch-D75M-OfZ.d.ts → dispatch-BuZfTh9r.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 +79 -16
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +1 -1
- package/dist/harness/check/runtime-render/index.js +2 -7
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/index.d.ts +2 -2
- package/dist/harness/index.js +64 -19
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js +2 -0
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +1 -1
- package/dist/harness/runtime.d.ts +2 -2
- package/dist/harness/runtime.js +5 -5
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js +4 -4
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +192 -58
- package/dist/index.js.map +1 -1
- package/dist/{llm-router-BEVtbAb9.d.ts → llm-router-D7fjBhtr.d.ts} +39 -0
- package/dist/patch.d.ts +1 -1
- package/dist/provider-adapter-contract.js +1017 -731
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/{types-public-DIpjC-OA.d.ts → types-public-CkNWEov9.d.ts} +64 -1
- 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 +21 -21
- package/src/adapters/provider-router.ts +9 -0
- package/src/boilerplate/system-prompt.ts +4 -4
- package/src/check/run-tier0.ts +109 -22
- package/src/check/type-checker.ts +12 -2
- package/src/evaluation/index.ts +4 -0
- package/src/evaluation/llm-evaluator.ts +52 -8
- package/src/evaluation/types-public.ts +79 -0
- package/src/evaluation/visual-evaluator.ts +27 -5
- package/src/harness/coding/run-eval-round.ts +32 -6
- package/src/harness/llm-router.ts +128 -2
- package/src/validation/primitives.ts +1 -1
package/dist/harness/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Harness } from './types-public.js';
|
|
2
2
|
export { CheckLeg, CheckResult, CreateHarnessInput, DefaultTaskRunner, HarnessConstructionContext, HarnessId, HarnessMeta, HarnessName, HarnessOverrides, HarnessRevision, HowLeg, IterationRecord, LLMEvaluator, PatchFn, Phase, PhaseRunResult, PlannerDecision, PlannerFn, ProcessLeg, PromptBuilder, RetryPolicy, RunCheckInput, RunHarnessInput, RunHarnessReason, RunHarnessResult, RunWorkflowInput, Task, TaskContext, TaskRunner, TierCheck, WhatLeg, Workflow, WorkflowRunResult, createHarness, runCheck, runHarness, runWorkflow } from './types-public.js';
|
|
3
3
|
export { applyLineRanges, defaultApplyPatch } from '../patch.js';
|
|
4
|
-
export { A as AgentConfig, L as LLMResponse, P as ProviderRetryInfo, c as callLLM, a as createAgent } from '../llm-router-
|
|
4
|
+
export { A as AgentConfig, L as LLMResponse, P as ProviderRetryInfo, c as callLLM, a as createAgent } from '../llm-router-D7fjBhtr.js';
|
|
5
5
|
export { WORKFLOWS, WorkflowId, pickWorkflow } from '../workflows.js';
|
|
6
6
|
export { LlmTraceEvent, LlmTraceKind, LlmTraceProvider, LlmTraceSink, getLlmTraceSink, setLlmTraceSink } from './llm-trace-sink.js';
|
|
7
7
|
export { ValidatorTraceEvent, ValidatorTraceSink, getValidatorTraceSink, setValidatorTraceSink } from './validator-trace-sink.js';
|
|
@@ -9,7 +9,7 @@ export { ProcessMode } from '../policy.js';
|
|
|
9
9
|
export { computeHarnessId, computeHarnessName, hashClassification } from '../hash.js';
|
|
10
10
|
import '@ggui-ai/protocol';
|
|
11
11
|
import '../axes-CzLEMDeB.js';
|
|
12
|
-
import '../types-public-
|
|
12
|
+
import '../types-public-CkNWEov9.js';
|
|
13
13
|
import '../types-BOvHNG7K.js';
|
|
14
14
|
import '../llm.js';
|
|
15
15
|
|
package/dist/harness/index.js
CHANGED
|
@@ -9,13 +9,8 @@ import 'zod';
|
|
|
9
9
|
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
-
var __esm = (fn, res
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
16
|
-
} catch (e) {
|
|
17
|
-
throw err = [e], e;
|
|
18
|
-
}
|
|
12
|
+
var __esm = (fn, res) => function __init() {
|
|
13
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
19
14
|
};
|
|
20
15
|
var __export = (target, all) => {
|
|
21
16
|
for (var name in all)
|
|
@@ -2016,17 +2011,17 @@ MANDATORY:
|
|
|
2016
2011
|
1. NEVER use hardcoded hex colors like \`#7c3aed\` \u2014 ONLY \`var(--ggui-color-*)\` tokens.
|
|
2017
2012
|
2. NEVER use CSS gradients with custom colors. If you need a gradient: \`linear-gradient(to bottom, var(--ggui-color-primary-500), var(--ggui-color-primary-700))\`.
|
|
2018
2013
|
3. NEVER invent your own palette. The system provides primary, neutral, success, warning, error, and info \u2014 use ONLY these.
|
|
2019
|
-
4. NEVER include literal fallback values in
|
|
2014
|
+
4. NEVER include literal fallback values in ANY token reference \u2014 colors, spacing, typography, radius, shadows alike. Write \`var(--ggui-spacing-4)\` bare, never \`var(--ggui-spacing-4, 16px)\`; \`var(--ggui-color-primary-600)\` bare, never \`var(--ggui-color-primary-600, #0284c7)\`. The runtime injects every token; a literal fallback paints the wrong value exactly when the operator's theme matters most.
|
|
2020
2015
|
|
|
2021
2016
|
Token categories:
|
|
2022
2017
|
- Brand: \`var(--ggui-color-primary-600)\`, \`var(--ggui-color-primary-50)\`
|
|
2023
2018
|
- Text: \`var(--ggui-color-onSurface)\`, \`var(--ggui-color-onSurfaceVariant)\`
|
|
2024
2019
|
- Backgrounds: \`var(--ggui-color-surface)\`, \`var(--ggui-color-surfaceVariant)\`
|
|
2025
2020
|
- Borders: \`var(--ggui-color-outline)\`
|
|
2026
|
-
- Spacing: \`var(--ggui-spacing-4
|
|
2027
|
-
- Typography: \`var(--ggui-font-size-sm
|
|
2021
|
+
- Spacing: \`var(--ggui-spacing-4)\`, \`var(--ggui-spacing-6)\`
|
|
2022
|
+
- Typography: \`var(--ggui-font-size-sm)\`, \`var(--ggui-font-weight-semibold)\`
|
|
2028
2023
|
- Shadows: \`var(--ggui-shape-shadow-sm)\`, \`var(--ggui-shape-shadow-md)\`, \`var(--ggui-shape-shadow-lg)\`
|
|
2029
|
-
- Radius: \`var(--ggui-shape-radius-md
|
|
2024
|
+
- Radius: \`var(--ggui-shape-radius-md)\`, \`var(--ggui-shape-radius-lg)\`
|
|
2030
2025
|
|
|
2031
2026
|
Prefer primitives' built-in styling props over inline styles when possible.
|
|
2032
2027
|
|
|
@@ -2738,7 +2733,16 @@ function getBedrockModelId(model) {
|
|
|
2738
2733
|
const BEDROCK_MAP = {
|
|
2739
2734
|
"anthropic/claude-haiku-4-5": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
2740
2735
|
"anthropic/claude-sonnet-4-6": "us.anthropic.claude-sonnet-4-6",
|
|
2741
|
-
"anthropic/claude-opus-4-6": "us.anthropic.claude-opus-4-6-v1:0"
|
|
2736
|
+
"anthropic/claude-opus-4-6": "us.anthropic.claude-opus-4-6-v1:0",
|
|
2737
|
+
// Claude 5-family (ggui#706, strings verified 2026-09-02 against
|
|
2738
|
+
// platform.claude.com; Bedrock base form `anthropic.<id>`, upcast to
|
|
2739
|
+
// the cross-region profile). Explicit so the ids are pinned by test,
|
|
2740
|
+
// not merely reachable through the generic fallback below.
|
|
2741
|
+
"anthropic/claude-fable-5-1": "us.anthropic.claude-fable-5-1",
|
|
2742
|
+
"anthropic/claude-opus-5": "us.anthropic.claude-opus-5",
|
|
2743
|
+
"anthropic/claude-sonnet-5": "us.anthropic.claude-sonnet-5",
|
|
2744
|
+
// Legacy (still available; registry state `legacy`, not deprecated).
|
|
2745
|
+
"anthropic/claude-fable-5": "us.anthropic.claude-fable-5"
|
|
2742
2746
|
};
|
|
2743
2747
|
const normalized = model.replace(/^anthropic\./, "anthropic/");
|
|
2744
2748
|
if (BEDROCK_MAP[normalized]) return BEDROCK_MAP[normalized];
|
|
@@ -2991,6 +2995,32 @@ var LLMAgent = class {
|
|
|
2991
2995
|
}
|
|
2992
2996
|
}
|
|
2993
2997
|
};
|
|
2998
|
+
function normalizeAnthropicModelId(model) {
|
|
2999
|
+
return model.replace(/^anthropic\//, "").replace(/^(?:[a-z]{2}\.)?anthropic\./, "");
|
|
3000
|
+
}
|
|
3001
|
+
function anthropicRejectsSamplingParams(model) {
|
|
3002
|
+
return /^claude-(?:opus-4-7|opus-5|sonnet-5|fable-5)(?:-|$)/.test(
|
|
3003
|
+
normalizeAnthropicModelId(model)
|
|
3004
|
+
);
|
|
3005
|
+
}
|
|
3006
|
+
function anthropicRejectsForcedToolChoice(model) {
|
|
3007
|
+
return /^claude-fable-5-1(?:-|$)/.test(normalizeAnthropicModelId(model));
|
|
3008
|
+
}
|
|
3009
|
+
function resolveAnthropicSampling(model, temperature) {
|
|
3010
|
+
if (temperature === void 0) {
|
|
3011
|
+
return { request: {}, applied: { temperature: "provider-default" } };
|
|
3012
|
+
}
|
|
3013
|
+
if (anthropicRejectsSamplingParams(model)) {
|
|
3014
|
+
return {
|
|
3015
|
+
request: {},
|
|
3016
|
+
applied: {
|
|
3017
|
+
temperature: "provider-default",
|
|
3018
|
+
strippedReason: `${normalizeAnthropicModelId(model)} rejects non-default sampling params (HTTP 400 on Opus 4.7+/5-family); caller's temperature=${temperature} was not sent`
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
}
|
|
3022
|
+
return { request: { temperature }, applied: { temperature } };
|
|
3023
|
+
}
|
|
2994
3024
|
var AnthropicAgent = class extends LLMAgent {
|
|
2995
3025
|
provider = "anthropic";
|
|
2996
3026
|
resolveModel(model) {
|
|
@@ -3022,6 +3052,10 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3022
3052
|
cache_control: { type: "ephemeral" }
|
|
3023
3053
|
}
|
|
3024
3054
|
];
|
|
3055
|
+
const sampling = resolveAnthropicSampling(resolvedModel, temperature);
|
|
3056
|
+
if (sampling.applied.strippedReason !== void 0) {
|
|
3057
|
+
console.warn(`[anthropic] callText: ${sampling.applied.strippedReason}`);
|
|
3058
|
+
}
|
|
3025
3059
|
try {
|
|
3026
3060
|
const response = await this.apiCall(
|
|
3027
3061
|
() => client.messages.create({
|
|
@@ -3029,7 +3063,7 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3029
3063
|
max_tokens: maxTokens ?? 4096,
|
|
3030
3064
|
system,
|
|
3031
3065
|
messages: [{ role: "user", content: userPrompt }],
|
|
3032
|
-
...
|
|
3066
|
+
...sampling.request
|
|
3033
3067
|
})
|
|
3034
3068
|
);
|
|
3035
3069
|
const usage = response.usage;
|
|
@@ -3061,7 +3095,8 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3061
3095
|
return {
|
|
3062
3096
|
text,
|
|
3063
3097
|
inputTokens: response.usage.input_tokens,
|
|
3064
|
-
outputTokens: response.usage.output_tokens
|
|
3098
|
+
outputTokens: response.usage.output_tokens,
|
|
3099
|
+
sampling: sampling.applied
|
|
3065
3100
|
};
|
|
3066
3101
|
} catch (e) {
|
|
3067
3102
|
const endedAt = Date.now();
|
|
@@ -3167,6 +3202,12 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3167
3202
|
...i === tools.length - 1 ? { cache_control: { type: "ephemeral" } } : {}
|
|
3168
3203
|
}));
|
|
3169
3204
|
try {
|
|
3205
|
+
const appliedToolChoice = toolChoice === "required" && anthropicRejectsForcedToolChoice(resolvedModel) ? "auto" : toolChoice;
|
|
3206
|
+
if (appliedToolChoice !== toolChoice) {
|
|
3207
|
+
console.warn(
|
|
3208
|
+
`[anthropic] callTools: ${normalizeAnthropicModelId(resolvedModel)} rejects forced tool_choice (HTTP 400); caller's 'required' downgraded to 'auto'`
|
|
3209
|
+
);
|
|
3210
|
+
}
|
|
3170
3211
|
const response = await this.apiCall(
|
|
3171
3212
|
() => client.messages.stream({
|
|
3172
3213
|
model: resolvedModel,
|
|
@@ -3174,7 +3215,7 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3174
3215
|
system,
|
|
3175
3216
|
messages: [{ role: "user", content: userPrompt }],
|
|
3176
3217
|
tools: cachedTools,
|
|
3177
|
-
tool_choice: { type:
|
|
3218
|
+
tool_choice: { type: appliedToolChoice === "required" ? "any" : "auto" }
|
|
3178
3219
|
}).finalMessage()
|
|
3179
3220
|
);
|
|
3180
3221
|
const usage = response.usage;
|
|
@@ -3216,7 +3257,8 @@ var AnthropicAgent = class extends LLMAgent {
|
|
|
3216
3257
|
inputTokens: response.usage.input_tokens,
|
|
3217
3258
|
outputTokens: response.usage.output_tokens,
|
|
3218
3259
|
cacheReadTokens: cacheRead,
|
|
3219
|
-
cacheCreationTokens: cacheCreated
|
|
3260
|
+
cacheCreationTokens: cacheCreated,
|
|
3261
|
+
appliedToolChoice
|
|
3220
3262
|
};
|
|
3221
3263
|
} catch (e) {
|
|
3222
3264
|
const endedAt = Date.now();
|
|
@@ -3370,7 +3412,8 @@ var OpenAIAgent = class extends LLMAgent {
|
|
|
3370
3412
|
return {
|
|
3371
3413
|
text,
|
|
3372
3414
|
inputTokens: response.usage?.input_tokens ?? 0,
|
|
3373
|
-
outputTokens: response.usage?.output_tokens ?? 0
|
|
3415
|
+
outputTokens: response.usage?.output_tokens ?? 0,
|
|
3416
|
+
sampling: { temperature: temperature ?? "provider-default" }
|
|
3374
3417
|
};
|
|
3375
3418
|
}
|
|
3376
3419
|
async callTools(model, systemPrompt, userPrompt, tools, toolChoice = "required", _scopedTools) {
|
|
@@ -3539,7 +3582,8 @@ var GoogleAgent = class extends LLMAgent {
|
|
|
3539
3582
|
return {
|
|
3540
3583
|
text: interactionText(interaction),
|
|
3541
3584
|
inputTokens: interaction.usage?.total_input_tokens ?? 0,
|
|
3542
|
-
outputTokens: interaction.usage?.total_output_tokens ?? 0
|
|
3585
|
+
outputTokens: interaction.usage?.total_output_tokens ?? 0,
|
|
3586
|
+
sampling: { temperature: temperature ?? "provider-default" }
|
|
3543
3587
|
};
|
|
3544
3588
|
}
|
|
3545
3589
|
async callVision(model, systemPrompt, userPrompt, image, maxTokens) {
|
|
@@ -3831,7 +3875,8 @@ var OpenRouterAgent = class extends LLMAgent {
|
|
|
3831
3875
|
return {
|
|
3832
3876
|
text,
|
|
3833
3877
|
inputTokens: response.usage.prompt_tokens,
|
|
3834
|
-
outputTokens: response.usage.completion_tokens
|
|
3878
|
+
outputTokens: response.usage.completion_tokens,
|
|
3879
|
+
sampling: { temperature: temperature ?? "provider-default" }
|
|
3835
3880
|
};
|
|
3836
3881
|
}
|
|
3837
3882
|
async callTools(model, systemPrompt, userPrompt, tools, toolChoice, _scopedTools) {
|