merco-agents 0.1.3 → 0.1.5

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/index.d.ts CHANGED
@@ -36,6 +36,22 @@ export declare class JsAgent {
36
36
  callStreamWithSession(task: JsTask, sessionKey: string | undefined | null, handler: JsStreamingHandler): Promise<void>
37
37
  }
38
38
 
39
+ /**
40
+ * JavaScript callback-based custom storage handler
41
+ * Allows TypeScript/JavaScript users to implement storage directly via callbacks
42
+ */
43
+ export declare class JsCustomStorageBuilder {
44
+ static new(): JsCustomStorageBuilder
45
+ withInitialize(callback: (arg: InitializeOperation) => void): NapiResult<JsCustomStorageBuilder>
46
+ withCreateSession(callback: (arg: CreateSessionOperation) => void): NapiResult<JsCustomStorageBuilder>
47
+ withGetSession(callback: (arg: GetSessionOperation) => void): NapiResult<JsCustomStorageBuilder>
48
+ withListSessions(callback: (arg: ListSessionsOperation) => void): NapiResult<JsCustomStorageBuilder>
49
+ withUpdateSession(callback: (arg: UpdateSessionOperation) => void): NapiResult<JsCustomStorageBuilder>
50
+ withDeleteSession(callback: (arg: DeleteSessionOperation) => void): NapiResult<JsCustomStorageBuilder>
51
+ withClose(callback: (arg: CloseOperation) => void): NapiResult<JsCustomStorageBuilder>
52
+ build(): Promise<NapiResult<JsStorageHandler>>
53
+ }
54
+
39
55
  /** JavaScript wrapper for Session */
40
56
  export declare class JsSession {
41
57
  /** Create a new session */
@@ -120,6 +136,35 @@ export declare class JsTask {
120
136
  /** Create a new agent using the builder pattern */
121
137
  export declare function agentBuilder(): Promise<AgentBuilderWrapper>
122
138
 
139
+ /** Typed parameter for close operation */
140
+ export interface CloseOperation {
141
+ operationId: string
142
+ }
143
+
144
+ /** Typed parameter for create session operation */
145
+ export interface CreateSessionOperation {
146
+ operationId: string
147
+ /** Session as JSON string (can be parsed to JsSession using JsSession::from_json) */
148
+ sessionJson: string
149
+ }
150
+
151
+ /** Typed parameter for delete session operation */
152
+ export interface DeleteSessionOperation {
153
+ operationId: string
154
+ sessionId: number
155
+ }
156
+
157
+ /** Typed parameter for get session operation */
158
+ export interface GetSessionOperation {
159
+ operationId: string
160
+ sessionId: number
161
+ }
162
+
163
+ /** Typed parameter for initialize operation */
164
+ export interface InitializeOperation {
165
+ operationId: string
166
+ }
167
+
123
168
  /** JavaScript representation of AgentCapabilities */
124
169
  export interface JsAgentCapabilities {
125
170
  maxConcurrentTasks: number
@@ -379,6 +424,11 @@ export interface JsToolCallStreaming {
379
424
  partialArgs: string
380
425
  }
381
426
 
427
+ /** Typed parameter for list sessions operation */
428
+ export interface ListSessionsOperation {
429
+ operationId: string
430
+ }
431
+
382
432
  /** Create storage from URL */
383
433
  export declare function storageCreateFromUrl(url: string): Promise<JsStorageHandler>
384
434
 
@@ -388,6 +438,21 @@ export declare function storageCreatePostgres(config: JsPostgresConfig): Promise
388
438
  /** Create SQLite storage */
389
439
  export declare function storageCreateSqlite(config: JsSqliteConfig): Promise<JsStorageHandler>
390
440
 
441
+ /**
442
+ * Helper function for JS to complete get_session operation
443
+ * session_json: JSON string of the session, or null/empty string if not found
444
+ */
445
+ export declare function storageOperationCompleteSession(operationId: string, sessionJson?: string | undefined | null, error?: string | undefined | null): NapiResult<undefined>
446
+
447
+ /**
448
+ * Helper function for JS to complete list_sessions operation
449
+ * sessions_json: JSON array string where each element is a session JSON string
450
+ */
451
+ export declare function storageOperationCompleteSessions(operationId: string, sessionsJson: string, error?: string | undefined | null): NapiResult<undefined>
452
+
453
+ /** Helper function for JS to complete storage operations with void result */
454
+ export declare function storageOperationCompleteVoid(operationId: string, error?: string | undefined | null): NapiResult<undefined>
455
+
391
456
  /**
392
457
  * Store result from tool call start callback (called from JS side)
393
458
  * The JS callback should call this function with the execution_id and allow boolean
@@ -421,3 +486,10 @@ export declare function toolRegister(name: string, description: string, paramete
421
486
  * This function is kept for API compatibility but does nothing.
422
487
  */
423
488
  export declare function toolUnregister(name: string): void
489
+
490
+ /** Typed parameter for update session operation */
491
+ export interface UpdateSessionOperation {
492
+ operationId: string
493
+ /** Session as JSON string (can be parsed to JsSession using JsSession::from_json) */
494
+ sessionJson: string
495
+ }
Binary file
Binary file
Binary file
package/merco-agents.node CHANGED
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merco-agents",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A powerful Rust library for building intelligent AI agents with Node.js bindings",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -45,6 +45,8 @@
45
45
  "prepublishOnly": "npm run build:all && node scripts/ensure-index.js",
46
46
  "prepack": "npm run build:all && node scripts/ensure-index.js",
47
47
  "publish:public": "npm publish --access public",
48
+ "version:bump": "node scripts/bump-version.js",
49
+ "collect:binaries": "node scripts/collect-platform-binaries.js",
48
50
  "test": "node test/test.js",
49
51
  "test:ts": "tsx test/test.ts",
50
52
  "test:streaming": "tsx test/test-streaming.ts"
@@ -71,6 +73,6 @@
71
73
  "typescript": "^5.9.3"
72
74
  },
73
75
  "engines": {
74
- "node": ">= 10"
76
+ "node": ">= 20"
75
77
  }
76
78
  }