refactor: jsc-statusbar 改名為 jsc-mod,指令改為 /statusline,版本重設為 0.0.1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-10-14 04:45:00 +00:00
co-authored by Claude Sonnet 5.5
parent 5701b8b8e5
commit 88a3a3aff2
12 changed files with 49 additions and 49 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
},
"plugins": [
{
"name": "jsc-statusbar",
"source": "./plugins/jsc-statusbar",
"name": "jsc-mod",
"source": "./plugins/jsc-mod",
"description": "輸入框上方單行狀態列:模型、目錄、分支、5h/7d 額度與重置、context、CPU/記憶體/磁碟"
},
{
+5 -5
View File
@@ -6,7 +6,7 @@ JSC 自用 Claude Code mods 的 marketplace。每個插件皆可單獨安裝、
## 插件
### [jsc-statusbar](plugins/jsc-statusbar) `0.0.4`
### [jsc-mod](plugins/jsc-mod) `0.0.1`
輸入框上方單行狀態列:模型、目錄、分支、5h/7d 額度與重置、context、CPU/記憶體/磁碟。
@@ -34,7 +34,7 @@ Matt Pocock 的工程技能整套(grilling、spec/ticket、TDD、code review
```bash
claude plugin marketplace add https://gitea.jsc.idv.tw/jiantw83/jsc-marketplace.git
claude plugin install jsc-statusbar@jsc-marketplace
claude plugin install jsc-mod@jsc-marketplace
claude plugin install jsc-companion@jsc-marketplace
claude plugin install jsc-herdr@jsc-marketplace
claude plugin install jsc-claude@jsc-marketplace
@@ -45,7 +45,7 @@ claude plugin install jsc-matt@jsc-marketplace
```bash
claude plugin marketplace update jsc-marketplace
claude plugin update jsc-statusbar@jsc-marketplace
claude plugin update jsc-mod@jsc-marketplace
claude plugin update jsc-companion@jsc-marketplace
claude plugin update jsc-herdr@jsc-marketplace
claude plugin update jsc-claude@jsc-marketplace
@@ -57,7 +57,7 @@ claude plugin update jsc-matt@jsc-marketplace
## 移除
```bash
claude plugin uninstall jsc-statusbar@jsc-marketplace
claude plugin uninstall jsc-mod@jsc-marketplace
claude plugin uninstall jsc-companion@jsc-marketplace
claude plugin uninstall jsc-herdr@jsc-marketplace
claude plugin uninstall jsc-claude@jsc-marketplace
@@ -65,7 +65,7 @@ claude plugin uninstall jsc-matt@jsc-marketplace
claude plugin marketplace remove jsc-marketplace
```
曾安裝舊名稱(`statusbar`、`companion`、`herdr`、`herdr-issue`、`jsc-eli5`)的環境,請先 `claude plugin uninstall <舊名>@jsc-marketplace` 再安裝新名稱。`jsc-eli5` 已改名為 `jsc-claude`,指令為 `/jsc-claude:eli5`。
曾安裝舊名稱(`statusbar`、`jsc-statusbar`、`companion`、`herdr`、`herdr-issue`、`jsc-eli5`)的環境,請先 `claude plugin uninstall <舊名>@jsc-marketplace` 再安裝新名稱。`jsc-eli5` 已改名為 `jsc-claude`,指令為 `/jsc-claude:eli5`。
## 授權
+1 -1
View File
@@ -1,4 +1,4 @@
// 角色行用的字串片段與寬度計算(與 statusbar 外掛各自獨立,不互相依賴)
// 角色行用的字串片段與寬度計算(與 jsc-mod 外掛各自獨立,不互相依賴)
export type Seg = { text: string; color?: string; dim?: boolean; bold?: boolean }
export function bar(p: number, cells = 5): string {
@@ -1,6 +1,6 @@
{
"name": "jsc-statusbar",
"version": "0.0.4",
"name": "jsc-mod",
"version": "0.0.1",
"description": "輸入框上方的單行狀態列:模型、目錄、分支、5h/7d 額度與重置、context、CPU/記憶體/磁碟",
"license": "MIT",
"types": "./types/index.d.ts",
+27
View File
@@ -0,0 +1,27 @@
# jsc-mod
## 指令
### `/statusline on`
開啟狀態列。
```text
/statusline on
```
### `/statusline off`
隱藏狀態列。
```text
/statusline off
```
### `/statusline compact`
改用極窄版狀態列。
```text
/statusline compact
```
@@ -91,7 +91,7 @@ describe('format', () => {
})
describe('band', () => {
test('draws one line above the prompt and hides with /statusbar off', async ($, on) => {
test('draws one line above the prompt and hides with /statusline off', async ($, on) => {
on('session.model', () => ({ value: 'claude-opus-5-5' }))
on('session.cwd', () => ({ value: '/home/dev/work/luopan' }))
const props = {
@@ -103,12 +103,12 @@ describe('band', () => {
view: {},
}
for (const surface of ['terminal', 'desktop'] as const) {
const ui = await $.ui.mount({ plugin: 'jsc-statusbar', surface, component: 'AbovePrompt', props })
const ui = await $.ui.mount({ plugin: 'jsc-mod', surface, component: 'AbovePrompt', props })
expect(await ui.find({ type: 'Text', text: /◆ Opus 5\.5/ })).toBeDefined()
expect(await ui.find({ type: 'Text', text: /5h —/ })).toBeDefined()
await ui.unmount()
}
const ran = await $.command.run({ command: 'statusbar', args: 'off' } as Parameters<typeof $.command.run>[0])
const ran = await $.command.run({ command: 'statusline', args: 'off' } as Parameters<typeof $.command.run>[0])
expect(JSON.stringify(ran)).toContain('隱藏')
})
})
@@ -5,12 +5,12 @@ import type { Mode, Sys, Usage, Window } from '../types'
import { fit, cpuPercent, parseCpu, parseDf, parseGit, parseMem, parseOffset } from './format'
import type { CpuSample } from './format'
const usageAtom = atom({ plugin: 'jsc-statusbar', key: 'usage' } as const, {})
const gitAtom = atom({ plugin: 'jsc-statusbar', key: 'git' } as const, null)
const sysAtom = atom({ plugin: 'jsc-statusbar', key: 'sys' } as const, {})
const modeAtom = atom({ plugin: 'jsc-statusbar', key: 'mode' } as const, 'auto')
const alertedAtom = atom({ plugin: 'jsc-statusbar', key: 'alerted' } as const, [])
const effortAtom = atom({ plugin: 'jsc-statusbar', key: 'effort' } as const, null)
const usageAtom = atom({ plugin: 'jsc-mod', key: 'usage' } as const, {})
const gitAtom = atom({ plugin: 'jsc-mod', key: 'git' } as const, null)
const sysAtom = atom({ plugin: 'jsc-mod', key: 'sys' } as const, {})
const modeAtom = atom({ plugin: 'jsc-mod', key: 'mode' } as const, 'auto')
const alertedAtom = atom({ plugin: 'jsc-mod', key: 'alerted' } as const, [])
const effortAtom = atom({ plugin: 'jsc-mod', key: 'effort' } as const, null)
const SYS_MS = 3000
const GIT_MS = 15_000
@@ -111,7 +111,7 @@ async function runHud($: EngineInterface, args: string) {
export const register: Register = on => {
on('session.start', async ($, e, next) => {
await $.command.register({
name: 'statusbar',
name: 'statusline',
description: '切換輸入框上方的狀態列',
argumentHint: 'on | off | compact',
})
@@ -161,7 +161,7 @@ export const register: Register = on => {
return ran
})
on('command.run', { command: 'statusbar' }, ($, e) => runHud($, e.args))
on('command.run', { command: 'statusline' }, ($, e) => runHud($, e.args))
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const mode = await read($, modeAtom)
@@ -16,7 +16,7 @@ export type Mode = 'auto' | 'compact' | 'off'
declare module 'claude-code' {
interface PluginState {
'jsc-statusbar': {
'jsc-mod': {
usage: Usage
git: Git | null
sys: Sys
-27
View File
@@ -1,27 +0,0 @@
# jsc-statusbar
## 指令
### `/statusbar on`
開啟狀態列。
```text
/statusbar on
```
### `/statusbar off`
隱藏狀態列。
```text
/statusbar off
```
### `/statusbar compact`
改用極窄版狀態列。
```text
/statusbar compact
```