@pactor-app/skills 1.24.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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/package.json +26 -0
  4. package/pactor/SKILL.md +373 -0
  5. package/pactor/references/dsl-authoring.md +448 -0
  6. package/prd-to-app/SKILL.md +75 -0
  7. package/prd-to-app/references/acceptance-checklist.md +47 -0
  8. package/prd-to-app/references/component-mapping.md +41 -0
  9. package/prd-to-app/references/mock-data-routes.md +66 -0
  10. package/prd-to-app/references/page-templates.md +274 -0
  11. package/prd-to-app/references/project-structure.md +89 -0
  12. package/prd-to-app/references/theme-and-style.md +41 -0
  13. package/prd-to-app/template/README.md +26 -0
  14. package/prd-to-app/template/app/[[...slug]]/page.tsx +7 -0
  15. package/prd-to-app/template/app/api/auth/login/route.ts +32 -0
  16. package/prd-to-app/template/app/api/auth/logout/route.ts +22 -0
  17. package/prd-to-app/template/app/api/data/[...parts]/route.ts +118 -0
  18. package/prd-to-app/template/app/api/public/pages/[id]/route.ts +40 -0
  19. package/prd-to-app/template/app/api/sitemap/route.ts +21 -0
  20. package/prd-to-app/template/app/api/users/route.ts +57 -0
  21. package/prd-to-app/template/app/favicon.ico +0 -0
  22. package/prd-to-app/template/app/globals.css +248 -0
  23. package/prd-to-app/template/app/layout.tsx +49 -0
  24. package/prd-to-app/template/app/login.css +122 -0
  25. package/prd-to-app/template/eslint.config.mjs +18 -0
  26. package/prd-to-app/template/next-env.d.ts +7 -0
  27. package/prd-to-app/template/next.config.js +32 -0
  28. package/prd-to-app/template/package.json +34 -0
  29. package/prd-to-app/template/pnpm-lock.yaml +6854 -0
  30. package/prd-to-app/template/pnpm-workspace.yaml +7 -0
  31. package/prd-to-app/template/postcss.config.mjs +7 -0
  32. package/prd-to-app/template/public/file.svg +1 -0
  33. package/prd-to-app/template/public/globe.svg +1 -0
  34. package/prd-to-app/template/public/next.svg +1 -0
  35. package/prd-to-app/template/public/skins/chenwunaifu.css +111 -0
  36. package/prd-to-app/template/public/skins/taijingshenlin.css +109 -0
  37. package/prd-to-app/template/public/skins/xuanzhimoyun.css +110 -0
  38. package/prd-to-app/template/public/vercel.svg +1 -0
  39. package/prd-to-app/template/public/window.svg +1 -0
  40. package/prd-to-app/template/scripts/build.mjs +35 -0
  41. package/prd-to-app/template/src/pactor/App.tsx +55 -0
  42. package/prd-to-app/template/src/pactor/actions.ts +438 -0
  43. package/prd-to-app/template/src/pactor/components/card-links.tsx +86 -0
  44. package/prd-to-app/template/src/pactor/components/chip-filter.tsx +89 -0
  45. package/prd-to-app/template/src/pactor/components/chip-node.tsx +46 -0
  46. package/prd-to-app/template/src/pactor/components/debug-chat.tsx +189 -0
  47. package/prd-to-app/template/src/pactor/components/index.ts +28 -0
  48. package/prd-to-app/template/src/pactor/components/log-status.tsx +64 -0
  49. package/prd-to-app/template/src/pactor/components/status-badge.tsx +46 -0
  50. package/prd-to-app/template/src/pactor/components/theme-switcher.tsx +136 -0
  51. package/prd-to-app/template/src/pactor/config.ts +28 -0
  52. package/prd-to-app/template/src/pactor/mocks/audit-mock.ts +403 -0
  53. package/prd-to-app/template/src/pactor/mocks/call-logs-mock.ts +875 -0
  54. package/prd-to-app/template/src/pactor/mocks/client-debug-mock.ts +188 -0
  55. package/prd-to-app/template/src/pactor/mocks/client-templates-mock.ts +497 -0
  56. package/prd-to-app/template/src/pactor/mocks/clients-mock.ts +483 -0
  57. package/prd-to-app/template/src/pactor/mocks/costs-mock.ts +406 -0
  58. package/prd-to-app/template/src/pactor/mocks/dashboard-mock.ts +192 -0
  59. package/prd-to-app/template/src/pactor/mocks/model-debug-mock.ts +144 -0
  60. package/prd-to-app/template/src/pactor/mocks/models-mock.ts +799 -0
  61. package/prd-to-app/template/src/pactor/mocks/ops-usage-mock.ts +806 -0
  62. package/prd-to-app/template/src/pactor/mocks/providers-mock.ts +424 -0
  63. package/prd-to-app/template/src/pactor/mocks/routes-mock.ts +604 -0
  64. package/prd-to-app/template/src/pactor/services.ts +185 -0
  65. package/prd-to-app/template/src/pactor/skin.ts +52 -0
  66. package/prd-to-app/template/src/server/accounts.ts +63 -0
  67. package/prd-to-app/template/src/server/cors.ts +34 -0
  68. package/prd-to-app/template/src/server/sitemap.ts +176 -0
  69. package/prd-to-app/template/src/server/yaml/common/dashboard.yaml +498 -0
  70. package/prd-to-app/template/src/server/yaml/common/login.yaml +84 -0
  71. package/prd-to-app/template/src/server/yaml/provider/provider-create.yaml +340 -0
  72. package/prd-to-app/template/src/server/yaml/provider/provider-detail.yaml +780 -0
  73. package/prd-to-app/template/src/server/yaml/provider/provider-edit.yaml +366 -0
  74. package/prd-to-app/template/src/server/yaml/provider/provider-list.yaml +1989 -0
  75. package/prd-to-app/template/src/server/yaml/route/route-create.yaml +511 -0
  76. package/prd-to-app/template/src/server/yaml/route/route-detail.yaml +610 -0
  77. package/prd-to-app/template/src/server/yaml/route/route-edit.yaml +809 -0
  78. package/prd-to-app/template/src/server/yaml/route/route-list.yaml +1793 -0
  79. package/prd-to-app/template/src/server/yaml/sitemap.yaml +250 -0
  80. package/prd-to-app/template/tsconfig.json +34 -0
