chati-dev 4.0.11 → 4.1.1

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.
Files changed (116) hide show
  1. package/README.md +14 -9
  2. package/bin/chati.js +17 -1
  3. package/framework/agents/build/dev.md +43 -10
  4. package/framework/agents/discover/brief.md +38 -8
  5. package/framework/agents/discover/brownfield-wu.md +44 -3
  6. package/framework/agents/discover/greenfield-wu.md +14 -0
  7. package/framework/agents/plan/architect-data-engineer.md +278 -0
  8. package/framework/agents/plan/architect-system.md +174 -0
  9. package/framework/agents/plan/architect.md +97 -301
  10. package/framework/agents/plan/detail.md +25 -0
  11. package/framework/agents/plan/tasks.md +29 -1
  12. package/framework/agents/plan/ux-brand-architect.md +215 -0
  13. package/framework/agents/plan/ux-component-engineer.md +289 -0
  14. package/framework/agents/plan/ux-researcher.md +166 -0
  15. package/framework/agents/plan/ux.md +126 -1008
  16. package/framework/agents/quality/qa-implementation.md +121 -22
  17. package/framework/agents/quality/qa-planning.md +18 -0
  18. package/framework/config.yaml +15 -4
  19. package/framework/constitution.md +9 -3
  20. package/framework/context/root.md +2 -2
  21. package/framework/data/entity-registry.yaml +59 -3
  22. package/framework/hooks/constitution-guard.js +67 -1
  23. package/framework/hooks/license-guard.js +4 -4
  24. package/framework/hooks/model-governance.js +2 -1
  25. package/framework/hooks/prism-engine.js +74 -6
  26. package/framework/hooks/read-protection.js +1 -1
  27. package/framework/hooks/session-digest.js +159 -7
  28. package/framework/hooks/settings.json +16 -4
  29. package/framework/hooks/style-guard.js +134 -0
  30. package/framework/hooks/undercover-guard.js +220 -0
  31. package/framework/i18n/en.yaml +2 -2
  32. package/framework/i18n/es.yaml +2 -2
  33. package/framework/i18n/fr.yaml +2 -2
  34. package/framework/i18n/pt.yaml +2 -2
  35. package/framework/intelligence/context-engine.md +21 -0
  36. package/framework/intelligence/hooks-performance.md +54 -0
  37. package/framework/intelligence/memory-layer.md +47 -0
  38. package/framework/migrations/v4.0-to-v4.1.yaml +165 -0
  39. package/framework/orchestrator/chati.md +327 -1067
  40. package/framework/schemas/session.schema.json +1 -1
  41. package/framework/templates/brandbook-html-tmpl.md +107 -0
  42. package/framework/templates/session-memory-tmpl.yaml +68 -0
  43. package/package.json +1 -1
  44. package/scripts/doctor/checks/agents.js +1 -1
  45. package/scripts/health-check.js +1 -1
  46. package/src/autonomy/build-state.js +1 -1
  47. package/src/autonomy/worktree-manager.js +13 -13
  48. package/src/config/agent-customizer.js +1 -1
  49. package/src/config/gemini-hooks-generator.js +149 -6
  50. package/src/config/ide-configs.js +1 -1
  51. package/src/context/bracket-tracker.js +25 -4
  52. package/src/context/engine.js +37 -7
  53. package/src/context/formatter.js +45 -1
  54. package/src/context/index.js +3 -3
  55. package/src/dashboard/data-reader.js +7 -7
  56. package/src/decision/engine.js +2 -2
  57. package/src/decision/registry-healer.js +1 -1
  58. package/src/decision/registry-updater.js +2 -2
  59. package/src/extensions/loader.js +1 -1
  60. package/src/gates/g1-planning-complete.js +1 -1
  61. package/src/gates/g2-qa-planning.js +1 -1
  62. package/src/gates/g3-implementation.js +4 -4
  63. package/src/gates/g4-qa-implementation.js +2 -2
  64. package/src/health/auto-fix.js +3 -3
  65. package/src/health/engine.js +2 -2
  66. package/src/installer/brownfield-upgrader.js +3 -3
  67. package/src/installer/manifest.js +1 -1
  68. package/src/installer/transaction.js +1 -1
  69. package/src/installer/validator.js +4 -4
  70. package/src/intelligence/decision-engine.js +1 -1
  71. package/src/intelligence/memory-manager.js +1 -1
  72. package/src/intelligence/registry-manager.js +2 -2
  73. package/src/intelligence/timeline.js +1 -1
  74. package/src/license/client.js +1 -1
  75. package/src/license/commands.js +2 -2
  76. package/src/memory/agent-memory.js +3 -3
  77. package/src/memory/daily-digest.js +170 -0
  78. package/src/memory/dream.js +254 -0
  79. package/src/memory/gotchas.js +2 -2
  80. package/src/memory/index.js +18 -0
  81. package/src/memory/magic-docs.js +98 -0
  82. package/src/memory/memory-extractor.js +163 -0
  83. package/src/memory/session-digest.js +144 -6
  84. package/src/merger/yaml-merger.js +1 -1
  85. package/src/orchestrator/cli.js +980 -0
  86. package/src/orchestrator/handoff-engine.js +31 -4
  87. package/src/orchestrator/index.js +9 -0
  88. package/src/orchestrator/session-manager.js +1 -1
  89. package/src/preview/detector.js +3 -3
  90. package/src/preview/launcher.js +2 -2
  91. package/src/quality/metrics-collector.js +1 -1
  92. package/src/quality/test-runner.js +2 -4
  93. package/src/scanning/density-scanner.js +51 -0
  94. package/src/scanning/env-scanner.js +97 -0
  95. package/src/scanning/index.js +7 -0
  96. package/src/scanning/leakage-scanner.js +54 -0
  97. package/src/scanning/placeholder-scanner.js +40 -0
  98. package/src/scanning/security-scanner.js +94 -0
  99. package/src/security/bash-security.js +335 -0
  100. package/src/security/index.js +9 -0
  101. package/src/telemetry/config.js +3 -3
  102. package/src/telemetry/sender.js +1 -1
  103. package/src/terminal/cli-registry.js +1 -1
  104. package/src/terminal/cost-tracker.js +1 -2
  105. package/src/terminal/prompt-builder.js +11 -27
  106. package/src/terminal/rate-limiter.js +1 -2
  107. package/src/terminal/run-agent.js +3 -3
  108. package/src/terminal/spawner.js +41 -4
  109. package/src/upgrade/checker.js +2 -2
  110. package/src/upgrade/migrator.js +1 -1
  111. package/src/utils/config-parser.js +1 -1
  112. package/src/utils/file-lock.js +3 -3
  113. package/src/utils/provider-limits.js +35 -4
  114. package/src/wizard/i18n.js +4 -4
  115. package/src/wizard/index.js +2 -1
  116. package/src/wizard/questions.js +4 -2
