@2cmddev/2cmd 0.0.0-stage → 0.1.2
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/.opencode/command/2cmd-audit.md +5 -0
- package/.opencode/command/2cmd-debt.md +5 -0
- package/.opencode/command/2cmd-gain.md +5 -0
- package/.opencode/command/2cmd-help.md +5 -0
- package/.opencode/command/2cmd-review.md +5 -0
- package/.opencode/command/2cmd.md +5 -0
- package/.opencode/plugins/2cmd-frontmatter.cjs +63 -0
- package/.opencode/plugins/2cmd.mjs +206 -0
- package/.opencode/plugins/index.js +4 -0
- package/.qoder/rules/2cmd.md +31 -0
- package/.qoder-plugin/plugin.json +16 -0
- package/.zcode-plugin/plugin.json +13 -0
- package/AGENTS.md +33 -0
- package/LICENSE +22 -0
- package/README.md +133 -2
- package/codex/answer.mjs +164 -0
- package/codex/data.mjs +31 -0
- package/codex/pty.py +80 -0
- package/codex/stats.mjs +105 -0
- package/codex/terminal.mjs +388 -0
- package/dsh/LICENSE +22 -0
- package/dsh/board.js +782 -0
- package/dsh/build.mjs +47 -0
- package/dsh/bundle.json +2104 -0
- package/dsh/client.js +877 -0
- package/dsh/cordis.patch.yml +3 -0
- package/dsh/index.js +185 -0
- package/dsh/ledger.js +50 -0
- package/dsh/market.js +152 -0
- package/dsh/package.json +24 -0
- package/dsh/prices.json +1812 -0
- package/dsh/settings-text.mjs +520 -0
- package/dsh/settings.js +42 -0
- package/dsh/stats.js +106 -0
- package/dsh/store.js +32 -0
- package/dsh/update-prices.mjs +9 -0
- package/dsh/update.js +27 -0
- package/dsh/voice-helper/Info.plist +13 -0
- package/dsh/voice-helper/Transcript.swift +21 -0
- package/dsh/voice-helper/build.sh +10 -0
- package/dsh/voice-helper/main.swift +70 -0
- package/dsh/voice-helper/test.swift +17 -0
- package/dsh/voice.js +63 -0
- package/hooks/2cmd-activate.js +219 -0
- package/hooks/2cmd-antigravity.js +64 -0
- package/hooks/2cmd-band-import.js +305 -0
- package/hooks/2cmd-config.js +186 -0
- package/hooks/2cmd-instructions.js +104 -0
- package/hooks/2cmd-map.js +200 -0
- package/hooks/2cmd-mode-tracker.js +248 -0
- package/hooks/2cmd-runtime.js +245 -0
- package/hooks/2cmd-statusline.ps1 +24 -0
- package/hooks/2cmd-statusline.sh +18 -0
- package/hooks/2cmd-subagent.js +100 -0
- package/hooks/band/board.ts +720 -0
- package/hooks/band/buttons.ts +60 -0
- package/hooks/band/i18n/de.ts +149 -0
- package/hooks/band/i18n/en.ts +150 -0
- package/hooks/band/i18n/es.ts +149 -0
- package/hooks/band/i18n/fr.ts +149 -0
- package/hooks/band/i18n/index.ts +42 -0
- package/hooks/band/i18n/ja.ts +149 -0
- package/hooks/band/i18n/ko.ts +149 -0
- package/hooks/band/i18n/pt.ts +149 -0
- package/hooks/band/i18n/ru.ts +149 -0
- package/hooks/band/i18n/vi.ts +149 -0
- package/hooks/band/i18n/zh-Hans.ts +149 -0
- package/hooks/band/i18n/zh-Hant.ts +149 -0
- package/hooks/band/logo.ts +3 -0
- package/hooks/band/metrics.ts +373 -0
- package/hooks/band/register.tsx +681 -0
- package/hooks/band/types.d.ts +45 -0
- package/hooks/band/windows-board.mjs +20 -0
- package/hooks/claude-band.json +6 -0
- package/hooks/claude-codex-hooks.json +41 -0
- package/hooks/codebuddy-hooks.json +20 -0
- package/hooks/copilot-hooks.json +21 -0
- package/hooks/cursor-hooks.json +17 -0
- package/hooks/qoder-hooks.json +26 -0
- package/hooks/zcode-hooks.json +26 -0
- package/package.json +56 -4
- package/pi-extension/index.js +258 -0
- package/pi-extension/names.js +19 -0
- package/pi-extension/package.json +8 -0
- package/scripts/cursor-hooks.js +145 -0
- package/scripts/uninstall.js +92 -0
- package/skills/2cmd/SKILL.md +55 -0
- package/skills/2cmd-audit/SKILL.md +105 -0
- package/skills/2cmd-debt/SKILL.md +46 -0
- package/skills/2cmd-gain/SKILL.md +53 -0
- package/skills/2cmd-help/SKILL.md +87 -0
- package/skills/2cmd-review/SKILL.md +143 -0
- package/skills/plugin.json +5 -0
package/dsh/build.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Builds board.js and bundle.json from the Claude plugin, so dsh/ can be installed on its own: node dsh/build.mjs
|
|
2
|
+
// Run it after changing the board, the language packs, the rules or the review and audit skills.
|
|
3
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { createRequire, stripTypeScriptTypes } from 'node:module'
|
|
5
|
+
import { pathToFileURL } from 'node:url'
|
|
6
|
+
import { SETTINGS } from './settings-text.mjs'
|
|
7
|
+
|
|
8
|
+
const LANGUAGES = ['en', 'zh-Hans', 'zh-Hant', 'ja', 'ko', 'es', 'fr', 'de', 'pt', 'ru', 'vi']
|
|
9
|
+
const read = file => readFileSync(new URL(`../${file}`, import.meta.url), 'utf8')
|
|
10
|
+
|
|
11
|
+
// The board's own notes name Claude Code and its /cost command, which would be wrong here.
|
|
12
|
+
const NOTES = {
|
|
13
|
+
en: ['recorded in DeepSeek Harness', 'Recorded in DeepSeek Harness, main chats only. Cost is an estimate at public API prices, not a bill. Sessions without a known price show – and are left out of totals. Stopped replies may cost more than shown.'],
|
|
14
|
+
'zh-Hans': ['数据来自 DeepSeek Harness', '数据由 DeepSeek Harness 中的面板记录,只算主对话。花费按公开的 API 价格估算,不是账单。查不到价格的会话显示 –,不计入合计。被停止的回复,实际花费可能更高。'],
|
|
15
|
+
'zh-Hant': ['資料來自 DeepSeek Harness', '資料由 DeepSeek Harness 中的面板記錄,只算主對話。花費按公開的 API 價格估算,不是帳單。查不到價格的對話顯示 –,不計入合計。被停止的回覆,實際花費可能更高。'],
|
|
16
|
+
ja: ['DeepSeek Harness で記録', 'DeepSeek Harness で記録(メインの会話のみ)。コストは公開 API 料金による推定で、請求額ではありません。料金が不明なセッションは – と表示し、合計に含めません。停止した応答の実際のコストはこれより高い場合があります。'],
|
|
17
|
+
ko: ['DeepSeek Harness에서 기록', 'DeepSeek Harness에서 기록하며 메인 대화만 포함합니다. 비용은 공개 API 요금으로 추정한 값이며 청구액이 아닙니다. 요금을 알 수 없는 세션은 –로 표시하고 합계에서 제외합니다. 중지된 답변의 실제 비용은 더 높을 수 있습니다.'],
|
|
18
|
+
es: ['registrado en DeepSeek Harness', 'Datos de DeepSeek Harness, solo de los chats principales. El coste es una estimación con precios públicos de API, no una factura. Las sesiones sin precio conocido muestran – y no cuentan en los totales. Las respuestas detenidas pueden costar más de lo mostrado.'],
|
|
19
|
+
fr: ['enregistré dans DeepSeek Harness', 'Données de DeepSeek Harness, discussions principales uniquement. Le coût est une estimation aux tarifs API publics, pas une facture. Les sessions sans tarif connu affichent – et ne comptent pas dans les totaux. Les réponses interrompues peuvent coûter plus que le montant affiché.'],
|
|
20
|
+
de: ['in DeepSeek Harness aufgezeichnet', 'Daten aus DeepSeek Harness, nur Hauptchats. Die Kosten sind eine Schätzung nach öffentlichen API-Preisen, keine Rechnung. Sitzungen ohne bekannten Preis zeigen – und zählen nicht zur Summe. Gestoppte Antworten können mehr kosten als angezeigt.'],
|
|
21
|
+
pt: ['registrado no DeepSeek Harness', 'Dados do DeepSeek Harness, só das conversas principais. O custo é uma estimativa pelos preços públicos de API, não uma fatura. Sessões sem preço conhecido mostram – e não entram nos totais. Respostas interrompidas podem custar mais do que o exibido.'],
|
|
22
|
+
ru: ['записано в DeepSeek Harness', 'Данные DeepSeek Harness, только основные чаты. Стоимость — оценка по открытым ценам API, а не счёт. Сессии без известной цены отмечены знаком – и не входят в итоги. Прерванные ответы могут стоить больше, чем показано.'],
|
|
23
|
+
vi: ['ghi lại trong DeepSeek Harness', 'Dữ liệu từ DeepSeek Harness, chỉ gồm các cuộc trò chuyện chính. Chi phí là ước tính theo giá API công khai, không phải hóa đơn. Phiên không rõ giá hiện – và không được tính vào tổng. Câu trả lời bị dừng có thể tốn nhiều hơn số hiển thị.'],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function build() {
|
|
27
|
+
const strings = {}
|
|
28
|
+
for (const language of LANGUAGES) {
|
|
29
|
+
const pack = Object.values(await import(new URL(`../hooks/band/i18n/${language}.ts`, import.meta.url))).find(value => typeof value?.hindsight === 'string')
|
|
30
|
+
const [measured, footer] = NOTES[language]
|
|
31
|
+
// btnHow and btnDone tell Claude Code users how to paste the buttons command; DSH has a settings page instead.
|
|
32
|
+
const { btnHow, btnDone, ...shared } = pack
|
|
33
|
+
strings[language] = { ...shared, ...SETTINGS[language], measured, footer }
|
|
34
|
+
}
|
|
35
|
+
const { get2CmdInstructions } = createRequire(import.meta.url)('../hooks/2cmd-instructions.js')
|
|
36
|
+
const rules = Object.fromEntries(['hindsight', 'reuse', 'pushback', 'scout'].map(mode => [mode, get2CmdInstructions(mode)]))
|
|
37
|
+
const skills = Object.fromEntries(['review', 'audit'].map(id => [id, read(`skills/2cmd-${id}/SKILL.md`).replace(/^---[\s\S]*?---\s*/, '')]))
|
|
38
|
+
|
|
39
|
+
const plain = file => stripTypeScriptTypes(read(`hooks/band/${file}.ts`)).replace(/^import .*\n/gm, '')
|
|
40
|
+
const fill = "const fill = (text, values) => text.replace(/\\{(\\w+)\\}/g, (whole, key) => String(values[key] ?? whole))\n"
|
|
41
|
+
const board = `// Built by build.mjs from hooks/band/buttons.ts, board.ts and logo.ts. Do not edit.\n${fill}${plain('logo')}${plain('buttons')}${plain('board')}`.replace(/[ \t]+$/gm, '')
|
|
42
|
+
return { 'bundle.json': JSON.stringify({ strings, rules, skills }, null, 1) + '\n', 'board.js': board }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
46
|
+
for (const [file, text] of Object.entries(await build())) writeFileSync(new URL(file, import.meta.url), text)
|
|
47
|
+
}
|