prime-dev-cli 2.0.1 → 2.0.3
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/README.md +132 -0
- package/bin/cli.mjs +6 -5
- package/dist/server/.next/BUILD_ID +1 -1
- package/dist/server/.next/app-build-manifest.json +5 -5
- package/dist/server/.next/build-manifest.json +2 -2
- package/dist/server/.next/cache/.rscinfo +1 -1
- package/dist/server/.next/cache/.tsbuildinfo +1 -1
- package/dist/server/.next/cache/eslint/.cache_1qa5vxt +1 -1
- package/dist/server/.next/fallback-build-manifest.json +2 -2
- package/dist/server/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/server/.next/next-server.js.nft.json +1 -1
- package/dist/server/.next/prerender-manifest.json +12 -12
- package/dist/server/.next/server/app/_not-found/page/app-build-manifest.json +1 -1
- package/dist/server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/_not-found.html +1 -1
- package/dist/server/.next/server/app/_not-found.rsc +2 -2
- package/dist/server/.next/server/app/configuration/page/app-build-manifest.json +2 -2
- package/dist/server/.next/server/app/configuration/page.js.nft.json +1 -1
- package/dist/server/.next/server/app/configuration/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/configuration.html +1 -1
- package/dist/server/.next/server/app/configuration.rsc +3 -3
- package/dist/server/.next/server/app/index.html +1 -1
- package/dist/server/.next/server/app/index.rsc +2 -2
- package/dist/server/.next/server/app/initialization/page/app-build-manifest.json +1 -1
- package/dist/server/.next/server/app/initialization/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/initialization.html +1 -1
- package/dist/server/.next/server/app/initialization.rsc +2 -2
- package/dist/server/.next/server/app/page/app-build-manifest.json +1 -1
- package/dist/server/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/chunks/ssr/_9f432559._.js +57 -0
- package/dist/server/.next/server/chunks/ssr/_9f432559._.js.map +1 -0
- package/dist/server/.next/server/chunks/ssr/_b0947ff2._.js +1 -1
- package/dist/server/.next/server/chunks/ssr/_b0947ff2._.js.map +1 -1
- package/dist/server/.next/server/pages/404.html +1 -1
- package/dist/server/.next/server/pages/500.html +1 -1
- package/dist/server/.next/server/server-reference-manifest.js +1 -1
- package/dist/server/.next/server/server-reference-manifest.json +1 -1
- package/dist/server/.next/static/chunks/50969308f8935cef.js +57 -0
- package/dist/server/.next/static/chunks/7ac838021c9de490.css +3 -0
- package/dist/server/.next/static/chunks/a0356c0f8a18f98a.js.map +1 -0
- package/dist/server/.next/static/chunks/c70911a309736bdf.css.map +1 -0
- package/dist/server/.next/trace +2 -2
- package/package.json +6 -3
- package/plugin-marketplace/.claude-plugin/marketplace.json +16 -0
- package/plugin-marketplace/plugins/prime-dev-cli/.claude-plugin/plugin.json +9 -0
- package/plugin-marketplace/plugins/prime-dev-cli/README.md +48 -0
- package/plugin-marketplace/plugins/prime-dev-cli/skills/prime-workspace/SKILL.md +55 -0
- package/skills/prime-workspace/README.md +109 -0
- package/skills/prime-workspace/SKILL.md +347 -0
- package/dist/server/.next/server/chunks/ssr/_5579d68f._.js +0 -57
- package/dist/server/.next/server/chunks/ssr/_5579d68f._.js.map +0 -1
- package/dist/server/.next/static/chunks/511924c894f8e3de.css.map +0 -1
- package/dist/server/.next/static/chunks/51208386dbc1874e.js.map +0 -1
- package/dist/server/.next/static/chunks/861aac2fba8d4e28.css +0 -3
- package/dist/server/.next/static/chunks/8c850efc5ffddd02.js +0 -57
- /package/dist/server/.next/static/{hKvS6HjDU-eBShMXMQ7An → Ia-qlvzazBlu740_UlpFl}/_buildManifest.js +0 -0
- /package/dist/server/.next/static/{hKvS6HjDU-eBShMXMQ7An → Ia-qlvzazBlu740_UlpFl}/_clientMiddlewareManifest.json +0 -0
- /package/dist/server/.next/static/{hKvS6HjDU-eBShMXMQ7An → Ia-qlvzazBlu740_UlpFl}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prime-workspace
|
|
3
|
+
description: Use this skill to handle prime-dev-cli workspace operations through natural language, such as starting an env like icrc, checking one app's status, creating or editing mock APIs and Mock.js responses, managing mock scenes, switching proxy targets, and updating microapp bindings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prime-workspace
|
|
7
|
+
|
|
8
|
+
This is the platform-neutral execution spec for `prime-dev-cli`.
|
|
9
|
+
|
|
10
|
+
The goal is not to expose raw API endpoints to the user. The goal is to let the user speak naturally, for example:
|
|
11
|
+
- 帮我启动 icrc
|
|
12
|
+
- 停掉 ilink-icrc
|
|
13
|
+
- 看看 iqc 在不在跑
|
|
14
|
+
- 把 icrc 切到 sitnew
|
|
15
|
+
- 给 isource 挂上 ilink-isource
|
|
16
|
+
- 把 /api/user/info 切到异常场景
|
|
17
|
+
|
|
18
|
+
## Preconditions
|
|
19
|
+
|
|
20
|
+
### Default local server
|
|
21
|
+
- Base URL: `http://localhost:52741`
|
|
22
|
+
|
|
23
|
+
### Reachability rule
|
|
24
|
+
Before using any action, first verify that the local server is reachable.
|
|
25
|
+
|
|
26
|
+
If the local server is not reachable:
|
|
27
|
+
- do not fabricate results
|
|
28
|
+
- for packaged users, suggest `prime ui`
|
|
29
|
+
- for repository developers, `pnpm run dev:server` is also acceptable
|
|
30
|
+
|
|
31
|
+
### Configuration source
|
|
32
|
+
Treat the runtime workspace configuration as the source of truth:
|
|
33
|
+
- current workspace/project/env structure comes from `~/.prime-projects.json`
|
|
34
|
+
- do not rely on stale example config fields if runtime data differs
|
|
35
|
+
|
|
36
|
+
## Intent-first action map
|
|
37
|
+
|
|
38
|
+
Do not think in terms of endpoints first. Think in terms of user intent first.
|
|
39
|
+
|
|
40
|
+
### 1. Workspace status
|
|
41
|
+
Typical requests:
|
|
42
|
+
- 看下工作空间状态
|
|
43
|
+
- 哪些项目还没准备好
|
|
44
|
+
- 项目空间现在什么情况
|
|
45
|
+
|
|
46
|
+
Use:
|
|
47
|
+
- `GET /api/check-workspace`
|
|
48
|
+
- `GET /api/process/status`
|
|
49
|
+
|
|
50
|
+
Return:
|
|
51
|
+
- whether workspace exists
|
|
52
|
+
- project counts
|
|
53
|
+
- existing / pending / incomplete projects
|
|
54
|
+
- currently running envs
|
|
55
|
+
|
|
56
|
+
### 2. Project drill-down
|
|
57
|
+
Typical requests:
|
|
58
|
+
- 看下 esource-fe
|
|
59
|
+
- 看下 esource-fe 分支
|
|
60
|
+
- 打开 esource-fe
|
|
61
|
+
- 给我建个 ilink-fe 和 iqc-fe 的工作区
|
|
62
|
+
|
|
63
|
+
Use as needed:
|
|
64
|
+
- `GET /api/project-config?project=<projectName>`
|
|
65
|
+
- `GET /api/current-branch?project=<projectName>`
|
|
66
|
+
- `POST /api/open-project`
|
|
67
|
+
- `POST /api/workspace/create`
|
|
68
|
+
|
|
69
|
+
### 3. Start / stop / status / logs
|
|
70
|
+
Typical requests:
|
|
71
|
+
- 帮我启动 icrc
|
|
72
|
+
- 停掉 ilink-icrc
|
|
73
|
+
- 看看 iqc 在不在跑
|
|
74
|
+
- 打开 isource 的日志
|
|
75
|
+
|
|
76
|
+
Use:
|
|
77
|
+
- `POST /api/process/start`
|
|
78
|
+
- `DELETE /api/process/start?projectName=<projectName>&envName=<envName>`
|
|
79
|
+
- `GET /api/process/status?projectName=<projectName>&envName=<envName>`
|
|
80
|
+
- `GET /api/process/logs?projectName=<projectName>&envName=<envName>&tail=100`
|
|
81
|
+
|
|
82
|
+
When starting one env:
|
|
83
|
+
- use that env's configured `startCommand`
|
|
84
|
+
- report the access URL from that env's configured `host`
|
|
85
|
+
- prefer output like:
|
|
86
|
+
- 已启动 icrc
|
|
87
|
+
- 访问地址:`http://localhost:8806`
|
|
88
|
+
|
|
89
|
+
### 4. Mock project-level control
|
|
90
|
+
Typical requests:
|
|
91
|
+
- 打开 iqc-fe 的 mock 功能
|
|
92
|
+
- 关闭 iqc-fe 的 mock 功能
|
|
93
|
+
- 打开 iqc-fe 的 mock 拦截
|
|
94
|
+
- 关闭 iqc-fe 的 mock 拦截
|
|
95
|
+
|
|
96
|
+
Use:
|
|
97
|
+
- `GET /api/project-config?project=<projectName>`
|
|
98
|
+
- `PUT /api/project-config`
|
|
99
|
+
|
|
100
|
+
Project-level mock fields:
|
|
101
|
+
- `mockOpen`
|
|
102
|
+
- `mockingIntercept`
|
|
103
|
+
|
|
104
|
+
### 5. Mock scene management
|
|
105
|
+
Typical requests:
|
|
106
|
+
- 看 mock 列表
|
|
107
|
+
- 把 /api/user/info 切到异常场景
|
|
108
|
+
- 新建一个超时场景
|
|
109
|
+
- 打开这个场景
|
|
110
|
+
- 关闭这个场景
|
|
111
|
+
- 预览 GET /api/user/info 现在返回什么
|
|
112
|
+
|
|
113
|
+
Use:
|
|
114
|
+
- `GET /api/mock-file?project=<projectName>`
|
|
115
|
+
- `POST /api/mock-file`
|
|
116
|
+
- `GET /api/mock-file-content?project=<projectName>&apiName=<apiName>&method=<method>&siteName=<siteName>`
|
|
117
|
+
- `PUT /api/mock-file-content`
|
|
118
|
+
- `PUT /api/mock-setting`
|
|
119
|
+
- `PUT /api/mock-open-status`
|
|
120
|
+
- `GET /api/get-mock-data?project=<projectName>&url=<url>&method=<method>`
|
|
121
|
+
|
|
122
|
+
### 6. Mock deletion and bulk toggles
|
|
123
|
+
Typical requests:
|
|
124
|
+
- 删除这个 mock 场景
|
|
125
|
+
- 删除整个 /api/user mock 接口
|
|
126
|
+
- 一键开启所有 mock
|
|
127
|
+
- 一键关闭所有 mock
|
|
128
|
+
|
|
129
|
+
Use:
|
|
130
|
+
- `DELETE /api/mock-file?project=<projectName>&apiName=<apiName>&method=<method>&siteName=<siteName>`
|
|
131
|
+
- `DELETE /api/delete-mock-api?project=<projectName>&apiName=<apiName>`
|
|
132
|
+
- `POST /api/open-all-mock`
|
|
133
|
+
- `POST /api/cleanup-mock`
|
|
134
|
+
|
|
135
|
+
### 7. Proxy viewing and editing
|
|
136
|
+
Typical requests:
|
|
137
|
+
- 看 icrc 现在走哪个代理
|
|
138
|
+
- 把 icrc 切到 sitnew
|
|
139
|
+
- 把 ilink 的 /icrc-api 切到 uat
|
|
140
|
+
- 给 ispar 新增 /idea-api
|
|
141
|
+
|
|
142
|
+
Use:
|
|
143
|
+
- `GET /api/project-config?project=<projectName>`
|
|
144
|
+
- `PUT /api/project-config`
|
|
145
|
+
|
|
146
|
+
### 8. MicroApp bindings
|
|
147
|
+
Typical requests:
|
|
148
|
+
- 看 icrc 挂了哪些微应用
|
|
149
|
+
- 给 isource 挂上 ilink-isource
|
|
150
|
+
- 清空 iua 的微应用代理
|
|
151
|
+
|
|
152
|
+
Use:
|
|
153
|
+
- `GET /api/all-projects-envs`
|
|
154
|
+
- `PUT /api/microapp-proxy-config`
|
|
155
|
+
|
|
156
|
+
## Natural-language routing rules
|
|
157
|
+
|
|
158
|
+
### Project vs env interpretation
|
|
159
|
+
Normalize both forms:
|
|
160
|
+
- `project` / `projectName`
|
|
161
|
+
- `env` / `envName`
|
|
162
|
+
|
|
163
|
+
Interpretation priority:
|
|
164
|
+
- start / stop / logs / proxy / microapp -> prefer **env**
|
|
165
|
+
- open project / branch / workspace creation -> prefer **project**
|
|
166
|
+
|
|
167
|
+
Examples:
|
|
168
|
+
- `帮我启动 icrc` -> treat `icrc` as an env
|
|
169
|
+
- `打开 ilink-fe` -> treat `ilink-fe` as a project
|
|
170
|
+
- `打开 ilink` -> ambiguous, ask whether the user means the project or the env
|
|
171
|
+
|
|
172
|
+
### Access URL rule
|
|
173
|
+
When an env is running or has just been started:
|
|
174
|
+
- derive the user-facing URL from that env's configured `host`
|
|
175
|
+
- if process APIs also return a port, still prefer `host` as the primary display URL
|
|
176
|
+
|
|
177
|
+
### Project workspace vs editor workspace
|
|
178
|
+
These are different intents:
|
|
179
|
+
- “创建项目空间” -> initialize/repair local repos
|
|
180
|
+
- “创建工作区” -> create/open a multi-project editor workspace
|
|
181
|
+
|
|
182
|
+
Do not collapse them into one action.
|
|
183
|
+
|
|
184
|
+
## Confirmation matrix
|
|
185
|
+
|
|
186
|
+
Always confirm before:
|
|
187
|
+
- deleting one mock scene
|
|
188
|
+
- deleting a whole mock API
|
|
189
|
+
- opening all mock scenes
|
|
190
|
+
- closing all mock scenes
|
|
191
|
+
- changing microapp selections
|
|
192
|
+
- changing proxies when multiple prefixes may match
|
|
193
|
+
|
|
194
|
+
Also explain why confirmation is needed.
|
|
195
|
+
|
|
196
|
+
## Required input rules
|
|
197
|
+
|
|
198
|
+
### Starting one env
|
|
199
|
+
To start an env reliably, determine:
|
|
200
|
+
- `projectName`
|
|
201
|
+
- `envName`
|
|
202
|
+
- `startCommand` from runtime config
|
|
203
|
+
- `host` from runtime config
|
|
204
|
+
|
|
205
|
+
If the env name maps cleanly to one configured env, proceed.
|
|
206
|
+
If multiple matches exist, ask a follow-up question.
|
|
207
|
+
|
|
208
|
+
### Proxy edits
|
|
209
|
+
For proxy edits, determine:
|
|
210
|
+
- `projectName`
|
|
211
|
+
- `envName`
|
|
212
|
+
- target prefix
|
|
213
|
+
- target proxy name or custom URL
|
|
214
|
+
- optional rewrite settings
|
|
215
|
+
|
|
216
|
+
If the env has multiple prefixes and the user did not specify which one, ask.
|
|
217
|
+
|
|
218
|
+
### Mock scene operations
|
|
219
|
+
For mock scene operations, determine:
|
|
220
|
+
- `projectName`
|
|
221
|
+
- `apiName`
|
|
222
|
+
- `method`
|
|
223
|
+
- `siteName`
|
|
224
|
+
|
|
225
|
+
Use “scene” as the user-facing term.
|
|
226
|
+
|
|
227
|
+
### MicroApp edits
|
|
228
|
+
For microapp operations, determine:
|
|
229
|
+
- `projectName`
|
|
230
|
+
- `envName`
|
|
231
|
+
- `selectedItems`
|
|
232
|
+
|
|
233
|
+
Important:
|
|
234
|
+
- `selectedItems` are env-name strings
|
|
235
|
+
- they are not full project/env identifiers
|
|
236
|
+
- explain this if the operation may affect expectations
|
|
237
|
+
|
|
238
|
+
## Request examples
|
|
239
|
+
|
|
240
|
+
### Workspace status
|
|
241
|
+
```http
|
|
242
|
+
GET /api/check-workspace
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Project config
|
|
246
|
+
```http
|
|
247
|
+
GET /api/project-config?project=esource-fe
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### One env status
|
|
251
|
+
```http
|
|
252
|
+
GET /api/process/status?projectName=esource-fe&envName=icrc
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Start one env
|
|
256
|
+
```http
|
|
257
|
+
POST /api/process/start
|
|
258
|
+
Content-Type: application/json
|
|
259
|
+
|
|
260
|
+
{
|
|
261
|
+
"projectName": "esource-fe",
|
|
262
|
+
"envName": "icrc",
|
|
263
|
+
"startCommand": "npm run serve:c"
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Switch current mock scene
|
|
268
|
+
```http
|
|
269
|
+
PUT /api/mock-setting
|
|
270
|
+
Content-Type: application/json
|
|
271
|
+
|
|
272
|
+
{
|
|
273
|
+
"projectName": "iqc-fe",
|
|
274
|
+
"apiName": "api_user_info",
|
|
275
|
+
"method": "get",
|
|
276
|
+
"currentSite": "异常场景"
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Update env proxy config
|
|
281
|
+
```http
|
|
282
|
+
PUT /api/project-config
|
|
283
|
+
Content-Type: application/json
|
|
284
|
+
|
|
285
|
+
{
|
|
286
|
+
"projectName": "esource-fe",
|
|
287
|
+
"envName": "icrc",
|
|
288
|
+
"apiProxies": []
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Update microapp bindings
|
|
293
|
+
```http
|
|
294
|
+
PUT /api/microapp-proxy-config
|
|
295
|
+
Content-Type: application/json
|
|
296
|
+
|
|
297
|
+
{
|
|
298
|
+
"projectName": "isource-fe",
|
|
299
|
+
"envName": "isource",
|
|
300
|
+
"selectedItems": ["ilink-isource"]
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Friendly usage examples
|
|
305
|
+
|
|
306
|
+
### Workspace / project / branch
|
|
307
|
+
- 看下工作空间状态
|
|
308
|
+
- 打开 esource-fe
|
|
309
|
+
- 给我建个 ilink-fe 和 iqc-fe 的工作区
|
|
310
|
+
- 看下 esource-fe 分支
|
|
311
|
+
|
|
312
|
+
### Start / stop / status / logs
|
|
313
|
+
- 帮我启动 icrc
|
|
314
|
+
- 停掉 ilink-icrc
|
|
315
|
+
- 看看 iqc 在不在跑
|
|
316
|
+
- 打开 isource 的日志
|
|
317
|
+
|
|
318
|
+
### Proxy
|
|
319
|
+
- 看 icrc 现在走哪个代理
|
|
320
|
+
- 把 icrc 切到 sitnew
|
|
321
|
+
- 把 ilink 的 /icrc-api 切到 uat
|
|
322
|
+
- 给 ispar 新增 /idea-api
|
|
323
|
+
|
|
324
|
+
### Mock
|
|
325
|
+
- 打开 iqc-fe 的 mock 功能
|
|
326
|
+
- 打开 iqc-fe 的 mock 拦截
|
|
327
|
+
- 看 mock 列表
|
|
328
|
+
- 把 /api/user/info 切到异常场景
|
|
329
|
+
- 新建一个超时场景
|
|
330
|
+
- 删除这个 mock 场景
|
|
331
|
+
- 一键关闭所有 mock
|
|
332
|
+
|
|
333
|
+
### MicroApp
|
|
334
|
+
- 看 icrc 挂了哪些微应用
|
|
335
|
+
- 给 isource 挂上 ilink-isource
|
|
336
|
+
- 清空 iua 的微应用代理
|
|
337
|
+
|
|
338
|
+
## Failure handling
|
|
339
|
+
|
|
340
|
+
If an API fails:
|
|
341
|
+
- name the exact action that failed
|
|
342
|
+
- report whether the likely cause is missing project, missing env, missing local workspace, bad input, or server unavailability
|
|
343
|
+
- do not invent missing values
|
|
344
|
+
|
|
345
|
+
If a request is ambiguous:
|
|
346
|
+
- ask one narrow follow-up question
|
|
347
|
+
- prefer clarifying project/env/prefix/scene ambiguity before doing anything destructive
|