@zvec/zvec-grep 0.2.0 → 0.2.1

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/docs/01-agents.md CHANGED
@@ -17,13 +17,22 @@ managed-rg route.
17
17
  | Codex | `codex` | `~/.codex/config.toml` and `~/.codex/AGENTS.md` |
18
18
  | Claude Code | `claude` | `~/.claude.json`, `~/.claude/settings.json`, and `~/.claude/CLAUDE.md` |
19
19
  | Qwen Code | `qwen` | `~/.qwen/settings.json` and `~/.qwen/QWEN.md` |
20
+ | Qoder CLI and IDE | `qoder` | `~/.qoder/settings.json`, `~/.qoder/AGENTS.md`, and the IDE user-level `~/.qoder/mcp.json` |
20
21
  | OpenCode | `opencode` | `~/.config/opencode/opencode.json` and the adjacent `AGENTS.md` |
21
22
  | Cursor | `cursor` | `~/.cursor/mcp.json` |
22
23
 
23
24
  The standard environment overrides used by each agent are respected, including
24
- `CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `QWEN_HOME`, `OPENCODE_CONFIG`, and
25
+ `CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `QWEN_HOME`, `QODER_CONFIG_DIR`,
26
+ `QODER_IDE_MCP_PATH`, `QODER_IDE_EXECUTABLE`, `OPENCODE_CONFIG`, and
25
27
  `CURSOR_CONFIG_DIR`.
26
28
 
29
+ The current Qoder CLI package exposes both `qoder` and `qodercli` commands, but
30
+ the installer exposes only the canonical `qoder` target. One Qoder install
31
+ configures both the CLI and IDE, and automatic detection recognizes either CLI
32
+ executable or the IDE. `QODER_CONFIG_DIR` overrides the Qoder CLI configuration
33
+ directory; `QODER_IDE_MCP_PATH` independently overrides the full IDE `mcp.json` path, and
34
+ `QODER_IDE_EXECUTABLE` overrides the IDE executable used by automatic detection.
35
+
27
36
  ## Install an integration
28
37
 
29
38
  Run the guided installer to select from detected agents:
@@ -38,6 +47,7 @@ For scripts or repeatable setup, select targets explicitly:
38
47
  zg install --target codex --yes
39
48
  zg install --target claude --target cursor --yes
40
49
  zg install --target qwen --yes
50
+ zg install --target qoder --yes
41
51
  zg install --target all --yes
