@moxxy/config 0.27.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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/dist/config-writer.d.ts +30 -0
  3. package/dist/config-writer.d.ts.map +1 -0
  4. package/dist/config-writer.js +57 -0
  5. package/dist/config-writer.js.map +1 -0
  6. package/dist/define.d.ts +17 -0
  7. package/dist/define.d.ts.map +1 -0
  8. package/dist/define.js +18 -0
  9. package/dist/define.js.map +1 -0
  10. package/dist/index.d.ts +9 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +11 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/loader.d.ts +28 -0
  15. package/dist/loader.d.ts.map +1 -0
  16. package/dist/loader.js +210 -0
  17. package/dist/loader.js.map +1 -0
  18. package/dist/merge.d.ts +9 -0
  19. package/dist/merge.d.ts.map +1 -0
  20. package/dist/merge.js +45 -0
  21. package/dist/merge.js.map +1 -0
  22. package/dist/plugin-settings-schema.d.ts +24 -0
  23. package/dist/plugin-settings-schema.d.ts.map +1 -0
  24. package/dist/plugin-settings-schema.js +17 -0
  25. package/dist/plugin-settings-schema.js.map +1 -0
  26. package/dist/plugin.d.ts +21 -0
  27. package/dist/plugin.d.ts.map +1 -0
  28. package/dist/plugin.js +329 -0
  29. package/dist/plugin.js.map +1 -0
  30. package/dist/plugins-tree-schema.d.ts +444 -0
  31. package/dist/plugins-tree-schema.d.ts.map +1 -0
  32. package/dist/plugins-tree-schema.js +93 -0
  33. package/dist/plugins-tree-schema.js.map +1 -0
  34. package/dist/schema.d.ts +1200 -0
  35. package/dist/schema.d.ts.map +1 -0
  36. package/dist/schema.js +198 -0
  37. package/dist/schema.js.map +1 -0
  38. package/dist/user-config.d.ts +77 -0
  39. package/dist/user-config.d.ts.map +1 -0
  40. package/dist/user-config.js +265 -0
  41. package/dist/user-config.js.map +1 -0
  42. package/package.json +56 -0
  43. package/src/config-writer.test.ts +52 -0
  44. package/src/config-writer.ts +88 -0
  45. package/src/define.ts +19 -0
  46. package/src/index.ts +64 -0
  47. package/src/loader.test.ts +122 -0
  48. package/src/loader.ts +232 -0
  49. package/src/loader.yaml.test.ts +149 -0
  50. package/src/merge.test.ts +78 -0
  51. package/src/merge.ts +44 -0
  52. package/src/plugin-settings-schema.ts +18 -0
  53. package/src/plugin.test.ts +310 -0
  54. package/src/plugin.ts +360 -0
  55. package/src/plugins-tree-schema.test.ts +25 -0
  56. package/src/plugins-tree-schema.ts +103 -0
  57. package/src/schema.ts +218 -0
  58. package/src/security-config.test.ts +30 -0
  59. package/src/user-config.test.ts +113 -0
  60. package/src/user-config.ts +359 -0
