@jsprismarine/console-protocol 0.23.0-unstable-20261121073620 → 0.23.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/CHANGELOG.md +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/messages.d.ts +2 -2
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @jsprismarine/console-protocol
|
|
2
2
|
|
|
3
|
-
## 0.23.0
|
|
3
|
+
## 0.23.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
- [#3273](https://github.com/JSPrismarine/JSPrismarine/pull/3273) [`e9c34cb`](https://github.com/JSPrismarine/JSPrismarine/commit/e9c34cb7afbfe8232eab6c8b3dd506f8e2d135e8) Thanks [@filiphsps](https://github.com/filiphsps)! - The server reports how far its start has got. `Kernel` takes an `onStart` option that hears each module begin and finish starting; a callback that throws is logged and the start goes on, the console protocol gains a `boot` message carrying each step, and a server with a remote console attached sends one for every step before it reports `running`.
|
|
16
16
|
|
|
17
17
|
- [`3c7a098`](https://github.com/JSPrismarine/JSPrismarine/commit/3c7a09872272cac3aa07809e0fba3879769708ae) Thanks [@filiphsps](https://github.com/filiphsps)! - The console's usage card now knows how many words each argument takes, so in `tp @s 0 64` it keeps `<position>` marked through all three coordinates instead of moving on to the next argument. Argument types say how many words they read (`argumentWords`): three for a position, two for a Java rotation or two-dimensional position, and the rest of the line for a message, JSON, NBT or a nested command. `CommandManager.commandReference()` sends a count for each part of each form as `usageWords`, and the console protocol's `CommandInfo` carries it.
|
|
18
|
-
- Updated dependencies [[`60edd7a`](https://github.com/JSPrismarine/JSPrismarine/commit/60edd7a1234650367fe5c2406ee402641be33ed9), [`bf419b8`](https://github.com/JSPrismarine/JSPrismarine/commit/bf419b82bfea52c095ca09b02c1c4ac955ac1d0a), [`c8e1685`](https://github.com/JSPrismarine/JSPrismarine/commit/c8e1685ae8316255d39674af9d00ac8d778f674d), [`b41035b`](https://github.com/JSPrismarine/JSPrismarine/commit/b41035be9b61570008b3405aa169418b19081915), [`4bda824`](https://github.com/JSPrismarine/JSPrismarine/commit/4bda8241a8631da2d205133c85fd361871d6cf61), [`7e2e6f3`](https://github.com/JSPrismarine/JSPrismarine/commit/7e2e6f3cff1f20a11a3f59aac94c68a33fa71a35), [`3e71a8d`](https://github.com/JSPrismarine/JSPrismarine/commit/3e71a8dd75bd0a97e0f8587666f60f160844ff0b), [`586269e`](https://github.com/JSPrismarine/JSPrismarine/commit/586269e324cddfe57caf4206f387895cda6d479f), [`5d2fb0e`](https://github.com/JSPrismarine/JSPrismarine/commit/5d2fb0eb3730e59260a09e60c130e57e5fdb099c), [`936970c`](https://github.com/JSPrismarine/JSPrismarine/commit/936970c04f98b392e4b753f3c89224da3d03cb49), [`57caf26`](https://github.com/JSPrismarine/JSPrismarine/commit/57caf2632f92e5da55ce6eedc4eb0be3d66190d4), [`4b590cf`](https://github.com/JSPrismarine/JSPrismarine/commit/4b590cf6c529d17d8df20d8eab9b2157dc213a19), [`349a814`](https://github.com/JSPrismarine/JSPrismarine/commit/349a81448bfc8be2f901efe14527b8c9334f11eb), [`
|
|
19
|
-
- @jsprismarine/errors@0.23.0
|
|
20
|
-
- @jsprismarine/logger@0.23.0
|
|
18
|
+
- Updated dependencies [[`60edd7a`](https://github.com/JSPrismarine/JSPrismarine/commit/60edd7a1234650367fe5c2406ee402641be33ed9), [`bf419b8`](https://github.com/JSPrismarine/JSPrismarine/commit/bf419b82bfea52c095ca09b02c1c4ac955ac1d0a), [`c8e1685`](https://github.com/JSPrismarine/JSPrismarine/commit/c8e1685ae8316255d39674af9d00ac8d778f674d), [`b41035b`](https://github.com/JSPrismarine/JSPrismarine/commit/b41035be9b61570008b3405aa169418b19081915), [`4bda824`](https://github.com/JSPrismarine/JSPrismarine/commit/4bda8241a8631da2d205133c85fd361871d6cf61), [`7e2e6f3`](https://github.com/JSPrismarine/JSPrismarine/commit/7e2e6f3cff1f20a11a3f59aac94c68a33fa71a35), [`3e71a8d`](https://github.com/JSPrismarine/JSPrismarine/commit/3e71a8dd75bd0a97e0f8587666f60f160844ff0b), [`586269e`](https://github.com/JSPrismarine/JSPrismarine/commit/586269e324cddfe57caf4206f387895cda6d479f), [`5d2fb0e`](https://github.com/JSPrismarine/JSPrismarine/commit/5d2fb0eb3730e59260a09e60c130e57e5fdb099c), [`936970c`](https://github.com/JSPrismarine/JSPrismarine/commit/936970c04f98b392e4b753f3c89224da3d03cb49), [`57caf26`](https://github.com/JSPrismarine/JSPrismarine/commit/57caf2632f92e5da55ce6eedc4eb0be3d66190d4), [`4b590cf`](https://github.com/JSPrismarine/JSPrismarine/commit/4b590cf6c529d17d8df20d8eab9b2157dc213a19), [`349a814`](https://github.com/JSPrismarine/JSPrismarine/commit/349a81448bfc8be2f901efe14527b8c9334f11eb), [`51ba202`](https://github.com/JSPrismarine/JSPrismarine/commit/51ba202baff773329d73211062ceed830d253b4f), [`aef478a`](https://github.com/JSPrismarine/JSPrismarine/commit/aef478a92f329bde9046fe616c9e50923f825dfd), [`56200a6`](https://github.com/JSPrismarine/JSPrismarine/commit/56200a61535d916f0c41a11d077752b194e4c08b), [`c500335`](https://github.com/JSPrismarine/JSPrismarine/commit/c5003358e3a7199593c6ddcdbe4bdf63f8c29fac), [`e090dd7`](https://github.com/JSPrismarine/JSPrismarine/commit/e090dd75379edbfc415d84925e48af29aaa4864e), [`6e758f9`](https://github.com/JSPrismarine/JSPrismarine/commit/6e758f9de80c357c12d992bf473f1bdac86fb274), [`93a1b61`](https://github.com/JSPrismarine/JSPrismarine/commit/93a1b610493f401c4ac62881f70b3dee8c882f33), [`e1c982e`](https://github.com/JSPrismarine/JSPrismarine/commit/e1c982eeed0dfd682b5680c45c69159e21fd9ec0), [`9579362`](https://github.com/JSPrismarine/JSPrismarine/commit/9579362b4070e246d6300d2f4e2dca2ab4715124), [`f18ef7c`](https://github.com/JSPrismarine/JSPrismarine/commit/f18ef7c595f58a267b5371baab96390d0282616d), [`cf88d2f`](https://github.com/JSPrismarine/JSPrismarine/commit/cf88d2f8c2184bd4e116db888d4528fa27f5338d), [`d6c69e4`](https://github.com/JSPrismarine/JSPrismarine/commit/d6c69e43051eb091f0b4a17c0f33799f5944caf3), [`0792e2a`](https://github.com/JSPrismarine/JSPrismarine/commit/0792e2a7e6e5e98729b80df412262fd549ea3cb9), [`1c3be54`](https://github.com/JSPrismarine/JSPrismarine/commit/1c3be5465a2865072ac0f16b4848ee0cd9b6b13a), [`db04d85`](https://github.com/JSPrismarine/JSPrismarine/commit/db04d8520c1d43b88196c14229f36f5c8e71f3c1)]:
|
|
19
|
+
- @jsprismarine/errors@0.23.0
|
|
20
|
+
- @jsprismarine/logger@0.23.0
|
|
21
21
|
|
|
22
22
|
## 0.22.0
|
|
23
23
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export type { BootState, CommandInfo, ConsoleMessage, ConsoleMessageType, Lifecy
|
|
|
6
6
|
export { BOOT_STATES, isBootState, isConsoleMessage, isLifecycleState, isServerMessage, LIFECYCLE_STATES, PROTOCOL_VERSION } from './messages.js';
|
|
7
7
|
export { subprocessLink } from './subprocessLink.js';
|
|
8
8
|
export type { IpcChild } from './subprocessLink.js';
|
|
9
|
+
export type { Envelope } from './messages.js';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/messages.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import type { LogLevel } from '@jsprismarine/logger/levels';
|
|
|
5
5
|
* instead of misreading each other.
|
|
6
6
|
*/
|
|
7
7
|
export declare const PROTOCOL_VERSION = 1;
|
|
8
|
-
|
|
8
|
+
/** The fields every console message starts with: its `type` and the protocol version it speaks. */
|
|
9
|
+
export interface Envelope<T extends string> {
|
|
9
10
|
type: T;
|
|
10
11
|
v: typeof PROTOCOL_VERSION;
|
|
11
12
|
}
|
|
@@ -152,5 +153,4 @@ export declare function isServerMessage(value: unknown): value is ServerMessage;
|
|
|
152
153
|
* required fields present and of the right kind. The `subscribe` level must be a log level.
|
|
153
154
|
*/
|
|
154
155
|
export declare function isConsoleMessage(value: unknown): value is ConsoleMessage;
|
|
155
|
-
export {};
|
|
156
156
|
//# sourceMappingURL=messages.d.ts.map
|
package/dist/messages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sources":["../src/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sources":["../src/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,mGAAmG;AACnG,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM;IACtC,IAAI,EAAE,CAAC,CAAC;IACR,CAAC,EAAE,OAAO,gBAAgB,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,C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AAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAQtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE"}
|
package/dist/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","names":[],"sources":["../src/messages.ts"],"sourcesContent":["// The subpath, not the barrel: `__fixtures__/server.ts` runs this file under Node's type\n// stripping, which resolves the package `exports` but not the barrel's extensionless imports.\nimport type { LogLevel } from '@jsprismarine/logger/levels';\nimport { isLogLevel } from '@jsprismarine/logger/levels';\n\n/**\n * Version of the message schema. Both sides stamp it on every message as `v`, and the type\n * guards reject messages from another version so a mismatched host and server fail loudly\n * instead of misreading each other.\n */\nexport const PROTOCOL_VERSION = 1;\n\ninterface Envelope<T extends string> {\n type: T;\n v: typeof PROTOCOL_VERSION;\n}\n\n/**\n * One log record as the server forwards it to the console.\n *\n * `seq` increases by one per record so the console can detect a gap even when a `log.dropped`\n * message is itself lost. `at` is epoch milliseconds so the console formats the time for its\n * own zone. `formatted` is the ANSI line the logger would have printed itself.\n */\nexport interface LogEntry {\n seq: number;\n level: LogLevel;\n namespace: string;\n at: number;\n message: string;\n formatted: string;\n}\n\n/** Server lifecycle states reported over the link. `stopped` and `crashed` come from the child's exit, not a message. */\nexport const LIFECYCLE_STATES = ['starting', 'running', 'stopping'] as const;\n\n/** One of {@link LIFECYCLE_STATES}. */\nexport type LifecycleState = (typeof LIFECYCLE_STATES)[number];\n\n/** Where a startup step is: begun, or done. */\nexport const BOOT_STATES = ['starting', 'started'] as const;\n\n/** One of {@link BOOT_STATES}. */\nexport type BootState = (typeof BOOT_STATES)[number];\n\n/** Whether a decoded value names one of {@link BOOT_STATES}. */\nexport function isBootState(value: unknown): value is BootState {\n return typeof value === 'string' && (BOOT_STATES as readonly string[]).includes(value);\n}\n\n/** Whether a decoded value names one of {@link LIFECYCLE_STATES}. */\nexport function isLifecycleState(value: unknown): value is LifecycleState {\n return typeof value === 'string' && (LIFECYCLE_STATES as readonly string[]).includes(value);\n}\n\n/**\n * One server command as the console's palette and usage card show it.\n *\n * `usage` lists the forms the command takes, each written from the command's name with its\n * arguments as Brigadier prints them, such as `teleport <targets> <position>`. A server may cap\n * that list; `moreUsage` is then true, so the console can say the list is incomplete.\n *\n * `usageWords` lists, for each form, how many typed words each part after the name reads: three\n * for a `<position>`, or `rest` for an argument that takes the rest of the line. A console counts\n * typed words through it to find the argument being typed. Without it, or for a form whose list\n * does not match its parts, every part reads one word.\n */\nexport interface CommandInfo {\n name: string;\n description?: string;\n aliases: readonly string[];\n usage: readonly string[];\n usageWords?: readonly (readonly (number | 'rest')[])[];\n moreUsage?: boolean;\n}\n\n/** Messages the server sends to the console. */\nexport type ServerMessage =\n | (Envelope<'hello'> & { serverVersion: string; pid: number })\n | (Envelope<'log'> & LogEntry)\n | (Envelope<'log.dropped'> & { count: number })\n | (Envelope<'status'> & {\n tps: number;\n tickMs: number;\n /** The ticks per second the server aims for. Consoles assume 20 when it is absent. */\n tickRate?: number;\n players: number;\n /** Online player names for consoles that show a player list. */\n playerNames?: readonly string[];\n maxPlayers: number;\n rssBytes: number;\n uptimeMs: number;\n })\n | (Envelope<'lifecycle'> & { state: LifecycleState })\n /** One step of the server's startup, such as `prismarine:content`, as it begins and ends. */\n | (Envelope<'boot'> & { step: string; state: BootState })\n | (Envelope<'command.result'> & { id: string; ok: boolean; error?: string })\n | (Envelope<'complete.result'> & { id: string; completions: readonly string[]; replace: string })\n | (Envelope<'commands.result'> & { id: string; commands: readonly CommandInfo[] });\n\n/** Messages the console sends to the server. */\nexport type ConsoleMessage =\n | (Envelope<'command'> & { id: string; line: string })\n | (Envelope<'complete'> & { id: string; line: string; cursor: number })\n | (Envelope<'commands'> & { id: string })\n | Envelope<'shutdown'>\n | (Envelope<'subscribe'> & { level: LogLevel });\n\n/** The `type` of a {@link ServerMessage}. */\nexport type ServerMessageType = ServerMessage['type'];\n\n/** The `type` of a {@link ConsoleMessage}. */\nexport type ConsoleMessageType = ConsoleMessage['type'];\n\n/** States of the host's supervisor, which owns the server child process. */\nexport type SupervisorState = 'starting' | 'running' | 'stopping' | 'stopped' | 'crashed' | 'restarting' | 'waiting';\n\n/**\n * Events the host raises about the server child. They never cross the IPC channel; the host\n * produces them from the child's exit status, the file watcher, and the child's stdio pipes,\n * and the console renders them as status and toasts rather than log lines.\n */\nexport type SupervisorEvent =\n | {\n type: 'supervisor.state';\n state: SupervisorState;\n code?: number | null;\n signal?: string | null;\n generation: number;\n }\n | {\n type: 'supervisor.watching';\n root: string;\n /**\n * Whether the host will act on a restart request. Set by the supervisor on the way\n * out; a frontend treats a missing value as false.\n */\n canRestart?: boolean;\n }\n | { type: 'supervisor.changed'; path: string }\n | { type: 'supervisor.generating'; ok?: boolean }\n | { type: 'supervisor.output'; stream: 'stdout' | 'stderr'; text: string };\n\n/**\n * How one field is checked: a `typeof` name, `'array'`, or, for a field whose type is a union\n * of string literals, the type guard that accepts exactly those literals.\n */\ntype FieldKind = 'string' | 'number' | 'boolean' | 'array' | ((value: unknown) => boolean);\n\n/**\n * The {@link FieldKind} for a field type. The tuple wrapper stops the conditional from\n * distributing over a literal union, so `'a' | 'b'` maps to one guard for the whole union\n * rather than a union of guards.\n */\ntype KindOf<T> = [T] extends [string]\n ? string extends T\n ? 'string'\n : (value: unknown) => value is T\n : [T] extends [number]\n ? 'number'\n : [T] extends [boolean]\n ? 'boolean'\n : [T] extends [readonly unknown[]]\n ? 'array'\n : never;\n\ntype RequiredKeys<T> = { [K in keyof T]-?: {} extends Pick<T, K> ? never : K }[keyof T];\n\n/**\n * The runtime check table for one message family: every message type maps to the\n * {@link FieldKind} of each of its required fields. Optional fields such as `error` are not\n * checked. `satisfies` against this type keeps the table in step with the message union: a\n * missing or extra type or field is a compile error, and so is a `'string'` where the field\n * type is a literal union and needs a guard.\n */\ntype FieldTable<Message extends Envelope<string>> = {\n readonly [M in Message as M['type']]: {\n readonly [K in Exclude<RequiredKeys<M>, keyof Envelope<string>>]: KindOf<M[K]>;\n };\n};\n\nconst SERVER_FIELDS = {\n hello: { serverVersion: 'string', pid: 'number' },\n log: {\n seq: 'number',\n level: isLogLevel,\n namespace: 'string',\n at: 'number',\n message: 'string',\n formatted: 'string'\n },\n 'log.dropped': { count: 'number' },\n status: {\n tps: 'number',\n tickMs: 'number',\n players: 'number',\n maxPlayers: 'number',\n rssBytes: 'number',\n uptimeMs: 'number'\n },\n lifecycle: { state: isLifecycleState },\n boot: { step: 'string', state: isBootState },\n 'command.result': { id: 'string', ok: 'boolean' },\n 'complete.result': { id: 'string', completions: 'array', replace: 'string' },\n 'commands.result': { id: 'string', commands: 'array' }\n} as const satisfies FieldTable<ServerMessage>;\n\nconst CONSOLE_FIELDS = {\n command: { id: 'string', line: 'string' },\n complete: { id: 'string', line: 'string', cursor: 'number' },\n commands: { id: 'string' },\n shutdown: {},\n subscribe: { level: isLogLevel }\n} as const satisfies FieldTable<ConsoleMessage>;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null;\n\nconst isStringArray = (value: unknown): value is readonly string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string');\n\nconst isWordCounts = (value: unknown): value is readonly (number | 'rest')[] =>\n Array.isArray(value) &&\n value.every((words) => words === 'rest' || (typeof words === 'number' && Number.isInteger(words) && words > 0));\n\nconst isCommandInfo = (value: unknown): value is CommandInfo =>\n isRecord(value) &&\n typeof value.name === 'string' &&\n (value.description === undefined || typeof value.description === 'string') &&\n isStringArray(value.aliases) &&\n isStringArray(value.usage) &&\n (value.usageWords === undefined || (Array.isArray(value.usageWords) && value.usageWords.every(isWordCounts))) &&\n (value.moreUsage === undefined || typeof value.moreUsage === 'boolean');\n\nconst hasKind = (value: unknown, kind: FieldKind): boolean => {\n if (typeof kind === 'function') return kind(value);\n return kind === 'array' ? Array.isArray(value) : typeof value === kind;\n};\n\nconst matchesTable = (value: unknown, table: Record<string, Record<string, FieldKind>>): boolean => {\n if (!isRecord(value) || value.v !== PROTOCOL_VERSION || typeof value.type !== 'string') return false;\n const fields = Object.hasOwn(table, value.type) ? table[value.type] : undefined;\n if (fields === undefined) return false;\n return Object.entries(fields).every(([key, kind]) => hasKind(value[key], kind));\n};\n\n/**\n * Whether a decoded JSON value is a {@link ServerMessage} of this protocol version with its\n * required fields present and of the right kind. Literal fields such as `level` and `state`\n * must hold one of their declared values.\n */\nexport function isServerMessage(value: unknown): value is ServerMessage {\n if (!matchesTable(value, SERVER_FIELDS)) return false;\n if (isRecord(value) && value.type === 'commands.result') {\n return Array.isArray(value.commands) && value.commands.every(isCommandInfo);\n }\n if (!isRecord(value) || value.type !== 'status') return true;\n if (Object.hasOwn(value, 'tickRate') && typeof value.tickRate !== 'number') return false;\n return !Object.hasOwn(value, 'playerNames') || isStringArray(value.playerNames);\n}\n\n/**\n * Whether a decoded JSON value is a {@link ConsoleMessage} of this protocol version with its\n * required fields present and of the right kind. The `subscribe` level must be a log level.\n */\nexport function isConsoleMessage(value: unknown): value is ConsoleMessage {\n return matchesTable(value, CONSOLE_FIELDS);\n}\n"],"mappings":";;;;;;;AAUA,IAAa,mBAAmB;;AAwBhC,IAAa,mBAAmB;CAAC;CAAY;CAAW;AAAU;;AAMlE,IAAa,cAAc,CAAC,YAAY,SAAS;;AAMjD,SAAgB,YAAY,OAAoC;CAC5D,OAAO,OAAO,UAAU,YAAa,YAAkC,SAAS,KAAK;AACzF;;AAGA,SAAgB,iBAAiB,OAAyC;CACtE,OAAO,OAAO,UAAU,YAAa,iBAAuC,SAAS,KAAK;AAC9F;AAgIA,IAAM,gBAAgB;CAClB,OAAO;EAAE,eAAe;EAAU,KAAK;CAAS;CAChD,KAAK;EACD,KAAK;EACL,OAAO;EACP,WAAW;EACX,IAAI;EACJ,SAAS;EACT,WAAW;CACf;CACA,eAAe,EAAE,OAAO,SAAS;CACjC,QAAQ;EACJ,KAAK;EACL,QAAQ;EACR,SAA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CAChG,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,MAAA,KAA0B,OAAO,MAAM,SAAS,UAAU,OAAO;CAC/F,MAAM,SAAS,OAAO,OAAO,OAAO,MAAM,IAAI,IAAI,MAAM,MAAM,QAAQ,KAAA;CACtE,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,OAAO,OAAO,QAAQ,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,MAAM,IAAI,CAAC;AAClF;;;;;;AAOA,SAAgB,gBAAgB,OAAwC;CACpE,IAAI,CAAC,aAAa,OAAO,aAAa,GAAG,OAAO;CAChD,IAAI,SAAS,KAAK,KAAK,MAAM,SAAS,mBAClC,OAAO,MAAM,QAAQ,MAAM,QAAQ,KAAK,MAAM,SAAS,MAAM,aAAa;CAE9E,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,SAAS,UAAU,OAAO;CACxD,IAAI,OAAO,OAAO,OAAO,UAAU,KAAK,OAAO,MAAM,aAAa,UAAU,OAAO;CACnF,OAAO,CAAC,OAAO,OAAO,OAAO,aAAa,KAAK,cAAc,MAAM,WAAW;AAClF;;;;;AAMA,SAAgB,iBAAiB,OAAyC;CACtE,OAAO,aAAa,OAAO,cAAc;AAC7C"}
|
|
1
|
+
{"version":3,"file":"messages.js","names":[],"sources":["../src/messages.ts"],"sourcesContent":["// The subpath, not the barrel: `__fixtures__/server.ts` runs this file under Node's type\n// stripping, which resolves the package `exports` but not the barrel's extensionless imports.\nimport type { LogLevel } from '@jsprismarine/logger/levels';\nimport { isLogLevel } from '@jsprismarine/logger/levels';\n\n/**\n * Version of the message schema. Both sides stamp it on every message as `v`, and the type\n * guards reject messages from another version so a mismatched host and server fail loudly\n * instead of misreading each other.\n */\nexport const PROTOCOL_VERSION = 1;\n\n/** The fields every console message starts with: its `type` and the protocol version it speaks. */\nexport interface Envelope<T extends string> {\n type: T;\n v: typeof PROTOCOL_VERSION;\n}\n\n/**\n * One log record as the server forwards it to the console.\n *\n * `seq` increases by one per record so the console can detect a gap even when a `log.dropped`\n * message is itself lost. `at` is epoch milliseconds so the console formats the time for its\n * own zone. `formatted` is the ANSI line the logger would have printed itself.\n */\nexport interface LogEntry {\n seq: number;\n level: LogLevel;\n namespace: string;\n at: number;\n message: string;\n formatted: string;\n}\n\n/** Server lifecycle states reported over the link. `stopped` and `crashed` come from the child's exit, not a message. */\nexport const LIFECYCLE_STATES = ['starting', 'running', 'stopping'] as const;\n\n/** One of {@link LIFECYCLE_STATES}. */\nexport type LifecycleState = (typeof LIFECYCLE_STATES)[number];\n\n/** Where a startup step is: begun, or done. */\nexport const BOOT_STATES = ['starting', 'started'] as const;\n\n/** One of {@link BOOT_STATES}. */\nexport type BootState = (typeof BOOT_STATES)[number];\n\n/** Whether a decoded value names one of {@link BOOT_STATES}. */\nexport function isBootState(value: unknown): value is BootState {\n return typeof value === 'string' && (BOOT_STATES as readonly string[]).includes(value);\n}\n\n/** Whether a decoded value names one of {@link LIFECYCLE_STATES}. */\nexport function isLifecycleState(value: unknown): value is LifecycleState {\n return typeof value === 'string' && (LIFECYCLE_STATES as readonly string[]).includes(value);\n}\n\n/**\n * One server command as the console's palette and usage card show it.\n *\n * `usage` lists the forms the command takes, each written from the command's name with its\n * arguments as Brigadier prints them, such as `teleport <targets> <position>`. A server may cap\n * that list; `moreUsage` is then true, so the console can say the list is incomplete.\n *\n * `usageWords` lists, for each form, how many typed words each part after the name reads: three\n * for a `<position>`, or `rest` for an argument that takes the rest of the line. A console counts\n * typed words through it to find the argument being typed. Without it, or for a form whose list\n * does not match its parts, every part reads one word.\n */\nexport interface CommandInfo {\n name: string;\n description?: string;\n aliases: readonly string[];\n usage: readonly string[];\n usageWords?: readonly (readonly (number | 'rest')[])[];\n moreUsage?: boolean;\n}\n\n/** Messages the server sends to the console. */\nexport type ServerMessage =\n | (Envelope<'hello'> & { serverVersion: string; pid: number })\n | (Envelope<'log'> & LogEntry)\n | (Envelope<'log.dropped'> & { count: number })\n | (Envelope<'status'> & {\n tps: number;\n tickMs: number;\n /** The ticks per second the server aims for. Consoles assume 20 when it is absent. */\n tickRate?: number;\n players: number;\n /** Online player names for consoles that show a player list. */\n playerNames?: readonly string[];\n maxPlayers: number;\n rssBytes: number;\n uptimeMs: number;\n })\n | (Envelope<'lifecycle'> & { state: LifecycleState })\n /** One step of the server's startup, such as `prismarine:content`, as it begins and ends. */\n | (Envelope<'boot'> & { step: string; state: BootState })\n | (Envelope<'command.result'> & { id: string; ok: boolean; error?: string })\n | (Envelope<'complete.result'> & { id: string; completions: readonly string[]; replace: string })\n | (Envelope<'commands.result'> & { id: string; commands: readonly CommandInfo[] });\n\n/** Messages the console sends to the server. */\nexport type ConsoleMessage =\n | (Envelope<'command'> & { id: string; line: string })\n | (Envelope<'complete'> & { id: string; line: string; cursor: number })\n | (Envelope<'commands'> & { id: string })\n | Envelope<'shutdown'>\n | (Envelope<'subscribe'> & { level: LogLevel });\n\n/** The `type` of a {@link ServerMessage}. */\nexport type ServerMessageType = ServerMessage['type'];\n\n/** The `type` of a {@link ConsoleMessage}. */\nexport type ConsoleMessageType = ConsoleMessage['type'];\n\n/** States of the host's supervisor, which owns the server child process. */\nexport type SupervisorState = 'starting' | 'running' | 'stopping' | 'stopped' | 'crashed' | 'restarting' | 'waiting';\n\n/**\n * Events the host raises about the server child. They never cross the IPC channel; the host\n * produces them from the child's exit status, the file watcher, and the child's stdio pipes,\n * and the console renders them as status and toasts rather than log lines.\n */\nexport type SupervisorEvent =\n | {\n type: 'supervisor.state';\n state: SupervisorState;\n code?: number | null;\n signal?: string | null;\n generation: number;\n }\n | {\n type: 'supervisor.watching';\n root: string;\n /**\n * Whether the host will act on a restart request. Set by the supervisor on the way\n * out; a frontend treats a missing value as false.\n */\n canRestart?: boolean;\n }\n | { type: 'supervisor.changed'; path: string }\n | { type: 'supervisor.generating'; ok?: boolean }\n | { type: 'supervisor.output'; stream: 'stdout' | 'stderr'; text: string };\n\n/**\n * How one field is checked: a `typeof` name, `'array'`, or, for a field whose type is a union\n * of string literals, the type guard that accepts exactly those literals.\n */\ntype FieldKind = 'string' | 'number' | 'boolean' | 'array' | ((value: unknown) => boolean);\n\n/**\n * The {@link FieldKind} for a field type. The tuple wrapper stops the conditional from\n * distributing over a literal union, so `'a' | 'b'` maps to one guard for the whole union\n * rather than a union of guards.\n */\ntype KindOf<T> = [T] extends [string]\n ? string extends T\n ? 'string'\n : (value: unknown) => value is T\n : [T] extends [number]\n ? 'number'\n : [T] extends [boolean]\n ? 'boolean'\n : [T] extends [readonly unknown[]]\n ? 'array'\n : never;\n\ntype RequiredKeys<T> = { [K in keyof T]-?: {} extends Pick<T, K> ? never : K }[keyof T];\n\n/**\n * The runtime check table for one message family: every message type maps to the\n * {@link FieldKind} of each of its required fields. Optional fields such as `error` are not\n * checked. `satisfies` against this type keeps the table in step with the message union: a\n * missing or extra type or field is a compile error, and so is a `'string'` where the field\n * type is a literal union and needs a guard.\n */\ntype FieldTable<Message extends Envelope<string>> = {\n readonly [M in Message as M['type']]: {\n readonly [K in Exclude<RequiredKeys<M>, keyof Envelope<string>>]: KindOf<M[K]>;\n };\n};\n\nconst SERVER_FIELDS = {\n hello: { serverVersion: 'string', pid: 'number' },\n log: {\n seq: 'number',\n level: isLogLevel,\n namespace: 'string',\n at: 'number',\n message: 'string',\n formatted: 'string'\n },\n 'log.dropped': { count: 'number' },\n status: {\n tps: 'number',\n tickMs: 'number',\n players: 'number',\n maxPlayers: 'number',\n rssBytes: 'number',\n uptimeMs: 'number'\n },\n lifecycle: { state: isLifecycleState },\n boot: { step: 'string', state: isBootState },\n 'command.result': { id: 'string', ok: 'boolean' },\n 'complete.result': { id: 'string', completions: 'array', replace: 'string' },\n 'commands.result': { id: 'string', commands: 'array' }\n} as const satisfies FieldTable<ServerMessage>;\n\nconst CONSOLE_FIELDS = {\n command: { id: 'string', line: 'string' },\n complete: { id: 'string', line: 'string', cursor: 'number' },\n commands: { id: 'string' },\n shutdown: {},\n subscribe: { level: isLogLevel }\n} as const satisfies FieldTable<ConsoleMessage>;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null;\n\nconst isStringArray = (value: unknown): value is readonly string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string');\n\nconst isWordCounts = (value: unknown): value is readonly (number | 'rest')[] =>\n Array.isArray(value) &&\n value.every((words) => words === 'rest' || (typeof words === 'number' && Number.isInteger(words) && words > 0));\n\nconst isCommandInfo = (value: unknown): value is CommandInfo =>\n isRecord(value) &&\n typeof value.name === 'string' &&\n (value.description === undefined || typeof value.description === 'string') &&\n isStringArray(value.aliases) &&\n isStringArray(value.usage) &&\n (value.usageWords === undefined || (Array.isArray(value.usageWords) && value.usageWords.every(isWordCounts))) &&\n (value.moreUsage === undefined || typeof value.moreUsage === 'boolean');\n\nconst hasKind = (value: unknown, kind: FieldKind): boolean => {\n if (typeof kind === 'function') return kind(value);\n return kind === 'array' ? Array.isArray(value) : typeof value === kind;\n};\n\nconst matchesTable = (value: unknown, table: Record<string, Record<string, FieldKind>>): boolean => {\n if (!isRecord(value) || value.v !== PROTOCOL_VERSION || typeof value.type !== 'string') return false;\n const fields = Object.hasOwn(table, value.type) ? table[value.type] : undefined;\n if (fields === undefined) return false;\n return Object.entries(fields).every(([key, kind]) => hasKind(value[key], kind));\n};\n\n/**\n * Whether a decoded JSON value is a {@link ServerMessage} of this protocol version with its\n * required fields present and of the right kind. Literal fields such as `level` and `state`\n * must hold one of their declared values.\n */\nexport function isServerMessage(value: unknown): value is ServerMessage {\n if (!matchesTable(value, SERVER_FIELDS)) return false;\n if (isRecord(value) && value.type === 'commands.result') {\n return Array.isArray(value.commands) && value.commands.every(isCommandInfo);\n }\n if (!isRecord(value) || value.type !== 'status') return true;\n if (Object.hasOwn(value, 'tickRate') && typeof value.tickRate !== 'number') return false;\n return !Object.hasOwn(value, 'playerNames') || isStringArray(value.playerNames);\n}\n\n/**\n * Whether a decoded JSON value is a {@link ConsoleMessage} of this protocol version with its\n * required fields present and of the right kind. The `subscribe` level must be a log level.\n */\nexport function isConsoleMessage(value: unknown): value is ConsoleMessage {\n return matchesTable(value, CONSOLE_FIELDS);\n}\n"],"mappings":";;;;;;;AAUA,IAAa,mBAAmB;;AAyBhC,IAAa,mBAAmB;CAAC;CAAY;CAAW;AAAU;;AAMlE,IAAa,cAAc,CAAC,YAAY,SAAS;;AAMjD,SAAgB,YAAY,OAAoC;CAC5D,OAAO,OAAO,UAAU,YAAa,YAAkC,SAAS,KAAK;AACzF;;AAGA,SAAgB,iBAAiB,OAAyC;CACtE,OAAO,OAAO,UAAU,YAAa,iBAAuC,SAAS,KAAK;AAC9F;AAgIA,IAAM,gBAAgB;CAClB,OAAO;EAAE,eAAe;EAAU,KAAK;CAAS;CAChD,KAAK;EACD,KAAK;EACL,OAAO;EACP,WAAW;EACX,IAAI;EACJ,SAAS;EACT,WAAW;CACf;CACA,eAAe,EAAE,OAAO,SAAS;CACjC,QAAQ;EACJ,KAAK;EACL,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,UAAU;EACV,UAAU;CACd;CACA,WAAW,EAAE,OAAO,iBAAiB;CACrC,MAAM;EAAE,MAAM;EAAU,OAAO;CAAY;CAC3C,kBAAkB;EAAE,IAAI;EAAU,IAAI;CAAU;CAChD,mBAAmB;EAAE,IAAI;EAAU,aAAa;EAAS,SAAS;CAAS;CAC3E,mBAAmB;EAAE,IAAI;EAAU,UAAU;CAAQ;AACzD;AAEA,IAAM,iBAAiB;CACnB,SAAS;EAAE,IAAI;EAAU,MAAM;CAAS;CACxC,UAAU;EAAE,IAAI;EAAU,MAAM;EAAU,QAAQ;CAAS;CAC3D,UAAU,EAAE,IAAI,SAAS;CACzB,UAAU,CAAC;CACX,WAAW,EAAE,OAAO,WAAW;AACnC;AAEA,IAAM,YAAY,UAAqD,OAAO,UAAU,YAAY,UAAU;AAE9G,IAAM,iBAAiB,UACnB,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,SAAS,OAAO,SAAS,QAAQ;AAE1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,aAAa,UAAU,OAAO;CACnF,OAAO,CAAC,OAAO,OAAO,OAAO,aAAa,KAAK,cAAc,MAAM,WAAW;AAClF;;;;;AAMA,SAAgB,iBAAiB,OAAyC;CACtE,OAAO,aAAa,OAAO,cAAc;AAC7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsprismarine/console-protocol",
|
|
3
|
-
"version": "0.23.0
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Message types and links between the JSPrismarine server and its console",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"vitest": "5.1.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@jsprismarine/errors": "0.23.0
|
|
47
|
-
"@jsprismarine/logger": "0.23.0
|
|
46
|
+
"@jsprismarine/errors": "0.23.0",
|
|
47
|
+
"@jsprismarine/logger": "0.23.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"clean": "rimraf dist jsp *.tsbuildinfo vite.config.ts.timestamp-* .tsup .turbo",
|