@io7/quantum-plugin-sdk 0.1.0-nightly.20260914.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # Quantum TypeScript Plugin SDK
2
+
3
+ > **Experimental:** JavaScript/TypeScript plugin development is still experimental. Many capabilities are not yet available, so it is not recommended as the primary development path. Prefer the .NET SDK for the current release.
4
+
5
+ `@io7/quantum-plugin-sdk` provides the typed lifecycle and host-capability contract for Quantum Web plugins.
6
+ Web plugins execute in a dedicated sandboxed iframe. The iframe is destroyed on unload, so timers, DOM state,
7
+ module globals, and event handlers cannot leak into the next runtime generation.
8
+
9
+ The .NET-only `IQuantumPlugin.ConfigureServices` hook configures a private `IServiceCollection` and therefore has
10
+ no TypeScript equivalent. Web plugins do not own a .NET DI container; use `activate` and its cleanup result for
11
+ runtime state and lifecycle, and consume Host capabilities through the supplied context.
12
+
13
+ ```ts
14
+ import { definePlugin, QuantumTopic } from "@io7/quantum-plugin-sdk";
15
+
16
+ export default definePlugin({
17
+ async activate(context) {
18
+ await context.log.info("Plugin activated");
19
+ const topic = QuantumTopic.of("devices.status");
20
+ const subscription = await context.eventBus.subscribe(topic, event => {
21
+ const payload = event.payload as { state?: string };
22
+ return context.log.info(`${event.publisher.id}: ${payload.state ?? "unknown"}`);
23
+ });
24
+ const publisher = context.eventBus.createPublisher<{ state: string }>(topic);
25
+ await publisher.publish({ state: "ready" });
26
+ return () => subscription.dispose();
27
+ },
28
+
29
+ mount({ element, route, locale, signal }) {
30
+ element.textContent = `${route.path} (${locale.cultureName})`;
31
+ signal.addEventListener("abort", () => element.replaceChildren(), { once: true });
32
+ }
33
+ });
34
+ ```
35
+
36
+ `QuantumPluginViewContext.locale` carries the Host-selected BCP-47 culture, ISO language, and text direction.
37
+ The Host remounts the view when the user changes language, so render localized copy and create locale-sensitive
38
+ `Intl` formatters inside `mount`.
39
+
40
+ The emitted plugin entry must be a single self-contained ESM file. Bundle dependencies into the entry with
41
+ esbuild, Rollup, Vite, or another ESM-capable bundler; runtime imports are intentionally unavailable inside the
42
+ opaque-origin frame.
43
+
44
+ Database schema migrations are package metadata rather than an iframe API. A Web plugin may use Prisma, Drizzle,
45
+ or another ORM during development, but its release declares `database.migrations` in `plugin.json` and ships an
46
+ append-only SQLite SQL history. The Host applies pending scripts before `activate`; the iframe receives no direct
47
+ database connection. See the repository Web plugin guide for the artifact and upgrade rules.
48
+
49
+ Installed plugins run as trusted, controlled code. Host navigation and name-routed plugin RPC are directly available;
50
+ an `integration` declaration is not required. TypeScript and .NET use the same RPC names and JSON boundary:
51
+
52
+ ```ts
53
+ const result = await context.rpc.invoke<Note[]>(
54
+ "quantum.plugin.notes.notes.find",
55
+ { text: "quantum" },
56
+ { traceId: "web-search" },
57
+ { signal: context.signal });
58
+
59
+ if (!result.isSuccess) {
60
+ throw new Error(`${result.errorCode}: ${result.message}`);
61
+ }
62
+ console.log(result.value);
63
+ ```
64
+
65
+ The same method can be addressed by its short `service.method` name or any method-level alias. Names are
66
+ case-insensitive. When multiple plugins implement a short name or alias, the Host logs the collision and selects
67
+ the implementation whose normalized plugin id is lexicographically smallest using ordinal comparison. A missing
68
+ name resolves to a failed `QuantumResult` with `rpc_not_found` instead of rejecting the Promise.
69
+
70
+ Each invocation owns a target DI scope, awaits the generated NOF Handler, serializes its `Result`, and then disposes
71
+ the scope. No CLR type name, service provider, or service instance enters the iframe.
72
+ Entries in `environment.snapshot().integrations` are informational declarations used for soft ordering; their `active`
73
+ field reports target availability and version compatibility but does not authorize or block interaction.
74
+
75
+ ## Plugin identity and version value objects
76
+
77
+ `QuantumPluginInfo` and `QuantumPluginIdentity` use the branded `PluginId` and `SemanticVersion` string types.
78
+ Construct external values at the boundary instead of casting unchecked strings:
79
+
80
+ ```ts
81
+ import { PluginId, SemanticVersion, VersionRange } from "@io7/quantum-plugin-sdk";
82
+
83
+ const pluginId = PluginId.of("Quantum.Plugin.Theme");
84
+ const current = SemanticVersion.parse("2.1.0-rc.2+linux.arm64");
85
+ const minimum = SemanticVersion.parse("2.1.0-beta.1");
86
+ const parts = SemanticVersion.components(current);
87
+ const range = VersionRange.parse("{1.2.3} | [2.0.0-alpha,3.0.0)");
88
+
89
+ if (SemanticVersion.compare(current, minimum) >= 0) {
90
+ console.log(pluginId, parts.major, parts.preReleaseIdentifiers, VersionRange.contains(range, current));
91
+ }
92
+ ```
93
+
94
+ `PluginId.of()` applies the same normalization, 128-character limit, character rules, and reserved `disabled`
95
+ check as the .NET SDK. `SemanticVersion.parse()` strictly requires SemVer 2.0.0 `major.minor.patch`; its numeric
96
+ components are `bigint`, and `SemanticVersion.compare()` ignores build metadata when determining precedence.
97
+ Both branded values remain strings on the JSON wire, preserving the existing iframe/Host payload shape.
98
+
99
+ Manifest `dependencies` and `integrations` use `versionRange` rather than the legacy `minVersion`. `VersionRange`
100
+ supports bounded or unbounded mathematical intervals, finite sets in braces, and unions separated by `|`; `(,)`
101
+ and `*` both mean all versions. Prereleases participate directly in SemVer precedence, while build metadata is
102
+ ignored, so `{1.2.3}` contains `1.2.3+linux-x64`. The branded range also remains a string on the JSON wire.
103
+
104
+ ## Topic EventBus
105
+
106
+ TypeScript and .NET plugins share the same Host EventBus. `QuantumTopic.of()` applies the same dot-delimited,
107
+ 255-character validation as the .NET `QuantumTopic` value object. Topics must match
108
+ `^[A-Za-z][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)*$`; the branded TypeScript type prevents passing unchecked
109
+ strings to the SDK API.
110
+
111
+ `QuantumEvent.payload` is the original JSON value. JavaScript already has a deserialized value, so the SDK does
112
+ not add CLR-style deserialization helpers; validate or narrow the `unknown` payload in the handler. Publishing
113
+ waits for all current subscribers, including asynchronous iframe handlers, and subscriber failures are returned
114
+ to the publisher. Disposing a subscription unregisters it immediately; runtime deactivation and iframe disposal
115
+ also remove all remaining subscriptions as a Host-side fallback. Messages are in-memory only and are not retained
116
+ or replayed.
@@ -0,0 +1,174 @@
1
+ export type MaybePromise<T> = T | PromiseLike<T>;
2
+ export type QuantumCleanup = void | (() => MaybePromise<void>) | {
3
+ dispose(): MaybePromise<void>;
4
+ };
5
+ export interface QuantumRpcOptions {
6
+ signal?: AbortSignal;
7
+ }
8
+ export interface QuantumPluginIdentity {
9
+ readonly id: PluginId;
10
+ readonly version: SemanticVersion;
11
+ readonly runtimeId: string;
12
+ }
13
+ export interface QuantumPluginInfo {
14
+ readonly id: PluginId;
15
+ readonly version: SemanticVersion;
16
+ }
17
+ declare const pluginIdBrand: unique symbol;
18
+ /** A normalized Quantum plugin identifier. */
19
+ export type PluginId = string & {
20
+ readonly [pluginIdBrand]: "PluginId";
21
+ };
22
+ /** Runtime factory and validator for PluginId values. */
23
+ export declare const PluginId: Readonly<{
24
+ maximumLength: 128;
25
+ of(value: string): PluginId;
26
+ tryParse(value: string): PluginId | null;
27
+ }>;
28
+ declare const semanticVersionBrand: unique symbol;
29
+ /** A validated Semantic Versioning 2.0.0 string. */
30
+ export type SemanticVersion = string & {
31
+ readonly [semanticVersionBrand]: "SemanticVersion";
32
+ };
33
+ export interface SemanticVersionComponents {
34
+ readonly major: bigint;
35
+ readonly minor: bigint;
36
+ readonly patch: bigint;
37
+ readonly preReleaseIdentifiers: readonly string[];
38
+ readonly buildMetadataIdentifiers: readonly string[];
39
+ readonly isPreRelease: boolean;
40
+ readonly preRelease: string | null;
41
+ readonly buildMetadata: string | null;
42
+ }
43
+ /** Parser, component accessor, and precedence comparator for SemanticVersion values. */
44
+ export declare const SemanticVersion: Readonly<{
45
+ parse(value: string): SemanticVersion;
46
+ tryParse(value: string): SemanticVersion | null;
47
+ components(value: SemanticVersion): SemanticVersionComponents;
48
+ compare(left: SemanticVersion, right: SemanticVersion): number;
49
+ }>;
50
+ declare const versionRangeBrand: unique symbol;
51
+ /** A validated union of Semantic Versioning 2.0.0 intervals and finite sets. */
52
+ export type VersionRange = string & {
53
+ readonly [versionRangeBrand]: "VersionRange";
54
+ };
55
+ /** Parser and membership test for VersionRange values. */
56
+ export declare const VersionRange: Readonly<{
57
+ parse(value: string): VersionRange;
58
+ tryParse(value: string): VersionRange | null;
59
+ contains(range: VersionRange, version: SemanticVersion): boolean;
60
+ }>;
61
+ declare const quantumTopicBrand: unique symbol;
62
+ /** A validated, dot-delimited EventBus topic. */
63
+ export type QuantumTopic = string & {
64
+ readonly [quantumTopicBrand]: "QuantumTopic";
65
+ };
66
+ /** Runtime factory and validator for QuantumTopic values. */
67
+ export declare const QuantumTopic: Readonly<{
68
+ of(value: string): QuantumTopic;
69
+ }>;
70
+ export interface QuantumEvent {
71
+ readonly id: string;
72
+ readonly topic: QuantumTopic;
73
+ readonly payload: unknown;
74
+ readonly publisher: QuantumPluginInfo;
75
+ /** ISO-8601 timestamp assigned by the Host. */
76
+ readonly publishedAt: string;
77
+ }
78
+ export interface QuantumEventPublisher<TMessage> {
79
+ readonly topic: QuantumTopic;
80
+ publish(message: TMessage, options?: QuantumRpcOptions): Promise<void>;
81
+ }
82
+ export interface QuantumEventSubscription {
83
+ readonly topic: QuantumTopic;
84
+ dispose(): Promise<void>;
85
+ }
86
+ export type QuantumEventHandler = (event: QuantumEvent) => MaybePromise<void>;
87
+ export interface QuantumEventBus {
88
+ createPublisher<TMessage>(topic: QuantumTopic): QuantumEventPublisher<TMessage>;
89
+ subscribe(topic: QuantumTopic, handler: QuantumEventHandler, options?: QuantumRpcOptions): Promise<QuantumEventSubscription>;
90
+ }
91
+ export interface QuantumPluginIntegration {
92
+ readonly pluginId: PluginId;
93
+ readonly versionRange: VersionRange;
94
+ /** Informational availability of the declared target; this does not gate plugin interaction. */
95
+ readonly active: boolean;
96
+ }
97
+ export interface QuantumEnvironmentSnapshot {
98
+ readonly plugin: QuantumPluginIdentity;
99
+ readonly loadedPlugins: readonly QuantumPluginInfo[];
100
+ readonly integrations: readonly QuantumPluginIntegration[];
101
+ }
102
+ export type QuantumRpcContext = Readonly<Record<string, unknown>>;
103
+ export type QuantumResult<TResponse = undefined> = {
104
+ readonly isSuccess: true;
105
+ readonly value: TResponse;
106
+ readonly errorCode: string;
107
+ readonly message: string;
108
+ readonly extra?: Readonly<Record<string, string>> | null;
109
+ } | {
110
+ readonly isSuccess: false;
111
+ readonly errorCode: string;
112
+ readonly message: string;
113
+ readonly extra?: Readonly<Record<string, string>> | null;
114
+ };
115
+ export interface QuantumRpcInvoker {
116
+ invoke<TResponse = undefined>(rpcName: string, payload: unknown, context?: QuantumRpcContext, options?: QuantumRpcOptions): Promise<QuantumResult<TResponse>>;
117
+ }
118
+ export interface QuantumPluginContext {
119
+ readonly plugin: QuantumPluginIdentity;
120
+ /** Aborted before plugin cleanup runs. */
121
+ readonly signal: AbortSignal;
122
+ readonly log: {
123
+ trace(message: string): Promise<void>;
124
+ debug(message: string): Promise<void>;
125
+ info(message: string): Promise<void>;
126
+ warn(message: string): Promise<void>;
127
+ error(message: string): Promise<void>;
128
+ };
129
+ readonly navigation: {
130
+ navigate(href: string): Promise<void>;
131
+ };
132
+ readonly environment: {
133
+ snapshot(): Promise<QuantumEnvironmentSnapshot>;
134
+ };
135
+ readonly eventBus: QuantumEventBus;
136
+ readonly assets: {
137
+ url(path: string): string;
138
+ readText(path: string, options?: QuantumRpcOptions): Promise<string>;
139
+ };
140
+ readonly rpc: QuantumRpcInvoker;
141
+ }
142
+ export interface QuantumRoute {
143
+ readonly path: string;
144
+ readonly view: string;
145
+ readonly title?: string | null;
146
+ }
147
+ /** Locale selected by the Host for the mounted plugin view. */
148
+ export interface QuantumLocale {
149
+ /** Normalized BCP-47 culture name, such as `en-US` or `zh-CN`. */
150
+ readonly cultureName: string;
151
+ /** ISO language name, such as `en` or `zh`. */
152
+ readonly languageName: string;
153
+ readonly textDirection: "ltr" | "rtl";
154
+ }
155
+ export interface QuantumPluginViewContext extends Omit<QuantumPluginContext, "signal"> {
156
+ /** The root element inside the plugin's isolated document. */
157
+ readonly element: HTMLElement;
158
+ readonly route: QuantumRoute;
159
+ readonly locale: QuantumLocale;
160
+ /** Aborted whenever the view is unmounted. */
161
+ readonly signal: AbortSignal;
162
+ }
163
+ export interface QuantumPluginDefinition {
164
+ activate?(context: QuantumPluginContext): MaybePromise<QuantumCleanup>;
165
+ deactivate?(context: QuantumPluginContext): MaybePromise<void>;
166
+ mount?(context: QuantumPluginViewContext): MaybePromise<QuantumCleanup>;
167
+ unmount?(context: QuantumPluginContext): MaybePromise<void>;
168
+ }
169
+ /**
170
+ * Adds compile-time checking while leaving the plugin definition unchanged for bundlers.
171
+ */
172
+ export declare function definePlugin<TDefinition extends QuantumPluginDefinition>(definition: TDefinition): TDefinition;
173
+ export {};
174
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAEjD,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC,GAC1B;IAAE,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;CACnC;AAED,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C,8CAA8C;AAC9C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,QAAQ,CAAC,CAAC,a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B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,CAAC;CACvC;AAED,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACpF,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,CAAC,OAAO,EAAE,oBAAoB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;IACvE,UAAU,CAAC,CAAC,OAAO,EAAE,oBAAoB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/D,KAAK,CAAC,CAAC,OAAO,EAAE,wBAAwB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;IACxE,OAAO,CAAC,CAAC,OAAO,EAAE,oBAAoB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,SAAS,uBAAuB,EACtE,UAAU,EAAE,WAAW,GACtB,WAAW,CAEb"}
package/dist/index.js ADDED
@@ -0,0 +1,287 @@
1
+ /** Runtime factory and validator for PluginId values. */
2
+ export const PluginId = Object.freeze({
3
+ maximumLength: 128,
4
+ of(value) {
5
+ if (typeof value !== "string" || value.trim().length === 0) {
6
+ throw new TypeError("A plugin id is required.");
7
+ }
8
+ const trimmed = value.trim();
9
+ if (!/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,126}[A-Za-z0-9])?$/.test(trimmed)) {
10
+ throw new TypeError("A plugin id must contain between 1 and 128 ASCII letters, numbers, dots, underscores, or hyphens, and must start and end with a letter or number.");
11
+ }
12
+ const normalized = trimmed.toLowerCase();
13
+ if (normalized === "disabled") {
14
+ throw new TypeError("Plugin id 'disabled' is reserved by the host.");
15
+ }
16
+ return normalized;
17
+ },
18
+ tryParse(value) {
19
+ try {
20
+ return PluginId.of(value);
21
+ }
22
+ catch (error) {
23
+ if (error instanceof TypeError) {
24
+ return null;
25
+ }
26
+ throw error;
27
+ }
28
+ }
29
+ });
30
+ /** Parser, component accessor, and precedence comparator for SemanticVersion values. */
31
+ export const SemanticVersion = Object.freeze({
32
+ parse(value) {
33
+ if (parseSemanticVersion(value) === null) {
34
+ throw new TypeError(`'${String(value)}' is not a valid Semantic Versioning 2.0.0 version.`);
35
+ }
36
+ return value;
37
+ },
38
+ tryParse(value) {
39
+ return parseSemanticVersion(value) === null ? null : value;
40
+ },
41
+ components(value) {
42
+ const components = parseSemanticVersion(value);
43
+ if (components === null) {
44
+ throw new TypeError(`'${String(value)}' is not a valid Semantic Versioning 2.0.0 version.`);
45
+ }
46
+ return components;
47
+ },
48
+ compare(left, right) {
49
+ const leftComponents = parseSemanticVersion(left);
50
+ const rightComponents = parseSemanticVersion(right);
51
+ if (leftComponents === null || rightComponents === null) {
52
+ throw new TypeError("SemanticVersion.compare requires valid Semantic Versioning 2.0.0 values.");
53
+ }
54
+ return compareSemanticVersions(leftComponents, rightComponents);
55
+ }
56
+ });
57
+ function parseSemanticVersion(value) {
58
+ if (typeof value !== "string" || value.length === 0) {
59
+ return null;
60
+ }
61
+ const buildSeparator = value.indexOf("+");
62
+ if (buildSeparator >= 0 && (value.indexOf("+", buildSeparator + 1) >= 0
63
+ || buildSeparator === value.length - 1)) {
64
+ return null;
65
+ }
66
+ const versionWithoutBuild = buildSeparator < 0 ? value : value.slice(0, buildSeparator);
67
+ const buildValue = buildSeparator < 0 ? null : value.slice(buildSeparator + 1);
68
+ const preReleaseSeparator = versionWithoutBuild.indexOf("-");
69
+ if (preReleaseSeparator >= 0 && preReleaseSeparator === versionWithoutBuild.length - 1) {
70
+ return null;
71
+ }
72
+ const coreValue = preReleaseSeparator < 0
73
+ ? versionWithoutBuild
74
+ : versionWithoutBuild.slice(0, preReleaseSeparator);
75
+ const preReleaseValue = preReleaseSeparator < 0
76
+ ? null
77
+ : versionWithoutBuild.slice(preReleaseSeparator + 1);
78
+ const coreIdentifiers = coreValue.split(".");
79
+ if (coreIdentifiers.length !== 3
80
+ || coreIdentifiers.some(identifier => !/^(?:0|[1-9][0-9]*)$/.test(identifier))) {
81
+ return null;
82
+ }
83
+ const preReleaseIdentifiers = preReleaseValue === null ? [] : preReleaseValue.split(".");
84
+ const buildMetadataIdentifiers = buildValue === null ? [] : buildValue.split(".");
85
+ const validIdentifier = (identifier) => /^[0-9A-Za-z-]+$/.test(identifier);
86
+ if (preReleaseIdentifiers.some(identifier => !validIdentifier(identifier) || (/^[0-9]+$/.test(identifier)
87
+ && identifier.length > 1 && identifier.startsWith("0")))
88
+ || buildMetadataIdentifiers.some(identifier => !validIdentifier(identifier))) {
89
+ return null;
90
+ }
91
+ return Object.freeze({
92
+ major: BigInt(coreIdentifiers[0]),
93
+ minor: BigInt(coreIdentifiers[1]),
94
+ patch: BigInt(coreIdentifiers[2]),
95
+ preReleaseIdentifiers: Object.freeze(preReleaseIdentifiers),
96
+ buildMetadataIdentifiers: Object.freeze(buildMetadataIdentifiers),
97
+ isPreRelease: preReleaseIdentifiers.length > 0,
98
+ preRelease: preReleaseValue,
99
+ buildMetadata: buildValue
100
+ });
101
+ }
102
+ function compareSemanticVersions(left, right) {
103
+ for (const [leftNumber, rightNumber] of [
104
+ [left.major, right.major],
105
+ [left.minor, right.minor],
106
+ [left.patch, right.patch]
107
+ ]) {
108
+ if (leftNumber !== rightNumber) {
109
+ return leftNumber < rightNumber ? -1 : 1;
110
+ }
111
+ }
112
+ if (left.preReleaseIdentifiers.length === 0 || right.preReleaseIdentifiers.length === 0) {
113
+ if (left.preReleaseIdentifiers.length === right.preReleaseIdentifiers.length) {
114
+ return 0;
115
+ }
116
+ return left.preReleaseIdentifiers.length === 0 ? 1 : -1;
117
+ }
118
+ const sharedLength = Math.min(left.preReleaseIdentifiers.length, right.preReleaseIdentifiers.length);
119
+ for (let index = 0; index < sharedLength; index++) {
120
+ const leftIdentifier = left.preReleaseIdentifiers[index];
121
+ const rightIdentifier = right.preReleaseIdentifiers[index];
122
+ const leftNumeric = /^[0-9]+$/.test(leftIdentifier);
123
+ const rightNumeric = /^[0-9]+$/.test(rightIdentifier);
124
+ if (leftNumeric !== rightNumeric) {
125
+ return leftNumeric ? -1 : 1;
126
+ }
127
+ if (leftIdentifier !== rightIdentifier) {
128
+ if (leftNumeric) {
129
+ return leftIdentifier.length === rightIdentifier.length
130
+ ? leftIdentifier < rightIdentifier ? -1 : 1
131
+ : leftIdentifier.length < rightIdentifier.length ? -1 : 1;
132
+ }
133
+ return leftIdentifier < rightIdentifier ? -1 : 1;
134
+ }
135
+ }
136
+ return Math.sign(left.preReleaseIdentifiers.length - right.preReleaseIdentifiers.length);
137
+ }
138
+ /** Parser and membership test for VersionRange values. */
139
+ export const VersionRange = Object.freeze({
140
+ parse(value) {
141
+ const range = parseVersionRange(value);
142
+ if (range === null) {
143
+ throw new TypeError(`'${String(value)}' is not a valid version range.`);
144
+ }
145
+ return range.normalized;
146
+ },
147
+ tryParse(value) {
148
+ const range = parseVersionRange(value);
149
+ return range === null ? null : range.normalized;
150
+ },
151
+ contains(range, version) {
152
+ const parsedRange = parseVersionRange(range);
153
+ const parsedVersion = parseSemanticVersion(version);
154
+ if (parsedRange === null || parsedVersion === null) {
155
+ throw new TypeError("VersionRange.contains requires valid range and version values.");
156
+ }
157
+ return parsedRange.terms.some(term => versionRangeTermContains(term, parsedVersion));
158
+ }
159
+ });
160
+ function parseVersionRange(value) {
161
+ if (typeof value !== "string" || value.trim().length === 0) {
162
+ return null;
163
+ }
164
+ const rawTerms = value.trim().split("|");
165
+ if (rawTerms.some(term => term.trim().length === 0)) {
166
+ return null;
167
+ }
168
+ const terms = [];
169
+ const normalizedTerms = [];
170
+ for (const rawTerm of rawTerms) {
171
+ const parsed = parseVersionRangeTerm(rawTerm.trim());
172
+ if (parsed === null) {
173
+ return null;
174
+ }
175
+ terms.push(parsed.term);
176
+ normalizedTerms.push(parsed.normalized);
177
+ }
178
+ return Object.freeze({
179
+ normalized: normalizedTerms.join("|"),
180
+ terms: Object.freeze(terms)
181
+ });
182
+ }
183
+ function parseVersionRangeTerm(term) {
184
+ if (term === "*") {
185
+ return {
186
+ normalized: "(,)",
187
+ term: {
188
+ kind: "interval",
189
+ lowerBound: null,
190
+ includeLowerBound: false,
191
+ upperBound: null,
192
+ includeUpperBound: false
193
+ }
194
+ };
195
+ }
196
+ if (term.startsWith("{") && term.endsWith("}")) {
197
+ const values = term.slice(1, -1).split(",").map(value => value.trim());
198
+ if (values.length === 0 || values.some(value => value.length === 0)) {
199
+ return null;
200
+ }
201
+ const versions = values.map(parseSemanticVersion);
202
+ if (versions.some(version => version === null)) {
203
+ return null;
204
+ }
205
+ return {
206
+ normalized: `{${values.join(",")}}`,
207
+ term: { kind: "set", versions: versions }
208
+ };
209
+ }
210
+ if (term.length < 3
211
+ || !(term.startsWith("[") || term.startsWith("("))
212
+ || !(term.endsWith("]") || term.endsWith(")"))) {
213
+ return null;
214
+ }
215
+ const bounds = term.slice(1, -1).split(",").map(value => value.trim());
216
+ if (bounds.length !== 2) {
217
+ return null;
218
+ }
219
+ const lowerValue = bounds[0];
220
+ const upperValue = bounds[1];
221
+ const includeLowerBound = term.startsWith("[");
222
+ const includeUpperBound = term.endsWith("]");
223
+ if ((lowerValue.length === 0 && includeLowerBound)
224
+ || (upperValue.length === 0 && includeUpperBound)) {
225
+ return null;
226
+ }
227
+ const lowerBound = lowerValue.length === 0 ? null : parseSemanticVersion(lowerValue);
228
+ const upperBound = upperValue.length === 0 ? null : parseSemanticVersion(upperValue);
229
+ if ((lowerValue.length > 0 && lowerBound === null)
230
+ || (upperValue.length > 0 && upperBound === null)) {
231
+ return null;
232
+ }
233
+ if (lowerBound !== null && upperBound !== null) {
234
+ const comparison = compareSemanticVersions(lowerBound, upperBound);
235
+ if (comparison > 0 || (comparison === 0 && (!includeLowerBound || !includeUpperBound))) {
236
+ return null;
237
+ }
238
+ }
239
+ return {
240
+ normalized: `${term[0]}${lowerValue},${upperValue}${term.at(-1)}`,
241
+ term: {
242
+ kind: "interval",
243
+ lowerBound,
244
+ includeLowerBound,
245
+ upperBound,
246
+ includeUpperBound
247
+ }
248
+ };
249
+ }
250
+ function versionRangeTermContains(term, version) {
251
+ if (term.kind === "set") {
252
+ return term.versions.some(candidate => compareSemanticVersions(candidate, version) === 0);
253
+ }
254
+ if (term.lowerBound !== null) {
255
+ const comparison = compareSemanticVersions(version, term.lowerBound);
256
+ if (comparison < 0 || (comparison === 0 && !term.includeLowerBound)) {
257
+ return false;
258
+ }
259
+ }
260
+ if (term.upperBound !== null) {
261
+ const comparison = compareSemanticVersions(version, term.upperBound);
262
+ if (comparison > 0 || (comparison === 0 && !term.includeUpperBound)) {
263
+ return false;
264
+ }
265
+ }
266
+ return true;
267
+ }
268
+ /** Runtime factory and validator for QuantumTopic values. */
269
+ export const QuantumTopic = Object.freeze({
270
+ of(value) {
271
+ if (typeof value !== "string" || value.length === 0 || value.length > 255) {
272
+ throw new TypeError("A topic must contain between 1 and 255 characters.");
273
+ }
274
+ const match = /^[A-Za-z][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)*$/.exec(value);
275
+ if (match?.[0] !== value) {
276
+ throw new TypeError("A topic must match ^[A-Za-z][A-Za-z0-9_-]*(\\.[A-Za-z0-9][A-Za-z0-9_-]*)*$/.");
277
+ }
278
+ return value;
279
+ }
280
+ });
281
+ /**
282
+ * Adds compile-time checking while leaving the plugin definition unchanged for bundlers.
283
+ */
284
+ export function definePlugin(definition) {
285
+ return definition;
286
+ }
287
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,yDAAyD;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,GAAG;IAElB,EAAE,CAAC,KAAa;QACd,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,oDAAoD,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,SAAS,CACjB,mJAAmJ,CACpJ,CAAC;QACJ,CAAC;QACD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,UAAsB,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC;YACH,OAAO,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAoBH,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CA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}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@io7/quantum-plugin-sdk",
3
+ "version": "0.1.0-nightly.20260914.3.3",
4
+ "description": "TypeScript SDK for isolated Quantum Web plugins",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.json",
20
+ "test": "npm run build && node --test test/*.test.mjs"
21
+ },
22
+ "keywords": [
23
+ "quantum",
24
+ "plugin",
25
+ "typescript"
26
+ ],
27
+ "license": "MIT",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/XmmShp/Quantum.Sdk.git"
34
+ },
35
+ "homepage": "https://github.com/XmmShp/Quantum.Sdk#readme",
36
+ "bugs": "https://github.com/XmmShp/Quantum.Sdk/issues",
37
+ "devDependencies": {
38
+ "typescript": "5.9.2"
39
+ }
40
+ }