@celestia-island/plana-types 0.1.0 → 0.1.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.
Files changed (85) hide show
  1. package/LICENSE +222 -0
  2. package/bindings/engine.ts +13 -1
  3. package/bindings/enums.ts +0 -2
  4. package/bindings/httpTypes.ts +0 -58
  5. package/bindings/mdd.ts +444 -0
  6. package/bindings/protocol-core-httpTypes.ts +69 -0
  7. package/bindings/{mcp → tools}/philia.ts +4 -4
  8. package/bindings/ws/agentLifecycle.ts +17 -4
  9. package/bindings/ws/core.ts +3 -3
  10. package/bindings/ws/handshake.ts +0 -4
  11. package/bindings/ws/layer2.ts +6 -6
  12. package/bindings/ws/realtime.ts +122 -0
  13. package/bindings/ws/tasks.ts +6 -1
  14. package/index.ts +74 -0
  15. package/package.json +13 -3
  16. package/Cargo.toml +0 -38
  17. package/bindings/FileAnchor.ts +0 -3
  18. package/bindings/index.ts +0 -47
  19. package/bindings/mcp/index.ts +0 -13
  20. package/bindings/package.json +0 -16
  21. package/bindings/region.ts +0 -3
  22. package/bindings/ws/baseMessages.ts +0 -7
  23. package/examples/schema_dump.rs +0 -51
  24. package/pnpm-workspace.yaml +0 -2
  25. package/src/engine.rs +0 -602
  26. package/src/enums.rs +0 -334
  27. package/src/external_mcp.rs +0 -132
  28. package/src/http.rs +0 -1077
  29. package/src/identity.rs +0 -160
  30. package/src/lib.rs +0 -1215
  31. package/src/malkuth.rs +0 -145
  32. package/src/mcp/aporia.rs +0 -272
  33. package/src/mcp/eleos.rs +0 -210
  34. package/src/mcp/epieikeia.rs +0 -194
  35. package/src/mcp/haplotes.rs +0 -310
  36. package/src/mcp/hubris.rs +0 -377
  37. package/src/mcp/kalos.rs +0 -251
  38. package/src/mcp/mod.rs +0 -23
  39. package/src/mcp/neikos.rs +0 -533
  40. package/src/mcp/orexis.rs +0 -493
  41. package/src/mcp/philia.rs +0 -267
  42. package/src/mcp/polemos.rs +0 -241
  43. package/src/mcp/skemma.rs +0 -442
  44. package/src/mcp/skopeo.rs +0 -282
  45. package/src/mcp/web_automation.rs +0 -122
  46. package/src/model.rs +0 -421
  47. package/src/protocol/base_messages.rs +0 -125
  48. package/src/protocol/handshake.rs +0 -364
  49. package/src/protocol/jsonrpc.rs +0 -888
  50. package/src/protocol/mod.rs +0 -10
  51. package/src/rbac.rs +0 -786
  52. package/src/region.rs +0 -362
  53. package/src/tracing_helpers.rs +0 -9
  54. package/src/ws/agent/agent_lifecycle.rs +0 -221
  55. package/src/ws/agent/layer2.rs +0 -126
  56. package/src/ws/agent/mod.rs +0 -9
  57. package/src/ws/agent/state_sync.rs +0 -111
  58. package/src/ws/agent/tasks.rs +0 -43
  59. package/src/ws/agent/yolo.rs +0 -161
  60. package/src/ws/mod.rs +0 -10
  61. package/src/ws/services/auth.rs +0 -99
  62. package/src/ws/services/industrial.rs +0 -647
  63. package/src/ws/services/knowledge_base.rs +0 -59
  64. package/src/ws/services/llm_provider.rs +0 -371
  65. package/src/ws/services/mod.rs +0 -7
  66. package/src/ws/ui/bridge_network.rs +0 -96
  67. package/src/ws/ui/file_browsing.rs +0 -88
  68. package/src/ws/ui/logs.rs +0 -55
  69. package/src/ws/ui/mod.rs +0 -11
  70. package/src/ws/ui/noa.rs +0 -105
  71. package/src/ws/ui/system_ui.rs +0 -27
  72. package/src/ws/ui/views.rs +0 -159
  73. package/src/ws/ui/workspace.rs +0 -73
  74. /package/bindings/{mcp → tools}/aporia.ts +0 -0
  75. /package/bindings/{mcp → tools}/eleos.ts +0 -0
  76. /package/bindings/{mcp → tools}/epieikeia.ts +0 -0
  77. /package/bindings/{mcp → tools}/haplotes.ts +0 -0
  78. /package/bindings/{mcp → tools}/hubris.ts +0 -0
  79. /package/bindings/{mcp → tools}/kalos.ts +0 -0
  80. /package/bindings/{mcp → tools}/neikos.ts +0 -0
  81. /package/bindings/{mcp → tools}/orexis.ts +0 -0
  82. /package/bindings/{mcp → tools}/polemos.ts +0 -0
  83. /package/bindings/{mcp → tools}/skemma.ts +0 -0
  84. /package/bindings/{mcp → tools}/skopeo.ts +0 -0
  85. /package/bindings/{mcp/webAutomation.ts → tools/web_automation.ts} +0 -0
