@celestia-island/plana-types 0.1.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.
Files changed (96) hide show
  1. package/Cargo.toml +38 -0
  2. package/bindings/FileAnchor.ts +3 -0
  3. package/bindings/engine.ts +277 -0
  4. package/bindings/enums.ts +31 -0
  5. package/bindings/httpTypes.ts +197 -0
  6. package/bindings/index.ts +47 -0
  7. package/bindings/mcp/aporia.ts +61 -0
  8. package/bindings/mcp/eleos.ts +18 -0
  9. package/bindings/mcp/epieikeia.ts +48 -0
  10. package/bindings/mcp/haplotes.ts +47 -0
  11. package/bindings/mcp/hubris.ts +41 -0
  12. package/bindings/mcp/index.ts +13 -0
  13. package/bindings/mcp/kalos.ts +47 -0
  14. package/bindings/mcp/neikos.ts +76 -0
  15. package/bindings/mcp/orexis.ts +64 -0
  16. package/bindings/mcp/philia.ts +57 -0
  17. package/bindings/mcp/polemos.ts +55 -0
  18. package/bindings/mcp/skemma.ts +58 -0
  19. package/bindings/mcp/skopeo.ts +56 -0
  20. package/bindings/mcp/webAutomation.ts +31 -0
  21. package/bindings/model.ts +240 -0
  22. package/bindings/package.json +16 -0
  23. package/bindings/region.ts +3 -0
  24. package/bindings/serde_json/JsonValue.ts +3 -0
  25. package/bindings/ws/agentLifecycle.ts +41 -0
  26. package/bindings/ws/auth.ts +15 -0
  27. package/bindings/ws/baseMessages.ts +7 -0
  28. package/bindings/ws/bridgeNetwork.ts +71 -0
  29. package/bindings/ws/core.ts +51 -0
  30. package/bindings/ws/fileBrowsing.ts +57 -0
  31. package/bindings/ws/handshake.ts +23 -0
  32. package/bindings/ws/industrial.ts +72 -0
  33. package/bindings/ws/knowledgeBase.ts +10 -0
  34. package/bindings/ws/layer2.ts +25 -0
  35. package/bindings/ws/llmProvider.ts +74 -0
  36. package/bindings/ws/logs.ts +11 -0
  37. package/bindings/ws/malkuth.ts +62 -0
  38. package/bindings/ws/noa.ts +17 -0
  39. package/bindings/ws/stateSync.ts +19 -0
  40. package/bindings/ws/systemUi.ts +5 -0
  41. package/bindings/ws/tasks.ts +6 -0
  42. package/bindings/ws/views.ts +163 -0
  43. package/bindings/ws/workspace.ts +11 -0
  44. package/bindings/ws/yolo.ts +32 -0
  45. package/examples/schema_dump.rs +51 -0
  46. package/package.json +6 -0
  47. package/pnpm-workspace.yaml +2 -0
  48. package/src/engine.rs +602 -0
  49. package/src/enums.rs +334 -0
  50. package/src/external_mcp.rs +132 -0
  51. package/src/http.rs +1077 -0
  52. package/src/identity.rs +160 -0
  53. package/src/lib.rs +1215 -0
  54. package/src/malkuth.rs +145 -0
  55. package/src/mcp/aporia.rs +272 -0
  56. package/src/mcp/eleos.rs +210 -0
  57. package/src/mcp/epieikeia.rs +194 -0
  58. package/src/mcp/haplotes.rs +310 -0
  59. package/src/mcp/hubris.rs +377 -0
  60. package/src/mcp/kalos.rs +251 -0
  61. package/src/mcp/mod.rs +23 -0
  62. package/src/mcp/neikos.rs +533 -0
  63. package/src/mcp/orexis.rs +493 -0
  64. package/src/mcp/philia.rs +267 -0
  65. package/src/mcp/polemos.rs +241 -0
  66. package/src/mcp/skemma.rs +442 -0
  67. package/src/mcp/skopeo.rs +282 -0
  68. package/src/mcp/web_automation.rs +122 -0
  69. package/src/model.rs +421 -0
  70. package/src/protocol/base_messages.rs +125 -0
  71. package/src/protocol/handshake.rs +364 -0
  72. package/src/protocol/jsonrpc.rs +888 -0
  73. package/src/protocol/mod.rs +10 -0
  74. package/src/rbac.rs +786 -0
  75. package/src/region.rs +362 -0
  76. package/src/tracing_helpers.rs +9 -0
  77. package/src/ws/agent/agent_lifecycle.rs +221 -0
  78. package/src/ws/agent/layer2.rs +126 -0
  79. package/src/ws/agent/mod.rs +9 -0
  80. package/src/ws/agent/state_sync.rs +111 -0
  81. package/src/ws/agent/tasks.rs +43 -0
  82. package/src/ws/agent/yolo.rs +161 -0
  83. package/src/ws/mod.rs +10 -0
  84. package/src/ws/services/auth.rs +99 -0
  85. package/src/ws/services/industrial.rs +647 -0
  86. package/src/ws/services/knowledge_base.rs +59 -0
  87. package/src/ws/services/llm_provider.rs +371 -0
  88. package/src/ws/services/mod.rs +7 -0
  89. package/src/ws/ui/bridge_network.rs +96 -0
  90. package/src/ws/ui/file_browsing.rs +88 -0
  91. package/src/ws/ui/logs.rs +55 -0
  92. package/src/ws/ui/mod.rs +11 -0
  93. package/src/ws/ui/noa.rs +105 -0
  94. package/src/ws/ui/system_ui.rs +27 -0
  95. package/src/ws/ui/views.rs +159 -0
  96. package/src/ws/ui/workspace.rs +73 -0
