fraim 2.0.159 → 2.0.160

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 (30) hide show
  1. package/README.md +1 -1
  2. package/dist/src/ai-hub/cert-store.js +70 -0
  3. package/dist/src/ai-hub/desktop-main.js +225 -50
  4. package/dist/src/ai-hub/manager-turns.js +38 -0
  5. package/dist/src/ai-hub/office-sideload.js +138 -0
  6. package/dist/src/ai-hub/openclaw-bridge.js +239 -0
  7. package/dist/src/ai-hub/server.js +346 -115
  8. package/dist/src/ai-hub/word-sideload.js +95 -0
  9. package/dist/src/cli/commands/add-ide.js +9 -0
  10. package/dist/src/cli/commands/login.js +1 -2
  11. package/dist/src/cli/commands/setup.js +0 -2
  12. package/dist/src/cli/commands/sync.js +19 -10
  13. package/dist/src/cli/doctor/checks/mcp-connectivity-checks.js +66 -2
  14. package/dist/src/cli/doctor/checks/workflow-checks.js +1 -65
  15. package/dist/src/cli/mcp/fraim-mcp-latest-launcher.js +136 -0
  16. package/dist/src/cli/mcp/mcp-server-registry.js +14 -10
  17. package/dist/src/cli/setup/auto-mcp-setup.js +1 -1
  18. package/dist/src/cli/utils/fraim-gitignore.js +11 -0
  19. package/dist/src/cli/utils/remote-sync.js +1 -1
  20. package/dist/src/core/config-loader.js +1 -2
  21. package/dist/src/core/fraim-config-schema.generated.js +0 -5
  22. package/dist/src/core/types.js +0 -1
  23. package/dist/src/first-run/session-service.js +3 -3
  24. package/package.json +2 -1
  25. package/public/ai-hub/index.html +20 -2
  26. package/public/ai-hub/powerpoint-taskpane/icon-64.png +0 -0
  27. package/public/ai-hub/powerpoint-taskpane/index.html +235 -0
  28. package/public/ai-hub/powerpoint-taskpane/manifest.xml +30 -0
  29. package/public/ai-hub/script.js +337 -120
  30. package/public/ai-hub/styles.css +456 -135
