-
Notifications
You must be signed in to change notification settings - Fork 3
Development
🌐 Language: English | 中文
npm install # installs + rebuilds better-sqlite3 for Electron
npm run typecheck # typechecks both halves, no emit — primary verification
npm run build # tsc (main) + esbuild (renderer) + copy static assets
npm start # electron . (requires a prior build)
npm run dev # build + start
npm run pack # build + electron-builder --win --dir → release/win-unpacked/
npm run dist # build + electron-builder --win → release/KinetAios Setup <ver>.exedist/, release/, node_modules/ are all gitignored.
CLAUDE.md is explicit:
Verification =
npm run typecheck+ launching the app (npm start) and driving the affected flow. Don't invent test scripts.
Both Windows 11 and macOS are first-class targets; platform-specific behavior (cmd.exe + .cmd shims + Windows paths vs. /bin/sh + unix paths) is routed at runtime.
- On macOS you can:
npm install/npm run typecheck/npm start(Electron is cross-platform; core logic smokes fine) - Cross-building is not supported: a Windows binary/NSIS installer must be built on Windows, a dmg on macOS (electron-builder + native-module rebuild need the target toolchain)
Platform-specific code paths (shell / PATH / hotkey / tray) must be verified on their target OS.
npm run typecheck
# = tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.jsonTwo independent halves:
- main process + shared (standard Node TypeScript)
- renderer (typechecked before esbuild bundles)
shared/types.ts is the pure-types + pure-functions module both halves import, so a change here is validated by both.
npm run build
# = tsc -p tsconfig.main.json # main → dist/main/*.js
# + esbuild src/renderer/app.ts quick.ts dashboard.ts files.ts \
# --bundle --format=iife --outdir=dist/renderer
# + copy src/renderer/ (non-.ts) → dist/renderer/ # html / css / images
# + copy brand.json → dist/brand.jsondist/ is the runtime root; package.json main points to dist/main/main.js. No build = npm start fails.
| Command | Output | Use |
|---|---|---|
npm run pack |
release/win-unpacked/KinetAios.exe (whole dir) |
Local trial install, sanity-check electron-builder output |
npm run dist |
release/KinetAios Setup <ver>.exe (NSIS installer) |
Real distribution, single-file installer |
scripts/pack.js adds --publish never to electron-builder (prevents accidental CI publish).
.github/workflows/release.yml:
- matrix:
windows-latest+macos-latest - steps: setup-node 18 → npm install → npm run build → npm run dist (each platform's default target)
- artifact: upload setup.exe / .dmg
- publish to Release (softprops/action-gh-release@v2, needs
permissions: contents: write)
CI failure postmortem: see ci-debug-v1.0.0.md.
package.json postinstall runs electron-builder install-app-deps, rebuilding better-sqlite3 against Electron's ABI.
At pack time electron-builder rebuilds again; asar: false avoids loading native modules from inside an asar.
brand.json (repo root):
{ "productName": "KinetAios", ... }Read at startup by src/main/brand.ts. ${getBrand().productName} is substituted into baseSystemPrompt and used throughout the UI. Renaming the product = edit this one file.
See Architecture "KinetAPI: three-layer contract" — three synchronized edits:
- Add method signature to
KinetAPIinsrc/shared/types.ts - Add
ipcRenderer.invoke/oninsrc/preload/preload.ts - Add
ipcMain.handle/oninsrc/main/main.ts
typecheck passes = all three line up.
See Tools-and-MCP "When to extend tools" — one edit:
- Add
Toolimplementation insrc/main/tools.ts - Register it in
allTools()/readOnlyTools()
The ReAct loop picks it up automatically. typecheck and ship.
See i18n "Adding a new language / Adding a new key".
- Close window = quit: no background persistence; hotkey works only while the app runs
- API key is encrypted but CLAUDE.md is stale on this (was plaintext earlier, now safeStorage)
-
Code indexing / semantic search / image multimodal / IDE plugins are on the
IMPROVEMENTS.mdroadmap, not done -
Mac→Windows cross-platform native-module build is unreliable — Windows installer must be produced on a Windows machine or
windows-latestCI
Commit directly to main, no branches (current project stage). git log is mixed but leans Chinese:
refactor(direct): memory 从 systemPrompt 移到 history[0]
fix: 切换 HTML 文件时 webview 不刷新
feat: 长期记忆面板(🧠)
Type prefixes: feat / fix / refactor / style / docs / chore / perf.