@camstack/addon-admin-ui 1.1.61 → 1.1.63

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.
Files changed (94) hide show
  1. package/dist/assets/{AddLocationWizard-bhaoQHmi.js → AddLocationWizard-VuBsssbs.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-CDqyaaBM.js → AddonCollectionPage-rY0iw4Lx.js} +1 -1
  3. package/dist/assets/Addons-waDrxMrF.js +1 -0
  4. package/dist/assets/{AdminTabs-DuXQHrHl.js → AdminTabs-DdlxkzYF.js} +1 -1
  5. package/dist/assets/{AiProfiles-D5XjlwmU.js → AiProfiles-CXfreEns.js} +1 -1
  6. package/dist/assets/{BrokerForm-Baz2aj-M.js → BrokerForm-Bi1zDzJU.js} +1 -1
  7. package/dist/assets/{Capabilities-DvWcCLd-.js → Capabilities-CBqnCVAQ.js} +1 -1
  8. package/dist/assets/{CapabilityBadges-Bi6Tc2CY.js → CapabilityBadges-bb3Kp76B.js} +1 -1
  9. package/dist/assets/{Cluster-DcCFkNFk.js → Cluster-CkmNDo_z.js} +1 -1
  10. package/dist/assets/{ClusterRecordingTab-B7HSeqkq.js → ClusterRecordingTab-qj7qdRav.js} +1 -1
  11. package/dist/assets/{Dashboard-hskGR5xq.js → Dashboard-0L-WtwHw.js} +1 -1
  12. package/dist/assets/{Data-Dis-z_X0.js → Data-B-KdcyYb.js} +1 -1
  13. package/dist/assets/{DetectionIntelligence-CA3LMzt1.js → DetectionIntelligence-DH2CerYz.js} +1 -1
  14. package/dist/assets/DeviceDetail-C0xHmlNy.js +2 -0
  15. package/dist/assets/{Devices-DNxov4qw.js → Devices-BqWTi9bF.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-hw9jA2hT.js → EmbedPlayerPage-BmllV_ir.js} +1 -1
  17. package/dist/assets/{Events-BaEa4hl0.js → Events-Cg33ehHw.js} +1 -1
  18. package/dist/assets/{FormBuilder-pVzTAhbz.js → FormBuilder-DDOu77Pz.js} +1 -1
  19. package/dist/assets/Identity-DokGTNX5.js +1 -0
  20. package/dist/assets/{IntegrationDetail-DgaohpFt.js → IntegrationDetail-HKDhoWtW.js} +1 -1
  21. package/dist/assets/{Integrations-ddV6H8iR.js → Integrations-as3Ez0fd.js} +1 -1
  22. package/dist/assets/{Integrations-CLAnn2sl.js → Integrations-qqFL0Gs0.js} +1 -1
  23. package/dist/assets/{Logs-C-l_222o.js → Logs-C0i-qXwM.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-QJdI6XiU.js → MotionZonesSettings-rxIHdY6l.js} +1 -1
  25. package/dist/assets/{MyAccess-C-2QbLht.js → MyAccess-52fP18AF.js} +1 -1
  26. package/dist/assets/Network-s1InxtpH.js +1 -0
  27. package/dist/assets/NodeAddonsSettingsPanel-PSaY411C.js +1 -0
  28. package/dist/assets/NodeInferenceDevices-CoLAPH96.js +1 -0
  29. package/dist/assets/{NotificationTargets-CuVPNUqr.js → NotificationTargets-BYTjEwxL.js} +1 -1
  30. package/dist/assets/Pipeline-D3jI3Huf.js +1 -0
  31. package/dist/assets/{Plates-DdLC_wRY.js → Plates-BwI8RHl9.js} +1 -1
  32. package/dist/assets/{PrivacyMaskSettings-Bo-FkVZR.js → PrivacyMaskSettings-DDk6LoXQ.js} +1 -1
  33. package/dist/assets/{ProviderIcon-CnbzzcMq.js → ProviderIcon-CWyyzoZB.js} +1 -1
  34. package/dist/assets/{Recordings-D4cmFzZr.js → Recordings-D5IKi_ba.js} +1 -1
  35. package/dist/assets/{ScanNetworkModal-C6i9aK6q.js → ScanNetworkModal-B2bUhuZ1.js} +1 -1
  36. package/dist/assets/{Settings-phbzuilC.js → Settings-DKkqVGNC.js} +1 -1
  37. package/dist/assets/{Showroom-DmDq_i4m.js → Showroom-ablwi-TX.js} +1 -1
  38. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DHhQMm3y.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CCcHjOIo.js} +1 -1
  39. package/dist/assets/{build-cluster-graph-CZpvG2DP.js → build-cluster-graph-C1vd_7m_.js} +1 -1
  40. package/dist/assets/circle-check-big-GmO5fdEl.js +1 -0
  41. package/dist/assets/clock-OUNfpFX_.js +1 -0
  42. package/dist/assets/{copy-DF0dst5T.js → copy-St-1O01R.js} +1 -1
  43. package/dist/assets/{debounced-invalidate-D_V-nbWY.js → debounced-invalidate-DlIKzA73.js} +1 -1
  44. package/dist/assets/{dist-Bhw1R8vS.js → dist-CYW0dAGQ.js} +1 -1
  45. package/dist/assets/dist-D7nNU2QV.js +7 -0
  46. package/dist/assets/{download-CHtMXSyD.js → download-CJ-1cdDh.js} +1 -1
  47. package/dist/assets/{face-bbox-DgibKOZL.js → face-bbox-CTcnAI8I.js} +1 -1
  48. package/dist/assets/{hostInit-tj-M5EQ9.js → hostInit-D4IGCyt3.js} +1 -1
  49. package/dist/assets/index-BKBKdGDb.css +2 -0
  50. package/dist/assets/index-Cjto-EXm.js +4 -0
  51. package/dist/assets/{key-round-e-ZWFR-B.js → key-round-LcTErOxf.js} +1 -1
  52. package/dist/assets/{mf-entry-bootstrap-0-eabd788d.js → mf-entry-bootstrap-0-c57c6485.js} +2 -2
  53. package/dist/assets/{pencil-B3cC4tAQ.js → pencil-BkXeyiDf.js} +1 -1
  54. package/dist/assets/{player-overlays-QWBHo29P.js → player-overlays-BfnV1C0Q.js} +1 -1
  55. package/dist/assets/plus-DXXZ8pd7.js +1 -0
  56. package/dist/assets/{radio-DJUawWOR.js → radio-CGyv3voN.js} +1 -1
  57. package/dist/assets/{refresh-cw-CPElSd1E.js → refresh-cw-DC4KMLsa.js} +1 -1
  58. package/dist/assets/remoteEntry-CXtVdVO7.js +1 -0
  59. package/dist/assets/{rotate-ccw-Dp3LyyNb.js → rotate-ccw-DlNmHkpr.js} +1 -1
  60. package/dist/assets/rotate-cw-d8IjPUYX.js +1 -0
  61. package/dist/assets/search-DkClo4ZA.js +1 -0
  62. package/dist/assets/{send-BHy3n_wg.js → send-CeJ2J9V3.js} +1 -1
  63. package/dist/assets/{server-jWz5lmi4.js → server-CArIZ-KL.js} +1 -1
  64. package/dist/assets/square-BFjZ9GUs.js +1 -0
  65. package/dist/assets/{square-check-big-XDhdJZmb.js → square-check-big--y441eG8.js} +1 -1
  66. package/dist/assets/src-CCZM6rtM.js +7 -0
  67. package/dist/assets/src-CfZUxvPx.js +67 -0
  68. package/dist/assets/{upload-D3TVf2zJ.js → upload-D6H_84gF.js} +1 -1
  69. package/dist/assets/{useEventInvalidation-CguqAy76.js → useEventInvalidation-DxjiYIcd.js} +1 -1
  70. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BU8EM8C6.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-zgU2Aw4J.js} +2 -2
  71. package/dist/assets/{wifi-CjcdCR8p.js → wifi-B0toFYT9.js} +1 -1
  72. package/dist/assets/{zap-WvYWjJ23.js → zap-d6IKZFEN.js} +1 -1
  73. package/dist/index.html +6 -6
  74. package/dist/server/addon.js +128 -33
  75. package/package.json +1 -1
  76. package/dist/assets/Addons-D1gjFdsg.js +0 -1
  77. package/dist/assets/DeviceDetail-Ck8YpUxr.js +0 -2
  78. package/dist/assets/Identity-bmeRqIbV.js +0 -1
  79. package/dist/assets/Network-_lS0ynPr.js +0 -1
  80. package/dist/assets/NodeAddonsSettingsPanel-BYlipjiY.js +0 -1
  81. package/dist/assets/Pipeline-C4AUuZCt.js +0 -1
  82. package/dist/assets/circle-check-big-CPxj2KQE.js +0 -1
  83. package/dist/assets/clock-2ZdTSOML.js +0 -1
  84. package/dist/assets/dist-CGJaNSH2.js +0 -7
  85. package/dist/assets/index-BOnUkW6K.js +0 -4
  86. package/dist/assets/index-Cmef4Jek.css +0 -2
  87. package/dist/assets/plus-DaxL0ZPp.js +0 -1
  88. package/dist/assets/remoteEntry-BZgTphE5.js +0 -1
  89. package/dist/assets/rotate-cw-Bq5FdMBy.js +0 -1
  90. package/dist/assets/search-sOe8umG9.js +0 -1
  91. package/dist/assets/square-Df6rn0vR.js +0 -1
  92. package/dist/assets/src-Ck8eP0y_.js +0 -7
  93. package/dist/assets/src-DP-u1HtQ.js +0 -67
  94. package/dist/assets/useDevice-DqpXrha7.js +0 -1
