Restructure the repository into a pnpm workspace under packages/ (core, webui, runtime). Move source files for core and webui into packages/*, add package manifests for @snowluma/core and @snowluma/runtime, and remove the old launcher package.json. Update root package.json to be a monorepo controller (scripts delegate to pnpm filters, set packageManager and Node engine). Configure build outputs to emit into the repo-root dist/ (vite config changes) so the existing release pipeline continues to work. Add .npmrc with mirrors, expand .gitignore for monorepo layout, add tsconfig base and package-level tsconfigs, and add vitest config for the core package. Adjust injector native search paths and update tests import paths to the new package layout. Small CI/workflow comment added to clarify build behavior and README updated with monorepo structure and common commands.
69 lines
2.6 KiB
TypeScript
69 lines
2.6 KiB
TypeScript
import type { ProtoSchema } from '../../protobuf/decode';
|
|
import { PushMsgBodySchema } from './message';
|
|
|
|
export const LongMsgUidSchema = {
|
|
uid: { field: 2, type: 'string' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const LongMsgSettingsSchema = {
|
|
field1: { field: 1, type: 'uint32' as const },
|
|
field2: { field: 2, type: 'uint32' as const },
|
|
field3: { field: 3, type: 'uint32' as const },
|
|
field4: { field: 4, type: 'uint32' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const SendLongMsgInfoSchema = {
|
|
type: { field: 1, type: 'uint32' as const },
|
|
uid: { field: 2, type: 'message' as const, schema: LongMsgUidSchema },
|
|
groupUin: { field: 3, type: 'uint32' as const },
|
|
payload: { field: 4, type: 'bytes' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const SendLongMsgReqSchema = {
|
|
info: { field: 2, type: 'message' as const, schema: SendLongMsgInfoSchema },
|
|
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const SendLongMsgRespResultSchema = {
|
|
resId: { field: 3, type: 'string' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const SendLongMsgRespSchema = {
|
|
result: { field: 2, type: 'message' as const, schema: SendLongMsgRespResultSchema },
|
|
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const RecvLongMsgInfoSchema = {
|
|
uid: { field: 1, type: 'message' as const, schema: LongMsgUidSchema },
|
|
resId: { field: 2, type: 'string' as const },
|
|
acquire: { field: 3, type: 'bool' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const RecvLongMsgReqSchema = {
|
|
info: { field: 1, type: 'message' as const, schema: RecvLongMsgInfoSchema },
|
|
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const RecvLongMsgRespResultSchema = {
|
|
resId: { field: 3, type: 'string' as const },
|
|
payload: { field: 4, type: 'bytes' as const },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const RecvLongMsgRespSchema = {
|
|
result: { field: 1, type: 'message' as const, schema: RecvLongMsgRespResultSchema },
|
|
settings: { field: 15, type: 'message' as const, schema: LongMsgSettingsSchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const LongMsgContentSchema = {
|
|
msgBody: { field: 1, type: 'repeated_message' as const, schema: PushMsgBodySchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const LongMsgActionSchema = {
|
|
actionCommand: { field: 1, type: 'string' as const },
|
|
actionData: { field: 2, type: 'message' as const, schema: LongMsgContentSchema },
|
|
} satisfies ProtoSchema;
|
|
|
|
export const LongMsgResultSchema = {
|
|
action: { field: 2, type: 'repeated_message' as const, schema: LongMsgActionSchema },
|
|
} satisfies ProtoSchema;
|