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