@coze-arch/cli 0.0.13 → 0.0.14-alpha.c52ee4

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 (76) hide show
  1. package/lib/__templates__/expo/AGENTS.md +15 -7
  2. package/lib/__templates__/expo/README.md +15 -7
  3. package/lib/__templates__/expo/client/eslint.config.mjs +3 -0
  4. package/lib/__templates__/expo/eslint-plugins/expo/index.js +9 -0
  5. package/lib/__templates__/expo/eslint-plugins/expo/rule.js +105 -0
  6. package/lib/__templates__/expo/eslint-plugins/expo/tech.md +108 -0
  7. package/lib/__templates__/nextjs/AGENTS.md +9 -0
  8. package/lib/__templates__/nextjs/eslint.config.mjs +15 -0
  9. package/lib/__templates__/pi-agent/.coze +10 -0
  10. package/lib/__templates__/pi-agent/AGENTS.md +150 -0
  11. package/lib/__templates__/pi-agent/README.md +155 -0
  12. package/lib/__templates__/pi-agent/_gitignore +3 -0
  13. package/lib/__templates__/pi-agent/docs/project-overview.md +273 -0
  14. package/lib/__templates__/pi-agent/docs/user/getting-started.md +46 -0
  15. package/lib/__templates__/pi-agent/package.json +52 -0
  16. package/lib/__templates__/pi-agent/pnpm-lock.yaml +7840 -0
  17. package/lib/__templates__/pi-agent/scripts/dev.sh +14 -0
  18. package/lib/__templates__/pi-agent/scripts/prepare.sh +2 -0
  19. package/lib/__templates__/pi-agent/src/agent.ts +367 -0
  20. package/lib/__templates__/pi-agent/src/channels/feishu/index.ts +760 -0
  21. package/lib/__templates__/pi-agent/src/channels/feishu/streaming-card.ts +297 -0
  22. package/lib/__templates__/pi-agent/src/channels/wechat/index.ts +171 -0
  23. package/lib/__templates__/pi-agent/src/config.ts +596 -0
  24. package/lib/__templates__/pi-agent/src/core.ts +218 -0
  25. package/lib/__templates__/pi-agent/src/dashboard/api/channels.ts +148 -0
  26. package/lib/__templates__/pi-agent/src/dashboard/api/docs.ts +204 -0
  27. package/lib/__templates__/pi-agent/src/dashboard/api/models.ts +141 -0
  28. package/lib/__templates__/pi-agent/src/dashboard/api/overview.ts +33 -0
  29. package/lib/__templates__/pi-agent/src/dashboard/config-store.ts +64 -0
  30. package/lib/__templates__/pi-agent/src/dashboard/index.ts +39 -0
  31. package/lib/__templates__/pi-agent/src/dashboard/server.ts +622 -0
  32. package/lib/__templates__/pi-agent/src/dashboard/types.ts +25 -0
  33. package/lib/__templates__/pi-agent/src/dashboard/web/index.html +13 -0
  34. package/lib/__templates__/pi-agent/src/dashboard/web/postcss.config.cjs +7 -0
  35. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/app-layout.tsx +186 -0
  36. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/page-title.tsx +17 -0
  37. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/alert.tsx +22 -0
  38. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/badge.tsx +25 -0
  39. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/button.tsx +40 -0
  40. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/card.tsx +29 -0
  41. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/input.tsx +18 -0
  42. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/label.tsx +8 -0
  43. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/select.tsx +80 -0
  44. package/lib/__templates__/pi-agent/src/dashboard/web/src/components/ui/separator.tsx +23 -0
  45. package/lib/__templates__/pi-agent/src/dashboard/web/src/hooks/use-fetch.ts +32 -0
  46. package/lib/__templates__/pi-agent/src/dashboard/web/src/hooks/use-local-storage-state.ts +23 -0
  47. package/lib/__templates__/pi-agent/src/dashboard/web/src/main.tsx +30 -0
  48. package/lib/__templates__/pi-agent/src/dashboard/web/src/pages/channels-page.tsx +188 -0
  49. package/lib/__templates__/pi-agent/src/dashboard/web/src/pages/chat-page.tsx +451 -0
  50. package/lib/__templates__/pi-agent/src/dashboard/web/src/pages/docs-page.tsx +65 -0
  51. package/lib/__templates__/pi-agent/src/dashboard/web/src/pages/models-page.tsx +122 -0
  52. package/lib/__templates__/pi-agent/src/dashboard/web/src/pages/overview-page.tsx +134 -0
  53. package/lib/__templates__/pi-agent/src/dashboard/web/src/services/chat-ws-service.ts +167 -0
  54. package/lib/__templates__/pi-agent/src/dashboard/web/src/styles.css +294 -0
  55. package/lib/__templates__/pi-agent/src/dashboard/web/src/utils/index.ts +11 -0
  56. package/lib/__templates__/pi-agent/src/dashboard/web/tsconfig.json +13 -0
  57. package/lib/__templates__/pi-agent/src/dashboard/web/vite.config.ts +17 -0
  58. package/lib/__templates__/pi-agent/src/index.ts +123 -0
  59. package/lib/__templates__/pi-agent/src/session-store.ts +223 -0
  60. package/lib/__templates__/pi-agent/template.config.js +45 -0
  61. package/lib/__templates__/pi-agent/tests/config.test.ts +292 -0
  62. package/lib/__templates__/pi-agent/tests/dashboard-docs-api.test.ts +125 -0
  63. package/lib/__templates__/pi-agent/tests/dashboard-models-api.test.ts +171 -0
  64. package/lib/__templates__/pi-agent/tests/feishu-channel.test.ts +149 -0
  65. package/lib/__templates__/pi-agent/tests/feishu-streaming-card.test.ts +15 -0
  66. package/lib/__templates__/pi-agent/tests/session-store.test.ts +61 -0
  67. package/lib/__templates__/pi-agent/tests/smoke/run-smoke.ts +275 -0
  68. package/lib/__templates__/pi-agent/tsconfig.json +20 -0
  69. package/lib/__templates__/pi-agent/types/larksuiteoapi-node-sdk.d.ts +113 -0
  70. package/lib/__templates__/taro/pnpm-lock.yaml +24 -14
  71. package/lib/__templates__/taro/server/package.json +0 -2
  72. package/lib/__templates__/taro/src/presets/dev-debug.ts +2 -2
  73. package/lib/__templates__/templates.json +24 -0
  74. package/lib/__templates__/vite/AGENTS.md +5 -0
  75. package/lib/cli.js +1 -1
  76. package/package.json +1 -1
