@xyne/workflow-sdk 3.2.45 → 3.2.47
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/agents/agent-step.d.ts +5 -5
- package/dist/agents/contract.d.ts +5 -5
- package/dist/agents/host-agent-step.d.ts +7 -7
- package/dist/agents/pi-session-runtime.d.ts +4 -4
- package/dist/common/credentials.d.ts +43 -0
- package/dist/common/credentials.d.ts.map +1 -1
- package/dist/common/credentials.js +34 -0
- package/dist/common/credentials.js.map +1 -1
- package/dist/connectors/builtin/builtin-connector.d.ts +1 -1
- package/dist/connectors/builtin/builtin-connector.d.ts.map +1 -1
- package/dist/connectors/builtin/builtin-connector.js +6 -4
- package/dist/connectors/builtin/builtin-connector.js.map +1 -1
- package/dist/connectors/builtin/credentials.d.ts +8 -0
- package/dist/connectors/builtin/credentials.d.ts.map +1 -1
- package/dist/connectors/builtin/credentials.js +14 -0
- package/dist/connectors/builtin/credentials.js.map +1 -1
- package/dist/connectors/builtin/steps/classifier-agent.step.d.ts +176 -0
- package/dist/connectors/builtin/steps/classifier-agent.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/classifier-agent.step.js +248 -0
- package/dist/connectors/builtin/steps/classifier-agent.step.js.map +1 -0
- package/dist/connectors/builtin/steps/cycle.step.d.ts +4 -4
- package/dist/connectors/builtin/steps/http-request.step.d.ts +4 -4
- package/dist/connectors/builtin/steps/map.step.d.ts +15 -4
- package/dist/connectors/builtin/steps/map.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/map.step.js +51 -18
- package/dist/connectors/builtin/steps/map.step.js.map +1 -1
- package/dist/connectors/builtin/steps/parallel.step.d.ts +4 -4
- package/dist/conversational-flow/create.d.ts +15 -2
- package/dist/conversational-flow/create.d.ts.map +1 -1
- package/dist/conversational-flow/create.js +29 -10
- package/dist/conversational-flow/create.js.map +1 -1
- package/dist/conversational-flow/edit.d.ts +21 -20
- package/dist/conversational-flow/edit.d.ts.map +1 -1
- package/dist/conversational-flow/edit.js +204 -286
- package/dist/conversational-flow/edit.js.map +1 -1
- package/dist/conversational-flow/index.d.ts +8 -3
- package/dist/conversational-flow/index.d.ts.map +1 -1
- package/dist/conversational-flow/index.js +7 -2
- package/dist/conversational-flow/index.js.map +1 -1
- package/dist/conversational-flow/internals.d.ts +51 -0
- package/dist/conversational-flow/internals.d.ts.map +1 -0
- package/dist/conversational-flow/internals.js +163 -0
- package/dist/conversational-flow/internals.js.map +1 -0
- package/dist/conversational-flow/lookup-edit.d.ts +96 -0
- package/dist/conversational-flow/lookup-edit.d.ts.map +1 -0
- package/dist/conversational-flow/lookup-edit.js +266 -0
- package/dist/conversational-flow/lookup-edit.js.map +1 -0
- package/dist/conversational-flow/lookups.d.ts +46 -0
- package/dist/conversational-flow/lookups.d.ts.map +1 -0
- package/dist/conversational-flow/lookups.js +145 -0
- package/dist/conversational-flow/lookups.js.map +1 -0
- package/dist/conversational-flow/read.d.ts.map +1 -1
- package/dist/conversational-flow/read.js +48 -7
- package/dist/conversational-flow/read.js.map +1 -1
- package/dist/conversational-flow/router-edit.d.ts +53 -0
- package/dist/conversational-flow/router-edit.d.ts.map +1 -0
- package/dist/conversational-flow/router-edit.js +191 -0
- package/dist/conversational-flow/router-edit.js.map +1 -0
- package/dist/conversational-flow/routers.d.ts +92 -0
- package/dist/conversational-flow/routers.d.ts.map +1 -0
- package/dist/conversational-flow/routers.js +286 -0
- package/dist/conversational-flow/routers.js.map +1 -0
- package/dist/conversational-flow/settle.d.ts +26 -0
- package/dist/conversational-flow/settle.d.ts.map +1 -0
- package/dist/conversational-flow/settle.js +59 -0
- package/dist/conversational-flow/settle.js.map +1 -0
- package/dist/conversational-flow/tree.d.ts +15 -1
- package/dist/conversational-flow/tree.d.ts.map +1 -1
- package/dist/conversational-flow/tree.js +28 -0
- package/dist/conversational-flow/tree.js.map +1 -1
- package/dist/conversational-flow/turn.d.ts +2 -0
- package/dist/conversational-flow/turn.d.ts.map +1 -1
- package/dist/conversational-flow/turn.js +26 -7
- package/dist/conversational-flow/turn.js.map +1 -1
- package/dist/conversational-flow/types.d.ts +50 -3
- package/dist/conversational-flow/types.d.ts.map +1 -1
- package/dist/conversational-flow/types.js +35 -0
- package/dist/conversational-flow/types.js.map +1 -1
- package/dist/engine/config-validator.js +2 -2
- package/dist/engine/config-validator.js.map +1 -1
- package/dist/engine/variable-resolver.js +1 -1
- package/dist/engine/variable-resolver.js.map +1 -1
- package/dist/engine/workflow-executor.d.ts.map +1 -1
- package/dist/engine/workflow-executor.js +10 -0
- package/dist/engine/workflow-executor.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/workflow-runtime.d.ts.map +1 -1
- package/dist/runtime/workflow-runtime.js +3 -0
- package/dist/runtime/workflow-runtime.js.map +1 -1
- package/dist/steps/base-step.d.ts.map +1 -1
- package/dist/steps/base-step.js +1 -0
- package/dist/steps/base-step.js.map +1 -1
- package/dist/testing/mock-context.d.ts.map +1 -1
- package/dist/testing/mock-context.js +1 -0
- package/dist/testing/mock-context.js.map +1 -1
- package/dist/types/context.d.ts +15 -0
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/known-types.d.ts +1 -0
- package/dist/types/known-types.d.ts.map +1 -1
- package/dist/types/known-types.js +1 -0
- package/dist/types/known-types.js.map +1 -1
- package/dist/util/variable-ref.d.ts +1 -1
- package/dist/util/variable-ref.d.ts.map +1 -1
- package/dist/util/variable-ref.js +1 -1
- package/dist/util/variable-ref.js.map +1 -1
- package/package.json +1 -1
|
@@ -205,6 +205,10 @@ export declare class AgentStep extends BaseActionStep<typeof AgentStepConfigSche
|
|
|
205
205
|
size?: number | undefined;
|
|
206
206
|
}>, "many">;
|
|
207
207
|
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
usage: {
|
|
209
|
+
inputTokens: number;
|
|
210
|
+
outputTokens: number;
|
|
211
|
+
};
|
|
208
212
|
response: string | Record<string, unknown>;
|
|
209
213
|
attachments: {
|
|
210
214
|
name: string;
|
|
@@ -219,11 +223,11 @@ export declare class AgentStep extends BaseActionStep<typeof AgentStepConfigSche
|
|
|
219
223
|
result?: unknown;
|
|
220
224
|
}[];
|
|
221
225
|
turnCount: number;
|
|
226
|
+
}, {
|
|
222
227
|
usage: {
|
|
223
228
|
inputTokens: number;
|
|
224
229
|
outputTokens: number;
|
|
225
230
|
};
|
|
226
|
-
}, {
|
|
227
231
|
response: string | Record<string, unknown>;
|
|
228
232
|
attachments: {
|
|
229
233
|
name: string;
|
|
@@ -238,10 +242,6 @@ export declare class AgentStep extends BaseActionStep<typeof AgentStepConfigSche
|
|
|
238
242
|
result?: unknown;
|
|
239
243
|
}[];
|
|
240
244
|
turnCount: number;
|
|
241
|
-
usage: {
|
|
242
|
-
inputTokens: number;
|
|
243
|
-
outputTokens: number;
|
|
244
|
-
};
|
|
245
245
|
}>;
|
|
246
246
|
readonly category: StepCategory;
|
|
247
247
|
constructor(runtime: BaseAgentRuntime, toolRegistry: AgentToolRegistry);
|
|
@@ -134,6 +134,10 @@ export declare const AgentResultSchema: z.ZodObject<{
|
|
|
134
134
|
size?: number | undefined;
|
|
135
135
|
}>, "many">;
|
|
136
136
|
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
usage: {
|
|
138
|
+
inputTokens: number;
|
|
139
|
+
outputTokens: number;
|
|
140
|
+
};
|
|
137
141
|
response: string | Record<string, unknown>;
|
|
138
142
|
attachments: {
|
|
139
143
|
name: string;
|
|
@@ -148,11 +152,11 @@ export declare const AgentResultSchema: z.ZodObject<{
|
|
|
148
152
|
result?: unknown;
|
|
149
153
|
}[];
|
|
150
154
|
turnCount: number;
|
|
155
|
+
}, {
|
|
151
156
|
usage: {
|
|
152
157
|
inputTokens: number;
|
|
153
158
|
outputTokens: number;
|
|
154
159
|
};
|
|
155
|
-
}, {
|
|
156
160
|
response: string | Record<string, unknown>;
|
|
157
161
|
attachments: {
|
|
158
162
|
name: string;
|
|
@@ -167,10 +171,6 @@ export declare const AgentResultSchema: z.ZodObject<{
|
|
|
167
171
|
result?: unknown;
|
|
168
172
|
}[];
|
|
169
173
|
turnCount: number;
|
|
170
|
-
usage: {
|
|
171
|
-
inputTokens: number;
|
|
172
|
-
outputTokens: number;
|
|
173
|
-
};
|
|
174
174
|
}>;
|
|
175
175
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
176
176
|
/**
|
|
@@ -65,8 +65,8 @@ declare const HostAgentBaseSchema: z.ZodObject<{
|
|
|
65
65
|
mode: z.ZodDefault<z.ZodEnum<["sync", "async"]>>;
|
|
66
66
|
waitForReply: z.ZodDefault<z.ZodBoolean>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
timeoutMs: number;
|
|
69
68
|
mode: "sync" | "async";
|
|
69
|
+
timeoutMs: number;
|
|
70
70
|
task: string;
|
|
71
71
|
waitForReply: boolean;
|
|
72
72
|
outputType: "string" | "json";
|
|
@@ -82,8 +82,8 @@ declare const HostAgentBaseSchema: z.ZodObject<{
|
|
|
82
82
|
}, {
|
|
83
83
|
task: string;
|
|
84
84
|
outputSchema?: string | Record<string, unknown> | undefined;
|
|
85
|
-
timeoutMs?: number | undefined;
|
|
86
85
|
mode?: "sync" | "async" | undefined;
|
|
86
|
+
timeoutMs?: number | undefined;
|
|
87
87
|
attachments?: string | {
|
|
88
88
|
name: string;
|
|
89
89
|
mimeType: string;
|
|
@@ -166,6 +166,10 @@ export declare class HostAgentStep<TProviderConfig extends z.AnyZodObject = z.An
|
|
|
166
166
|
size?: number | undefined;
|
|
167
167
|
}>, "many">;
|
|
168
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
usage: {
|
|
170
|
+
inputTokens: number;
|
|
171
|
+
outputTokens: number;
|
|
172
|
+
};
|
|
169
173
|
response: string | Record<string, unknown>;
|
|
170
174
|
attachments: {
|
|
171
175
|
name: string;
|
|
@@ -180,11 +184,11 @@ export declare class HostAgentStep<TProviderConfig extends z.AnyZodObject = z.An
|
|
|
180
184
|
result?: unknown;
|
|
181
185
|
}[];
|
|
182
186
|
turnCount: number;
|
|
187
|
+
}, {
|
|
183
188
|
usage: {
|
|
184
189
|
inputTokens: number;
|
|
185
190
|
outputTokens: number;
|
|
186
191
|
};
|
|
187
|
-
}, {
|
|
188
192
|
response: string | Record<string, unknown>;
|
|
189
193
|
attachments: {
|
|
190
194
|
name: string;
|
|
@@ -199,10 +203,6 @@ export declare class HostAgentStep<TProviderConfig extends z.AnyZodObject = z.An
|
|
|
199
203
|
result?: unknown;
|
|
200
204
|
}[];
|
|
201
205
|
turnCount: number;
|
|
202
|
-
usage: {
|
|
203
|
-
inputTokens: number;
|
|
204
|
-
outputTokens: number;
|
|
205
|
-
};
|
|
206
206
|
}>;
|
|
207
207
|
constructor(provider: BaseAgentProvider<TProviderConfig, unknown>, options?: HostAgentStepOptions);
|
|
208
208
|
decorateConfigSchema(jsonSchema: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -28,18 +28,18 @@ export declare const PiSessionConfigSchema: z.ZodObject<{
|
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
systemPrompt: string;
|
|
30
30
|
userMessage: string;
|
|
31
|
+
model?: string | undefined;
|
|
31
32
|
timeoutMs?: number | undefined;
|
|
32
33
|
maxRetries?: number | undefined;
|
|
33
|
-
model?: string | undefined;
|
|
34
34
|
temperature?: number | undefined;
|
|
35
35
|
maxTokens?: number | undefined;
|
|
36
36
|
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
systemPrompt: string;
|
|
39
39
|
userMessage: string;
|
|
40
|
+
model?: string | undefined;
|
|
40
41
|
timeoutMs?: number | undefined;
|
|
41
42
|
maxRetries?: number | undefined;
|
|
42
|
-
model?: string | undefined;
|
|
43
43
|
temperature?: number | undefined;
|
|
44
44
|
maxTokens?: number | undefined;
|
|
45
45
|
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
@@ -68,18 +68,18 @@ export declare class PiSessionRuntime extends BaseAgentRuntime<typeof PiSessionC
|
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
69
|
systemPrompt: string;
|
|
70
70
|
userMessage: string;
|
|
71
|
+
model?: string | undefined;
|
|
71
72
|
timeoutMs?: number | undefined;
|
|
72
73
|
maxRetries?: number | undefined;
|
|
73
|
-
model?: string | undefined;
|
|
74
74
|
temperature?: number | undefined;
|
|
75
75
|
maxTokens?: number | undefined;
|
|
76
76
|
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
77
77
|
}, {
|
|
78
78
|
systemPrompt: string;
|
|
79
79
|
userMessage: string;
|
|
80
|
+
model?: string | undefined;
|
|
80
81
|
timeoutMs?: number | undefined;
|
|
81
82
|
maxRetries?: number | undefined;
|
|
82
|
-
model?: string | undefined;
|
|
83
83
|
temperature?: number | undefined;
|
|
84
84
|
maxTokens?: number | undefined;
|
|
85
85
|
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
@@ -92,6 +92,24 @@ export declare const SecretValuesSchema: z.ZodObject<{
|
|
|
92
92
|
value: string;
|
|
93
93
|
}>;
|
|
94
94
|
export type SecretValues = z.infer<typeof SecretValuesSchema>;
|
|
95
|
+
/**
|
|
96
|
+
* A service the engine calls: where it lives and the key it takes.
|
|
97
|
+
*
|
|
98
|
+
* Runtime: the key is sent as `Authorization: Bearer <key>`, and the step reads
|
|
99
|
+
* `endpoint` to know where to send it — so moving between a vendor and a
|
|
100
|
+
* self-hosted model of the same kind is a credential change, not a workflow edit.
|
|
101
|
+
*/
|
|
102
|
+
export declare const EndpointKeyValuesSchema: z.ZodObject<{
|
|
103
|
+
endpoint: z.ZodString;
|
|
104
|
+
apiKey: z.ZodString;
|
|
105
|
+
}, "strict", z.ZodTypeAny, {
|
|
106
|
+
endpoint: string;
|
|
107
|
+
apiKey: string;
|
|
108
|
+
}, {
|
|
109
|
+
endpoint: string;
|
|
110
|
+
apiKey: string;
|
|
111
|
+
}>;
|
|
112
|
+
export type EndpointKeyValues = z.infer<typeof EndpointKeyValuesSchema>;
|
|
95
113
|
/**
|
|
96
114
|
* Credential authentication is discriminated by `authType`, keeping each
|
|
97
115
|
* authentication type paired with its exact values shape.
|
|
@@ -211,6 +229,30 @@ export declare const CredentialAuthSchema: z.ZodDiscriminatedUnion<"authType", [
|
|
|
211
229
|
value: string;
|
|
212
230
|
};
|
|
213
231
|
authType: "secret";
|
|
232
|
+
}>, z.ZodObject<{
|
|
233
|
+
authType: z.ZodLiteral<"endpoint_key">;
|
|
234
|
+
values: z.ZodObject<{
|
|
235
|
+
endpoint: z.ZodString;
|
|
236
|
+
apiKey: z.ZodString;
|
|
237
|
+
}, "strict", z.ZodTypeAny, {
|
|
238
|
+
endpoint: string;
|
|
239
|
+
apiKey: string;
|
|
240
|
+
}, {
|
|
241
|
+
endpoint: string;
|
|
242
|
+
apiKey: string;
|
|
243
|
+
}>;
|
|
244
|
+
}, "strict", z.ZodTypeAny, {
|
|
245
|
+
values: {
|
|
246
|
+
endpoint: string;
|
|
247
|
+
apiKey: string;
|
|
248
|
+
};
|
|
249
|
+
authType: "endpoint_key";
|
|
250
|
+
}, {
|
|
251
|
+
values: {
|
|
252
|
+
endpoint: string;
|
|
253
|
+
apiKey: string;
|
|
254
|
+
};
|
|
255
|
+
authType: "endpoint_key";
|
|
214
256
|
}>]>;
|
|
215
257
|
export type CredentialAuth = z.infer<typeof CredentialAuthSchema>;
|
|
216
258
|
/**
|
|
@@ -232,6 +274,7 @@ export declare const CredentialAuthType: {
|
|
|
232
274
|
readonly CustomHeader: "custom_header";
|
|
233
275
|
readonly OAuth2ClientCredentials: "oauth2_client_credentials";
|
|
234
276
|
readonly Secret: "secret";
|
|
277
|
+
readonly EndpointKey: "endpoint_key";
|
|
235
278
|
};
|
|
236
279
|
export type CredentialAuthType = CredentialAuth['authType'];
|
|
237
280
|
export type AuthSpecificValues = CredentialAuth['values'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/common/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,eAAO,MAAM,sBAAsB,kCAAgC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAEjE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,4BAA4B,GAAG,4BAA4B,CAAC;AAExE,UAAU,2BAA2B;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;CAC1D;AAgBD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;EAOpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAWnB,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;GAIG;AAC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AQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC3D"}
|
|
@@ -88,6 +88,33 @@ export const SecretValuesSchema = z
|
|
|
88
88
|
}),
|
|
89
89
|
})
|
|
90
90
|
.strict();
|
|
91
|
+
/**
|
|
92
|
+
* A service the engine calls: where it lives and the key it takes.
|
|
93
|
+
*
|
|
94
|
+
* Runtime: the key is sent as `Authorization: Bearer <key>`, and the step reads
|
|
95
|
+
* `endpoint` to know where to send it — so moving between a vendor and a
|
|
96
|
+
* self-hosted model of the same kind is a credential change, not a workflow edit.
|
|
97
|
+
*/
|
|
98
|
+
export const EndpointKeyValuesSchema = z
|
|
99
|
+
.object({
|
|
100
|
+
endpoint: credentialField(z.string().url(), {
|
|
101
|
+
label: 'Endpoint',
|
|
102
|
+
control: 'url',
|
|
103
|
+
placeholder: 'https://api.example.com/v1/…',
|
|
104
|
+
}),
|
|
105
|
+
apiKey: credentialField(z.string().min(1), {
|
|
106
|
+
label: 'API key',
|
|
107
|
+
control: 'password',
|
|
108
|
+
}),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
const EndpointKeyCredentialAuthSchema = z
|
|
112
|
+
.object({
|
|
113
|
+
authType: z.literal('endpoint_key'),
|
|
114
|
+
values: EndpointKeyValuesSchema,
|
|
115
|
+
})
|
|
116
|
+
.strict()
|
|
117
|
+
.describe('Endpoint & API key');
|
|
91
118
|
const BearerCredentialAuthSchema = z
|
|
92
119
|
.object({
|
|
93
120
|
authType: z.literal('bearer'),
|
|
@@ -133,6 +160,7 @@ export const CredentialAuthSchema = z.discriminatedUnion('authType', [
|
|
|
133
160
|
CustomHeaderCredentialAuthSchema,
|
|
134
161
|
OAuth2ClientCredentialsCredentialAuthSchema,
|
|
135
162
|
SecretCredentialAuthSchema,
|
|
163
|
+
EndpointKeyCredentialAuthSchema,
|
|
136
164
|
]);
|
|
137
165
|
/**
|
|
138
166
|
* The stored secret shapes, as a named list.
|
|
@@ -153,6 +181,7 @@ export const CredentialAuthType = {
|
|
|
153
181
|
CustomHeader: 'custom_header',
|
|
154
182
|
OAuth2ClientCredentials: 'oauth2_client_credentials',
|
|
155
183
|
Secret: 'secret',
|
|
184
|
+
EndpointKey: 'endpoint_key',
|
|
156
185
|
};
|
|
157
186
|
/**
|
|
158
187
|
* Per-auth-type value schemas, extracted from the discriminated union.
|
|
@@ -199,6 +228,11 @@ export function applyResolvedCredentialAuth(headers, credential) {
|
|
|
199
228
|
throw new Error(`Credential "${credential.name}" is a secret for verifying inbound requests ` +
|
|
200
229
|
'and cannot authenticate an outbound request');
|
|
201
230
|
}
|
|
231
|
+
case 'endpoint_key': {
|
|
232
|
+
const { apiKey } = credential.values;
|
|
233
|
+
headers.set('authorization', `Bearer ${apiKey}`);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
202
236
|
}
|
|
203
237
|
}
|
|
204
238
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/common/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAoBpE,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAGxC,CAAC;AAEJ,SAAS,eAAe,CACtB,MAAe,EACf,QAAmD;IAEnD,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,uBAAuB,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IACvD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,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,CAAC;IACJ,CAAC;IACD,sEAAsE;IACtE,0EAA0E;IAC1E,OAAO,UAAU,CAAC,MAA0C,CAAC;AAC/D,CAAC;AAoED,SAAS,qBAAqB,CAC5B,MAAsB;IAEtB,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE;QAC7D,MAAM,QAAQ,GAAG,uBAAuB,CAAC,GAAG,CAAC,WAA2B,CAAC,CAAC;QAC1E,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACnC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK;IACjC,KAAK,EAAE,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK;IACxD,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;CACnD,CAAC,CAAC,CAAC"}
|
|
@@ -20,7 +20,7 @@ export declare class BuiltinConnector extends BaseConnector {
|
|
|
20
20
|
readonly name = "Built-in";
|
|
21
21
|
readonly description = "The engine's own steps and triggers \u2014 control flow, code, HTTP and the default triggers.";
|
|
22
22
|
readonly icon = "blocks";
|
|
23
|
-
/** The connector-less auth shapes
|
|
23
|
+
/** The connector-less auth shapes `HTTP_REQUEST` accepts, plus the service a classifier asks. */
|
|
24
24
|
readonly credentials: readonly CredentialDefinition[];
|
|
25
25
|
/**
|
|
26
26
|
* Declared through `declareSteps`, which checks each step only accepts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-connector.d.ts","sourceRoot":"","sources":["../../../src/connectors/builtin/builtin-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-connector.d.ts","sourceRoot":"","sources":["../../../src/connectors/builtin/builtin-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAsBnE,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,SAAkB,EAAE,aAAa;IACjC,SAAkB,OAAO,WAAW;IACpC,SAAkB,IAAI,cAAc;IACpC,SAAkB,WAAW,mGACgE;IAC7F,SAAkB,IAAI,YAAY;IAIlC,iGAAiG;IACjG,SAAkB,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAE5D;IAEF;;;;OAIG;IACH,SAAkB,KAAK,EAAE,SAAS,OAAO,EAAE,CAcxC;IAEH,SAAkB,QAAQ,EAAE,SAAS,UAAU,EAAE,CAK/C;CACH"}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { BaseConnector } from '../core/base-connector.js';
|
|
15
15
|
import { declareSteps } from '../core/credentials.js';
|
|
16
|
-
import {
|
|
16
|
+
import { BUILTIN_ALL_CREDENTIALS } from './credentials.js';
|
|
17
|
+
import { ClassifierAgentStep } from './steps/classifier-agent.step.js';
|
|
17
18
|
import { CodeStep } from './steps/code.step.js';
|
|
18
19
|
import { ConditionalStep } from './steps/conditional.step.js';
|
|
19
20
|
import { DedupStep } from './steps/dedup.step.js';
|
|
@@ -35,17 +36,18 @@ export class BuiltinConnector extends BaseConnector {
|
|
|
35
36
|
name = 'Built-in';
|
|
36
37
|
description = "The engine's own steps and triggers — control flow, code, HTTP and the default triggers.";
|
|
37
38
|
icon = 'blocks';
|
|
38
|
-
/** The connector-less auth shapes
|
|
39
|
+
/** The connector-less auth shapes `HTTP_REQUEST` accepts, plus the service a classifier asks. */
|
|
39
40
|
credentials = [
|
|
40
|
-
...
|
|
41
|
+
...BUILTIN_ALL_CREDENTIALS,
|
|
41
42
|
];
|
|
42
43
|
/**
|
|
43
44
|
* Declared through `declareSteps`, which checks each step only accepts
|
|
44
45
|
* credentials from the list above — in the editor, not at boot. The casts the
|
|
45
46
|
* old array needed are gone with it.
|
|
46
47
|
*/
|
|
47
|
-
steps = declareSteps(
|
|
48
|
+
steps = declareSteps(BUILTIN_ALL_CREDENTIALS, [
|
|
48
49
|
new FinishStep(),
|
|
50
|
+
new ClassifierAgentStep(),
|
|
49
51
|
new CodeStep(),
|
|
50
52
|
new ConditionalStep(),
|
|
51
53
|
new GoToStep(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-connector.js","sourceRoot":"","sources":["../../../src/connectors/builtin/builtin-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"builtin-connector.js","sourceRoot":"","sources":["../../../src/connectors/builtin/builtin-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,YA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YAAY,CAAC,uBAAuB,EAAE;QAClF,IAAI,UAAU,EAAE;QAChB,IAAI,mBAAmB,EAAE;QACzB,IAAI,QAAQ,EAAE;QACd,IAAI,eAAe,EAAE;QACrB,IAAI,QAAQ,EAAE;QACd,IAAI,SAAS,EAAE;QACf,IAAI,eAAe,EAAE;QACrB,IAAI,QAAQ,EAAE;QACd,IAAI,OAAO,EAAE;QACb,IAAI,YAAY,EAAE;QAClB,IAAI,SAAS,EAAE;QACf,IAAI,UAAU,EAAE;QAChB,IAAI,QAAQ,EAAE;KACf,CAAC,CAAC;IAEe,QAAQ,GAA0B;QAClD,IAAI,oBAAoB,EAAgB;QACxC,IAAI,mBAAmB,EAAgB;QACvC,IAAI,kBAAkB,EAAgB;QACtC,IAAI,uBAAuB,EAAgB;KAC5C,CAAC;CACH"}
|
|
@@ -13,6 +13,14 @@ export declare const BUILTIN_BEARER: import("../core/credentials.js").Credential
|
|
|
13
13
|
export declare const BUILTIN_BASIC: import("../core/credentials.js").CredentialDefinition<"builtin">;
|
|
14
14
|
export declare const BUILTIN_CUSTOM_HEADER: import("../core/credentials.js").CredentialDefinition<"builtin">;
|
|
15
15
|
export declare const BUILTIN_OAUTH2_CLIENT_CREDENTIALS: import("../core/credentials.js").CredentialDefinition<"builtin">;
|
|
16
|
+
/**
|
|
17
|
+
* A service the engine calls — where it is and the key it takes. The classifier
|
|
18
|
+
* step reads both from here, so swapping the model it asks is a credential
|
|
19
|
+
* change rather than an edit to every workflow that uses it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BUILTIN_ENDPOINT_KEY: import("../core/credentials.js").CredentialDefinition<"builtin">;
|
|
16
22
|
/** Every shape an HTTP request can authenticate with. */
|
|
17
23
|
export declare const BUILTIN_CREDENTIALS: readonly [import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">];
|
|
24
|
+
/** Everything the built-in connector offers: the HTTP shapes, and a service to call. */
|
|
25
|
+
export declare const BUILTIN_ALL_CREDENTIALS: readonly [import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">, import("../core/credentials.js").CredentialDefinition<"builtin">];
|
|
18
26
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/connectors/builtin/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,eAAO,MAAM,cAAc,kEAMzB,CAAC;AAEH,eAAO,MAAM,aAAa,kEAMxB,CAAC;AAEH,eAAO,MAAM,qBAAqB,kEAMhC,CAAC;AAEH,eAAO,MAAM,iCAAiC,kEAM5C,CAAC;AAEH,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,mRAKtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/connectors/builtin/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,eAAO,MAAM,cAAc,kEAMzB,CAAC;AAEH,eAAO,MAAM,aAAa,kEAMxB,CAAC;AAEH,eAAO,MAAM,qBAAqB,kEAMhC,CAAC;AAEH,eAAO,MAAM,iCAAiC,kEAM5C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kEAM/B,CAAC;AAEH,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,mRAKtB,CAAC;AAEX,wFAAwF;AACxF,eAAO,MAAM,uBAAuB,qVAA0D,CAAC"}
|
|
@@ -40,6 +40,18 @@ export const BUILTIN_OAUTH2_CLIENT_CREDENTIALS = defineCredential({
|
|
|
40
40
|
description: 'Client ID and secret exchanged for a token on each request.',
|
|
41
41
|
authType: CredentialAuthType.OAuth2ClientCredentials,
|
|
42
42
|
});
|
|
43
|
+
/**
|
|
44
|
+
* A service the engine calls — where it is and the key it takes. The classifier
|
|
45
|
+
* step reads both from here, so swapping the model it asks is a credential
|
|
46
|
+
* change rather than an edit to every workflow that uses it.
|
|
47
|
+
*/
|
|
48
|
+
export const BUILTIN_ENDPOINT_KEY = defineCredential({
|
|
49
|
+
connectorId: BUILTIN,
|
|
50
|
+
credType: 'BUILTIN_ENDPOINT_KEY',
|
|
51
|
+
label: 'Endpoint & API key',
|
|
52
|
+
description: 'The address of a service and the key it takes, e.g. a classifier model.',
|
|
53
|
+
authType: CredentialAuthType.EndpointKey,
|
|
54
|
+
});
|
|
43
55
|
/** Every shape an HTTP request can authenticate with. */
|
|
44
56
|
export const BUILTIN_CREDENTIALS = [
|
|
45
57
|
BUILTIN_BEARER,
|
|
@@ -47,4 +59,6 @@ export const BUILTIN_CREDENTIALS = [
|
|
|
47
59
|
BUILTIN_CUSTOM_HEADER,
|
|
48
60
|
BUILTIN_OAUTH2_CLIENT_CREDENTIALS,
|
|
49
61
|
];
|
|
62
|
+
/** Everything the built-in connector offers: the HTTP shapes, and a service to call. */
|
|
63
|
+
export const BUILTIN_ALL_CREDENTIALS = [...BUILTIN_CREDENTIALS, BUILTIN_ENDPOINT_KEY];
|
|
50
64
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/connectors/builtin/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC7C,WAAW,EAAE,OAAO;IACpB,QAAQ,EAAE,gBAAgB;IAC1B,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,yDA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the classes you name, with a
|
|
3
|
+
* measure of how sure the model was.
|
|
4
|
+
*
|
|
5
|
+
* ## What it is not
|
|
6
|
+
*
|
|
7
|
+
* Despite the name it has nothing in common with `RUN_AGENT`: no session, no
|
|
8
|
+
* tools, no streaming, no turns, nothing kept between runs. It is one HTTP call
|
|
9
|
+
* that sends the thing to classify and the classes, and returns one of them.
|
|
10
|
+
* The step does not act on the answer — a CONDITIONAL, SWITCH or GO_TO after it
|
|
11
|
+
* does.
|
|
12
|
+
*
|
|
13
|
+
* ## The model behind it
|
|
14
|
+
*
|
|
15
|
+
* A "System One" model: one that answers typed questions rather than writing
|
|
16
|
+
* prose. TypeSafe's Jev is one; any endpoint speaking the same contract is
|
|
17
|
+
* another, which is why the endpoint is configuration and no vendor is named in
|
|
18
|
+
* the code.
|
|
19
|
+
*
|
|
20
|
+
* POST <endpoint> Authorization: Bearer <key>
|
|
21
|
+
* { "model": "<model>", "state": <what to classify>,
|
|
22
|
+
* "questions": { "class": { "type": "choice",
|
|
23
|
+
* "instructions": "<the question>",
|
|
24
|
+
* "criteria": { "<class>": "<what it means>" } } } }
|
|
25
|
+
*
|
|
26
|
+
* → { "answers": { "class": { "choice": "…", "probabilities": { … },
|
|
27
|
+
* "confidence": 0.74 } }, "usage": { … } }
|
|
28
|
+
*
|
|
29
|
+
* ## Confidence
|
|
30
|
+
*
|
|
31
|
+
* `confidence` is how concentrated the probabilities are: one clear peak is
|
|
32
|
+
* high, a flat spread is low. Set `minConfidence` with a `fallbackClass` and a
|
|
33
|
+
* shaky answer becomes that class instead — so a flow can ask again rather than
|
|
34
|
+
* act on a guess. `belowConfidence` says it happened; `probabilities` always
|
|
35
|
+
* carries what the model actually thought.
|
|
36
|
+
*/
|
|
37
|
+
import { z } from 'zod';
|
|
38
|
+
import { BaseActionStep } from '../../../steps/base-step.js';
|
|
39
|
+
import type { StepExecutionContext } from '../../../steps/base-step.js';
|
|
40
|
+
import { BuiltinStepType } from '../../../types/known-types.js';
|
|
41
|
+
import type { StepCategory } from '../../../types/categories.js';
|
|
42
|
+
export { DEFAULT_CLASSIFIER_ENDPOINT } from '../../../conversational-flow/types.js';
|
|
43
|
+
export declare const ClassifierAgentStepConfigSchema: z.ZodObject<{
|
|
44
|
+
input: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
45
|
+
instructions: z.ZodString;
|
|
46
|
+
classes: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
47
|
+
model: z.ZodDefault<z.ZodString>;
|
|
48
|
+
credentialName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
49
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
fallbackClass: z.ZodOptional<z.ZodString>;
|
|
51
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
maxAttempts: number;
|
|
55
|
+
input: string | Record<string, unknown> | unknown[];
|
|
56
|
+
instructions: string;
|
|
57
|
+
classes: Record<string, string>;
|
|
58
|
+
model: string;
|
|
59
|
+
timeoutMs: number;
|
|
60
|
+
credentialName?: string | undefined;
|
|
61
|
+
minConfidence?: number | undefined;
|
|
62
|
+
fallbackClass?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
input: string | Record<string, unknown> | unknown[];
|
|
65
|
+
instructions: string;
|
|
66
|
+
classes: Record<string, string>;
|
|
67
|
+
maxAttempts?: number | undefined;
|
|
68
|
+
credentialName?: string | undefined;
|
|
69
|
+
model?: string | undefined;
|
|
70
|
+
minConfidence?: number | undefined;
|
|
71
|
+
fallbackClass?: string | undefined;
|
|
72
|
+
timeoutMs?: number | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
export type ClassifierAgentStepConfig = z.infer<typeof ClassifierAgentStepConfigSchema>;
|
|
75
|
+
export interface ClassifierAgentStepOutput extends Record<string, unknown> {
|
|
76
|
+
/** The class chosen — or `fallbackClass`, when the model was less sure than asked. */
|
|
77
|
+
class: string;
|
|
78
|
+
/** 0–1: how concentrated the model's probabilities were. */
|
|
79
|
+
confidence: number;
|
|
80
|
+
/** What the model thought of every class, whatever was answered. */
|
|
81
|
+
probabilities: Record<string, number>;
|
|
82
|
+
belowConfidence: boolean;
|
|
83
|
+
model: string;
|
|
84
|
+
usage: {
|
|
85
|
+
inputTokens: number;
|
|
86
|
+
outputTokens: number;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export declare class ClassifierAgentStep extends BaseActionStep<typeof ClassifierAgentStepConfigSchema, ClassifierAgentStepOutput> {
|
|
90
|
+
readonly type = BuiltinStepType.CLASSIFIER_AGENT;
|
|
91
|
+
readonly name = "Classifier";
|
|
92
|
+
readonly description = "Put something in one of the classes you name \u2014 which screen answers a message, which team a ticket belongs to \u2014 and say how sure the model was";
|
|
93
|
+
readonly configSchema: z.ZodObject<{
|
|
94
|
+
input: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
95
|
+
instructions: z.ZodString;
|
|
96
|
+
classes: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
97
|
+
model: z.ZodDefault<z.ZodString>;
|
|
98
|
+
credentialName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
99
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
fallbackClass: z.ZodOptional<z.ZodString>;
|
|
101
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
102
|
+
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
maxAttempts: number;
|
|
105
|
+
input: string | Record<string, unknown> | unknown[];
|
|
106
|
+
instructions: string;
|
|
107
|
+
classes: Record<string, string>;
|
|
108
|
+
model: string;
|
|
109
|
+
timeoutMs: number;
|
|
110
|
+
credentialName?: string | undefined;
|
|
111
|
+
minConfidence?: number | undefined;
|
|
112
|
+
fallbackClass?: string | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
input: string | Record<string, unknown> | unknown[];
|
|
115
|
+
instructions: string;
|
|
116
|
+
classes: Record<string, string>;
|
|
117
|
+
maxAttempts?: number | undefined;
|
|
118
|
+
credentialName?: string | undefined;
|
|
119
|
+
model?: string | undefined;
|
|
120
|
+
minConfidence?: number | undefined;
|
|
121
|
+
fallbackClass?: string | undefined;
|
|
122
|
+
timeoutMs?: number | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
readonly outputSchema: z.ZodObject<{
|
|
125
|
+
class: z.ZodString;
|
|
126
|
+
confidence: z.ZodNumber;
|
|
127
|
+
probabilities: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
128
|
+
belowConfidence: z.ZodBoolean;
|
|
129
|
+
model: z.ZodString;
|
|
130
|
+
usage: z.ZodObject<{
|
|
131
|
+
inputTokens: z.ZodNumber;
|
|
132
|
+
outputTokens: z.ZodNumber;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
inputTokens: number;
|
|
135
|
+
outputTokens: number;
|
|
136
|
+
}, {
|
|
137
|
+
inputTokens: number;
|
|
138
|
+
outputTokens: number;
|
|
139
|
+
}>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
class: string;
|
|
142
|
+
model: string;
|
|
143
|
+
confidence: number;
|
|
144
|
+
probabilities: Record<string, number>;
|
|
145
|
+
belowConfidence: boolean;
|
|
146
|
+
usage: {
|
|
147
|
+
inputTokens: number;
|
|
148
|
+
outputTokens: number;
|
|
149
|
+
};
|
|
150
|
+
}, {
|
|
151
|
+
class: string;
|
|
152
|
+
model: string;
|
|
153
|
+
confidence: number;
|
|
154
|
+
probabilities: Record<string, number>;
|
|
155
|
+
belowConfidence: boolean;
|
|
156
|
+
usage: {
|
|
157
|
+
inputTokens: number;
|
|
158
|
+
outputTokens: number;
|
|
159
|
+
};
|
|
160
|
+
}>;
|
|
161
|
+
readonly category: StepCategory;
|
|
162
|
+
readonly icon = "list-tree";
|
|
163
|
+
readonly credentialSlots: readonly [{
|
|
164
|
+
readonly name: "credentialName";
|
|
165
|
+
readonly required: false;
|
|
166
|
+
}];
|
|
167
|
+
/** Where the model lives and the key it takes — both from the credential. */
|
|
168
|
+
readonly credential: import("../../core/credentials.js").CredentialDefinition<"builtin">[];
|
|
169
|
+
decorateConfigSchema(jsonSchema: Record<string, unknown>): Record<string, unknown>;
|
|
170
|
+
/** `class` is one of the configured classes, so downstream pickers offer them. */
|
|
171
|
+
resolveOutputJsonSchema(config: Record<string, unknown>): Record<string, unknown>;
|
|
172
|
+
execute(config: ClassifierAgentStepConfig, ctx: StepExecutionContext): Promise<ClassifierAgentStepOutput>;
|
|
173
|
+
/** One call, retried while the service says it is busy. */
|
|
174
|
+
private ask;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=classifier-agent.step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classifier-agent.step.d.ts","sourceRoot":"","sources":["../../../../src/connectors/builtin/steps/classifier-agent.step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAQjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAUpF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B1C,CAAC;AAEH,MAAM,MAA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