package/dist/plugin.js ADDED
@@ -0,0 +1,329 @@
1
+ import { promises as fs } from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { z, createMutex, defineTool, definePlugin } from '@moxxy/sdk';
4
+ import { moxxyPath, writeFileAtomic } from '@moxxy/sdk/server';
5
+ import { findUpward, loadConfig } from './loader.js';
6
+ import { moxxyConfigSchema } from './schema.js';
7
+ import { setConfigValue } from './config-writer.js';
8
+ const scopeSchema = z.enum(['user', 'project']);
9
+ // Default scope when the model omits it. Project-local is the safer
10
+ // default for read tools — touching the user-global file is usually an
11
+ // explicit operator action, not an inferred one.
12
+ const scopeSchemaOptional = scopeSchema.optional().default('project');
13
+ const USER_YAML = () => moxxyPath('config.yaml');
14
+ // The editor tools only read/write YAML configs (`doc.setIn` then re-serialize),
15
+ // so the project-scope walk deliberately matches ONLY the YAML names — never the
16
+ // .ts/.js configs `loadConfig` also honors, which these tools can't safely edit.
17
+ // The upward-walk traversal itself is shared with loader.ts (findUpward) so the
18
+ // depth bound can't drift; only this name list differs, by design.
19
+ const PROJECT_YAML_NAMES = ['moxxy.config.yaml', 'moxxy.config.yml'];
20
+ async function findScopePath(scope, cwd) {
21
+ if (scope === 'user') {
22
+ const yaml = USER_YAML();
23
+ try {
24
+ await fs.access(yaml);
25
+ return yaml;
26
+ }
27
+ catch {
28
+ return null;
29
+ }
30
+ }
31
+ // Project scope: walk upward looking for moxxy.config.yaml first, .yml second.
32
+ return findUpward(cwd, PROJECT_YAML_NAMES);
33
+ }
34
+ function scopeDefaultPath(scope, cwd) {
35
+ return scope === 'user' ? USER_YAML() : path.join(cwd, 'moxxy.config.yaml');
36
+ }
37
+ /**
38
+ * True when a resolved project-scope target lives ABOVE cwd. The upward walk
39
+ * (findScopePath → findUpward) can resolve a config file in an ancestor dir, so
40
+ * a write/init may silently mutate a parent monorepo's or home-dir config. We
41
+ * surface this in the tool result so the operator can see the edit left the
42
+ * project root rather than discovering it after the fact. User scope is always
43
+ * the explicit ~/.moxxy path, so it never counts as an ancestor write.
44
+ */
45
+ function isOutsideCwd(target, cwd) {
46
+ const rel = path.relative(path.resolve(cwd), path.resolve(target));
47
+ return rel.startsWith('..') || path.isAbsolute(rel);
48
+ }
49
+ async function readDoc(filePath) {
50
+ const text = await fs.readFile(filePath, 'utf8').catch(() => '');
51
+ const yamlMod = (await import('yaml'));
52
+ const doc = yamlMod.parseDocument(text);
53
+ return { doc, text };
54
+ }
55
+ function parseDotPath(p) {
56
+ if (!p)
57
+ return [];
58
+ return p.split('.').map((seg) => (/^\d+$/.test(seg) ? Number(seg) : seg));
59
+ }
60
+ // True only when `cursor` is a plain object or array that has `seg` as an OWN
61
+ // (not inherited) property. Keeps config_get's dot-path traversal inside the
62
+ // parsed config instead of letting it climb the prototype chain or index into
63
+ // scalar values.
64
+ function isIndexableOwn(cursor, seg) {
65
+ if (cursor === null || typeof cursor !== 'object')
66
+ return false;
67
+ if (seg === '__proto__' || seg === 'constructor' || seg === 'prototype')
68
+ return false;
69
+ return Object.prototype.hasOwnProperty.call(cursor, seg);
70
+ }
71
+ function parseValue(raw) {
72
+ // Try JSON first (allows arrays, numbers, booleans, strings, objects).
73
+ try {
74
+ return JSON.parse(raw);
75
+ }
76
+ catch {
77
+ return raw;
78
+ }
79
+ }
80
+ // Capability fs globs shared by the tools below. The project-scope config can
81
+ // resolve in an ANCESTOR directory (findUpward's bounded walk), so these
82
+ // anchor on the well-known basenames rather than `$cwd` — the cap matcher
83
+ // tests them against absolute paths. The editor tools only ever touch YAML;
84
+ // reload/validate go through loadConfig, which also honors executable
85
+ // configs (config.ts/js in ~/.moxxy, moxxy.config.ts/js in the project).
86
+ const YAML_CONFIG_GLOBS = [
87
+ '~/.moxxy/config.yaml',
88
+ '/**/moxxy.config.yaml',
89
+ '/**/moxxy.config.yml',
90
+ ];
91
+ const LOADER_CONFIG_GLOBS = ['~/.moxxy/config.*', '/**/moxxy.config.*'];
92
+ export function buildConfigPlugin(opts = { cwd: process.cwd() }) {
93
+ const cwd = opts.cwd;
94
+ const applier = opts.applier;
95
+ // Per-instance mutex serializing the read-modify-write of the config file.
96
+ // writeFileAtomic prevents torn writes but not lost updates: two concurrent
97
+ // config_set calls (the model can fire tools in parallel) would each apply
98
+ // their edit on top of the same stale doc, and the last atomic rename would
99
+ // clobber the other. Mirrors provider-admin/store.ts.
100
+ const writeMutex = createMutex();
101
+ return definePlugin({
102
+ name: '@moxxy/plugin-config',
103
+ version: '0.0.0',
104
+ tools: [
105
+ defineTool({
106
+ name: 'config_path',
107
+ description: 'Return the resolved file path for the moxxy config at a given scope ' +
108
+ '(defaults to "project" — the moxxy.config.yaml in the current dir). ' +
109
+ 'Returns null if no file exists yet.',
110
+ inputSchema: z.object({ scope: scopeSchemaOptional }),
111
+ isolation: {
112
+ capabilities: {
113
+ fs: { read: [...YAML_CONFIG_GLOBS] },
114
+ net: { mode: 'none' },
115
+ timeMs: 10_000,
116
+ },
117
+ },
118
+ handler: async ({ scope }) => {
119
+ const found = await findScopePath(scope, cwd);
120
+ return { scope, path: found, defaultPath: scopeDefaultPath(scope, cwd) };
121
+ },
122
+ }),
123
+ defineTool({
124
+ name: 'config_show',
125
+ description: 'Return the raw text of the moxxy config at the given scope (defaults to "project"). ' +
126
+ 'Useful when the agent needs to inspect or edit it.',
127
+ inputSchema: z.object({ scope: scopeSchemaOptional }),
128
+ isolation: {
129
+ capabilities: {
130
+ fs: { read: [...YAML_CONFIG_GLOBS] },
131
+ net: { mode: 'none' },
132
+ timeMs: 10_000,
133
+ },
134
+ },
135
+ handler: async ({ scope }) => {
136
+ const found = await findScopePath(scope, cwd);
137
+ if (!found)
138
+ return { scope, path: null, text: '' };
139
+ const text = await fs.readFile(found, 'utf8');
140
+ return { scope, path: found, text };
141
+ },
142
+ }),
143
+ defineTool({
144
+ name: 'config_get',
145
+ description: 'Read a single value from the config by dot-path (e.g. "provider.model"). Returns the parsed JSON value.',
146
+ inputSchema: z.object({ scope: scopeSchemaOptional, path: z.string().min(1) }),
147
+ // `$cwd/*`: the `path` INPUT is a dot-path ("provider.model"), not a
148
+ // file, but the cap checker's key heuristic treats it as one and
149
+ // resolves it against cwd — cover that single-segment resolution so
150
+ // legitimate reads aren't denied. The real fs surface is the globs.
151
+ isolation: {
152
+ capabilities: {
153
+ fs: { read: [...YAML_CONFIG_GLOBS, '$cwd/*'] },
154
+ net: { mode: 'none' },
155
+ timeMs: 10_000,
156
+ },
157
+ },
158
+ handler: async ({ scope, path: dotPath }) => {
159
+ const found = await findScopePath(scope, cwd);
160
+ if (!found)
161
+ return null;
162
+ const yamlMod = (await import('yaml'));
163
+ const text = await fs.readFile(found, 'utf8');
164
+ const parsed = yamlMod.parse(text) ?? {};
165
+ const segs = parseDotPath(dotPath);
166
+ let cursor = parsed;
167
+ for (const seg of segs) {
168
+ // Only descend into a plain object or array, and only into an OWN
169
+ // property — otherwise a path like `constructor.prototype.toString`
170
+ // would walk the prototype chain and leak built-ins, and indexing a
171
+ // string value would return characters by number.
172
+ if (!isIndexableOwn(cursor, seg))
173
+ return null;
174
+ cursor = cursor[seg];
175
+ }
176
+ return cursor ?? null;
177
+ },
178
+ }),
179
+ defineTool({
180
+ name: 'config_set',
181
+ description: 'Set a value at a dot-path in the moxxy config. Creates the file if missing. Value is JSON-parsed (so pass `"sonnet"`, `42`, `["a","b"]`, etc).',
182
+ inputSchema: z.object({
183
+ scope: scopeSchema,
184
+ path: z.string().min(1),
185
+ value: z.string(),
186
+ }),
187
+ permission: { action: 'prompt' },
188
+ // Comment-preserving read-modify-write of the YAML config. `$cwd/*`
189
+ // covers the dot-path `path` input, which the cap checker's key
190
+ // heuristic resolves against cwd (see config_get). The live applier
191
+ // is a host-owned closure; its runtime effects are the host's.
192
+ isolation: {
193
+ capabilities: {
194
+ fs: { read: [...YAML_CONFIG_GLOBS, '$cwd/*'], write: [...YAML_CONFIG_GLOBS] },
195
+ net: { mode: 'none' },
196
+ timeMs: 30_000,
197
+ },
198
+ },
199
+ handler: async ({ scope, path: dotPath, value }) => {
200
+ // ONE write implementation for every surface: the shared
201
+ // schema-validated, comment-preserving, mutex-serialized writer
202
+ // (config-writer.ts) — the TUI /settings panel writes through the
203
+ // same function, so tool and UI writes can't interleave or drift.
204
+ const written = await setConfigValue({
205
+ scope,
206
+ cwd,
207
+ path: dotPath,
208
+ value: parseValue(value),
209
+ });
210
+ // If a runtime applier is wired, try to reflect the change live.
211
+ let runtime = { applied: [], pending: [] };
212
+ if (applier) {
213
+ try {
214
+ runtime = await applier(written.config);
215
+ }
216
+ catch (err) {
217
+ runtime = {
218
+ applied: [],
219
+ pending: [`reload-failed: ${err instanceof Error ? err.message : String(err)}`],
220
+ };
221
+ }
222
+ }
223
+ return {
224
+ path: written.path,
225
+ outsideCwd: scope === 'project' && isOutsideCwd(written.path, cwd),
226
+ runtime,
227
+ };
228
+ },
229
+ }),
230
+ defineTool({
231
+ name: 'config_reload',
232
+ description: 'Re-read the merged config from disk and apply the safe subset of changes (mode, compactor, plugin enable/disable) to the active session. Anything outside that subset is reported in `pending` and requires a restart.',
233
+ inputSchema: z.object({}),
234
+ // loadConfig may execute a .ts/.js config via jiti, whose compile
235
+ // cache lands under node_modules/.cache. The applier is a host-owned
236
+ // closure; its runtime effects (plugin load/unload) are the host's.
237
+ isolation: {
238
+ capabilities: {
239
+ fs: {
240
+ read: [...LOADER_CONFIG_GLOBS],
241
+ write: ['/**/node_modules/.cache/**', '/tmp/**'],
242
+ },
243
+ net: { mode: 'none' },
244
+ timeMs: 30_000,
245
+ },
246
+ },
247
+ handler: async () => {
248
+ if (!applier) {
249
+ return { applied: [], pending: ['(no runtime applier configured)'] };
250
+ }
251
+ const { config: fresh } = await loadConfig({ cwd });
252
+ return await applier(fresh);
253
+ },
254
+ }),
255
+ defineTool({
256
+ name: 'config_init',
257
+ description: 'Create a starter moxxy config file at the given scope (yaml format), if one does not already exist.',
258
+ inputSchema: z.object({ scope: scopeSchema }),
259
+ permission: { action: 'prompt' },
260
+ isolation: {
261
+ capabilities: {
262
+ fs: {
263
+ read: [...YAML_CONFIG_GLOBS],
264
+ write: ['~/.moxxy/config.yaml', '$cwd/moxxy.config.yaml'],
265
+ },
266
+ net: { mode: 'none' },
267
+ timeMs: 30_000,
268
+ },
269
+ },
270
+ handler: async ({ scope }) => writeMutex.run(async () => {
271
+ const existing = await findScopePath(scope, cwd);
272
+ if (existing) {
273
+ return {
274
+ path: existing,
275
+ created: false,
276
+ outsideCwd: scope === 'project' && isOutsideCwd(existing, cwd),
277
+ };
278
+ }
279
+ const target = scopeDefaultPath(scope, cwd);
280
+ await fs.mkdir(path.dirname(target), { recursive: true });
281
+ const template = `# moxxy config (${scope} scope)
282
+ # Documentation: https://docs.moxxy.ai
283
+ plugins:
284
+ provider:
285
+ default: anthropic
286
+ items:
287
+ anthropic:
288
+ model: claude-sonnet-4-6
289
+ mode:
290
+ default: default
291
+ `;
292
+ await writeFileAtomic(target, template);
293
+ return {
294
+ path: target,
295
+ created: true,
296
+ outsideCwd: scope === 'project' && isOutsideCwd(target, cwd),
297
+ };
298
+ }),
299
+ }),
300
+ defineTool({
301
+ name: 'config_validate',
302
+ description: 'Re-run schema validation on the merged config (user + project) without applying any changes. Returns ok or the list of issues.',
303
+ inputSchema: z.object({}),
304
+ // Same surface as config_reload: loadConfig may execute a .ts/.js
305
+ // config via jiti (compile cache under node_modules/.cache).
306
+ isolation: {
307
+ capabilities: {
308
+ fs: {
309
+ read: [...LOADER_CONFIG_GLOBS],
310
+ write: ['/**/node_modules/.cache/**', '/tmp/**'],
311
+ },
312
+ net: { mode: 'none' },
313
+ timeMs: 30_000,
314
+ },
315
+ },
316
+ handler: async () => {
317
+ try {
318
+ await loadConfig({ cwd });
319
+ return { ok: true };
320
+ }
321
+ catch (err) {
322
+ return { ok: false, error: err instanceof Error ? err.message : String(err) };
323
+ }
324
+ },
325
+ }),
326
+ ],
327
+ });
328
+ }
329
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAe,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBpD,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhD,oEAAoE;AACpE,uEAAuE;AACvE,iDAAiD;AACjD,MAAM,mBAAmB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtE,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAEzD,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,mEAAmE;AACnE,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