@thxgg/steward 0.1.7 → 0.1.11

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.
Files changed (36) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bo1Fdv48.js → BPaqwWyl.js} +2 -2
  3. package/.output/public/_nuxt/{DhQtydpF.js → C8LtDyY4.js} +1 -1
  4. package/.output/public/_nuxt/{D0zW6lUK.js → CQgu_W_k.js} +1 -1
  5. package/.output/public/_nuxt/{BRDbaJqY.js → CZKCADv6.js} +2 -2
  6. package/.output/public/_nuxt/{CEJOILWG.js → CeO4HNxC.js} +1 -1
  7. package/.output/public/_nuxt/{BNzFoVmP.js → Cs5ptsBk.js} +1 -1
  8. package/.output/public/_nuxt/{CFsNy2aC.js → CshyynD6.js} +1 -1
  9. package/.output/public/_nuxt/{DYDTtHLR.js → CzKPXRws.js} +1 -1
  10. package/.output/public/_nuxt/{BqmZq_gb.js → DOvbLsAq.js} +1 -1
  11. package/.output/public/_nuxt/{Bri1ZtcQ.js → DbloiS5Y.js} +1 -1
  12. package/.output/public/_nuxt/{B3hkJjmY.js → DcRwFvvS.js} +1 -1
  13. package/.output/public/_nuxt/builds/latest.json +1 -1
  14. package/.output/public/_nuxt/builds/meta/e2995e80-736c-47cd-8041-a131bab2f136.json +1 -0
  15. package/.output/public/_nuxt/{X6fIXIFO.js → vr7VLA9A.js} +1 -1
  16. package/.output/server/chunks/build/{_prd_-CnwhMRyf.mjs → _prd_-CkKfJB6U.mjs} +2 -2
  17. package/.output/server/chunks/build/_prd_-CkKfJB6U.mjs.map +1 -0
  18. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  19. package/.output/server/chunks/build/server.mjs +1 -1
  20. package/.output/server/chunks/nitro/nitro.mjs +684 -622
  21. package/.output/server/package.json +1 -1
  22. package/README.md +31 -4
  23. package/bin/prd +117 -0
  24. package/dist/host/src/api/git.js +1 -8
  25. package/dist/host/src/api/prds.js +2 -8
  26. package/dist/host/src/api/repo-context.js +60 -0
  27. package/dist/host/src/api/repos.js +6 -0
  28. package/dist/host/src/api/state.js +20 -21
  29. package/dist/host/src/executor.js +215 -29
  30. package/dist/host/src/help.js +124 -0
  31. package/dist/host/src/mcp.js +51 -25
  32. package/dist/server/utils/db.js +86 -1
  33. package/docs/MCP.md +64 -3
  34. package/package.json +1 -1
  35. package/.output/public/_nuxt/builds/meta/6683a0d9-9c02-4098-b750-bbbc0305261e.json +0 -1
  36. package/.output/server/chunks/build/_prd_-CnwhMRyf.mjs.map +0 -1
package/docs/MCP.md CHANGED
@@ -46,6 +46,20 @@ Example MCP client config:
46
46
  }
