@defai.digital/ax-cli 4.4.7 → 4.4.11
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/bin/ax-cli +1 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +158 -9
- package/dist/index.js.map +1 -1
- package/dist/setup.d.ts +27 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +591 -0
- package/dist/setup.js.map +1 -0
- package/package.json +43 -135
- package/LICENSE +0 -22
- package/README.md +0 -420
- package/config-defaults/messages.yaml +0 -75
- package/config-defaults/models.yaml +0 -57
- package/config-defaults/prompts.yaml +0 -948
- package/config-defaults/settings.yaml +0 -157
- package/dist/agent/agent-executor.d.ts +0 -61
- package/dist/agent/agent-executor.js +0 -194
- package/dist/agent/agent-executor.js.map +0 -1
- package/dist/agent/agent-router.d.ts +0 -68
- package/dist/agent/agent-router.js +0 -242
- package/dist/agent/agent-router.js.map +0 -1
- package/dist/agent/context-manager.d.ts +0 -122
- package/dist/agent/context-manager.js +0 -406
- package/dist/agent/context-manager.js.map +0 -1
- package/dist/agent/core/index.d.ts +0 -8
- package/dist/agent/core/index.js +0 -9
- package/dist/agent/core/index.js.map +0 -1
- package/dist/agent/core/types.d.ts +0 -92
- package/dist/agent/core/types.js +0 -11
- package/dist/agent/core/types.js.map +0 -1
- package/dist/agent/dependency-resolver.d.ts +0 -90
- package/dist/agent/dependency-resolver.js +0 -366
- package/dist/agent/dependency-resolver.js.map +0 -1
- package/dist/agent/execution/index.d.ts +0 -9
- package/dist/agent/execution/index.js +0 -9
- package/dist/agent/execution/index.js.map +0 -1
- package/dist/agent/execution/tool-executor.d.ts +0 -93
- package/dist/agent/execution/tool-executor.js +0 -552
- package/dist/agent/execution/tool-executor.js.map +0 -1
- package/dist/agent/index.d.ts +0 -14
- package/dist/agent/index.js +0 -145
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/llm-agent.d.ts +0 -368
- package/dist/agent/llm-agent.js +0 -1931
- package/dist/agent/llm-agent.js.map +0 -1
- package/dist/agent/loop-detector.d.ts +0 -72
- package/dist/agent/loop-detector.js +0 -335
- package/dist/agent/loop-detector.js.map +0 -1
- package/dist/agent/parallel-tools.d.ts +0 -69
- package/dist/agent/parallel-tools.js +0 -188
- package/dist/agent/parallel-tools.js.map +0 -1
- package/dist/agent/planning/index.d.ts +0 -9
- package/dist/agent/planning/index.js +0 -9
- package/dist/agent/planning/index.js.map +0 -1
- package/dist/agent/planning/plan-executor.d.ts +0 -79
- package/dist/agent/planning/plan-executor.js +0 -240
- package/dist/agent/planning/plan-executor.js.map +0 -1
- package/dist/agent/progress-tracker.d.ts +0 -94
- package/dist/agent/progress-tracker.js +0 -225
- package/dist/agent/progress-tracker.js.map +0 -1
- package/dist/agent/specialized/analysis-agent.d.ts +0 -11
- package/dist/agent/specialized/analysis-agent.js +0 -24
- package/dist/agent/specialized/analysis-agent.js.map +0 -1
- package/dist/agent/specialized/debug-agent.d.ts +0 -11
- package/dist/agent/specialized/debug-agent.js +0 -46
- package/dist/agent/specialized/debug-agent.js.map +0 -1
- package/dist/agent/specialized/documentation-agent.d.ts +0 -11
- package/dist/agent/specialized/documentation-agent.js +0 -24
- package/dist/agent/specialized/documentation-agent.js.map +0 -1
- package/dist/agent/specialized/index.d.ts +0 -11
- package/dist/agent/specialized/index.js +0 -12
- package/dist/agent/specialized/index.js.map +0 -1
- package/dist/agent/specialized/performance-agent.d.ts +0 -11
- package/dist/agent/specialized/performance-agent.js +0 -24
- package/dist/agent/specialized/performance-agent.js.map +0 -1
- package/dist/agent/specialized/refactoring-agent.d.ts +0 -11
- package/dist/agent/specialized/refactoring-agent.js +0 -24
- package/dist/agent/specialized/refactoring-agent.js.map +0 -1
- package/dist/agent/specialized/testing-agent.d.ts +0 -11
- package/dist/agent/specialized/testing-agent.js +0 -24
- package/dist/agent/specialized/testing-agent.js.map +0 -1
- package/dist/agent/status-reporter.d.ts +0 -114
- package/dist/agent/status-reporter.js +0 -335
- package/dist/agent/status-reporter.js.map +0 -1
- package/dist/agent/streaming/index.d.ts +0 -9
- package/dist/agent/streaming/index.js +0 -9
- package/dist/agent/streaming/index.js.map +0 -1
- package/dist/agent/streaming/stream-handler.d.ts +0 -62
- package/dist/agent/streaming/stream-handler.js +0 -217
- package/dist/agent/streaming/stream-handler.js.map +0 -1
- package/dist/agent/subagent-orchestrator.d.ts +0 -166
- package/dist/agent/subagent-orchestrator.js +0 -487
- package/dist/agent/subagent-orchestrator.js.map +0 -1
- package/dist/agent/subagent-types.d.ts +0 -261
- package/dist/agent/subagent-types.js +0 -257
- package/dist/agent/subagent-types.js.map +0 -1
- package/dist/agent/subagent.d.ts +0 -116
- package/dist/agent/subagent.js +0 -507
- package/dist/agent/subagent.js.map +0 -1
- package/dist/checkpoint/index.d.ts +0 -9
- package/dist/checkpoint/index.js +0 -11
- package/dist/checkpoint/index.js.map +0 -1
- package/dist/checkpoint/manager.d.ts +0 -101
- package/dist/checkpoint/manager.js +0 -407
- package/dist/checkpoint/manager.js.map +0 -1
- package/dist/checkpoint/storage.d.ts +0 -39
- package/dist/checkpoint/storage.js +0 -350
- package/dist/checkpoint/storage.js.map +0 -1
- package/dist/checkpoint/types.d.ts +0 -111
- package/dist/checkpoint/types.js +0 -17
- package/dist/checkpoint/types.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -7
- package/dist/commands/cache.js +0 -284
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/custom-commands.d.ts +0 -77
- package/dist/commands/custom-commands.js +0 -251
- package/dist/commands/custom-commands.js.map +0 -1
- package/dist/commands/design.d.ts +0 -18
- package/dist/commands/design.js +0 -511
- package/dist/commands/design.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -6
- package/dist/commands/doctor.js +0 -773
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/frontend.d.ts +0 -9
- package/dist/commands/frontend.js +0 -645
- package/dist/commands/frontend.js.map +0 -1
- package/dist/commands/init/wizard.d.ts +0 -55
- package/dist/commands/init/wizard.js +0 -189
- package/dist/commands/init/wizard.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.js +0 -195
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp-migrate.d.ts +0 -9
- package/dist/commands/mcp-migrate.js +0 -175
- package/dist/commands/mcp-migrate.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -2
- package/dist/commands/mcp.js +0 -1292
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/memory.d.ts +0 -6
- package/dist/commands/memory.js +0 -555
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/models.d.ts +0 -5
- package/dist/commands/models.js +0 -213
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/plan.d.ts +0 -43
- package/dist/commands/plan.js +0 -362
- package/dist/commands/plan.js.map +0 -1
- package/dist/commands/rewind.d.ts +0 -19
- package/dist/commands/rewind.js +0 -221
- package/dist/commands/rewind.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -14
- package/dist/commands/setup.js +0 -733
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/status.d.ts +0 -7
- package/dist/commands/status.js +0 -437
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/templates.d.ts +0 -5
- package/dist/commands/templates.js +0 -245
- package/dist/commands/templates.js.map +0 -1
- package/dist/commands/update.d.ts +0 -49
- package/dist/commands/update.js +0 -366
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/usage.d.ts +0 -8
- package/dist/commands/usage.js +0 -264
- package/dist/commands/usage.js.map +0 -1
- package/dist/commands/vscode.d.ts +0 -7
- package/dist/commands/vscode.js +0 -419
- package/dist/commands/vscode.js.map +0 -1
- package/dist/constants.d.ts +0 -236
- package/dist/constants.js +0 -288
- package/dist/constants.js.map +0 -1
- package/dist/design/figma-alias.d.ts +0 -170
- package/dist/design/figma-alias.js +0 -577
- package/dist/design/figma-alias.js.map +0 -1
- package/dist/design/figma-audit.d.ts +0 -40
- package/dist/design/figma-audit.js +0 -383
- package/dist/design/figma-audit.js.map +0 -1
- package/dist/design/figma-client.d.ts +0 -131
- package/dist/design/figma-client.js +0 -369
- package/dist/design/figma-client.js.map +0 -1
- package/dist/design/figma-map.d.ts +0 -29
- package/dist/design/figma-map.js +0 -346
- package/dist/design/figma-map.js.map +0 -1
- package/dist/design/figma-tokens.d.ts +0 -73
- package/dist/design/figma-tokens.js +0 -448
- package/dist/design/figma-tokens.js.map +0 -1
- package/dist/design/index.d.ts +0 -13
- package/dist/design/index.js +0 -20
- package/dist/design/index.js.map +0 -1
- package/dist/design/types.d.ts +0 -98
- package/dist/design/types.js +0 -9
- package/dist/design/types.js.map +0 -1
- package/dist/hooks/hook-runner.d.ts +0 -142
- package/dist/hooks/hook-runner.js +0 -436
- package/dist/hooks/hook-runner.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/manager.d.ts +0 -84
- package/dist/hooks/manager.js +0 -348
- package/dist/hooks/manager.js.map +0 -1
- package/dist/hooks/types.d.ts +0 -134
- package/dist/hooks/types.js +0 -9
- package/dist/hooks/types.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/ipc/index.d.ts +0 -9
- package/dist/ipc/index.js +0 -10
- package/dist/ipc/index.js.map +0 -1
- package/dist/ipc/vscode-client.d.ts +0 -200
- package/dist/ipc/vscode-client.js +0 -495
- package/dist/ipc/vscode-client.js.map +0 -1
- package/dist/llm/client.d.ts +0 -205
- package/dist/llm/client.js +0 -735
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/tools.d.ts +0 -102
- package/dist/llm/tools.js +0 -275
- package/dist/llm/tools.js.map +0 -1
- package/dist/llm/types.d.ts +0 -428
- package/dist/llm/types.js +0 -194
- package/dist/llm/types.js.map +0 -1
- package/dist/mcp/automatosx-auto-discovery.d.ts +0 -66
- package/dist/mcp/automatosx-auto-discovery.js +0 -169
- package/dist/mcp/automatosx-auto-discovery.js.map +0 -1
- package/dist/mcp/automatosx-loader.d.ts +0 -99
- package/dist/mcp/automatosx-loader.js +0 -250
- package/dist/mcp/automatosx-loader.js.map +0 -1
- package/dist/mcp/cancellation.d.ts +0 -182
- package/dist/mcp/cancellation.js +0 -275
- package/dist/mcp/cancellation.js.map +0 -1
- package/dist/mcp/client-v2.d.ts +0 -500
- package/dist/mcp/client-v2.js +0 -1433
- package/dist/mcp/client-v2.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -170
- package/dist/mcp/client.js +0 -232
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/config-detector.d.ts +0 -90
- package/dist/mcp/config-detector.js +0 -250
- package/dist/mcp/config-detector.js.map +0 -1
- package/dist/mcp/config-migrator.d.ts +0 -68
- package/dist/mcp/config-migrator.js +0 -291
- package/dist/mcp/config-migrator.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -24
- package/dist/mcp/config.js +0 -273
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/constants.d.ts +0 -66
- package/dist/mcp/constants.js +0 -85
- package/dist/mcp/constants.js.map +0 -1
- package/dist/mcp/content-length-transport.d.ts +0 -106
- package/dist/mcp/content-length-transport.js +0 -413
- package/dist/mcp/content-length-transport.js.map +0 -1
- package/dist/mcp/debug.d.ts +0 -211
- package/dist/mcp/debug.js +0 -404
- package/dist/mcp/debug.js.map +0 -1
- package/dist/mcp/error-formatter.d.ts +0 -40
- package/dist/mcp/error-formatter.js +0 -207
- package/dist/mcp/error-formatter.js.map +0 -1
- package/dist/mcp/error-remediation.d.ts +0 -45
- package/dist/mcp/error-remediation.js +0 -291
- package/dist/mcp/error-remediation.js.map +0 -1
- package/dist/mcp/health.d.ts +0 -120
- package/dist/mcp/health.js +0 -267
- package/dist/mcp/health.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -56
- package/dist/mcp/index.js +0 -89
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/invariants.d.ts +0 -141
- package/dist/mcp/invariants.js +0 -243
- package/dist/mcp/invariants.js.map +0 -1
- package/dist/mcp/mutex-safe.d.ts +0 -151
- package/dist/mcp/mutex-safe.js +0 -260
- package/dist/mcp/mutex-safe.js.map +0 -1
- package/dist/mcp/progress.d.ts +0 -155
- package/dist/mcp/progress.js +0 -252
- package/dist/mcp/progress.js.map +0 -1
- package/dist/mcp/prompts.d.ts +0 -68
- package/dist/mcp/prompts.js +0 -129
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/provider-mcp-loader.d.ts +0 -130
- package/dist/mcp/provider-mcp-loader.js +0 -292
- package/dist/mcp/provider-mcp-loader.js.map +0 -1
- package/dist/mcp/reconnection.d.ts +0 -101
- package/dist/mcp/reconnection.js +0 -253
- package/dist/mcp/reconnection.js.map +0 -1
- package/dist/mcp/registry.d.ts +0 -75
- package/dist/mcp/registry.js +0 -276
- package/dist/mcp/registry.js.map +0 -1
- package/dist/mcp/resources.d.ts +0 -58
- package/dist/mcp/resources.js +0 -144
- package/dist/mcp/resources.js.map +0 -1
- package/dist/mcp/schema-validator.d.ts +0 -82
- package/dist/mcp/schema-validator.js +0 -161
- package/dist/mcp/schema-validator.js.map +0 -1
- package/dist/mcp/ssrf-protection.d.ts +0 -86
- package/dist/mcp/ssrf-protection.js +0 -311
- package/dist/mcp/ssrf-protection.js.map +0 -1
- package/dist/mcp/subscriptions.d.ts +0 -168
- package/dist/mcp/subscriptions.js +0 -248
- package/dist/mcp/subscriptions.js.map +0 -1
- package/dist/mcp/templates.d.ts +0 -52
- package/dist/mcp/templates.js +0 -627
- package/dist/mcp/templates.js.map +0 -1
- package/dist/mcp/transports.d.ts +0 -80
- package/dist/mcp/transports.js +0 -237
- package/dist/mcp/transports.js.map +0 -1
- package/dist/mcp/type-safety.d.ts +0 -225
- package/dist/mcp/type-safety.js +0 -237
- package/dist/mcp/type-safety.js.map +0 -1
- package/dist/mcp/validation.d.ts +0 -29
- package/dist/mcp/validation.js +0 -339
- package/dist/mcp/validation.js.map +0 -1
- package/dist/mcp/zai-detector.d.ts +0 -63
- package/dist/mcp/zai-detector.js +0 -193
- package/dist/mcp/zai-detector.js.map +0 -1
- package/dist/mcp/zai-templates.d.ts +0 -90
- package/dist/mcp/zai-templates.js +0 -157
- package/dist/mcp/zai-templates.js.map +0 -1
- package/dist/memory/context-generator.d.ts +0 -84
- package/dist/memory/context-generator.js +0 -546
- package/dist/memory/context-generator.js.map +0 -1
- package/dist/memory/context-injector.d.ts +0 -97
- package/dist/memory/context-injector.js +0 -159
- package/dist/memory/context-injector.js.map +0 -1
- package/dist/memory/context-store.d.ts +0 -103
- package/dist/memory/context-store.js +0 -264
- package/dist/memory/context-store.js.map +0 -1
- package/dist/memory/index.d.ts +0 -43
- package/dist/memory/index.js +0 -49
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/provider-context-store.d.ts +0 -127
- package/dist/memory/provider-context-store.js +0 -385
- package/dist/memory/provider-context-store.js.map +0 -1
- package/dist/memory/schemas.d.ts +0 -118
- package/dist/memory/schemas.js +0 -106
- package/dist/memory/schemas.js.map +0 -1
- package/dist/memory/stats-collector.d.ts +0 -73
- package/dist/memory/stats-collector.js +0 -170
- package/dist/memory/stats-collector.js.map +0 -1
- package/dist/memory/types.d.ts +0 -177
- package/dist/memory/types.js +0 -73
- package/dist/memory/types.js.map +0 -1
- package/dist/permissions/index.d.ts +0 -6
- package/dist/permissions/index.js +0 -7
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/permission-manager.d.ts +0 -149
- package/dist/permissions/permission-manager.js +0 -410
- package/dist/permissions/permission-manager.js.map +0 -1
- package/dist/planner/dependency-resolver.d.ts +0 -72
- package/dist/planner/dependency-resolver.js +0 -272
- package/dist/planner/dependency-resolver.js.map +0 -1
- package/dist/planner/index.d.ts +0 -12
- package/dist/planner/index.js +0 -28
- package/dist/planner/index.js.map +0 -1
- package/dist/planner/plan-generator.d.ts +0 -74
- package/dist/planner/plan-generator.js +0 -244
- package/dist/planner/plan-generator.js.map +0 -1
- package/dist/planner/plan-storage.d.ts +0 -113
- package/dist/planner/plan-storage.js +0 -398
- package/dist/planner/plan-storage.js.map +0 -1
- package/dist/planner/prompts/planning-prompt.d.ts +0 -62
- package/dist/planner/prompts/planning-prompt.js +0 -414
- package/dist/planner/prompts/planning-prompt.js.map +0 -1
- package/dist/planner/task-planner.d.ts +0 -139
- package/dist/planner/task-planner.js +0 -532
- package/dist/planner/task-planner.js.map +0 -1
- package/dist/planner/token-estimator.d.ts +0 -63
- package/dist/planner/token-estimator.js +0 -295
- package/dist/planner/token-estimator.js.map +0 -1
- package/dist/planner/types.d.ts +0 -425
- package/dist/planner/types.js +0 -213
- package/dist/planner/types.js.map +0 -1
- package/dist/provider/config.d.ts +0 -227
- package/dist/provider/config.js +0 -430
- package/dist/provider/config.js.map +0 -1
- package/dist/schemas/api-schemas.d.ts +0 -45
- package/dist/schemas/api-schemas.js +0 -129
- package/dist/schemas/api-schemas.js.map +0 -1
- package/dist/schemas/confirmation-schemas.d.ts +0 -39
- package/dist/schemas/confirmation-schemas.js +0 -48
- package/dist/schemas/confirmation-schemas.js.map +0 -1
- package/dist/schemas/index-unified.d.ts +0 -12
- package/dist/schemas/index-unified.js +0 -17
- package/dist/schemas/index-unified.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -83
- package/dist/schemas/index.js +0 -139
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/settings-schemas.d.ts +0 -186
- package/dist/schemas/settings-schemas.js +0 -324
- package/dist/schemas/settings-schemas.js.map +0 -1
- package/dist/schemas/tool-schemas.d.ts +0 -127
- package/dist/schemas/tool-schemas.js +0 -84
- package/dist/schemas/tool-schemas.js.map +0 -1
- package/dist/schemas/yaml-schemas.d.ts +0 -231
- package/dist/schemas/yaml-schemas.js +0 -199
- package/dist/schemas/yaml-schemas.js.map +0 -1
- package/dist/sdk/errors.d.ts +0 -100
- package/dist/sdk/errors.js +0 -138
- package/dist/sdk/errors.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -901
- package/dist/sdk/index.js +0 -1272
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/progress-reporter.d.ts +0 -123
- package/dist/sdk/progress-reporter.js +0 -220
- package/dist/sdk/progress-reporter.js.map +0 -1
- package/dist/sdk/testing.d.ts +0 -427
- package/dist/sdk/testing.js +0 -725
- package/dist/sdk/testing.js.map +0 -1
- package/dist/sdk/tool-registry.d.ts +0 -194
- package/dist/sdk/tool-registry.js +0 -326
- package/dist/sdk/tool-registry.js.map +0 -1
- package/dist/sdk/types.d.ts +0 -53
- package/dist/sdk/types.js +0 -8
- package/dist/sdk/types.js.map +0 -1
- package/dist/sdk/unified-logger.d.ts +0 -173
- package/dist/sdk/unified-logger.js +0 -327
- package/dist/sdk/unified-logger.js.map +0 -1
- package/dist/sdk/version.d.ts +0 -163
- package/dist/sdk/version.js +0 -205
- package/dist/sdk/version.js.map +0 -1
- package/dist/tools/ask-user.d.ts +0 -126
- package/dist/tools/ask-user.js +0 -290
- package/dist/tools/ask-user.js.map +0 -1
- package/dist/tools/ax-agent.d.ts +0 -71
- package/dist/tools/ax-agent.js +0 -283
- package/dist/tools/ax-agent.js.map +0 -1
- package/dist/tools/bash-output.d.ts +0 -25
- package/dist/tools/bash-output.js +0 -146
- package/dist/tools/bash-output.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -67
- package/dist/tools/bash.js +0 -522
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/confirmation-tool.d.ts +0 -16
- package/dist/tools/confirmation-tool.js +0 -76
- package/dist/tools/confirmation-tool.js.map +0 -1
- package/dist/tools/definitions/ask-user.d.ts +0 -8
- package/dist/tools/definitions/ask-user.js +0 -168
- package/dist/tools/definitions/ask-user.js.map +0 -1
- package/dist/tools/definitions/ax-agent.d.ts +0 -8
- package/dist/tools/definitions/ax-agent.js +0 -276
- package/dist/tools/definitions/ax-agent.js.map +0 -1
- package/dist/tools/definitions/bash-output.d.ts +0 -7
- package/dist/tools/definitions/bash-output.js +0 -78
- package/dist/tools/definitions/bash-output.js.map +0 -1
- package/dist/tools/definitions/bash.d.ts +0 -8
- package/dist/tools/definitions/bash.js +0 -152
- package/dist/tools/definitions/bash.js.map +0 -1
- package/dist/tools/definitions/create-file.d.ts +0 -7
- package/dist/tools/definitions/create-file.js +0 -129
- package/dist/tools/definitions/create-file.js.map +0 -1
- package/dist/tools/definitions/design.d.ts +0 -12
- package/dist/tools/definitions/design.js +0 -368
- package/dist/tools/definitions/design.js.map +0 -1
- package/dist/tools/definitions/index.d.ts +0 -49
- package/dist/tools/definitions/index.js +0 -87
- package/dist/tools/definitions/index.js.map +0 -1
- package/dist/tools/definitions/multi-edit.d.ts +0 -7
- package/dist/tools/definitions/multi-edit.js +0 -123
- package/dist/tools/definitions/multi-edit.js.map +0 -1
- package/dist/tools/definitions/search.d.ts +0 -7
- package/dist/tools/definitions/search.js +0 -159
- package/dist/tools/definitions/search.js.map +0 -1
- package/dist/tools/definitions/str-replace-editor.d.ts +0 -7
- package/dist/tools/definitions/str-replace-editor.js +0 -145
- package/dist/tools/definitions/str-replace-editor.js.map +0 -1
- package/dist/tools/definitions/todo.d.ts +0 -8
- package/dist/tools/definitions/todo.js +0 -261
- package/dist/tools/definitions/todo.js.map +0 -1
- package/dist/tools/definitions/view-file.d.ts +0 -7
- package/dist/tools/definitions/view-file.js +0 -111
- package/dist/tools/definitions/view-file.js.map +0 -1
- package/dist/tools/design-tool.d.ts +0 -68
- package/dist/tools/design-tool.js +0 -299
- package/dist/tools/design-tool.js.map +0 -1
- package/dist/tools/format-generators.d.ts +0 -62
- package/dist/tools/format-generators.js +0 -291
- package/dist/tools/format-generators.js.map +0 -1
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.js +0 -11
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/priority-registry.d.ts +0 -124
- package/dist/tools/priority-registry.js +0 -401
- package/dist/tools/priority-registry.js.map +0 -1
- package/dist/tools/priority.d.ts +0 -158
- package/dist/tools/priority.js +0 -350
- package/dist/tools/priority.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -146
- package/dist/tools/registry.js +0 -171
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/search.d.ts +0 -85
- package/dist/tools/search.js +0 -430
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/text-editor.d.ts +0 -87
- package/dist/tools/text-editor.js +0 -1369
- package/dist/tools/text-editor.js.map +0 -1
- package/dist/tools/todo-tool.d.ts +0 -20
- package/dist/tools/todo-tool.js +0 -186
- package/dist/tools/todo-tool.js.map +0 -1
- package/dist/tools/types.d.ts +0 -175
- package/dist/tools/types.js +0 -11
- package/dist/tools/types.js.map +0 -1
- package/dist/types/index.d.ts +0 -30
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/project-analysis.d.ts +0 -84
- package/dist/types/project-analysis.js +0 -5
- package/dist/types/project-analysis.js.map +0 -1
- package/dist/types/template.d.ts +0 -53
- package/dist/types/template.js +0 -5
- package/dist/types/template.js.map +0 -1
- package/dist/ui/app.d.ts +0 -7
- package/dist/ui/app.js +0 -102
- package/dist/ui/app.js.map +0 -1
- package/dist/ui/components/api-key-input.d.ts +0 -7
- package/dist/ui/components/api-key-input.js +0 -92
- package/dist/ui/components/api-key-input.js.map +0 -1
- package/dist/ui/components/chat-history.d.ts +0 -12
- package/dist/ui/components/chat-history.js +0 -391
- package/dist/ui/components/chat-history.js.map +0 -1
- package/dist/ui/components/chat-input.d.ts +0 -13
- package/dist/ui/components/chat-input.js +0 -179
- package/dist/ui/components/chat-input.js.map +0 -1
- package/dist/ui/components/chat-interface.d.ts +0 -11
- package/dist/ui/components/chat-interface.js +0 -830
- package/dist/ui/components/chat-interface.js.map +0 -1
- package/dist/ui/components/collapsible-tool-result.d.ts +0 -42
- package/dist/ui/components/collapsible-tool-result.js +0 -216
- package/dist/ui/components/collapsible-tool-result.js.map +0 -1
- package/dist/ui/components/command-suggestions.d.ts +0 -29
- package/dist/ui/components/command-suggestions.js +0 -88
- package/dist/ui/components/command-suggestions.js.map +0 -1
- package/dist/ui/components/confirmation-dialog.d.ts +0 -11
- package/dist/ui/components/confirmation-dialog.js +0 -100
- package/dist/ui/components/confirmation-dialog.js.map +0 -1
- package/dist/ui/components/context-breakdown.d.ts +0 -23
- package/dist/ui/components/context-breakdown.js +0 -124
- package/dist/ui/components/context-breakdown.js.map +0 -1
- package/dist/ui/components/diff-renderer.d.ts +0 -13
- package/dist/ui/components/diff-renderer.js +0 -192
- package/dist/ui/components/diff-renderer.js.map +0 -1
- package/dist/ui/components/index.d.ts +0 -18
- package/dist/ui/components/index.js +0 -20
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/keyboard-help.d.ts +0 -17
- package/dist/ui/components/keyboard-help.js +0 -122
- package/dist/ui/components/keyboard-help.js.map +0 -1
- package/dist/ui/components/keyboard-hints.d.ts +0 -35
- package/dist/ui/components/keyboard-hints.js +0 -142
- package/dist/ui/components/keyboard-hints.js.map +0 -1
- package/dist/ui/components/loading-spinner.d.ts +0 -9
- package/dist/ui/components/loading-spinner.js +0 -120
- package/dist/ui/components/loading-spinner.js.map +0 -1
- package/dist/ui/components/mcp-dashboard.d.ts +0 -15
- package/dist/ui/components/mcp-dashboard.js +0 -520
- package/dist/ui/components/mcp-dashboard.js.map +0 -1
- package/dist/ui/components/mcp-status.d.ts +0 -5
- package/dist/ui/components/mcp-status.js +0 -58
- package/dist/ui/components/mcp-status.js.map +0 -1
- package/dist/ui/components/model-selection.d.ts +0 -12
- package/dist/ui/components/model-selection.js +0 -17
- package/dist/ui/components/model-selection.js.map +0 -1
- package/dist/ui/components/phase-progress.d.ts +0 -21
- package/dist/ui/components/phase-progress.js +0 -185
- package/dist/ui/components/phase-progress.js.map +0 -1
- package/dist/ui/components/question-dialog.d.ts +0 -17
- package/dist/ui/components/question-dialog.js +0 -181
- package/dist/ui/components/question-dialog.js.map +0 -1
- package/dist/ui/components/quick-actions.d.ts +0 -12
- package/dist/ui/components/quick-actions.js +0 -171
- package/dist/ui/components/quick-actions.js.map +0 -1
- package/dist/ui/components/reasoning-display.d.ts +0 -36
- package/dist/ui/components/reasoning-display.js +0 -46
- package/dist/ui/components/reasoning-display.js.map +0 -1
- package/dist/ui/components/status-bar.d.ts +0 -47
- package/dist/ui/components/status-bar.js +0 -310
- package/dist/ui/components/status-bar.js.map +0 -1
- package/dist/ui/components/subagent-monitor.d.ts +0 -41
- package/dist/ui/components/subagent-monitor.js +0 -122
- package/dist/ui/components/subagent-monitor.js.map +0 -1
- package/dist/ui/components/toast-notification.d.ts +0 -197
- package/dist/ui/components/toast-notification.js +0 -190
- package/dist/ui/components/toast-notification.js.map +0 -1
- package/dist/ui/components/tool-group-display.d.ts +0 -19
- package/dist/ui/components/tool-group-display.js +0 -222
- package/dist/ui/components/tool-group-display.js.map +0 -1
- package/dist/ui/components/virtualized-chat-history.d.ts +0 -33
- package/dist/ui/components/virtualized-chat-history.js +0 -182
- package/dist/ui/components/virtualized-chat-history.js.map +0 -1
- package/dist/ui/components/welcome-panel.d.ts +0 -11
- package/dist/ui/components/welcome-panel.js +0 -225
- package/dist/ui/components/welcome-panel.js.map +0 -1
- package/dist/ui/hooks/use-chat-reducer.d.ts +0 -69
- package/dist/ui/hooks/use-chat-reducer.js +0 -118
- package/dist/ui/hooks/use-chat-reducer.js.map +0 -1
- package/dist/ui/hooks/use-enhanced-input.d.ts +0 -53
- package/dist/ui/hooks/use-enhanced-input.js +0 -1275
- package/dist/ui/hooks/use-enhanced-input.js.map +0 -1
- package/dist/ui/hooks/use-input-handler.d.ts +0 -79
- package/dist/ui/hooks/use-input-handler.js +0 -2251
- package/dist/ui/hooks/use-input-handler.js.map +0 -1
- package/dist/ui/hooks/use-input-history.d.ts +0 -9
- package/dist/ui/hooks/use-input-history.js +0 -168
- package/dist/ui/hooks/use-input-history.js.map +0 -1
- package/dist/ui/shared/max-sized-box.d.ts +0 -17
- package/dist/ui/shared/max-sized-box.js +0 -14
- package/dist/ui/shared/max-sized-box.js.map +0 -1
- package/dist/ui/themes/index.d.ts +0 -5
- package/dist/ui/themes/index.js +0 -5
- package/dist/ui/themes/index.js.map +0 -1
- package/dist/ui/themes/theme-registry.d.ts +0 -55
- package/dist/ui/themes/theme-registry.js +0 -202
- package/dist/ui/themes/theme-registry.js.map +0 -1
- package/dist/ui/utils/bracketed-paste-handler.d.ts +0 -97
- package/dist/ui/utils/bracketed-paste-handler.js +0 -322
- package/dist/ui/utils/bracketed-paste-handler.js.map +0 -1
- package/dist/ui/utils/change-summarizer.d.ts +0 -20
- package/dist/ui/utils/change-summarizer.js +0 -282
- package/dist/ui/utils/change-summarizer.js.map +0 -1
- package/dist/ui/utils/code-colorizer.d.ts +0 -9
- package/dist/ui/utils/code-colorizer.js +0 -13
- package/dist/ui/utils/code-colorizer.js.map +0 -1
- package/dist/ui/utils/colors.d.ts +0 -41
- package/dist/ui/utils/colors.js +0 -80
- package/dist/ui/utils/colors.js.map +0 -1
- package/dist/ui/utils/image-handler.d.ts +0 -29
- package/dist/ui/utils/image-handler.js +0 -129
- package/dist/ui/utils/image-handler.js.map +0 -1
- package/dist/ui/utils/markdown-renderer.d.ts +0 -4
- package/dist/ui/utils/markdown-renderer.js +0 -40
- package/dist/ui/utils/markdown-renderer.js.map +0 -1
- package/dist/ui/utils/semantic-action-detector.d.ts +0 -49
- package/dist/ui/utils/semantic-action-detector.js +0 -339
- package/dist/ui/utils/semantic-action-detector.js.map +0 -1
- package/dist/ui/utils/tool-grouper.d.ts +0 -94
- package/dist/ui/utils/tool-grouper.js +0 -618
- package/dist/ui/utils/tool-grouper.js.map +0 -1
- package/dist/utils/api-error.d.ts +0 -61
- package/dist/utils/api-error.js +0 -176
- package/dist/utils/api-error.js.map +0 -1
- package/dist/utils/audit-logger.d.ts +0 -206
- package/dist/utils/audit-logger.js +0 -286
- package/dist/utils/audit-logger.js.map +0 -1
- package/dist/utils/auto-accept-logger.d.ts +0 -175
- package/dist/utils/auto-accept-logger.js +0 -423
- package/dist/utils/auto-accept-logger.js.map +0 -1
- package/dist/utils/automatosx-detector.d.ts +0 -19
- package/dist/utils/automatosx-detector.js +0 -52
- package/dist/utils/automatosx-detector.js.map +0 -1
- package/dist/utils/background-task-manager.d.ts +0 -114
- package/dist/utils/background-task-manager.js +0 -470
- package/dist/utils/background-task-manager.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -77
- package/dist/utils/cache.js +0 -180
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/command-security.d.ts +0 -85
- package/dist/utils/command-security.js +0 -210
- package/dist/utils/command-security.js.map +0 -1
- package/dist/utils/config-loader.d.ts +0 -190
- package/dist/utils/config-loader.js +0 -108
- package/dist/utils/config-loader.js.map +0 -1
- package/dist/utils/confirmation-service.d.ts +0 -51
- package/dist/utils/confirmation-service.js +0 -220
- package/dist/utils/confirmation-service.js.map +0 -1
- package/dist/utils/console-messenger.d.ts +0 -80
- package/dist/utils/console-messenger.js +0 -142
- package/dist/utils/console-messenger.js.map +0 -1
- package/dist/utils/custom-instructions.d.ts +0 -1
- package/dist/utils/custom-instructions.js +0 -24
- package/dist/utils/custom-instructions.js.map +0 -1
- package/dist/utils/encryption.d.ts +0 -86
- package/dist/utils/encryption.js +0 -236
- package/dist/utils/encryption.js.map +0 -1
- package/dist/utils/enhanced-error-messages.d.ts +0 -33
- package/dist/utils/enhanced-error-messages.js +0 -440
- package/dist/utils/enhanced-error-messages.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -65
- package/dist/utils/error-handler.js +0 -148
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/error-translator.d.ts +0 -25
- package/dist/utils/error-translator.js +0 -203
- package/dist/utils/error-translator.js.map +0 -1
- package/dist/utils/external-editor.d.ts +0 -47
- package/dist/utils/external-editor.js +0 -179
- package/dist/utils/external-editor.js.map +0 -1
- package/dist/utils/file-cache.d.ts +0 -148
- package/dist/utils/file-cache.js +0 -413
- package/dist/utils/file-cache.js.map +0 -1
- package/dist/utils/file-lock.d.ts +0 -141
- package/dist/utils/file-lock.js +0 -554
- package/dist/utils/file-lock.js.map +0 -1
- package/dist/utils/file-mentions.d.ts +0 -68
- package/dist/utils/file-mentions.js +0 -225
- package/dist/utils/file-mentions.js.map +0 -1
- package/dist/utils/history-manager.d.ts +0 -52
- package/dist/utils/history-manager.js +0 -211
- package/dist/utils/history-manager.js.map +0 -1
- package/dist/utils/history-migration.d.ts +0 -9
- package/dist/utils/history-migration.js +0 -37
- package/dist/utils/history-migration.js.map +0 -1
- package/dist/utils/image-processor.d.ts +0 -33
- package/dist/utils/image-processor.js +0 -124
- package/dist/utils/image-processor.js.map +0 -1
- package/dist/utils/index.d.ts +0 -92
- package/dist/utils/index.js +0 -111
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/init-previewer.d.ts +0 -56
- package/dist/utils/init-previewer.js +0 -239
- package/dist/utils/init-previewer.js.map +0 -1
- package/dist/utils/init-validator.d.ts +0 -65
- package/dist/utils/init-validator.js +0 -252
- package/dist/utils/init-validator.js.map +0 -1
- package/dist/utils/input-sanitizer.d.ts +0 -210
- package/dist/utils/input-sanitizer.js +0 -362
- package/dist/utils/input-sanitizer.js.map +0 -1
- package/dist/utils/instruction-generator.d.ts +0 -21
- package/dist/utils/instruction-generator.js +0 -233
- package/dist/utils/instruction-generator.js.map +0 -1
- package/dist/utils/json-utils.d.ts +0 -72
- package/dist/utils/json-utils.js +0 -226
- package/dist/utils/json-utils.js.map +0 -1
- package/dist/utils/llm-optimized-instruction-generator.d.ts +0 -36
- package/dist/utils/llm-optimized-instruction-generator.js +0 -365
- package/dist/utils/llm-optimized-instruction-generator.js.map +0 -1
- package/dist/utils/message-optimizer.d.ts +0 -100
- package/dist/utils/message-optimizer.js +0 -297
- package/dist/utils/message-optimizer.js.map +0 -1
- package/dist/utils/onboarding-manager.d.ts +0 -45
- package/dist/utils/onboarding-manager.js +0 -131
- package/dist/utils/onboarding-manager.js.map +0 -1
- package/dist/utils/parallel-analyzer.d.ts +0 -123
- package/dist/utils/parallel-analyzer.js +0 -241
- package/dist/utils/parallel-analyzer.js.map +0 -1
- package/dist/utils/paste-utils.d.ts +0 -99
- package/dist/utils/paste-utils.js +0 -295
- package/dist/utils/paste-utils.js.map +0 -1
- package/dist/utils/path-helpers.d.ts +0 -8
- package/dist/utils/path-helpers.js +0 -35
- package/dist/utils/path-helpers.js.map +0 -1
- package/dist/utils/path-security.d.ts +0 -92
- package/dist/utils/path-security.js +0 -300
- package/dist/utils/path-security.js.map +0 -1
- package/dist/utils/path-utils.d.ts +0 -83
- package/dist/utils/path-utils.js +0 -122
- package/dist/utils/path-utils.js.map +0 -1
- package/dist/utils/path-validator.d.ts +0 -66
- package/dist/utils/path-validator.js +0 -141
- package/dist/utils/path-validator.js.map +0 -1
- package/dist/utils/performance.d.ts +0 -74
- package/dist/utils/performance.js +0 -133
- package/dist/utils/performance.js.map +0 -1
- package/dist/utils/process-pool.d.ts +0 -109
- package/dist/utils/process-pool.js +0 -332
- package/dist/utils/process-pool.js.map +0 -1
- package/dist/utils/progress-tracker.d.ts +0 -51
- package/dist/utils/progress-tracker.js +0 -152
- package/dist/utils/progress-tracker.js.map +0 -1
- package/dist/utils/project-analyzer.d.ts +0 -49
- package/dist/utils/project-analyzer.js +0 -396
- package/dist/utils/project-analyzer.js.map +0 -1
- package/dist/utils/prompt-builder.d.ts +0 -14
- package/dist/utils/prompt-builder.js +0 -100
- package/dist/utils/prompt-builder.js.map +0 -1
- package/dist/utils/provider-context.d.ts +0 -243
- package/dist/utils/provider-context.js +0 -421
- package/dist/utils/provider-context.js.map +0 -1
- package/dist/utils/provider-file-cache.d.ts +0 -91
- package/dist/utils/provider-file-cache.js +0 -165
- package/dist/utils/provider-file-cache.js.map +0 -1
- package/dist/utils/provider-settings.d.ts +0 -181
- package/dist/utils/provider-settings.js +0 -450
- package/dist/utils/provider-settings.js.map +0 -1
- package/dist/utils/rate-limiter.d.ts +0 -222
- package/dist/utils/rate-limiter.js +0 -338
- package/dist/utils/rate-limiter.js.map +0 -1
- package/dist/utils/retry-helper.d.ts +0 -81
- package/dist/utils/retry-helper.js +0 -244
- package/dist/utils/retry-helper.js.map +0 -1
- package/dist/utils/safety-rules.d.ts +0 -64
- package/dist/utils/safety-rules.js +0 -225
- package/dist/utils/safety-rules.js.map +0 -1
- package/dist/utils/settings-manager.d.ts +0 -256
- package/dist/utils/settings-manager.js +0 -967
- package/dist/utils/settings-manager.js.map +0 -1
- package/dist/utils/setup-validator.d.ts +0 -47
- package/dist/utils/setup-validator.js +0 -304
- package/dist/utils/setup-validator.js.map +0 -1
- package/dist/utils/string-utils.d.ts +0 -19
- package/dist/utils/string-utils.js +0 -28
- package/dist/utils/string-utils.js.map +0 -1
- package/dist/utils/template-manager.d.ts +0 -62
- package/dist/utils/template-manager.js +0 -366
- package/dist/utils/template-manager.js.map +0 -1
- package/dist/utils/text-utils.d.ts +0 -82
- package/dist/utils/text-utils.js +0 -203
- package/dist/utils/text-utils.js.map +0 -1
- package/dist/utils/token-counter.d.ts +0 -76
- package/dist/utils/token-counter.js +0 -231
- package/dist/utils/token-counter.js.map +0 -1
- package/dist/utils/usage-tracker.d.ts +0 -78
- package/dist/utils/usage-tracker.js +0 -126
- package/dist/utils/usage-tracker.js.map +0 -1
- package/dist/utils/version.d.ts +0 -14
- package/dist/utils/version.js +0 -70
- package/dist/utils/version.js.map +0 -1
package/dist/commands/doctor.js
DELETED
|
@@ -1,773 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Doctor command - Diagnose AX CLI configuration and environment
|
|
3
|
-
* Checks API configuration, file system, MCP servers, models, and dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
import * as prompts from "@clack/prompts";
|
|
8
|
-
import { existsSync, accessSync, constants, mkdirSync } from "fs";
|
|
9
|
-
import { homedir } from "os";
|
|
10
|
-
import { join } from "path";
|
|
11
|
-
import { exec } from "child_process";
|
|
12
|
-
import { promisify } from "util";
|
|
13
|
-
import OpenAI from "openai";
|
|
14
|
-
import { getSettingsManager } from "../utils/settings-manager.js";
|
|
15
|
-
import { GLM_MODELS, CONFIG_PATHS } from "../constants.js";
|
|
16
|
-
import { detectZAIServices, isGLMModel, isZAIBaseURL, ZAI_SERVER_NAMES, ZAI_MCP_TEMPLATES, } from "../mcp/index.js";
|
|
17
|
-
import { parseJsonFile } from "../utils/json-utils.js";
|
|
18
|
-
import { formatTokenCount } from "../utils/token-counter.js";
|
|
19
|
-
import { extractErrorMessage } from "../utils/error-handler.js";
|
|
20
|
-
const execAsync = promisify(exec);
|
|
21
|
-
export function createDoctorCommand() {
|
|
22
|
-
const doctorCmd = new Command("doctor")
|
|
23
|
-
.description("Diagnose AX CLI configuration and environment")
|
|
24
|
-
.option("--json", "Output results in JSON format")
|
|
25
|
-
.option("--verbose", "Show detailed diagnostic information")
|
|
26
|
-
.action(async (options) => {
|
|
27
|
-
try {
|
|
28
|
-
// JSON mode uses plain output for parsing
|
|
29
|
-
if (options.json) {
|
|
30
|
-
const results = [];
|
|
31
|
-
results.push(await checkNodeVersion());
|
|
32
|
-
results.push(...checkConfigFiles());
|
|
33
|
-
results.push(...await checkApiConfiguration());
|
|
34
|
-
results.push(checkModelConfiguration());
|
|
35
|
-
results.push(...await checkMCPServers());
|
|
36
|
-
results.push(...await checkZAIMCPStatus());
|
|
37
|
-
results.push(...await checkDependencies());
|
|
38
|
-
console.log(JSON.stringify(results, null, 2));
|
|
39
|
-
const hasFailures = results.some(r => r.status === "fail");
|
|
40
|
-
process.exit(hasFailures ? 1 : 0);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// Interactive mode with @clack/prompts
|
|
44
|
-
prompts.intro(chalk.cyan("AX CLI Doctor"));
|
|
45
|
-
const results = [];
|
|
46
|
-
const spinner = prompts.spinner();
|
|
47
|
-
// 1. Check Node.js version
|
|
48
|
-
spinner.start("Checking Node.js version...");
|
|
49
|
-
results.push(await checkNodeVersion());
|
|
50
|
-
spinner.stop(formatCheckResult(results[results.length - 1]));
|
|
51
|
-
// 2. Check config files
|
|
52
|
-
spinner.start("Checking configuration files...");
|
|
53
|
-
const configResults = checkConfigFiles();
|
|
54
|
-
results.push(...configResults);
|
|
55
|
-
spinner.stop(`Configuration: ${configResults.filter(r => r.status === "pass").length}/${configResults.length} OK`);
|
|
56
|
-
// 3. Check API configuration
|
|
57
|
-
spinner.start("Checking API configuration...");
|
|
58
|
-
const apiResults = await checkApiConfiguration();
|
|
59
|
-
results.push(...apiResults);
|
|
60
|
-
spinner.stop(`API: ${apiResults.filter(r => r.status === "pass").length}/${apiResults.length} OK`);
|
|
61
|
-
// 4. Check model configuration
|
|
62
|
-
spinner.start("Checking model configuration...");
|
|
63
|
-
results.push(checkModelConfiguration());
|
|
64
|
-
spinner.stop(formatCheckResult(results[results.length - 1]));
|
|
65
|
-
// 5. Check MCP servers
|
|
66
|
-
spinner.start("Checking MCP servers...");
|
|
67
|
-
const mcpResults = await checkMCPServers();
|
|
68
|
-
results.push(...mcpResults);
|
|
69
|
-
spinner.stop(`MCP: ${mcpResults.length} server(s) checked`);
|
|
70
|
-
// 6. Check Z.AI MCP integration (if using Z.AI)
|
|
71
|
-
spinner.start("Checking Z.AI integration...");
|
|
72
|
-
const zaiResults = await checkZAIMCPStatus();
|
|
73
|
-
results.push(...zaiResults);
|
|
74
|
-
if (zaiResults.length > 0) {
|
|
75
|
-
spinner.stop(`Z.AI: ${zaiResults.filter(r => r.status === "pass").length}/${zaiResults.length} OK`);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
spinner.stop("Z.AI: Not applicable");
|
|
79
|
-
}
|
|
80
|
-
// 7. Check dependencies
|
|
81
|
-
spinner.start("Checking dependencies...");
|
|
82
|
-
const depResults = await checkDependencies();
|
|
83
|
-
results.push(...depResults);
|
|
84
|
-
spinner.stop(`Dependencies: ${depResults.filter(r => r.status === "pass").length}/${depResults.length} OK`);
|
|
85
|
-
// Display detailed results
|
|
86
|
-
displayResults(results, options.verbose);
|
|
87
|
-
// Exit code based on results
|
|
88
|
-
const hasFailures = results.some(r => r.status === "fail");
|
|
89
|
-
const hasWarnings = results.some(r => r.status === "warning");
|
|
90
|
-
if (hasFailures) {
|
|
91
|
-
prompts.outro(chalk.red("Some checks failed. Please address the issues above."));
|
|
92
|
-
}
|
|
93
|
-
else if (hasWarnings) {
|
|
94
|
-
prompts.outro(chalk.yellow("Diagnostics complete with warnings."));
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
prompts.outro(chalk.green("All checks passed!"));
|
|
98
|
-
}
|
|
99
|
-
process.exit(hasFailures ? 1 : 0);
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
prompts.log.error(`Doctor command failed: ${extractErrorMessage(error)}`);
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
return doctorCmd;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Check Node.js version
|
|
110
|
-
*/
|
|
111
|
-
async function checkNodeVersion() {
|
|
112
|
-
const currentVersion = process.version;
|
|
113
|
-
const majorVersion = parseInt(currentVersion.slice(1).split('.')?.[0] || '0', 10);
|
|
114
|
-
const requiredVersion = 24;
|
|
115
|
-
if (majorVersion >= requiredVersion) {
|
|
116
|
-
return {
|
|
117
|
-
name: "Node.js Version",
|
|
118
|
-
status: "pass",
|
|
119
|
-
message: `${currentVersion}`,
|
|
120
|
-
details: [`Required: Node.js ${requiredVersion}+`],
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
name: "Node.js Version",
|
|
125
|
-
status: "fail",
|
|
126
|
-
message: `${currentVersion} (requires ${requiredVersion}+)`,
|
|
127
|
-
suggestion: `Upgrade Node.js to version ${requiredVersion} or higher`,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Check configuration files
|
|
132
|
-
*/
|
|
133
|
-
function checkConfigFiles() {
|
|
134
|
-
const results = [];
|
|
135
|
-
// User config - use centralized path constant
|
|
136
|
-
if (existsSync(CONFIG_PATHS.USER_CONFIG)) {
|
|
137
|
-
const parseResult = parseJsonFile(CONFIG_PATHS.USER_CONFIG);
|
|
138
|
-
if (parseResult.success) {
|
|
139
|
-
results.push({
|
|
140
|
-
name: "User Config File",
|
|
141
|
-
status: "pass",
|
|
142
|
-
message: "Found and valid",
|
|
143
|
-
details: [`Location: ${CONFIG_PATHS.USER_CONFIG}`],
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
results.push({
|
|
148
|
-
name: "User Config File",
|
|
149
|
-
status: "fail",
|
|
150
|
-
message: "Found but corrupted",
|
|
151
|
-
details: [`Location: ${CONFIG_PATHS.USER_CONFIG}`, `Error: ${parseResult.error}`],
|
|
152
|
-
suggestion: "Run 'ax-cli setup' to recreate configuration",
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
results.push({
|
|
158
|
-
name: "User Config File",
|
|
159
|
-
status: "warning",
|
|
160
|
-
message: "Not found",
|
|
161
|
-
details: [`Expected location: ${CONFIG_PATHS.USER_CONFIG}`],
|
|
162
|
-
suggestion: "Run 'ax-cli setup' to create configuration",
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
// Project settings - use centralized path constant
|
|
166
|
-
if (existsSync(CONFIG_PATHS.PROJECT_SETTINGS)) {
|
|
167
|
-
const parseResult = parseJsonFile(CONFIG_PATHS.PROJECT_SETTINGS);
|
|
168
|
-
if (parseResult.success) {
|
|
169
|
-
results.push({
|
|
170
|
-
name: "Project Settings",
|
|
171
|
-
status: "pass",
|
|
172
|
-
message: "Found and valid",
|
|
173
|
-
details: [`Location: ${CONFIG_PATHS.PROJECT_SETTINGS}`],
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
results.push({
|
|
178
|
-
name: "Project Settings",
|
|
179
|
-
status: "warning",
|
|
180
|
-
message: "Found but corrupted",
|
|
181
|
-
details: [`Location: ${CONFIG_PATHS.PROJECT_SETTINGS}`, `Error: ${parseResult.error}`],
|
|
182
|
-
suggestion: "Run 'ax-cli init' to recreate project settings",
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
results.push({
|
|
188
|
-
name: "Project Settings",
|
|
189
|
-
status: "pass",
|
|
190
|
-
message: "Not configured (using user settings)",
|
|
191
|
-
details: [`Optional: ${CONFIG_PATHS.PROJECT_SETTINGS}`],
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return results;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Check API configuration
|
|
198
|
-
*/
|
|
199
|
-
async function checkApiConfiguration() {
|
|
200
|
-
const results = [];
|
|
201
|
-
const manager = getSettingsManager();
|
|
202
|
-
// API Key
|
|
203
|
-
const apiKey = manager.getApiKey();
|
|
204
|
-
if (apiKey && apiKey.trim()) {
|
|
205
|
-
results.push({
|
|
206
|
-
name: "API Key",
|
|
207
|
-
status: "pass",
|
|
208
|
-
message: "Configured",
|
|
209
|
-
details: [`Length: ${apiKey.length} characters`],
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
results.push({
|
|
214
|
-
name: "API Key",
|
|
215
|
-
status: "fail",
|
|
216
|
-
message: "Not configured",
|
|
217
|
-
suggestion: "Run 'ax-cli setup' to configure API key",
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
// Base URL
|
|
221
|
-
const baseURL = manager.getBaseURL();
|
|
222
|
-
if (baseURL && baseURL.trim()) {
|
|
223
|
-
// Test reachability
|
|
224
|
-
const reachable = await testEndpointReachability(baseURL);
|
|
225
|
-
if (reachable.success) {
|
|
226
|
-
results.push({
|
|
227
|
-
name: "Base URL",
|
|
228
|
-
status: "pass",
|
|
229
|
-
message: "Configured and reachable",
|
|
230
|
-
details: [`URL: ${baseURL}`],
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
results.push({
|
|
235
|
-
name: "Base URL",
|
|
236
|
-
status: "warning",
|
|
237
|
-
message: "Configured but unreachable",
|
|
238
|
-
details: [`URL: ${baseURL}`, `Error: ${reachable.error}`],
|
|
239
|
-
suggestion: "Check internet connection or firewall settings",
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
results.push({
|
|
245
|
-
name: "Base URL",
|
|
246
|
-
status: "fail",
|
|
247
|
-
message: "Not configured",
|
|
248
|
-
suggestion: "Run 'ax-cli setup' to configure base URL",
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
// Test API with minimal request
|
|
252
|
-
if (apiKey && baseURL) {
|
|
253
|
-
const model = manager.getCurrentModel();
|
|
254
|
-
if (model) {
|
|
255
|
-
const apiTest = await testApiConnection(baseURL, apiKey, model);
|
|
256
|
-
if (apiTest.success) {
|
|
257
|
-
results.push({
|
|
258
|
-
name: "API Connection",
|
|
259
|
-
status: "pass",
|
|
260
|
-
message: "Successfully connected",
|
|
261
|
-
details: [`Model: ${model}`],
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
results.push({
|
|
266
|
-
name: "API Connection",
|
|
267
|
-
status: "fail",
|
|
268
|
-
message: "Connection failed",
|
|
269
|
-
details: [`Error: ${apiTest.error}`],
|
|
270
|
-
suggestion: "Verify API key and base URL are correct",
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return results;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Check model configuration
|
|
279
|
-
*/
|
|
280
|
-
function checkModelConfiguration() {
|
|
281
|
-
const manager = getSettingsManager();
|
|
282
|
-
const model = manager.getCurrentModel();
|
|
283
|
-
if (!model) {
|
|
284
|
-
return {
|
|
285
|
-
name: "Model Configuration",
|
|
286
|
-
status: "fail",
|
|
287
|
-
message: "No model configured",
|
|
288
|
-
suggestion: "Run 'ax-cli setup' to configure default model",
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
// Check if model is in predefined list
|
|
292
|
-
const modelConfig = GLM_MODELS[model];
|
|
293
|
-
if (modelConfig) {
|
|
294
|
-
return {
|
|
295
|
-
name: "Model Configuration",
|
|
296
|
-
status: "pass",
|
|
297
|
-
message: `${model} (supported)`,
|
|
298
|
-
details: [
|
|
299
|
-
`Context: ${formatTokenCount(modelConfig.contextWindow, { suffix: true, uppercase: true })}`,
|
|
300
|
-
`Max Output: ${formatTokenCount(modelConfig.maxOutputTokens, { suffix: true, uppercase: true })}`,
|
|
301
|
-
`Thinking: ${modelConfig.supportsThinking ? "Yes" : "No"}`,
|
|
302
|
-
],
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
// Custom model (Ollama, etc)
|
|
306
|
-
return {
|
|
307
|
-
name: "Model Configuration",
|
|
308
|
-
status: "pass",
|
|
309
|
-
message: `${model} (custom)`,
|
|
310
|
-
details: ["This is a custom model not in predefined list"],
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Check MCP servers
|
|
315
|
-
*/
|
|
316
|
-
async function checkMCPServers() {
|
|
317
|
-
const results = [];
|
|
318
|
-
const manager = getSettingsManager();
|
|
319
|
-
try {
|
|
320
|
-
const projectSettings = manager.loadProjectSettings();
|
|
321
|
-
const mcpServers = projectSettings.mcpServers || {};
|
|
322
|
-
const serverNames = Object.keys(mcpServers);
|
|
323
|
-
if (serverNames.length === 0) {
|
|
324
|
-
results.push({
|
|
325
|
-
name: "MCP Servers",
|
|
326
|
-
status: "pass",
|
|
327
|
-
message: "No MCP servers configured",
|
|
328
|
-
details: ["Optional feature - run 'ax-cli mcp add' to add servers"],
|
|
329
|
-
});
|
|
330
|
-
return results;
|
|
331
|
-
}
|
|
332
|
-
results.push({
|
|
333
|
-
name: "MCP Servers",
|
|
334
|
-
status: "pass",
|
|
335
|
-
message: `${serverNames.length} server(s) configured`,
|
|
336
|
-
details: serverNames.map(name => `• ${name}`),
|
|
337
|
-
});
|
|
338
|
-
// Check each server configuration
|
|
339
|
-
for (const serverName of serverNames) {
|
|
340
|
-
const serverConfig = mcpServers[serverName];
|
|
341
|
-
const hasValidTransport = serverConfig.transport || (serverConfig.command && serverConfig.args);
|
|
342
|
-
if (hasValidTransport) {
|
|
343
|
-
results.push({
|
|
344
|
-
name: `MCP Server: ${serverName}`,
|
|
345
|
-
status: "pass",
|
|
346
|
-
message: "Configuration valid",
|
|
347
|
-
details: serverConfig.transport
|
|
348
|
-
? [`Transport: ${serverConfig.transport.type}`]
|
|
349
|
-
: [`Command: ${serverConfig.command}`],
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
results.push({
|
|
354
|
-
name: `MCP Server: ${serverName}`,
|
|
355
|
-
status: "warning",
|
|
356
|
-
message: "Configuration incomplete",
|
|
357
|
-
suggestion: "Check server configuration in .ax-cli/settings.json",
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
catch (error) {
|
|
363
|
-
results.push({
|
|
364
|
-
name: "MCP Servers",
|
|
365
|
-
status: "warning",
|
|
366
|
-
message: "Could not check MCP configuration",
|
|
367
|
-
details: [extractErrorMessage(error)],
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
return results;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Check Z.AI MCP integration status
|
|
374
|
-
*/
|
|
375
|
-
async function checkZAIMCPStatus() {
|
|
376
|
-
const results = [];
|
|
377
|
-
const manager = getSettingsManager();
|
|
378
|
-
// Check if using Z.AI
|
|
379
|
-
const model = manager.getCurrentModel() || "";
|
|
380
|
-
const baseURL = manager.getBaseURL() || "";
|
|
381
|
-
const isZAIUser = isGLMModel(model) || isZAIBaseURL(baseURL);
|
|
382
|
-
if (!isZAIUser) {
|
|
383
|
-
// Not a Z.AI user, skip check
|
|
384
|
-
return results;
|
|
385
|
-
}
|
|
386
|
-
try {
|
|
387
|
-
const status = await detectZAIServices();
|
|
388
|
-
// Check API key
|
|
389
|
-
if (!status.hasApiKey) {
|
|
390
|
-
results.push({
|
|
391
|
-
name: "Z.AI MCP",
|
|
392
|
-
status: "warning",
|
|
393
|
-
message: "API key not configured for Z.AI MCP",
|
|
394
|
-
suggestion: "Set API key with 'ax-cli config set apiKey YOUR_KEY'",
|
|
395
|
-
});
|
|
396
|
-
return results;
|
|
397
|
-
}
|
|
398
|
-
// Check enabled servers
|
|
399
|
-
if (status.enabledServers.length === 0) {
|
|
400
|
-
results.push({
|
|
401
|
-
name: "Z.AI MCP",
|
|
402
|
-
status: "warning",
|
|
403
|
-
message: "No Z.AI MCP servers enabled",
|
|
404
|
-
details: [
|
|
405
|
-
"Available: Web Search, Web Reader, Vision",
|
|
406
|
-
"These provide web access and image analysis capabilities",
|
|
407
|
-
],
|
|
408
|
-
suggestion: "Enable with 'ax-cli mcp add-zai'",
|
|
409
|
-
});
|
|
410
|
-
return results;
|
|
411
|
-
}
|
|
412
|
-
// Report enabled servers
|
|
413
|
-
const serverDetails = status.enabledServers.map(s => {
|
|
414
|
-
const template = ZAI_MCP_TEMPLATES[s];
|
|
415
|
-
return `• ${template.displayName}`;
|
|
416
|
-
});
|
|
417
|
-
results.push({
|
|
418
|
-
name: "Z.AI MCP",
|
|
419
|
-
status: "pass",
|
|
420
|
-
message: `${status.enabledServers.length} server(s) enabled`,
|
|
421
|
-
details: serverDetails,
|
|
422
|
-
});
|
|
423
|
-
// Check if vision is available but not enabled
|
|
424
|
-
if (!status.enabledServers.includes(ZAI_SERVER_NAMES.VISION)) {
|
|
425
|
-
if (status.nodeVersionOk) {
|
|
426
|
-
results.push({
|
|
427
|
-
name: "Z.AI Vision",
|
|
428
|
-
status: "pass",
|
|
429
|
-
message: "Available (not enabled)",
|
|
430
|
-
details: ["Node.js version is compatible"],
|
|
431
|
-
suggestion: "Enable with 'ax-cli mcp add-zai --server zai-vision'",
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
else {
|
|
435
|
-
results.push({
|
|
436
|
-
name: "Z.AI Vision",
|
|
437
|
-
status: "warning",
|
|
438
|
-
message: "Not available",
|
|
439
|
-
details: [`Requires Node.js 22+, you have v${status.nodeVersion}`],
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
catch (error) {
|
|
445
|
-
results.push({
|
|
446
|
-
name: "Z.AI MCP",
|
|
447
|
-
status: "warning",
|
|
448
|
-
message: "Could not check Z.AI MCP status",
|
|
449
|
-
details: [extractErrorMessage(error)],
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
return results;
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Check dependencies
|
|
456
|
-
*/
|
|
457
|
-
async function checkDependencies() {
|
|
458
|
-
const results = [];
|
|
459
|
-
// Check ripgrep (for search tool)
|
|
460
|
-
const rgCheck = await checkCommand("rg --version");
|
|
461
|
-
if (rgCheck.found) {
|
|
462
|
-
results.push({
|
|
463
|
-
name: "ripgrep (search)",
|
|
464
|
-
status: "pass",
|
|
465
|
-
message: "Installed",
|
|
466
|
-
details: rgCheck.version ? [`Version: ${rgCheck.version}`] : undefined,
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
else {
|
|
470
|
-
results.push({
|
|
471
|
-
name: "ripgrep (search)",
|
|
472
|
-
status: "warning",
|
|
473
|
-
message: "Not found",
|
|
474
|
-
suggestion: "Install ripgrep for faster file search: brew install ripgrep",
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
// Check git
|
|
478
|
-
const gitCheck = await checkCommand("git --version");
|
|
479
|
-
if (gitCheck.found) {
|
|
480
|
-
results.push({
|
|
481
|
-
name: "git",
|
|
482
|
-
status: "pass",
|
|
483
|
-
message: "Installed",
|
|
484
|
-
details: gitCheck.version ? [`Version: ${gitCheck.version}`] : undefined,
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
else {
|
|
488
|
-
results.push({
|
|
489
|
-
name: "git",
|
|
490
|
-
status: "warning",
|
|
491
|
-
message: "Not found",
|
|
492
|
-
details: ["Required for git operations"],
|
|
493
|
-
suggestion: "Install git: https://git-scm.com/downloads",
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
// Check AutomatosX native module ABI compatibility
|
|
497
|
-
results.push(await checkAutomatosXNativeModules());
|
|
498
|
-
// Check file system permissions
|
|
499
|
-
results.push(...checkFileSystemPermissions());
|
|
500
|
-
return results;
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Check AutomatosX native module ABI compatibility
|
|
504
|
-
* Native modules like better-sqlite3 are compiled for specific Node.js ABI versions
|
|
505
|
-
*/
|
|
506
|
-
async function checkAutomatosXNativeModules() {
|
|
507
|
-
try {
|
|
508
|
-
// Check if AutomatosX is installed
|
|
509
|
-
const axCheck = await checkCommand("ax --version");
|
|
510
|
-
if (!axCheck.found) {
|
|
511
|
-
return {
|
|
512
|
-
name: "AutomatosX Native Modules",
|
|
513
|
-
status: "pass",
|
|
514
|
-
message: "Not applicable (AutomatosX not installed)",
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
// Try to run ax to detect ABI issues
|
|
518
|
-
const { stdout, stderr } = await execAsync("ax list agents 2>&1", { timeout: 10000 }).catch(e => ({
|
|
519
|
-
stdout: '',
|
|
520
|
-
stderr: e.message || e.stderr || ''
|
|
521
|
-
}));
|
|
522
|
-
const output = stdout + stderr;
|
|
523
|
-
// Check for common ABI mismatch errors
|
|
524
|
-
if (output.includes("NODE_MODULE_VERSION") || output.includes("was compiled against a different")) {
|
|
525
|
-
const moduleMatch = output.match(/NODE_MODULE_VERSION (\d+)/g);
|
|
526
|
-
const versions = moduleMatch?.map(m => m.match(/\d+/)?.[0]).filter(Boolean) || [];
|
|
527
|
-
return {
|
|
528
|
-
name: "AutomatosX Native Modules",
|
|
529
|
-
status: "fail",
|
|
530
|
-
message: "ABI version mismatch",
|
|
531
|
-
details: [
|
|
532
|
-
`Native modules compiled for different Node.js version`,
|
|
533
|
-
versions.length >= 2 ? `Module ABI: ${versions[0]}, Runtime ABI: ${versions[1]}` : '',
|
|
534
|
-
`Current Node.js: ${process.version}`,
|
|
535
|
-
].filter(Boolean),
|
|
536
|
-
suggestion: "Rebuild native modules: cd ~/.automatosx && npm rebuild better-sqlite3",
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
return {
|
|
540
|
-
name: "AutomatosX Native Modules",
|
|
541
|
-
status: "pass",
|
|
542
|
-
message: "Compatible",
|
|
543
|
-
details: [`Node.js ${process.version} ABI compatible`],
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
catch (error) {
|
|
547
|
-
return {
|
|
548
|
-
name: "AutomatosX Native Modules",
|
|
549
|
-
status: "warning",
|
|
550
|
-
message: "Could not verify",
|
|
551
|
-
details: [extractErrorMessage(error)],
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Check file system permissions for required directories
|
|
557
|
-
*/
|
|
558
|
-
function checkFileSystemPermissions() {
|
|
559
|
-
const results = [];
|
|
560
|
-
// Directories to check (deduplicated)
|
|
561
|
-
const dirsToCheck = [
|
|
562
|
-
{ path: CONFIG_PATHS.USER_DIR, name: 'AX CLI config directory' },
|
|
563
|
-
{ path: join(homedir(), '.automatosx'), name: 'AutomatosX data directory' },
|
|
564
|
-
];
|
|
565
|
-
for (const { path, name } of dirsToCheck) {
|
|
566
|
-
try {
|
|
567
|
-
// Check if directory exists
|
|
568
|
-
if (!existsSync(path)) {
|
|
569
|
-
// Try to create it
|
|
570
|
-
try {
|
|
571
|
-
mkdirSync(path, { recursive: true });
|
|
572
|
-
results.push({
|
|
573
|
-
name: `Permissions: ${name}`,
|
|
574
|
-
status: "pass",
|
|
575
|
-
message: "Created successfully",
|
|
576
|
-
details: [`Path: ${path}`],
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
catch (createError) {
|
|
580
|
-
results.push({
|
|
581
|
-
name: `Permissions: ${name}`,
|
|
582
|
-
status: "fail",
|
|
583
|
-
message: "Cannot create directory",
|
|
584
|
-
details: [`Path: ${path}`, extractErrorMessage(createError)],
|
|
585
|
-
suggestion: `Check parent directory permissions or create manually: mkdir -p "${path}"`,
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
continue;
|
|
589
|
-
}
|
|
590
|
-
// Check read/write permissions
|
|
591
|
-
accessSync(path, constants.R_OK | constants.W_OK);
|
|
592
|
-
results.push({
|
|
593
|
-
name: `Permissions: ${name}`,
|
|
594
|
-
status: "pass",
|
|
595
|
-
message: "Read/write OK",
|
|
596
|
-
details: [`Path: ${path}`],
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
catch (error) {
|
|
600
|
-
const errorMsg = extractErrorMessage(error);
|
|
601
|
-
const isEPERM = errorMsg.includes('EPERM') || errorMsg.includes('permission denied');
|
|
602
|
-
results.push({
|
|
603
|
-
name: `Permissions: ${name}`,
|
|
604
|
-
status: "fail",
|
|
605
|
-
message: isEPERM ? "Permission denied" : "Access error",
|
|
606
|
-
details: [`Path: ${path}`, errorMsg],
|
|
607
|
-
suggestion: isEPERM
|
|
608
|
-
? `Fix permissions: chmod 755 "${path}" or check if directory is owned by current user`
|
|
609
|
-
: `Check directory access: ls -la "${path}"`,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
return results;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Test endpoint reachability
|
|
617
|
-
*/
|
|
618
|
-
async function testEndpointReachability(baseURL) {
|
|
619
|
-
try {
|
|
620
|
-
// For local endpoints, check if service is running
|
|
621
|
-
if (baseURL.includes("localhost") || baseURL.includes("127.0.0.1")) {
|
|
622
|
-
const response = await fetch(baseURL.replace("/v1", "") + "/api/version", {
|
|
623
|
-
method: "GET",
|
|
624
|
-
signal: AbortSignal.timeout(3000),
|
|
625
|
-
});
|
|
626
|
-
if (response.ok) {
|
|
627
|
-
return { success: true };
|
|
628
|
-
}
|
|
629
|
-
return {
|
|
630
|
-
success: false,
|
|
631
|
-
error: "Local service not responding",
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
// For remote endpoints, try a simple request
|
|
635
|
-
const response = await fetch(baseURL + "/models", {
|
|
636
|
-
method: "GET",
|
|
637
|
-
signal: AbortSignal.timeout(5000),
|
|
638
|
-
});
|
|
639
|
-
// Any response means endpoint is reachable
|
|
640
|
-
if (response.status === 401 || response.status === 403 || response.ok) {
|
|
641
|
-
return { success: true };
|
|
642
|
-
}
|
|
643
|
-
return {
|
|
644
|
-
success: false,
|
|
645
|
-
error: `Server returned ${response.status}`,
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
catch (error) {
|
|
649
|
-
const err = error;
|
|
650
|
-
if (err?.name === "AbortError" || err?.name === "TimeoutError") {
|
|
651
|
-
return { success: false, error: "Connection timeout" };
|
|
652
|
-
}
|
|
653
|
-
if (err?.code === "ECONNREFUSED") {
|
|
654
|
-
return { success: false, error: "Connection refused" };
|
|
655
|
-
}
|
|
656
|
-
return {
|
|
657
|
-
success: false,
|
|
658
|
-
error: error instanceof Error ? error.message : "Network error",
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Test API connection with minimal request
|
|
664
|
-
*/
|
|
665
|
-
async function testApiConnection(baseURL, apiKey, model) {
|
|
666
|
-
try {
|
|
667
|
-
const client = new OpenAI({
|
|
668
|
-
baseURL,
|
|
669
|
-
apiKey,
|
|
670
|
-
timeout: 10000, // 10 second timeout
|
|
671
|
-
});
|
|
672
|
-
await client.chat.completions.create({
|
|
673
|
-
model,
|
|
674
|
-
messages: [{ role: "user", content: "test" }],
|
|
675
|
-
max_tokens: 1,
|
|
676
|
-
});
|
|
677
|
-
return { success: true };
|
|
678
|
-
}
|
|
679
|
-
catch (error) {
|
|
680
|
-
let errorMessage = error instanceof Error ? error.message : "Connection failed";
|
|
681
|
-
const err = error;
|
|
682
|
-
if (err?.status === 401) {
|
|
683
|
-
errorMessage = "Invalid or expired API key";
|
|
684
|
-
}
|
|
685
|
-
else if (err?.status === 403) {
|
|
686
|
-
errorMessage = "API key lacks required permissions";
|
|
687
|
-
}
|
|
688
|
-
else if (err?.status === 404) {
|
|
689
|
-
errorMessage = "Model not found";
|
|
690
|
-
}
|
|
691
|
-
else if (err?.error?.message) {
|
|
692
|
-
errorMessage = err.error.message;
|
|
693
|
-
}
|
|
694
|
-
return {
|
|
695
|
-
success: false,
|
|
696
|
-
error: errorMessage,
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Check if a command exists
|
|
702
|
-
*/
|
|
703
|
-
async function checkCommand(command) {
|
|
704
|
-
try {
|
|
705
|
-
const { stdout } = await execAsync(command, { timeout: 3000 });
|
|
706
|
-
const lines = stdout.trim().split("\n");
|
|
707
|
-
const version = lines.length > 0 ? lines[0] : undefined;
|
|
708
|
-
return { found: true, version };
|
|
709
|
-
}
|
|
710
|
-
catch {
|
|
711
|
-
return { found: false };
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
/**
|
|
715
|
-
* Format a single check result for spinner stop message
|
|
716
|
-
*/
|
|
717
|
-
function formatCheckResult(result) {
|
|
718
|
-
const icon = result.status === "pass" ? "✓" : result.status === "warning" ? "⚠" : "✗";
|
|
719
|
-
const color = result.status === "pass" ? chalk.green : result.status === "warning" ? chalk.yellow : chalk.red;
|
|
720
|
-
return color(`${icon} ${result.name}: ${result.message}`);
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Display results in formatted output using @clack/prompts
|
|
724
|
-
*/
|
|
725
|
-
function displayResults(results, verbose) {
|
|
726
|
-
let passCount = 0;
|
|
727
|
-
let warnCount = 0;
|
|
728
|
-
let failCount = 0;
|
|
729
|
-
// Count results
|
|
730
|
-
for (const result of results) {
|
|
731
|
-
if (result.status === "pass")
|
|
732
|
-
passCount++;
|
|
733
|
-
else if (result.status === "warning")
|
|
734
|
-
warnCount++;
|
|
735
|
-
else
|
|
736
|
-
failCount++;
|
|
737
|
-
}
|
|
738
|
-
// Build summary note
|
|
739
|
-
const summaryLines = [];
|
|
740
|
-
summaryLines.push(chalk.green(`✓ ${passCount} passed`));
|
|
741
|
-
if (warnCount > 0)
|
|
742
|
-
summaryLines.push(chalk.yellow(`⚠ ${warnCount} warnings`));
|
|
743
|
-
if (failCount > 0)
|
|
744
|
-
summaryLines.push(chalk.red(`✗ ${failCount} failed`));
|
|
745
|
-
prompts.note(summaryLines.join("\n"), "Summary");
|
|
746
|
-
// Show details for failures and warnings (always), or all if verbose
|
|
747
|
-
const detailResults = verbose
|
|
748
|
-
? results
|
|
749
|
-
: results.filter(r => r.status !== "pass");
|
|
750
|
-
if (detailResults.length > 0) {
|
|
751
|
-
console.log(); // spacing
|
|
752
|
-
for (const result of detailResults) {
|
|
753
|
-
if (result.status === "pass") {
|
|
754
|
-
prompts.log.success(`${result.name}: ${result.message}`);
|
|
755
|
-
}
|
|
756
|
-
else if (result.status === "warning") {
|
|
757
|
-
prompts.log.warn(`${result.name}: ${result.message}`);
|
|
758
|
-
}
|
|
759
|
-
else {
|
|
760
|
-
prompts.log.error(`${result.name}: ${result.message}`);
|
|
761
|
-
}
|
|
762
|
-
if (result.details) {
|
|
763
|
-
result.details.forEach(detail => {
|
|
764
|
-
console.log(chalk.dim(` ${detail}`));
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
if (result.suggestion) {
|
|
768
|
-
prompts.log.info(` 💡 ${result.suggestion}`);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
//# sourceMappingURL=doctor.js.map
|