droid-mode 0.0.13 → 0.1.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://raw.githubusercontent.com/Gitmaxd/droid-mode/main/assets/droid-mode-readme.webp" alt="Droid Mode" width="600" />
3
+ <img src="https://res.cloudinary.com/ds7w5yhjh/image/upload/v1767480336/droid-mode-readme_ymx61e.webp" alt="Droid Mode" width="600" />
4
4
 
5
5
  **Progressive MCP for AI Agents. Zero Context Bloat.**
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid-mode",
3
- "version": "0.0.13",
3
+ "version": "0.1.0",
4
4
  "description": "Progressive Code-Mode MCP integration for Factory.ai Droid - access MCP tools without context bloat",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -14,8 +14,23 @@ Access MCP tools **without loading them into context**. Progressive discovery
14
14
  - **Procedural workflows** (filter/join/iterate between tool calls)
15
15
  - **Auditability** (explicit scripts + saved artifacts)
16
16
 
17
+ ## Requirements
18
+
19
+ | Requirement | Details |
20
+ |-------------|---------|
21
+ | Node.js | >= 18.0.0 |
22
+ | Permissions | `bin/dm` must be executable (`chmod +x`) |
23
+ | MCP Config | Valid `mcp.json` with at least one server |
24
+
17
25
  ## Commands
18
26
 
27
+ **IMPORTANT**: The `dm` script must be called with full path. **Try workspace first**:
28
+
29
+ 1. **Workspace** (try first): `./.factory/skills/droid-mode/bin/dm`
30
+ 2. **Personal** (fallback): `~/.factory/skills/droid-mode/bin/dm`
31
+
32
+ If workspace path fails with "not found", use personal path.
33
+
19
34
  | Level | Command | Purpose |
20
35
  |-------|---------|---------|
21
36
  | 1 | `dm servers` | Discover available MCP servers |
@@ -44,10 +59,49 @@ All droid-mode commands are safe to rerun:
44
59
 
45
60
  No cleanup required between invocations.
46
61
 
62
+ ## Tool Execution Options
63
+
64
+ **Option 1: Direct MCP Call (Single Tool)**
65
+
66
+ ```bash
67
+ # 1. Hydrate the tool schema
68
+ dm hydrate search_documents --server contextrepo
69
+
70
+ # 2. Call via MCP server directly (tool now available in context)
71
+ ```
72
+
73
+ No workflow file needed for single tool calls.
74
+
75
+ **Option 2: Procedural Workflow (Multiple Tools)**
76
+
77
+ For loops, conditionals, or chaining multiple calls, use `dm run`:
78
+
79
+ | Input | Flag | Required | Example |
80
+ |-------|------|----------|---------|
81
+ | Workflow file | `--workflow` | Yes | `workflow.js` |
82
+ | Tool list | `--tools` | Yes | `search,query` |
83
+ | Server name | `--server` | If multiple servers | `contextrepo` |
84
+
85
+ ## Naming Convention
86
+
87
+ Tool names use **snake_case** in CLI flags but **camelCase** in workflow code:
88
+
89
+ | Context | Format | Example |
90
+ |---------|--------|---------|
91
+ | CLI `--tools` flag | snake_case | `--tools list_collections` |
92
+ | Workflow `t.` accessor | camelCase | `t.listCollections({})` |
93
+
94
+ **Conversion rule**: Remove underscores, capitalize each word after first.
95
+ - `list_collections` → `listCollections`
96
+ - `search_documents` → `searchDocuments`
97
+ - `get_file_content` → `getFileContent`
98
+
47
99
  ## Workflow Example
48
100
 
49
101
  ```js
50
102
  // workflow.js
103
+ // Note: Tool name converts from snake_case to camelCase
104
+ // search_documents → t.searchDocuments()
51
105
  workflow = async () => {
52
106
  const docs = await t.searchDocuments({ query: "PRD", limit: 5 })
53
107
  return docs.results.map(d => d.id)
@@ -55,12 +109,24 @@ workflow = async () => {
55
109
  ```
