c200fe0f86
CI / lint (push) Successful in 18s
CI / unit_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / build (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / security (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / helm (push) Has been cancelled
CI / quality (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / status-check (push) Has been cancelled
CI / benchmark-regression (push) Has been cancelled
CI / docker (push) Has been cancelled
Add hover and definition support to LspClient and LspRuntime. - LspClient.get_hover(): sends textDocument/hover, returns Hover dict or None - LspClient.get_definitions(): sends textDocument/definition, handles Location, Location[], and LocationLink[] responses - LspRuntime wrappers: input validation, file reading, language detection, 1-based to 0-based line/column conversion - try/finally for did_close() safety on both new methods - Tool adapter: HOVER and DEFINITIONS dispatch to runtime instead of raising LspNotAvailableError - Updated lsp_tool_adapter_coverage test (HOVER -> REFERENCES) - 21 Behave BDD scenarios with full path coverage Closes #1243 Co-authored-by: Hamza Khyari <hamza.khyari@cleverthis.com> Co-committed-by: Hamza Khyari <hamza.khyari@cleverthis.com>
109 lines
5.3 KiB
Gherkin
109 lines
5.3 KiB
Gherkin
Feature: Resource and LSP CLI missing flags (issue #904)
|
|
As a CleverAgents user
|
|
I want the CLI to support all specification-defined flags
|
|
So that I can fully manage resources and LSP servers per the spec
|
|
|
|
# ---- resource add --update ----
|
|
|
|
Scenario: Add a resource with --update re-registers it
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
And I add a resource flags resource "git-checkout" named "local/upd-test" with path "/tmp/u1"
|
|
When I run resource flags add "git-checkout" "local/upd-test" with path "/tmp/u2" and update
|
|
Then the resource flags output should contain "Added resource"
|
|
And the resource flags output should contain "local/upd-test"
|
|
|
|
Scenario: Add with --update when resource does not yet exist
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags add "git-checkout" "local/new-upd" with path "/tmp/nu" and update
|
|
Then the resource flags output should contain "Added resource"
|
|
|
|
# ---- resource add --mount (container types) ----
|
|
|
|
Scenario: Mount flag rejected for non-container type
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags add "git-checkout" "local/bad-mount" with path "/tmp/bm" and mount "local/repo:/workspace"
|
|
Then the resource flags command should fail
|
|
And the resource flags output should contain "container types"
|
|
|
|
# ---- resource add --clone-into ----
|
|
|
|
Scenario: Clone-into flag rejected for non-container type
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags add "git-checkout" "local/bad-clone" with path "/tmp/bc" and clone-into "https://example.com/repo.git:/workspace"
|
|
Then the resource flags command should fail
|
|
And the resource flags output should contain "container resource types"
|
|
|
|
Scenario: Clone-into flag with invalid format
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags add "container-instance" "local/bad-fmt" with clone-into "no-colon-here"
|
|
Then the resource flags command should fail
|
|
And the resource flags output should contain "REPO_URL"
|
|
|
|
# ---- resource list --all ----
|
|
|
|
Scenario: Resource list default excludes auto-discovered resources
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
And a user-added resource flags resource "git-checkout" named "local/user-res" with path "/tmp/ur"
|
|
And an auto-discovered resource flags resource named "local/auto-res"
|
|
When I run resource flags list
|
|
Then the resource flags output should contain "local/user-res"
|
|
And the resource flags output should not contain "local/auto-res"
|
|
|
|
Scenario: Resource list --all includes auto-discovered resources
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
And a user-added resource flags resource "git-checkout" named "local/user-res2" with path "/tmp/ur2"
|
|
And an auto-discovered resource flags resource named "local/auto-res2"
|
|
When I run resource flags list with --all
|
|
Then the resource flags output should contain "local/user-res2"
|
|
And the resource flags output should contain "local/auto-res2"
|
|
|
|
# ---- resource tree --depth default ----
|
|
|
|
Scenario: Tree depth defaults to 3
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
And a resource flags resource "git-checkout" named "local/depth-root" with path "/tmp/dr"
|
|
When I run resource flags tree for "local/depth-root" with default depth
|
|
Then the resource flags tree depth used should be 3
|
|
|
|
# ---- resource type list [REGEX] ----
|
|
|
|
Scenario: Resource type list with regex filter
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags type list with regex "git"
|
|
Then the resource flags output should contain "git-checkout"
|
|
And the resource flags output should not contain "fs-directory"
|
|
|
|
Scenario: Resource type list without regex shows all
|
|
Given a fresh resource flags test registry
|
|
And resource flags built-in types are bootstrapped
|
|
When I run resource flags type list without regex
|
|
Then the resource flags output should contain "git-checkout"
|
|
And the resource flags output should contain "fs-directory"
|
|
|
|
# ---- lsp list [REGEX] ----
|
|
|
|
Scenario: LSP list with regex filter
|
|
Given a clean LSP flags test environment
|
|
And a registered LSP flags server "local/pyright-test" for language "python"
|
|
And a registered LSP flags server "local/clangd-test" for language "cpp"
|
|
When I run lsp flags list with regex "pyright"
|
|
Then the lsp flags output should contain "local/pyright-test"
|
|
And the lsp flags output should not contain "local/clangd-test"
|
|
|
|
Scenario: LSP list without regex shows all
|
|
Given a clean LSP flags test environment
|
|
And a registered LSP flags server "local/pyright-test2" for language "python"
|
|
And a registered LSP flags server "local/clangd-test2" for language "cpp"
|
|
When I run lsp flags list without regex
|
|
Then the lsp flags output should contain "local/pyright-test2"
|
|
And the lsp flags output should contain "local/clangd-test2"
|