fraim 2.0.202 → 2.0.204

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 (79) hide show
  1. package/README.md +3 -3
  2. package/bin/fraim.js +8 -18
  3. package/dist/src/cli/commands/first-run.js +2 -37
  4. package/dist/src/cli/doctor/checks/mcp-connectivity-checks.js +1 -1
  5. package/dist/src/cli/fraim.js +0 -2
  6. package/dist/src/cli/setup/ide-invocation-surfaces.js +6 -6
  7. package/dist/src/cli/utils/managed-agent-paths.js +76 -6
  8. package/dist/src/cli/utils/version-utils.js +2 -2
  9. package/dist/src/config/persona-capability-bundles.js +3 -3
  10. package/dist/src/core/job-phases.js +168 -0
  11. package/dist/src/core/utils/ports.js +32 -0
  12. package/dist/src/core/utils/stub-generator.js +24 -2
  13. package/dist/src/first-run/session-service.js +106 -24
  14. package/dist/src/local-mcp-server/learning-context-builder.js +1 -1
  15. package/dist/src/local-mcp-server/stdio-server.js +41 -9
  16. package/dist/src/routes/analytics.js +2 -2
  17. package/dist/src/services/registry-service.js +2 -2
  18. package/index.js +1 -1
  19. package/package.json +61 -181
  20. package/dist/src/ai-hub/catalog.js +0 -406
  21. package/dist/src/ai-hub/cert-store.js +0 -70
  22. package/dist/src/ai-hub/conversation-store.js +0 -359
  23. package/dist/src/ai-hub/desktop-main.js +0 -449
  24. package/dist/src/ai-hub/hosts.js +0 -1664
  25. package/dist/src/ai-hub/hub-latest-version.js +0 -52
  26. package/dist/src/ai-hub/hub-launch-decision.js +0 -57
  27. package/dist/src/ai-hub/hub-runtime-file.js +0 -43
  28. package/dist/src/ai-hub/managed-browser.js +0 -269
  29. package/dist/src/ai-hub/manager-turns.js +0 -64
  30. package/dist/src/ai-hub/office-sideload.js +0 -156
  31. package/dist/src/ai-hub/openclaw-bridge.js +0 -250
  32. package/dist/src/ai-hub/preferences.js +0 -201
  33. package/dist/src/ai-hub/remote-hub-gateway.js +0 -88
  34. package/dist/src/ai-hub/server.js +0 -3827
  35. package/dist/src/ai-hub/types.js +0 -2
  36. package/dist/src/ai-hub/word-sideload.js +0 -95
  37. package/dist/src/cli/commands/hub.js +0 -238
  38. package/dist/src/cli/commands/test-mcp.js +0 -171
  39. package/dist/src/cli/setup/first-run.js +0 -242
  40. package/dist/src/core/config-writer.js +0 -75
  41. package/dist/src/core/utils/job-aliases.js +0 -47
  42. package/dist/src/core/utils/workflow-parser.js +0 -174
  43. package/dist/src/services/email-service-clean.js +0 -782
  44. package/extensions/office-word/favicon.ico +0 -0
  45. package/extensions/office-word/icon-64.png +0 -0
  46. package/extensions/office-word/manifest.xml +0 -33
  47. package/extensions/office-word/taskpane.html +0 -242
  48. package/public/ai-hub/index.html +0 -894
  49. package/public/ai-hub/powerpoint-taskpane/icon-64.png +0 -0
  50. package/public/ai-hub/powerpoint-taskpane/index.html +0 -236
  51. package/public/ai-hub/powerpoint-taskpane/manifest.xml +0 -30
  52. package/public/ai-hub/review.css +0 -381
  53. package/public/ai-hub/script.js +0 -11024
  54. package/public/ai-hub/styles.css +0 -4873
  55. package/public/portfolio/ashley.html +0 -523
  56. package/public/portfolio/auditya.html +0 -83
  57. package/public/portfolio/banke.html +0 -83
  58. package/public/portfolio/beza.html +0 -659
  59. package/public/portfolio/careena.html +0 -632
  60. package/public/portfolio/casey.html +0 -568
  61. package/public/portfolio/celia.html +0 -490
  62. package/public/portfolio/deidre.html +0 -642
  63. package/public/portfolio/gautam.html +0 -597
  64. package/public/portfolio/hari.html +0 -469
  65. package/public/portfolio/huxley.html +0 -1354
  66. package/public/portfolio/index.html +0 -741
  67. package/public/portfolio/maestro.html +0 -518
  68. package/public/portfolio/mandy.html +0 -590
  69. package/public/portfolio/mona.html +0 -597
  70. package/public/portfolio/pam.html +0 -887
  71. package/public/portfolio/procella.html +0 -107
  72. package/public/portfolio/qasm.html +0 -569
  73. package/public/portfolio/ricardo.html +0 -489
  74. package/public/portfolio/sade.html +0 -560
  75. package/public/portfolio/sam.html +0 -654
  76. package/public/portfolio/sechar.html +0 -580
  77. package/public/portfolio/sreya.html +0 -599
  78. package/public/portfolio/swen.html +0 -601
  79. /package/dist/src/{ai-hub → core}/brand-store.js +0 -0
