@shwfed/config 2.3.11 → 2.3.13

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.
Files changed (95) hide show
  1. package/dist/mcp.mjs +1157 -733
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-BZahzuEc.js → config-0UIjgMSM.js} +1 -1
  4. package/dist/preview/assets/{config-57-v4VXo.js → config-9eu0BvKT.js} +1 -1
  5. package/dist/preview/assets/{config-BnZQO-Sp.js → config-B1jKkIYg.js} +1 -1
  6. package/dist/preview/assets/{config-DNokxY7M.js → config-BpTg08Vv.js} +1 -1
  7. package/dist/preview/assets/{config-_uPI8qV-.js → config-CDjs2Ohl.js} +1 -1
  8. package/dist/preview/assets/{config-_msO_f2R.js → config-CVS1PW6h.js} +1 -1
  9. package/dist/preview/assets/{config-Be-2ZA2R.js → config-DoQjG5TI.js} +1 -1
  10. package/dist/preview/assets/{config-Bp91DUdU.js → config-f56G9OU7.js} +1 -1
  11. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-BtScXbs1.js → definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js} +1 -1
  12. package/dist/preview/assets/index-Br_eXThF.css +1 -0
  13. package/dist/preview/assets/index-DDthcoXk.js +637 -0
  14. package/dist/preview/assets/index-DhkKZ2ii.js +1 -0
  15. package/dist/preview/assets/{runtime-Dk9u-Ybw.js → runtime-BICQC6bF.js} +1 -1
  16. package/dist/preview/assets/{runtime-CfR7ZAND.js → runtime-BkZp9k_z.js} +1 -1
  17. package/dist/preview/assets/{runtime-XXqIAt53.js → runtime-BqFFtMNw.js} +1 -1
  18. package/dist/preview/assets/{runtime-BBms4myv.js → runtime-COMOofol.js} +1 -1
  19. package/dist/preview/assets/{runtime-D3EyeiyA.js → runtime-CPPOlC0F.js} +1 -1
  20. package/dist/preview/assets/{runtime-cKWSGFod.js → runtime-DejxoCBP.js} +1 -1
  21. package/dist/preview/assets/{runtime-w7V-p3t1.js → runtime-YYdaCEw3.js} +1 -1
  22. package/dist/preview/assets/{runtime-B9u14qqB.js → runtime-hKRNY9F6.js} +1 -1
  23. package/dist/preview/index.html +2 -2
  24. package/dist/runtime/components/actions/utils/resolve.js +6 -2
  25. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
  26. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +4 -0
  27. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +6 -17
  28. package/dist/runtime/components/config/utils/resolve.js +3 -1
  29. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
  30. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
  31. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
  32. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
  33. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +22 -22
  34. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +22 -22
  35. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  36. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  37. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
  38. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
  39. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +12 -12
  40. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +12 -12
  41. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +10 -10
  42. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +10 -10
  43. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +12 -12
  44. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +12 -12
  45. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
  46. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue +605 -0
  47. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
  48. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
  49. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +324 -0
  50. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
  51. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +99 -0
  52. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +129 -0
  53. package/dist/runtime/components/form/unit-config.vue +0 -23
  54. package/dist/runtime/components/form/utils/resolve.js +3 -1
  55. package/dist/runtime/components/table/config.d.vue.ts +2 -2
  56. package/dist/runtime/components/table/config.vue +5 -45
  57. package/dist/runtime/components/table/config.vue.d.ts +2 -2
  58. package/dist/runtime/components/table/schema.d.ts +9 -2
  59. package/dist/runtime/components/table/schema.js +30 -14
  60. package/dist/runtime/components/table/utils/resolve.js +3 -1
  61. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.d.vue.ts +1 -1
  62. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.vue.d.ts +1 -1
  63. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +1 -1
  64. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +1 -1
  65. package/dist/runtime/components/ui/tree/Tree.d.vue.ts +57 -0
  66. package/dist/runtime/components/ui/tree/Tree.vue +325 -0
  67. package/dist/runtime/components/ui/tree/Tree.vue.d.ts +57 -0
  68. package/dist/runtime/components/ui/tree/TreeNode.d.vue.ts +53 -0
  69. package/dist/runtime/components/ui/tree/TreeNode.vue +299 -0
  70. package/dist/runtime/components/ui/tree/TreeNode.vue.d.ts +53 -0
  71. package/dist/runtime/components/ui/tree/index.d.ts +3 -0
  72. package/dist/runtime/components/ui/tree/index.js +2 -0
  73. package/dist/runtime/components/ui/tree/types.d.ts +120 -0
  74. package/dist/runtime/components/ui/tree/types.js +0 -0
  75. package/dist/runtime/components/ui/tree/useTreeState.d.ts +95 -0
  76. package/dist/runtime/components/ui/tree/useTreeState.js +369 -0
  77. package/dist/runtime/shims.d.ts +2 -0
  78. package/package.json +1 -1
  79. package/dist/preview/assets/index-DDbl2Atj.js +0 -1
  80. package/dist/preview/assets/index-DGa3Oj3y.js +0 -1075
  81. package/dist/preview/assets/index-mbGtsgdv.css +0 -1
  82. package/dist/runtime/components/form/ai/fields-button.d.vue.ts +0 -13
  83. package/dist/runtime/components/form/ai/fields-button.vue +0 -460
  84. package/dist/runtime/components/form/ai/fields-button.vue.d.ts +0 -13
  85. package/dist/runtime/components/form/ai/fields-task.md +0 -71
  86. package/dist/runtime/components/table/ai/columns-button.d.vue.ts +0 -12
  87. package/dist/runtime/components/table/ai/columns-button.vue +0 -492
  88. package/dist/runtime/components/table/ai/columns-button.vue.d.ts +0 -12
  89. package/dist/runtime/components/table/ai/columns-task.md +0 -53
  90. package/dist/runtime/components/table/ai/data-source-button.d.vue.ts +0 -20
  91. package/dist/runtime/components/table/ai/data-source-button.vue +0 -324
  92. package/dist/runtime/components/table/ai/data-source-button.vue.d.ts +0 -20
  93. package/dist/runtime/components/table/ai/data-source-task.md +0 -17
  94. package/dist/runtime/utils/ai/cel-prompt.d.ts +0 -11
  95. package/dist/runtime/utils/ai/cel-prompt.js +0 -27
