@miphamai/cli 0.81.2 → 0.81.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miphamai/cli",
3
- "version": "0.81.2",
3
+ "version": "0.81.3",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",
@@ -39,7 +39,8 @@
39
39
  "build": "bun run scripts/generate-bundled-skills.ts && bun build --compile --minify ./bin/mipham.ts --outfile dist/mipham",
40
40
  "typecheck": "tsc --noEmit",
41
41
  "test": "vitest run",
42
- "knip": "knip --production --no-progress --no-exit-code"
42
+ "knip": "knip --production --no-progress --no-exit-code",
43
+ "coverage": "vitest run --coverage --coverage.provider=v8 --coverage.include='src/**/*.{ts,tsx}' --coverage.reporter=text-summary --coverage.reporter=json-summary"
43
44
  },
44
45
  "dependencies": {
45
46
  "@larksuiteoapi/node-sdk": "^1.73.0",
@@ -55,6 +56,7 @@
55
56
  "@types/bun": "^1.4.2",
56
57
  "@types/node": "^22.19.19",
57
58
  "@types/react": "^19.3.0",
59
+ "@vitest/coverage-v8": "^5.0.0",
58
60
  "ink-testing-library": "^4.0.0",
59
61
  "vitest": "^5.0.0"
60
62
  }
@@ -1038,6 +1038,10 @@ export class QueryEngine {
1038
1038
  })
1039
1039
  this.context.addToolResult(toolUse.id, result)
1040
1040
  }
1041
+
1042
+ // Path-scoped rules for files touched in this round: process() injects for
1043
+ // the first tool round only, so the multi-turn rounds need their own call.
1044
+ this.injectRules()
1041
1045
  }
1042
1046
  // Max turns reached — safety limit, stop gracefully
1043
1047
  }
package/src/index.tsx CHANGED
@@ -26,6 +26,7 @@ import { loadSessionMemories, getMemoryManager } from './core/memory/memory-load
26
26
  import { ContextManager } from './core/context'
27
27
  import { PrefixCacheTracker } from './core/context-token'
28
28
  import { QueryEngine } from './core/engine'
29
+ import { RulesLoader } from './core/rules-loader'
29
30
  import { generateSessionName } from './core/session-name'
30
31
  import { ExperienceRuleEngine } from './core/rule-engine.js'
31
32
  import { SessionLog } from './core/session-log'
@@ -535,6 +536,10 @@ export async function runApp(options: RunOptions): Promise<void> {
535
536
  engine.setSkills(vajraContext.get(SKILLS_KEY)!)
536
537
  engine.setLlm(vajraContext.get(LLM_KEY)!)
537
538
 
539
+ // Path-scoped rules (.mipham/rules/*.md) — injected when the AI touches a
540
+ // matching file. Loaded once at startup; setRulesLoader performs the load.
541
+ engine.setRulesLoader(new RulesLoader(process.cwd()))
542
+
538
543
  // Wire inference hooks (DLP) configuration
539
544
  const inferenceHookConfig = loadInferenceHookConfig()
540
545
  engine.setInferenceHookConfig(inferenceHookConfig)
@@ -9,7 +9,7 @@
9
9
  export const PACKAGE_NAME = '@miphamai/cli' as const
10
10
 
11
11
  /** 当前发布版本 */
12
- export const PACKAGE_VERSION = '0.81.2' as const
12
+ export const PACKAGE_VERSION = '0.81.3' as const
13
13
 
14
14
  /** npm install 全局安装命令 */
15
15
  export const NPM_INSTALL_COMMAND = `npm install -g ${PACKAGE_NAME}` as const