@@ -11102,10 +11102,7 @@ var ConfigUISchemaNullableBridge = custom();
11102
11102
  var InferenceCapabilitiesBridge = custom();
11103
11103
  var ModelAvailabilityListBridge = custom();
11104
11104
  var PipelineRunResultBridge = custom();
11105
- method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
11106
- kind: "mutation",
11107
- auth: "admin"
11108
- }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
11105
+ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
11109
11106
  modelId: string(),
11110
11107
  settings: record(string(), unknown()).readonly()
11111
11108
  }))), method(object({ steps: record(string(), object({
@@ -11223,8 +11220,18 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
11223
11220
  * - `runtime` — main camera-serving engine (no idle TTL).
11224
11221
  * - `warm-override` — benchmark/test override held in the warm
11225
11222
  * cache; auto-disposed after the idle TTL.
11223
+ * - `device-pool` — a concurrent per-device pool (Phase 2
11224
+ * multi-device, keyed by `deviceKey`) resolved
11225
+ * via `resolveDeviceFactory`. Runs alongside the
11226
+ * `runtime` engine on a DIFFERENT accelerator
11227
+ * (NPU / iGPU / Coral) — this is how the
11228
+ * Engines tab shows all pools running at once.
11226
11229
  */
11227
- kind: _enum(["runtime", "warm-override"]),
11230
+ kind: _enum([
11231
+ "runtime",
11232
+ "warm-override",
11233
+ "device-pool"
11234
+ ]),
11228
11235
  /** Native pid of the underlying Python pool (null when no pool). */
11229
11236
  poolPid: number().nullable(),
11230
11237
  /** ms since this factory was last used (null when not warm-tracked). */
@@ -11594,6 +11601,19 @@ var RunnerLocalLoadSchema = object({
11594
11601
  avgInferenceTimeMs: number(),
11595
11602
  /** Total queue depth across motion + detection queues. */
11596
11603
  queueDepthTotal: number(),
11604
+ /**
11605
+ * Per-inference-device live load (multi-device C4). One entry per deviceKey
11606
+ * this runner currently has attached cameras on, so the orchestrator's second
11607
+ * `balance()` pass (over a node's devices) weights on real per-pool session
11608
+ * counts. Empty on single-device / pre-multi-device runners. `queueDepthTotal`
11609
+ * per device is 0 until the pool backlog gets a public accessor (follow-up).
11610
+ */
11611
+ devices: array(object({
11612
+ deviceKey: string(),
11613
+ backend: string(),
11614
+ attachedCameras: number(),
11615
+ queueDepthTotal: number()
11616
+ })).default([]),
11597
11617
  /** Hardware capability flags reported by this node. */
11598
11618
  hardware: object({
11599
11619
  hasGpu: boolean(),
@@ -16740,13 +16760,11 @@ var PipelineTemplateSchema = object({
16740
16760
  createdAt: string(),
16741
16761
  updatedAt: string()
16742
16762
  });
16743
- var AgentAddonConfigSchema = object({
16744
- enabled: boolean(),
16763
+ var DeviceStepConfigSchema = object({
16745
16764
  modelId: string().optional(),
16746
- settings: record(string(), unknown()).readonly()
16765
+ settings: record(string(), unknown()).optional()
16747
16766
  });
16748
16767
  var AgentPipelineSettingsSchema = object({
16749
- addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
16750
16768
  maxCameras: number().int().nonnegative().nullable().default(null),
16751
16769
  /** Per-node detection weight (relative share for the quota balancer). */
16752
16770
  detectWeight: number().positive().optional(),
@@ -16770,7 +16788,22 @@ var AgentPipelineSettingsSchema = object({
16770
16788
  * it already uses to reach the hub). Set this only when the auto-detected
16771
16789
  * address is wrong (multi-homed host, NAT, custom interface).
16772
16790
  */
16773
- reachableHost: string().optional()
16791
+ reachableHost: string().optional(),
16792
+ /**
16793
+ * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
16794
+ * weight, steps}. Absent / all-disabled ⇒ the node's single default
16795
+ * accelerator (safe default); two+ enabled ⇒ the dispatcher balances
16796
+ * detection sessions across them so they run CONCURRENTLY. `steps` is the
16797
+ * per-(node,device) BASE provisioning (`stepId → {modelId?, settings?}`) —
16798
+ * the default model/settings for every camera landing on that accelerator;
16799
+ * a stepId absent ⇒ the step uses that device's format default.
16800
+ */
16801
+ inferenceDevices: record(string(), object({
16802
+ enabled: boolean(),
16803
+ weight: number().positive().optional(),
16804
+ maxSessions: number().int().positive().optional(),
16805
+ steps: record(string(), DeviceStepConfigSchema).optional()
16806
+ })).optional()
16774
16807
  });
16775
16808
  var CameraPipelineForAgentSchema = object({
16776
16809
  steps: array(PipelineStepInputSchema).readonly(),
@@ -16780,14 +16813,13 @@ var CameraPipelineForAgentSchema = object({
16780
16813
  }).nullable()
16781
16814
  });
16782
16815
  var CameraStepOverridePatchSchema = object({
16783
- enabled: boolean().optional(),
16784
16816
  modelId: string().optional(),
16785
16817
  settings: record(string(), unknown()).readonly().optional()
16786
16818
  });
16787
16819
  var CameraPipelineSettingsSchema = object({
16788
16820
  pinnedAgentNodeId: string().optional(),
16789
16821
  stepToggles: record(string(), boolean()).optional(),
16790
- stepOverridesByAgent: record(string(), record(string(), CameraStepOverridePatchSchema)).optional(),
16822
+ stepOverridesByDevice: record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).optional(),
16791
16823
  pipelineByAgent: record(string(), CameraPipelineForAgentSchema).optional()
16792
16824
  });
16793
16825
  /**
@@ -17001,6 +17033,44 @@ var CameraStatusSchema = object({
17001
17033
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
17002
17034
  fetchedAt: number()
17003
17035
  });
17036
+ var NodeInferenceDeviceSchema = object({
17037
+ /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
17038
+ key: string(),
17039
+ backend: string(),
17040
+ device: string(),
17041
+ format: _enum(MODEL_FORMATS),
17042
+ /** Whether the node's live probe reports the device as usable right now. */
17043
+ available: boolean(),
17044
+ /**
17045
+ * Whether this device participates in dispatch. AUTO default (spec C2):
17046
+ * accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
17047
+ * entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
17048
+ * not a balanced target). An explicit stored value always wins; a stored-only
17049
+ * (unavailable) key keeps its stored value.
17050
+ */
17051
+ enabled: boolean(),
17052
+ /** Relative balancer weight for the enabled device (default 1). */
17053
+ weight: number(),
17054
+ /** Per-device concurrent-session cap; null = unlimited (multi-device C4). */
17055
+ maxSessions: number().nullable(),
17056
+ /** Object-detection model the executor defaults to for this deviceKey. */
17057
+ defaultModelId: string(),
17058
+ /**
17059
+ * Per-(node,device) BASE provisioning (C7.2/C7.4) — the RAW stored
17060
+ * `stepId → {modelId?, settings?}` map from `inferenceDevices[key].steps`.
17061
+ * Absent/empty ⇒ no base (every step uses its device format default). The
17062
+ * UI cross-references `pipelineExecutor.getSchema` for the models actually
17063
+ * available per format; this is the stored selection that becomes the
17064
+ * default for EVERY camera landing on this accelerator.
17065
+ */
17066
+ steps: record(string(), DeviceStepConfigSchema).optional()
17067
+ });
17068
+ var NodeInferenceDevicesSchema = object({
17069
+ nodeId: string(),
17070
+ /** False when the node's platform-probe was unreachable (no live device set). */
17071
+ reachable: boolean(),
17072
+ devices: array(NodeInferenceDeviceSchema).readonly()
17073
+ });
17004
17074
  method(object({
17005
17075
  deviceId: number(),
17006
17076
  agentNodeId: string()
@@ -17010,7 +17080,13 @@ method(object({
17010
17080
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
17011
17081
  kind: "mutation",
17012
17082
  auth: "admin"
17013
- }), method(_void(), object({ migrated: number() }), {
17083
+ }), method(object({
17084
+ deviceId: number(),
17085
+ deviceKey: string()
17086
+ }), object({ success: literal(true) }), {
17087
+ kind: "mutation",
17088
+ auth: "admin"
17089
+ }), method(object({ deviceId: number() }), object({ deviceKey: string().nullable() })), method(_void(), object({ migrated: number() }), {
17014
17090
  kind: "mutation",
17015
17091
  auth: "admin"
17016
17092
  }), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
@@ -17044,13 +17120,7 @@ method(object({
17044
17120
  }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
17045
17121
  nodeId: string(),
17046
17122
  settings: AgentPipelineSettingsSchema
17047
- })).readonly()), method(object({
17048
- agentNodeId: string(),
17049
- defaults: record(string(), AgentAddonConfigSchema)
17050
- }), object({ success: literal(true) }), {
17051
- kind: "mutation",
17052
- auth: "admin"
17053
- }), method(object({ agentNodeId: string() }), object({
17123
+ })).readonly()), method(object({ agentNodeId: string() }), object({
17054
17124
  success: boolean(),
17055
17125
  removed: boolean()
17056
17126
  }), {
@@ -17082,7 +17152,18 @@ method(object({
17082
17152
  }), object({ success: literal(true) }), {
17083
17153
  kind: "mutation",
17084
17154
  auth: "admin"
17085
- }), method(object({ agentNodeId: string() }), object({
17155
+ }), method(object({
17156
+ agentNodeId: string(),
17157
+ inferenceDevices: record(string(), object({
17158
+ enabled: boolean(),
17159
+ weight: number().positive().optional(),
17160
+ maxSessions: number().int().positive().optional(),
17161
+ steps: record(string(), DeviceStepConfigSchema).optional()
17162
+ }))
17163
+ }), object({ success: literal(true) }), {
17164
+ kind: "mutation",
17165
+ auth: "admin"
17166
+ }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({ agentNodeId: string() }), object({
17086
17167
  success: literal(true),
17087
17168
  /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
17088
17169
  effectiveModelId: string().nullable(),
@@ -17098,9 +17179,10 @@ method(object({
17098
17179
  }), object({ success: literal(true) }), {
17099
17180
  kind: "mutation",
17100
17181
  auth: "admin"
17101
- }), method(object({ deviceId: number() }), record(string(), record(string(), CameraStepOverridePatchSchema)).nullable()), method(object({
17182
+ }), method(object({ deviceId: number() }), record(string(), record(string(), record(string(), CameraStepOverridePatchSchema))).nullable()), method(object({
17102
17183
  deviceId: number(),
17103
17184
  agentNodeId: string(),
17185
+ deviceKey: string(),
17104
17186
  addonId: string(),
17105
17187
  patch: CameraStepOverridePatchSchema.nullable()
17106
17188
  }), object({ success: literal(true) }), {
@@ -17252,7 +17334,8 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
17252
17334
  /** Explicit target version; omitted = latest from the registry. */
17253
17335
  version: string().optional() }), ServerUpdateActionResultSchema, {
17254
17336
  kind: "mutation",
17255
- auth: "admin"
17337
+ auth: "admin",
17338
+ timeoutMs: 16 * 6e4
17256
17339
  }), method(_void(), ServerUpdateActionResultSchema, {
17257
17340
  kind: "mutation",
17258
17341
  auth: "admin"
@@ -23351,12 +23434,6 @@ Object.freeze({
23351
23434
  addonId: null,
23352
23435
  access: "view"
23353
23436
  },
23354
- "pipelineExecutor.reprobeEngine": {
23355
- capName: "pipeline-executor",
23356
- capScope: "system",
23357
- addonId: null,
23358
- access: "create"
23359
- },
23360
23437
  "pipelineExecutor.runAudioTest": {
23361
23438
  capName: "pipeline-executor",
23362
23439
  capScope: "system",
@@ -23507,6 +23584,12 @@ Object.freeze({
23507
23584
  addonId: null,
23508
23585
  access: "view"
23509
23586
  },
23587
+ "pipelineOrchestrator.getNodeInferenceDevices": {
23588
+ capName: "pipeline-orchestrator",
23589
+ capScope: "system",
23590
+ addonId: null,
23591
+ access: "view"
23592
+ },
23510
23593
  "pipelineOrchestrator.getPipelineAssignment": {
23511
23594
  capName: "pipeline-orchestrator",
23512
23595
  capScope: "system",
@@ -23519,6 +23602,12 @@ Object.freeze({
23519
23602
  addonId: null,
23520
23603
  access: "view"
23521
23604
  },
23605
+ "pipelineOrchestrator.getPipelineDevicePin": {
23606
+ capName: "pipeline-orchestrator",
23607
+ capScope: "system",
23608
+ addonId: null,
23609
+ access: "view"
23610
+ },
23522
23611
  "pipelineOrchestrator.listAgentSettings": {
23523
23612
  capName: "pipeline-orchestrator",
23524
23613
  capScope: "system",
@@ -23561,19 +23650,19 @@ Object.freeze({
23561
23650
  addonId: null,
23562
23651
  access: "create"
23563
23652
  },
23564
- "pipelineOrchestrator.setAgentAddonDefaults": {
23653
+ "pipelineOrchestrator.setAgentCapabilities": {
23565
23654
  capName: "pipeline-orchestrator",
23566
23655
  capScope: "system",
23567
23656
  addonId: null,
23568
23657
  access: "create"
23569
23658
  },
23570
- "pipelineOrchestrator.setAgentCapabilities": {
23659
+ "pipelineOrchestrator.setAgentDetectWeight": {
23571
23660
  capName: "pipeline-orchestrator",
23572
23661
  capScope: "system",
23573
23662
  addonId: null,
23574
23663
  access: "create"
23575
23664
  },
23576
- "pipelineOrchestrator.setAgentDetectWeight": {
23665
+ "pipelineOrchestrator.setAgentInferenceDevices": {
23577
23666
  capName: "pipeline-orchestrator",
23578
23667
  capScope: "system",
23579
23668
  addonId: null,
@@ -23615,6 +23704,12 @@ Object.freeze({
23615
23704
  addonId: null,
23616
23705
  access: "create"
23617
23706
  },
23707
+ "pipelineOrchestrator.setPipelineDevicePin": {
23708
+ capName: "pipeline-orchestrator",
23709
+ capScope: "system",
23710
+ addonId: null,
23711
+ access: "create"
23712
+ },
23618
23713
  "pipelineOrchestrator.unassignAudio": {
23619
23714
  capName: "pipeline-orchestrator",
23620
23715
  capScope: "system",
@@ -25186,7 +25281,7 @@ var AdminUIAddon = class extends BaseAddon {
25186
25281
  capability: adminUiCapability,
25187
25282
  provider: {
25188
25283
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
25189
- getVersion: async () => ({ version: "1.1.61" })
25284
+ getVersion: async () => ({ version: "1.1.63" })
25190
25285
  }
25191
25286
  }];
25192
25287
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "CamStack Admin UI — Vite frontend build and server-side addon",
@@ -1 +0,0 @@
1
- import{Ct as e,Dt as t,Fa as n,Fr as r,Mt as i,Nt as a,Ot as o,Ra as s,St as c,Tt as l,Va as u,Vr as ee,_t as d,bt as f,g as p,gt as m,ht as h,jt as g,kt as _,m as v,mt as te,pt as ne,v as re,vt as ie,wt as y,yt as ae}from"./src-DP-u1HtQ.js";import{I as b,K as x,Q as S,R as oe,S as C,W as w,b as T,o as E,q as D,x as O,z as k}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{K as A}from"./src-Ck8eP0y_.js";import{p as se}from"./player-overlays-QWBHo29P.js";import{t as j}from"./clock-2ZdTSOML.js";import{t as M}from"./download-CHtMXSyD.js";import{t as ce}from"./plus-DaxL0ZPp.js";import{t as N}from"./refresh-cw-CPElSd1E.js";import{t as le}from"./search-sOe8umG9.js";import{t as P}from"./upload-D3TVf2zJ.js";import{I as F,J as ue,K as de,L as I,M as fe,S as L,W as R,g as z,i as B,m as pe,p as V,s as H}from"./index-BOnUkW6K.js";import{t as U}from"./AdminPage-BwmGKnRf.js";import{t as me}from"./NodeAddonsSettingsPanel-BYlipjiY.js";var he=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),W=R(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),G=R(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),K=R(`skip-forward`,[[`polygon`,{points:`5 4 15 12 5 20 5 4`,key:`16p6eg`}],[`line`,{x1:`19`,x2:`19`,y1:`5`,y2:`19`,key:`futhcm`}]]);S();var q=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),J=new Set([`done`,`failed`,`skipped`]);function Y(e){return!J.has(e.phase)&&!q.has(e.jobState)}function ge(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=q.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 _e(){let{data:e}=c({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=u(A.AddonsJobProgress,e=>e.job.jobId);return w(()=>{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 ge([...n.values()],Date.now())},[e,t])}var X={queued:{icon:j,cls:`bg-muted text-foreground-subtle`,label:`queued`},fetching:{icon:L,cls:`bg-primary/10 text-primary`,label:`fetching`,spin:!0},staged:{icon:L,cls:`bg-primary/10 text-primary`,label:`staged`,spin:!0},validating:{icon:L,cls:`bg-primary/10 text-primary`,label:`validating`,spin:!0},applying:{icon:L,cls:`bg-primary/10 text-primary`,label:`applying`,spin:!0},restarting:{icon:L,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,label:`restarting`,spin:!0},applied:{icon:L,cls:`bg-primary/10 text-primary`,label:`finalizing`,spin:!0},done:{icon:I,cls:`bg-success/10 text-success`,label:`updated`},failed:{icon:W,cls:`bg-danger/10 text-danger`,label:`failed`},skipped:{icon:K,cls:`bg-muted text-foreground-subtle`,label:`skipped`}};function ve({progress:e}){let t=X[e.phase],n=t.icon,r=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return C(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${t.cls}`,title:r,children:[O(n,{className:`w-2.5 h-2.5 ${t.spin?`animate-spin`:``}`}),t.label,C(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function ye({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:a,selectedVersion:o}){let s=n===`upload`||n===`local`,{data:c,isLoading:l}=ie({name:e});return C(`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:[C(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[O(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:`Versions`}),O(`button`,{type:`button`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:O(B,{className:`h-3 w-3`})})]}),s&&C(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[O(P,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),C(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[C(`span`,{className:`font-semibold`,children:[n===`upload`?`Uploaded copy`:`Local copy`,` in place.`]}),` `,`Re-install `,O(`span`,{className:`font-mono`,children:t}),` from npm to track upstream releases again.`]})]}),l&&C(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[O(L,{className:`h-3.5 w-3.5 animate-spin`}),`Loading versions...`]}),c&&O(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:c.map(e=>{let n=e.version===t,i=a!==void 0&&e.version===o,c=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),l=C(T,{children:[O(`span`,{className:`font-mono flex-1 text-left ${n?`text-primary font-semibold`:c?`text-amber-400`:`text-foreground`}`,children:e.version}),n&&O(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:`current`}),e.distTags.map(e=>O(`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&&O(`span`,{className:`text-[9px] text-red-400 line-through`,children:`deprecated`}),O(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return a?C(`button`,{type:`button`,"aria-label":`Select ${e.version}`,onClick:()=>a(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:[l,i?O(I,{className:`h-3 w-3 text-primary shrink-0`}):O(`span`,{className:`w-3 shrink-0`})]},e.version):C(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${n?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[l,n&&!s?O(I,{className:`h-3 w-3 text-primary shrink-0`}):O(`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?`Re-install ${e.version} from npm`:`Install ${e.version}`,children:O(M,{className:`h-3 w-3`})})]},e.version)})}),c&&c.length===0&&O(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:`No versions found`})]})}var be={queued:{icon:j,bg:`bg-muted text-foreground-subtle`,label:`queued`},updating:{icon:L,bg:`bg-primary/10 text-primary`,label:`updating`,spin:!0},"done-pending-restart":{icon:N,bg:`bg-amber-500/10 text-amber-700`,label:`pending restart`},done:{icon:I,bg:`bg-success/10 text-success`,label:`done`},failed:{icon:W,bg:`bg-danger/10 text-danger`,label:`failed`}};function xe({item:e}){let t=be[e.status],n=t.icon;return C(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${t.bg}`,title:e.error,children:[O(n,{className:`w-2.5 h-2.5 ${t.spin?`animate-spin`:``}`}),t.label]})}S();var Z=`device-export`;function Se(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===Z)}function Ce({isBundle:e,installSource:t,addonId:n,iconPath:r,color:i}){let[a,o]=D(!1),s=i?{backgroundColor:`${i.startsWith(`#`)?i:`#${i}`}26`}:void 0,c=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,l=n&&r?`/api/addon-assets/${n}/${r}`:null,u=!!l&&!a;return C(`div`,{className:`relative flex-shrink-0`,children:[O(`div`,{className:`h-9 w-9 rounded-lg flex items-center justify-center ${s?``:c}`,style:s,children:u?O(`img`,{src:l,alt:n,className:`h-5 w-5`,onError:()=>o(!0)}):O(e?G:z,{className:`h-4 w-4`})}),t===`local`&&O(`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`}),t===`npm`&&O(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:O(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:O(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),t===`upload`&&O(`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:O(P,{className:`h-2.5 w-2.5 text-white`})})]})}function we({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:a,onUpdate:o,onOpenPicker:s,children:c}){if(r)return C(`span`,{className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 shrink-0`,children:[O(L,{className:`h-3 w-3 animate-spin`}),`Updating…`]});if(t){let r=n??t;return C(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[o&&C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o()},disabled:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 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:`Update to ${r}`,children:[O(M,{className:`h-3 w-3`}),`Update`]}),C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:a,"aria-label":`Select version to install`,title:`Installed ${e} — update available. Selected ${r}; tap to choose another version.`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 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:[O(`span`,{className:`font-normal opacity-70`,children:e}),O(`span`,{className:`font-normal opacity-70`,children:`→`}),r,O(F,{className:`h-3 w-3`})]}),c]})}return C(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:a,className:[`inline-flex items-center gap-1 rounded-md px-2 py-1 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:`Version ${e} — tap to view all versions`,children:[e,O(F,{className:`h-3 w-3 opacity-50`})]}),c]})}function Te({addonId:e}){let t=E(),{data:n=`inherit`}=h({addonId:e}),r=_({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return O(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>O(`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))})}function Ee({addon:e,agents:r=[],clusterStatus:a,hideVersion:o,availableUpdate:s,onUpdate:c,isUpdating:u,jobProgress:ee,bundle:d,bulkItem:f,disabledByBulk:m,isSystem:h}){let[g,_]=D(!1),[te,ne]=D(!1),[ie,y]=D(!1),[b,x]=D(null);k(()=>{x(null)},[s]);let S=b??s,[oe,w]=D(!1),[A,j]=D(!1),[M,le]=D(`logs`),P=E(),ue=se(),I=de(),fe=n(),{manifest:L}=e,R=e.installedOn??[],z=!d&&!L.protected&&L.removable!==!1,U=!!d,K=d?.displayName??L.name,q=d?.packageName??L.packageName,J=d?.version??L.packageVersion??L.version,Y=d?.installSource??e.installSource,ge=d?d.bundle?.description??d.addons[0]?.manifest.description:L.description,_e=i({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]}),P.invalidateQueries({queryKey:[[`addonPages`]]}),P.invalidateQueries({queryKey:[[`capabilities`]]})}}),X=l({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]})}}),be=ae({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]}),P.invalidateQueries({queryKey:[[`addonPages`]]}),P.invalidateQueries({queryKey:[[`capabilities`]]}),P.invalidateQueries({queryKey:[[`integrations`]]})}}),Z=t({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]}),P.invalidateQueries({queryKey:[[`alerts`]]})}}),Q=e.health,De=Q?.phase===`failed`&&!Q.inGracePeriod,Oe=De&&Q?.nextRetryAt&&!Q.retrying;return C(`div`,{className:`rounded-lg border bg-surface overflow-hidden ${De?`border-red-500/50`:`border-border`}`,children:[De&&Q&&C(`div`,{className:`bg-danger/10 border-b border-danger/30 px-4 py-2.5 flex items-start gap-2.5`,children:[O(W,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),C(`div`,{className:`flex-1 min-w-0`,children:[C(`div`,{className:`text-xs font-semibold text-danger`,children:[`Failed to load (attempt #`,Q.retryCount,`)`]}),O(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Q.lastError?.message??`Unknown error`}),Oe&&Q.nextRetryAt&&C(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:[`Auto-retry at `,new Date(Q.nextRetryAt).toLocaleTimeString()]})]}),C(`button`,{type:`button`,disabled:Z.isPending||Q.retrying,onClick:e=>{e.stopPropagation(),Z.mutate({packageName:q})},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:`Reset retry counter and force immediate reload`,children:[O(N,{className:`h-3 w-3 ${Z.isPending||Q.retrying?`animate-spin`:``}`}),`Retry now`]})]}),C(`div`,{className:`flex items-start gap-3 px-4 py-3`,children:[O(Ce,{isBundle:U||!!L.components&&L.components.length>1,installSource:Y,addonId:U?d.addons[0]?.manifest.id:L.id,iconPath:U?d.bundle?.icon??d.addons[0]?.manifest.icon:L.icon,color:U?d.addons[0]?.manifest.color:L.color}),C(`div`,{className:`flex-1 min-w-0`,children:[C(`div`,{className:`flex items-start justify-between gap-2`,children:[O(`span`,{className:`text-sm font-semibold text-foreground truncate min-w-0`,children:K}),!o&&O(we,{version:J,availableUpdate:s,...S===void 0?{}:{selectedVersion:S},isUpdating:u,installSource:Y,disabled:m,...c&&S!==void 0?{onUpdate:()=>c(S)}:{},onOpenPicker:()=>y(e=>!e),children:ie&&O(ye,{packageName:q,currentVersion:J,...Y?{installSource:Y}:{},...s!==void 0&&S!==void 0?{selectedVersion:S,onSelect:e=>{x(e),y(!1)}}:{},onInstall:e=>{y(!1),be.mutate({packageName:q,version:e})},onClose:()=>y(!1)})})]}),C(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[q!==K&&O(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:q}),U&&C(`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:[O(G,{className:`h-3 w-3`}),d.addons.length]}),h&&C(`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:`System package — updating restarts the hub`,children:[O(N,{className:`h-3 w-3`}),`System`]}),f!=null&&O(xe,{item:f}),ee!=null&&O(ve,{progress:ee})]}),ge&&O(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:ge}),!U&&e.process&&C(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[O(`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`?`forked`:`in-process`}),e.process.pid!=null&&C(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),O(`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`:e.process.state===`crashed`||e.process.state===`failed`?`bg-red-500/15 text-red-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.state})]})]})]}),!U&&C(`div`,{className:`flex items-center gap-1 px-4 py-1.5 border-t border-border/50 bg-surface-hover/20`,children:[C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),X.mutate({addonId:L.id})},disabled:X.isPending||m,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 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:[O(N,{className:`h-3 w-3 ${X.isPending?`animate-spin`:``}`}),`Restart`]}),C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),w(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${oe?`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:[O(pe,{className:`h-3 w-3`}),`Logs`]}),!U&&C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),j(!0)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${A?`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:[O(V,{className:`h-3 w-3`}),`Settings`]}),O(`div`,{className:`flex-1`}),z&&C(`button`,{type:`button`,onClick:async e=>{e.stopPropagation(),await fe({title:`Uninstall ${L.name}?`,message:`This will remove the addon package and all its data. This action cannot be undone.`,confirmLabel:`Uninstall`,variant:`danger`})&&_e.mutate({packageName:L.packageName})},disabled:_e.isPending||m,className:`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`,children:[O(H,{className:`h-3 w-3`}),_e.isPending?`Removing...`:`Uninstall`]})]}),a&&a.nodes.length>1&&!U&&C(`div`,{className:`border-t border-border px-4 py-2 bg-muted/10`,children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:`Cluster Deployment`}),O(`div`,{className:`space-y-1`,children:a.nodes.map(e=>C(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[O(`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`}`}),O(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),O(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&O(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:`outdated`}),e.status===`offline`&&O(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:`offline`}),e.synced&&e.status!==`offline`&&O(`span`,{className:`text-[9px] text-success`,children:`synced`})]},e.nodeId))})]}),oe&&!U&&C(`div`,{className:`border-t border-border`,children:[C(`div`,{className:`flex items-center px-4 py-1 bg-surface-hover/20 border-b border-border/50`,children:[C(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[O(`button`,{type:`button`,onClick:()=>le(`logs`),className:`px-2 py-0.5 transition-colors ${M===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:`Logs`}),O(`button`,{type:`button`,onClick:()=>le(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${M===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:`Events`})]}),O(`div`,{className:`flex-1`}),O(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),w(!1)},className:`text-foreground-subtle hover:text-foreground`,children:O(B,{className:`h-3.5 w-3.5`})})]}),M===`logs`&&O(p,{addonId:L.id,maxHeight:`max-h-64`,showFilters:!1}),M===`events`&&O(v,{addonId:L.id,category:`addon.*`,maxHeight:`max-h-64`})]}),U&&C(T,{children:[O(`button`,{type:`button`,onClick:()=>_(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:O(g?he:F,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),g&&O(`div`,{className:`border-t border-border px-3 py-2 space-y-2`,children:d.addons.map(e=>O(Ee,{addon:e,agents:r,hideVersion:!0},e.manifest.id))})]}),A&&!U&&O(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4`,onClick:()=>j(!1),children:C(`div`,{className:`w-full max-w-lg max-h-[80vh] rounded-xl border border-border bg-surface shadow-2xl flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[C(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-border flex-shrink-0`,children:[C(`div`,{className:`flex items-center gap-2`,children:[O(V,{className:`h-4 w-4 text-primary`}),C(`h2`,{className:`text-sm font-semibold text-foreground`,children:[K,` Settings`]})]}),O(`button`,{onClick:()=>j(!1),className:`text-foreground-subtle hover:text-foreground transition-colors p-1 rounded`,children:O(B,{className:`h-4 w-4`})})]}),C(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-4`,children:[O(me,{nodeId:`hub`,addonIds:[L.id],level:`global`}),Se(L)&&C(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Device export`}),O(re,{addonId:L.id,trpc:ue.trpcClient,onOpenDevice:e=>I(`/devices/${e}`)})]}),Y===`npm`&&C(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Auto-Update`}),O(Te,{addonId:L.id})]}),L.components&&L.components.length>0&&C(`div`,{children:[C(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:[`Components (`,L.components.length,`)`]}),O(`div`,{className:`flex flex-wrap gap-1`,children:L.components.map(e=>O(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]}),r.length>=2&&C(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Installed on`}),C(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[R.length===0&&O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Hub (local)`}),R.map(e=>O(`span`,{className:`rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle`,children:e},e)),C(`div`,{className:`relative`,children:[C(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),ne(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:`Install on more agents`,children:[O(ce,{className:`h-3 w-3`}),`Add agent`]}),te&&C(`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:[r.filter(e=>!e.isHub&&!R.includes(e.name)).map(e=>O(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),ne(!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)),r.filter(e=>!e.isHub&&!R.includes(e.name)).length===0&&O(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle`,children:`No available agents`})]})]})]})]})]}),O(`div`,{className:`flex items-center justify-end px-5 py-3 border-t border-border flex-shrink-0`,children:O(`button`,{type:`button`,onClick:()=>j(!1),className:`rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,children:`Close`})})]})})]})}S();var Q=`.tgz,.tar.gz,.zip`;function De({onUploadSuccess:e}){let[t,n]=D(!1),r=x(null),i=b(async t=>{n(!0);let r=new FormData;r.append(`file`,t);let i=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(`/api/addons/upload`,{method:`POST`,headers:{Authorization:`Bearer ${i}`},body:r})).json()).success&&e()}finally{n(!1)}},[e]);return C(T,{children:[O(`input`,{ref:r,type:`file`,accept:Q,onChange:b(e=>{let t=e.target.files?.[0];t&&i(t),e.target.value=``},[i]),className:`hidden`}),C(`button`,{type:`button`,onClick:()=>r.current?.click(),disabled:t,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:[t?O(L,{className:`w-3.5 h-3.5 animate-spin`}):O(P,{className:`w-3.5 h-3.5`}),t?`Uploading...`:`Upload`]})]})}S();var Oe=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/shm-ring`,`@camstack/ui-library`]);function ke(e){return e!==void 0&&Oe.has(e)}function Ae(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function je(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`}: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 Me(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 Ne({addons:t,clusterStatus:r,selectedNode:i,onRefresh:s,isRefreshing:c}){let l=E(),[u,ee]=D(``),f=oe(u),[p,h]=D(!1),_=x(null);k(()=>{if(!p)return;let e=e=>{_.current&&!_.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]);let{data:v}=e({nodeId:i.id}),te=w(()=>{let e=new Map;for(let t of v??[])e.set(t.name,t.latestVersion);return e},[v]),re=w(()=>(v??[]).filter(e=>!e.isSystem).length,[v]),[ie,y]=D(()=>new Set),[S,T]=D(()=>new Map),A=b(e=>{y(t=>new Set(t).add(e))},[]),se=b(e=>{y(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),j=b((e,t)=>{T(n=>new Map(n).set(e,t))},[]),ce=b(e=>{T(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),P=a({onMutate:e=>{A(e.name),ce(e.name)},onSuccess:(e,t)=>{se(t.name);let n=e;if(n&&n.success===!1){j(t.name,n.error??`Update failed (no error message returned by server)`);return}l.invalidateQueries({queryKey:[[`addons`]]}),l.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{se(t.name),j(t.name,e instanceof Error?e.message:String(e))}}),F=_e(),de=x(new Set);k(()=>{let e=new Set;for(let[t,n]of F)Y(n)&&e.add(t);let t=[...de.current].some(t=>!e.has(t));de.current=e,t&&(l.invalidateQueries({queryKey:[[`addons`]]}),l.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[F,l]);let{data:R}=m(void 0),z=ne({onSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:B,isFetching:pe}=o({query:f||void 0},{enabled:p}),V=g(),{data:H}=d(void 0),U=H?.requestedAt,[me,he]=D(null),[W,G]=D(!1);k(()=>{if(H?.kind===`framework-bulk-update`&&H.requestedAt!==me){he(H.requestedAt),G(!0);let e=window.setTimeout(()=>G(!1),6e3);return()=>window.clearTimeout(e)}},[U,me,H]),n();let K=b(async()=>{let e=(v??[]).filter(e=>!e.isSystem);e.length!==0&&await V.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[i.id]})},[v,i.id,V]),q=ae({onSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`]]}),l.invalidateQueries({queryKey:[[`addonPages`]]}),l.invalidateQueries({queryKey:[[`capabilities`]]}),l.invalidateQueries({queryKey:[[`integrations`]]})}}),[J,ge]=D(`type`),[X,ve]=D(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),ye=e=>{ve(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[be,xe]=ue(),Z=be.get(`capability`),Se=w(()=>{let e=t.filter(e=>!ke(e.manifest.packageName));return i.isHub||(e=e.filter(e=>Ae(e.placement,i.isHub))),Z&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===Z))),e},[t,i.isHub,Z]),Ce=()=>{let e=new URLSearchParams(be);e.delete(`capability`),xe(e,{replace:!0})},we=X===`flat`?Se:Me(Se),Te=w(()=>{let e=[...we];switch(J){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},[we,J]);return C(`div`,{className:`space-y-4`,children:[[...S.entries()].map(([e,t])=>O(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-3 py-2 text-[11px]`,children:C(`div`,{className:`flex items-start justify-between gap-3`,children:[C(`div`,{className:`space-y-0.5`,children:[C(`div`,{className:`font-medium text-danger`,children:[`Failed to update `,e]}),O(`div`,{className:`text-foreground-subtle font-mono`,children:t})]}),O(`button`,{type:`button`,onClick:()=>ce(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:`dismiss`})]})},e)),C(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[C(`div`,{className:`flex items-center gap-1.5`,children:[O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Sort:`}),C(`select`,{value:J,onChange:e=>ge(e.target.value),className:`rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] text-foreground focus:outline-none focus:border-primary/50`,children:[O(`option`,{value:`type`,children:`Bundles first`}),O(`option`,{value:`name`,children:`Name`}),O(`option`,{value:`source`,children:`Install source`})]})]}),C(`div`,{className:`flex items-center gap-1.5`,children:[O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`View:`}),O(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>O(`button`,{type:`button`,onClick:()=>ye(e),className:`px-2.5 py-1.5 transition-colors capitalize ${X===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?`Group multi-addon packages into a bundle card`:`Show every addon as its own card`,children:e},e))})]}),i.isHub&&C(`div`,{className:`flex items-center gap-1.5`,children:[O(N,{className:`h-3 w-3 text-foreground-subtle`}),O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Auto-Update:`}),O(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>O(`button`,{type:`button`,onClick:()=>z.mutate({channel:e}),disabled:z.isPending,className:`px-2.5 py-1.5 transition-colors capitalize ${R?.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))})]}),re>0&&C(`button`,{type:`button`,onClick:()=>void K(),disabled:V.isPending,className:`flex items-center gap-1.5 px-2.5 py-1.5 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:[V.isPending?O(L,{className:`w-3 h-3 animate-spin`}):O(M,{className:`w-3 h-3`}),V.isPending?`Updating…`:`Update All (${re})`]}),C(`button`,{type:`button`,onClick:s,disabled:c||V.isPending,className:`flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[O(N,{className:`w-3 h-3 ${c?`animate-spin`:``}`}),`Refresh`]})]}),C(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[C(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:_,children:[O(le,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle`}),O(`input`,{type:`text`,value:u,onChange:e=>{ee(e.target.value),h(!0)},onFocus:()=>h(!0),placeholder:`Search addons on npm...`,disabled:V.isPending,className:`w-full rounded-lg border border-border bg-background pl-9 pr-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed`}),pe&&O(L,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 h-3 w-3 text-foreground-subtle animate-spin`}),p&&B&&B.length>0&&C(`div`,{className:`absolute left-0 right-0 top-full mt-1 z-40 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,children:[B.length>0&&C(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:[`npm results (`,B.length,`)`]}),B&&B.length>0&&O(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:B.map(e=>C(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[O(`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()}),C(`div`,{className:`flex-1 min-w-0`,children:[C(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[O(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),C(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),O(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&O(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?C(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-emerald-500/30 bg-emerald-500/10 text-emerald-400 shrink-0`,children:[O(I,{className:`h-3 w-3`}),e.installedVersion??`Installed`]}):C(`button`,{type:`button`,onClick:()=>q.mutate({packageName:e.name}),disabled:q.isPending,className:`inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors shrink-0`,children:[q.isPending?O(L,{className:`h-3 w-3 animate-spin`}):O(M,{className:`h-3 w-3`}),`Install`]})]},e.name))})]})]}),O(De,{onUploadSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`]]}),s()}})]}),Z&&C(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-lg bg-primary/10 border border-primary/30 text-sm`,children:[O(`span`,{className:`text-foreground-subtle`,children:`Filtering by capability:`}),O(`span`,{className:`font-mono text-primary font-semibold`,children:Z}),O(`button`,{type:`button`,onClick:Ce,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:`Clear`})]}),W&&C(`div`,{className:`fixed top-4 right-4 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:[O(fe,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),C(`div`,{children:[O(`div`,{className:`text-[11px] font-semibold text-foreground`,children:`Bulk update completed`}),O(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:`System packages updated — hub restarted successfully.`})]})]}),Se.length===0&&O(`div`,{className:`text-xs text-foreground-subtle`,children:t.length===0?`No addons installed`:Z?`No installed addons declare the "${Z}" capability. Browse the npm catalog above to find a compatible addon.`:`No addons compatible with ${i.name} (placement filter active)`}),O(`div`,{className:`space-y-2`,children:Te.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=te.get(t),a=$(e)?e.representative:e,o=n?e=>P.mutate({name:t,version:e,nodeId:i.id}):void 0,s=F.get(t)??null,c=s!==null&&Y(s);return O(Ee,{addon:a,clusterStatus:r?.[a.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,isUpdating:ie.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:V.isPending},$(e)?t:e.manifest.id)})})]})}function Pe(){let e=E(),{data:t,isLoading:n,isError:i}=f(),{data:a}=r(void 0),{data:o}=ee(void 0,{refetchInterval:1e4}),c=w(()=>{let e=new Map;e.set(`hub`,{id:`hub`,name:`Hub`,isHub:!0});for(let t of o??[]){let n=String(t.id??``);n&&e.set(n,{id:n,name:String(t.name??n),isHub:!!t.isHub})}return[...e.values()]},[o]),[l,u]=D(`hub`),d=c.find(e=>e.id===l)??c[0],p=te(),m=y(),h=p.isPending||m.isPending,g=async()=>{await p.mutateAsync({nodeId:l}),await m.mutateAsync(),e.invalidateQueries({queryKey:[[`addons`]]})},_=x(p);_.current=p,k(()=>{_.current.mutate({nodeId:`hub`})},[]);let v=(t??[]).map(je).filter(e=>e!==null);return C(U,{children:[C(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[O(s,{selectedNodeId:l,onSelect:u}),C(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[!n&&!i&&C(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:[v.length,` installed`]}),C(`button`,{type:`button`,onClick:()=>void g(),disabled:h,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:`Re-fetch addons + check npm for new versions`,children:[O(N,{className:`w-3 h-3 ${h?`animate-spin`:``}`}),`Check for updates`]})]})]}),!d.isHub&&C(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 px-3 py-2 text-[11px] text-foreground-subtle`,children:[`Showing only addons compatible with`,` `,O(`span`,{className:`font-medium text-foreground`,children:d.name}),` — agents only run`,` `,O(`code`,{className:`font-mono`,children:`agent-only`}),` and`,` `,O(`code`,{className:`font-mono`,children:`any-node`}),` addons. Install / uninstall is hub-driven; agents auto-sync from the hub.`]}),n&&O(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading…`}),i&&O(`div`,{className:`text-xs text-danger`,children:`Failed to load addons`}),!n&&!i&&O(Ne,{addons:v,clusterStatus:a,selectedNode:d,onRefresh:()=>void g(),isRefreshing:h})]})}export{Pe as AddonsPage};