@rainbow-robotics/preview-host 1.10.3-dev.0 → 1.10.3-dev.3
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/{AmrCapabilityControl.DA5qEK-i.js → AmrCapabilityControl.Z_d-VC9Z.js} +1 -1
- package/dist/assets/{__federation_expose_App.SnDQaVWF.js → __federation_expose_App.D0j69uwn.js} +271 -271
- package/dist/assets/__federation_fn_import.DdkEuT6t.js +2 -2
- package/dist/assets/{cssMode.BMih__rD.js → cssMode.DyXwpLTd.js} +1 -1
- package/dist/assets/{freemarker2.DC5Bsvwq.js → freemarker2.BhkpxVMp.js} +1 -1
- package/dist/assets/{handlebars.BJ5gVGRl.js → handlebars.DpLjf4R6.js} +1 -1
- package/dist/assets/{html.CmYW8yYx.js → html.CTuwuJr1.js} +1 -1
- package/dist/assets/{htmlMode.DhN5zWqE.js → htmlMode.cn2FXSIx.js} +1 -1
- package/dist/assets/{index.DIDgv_ph.js → index.CRvVA2hR.js} +1 -1
- package/dist/assets/{index.Bah31zT_.js → index.CmeyqH8F.js} +1 -1
- package/dist/assets/{index.BeiJ-a8H.js → index.ty6jAGhf.js} +6 -6
- package/dist/assets/{javascript.DA0cW-3s.js → javascript.CsWjKsGL.js} +1 -1
- package/dist/assets/{jsonMode.ErYDHAjl.js → jsonMode.CQrFRi6o.js} +1 -1
- package/dist/assets/{liquid.DqFw7tdw.js → liquid.DZnAO6og.js} +1 -1
- package/dist/assets/{lspLanguageFeatures.kDn-df_L.js → lspLanguageFeatures.Cq8PtdUr.js} +1 -1
- package/dist/assets/{mdx.DSDHlE6d.js → mdx.KHhHEEYv.js} +1 -1
- package/dist/assets/{python.Bzg3UZzP.js → python.6BUyXnKa.js} +1 -1
- package/dist/assets/{razor.ntIcJd8C.js → razor.BUOpL_5r.js} +1 -1
- package/dist/assets/remoteEntry.js +1 -1
- package/dist/assets/{tsMode.BI2mVLGJ.js → tsMode.7xXRG068.js} +1 -1
- package/dist/assets/{typescript.DMn_nMRU.js → typescript.DW3_MzQg.js} +1 -1
- package/dist/assets/{useFileDownload.Bb9T7iGO.js → useFileDownload.CKlsLIzE.js} +198 -198
- package/dist/assets/{xml.RFyHm9pH.js → xml.B8XdWl20.js} +1 -1
- package/dist/assets/{yaml.NC3LTkDx.js → yaml.dEVey32t.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/plugin-shared/plugin-ui_react.js +1 -1
- package/dist/plugin-shared/plugin-ui_sdk.js +1 -1
- package/package.json +1 -1
- package/serve.mjs +30 -7
- /package/dist/assets/{RbLocalizationProvider.BX3b4qG3.js → RbLocalizationProvider.5ZpOu7R7.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./__federation_expose_App.
|
|
1
|
+
import{l as e}from"./__federation_expose_App.D0j69uwn.js";const n={comments:{blockComment:["<!--","-->"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:e.IndentAction.Indent}}]},o={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};export{n as conf,o as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./__federation_expose_App.
|
|
1
|
+
import{l as e}from"./__federation_expose_App.D0j69uwn.js";const t={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},o={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{t as conf,o as language};
|
package/dist/index.html
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Rainbow Robotics System</title>
|
|
8
8
|
<script type="importmap">{"imports":{"react":"/plugin-shared/react.js","react/jsx-runtime":"/plugin-shared/react_jsx-runtime.js","react/jsx-dev-runtime":"/plugin-shared/react_jsx-dev-runtime.js","react-dom":"/plugin-shared/react-dom.js","react-dom/client":"/plugin-shared/react-dom_client.js","@rainbow-robotics/plugin-ui/react":"/plugin-shared/plugin-ui_react.js","@rainbow-robotics/plugin-ui/sdk":"/plugin-shared/plugin-ui_sdk.js","@rainbow-robotics/plugin-ui/host-ui":"/plugin-shared/plugin-ui_host-ui.js","@rainbow-robotics/plugin-ui/ws":"/plugin-shared/plugin-ui_ws.js"}}</script>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index.
|
|
9
|
+
<script type="module" crossorigin src="/assets/index.CRvVA2hR.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/__federation_fn_import.DdkEuT6t.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/index.P6snMalu.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime.CBqCNPYB.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/emotion-styled-base.browser.esm.BIcjgOzg.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/RbLocalizationProvider.
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/RbLocalizationProvider.5ZpOu7R7.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/index.B3zY1kf7.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/useFileDownload.
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/index.
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/__federation_expose_App.
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/useFileDownload.CKlsLIzE.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/index.CmeyqH8F.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/__federation_expose_App.D0j69uwn.js">
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const m = (globalThis.__RB_SHARED__||{})["@rainbow-robotics/plugin-ui/react"];
|
|
2
2
|
if (!m) throw new Error("[plugin-ui] host shared module not registered: @rainbow-robotics/plugin-ui/react");
|
|
3
|
-
export const { HStack, VStack, GreenCheckCircleIcon, AmberWarningCircleIcon, RBLabelButton, RBIconButton, RBCheckLabelButton, RBCheckIconButton, RBInlineLabelButton, RBAccordion, RBAccordionGroup, RBDivider, RBBattery, RBTextInput, RBTextArea, RBDateInput, RBRangeDateInput, RBAlert, RBConfirm, RBPrompt, RBDim, RBModal, RBSelectBox, RBSelectOption, Option, RBSelectDropBox, RBNoData, RBPagination, RBSideNumberInput, RBRadioBox, RBRadioButton, RBCheckBox, RBTab, RBTabItem, RBChipTab, RBChipItem, RBChipsBoxTab, RBChipsBoxItem, RBTable, RBTableRow, RBTdColumn, RBTdExpend, RBBadge, RBEmptyView, RBTextLabel, RBTextHelperText, RBTextField, RBMultiRangeInput, RBJoyStick, RBTooltip, RBSwitchField, RBCard, RBCardHeader, RBCardHeaderText, RBCardTitle, RBCardDescription, RBCardContent, RBCardFooter, RBCardAction, RBCardPreviewSlot, RBCommand, RBCommandDialog, RBCommandInput, RBCommandList, RBCommandEmpty, RBCommandGroup, RBCommandItem, RBCommandSelected, RBCommandSeparator, RBCommandShortcut, RBDialog, RBDialogTrigger, RBDialogClose, RBDialogPortal, RBDialogOverlay, RBDialogContent, RBDialogHeader, RBDialogFooter, RBDialogTitle, RBDialogDescription, RBDrawer, RBDrawerTrigger, RBDrawerClose, RBDrawerPortal, RBDrawerOverlay, RBDrawerContent, RBDrawerHeader, RBDrawerBody, RBDrawerFooter, RBDrawerTitle, RBDrawerDescription, RBSheet, RBSheetTrigger, RBSheetClose, RBSheetPortal, RBSheetOverlay, RBSheetContent, RBSheetHeader, RBSheetFooter, RBSheetTitle, RBSheetDescription, RBPopover, RBPopoverTrigger, RBPopoverContent, RBPopoverAnchor, RBPopoverPlacements, RBDropdownMenu, RBDropdownMenuTrigger, RBDropdownMenuContent, RBDropdownMenuItem, RBDropdownMenuCheckboxItem, RBDropdownMenuRadioItem, RBDropdownMenuLabel, RBDropdownMenuSeparator, RBDropdownMenuShortcut, RBDropdownMenuGroup, RBDropdownMenuPortal, RBDropdownMenuSub, RBDropdownMenuSubContent, RBDropdownMenuSubTrigger, RBDropdownMenuRadioGroup, RBMenubar, RBMenubarMenu, RBMenubarGroup, RBMenubarPortal, RBMenubarTrigger, RBMenubarContent, RBMenubarItem, RBMenubarCheckboxItem, RBMenubarRadioGroup, RBMenubarRadioItem, RBMenubarLabel, RBMenubarSeparator, RBMenubarShortcut, RBMenubarSub, RBMenubarSubTrigger, RBMenubarSubContent, RBSlider, RBSwitch, RBToggle, RBToggleGroup, RBToggleGroupItem, RBTabs, RBTabsList, RBTabsTrigger, RBTabsContent, RBResizable, RBResizablePanelGroup, RBResizablePanel, RBResizableHandle, RBShadCalendar, RBDatePickerPreset, RBDatePickerFooterTime, RBDatePickerFooterButton, RANGE_DATE_PRESETS, getRangePresetDates, labelButtonVariants, iconButtonVariants, checkLabelButtonVariants, checkIconButtonVariants, inlineLabelButtonVariants, dividerVariants, batteryFillVariants, textInputVariants, textAreaVariants, selectTriggerVariants, sideNumberInputVariants, accordionVariants, radioRootVariants, checkBoxRootVariants, tabRootVariants, chipRootVariants, badgeRootVariants, emptyViewRootVariants, cardRootVariants, RBIcons, RBLight, RBSpinner, RBSimpleToast, RBQrBarCodeGuideModal, lightColors, lightSizes, useRb, useRbFormData, useRbSave } = m;
|
|
3
|
+
export const { HStack, VStack, GreenCheckCircleIcon, AmberWarningCircleIcon, RBLabelButton, RBIconButton, RBCheckLabelButton, RBCheckIconButton, RBInlineLabelButton, RBAccordion, RBAccordionGroup, RBDivider, RBBattery, RBTextInput, RBTextArea, RBDateInput, RBRangeDateInput, RBAlert, RBConfirm, RBPrompt, RBDim, RBModal, RBSelectBox, RBSelectOption, Option, RBSelectDropBox, RBNoData, RBPagination, RBSideNumberInput, RBRadioBox, RBRadioButton, RBCheckBox, RBTab, RBTabItem, RBChipTab, RBChipItem, RBChipsBoxTab, RBChipsBoxItem, RBTable, RBTableRow, RBTdColumn, RBTdExpend, RBBadge, RBEmptyView, RBTextLabel, RBTextHelperText, RBTextField, RBMultiRangeInput, RBJoyStick, RBTooltip, RBSwitchField, RBCard, RBCardHeader, RBCardHeaderText, RBCardTitle, RBCardDescription, RBCardContent, RBCardFooter, RBCardAction, RBCardPreviewSlot, RBCommand, RBCommandDialog, RBCommandInput, RBCommandList, RBCommandEmpty, RBCommandGroup, RBCommandItem, RBCommandSelected, RBCommandSeparator, RBCommandShortcut, RBDialog, RBDialogTrigger, RBDialogClose, RBDialogPortal, RBDialogOverlay, RBDialogContent, RBDialogHeader, RBDialogFooter, RBDialogTitle, RBDialogDescription, RBDrawer, RBDrawerTrigger, RBDrawerClose, RBDrawerPortal, RBDrawerOverlay, RBDrawerContent, RBDrawerHeader, RBDrawerBody, RBDrawerFooter, RBDrawerTitle, RBDrawerDescription, RBSheet, RBSheetTrigger, RBSheetClose, RBSheetPortal, RBSheetOverlay, RBSheetContent, RBSheetHeader, RBSheetFooter, RBSheetTitle, RBSheetDescription, RBPopover, RBPopoverTrigger, RBPopoverContent, RBPopoverAnchor, RBPopoverPlacements, RBDropdownMenu, RBDropdownMenuTrigger, RBDropdownMenuContent, RBDropdownMenuItem, RBDropdownMenuCheckboxItem, RBDropdownMenuRadioItem, RBDropdownMenuLabel, RBDropdownMenuSeparator, RBDropdownMenuShortcut, RBDropdownMenuGroup, RBDropdownMenuPortal, RBDropdownMenuSub, RBDropdownMenuSubContent, RBDropdownMenuSubTrigger, RBDropdownMenuRadioGroup, RBMenubar, RBMenubarMenu, RBMenubarGroup, RBMenubarPortal, RBMenubarTrigger, RBMenubarContent, RBMenubarItem, RBMenubarCheckboxItem, RBMenubarRadioGroup, RBMenubarRadioItem, RBMenubarLabel, RBMenubarSeparator, RBMenubarShortcut, RBMenubarSub, RBMenubarSubTrigger, RBMenubarSubContent, RBSlider, RBSwitch, RBToggle, RBToggleGroup, RBToggleGroupItem, RBTabs, RBTabsList, RBTabsTrigger, RBTabsContent, RBResizable, RBResizablePanelGroup, RBResizablePanel, RBResizableHandle, RBShadCalendar, RBDatePickerPreset, RBDatePickerFooterTime, RBDatePickerFooterButton, RANGE_DATE_PRESETS, getRangePresetDates, labelButtonVariants, iconButtonVariants, checkLabelButtonVariants, checkIconButtonVariants, inlineLabelButtonVariants, dividerVariants, batteryFillVariants, textInputVariants, textAreaVariants, selectTriggerVariants, sideNumberInputVariants, accordionVariants, radioRootVariants, checkBoxRootVariants, tabRootVariants, chipRootVariants, badgeRootVariants, emptyViewRootVariants, cardRootVariants, RBIcons, RBLight, RBSpinner, RBSimpleToast, RBQrBarCodeGuideModal, lightColors, lightSizes, useRb, useRbFormData, useRbSave, useRbStorage, createRbStore } = m;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const m = (globalThis.__RB_SHARED__||{})["@rainbow-robotics/plugin-ui/sdk"];
|
|
2
2
|
if (!m) throw new Error("[plugin-ui] host shared module not registered: @rainbow-robotics/plugin-ui/sdk");
|
|
3
|
-
export const { RbContext, useRb, useRbFormData, useRbSave } = m;
|
|
3
|
+
export const { RbContext, useRb, useRbFormData, useRbSave, useRbStorage, createRbStore } = m;
|
package/package.json
CHANGED
package/serve.mjs
CHANGED
|
@@ -128,10 +128,34 @@ function tryServe(res, baseDir, relPath, opts) {
|
|
|
128
128
|
// kit's S3 copy on first use and kept in ~/.muscat-pk/models, so the 3D robot view works with any
|
|
129
129
|
// robot or a local core SW, and offline once a model has been seen.
|
|
130
130
|
// ponytail: cached by path only; a changed model needs ~/.muscat-pk/models cleared.
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
// Tried in order: the kit's S3 copy, then the assets server (:5177) of the robot / local Muscat,
|
|
132
|
+
// which has the models that Muscat ships — so a model missing from S3 (or no internet) still shows.
|
|
133
|
+
const MODEL_SOURCES = [
|
|
134
|
+
...new Set([
|
|
135
|
+
process.env.MUSCAT_PK_MODELS_URL || "https://rainbow-deploy.s3.ap-northeast-2.amazonaws.com/muscat-plugin-kit/models",
|
|
136
|
+
...(robotHost ? [`http://${robotHost}:5177/models`] : []),
|
|
137
|
+
"http://localhost:5177/models",
|
|
138
|
+
]),
|
|
139
|
+
];
|
|
133
140
|
const MODELS_CACHE = resolve(homedir(), ".muscat-pk", "models");
|
|
134
141
|
|
|
142
|
+
const unreachable = new Set(); // a source that didn't answer is skipped from then on
|
|
143
|
+
|
|
144
|
+
async function fetchModel(rel) {
|
|
145
|
+
const path = rel.split("/").map(encodeURIComponent).join("/");
|
|
146
|
+
for (const base of MODEL_SOURCES) {
|
|
147
|
+
if (unreachable.has(base)) continue;
|
|
148
|
+
try {
|
|
149
|
+
const r = await fetch(`${base}/${path}`, { signal: AbortSignal.timeout(15_000) });
|
|
150
|
+
// S3 answers 403 for a missing key; a web server may answer 200 with an HTML fallback page.
|
|
151
|
+
if (r.ok && !(r.headers.get("content-type") ?? "").startsWith("text/html")) return Buffer.from(await r.arrayBuffer());
|
|
152
|
+
} catch {
|
|
153
|
+
unreachable.add(base);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
|
|
135
159
|
async function serveModel(res, url) {
|
|
136
160
|
const rel = decodeURIComponent(url.slice("/models/".length));
|
|
137
161
|
const file = resolve(MODELS_CACHE, rel);
|
|
@@ -141,16 +165,15 @@ async function serveModel(res, url) {
|
|
|
141
165
|
return;
|
|
142
166
|
}
|
|
143
167
|
if (!existsSync(file)) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
res.statusCode = r.ok || r.status === 403 ? 404 : r.status;
|
|
168
|
+
const data = await fetchModel(rel);
|
|
169
|
+
if (!data) {
|
|
170
|
+
res.statusCode = 404;
|
|
148
171
|
res.end(`model file not found: ${rel}`);
|
|
149
172
|
return;
|
|
150
173
|
}
|
|
151
174
|
mkdirSync(dirname(file), { recursive: true });
|
|
152
175
|
const part = `${file}.${process.pid}.part`;
|
|
153
|
-
writeFileSync(part,
|
|
176
|
+
writeFileSync(part, data);
|
|
154
177
|
renameSync(part, file);
|
|
155
178
|
}
|
|
156
179
|
sendFile(res, file);
|
/package/dist/assets/{RbLocalizationProvider.BX3b4qG3.js → RbLocalizationProvider.5ZpOu7R7.js}
RENAMED
|
File without changes
|