memorix 1.9.12 → 1.10.0
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 +20 -1
- package/dist/cli/index.js +549 -101
- package/dist/index.d.ts +46 -0
- package/dist/index.js +271 -27
- package/dist/maintenance-runner.js +143 -3
- package/dist/media-audio-runner.js +143 -3
- package/dist/media-video-runner.js +143 -3
- package/dist/memcode/index.js +124 -8
- package/dist/memcode-runtime/CHANGELOG.md +20 -1
- package/dist/sdk.js +270 -26
- package/dist/vector-backfill-runner.js +143 -3
- package/docs/1.2.0-EVALUATION-HARNESS.md +88 -0
- package/docs/1.3-MEMORY-ARCHITECTURE.md +31 -0
- package/docs/API_REFERENCE.md +19 -0
- package/docs/DEVELOPMENT.md +16 -3
- package/docs/INTEGRATIONS.md +25 -0
- package/docs/PERFORMANCE.md +21 -6
- package/docs/README.md +4 -4
- package/docs/ROADMAP-1.9.12-2.0.md +92 -7
- package/package.json +3 -1
- package/plugins/antigravity/memorix/plugin.json +1 -1
- package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
- package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/copilot/memorix/plugin.json +1 -1
- package/plugins/gemini/memorix/gemini-extension.json +1 -1
- package/plugins/hermes/memorix/plugin.yaml +1 -1
- package/plugins/omp/memorix/package.json +1 -1
- package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/pi/memorix/package.json +1 -1
- package/server.json +2 -2
- package/src/cli/commands/agent-integrations.ts +164 -7
- package/src/cli/commands/memory.ts +1 -1
- package/src/cli/commands/serve-http.ts +30 -1
- package/src/cli/commands/setup.ts +5 -21
- package/src/codegraph/auto-context.ts +5 -0
- package/src/codegraph/context-pack.ts +4 -0
- package/src/compact/engine.ts +43 -2
- package/src/evaluation/context-task-matrix.ts +247 -0
- package/src/evaluation/context-task-runner.ts +175 -0
- package/src/integrations/registry.ts +191 -4
- package/src/knowledge/context-assembly.ts +33 -2
- package/src/knowledge/workset.ts +35 -3
- package/src/server/request-context.ts +96 -0
- package/src/server.ts +16 -4
- package/src/store/orama-store.ts +54 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 状态:规划基线
|
|
4
4
|
>
|
|
5
|
-
> 更新时间:2026-10-
|
|
5
|
+
> 更新时间:2026-10-23
|
|
6
6
|
>
|
|
7
7
|
> 这份文档是后续编码任务的总计划。它定义版本主题、依赖关系、成功标准和
|
|
8
8
|
> 2.0 的启动条件。具体实现任务、测试结果和最终版本范围必须在执行过程中
|
|
@@ -47,11 +47,15 @@ Memorix 已经超过“给 coding agent 加一个记忆工具”的阶段。当
|
|
|
47
47
|
|
|
48
48
|
### 1.1 当前事实
|
|
49
49
|
|
|
50
|
-
当前发布基线是 `v1.9.
|
|
51
|
-
迁移、Node 26 Pi hooks、Qwen hooks、API Route provider、session label
|
|
52
|
-
|
|
50
|
+
当前发布基线是 `v1.9.12`。1.9.12 已经完成 CJK 搜索、搜索回退、大库 alias
|
|
51
|
+
迁移、Node 26 Pi hooks、Qwen hooks、API Route provider、session label、发布
|
|
52
|
+
provenance 收紧和后台更新脚本隔离,并通过了跨平台 CI、全量测试和 MCP smoke。
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
`v1.9.12` 已从提交 `d5d8b5f` 发布到 npm、官方 MCP Registry 和 GitHub
|
|
55
|
+
Release。其后 `main` 已进入 1.10 additive contract-convergence iteration,
|
|
56
|
+
当前工作区不再是 1.9.12 release preparation。
|
|
57
|
+
|
|
58
|
+
1.9.12 已完成:
|
|
55
59
|
|
|
56
60
|
- publish workflow 增加 `npm audit signatures`;
|
|
57
61
|
- 发布 provenance 失败时删除无 provenance 的 `npm publish --ignore-scripts`
|
|
@@ -61,8 +65,8 @@ Memorix 已经超过“给 coding agent 加一个记忆工具”的阶段。当
|
|
|
61
65
|
- 本地 lint、build、全量测试、legacy/modern stdio、HTTP conformance 和
|
|
62
66
|
packed package install smoke 已通过。
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
公开 issue #327 仍保持开放,等待报告者补充可复现的包与扫描证据;这不阻止
|
|
69
|
+
已发布版本继续维护,但不能被记录为已证伪的安全报告。
|
|
66
70
|
|
|
67
71
|
### 1.2 必须保留的产品契约
|
|
68
72
|
|
|
@@ -143,6 +147,85 @@ tool contract、默认 provider、项目绑定或存储真相模型。
|
|
|
143
147
|
|
|
144
148
|
## 3. 1.10:可信上下文与契约收敛
|
|
145
149
|
|
|
150
|
+
执行状态:第一块“receipt governance transparency”已开始实现。当前 receipt
|
|
151
|
+
已经暴露 optional-evidence 的 freshness、trust、quality、conflict 和
|
|
152
|
+
evidenceCount。第二块已补 retrieval mode、code provider、fallback reason、
|
|
153
|
+
candidate/selected/omitted counts;第三块已为预算省略项补最多三个稳定
|
|
154
|
+
sample IDs,不保存原始内容。第一条本地性能基线已记录:Windows Node
|
|
155
|
+
22.22.3、1,000 records、20 runs、embedding/LLM disabled,specific query
|
|
156
|
+
p95 9.629ms,broad query p95 12.079ms;10,000 records 时 seed/index
|
|
157
|
+
12.633s,specific query p95 17.259ms,broad query p95 125.991ms。这个结果说明
|
|
158
|
+
broad retrieval 的数据量增长成本已经是 1.10 的实测性能问题。下一步扩展
|
|
159
|
+
40k 数据量和 receipt assembly latency,再进入 runtime binding 和 adapter
|
|
160
|
+
contract。40,000 records 时 seed/index 45.658s、specific query p95 2.187ms、
|
|
161
|
+
broad query p95 84.462ms;specific path 对热缓存和 query distribution 敏感,
|
|
162
|
+
broad path 是更稳定的容量信号。随后 large-store gate 已增加 bounded
|
|
163
|
+
receipt 测量:同一 Windows Node 22.22.3、40k records 下,MCP context 端到端
|
|
164
|
+
为 573.561ms,receipt assembly 为 7ms,说明当前 receipt 组装不是容量瓶颈。
|
|
165
|
+
下一步进入 runtime binding receipt 和 adapter contract,并继续保留端到端
|
|
166
|
+
context 与内部 assembly 两个指标。
|
|
167
|
+
|
|
168
|
+
Runtime binding 的第一条实现已落地:`memorix_session_start` 返回 additive
|
|
169
|
+
`structuredContent.binding` receipt,legacy HTTP、stateless HTTP 和直接 server
|
|
170
|
+
路径共享同一字段。receipt 记录 resolved/unresolved、source、explicit、project
|
|
171
|
+
ID、project root/data directory hash 和 transport;测试确认不会泄露原始路径、
|
|
172
|
+
MCP session ID 或 project handle。现在 receipt 也记录 verified Git remote 的
|
|
173
|
+
hash/host、handle 的 hash 与 created/last-used/expiry 窗口;stateless handle
|
|
174
|
+
创建使用项目 data directory,后续请求不会回退到 control-plane base database。
|
|
175
|
+
下一步进入 adapter registry contract。
|
|
176
|
+
|
|
177
|
+
Adapter registry contract 的第一条实现已落地:`src/integrations/registry.ts`
|
|
178
|
+
现在为全部 19 个 agent 目标生成 schema version 1 capability manifest,包含
|
|
179
|
+
transport/command、artifact、hook lifecycle、rules/skills/guidance、scope、
|
|
180
|
+
生命周期动作、host compatibility 状态、运行时要求和来源文件。`setup` 的
|
|
181
|
+
目标列表直接从 registry 派生;Qwen 已进入 registry,但明确为 hooks-only,
|
|
182
|
+
不会被误报为完整 setup 目标。registry 校验和 setup/doctor 回归测试已通过。
|
|
183
|
+
|
|
184
|
+
Doctor parity 已接入同一 manifest:每个 agent entry 现在报告预期/观测到的
|
|
185
|
+
transport、artifact 类别、生命周期能力、registry source 和 parity issues。
|
|
186
|
+
Qwen 的 MCP lane 会保持 skipped,hooks-only 的 install/uninstall 能力会明确
|
|
187
|
+
保留,repair/doctor 尚未被伪装成已实现。
|
|
188
|
+
|
|
189
|
+
对于 host 提供稳定路径的 rules 和 hooks,doctor parity 已增加具体
|
|
190
|
+
`artifactChecks`(scope、path、exists、status);package/skill 路径继续保留
|
|
191
|
+
为 manifest expectation,直到安装根目录可以跨启动方式可靠解析。
|
|
192
|
+
|
|
193
|
+
Memory ownership matrix 已补入 [1.3 Memory Architecture](1.3-MEMORY-ARCHITECTURE.md)
|
|
194
|
+
作为唯一权威文档,覆盖 Observation、Reasoning、Claim、Wiki/Workflow、
|
|
195
|
+
Session/Team、Long-term Memory 和 CodeGraph,并明确 Task Workset 是派生视图。
|
|
196
|
+
|
|
197
|
+
Evaluation 的第一步也已完成:现有 harness 新增 20 项 1.10 task matrix,覆盖
|
|
198
|
+
continuity、retrieval、safety、runtime 和 integration 五类边界,并固定
|
|
199
|
+
first-action、recovery、precision/recall、stale/conflict rejection、abstention、
|
|
200
|
+
token、latency、RSS、fallback/degraded 和 review cost 指标。`gate:context-matrix`
|
|
201
|
+
验证矩阵 contract,`gate:context-runtime` 已将 20 项矩阵执行到真实运行路径并
|
|
202
|
+
记录 40k large-store transport baseline;100k capacity gate 也已单独通过。
|
|
203
|
+
|
|
204
|
+
已有 replay harness 的第一组实测也已记录:embedding disabled、4 个固定问题
|
|
205
|
+
全部命中(4/4),最大单轮 277 tokens、0 次超预算;session dedup 将重复展示
|
|
206
|
+
从 4/16(25%)降到 3/16(18.75%),命中率保持 100%。这组结果只覆盖已映射
|
|
207
|
+
的 continuity/retrieval baseline,不能代表其余矩阵 case。
|
|
208
|
+
|
|
209
|
+
Operator surface 也已对齐:HTTP control-plane `/health` 现在携带
|
|
210
|
+
`transport: dashboard` 的 privacy-safe binding receipt,包含 verified project
|
|
211
|
+
和 data directory hashes 以及 Git remote state,不暴露本地路径。
|
|
212
|
+
|
|
213
|
+
Retrieval facade 也开始收敛:`compactSearch`、MCP `memorix_search` 和 CLI
|
|
214
|
+
`memory search --json` 共享 schema version 1 的 retrieval receipt,记录实际
|
|
215
|
+
search mode、candidate/selected/omitted counts、token budget omissions、fallback
|
|
216
|
+
reason、token count 和 elapsed time;查询文本与原始 memory 内容不进入 receipt。
|
|
217
|
+
底层 Orama/SQLite search 现在保留 request-level diagnostics,使这些字段来自
|
|
218
|
+
实际检索路径而不是调用方猜测。
|
|
219
|
+
|
|
220
|
+
1.10 的真实任务矩阵已执行完成:20/20 cases passed。Windows Node 22.22.3、
|
|
221
|
+
embeddings/LLM disabled 的基线为 memory hit precision/recall 1.00/1.00、
|
|
222
|
+
stale/conflict rejection 1.00/1.00、abstention precision 0.95,矩阵 p50/p95
|
|
223
|
+
为 2ms/255ms,peak RSS 为 428,867,584 bytes。40k packed large-store gate
|
|
224
|
+
和 100k capacity gate 均通过;40k MCP context/receipt assembly 为
|
|
225
|
+
518.983ms/6ms,100k 为 1,099.809ms/7ms,两个 gate 都没有 failed checks。
|
|
226
|
+
可复现入口为 `npm run gate:context-runtime`(20-case + 40k)以及
|
|
227
|
+
`node scripts/large-store-gate.mjs --records 100000`(100k 容量门禁)。
|
|
228
|
+
|
|
146
229
|
### 3.1 版本定位
|
|
147
230
|
|
|
148
231
|
1.10 是下一条真正的产品主线。它的核心不是“加入更多记忆”,而是让 Memorix
|
|
@@ -428,6 +511,8 @@ Hosted relay 需要区分:
|
|
|
428
511
|
### 5.3 社区和分发
|
|
429
512
|
|
|
430
513
|
- 完成 #297 awesome-list 外部提交;
|
|
514
|
+
- MiniMax M3.1 Flash 的 provider/model 生态更新已通过 PR #344 合并;
|
|
515
|
+
该更新保留旧模型 lookup 兼容性,并只纳入有证据的 direct/OpenRouter 路径;
|
|
431
516
|
- 增加官方 integration examples 和安全边界说明;
|
|
432
517
|
- 发布可复现 benchmark 和结果生成脚本;
|
|
433
518
|
- 发布包 provenance、SBOM、checksum 和支持矩阵;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorix",
|
|
3
3
|
"mcpName": "io.github.AVIDS2/memorix",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.10.0",
|
|
5
5
|
"description": "Local-first shared memory layer for AI coding agents across MCP clients, Git history, reasoning context, and project sessions.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
"benchmark:codegraph:scale": "node scripts/benchmark-codegraph-scale.mjs",
|
|
79
79
|
"benchmark:retrieval": "npm run build && node scripts/benchmark-retrieval.mjs",
|
|
80
80
|
"gate:memory-quality": "vitest run tests/evaluation/memory-quality-gate.test.ts tests/evaluation/session-replay-evaluation.test.ts",
|
|
81
|
+
"gate:context-matrix": "vitest run tests/evaluation/context-task-matrix.test.ts",
|
|
82
|
+
"gate:context-runtime": "node scripts/context-evaluation-gate.mjs",
|
|
81
83
|
"gate:large-store": "npm run build && node scripts/large-store-gate.mjs",
|
|
82
84
|
"sync:mcp-registry": "node scripts/sync-mcp-registry-manifest.mjs",
|
|
83
85
|
"check:mcp-registry": "node scripts/check-mcp-registry-manifest.mjs",
|
package/server.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/AVIDS2/memorix",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "1.
|
|
10
|
+
"version": "1.10.0",
|
|
11
11
|
"websiteUrl": "https://mem.rglens.com",
|
|
12
12
|
"icons": [
|
|
13
13
|
{
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{
|
|
23
23
|
"registryType": "npm",
|
|
24
24
|
"identifier": "memorix",
|
|
25
|
-
"version": "1.
|
|
25
|
+
"version": "1.10.0",
|
|
26
26
|
"runtimeHint": "npx",
|
|
27
27
|
"packageArguments": [
|
|
28
28
|
{
|
|
@@ -5,11 +5,15 @@ import { basename, dirname, resolve } from 'node:path';
|
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import type { MCPServerEntry } from '../../types.js';
|
|
7
7
|
import type { AgentName } from '../../hooks/types.js';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getAgentRulesPath,
|
|
10
|
+
getGlobalConfigPath,
|
|
11
|
+
getProjectConfigPath,
|
|
12
|
+
installAgentGuidance,
|
|
13
|
+
} from '../../hooks/installers/index.js';
|
|
9
14
|
import {
|
|
10
15
|
buildMemorixServer,
|
|
11
16
|
getMcpAdapter,
|
|
12
|
-
getSetupAgentTargets,
|
|
13
17
|
installPluginPackage,
|
|
14
18
|
installMcpConfig,
|
|
15
19
|
migrateLegacyCodexIntegration,
|
|
@@ -17,6 +21,12 @@ import {
|
|
|
17
21
|
type McpConfigAgent,
|
|
18
22
|
} from './setup.js';
|
|
19
23
|
import { getCliVersion } from '../version.js';
|
|
24
|
+
import {
|
|
25
|
+
getAgentIntegrationEntries,
|
|
26
|
+
type IntegrationCapabilityManifest,
|
|
27
|
+
type IntegrationLifecycleAction,
|
|
28
|
+
type IntegrationTransport,
|
|
29
|
+
} from '../../integrations/registry.js';
|
|
20
30
|
|
|
21
31
|
export type AgentIntegrationScope = 'local' | 'project' | 'global' | 'all';
|
|
22
32
|
export type AgentIntegrationStatus = 'ok' | 'missing' | 'repairable' | 'skipped';
|
|
@@ -76,8 +86,31 @@ export interface AgentPluginStatus {
|
|
|
76
86
|
checks: AgentPluginCheck[];
|
|
77
87
|
}
|
|
78
88
|
|
|
89
|
+
export interface AgentCapabilityParity {
|
|
90
|
+
manifestVersion: IntegrationCapabilityManifest['schemaVersion'];
|
|
91
|
+
expectedTransports: IntegrationTransport[];
|
|
92
|
+
defaultTransport: IntegrationCapabilityManifest['transport']['default'];
|
|
93
|
+
observedTransports: IntegrationTransport[];
|
|
94
|
+
expectedArtifacts: string[];
|
|
95
|
+
artifactStatus: Record<string, AgentIntegrationStatus>;
|
|
96
|
+
artifactChecks: AgentArtifactCheck[];
|
|
97
|
+
lifecycle: Record<IntegrationLifecycleAction, boolean>;
|
|
98
|
+
status: AgentIntegrationStatus;
|
|
99
|
+
issues: string[];
|
|
100
|
+
source: IntegrationCapabilityManifest['source'];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface AgentArtifactCheck {
|
|
104
|
+
kind: 'hooks' | 'rules' | 'guidance';
|
|
105
|
+
scope: 'project' | 'global';
|
|
106
|
+
path: string;
|
|
107
|
+
exists: boolean;
|
|
108
|
+
status: AgentIntegrationStatus;
|
|
109
|
+
}
|
|
110
|
+
|
|
79
111
|
export interface AgentIntegrationEntry {
|
|
80
112
|
agent: AgentName;
|
|
113
|
+
capability: AgentCapabilityParity;
|
|
81
114
|
mcp: {
|
|
82
115
|
status: AgentIntegrationStatus;
|
|
83
116
|
issues: string[];
|
|
@@ -139,7 +172,7 @@ type ConcreteAgentIntegrationScope = Exclude<AgentIntegrationScope, 'all'>;
|
|
|
139
172
|
type JsonRecord = Record<string, unknown>;
|
|
140
173
|
|
|
141
174
|
function requestedAgents(agent?: string): AgentName[] {
|
|
142
|
-
const all =
|
|
175
|
+
const all = getAgentIntegrationEntries().map(entry => entry.agent);
|
|
143
176
|
if (!agent || agent === 'all') return all;
|
|
144
177
|
return all.includes(agent as AgentName) ? [agent as AgentName] : [];
|
|
145
178
|
}
|
|
@@ -167,10 +200,122 @@ function worstStatus(statuses: AgentIntegrationStatus[]): AgentIntegrationStatus
|
|
|
167
200
|
return 'skipped';
|
|
168
201
|
}
|
|
169
202
|
|
|
203
|
+
function capabilityParity(
|
|
204
|
+
agent: AgentName,
|
|
205
|
+
projectRoot: string,
|
|
206
|
+
scope: AgentIntegrationScope,
|
|
207
|
+
mcp: AgentIntegrationEntry['mcp'],
|
|
208
|
+
guidance: AgentIntegrationEntry['guidance'],
|
|
209
|
+
plugin: AgentPluginStatus,
|
|
210
|
+
): AgentCapabilityParity {
|
|
211
|
+
const manifest = getAgentIntegrationEntries().find(entry => entry.agent === agent)?.capabilities;
|
|
212
|
+
if (!manifest) {
|
|
213
|
+
return {
|
|
214
|
+
manifestVersion: '1',
|
|
215
|
+
expectedTransports: [],
|
|
216
|
+
defaultTransport: 'none',
|
|
217
|
+
observedTransports: [],
|
|
218
|
+
expectedArtifacts: [],
|
|
219
|
+
artifactStatus: {},
|
|
220
|
+
artifactChecks: [],
|
|
221
|
+
lifecycle: { install: false, repair: false, doctor: false, uninstall: false },
|
|
222
|
+
status: 'missing',
|
|
223
|
+
issues: ['manifest-missing'],
|
|
224
|
+
source: {
|
|
225
|
+
registry: 'src/integrations/registry.ts',
|
|
226
|
+
generatedBy: [],
|
|
227
|
+
documentation: [],
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const expectedArtifacts = [
|
|
233
|
+
...(manifest.artifacts.packageFiles.length > 0 ? ['package'] : []),
|
|
234
|
+
...(manifest.artifacts.hookFiles.length > 0 ? ['hooks'] : []),
|
|
235
|
+
...(manifest.artifacts.ruleFiles.length > 0 ? ['rules'] : []),
|
|
236
|
+
...(manifest.artifacts.skillFiles.length > 0 ? ['skills'] : []),
|
|
237
|
+
...(manifest.artifacts.guidanceFiles.length > 0 ? ['guidance'] : []),
|
|
238
|
+
];
|
|
239
|
+
const artifactStatus: Record<string, AgentIntegrationStatus> = {};
|
|
240
|
+
if (manifest.transport.supported.length > 0) artifactStatus.mcp = mcp.status;
|
|
241
|
+
if (manifest.artifacts.packageFiles.length > 0) artifactStatus.package = plugin.status;
|
|
242
|
+
if (manifest.artifacts.hookFiles.length > 0) {
|
|
243
|
+
artifactStatus.hooks = plugin.checks.length > 0 ? plugin.status : 'skipped';
|
|
244
|
+
}
|
|
245
|
+
if (manifest.artifacts.ruleFiles.length > 0 || manifest.artifacts.guidanceFiles.length > 0) {
|
|
246
|
+
artifactStatus.guidance = guidance.status;
|
|
247
|
+
}
|
|
248
|
+
if (manifest.artifacts.skillFiles.length > 0) {
|
|
249
|
+
artifactStatus.skills = plugin.checks.length > 0 ? plugin.status : 'skipped';
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const artifactChecks: AgentArtifactCheck[] = [];
|
|
253
|
+
for (const check of guidance.checks) {
|
|
254
|
+
if (check.scope === 'local') continue;
|
|
255
|
+
const kind = manifest.artifacts.ruleFiles.length > 0 ? 'rules' : 'guidance';
|
|
256
|
+
artifactChecks.push({
|
|
257
|
+
kind,
|
|
258
|
+
scope: check.scope,
|
|
259
|
+
path: check.path,
|
|
260
|
+
exists: check.exists,
|
|
261
|
+
status: check.status,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (manifest.hooks.supported) {
|
|
265
|
+
const artifactScopes = requestedGuidanceScopes(scope)
|
|
266
|
+
.filter((value): value is 'project' | 'global' => value !== 'local');
|
|
267
|
+
for (const artifactScope of artifactScopes) {
|
|
268
|
+
const path = artifactScope === 'project'
|
|
269
|
+
? getProjectConfigPath(agent, projectRoot)
|
|
270
|
+
: getGlobalConfigPath(agent);
|
|
271
|
+
if (!path) continue;
|
|
272
|
+
const exists = existsSync(path);
|
|
273
|
+
artifactChecks.push({
|
|
274
|
+
kind: 'hooks',
|
|
275
|
+
scope: artifactScope,
|
|
276
|
+
path,
|
|
277
|
+
exists,
|
|
278
|
+
status: exists ? 'ok' : 'missing',
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const observedTransports = [...new Set(mcp.checks
|
|
284
|
+
.map(check => check.server?.transport)
|
|
285
|
+
.filter((transport): transport is IntegrationTransport => transport === 'stdio' || transport === 'http'))];
|
|
286
|
+
const parityStatuses = [
|
|
287
|
+
...Object.values(artifactStatus),
|
|
288
|
+
...artifactChecks.map(check => check.status),
|
|
289
|
+
];
|
|
290
|
+
const issues = Object.entries(artifactStatus)
|
|
291
|
+
.filter(([, status]) => status === 'missing' || status === 'repairable')
|
|
292
|
+
.map(([kind, status]) => `${kind}-${status}`);
|
|
293
|
+
issues.push(...artifactChecks
|
|
294
|
+
.filter(check => check.status === 'missing' || check.status === 'repairable')
|
|
295
|
+
.map(check => `${check.kind}-${check.scope}-${check.status}`));
|
|
296
|
+
if (manifest.transport.supported.length > 0 && mcp.status === 'skipped') {
|
|
297
|
+
issues.push('transport-not-checked');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return {
|
|
301
|
+
manifestVersion: manifest.schemaVersion,
|
|
302
|
+
expectedTransports: [...manifest.transport.supported],
|
|
303
|
+
defaultTransport: manifest.transport.default,
|
|
304
|
+
observedTransports,
|
|
305
|
+
expectedArtifacts,
|
|
306
|
+
artifactStatus,
|
|
307
|
+
artifactChecks,
|
|
308
|
+
lifecycle: { ...manifest.lifecycle },
|
|
309
|
+
status: worstStatus(parityStatuses),
|
|
310
|
+
issues: unique(issues),
|
|
311
|
+
source: manifest.source,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
170
315
|
function isMcpConfigAgent(agent: AgentName): agent is McpConfigAgent {
|
|
171
316
|
// Grok has a setup-only HTTP adapter. Doctor/repair skip it so a default
|
|
172
317
|
// host-owned Grok MCP is not reported as missing.
|
|
173
|
-
return agent !== 'pi' && agent !== 'grok';
|
|
318
|
+
return agent !== 'pi' && agent !== 'grok' && agent !== 'qwen';
|
|
174
319
|
}
|
|
175
320
|
|
|
176
321
|
function isActionableMcpRepairIssue(issue: string): boolean {
|
|
@@ -996,11 +1141,15 @@ export async function inspectAgentIntegrations(options: {
|
|
|
996
1141
|
const entries: AgentIntegrationEntry[] = [];
|
|
997
1142
|
|
|
998
1143
|
for (const agent of agents) {
|
|
1144
|
+
const mcp = await inspectMcp(agent, projectRoot, scope);
|
|
1145
|
+
const guidance = await inspectGuidance(agent, projectRoot, scope);
|
|
1146
|
+
const plugin = await inspectPlugin(agent, scope);
|
|
999
1147
|
entries.push({
|
|
1000
1148
|
agent,
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1149
|
+
capability: capabilityParity(agent, projectRoot, scope, mcp, guidance, plugin),
|
|
1150
|
+
mcp,
|
|
1151
|
+
guidance,
|
|
1152
|
+
plugin,
|
|
1004
1153
|
});
|
|
1005
1154
|
}
|
|
1006
1155
|
|
|
@@ -1030,6 +1179,14 @@ export function formatAgentIntegrationReport(report: AgentIntegrationReport): st
|
|
|
1030
1179
|
for (const entry of report.entries) {
|
|
1031
1180
|
const status = worstStatus([entry.mcp.status, entry.guidance.status, entry.plugin.status]);
|
|
1032
1181
|
lines.push(`${entry.agent}: ${status}`);
|
|
1182
|
+
const expected = entry.capability.expectedArtifacts.length > 0
|
|
1183
|
+
? entry.capability.expectedArtifacts.join(', ')
|
|
1184
|
+
: 'none';
|
|
1185
|
+
const observed = entry.capability.observedTransports.length > 0
|
|
1186
|
+
? entry.capability.observedTransports.join(', ')
|
|
1187
|
+
: 'none';
|
|
1188
|
+
lines.push(` Capability: v${entry.capability.manifestVersion}; transport=${entry.capability.defaultTransport}; observed=${observed}; artifacts=${expected}; parity=${entry.capability.status}`);
|
|
1189
|
+
if (entry.capability.issues.length > 0) lines.push(` Capability parity: ${entry.capability.issues.join(', ')}`);
|
|
1033
1190
|
if (entry.mcp.issues.length > 0) lines.push(` MCP: ${entry.mcp.issues.join(', ')}`);
|
|
1034
1191
|
if (entry.guidance.issues.length > 0) lines.push(` Guidance: ${entry.guidance.issues.join(', ')}`);
|
|
1035
1192
|
const hookTrustPending = entry.plugin.issues.includes('codex-hook-trust-pending');
|
|
@@ -93,7 +93,7 @@ export default defineCommand({
|
|
|
93
93
|
const limit = parsePositiveInt(args.limit as string | undefined, 10);
|
|
94
94
|
const quality = coerceRetrievalQuality(args.quality as string | undefined);
|
|
95
95
|
const result = await compactSearch({ query, limit, quality, projectId: project.id, reader }, 'cli');
|
|
96
|
-
emitResult({ project, entries: result.entries }, result.formatted, asJson);
|
|
96
|
+
emitResult({ project, entries: result.entries, retrieval: result.receipt }, result.formatted, asJson);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -382,6 +382,12 @@ export default defineCommand({
|
|
|
382
382
|
const requestedRoot = requestInfo?.headers.get('mcp-project-root') ?? undefined;
|
|
383
383
|
const root = persisted?.projectRoot ?? requestedRoot ?? projectRoot;
|
|
384
384
|
const dataDir = await resolveModernDataDir(root, persisted);
|
|
385
|
+
const binding = persisted ?? (() => {
|
|
386
|
+
const detected = detectorMod.detectProject(root);
|
|
387
|
+
if (!detected) return undefined;
|
|
388
|
+
const existing = statelessBindingStore.findByProjectRoot(detected.rootPath);
|
|
389
|
+
return existing ? statelessBindingStore.touch(existing.handleId) ?? existing : undefined;
|
|
390
|
+
})();
|
|
385
391
|
const runtimeKey = JSON.stringify([dataDir, root]);
|
|
386
392
|
// The SDK closes the per-request bridge after the response. The pool
|
|
387
393
|
// decrements the runtime reference there; the business runtime remains
|
|
@@ -391,6 +397,17 @@ export default defineCommand({
|
|
|
391
397
|
try {
|
|
392
398
|
const runtime = await createModernMcpRuntime({
|
|
393
399
|
projectRoot: root,
|
|
400
|
+
bindingTransport: 'stateless-http',
|
|
401
|
+
...(binding
|
|
402
|
+
? {
|
|
403
|
+
bindingHandle: {
|
|
404
|
+
handleId: binding.handleId,
|
|
405
|
+
createdAt: binding.createdAt,
|
|
406
|
+
lastUsedAt: binding.lastUsedAt,
|
|
407
|
+
...(binding.expiresAt ? { expiresAt: binding.expiresAt } : {}),
|
|
408
|
+
},
|
|
409
|
+
}
|
|
410
|
+
: {}),
|
|
394
411
|
allowUntrackedFallback: false,
|
|
395
412
|
deferProjectInitUntilBound: true,
|
|
396
413
|
deferProjectRuntimeInit: true,
|
|
@@ -691,11 +708,12 @@ export default defineCommand({
|
|
|
691
708
|
: projectRoot;
|
|
692
709
|
const detected = detectorMod.detectProject(requestedRoot);
|
|
693
710
|
if (detected) {
|
|
711
|
+
const bindingDataDir = await persistMod.getProjectDataDir(detected.id);
|
|
694
712
|
const binding = statelessBindingStore.findByProjectRoot(detected.rootPath)
|
|
695
713
|
?? statelessBindingStore.create({
|
|
696
714
|
projectId: detected.id,
|
|
697
715
|
projectRoot: detected.rootPath,
|
|
698
|
-
dataDir:
|
|
716
|
+
dataDir: bindingDataDir,
|
|
699
717
|
});
|
|
700
718
|
res.setHeader('Mcp-Project-Handle', binding.handleId);
|
|
701
719
|
}
|
|
@@ -807,6 +825,7 @@ export default defineCommand({
|
|
|
807
825
|
dashboardMode: 'control-plane',
|
|
808
826
|
dashboardPort: port,
|
|
809
827
|
toolProfile,
|
|
828
|
+
bindingTransport: 'legacy-http',
|
|
810
829
|
projectBinding: binding,
|
|
811
830
|
},
|
|
812
831
|
));
|
|
@@ -956,6 +975,15 @@ export default defineCommand({
|
|
|
956
975
|
rootPath: projectRoot,
|
|
957
976
|
};
|
|
958
977
|
const defaultDataDir = await getProjectDataDir(defaultProject.id);
|
|
978
|
+
const dashboardBinding = createProjectBindingController(defaultProject.rootPath);
|
|
979
|
+
if (defaultProject.id !== '__unresolved__') {
|
|
980
|
+
dashboardBinding.recordResolvedProject(defaultProject.id, defaultProject.rootPath);
|
|
981
|
+
}
|
|
982
|
+
const dashboardBindingReceipt = dashboardBinding.receipt({
|
|
983
|
+
dataDir: defaultDataDir,
|
|
984
|
+
transport: 'dashboard',
|
|
985
|
+
gitRemote: defaultProject.gitRemote,
|
|
986
|
+
});
|
|
959
987
|
const baseDir = getBaseDataDir();
|
|
960
988
|
|
|
961
989
|
// HTTP sessions intentionally keep their own runtime globals. This worker
|
|
@@ -1996,6 +2024,7 @@ export default defineCommand({
|
|
|
1996
2024
|
pid: process.pid,
|
|
1997
2025
|
projectId: defaultProject?.id ?? '__unresolved__',
|
|
1998
2026
|
projectName: defaultProject?.name ?? null,
|
|
2027
|
+
binding: dashboardBindingReceipt,
|
|
1999
2028
|
readyAt: httpReadyAt,
|
|
2000
2029
|
memory: {
|
|
2001
2030
|
rss: memory.rss,
|
|
@@ -34,7 +34,10 @@ import { DshMCPAdapter } from '../../workspace/mcp-adapters/dsh.js';
|
|
|
34
34
|
import { WorkbuddyMCPAdapter } from '../../workspace/mcp-adapters/workbuddy.js';
|
|
35
35
|
import { CodeBuddyMCPAdapter } from '../../workspace/mcp-adapters/codebuddy.js';
|
|
36
36
|
import { GrokMCPAdapter } from '../../workspace/mcp-adapters/grok.js';
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
getSetupAgentTargets as readSetupAgentTargets,
|
|
39
|
+
getSetupIntegrationRows as readSetupIntegrationRows,
|
|
40
|
+
} from '../../integrations/registry.js';
|
|
38
41
|
import { OFFICIAL_MEMORIX_SKILLS } from '../../hooks/official-skills.js';
|
|
39
42
|
import { getCliVersion } from '../version.js';
|
|
40
43
|
|
|
@@ -178,26 +181,7 @@ const CODEBUDDY_PLUGIN_AGENTS = new Set<AgentName>(['codebuddy']);
|
|
|
178
181
|
// These hosts have a native package/plugin surface. Their default setup must not
|
|
179
182
|
// create project-local fallback files beside the user's own agent configuration.
|
|
180
183
|
const PACKAGE_OWNED_INTEGRATION_AGENTS = new Set<AgentName>(['codex', 'codebuddy', 'antigravity', 'openclaw', 'hermes', 'omp']);
|
|
181
|
-
const SUPPORTED_SETUP_AGENTS: AgentName[] =
|
|
182
|
-
'claude',
|
|
183
|
-
'codex',
|
|
184
|
-
'codebuddy',
|
|
185
|
-
'opencode',
|
|
186
|
-
'cursor',
|
|
187
|
-
'windsurf',
|
|
188
|
-
'copilot',
|
|
189
|
-
'gemini-cli',
|
|
190
|
-
'antigravity',
|
|
191
|
-
'openclaw',
|
|
192
|
-
'hermes',
|
|
193
|
-
'omp',
|
|
194
|
-
'kiro',
|
|
195
|
-
'trae',
|
|
196
|
-
'dsh',
|
|
197
|
-
'workbuddy',
|
|
198
|
-
'pi',
|
|
199
|
-
'grok',
|
|
200
|
-
];
|
|
184
|
+
const SUPPORTED_SETUP_AGENTS: AgentName[] = readSetupAgentTargets();
|
|
201
185
|
|
|
202
186
|
export function getSetupAgentTargets(): AgentName[] {
|
|
203
187
|
return [...SUPPORTED_SETUP_AGENTS];
|
|
@@ -460,6 +460,11 @@ export async function buildAutoProjectContext(input: {
|
|
|
460
460
|
: {}),
|
|
461
461
|
...(semanticOutline ? { semanticCode: semanticOutline } : {}),
|
|
462
462
|
providerQuality,
|
|
463
|
+
retrieval: {
|
|
464
|
+
mode: semanticOutline ? 'hybrid' : 'lexical',
|
|
465
|
+
codeProvider: providerQuality.selected,
|
|
466
|
+
...(externalCaution ? { fallbackReason: externalCaution } : {}),
|
|
467
|
+
},
|
|
463
468
|
currentFacts: worksetFactLines(currentFacts),
|
|
464
469
|
...(continuation ? { continuation } : {}),
|
|
465
470
|
...(continuity ? { continuity } : {}),
|
|
@@ -308,6 +308,10 @@ export async function attachTaskWorkset(input: {
|
|
|
308
308
|
startHere: uniq([...semanticStartHere, ...input.pack.suggestedReads]),
|
|
309
309
|
...(semanticCode ? { semanticCode } : {}),
|
|
310
310
|
...(input.providerQuality ? { providerQuality: input.providerQuality } : {}),
|
|
311
|
+
retrieval: {
|
|
312
|
+
mode: semanticCode ? 'hybrid' : 'unknown',
|
|
313
|
+
...(input.providerQuality?.selected ? { codeProvider: input.providerQuality.selected } : {}),
|
|
314
|
+
},
|
|
311
315
|
reliableMemory: input.pack.memories
|
|
312
316
|
.filter(memory => memory.status === 'current')
|
|
313
317
|
.map(memory => ({
|