@celestia-island/plana-types 0.1.5 → 0.1.7

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.
@@ -0,0 +1,203 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Params of [`PROTOCOL_CONNECT_METHOD`].
5
+ */
6
+ export type ConnectParamsDto = {
7
+ /**
8
+ * How to reach the device.
9
+ */
10
+ transport: TransportInfoDto, };
11
+
12
+ /**
13
+ * Result of [`PROTOCOL_CONNECT_METHOD`].
14
+ */
15
+ export type ConnectResultDto = {
16
+ /**
17
+ * Whether the connection was established.
18
+ */
19
+ connected: boolean, };
20
+
21
+ /**
22
+ * Identifies a data location across any industrial protocol: the
23
+ * `address` field of [`protocol.read`](PROTOCOL_READ_METHOD) and
24
+ * [`protocol.write`](PROTOCOL_WRITE_METHOD) params.
25
+ */
26
+ export type DataAddressDto = { "kind": "modbus",
27
+ /**
28
+ * Modbus station/slave ID.
29
+ */
30
+ station: number,
31
+ /**
32
+ * Modbus function code.
33
+ */
34
+ fc: number,
35
+ /**
36
+ * Starting register address.
37
+ */
38
+ address: number,
39
+ /**
40
+ * Number of registers to read/write.
41
+ */
42
+ count: number, } | { "kind": "s7",
43
+ /**
44
+ * Data block number.
45
+ */
46
+ db_number: number,
47
+ /**
48
+ * Byte offset within the DB.
49
+ */
50
+ offset: number,
51
+ /**
52
+ * Number of bytes to read/write.
53
+ */
54
+ length: number, } | { "kind": "mc",
55
+ /**
56
+ * Device code (e.g. "D", "M", "X", "Y").
57
+ */
58
+ device: string,
59
+ /**
60
+ * Starting head address.
61
+ */
62
+ head_address: number,
63
+ /**
64
+ * Number of elements.
65
+ */
66
+ count: number, } | { "kind": "raw",
67
+ /**
68
+ * Raw address string (protocol-specific).
69
+ */
70
+ address: string,
71
+ /**
72
+ * Expected data size in bytes.
73
+ */
74
+ size: number, };
75
+
76
+ /**
77
+ * Params of [`PROTOCOL_PING_METHOD`] — the empty params object `{}`.
78
+ *
79
+ * JSON-RPC 2.0 lets a no-argument method omit `params` entirely, and the
80
+ * sibling TypeScript client does exactly that when called without an
81
+ * argument; plana's router hands such a handler `Value::Null` for the
82
+ * missing field. Deserialization therefore tolerates `null` alongside the
83
+ * canonical `{}` (unknown fields are ignored, mirroring serde's derive
84
+ * default), while serialization always emits `{}`.
85
+ */
86
+ export type PingParamsDto = Record<symbol, never>;
87
+
88
+ /**
89
+ * Result of [`PROTOCOL_PING_METHOD`].
90
+ */
91
+ export type PingResultDto = {
92
+ /**
93
+ * Whether the device answered the connectivity check.
94
+ */
95
+ reachable: boolean, };
96
+
97
+ /**
98
+ * Params of [`PROTOCOL_PROBE_METHOD`].
99
+ */
100
+ export type ProbeParamsDto = {
101
+ /**
102
+ * The endpoint to probe.
103
+ */
104
+ transport: TransportInfoDto, };
105
+
106
+ /**
107
+ * Result of [`PROTOCOL_PROBE_METHOD`].
108
+ *
109
+ * Not to be confused with `plana_celestia_types::tools::polemos::
110
+ * ProtocolProbeResult` (the LLM terminal tool's probe report) — see the
111
+ * crate docs.
112
+ */
113
+ export type ProbeResultDto = {
114
+ /**
115
+ * Human-readable protocol name that was detected (e.g. "modbus_tcp").
116
+ */
117
+ protocol: string,
118
+ /**
119
+ * Detection confidence in `[0.0, 1.0]`.
120
+ */
121
+ confidence: number, };
122
+
123
+ /**
124
+ * Params of [`PROTOCOL_READ_METHOD`].
125
+ */
126
+ export type ReadParamsDto = {
127
+ /**
128
+ * Where to read.
129
+ */
130
+ address: DataAddressDto, };
131
+
132
+ /**
133
+ * Result of [`PROTOCOL_READ_METHOD`].
134
+ */
135
+ export type ReadResultDto = {
136
+ /**
137
+ * Raw bytes read from the device.
138
+ */
139
+ raw: Array<number>,
140
+ /**
141
+ * Read latency in microseconds.
142
+ */
143
+ latency_us: bigint, };
144
+
145
+ /**
146
+ * Describes how to reach a device: the `transport` field of
147
+ * [`protocol.connect`](PROTOCOL_CONNECT_METHOD) and
148
+ * [`protocol.probe`](PROTOCOL_PROBE_METHOD) params.
149
+ */
150
+ export type TransportInfoDto = { "kind": "tcp",
151
+ /**
152
+ * TCP hostname or IP address.
153
+ */
154
+ host: string,
155
+ /**
156
+ * TCP port number.
157
+ */
158
+ port: number, } | { "kind": "serial",
159
+ /**
160
+ * Serial device path (e.g. "/dev/ttyUSB0").
161
+ */
162
+ port: string,
163
+ /**
164
+ * Optional baud rate hint. Serializes as `null` when absent and
165
+ * defaults to `None` when the field is missing on the wire.
166
+ */
167
+ baud: number | null, };
168
+
169
+ /**
170
+ * Params of [`PROTOCOL_WRITE_METHOD`].
171
+ */
172
+ export type WriteParamsDto = {
173
+ /**
174
+ * Where to write.
175
+ */
176
+ address: DataAddressDto,
177
+ /**
178
+ * Raw bytes to write.
179
+ */
180
+ data: Array<number>, };
181
+
182
+ /**
183
+ * Result of [`PROTOCOL_WRITE_METHOD`].
184
+ */
185
+ export type WriteResultDto = {
186
+ /**
187
+ * Whether a read-back verification confirmed the write. `false` is not
188
+ * proof of failure — see [`verification`](Self::verification) for the
189
+ * precise tri-state.
190
+ */
191
+ confirmed: boolean,
192
+ /**
193
+ * Precise verification status. `#[serde(default)]` keeps legacy
194
+ * `{ "confirmed": bool }` payloads deserializable (they map to
195
+ * [`WriteVerificationDto::Unknown`]).
196
+ */
197
+ verification: WriteVerificationDto, };
198
+
199
+ /**
200
+ * Tri-state confirmation of a
201
+ * [`protocol.write`](PROTOCOL_WRITE_METHOD) result.
202
+ */
203
+ export type WriteVerificationDto = "confirmed" | "unconfirmed" | "unknown";
@@ -114,7 +114,7 @@ export type UsageModelEntry = { model: string, tokens: bigint, cost_usd: number,
114
114
 
115
115
  export type UserPreferences = { theme?: string, themeMode?: string, chatMode?: string, locale?: string, };
116
116
 
117
- export type UserProfileResponse = { id: string, username: string, email: string, display_name: string, avatar_url: string | null, is_active: boolean, is_admin: boolean, role: string, groups: Array<RbacGroup>, preferences?: UserPreferences, created_at: string, };
117
+ export type UserProfileResponse = { id: string, username: string, email: string, display_name: string, avatar_url: string | null, is_active: boolean, role: string, groups: Array<RbacGroup>, preferences?: UserPreferences, created_at: string, };
118
118
 
119
119
  export type UserTierInfo = { user_id: string, tier: string, tier_expires_at?: string, daily_quota_used: number, monthly_token_used: number, last_quota_reset_at?: string, };
120
120
 
@@ -132,8 +132,4 @@ export type WebhookItem = { id: string, name: string, url: string, platform: str
132
132
 
133
133
  export type WebhookListResponse = { webhooks: Array<WebhookInfoItem>, };
134
134
 
135
- export type WorkspaceItem = { id: string, path: string, editor: string, git_branch: string, status: string, connected: boolean, short_id: string, alias?: string, connection_kind: string, };
136
-
137
- export type WorkspaceResolveResponse = { workspace_uuid: string, short_id: string, alias?: string, path: string, };
138
-
139
135
  export type WorkspaceSessionResponse = { workspace_id: string, workspace_path: string, editor_name: string, editor_version: string, git_branch: string, cursor?: CursorState, connected_at: string, last_heartbeat: string, };
@@ -56,7 +56,7 @@ export type RbacGroup = { id: string, name: string, description: string, member_
56
56
 
57
57
  export type RbacGroupsResponse = { groups: Array<RbacGroup>, };
58
58
 
59
- export type RbacUser = { id: string, username: string, email: string, display_name: string, avatar_url: string | null, is_active: boolean, is_admin: boolean, role: string, tier: string, created_at: string, };
59
+ export type RbacUser = { id: string, username: string, email: string, display_name: string, avatar_url: string | null, is_active: boolean, role: string, tier: string, created_at: string, };
60
60
 
61
61
  export type RbacUsersResponse = { users: Array<RbacUser>, };
62
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/plana-types",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/celestia-island/plana"