@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
@@ -0,0 +1,105 @@
1
+ //! NOA Workspace — SyncMessage variant params.
2
+ //!
3
+ //! Mirrors `entelecheia/packages/shared/state_types/src/gateway/
4
+ //! tui_types/message/types/mod.rs`. The NOA handshake is a 4-message round trip:
5
+ //!
6
+ //! scepter → client RequestNoaHandshake
7
+ //! client → scepter NoaHandshakeResponse
8
+ //! scepter → client NoaAuthRequest (branch picker)
9
+ //! client → scepter NoaAuthResponse (user's choice)
10
+ //! scepter → client NoaReady (terminal event)
11
+ //!
12
+ //! Plus a bidirectional event-sync pair used after NoaReady.
13
+
14
+ use serde::{Deserialize, Serialize};
15
+ use ts_rs::TS;
16
+
17
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
18
+ #[ts(export, export_to = "ws/noa.ts")]
19
+ pub struct NoaEvent {
20
+ pub event_id: String,
21
+ pub event_type: String,
22
+ pub timestamp: String,
23
+ #[serde(default)]
24
+ #[ts(optional)]
25
+ pub file_path: Option<String>,
26
+ #[serde(default)]
27
+ #[ts(optional)]
28
+ pub content_hash: Option<String>,
29
+ #[serde(default)]
30
+ #[ts(optional, type = "Record<string, unknown>")]
31
+ pub metadata: Option<serde_json::Value>,
32
+ }
33
+
34
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
35
+ #[ts(export, export_to = "ws/noa.ts")]
36
+ pub struct RequestNoaHandshakeParams {
37
+ #[ts(type = "string")]
38
+ pub workspace_id: uuid::Uuid,
39
+ pub remote_name: String,
40
+ pub remote_path: String,
41
+ }
42
+
43
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
44
+ #[ts(export, export_to = "ws/noa.ts")]
45
+ pub struct NoaHandshakeResponseParams {
46
+ #[ts(type = "string")]
47
+ pub workspace_id: uuid::Uuid,
48
+ pub repo_id: String,
49
+ pub current_branch: String,
50
+ #[serde(default)]
51
+ pub noa_initialized: bool,
52
+ #[serde(default)]
53
+ pub gitignore_updated: bool,
54
+ }
55
+
56
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
57
+ #[ts(export, export_to = "ws/noa.ts")]
58
+ pub struct NoaAuthRequestParams {
59
+ #[ts(type = "string")]
60
+ pub workspace_id: uuid::Uuid,
61
+ pub branches: Vec<String>,
62
+ pub suggested_branch: String,
63
+ pub reason: String,
64
+ }
65
+
66
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
67
+ #[ts(export, export_to = "ws/noa.ts")]
68
+ pub struct NoaAuthResponseParams {
69
+ #[ts(type = "string")]
70
+ pub workspace_id: uuid::Uuid,
71
+ pub selected_branch: String,
72
+ #[serde(default)]
73
+ #[ts(optional)]
74
+ pub branch_base: Option<String>,
75
+ #[serde(default)]
76
+ pub approved: bool,
77
+ }
78
+
79
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
80
+ #[ts(export, export_to = "ws/noa.ts")]
81
+ pub struct NoaReadyParams {
82
+ #[ts(type = "string")]
83
+ pub workspace_id: uuid::Uuid,
84
+ pub branch: String,
85
+ pub snapshot_id: String,
86
+ }
87
+
88
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
89
+ #[ts(export, export_to = "ws/noa.ts")]
90
+ pub struct NoaEventSyncParams {
91
+ #[ts(type = "string")]
92
+ pub workspace_id: uuid::Uuid,
93
+ pub events: Vec<NoaEvent>,
94
+ #[serde(default)]
95
+ #[ts(optional)]
96
+ pub direction: Option<String>,
97
+ }
98
+
99
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
100
+ #[ts(export, export_to = "ws/noa.ts")]
101
+ pub struct NoaEventSyncAckParams {
102
+ #[ts(type = "string")]
103
+ pub workspace_id: uuid::Uuid,
104
+ pub last_event_id: String,
105
+ }
@@ -0,0 +1,27 @@
1
+ //! System / UI — web-UI control & status.
2
+
3
+ use serde::{Deserialize, Serialize};
4
+ use ts_rs::TS;
5
+
6
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
7
+ #[ts(export, export_to = "ws/systemUi.ts")]
8
+ pub struct WebUiControlResponseParams {
9
+ pub command: String,
10
+ pub success: bool,
11
+ pub message: String,
12
+ #[serde(default)]
13
+ #[ts(optional)]
14
+ pub url: Option<String>,
15
+ }
16
+
17
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
18
+ #[ts(export, export_to = "ws/systemUi.ts")]
19
+ pub struct WebUiStatusParams {
20
+ pub running: bool,
21
+ #[serde(default)]
22
+ #[ts(optional)]
23
+ pub url: Option<String>,
24
+ #[serde(default)]
25
+ #[ts(optional)]
26
+ pub container_id: Option<String>,
27
+ }
@@ -0,0 +1,159 @@
1
+ //! Abstract View Interface — pluggable dashboard views.
2
+
3
+ use serde::{Deserialize, Serialize};
4
+ use ts_rs::TS;
5
+
6
+ /// View type identifier — determines which frontend renderer handles the view.
7
+ #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, TS)]
8
+ #[serde(rename_all = "snake_case")]
9
+ #[ts(export, export_to = "ws/views.ts")]
10
+ pub enum ViewKind {
11
+ /// Industrial SCADA / HMI panel (P&ID, gauges, alarm panel, trend charts)
12
+ IndustrialScada,
13
+ /// Chat / conversation interface (default demiurge view)
14
+ Chat,
15
+ /// Kanban board (task cards, columns, drag-drop)
16
+ Kanban,
17
+ /// Gantt chart (timeline, milestones, dependencies)
18
+ Gantt,
19
+ /// Data table / spreadsheet (like Feishu multi-dimensional table)
20
+ DataTable,
21
+ /// Audio/video generation flow (node graph like ComfyUI)
22
+ MediaFlow,
23
+ /// File explorer / code browser
24
+ FileExplorer,
25
+ /// Custom (plugin-rendered)
26
+ Custom,
27
+ }
28
+
29
+ /// A view instance — one panel in the dashboard.
30
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
31
+ #[ts(export, export_to = "ws/views.ts")]
32
+ pub struct ViewInstance {
33
+ /// Unique view ID within the workspace.
34
+ pub view_id: String,
35
+ /// What kind of renderer to use.
36
+ pub kind: ViewKind,
37
+ /// Display title.
38
+ pub title: String,
39
+ /// Data source identifier — what the view is bound to.
40
+ /// Examples: "industrial:station:19", "chat:conversation:abc",
41
+ /// "kanban:project:xyz", "media:flow:comfyui"
42
+ pub data_source: String,
43
+ /// View-specific configuration (JSON, interpreted by the renderer).
44
+ #[serde(default)]
45
+ #[ts(type = "Record<string, unknown>")]
46
+ pub config: serde_json::Value,
47
+ /// Layout position (grid area, tab order, etc.).
48
+ #[serde(default)]
49
+ #[ts(optional)]
50
+ pub layout: Option<ViewLayout>,
51
+ }
52
+
53
+ /// Layout descriptor for a view within the dashboard grid.
54
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
55
+ #[ts(export, export_to = "ws/views.ts")]
56
+ pub struct ViewLayout {
57
+ /// Grid column start (1-based).
58
+ #[serde(default)]
59
+ pub col: u32,
60
+ /// Grid row start (1-based).
61
+ #[serde(default)]
62
+ pub row: u32,
63
+ /// Column span.
64
+ #[serde(default)]
65
+ pub col_span: u32,
66
+ /// Row span.
67
+ #[serde(default)]
68
+ pub row_span: u32,
69
+ /// Minimum width in pixels.
70
+ #[serde(default)]
71
+ #[ts(optional)]
72
+ pub min_width: Option<u32>,
73
+ /// Minimum height in pixels.
74
+ #[serde(default)]
75
+ #[ts(optional)]
76
+ pub min_height: Option<u32>,
77
+ }
78
+
79
+ /// Dashboard layout — a collection of views arranged in a grid.
80
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
81
+ #[ts(export, export_to = "ws/views.ts")]
82
+ pub struct DashboardLayout {
83
+ /// Workspace ID this dashboard belongs to.
84
+ pub workspace_id: String,
85
+ /// Dashboard name.
86
+ pub name: String,
87
+ /// All view instances in this dashboard.
88
+ pub views: Vec<ViewInstance>,
89
+ /// Grid columns count (0 = auto).
90
+ #[serde(default)]
91
+ pub grid_columns: u32,
92
+ }
93
+
94
+ /// Push a dashboard layout update to connected clients.
95
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
96
+ #[ts(export, export_to = "ws/views.ts")]
97
+ pub struct DashboardLayoutPushParams {
98
+ pub layout: DashboardLayout,
99
+ }
100
+
101
+ /// View data update — incremental data push for a specific view.
102
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
103
+ #[ts(export, export_to = "ws/views.ts")]
104
+ pub struct ViewDataPushParams {
105
+ /// Target view ID.
106
+ pub view_id: String,
107
+ /// Data payload (format depends on ViewKind).
108
+ #[ts(type = "Record<string, unknown>")]
109
+ pub data: serde_json::Value,
110
+ /// Whether this is a full replacement or incremental update.
111
+ #[serde(default)]
112
+ pub full_replace: bool,
113
+ }
114
+
115
+ /// A widget inside a webui dashboard descriptor (P3#A4).
116
+ ///
117
+ /// Mirrors the shittim-chest `WidgetDescriptor` (dashboard.ts) so the
118
+ /// agent-side push tool can construct widgets the webui understands
119
+ /// without knowing its internals.
120
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
121
+ #[ts(export, export_to = "ws/views.ts")]
122
+ pub struct DashboardWidget {
123
+ /// Unique widget id within the layout.
124
+ pub id: String,
125
+ /// Renderer discriminator ("gauge-row", "node-graph", "data-table", …).
126
+ #[serde(rename = "type")]
127
+ pub widget_type: String,
128
+ /// Optional display title.
129
+ #[serde(default, skip_serializing_if = "Option::is_none")]
130
+ #[ts(optional)]
131
+ pub title: Option<String>,
132
+ /// Data-source label (free-form).
133
+ #[serde(default)]
134
+ pub source: String,
135
+ /// Grid span hint ("full" | "half").
136
+ #[serde(default, skip_serializing_if = "Option::is_none")]
137
+ #[ts(optional)]
138
+ pub span: Option<String>,
139
+ /// Widget-specific configuration.
140
+ #[serde(default, skip_serializing_if = "Option::is_none")]
141
+ #[ts(optional, type = "Record<string, unknown>")]
142
+ pub config: Option<serde_json::Value>,
143
+ /// Initial data payload (shape depends on widget type).
144
+ #[serde(default, skip_serializing_if = "Option::is_none")]
145
+ #[ts(optional, type = "Record<string, unknown>")]
146
+ pub data: Option<serde_json::Value>,
147
+ }
148
+
149
+ /// Widget create/update/delete on an existing layout (P3#A4).
150
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
151
+ #[ts(export, export_to = "ws/views.ts")]
152
+ pub struct ViewInstancePushParams {
153
+ /// Target layout (panel instance) id.
154
+ pub layout_id: String,
155
+ /// Mutation: "create" | "update" | "delete".
156
+ pub op: String,
157
+ /// Widget descriptor to create/update (ignored for delete).
158
+ pub widget: DashboardWidget,
159
+ }
@@ -0,0 +1,73 @@
1
+ //! Workspace & Polemos device registry types.
2
+
3
+ use serde::{Deserialize, Serialize};
4
+ use ts_rs::TS;
5
+
6
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
7
+ #[ts(export, export_to = "ws/workspace.ts")]
8
+ pub struct WorkspaceStatusParams {
9
+ #[ts(type = "string")]
10
+ pub workspace_id: uuid::Uuid,
11
+ #[serde(default)]
12
+ #[ts(optional)]
13
+ pub display_name: Option<String>,
14
+ #[serde(default)]
15
+ pub connection_kind: String,
16
+ #[serde(default)]
17
+ #[ts(optional)]
18
+ pub resolved_path: Option<String>,
19
+ #[serde(default)]
20
+ #[ts(optional)]
21
+ pub remote_url: Option<String>,
22
+ #[serde(default)]
23
+ #[ts(optional)]
24
+ pub branch: Option<String>,
25
+ #[serde(default)]
26
+ #[ts(optional)]
27
+ pub host_id: Option<String>,
28
+ }
29
+
30
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
31
+ #[ts(export, export_to = "ws/workspace.ts")]
32
+ pub struct PolemosDeviceInfo {
33
+ #[ts(type = "string")]
34
+ pub node_id: uuid::Uuid,
35
+ pub name: String,
36
+ pub address: String,
37
+ pub status: String,
38
+ #[serde(default)]
39
+ #[ts(optional)]
40
+ pub workspace_path: Option<String>,
41
+ #[serde(default)]
42
+ #[ts(optional)]
43
+ pub ide_id: Option<String>,
44
+ }
45
+
46
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
47
+ #[ts(export, export_to = "ws/workspace.ts")]
48
+ pub struct PolemosDeviceListParams {
49
+ pub devices: Vec<PolemosDeviceInfo>,
50
+ }
51
+
52
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
53
+ #[ts(export, export_to = "ws/workspace.ts")]
54
+ pub struct RegisterPolemosDeviceResponseParams {
55
+ pub success: bool,
56
+ #[serde(default)]
57
+ #[ts(optional)]
58
+ pub error: Option<String>,
59
+ #[serde(default)]
60
+ #[ts(optional)]
61
+ pub device: Option<PolemosDeviceInfo>,
62
+ }
63
+
64
+ #[derive(Debug, Clone, Serialize, Deserialize, TS)]
65
+ #[ts(export, export_to = "ws/workspace.ts")]
66
+ pub struct SwitchWorkspaceResponseParams {
67
+ pub success: bool,
68
+ #[ts(type = "string")]
69
+ pub workspace_id: uuid::Uuid,
70
+ #[serde(default)]
71
+ #[ts(optional)]
72
+ pub error: Option<String>,
73
+ }