@stacknet/stacks 0.2.0 → 0.2.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 (63) hide show
  1. package/README.md +136 -0
  2. package/dist/{billing-eQZIWeNW.d.cts → billing-cj0eSVrp.d.cts} +59 -1
  3. package/dist/{billing-eQZIWeNW.d.ts → billing-cj0eSVrp.d.ts} +59 -1
  4. package/dist/clients/index.cjs +4 -4
  5. package/dist/clients/index.d.cts +24 -1
  6. package/dist/clients/index.d.ts +24 -1
  7. package/dist/clients/index.js +4 -4
  8. package/dist/index.cjs +7 -7
  9. package/dist/index.d.cts +3 -3
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +7 -7
  12. package/dist/proxy/index.cjs +2 -2
  13. package/dist/proxy/index.js +2 -2
  14. package/dist/streaming/index.cjs +5 -5
  15. package/dist/streaming/index.js +5 -5
  16. package/dist/types/index.d.cts +1 -1
  17. package/dist/types/index.d.ts +1 -1
  18. package/package.json +15 -13
  19. package/src/clients/agents.ts +0 -250
  20. package/src/clients/billing.ts +0 -197
  21. package/src/clients/coder.ts +0 -655
  22. package/src/clients/files.ts +0 -86
  23. package/src/clients/index.ts +0 -93
  24. package/src/clients/magma.ts +0 -299
  25. package/src/clients/mcp.ts +0 -208
  26. package/src/clients/network.ts +0 -118
  27. package/src/clients/points.ts +0 -403
  28. package/src/clients/skills.ts +0 -236
  29. package/src/clients/social.ts +0 -286
  30. package/src/clients/stack-management.ts +0 -279
  31. package/src/clients/task-network.ts +0 -303
  32. package/src/clients/user.ts +0 -84
  33. package/src/clients/widgets.ts +0 -171
  34. package/src/index.ts +0 -387
  35. package/src/managers/index.ts +0 -10
  36. package/src/managers/task-manager.ts +0 -332
  37. package/src/proxy/forwarder.ts +0 -235
  38. package/src/proxy/index.ts +0 -32
  39. package/src/proxy/route-handlers.ts +0 -1107
  40. package/src/streaming/component-stream.ts +0 -319
  41. package/src/streaming/index.ts +0 -21
  42. package/src/streaming/sse.ts +0 -266
  43. package/src/types/agent.ts +0 -108
  44. package/src/types/billing.ts +0 -121
  45. package/src/types/chat.ts +0 -58
  46. package/src/types/coder.ts +0 -345
  47. package/src/types/credential.ts +0 -111
  48. package/src/types/file.ts +0 -15
  49. package/src/types/imagination.ts +0 -50
  50. package/src/types/index.ts +0 -20
  51. package/src/types/mcp.ts +0 -35
  52. package/src/types/network.ts +0 -97
  53. package/src/types/points.ts +0 -250
  54. package/src/types/skill.ts +0 -107
  55. package/src/types/social.ts +0 -109
  56. package/src/types/stack.ts +0 -269
  57. package/src/types/task.ts +0 -41
  58. package/src/types/user.ts +0 -29
  59. package/src/types/widget.ts +0 -57
  60. package/src/utils/constants.ts +0 -26
  61. package/src/utils/errors.ts +0 -169
  62. package/src/utils/helpers.ts +0 -85
  63. package/src/utils/index.ts +0 -7
