@chai-ui/vue 0.12.0 → 0.13.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/DESIGN.md CHANGED
@@ -170,7 +170,7 @@ Rules:
170
170
  | Try again | `ResultCard`'s retry fires `onAction("retry", result)` | Re-run the **same** model call, not a different one |
171
171
  | Feedback | Like/dislike fire `onAction`, and the displayed vote comes from `getVote` | Store votes yourself |
172
172
  | Details | The flip side shows prompt, model, tokens, cost and duration | Supply `models` so ids resolve to labels |
173
- | Quality checks | Each result's `evaluations` render on the flip side: green with a check if it passed, red with a cross if it failed | Run your checks in your backend proxy and add a top-level `evaluations: [{ id, label, passed }]` field to the JSON it returns (for a stream, send it as its own `data:` chunk). The built-in Fal and OpenRouter engines read that field, a custom engine returns it from `generate`, and `useComposer` puts it on the matching `Result`. CHAI never runs or scores anything itself, and there are no confidence scores. |
173
+ | Quality checks | Each result's `evaluations` render on the flip side: green with a check if it passed, red with a cross if it failed | Run your checks in your backend proxy and add a top-level `evaluations: [{ id, label, passed }]` field to the JSON it returns (for a stream, send it as its own `data:` chunk). The built-in Fal and OpenRouter engines read that field, a custom engine returns it from `generate`, and `useComposer` puts it on the matching `Result`. Or turn on the opt-in judge: `useComposer({ judgeModel, judgeChecks })` has a model you name check each text or image result against your criteria, one tag per check, after your backend's. It's off by default, with no default model, and there are no confidence scores. |
174
174
 
175
175
  `ResultCard` is where a run ends. Don't add a "use as input" action that
176
176
  feeds a result back into a `Composer`. Chaining steps like that is
package/README.md CHANGED
@@ -103,7 +103,8 @@ into the page. Left out, it's `"auto"`: each menu goes where it fits.
103
103
  - **`MediaAnalyzer`** + **`useMediaAnalyzer`**: media in, a
104
104
  generation-ready prompt out.
105
105
  - **`ResultCard`**: one prompt's results, paged, with votes, retry,
106
- download, share, details and streaming text.
106
+ download, share, details, streaming text and quality-check tags (from
107
+ your backend, or the opt-in judge: `useComposer({ judgeModel, judgeChecks })`).
107
108
  - **`EditCard`**: marked regions with their own instructions, and each
108
109
  edit as a new version.
109
110
  - **`useComposer`**, **`ChaiProvider`**, and the `Toggle`, `SearchMenu`
package/dist/index.d.ts CHANGED
@@ -11,6 +11,6 @@ export type { ResultCardMoreAction, ResultCardVote } from "./result-card/types.j
11
11
  export * from "./reasoning.js";
12
12
  export * from "./useComposer.js";
13
13
  export * from "./useMediaAnalyzer.js";