Binary file
Binary file
@@ -1,33 +0,0 @@
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>d1090951-50cf-4cf2-9d12-b0f8541d265c</Id>
7
- <Version>1.0.0.0</Version>
8
- <ProviderName>FRAIM</ProviderName>
9
- <DefaultLocale>en-US</DefaultLocale>
10
- <DisplayName DefaultValue="FRAIM"/>
11
- <Description DefaultValue="AI Hub for your document - legal, product, engineering, and more in one task pane."/>
12
- <IconUrl DefaultValue="http://localhost:43091/word-taskpane/icon-64.png"/>
13
- <HighResolutionIconUrl DefaultValue="http://localhost:43091/word-taskpane/icon-64.png"/>
14
- <AppDomains>
15
- <AppDomain>https://appsforoffice.microsoft.com</AppDomain>
16
- </AppDomains>
17
-
18
- <Hosts>
19
- <Host Name="Document"/>
20
- </Hosts>
21
-
22
- <Requirements>
23
- <Sets>
24
- <Set Name="WordApi" MinVersion="1.1"/>
25
- </Sets>
26
- </Requirements>
27
-
28
- <DefaultSettings>
29
- <SourceLocation DefaultValue="http://localhost:43091/word-taskpane/"/>
30
- </DefaultSettings>
31
-
32
- <Permissions>ReadWriteDocument</Permissions>
33
- </OfficeApp>
@@ -1,242 +0,0 @@
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
- <script src="config.js" type="text/javascript"></script>
9
- <style>
10
- * { margin: 0; padding: 0; box-sizing: border-box; }
11
- html, body { height: 100%; overflow: hidden; }
12
- iframe { width: 100%; height: 100vh; border: none; display: block; }
13
- </style>
14
- </head>
15
- <body>
16
- <iframe id="hub" src="" allow="clipboard-read; clipboard-write"></iframe>
17
- <script>
18
- // In Word Online the taskpane is served over HTTPS (ssl-proxy at localhost:43092).
19
- // Loading an HTTP iframe from an HTTPS page is mixed-content-blocked, so use the
20
- // same origin as the taskpane when running over HTTPS (the ssl-proxy forwards all
21
- // routes to the Hub). HTTP (isolated tests) keeps the direct Hub address.
22
- var HUB_ORIGIN = window.location.protocol === 'https:'
23
- ? window.location.origin
24
- : (window.FRAIM_HUB_ORIGIN || 'http://127.0.0.1:43091');
25
- var hubFrame = document.getElementById('hub');
26
- var pendingPush = null; // context queued before hub-ready fires
27
- var hubReady = false;
28
- var selectionHandlerAdded = false;
29
-
30
- // ── postMessage bridge (inbound from Hub) ─────────────────────────────────
31
- window.addEventListener('message', function(event) {
32
- if (event.origin !== HUB_ORIGIN) return;
33
- var msg = event.data || {};
34
- if (msg.type === 'hub-ready') {
35
- hubReady = true;
36
- if (pendingPush) { pushToHub(pendingPush); pendingPush = null; }
37
- } else if (msg.type === 'word-request') {
38
- handleWordRequest(msg.action, msg.requestId, msg.payload || {});
39
- }
40
- });
41
-
42
- function pushToHub(msg) {
43
- if (hubFrame && hubFrame.contentWindow) {
44
- hubFrame.contentWindow.postMessage(msg, HUB_ORIGIN);
45
- }
46
- }
47
-
48
- // ── Reading Word context ───────────────────────────────────────────────────
49
- function docMeta() {
50
- var meta = { docUrl: '', docTitle: '' };
51
- try {
52
- var doc = window.Office && Office.context && Office.context.document;
53
- meta.docUrl = (doc && doc.url) ? doc.url : '';
54
- if (meta.docUrl) {
55
- var parts = meta.docUrl.replace(/\\/g, '/').split('/');
56
- meta.docTitle = (parts[parts.length - 1] || '').replace(/\.[^.]+$/, '');
57
- }
58
- } catch(e) {}
59
- return meta;
60
- }
61
-
62
- function readSelectionAsync(cb) {
63
- try {
64
- Office.context.document.getSelectedDataAsync(
65
- Office.CoercionType.Text,
66
- { valueFormat: 'unformatted', filterType: 'onlySelected' },
67
- function(r) { cb(r.status === Office.AsyncResultStatus.Succeeded ? String(r.value || '').trim() : ''); }
68
- );
69
- } catch(e) { cb(''); }
70
- }
71
-
72
- function readBodyAsync(cb) {
73
- try {
74
- Office.context.document.getSelectedDataAsync(
75
- Office.CoercionType.Text,
76
- { valueFormat: 'unformatted' },
77
- function(r) { cb(r.status === Office.AsyncResultStatus.Succeeded ? String(r.value || '') : ''); }
78
- );
79
- } catch(e) { cb(''); }
80
- }
81
-
82
- function readCommentsAsync(cb) {
83
- try {
84
- if (typeof Word !== 'undefined' && Word.run) {
85
- Word.run(function(ctx) {
86
- var comments = ctx.document.body.getComments();
87
- comments.load('items/id,items/authorName,items/content,items/resolved');
88
- return ctx.sync().then(function() {
89
- cb((comments.items || []).slice(0, 20).map(function(c) {
90
- return { id: c.id || '', author: c.authorName || '', text: c.content || '', resolved: !!c.resolved };
91
- }));
92
- });
93
- }).catch(function() { cb([]); });
94
- } else { cb([]); }
95
- } catch(e) { cb([]); }
96
- }
97
-
98
- function readFullContext(cb) {
99
- var meta = docMeta();
100
- readSelectionAsync(function(selection) {
101
- readBodyAsync(function(body) {
102
- readCommentsAsync(function(comments) {
103
- cb({
104
- docUrl: meta.docUrl,
105
- docTitle: meta.docTitle,
106
- selection: selection,
107
- hasSelection: selection.length > 0,
108
- bodyPreview: body.slice(0, 2000),
109
- wordCount: body ? body.split(/\s+/).filter(Boolean).length : 0,
110
- comments: comments,
111
- });
112
- });
113
- });
114
- });
115
- }
116
-
117
- // ── Selection-change handler ───────────────────────────────────────────────
118
- function addSelectionHandler() {
119
- if (selectionHandlerAdded) return;
120
- try {
121
- Office.context.document.addHandlerAsync(
122
- Office.EventType.DocumentSelectionChanged,
123
- function() {
124
- readSelectionAsync(function(sel) {
125
- var m = docMeta();
126
- pushToHub({ type: 'word-context-update', payload: {
127
- docUrl: m.docUrl, docTitle: m.docTitle,
128
- selection: sel, hasSelection: sel.length > 0,
129
- }});
130
- });
131
- },
132
- function(r) { if (r.status === Office.AsyncResultStatus.Succeeded) selectionHandlerAdded = true; }
133
- );
134
- } catch(e) {}
135
- }
136
-
137
- // ── Handling requests from Hub ─────────────────────────────────────────────
138
- function handleWordRequest(action, requestId, payload) {
139
- function respond(result) {
140
- pushToHub({ type: 'word-response', requestId: requestId, payload: result });
141
- }
142
- if (action === 'get-context') {
143
- readFullContext(function(ctx) { respond(ctx); });
144
- } else if (action === 'get-selection') {
145
- readSelectionAsync(function(sel) { respond({ selection: sel, hasSelection: sel.length > 0 }); });
146
- } else if (action === 'insert-text') {
147
- // Replace current selection (or insert at cursor) with given text.
148
- try {
149
- Office.context.document.setSelectedDataAsync(
150
- payload.text || '',
151
- { coercionType: Office.CoercionType.Text },
152
- function(r) { respond({ ok: r.status === Office.AsyncResultStatus.Succeeded }); }
153
- );
154
- } catch(e) { respond({ ok: false, error: e.message }); }
155
- } else if (action === 'insert-after') {
156
- // Insert text after the current selection using Word API.
157
- try {
158
- if (typeof Word !== 'undefined' && Word.run) {
159
- Word.run(function(ctx) {
160
- var sel = ctx.document.getSelection();
161
- sel.insertText((payload.newline !== false ? '\n' : '') + (payload.text || ''), Word.InsertLocation.after);
162
- return ctx.sync();
163
- }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
164
- } else { respond({ ok: false, error: 'Word API 1.1+ not available' }); }
165
- } catch(e) { respond({ ok: false, error: e.message }); }
166
- } else if (action === 'append-to-doc') {
167
- // Append text at the very end of the document.
168
- try {
169
- if (typeof Word !== 'undefined' && Word.run) {
170
- Word.run(function(ctx) {
171
- ctx.document.body.insertText('\n' + (payload.text || ''), Word.InsertLocation.end);
172
- return ctx.sync();
173
- }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
174
- } else { respond({ ok: false, error: 'Word API 1.1+ not available' }); }
175
- } catch(e) { respond({ ok: false, error: e.message }); }
176
- } else if (action === 'reply-to-comment') {
177
- // Reply to a comment by ID.
178
- try {
179
- if (typeof Word !== 'undefined' && Word.run) {
180
- Word.run(function(ctx) {
181
- var comments = ctx.document.body.getComments();
182
- comments.load('items/id');
183
- return ctx.sync().then(function() {
184
- var target = (comments.items || []).find(function(c) { return c.id === payload.commentId; });
185
- if (!target) throw new Error('Comment not found: ' + payload.commentId);
186
- target.reply(payload.text || '');
187
- return ctx.sync();
188
- });
189
- }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
190
- } else { respond({ ok: false, error: 'Word API not available' }); }
191
- } catch(e) { respond({ ok: false, error: e.message }); }
192
- } else if (action === 'track-changes-on') {
193
- try {
194
- if (typeof Word !== 'undefined' && Word.run) {
195
- Word.run(function(ctx) {
196
- ctx.document.changeTrackingMode = Word.ChangeTrackingMode.trackAll;
197
- return ctx.sync();
198
- }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
199
- } else { respond({ ok: false, error: 'Word API not available' }); }
200
- } catch(e) { respond({ ok: false, error: e.message }); }
201
- } else if (action === 'track-changes-off') {
202
- try {
203
- if (typeof Word !== 'undefined' && Word.run) {
204
- Word.run(function(ctx) {
205
- ctx.document.changeTrackingMode = Word.ChangeTrackingMode.off;
206
- return ctx.sync();
207
- }).then(function() { respond({ ok: true }); }).catch(function(e) { respond({ ok: false, error: e.message }); });
208
- } else { respond({ ok: false, error: 'Word API not available' }); }
209
- } catch(e) { respond({ ok: false, error: e.message }); }
210
- } else {
211
- respond({ ok: false, error: 'Unknown action: ' + action });
212
- }
213
- }
214
-
215
- // ── Mount ─────────────────────────────────────────────────────────────────
216
- function mountHub() {
217
- var meta = docMeta();
218
- var params = new URLSearchParams({ surface: 'task-pane' });
219
- if (meta.docUrl) params.set('docUrl', meta.docUrl);
220
- if (meta.docTitle) params.set('docTitle', meta.docTitle);
221
- hubFrame.src = HUB_ORIGIN + '/ai-hub/?' + params.toString();
222
-
223
- hubFrame.addEventListener('load', function() {
224
- // Push full context once Hub has registered its message listener.
225
- setTimeout(function() {
226
- readFullContext(function(ctx) {
227
- var msg = { type: 'word-context', payload: ctx };
228
- if (hubReady) { pushToHub(msg); } else { pendingPush = msg; }
229
- });
230
- }, 300);
231
- addSelectionHandler();
232
- });
233
- }
234
-
235
- if (typeof Office !== 'undefined') {
236
- Office.onReady(function() { mountHub(); });
237
- } else {
238
- window.addEventListener('DOMContentLoaded', mountHub);
239
- }
240
- </script>
241
- </body>
242
- </html>