@hivemind-os/collective-daemon 0.2.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.
- package/dist/chunk-57QD6553.js +803 -0
- package/dist/chunk-57QD6553.js.map +1 -0
- package/dist/chunk-BHN4GOYD.js +1196 -0
- package/dist/chunk-BHN4GOYD.js.map +1 -0
- package/dist/chunk-BJW47ZD5.js +341 -0
- package/dist/chunk-BJW47ZD5.js.map +1 -0
- package/dist/chunk-CJHYQ7RR.js +656 -0
- package/dist/chunk-CJHYQ7RR.js.map +1 -0
- package/dist/chunk-NXIFS427.js +183 -0
- package/dist/chunk-NXIFS427.js.map +1 -0
- package/dist/chunk-Q3V4V7UR.js +305 -0
- package/dist/chunk-Q3V4V7UR.js.map +1 -0
- package/dist/chunk-VHECO532.js +1005 -0
- package/dist/chunk-VHECO532.js.map +1 -0
- package/dist/config-SuloXL2_.d.ts +90 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +19 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +523 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc/server.d.ts +69 -0
- package/dist/ipc/server.js +8 -0
- package/dist/ipc/server.js.map +1 -0
- package/dist/portal/server.d.ts +72 -0
- package/dist/portal/server.js +10 -0
- package/dist/portal/server.js.map +1 -0
- package/dist/provider/index.d.ts +202 -0
- package/dist/provider/index.js +22 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/relay/index.d.ts +55 -0
- package/dist/relay/index.js +7 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/session-monitor-P9hNAFw4.d.ts +16 -0
- package/dist/state.d.ts +59 -0
- package/dist/state.js +11 -0
- package/dist/state.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AuthProvider, ZkLoginPendingSession, StoredZkLoginSession, OAuthConfig } from '@hivemind-os/collective-core';
|
|
2
|
+
import { D as DaemonFullConfig } from '../config-SuloXL2_.js';
|
|
3
|
+
import { D as DaemonAuthStatus } from '../session-monitor-P9hNAFw4.js';
|
|
4
|
+
import { DaemonState } from '../state.js';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import '@hivemind-os/collective-types';
|
|
7
|
+
import '@mysten/sui/cryptography';
|
|
8
|
+
import '@mysten/sui/keypairs/ed25519';
|
|
9
|
+
|
|
10
|
+
interface PortalAuthProvider extends AuthProvider {
|
|
11
|
+
createAuthorizationRequest(params: {
|
|
12
|
+
redirectUri: string;
|
|
13
|
+
state: string;
|
|
14
|
+
codeChallenge: string;
|
|
15
|
+
scopes?: string[];
|
|
16
|
+
}): Promise<{
|
|
17
|
+
authorizationUrl: string;
|
|
18
|
+
pendingSession: ZkLoginPendingSession;
|
|
19
|
+
}>;
|
|
20
|
+
exchangeAuthorizationCode(code: string, codeVerifier: string, redirectUri: string): Promise<{
|
|
21
|
+
jwt: string;
|
|
22
|
+
refreshToken?: string;
|
|
23
|
+
}>;
|
|
24
|
+
authenticateWithJwt(jwt: string, params: {
|
|
25
|
+
pendingSession: ZkLoginPendingSession;
|
|
26
|
+
refreshToken?: string;
|
|
27
|
+
}): Promise<StoredZkLoginSession>;
|
|
28
|
+
getSession(): StoredZkLoginSession | null;
|
|
29
|
+
getOAuthConfig(): OAuthConfig;
|
|
30
|
+
setOAuthConfig(oauth: OAuthConfig): void;
|
|
31
|
+
}
|
|
32
|
+
interface PortalLogger {
|
|
33
|
+
info(bindings: Record<string, unknown>, message: string): void;
|
|
34
|
+
warn(bindings: Record<string, unknown>, message: string): void;
|
|
35
|
+
}
|
|
36
|
+
interface PortalServerOptions {
|
|
37
|
+
config: DaemonFullConfig;
|
|
38
|
+
configPath: string;
|
|
39
|
+
authProvider: PortalAuthProvider;
|
|
40
|
+
state?: DaemonState;
|
|
41
|
+
logger?: PortalLogger;
|
|
42
|
+
getAuthStatus?: () => DaemonAuthStatus | null;
|
|
43
|
+
onAuthenticated?: (session: StoredZkLoginSession) => Promise<void> | void;
|
|
44
|
+
onSettingsSaved?: (config: DaemonFullConfig) => Promise<void> | void;
|
|
45
|
+
}
|
|
46
|
+
declare class PortalServer {
|
|
47
|
+
private readonly options;
|
|
48
|
+
private readonly server;
|
|
49
|
+
private readonly pendingAuth;
|
|
50
|
+
private baseUrl;
|
|
51
|
+
private setupComplete;
|
|
52
|
+
private completionPromise;
|
|
53
|
+
private resolveCompletion;
|
|
54
|
+
constructor(options: PortalServerOptions);
|
|
55
|
+
start(): Promise<string>;
|
|
56
|
+
stop(): Promise<void>;
|
|
57
|
+
waitForAuth(): Promise<void>;
|
|
58
|
+
getUrl(): string;
|
|
59
|
+
getReauthUrl(): string;
|
|
60
|
+
private registerRoutes;
|
|
61
|
+
private startAuthFlow;
|
|
62
|
+
private handleOAuthCallback;
|
|
63
|
+
private authenticateGoogleCallback;
|
|
64
|
+
private authenticateAppleCallback;
|
|
65
|
+
private pruneExpiredPendingAuth;
|
|
66
|
+
private setActiveOAuthConfig;
|
|
67
|
+
private getRedirectUri;
|
|
68
|
+
private getAuthStatus;
|
|
69
|
+
private renderPage;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { type PortalAuthProvider, type PortalLogger, PortalServer, type PortalServerOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { CreateMessageRequest, CreateMessageResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { D as DaemonFullConfig } from '../config-SuloXL2_.js';
|
|
3
|
+
import { RelayClientConfig, RelayClient } from '../relay/index.js';
|
|
4
|
+
import { DaemonState } from '../state.js';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import '@hivemind-os/collective-types';
|
|
7
|
+
import '@hivemind-os/collective-core';
|
|
8
|
+
import '@hivemind-os/collective-relay';
|
|
9
|
+
import '@mysten/sui/cryptography';
|
|
10
|
+
import '@mysten/sui/keypairs/ed25519';
|
|
11
|
+
|
|
12
|
+
interface ExecutionAdapter {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
execute(params: {
|
|
15
|
+
taskId: string;
|
|
16
|
+
capability: string;
|
|
17
|
+
inputData: Uint8Array;
|
|
18
|
+
metadata?: Record<string, string>;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
resultData: Uint8Array;
|
|
21
|
+
metadata?: Record<string, string>;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class EchoAdapter implements ExecutionAdapter {
|
|
26
|
+
readonly name = "echo";
|
|
27
|
+
execute(params: {
|
|
28
|
+
taskId: string;
|
|
29
|
+
capability: string;
|
|
30
|
+
inputData: Uint8Array;
|
|
31
|
+
metadata?: Record<string, string>;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
resultData: Uint8Array;
|
|
34
|
+
metadata?: Record<string, string>;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type LocalFunction = (input: Uint8Array, metadata?: Record<string, string>) => Promise<Uint8Array>;
|
|
39
|
+
declare class LocalFunctionAdapter implements ExecutionAdapter {
|
|
40
|
+
private readonly fn;
|
|
41
|
+
readonly name = "local-function";
|
|
42
|
+
constructor(fn: LocalFunction);
|
|
43
|
+
execute(params: {
|
|
44
|
+
taskId: string;
|
|
45
|
+
capability: string;
|
|
46
|
+
inputData: Uint8Array;
|
|
47
|
+
metadata?: Record<string, string>;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
resultData: Uint8Array;
|
|
50
|
+
metadata?: Record<string, string>;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Narrow interface for MCP sampling. The provider runtime supplies an implementation
|
|
56
|
+
* that looks up the correct connected MCP client and sends the sampling request.
|
|
57
|
+
* This avoids exposing the full MCP Server to adapter code.
|
|
58
|
+
*/
|
|
59
|
+
type McpSamplingFn = (appName: string, params: CreateMessageRequest['params']) => Promise<CreateMessageResult>;
|
|
60
|
+
interface McpSamplingAdapterConfig {
|
|
61
|
+
appName: string;
|
|
62
|
+
systemPrompt: string;
|
|
63
|
+
maxTokens?: number;
|
|
64
|
+
modelHint?: string;
|
|
65
|
+
}
|
|
66
|
+
declare class McpSamplingAdapter implements ExecutionAdapter {
|
|
67
|
+
private readonly sample;
|
|
68
|
+
readonly name = "mcp-sampling";
|
|
69
|
+
private readonly appName;
|
|
70
|
+
private readonly systemPrompt;
|
|
71
|
+
private readonly maxTokens;
|
|
72
|
+
private readonly modelHint;
|
|
73
|
+
constructor(config: McpSamplingAdapterConfig, sample: McpSamplingFn);
|
|
74
|
+
execute(params: {
|
|
75
|
+
taskId: string;
|
|
76
|
+
capability: string;
|
|
77
|
+
inputData: Uint8Array;
|
|
78
|
+
metadata?: Record<string, string>;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
resultData: Uint8Array;
|
|
81
|
+
metadata?: Record<string, string>;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface SubprocessAdapterConfig {
|
|
86
|
+
command: string;
|
|
87
|
+
args?: string[];
|
|
88
|
+
cwd?: string;
|
|
89
|
+
env?: Record<string, string>;
|
|
90
|
+
timeoutMs?: number;
|
|
91
|
+
maxOutputBytes?: number;
|
|
92
|
+
}
|
|
93
|
+
declare class SubprocessAdapter implements ExecutionAdapter {
|
|
94
|
+
readonly name = "subprocess";
|
|
95
|
+
private readonly command;
|
|
96
|
+
private readonly args;
|
|
97
|
+
private readonly cwd;
|
|
98
|
+
private readonly env;
|
|
99
|
+
private readonly timeoutMs;
|
|
100
|
+
private readonly maxOutputBytes;
|
|
101
|
+
constructor(config: SubprocessAdapterConfig);
|
|
102
|
+
execute(params: {
|
|
103
|
+
taskId: string;
|
|
104
|
+
capability: string;
|
|
105
|
+
inputData: Uint8Array;
|
|
106
|
+
metadata?: Record<string, string>;
|
|
107
|
+
}): Promise<{
|
|
108
|
+
resultData: Uint8Array;
|
|
109
|
+
metadata?: Record<string, string>;
|
|
110
|
+
}>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface WebhookAdapterConfig {
|
|
114
|
+
url: string;
|
|
115
|
+
method?: string;
|
|
116
|
+
headers?: Record<string, string>;
|
|
117
|
+
timeoutMs?: number;
|
|
118
|
+
maxResponseBytes?: number;
|
|
119
|
+
}
|
|
120
|
+
declare class WebhookAdapter implements ExecutionAdapter {
|
|
121
|
+
readonly name = "webhook";
|
|
122
|
+
private readonly url;
|
|
123
|
+
private readonly method;
|
|
124
|
+
private readonly headers;
|
|
125
|
+
private readonly timeoutMs;
|
|
126
|
+
private readonly maxResponseBytes;
|
|
127
|
+
constructor(config: WebhookAdapterConfig);
|
|
128
|
+
execute(params: {
|
|
129
|
+
taskId: string;
|
|
130
|
+
capability: string;
|
|
131
|
+
inputData: Uint8Array;
|
|
132
|
+
metadata?: Record<string, string>;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
resultData: Uint8Array;
|
|
135
|
+
metadata?: Record<string, string>;
|
|
136
|
+
}>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface ProviderCapabilityConfig {
|
|
140
|
+
name: string;
|
|
141
|
+
description: string;
|
|
142
|
+
version: string;
|
|
143
|
+
priceMist: number;
|
|
144
|
+
currency?: string;
|
|
145
|
+
adapter: string;
|
|
146
|
+
adapterConfig?: Record<string, unknown>;
|
|
147
|
+
}
|
|
148
|
+
interface ProviderConfig {
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
capabilities: ProviderCapabilityConfig[];
|
|
151
|
+
maxConcurrency: number;
|
|
152
|
+
autoRegister: boolean;
|
|
153
|
+
}
|
|
154
|
+
declare function loadProviderConfig(config: DaemonFullConfig): ProviderConfig | null;
|
|
155
|
+
|
|
156
|
+
declare class ProviderRuntime {
|
|
157
|
+
private readonly params;
|
|
158
|
+
private subscription?;
|
|
159
|
+
private cursorStore?;
|
|
160
|
+
private readonly taskQueue;
|
|
161
|
+
private readonly adapters;
|
|
162
|
+
private readonly capabilityConfigs;
|
|
163
|
+
private readonly relayClients;
|
|
164
|
+
private registeredCapabilities;
|
|
165
|
+
private chainOperations;
|
|
166
|
+
private ownAgentCardId?;
|
|
167
|
+
constructor(params: {
|
|
168
|
+
state: DaemonState;
|
|
169
|
+
providerConfig: ProviderConfig;
|
|
170
|
+
cursorDbPath: string;
|
|
171
|
+
relayConfig?: DaemonFullConfig['relay'];
|
|
172
|
+
relayClientFactory?: (config: RelayClientConfig, identity: DaemonState['relayAuthProvider']) => RelayClient;
|
|
173
|
+
mcpSamplingFn?: McpSamplingFn;
|
|
174
|
+
broadcastNotification?: (method: string, params?: unknown) => void;
|
|
175
|
+
});
|
|
176
|
+
start(): Promise<void>;
|
|
177
|
+
stop(): Promise<void>;
|
|
178
|
+
private connectRelays;
|
|
179
|
+
private handleRawEvent;
|
|
180
|
+
private handleTaskPosted;
|
|
181
|
+
private processTask;
|
|
182
|
+
private executeLocalTask;
|
|
183
|
+
private runChainOperation;
|
|
184
|
+
private initializeAdapters;
|
|
185
|
+
private registerAgentCard;
|
|
186
|
+
private resolveOwnAgentCardId;
|
|
187
|
+
private get hasRelaySupport();
|
|
188
|
+
private get relayMetadata();
|
|
189
|
+
private get registrationEndpoint();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare class TaskQueue {
|
|
193
|
+
private readonly maxConcurrency;
|
|
194
|
+
private readonly running;
|
|
195
|
+
constructor(maxConcurrency?: number);
|
|
196
|
+
enqueue(taskId: string, work: () => Promise<void>): Promise<boolean>;
|
|
197
|
+
get activeCount(): number;
|
|
198
|
+
get isFull(): boolean;
|
|
199
|
+
drain(): Promise<void>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { EchoAdapter, type ExecutionAdapter, type LocalFunction, LocalFunctionAdapter, McpSamplingAdapter, type McpSamplingAdapterConfig, type McpSamplingFn, type ProviderCapabilityConfig, type ProviderConfig, ProviderRuntime, SubprocessAdapter, type SubprocessAdapterConfig, TaskQueue, WebhookAdapter, type WebhookAdapterConfig, loadProviderConfig };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EchoAdapter,
|
|
3
|
+
LocalFunctionAdapter,
|
|
4
|
+
McpSamplingAdapter,
|
|
5
|
+
ProviderRuntime,
|
|
6
|
+
SubprocessAdapter,
|
|
7
|
+
TaskQueue,
|
|
8
|
+
WebhookAdapter,
|
|
9
|
+
loadProviderConfig
|
|
10
|
+
} from "../chunk-57QD6553.js";
|
|
11
|
+
import "../chunk-BJW47ZD5.js";
|
|
12
|
+
export {
|
|
13
|
+
EchoAdapter,
|
|
14
|
+
LocalFunctionAdapter,
|
|
15
|
+
McpSamplingAdapter,
|
|
16
|
+
ProviderRuntime,
|
|
17
|
+
SubprocessAdapter,
|
|
18
|
+
TaskQueue,
|
|
19
|
+
WebhookAdapter,
|
|
20
|
+
loadProviderConfig
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AuthProvider } from '@hivemind-os/collective-core';
|
|
2
|
+
import { TaskRequest, TaskResponse } from '@hivemind-os/collective-relay';
|
|
3
|
+
|
|
4
|
+
interface RelayClientConfig {
|
|
5
|
+
relayUrl: string;
|
|
6
|
+
relayDid?: string;
|
|
7
|
+
reconnectIntervalMs?: number;
|
|
8
|
+
heartbeatIntervalMs?: number;
|
|
9
|
+
}
|
|
10
|
+
declare class RelayClient {
|
|
11
|
+
private readonly config;
|
|
12
|
+
private readonly identity;
|
|
13
|
+
private ws;
|
|
14
|
+
private reconnectTimer?;
|
|
15
|
+
private heartbeatTimer?;
|
|
16
|
+
private heartbeatAckTimer?;
|
|
17
|
+
private pendingConnection;
|
|
18
|
+
private taskHandler?;
|
|
19
|
+
private registeredCapabilities;
|
|
20
|
+
private reconnectAttempt;
|
|
21
|
+
private outboundSequence;
|
|
22
|
+
private inboundSequence;
|
|
23
|
+
private disconnecting;
|
|
24
|
+
private _sessionId;
|
|
25
|
+
constructor(config: RelayClientConfig, identity: AuthProvider);
|
|
26
|
+
get isConnected(): boolean;
|
|
27
|
+
get sessionId(): string | null;
|
|
28
|
+
connect(capabilities: string[]): Promise<void>;
|
|
29
|
+
disconnect(): Promise<void>;
|
|
30
|
+
onTaskRequest(handler: (request: TaskRequest) => Promise<TaskResponse>): void;
|
|
31
|
+
sendResult(taskId: string, result: unknown): Promise<void>;
|
|
32
|
+
sendProgress(taskId: string, progress: number, message?: string): Promise<void>;
|
|
33
|
+
sendChunk(taskId: string, data: string): Promise<void>;
|
|
34
|
+
sendError(taskId: string, error: {
|
|
35
|
+
code: string;
|
|
36
|
+
message: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
private openConnection;
|
|
39
|
+
private authenticate;
|
|
40
|
+
private handleMessage;
|
|
41
|
+
private handleTaskRequest;
|
|
42
|
+
private sendTaskMessage;
|
|
43
|
+
private nextSequence;
|
|
44
|
+
private startHeartbeat;
|
|
45
|
+
private handleClose;
|
|
46
|
+
private scheduleReconnect;
|
|
47
|
+
private reconnect;
|
|
48
|
+
private resolvePendingConnection;
|
|
49
|
+
private rejectPendingConnection;
|
|
50
|
+
private clearReconnectTimer;
|
|
51
|
+
private clearHeartbeatAckTimer;
|
|
52
|
+
private clearHeartbeatTimers;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { RelayClient, type RelayClientConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthMode } from '@hivemind-os/collective-core';
|
|
2
|
+
|
|
3
|
+
type DaemonAuthState = 'authenticated' | 'expiring' | 'expired' | 'reauth_required';
|
|
4
|
+
interface DaemonAuthStatus {
|
|
5
|
+
authMode: AuthMode;
|
|
6
|
+
authenticated: boolean;
|
|
7
|
+
state: DaemonAuthState;
|
|
8
|
+
address: string | null;
|
|
9
|
+
expiresAt: number | null;
|
|
10
|
+
expiresInMs: number | null;
|
|
11
|
+
refreshAvailable: boolean;
|
|
12
|
+
lastError: string | null;
|
|
13
|
+
updatedAt: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { DaemonAuthStatus as D };
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AuthProvider, MeshSuiClient, RegistryClient, TaskClient, AgentCache, BlobStore, X25519KeyPair, SpendingPolicyEngine, EvmWallet, X402Client, OAuthProvider, OAuthConfig } from '@hivemind-os/collective-core';
|
|
2
|
+
import { DID } from '@hivemind-os/collective-types';
|
|
3
|
+
import { Signer } from '@mysten/sui/cryptography';
|
|
4
|
+
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
5
|
+
import { D as DaemonFullConfig } from './config-SuloXL2_.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
|
|
8
|
+
interface DaemonStatusBase {
|
|
9
|
+
did: DID;
|
|
10
|
+
address: string;
|
|
11
|
+
evmAddress?: string;
|
|
12
|
+
uptime: number;
|
|
13
|
+
spendingToday: string;
|
|
14
|
+
providerRunning: boolean;
|
|
15
|
+
authMode: AuthProvider['mode'];
|
|
16
|
+
authenticated: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface DaemonIdentityContext {
|
|
19
|
+
authProvider: AuthProvider;
|
|
20
|
+
did: DID;
|
|
21
|
+
identityKeypair: Ed25519Keypair;
|
|
22
|
+
identitySecretKey: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
declare class DaemonState {
|
|
25
|
+
readonly keypair: Signer;
|
|
26
|
+
readonly identityKeypair: Ed25519Keypair;
|
|
27
|
+
readonly authProvider: AuthProvider;
|
|
28
|
+
readonly relayAuthProvider: AuthProvider;
|
|
29
|
+
readonly did: DID;
|
|
30
|
+
readonly suiClient: MeshSuiClient;
|
|
31
|
+
readonly registryClient: RegistryClient;
|
|
32
|
+
readonly taskClient: TaskClient;
|
|
33
|
+
readonly agentCache: AgentCache;
|
|
34
|
+
readonly blobStore: BlobStore;
|
|
35
|
+
readonly encryptionKeyPair: X25519KeyPair;
|
|
36
|
+
readonly encryption: {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
requireEncryption: boolean;
|
|
39
|
+
publicKey?: string;
|
|
40
|
+
};
|
|
41
|
+
readonly spendingPolicy: SpendingPolicyEngine;
|
|
42
|
+
readonly evmWallet?: EvmWallet;
|
|
43
|
+
readonly x402Client?: X402Client;
|
|
44
|
+
readonly network: DaemonFullConfig['network'];
|
|
45
|
+
readonly startedAt: number;
|
|
46
|
+
readonly address: string;
|
|
47
|
+
private readonly cursorStore;
|
|
48
|
+
private readonly subscriptions;
|
|
49
|
+
private providerRunning;
|
|
50
|
+
private constructor();
|
|
51
|
+
static create(config: DaemonFullConfig, identityContext?: DaemonIdentityContext): Promise<DaemonState>;
|
|
52
|
+
setProviderRunning(providerRunning: boolean): void;
|
|
53
|
+
getStatusBase(): DaemonStatusBase;
|
|
54
|
+
shutdown(): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
declare function createDaemonIdentityContext(config: DaemonFullConfig): Promise<DaemonIdentityContext>;
|
|
57
|
+
declare function buildOAuthConfig(config: DaemonFullConfig, redirectUri?: string, preferredProvider?: OAuthProvider): OAuthConfig;
|
|
58
|
+
|
|
59
|
+
export { type DaemonIdentityContext, DaemonState, type DaemonStatusBase, buildOAuthConfig, createDaemonIdentityContext };
|
package/dist/state.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hivemind-os/collective-daemon",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./config": {
|
|
13
|
+
"types": "./dist/config.d.ts",
|
|
14
|
+
"import": "./dist/config.js"
|
|
15
|
+
},
|
|
16
|
+
"./state": {
|
|
17
|
+
"types": "./dist/state.d.ts",
|
|
18
|
+
"import": "./dist/state.js"
|
|
19
|
+
},
|
|
20
|
+
"./provider": {
|
|
21
|
+
"types": "./dist/provider/index.d.ts",
|
|
22
|
+
"import": "./dist/provider/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./ipc/server": {
|
|
25
|
+
"types": "./dist/ipc/server.d.ts",
|
|
26
|
+
"import": "./dist/ipc/server.js"
|
|
27
|
+
},
|
|
28
|
+
"./portal/server": {
|
|
29
|
+
"types": "./dist/portal/server.d.ts",
|
|
30
|
+
"import": "./dist/portal/server.js"
|
|
31
|
+
},
|
|
32
|
+
"./relay": {
|
|
33
|
+
"types": "./dist/relay/index.d.ts",
|
|
34
|
+
"import": "./dist/relay/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"bin": {
|
|
41
|
+
"collective-daemon": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@fastify/cors": "^11.2.0",
|
|
45
|
+
"@fastify/static": "^9.1.3",
|
|
46
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
47
|
+
"@mysten/sui": "^1.30.0",
|
|
48
|
+
"fastify": "^5.8.5",
|
|
49
|
+
"js-yaml": "^4.1.0",
|
|
50
|
+
"open": "^11.0.0",
|
|
51
|
+
"pino": "^9.0.0",
|
|
52
|
+
"pino-pretty": "^13.0.0",
|
|
53
|
+
"ws": "^8.0.0",
|
|
54
|
+
"@hivemind-os/collective-core": "0.2.0",
|
|
55
|
+
"@hivemind-os/collective-mcp-server": "0.2.0",
|
|
56
|
+
"@hivemind-os/collective-relay": "0.2.0",
|
|
57
|
+
"@hivemind-os/collective-types": "0.2.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/js-yaml": "^4.0.0",
|
|
61
|
+
"@types/ws": "^8.0.0",
|
|
62
|
+
"tsup": "^8.0.0",
|
|
63
|
+
"typescript": "^5.7.0",
|
|
64
|
+
"vitest": "^3.0.0"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "tsup",
|
|
68
|
+
"test": "vitest",
|
|
69
|
+
"lint": "eslint src/ tests/ vitest.config.ts tsup.config.ts",
|
|
70
|
+
"start": "node dist/index.js"
|
|
71
|
+
}
|
|
72
|
+
}
|