@shenghuabi/workflow 1.0.12 → 1.1.1

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.js CHANGED
@@ -41,7 +41,6 @@ __export(workflow_exports, {
41
41
  DEFAULT_INPUT_KEY: () => DEFAULT_INPUT_KEY,
42
42
  EXAMPLES_DEFINE: () => EXAMPLES_DEFINE,
43
43
  EnviromentParametersToken: () => EnviromentParametersToken,
44
- HandleDataDefine: () => HandleDataDefine,
45
44
  HelpObj: () => HelpObj,
46
45
  INLINE_Template: () => INLINE_Template,
47
46
  INLINE_Template2: () => INLINE_Template2,
@@ -204,7 +203,11 @@ var EXAMPLES_DEFINE = v.pipe(
204
203
  ),
205
204
  import_view_angular_core2.actions.wrappers.set(["tooltip"])
206
205
  ),
207
- value: v.pipe(v.string(), v.title("问题"), import_view_angular_core2.actions.class.top("flex-1"))
206
+ value: v.pipe(
207
+ v.string(),
208
+ v.title("问题"),
209
+ import_view_angular_core2.actions.class.top("flex-1")
210
+ )
208
211
  }),
209
212
  // todo 待修复
210
213
  import_view_angular_core2.actions.class.top("flex gap-2 items-center")
@@ -216,7 +219,11 @@ var EXAMPLES_DEFINE = v.pipe(
216
219
  v.description("是否需要格式化"),
217
220
  import_view_angular_core2.actions.wrappers.set(["tooltip"])
218
221
  ),
219
- value: v.pipe(v.string(), v.title("回答"), import_view_angular_core2.actions.class.top("flex-1"))
222
+ value: v.pipe(
223
+ v.string(),
224
+ v.title("回答"),
225
+ import_view_angular_core2.actions.class.top("flex-1")
226
+ )
220
227
  }),
221
228
  import_view_angular_core2.actions.class.top("flex gap-2 items-center")
222
229
  )
@@ -227,131 +234,85 @@ var EXAMPLES_DEFINE = v.pipe(
227
234
  []
228
235
  ),
229
236
  v.title("用例"),
230
- v.description("回答问题之前,会参考定义的用例格式进行回复,用于规范回答"),
231
- (0, import_view_angular_core2.condition)({
232
- environments: ["display"],
233
- actions: [
234
- (0, import_view_angular_core2.renderConfig)({
235
- hidden: true
236
- })
237
- ]
238
- })
239
- );
240
-
241
- // packages/workflow/share/common/handle.define.ts
242
- var v2 = __toESM(require("valibot"), 1);
243
- var import_view_angular_core3 = require("@piying/view-angular-core");
244
- var import_valibot_visit = require("@piying/valibot-visit");
245
- var HiddenAction = (0, import_valibot_visit.condition)({
246
- environments: ["display", "default"],
247
- actions: [(0, import_view_angular_core3.setComponent)(""), (0, import_view_angular_core3.renderConfig)({ hidden: true })]
248
- });
249
- var AnyHiddenList = v2.pipe(
250
- v2.array(v2.pipe(v2.optional(v2.any()), HiddenAction)),
251
- (0, import_view_angular_core3.setComponent)(""),
252
- (0, import_view_angular_core3.renderConfig)({ hidden: true })
253
- );
254
- var HandleDataDefine = v2.pipe(
255
- v2.optional(
256
- v2.object({
257
- output: AnyHiddenList,
258
- input: AnyHiddenList
259
- })
260
- ),
261
- HiddenAction
237
+ v.description("回答问题之前,会参考定义的用例格式进行回复,用于规范回答")
262
238
  );
263
239
 
264
240
  // packages/workflow/share/common/inline-template.define.ts
265
- var import_view_angular_core4 = require("@piying/view-angular-core");
241
+ var import_view_angular_core3 = require("@piying/view-angular-core");
266
242
  var import_rxjs = require("rxjs");
