@cello-protocol/daemon 0.0.3 → 0.0.5

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 (153) hide show
  1. package/dist/agent-loader.d.ts +41 -0
  2. package/dist/agent-loader.d.ts.map +1 -0
  3. package/dist/agent-loader.js +94 -0
  4. package/dist/agent-loader.js.map +1 -0
  5. package/dist/bin/cello-daemon.d.ts +13 -0
  6. package/dist/bin/cello-daemon.d.ts.map +1 -0
  7. package/dist/bin/cello-daemon.js +170 -0
  8. package/dist/bin/cello-daemon.js.map +1 -0
  9. package/dist/cello-node-transport-dialer.d.ts +59 -0
  10. package/dist/cello-node-transport-dialer.d.ts.map +1 -0
  11. package/dist/cello-node-transport-dialer.js +108 -0
  12. package/dist/cello-node-transport-dialer.js.map +1 -0
  13. package/dist/challenge-verifier.d.ts +12 -0
  14. package/dist/challenge-verifier.d.ts.map +1 -0
  15. package/dist/challenge-verifier.js +11 -0
  16. package/dist/challenge-verifier.js.map +1 -0
  17. package/dist/connect-or-start.d.ts +25 -0
  18. package/dist/connect-or-start.d.ts.map +1 -0
  19. package/dist/connect-or-start.js +117 -0
  20. package/dist/connect-or-start.js.map +1 -0
  21. package/dist/content-park-client.d.ts +49 -0
  22. package/dist/content-park-client.d.ts.map +1 -0
  23. package/dist/content-park-client.js +196 -0
  24. package/dist/content-park-client.js.map +1 -0
  25. package/dist/daemon.d.ts +65 -0
  26. package/dist/daemon.d.ts.map +1 -0
  27. package/dist/daemon.js +3202 -0
  28. package/dist/daemon.js.map +1 -0
  29. package/dist/directory-bootstrap.d.ts +55 -0
  30. package/dist/directory-bootstrap.d.ts.map +1 -0
  31. package/dist/directory-bootstrap.js +102 -0
  32. package/dist/directory-bootstrap.js.map +1 -0
  33. package/dist/file-manifest-provider.d.ts +18 -0
  34. package/dist/file-manifest-provider.d.ts.map +1 -0
  35. package/dist/file-manifest-provider.js +72 -0
  36. package/dist/file-manifest-provider.js.map +1 -0
  37. package/dist/index.d.ts +18 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +18 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/ipc-client.d.ts +31 -0
  42. package/dist/ipc-client.d.ts.map +1 -0
  43. package/dist/ipc-client.js +112 -0
  44. package/dist/ipc-client.js.map +1 -0
  45. package/dist/ipc-server.d.ts +49 -0
  46. package/dist/ipc-server.d.ts.map +1 -0
  47. package/dist/ipc-server.js +268 -0
  48. package/dist/ipc-server.js.map +1 -0
  49. package/dist/lock-file.d.ts +27 -0
  50. package/dist/lock-file.d.ts.map +1 -0
  51. package/dist/lock-file.js +84 -0
  52. package/dist/lock-file.js.map +1 -0
  53. package/dist/manifest-loader.d.ts +33 -0
  54. package/dist/manifest-loader.d.ts.map +1 -0
  55. package/dist/manifest-loader.js +70 -0
  56. package/dist/manifest-loader.js.map +1 -0
  57. package/dist/manifest-poll-scheduler.d.ts +31 -0
  58. package/dist/manifest-poll-scheduler.d.ts.map +1 -0
  59. package/dist/manifest-poll-scheduler.js +59 -0
  60. package/dist/manifest-poll-scheduler.js.map +1 -0
  61. package/dist/manifest-version-store-file.d.ts +18 -0
  62. package/dist/manifest-version-store-file.d.ts.map +1 -0
  63. package/dist/manifest-version-store-file.js +40 -0
  64. package/dist/manifest-version-store-file.js.map +1 -0
  65. package/dist/manifest-version-store.d.ts +14 -0
  66. package/dist/manifest-version-store.d.ts.map +1 -0
  67. package/dist/manifest-version-store.js +13 -0
  68. package/dist/manifest-version-store.js.map +1 -0
  69. package/dist/network-directory-node.d.ts +94 -0
  70. package/dist/network-directory-node.d.ts.map +1 -0
  71. package/dist/network-directory-node.js +626 -0
  72. package/dist/network-directory-node.js.map +1 -0
  73. package/dist/nonce-dedup.d.ts +68 -0
  74. package/dist/nonce-dedup.d.ts.map +1 -0
  75. package/dist/nonce-dedup.js +204 -0
  76. package/dist/nonce-dedup.js.map +1 -0
  77. package/dist/notification-dispatcher.d.ts +65 -0
  78. package/dist/notification-dispatcher.d.ts.map +1 -0
  79. package/dist/notification-dispatcher.js +138 -0
  80. package/dist/notification-dispatcher.js.map +1 -0
  81. package/dist/registration-context.d.ts +69 -0
  82. package/dist/registration-context.d.ts.map +1 -0
  83. package/dist/registration-context.js +118 -0
  84. package/dist/registration-context.js.map +1 -0
  85. package/dist/registration-manager.d.ts +72 -0
  86. package/dist/registration-manager.d.ts.map +1 -0
  87. package/dist/registration-manager.js +267 -0
  88. package/dist/registration-manager.js.map +1 -0
  89. package/dist/registration-persistence.d.ts +131 -0
  90. package/dist/registration-persistence.d.ts.map +1 -0
  91. package/dist/registration-persistence.js +233 -0
  92. package/dist/registration-persistence.js.map +1 -0
  93. package/dist/retry-queue.d.ts +144 -0
  94. package/dist/retry-queue.d.ts.map +1 -0
  95. package/dist/retry-queue.js +444 -0
  96. package/dist/retry-queue.js.map +1 -0
  97. package/dist/seal-frontier-verify.d.ts +58 -0
  98. package/dist/seal-frontier-verify.d.ts.map +1 -0
  99. package/dist/seal-frontier-verify.js +87 -0
  100. package/dist/seal-frontier-verify.js.map +1 -0
  101. package/dist/seal-legibility-tbs.d.ts +25 -0
  102. package/dist/seal-legibility-tbs.d.ts.map +1 -0
  103. package/dist/seal-legibility-tbs.js +78 -0
  104. package/dist/seal-legibility-tbs.js.map +1 -0
  105. package/dist/seal-upgrade.d.ts +90 -0
  106. package/dist/seal-upgrade.d.ts.map +1 -0
  107. package/dist/seal-upgrade.js +178 -0
  108. package/dist/seal-upgrade.js.map +1 -0
  109. package/dist/session-assignment-parser.d.ts +22 -0
  110. package/dist/session-assignment-parser.d.ts.map +1 -0
  111. package/dist/session-assignment-parser.js +139 -0
  112. package/dist/session-assignment-parser.js.map +1 -0
  113. package/dist/session-ceremony.d.ts +156 -0
  114. package/dist/session-ceremony.d.ts.map +1 -0
  115. package/dist/session-ceremony.js +447 -0
  116. package/dist/session-ceremony.js.map +1 -0
  117. package/dist/session-connection-gater.d.ts +91 -0
  118. package/dist/session-connection-gater.d.ts.map +1 -0
  119. package/dist/session-connection-gater.js +146 -0
  120. package/dist/session-connection-gater.js.map +1 -0
  121. package/dist/session-node-manager.d.ts +585 -0
  122. package/dist/session-node-manager.d.ts.map +1 -0
  123. package/dist/session-node-manager.js +2609 -0
  124. package/dist/session-node-manager.js.map +1 -0
  125. package/dist/session-relay-client.d.ts +101 -0
  126. package/dist/session-relay-client.d.ts.map +1 -0
  127. package/dist/session-relay-client.js +520 -0
  128. package/dist/session-relay-client.js.map +1 -0
  129. package/dist/session-tree.d.ts +80 -0
  130. package/dist/session-tree.d.ts.map +1 -0
  131. package/dist/session-tree.js +123 -0
  132. package/dist/session-tree.js.map +1 -0
  133. package/dist/signaling-connect.d.ts +83 -0
  134. package/dist/signaling-connect.d.ts.map +1 -0
  135. package/dist/signaling-connect.js +266 -0
  136. package/dist/signaling-connect.js.map +1 -0
  137. package/dist/transcript-cipher.d.ts +31 -0
  138. package/dist/transcript-cipher.d.ts.map +1 -0
  139. package/dist/transcript-cipher.js +74 -0
  140. package/dist/transcript-cipher.js.map +1 -0
  141. package/dist/transport-composition.d.ts +31 -0
  142. package/dist/transport-composition.d.ts.map +1 -0
  143. package/dist/transport-composition.js +55 -0
  144. package/dist/transport-composition.js.map +1 -0
  145. package/dist/transport-selector.d.ts +189 -0
  146. package/dist/transport-selector.d.ts.map +1 -0
  147. package/dist/transport-selector.js +195 -0
  148. package/dist/transport-selector.js.map +1 -0
  149. package/dist/types.d.ts +265 -0
  150. package/dist/types.d.ts.map +1 -0
  151. package/dist/types.js +33 -0
  152. package/dist/types.js.map +1 -0
  153. package/package.json +4 -4
