@opentray/ext-badge 0.14.4 → 0.15.0
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/README.md +2 -0
- package/contract.json +4 -0
- package/dist/index.d.mts +26 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +27 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ Official status extension for OpenTray.
|
|
|
11
11
|
Windows and Linux support is intentionally reduced until a real native projection exists. Unsupported families reject explicitly.
|
|
12
12
|
On the current macOS Dock proof surface, progress and progress state are explicitly unsupported and should not be treated as a working Dock projection.
|
|
13
13
|
|
|
14
|
+
`BadgeExt.artifact` maps supported targets to platform packages relative to this facade and names the canonical Badge contract manifest. Consumers do not install or locate the native library manually.
|
|
15
|
+
|
|
14
16
|
## Debug Panel
|
|
15
17
|
|
|
16
18
|
The repository ships a macOS-facing proof surface at `pnpm --filter opentray example:badge`.
|
package/contract.json
ADDED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TrayHandle } from "opentray";
|
|
1
|
+
import { NativeExtensionArtifact, TrayHandle } from "opentray";
|
|
2
2
|
|
|
3
3
|
//#region ../spec/src/index.d.ts
|
|
4
4
|
type AppId = string;
|
|
@@ -118,7 +118,7 @@ declare const badgePanelEnvelopeFromCapabilities: (snapshot: BadgeCapabilities)
|
|
|
118
118
|
//#region src/index.d.ts
|
|
119
119
|
interface BadgeExtensionOptions {
|
|
120
120
|
mountId?: string;
|
|
121
|
-
|
|
121
|
+
artifact?: NativeExtensionArtifact;
|
|
122
122
|
platform?: BadgePlatform;
|
|
123
123
|
}
|
|
124
124
|
interface BadgeExtensionCapability extends BadgeHandle {
|
|
@@ -128,9 +128,31 @@ interface BadgeExtensionCapability extends BadgeHandle {
|
|
|
128
128
|
declare const attachBadge: (tray: TrayHandle, options?: BadgeExtensionOptions) => BadgeExtensionCapability;
|
|
129
129
|
declare const BadgeExt: {
|
|
130
130
|
name: string;
|
|
131
|
-
|
|
131
|
+
artifact: {
|
|
132
|
+
kind: "package";
|
|
133
|
+
packageJsonUrl: string;
|
|
134
|
+
contractManifestUrl: string;
|
|
135
|
+
targets: {
|
|
136
|
+
"darwin-arm64": {
|
|
137
|
+
packageName: string;
|
|
138
|
+
libraryPath: string;
|
|
139
|
+
};
|
|
140
|
+
"darwin-x64": {
|
|
141
|
+
packageName: string;
|
|
142
|
+
libraryPath: string;
|
|
143
|
+
};
|
|
144
|
+
"win32-arm64": {
|
|
145
|
+
packageName: string;
|
|
146
|
+
libraryPath: string;
|
|
147
|
+
};
|
|
148
|
+
"win32-x64": {
|
|
149
|
+
packageName: string;
|
|
150
|
+
libraryPath: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
132
154
|
resolveMount(options: BadgeExtensionOptions | undefined): {
|
|
133
|
-
|
|
155
|
+
artifact?: NativeExtensionArtifact;
|
|
134
156
|
mountId?: string;
|
|
135
157
|
};
|
|
136
158
|
extend(tray: TrayHandle, context: import("opentray").TrayExtensionContext, options: BadgeExtensionOptions | undefined): BadgeHandle;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../spec/src/index.ts","../src/shared.ts","../src/index.ts"],"mappings":";;;KAEY,KAAA;AAAA,KACA,MAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../spec/src/index.ts","../src/shared.ts","../src/index.ts"],"mappings":";;;KAEY,KAAA;AAAA,KACA,MAAA;AAAA,UA4WK,cAAA;EACf,KAAA,EAAO,KAAA;EACP,MAAA,GAAS,MAAM;EACf,GAAA;AAAA;AAAA,UAGe,iBAAA;EACf,KAAA,EAAO,cAAA;EACP,IAAA,EAAM,KAAK;AAAA;;;KCvXD,oBAAA;AAAA,KAEA,aAAA;AAAA,UAEK,UAAA;EACf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
packageJsonUrl: new URL("../package.json", import.meta.url).href,
|
|
5
|
+
contractManifestUrl: new URL("../contract.json", import.meta.url).href,
|
|
6
|
+
targets: {
|
|
7
|
+
"darwin-arm64": {
|
|
8
|
+
packageName: "@opentray/ext-badge-darwin-arm64",
|
|
9
|
+
libraryPath: "lib/libopentray_ext_badge.dylib"
|
|
10
|
+
},
|
|
11
|
+
"darwin-x64": {
|
|
12
|
+
packageName: "@opentray/ext-badge-darwin-x64",
|
|
13
|
+
libraryPath: "lib/libopentray_ext_badge.dylib"
|
|
14
|
+
},
|
|
15
|
+
"win32-arm64": {
|
|
16
|
+
packageName: "@opentray/ext-badge-windows-arm64",
|
|
17
|
+
libraryPath: "bin/opentray_ext_badge.dll"
|
|
18
|
+
},
|
|
19
|
+
"win32-x64": {
|
|
20
|
+
packageName: "@opentray/ext-badge-windows-x64",
|
|
21
|
+
libraryPath: "bin/opentray_ext_badge.dll"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
1
26
|
//#region src/shared.ts
|
|
2
27
|
const defaultBadgeState = () => ({
|
|
3
28
|
badgeText: "12",
|
|
@@ -48,7 +73,6 @@ const badgePanelEnvelopeFromCapabilities = (snapshot) => ({
|
|
|
48
73
|
//#endregion
|
|
49
74
|
//#region src/index.ts
|
|
50
75
|
const BADGE_EXTENSION_NAME = "badge";
|
|
51
|
-
const BADGE_EXTENSION_PACKAGE = "@opentray/ext-badge";
|
|
52
76
|
const attachBadge = (tray, options = {}) => {
|
|
53
77
|
const platform = options.platform ?? process.platform;
|
|
54
78
|
const extension = tray.extend(BadgeExt, options);
|
|
@@ -60,11 +84,11 @@ const attachBadge = (tray, options = {}) => {
|
|
|
60
84
|
};
|
|
61
85
|
const BadgeExt = {
|
|
62
86
|
name: BADGE_EXTENSION_NAME,
|
|
63
|
-
|
|
87
|
+
artifact: BADGE_NATIVE_ARTIFACT,
|
|
64
88
|
resolveMount(options) {
|
|
65
89
|
return {
|
|
66
90
|
...options?.mountId === void 0 ? {} : { mountId: options.mountId },
|
|
67
|
-
...options?.
|
|
91
|
+
...options?.artifact === void 0 ? {} : { artifact: options.artifact }
|
|
68
92
|
};
|
|
69
93
|
},
|
|
70
94
|
extend(tray, context, options) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/shared.ts","../src/index.ts"],"sourcesContent":["export type BadgeCapabilityLevel = \"native\" | \"reduced\" | \"unsupported\";\n\nexport type BadgePlatform = \"darwin\" | \"win32\" | \"linux\";\n\nexport interface BadgeState {\n badgeText: string;\n badgeCount: number | null;\n progressValue: number;\n progressMax: number;\n progressState: \"none\" | \"indeterminate\" | \"normal\" | \"paused\" | \"error\";\n overlayIcon: \"none\" | \"dot\" | \"alert\";\n attention: boolean;\n}\n\nexport interface BadgeCapabilityFamily {\n badgeText: BadgeCapabilityLevel;\n progress: BadgeCapabilityLevel;\n overlayIcon: BadgeCapabilityLevel;\n attention: BadgeCapabilityLevel;\n}\n\nexport interface BadgeCapabilities {\n platform: BadgePlatform;\n mode: \"native\" | \"reduced\" | \"unsupported\";\n capabilities: BadgeCapabilityFamily;\n state: BadgeState;\n reason?: string;\n}\n\nexport type BadgeCommand =\n | { type: \"getCapabilities\" }\n | { type: \"setBadge\"; value: string }\n | { type: \"clearBadge\" }\n | { type: \"setProgress\"; value: number; max?: number }\n | { type: \"setProgressState\"; value: BadgeState[\"progressState\"] }\n | { type: \"setOverlayIcon\"; value: BadgeState[\"overlayIcon\"] }\n | { type: \"setAttention\"; value: boolean }\n | { type: \"showPanel\" }\n | { type: \"hidePanel\" }\n | { type: \"reset\" }\n ;\n\nexport type BadgeEvent =\n | { type: \"capabilities\"; snapshot: BadgeCapabilities }\n | { type: \"state\"; snapshot: BadgeCapabilities }\n | { type: \"result\"; op: string; ok: true; snapshot: BadgeCapabilities }\n | { type: \"result\"; op: string; ok: false; error: string; snapshot: BadgeCapabilities };\n\nexport interface BadgeHandle {\n getCapabilities(): Promise<BadgeCapabilities>;\n setBadge(value: string): Promise<BadgeCapabilities>;\n clearBadge(): Promise<BadgeCapabilities>;\n setProgress(value: number, max?: number): Promise<BadgeCapabilities>;\n setProgressState(value: BadgeState[\"progressState\"]): Promise<BadgeCapabilities>;\n setOverlayIcon(value: BadgeState[\"overlayIcon\"]): Promise<BadgeCapabilities>;\n setAttention(value: boolean): Promise<BadgeCapabilities>;\n showPanel(): Promise<BadgeCapabilities>;\n hidePanel(): Promise<BadgeCapabilities>;\n reset(): Promise<BadgeCapabilities>;\n}\n\nexport interface BadgePanelEnvelope {\n platform: BadgePlatform;\n mode: \"native\" | \"reduced\" | \"unsupported\";\n capabilities: BadgeCapabilityFamily;\n state: BadgeState;\n log: string[];\n reason?: string;\n}\n\nexport const defaultBadgeState = (): BadgeState => ({\n badgeText: \"12\",\n badgeCount: 12,\n progressValue: 0,\n progressMax: 100,\n progressState: \"none\",\n overlayIcon: \"dot\",\n attention: false,\n});\n\nexport const defaultBadgeCapabilities = (platform: BadgePlatform): BadgeCapabilities => {\n const common = {\n badgeText: \"reduced\",\n progress: \"unsupported\",\n overlayIcon: \"reduced\",\n attention: \"reduced\",\n } satisfies BadgeCapabilityFamily;\n return {\n platform,\n mode: \"reduced\",\n capabilities: common,\n state: defaultBadgeState(),\n reason: \"badge projection is currently reduced to a local proof surface\",\n };\n};\n\nexport const normalizeProgress = (value: number, max?: number): { value: number; max: number } => {\n const normalizedMax = Number.isFinite(max ?? 100) ? Math.max(1, Math.round(max ?? 100)) : 100;\n const normalizedValue = Number.isFinite(value) ? Math.max(0, Math.min(normalizedMax, Math.round(value))) : 0;\n return { value: normalizedValue, max: normalizedMax };\n};\n\nexport const normalizeBadgeText = (value: string): { badgeText: string; badgeCount: number | null } => {\n const badgeText = value.trim();\n const parsed = Number.parseInt(badgeText, 10);\n return {\n badgeText,\n badgeCount: Number.isFinite(parsed) ? parsed : null,\n };\n};\n\nexport const badgePanelEnvelopeFromCapabilities = (\n snapshot: BadgeCapabilities,\n): BadgePanelEnvelope => ({\n platform: snapshot.platform,\n mode: snapshot.mode,\n capabilities: snapshot.capabilities,\n state: snapshot.state,\n log: [],\n ...(snapshot.reason === undefined ? {} : { reason: snapshot.reason }),\n});\n","import type { ExtensionEnvelope } from \"@opentray/spec\";\nimport type { TrayHandle } from \"opentray\";\n\nimport {\n badgePanelEnvelopeFromCapabilities,\n defaultBadgeCapabilities,\n normalizeBadgeText,\n normalizeProgress,\n type BadgeCapabilities,\n type BadgeCapabilityFamily,\n type BadgeEvent,\n type BadgeHandle,\n type BadgePanelEnvelope,\n type BadgePlatform,\n type BadgeState,\n} from \"./shared\";\n\nexport type * from \"./shared\";\nexport { badgePanelEnvelopeFromCapabilities } from \"./shared\";\n\nconst BADGE_EXTENSION_NAME = \"badge\";\nconst BADGE_EXTENSION_PACKAGE = \"@opentray/ext-badge\";\n\nexport interface BadgeExtensionOptions {\n mountId?: string;\n path?: string;\n platform?: BadgePlatform;\n}\n\nexport interface BadgeExtensionCapability extends BadgeHandle {\n readonly platform: BadgePlatform;\n readonly getPanelEnvelope: () => Promise<BadgePanelEnvelope>;\n}\n\nexport const attachBadge = (tray: TrayHandle, options: BadgeExtensionOptions = {}): BadgeExtensionCapability => {\n const platform = options.platform ?? process.platform as BadgePlatform;\n const extension = tray.extend(BadgeExt, options);\n return {\n ...extension,\n platform,\n getPanelEnvelope: async () => badgePanelEnvelopeFromCapabilities(await extension.getCapabilities()),\n };\n};\n\nexport const BadgeExt = {\n name: BADGE_EXTENSION_NAME,\n path: BADGE_EXTENSION_PACKAGE,\n resolveMount(options: BadgeExtensionOptions | undefined) {\n return {\n ...(options?.mountId === undefined ? {} : { mountId: options.mountId }),\n ...(options?.path === undefined ? {} : { path: options.path }),\n };\n },\n extend(tray: TrayHandle, context, options: BadgeExtensionOptions | undefined): BadgeHandle {\n const requestedPlatform = options?.platform ?? (process.platform as BadgePlatform);\n const snapshot = defaultBadgeCapabilities(requestedPlatform);\n return createBadgeHandle(() => context.ensureLoaded(), tray, context.mountId, snapshot);\n },\n} satisfies import(\"opentray\").TrayExtension<BadgeHandle, BadgeExtensionOptions>;\n\nexport const isBadgeEvent = (event: ExtensionEnvelope): event is ExtensionEnvelope<BadgeEvent> =>\n event.scope.ext === BADGE_EXTENSION_NAME &&\n typeof event.data === \"object\" &&\n event.data !== null &&\n \"type\" in event.data;\n\nfunction createBadgeHandle(\n ensureLoaded: () => Promise<void>,\n tray: TrayHandle,\n mountId: string,\n seed: BadgeCapabilities,\n): BadgeHandle {\n const state: BadgeState = structuredClone(seed.state);\n const capabilities: BadgeCapabilityFamily = { ...seed.capabilities };\n const platform = seed.platform;\n const mode = seed.mode;\n const reason = seed.reason;\n\n const snapshot = (): BadgeCapabilities => ({\n platform,\n mode,\n capabilities: { ...capabilities },\n state: structuredClone(state),\n ...(reason === undefined ? {} : { reason }),\n });\n\n const rejectUnsupported = (family: keyof BadgeCapabilityFamily, op: string): never => {\n const support = capabilities[family];\n throw new Error(`${op} is ${support} on ${platform}`);\n };\n\n return {\n getCapabilities: async () => {\n await ensureLoaded();\n await tray.requestExtension(mountId, { type: \"getCapabilities\" });\n return snapshot();\n },\n setBadge: async (value: string) => {\n await ensureLoaded();\n const normalized = normalizeBadgeText(value);\n state.badgeText = normalized.badgeText;\n state.badgeCount = normalized.badgeCount;\n await tray.commandExtension(mountId, { type: \"setBadge\", value: normalized.badgeText });\n return snapshot();\n },\n clearBadge: async () => {\n await ensureLoaded();\n state.badgeText = \"\";\n state.badgeCount = null;\n await tray.commandExtension(mountId, { type: \"clearBadge\" });\n return snapshot();\n },\n setProgress: async (value: number, max?: number) => {\n await ensureLoaded();\n if (capabilities.progress === \"unsupported\") {\n rejectUnsupported(\"progress\", \"setProgress\");\n }\n const normalized = normalizeProgress(value, max);\n state.progressValue = normalized.value;\n state.progressMax = normalized.max;\n await tray.commandExtension(mountId, { type: \"setProgress\", value: normalized.value, max: normalized.max });\n return snapshot();\n },\n setProgressState: async (value: BadgeState[\"progressState\"]) => {\n await ensureLoaded();\n if (capabilities.progress === \"unsupported\") {\n rejectUnsupported(\"progress\", \"setProgressState\");\n }\n state.progressState = value;\n await tray.commandExtension(mountId, { type: \"setProgressState\", value });\n return snapshot();\n },\n setOverlayIcon: async (value: BadgeState[\"overlayIcon\"]) => {\n await ensureLoaded();\n state.overlayIcon = value;\n await tray.commandExtension(mountId, { type: \"setOverlayIcon\", value });\n return snapshot();\n },\n setAttention: async (value: boolean) => {\n await ensureLoaded();\n state.attention = Boolean(value);\n await tray.commandExtension(mountId, { type: \"setAttention\", value: Boolean(value) });\n return snapshot();\n },\n showPanel: async () => {\n await ensureLoaded();\n await tray.commandExtension(mountId, { type: \"showPanel\" });\n return snapshot();\n },\n hidePanel: async () => {\n await ensureLoaded();\n await tray.commandExtension(mountId, { type: \"hidePanel\" });\n return snapshot();\n },\n reset: async () => {\n await ensureLoaded();\n Object.assign(state, seed.state);\n await tray.commandExtension(mountId, { type: \"reset\" });\n return snapshot();\n },\n };\n}\n"],"mappings":";AAsEA,MAAa,2BAAuC;CAClD,WAAW;CACX,YAAY;CACZ,eAAe;CACf,aAAa;CACb,eAAe;CACf,aAAa;CACb,WAAW;AACb;AAEA,MAAa,4BAA4B,aAA+C;CAOtF,OAAO;EACL;EACA,MAAM;EACN,cAAc;GARd,WAAW;GACX,UAAU;GACV,aAAa;GACb,WAAW;EAKQ;EACnB,OAAO,kBAAkB;EACzB,QAAQ;CACV;AACF;AAEA,MAAa,qBAAqB,OAAe,QAAiD;CAChG,MAAM,gBAAgB,OAAO,SAAS,OAAO,GAAG,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,GAAG,CAAC,IAAI;CAE1F,OAAO;EAAE,OADe,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,eAAe,KAAK,MAAM,KAAK,CAAC,CAAC,IAAI;EAC1E,KAAK;CAAc;AACtD;AAEA,MAAa,sBAAsB,UAAoE;CACrG,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AkB,YAAY,kBAAkB;GAElD,MAAM,gBAAgB;GACtB,MAAM,KAAK,iBAAiB,SAAS;IAAE,MAAM;IAAoB;GAAM,CAAC;GACxE,OAAO,SAAS;EAClB;EACA,gBAAgB,OAAO,UAAqC;GAC1D,MAAM,aAAa;GACnB,MAAM,cAAc;GACpB,MAAM,KAAK,iBAAiB,SAAS;IAAE,MAAM;IAAkB;GAAM,CAAC;GACtE,OAAO,SAAS;EAClB;EACA,cAAc,OAAO,UAAmB;GACtC,MAAM,aAAa;GACnB,MAAM,YAAY,QAAQ,KAAK;GAC/B,MAAM,KAAK,iBAAiB,SAAS;IAAE,MAAM;IAAgB,OAAO,QAAQ,KAAK;GAAE,CAAC;GACpF,OAAO,SAAS;EAClB;EACA,WAAW,YAAY;GACrB,MAAM,aAAa;GACnB,MAAM,KAAK,iBAAiB,SAAS,EAAE,MAAM,YAAY,CAAC;GAC1D,OAAO,SAAS;EAClB;EACA,WAAW,YAAY;GACrB,MAAM,aAAa;GACnB,MAAM,KAAK,iBAAiB,SAAS,EAAE,MAAM,YAAY,CAAC;GAC1D,OAAO,SAAS;EAClB;EACA,OAAO,YAAY;GACjB,MAAM,aAAa;GACnB,OAAO,OAAO,OAAO,KAAK,KAAK;GAC/B,MAAM,KAAK,iBAAiB,SAAS,EAAE,MAAM,QAAQ,CAAC;GACtD,OAAO,SAAS;EAClB;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/native-artifact.ts","../src/shared.ts","../src/index.ts"],"sourcesContent":["// Orthogonal intents (2026-07-19; original user request: pnpm install must be sufficient):\n// 1. Declare the official Badge platform package closure as platform-neutral data.\n// 2. Keep native package selection relative to this facade instead of consumer cwd.\n\nimport type { NativeExtensionPackageArtifact } from \"opentray\";\n\nexport const BADGE_NATIVE_ARTIFACT = {\n kind: \"package\",\n packageJsonUrl: new URL(\"../package.json\", import.meta.url).href,\n contractManifestUrl: new URL(\"../contract.json\", import.meta.url).href,\n targets: {\n \"darwin-arm64\": {\n packageName: \"@opentray/ext-badge-darwin-arm64\",\n libraryPath: \"lib/libopentray_ext_badge.dylib\",\n },\n \"darwin-x64\": {\n packageName: \"@opentray/ext-badge-darwin-x64\",\n libraryPath: \"lib/libopentray_ext_badge.dylib\",\n },\n \"win32-arm64\": {\n packageName: \"@opentray/ext-badge-windows-arm64\",\n libraryPath: \"bin/opentray_ext_badge.dll\",\n },\n \"win32-x64\": {\n packageName: \"@opentray/ext-badge-windows-x64\",\n libraryPath: \"bin/opentray_ext_badge.dll\",\n },\n },\n} satisfies NativeExtensionPackageArtifact;\n","export type BadgeCapabilityLevel = \"native\" | \"reduced\" | \"unsupported\";\n\nexport type BadgePlatform = \"darwin\" | \"win32\" | \"linux\";\n\nexport interface BadgeState {\n badgeText: string;\n badgeCount: number | null;\n progressValue: number;\n progressMax: number;\n progressState: \"none\" | \"indeterminate\" | \"normal\" | \"paused\" | \"error\";\n overlayIcon: \"none\" | \"dot\" | \"alert\";\n attention: boolean;\n}\n\nexport interface BadgeCapabilityFamily {\n badgeText: BadgeCapabilityLevel;\n progress: BadgeCapabilityLevel;\n overlayIcon: BadgeCapabilityLevel;\n attention: BadgeCapabilityLevel;\n}\n\nexport interface BadgeCapabilities {\n platform: BadgePlatform;\n mode: \"native\" | \"reduced\" | \"unsupported\";\n capabilities: BadgeCapabilityFamily;\n state: BadgeState;\n reason?: string;\n}\n\nexport type BadgeCommand =\n | { type: \"getCapabilities\" }\n | { type: \"setBadge\"; value: string }\n | { type: \"clearBadge\" }\n | { type: \"setProgress\"; value: number; max?: number }\n | { type: \"setProgressState\"; value: BadgeState[\"progressState\"] }\n | { type: \"setOverlayIcon\"; value: BadgeState[\"overlayIcon\"] }\n | { type: \"setAttention\"; value: boolean }\n | { type: \"showPanel\" }\n | { type: \"hidePanel\" }\n | { type: \"reset\" }\n ;\n\nexport type BadgeEvent =\n | { type: \"capabilities\"; snapshot: BadgeCapabilities }\n | { type: \"state\"; snapshot: BadgeCapabilities }\n | { type: \"result\"; op: string; ok: true; snapshot: BadgeCapabilities }\n | { type: \"result\"; op: string; ok: false; error: string; snapshot: BadgeCapabilities };\n\nexport interface BadgeHandle {\n getCapabilities(): Promise<BadgeCapabilities>;\n setBadge(value: string): Promise<BadgeCapabilities>;\n clearBadge(): Promise<BadgeCapabilities>;\n setProgress(value: number, max?: number): Promise<BadgeCapabilities>;\n setProgressState(value: BadgeState[\"progressState\"]): Promise<BadgeCapabilities>;\n setOverlayIcon(value: BadgeState[\"overlayIcon\"]): Promise<BadgeCapabilities>;\n setAttention(value: boolean): Promise<BadgeCapabilities>;\n showPanel(): Promise<BadgeCapabilities>;\n hidePanel(): Promise<BadgeCapabilities>;\n reset(): Promise<BadgeCapabilities>;\n}\n\nexport interface BadgePanelEnvelope {\n platform: BadgePlatform;\n mode: \"native\" | \"reduced\" | \"unsupported\";\n capabilities: BadgeCapabilityFamily;\n state: BadgeState;\n log: string[];\n reason?: string;\n}\n\nexport const defaultBadgeState = (): BadgeState => ({\n badgeText: \"12\",\n badgeCount: 12,\n progressValue: 0,\n progressMax: 100,\n progressState: \"none\",\n overlayIcon: \"dot\",\n attention: false,\n});\n\nexport const defaultBadgeCapabilities = (platform: BadgePlatform): BadgeCapabilities => {\n const common = {\n badgeText: \"reduced\",\n progress: \"unsupported\",\n overlayIcon: \"reduced\",\n attention: \"reduced\",\n } satisfies BadgeCapabilityFamily;\n return {\n platform,\n mode: \"reduced\",\n capabilities: common,\n state: defaultBadgeState(),\n reason: \"badge projection is currently reduced to a local proof surface\",\n };\n};\n\nexport const normalizeProgress = (value: number, max?: number): { value: number; max: number } => {\n const normalizedMax = Number.isFinite(max ?? 100) ? Math.max(1, Math.round(max ?? 100)) : 100;\n const normalizedValue = Number.isFinite(value) ? Math.max(0, Math.min(normalizedMax, Math.round(value))) : 0;\n return { value: normalizedValue, max: normalizedMax };\n};\n\nexport const normalizeBadgeText = (value: string): { badgeText: string; badgeCount: number | null } => {\n const badgeText = value.trim();\n const parsed = Number.parseInt(badgeText, 10);\n return {\n badgeText,\n badgeCount: Number.isFinite(parsed) ? parsed : null,\n };\n};\n\nexport const badgePanelEnvelopeFromCapabilities = (\n snapshot: BadgeCapabilities,\n): BadgePanelEnvelope => ({\n platform: snapshot.platform,\n mode: snapshot.mode,\n capabilities: snapshot.capabilities,\n state: snapshot.state,\n log: [],\n ...(snapshot.reason === undefined ? {} : { reason: snapshot.reason }),\n});\n","import type { ExtensionEnvelope } from \"@opentray/spec\";\nimport type { NativeExtensionArtifact, TrayHandle } from \"opentray\";\n\nimport { BADGE_NATIVE_ARTIFACT } from \"./native-artifact\";\n\nimport {\n badgePanelEnvelopeFromCapabilities,\n defaultBadgeCapabilities,\n normalizeBadgeText,\n normalizeProgress,\n type BadgeCapabilities,\n type BadgeCapabilityFamily,\n type BadgeEvent,\n type BadgeHandle,\n type BadgePanelEnvelope,\n type BadgePlatform,\n type BadgeState,\n} from \"./shared\";\n\nexport type * from \"./shared\";\nexport { badgePanelEnvelopeFromCapabilities } from \"./shared\";\n\nconst BADGE_EXTENSION_NAME = \"badge\";\nexport interface BadgeExtensionOptions {\n mountId?: string;\n artifact?: NativeExtensionArtifact;\n platform?: BadgePlatform;\n}\n\nexport interface BadgeExtensionCapability extends BadgeHandle {\n readonly platform: BadgePlatform;\n readonly getPanelEnvelope: () => Promise<BadgePanelEnvelope>;\n}\n\nexport const attachBadge = (tray: TrayHandle, options: BadgeExtensionOptions = {}): BadgeExtensionCapability => {\n const platform = options.platform ?? process.platform as BadgePlatform;\n const extension = tray.extend(BadgeExt, options);\n return {\n ...extension,\n platform,\n getPanelEnvelope: async () => badgePanelEnvelopeFromCapabilities(await extension.getCapabilities()),\n };\n};\n\nexport const BadgeExt = {\n name: BADGE_EXTENSION_NAME,\n artifact: BADGE_NATIVE_ARTIFACT,\n resolveMount(options: BadgeExtensionOptions | undefined) {\n return {\n ...(options?.mountId === undefined ? {} : { mountId: options.mountId }),\n ...(options?.artifact === undefined ? {} : { artifact: options.artifact }),\n };\n },\n extend(tray: TrayHandle, context, options: BadgeExtensionOptions | undefined): BadgeHandle {\n const requestedPlatform = options?.platform ?? (process.platform as BadgePlatform);\n const snapshot = defaultBadgeCapabilities(requestedPlatform);\n return createBadgeHandle(() => context.ensureLoaded(), tray, context.mountId, snapshot);\n },\n} satisfies import(\"opentray\").TrayExtension<BadgeHandle, BadgeExtensionOptions>;\n\nexport const isBadgeEvent = (event: ExtensionEnvelope): event is ExtensionEnvelope<BadgeEvent> =>\n event.scope.ext === BADGE_EXTENSION_NAME &&\n typeof event.data === \"object\" &&\n event.data !== null &&\n \"type\" in event.data;\n\nfunction createBadgeHandle(\n ensureLoaded: () => Promise<void>,\n tray: TrayHandle,\n mountId: string,\n seed: BadgeCapabilities,\n): BadgeHandle {\n const state: BadgeState = structuredClone(seed.state);\n const capabilities: BadgeCapabilityFamily = { ...seed.capabilities };\n const platform = seed.platform;\n const mode = seed.mode;\n const reason = seed.reason;\n\n const snapshot = (): BadgeCapabilities => ({\n platform,\n mode,\n capabilities: { ...capabilities },\n state: structuredClone(state),\n ...(reason === undefined ? {} : { reason }),\n });\n\n const rejectUnsupported = (family: keyof BadgeCapabilityFamily, op: string): never => {\n const support = capabilities[family];\n throw new Error(`${op} is ${support} on ${platform}`);\n };\n\n return {\n getCapabilities: async () => {\n await ensureLoaded();\n await tray.requestExtension(mountId, { type: \"getCapabilities\" });\n return snapshot();\n },\n setBadge: async (value: string) => {\n await ensureLoaded();\n const normalized = normalizeBadgeText(value);\n state.badgeText = normalized.badgeText;\n state.badgeCount = normalized.badgeCount;\n await tray.commandExtension(mountId, { type: \"setBadge\", value: normalized.badgeText });\n return snapshot();\n },\n clearBadge: async () => {\n await ensureLoaded();\n state.badgeText = \"\";\n state.badgeCount = null;\n await tray.commandExtension(mountId, { type: \"clearBadge\" });\n return snapshot();\n },\n setProgress: async (value: number, max?: number) => {\n await ensureLoaded();\n if (capabilities.progress === \"unsupported\") {\n rejectUnsupported(\"progress\", \"setProgress\");\n }\n const normalized = normalizeProgress(value, max);\n state.progressValue = normalized.value;\n state.progressMax = normalized.max;\n await tray.commandExtension(mountId, { type: \"setProgress\", value: normalized.value, max: normalized.max });\n return snapshot();\n },\n setProgressState: async (value: BadgeState[\"progressState\"]) => {\n await ensureLoaded();\n if (capabilities.progress === \"unsupported\") {\n rejectUnsupported(\"progress\", \"setProgressState\");\n }\n state.progressState = value;\n await tray.commandExtension(mountId, { type: \"setProgressState\", value });\n return snapshot();\n },\n setOverlayIcon: async (value: BadgeState[\"overlayIcon\"]) => {\n await ensureLoaded();\n state.overlayIcon = value;\n await tray.commandExtension(mountId, { type: \"setOverlayIcon\", value });\n return snapshot();\n },\n setAttention: async (value: boolean) => {\n await ensureLoaded();\n state.attention = Boolean(value);\n await tray.commandExtension(mountId, { type: \"setAttention\", value: Boolean(value) });\n return snapshot();\n },\n showPanel: async () => {\n await ensureLoaded();\n await tray.commandExtension(mountId, { type: \"showPanel\" });\n return snapshot();\n },\n hidePanel: async () => {\n await ensureLoaded();\n await tray.commandExtension(mountId, { type: \"hidePanel\" });\n return snapshot();\n },\n reset: async () => {\n await ensureLoaded();\n Object.assign(state, seed.state);\n await tray.commandExtension(mountId, { type: \"reset\" });\n return snapshot();\n },\n };\n}\n"],"mappings":";AAMA,MAAa,wBAAwB;CACnC,MAAM;CACN,gBAAgB,IAAI,IAAI,mBAAmB,OAAO,KAAK,GAAG,EAAE;CAC5D,qBAAqB,IAAI,IAAI,oBAAoB,OAAO,KAAK,GAAG,EAAE;CAClE,SAAS;EACP,gBAAgB;GACd,aAAa;GACb,aAAa;EACf;EACA,cAAc;GACZ,aAAa;GACb,aAAa;EACf;EACA,eAAe;GACb,aAAa;GACb,aAAa;EACf;EACA,aAAa;GACX,aAAa;GACb,aAAa;EACf;CACF;AACF;;;AC0CA,MAAa,2BAAuC;CAClD,WAAW;CACX,YAAY;CACZ,eAAe;CACf,aAAa;CACb,eAAe;CACf,aAAa;CACb,WAAW;AACb;AAEA,MAAa,4BAA4B,aAA+C;C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,MAAM,QAAQ,CAAC;GACtD,OAAO,SAAS;EAClB;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentray/ext-badge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Official OpenTray status extension backed by the OpenTray extension ABI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
+
"contract.json",
|
|
19
20
|
"dist",
|
|
20
21
|
"README.md"
|
|
21
22
|
],
|
|
@@ -24,17 +25,17 @@
|
|
|
24
25
|
"opentray": ">=0.0.0"
|
|
25
26
|
},
|
|
26
27
|
"optionalDependencies": {
|
|
27
|
-
"@opentray/ext-badge-darwin-arm64": "0.
|
|
28
|
-
"@opentray/ext-badge-darwin-x64": "0.
|
|
29
|
-
"@opentray/ext-badge-windows-arm64": "0.
|
|
30
|
-
"@opentray/ext-badge-windows-x64": "0.
|
|
28
|
+
"@opentray/ext-badge-darwin-arm64": "0.15.0",
|
|
29
|
+
"@opentray/ext-badge-darwin-x64": "0.15.0",
|
|
30
|
+
"@opentray/ext-badge-windows-arm64": "0.15.0",
|
|
31
|
+
"@opentray/ext-badge-windows-x64": "0.15.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"tsdown": "^0.22.1",
|
|
34
35
|
"typescript": "^6.0.3",
|
|
35
36
|
"vitest": "^4.1.7",
|
|
36
|
-
"@opentray/spec": "0.
|
|
37
|
-
"opentray": "0.
|
|
37
|
+
"@opentray/spec": "0.15.0",
|
|
38
|
+
"opentray": "0.15.0"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "tsdown src/index.ts --format esm --dts",
|