@crewx/cli 0.9.0-rc.9 → 0.9.0-rc.91

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 (45) hide show
  1. package/dist/bootstrap/codex-writable-roots.d.ts +13 -0
  2. package/dist/bootstrap/codex-writable-roots.js +25 -0
  3. package/dist/bootstrap/crewx-cli.js +2 -1
  4. package/dist/builtin.js +1 -0
  5. package/dist/commands/agent.js +0 -58
  6. package/dist/commands/db.d.ts +1 -0
  7. package/dist/commands/db.js +191 -1
  8. package/dist/commands/doctor.d.ts +53 -0
  9. package/dist/commands/doctor.js +391 -21
  10. package/dist/commands/emit-trailer.d.ts +25 -0
  11. package/dist/commands/emit-trailer.js +33 -0
  12. package/dist/commands/execute.d.ts +6 -1
  13. package/dist/commands/execute.js +162 -11
  14. package/dist/commands/hook/command-marker.d.ts +2 -0
  15. package/dist/commands/hook/command-marker.js +5 -0
  16. package/dist/commands/hook/install.d.ts +0 -1
  17. package/dist/commands/hook/install.js +60 -63
  18. package/dist/commands/hook/status.js +3 -3
  19. package/dist/commands/hook/uninstall.js +2 -2
  20. package/dist/commands/init.js +22 -1
  21. package/dist/commands/log.js +4 -3
  22. package/dist/commands/parse-common-flags.d.ts +5 -1
  23. package/dist/commands/parse-common-flags.js +6 -2
  24. package/dist/commands/ps.js +7 -6
  25. package/dist/commands/publish.d.ts +1 -0
  26. package/dist/commands/publish.js +290 -0
  27. package/dist/commands/query.d.ts +3 -1
  28. package/dist/commands/query.js +78 -11
  29. package/dist/commands/registry.js +3 -1
  30. package/dist/commands/result.d.ts +7 -3
  31. package/dist/commands/result.js +41 -6
  32. package/dist/commands/shortcut.d.ts +1 -0
  33. package/dist/commands/shortcut.js +267 -0
  34. package/dist/commands/slack.js +2 -1
  35. package/dist/commands/write-output.d.ts +3 -0
  36. package/dist/commands/write-output.js +24 -0
  37. package/dist/logging.d.ts +1 -1
  38. package/dist/logging.js +3 -2
  39. package/dist/main.d.ts +3 -2
  40. package/dist/main.js +56 -11
  41. package/dist/utils/env-defaults.d.ts +2 -5
  42. package/dist/utils/env-defaults.js +10 -5
  43. package/dist/utils/sdk-compat.d.ts +24 -0
  44. package/dist/utils/sdk-compat.js +120 -0
  45. package/package.json +13 -11
@@ -33,6 +33,19 @@ export declare function escapeTomlBasicString(value: string): string;
33
33
  * Works for both `codex exec` and `codex exec resume` (config-override form).
34
34
  */
35
35
  export declare function buildCodexWritableRootArgs(crewxHome: string): string[];