@@ -0,0 +1,265 @@
1
+ /**
2
+ * CELLO Daemon IPC Types
3
+ *
4
+ * IPC framing: JSON-newline-delimited over Unix domain socket.
5
+ * Requests: {id, method, params}
6
+ * Responses: {id, result} or {id, error: {code, message, guidance}}
7
+ */
8
+ import type { IManifestProvider, IManifestVersionStore, IManifestPollScheduler, IDirectoryChallengeVerifier, ConnectResult, IAutoNatService } from "@cello-protocol/transport";
9
+ import type { TransportDialer, SessionNegotiator } from "./transport-selector.js";
10
+ export type { IManifestProvider, IManifestVersionStore, IManifestPollScheduler, IDirectoryChallengeVerifier, };
11
+ import type { DirectoryEndpoint } from "./signaling-connect.js";
12
+ export interface Logger {
13
+ debug(event: string, context: Record<string, unknown>): void;
14
+ info(event: string, context: Record<string, unknown>): void;
15
+ warn(event: string, context: Record<string, unknown>): void;
16
+ error(event: string, context: Record<string, unknown>): void;
17
+ }
18
+ export interface LockFileContent {
19
+ pid: number;
20
+ socketPath: string;
21
+ version: string;
22
+ }
23
+ export interface IpcRequest {
24
+ id: string;
25
+ method: string;
26
+ params?: Record<string, unknown>;
27
+ }
28
+ export interface IpcResponseOk {
29
+ id: string;
30
+ result: unknown;
31
+ }
32
+ export interface IpcResponseError {
33
+ id: string;
34
+ error: {
35
+ code: string;
36
+ message: string;
37
+ guidance: string;
38
+ };
39
+ }
40
+ export type IpcResponse = IpcResponseOk | IpcResponseError;
41
+ export interface IpcNotification {
42
+ notification: string;
43
+ data?: Record<string, unknown>;
44
+ }
45
+ export type IpcFrame = IpcResponse | IpcNotification;
46
+ /**
47
+ * Sentinel agentName used for the standing receiver node before any agent
48
+ * transitions to Online. The IPC socket opens after initialize() completes,
49
+ * so no agent can call cello_start_agent before the standing receiver exists.
50
+ */
51
+ export declare const STANDING_RECEIVER_AGENT_NAME: "__standing_receiver__";
52
+ export type AgentState = "registered" | "online" | "current" | "load_failed";
53
+ export interface AgentInfo {
54
+ name: string;
55
+ state: AgentState;
56
+ pubkey?: string;
57
+ error?: string;
58
+ }
59
+ export type ConnectionStatus = "verified" | "stale" | "gone" | "unverified";
60
+ export interface ConnectionInfo {
61
+ counterpartyPubkey: string;
62
+ status: ConnectionStatus;
63
+ }
64
+ export type DirectorySignalingState = "connected" | "reconnecting" | "lost";
65
+ export interface DaemonStatusResponse {
66
+ daemon: "running";
67
+ directory_signaling: DirectorySignalingState;
68
+ agents: AgentInfo[];
69
+ connections: ConnectionInfo[];
70
+ /**
71
+ * True when the standing receiver node is listening and ready to accept the
72
+ * next inbound session. Set to true by SessionNodeManager.initialize() during
73
+ * daemon startup (before the IPC socket opens). DAEMON-002 AC-002.
74
+ */
75
+ standing_receiver_ready: boolean;
76
+ /**
77
+ * Total count of retry_queue entries across all sessions.
78
+ * Always present as integer >= 0. DAEMON-003 AC-009.
79
+ */
80
+ retryQueueDepth: number;
81
+ /**
82
+ * M7-SESSION-001 AC-007: interrupted sessions from SQLite.
83
+ * Always present (empty array if none). Never undefined or omitted.
84
+ */
85
+ interrupted_sessions: InterruptedSessionInfo[];
86
+ }
87
+ export interface DaemonConfig {
88
+ celloDir: string;
89
+ socketPath: string;
90
+ lockFilePath: string;
91
+ maxConnections: number;
92
+ version: string;
93
+ logger: Logger;
94
+ /**
95
+ * M7-MANIFEST-002: manifest loading and verification.
96
+ * When provided, startDaemon() calls manifestProvider.loadAndVerify() at startup.
97
+ * When absent, manifest loading is skipped (backward compat for DAEMON-001 tests).
98
+ *
99
+ * Production: requires manifestRootKeys (non-empty array) and manifestThreshold (>= 1).
100
+ * The bundled consortium-manifest.json is NOT shipped in the npm package — operators
101
+ * must supply their own manifest path via FileManifestProvider(path).
102
+ */
103
+ manifestProvider?: IManifestProvider;
104
+ /**
105
+ * M7-MANIFEST-002: officer root keys for manifest signature verification.
106
+ * Required when manifestProvider is provided.
107
+ */
108
+ manifestRootKeys?: readonly string[];
109
+ /**
110
+ * M7-MANIFEST-002: officer threshold for manifest signature verification.
111
+ * Required when manifestProvider is provided.
112
+ */
113
+ manifestThreshold?: number;
114
+ /**
115
+ * M7-MANIFEST-002: version store for monotonicity enforcement.
116
+ * When absent, monotonicity check is skipped.
117
+ */
118
+ manifestVersionStore?: IManifestVersionStore;
119
+ /**
120
+ * M7-MANIFEST-002: poll scheduler for background manifest refresh.
121
+ * When absent, polling is disabled.
122
+ */
123
+ manifestPollScheduler?: IManifestPollScheduler;
124
+ /**
125
+ * M7-MANIFEST-002: challenge verifier for directory step-5 identity proof.
126
+ * When absent, directory challenge verification is skipped.
127
+ */
128
+ challengeVerifier?: IDirectoryChallengeVerifier;
129
+ /**
130
+ * M7-SIGNAL-001: injectable connect function for directory signaling stream.
131
+ * When absent, a stub that always rejects (directory_signaling_not_configured) is used.
132
+ * Production: performs the full 7-step directory handshake.
133
+ *
134
+ * Tests inject a fake signalingConnect directly. Production leaves this undefined
135
+ * and supplies directoryEndpointResolver instead (see below), so startDaemon can
136
+ * build the real connect wired to its own loaded-agent identity.
137
+ */
138
+ signalingConnect?: () => Promise<ConnectResult>;
139
+ /**
140
+ * M7 Keystone (Part 1): resolves the directory endpoint to dial (GET /bootstrap).
141
+ * When signalingConnect is absent and this is present, startDaemon builds the
142
+ * production signalingConnect from this resolver + the daemon's primary agent
143
+ * identity. Ignored when signalingConnect is provided directly.
144
+ */
145
+ directoryEndpointResolver?: () => Promise<DirectoryEndpoint | null>;
146
+ /**
147
+ * CELLO-M7-DAEMON-004: injectable session-node factory for the composition root.
148
+ * When absent, the production factory (real libp2p via createNode) is used.
149
+ * Tests inject a controllable factory to exercise the send/receive/tree path
150
+ * without the real transport stack — the same adapter-injection pattern
151
+ * DAEMON-002 established for ISessionNodeFactory.
152
+ */
153
+ sessionNodeFactory?: import("./session-node-manager.js").ISessionNodeFactory;
154
+ /**
155
+ * CELLO-M7-MSG-001 (AC-004/AC-005): park target for the startup flush of un-acked
156
+ * content. On startup — BEFORE the IPC socket opens — the daemon drains retry_queue
157
+ * entries still awaiting a `persisted` delivery ACK and re-parks each to the relay
158
+ * store-and-forward queue via this function (the crash backstop, D-d). The function
159
+ * performs the encrypted relay deposit and is the natural emitter of
160
+ * content.park.deposited (it holds the recipient context).
161
+ *
162
+ * Re-home (Option A): this is supplied by the daemon's OWN send path — the daemon
163
+ * owns the session core, so it constructs the relay-deposit function natively (NOT a
164
+ * hosted CelloClient / RelayStreamManager). When absent (a daemon started without the
165
+ * content send path, or unit tests), the startup flush is a documented no-op
166
+ * (content.park.flush.deferred at WARN) and the durable awaiting entries remain queued
167
+ * for the next startup that has a park target.
168
+ */
169
+ contentParkFn?: import("./retry-queue.js").ParkFn;
170
+ /**
171
+ * CELLO-M7-MSG-001 (AC-001/AC-003): the TTF (time-to-flush) window, in ms, the
172
+ * sender waits for a `persisted` delivery ACK before handing un-acked content to the
173
+ * park backstop. Default 20_000 (Part-4 proposed 10–30s band). Tests inject a small
174
+ * value to drive TTF expiry deterministically.
175
+ */
176
+ contentTtfMs?: number;
177
+ /**
178
+ * CELLO-M7-TRANSPORT-001: low-level dialer backing the transport selector in
179
+ * production environments (dev/staging/production). Wraps a CelloNode (direct +
180
+ * relay circuit dial) and the daemon relay registry. Required for production
181
+ * CELLO_ENV; for 'local'/'test' the composition root uses an in-process stub.
182
+ */
183
+ transportDialer?: TransportDialer;
184
+ /**
185
+ * CELLO-M7-TRANSPORT-001: AutoNAT service adapter backing dialability detection
186
+ * in production environments. Wraps the standing-receiver node's libp2p AutoNAT
187
+ * observable. For 'local'/'test' the composition root uses a stub (dialable=false).
188
+ */
189
+ autoNatService?: IAutoNatService;
190
+ /**
191
+ * CELLO-M7-TRANSPORT-001: directory session negotiation adapter (WIRE-001/
192
+ * SIGNAL-001). cello_initiate_session calls negotiate() to obtain the
193
+ * FROST-signed SessionAssignment, then drives the transport selector to dial the
194
+ * counterparty (AC-005/AC-006/AC-008/AC-010c). When absent, cello_initiate_session
195
+ * reports directory_signaling_not_configured — it does NOT crash, proving the
196
+ * transport adapters are wired.
197
+ */
198
+ sessionNegotiator?: SessionNegotiator;
199
+ /**
200
+ * CELLO-M7-TRANSPORT-001: returns this daemon's relay circuit address (from the
201
+ * relay registry populated at directory connection) for the SessionAssignment
202
+ * advertised address when the standing receiver is NOT dialable (AC-004). When
203
+ * absent, an empty advertised relay address is used (the negotiator supplies the
204
+ * real one in production).
205
+ */
206
+ getRelayCircuitAddress?: () => string;
207
+ }
208
+ /**
209
+ * Maximum number of concurrent session nodes per daemon.
210
+ * Outline.md §Resource Caps, DAEMON-002 AC-006.
211
+ */
212
+ export declare const MAX_SESSION_NODES = 32;
213
+ /**
214
+ * Status of a session persisted in SQLite.
215
+ *
216
+ * - active: live session with a transport node.
217
+ * - interrupted: relay/daemon detected the session was cut short; eligible for
218
+ * the operator-initiated seal-interrupted bilateral flow.
219
+ * - seal_interrupted_pending: both parties have produced and exchanged signed
220
+ * SEAL-INTERRUPTED leaves (a verified bilateral commitment), but the FROST
221
+ * threshold notarization has NOT been performed. This is a non-terminal state
222
+ * — it is explicitly NOT 'sealed'. See daemon.ts handleSealInterruptedFlow and
223
+ * the H-1 audit note for what blocks the threshold seal.
224
+ * - sealed: a real FROST threshold notarization completed. Only the normal
225
+ * (non-interrupted) close path produces this today.
226
+ */
227
+ export type SessionStatus = "active" | "sealed" | "interrupted" | "seal_interrupted_pending";
228
+ export interface SessionRecord {
229
+ session_id: string;
230
+ agent_name: string;
231
+ counterparty_pubkey: string;
232
+ status: SessionStatus;
233
+ created_at: number;
234
+ updated_at: number;
235
+ /** M7-SESSION-001: leaf count at interruption. 0 if not yet set. */
236
+ message_count: number;
237
+ /** M7-SESSION-001: ISO 8601 timestamp of interruption. Null if not yet set. */
238
+ interrupted_at: string | null;
239
+ /**
240
+ * M7 legibility-TBS-binding: the counterparty's FROST primary (group) pubkey hex, from the
241
+ * SessionAssignment's signer_pubkey. The responder verifies the bilateral seal signature against
242
+ * it. Null when this party initiated (it verifies against its own primary).
243
+ */
244
+ counterparty_primary_pubkey?: string | null;
245
+ }
246
+ /** M7-SESSION-001: An interrupted session entry in the cello status response. */
247
+ export interface InterruptedSessionInfo {
248
+ sessionId: string;
249
+ agentName: string;
250
+ counterpartyPubkey: string;
251
+ messageCount: number;
252
+ interruptedAt: string;
253
+ }
254
+ export declare const ErrorCodes: {
255
+ readonly DAEMON_LOCK_STALE_REMOVED: "daemon_lock_stale_removed";
256
+ readonly DAEMON_SOCKET_BIND_FAILED: "daemon_socket_bind_failed";
257
+ readonly AGENT_LOAD_FAILED: "agent_load_failed";
258
+ readonly IPC_CONNECTION_LIMIT: "ipc_connection_limit";
259
+ readonly CONNECTION_VALIDATION_TIMEOUT: "connection_validation_timeout";
260
+ readonly DIRECTORY_UNREACHABLE_AT_LOGIN: "directory_unreachable_at_login";
261
+ readonly MAX_SESSIONS_REACHED: "max_sessions_reached";
262
+ readonly SESSION_NODE_CREATION_FAILED: "session_node_creation_failed";
263
+ readonly STANDING_RECEIVER_UNAVAILABLE: "standing_receiver_unavailable";
264
+ };
265
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,aAAa,EACb,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGlF,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,GAC5B,CAAC;AAGF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC9D;AAID,MA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Unix domain socket.
5
+ * Requests: {id, method, params}
6
+ * Responses: {id, result} or {id, error: {code, message, guidance}}
7
+ */
8
+ // --- Session node sentinel ---
9
+ /**
10
+ * Sentinel agentName used for the standing receiver node before any agent
11
+ * transitions to Online. The IPC socket opens after initialize() completes,
12
+ * so no agent can call cello_start_agent before the standing receiver exists.
13
+ */
14
+ export const STANDING_RECEIVER_AGENT_NAME = "__standing_receiver__";
15
+ // --- Session node types ---
16
+ /**
17
+ * Maximum number of concurrent session nodes per daemon.
18
+ * Outline.md §Resource Caps, DAEMON-002 AC-006.
19
+ */
20
+ export const MAX_SESSION_NODES = 32;
21
+ // --- Error codes ---
22
+ export const ErrorCodes = {
23
+ DAEMON_LOCK_STALE_REMOVED: "daemon_lock_stale_removed",
24
+ DAEMON_SOCKET_BIND_FAILED: "daemon_socket_bind_failed",
25
+ AGENT_LOAD_FAILED: "agent_load_failed",
26
+ IPC_CONNECTION_LIMIT: "ipc_connection_limit",
27
+ CONNECTION_VALIDATION_TIMEOUT: "connection_validation_timeout",
28
+ DIRECTORY_UNREACHABLE_AT_LOGIN: "directory_unreachable_at_login",
29
+ MAX_SESSIONS_REACHED: "max_sessions_reached",
30
+ SESSION_NODE_CREATION_FAILED: "session_node_creation_failed",
31
+ STANDING_RECEIVER_UNAVAILABLE: "standing_receiver_unavailable",
32
+ };
33
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyEH,gCAAgC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,uBAAgC,CAAC;AA6K7E,6BAA6B;AAE7B;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAkDpC,sBAAsB;AAEtB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,yBAAyB,EAAE,2BAA2B;IACtD,yBAAyB,EAAE,2BAA2B;IACtD,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,sBAAsB;IAC5C,6BAA6B,EAAE,+BAA+B;IAC9D,8BAA8B,EAAE,gCAAgC;IAChE,oBAAoB,EAAE,sBAAsB;IAC5C,4BAA4B,EAAE,8BAA8B;IAC5D,6BAA6B,EAAE,+BAA+B;CACtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/daemon",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -29,9 +29,9 @@
29
29
  "@libp2p/interface": "^3.0.0",
30
30
  "cbor-x": "^1.6.0",
31
31
  "it-length-prefixed": "^10.0.1",
32
- "@cello-protocol/crypto": "0.0.8",
33
- "@cello-protocol/transport": "0.0.5",
34
- "@cello-protocol/protocol-types": "0.0.5"
32
+ "@cello-protocol/crypto": "0.0.9",
33
+ "@cello-protocol/protocol-types": "0.0.6",
34
+ "@cello-protocol/transport": "0.0.6"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^25.6.2",