@aiti-ai/aiti-model-recent 0.1.10 → 0.1.12
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 +14 -23
- package/README.zh-CN.md +30 -0
- package/dev-pack.mjs +16 -3
- package/index.ts +8 -1
- package/package.json +12 -3
- package/tools/build-client.mjs +2 -1
package/README.md
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
# @aiti-ai/aiti-model-recent
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> The model selector's "recently used" data provider — a pure service extension (zero UI); the panel's recent section fetches data synchronously and pick events feed the LRU; the localStorage key matches the original implementation, zero migration
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
English · [简体中文](./README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## About aiti
|
|
8
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/
|
|
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/aiti-ai)) plus debug injection into mainstream dev tools (aiti-devtools) and a rich extension system.
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- 官网 / site: <https://aiti.pw>
|
|
11
|
+
- Workbench & monorepo: <https://github.com/aiti-ai/aiti-ai>
|
|
12
|
+
- Site: <https://aiti.pw>
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
Category: Chat enhancements · Tags: `model-selector` · `recent` · `lru` · `service`
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
## Install
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Bundled with **aiti-agent** (`@aiti-ai/pi-web`) — enable it from the in-app extension manager (ExtMan / App Center).
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Manual install: place this package at `~/.pi/web/extensions/aiti-model-recent/` and reload pi-web.
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
## Documentation
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# 部署到 ~/.pi/web/extensions/aiti-model-recent/ 后 reload(需宿主 ≥ service 接缝版本,defork P4)
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 文档 · Documentation
|
|
32
|
-
|
|
33
|
-
- 中文完整文档(aiti-docs): <https://aiti.pw/extensions/aiti-model-recent.html>
|
|
34
|
-
- English docs: <https://aiti.pw/en/extensions/aiti-model-recent.html>
|
|
35
|
-
- 扩展注册表 / registry: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
|
|
24
|
+
- Documentation (English): <https://aiti.pw/en/extensions/aiti-model-recent.html>
|
|
25
|
+
- 文档(中文): <https://aiti.pw/extensions/aiti-model-recent.html>
|
|
26
|
+
- Extension registry: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
|
|
36
27
|
|
|
37
28
|
## License
|
|
38
29
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @aiti-ai/aiti-model-recent
|
|
2
|
+
|
|
3
|
+
> 模型选择器「最近使用」数据提供方——纯 service 扩展(零 UI),面板最近段同步取数 + pick 事件入库 LRU;localStorage key 与原实现一致零迁移
|
|
4
|
+
|
|
5
|
+
[English](./README.md) · 简体中文
|
|
6
|
+
|
|
7
|
+
## 关于 aiti
|
|
8
|
+
|
|
9
|
+
本包是 **aiti** 生态的组成部分——以 [pi](https://pi.dev) 为引擎的个人 AI 开发工作台与本地调试注入生态:**aiti-agent**(自托管 Web 工作台,基于开源项目 [pi-web](https://github.com/aiti-ai/aiti-ai) 构建,浏览器为主操作面)+ 各开发工具内的调试注入(aiti-devtools)+ 丰富的扩展体系。
|
|
10
|
+
|
|
11
|
+
- 工作台 / 生态仓库(aiti-agent,基于 pi-web): <https://github.com/aiti-ai/aiti-ai>
|
|
12
|
+
- 官网: <https://aiti.pw>
|
|
13
|
+
|
|
14
|
+
分类: 聊天增强 · tags: `model-selector` · `recent` · `lru` · `service`
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
随 **aiti-agent**(`@aiti-ai/pi-web`)捆绑发行——在工作台内的扩展管理器(ExtMan / 应用中心)启用即可。
|
|
19
|
+
|
|
20
|
+
手动安装:把本包放到 `~/.pi/web/extensions/aiti-model-recent/` 后 reload。
|
|
21
|
+
|
|
22
|
+
## 文档
|
|
23
|
+
|
|
24
|
+
- 中文文档: <https://aiti.pw/extensions/aiti-model-recent.html>
|
|
25
|
+
- Documentation (English): <https://aiti.pw/en/extensions/aiti-model-recent.html>
|
|
26
|
+
- 扩展注册表: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
|
|
27
|
+
|
|
28
|
+
## 许可证
|
|
29
|
+
|
|
30
|
+
MIT
|
package/dev-pack.mjs
CHANGED
|
@@ -77,7 +77,7 @@ export function agentsMdTemplate(extId) {
|
|
|
77
77
|
|
|
78
78
|
/** 默认 tools/build.mjs(esbuild 单包零配置;扩展自带 tools/build.mjs 则不走到这里)。 */
|
|
79
79
|
function buildMjsTemplate(extId, extRoot, clientOut, entryRel) {
|
|
80
|
-
|
|
80
|
+
// No hardcoded checkout path: candidates are resolved at run time (see repoCandidates below).
|
|
81
81
|
return `/**
|
|
82
82
|
* ${extId} · 现场构建入口(dev-pack 默认模板,esbuild 单包零配置)
|
|
83
83
|
* 用法:node tools/build.mjs
|
|
@@ -96,12 +96,25 @@ const entryRel = ${JSON.stringify(entryRel || "")};
|
|
|
96
96
|
|
|
97
97
|
// esbuild 解析:部署目录 node_modules → 源码仓 node_modules(本机开发场景)→ PATH 上的 esbuild → npm exec 现拉。
|
|
98
98
|
// 注意:node_modules/esbuild/bin/esbuild 是原生二进制(ELF/Mach-O),必须直接执行(不能当 JS 跑)。
|
|
99
|
+
// Checkout roots are discovered by walking up from the extension dir (a root has node_modules/),
|
|
100
|
+
// plus AITI_REPO_ROOT when set — no machine-specific absolute paths baked into generated files.
|
|
101
|
+
function repoCandidates() {
|
|
102
|
+
const out = [];
|
|
103
|
+
if (process.env.AITI_REPO_ROOT) out.push(process.env.AITI_REPO_ROOT.split(pathSep).join("/") + "/node_modules/esbuild/bin/esbuild");
|
|
104
|
+
let d = extRoot;
|
|
105
|
+
for (let i = 0; i < 8; i++) {
|
|
106
|
+
out.push(d.split(pathSep).join("/") + "/node_modules/esbuild/bin/esbuild");
|
|
107
|
+
const up = dirname(d);
|
|
108
|
+
if (up === d) break;
|
|
109
|
+
d = up;
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
99
113
|
function findEsbuild() {
|
|
100
114
|
const home = (process.env.HOME || process.env.USERPROFILE || "").split(pathSep).join("/");
|
|
101
115
|
const candidates = [
|
|
102
116
|
extRoot + "/node_modules/esbuild/bin/esbuild",
|
|
103
|
-
|
|
104
|
-
"C:/workspace/aiti-ai/node_modules/esbuild/bin/esbuild", // windows dev box(源码在 D 盘)
|
|
117
|
+
...repoCandidates(),
|
|
105
118
|
];
|
|
106
119
|
for (const c of candidates) {
|
|
107
120
|
if (!existsSync(c)) continue;
|
package/index.ts
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
export default {
|
|
11
11
|
id: "aiti-model-recent",
|
|
12
12
|
name: "Model Recent",
|
|
13
|
-
version: "0.1.0",
|
|
14
13
|
client: "dist/aiti-model-recent.mjs",
|
|
15
14
|
icon: "icons/clock.svg",
|
|
16
15
|
clientImmediately: true, // service 须在首开模型面板前注册(boot 物化)
|
|
@@ -23,4 +22,12 @@ export default {
|
|
|
23
22
|
enabled: true,
|
|
24
23
|
},
|
|
25
24
|
],
|
|
25
|
+
ui: {
|
|
26
|
+
// English manifest-text overrides (name/description/feature labels); zh source lives in the manifest.
|
|
27
|
+
i18n: {
|
|
28
|
+
en: {
|
|
29
|
+
"feat.modelRecent.enabled": "Recently used models",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
26
33
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiti-ai/aiti-model-recent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "The model selector's \"recently used\" data provider — a pure service extension (zero UI); the panel's recent section fetches data synchronously and pick events feed the LRU; the localStorage key matches the original implementation, zero migration",
|
|
6
|
+
"displayNameI18n": {
|
|
7
|
+
"en": "Recent Models"
|
|
8
|
+
},
|
|
9
|
+
"descriptionI18n": {
|
|
10
|
+
"zh-CN": "模型选择器「最近使用」数据提供方——纯 service 扩展(零 UI),面板最近段同步取数 + pick 事件入库 LRU;localStorage key 与原实现一致零迁移"
|
|
11
|
+
},
|
|
6
12
|
"scripts": {
|
|
7
13
|
"build:client": "vite build --config vite.config.ts",
|
|
8
14
|
"watch": "vite build --watch --config vite.config.ts",
|
|
@@ -12,12 +18,15 @@
|
|
|
12
18
|
"vite": "^6.4.3"
|
|
13
19
|
},
|
|
14
20
|
"soul": "常用的模型,应当在指尖。",
|
|
21
|
+
"soulI18n": {
|
|
22
|
+
"en": "Frequently used models should be at your fingertips."
|
|
23
|
+
},
|
|
15
24
|
"aitiConfigs": {
|
|
16
25
|
"configFiles": []
|
|
17
26
|
},
|
|
18
27
|
"aitiExtProtocol": "1.0",
|
|
19
28
|
"license": "MIT",
|
|
20
|
-
"contentHash": "
|
|
29
|
+
"contentHash": "b7d4949113880577",
|
|
21
30
|
"repository": {
|
|
22
31
|
"type": "git",
|
|
23
32
|
"url": "git+https://github.com/aiti-ai/aiti-ai.git",
|
package/tools/build-client.mjs
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* npm run watch (vite build --watch,改源码自动重建 → 配合前端 rev poller 即 HMR)
|
|
10
10
|
*/
|
|
11
11
|
import { spawnSync } from "node:child_process";
|
|
12
|
+
import { createRequire } from "node:module";
|
|
12
13
|
import { resolve } from "node:path";
|
|
13
14
|
import { fileURLToPath } from "node:url";
|
|
14
15
|
import { existsSync } from "node:fs";
|
|
@@ -18,7 +19,7 @@ const root = resolve(fileURLToPath(new URL("..", import.meta.url)));
|
|
|
18
19
|
// Windows 上 .bin/vite(无扩展名 sh 脚本)spawn 会 status=null 静默失败;
|
|
19
20
|
// 跨平台统一 node 直跑 vite.js 入口(.bin 垫片的真实目标,npm scripts 内部同做法)。
|
|
20
21
|
const viteJs = resolve(root, "node_modules", "vite", "bin", "vite.js");
|
|
21
|
-
const viteBin = existsSync(viteJs) ? viteJs : "vite";
|
|
22
|
+
const viteBin = existsSync(viteJs) ? viteJs : resolve(createRequire(import.meta.url).resolve("vite/package.json"), "..", "bin", "vite.js");
|
|
22
23
|
|
|
23
24
|
const r = spawnSync(process.execPath, [viteBin, "build", "--config", resolve(root, "vite.config.ts")], {
|
|
24
25
|
cwd: root,
|