@xopcai/xopc 0.0.200 → 0.0.202
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-DYVN1hRp.js → activity-store-DOhnAQOQ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-eMarz29u.js → agent-avatar-dicebear-CAjfa48Q.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DeLW-454.js → agents-Cke8EF5Z.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B8mzbAle.js → api-E9Bk-Idp.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-yfb68wq9.js → app-management-settings-panel-GNT3iv0V.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B8SPknFM.js → appearance-settings-BFond2ll.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bmor22Ny.js → apps-page-B9D-6sJt.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DmYRiOP3.js → archive-plugin-C6qpchzp.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D66JvcPi.js → attachment-load-B4CcSDdV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Q4e8m11h.js → automations-page-BFS3dH43.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-ChIsZArT.js → binary-plugins-xYL_41XP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Ck-k_d0Z.js → block-editor-nYiJQItv.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page--uVL73Sb.js → browser-settings-page-ELV-Y8rz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-_ndaecsf.js → browser-workflow-inputs-D_jnndyz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-BC5jm1zL.js → browser-workflows-page-pT7Hvwwh.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DXpf3QYN.js → capabilities-settings-panel-Dbx_nPAI.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-Dy1jZJKs.js → capability-presets-api--tz0mGLY.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-NAjCsrTi.js → capability-presets-settings-panel-DHg_JMUz.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-D-9qiuio.js → channel-recipient-api-CkOKF9nc.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-CiWUo7jW.js → channels-settings-DjHOlPq-.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DNDvMWpl.js +1 -0
- package/dist/gateway/static/root/assets/{connectors-api-5xiCRVUS.js → connectors-api-X5ukNasZ.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DOwlMseU.js → connectors-page-RY-W6CQt.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-B3PebXKZ.js → cron-expression-DHY0LrLq.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-C1Vke7Xn.js → date-picker-CGm8EH8G.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-FrQ0tsBC.js → dependency-picker-DDECr6Hj.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CPBAzNJi.js → desktop-pet-BoEIRgm2.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D6s3glDP.js → desktop-pet-settings-s4kmnf-W.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CbNQ7QQS.js → directory-picker-path-field-DmfFg4Gq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-dTK14hUv.js → extension-debug-page-DrLEK8GU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Cpdj1Kip.js → extension-page-DtyFPtMR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-iNHUZGd5.js → extension-settings-page-Xok6T2KD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-SvMvWqMM.js → gateway-config-api-DwSpEYiw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-jB0hAhWO.js → gateway-config-swr-Cv2ywpdb.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BilR3dGZ.js → gateway-settings-B5Zh2rx9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C-fRlHCL.js → gateway-startup-retry-undf-k5g.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-zK40dcQ5.js → heartbeat-settings-C2RxqeK0.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-NyXy5MLr.js → home-page-DPhkqxEb.js} +1 -1
- package/dist/gateway/static/root/assets/index-CKSplmFw.js +152 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-nKzsroud.js → keyboard-shortcuts-settings-BN3p-1wI.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Ds3sPXTh.js → local-app-workbench-page-D7FmunJF.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DV1s_FYh.js → local-apps-page-C7H807zd.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-xULEcFVs.js → locale-store-CnamlR07.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Biz4eA02.js → logs-page-vrjf-JTk.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-D7KjYgHu.js → management-settings-CTIaHfgU.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CTYbpkrd.js → markdown-split-C0iKadAm.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BXYnaiZ6.js → media-plugins-DcM72GSJ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D7kOD_o_.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-CWWVXpw5.js → notes-page-By_EzRhP.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-DnBkQihH.js → notes-workbench-Cp1ierS_.js} +2 -2
- package/dist/gateway/static/root/assets/{preview-open-alternatives-pimQAkeI.js → preview-open-alternatives-CpblfmWk.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BoYSS_YR.js → product-open-page-dQ2_5PLu.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-ZO7t1UkB.js → project-detail-page-Cp_jfZJj.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-By-vq41g.js → projects-page-DYbmweGw.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-C0C_Y9d0.js → remote-access-hub-U2qXVyLH.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DT8flaX1.js → runtime-tools-settings-panel-DiPj9FLN.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DabEP-UI.js → schema-form-BDLYItBP.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BNlVwUzV.js → sessions-page-CtNKNhCi.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B6IMzhWo.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DCsfZAtC.js → settings-form-section-Dr4Uf_CY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Dac6Yd0T.js → settings-loading-skeleton-Bqi7tsXj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BDoYoEar.js → settings-page-BbookgxJ.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DWijJ1rw.js → setup-status-panel-mUu0iDlD.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-ie9I2_7h.js → share-preview-page-1M79esSO.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DU9VrJLf.js → shares-settings-DadcMA8y.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-C3ZzYCz0.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-N0YhaR5S.js → skills-page-B3kqZ-ke.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-C639DLXr.js → skills-page.utils-b9byH-KL.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CpshpQtC.js → system-settings-panel-CL_AXjw1.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DsTocYkK.js → task-detail-page-Bnjpkl4v.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CHQRiuCF.js → theme-store-BDyUTObE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-ms6rDy59.js → use-autosave-CUI3q_I-.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-BUxIemwy.js → user-context-page-CBgAAZiB.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CObrQWh2.js → voice-api-key-field-DLXOB1jw.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BBxrnEFt.js → work-discovery-overlay-BvlvyVJX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DN3l-HW3.js → work-discovery-page-BBpnnnrs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BxXhe3IV.js → workflow-run-setup-panel-DKpUxB-i.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BCHkjd1i.js → workflows-page-Dd_9p9ji.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D-IgcHPp.js → working-directory-picker-modal-BcyiDXU3.js} +1 -1
- package/dist/gateway/static/root/index.html +8 -8
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/oauth/types.d.ts +2 -0
- package/dist/src/auth/oauth/xopc-cloud.js +24 -2
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/oauth-async.d.ts +1 -0
- package/dist/src/gateway/hono/oauth-async.js +15 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/channels-status-swr-B4Rbh3bM.js +0 -1
- package/dist/gateway/static/root/assets/index-CCK8zdlS.js +0 -152
- package/dist/gateway/static/root/assets/messages-3qRsLZuX.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-CxYBQDaM.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-C5RaIvoE.js +0 -1
|
@@ -41,9 +41,10 @@ function escapeHtml(value) {
|
|
|
41
41
|
"'": "'"
|
|
42
42
|
})[character] ?? character);
|
|
43
43
|
}
|
|
44
|
-
function callbackHtml(title, message, tone) {
|
|
44
|
+
function callbackHtml(title, message, tone, returnToAppUrl) {
|
|
45
45
|
const safeTitle = escapeHtml(title);
|
|
46
46
|
const safeMessage = escapeHtml(message);
|
|
47
|
+
const safeReturnToAppUrl = returnToAppUrl?.startsWith("xopc://") ? escapeHtml(returnToAppUrl) : void 0;
|
|
47
48
|
return `<!doctype html>
|
|
48
49
|
<html lang="en">
|
|
49
50
|
<head>
|
|
@@ -134,6 +135,20 @@ function callbackHtml(title, message, tone) {
|
|
|
134
135
|
line-height: 1.55;
|
|
135
136
|
}
|
|
136
137
|
.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; }
|
|
138
|
+
.return-button {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
margin-top: 22px;
|
|
143
|
+
min-height: 42px;
|
|
144
|
+
border-radius: 12px;
|
|
145
|
+
padding: 0 16px;
|
|
146
|
+
background: var(--accent);
|
|
147
|
+
color: #fff;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
font-weight: 650;
|
|
150
|
+
text-decoration: none;
|
|
151
|
+
}
|
|
137
152
|
@media (prefers-color-scheme: dark) {
|
|
138
153
|
:root {
|
|
139
154
|
--accent-soft: rgba(58, 107, 255, 0.16);
|
|
@@ -183,11 +198,18 @@ function callbackHtml(title, message, tone) {
|
|
|
183
198
|
</div>
|
|
184
199
|
<h1>${safeTitle}</h1>
|
|
185
200
|
<p class="message">${safeMessage}</p>
|
|
201
|
+
${safeReturnToAppUrl ? `<a id="return-to-xopc" class="return-button" href="${safeReturnToAppUrl}">Open XOPC</a>` : ""}
|
|
186
202
|
<div class="next-step">
|
|
187
203
|
<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
204
|
<span>You can safely close this window and return to XOPC.</span>
|
|
189
205
|
</div>
|
|
190
206
|
</main>
|
|
207
|
+
${safeReturnToAppUrl ? `<script>
|
|
208
|
+
window.setTimeout(function () {
|
|
209
|
+
var link = document.getElementById('return-to-xopc');
|
|
210
|
+
if (link) window.location.href = link.href;
|
|
211
|
+
}, 350);
|
|
212
|
+
<\/script>` : ""}
|
|
191
213
|
</body>
|
|
192
214
|
</html>`;
|
|
193
215
|
}
|
|
@@ -226,7 +248,7 @@ async function loginWithBrowser(callbacks) {
|
|
|
226
248
|
return;
|
|
227
249
|
}
|
|
228
250
|
response.statusCode = 200;
|
|
229
|
-
response.end(callbackHtml("Authorization complete", "XOPC received the authorization callback successfully.", "success"));
|
|
251
|
+
response.end(callbackHtml("Authorization complete", "XOPC received the authorization callback successfully.", "success", callbacks.returnToAppUrl));
|
|
230
252
|
settle?.({ code });
|
|
231
253
|
} catch {
|
|
232
254
|
const error = /* @__PURE__ */ new Error("XOPC OAuth callback could not be processed");
|
|
@@ -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";
|
|
4
5
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
5
6
|
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";
|
|
@@ -9,6 +9,7 @@ import { Hono } from 'hono';
|
|
|
9
9
|
import type { GatewayService } from '../service.js';
|
|
10
10
|
import { type OAuthCredentials } from '../../auth/oauth/types.js';
|
|
11
11
|
export declare function refreshModelCatalogAfterOAuth(provider: string, service: Pick<GatewayService, 'getModelCatalogSync'>): Promise<void>;
|
|
12
|
+
export declare function normalizeDesktopOAuthReturnPath(value: unknown): string | undefined;
|
|
12
13
|
export declare function resolveOAuthLoginMethodPreference(params: {
|
|
13
14
|
requestedMethod?: unknown;
|
|
14
15
|
supportedMethods?: readonly string[];
|
|
@@ -53,6 +53,18 @@ setInterval(() => {
|
|
|
53
53
|
function generateSessionId() {
|
|
54
54
|
return `oauth_${Date.now()}_${Math.random().toString(36).substring(2, 15)}`;
|
|
55
55
|
}
|
|
56
|
+
function normalizeDesktopOAuthReturnPath(value) {
|
|
57
|
+
if (typeof value !== "string") return void 0;
|
|
58
|
+
const path = value.trim();
|
|
59
|
+
if (path.length === 0 || path.length > 2048 || !path.startsWith("/") || path.startsWith("//") || path.includes("\\") || /[\u0000-\u001f\u007f]/.test(path)) return;
|
|
60
|
+
return path;
|
|
61
|
+
}
|
|
62
|
+
function desktopOAuthReturnUrl(sessionId, returnPath) {
|
|
63
|
+
const params = new URLSearchParams({ request_id: sessionId });
|
|
64
|
+
const normalizedReturnPath = normalizeDesktopOAuthReturnPath(returnPath);
|
|
65
|
+
if (normalizedReturnPath) params.set("return_path", normalizedReturnPath);
|
|
66
|
+
return `xopc://cloud/model-connected?${params.toString()}`;
|
|
67
|
+
}
|
|
56
68
|
function cancelOAuthSession(session, message = "OAuth flow cancelled") {
|
|
57
69
|
if (session.abortController) session.abortController.abort();
|
|
58
70
|
if (session.manualCodeResolve) session.manualCodeResolve("");
|
|
@@ -110,6 +122,7 @@ function createOAuthAsyncHandler(service) {
|
|
|
110
122
|
const session = {
|
|
111
123
|
id: sessionId,
|
|
112
124
|
provider,
|
|
125
|
+
...body.client === "desktop" && provider === "xopc-cloud" ? { returnToAppUrl: desktopOAuthReturnUrl(sessionId, body.returnPath) } : {},
|
|
113
126
|
preferredLoginMethod: preferredOAuthLoginMethod({
|
|
114
127
|
provider,
|
|
115
128
|
requestedMethod: body.loginMethod,
|
|
@@ -283,6 +296,7 @@ async function runOAuthFlow(session, oauthProvider, service) {
|
|
|
283
296
|
}, "Selected OAuth auth method");
|
|
284
297
|
return selectedOption.id;
|
|
285
298
|
},
|
|
299
|
+
returnToAppUrl: session.returnToAppUrl,
|
|
286
300
|
signal: abortController.signal
|
|
287
301
|
};
|
|
288
302
|
try {
|
|
@@ -328,4 +342,4 @@ function deleteOAuthCredentialsFromCache(provider) {
|
|
|
328
342
|
oauthCredentialsCache.delete(provider);
|
|
329
343
|
}
|
|
330
344
|
//#endregion
|
|
331
|
-
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, refreshModelCatalogAfterOAuth, resolveOAuthLoginMethodPreference, setOAuthCredentialsToCache };
|
|
345
|
+
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, normalizeDesktopOAuthReturnPath, refreshModelCatalogAfterOAuth, resolveOAuthLoginMethodPreference, setOAuthCredentialsToCache };
|
|
@@ -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";
|
|
2
3
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
3
4
|
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.202",
|
|
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/
|
|
166
|
-
"@xopcai/realtime-protocol": "0.0.0",
|
|
165
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
167
166
|
"@xopcai/realtime-client": "0.0.0",
|
|
168
|
-
"@xopcai/
|
|
167
|
+
"@xopcai/realtime-protocol": "0.0.0",
|
|
168
|
+
"@xopcai/endpoint-tools-protocol": "0.0.0"
|
|
169
169
|
},
|
|
170
170
|
"scripts": {
|
|
171
171
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./locale-store-xULEcFVs.js";import{n as t}from"./channel-recipient-api-D-9qiuio.js";function n(){return e(`/api/channels/status`)}var r=t;export{r as n,n as t};
|