@@ -197,9 +197,6 @@ importers:
197
197
  '@supabase/supabase-js':
198
198
  specifier: 2.95.3
199
199
  version: 2.95.3
200
- better-sqlite3:
201
- specifier: ^11.9.1
202
- version: 11.10.0
203
200
  coze-coding-dev-sdk:
204
201
  specifier: ^0.7.16
205
202
  version: 0.7.16(openai@6.16.0(ws@8.19.0)(zod@4.3.5))(ws@8.19.0)
@@ -234,9 +231,6 @@ importers:
234
231
  '@nestjs/schematics':
235
232
  specifier: ^10.2.3
236
233
  version: 10.2.3(chokidar@3.6.0)(typescript@5.9.3)
237
- '@types/better-sqlite3':
238
- specifier: ^7.6.13
239
- version: 7.6.13
240
234
  '@types/express':
241
235
  specifier: 5.0.6
242
236
  version: 5.0.6
@@ -15586,6 +15580,7 @@ snapshots:
15586
15580
  '@types/better-sqlite3@7.6.13':
15587
15581
  dependencies:
15588
15582
  '@types/node': 22.19.6
15583
+ optional: true
15589
15584
 
15590
15585
  '@types/body-parser@1.19.6':
15591
15586
  dependencies:
@@ -16921,6 +16916,7 @@ snapshots:
16921
16916
  dependencies:
16922
16917
  bindings: 1.5.0
16923
16918
  prebuild-install: 7.1.3
16919
+ optional: true
16924
16920
 
16925
16921
  big-integer@1.6.52: {}
16926
16922
 
@@ -16936,6 +16932,7 @@ snapshots:
16936
16932
  bindings@1.5.0:
16937
16933
  dependencies:
16938
16934
  file-uri-to-path: 1.0.0
16935
+ optional: true
16939
16936
 
16940
16937
  bl@1.2.3:
16941
16938
  dependencies:
@@ -17239,7 +17236,8 @@ snapshots:
17239
17236
  dependencies:
17240
17237
  readdirp: 5.0.0
17241
17238
 
17242
- chownr@1.1.4: {}
17239
+ chownr@1.1.4:
17240
+ optional: true
17243
17241
 
17244
17242
  chroma-js@2.6.0: {}
17245
17243
 
@@ -17735,6 +17733,7 @@ snapshots:
17735
17733
  decompress-response@6.0.0:
17736
17734
  dependencies:
17737
17735
  mimic-response: 3.1.0
17736
+ optional: true
17738
17737
 
17739
17738
  decompress-tar@4.1.1:
17740
17739
  dependencies:
@@ -18491,7 +18490,8 @@ snapshots:
18491
18490
 
18492
18491
  exif-parser@0.1.12: {}
18493
18492
 
18494
- expand-template@2.0.3: {}
18493
+ expand-template@2.0.3:
18494
+ optional: true
18495
18495
 
18496
18496
  express@4.21.2:
18497
18497
  dependencies:
@@ -18679,7 +18679,8 @@ snapshots:
18679
18679
 
18680
18680
  file-type@8.1.0: {}
18681
18681
 
18682
- file-uri-to-path@1.0.0: {}
18682
+ file-uri-to-path@1.0.0:
18683
+ optional: true
18683
18684
 
18684
18685
  filename-reserved-regex@2.0.0: {}
18685
18686
 
@@ -18963,7 +18964,8 @@ snapshots:
18963
18964
 
18964
18965
  git-clone@0.1.0: {}
18965
18966
 
18966
- github-from-package@0.0.0: {}
18967
+ github-from-package@0.0.0:
18968
+ optional: true
18967
18969
 
18968
18970
  glob-parent@5.1.2:
18969
18971
  dependencies:
@@ -20214,7 +20216,8 @@ snapshots:
20214
20216
 
20215
20217
  mimic-response@1.0.1: {}
20216
20218
 
20217
- mimic-response@3.1.0: {}
20219
+ mimic-response@3.1.0:
20220
+ optional: true
20218
20221
 
20219
20222
  min-document@2.19.2:
20220
20223
  dependencies:
@@ -20446,7 +20449,8 @@ snapshots:
20446
20449
 
20447
20450
  mkdir-p@0.0.7: {}
20448
20451
 
20449
- mkdirp-classic@0.5.3: {}
20452
+ mkdirp-classic@0.5.3:
20453
+ optional: true
20450
20454
 
20451
20455
  mkdirp@0.5.6:
20452
20456
  dependencies:
@@ -20503,7 +20507,8 @@ snapshots:
20503
20507
 
20504
20508
  nanoid@3.3.11: {}
20505
20509
 
20506
- napi-build-utils@2.0.0: {}
20510
+ napi-build-utils@2.0.0:
20511
+ optional: true
20507
20512
 
20508
20513
  natural-compare@1.4.0: {}
20509
20514
 
@@ -20545,6 +20550,7 @@ snapshots:
20545
20550
  node-abi@3.87.0:
20546
20551
  dependencies:
20547
20552
  semver: 7.7.4
20553
+ optional: true
20548
20554
 
20549
20555
  node-abort-controller@3.1.1: {}
20550
20556
 
@@ -21505,6 +21511,7 @@ snapshots:
21505
21511
  simple-get: 4.0.1
21506
21512
  tar-fs: 2.1.4
21507
21513
  tunnel-agent: 0.6.0
21514
+ optional: true
21508
21515
 
21509
21516
  prelude-ls@1.2.1: {}
21510
21517
 
@@ -22232,13 +22239,15 @@ snapshots:
22232
22239
 
22233
22240
  signal-exit@4.1.0: {}
22234
22241
 
22235
- simple-concat@1.0.1: {}
22242
+ simple-concat@1.0.1:
22243
+ optional: true
22236
22244
 
22237
22245
  simple-get@4.0.1:
22238
22246
  dependencies:
22239
22247
  decompress-response: 6.0.0
22240
22248
  once: 1.4.0
22241
22249
  simple-concat: 1.0.1
22250
+ optional: true
22242
22251
 
22243
22252
  simple-plist@1.3.1:
22244
22253
  dependencies:
@@ -22650,6 +22659,7 @@ snapshots:
22650
22659
  mkdirp-classic: 0.5.3