14
- export { createFalEngine, createFalTranscriber, createOpenRouterEngine, createMockEngine, mockEngine, buildRegionEditPrompt, DEFAULT_MAX_ATTACHMENTS_BY_KIND, DEFAULT_MAX_REGIONS, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, EDIT_IMAGE_USE_CASE, TEXT_USE_CASE, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, GenerationError, isMediaAnalyzerAtCap, nextMediaAnalyzerAttachments, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, SUGGESTED_IMAGE_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_EDIT_MODELS, SUGGESTED_ANALYSIS_MODELS, reasoningModelFor, suggestedModels, promptWithGenres, checkSuggestedModels, nextUseCases, combinesWithOthers, } from "@chai-ui/core";
15
- export type { AudioUseCase, ComposerAttachMenuAction, ComposerPromptField, ComposerAttachment, ComposerSelection, ComposerSubmitPayload, ComposerUseCase, DroppedMedia, EditRegion, EditVersion, Evaluation, GenerationEngine, GenerationUseCase, MediaAnalysisKind, MediaAnalysisPromptLength, MediaAnalyzerAttachment, MediaAnalyzerSubmitPayload, MediaKind, MenuPlacement, ModelOption, OutputKind, Transcribe, VoiceClip, VoiceInputConfig, VoiceOption, ParameterOption, Reasoning, RegionBox, RegionFormat, Request, Result, ResultStatus, Run, SuggestedModelProblem, SuggestedModelsCheck, FalInputFormat, Usage, } from "@chai-ui/core";
14
+ export { createFalEngine, createFalTranscriber, createOpenRouterEngine, createMockEngine, mockEngine, buildRegionEditPrompt, DEFAULT_MAX_ATTACHMENTS_BY_KIND, DEFAULT_MAX_REGIONS, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, EDIT_IMAGE_USE_CASE, TEXT_USE_CASE, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, GenerationError, isMediaAnalyzerAtCap, nextMediaAnalyzerAttachments, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, SUGGESTED_IMAGE_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_EDIT_MODELS, SUGGESTED_ANALYSIS_MODELS, reasoningModelFor, suggestedModels, promptWithGenres, checkSuggestedModels, nextUseCases, combinesWithOthers, buildJudgePrompt, DEFAULT_EVALUATION_CHECKS, } from "@chai-ui/core";
15
+ export type { AudioUseCase, ComposerAttachMenuAction, ComposerPromptField, ComposerAttachment, ComposerSelection, ComposerSubmitPayload, ComposerUseCase, DroppedMedia, EditRegion, EditVersion, Evaluation, EvaluationCheck, JudgePromptInput, GenerationEngine, GenerationUseCase, MediaAnalysisKind, MediaAnalysisPromptLength, MediaAnalyzerAttachment, MediaAnalyzerSubmitPayload, MediaKind, MenuPlacement, ModelOption, OutputKind, Transcribe, VoiceClip, VoiceInputConfig, VoiceOption, ParameterOption, Reasoning, RegionBox, RegionFormat, Request, Result, ResultStatus, Run, SuggestedModelProblem, SuggestedModelsCheck, FalInputFormat, Usage, } from "@chai-ui/core";
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"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,EAAE,MAAM,wBAAwB,CAAC;AACnF,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAItC,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,+BAA+B,EAC/B,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,+BAA+B,EAC/B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACZ,OAAO,EACP,MAAM,EACN,YAAY,EACZ,GAAG,EACH,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,KAAK,GACN,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { inject, computed, defineComponent, provide, renderSlot, watch, onScopeDispose, h, ref, nextTick, openBlock, createElementBlock, createElementVNode, normalizeClass, createBlock, unref, Fragment, renderList, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle, createVNode, useId, shallowRef, mergeProps, onMounted, onUnmounted, withModifiers, withCtx, withDirectives, vModelText, reactive, toValue } from "vue";
2
2
  import { reasoningEngineFor, createReasoning, menuOpensAbove, regionColor, MAX_ANIMATE_ENHANCE_LENGTH, enhanceRevealDurationMs, VOICE_LEVEL_COUNT, formatVoiceElapsed, composerView, composerAttachMenuItems, createVoiceInput, composerAttachmentsFromFiles, regionBoxStyle, REGION_CORNERS, DEFAULT_MAX_REGIONS, freeRegionNumber, EDIT_ZOOM_STEPS, regionPopoverPosition, editCardWidth, newRegion, panForZoom, clampPan, fitBox, resizeBox, regionBoxForKey, panForKey, downloadMedia, downloadFilename, shareMedia, resultModelLabel, formatTokens, formatCost, formatDuration, formatAspectRatio, SUGGESTED_ANALYSIS_MODELS, DEFAULT_MAX_ATTACHMENTS_BY_KIND, isMediaAnalyzerAtCap, mediaAnalyzerModelSections, PROMPT_LENGTH_HINT, readMediaFiles, nextMediaAnalyzerAttachments, replacedNote, createComposerStore, pickReasoning, createMediaAnalyzerStore } from "@chai-ui/core";