@@ -1,13 +1,44 @@
1
1
  /**
2
- * @fileoverview Canonical provider context window limits.
2
+ * @fileoverview Canonical context window limits by provider and model.
3
3
  *
4
- * Single source of truth for provider token limits used by
5
- * bracket-tracker, context-status, and prompt-builder.
4
+ * Single source of truth for token limits used by
5
+ * bracket-tracker, context-status, prompt-builder, and prism-engine hook.
6
+ *
7
+ * SYNC: chati.dev/hooks/prism-engine.js has an inline copy of MODEL_LIMITS.
8
+ * If you update here, update there too.
6
9
  */
7
10
 
8
- /** Provider context window limits (tokens). */
11
+ /** Provider context window limits (tokens) — fallback when model unknown. */
9
12
  export const PROVIDER_LIMITS = {
10
13
  claude: 200_000,
11
14
  gemini: 1_000_000,
12
15
  codex: 128_000,
13
16
  };
17
+
18
+ /**
19
+ * Model-specific context window limits (tokens).
20
+ * Takes precedence over PROVIDER_LIMITS when model tier is known.
21
+ */
22
+ export const MODEL_LIMITS = {
23
+ // Claude models
24
+ opus: 1_000_000,
25
+ sonnet: 200_000,
26
+ haiku: 200_000,
27
+ // Gemini models
28
+ pro: 1_000_000,
29
+ flash: 1_000_000,
30
+ // Codex models
31
+ codex: 128_000,
32
+ };
33
+
34
+ /**
35
+ * Resolve context window limit: model-specific > provider fallback > default.
36
+ * @param {string} [model] - Model tier (opus, sonnet, haiku, pro, flash, codex)
37
+ * @param {string} [provider] - Provider name (claude, gemini, codex)
38
+ * @returns {number} Context window limit in tokens
39
+ */
40
+ export function resolveContextLimit(model, provider) {
41
+ if (model && MODEL_LIMITS[model]) return MODEL_LIMITS[model];
42
+ if (provider && PROVIDER_LIMITS[provider]) return PROVIDER_LIMITS[provider];
43
+ return 200_000;
44
+ }
@@ -35,7 +35,7 @@ const FALLBACK_EN = {
35
35
  quick_start_switch_hint: 'Switch CLIs anytime — your session continues from where you left off',
36
36
  created_overlays: 'Created provider overlay directories',
37
37
  will_install: 'Will install:',
38
- agents_count: '13 agent definitions (DISCOVER, PLAN, BUILD, DEPLOY phases)',
38
+ agents_count: 'Specialized agent definitions across DISCOVER, PLAN, BUILD, DEPLOY phases',
39
39
  workflows_count: '6 workflow blueprints',
40
40
  templates_count: '6 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate, Quick Brief)',
41
41
  constitution: 'Constitution (19 Articles + Preamble)',
@@ -51,7 +51,7 @@ const FALLBACK_EN = {
51
51
  created_claude_md: 'Created CLAUDE.md',
52
52
  configured_mcps: 'Configured MCPs:',
53
53
  validating: 'Validating installation...',
54
- agents_valid: 'All 13 agents implement 8 protocols',
54
+ agents_valid: 'All agents implement 8 protocols',
55
55
  handoff_ok: 'Handoff protocol: OK',
56
56
  validation_ok: 'Self-validation criteria: OK',
57
57
  constitution_ok: 'Constitution: 19 articles verified',
@@ -137,8 +137,8 @@ export function loadLanguage(lang, targetDir = null) {
137
137
  const parsed = yaml.load(content);
138
138
  currentStrings = parsed;
139
139
  return currentStrings;
140
- } catch {
141
- // Fall through to next path
140
+ } catch (err) {
141
+ process.stderr.write(`[chati] i18n load-lang: ${err.message}\n`);
142
142
  }
143
143
  }
144
144
  }