36
+ /**
37
+ * Create an `AdditionalArgsProvider` that skips Codex's git repository trust
38
+ * check for a resolved workspace.
39
+ *
40
+ * The workspace is resolved by the product layer, so an unavailable workspace
41
+ * must not fall back to the host cwd. The flag is independent of execution
42
+ * mode because it controls repository trust rather than filesystem access.
43
+ */
44
+ export declare function createCodexSkipGitRepoCheckProvider(workspaceRoot: string | undefined): AdditionalArgsProvider;
45
+ /**
46
+ * Compose product-layer argument providers while preserving their order.
47
+ */
48
+ export declare function composeAdditionalArgsProviders(...providers: AdditionalArgsProvider[]): AdditionalArgsProvider;
36
49
  /**
37
50
  * Create an `AdditionalArgsProvider` (SDK extension point, WI-20260703-001)
38
51
  * that injects CrewX home as a Codex writable root for `workspace-write`
@@ -20,6 +20,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.resolveCrewxHome = resolveCrewxHome;
21
21
  exports.escapeTomlBasicString = escapeTomlBasicString;
22
22
  exports.buildCodexWritableRootArgs = buildCodexWritableRootArgs;
23
+ exports.createCodexSkipGitRepoCheckProvider = createCodexSkipGitRepoCheckProvider;
24
+ exports.composeAdditionalArgsProviders = composeAdditionalArgsProviders;
23
25
  exports.createCodexWritableRootsProvider = createCodexWritableRootsProvider;
24
26
  const os_1 = require("os");
25
27
  const path_1 = require("path");
@@ -68,6 +70,29 @@ function buildCodexWritableRootArgs(crewxHome) {
68
70
  function isCodexProvider(ctx) {
69
71
  return ctx.providerId === 'codex' || ctx.providerStr === 'cli/codex';
70
72
  }
73
+ /**
74
+ * Create an `AdditionalArgsProvider` that skips Codex's git repository trust
75
+ * check for a resolved workspace.
76
+ *
77
+ * The workspace is resolved by the product layer, so an unavailable workspace
78
+ * must not fall back to the host cwd. The flag is independent of execution
79
+ * mode because it controls repository trust rather than filesystem access.
80
+ */
81
+ function createCodexSkipGitRepoCheckProvider(workspaceRoot) {
82
+ return (ctx) => {
83
+ if (!isCodexProvider(ctx))
84
+ return [];
85
+ if (!workspaceRoot)
86
+ return [];
87
+ return ['--skip-git-repo-check'];
88
+ };
89
+ }
90
+ /**
91
+ * Compose product-layer argument providers while preserving their order.
92
+ */
93
+ function composeAdditionalArgsProviders(...providers) {
94
+ return (ctx) => providers.flatMap((provider) => provider(ctx));
95
+ }
71
96
  /**
72
97
  * Create an `AdditionalArgsProvider` (SDK extension point, WI-20260703-001)
73
98
  * that injects CrewX home as a Codex writable root for `workspace-write`
@@ -40,6 +40,7 @@ async function createCliCrewx(configPath = process.env.CREWX_CONFIG ?? 'crewx.ya
40
40
  else {
41
41
  yamlPath = undefined;
42
42
  }
43
+ const skipRoot = yamlPath !== undefined ? (0, path_1.dirname)(absConfigPath) : undefined;
43
44
  // Run drizzle migrations once at bootstrap — plugin relies on this guarantee.
44
45
  const dbDir = (0, path_1.join)((0, os_1.homedir)(), '.crewx');
45
46
  (0, fs_1.mkdirSync)(dbDir, { recursive: true });
@@ -53,7 +54,7 @@ async function createCliCrewx(configPath = process.env.CREWX_CONFIG ?? 'crewx.ya
53
54
  }
54
55
  const crewx = await sdk_1.Crewx.loadYaml(yamlPath, {
55
56
  remoteFactory: createCliCrewx,
56
- additionalArgsProvider: (0, codex_writable_roots_1.createCodexWritableRootsProvider)(),
57
+ additionalArgsProvider: (0, codex_writable_roots_1.composeAdditionalArgsProviders)((0, codex_writable_roots_1.createCodexWritableRootsProvider)(), (0, codex_writable_roots_1.createCodexSkipGitRepoCheckProvider)(skipRoot)),
57
58
  });
58
59
  (0, register_builtin_tools_1.registerBuiltinToolsIfNeeded)(crewx);
59
60
  await crewx.use(new plugins_1.ConversationPlugin());
package/dist/builtin.js CHANGED
@@ -55,6 +55,7 @@ const BUILTIN_MAP = {
55
55
  dreaming: () => Promise.resolve().then(() => __importStar(require('@crewx/dreaming/cli'))),
56
56
  wi: () => Promise.resolve().then(() => __importStar(require('@crewx/wi/cli'))),
57
57
  chromex: () => Promise.resolve().then(() => __importStar(require('@crewx/chromex/cli'))),
58
+ notify: () => Promise.resolve().then(() => __importStar(require('@crewx/notify/cli'))),
58
59
  };
59
60
  exports.BUILTIN_COMMANDS = new Set(Object.keys(BUILTIN_MAP));
60
61
  // Load skill-tracer for observability (graceful degradation if unavailable)
@@ -3,46 +3,11 @@
3
3
  * crewx agent handler.
4
4
  * Dispatches `crewx agent ls` and `crewx agent prompt` subcommands.
5
5
  */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || (function () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
6
  Object.defineProperty(exports, "__esModule", { value: true });
40
7
  exports.handleAgent = handleAgent;
41
- const path = __importStar(require("path"));
42
8
  const fs_1 = require("fs");
43
9
  const crewx_cli_1 = require("../bootstrap/crewx-cli");
44
10
  const sdk_1 = require("@crewx/sdk");
45
- const skill_1 = require("@crewx/skill");
46
11
  /**
47
12
  * Parse a flag from args array.
48
13
  * Supports both `--flag=value` and `--flag value` forms.
@@ -135,11 +100,9 @@ async function handleAgentPrompt(crewx, args) {
135
100
  process.exit(1);
136
101
  }
137
102
  try {
138
- const skills = loadAgentSkills();
139
103
  const rendered = await crewx.renderAgentPromptFull(agentIdRaw, {
140
104
  env: process.env,
141
105
  session: { mode: 'query', platform: 'cli' },
142
- skills,
143
106
  });
144
107
  const displayId = agentIdRaw.startsWith('@') ? agentIdRaw.slice(1) : agentIdRaw;
145
108
  console.log(`\n🤖 **Rendered Prompt for Agent: ${displayId}**\n`);
@@ -197,27 +160,6 @@ async function handleAgent(args) {
197
160
  process.exit(1);
198
161
  }
199
162
  }
200
- /**
201
- * Discover available skills and convert to SkillEntry format for template rendering.
202
- * Searches skills/ and node_modules/@crewx directories.
203
- */
204
- function loadAgentSkills() {
205
- try {
206
- const engine = new skill_1.SkillEngine(process.cwd());
207
- const discovered = engine.discover();
208
- return discovered.map(s => ({
209
- metadata: {
210
- name: s.name,
211
- version: s.version ?? '0.0.0',
212
- description: s.description ?? '',
213
- },
214
- filePath: s.skillMdPath ?? path.join(s.dir, 'SKILL.md'),
215
- }));
216
- }
217
- catch {
218
- return [];
219
- }
220
- }
221
163
  function printAgentHelp() {
222
164
  console.log(`
223
165
  CrewX Agent Management
@@ -6,4 +6,5 @@
6
6
  * crewx db push --force Apply without confirmation + reset migration history
7
7
  * crewx db push --dry-run Show preview only, no changes
8
8
  */
9
+ export declare const TASK_LOG_MIGRATION_HELP = "Usage:\n crewx db migrate-task-logs --dry-run [--db PATH]\n crewx db migrate-task-logs --apply [--db PATH] [--batch-tasks N]\n crewx db migrate-task-logs --verify [--db PATH]\n\nModes:\n --dry-run Read and validate legacy blobs without writing or creating a backup.\n --apply Create a consistent SQLite backup, then migrate one task per transaction.\n --verify Check source invariants, event sequences, counts, and orphan rows.\n\nApply policy:\n Only blob tasks with status success, failed, or completed are migrated.\n pending, running, paused, and unknown statuses are deferred for a later run.\n There is no --force or --include-active option. Apply requires the estimated\n database/event growth plus a 10 GiB free-space reserve.\n\nExit codes:\n 0 Completed with no malformed rows or invariant failures.\n 1 Safe tasks completed but a row/invariant failed, or apply was blocked.\n 2 Invalid command-line arguments.\n\nThe command never runs automatically at server startup and never runs VACUUM.";
9
10
  export declare function handleDb(args: string[]): Promise<void>;
@@ -11,12 +11,36 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  return (mod && mod.__esModule) ? mod : { "default": mod };
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.TASK_LOG_MIGRATION_HELP = void 0;
14
15
  exports.handleDb = handleDb;
15
16
  const path_1 = __importDefault(require("path"));
16
17
  const os_1 = __importDefault(require("os"));
17
18
  const readline_1 = __importDefault(require("readline"));
18
19
  const repository_1 = require("@crewx/sdk/repository");
19
20
  const repository_2 = require("@crewx/sdk/repository");
21
+ const repository_3 = require("@crewx/sdk/repository");
22
+ exports.TASK_LOG_MIGRATION_HELP = `Usage:
23
+ crewx db migrate-task-logs --dry-run [--db PATH]
24
+ crewx db migrate-task-logs --apply [--db PATH] [--batch-tasks N]
25
+ crewx db migrate-task-logs --verify [--db PATH]
26
+
27
+ Modes:
28
+ --dry-run Read and validate legacy blobs without writing or creating a backup.
29
+ --apply Create a consistent SQLite backup, then migrate one task per transaction.
30
+ --verify Check source invariants, event sequences, counts, and orphan rows.
31
+
32
+ Apply policy:
33
+ Only blob tasks with status success, failed, or completed are migrated.
34
+ pending, running, paused, and unknown statuses are deferred for a later run.
35
+ There is no --force or --include-active option. Apply requires the estimated
36
+ database/event growth plus a 10 GiB free-space reserve.
37
+
38
+ Exit codes:
39
+ 0 Completed with no malformed rows or invariant failures.
40
+ 1 Safe tasks completed but a row/invariant failed, or apply was blocked.
41
+ 2 Invalid command-line arguments.
42
+
43
+ The command never runs automatically at server startup and never runs VACUUM.`;
20
44
  function defaultDbPath() {
21
45
  return path_1.default.join(os_1.default.homedir(), '.crewx', 'crewx.db');
22
46
  }
@@ -57,6 +81,12 @@ function formatPreview(result, dbPath) {
57
81
  function hasChanges(result) {
58
82
  return result.created.length > 0 || result.altered.length > 0;
59
83
  }
84
+ function formatStatusCounts(counts) {
85
+ const entries = Object.entries(counts ?? {});
86
+ return entries.length > 0
87
+ ? entries.map(([status, count]) => `${status}=${count}`).join(', ')
88
+ : '(none)';
89
+ }
60
90
  function prompt(question) {
61
91
  const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stdout });
62
92
  return new Promise((resolve) => {
@@ -68,13 +98,173 @@ function prompt(question) {
68
98
  }
69
99
  async function handleDb(args) {
70
100
  const subcommand = args[0];
101
+ if (subcommand === 'migrate-task-logs') {
102
+ await handleTaskLogMigration(args.slice(1));
103
+ return;
104
+ }
105
+ if (subcommand === '--help' || subcommand === '-h') {
106
+ console.log('Usage: crewx db push [--force] [--dry-run]');
107
+ console.log(exports.TASK_LOG_MIGRATION_HELP);
108
+ return;
109
+ }
71
110
  if (!subcommand || subcommand === 'push') {
72
111
  await handleDbPush(args.slice(subcommand === 'push' ? 1 : 0));
73
112
  return;
74
113
  }
75
114
  console.error(`Unknown db subcommand: ${subcommand}`);
76
115
  console.error('Usage: crewx db push [--force] [--dry-run]');
77
- process.exit(1);
116
+ console.error(exports.TASK_LOG_MIGRATION_HELP);
117
+ process.exitCode = 2;
118
+ }
119
+ class TaskLogMigrationUsageError extends Error {
120
+ }
121
+ function parseTaskLogMigrationArgs(args) {
122
+ let mode;
123
+ let dbPath;
124
+ let batchTasks;
125
+ const setMode = (next) => {
126
+ if (mode)
127
+ throw new TaskLogMigrationUsageError('Choose exactly one of --dry-run, --apply, or --verify.');
128
+ mode = next;
129
+ };
130
+ const requireValue = (args, index, flag) => {
131
+ const value = args[index + 1];
132
+ if (!value || value.startsWith('--'))
133
+ throw new TaskLogMigrationUsageError(`${flag} requires a value.`);
134
+ return value;
135
+ };
136
+ for (let index = 0; index < args.length; index += 1) {
137
+ const arg = args[index];
138
+ if (arg === '--help' || arg === '-h') {
139
+ throw new TaskLogMigrationUsageError(exports.TASK_LOG_MIGRATION_HELP);
140
+ }
141
+ if (arg === '--dry-run') {
142
+ setMode('dry-run');
143
+ continue;
144
+ }
145
+ if (arg === '--apply') {
146
+ setMode('apply');
147
+ continue;
148
+ }
149
+ if (arg === '--verify') {
150
+ setMode('verify');
151
+ continue;
152
+ }
153
+ if (arg === '--db') {
154
+ dbPath = requireValue(args, index, '--db');
155
+ index += 1;
156
+ continue;
157
+ }
158
+ if (arg.startsWith('--db=')) {
159
+ dbPath = arg.slice('--db='.length);
160
+ if (!dbPath)
161
+ throw new TaskLogMigrationUsageError('--db requires a value.');
162
+ continue;
163
+ }
164
+ if (arg === '--batch-tasks') {
165
+ const value = requireValue(args, index, '--batch-tasks');
166
+ const parsed = Number(value);
167
+ if (!Number.isSafeInteger(parsed) || parsed < 1) {
168
+ throw new TaskLogMigrationUsageError('--batch-tasks must be a positive integer.');
169
+ }
170
+ batchTasks = parsed;
171
+ index += 1;
172
+ continue;
173
+ }
174
+ if (arg.startsWith('--batch-tasks=')) {
175
+ const value = arg.slice('--batch-tasks='.length);
176
+ const parsed = Number(value);
177
+ if (!Number.isSafeInteger(parsed) || parsed < 1) {
178
+ throw new TaskLogMigrationUsageError('--batch-tasks must be a positive integer.');
179
+ }
180
+ batchTasks = parsed;
181
+ continue;
182
+ }
183
+ throw new TaskLogMigrationUsageError(`Unknown option: ${arg}`);
184
+ }
185
+ if (!mode)
186
+ throw new TaskLogMigrationUsageError('Choose one of --dry-run, --apply, or --verify.');
187
+ if (batchTasks !== undefined && mode !== 'apply') {
188
+ throw new TaskLogMigrationUsageError('--batch-tasks is only valid with --apply.');
189
+ }
190
+ return { mode, dbPath, batchTasks };
191
+ }
192
+ function formatMigrationReport(report) {
193
+ const modeLabel = report.mode === 'dry-run' ? 'Dry-run' : report.mode === 'apply' ? 'Apply' : 'Verify';
194
+ const lines = [
195
+ `[crewx] Task-log migration — ${modeLabel}`,
196
+ ` Database: ${report.dbPath}`,
197
+ ` Tasks scanned: ${report.taskCount}`,
198
+ ` Blob candidates: ${report.candidateTaskCount}`,
199
+ ` Eligible terminal blobs: ${report.eligibleTaskCount}`,
200
+ ` Status counts: ${formatStatusCounts(report.statusCounts)}`,
201
+ ` Deferred blob tasks: ${report.deferredTaskCount}`,
202
+ ` Deferred statuses: ${formatStatusCounts(report.deferredStatusCounts)}`,
203
+ ` Entries: ${report.entryCount}`,
204
+ ` Source bytes: ${report.sourceBytes}`,
205
+ ` Estimated free-space need: ${report.estimatedFreeSpaceBytes}`,
206
+ ` Required free space (with reserve): ${report.requiredFreeSpaceBytes}`,
207
+ ` Available free space: ${report.availableFreeSpaceBytes}`,
208
+ ` Free-space gate: ${report.freeSpaceGatePassed ? 'PASS' : 'FAIL'}`,
209
+ ` Migrated: ${report.migratedTasks} task(s), ${report.migratedEntries} entr${report.migratedEntries === 1 ? 'y' : 'ies'}`,
210
+ ` Skipped event-source tasks: ${report.skippedTasks}`,
211
+ ` Failed tasks: ${report.failedTasks}`,
212
+ ` Logical source bytes removed: ${report.logicalSourceBytesRemoved}`,
213
+ ];
214
+ if (report.remainingTaskCount !== undefined)
215
+ lines.push(` Remaining blob tasks: ${report.remainingTaskCount}`);
216
+ if (report.backupPath) {
217
+ lines.push(` Backup: ${report.backupPath}`);
218
+ if (report.backupMethod)
219
+ lines.push(` Backup method: ${report.backupMethod}`);
220
+ }
221
+ if (report.verification) {
222
+ lines.push(` Event rows checked: ${report.verification.eventCount}`);
223
+ lines.push(` Verification issues: ${report.verification.issues.length}`);
224
+ }
225
+ if (report.blockedReason)
226
+ lines.push(` Blocked: ${report.blockedReason}`);
227
+ for (const warning of report.warnings ?? [])
228
+ lines.push(` Warning: ${warning}`);
229
+ return lines.join('\n');
230
+ }
231
+ async function handleTaskLogMigration(args) {
232
+ let parsed;
233
+ try {
234
+ parsed = parseTaskLogMigrationArgs(args);
235
+ }
236
+ catch (error) {
237
+ const message = error instanceof Error ? error.message : String(error);
238
+ if (message === exports.TASK_LOG_MIGRATION_HELP) {
239
+ console.log(message);
240
+ }
241
+ else {
242
+ console.error(message);
243
+ console.error(exports.TASK_LOG_MIGRATION_HELP);
244
+ process.exitCode = 2;
245
+ }
246
+ return;
247
+ }
248
+ try {
249
+ const report = await (0, repository_3.runTaskLogMigration)(parsed);
250
+ console.log(formatMigrationReport(report));
251
+ if (!report.ok) {
252
+ if (report.blockedReason)
253
+ console.error(report.blockedReason);
254
+ const failures = report.failures ?? report.malformedRows ?? [];
255
+ for (const failure of failures) {
256
+ console.error(` ${failure.taskId}: ${failure.reason}`);
257
+ }
258
+ process.exitCode = 1;
259
+ }
260
+ else {
261
+ process.exitCode = 0;
262
+ }
263
+ }
264
+ catch (error) {
265
+ console.error(error instanceof Error ? error.message : String(error));
266
+ process.exitCode = 1;
267
+ }
78
268
  }
79
269
  async function handleDbPush(args) {
80
270
  const force = args.includes('--force');
@@ -6,7 +6,60 @@
6
6
  * crewx doctor Run full diagnosis
7
7
  * crewx doctor --config <path> Use specific config file
8
8
  */
9
+ interface DiagnosticResult {
10
+ name: string;
11
+ status: 'success' | 'warning' | 'error';
12
+ message: string;
13
+ details?: string;
14
+ }
15
+ export interface CliProviderInfo {
16
+ cmd: string;
17
+ install: string;
18
+ }
19
+ export interface DoctorArtifact {
20
+ directory: string;
21
+ sizeBytes: number;
22
+ details: string[];
23
+ }
24
+ export interface NpxCacheReport {
25
+ cacheRoot: string;
26
+ zeroByteLockfileDirectories: DoctorArtifact[];
27
+ staleFileCacheDirectories: DoctorArtifact[];
28
+ cleanableDirectories: DoctorArtifact[];
29
+ }
30
+ export interface HookCommandIssue {
31
+ provider: 'claude' | 'codex';
32
+ settingsPath: string;
33
+ command: string;
34
+ reason: 'launcher' | 'non-absolute';
35
+ }
36
+ export interface HookCommandReport {
37
+ inspectedFiles: string[];
38
+ issues: HookCommandIssue[];
39
+ }
40
+ export interface CrewxShimReport {
41
+ shimRoot: string;
42
+ currentFingerprint?: string;
43
+ staleDirectories: Array<DoctorArtifact & {
44
+ fingerprint: string;
45
+ }>;
46
+ }
47
+ /** CLI diagnostics keyed by the bare provider name used in PROVIDER_ORDER. */
48
+ export declare const CLI_PROVIDER_INFO: Record<string, CliProviderInfo>;
49
+ /** Format a byte count for diagnostic output. */
50
+ export declare function formatBytes(bytes: number): string;
51
+ /** Inspect npm's persistent `_npx` cache without modifying it. */
52
+ export declare function inspectNpxCache(cacheRoot?: string): NpxCacheReport;
53
+ /** Inspect installed CrewX hooks without rewriting provider settings. */
54
+ export declare function inspectHookCommands(projectRoot: string): HookCommandReport;
55
+ /** Inspect orphaned CrewX PATH shim directories without modifying them. */
56
+ export declare function inspectCrewxShims(crewxHome?: string, resolvedFingerprint?: string | undefined): CrewxShimReport;
57
+ /**
58
+ * Check CLI provider availability in the canonical PROVIDER_ORDER.
59
+ */
60
+ export declare function checkCliProviders(): DiagnosticResult[];
9
61
  /**
10
62
  * Handle `crewx doctor` command.
11
63
  */
12
64
  export declare function handleDoctor(args: string[]): Promise<void>;
65
+ export {};