@@ -0,0 +1,511 @@
1
+ dsl: "1.0"
2
+ page:
3
+ id: route-create
4
+ title: 新增路由
5
+ name: routeForm
6
+ description: 创建或修改 Route:基本信息、入口配置与模型路由策略
7
+ body:
8
+ type: Page
9
+ children:
10
+ - type: Breadcrumb
11
+ props:
12
+ items:
13
+ - label: 模型路由
14
+ - label: 路由
15
+ href: /routes
16
+ - label: 新增路由
17
+ - type: Card
18
+ children:
19
+ - type: Flex
20
+ props:
21
+ direction: vertical
22
+ gap: small
23
+ children:
24
+ - type: Typography
25
+ props:
26
+ variant: h3
27
+ text: 新建路由
28
+ - type: Typography
29
+ props:
30
+ variant: muted
31
+ text: 在单一页面完成路由配置:基本信息、请求路径、协议格式与模型调度策略。不使用画布,不配置降级。
32
+ - type: Form
33
+ props:
34
+ layout: vertical
35
+ initialValues:
36
+ type: pool
37
+ protocol: OpenAI / Chat Completions
38
+ operation: chat.completions
39
+ strategy: WEIGHTED
40
+ healthFilter: on
41
+ events:
42
+ onSubmit:
43
+ - action: message
44
+ params:
45
+ messageType: success
46
+ text: 路由「${event.name}」已创建并启用(演示)
47
+ - action: navigate
48
+ params:
49
+ to: /routes
50
+ children:
51
+ - type: Flex
52
+ props:
53
+ direction: vertical
54
+ gap: middle
55
+ children:
56
+ - type: Card
57
+ props:
58
+ title: ① 基本信息
59
+ children:
60
+ - type: Grid
61
+ props:
62
+ columns: 2
63
+ gap: 16
64
+ children:
65
+ - type: Field
66
+ props:
67
+ label: 路由名称
68
+ required: true
69
+ children:
70
+ - type: Input
71
+ props:
72
+ name: name
73
+ className: w-full
74
+ placeholder: 展示名,如 推理模型默认路由
75
+ rules:
76
+ - required: true
77
+ message: 请输入路由名称
78
+ - type: Field
79
+ children:
80
+ - type: Flex
81
+ props:
82
+ justify: space-between
83
+ align: center
84
+ className: w-full mb-3.5
85
+ children:
86
+ - type: Flex
87
+ props:
88
+ align: center
89
+ className: gap-0.5
90
+ children:
91
+ - type: Text
92
+ props:
93
+ text: "*"
94
+ className: text-destructive text-sm leading-none
95
+ - type: Label
96
+ props:
97
+ text: 路由标识
98
+ - type: Text
99
+ props:
100
+ text: 路由标识 创建后不可修改
101
+ type: secondary
102
+ className: text-xs leading-none
103
+ - type: Input
104
+ props:
105
+ name: code
106
+ className: w-full
107
+ placeholder: 小写 + 数字 + 连字符,如 reasoning-default
108
+ disabled: false
109
+ rules:
110
+ - required: true
111
+ message: 请输入路由标识
112
+ - type: Field
113
+ props:
114
+ label: 类型
115
+ required: true
116
+ children:
117
+ - type: RadioGroup
118
+ props:
119
+ name: type
120
+ direction: horizontal
121
+ options:
122
+ - label: 单模型
123
+ value: single
124
+ - label: 多模型池
125
+ value: pool
126
+ - label: 条件路由
127
+ value: conditional
128
+ className: mt-2
129
+ - type: Field
130
+ props:
131
+ label: 逻辑模型 Alias
132
+ children:
133
+ - type: Input
134
+ props:
135
+ name: alias
136
+ className: w-full
137
+ placeholder: 对外暴露的模型名,如 reasoning
138
+ - type: Field
139
+ props:
140
+ label: 标签
141
+ children:
142
+ - type: Input
143
+ props:
144
+ name: tags
145
+ className: w-full
146
+ placeholder: 逗号分隔:reasoning, premium
147
+ - type: Field
148
+ props:
149
+ label: 描述
150
+ children:
151
+ - type: Textarea
152
+ props:
153
+ name: description
154
+ className: w-full
155
+ rows: 3
156
+ - type: Card
157
+ props:
158
+ title: ② 入口配置
159
+ children:
160
+ - type: Grid
161
+ props:
162
+ columns: 2
163
+ gap: 16
164
+ children:
165
+ - type: Field
166
+ props:
167
+ label: 请求路径
168
+ required: true
169
+ children:
170
+ - type: Input
171
+ props:
172
+ name: path
173
+ className: w-full
174
+ placeholder: /v1/chat/completions
175
+ rules:
176
+ - required: true
177
+ message: 请输入请求路径
178
+ - type: Field
179
+ props:
180
+ label: 协议格式
181
+ required: true
182
+ children:
183
+ - type: Select
184
+ props:
185
+ name: protocol
186
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
187
+ options:
188
+ - label: OpenAI / Chat Completions
189
+ value: OpenAI / Chat Completions
190
+ - label: OpenAI / Responses
191
+ value: OpenAI / Responses
192
+ - label: Anthropic / Messages
193
+ value: Anthropic / Messages
194
+ - label: OpenAI / Embeddings
195
+ value: OpenAI / Embeddings
196
+ rules:
197
+ - required: true
198
+ message: 请选择协议格式
199
+ - type: Field
200
+ props:
201
+ label: Ingress Operation
202
+ children:
203
+ - type: Input
204
+ props:
205
+ name: operation
206
+ className: w-full
207
+ disabled: true
208
+ - type: Button
209
+ props:
210
+ text: 查看协议说明
211
+ icon: eye
212
+ size: small
213
+ variant: link
214
+ className: p-0 h-auto mt-1
215
+ events:
216
+ onClick:
217
+ - id: schemaView
218
+ action: overlay.open
219
+ params:
220
+ overlay:
221
+ type: modal
222
+ title: 协议说明
223
+ width: 560
224
+ content:
225
+ type: Flex
226
+ props:
227
+ direction: vertical
228
+ gap: middle
229
+ children:
230
+ - type: Alert
231
+ props:
232
+ showIcon: true
233
+ variant: info
234
+ message: Ingress Protocol 描述对外请求格式,与 Model「提供商」Tab 中的上游协议无关。
235
+ - type: Text
236
+ props:
237
+ text: '{ "model": "reasoning", "messages": [{ "role": "user", "content": "..."
238
+ }] }'
239
+ className: font-mono text-sm
240
+ - type: Card
241
+ props:
242
+ title: ③ 模型与路由策略
243
+ children:
244
+ - type: Flex
245
+ props:
246
+ justify: space-between
247
+ align: center
248
+ children:
249
+ - type: Text
250
+ props:
251
+ text: 配置模型列表与调度策略;C / M 留空继承 Model「提供商」配置
252
+ type: secondary
253
+ className: text-sm
254
+ - type: Button
255
+ props:
256
+ text: 添加模型
257
+ icon: plus
258
+ variant: primary
259
+ size: small
260
+ events:
261
+ onClick:
262
+ - id: modelResult
263
+ action: overlay.open
264
+ params:
265
+ overlay:
266
+ type: modal
267
+ title: 添加模型
268
+ width: 560
269
+ content:
270
+ type: Form
271
+ props:
272
+ name: routeModel
273
+ initialValues:
274
+ status: enabled
275
+ events:
276
+ onSubmit:
277
+ - action: overlay.close
278
+ params:
279
+ payload:
280
+ ok: true
281
+ children:
282
+ - type: Flex
283
+ props:
284
+ direction: vertical
285
+ gap: middle
286
+ align: stretch
287
+ children:
288
+ - type: Grid
289
+ props:
290
+ columns: 2
291
+ gap: 16
292
+ className: "[&>[data-slot=grid-item]:first-child]:col-span-full"
293
+ children:
294
+ - type: Field
295
+ props:
296
+ label: Model
297
+ required: true
298
+ children:
299
+ - type: Select
300
+ props:
301
+ name: model
302
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
303
+ options:
304
+ - label: GPT-5(gpt-5)
305
+ value: gpt-5
306
+ - label: Qwen3.5 Flash(qwen3.5-flash)
307
+ value: qwen3.5-flash
308
+ - label: Qwen3-VL Plus(qwen3-vl-plus)
309
+ value: qwen3-vl-plus
310
+ - label: Gemini 3 Flash(gemini-3-flash)
311
+ value: gemini-3-flash
312
+ rules:
313
+ - required: true
314
+ message: 请选择 Model
315
+ - type: Field
316
+ props:
317
+ label: 权重
318
+ children:
319
+ - type: NumberInput
320
+ props:
321
+ name: weight
322
+ className: w-full
323
+ min: 0
324
+ precision: 0
325
+ placeholder: "50"
326
+ - type: Field
327
+ props:
328
+ label: 优先级
329
+ children:
330
+ - type: Select
331
+ props:
332
+ name: priority
333
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
334
+ options:
335
+ - label: P0
336
+ value: P0
337
+ - label: P1
338
+ value: P1
339
+ - label: P2
340
+ value: P2
341
+ - type: Field
342
+ props:
343
+ label: 供应成本倍率 C
344
+ children:
345
+ - type: NumberInput
346
+ props:
347
+ name: costRate
348
+ className: w-full
349
+ min: 0
350
+ step: 0.1
351
+ placeholder: 留空继承 Model 提供商配置
352
+ - type: Field
353
+ props:
354
+ label: 用户计费倍率 M
355
+ children:
356
+ - type: NumberInput
357
+ props:
358
+ name: billingRate
359
+ className: w-full
360
+ min: 0
361
+ step: 0.1
362
+ placeholder: 留空继承
363
+ - type: Field
364
+ props:
365
+ label: 状态
366
+ children:
367
+ - type: RadioGroup
368
+ props:
369
+ name: status
370
+ direction: horizontal
371
+ options:
372
+ - label: 启用
373
+ value: enabled
374
+ - label: 停用
375
+ value: disabled
376
+ - type: Flex
377
+ props:
378
+ justify: end
379
+ gap: middle
380
+ children:
381
+ - type: Button
382
+ props:
383
+ text: 取消
384
+ events:
385
+ onClick:
386
+ - action: overlay.close
387
+ - type: Button
388
+ props:
389
+ text: 确认添加
390
+ variant: primary
391
+ submit: true
392
+ - action: if
393
+ params:
394
+ condition: ${actions.modelResult.ok}
395
+ then:
396
+ - action: message
397
+ params:
398
+ messageType: success
399
+ text: 模型已添加(演示:不落库)
400
+ - type: Grid
401
+ props:
402
+ columns: 2
403
+ gap: 16
404
+ className: mt-4 [&>[data-slot=grid-item]:first-child]:col-span-full
405
+ children:
406
+ - type: Field
407
+ props:
408
+ label: 模型路由策略
409
+ required: true
410
+ children:
411
+ - type: Select
412
+ props:
413
+ name: strategy
414
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
415
+ options:
416
+ - label: 加权轮询 (WEIGHTED)
417
+ value: WEIGHTED
418
+ - label: 哈希分配 (HASH)
419
+ value: HASH
420
+ - label: 优先级 (PRIORITY)
421
+ value: PRIORITY
422
+ - label: 轮询 (ROUND_ROBIN)
423
+ value: ROUND_ROBIN
424
+ - label: 随机 (RANDOM)
425
+ value: RANDOM
426
+ - label: 固定 (FIXED)
427
+ value: FIXED
428
+ rules:
429
+ - required: true
430
+ message: 请选择模型路由策略
431
+ - type: Field
432
+ props:
433
+ label: 粘性 Session
434
+ children:
435
+ - type: RadioGroup
436
+ props:
437
+ name: stickySession
438
+ direction: horizontal
439
+ options:
440
+ - label: 开启
441
+ value: on
442
+ - label: 关闭
443
+ value: off
444
+ className: mt-2
445
+ - type: Field
446
+ props:
447
+ label: 健康过滤
448
+ children:
449
+ - type: RadioGroup
450
+ props:
451
+ name: healthFilter
452
+ direction: horizontal
453
+ options:
454
+ - label: 仅调度 HEALTHY 实例
455
+ value: on
456
+ - label: 关闭
457
+ value: off
458
+ className: mt-2
459
+ - type: Text
460
+ props:
461
+ text: 尚未添加模型;保存草稿允许 0 条,启用前至少 1 条启用模型。
462
+ type: secondary
463
+ className: text-sm mt-4
464
+ - type: Flex
465
+ props:
466
+ justify: end
467
+ className: mt-4
468
+ children:
469
+ - type: Flex
470
+ props:
471
+ align: center
472
+ gap: middle
473
+ children:
474
+ - type: Button
475
+ props:
476
+ text: 取消
477
+ icon: x
478
+ events:
479
+ onClick:
480
+ - action: navigate
481
+ params:
482
+ to: /routes
483
+ - type: Button
484
+ props:
485
+ text: 模拟调用
486
+ icon: zap
487
+ events:
488
+ onClick:
489
+ - action: message
490
+ params:
491
+ messageType: info
492
+ text: 模拟调用:用当前未保存配置演算命中模型与策略(演示)
493
+ - type: Button
494
+ props:
495
+ text: 保存草稿
496
+ icon: save
497
+ events:
498
+ onClick:
499
+ - action: message
500
+ params:
501
+ messageType: success
502
+ text: 草稿已保存(演示:静态页面不落库)
503
+ - action: navigate
504
+ params:
505
+ to: /routes
506
+ - type: Button
507
+ props:
508
+ text: 保存并启用
509
+ icon: check-circle
510
+ variant: primary
511
+ submit: true