@axiom-lattice/protocols 2.1.50 → 2.1.53
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +220 -12
- package/dist/index.d.ts +220 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ConnectionStoreProtocol.ts +1 -0
- package/src/EvalStoreProtocol.ts +1 -0
- package/src/InternalDSL.ts +0 -5
- package/src/ModelLatticeProtocol.ts +3 -1
- package/src/PluginProtocol.ts +63 -1
- package/src/TaskStoreProtocol.ts +103 -3
- package/src/TaskWorkItemProtocol.ts +49 -0
- package/src/WorkflowDSL.ts +4 -0
- package/src/WorkflowTrackingStoreProtocol.ts +24 -1
- package/src/index.ts +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/protocols@2.1.
|
|
2
|
+
> @axiom-lattice/protocols@2.1.53 build /home/runner/work/agentic/agentic/packages/protocols
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m6.69 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m45.69 KB[39m
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in 218ms
|
|
14
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m4.78 KB[39m
|
|
15
12
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m43.41 KB[39m
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 188ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m6.69 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m45.75 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 207ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 14394ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m134.29 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m134.29 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @axiom-lattice/protocols
|
|
2
2
|
|
|
3
|
+
## 2.1.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 075a384: add skill graph, tenant url
|
|
8
|
+
|
|
9
|
+
## 2.1.52
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- acdaec8: add read image file via llm
|
|
14
|
+
|
|
15
|
+
## 2.1.51
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2d1c9f4: enhance core
|
|
20
|
+
|
|
3
21
|
## 2.1.50
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -104,6 +104,8 @@ interface LLMConfig {
|
|
|
104
104
|
baseURL?: string;
|
|
105
105
|
modelKwargs?: Record<string, any>;
|
|
106
106
|
extra?: Record<string, any>;
|
|
107
|
+
/** Whether the model supports vision/image inputs for multimodal processing */
|
|
108
|
+
supportsVision?: boolean;
|
|
107
109
|
}
|
|
108
110
|
/**
|
|
109
111
|
* 模型Lattice协议接口
|
|
@@ -2139,6 +2141,7 @@ interface ConnectionEntry {
|
|
|
2139
2141
|
updatedAt: string;
|
|
2140
2142
|
}
|
|
2141
2143
|
interface ConnectionStore {
|
|
2144
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
2142
2145
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
2143
2146
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
2144
2147
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -2938,7 +2941,7 @@ interface WorkflowRun {
|
|
|
2938
2941
|
updatedAt: Date;
|
|
2939
2942
|
}
|
|
2940
2943
|
type StepType = 'task_delegation' | 'tool_call' | 'human_in_loop' | 'topology_transition' | 'agent' | 'human_feedback' | 'map' | 'input' | 'terminal';
|
|
2941
|
-
type StepStatus = 'running' | 'completed' | 'failed' | 'interrupted' | 'skipped';
|
|
2944
|
+
type StepStatus = 'running' | 'completed' | 'failed' | 'interrupted' | 'skipped' | 'cancelled';
|
|
2942
2945
|
interface RunStep {
|
|
2943
2946
|
id: string;
|
|
2944
2947
|
runId: string;
|
|
@@ -2992,6 +2995,22 @@ interface UpdateRunStepRequest {
|
|
|
2992
2995
|
completedAt?: Date | null;
|
|
2993
2996
|
durationMs?: number;
|
|
2994
2997
|
}
|
|
2998
|
+
interface QueryWorkflowRunsOptions {
|
|
2999
|
+
/** Filter by run status (e.g. 'interrupted' for inbox). */
|
|
3000
|
+
status?: WorkflowRunStatus;
|
|
3001
|
+
/** Filter by assistant. */
|
|
3002
|
+
assistantId?: string;
|
|
3003
|
+
/** Max records to return. Omit to return all matching runs. */
|
|
3004
|
+
limit?: number;
|
|
3005
|
+
/** Records to skip. Applied before limit. */
|
|
3006
|
+
offset?: number;
|
|
3007
|
+
}
|
|
3008
|
+
interface QueryWorkflowRunsResult {
|
|
3009
|
+
/** Matching runs, always ordered by updatedAt DESC. */
|
|
3010
|
+
records: WorkflowRun[];
|
|
3011
|
+
/** Total matching runs BEFORE limit/offset. */
|
|
3012
|
+
total: number;
|
|
3013
|
+
}
|
|
2995
3014
|
interface WorkflowTrackingStore {
|
|
2996
3015
|
createWorkflowRun(request: CreateWorkflowRunRequest): Promise<WorkflowRun>;
|
|
2997
3016
|
getWorkflowRun(runId: string): Promise<WorkflowRun | null>;
|
|
@@ -3000,6 +3019,11 @@ interface WorkflowTrackingStore {
|
|
|
3000
3019
|
getWorkflowRunsByThreadId(tenantId: string, threadId: string): Promise<WorkflowRun[]>;
|
|
3001
3020
|
getWorkflowRunsByAssistantId(tenantId: string, assistantId: string): Promise<WorkflowRun[]>;
|
|
3002
3021
|
getWorkflowRunsByTenantId(tenantId: string): Promise<WorkflowRun[]>;
|
|
3022
|
+
/**
|
|
3023
|
+
* Query runs with optional status/assistant filters and limit/offset pagination.
|
|
3024
|
+
* Always ordered by updatedAt DESC. `total` counts all matching runs (ignores limit/offset).
|
|
3025
|
+
*/
|
|
3026
|
+
queryWorkflowRuns(tenantId: string, options?: QueryWorkflowRunsOptions): Promise<QueryWorkflowRunsResult>;
|
|
3003
3027
|
createRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
3004
3028
|
/** Idempotent create — uses (runId, stepType, stepName) as unique key. Returns existing step if one already exists. */
|
|
3005
3029
|
upsertRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
@@ -3459,6 +3483,7 @@ interface EvalStore {
|
|
|
3459
3483
|
getResultsByRun(tenantId: string, runId: string): Promise<EvalRunResult[]>;
|
|
3460
3484
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, 'id' | 'runId' | 'createdAt'>): Promise<EvalRunResult>;
|
|
3461
3485
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
3486
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
3462
3487
|
getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
|
|
3463
3488
|
}
|
|
3464
3489
|
|
|
@@ -3480,6 +3505,14 @@ interface TaskItem {
|
|
|
3480
3505
|
* Tenant identifier
|
|
3481
3506
|
*/
|
|
3482
3507
|
tenantId: string;
|
|
3508
|
+
/**
|
|
3509
|
+
* Workspace identifier (from runConfig)
|
|
3510
|
+
*/
|
|
3511
|
+
workspaceId?: string;
|
|
3512
|
+
/**
|
|
3513
|
+
* Project identifier (from runConfig)
|
|
3514
|
+
*/
|
|
3515
|
+
projectId?: string;
|
|
3483
3516
|
/**
|
|
3484
3517
|
* Owner type — either a user or an agent
|
|
3485
3518
|
*/
|
|
@@ -3499,7 +3532,7 @@ interface TaskItem {
|
|
|
3499
3532
|
/**
|
|
3500
3533
|
* Task status
|
|
3501
3534
|
*/
|
|
3502
|
-
status: 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
3535
|
+
status: 'pending' | 'in_progress' | 'review' | 'failed' | 'interrupted' | 'completed' | 'cancelled';
|
|
3503
3536
|
/**
|
|
3504
3537
|
* Task priority level
|
|
3505
3538
|
*/
|
|
@@ -3532,6 +3565,22 @@ interface TaskItem {
|
|
|
3532
3565
|
* Task last update timestamp
|
|
3533
3566
|
*/
|
|
3534
3567
|
updatedAt: Date;
|
|
3568
|
+
/**
|
|
3569
|
+
* Whether this task requires review before completion
|
|
3570
|
+
*/
|
|
3571
|
+
requireReview?: boolean;
|
|
3572
|
+
/**
|
|
3573
|
+
* IDs of tasks this task depends on
|
|
3574
|
+
*/
|
|
3575
|
+
dependencies?: string[];
|
|
3576
|
+
/**
|
|
3577
|
+
* Task result output
|
|
3578
|
+
*/
|
|
3579
|
+
result?: string;
|
|
3580
|
+
/**
|
|
3581
|
+
* Reason for task failure (when status is 'failed')
|
|
3582
|
+
*/
|
|
3583
|
+
failureReason?: string;
|
|
3535
3584
|
}
|
|
3536
3585
|
/**
|
|
3537
3586
|
* Create task request type
|
|
@@ -3548,11 +3597,19 @@ interface CreateTaskRequest {
|
|
|
3548
3597
|
/**
|
|
3549
3598
|
* Task status — defaults to 'pending' if not provided
|
|
3550
3599
|
*/
|
|
3551
|
-
status?: 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
3600
|
+
status?: 'pending' | 'in_progress' | 'review' | 'failed' | 'interrupted' | 'completed' | 'cancelled';
|
|
3552
3601
|
/**
|
|
3553
3602
|
* Task priority level — defaults to 'medium' if not provided
|
|
3554
3603
|
*/
|
|
3555
3604
|
priority?: 'low' | 'medium' | 'high';
|
|
3605
|
+
/**
|
|
3606
|
+
* Workspace identifier
|
|
3607
|
+
*/
|
|
3608
|
+
workspaceId?: string;
|
|
3609
|
+
/**
|
|
3610
|
+
* Project identifier
|
|
3611
|
+
*/
|
|
3612
|
+
projectId?: string;
|
|
3556
3613
|
/**
|
|
3557
3614
|
* Optional due date as ISO string
|
|
3558
3615
|
*/
|
|
@@ -3581,6 +3638,22 @@ interface CreateTaskRequest {
|
|
|
3581
3638
|
* Owner identifier — defaults based on context if not provided
|
|
3582
3639
|
*/
|
|
3583
3640
|
ownerId?: string;
|
|
3641
|
+
/**
|
|
3642
|
+
* Whether this task requires review before completion
|
|
3643
|
+
*/
|
|
3644
|
+
requireReview?: boolean;
|
|
3645
|
+
/**
|
|
3646
|
+
* IDs of tasks this task depends on
|
|
3647
|
+
*/
|
|
3648
|
+
dependencies?: string[];
|
|
3649
|
+
/**
|
|
3650
|
+
* Task result output
|
|
3651
|
+
*/
|
|
3652
|
+
result?: string;
|
|
3653
|
+
/**
|
|
3654
|
+
* Reason for task failure (when status is 'failed')
|
|
3655
|
+
*/
|
|
3656
|
+
failureReason?: string;
|
|
3584
3657
|
}
|
|
3585
3658
|
/**
|
|
3586
3659
|
* Update task request type
|
|
@@ -3597,11 +3670,19 @@ interface UpdateTaskRequest {
|
|
|
3597
3670
|
/**
|
|
3598
3671
|
* Task status
|
|
3599
3672
|
*/
|
|
3600
|
-
status?: 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
3673
|
+
status?: 'pending' | 'in_progress' | 'review' | 'failed' | 'interrupted' | 'completed' | 'cancelled';
|
|
3601
3674
|
/**
|
|
3602
3675
|
* Task priority level
|
|
3603
3676
|
*/
|
|
3604
3677
|
priority?: 'low' | 'medium' | 'high';
|
|
3678
|
+
/**
|
|
3679
|
+
* Workspace identifier
|
|
3680
|
+
*/
|
|
3681
|
+
workspaceId?: string;
|
|
3682
|
+
/**
|
|
3683
|
+
* Project identifier
|
|
3684
|
+
*/
|
|
3685
|
+
projectId?: string;
|
|
3605
3686
|
/**
|
|
3606
3687
|
* Optional due date as ISO string
|
|
3607
3688
|
*/
|
|
@@ -3630,6 +3711,22 @@ interface UpdateTaskRequest {
|
|
|
3630
3711
|
* Owner identifier
|
|
3631
3712
|
*/
|
|
3632
3713
|
ownerId?: string;
|
|
3714
|
+
/**
|
|
3715
|
+
* Whether this task requires review before completion
|
|
3716
|
+
*/
|
|
3717
|
+
requireReview?: boolean;
|
|
3718
|
+
/**
|
|
3719
|
+
* IDs of tasks this task depends on
|
|
3720
|
+
*/
|
|
3721
|
+
dependencies?: string[];
|
|
3722
|
+
/**
|
|
3723
|
+
* Task result output
|
|
3724
|
+
*/
|
|
3725
|
+
result?: string;
|
|
3726
|
+
/**
|
|
3727
|
+
* Reason for task failure (when status is 'failed')
|
|
3728
|
+
*/
|
|
3729
|
+
failureReason?: string;
|
|
3633
3730
|
}
|
|
3634
3731
|
/**
|
|
3635
3732
|
* Task list filter criteria
|
|
@@ -3655,6 +3752,14 @@ interface TaskListFilter {
|
|
|
3655
3752
|
* Filter by priority level
|
|
3656
3753
|
*/
|
|
3657
3754
|
priority?: string;
|
|
3755
|
+
/**
|
|
3756
|
+
* Filter by workspace ID
|
|
3757
|
+
*/
|
|
3758
|
+
workspaceId?: string;
|
|
3759
|
+
/**
|
|
3760
|
+
* Filter by project ID
|
|
3761
|
+
*/
|
|
3762
|
+
projectId?: string;
|
|
3658
3763
|
/**
|
|
3659
3764
|
* Filter by parent task ID
|
|
3660
3765
|
*/
|
|
@@ -3721,6 +3826,52 @@ interface TaskStore {
|
|
|
3721
3826
|
delete(tenantId: string, id: string): Promise<boolean>;
|
|
3722
3827
|
}
|
|
3723
3828
|
|
|
3829
|
+
/**
|
|
3830
|
+
* TaskWorkItemProtocol
|
|
3831
|
+
*
|
|
3832
|
+
* Work item protocol for event-sourced task change tracking.
|
|
3833
|
+
* Every status change or action on a TaskItem produces one TaskWorkItem.
|
|
3834
|
+
*/
|
|
3835
|
+
interface TaskWorkItem {
|
|
3836
|
+
id: string;
|
|
3837
|
+
taskId: string;
|
|
3838
|
+
tenantId: string;
|
|
3839
|
+
workspaceId?: string;
|
|
3840
|
+
projectId?: string;
|
|
3841
|
+
action: string;
|
|
3842
|
+
actor: string;
|
|
3843
|
+
threadId?: string;
|
|
3844
|
+
summary?: string;
|
|
3845
|
+
detail?: Record<string, unknown>;
|
|
3846
|
+
attempt?: number;
|
|
3847
|
+
createdAt: Date;
|
|
3848
|
+
}
|
|
3849
|
+
interface CreateWorkItemRequest {
|
|
3850
|
+
taskId: string;
|
|
3851
|
+
tenantId: string;
|
|
3852
|
+
workspaceId?: string;
|
|
3853
|
+
projectId?: string;
|
|
3854
|
+
action: string;
|
|
3855
|
+
actor: string;
|
|
3856
|
+
threadId?: string;
|
|
3857
|
+
summary?: string;
|
|
3858
|
+
detail?: Record<string, unknown>;
|
|
3859
|
+
attempt?: number;
|
|
3860
|
+
}
|
|
3861
|
+
interface TaskWorkItemListFilter {
|
|
3862
|
+
tenantId: string;
|
|
3863
|
+
taskId: string;
|
|
3864
|
+
workspaceId?: string;
|
|
3865
|
+
projectId?: string;
|
|
3866
|
+
action?: string;
|
|
3867
|
+
limit?: number;
|
|
3868
|
+
offset?: number;
|
|
3869
|
+
}
|
|
3870
|
+
interface TaskWorkItemStore {
|
|
3871
|
+
create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
|
|
3872
|
+
list(filter: TaskWorkItemListFilter): Promise<TaskWorkItem[]>;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3724
3875
|
/**
|
|
3725
3876
|
* ChannelAdapterProtocol
|
|
3726
3877
|
*/
|
|
@@ -4022,6 +4173,8 @@ interface YamlAgentStep {
|
|
|
4022
4173
|
if?: string;
|
|
4023
4174
|
/** Agent instruction with {{template}} references. */
|
|
4024
4175
|
prompt: string;
|
|
4176
|
+
/** Reference a pre-registered agent to execute this step (uses that agent's tools/model/middleware). Text passthrough — no schema enforcement. */
|
|
4177
|
+
ref?: string;
|
|
4025
4178
|
/** Shorthand output schema: { field: "string" | "number" | "boolean" } */
|
|
4026
4179
|
output?: Record<string, unknown>;
|
|
4027
4180
|
/** When true, inject ask_user_to_clarify middleware. */
|
|
@@ -4045,6 +4198,8 @@ interface YamlMapStep {
|
|
|
4045
4198
|
/** Agent applied to each element. Use {{item}} for current element. */
|
|
4046
4199
|
each: {
|
|
4047
4200
|
prompt: string;
|
|
4201
|
+
/** Reference a pre-registered agent for per-item execution. Ignores each.output schema. */
|
|
4202
|
+
ref?: string;
|
|
4048
4203
|
output?: Record<string, unknown>;
|
|
4049
4204
|
};
|
|
4050
4205
|
/** Shorthand output schema for the aggregated results. */
|
|
@@ -4115,11 +4270,6 @@ interface InternalMapNode extends InternalBaseNode {
|
|
|
4115
4270
|
input?: InternalInput;
|
|
4116
4271
|
schema?: Record<string, unknown>;
|
|
4117
4272
|
};
|
|
4118
|
-
reduce?: {
|
|
4119
|
-
ref?: string;
|
|
4120
|
-
input?: InternalInput;
|
|
4121
|
-
schema?: Record<string, unknown>;
|
|
4122
|
-
};
|
|
4123
4273
|
}
|
|
4124
4274
|
interface InternalTerminalNode extends InternalBaseNode {
|
|
4125
4275
|
type: "terminal";
|
|
@@ -4300,6 +4450,8 @@ interface PluginMeta {
|
|
|
4300
4450
|
configSchema?: Record<string, unknown>;
|
|
4301
4451
|
/** 默认配置 */
|
|
4302
4452
|
defaultConfig?: Record<string, unknown>;
|
|
4453
|
+
/** 推荐的配套插件,在前端中间件配置 UI 中展示为提示 */
|
|
4454
|
+
recommends?: string[];
|
|
4303
4455
|
}
|
|
4304
4456
|
/**
|
|
4305
4457
|
* 插件元数据输出(API 返回格式)
|
|
@@ -4316,9 +4468,47 @@ interface PluginMetaOutput extends PluginMeta {
|
|
|
4316
4468
|
};
|
|
4317
4469
|
}
|
|
4318
4470
|
/**
|
|
4319
|
-
*
|
|
4471
|
+
* Build-time context passed to plugin middleware factories.
|
|
4472
|
+
*
|
|
4473
|
+
* Contains cross-plugin aggregated data determined at build time.
|
|
4474
|
+
* Does NOT carry request-scoped data (tenantId, threadId) — middleware
|
|
4475
|
+
* instances may be reused across tenants, so runtime context must be
|
|
4476
|
+
* accessed at execution time via `exeConfig.configurable.runConfig`.
|
|
4477
|
+
*
|
|
4478
|
+
* @example
|
|
4479
|
+
* ```ts
|
|
4480
|
+
* const myPlugin: Plugin = {
|
|
4481
|
+
* meta: { ... },
|
|
4482
|
+
* middleware: (config, context) => {
|
|
4483
|
+
* const skills = context?.pluginSkillContents ?? {};
|
|
4484
|
+
* return createMyMiddleware({ ...config, pluginSkills: skills });
|
|
4485
|
+
* },
|
|
4486
|
+
* };
|
|
4487
|
+
* ```
|
|
4488
|
+
*/
|
|
4489
|
+
interface PluginContext {
|
|
4490
|
+
/**
|
|
4491
|
+
* Cross-plugin aggregated skill contents (SKILL.md, keyed by skill name).
|
|
4492
|
+
* Collected from all enabled plugins before the main middleware loop.
|
|
4493
|
+
* Most plugins should ignore this; only cross-plugin coordination
|
|
4494
|
+
* middleware (e.g. skillMiddleware) consumes it.
|
|
4495
|
+
*/
|
|
4496
|
+
pluginSkillContents?: Record<string, string>;
|
|
4497
|
+
}
|
|
4498
|
+
/**
|
|
4499
|
+
* Factory function that creates middleware from plugin config.
|
|
4500
|
+
*
|
|
4501
|
+
* @param config - User-provided plugin configuration (from agent middleware config)
|
|
4502
|
+
* @param context - Optional build-time cross-plugin context (NOT request-scoped)
|
|
4503
|
+
* @returns Middleware instance or Promise of one
|
|
4504
|
+
*
|
|
4505
|
+
* @remarks
|
|
4506
|
+
* - The `context` parameter was added in v3 of the plugin protocol.
|
|
4507
|
+
* - Existing plugins that only accept `config` continue to work (extra argument is ignored).
|
|
4508
|
+
* - Context is for BUILD-TIME cross-plugin data only. Request-scoped data
|
|
4509
|
+
* (tenantId, threadId) must be read at runtime from `exeConfig.configurable.runConfig`.
|
|
4320
4510
|
*/
|
|
4321
|
-
type PluginMiddlewareFactory<T = unknown> = (config: Record<string, unknown
|
|
4511
|
+
type PluginMiddlewareFactory<T = unknown> = (config: Record<string, unknown>, context?: PluginContext) => T | Promise<T>;
|
|
4322
4512
|
/**
|
|
4323
4513
|
* Plugin 基类接口
|
|
4324
4514
|
*
|
|
@@ -4344,6 +4534,24 @@ interface Plugin {
|
|
|
4344
4534
|
connection?: PluginConnection;
|
|
4345
4535
|
/** 中间件工厂(可选,没有则不注册任何工具) */
|
|
4346
4536
|
middleware?: PluginMiddlewareFactory;
|
|
4537
|
+
/**
|
|
4538
|
+
* 插件贡献的技能内容(SKILL.md,以技能名为 key)。
|
|
4539
|
+
* 名称必须以 "{pluginType}-" 为前缀,注册时校验。
|
|
4540
|
+
* Builder 在构建中间件之前从所有启用的插件中收集。
|
|
4541
|
+
*/
|
|
4542
|
+
skills?: Record<string, string>;
|
|
4543
|
+
/**
|
|
4544
|
+
* 插件贡献的 Agent 定义(以 agent key 为键)。
|
|
4545
|
+
* 在租户首次访问时通过 ensurePluginAgentsForTenant 按租户注册到
|
|
4546
|
+
* AgentLatticeManager,与 builtin agents 模式一致。所有租户全局可用。
|
|
4547
|
+
*/
|
|
4548
|
+
agents?: Record<string, AgentConfig>;
|
|
4549
|
+
/**
|
|
4550
|
+
* 插件贡献的 Store 实现(以 store type 为键)。
|
|
4551
|
+
* 在 configureStores 时通过 customStores 机制自动注册到 StoreLatticeManager。
|
|
4552
|
+
* 支持工厂函数(延迟初始化)或实例对象。
|
|
4553
|
+
*/
|
|
4554
|
+
stores?: Record<string, object | (() => object)>;
|
|
4347
4555
|
}
|
|
4348
4556
|
|
|
4349
4557
|
/**
|
|
@@ -4409,4 +4617,4 @@ type Timestamp = number;
|
|
|
4409
4617
|
*/
|
|
4410
4618
|
type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
|
|
4411
4619
|
|
|
4412
|
-
export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type CreateA2AApiKeyInput, type CreateAssistantRequest, type CreateBindingInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OutboundMessage, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectStore, type QueryParams, type QueryResultFormat, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type SandboxMiddlewareConfig, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskHandler, type TaskItem, type TaskListFilter, type TaskStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig };
|
|
4620
|
+
export { type A2AApiKeyEntry, type A2AApiKeyRecord, type A2AApiKeyStore, type A2AArtifact, type A2AAuthContext, type A2ACapabilities, type A2AConfig, type A2ADataPart, type A2AFilePart, type A2AMessage, type A2APart, type A2AProvider, type A2APushNotification, type A2ARemoteAgentConfig, type A2ASSEEvent, type A2ASkill, type A2ATask, type A2ATaskArtifactUpdatePayload, type A2ATaskSendRequest, type A2ATaskState, type A2ATaskStatus, type A2ATaskUpdatePayload, type A2ATextPart, A2A_DEFAULT_CAPABILITIES, A2A_DEFAULT_INPUT_MODES, A2A_DEFAULT_OUTPUT_MODES, type AgentCard, type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMenuConfig, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type Attachment, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Binding, type BindingRegistry, type BootstrapFilesConfig, type BrowserMiddlewareConfig, type Callback, type ChannelAdapter, type ChannelInstallation, type ChannelInstallationStore, type ChannelInstallationType, type ClawMiddlewareConfig, type CodeEvalMiddlewareConfig, type Collection, type CollectionField, type CollectionFieldType, type CollectionMiddlewareConfig, type CollectionSchema, type CollectionStore, type ConnectionEntry, type ConnectionStore, type CreateA2AApiKeyInput, type CreateAssistantRequest, type CreateBindingInput, type CreateChannelInstallationRequest, type CreateCollectionRequest, type CreateDatabaseConfigRequest, type CreateEvalCaseRequest, type CreateEvalProjectRequest, type CreateEvalRunRequest, type CreateEvalSuiteRequest, type CreateMcpServerConfigRequest, type CreateMenuItemInput, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateRunStepRequest, type CreateShareRequest, type CreateSkillRequest, type CreateTaskRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkItemRequest, type CreateWorkflowRunRequest, type CreateWorkspaceRequest, type CustomMenuConfig, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DeveloperMessage, type DispatchResult, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type EvalCase, type EvalProject, type EvalProjectReport, type EvalRun, type EvalRunResult, type EvalStore, type EvalSuite, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type HtmlMenuConfig, type ID, type InboundMessage, type InternalAgentNode, type InternalBaseNode, type InternalDSL, type InternalEdge, type InternalInput, type InternalInputNode, type InternalMapNode, type InternalNode, type InternalNodeConfig, type InternalOutput, type InternalState, type InternalStateField, type InternalTerminalNode, type InterruptMessage, type LLMConfig, type LarkChannelInstallationConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpServerConfigEntry, type McpServerConfigStore, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type MenuContentConfig, type MenuContentType, type MenuItem, type MenuRegistry, type MenuTarget, type Message, type MessageChunk, type MessageChunkType, MessageChunkTypes, type MessageContext, type MessageMiddleware, type MetricColumn, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type OutboundMessage, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Plugin, type PluginConnection, type PluginConnectionFieldSchema, type PluginConnectionTestResult, type PluginContext, type PluginDiscoveredResource, type PluginMeta, type PluginMetaOutput, type PluginMiddlewareFactory, type PluginToolMeta, type ProcessingAgentConfig, type Project, type ProjectStore, type QueryParams, type QueryResultFormat, type QueryWorkflowRunsOptions, type QueryWorkflowRunsResult, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type ReplyTarget, type ResourceAddress, type ResourceResolver, type Result, type RunStep, type SandboxMiddlewareConfig, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SchedulerMiddlewareConfig, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type ShareRecord, type ShareResult, type ShareVisibility, type SharedResourceStore, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SkillStoreContext, type SqlMiddlewareConfig, type StepStatus, type StepType, type StorageType, type SystemMessage, type TableQueryRequest, type TableQueryResponse, type TaskHandler, type TaskItem, type TaskListFilter, type TaskStore, type TaskWorkItem, type TaskWorkItemListFilter, type TaskWorkItemStore, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type TestMcpServerToolsResponse, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type TopologyEdge, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateChannelInstallationRequest, type UpdateCollectionRequest, type UpdateDatabaseConfigRequest, type UpdateMcpServerConfigRequest, type UpdateMenuItemInput, type UpdateMetricsServerConfigRequest, type UpdateProjectRequest, type UpdateRunStepRequest, type UpdateTaskRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkflowRunRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreCreateParams, type VectorStoreLatticeProtocol, type VectorStoreProvider, type WechatChannelInstallationConfig, type WorkflowAgentConfig, type WorkflowRun, type WorkflowRunStatus, type WorkflowTrackingStore, type Workspace, type WorkspaceStore, type YamlAgentStep, type YamlMapStep, type YamlParallelBlock, type YamlTopLevelStep, type YamlWorkflow, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isA2ARemoteAgentConfig, isDeepAgentConfig, isProcessingAgentConfig, isTeamAgentConfig, isWorkflowAgentConfig };
|