package/src/identity.rs DELETED
@@ -1,160 +0,0 @@
1
- //! Cross-platform machine fingerprint.
2
- //!
3
- //! Provides a deterministic, installation-unique identifier that can be read
4
- //! without admin privileges. The fingerprint is used as key material for the
5
- //! local OAuth issuer — the same machine always derives the same key, so the
6
- //! issuer and the resource server (both running on the same host) can
7
- //! independently compute the same HS256 signing/verification key.
8
- //!
9
- //! The raw platform identifier is hashed with SHA-256 so the output is a
10
- //! fixed-width, opaque hex string regardless of the underlying source format.
11
- //!
12
- //! # Sources
13
- //!
14
- //! | Platform | Source |
15
- //! |----------|--------|
16
- //! | Linux | `/etc/machine-id` (systemd) |
17
- //! | Windows | `HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid` |
18
- //! | macOS | `IOPlatformUUID` via ioreg |
19
- //! | WSL2 | `/etc/machine-id` (WSL2 distro's own) |
20
- //!
21
- //! If the primary source is unavailable, falls back to a composite of the
22
- //! hostname + OS details — less unique but stable across reboots.
23
-
24
- use sha2::{Digest, Sha256};
25
-
26
- /// 64 hex chars — the SHA-256 hash of the machine identifier.
27
- pub fn machine_fingerprint() -> Option<String> {
28
- let raw = raw_machine_id()?;
29
- let hash = Sha256::digest(raw.as_bytes());
30
- Some(hex::encode(hash))
31
- }
32
-
33
- /// Return the best available raw platform identifier, or None.
34
- fn raw_machine_id() -> Option<String> {
35
- #[cfg(target_os = "linux")]
36
- {
37
- // Standard systemd machine-id; present on virtually all modern Linux
38
- // distros AND inside WSL2 distros (each WSL2 distro gets its own).
39
- if let Ok(id) = std::fs::read_to_string("/etc/machine-id") {
40
- let trimmed = id.trim().to_string();
41
- if !trimmed.is_empty() {
42
- return Some(trimmed);
43
- }
44
- }
45
- // Fallback: /var/lib/dbus/machine-id (older systems).
46
- if let Ok(id) = std::fs::read_to_string("/var/lib/dbus/machine-id") {
47
- let trimmed = id.trim().to_string();
48
- if !trimmed.is_empty() {
49
- return Some(trimmed);
50
- }
51
- }
52
- }
53
-
54
- #[cfg(target_os = "windows")]
55
- {
56
- // MachineGuid is a REG_SZ under HKLM; it's set at Windows
57
- // installation and never changes. Reading it does not require admin.
58
- if let Ok(output) = std::process::Command::new("reg")
59
- .args([
60
- "query",
61
- r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography",
62
- "/v",
63
- "MachineGuid",
64
- ])
65
- .output()
66
- {
67
- let text = String::from_utf8_lossy(&output.stdout);
68
- // Output format:
69
- // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
70
- // MachineGuid REG_SZ {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
71
- for line in text.lines() {
72
- if let Some(pos) = line.find("REG_SZ") {
73
- let val = line[pos + 6..].trim();
74
- // Strip curly braces if present.
75
- let val = val.trim_start_matches('{').trim_end_matches('}');
76
- if !val.is_empty() {
77
- return Some(val.to_string());
78
- }
79
- }
80
- }
81
- }
82
- }
83
-
84
- #[cfg(target_os = "macos")]
85
- {
86
- if let Ok(output) = std::process::Command::new("ioreg")
87
- .args(["-d2", "-c", "IOPlatformExpertDevice"])
88
- .output()
89
- {
90
- let text = String::from_utf8_lossy(&output.stdout);
91
- for line in text.lines() {
92
- if let Some(pos) = line.find("IOPlatformUUID") {
93
- let remainder = &line[pos..];
94
- // Line looks like: "IOPlatformUUID" = "XXXXXXXX-XXXX-..."
95
- if let Some(q1) = remainder.find('"') {
96
- let after_key = &remainder[q1 + 1..];
97
- if let Some(q2) = after_key.find('"') {
98
- let after_eq = &after_key[q2 + 1..];
99
- if let Some(q3) = after_eq.find('"') {
100
- if let Some(q4) = after_eq[q3 + 1..].find('"') {
101
- let uuid = &after_eq[q3 + 1..q3 + 1 + q4];
102
- return Some(uuid.to_string());
103
- }
104
- }
105
- }
106
- }
107
- }
108
- }
109
- }
110
- }
111
-
112
- // Universal fallback: hostname + OS. Not unique across clones, but stable
113
- // across reboots and sufficient for a dev machine where the primary source
114
- // failed for some reason.
115
- let host = hostname::get().ok().and_then(|h| h.into_string().ok())?;
116
- Some(format!(
117
- "{}:{}:{}",
118
- host,
119
- std::env::consts::OS,
120
- std::env::consts::ARCH
121
- ))
122
- }
123
-
124
- /// Thin wrapper — hostname detection without pulling in a crate.
125
- /// Windows: COMPUTERNAME env (always set). Unix: /proc/sys/kernel/hostname
126
- /// or /etc/hostname. Fallback: "unknown".
127
- mod hostname {
128
- use std::ffi::OsString;
129
-
130
- pub fn get() -> std::io::Result<OsString> {
131
- #[cfg(windows)]
132
- {
133
- std::env::var("COMPUTERNAME")
134
- .map(OsString::from)
135
- .map_err(|_| std::io::Error::new(std::io::ErrorKind::NotFound, "COMPUTERNAME"))
136
- }
137
- #[cfg(unix)]
138
- {
139
- for path in ["/proc/sys/kernel/hostname", "/etc/hostname"] {
140
- if let Ok(s) = std::fs::read_to_string(path) {
141
- let trimmed = s.trim().to_string();
142
- if !trimmed.is_empty() {
143
- return Ok(OsString::from(trimmed));
144
- }
145
- }
146
- }
147
- Err(std::io::Error::new(
148
- std::io::ErrorKind::NotFound,
149
- "hostname files",
150
- ))
151
- }
152
- #[cfg(not(any(windows, unix)))]
153
- {
154
- Err(std::io::Error::new(
155
- std::io::ErrorKind::Unsupported,
156
- "unsupported platform",
157
- ))
158
- }
159
- }
160
- }