@@ -1,20 +0,0 @@
1
- /**
2
- * @stacknet/stacks - Type definitions
3
- */
4
-
5
- export * from './task';
6
- export * from './chat';
7
- export * from './imagination';
8
- export * from './agent';
9
- export * from './mcp';
10
- export * from './social';
11
- export * from './widget';
12
- export * from './user';
13
- export * from './file';
14
- export * from './skill';
15
- export * from './coder';
16
- export * from './points';
17
- export * from './stack';
18
- export * from './network';
19
- export * from './billing';
20
- export * from './credential';
package/src/types/mcp.ts DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * MCP (Model Context Protocol) type definitions
3
- */
4
-
5
- export interface MCPSessionConfig {
6
- baseUrl?: string;
7
- agentId?: string;
8
- timeout?: number;
9
- }
10
-
11
- export interface MCPSession {
12
- id: string;
13
- agentId: string;
14
- status: 'active' | 'closed' | 'error';
15
- createdAt: Date;
16
- }
17
-
18
- export interface MCPMessage {
19
- role: 'user' | 'assistant';
20
- content: MCPContent;
21
- }
22
-
23
- export interface MCPContent {
24
- type: 'text' | 'image' | 'tool_use' | 'tool_result';
25
- text?: string;
26
- data?: string;
27
- toolName?: string;
28
- toolInput?: Record<string, unknown>;
29
- }
30
-
31
- export interface MCPToolResult {
32
- result: unknown;
33
- data?: Record<string, unknown>;
34
- error?: string;
35
- }
@@ -1,97 +0,0 @@
1
- /**
2
- * Network, consensus, and metrics type definitions
3
- */
4
-
5
- // ============================================================================
6
- // Network
7
- // ============================================================================
8
-
9
- export interface NetworkStatus {
10
- total_nodes: number;
11
- online_nodes: number;
12
- current_leader: string;
13
- consensus_health: 'healthy' | 'degraded' | 'unhealthy';
14
- last_block_time: number;
15
- network_version: string;
16
- consensus?: ConsensusStatus;
17
- }
18
-
19
- export interface MPCNode {
20
- id: string;
21
- name: string;
22
- endpoint: string;
23
- status: 'online' | 'offline' | 'signing' | 'dkg';
24
- public_key_share: string;
25
- keyId?: string;
26
- last_heartbeat: number;
27
- load: number;
28
- version: string;
29
- }
30
-
31
- // ============================================================================
32
- // Consensus (Raft / Octopii)
33
- // ============================================================================
34
-
35
- export interface ConsensusStatus {
36
- enabled: boolean;
37
- node_id?: number;
38
- is_leader?: boolean;
39
- current_leader?: number;
40
- term?: number;
41
- last_log_index?: number;
42
- commit_index?: number;
43
- state_summary?: ConsensusStateSummary;
44
- running?: boolean;
45
- }
46
-
47
- export interface ConsensusStateSummary {
48
- stack_count: number;
49
- session_count: number;
50
- task_count: number;
51
- worker_count: number;
52
- }
53
-
54
- export interface LeaderStatus {
55
- is_leader: boolean;
56
- }
57
-
58
- // ============================================================================
59
- // Auth Metrics
60
- // ============================================================================
61
-
62
- export interface AuthMetrics {
63
- total_global_identities: number;
64
- total_registered_stacks: number;
65
- stack_identities: number;
66
- active_sessions: number;
67
- total_tokens_input: number;
68
- total_tokens_output: number;
69
- total_image_megapixels: number;
70
- total_video_megabytes: number;
71
- total_audio_megabytes: number;
72
- total_input_token_value?: string;
73
- total_output_token_value?: string;
74
- total_token_value?: string;
75
- auth_method_breakdown: {
76
- email: number;
77
- web3_evm: number;
78
- web3_solana: number;
79
- web3_bitcoin: number;
80
- oauth: number;
81
- };
82
- signatures_24h: number;
83
- avg_signing_time_ms: number;
84
- avg_latency_ms: number;
85
- dkg_ceremonies_completed: number;
86
- attestations_issued_24h: number;
87
- attestations_verified_24h: number;
88
- }
89
-
90
- // ============================================================================
91
- // Client Config
92
- // ============================================================================
93
-
94
- export interface NetworkClientConfig {
95
- baseUrl?: string;
96
- authToken?: string;
97
- }
@@ -1,250 +0,0 @@
1
- /**
2
- * Points Types
3
- *
4
- * Types for the Points Coprocessor SDK client.
5
- */
6
-
7
- /**
8
- * Context Domain - namespace for points with authority control
9
- */
10
- export interface ContextDomain {
11
- id: string;
12
- name: string;
13
- description?: string;
14
- authorityAgent: string;
15
- seal: string;
16
- createdAt: number;
17
- metadata?: Record<string, unknown>;
18
- }
19
-
20
- /**
21
- * Point Context - defines what actions/achievements points represent
22
- */
23
- export interface PointContext {
24
- id: string;
25
- domainId: string;
26
- name: string;
27
- description?: string;
28
- unit?: string;
29
- allowNegative: boolean;
30
- createdAt: number;
31
- metadata?: Record<string, unknown>;
32
- }
33
-
34
- /**
35
- * Delegation - authority delegation to sub-agents
36
- */
37
- export interface Delegation {
38
- id: string;
39
- domainId: string;
40
- delegator: string;
41
- delegate: string;
42
- scope: DelegationScope;
43
- validFrom: number;
44
- validUntil: number | null;
45
- revoked: boolean;
46
- revokedAt?: number;
47
- signature: string;
48
- createdAt: number;
49
- }
50
-
51
- export interface DelegationScope {
52
- pointContexts: string[];
53
- maxAmount?: number | null;
54
- canDelegate: boolean;
55
- }
56
-
57
- /**
58
- * Point Record - individual point addition/deduction
59
- */
60
- export interface PointRecord {
61
- id: string;
62
- mid: string;
63
- domainId: string;
64
- contextId: string;
65
- amount: number;
66
- reason?: string;
67
- actionProof: ActionProof;
68
- issuer: string;
69
- delegationChain?: DelegationChainLink[];
70
- signature: string;
71
- createdAt: number;
72
- }
73
-
74
- export interface ActionProof {
75
- taskId?: string;
76
- resultHash?: string;
77
- consensusProof?: string;
78
- failureType?: string;
79
- evidenceHash?: string;
80
- metadata?: Record<string, unknown>;
81
- }
82
-
83
- export interface DelegationChainLink {
84
- delegationId: string;
85
- delegator: string;
86
- delegate: string;
87
- signature: string;
88
- }
89
-
90
- /**
91
- * Point Spend Record
92
- */
93
- export interface PointSpend {
94
- id: string;
95
- mid: string;
96
- domainId: string;
97
- contextId: string;
98
- amount: number;
99
- destination: SpendDestination;
100
- metaproof?: string;
101
- signature: string;
102
- createdAt: number;
103
- }
104
-
105
- export interface SpendDestination {
106
- type: 'settlement' | 'burn';
107
- target?: string;
108
- }
109
-
110
- /**
111
- * Balance response
112
- */
113
- export interface PointBalance {
114
- mid: string;
115
- domain?: string;
116
- total: number;
117
- byContext: Record<string, number>;
118
- }
119
-
120
- // ============================================================================
121
- // Input Types
122
- // ============================================================================
123
-
124
- export interface CreateDomainInput {
125
- name: string;
126
- description?: string;
127
- authorityAgent: string;
128
- metadata?: Record<string, unknown>;
129
- }
130
-
131
- export interface CreateContextInput {
132
- domainId: string;
133
- name: string;
134
- description?: string;
135
- unit?: string;
136
- allowNegative?: boolean;
137
- metadata?: Record<string, unknown>;
138
- }
139
-
140
- export interface CreateDelegationInput {
141
- domainId: string;
142
- delegate: string;
143
- scope: DelegationScope;
144
- validFrom?: number;
145
- validUntil?: number | null;
146
- }
147
-
148
- export interface AddPointsInput {
149
- mid: string;
150
- domainId: string;
151
- contextId: string;
152
- amount: number;
153
- reason?: string;
154
- actionProof: ActionProof;
155
- delegationChain?: DelegationChainLink[];
156
- }
157
-
158
- export interface SpendPointsInput {
159
- mid: string;
160
- domainId: string;
161
- contextId: string;
162
- amount: number;
163
- destination: SpendDestination;
164
- }
165
-
166
- export interface HistoryFilters {
167
- mid?: string;
168
- domainId?: string;
169
- contextId?: string;
170
- periodStart?: number;
171
- periodEnd?: number;
172
- taskId?: string;
173
- limit?: number;
174
- offset?: number;
175
- }
176
-
177
- export interface DelegationFilters {
178
- domainId?: string;
179
- delegator?: string;
180
- delegate?: string;
181
- activeOnly?: boolean;
182
- }
183
-
184
- // ============================================================================
185
- // Response Types
186
- // ============================================================================
187
-
188
- export interface DomainsListResponse {
189
- domains: ContextDomain[];
190
- }
191
-
192
- export interface DomainResponse {
193
- domain: ContextDomain;
194
- paymentRequired?: boolean;
195
- }
196
-
197
- export interface ContextsListResponse {
198
- contexts: PointContext[];
199
- }
200
-
201
- export interface ContextResponse {
202
- context: PointContext;
203
- paymentRequired?: boolean;
204
- }
205
-
206
- export interface DelegationsListResponse {
207
- delegations: Delegation[];
208
- }
209
-
210
- export interface DelegationResponse {
211
- delegation: Delegation;
212
- }
213
-
214
- export interface PointRecordResponse {
215
- record: PointRecord;
216
- }
217
-
218
- export interface PointSpendResponse {
219
- spend: PointSpend;
220
- metaproof?: string;
221
- }
222
-
223
- export interface HistoryResponse {
224
- records: PointRecord[];
225
- total: number;
226
- }
227
-
228
- export interface InitNetworkResponse {
229
- domain: ContextDomain;
230
- contexts: PointContext[];
231
- }
232
-
233
- export interface PaymentRequiredResponse {
234
- error: string;
235
- paymentRequired: true;
236
- paymentDetails: {
237
- type: string;
238
- amount: number;
239
- currency: string;
240
- recipient: string;
241
- };
242
- }
243
-
244
- // ============================================================================
245
- // Client Config
246
- // ============================================================================
247
-
248
- export interface PointsClientConfig {
249
- baseUrl?: string;
250
- }
@@ -1,107 +0,0 @@
1
- /**
2
- * Skill Types
3
- */
4
-
5
- export interface Skill {
6
- id: string;
7
- name: string;
8
- description: string;
9
- creator_mid: string;
10
- skill_md: string;
11
- skill_hash: string | null; // SHA-256 hash for verifiability
12
- scripts: { name: string; content: string }[] | null;
13
- references: { name: string; content: string }[] | null;
14
- assets: { name: string; url: string }[] | null;
15
- tags: string[];
16
- version: string;
17
- is_public: boolean;
18
- usage_count: number;
19
- created_at: number;
20
- updated_at: number;
21
- }
22
-
23
- export interface SkillVerifyResponse {
24
- valid: boolean;
25
- expected?: string;
26
- actual?: string;
27
- }
28
-
29
- export interface SkillsListResponse {
30
- skills: Skill[];
31
- }
32
-
33
- export interface SkillResponse {
34
- skill?: Skill;
35
- skill_id?: string;
36
- success?: boolean;
37
- error?: string;
38
- }
39
-
40
- export interface SkillCreateInput {
41
- name: string;
42
- description?: string;
43
- skill_md: string;
44
- scripts?: { name: string; content: string }[] | null;
45
- references?: { name: string; content: string }[] | null;
46
- assets?: { name: string; url: string }[] | null;
47
- tags?: string[];
48
- version?: string;
49
- is_public?: boolean;
50
- creator_mid?: string;
51
- }
52
-
53
- export interface SkillUpdateInput {
54
- name?: string;
55
- description?: string;
56
- skill_md?: string;
57
- scripts?: { name: string; content: string }[] | null;
58
- references?: { name: string; content: string }[] | null;
59
- assets?: { name: string; url: string }[] | null;
60
- tags?: string[];
61
- version?: string;
62
- is_public?: boolean;
63
- }
64
-
65
- export interface SkillsClientConfig {
66
- baseUrl?: string;
67
- /**
68
- * Use the coprocessor API (/cpx/agent/skills) instead of legacy (/skills).
69
- * Defaults to true. Set to false for backwards compatibility.
70
- */
71
- useCpxApi?: boolean;
72
- }
73
-
74
- export interface SkillVerifyResponse {
75
- valid: boolean;
76
- expected?: string;
77
- actual?: string;
78
- }
79
-
80
- export interface SkillMapResponse {
81
- version: number;
82
- generated_at: number;
83
- skills: Array<{
84
- id: string;
85
- name: string;
86
- description: string;
87
- content_type: string;
88
- category: string | null;
89
- usage_count: number;
90
- is_precompiled: boolean;
91
- skill_hash: string | null;
92
- }>;
93
- }
94
-
95
- export interface SkillMapPromptResponse {
96
- prompt: string;
97
- }
98
-
99
- export interface SkillSummaryResponse {
100
- summary: string;
101
- skills: Array<{
102
- id: string;
103
- name: string;
104
- description: string;
105
- keywords: string[];
106
- }>;
107
- }
@@ -1,109 +0,0 @@
1
- /**
2
- * Social Network Types
3
- */
4
-
5
- export interface SocialAuthor {
6
- mid: string;
7
- username: string;
8
- avatar_url: string | null;
9
- bio?: string | null;
10
- }
11
-
12
- export type MediaType = 'image' | 'video' | 'audio' | 'animation';
13
-
14
- export type Orientation = 'portrait' | 'landscape';
15
-
16
- export interface SocialPost {
17
- id: string;
18
- creator_mid: string;
19
- content: string;
20
- media_url: string;
21
- media_type: MediaType;
22
- orientation?: Orientation;
23
- poster_url?: string;
24
- created_at: number;
25
- likes_count: number;
26
- comments_count: number;
27
- views_count: number;
28
- plays_count?: number;
29
- remix_of?: string;
30
- author: SocialAuthor;
31
- }
32
-
33
- export interface SocialComment {
34
- id: string;
35
- author_mid: string;
36
- content: string;
37
- created_at: number;
38
- author: SocialAuthor;
39
- }
40
-
41
- export interface SocialRemix {
42
- id: string;
43
- creator_mid: string;
44
- content: string;
45
- media_url: string;
46
- poster_url?: string;
47
- created_at: number;
48
- author: SocialAuthor;
49
- }
50
-
51
- export interface FeedResponse {
52
- posts: SocialPost[];
53
- hasMore: boolean;
54
- page: number;
55
- total?: number;
56
- }
57
-
58
- export interface PostResponse {
59
- post: SocialPost;
60
- }
61
-
62
- export interface CommentsResponse {
63
- comments: SocialComment[];
64
- }
65
-
66
- export interface RemixesResponse {
67
- remixes: SocialRemix[];
68
- }
69
-
70
- export interface LikeCheckResponse {
71
- liked: boolean;
72
- }
73
-
74
- export interface LikeResponse {
75
- success: boolean;
76
- likes_count?: number;
77
- }
78
-
79
- export interface CommentResponse {
80
- success: boolean;
81
- comment?: SocialComment;
82
- }
83
-
84
- export interface CreatePostInput {
85
- creatorMid: string;
86
- content: string;
87
- mediaUrl: string;
88
- mediaType: MediaType;
89
- orientation?: Orientation;
90
- posterUrl?: string;
91
- remixOf?: string;
92
- }
93
-
94
- export interface CreatePostResponse {
95
- success: boolean;
96
- post?: SocialPost;
97
- id?: string;
98
- }
99
-
100
- export interface ProfileResponse {
101
- mid: string;
102
- username: string;
103
- avatar_url: string | null;
104
- bio?: string | null;
105
- }
106
-
107
- export interface SocialClientConfig {
108
- baseUrl?: string;
109
- }