@stacknet/rackutils 0.2.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.
@@ -63,31 +63,88 @@ interface PushResult {
63
63
  manifest_cid?: string;
64
64
  }
65
65
  interface RackSession {
66
- /** Whether the session is authenticated */
67
66
  authenticated: boolean;
68
- /** Resolved user global ID (from API key) */
69
67
  userId?: string;
70
- /** API key in use */
71
68
  apiKey?: string;
72
- /** Permission level */
73
69
  permission?: 'read' | 'write';
74
70
  }
75
71
  interface TokenBudget {
76
- /** Plan allocation in tokens */
77
72
  planAllocation: number;
78
- /** Inference tokens used */
79
73
  inferenceUsed: number;
80
- /** Ledger debits (skill/tensor registration, etc.) */
81
74
  ledgerSpent: number;
82
- /** Total used */
83
75
  totalUsed: number;
84
- /** Remaining tokens */
85
76
  remaining: number;
86
- /** Usage percentage */
87
77
  percent: number;
88
- /** Whether the plan limit is exceeded */
89
78
  exceeded: boolean;
90
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
+ }
91
148
  interface SkillRegistrationInput {
92
149
  name: string;
93
150
  description?: string;
@@ -111,16 +168,11 @@ interface TensorRegistrationInput {
111
168
  name: string;
112
169
  description?: string;
113
170
  tensor_filename: string;
114
- /** Base64-encoded tensor data (for small files) */
115
171
  tensor_data?: string;
116
- /** SHA-256 hash of tensor file (for large files — reference mode) */
117
172
  tensor_hash?: string;
118
- /** Size of tensor file in bytes (for large files — reference mode) */
119
173
  tensor_size_bytes?: number;
120
- /** Base64-encoded example media */
121
174
  example_data?: string;
122
175
  example_filename?: string;
123
- /** Text-based example files (e.g. prompts.md) */
124
176
  example_files?: Array<{
125
177
  path: string;
126
178
  content: string;
@@ -161,19 +213,30 @@ interface StarInfo {
161
213
  starred: boolean;
162
214
  repo_id: string;
163
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
+ }
164
233
  interface CostEstimate {
165
- /** Type of registration */
166
234
  type: 'skill' | 'tensor';
167
- /** Total bytes of content */
168
235
  totalBytes: number;
169
- /** Total megabytes (for tensors) */
170
236
  totalMegabytes: number;
171
- /** Base cost before multiplier */
172
237
  baseCost: number;
173
- /** Multiplier applied */
174
238
  multiplier: number;
175
- /** Final registration cost in tokens */
176
239
  registrationCostTokens: number;
177
240
  }
178
241
 
179
- export type { CostEstimate, DiffEntry, InitResult, PushResult, RackConfig, RackSession, RepoCommit, RepoFile, RepoInfo, RepoTree, SkillRegistrationInput, SkillRegistrationResult, StarInfo, StarResult, TensorRegistrationInput, TensorRegistrationResult, TokenBudget, 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacknet/rackutils",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "React hooks and components for reading and writing StackNet Racks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",