@pulsefield/protocol 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,13 +1,59 @@
1
1
  {
2
2
  "name": "@pulsefield/protocol",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "index.js",
3
+ "version": "0.0.2",
4
+ "description": "Shared Protocol Buffers contracts for Pulsefield clients and model services.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Pulsefield/protocol.git"
8
+ },
9
+ "type": "module",
10
+ "license": "Apache-2.0",
11
+ "packageManager": "npm@11.12.1",
12
+ "engines": {
13
+ "node": ">=22.0.0",
14
+ "npm": ">=11.0.0"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "exports": {
21
+ "./proto/*": "./proto/*",
22
+ "./gen/swift/*": "./gen/swift/*",
23
+ "./gen/python/*": "./gen/python/*",
24
+ "./fixtures/*": "./fixtures/*",
25
+ "./package.json": "./package.json"
26
+ },
6
27
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
28
+ "tools": "node --version && npm --version && buf --version && tsc --version && vitest --version && prettier --version",
29
+ "proto:format": "buf format -w proto",
30
+ "proto:lint": "buf lint",
31
+ "proto:generate": "buf generate",
32
+ "check": "buf lint && tsc -p tsconfig.json --noEmit",
33
+ "test": "vitest run --passWithNoTests",
34
+ "format": "prettier --check .",
35
+ "format:write": "prettier --write ."
8
36
  },
9
- "keywords": [],
37
+ "keywords": [
38
+ "pulsefield",
39
+ "protobuf",
40
+ "protocol"
41
+ ],
10
42
  "author": "",
11
- "license": "ISC",
12
- "type": "commonjs"
43
+ "files": [
44
+ "proto",
45
+ "gen",
46
+ "fixtures",
47
+ "buf.yaml",
48
+ "buf.gen.yaml",
49
+ "README.md",
50
+ "LICENSE"
51
+ ],
52
+ "devDependencies": {
53
+ "@bufbuild/buf": "1.70.0",
54
+ "@types/node": "25.9.3",
55
+ "prettier": "3.8.4",
56
+ "typescript": "6.0.3",
57
+ "vitest": "4.1.8"
58
+ }
13
59
  }
@@ -0,0 +1,77 @@
1
+ syntax = "proto3";
2
+
3
+ package pulsefield.protocol.v1;
4
+
5
+ message Envelope {
6
+ string session_id = 1;
7
+ uint64 sequence = 2;
8
+ int64 sent_at_unix_ms = 3;
9
+
10
+ oneof payload {
11
+ ReadyRequest ready = 10;
12
+ AudioRequest audio = 11;
13
+ ReferenceTimeRequest reference_time = 12;
14
+ StopSessionRequest stop_session = 13;
15
+ HitObjectTokenEvent hit_object_token = 20;
16
+ ErrorEvent error = 21;
17
+ StatusEvent status = 22;
18
+ }
19
+ }
20
+
21
+ message ReadyRequest {}
22
+
23
+ message AudioRequest {
24
+ string audio_path = 1;
25
+ optional uint32 audio_length_ms = 2;
26
+ MusicSource music_source = 3;
27
+ optional double difficulty = 4;
28
+ InferenceRoute route = 5;
29
+ }
30
+
31
+ message ReferenceTimeRequest {
32
+ uint32 ref_time_ms = 1;
33
+ double local_host_time_send_ms = 2;
34
+ optional uint32 audio_length_ms = 3;
35
+ }
36
+
37
+ message StopSessionRequest {
38
+ string reason = 1;
39
+ }
40
+
41
+ message HitObjectTokenEvent {
42
+ uint32 token_id = 1;
43
+ uint32 ms_in_ref_audio = 2;
44
+ }
45
+
46
+ message ErrorEvent {
47
+ string code = 1;
48
+ string message = 2;
49
+ }
50
+
51
+ message StatusEvent {
52
+ EndpointStatus status = 1;
53
+ string message = 2;
54
+ uint32 ref_time_ms = 3;
55
+ double local_host_time_ms = 4;
56
+ }
57
+
58
+ enum MusicSource {
59
+ MUSIC_SOURCE_UNSPECIFIED = 0;
60
+ MUSIC_SOURCE_BACKGROUND = 1;
61
+ MUSIC_SOURCE_SYSTEM_AUDIO = 2;
62
+ }
63
+
64
+ enum InferenceRoute {
65
+ INFERENCE_ROUTE_UNSPECIFIED = 0;
66
+ INFERENCE_ROUTE_MAPPER = 1;
67
+ INFERENCE_ROUTE_TIMING_MOCK = 2;
68
+ }
69
+
70
+ enum EndpointStatus {
71
+ ENDPOINT_STATUS_UNSPECIFIED = 0;
72
+ ENDPOINT_STATUS_READY = 1;
73
+ ENDPOINT_STATUS_AUDIO_PREPARING = 2;
74
+ ENDPOINT_STATUS_AUDIO_READY = 3;
75
+ ENDPOINT_STATUS_STREAMING = 4;
76
+ ENDPOINT_STATUS_STOPPED = 5;
77
+ }