@radix-ai/ai-memory 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/dist/cli/adapters.d.ts.map +1 -1
- package/dist/cli/adapters.js +81 -26
- package/dist/cli/adapters.js.map +1 -1
- package/dist/cli/environment.d.ts +2 -0
- package/dist/cli/environment.d.ts.map +1 -1
- package/dist/cli/environment.js +16 -1
- package/dist/cli/environment.js.map +1 -1
- package/dist/cli/index.js +113 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/evals/platform-integration.d.ts +2 -1
- package/dist/evals/platform-integration.d.ts.map +1 -1
- package/dist/evals/platform-integration.js +21 -7
- package/dist/evals/platform-integration.js.map +1 -1
- package/dist/hybrid-search/index.js +2 -2
- package/dist/hybrid-search/index.js.map +1 -1
- package/dist/mcp-server/tools/index.js +3 -3
- package/dist/mcp-server/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/plugins/adapters/generic/README.md +11 -10
- package/plugins/ai-memory/rules/parallel-safe-planning.md +2 -2
- package/plugins/ai-memory/skills/desktop-automation/SKILL.md +35 -0
- package/plugins/ai-memory/skills/mem-compound/SKILL.md +1 -1
- package/plugins/ai-memory/skills/mem-init/SKILL.md +181 -30
- package/templates/.ai/IDENTITY.md +56 -2
- package/templates/.ai/reference/PROJECT.md +40 -3
- package/templates/.ai/reference/capability-specs.json +55 -0
- package/templates/.ai/reference/environment-specs.json +18 -4
package/README.md
CHANGED
|
@@ -126,10 +126,13 @@ Creates: `acp/`, `docs-schema.json`, `rules/doc-placement.md`, `agents/docs-mana
|
|
|
126
126
|
| `/mem-init` | First-time project setup |
|
|
127
127
|
| `/mem-validate` | Before a risky change (Full tier) |
|
|
128
128
|
| `/mem-auto-review` | Automated PR review (Bugbot, CI, automations) |
|
|
129
|
+
| `/browser` | Browser automation (screenshots, navigate, interact) |
|
|
130
|
+
| `/screen-capture` | Desktop/app window screenshot for vision analysis |
|
|
131
|
+
| `/desktop-automation` | Desktop UI automation (mouse, keyboard, OCR) |
|
|
129
132
|
|
|
130
133
|
### How to invoke skills
|
|
131
134
|
|
|
132
|
-
Skills are stored in `.ai/skills/` (canonical) with stubs in `.agents/skills
|
|
135
|
+
Skills are stored in `.ai/skills/` (canonical) with stubs in your tool's skills directory (e.g., `.cursor/skills/`, `.claude/skills/`, `.agents/skills/` for Antigravity). How you invoke them depends on your tool:
|
|
133
136
|
|
|
134
137
|
| Tool | How to invoke | Example |
|
|
135
138
|
|------|--------------|---------|
|
|
@@ -235,7 +238,7 @@ PROJECT_STATUS.md is writable by default (`writable: true` in frontmatter). This
|
|
|
235
238
|
4. Next iteration reads the updated PROJECT_STATUS.md
|
|
236
239
|
5. Natural convergence through iteration
|
|
237
240
|
|
|
238
|
-
This follows the [autoresearch](https://github.com/mutable-state-inc/autoresearch-at-home) pattern and the [Ralph Wiggum](https://ralph-wiggum.ai/) approach: **the
|
|
241
|
+
This follows the [autoresearch](https://github.com/mutable-state-inc/autoresearch-at-home) pattern and the [Ralph Wiggum](https://ralph-wiggum.ai/) approach: **the status file on disk is the shared state.**
|
|
239
242
|
|
|
240
243
|
### Concurrent agents (cloud agents, worktrees, background tasks)
|
|
241
244
|
|
|
@@ -325,7 +328,7 @@ ai-memory eval add my-metric
|
|
|
325
328
|
|
|
326
329
|
## Design
|
|
327
330
|
|
|
328
|
-
-
|
|
331
|
+
- **Environment adaptation** — Spec-driven detection and injection. Implemented via `detectEnvironments()` in `src/cli/environment.ts` and `install --capability`.
|
|
329
332
|
|
|
330
333
|
---
|
|
331
334
|
|
|
@@ -336,7 +339,7 @@ ai-memory eval add my-metric
|
|
|
336
339
|
- [compound-engineering-plugin](https://github.com/EveryInc/compound-engineering-plugin) — Plugin this system is modeled after
|
|
337
340
|
- [lossless-claw](https://github.com/Martian-Engineering/lossless-claw) — Lossless context compaction (inspiration for session archive design)
|
|
338
341
|
- [autoresearch-at-home](https://github.com/mutable-state-inc/autoresearch-at-home) — Multi-agent iterative research
|
|
339
|
-
- [Ralph Wiggum](https://ralph-wiggum.ai/) — Iterative agent loops via
|
|
342
|
+
- [Ralph Wiggum](https://ralph-wiggum.ai/) — Iterative agent loops via status file on disk
|
|
340
343
|
|
|
341
344
|
---
|
|
342
345
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/cli/adapters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,6/BAkBjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,21CAoCxB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,qFAAqF;AACrF,wBAAgB,UAAU,IAAI,MAAM,CAoBnC;
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/cli/adapters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,6/BAkBjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,21CAoCxB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,qFAAqF;AACrF,wBAAgB,UAAU,IAAI,MAAM,CAoBnC;AA4BD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoOnD,CAAC;AAIF,eAAO,MAAM,kBAAkB,0vCAwC9B,CAAC;AAGF,eAAO,MAAM,gBAAgB,orBAa5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAiBrB,CAAC;AAIZ,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CA4CrD,CAAC"}
|
package/dist/cli/adapters.js
CHANGED
|
@@ -88,6 +88,24 @@ export function getMCPJson() {
|
|
|
88
88
|
function skillStub(name, description) {
|
|
89
89
|
return `---\nname: ${name}\ndescription: ${description}\n---\n\n# ${name}\n\nCanonical definition: \`.ai/skills/${name}/SKILL.md\`\n\nRead the canonical file for full instructions.\n`;
|
|
90
90
|
}
|
|
91
|
+
const SKILL_STUBS = [
|
|
92
|
+
["mem-compound", "Captures session learnings into persistent memory."],
|
|
93
|
+
["mem-session-close", "Quick session close for sessions with no major learnings."],
|
|
94
|
+
["mem-validate", "Validate memory entries and code changes against governance rules."],
|
|
95
|
+
["mem-init", "Initialize ai-memory in a new project."],
|
|
96
|
+
["browser", "Browser automation (screenshots, navigate, interact)."],
|
|
97
|
+
["screen-capture", "Desktop/app window screenshot for vision analysis."],
|
|
98
|
+
["desktop-automation", "Desktop UI automation — mouse, keyboard, OCR. For desktop applications, Electron apps."],
|
|
99
|
+
["mem-auto-review", "Automated PR review using ai-memory governance rules."],
|
|
100
|
+
];
|
|
101
|
+
/** Generate skill stub files for a given tool-specific skills directory */
|
|
102
|
+
function skillStubsForDir(dir) {
|
|
103
|
+
const stubs = {};
|
|
104
|
+
for (const [name, desc] of SKILL_STUBS) {
|
|
105
|
+
stubs[`${dir}/${name}/SKILL.md`] = skillStub(name, desc);
|
|
106
|
+
}
|
|
107
|
+
return stubs;
|
|
108
|
+
}
|
|
91
109
|
/** Full skill content — written to .ai/skills/<name>/SKILL.md by install */
|
|
92
110
|
export const CANONICAL_SKILLS = {
|
|
93
111
|
"mem-compound": `---
|
|
@@ -172,19 +190,26 @@ description: Validate memory entries and code changes against governance rules.
|
|
|
172
190
|
`,
|
|
173
191
|
"mem-init": `---
|
|
174
192
|
name: mem-init
|
|
175
|
-
description:
|
|
193
|
+
description: Guided setup wizard for ai-memory. Scans the codebase and walks the user through configuring each file with project-specific recommendations. Every step is skippable.
|
|
176
194
|
disable-model-invocation: true
|
|
177
195
|
---
|
|
178
196
|
|
|
179
|
-
# mem-init —
|
|
180
|
-
|
|
181
|
-
## Instructions
|
|
197
|
+
# mem-init — Guided Setup Wizard
|
|
182
198
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
## When to use
|
|
200
|
+
First time setting up ai-memory, or re-run to refresh recommendations.
|
|
201
|
+
|
|
202
|
+
**Quick setup (skip wizard):** Run \`npx @radix-ai/ai-memory init\` and edit files manually.
|
|
203
|
+
|
|
204
|
+
## Steps
|
|
205
|
+
1. **Scaffold** — Run \`npx @radix-ai/ai-memory init\` (or \`--full\`), then \`install --to <tool>\`. Skip if \`.ai/\` exists.
|
|
206
|
+
2. **Codebase scan** — Read: manifest (package.json etc.), README, directory listing, CI config, build config, git log, existing MCPs, existing rules files, existing docs. Summarize internally.
|
|
207
|
+
3. **Guide IDENTITY.md** — Explain each section (Mindset, Autonomy Level, Constraints, Permissions). Suggest project-specific constraints from scan. Ask autonomy level preference (HIGH/MEDIUM/LOW TOUCH). User edits the file. Skippable.
|
|
208
|
+
4. **Guide reference/PROJECT.md** — Present scan findings as suggestions for: Project Overview, Tech Stack, Architecture, Data Models, Integrations, Dev Setup. User edits the file. Skippable.
|
|
209
|
+
5. **Guide PROJECT_STATUS.md** — Suggest Current Focus from git log, Open Questions from scan gaps, What's Working from observed patterns. User edits. Skippable.
|
|
210
|
+
6. **Knowledge audit** — Report existing docs (ARCHITECTURE.md, CONTRIBUTING.md, CHANGELOG.md, .env.example, TODO comments, existing MCPs/rules). Suggest what to import into .ai/memory/. Do not import automatically.
|
|
211
|
+
7. **Recommendations** — Suggest relevant features: CI detected → mem-auto-review, multiple contributors → Full tier, no tests → testing-strategy pattern, monorepo → per-package skills.
|
|
212
|
+
8. **Validate** — Run \`npx @radix-ai/ai-memory validate\`. Print summary of what was done, remaining placeholders, and next steps.
|
|
188
213
|
`,
|
|
189
214
|
browser: `---
|
|
190
215
|
name: browser
|
|
@@ -193,6 +218,7 @@ type: skill
|
|
|
193
218
|
status: active
|
|
194
219
|
requires:
|
|
195
220
|
capabilities: [browser]
|
|
221
|
+
permission: read # read | edit | write — only request what the task needs
|
|
196
222
|
---
|
|
197
223
|
|
|
198
224
|
# browser — Browser Automation Skill
|
|
@@ -238,6 +264,42 @@ See \`.ai/reference/capability-specs.json\` for platform-specific install (e.g.
|
|
|
238
264
|
|
|
239
265
|
- Capture → save to \`.ai/temp/\` → agent reads via file or \`get_memory\`
|
|
240
266
|
- Handoff: write path to \`.ai/temp/request-for-*.md\` for another agent
|
|
267
|
+
`,
|
|
268
|
+
"desktop-automation": `---
|
|
269
|
+
name: desktop-automation
|
|
270
|
+
description: Desktop UI automation — mouse, keyboard, OCR. For any desktop application, Electron apps, legacy software. Requires desktop_automation capability.
|
|
271
|
+
type: skill
|
|
272
|
+
status: active
|
|
273
|
+
requires:
|
|
274
|
+
capabilities: [desktop_automation]
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
# desktop-automation — Desktop UI Automation Skill
|
|
278
|
+
|
|
279
|
+
## When to use
|
|
280
|
+
|
|
281
|
+
- Type into any desktop application or Electron apps
|
|
282
|
+
- Automate legacy desktop apps without APIs
|
|
283
|
+
- UI testing, data entry, accessibility tools
|
|
284
|
+
|
|
285
|
+
## Permissions
|
|
286
|
+
|
|
287
|
+
Declare the minimal permission needed for the task (see capability-specs.json):
|
|
288
|
+
- **read** — Observe, screenshot, OCR only
|
|
289
|
+
- **edit** — Click, type, navigate (no destructive actions)
|
|
290
|
+
- **write** — Full control (submit, delete, etc.)
|
|
291
|
+
|
|
292
|
+
Only request the permission the task requires.
|
|
293
|
+
|
|
294
|
+
## Setup
|
|
295
|
+
|
|
296
|
+
- **Cursor/Claude Code/Windsurf/Cline:** Run \`ai-memory install --capability desktop_automation\`
|
|
297
|
+
- **Antigravity:** Add computer-control-mcp to \`~/.gemini/antigravity/mcp_config.json\` manually. Requires \`uvx\` (uv) or \`pip install computer-control-mcp\`.
|
|
298
|
+
|
|
299
|
+
## Usage
|
|
300
|
+
|
|
301
|
+
- Use mouse/keyboard tools for interaction; OCR for reading screen content
|
|
302
|
+
- Save captures to \`.ai/temp/\` for handoff
|
|
241
303
|
`,
|
|
242
304
|
"mem-auto-review": `---
|
|
243
305
|
name: mem-auto-review
|
|
@@ -356,14 +418,15 @@ export const TOOL_ADAPTERS = {
|
|
|
356
418
|
mcp: true,
|
|
357
419
|
mcpPath: ".cursor/mcp.json",
|
|
358
420
|
extraFiles: {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
421
|
+
...skillStubsForDir(".cursor/skills"),
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
antigravity: {
|
|
425
|
+
dest: ".agents/rules/00-load-ai-memory.md",
|
|
426
|
+
content: BOOTSTRAP_INSTRUCTION,
|
|
427
|
+
mcp: false, // Antigravity MCP is global-only (~/.gemini/antigravity/mcp_config.json)
|
|
428
|
+
extraFiles: {
|
|
429
|
+
...skillStubsForDir(".agents/skills"),
|
|
367
430
|
},
|
|
368
431
|
},
|
|
369
432
|
windsurf: {
|
|
@@ -386,15 +449,7 @@ export const TOOL_ADAPTERS = {
|
|
|
386
449
|
content: `# Claude Code — Project Memory\n\n${BOOTSTRAP_INSTRUCTION}`,
|
|
387
450
|
mcp: true,
|
|
388
451
|
extraFiles: {
|
|
389
|
-
|
|
390
|
-
".agents/skills/mem-compound/SKILL.md": skillStub("mem-compound", "Captures session learnings into persistent memory."),
|
|
391
|
-
".agents/skills/mem-session-close/SKILL.md": skillStub("mem-session-close", "Quick session close for sessions with no major learnings."),
|
|
392
|
-
".agents/skills/mem-validate/SKILL.md": skillStub("mem-validate", "Validate memory entries and code changes against governance rules."),
|
|
393
|
-
".agents/skills/mem-init/SKILL.md": skillStub("mem-init", "Initialize ai-memory in a new project."),
|
|
394
|
-
".agents/skills/browser/SKILL.md": skillStub("browser", "Browser automation (screenshots, navigate, interact)."),
|
|
395
|
-
".agents/skills/screen-capture/SKILL.md": skillStub("screen-capture", "Desktop/app window screenshot for vision analysis."),
|
|
396
|
-
".agents/skills/mem-auto-review/SKILL.md": skillStub("mem-auto-review", "Automated PR review using ai-memory governance rules."),
|
|
397
|
-
// Claude Code hooks (SessionStart, PreCompact)
|
|
452
|
+
...skillStubsForDir(".claude/skills"),
|
|
398
453
|
".claude/hooks/SessionStart.js": SESSION_START_HOOK,
|
|
399
454
|
".claude/hooks/PreCompact.js": PRE_COMPACT_HOOK,
|
|
400
455
|
".claude/settings.local.json": CLAUDE_HOOKS_CONFIG,
|
package/dist/cli/adapters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/cli/adapters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;CAkBpC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC3B,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAExD,qFAAqF;AACrF,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,CAAC,iBAAiB,CAAC;gBACzB,GAAG,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE;aAC1C;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,8BAA8B;gBACnC,OAAO,EAAE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O,EAAE,qBAAqB;QAC9B,GAAG,EAAE,IAAI;KACV;IACD,KAAK,EAAE;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,qBAAqB;QAC9B,GAAG,EAAE,IAAI;KACV;IACD,OAAO,EAAE;QACP,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,6BAA6B,qBAAqB,gHAAgH;QAC3K,GAAG,EAAE,KAAK;KACX;IACD,aAAa,EAAE;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,qCAAqC,qBAAqB,EAAE;QACrE,GAAG,EAAE,IAAI;QACT,UAAU,EAAE;YACV,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;YACrC,+BAA+B,EAAE,kBAAkB;YACnD,6BAA6B,EAAE,gBAAgB;YAC/C,6BAA6B,EAAE,mBAAmB;SACnD;KACF;CACF,CAAC"}
|
|
@@ -25,6 +25,8 @@ export declare function detectEnvironments(projectRoot: string, packageRoot: str
|
|
|
25
25
|
* Reads from capability-specs.json → environments[envId].
|
|
26
26
|
*/
|
|
27
27
|
export declare function getCapabilityConfig(capability: string, envId: string, projectRoot: string, packageRoot: string): unknown;
|
|
28
|
+
/** Get manual setup instructions when capability has manual config for an environment. */
|
|
29
|
+
export declare function getCapabilityManualInstructions(capability: string, envId: string, projectRoot: string, packageRoot: string): string | null;
|
|
28
30
|
/**
|
|
29
31
|
* Inject MCP config for a capability into the environment's config file.
|
|
30
32
|
* Merges new server entry into mcpServers; does not overwrite existing ai-memory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/cli/environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,E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AAE,MAAM,GAClB,OAAO,CAOT;AAED,0FAA0F;AAC1F,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAKf;AAWD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAcT"}
|
package/dist/cli/environment.js
CHANGED
|
@@ -53,12 +53,21 @@ export function getCapabilityConfig(capability, envId, projectRoot, packageRoot)
|
|
|
53
53
|
const envConfig = cap.environments?.[envId];
|
|
54
54
|
return envConfig ?? null;
|
|
55
55
|
}
|
|
56
|
+
/** Get manual setup instructions when capability has manual config for an environment. */
|
|
57
|
+
export function getCapabilityManualInstructions(capability, envId, projectRoot, packageRoot) {
|
|
58
|
+
const config = getCapabilityConfig(capability, envId, projectRoot, packageRoot);
|
|
59
|
+
if (!config || typeof config !== "object")
|
|
60
|
+
return null;
|
|
61
|
+
const manual = config.manual;
|
|
62
|
+
return typeof manual === "string" ? manual : null;
|
|
63
|
+
}
|
|
56
64
|
/** MCP config paths per environment (relative to project root). Matches install adapter mcpPath. */
|
|
57
65
|
const ENV_MCP_PATHS = {
|
|
58
66
|
cursor: ".cursor/mcp.json",
|
|
59
67
|
"claude-code": ".mcp.json",
|
|
60
68
|
windsurf: ".mcp.json",
|
|
61
69
|
cline: ".mcp.json",
|
|
70
|
+
antigravity: ".mcp.json", // Antigravity uses global config; project path unused for injection
|
|
62
71
|
};
|
|
63
72
|
/**
|
|
64
73
|
* Inject MCP config for a capability into the environment's config file.
|
|
@@ -92,6 +101,8 @@ function loadMcpConfig(path) {
|
|
|
92
101
|
function mcpEntryFromCapConfig(capability, config) {
|
|
93
102
|
if (config.native === true)
|
|
94
103
|
return null; // Cursor has browser natively; no injection
|
|
104
|
+
if (config.manual !== undefined)
|
|
105
|
+
return null; // Manual setup (e.g. Antigravity global MCP)
|
|
95
106
|
const mcp = config.mcp;
|
|
96
107
|
if (!mcp || typeof mcp !== "object")
|
|
97
108
|
return null;
|
|
@@ -109,9 +120,13 @@ function mcpEntryFromCapConfig(capability, config) {
|
|
|
109
120
|
}
|
|
110
121
|
return null;
|
|
111
122
|
}
|
|
123
|
+
const CAPABILITY_MCP_KEYS = {
|
|
124
|
+
browser: "cursor-ide-browser",
|
|
125
|
+
desktop_automation: "computer-control-mcp",
|
|
126
|
+
};
|
|
112
127
|
function mergeMcpConfig(existing, capability, entry) {
|
|
113
128
|
const servers = { ...(existing.mcpServers ?? {}) };
|
|
114
|
-
const key = capability
|
|
129
|
+
const key = CAPABILITY_MCP_KEYS[capability] ?? `capability-${capability}`;
|
|
115
130
|
if (!servers[key])
|
|
116
131
|
servers[key] = entry;
|
|
117
132
|
return { ...existing, mcpServers: servers };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/cli/environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAerC,2FAA2F;AAC3F,SAAS,YAAY,CAAC,WAAmB,EAAE,WAAmB,EAAE,QAAgB;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,IAAI,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IAC9C,OAAO,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACtE,CAAC;AAED,yEAAyE;AACzE,SAAS,QAAQ,CAAI,IAAY;IAC/B,I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B;IAClD,OAAO,EAAE,oBAAoB;IAC7B,kBAAkB,EAAE,sBAAsB;CAC3C,CAAC;AAEF,SAAS,cAAc,CACrB,QAAkD,EAClD,UAAkB,EAClB,KAAc;IAEd,MAAM,OAAO,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;IACnD,MAAM,GAAG,GAAG,mBAAmB,CAAC,UAAU,CAAC,IAAI,cAAc,UAAU,EAAE,CAAC;IAC1E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { existsSync, readFileSync } from "fs";
|
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import { DEFAULT_DOCS_SCHEMA_JSON } from "../docs-schema.js";
|
|
8
8
|
import { TOOL_ADAPTERS, getMCPJson, MCP_LAUNCHER, MCP_LAUNCHER_PATH, CANONICAL_SKILLS } from "./adapters.js";
|
|
9
|
-
import { detectEnvironments, injectCapabilityConfig } from "./environment.js";
|
|
9
|
+
import { detectEnvironments, injectCapabilityConfig, getCapabilityManualInstructions } from "./environment.js";
|
|
10
10
|
// Read version from package.json — single source of truth
|
|
11
11
|
const __dirname_cli = dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
const pkgPath = join(__dirname_cli, "..", "..", "package.json");
|
|
@@ -63,14 +63,12 @@ program
|
|
|
63
63
|
await warmSearchModel();
|
|
64
64
|
console.log(`✓ Model ready.`);
|
|
65
65
|
}
|
|
66
|
-
console.log(`\n✓ Done. Next
|
|
67
|
-
console.log(`
|
|
68
|
-
console.log(`
|
|
69
|
-
console.log(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
console.log(` 5. Run \`ai-memory generate-harness\` to compile the rule set`);
|
|
73
|
-
}
|
|
66
|
+
console.log(`\n✓ Done. Next step:`);
|
|
67
|
+
console.log(` Run /mem-init in your AI tool for guided setup with project-specific recommendations.`);
|
|
68
|
+
console.log(` Or manually edit .ai/IDENTITY.md and .ai/PROJECT_STATUS.md.`);
|
|
69
|
+
console.log(``);
|
|
70
|
+
console.log(` Connect your tool: npx @radix-ai/ai-memory install --to <tool>`);
|
|
71
|
+
console.log(` Supported tools: cursor, claude-code, antigravity, windsurf, cline, copilot`);
|
|
74
72
|
});
|
|
75
73
|
async function scaffoldAiDir(aiDir, full) {
|
|
76
74
|
// Core dirs (always)
|
|
@@ -148,7 +146,7 @@ program
|
|
|
148
146
|
.description("Install the ai-memory bootstrap for a specific tool")
|
|
149
147
|
.requiredOption("--to <tool>", `Target tool (${Object.keys(TOOL_ADAPTERS).join(", ")})`)
|
|
150
148
|
.option("--dir <dir>", "Project root (default: current directory)")
|
|
151
|
-
.option("--capability <cap>", "Inject capability config (browser, screen_capture). Repeatable.", (v, acc) => (acc ?? []).concat(v), [])
|
|
149
|
+
.option("--capability <cap>", "Inject capability config (browser, screen_capture, desktop_automation). Repeatable.", (v, acc) => (acc ?? []).concat(v), [])
|
|
152
150
|
.action(async (opts) => {
|
|
153
151
|
const tool = opts.to.toLowerCase();
|
|
154
152
|
const adapter = TOOL_ADAPTERS[tool];
|
|
@@ -212,8 +210,9 @@ program
|
|
|
212
210
|
const pkgRoot = join(__dirname_cli, "..", "..");
|
|
213
211
|
const envs = detectEnvironments(projectRoot, pkgRoot);
|
|
214
212
|
for (const cap of capabilities) {
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
const knownCaps = ["browser", "screen_capture", "desktop_automation"];
|
|
214
|
+
if (!knownCaps.includes(cap)) {
|
|
215
|
+
console.warn(` [warn] Unknown capability: ${cap}. Skipping. Known: ${knownCaps.join(", ")}`);
|
|
217
216
|
continue;
|
|
218
217
|
}
|
|
219
218
|
let injected = 0;
|
|
@@ -231,11 +230,28 @@ program
|
|
|
231
230
|
if (cap === "screen_capture" && injected === 0 && envs.length > 0) {
|
|
232
231
|
console.warn(` [warn] screen_capture has no MCP config — it uses platform tools (e.g. Peekaboo). See capability-specs.json.`);
|
|
233
232
|
}
|
|
233
|
+
// Print manual instructions for capabilities that require global/manual setup (e.g. Antigravity + desktop_automation)
|
|
234
|
+
for (const envId of envs) {
|
|
235
|
+
const manual = getCapabilityManualInstructions(cap, envId, projectRoot, pkgRoot);
|
|
236
|
+
if (manual) {
|
|
237
|
+
console.log(` [${envId}] ${cap}: ${manual}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
|
-
console.log(`\nDone.
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
console.log(`\nDone. Before starting:`);
|
|
243
|
+
if (tool === "antigravity") {
|
|
244
|
+
console.log(` 1. Add ai-memory MCP to ~/.gemini/antigravity/mcp_config.json (Antigravity uses global MCP config)`);
|
|
245
|
+
console.log(` 2. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`);
|
|
246
|
+
}
|
|
247
|
+
else if (adapter.mcp) {
|
|
248
|
+
console.log(` 1. Enable the ai-memory MCP server in your tool's settings (it's disabled by default)`);
|
|
249
|
+
console.log(` 2. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
console.log(` 1. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`);
|
|
253
|
+
}
|
|
254
|
+
console.log(` Run /mem-init for guided onboarding.`);
|
|
239
255
|
console.log(`\nIf search_memory is not available, restart your editor — MCP servers load at startup.`);
|
|
240
256
|
});
|
|
241
257
|
// ─── mcp ────────────────────────────────────────────────────────────────────
|
|
@@ -760,31 +776,79 @@ const DEFAULT_IDENTITY = `---
|
|
|
760
776
|
id: identity
|
|
761
777
|
type: identity
|
|
762
778
|
status: active
|
|
763
|
-
writable:
|
|
779
|
+
writable: true
|
|
764
780
|
last_updated: ${new Date().toISOString().slice(0, 10)}
|
|
765
781
|
---
|
|
766
782
|
|
|
767
783
|
# Identity
|
|
768
784
|
|
|
769
|
-
You are a senior developer focused on long-term strategy and production readiness.
|
|
785
|
+
You are a senior developer focused on long-term strategy and production readiness. You think beyond the immediate task — anticipating downstream effects, architectural implications, and long-term maintainability. Every decision is deliberate, forward-looking, and grounded in engineering excellence.
|
|
786
|
+
|
|
787
|
+
## Mindset
|
|
788
|
+
|
|
789
|
+
- Think about gaps and edge cases before writing code
|
|
790
|
+
- Propose solutions that are production-grade, not prototypes
|
|
791
|
+
- When diagnosing an issue, consider the full call chain — not just the immediate symptom
|
|
792
|
+
- [Add project-specific mindset guidance here]
|
|
793
|
+
|
|
794
|
+
## Autonomy Level
|
|
770
795
|
|
|
771
|
-
|
|
796
|
+
<!-- Set one of: HIGH_TOUCH, MEDIUM_TOUCH, LOW_TOUCH -->
|
|
797
|
+
level: HIGH_TOUCH
|
|
772
798
|
|
|
773
|
-
|
|
799
|
+
### HIGH_TOUCH (default)
|
|
800
|
+
**ASK before:** architectural changes, scope changes, trade-offs, ambiguous requirements, irreversible actions.
|
|
801
|
+
**DO NOT ask for:** permission to search/read, executing decided approach, gathering info.
|
|
802
|
+
**Long-running agents:** checkpoint at phase transitions.
|
|
803
|
+
|
|
804
|
+
### MEDIUM_TOUCH
|
|
805
|
+
**ASK before:** irreversible actions, breaking changes, security-sensitive changes.
|
|
806
|
+
**Proceed autonomously with:** refactors, test additions, dependency updates, documentation.
|
|
807
|
+
**Checkpoint:** only on scope changes.
|
|
808
|
+
|
|
809
|
+
### LOW_TOUCH
|
|
810
|
+
**ASK before:** production deployments, data deletion, security rule changes.
|
|
811
|
+
**Proceed autonomously with:** everything else.
|
|
812
|
+
**Checkpoint:** only on errors or blockers.
|
|
774
813
|
|
|
775
814
|
## Constraints (NEVER without explicit approval)
|
|
776
815
|
|
|
777
816
|
- Never commit secrets, API keys, or .env files
|
|
778
817
|
- Never delete user data without explicit request
|
|
779
818
|
- Never deploy to production without explicit request
|
|
780
|
-
- Never write full protocols to tool directories — canonical content goes in \`.ai
|
|
819
|
+
- Never write full protocols to tool directories — canonical content goes in \`.ai/\`, stubs in tool dirs
|
|
820
|
+
- Always use \`commit_memory\` MCP tool for writing to \`.ai/memory/\`. Never edit memory files directly.
|
|
821
|
+
- [Add project-specific constraints here]
|
|
822
|
+
|
|
823
|
+
## Permissions (ASK before doing)
|
|
824
|
+
|
|
825
|
+
- Creating new files (prefer editing existing)
|
|
826
|
+
- Adding dependencies
|
|
827
|
+
- [Add project-specific permissions here]
|
|
781
828
|
|
|
782
|
-
## Before
|
|
829
|
+
## Before Starting Any Task
|
|
783
830
|
|
|
784
831
|
1. Read \`.ai/memory/memory-index.md\`
|
|
785
|
-
2. Search \`.ai/memory/\` for
|
|
832
|
+
2. Search \`.ai/memory/\` for bugs, patterns, decisions relevant to the task
|
|
786
833
|
3. Search \`.ai/skills/\` for applicable domain patterns
|
|
787
|
-
4. Fetch \`.ai/reference/PROJECT.md\` only when
|
|
834
|
+
4. Fetch \`.ai/reference/PROJECT.md\` only when task requires architecture, data models, or integrations
|
|
835
|
+
|
|
836
|
+
## Inference Discipline
|
|
837
|
+
|
|
838
|
+
1. **State inferences explicitly**: "I'm inferring X because Y"
|
|
839
|
+
2. **Check memory for conflicts**: Search \`.ai/memory/\` before acting on inference
|
|
840
|
+
3. **Surface uncertainty**: If confidence < 90%, say so and ask
|
|
841
|
+
4. **Never reduce scope silently**: All content is tool-agnostic by default
|
|
842
|
+
|
|
843
|
+
After completing any non-trivial task, self-verify: Did I answer what was asked, or what I assumed was asked?
|
|
844
|
+
|
|
845
|
+
## Authority (when sources conflict)
|
|
846
|
+
|
|
847
|
+
PROJECT.md > memory files > code > inference.
|
|
848
|
+
|
|
849
|
+
## When Confused
|
|
850
|
+
|
|
851
|
+
Tell the user. Fix the code, not the documentation.
|
|
788
852
|
`;
|
|
789
853
|
const DEFAULT_PROJECT_STATUS = `---
|
|
790
854
|
id: project-status
|
|
@@ -796,7 +860,7 @@ last_updated: ${new Date().toISOString().slice(0, 10)}
|
|
|
796
860
|
|
|
797
861
|
# Project Status
|
|
798
862
|
|
|
799
|
-
> This file evolves with the project. Both humans and AI update it — AI writes what it learned, humans steer the focus. This is your RALPH loop
|
|
863
|
+
> This file evolves with the project. Both humans and AI update it — AI writes what it learned, humans steer the focus. This is your RALPH loop status file.
|
|
800
864
|
|
|
801
865
|
## Current Focus
|
|
802
866
|
|
|
@@ -993,31 +1057,47 @@ Curated history of past session decisions. One line per session.
|
|
|
993
1057
|
<!-- Format: [YYYY-MM-DD] Brief description of what was done and decided. -->
|
|
994
1058
|
`;
|
|
995
1059
|
const DEFAULT_PROJECT = `---
|
|
996
|
-
id: project
|
|
997
|
-
type:
|
|
1060
|
+
id: project-reference
|
|
1061
|
+
type: reference
|
|
998
1062
|
status: active
|
|
999
1063
|
last_updated: ${new Date().toISOString().slice(0, 10)}
|
|
1000
1064
|
---
|
|
1001
1065
|
|
|
1002
|
-
# Project
|
|
1066
|
+
# Project Reference
|
|
1003
1067
|
|
|
1004
|
-
**
|
|
1068
|
+
**Full project reference for AI agents. Fetch this file when the task requires architecture, data models, integrations, or development setup.**
|
|
1005
1069
|
|
|
1006
|
-
|
|
1070
|
+
Load this file only when the task requires full project context. Prefer \`memory-index.md\` for session start.
|
|
1007
1071
|
|
|
1008
|
-
|
|
1072
|
+
---
|
|
1073
|
+
|
|
1074
|
+
## Project Overview
|
|
1075
|
+
|
|
1076
|
+
[What this project is, who it's for, what problem it solves]
|
|
1009
1077
|
|
|
1010
1078
|
## Tech Stack
|
|
1011
1079
|
|
|
1012
|
-
[
|
|
1080
|
+
- **Language:** [e.g., TypeScript, Python, Go]
|
|
1081
|
+
- **Framework:** [e.g., React, FastAPI, none]
|
|
1082
|
+
- **Build:** [e.g., Vite, webpack, tsc, cargo]
|
|
1083
|
+
- **CI:** [e.g., GitHub Actions, GitLab CI, none]
|
|
1084
|
+
- **Key dependencies:** [Top 5-8 from manifest file]
|
|
1085
|
+
|
|
1086
|
+
## Architecture
|
|
1087
|
+
|
|
1088
|
+
[High-level structure — e.g., "Monorepo with packages/ for shared libs", "Single Express API with PostgreSQL"]
|
|
1013
1089
|
|
|
1014
1090
|
## Data Models
|
|
1015
1091
|
|
|
1016
|
-
[
|
|
1092
|
+
[Schema files, ORM models, key types. Remove this section if not applicable.]
|
|
1017
1093
|
|
|
1018
1094
|
## Integrations
|
|
1019
1095
|
|
|
1020
|
-
[
|
|
1096
|
+
[External services — e.g., "Stripe (payments)", "SendGrid (email)", "PostgreSQL (primary DB)". Remove if not applicable.]
|
|
1097
|
+
|
|
1098
|
+
## Development Setup
|
|
1099
|
+
|
|
1100
|
+
[How to run the project locally — from README, Makefile, docker-compose, .env.example]
|
|
1021
1101
|
`;
|
|
1022
1102
|
const DEFAULT_ACP_MANIFEST = JSON.stringify({
|
|
1023
1103
|
name: "ai-memory-agent",
|