package/Cargo.toml ADDED
@@ -0,0 +1,38 @@
1
+ [package]
2
+ name = "plana-types"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ rust-version.workspace = true
6
+ authors.workspace = true
7
+ license.workspace = true
8
+ description = "Shared protocol types for celestia-island"
9
+ repository = "https://github.com/celestia-island/plana"
10
+ keywords = ["json-rpc", "protocol", "mcp", "typescript", "schema"]
11
+ categories = ["api-bindings", "data-structures", "web-programming::websocket", "network-programming"]
12
+ # Keep generated TS bindings, Python build scripts, and docs out of the published crate.
13
+ exclude = ["bindings", "scripts", ".cargo", "justfile", "package.json", "pnpm-workspace.yaml", "PLAN.md", "res", "examples"]
14
+
15
+ [features]
16
+ default = []
17
+ tracing-helpers = ["chrono", "tracing-subscriber"]
18
+
19
+ [dependencies]
20
+
21
+ kirino = { workspace = true }
22
+
23
+ chrono = { workspace = true, optional = true }
24
+ hex.workspace = true
25
+ schemars = { workspace = true }
26
+ serde = { workspace = true, features = ["derive"] }
27
+ serde_json.workspace = true
28
+ sha2.workspace = true
29
+ thiserror.workspace = true
30
+ tracing-subscriber = { workspace = true, optional = true }
31
+ ts-rs = { workspace = true }
32
+ uuid = { workspace = true }
33
+ [dev-dependencies]
34
+
35
+ anyhow.workspace = true
36
+ toml.workspace = true
37
+ [package.metadata.docs.rs]
38
+ all-features = true
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type FileAnchor = { file_path: string, line_start?: number | null, line_end?: number | null, snapshot_hash?: string | null, };
@@ -0,0 +1,277 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { JsonValue } from "./serde_json/JsonValue";
3
+
4
+ /**
5
+ * `Engine.BinaryAbort` notification params — cancels an in-flight
6
+ * transfer; the receiver discards buffered bytes and returns to normal
7
+ * RPC operation.
8
+ */
9
+ export type EngineBinaryAbortParams = { transfer_id: string, reason: string, };
10
+
11
+ /**
12
+ * `Engine.BinaryEnd` notification params — sent after the final binary
13
+ * frame; the receiver validates and returns to normal RPC operation.
14
+ */
15
+ export type EngineBinaryEndParams = { transfer_id: string,
16
+ /**
17
+ * Bytes actually received across all frames.
18
+ */
19
+ bytes_received: bigint,
20
+ /**
21
+ * Whether the checksum matched (None when no checksum was announced).
22
+ */
23
+ checksum_ok?: boolean, };
24
+
25
+ /**
26
+ * `Engine.BinaryStart` notification params — the announce packet sent
27
+ * BEFORE any binary frame. Every payload is labelled with a MIME type.
28
+ */
29
+ export type EngineBinaryStartParams = {
30
+ /**
31
+ * Correlation id shared by announce / frames / finish.
32
+ */
33
+ transfer_id: string,
34
+ /**
35
+ * MIME type of the whole payload (e.g. "audio/wav",
36
+ * "application/octet-stream"). Empty means unspecified binary.
37
+ */
38
+ mime: string, total_bytes: bigint,
39
+ /**
40
+ * Expected number of binary frames (for early truncation checks).
41
+ */
42
+ chunk_count: number,
43
+ /**
44
+ * Optional SHA-256 hex digest of the payload.
45
+ */
46
+ checksum?: string,
47
+ /**
48
+ * Optional association with a stream (generic streaming).
49
+ */
50
+ stream_id?: string, };
51
+
52
+ /**
53
+ * Static capability declaration supplied at handshake time.
54
+ */
55
+ export type EngineCapabilities = { streaming: boolean, embeddings: boolean, max_context_length: number, hardware: Array<EngineGpuInfo>,
56
+ /**
57
+ * Modalities the engine can consume as input (empty = text only).
58
+ */
59
+ input_modalities: Array<EngineModality>,
60
+ /**
61
+ * Modalities the engine can produce as output.
62
+ */
63
+ output_modalities: Array<EngineModality>,
64
+ /**
65
+ * MIME content types accepted as input (e.g. "audio/wav",
66
+ * "application/octet-stream", "application/json").
67
+ */
68
+ content_types: Array<string>,
69
+ /**
70
+ * Engine-defined `Engine.Invoke` method names beyond the standard
71
+ * convenience methods (e.g. "audio.generate", "signal.filter").
72
+ * Any engine-specific operation is reachable via `Engine.Invoke`
73
+ * even when absent from this list.
74
+ */
75
+ methods: Array<string>, };
76
+
77
+ /**
78
+ * `Engine.ChatChunk` notification — streamed token delta.
79
+ */
80
+ export type EngineChatChunk = { stream_id: string, token: string,
81
+ /**
82
+ * Set on the final chunk.
83
+ */
84
+ is_complete: boolean, usage?: EngineUsage, };
85
+
86
+ /**
87
+ * `Engine.Chat` (non-streaming) / `Engine.ChatStart` (streaming) params.
88
+ */
89
+ export type EngineChatParams = { model: string, messages: Array<EngineMessage>, temperature?: number, max_tokens?: number,
90
+ /**
91
+ * Present for streaming requests — chunks are tagged with this id.
92
+ */
93
+ stream_id?: string,
94
+ /**
95
+ * Free-form passthrough merged into the upstream payload (same
96
+ * semantics as the gateway's `extra` field).
97
+ */
98
+ extra?: JsonValue, };
99
+
100
+ /**
101
+ * `Engine.Chat` result for a non-streaming completion.
102
+ */
103
+ export type EngineChatResult = { model: string, content: string, usage?: EngineUsage, };
104
+
105
+ /**
106
+ * `Engine.ChatStart` acceptance result. `ok: false` rejects the stream
107
+ * before any chunk is sent.
108
+ */
109
+ export type EngineChatStartResult = { ok: boolean, error?: string, stream_id: string, };
110
+
111
+ /**
112
+ * One content unit inside a message. Text is a plain string; everything
113
+ * else is a data block described by mime + encoding so consumers can
114
+ * decode without prior agreement:
115
+ * - `data`: base64 bytes (standard `encoding: "base64"`)
116
+ * - `encoding: "binary-frame"`: bytes arrive in the immediately following
117
+ * WebSocket binary frame (JSON notification is the announcer/trailer)
118
+ * - `encoding: "json"`: `data` is inline JSON (structured sensor readings,
119
+ * tensors, feature vectors…)
120
+ */
121
+ export type EngineContentPart = {
122
+ /**
123
+ * MIME type — "text/plain" for plain text parts.
124
+ */
125
+ mime: string,
126
+ /**
127
+ * Encoding of `data` ("base64" | "binary-frame" | "json" | "utf-8").
128
+ */
129
+ encoding: string,
130
+ /**
131
+ * Payload: base64 text, inline JSON, or raw text depending on
132
+ * `encoding`. Empty for binary-frame parts (bytes follow as a WS
133
+ * binary frame).
134
+ */
135
+ data?: JsonValue,
136
+ /**
137
+ * Optional shape hint for tensor/sensor parts, e.g. [1, 16000]
138
+ * (channels × samples) or the sensor schema id.
139
+ */
140
+ shape?: Array<number>, };
141
+
142
+ export type EngineEmbeddingsParams = { model: string, input: Array<string>, };
143
+
144
+ export type EngineEmbeddingsResult = { model: string, embeddings: Array<Array<number>>, };
145
+
146
+ /**
147
+ * One GPU the engine can drive — used by capacity-aware placement.
148
+ */
149
+ export type EngineGpuInfo = { name: string, vram_gb: bigint, };
150
+
151
+ /**
152
+ * `Engine.Handshake` params — the engine's first message on connect.
153
+ */
154
+ export type EngineHandshakeParams = {
155
+ /**
156
+ * Optional shared token; the gateway rejects mismatches.
157
+ */
158
+ token?: string, engine: EngineIdentity, capabilities: EngineCapabilities, };
159
+
160
+ /**
161
+ * `Engine.Handshake` result. `ok: false` closes the connection.
162
+ *
163
+ * Handshake direction: when the gateway connects to an engine (engine is
164
+ * the server), the gateway sends `Engine.Handshake` and the engine answers
165
+ * with this result carrying its **own** declared capabilities, so the
166
+ * gateway learns modalities/content types before any request. When the
167
+ * engine connects to the gateway (engine is the client), the engine sends
168
+ * `Engine.Handshake` with its capabilities in the params and the gateway
169
+ * answers with `ok` only — the `capabilities` field is then ignored.
170
+ */
171
+ export type EngineHandshakeResult = { ok: boolean, error?: string, protocol_version: number,
172
+ /**
173
+ * The engine's own capability declaration (server-mode handshake).
174
+ */
175
+ capabilities?: EngineCapabilities, };
176
+
177
+ /**
178
+ * Engine implementation identity (any language is fine — this is the
179
+ * interchange contract).
180
+ */
181
+ export type EngineIdentity = { name: string, version: string,
182
+ /**
183
+ * Implementation language, e.g. "rust", "cpp".
184
+ */
185
+ language?: string,
186
+ /**
187
+ * Optional vendor URL.
188
+ */
189
+ vendor?: string, };
190
+
191
+ /**
192
+ * `Engine.Invoke` / `Engine.InvokeStart` params — the generic extension
193
+ * channel. `method` is engine-defined (e.g. "audio.generate",
194
+ * "signal.filter", "train.step"); `params` is any JSON the engine
195
+ * understands. `messages` is optional and reuses the multimodal content
196
+ * model for engines that mix free-form payloads with content parts.
197
+ */
198
+ export type EngineInvokeParams = { method: string, params: JsonValue, messages?: Array<EngineMessage>,
199
+ /**
200
+ * Present for streaming invocations — chunks are tagged with this id.
201
+ */
202
+ stream_id?: string, };
203
+
204
+ /**
205
+ * `Engine.Invoke` result — any JSON the engine returns.
206
+ */
207
+ export type EngineInvokeResult = { method: string, result: JsonValue, };
208
+
209
+ /**
210
+ * `Engine.InvokeStart` acceptance result (same shape as ChatStart).
211
+ */
212
+ export type EngineInvokeStartResult = { ok: boolean, error?: string, stream_id: string, };
213
+
214
+ /**
215
+ * A message in an `Engine.Chat` / `Engine.ChatStart` / `Engine.Invoke`
216
+ * payload. Content is a list of parts so mixed-modality inputs (text +
217
+ * audio + sensor…) are representable. `role` is advisory; specialised
218
+ * engines may ignore it.
219
+ */
220
+ export type EngineMessage = { role: string, content: Array<EngineContentPart>, };
221
+
222
+ /**
223
+ * Input/output modalities an engine can handle. The gateway does NOT
224
+ * assume text — it routes and passes payloads through based on this
225
+ * declaration.
226
+ */
227
+ export type EngineModality = "Text" | "Audio" | "Image" | "Video" | "Sensor" | "Tensor" | "Generic";
228
+
229
+ export type EngineModelInfo = { id: string, context_length?: number, embedding: boolean, };
230
+
231
+ /**
232
+ * `Engine.Models` result.
233
+ */
234
+ export type EngineModelsResult = { models: Array<EngineModelInfo>, };
235
+
236
+ /**
237
+ * `Engine.Shutdown` params — graceful stop requested by the gateway.
238
+ */
239
+ export type EngineShutdownParams = { reason?: string, };
240
+
241
+ /**
242
+ * `Engine.Stats` result — live telemetry for capacity-aware placement.
243
+ */
244
+ export type EngineStatsResult = {
245
+ /**
246
+ * Per-GPU utilisation percentages (0-100), same shape as the agent
247
+ * control-plane heartbeats.
248
+ */
249
+ gpu_utilization: Array<number>, uptime_secs: bigint,
250
+ /**
251
+ * Model id currently loaded, when the engine pins a single model.
252
+ */
253
+ model_loaded?: string, };
254
+
255
+ /**
256
+ * `Engine.StreamChunk` notification — a generic streamed data block for
257
+ * any output modality (audio frame, sensor sample batch, tensor slice…).
258
+ */
259
+ export type EngineStreamChunk = { stream_id: string,
260
+ /**
261
+ * MIME type of this block (e.g. "audio/wav", "application/json").
262
+ */
263
+ mime: string,
264
+ /**
265
+ * "base64" | "binary-frame" | "json" | "utf-8".
266
+ */
267
+ encoding: string, data?: JsonValue,
268
+ /**
269
+ * Optional shape hint for tensor/sensor blocks.
270
+ */
271
+ shape?: Array<number>,
272
+ /**
273
+ * Set on the final block.
274
+ */
275
+ is_complete: boolean, usage?: EngineUsage, };
276
+
277
+ export type EngineUsage = { prompt_tokens: number, completion_tokens: number, };
@@ -0,0 +1,31 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type AnnotationType = "Note" | "Warning" | "Todo" | "Suggestion" | "Conflict";
4
+
5
+ export type ConnectionType = "Local" | "RemoteLan" | "RemoteInternet";
6
+
7
+ export type ConsultationStatus = "WaitingHuman" | "Pending" | "Answered" | "Delivered" | "Scheduled" | "Triggered" | "Cancelled" | "Replied";
8
+
9
+ export type ContainerOpStatus = "Created" | "Running" | "Stopped" | "Removed" | "Forked";
10
+
11
+ export type ConversationMessageType = "Question" | "Answer" | "Clarification" | "Objection" | "CounterProposal" | "Resolution";
12
+
13
+ export type ConversationStatus = "Active" | "Resolved" | "Deadlocked" | "Escalated";
14
+
15
+ export type FileOpStatus = "Created" | "Deleted" | "Edited" | "Written";
16
+
17
+ export type FileOperationType = "Reading" | "Editing" | "Deleting";
18
+
19
+ export type FileType = "File" | "Directory";
20
+
21
+ export type GoalStatus = "Active" | "Completed" | "Abandoned";
22
+
23
+ export type GoalTaskStatus = "Pending" | "InProgress" | "Completed" | "Failed" | "Cancelled";
24
+
25
+ export type ObservationType = "Reading" | "Editing" | "Deleting" | "Watching";
26
+
27
+ export type ScriptLanguage = "Bash" | "Sh" | "Python" | "Python3" | "Javascript" | "Typescript" | "Node" | "Zsh" | "Layer2";
28
+
29
+ export type TrackStatus = "Active" | "Completed" | "Abandoned";
30
+
31
+ export type WebSearchEngine = "Duckduckgo";
@@ -0,0 +1,197 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type AgentConfig = { max_concurrent_tasks: number, timeout_secs: number, retry_on_failure: boolean, model: string, system_prompt: string, };
4
+
5
+ export type AgentContainer = { id: string, image: string, status: string, uptime_secs: bigint, };
6
+
7
+ export type AgentItem = { id: string, name: string, description: string, agent_type: string, layer: number, status: string, enabled: boolean, tools: Array<AgentTool>, toolsCount: number, subscribed: boolean, installed: boolean, version: string, config: AgentConfig, container: AgentContainer | null, skills: Array<string>, createdAt: string, updatedAt: string, };
8
+
9
+ export type AgentTool = { id: string, name: string, description: string, enabled: boolean, };
10
+
11
+ export type AliasRegistryEntry = { workspace_uuid: string, alias: string, short_id: string, };
12
+
13
+ export type AvatarPlatformResponse = { id: string, slug: string, label: string, url_template: string, hint: string | null, enabled: boolean, sort_order: number, };
14
+
15
+ export type AvatarUpdateResponse = { avatar_url: string | null, };
16
+
17
+ /**
18
+ * Backend build profile.
19
+ */
20
+ export type BackendKind = "dev" | "nightly" | "prod" | "mock";
21
+
22
+ export type ChannelConfigDetail = { id: string, platform: string, enabled: boolean, name: string, description?: string, bot_token?: string, app_id?: string, app_secret?: string, verify_token?: string, api_base?: string, extra_config?: Record<string, unknown>, webhook_path: string, last_error?: string, last_tested_at?: string, created_at: string, updated_at: string, };
23
+
24
+ export type ChannelConfigResponse = { config: ChannelConfigDetail, active: boolean, };
25
+
26
+ export type ChannelConfigsResponse = { configs: Array<ChannelConfigResponse>, };
27
+
28
+ export type ChannelListItem = { platform: string, enabled: boolean, bot_name: string, webhook_path: string, };
29
+
30
+ export type ChannelListResponse = { channels: Array<ChannelListItem>, };
31
+
32
+ export type ChannelMessageItem = { id: string, platform: string, direction: string, message_id: string, chat_id: string, sender_id: string | null, text: string, is_group: boolean, group_id: string | null, error: string | null, created_at: string, };
33
+
34
+ export type ChannelMessageListResponse = { messages: Array<ChannelMessageItem>, count: number, };
35
+
36
+ export type ConnectionStatus = { connected: boolean, latency: bigint, lastCheck: string, };
37
+
38
+ export type CreatedResponse = { created: Array<string>, };
39
+
40
+ export type CursorState = { workspace_id?: string, file?: string, line: number, column: number, total_lines?: number, language?: string, visible_range?: CursorVisibleRange, };
41
+
42
+ export type CursorVisibleRange = { start: number, end: number, };
43
+
44
+ export type DeletedResponse = { deleted: bigint, };
45
+
46
+ export type DeliveryListResponse = { deliveries: Array<Record<string, unknown>>, count: number, };
47
+
48
+ export type DeviceResponse = { id: string, device_id: string, name: string, device_type: string, status: string, last_seen_at: string | null, metadata?: Record<string, unknown>, created_at: string, };
49
+
50
+ export type ErrorResponse = { error: string, message?: string, };
51
+
52
+ export type FileEntry = { name: string, type: string, size: bigint | null, };
53
+
54
+ export type FileListingResponse = { path: string, entries: Array<FileEntry>, };
55
+
56
+ export type GrantItem = { id: string, scope: string, user_id: string | null, group_id: string | null, permission: string, resource_id: string | null, granted: boolean, created_at: string, };
57
+
58
+ export type GrantListResponse = { grants: Array<GrantItem>, };
59
+
60
+ export type HealthDetailed = { shittimChest: ConnectionStatus, scepter: ConnectionStatus, database: ConnectionStatus, activeSessions: number, uptime: bigint, version: string, };
61
+
62
+ /**
63
+ * Standard /api/health response for all plana backends.
64
+ */
65
+ export type HealthResponse = { status: ServiceStatus, version: string, kind: BackendKind, uptime: bigint, network: NetworkInfo, build_hash: string | null, engine_version: string | null, };
66
+
67
+ export type IdResponse = { id: string, };
68
+
69
+ export type IpWhitelistResponse = { enabled: boolean, whitelist: Array<Record<string, unknown>>, };
70
+
71
+ export type ModelInfo = { id: string, provider_name: string, provider_id: string, category: string, };
72
+
73
+ export type MyPermissions = { role: string, permissions: Array<string>, };
74
+
75
+ /**
76
+ * Network context from the incoming request.
77
+ */
78
+ export type NetworkInfo = { transport: string, region: string, asn: number | null, };
79
+
80
+ export type OAuthProvider = { provider: string, client_id: string, client_secret_masked: string, public_domain: string, enabled: boolean, };
81
+
82
+ export type OkIdResponse = { ok: boolean, id: string, };
83
+
84
+ export type OkMessageResponse = { ok: boolean, message: string, };
85
+
86
+ export type OkResponse = { ok: boolean, };
87
+
88
+ export type PermissionsResponse = { role: string, permissions: Array<string>, };
89
+
90
+ export type ProjectItem = { id: string, name: string, description: string | null, sort_order: number, created_at: string, updated_at: string, };
91
+
92
+ export type ProviderPublic = { id: string, name: string, endpoint: string, api_key_masked: string, models: Array<string>, category: string, is_default: boolean, enabled: boolean, priority: number, };
93
+
94
+ export type ProxySystemInfo = { version: string, nodeVersion: string, platform: string, cpuUsage: number, memoryUsage: number, diskUsage: number, };
95
+
96
+ export type RbacGroup = { id: string, name: string, description: string, member_count: number, created_at: string, updated_at: string, };
97
+
98
+ export type RbacGroupsResponse = { groups: Array<RbacGroup>, };
99
+
100
+ 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, };
101
+
102
+ export type RbacUsersResponse = { users: Array<RbacUser>, };
103
+
104
+ export type ReadinessResponse = { status: string, database: boolean, };
105
+
106
+ export type ResourceQuota = { id: string, name: string, resource_type: string, limit_value: number, limit_unit: string, used_value: number, period: string, tier: string, enabled: boolean, };
107
+
108
+ export type ResourceQuotaListResponse = { quotas: Array<ResourceQuota>, };
109
+
110
+ export type ResourceUsageResponse = { summary: Array<ResourceUsageSummary>, };
111
+
112
+ export type ResourceUsageSummary = { resource_type: string, current_usage: number, unit: string, limit: number, period: string, utilization_pct: number, };
113
+
114
+ export type SceneBloom = { strength: number, radius: number, threshold: number, };
115
+
116
+ export type SceneCamera = { position: SceneVec3, target: SceneVec3, bookmarks?: { [key in string]: SceneCameraBookmark } | null, };
117
+
118
+ export type SceneCameraBookmark = { position: SceneVec3, target: SceneVec3, };
119
+
120
+ export type SceneConfigItem = { project_id: string, background_color: string, ground: SceneGround | null, lighting: SceneLighting | null, grid: SceneGrid, camera: SceneCamera, bloom: SceneBloom, ambient_light_intensity: number, };
121
+
122
+ export type SceneGrid = { visible: boolean, size: number, divisions: number, };
123
+
124
+ export type SceneGround = { enabled: boolean, size_x: number, size_z: number, color: string, y: number, grid_visible: boolean, grid_size: number, grid_divisions: number, grid_color: string, grid_opacity: number, };
125
+
126
+ export type SceneLighting = { ambient_color: [number, number, number], ambient_intensity: number, directional_color: [number, number, number], directional_intensity: number, directional_position: [number, number, number], };
127
+
128
+ export type SceneVec3 = { x: number, y: number, z: number, };
129
+
130
+ /**
131
+ * Service health status. Serde uses lowercase so JSON returns "ok" etc.
132
+ */
133
+ export type ServiceStatus = "ok" | "degraded" | "unhealthy";
134
+
135
+ export type SessionCreateResponse = { session_id: string, status: string, signaling?: Record<string, unknown>, };
136
+
137
+ export type SetupCheckResponse = { needs_setup: boolean, locale?: string, registration_enabled: boolean, };
138
+
139
+ export type SkillItem = { skill_id: string, name: string, description: string, category: string, agent: string, agent_types: Array<string>, parameters: Array<SkillParameterItem>, estimated_duration_secs: bigint, };
140
+
141
+ export type SkillParameterItem = { name: string, type: string, default?: unknown, description: string | null, required: boolean, };
142
+
143
+ export type StatusResponse = { status: string, agent_id?: string, platform?: string, id?: string, plugin_id?: string, };
144
+
145
+ export type SystemInfoAgents = { total: number, running: number, idle: number, stopped: number, };
146
+
147
+ export type SystemInfoConnections = { active_ws: number, active_http: number, };
148
+
149
+ export type SystemInfoDatabase = { engine: string, size_mb: number, connections: number, };
150
+
151
+ export type SystemInfoResources = { cpu_usage_pct: number, memory_used_gb: number, memory_total_gb: number, disk_used_gb: number, disk_total_gb: number, };
152
+
153
+ export type SystemInfoResponse = { version: string, uptime_secs: bigint, agents: SystemInfoAgents, resources: SystemInfoResources, connections: SystemInfoConnections, database: SystemInfoDatabase, };
154
+
155
+ export type TierDefinition = { tier: string, daily_request_limit: number, monthly_token_limit: number, max_sessions: number, price: string, };
156
+
157
+ export type TierListResponse = { tiers: Array<TierDefinition>, };
158
+
159
+ export type TokenUsageResponse = { usage: Array<UsageEntry>, total_tokens: bigint, };
160
+
161
+ export type ToolItem = { tool_id: string, name: string, description: string, category: string, agent: string, input_schema: Record<string, unknown>, output_schema?: Record<string, unknown>, };
162
+
163
+ export type UpdateUserTierPayload = { user_id: string, tier: string, };
164
+
165
+ export type UsageDataResponse = { period: string, total_tokens: bigint, total_cost_usd: number, by_model: Array<UsageModelEntry>, by_day: Array<UsageDayEntry>, };
166
+
167
+ export type UsageDayEntry = { date: string, tokens: bigint, requests: number, };
168
+
169
+ export type UsageEntry = { model: string, token_count: bigint, };
170
+
171
+ export type UsageModelEntry = { model: string, tokens: bigint, cost_usd: number, requests: number, };
172
+
173
+ export type UserPreferences = { theme?: string, themeMode?: string, chatMode?: string, locale?: string, };
174
+
175
+ 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, };
176
+
177
+ 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, };
178
+
179
+ export type ValidateKeyResponse = { valid: boolean, models: Array<string>, recommended_models: Array<string>, error: string | null, };
180
+
181
+ export type VendorInfo = { id: string, name: string, endpoint: string, category: string, description: string, recommended_models: Array<string>, plan_models: { [key in string]: Array<string> }, };
182
+
183
+ export type WebhookDeliveryGenItem = { id: string, webhook_id: string, event: string, status: number, duration_ms: bigint, timestamp: string, request_headers: { [key in string]: string }, response_body?: Record<string, unknown>, };
184
+
185
+ export type WebhookDeliveryItem = { id: string, webhookId: string, event: string, statusCode: number, requestHeaders: { [key in string]: string }, requestBody?: Record<string, unknown>, responseHeaders?: { [key in string]: string }, responseBody: string, duration: bigint, success: boolean, deliveredAt: string, };
186
+
187
+ export type WebhookInfoItem = { name: string, url: string, events: Array<string>, };
188
+
189
+ export type WebhookItem = { id: string, name: string, url: string, platform: string, secret: string, events: Array<string>, status: string, lastDeliveryAt?: string, createdAt: string, updatedAt: string, };
190
+
191
+ export type WebhookListResponse = { webhooks: Array<WebhookInfoItem>, };
192
+
193
+ export type WorkspaceItem = { id: string, path: string, editor: string, git_branch: string, status: string, connected: boolean, short_id: string, alias?: string, connection_kind: string, };
194
+
195
+ export type WorkspaceResolveResponse = { workspace_uuid: string, short_id: string, alias?: string, path: string, };
196
+
197
+ 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, };
@@ -0,0 +1,47 @@
1
+ // WS protocol — foundational shared enums (Agent, AgentStatus, TaskStatus, …).
2
+ export * from "./ws/core";
3
+ // WS protocol — per-domain message param structs.
4
+ export * from "./ws/handshake";
5
+ export * from "./ws/noa";
6
+ export * from "./ws/logs";
7
+ export * from "./ws/agentLifecycle";
8
+ export * from "./ws/tasks";
9
+ export * from "./ws/llmProvider";
10
+ export * from "./ws/stateSync";
11
+ export * from "./ws/knowledgeBase";
12
+ export * from "./ws/layer2";
13
+ export * from "./ws/workspace";
14
+ export * from "./ws/systemUi";
15
+ export * from "./ws/auth";
16
+ export * from "./ws/yolo";
17
+ export * from "./ws/baseMessages";
18
+ export * from "./ws/industrial";
19
+ export * from "./ws/views";
20
+ export * from "./ws/fileBrowsing";
21
+ export * from "./ws/bridgeNetwork";
22
+ // Malkuth supervision protocol types (restart authorization gate).
23
+ // HealthResponse is re-exported under a distinct name because the HTTP REST
24
+ // types below export a same-named type; TS forbids two `export *` collisions.
25
+ export {
26
+ type GateDecision,
27
+ type RestartRisk,
28
+ type RestartGateDecision,
29
+ type RestartProposal,
30
+ type ConnectionProtocol,
31
+ type WorkerState,
32
+ type ConnectionEndpoint,
33
+ type DrainRequest,
34
+ type HealthResponse as MalkuthHealthResponse,
35
+ type WorkerRegistration,
36
+ type WorkerStatus,
37
+ } from "./ws/malkuth";
38
+ // HTTP REST API types.
39
+ export * from "./httpTypes";
40
+ // Unified model management types.
41
+ export * from "./model";
42
+ // Shared domain vocabulary enums.
43
+ export * from "./enums";
44
+ // Celestia Engine Protocol (CEP) — model-runtime interchange types.
45
+ export * from "./engine";
46
+ // Per-agent MCP tool request/result types (namespaced).
47
+ export * as mcp from "./mcp";
@@ -0,0 +1,61 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type AnomalyDetectParams = { values: Array<number>, method: string | null, threshold: number | null, timestamps: Array<bigint> | null, window_size: number | null, };
4
+
5
+ export type AnomalyInfo = { index: number, value: number, expected: number, deviation: number, timestamp: bigint | null, severity: string, };
6
+
7
+ export type AnomalyResult = { anomalies: Array<AnomalyInfo>, total_points: number, anomaly_count: number, anomaly_ratio: number, method: string, threshold: number, };
8
+
9
+ export type CausalReasonParams = { target: string, target_values: Array<number>, candidates: { [key in string]: Array<number> } | null, max_lag: number | null, };
10
+
11
+ export type CausalReasonResult = { correlations: Array<CorrelationInfo>, hypotheses: Array<Hypothesis>, recommended_actions: Array<string>, confidence: number, };
12
+
13
+ export type CorrelationInfo = { variable: string, correlation: number, lag: number, direction: string, };
14
+
15
+ export type Hypothesis = { cause: string, effect: string, strength: number, reasoning: string, };
16
+
17
+ export type LlmChatParams = { prompt: string, model: string | null, system_prompt: string | null, };
18
+
19
+ export type LlmChatResult = { model: string, tokens: string, response: string, };
20
+
21
+ export type MediaAssetItem = { asset_id: string, asset_type: string, source_url: string, metadata: Record<string, unknown>, tags: Array<string>, created_at: string, };
22
+
23
+ export type MediaAssetRegisterResult = { asset_id: string, asset_type: string, source_url: string, tags: Array<string>, };
24
+
25
+ export type MediaAssetRetrieveResult = { count: number, assets: Array<MediaAssetItem>, };
26
+
27
+ export type RagDbDeleteParams = { id: string, };
28
+
29
+ export type RagDbDeleteResult = { doc_id: string, };
30
+
31
+ export type RagDbReadParams = { query_embedding: Array<number>, limit: number | null, };
32
+
33
+ export type RagDbReadResult = { count: number, results: Array<RagDocResult>, };
34
+
35
+ export type RagDbStatsParams = Record<symbol, never>;
36
+
37
+ export type RagDbStatsResult = { total_documents: number, total_media_assets: number, embedding_dimensions: number | null, storage_backend: string, };
38
+
39
+ export type RagDbWriteParams = { content: string, embedding: Array<number> | null, metadata: Record<string, unknown> | null, source: string | null, };
40
+
41
+ export type RagDbWriteResult = { doc_id: string, embedding_dim: number, content: string, };
42
+
43
+ export type RagDocResult = { doc_id: string, similarity: number, content: string, source: string | null, metadata: Record<string, unknown> | null, };
44
+
45
+ export type TranslateReportParams = { content: string, target_language: string | null, };
46
+
47
+ export type TranslateReportResult = { target_language: string, original_length: number, translated_length: number, translation: string, };
48
+
49
+ export type WorkspaceIndexParams = { workspace_root: string, full_rebuild: boolean | null, };
50
+
51
+ export type WorkspaceIndexResult = { total_files: number, total_chunks: number, total_bytes: number, duration_ms: bigint, };
52
+
53
+ export type WorkspaceSearchDoc = { doc_id: string, file_path: string, start_line: number, end_line: number, language: string, similarity: number, snippet: string, };
54
+
55
+ export type WorkspaceSearchParams = { query: string, limit: number | null, };
56
+
57
+ export type WorkspaceSearchResult = { count: number, results: Array<WorkspaceSearchDoc>, };
58
+
59
+ export type WorkspaceStatusParams = Record<symbol, never>;
60
+
61
+ export type WorkspaceStatusResult = { total_files: number, total_chunks: number, total_bytes: number, last_indexed: string | null, is_indexing: boolean, };