@aiti-ai/aiti-model-wizard 0.0.0-stage → 0.1.11

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 (43) hide show
  1. package/AGENTS.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +38 -2
  4. package/catalog/models.dev.json +1 -0
  5. package/check-client.mjs +273 -0
  6. package/china-catalog.json +772 -0
  7. package/client/src/amw-styles.ts +388 -0
  8. package/client/src/enabled-scope.tsx +327 -0
  9. package/client/src/entry.tsx +235 -0
  10. package/client/src/host-shim.ts +108 -0
  11. package/client/src/jsx-runtime.ts +2 -0
  12. package/client/src/multi-key-status.tsx +456 -0
  13. package/client/src/provider-icons.tsx +202 -0
  14. package/client/src/wizard-app.tsx +4459 -0
  15. package/client/src/wizard-lib.tsx +106 -0
  16. package/core-upsert-env.test.mjs +110 -0
  17. package/core.cjs +2813 -0
  18. package/deploy-commit.mjs +52 -0
  19. package/dev-pack.mjs +246 -0
  20. package/dist/aiti-model-wizard-client.mjs +4 -0
  21. package/dist/entry-BmEzeUmI.js +464 -0
  22. package/dist/wizard-app-m_Ku7XnI.js +9214 -0
  23. package/ext-icons-deploy.mjs +24 -0
  24. package/icon.svg +1 -0
  25. package/icons/sparkles.svg +1 -0
  26. package/index.ts +1823 -0
  27. package/package.json +33 -4
  28. package/reload-instances.mjs +60 -0
  29. package/schema-shape.test.mjs +132 -0
  30. package/skills/index.json +1 -0
  31. package/skills/model-params-fill/SKILL.md +127 -0
  32. package/skills/model-wizard/SKILL.md +53 -0
  33. package/test/combo.test.mjs +254 -0
  34. package/test/core.test.mjs +564 -0
  35. package/test/detect-hint.test.mjs +219 -0
  36. package/test/model-override.test.mjs +74 -0
  37. package/test/ocsession-learn.test.mjs +54 -0
  38. package/test/uiue-checkup.test.mjs +83 -0
  39. package/tools/build-client.mjs +32 -0
  40. package/tools/deploy.mjs +120 -0
  41. package/tools/fetch-catalog.mjs +111 -0
  42. package/vendor/effective-models.cjs +176 -0
  43. package/vite.config.ts +39 -0
