opc-agent 4.1.2 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/channels/dingtalk.d.ts.map +1 -0
- package/dist/channels/dingtalk.js.map +1 -0
- package/dist/channels/discord.d.ts.map +1 -0
- package/dist/channels/discord.js.map +1 -0
- package/dist/channels/email.d.ts.map +1 -0
- package/dist/channels/email.js.map +1 -0
- package/dist/channels/feishu.d.ts.map +1 -0
- package/dist/channels/feishu.js.map +1 -0
- package/dist/channels/googlechat.d.ts.map +1 -0
- package/dist/channels/googlechat.js.map +1 -0
- package/dist/channels/imessage.d.ts.map +1 -0
- package/dist/channels/imessage.js.map +1 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/irc.d.ts.map +1 -0
- package/dist/channels/irc.js.map +1 -0
- package/dist/channels/line.d.ts.map +1 -0
- package/dist/channels/line.js.map +1 -0
- package/dist/channels/matrix.d.ts.map +1 -0
- package/dist/channels/matrix.js.map +1 -0
- package/dist/channels/mattermost.d.ts.map +1 -0
- package/dist/channels/mattermost.js.map +1 -0
- package/dist/channels/msteams.d.ts.map +1 -0
- package/dist/channels/msteams.js.map +1 -0
- package/dist/channels/nostr.d.ts.map +1 -0
- package/dist/channels/nostr.js.map +1 -0
- package/dist/channels/qq.d.ts.map +1 -0
- package/dist/channels/qq.js.map +1 -0
- package/dist/channels/signal.d.ts.map +1 -0
- package/dist/channels/signal.js.map +1 -0
- package/dist/channels/slack.d.ts.map +1 -0
- package/dist/channels/slack.js.map +1 -0
- package/dist/channels/sms.d.ts.map +1 -0
- package/dist/channels/sms.js.map +1 -0
- package/dist/channels/telegram.d.ts.map +1 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/twitch.d.ts.map +1 -0
- package/dist/channels/twitch.js.map +1 -0
- package/dist/channels/voice-call.d.ts.map +1 -0
- package/dist/channels/voice-call.js.map +1 -0
- package/dist/channels/voice.d.ts.map +1 -0
- package/dist/channels/voice.js.map +1 -0
- package/dist/channels/web.d.ts.map +1 -0
- package/dist/channels/web.js.map +1 -0
- package/dist/channels/webhook.d.ts.map +1 -0
- package/dist/channels/webhook.js.map +1 -0
- package/dist/channels/websocket.d.ts.map +1 -0
- package/dist/channels/websocket.js.map +1 -0
- package/dist/channels/wechat.d.ts.map +1 -0
- package/dist/channels/wechat.js.map +1 -0
- package/dist/channels/whatsapp.d.ts.map +1 -0
- package/dist/channels/whatsapp.js.map +1 -0
- package/dist/cli/chat.d.ts.map +1 -0
- package/dist/cli/chat.js.map +1 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +108 -11
- package/dist/cli.js.map +1 -0
- package/dist/core/a2a.d.ts.map +1 -0
- package/dist/core/a2a.js.map +1 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/analytics-engine.d.ts.map +1 -0
- package/dist/core/analytics-engine.js.map +1 -0
- package/dist/core/api-server.d.ts.map +1 -0
- package/dist/core/api-server.js.map +1 -0
- package/dist/core/audio.d.ts.map +1 -0
- package/dist/core/audio.js.map +1 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/collaboration.d.ts.map +1 -0
- package/dist/core/collaboration.js.map +1 -0
- package/dist/core/compose.d.ts.map +1 -0
- package/dist/core/compose.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/context-discovery.d.ts.map +1 -0
- package/dist/core/context-discovery.js.map +1 -0
- package/dist/core/context-refs.d.ts.map +1 -0
- package/dist/core/context-refs.js.map +1 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/gateway.d.ts.map +1 -0
- package/dist/core/gateway.js.map +1 -0
- package/dist/core/heartbeat.d.ts.map +1 -0
- package/dist/core/heartbeat.js.map +1 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js.map +1 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/ide-bridge.d.ts.map +1 -0
- package/dist/core/ide-bridge.js.map +1 -0
- package/dist/core/knowledge.d.ts.map +1 -0
- package/dist/core/knowledge.js.map +1 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/model-recommender.d.ts +40 -0
- package/dist/core/model-recommender.d.ts.map +1 -0
- package/dist/core/model-recommender.js +186 -0
- package/dist/core/model-recommender.js.map +1 -0
- package/dist/core/node-network.d.ts.map +1 -0
- package/dist/core/node-network.js.map +1 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/performance.d.ts.map +1 -0
- package/dist/core/performance.js.map +1 -0
- package/dist/core/profiles.d.ts.map +1 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/rate-limiter.d.ts.map +1 -0
- package/dist/core/rate-limiter.js.map +1 -0
- package/dist/core/room.d.ts.map +1 -0
- package/dist/core/room.js.map +1 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/sandbox.d.ts.map +1 -0
- package/dist/core/sandbox.js.map +1 -0
- package/dist/core/scheduler.d.ts.map +1 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/streaming.d.ts.map +1 -0
- package/dist/core/streaming.js.map +1 -0
- package/dist/core/subagent.d.ts.map +1 -0
- package/dist/core/subagent.js.map +1 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/versioning.d.ts.map +1 -0
- package/dist/core/versioning.js.map +1 -0
- package/dist/core/vision.d.ts.map +1 -0
- package/dist/core/vision.js.map +1 -0
- package/dist/core/watch.d.ts.map +1 -0
- package/dist/core/watch.js.map +1 -0
- package/dist/core/workflow-graph.d.ts.map +1 -0
- package/dist/core/workflow-graph.js.map +1 -0
- package/dist/core/workflow.d.ts.map +1 -0
- package/dist/core/workflow.js.map +1 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js.map +1 -0
- package/dist/deploy/hermes.d.ts.map +1 -0
- package/dist/deploy/hermes.js.map +1 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/openclaw.d.ts.map +1 -0
- package/dist/deploy/openclaw.js.map +1 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js.map +1 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/hub/brain-seed.d.ts.map +1 -0
- package/dist/hub/brain-seed.js.map +1 -0
- package/dist/hub/client.d.ts.map +1 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -0
- package/dist/mcp/servers/calculator-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/calculator-mcp.js.map +1 -0
- package/dist/mcp/servers/crypto-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/crypto-mcp.js.map +1 -0
- package/dist/mcp/servers/database-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/database-mcp.js.map +1 -0
- package/dist/mcp/servers/datetime-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/datetime-mcp.js.map +1 -0
- package/dist/mcp/servers/filesystem.d.ts.map +1 -0
- package/dist/mcp/servers/filesystem.js.map +1 -0
- package/dist/mcp/servers/github-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/github-mcp.js.map +1 -0
- package/dist/mcp/servers/index.d.ts.map +1 -0
- package/dist/mcp/servers/index.js.map +1 -0
- package/dist/mcp/servers/json-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/json-mcp.js.map +1 -0
- package/dist/mcp/servers/memory-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/memory-mcp.js.map +1 -0
- package/dist/mcp/servers/regex-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/regex-mcp.js.map +1 -0
- package/dist/mcp/servers/web-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/web-mcp.js.map +1 -0
- package/dist/memory/context-compressor.d.ts.map +1 -0
- package/dist/memory/context-compressor.js.map +1 -0
- package/dist/memory/deepbrain.d.ts.map +1 -0
- package/dist/memory/deepbrain.js.map +1 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/seed-loader.d.ts.map +1 -0
- package/dist/memory/seed-loader.js.map +1 -0
- package/dist/memory/user-profiler.d.ts.map +1 -0
- package/dist/memory/user-profiler.js.map +1 -0
- package/dist/plugins/content-filter.d.ts.map +1 -0
- package/dist/plugins/content-filter.js.map +1 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/logger.d.ts.map +1 -0
- package/dist/plugins/logger.js.map +1 -0
- package/dist/plugins/rate-limiter.d.ts.map +1 -0
- package/dist/plugins/rate-limiter.js.map +1 -0
- package/dist/protocols/a2a/client.d.ts.map +1 -0
- package/dist/protocols/a2a/client.js.map +1 -0
- package/dist/protocols/a2a/index.d.ts.map +1 -0
- package/dist/protocols/a2a/index.js.map +1 -0
- package/dist/protocols/a2a/server.d.ts.map +1 -0
- package/dist/protocols/a2a/server.js.map +1 -0
- package/dist/protocols/a2a/types.d.ts.map +1 -0
- package/dist/protocols/a2a/types.js.map +1 -0
- package/dist/protocols/a2a/utils.d.ts.map +1 -0
- package/dist/protocols/a2a/utils.js.map +1 -0
- package/dist/protocols/agui/client.d.ts.map +1 -0
- package/dist/protocols/agui/client.js.map +1 -0
- package/dist/protocols/agui/index.d.ts.map +1 -0
- package/dist/protocols/agui/index.js.map +1 -0
- package/dist/protocols/agui/server.d.ts.map +1 -0
- package/dist/protocols/agui/server.js.map +1 -0
- package/dist/protocols/agui/types.d.ts.map +1 -0
- package/dist/protocols/agui/types.js.map +1 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/mcp/agent-tools.d.ts.map +1 -0
- package/dist/protocols/mcp/agent-tools.js.map +1 -0
- package/dist/protocols/mcp/index.d.ts.map +1 -0
- package/dist/protocols/mcp/index.js.map +1 -0
- package/dist/protocols/mcp/server.d.ts.map +1 -0
- package/dist/protocols/mcp/server.js.map +1 -0
- package/dist/protocols/mcp/types.d.ts.map +1 -0
- package/dist/protocols/mcp/types.js.map +1 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/publish/index.d.ts.map +1 -0
- package/dist/publish/index.js.map +1 -0
- package/dist/scheduler/cron-engine.d.ts.map +1 -0
- package/dist/scheduler/cron-engine.js.map +1 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/schema/oad.d.ts.map +1 -0
- package/dist/schema/oad.js.map +1 -0
- package/dist/security/approval.d.ts.map +1 -0
- package/dist/security/approval.js.map +1 -0
- package/dist/security/approvals.d.ts.map +1 -0
- package/dist/security/approvals.js.map +1 -0
- package/dist/security/elevated.d.ts.map +1 -0
- package/dist/security/elevated.js.map +1 -0
- package/dist/security/guardrails.d.ts.map +1 -0
- package/dist/security/guardrails.js.map +1 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/keys.d.ts.map +1 -0
- package/dist/security/keys.js.map +1 -0
- package/dist/security/secrets.d.ts.map +1 -0
- package/dist/security/secrets.js.map +1 -0
- package/dist/skills/auto-learn.d.ts.map +1 -0
- package/dist/skills/auto-learn.js.map +1 -0
- package/dist/skills/base.d.ts.map +1 -0
- package/dist/skills/base.js.map +1 -0
- package/dist/skills/builtin/index.d.ts.map +1 -0
- package/dist/skills/builtin/index.js.map +1 -0
- package/dist/skills/document.d.ts.map +1 -0
- package/dist/skills/document.js.map +1 -0
- package/dist/skills/http.d.ts.map +1 -0
- package/dist/skills/http.js.map +1 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/marketplace.d.ts.map +1 -0
- package/dist/skills/marketplace.js.map +1 -0
- package/dist/skills/scheduler.d.ts.map +1 -0
- package/dist/skills/scheduler.js.map +1 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/skills/webhook-trigger.d.ts.map +1 -0
- package/dist/skills/webhook-trigger.js.map +1 -0
- package/dist/studio/server.d.ts.map +1 -0
- package/dist/studio/server.js.map +1 -0
- package/dist/studio/templates-data.d.ts.map +1 -0
- package/dist/studio/templates-data.js.map +1 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/templates/code-reviewer.d.ts.map +1 -0
- package/dist/templates/code-reviewer.js.map +1 -0
- package/dist/templates/content-writer.d.ts.map +1 -0
- package/dist/templates/content-writer.js.map +1 -0
- package/dist/templates/customer-service.d.ts.map +1 -0
- package/dist/templates/customer-service.js.map +1 -0
- package/dist/templates/data-analyst.d.ts.map +1 -0
- package/dist/templates/data-analyst.js.map +1 -0
- package/dist/templates/executive-assistant.d.ts.map +1 -0
- package/dist/templates/executive-assistant.js.map +1 -0
- package/dist/templates/financial-advisor.d.ts.map +1 -0
- package/dist/templates/financial-advisor.js.map +1 -0
- package/dist/templates/hr-recruiter.d.ts.map +1 -0
- package/dist/templates/hr-recruiter.js.map +1 -0
- package/dist/templates/knowledge-base.d.ts.map +1 -0
- package/dist/templates/knowledge-base.js.map +1 -0
- package/dist/templates/legal-assistant.d.ts.map +1 -0
- package/dist/templates/legal-assistant.js.map +1 -0
- package/dist/templates/project-manager.d.ts.map +1 -0
- package/dist/templates/project-manager.js.map +1 -0
- package/dist/templates/sales-assistant.d.ts.map +1 -0
- package/dist/templates/sales-assistant.js.map +1 -0
- package/dist/templates/teacher.d.ts.map +1 -0
- package/dist/templates/teacher.js.map +1 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tools/builtin/browser.d.ts.map +1 -0
- package/dist/tools/builtin/browser.js.map +1 -0
- package/dist/tools/builtin/datetime.d.ts.map +1 -0
- package/dist/tools/builtin/datetime.js.map +1 -0
- package/dist/tools/builtin/file.d.ts.map +1 -0
- package/dist/tools/builtin/file.js.map +1 -0
- package/dist/tools/builtin/home-assistant.d.ts.map +1 -0
- package/dist/tools/builtin/home-assistant.js.map +1 -0
- package/dist/tools/builtin/index.d.ts.map +1 -0
- package/dist/tools/builtin/index.js.map +1 -0
- package/dist/tools/builtin/rl-tools.d.ts.map +1 -0
- package/dist/tools/builtin/rl-tools.js.map +1 -0
- package/dist/tools/builtin/shell.d.ts.map +1 -0
- package/dist/tools/builtin/shell.js.map +1 -0
- package/dist/tools/builtin/vision.d.ts.map +1 -0
- package/dist/tools/builtin/vision.js.map +1 -0
- package/dist/tools/builtin/web-search.d.ts.map +1 -0
- package/dist/tools/builtin/web-search.js.map +1 -0
- package/dist/tools/builtin/web.d.ts.map +1 -0
- package/dist/tools/builtin/web.js.map +1 -0
- package/dist/tools/calculator.d.ts.map +1 -0
- package/dist/tools/calculator.js.map +1 -0
- package/dist/tools/datetime.d.ts.map +1 -0
- package/dist/tools/datetime.js.map +1 -0
- package/dist/tools/document-processor.d.ts.map +1 -0
- package/dist/tools/document-processor.js.map +1 -0
- package/dist/tools/gateway.d.ts.map +1 -0
- package/dist/tools/gateway.js.map +1 -0
- package/dist/tools/image-generator.d.ts.map +1 -0
- package/dist/tools/image-generator.js.map +1 -0
- package/dist/tools/integrations/calendar.d.ts.map +1 -0
- package/dist/tools/integrations/calendar.js.map +1 -0
- package/dist/tools/integrations/code-exec.d.ts.map +1 -0
- package/dist/tools/integrations/code-exec.js.map +1 -0
- package/dist/tools/integrations/csv-analyzer.d.ts.map +1 -0
- package/dist/tools/integrations/csv-analyzer.js.map +1 -0
- package/dist/tools/integrations/database.d.ts.map +1 -0
- package/dist/tools/integrations/database.js.map +1 -0
- package/dist/tools/integrations/email-send.d.ts.map +1 -0
- package/dist/tools/integrations/email-send.js.map +1 -0
- package/dist/tools/integrations/git-tool.d.ts.map +1 -0
- package/dist/tools/integrations/git-tool.js.map +1 -0
- package/dist/tools/integrations/github-tool.d.ts.map +1 -0
- package/dist/tools/integrations/github-tool.js.map +1 -0
- package/dist/tools/integrations/image-gen.d.ts.map +1 -0
- package/dist/tools/integrations/image-gen.js.map +1 -0
- package/dist/tools/integrations/index.d.ts.map +1 -0
- package/dist/tools/integrations/index.js.map +1 -0
- package/dist/tools/integrations/jira.d.ts.map +1 -0
- package/dist/tools/integrations/jira.js.map +1 -0
- package/dist/tools/integrations/notion.d.ts.map +1 -0
- package/dist/tools/integrations/notion.js.map +1 -0
- package/dist/tools/integrations/npm-tool.d.ts.map +1 -0
- package/dist/tools/integrations/npm-tool.js.map +1 -0
- package/dist/tools/integrations/pdf-reader.d.ts.map +1 -0
- package/dist/tools/integrations/pdf-reader.js.map +1 -0
- package/dist/tools/integrations/slack.d.ts.map +1 -0
- package/dist/tools/integrations/slack.js.map +1 -0
- package/dist/tools/integrations/summarizer.d.ts.map +1 -0
- package/dist/tools/integrations/summarizer.js.map +1 -0
- package/dist/tools/integrations/translator.d.ts.map +1 -0
- package/dist/tools/integrations/translator.js.map +1 -0
- package/dist/tools/integrations/trello.d.ts.map +1 -0
- package/dist/tools/integrations/trello.js.map +1 -0
- package/dist/tools/integrations/vector-search.d.ts.map +1 -0
- package/dist/tools/integrations/vector-search.js.map +1 -0
- package/dist/tools/integrations/web-scraper.d.ts.map +1 -0
- package/dist/tools/integrations/web-scraper.js.map +1 -0
- package/dist/tools/integrations/web-search.d.ts.map +1 -0
- package/dist/tools/integrations/web-search.js.map +1 -0
- package/dist/tools/integrations/webhook.d.ts.map +1 -0
- package/dist/tools/integrations/webhook.js.map +1 -0
- package/dist/tools/json-transform.d.ts.map +1 -0
- package/dist/tools/json-transform.js.map +1 -0
- package/dist/tools/mcp-client.d.ts.map +1 -0
- package/dist/tools/mcp-client.js.map +1 -0
- package/dist/tools/mcp.d.ts.map +1 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/text-analysis.d.ts.map +1 -0
- package/dist/tools/text-analysis.js.map +1 -0
- package/dist/tools/web-scraper.d.ts.map +1 -0
- package/dist/tools/web-scraper.js.map +1 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/traces/index.d.ts.map +1 -0
- package/dist/traces/index.js.map +1 -0
- package/dist/ui/components.d.ts.map +1 -0
- package/dist/ui/components.js.map +1 -0
- package/models.json +164 -0
- package/package.json +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -20
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -14
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -13
- package/.github/workflows/ci.yml +0 -24
- package/USABILITY-ISSUES.md +0 -73
- package/docs/.vitepress/config.ts +0 -103
- package/docs/api/cli.md +0 -48
- package/docs/api/oad-schema.md +0 -64
- package/docs/api/sdk.md +0 -80
- package/docs/guide/concepts.md +0 -51
- package/docs/guide/configuration.md +0 -79
- package/docs/guide/deployment.md +0 -42
- package/docs/guide/getting-started.md +0 -44
- package/docs/guide/templates.md +0 -28
- package/docs/guide/testing.md +0 -84
- package/docs/index.md +0 -27
- package/docs/zh/api/cli.md +0 -54
- package/docs/zh/api/oad-schema.md +0 -87
- package/docs/zh/api/sdk.md +0 -102
- package/docs/zh/guide/concepts.md +0 -104
- package/docs/zh/guide/configuration.md +0 -135
- package/docs/zh/guide/deployment.md +0 -81
- package/docs/zh/guide/getting-started.md +0 -82
- package/docs/zh/guide/templates.md +0 -84
- package/docs/zh/guide/testing.md +0 -88
- package/docs/zh/index.md +0 -27
- package/fix-sidebar.mjs +0 -188
- package/serve-studio.js +0 -13
- package/serve-test.js +0 -25
- package/src/analytics/index.ts +0 -66
- package/src/channels/dingtalk.ts +0 -46
- package/src/channels/discord.ts +0 -192
- package/src/channels/email.ts +0 -351
- package/src/channels/feishu.ts +0 -349
- package/src/channels/googlechat.ts +0 -42
- package/src/channels/imessage.ts +0 -32
- package/src/channels/index.ts +0 -15
- package/src/channels/irc.ts +0 -82
- package/src/channels/line.ts +0 -33
- package/src/channels/matrix.ts +0 -34
- package/src/channels/mattermost.ts +0 -57
- package/src/channels/msteams.ts +0 -33
- package/src/channels/nostr.ts +0 -33
- package/src/channels/qq.ts +0 -34
- package/src/channels/signal.ts +0 -33
- package/src/channels/slack.ts +0 -217
- package/src/channels/sms.ts +0 -34
- package/src/channels/telegram.ts +0 -616
- package/src/channels/twitch.ts +0 -65
- package/src/channels/voice-call.ts +0 -100
- package/src/channels/voice.ts +0 -471
- package/src/channels/web.ts +0 -638
- package/src/channels/webhook.ts +0 -199
- package/src/channels/websocket.ts +0 -399
- package/src/channels/wechat.ts +0 -329
- package/src/channels/whatsapp.ts +0 -33
- package/src/cli/chat.ts +0 -99
- package/src/cli/setup.ts +0 -314
- package/src/cli.ts +0 -2826
- package/src/core/a2a.ts +0 -203
- package/src/core/agent.ts +0 -476
- package/src/core/analytics-engine.ts +0 -186
- package/src/core/api-server.ts +0 -277
- package/src/core/audio.ts +0 -98
- package/src/core/auth.ts +0 -57
- package/src/core/cache.ts +0 -141
- package/src/core/collaboration.ts +0 -275
- package/src/core/compose.ts +0 -77
- package/src/core/config.ts +0 -14
- package/src/core/context-discovery.ts +0 -85
- package/src/core/context-refs.ts +0 -140
- package/src/core/errors.ts +0 -148
- package/src/core/gateway.ts +0 -106
- package/src/core/heartbeat.ts +0 -51
- package/src/core/hitl.ts +0 -138
- package/src/core/hooks.ts +0 -105
- package/src/core/ide-bridge.ts +0 -133
- package/src/core/knowledge.ts +0 -255
- package/src/core/logger.ts +0 -57
- package/src/core/node-network.ts +0 -86
- package/src/core/orchestrator.ts +0 -215
- package/src/core/performance.ts +0 -187
- package/src/core/profiles.ts +0 -122
- package/src/core/rate-limiter.ts +0 -128
- package/src/core/room.ts +0 -109
- package/src/core/runtime.ts +0 -435
- package/src/core/sandbox.ts +0 -344
- package/src/core/scheduler.ts +0 -187
- package/src/core/security.ts +0 -171
- package/src/core/session-manager.ts +0 -137
- package/src/core/streaming.ts +0 -195
- package/src/core/subagent.ts +0 -98
- package/src/core/types.ts +0 -68
- package/src/core/versioning.ts +0 -106
- package/src/core/vision.ts +0 -180
- package/src/core/watch.ts +0 -178
- package/src/core/workflow-graph.ts +0 -365
- package/src/core/workflow.ts +0 -235
- package/src/daemon.ts +0 -96
- package/src/deploy/hermes.ts +0 -156
- package/src/deploy/index.ts +0 -255
- package/src/deploy/openclaw.ts +0 -190
- package/src/doctor.ts +0 -243
- package/src/eval/index.ts +0 -211
- package/src/eval/suites/basic.json +0 -16
- package/src/eval/suites/memory.json +0 -12
- package/src/eval/suites/safety.json +0 -14
- package/src/hub/brain-seed.ts +0 -54
- package/src/hub/client.ts +0 -60
- package/src/i18n/index.ts +0 -216
- package/src/index.ts +0 -283
- package/src/mcp/servers/calculator-mcp.ts +0 -65
- package/src/mcp/servers/crypto-mcp.ts +0 -73
- package/src/mcp/servers/database-mcp.ts +0 -72
- package/src/mcp/servers/datetime-mcp.ts +0 -69
- package/src/mcp/servers/filesystem.ts +0 -66
- package/src/mcp/servers/github-mcp.ts +0 -58
- package/src/mcp/servers/index.ts +0 -63
- package/src/mcp/servers/json-mcp.ts +0 -102
- package/src/mcp/servers/memory-mcp.ts +0 -56
- package/src/mcp/servers/regex-mcp.ts +0 -53
- package/src/mcp/servers/web-mcp.ts +0 -49
- package/src/memory/context-compressor.ts +0 -189
- package/src/memory/deepbrain.ts +0 -202
- package/src/memory/index.ts +0 -41
- package/src/memory/seed-loader.ts +0 -212
- package/src/memory/user-profiler.ts +0 -215
- package/src/plugins/content-filter.ts +0 -23
- package/src/plugins/index.ts +0 -339
- package/src/plugins/logger.ts +0 -18
- package/src/plugins/rate-limiter.ts +0 -38
- package/src/protocols/a2a/client.ts +0 -132
- package/src/protocols/a2a/index.ts +0 -8
- package/src/protocols/a2a/server.ts +0 -333
- package/src/protocols/a2a/types.ts +0 -88
- package/src/protocols/a2a/utils.ts +0 -50
- package/src/protocols/agui/client.ts +0 -83
- package/src/protocols/agui/index.ts +0 -4
- package/src/protocols/agui/server.ts +0 -218
- package/src/protocols/agui/types.ts +0 -153
- package/src/protocols/index.ts +0 -2
- package/src/protocols/mcp/agent-tools.ts +0 -134
- package/src/protocols/mcp/index.ts +0 -8
- package/src/protocols/mcp/server.ts +0 -262
- package/src/protocols/mcp/types.ts +0 -69
- package/src/providers/index.ts +0 -632
- package/src/publish/index.ts +0 -376
- package/src/scheduler/cron-engine.ts +0 -191
- package/src/scheduler/index.ts +0 -2
- package/src/schema/oad.ts +0 -217
- package/src/security/approval.ts +0 -131
- package/src/security/approvals.ts +0 -143
- package/src/security/elevated.ts +0 -105
- package/src/security/guardrails.ts +0 -248
- package/src/security/index.ts +0 -9
- package/src/security/keys.ts +0 -87
- package/src/security/secrets.ts +0 -129
- package/src/skills/auto-learn.ts +0 -262
- package/src/skills/base.ts +0 -16
- package/src/skills/builtin/index.ts +0 -408
- package/src/skills/document.ts +0 -100
- package/src/skills/http.ts +0 -35
- package/src/skills/index.ts +0 -27
- package/src/skills/marketplace.ts +0 -113
- package/src/skills/scheduler.ts +0 -80
- package/src/skills/types.ts +0 -42
- package/src/skills/webhook-trigger.ts +0 -59
- package/src/studio/server.ts +0 -1791
- package/src/studio/templates-data.ts +0 -178
- package/src/studio-ui/index.html +0 -3076
- package/src/telemetry/index.ts +0 -324
- package/src/templates/code-reviewer.ts +0 -30
- package/src/templates/content-writer.ts +0 -58
- package/src/templates/customer-service.ts +0 -76
- package/src/templates/data-analyst.ts +0 -66
- package/src/templates/executive-assistant.ts +0 -71
- package/src/templates/financial-advisor.ts +0 -60
- package/src/templates/hr-recruiter.ts +0 -58
- package/src/templates/knowledge-base.ts +0 -27
- package/src/templates/legal-assistant.ts +0 -71
- package/src/templates/project-manager.ts +0 -58
- package/src/templates/sales-assistant.ts +0 -75
- package/src/templates/teacher.ts +0 -75
- package/src/testing/index.ts +0 -181
- package/src/tools/builtin/browser.ts +0 -299
- package/src/tools/builtin/datetime.ts +0 -41
- package/src/tools/builtin/file.ts +0 -107
- package/src/tools/builtin/home-assistant.ts +0 -116
- package/src/tools/builtin/index.ts +0 -37
- package/src/tools/builtin/rl-tools.ts +0 -243
- package/src/tools/builtin/shell.ts +0 -43
- package/src/tools/builtin/vision.ts +0 -64
- package/src/tools/builtin/web-search.ts +0 -126
- package/src/tools/builtin/web.ts +0 -35
- package/src/tools/calculator.ts +0 -73
- package/src/tools/datetime.ts +0 -149
- package/src/tools/document-processor.ts +0 -213
- package/src/tools/gateway.ts +0 -220
- package/src/tools/image-generator.ts +0 -150
- package/src/tools/integrations/calendar.ts +0 -73
- package/src/tools/integrations/code-exec.ts +0 -39
- package/src/tools/integrations/csv-analyzer.ts +0 -92
- package/src/tools/integrations/database.ts +0 -44
- package/src/tools/integrations/email-send.ts +0 -76
- package/src/tools/integrations/git-tool.ts +0 -42
- package/src/tools/integrations/github-tool.ts +0 -76
- package/src/tools/integrations/image-gen.ts +0 -56
- package/src/tools/integrations/index.ts +0 -92
- package/src/tools/integrations/jira.ts +0 -83
- package/src/tools/integrations/notion.ts +0 -71
- package/src/tools/integrations/npm-tool.ts +0 -48
- package/src/tools/integrations/pdf-reader.ts +0 -58
- package/src/tools/integrations/slack.ts +0 -65
- package/src/tools/integrations/summarizer.ts +0 -49
- package/src/tools/integrations/translator.ts +0 -48
- package/src/tools/integrations/trello.ts +0 -60
- package/src/tools/integrations/vector-search.ts +0 -42
- package/src/tools/integrations/web-scraper.ts +0 -47
- package/src/tools/integrations/web-search.ts +0 -58
- package/src/tools/integrations/webhook.ts +0 -38
- package/src/tools/json-transform.ts +0 -187
- package/src/tools/mcp-client.ts +0 -131
- package/src/tools/mcp.ts +0 -76
- package/src/tools/text-analysis.ts +0 -116
- package/src/tools/web-scraper.ts +0 -179
- package/src/tools/web-search.ts +0 -180
- package/src/traces/index.ts +0 -132
- package/src/types/agent-workstation.d.ts +0 -2
- package/src/ui/components.ts +0 -127
- package/srv-err.txt +0 -0
- package/srv-out.txt +0 -1
- package/test-agent/Dockerfile +0 -9
- package/test-agent/README.md +0 -50
- package/test-agent/agent.yaml +0 -23
- package/test-agent/docker-compose.yml +0 -11
- package/test-agent/oad.yaml +0 -31
- package/test-agent/package-lock.json +0 -1492
- package/test-agent/package.json +0 -18
- package/test-agent/src/index.ts +0 -24
- package/test-agent/src/skills/echo.ts +0 -15
- package/test-agent/tsconfig.json +0 -25
- package/test-full.js +0 -43
- package/test-sidebar.js +0 -22
- package/test-studio3.js +0 -75
- package/test-studio4.js +0 -41
- package/tests/a2a-protocol.test.ts +0 -285
- package/tests/a2a.test.ts +0 -66
- package/tests/agent.test.ts +0 -72
- package/tests/agui-protocol.test.ts +0 -246
- package/tests/analytics.test.ts +0 -50
- package/tests/api-server.test.ts +0 -148
- package/tests/approvals.test.ts +0 -89
- package/tests/audio.test.ts +0 -40
- package/tests/auto-learn.test.ts +0 -105
- package/tests/brain-seed-extended.test.ts +0 -490
- package/tests/brain-seed.test.ts +0 -239
- package/tests/browser.test.ts +0 -179
- package/tests/builtin-tools.test.ts +0 -83
- package/tests/channel.test.ts +0 -39
- package/tests/channels/discord.test.ts +0 -79
- package/tests/channels/email.test.ts +0 -148
- package/tests/channels/feishu.test.ts +0 -123
- package/tests/channels/telegram.test.ts +0 -129
- package/tests/channels/websocket.test.ts +0 -53
- package/tests/channels/wechat.test.ts +0 -170
- package/tests/channels-extra.test.ts +0 -45
- package/tests/chat-cli.test.ts +0 -160
- package/tests/cli.test.ts +0 -46
- package/tests/collaboration.test.ts +0 -319
- package/tests/context-compressor.test.ts +0 -172
- package/tests/context-refs.test.ts +0 -121
- package/tests/cron-engine.test.ts +0 -101
- package/tests/daemon.test.ts +0 -135
- package/tests/deepbrain-wire.test.ts +0 -234
- package/tests/deploy-and-dag.test.ts +0 -196
- package/tests/doctor.test.ts +0 -38
- package/tests/document-processor.test.ts +0 -69
- package/tests/e2e-nocode.test.ts +0 -442
- package/tests/e2e.test.ts +0 -134
- package/tests/elevated.test.ts +0 -69
- package/tests/errors.test.ts +0 -83
- package/tests/eval.test.ts +0 -173
- package/tests/gateway.test.ts +0 -63
- package/tests/guardrails.test.ts +0 -177
- package/tests/hitl.test.ts +0 -71
- package/tests/home-assistant.test.ts +0 -40
- package/tests/hooks.test.ts +0 -79
- package/tests/i18n.test.ts +0 -41
- package/tests/ide-bridge.test.ts +0 -38
- package/tests/image-generator.test.ts +0 -84
- package/tests/init-role.test.ts +0 -124
- package/tests/integrations.test.ts +0 -249
- package/tests/mcp-client.test.ts +0 -92
- package/tests/mcp-server.test.ts +0 -178
- package/tests/mcp-servers.test.ts +0 -260
- package/tests/mcp.test.ts +0 -54
- package/tests/node-network.test.ts +0 -74
- package/tests/oad.test.ts +0 -68
- package/tests/performance.test.ts +0 -115
- package/tests/plugin-a2a-enhanced.test.ts +0 -230
- package/tests/plugin.test.ts +0 -74
- package/tests/profiles.test.ts +0 -61
- package/tests/publish.test.ts +0 -231
- package/tests/rl-tools.test.ts +0 -93
- package/tests/room.test.ts +0 -106
- package/tests/runtime.test.ts +0 -42
- package/tests/sandbox-manager.test.ts +0 -46
- package/tests/sandbox.test.ts +0 -46
- package/tests/scheduler.test.ts +0 -200
- package/tests/secrets.test.ts +0 -107
- package/tests/security-enhanced.test.ts +0 -233
- package/tests/security.test.ts +0 -60
- package/tests/settings-api.test.ts +0 -148
- package/tests/setup.test.ts +0 -73
- package/tests/skill-learner.test.ts +0 -161
- package/tests/streaming.test.ts +0 -109
- package/tests/studio.test.ts +0 -402
- package/tests/subagent.test.ts +0 -193
- package/tests/telegram-discord.test.ts +0 -60
- package/tests/telemetry.test.ts +0 -186
- package/tests/templates.test.ts +0 -77
- package/tests/tools/builtin-extended.test.ts +0 -138
- package/tests/user-profiler.test.ts +0 -169
- package/tests/v070.test.ts +0 -76
- package/tests/v090-features.test.ts +0 -254
- package/tests/versioning.test.ts +0 -75
- package/tests/vision.test.ts +0 -61
- package/tests/voice-call.test.ts +0 -47
- package/tests/voice-enhanced.test.ts +0 -169
- package/tests/voice-interaction.test.ts +0 -38
- package/tests/voice.test.ts +0 -61
- package/tests/web-search.test.ts +0 -155
- package/tests/webhook.test.ts +0 -29
- package/tests/workflow-graph.test.ts +0 -279
- package/tests/workflow.test.ts +0 -143
- package/tmp-js-test.js +0 -1532
- package/tmp-sc.js +0 -1716
- package/tutorial/customer-service-agent/README.md +0 -612
- package/tutorial/customer-service-agent/SOUL.md +0 -26
- package/tutorial/customer-service-agent/agent.yaml +0 -63
- package/tutorial/customer-service-agent/package.json +0 -19
- package/tutorial/customer-service-agent/src/index.ts +0 -69
- package/tutorial/customer-service-agent/src/skills/faq.ts +0 -27
- package/tutorial/customer-service-agent/src/skills/ticket.ts +0 -22
- package/tutorial/customer-service-agent/tsconfig.json +0 -14
- package/vitest.config.ts +0 -9
package/tests/hooks.test.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { HookManager, ALL_HOOK_EVENTS } from '../src/core/hooks';
|
|
3
|
-
import type { HookContext, HookEvent } from '../src/core/hooks';
|
|
4
|
-
|
|
5
|
-
describe('HookManager', () => {
|
|
6
|
-
it('should have 14 hook events defined', () => {
|
|
7
|
-
// 7 before/after pairs (message/tool/llm/send/learn/recall) = 12 + on:error/start/stop = 15
|
|
8
|
-
expect(ALL_HOOK_EVENTS.length).toBe(15);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('should register and run hooks', async () => {
|
|
12
|
-
const mgr = new HookManager();
|
|
13
|
-
let called = false;
|
|
14
|
-
mgr.register('before:message', () => { called = true; });
|
|
15
|
-
await mgr.run('before:message');
|
|
16
|
-
expect(called).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should run hooks in priority order', async () => {
|
|
20
|
-
const mgr = new HookManager();
|
|
21
|
-
const order: number[] = [];
|
|
22
|
-
mgr.register('before:tool', () => { order.push(2); }, { priority: 200 });
|
|
23
|
-
mgr.register('before:tool', () => { order.push(1); }, { priority: 50 });
|
|
24
|
-
mgr.register('before:tool', () => { order.push(3); }, { priority: 300 });
|
|
25
|
-
await mgr.run('before:tool');
|
|
26
|
-
expect(order).toEqual([1, 2, 3]);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('should allow context modification', async () => {
|
|
30
|
-
const mgr = new HookManager();
|
|
31
|
-
mgr.register('before:llm', (ctx) => ({ ...ctx, modified: true }));
|
|
32
|
-
mgr.register('before:llm', (ctx) => ({ ...ctx, extra: 'data' }));
|
|
33
|
-
const result = await mgr.run('before:llm', { original: true });
|
|
34
|
-
expect(result.original).toBe(true);
|
|
35
|
-
expect(result.modified).toBe(true);
|
|
36
|
-
expect(result.extra).toBe('data');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should unregister hooks', async () => {
|
|
40
|
-
const mgr = new HookManager();
|
|
41
|
-
let count = 0;
|
|
42
|
-
const id = mgr.register('after:message', () => { count++; });
|
|
43
|
-
await mgr.run('after:message');
|
|
44
|
-
expect(count).toBe(1);
|
|
45
|
-
expect(mgr.unregister(id)).toBe(true);
|
|
46
|
-
await mgr.run('after:message');
|
|
47
|
-
expect(count).toBe(1);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should list registered hooks', () => {
|
|
51
|
-
const mgr = new HookManager();
|
|
52
|
-
mgr.register('on:error', () => {}, { name: 'error-logger', priority: 10 });
|
|
53
|
-
const list = mgr.getRegistered('on:error');
|
|
54
|
-
expect(list).toHaveLength(1);
|
|
55
|
-
expect(list[0].name).toBe('error-logger');
|
|
56
|
-
expect(list[0].priority).toBe(10);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should clear hooks', () => {
|
|
60
|
-
const mgr = new HookManager();
|
|
61
|
-
mgr.register('on:start', () => {});
|
|
62
|
-
mgr.register('on:stop', () => {});
|
|
63
|
-
mgr.clear('on:start');
|
|
64
|
-
expect(mgr.hasHooks('on:start')).toBe(false);
|
|
65
|
-
expect(mgr.hasHooks('on:stop')).toBe(true);
|
|
66
|
-
mgr.clear();
|
|
67
|
-
expect(mgr.hasHooks('on:stop')).toBe(false);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should handle async hooks', async () => {
|
|
71
|
-
const mgr = new HookManager();
|
|
72
|
-
mgr.register('before:send', async (ctx) => {
|
|
73
|
-
await new Promise(r => setTimeout(r, 5));
|
|
74
|
-
return { ...ctx, async: true };
|
|
75
|
-
});
|
|
76
|
-
const result = await mgr.run('before:send', {});
|
|
77
|
-
expect(result.async).toBe(true);
|
|
78
|
-
});
|
|
79
|
-
});
|
package/tests/i18n.test.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { t, setLocale, getLocale, detectLocale, addMessages } from '../src/i18n';
|
|
3
|
-
|
|
4
|
-
describe('i18n', () => {
|
|
5
|
-
it('should return English messages by default', () => {
|
|
6
|
-
setLocale('en');
|
|
7
|
-
expect(t('agent.greeting')).toBe('Hello! How can I help you?');
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('should return Chinese messages', () => {
|
|
11
|
-
setLocale('zh-CN');
|
|
12
|
-
expect(t('agent.greeting')).toBe('你好!有什么可以帮你的?');
|
|
13
|
-
setLocale('en'); // reset
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('should interpolate params', () => {
|
|
17
|
-
setLocale('en');
|
|
18
|
-
expect(t('agent.started', { name: 'TestBot' })).toBe('Agent "TestBot" started successfully');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should fall back to key if not found', () => {
|
|
22
|
-
expect(t('nonexistent.key')).toBe('nonexistent.key');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should get and set locale', () => {
|
|
26
|
-
setLocale('zh-CN');
|
|
27
|
-
expect(getLocale()).toBe('zh-CN');
|
|
28
|
-
setLocale('en');
|
|
29
|
-
expect(getLocale()).toBe('en');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should add custom messages', () => {
|
|
33
|
-
addMessages('en', { 'custom.key': 'Custom value' });
|
|
34
|
-
expect(t('custom.key')).toBe('Custom value');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should detect locale from environment', () => {
|
|
38
|
-
const locale = detectLocale();
|
|
39
|
-
expect(['en', 'zh-CN']).toContain(locale);
|
|
40
|
-
});
|
|
41
|
-
});
|
package/tests/ide-bridge.test.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { IDEBridge } from '../src/core/ide-bridge';
|
|
3
|
-
|
|
4
|
-
describe('IDEBridge', () => {
|
|
5
|
-
it('should create with vscode config', () => {
|
|
6
|
-
const bridge = new IDEBridge({ editor: 'vscode' });
|
|
7
|
-
expect(bridge).toBeInstanceOf(IDEBridge);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('should create with jetbrains config', () => {
|
|
11
|
-
const bridge = new IDEBridge({ editor: 'jetbrains', workspacePath: '/tmp' });
|
|
12
|
-
expect(bridge).toBeInstanceOf(IDEBridge);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('getDiagnostics returns empty array (stub)', async () => {
|
|
16
|
-
const bridge = new IDEBridge({ editor: 'vscode' });
|
|
17
|
-
const diags = await bridge.getDiagnostics();
|
|
18
|
-
expect(diags).toEqual([]);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('getOpenFiles returns empty array (stub)', async () => {
|
|
22
|
-
const bridge = new IDEBridge({ editor: 'zed' });
|
|
23
|
-
const files = await bridge.getOpenFiles();
|
|
24
|
-
expect(files).toEqual([]);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('getSelection returns null (stub)', async () => {
|
|
28
|
-
const bridge = new IDEBridge({ editor: 'cursor' });
|
|
29
|
-
const sel = await bridge.getSelection();
|
|
30
|
-
expect(sel).toBeNull();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('applyEdit throws for non-empty edits (stub)', async () => {
|
|
34
|
-
const bridge = new IDEBridge({ editor: 'vscode' });
|
|
35
|
-
await expect(bridge.applyEdit('test.ts', [{ range: { startLine: 1, startColumn: 0, endLine: 1, endColumn: 5 }, newText: 'hi' }]))
|
|
36
|
-
.rejects.toThrow('extension');
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { ImageGenerator } from '../src/tools/image-generator';
|
|
3
|
-
|
|
4
|
-
describe('ImageGenerator', () => {
|
|
5
|
-
describe('detectProvider', () => {
|
|
6
|
-
it('returns null when no keys configured', () => {
|
|
7
|
-
const gen = new ImageGenerator({});
|
|
8
|
-
expect(gen.detectProvider()).toBeNull();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('detects dalle when openai key set', () => {
|
|
12
|
-
const gen = new ImageGenerator({ openaiApiKey: 'sk-test' });
|
|
13
|
-
expect(gen.detectProvider()).toBe('dalle');
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('detects stable-diffusion when SD URL set', () => {
|
|
17
|
-
const gen = new ImageGenerator({ sdApiUrl: 'http://localhost:7860' });
|
|
18
|
-
expect(gen.detectProvider()).toBe('stable-diffusion');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('detects replicate when token set', () => {
|
|
22
|
-
const gen = new ImageGenerator({ replicateApiKey: 'r8_test' });
|
|
23
|
-
expect(gen.detectProvider()).toBe('replicate');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('prefers dalle over others', () => {
|
|
27
|
-
const gen = new ImageGenerator({ openaiApiKey: 'sk-test', sdApiUrl: 'http://localhost:7860' });
|
|
28
|
-
expect(gen.detectProvider()).toBe('dalle');
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe('getStatus', () => {
|
|
33
|
-
it('returns provider status', () => {
|
|
34
|
-
const gen = new ImageGenerator({ openaiApiKey: 'sk-test' });
|
|
35
|
-
const status = gen.getStatus();
|
|
36
|
-
expect(status.configured).toBe(true);
|
|
37
|
-
expect(status.providers).toHaveLength(3);
|
|
38
|
-
expect(status.providers.find(p => p.name === 'dalle')?.configured).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('shows unconfigured when no keys', () => {
|
|
42
|
-
const gen = new ImageGenerator({});
|
|
43
|
-
const status = gen.getStatus();
|
|
44
|
-
expect(status.configured).toBe(false);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
describe('generate', () => {
|
|
49
|
-
it('returns error when no provider configured', async () => {
|
|
50
|
-
const gen = new ImageGenerator({});
|
|
51
|
-
const result = await gen.generate('a cat');
|
|
52
|
-
expect(result.success).toBe(false);
|
|
53
|
-
expect(result.error).toContain('No image generation provider configured');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('returns error for unknown provider', async () => {
|
|
57
|
-
const gen = new ImageGenerator({});
|
|
58
|
-
const result = await gen.generate('a cat', { provider: 'unknown' });
|
|
59
|
-
expect(result.success).toBe(false);
|
|
60
|
-
expect(result.error).toContain('Unknown provider');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('returns error when dalle key missing', async () => {
|
|
64
|
-
const gen = new ImageGenerator({});
|
|
65
|
-
const result = await gen.generate('a cat', { provider: 'dalle' });
|
|
66
|
-
expect(result.success).toBe(false);
|
|
67
|
-
expect(result.error).toContain('OPENAI_API_KEY');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('returns error when SD URL missing', async () => {
|
|
71
|
-
const gen = new ImageGenerator({});
|
|
72
|
-
const result = await gen.generate('a cat', { provider: 'stable-diffusion' });
|
|
73
|
-
expect(result.success).toBe(false);
|
|
74
|
-
expect(result.error).toContain('SD_API_URL');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('returns error when replicate key missing', async () => {
|
|
78
|
-
const gen = new ImageGenerator({});
|
|
79
|
-
const result = await gen.generate('a cat', { provider: 'replicate' });
|
|
80
|
-
expect(result.success).toBe(false);
|
|
81
|
-
expect(result.error).toContain('REPLICATE_API_TOKEN');
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
});
|
package/tests/init-role.test.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import { execSync } from 'child_process';
|
|
5
|
-
import { searchRoles, getPopularRoles, getRole, getCategories } from 'agent-workstation';
|
|
6
|
-
|
|
7
|
-
const CLI_PATH = path.join(__dirname, '..', 'dist', 'cli.js');
|
|
8
|
-
const TMP_DIR = path.join(process.env.TEMP || require('os').tmpdir(), 'opc-test-init-role-' + process.pid);
|
|
9
|
-
|
|
10
|
-
function run(args: string): string {
|
|
11
|
-
return execSync(`node "${CLI_PATH}" ${args}`, { cwd: TMP_DIR, encoding: 'utf-8', timeout: 15000 });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe('opc init --role integration with agent-workstation', () => {
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
if (fs.existsSync(TMP_DIR)) fs.rmSync(TMP_DIR, { recursive: true, force: true });
|
|
17
|
-
fs.mkdirSync(TMP_DIR, { recursive: true });
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
if (fs.existsSync(TMP_DIR)) fs.rmSync(TMP_DIR, { recursive: true, force: true });
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// --- agent-workstation API tests ---
|
|
25
|
-
|
|
26
|
-
it('searchRoles returns results for "customer"', () => {
|
|
27
|
-
const results = searchRoles('customer');
|
|
28
|
-
expect(results.length).toBeGreaterThan(0);
|
|
29
|
-
expect(results[0].category).toBe('customer-service');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('searchRoles returns results for "developer"', () => {
|
|
33
|
-
const results = searchRoles('developer');
|
|
34
|
-
expect(results.length).toBeGreaterThan(0);
|
|
35
|
-
expect(results.some((r: any) => r.role.includes('developer'))).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('searchRoles returns empty for nonexistent role', () => {
|
|
39
|
-
const results = searchRoles('xyznonexistentrole12345');
|
|
40
|
-
expect(results.length).toBe(0);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('getPopularRoles returns roles with category and role fields', () => {
|
|
44
|
-
const roles = getPopularRoles();
|
|
45
|
-
expect(roles.length).toBeGreaterThan(5);
|
|
46
|
-
for (const r of roles) {
|
|
47
|
-
expect(r).toHaveProperty('category');
|
|
48
|
-
expect(r).toHaveProperty('role');
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('getRole loads full role data with files', () => {
|
|
53
|
-
const role = getRole('customer-service', 'customer-service-rep');
|
|
54
|
-
expect(role).toBeTruthy();
|
|
55
|
-
expect(role.files).toBeTruthy();
|
|
56
|
-
expect(role.files['system-prompt.md']).toBeTruthy();
|
|
57
|
-
expect(role.files['brain-seed.md']).toBeTruthy();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('getCategories returns category list', () => {
|
|
61
|
-
const cats = getCategories();
|
|
62
|
-
expect(cats.length).toBeGreaterThan(3);
|
|
63
|
-
expect(cats.some((c: any) => c.name === 'customer-service')).toBe(true);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// --- CLI integration tests ---
|
|
67
|
-
|
|
68
|
-
it('--list-roles shows available roles', () => {
|
|
69
|
-
const output = run('init --list-roles');
|
|
70
|
-
expect(output).toContain('Available workstation roles');
|
|
71
|
-
expect(output).toContain('customer-service');
|
|
72
|
-
expect(output).toContain('--role');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('--role customer-service generates SOUL.md from template', () => {
|
|
76
|
-
const output = run('init test-cs-agent --role customer-service');
|
|
77
|
-
expect(output).toContain('customer-service');
|
|
78
|
-
const soulPath = path.join(TMP_DIR, 'test-cs-agent', 'SOUL.md');
|
|
79
|
-
expect(fs.existsSync(soulPath)).toBe(true);
|
|
80
|
-
const soul = fs.readFileSync(soulPath, 'utf-8');
|
|
81
|
-
expect(soul).toContain('Customer Service');
|
|
82
|
-
expect(soul.split('\n').length).toBeGreaterThan(10);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('--role generates agent.yaml with role systemPrompt', () => {
|
|
86
|
-
run('init test-yaml-agent --role customer-service');
|
|
87
|
-
const agentYaml = fs.readFileSync(path.join(TMP_DIR, 'test-yaml-agent', 'agent.yaml'), 'utf-8');
|
|
88
|
-
expect(agentYaml).toContain('Customer Service');
|
|
89
|
-
expect(agentYaml).toContain('systemPrompt');
|
|
90
|
-
expect(agentYaml).toContain('deepbrain');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('--role generates brain-seed when available', () => {
|
|
94
|
-
run('init test-brain-agent --role customer-service');
|
|
95
|
-
const brainPath = path.join(TMP_DIR, 'test-brain-agent', 'data', 'brain-seed.md');
|
|
96
|
-
expect(fs.existsSync(brainPath)).toBe(true);
|
|
97
|
-
const brain = fs.readFileSync(brainPath, 'utf-8');
|
|
98
|
-
expect(brain.length).toBeGreaterThan(50);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('--role generates CONTEXT.md with role info', () => {
|
|
102
|
-
run('init test-ctx-agent --role customer-service');
|
|
103
|
-
const ctx = fs.readFileSync(path.join(TMP_DIR, 'test-ctx-agent', 'CONTEXT.md'), 'utf-8');
|
|
104
|
-
expect(ctx).toContain('Customer Service');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('--role with unknown role gives error', () => {
|
|
108
|
-
expect(() => run('init test-bad --role xyznonexistent123')).toThrow();
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('--role with partial match "developer" works', () => {
|
|
112
|
-
const output = run('init test-dev-agent --role developer');
|
|
113
|
-
expect(output).toContain('developer');
|
|
114
|
-
expect(fs.existsSync(path.join(TMP_DIR, 'test-dev-agent', 'SOUL.md'))).toBe(true);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('init without --role still works (generic project)', () => {
|
|
118
|
-
const output = run('init test-generic -y');
|
|
119
|
-
expect(output).toContain('Created agent project');
|
|
120
|
-
expect(output).toContain('Tip');
|
|
121
|
-
expect(output).toContain('--role');
|
|
122
|
-
expect(fs.existsSync(path.join(TMP_DIR, 'test-generic', 'SOUL.md'))).toBe(true);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
getAllIntegrationTools, getIntegrationTool,
|
|
4
|
-
SlackTool, EmailSendTool, WebhookTool,
|
|
5
|
-
NotionTool, GitHubTool, JiraTool, CalendarTool, TrelloTool,
|
|
6
|
-
WebSearchTool, WebScraperTool, DatabaseTool, VectorSearchTool,
|
|
7
|
-
CodeExecutionTool, GitTool, NpmTool,
|
|
8
|
-
ImageGenerationTool, PDFReaderTool, CSVAnalyzerTool,
|
|
9
|
-
SummarizerTool, TranslatorTool,
|
|
10
|
-
} from '../src/tools/integrations';
|
|
11
|
-
|
|
12
|
-
describe('Integration Tools Registry', () => {
|
|
13
|
-
it('should return all 20 tools', () => {
|
|
14
|
-
const tools = getAllIntegrationTools();
|
|
15
|
-
expect(tools).toHaveLength(20);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should find tools by name', () => {
|
|
19
|
-
expect(getIntegrationTool('slack')).toBe(SlackTool);
|
|
20
|
-
expect(getIntegrationTool('github')).toBe(GitHubTool);
|
|
21
|
-
expect(getIntegrationTool('nonexistent')).toBeUndefined();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('each tool has required properties', () => {
|
|
25
|
-
const tools = getAllIntegrationTools();
|
|
26
|
-
for (const tool of tools) {
|
|
27
|
-
expect(tool.name).toBeTruthy();
|
|
28
|
-
expect(tool.description).toBeTruthy();
|
|
29
|
-
expect(tool.inputSchema).toBeDefined();
|
|
30
|
-
expect(typeof tool.execute).toBe('function');
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('all tool names are unique', () => {
|
|
35
|
-
const tools = getAllIntegrationTools();
|
|
36
|
-
const names = tools.map((t) => t.name);
|
|
37
|
-
expect(new Set(names).size).toBe(names.length);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe('SlackTool', () => {
|
|
42
|
-
it('should require action', async () => {
|
|
43
|
-
const r = await SlackTool.execute({});
|
|
44
|
-
expect(r.content).toContain('Unknown action');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should require text for send_message', async () => {
|
|
48
|
-
const r = await SlackTool.execute({ action: 'send_message' });
|
|
49
|
-
expect(r.isError).toBe(true);
|
|
50
|
-
expect(r.content).toContain('text is required');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
describe('EmailSendTool', () => {
|
|
55
|
-
it('should require SMTP env vars', async () => {
|
|
56
|
-
const r = await EmailSendTool.execute({ to: 'a@b.com', subject: 'test', body: 'hi' });
|
|
57
|
-
expect(r.isError).toBe(true);
|
|
58
|
-
expect(r.content).toContain('SMTP_HOST');
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe('WebhookTool', () => {
|
|
63
|
-
it('should require url', async () => {
|
|
64
|
-
const r = await WebhookTool.execute({});
|
|
65
|
-
expect(r.isError).toBe(true);
|
|
66
|
-
expect(r.content).toContain('url is required');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe('NotionTool', () => {
|
|
71
|
-
it('should require API key', async () => {
|
|
72
|
-
const r = await NotionTool.execute({ action: 'search', query: 'test' });
|
|
73
|
-
expect(r.isError).toBe(true);
|
|
74
|
-
expect(r.content).toContain('NOTION_API_KEY');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('GitHubTool', () => {
|
|
79
|
-
it('should require GITHUB_TOKEN', async () => {
|
|
80
|
-
const r = await GitHubTool.execute({ action: 'list_issues', owner: 'a', repo: 'b' });
|
|
81
|
-
expect(r.isError).toBe(true);
|
|
82
|
-
expect(r.content).toContain('GITHUB_TOKEN');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should validate create_issue params', async () => {
|
|
86
|
-
process.env.GITHUB_TOKEN = 'test';
|
|
87
|
-
const r = await GitHubTool.execute({ action: 'create_issue' });
|
|
88
|
-
expect(r.isError).toBe(true);
|
|
89
|
-
expect(r.content).toContain('owner, repo, title required');
|
|
90
|
-
delete process.env.GITHUB_TOKEN;
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe('JiraTool', () => {
|
|
95
|
-
it('should require Jira env vars', async () => {
|
|
96
|
-
const r = await JiraTool.execute({ action: 'search', jql: 'test' });
|
|
97
|
-
expect(r.isError).toBe(true);
|
|
98
|
-
expect(r.content).toContain('JIRA_URL');
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
describe('CalendarTool', () => {
|
|
103
|
-
it('should require GOOGLE_ACCESS_TOKEN', async () => {
|
|
104
|
-
const r = await CalendarTool.execute({ action: 'list_events' });
|
|
105
|
-
expect(r.isError).toBe(true);
|
|
106
|
-
expect(r.content).toContain('GOOGLE_ACCESS_TOKEN');
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe('TrelloTool', () => {
|
|
111
|
-
it('should require API key and token', async () => {
|
|
112
|
-
const r = await TrelloTool.execute({ action: 'list_boards' });
|
|
113
|
-
expect(r.isError).toBe(true);
|
|
114
|
-
expect(r.content).toContain('TRELLO_API_KEY');
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe('WebSearchTool', () => {
|
|
119
|
-
it('should require query', async () => {
|
|
120
|
-
const r = await WebSearchTool.execute({});
|
|
121
|
-
expect(r.isError).toBe(true);
|
|
122
|
-
expect(r.content).toContain('query required');
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('should require API key', async () => {
|
|
126
|
-
const r = await WebSearchTool.execute({ query: 'test' });
|
|
127
|
-
expect(r.isError).toBe(true);
|
|
128
|
-
expect(r.content).toContain('No search API key');
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
describe('WebScraperTool', () => {
|
|
133
|
-
it('should require url', async () => {
|
|
134
|
-
const r = await WebScraperTool.execute({});
|
|
135
|
-
expect(r.isError).toBe(true);
|
|
136
|
-
expect(r.content).toContain('url required');
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
describe('DatabaseTool', () => {
|
|
141
|
-
it('should require connection URL', async () => {
|
|
142
|
-
const r = await DatabaseTool.execute({ query: 'SELECT 1' });
|
|
143
|
-
expect(r.isError).toBe(true);
|
|
144
|
-
expect(r.content).toContain('DATABASE_URL');
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it('should block destructive queries by default', async () => {
|
|
148
|
-
process.env.DATABASE_URL = 'test.db';
|
|
149
|
-
const r = await DatabaseTool.execute({ query: 'DROP TABLE users' });
|
|
150
|
-
expect(r.isError).toBe(true);
|
|
151
|
-
expect(r.content).toContain('Destructive queries blocked');
|
|
152
|
-
delete process.env.DATABASE_URL;
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
describe('VectorSearchTool', () => {
|
|
157
|
-
it('should require DEEPBRAIN_URL', async () => {
|
|
158
|
-
const r = await VectorSearchTool.execute({ query: 'test' });
|
|
159
|
-
expect(r.isError).toBe(true);
|
|
160
|
-
expect(r.content).toContain('DEEPBRAIN_URL');
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
describe('CodeExecutionTool', () => {
|
|
165
|
-
it('should require code', async () => {
|
|
166
|
-
const r = await CodeExecutionTool.execute({ language: 'javascript', code: '' });
|
|
167
|
-
expect(r.isError).toBe(true);
|
|
168
|
-
expect(r.content).toContain('code required');
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should reject unknown language', async () => {
|
|
172
|
-
const r = await CodeExecutionTool.execute({ language: 'ruby', code: 'puts 1' });
|
|
173
|
-
expect(r.isError).toBe(true);
|
|
174
|
-
expect(r.content).toContain('Unsupported language');
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
describe('GitTool', () => {
|
|
179
|
-
it('should require message for commit', async () => {
|
|
180
|
-
const r = await GitTool.execute({ action: 'commit' });
|
|
181
|
-
expect(r.isError).toBe(true);
|
|
182
|
-
expect(r.content).toContain('message required');
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
describe('NpmTool', () => {
|
|
187
|
-
it('should reject install action', async () => {
|
|
188
|
-
const r = await NpmTool.execute({ action: 'install', package: 'lodash' });
|
|
189
|
-
expect(r.isError).toBe(true);
|
|
190
|
-
expect(r.content).toContain('not supported');
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
describe('ImageGenerationTool', () => {
|
|
195
|
-
it('should require prompt', async () => {
|
|
196
|
-
const r = await ImageGenerationTool.execute({});
|
|
197
|
-
expect(r.isError).toBe(true);
|
|
198
|
-
expect(r.content).toContain('prompt required');
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
describe('PDFReaderTool', () => {
|
|
203
|
-
it('should require file_path or url', async () => {
|
|
204
|
-
const r = await PDFReaderTool.execute({});
|
|
205
|
-
expect(r.isError).toBe(true);
|
|
206
|
-
expect(r.content).toContain('file_path or url required');
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
describe('CSVAnalyzerTool', () => {
|
|
211
|
-
it('should require file_path or data', async () => {
|
|
212
|
-
const r = await CSVAnalyzerTool.execute({});
|
|
213
|
-
expect(r.isError).toBe(true);
|
|
214
|
-
expect(r.content).toContain('file_path or data required');
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it('should parse inline CSV', async () => {
|
|
218
|
-
const r = await CSVAnalyzerTool.execute({ data: 'name,age\nAlice,30\nBob,25', action: 'parse' });
|
|
219
|
-
expect(r.isError).toBeUndefined();
|
|
220
|
-
expect(r.content).toContain('2 rows');
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('should aggregate CSV', async () => {
|
|
224
|
-
const r = await CSVAnalyzerTool.execute({ data: 'name,score\nA,10\nB,20\nC,30', action: 'aggregate', column: 'score', operation: 'sum' });
|
|
225
|
-
expect(r.content).toContain('60');
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
describe('SummarizerTool', () => {
|
|
230
|
-
it('should require text', async () => {
|
|
231
|
-
const r = await SummarizerTool.execute({});
|
|
232
|
-
expect(r.isError).toBe(true);
|
|
233
|
-
expect(r.content).toContain('text required');
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
it('should require API key', async () => {
|
|
237
|
-
const r = await SummarizerTool.execute({ text: 'Hello world' });
|
|
238
|
-
expect(r.isError).toBe(true);
|
|
239
|
-
expect(r.content).toContain('OPENAI_API_KEY');
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
describe('TranslatorTool', () => {
|
|
244
|
-
it('should require text and target language', async () => {
|
|
245
|
-
const r = await TranslatorTool.execute({});
|
|
246
|
-
expect(r.isError).toBe(true);
|
|
247
|
-
expect(r.content).toContain('text and to are required');
|
|
248
|
-
});
|
|
249
|
-
});
|