@@ -1,324 +0,0 @@
1
- <script setup>
2
- import { celCheck as $celCheck } from "../../../utils/cel";
3
- import { Icon } from "@iconify/vue";
4
- import { Either, Schema } from "effect";
5
- import { computed, ref } from "vue";
6
- import { toast } from "vue-sonner";
7
- import ShwfedModal from "../../modal.vue";
8
- import { Button } from "../../ui/button";
9
- import { Markdown } from "../../ui/markdown";
10
- import { Textarea } from "../../ui/textarea";
11
- import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip";
12
- import { composeCelPrompt } from "../../../utils/ai/cel-prompt";
13
- import { StructuredOutputDecodeError, ai as $ai } from "../../../utils/ai";
14
- import TASK from "./data-source-task.md?raw";
15
- defineOptions({ name: "ShwfedTableAiDataSourceButton" });
16
- const props = defineProps({
17
- dataSource: { type: Object, required: false },
18
- columns: { type: Array, required: false }
19
- });
20
- const emit = defineEmits(["apply"]);
21
- const DataSourceDraft = Schema.Struct({
22
- request: Schema.optional(Schema.String).annotations({
23
- description: 'CEL expression returning an HttpRequest (e.g. http.get("/api/users").query("page", pageIndex + 1)). Omit if the data is static or comes from an outer context.'
24
- }),
25
- data: Schema.optional(Schema.String).annotations({
26
- description: "CEL expression returning a list. Reference `json` to extract from the HTTP response when `request` is set."
27
- }),
28
- total: Schema.optional(Schema.String).annotations({
29
- description: "CEL expression returning a number for server-side pagination. Omit to fall back to client pagination."
30
- })
31
- });
32
- const REQUEST_SCOPE = {
33
- pageIndex: { type: "number", label: "\u5F53\u524D\u9875\u7801", description: "\u5F53\u524D\u9875\u7801\uFF08\u4ECE 0 \u5F00\u59CB\uFF09\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0", value: 0 },
34
- pageSize: { type: "number", label: "\u6BCF\u9875\u884C\u6570", description: "\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0", value: 0 },
35
- query: { type: "dyn", label: "\u641C\u7D22\u6761\u4EF6", description: "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61", value: {} }
36
- };
37
- const JSON_SCOPE = {
38
- json: { type: "optional<dyn>", label: "HTTP \u54CD\u5E94\u4F53", description: "\u5DF2\u89E3\u6790\u7684 JSON \u54CD\u5E94\uFF1B\u672A\u914D\u7F6E request \u65F6\u4E3A none", value: void 0 },
39
- query: { type: "dyn", label: "\u641C\u7D22\u6761\u4EF6", description: "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61", value: {} }
40
- };
41
- const open = ref(false);
42
- const context = ref("");
43
- const submitting = ref(false);
44
- const tick = ref(0);
45
- const description = [
46
- "\u7C98\u8D34\u63A5\u53E3\u6587\u6863\u3001\u793A\u4F8B\u54CD\u5E94\u6216 PRD \u6458\u8981\uFF0C\u4FE1\u606F\u8D8A\u5B8C\u6574\u751F\u6210\u8D8A\u51C6\u786E\u3002",
47
- "",
48
- "AI \u4F1A\u6839\u636E\u63CF\u8FF0\u751F\u6210 `\u8BF7\u6C42` / `\u6570\u636E` / `\u603B\u6570` \u4E09\u4E2A CEL \u5B57\u6BB5\u3002"
49
- ].join("\n");
50
- const canSubmit = computed(() => !submitting.value && context.value.trim().length > 0);
51
- function onTrigger() {
52
- open.value = true;
53
- }
54
- function checkCelString(expr) {
55
- if (typeof expr !== "string" || expr.trim() === "") return null;
56
- const checked = $celCheck(expr);
57
- if (Either.isLeft(checked)) {
58
- return checked.left instanceof Error ? checked.left.message : String(checked.left);
59
- }
60
- return null;
61
- }
62
- function collectErrors(ds) {
63
- const out = [];
64
- for (const key of ["request", "data", "total"]) {
65
- const msg = checkCelString(ds[key]);
66
- if (msg) out.push({ path: key, message: msg });
67
- }
68
- return out;
69
- }
70
- function buildRetryFeedback(errors) {
71
- const lines = errors.map(({ path, message }) => `- \`${path}\`: ${message}`);
72
- return [
73
- "The previous output failed CEL validation. Fix only the listed fields and return the corrected object \u2014 keep the other fields identical.",
74
- "",
75
- "Errors:",
76
- ...lines
77
- ].join("\n");
78
- }
79
- function buildShapeFeedback(message) {
80
- return [
81
- "The previous output did not match the required JSON shape. Re-emit the structured output, this time matching the schema exactly. The output must be a JSON object with optional `request`, `data`, `total` fields (each a CEL string). Omit fields the user did not address.",
82
- "",
83
- "Decoder error:",
84
- message
85
- ].join("\n");
86
- }
87
- const EXPECTED_KEYS = ["request", "data", "total"];
88
- function tryUnwrap(raw) {
89
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
90
- const entries = Object.entries(raw);
91
- if (entries.length !== 1) return null;
92
- const [, inner] = entries[0];
93
- let candidate = inner;
94
- if (typeof candidate === "string") {
95
- try {
96
- candidate = JSON.parse(candidate);
97
- } catch {
98
- return null;
99
- }
100
- }
101
- if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) return null;
102
- const obj = candidate;
103
- if (!EXPECTED_KEYS.some((k) => k in obj)) return null;
104
- return candidate;
105
- }
106
- async function callModel(prompt, system, retry) {
107
- try {
108
- const value = await $ai.generateObject({
109
- prompt,
110
- system,
111
- schema: DataSourceDraft,
112
- objectName: "data_source",
113
- ...retry ? { retry } : {},
114
- onProgress: () => {
115
- tick.value++;
116
- }
117
- });
118
- const errors = collectErrors(value);
119
- if (errors.length > 0) {
120
- return { kind: "retry", previousOutput: value, feedback: buildRetryFeedback(errors) };
121
- }
122
- return { kind: "ok", value };
123
- } catch (err) {
124
- if (err instanceof StructuredOutputDecodeError) {
125
- const unwrapped = tryUnwrap(err.rawOutput);
126
- if (unwrapped !== null) {
127
- const decoded = Schema.decodeUnknownEither(DataSourceDraft)(unwrapped);
128
- if (Either.isRight(decoded)) {
129
- const value = decoded.right;
130
- const errors = collectErrors(value);
131
- if (errors.length === 0) return { kind: "ok", value };
132
- return { kind: "retry", previousOutput: value, feedback: buildRetryFeedback(errors) };
133
- }
134
- }
135
- return { kind: "retry", previousOutput: err.rawOutput, feedback: buildShapeFeedback(err.message) };
136
- }
137
- throw err;
138
- }
139
- }
140
- function trimOrUndef(s) {
141
- if (typeof s !== "string") return void 0;
142
- const t = s.trim();
143
- return t.length > 0 ? t : void 0;
144
- }
145
- function buildEmit(value) {
146
- const ds = {};
147
- const r = trimOrUndef(value.request);
148
- const d = trimOrUndef(value.data);
149
- const t = trimOrUndef(value.total);
150
- if (r !== void 0) ds.request = r;
151
- if (d !== void 0) ds.data = d;
152
- if (t !== void 0) ds.total = t;
153
- return ds;
154
- }
155
- function buildUserPrompt() {
156
- return [
157
- context.value.trim(),
158
- "",
159
- "# Current configuration",
160
- "",
161
- "```json",
162
- // Including the column shape can hint at expected response fields.
163
- JSON.stringify({
164
- dataSource: props.dataSource ?? null,
165
- columns: props.columns ?? []
166
- }, null, 2),
167
- "```"
168
- ].join("\n");
169
- }
170
- async function onSubmit() {
171
- if (!canSubmit.value) return;
172
- submitting.value = true;
173
- tick.value = 0;
174
- try {
175
- const system = composeCelPrompt({
176
- scope: [
177
- { name: "`request` \u5B57\u6BB5\u53EF\u7528\u53D8\u91CF", context: REQUEST_SCOPE },
178
- { name: "`data` / `total` \u5B57\u6BB5\u53EF\u7528\u53D8\u91CF", context: JSON_SCOPE }
179
- ],
180
- task: TASK
181
- });
182
- const prompt = buildUserPrompt();
183
- let outcome = await callModel(prompt, system);
184
- if (outcome.kind === "retry") {
185
- tick.value = 0;
186
- outcome = await callModel(prompt, system, {
187
- previousOutput: outcome.previousOutput,
188
- feedback: outcome.feedback
189
- });
190
- }
191
- if (outcome.kind === "ok") {
192
- const ds = buildEmit(outcome.value);
193
- if (Object.keys(ds).length > 0) {
194
- emit("apply", ds);
195
- toast.success("\u5DF2\u6839\u636E\u63CF\u8FF0\u751F\u6210\u6570\u636E\u6E90");
196
- } else {
197
- toast.message("AI \u672A\u8FD4\u56DE\u4EFB\u4F55\u53EF\u5E94\u7528\u7684\u5B57\u6BB5");
198
- }
199
- open.value = false;
200
- context.value = "";
201
- return;
202
- }
203
- const last = outcome.previousOutput;
204
- const candidate = last && typeof last === "object" ? last : null;
205
- const usable = candidate && EXPECTED_KEYS.some((k) => k in candidate) ? candidate : tryUnwrap(last);
206
- if (usable && typeof usable === "object") {
207
- const ds = buildEmit(usable);
208
- if (Object.keys(ds).length > 0) {
209
- emit("apply", ds);
210
- toast.message("AI \u8F93\u51FA\u672A\u901A\u8FC7\u6821\u9A8C\uFF0C\u5DF2\u5E94\u7528\u53EF\u89E3\u6790\u7684\u90E8\u5206\uFF0C\u8BF7\u68C0\u67E5");
211
- open.value = false;
212
- context.value = "";
213
- return;
214
- }
215
- }
216
- toast.error("AI \u751F\u6210\u5931\u8D25", { description: "\u6A21\u578B\u672A\u8FD4\u56DE\u53EF\u5E94\u7528\u7684\u5B57\u6BB5\uFF0C\u8BF7\u8C03\u6574\u63CF\u8FF0\u540E\u91CD\u8BD5" });
217
- } catch (err) {
218
- const message = err instanceof Error ? err.message : String(err);
219
- toast.error("AI \u751F\u6210\u5931\u8D25", { description: message });
220
- } finally {
221
- submitting.value = false;
222
- }
223
- }
224
- </script>
225
-
226
- <template>
227
- <Tooltip :delay-duration="180">
228
- <TooltipTrigger as-child>
229
- <button
230
- type="button"
231
- class="ai-trigger"
232
- :disabled="submitting"
233
- @click="onTrigger"
234
- >
235
- <Icon
236
- icon="fluent:magic-wand-20-regular"
237
- class="size-4"
238
- />
239
- </button>
240
- </TooltipTrigger>
241
- <TooltipContent side="right">
242
- AI 生成数据源
243
- </TooltipContent>
244
- </Tooltip>
245
-
246
- <ShwfedModal
247
- v-model:open="open"
248
- content-width="48rem"
249
- :dismissible="!submitting"
250
- >
251
- <template #title>
252
- <span class="flex items-center gap-2">
253
- <Icon
254
- icon="fluent:magic-wand-20-regular"
255
- class="size-5"
256
- />
257
- AI 生成数据源
258
- </span>
259
- </template>
260
- <template #description>
261
- <Markdown
262
- :source="description"
263
- block
264
- class="prose prose-sm prose-zinc max-w-none"
265
- />
266
- </template>
267
-
268
- <form
269
- class="flex flex-col gap-2 py-2"
270
- @submit.prevent="onSubmit"
271
- >
272
- <Textarea
273
- v-model="context"
274
- placeholder="任意上下文,建议包含:&#10;- 接口路径与方法(如 GET /api/users)&#10;- 查询参数与分页约定(page 是否从 1 开始?)&#10;- 示例响应(JSON),尤其是数据列表与总数字段名"
275
- wrap="soft"
276
- class="field-sizing-fixed h-72 max-h-[60vh] resize-none overflow-auto break-all whitespace-pre-wrap font-mono text-xs"
277
- :disabled="submitting"
278
- />
279
- </form>
280
-
281
- <template #footer>
282
- <div class="flex items-center gap-2">
283
- <div
284
- v-if="submitting"
285
- class="mr-auto flex items-center gap-2 text-xs text-muted-foreground"
286
- aria-live="polite"
287
- >
288
- <span
289
- :key="tick"
290
- class="ai-progress-dot"
291
- :class="tick > 0 ? 'is-streaming' : 'is-waiting'"
292
- />
293
- <span>{{ tick > 0 ? "\u6B63\u5728\u63A5\u6536\u6A21\u578B\u8F93\u51FA\u2026" : "\u6B63\u5728\u8BF7\u6C42\u6A21\u578B\u2026" }}</span>
294
- </div>
295
- <Button
296
- type="button"
297
- size="sm"
298
- :disabled="submitting"
299
- @click="open = false"
300
- >
301
- <Icon icon="fluent:dismiss-20-regular" />
302
- 取消
303
- </Button>
304
- <Button
305
- type="button"
306
- variant="primary"
307
- size="sm"
308
- :disabled="!canSubmit"
309
- @click="onSubmit"
310
- >
311
- <Icon
312
- :icon="submitting ? 'fluent:arrow-sync-20-regular' : 'fluent:sparkle-20-regular'"
313
- :class="submitting ? 'animate-spin' : ''"
314
- />
315
- 生成
316
- </Button>
317
- </div>
318
- </template>
319
- </ShwfedModal>
320
- </template>
321
-
322
- <style scoped>
323
- .ai-trigger{align-items:center;border-radius:.25rem;color:#a1a1aa;display:inline-flex;height:1.5rem;justify-content:center;transition:background-color .1s ease,color .1s ease;width:1.5rem}.ai-trigger:hover:not(:disabled){background-color:#f4f4f5;color:var(--primary)}.ai-trigger:disabled{cursor:not-allowed;opacity:.5}.ai-progress-dot{background-color:var(--primary,currentColor);border-radius:9999px;display:inline-block;height:.5rem;width:.5rem}.ai-progress-dot.is-waiting{animation:ai-progress-waiting 1.2s ease-in-out infinite}.ai-progress-dot.is-streaming{animation:ai-progress-kick .32s ease-out}@keyframes ai-progress-waiting{0%,to{opacity:.35;transform:scale(1)}50%{opacity:1;transform:scale(1.15)}}@keyframes ai-progress-kick{0%{opacity:1;transform:scale(1.6)}to{opacity:.7;transform:scale(1)}}
324
- </style>
@@ -1,20 +0,0 @@
1
- type AnyRecord = Record<string, any>;
2
- type __VLS_Props = {
3
- dataSource?: AnyRecord;
4
- columns?: ReadonlyArray<AnyRecord>;
5
- };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- apply: (value: {
8
- request?: string;
9
- data?: string;
10
- total?: string;
11
- }) => any;
12
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
- onApply?: ((value: {
14
- request?: string;
15
- data?: string;
16
- total?: string;
17
- }) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
- declare const _default: typeof __VLS_export;
20
- export default _default;
@@ -1,17 +0,0 @@
1
- Generate a partial **table data source** from the user's free-form description. The output is a single struct with three optional CEL fields: `request` (HttpRequest), `data` (list), `total` (number).
2
-
3
- # Goal
4
-
5
- Translate the user's prompt (API docs / sample response / PRD) into a small, defensive CEL data source. Only emit fields the user addresses; omit the rest.
6
-
7
- # Field guidance
8
-
9
- - `request`: a single `http.get/post/put/patch/delete(path)` builder chain. Use `.query(query)` to splat the search-bar state when relevant; use `pageIndex` / `pageSize` for pagination params. Omit `request` only when the user explicitly says the data is not fetched (comes from an outer scope).
10
- - Do NOT add auth headers (Authorization, access_token, token, etc.) — the http client injects them globally from the user session. Adding them will double up or override the real token.
11
- - If the API's page number is 1-based (sample responses showing `page=1` or `current_page=1` are the tell), use `pageIndex + 1`. If 0-based, use `pageIndex`. Pass `pageSize` directly.
12
- - `data`: a CEL expression that, given `json` (the parsed response), returns the row list. Use optional access (`.?`) and `.orValue([])` for safety.
13
- - `total`: a CEL expression returning the total row count. Omit when the response has no total/count field — the host falls back to client pagination.
14
-
15
- If the context is too sparse to be confident (e.g. no path, no response shape), make the most reasonable guess and keep accessors defensive (optional access + `.orValue` fallbacks). Output CEL source only, one expression per field. Do not wrap in code fences. Do not add comments.
16
-
17
- The current configuration is appended to the user prompt under `Current configuration` — preserve / extend rather than starting from scratch.
@@ -1,11 +0,0 @@
1
- import type { CELContext } from '../cel-context.js';
2
- import celSyntaxGuide from '../../vendor/cel-js/PROMPT.md?raw.js';
3
- export { celSyntaxGuide };
4
- export interface ComposeCelPromptInput {
5
- readonly scope?: ReadonlyArray<{
6
- readonly name: string;
7
- readonly context: CELContext;
8
- }>;
9
- readonly task: string;
10
- }
11
- export declare function composeCelPrompt(input: ComposeCelPromptInput): string;
@@ -1,27 +0,0 @@
1
- import celSyntaxGuide from "../../vendor/cel-js/PROMPT.md?raw";
2
- export { celSyntaxGuide };
3
- function renderScope(scope) {
4
- const lines = [];
5
- for (const { name, context } of scope) {
6
- const entries = Object.entries(context);
7
- if (entries.length === 0) continue;
8
- lines.push(`### ${name}`);
9
- lines.push("");
10
- lines.push("| Variable | Type | Description |");
11
- lines.push("|----------|------|-------------|");
12
- for (const [varName, entry] of entries) {
13
- const desc = (entry.description ?? entry.label).replace(/\|/g, "\\|").replace(/\n/g, " ");
14
- lines.push(`| \`${varName}\` | \`${entry.type}\` | ${desc} |`);
15
- }
16
- lines.push("");
17
- }
18
- return lines.join("\n");
19
- }
20
- export function composeCelPrompt(input) {
21
- const parts = [celSyntaxGuide];
22
- if (input.scope && input.scope.length > 0) {
23
- parts.push("# Variables In Scope", "", renderScope(input.scope));
24
- }
25
- parts.push("# Task", "", input.task);
26
- return parts.join("\n");
27
- }