@defai.digital/ax-cli 4.4.6 → 4.4.10
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 -387
- 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/sdk/index.d.ts
DELETED
|
@@ -1,901 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AX CLI SDK v1.4.0 - Programmatic API for AX CLI
|
|
3
|
-
*
|
|
4
|
-
* Use AX CLI as a library for integrations, VSCode extensions, and programmatic AI agents.
|
|
5
|
-
*
|
|
6
|
-
* ## Installation
|
|
7
|
-
*
|
|
8
|
-
* ```bash
|
|
9
|
-
* npm install @defai.digital/ax-cli
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* ## Quick Start
|
|
13
|
-
*
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { createAgent, createGLMAgent, createGrokAgent } from '@defai.digital/ax-cli/sdk';
|
|
16
|
-
*
|
|
17
|
-
* // Option 1: Auto-detect provider
|
|
18
|
-
* const agent = await createAgent();
|
|
19
|
-
*
|
|
20
|
-
* // Option 2: Explicit provider
|
|
21
|
-
* const glmAgent = await createGLMAgent(); // Uses ~/.ax-glm/config.json
|
|
22
|
-
* const grokAgent = await createGrokAgent(); // Uses ~/.ax-grok/config.json
|
|
23
|
-
*
|
|
24
|
-
* // Process messages
|
|
25
|
-
* const result = await agent.processUserMessage('Analyze this code');
|
|
26
|
-
* agent.dispose();
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* ## Public API (v1.4.0)
|
|
30
|
-
*
|
|
31
|
-
* ### Agent Creation
|
|
32
|
-
* - `createAgent(options?)` - Create agent with auto-detected or specified provider
|
|
33
|
-
* - `createGLMAgent(options?)` - Create GLM (Z.AI) agent
|
|
34
|
-
* - `createGrokAgent(options?)` - Create Grok (xAI) agent
|
|
35
|
-
* - `tryCreateAgent(options?)` - Create agent without throwing (returns result object)
|
|
36
|
-
* - `withAgent(fn, options?)` - Run function with auto-disposed agent
|
|
37
|
-
*
|
|
38
|
-
* ### Error Handling
|
|
39
|
-
* - `SDKError` - Structured error class with error codes
|
|
40
|
-
* - `SDKErrorCode` - Error code enum (SETUP_NOT_RUN, API_KEY_MISSING, etc.)
|
|
41
|
-
*
|
|
42
|
-
* ### Agent Utilities
|
|
43
|
-
* - `getAgentInfo(agent)` - Get provider, model, config info
|
|
44
|
-
* - `getAgentStatus(agent)` - Check if agent is available/busy/disposed
|
|
45
|
-
* - `isAgentDisposed(agent)` - Check disposal state
|
|
46
|
-
* - `disposeAsync(agent)` - Dispose with async hook support
|
|
47
|
-
*
|
|
48
|
-
* ### Provider Utilities
|
|
49
|
-
* - `detectProvider()` - Auto-detect configured provider
|
|
50
|
-
* - `checkProviderHealth(provider?)` - Check if provider is configured
|
|
51
|
-
* - `getAllProviderHealth()` - Check all providers
|
|
52
|
-
*
|
|
53
|
-
* ### Version Info
|
|
54
|
-
* - `SDK_VERSION`, `CLI_VERSION` - Version constants
|
|
55
|
-
* - `getSDKVersion()`, `getCLIVersion()` - Version strings
|
|
56
|
-
* - `isSDKVersionCompatible(minVersion)` - Version check
|
|
57
|
-
*
|
|
58
|
-
* ### Testing
|
|
59
|
-
* - `createMockAgent(responses)` - Create mock for testing
|
|
60
|
-
* - `createMockSettings(overrides)` - Mock settings manager
|
|
61
|
-
*
|
|
62
|
-
* ## Example: Streaming Responses
|
|
63
|
-
*
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { createGLMAgent, SDKError, SDKErrorCode } from '@defai.digital/ax-cli/sdk';
|
|
66
|
-
*
|
|
67
|
-
* const agent = await createGLMAgent();
|
|
68
|
-
*
|
|
69
|
-
* agent.on('stream', (chunk) => {
|
|
70
|
-
* if (chunk.type === 'content') {
|
|
71
|
-
* process.stdout.write(chunk.content);
|
|
72
|
-
* }
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* try {
|
|
76
|
-
* await agent.processUserMessage('Explain async/await');
|
|
77
|
-
* } catch (error) {
|
|
78
|
-
* if (SDKError.isSDKError(error)) {
|
|
79
|
-
* console.error(`Error [${error.code}]: ${error.message}`);
|
|
80
|
-
* }
|
|
81
|
-
* } finally {
|
|
82
|
-
* agent.dispose();
|
|
83
|
-
* }
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* ## Example: Parallel Providers
|
|
87
|
-
*
|
|
88
|
-
* ```typescript
|
|
89
|
-
* import { createGLMAgent, createGrokAgent } from '@defai.digital/ax-cli/sdk';
|
|
90
|
-
*
|
|
91
|
-
* // Run GLM and Grok in parallel
|
|
92
|
-
* const [glm, grok] = await Promise.all([
|
|
93
|
-
* createGLMAgent(),
|
|
94
|
-
* createGrokAgent(),
|
|
95
|
-
* ]);
|
|
96
|
-
*
|
|
97
|
-
* const [glmResult, grokResult] = await Promise.all([
|
|
98
|
-
* glm.processUserMessage('Analyze with GLM'),
|
|
99
|
-
* grok.processUserMessage('Analyze with Grok'),
|
|
100
|
-
* ]);
|
|
101
|
-
*
|
|
102
|
-
* glm.dispose();
|
|
103
|
-
* grok.dispose();
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* ## Example: Testing
|
|
107
|
-
*
|
|
108
|
-
* ```typescript
|
|
109
|
-
* import { createMockAgent } from '@defai.digital/ax-cli/sdk';
|
|
110
|
-
*
|
|
111
|
-
* const mock = createMockAgent(['Hello!', 'How can I help?']);
|
|
112
|
-
* const result = await mock.processUserMessage('Hi');
|
|
113
|
-
* expect(result).toContain('Hello!');
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* @packageDocumentation
|
|
117
|
-
*/
|
|
118
|
-
export { LLMAgent } from '../agent/llm-agent.js';
|
|
119
|
-
export { Subagent } from '../agent/subagent.js';
|
|
120
|
-
export { SubagentOrchestrator } from '../agent/subagent-orchestrator.js';
|
|
121
|
-
export { ContextManager } from '../agent/context-manager.js';
|
|
122
|
-
import { LLMAgent } from '../agent/llm-agent.js';
|
|
123
|
-
import { Subagent } from '../agent/subagent.js';
|
|
124
|
-
import { SDKError } from './errors.js';
|
|
125
|
-
import { type ProviderType } from '../utils/provider-context.js';
|
|
126
|
-
export { withFileLock, withFileLockSync, SafeJsonFile, LockGuard, cleanupStaleLocks, type LockOptions, } from '../utils/file-lock.js';
|
|
127
|
-
export { LLMClient } from '../llm/client.js';
|
|
128
|
-
export type { LLMMessage, LLMTool, LLMToolCall, LLMResponse, SearchParameters, SearchOptions, } from '../llm/client.js';
|
|
129
|
-
export type { ChatOptions, ThinkingConfig, SamplingConfig, GLM46StreamChunk, } from '../llm/types.js';
|
|
130
|
-
export type { ChatEntry, StreamingChunk } from '../agent/llm-agent.js';
|
|
131
|
-
export type { ToolResult, Tool, EditorCommand, AgentState } from '../types/index.js';
|
|
132
|
-
export { SubagentRole, SubagentState, type SubagentConfig, type SubagentTask, type SubagentResult, type SubagentStatus, } from '../agent/subagent-types.js';
|
|
133
|
-
export { CLI_VERSION, SDK_VERSION, SDK_API_VERSION, getCLIVersion, getSDKVersion, getSDKInfo, getVersionString, isSDKVersionCompatible, } from './version.js';
|
|
134
|
-
export { SDKError, SDKErrorCode } from './errors.js';
|
|
135
|
-
export { MockAgent, createMockAgent, MockSettingsManager, createMockSettings, MockMCPServer, createMockMCPServer, waitForAgent, createMockToolResult, assertToolSuccess, assertToolFailure } from './testing.js';
|
|
136
|
-
export type { MockMCPServerOptions } from './testing.js';
|
|
137
|
-
export type { ProviderType } from '../utils/provider-context.js';
|
|
138
|
-
export { detectProvider } from '../utils/provider-context.js';
|
|
139
|
-
/**
|
|
140
|
-
* Agent configuration options for SDK users
|
|
141
|
-
*
|
|
142
|
-
* SECURITY: Credentials (apiKey, baseURL) must be configured via "ax-cli setup"
|
|
143
|
-
* and are NOT exposed through the SDK API to prevent security vulnerabilities.
|
|
144
|
-
*
|
|
145
|
-
* MULTI-PROVIDER SUPPORT (v5.0):
|
|
146
|
-
* When running multiple providers in parallel (ax-glm and ax-grok), use the
|
|
147
|
-
* `provider` option to specify which provider's configuration to use.
|
|
148
|
-
* Each provider has isolated:
|
|
149
|
-
* - Configuration files (~/.ax-glm/ vs ~/.ax-grok/)
|
|
150
|
-
* - Cache directories
|
|
151
|
-
* - Memory stores
|
|
152
|
-
* - History
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* // Run GLM and Grok agents in parallel
|
|
157
|
-
* const glmAgent = await createAgent({ provider: 'glm' });
|
|
158
|
-
* const grokAgent = await createAgent({ provider: 'grok' });
|
|
159
|
-
*
|
|
160
|
-
* // Use both simultaneously
|
|
161
|
-
* const [glmResult, grokResult] = await Promise.all([
|
|
162
|
-
* glmAgent.processUserMessage('Analyze with GLM'),
|
|
163
|
-
* grokAgent.processUserMessage('Analyze with Grok'),
|
|
164
|
-
* ]);
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export interface AgentOptions {
|
|
168
|
-
/**
|
|
169
|
-
* Provider to use for configuration
|
|
170
|
-
*
|
|
171
|
-
* When specified, the agent will use the provider-specific configuration
|
|
172
|
-
* from the corresponding directory:
|
|
173
|
-
* - 'glm': Uses ~/.ax-glm/config.json
|
|
174
|
-
* - 'grok': Uses ~/.ax-grok/config.json
|
|
175
|
-
* - 'generic': Uses ~/.ax-cli/config.json
|
|
176
|
-
*
|
|
177
|
-
* If not specified, automatically detects based on:
|
|
178
|
-
* 1. AX_PROVIDER environment variable
|
|
179
|
-
* 2. Which provider's API key is set (ZAI_API_KEY, XAI_API_KEY)
|
|
180
|
-
* 3. Falls back to 'generic'
|
|
181
|
-
*
|
|
182
|
-
* @default auto-detect
|
|
183
|
-
*/
|
|
184
|
-
provider?: ProviderType;
|
|
185
|
-
/** Maximum number of tool execution rounds (1-1000, default: 400) */
|
|
186
|
-
maxToolRounds?: number;
|
|
187
|
-
/**
|
|
188
|
-
* Enable debug mode for verbose logging
|
|
189
|
-
*
|
|
190
|
-
* When enabled, the SDK will log detailed information about:
|
|
191
|
-
* - Agent initialization
|
|
192
|
-
* - Message processing
|
|
193
|
-
* - Tool executions
|
|
194
|
-
* - Errors and warnings
|
|
195
|
-
*
|
|
196
|
-
* Debug logs are written to stderr and prefixed with [AX SDK DEBUG].
|
|
197
|
-
*
|
|
198
|
-
* @default false
|
|
199
|
-
*/
|
|
200
|
-
debug?: boolean;
|
|
201
|
-
/**
|
|
202
|
-
* Enable automatic cleanup on process exit signals
|
|
203
|
-
*
|
|
204
|
-
* When enabled (default), the SDK automatically registers cleanup handlers for:
|
|
205
|
-
* - process.exit
|
|
206
|
-
* - SIGINT (Ctrl+C)
|
|
207
|
-
* - SIGTERM
|
|
208
|
-
* - SIGHUP
|
|
209
|
-
*
|
|
210
|
-
* Set to false if you want manual control over cleanup (useful for libraries,
|
|
211
|
-
* long-running services, or when you want to manage agent lifecycle yourself).
|
|
212
|
-
*
|
|
213
|
-
* @default true (backward compatible - cleanup enabled by default)
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* ```typescript
|
|
217
|
-
* // Auto-cleanup enabled (default behavior)
|
|
218
|
-
* const agent = await createAgent();
|
|
219
|
-
*
|
|
220
|
-
* // Manual cleanup control
|
|
221
|
-
* const agent = await createAgent({ autoCleanup: false });
|
|
222
|
-
* // ... use agent ...
|
|
223
|
-
* agent.dispose(); // Manual cleanup
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
autoCleanup?: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* Lifecycle hook called before agent disposal
|
|
229
|
-
*
|
|
230
|
-
* This hook is called BEFORE the agent's dispose() method runs, allowing you to:
|
|
231
|
-
* - Save state or checkpoint data
|
|
232
|
-
* - Log metrics or analytics
|
|
233
|
-
* - Notify external systems
|
|
234
|
-
* - Perform custom cleanup
|
|
235
|
-
*
|
|
236
|
-
* Can be async (returns Promise<void>) or sync (returns void).
|
|
237
|
-
*
|
|
238
|
-
* @param None
|
|
239
|
-
* @returns void or Promise<void>
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* ```typescript
|
|
243
|
-
* const agent = await createAgent({
|
|
244
|
-
* onDispose: async () => {
|
|
245
|
-
* console.log('Agent disposing, saving state...');
|
|
246
|
-
* await saveAgentState(agent);
|
|
247
|
-
* }
|
|
248
|
-
* });
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
onDispose?: () => void | Promise<void>;
|
|
252
|
-
/**
|
|
253
|
-
* Error handler called when agent encounters errors
|
|
254
|
-
*
|
|
255
|
-
* This hook is called whenever the agent encounters an error during:
|
|
256
|
-
* - Message processing
|
|
257
|
-
* - Tool execution
|
|
258
|
-
* - Stream handling
|
|
259
|
-
*
|
|
260
|
-
* Use this to implement custom error handling, logging, or recovery logic.
|
|
261
|
-
*
|
|
262
|
-
* @param error - The error that occurred
|
|
263
|
-
* @returns void
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```typescript
|
|
267
|
-
* const agent = await createAgent({
|
|
268
|
-
* onError: (error) => {
|
|
269
|
-
* console.error('Agent error:', error);
|
|
270
|
-
* metrics.incrementErrorCount();
|
|
271
|
-
* errorLogger.log(error);
|
|
272
|
-
* }
|
|
273
|
-
* });
|
|
274
|
-
* ```
|
|
275
|
-
*/
|
|
276
|
-
onError?: (error: Error) => void;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Create a new LLM Agent with configuration
|
|
280
|
-
*
|
|
281
|
-
* SECURITY: All credentials (API key, base URL, model) must be configured
|
|
282
|
-
* via "ax-cli setup" command. This prevents security vulnerabilities where
|
|
283
|
-
* credentials could be exposed in code or logs.
|
|
284
|
-
*
|
|
285
|
-
* @param options - Agent configuration options (non-sensitive only)
|
|
286
|
-
* @returns Configured LLM Agent instance
|
|
287
|
-
* @throws {SDKError} With code SETUP_NOT_RUN if ax-cli setup has not been run
|
|
288
|
-
* @throws {SDKError} With code API_KEY_MISSING if API key not configured
|
|
289
|
-
* @throws {SDKError} With code BASE_URL_MISSING if base URL not configured
|
|
290
|
-
* @throws {SDKError} With code MODEL_MISSING if model not configured
|
|
291
|
-
* @throws {SDKError} With code VALIDATION_ERROR if options are invalid
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* ```typescript
|
|
295
|
-
* import { createAgent, SDKError, SDKErrorCode } from '@defai.digital/ax-cli/sdk';
|
|
296
|
-
*
|
|
297
|
-
* // First, user must run: ax-cli setup
|
|
298
|
-
* // Then use SDK with settings from setup:
|
|
299
|
-
*
|
|
300
|
-
* const agent = await createAgent({
|
|
301
|
-
* maxToolRounds: 50 // Optional: 1-1000, default 400
|
|
302
|
-
* });
|
|
303
|
-
*
|
|
304
|
-
* try {
|
|
305
|
-
* agent.on('stream', (chunk) => {
|
|
306
|
-
* if (chunk.type === 'content') {
|
|
307
|
-
* console.log(chunk.content);
|
|
308
|
-
* }
|
|
309
|
-
* });
|
|
310
|
-
*
|
|
311
|
-
* const result = await agent.processUserMessage('Analyze this codebase');
|
|
312
|
-
* console.log(result);
|
|
313
|
-
* } catch (error) {
|
|
314
|
-
* if (SDKError.isSDKError(error)) {
|
|
315
|
-
* switch (error.code) {
|
|
316
|
-
* case SDKErrorCode.SETUP_NOT_RUN:
|
|
317
|
-
* console.error('Run ax-cli setup first');
|
|
318
|
-
* break;
|
|
319
|
-
* case SDKErrorCode.API_KEY_MISSING:
|
|
320
|
-
* console.error('API key not configured');
|
|
321
|
-
* break;
|
|
322
|
-
* }
|
|
323
|
-
* }
|
|
324
|
-
* } finally {
|
|
325
|
-
* // Always cleanup resources
|
|
326
|
-
* agent.dispose();
|
|
327
|
-
* }
|
|
328
|
-
* ```
|
|
329
|
-
*/
|
|
330
|
-
export declare function createAgent(options?: AgentOptions): Promise<LLMAgent>;
|
|
331
|
-
/**
|
|
332
|
-
* Create an agent configured for GLM (Z.AI)
|
|
333
|
-
*
|
|
334
|
-
* Convenience function that creates an agent with provider: 'glm'.
|
|
335
|
-
* Uses configuration from ~/.ax-glm/config.json.
|
|
336
|
-
*
|
|
337
|
-
* @param options - Agent options (provider is set to 'glm')
|
|
338
|
-
* @returns Configured LLM Agent for GLM
|
|
339
|
-
*
|
|
340
|
-
* @example
|
|
341
|
-
* ```typescript
|
|
342
|
-
* const agent = await createGLMAgent();
|
|
343
|
-
* const result = await agent.processUserMessage('Hello');
|
|
344
|
-
* agent.dispose();
|
|
345
|
-
* ```
|
|
346
|
-
*/
|
|
347
|
-
export declare function createGLMAgent(options?: Omit<AgentOptions, 'provider'>): Promise<LLMAgent>;
|
|
348
|
-
/**
|
|
349
|
-
* Create an agent configured for Grok (xAI)
|
|
350
|
-
*
|
|
351
|
-
* Convenience function that creates an agent with provider: 'grok'.
|
|
352
|
-
* Uses configuration from ~/.ax-grok/config.json.
|
|
353
|
-
*
|
|
354
|
-
* @param options - Agent options (provider is set to 'grok')
|
|
355
|
-
* @returns Configured LLM Agent for Grok
|
|
356
|
-
*
|
|
357
|
-
* @example
|
|
358
|
-
* ```typescript
|
|
359
|
-
* const agent = await createGrokAgent();
|
|
360
|
-
* const result = await agent.processUserMessage('Hello');
|
|
361
|
-
* agent.dispose();
|
|
362
|
-
* ```
|
|
363
|
-
*/
|
|
364
|
-
export declare function createGrokAgent(options?: Omit<AgentOptions, 'provider'>): Promise<LLMAgent>;
|
|
365
|
-
/**
|
|
366
|
-
* Result type for tryCreateAgent
|
|
367
|
-
*/
|
|
368
|
-
export type CreateAgentResult = {
|
|
369
|
-
success: true;
|
|
370
|
-
agent: LLMAgent;
|
|
371
|
-
error: undefined;
|
|
372
|
-
} | {
|
|
373
|
-
success: false;
|
|
374
|
-
agent: undefined;
|
|
375
|
-
error: SDKError;
|
|
376
|
-
};
|
|
377
|
-
/**
|
|
378
|
-
* Create an agent without throwing errors
|
|
379
|
-
*
|
|
380
|
-
* Unlike createAgent(), this function returns a result object instead of throwing.
|
|
381
|
-
* Useful for graceful error handling without try-catch blocks.
|
|
382
|
-
*
|
|
383
|
-
* @param options - Agent configuration options
|
|
384
|
-
* @returns Result object with either agent or error
|
|
385
|
-
*
|
|
386
|
-
* @example
|
|
387
|
-
* ```typescript
|
|
388
|
-
* const result = await tryCreateAgent({ provider: 'glm' });
|
|
389
|
-
*
|
|
390
|
-
* if (result.success) {
|
|
391
|
-
* // Use agent
|
|
392
|
-
* await result.agent.processUserMessage('Hello');
|
|
393
|
-
* result.agent.dispose();
|
|
394
|
-
* } else {
|
|
395
|
-
* // Handle error without try-catch
|
|
396
|
-
* console.error('Failed:', result.error.code, result.error.message);
|
|
397
|
-
* }
|
|
398
|
-
* ```
|
|
399
|
-
*/
|
|
400
|
-
export declare function tryCreateAgent(options?: AgentOptions): Promise<CreateAgentResult>;
|
|
401
|
-
/**
|
|
402
|
-
* Run a function with a temporary agent that is automatically disposed
|
|
403
|
-
*
|
|
404
|
-
* This helper creates an agent, runs your function, and ensures the agent
|
|
405
|
-
* is properly disposed even if an error occurs. Useful for:
|
|
406
|
-
* - One-off agent operations
|
|
407
|
-
* - Scripts that need cleanup guarantees
|
|
408
|
-
* - Testing scenarios
|
|
409
|
-
*
|
|
410
|
-
* @param fn - Function to run with the agent
|
|
411
|
-
* @param options - Agent configuration options
|
|
412
|
-
* @returns Result of the function
|
|
413
|
-
*
|
|
414
|
-
* @example
|
|
415
|
-
* ```typescript
|
|
416
|
-
* // Simple usage
|
|
417
|
-
* const result = await withAgent(async (agent) => {
|
|
418
|
-
* return await agent.processUserMessage('Analyze this code');
|
|
419
|
-
* });
|
|
420
|
-
*
|
|
421
|
-
* // With options
|
|
422
|
-
* const result = await withAgent(
|
|
423
|
-
* async (agent) => {
|
|
424
|
-
* agent.on('stream', console.log);
|
|
425
|
-
* return await agent.processUserMessage('Hello');
|
|
426
|
-
* },
|
|
427
|
-
* { provider: 'glm', maxToolRounds: 50 }
|
|
428
|
-
* );
|
|
429
|
-
* ```
|
|
430
|
-
*/
|
|
431
|
-
export declare function withAgent<T>(fn: (agent: LLMAgent) => Promise<T>, options?: AgentOptions): Promise<T>;
|
|
432
|
-
/**
|
|
433
|
-
* Run a function with a temporary agent, returning result or error
|
|
434
|
-
*
|
|
435
|
-
* Combines withAgent and tryCreateAgent - creates agent, runs function,
|
|
436
|
-
* disposes, and returns result without throwing. Ideal for error-tolerant
|
|
437
|
-
* workflows.
|
|
438
|
-
*
|
|
439
|
-
* @param fn - Function to run with the agent
|
|
440
|
-
* @param options - Agent configuration options
|
|
441
|
-
* @returns Result object with either value or error
|
|
442
|
-
*
|
|
443
|
-
* @example
|
|
444
|
-
* ```typescript
|
|
445
|
-
* const result = await tryWithAgent(async (agent) => {
|
|
446
|
-
* return await agent.processUserMessage('Hello');
|
|
447
|
-
* }, { provider: 'grok' });
|
|
448
|
-
*
|
|
449
|
-
* if (result.success) {
|
|
450
|
-
* console.log('Got response:', result.value);
|
|
451
|
-
* } else {
|
|
452
|
-
* console.error('Failed:', result.error.message);
|
|
453
|
-
* }
|
|
454
|
-
* ```
|
|
455
|
-
*/
|
|
456
|
-
export declare function tryWithAgent<T>(fn: (agent: LLMAgent) => Promise<T>, options?: AgentOptions): Promise<{
|
|
457
|
-
success: true;
|
|
458
|
-
value: T;
|
|
459
|
-
error: undefined;
|
|
460
|
-
} | {
|
|
461
|
-
success: false;
|
|
462
|
-
value: undefined;
|
|
463
|
-
error: SDKError;
|
|
464
|
-
}>;
|
|
465
|
-
/**
|
|
466
|
-
* Options for creating a subagent
|
|
467
|
-
*/
|
|
468
|
-
export interface SubagentOptions extends Partial<import('../agent/subagent-types.js').SubagentConfig> {
|
|
469
|
-
/**
|
|
470
|
-
* Provider to use for this subagent's configuration
|
|
471
|
-
*
|
|
472
|
-
* When specified, the subagent will use provider-specific settings.
|
|
473
|
-
* Important for parallel multi-provider scenarios.
|
|
474
|
-
*
|
|
475
|
-
* @default auto-detect based on environment
|
|
476
|
-
*/
|
|
477
|
-
provider?: ProviderType;
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Create a specialized subagent for specific tasks
|
|
481
|
-
*
|
|
482
|
-
* @param role - The role/specialty of the subagent
|
|
483
|
-
* @param options - Optional configuration including provider
|
|
484
|
-
* @returns Configured Subagent instance
|
|
485
|
-
*
|
|
486
|
-
* @example
|
|
487
|
-
* ```typescript
|
|
488
|
-
* // Basic usage
|
|
489
|
-
* const testAgent = createSubagent(SubagentRole.TESTING, {
|
|
490
|
-
* maxToolRounds: 20,
|
|
491
|
-
* priority: 2
|
|
492
|
-
* });
|
|
493
|
-
*
|
|
494
|
-
* // With provider for parallel support
|
|
495
|
-
* const glmSubagent = createSubagent(SubagentRole.ANALYSIS, {
|
|
496
|
-
* provider: 'glm',
|
|
497
|
-
* maxToolRounds: 30
|
|
498
|
-
* });
|
|
499
|
-
*
|
|
500
|
-
* const result = await testAgent.execute({
|
|
501
|
-
* id: 'task-1',
|
|
502
|
-
* description: 'Write unit tests for auth module',
|
|
503
|
-
* context: { files: ['src/auth.ts'] }
|
|
504
|
-
* });
|
|
505
|
-
* ```
|
|
506
|
-
*/
|
|
507
|
-
export declare function createSubagent(role: import('../agent/subagent-types.js').SubagentRole, options?: SubagentOptions): Subagent;
|
|
508
|
-
/**
|
|
509
|
-
* Remove auto-cleanup handlers from an agent
|
|
510
|
-
*
|
|
511
|
-
* Use this function to remove the automatic cleanup handlers registered by createAgent()
|
|
512
|
-
* when autoCleanup was enabled (default). This gives you manual control over when the
|
|
513
|
-
* agent is disposed.
|
|
514
|
-
*
|
|
515
|
-
* **Use Cases:**
|
|
516
|
-
* - Long-running services that manage agent lifecycle manually
|
|
517
|
-
* - Testing scenarios where you want precise control over cleanup
|
|
518
|
-
* - Library code that embeds agents
|
|
519
|
-
*
|
|
520
|
-
* **Note:** Only works if agent was created with autoCleanup: true (default).
|
|
521
|
-
* If autoCleanup was false, this function does nothing.
|
|
522
|
-
*
|
|
523
|
-
* @param agent - The agent instance created with createAgent()
|
|
524
|
-
*
|
|
525
|
-
* @example
|
|
526
|
-
* ```typescript
|
|
527
|
-
* // Create agent with auto-cleanup (default)
|
|
528
|
-
* const agent = await createAgent();
|
|
529
|
-
*
|
|
530
|
-
* // Later, take manual control
|
|
531
|
-
* removeCleanupHandlers(agent);
|
|
532
|
-
*
|
|
533
|
-
* // Now you must manually dispose
|
|
534
|
-
* agent.dispose();
|
|
535
|
-
* ```
|
|
536
|
-
*
|
|
537
|
-
* @example
|
|
538
|
-
* ```typescript
|
|
539
|
-
* // For manual cleanup from the start, use autoCleanup: false
|
|
540
|
-
* const agent = await createAgent({ autoCleanup: false });
|
|
541
|
-
* // No need to call removeCleanupHandlers
|
|
542
|
-
* agent.dispose(); // Manual cleanup
|
|
543
|
-
* ```
|
|
544
|
-
*/
|
|
545
|
-
export declare function removeCleanupHandlers(agent: LLMAgent): void;
|
|
546
|
-
/**
|
|
547
|
-
* Initialize SDK and MCP servers
|
|
548
|
-
*
|
|
549
|
-
* SECURITY: This function does NOT accept credentials. All credentials must be
|
|
550
|
-
* configured via "ax-cli setup" command. This function only initializes MCP servers.
|
|
551
|
-
*
|
|
552
|
-
* @example
|
|
553
|
-
* ```typescript
|
|
554
|
-
* // Initialize MCP servers from ax-cli settings
|
|
555
|
-
* await initializeSDK();
|
|
556
|
-
* ```
|
|
557
|
-
*
|
|
558
|
-
* @deprecated Most SDK users don't need to call this - createAgent() handles initialization.
|
|
559
|
-
* Only call this if you need to pre-initialize MCP servers.
|
|
560
|
-
*/
|
|
561
|
-
export declare function initializeSDK(): Promise<void>;
|
|
562
|
-
/**
|
|
563
|
-
* Information about an agent's configuration
|
|
564
|
-
*/
|
|
565
|
-
export interface AgentInfo {
|
|
566
|
-
/** Provider type ('glm', 'grok', or 'generic') */
|
|
567
|
-
provider: ProviderType;
|
|
568
|
-
/** Provider display name */
|
|
569
|
-
providerDisplayName: string;
|
|
570
|
-
/** Current model in use */
|
|
571
|
-
model: string | undefined;
|
|
572
|
-
/** Base URL for API calls */
|
|
573
|
-
baseURL: string | undefined;
|
|
574
|
-
/** Whether the agent has been disposed */
|
|
575
|
-
isDisposed: boolean;
|
|
576
|
-
/** Configuration directory path */
|
|
577
|
-
configDir: string;
|
|
578
|
-
/** CLI command name for this provider */
|
|
579
|
-
cliName: string;
|
|
580
|
-
/** When the agent was created */
|
|
581
|
-
createdAt: Date;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* Get information about an agent created with createAgent()
|
|
585
|
-
*
|
|
586
|
-
* This function extracts the provider, model, and configuration information
|
|
587
|
-
* from an agent instance. Useful for debugging, logging, and multi-provider
|
|
588
|
-
* scenarios where you need to know which provider an agent is using.
|
|
589
|
-
*
|
|
590
|
-
* @param agent - The agent instance created with createAgent()
|
|
591
|
-
* @returns AgentInfo object with provider/model details, or null if not SDK-created
|
|
592
|
-
*
|
|
593
|
-
* @example
|
|
594
|
-
* ```typescript
|
|
595
|
-
* const glmAgent = await createAgent({ provider: 'glm' });
|
|
596
|
-
* const grokAgent = await createAgent({ provider: 'grok' });
|
|
597
|
-
*
|
|
598
|
-
* const glmInfo = getAgentInfo(glmAgent);
|
|
599
|
-
* console.log(glmInfo?.provider); // 'glm'
|
|
600
|
-
* console.log(glmInfo?.model); // 'glm-4.6'
|
|
601
|
-
*
|
|
602
|
-
* const grokInfo = getAgentInfo(grokAgent);
|
|
603
|
-
* console.log(grokInfo?.provider); // 'grok'
|
|
604
|
-
* console.log(grokInfo?.model); // 'grok-4-0709'
|
|
605
|
-
* ```
|
|
606
|
-
*/
|
|
607
|
-
export declare function getAgentInfo(agent: LLMAgent): AgentInfo | null;
|
|
608
|
-
/**
|
|
609
|
-
* Get the model an agent is using
|
|
610
|
-
*
|
|
611
|
-
* Quick accessor to get just the model name from an SDK-created agent.
|
|
612
|
-
* Returns undefined if the agent was not created via createAgent().
|
|
613
|
-
*
|
|
614
|
-
* @param agent - The agent instance
|
|
615
|
-
* @returns The model name or undefined
|
|
616
|
-
*
|
|
617
|
-
* @example
|
|
618
|
-
* ```typescript
|
|
619
|
-
* const agent = await createAgent({ provider: 'glm' });
|
|
620
|
-
* console.log(getAgentModel(agent)); // 'glm-4.6'
|
|
621
|
-
* ```
|
|
622
|
-
*/
|
|
623
|
-
export declare function getAgentModel(agent: LLMAgent): string | undefined;
|
|
624
|
-
/**
|
|
625
|
-
* Get the base URL an agent is using
|
|
626
|
-
*
|
|
627
|
-
* Quick accessor to get just the base URL from an SDK-created agent.
|
|
628
|
-
* Returns undefined if the agent was not created via createAgent().
|
|
629
|
-
*
|
|
630
|
-
* @param agent - The agent instance
|
|
631
|
-
* @returns The base URL or undefined
|
|
632
|
-
*
|
|
633
|
-
* @example
|
|
634
|
-
* ```typescript
|
|
635
|
-
* const agent = await createAgent({ provider: 'grok' });
|
|
636
|
-
* console.log(getAgentBaseURL(agent)); // 'https://api.x.ai/v1'
|
|
637
|
-
* ```
|
|
638
|
-
*/
|
|
639
|
-
export declare function getAgentBaseURL(agent: LLMAgent): string | undefined;
|
|
640
|
-
/**
|
|
641
|
-
* Get the provider an agent is using
|
|
642
|
-
*
|
|
643
|
-
* Quick accessor to get just the provider type from an SDK-created agent.
|
|
644
|
-
* Returns undefined if the agent was not created via createAgent().
|
|
645
|
-
*
|
|
646
|
-
* @param agent - The agent instance
|
|
647
|
-
* @returns The provider type or undefined
|
|
648
|
-
*
|
|
649
|
-
* @example
|
|
650
|
-
* ```typescript
|
|
651
|
-
* const agent = await createAgent({ provider: 'glm' });
|
|
652
|
-
* console.log(getAgentProvider(agent)); // 'glm'
|
|
653
|
-
* ```
|
|
654
|
-
*/
|
|
655
|
-
export declare function getAgentProvider(agent: LLMAgent): ProviderType | undefined;
|
|
656
|
-
/**
|
|
657
|
-
* Get when an agent was created
|
|
658
|
-
*
|
|
659
|
-
* Quick accessor to get the creation timestamp from an SDK-created agent.
|
|
660
|
-
* Useful for logging, monitoring, and debugging agent lifecycle.
|
|
661
|
-
* Returns undefined if the agent was not created via createAgent().
|
|
662
|
-
*
|
|
663
|
-
* @param agent - The agent instance
|
|
664
|
-
* @returns The creation Date or undefined
|
|
665
|
-
*
|
|
666
|
-
* @example
|
|
667
|
-
* ```typescript
|
|
668
|
-
* const agent = await createAgent();
|
|
669
|
-
* console.log(getAgentCreatedAt(agent)); // Date object
|
|
670
|
-
* ```
|
|
671
|
-
*/
|
|
672
|
-
export declare function getAgentCreatedAt(agent: LLMAgent): Date | undefined;
|
|
673
|
-
/**
|
|
674
|
-
* Get how long an agent has been running (age in milliseconds)
|
|
675
|
-
*
|
|
676
|
-
* Returns the time elapsed since the agent was created. Useful for:
|
|
677
|
-
* - Monitoring long-running agents
|
|
678
|
-
* - Implementing agent timeouts
|
|
679
|
-
* - Debugging performance issues
|
|
680
|
-
* - Logging agent lifecycle metrics
|
|
681
|
-
*
|
|
682
|
-
* @param agent - The agent instance
|
|
683
|
-
* @returns Age in milliseconds, or undefined if not SDK-created
|
|
684
|
-
*
|
|
685
|
-
* @example
|
|
686
|
-
* ```typescript
|
|
687
|
-
* const agent = await createAgent();
|
|
688
|
-
*
|
|
689
|
-
* // ... some work ...
|
|
690
|
-
*
|
|
691
|
-
* const ageMs = getAgentAge(agent);
|
|
692
|
-
* if (ageMs !== undefined) {
|
|
693
|
-
* console.log(`Agent running for ${Math.round(ageMs / 1000)}s`);
|
|
694
|
-
*
|
|
695
|
-
* // Implement timeout
|
|
696
|
-
* if (ageMs > 5 * 60 * 1000) { // 5 minutes
|
|
697
|
-
* console.warn('Agent running too long, disposing');
|
|
698
|
-
* agent.dispose();
|
|
699
|
-
* }
|
|
700
|
-
* }
|
|
701
|
-
* ```
|
|
702
|
-
*/
|
|
703
|
-
export declare function getAgentAge(agent: LLMAgent): number | undefined;
|
|
704
|
-
/**
|
|
705
|
-
* Format agent age as human-readable string
|
|
706
|
-
*
|
|
707
|
-
* Convenience function to get agent age as a formatted string.
|
|
708
|
-
* Returns undefined if agent was not created via createAgent().
|
|
709
|
-
*
|
|
710
|
-
* @param agent - The agent instance
|
|
711
|
-
* @returns Formatted age string (e.g., "1m 30s", "2h 15m"), or undefined
|
|
712
|
-
*
|
|
713
|
-
* @example
|
|
714
|
-
* ```typescript
|
|
715
|
-
* const agent = await createAgent();
|
|
716
|
-
* // ... work ...
|
|
717
|
-
* console.log(`Agent age: ${formatAgentAge(agent)}`); // "Agent age: 1m 30s"
|
|
718
|
-
* ```
|
|
719
|
-
*/
|
|
720
|
-
export declare function formatAgentAge(agent: LLMAgent): string | undefined;
|
|
721
|
-
/**
|
|
722
|
-
* Check if an agent is busy (bash executing) or disposed
|
|
723
|
-
*
|
|
724
|
-
* This function provides a quick check to determine if an agent is available
|
|
725
|
-
* to process new messages. An agent is considered "busy" if:
|
|
726
|
-
* - It has been disposed (cannot be used at all)
|
|
727
|
-
* - It is currently executing a bash command
|
|
728
|
-
*
|
|
729
|
-
* Useful for:
|
|
730
|
-
* - Pre-flight checks before sending messages
|
|
731
|
-
* - Implementing request queuing
|
|
732
|
-
* - Health monitoring dashboards
|
|
733
|
-
*
|
|
734
|
-
* @param agent - The agent instance to check
|
|
735
|
-
* @returns Object with availability status
|
|
736
|
-
*
|
|
737
|
-
* @example
|
|
738
|
-
* ```typescript
|
|
739
|
-
* const agent = await createAgent();
|
|
740
|
-
*
|
|
741
|
-
* // Check before processing
|
|
742
|
-
* const status = getAgentStatus(agent);
|
|
743
|
-
* if (!status.available) {
|
|
744
|
-
* console.log('Agent not available:', status.reason);
|
|
745
|
-
* return;
|
|
746
|
-
* }
|
|
747
|
-
*
|
|
748
|
-
* await agent.processUserMessage('Hello');
|
|
749
|
-
* ```
|
|
750
|
-
*/
|
|
751
|
-
export declare function getAgentStatus(agent: LLMAgent): {
|
|
752
|
-
/** Whether the agent is available to process messages */
|
|
753
|
-
available: boolean;
|
|
754
|
-
/** Whether the agent has been disposed */
|
|
755
|
-
isDisposed: boolean;
|
|
756
|
-
/** Whether the agent is executing bash command */
|
|
757
|
-
isBusy: boolean;
|
|
758
|
-
/** Reason why agent is unavailable (if not available) */
|
|
759
|
-
reason?: string;
|
|
760
|
-
/** Agent age in milliseconds (if SDK-created) */
|
|
761
|
-
ageMs?: number;
|
|
762
|
-
};
|
|
763
|
-
/**
|
|
764
|
-
* Result of a provider health check
|
|
765
|
-
*/
|
|
766
|
-
export interface ProviderHealthResult {
|
|
767
|
-
/** Whether the provider is healthy and ready */
|
|
768
|
-
healthy: boolean;
|
|
769
|
-
/** Provider type checked */
|
|
770
|
-
provider: ProviderType;
|
|
771
|
-
/** Whether API key is configured */
|
|
772
|
-
hasApiKey: boolean;
|
|
773
|
-
/** Whether base URL is configured */
|
|
774
|
-
hasBaseURL: boolean;
|
|
775
|
-
/** Whether model is configured */
|
|
776
|
-
hasModel: boolean;
|
|
777
|
-
/** Human-readable status message */
|
|
778
|
-
message: string;
|
|
779
|
-
/** Error details if unhealthy */
|
|
780
|
-
error?: string;
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Check if a provider is properly configured and ready to use
|
|
784
|
-
*
|
|
785
|
-
* This function validates that a provider has all required configuration
|
|
786
|
-
* (API key, base URL, model) without actually creating an agent or making
|
|
787
|
-
* API calls. Useful for:
|
|
788
|
-
* - Pre-flight checks before creating agents
|
|
789
|
-
* - Setup wizards and configuration UIs
|
|
790
|
-
* - Health checks in long-running services
|
|
791
|
-
*
|
|
792
|
-
* @param provider - Provider to check (defaults to auto-detect)
|
|
793
|
-
* @returns ProviderHealthResult with configuration status
|
|
794
|
-
*
|
|
795
|
-
* @example
|
|
796
|
-
* ```typescript
|
|
797
|
-
* // Check specific provider
|
|
798
|
-
* const glmHealth = checkProviderHealth('glm');
|
|
799
|
-
* if (!glmHealth.healthy) {
|
|
800
|
-
* console.error('GLM not configured:', glmHealth.message);
|
|
801
|
-
* console.log('Run: ax-glm setup');
|
|
802
|
-
* }
|
|
803
|
-
*
|
|
804
|
-
* // Check all providers
|
|
805
|
-
* const providers: ProviderType[] = ['glm', 'grok'];
|
|
806
|
-
* for (const p of providers) {
|
|
807
|
-
* const health = checkProviderHealth(p);
|
|
808
|
-
* console.log(`${p}: ${health.healthy ? '✓' : '✗'} ${health.message}`);
|
|
809
|
-
* }
|
|
810
|
-
* ```
|
|
811
|
-
*/
|
|
812
|
-
export declare function checkProviderHealth(provider?: ProviderType): ProviderHealthResult;
|
|
813
|
-
/**
|
|
814
|
-
* Get health status for all supported providers
|
|
815
|
-
*
|
|
816
|
-
* @returns Array of health results for all providers
|
|
817
|
-
*
|
|
818
|
-
* @example
|
|
819
|
-
* ```typescript
|
|
820
|
-
* const allHealth = getAllProviderHealth();
|
|
821
|
-
* const configured = allHealth.filter(h => h.healthy);
|
|
822
|
-
* console.log(`${configured.length} providers ready`);
|
|
823
|
-
* ```
|
|
824
|
-
*/
|
|
825
|
-
export declare function getAllProviderHealth(): ProviderHealthResult[];
|
|
826
|
-
/**
|
|
827
|
-
* Check if an agent has been disposed
|
|
828
|
-
*
|
|
829
|
-
* This function provides a reliable way to check if an agent created with
|
|
830
|
-
* createAgent() has been disposed. Works regardless of the `autoCleanup` setting.
|
|
831
|
-
*
|
|
832
|
-
* @param agent - The agent instance to check
|
|
833
|
-
* @returns true if the agent has been disposed, false otherwise
|
|
834
|
-
* @returns undefined if the agent was not created via createAgent()
|
|
835
|
-
*
|
|
836
|
-
* @example
|
|
837
|
-
* ```typescript
|
|
838
|
-
* const agent = await createAgent();
|
|
839
|
-
* console.log(isAgentDisposed(agent)); // false
|
|
840
|
-
*
|
|
841
|
-
* agent.dispose();
|
|
842
|
-
* console.log(isAgentDisposed(agent)); // true
|
|
843
|
-
* ```
|
|
844
|
-
*/
|
|
845
|
-
export declare function isAgentDisposed(agent: LLMAgent): boolean | undefined;
|
|
846
|
-
/**
|
|
847
|
-
* Dispose an agent asynchronously, properly awaiting the onDispose hook
|
|
848
|
-
*
|
|
849
|
-
* The standard `agent.dispose()` is synchronous and fires async onDispose hooks
|
|
850
|
-
* in a fire-and-forget manner. Use this function when you need to ensure the
|
|
851
|
-
* onDispose hook completes before continuing.
|
|
852
|
-
*
|
|
853
|
-
* @param agent - The agent instance to dispose
|
|
854
|
-
* @returns Promise that resolves when disposal is complete
|
|
855
|
-
*
|
|
856
|
-
* @example
|
|
857
|
-
* ```typescript
|
|
858
|
-
* const agent = await createAgent({
|
|
859
|
-
* onDispose: async () => {
|
|
860
|
-
* await saveState(); // This WILL be awaited with disposeAsync
|
|
861
|
-
* }
|
|
862
|
-
* });
|
|
863
|
-
*
|
|
864
|
-
* // ... use agent ...
|
|
865
|
-
*
|
|
866
|
-
* // Properly await cleanup
|
|
867
|
-
* await disposeAsync(agent);
|
|
868
|
-
* console.log('Cleanup complete, state saved');
|
|
869
|
-
* ```
|
|
870
|
-
*/
|
|
871
|
-
export declare function disposeAsync(agent: LLMAgent): Promise<void>;
|
|
872
|
-
/**
|
|
873
|
-
* Information about a subagent's configuration
|
|
874
|
-
*/
|
|
875
|
-
export interface SubagentInfo {
|
|
876
|
-
/** Provider type if configured */
|
|
877
|
-
provider: ProviderType | undefined;
|
|
878
|
-
/** Provider display name if configured */
|
|
879
|
-
providerDisplayName: string | undefined;
|
|
880
|
-
/** Configuration directory path if configured */
|
|
881
|
-
configDir: string | undefined;
|
|
882
|
-
/** CLI command name for this provider if configured */
|
|
883
|
-
cliName: string | undefined;
|
|
884
|
-
/** The subagent's role */
|
|
885
|
-
role: import('../agent/subagent-types.js').SubagentRole;
|
|
886
|
-
}
|
|
887
|
-
/**
|
|
888
|
-
* Get information about a subagent created with createSubagent()
|
|
889
|
-
*
|
|
890
|
-
* @param subagent - The subagent instance
|
|
891
|
-
* @returns SubagentInfo object with provider details
|
|
892
|
-
*
|
|
893
|
-
* @example
|
|
894
|
-
* ```typescript
|
|
895
|
-
* const subagent = createSubagent(SubagentRole.TESTING, { provider: 'glm' });
|
|
896
|
-
* const info = getSubagentInfo(subagent);
|
|
897
|
-
* console.log(info.provider); // 'glm'
|
|
898
|
-
* console.log(info.role); // SubagentRole.TESTING
|
|
899
|
-
* ```
|
|
900
|
-
*/
|
|
901
|
-
export declare function getSubagentInfo(subagent: Subagent): SubagentInfo;
|