3
- import { CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, DEFAULT_MAX_ATTACHMENTS_BY_KIND as DEFAULT_MAX_ATTACHMENTS_BY_KIND2, DEFAULT_MAX_REGIONS as DEFAULT_MAX_REGIONS2, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, EDIT_IMAGE_USE_CASE, GenerationError, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, SUGGESTED_ANALYSIS_MODELS as SUGGESTED_ANALYSIS_MODELS2, SUGGESTED_EDIT_MODELS, SUGGESTED_IMAGE_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, TEXT_USE_CASE, buildRegionEditPrompt, checkSuggestedModels, combinesWithOthers, createFalEngine, createFalTranscriber, createMockEngine, createOpenRouterEngine, isMediaAnalyzerAtCap as isMediaAnalyzerAtCap2, mockEngine, nextMediaAnalyzerAttachments as nextMediaAnalyzerAttachments2, nextUseCases, promptWithGenres, reasoningModelFor, suggestedModels } from "@chai-ui/core";
3
+ import { CREATE_MUSIC_USE_CASE, CREATE_SPEECH_USE_CASE, DEFAULT_EVALUATION_CHECKS, DEFAULT_MAX_ATTACHMENTS_BY_KIND as DEFAULT_MAX_ATTACHMENTS_BY_KIND2, DEFAULT_MAX_REGIONS as DEFAULT_MAX_REGIONS2, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, DEFAULT_MODEL_ID, DEFAULT_REASONING_MODEL, DEFAULT_REASONING_MODEL_BY_KIND, EDIT_IMAGE_USE_CASE, GenerationError, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, PRECISE_EDIT_MODELS, ROUTING_MODEL_ID, SUGGESTED_ANALYSIS_MODELS as SUGGESTED_ANALYSIS_MODELS2, SUGGESTED_EDIT_MODELS, SUGGESTED_IMAGE_MODELS, SUGGESTED_IMAGE_TO_VIDEO_MODELS, SUGGESTED_TEXT_TO_VIDEO_MODELS, TEXT_USE_CASE, buildJudgePrompt, buildRegionEditPrompt, checkSuggestedModels, combinesWithOthers, createFalEngine, createFalTranscriber, createMockEngine, createOpenRouterEngine, isMediaAnalyzerAtCap as isMediaAnalyzerAtCap2, mockEngine, nextMediaAnalyzerAttachments as nextMediaAnalyzerAttachments2, nextUseCases, promptWithGenres, reasoningModelFor, suggestedModels } from "@chai-ui/core";
4
4
  import "@material/web/fab/fab.js";
5
5
  import "@material/web/checkbox/checkbox.js";
6
6
  import "@material/web/textfield/outlined-text-field.js";
@@ -2813,6 +2813,7 @@ export {
2813
2813
  CREATE_SPEECH_USE_CASE,
2814
2814
  _sfc_main$k as ChaiProvider,
2815
2815
  _sfc_main$c as Composer,
2816
+ DEFAULT_EVALUATION_CHECKS,
2816
2817
  DEFAULT_MAX_ATTACHMENTS_BY_KIND2 as DEFAULT_MAX_ATTACHMENTS_BY_KIND,
2817
2818
  DEFAULT_MAX_REGIONS2 as DEFAULT_MAX_REGIONS,
2818
2819
  DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH,
@@ -2837,6 +2838,7 @@ export {
2837
2838
  _sfc_main$d as SearchMenu,
2838
2839
  TEXT_USE_CASE,
2839
2840
  _sfc_main$e as Toggle,
2841
+ buildJudgePrompt,
2840
2842
  buildRegionEditPrompt,
2841
2843
  checkSuggestedModels,
2842
2844
  combinesWithOthers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chai-ui/vue",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Chai UI Vue components — smart, drop-in UI for AI apps: Composer, Media Analyzer, Result Card, Edit Card, and the useComposer composable.",
5
5
  "license": "MIT",
6
6
  "author": "kazarazat",
@@ -47,8 +47,8 @@
47
47
  "dependencies": {
48
48
  "@fontsource/roboto": "^5.3.0",
49
49
  "@material/web": "^2.5.0",
50
- "@chai-ui/core": "0.12.0",
51
- "@chai-ui/tokens": "0.12.0"
50
+ "@chai-ui/core": "0.13.0",
51
+ "@chai-ui/tokens": "0.13.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@vitejs/plugin-vue": "^6.0.9",
package/src/index.ts CHANGED
@@ -49,6 +49,8 @@ export {
49
49
  checkSuggestedModels,
50
50
  nextUseCases,
51
51
  combinesWithOthers,
52
+ buildJudgePrompt,
53
+ DEFAULT_EVALUATION_CHECKS,
52
54
  } from "@chai-ui/core";
53
55
  export type {
54
56
  AudioUseCase,
@@ -62,6 +64,8 @@ export type {
62
64
  EditRegion,
63
65
  EditVersion,
64
66
  Evaluation,
67
+ EvaluationCheck,
68
+ JudgePromptInput,
65
69
  GenerationEngine,
66
70
  GenerationUseCase,
67
71
  MediaAnalysisKind,