@aexol/spectral 0.8.0 → 0.8.5
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/CHANGELOG.md +82 -55
- package/README.md +80 -82
- package/dist/agent/agents.d.ts +37 -0
- package/dist/agent/agents.d.ts.map +1 -0
- package/dist/agent/index.d.ts +29 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/commands/bind.d.ts +12 -0
- package/dist/commands/bind.d.ts.map +1 -0
- package/dist/commands/login-oauth.d.ts +15 -0
- package/dist/commands/login-oauth.d.ts.map +1 -0
- package/dist/commands/login.d.ts +37 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/serve.d.ts +112 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/unbind.d.ts +8 -0
- package/dist/commands/unbind.d.ts.map +1 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/designer/guidelines.d.ts +23 -0
- package/dist/designer/guidelines.d.ts.map +1 -0
- package/dist/designer/index.d.ts +26 -0
- package/dist/designer/index.d.ts.map +1 -0
- package/dist/designer/philosophies.d.ts +33 -0
- package/dist/designer/philosophies.d.ts.map +1 -0
- package/dist/designer/skills.d.ts +27 -0
- package/dist/designer/skills.d.ts.map +1 -0
- package/dist/designer/systems.d.ts +36 -0
- package/dist/designer/systems.d.ts.map +1 -0
- package/dist/extensions/aexol-mcp.d.ts +25 -0
- package/dist/extensions/aexol-mcp.d.ts.map +1 -0
- package/dist/extensions/kanban-bridge.d.ts +24 -0
- package/dist/extensions/kanban-bridge.d.ts.map +1 -0
- package/dist/extensions/kanban-bridge.js +668 -0
- package/dist/extensions/openrouter-attribution.d.ts +12 -0
- package/dist/extensions/openrouter-attribution.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.d.ts +23 -0
- package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.js +32 -22
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/mcp/agent-dir.d.ts +3 -0
- package/dist/mcp/agent-dir.d.ts.map +1 -0
- package/dist/mcp/commands.d.ts +9 -0
- package/dist/mcp/commands.d.ts.map +1 -0
- package/dist/mcp/config.d.ts +78 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/consent-manager.d.ts +14 -0
- package/dist/mcp/consent-manager.d.ts.map +1 -0
- package/dist/mcp/direct-tools.d.ts +11 -0
- package/dist/mcp/direct-tools.d.ts.map +1 -0
- package/dist/mcp/errors.d.ts +100 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/glimpse-ui.d.ts +10 -0
- package/dist/mcp/glimpse-ui.d.ts.map +1 -0
- package/dist/mcp/host-html-template.d.ts +17 -0
- package/dist/mcp/host-html-template.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/init.d.ts +10 -0
- package/dist/mcp/init.d.ts.map +1 -0
- package/dist/mcp/init.js +1 -9
- package/dist/mcp/lifecycle.d.ts +30 -0
- package/dist/mcp/lifecycle.d.ts.map +1 -0
- package/dist/mcp/logger.d.ts +52 -0
- package/dist/mcp/logger.d.ts.map +1 -0
- package/dist/mcp/mcp-auth-flow.d.ts +69 -0
- package/dist/mcp/mcp-auth-flow.d.ts.map +1 -0
- package/dist/mcp/mcp-auth.d.ts +100 -0
- package/dist/mcp/mcp-auth.d.ts.map +1 -0
- package/dist/mcp/mcp-callback-server.d.ts +40 -0
- package/dist/mcp/mcp-callback-server.d.ts.map +1 -0
- package/dist/mcp/mcp-oauth-provider.d.ts +101 -0
- package/dist/mcp/mcp-oauth-provider.d.ts.map +1 -0
- package/dist/mcp/metadata-cache.d.ts +32 -0
- package/dist/mcp/metadata-cache.d.ts.map +1 -0
- package/dist/mcp/npx-resolver.d.ts +7 -0
- package/dist/mcp/npx-resolver.d.ts.map +1 -0
- package/dist/mcp/oauth-handler.d.ts +19 -0
- package/dist/mcp/oauth-handler.d.ts.map +1 -0
- package/dist/mcp/onboarding-state.d.ts +13 -0
- package/dist/mcp/onboarding-state.d.ts.map +1 -0
- package/dist/mcp/proxy-modes.d.ts +12 -0
- package/dist/mcp/proxy-modes.d.ts.map +1 -0
- package/dist/mcp/resource-tools.d.ts +2 -0
- package/dist/mcp/resource-tools.d.ts.map +1 -0
- package/dist/mcp/sampling-handler.d.ts +16 -0
- package/dist/mcp/sampling-handler.d.ts.map +1 -0
- package/dist/mcp/server-manager.d.ts +42 -0
- package/dist/mcp/server-manager.d.ts.map +1 -0
- package/dist/mcp/state.d.ts +41 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/tool-metadata.d.ts +11 -0
- package/dist/mcp/tool-metadata.d.ts.map +1 -0
- package/dist/mcp/tool-registrar.d.ts +9 -0
- package/dist/mcp/tool-registrar.d.ts.map +1 -0
- package/dist/mcp/types.d.ts +263 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/ui-resource-handler.d.ts +10 -0
- package/dist/mcp/ui-resource-handler.d.ts.map +1 -0
- package/dist/mcp/ui-server.d.ts +37 -0
- package/dist/mcp/ui-server.d.ts.map +1 -0
- package/dist/mcp/ui-session.d.ts +27 -0
- package/dist/mcp/ui-session.d.ts.map +1 -0
- package/dist/mcp/ui-stream-types.d.ts +197 -0
- package/dist/mcp/ui-stream-types.d.ts.map +1 -0
- package/dist/mcp/utils.d.ts +17 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/vitest.config.d.ts +3 -0
- package/dist/mcp/vitest.config.d.ts.map +1 -0
- package/dist/mcp-client.d.ts +58 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +2 -1
- package/dist/memory/branch.d.ts +124 -0
- package/dist/memory/branch.d.ts.map +1 -0
- package/dist/memory/commands/status.d.ts +4 -0
- package/dist/memory/commands/status.d.ts.map +1 -0
- package/dist/memory/commands/view.d.ts +4 -0
- package/dist/memory/commands/view.d.ts.map +1 -0
- package/dist/memory/compaction.d.ts +113 -0
- package/dist/memory/compaction.d.ts.map +1 -0
- package/dist/memory/config.d.ts +27 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/debug-log.d.ts +12 -0
- package/dist/memory/debug-log.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-hook.d.ts +4 -0
- package/dist/memory/hooks/compaction-hook.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-trigger.d.ts +4 -0
- package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -0
- package/dist/memory/hooks/observer-trigger.d.ts +4 -0
- package/dist/memory/hooks/observer-trigger.d.ts.map +1 -0
- package/dist/memory/ids.d.ts +2 -0
- package/dist/memory/ids.d.ts.map +1 -0
- package/dist/memory/index.d.ts +3 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +2 -0
- package/dist/memory/model-budget.d.ts +4 -0
- package/dist/memory/model-budget.d.ts.map +1 -0
- package/dist/memory/observer.d.ts +21 -0
- package/dist/memory/observer.d.ts.map +1 -0
- package/dist/memory/project-observations-store.d.ts +24 -0
- package/dist/memory/project-observations-store.d.ts.map +1 -0
- package/dist/memory/prompts.d.ts +11 -0
- package/dist/memory/prompts.d.ts.map +1 -0
- package/dist/memory/relevance.d.ts +4 -0
- package/dist/memory/relevance.d.ts.map +1 -0
- package/dist/memory/runtime.d.ts +40 -0
- package/dist/memory/runtime.d.ts.map +1 -0
- package/dist/memory/serialize.d.ts +26 -0
- package/dist/memory/serialize.d.ts.map +1 -0
- package/dist/memory/tokens.d.ts +8 -0
- package/dist/memory/tokens.d.ts.map +1 -0
- package/dist/memory/tools/read-project-observations.d.ts +8 -0
- package/dist/memory/tools/read-project-observations.d.ts.map +1 -0
- package/dist/memory/tools/recall-observation.d.ts +63 -0
- package/dist/memory/tools/recall-observation.d.ts.map +1 -0
- package/dist/memory/tools/write-project-observation.d.ts +9 -0
- package/dist/memory/tools/write-project-observation.d.ts.map +1 -0
- package/dist/memory/tools/write-project-observation.js +60 -0
- package/dist/memory/types.d.ts +65 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/preflight.d.ts +27 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +3 -1
- package/dist/relay/auto-research.d.ts +64 -0
- package/dist/relay/auto-research.d.ts.map +1 -0
- package/dist/relay/auto-research.js +208 -69
- package/dist/relay/client.d.ts +126 -0
- package/dist/relay/client.d.ts.map +1 -0
- package/dist/relay/dispatcher.d.ts +207 -0
- package/dist/relay/dispatcher.d.ts.map +1 -0
- package/dist/relay/machine-store.d.ts +68 -0
- package/dist/relay/machine-store.d.ts.map +1 -0
- package/dist/relay/models-fetch.d.ts +75 -0
- package/dist/relay/models-fetch.d.ts.map +1 -0
- package/dist/relay/registration.d.ts +81 -0
- package/dist/relay/registration.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent-loop.d.ts +24 -0
- package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent.d.ts +125 -0
- package/dist/sdk/agent-core/agent.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts +92 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts +53 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts +95 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts +25 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts +51 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/messages.d.ts +51 -0
- package/dist/sdk/agent-core/harness/messages.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts +48 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts +26 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts +33 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts +18 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts +25 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts +11 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts +32 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts +2 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/skills.d.ts +44 -0
- package/dist/sdk/agent-core/harness/skills.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts +3 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/types.d.ts +601 -0
- package/dist/sdk/agent-core/harness/types.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts +14 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts +70 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts.map +1 -0
- package/dist/sdk/agent-core/index.d.ts +20 -0
- package/dist/sdk/agent-core/index.d.ts.map +1 -0
- package/dist/sdk/agent-core/node.d.ts +3 -0
- package/dist/sdk/agent-core/node.d.ts.map +1 -0
- package/dist/sdk/agent-core/proxy.d.ts +69 -0
- package/dist/sdk/agent-core/proxy.d.ts.map +1 -0
- package/dist/sdk/agent-core/types.d.ts +393 -0
- package/dist/sdk/agent-core/types.d.ts.map +1 -0
- package/dist/sdk/ai/api-registry.d.ts +20 -0
- package/dist/sdk/ai/api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/cli.d.ts +3 -0
- package/dist/sdk/ai/cli.d.ts.map +1 -0
- package/dist/sdk/ai/env-api-keys.d.ts +18 -0
- package/dist/sdk/ai/env-api-keys.d.ts.map +1 -0
- package/dist/sdk/ai/env-api-keys.js +9 -49
- package/dist/sdk/ai/image-models.d.ts +10 -0
- package/dist/sdk/ai/image-models.d.ts.map +1 -0
- package/dist/sdk/ai/image-models.generated.d.ts +440 -0
- package/dist/sdk/ai/image-models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/images-api-registry.d.ts +14 -0
- package/dist/sdk/ai/images-api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/images.d.ts +4 -0
- package/dist/sdk/ai/images.d.ts.map +1 -0
- package/dist/sdk/ai/index.d.ts +21 -0
- package/dist/sdk/ai/index.d.ts.map +1 -0
- package/dist/sdk/ai/models.d.ts +18 -0
- package/dist/sdk/ai/models.d.ts.map +1 -0
- package/dist/sdk/ai/models.generated.d.ts +17349 -0
- package/dist/sdk/ai/models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/oauth.d.ts +2 -0
- package/dist/sdk/ai/oauth.d.ts.map +1 -0
- package/dist/sdk/ai/providers/anthropic.d.ts +54 -0
- package/dist/sdk/ai/providers/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/providers/faux.d.ts +56 -0
- package/dist/sdk/ai/providers/faux.d.ts.map +1 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts +8 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts +19 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts +3 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts.map +1 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts +15 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -0
- package/dist/sdk/ai/providers/simple-options.d.ts +8 -0
- package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts +8 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -0
- package/dist/sdk/ai/session-resources.d.ts +4 -0
- package/dist/sdk/ai/session-resources.d.ts.map +1 -0
- package/dist/sdk/ai/stream.d.ts +8 -0
- package/dist/sdk/ai/stream.d.ts.map +1 -0
- package/dist/sdk/ai/types.d.ts +488 -0
- package/dist/sdk/ai/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts +19 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts.map +1 -0
- package/dist/sdk/ai/utils/event-stream.d.ts +21 -0
- package/dist/sdk/ai/utils/event-stream.d.ts.map +1 -0
- package/dist/sdk/ai/utils/hash.d.ts +3 -0
- package/dist/sdk/ai/utils/hash.d.ts.map +1 -0
- package/dist/sdk/ai/utils/headers.d.ts +2 -0
- package/dist/sdk/ai/utils/headers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/json-parse.d.ts +16 -0
- package/dist/sdk/ai/utils/json-parse.d.ts.map +1 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts +10 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts +25 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/anthropic.js +1 -1
- package/dist/sdk/ai/utils/oauth/device-code.d.ts +19 -0
- package/dist/sdk/ai/utils/oauth/device-code.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts +30 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts +58 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts +3 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +34 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.js +1 -1
- package/dist/sdk/ai/utils/oauth/pkce.d.ts +13 -0
- package/dist/sdk/ai/utils/oauth/pkce.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts +64 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/overflow.d.ts +56 -0
- package/dist/sdk/ai/utils/overflow.d.ts.map +1 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts +22 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts.map +1 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts +17 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/validation.d.ts +18 -0
- package/dist/sdk/ai/utils/validation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/cli.d.ts +3 -0
- package/dist/sdk/coding-agent/cli.d.ts.map +1 -0
- package/dist/sdk/coding-agent/config.d.ts +71 -0
- package/dist/sdk/coding-agent/config.d.ts.map +1 -0
- package/dist/sdk/coding-agent/config.js +2 -69
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts +117 -0
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts +86 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts +626 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts +5 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts +145 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts +32 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +142 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts +7 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts +38 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts +3 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts +15 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts +9 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/exec.d.ts +29 -0
- package/dist/sdk/coding-agent/core/exec.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts +24 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.js +3 -35
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts +161 -0
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/runner.js +1 -2
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +1181 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts +20 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts +21 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts +371 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/messages.d.ts +77 -0
- package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts +150 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts +7 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.js +8 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts +110 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver.js +1 -1
- package/dist/sdk/coding-agent/core/output-guard.d.ts +6 -0
- package/dist/sdk/coding-agent/core/output-guard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts +204 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts +52 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts +2 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts +23 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts +194 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resource-loader.js +1 -1
- package/dist/sdk/coding-agent/core/sdk.d.ts +107 -0
- package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts +19 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts +333 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts +209 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/settings-manager.js +1 -170
- package/dist/sdk/coding-agent/core/skills.d.ts +60 -0
- package/dist/sdk/coding-agent/core/skills.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts +14 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts +18 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts +28 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/system-prompt.js +3 -1
- package/dist/sdk/coding-agent/core/telemetry.d.ts +3 -0
- package/dist/sdk/coding-agent/core/telemetry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/theme.d.ts +28 -0
- package/dist/sdk/coding-agent/core/theme.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/theme.js +202 -0
- package/dist/sdk/coding-agent/core/timings.d.ts +8 -0
- package/dist/sdk/coding-agent/core/timings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts +63 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/bash.js +17 -18
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts +87 -0
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts +39 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit.js +7 -8
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/find.js +9 -13
- package/dist/sdk/coding-agent/core/tools/grep.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/grep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/grep.js +10 -14
- package/dist/sdk/coding-agent/core/tools/index.d.ts +40 -0
- package/dist/sdk/coding-agent/core/tools/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/ls.js +9 -10
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts +52 -0
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts +8 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.js +33 -35
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts +17 -0
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/{modes/interactive/components/diff.js → core/tools/render-diff.js} +18 -31
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts +21 -0
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts +70 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts +26 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/write.js +10 -11
- package/dist/sdk/coding-agent/index.d.ts +29 -0
- package/dist/sdk/coding-agent/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/index.js +7 -5
- package/dist/sdk/coding-agent/main.d.ts +2 -0
- package/dist/sdk/coding-agent/main.d.ts.map +1 -0
- package/dist/sdk/coding-agent/migrations.d.ts +33 -0
- package/dist/sdk/coding-agent/migrations.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/index.d.ts +8 -0
- package/dist/sdk/coding-agent/modes/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/index.js +0 -1
- package/dist/sdk/coding-agent/modes/print-mode.d.ts +28 -0
- package/dist/sdk/coding-agent/modes/print-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts +17 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts +224 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.js +2 -2
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts +419 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts +21 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts +11 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/git.d.ts +26 -0
- package/dist/sdk/coding-agent/utils/git.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/html.d.ts +7 -0
- package/dist/sdk/coding-agent/utils/html.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts +9 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts +36 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts +31 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts +13 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/photon.js +2 -10
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.js +1 -2
- package/dist/sdk/coding-agent/utils/shell.d.ts +30 -0
- package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts +12 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts.map +1 -0
- package/dist/server/agent-bridge.d.ts +308 -0
- package/dist/server/agent-bridge.d.ts.map +1 -0
- package/dist/server/agent-bridge.js +2 -1
- package/dist/server/handlers/errors.d.ts +26 -0
- package/dist/server/handlers/errors.d.ts.map +1 -0
- package/dist/server/handlers/paths-autocomplete.d.ts +45 -0
- package/dist/server/handlers/paths-autocomplete.d.ts.map +1 -0
- package/dist/server/handlers/projects.d.ts +58 -0
- package/dist/server/handlers/projects.d.ts.map +1 -0
- package/dist/server/handlers/queue.d.ts +27 -0
- package/dist/server/handlers/queue.d.ts.map +1 -0
- package/dist/server/handlers/sessions.d.ts +50 -0
- package/dist/server/handlers/sessions.d.ts.map +1 -0
- package/dist/server/paths.d.ts +51 -0
- package/dist/server/paths.d.ts.map +1 -0
- package/dist/server/session-stream.d.ts +379 -0
- package/dist/server/session-stream.d.ts.map +1 -0
- package/dist/server/shutdown.d.ts +102 -0
- package/dist/server/shutdown.d.ts.map +1 -0
- package/dist/server/storage.d.ts +287 -0
- package/dist/server/storage.d.ts.map +1 -0
- package/dist/server/title-generator.d.ts +25 -0
- package/dist/server/title-generator.d.ts.map +1 -0
- package/dist/server/wire.d.ts +448 -0
- package/dist/server/wire.d.ts.map +1 -0
- package/dist/studio-binding.d.ts +44 -0
- package/dist/studio-binding.d.ts.map +1 -0
- package/dist/studio-binding.js +1 -1
- package/package.json +11 -1
- package/dist/sdk/coding-agent/bun/cli.js +0 -7
- package/dist/sdk/coding-agent/bun/restore-sandbox-env.js +0 -31
- package/dist/sdk/coding-agent/cli/args.js +0 -340
- package/dist/sdk/coding-agent/cli/file-processor.js +0 -82
- package/dist/sdk/coding-agent/cli/initial-message.js +0 -21
- package/dist/sdk/coding-agent/core/footer-data-provider.js +0 -309
- package/dist/sdk/coding-agent/modes/interactive/components/keybinding-hints.js +0 -35
- package/dist/sdk/coding-agent/modes/interactive/components/visual-truncate.js +0 -26
- package/dist/sdk/coding-agent/modes/interactive/interactive-mode.js +0 -3
- package/dist/sdk/coding-agent/modes/interactive/theme/theme.js +0 -1022
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kanban Bridge pi extension.
|
|
3
|
+
*
|
|
4
|
+
* Registers kanban management tools that allow the coding agent to read,
|
|
5
|
+
* create, update, and move Kanban tasks on the Aexol Studio board. This
|
|
6
|
+
* enables task-driven execution — the agent can pick up TODO tasks, work
|
|
7
|
+
* on them, and move them to DONE.
|
|
8
|
+
*
|
|
9
|
+
* Auth is read from ~/.spectral/config.json (same as aexol-mcp).
|
|
10
|
+
* The Studio project ID comes from the local binding (.aexol/aexol.jsonc),
|
|
11
|
+
* falling back to an explicit kanban_project_id flag.
|
|
12
|
+
*
|
|
13
|
+
* Registered tools:
|
|
14
|
+
* - kanban_list — List all Kanban tasks for the project
|
|
15
|
+
* - kanban_get — Get a single task by ID
|
|
16
|
+
* - kanban_create — Create a new Kanban task
|
|
17
|
+
* - kanban_update — Update a task (title, description, priority, tags)
|
|
18
|
+
* - kanban_move — Move a task between columns (BACKLOG → TODO → IN_PROGRESS → DONE)
|
|
19
|
+
* - kanban_next — Pick the next TODO task and mark it IN_PROGRESS
|
|
20
|
+
* - kanban_delete — Delete a task
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Send a GraphQL query/mutation to the Aexol backend.
|
|
24
|
+
* Uses the same auth and endpoint as the Studio frontend.
|
|
25
|
+
*/
|
|
26
|
+
async function graphqlRequest(opts, query, variables) {
|
|
27
|
+
const body = JSON.stringify({ query, variables });
|
|
28
|
+
const res = await fetch(`${opts.backendUrl}/graphql`, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers: {
|
|
31
|
+
"Content-Type": "application/json",
|
|
32
|
+
Accept: "application/json",
|
|
33
|
+
Authorization: `Bearer ${opts.token}`,
|
|
34
|
+
},
|
|
35
|
+
body,
|
|
36
|
+
signal: AbortSignal.timeout(opts.timeoutMs ?? 15_000),
|
|
37
|
+
});
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
let detail = "";
|
|
40
|
+
try {
|
|
41
|
+
detail = (await res.text()).slice(0, 300);
|
|
42
|
+
}
|
|
43
|
+
catch { /* ignore */ }
|
|
44
|
+
throw new GraphQLError(`HTTP ${res.status} from GraphQL${detail ? `: ${detail}` : ""}`);
|
|
45
|
+
}
|
|
46
|
+
const json = (await res.json());
|
|
47
|
+
if (json.errors && json.errors.length > 0) {
|
|
48
|
+
throw new GraphQLError(json.errors.map((e) => e.message).join("; "));
|
|
49
|
+
}
|
|
50
|
+
if (!json.data) {
|
|
51
|
+
throw new GraphQLError("GraphQL response missing data");
|
|
52
|
+
}
|
|
53
|
+
return json.data;
|
|
54
|
+
}
|
|
55
|
+
class GraphQLError extends Error {
|
|
56
|
+
constructor(message) {
|
|
57
|
+
super(message);
|
|
58
|
+
this.name = "GraphQLError";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// GraphQL fragments (minimal inline selectors — no codegen dependency)
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
const KANBAN_TASK_FRAGMENT = `
|
|
65
|
+
id
|
|
66
|
+
projectId
|
|
67
|
+
column
|
|
68
|
+
title
|
|
69
|
+
description
|
|
70
|
+
priority
|
|
71
|
+
sortOrder
|
|
72
|
+
tags
|
|
73
|
+
createdAt
|
|
74
|
+
updatedAt
|
|
75
|
+
completedAt
|
|
76
|
+
assignee { id username email }
|
|
77
|
+
`;
|
|
78
|
+
const KANBAN_TASK_FRAGMENT_LIGHT = `
|
|
79
|
+
id
|
|
80
|
+
column
|
|
81
|
+
title
|
|
82
|
+
priority
|
|
83
|
+
tags
|
|
84
|
+
`;
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// GraphQL operations
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
async function listKanbanTasks(opts) {
|
|
89
|
+
const data = await graphqlRequest(opts, `query($projectId: ID!) {
|
|
90
|
+
kanbanTasks(projectId: $projectId, limit: 500) {
|
|
91
|
+
${KANBAN_TASK_FRAGMENT_LIGHT}
|
|
92
|
+
}
|
|
93
|
+
}`, { projectId: opts.projectId });
|
|
94
|
+
return data.kanbanTasks;
|
|
95
|
+
}
|
|
96
|
+
async function getKanbanTask(opts, taskId) {
|
|
97
|
+
// There's no single-task query, so fetch all and filter
|
|
98
|
+
const data = await graphqlRequest(opts, `query($projectId: ID!) {
|
|
99
|
+
kanbanTasks(projectId: $projectId, limit: 500) {
|
|
100
|
+
${KANBAN_TASK_FRAGMENT}
|
|
101
|
+
}
|
|
102
|
+
}`, { projectId: opts.projectId });
|
|
103
|
+
const task = data.kanbanTasks.find((t) => t.id === taskId);
|
|
104
|
+
if (!task)
|
|
105
|
+
throw new GraphQLError(`Task not found: ${taskId}`);
|
|
106
|
+
return task;
|
|
107
|
+
}
|
|
108
|
+
async function createKanbanTask(opts, input) {
|
|
109
|
+
const data = await graphqlRequest(opts, `mutation($input: CreateKanbanTaskInput!) {
|
|
110
|
+
createKanbanTask(input: $input) {
|
|
111
|
+
${KANBAN_TASK_FRAGMENT}
|
|
112
|
+
}
|
|
113
|
+
}`, {
|
|
114
|
+
input: {
|
|
115
|
+
projectId: opts.projectId,
|
|
116
|
+
title: input.title,
|
|
117
|
+
description: input.description ?? null,
|
|
118
|
+
column: input.column ?? "BACKLOG",
|
|
119
|
+
priority: input.priority ?? 0,
|
|
120
|
+
tags: input.tags ?? null,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
return data.createKanbanTask;
|
|
124
|
+
}
|
|
125
|
+
async function updateKanbanTask(opts, taskId, input) {
|
|
126
|
+
const data = await graphqlRequest(opts, `mutation($id: ID!, $input: UpdateKanbanTaskInput!) {
|
|
127
|
+
updateKanbanTask(id: $id, input: $input) {
|
|
128
|
+
${KANBAN_TASK_FRAGMENT}
|
|
129
|
+
}
|
|
130
|
+
}`, {
|
|
131
|
+
id: taskId,
|
|
132
|
+
input: {
|
|
133
|
+
title: input.title ?? undefined,
|
|
134
|
+
description: input.description ?? undefined,
|
|
135
|
+
column: input.column ?? undefined,
|
|
136
|
+
priority: input.priority ?? undefined,
|
|
137
|
+
tags: input.tags ?? undefined,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
return data.updateKanbanTask;
|
|
141
|
+
}
|
|
142
|
+
async function moveKanbanTask(opts, taskId, targetColumn, targetSortOrder) {
|
|
143
|
+
const data = await graphqlRequest(opts, `mutation($input: MoveKanbanTaskInput!) {
|
|
144
|
+
moveKanbanTask(input: $input) {
|
|
145
|
+
${KANBAN_TASK_FRAGMENT}
|
|
146
|
+
}
|
|
147
|
+
}`, {
|
|
148
|
+
input: {
|
|
149
|
+
taskId,
|
|
150
|
+
targetColumn,
|
|
151
|
+
targetSortOrder,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
return data.moveKanbanTask;
|
|
155
|
+
}
|
|
156
|
+
async function deleteKanbanTask(opts, taskId) {
|
|
157
|
+
await graphqlRequest(opts, `mutation($id: ID!) {
|
|
158
|
+
deleteKanbanTask(id: $id)
|
|
159
|
+
}`, { id: taskId });
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
// Config resolution
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
import { readConfig } from "../config.js";
|
|
166
|
+
import { readStudioBinding } from "../studio-binding.js";
|
|
167
|
+
import { getConfigFile } from "../config.js";
|
|
168
|
+
async function resolveKanbanConfig(explicitProjectId) {
|
|
169
|
+
const cfg = await readConfig();
|
|
170
|
+
if (!cfg) {
|
|
171
|
+
process.stderr.write(`[kanban-bridge] No config found at ${getConfigFile()}. Run \`spectral login\`.\n`);
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
const token = cfg.teamApiKey || cfg.userJwt || "";
|
|
175
|
+
if (!token) {
|
|
176
|
+
process.stderr.write(`[kanban-bridge] No auth token in config. Run \`spectral login\`.\n`);
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
// Resolve backend URL — the config stores the MCP URL, we need the base
|
|
180
|
+
const backendUrl = cfg.apiUrl.replace(/\/mcp$/, "");
|
|
181
|
+
// Resolve projectId: explicit param > studio binding
|
|
182
|
+
let projectId = explicitProjectId || null;
|
|
183
|
+
if (!projectId) {
|
|
184
|
+
try {
|
|
185
|
+
const binding = await readStudioBinding();
|
|
186
|
+
if (binding?.projectId) {
|
|
187
|
+
projectId = binding.projectId;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// ignore
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (!projectId) {
|
|
195
|
+
process.stderr.write(`[kanban-bridge] No projectId available. Bind a project via \`spectral bind <project-id>\` or pass projectId explicitly.\n`);
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
return { token, backendUrl, projectId };
|
|
199
|
+
}
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
// Tool: kanban_list
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
const kanbanListTool = {
|
|
204
|
+
name: "kanban_list",
|
|
205
|
+
label: "List Kanban Tasks",
|
|
206
|
+
description: [
|
|
207
|
+
"List all Kanban tasks for the bound Studio project.",
|
|
208
|
+
"Returns tasks grouped by column: BACKLOG, TODO, IN_PROGRESS, DONE.",
|
|
209
|
+
"Use this to see what work is planned and what's currently in progress.",
|
|
210
|
+
].join(" "),
|
|
211
|
+
parameters: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
column: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "Optional: filter by column (BACKLOG, TODO, IN_PROGRESS, DONE). If omitted, returns all tasks.",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
async execute(_toolCallId, params) {
|
|
221
|
+
const p = params;
|
|
222
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
223
|
+
if (!cfg) {
|
|
224
|
+
return {
|
|
225
|
+
content: [{ type: "text", text: "Error: Kanban bridge not configured. Run `spectral login` and `spectral bind <project-id>`." }],
|
|
226
|
+
details: { isError: true },
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
const allTasks = await listKanbanTasks(cfg);
|
|
231
|
+
// Group by column
|
|
232
|
+
const groups = {
|
|
233
|
+
BACKLOG: [],
|
|
234
|
+
TODO: [],
|
|
235
|
+
IN_PROGRESS: [],
|
|
236
|
+
DONE: [],
|
|
237
|
+
};
|
|
238
|
+
for (const task of allTasks) {
|
|
239
|
+
(groups[task.column] ??= []).push(task);
|
|
240
|
+
}
|
|
241
|
+
if (p.column && groups[p.column]) {
|
|
242
|
+
const col = groups[p.column];
|
|
243
|
+
const lines = [`## ${p.column} (${col.length} tasks)`, ""];
|
|
244
|
+
for (const t of col) {
|
|
245
|
+
lines.push(`- **[${t.id}]** ${t.title} (priority: ${t.priority}${t.tags ? `, tags: ${t.tags}` : ""})`);
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
249
|
+
details: {},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const lines = [`## Kanban Board — Project ${cfg.projectId}`, `Total: ${allTasks.length} tasks`, ""];
|
|
253
|
+
for (const [col, tasks] of Object.entries(groups)) {
|
|
254
|
+
if (tasks.length === 0) {
|
|
255
|
+
lines.push(`### ${col} — empty`);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
lines.push(`### ${col} (${tasks.length})`);
|
|
259
|
+
for (const t of tasks) {
|
|
260
|
+
lines.push(`- **[${t.id}]** ${t.title} (priority: ${t.priority}${t.tags ? `, tags: ${t.tags}` : ""})`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
lines.push("");
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
267
|
+
details: {},
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
272
|
+
return {
|
|
273
|
+
content: [{ type: "text", text: `Error listing tasks: ${msg}` }],
|
|
274
|
+
details: { isError: true },
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
// ---------------------------------------------------------------------------
|
|
280
|
+
// Tool: kanban_get
|
|
281
|
+
// ---------------------------------------------------------------------------
|
|
282
|
+
const kanbanGetTool = {
|
|
283
|
+
name: "kanban_get",
|
|
284
|
+
label: "Get Kanban Task",
|
|
285
|
+
description: "Get full details for a specific Kanban task by ID.",
|
|
286
|
+
parameters: {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
taskId: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "The Kanban task ID (from kanban_list output)",
|
|
292
|
+
},
|
|
293
|
+
projectId: {
|
|
294
|
+
type: "string",
|
|
295
|
+
description: "Optional: override the default project ID",
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
required: ["taskId"],
|
|
299
|
+
},
|
|
300
|
+
async execute(_toolCallId, params) {
|
|
301
|
+
const p = params;
|
|
302
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
303
|
+
if (!cfg) {
|
|
304
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
const task = await getKanbanTask(cfg, p.taskId);
|
|
308
|
+
const lines = [
|
|
309
|
+
`## Task: ${task.title}`,
|
|
310
|
+
`ID: ${task.id}`,
|
|
311
|
+
`Column: ${task.column}`,
|
|
312
|
+
`Priority: ${task.priority}`,
|
|
313
|
+
`Tags: ${task.tags ?? "(none)"}`,
|
|
314
|
+
`Created: ${task.createdAt}`,
|
|
315
|
+
`Updated: ${task.updatedAt}`,
|
|
316
|
+
task.completedAt ? `Completed: ${task.completedAt}` : null,
|
|
317
|
+
task.assignee ? `Assignee: ${task.assignee.username} (${task.assignee.email})` : "Assignee: unassigned",
|
|
318
|
+
"",
|
|
319
|
+
"### Description",
|
|
320
|
+
task.description ?? "(no description)",
|
|
321
|
+
];
|
|
322
|
+
return {
|
|
323
|
+
content: [{ type: "text", text: lines.filter(Boolean).join("\n") }],
|
|
324
|
+
details: {},
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
catch (err) {
|
|
328
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
329
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], details: { isError: true } };
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
// ---------------------------------------------------------------------------
|
|
334
|
+
// Tool: kanban_create
|
|
335
|
+
// ---------------------------------------------------------------------------
|
|
336
|
+
const kanbanCreateTool = {
|
|
337
|
+
name: "kanban_create",
|
|
338
|
+
label: "Create Kanban Task",
|
|
339
|
+
description: "Create a new Kanban task on the board.",
|
|
340
|
+
parameters: {
|
|
341
|
+
type: "object",
|
|
342
|
+
properties: {
|
|
343
|
+
title: { type: "string", description: "Task title" },
|
|
344
|
+
description: { type: "string", description: "Detailed task description including acceptance criteria" },
|
|
345
|
+
column: { type: "string", description: "Column: BACKLOG (default), TODO, IN_PROGRESS, DONE" },
|
|
346
|
+
priority: { type: "number", description: "Priority 0-100. Higher = more urgent." },
|
|
347
|
+
tags: { type: "string", description: "Comma-separated tags: auth,api,frontend,backend,testing" },
|
|
348
|
+
projectId: { type: "string", description: "Optional: override the default project ID" },
|
|
349
|
+
},
|
|
350
|
+
required: ["title", "description"],
|
|
351
|
+
},
|
|
352
|
+
async execute(_toolCallId, params) {
|
|
353
|
+
const p = params;
|
|
354
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
355
|
+
if (!cfg) {
|
|
356
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
const task = await createKanbanTask(cfg, {
|
|
360
|
+
title: p.title,
|
|
361
|
+
description: p.description,
|
|
362
|
+
column: p.column ?? "BACKLOG",
|
|
363
|
+
priority: p.priority ?? 0,
|
|
364
|
+
tags: p.tags,
|
|
365
|
+
});
|
|
366
|
+
return {
|
|
367
|
+
content: [{
|
|
368
|
+
type: "text",
|
|
369
|
+
text: `✓ Created task "${task.title}" (${task.id}) in ${task.column}`,
|
|
370
|
+
}],
|
|
371
|
+
details: {},
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
catch (err) {
|
|
375
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
376
|
+
return { content: [{ type: "text", text: `Error creating task: ${msg}` }], details: { isError: true } };
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
};
|
|
380
|
+
// ---------------------------------------------------------------------------
|
|
381
|
+
// Tool: kanban_update
|
|
382
|
+
// ---------------------------------------------------------------------------
|
|
383
|
+
const kanbanUpdateTool = {
|
|
384
|
+
name: "kanban_update",
|
|
385
|
+
label: "Update Kanban Task",
|
|
386
|
+
description: "Update a Kanban task's metadata (title, description, priority, tags). To move between columns, use kanban_move.",
|
|
387
|
+
parameters: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: {
|
|
390
|
+
taskId: { type: "string", description: "The Kanban task ID" },
|
|
391
|
+
title: { type: "string", description: "New title" },
|
|
392
|
+
description: { type: "string", description: "Updated description with results/progress" },
|
|
393
|
+
priority: { type: "number", description: "Updated priority 0-100" },
|
|
394
|
+
tags: { type: "string", description: "Updated comma-separated tags" },
|
|
395
|
+
projectId: { type: "string", description: "Optional: override the default project ID" },
|
|
396
|
+
},
|
|
397
|
+
required: ["taskId"],
|
|
398
|
+
},
|
|
399
|
+
async execute(_toolCallId, params) {
|
|
400
|
+
const p = params;
|
|
401
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
402
|
+
if (!cfg) {
|
|
403
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
404
|
+
}
|
|
405
|
+
try {
|
|
406
|
+
const input = {};
|
|
407
|
+
if (p.title !== undefined)
|
|
408
|
+
input.title = p.title;
|
|
409
|
+
if (p.description !== undefined)
|
|
410
|
+
input.description = p.description;
|
|
411
|
+
if (p.priority !== undefined)
|
|
412
|
+
input.priority = p.priority;
|
|
413
|
+
if (p.tags !== undefined)
|
|
414
|
+
input.tags = p.tags;
|
|
415
|
+
if (Object.keys(input).length === 0) {
|
|
416
|
+
return { content: [{ type: "text", text: "No changes provided. Specify at least one field to update." }], details: { isError: true } };
|
|
417
|
+
}
|
|
418
|
+
const task = await updateKanbanTask(cfg, p.taskId, input);
|
|
419
|
+
return {
|
|
420
|
+
content: [{ type: "text", text: `✓ Updated task "${task.title}" (${task.id})` }],
|
|
421
|
+
details: {},
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
catch (err) {
|
|
425
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
426
|
+
return { content: [{ type: "text", text: `Error updating task: ${msg}` }], details: { isError: true } };
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
};
|
|
430
|
+
// ---------------------------------------------------------------------------
|
|
431
|
+
// Tool: kanban_move
|
|
432
|
+
// ---------------------------------------------------------------------------
|
|
433
|
+
const kanbanMoveTool = {
|
|
434
|
+
name: "kanban_move",
|
|
435
|
+
label: "Move Kanban Task",
|
|
436
|
+
description: [
|
|
437
|
+
"Move a Kanban task between columns.",
|
|
438
|
+
"BACKLOG → TODO → IN_PROGRESS → DONE.",
|
|
439
|
+
"Moving to DONE automatically sets the completedAt timestamp.",
|
|
440
|
+
"Use this to reflect actual progress on the board.",
|
|
441
|
+
].join(" "),
|
|
442
|
+
parameters: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {
|
|
445
|
+
taskId: { type: "string", description: "The Kanban task ID" },
|
|
446
|
+
targetColumn: { type: "string", description: "Target column: BACKLOG, TODO, IN_PROGRESS, DONE" },
|
|
447
|
+
sortOrder: { type: "number", description: "Position within the target column (0 = top). Defaults to 0 (top of column)." },
|
|
448
|
+
projectId: { type: "string", description: "Optional: override the default project ID" },
|
|
449
|
+
},
|
|
450
|
+
required: ["taskId", "targetColumn"],
|
|
451
|
+
},
|
|
452
|
+
async execute(_toolCallId, params) {
|
|
453
|
+
const p = params;
|
|
454
|
+
const validColumns = ["BACKLOG", "TODO", "IN_PROGRESS", "DONE"];
|
|
455
|
+
if (!validColumns.includes(p.targetColumn)) {
|
|
456
|
+
return {
|
|
457
|
+
content: [{ type: "text", text: `Invalid column "${p.targetColumn}". Must be one of: ${validColumns.join(", ")}` }],
|
|
458
|
+
details: { isError: true },
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
462
|
+
if (!cfg) {
|
|
463
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
const task = await moveKanbanTask(cfg, p.taskId, p.targetColumn, p.sortOrder ?? 0);
|
|
467
|
+
return {
|
|
468
|
+
content: [{
|
|
469
|
+
type: "text",
|
|
470
|
+
text: `✓ Moved "${task.title}" from ${task.column !== p.targetColumn ? "to " : "within "}${p.targetColumn}`,
|
|
471
|
+
}],
|
|
472
|
+
details: {},
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
catch (err) {
|
|
476
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
477
|
+
return { content: [{ type: "text", text: `Error moving task: ${msg}` }], details: { isError: true } };
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
// ---------------------------------------------------------------------------
|
|
482
|
+
// Tool: kanban_next — pick next TODO, mark IN_PROGRESS
|
|
483
|
+
// ---------------------------------------------------------------------------
|
|
484
|
+
const kanbanNextTool = {
|
|
485
|
+
name: "kanban_next",
|
|
486
|
+
label: "Start Next Kanban Task",
|
|
487
|
+
description: [
|
|
488
|
+
"Pick the next-highest-priority TODO task, mark it IN_PROGRESS, and return its details.",
|
|
489
|
+
"This is the primary task-driven execution tool: call it when you're ready to start working on the next planned task.",
|
|
490
|
+
"The agent should call this, work on the task, then call kanban_move to DONE when finished.",
|
|
491
|
+
].join(" "),
|
|
492
|
+
parameters: {
|
|
493
|
+
type: "object",
|
|
494
|
+
properties: {
|
|
495
|
+
taskId: { type: "string", description: "Optional: start a specific task by ID instead of auto-selecting the next one." },
|
|
496
|
+
projectId: { type: "string", description: "Optional: override the default project ID" },
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
async execute(_toolCallId, params) {
|
|
500
|
+
const p = params;
|
|
501
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
502
|
+
if (!cfg) {
|
|
503
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
504
|
+
}
|
|
505
|
+
try {
|
|
506
|
+
const allTasks = await listKanbanTasks(cfg);
|
|
507
|
+
// If a specific task ID is given, start that one
|
|
508
|
+
if (p.taskId) {
|
|
509
|
+
const task = allTasks.find((t) => t.id === p.taskId);
|
|
510
|
+
if (!task) {
|
|
511
|
+
return { content: [{ type: "text", text: `Task not found: ${p.taskId}` }], details: { isError: true } };
|
|
512
|
+
}
|
|
513
|
+
if (task.column !== "TODO" && task.column !== "BACKLOG") {
|
|
514
|
+
return {
|
|
515
|
+
content: [{ type: "text", text: `Task "${task.title}" is already in ${task.column}. Only TODO or BACKLOG tasks can be started.` }],
|
|
516
|
+
details: { isError: true },
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
const moved = await moveKanbanTask(cfg, p.taskId, "IN_PROGRESS", 0);
|
|
520
|
+
const fullTask = await getKanbanTask(cfg, p.taskId);
|
|
521
|
+
const lines = [
|
|
522
|
+
`## Started: ${fullTask.title}`,
|
|
523
|
+
`ID: ${fullTask.id}`,
|
|
524
|
+
`Priority: ${fullTask.priority}`,
|
|
525
|
+
`Tags: ${fullTask.tags ?? "(none)"}`,
|
|
526
|
+
"",
|
|
527
|
+
"### Description",
|
|
528
|
+
fullTask.description ?? "(no description)",
|
|
529
|
+
"",
|
|
530
|
+
"### Instructions",
|
|
531
|
+
"1. Read and understand the task description above",
|
|
532
|
+
"2. Implement the required changes using your tools (read, write, edit, bash)",
|
|
533
|
+
"3. Test your changes when applicable",
|
|
534
|
+
`4. When done, call kanban_move to mark this task as DONE`,
|
|
535
|
+
"5. Then call kanban_next to start the next task (if any)",
|
|
536
|
+
];
|
|
537
|
+
return { content: [{ type: "text", text: lines.join("\n") }], details: {} };
|
|
538
|
+
}
|
|
539
|
+
// Auto-select: pick the highest-priority TODO task
|
|
540
|
+
const todoTasks = allTasks
|
|
541
|
+
.filter((t) => t.column === "TODO")
|
|
542
|
+
.sort((a, b) => b.priority - a.priority);
|
|
543
|
+
if (todoTasks.length === 0) {
|
|
544
|
+
// Check BACKLOG as fallback
|
|
545
|
+
const backlogTasks = allTasks
|
|
546
|
+
.filter((t) => t.column === "BACKLOG")
|
|
547
|
+
.sort((a, b) => b.priority - a.priority);
|
|
548
|
+
if (backlogTasks.length === 0) {
|
|
549
|
+
return {
|
|
550
|
+
content: [{ type: "text", text: "No TODO or BACKLOG tasks available. All tasks may be IN_PROGRESS or DONE. Use kanban_list to check the board." }],
|
|
551
|
+
details: {},
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
// Move the first BACKLOG task to TODO, then start it
|
|
555
|
+
const next = backlogTasks[0];
|
|
556
|
+
await moveKanbanTask(cfg, next.id, "TODO", 0);
|
|
557
|
+
await moveKanbanTask(cfg, next.id, "IN_PROGRESS", 0);
|
|
558
|
+
const fullTask = await getKanbanTask(cfg, next.id);
|
|
559
|
+
const lines = [
|
|
560
|
+
`## Started (from BACKLOG): ${fullTask.title}`,
|
|
561
|
+
`ID: ${fullTask.id}`,
|
|
562
|
+
`Priority: ${fullTask.priority}`,
|
|
563
|
+
`Tags: ${fullTask.tags ?? "(none)"}`,
|
|
564
|
+
"",
|
|
565
|
+
"### Description",
|
|
566
|
+
fullTask.description ?? "(no description)",
|
|
567
|
+
"",
|
|
568
|
+
`Remaining TODO tasks: ${todoTasks.length}. Backlog: ${backlogTasks.length - 1}.`,
|
|
569
|
+
];
|
|
570
|
+
return { content: [{ type: "text", text: lines.join("\n") }], details: {} };
|
|
571
|
+
}
|
|
572
|
+
// Start the highest-priority TODO
|
|
573
|
+
const next = todoTasks[0];
|
|
574
|
+
const moved = await moveKanbanTask(cfg, next.id, "IN_PROGRESS", 0);
|
|
575
|
+
const fullTask = await getKanbanTask(cfg, next.id);
|
|
576
|
+
const lines = [
|
|
577
|
+
`## Started: ${fullTask.title}`,
|
|
578
|
+
`ID: ${fullTask.id}`,
|
|
579
|
+
`Priority: ${fullTask.priority}`,
|
|
580
|
+
`Tags: ${fullTask.tags ?? "(none)"}`,
|
|
581
|
+
"",
|
|
582
|
+
"### Description",
|
|
583
|
+
fullTask.description ?? "(no description)",
|
|
584
|
+
"",
|
|
585
|
+
"### Instructions",
|
|
586
|
+
"1. Read and understand the task description above",
|
|
587
|
+
"2. Implement the required changes using your tools (read, write, edit, bash)",
|
|
588
|
+
"3. Test your changes when applicable",
|
|
589
|
+
`4. When done, call kanban_move to mark this task as DONE`,
|
|
590
|
+
"5. Then call kanban_next to start the next task (if any)",
|
|
591
|
+
"",
|
|
592
|
+
`Remaining TODO tasks: ${todoTasks.length - 1}`,
|
|
593
|
+
];
|
|
594
|
+
return { content: [{ type: "text", text: lines.join("\n") }], details: {} };
|
|
595
|
+
}
|
|
596
|
+
catch (err) {
|
|
597
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
598
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], details: { isError: true } };
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
};
|
|
602
|
+
// ---------------------------------------------------------------------------
|
|
603
|
+
// Tool: kanban_delete
|
|
604
|
+
// ---------------------------------------------------------------------------
|
|
605
|
+
const kanbanDeleteTool = {
|
|
606
|
+
name: "kanban_delete",
|
|
607
|
+
label: "Delete Kanban Task",
|
|
608
|
+
description: "Delete a Kanban task from the board.",
|
|
609
|
+
parameters: {
|
|
610
|
+
type: "object",
|
|
611
|
+
properties: {
|
|
612
|
+
taskId: { type: "string", description: "The Kanban task ID to delete" },
|
|
613
|
+
projectId: { type: "string", description: "Optional: override the default project ID" },
|
|
614
|
+
},
|
|
615
|
+
required: ["taskId"],
|
|
616
|
+
},
|
|
617
|
+
async execute(_toolCallId, params) {
|
|
618
|
+
const p = params;
|
|
619
|
+
const cfg = await resolveKanbanConfig(p.projectId);
|
|
620
|
+
if (!cfg) {
|
|
621
|
+
return { content: [{ type: "text", text: "Error: Kanban bridge not configured." }], details: { isError: true } };
|
|
622
|
+
}
|
|
623
|
+
try {
|
|
624
|
+
await deleteKanbanTask(cfg, p.taskId);
|
|
625
|
+
return {
|
|
626
|
+
content: [{ type: "text", text: `✓ Deleted task ${p.taskId}` }],
|
|
627
|
+
details: {},
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
catch (err) {
|
|
631
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
632
|
+
return { content: [{ type: "text", text: `Error deleting task: ${msg}` }], details: { isError: true } };
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
};
|
|
636
|
+
// ---------------------------------------------------------------------------
|
|
637
|
+
// Extension entry point
|
|
638
|
+
// ---------------------------------------------------------------------------
|
|
639
|
+
export default async function kanbanBridgeExtension(pi) {
|
|
640
|
+
const tools = [
|
|
641
|
+
kanbanListTool,
|
|
642
|
+
kanbanGetTool,
|
|
643
|
+
kanbanCreateTool,
|
|
644
|
+
kanbanUpdateTool,
|
|
645
|
+
kanbanMoveTool,
|
|
646
|
+
kanbanNextTool,
|
|
647
|
+
kanbanDeleteTool,
|
|
648
|
+
];
|
|
649
|
+
let registered = 0;
|
|
650
|
+
for (const tool of tools) {
|
|
651
|
+
try {
|
|
652
|
+
pi.registerTool(tool);
|
|
653
|
+
registered++;
|
|
654
|
+
}
|
|
655
|
+
catch (err) {
|
|
656
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
657
|
+
process.stderr.write(`[kanban-bridge] Failed to register tool "${tool.name}": ${msg}\n`);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
// Verify config is resolvable on startup (non-fatal — tools work lazily too)
|
|
661
|
+
const cfg = await resolveKanbanConfig();
|
|
662
|
+
if (cfg) {
|
|
663
|
+
process.stderr.write(`[kanban-bridge] Registered ${registered} Kanban tool(s). Connected to project ${cfg.projectId}.\n`);
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
process.stderr.write(`[kanban-bridge] Registered ${registered} Kanban tool(s). No project bound yet — tools will work once kanban_project_id or studio binding is available.\n`);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenRouter App Attribution extension.
|
|
3
|
+
*
|
|
4
|
+
* Adds HTTP headers required by OpenRouter's app attribution system so that
|
|
5
|
+
* Aexol / Spectral appears in OpenRouter rankings, analytics, and model
|
|
6
|
+
* "Apps" tabs. Without these headers our usage is anonymous to OpenRouter.
|
|
7
|
+
*
|
|
8
|
+
* @see https://openrouter.ai/docs/app-attribution
|
|
9
|
+
*/
|
|
10
|
+
import type { ExtensionAPI } from "../sdk/coding-agent/index.js";
|
|
11
|
+
export default function openrouterAttributionExtension(pi: ExtensionAPI): void;
|
|
12
|
+
//# sourceMappingURL=openrouter-attribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openrouter-attribution.d.ts","sourceRoot":"","sources":["../../src/extensions/openrouter-attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAU7E"}
|