@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,366 @@
1
+ dsl: "1.0"
2
+ page:
3
+ id: provider-edit
4
+ title: 编辑 Provider
5
+ name: providerForm
6
+ description: 创建或修改 Provider,并配置上游 Base URL 与 API Key
7
+ dataSources:
8
+ detail:
9
+ type: http
10
+ autoLoad: true
11
+ request:
12
+ method: GET
13
+ url: /api/data/providers/${route.params.code}
14
+ body:
15
+ type: Page
16
+ children:
17
+ - type: Breadcrumb
18
+ props:
19
+ items:
20
+ - label: 模型资产
21
+ - label: Provider
22
+ href: /providers
23
+ - label: ${data.detail.name}
24
+ href: /providers/${route.params.code}
25
+ - label: 编辑
26
+ - type: Card
27
+ children:
28
+ - type: Flex
29
+ props:
30
+ direction: vertical
31
+ gap: small
32
+ children:
33
+ - type: Typography
34
+ props:
35
+ variant: h3
36
+ text: 编辑 Provider — ${data.detail.name}
37
+ - type: Typography
38
+ props:
39
+ variant: muted
40
+ text: 定义供应商并配置上游连接与 API Key
41
+ - type: Form
42
+ when: ${data.detail != null}
43
+ props:
44
+ layout: vertical
45
+ initialValues:
46
+ code: ${data.detail.code}
47
+ name: ${data.detail.name}
48
+ providerType: ${data.detail.providerType}
49
+ protocol: ${data.detail.protocol}
50
+ status: ${data.detail.status}
51
+ description: ${data.detail.description}
52
+ baseUrl: ${data.detail.baseUrl}
53
+ region: ${data.detail.region}
54
+ timeout: ${data.detail.timeout}
55
+ proxy: ${data.detail.proxy}
56
+ capabilityExtension: ${data.detail.capabilityExtension}
57
+ events:
58
+ onSubmit:
59
+ - id: cfm
60
+ action: confirm
61
+ condition: ${event.status == 'disabled'}
62
+ params:
63
+ title: 确认停用 Provider
64
+ content: 停用后,该 Provider 将无法被新建 Model / Target 引用。⚠ 存在 ONLINE Target
65
+ 引用时,建议先完成切换再停用。(演示)
66
+ - action: if
67
+ params:
68
+ condition: ${event.status != 'disabled' || actions.cfm}
69
+ then:
70
+ - action: message
71
+ params:
72
+ messageType: success
73
+ text: Provider 已保存(演示:静态页面不落库)
74
+ - action: navigate
75
+ params:
76
+ to: /providers/${route.params.code}
77
+ children:
78
+ - type: Flex
79
+ props:
80
+ direction: vertical
81
+ gap: middle
82
+ children:
83
+ - type: Card
84
+ props:
85
+ title: 基本信息
86
+ children:
87
+ - type: Grid
88
+ props:
89
+ columns: 2
90
+ gap: 16
91
+ className: "[&>[data-slot=grid-item]:last-child]:col-span-full"
92
+ children:
93
+ - type: Field
94
+ children:
95
+ - type: Flex
96
+ props:
97
+ justify: space-between
98
+ align: center
99
+ className: w-full mb-3.5
100
+ children:
101
+ - type: Flex
102
+ props:
103
+ align: center
104
+ className: gap-0.5
105
+ children:
106
+ - type: Text
107
+ props:
108
+ text: "*"
109
+ className: text-destructive text-sm leading-none
110
+ - type: Label
111
+ props:
112
+ text: Provider Code
113
+ - type: Text
114
+ props:
115
+ text: Provider Code 创建后不可修改
116
+ type: secondary
117
+ className: text-xs leading-none
118
+ - type: Input
119
+ props:
120
+ name: code
121
+ className: w-full
122
+ placeholder: 小写 + 数字 + 连字符,如 openai
123
+ disabled: true
124
+ rules:
125
+ - required: true
126
+ message: 请输入 Provider Code
127
+ - type: Field
128
+ props:
129
+ label: Provider Name
130
+ required: true
131
+ children:
132
+ - type: Input
133
+ props:
134
+ name: name
135
+ className: w-full
136
+ placeholder: 1–64 字符
137
+ rules:
138
+ - required: true
139
+ message: 请输入 Provider Name
140
+ - type: Field
141
+ props:
142
+ label: Provider Type
143
+ required: true
144
+ children:
145
+ - type: Select
146
+ props:
147
+ name: providerType
148
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
149
+ options:
150
+ - label: 商业
151
+ value: 商业
152
+ - label: 云服务
153
+ value: 云服务
154
+ - label: 私有
155
+ value: 私有
156
+ - label: 自定义
157
+ value: 自定义
158
+ rules:
159
+ - required: true
160
+ message: 请选择 Provider Type
161
+ - type: Field
162
+ props:
163
+ label: Default Protocol
164
+ required: true
165
+ children:
166
+ - type: Select
167
+ props:
168
+ name: protocol
169
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
170
+ options:
171
+ - label: OpenAI Compatible
172
+ value: OpenAI Compatible
173
+ - label: Anthropic Messages
174
+ value: Anthropic Messages
175
+ - label: Gemini
176
+ value: Gemini
177
+ - label: DashScope
178
+ value: DashScope
179
+ - label: 自定义
180
+ value: 自定义
181
+ rules:
182
+ - required: true
183
+ message: 请选择 Default Protocol
184
+ - type: Field
185
+ props:
186
+ label: Status
187
+ children:
188
+ - type: RadioGroup
189
+ props:
190
+ name: status
191
+ direction: horizontal
192
+ options:
193
+ - label: 启用
194
+ value: enabled
195
+ - label: 停用
196
+ value: disabled
197
+ - type: Field
198
+ props:
199
+ label: Description
200
+ children:
201
+ - type: Textarea
202
+ props:
203
+ name: description
204
+ className: w-full
205
+ placeholder: 最长 500 字符
206
+ rows: 3
207
+ - type: Card
208
+ props:
209
+ title: 连接与凭证
210
+ children:
211
+ - type: Alert
212
+ props:
213
+ showIcon: true
214
+ variant: info
215
+ className: mb-4
216
+ message: 配置 Runtime 访问上游模型服务时使用的地址与 API Key
217
+ - type: Grid
218
+ props:
219
+ columns: 2
220
+ gap: 16
221
+ className: mt-2
222
+ children:
223
+ - type: Field
224
+ props:
225
+ label: Base URL
226
+ required: true
227
+ children:
228
+ - type: Input
229
+ props:
230
+ name: baseUrl
231
+ className: w-full
232
+ placeholder: https://api.openai.com/v1
233
+ rules:
234
+ - required: true
235
+ message: 请输入 Base URL(合法 HTTPS URL)
236
+ - type: Field
237
+ props:
238
+ label: Region
239
+ children:
240
+ - type: Input
241
+ props:
242
+ name: region
243
+ className: w-full
244
+ placeholder: 如 us-east、cn-beijing
245
+ - type: Field
246
+ children:
247
+ - type: Flex
248
+ props:
249
+ justify: space-between
250
+ align: center
251
+ className: w-full mb-3.5
252
+ children:
253
+ - type: Flex
254
+ props:
255
+ align: center
256
+ className: gap-0.5
257
+ children:
258
+ - type: Text
259
+ props:
260
+ text: "*"
261
+ className: text-destructive text-sm leading-none
262
+ - type: Label
263
+ props:
264
+ text: API Key
265
+ - type: Text
266
+ props:
267
+ text: "当前状态:${data.detail.keyStatus == 'configured' ? '● 已配置(' +
268
+ data.detail.maskedKey + ')' : '● 未配置'}"
269
+ type: secondary
270
+ className: text-xs leading-none
271
+ - type: Input
272
+ props:
273
+ name: apiKey
274
+ className: w-full
275
+ type: password
276
+ placeholder: 留空表示不修改
277
+ - type: Field
278
+ props:
279
+ label: Timeout (ms)
280
+ children:
281
+ - type: NumberInput
282
+ props:
283
+ name: timeout
284
+ className: w-full
285
+ min: 0
286
+ precision: 0
287
+ placeholder: "60000"
288
+ - type: Field
289
+ props:
290
+ label: Proxy
291
+ children:
292
+ - type: Input
293
+ props:
294
+ name: proxy
295
+ className: w-full
296
+ placeholder: 可选代理地址
297
+ - type: Flex
298
+ props:
299
+ align: center
300
+ gap: middle
301
+ className: h-full
302
+ children:
303
+ - type: Button
304
+ props:
305
+ text: 测试连接
306
+ className: mt-[2px]
307
+ events:
308
+ onClick:
309
+ - action: message
310
+ params:
311
+ messageType: success
312
+ text: 连接测试成功:HTTP 200, 128ms(演示:不持久化未保存字段)
313
+ - type: Text
314
+ props:
315
+ text: 保存前建议先测试 Base URL 与 API Key 是否有效
316
+ type: secondary
317
+ className: text-xs
318
+ - type: Card
319
+ props:
320
+ title: 能力扩展(Capability Extension)
321
+ children:
322
+ - type: Field
323
+ props:
324
+ label: JSON 模式
325
+ children:
326
+ - type: Textarea
327
+ props:
328
+ name: capabilityExtension
329
+ rows: 5
330
+ className: font-mono w-full
331
+ placeholder: '{ "supports_responses": true }'
332
+ - type: Flex
333
+ props:
334
+ justify: end
335
+ className: mt-4
336
+ children:
337
+ - type: Button
338
+ props:
339
+ text: 取消
340
+ icon: x
341
+ events:
342
+ onClick:
343
+ - action: navigate
344
+ params:
345
+ to: /providers/${route.params.code}
346
+ - type: Button
347
+ props:
348
+ text: 保存
349
+ icon: save
350
+ variant: primary
351
+ submit: true
352
+ - type: Empty
353
+ when: ${data.detail == null && !dataStatus.detail.loading}
354
+ props:
355
+ title: 未找到 Provider
356
+ description: Provider Code「${route.params.code}」不存在或已被删除
357
+ children:
358
+ - type: Button
359
+ props:
360
+ text: 返回列表
361
+ variant: primary
362
+ events:
363
+ onClick:
364
+ - action: navigate
365
+ params:
366
+ to: /providers