@aiti-ai/aiti-ctx-meter 0.1.14 → 0.1.16

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 CHANGED
@@ -1,38 +1,29 @@
1
1
  # @aiti-ai/aiti-ctx-meter
2
2
 
3
- > 输入区上下文比例条指示器——桌面 compactLead 竖向比例条 + 小屏 modelInfoLead 前导位,urgency 四档色阶 + critical 呼吸,点击开宿主会话统计面板
3
+ > Input-area context ratio-bar indicator — desktop compactLead vertical bar + small-screen modelInfoLead leading slot, four-tier urgency color scale + critical breathing, click opens the host session stats panel
4
4
 
5
- ## 来源 · Origin
5
+ English · [简体中文](./README.zh-CN.md)
6
6
 
7
- 本包是 **aiti** 生态的组成部分——以 [pi](https://pi.dev) 为引擎的个人 AI 开发工作台与本地调试注入生态:**aiti-agent**(自托管 Web 工作台,基于开源项目 [pi-web](https://github.com/aiti-ai/pi-web) 构建,浏览器为主操作面)+ 各开发工具内的调试注入(aiti-devtools)+ 丰富的扩展体系。
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/pi-web)) plus debug injection into mainstream dev tools (aiti-devtools) and a rich extension system.
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
- - 工作台 / workbench: <https://github.com/aiti-ai/pi-web>
12
- - 生态仓库 / monorepo: <https://github.com/aiti-ai/aiti-ai>
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: `context` · `meter` · `compact-lead` · `model-info-lead` · `urgency` · `breathing` · `session-stats`
16
15
 
17
- 输入区上下文比例条指示器——桌面 compactLead 竖向比例条 + 小屏 modelInfoLead 前导位,urgency 四档色阶 + critical 呼吸,点击开宿主会话统计面板
16
+ ## Install
18
17
 
19
- 聊天增强 · tags: `context` · `meter` · `compact-lead` · `model-info-lead` · `urgency` · `breathing` · `session-stats`
18
+ Bundled with **aiti-agent** (`@aiti-ai/pi-web`) — enable it from the in-app extension manager (ExtMan / App Center).
20
19
 
21
- ## Positioning (English)
20
+ Manual install: place this package at `~/.pi/web/extensions/aiti-ctx-meter/` and reload pi-web.
22
21
 
23
- Input-area context ratio-bar indicator — desktop compactLead vertical bar + small-screen modelInfoLead leading slot, four-tier urgency color scale + critical breathing, click opens the host session stats panel
22
+ ## Documentation
24
23
 
25
- ## 安装 / 部署
26
-
27
- ```bash
28
- node pi-web-ext/aiti-ctx-meter/tools/deploy.mjs # 构建产物拷贝 + 双实例部署 + reload
29
- ```
30
-
31
- ## 文档 · Documentation
32
-
33
- - 中文完整文档(aiti-docs): <https://aiti.pw/extensions/aiti-ctx-meter.html>
34
- - English docs: <https://aiti.pw/en/extensions/aiti-ctx-meter.html>
35
- - 扩展注册表 / registry: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
24
+ - Documentation (English): <https://aiti.pw/en/extensions/aiti-ctx-meter.html>
25
+ - 文档(中文): <https://aiti.pw/extensions/aiti-ctx-meter.html>
26
+ - Extension registry: <https://aiti.pw/extensions.html> · machine-readable <https://aiti.pw/extensions.json>
36
27
 
37
28
  ## License
38
29
 
@@ -0,0 +1,30 @@
1
+ # @aiti-ai/aiti-ctx-meter
2
+
3
+ > 输入区上下文比例条指示器——桌面 compactLead 竖向比例条 + 小屏 modelInfoLead 前导位,urgency 四档色阶 + critical 呼吸,点击开宿主会话统计面板
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: `context` · `meter` · `compact-lead` · `model-info-lead` · `urgency` · `breathing` · `session-stats`
15
+
16
+ ## 安装
17
+
18
+ 随 **aiti-agent**(`@aiti-ai/pi-web`)捆绑发行——在工作台内的扩展管理器(ExtMan / 应用中心)启用即可。
19
+
20
+ 手动安装:把本包放到 `~/.pi/web/extensions/aiti-ctx-meter/` 后 reload。
21
+
22
+ ## 文档
23
+
24
+ - 中文文档: <https://aiti.pw/extensions/aiti-ctx-meter.html>
25
+ - Documentation (English): <https://aiti.pw/en/extensions/aiti-ctx-meter.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
- const repoHint = "/home/pi/workspace/aiti-ai"; // 现场构建探测源码仓 node_modules 用(三机各不同,缺失时走 npm exec)
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
- home + "/workspace/aiti-ai/node_modules/esbuild/bin/esbuild",
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
@@ -15,12 +15,12 @@
15
15
  export default {
16
16
  id: "aiti-ctx-meter",
17
17
  name: "上下文比例条(context %)",
18
- version: "0.1.4",
19
18
  icon: "icons/meter-vertical.svg",
20
19
  client: "dist/aiti-ctx-meter-client.mjs",
21
20
  ui: {
22
21
  i18n: {
23
22
  en: {
23
+ "ext.displayName": "Context Meter (context %)",
24
24
  "meter.none": "No context data yet (idle or external backend)",
25
25
  "meter.compacting": "Compacting…",
26
26
  "meter.queued": "Compaction queued",
package/package.json CHANGED
@@ -1,14 +1,23 @@
1
1
  {
2
2
  "name": "@aiti-ai/aiti-ctx-meter",
3
- "version": "0.1.14",
4
- "description": "输入区上下文比例条指示器(context % + 会话面板入口)",
3
+ "version": "0.1.16",
4
+ "description": "Input-area context ratio-bar indicator — desktop compactLead vertical bar + small-screen modelInfoLead leading slot, four-tier urgency color scale + critical breathing, click opens the host session stats panel",
5
+ "displayNameI18n": {
6
+ "en": "Context Meter (context %)"
7
+ },
8
+ "descriptionI18n": {
9
+ "zh-CN": "输入区上下文比例条指示器——桌面 compactLead 竖向比例条 + 小屏 modelInfoLead 前导位,urgency 四档色阶 + critical 呼吸,点击开宿主会话统计面板"
10
+ },
5
11
  "soul": "上下文还剩多少,看一眼电池就知道。",
12
+ "soulI18n": {
13
+ "en": "How much context is left — one glance at the battery tells you."
14
+ },
6
15
  "scripts": {
7
16
  "build:client": "node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('client/src/aiti-ctx-meter-client.mjs','dist/aiti-ctx-meter-client.mjs')\""
8
17
  },
9
18
  "aitiExtProtocol": "1.0",
10
19
  "license": "MIT",
11
- "contentHash": "1ad7cf4554f4c80c",
20
+ "contentHash": "13a2cac0726c7f72",
12
21
  "repository": {
13
22
  "type": "git",
14
23
  "url": "git+https://github.com/aiti-ai/aiti-ai.git",