@@ -26,7 +26,8 @@ export async function runWizard(targetDir, options = {}) {
26
26
  let logoText;
27
27
  try {
28
28
  logoText = readFileSync(join(__dirname, '..', '..', 'assets', 'logo.txt'), 'utf-8');
29
- } catch {
29
+ } catch (err) {
30
+ process.stderr.write(`[chati] wizard logo: ${err.message}\n`);
30
31
  logoText = 'chati.dev';
31
32
  }
32
33
 
@@ -83,7 +83,8 @@ export async function stepProviderSelection() {
83
83
  let installed;
84
84
  try {
85
85
  installed = provider ? await isProviderAvailable(provider) : false;
86
- } catch {
86
+ } catch (err) {
87
+ process.stderr.write(`[chati] wizard provider-detect: ${err.message}\n`);
87
88
  installed = key === 'claude-code';
88
89
  }
89
90
  const suffix = !installed ? ` ${dim(t('installer.llm_provider_not_installed'))}` : '';
@@ -154,7 +155,8 @@ export async function stepIDESelection() {
154
155
  const provider = IDE_TO_PROVIDER[ide];
155
156
  try {
156
157
  availability[ide] = provider ? await isProviderAvailable(provider) : false;
157
- } catch {
158
+ } catch (err) {
159
+ process.stderr.write(`[chati] wizard editor-detect: ${err.message}\n`);
158
160
  availability[ide] = ide === 'claude-code';
159
161
  }
160
162
  }