47
47
  ```
48
48
 
49
+ ## Runtime Requirements
50
+
51
+ - `repos`, `prds`, and `state` APIs require sqlite runtime support.
52
+ - Steward uses Node's built-in `node:sqlite` module.
53
+ - `prd mcp` auto-retries with `--experimental-sqlite` when the runtime supports it.
54
+
55
+ If you still see `ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite`, launch explicitly with:
56
+
57
+ ```bash
58
+ NODE_OPTIONS=--experimental-sqlite npx -y @thxgg/steward mcp
59
+ ```
60
+
61
+ If that still fails, the MCP host is using an incompatible Node runtime.
62
+
49
63
  ## Execute Contract
50
64
 
51
65
  `execute` expects one input field:
@@ -58,7 +72,31 @@ Example MCP client config:
58
72
 
59
73
  Your code is wrapped in an async function, so you can use `await` directly.
60
74
 
61
- Return values are JSON-stringified in the MCP response.
75
+ Each call returns a JSON envelope:
76
+
77
+ ```json
78
+ {
79
+ "ok": true,
80
+ "result": {},
81
+ "logs": [],
82
+ "error": null,
83
+ "meta": {
84
+ "timeoutMs": 30000,
85
+ "durationMs": 12,
86
+ "truncatedResult": false,
87
+ "truncatedLogs": false,
88
+ "resultWasUndefined": false
89
+ }
90
+ }
91
+ ```
92
+
93
+ - `result` is `null` when your code does not explicitly return a value.
94
+ - `logs` contains captured `console.log/info/warn/error` output from sandbox code.
95
+ - `error` is populated with `{ code, message, stack?, details? }` on failure.
96
+
97
+ In-sandbox discovery helper:
98
+
99
+ - `steward.help()`
62
100
 
63
101
  ## Available APIs
64
102
 
@@ -66,6 +104,7 @@ Return values are JSON-stringified in the MCP response.
66
104
 
67
105
  - `repos.list()`
68
106
  - `repos.get(repoId)`
107
+ - `repos.current()`
69
108
  - `repos.add(path, name?)`
70
109
  - `repos.remove(repoId)`
71
110
  - `repos.refreshGitRepos(repoId)`
@@ -89,10 +128,13 @@ Return values are JSON-stringified in the MCP response.
89
128
 
90
129
  - `state.get(repoId, slug)`
91
130
  - `state.getByPath(repoPath, slug)`
131
+ - `state.getCurrent(slug)`
92
132
  - `state.summaries(repoId)`
93
133
  - `state.summariesByPath(repoPath)`
134
+ - `state.summariesCurrent()`
94
135
  - `state.upsert(repoId, slug, payload)`
95
136
  - `state.upsertByPath(repoPath, slug, payload)`
137
+ - `state.upsertCurrent(slug, payload)`
96
138
 
97
139
  `payload` supports any combination of:
98
140
 
@@ -116,7 +158,7 @@ return await Promise.all(reposList.map(async (repo) => ({
116
158
  Load one PRD with state:
117
159
 
118
160
  ```js
119
- const repo = (await repos.list())[0]
161
+ const repo = await repos.current()
120
162
  const slug = 'prd-viewer'
121
163
 
122
164
  return {
@@ -139,6 +181,24 @@ return await Promise.all(commits.map(async (entry) => ({
139
181
  })))
140
182
  ```
141
183
 
184
+ Inspect signatures at runtime:
185
+
186
+ ```js
187
+ return steward.help()
188
+ ```
189
+
190
+ Update state in the current repo (no repoId required):
191
+
192
+ ```js
193
+ const slug = 'prd-viewer'
194
+
195
+ await state.upsertCurrent(slug, {
196
+ notes: '# Updated from codemode'
197
+ })
198
+
199
+ return { saved: true }
200
+ ```
201
+
142
202
  Update state directly by path (replacement for shell helpers):
143
203
 
144
204
  ```js
@@ -170,7 +230,8 @@ return { saved: true }
170
230
  ## Limits
171
231
 
172
232
  - Execution timeout: 30 seconds
173
- - Output preview limit: 50,000 characters
233
+ - Result preview limit: 50,000 characters
234
+ - Captured log limit: 20,000 characters (max 200 log entries)
174
235
  - Timer limit: 100 active timers in sandbox
175
236
 
176
237
  ## Safety Notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thxgg/steward",
3
- "version": "0.1.7",
3
+ "version": "0.1.11",
4
4
  "description": "Local-first PRD workflow steward with codemode MCP and web UI.",
5
5
  "type": "module",
6
6
  "author": "thxgg",
@@ -1 +0,0 @@
1
- {"id":"6683a0d9-9c02-4098-b750-bbbc0305261e","timestamp":1771766521897,"prerendered":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_prd_-CnwhMRyf.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/_prd_-CnwhMRyf.js"],"names":[],"mappings":"","x_google_ignoreList":[0]}