@fonderie/cli 0.6.0 → 0.7.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/bin/fonderie.mjs CHANGED
@@ -331,6 +331,7 @@ const ADMIN_PAGES = {
331
331
  user: { path: '/users', about: 'look up a user: admin user <email|id> [sessions|history|revoke-sessions|suspend|unsuspend]' },
332
332
  catalog: { path: '/catalog', about: 'plans as configured and as stored' },
333
333
  subscriber:{ path: '/subscriptions', about: 'admin subscriber <user|workspace> <id> [subscription|wallet|ledger]' },
334
+ audit: { path: '/audit', about: 'events across every workspace (--workspace, --type, --actor, --from, --to, --limit, --cursor)' },
334
335
  };
335
336
  async function adminCmd() {
336
337
  const pageName = argv[1];
@@ -372,6 +373,11 @@ async function adminCmd() {
372
373
  const before = arg('--before', undefined);
373
374
  if (pageName === 'log' && limit) q.set('limit', limit);
374
375
  if (pageName === 'log' && before) q.set('before', before);
376
+ if (pageName === 'audit') {
377
+ for (const [flag, param] of [['--workspace', 'workspaceId'], ['--type', 'type'], ['--actor', 'actorId'], ['--from', 'from'], ['--to', 'to'], ['--limit', 'limit'], ['--cursor', 'cursor']]) {
378
+ const v = arg(flag, undefined); if (v) q.set(param, v);
379
+ }
380
+ }
375
381
  const qs = q.toString();
376
382
  return adminFetch('GET', prefix + page.path + (qs ? `?${qs}` : ''));
377
383
  }
@@ -474,6 +480,7 @@ else {
474
480
  fonderie admin <attention|manifest|doctor|config|routes|tokens|log> [--limit <n>] [--before <cursor>]
475
481
  fonderie admin user <email|id> [sessions|history|revoke-sessions|suspend|unsuspend]
476
482
  fonderie admin catalog · admin subscriber <user|workspace> <id> [subscription|wallet|ledger] [--currency <c>]
483
+ fonderie admin audit [--workspace <id>] [--type <t>] [--actor <id>] [--from <iso>] [--to <iso>] [--limit <n>]
477
484
  read a deployment's operator surface (@fonderie/admin) — same env; FONDERIE_ADMIN_PREFIX if moved
478
485
 
479
486
  Zero deps. No MCP server. A binary + markdown that runs in any agent harness.`);
@@ -153,6 +153,8 @@ await (async () => {
153
153
  if (!find('GET', '/_admin/catalog')) fail('admin catalog: wrong path');
154
154
  if (!find('GET', '/_admin/subscriptions/workspace/w1')) fail('admin subscriber: wrong path');
155
155
  if (!find('GET', '/_admin/wallet/user/u1/ledger?currency=eur&limit=7')) fail('admin subscriber ledger: flags not forwarded');
156
+ await cli(['admin', 'audit', '--workspace', 'w1', '--type', 'user.login', '--limit', '9']);
157
+ if (!find('GET', '/_admin/audit?workspaceId=w1&type=user.login&limit=9')) fail('admin audit: flags not forwarded');
156
158
  let badType = 0;
157
159
  try { await cli(['admin', 'subscriber', 'team', 'x']); } catch (e) { badType = e.code; }
158
160
  if (badType !== 2) fail(`admin subscriber <bad type> should exit 2, got ${badType}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "The Fonderie CLI — teaches any coding agent the SDK without loading it eagerly. `fonderie skill` writes a lazy skill (a small router + per-package bodies read on demand); `fonderie query` answers what to install for a capability. Zero deps, runs anywhere.",
5
5
  "keywords": [
6
6
  "fonderiejs",