package/AGENTS.md ADDED
@@ -0,0 +1,28 @@
1
+ # aiti-model-wizard 扩展(部署目录直改指南)
2
+
3
+ ## 结构
4
+ - 运行时文件平铺在本目录根(index.ts / core.cjs …,宿主 loader 按相对路径加载——**禁手改运行时平铺文件**,改 src/ 再 build)
5
+ - `src/` 源码(client/src + 服务端 ts/cjs)· `dist/` 构建产物(禁手改)· `tools/` 构建/部署脚本
6
+ - npm 包形态的扩展:本目录 package.json 含 version 与 aitiConfigs 声明
7
+
8
+ ## 小改现场流程(改文案/样式/小逻辑)
9
+ 1. 改 `src/` 下对应源码
10
+ 2. `node tools/build.mjs`(client 有构建产物的扩展;纯服务端改动跳过)
11
+ 3. `curl -X POST http://127.0.0.1:3001/api/extensions/reload`(dev;prod 3002;外部经 nginx 带 basePath:/dev、/mac、/mdev、/win、/wdev → `/xxx/api/extensions/reload`)
12
+ 4. 浏览器刷新页面验证
13
+
14
+ ## 大改回源码仓
15
+ - 源码仓:`extensions/aiti-model-wizard/`(git 管理,deploy 同步回本目录)
16
+ - 改完在源码仓跑 `node tools/deploy.mjs`(或仓库根 `node scripts/deploy-all.mjs --only aiti-model-wizard`)
17
+
18
+ ## 数据目录(数据分层:config / cache)
19
+ - `ctx.configDir` 根级 = 配置与关键小状态(aiti-configs 备份范围;小、珍贵、人可读)
20
+ - `ctx.cacheDir`(= `<configDir>/cache/`)= 可删缓存:db/venv/日志/大文件;rm -rf 后扩展下次访问自动重建
21
+ - `ctx.dataDir` 已移除(访问即抛)——新代码禁用
22
+ - 本扩展白名单(永不为 cache 的配置文件)见 package.json `aitiConfigs.configFiles`
23
+
24
+ ## 红线
25
+ - 禁轮询(setInterval 拉取);需要等待用事件/回调/SSE(桥的 SSE、aiti-event-bus topics)
26
+ - 禁重启生产服务(pi-web 3002 等 restart 须用户明确同意)
27
+ - 禁手改 dist/ 与运行时平铺文件;跨扩展通信走 ctx.services(禁 globalThis.__ext 直穿)
28
+ - 服务端:SQLite 一律 WAL + 分批小事务(批间 setImmediate 让步);禁 execFileSync 调 >1s 外部程序;>8MB 文件禁同步读
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aiti-ai contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # @aiti-ai/aiti-model-wizard
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > 引导添加 AI 提供商/模型:目录搜索(models.dev + 国内 AI 目录,中英文,贴 API 地址也能反向搜到)→ 填 token → 测试(2xx/429 都算通过)→ 选/输模型 → 写 models.json;找不到用 baseUrl 反向匹配(任意文档/代码片段自动提取 URL)/ 自动探测(漏 v1/v2 也能补,命中带 key 拉模型列表 + OpenAPI/模型前缀品牌信号);编辑时 token 打码不返回前端
4
+
5
+ ## 来源 · Origin
6
+
7
+ 本包是 **aiti** 生态的组成部分——以 [pi](https://pi.dev) 为引擎的个人 AI 开发工作台与本地调试注入生态:**aiti-agent**(自托管 Web 工作台,基于开源项目 [pi-web](https://github.com/aiti-ai/pi-web) 构建,浏览器为主操作面)+ 各开发工具内的调试注入(aiti-devtools)+ 丰富的扩展体系。
8
+
9
+ This package is part of the **aiti** ecosystem — a personal AI development workbench powered by [pi](https://pi.dev): **aiti-agent** (a self-hosted web workbench built on the open-source [pi-web](https://github.com/aiti-ai/pi-web)) plus debug injection into mainstream dev tools (aiti-devtools) and a rich extension system.
10
+
11
+ - 工作台 / workbench: <https://github.com/aiti-ai/pi-web>
12
+ - 生态仓库 / monorepo: <https://github.com/aiti-ai/aiti-ai>
13
+ - 官网 / site: <https://aiti.pw>
14
+
15
+ ## 功能定位(中文)
16
+
17
+ 引导添加 AI 提供商/模型:目录搜索(models.dev + 国内 AI 目录,中英文,贴 API 地址也能反向搜到)→ 填 token → 测试(2xx/429 都算通过)→ 选/输模型 → 写 models.json;找不到用 baseUrl 反向匹配(任意文档/代码片段自动提取 URL)/ 自动探测(漏 v1/v2 也能补,命中带 key 拉模型列表 + OpenAPI/模型前缀品牌信号);编辑时 token 打码不返回前端
18
+
19
+ AI 能力 · tags: `model` · `provider` · `wizard` · `onboarding` · `models.dev` · `catalog`
20
+
21
+ ## Positioning (English)
22
+
23
+ Guided AI provider/model onboarding — catalog search (models.dev + domestic AI catalog, Chinese/English, paste an API URL to reverse-search) → enter token → test (both 2xx/429 count as pass) → pick/type a model → write models.json; on miss, baseUrl reverse matching (auto-extracts URLs from any doc/code snippet) or auto detection (fills missing v1/v2, pulls the model list with a key + OpenAPI/model-prefix brand signals); tokens are masked on every read and never returned to the frontend
24
+
25
+ ## 安装 / 部署
26
+
27
+ ```bash
28
+ # 部署到 ~/.pi/web/extensions/aiti-model-wizard/ 后 reload
29
+ ```
30
+
31
+ ## 文档 · Documentation
32
+
33
+ - 中文完整文档(aiti-docs): <https://aiti.pw/extensions/aiti-model-wizard.html>
34
+ - English docs: <https://aiti.pw/en/extensions/aiti-model-wizard.html>
35
+ - 扩展注册表 / registry: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
36
+
37
+ ## License
38
+
39
+ MIT