@commandgarden/cli 2.5.1 → 2.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.
Files changed (56) hide show
  1. package/dist/main.js +0 -0
  2. package/node_modules/@commandgarden/app/dist/client/assets/Slides-0sL-MDMf.js +31 -0
  3. package/node_modules/@commandgarden/app/dist/client/assets/index-Bzw5cF_s.js +461 -0
  4. package/node_modules/@commandgarden/app/dist/client/assets/index-DrFywqdr.css +1 -0
  5. package/node_modules/@commandgarden/app/dist/client/index.html +19 -19
  6. package/node_modules/@commandgarden/app/dist/server/journal/sources/git.source.d.ts +1 -1
  7. package/node_modules/@commandgarden/app/dist/server/journal/sources/git.source.js +2 -2
  8. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.d.ts +12 -13
  9. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.js +70 -17
  10. package/node_modules/@commandgarden/app/dist/server/store.js +35 -35
  11. package/node_modules/@commandgarden/app/package.json +42 -42
  12. package/node_modules/@commandgarden/chrome/dist/content-script.js.map +1 -1
  13. package/node_modules/@commandgarden/chrome/dist/manifest.json +16 -16
  14. package/node_modules/@commandgarden/chrome/dist/popup.html +218 -218
  15. package/node_modules/@commandgarden/chrome/dist/popup.js.map +1 -1
  16. package/node_modules/@commandgarden/chrome/dist/service-worker.js +68 -13
  17. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  18. package/node_modules/@commandgarden/chrome/package.json +25 -25
  19. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.eval.js +100 -143
  20. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.yaml +70 -70
  21. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-content.yaml +58 -58
  22. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-pages.yaml +47 -47
  23. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.eval.js +115 -115
  24. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.yaml +54 -54
  25. package/node_modules/@commandgarden/daemon/connectors/lib/msal-token.js +20 -20
  26. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.eval.js +198 -186
  27. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.yaml +42 -41
  28. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.eval.js +94 -94
  29. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.yaml +34 -34
  30. package/node_modules/@commandgarden/daemon/connectors/socket-security-news.yaml +63 -63
  31. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +437 -343
  32. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +53 -47
  33. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.eval.js +547 -547
  34. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.yaml +48 -48
  35. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.eval.js +52 -52
  36. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.yaml +42 -42
  37. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.eval.js +81 -81
  38. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.yaml +52 -52
  39. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.eval.js +27 -27
  40. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.yaml +38 -38
  41. package/node_modules/@commandgarden/daemon/connectors/tokenmaster-clients-list.yaml +55 -55
  42. package/node_modules/@commandgarden/daemon/dist/audit-store.js +8 -8
  43. package/node_modules/@commandgarden/daemon/dist/ws-relay.js +1 -1
  44. package/node_modules/@commandgarden/daemon/package.json +32 -32
  45. package/node_modules/@commandgarden/shared/package.json +32 -32
  46. package/package.json +58 -58
  47. package/node_modules/@commandgarden/app/dist/client/assets/index-DCptfmmK.js +0 -397
  48. package/node_modules/@commandgarden/app/dist/client/assets/index-qunCIeG9.css +0 -1
  49. package/node_modules/@commandgarden/app/dist/server/daemon-client.test.js +0 -47
  50. package/node_modules/@commandgarden/app/dist/server/routes/routes.test.js +0 -137
  51. package/node_modules/@commandgarden/app/dist/server/store.test.js +0 -59
  52. package/node_modules/@commandgarden/chrome/dist/fetch-interceptor.js +0 -44
  53. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts +0 -24
  54. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts.map +0 -1
  55. package/node_modules/@commandgarden/daemon/dist/cdp-client.js +0 -150
  56. package/node_modules/@commandgarden/daemon/dist/cdp-client.js.map +0 -1
