@camstack/addon-admin-ui 1.2.441 → 1.2.442
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/{AddonAssetIcon-CCzVCA49.js → AddonAssetIcon-BccuV0q0.js} +1 -1
- package/dist/assets/Addons-kSQ_LfKG.js +4 -0
- package/dist/assets/{AdminPage--m3xHpjx.js → AdminPage-C_5SnDIL.js} +1 -1
- package/dist/assets/{AdminSectionedPage-D5J86Kfp.js → AdminSectionedPage-9KWXxykK.js} +1 -1
- package/dist/assets/AiProfiles-jgiZ-hEI.js +3 -0
- package/dist/assets/{BrokerForm-Cd5z8Mk0.js → BrokerForm-DzQNeSxm.js} +1 -1
- package/dist/assets/{Build-RW9SjiCM.js → Build-DCeob-yZ.js} +5 -5
- package/dist/assets/{Calendars-CVnE0N6y.js → Calendars-Cla89sbi.js} +1 -1
- package/dist/assets/Cluster-eTZjguTx.js +1 -0
- package/dist/assets/{ClusterStepModel-BbVbEWqh.js → ClusterStepModel-8aoPvS-k.js} +1 -1
- package/dist/assets/CompositionEditor-CJR7m-qo.js +1 -0
- package/dist/assets/{CompositionEditorPage-D3LiFLq4.js → CompositionEditorPage-BgQSiVo8.js} +1 -1
- package/dist/assets/Data-xUdBOATt.js +2 -0
- package/dist/assets/{DeviceDetail-Ry7b522t.js → DeviceDetail-BxgqCzrO.js} +2 -2
- package/dist/assets/{DeviceDoActionFields-n2-NdVST.js → DeviceDoActionFields-BjVWVHu7.js} +1 -1
- package/dist/assets/{Devices-BacO9x6N.js → Devices-D9zuTHOW.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-DgFNOUrt.js → EmbedPlayerPage-MXUvBkWX.js} +1 -1
- package/dist/assets/Identity-0TfWSUca.js +1 -0
- package/dist/assets/IntegrationDetail-e-6OvQx9.js +1 -0
- package/dist/assets/IntegrationHub-CA9MM1oL.js +1 -0
- package/dist/assets/Integrations-BbsiTLtO.js +1 -0
- package/dist/assets/Integrations-BdrRZHfb.js +1 -0
- package/dist/assets/{Library-yKp-qGfV.js → Library-B9_Scpen.js} +1 -1
- package/dist/assets/Locations-DdCSAAsc.js +3 -0
- package/dist/assets/{Logs-DWz6dVJo.js → Logs-CVR97TYT.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-wkrQJhyN.js → MaskShapeCanvas-DEZFJVo5.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BZneggiu.js → MotionZonesSettings-Bwo-3iRG.js} +1 -1
- package/dist/assets/MyAccess-oZ9l9GBy.js +2 -0
- package/dist/assets/Network-CNhaeFmn.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-BxeQZ-hu.js → NodeAddonsSettingsPanel-CRyxRlRb.js} +1 -1
- package/dist/assets/{Notifications-B0nD4977.js → Notifications-2cTCf7lp.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-CN2hF3qR.js → PrivacyMaskSettings-cDl1Qu_T.js} +1 -1
- package/dist/assets/Recordings-DycF_b6H.js +1 -0
- package/dist/assets/{ScanNetworkModal-CfHHLP_k.js → ScanNetworkModal-C5RUKriq.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-CU-Yj4Sw.js → SceneMonitorEditor-BmaWm_DT.js} +1 -1
- package/dist/assets/SessionsList-Cu3ZE31w.js +2 -0
- package/dist/assets/{Showroom-ChGRG_dB.js → Showroom-ndc_ZezE.js} +1 -1
- package/dist/assets/{System-GfppoElu.js → System-C_RpKyaA.js} +1 -1
- package/dist/assets/{Terminal-C7azorOj.js → Terminal-BdKedDZS.js} +3 -3
- package/dist/assets/{Viewer-DWdf6_8H.js → Viewer-LdYt8Q3H.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CGI8Rmb1.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DId7Mdzp.js} +1 -1
- package/dist/assets/{addon-icons-context-D3LZwxs2.js → addon-icons-context-BNhm5nij.js} +1 -1
- package/dist/assets/{archive-BOODG6Jz.js → archive-Dj3rQasM.js} +1 -1
- package/dist/assets/{authed-media-F_SweyTm.js → authed-media-CRKmATDJ.js} +1 -1
- package/dist/assets/{bell-off-acWBqVHX.js → bell-off-BxB4ohQe.js} +1 -1
- package/dist/assets/{board-model-Bdetmchn.js → board-model-Bx9i2Ikh.js} +1 -1
- package/dist/assets/{boxes-U2BARjlG.js → boxes-Cyb74Sc2.js} +1 -1
- package/dist/assets/circle-slash-CJ8sDXES.js +1 -0
- package/dist/assets/client-CqoBi3ym.js +358 -0
- package/dist/assets/{cloud-upload-C12rtBFh.js → cloud-upload-STkEa8On.js} +1 -1
- package/dist/assets/crop-Cvf_bPJF.js +1 -0
- package/dist/assets/{device-integration-icon-BeeizbXV.js → device-integration-icon-NmvFHcoT.js} +1 -1
- package/dist/assets/device-picker-model-2g0u_pQE.js +1 -0
- package/dist/assets/{dist-CQud2KJs.js → dist-CboU_aT5.js} +1 -1
- package/dist/assets/dist-yylqec5a.js +358 -0
- package/dist/assets/{eraser-BmJjK2wc.js → eraser-MfKJ-xHy.js} +1 -1
- package/dist/assets/{hard-drive-download-DfnBSa39.js → hard-drive-download-DNMTqY2h.js} +1 -1
- package/dist/assets/{history-CNfarVY1.js → history-ohLSkO2A.js} +1 -1
- package/dist/assets/{hostInit-Df4MAORd.js → hostInit-LP6ARUYA.js} +1 -1
- package/dist/assets/i18n-Bldp2nug.js +1 -0
- package/dist/assets/{icons-BLn-D-gO.js → icons-Bft8hsua.js} +1 -1
- package/dist/assets/{index-CcAR8Rlk.js → index-WxoBkjSL.js} +3 -3
- package/dist/assets/{key-BF4fZLz_.js → key-LDVs0Hda.js} +1 -1
- package/dist/assets/{key-round-CjE9GF4T.js → key-round-ufq1OhZE.js} +1 -1
- package/dist/assets/{layers-b-H6nVdd.js → layers-DMR3HPTk.js} +1 -1
- package/dist/assets/{linked-devices-model-BMUapBfD.js → linked-devices-model-BhIH5Kho.js} +1 -1
- package/dist/assets/{list-ordered-CxtL1h3H.js → list-ordered-iFgP3FdK.js} +1 -1
- package/dist/assets/{location-owned-usage-DVh3ypCw.js → location-owned-usage-ChRB3Z7a.js} +1 -1
- package/dist/assets/{log-in-D4y0eEu8.js → log-in-4wTdM9C2.js} +1 -1
- package/dist/assets/{memory-stick-jw7STOQc.js → memory-stick-BVZbZTDE.js} +1 -1
- package/dist/assets/{message-square-plus-EaPlmlsM.js → message-square-plus-DTEXt10L.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-8a2679ae.js → mf-entry-bootstrap-0-6f3bb22b.js} +2 -2
- package/dist/assets/{mic-off-DiEVWn3e.js → mic-off-BOvuLxyG.js} +1 -1
- package/dist/assets/{monitor-off-bCAhCbCp.js → monitor-off-BJJUHiNu.js} +1 -1
- package/dist/assets/{monitor-smartphone-ASdELIYw.js → monitor-smartphone-BaRjkvN9.js} +1 -1
- package/dist/assets/mount-2g0u_pQE.js +1 -0
- package/dist/assets/{notification-schedule-field-BKROBLSv.js → notification-schedule-field-BHhbg0a-.js} +1 -1
- package/dist/assets/{player-overlays-Fx6RE6kI.js → player-overlays-CpALjVtS.js} +1 -1
- package/dist/assets/{recycle-twm2_92b.js → recycle-CjrRLz-b.js} +1 -1
- package/dist/assets/remoteEntry-CgICLtvC.js +1 -0
- package/dist/assets/{scan-eye-DuyDP-FQ.js → scan-eye-D35EojCj.js} +1 -1
- package/dist/assets/{scissors-BJ2tjgEs.js → scissors-DreuVKed.js} +1 -1
- package/dist/assets/{search-x-C9z-zNBZ.js → search-x-DQHP4OCR.js} +1 -1
- package/dist/assets/{send-C_-A97md.js → send-Dta9lxhX.js} +1 -1
- package/dist/assets/{settings-2-A0nya3CH.js → settings-2-DPZ8CKFD.js} +1 -1
- package/dist/assets/{speaker-C8juqhRE.js → speaker-D95jrOt6.js} +1 -1
- package/dist/assets/src-CsHgYIi2.js +67 -0
- package/dist/assets/{timer-reset-DHBRudwU.js → timer-reset-EEmenpu7.js} +1 -1
- package/dist/assets/{ungroup-BLEMoVnk.js → ungroup-Db4urNO1.js} +1 -1
- package/dist/assets/{unlink-YiKNaJO_.js → unlink-6J-SREPz.js} +1 -1
- package/dist/assets/{usb-DzR5JdOt.js → usb-UiuX4lHP.js} +1 -1
- package/dist/assets/{use-scenes-feed-wz6RYR34.js → use-scenes-feed-xAvk3mdK.js} +1 -1
- package/dist/assets/{use-stationary-objects-ByxBafUy.js → use-stationary-objects-BSuACN9l.js} +1 -1
- package/dist/assets/useEventInvalidation-2g0u_pQE.js +1 -0
- package/dist/assets/{useNodeUrlSelection-v_RZ_Gxk.js → useNodeUrlSelection-itsA69-a.js} +1 -1
- package/dist/assets/user-round-t1eXjuPz.js +1 -0
- package/dist/assets/{user-x-CY41cwk1.js → user-x-BiLr1XcR.js} +1 -1
- package/dist/assets/{video-BRgeujOO.js → video-DSVienqW.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BrkS3kK7.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BzdoZPn9.js} +2 -2
- package/dist/index.html +10 -10
- package/dist/server/addon.js +166 -103
- package/package.json +1 -1
- package/dist/assets/Addons-CUPFTOFz.js +0 -4
- package/dist/assets/AiProfiles-CEZqx-Sw.js +0 -3
- package/dist/assets/Cluster-DdgLAQcF.js +0 -1
- package/dist/assets/CompositionEditor-BDEQF7e9.js +0 -1
- package/dist/assets/Data-TI1fXQ8e.js +0 -2
- package/dist/assets/Identity-BPWd0o-B.js +0 -1
- package/dist/assets/IntegrationDetail-CFsboI2-.js +0 -1
- package/dist/assets/IntegrationHub-BRMnV56J.js +0 -1
- package/dist/assets/Integrations-Bf2SzcCT.js +0 -1
- package/dist/assets/Integrations-CBqnh8t8.js +0 -1
- package/dist/assets/Locations-BCY7diBp.js +0 -3
- package/dist/assets/MyAccess-DmuNu2nC.js +0 -2
- package/dist/assets/Network-CMlIm20D.js +0 -1
- package/dist/assets/Recordings-CkHyBhqh.js +0 -1
- package/dist/assets/SessionsList-DrSkZMrj.js +0 -2
- package/dist/assets/circle-slash-90QkMLx4.js +0 -1
- package/dist/assets/client-yfOXPkcm.js +0 -358
- package/dist/assets/crop-BjSJZpbg.js +0 -1
- package/dist/assets/device-picker-model-CRpYde_B.js +0 -1
- package/dist/assets/dist-BfR6seq4.js +0 -358
- package/dist/assets/i18n-B1bxeya5.js +0 -1
- package/dist/assets/mount-CRpYde_B.js +0 -1
- package/dist/assets/remoteEntry-D-hdlf-C.js +0 -1
- package/dist/assets/src-AhVPNkCn.js +0 -67
- package/dist/assets/useEventInvalidation-CRpYde_B.js +0 -1
- package/dist/assets/user-round-CjXCVqIf.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -5415,7 +5415,7 @@ var ZodIssueCode = {
|
|
|
5415
5415
|
var ZodFirstPartyTypeKind;
|
|
5416
5416
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5417
5417
|
//#endregion
|
|
5418
|
-
//#region ../types/dist/sleep-
|
|
5418
|
+
//#region ../types/dist/sleep-yKL5gfrH.mjs
|
|
5419
5419
|
/**
|
|
5420
5420
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5421
5421
|
* window to float samples (D455).
|
|
@@ -7798,9 +7798,9 @@ function normalizeAddonInitResult(result) {
|
|
|
7798
7798
|
return result;
|
|
7799
7799
|
}
|
|
7800
7800
|
/**
|
|
7801
|
-
* The share-view scope kinds a
|
|
7802
|
-
* and validates them (`
|
|
7803
|
-
* list); a data plane names the kinds it ACCEPTS in `share`.
|
|
7801
|
+
* The share-view scope kinds a share-link token can carry. The hub mints
|
|
7802
|
+
* and validates them (`ShareViewGrantSchema` builds its
|
|
7803
|
+
* enum from this list); a data plane names the kinds it ACCEPTS in `share`.
|
|
7804
7804
|
*/
|
|
7805
7805
|
var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
|
|
7806
7806
|
/** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
|
|
@@ -12427,7 +12427,7 @@ var ConvertResultSchema = object({
|
|
|
12427
12427
|
* `super_admin` — collapsed onto the single boolean because every
|
|
12428
12428
|
* non-admin caller is governed by the same scope-check rules; the
|
|
12429
12429
|
* distinction was only ever used to route role-specific procedures
|
|
12430
|
-
* which we no longer have. CLI / webhook integrations are `
|
|
12430
|
+
* which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
|
|
12431
12431
|
* with `isAdmin: false` + an explicit scope list.
|
|
12432
12432
|
*/
|
|
12433
12433
|
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
@@ -12616,10 +12616,12 @@ var AddonRoutesScopeSchema = object({
|
|
|
12616
12616
|
type: literal("addon-routes"),
|
|
12617
12617
|
access: array(MethodAccessSchema).min(1)
|
|
12618
12618
|
});
|
|
12619
|
+
var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
|
|
12619
12620
|
var CredentialScopeSchema = union([
|
|
12620
12621
|
literal("*"),
|
|
12621
12622
|
ShareViewScopeSchema,
|
|
12622
12623
|
AddonRoutesScopeSchema,
|
|
12624
|
+
PreferencesSelfScopeSchema,
|
|
12623
12625
|
TokenScopeSchema
|
|
12624
12626
|
]);
|
|
12625
12627
|
object({
|
|
@@ -12628,6 +12630,55 @@ object({
|
|
|
12628
12630
|
jti: string().min(16),
|
|
12629
12631
|
scopes: array(CredentialScopeSchema).min(1)
|
|
12630
12632
|
});
|
|
12633
|
+
var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
|
|
12634
|
+
/** A namespace's value: a JSON object, opaque to the hub. */
|
|
12635
|
+
var PreferenceValueSchema = record(string(), unknown());
|
|
12636
|
+
var PreferenceDeviceIdSchema = string().min(1).max(64);
|
|
12637
|
+
/** A stored row, as the owner reads it. */
|
|
12638
|
+
var PreferenceRowSchema = object({
|
|
12639
|
+
namespace: PreferenceNamespaceSchema,
|
|
12640
|
+
value: PreferenceValueSchema,
|
|
12641
|
+
/** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
|
|
12642
|
+
revision: number().int().positive(),
|
|
12643
|
+
updatedAt: number().int(),
|
|
12644
|
+
/** The client id the last writer sent; `null` when it sent none. */
|
|
12645
|
+
updatedByDevice: PreferenceDeviceIdSchema.nullable()
|
|
12646
|
+
});
|
|
12647
|
+
object({
|
|
12648
|
+
/** Absent: every namespace the caller holds. */
|
|
12649
|
+
namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
|
|
12650
|
+
object({ rows: array(PreferenceRowSchema) });
|
|
12651
|
+
object({
|
|
12652
|
+
namespace: PreferenceNamespaceSchema,
|
|
12653
|
+
value: PreferenceValueSchema,
|
|
12654
|
+
/**
|
|
12655
|
+
* The revision the edit was based on. Absent: last write wins. `0`: the
|
|
12656
|
+
* namespace must not exist yet. Any other value that is not the current
|
|
12657
|
+
* revision answers `conflict` and writes nothing.
|
|
12658
|
+
*/
|
|
12659
|
+
baseRevision: number().int().nonnegative().optional(),
|
|
12660
|
+
deviceId: PreferenceDeviceIdSchema.optional()
|
|
12661
|
+
});
|
|
12662
|
+
discriminatedUnion("status", [object({
|
|
12663
|
+
status: literal("saved"),
|
|
12664
|
+
row: PreferenceRowSchema
|
|
12665
|
+
}), object({
|
|
12666
|
+
status: literal("conflict"),
|
|
12667
|
+
current: PreferenceRowSchema.nullable()
|
|
12668
|
+
})]);
|
|
12669
|
+
object({ namespace: PreferenceNamespaceSchema });
|
|
12670
|
+
object({
|
|
12671
|
+
/** `false` when the namespace did not exist. */
|
|
12672
|
+
deleted: boolean() });
|
|
12673
|
+
object({
|
|
12674
|
+
/** The revision the client holds per namespace; a namespace it does not list is new to it. */
|
|
12675
|
+
revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
|
|
12676
|
+
object({
|
|
12677
|
+
/** Every row whose revision differs from the client's, and every row it did not list. */
|
|
12678
|
+
rows: array(PreferenceRowSchema),
|
|
12679
|
+
/** Namespaces the client listed that no longer exist. */
|
|
12680
|
+
deleted: array(PreferenceNamespaceSchema)
|
|
12681
|
+
});
|
|
12631
12682
|
_enum(["new-session", "step-up"]);
|
|
12632
12683
|
/** The languages the hub's app landing pages are written in (D858). */
|
|
12633
12684
|
var AppPageLangSchema = _enum(["en", "it"]);
|
|
@@ -39506,38 +39557,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
|
|
|
39506
39557
|
auth: "admin",
|
|
39507
39558
|
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
39508
39559
|
});
|
|
39560
|
+
var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
|
|
39561
|
+
/** What a model (or, by default, every model of a kind) can do. */
|
|
39562
|
+
var LlmModelFeaturesSchema = object({
|
|
39563
|
+
vision: boolean(),
|
|
39564
|
+
tools: boolean(),
|
|
39565
|
+
streaming: boolean()
|
|
39566
|
+
});
|
|
39567
|
+
/** One model a provider offers. `features` overrides the kind's defaults, per field. */
|
|
39568
|
+
var LlmModelInfoSchema = object({
|
|
39569
|
+
id: string(),
|
|
39570
|
+
label: string().optional(),
|
|
39571
|
+
contextLength: number().int().positive().optional(),
|
|
39572
|
+
features: LlmModelFeaturesSchema.partial().optional()
|
|
39573
|
+
});
|
|
39509
39574
|
/**
|
|
39510
|
-
*
|
|
39511
|
-
*
|
|
39512
|
-
*
|
|
39513
|
-
*
|
|
39514
|
-
* (hub-placed); the cap stays open for future providers.
|
|
39515
|
-
*
|
|
39516
|
-
* Profiles are ROWS (data), not addons: one row = one usable model endpoint.
|
|
39517
|
-
* `apiKey` is a password field — providers REDACT it on read and merge on
|
|
39518
|
-
* write; a stored key NEVER round-trips to a client.
|
|
39575
|
+
* The provider-specific part of a profile, validated by the provider that owns
|
|
39576
|
+
* the kind (`upsertProfile` refuses what it does not accept). A field its
|
|
39577
|
+
* `connectionSchema` declares `type: 'password'` is a secret: it is held in the
|
|
39578
|
+
* keychain, never in the row, and reads back as the redaction marker.
|
|
39519
39579
|
*/
|
|
39520
|
-
var
|
|
39521
|
-
"openai-compatible",
|
|
39522
|
-
"openai",
|
|
39523
|
-
"anthropic",
|
|
39524
|
-
"google",
|
|
39525
|
-
"managed-local",
|
|
39526
|
-
"apple-foundation"
|
|
39527
|
-
]);
|
|
39580
|
+
var LlmProviderConfigSchema = record(string(), unknown());
|
|
39528
39581
|
var LlmProfileSchema = object({
|
|
39529
39582
|
id: string(),
|
|
39530
39583
|
name: string(),
|
|
39584
|
+
/** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
|
|
39531
39585
|
kind: LlmProfileKindSchema,
|
|
39532
39586
|
/** Stamped by the provider — keeps the fanned catalog routable. */
|
|
39533
39587
|
addonId: string(),
|
|
39534
39588
|
enabled: boolean(),
|
|
39535
39589
|
/** Vendor model id, or the managed runtime's loaded model. */
|
|
39536
39590
|
model: string(),
|
|
39537
|
-
/** Required for openai-compatible; override for cloud kinds. */
|
|
39538
|
-
baseUrl: string().optional(),
|
|
39539
|
-
/** ConfigUISchema type:'password' — never round-trips (spec §5). */
|
|
39540
|
-
apiKey: string().optional(),
|
|
39541
39591
|
/** Vision on/off. A vision call against a `false` profile is REFUSED, never
|
|
39542
39592
|
* degraded to text — that shipped once and produced a confident answer to a
|
|
39543
39593
|
* question about a picture nobody sent. */
|
|
@@ -39545,15 +39595,11 @@ var LlmProfileSchema = object({
|
|
|
39545
39595
|
temperature: number().min(0).max(2).optional(),
|
|
39546
39596
|
/** Nucleus sampling. Every wire we speak has it. */
|
|
39547
39597
|
topP: number().min(0).max(1).optional(),
|
|
39548
|
-
/** Top-k sampling. Carried only by the wires that have it —
|
|
39549
|
-
*
|
|
39550
|
-
* `top_p` and no `top_k`). The profile editor hides the field wherever it
|
|
39551
|
-
* would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
|
|
39598
|
+
/** Top-k sampling. Carried only by the wires that have it — a kind offers the
|
|
39599
|
+
* field in its editor only when its descriptor lists it in `profileFields`. */
|
|
39552
39600
|
topK: number().int().positive().optional(),
|
|
39553
39601
|
maxTokens: number().int().positive().optional(),
|
|
39554
|
-
/** Prompt context window. Advisory for cloud kinds (they enforce their own)
|
|
39555
|
-
* for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
|
|
39556
|
-
* the model with, so it is the one field that changes a PROCESS. */
|
|
39602
|
+
/** Prompt context window. Advisory for cloud kinds (they enforce their own). */
|
|
39557
39603
|
contextLength: number().int().positive().optional(),
|
|
39558
39604
|
/** Default system prompt. A caller's `system` REPLACES it (never appends —
|
|
39559
39605
|
* two system prompts fighting is worse than either alone). */
|
|
@@ -39579,16 +39625,37 @@ var LlmProfileSchema = object({
|
|
|
39579
39625
|
* library; the REGISTRY of callable tools is ours and is empty in v1, so a
|
|
39580
39626
|
* `true` here buys the wiring, not behaviour, until tools are registered. */
|
|
39581
39627
|
toolsEnabled: boolean().default(false),
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
|
|
39585
|
-
|
|
39586
|
-
|
|
39587
|
-
|
|
39588
|
-
|
|
39589
|
-
|
|
39590
|
-
|
|
39591
|
-
|
|
39628
|
+
/** Everything the kind's provider owns (endpoint, key, node, runtime…). */
|
|
39629
|
+
providerConfig: LlmProviderConfigSchema.default({})
|
|
39630
|
+
});
|
|
39631
|
+
/**
|
|
39632
|
+
* The common profile fields a kind's editor offers. The editor owns how each
|
|
39633
|
+
* one is drawn; the provider says which of them mean something on its wire.
|
|
39634
|
+
*/
|
|
39635
|
+
var LlmProfileFieldSchema = _enum([
|
|
39636
|
+
"temperature",
|
|
39637
|
+
"topP",
|
|
39638
|
+
"topK",
|
|
39639
|
+
"maxTokens",
|
|
39640
|
+
"contextLength",
|
|
39641
|
+
"systemPrompt",
|
|
39642
|
+
"timeoutMs",
|
|
39643
|
+
"connectTimeoutMs",
|
|
39644
|
+
"firstTokenTimeoutMs",
|
|
39645
|
+
"idleTimeoutMs",
|
|
39646
|
+
"retry",
|
|
39647
|
+
"toolsEnabled"
|
|
39648
|
+
]);
|
|
39649
|
+
/**
|
|
39650
|
+
* A provider-drawn part of the editor, by a generic widget id the admin UI
|
|
39651
|
+
* registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
|
|
39652
|
+
* picker: that widget owns the model choice.
|
|
39653
|
+
*/
|
|
39654
|
+
var LlmProviderWidgetSchema = object({
|
|
39655
|
+
id: string(),
|
|
39656
|
+
placement: _enum(["connection", "model"]),
|
|
39657
|
+
/** `providerConfig` keys this widget must fill before the profile can be saved. */
|
|
39658
|
+
requires: array(string()).optional()
|
|
39592
39659
|
});
|
|
39593
39660
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
39594
39661
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
@@ -39597,11 +39664,56 @@ var ConfigSchemaPassthrough$3 = unknown();
|
|
|
39597
39664
|
var LlmProfileKindDescriptorSchema = object({
|
|
39598
39665
|
kind: LlmProfileKindSchema,
|
|
39599
39666
|
label: string(),
|
|
39667
|
+
/** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
|
|
39600
39668
|
icon: string(),
|
|
39601
39669
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
39602
39670
|
addonId: string(),
|
|
39603
|
-
|
|
39671
|
+
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
39672
|
+
connectionSchema: ConfigSchemaPassthrough$3,
|
|
39673
|
+
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
39674
|
+
advancedSchema: ConfigSchemaPassthrough$3.optional(),
|
|
39675
|
+
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
39676
|
+
features: LlmModelFeaturesSchema,
|
|
39677
|
+
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
39678
|
+
visionEditable: boolean(),
|
|
39679
|
+
/** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
|
|
39680
|
+
modelCatalog: _enum([
|
|
39681
|
+
"fetch",
|
|
39682
|
+
"static",
|
|
39683
|
+
"none"
|
|
39684
|
+
]),
|
|
39685
|
+
staticModels: array(LlmModelInfoSchema).optional(),
|
|
39686
|
+
/** The common fields that mean something on this kind's wire. */
|
|
39687
|
+
profileFields: array(LlmProfileFieldSchema),
|
|
39688
|
+
providerWidgets: array(LlmProviderWidgetSchema).optional()
|
|
39604
39689
|
});
|
|
39690
|
+
/**
|
|
39691
|
+
* `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
|
|
39692
|
+
* (the editor's form); with `profileId` too, a secret the draft leaves
|
|
39693
|
+
* untouched (absent or the redaction marker) is resolved server-side from the
|
|
39694
|
+
* stored profile — the browser never receives it.
|
|
39695
|
+
*/
|
|
39696
|
+
var LlmListModelsInputSchema = object({
|
|
39697
|
+
addonId: string(),
|
|
39698
|
+
kind: LlmProfileKindSchema,
|
|
39699
|
+
profileId: string().optional(),
|
|
39700
|
+
connection: LlmProviderConfigSchema.optional()
|
|
39701
|
+
});
|
|
39702
|
+
var LlmListModelsErrorCodeSchema = _enum([
|
|
39703
|
+
"auth",
|
|
39704
|
+
"network",
|
|
39705
|
+
"unsupported",
|
|
39706
|
+
"invalid"
|
|
39707
|
+
]);
|
|
39708
|
+
/** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
|
|
39709
|
+
var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
|
|
39710
|
+
ok: literal(true),
|
|
39711
|
+
models: array(LlmModelInfoSchema)
|
|
39712
|
+
}), object({
|
|
39713
|
+
ok: literal(false),
|
|
39714
|
+
code: LlmListModelsErrorCodeSchema,
|
|
39715
|
+
message: string()
|
|
39716
|
+
})]);
|
|
39605
39717
|
var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
|
|
39606
39718
|
var LlmDefaultSchema = object({
|
|
39607
39719
|
selector: LlmDefaultSelectorSchema,
|
|
@@ -39701,7 +39813,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
|
39701
39813
|
kind: "mutation",
|
|
39702
39814
|
auth: "admin",
|
|
39703
39815
|
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
39704
|
-
}), method(
|
|
39816
|
+
}), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
|
|
39817
|
+
kind: "mutation",
|
|
39818
|
+
auth: "admin"
|
|
39819
|
+
}), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
39705
39820
|
selector: LlmDefaultSelectorSchema,
|
|
39706
39821
|
profileId: string().nullable()
|
|
39707
39822
|
}), _void(), {
|
|
@@ -60696,26 +60811,6 @@ var ApiKeySummarySchema = object({
|
|
|
60696
60811
|
createdAt: number(),
|
|
60697
60812
|
lastUsedAt: number().optional()
|
|
60698
60813
|
});
|
|
60699
|
-
var ScopedTokenSummarySchema = object({
|
|
60700
|
-
id: string(),
|
|
60701
|
-
userId: string(),
|
|
60702
|
-
name: string(),
|
|
60703
|
-
tokenPrefix: string(),
|
|
60704
|
-
scopes: array(TokenScopeSchema),
|
|
60705
|
-
expiresAt: number().nullish(),
|
|
60706
|
-
lastUsedAt: number().nullish(),
|
|
60707
|
-
createdAt: number()
|
|
60708
|
-
});
|
|
60709
|
-
var CreateScopedTokenInputSchema = object({
|
|
60710
|
-
userId: string(),
|
|
60711
|
-
name: string(),
|
|
60712
|
-
scopes: array(TokenScopeSchema),
|
|
60713
|
-
expiresAt: number().optional()
|
|
60714
|
-
});
|
|
60715
|
-
var CreateScopedTokenResultSchema = object({
|
|
60716
|
-
token: string(),
|
|
60717
|
-
record: ScopedTokenSummarySchema
|
|
60718
|
-
});
|
|
60719
60814
|
var OauthSessionSummarySchema = object({
|
|
60720
60815
|
id: string(),
|
|
60721
60816
|
userId: string(),
|
|
@@ -60737,11 +60832,11 @@ var TotpStatusSchema = object({
|
|
|
60737
60832
|
confirmedAt: number().nullable()
|
|
60738
60833
|
});
|
|
60739
60834
|
/**
|
|
60740
|
-
* user-management — singleton capability for user accounts
|
|
60741
|
-
*
|
|
60835
|
+
* user-management — singleton capability for user accounts and the
|
|
60836
|
+
* legacy API-key rows.
|
|
60742
60837
|
*
|
|
60743
60838
|
* v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
|
|
60744
|
-
* — the subset check on `setUserScopes`
|
|
60839
|
+
* — the subset check on `setUserScopes` is moot
|
|
60745
60840
|
* because non-admins never reach these. If/when we open non-admin
|
|
60746
60841
|
* delegation, structural caller-scope subset check goes inside the
|
|
60747
60842
|
* provider.
|
|
@@ -60798,15 +60893,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
|
|
|
60798
60893
|
kind: "mutation",
|
|
60799
60894
|
auth: "admin",
|
|
60800
60895
|
access: "delete"
|
|
60801
|
-
}), method(
|
|
60802
|
-
kind: "mutation",
|
|
60803
|
-
auth: "admin",
|
|
60804
|
-
access: "create"
|
|
60805
|
-
}), method(object({ id: string() }), object({ success: literal(true) }), {
|
|
60806
|
-
kind: "mutation",
|
|
60807
|
-
auth: "admin",
|
|
60808
|
-
access: "delete"
|
|
60809
|
-
}), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
|
|
60896
|
+
}), method(object({ userId: string() }), TotpSetupResultSchema, {
|
|
60810
60897
|
kind: "mutation",
|
|
60811
60898
|
auth: "admin",
|
|
60812
60899
|
access: "create"
|
|
@@ -64962,7 +65049,7 @@ Object.freeze({
|
|
|
64962
65049
|
capName: "llm",
|
|
64963
65050
|
capScope: "system",
|
|
64964
65051
|
addonId: null,
|
|
64965
|
-
access: "
|
|
65052
|
+
access: "create"
|
|
64966
65053
|
},
|
|
64967
65054
|
"llm.listNodeModels": {
|
|
64968
65055
|
capName: "llm",
|
|
@@ -69626,12 +69713,6 @@ Object.freeze({
|
|
|
69626
69713
|
addonId: null,
|
|
69627
69714
|
access: "create"
|
|
69628
69715
|
},
|
|
69629
|
-
"userManagement.createScopedToken": {
|
|
69630
|
-
capName: "user-management",
|
|
69631
|
-
capScope: "system",
|
|
69632
|
-
addonId: null,
|
|
69633
|
-
access: "create"
|
|
69634
|
-
},
|
|
69635
69716
|
"userManagement.createUser": {
|
|
69636
69717
|
capName: "user-management",
|
|
69637
69718
|
capScope: "system",
|
|
@@ -69680,12 +69761,6 @@ Object.freeze({
|
|
|
69680
69761
|
addonId: null,
|
|
69681
69762
|
access: "view"
|
|
69682
69763
|
},
|
|
69683
|
-
"userManagement.listScopedTokens": {
|
|
69684
|
-
capName: "user-management",
|
|
69685
|
-
capScope: "system",
|
|
69686
|
-
addonId: null,
|
|
69687
|
-
access: "view"
|
|
69688
|
-
},
|
|
69689
69764
|
"userManagement.listUsers": {
|
|
69690
69765
|
capName: "user-management",
|
|
69691
69766
|
capScope: "system",
|
|
@@ -69740,12 +69815,6 @@ Object.freeze({
|
|
|
69740
69815
|
addonId: null,
|
|
69741
69816
|
access: "delete"
|
|
69742
69817
|
},
|
|
69743
|
-
"userManagement.revokeScopedToken": {
|
|
69744
|
-
capName: "user-management",
|
|
69745
|
-
capScope: "system",
|
|
69746
|
-
addonId: null,
|
|
69747
|
-
access: "delete"
|
|
69748
|
-
},
|
|
69749
69818
|
"userManagement.setupTotp": {
|
|
69750
69819
|
capName: "user-management",
|
|
69751
69820
|
capScope: "system",
|
|
@@ -69776,12 +69845,6 @@ Object.freeze({
|
|
|
69776
69845
|
addonId: null,
|
|
69777
69846
|
access: "view"
|
|
69778
69847
|
},
|
|
69779
|
-
"userManagement.validateScopedToken": {
|
|
69780
|
-
capName: "user-management",
|
|
69781
|
-
capScope: "system",
|
|
69782
|
-
addonId: null,
|
|
69783
|
-
access: "view"
|
|
69784
|
-
},
|
|
69785
69848
|
"userManagement.verifyTotp": {
|
|
69786
69849
|
capName: "user-management",
|
|
69787
69850
|
capScope: "system",
|
|
@@ -74117,7 +74180,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
74117
74180
|
capability: adminUiCapability,
|
|
74118
74181
|
provider: {
|
|
74119
74182
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
74120
|
-
getVersion: async () => ({ version: "1.2.
|
|
74183
|
+
getVersion: async () => ({ version: "1.2.442" })
|
|
74121
74184
|
}
|
|
74122
74185
|
}];
|
|
74123
74186
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,G as n,J as r,L as i,S as a,b as o,o as s,q as c,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{It as d,Nt as f,Ot as p,Q as m,Rn as h,Si as g,Tn as _,Wr as v,ai as y,bn as b,dt as x,fn as S,kn as C,or as w,pi as ee,pn as te,tn as T,un as E,vi as ne,xi as re}from"./player-overlays-Fx6RE6kI.js";import{ki as D}from"./client-yfOXPkcm.js";import{i as O,l as ie}from"./video-BRgeujOO.js";import{$n as k,Ar as ae,Cr as A,Dn as oe,Dr as se,Dt as ce,Er as j,Et as le,G as M,Hn as N,Hr as P,Ir as ue,Lr as de,Mn as F,Mr as fe,Nn as pe,Nr as I,On as L,Or as me,Pr as he,Qn as R,Rr as ge,Sr as z,Tr as B,Ur as _e,Vr as V,_u as H,br as U,bu as W,es as G,et as ve,jn as ye,jr as be,kn as xe,nu as Se,sr as K,wr as Ce,zr as q}from"./src-AhVPNkCn.js";import{t as J}from"./useTranslation-D3Is_4B6.js";import"./mount-CRpYde_B.js";import{Z as Y,et as X,nt as we}from"./index-CcAR8Rlk.js";import{t as Z}from"./AdminPage--m3xHpjx.js";import{t as Te}from"./NodeAddonsSettingsPanel-BxeQZ-hu.js";import{n as Q,t as Ee}from"./useNodeUrlSelection-v_RZ_Gxk.js";function De(e){if(e===void 0)return null;switch(e.state){case`failed`:case`refused`:case`missing`:case`crashed`:return{kind:e.state,...e.reason===void 0?{}:{reason:e.reason}};default:return null}}e();var Oe={queued:{icon:y,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:w,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:b,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:g,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:O,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function ke({item:e}){let{t}=J(),n=Oe[e.status],r=n.icon;return a(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${n.bg}`,title:e.error,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey)]})}var Ae=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),je=new Set([`done`,`failed`,`skipped`]);function Me(e){return!je.has(e.phase)&&!Ae.has(e.jobState)}function Ne(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Ae.has(e.state);for(let i of e.tasks)r&&i.finishedAtMs!==null&&t-i.finishedAtMs>6e4||n.set(i.packageName,{jobId:e.jobId,packageName:i.packageName,phase:i.phase,fromVersion:i.fromVersion,toVersion:i.toVersion,error:i.error,jobState:e.state,finishedAtMs:i.finishedAtMs})}return n}function Pe(){let{data:e}=be({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=W(D.AddonsJobProgress,e=>e.job.jobId);return n(()=>{let n=new Map;for(let t of e??[])n.set(t.jobId,t);for(let[e,r]of t)n.set(e,r.job);return Ne([...n.values()],Date.now())},[e,t])}var Fe={queued:{icon:y,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:w,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:w,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:g,cls:`bg-success/10 text-success`,labelKey:`addons.jobProgress.updated`},failed:{icon:O,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:T,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Ie({progress:e}){let{t}=J(),n=Fe[e.phase],r=n.icon,i=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return a(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${n.cls}`,title:i,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey),a(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Le(e,t){return e.filter(e=>e.packageName===t).slice().sort((e,t)=>e.isHub===t.isHub?e.nodeName.localeCompare(t.nodeName):e.isHub?-1:1)}function Re(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function ze(e,t,n){let r=[`${e} will be uninstalled from ${t.length} node(s). Its runners stop, its capabilities are deregistered and its code is deleted:`,...t.map(Re)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function Be(e,t,n){let r=[`${e} will be uninstalled from ${t}: its runners stop and its code is deleted.`];return n.length>0&&r.push(`It stays installed on: ${n.map(e=>e.nodeName).join(`, `)}. Use "Everywhere" to remove it from every node.`),r.push(`This cannot be undone.`),r.join(`
|
|
3
|
-
`)}var Ve={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function He(e,t){let n=[];for(let r of e.results){let e=r.runnersStopped.length>0?` (stopped ${r.runnersStopped.join(`, `)})`:``;n.push(`${t(r.nodeId)}: ${Ve[r.outcome]}${e}`),r.error!==void 0&&n.push(` ${r.error}`);for(let e of r.warnings)n.push(` ${e}`)}return n.join(`
|
|
4
|
-
`)}var Ue={},We=3e4,Ge=`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors`;function Ke({packageName:e,displayName:t,selectedNode:n,hideNodeAction:r,disabled:i}){let{t:o}=J(),c=s(),u=k(),f=R(),p=ae(Ue,{staleTime:We}),m=p.data?.installations??[],h=(p.data?.unreachable??[]).map(e=>e.nodeId),g=Le(m,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===n.id?n.name:e),v=P({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),y=async e=>{await f({title:e.success?o(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:t}):o(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:t}),message:He(e,_),variant:e.success?`default`:`danger`})},b=async n=>{try{await y(await v.mutateAsync({packageName:e,...n}))}catch(e){await f({title:o(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:t}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==n.id);await u({title:o(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:t,name:n.name}),message:Be(t,n.name,e),confirmLabel:o(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(n.isHub?{}:{nodeId:n.id})},S=async()=>{let n=(await p.refetch()).data;if(n===void 0){await f({title:o(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:o(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Le(n.installations,e);await u({title:o(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:t}),message:ze(t,r,n.unreachable.map(e=>e.nodeId)),confirmLabel:o(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||i===!0;return a(`div`,{className:`flex items-center gap-1.5`,children:[r!==!0&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:n.name}),children:[l(d,{className:`h-3 w-3`}),v.isPending?o(`addons.addonUninstallControls.removing`,`Removing...`):o(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||r===!0||h.length>0)&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[l(ie,{className:`h-3 w-3`}),g.length>0?o(`addons.uninstallControls.everywhereCount`,{count:g.length}):o(`addons.uninstallControls.everywhere`)]})]})}function qe({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:s,selectedVersion:c}){let{t:u}=J(),d=n===`upload`||n===`local`,{data:f,isLoading:m}=j({name:e});return a(`div`,{className:`fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,style:{top:`auto`,bottom:`auto`},ref:e=>{if(!e)return;let t=e.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerHeight-t.bottom,r=t.top;n<280&&r>n?(e.style.bottom=`${window.innerHeight-t.top+4}px`,e.style.top=`auto`):(e.style.top=`${t.bottom+4}px`,e.style.bottom=`auto`),e.style.right=`${window.innerWidth-t.right}px`},onClick:e=>e.stopPropagation(),children:[a(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[l(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:u(`addons.versionPicker.versions`,`Versions`)}),l(`button`,{type:`button`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3 w-3`})})]}),d&&a(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[l(p,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),a(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[l(`span`,{className:`font-semibold`,children:u(`addons.versionPicker.inPlace`,{kind:n===`upload`?u(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):u(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,l(Y,{i18nKey:`addons.versionPicker.reinstall`,values:{version:t},components:{mono:l(`span`,{className:`font-mono`})}})]})]}),m&&a(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[l(w,{className:`h-3.5 w-3.5 animate-spin`}),u(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),f&&l(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:f.map(e=>{let n=e.version===t,i=s!==void 0&&e.version===c,d=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),f=a(o,{children:[l(`span`,{className:`font-mono flex-1 text-left ${n?`text-primary font-semibold`:d?`text-amber-400`:`text-foreground`}`,children:e.version}),n&&l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:u(`common.current`)}),e.distTags.map(e=>l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e===`latest`?`bg-emerald-500/15 text-emerald-400`:e===`beta`?`bg-amber-500/15 text-amber-400`:`bg-gray-500/15 text-gray-400`}`,children:e},e)),e.deprecated&&l(`span`,{className:`text-[9px] text-red-400 line-through`,children:u(`common.deprecated`)}),l(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return s?a(`button`,{type:`button`,"aria-label":u(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>s(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${i?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,i?l(g,{className:`h-3 w-3 text-primary shrink-0`}):l(`span`,{className:`w-3 shrink-0`})]},e.version):a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${n?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,l(`button`,{type:`button`,onClick:()=>r(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:n?u(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):u(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:l(v,{className:`h-3 w-3`})})]},e.version)})}),f&&f.length===0&&l(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:u(`addons.versionPicker.noVersionsFound`,`No versions found`)})]})}e();var Je=`device-export`;function Ye(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===Je)}function Xe(e){return e!==`local`&&e!==`upload`}function Ze({isBundle:e,installSource:t,addonId:n,iconPath:i,color:o}){let[s,c]=r(!1),u=o?{backgroundColor:`${o.startsWith(`#`)?o:`#${o}`}26`}:void 0,d=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,f=n&&i?m(`/api/addon-assets/${n}/${i}`):null,g=!!f&&!s;return a(`div`,{className:`relative flex-shrink-0`,children:[l(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:g?l(`img`,{src:f,alt:n,className:`h-4 w-4`,onError:()=>c(!0)}):l(e?h:_,{className:`h-3.5 w-3.5`})}),t===`local`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm`,children:`DEV`}),Xe(t)&&l(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:l(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:l(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),t===`upload`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm`,children:l(p,{className:`h-2.5 w-2.5 text-white`})})]})}function Qe({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:o,onUpdate:s,onOpenPicker:c,children:u}){let{t:d}=J();if(r)return a(`span`,{className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 shrink-0`,children:[l(w,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(t){let r=n??t;return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[s&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:o,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-semibold border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,title:d(`addons.addonCard.updateTo`,`Update to {{target}}`,{target:r}),children:[l(v,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,"aria-label":d(`addons.addonCard.selectVersionToInstall`,`Select version to install`),title:d(`addons.addonCard.installedUpdateAvailableSelectedTap`,`Installed {{version}} — update available. Selected {{target}}; tap to choose another version.`,{version:e,target:r}),className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border border-amber-500/40 bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 animate-pulse disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[l(`span`,{className:`font-normal opacity-70`,children:e}),l(`span`,{className:`font-normal opacity-70`,children:`→`}),r,l(re,{className:`h-3 w-3`})]}),u]})}return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,className:[`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,i===`local`?`border-orange-500/30 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20`].join(` `),title:d(`addons.addonCard.versionTapToViewAll`,`Version {{version}} — tap to view all versions`,{version:e}),children:[e,l(re,{className:`h-3 w-3 opacity-50`})]}),u]})}function $e({addonId:e}){let t=s(),{data:n=`inherit`}=A({addonId:e}),r=ge({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return l(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>l(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),r.mutate({addonId:e,channel:t})},disabled:r.isPending,className:`px-2.5 py-1 transition-colors capitalize ${n===t?t===`inherit`?`bg-gray-700/50 text-gray-700 dark:text-gray-300`:t===`off`?`bg-gray-700 text-gray-700 dark:text-gray-300`:t===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${t===`inherit`?``:`border-l border-border`}`,children:t},t))})}var et={id:`hub`,name:`Hub`,isHub:!0};function tt({addon:e,agents:n=[],clusterStatus:i,hideVersion:c,availableUpdate:u,onUpdate:d,isUpdating:f,jobProgress:p,bundle:m,bulkItem:g,disabledByBulk:_,isSystem:v,selectedNode:y}){let{t:S}=J(),[w,ee]=r(!1),[T,D]=r(!1),[ie,k]=r(!1),[ae,A]=r(null);t(()=>{A(null)},[u]);let j=ae??u,[M,P]=r(!1),[de,fe]=r(!1),[I,me]=r(`logs`),R=s(),ge=X(),{manifest:z}=e,B=e.installedOn??[],_e=!m&&!z.protected&&z.removable!==!1,V=!!m,H=m?.displayName??z.name,U=m?.packageName??z.packageName,W=m?.version??z.packageVersion??z.version,G=m?.installSource??e.installSource,be=m?m.bundle?.description??m.addons[0]?.manifest.description:z.description,Se=he({onSuccess:()=>{R.invalidateQueries({queryKey:[[`addons`]]})}}),K=se({onSuccess:()=>{R.invalidateQueries({queryKey:[[`addons`]]}),R.invalidateQueries({queryKey:[[`addonPages`]]}),R.invalidateQueries({queryKey:[[`capabilities`]]}),R.invalidateQueries({queryKey:[[`integrations`]]})}}),Ce=ue({onSuccess:()=>{R.invalidateQueries({queryKey:[[`addons`]]}),R.invalidateQueries({queryKey:[[`alerts`]]})}}),q=e.health,Y=q?.phase===`failed`&&!q.inGracePeriod,we=Y&&q?.nextRetryAt&&!q.retrying,Z=De(e.process);return a(`div`,{className:`rounded-md border bg-surface overflow-hidden ${Y?`border-red-500/50`:`border-border`}`,children:[Y&&q&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(O,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:S(`addons.addonCard.failedToLoad`,{attempt:q.retryCount})}),l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:q.lastError?.message??S(`addons.addonCard.unknownError`,`Unknown error`)}),we&&q.nextRetryAt&&l(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:S(`addons.addonCard.autoRetryAt`,{time:new Date(q.nextRetryAt).toLocaleTimeString()})})]}),a(`button`,{type:`button`,disabled:Ce.isPending||q.retrying,onClick:e=>{e.stopPropagation(),Ce.mutate({packageName:U})},className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-semibold border border-red-400/40 bg-red-400/10 text-red-700 dark:text-red-300 hover:bg-red-400/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0`,title:S(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[l(b,{className:`h-3 w-3 ${Ce.isPending||q.retrying?`animate-spin`:``}`}),S(`addons.addonCard.retryNow`,`Retry now`)]})]}),Z!==null&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(O,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:S(`addons.addonCard.processProblem.${Z.kind}`)}),Z.reason!==void 0&&l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Z.reason})]})]}),a(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[l(Ze,{isBundle:V||!!z.components&&z.components.length>1,installSource:G,addonId:V?m.addons[0]?.manifest.id:z.id,iconPath:V?m.bundle?.icon??m.addons[0]?.manifest.icon:z.icon,color:V?m.addons[0]?.manifest.color:z.color}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-start justify-between gap-2`,children:[l(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:H}),!c&&l(Qe,{version:W,availableUpdate:u,...j===void 0?{}:{selectedVersion:j},isUpdating:f,installSource:G,disabled:_,...d&&j!==void 0?{onUpdate:()=>d(j)}:{},onOpenPicker:()=>k(e=>!e),children:ie&&l(qe,{packageName:U,currentVersion:W,...G?{installSource:G}:{},...u!==void 0&&j!==void 0?{selectedVersion:j,onSelect:e=>{A(e),k(!1)}}:{},onInstall:e=>{k(!1),K.mutate({packageName:U,version:e})},onClose:()=>k(!1)})})]}),a(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[U!==H&&l(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:U}),V&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,children:[l(h,{className:`h-3 w-3`}),m.addons.length]}),v&&a(`span`,{className:`text-[10px] rounded-full bg-amber-500/15 text-amber-700 dark:text-amber-300 px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,title:S(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[l(b,{className:`h-3 w-3`}),S(`addons.addonCard.system`,`System`)]}),g!=null&&l(ke,{item:g}),p!=null&&l(Ie,{progress:p})]}),be&&l(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:be}),!V&&e.process&&a(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.mode===`forked`?`bg-blue-500/15 text-blue-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.mode===`forked`?S(`addons.addonCard.forked`):S(`addons.addonCard.inProcess`)}),e.process.pid!=null&&a(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.state===`running`?`bg-emerald-500/15 text-emerald-400`:Z===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!V&&a(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Se.mutate({addonId:z.id})},disabled:Se.isPending||_,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors`,children:[l(b,{className:`h-3 w-3 ${Se.isPending?`animate-spin`:``}`}),S(`addons.addonCard.restart`,`Restart`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),P(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${M?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(te,{className:`h-3 w-3`}),S(`addons.addonCard.logs`,`Logs`)]}),!V&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),fe(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${de?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(E,{className:`h-3 w-3`}),S(`addons.addonCard.settings`,`Settings`)]}),l(`div`,{className:`flex-1`}),_e&&l(Ke,{packageName:z.packageName,displayName:z.name,selectedNode:y??et,disabled:_})]}),i&&i.nodes.length>1&&!V&&a(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:S(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),l(`div`,{className:`space-y-1`,children:i.nodes.map(e=>a(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[l(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`offline`?`bg-muted-foreground/30`:e.synced?`bg-success`:`bg-amber-500`}`}),l(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),l(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:S(`addons.addonCard.outdated`)}),e.status===`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:S(`common.offline`)}),e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] text-success`,children:S(`common.synced`)})]},e.nodeId))})]}),M&&!V&&a(`div`,{className:`border-t border-border`,children:[a(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[a(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[l(`button`,{type:`button`,onClick:()=>me(`logs`),className:`px-2 py-0.5 transition-colors ${I===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.logs`,`Logs`)}),l(`button`,{type:`button`,onClick:()=>me(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${I===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.events`,`Events`)})]}),l(`div`,{className:`flex-1`}),l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),P(!1)},className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3.5 w-3.5`})})]}),I===`logs`&&l(ce,{addonId:z.id,maxHeight:`max-h-64`,showFilters:!1}),I===`events`&&l(le,{addonId:z.id,category:`addon.*`,maxHeight:`max-h-64`})]}),V&&a(o,{children:[l(`button`,{type:`button`,onClick:()=>ee(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:l(w?ne:re,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),w&&l(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:m.addons.map(e=>l(tt,{addon:e,agents:n,hideVersion:!0},e.manifest.id))})]}),de&&!V&&l(oe,{open:!0,onOpenChange:e=>!e&&fe(!1),children:a(xe,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[l(F,{children:a(pe,{className:`flex items-center gap-2`,children:[l(E,{className:`h-4 w-4 text-primary`}),S(`addons.addonCard.settingsTitle`,{name:H})]})}),a(L,{className:`space-y-4`,children:[l(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:S(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),l(Te,{nodeId:null,addonIds:[z.id],level:`global`,fieldScope:`cluster`,emptyMessage:S(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),Ye(z)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.deviceExport`,`Device export`)}),l(ve,{addonId:z.id,onOpenDevice:e=>ge(`/devices/${e}`)})]}),Xe(G)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.autoUpdate`,`Auto-Update`)}),l($e,{addonId:z.id})]}),z.components&&z.components.length>0&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.components`,{count:z.components.length})}),l(`div`,{className:`flex flex-wrap gap-1`,children:z.components.map(e=>l(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]}),n.length>=2&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.installedOn`,`Installed on`)}),a(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[B.length===0&&l(`span`,{className:`text-[10px] text-foreground-subtle`,children:S(`addons.addonCard.hubLocal`,`Hub (local)`)}),B.map(e=>l(`span`,{className:`rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle`,children:e},e)),a(`div`,{className:`relative`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),D(e=>!e)},className:`inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors`,title:S(`addons.addonCard.installOnMoreAgents`,`Install on more agents`),children:[l(C,{className:`h-3 w-3`}),S(`addons.addonCard.addAgent`,`Add agent`)]}),T&&a(`div`,{className:`absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden`,children:[n.filter(e=>!e.isHub&&!B.includes(e.name)).map(e=>l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),D(!1)},className:`w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors`,children:e.name},e.id)),n.filter(e=>!e.isHub&&!B.includes(e.name)).length===0&&l(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle`,children:S(`addons.addonCard.noAvailableAgents`,`No available agents`)})]})]})]})]})]}),l(ye,{children:l(N,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>fe(!1),children:S(`common.close`,`Close`)})})]})})]})}e();var nt=`.tgz,.tar.gz,.zip`;function rt({onUploadSuccess:e}){let{t}=J(),[n,s]=r(!1),u=c(null),d=i(async t=>{s(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(m(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{s(!1)}},[e]);return a(o,{children:[l(`input`,{ref:u,type:`file`,accept:nt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),a(`button`,{type:`button`,onClick:()=>u.current?.click(),disabled:n,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[n?l(w,{className:`w-3.5 h-3.5 animate-spin`}):l(p,{className:`w-3.5 h-3.5`}),n?t(`addons.addonUploadZone.uploading`,`Uploading...`):t(`addons.addonUploadZone.upload`,`Upload`)]})]})}var it=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/ui-library`,`@camstack/addon-agent-ui`]);function at(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||it.has(r.packageName)||!t.isHub&&r.nodeId!==t.id)continue;let e=n.get(r.packageName)??[];e.push(r),n.set(r.packageName,e)}return[...n].map(([e,t])=>({packageName:e,rows:t})).sort((e,t)=>e.packageName.localeCompare(t.packageName))}function ot({selectedNode:e}){let{t}=J(),{data:n}=ae(Ue,{staleTime:We});if(n===void 0)return null;let r=at(n.installations,e),i=n.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return r.length===0&&i.length===0?null:a(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[a(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[l(f,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?t(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):t(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),i.length>0&&l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:i.map(e=>e.nodeId).join(`, `)})}),r.map(t=>a(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[a(`div`,{className:`min-w-0`,children:[l(`div`,{className:`text-xs font-mono text-foreground break-all`,children:t.packageName}),l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),l(Ke,{packageName:t.packageName,displayName:t.packageName,selectedNode:e,hideNodeAction:e.isHub})]},t.packageName))]})}function st({addon:e,installing:t,onInstall:n}){let{t:r}=J();return a(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[l(`div`,{className:`w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0`,children:e.name.replace(`@camstack/addon-`,``).charAt(0).toUpperCase()}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[l(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),a(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),l(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&l(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?l(K,{variant:`success`,icon:l(g,{className:`h-3 w-3`}),children:e.installedVersion??r(`system.capabilityCatalog.installed`,`Installed`)}):a(N,{size:`sm`,onClick:()=>n(e.name),disabled:t,className:`shrink-0`,children:[t?l(w,{className:`h-3 w-3 animate-spin`}):l(v,{className:`h-3 w-3`}),r(`system.capabilityCatalog.install`,`Install`)]})]})}function ct({capability:e,installing:t,onInstall:n}){let{t:r}=J(),{data:i,isPending:o,isError:s}=de({capability:e}),c;if(s)c=l(`div`,{className:`px-3 py-2 text-xs text-danger`,children:r(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(o||i===void 0)c=a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[l(w,{className:`h-3 w-3 animate-spin`}),r(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let a=i.filter(e=>!e.installed);c=a.length===0?l(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:i.length===0?r(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):r(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):l(`div`,{className:`divide-y divide-border`,children:a.map(e=>l(st,{addon:e,installing:t,onInstall:n},e.name))})}return a(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":r(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[l(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:r(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),c]})}e();function lt(e){return e===`npm`||e===`dev`?e:null}var ut=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,dt=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,ft=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],pt=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/shm-ring`,`@camstack/ui-library`]);function mt(e){return e!==void 0&&pt.has(e)}var ht={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function gt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function _t(e){return e===`local`?`dev`:`npm`}function vt(e){let t=e;if(!t?.manifest)return null;let n={...t.manifest,name:t.manifest.name??t.manifest.id,version:t.manifest.version??`0.0.0`,capabilities:t.manifest.capabilities??[]},r=t.process,i=r?{pid:r.pid,mode:r.mode===`forked`?`forked`:`in-process`,state:r.state??`unknown`,...r.reason===void 0?{}:{reason:r.reason}}:void 0,a=t.health,o=t.declaration?.execution,s=t.manifest.execution,c=o?.placement??s?.placement;return{manifest:n,enabled:!0,source:t.source,installSource:t.installSource,installedOn:[],...i?{process:i}:{},hasBackup:t.hasBackup,...a?{health:a}:{},...c?{placement:c}:{}}}function yt(e){let t=new Map,n=[];for(let r of e){let e=r.manifest.packageName;if(!e){n.push(r);continue}let i=t.get(e);if(i)i.addons.push(r);else{let n=r.manifest.bundle,i={packageName:e,displayName:n?.displayName??r.manifest.packageDisplayName??r.manifest.name,version:r.manifest.packageVersion,addons:[r],...r.installSource===void 0?{}:{installSource:r.installSource},...n===void 0?{}:{bundle:n}};t.set(e,i)}}let r=[];for(let e of t.values())e.bundle!==void 0||e.addons.length>=2?r.push({bundle:e,representative:e.addons[0]}):r.push(e.addons[0]);return r.push(...n),r}function $(e){return`bundle`in e}function bt({addons:e,clusterStatus:o,selectedNode:d,onRefresh:f,isRefreshing:p}){let{t:m}=J(),h=s(),[g,_]=r(``),y=u(g),[x,C]=r(!1),te=c(null);t(()=>{if(!x)return;let e=e=>{te.current&&!te.current.contains(e.target)&&C(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[x]);let{data:T}=fe({nodeId:d.id}),E=n(()=>{let e=new Map;for(let t of T??[])e.set(t.name,t.latestVersion);return e},[T]),ne=n(()=>(T??[]).filter(e=>!e.isSystem).length,[T]),[re,D]=r(()=>new Set),[O,ie]=r(()=>new Map),ae=i(e=>{D(t=>new Set(t).add(e))},[]),A=i(e=>{D(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),oe=i((e,t)=>{ie(n=>new Map(n).set(e,t))},[]),ce=i(e=>{ie(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),j=_e({onMutate:e=>{ae(e.name),ce(e.name)},onSuccess:(e,t)=>{A(t.name);let n=e;if(n&&n.success===!1){oe(t.name,n.error??`Update failed (no error message returned by server)`);return}h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{A(t.name),oe(t.name,e instanceof Error?e.message:String(e))}}),le=Pe(),M=c(new Set);t(()=>{let e=new Set;for(let[t,n]of le)Me(n)&&e.add(t);let t=[...M.current].some(t=>!e.has(t));M.current=e,t&&(h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[le,h]);let{data:N}=Ce(void 0),P=U({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),ue=q({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:F,isFetching:pe}=de({query:y||void 0},{enabled:x}),I=V(),{data:L}=B(void 0),me=L?.requestedAt,[he,R]=r(null),[ge,z]=r(!1);t(()=>{if(L?.kind===`framework-bulk-update`&&L.requestedAt!==he){R(L.requestedAt),z(!0);let e=window.setTimeout(()=>z(!1),6e3);return()=>window.clearTimeout(e)}},[me,he,L]),k();let H=i(async()=>{let e=(T??[]).filter(e=>!e.isSystem);if(e.length!==0){if(!d.isHub){for(let t of e)await j.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await I.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[T,d.id,d.isHub,I,j]),W=se({onSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`]]}),h.invalidateQueries({queryKey:[[`addonPages`]]}),h.invalidateQueries({queryKey:[[`capabilities`]]}),h.invalidateQueries({queryKey:[[`integrations`]]})}}),[G,ve]=r(`type`),[ye,be]=r(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),xe=e=>{be(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[K,Y]=we(),X=K.get(`capability`),Z=K.get(`updatable`)===`1`,Te=K.get(`error`)===`1`,Q=lt(K.get(`source`)),Ee=i(e=>{let t=new URLSearchParams(K);e?t.set(`updatable`,`1`):t.delete(`updatable`),Y(t,{replace:!0})},[K,Y]),Oe=i(e=>{let t=new URLSearchParams(K);e?t.set(`error`,`1`):t.delete(`error`),Y(t,{replace:!0})},[K,Y]),ke=i(e=>{let t=new URLSearchParams(K);e===null?t.delete(`source`):t.set(`source`,e),Y(t,{replace:!0})},[K,Y]),Ae=n(()=>e.filter(e=>De(e.process)!==null).length,[e]),je=n(()=>{let t=e.filter(e=>!mt(e.manifest.packageName));return d.isHub||(t=t.filter(e=>gt(e.placement,d.isHub))),X&&(t=t.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),Z&&(t=t.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&E.has(t)})),Q!==null&&(t=t.filter(e=>_t(e.installSource)===Q)),Te&&(t=t.filter(e=>De(e.process)!==null)),t},[e,d.isHub,X,Z,Q,Te,E]),Ne=()=>{let e=new URLSearchParams(K);e.delete(`capability`),Y(e,{replace:!0})},Fe=ye===`flat`?je:yt(je),Ie=n(()=>{let e=[...Fe];switch(G){case`type`:e.sort((e,t)=>{let n=+!$(e),r=+!$(t);if(n!==r)return n-r;let i=$(e)?e.bundle.displayName:e.manifest.name,a=$(t)?t.bundle.displayName:t.manifest.name;return i.localeCompare(a)});break;case`name`:e.sort((e,t)=>{let n=$(e)?e.bundle.displayName:e.manifest.name,r=$(t)?t.bundle.displayName:t.manifest.name;return n.localeCompare(r)});break;case`source`:e.sort((e,t)=>{let n=$(e)?e.bundle.installSource??``:e.installSource??``,r=$(t)?t.bundle.installSource??``:t.installSource??``;return n.localeCompare(r)});break}return e},[Fe,G]);return a(`div`,{className:`space-y-3`,children:[[...O.entries()].map(([e,t])=>l(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:a(`div`,{className:`flex items-start justify-between gap-3`,children:[a(`div`,{className:`space-y-0.5`,children:[l(`div`,{className:`font-medium text-danger`,children:m(`systemPage.addons.updateFailed`,{name:e})}),l(`div`,{className:`text-foreground-subtle font-mono`,children:t})]}),l(`button`,{type:`button`,onClick:()=>ce(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:m(`common.dismiss`)})]})},e)),a(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.sort`,`Sort:`)}),a(`select`,{value:G,onChange:e=>ve(e.target.value),className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50`,children:[l(`option`,{value:`type`,children:m(`admin.system.addons.bundlesFirst`,`Bundles first`)}),l(`option`,{value:`name`,children:m(`admin.system.addons.name`,`Name`)}),l(`option`,{value:`source`,children:m(`admin.system.addons.installSource`,`Install source`)})]})]}),a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.view`,`View:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>l(`button`,{type:`button`,onClick:()=>xe(e),className:`px-2 py-1 transition-colors capitalize ${ye===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?m(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):m(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(b,{className:`h-3 w-3 text-foreground-subtle`}),l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>l(`button`,{type:`button`,onClick:()=>P.mutate({channel:e}),disabled:P.isPending,className:`px-2 py-1 transition-colors capitalize ${N?.channel===e?e===`off`?`bg-gray-700 text-gray-200`:e===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${e===`off`?``:`border-l border-border`}`,children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.checkEvery`,`Check every:`)}),l(`select`,{className:`rounded-md border border-border bg-transparent px-1.5 py-1 text-[10px] font-medium text-foreground-subtle`,value:N?.updateCheckIntervalSeconds??21600,disabled:ue.isPending||N===void 0,onChange:e=>{N!==void 0&&ue.mutate({channel:N.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:ft.map(e=>l(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),ne>0&&a(`button`,{type:`button`,onClick:()=>void H(),disabled:I.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 border border-blue-500/30 disabled:opacity-50 transition-colors font-medium`,children:[I.isPending?l(w,{className:`w-3 h-3 animate-spin`}):l(v,{className:`w-3 h-3`}),I.isPending?m(`admin.system.addons.updating`,`Updating…`):m(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:ne})]}),a(`button`,{type:`button`,onClick:f,disabled:p||I.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[l(b,{className:`w-3 h-3 ${p?`animate-spin`:``}`}),m(`common.refresh`,`Refresh`)]})]}),a(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":m(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.filter`,`Filter:`)}),[{id:`updatable`,label:m(`admin.system.addons.updatable`,`Updatable`),pressed:Z,toggle:()=>Ee(!Z)},{id:`error`,label:m(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ae}),pressed:Te,toggle:()=>Oe(!Te)},{id:`npm`,label:`npm`,pressed:Q===`npm`,toggle:()=>ke(Q===`npm`?null:`npm`)},{id:`dev`,label:m(`admin.system.addons.dev`,`Dev`),pressed:Q===`dev`,toggle:()=>ke(Q===`dev`?null:`dev`)}].map(e=>l(`button`,{type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?ut:dt,children:e.label},e.id))]}),a(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[a(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:te,children:[l(Se,{type:`text`,value:g,onChange:e=>{_(e.target.value),C(!0)},onFocus:()=>C(!0),placeholder:m(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":m(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:I.isPending,leftSlot:l(S,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:pe?l(w,{className:`h-3 w-3 animate-spin`}):void 0}),x&&F&&F.length>0&&a(`div`,{className:`absolute left-0 right-0 top-full mt-1 z-40 rounded-md border border-border bg-surface shadow-xl overflow-hidden`,children:[F.length>0&&l(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:m(`systemPage.addons.npmResults`,{count:F.length})}),F&&F.length>0&&l(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:F.map(e=>l(st,{addon:e,installing:W.isPending,onInstall:e=>W.mutate({packageName:e})},e.name))})]})]}),l(rt,{onUploadSuccess:()=>{h.invalidateQueries({queryKey:[[`addons`]]}),f()}})]}),X&&a(`div`,{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-primary/10 border border-primary/30 text-xs`,children:[l(`span`,{className:`text-foreground-subtle`,children:m(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),l(`span`,{className:`font-mono text-primary font-semibold`,children:X}),l(`button`,{type:`button`,onClick:Ne,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:m(`admin.system.addons.clear`,`Clear`)})]}),X&&l(ct,{capability:X,installing:W.isPending,onInstall:e=>W.mutate({packageName:e})}),X&&je.length>0&&l(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:m(`admin.system.addons.installed`,`Installed`)}),ge&&a(`div`,{className:`fixed top-[calc(env(safe-area-inset-top)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm max-w-sm pointer-events-auto`,children:[l(ee,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),a(`div`,{children:[l(`div`,{className:`text-[11px] font-semibold text-foreground`,children:m(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),l(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:m(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),je.length===0&&l(`div`,{className:`text-xs text-foreground-subtle`,children:e.length===0?m(`admin.system.addons.noAddonsInstalled`,`No addons installed`):X?m(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:X}):m(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),l(`div`,{className:`space-y-1.5`,children:Ie.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=E.get(t),r=$(e)?e.representative:e,i=n?e=>j.mutate({name:t,version:e,nodeId:d.id}):void 0,a=le.get(t)??null,s=a!==null&&Me(a);return l(tt,{addon:r,clusterStatus:o?.[r.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,isUpdating:re.has(t)||s,jobProgress:a,onUpdate:i,disabledByBulk:I.isPending,selectedNode:d},$(e)?t:e.manifest.id)})})]})}function xt(){let{t:e}=J(),n=s(),{data:r}=G(void 0),{nodes:i}=H(),{selection:o,selectNode:u,requestedNodeId:d}=Ee(i.length>0?i:[ht]),f=o.node??ht,p=f.id,m=i.length>0?o.staleNodeId:null,{data:h,isLoading:g,isError:_}=me({nodeId:p}),v=z(),y=I(),x=v.isPending||y.isPending,S=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),n.invalidateQueries({queryKey:[[`addons`]]})},C=c(v);C.current=v;let w=c(d??`hub`);t(()=>{C.current.mutate({nodeId:w.current})},[]);let ee=(h??[]).map(vt).filter(e=>e!==null);return a(Z,{children:[a(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[l(M,{selectedNodeId:p,onSelect:u}),a(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&l(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:ee.length})}),a(`button`,{type:`button`,onClick:()=>void S(),disabled:x,className:`inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:e(`admin.system.addons.reFetchAddonsCheckNpm`,`Re-fetch addons + check npm for new versions`),children:[l(b,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),l(Q,{staleNodeId:m,shownNodeName:f.name}),l(ot,{selectedNode:f}),g&&l(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:e(`common.loading`,`Loading…`)}),_&&l(`div`,{className:`text-xs text-danger`,children:e(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),!g&&!_&&l(bt,{addons:ee,clusterStatus:r,selectedNode:f,onRefresh:()=>void S(),isRefreshing:x})]})}export{xt as AddonsPage};
|