@yuriai/web 0.1.16 → 0.1.18
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/assets/{AgentAvatar-DPBeg3oL.js → AgentAvatar-Dn3d91Bp.js} +1 -1
- package/dist/assets/{AssistantView-ClusVHm3.js → AssistantView-3S3PpBjs.js} +3 -3
- package/dist/assets/{DiagramView-DJTM6ODs.js → DiagramView-CTY5Um4M.js} +1 -1
- package/dist/assets/{FadeInOnReveal-Cx0k6XUX.js → FadeInOnReveal-D7ifJQAw.js} +1 -1
- package/dist/assets/{Icon-tuli5r38.js → Icon-DZmADJWp.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-Bb5so0Of.js → ImageLoadingPlaceholder-Dw4P79Ms.js} +1 -1
- package/dist/assets/{LoadingImage-C6L95rT6.js → LoadingImage-CCKvcYRc.js} +1 -1
- package/dist/assets/{MarkdownRenderer-BOzf06hy.js → MarkdownRenderer-C0UNUMvd.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-nJqYBYY5.js → MarkdownRendererImpl-Bh2DYMba.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-ISP5YVfC.js → MarkstreamRendererImpl-CofeYQvg.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DYPgyd53.js → MobileDetailNavigation-Dv5XHCnW.js} +1 -1
- package/dist/assets/{MobileShareBridge-B8qheVUE.js → MobileShareBridge-tKAyc2bO.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-1pFJzsUE.js → MobileTabPageHeader-ANWyewuK.js} +1 -1
- package/dist/assets/{MultiRunWindow-TFhuosI7.js → MultiRunWindow-Gh6sdZA4.js} +1 -1
- package/dist/assets/{OnboardingScreen-DVmBX2U1.js → OnboardingScreen-DE2iB21m.js} +1 -1
- package/dist/assets/{OverlayScrollbar-D5nUzsru.js → OverlayScrollbar-BlzvB3ct.js} +1 -1
- package/dist/assets/{SettingsView-oJNzImEs.js → SettingsView-CNmMgobr.js} +2 -2
- package/dist/assets/{SettingsWindow-DCqKjsob.js → SettingsWindow-CC3Alyza.js} +1 -1
- package/dist/assets/{TerminalView-D200BgVI.js → TerminalView-wKTDRzF8.js} +1 -1
- package/dist/assets/{ToolOutputDialog-B2rAKALC.js → ToolOutputDialog-CnO2TzIK.js} +1 -1
- package/dist/assets/{YuriLogo-lTu65FqY.js → YuriLogo-Dm011NCM.js} +1 -1
- package/dist/assets/{appThemeRegistry-Df0QAgDt.js → appThemeRegistry-CfYa7h6w.js} +1 -1
- package/dist/assets/{button-BYnYoCZy.js → button-CEcZQm-B.js} +1 -1
- package/dist/assets/{capgoAdapter-B1JGsWB-.js → capgoAdapter-Bbg9bUu7.js} +1 -1
- package/dist/assets/{collapsible-DZhQ_5lo.js → collapsible-B6ON5Mai.js} +1 -1
- package/dist/assets/{diagram-CJZ0URNS.js → diagram-9xxUjDb_.js} +1 -1
- package/dist/assets/{dialog-nRZ4nWn0.js → dialog-CjPdvmr0.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-Z2jL8P90.js → dropdown-menu.styles-Cm3A3LAl.js} +1 -1
- package/dist/assets/{es-DKMfE2g4.js → es-CqWNlkik.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-DtSAgPbH.js → fileMentionTouchSelection-B-TBtcnw.js} +1 -1
- package/dist/assets/{fr-DeBe3ouU.js → fr-CpxexYkk.js} +1 -1
- package/dist/assets/{gitApi-B8HOpTmn.js → gitApi-r2KmJn5U.js} +1 -1
- package/dist/assets/{input-Ctn0g9vd.js → input-yYSzMq8L.js} +1 -1
- package/dist/assets/{insertionBoundaries-CnvMX7Vd.js → insertionBoundaries-DTZGt8de.js} +1 -1
- package/dist/assets/{ja-BesmOdJA.js → ja-ByTgQPSi.js} +1 -1
- package/dist/assets/{ko-C00DHDrX.js → ko-BGfRP-3B.js} +1 -1
- package/dist/assets/{main-KtEZKcP1.js → main-BGkHVEOB.js} +4 -4
- package/dist/assets/{main-C0Q_YuR5.js → main-Dh7YsvL7.js} +2 -2
- package/dist/assets/{markdownHeightCache-qOdEJNXq.js → markdownHeightCache-w0HDCLwk.js} +1 -1
- package/dist/assets/{mcpQueries-PR2yspsH.js → mcpQueries-DWwfeUWo.js} +1 -1
- package/dist/assets/{miniChat-eHONuAMl.js → miniChat-BNXC1Uwf.js} +2 -2
- package/dist/assets/{mobile-Dhf0ZZ9w.js → mobile-BZdmrG0l.js} +2 -2
- package/dist/assets/{mobileBackNavigation-B_77fWgl.js → mobileBackNavigation-DdzXgcsh.js} +1 -1
- package/dist/assets/{multirun-DU-bB0Fz.js → multirun-BkZZvy-g.js} +1 -1
- package/dist/assets/{native-config-C983LoGp.js → native-config-VkD8jWjT.js} +1 -1
- package/dist/assets/{pl-DjFYuP3K.js → pl-DIwCzbXW.js} +1 -1
- package/dist/assets/{projectMeta-BbLfp8I_.js → projectMeta-SJUW6WLN.js} +1 -1
- package/dist/assets/{pt-BR-CxNevoP6.js → pt-BR-4MjIbbWQ.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-CzK3jEE3.js → renderElectronMiniChatApp-tJgU_2iE.js} +2 -2
- package/dist/assets/{renderMobileApp-4A1igptR.js → renderMobileApp-D8XGqOjL.js} +4 -4
- package/dist/assets/{runtimeConfig-CQ98mFUj.js → runtimeConfig-CWesudQj.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-CjdKfQkh.js → runtimeEndpointReset-CbPjEtyd.js} +2 -2
- package/dist/assets/{scheduledTaskNavigation-HqH8WVi0.js → scheduledTaskNavigation-BhsUww-K.js} +1 -1
- package/dist/assets/{sessionChangeSummary-O5cuQBr9.js → sessionChangeSummary-BCpu7FyU.js} +1 -1
- package/dist/assets/{sessionLookup-y_eZdACc.js → sessionLookup-CYcaXWbS.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-iF-Lsdrw.js → sortable-tabs-strip-MyKMqyvw.js} +1 -1
- package/dist/assets/{speechSettingsQueries-DAg065ps.js → speechSettingsQueries-yoeVhzst.js} +1 -1
- package/dist/assets/src-SP38MjX4.css +2 -0
- package/dist/assets/{store-CKdJiGxW.js → store-JjNwX_aQ.js} +2 -2
- package/dist/assets/{textarea-COrQqu0T.js → textarea-CO8JEdzP.js} +1 -1
- package/dist/assets/{tooltip-GgfMkvSY.js → tooltip-Dmw1nU2I.js} +1 -1
- package/dist/assets/{types-BerJclt2.js → types-B6z2-TGK.js} +1 -1
- package/dist/assets/{uk-B4NY4iyI.js → uk-D9WsfZqn.js} +1 -1
- package/dist/assets/{useAppFontEffects-B1sGq92W.js → useAppFontEffects-kBRpVvqj.js} +7 -7
- package/dist/assets/{useDesktopWindowControlsLayout-xIv_DjE8.js → useDesktopWindowControlsLayout-BHvLM__x.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DB0Jdz7o.js → useEffectiveDirectory-D23Wy2sb.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BKkspQdp.js → useMobileNavigationStore-zm-aOKmE.js} +7 -7
- package/dist/assets/{useWorkerHighlightedLines-DvyGtvqN.js → useWorkerHighlightedLines-DhpBon5c.js} +1 -1
- package/dist/assets/{zh-CN-CHBpOEbP.js → zh-CN-CAIBZPD7.js} +1 -1
- package/dist/assets/{zh-TW-DTVob60i.js → zh-TW-IpFLeeKe.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +6 -6
- package/package.json +1 -1
- package/server/lib/config-sync/DOCUMENTATION.md +1 -1
- package/server/lib/config-sync/magpie.js +25 -4
- package/server/lib/config-sync/magpie.test.js +8 -2
- package/server/lib/config-sync/routes.js +4 -0
- package/server/lib/config-sync/routes.test.js +11 -0
- package/dist/assets/src-OU8Px6Wu.css +0 -2
package/dist/index.html
CHANGED
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
opacity: 0.72;
|
|
561
561
|
}
|
|
562
562
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-Dh7YsvL7.js"></script>
|
|
564
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
566
566
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -583,11 +583,11 @@
|
|
|
583
583
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
584
584
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
586
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
587
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
588
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
589
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
590
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
586
|
+
<link rel="modulepreload" crossorigin href="/assets/types-B6z2-TGK.js">
|
|
587
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bbg9bUu7.js">
|
|
588
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-VkD8jWjT.js">
|
|
589
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CWesudQj.js">
|
|
590
|
+
<link rel="stylesheet" crossorigin href="/assets/src-SP38MjX4.css">
|
|
591
591
|
</head>
|
|
592
592
|
<body class="h-full bg-background text-foreground">
|
|
593
593
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-BNXC1Uwf.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
104
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/types-B6z2-TGK.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bbg9bUu7.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-VkD8jWjT.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CWesudQj.js">
|
|
104
|
+
<link rel="stylesheet" crossorigin href="/assets/src-SP38MjX4.css">
|
|
105
105
|
</head>
|
|
106
106
|
<body class="h-full bg-background text-foreground">
|
|
107
107
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-BZdmrG0l.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
93
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/types-B6z2-TGK.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bbg9bUu7.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-VkD8jWjT.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CWesudQj.js">
|
|
93
|
+
<link rel="stylesheet" crossorigin href="/assets/src-SP38MjX4.css">
|
|
94
94
|
</head>
|
|
95
95
|
<body class="h-full bg-background text-foreground">
|
|
96
96
|
<div id="root" class="h-full"></div>
|
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ Discovery checks `MAGPIE_BINARY`, PATH, the user's `.local/bin`, macOS applicati
|
|
|
89
89
|
|
|
90
90
|
Selecting Magpie uses its native `backup` / `restore` with configuration, API keys, profiles, agent models, library and portable plugin declarations. Native provider/group restore merges by ID and does not propagate deletions; settings and library follow Magpie's own restore semantics, retaining machine-local settings. This is a full native bundle, not a provider-only restore.
|
|
91
91
|
|
|
92
|
-
The v2 envelope additionally carries recognized plugin API/OAuth accounts and self-contained saved Codex credentials. The source CLI account inventory limits export to recognized providers; hidden and orphaned plugin sign-ins are excluded. Plugin accounts merge by their native account key into `plugin-auth.json` under Magpie's exclusive-create lock, using a private atomic replacement. Destination-only accounts remain; repeated transfers do not append duplicates. Codex uses native `accounts import codex --yes`, which owns account identity/deduplication and the OS-level `logins.json` lock. Yuri never writes `logins.json` or copies machine-local account homes. Other subscription formats and accounts discovered only from external clients are not inferred or silently treated as transferred: unsupported active source accounts produce `sign_in_required`. An import re-reads `accounts --json` and requires all transferred plugin account counts and Codex identities to be recognized before returning success. This checks discovery, not successful model inference or future token renewal; revoked credentials still require login.
|
|
92
|
+
The v2 envelope additionally carries recognized plugin API/OAuth accounts and self-contained saved Codex credentials. The source CLI account inventory limits export to recognized providers; hidden and orphaned plugin sign-ins are excluded. Plugin accounts merge by their native account key into `plugin-auth.json` under Magpie's exclusive-create lock, using a private atomic replacement. Destination-only accounts remain; repeated transfers do not append duplicates. Codex uses native `accounts import codex --yes`, which owns account identity/deduplication and the OS-level `logins.json` lock. Yuri never writes `logins.json` or copies machine-local account homes. Other subscription formats and accounts discovered only from external clients are not inferred or silently treated as transferred: unsupported active source accounts produce `sign_in_required`. An import re-reads `accounts --json` and requires all transferred plugin account counts and Codex identities to be recognized before returning success. Plugin diagnostics on stderr are ignored when recovering the top-level JSON array from the merged CLI streams. This checks discovery, not successful model inference or future token renewal; revoked credentials still require login.
|
|
93
93
|
|
|
94
94
|
Missing destination executables are installed only when Magpie is explicitly selected for import, never in preview or ordinary OpenCode sync. The host selects the official pure CLI asset for macOS/Linux/Windows x64/arm64 from `https://usemagpie.ai/api/latest`, verifies SHA-256, checks `--version`, then atomically publishes it under `<YURI_DATA_DIR>/tools/magpie/` (default `~/.config/yuri`). Existing desktop clients and CLIs are reused. Installation is process-local single-flight, needs no global PATH change or desktop environment, and fails explicitly for unsupported platforms or unverifiable downloads.
|
|
95
95
|
|
|
@@ -12,6 +12,27 @@ const exists = async (file) => {
|
|
|
12
12
|
catch (error) { if (error.code === 'ENOENT' || error.code === 'ENOTDIR') return null; throw error; }
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
// Magpie plugins may print diagnostics on stderr while accounts --json still exits 0.
|
|
16
|
+
// runCli merges streams for restore pattern matching, so recover the top-level JSON array.
|
|
17
|
+
export const parseMagpieAccountsJson = (raw) => {
|
|
18
|
+
const text = String(raw || '').replace(/\x1b\[[0-9;]*m/g, '');
|
|
19
|
+
let start = -1;
|
|
20
|
+
for (let i = 0; i < text.length; i++) {
|
|
21
|
+
if (text[i] === '[' && (i === 0 || text[i - 1] === '\n' || text[i - 1] === '\r')) {
|
|
22
|
+
start = i;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (start < 0) throw new Error('Unable to read Magpie accounts');
|
|
27
|
+
try {
|
|
28
|
+
const accounts = JSON.parse(text.slice(start));
|
|
29
|
+
if (!Array.isArray(accounts)) throw new Error();
|
|
30
|
+
return accounts;
|
|
31
|
+
} catch {
|
|
32
|
+
throw new Error('Unable to read Magpie accounts');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
15
36
|
// Raw CLI output may contain provider names, paths or credentials. Never forward it.
|
|
16
37
|
const runCli = (binary, args, { input = '', env, timeout = 600_000 } = {}) => new Promise((resolve, reject) => {
|
|
17
38
|
const child = spawn(binary, args, { env, windowsHide: true, detached: process.platform !== 'win32', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
@@ -207,7 +228,7 @@ export function createMagpieSync({
|
|
|
207
228
|
const backup = await fs.readFile(file);
|
|
208
229
|
let authorization;
|
|
209
230
|
try {
|
|
210
|
-
const accounts =
|
|
231
|
+
const accounts = parseMagpieAccountsJson(await run(binary, ['accounts', '--json'], { env }));
|
|
211
232
|
authorization = await collectMagpieAuth(await dataDir(binary), accounts);
|
|
212
233
|
} catch { throw new Error('Unable to export Magpie authorizations'); }
|
|
213
234
|
const payload = Buffer.from(JSON.stringify({ format: 'magpie-sync-v2', passphrase, backup: backup.toString('base64'), authorization }));
|
|
@@ -247,7 +268,7 @@ export function createMagpieSync({
|
|
|
247
268
|
await run(binary, ['accounts', 'import', 'codex', credentialFile, '--yes'], { env });
|
|
248
269
|
} finally { await fs.rm(credentialFile, { force: true }); }
|
|
249
270
|
});
|
|
250
|
-
const accounts =
|
|
271
|
+
const accounts = parseMagpieAccountsJson(await run(binary, ['accounts', '--json'], { env }));
|
|
251
272
|
verifyMagpieAuth(decoded.authorization, accounts);
|
|
252
273
|
const configured = JSON.parse(await fs.readFile(path.join(dir, 'providers.json'), 'utf8').catch((error) => {
|
|
253
274
|
if (error.code === 'ENOENT') return '{"providers":[]}';
|
|
@@ -262,8 +283,8 @@ export function createMagpieSync({
|
|
|
262
283
|
output = await run(binary, ['restore', file], { env, input: `${decoded.passphrase}\n` });
|
|
263
284
|
if (/Couldn't add the plugin|Needs a key|Library:.*couldn't/i.test(output)) throw new Error();
|
|
264
285
|
}
|
|
265
|
-
} catch {
|
|
266
|
-
throw new Error('Magpie authorization sync or verification failed; some configuration and accounts may already be applied. Retry to finish.');
|
|
286
|
+
} catch (error) {
|
|
287
|
+
throw new Error('Magpie authorization sync or verification failed; some configuration and accounts may already be applied. Retry to finish.', { cause: error });
|
|
267
288
|
}
|
|
268
289
|
}
|
|
269
290
|
const magpieWarnings = [];
|
|
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { createHash } from 'node:crypto';
|
|
6
|
-
import { createMagpieSync } from './magpie.js';
|
|
6
|
+
import { createMagpieSync, parseMagpieAccountsJson } from './magpie.js';
|
|
7
7
|
import { planOpenCodeConfigSync, planOpenCodeConfigSyncFromInventory } from './plan.js';
|
|
8
8
|
import { applyConfigSyncPlan } from './engine.js';
|
|
9
9
|
|
|
@@ -23,6 +23,12 @@ const write = async (file, content = '{}') => {
|
|
|
23
23
|
afterEach(async () => { await Promise.all(dirs.splice(0).map((dir) => fs.rm(dir, { recursive: true, force: true }))); });
|
|
24
24
|
|
|
25
25
|
describe('Magpie discovery and native transfer', () => {
|
|
26
|
+
it('recovers accounts JSON when plugin diagnostics precede the array on merged streams', () => {
|
|
27
|
+
expect(parseMagpieAccountsJson('2026/10/28 10:45:30 plugin [error]: Grok is not signed in\n[{"agent":"cursor","user":"a@example.invalid"}]'))
|
|
28
|
+
.toEqual([{ agent: 'cursor', user: 'a@example.invalid' }]);
|
|
29
|
+
expect(() => parseMagpieAccountsJson('no json here')).toThrow('Unable to read Magpie accounts');
|
|
30
|
+
});
|
|
31
|
+
|
|
26
32
|
it('hides config-only sources until Magpie is installed, without installing during preview', async () => {
|
|
27
33
|
const { home, options } = await machine();
|
|
28
34
|
const fetchImpl = vi.fn();
|
|
@@ -122,7 +128,7 @@ describe('Magpie discovery and native transfer', () => {
|
|
|
122
128
|
]));
|
|
123
129
|
const payload = await createMagpieSync({ ...source.options, run: async (_binary, args) => {
|
|
124
130
|
if (args[0] === '--version') return 'magpie 0.1.1319';
|
|
125
|
-
if (args[0] === 'accounts') return '[{"agent":"astra"},{"agent":"codex","user":"fixture@example.invalid"}]';
|
|
131
|
+
if (args[0] === 'accounts') return '2026/10/28 plugin [error]: Grok is not signed in\n[{"agent":"astra"},{"agent":"codex","user":"fixture@example.invalid"}]';
|
|
126
132
|
await write(args[1], '{"format":"magpie-backup"}');
|
|
127
133
|
return '';
|
|
128
134
|
} }).download();
|
|
@@ -25,9 +25,13 @@ export const registerConfigSyncRoutes = (app, deps = {}) => {
|
|
|
25
25
|
: code === 'sync_payload_too_large' || code === 'sync_too_many_files' ? 413
|
|
26
26
|
: code === 'sync_invalid_kind' ? 400
|
|
27
27
|
: fallbackStatus;
|
|
28
|
+
// Magpie import failures wrap the actionable native/verification cause; the transfer
|
|
29
|
+
// envelope itself is never reported, so the nested message is safe to forward.
|
|
30
|
+
const cause = error instanceof Error && error.cause instanceof Error ? error.cause.message.trim() : '';
|
|
28
31
|
res.status(status).json({
|
|
29
32
|
error: error instanceof Error ? error.message : String(error),
|
|
30
33
|
...(code ? { code } : {}),
|
|
34
|
+
...(cause && cause !== (error instanceof Error ? error.message : '') ? { detail: cause } : {}),
|
|
31
35
|
...(error?.syncRunId ? { syncRunId: error.syncRunId } : {}),
|
|
32
36
|
});
|
|
33
37
|
};
|
|
@@ -72,6 +72,17 @@ describe('config-sync HTTP routes', () => {
|
|
|
72
72
|
expect(received).toEqual([payload, payload]);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
it('reports the underlying Magpie failure cause without the transfer envelope', async () => {
|
|
76
|
+
const { app } = await createApp(undefined, {
|
|
77
|
+
inventory: async () => ({ available: true, installed: true }),
|
|
78
|
+
download: async () => Buffer.from('fixture'),
|
|
79
|
+
import: async () => { throw new Error('Magpie import failed', { cause: new Error('Magpie authorization store is busy; retry sync') }); },
|
|
80
|
+
});
|
|
81
|
+
const failed = await request(app).put('/api/yuri/config-sync/magpie')
|
|
82
|
+
.set('Content-Type', 'application/octet-stream').send(Buffer.from('fixture')).expect(500);
|
|
83
|
+
expect(failed.body).toEqual({ error: 'Magpie import failed', detail: 'Magpie authorization store is busy; retry sync' });
|
|
84
|
+
});
|
|
85
|
+
|
|
75
86
|
it('transfers credential bytes through HTTP without putting values in inventory or filesystem backups', async () => {
|
|
76
87
|
const payload = Buffer.from(JSON.stringify({ format: 'opencode-credentials-v1', entries: [{ fixture: 'private-value' }] }));
|
|
77
88
|
const received = [];
|