@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/llm/types.d.ts
DELETED
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GLM-4.6 API Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* This file contains comprehensive type definitions for GLM-4.6 API features,
|
|
5
|
-
* including advanced reasoning mode, configurable parameters, and enhanced
|
|
6
|
-
* response structures.
|
|
7
|
-
*
|
|
8
|
-
* @see https://docs.z.ai/guides/llm/glm-4.6
|
|
9
|
-
*/
|
|
10
|
-
import type { LLMTool, LLMToolCall, SearchOptions } from "./client.js";
|
|
11
|
-
/**
|
|
12
|
-
* Thinking/Reasoning configuration for models with extended thinking support
|
|
13
|
-
*
|
|
14
|
-
* Supports two styles of thinking mode:
|
|
15
|
-
* - GLM (Z.AI): Uses `thinking_mode` parameter with type "enabled"/"disabled"
|
|
16
|
-
* - Grok 3 (xAI): Uses `reasoning_effort` parameter with "low"/"high" values
|
|
17
|
-
*
|
|
18
|
-
* When enabled, the model will include reasoning_content in responses,
|
|
19
|
-
* showing the step-by-step thought process before generating the final answer.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // GLM style (default)
|
|
24
|
-
* const thinking: ThinkingConfig = { type: "enabled" };
|
|
25
|
-
*
|
|
26
|
-
* // Grok 3 style with reasoning effort
|
|
27
|
-
* const thinking: ThinkingConfig = { type: "enabled", reasoningEffort: "high" };
|
|
28
|
-
* const response = await client.chat(messages, [], { thinking });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export interface ThinkingConfig {
|
|
32
|
-
/**
|
|
33
|
-
* Enable or disable thinking mode
|
|
34
|
-
* - "enabled": Include reasoning process in responses
|
|
35
|
-
* - "disabled": Standard response without reasoning
|
|
36
|
-
*/
|
|
37
|
-
type: "enabled" | "disabled";
|
|
38
|
-
/**
|
|
39
|
-
* Reasoning effort level for Grok 3 models (xAI)
|
|
40
|
-
* Only used when the provider uses 'reasoning_effort' style
|
|
41
|
-
* - "low": Light reasoning for simpler tasks
|
|
42
|
-
* - "high": Deep reasoning for complex tasks (default when enabled)
|
|
43
|
-
*/
|
|
44
|
-
reasoningEffort?: "low" | "high";
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Sampling configuration for controlling output diversity and reproducibility
|
|
48
|
-
*
|
|
49
|
-
* Provider-specific behaviors:
|
|
50
|
-
* - GLM (Z.AI): Uses `do_sample` parameter. Set to `false` for deterministic output.
|
|
51
|
-
* Seed is NOT supported by z.ai.
|
|
52
|
-
* - Grok (xAI): Uses `seed` parameter for reproducible outputs.
|
|
53
|
-
* do_sample is NOT used by Grok.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* // GLM: Deterministic mode for reproducible outputs
|
|
58
|
-
* const sampling: SamplingConfig = { doSample: false };
|
|
59
|
-
*
|
|
60
|
-
* // Grok: Seed-based reproducible outputs
|
|
61
|
-
* const sampling: SamplingConfig = { seed: 42 };
|
|
62
|
-
*
|
|
63
|
-
* const response = await client.chat(messages, [], { sampling });
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export interface SamplingConfig {
|
|
67
|
-
/**
|
|
68
|
-
* Whether to sample the output to increase diversity (GLM only)
|
|
69
|
-
* - true (default): Use random sampling based on temperature for creative outputs
|
|
70
|
-
* - false: Use greedy decoding for deterministic, reproducible results
|
|
71
|
-
*
|
|
72
|
-
* When set to false, the model will always select the most probable token,
|
|
73
|
-
* making outputs reproducible.
|
|
74
|
-
*
|
|
75
|
-
* Note: Only supported by GLM (z.ai). Ignored for Grok models.
|
|
76
|
-
*/
|
|
77
|
-
doSample?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Random seed for reproducible sampling (Grok only)
|
|
80
|
-
*
|
|
81
|
-
* Use the same seed value to get reproducible outputs from Grok models.
|
|
82
|
-
*
|
|
83
|
-
* Note: Only supported by Grok (xAI). For GLM models, use doSample: false instead.
|
|
84
|
-
*
|
|
85
|
-
* @example 42, 12345, Date.now()
|
|
86
|
-
*/
|
|
87
|
-
seed?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Nucleus sampling parameter (alternative to temperature)
|
|
90
|
-
*
|
|
91
|
-
* Controls diversity by limiting token selection to the smallest set
|
|
92
|
-
* whose cumulative probability exceeds top_p.
|
|
93
|
-
*
|
|
94
|
-
* Recommended range: 0.8-0.95
|
|
95
|
-
* Note: It's generally not advised to use both temperature and top_p simultaneously.
|
|
96
|
-
*
|
|
97
|
-
* @minimum 0.0
|
|
98
|
-
* @maximum 1.0
|
|
99
|
-
*/
|
|
100
|
-
topP?: number;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Comprehensive options for GLM-4.6 chat requests
|
|
104
|
-
*
|
|
105
|
-
* Consolidates all available parameters for chat completions,
|
|
106
|
-
* providing type-safe configuration for GLM-4.6 features.
|
|
107
|
-
*/
|
|
108
|
-
export interface ChatOptions {
|
|
109
|
-
/**
|
|
110
|
-
* Model identifier
|
|
111
|
-
* @default "glm-4.6"
|
|
112
|
-
* @example "glm-4.6"
|
|
113
|
-
*/
|
|
114
|
-
model?: string;
|
|
115
|
-
/**
|
|
116
|
-
* Temperature controls randomness in responses
|
|
117
|
-
*
|
|
118
|
-
* - Lower values (0.6): More focused and deterministic
|
|
119
|
-
* - Higher values (1.0): More creative and diverse
|
|
120
|
-
*
|
|
121
|
-
* @default 0.7
|
|
122
|
-
* @minimum 0.6
|
|
123
|
-
* @maximum 1.0
|
|
124
|
-
*/
|
|
125
|
-
temperature?: number;
|
|
126
|
-
/**
|
|
127
|
-
* Maximum number of tokens to generate
|
|
128
|
-
*
|
|
129
|
-
* GLM-4.6 supports up to 128,000 output tokens
|
|
130
|
-
*
|
|
131
|
-
* @default 8192
|
|
132
|
-
* @maximum 128000
|
|
133
|
-
*/
|
|
134
|
-
maxTokens?: number;
|
|
135
|
-
/**
|
|
136
|
-
* Enable/disable advanced reasoning mode
|
|
137
|
-
*
|
|
138
|
-
* When enabled, responses include reasoning_content showing
|
|
139
|
-
* the model's step-by-step thought process.
|
|
140
|
-
*/
|
|
141
|
-
thinking?: ThinkingConfig;
|
|
142
|
-
/**
|
|
143
|
-
* Search parameters for web-enabled queries
|
|
144
|
-
*/
|
|
145
|
-
searchOptions?: SearchOptions;
|
|
146
|
-
/**
|
|
147
|
-
* Tools/functions available for the model to call
|
|
148
|
-
*/
|
|
149
|
-
tools?: LLMTool[];
|
|
150
|
-
/**
|
|
151
|
-
* Enable streaming responses
|
|
152
|
-
* @default false
|
|
153
|
-
*/
|
|
154
|
-
stream?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Response format for structured output
|
|
157
|
-
*
|
|
158
|
-
* When set to { type: "json_object" }, the model will return valid JSON.
|
|
159
|
-
* Use this for plan generation and other structured responses.
|
|
160
|
-
*
|
|
161
|
-
* @example { type: "json_object" }
|
|
162
|
-
*/
|
|
163
|
-
responseFormat?: {
|
|
164
|
-
type: "text" | "json_object";
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Sampling configuration for controlling output diversity and reproducibility
|
|
168
|
-
*
|
|
169
|
-
* Use this to enable deterministic mode or fine-tune sampling behavior.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```typescript
|
|
173
|
-
* // Deterministic mode
|
|
174
|
-
* { sampling: { doSample: false, seed: 42 } }
|
|
175
|
-
*
|
|
176
|
-
* // Fine-tuned sampling with top_p
|
|
177
|
-
* { sampling: { doSample: true, topP: 0.9 } }
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
sampling?: SamplingConfig;
|
|
181
|
-
/**
|
|
182
|
-
* AbortSignal for cancelling the request
|
|
183
|
-
*
|
|
184
|
-
* Allows the caller to cancel in-progress requests when needed.
|
|
185
|
-
*/
|
|
186
|
-
signal?: AbortSignal;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* GLM-4.6 enhanced response structure
|
|
190
|
-
*
|
|
191
|
-
* Extends the standard response with reasoning content and
|
|
192
|
-
* enhanced usage metrics.
|
|
193
|
-
*/
|
|
194
|
-
export interface GLM46Response {
|
|
195
|
-
id: string;
|
|
196
|
-
object: string;
|
|
197
|
-
created: number;
|
|
198
|
-
model: string;
|
|
199
|
-
choices: Array<{
|
|
200
|
-
index: number;
|
|
201
|
-
message: {
|
|
202
|
-
role: string;
|
|
203
|
-
content: string | null;
|
|
204
|
-
/**
|
|
205
|
-
* Reasoning process (only present when thinking is enabled)
|
|
206
|
-
* Contains the step-by-step thought process before the final answer
|
|
207
|
-
*/
|
|
208
|
-
reasoning_content?: string;
|
|
209
|
-
tool_calls?: LLMToolCall[];
|
|
210
|
-
};
|
|
211
|
-
finish_reason: string;
|
|
212
|
-
}>;
|
|
213
|
-
/**
|
|
214
|
-
* Token usage statistics
|
|
215
|
-
*/
|
|
216
|
-
usage?: {
|
|
217
|
-
prompt_tokens: number;
|
|
218
|
-
completion_tokens: number;
|
|
219
|
-
total_tokens: number;
|
|
220
|
-
/**
|
|
221
|
-
* Tokens used for reasoning (only when thinking is enabled)
|
|
222
|
-
*/
|
|
223
|
-
reasoning_tokens?: number;
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* GLM-4.6 streaming response chunk
|
|
228
|
-
*
|
|
229
|
-
* Individual chunks received during streaming responses,
|
|
230
|
-
* including support for reasoning content.
|
|
231
|
-
*/
|
|
232
|
-
export interface GLM46StreamChunk {
|
|
233
|
-
id: string;
|
|
234
|
-
object: string;
|
|
235
|
-
created: number;
|
|
236
|
-
model: string;
|
|
237
|
-
choices: Array<{
|
|
238
|
-
index: number;
|
|
239
|
-
delta: {
|
|
240
|
-
role?: string;
|
|
241
|
-
/**
|
|
242
|
-
* Incremental content from the final response
|
|
243
|
-
*/
|
|
244
|
-
content?: string;
|
|
245
|
-
/**
|
|
246
|
-
* Incremental reasoning content (when thinking is enabled)
|
|
247
|
-
* Shows the model's thought process as it develops
|
|
248
|
-
*/
|
|
249
|
-
reasoning_content?: string;
|
|
250
|
-
tool_calls?: Array<{
|
|
251
|
-
index: number;
|
|
252
|
-
id?: string;
|
|
253
|
-
type?: "function";
|
|
254
|
-
function?: {
|
|
255
|
-
name?: string;
|
|
256
|
-
arguments?: string;
|
|
257
|
-
};
|
|
258
|
-
}>;
|
|
259
|
-
};
|
|
260
|
-
finish_reason?: string | null;
|
|
261
|
-
}>;
|
|
262
|
-
/**
|
|
263
|
-
* Token usage statistics (usually in the final chunk)
|
|
264
|
-
*/
|
|
265
|
-
usage?: {
|
|
266
|
-
prompt_tokens: number;
|
|
267
|
-
completion_tokens: number;
|
|
268
|
-
total_tokens: number;
|
|
269
|
-
reasoning_tokens?: number;
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Type guard to check if a response is a GLM-4.6 response
|
|
274
|
-
*/
|
|
275
|
-
export declare function isGLM46Response(response: unknown): response is GLM46Response;
|
|
276
|
-
/**
|
|
277
|
-
* Type guard to check if a chunk has reasoning content
|
|
278
|
-
*/
|
|
279
|
-
export declare function hasReasoningContent(chunk: GLM46StreamChunk): chunk is GLM46StreamChunk & {
|
|
280
|
-
choices: Array<{
|
|
281
|
-
delta: {
|
|
282
|
-
reasoning_content: string;
|
|
283
|
-
};
|
|
284
|
-
}>;
|
|
285
|
-
};
|
|
286
|
-
/**
|
|
287
|
-
* Message content part for multimodal messages
|
|
288
|
-
*/
|
|
289
|
-
export type MessageContentPart = {
|
|
290
|
-
type: "text";
|
|
291
|
-
text: string;
|
|
292
|
-
} | {
|
|
293
|
-
type: "image_url";
|
|
294
|
-
image_url: {
|
|
295
|
-
url: string;
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* Message with multimodal content support
|
|
300
|
-
*/
|
|
301
|
-
export interface MultimodalMessage {
|
|
302
|
-
role: "user" | "assistant" | "system";
|
|
303
|
-
content: string | MessageContentPart[];
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* GLM-4.6 model configurations
|
|
307
|
-
*
|
|
308
|
-
* Defines capabilities and limits for supported models
|
|
309
|
-
*/
|
|
310
|
-
export declare const GLM_MODELS: {
|
|
311
|
-
readonly "glm-4.6": {
|
|
312
|
-
readonly contextWindow: 200000;
|
|
313
|
-
readonly maxOutputTokens: 128000;
|
|
314
|
-
readonly supportsThinking: true;
|
|
315
|
-
readonly supportsVision: false;
|
|
316
|
-
readonly defaultTemperature: 0.7;
|
|
317
|
-
readonly temperatureRange: {
|
|
318
|
-
readonly min: 0.6;
|
|
319
|
-
readonly max: 1;
|
|
320
|
-
};
|
|
321
|
-
readonly tokenEfficiency: 1.3;
|
|
322
|
-
};
|
|
323
|
-
readonly "glm-4.5v": {
|
|
324
|
-
readonly contextWindow: 64000;
|
|
325
|
-
readonly maxOutputTokens: 16000;
|
|
326
|
-
readonly supportsThinking: true;
|
|
327
|
-
readonly supportsVision: true;
|
|
328
|
-
readonly defaultTemperature: 0.7;
|
|
329
|
-
readonly temperatureRange: {
|
|
330
|
-
readonly min: 0.6;
|
|
331
|
-
readonly max: 1;
|
|
332
|
-
};
|
|
333
|
-
readonly tokenEfficiency: 1.2;
|
|
334
|
-
};
|
|
335
|
-
readonly "glm-4.6v": {
|
|
336
|
-
readonly contextWindow: 128000;
|
|
337
|
-
readonly maxOutputTokens: 128000;
|
|
338
|
-
readonly supportsThinking: true;
|
|
339
|
-
readonly supportsVision: true;
|
|
340
|
-
readonly defaultTemperature: 0.7;
|
|
341
|
-
readonly temperatureRange: {
|
|
342
|
-
readonly min: 0.6;
|
|
343
|
-
readonly max: 1;
|
|
344
|
-
};
|
|
345
|
-
readonly tokenEfficiency: 1.3;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
export type SupportedModel = keyof typeof GLM_MODELS;
|
|
349
|
-
/**
|
|
350
|
-
* Get model configuration by name
|
|
351
|
-
*/
|
|
352
|
-
export declare function getModelConfig(model: string): {
|
|
353
|
-
readonly contextWindow: 200000;
|
|
354
|
-
readonly maxOutputTokens: 128000;
|
|
355
|
-
readonly supportsThinking: true;
|
|
356
|
-
readonly supportsVision: false;
|
|
357
|
-
readonly defaultTemperature: 0.7;
|
|
358
|
-
readonly temperatureRange: {
|
|
359
|
-
readonly min: 0.6;
|
|
360
|
-
readonly max: 1;
|
|
361
|
-
};
|
|
362
|
-
readonly tokenEfficiency: 1.3;
|
|
363
|
-
} | {
|
|
364
|
-
readonly contextWindow: 64000;
|
|
365
|
-
readonly maxOutputTokens: 16000;
|
|
366
|
-
readonly supportsThinking: true;
|
|
367
|
-
readonly supportsVision: true;
|
|
368
|
-
readonly defaultTemperature: 0.7;
|
|
369
|
-
readonly temperatureRange: {
|
|
370
|
-
readonly min: 0.6;
|
|
371
|
-
readonly max: 1;
|
|
372
|
-
};
|
|
373
|
-
readonly tokenEfficiency: 1.2;
|
|
374
|
-
} | {
|
|
375
|
-
readonly contextWindow: 128000;
|
|
376
|
-
readonly maxOutputTokens: 128000;
|
|
377
|
-
readonly supportsThinking: true;
|
|
378
|
-
readonly supportsVision: true;
|
|
379
|
-
readonly defaultTemperature: 0.7;
|
|
380
|
-
readonly temperatureRange: {
|
|
381
|
-
readonly min: 0.6;
|
|
382
|
-
readonly max: 1;
|
|
383
|
-
};
|
|
384
|
-
readonly tokenEfficiency: 1.3;
|
|
385
|
-
};
|
|
386
|
-
/**
|
|
387
|
-
* Validate temperature for a given model
|
|
388
|
-
*
|
|
389
|
-
* @throws Error if temperature is out of valid range
|
|
390
|
-
*/
|
|
391
|
-
export declare function validateTemperature(temperature: number, model: string): void;
|
|
392
|
-
/**
|
|
393
|
-
* Validate max tokens for a given model
|
|
394
|
-
*
|
|
395
|
-
* @throws Error if maxTokens exceeds model limit
|
|
396
|
-
*/
|
|
397
|
-
export declare function validateMaxTokens(maxTokens: number, model: string): void;
|
|
398
|
-
/**
|
|
399
|
-
* Validate thinking configuration for a given model
|
|
400
|
-
* Supports both GLM models (glm-4.6) and Grok 3 models
|
|
401
|
-
*
|
|
402
|
-
* @throws Error if thinking is not supported by the model
|
|
403
|
-
*/
|
|
404
|
-
export declare function validateThinking(thinking: ThinkingConfig | undefined, model: string): void;
|
|
405
|
-
/**
|
|
406
|
-
* Create default chat options with sensible defaults
|
|
407
|
-
*/
|
|
408
|
-
export declare function createDefaultChatOptions(model?: string): Required<Omit<ChatOptions, 'thinking' | 'searchOptions' | 'tools' | 'responseFormat' | 'sampling' | 'signal'>>;
|
|
409
|
-
/**
|
|
410
|
-
* Validate sampling configuration
|
|
411
|
-
*
|
|
412
|
-
* @throws Error if sampling parameters are invalid or conflicting
|
|
413
|
-
*/
|
|
414
|
-
export declare function validateSampling(sampling: SamplingConfig | undefined, temperature?: number): void;
|
|
415
|
-
/**
|
|
416
|
-
* Create sampling config for deterministic/reproducible mode
|
|
417
|
-
*
|
|
418
|
-
* @param seed Optional seed for reproducibility
|
|
419
|
-
* @returns SamplingConfig configured for deterministic output
|
|
420
|
-
*/
|
|
421
|
-
export declare function createDeterministicSampling(seed?: number): SamplingConfig;
|
|
422
|
-
/**
|
|
423
|
-
* Create sampling config for creative/diverse output
|
|
424
|
-
*
|
|
425
|
-
* @param topP Optional nucleus sampling parameter (default: 0.9)
|
|
426
|
-
* @returns SamplingConfig configured for diverse output
|
|
427
|
-
*/
|
|
428
|
-
export declare function createCreativeSampling(topP?: number): SamplingConfig;
|
package/dist/llm/types.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GLM-4.6 API Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* This file contains comprehensive type definitions for GLM-4.6 API features,
|
|
5
|
-
* including advanced reasoning mode, configurable parameters, and enhanced
|
|
6
|
-
* response structures.
|
|
7
|
-
*
|
|
8
|
-
* @see https://docs.z.ai/guides/llm/glm-4.6
|
|
9
|
-
*/
|
|
10
|
-
import { DEFAULT_MODEL } from "../constants.js";
|
|
11
|
-
/**
|
|
12
|
-
* Type guard to check if a response is a GLM-4.6 response
|
|
13
|
-
*/
|
|
14
|
-
export function isGLM46Response(response) {
|
|
15
|
-
if (typeof response !== 'object' || response === null) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
const candidate = response;
|
|
19
|
-
return 'choices' in response && Array.isArray(candidate.choices);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Type guard to check if a chunk has reasoning content
|
|
23
|
-
*/
|
|
24
|
-
export function hasReasoningContent(chunk) {
|
|
25
|
-
return (chunk.choices.length > 0 &&
|
|
26
|
-
typeof chunk.choices[0]?.delta?.reasoning_content === 'string' &&
|
|
27
|
-
chunk.choices[0].delta.reasoning_content.length > 0);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* GLM-4.6 model configurations
|
|
31
|
-
*
|
|
32
|
-
* Defines capabilities and limits for supported models
|
|
33
|
-
*/
|
|
34
|
-
export const GLM_MODELS = {
|
|
35
|
-
"glm-4.6": {
|
|
36
|
-
contextWindow: 200000, // 200K tokens
|
|
37
|
-
maxOutputTokens: 128000, // 128K max output
|
|
38
|
-
supportsThinking: true,
|
|
39
|
-
supportsVision: false,
|
|
40
|
-
defaultTemperature: 0.7,
|
|
41
|
-
temperatureRange: { min: 0.6, max: 1.0 },
|
|
42
|
-
tokenEfficiency: 1.3, // 30% more efficient
|
|
43
|
-
},
|
|
44
|
-
// Note: glm-4.5v is deprecated, use glm-4.6v instead
|
|
45
|
-
"glm-4.5v": {
|
|
46
|
-
contextWindow: 64000, // 64K multimodal context
|
|
47
|
-
maxOutputTokens: 16000, // 16K max output
|
|
48
|
-
supportsThinking: true,
|
|
49
|
-
supportsVision: true, // Vision capabilities
|
|
50
|
-
defaultTemperature: 0.7,
|
|
51
|
-
temperatureRange: { min: 0.6, max: 1.0 },
|
|
52
|
-
tokenEfficiency: 1.2,
|
|
53
|
-
},
|
|
54
|
-
"glm-4.6v": {
|
|
55
|
-
contextWindow: 128000, // 128K multimodal context (upgraded from 64K)
|
|
56
|
-
maxOutputTokens: 128000, // 128K max output
|
|
57
|
-
supportsThinking: true,
|
|
58
|
-
supportsVision: true, // Native multimodal function calling
|
|
59
|
-
defaultTemperature: 0.7,
|
|
60
|
-
temperatureRange: { min: 0.6, max: 1.0 },
|
|
61
|
-
tokenEfficiency: 1.3,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Get model configuration by name
|
|
66
|
-
*/
|
|
67
|
-
export function getModelConfig(model) {
|
|
68
|
-
// Use the configured default model as fallback, not hardcoded "glm-4.6"
|
|
69
|
-
return GLM_MODELS[model] || GLM_MODELS[DEFAULT_MODEL];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Validate temperature for a given model
|
|
73
|
-
*
|
|
74
|
-
* @throws Error if temperature is out of valid range
|
|
75
|
-
*/
|
|
76
|
-
export function validateTemperature(temperature, model) {
|
|
77
|
-
const config = getModelConfig(model);
|
|
78
|
-
const { min, max } = config.temperatureRange;
|
|
79
|
-
if (temperature < min || temperature > max) {
|
|
80
|
-
throw new Error(`Temperature ${temperature} is out of range for model ${model}. ` +
|
|
81
|
-
`Valid range: ${min} - ${max}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Validate max tokens for a given model
|
|
86
|
-
*
|
|
87
|
-
* @throws Error if maxTokens exceeds model limit
|
|
88
|
-
*/
|
|
89
|
-
export function validateMaxTokens(maxTokens, model) {
|
|
90
|
-
const config = getModelConfig(model);
|
|
91
|
-
if (maxTokens > config.maxOutputTokens) {
|
|
92
|
-
throw new Error(`Max tokens ${maxTokens} exceeds model limit for ${model}. ` +
|
|
93
|
-
`Maximum: ${config.maxOutputTokens}`);
|
|
94
|
-
}
|
|
95
|
-
if (maxTokens < 1) {
|
|
96
|
-
throw new Error(`Max tokens must be at least 1, got ${maxTokens}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Validate thinking configuration for a given model
|
|
101
|
-
* Supports both GLM models (glm-4.6) and Grok 3 models
|
|
102
|
-
*
|
|
103
|
-
* @throws Error if thinking is not supported by the model
|
|
104
|
-
*/
|
|
105
|
-
export function validateThinking(thinking, model) {
|
|
106
|
-
if (thinking && thinking.type === "enabled") {
|
|
107
|
-
const modelLower = model.toLowerCase();
|
|
108
|
-
// Grok 4 models support thinking via reasoning_effort
|
|
109
|
-
if (modelLower.includes("grok-4")) {
|
|
110
|
-
return; // Valid for Grok 4
|
|
111
|
-
}
|
|
112
|
-
// Check GLM model configuration
|
|
113
|
-
const config = getModelConfig(model);
|
|
114
|
-
if (!config.supportsThinking) {
|
|
115
|
-
throw new Error(`Thinking mode is not supported by model ${model}. ` +
|
|
116
|
-
`Use glm-4.6 for thinking capabilities, or grok-4 for Grok models.`);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Create default chat options with sensible defaults
|
|
122
|
-
*/
|
|
123
|
-
export function createDefaultChatOptions(model) {
|
|
124
|
-
// Use the configured default model as fallback, not hardcoded "glm-4.6"
|
|
125
|
-
const modelName = model || DEFAULT_MODEL;
|
|
126
|
-
const config = getModelConfig(modelName);
|
|
127
|
-
return {
|
|
128
|
-
model: modelName,
|
|
129
|
-
temperature: config.defaultTemperature,
|
|
130
|
-
maxTokens: Math.min(8192, config.maxOutputTokens), // Conservative default
|
|
131
|
-
stream: false,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Validate sampling configuration
|
|
136
|
-
*
|
|
137
|
-
* @throws Error if sampling parameters are invalid or conflicting
|
|
138
|
-
*/
|
|
139
|
-
export function validateSampling(sampling, temperature) {
|
|
140
|
-
if (!sampling)
|
|
141
|
-
return;
|
|
142
|
-
// Validate top_p range
|
|
143
|
-
if (sampling.topP !== undefined) {
|
|
144
|
-
if (sampling.topP < 0 || sampling.topP > 1) {
|
|
145
|
-
throw new Error(`top_p ${sampling.topP} is out of range. Valid range: 0.0 - 1.0`);
|
|
146
|
-
}
|
|
147
|
-
// Warn about using both temperature and top_p (not recommended)
|
|
148
|
-
if (temperature !== undefined && temperature !== 1.0) {
|
|
149
|
-
console.warn("Warning: Using both temperature and top_p simultaneously is not recommended. " +
|
|
150
|
-
"Consider using only one for controlling diversity.");
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
// Validate seed is a positive integer
|
|
154
|
-
if (sampling.seed !== undefined) {
|
|
155
|
-
if (!Number.isInteger(sampling.seed) || sampling.seed < 0) {
|
|
156
|
-
throw new Error(`seed must be a non-negative integer, got ${sampling.seed}`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// Log info about deterministic mode
|
|
160
|
-
if (sampling.doSample === false) {
|
|
161
|
-
if (sampling.seed !== undefined) {
|
|
162
|
-
// Fully deterministic mode enabled
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
console.warn("Note: doSample=false without a seed will produce deterministic output, " +
|
|
166
|
-
"but results may vary between API calls. Add a seed for full reproducibility.");
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Create sampling config for deterministic/reproducible mode
|
|
172
|
-
*
|
|
173
|
-
* @param seed Optional seed for reproducibility
|
|
174
|
-
* @returns SamplingConfig configured for deterministic output
|
|
175
|
-
*/
|
|
176
|
-
export function createDeterministicSampling(seed) {
|
|
177
|
-
return {
|
|
178
|
-
doSample: false,
|
|
179
|
-
seed: seed ?? Math.floor(Math.random() * 2147483647), // Generate random seed if not provided
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Create sampling config for creative/diverse output
|
|
184
|
-
*
|
|
185
|
-
* @param topP Optional nucleus sampling parameter (default: 0.9)
|
|
186
|
-
* @returns SamplingConfig configured for diverse output
|
|
187
|
-
*/
|
|
188
|
-
export function createCreativeSampling(topP = 0.9) {
|
|
189
|
-
return {
|
|
190
|
-
doSample: true,
|
|
191
|
-
topP,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=types.js.map
|
package/dist/llm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/llm/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AutomatosX MCP Auto-Discovery
|
|
3
|
-
*
|
|
4
|
-
* Automatically detects and enables AutomatosX MCP server when installed.
|
|
5
|
-
* This provides seamless integration between ax-glm/ax-grok and AutomatosX.
|
|
6
|
-
*
|
|
7
|
-
* Design:
|
|
8
|
-
* 1. Check if `automatosx` command exists in PATH
|
|
9
|
-
* 2. If installed, automatically inject AutomatosX MCP server config
|
|
10
|
-
* 3. User can override via .mcp.json or disable via settings
|
|
11
|
-
*
|
|
12
|
-
* This ensures that when users have both ax-glm/ax-grok and AutomatosX installed,
|
|
13
|
-
* they get automatic integration without manual configuration.
|
|
14
|
-
*/
|
|
15
|
-
import type { MCPServerConfig } from '../schemas/settings-schemas.js';
|
|
16
|
-
/**
|
|
17
|
-
* Result of AutomatosX detection
|
|
18
|
-
*/
|
|
19
|
-
export interface AutomatosXDetectionResult {
|
|
20
|
-
/** Whether AutomatosX is installed and available */
|
|
21
|
-
installed: boolean;
|
|
22
|
-
/** Path to the automatosx command (if found) */
|
|
23
|
-
commandPath?: string;
|
|
24
|
-
/** Version of AutomatosX (if detected) */
|
|
25
|
-
version?: string;
|
|
26
|
-
/** Whether MCP server capability is available */
|
|
27
|
-
hasMCPServer: boolean;
|
|
28
|
-
/** Error message if detection failed */
|
|
29
|
-
error?: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Options for auto-discovery
|
|
33
|
-
*/
|
|
34
|
-
export interface AutoDiscoveryOptions {
|
|
35
|
-
/** Skip auto-discovery entirely */
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
/** Custom command path for automatosx */
|
|
38
|
-
customCommandPath?: string;
|
|
39
|
-
/** Custom environment variables for the MCP server */
|
|
40
|
-
env?: Record<string, string>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Detect if AutomatosX is installed and available
|
|
44
|
-
*/
|
|
45
|
-
export declare function detectAutomatosX(forceRefresh?: boolean): AutomatosXDetectionResult;
|
|
46
|
-
/**
|
|
47
|
-
* Generate AutomatosX MCP server config for auto-discovery
|
|
48
|
-
*/
|
|
49
|
-
export declare function generateAutoDiscoveryConfig(options?: AutoDiscoveryOptions): MCPServerConfig | null;
|
|
50
|
-
/**
|
|
51
|
-
* Get auto-discovered MCP servers
|
|
52
|
-
*
|
|
53
|
-
* Returns AutomatosX MCP server config if:
|
|
54
|
-
* 1. AutomatosX is installed
|
|
55
|
-
* 2. It has MCP server capability
|
|
56
|
-
* 3. Auto-discovery is not disabled
|
|
57
|
-
*/
|
|
58
|
-
export declare function getAutoDiscoveredServers(options?: AutoDiscoveryOptions): MCPServerConfig[];
|
|
59
|
-
/**
|
|
60
|
-
* Check if a server name is an auto-discovered AutomatosX server
|
|
61
|
-
*/
|
|
62
|
-
export declare function isAutoDiscoveredServer(serverName: string): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Clear the detection cache
|
|
65
|
-
*/
|
|
66
|
-
export declare function clearDetectionCache(): void;
|