@stacknet/rackutils 0.1.0 → 0.3.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/components/index.cjs +6 -6
- package/dist/components/index.js +6 -6
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +107 -3
- package/dist/hooks/index.d.ts +107 -3
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/types/index.d.cts +181 -1
- package/dist/types/index.d.ts +181 -1
- package/package.json +1 -1
package/dist/types/index.d.cts
CHANGED
|
@@ -44,6 +44,10 @@ interface RackConfig {
|
|
|
44
44
|
ownerMid?: string;
|
|
45
45
|
/** Author MID for write operations */
|
|
46
46
|
authorMid?: string;
|
|
47
|
+
/** StackNet API key (gk_ or sk_ prefixed) for authenticated operations */
|
|
48
|
+
apiKey?: string;
|
|
49
|
+
/** Direct StackNet API URL (for registration/billing — bypasses proxy) */
|
|
50
|
+
stacknetUrl?: string;
|
|
47
51
|
}
|
|
48
52
|
interface InitResult {
|
|
49
53
|
success: boolean;
|
|
@@ -58,5 +62,181 @@ interface PushResult {
|
|
|
58
62
|
tree_cid: string;
|
|
59
63
|
manifest_cid?: string;
|
|
60
64
|
}
|
|
65
|
+
interface RackSession {
|
|
66
|
+
authenticated: boolean;
|
|
67
|
+
userId?: string;
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
permission?: 'read' | 'write';
|
|
70
|
+
}
|
|
71
|
+
interface TokenBudget {
|
|
72
|
+
planAllocation: number;
|
|
73
|
+
inferenceUsed: number;
|
|
74
|
+
ledgerSpent: number;
|
|
75
|
+
totalUsed: number;
|
|
76
|
+
remaining: number;
|
|
77
|
+
percent: number;
|
|
78
|
+
exceeded: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface SkillMeta {
|
|
81
|
+
skill_id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
creator: string;
|
|
85
|
+
stack_id?: string;
|
|
86
|
+
content_type?: string;
|
|
87
|
+
category?: string;
|
|
88
|
+
tags?: string[];
|
|
89
|
+
version?: string;
|
|
90
|
+
published_at?: string;
|
|
91
|
+
lode?: {
|
|
92
|
+
schema?: string;
|
|
93
|
+
schema_version?: number;
|
|
94
|
+
fingerprint: string;
|
|
95
|
+
vein_binary?: string;
|
|
96
|
+
vein_bytes?: number;
|
|
97
|
+
};
|
|
98
|
+
registration?: {
|
|
99
|
+
total_bytes: number;
|
|
100
|
+
base_tokens: number;
|
|
101
|
+
multiplier: number;
|
|
102
|
+
registration_cost_tokens: number;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
interface SkillStats {
|
|
106
|
+
meta: SkillMeta | null;
|
|
107
|
+
tokenCount: number | null;
|
|
108
|
+
usageCount: number | null;
|
|
109
|
+
}
|
|
110
|
+
interface TensorMeta {
|
|
111
|
+
tensor_id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
description?: string;
|
|
114
|
+
creator: string;
|
|
115
|
+
content_type?: string;
|
|
116
|
+
category?: string;
|
|
117
|
+
tags?: string[];
|
|
118
|
+
version?: string;
|
|
119
|
+
base_model?: string;
|
|
120
|
+
format?: string;
|
|
121
|
+
tensor_filename?: string;
|
|
122
|
+
tensor_size_bytes?: number;
|
|
123
|
+
tensor_size_mb?: number;
|
|
124
|
+
example_filename?: string;
|
|
125
|
+
training?: {
|
|
126
|
+
steps?: number;
|
|
127
|
+
epochs?: number;
|
|
128
|
+
learning_rate?: string;
|
|
129
|
+
batch_size?: number;
|
|
130
|
+
optimizer?: string;
|
|
131
|
+
};
|
|
132
|
+
trigger_words?: string[];
|
|
133
|
+
published_at?: string;
|
|
134
|
+
lode?: {
|
|
135
|
+
fingerprint: string;
|
|
136
|
+
};
|
|
137
|
+
registration?: {
|
|
138
|
+
total_bytes: number;
|
|
139
|
+
total_megabytes: number;
|
|
140
|
+
multiplier: number;
|
|
141
|
+
registration_cost_tokens: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
interface TensorStats {
|
|
145
|
+
meta: TensorMeta | null;
|
|
146
|
+
sizeMB: number | null;
|
|
147
|
+
}
|
|
148
|
+
interface SkillRegistrationInput {
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
skill_md: string;
|
|
152
|
+
content_type?: string;
|
|
153
|
+
category?: string;
|
|
154
|
+
tags?: string[];
|
|
155
|
+
version?: string;
|
|
156
|
+
scripts?: string;
|
|
157
|
+
stack_id?: string;
|
|
158
|
+
}
|
|
159
|
+
interface SkillRegistrationResult {
|
|
160
|
+
skill_id: string;
|
|
161
|
+
rack_repo_id: string | null;
|
|
162
|
+
rack_pinned: boolean;
|
|
163
|
+
attributed_to: string;
|
|
164
|
+
registration_cost_tokens: number | null;
|
|
165
|
+
lode_fingerprint: string | null;
|
|
166
|
+
}
|
|
167
|
+
interface TensorRegistrationInput {
|
|
168
|
+
name: string;
|
|
169
|
+
description?: string;
|
|
170
|
+
tensor_filename: string;
|
|
171
|
+
tensor_data?: string;
|
|
172
|
+
tensor_hash?: string;
|
|
173
|
+
tensor_size_bytes?: number;
|
|
174
|
+
example_data?: string;
|
|
175
|
+
example_filename?: string;
|
|
176
|
+
example_files?: Array<{
|
|
177
|
+
path: string;
|
|
178
|
+
content: string;
|
|
179
|
+
}>;
|
|
180
|
+
content_type?: string;
|
|
181
|
+
category?: string;
|
|
182
|
+
tags?: string[];
|
|
183
|
+
version?: string;
|
|
184
|
+
base_model?: string;
|
|
185
|
+
format?: string;
|
|
186
|
+
training?: {
|
|
187
|
+
steps?: number;
|
|
188
|
+
epochs?: number;
|
|
189
|
+
learning_rate?: string;
|
|
190
|
+
batch_size?: number;
|
|
191
|
+
optimizer?: string;
|
|
192
|
+
};
|
|
193
|
+
trigger_words?: string[];
|
|
194
|
+
}
|
|
195
|
+
interface TensorRegistrationResult {
|
|
196
|
+
tensor_id: string;
|
|
197
|
+
rack_repo_id: string | null;
|
|
198
|
+
rack_pinned: boolean;
|
|
199
|
+
attributed_to: string;
|
|
200
|
+
registration_cost_tokens: number | null;
|
|
201
|
+
tensor_size_mb: number | null;
|
|
202
|
+
lode_fingerprint: string | null;
|
|
203
|
+
}
|
|
204
|
+
interface StarResult {
|
|
205
|
+
success: boolean;
|
|
206
|
+
starred: boolean;
|
|
207
|
+
stars: number;
|
|
208
|
+
cost: number;
|
|
209
|
+
transaction_id?: string;
|
|
210
|
+
}
|
|
211
|
+
interface StarInfo {
|
|
212
|
+
stars: number;
|
|
213
|
+
starred: boolean;
|
|
214
|
+
repo_id: string;
|
|
215
|
+
}
|
|
216
|
+
interface NetworkStats {
|
|
217
|
+
repos: number;
|
|
218
|
+
skills: number;
|
|
219
|
+
tensors: number;
|
|
220
|
+
stacks: number;
|
|
221
|
+
agents: number;
|
|
222
|
+
stars: number;
|
|
223
|
+
usages: number;
|
|
224
|
+
registration_tokens: number;
|
|
225
|
+
inference_tokens: number;
|
|
226
|
+
total_tokens: number;
|
|
227
|
+
}
|
|
228
|
+
interface TrendingRepo extends RepoInfo {
|
|
229
|
+
stars: number;
|
|
230
|
+
usage: number;
|
|
231
|
+
score: number;
|
|
232
|
+
}
|
|
233
|
+
interface CostEstimate {
|
|
234
|
+
type: 'skill' | 'tensor';
|
|
235
|
+
totalBytes: number;
|
|
236
|
+
totalMegabytes: number;
|
|
237
|
+
baseCost: number;
|
|
238
|
+
multiplier: number;
|
|
239
|
+
registrationCostTokens: number;
|
|
240
|
+
}
|
|
61
241
|
|
|
62
|
-
export type { DiffEntry, InitResult, PushResult, RackConfig, RepoCommit, RepoFile, RepoInfo, RepoTree, TreeEntry };
|
|
242
|
+
export type { CostEstimate, DiffEntry, InitResult, NetworkStats, PushResult, RackConfig, RackSession, RepoCommit, RepoFile, RepoInfo, RepoTree, SkillMeta, SkillRegistrationInput, SkillRegistrationResult, SkillStats, StarInfo, StarResult, TensorMeta, TensorRegistrationInput, TensorRegistrationResult, TensorStats, TokenBudget, TreeEntry, TrendingRepo };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,6 +44,10 @@ interface RackConfig {
|
|
|
44
44
|
ownerMid?: string;
|
|
45
45
|
/** Author MID for write operations */
|
|
46
46
|
authorMid?: string;
|
|
47
|
+
/** StackNet API key (gk_ or sk_ prefixed) for authenticated operations */
|
|
48
|
+
apiKey?: string;
|
|
49
|
+
/** Direct StackNet API URL (for registration/billing — bypasses proxy) */
|
|
50
|
+
stacknetUrl?: string;
|
|
47
51
|
}
|
|
48
52
|
interface InitResult {
|
|
49
53
|
success: boolean;
|
|
@@ -58,5 +62,181 @@ interface PushResult {
|
|
|
58
62
|
tree_cid: string;
|
|
59
63
|
manifest_cid?: string;
|
|
60
64
|
}
|
|
65
|
+
interface RackSession {
|
|
66
|
+
authenticated: boolean;
|
|
67
|
+
userId?: string;
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
permission?: 'read' | 'write';
|
|
70
|
+
}
|
|
71
|
+
interface TokenBudget {
|
|
72
|
+
planAllocation: number;
|
|
73
|
+
inferenceUsed: number;
|
|
74
|
+
ledgerSpent: number;
|
|
75
|
+
totalUsed: number;
|
|
76
|
+
remaining: number;
|
|
77
|
+
percent: number;
|
|
78
|
+
exceeded: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface SkillMeta {
|
|
81
|
+
skill_id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
creator: string;
|
|
85
|
+
stack_id?: string;
|
|
86
|
+
content_type?: string;
|
|
87
|
+
category?: string;
|
|
88
|
+
tags?: string[];
|
|
89
|
+
version?: string;
|
|
90
|
+
published_at?: string;
|
|
91
|
+
lode?: {
|
|
92
|
+
schema?: string;
|
|
93
|
+
schema_version?: number;
|
|
94
|
+
fingerprint: string;
|
|
95
|
+
vein_binary?: string;
|
|
96
|
+
vein_bytes?: number;
|
|
97
|
+
};
|
|
98
|
+
registration?: {
|
|
99
|
+
total_bytes: number;
|
|
100
|
+
base_tokens: number;
|
|
101
|
+
multiplier: number;
|
|
102
|
+
registration_cost_tokens: number;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
interface SkillStats {
|
|
106
|
+
meta: SkillMeta | null;
|
|
107
|
+
tokenCount: number | null;
|
|
108
|
+
usageCount: number | null;
|
|
109
|
+
}
|
|
110
|
+
interface TensorMeta {
|
|
111
|
+
tensor_id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
description?: string;
|
|
114
|
+
creator: string;
|
|
115
|
+
content_type?: string;
|
|
116
|
+
category?: string;
|
|
117
|
+
tags?: string[];
|
|
118
|
+
version?: string;
|
|
119
|
+
base_model?: string;
|
|
120
|
+
format?: string;
|
|
121
|
+
tensor_filename?: string;
|
|
122
|
+
tensor_size_bytes?: number;
|
|
123
|
+
tensor_size_mb?: number;
|
|
124
|
+
example_filename?: string;
|
|
125
|
+
training?: {
|
|
126
|
+
steps?: number;
|
|
127
|
+
epochs?: number;
|
|
128
|
+
learning_rate?: string;
|
|
129
|
+
batch_size?: number;
|
|
130
|
+
optimizer?: string;
|
|
131
|
+
};
|
|
132
|
+
trigger_words?: string[];
|
|
133
|
+
published_at?: string;
|
|
134
|
+
lode?: {
|
|
135
|
+
fingerprint: string;
|
|
136
|
+
};
|
|
137
|
+
registration?: {
|
|
138
|
+
total_bytes: number;
|
|
139
|
+
total_megabytes: number;
|
|
140
|
+
multiplier: number;
|
|
141
|
+
registration_cost_tokens: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
interface TensorStats {
|
|
145
|
+
meta: TensorMeta | null;
|
|
146
|
+
sizeMB: number | null;
|
|
147
|
+
}
|
|
148
|
+
interface SkillRegistrationInput {
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
skill_md: string;
|
|
152
|
+
content_type?: string;
|
|
153
|
+
category?: string;
|
|
154
|
+
tags?: string[];
|
|
155
|
+
version?: string;
|
|
156
|
+
scripts?: string;
|
|
157
|
+
stack_id?: string;
|
|
158
|
+
}
|
|
159
|
+
interface SkillRegistrationResult {
|
|
160
|
+
skill_id: string;
|
|
161
|
+
rack_repo_id: string | null;
|
|
162
|
+
rack_pinned: boolean;
|
|
163
|
+
attributed_to: string;
|
|
164
|
+
registration_cost_tokens: number | null;
|
|
165
|
+
lode_fingerprint: string | null;
|
|
166
|
+
}
|
|
167
|
+
interface TensorRegistrationInput {
|
|
168
|
+
name: string;
|
|
169
|
+
description?: string;
|
|
170
|
+
tensor_filename: string;
|
|
171
|
+
tensor_data?: string;
|
|
172
|
+
tensor_hash?: string;
|
|
173
|
+
tensor_size_bytes?: number;
|
|
174
|
+
example_data?: string;
|
|
175
|
+
example_filename?: string;
|
|
176
|
+
example_files?: Array<{
|
|
177
|
+
path: string;
|
|
178
|
+
content: string;
|
|
179
|
+
}>;
|
|
180
|
+
content_type?: string;
|
|
181
|
+
category?: string;
|
|
182
|
+
tags?: string[];
|
|
183
|
+
version?: string;
|
|
184
|
+
base_model?: string;
|
|
185
|
+
format?: string;
|
|
186
|
+
training?: {
|
|
187
|
+
steps?: number;
|
|
188
|
+
epochs?: number;
|
|
189
|
+
learning_rate?: string;
|
|
190
|
+
batch_size?: number;
|
|
191
|
+
optimizer?: string;
|
|
192
|
+
};
|
|
193
|
+
trigger_words?: string[];
|
|
194
|
+
}
|
|
195
|
+
interface TensorRegistrationResult {
|
|
196
|
+
tensor_id: string;
|
|
197
|
+
rack_repo_id: string | null;
|
|
198
|
+
rack_pinned: boolean;
|
|
199
|
+
attributed_to: string;
|
|
200
|
+
registration_cost_tokens: number | null;
|
|
201
|
+
tensor_size_mb: number | null;
|
|
202
|
+
lode_fingerprint: string | null;
|
|
203
|
+
}
|
|
204
|
+
interface StarResult {
|
|
205
|
+
success: boolean;
|
|
206
|
+
starred: boolean;
|
|
207
|
+
stars: number;
|
|
208
|
+
cost: number;
|
|
209
|
+
transaction_id?: string;
|
|
210
|
+
}
|
|
211
|
+
interface StarInfo {
|
|
212
|
+
stars: number;
|
|
213
|
+
starred: boolean;
|
|
214
|
+
repo_id: string;
|
|
215
|
+
}
|
|
216
|
+
interface NetworkStats {
|
|
217
|
+
repos: number;
|
|
218
|
+
skills: number;
|
|
219
|
+
tensors: number;
|
|
220
|
+
stacks: number;
|
|
221
|
+
agents: number;
|
|
222
|
+
stars: number;
|
|
223
|
+
usages: number;
|
|
224
|
+
registration_tokens: number;
|
|
225
|
+
inference_tokens: number;
|
|
226
|
+
total_tokens: number;
|
|
227
|
+
}
|
|
228
|
+
interface TrendingRepo extends RepoInfo {
|
|
229
|
+
stars: number;
|
|
230
|
+
usage: number;
|
|
231
|
+
score: number;
|
|
232
|
+
}
|
|
233
|
+
interface CostEstimate {
|
|
234
|
+
type: 'skill' | 'tensor';
|
|
235
|
+
totalBytes: number;
|
|
236
|
+
totalMegabytes: number;
|
|
237
|
+
baseCost: number;
|
|
238
|
+
multiplier: number;
|
|
239
|
+
registrationCostTokens: number;
|
|
240
|
+
}
|
|
61
241
|
|
|
62
|
-
export type { DiffEntry, InitResult, PushResult, RackConfig, RepoCommit, RepoFile, RepoInfo, RepoTree, TreeEntry };
|
|
242
|
+
export type { CostEstimate, DiffEntry, InitResult, NetworkStats, PushResult, RackConfig, RackSession, RepoCommit, RepoFile, RepoInfo, RepoTree, SkillMeta, SkillRegistrationInput, SkillRegistrationResult, SkillStats, StarInfo, StarResult, TensorMeta, TensorRegistrationInput, TensorRegistrationResult, TensorStats, TokenBudget, TreeEntry, TrendingRepo };
|