42
52
  ```
43
53
 
@@ -45,16 +55,73 @@ The installer:
45
55
 
46
56
  1. adds a managed `zvec_grep` MCP entry;
47
57
  2. adds search guidance where the agent supports it;
48
- 3. adds local MCP tool approval for Codex and Claude Code, and managed server
49
- trust for Qwen Code;
58
+ 3. adds local MCP tool approval for Codex and Claude Code, managed server trust
59
+ for Qwen Code and Qoder CLI, and exact search/rg allow rules for Qoder's
60
+ CLI-backed runtime;
50
61
  4. starts the local zvec-grep server when possible.
51
62
 
52
63
  The [Server guide](./06-server.md) explains when the daemon is useful and how its
53
64
  lifecycle differs from Direct execution.
54
65
 
55
66
  Managed text blocks use `ZVEC_GREP_START` and `ZVEC_GREP_END` markers. Existing
56
- content outside those blocks is preserved. If an unmanaged `zvec_grep` entry
57
- already exists, inspect it before using `--force` to replace it.
67
+ content outside those blocks is preserved, as are unrelated settings and other
68
+ MCP servers. If an unmanaged `zvec_grep` entry already exists, inspect it before
69
+ using `--force` to replace it.
70
+
71
+ For Qoder CLI, `--mcp-transport` selects either a stdio or HTTP entry under
72
+ `mcpServers`; the installer also manages the timeout and trust fields. Search
73
+ guidance is written to `${QODER_CONFIG_DIR:-~/.qoder}/AGENTS.md` without
74
+ replacing unrelated guidance.
75
+
76
+ The same Qoder `settings.json`, used by Qoder CLI and CLI-backed Qoder clients,
77
+ receives exact `permissions.allow` rules for
78
+ `mcp__zvec_grep__zvec_grep_search` and `mcp__zvec_grep__zvec_grep_rg`, plus the
79
+ equivalent server-level `alwaysAllow` policy. This avoids repeated tool approval
80
+ prompts without allowing other MCP tools. Existing permission rules and JSONC
81
+ comments are preserved; uninstall removes only rules added by zg.
82
+
83
+ The same install writes the Qoder IDE MCP entry to its user-level
84
+ `~/.qoder/mcp.json`. Set `QODER_IDE_MCP_PATH` to override that complete file
85
+ path. The IDE entry uses
86
+ stdio when `--mcp-transport stdio` is selected. For HTTP it uses a `type: "sse"`
87
+ URL entry, from which Qoder IDE automatically detects the streamable HTTP MCP
88
+ endpoint. Qoder's platform `SharedClientCache` is runtime/cache state rather
89
+ than the user MCP configuration entry point, so the installer does not write
90
+ it. Qoder IDE has no supported global Rules file, so the installer does not
91
+ claim to create or manage IDE search guidance.
92
+
93
+ Both Qoder clients receive the same MCP form-based Remote Embedding
94
+ authorization request as other clients. If Qoder CLI reports that no handler is
95
+ registered for `elicitation/create`, or returns a decline or cancellation
96
+ without displaying the form, its installed `AGENTS.md` guidance supplies a
97
+ compatibility interaction through the exact `AskUserQuestion` tool. The CLI
98
+ agent must ask whether to allow Remote Embedding for the workspace, use local
99
+ FTS only, or cancel.
100
+
101
+ Qoder IDE uses the exact native tool name `ask_user_question`, but its official
102
+ integration does not provide a global Rules location where the installer can
103
+ persist the fallback. In stdio mode, the zvec-grep bridge turns a missing
104
+ `elicitation/create` handler into an actionable error that tells the top-level
105
+ IDE agent to present the same three choices with `ask_user_question`. This path
106
+ still needs an end-to-end smoke test in a real Qoder IDE session and should not
107
+ be treated as proof that every IDE build follows the instruction.
108
+
109
+ Only after explicit workspace approval may either client run the following
110
+ persistent grant and retry the original MCP search once:
111
+
112
+ ```bash
113
+ zg auth grant "/absolute/workspace" \
114
+ --capability embedding \
115
+ --scope workspace
116
+ ```
117
+
118
+ The local-FTS choice retries the search without `query`, `queries`, or `vector`
119
+ routes and with `autoUpdate: false` and `freshness: "eventual"`. It neither
120
+ refreshes the remote-embedding index nor sends query text or workspace content
121
+ to a remote Embedding provider. In a headless session where Qoder cannot ask the
122
+ user, the agent stops without granting access. Neither question tool should
123
+ collect a token, API key, or password. Provider credentials remain separate
124
+ from this data authorization.
58
125
 
59
126
  Restart the selected agent, or open a new session, after installation.
60
127
 
@@ -103,10 +170,13 @@ zg server status --check-ready
103
170
 
104
171
  Then start a new agent session and confirm that the client-specific search tool
105
172
  is available. It is `zvec_grep_search` in Codex and Claude Code,
106
- `mcp__zvec_grep__zvec_grep_search` in Qwen Code, and
107
- `zvec_grep_zvec_grep_search` in OpenCode. If the MCP connection is unavailable,
108
- the same indexed search and optional managed-rg route remain available from the
109
- shell:
173
+ `mcp__zvec_grep__zvec_grep_search` in Qwen Code and Qoder CLI, and
174
+ `zvec_grep_zvec_grep_search` in OpenCode. With the optional `full` MCP toolset,
175
+ Qoder CLI exposes managed rg as `mcp__zvec_grep__zvec_grep_rg`. For Qoder IDE,
176
+ confirm after restart that the `zvec_grep` server and its tools appear; the exact
177
+ host-qualified tool label remains part of the real-machine smoke test. If the
178
+ MCP connection is unavailable, the same indexed search and optional managed-rg
179
+ route remain available from the shell:
110
180
 
111
181
  ```bash
112
182
  zg query "where theme preferences are restored"
@@ -131,6 +201,7 @@ Use the same target names to remove only zvec-grep-managed entries:
131
201
  ```bash
132
202
  zg uninstall --target codex --yes
133
203
  zg uninstall --target qwen --yes
204
+ zg uninstall --target qoder --yes
134
205
  zg uninstall --target all --yes
135
206
  ```
136
207
 
package/docs/02-cli.md CHANGED
@@ -146,17 +146,18 @@ scripts.
146
146
  ## `zg install` and `zg uninstall`