@@ -1,150 +0,0 @@
1
- // src/cdp-client.ts
2
- //
3
- // Lightweight CDP (Chrome DevTools Protocol) client that connects to Chrome's
4
- // --remote-debugging-port and calls Network.enable on target tabs. This forces
5
- // Chrome to route Service Worker-handled requests through the observable path,
6
- // making them visible to window.fetch interceptors in the page context.
7
- //
8
- // Without Network.enable, OWA's getSchedule GraphQL call goes through the
9
- // Service Worker's internal fetch — invisible to any page-level interception.
10
- import { WebSocket } from 'ws';
11
- export class CdpClient {
12
- port;
13
- ws = null;
14
- msgId = 0;
15
- pending = new Map();
16
- sessionIds = new Set();
17
- constructor(port) {
18
- this.port = port;
19
- }
20
- /** Connect to Chrome's browser-level CDP endpoint. */
21
- async connect() {
22
- const versionUrl = `http://127.0.0.1:${this.port}/json/version`;
23
- const resp = await fetch(versionUrl);
24
- if (!resp.ok)
25
- throw new Error(`CDP version endpoint returned ${resp.status}`);
26
- const info = await resp.json();
27
- const wsUrl = info.webSocketDebuggerUrl;
28
- if (!wsUrl)
29
- throw new Error('No webSocketDebuggerUrl in CDP version response');
30
- return new Promise((resolve, reject) => {
31
- const ws = new WebSocket(wsUrl);
32
- const timeout = setTimeout(() => {
33
- ws.close();
34
- reject(new Error('CDP WebSocket connection timed out'));
35
- }, 5000);
36
- ws.on('open', () => {
37
- clearTimeout(timeout);
38
- this.ws = ws;
39
- resolve();
40
- });
41
- ws.on('error', (err) => {
42
- clearTimeout(timeout);
43
- reject(new Error(`CDP WebSocket error: ${err.message}`));
44
- });
45
- ws.on('message', (data) => {
46
- try {
47
- const msg = JSON.parse(String(data));
48
- // Handle responses to our commands
49
- if (msg.id !== undefined) {
50
- const entry = this.pending.get(msg.id);
51
- if (entry) {
52
- this.pending.delete(msg.id);
53
- if (msg.error)
54
- entry.reject(new Error(msg.error.message));
55
- else
56
- entry.resolve(msg.result);
57
- }
58
- }
59
- // Handle Target.attachedToTarget — auto-enable Network on new sessions
60
- if (msg.method === 'Target.attachedToTarget' && msg.params) {
61
- const sessionId = msg.params.sessionId;
62
- if (sessionId) {
63
- this.sessionIds.add(sessionId);
64
- this.sendToSession(sessionId, 'Network.enable', {}).catch(() => { });
65
- }
66
- }
67
- }
68
- catch { /* ignore parse errors */ }
69
- });
70
- ws.on('close', () => { this.ws = null; });
71
- });
72
- }
73
- /** Send a CDP command to the browser target. */
74
- send(method, params = {}) {
75
- if (!this.ws)
76
- return Promise.reject(new Error('CDP not connected'));
77
- const id = ++this.msgId;
78
- return new Promise((resolve, reject) => {
79
- const timer = setTimeout(() => {
80
- this.pending.delete(id);
81
- reject(new Error(`CDP command ${method} timed out`));
82
- }, 10000);
83
- this.pending.set(id, {
84
- resolve: (r) => { clearTimeout(timer); resolve(r); },
85
- reject: (e) => { clearTimeout(timer); reject(e); },
86
- });
87
- this.ws.send(JSON.stringify({ id, method, params }));
88
- });
89
- }
90
- /** Send a CDP command to a specific session (tab). */
91
- sendToSession(sessionId, method, params = {}) {
92
- if (!this.ws)
93
- return Promise.reject(new Error('CDP not connected'));
94
- const id = ++this.msgId;
95
- return new Promise((resolve, reject) => {
96
- const timer = setTimeout(() => {
97
- this.pending.delete(id);
98
- reject(new Error(`CDP command ${method} timed out`));
99
- }, 10000);
100
- this.pending.set(id, {
101
- resolve: (r) => { clearTimeout(timer); resolve(r); },
102
- reject: (e) => { clearTimeout(timer); reject(e); },
103
- });
104
- this.ws.send(JSON.stringify({ id, method, params, sessionId }));
105
- });
106
- }
107
- /**
108
- * Enable Network domain on all matching tabs and future tabs.
109
- * Uses Target.setAutoAttach to automatically attach to new targets
110
- * (tabs created by the extension) and enable Network on them.
111
- */
112
- async enableNetworkCapture(urlPattern) {
113
- // Auto-attach to existing and new targets
114
- await this.send('Target.setAutoAttach', {
115
- autoAttach: true,
116
- waitForDebuggerOnStart: false,
117
- flatten: true,
118
- filter: [{ type: 'page' }],
119
- });
120
- // Also manually attach to existing tabs matching the URL pattern
121
- if (urlPattern) {
122
- const resp = await fetch(`http://127.0.0.1:${this.port}/json`);
123
- if (resp.ok) {
124
- const targets = await resp.json();
125
- for (const t of targets) {
126
- if (t.type === 'page' && t.url.includes(urlPattern)) {
127
- try {
128
- await this.send('Target.attachToTarget', { targetId: t.id, flatten: true });
129
- }
130
- catch { /* may already be attached */ }
131
- }
132
- }
133
- }
134
- }
135
- }
136
- /** Disconnect from CDP. */
137
- disconnect() {
138
- this.sessionIds.clear();
139
- for (const [, entry] of this.pending) {
140
- entry.reject(new Error('CDP disconnected'));
141
- }
142
- this.pending.clear();
143
- if (this.ws) {
144
- this.ws.close();
145
- this.ws = null;
146
- }
147
- }
148
- get connected() { return this.ws !== null; }
149
- }
150
- //# sourceMappingURL=cdp-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdp-client.js","sourceRoot":"","sources":["../src/cdp-client.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,wEAAwE;AACxE,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAmB/B,MAAM,OAAO,SAAS;IAMA;IALZ,EAAE,GAAqB,IAAI,CAAC;IAC5B,KAAK,GAAG,CAAC,CAAC;IACV,OAAO,GAAG,IAAI,GAAG,EAAyE,CAAC;IAC3F,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAEvC,YAAoB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE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