@ggui-ai/ui-gen 0.27.0 → 0.28.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.
@@ -482,6 +482,8 @@ function claudeCodeLoginQueryOptions() {
482
482
  function getBedrockModelId(model) {
483
483
  const BEDROCK_MAP = {
484
484
  "anthropic/claude-haiku-4-5": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
485
+ "anthropic/claude-haiku-5-5": "us.anthropic.claude-haiku-5-5",
486
+ // listed ACTIVE in us-east-1 (ggui#1743)
485
487
  "anthropic/claude-sonnet-4-6": "us.anthropic.claude-sonnet-4-6",
486
488
  "anthropic/claude-opus-4-6": "us.anthropic.claude-opus-4-6-v1:0",
487
489
  // Claude 5-family (ggui#706, strings verified 2026-09-02 against
@@ -2344,13 +2346,13 @@ function buildEvalResult(raw, passThreshold, inputTokens, outputTokens) {
2344
2346
  function getDefaultEvalModel(provider) {
2345
2347
  switch (provider) {
2346
2348
  case "claude":
2347
- return "claude-haiku-4-5-20251001";
2349
+ return "claude-haiku-5-5";
2348
2350
  case "openai":
2349
2351
  return "gpt-5.6-luna";
2350
2352
  case "google":
2351
2353
  return "gemini-3.5-flash-lite";
2352
2354
  default:
2353
- return "claude-haiku-4-5-20251001";
2355
+ return "claude-haiku-5-5";
2354
2356
  }
2355
2357
  }
2356
2358
 
@@ -2920,10 +2922,96 @@ function getInitialValuePropNames(contract) {
2920
2922
  }
2921
2923
  return names;
2922
2924
  }
2925
+ function objectLiteralKeysAt(src, open) {
2926
+ if (src[open] !== "{") return void 0;
2927
+ const keys = [];
2928
+ let depth = 0;
2929
+ let expectKey = true;
2930
+ for (let i = open; i < src.length; i++) {
2931
+ const c = src[i];
2932
+ if (c === '"' || c === "'" || c === "`") {
2933
+ let j = i + 1;
2934
+ while (j < src.length && src[j] !== c) j += src[j] === "\\" ? 2 : 1;
2935
+ if (depth === 1 && expectKey && /^\s*:/.test(src.slice(j + 1))) keys.push(src.slice(i + 1, j));
2936
+ i = j;
2937
+ expectKey = false;
2938
+ continue;
2939
+ }
2940
+ if (c === "{" || c === "[" || c === "(") {
2941
+ depth++;
2942
+ if (depth === 1) expectKey = true;
2943
+ continue;
2944
+ }
2945
+ if (c === "}" || c === "]" || c === ")") {
2946
+ depth--;
2947
+ if (depth === 0) return keys;
2948
+ continue;
2949
+ }
2950
+ if (depth !== 1) continue;
2951
+ if (c === ",") {
2952
+ expectKey = true;
2953
+ continue;
2954
+ }
2955
+ if (expectKey && /[A-Za-z_$]/.test(c ?? "")) {
2956
+ const m = /^([A-Za-z_$][\w$]*)\s*(:|,|\})/.exec(src.slice(i));
2957
+ if (m !== null && m[1] !== void 0) keys.push(m[1]);
2958
+ expectKey = false;
2959
+ }
2960
+ }
2961
+ return keys;
2962
+ }
2963
+ function callArgsAt(src, open) {
2964
+ const args = [];
2965
+ let depth = 0;
2966
+ let start = open + 1;
2967
+ for (let i = open; i < src.length; i++) {
2968
+ const c = src[i];
2969
+ if (c === '"' || c === "'" || c === "`") {
2970
+ let j = i + 1;
2971
+ while (j < src.length && src[j] !== c) j += src[j] === "\\" ? 2 : 1;
2972
+ i = j;
2973
+ continue;
2974
+ }
2975
+ if (c === "(" || c === "{" || c === "[") depth++;
2976
+ else if (c === ")" || c === "}" || c === "]") {
2977
+ depth--;
2978
+ if (depth === 0) {
2979
+ args.push(src.slice(start, i));
2980
+ return args;
2981
+ }
2982
+ } else if (c === "," && depth === 1) {
2983
+ args.push(src.slice(start, i));
2984
+ start = i + 1;
2985
+ }
2986
+ }
2987
+ return args;
2988
+ }
2989
+ function initialStateKeys(src, argStart, argText) {
2990
+ const lead = argText.length - argText.trimStart().length;
2991
+ let at = argStart + lead;
2992
+ let text = argText.trim();
2993
+ const lazy = /^\(\s*\)\s*=>\s*\(?\s*/.exec(text);
2994
+ if (lazy !== null) {
2995
+ at += lazy[0].length;
2996
+ text = text.slice(lazy[0].length);
2997
+ }
2998
+ if (text.startsWith("{")) return objectLiteralKeysAt(src, at) ?? [];
2999
+ const ident = /^([A-Za-z_$][\w$]*)\s*\)?\s*$/.exec(text);
3000
+ if (ident === null || ident[1] === void 0) return [];
3001
+ const decls = [...src.matchAll(new RegExp(`(?:const|let|var)\\s+${ident[1]}\\s*(?::[^=]{1,200})?=\\s*`, "g"))];
3002
+ const decl = decls.length === 1 ? decls[0] : void 0;
3003
+ if (decl === void 0) return [];
3004
+ return objectLiteralKeysAt(src, (decl.index ?? 0) + decl[0].length) ?? [];
3005
+ }
2923
3006
  function collectStateKeys(src) {
2924
3007
  const keys = /* @__PURE__ */ new Set();
2925
3008
  const varRe = /const\s*\[\s*(\w+)\s*,\s*(\w+)\s*\]\s*=\s*useState/g;
2926
3009
  for (const m of src.matchAll(varRe)) keys.add(m[1]);
3010
+ const contextRe = /const\s*\[\s*(\w+)\s*,\s*\w+\s*\]\s*=\s*useGguiContext\s*(?:<[^>]*>)?\s*\(\s*['"`](\w+)['"`]/g;
3011
+ for (const m of src.matchAll(contextRe)) {
3012
+ keys.add(m[1]);
3013
+ keys.add(m[2]);
3014
+ }
2927
3015
  const objRe = /useState(?:<[^>]*>)?\s*\(\s*\{([\s\S]*?)\}\s*\)/g;
2928
3016
  for (const m of src.matchAll(objRe)) {
2929
3017
  const keyRe = /(?:^|,)\s*(\w+)\s*:/g;
@@ -2934,6 +3022,16 @@ function collectStateKeys(src) {
2934
3022
  const keyRe = /(?:^|,)\s*(\w+)\s*:/g;
2935
3023
  for (const km of m[1].matchAll(keyRe)) keys.add(km[1]);
2936
3024
  }
3025
+ for (const m of src.matchAll(/\b(useState|useReducer)\s*(?:<[^>]*>)?\s*\(/g)) {
3026
+ const open = (m.index ?? 0) + m[0].length - 1;
3027
+ const args = callArgsAt(src, open);
3028
+ const which = m[1] === "useReducer" ? 1 : 0;
3029
+ const arg = args[which];
3030
+ if (arg === void 0) continue;
3031
+ let argStart = open + 1;
3032
+ for (let k = 0; k < which; k++) argStart += (args[k]?.length ?? 0) + 1;
3033
+ for (const key of initialStateKeys(src, argStart, arg)) keys.add(key);
3034
+ }
2937
3035
  return keys;
2938
3036
  }
2939
3037
  function mkIssue(subcategory, description, fix, result = "fail") {
@@ -3546,7 +3644,7 @@ function runNoHardcodedEntities(input) {
3546
3644
  mkIssue(
3547
3645
  "state.merge.no_hardcoded_entities",
3548
3646
  `Hardcoded entity array literal (multiple objects with "${idField}") in the component \u2014 entity data should come from state/props.`,
3549
- `Remove the literal array. Seed state from props.{entityProp} and merge updates via stream.`
3647
+ `Remove the literal array: this data comes from ${all.filter((e) => e.idField === idField).map((e) => `props.${e.name}`).join(" / ") || "props"}. Read it there (\`?? []\` for an absent value, never a literal default), seed state from it, and merge updates via stream.`
3550
3648
  )
3551
3649
  );
3552
3650
  }
@@ -6369,7 +6467,7 @@ function parseCriteriaAnswers(raw) {
6369
6467
  function getDefaultVisualModel(provider) {
6370
6468
  switch (provider) {
6371
6469
  case "claude":
6372
- return "claude-haiku-4-5-20251001";
6470
+ return "claude-haiku-5-5";
6373
6471
  case "google":
6374
6472
  return "gemini-3-flash-preview";
6375
6473
  }