@commandgarden/cli 2.14.3 → 2.15.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 (25) hide show
  1. package/node_modules/@commandgarden/app/dist/client/assets/Slides-5KujoV-w.js +30 -0
  2. package/node_modules/@commandgarden/app/dist/client/assets/index-2gEJ4GIc.js +521 -0
  3. package/node_modules/@commandgarden/app/dist/client/assets/{index-rHqHbsBw.css → index-CHt4v0FJ.css} +1 -1
  4. package/node_modules/@commandgarden/app/dist/client/index.html +2 -2
  5. package/node_modules/@commandgarden/app/dist/server/routes/ai-news-cache.d.ts +3 -0
  6. package/node_modules/@commandgarden/app/dist/server/routes/ai-news-cache.js +17 -0
  7. package/node_modules/@commandgarden/app/dist/server/routes/connectors.js +4 -0
  8. package/node_modules/@commandgarden/app/dist/server/routes/index.js +4 -0
  9. package/node_modules/@commandgarden/app/dist/server/routes/roles-cache.d.ts +3 -0
  10. package/node_modules/@commandgarden/app/dist/server/routes/roles-cache.js +17 -0
  11. package/node_modules/@commandgarden/app/dist/server/store.d.ts +12 -0
  12. package/node_modules/@commandgarden/app/dist/server/store.js +44 -0
  13. package/node_modules/@commandgarden/app/skills/cg/SKILL.md +4 -0
  14. package/node_modules/@commandgarden/chrome/dist/service-worker.js +1 -1
  15. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  16. package/node_modules/@commandgarden/daemon/connectors/alice-role-list.yaml +62 -0
  17. package/node_modules/@commandgarden/daemon/connectors/every-newsletter.eval.js +87 -0
  18. package/node_modules/@commandgarden/daemon/connectors/every-newsletter.yaml +40 -0
  19. package/node_modules/@commandgarden/daemon/connectors/simonwillison-blog.eval.js +39 -0
  20. package/node_modules/@commandgarden/daemon/connectors/simonwillison-blog.yaml +39 -0
  21. package/node_modules/@commandgarden/daemon/connectors/uis-mic-user-information.eval.js +22 -0
  22. package/node_modules/@commandgarden/daemon/connectors/uis-mic-user-information.yaml +54 -0
  23. package/package.json +1 -1
  24. package/node_modules/@commandgarden/app/dist/client/assets/Slides-DMIm_HgI.js +0 -21
  25. package/node_modules/@commandgarden/app/dist/client/assets/index-CupEN1w-.js +0 -511
@@ -5,6 +5,10 @@ const APP_ROUTES = {
5
5
  'saba/pending-training': '/apps/saba',
6
6
  'tokenmaster/clients-list': '/apps/trusted-peer-expiry',
7
7
  'tokenmaster/client-trustedby': '/apps/trusted-peer-expiry',
8
+ 'alice/role-list': '/apps/roles',
9
+ 'uis/mic-user-information': '/apps/roles',
10
+ 'simonwillison/blog': '/apps/ai-news',
11
+ 'every/newsletter': '/apps/ai-news',
8
12
  };