267
- var v3 = __toESM(require("valibot"), 1);
268
- var INLINE_Template = v3.pipe(
269
- v3.object({
270
- enable: v3.optional(v3.boolean(), true),
243
+ var v2 = __toESM(require("valibot"), 1);
244
+ var INLINE_Template = v2.pipe(
245
+ v2.object({
246
+ enable: v2.optional(v2.boolean(), true),
271
247
  // 经用条件
272
- value: v3.pipe(
273
- v3.optional(v3.string(), "{{NODE.description}}"),
274
- v3.title("模板"),
275
- v3.description("允许使用变量:{{NODE.xxx}}(参考节点帮助)"),
276
- import_view_angular_core4.actions.wrappers.set(["tooltip", "label"]),
277
- import_view_angular_core4.actions.class.top("flex-1"),
278
- (0, import_view_angular_core4.disableWhen)({
248
+ value: v2.pipe(
249
+ v2.optional(v2.string(), "{{NODE.description}}"),
250
+ v2.title("模板"),
251
+ v2.description("允许使用变量:{{NODE.xxx}}(参考节点帮助)"),
252
+ import_view_angular_core3.actions.wrappers.set(["tooltip", "label"]),
253
+ import_view_angular_core3.actions.class.top("flex-1"),
254
+ (0, import_view_angular_core3.disableWhen)({
279
255
  listen: (fn) => fn({
280
256
  list: [["..", "enable"]]
281
257
  }).pipe((0, import_rxjs.map)(({ list }) => !list[0]))
282
258
  })
283
259
  )
284
260
  }),
285
- import_view_angular_core4.actions.wrappers.patch(["div"]),
286
- import_view_angular_core4.actions.class.top("flex gap-2")
261
+ import_view_angular_core3.actions.wrappers.patch(["div"]),
262
+ import_view_angular_core3.actions.class.top("flex gap-2")
287
263
  );
288
- var INLINE_Template2 = v3.pipe(
289
- v3.object({
290
- enable: v3.optional(v3.boolean(), false),
264
+ var INLINE_Template2 = v2.pipe(
265
+ v2.object({
266
+ enable: v2.optional(v2.boolean(), false),
291
267
  // 经用条件
292
- value: v3.pipe(
293
- v3.optional(v3.string()),
294
- v3.title("模板"),
295
- v3.description("允许使用变量:{{ENTRY.xxx}}(参考节点帮助)"),
296
- import_view_angular_core4.actions.wrappers.set(["tooltip", "label"]),
297
- import_view_angular_core4.actions.class.top("flex-1"),
298
- (0, import_view_angular_core4.disableWhen)({
268
+ value: v2.pipe(
269
+ v2.optional(v2.string()),
270
+ v2.title("模板"),
271
+ v2.description("允许使用变量:{{ENTRY.xxx}}(参考节点帮助)"),
272
+ import_view_angular_core3.actions.wrappers.set(["tooltip", "label"]),
273
+ import_view_angular_core3.actions.class.top("flex-1"),
274
+ (0, import_view_angular_core3.disableWhen)({
299
275
  listen: (fn) => fn({
300
276
  list: [["..", "enable"]]
301
277
  }).pipe((0, import_rxjs.map)(({ list }) => !list[0]))
302
278
  })
303
279
  )
304
280
  }),
305
- import_view_angular_core4.actions.wrappers.patch(["div"]),
306
- import_view_angular_core4.actions.class.top("flex gap-2 items-center")
281
+ import_view_angular_core3.actions.wrappers.patch(["div"]),
282
+ import_view_angular_core3.actions.class.top("flex gap-2 items-center")
307
283
  );
308
284
 
309
285
  // packages/workflow/share/common/llm.define.ts
310
- var import_view_angular_core5 = require("@piying/view-angular-core");
311
- var import_valibot_visit2 = require("@piying/valibot-visit");
312
- var v4 = __toESM(require("valibot"), 1);
286
+ var import_view_angular_core4 = require("@piying/view-angular-core");
287
+ var v3 = __toESM(require("valibot"), 1);
313
288
  function llmModelConfig(item) {
314
- return v4.pipe(
315
- v4.intersect([
316
- v4.pipe(
317
- v4.intersect([
318
- v4.pipe(
319
- v4.object({
320
- name: v4.pipe(
321
- v4.optional(v4.string()),
322
- v4.title("预定义模型配置"),
323
- (0, import_view_angular_core5.setComponent)("select"),
324
- import_view_angular_core5.actions.inputs.patchAsync({
289
+ return v3.pipe(
290
+ v3.intersect([
291
+ v3.pipe(
292
+ v3.intersect([
293
+ v3.pipe(
294
+ v3.object({
295
+ name: v3.pipe(
296
+ v3.optional(v3.string()),
297
+ v3.title("预定义模型配置"),
298
+ (0, import_view_angular_core4.setComponent)("select"),
299
+ import_view_angular_core4.actions.inputs.patchAsync({
325
300
  options: (field) => field.context.getModelList()
326
301
  })
327
302
  ),
328
- model: v4.pipe(v4.optional(v4.string()), v4.title("模型")),
303
+ model: v3.pipe(v3.optional(v3.string()), v3.title("模型")),
329
304
  // todo 配置变化configuration层被去掉.这里应该更详细支持更多参数
330
- baseURL: v4.pipe(v4.optional(v4.string()), v4.title("地址"))
305
+ baseURL: v3.pipe(v3.optional(v3.string()), v3.title("地址"))
331
306
  }),
332
307
  asColumn()
333
308
  )
334
309
  ]),
335
- v4.title(item?.label ?? "对话模型"),
336
- (0, import_valibot_visit2.condition)({
337
- environments: ["display", "config"],
338
- actions: [(0, import_view_angular_core5.asVirtualGroup)()]
339
- })
310
+ v3.title(item?.label ?? "对话模型"),
311
+ (0, import_view_angular_core4.asVirtualGroup)()
340
312
  )
341
313
  ]),
342
- (0, import_valibot_visit2.condition)({
343
- environments: ["display", "config"],
344
- actions: [(0, import_view_angular_core5.asVirtualGroup)()]
345
- }),
346
- (0, import_valibot_visit2.condition)({
347
- environments: ["display"],
348
- actions: [
349
- (0, import_view_angular_core5.renderConfig)({
350
- hidden: true
351
- })
352
- ]
353
- }),
354
- (0, import_view_angular_core5.setComponent)("accordion")
314
+ (0, import_view_angular_core4.asVirtualGroup)(),
315
+ (0, import_view_angular_core4.setComponent)("accordion")
355
316
  );
356
317
  }
357
318
 
@@ -460,7 +421,7 @@ var NODE_COMMON = {
460
421
 
461
422
  // packages/workflow/inline/node/chat/chat.node.define.ts
462
423
  var v7 = __toESM(require("valibot"), 1);
463
- var import_view_angular_core6 = require("@piying/view-angular-core");
424
+ var import_view_angular_core5 = require("@piying/view-angular-core");
464
425
  var ResponseList = ["json", "markdown", "yaml"];
465
426
  var ResponseFormat = ["text", "json_object", "json_schema"];
466
427
  var CHAT_NODE_DEFINE = v7.looseObject({
@@ -471,7 +432,7 @@ var CHAT_NODE_DEFINE = v7.looseObject({
471
432
  /** 处理时解析 */
472
433
  responseFormat: v7.pipe(
473
434
  v7.optional(v7.picklist(ResponseFormat)),
474
- import_view_angular_core6.actions.inputs.patch({
435
+ import_view_angular_core5.actions.inputs.patch({
475
436
  options: [
476
437
  // 有输入json时
477
438
  {
@@ -497,7 +458,7 @@ var CHAT_NODE_DEFINE = v7.looseObject({
497
458
  /** 处理后解析 */
498
459
  parseBy: v7.pipe(
499
460
  v7.optional(v7.picklist(ResponseList)),
500
- import_view_angular_core6.actions.inputs.patch({
461
+ import_view_angular_core5.actions.inputs.patch({
501
462
  options: [
502
463
  { label: "直接返回", value: void 0 },
503
464
  {
@@ -518,7 +479,7 @@ var CHAT_NODE_DEFINE = v7.looseObject({
518
479
  ]
519
480
  }),
520
481
  v7.title("返回解析"),
521
- (0, import_view_angular_core6.valueChange)((fn) => {
482
+ (0, import_view_angular_core5.valueChange)((fn) => {
522
483
  fn({ list: [["..", "responseFormat"]] }).subscribe(
523
484
  ({ list: [value], field }) => {
524
485
  if ((value ?? "").startsWith("json")) {
@@ -532,48 +493,47 @@ var CHAT_NODE_DEFINE = v7.looseObject({
532
493
  ),
533
494
  examples: EXAMPLES_DEFINE
534
495
  }),
535
- import_view_angular_core6.actions.wrappers.patch(["div"]),
536
- import_view_angular_core6.actions.class.top("grid auto-rows-auto gap-2")
496
+ import_view_angular_core5.actions.wrappers.patch(["div"]),
497
+ import_view_angular_core5.actions.class.top("grid auto-rows-auto gap-2")
537
498
  ),
538
499
  value: v7.pipe(
539
500
  v7.custom(Boolean),
540
- (0, import_view_angular_core6.setComponent)(""),
541
- (0, import_view_angular_core6.condition)({
542
- environments: ["display"],
543
- actions: [
544
- (0, import_view_angular_core6.setComponent)("prompt-list"),
545
- (0, import_view_angular_core6.valueChange)((fn) => {
546
- fn({ list: [void 0] }).subscribe(({ list: [value], field }) => {
547
- if (!Array.isArray(value)) {
548
- return;
549
- }
550
- const inputValue = value ?? [];
551
- field.context.parseTemplate(
552
- inputValue.flatMap(
553
- (item) => item.content.map(
554
- (item2) => item2.type === "text" ? item2.text : ""
555
- )
556
- )
557
- ).then((value2) => {
558
- if (!value2) {
559
- return;
560
- }
561
- field.context.changeHandleData(field, "input", 1, value2);
562
- });
563
- const list = inputValue.flatMap(
564
- (item) => item.content.map(
565
- (item2) => item2.type === "image_url" ? item2.image_url.url : void 0
566
- )
567
- ).filter(Boolean).map((item) => ({
568
- value: `${item}`,
569
- label: `${item}`,
570
- inputType: `image`
571
- }));
572
- field.context.changeHandleData(field, "input", 3, list ?? []);
573
- });
574
- })
575
- ]
576
- })
501
+ (0, import_view_angular_core5.setComponent)("prompt-list")
502
+ // valueChange((fn) => {
503
+ // fn({ list: [undefined] }).subscribe(({ list: [value], field }) => {
504
+ // if (!Array.isArray(value)) {
505
+ // return;
506
+ // }
507
+ // const inputValue: ChatMessageListInputType = value ?? [];
508
+ // // field.context
509
+ // // .parseTemplate(
510
+ // // inputValue.flatMap((item) =>
511
+ // // item.content.map((item) =>
512
+ // // item.type === 'text' ? item.text : '',
513
+ // // ),
514
+ // // ),
515
+ // // )
516
+ // // .then((value: any) => {
517
+ // // if (!value) {
518
+ // // return;
519
+ // // }
520
+ // // field.context.changeHandleData(field, 'input', 1, value);
521
+ // // });
522
+ // // const list = inputValue
523
+ // // .flatMap((item) =>
524
+ // // item.content.map((item) =>
525
+ // // item.type === 'image_url' ? item.image_url.url : undefined,
526
+ // // ),
527
+ // // )
528
+ // // .filter(Boolean)
529
+ // // .map((item) => ({
530
+ // // value: `${item}`,
531
+ // // label: `${item}`,
532
+ // // inputType: `image` as const,
533
+ // // }));
534
+ // // field.context.changeHandleData(field, 'input', 3, list ?? []);
535
+ // });
536
+ // }),
577
537
  )
578
538
  })
579
539
  });
@@ -2060,7 +2020,6 @@ var WORKFLOW_MODULE = {
2060
2020
  DEFAULT_INPUT_KEY,
2061
2021
  EXAMPLES_DEFINE,
2062
2022
  EnviromentParametersToken,
2063
- HandleDataDefine,
2064
2023
  HelpObj,
2065
2024
  INLINE_Template,
2066
2025
  INLINE_Template2,