fraim 2.0.154 → 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.
- package/README.md +1 -1
- package/dist/src/ai-hub/cert-store.js +70 -0
- package/dist/src/ai-hub/desktop-main.js +225 -50
- package/dist/src/ai-hub/hosts.js +135 -8
- package/dist/src/ai-hub/manager-turns.js +38 -0
- package/dist/src/ai-hub/office-sideload.js +138 -0
- package/dist/src/ai-hub/openclaw-bridge.js +239 -0
- package/dist/src/ai-hub/server.js +479 -48
- package/dist/src/ai-hub/word-sideload.js +95 -0
- package/dist/src/cli/commands/add-ide.js +9 -0
- package/dist/src/cli/commands/init-project.js +46 -34
- package/dist/src/cli/commands/login.js +1 -2
- package/dist/src/cli/commands/setup.js +0 -2
- package/dist/src/cli/commands/sync.js +41 -11
- package/dist/src/cli/doctor/checks/mcp-connectivity-checks.js +66 -2
- package/dist/src/cli/doctor/checks/workflow-checks.js +1 -65
- package/dist/src/cli/mcp/fraim-mcp-latest-launcher.js +136 -0
- package/dist/src/cli/mcp/mcp-server-registry.js +14 -10
- package/dist/src/cli/setup/auto-mcp-setup.js +1 -1
- package/dist/src/cli/setup/ide-invocation-surfaces.js +2 -2
- package/dist/src/cli/utils/fraim-gitignore.js +11 -0
- package/dist/src/cli/utils/github-workflow-sync.js +231 -0
- package/dist/src/cli/utils/managed-agent-paths.js +1 -1
- package/dist/src/cli/utils/project-bootstrap.js +6 -3
- package/dist/src/cli/utils/remote-sync.js +1 -1
- package/dist/src/core/ai-mentor.js +46 -37
- package/dist/src/core/config-loader.js +69 -2
- package/dist/src/core/fraim-config-schema.generated.js +267 -6
- package/dist/src/core/types.js +0 -1
- package/dist/src/core/utils/fraim-labels.js +182 -0
- package/dist/src/core/utils/git-utils.js +22 -1
- package/dist/src/core/utils/project-fraim-paths.js +58 -0
- package/dist/src/first-run/session-service.js +3 -3
- package/dist/src/first-run/types.js +1 -1
- package/dist/src/local-mcp-server/learning-context-builder.js +77 -52
- package/dist/src/local-mcp-server/stdio-server.js +212 -13
- package/package.json +6 -2
- package/public/ai-hub/index.html +289 -229
- package/public/ai-hub/powerpoint-taskpane/icon-64.png +0 -0
- package/public/ai-hub/powerpoint-taskpane/index.html +235 -0
- package/public/ai-hub/powerpoint-taskpane/manifest.xml +30 -0
- package/public/ai-hub/script.js +1155 -586
- package/public/ai-hub/styles.css +1226 -722
- package/public/first-run/index.html +35 -35
- package/public/first-run/script.js +667 -667
|
@@ -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>
|