147
147
 
148
148
  ```text
149
- zg install [--target codex|claude|qwen|opencode|cursor|all|auto] [--mcp-transport stdio|http] [--mcp-toolset agent|full] [--yes] [--force]
150
- zg uninstall [--target codex|claude|qwen|opencode|cursor|all|auto] [--yes]
149
+ zg install [--target codex|claude|qwen|qoder|opencode|cursor|all|auto] [--mcp-transport stdio|http] [--mcp-toolset agent|full] [--yes] [--force]
150
+ zg uninstall [--target codex|claude|qwen|qoder|opencode|cursor|all|auto] [--yes]
151
151
  ```
152
152
 
153
- `--target` is repeatable. `zg install` also accepts:
153
+ `--target` is repeatable. `qoder` is the single Qoder target and configures
154
+ Qoder CLI and Qoder IDE together. `zg install` also accepts:
154
155
 
155
156
  | Option | Meaning |
156
157
  | --- | --- |
157
158
  | `--mcp-transport <stdio\|http>` | MCP connection mode; default `stdio` |
158
159
  | `--mcp-toolset <agent\|full>` | Daemon MCP surface; default `agent` |
159
- | `--mcp-tool-timeout <seconds>` | Codex, Qwen Code, and OpenCode MCP timeout; default 600 seconds |
160
+ | `--mcp-tool-timeout <seconds>` | Codex, Qwen Code, both Qoder clients, and OpenCode MCP timeout; default 600 seconds |
160
161
  | `--mcp-token-env <name>` | Environment variable containing the server token |
161
162
  | `--force` | Replace a conflicting unmanaged `zvec_grep` entry |
162
163
 
@@ -229,6 +230,9 @@ refresh, authentication, and logs. See [MCP](./03-mcp.md) for the tool contract.
229
230
  | `DASHSCOPE_API_KEY` | Qwen API-key fallback after `ZVEC_GREP_API_KEY` |
230
231
  | `QWEN_API_KEY` | Qwen API-key fallback after `DASHSCOPE_API_KEY` |
231
232
  | `QWEN_HOME` | Qwen Code configuration directory used by `zg install` |
233
+ | `QODER_CONFIG_DIR` | Qoder CLI configuration directory used by `zg install` |
234
+ | `QODER_IDE_MCP_PATH` | Full Qoder IDE `mcp.json` path used by `zg install` |
235
+ | `QODER_IDE_EXECUTABLE` | Qoder IDE executable used for automatic install-target detection |
232
236
 
233
237
  Run `zg help environment` for advanced variables, agent integration paths,
234
238
  scope, and detailed precedence. A new index selects its model in this order:
@@ -152,6 +152,27 @@ Before granting access, confirm that the workspace content is permitted to be
152
152
  sent to the selected provider and endpoint. MCP tool approval is separate from
153
153
  this data authorization.
154
154
 
155
+ When Qoder CLI reports that it has no handler for `elicitation/create`, or
156
+ declines or cancels without displaying the form, the `AGENTS.md` guidance
157
+ installed by `zg install --target qoder` uses the exact `AskUserQuestion` tool
158
+ as a compatibility path. It offers workspace approval, local FTS only, or
159
+ cancel.
160
+
161
+ Qoder IDE uses the exact native tool name `ask_user_question`. Because Qoder IDE
162
+ does not provide a supported global Rules location, the installer does not
163
+ write equivalent IDE guidance. In stdio mode, the zvec-grep bridge instead
164
+ turns a missing `elicitation/create` handler into an actionable error directing
165
+ the top-level IDE agent to present the same choices with `ask_user_question`.
166
+ This path still requires an end-to-end smoke test in a real Qoder IDE session.
167
+
168
+ Either path runs the Workspace grant only after explicit approval and retries
169
+ the original MCP search once. Choosing local FTS instead removes
170
+ vector-producing query routes, sets `autoUpdate` to `false`, and keeps retrieval
171
+ local without refreshing the remote-embedding index; a headless session never
172
+ grants access automatically. Neither question tool should collect a token, API
173
+ key, or password. `--allow-remote` is not a substitute for this path because it
174
+ authorizes only the current CLI command, not a later MCP retry.
175
+
155
176
  ## Input length and truncation
156
177
 
157
178
  zvec-grep uses the selected model's input limit when it creates fragments, but
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zvec/zvec-grep",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Agent-friendly hybrid workspace search across code and non-code content.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",