@cleocode/adapters 2026.10.3 → 2026.10.5-rc.ci.672

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 (48) hide show
  1. package/dist/heavy-command-hook.d.ts +12 -0
  2. package/dist/heavy-command-hook.d.ts.map +1 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2095 -1269
  6. package/dist/index.js.map +3 -3
  7. package/dist/providers/claude-code/adapter.d.ts.map +1 -1
  8. package/dist/providers/claude-code/hooks.d.ts +43 -17
  9. package/dist/providers/claude-code/hooks.d.ts.map +1 -1
  10. package/dist/providers/claude-code/install.d.ts +42 -14
  11. package/dist/providers/claude-code/install.d.ts.map +1 -1
  12. package/dist/providers/claude-code/paths.d.ts +77 -0
  13. package/dist/providers/claude-code/paths.d.ts.map +1 -1
  14. package/dist/providers/codex/install.d.ts.map +1 -1
  15. package/dist/providers/cursor/install.d.ts.map +1 -1
  16. package/dist/providers/gemini-cli/install.d.ts.map +1 -1
  17. package/dist/providers/kimi/install.d.ts.map +1 -1
  18. package/dist/providers/openai-sdk/install.d.ts.map +1 -1
  19. package/dist/providers/opencode/install.d.ts.map +1 -1
  20. package/dist/providers/pi/install.d.ts.map +1 -1
  21. package/dist/providers/shared/heavy-command-hook-delivery.d.ts +97 -0
  22. package/dist/providers/shared/heavy-command-hook-delivery.d.ts.map +1 -0
  23. package/dist/providers/shared/heavy-command-hook-install.d.ts +153 -7
  24. package/dist/providers/shared/heavy-command-hook-install.d.ts.map +1 -1
  25. package/dist/providers/shared/project-instruction-file.d.ts +30 -0
  26. package/dist/providers/shared/project-instruction-file.d.ts.map +1 -0
  27. package/package.json +9 -5
  28. package/src/__tests__/claude-code-adapter.test.ts +11 -6
  29. package/src/heavy-command-hook.ts +21 -0
  30. package/src/index.ts +12 -0
  31. package/src/providers/claude-code/__tests__/hooks-install.test.ts +20 -17
  32. package/src/providers/claude-code/__tests__/no-user-global-write.test.ts +293 -0
  33. package/src/providers/claude-code/adapter.ts +3 -1
  34. package/src/providers/claude-code/hooks.ts +138 -51
  35. package/src/providers/claude-code/install.ts +123 -52
  36. package/src/providers/claude-code/paths.ts +159 -1
  37. package/src/providers/codex/install.ts +7 -6
  38. package/src/providers/cursor/install.ts +26 -12
  39. package/src/providers/gemini-cli/install.ts +4 -2
  40. package/src/providers/kimi/install.ts +4 -2
  41. package/src/providers/openai-sdk/install.ts +5 -2
  42. package/src/providers/opencode/install.ts +4 -2
  43. package/src/providers/pi/install.ts +4 -2
  44. package/src/providers/shared/__tests__/heavy-command-hook-delivery.test.ts +580 -0
  45. package/src/providers/shared/__tests__/heavy-command-hook-install.test.ts +20 -0
  46. package/src/providers/shared/heavy-command-hook-delivery.ts +620 -0
  47. package/src/providers/shared/heavy-command-hook-install.ts +401 -32
  48. package/src/providers/shared/project-instruction-file.ts +47 -0
@@ -14,6 +14,7 @@ import { join } from 'node:path';
14
14
  import { ensureProviderInstructionFile } from '@cleocode/caamp';
15
15
  import type { AdapterInstallProvider, InstallOptions, InstallResult } from '@cleocode/contracts';
16
16
  import { getCleoTemplatesTildePath } from '../shared/paths.js';
17
+ import { ensureProjectInstructionFile } from '../shared/project-instruction-file.js';
17
18
 