56
110
 
57
111
  ```bash
58
- dm run --server contextrepo --tools search_documents --workflow workflow.js
112
+ # Workspace skill
113
+ ./.factory/skills/droid-mode/bin/dm run --server contextrepo --tools search_documents --workflow workflow.js
114
+
115
+ # Personal skill
116
+ ~/.factory/skills/droid-mode/bin/dm run --server contextrepo --tools search_documents --workflow workflow.js
59
117
  ```
60
118
 
61
119
  ## Verification
62
120
 
63
- After using droid-mode, verify:
121
+ After using droid-mode, verify (using full path to `dm` for your installation):
122
+
123
+ ```bash
124
+ # Workspace skill
125
+ ./.factory/skills/droid-mode/bin/dm doctor --server X
126
+
127
+ # Personal skill
128
+ ~/.factory/skills/droid-mode/bin/dm doctor --server X
129
+ ```
64
130
 
65
131
  - [ ] `dm doctor --server X` passes (connection works)
66
132
  - [ ] Artifacts exist in `.factory/droid-mode/` (cache, hydrated, runs)
@@ -86,12 +152,18 @@ The skill completes successfully when these artifacts exist:
86
152
  | TypeScript types | `.factory/droid-mode/hydrated/<server>/<ts>/types.d.ts` | Generated type definitions |
87
153
  | Execution trace | `.factory/droid-mode/runs/<server>/<ts>/run.json` | `{ error: false, result: ... }` |
88
154
 
89
- Verify with: `dm doctor --server X` (should exit 0)
155
+ Verify with the appropriate full path for your installation:
156
+ - Workspace: `./.factory/skills/droid-mode/bin/dm doctor --server X`
157
+ - Personal: `~/.factory/skills/droid-mode/bin/dm doctor --server X`
158
+
159
+ Command should exit 0.
90
160
 
91
161
  ## Fallbacks
92
162
 
93
163
  | Issue | Resolution |
94
164
  |-------|------------|
165
+ | Node.js version error | Upgrade to Node.js >= 18.0.0 |
166
+ | Permission denied on dm | Run `chmod +x bin/dm` in skill directory |
95
167
  | Server not found | Run `dm servers` to list available servers |
96
168
  | Connection timeout | Check `mcp.json` config, run `dm doctor` |
97
169
  | Tool not found | Run `dm index --server X` to refresh cache |
@@ -121,6 +193,27 @@ All JSON artifacts are machine-parseable for downstream skill chaining. Workflow
121
193
  - `examples/hooks/` — PreToolUse hook examples
122
194
  - `README.md` — full documentation
123
195
 
196
+ ## Quick Reference
197
+
198
+ **Find dm**: Always at `./.factory/skills/droid-mode/bin/dm` (workspace) or `~/.factory/skills/droid-mode/bin/dm` (personal)
199
+
200
+ **Minimal workflow** (using workspace path):
201
+ ```bash
202
+ # 1. Discover tools (snake_case names)
203
+ ./.factory/skills/droid-mode/bin/dm index --server X
204
+
205
+ # 2. Hydrate (use snake_case)
206
+ ./.factory/skills/droid-mode/bin/dm hydrate tool_name --server X
207
+
208
+ # 3. Execute (use camelCase in workflow)
209
+ echo 'workflow = async () => await t.toolName({})' > /tmp/wf.js
210
+ ./.factory/skills/droid-mode/bin/dm run --server X --tools tool_name --workflow /tmp/wf.js
211
+ ```
212
+
213
+ For personal skill, replace `./.factory/` with `~/.factory/`.
214
+
215
+ **Common mistake**: Using `t.tool_name()` instead of `t.toolName()` in workflows.
216
+
124
217
  ## References
125
218
 
126
219
  For project-specific conventions, see: