@resourcexjs/core 0.0.2 → 0.1.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/index.d.ts CHANGED
@@ -43,46 +43,109 @@ interface ParsedARP {
43
43
  declare function parseARP(url: string): ParsedARP;
44
44
  /**
45
45
  * Transport Handler Interface
46
- * Responsible for fetching resource content from various sources
46
+ * Responsible for I/O primitives - read, write, list, exists, delete
47
+ * Transport only handles WHERE and HOW to access bytes, not WHAT they mean
48
+ */
49
+ /**
50
+ * Transport capabilities declaration
51
+ */
52
+ interface TransportCapabilities {
53
+ readonly canRead: boolean;
54
+ readonly canWrite: boolean;
55
+ readonly canList: boolean;
56
+ readonly canDelete: boolean;
57
+ readonly canStat: boolean;
58
+ }
59
+ /**
60
+ * Resource stat information
61
+ */
62
+ interface ResourceStat {
63
+ size: number;
64
+ modifiedAt?: Date;
65
+ isDirectory?: boolean;
66
+ }
67
+ /**
68
+ * Transport Handler - provides I/O primitives
47
69
  */
48
70
  interface TransportHandler {
49
71
  /**
50
- * Transport type name (e.g., "https", "file")
72
+ * Transport name (e.g., "https", "file", "s3")
73
+ */
74
+ readonly name: string;
75
+ /**
76
+ * Transport capabilities
51
77
  */
52
- readonly type: string;
78
+ readonly capabilities: TransportCapabilities;
53
79
  /**
54
- * Fetch resource content from the given location
80
+ * Read content from location
55
81
  * @param location - The location string after ://
56
82
  * @returns Raw content as Buffer
57
83
  */
58
- fetch(location: string): Promise<Buffer>;
84
+ read(location: string): Promise<Buffer>;
85
+ /**
86
+ * Write content to location
87
+ * @param location - The location string after ://
88
+ * @param content - Content to write
89
+ */
90
+ write?(location: string, content: Buffer): Promise<void>;
91
+ /**
92
+ * List entries at location (for directory-like transports)
93
+ * @param location - The location string after ://
94
+ * @returns Array of entry names
95
+ */
96
+ list?(location: string): Promise<string[]>;
97
+ /**
98
+ * Create directory at location
99
+ * @param location - The location string after ://
100
+ */
101
+ mkdir?(location: string): Promise<void>;
102
+ /**
103
+ * Check if resource exists at location
104
+ * @param location - The location string after ://
105
+ */
106
+ exists?(location: string): Promise<boolean>;
107
+ /**
108
+ * Get resource stat information
109
+ * @param location - The location string after ://
110
+ */
111
+ stat?(location: string): Promise<ResourceStat>;
112
+ /**
113
+ * Delete resource at location
114
+ * @param location - The location string after ://
115
+ */
116
+ delete?(location: string): Promise<void>;
59
117
  }
60
118
  declare class HttpTransportHandler implements TransportHandler {
61
- readonly type: string;
119
+ readonly name: string;
62
120
  private readonly protocol;
121
+ readonly capabilities: TransportCapabilities;
63
122
  constructor(protocol?: "http" | "https");
64
- fetch(location: string): Promise<Buffer>;
123
+ read(location: string): Promise<Buffer>;
65
124
  }
66
125
  declare const httpsHandler: HttpTransportHandler;
67
126
  declare const httpHandler: HttpTransportHandler;
68
127
  declare class FileTransportHandler implements TransportHandler {
69
- readonly type = "file";
70
- fetch(location: string): Promise<Buffer>;
128
+ readonly name = "file";
129
+ readonly capabilities: TransportCapabilities;
130
+ private resolvePath;
131
+ read(location: string): Promise<Buffer>;
132
+ write(location: string, content: Buffer): Promise<void>;
133
+ list(location: string): Promise<string[]>;
134
+ mkdir(location: string): Promise<void>;
135
+ exists(location: string): Promise<boolean>;
136
+ stat(location: string): Promise<ResourceStat>;
137
+ delete(location: string): Promise<void>;
71
138
  }
72
139
  declare const fileHandler: FileTransportHandler;
73
140
  /**
74
- * Get transport handler by type
141
+ * Get transport handler by name
75
142
  */
76
- declare function getTransportHandler(type: string): TransportHandler;
143
+ declare function getTransportHandler(name: string): TransportHandler;
77
144
  /**
78
145
  * Register a custom transport handler
79
146
  */
80
147
  declare function registerTransportHandler(handler: TransportHandler): void;
81
148
  /**
82
- * Semantic Handler Interface
83
- * Responsible for parsing raw content into AI-usable format
84
- */
85
- /**
86
149
  * Resource metadata
87
150
  */
88
151
  interface ResourceMeta {
@@ -93,17 +156,17 @@ interface ResourceMeta {
93
156
  size: number;
94
157
  encoding?: string;
95
158
  mimeType?: string;
96
- fetchedAt: string;
159
+ resolvedAt: string;
97
160
  }
98
161
  /**
99
162
  * Context passed to semantic handler
100
163
  */
101
- interface ParseContext {
164
+ interface SemanticContext {
102
165
  url: string;
103
166
  semantic: string;
104
167
  transport: string;
105
168
  location: string;
106
- fetchedAt: Date;
169
+ timestamp: Date;
107
170
  }
108
171
  /**
109
172
  * Base resource interface
@@ -115,27 +178,65 @@ interface Resource<T = unknown> {
115
178
  }
116
179
  /**
117
180
  * Semantic handler interface
181
+ * Semantic orchestrates Transport primitives to resolve/deposit resources
118
182
  */
119
183
  interface SemanticHandler<T = unknown> {
120
- readonly type: string;
121
184
  /**
122
- * Parse raw content into structured resource
185
+ * Semantic name (e.g., "text", "json", "package")
186
+ */
187
+ readonly name: string;
188
+ /**
189
+ * Resolve resource from location
190
+ * Semantic controls how to use transport primitives to fetch and parse resource
191
+ *
192
+ * @param transport - Transport handler for I/O operations
193
+ * @param location - Resource location
194
+ * @param context - Semantic context
195
+ */
196
+ resolve(transport: TransportHandler, location: string, context: SemanticContext): Promise<Resource<T>>;
197
+ /**
198
+ * Deposit resource to location
199
+ * Semantic controls how to serialize data and use transport primitives to store
200
+ *
201
+ * @param transport - Transport handler for I/O operations
202
+ * @param location - Resource location
203
+ * @param data - Data to deposit
204
+ * @param context - Semantic context
205
+ */
206
+ deposit?(transport: TransportHandler, location: string, data: T, context: SemanticContext): Promise<void>;
207
+ /**
208
+ * Check if resource exists at location
209
+ *
210
+ * @param transport - Transport handler for I/O operations
211
+ * @param location - Resource location
212
+ * @param context - Semantic context
123
213
  */
124
- parse(content: Buffer, context: ParseContext): Resource<T>;
214
+ exists?(transport: TransportHandler, location: string, context: SemanticContext): Promise<boolean>;
215
+ /**
216
+ * Delete resource at location
217
+ *
218
+ * @param transport - Transport handler for I/O operations
219
+ * @param location - Resource location
220
+ * @param context - Semantic context
221
+ */
222
+ delete?(transport: TransportHandler, location: string, context: SemanticContext): Promise<void>;
125
223
  }
126
224
  interface TextResource extends Resource<string> {
127
225
  type: "text";
128
226
  content: string;
129
227
  }
130
228
  declare class TextSemanticHandler implements SemanticHandler<string> {
131
- readonly type = "text";
132
- parse(content: Buffer, context: ParseContext): TextResource;
229
+ readonly name = "text";
230
+ resolve(transport: TransportHandler, location: string, context: SemanticContext): Promise<TextResource>;
231
+ deposit(transport: TransportHandler, location: string, data: string, _context: SemanticContext): Promise<void>;
232
+ exists(transport: TransportHandler, location: string, _context: SemanticContext): Promise<boolean>;
233
+ delete(transport: TransportHandler, location: string, _context: SemanticContext): Promise<void>;
133
234
  }
134
235
  declare const textHandler: TextSemanticHandler;
135
236
  /**
136
- * Get semantic handler by type
237
+ * Get semantic handler by name
137
238
  */
138
- declare function getSemanticHandler(type: string): SemanticHandler;
239
+ declare function getSemanticHandler(name: string): SemanticHandler;
139
240
  /**
140
241
  * Register a custom semantic handler
141
242
  */
@@ -149,8 +250,25 @@ declare function registerSemanticHandler(handler: SemanticHandler): void;
149
250
  */
150
251
  declare function resolve(url: string): Promise<Resource>;
151
252
  /**
152
- * @resourcexjs/core
153
- * ARP (Agent Resource Protocol) implementation
253
+ * Deposit data to an ARP URL
254
+ *
255
+ * @example
256
+ * await deposit("arp:text:file://./data/config.txt", "hello world");
257
+ */
258
+ declare function deposit(url: string, data: unknown): Promise<void>;
259
+ /**
260
+ * Check if resource exists at ARP URL
261
+ *
262
+ * @example
263
+ * const exists = await resourceExists("arp:text:file://./data/config.txt");
264
+ */
265
+ declare function resourceExists(url: string): Promise<boolean>;
266
+ /**
267
+ * Delete resource at ARP URL
268
+ *
269
+ * @example
270
+ * await resourceDelete("arp:text:file://./data/config.txt");
154
271
  */
155
- declare const VERSION = "0.0.1";
156
- export { textHandler, resolve, registerTransportHandler, registerSemanticHandler, parseARP, httpsHandler, httpHandler, getTransportHandler, getSemanticHandler, fileHandler, VERSION, TransportHandler, TransportError, TextResource, SemanticHandler, SemanticError, ResourceXError, ResourceMeta, Resource, ParsedARP, ParseError, ParseContext };
272
+ declare function resourceDelete(url: string): Promise<void>;
273
+ declare const VERSION: string;
274
+ export { textHandler, resourceExists, resourceDelete, resolve, registerTransportHandler, registerSemanticHandler, parseARP, httpsHandler, httpHandler, getTransportHandler, getSemanticHandler, fileHandler, deposit, VERSION, TransportHandler, TransportError, TransportCapabilities, TextResource, SemanticHandler, SemanticError, SemanticContext, ResourceXError, ResourceStat, ResourceMeta, Resource, ParsedARP, ParseError };
package/dist/index.js CHANGED
@@ -63,18 +63,25 @@ function parseARP(url) {
63
63
  }
64
64
  // src/transport/http.ts
65
65
  class HttpTransportHandler {
66
- type;
66
+ name;
67
67
  protocol;
68
+ capabilities = {
69
+ canRead: true,
70
+ canWrite: false,
71
+ canList: false,
72
+ canDelete: false,
73
+ canStat: false
74
+ };
68
75
  constructor(protocol = "https") {
69
76
  this.protocol = protocol;
70
- this.type = protocol;
77
+ this.name = protocol;
71
78
  }
72
- async fetch(location) {
79
+ async read(location) {
73
80
  const url = `${this.protocol}://${location}`;
74
81
  try {
75
82
  const response = await fetch(url);
76
83
  if (!response.ok) {
77
- throw new TransportError(`HTTP ${response.status}: ${response.statusText} - ${url}`, this.type);
84
+ throw new TransportError(`HTTP ${response.status}: ${response.statusText} - ${url}`, this.name);
78
85
  }
79
86
  const arrayBuffer = await response.arrayBuffer();
80
87
  return Buffer.from(arrayBuffer);
@@ -82,24 +89,106 @@ class HttpTransportHandler {
82
89
  if (error instanceof TransportError) {
83
90
  throw error;
84
91
  }
85
- throw new TransportError(`Network error: ${url}`, this.type, { cause: error });
92
+ throw new TransportError(`Network error: ${url}`, this.name, {
93
+ cause: error
94
+ });
86
95
  }
87
96
  }
88
97
  }
89
98
  var httpsHandler = new HttpTransportHandler("https");
90
99
  var httpHandler = new HttpTransportHandler("http");
91
100
  // src/transport/file.ts
92
- import { readFile } from "node:fs/promises";
93
- import { resolve } from "node:path";
101
+ import { readFile, writeFile, readdir, mkdir, rm, access, stat as fsStat } from "node:fs/promises";
102
+ import { resolve, dirname } from "node:path";
94
103
  class FileTransportHandler {
95
- type = "file";
96
- async fetch(location) {
97
- const filePath = resolve(process.cwd(), location);
104
+ name = "file";
105
+ capabilities = {
106
+ canRead: true,
107
+ canWrite: true,
108
+ canList: true,
109
+ canDelete: true,
110
+ canStat: true
111
+ };
112
+ resolvePath(location) {
113
+ return resolve(process.cwd(), location);
114
+ }
115
+ async read(location) {
116
+ const filePath = this.resolvePath(location);
98
117
  try {
99
118
  return await readFile(filePath);
100
119
  } catch (error) {
101
120
  const err = error;
102
- throw new TransportError(`File read error: ${err.code} - ${filePath}`, this.type, {
121
+ throw new TransportError(`File read error: ${err.code} - ${filePath}`, this.name, {
122
+ cause: err
123
+ });
124
+ }
125
+ }
126
+ async write(location, content) {
127
+ const filePath = this.resolvePath(location);
128
+ try {
129
+ await mkdir(dirname(filePath), { recursive: true });
130
+ await writeFile(filePath, content);
131
+ } catch (error) {
132
+ const err = error;
133
+ throw new TransportError(`File write error: ${err.code} - ${filePath}`, this.name, {
134
+ cause: err
135
+ });
136
+ }
137
+ }
138
+ async list(location) {
139
+ const dirPath = this.resolvePath(location);
140
+ try {
141
+ return await readdir(dirPath);
142
+ } catch (error) {
143
+ const err = error;
144
+ throw new TransportError(`Directory list error: ${err.code} - ${dirPath}`, this.name, {
145
+ cause: err
146
+ });
147
+ }
148
+ }
149
+ async mkdir(location) {
150
+ const dirPath = this.resolvePath(location);
151
+ try {
152
+ await mkdir(dirPath, { recursive: true });
153
+ } catch (error) {
154
+ const err = error;
155
+ throw new TransportError(`Directory create error: ${err.code} - ${dirPath}`, this.name, {
156
+ cause: err
157
+ });
158
+ }
159
+ }
160
+ async exists(location) {
161
+ const filePath = this.resolvePath(location);
162
+ try {
163
+ await access(filePath);
164
+ return true;
165
+ } catch {
166
+ return false;
167
+ }
168
+ }
169
+ async stat(location) {
170
+ const filePath = this.resolvePath(location);
171
+ try {
172
+ const stats = await fsStat(filePath);
173
+ return {
174
+ size: stats.size,
175
+ modifiedAt: stats.mtime,
176
+ isDirectory: stats.isDirectory()
177
+ };
178
+ } catch (error) {
179
+ const err = error;
180
+ throw new TransportError(`File stat error: ${err.code} - ${filePath}`, this.name, {
181
+ cause: err
182
+ });
183
+ }
184
+ }
185
+ async delete(location) {
186
+ const filePath = this.resolvePath(location);
187
+ try {
188
+ await rm(filePath, { recursive: true });
189
+ } catch (error) {
190
+ const err = error;
191
+ throw new TransportError(`File delete error: ${err.code} - ${filePath}`, this.name, {
103
192
  cause: err
104
193
  });
105
194
  }
@@ -112,30 +201,31 @@ var handlers = new Map([
112
201
  ["http", httpHandler],
113
202
  ["file", fileHandler]
114
203
  ]);
115
- function getTransportHandler(type) {
116
- const handler = handlers.get(type);
204
+ function getTransportHandler(name) {
205
+ const handler = handlers.get(name);
117
206
  if (!handler) {
118
- throw new TransportError(`Unsupported transport type: ${type}`, type);
207
+ throw new TransportError(`Unsupported transport type: ${name}`, name);
119
208
  }
120
209
  return handler;
121
210
  }
122
211
  function registerTransportHandler(handler) {
123
- handlers.set(handler.type, handler);
212
+ handlers.set(handler.name, handler);
124
213
  }
125
214
  // src/semantic/text.ts
126
215
  class TextSemanticHandler {
127
- type = "text";
128
- parse(content, context) {
129
- const text = content.toString("utf-8");
216
+ name = "text";
217
+ async resolve(transport, location, context) {
218
+ const buffer = await transport.read(location);
219
+ const text = buffer.toString("utf-8");
130
220
  const meta = {
131
221
  url: context.url,
132
222
  semantic: context.semantic,
133
223
  transport: context.transport,
134
224
  location: context.location,
135
- size: content.length,
225
+ size: buffer.length,
136
226
  encoding: "utf-8",
137
227
  mimeType: "text/plain",
138
- fetchedAt: context.fetchedAt.toISOString()
228
+ resolvedAt: context.timestamp.toISOString()
139
229
  };
140
230
  return {
141
231
  type: "text",
@@ -143,41 +233,109 @@ class TextSemanticHandler {
143
233
  meta
144
234
  };
145
235
  }
236
+ async deposit(transport, location, data, _context) {
237
+ if (!transport.write) {
238
+ throw new SemanticError(`Transport "${transport.name}" does not support write operation`, this.name);
239
+ }
240
+ const buffer = Buffer.from(data, "utf-8");
241
+ await transport.write(location, buffer);
242
+ }
243
+ async exists(transport, location, _context) {
244
+ if (transport.exists) {
245
+ return transport.exists(location);
246
+ }
247
+ try {
248
+ await transport.read(location);
249
+ return true;
250
+ } catch {
251
+ return false;
252
+ }
253
+ }
254
+ async delete(transport, location, _context) {
255
+ if (!transport.delete) {
256
+ throw new SemanticError(`Transport "${transport.name}" does not support delete operation`, this.name);
257
+ }
258
+ await transport.delete(location);
259
+ }
146
260
  }
147
261
  var textHandler = new TextSemanticHandler;
148
262
  // src/semantic/index.ts
149
263
  var handlers2 = new Map([["text", textHandler]]);
150
- function getSemanticHandler(type) {
151
- const handler = handlers2.get(type);
264
+ function getSemanticHandler(name) {
265
+ const handler = handlers2.get(name);
152
266
  if (!handler) {
153
- throw new SemanticError(`Unsupported semantic type: ${type}`, type);
267
+ throw new SemanticError(`Unsupported semantic type: ${name}`, name);
154
268
  }
155
269
  return handler;
156
270
  }
157
271
  function registerSemanticHandler(handler) {
158
- handlers2.set(handler.type, handler);
272
+ handlers2.set(handler.name, handler);
159
273
  }
160
274
  // src/resolve.ts
161
- async function resolve2(url) {
162
- const fetchedAt = new Date;
163
- const parsed = parseARP(url);
164
- const transportHandler = getTransportHandler(parsed.transport);
165
- const semanticHandler = getSemanticHandler(parsed.semantic);
166
- const content = await transportHandler.fetch(parsed.location);
167
- const context = {
275
+ function createContext(url, semantic, transport, location) {
276
+ return {
168
277
  url,
169
- semantic: parsed.semantic,
170
- transport: parsed.transport,
171
- location: parsed.location,
172
- fetchedAt
278
+ semantic,
279
+ transport,
280
+ location,
281
+ timestamp: new Date
173
282
  };
174
- return semanticHandler.parse(content, context);
283
+ }
284
+ async function resolve2(url) {
285
+ const parsed = parseARP(url);
286
+ const transport = getTransportHandler(parsed.transport);
287
+ const semantic = getSemanticHandler(parsed.semantic);
288
+ const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);
289
+ return semantic.resolve(transport, parsed.location, context);
290
+ }
291
+ async function deposit(url, data) {
292
+ const parsed = parseARP(url);
293
+ const transport = getTransportHandler(parsed.transport);
294
+ const semantic = getSemanticHandler(parsed.semantic);
295
+ if (!semantic.deposit) {
296
+ throw new SemanticError(`Semantic "${semantic.name}" does not support deposit operation`, parsed.semantic);
297
+ }
298
+ const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);
299
+ await semantic.deposit(transport, parsed.location, data, context);
300
+ }
301
+ async function resourceExists(url) {
302
+ const parsed = parseARP(url);
303
+ const transport = getTransportHandler(parsed.transport);
304
+ const semantic = getSemanticHandler(parsed.semantic);
305
+ const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);
306
+ if (semantic.exists) {
307
+ return semantic.exists(transport, parsed.location, context);
308
+ }
309
+ if (transport.exists) {
310
+ return transport.exists(parsed.location);
311
+ }
312
+ try {
313
+ await transport.read(parsed.location);
314
+ return true;
315
+ } catch {
316
+ return false;
317
+ }
318
+ }
319
+ async function resourceDelete(url) {
320
+ const parsed = parseARP(url);
321
+ const transport = getTransportHandler(parsed.transport);
322
+ const semantic = getSemanticHandler(parsed.semantic);
323
+ const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);
324
+ if (semantic.delete) {
325
+ return semantic.delete(transport, parsed.location, context);
326
+ }
327
+ if (!transport.delete) {
328
+ throw new SemanticError(`Neither semantic "${semantic.name}" nor transport "${transport.name}" supports delete operation`, parsed.semantic);
329
+ }
330
+ await transport.delete(parsed.location);
175
331
  }
176
332
 
177
333
  // src/index.ts
178
- var VERSION = "0.0.1";
334
+ var VERSION = "0.1.0";
179
335
  export {
180
336
  textHandler,
337
+ resourceExists,
338
+ resourceDelete,
181
339
  resolve2 as resolve,
182
340
  registerTransportHandler,
183
341
  registerSemanticHandler,
@@ -187,6 +345,7 @@ export {
187
345
  getTransportHandler,
188
346
  getSemanticHandler,
189
347
  fileHandler,
348
+ deposit,
190
349
  VERSION,
191
350
  TransportError,
192
351
  SemanticError,
@@ -194,4 +353,4 @@ export {
194
353
  ParseError
195
354
  };
196
355
 
197
- //# debugId=7FDB8A773330183C64756E2164756E21
356
+ //# debugId=2B4D80A207905AF464756E2164756E21
package/dist/index.js.map CHANGED
@@ -4,15 +4,15 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * ResourceX Error Types\n */\n\n/**\n * Base error class for all ResourceX errors\n */\nexport class ResourceXError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"ResourceXError\";\n }\n}\n\n/**\n * Error thrown when ARP URL parsing fails\n */\nexport class ParseError extends ResourceXError {\n constructor(\n message: string,\n public readonly url?: string\n ) {\n super(message);\n this.name = \"ParseError\";\n }\n}\n\n/**\n * Error thrown when transport layer fails\n */\nexport class TransportError extends ResourceXError {\n constructor(\n message: string,\n public readonly transport?: string,\n options?: ErrorOptions\n ) {\n super(message, options);\n this.name = \"TransportError\";\n }\n}\n\n/**\n * Error thrown when semantic layer fails\n */\nexport class SemanticError extends ResourceXError {\n constructor(\n message: string,\n public readonly semantic?: string,\n options?: ErrorOptions\n ) {\n super(message, options);\n this.name = \"SemanticError\";\n }\n}\n",
6
6
  "/**\n * ARP URL Parser\n * Format: arp:{semantic}:{transport}://{location}\n */\n\nimport { ParseError } from \"./errors.js\";\n\nexport interface ParsedARP {\n semantic: string;\n transport: string;\n location: string;\n}\n\n/**\n * Parse an ARP URL into its components\n *\n * @example\n * parseARP(\"arp:text:https://example.com/file.txt\")\n * // { semantic: \"text\", transport: \"https\", location: \"example.com/file.txt\" }\n */\nexport function parseARP(url: string): ParsedARP {\n // 1. Check protocol prefix\n if (!url.startsWith(\"arp:\")) {\n throw new ParseError(`Invalid ARP URL: must start with \"arp:\"`, url);\n }\n\n const content = url.substring(4); // Remove \"arp:\"\n\n // 2. Find :// separator\n const separatorIndex = content.indexOf(\"://\");\n if (separatorIndex === -1) {\n throw new ParseError(`Invalid ARP URL: missing \"://\"`, url);\n }\n\n const typePart = content.substring(0, separatorIndex);\n const location = content.substring(separatorIndex + 3);\n\n // 3. Split type part by :\n const colonIndex = typePart.indexOf(\":\");\n if (colonIndex === -1) {\n throw new ParseError(`Invalid ARP URL: must have exactly 2 types (semantic:transport)`, url);\n }\n\n const semantic = typePart.substring(0, colonIndex);\n const transport = typePart.substring(colonIndex + 1);\n\n // 4. Validate non-empty\n if (!semantic) {\n throw new ParseError(`Invalid ARP URL: semantic type cannot be empty`, url);\n }\n if (!transport) {\n throw new ParseError(`Invalid ARP URL: transport type cannot be empty`, url);\n }\n if (!location) {\n throw new ParseError(`Invalid ARP URL: location cannot be empty`, url);\n }\n\n return { semantic, transport, location };\n}\n",
7
- "/**\n * HTTP/HTTPS Transport Handler\n */\n\nimport { TransportError } from \"../errors.js\";\nimport type { TransportHandler } from \"./types.js\";\n\nexport class HttpTransportHandler implements TransportHandler {\n readonly type: string;\n private readonly protocol: \"http\" | \"https\";\n\n constructor(protocol: \"http\" | \"https\" = \"https\") {\n this.protocol = protocol;\n this.type = protocol;\n }\n\n async fetch(location: string): Promise<Buffer> {\n const url = `${this.protocol}://${location}`;\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new TransportError(\n `HTTP ${response.status}: ${response.statusText} - ${url}`,\n this.type\n );\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return Buffer.from(arrayBuffer);\n } catch (error) {\n if (error instanceof TransportError) {\n throw error;\n }\n throw new TransportError(`Network error: ${url}`, this.type, { cause: error as Error });\n }\n }\n}\n\nexport const httpsHandler: HttpTransportHandler = new HttpTransportHandler(\"https\");\nexport const httpHandler: HttpTransportHandler = new HttpTransportHandler(\"http\");\n",
8
- "/**\n * File Transport Handler\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { TransportError } from \"../errors.js\";\nimport type { TransportHandler } from \"./types.js\";\n\nexport class FileTransportHandler implements TransportHandler {\n readonly type = \"file\";\n\n async fetch(location: string): Promise<Buffer> {\n const filePath = resolve(process.cwd(), location);\n\n try {\n return await readFile(filePath);\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`File read error: ${err.code} - ${filePath}`, this.type, {\n cause: err,\n });\n }\n }\n}\n\nexport const fileHandler: FileTransportHandler = new FileTransportHandler();\n",
9
- "/**\n * Transport Handlers Registry\n */\n\nimport { TransportError } from \"../errors.js\";\n\nexport type { TransportHandler } from \"./types.js\";\nexport { HttpTransportHandler, httpsHandler, httpHandler } from \"./http.js\";\nexport { FileTransportHandler, fileHandler } from \"./file.js\";\n\nimport type { TransportHandler } from \"./types.js\";\nimport { httpsHandler, httpHandler } from \"./http.js\";\nimport { fileHandler } from \"./file.js\";\n\nconst handlers = new Map<string, TransportHandler>([\n [\"https\", httpsHandler],\n [\"http\", httpHandler],\n [\"file\", fileHandler],\n]);\n\n/**\n * Get transport handler by type\n */\nexport function getTransportHandler(type: string): TransportHandler {\n const handler = handlers.get(type);\n if (!handler) {\n throw new TransportError(`Unsupported transport type: ${type}`, type);\n }\n return handler;\n}\n\n/**\n * Register a custom transport handler\n */\nexport function registerTransportHandler(handler: TransportHandler): void {\n handlers.set(handler.type, handler);\n}\n",
10
- "/**\n * Text Semantic Handler\n * Handles plain text resources\n */\n\nimport type { Resource, SemanticHandler, ParseContext, ResourceMeta } from \"./types.js\";\n\nexport interface TextResource extends Resource<string> {\n type: \"text\";\n content: string;\n}\n\nexport class TextSemanticHandler implements SemanticHandler<string> {\n readonly type = \"text\";\n\n parse(content: Buffer, context: ParseContext): TextResource {\n const text = content.toString(\"utf-8\");\n\n const meta: ResourceMeta = {\n url: context.url,\n semantic: context.semantic,\n transport: context.transport,\n location: context.location,\n size: content.length,\n encoding: \"utf-8\",\n mimeType: \"text/plain\",\n fetchedAt: context.fetchedAt.toISOString(),\n };\n\n return {\n type: \"text\",\n content: text,\n meta,\n };\n }\n}\n\nexport const textHandler: TextSemanticHandler = new TextSemanticHandler();\n",
11
- "/**\n * Semantic Handlers Registry\n */\n\nimport { SemanticError } from \"../errors.js\";\n\nexport type { Resource, SemanticHandler, ResourceMeta, ParseContext } from \"./types.js\";\nexport type { TextResource } from \"./text.js\";\nexport { TextSemanticHandler, textHandler } from \"./text.js\";\n\nimport type { SemanticHandler } from \"./types.js\";\nimport { textHandler } from \"./text.js\";\n\nconst handlers: Map<string, SemanticHandler> = new Map([[\"text\", textHandler]]);\n\n/**\n * Get semantic handler by type\n */\nexport function getSemanticHandler(type: string): SemanticHandler {\n const handler = handlers.get(type);\n if (!handler) {\n throw new SemanticError(`Unsupported semantic type: ${type}`, type);\n }\n return handler;\n}\n\n/**\n * Register a custom semantic handler\n */\nexport function registerSemanticHandler(handler: SemanticHandler): void {\n handlers.set(handler.type, handler);\n}\n",
12
- "/**\n * Resource Resolution\n * End-to-end flow: URL parse Transport fetch Semantic parse\n */\n\nimport { parseARP } from \"./parser.js\";\nimport { getTransportHandler } from \"./transport/index.js\";\nimport { getSemanticHandler, type Resource, type ParseContext } from \"./semantic/index.js\";\n\n/**\n * Resolve an ARP URL to a resource\n *\n * @example\n * const resource = await resolve(\"arp:text:https://example.com/file.txt\");\n * // { type: \"text\", content: \"...\", meta: { ... } }\n */\nexport async function resolve(url: string): Promise<Resource> {\n const fetchedAt = new Date();\n\n // 1. Parse URL\n const parsed = parseARP(url);\n\n // 2. Get handlers\n const transportHandler = getTransportHandler(parsed.transport);\n const semanticHandler = getSemanticHandler(parsed.semantic);\n\n // 3. Fetch raw content\n const content = await transportHandler.fetch(parsed.location);\n\n // 4. Build context for semantic handler\n const context: ParseContext = {\n url,\n semantic: parsed.semantic,\n transport: parsed.transport,\n location: parsed.location,\n fetchedAt,\n };\n\n // 5. Parse and return\n return semanticHandler.parse(content, context);\n}\n",
13
- "/**\n * @resourcexjs/core\n * ARP (Agent Resource Protocol) implementation\n */\n\nexport const VERSION = \"0.0.1\";\n\n// Errors\nexport { ResourceXError, ParseError, TransportError, SemanticError } from \"./errors.js\";\n\n// Parser\nexport { parseARP, type ParsedARP } from \"./parser.js\";\n\n// Transport\nexport {\n type TransportHandler,\n getTransportHandler,\n registerTransportHandler,\n httpsHandler,\n httpHandler,\n fileHandler,\n} from \"./transport/index.js\";\n\n// Semantic\nexport {\n type Resource,\n type SemanticHandler,\n type ResourceMeta,\n type ParseContext,\n type TextResource,\n getSemanticHandler,\n registerSemanticHandler,\n textHandler,\n} from \"./semantic/index.js\";\n\n// Resolve\nexport { resolve } from \"./resolve.js\";\n"
7
+ "/**\n * HTTP/HTTPS Transport Handler\n * Provides read-only I/O primitives for HTTP resources\n */\n\nimport { TransportError } from \"../errors.js\";\nimport type { TransportHandler, TransportCapabilities } from \"./types.js\";\n\nexport class HttpTransportHandler implements TransportHandler {\n readonly name: string;\n private readonly protocol: \"http\" | \"https\";\n\n readonly capabilities: TransportCapabilities = {\n canRead: true,\n canWrite: false,\n canList: false,\n canDelete: false,\n canStat: false,\n };\n\n constructor(protocol: \"http\" | \"https\" = \"https\") {\n this.protocol = protocol;\n this.name = protocol;\n }\n\n async read(location: string): Promise<Buffer> {\n const url = `${this.protocol}://${location}`;\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new TransportError(\n `HTTP ${response.status}: ${response.statusText} - ${url}`,\n this.name\n );\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return Buffer.from(arrayBuffer);\n } catch (error) {\n if (error instanceof TransportError) {\n throw error;\n }\n throw new TransportError(`Network error: ${url}`, this.name, {\n cause: error as Error,\n });\n }\n }\n\n // HTTP transport is read-only, write/list/delete are not implemented\n}\n\nexport const httpsHandler: HttpTransportHandler = new HttpTransportHandler(\"https\");\nexport const httpHandler: HttpTransportHandler = new HttpTransportHandler(\"http\");\n",
8
+ "/**\n * File Transport Handler\n * Provides I/O primitives for local filesystem\n */\n\nimport { readFile, writeFile, readdir, mkdir, rm, access, stat as fsStat } from \"node:fs/promises\";\nimport { resolve, dirname } from \"node:path\";\nimport { TransportError } from \"../errors.js\";\nimport type { TransportHandler, TransportCapabilities, ResourceStat } from \"./types.js\";\n\nexport class FileTransportHandler implements TransportHandler {\n readonly name = \"file\";\n\n readonly capabilities: TransportCapabilities = {\n canRead: true,\n canWrite: true,\n canList: true,\n canDelete: true,\n canStat: true,\n };\n\n private resolvePath(location: string): string {\n return resolve(process.cwd(), location);\n }\n\n async read(location: string): Promise<Buffer> {\n const filePath = this.resolvePath(location);\n\n try {\n return await readFile(filePath);\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`File read error: ${err.code} - ${filePath}`, this.name, {\n cause: err,\n });\n }\n }\n\n async write(location: string, content: Buffer): Promise<void> {\n const filePath = this.resolvePath(location);\n\n try {\n // Ensure directory exists\n await mkdir(dirname(filePath), { recursive: true });\n await writeFile(filePath, content);\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`File write error: ${err.code} - ${filePath}`, this.name, {\n cause: err,\n });\n }\n }\n\n async list(location: string): Promise<string[]> {\n const dirPath = this.resolvePath(location);\n\n try {\n return await readdir(dirPath);\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`Directory list error: ${err.code} - ${dirPath}`, this.name, {\n cause: err,\n });\n }\n }\n\n async mkdir(location: string): Promise<void> {\n const dirPath = this.resolvePath(location);\n\n try {\n await mkdir(dirPath, { recursive: true });\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`Directory create error: ${err.code} - ${dirPath}`, this.name, {\n cause: err,\n });\n }\n }\n\n async exists(location: string): Promise<boolean> {\n const filePath = this.resolvePath(location);\n\n try {\n await access(filePath);\n return true;\n } catch {\n return false;\n }\n }\n\n async stat(location: string): Promise<ResourceStat> {\n const filePath = this.resolvePath(location);\n\n try {\n const stats = await fsStat(filePath);\n return {\n size: stats.size,\n modifiedAt: stats.mtime,\n isDirectory: stats.isDirectory(),\n };\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`File stat error: ${err.code} - ${filePath}`, this.name, {\n cause: err,\n });\n }\n }\n\n async delete(location: string): Promise<void> {\n const filePath = this.resolvePath(location);\n\n try {\n await rm(filePath, { recursive: true });\n } catch (error) {\n const err = error as Error & { code?: string };\n throw new TransportError(`File delete error: ${err.code} - ${filePath}`, this.name, {\n cause: err,\n });\n }\n }\n}\n\nexport const fileHandler: FileTransportHandler = new FileTransportHandler();\n",
9
+ "/**\n * Transport Handlers Registry\n */\n\nimport { TransportError } from \"../errors.js\";\n\nexport type { TransportHandler, TransportCapabilities, ResourceStat } from \"./types.js\";\nexport { HttpTransportHandler, httpsHandler, httpHandler } from \"./http.js\";\nexport { FileTransportHandler, fileHandler } from \"./file.js\";\n\nimport type { TransportHandler } from \"./types.js\";\nimport { httpsHandler, httpHandler } from \"./http.js\";\nimport { fileHandler } from \"./file.js\";\n\nconst handlers = new Map<string, TransportHandler>([\n [\"https\", httpsHandler],\n [\"http\", httpHandler],\n [\"file\", fileHandler],\n]);\n\n/**\n * Get transport handler by name\n */\nexport function getTransportHandler(name: string): TransportHandler {\n const handler = handlers.get(name);\n if (!handler) {\n throw new TransportError(`Unsupported transport type: ${name}`, name);\n }\n return handler;\n}\n\n/**\n * Register a custom transport handler\n */\nexport function registerTransportHandler(handler: TransportHandler): void {\n handlers.set(handler.name, handler);\n}\n",
10
+ "/**\n * Text Semantic Handler\n * Handles plain text resources\n */\n\nimport { SemanticError } from \"../errors.js\";\nimport type { TransportHandler } from \"../transport/types.js\";\nimport type { Resource, SemanticHandler, SemanticContext, ResourceMeta } from \"./types.js\";\n\nexport interface TextResource extends Resource<string> {\n type: \"text\";\n content: string;\n}\n\nexport class TextSemanticHandler implements SemanticHandler<string> {\n readonly name = \"text\";\n\n async resolve(\n transport: TransportHandler,\n location: string,\n context: SemanticContext\n ): Promise<TextResource> {\n const buffer = await transport.read(location);\n const text = buffer.toString(\"utf-8\");\n\n const meta: ResourceMeta = {\n url: context.url,\n semantic: context.semantic,\n transport: context.transport,\n location: context.location,\n size: buffer.length,\n encoding: \"utf-8\",\n mimeType: \"text/plain\",\n resolvedAt: context.timestamp.toISOString(),\n };\n\n return {\n type: \"text\",\n content: text,\n meta,\n };\n }\n\n async deposit(\n transport: TransportHandler,\n location: string,\n data: string,\n _context: SemanticContext\n ): Promise<void> {\n if (!transport.write) {\n throw new SemanticError(\n `Transport \"${transport.name}\" does not support write operation`,\n this.name\n );\n }\n\n const buffer = Buffer.from(data, \"utf-8\");\n await transport.write(location, buffer);\n }\n\n async exists(\n transport: TransportHandler,\n location: string,\n _context: SemanticContext\n ): Promise<boolean> {\n if (transport.exists) {\n return transport.exists(location);\n }\n\n // Fallback: try to read\n try {\n await transport.read(location);\n return true;\n } catch {\n return false;\n }\n }\n\n async delete(\n transport: TransportHandler,\n location: string,\n _context: SemanticContext\n ): Promise<void> {\n if (!transport.delete) {\n throw new SemanticError(\n `Transport \"${transport.name}\" does not support delete operation`,\n this.name\n );\n }\n\n await transport.delete(location);\n }\n}\n\nexport const textHandler: TextSemanticHandler = new TextSemanticHandler();\n",
11
+ "/**\n * Semantic Handlers Registry\n */\n\nimport { SemanticError } from \"../errors.js\";\n\nexport type { Resource, SemanticHandler, ResourceMeta, SemanticContext } from \"./types.js\";\nexport type { TextResource } from \"./text.js\";\nexport { TextSemanticHandler, textHandler } from \"./text.js\";\n\nimport type { SemanticHandler } from \"./types.js\";\nimport { textHandler } from \"./text.js\";\n\nconst handlers: Map<string, SemanticHandler> = new Map([[\"text\", textHandler]]);\n\n/**\n * Get semantic handler by name\n */\nexport function getSemanticHandler(name: string): SemanticHandler {\n const handler = handlers.get(name);\n if (!handler) {\n throw new SemanticError(`Unsupported semantic type: ${name}`, name);\n }\n return handler;\n}\n\n/**\n * Register a custom semantic handler\n */\nexport function registerSemanticHandler(handler: SemanticHandler): void {\n handlers.set(handler.name, handler);\n}\n",
12
+ "/**\n * Resource Operations\n * End-to-end flows for resolve/deposit/exists/delete\n *\n * New Architecture:\n * - Transport provides I/O primitives (read/write/list/exists/delete)\n * - Semantic orchestrates Transport primitives to handle resource semantics\n * - This module coordinates Transport + Semantic based on parsed URL\n */\n\nimport { parseARP } from \"./parser.js\";\nimport { getTransportHandler } from \"./transport/index.js\";\nimport { getSemanticHandler, type Resource, type SemanticContext } from \"./semantic/index.js\";\nimport { SemanticError } from \"./errors.js\";\n\n/**\n * Create semantic context from parsed URL\n */\nfunction createContext(\n url: string,\n semantic: string,\n transport: string,\n location: string\n): SemanticContext {\n return {\n url,\n semantic,\n transport,\n location,\n timestamp: new Date(),\n };\n}\n\n/**\n * Resolve an ARP URL to a resource\n *\n * @example\n * const resource = await resolve(\"arp:text:https://example.com/file.txt\");\n * // { type: \"text\", content: \"...\", meta: { ... } }\n */\nexport async function resolve(url: string): Promise<Resource> {\n const parsed = parseARP(url);\n\n const transport = getTransportHandler(parsed.transport);\n const semantic = getSemanticHandler(parsed.semantic);\n\n const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);\n\n // Semantic controls the resolve flow\n return semantic.resolve(transport, parsed.location, context);\n}\n\n/**\n * Deposit data to an ARP URL\n *\n * @example\n * await deposit(\"arp:text:file://./data/config.txt\", \"hello world\");\n */\nexport async function deposit(url: string, data: unknown): Promise<void> {\n const parsed = parseARP(url);\n\n const transport = getTransportHandler(parsed.transport);\n const semantic = getSemanticHandler(parsed.semantic);\n\n if (!semantic.deposit) {\n throw new SemanticError(\n `Semantic \"${semantic.name}\" does not support deposit operation`,\n parsed.semantic\n );\n }\n\n const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);\n\n // Semantic controls the deposit flow\n await semantic.deposit(transport, parsed.location, data, context);\n}\n\n/**\n * Check if resource exists at ARP URL\n *\n * @example\n * const exists = await resourceExists(\"arp:text:file://./data/config.txt\");\n */\nexport async function resourceExists(url: string): Promise<boolean> {\n const parsed = parseARP(url);\n\n const transport = getTransportHandler(parsed.transport);\n const semantic = getSemanticHandler(parsed.semantic);\n\n const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);\n\n if (semantic.exists) {\n return semantic.exists(transport, parsed.location, context);\n }\n\n // Fallback to transport exists if semantic doesn't implement it\n if (transport.exists) {\n return transport.exists(parsed.location);\n }\n\n // Fallback: try to read\n try {\n await transport.read(parsed.location);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Delete resource at ARP URL\n *\n * @example\n * await resourceDelete(\"arp:text:file://./data/config.txt\");\n */\nexport async function resourceDelete(url: string): Promise<void> {\n const parsed = parseARP(url);\n\n const transport = getTransportHandler(parsed.transport);\n const semantic = getSemanticHandler(parsed.semantic);\n\n const context = createContext(url, parsed.semantic, parsed.transport, parsed.location);\n\n if (semantic.delete) {\n return semantic.delete(transport, parsed.location, context);\n }\n\n // Fallback to transport delete\n if (!transport.delete) {\n throw new SemanticError(\n `Neither semantic \"${semantic.name}\" nor transport \"${transport.name}\" supports delete operation`,\n parsed.semantic\n );\n }\n\n await transport.delete(parsed.location);\n}\n",
13
+ "/**\n * @resourcexjs/core\n * ARP (Agent Resource Protocol) implementation\n */\n\ndeclare const __VERSION__: string;\nexport const VERSION: string = __VERSION__;\n\n// Errors\nexport { ResourceXError, ParseError, TransportError, SemanticError } from \"./errors.js\";\n\n// Parser\nexport { parseARP, type ParsedARP } from \"./parser.js\";\n\n// Transport\nexport {\n type TransportHandler,\n type TransportCapabilities,\n type ResourceStat,\n getTransportHandler,\n registerTransportHandler,\n httpsHandler,\n httpHandler,\n fileHandler,\n} from \"./transport/index.js\";\n\n// Semantic\nexport {\n type Resource,\n type SemanticHandler,\n type ResourceMeta,\n type SemanticContext,\n type TextResource,\n getSemanticHandler,\n registerSemanticHandler,\n textHandler,\n} from \"./semantic/index.js\";\n\n// Resource Operations\nexport { resolve, deposit, resourceExists, resourceDelete } from \"./resolve.js\";\n"
14
14
  ],
15
- "mappings": ";AAOO,MAAM,uBAAuB,MAAM;AAAA,EACxC,WAAW,CAAC,SAAiB,SAAwB;AAAA,IACnD,MAAM,SAAS,OAAO;AAAA,IACtB,KAAK,OAAO;AAAA;AAEhB;AAAA;AAKO,MAAM,mBAAmB,eAAe;AAAA,EAG3B;AAAA,EAFlB,WAAW,CACT,SACgB,KAChB;AAAA,IACA,MAAM,OAAO;AAAA,IAFG;AAAA,IAGhB,KAAK,OAAO;AAAA;AAEhB;AAAA;AAKO,MAAM,uBAAuB,eAAe;AAAA,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IAAI;AAAA,IACF,MAAM,UAAU,KAAK,OAAO,QAAQ;AAAA,IACpC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA;AAAA;AAUX,eAAsB,cAAc,CAAC,KAA4B;AAAA,EAC/D,MAAM,SAAS,SAAS,GAAG;AAAA,EAE3B,MAAM,YAAY,oBAAoB,OAAO,SAAS;AAAA,EACtD,MAAM,WAAW,mBAAmB,OAAO,QAAQ;AAAA,EAEnD,MAAM,UAAU,cAAc,KAAK,OAAO,UAAU,OAAO,WAAW,OAAO,QAAQ;AAAA,EAErF,IAAI,SAAS,QAAQ;AAAA,IACnB,OAAO,SAAS,OAAO,WAAW,OAAO,UAAU,OAAO;AAAA,EAC5D;AAAA,EAGA,IAAI,CAAC,UAAU,QAAQ;AAAA,IACrB,MAAM,IAAI,cACR,qBAAqB,SAAS,wBAAwB,UAAU,mCAChE,OAAO,QACT;AAAA,EACF;AAAA,EAEA,MAAM,UAAU,OAAO,OAAO,QAAQ;AAAA;;;ACjIjC,IAAM,UAAkB;",
16
+ "debugId": "2B4D80A207905AF464756E2164756E21",
17
17
  "names": []
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resourcexjs/core",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "ResourceX Core - ARP (Agent Resource Protocol) implementation",
5
5
  "keywords": [
6
6
  "resourcex",