@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.
- package/dist/heavy-command-hook.d.ts +12 -0
- package/dist/heavy-command-hook.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2095 -1269
- package/dist/index.js.map +3 -3
- package/dist/providers/claude-code/adapter.d.ts.map +1 -1
- package/dist/providers/claude-code/hooks.d.ts +43 -17
- package/dist/providers/claude-code/hooks.d.ts.map +1 -1
- package/dist/providers/claude-code/install.d.ts +42 -14
- package/dist/providers/claude-code/install.d.ts.map +1 -1
- package/dist/providers/claude-code/paths.d.ts +77 -0
- package/dist/providers/claude-code/paths.d.ts.map +1 -1
- package/dist/providers/codex/install.d.ts.map +1 -1
- package/dist/providers/cursor/install.d.ts.map +1 -1
- package/dist/providers/gemini-cli/install.d.ts.map +1 -1
- package/dist/providers/kimi/install.d.ts.map +1 -1
- package/dist/providers/openai-sdk/install.d.ts.map +1 -1
- package/dist/providers/opencode/install.d.ts.map +1 -1
- package/dist/providers/pi/install.d.ts.map +1 -1
- package/dist/providers/shared/heavy-command-hook-delivery.d.ts +97 -0
- package/dist/providers/shared/heavy-command-hook-delivery.d.ts.map +1 -0
- package/dist/providers/shared/heavy-command-hook-install.d.ts +153 -7
- package/dist/providers/shared/heavy-command-hook-install.d.ts.map +1 -1
- package/dist/providers/shared/project-instruction-file.d.ts +30 -0
- package/dist/providers/shared/project-instruction-file.d.ts.map +1 -0
- package/package.json +9 -5
- package/src/__tests__/claude-code-adapter.test.ts +11 -6
- package/src/heavy-command-hook.ts +21 -0
- package/src/index.ts +12 -0
- package/src/providers/claude-code/__tests__/hooks-install.test.ts +20 -17
- package/src/providers/claude-code/__tests__/no-user-global-write.test.ts +293 -0
- package/src/providers/claude-code/adapter.ts +3 -1
- package/src/providers/claude-code/hooks.ts +138 -51
- package/src/providers/claude-code/install.ts +123 -52
- package/src/providers/claude-code/paths.ts +159 -1
- package/src/providers/codex/install.ts +7 -6
- package/src/providers/cursor/install.ts +26 -12
- package/src/providers/gemini-cli/install.ts +4 -2
- package/src/providers/kimi/install.ts +4 -2
- package/src/providers/openai-sdk/install.ts +5 -2
- package/src/providers/opencode/install.ts +4 -2
- package/src/providers/pi/install.ts +4 -2
- package/src/providers/shared/__tests__/heavy-command-hook-delivery.test.ts +580 -0
- package/src/providers/shared/__tests__/heavy-command-hook-install.test.ts +20 -0
- package/src/providers/shared/heavy-command-hook-delivery.ts +620 -0
- package/src/providers/shared/heavy-command-hook-install.ts +401 -32
- 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
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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).
|