push neon reactor

This commit is contained in:
2026-07-12 15:11:38 +02:00
parent 172e72dbcd
commit aeab5f7820
9597 changed files with 2407488 additions and 0 deletions
@@ -0,0 +1,41 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export interface InitWithPortMessage {
messageType: 'initCommunicationWithPort';
instanceId: string;
}
/** Handshake response sent by the host via the MessagePort. */
export interface InitCommunicationMessage {
messageType: 'initCommunication';
antiCSRFToken: string;
}
/** Plugin call sent by the app to the host on the port. */
export interface PluginCallMessage {
isPluginCall: true;
callbackId: string;
/** @deprecated Use fully-qualified action keys instead (e.g. 'AppLifecycle.getContext'). */
service?: string;
action: string;
actionArgs: unknown[];
antiCSRFToken: string | undefined;
}
/** Plugin response sent by the host to the app on the port. */
export interface PluginResponseMessage {
isPluginCall: true;
callbackId: string;
status: (typeof PluginCallStatus)[keyof typeof PluginCallStatus];
args: unknown[];
keepCallback: boolean;
}
/** Status codes for plugin call responses. */
export declare const PluginCallStatus: {
readonly Pending: 0;
readonly Success: 1;
readonly Error: 2;
};
/** Type guard for InitWithPortMessage. */
export declare function isInitWithPortMessage(data: unknown): data is InitWithPortMessage;
/** Type guard for PluginCallMessage. */
export declare function isPluginCallMessage(data: unknown): data is PluginCallMessage;
//# sourceMappingURL=MessageProtocol.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"MessageProtocol.d.ts","sourceRoot":"","sources":["../../src/communication/MessageProtocol.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,2BAA2B,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;IACjE,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,8CAA8C;AAC9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,0CAA0C;AAC1C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,mBAAmB,CAMhF;AAED,wCAAwC;AACxC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,iBAAiB,CAW5E"}
@@ -0,0 +1,29 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/** Status codes for plugin call responses. */
export const PluginCallStatus = {
Pending: 0,
Success: 1,
Error: 2,
};
/** Type guard for InitWithPortMessage. */
export function isInitWithPortMessage(data) {
if (typeof data !== 'object' || data === null) {
return false;
}
const msg = data;
return msg.messageType === 'initCommunicationWithPort' && typeof msg.instanceId === 'string';
}
/** Type guard for PluginCallMessage. */
export function isPluginCallMessage(data) {
if (typeof data !== 'object' || data === null) {
return false;
}
const msg = data;
return (msg.isPluginCall === true &&
typeof msg.callbackId === 'string' &&
typeof msg.action === 'string' &&
Array.isArray(msg.actionArgs));
}
//# sourceMappingURL=MessageProtocol.js.map
@@ -0,0 +1 @@
{"version":3,"file":"MessageProtocol.js","sourceRoot":"","sources":["../../src/communication/MessageProtocol.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiCH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACA,CAAC;AAEX,0CAA0C;AAC1C,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,OAAO,GAAG,CAAC,WAAW,KAAK,2BAA2B,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC;AAC/F,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,OAAO,CACL,GAAG,CAAC,YAAY,KAAK,IAAI;QACzB,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ;QAC9B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,48 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/**
* **Wire Contract Guards — Message Protocol Compile-Time Layer**
*
* This file uses TypeScript conditional types to assert exact type equality
* for every message envelope interface. If any interface changes shape,
* `tsc` will fail.
*
* This file produces no runtime output — it exists solely for `bun run check-types`.
*/
import type { InitCommunicationMessage, InitWithPortMessage, PluginCallMessage, PluginCallStatus, PluginResponseMessage } from './MessageProtocol.js';
type IsExact<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
type Assert<T extends true> = T;
type _InitWithPortMessage = Assert<IsExact<InitWithPortMessage, {
messageType: 'initCommunicationWithPort';
instanceId: string;
}>>;
type _InitCommunicationMessage = Assert<IsExact<InitCommunicationMessage, {
messageType: 'initCommunication';
antiCSRFToken: string;
}>>;
type _PluginCallMessage = Assert<IsExact<PluginCallMessage, {
isPluginCall: true;
callbackId: string;
/** @deprecated */ service?: string;
action: string;
actionArgs: unknown[];
antiCSRFToken: string | undefined;
}>>;
type _PluginResponseMessage = Assert<IsExact<PluginResponseMessage, {
isPluginCall: true;
callbackId: string;
status: (typeof PluginCallStatus)[keyof typeof PluginCallStatus];
args: unknown[];
keepCallback: boolean;
}>>;
type _PluginCallStatusType = Assert<IsExact<(typeof PluginCallStatus)[keyof typeof PluginCallStatus], 0 | 1 | 2>>;
export type _ContractChecks = [
_InitWithPortMessage,
_InitCommunicationMessage,
_PluginCallMessage,
_PluginResponseMessage,
_PluginCallStatusType
];
export {};
//# sourceMappingURL=MessageProtocolContracts.typecheck.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"MessageProtocolContracts.typecheck.d.ts","sourceRoot":"","sources":["../../src/communication/MessageProtocolContracts.typecheck.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,IACf,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACrF,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAIhC,KAAK,oBAAoB,GAAG,MAAM,CAChC,OAAO,CACL,mBAAmB,EACnB;IACE,WAAW,EAAE,2BAA2B,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CACF,CACF,CAAC;AAEF,KAAK,yBAAyB,GAAG,MAAM,CACrC,OAAO,CACL,wBAAwB,EACxB;IACE,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB,CACF,CACF,CAAC;AAEF,KAAK,kBAAkB,GAAG,MAAM,CAC9B,OAAO,CACL,iBAAiB,EACjB;IACE,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,CACF,CACF,CAAC;AAEF,KAAK,sBAAsB,GAAG,MAAM,CAClC,OAAO,CACL,qBAAqB,EACrB;IACE,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;IACjE,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB,CACF,CACF,CAAC;AAIF,KAAK,qBAAqB,GAAG,MAAM,CACjC,OAAO,CAAC,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAC7E,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB;IACpB,yBAAyB;IACzB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;CACtB,CAAC"}
@@ -0,0 +1,5 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export {};
//# sourceMappingURL=MessageProtocolContracts.typecheck.js.map
@@ -0,0 +1 @@
{"version":3,"file":"MessageProtocolContracts.typecheck.js","sourceRoot":"","sources":["../../src/communication/MessageProtocolContracts.typecheck.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,5 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { InitCommunicationMessage, InitWithPortMessage, isInitWithPortMessage, isPluginCallMessage, PluginCallMessage, PluginCallStatus, PluginResponseMessage, } from './MessageProtocol.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/communication/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { isInitWithPortMessage, isPluginCallMessage, PluginCallStatus, } from './MessageProtocol.js';
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/communication/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,qBAAqB,EACrB,mBAAmB,EAEnB,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC"}