feat(hachidori): send character dictionaries over the link to Hachidori hosts

Hachidori 0.2.3 accepts dictionary ZIPs as chunked upload requests: an
unlinked install imports them itself and a linked one forwards them to its
host. The parser bridge now imports through that path with replace, retrying
a busy commit with the same upload. Linked hosts without linked-import-v1
(hachidori-docker, older Hachidori) keep the management API upload.
This commit is contained in:
sudacode committed 2026-10-05 09:10:33 -07:00
1 parent e25d472d82
commit e1c4d6ca94
11 files changed
+195 -25

No files matched your search

@@ -7,6 +7,7 @@ import {
} from './hachidori-dictionary-import';
import {
buildHachidoriSharingScript,
HACHIDORI_LINKED_IMPORT_CAPABILITY,
parseHachidoriHostStatus,
type HachidoriSharingRequest,
} from '../../../shared/hachidori-sharing';
@@ -1817,7 +1818,12 @@ export async function importYomitanDictionaryFromZip(
const host = await requestHachidoriSharing({ type: 'hd_sharing_status' }, deps, logger);
if (host.kind === 'disconnected' || host.kind === 'unavailable')
throw new Error(host.message);
if (host.kind === 'connected') {
// Hosts with linked imports take the ZIP over the link like a local import,
// below. Older hosts and hachidori-docker need their management API.
if (
host.kind === 'connected' &&
!host.capabilities.includes(HACHIDORI_LINKED_IMPORT_CAPABILITY)
) {
const origin = resolveHachidoriManagementUrl(
host,
hachidoriManagementUrl,