@xopcai/xopc 0.0.192 → 0.0.193
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-B-tzXpDD.js → activity-store-BwmdJ5pv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-xOu0qNwc.js → agent-avatar-dicebear-DmNq0t2n.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BOo1rVn9.js +68 -0
- package/dist/gateway/static/root/assets/{api-fMItZb-h.js → api-BM1hNzjw.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D6Rv3OWI.js → app-management-settings-panel-B3xStqSX.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CKoNCwco.js → appearance-settings-DglyenDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DC9qPFTx.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BokNQBwH.js → archive-plugin-DvtcrBss.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Dx1HglsM.js → attachment-load-CALdq4xM.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BIGGKb0T.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CPYAflIG.js → binary-plugins-GaVuvrDI.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BFLgl8SS.js → block-editor-C2KrMYa_.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-CPW_E-xj.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CqLnqA9z.js → browser-workflow-inputs-FfEEjhIS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Db5v3HtE.js → browser-workflows-page-DFP9_UQk.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CsD8aGHU.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-lov0J9A2.js → capability-presets-api-BoOzFotX.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-NCeyWH6Z.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-DSJznouK.js → channel-recipient-api-_8IiTxRB.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CknzwxNC.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +1 -0
- package/dist/gateway/static/root/assets/{connectors-api-3ccRyS3L.js → connectors-api-vaSrhPF8.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DEGE7xp_.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-C9hhCiuo.js → cron-expression-BjFuXlGY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CTtZFZug.js → dependency-picker-DOdkHdPv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DOUeNVmC.js → desktop-pet-Dz-Yf8Uu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D4704vtl.js → desktop-pet-settings-C8EHFEtd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DJDXeA1B.js → directory-picker-path-field-DKbfmZlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-C0n2NMF1.js → extension-debug-page-Dq0xsr_e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-vG-xxRNs.js → extension-page-IgSLUyWP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CtuY2THd.js → extension-settings-page-VC-8Pjn2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CZra7GuI.js → gateway-config-api-CH2R7yqo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Cz33jRkR.js → gateway-settings-DLQJWaBQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BbVV0udv.js → gateway-startup-retry--2njcDpC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D2XMlA_U.js → heartbeat-settings-43loWoGb.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DqvpI6LC.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BgrOvhaJ.js → image-generation-api-Cki7jfEV.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DzmbmOGA.js → index-BpkdvHH0.js} +61 -61
- package/dist/gateway/static/root/assets/index-CFVjH-EK.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BfyAEG1G.js → keyboard-shortcuts-settings-DJDZes_8.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CvNQM6qm.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BYalcRSY.js → local-apps-page-C2ajOn1D.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-VOY1wMO9.js → locale-store-Bjvw7jtg.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BLm5yWqQ.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-BQf-6s32.js → management-settings--_eXnFVr.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-Cy_2SN1Q.js → markdown-split-iL2oi-x2.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CkDupqb2.js → media-plugins-BIbkLVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DMJ-6-1m.js → messages-DQ5X6cXp.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-kiGRR9jo.js → notes-page-xFxaZ6gT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-PAftxL3V.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-CvzSdYVj.js → page-tabs-CROi9zm1.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-kZ0nco7e.js → preview-open-alternatives-BwYcPjOM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DgoieqQC.js → product-open-page-BezeuVFd.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CCdfZcw-.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DOG9zm5e.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DQBFgveI.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bud_NTEZ.js → runtime-tools-settings-panel-Bs6tpSyX.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-GlbsCBmv.js → schema-form-CWoSjz9s.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Db6L6M2H.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcO2bd6q.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CKLns16d.js → settings-form-section-BJaMEHsX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BDzpxgk0.js → settings-loading-skeleton-sn4k17x7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BH0pF7QB.js → settings-page-D2hfeFPX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-J793iqfm.js → settings-page-layout-CLtUsWsu.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-UmQC_uZ1.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-UTm_7r0l.js → share-preview-page-BJ58AluH.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BZKn6Fdc.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Cx3i24w_.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DjUllGtk.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-Bwid1TGB.js → skills-page.utils-CZYIuE26.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DUrgdQMk.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BGG2cFe9.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-GVZOImyb.js → theme-store-DtxpMC5S.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-CT2c85Ju.js → typed-models-lib-CRNMvvFX.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CcvY7DTh.js → use-autosave-Dle3-zdQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BLLmw5S1.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Ricc3QGo.js → voice-api-key-field-BrWH0dCl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BoomfqhX.js → work-discovery-overlay-BZ1l9CFM.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BnPF2vx7.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BK6e9yzK.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-Bp5JxQJa.js +5 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/gateway/static/root/notification-sw.js +15 -0
- package/dist/package.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +163 -7
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +21 -8
- package/dist/src/heartbeat/index.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agents-CxuwvDk0.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-wAb5dnHZ.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Drgazevs.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DmYlFJW7.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D7Z8T0o5.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-COjnwO0U.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DcRYBNN7.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C2UYdebT.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-FVmvBG9H.js +0 -2
- package/dist/gateway/static/root/assets/home-page-CPrHkPN6.js +0 -3
- package/dist/gateway/static/root/assets/index-Cg7Xnlu3.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Clz47vSr.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Cxq9WMf5.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-DkYkPGyB.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CeSjJd-N.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-fZ1rm4b9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CbYI6KC8.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-sOJ_TnLm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI0u77dt.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGsml89P.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BM--lgUS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CGCOC-rV.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-iLyaOl48.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-BcB3p1e3.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DQYEf08v.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CGI41bfO.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-mbnepbQk.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DSWG2xqL.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DtV0ruyk.js +0 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
self.addEventListener('notificationclick', (event) => {
|
|
2
|
+
event.notification.close();
|
|
3
|
+
const route = event.notification.data?.route;
|
|
4
|
+
if (typeof route !== 'string' || !route.startsWith('/chat/')) return;
|
|
5
|
+
event.waitUntil((async () => {
|
|
6
|
+
const windows = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });
|
|
7
|
+
const client = windows[0];
|
|
8
|
+
if (client) {
|
|
9
|
+
client.postMessage({ type: 'xopc:notification-click', route });
|
|
10
|
+
await client.focus();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
await self.clients.openWindow(`/#${route}`);
|
|
14
|
+
})());
|
|
15
|
+
});
|
package/dist/package.js
CHANGED
|
@@ -32,8 +32,164 @@ async function tokenRequest(body, signal) {
|
|
|
32
32
|
signal: signal ?? AbortSignal.timeout(3e4)
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
35
|
+
function escapeHtml(value) {
|
|
36
|
+
return value.replace(/[&<>"']/g, (character) => ({
|
|
37
|
+
"&": "&",
|
|
38
|
+
"<": "<",
|
|
39
|
+
">": ">",
|
|
40
|
+
"\"": """,
|
|
41
|
+
"'": "'"
|
|
42
|
+
})[character] ?? character);
|
|
43
|
+
}
|
|
44
|
+
function callbackHtml(title, message, tone) {
|
|
45
|
+
const safeTitle = escapeHtml(title);
|
|
46
|
+
const safeMessage = escapeHtml(message);
|
|
47
|
+
return `<!doctype html>
|
|
48
|
+
<html lang="en">
|
|
49
|
+
<head>
|
|
50
|
+
<meta charset="utf-8" />
|
|
51
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
52
|
+
<meta name="referrer" content="no-referrer" />
|
|
53
|
+
<title>${safeTitle} · XOPC</title>
|
|
54
|
+
<style>
|
|
55
|
+
:root {
|
|
56
|
+
color-scheme: light dark;
|
|
57
|
+
--accent: #3a6bff;
|
|
58
|
+
--accent-soft: #eef3ff;
|
|
59
|
+
--canvas: #f7f8fb;
|
|
60
|
+
--panel: rgba(255, 255, 255, 0.88);
|
|
61
|
+
--text: #111111;
|
|
62
|
+
--muted: #666666;
|
|
63
|
+
--edge: rgba(17, 17, 17, 0.08);
|
|
64
|
+
--status: ${tone === "success" ? "#17864b" : "#d64242"};
|
|
65
|
+
--status-soft: ${tone === "success" ? "#e7fbf1" : "#fff0f0"};
|
|
66
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
67
|
+
}
|
|
68
|
+
* { box-sizing: border-box; }
|
|
69
|
+
html, body { min-height: 100%; }
|
|
70
|
+
body {
|
|
71
|
+
margin: 0;
|
|
72
|
+
min-height: 100vh;
|
|
73
|
+
display: grid;
|
|
74
|
+
place-items: center;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
padding: 24px;
|
|
77
|
+
background:
|
|
78
|
+
radial-gradient(circle at 18% 18%, rgba(46, 216, 255, 0.16), transparent 34rem),
|
|
79
|
+
radial-gradient(circle at 82% 78%, rgba(91, 87, 255, 0.14), transparent 32rem),
|
|
80
|
+
var(--canvas);
|
|
81
|
+
color: var(--text);
|
|
82
|
+
-webkit-font-smoothing: antialiased;
|
|
83
|
+
}
|
|
84
|
+
.glow {
|
|
85
|
+
position: fixed;
|
|
86
|
+
width: 280px;
|
|
87
|
+
height: 280px;
|
|
88
|
+
border-radius: 999px;
|
|
89
|
+
background: rgba(58, 107, 255, 0.12);
|
|
90
|
+
filter: blur(72px);
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
.glow-one { top: -120px; right: -80px; }
|
|
94
|
+
.glow-two { bottom: -150px; left: -80px; }
|
|
95
|
+
.card {
|
|
96
|
+
position: relative;
|
|
97
|
+
width: min(100%, 480px);
|
|
98
|
+
padding: 34px;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
border: 1px solid var(--edge);
|
|
101
|
+
border-radius: 24px;
|
|
102
|
+
background: var(--panel);
|
|
103
|
+
box-shadow: 0 24px 80px rgba(31, 41, 78, 0.12), 0 2px 12px rgba(17, 17, 17, 0.05);
|
|
104
|
+
backdrop-filter: blur(20px);
|
|
105
|
+
-webkit-backdrop-filter: blur(20px);
|
|
106
|
+
}
|
|
107
|
+
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; font-weight: 700; letter-spacing: -0.02em; }
|
|
108
|
+
.logo { width: 38px; height: 38px; filter: drop-shadow(0 8px 14px rgba(58, 107, 255, 0.22)); }
|
|
109
|
+
.status {
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: 7px;
|
|
113
|
+
margin-bottom: 18px;
|
|
114
|
+
border-radius: 999px;
|
|
115
|
+
padding: 7px 11px 7px 8px;
|
|
116
|
+
background: var(--status-soft);
|
|
117
|
+
color: var(--status);
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
font-weight: 650;
|
|
120
|
+
letter-spacing: 0.01em;
|
|
121
|
+
}
|
|
122
|
+
.status-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
123
|
+
h1 { margin: 0; font-size: clamp(26px, 6vw, 32px); line-height: 1.15; letter-spacing: -0.035em; }
|
|
124
|
+
.message { margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
|
|
125
|
+
.next-step {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: flex-start;
|
|
128
|
+
gap: 11px;
|
|
129
|
+
margin-top: 28px;
|
|
130
|
+
padding-top: 22px;
|
|
131
|
+
border-top: 1px solid var(--edge);
|
|
132
|
+
color: var(--muted);
|
|
133
|
+
font-size: 13px;
|
|
134
|
+
line-height: 1.55;
|
|
135
|
+
}
|
|
136
|
+
.window-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
137
|
+
@media (prefers-color-scheme: dark) {
|
|
138
|
+
:root {
|
|
139
|
+
--accent-soft: rgba(58, 107, 255, 0.16);
|
|
140
|
+
--canvas: #090a0d;
|
|
141
|
+
--panel: rgba(20, 22, 28, 0.9);
|
|
142
|
+
--text: #f7f8fb;
|
|
143
|
+
--muted: #a6a9b2;
|
|
144
|
+
--edge: rgba(255, 255, 255, 0.09);
|
|
145
|
+
--status: ${tone === "success" ? "#63d69a" : "#ff8484"};
|
|
146
|
+
--status-soft: ${tone === "success" ? "rgba(44, 203, 127, 0.12)" : "rgba(255, 93, 93, 0.12)"};
|
|
147
|
+
}
|
|
148
|
+
body {
|
|
149
|
+
background:
|
|
150
|
+
radial-gradient(circle at 18% 18%, rgba(46, 216, 255, 0.09), transparent 34rem),
|
|
151
|
+
radial-gradient(circle at 82% 78%, rgba(91, 87, 255, 0.12), transparent 32rem),
|
|
152
|
+
var(--canvas);
|
|
153
|
+
}
|
|
154
|
+
.card { box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42); }
|
|
155
|
+
}
|
|
156
|
+
@media (max-width: 520px) {
|
|
157
|
+
body { padding: 16px; }
|
|
158
|
+
.card { padding: 26px 22px; border-radius: 20px; }
|
|
159
|
+
.brand { margin-bottom: 28px; }
|
|
160
|
+
}
|
|
161
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
162
|
+
.card { animation: enter 420ms cubic-bezier(.2, .75, .25, 1) both; }
|
|
163
|
+
.status-icon { animation: settle 520ms 160ms cubic-bezier(.2, .8, .25, 1.25) both; }
|
|
164
|
+
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.985); } }
|
|
165
|
+
@keyframes settle { from { opacity: 0; transform: scale(.65); } }
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
168
|
+
</head>
|
|
169
|
+
<body>
|
|
170
|
+
<div class="glow glow-one"></div>
|
|
171
|
+
<div class="glow glow-two"></div>
|
|
172
|
+
<main class="card">
|
|
173
|
+
<div class="brand">
|
|
174
|
+
<svg class="logo" viewBox="0 0 72 72" aria-hidden="true">
|
|
175
|
+
<rect width="72" height="72" rx="20" fill="#3a6bff" />
|
|
176
|
+
<path d="M22 22l28 28M50 22 22 50" stroke="#fff" stroke-width="8" stroke-linecap="round" />
|
|
177
|
+
</svg>
|
|
178
|
+
<span>XOPC</span>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="status">
|
|
181
|
+
<svg class="status-icon" viewBox="0 0 24 24" aria-hidden="true">${tone === "success" ? "<path d=\"m7.5 12 3 3 6-7\" />" : "<path d=\"M12 8v5m0 3.5v.01\" />"}</svg>
|
|
182
|
+
<span>${tone === "success" ? "Authorization successful" : "Authorization needs attention"}</span>
|
|
183
|
+
</div>
|
|
184
|
+
<h1>${safeTitle}</h1>
|
|
185
|
+
<p class="message">${safeMessage}</p>
|
|
186
|
+
<div class="next-step">
|
|
187
|
+
<svg class="window-icon" viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="5" width="18" height="14" rx="2" /><path d="M3 9h18" /></svg>
|
|
188
|
+
<span>You can safely close this window and return to XOPC.</span>
|
|
189
|
+
</div>
|
|
190
|
+
</main>
|
|
191
|
+
</body>
|
|
192
|
+
</html>`;
|
|
37
193
|
}
|
|
38
194
|
async function loginWithBrowser(callbacks) {
|
|
39
195
|
if (callbacks.signal?.aborted) throw callbacks.signal.reason instanceof Error ? callbacks.signal.reason : /* @__PURE__ */ new Error("XOPC OAuth login cancelled");
|
|
@@ -49,7 +205,7 @@ async function loginWithBrowser(callbacks) {
|
|
|
49
205
|
const url = new URL(request.url ?? "", "http://127.0.0.1");
|
|
50
206
|
if (url.pathname !== CALLBACK_PATH) {
|
|
51
207
|
response.statusCode = 404;
|
|
52
|
-
response.end(callbackHtml("Authorization callback not found", "This is not a valid XOPC OAuth callback URL."));
|
|
208
|
+
response.end(callbackHtml("Authorization callback not found", "This is not a valid XOPC OAuth callback URL.", "error"));
|
|
53
209
|
return;
|
|
54
210
|
}
|
|
55
211
|
const returnedState = url.searchParams.get("state");
|
|
@@ -58,24 +214,24 @@ async function loginWithBrowser(callbacks) {
|
|
|
58
214
|
if (returnedState !== state) {
|
|
59
215
|
const error = /* @__PURE__ */ new Error("XOPC OAuth state mismatch");
|
|
60
216
|
response.statusCode = 400;
|
|
61
|
-
response.end(callbackHtml("Authorization failed", error.message));
|
|
217
|
+
response.end(callbackHtml("Authorization failed", error.message, "error"));
|
|
62
218
|
settle?.({ error });
|
|
63
219
|
return;
|
|
64
220
|
}
|
|
65
221
|
if (oauthError || !code) {
|
|
66
222
|
const error = /* @__PURE__ */ new Error(oauthError === "access_denied" ? "XOPC OAuth authorization was denied" : "XOPC OAuth callback did not include an authorization code");
|
|
67
223
|
response.statusCode = 400;
|
|
68
|
-
response.end(callbackHtml("Authorization failed", error.message));
|
|
224
|
+
response.end(callbackHtml("Authorization failed", error.message, "error"));
|
|
69
225
|
settle?.({ error });
|
|
70
226
|
return;
|
|
71
227
|
}
|
|
72
228
|
response.statusCode = 200;
|
|
73
|
-
response.end(callbackHtml("Authorization complete", "XOPC received the authorization callback successfully."));
|
|
229
|
+
response.end(callbackHtml("Authorization complete", "XOPC received the authorization callback successfully.", "success"));
|
|
74
230
|
settle?.({ code });
|
|
75
231
|
} catch {
|
|
76
232
|
const error = /* @__PURE__ */ new Error("XOPC OAuth callback could not be processed");
|
|
77
233
|
response.statusCode = 500;
|
|
78
|
-
response.end(callbackHtml("Authorization failed", error.message));
|
|
234
|
+
response.end(callbackHtml("Authorization failed", error.message, "error"));
|
|
79
235
|
settle?.({ error });
|
|
80
236
|
}
|
|
81
237
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
5
4
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
6
5
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -7,9 +7,9 @@ import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import "../../../workflows/draft/index.js";
|
|
11
10
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
12
11
|
import "../../../workflows/authoring/index.js";
|
|
12
|
+
import "../../../workflows/draft/index.js";
|
|
13
13
|
import { basename, join } from "node:path";
|
|
14
14
|
import { readFile, stat } from "node:fs/promises";
|
|
15
15
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -33,6 +33,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
33
33
|
let taskRun;
|
|
34
34
|
let taskRunStatus = "failed";
|
|
35
35
|
let taskRunSummary = "Agent run ended unexpectedly";
|
|
36
|
+
let terminalStatus = "error";
|
|
36
37
|
let webchatSessionKey;
|
|
37
38
|
let webchatSessionId;
|
|
38
39
|
let webchatMetadata;
|
|
@@ -107,8 +108,8 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
107
108
|
yield event;
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
yield* emitAndYield(mapper.start());
|
|
111
111
|
try {
|
|
112
|
+
yield* emitAndYield(mapper.start());
|
|
112
113
|
if (channel === "webchat" && webchatSessionKey) {
|
|
113
114
|
const sessionKey = webchatSessionKey;
|
|
114
115
|
updateAsyncLogContext({
|
|
@@ -139,16 +140,10 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
139
140
|
const endStatus = mergedSignal.aborted ? "cancelled" : "success";
|
|
140
141
|
const endSummary = mergedSignal.aborted ? "Interrupted" : "Message processed successfully";
|
|
141
142
|
taskRunStatus = mergedSignal.aborted ? "cancelled" : "succeeded";
|
|
143
|
+
terminalStatus = endStatus;
|
|
142
144
|
taskRunSummary = endSummary;
|
|
143
145
|
yield* emitAndYield(mapper.end(endStatus, endSummary));
|
|
144
146
|
completeRealtimeTopic(`run:${runId}`);
|
|
145
|
-
try {
|
|
146
|
-
const metaAfter = await sessionIndex.getSessionMetadata(sessionKey);
|
|
147
|
-
if (metaAfter?.name) emit("session.updated", {
|
|
148
|
-
key: sessionKey,
|
|
149
|
-
name: metaAfter.name
|
|
150
|
-
});
|
|
151
|
-
} catch {}
|
|
152
147
|
return {
|
|
153
148
|
status: mergedSignal.aborted ? "aborted" : "ok",
|
|
154
149
|
summary: mergedSignal.aborted ? "Interrupted" : "Message processed successfully"
|
|
@@ -165,6 +160,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
165
160
|
}, `Agent processing failed: ${em}`);
|
|
166
161
|
streamError = em;
|
|
167
162
|
taskRunStatus = "failed";
|
|
163
|
+
terminalStatus = "error";
|
|
168
164
|
taskRunSummary = em;
|
|
169
165
|
const errorContent = formatAgentRunErrorForClient(streamError);
|
|
170
166
|
yield* emitAndYield(mapper.error(errorContent));
|
|
@@ -278,6 +274,23 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
278
274
|
runId
|
|
279
275
|
}, `Task run finalization failed: ${errorMessage}`);
|
|
280
276
|
}
|
|
277
|
+
if (webchatSessionKey) {
|
|
278
|
+
const metaAfter = await sessionIndex.getSessionMetadata(webchatSessionKey).catch(() => void 0);
|
|
279
|
+
if (metaAfter?.name) emit("session.updated", {
|
|
280
|
+
key: webchatSessionKey,
|
|
281
|
+
name: metaAfter.name
|
|
282
|
+
});
|
|
283
|
+
emit("agent.run.ended", {
|
|
284
|
+
schemaVersion: 1,
|
|
285
|
+
runId,
|
|
286
|
+
sessionKey: webchatSessionKey,
|
|
287
|
+
status: terminalStatus,
|
|
288
|
+
completedAtMs: Date.now(),
|
|
289
|
+
route: `/chat/${encodeURIComponent(webchatSessionKey)}`,
|
|
290
|
+
source: "webchat",
|
|
291
|
+
...metaAfter?.name?.trim() ? { sessionTitle: metaAfter.name.trim().slice(0, 100) } : {}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
281
294
|
}
|
|
282
295
|
}
|
|
283
296
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.193",
|
|
4
4
|
"description": "Local-first AI system that remembers context, coordinates AI, and sustains long-term progress.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -162,10 +162,10 @@
|
|
|
162
162
|
"vitepress": "^1.6.4",
|
|
163
163
|
"vitest": "4.1.5",
|
|
164
164
|
"vue": "^3.5.35",
|
|
165
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
165
166
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
166
|
-
"@xopcai/realtime-protocol": "0.0.0",
|
|
167
167
|
"@xopcai/realtime-client": "0.0.0",
|
|
168
|
-
"@xopcai/
|
|
168
|
+
"@xopcai/realtime-protocol": "0.0.0"
|
|
169
169
|
},
|
|
170
170
|
"scripts": {
|
|
171
171
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|