9
13
  export function connectorRoutes(app, daemon) {
10
14
  app.get('/api/connectors', async () => {
@@ -8,7 +8,9 @@ import { goalsRoutes } from './goals.js';
8
8
  import { timetrackingCacheRoutes } from './timetracking-cache.js';
9
9
  import { journalRoutes } from './journal.js';
10
10
  import { securityNewsCacheRoutes } from './security-news-cache.js';
11
+ import { aiNewsCacheRoutes } from './ai-news-cache.js';
11
12
  import { trustedPeersCacheRoutes } from './trusted-peers-cache.js';
13
+ import { rolesCacheRoutes } from './roles-cache.js';
12
14
  import { roomAvailabilityCacheRoutes } from './room-availability-cache.js';
13
15
  import { skillsRoutes } from './skills.js';
14
16
  export function registerRoutes(app, daemon, store) {
@@ -22,7 +24,9 @@ export function registerRoutes(app, daemon, store) {
22
24
  timetrackingCacheRoutes(app, store);
23
25
  journalRoutes(app, daemon, store);
24
26
  securityNewsCacheRoutes(app, store);
27
+ aiNewsCacheRoutes(app, store);
25
28
  trustedPeersCacheRoutes(app, store);
29
+ rolesCacheRoutes(app, store);
26
30
  roomAvailabilityCacheRoutes(app, store);
27
31
  skillsRoutes(app);
28
32
  }
@@ -0,0 +1,3 @@
1
+ import type { FastifyInstance } from 'fastify';
2
+ import type { AppStore } from '../store.js';
3
+ export declare function rolesCacheRoutes(app: FastifyInstance, store: AppStore): void;
@@ -0,0 +1,17 @@
1
+ export function rolesCacheRoutes(app, store) {
2
+ app.get('/api/roles/cache', async () => {
3
+ const cached = store.getCachedRoles();
4
+ if (!cached)
5
+ return { ok: true, userId: null, uisData: null, aliceData: null, fetchedAt: null };
6
+ return { ok: true, userId: cached.userId, uisData: cached.uisData, aliceData: cached.aliceData, fetchedAt: cached.fetchedAt };
7
+ });
8
+ app.post('/api/roles/cache', async (req, reply) => {
9
+ const { userId, uisData, aliceData } = req.body;
10
+ if (!userId || typeof userId !== 'string') {
11
+ reply.code(400);
12
+ return { ok: false, error: 'Missing userId' };
13
+ }
14
+ store.cacheRoles(userId, uisData ?? null, aliceData ?? null);
15
+ return { ok: true };
16
+ });
17
+ }
@@ -48,11 +48,23 @@ export declare class AppStore {
48
48
  data: Record<string, unknown>[];
49
49
  fetchedAt: string;
50
50
  } | null;
51
+ cacheRoles(userId: string, uisData: Record<string, unknown> | null, aliceData: Record<string, unknown>[] | null): void;
52
+ getCachedRoles(): {
53
+ userId: string;
54
+ uisData: Record<string, unknown> | null;
55
+ aliceData: Record<string, unknown>[] | null;
56
+ fetchedAt: string;
57
+ } | null;
51
58
  cacheSecurityNews(data: Record<string, unknown>[]): void;
52
59
  getCachedSecurityNews(): {
53
60
  data: Record<string, unknown>[];
54
61
  fetchedAt: string;
55
62
  } | null;
63
+ cacheAiNews(data: Record<string, unknown>[]): void;
64
+ getCachedAiNews(): {
65
+ data: Record<string, unknown>[];
66
+ fetchedAt: string;
67
+ } | null;
56
68
  cacheRoomAvailability(date: string, data: Record<string, unknown>[]): void;
57
69
  getCachedRoomAvailability(date: string): {
58
70
  data: Record<string, unknown>[];
@@ -101,11 +101,23 @@ export class AppStore {
101
101
  id INTEGER PRIMARY KEY CHECK (id = 1),
102
102
  data TEXT NOT NULL,
103
103
  fetched_at TEXT NOT NULL
104
+ )`);
105
+ this.db.run(`CREATE TABLE IF NOT EXISTS ai_news_cache (
106
+ id INTEGER PRIMARY KEY CHECK (id = 1),
107
+ data TEXT NOT NULL,
108
+ fetched_at TEXT NOT NULL
104
109
  )`);
105
110
  this.db.run(`CREATE TABLE IF NOT EXISTS trusted_peers_cache (
106
111
  id INTEGER PRIMARY KEY CHECK (id = 1),
107
112
  data TEXT NOT NULL,
108
113
  fetched_at TEXT NOT NULL
114
+ )`);
115
+ this.db.run(`CREATE TABLE IF NOT EXISTS roles_cache (
116
+ id INTEGER PRIMARY KEY CHECK (id = 1),
117
+ user_id TEXT NOT NULL,
118
+ uis_data TEXT,
119
+ alice_data TEXT,
120
+ fetched_at TEXT NOT NULL
109
121
  )`);
110
122
  this.db.run(`CREATE TABLE IF NOT EXISTS room_availability_cache (
111
123
  date TEXT PRIMARY KEY,
@@ -258,6 +270,24 @@ export class AppStore {
258
270
  fetchedAt: rows[0].fetched_at,
259
271
  };
260
272
  }
273
+ cacheRoles(userId, uisData, aliceData) {
274
+ const now = new Date().toISOString();
275
+ this.db.run('INSERT OR REPLACE INTO roles_cache (id, user_id, uis_data, alice_data, fetched_at) VALUES (1, ?, ?, ?, ?)', [userId, uisData ? JSON.stringify(uisData) : null, aliceData ? JSON.stringify(aliceData) : null, now]);
276
+ this.persist();
277
+ }
278
+ getCachedRoles() {
279
+ const rows = this.query('SELECT user_id, uis_data, alice_data, fetched_at FROM roles_cache WHERE id = 1');
280
+ if (rows.length === 0)
281
+ return null;
282
+ const uisRaw = rows[0].uis_data;
283
+ const aliceRaw = rows[0].alice_data;
284
+ return {
285
+ userId: rows[0].user_id,
286
+ uisData: uisRaw ? JSON.parse(uisRaw) : null,
287
+ aliceData: aliceRaw ? JSON.parse(aliceRaw) : null,
288
+ fetchedAt: rows[0].fetched_at,
289
+ };
290
+ }
261
291
  cacheSecurityNews(data) {
262
292
  const now = new Date().toISOString();
263
293
  this.db.run('INSERT OR REPLACE INTO security_news_cache (id, data, fetched_at) VALUES (1, ?, ?)', [JSON.stringify(data), now]);
@@ -272,6 +302,20 @@ export class AppStore {
272
302
  fetchedAt: rows[0].fetched_at,
273
303
  };
274
304
  }
305
+ cacheAiNews(data) {
306
+ const now = new Date().toISOString();
307
+ this.db.run('INSERT OR REPLACE INTO ai_news_cache (id, data, fetched_at) VALUES (1, ?, ?)', [JSON.stringify(data), now]);
308
+ this.persist();
309
+ }
310
+ getCachedAiNews() {
311
+ const rows = this.query('SELECT data, fetched_at FROM ai_news_cache WHERE id = 1');
312
+ if (rows.length === 0)
313
+ return null;
314
+ return {
315
+ data: JSON.parse(rows[0].data),
316
+ fetchedAt: rows[0].fetched_at,
317
+ };
318
+ }
275
319
  cacheRoomAvailability(date, data) {
276
320
  const now = new Date().toISOString();
277
321
  this.db.run('INSERT OR REPLACE INTO room_availability_cache (date, data, fetched_at) VALUES (?, ?, ?)', [date, JSON.stringify(data), now]);
@@ -42,6 +42,8 @@ Errors return plain text starting with `Error:` — not JSON.
42
42
  | Key | Description | Args |
43
43
  |-----|-------------|------|
44
44
  | `ado/git-commits` | ADO Git commits & PRs for a date range | `org`, `project`, `repo`, `fromDate`, `toDate`, `author` |
45
+ | `alice/role-list` | Role assignments for a user from Alice | `userId` |
46
+ | `every/newsletter` | Latest blog posts from Every | `sort` (optional) |
45
47
  | `gcs/kb-pages` | GCS Knowledge Base page index | — |
46
48
  | `gcs/kb-content` | Retrieve one GCS KB page as Markdown | `path` |
47
49
  | `jira/my-tickets` | Jira tickets assigned to user | `fromDate`, `toDate`, `assignee` |
@@ -55,6 +57,8 @@ Errors return plain text starting with `Error:` — not JSON.
55
57
  | `tldrsec/newsletter` | tl;dr sec newsletter issues | — |
56
58
  | `tokenmaster/client-trustedby` | Clients that trust a given client | `clientid`, `region` |
57
59
  | `tokenmaster/clients-list` | Clients managed by current user | `region` |
60
+ | `uis/mic-user-information` | User identity, department, groups, and scopes from UIS | `userId` |
61
+ | `simonwillison/blog` | Simon Willison's blog posts (Atom feed) | `tag` (optional) |
58
62
  | `wiz/blog-security` | Wiz security blog posts | `tag` (optional) |
59
63
 
60
64
  ## Errors
@@ -6928,7 +6928,7 @@ var PipelineContext = class {
6928
6928
  applyFilter(field, operator, value) {
6929
6929
  this.data = this.data.filter((row) => {
6930
6930
  const actual = row[field];
6931
- const expected = isNaN(Number(value)) ? value : Number(value);
6931
+ const expected = value === "" || isNaN(Number(value)) ? value : Number(value);
6932
6932
  switch (operator) {
6933
6933
  case "eq":
6934
6934
  return actual === expected;