22651
22660
  pump: 3.0.3
22652
22661
  tar-stream: 2.2.0
22662
+ optional: true
22653
22663
 
22654
22664
  tar-stream@1.6.2:
22655
22665
  dependencies:
@@ -17,7 +17,6 @@
17
17
  "@nestjs/core": "^10.4.15",
18
18
  "@nestjs/platform-express": "^10.4.15",
19
19
  "@supabase/supabase-js": "2.95.3",
20
- "better-sqlite3": "^11.9.1",
21
20
  "coze-coding-dev-sdk": "^0.7.16",
22
21
  "dotenv": "^17.2.3",
23
22
  "drizzle-kit": "^0.31.8",
@@ -31,7 +30,6 @@
31
30
  "devDependencies": {
32
31
  "@nestjs/cli": "^10.4.9",
33
32
  "@nestjs/schematics": "^10.2.3",
34
- "@types/better-sqlite3": "^7.6.13",
35
33
  "@types/express": "5.0.6",
36
34
  "@types/node": "^22.10.2",
37
35
  "drizzle-kit": "^0.31.8",
@@ -3,11 +3,11 @@ import Taro from '@tarojs/taro';
3
3
  /**
4
4
  * 小程序调试工具
5
5
  * 在开发版/体验版自动开启调试模式
6
- * 支持微信小程序和抖音小程序
6
+ * 支持微信小程序
7
7
  */
8
8
  export function devDebug() {
9
9
  const env = Taro.getEnv();
10
- if (env === Taro.ENV_TYPE.WEAPP || env === Taro.ENV_TYPE.TT) {
10
+ if (env === Taro.ENV_TYPE.WEAPP) {
11
11
  try {
12
12
  const accountInfo = Taro.getAccountInfoSync();
13
13
  const envVersion = accountInfo.miniProgram.envVersion;
@@ -94,6 +94,30 @@
94
94
  "additionalProperties": false
95
95
  }
96
96
  },
97
+ {
98
+ "name": "pi-agent",
99
+ "description": "Pi Agent:`coze init ${COZE_WORKSPACE_PATH} --template pi-agent`\n- 适用:基于 pi-agent-core 的 AI Agent 应用\n- 支持飞书、微信等多渠道接入\n- 内置 Dashboard 管理面板\n- 使用 TypeScript + Express + Vite",
100
+ "location": "./pi-agent",
101
+ "paramsSchema": {
102
+ "type": "object",
103
+ "properties": {
104
+ "port": {
105
+ "type": "number",
106
+ "default": 5000,
107
+ "minimum": 1024,
108
+ "maximum": 65535,
109
+ "description": "Dashboard server port"
110
+ },
111
+ "workspaceDir": {
112
+ "type": "string",
113
+ "default": "/workspace/workspace",
114
+ "description": "Workspace directory path"
115
+ }
116
+ },
117
+ "required": [],
118
+ "additionalProperties": false
119
+ }
120
+ },
97
121
  {
98
122
  "name": "taro",
99
123
  "description": "Taro(小程序 + H5):`coze init ${COZE_WORKSPACE_PATH} --template taro`\n- 适用:微信小程序、H5 跨端应用\n- 前后端分离架构:Taro 4 + NestJS\n- 支持微信小程序和 H5 双端构建\n- 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式",
@@ -39,3 +39,8 @@
39
39
  ## 开发规范
40
40
 
41
41
  - 使用 Tailwind CSS 进行样式开发
42
+
43
+ ### 编码规范
44
+
45
+ - 默认按 TypeScript `strict` 心智写代码;优先复用当前作用域已声明的变量、函数、类型和导入,禁止引用未声明标识符或拼错变量名。
46
+ - 禁止隐式 `any` 和 `as any`;函数参数、返回值、解构项、事件对象、Express `req`/`res`、`catch` 错误在使用前应有明确类型或先完成类型收窄,并清理未使用的变量和导入。
package/lib/cli.js CHANGED
@@ -2107,7 +2107,7 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.13";
2110
+ var version = "0.0.14-alpha.c52ee4";
2111
2111
  var description = "coze coding devtools cli";
2112
2112
  var license = "MIT";
2113
2113
  var author = "fanwenjie.fe@bytedance.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.13",
3
+ "version": "0.0.14-alpha.c52ee4",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",