merco-agents 0.1.4 → 0.1.6
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 +76 -2
- package/index.js +2 -5
- package/merco-agents.darwin-arm64.node +0 -0
- package/merco-agents.darwin-x64.node +0 -0
- package/merco-agents.linux-arm64-gnu.node +0 -0
- package/merco-agents.linux-x64-gnu.node +0 -0
- package/merco-agents.node +0 -0
- package/merco-agents.win32-arm64-msvc.node +0 -0
- package/merco-agents.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -36,14 +36,30 @@ 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 */
|
|
42
58
|
static new(name: string): JsSession
|
|
43
59
|
/** Create a session with description */
|
|
44
60
|
static withDescription(name: string, description: string): JsSession
|
|
45
|
-
/** Get session ID */
|
|
46
|
-
get id():
|
|
61
|
+
/** Get session ID as string to avoid precision loss with large u64 values */
|
|
62
|
+
get id(): string
|
|
47
63
|
/** Get session name */
|
|
48
64
|
get name(): string
|
|
49
65
|
/** Get session description */
|
|
@@ -120,6 +136,37 @@ 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
|
+
/** Session ID as string to avoid precision loss with large u64 values */
|
|
155
|
+
sessionId: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Typed parameter for get session operation */
|
|
159
|
+
export interface GetSessionOperation {
|
|
160
|
+
operationId: string
|
|
161
|
+
/** Session ID as string to avoid precision loss with large u64 values */
|
|
162
|
+
sessionId: string
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Typed parameter for initialize operation */
|
|
166
|
+
export interface InitializeOperation {
|
|
167
|
+
operationId: string
|
|
168
|
+
}
|
|
169
|
+
|
|
123
170
|
/** JavaScript representation of AgentCapabilities */
|
|
124
171
|
export interface JsAgentCapabilities {
|
|
125
172
|
maxConcurrentTasks: number
|
|
@@ -379,6 +426,11 @@ export interface JsToolCallStreaming {
|
|
|
379
426
|
partialArgs: string
|
|
380
427
|
}
|
|
381
428
|
|
|
429
|
+
/** Typed parameter for list sessions operation */
|
|
430
|
+
export interface ListSessionsOperation {
|
|
431
|
+
operationId: string
|
|
432
|
+
}
|
|
433
|
+
|
|
382
434
|
/** Create storage from URL */
|
|
383
435
|
export declare function storageCreateFromUrl(url: string): Promise<JsStorageHandler>
|
|
384
436
|
|
|
@@ -388,6 +440,21 @@ export declare function storageCreatePostgres(config: JsPostgresConfig): Promise
|
|
|
388
440
|
/** Create SQLite storage */
|
|
389
441
|
export declare function storageCreateSqlite(config: JsSqliteConfig): Promise<JsStorageHandler>
|
|
390
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Helper function for JS to complete get_session operation
|
|
445
|
+
* session_json: JSON string of the session, or null/empty string if not found
|
|
446
|
+
*/
|
|
447
|
+
export declare function storageOperationCompleteSession(operationId: string, sessionJson?: string | undefined | null, error?: string | undefined | null): NapiResult<undefined>
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Helper function for JS to complete list_sessions operation
|
|
451
|
+
* sessions_json: JSON array string where each element is a session JSON string
|
|
452
|
+
*/
|
|
453
|
+
export declare function storageOperationCompleteSessions(operationId: string, sessionsJson: string, error?: string | undefined | null): NapiResult<undefined>
|
|
454
|
+
|
|
455
|
+
/** Helper function for JS to complete storage operations with void result */
|
|
456
|
+
export declare function storageOperationCompleteVoid(operationId: string, error?: string | undefined | null): NapiResult<undefined>
|
|
457
|
+
|
|
391
458
|
/**
|
|
392
459
|
* Store result from tool call start callback (called from JS side)
|
|
393
460
|
* The JS callback should call this function with the execution_id and allow boolean
|
|
@@ -421,3 +488,10 @@ export declare function toolRegister(name: string, description: string, paramete
|
|
|
421
488
|
* This function is kept for API compatibility but does nothing.
|
|
422
489
|
*/
|
|
423
490
|
export declare function toolUnregister(name: string): void
|
|
491
|
+
|
|
492
|
+
/** Typed parameter for update session operation */
|
|
493
|
+
export interface UpdateSessionOperation {
|
|
494
|
+
operationId: string
|
|
495
|
+
/** Session as JSON string (can be parsed to JsSession using JsSession::from_json) */
|
|
496
|
+
sessionJson: string
|
|
497
|
+
}
|
package/index.js
CHANGED
|
@@ -576,19 +576,16 @@ module.exports.AgentBuilderWrapper = nativeBinding.AgentBuilderWrapper
|
|
|
576
576
|
module.exports.JsAgent = nativeBinding.JsAgent
|
|
577
577
|
module.exports.JsSession = nativeBinding.JsSession
|
|
578
578
|
module.exports.JsStorageHandler = nativeBinding.JsStorageHandler
|
|
579
|
-
module.exports.JsStreamingHandler = nativeBinding.JsStreamingHandler
|
|
580
579
|
module.exports.JsTask = nativeBinding.JsTask
|
|
581
580
|
module.exports.agentBuilder = nativeBinding.agentBuilder
|
|
582
|
-
module.exports.JsChunkType = nativeBinding.JsChunkType
|
|
583
581
|
module.exports.JsJsonFieldType = nativeBinding.JsJsonFieldType
|
|
584
582
|
module.exports.JsOutputFormat = nativeBinding.JsOutputFormat
|
|
585
583
|
module.exports.JsProvider = nativeBinding.JsProvider
|
|
586
|
-
module.exports.JsReasoningEffort = nativeBinding.JsReasoningEffort
|
|
587
584
|
module.exports.storageCreateFromUrl = nativeBinding.storageCreateFromUrl
|
|
588
585
|
module.exports.storageCreatePostgres = nativeBinding.storageCreatePostgres
|
|
589
586
|
module.exports.storageCreateSqlite = nativeBinding.storageCreateSqlite
|
|
590
|
-
module.exports.toolCallStartComplete = nativeBinding.toolCallStartComplete
|
|
591
|
-
module.exports.toolCompleteExecution = nativeBinding.toolCompleteExecution
|
|
592
587
|
module.exports.toolList = nativeBinding.toolList
|
|
593
588
|
module.exports.toolRegister = nativeBinding.toolRegister
|
|
594
589
|
module.exports.toolUnregister = nativeBinding.toolUnregister
|
|
590
|
+
|
|
591
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/merco-agents.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|