@@ -8,10 +8,6 @@ exports.SUPPORTED_FRAIM_CONFIG_PATHS = exports.FRAIM_CONFIG_SCHEMA = void 0;
8
8
  exports.FRAIM_CONFIG_SCHEMA = {
9
9
  "kind": "object",
10
10
  "properties": {
11
- "version": {
12
- "kind": "string",
13
- "required": true
14
- },
15
11
  "project": {
16
12
  "kind": "object",
17
13
  "properties": {
@@ -487,7 +483,6 @@ exports.FRAIM_CONFIG_SCHEMA = {
487
483
  "required": true
488
484
  };
489
485
  exports.SUPPORTED_FRAIM_CONFIG_PATHS = [
490
- "version",
491
486
  "project",
492
487
  "project.name",
493
488
  "project.industry",
@@ -9,7 +9,6 @@ exports.DEFAULT_FRAIM_CONFIG = void 0;
9
9
  * Default configuration values
10
10
  */
11
11
  exports.DEFAULT_FRAIM_CONFIG = {
12
- version: '2.0.47',
13
12
  project: {
14
13
  name: 'Untitled Project'
15
14
  },
@@ -507,7 +507,7 @@ class FirstRunSessionService {
507
507
  fs_1.default.mkdirSync(prefix, { recursive: true });
508
508
  row.streamOutput = 'Installing FRAIM on this machine...';
509
509
  this.persist();
510
- await runProcess('npm', ['install', '-g', 'fraim-framework@latest'], { npm_config_prefix: prefix });
510
+ await runProcess('npm', ['install', '-g', 'fraim@latest'], { npm_config_prefix: prefix });
511
511
  }
512
512
  persistShellPath();
513
513
  const detectedIDEs = (0, ide_detector_1.detectInstalledIDEs)();
@@ -752,7 +752,7 @@ class FirstRunSessionService {
752
752
  appendInstallLog(`hub-opened ${hubUrl}`);
753
753
  return {
754
754
  ok: true,
755
- message: `Hub is open at ${hubUrl}. From now on, run \`npx fraim-framework@latest hub --browser\` to launch it again — the standalone launcher binary ships in v2 (#355).`,
755
+ message: `Hub is open at ${hubUrl}. From now on, run \`npx fraim@latest hub --browser\` to launch it again — the standalone launcher binary ships in v2 (#355).`,
756
756
  hubUrl,
757
757
  };
758
758
  }
@@ -761,7 +761,7 @@ class FirstRunSessionService {
761
761
  appendInstallLog(`hub-open-failed ${detail}`);
762
762
  return {
763
763
  ok: false,
764
- message: `Could not open the Hub automatically: ${detail}. Run \`npx fraim-framework@latest hub --browser\` from a terminal to open it manually.`,
764
+ message: `Could not open the Hub automatically: ${detail}. Run \`npx fraim@latest hub --browser\` from a terminal to open it manually.`,
765
765
  };
766
766
  }
767
767
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim",
3
- "version": "2.0.159",
3
+ "version": "2.0.160",
4
4
  "description": "FRAIM CLI - Framework for Rigor-based AI Management (alias for fraim-framework)",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -151,6 +151,7 @@
151
151
  "nodemailer": "^8.0.3",
152
152
  "prompts": "^2.4.2",
153
153
  "resend": "^6.9.3",
154
+ "selfsigned": "^5.5.0",
154
155
  "semver": "^7.7.4",
155
156
  "stripe": "^20.3.1",
156
157
  "toml": "^3.0.0",
@@ -3,15 +3,18 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AI Hub</title>
6
+ <meta name="color-scheme" content="light dark">
7
+ <title>FRAIM AI Hub</title>
7
8
  <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' rx='10' fill='%233d8a6e'/%3E%3Ctext x='24' y='32' text-anchor='middle' font-family='Helvetica,Arial,sans-serif' font-size='22' font-weight='700' fill='white'%3EH%3C/text%3E%3C/svg%3E">
9
+ <!-- Detect Electron before CSS paints so body.electron rules apply on first render -->
10
+ <script>if(/Electron/.test(navigator.userAgent)){document.documentElement.classList.add('electron');}</script>
8
11
  <link rel="stylesheet" href="./styles.css">
9
12
  </head>
10
13
  <body>
11
14
 
12
15
  <div class="page">
13
16
 
14
- <header class="header">
17
+ <header class="header" style="-webkit-app-region: drag;">
15
18
  <h1 class="header-title">Manage your FRAIM Employees</h1>
16
19
  <section class="welcome">
17
20
  Hi <strong class="you">there</strong>, remember, you are the
@@ -63,6 +66,7 @@
63
66
 
64
67
  <div class="layout">
65
68
  <aside class="rail">
69
+ <span id="tp-project-label" class="tp-project-label"></span>
66
70
  <button class="new-conv" type="button" id="new-conv-btn">+ New job</button>
67
71
  <div class="rail-note">Alpha: browser shell for directing employees across your project.</div>
68
72
  <section class="rail-section rail-section--employees">
@@ -76,6 +80,12 @@
76
80
  </section>
77
81
  </aside>
78
82
 
83
+ <div id="word-context-bar" class="word-context-bar" hidden>
84
+ <span class="word-ctx-icon">📄</span>
85
+ <span class="word-ctx-text" id="word-ctx-text"></span>
86
+ <button class="word-ctx-refresh" type="button" id="word-ctx-refresh" title="Refresh document context">↻</button>
87
+ </div>
88
+
79
89
  <main class="conversation" id="conversation">
80
90
  <div class="empty-state" id="empty">
81
91
  <h3>No job selected</h3>
@@ -241,6 +251,14 @@
241
251
  <div class="desc" id="picked-desc"></div>
242
252
  </div>
243
253
  <textarea id="instructions" placeholder="What outcome do you want? Any context the employee should know?"></textarea>
254
+ <div id="word-context-card" class="word-context-card" hidden>
255
+ <div class="word-ctx-card-header">
256
+ <span class="word-ctx-card-icon">📄</span>
257
+ <span class="word-ctx-card-label" id="word-ctx-card-label">Document context</span>
258
+ <button type="button" class="word-ctx-card-toggle" id="word-ctx-card-toggle" aria-label="Expand document context">▸</button>
259
+ </div>
260
+ <div class="word-ctx-card-body" id="word-ctx-card-body" hidden></div>
261
+ </div>
244
262
  <div class="employee-line">
245
263
  <span class="employee-label">Employee:</span>
246
264
  <select id="employee-select" class="employee-select"></select>
@@ -0,0 +1,235 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>FRAIM Hub</title>
7
+ <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
8
+ <style>
9
+ * { margin: 0; padding: 0; box-sizing: border-box; }
10
+ html, body { height: 100%; overflow: hidden; }
11
+ iframe { width: 100%; height: 100vh; border: none; display: block; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <iframe id="hub" src="" allow="clipboard-read; clipboard-write"></iframe>
16
+ <script>
17
+ // PowerPoint task pane — mirrors extensions/office-word/taskpane.html so PPT
18
+ // gets the identical full Hub experience. It mounts the Hub /ai-hub/ surface in
19
+ // an iframe and bridges host context over postMessage using the same
20
+ // word-context / word-request / word-response contract the Hub already speaks
21
+ // (the names are the generic host-bridge protocol, not Word-specific).
22
+ //
23
+ // In Office Online the pane is served over HTTPS; loading an HTTP iframe from an
24
+ // HTTPS page is mixed-content-blocked, so use the pane's own origin there. On
25
+ // desktop (HTTP) use the direct Hub address.
26
+ var HUB_ORIGIN = window.location.protocol === 'https:'
27
+ ? window.location.origin
28
+ : 'http://127.0.0.1:43091';
29
+ var hubFrame = document.getElementById('hub');
30
+ var pendingPush = null; // context queued before hub-ready fires
31
+ var hubReady = false;
32
+ var selectionHandlerAdded = false;
33
+
34
+ // ── postMessage bridge (inbound from Hub) ─────────────────────────────────
35
+ window.addEventListener('message', function(event) {
36
+ if (event.origin !== HUB_ORIGIN) return;
37
+ var msg = event.data || {};
38
+ if (msg.type === 'hub-ready') {
39
+ hubReady = true;
40
+ if (pendingPush) { pushToHub(pendingPush); pendingPush = null; }
41
+ } else if (msg.type === 'word-request') {
42
+ handleHostRequest(msg.action, msg.requestId, msg.payload || {});
43
+ }
44
+ });
45
+
46
+ function pushToHub(msg) {
47
+ if (hubFrame && hubFrame.contentWindow) {
48
+ hubFrame.contentWindow.postMessage(msg, HUB_ORIGIN);
49
+ }
50
+ }
51
+
52
+ // ── Reading PowerPoint context ──────────────────────────────────────────────
53
+ function docMeta() {
54
+ var meta = { docUrl: '', docTitle: '' };
55
+ try {
56
+ var doc = window.Office && Office.context && Office.context.document;
57
+ meta.docUrl = (doc && doc.url) ? doc.url : '';
58
+ if (meta.docUrl) {
59
+ var parts = meta.docUrl.replace(/\\/g, '/').split('/');
60
+ meta.docTitle = (parts[parts.length - 1] || '').replace(/\.[^.]+$/, '');
61
+ }
62
+ } catch(e) {}
63
+ return meta;
64
+ }
65
+
66
+ function readSelectionAsync(cb) {
67
+ try {
68
+ Office.context.document.getSelectedDataAsync(
69
+ Office.CoercionType.Text,
70
+ function(r) { cb(r.status === Office.AsyncResultStatus.Succeeded ? String(r.value || '').trim() : ''); }
71
+ );
72
+ } catch(e) { cb(''); }
73
+ }
74
+
75
+ // Read the current slide's text + speaker notes via the PowerPoint API.
76
+ function readSlideAsync(cb) {
77
+ try {
78
+ if (typeof PowerPoint !== 'undefined' && PowerPoint.run) {
79
+ PowerPoint.run(function(ctx) {
80
+ var slides = ctx.presentation.getSelectedSlides();
81
+ slides.load('items');
82
+ return ctx.sync().then(function() {
83
+ var slide = slides.items && slides.items[0];
84
+ if (!slide) { cb({ slideText: '', notes: '' }); return; }
85
+ var shapes = slide.shapes;
86
+ shapes.load('items/textFrame/textRange/text');
87
+ var ns = slide.notesSlide;
88
+ try { ns.load('notesTextFrame/textRange/text'); } catch(e) {}
89
+ return ctx.sync().then(function() {
90
+ var notes = '';
91
+ try { notes = ns.notesTextFrame.textRange.text || ''; } catch(e) {}
92
+ var slideText = (shapes.items || [])
93
+ .map(function(s){ try { return s.textFrame.textRange.text || ''; } catch(e){ return ''; } })
94
+ .filter(Boolean).join('\n');
95
+ cb({ slideText: slideText, notes: notes });
96
+ });
97
+ });
98
+ }).catch(function() { cb({ slideText: '', notes: '' }); });
99
+ } else { cb({ slideText: '', notes: '' }); }
100
+ } catch(e) { cb({ slideText: '', notes: '' }); }
101
+ }
102
+
103
+ function slideCountAsync(cb) {
104
+ try {
105
+ if (typeof PowerPoint !== 'undefined' && PowerPoint.run) {
106
+ PowerPoint.run(function(ctx) {
107
+ var slides = ctx.presentation.slides;
108
+ slides.load('items');
109
+ return ctx.sync().then(function() { cb((slides.items || []).length); });
110
+ }).catch(function() { cb(0); });
111
+ } else { cb(0); }
112
+ } catch(e) { cb(0); }
113
+ }
114
+
115
+ function readFullContext(cb) {
116
+ var meta = docMeta();
117
+ readSelectionAsync(function(selection) {
118
+ readSlideAsync(function(slide) {
119
+ slideCountAsync(function(count) {
120
+ var body = [slide.slideText, slide.notes ? ('Notes: ' + slide.notes) : ''].filter(Boolean).join('\n');
121
+ cb({
122
+ docUrl: meta.docUrl,
123
+ docTitle: meta.docTitle,
124
+ selection: selection,
125
+ hasSelection: selection.length > 0,
126
+ bodyPreview: body.slice(0, 2000),
127
+ wordCount: body ? body.split(/\s+/).filter(Boolean).length : 0,
128
+ slideCount: count,
129
+ comments: [],
130
+ });
131
+ });
132
+ });
133
+ });
134
+ }
135
+
136
+ // ── Selection-change handler ───────────────────────────────────────────────
137
+ function addSelectionHandler() {
138
+ if (selectionHandlerAdded) return;
139
+ try {
140
+ Office.context.document.addHandlerAsync(
141
+ Office.EventType.DocumentSelectionChanged,
142
+ function() {
143
+ readSelectionAsync(function(sel) {
144
+ var m = docMeta();
145
+ pushToHub({ type: 'word-context-update', payload: {
146
+ docUrl: m.docUrl, docTitle: m.docTitle,
147
+ selection: sel, hasSelection: sel.length > 0,
148
+ }});
149
+ });
150
+ },
151
+ function(r) { if (r.status === Office.AsyncResultStatus.Succeeded) selectionHandlerAdded = true; }
152
+ );
153
+ } catch(e) {}
154
+ }
155
+
156
+ // ── Handling requests from Hub ─────────────────────────────────────────────
157
+ function handleHostRequest(action, requestId, payload) {
158
+ function respond(result) {
159
+ pushToHub({ type: 'word-response', requestId: requestId, payload: result });
160
+ }
161
+ if (action === 'get-context') {
162
+ readFullContext(function(ctx) { respond(ctx); });
163
+ } else if (action === 'get-selection') {
164
+ readSelectionAsync(function(sel) { respond({ selection: sel, hasSelection: sel.length > 0 }); });
165
+ } else if (action === 'insert-text') {
166
+ // Insert a new text box on the current slide with the given text.
167
+ try {
168
+ if (typeof PowerPoint !== 'undefined' && PowerPoint.run) {
169
+ PowerPoint.run(function(ctx) {
170
+ var slides = ctx.presentation.getSelectedSlides();
171
+ slides.load('items');
172
+ return ctx.sync().then(function() {
173
+ var slide = slides.items && slides.items[0];
174
+ if (!slide) throw new Error('No slide selected');
175
+ var box = slide.shapes.addTextBox(payload.text || '');
176
+ box.left = 50; box.top = 50; box.width = 600; box.height = 100;
177
+ return ctx.sync();
178
+ });
179
+ }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
180
+ } else { respond({ ok: false, error: 'PowerPoint API 1.1+ not available' }); }
181
+ } catch(e) { respond({ ok: false, error: e.message }); }
182
+ } else if (action === 'insert-after' || action === 'append-to-doc') {
183
+ // Append text into the current slide's speaker notes.
184
+ try {
185
+ if (typeof PowerPoint !== 'undefined' && PowerPoint.run) {
186
+ PowerPoint.run(function(ctx) {
187
+ var slides = ctx.presentation.getSelectedSlides();
188
+ slides.load('items');
189
+ return ctx.sync().then(function() {
190
+ var slide = slides.items && slides.items[0];
191
+ if (!slide) throw new Error('No slide selected');
192
+ var ns = slide.notesSlide;
193
+ ns.load('notesTextFrame/textRange/text');
194
+ return ctx.sync().then(function() {
195
+ var existing = '';
196
+ try { existing = ns.notesTextFrame.textRange.text || ''; } catch(e) {}
197
+ ns.notesTextFrame.textRange.text = (existing ? existing + '\n' : '') + (payload.text || '');
198
+ return ctx.sync();
199
+ });
200
+ });
201
+ }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
202
+ } else { respond({ ok: false, error: 'PowerPoint API not available' }); }
203
+ } catch(e) { respond({ ok: false, error: e.message }); }
204
+ } else {
205
+ respond({ ok: false, error: 'Unknown action: ' + action });
206
+ }
207
+ }
208
+
209
+ // ── Mount ─────────────────────────────────────────────────────────────────
210
+ function mountHub() {
211
+ var meta = docMeta();
212
+ var params = new URLSearchParams({ surface: 'task-pane' });
213
+ if (meta.docUrl) params.set('docUrl', meta.docUrl);
214
+ if (meta.docTitle) params.set('docTitle', meta.docTitle);
215
+ hubFrame.src = HUB_ORIGIN + '/ai-hub/?' + params.toString();
216
+
217
+ hubFrame.addEventListener('load', function() {
218
+ setTimeout(function() {
219
+ readFullContext(function(ctx) {
220
+ var msg = { type: 'word-context', payload: ctx };
221
+ if (hubReady) { pushToHub(msg); } else { pendingPush = msg; }
222
+ });
223
+ }, 300);
224
+ addSelectionHandler();
225
+ });
226
+ }
227
+
228
+ if (typeof Office !== 'undefined') {
229
+ Office.onReady(function() { mountHub(); });
230
+ } else {
231
+ window.addEventListener('DOMContentLoaded', mountHub);
232
+ }
233
+ </script>
234
+ </body>
235
+ </html>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
5
+ xsi:type="TaskPaneApp">
6
+ <Id>e7a3c812-91fd-4b2e-8c15-d4f6a903b71e</Id>
7
+ <Version>1.0.0.0</Version>
8
+ <ProviderName>FRAIM</ProviderName>
9
+ <DefaultLocale>en-US</DefaultLocale>
10
+ <DisplayName DefaultValue="FRAIM"/>
11
+ <Description DefaultValue="FRAIM AI Hub in PowerPoint - analyze, draft, and improve presentations."/>
12
+ <IconUrl DefaultValue="http://127.0.0.1:43091/powerpoint-taskpane/icon-64.png"/>
13
+ <HighResolutionIconUrl DefaultValue="http://127.0.0.1:43091/powerpoint-taskpane/icon-64.png"/>
14
+ <SupportUrl DefaultValue="http://127.0.0.1:43091"/>
15
+ <AppDomains>
16
+ <AppDomain>https://appsforoffice.microsoft.com</AppDomain>
17
+ </AppDomains>
18
+ <Hosts>
19
+ <Host Name="Presentation"/>
20
+ </Hosts>
21
+ <Requirements>
22
+ <Sets>
23
+ <Set Name="PowerPointApi" MinVersion="1.1"/>
24
+ </Sets>
25
+ </Requirements>
26
+ <DefaultSettings>
27
+ <SourceLocation DefaultValue="http://127.0.0.1:43091/powerpoint-taskpane/"/>
28
+ </DefaultSettings>
29
+ <Permissions>ReadWriteDocument</Permissions>
30
+ </OfficeApp>