@agentforge/core 0.16.10 → 0.16.11
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.cts +33 -29
- package/dist/index.d.ts +33 -29
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -4182,6 +4182,7 @@ declare function createErrorReporter(options: ErrorReporterOptions): ErrorReport
|
|
|
4182
4182
|
* Types for LangGraph interrupt handling
|
|
4183
4183
|
* @module langgraph/interrupts/types
|
|
4184
4184
|
*/
|
|
4185
|
+
|
|
4185
4186
|
/**
|
|
4186
4187
|
* Priority level for human requests
|
|
4187
4188
|
*/
|
|
@@ -4205,7 +4206,7 @@ interface HumanRequest {
|
|
|
4205
4206
|
/**
|
|
4206
4207
|
* Optional context
|
|
4207
4208
|
*/
|
|
4208
|
-
context?:
|
|
4209
|
+
context?: JsonObject;
|
|
4209
4210
|
/**
|
|
4210
4211
|
* Priority level
|
|
4211
4212
|
*/
|
|
@@ -4243,14 +4244,22 @@ interface HumanRequest {
|
|
|
4243
4244
|
* Interrupt type - identifies what kind of interrupt occurred
|
|
4244
4245
|
*/
|
|
4245
4246
|
type InterruptType = 'human_request' | 'approval_required' | 'custom';
|
|
4247
|
+
/**
|
|
4248
|
+
* Shared interrupt metadata contract.
|
|
4249
|
+
*/
|
|
4250
|
+
type InterruptMetadata = JsonObject;
|
|
4251
|
+
/**
|
|
4252
|
+
* JSON-safe payload allowed in generic interrupt and resume flows.
|
|
4253
|
+
*/
|
|
4254
|
+
type InterruptPayload = JsonValue;
|
|
4246
4255
|
/**
|
|
4247
4256
|
* Interrupt data stored in the checkpoint
|
|
4248
4257
|
*/
|
|
4249
|
-
interface InterruptData {
|
|
4258
|
+
interface InterruptData<TType extends InterruptType = InterruptType, TData = unknown, TMetadata extends InterruptMetadata = InterruptMetadata> {
|
|
4250
4259
|
/**
|
|
4251
4260
|
* Type of interrupt
|
|
4252
4261
|
*/
|
|
4253
|
-
type:
|
|
4262
|
+
type: TType;
|
|
4254
4263
|
/**
|
|
4255
4264
|
* Unique ID for this interrupt
|
|
4256
4265
|
*/
|
|
@@ -4262,37 +4271,32 @@ interface InterruptData {
|
|
|
4262
4271
|
/**
|
|
4263
4272
|
* The data associated with this interrupt
|
|
4264
4273
|
*/
|
|
4265
|
-
data:
|
|
4274
|
+
data: TData;
|
|
4266
4275
|
/**
|
|
4267
4276
|
* Optional metadata
|
|
4268
4277
|
*/
|
|
4269
|
-
metadata?:
|
|
4278
|
+
metadata?: TMetadata;
|
|
4270
4279
|
}
|
|
4271
4280
|
/**
|
|
4272
|
-
*
|
|
4281
|
+
* Approval request payload.
|
|
4273
4282
|
*/
|
|
4274
|
-
interface
|
|
4275
|
-
|
|
4276
|
-
|
|
4283
|
+
interface ApprovalRequiredData {
|
|
4284
|
+
action: string;
|
|
4285
|
+
description: string;
|
|
4286
|
+
context?: JsonObject;
|
|
4277
4287
|
}
|
|
4288
|
+
/**
|
|
4289
|
+
* Human request interrupt data
|
|
4290
|
+
*/
|
|
4291
|
+
type HumanRequestInterrupt = InterruptData<'human_request', HumanRequest>;
|
|
4278
4292
|
/**
|
|
4279
4293
|
* Approval required interrupt data
|
|
4280
4294
|
*/
|
|
4281
|
-
|
|
4282
|
-
type: 'approval_required';
|
|
4283
|
-
data: {
|
|
4284
|
-
action: string;
|
|
4285
|
-
description: string;
|
|
4286
|
-
context?: Record<string, any>;
|
|
4287
|
-
};
|
|
4288
|
-
}
|
|
4295
|
+
type ApprovalRequiredInterrupt = InterruptData<'approval_required', ApprovalRequiredData>;
|
|
4289
4296
|
/**
|
|
4290
4297
|
* Custom interrupt data
|
|
4291
4298
|
*/
|
|
4292
|
-
|
|
4293
|
-
type: 'custom';
|
|
4294
|
-
data: any;
|
|
4295
|
-
}
|
|
4299
|
+
type CustomInterrupt<TData extends InterruptPayload = InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata> = InterruptData<'custom', TData, TMetadata>;
|
|
4296
4300
|
/**
|
|
4297
4301
|
* Union type of all interrupt types
|
|
4298
4302
|
*/
|
|
@@ -4300,15 +4304,15 @@ type AnyInterrupt = HumanRequestInterrupt | ApprovalRequiredInterrupt | CustomIn
|
|
|
4300
4304
|
/**
|
|
4301
4305
|
* Resume command for continuing after an interrupt
|
|
4302
4306
|
*/
|
|
4303
|
-
interface ResumeCommand {
|
|
4307
|
+
interface ResumeCommand<TResume extends InterruptPayload = InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata> {
|
|
4304
4308
|
/**
|
|
4305
4309
|
* The response to the interrupt
|
|
4306
4310
|
*/
|
|
4307
|
-
resume:
|
|
4311
|
+
resume: TResume;
|
|
4308
4312
|
/**
|
|
4309
4313
|
* Optional metadata about the response
|
|
4310
4314
|
*/
|
|
4311
|
-
metadata?:
|
|
4315
|
+
metadata?: TMetadata;
|
|
4312
4316
|
}
|
|
4313
4317
|
/**
|
|
4314
4318
|
* Thread status
|
|
@@ -4337,7 +4341,7 @@ interface ThreadInfo {
|
|
|
4337
4341
|
/**
|
|
4338
4342
|
* Optional metadata
|
|
4339
4343
|
*/
|
|
4340
|
-
metadata?:
|
|
4344
|
+
metadata?: InterruptMetadata;
|
|
4341
4345
|
}
|
|
4342
4346
|
/**
|
|
4343
4347
|
* Options for checking interrupt status
|
|
@@ -4367,11 +4371,11 @@ interface ResumeOptions {
|
|
|
4367
4371
|
/**
|
|
4368
4372
|
* The response/value to resume with
|
|
4369
4373
|
*/
|
|
4370
|
-
value:
|
|
4374
|
+
value: InterruptPayload;
|
|
4371
4375
|
/**
|
|
4372
4376
|
* Optional metadata
|
|
4373
4377
|
*/
|
|
4374
|
-
metadata?:
|
|
4378
|
+
metadata?: InterruptMetadata;
|
|
4375
4379
|
}
|
|
4376
4380
|
|
|
4377
4381
|
/**
|
|
@@ -4415,7 +4419,7 @@ declare function createHumanRequestInterrupt(request: HumanRequest): HumanReques
|
|
|
4415
4419
|
* );
|
|
4416
4420
|
* ```
|
|
4417
4421
|
*/
|
|
4418
|
-
declare function createApprovalRequiredInterrupt(action: string, description: string, context?:
|
|
4422
|
+
declare function createApprovalRequiredInterrupt(action: string, description: string, context?: JsonObject): ApprovalRequiredInterrupt;
|
|
4419
4423
|
/**
|
|
4420
4424
|
* Create a custom interrupt
|
|
4421
4425
|
*
|
|
@@ -4432,7 +4436,7 @@ declare function createApprovalRequiredInterrupt(action: string, description: st
|
|
|
4432
4436
|
* );
|
|
4433
4437
|
* ```
|
|
4434
4438
|
*/
|
|
4435
|
-
declare function createCustomInterrupt(id: string, data:
|
|
4439
|
+
declare function createCustomInterrupt<TData extends InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata>(id: string, data: TData, metadata?: TMetadata): CustomInterrupt<TData, TMetadata>;
|
|
4436
4440
|
/**
|
|
4437
4441
|
* Check if an interrupt is a human request
|
|
4438
4442
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4182,6 +4182,7 @@ declare function createErrorReporter(options: ErrorReporterOptions): ErrorReport
|
|
|
4182
4182
|
* Types for LangGraph interrupt handling
|
|
4183
4183
|
* @module langgraph/interrupts/types
|
|
4184
4184
|
*/
|
|
4185
|
+
|
|
4185
4186
|
/**
|
|
4186
4187
|
* Priority level for human requests
|
|
4187
4188
|
*/
|
|
@@ -4205,7 +4206,7 @@ interface HumanRequest {
|
|
|
4205
4206
|
/**
|
|
4206
4207
|
* Optional context
|
|
4207
4208
|
*/
|
|
4208
|
-
context?:
|
|
4209
|
+
context?: JsonObject;
|
|
4209
4210
|
/**
|
|
4210
4211
|
* Priority level
|
|
4211
4212
|
*/
|
|
@@ -4243,14 +4244,22 @@ interface HumanRequest {
|
|
|
4243
4244
|
* Interrupt type - identifies what kind of interrupt occurred
|
|
4244
4245
|
*/
|
|
4245
4246
|
type InterruptType = 'human_request' | 'approval_required' | 'custom';
|
|
4247
|
+
/**
|
|
4248
|
+
* Shared interrupt metadata contract.
|
|
4249
|
+
*/
|
|
4250
|
+
type InterruptMetadata = JsonObject;
|
|
4251
|
+
/**
|
|
4252
|
+
* JSON-safe payload allowed in generic interrupt and resume flows.
|
|
4253
|
+
*/
|
|
4254
|
+
type InterruptPayload = JsonValue;
|
|
4246
4255
|
/**
|
|
4247
4256
|
* Interrupt data stored in the checkpoint
|
|
4248
4257
|
*/
|
|
4249
|
-
interface InterruptData {
|
|
4258
|
+
interface InterruptData<TType extends InterruptType = InterruptType, TData = unknown, TMetadata extends InterruptMetadata = InterruptMetadata> {
|
|
4250
4259
|
/**
|
|
4251
4260
|
* Type of interrupt
|
|
4252
4261
|
*/
|
|
4253
|
-
type:
|
|
4262
|
+
type: TType;
|
|
4254
4263
|
/**
|
|
4255
4264
|
* Unique ID for this interrupt
|
|
4256
4265
|
*/
|
|
@@ -4262,37 +4271,32 @@ interface InterruptData {
|
|
|
4262
4271
|
/**
|
|
4263
4272
|
* The data associated with this interrupt
|
|
4264
4273
|
*/
|
|
4265
|
-
data:
|
|
4274
|
+
data: TData;
|
|
4266
4275
|
/**
|
|
4267
4276
|
* Optional metadata
|
|
4268
4277
|
*/
|
|
4269
|
-
metadata?:
|
|
4278
|
+
metadata?: TMetadata;
|
|
4270
4279
|
}
|
|
4271
4280
|
/**
|
|
4272
|
-
*
|
|
4281
|
+
* Approval request payload.
|
|
4273
4282
|
*/
|
|
4274
|
-
interface
|
|
4275
|
-
|
|
4276
|
-
|
|
4283
|
+
interface ApprovalRequiredData {
|
|
4284
|
+
action: string;
|
|
4285
|
+
description: string;
|
|
4286
|
+
context?: JsonObject;
|
|
4277
4287
|
}
|
|
4288
|
+
/**
|
|
4289
|
+
* Human request interrupt data
|
|
4290
|
+
*/
|
|
4291
|
+
type HumanRequestInterrupt = InterruptData<'human_request', HumanRequest>;
|
|
4278
4292
|
/**
|
|
4279
4293
|
* Approval required interrupt data
|
|
4280
4294
|
*/
|
|
4281
|
-
|
|
4282
|
-
type: 'approval_required';
|
|
4283
|
-
data: {
|
|
4284
|
-
action: string;
|
|
4285
|
-
description: string;
|
|
4286
|
-
context?: Record<string, any>;
|
|
4287
|
-
};
|
|
4288
|
-
}
|
|
4295
|
+
type ApprovalRequiredInterrupt = InterruptData<'approval_required', ApprovalRequiredData>;
|
|
4289
4296
|
/**
|
|
4290
4297
|
* Custom interrupt data
|
|
4291
4298
|
*/
|
|
4292
|
-
|
|
4293
|
-
type: 'custom';
|
|
4294
|
-
data: any;
|
|
4295
|
-
}
|
|
4299
|
+
type CustomInterrupt<TData extends InterruptPayload = InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata> = InterruptData<'custom', TData, TMetadata>;
|
|
4296
4300
|
/**
|
|
4297
4301
|
* Union type of all interrupt types
|
|
4298
4302
|
*/
|
|
@@ -4300,15 +4304,15 @@ type AnyInterrupt = HumanRequestInterrupt | ApprovalRequiredInterrupt | CustomIn
|
|
|
4300
4304
|
/**
|
|
4301
4305
|
* Resume command for continuing after an interrupt
|
|
4302
4306
|
*/
|
|
4303
|
-
interface ResumeCommand {
|
|
4307
|
+
interface ResumeCommand<TResume extends InterruptPayload = InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata> {
|
|
4304
4308
|
/**
|
|
4305
4309
|
* The response to the interrupt
|
|
4306
4310
|
*/
|
|
4307
|
-
resume:
|
|
4311
|
+
resume: TResume;
|
|
4308
4312
|
/**
|
|
4309
4313
|
* Optional metadata about the response
|
|
4310
4314
|
*/
|
|
4311
|
-
metadata?:
|
|
4315
|
+
metadata?: TMetadata;
|
|
4312
4316
|
}
|
|
4313
4317
|
/**
|
|
4314
4318
|
* Thread status
|
|
@@ -4337,7 +4341,7 @@ interface ThreadInfo {
|
|
|
4337
4341
|
/**
|
|
4338
4342
|
* Optional metadata
|
|
4339
4343
|
*/
|
|
4340
|
-
metadata?:
|
|
4344
|
+
metadata?: InterruptMetadata;
|
|
4341
4345
|
}
|
|
4342
4346
|
/**
|
|
4343
4347
|
* Options for checking interrupt status
|
|
@@ -4367,11 +4371,11 @@ interface ResumeOptions {
|
|
|
4367
4371
|
/**
|
|
4368
4372
|
* The response/value to resume with
|
|
4369
4373
|
*/
|
|
4370
|
-
value:
|
|
4374
|
+
value: InterruptPayload;
|
|
4371
4375
|
/**
|
|
4372
4376
|
* Optional metadata
|
|
4373
4377
|
*/
|
|
4374
|
-
metadata?:
|
|
4378
|
+
metadata?: InterruptMetadata;
|
|
4375
4379
|
}
|
|
4376
4380
|
|
|
4377
4381
|
/**
|
|
@@ -4415,7 +4419,7 @@ declare function createHumanRequestInterrupt(request: HumanRequest): HumanReques
|
|
|
4415
4419
|
* );
|
|
4416
4420
|
* ```
|
|
4417
4421
|
*/
|
|
4418
|
-
declare function createApprovalRequiredInterrupt(action: string, description: string, context?:
|
|
4422
|
+
declare function createApprovalRequiredInterrupt(action: string, description: string, context?: JsonObject): ApprovalRequiredInterrupt;
|
|
4419
4423
|
/**
|
|
4420
4424
|
* Create a custom interrupt
|
|
4421
4425
|
*
|
|
@@ -4432,7 +4436,7 @@ declare function createApprovalRequiredInterrupt(action: string, description: st
|
|
|
4432
4436
|
* );
|
|
4433
4437
|
* ```
|
|
4434
4438
|
*/
|
|
4435
|
-
declare function createCustomInterrupt(id: string, data:
|
|
4439
|
+
declare function createCustomInterrupt<TData extends InterruptPayload, TMetadata extends InterruptMetadata = InterruptMetadata>(id: string, data: TData, metadata?: TMetadata): CustomInterrupt<TData, TMetadata>;
|
|
4436
4440
|
/**
|
|
4437
4441
|
* Check if an interrupt is a human request
|
|
4438
4442
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge/core",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.11",
|
|
4
4
|
"description": "Production-ready TypeScript agent framework built on LangGraph with orchestration, middleware, and typed abstractions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|