@camstack/addon-admin-ui 1.1.47 → 1.1.49
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/{AddLocationWizard-Ja3EFJLM.js → AddLocationWizard-Dz9GwK3X.js} +1 -1
- package/dist/assets/{AddonCollectionPage-DarnvrBW.js → AddonCollectionPage-CPIG1xIh.js} +1 -1
- package/dist/assets/Addons-BVoEWQqv.js +1 -0
- package/dist/assets/{AdminTabs-CAcc6cMo.js → AdminTabs-D5g4I7it.js} +1 -1
- package/dist/assets/{BrokerForm-B3T_wC8B.js → BrokerForm-BR4xZ9GV.js} +1 -1
- package/dist/assets/{Capabilities-heWYOejs.js → Capabilities-CgH6yyV4.js} +1 -1
- package/dist/assets/{CapabilityBadges-BwulGeU7.js → CapabilityBadges-DTQZ0aly.js} +1 -1
- package/dist/assets/{Cluster-Cztf4fk8.js → Cluster-Dc8m2Nu_.js} +1 -1
- package/dist/assets/{Dashboard-Bf4EbvYA.js → Dashboard-BGWor0uh.js} +1 -1
- package/dist/assets/{Data-B_7DwGv9.js → Data-Cb4_Oaed.js} +1 -1
- package/dist/assets/DetectionIntelligence-CfZ37xjp.js +1 -0
- package/dist/assets/DeviceDetail-BkHwKCpH.js +2 -0
- package/dist/assets/{Devices-CBtOs7sm.js → Devices-CQIttH5I.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-ilPK8vT0.js → EmbedPlayerPage-C1yR1-sh.js} +1 -1
- package/dist/assets/{FormBuilder-DmAaqS0P.js → FormBuilder-CvDRhN0P.js} +1 -1
- package/dist/assets/Identity-DGjKIPeq.js +1 -0
- package/dist/assets/IntegrationDetail-CrkNK-Hf.js +1 -0
- package/dist/assets/{Integrations-C1OT7Ojq.js → Integrations-CpvCTW8-.js} +1 -1
- package/dist/assets/{Integrations-DL6LKL4J.js → Integrations-D8q33Wah.js} +1 -1
- package/dist/assets/{Logs-DkJkJGxW.js → Logs-BRxaQ_U_.js} +1 -1
- package/dist/assets/{MotionZonesSettings-DL55VLbI.js → MotionZonesSettings-rCwGI64Z.js} +1 -1
- package/dist/assets/{MyAccess-CBeAjiv_.js → MyAccess-CkYg7_Ir.js} +1 -1
- package/dist/assets/Network-CFnhAtCA.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-B-nngyAf.js → NodeAddonsSettingsPanel-DLaqbqbL.js} +1 -1
- package/dist/assets/{NotificationTargets-TIsi38-I.js → NotificationTargets-D29cZR2T.js} +1 -1
- package/dist/assets/Pipeline-V9nILBzv.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-8aXddQXv.js → PrivacyMaskSettings-DXSWRyvI.js} +1 -1
- package/dist/assets/{ProviderIcon-BHB6sXAt.js → ProviderIcon-CU_LjfQm.js} +1 -1
- package/dist/assets/{ScanNetworkModal-DrMdqNIo.js → ScanNetworkModal-P7eJ4JF2.js} +1 -1
- package/dist/assets/{ServerManagement-Dk3DE_WG.js → ServerManagement-Bu1zXR_P.js} +1 -1
- package/dist/assets/{Settings-M_kT8ySJ.js → Settings-CEmGDN3Y.js} +1 -1
- package/dist/assets/{Showroom-DKOjUcCg.js → Showroom-nfSg2aKy.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D33LJRoa.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Dks9ZX4F.js} +1 -1
- package/dist/assets/{build-cluster-graph-U096JDKn.js → build-cluster-graph-CeRMttjo.js} +2 -2
- package/dist/assets/circle-check-big-Dqebmb1c.js +1 -0
- package/dist/assets/{copy-CzLPrafW.js → copy-CBUp-aR5.js} +1 -1
- package/dist/assets/dist-Drk1jDUF.js +7 -0
- package/dist/assets/{dist-BqJ4ODEV.js → dist-buVqWnnL.js} +1 -1
- package/dist/assets/{download-pveeJDxf.js → download-CYT0fAUg.js} +1 -1
- package/dist/assets/{hostInit-Dum3X3mF.js → hostInit-Bk1ezl81.js} +1 -1
- package/dist/assets/index-BFJ6KO0x.css +2 -0
- package/dist/assets/index-DS1f1ju4.js +4 -0
- package/dist/assets/{key-round-Cgd91f3y.js → key-round-BgzoboJl.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-5691f327.js → mf-entry-bootstrap-0-9540ab68.js} +2 -2
- package/dist/assets/{pencil-DRjwER9e.js → pencil-BQxsIcr8.js} +1 -1
- package/dist/assets/{player-overlays-BjWq4Lsw.js → player-overlays-DwbK2Bhn.js} +1 -1
- package/dist/assets/plus-CqKOQ1Hi.js +1 -0
- package/dist/assets/{radio-Dil4Ibsx.js → radio-BO71WGgk.js} +1 -1
- package/dist/assets/{refresh-cw-Deh_KPTo.js → refresh-cw-wjVnPKQ-.js} +1 -1
- package/dist/assets/remoteEntry-8u5R_pK8.js +1 -0
- package/dist/assets/{rotate-ccw-B87yFCCj.js → rotate-ccw-08G_t-S-.js} +1 -1
- package/dist/assets/rotate-cw-bd1bkxca.js +1 -0
- package/dist/assets/search-Cuq_Otgb.js +1 -0
- package/dist/assets/{sparkles-BpXfWQIN.js → sparkles-AJHBDXs0.js} +1 -1
- package/dist/assets/square-B8TB8cnk.js +1 -0
- package/dist/assets/{square-check-big-eVWC31kd.js → square-check-big-vHolvNm8.js} +1 -1
- package/dist/assets/src-Bt1nDoRU.js +7 -0
- package/dist/assets/src-DdAjHIAX.js +67 -0
- package/dist/assets/{upload-CfFD_PUi.js → upload-BzEvIjFG.js} +1 -1
- package/dist/assets/{useDevice-u2EdLcQq.js → useDevice-DsFNX4hK.js} +1 -1
- package/dist/assets/{useEventInvalidation-DEG6y8gC.js → useEventInvalidation-sogITDGH.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-qa0QFz07.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DaYJFh3Y.js} +2 -2
- package/dist/assets/{wifi-Dnk9IQ1K.js → wifi-D2DUPSjR.js} +1 -1
- package/dist/assets/{zap-8_HIF5GC.js → zap-DpaieZgs.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/server/addon.js +125 -9
- package/package.json +1 -1
- package/dist/assets/Addons-DEUDLZZU.js +0 -1
- package/dist/assets/DetectionIntelligence-sFokINqt.js +0 -1
- package/dist/assets/DeviceDetail-Dihuj9Ih.js +0 -2
- package/dist/assets/Identity-CapaLyHC.js +0 -1
- package/dist/assets/IntegrationDetail-DO7HjLBW.js +0 -1
- package/dist/assets/Network-D_FxKVCf.js +0 -1
- package/dist/assets/Pipeline-CfULuDgZ.js +0 -1
- package/dist/assets/circle-check-big-BgUVBcnB.js +0 -1
- package/dist/assets/dist-bNuNFLZO.js +0 -7
- package/dist/assets/index-BXn17UrG.css +0 -2
- package/dist/assets/index-Cs4056Il.js +0 -4
- package/dist/assets/plus-BUOkx72I.js +0 -1
- package/dist/assets/remoteEntry-C23sPYAV.js +0 -1
- package/dist/assets/rotate-cw-1kDV0Jj3.js +0 -1
- package/dist/assets/search-DXf7ROHt.js +0 -1
- package/dist/assets/square-7B5ghrYh.js +0 -1
- package/dist/assets/src-PqKMUhAl.js +0 -7
- package/dist/assets/src-nTmr96zw.js +0 -67
package/dist/server/addon.js
CHANGED
|
@@ -4629,7 +4629,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4629
4629
|
return inst;
|
|
4630
4630
|
}
|
|
4631
4631
|
//#endregion
|
|
4632
|
-
//#region ../types/dist/sleep-
|
|
4632
|
+
//#region ../types/dist/sleep-BC9Yqte7.mjs
|
|
4633
4633
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4634
4634
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4635
4635
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6733,6 +6733,18 @@ function method(input, output, options) {
|
|
|
6733
6733
|
timeoutMs: options?.timeoutMs
|
|
6734
6734
|
};
|
|
6735
6735
|
}
|
|
6736
|
+
/**
|
|
6737
|
+
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
6738
|
+
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
6739
|
+
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
6740
|
+
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
6741
|
+
*/
|
|
6742
|
+
function systemMethod(input, output, options) {
|
|
6743
|
+
return {
|
|
6744
|
+
...method(input, output, options),
|
|
6745
|
+
systemOnly: true
|
|
6746
|
+
};
|
|
6747
|
+
}
|
|
6736
6748
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
6737
6749
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
6738
6750
|
var adminUiCapability = {
|
|
@@ -10480,6 +10492,7 @@ var PipelineAddonSchemaSchema = object({
|
|
|
10480
10492
|
defaultModelId: string(),
|
|
10481
10493
|
defaultModelIdByFormat: record(string(), string()).optional(),
|
|
10482
10494
|
enabledByDefault: boolean().optional(),
|
|
10495
|
+
backfillIntoExistingOverrides: boolean().optional(),
|
|
10483
10496
|
defaultConfidence: number(),
|
|
10484
10497
|
group: string().optional(),
|
|
10485
10498
|
configSchema: array(ConfigFieldBridge).readonly().optional()
|
|
@@ -10786,6 +10799,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(ZoneSchema).read
|
|
|
10786
10799
|
auth: "admin"
|
|
10787
10800
|
}), object({ zones: array(ZoneSchema).readonly() });
|
|
10788
10801
|
/**
|
|
10802
|
+
* A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
|
|
10803
|
+
* decode worker resolves it against the RETAINED native frame's real pixel dims,
|
|
10804
|
+
* so the caller supplies only the detection-res bbox divided by the detection
|
|
10805
|
+
* dims — no native resolution to plumb.
|
|
10806
|
+
*/
|
|
10807
|
+
var NativeCropBboxSchema = object({
|
|
10808
|
+
x: number(),
|
|
10809
|
+
y: number(),
|
|
10810
|
+
w: number(),
|
|
10811
|
+
h: number()
|
|
10812
|
+
});
|
|
10813
|
+
/** Result of a best-effort native-resolution crop (`getNativeCrop`). */
|
|
10814
|
+
var NativeCropResultSchema = object({
|
|
10815
|
+
/** Packed rgb (24-bit) pixels of the crop. */
|
|
10816
|
+
bytes: _instanceof(Uint8Array),
|
|
10817
|
+
width: number().int().positive(),
|
|
10818
|
+
height: number().int().positive()
|
|
10819
|
+
});
|
|
10820
|
+
/**
|
|
10789
10821
|
* Per-camera tunable ranges + defaults. Single source of truth used
|
|
10790
10822
|
* by both the Zod data schema (validation + default fallback) and
|
|
10791
10823
|
* the device settings UI (slider min/max/step). Touch one place and
|
|
@@ -11041,7 +11073,11 @@ var RunnerLocalMetricsSchema = object({
|
|
|
11041
11073
|
avgInferenceTimeMs: number(),
|
|
11042
11074
|
queueDepth: number()
|
|
11043
11075
|
});
|
|
11044
|
-
method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly())
|
|
11076
|
+
method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
|
|
11077
|
+
handle: FrameHandleSchema,
|
|
11078
|
+
bbox: NativeCropBboxSchema,
|
|
11079
|
+
maxWidth: number().int().positive().optional()
|
|
11080
|
+
}), NativeCropResultSchema.nullable());
|
|
11045
11081
|
object({
|
|
11046
11082
|
detected: boolean(),
|
|
11047
11083
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
@@ -15079,7 +15115,17 @@ var TrackSchema = object({
|
|
|
15079
15115
|
/** Cumulative normalized distance travelled (0..1 units = full frame width). */
|
|
15080
15116
|
totalDistance: number(),
|
|
15081
15117
|
state: TrackStateSchema,
|
|
15082
|
-
active: boolean()
|
|
15118
|
+
active: boolean(),
|
|
15119
|
+
/** Deterministic key-event importance score in [0,1] (server-computed at
|
|
15120
|
+
* track expiry, recomputed on late label). Absent on legacy rows written
|
|
15121
|
+
* before scoring shipped — consumers degrade to absence / compute-on-read. */
|
|
15122
|
+
importance: number().optional(),
|
|
15123
|
+
/** Id of the track's highest-confidence ObjectEvent (its representative
|
|
15124
|
+
* "best" frame). Absent when the track produced no object events. */
|
|
15125
|
+
bestEventId: string().optional(),
|
|
15126
|
+
/** Tag of the importance sub-signal that dominated the score
|
|
15127
|
+
* (identity|dwell|proximity|class|confidence|travel|zone). */
|
|
15128
|
+
importanceReason: string().optional()
|
|
15083
15129
|
});
|
|
15084
15130
|
var BaseEventFields = {
|
|
15085
15131
|
id: string(),
|
|
@@ -15144,8 +15190,18 @@ var ObjectEventSchema = object({
|
|
|
15144
15190
|
frameHeight: number().optional(),
|
|
15145
15191
|
/** MediaStore key for the crop attached to this event (if any). */
|
|
15146
15192
|
mediaKey: string().optional(),
|
|
15193
|
+
/** Design B: MediaStore key of the track's native-resolution key frame (the
|
|
15194
|
+
* best-detection full frame). Resolve via the event-media data-plane
|
|
15195
|
+
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
|
|
15196
|
+
* draws `bbox` over the native frame. Absent on legacy rows / non-decoded
|
|
15197
|
+
* sources — consumers fall back to `mediaKey` (the tight crop). */
|
|
15198
|
+
keyFrameMediaKey: string().optional(),
|
|
15147
15199
|
/** Populated by B5 (recording playback URL for this event). */
|
|
15148
|
-
mediaUrl: string().optional()
|
|
15200
|
+
mediaUrl: string().optional(),
|
|
15201
|
+
/** The parent track's key-event importance [0,1], propagated to every object
|
|
15202
|
+
* event of the track (so an event row can be sorted by importance without a
|
|
15203
|
+
* track join). Absent on legacy rows / before the track was scored. */
|
|
15204
|
+
importance: number().optional()
|
|
15149
15205
|
});
|
|
15150
15206
|
var AudioEventSchema = object({
|
|
15151
15207
|
...BaseEventFields,
|
|
@@ -15169,7 +15225,8 @@ var MediaFileKindEnum = _enum([
|
|
|
15169
15225
|
"fullFrame",
|
|
15170
15226
|
"fullFrameBoxed",
|
|
15171
15227
|
"faceCrop",
|
|
15172
|
-
"plateCrop"
|
|
15228
|
+
"plateCrop",
|
|
15229
|
+
"keyFrame"
|
|
15173
15230
|
]);
|
|
15174
15231
|
var MediaFileSchema = object({
|
|
15175
15232
|
key: string(),
|
|
@@ -15190,6 +15247,32 @@ var DeviceEventQueryInput = object({
|
|
|
15190
15247
|
projection: _enum(["full", "slim"]).optional()
|
|
15191
15248
|
});
|
|
15192
15249
|
var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
|
|
15250
|
+
var KeyEventQueryInput = object({
|
|
15251
|
+
deviceId: number(),
|
|
15252
|
+
/** Window lower bound (track firstSeen ≥ since). */
|
|
15253
|
+
since: number(),
|
|
15254
|
+
/** Window upper bound (track firstSeen ≤ until). */
|
|
15255
|
+
until: number(),
|
|
15256
|
+
limit: number().int().min(1).max(200).default(50),
|
|
15257
|
+
/** Drop tracks scoring below this importance. */
|
|
15258
|
+
minImportance: number().min(0).max(1).optional(),
|
|
15259
|
+
/** Restrict to a single class (e.g. 'person'). */
|
|
15260
|
+
classFilter: string().optional()
|
|
15261
|
+
});
|
|
15262
|
+
var KeyEventSchema = object({
|
|
15263
|
+
/** The representative event id (the track's best ObjectEvent, else its trackId). */
|
|
15264
|
+
id: string(),
|
|
15265
|
+
trackId: string(),
|
|
15266
|
+
/** Track start time (firstSeen). */
|
|
15267
|
+
timestamp: number(),
|
|
15268
|
+
className: string(),
|
|
15269
|
+
label: string().optional(),
|
|
15270
|
+
importance: number(),
|
|
15271
|
+
/** Highest-confidence ObjectEvent id for the track (empty when none). */
|
|
15272
|
+
bestEventId: string(),
|
|
15273
|
+
/** Track lifetime in ms (lastSeen - firstSeen). */
|
|
15274
|
+
windowMs: number().optional()
|
|
15275
|
+
});
|
|
15193
15276
|
var TrackedDetectionSchema = object({
|
|
15194
15277
|
trackId: string(),
|
|
15195
15278
|
className: string(),
|
|
@@ -15219,7 +15302,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
15219
15302
|
}), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
|
|
15220
15303
|
kind: "mutation",
|
|
15221
15304
|
auth: "admin"
|
|
15222
|
-
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({
|
|
15305
|
+
}), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
|
|
15223
15306
|
deviceId: number(),
|
|
15224
15307
|
since: number(),
|
|
15225
15308
|
until: number(),
|
|
@@ -15986,7 +16069,12 @@ DeviceType.Camera, method(object({
|
|
|
15986
16069
|
}), SnapshotImageSchema.nullable()), method(object({ deviceId: number() }), _void(), {
|
|
15987
16070
|
kind: "mutation",
|
|
15988
16071
|
auth: "admin"
|
|
15989
|
-
})
|
|
16072
|
+
}), systemMethod(object({ deviceIds: array(number()).min(1).max(200) }), array(object({
|
|
16073
|
+
deviceId: number(),
|
|
16074
|
+
lastCapturedAt: number().nullable(),
|
|
16075
|
+
cacheAgeMs: number().nullable(),
|
|
16076
|
+
etag: string().nullable()
|
|
16077
|
+
})));
|
|
15990
16078
|
/**
|
|
15991
16079
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
15992
16080
|
* providers (OIDC, SAML, magic-link, …) mint an HMAC-signed token
|
|
@@ -17131,7 +17219,17 @@ var FaceInfoSchema = object({
|
|
|
17131
17219
|
recognizedIdentityId: string().optional(),
|
|
17132
17220
|
identityName: string().optional(),
|
|
17133
17221
|
assigned: boolean(),
|
|
17134
|
-
base64: string().optional()
|
|
17222
|
+
base64: string().optional(),
|
|
17223
|
+
/** Design B: the face bbox (pixel space) on the key frame — lets a detail
|
|
17224
|
+
* view draw the box over the native `keyFrameMediaKey` frame. Absent on
|
|
17225
|
+
* legacy rows written before design B. */
|
|
17226
|
+
faceBbox: BoundingBoxSchema.optional(),
|
|
17227
|
+
/** Design B: MediaStore key of the track's native-resolution key frame.
|
|
17228
|
+
* Fetch the native JPEG via the event-media data-plane
|
|
17229
|
+
* (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
|
|
17230
|
+
* track produced no key frame (e.g. native/onboard source) — the UI falls
|
|
17231
|
+
* back to the inline `base64` face crop. */
|
|
17232
|
+
keyFrameMediaKey: string().optional()
|
|
17135
17233
|
});
|
|
17136
17234
|
var FaceFilterEnum = _enum([
|
|
17137
17235
|
"unassigned",
|
|
@@ -21250,6 +21348,12 @@ Object.freeze({
|
|
|
21250
21348
|
addonId: null,
|
|
21251
21349
|
access: "view"
|
|
21252
21350
|
},
|
|
21351
|
+
"pipelineAnalytics.getKeyEvents": {
|
|
21352
|
+
capName: "pipeline-analytics",
|
|
21353
|
+
capScope: "device",
|
|
21354
|
+
addonId: null,
|
|
21355
|
+
access: "view"
|
|
21356
|
+
},
|
|
21253
21357
|
"pipelineAnalytics.getMotionEvents": {
|
|
21254
21358
|
capName: "pipeline-analytics",
|
|
21255
21359
|
capScope: "device",
|
|
@@ -21778,6 +21882,12 @@ Object.freeze({
|
|
|
21778
21882
|
addonId: null,
|
|
21779
21883
|
access: "view"
|
|
21780
21884
|
},
|
|
21885
|
+
"pipelineRunner.getNativeCrop": {
|
|
21886
|
+
capName: "pipeline-runner",
|
|
21887
|
+
capScope: "system",
|
|
21888
|
+
addonId: null,
|
|
21889
|
+
access: "view"
|
|
21890
|
+
},
|
|
21781
21891
|
"pipelineRunner.reportMotion": {
|
|
21782
21892
|
capName: "pipeline-runner",
|
|
21783
21893
|
capScope: "system",
|
|
@@ -22144,6 +22254,12 @@ Object.freeze({
|
|
|
22144
22254
|
addonId: null,
|
|
22145
22255
|
access: "view"
|
|
22146
22256
|
},
|
|
22257
|
+
"snapshot.getSnapshotOverview": {
|
|
22258
|
+
capName: "snapshot",
|
|
22259
|
+
capScope: "device",
|
|
22260
|
+
addonId: null,
|
|
22261
|
+
access: "view"
|
|
22262
|
+
},
|
|
22147
22263
|
"snapshot.invalidateCache": {
|
|
22148
22264
|
capName: "snapshot",
|
|
22149
22265
|
capScope: "device",
|
|
@@ -23146,7 +23262,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
23146
23262
|
capability: adminUiCapability,
|
|
23147
23263
|
provider: {
|
|
23148
23264
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
23149
|
-
getVersion: async () => ({ version: "1.1.
|
|
23265
|
+
getVersion: async () => ({ version: "1.1.49" })
|
|
23150
23266
|
}
|
|
23151
23267
|
}];
|
|
23152
23268
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ar as e,At as t,Et as n,Ir as r,Ot as i,St as a,Tt as o,_t as s,bt as c,dt as l,ea as u,ft as d,g as ee,gt as f,ht as p,kt as m,m as h,mt as g,oa as _,pt as v,ra as y,ut as te,v as ne,wt as re,xt as ie,yt as b}from"./src-nTmr96zw.js";import{I as x,K as S,Q as C,R as ae,S as w,W as T,b as E,o as oe,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{R as A}from"./src-PqKMUhAl.js";import{p as se}from"./player-overlays-BjWq4Lsw.js";import{t as j}from"./download-pveeJDxf.js";import{t as ce}from"./plus-BUOkx72I.js";import{t as M}from"./refresh-cw-Deh_KPTo.js";import{t as N}from"./search-DXf7ROHt.js";import{t as P}from"./upload-CfFD_PUi.js";import{F as le,H as F,I,K as ue,S as L,W as de,f as fe,g as R,i as z,j as B,m as pe,s as V}from"./index-Cs4056Il.js";import{t as H}from"./AdminPage-BwmGKnRf.js";import{t as me}from"./NodeAddonsSettingsPanel-B-nngyAf.js";var he=F(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),U=F(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),W=F(`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`}]]),ge=F(`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`}]]),G=F(`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`}]]);C();var K=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),q=new Set([`done`,`failed`,`skipped`]);function J(e){return!q.has(e.phase)&&!K.has(e.jobState)}function _e(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=K.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 ve(){let{data:e}=b({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=_(A.AddonsJobProgress,e=>e.job.jobId);return T(()=>{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 _e([...n.values()],Date.now())},[e,t])}var Y={queued:{icon:U,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:G,cls:`bg-muted text-foreground-subtle`,label:`skipped`}};function ye({progress:e}){let t=Y[e.phase],n=t.icon,r=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return w(`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,w(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function be({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:a,selectedVersion:o}){let s=n===`upload`||n===`local`,{data:c,isLoading:l}=p({name:e});return w(`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:[w(`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(z,{className:`h-3 w-3`})})]}),s&&w(`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`}),w(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[w(`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&&w(`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=w(E,{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?w(`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):w(`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(j,{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 xe={queued:{icon:U,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:M,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 Se({item:e}){let t=xe[e.status],n=t.icon;return w(`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]})}C();var X=`device-export`;function Ce(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===X)}function we({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 w(`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?ge:R,{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 Te({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:a,onUpdate:o,onOpenPicker:s,children:c}){if(r)return w(`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 w(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[o&&w(`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(j,{className:`h-3 w-3`}),`Update`]}),w(`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(le,{className:`h-3 w-3`})]}),c]})}return w(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[w(`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(le,{className:`h-3 w-3 opacity-50`})]}),c]})}function Ee({addonId:e}){let t=oe(),{data:r=`inherit`}=d({addonId:e}),i=n({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(),i.mutate({addonId:e,channel:t})},disabled:i.isPending,className:`px-2.5 py-1 transition-colors capitalize ${r===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 De({addon:e,agents:t=[],clusterStatus:n,hideVersion:r,availableUpdate:i,onUpdate:o,isUpdating:s,jobProgress:c,bundle:l,bulkItem:d,disabledByBulk:p,isSystem:g}){let[_,v]=D(!1),[y,te]=D(!1),[ie,b]=D(!1),[x,S]=D(null);k(()=>{S(null)},[i]);let C=x??i,[ae,T]=D(!1),[A,j]=D(!1),[N,P]=D(`logs`),F=oe(),I=se(),ue=de(),L=u(),{manifest:R}=e,B=e.installedOn??[],H=!l&&!R.protected&&R.removable!==!1,U=!!l,G=l?.displayName??R.name,K=l?.packageName??R.packageName,q=l?.version??R.packageVersion??R.version,J=l?.installSource??e.installSource,_e=l?l.bundle?.description??l.addons[0]?.manifest.description:R.description,ve=m({onSuccess:()=>{F.invalidateQueries({queryKey:[[`addons`]]}),F.invalidateQueries({queryKey:[[`addonPages`]]}),F.invalidateQueries({queryKey:[[`capabilities`]]})}}),Y=a({onSuccess:()=>{F.invalidateQueries({queryKey:[[`addons`]]})}}),xe=f({onSuccess:()=>{F.invalidateQueries({queryKey:[[`addons`]]}),F.invalidateQueries({queryKey:[[`addonPages`]]}),F.invalidateQueries({queryKey:[[`capabilities`]]}),F.invalidateQueries({queryKey:[[`integrations`]]})}}),X=re({onSuccess:()=>{F.invalidateQueries({queryKey:[[`addons`]]}),F.invalidateQueries({queryKey:[[`alerts`]]})}}),Z=e.health,Q=Z?.phase===`failed`&&!Z.inGracePeriod,Oe=Q&&Z?.nextRetryAt&&!Z.retrying;return w(`div`,{className:`rounded-lg border bg-surface overflow-hidden ${Q?`border-red-500/50`:`border-border`}`,children:[Q&&Z&&w(`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`}),w(`div`,{className:`flex-1 min-w-0`,children:[w(`div`,{className:`text-xs font-semibold text-danger`,children:[`Failed to load (attempt #`,Z.retryCount,`)`]}),O(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Z.lastError?.message??`Unknown error`}),Oe&&Z.nextRetryAt&&w(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:[`Auto-retry at `,new Date(Z.nextRetryAt).toLocaleTimeString()]})]}),w(`button`,{type:`button`,disabled:X.isPending||Z.retrying,onClick:e=>{e.stopPropagation(),X.mutate({packageName:K})},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(M,{className:`h-3 w-3 ${X.isPending||Z.retrying?`animate-spin`:``}`}),`Retry now`]})]}),w(`div`,{className:`flex items-start gap-3 px-4 py-3`,children:[O(we,{isBundle:U||!!R.components&&R.components.length>1,installSource:J,addonId:U?l.addons[0]?.manifest.id:R.id,iconPath:U?l.bundle?.icon??l.addons[0]?.manifest.icon:R.icon,color:U?l.addons[0]?.manifest.color:R.color}),w(`div`,{className:`flex-1 min-w-0`,children:[w(`div`,{className:`flex items-start justify-between gap-2`,children:[O(`span`,{className:`text-sm font-semibold text-foreground truncate min-w-0`,children:G}),!r&&O(Te,{version:q,availableUpdate:i,...C===void 0?{}:{selectedVersion:C},isUpdating:s,installSource:J,disabled:p,...o&&C!==void 0?{onUpdate:()=>o(C)}:{},onOpenPicker:()=>b(e=>!e),children:ie&&O(be,{packageName:K,currentVersion:q,...J?{installSource:J}:{},...i!==void 0&&C!==void 0?{selectedVersion:C,onSelect:e=>{S(e),b(!1)}}:{},onInstall:e=>{b(!1),xe.mutate({packageName:K,version:e})},onClose:()=>b(!1)})})]}),w(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[K!==G&&O(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:K}),U&&w(`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(ge,{className:`h-3 w-3`}),l.addons.length]}),g&&w(`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(M,{className:`h-3 w-3`}),`System`]}),d!=null&&O(Se,{item:d}),c!=null&&O(ye,{progress:c})]}),_e&&O(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:_e}),!U&&e.process&&w(`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&&w(`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&&w(`div`,{className:`flex items-center gap-1 px-4 py-1.5 border-t border-border/50 bg-surface-hover/20`,children:[w(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Y.mutate({addonId:R.id})},disabled:Y.isPending||p,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(M,{className:`h-3 w-3 ${Y.isPending?`animate-spin`:``}`}),`Restart`]}),w(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),T(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${ae?`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&&w(`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(fe,{className:`h-3 w-3`}),`Settings`]}),O(`div`,{className:`flex-1`}),H&&w(`button`,{type:`button`,onClick:async e=>{e.stopPropagation(),await L({title:`Uninstall ${R.name}?`,message:`This will remove the addon package and all its data. This action cannot be undone.`,confirmLabel:`Uninstall`,variant:`danger`})&&ve.mutate({packageName:R.packageName})},disabled:ve.isPending||p,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(V,{className:`h-3 w-3`}),ve.isPending?`Removing...`:`Uninstall`]})]}),n&&n.nodes.length>1&&!U&&w(`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:n.nodes.map(e=>w(`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))})]}),ae&&!U&&w(`div`,{className:`border-t border-border`,children:[w(`div`,{className:`flex items-center px-4 py-1 bg-surface-hover/20 border-b border-border/50`,children:[w(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[O(`button`,{type:`button`,onClick:()=>P(`logs`),className:`px-2 py-0.5 transition-colors ${N===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:`Logs`}),O(`button`,{type:`button`,onClick:()=>P(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${N===`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(),T(!1)},className:`text-foreground-subtle hover:text-foreground`,children:O(z,{className:`h-3.5 w-3.5`})})]}),N===`logs`&&O(ee,{addonId:R.id,maxHeight:`max-h-64`,showFilters:!1}),N===`events`&&O(h,{addonId:R.id,category:`addon.*`,maxHeight:`max-h-64`})]}),U&&w(E,{children:[O(`button`,{type:`button`,onClick:()=>v(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(_?he:le,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),_&&O(`div`,{className:`border-t border-border px-3 py-2 space-y-2`,children:l.addons.map(e=>O(De,{addon:e,agents:t,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:w(`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:[w(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-border flex-shrink-0`,children:[w(`div`,{className:`flex items-center gap-2`,children:[O(fe,{className:`h-4 w-4 text-primary`}),w(`h2`,{className:`text-sm font-semibold text-foreground`,children:[G,` Settings`]})]}),O(`button`,{onClick:()=>j(!1),className:`text-foreground-subtle hover:text-foreground transition-colors p-1 rounded`,children:O(z,{className:`h-4 w-4`})})]}),w(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-4`,children:[O(me,{nodeId:`hub`,addonIds:[R.id],level:`global`}),Ce(R)&&w(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Device export`}),O(ne,{addonId:R.id,trpc:I.trpcClient,onOpenDevice:e=>ue(`/devices/${e}`)})]}),J===`npm`&&w(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Auto-Update`}),O(Ee,{addonId:R.id})]}),R.components&&R.components.length>0&&w(`div`,{children:[w(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:[`Components (`,R.components.length,`)`]}),O(`div`,{className:`flex flex-wrap gap-1`,children:R.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))})]}),t.length>=2&&w(`div`,{children:[O(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:`Installed on`}),w(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[B.length===0&&O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Hub (local)`}),B.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)),w(`div`,{className:`relative`,children:[w(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),te(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`]}),y&&w(`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:[t.filter(e=>!e.isHub&&!B.includes(e.name)).map(e=>O(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),te(!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)),t.filter(e=>!e.isHub&&!B.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`})})]})})]})}C();var Z=`.tgz,.tar.gz,.zip`;function Q({onUploadSuccess:e}){let[t,n]=D(!1),r=S(null),i=x(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 w(E,{children:[O(`input`,{ref:r,type:`file`,accept:Z,onChange:x(e=>{let t=e.target.files?.[0];t&&i(t),e.target.value=``},[i]),className:`hidden`}),w(`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`]})]})}C();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:e,clusterStatus:n,selectedNode:r,onRefresh:a,isRefreshing:s}){let l=oe(),[d,ee]=D(``),p=ae(d),[m,h]=D(!1),_=S(null);k(()=>{if(!m)return;let e=e=>{_.current&&!_.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let{data:y}=c({nodeId:r.id}),ne=T(()=>{let e=new Map;for(let t of y??[])e.set(t.name,t.latestVersion);return e},[y]),re=T(()=>(y??[]).filter(e=>!e.isSystem).length,[y]),[ie,b]=D(()=>new Set),[C,E]=D(()=>new Map),A=x(e=>{b(t=>new Set(t).add(e))},[]),se=x(e=>{b(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),ce=x((e,t)=>{E(n=>new Map(n).set(e,t))},[]),P=x(e=>{E(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),le=t({onMutate:e=>{A(e.name),P(e.name)},onSuccess:(e,t)=>{se(t.name);let n=e;if(n&&n.success===!1){ce(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),ce(t.name,e instanceof Error?e.message:String(e))}}),F=ve(),de=S(new Set);k(()=>{let e=new Set;for(let[t,n]of F)J(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:fe}=v(void 0),R=te({onSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:z,isFetching:pe}=o({query:p||void 0},{enabled:m}),V=i(),{data:H}=g(void 0),me=H?.requestedAt,[he,U]=D(null),[W,ge]=D(!1);k(()=>{if(H?.kind===`framework-bulk-update`&&H.requestedAt!==he){U(H.requestedAt),ge(!0);let e=window.setTimeout(()=>ge(!1),6e3);return()=>window.clearTimeout(e)}},[me,he,H]),u();let G=x(async()=>{let e=(y??[]).filter(e=>!e.isSystem);e.length!==0&&await V.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[r.id]})},[y,r.id,V]),K=f({onSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`]]}),l.invalidateQueries({queryKey:[[`addonPages`]]}),l.invalidateQueries({queryKey:[[`capabilities`]]}),l.invalidateQueries({queryKey:[[`integrations`]]})}}),[q,_e]=D(`type`),[Y,ye]=D(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),be=e=>{ye(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[xe,Se]=ue(),X=xe.get(`capability`),Ce=T(()=>{let t=e.filter(e=>!ke(e.manifest.packageName));return r.isHub||(t=t.filter(e=>Ae(e.placement,r.isHub))),X&&(t=t.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),t},[e,r.isHub,X]),we=()=>{let e=new URLSearchParams(xe);e.delete(`capability`),Se(e,{replace:!0})},Te=Y===`flat`?Ce:Me(Ce),Ee=T(()=>{let e=[...Te];switch(q){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},[Te,q]);return w(`div`,{className:`space-y-4`,children:[[...C.entries()].map(([e,t])=>O(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-3 py-2 text-[11px]`,children:w(`div`,{className:`flex items-start justify-between gap-3`,children:[w(`div`,{className:`space-y-0.5`,children:[w(`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:()=>P(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:`dismiss`})]})},e)),w(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[w(`div`,{className:`flex items-center gap-1.5`,children:[O(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Sort:`}),w(`select`,{value:q,onChange:e=>_e(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`})]})]}),w(`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:()=>be(e),className:`px-2.5 py-1.5 transition-colors capitalize ${Y===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))})]}),r.isHub&&w(`div`,{className:`flex items-center gap-1.5`,children:[O(M,{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:()=>R.mutate({channel:e}),disabled:R.isPending,className:`px-2.5 py-1.5 transition-colors capitalize ${fe?.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&&w(`button`,{type:`button`,onClick:()=>void G(),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(j,{className:`w-3 h-3`}),V.isPending?`Updating…`:`Update All (${re})`]}),w(`button`,{type:`button`,onClick:a,disabled:s||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(M,{className:`w-3 h-3 ${s?`animate-spin`:``}`}),`Refresh`]})]}),w(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[w(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:_,children:[O(N,{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:d,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`}),m&&z&&z.length>0&&w(`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:[z.length>0&&w(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:[`npm results (`,z.length,`)`]}),z&&z.length>0&&O(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:z.map(e=>w(`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()}),w(`div`,{className:`flex-1 min-w-0`,children:[w(`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-)?/,``)}),w(`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?w(`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`]}):w(`button`,{type:`button`,onClick:()=>K.mutate({packageName:e.name}),disabled:K.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:[K.isPending?O(L,{className:`h-3 w-3 animate-spin`}):O(j,{className:`h-3 w-3`}),`Install`]})]},e.name))})]})]}),O(Q,{onUploadSuccess:()=>{l.invalidateQueries({queryKey:[[`addons`]]}),a()}})]}),X&&w(`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:X}),O(`button`,{type:`button`,onClick:we,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:`Clear`})]}),W&&w(`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(B,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),w(`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.`})]})]}),Ce.length===0&&O(`div`,{className:`text-xs text-foreground-subtle`,children:e.length===0?`No addons installed`:X?`No installed addons declare the "${X}" capability. Browse the npm catalog above to find a compatible addon.`:`No addons compatible with ${r.name} (placement filter active)`}),O(`div`,{className:`space-y-2`,children:Ee.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,i=ne.get(t),a=$(e)?e.representative:e,o=i?e=>le.mutate({name:t,version:e,nodeId:r.id}):void 0,s=F.get(t)??null,c=s!==null&&J(s);return O(De,{addon:a,clusterStatus:n?.[a.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:i,isUpdating:ie.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:V.isPending},$(e)?t:e.manifest.id)})})]})}function Pe(){let t=oe(),{data:n,isLoading:i,isError:a}=s(),{data:o}=e(void 0),{data:c}=r(void 0,{refetchInterval:1e4}),u=T(()=>{let e=new Map;e.set(`hub`,{id:`hub`,name:`Hub`,isHub:!0});for(let t of c??[]){let n=String(t.id??``);n&&e.set(n,{id:n,name:String(t.name??n),isHub:!!t.isHub})}return[...e.values()]},[c]),[d,ee]=D(`hub`),f=u.find(e=>e.id===d)??u[0],p=l(),m=ie(),h=p.isPending||m.isPending,g=async()=>{await p.mutateAsync({nodeId:d}),await m.mutateAsync(),t.invalidateQueries({queryKey:[[`addons`]]})},_=S(p);_.current=p,k(()=>{_.current.mutate({nodeId:`hub`})},[]);let v=(n??[]).map(je).filter(e=>e!==null);return w(H,{children:[w(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[O(y,{selectedNodeId:d,onSelect:ee}),w(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[!i&&!a&&w(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:[v.length,` installed`]}),w(`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(M,{className:`w-3 h-3 ${h?`animate-spin`:``}`}),`Check for updates`]})]})]}),!f.isHub&&w(`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:f.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.`]}),i&&O(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading…`}),a&&O(`div`,{className:`text-xs text-danger`,children:`Failed to load addons`}),!i&&!a&&O(Ne,{addons:v,clusterStatus:o,selectedNode:f,onRefresh:()=>void g(),isRefreshing:h})]})}export{Pe as AddonsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$n as e,Aa as t,Ca as n,Da as r,Ea as i,Gn as a,Jn as o,Kn as s,Ma as c,Na as l,Oa as u,Qn as d,Ta as f,Un as p,Wn as m,Xn as h,Yn as g,Zn as _,er as v,qn as y,wa as b}from"./src-nTmr96zw.js";import{Q as x,S,W as C,b as w,o as T,q as E,x as D}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as O}from"./pencil-DRjwER9e.js";import{t as k}from"./plus-BUOkx72I.js";import{t as A}from"./sparkles-BpXfWQIN.js";import{t as j}from"./square-check-big-eVWC31kd.js";import{t as M}from"./square-7B5ghrYh.js";import{F as N,H as P,I as F,N as I,S as L,h as R,i as z,s as B}from"./index-Cs4056Il.js";import{t as V}from"./AdminPage-BwmGKnRf.js";var H=P(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),U=P(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),W=P(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]);x();var G=[[`faceGallery`]];function K({identityId:e}){let t=T(),{data:n,isLoading:r}=o({identityId:e}),i=h();function a(n){i.mutate({identityId:e,sampleId:n.id},{onSettled:()=>{t.invalidateQueries({queryKey:G})}})}return r?S(`div`,{className:`flex items-center gap-2 py-3 text-xs text-foreground-subtle`,children:[D(L,{className:`h-3.5 w-3.5 animate-spin`}),`Loading samples…`]}):!n||n.length===0?D(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`No samples yet.`}):D(`div`,{className:`mt-2 grid grid-cols-4 gap-2 sm:grid-cols-6 md:grid-cols-8`,children:n.map(e=>S(`div`,{className:`group relative aspect-square overflow-hidden rounded-md border border-border bg-surface`,children:[e.base64?D(`img`,{src:`data:image/jpeg;base64,${e.base64}`,alt:`Sample`,className:`h-full w-full object-cover`}):D(`div`,{className:`flex h-full w-full items-center justify-center text-foreground-subtle`,children:D(U,{className:`h-6 w-6`})}),D(`button`,{type:`button`,onClick:()=>a(e),disabled:i.isPending,className:`absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100 disabled:cursor-not-allowed`,"aria-label":`Remove sample`,children:D(z,{className:`h-4 w-4 text-white`})})]},e.id))})}function q({identity:e,expanded:a,onToggle:o}){let d=T(),[p,m]=E(``),[h,g]=E(!1),[v,y]=E(!1),x=_(),C=s();function k(){m(e.name),g(!0)}function A(){g(!1),m(``)}function j(){let t=p.trim();if(!t||t===e.name){A();return}x.mutate({id:e.id,name:t},{onSettled:()=>{d.invalidateQueries({queryKey:G}),A()}})}function M(){C.mutate({id:e.id},{onSettled:()=>{d.invalidateQueries({queryKey:G}),y(!1)}})}return S(`div`,{className:`rounded-md border border-border bg-surface`,children:[S(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[D(`div`,{className:`h-8 w-8 shrink-0 overflow-hidden rounded-full border border-border bg-surface-hover`,children:e.coverBase64?D(`img`,{src:`data:image/jpeg;base64,${e.coverBase64}`,alt:e.name,className:`h-full w-full object-cover`}):D(`div`,{className:`flex h-full w-full items-center justify-center`,children:D(U,{className:`h-4 w-4 text-foreground-subtle`})})}),D(`div`,{className:`flex flex-1 min-w-0 items-center gap-2`,children:h?S(w,{children:[D(t,{value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j(),e.key===`Escape`&&A()},className:`h-6 text-xs`,autoFocus:!0}),D(`button`,{type:`button`,onClick:j,disabled:x.isPending,className:`text-success hover:text-success/80 disabled:opacity-50`,"aria-label":`Confirm rename`,children:D(F,{className:`h-3.5 w-3.5`})}),D(`button`,{type:`button`,onClick:A,className:`text-foreground-subtle hover:text-foreground`,"aria-label":`Cancel rename`,children:D(z,{className:`h-3.5 w-3.5`})})]}):D(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name})}),D(c,{variant:`default`,className:`text-[10px]`,children:e.sampleCount}),!h&&S(`div`,{className:`flex items-center gap-1`,children:[D(`button`,{type:`button`,onClick:k,className:`p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground`,"aria-label":`Rename`,children:D(O,{className:`h-3.5 w-3.5`})}),D(`button`,{type:`button`,onClick:()=>y(!0),className:`p-1 rounded hover:bg-danger/10 text-foreground-subtle hover:text-danger`,"aria-label":`Delete`,children:D(B,{className:`h-3.5 w-3.5`})})]}),D(`button`,{type:`button`,onClick:o,className:`p-1 rounded hover:bg-surface-hover text-foreground-subtle`,"aria-label":a?`Collapse`:`Expand`,children:D(a?N:I,{className:`h-3.5 w-3.5`})})]}),a&&D(`div`,{className:`border-t border-border px-3 pb-3 pt-2`,children:D(K,{identityId:e.id})}),D(n,{open:v,onOpenChange:e=>!e&&y(!1),children:S(b,{children:[S(r,{children:[D(u,{children:`Delete person`}),S(f,{children:[`Delete `,D(`strong`,{children:e.name}),` and all their samples? This cannot be undone.`]})]}),S(i,{children:[D(l,{variant:`secondary`,onClick:()=>y(!1),children:`Cancel`}),S(l,{variant:`danger`,onClick:M,disabled:C.isPending,children:[C.isPending?D(L,{className:`h-3.5 w-3.5 animate-spin`}):null,`Delete`]})]})]})})]})}function J(){let e=T(),[n,r]=E(``),i=m();function a(){let t=n.trim();t&&i.mutate({name:t},{onSettled:()=>{e.invalidateQueries({queryKey:G}),r(``)}})}return S(`div`,{className:`flex items-center gap-2 pt-2`,children:[D(t,{placeholder:`New person name…`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a()},className:`h-7 text-xs flex-1`}),S(l,{variant:`primary`,size:`sm`,onClick:a,disabled:i.isPending||!n.trim(),children:[i.isPending?D(L,{className:`h-3.5 w-3.5 animate-spin`}):D(k,{className:`h-3.5 w-3.5`}),`Add`]})]})}function Y(){let{data:e,isLoading:t}=y(),[n,r]=E(null);function i(e){r(t=>t===e?null:e)}return t?S(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[D(L,{className:`h-4 w-4 animate-spin`}),`Loading people…`]}):S(`div`,{className:`space-y-2`,children:[(!e||e.length===0)&&D(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`No people enrolled yet. Add one below.`}),e?.map(e=>D(q,{identity:e,expanded:n===e.id,onToggle:()=>i(e.id)},e.id)),D(J,{})]})}x();var X=[[`faceGallery`]];function Z({faceIds:e,identities:a,onDone:o}){let s=T(),c=p(),d=m(),[h,g]=E(``),[_,v]=E(!1),[y,x]=E(null),C=e!==null&&e.length>0,w=e?.length??0;function O(){v(!1),g(``),x(null)}function k(){O(),o()}function A(t){!e||e.length===0||c.mutate({faceIds:[...e],identityId:t},{onSettled:()=>{s.invalidateQueries({queryKey:X}),k()}})}function j(){!e||!h.trim()||d.mutate({name:h.trim()},{onSuccess:e=>{e?.id&&A(e.id)},onError:()=>{s.invalidateQueries({queryKey:X}),k()}})}let M=c.isPending||d.isPending;return D(n,{open:C,onOpenChange:e=>!e&&k(),children:S(b,{children:[S(r,{children:[D(u,{children:w>1?`Assign ${w} faces to person`:`Assign face to person`}),D(f,{children:`Select an existing person or create a new one.`})]}),D(`div`,{className:`space-y-1 max-h-56 overflow-y-auto`,children:a.map(e=>S(`button`,{type:`button`,onClick:()=>x(e.id),className:`w-full rounded-md px-3 py-2 text-left text-xs transition-colors ${y===e.id?`bg-primary/12 text-primary`:`hover:bg-surface-hover text-foreground`}`,children:[D(`span`,{className:`font-medium`,children:e.name}),S(`span`,{className:`ml-2 text-foreground-subtle`,children:[e.sampleCount,` samples`]})]},e.id))}),_?D(`div`,{className:`flex items-center gap-2 pt-2 border-t border-border`,children:D(t,{placeholder:`New person name…`,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},autoFocus:!0,className:`flex-1`})}):D(`button`,{type:`button`,onClick:()=>{x(null),v(!0)},className:`mt-2 w-full rounded-md border border-dashed border-border px-3 py-2 text-left text-xs text-foreground-subtle hover:border-primary hover:text-primary transition-colors`,children:`+ New person…`}),S(i,{children:[D(l,{variant:`secondary`,onClick:k,disabled:M,children:`Cancel`}),_?S(l,{variant:`primary`,onClick:j,disabled:M||!h.trim(),children:[M&&D(L,{className:`h-3.5 w-3.5 animate-spin`}),`Create & assign`]}):S(l,{variant:`primary`,onClick:()=>y&&A(y),disabled:M||!y,children:[M&&D(L,{className:`h-3.5 w-3.5 animate-spin`}),`Assign`,w>1?` ${w}`:``]})]})]})})}function Q({face:t,selected:n,onToggleSelect:r,onAssign:i}){let o=T(),s=e(),c=a(),l=()=>{o.invalidateQueries({queryKey:X})};return S(`div`,{className:`group relative flex flex-col gap-1 rounded-md border bg-surface overflow-hidden ${n?`border-primary ring-1 ring-primary`:`border-border`}`,children:[S(`div`,{className:`aspect-square relative overflow-hidden bg-surface-hover`,children:[t.base64?D(`img`,{src:`data:image/jpeg;base64,${t.base64}`,alt:`Face`,className:`h-full w-full object-cover`}):D(`div`,{className:`flex h-full w-full items-center justify-center text-foreground-subtle`,children:D(U,{className:`h-8 w-8`})}),D(`button`,{type:`button`,onClick:()=>r(t.faceId),className:`absolute left-1 top-1 rounded bg-black/40 p-0.5 text-white hover:bg-black/60`,"aria-label":n?`Deselect`:`Select`,children:n?D(j,{className:`h-3.5 w-3.5 text-primary`}):D(M,{className:`h-3.5 w-3.5`})}),S(`div`,{className:`absolute inset-0 flex items-center justify-center gap-2 bg-black/50 opacity-0 transition-opacity group-hover:opacity-100`,children:[t.assigned?D(`button`,{type:`button`,onClick:()=>s.mutate({faceId:t.faceId},{onSettled:l}),disabled:s.isPending,className:`rounded-full bg-warning/80 p-1.5 text-white hover:bg-warning disabled:opacity-50`,title:`Detach`,children:s.isPending?D(L,{className:`h-3.5 w-3.5 animate-spin`}):D(W,{className:`h-3.5 w-3.5`})}):D(`button`,{type:`button`,onClick:()=>i(t.faceId),className:`rounded-full bg-primary/80 p-1.5 text-white hover:bg-primary`,title:`Assign to person`,children:D(H,{className:`h-3.5 w-3.5`})}),D(`button`,{type:`button`,onClick:()=>c.mutate({faceId:t.faceId},{onSettled:l}),disabled:c.isPending,className:`rounded-full bg-danger/80 p-1.5 text-white hover:bg-danger disabled:opacity-50`,title:`Delete face`,children:c.isPending?D(L,{className:`h-3.5 w-3.5 animate-spin`}):D(B,{className:`h-3.5 w-3.5`})})]})]}),S(`div`,{className:`px-2 pb-2 space-y-0.5`,children:[D(`p`,{className:`text-[10px] text-foreground-subtle truncate`,children:t.deviceId}),t.identityName&&D(`p`,{className:`text-[10px] font-medium text-primary truncate`,title:t.identityName,children:t.identityName})]})]})}var $=[{label:`All`,value:`all`},{label:`Unassigned`,value:`unassigned`},{label:`Recognized`,value:`recognized`}];function ee(){let e=T(),[t,n]=E(`all`),[r,i]=E(new Set),[o,s]=E(null),[c,u]=E(!1),{data:f,isLoading:m}=g({limit:100,filter:t}),{data:h=[]}=y(),{data:_,isFetching:b}=d({threshold:.5,minClusterSize:2,limit:20},{enabled:c}),x=p(),w=v(),O=a(),k=f??[],j=C(()=>new Map(k.map(e=>[e.faceId,e])),[k]),M=()=>{e.invalidateQueries({queryKey:X})},N=()=>i(new Set);function P(e){i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function F(e){i(t=>{let n=new Set(t);for(let t of e)n.add(t);return n})}let I=[...r],R=x.isPending||w.isPending||O.isPending;function V(){I.length!==0&&w.mutate({faceIds:I},{onSettled:()=>{M(),N()}})}function G(){I.length!==0&&Promise.allSettled(I.map(e=>O.mutateAsync({faceId:e}))).then(()=>{M(),N()})}return S(`div`,{className:`space-y-3`,children:[S(`div`,{className:`flex items-center gap-1`,children:[$.map(e=>D(`button`,{type:`button`,onClick:()=>n(e.value),className:`rounded-md px-2.5 py-1 text-xs transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value)),S(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`ml-2 flex items-center gap-1 rounded-md px-2.5 py-1 text-xs transition-colors ${c?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[D(A,{className:`h-3.5 w-3.5`}),` Similar groups`]}),!m&&S(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:[k.length,` face`,k.length===1?``:`s`]})]}),r.size>0&&S(`div`,{className:`flex items-center gap-2 rounded-md border border-primary/40 bg-primary/8 px-3 py-2`,children:[S(`span`,{className:`text-xs font-medium text-foreground`,children:[r.size,` selected`]}),S(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[S(l,{variant:`primary`,onClick:()=>s(I),disabled:R,children:[D(H,{className:`h-3.5 w-3.5`}),` Assign`]}),S(l,{variant:`secondary`,onClick:V,disabled:R,children:[w.isPending?D(L,{className:`h-3.5 w-3.5 animate-spin`}):D(W,{className:`h-3.5 w-3.5`}),` `,`Detach`]}),S(l,{variant:`secondary`,onClick:G,disabled:R,children:[D(B,{className:`h-3.5 w-3.5`}),` Delete`]}),D(l,{variant:`ghost`,onClick:N,disabled:R,children:D(z,{className:`h-3.5 w-3.5`})})]})]}),c&&S(`div`,{className:`rounded-md border border-border bg-surface p-3`,children:[D(`p`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Look-alike groups`}),b?S(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[D(L,{className:`h-4 w-4 animate-spin`}),` Finding similar faces…`]}):!_||_.length===0?D(`p`,{className:`text-xs text-foreground-subtle`,children:`No look-alike groups found among unassigned faces.`}):D(`div`,{className:`space-y-2`,children:_.map(e=>S(`div`,{className:`flex items-center gap-2 rounded-md bg-surface-hover/50 p-2`,children:[D(`div`,{className:`flex -space-x-1.5`,children:e.faceIds.slice(0,6).map(e=>{let t=j.get(e);return D(`div`,{className:`h-8 w-8 overflow-hidden rounded border border-border bg-surface`,children:t?.base64?D(`img`,{src:`data:image/jpeg;base64,${t.base64}`,alt:``,className:`h-full w-full object-cover`}):D(U,{className:`h-full w-full p-1.5 text-foreground-subtle`})},e)})}),S(`span`,{className:`text-xs text-foreground-subtle`,children:[e.size,` faces · `,Math.round(e.cohesion*100),`% alike`]}),S(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[D(l,{variant:`secondary`,onClick:()=>F(e.faceIds),children:`Select group`}),S(l,{variant:`primary`,onClick:()=>s(e.faceIds),children:[D(H,{className:`h-3.5 w-3.5`}),` Assign all`]})]})]},e.representativeFaceId))})]}),m&&S(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[D(L,{className:`h-4 w-4 animate-spin`}),` Loading faces…`]}),!m&&k.length===0&&D(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:`No faces found for this filter.`}),!m&&k.length>0&&D(`div`,{className:`grid grid-cols-4 gap-2 sm:grid-cols-6 md:grid-cols-8 lg:grid-cols-10`,children:k.map(e=>D(Q,{face:e,selected:r.has(e.faceId),onToggleSelect:P,onAssign:e=>s([e])},e.faceId))}),D(Z,{faceIds:o,identities:h,onDone:()=>{s(null),N()}})]})}function te(){return D(V,{icon:R,title:`Detection Intelligence`,subtitle:`Manage enrolled identities and assign detected face crops to people.`,children:S(`section`,{className:`space-y-3`,children:[S(`div`,{children:[D(`h2`,{className:`text-sm font-semibold text-foreground mb-1`,children:`People`}),D(`p`,{className:`text-xs text-foreground-subtle mb-3`,children:`Enrolled identities used for face recognition. Expand a row to view or remove training samples.`}),D(Y,{})]}),S(`div`,{className:`pt-4 border-t border-border`,children:[D(`h2`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Recent detected faces`}),D(`p`,{className:`text-xs text-foreground-subtle mb-3`,children:`Face crops captured by the detection pipeline. Assign them to a person to build recognition training data.`}),D(ee,{})]})]})})}export{te as DetectionIntelligencePage};
|