18
19
  /**
19
20
  * Install provider for Kimi.
@@ -58,15 +59,16 @@ export class KimiInstallProvider implements AdapterInstallProvider {
58
59
  const installedAt = new Date().toISOString();
59
60
  const details: Record<string, unknown> = {};
60
61
 
61
- const result = await ensureProviderInstructionFile('kimi', projectDir, {
62
+ const result = await ensureProjectInstructionFile('kimi', projectDir, {
62
63
  references: [`@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`, '@.cleo/memory-bridge.md'],
63
64
  scope: 'project',
64
65
  });
65
66
 
66
- const instructionFileUpdated = result.action !== 'intact';
67
+ const instructionFileUpdated = result !== null && result.action !== 'intact';
67
68
  if (instructionFileUpdated) {
68
69
  details.instructionFile = result.filePath;
69
70
  }
71
+ if (result === null) details.instructionFile = 'skipped'; // T13227: $HOME project
70
72
 
71
73
  return {
72
74
  success: true,
@@ -14,6 +14,7 @@ import { join } from 'node:path';
14
14
  import { ensureProviderInstructionFile } from '@cleocode/caamp';
15
15
  import type { AdapterInstallProvider, InstallOptions, InstallResult } from '@cleocode/contracts';
16
16
  import { getCleoTemplatesTildePath } from '../shared/paths.js';
17
+ import { ensureProjectInstructionFile } from '../shared/project-instruction-file.js';
17
18
 
18
19
  /**
19
20
  * Install provider for the OpenAI SDK adapter (Vercel AI SDK).
@@ -40,15 +41,17 @@ export class OpenAiSdkInstallProvider implements AdapterInstallProvider {
40
41
  const details: Record<string, unknown> = {};
41
42
 
42
43
  // Step 1: Ensure AGENTS.md has @-references via CAAMP registry
43
- const instructionResult = await ensureProviderInstructionFile('openai-sdk', projectDir, {
44
+ const instructionResult = await ensureProjectInstructionFile('openai-sdk', projectDir, {
44
45
  references: [`@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`, '@.cleo/memory-bridge.md'],
45
46
  scope: 'project',
46
47
  });
47
48
 
48
- const instructionFileUpdated = instructionResult.action !== 'intact';
49
+ const instructionFileUpdated =
50
+ instructionResult !== null && instructionResult.action !== 'intact';
49
51
  if (instructionFileUpdated) {
50
52
  details.instructionFile = instructionResult.filePath;
51
53
  }
54
+ if (instructionResult === null) details.instructionFile = 'skipped'; // T13227: $HOME project
52
55
 
53
56
  // Step 2: Create .openai config directory stub
54
57
  const configCreated = this.ensureConfigDir(projectDir);
@@ -25,6 +25,7 @@ import {
25
25
  installProviderHookTemplates,
26
26
  } from '../shared/hook-template-installer.js';
27
27
  import { getCleoTemplatesTildePath } from '../shared/paths.js';
28
+ import { ensureProjectInstructionFile } from '../shared/project-instruction-file.js';
28
29
 
29
30
  /**
30
31
  * Install provider for OpenCode.
@@ -57,15 +58,16 @@ export class OpenCodeInstallProvider implements AdapterInstallProvider {
57
58
  const details: Record<string, unknown> = {};
58
59
 
59
60
  // Step 1: Ensure AGENTS.md has @-references via CAAMP canonical API.
60
- const instructResult = await ensureProviderInstructionFile('opencode', projectDir, {
61
+ const instructResult = await ensureProjectInstructionFile('opencode', projectDir, {
61
62
  scope: 'project',
62
63
  references: [`@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`, '@.cleo/memory-bridge.md'],
63
64
  });
64
65
 
65
- const instructionFileUpdated = instructResult.action !== 'intact';
66
+ const instructionFileUpdated = instructResult !== null && instructResult.action !== 'intact';
66
67
  if (instructionFileUpdated) {
67
68
  details.instructionFile = join(projectDir, instructResult.instructFile);
68
69
  }
70
+ if (instructResult === null) details.instructionFile = 'skipped'; // T13227: $HOME project
69
71
 
70
72
  // Step 2 (T1013): Install PreCompact hook templates + generate the JS
71
73
  // plugin wrapper that spawns the bash shim on
@@ -19,6 +19,7 @@ import { join } from 'node:path';
19
19
  import { ensureProviderInstructionFile } from '@cleocode/caamp';
20
20
  import type { AdapterInstallProvider, InstallOptions, InstallResult } from '@cleocode/contracts';
21
21
  import { getCleoTemplatesTildePath } from '../shared/paths.js';
22
+ import { ensureProjectInstructionFile } from '../shared/project-instruction-file.js';
22
23
 
23
24
  /**
24
25
  * CLEO @-references injected into Pi instruction files.
@@ -55,15 +56,16 @@ export class PiInstallProvider implements AdapterInstallProvider {
55
56
  const details: Record<string, unknown> = {};
56
57
 
57
58
  // Step 1: Ensure project AGENTS.md has @-references via CAAMP canonical API.
58
- const projectResult = await ensureProviderInstructionFile('pi', projectDir, {
59
+ const projectResult = await ensureProjectInstructionFile('pi', projectDir, {
59
60
  scope: 'project',
60
61
  references: getCleoReferences(),
61
62
  });
62
63
 
63
- const projectUpdated = projectResult.action !== 'intact';
64
+ const projectUpdated = projectResult !== null && projectResult.action !== 'intact';
64
65
  if (projectUpdated) {
65
66
  details.instructionFile = join(projectDir, projectResult.instructFile);
66
67
  }
68
+ if (projectResult === null) details.instructionFile = 'skipped'; // T13227: $HOME project
67
69
 
68
70
  // Step 2: Ensure global AGENTS.md has @-references (best-effort).
69
71
  // CAAMP resolves pathGlobal from the registry ($HOME/.pi/agent).