usegrunt 0.6.5 → 0.6.6

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.
@@ -8,12 +8,12 @@ import { setTimeout as delay } from 'node:timers/promises';
8
8
  import { intro, outro, spinner, log, note, multiselect, isCancel } from '@clack/prompts';
9
9
  import chalk from 'chalk';
10
10
  import { setupFallbacks } from './fallback-setup.js';
11
- import { parallelMap } from './parallel.js';
11
+ import { parallelMap, SETUP_CONCURRENCY } from './parallel.js';
12
12
  import { withTerminal } from './terminal.js';
13
13
  import { DOCTOR_TIMEOUT_MS } from './freebuff.js';
14
14
  import { BrowserSquire, PROVIDERS, setup, squireEnvironment } from './setup.js';
15
15
  import { RegistrySync } from './registry.js';
16
- import { bundledRegistry, knownAdapters } from '../registry.js';
16
+ import { bundledRegistry, disabledAdapters, knownAdapters } from '../registry.js';
17
17
  import { banner } from './banner.js';
18
18
  import { approveDataSharing, requiresDataSharing } from './data-sharing.js';
19
19
  import { HARNESSES, configurePi, connectHarness, detectHarnesses } from './harnesses.js';
@@ -134,9 +134,9 @@ const xml = (value) => value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').re
134
134
  export async function installedSources(directory = configDir()) {
135
135
  try {
136
136
  const sources = JSON.parse(await readFile(join(directory, 'installed-sources.json'), 'utf8'));
137
- if (!Array.isArray(sources) || !sources.length || sources.some(id => typeof id !== 'string' || ![...knownAdapters, 'freellmapi'].includes(id)))
137
+ if (!Array.isArray(sources) || sources.some(id => typeof id !== 'string' || ![...knownAdapters, 'freellmapi'].includes(id)))
138
138
  throw new Error('Invalid saved grunt sources');
139
- return [...new Set(sources)].join(',');
139
+ return [...new Set(sources)].filter(id => !disabledAdapters.has(id)).join(',');
140
140
  }
141
141
  catch (error) {
142
142
  if (error.code !== 'ENOENT')
@@ -148,13 +148,16 @@ export async function installedSources(directory = configDir()) {
148
148
  catch (error) {
149
149
  if (error.code !== 'ENOENT')
150
150
  throw error;
151
- return 'freebuff,opencode,kilo,zro';
151
+ return 'opencode,kilo,zro';
152
152
  }
153
- return 'freellmapi,kilo,freebuff,opencode,zro';
153
+ return 'freellmapi,kilo,opencode,zro';
154
154
  }
155
155
  export async function installService(adapters) {
156
156
  if (!['linux', 'darwin'].includes(process.platform))
157
157
  throw new Error('grunt background service requires systemd or launchd');
158
+ const selected = [...new Set(adapters ?? (await installedSources()).split(','))].filter(id => id && !disabledAdapters.has(id));
159
+ if (selected.some(id => !knownAdapters.has(id) && id !== 'freellmapi'))
160
+ throw new Error('Invalid grunt service selection');
158
161
  const directory = configDir(), runtime = join(directory, 'runtime');
159
162
  // npx cache entries can disappear. Keep a backend runtime outside that cache.
160
163
  const root = fileURLToPath(new URL('../../', import.meta.url));
@@ -167,7 +170,7 @@ export async function installService(adapters) {
167
170
  const port = process.env.MILO_PORT || '8788';
168
171
  if (!/^\d+$/.test(port) || Number(port) < 1 || Number(port) > 65535)
169
172
  throw new Error('Invalid grunt service port');
170
- const env = { GRUNT_DAEMON: '1', MILO_CONFIG_DIR: directory, MILO_PORT: port, MILO_SOURCES: adapters?.join(',') ?? await installedSources(directory), PATH: process.env.PATH || '/usr/local/bin:/usr/bin:/bin' };
173
+ const env = { GRUNT_DAEMON: '1', MILO_CONFIG_DIR: directory, MILO_PORT: port, MILO_SOURCES: selected.join(','), PATH: process.env.PATH || '/usr/local/bin:/usr/bin:/bin' };
171
174
  if (process.env.MILO_FREELLMAPI_URL)
172
175
  env.MILO_FREELLMAPI_URL = process.env.MILO_FREELLMAPI_URL;
173
176
  const opencodeConfig = join(directory, 'opencode-free.json');
@@ -180,7 +183,7 @@ export async function installService(adapters) {
180
183
  throw error;
181
184
  }
182
185
  await installBackgroundService('milo', entry, env);
183
- await writeFile(join(directory, 'installed-sources.json'), JSON.stringify(env.MILO_SOURCES.split(',')), { mode: 0o600 });
186
+ await writeFile(join(directory, 'installed-sources.json'), JSON.stringify(selected), { mode: 0o600 });
184
187
  }
185
188
  export async function installBackgroundService(name, entry, env) {
186
189
  if (!/^[a-z][a-z0-9-]*$/.test(name))
@@ -202,8 +205,8 @@ export async function installBackgroundService(name, entry, env) {
202
205
  await command('launchctl', ['bootstrap', domain, plist]);
203
206
  }
204
207
  }
205
- // /v1/models asks every source whether it is available, and Freebuff runs `freebuff doctor` to answer.
206
- // Give each probe longer than that check, and stop after totalMs so a hung service still fails.
208
+ // /v1/models asks every source whether it is available. Bound the combined probe
209
+ // so a hung native CLI cannot leave the installer waiting forever.
207
210
  export async function checkService(port = 8788, totalMs = 90000) {
208
211
  const deadline = Date.now() + totalMs;
209
212
  while (Date.now() < deadline) {
@@ -255,7 +258,7 @@ export async function checkServiceSources(unavailable, notify = console.log, ada
255
258
  notify(`${id}: FAIL — ${unit.origin} sets MILO_SOURCES=${unit.sources.join(',')}, which lacks ${id}. Setup does not edit it; add ${id} there or remove that setting.`);
256
259
  }
257
260
  }
258
- export async function checkFallbackServices(unavailable, port = 8788, notify = console.log, adapters = ['freebuff', 'opencode'], wait = { limit: 180000, interval: 2000 }) {
261
+ export async function checkFallbackServices(unavailable, port = 8788, notify = console.log, adapters = ['opencode'], wait = { limit: 180000, interval: 2000 }) {
259
262
  const directory = await mkdtemp(join(tmpdir(), 'milo-free-check-'));
260
263
  try {
261
264
  for (const source of adapters) {
@@ -398,6 +401,8 @@ export async function connectHarnesses(port, options = {}) {
398
401
  }
399
402
  const wizardActions = { installedSources, createSquire: () => new BrowserSquire(), banner, preflight, connectSquire, setup, setupFallbacks, installService, configurePi, checkService, checkFallbackServices, loadRegistry, checkServiceSources, connectHarnesses, approveDataSharing };
400
403
  export async function wizard(add, actions = wizardActions) {
404
+ if (add && disabledAdapters.has(add))
405
+ throw new Error(`${add} routing is disabled`);
401
406
  if (add && !Object.hasOwn(PROVIDERS, add))
402
407
  throw new Error(`Choose a supported provider: ${Object.keys(PROVIDERS).join(', ')}`);
403
408
  const squire = actions.createSquire?.();
@@ -409,20 +414,18 @@ export async function wizard(add, actions = wizardActions) {
409
414
  note(SQUIRE_NOTICE, 'Google sign-in for Trusty Squire');
410
415
  await step('Connecting Trusty Squire', () => actions.connectSquire(squire ? { squire } : {}));
411
416
  // Capture legacy API routing before default Kilo setup creates its admin file.
412
- const previous = (await actions.installedSources?.())?.split(',') ?? [];
417
+ const previous = ((await actions.installedSources?.())?.split(',') ?? []).filter(id => id && !disabledAdapters.has(id));
413
418
  if (add) {
414
- const defaults = bundledRegistry.adapters.filter(adapter => knownAdapters.has(adapter.id)).map(adapter => adapter.id);
415
- const sources = ['kilo', 'nvidia', 'zro', 'tokenharbor', 'runcrate', 'apinex', 'mistral-vibe', 'livekit'].includes(add)
419
+ const defaults = bundledRegistry.adapters.filter(adapter => knownAdapters.has(adapter.id) && !disabledAdapters.has(adapter.id)).map(adapter => adapter.id);
420
+ const sources = ['kilo', 'nvidia', 'zro', 'tokenharbor', 'runcrate', 'apinex', 'mistral-vibe', 'livekit', 'pollinations', 'beatapi', 'clixad', 'perch'].includes(add)
416
421
  ? [...new Set([...(previous.length ? previous : defaults), add])]
417
422
  : [...new Set(['freellmapi', ...previous, ...defaults])];
418
423
  const consent = await (actions.approveDataSharing ?? approveDataSharing)({ directory: configDir(), providers: sources });
419
424
  if (consent.skipped.includes(add)) {
420
425
  // A declined addition still needs to replace a previously installed
421
426
  // runtime that predates consent enforcement. Keep only prior choices.
422
- if (previous.length) {
423
- await step('Updating the grunt background service', () => actions.installService(previous));
424
- await step('Waiting for grunt to answer', () => actions.checkService(Number(process.env.MILO_PORT || '8788')));
425
- }
427
+ await step('Updating the grunt background service', () => actions.installService(previous));
428
+ await step('Waiting for grunt to answer', () => actions.checkService(Number(process.env.MILO_PORT || '8788')));
426
429
  outro(`${add} skipped; data sharing was not approved`);
427
430
  return;
428
431
  }
@@ -445,9 +448,9 @@ export async function wizard(add, actions = wizardActions) {
445
448
  log.info(`Registry: ${registry.adapters.length} free services, published ${published}`);
446
449
  else
447
450
  log.warn(`Registry unreachable; using the ${pulled.origin === 'cache' ? 'list saved by an earlier setup' : 'list bundled with this version'} (published ${published})`);
448
- const adapters = registry.adapters.filter(adapter => knownAdapters.has(adapter.id));
451
+ const adapters = registry.adapters.filter(adapter => knownAdapters.has(adapter.id) && !disabledAdapters.has(adapter.id));
449
452
  log.message(registry.adapters.map(adapter => knownAdapters.has(adapter.id)
450
- ? `${chalk.bold(adapter.id.padEnd(10))} ${chalk.dim(describe(adapter))}`
453
+ ? `${chalk.bold(adapter.id.padEnd(10))} ${chalk.dim(disabledAdapters.has(adapter.id) ? 'disabled pending integration review' : describe(adapter))}`
451
454
  : `${chalk.dim(adapter.id.padEnd(10))} ${chalk.dim('skipped: needs a newer usegrunt')}`).join('\n'));
452
455
  const requested = adapters.map(adapter => adapter.id);
453
456
  const consent = await (actions.approveDataSharing ?? approveDataSharing)({ directory: configDir(), providers: requested });
@@ -468,7 +471,7 @@ export async function wizard(add, actions = wizardActions) {
468
471
  outro('No approved free services are available; the background service now enforces your data-sharing choices');
469
472
  return;
470
473
  }
471
- log.step(`Installing and connecting ${ids.length} vetted free services (up to 3 at once)`);
474
+ log.step(`Installing and connecting ${ids.length} vetted free services (up to ${SETUP_CONCURRENCY} at once)`);
472
475
  log.info('Trusty Squire reuses existing accounts and grants. Only free access is requested. Provider verification may still need your browser; verification prompts are queued.');
473
476
  const outcome = await actions.setupFallbacks({ directory: configDir(), run: command, adapters: ids, notify,
474
477
  ...(consent.approved.length ? { dataSharingApproved: consent.approved } : {}),
@@ -1,23 +1,12 @@
1
1
  {
2
2
  "version": 1,
3
- "published": "2026-11-15T06:09:28Z",
3
+ "published": "2026-11-15T19:14:43.749Z",
4
4
  "adapters": [
5
- {
6
- "id": "freebuff",
7
- "kind": "agent",
8
- "tier": "stable",
9
- "weight": 0.192,
10
- "modalities": [
11
- "text"
12
- ],
13
- "install": "npm:freebuff",
14
- "signup": "https://freebuff.com/login"
15
- },
16
5
  {
17
6
  "id": "opencode",
18
7
  "kind": "agent",
19
8
  "tier": "stable",
20
- "weight": 0.192,
9
+ "weight": 0.25263157894736843,
21
10
  "modalities": [
22
11
  "text"
23
12
  ],
@@ -32,19 +21,18 @@
32
21
  "id": "kilo",
33
22
  "kind": "model",
34
23
  "tier": "stable",
35
- "weight": 0.256,
24
+ "weight": 0.3368421052631579,
36
25
  "modalities": [
37
26
  "text"
38
27
  ],
39
28
  "install": "builtin:kilo",
40
- "signup": "https://app.kilo.ai/profile",
41
- "model": "kilo-auto/free"
29
+ "model": "particle-ai/particle-1:free"
42
30
  },
43
31
  {
44
32
  "id": "zro",
45
33
  "kind": "model",
46
34
  "tier": "stable",
47
- "weight": 0.16,
35
+ "weight": 0.21052631578947367,
48
36
  "modalities": [
49
37
  "text"
50
38
  ],
@@ -56,7 +44,7 @@
56
44
  "id": "tokenharbor",
57
45
  "kind": "model",
58
46
  "tier": "experimental",
59
- "weight": 0.04,
47
+ "weight": 0.025,
60
48
  "modalities": [
61
49
  "text"
62
50
  ],
@@ -68,7 +56,7 @@
68
56
  "id": "runcrate",
69
57
  "kind": "model",
70
58
  "tier": "experimental",
71
- "weight": 0.04,
59
+ "weight": 0.025,
72
60
  "modalities": [
73
61
  "text"
74
62
  ],
@@ -76,23 +64,11 @@
76
64
  "signup": "https://www.runcrate.ai/inference/free",
77
65
  "model": "deepseek-ai/DeepSeek-V4.1-Flash"
78
66
  },
79
- {
80
- "id": "apinex",
81
- "kind": "model",
82
- "tier": "experimental",
83
- "weight": 0.04,
84
- "modalities": [
85
- "text"
86
- ],
87
- "install": "builtin:apinex",
88
- "signup": "https://apinex.bond/register",
89
- "model": "free/deepseek-v4.1-flash"
90
- },
91
67
  {
92
68
  "id": "mistral-vibe",
93
69
  "kind": "agent",
94
70
  "tier": "experimental",
95
- "weight": 0.04,
71
+ "weight": 0.025,
96
72
  "modalities": [
97
73
  "text"
98
74
  ],
@@ -104,13 +80,61 @@
104
80
  "id": "livekit",
105
81
  "kind": "model",
106
82
  "tier": "experimental",
107
- "weight": 0.04,
83
+ "weight": 0.025,
108
84
  "modalities": [
109
85
  "text"
110
86
  ],
111
87
  "install": "builtin:livekit",
112
88
  "signup": "https://cloud.livekit.io/",
113
89
  "model": "deepseek-ai/deepseek-v4.1-flash"
90
+ },
91
+ {
92
+ "id": "pollinations",
93
+ "kind": "model",
94
+ "tier": "experimental",
95
+ "weight": 0.025,
96
+ "modalities": [
97
+ "text"
98
+ ],
99
+ "install": "builtin:pollinations",
100
+ "signup": "https://enter.pollinations.ai/",
101
+ "model": "community/morriszdweck/glm-5.3-flash-free"
102
+ },
103
+ {
104
+ "id": "beatapi",
105
+ "kind": "model",
106
+ "tier": "experimental",
107
+ "weight": 0.025,
108
+ "modalities": [
109
+ "text"
110
+ ],
111
+ "install": "builtin:beatapi",
112
+ "signup": "https://beatapi.io/",
113
+ "model": "deepseek-v4.1-flash-free"
114
+ },
115
+ {
116
+ "id": "clixad",
117
+ "kind": "agent",
118
+ "tier": "experimental",
119
+ "weight": 0.025,
120
+ "modalities": [
121
+ "text"
122
+ ],
123
+ "install": "builtin:clixad",
124
+ "signup": "https://app.clixad.io",
125
+ "model": "glm-5.3-flash"
126
+ },
127
+ {
128
+ "id": "perch",
129
+ "kind": "agent",
130
+ "tier": "experimental",
131
+ "weight": 0.025,
132
+ "modalities": [
133
+ "text"
134
+ ],
135
+ "install": "builtin:perch",
136
+ "signup": "https://www.perchai.app",
137
+ "model": "deepseek-flash-starter"
114
138
  }
115
139
  ]
116
140
  }
package/dist/registry.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { pathToFileURL } from 'node:url';
3
- const installers = { freebuff: 'npm:freebuff', opencode: 'npm:opencode-ai', kilo: 'builtin:kilo', nvidia: 'builtin:nvidia', zro: 'builtin:zro', tokenharbor: 'builtin:tokenharbor', runcrate: 'builtin:runcrate', apinex: 'builtin:apinex', 'mistral-vibe': 'builtin:mistral-vibe', livekit: 'builtin:livekit' };
3
+ const installers = { freebuff: 'npm:freebuff', opencode: 'npm:opencode-ai', kilo: 'builtin:kilo', nvidia: 'builtin:nvidia', zro: 'builtin:zro', tokenharbor: 'builtin:tokenharbor', runcrate: 'builtin:runcrate', apinex: 'builtin:apinex', 'mistral-vibe': 'builtin:mistral-vibe', livekit: 'builtin:livekit', pollinations: 'builtin:pollinations', beatapi: 'builtin:beatapi', clixad: 'builtin:clixad', perch: 'builtin:perch' };
4
4
  export const knownAdapters = new Set(Object.keys(installers));
5
+ // Retain schema compatibility with saved registries while stopping every app route.
6
+ export const disabledAdapters = new Set(['freebuff', 'apinex']);
5
7
  export function validateRegistry(value) {
6
8
  const fail = () => { throw new Error('Invalid adapter registry'); };
7
9
  if (!value || typeof value !== 'object' || Array.isArray(value))
@@ -39,7 +41,7 @@ export function validateRegistry(value) {
39
41
  return fail();
40
42
  }
41
43
  // Known adapters have fixed installers and capabilities; registry data never supplies code.
42
- if (knownAdapters.has(a.id) && (a.kind !== (['kilo', 'nvidia', 'zro', 'tokenharbor', 'runcrate', 'apinex', 'livekit'].includes(a.id) ? 'model' : 'agent') || a.install !== installers[a.id]
44
+ if (knownAdapters.has(a.id) && (a.kind !== (['kilo', 'nvidia', 'zro', 'tokenharbor', 'runcrate', 'apinex', 'livekit', 'pollinations', 'beatapi'].includes(a.id) ? 'model' : 'agent') || a.install !== installers[a.id]
43
45
  || a.modalities.some(m => m !== 'text')))
44
46
  return fail();
45
47
  ids.add(a.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usegrunt",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"