@n1k1t/pipelain 0.2.2 → 0.3.0

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.
Files changed (135) hide show
  1. package/lib/src/index.d.ts +3 -0
  2. package/lib/src/index.d.ts.map +1 -1
  3. package/lib/src/index.js +3 -0
  4. package/lib/src/index.js.map +1 -1
  5. package/lib/src/models/content/factory.d.ts +3 -3
  6. package/lib/src/models/content/factory.d.ts.map +1 -1
  7. package/lib/src/models/content/factory.js +3 -3
  8. package/lib/src/models/content/factory.js.map +1 -1
  9. package/lib/src/models/content/index.d.ts +1 -0
  10. package/lib/src/models/content/index.d.ts.map +1 -1
  11. package/lib/src/models/content/index.js +1 -0
  12. package/lib/src/models/content/index.js.map +1 -1
  13. package/lib/src/models/content/kinds/article.d.ts +2 -2
  14. package/lib/src/models/content/kinds/article.d.ts.map +1 -1
  15. package/lib/src/models/content/kinds/article.js.map +1 -1
  16. package/lib/src/models/content/kinds/attachment.d.ts +3 -4
  17. package/lib/src/models/content/kinds/attachment.d.ts.map +1 -1
  18. package/lib/src/models/content/kinds/attachment.js +2 -6
  19. package/lib/src/models/content/kinds/attachment.js.map +1 -1
  20. package/lib/src/models/content/kinds/rules.d.ts.map +1 -1
  21. package/lib/src/models/content/kinds/rules.js.map +1 -1
  22. package/lib/src/models/content/kinds/sources.d.ts +1 -1
  23. package/lib/src/models/content/kinds/sources.d.ts.map +1 -1
  24. package/lib/src/models/content/kinds/sources.js +1 -1
  25. package/lib/src/models/content/kinds/sources.js.map +1 -1
  26. package/lib/src/models/content/kinds/tasks.d.ts.map +1 -1
  27. package/lib/src/models/content/kinds/tasks.js.map +1 -1
  28. package/lib/src/models/content/types.d.ts +12 -0
  29. package/lib/src/models/content/types.d.ts.map +1 -0
  30. package/lib/src/models/content/types.js +3 -0
  31. package/lib/src/models/content/types.js.map +1 -0
  32. package/lib/src/models/llm/mcp.d.ts +3 -0
  33. package/lib/src/models/llm/mcp.d.ts.map +1 -1
  34. package/lib/src/models/llm/mcp.js +21 -0
  35. package/lib/src/models/llm/mcp.js.map +1 -1
  36. package/lib/src/models/llm/providers/anthropic.d.ts.map +1 -1
  37. package/lib/src/models/llm/providers/anthropic.js +2 -1
  38. package/lib/src/models/llm/providers/anthropic.js.map +1 -1
  39. package/lib/src/models/llm/providers/google.d.ts.map +1 -1
  40. package/lib/src/models/llm/providers/google.js +2 -1
  41. package/lib/src/models/llm/providers/google.js.map +1 -1
  42. package/lib/src/models/llm/providers/mistral.d.ts.map +1 -1
  43. package/lib/src/models/llm/providers/mistral.js +2 -1
  44. package/lib/src/models/llm/providers/mistral.js.map +1 -1
  45. package/lib/src/models/llm/providers/model.d.ts +1 -1
  46. package/lib/src/models/llm/providers/model.d.ts.map +1 -1
  47. package/lib/src/models/llm/providers/openai.d.ts.map +1 -1
  48. package/lib/src/models/llm/providers/openai.js +2 -1
  49. package/lib/src/models/llm/providers/openai.js.map +1 -1
  50. package/lib/src/models/llm/providers/proxy.d.ts.map +1 -1
  51. package/lib/src/models/llm/providers/proxy.js +2 -1
  52. package/lib/src/models/llm/providers/proxy.js.map +1 -1
  53. package/lib/src/models/llm/tools/attachment.d.ts +10 -0
  54. package/lib/src/models/llm/tools/attachment.d.ts.map +1 -0
  55. package/lib/src/models/llm/tools/attachment.js +29 -0
  56. package/lib/src/models/llm/tools/attachment.js.map +1 -0
  57. package/lib/src/models/llm/tools/edit.d.ts.map +1 -1
  58. package/lib/src/models/llm/tools/edit.js +1 -4
  59. package/lib/src/models/llm/tools/edit.js.map +1 -1
  60. package/lib/src/models/llm/tools/grep.d.ts.map +1 -1
  61. package/lib/src/models/llm/tools/grep.js +0 -3
  62. package/lib/src/models/llm/tools/grep.js.map +1 -1
  63. package/lib/src/models/llm/tools/index.d.ts +1 -0
  64. package/lib/src/models/llm/tools/index.d.ts.map +1 -1
  65. package/lib/src/models/llm/tools/index.js +3 -1
  66. package/lib/src/models/llm/tools/index.js.map +1 -1
  67. package/lib/src/models/llm/tools/ls.d.ts.map +1 -1
  68. package/lib/src/models/llm/tools/ls.js +0 -3
  69. package/lib/src/models/llm/tools/ls.js.map +1 -1
  70. package/lib/src/models/llm/tools/read.d.ts.map +1 -1
  71. package/lib/src/models/llm/tools/read.js +1 -5
  72. package/lib/src/models/llm/tools/read.js.map +1 -1
  73. package/lib/src/models/llm/tools/write.d.ts +1 -1
  74. package/lib/src/models/pipeline/errors.d.ts +0 -25
  75. package/lib/src/models/pipeline/errors.d.ts.map +1 -1
  76. package/lib/src/models/pipeline/errors.js +1 -70
  77. package/lib/src/models/pipeline/errors.js.map +1 -1
  78. package/lib/src/models/pipeline/model.d.ts +14 -6
  79. package/lib/src/models/pipeline/model.d.ts.map +1 -1
  80. package/lib/src/models/pipeline/model.js +11 -2
  81. package/lib/src/models/pipeline/model.js.map +1 -1
  82. package/lib/src/models/pipeline/session.d.ts +8 -18
  83. package/lib/src/models/pipeline/session.d.ts.map +1 -1
  84. package/lib/src/models/pipeline/session.js +13 -2
  85. package/lib/src/models/pipeline/session.js.map +1 -1
  86. package/lib/src/models/pipeline/stdout/compiled/console.js +9 -9
  87. package/lib/src/models/pipeline/stdout/compiled/console.js.map +1 -1
  88. package/lib/src/models/pipeline/stdout/model.d.ts.map +1 -1
  89. package/lib/src/models/pipeline/stdout/model.js +15 -3
  90. package/lib/src/models/pipeline/stdout/model.js.map +1 -1
  91. package/lib/src/models/pipeline/steps/ai/actions/index.d.ts +3 -0
  92. package/lib/src/models/pipeline/steps/ai/actions/index.d.ts.map +1 -0
  93. package/lib/src/models/pipeline/steps/ai/actions/index.js +19 -0
  94. package/lib/src/models/pipeline/steps/ai/actions/index.js.map +1 -0
  95. package/lib/src/models/pipeline/steps/ai/actions/model.d.ts +13 -0
  96. package/lib/src/models/pipeline/steps/ai/actions/model.d.ts.map +1 -0
  97. package/lib/src/models/pipeline/steps/ai/actions/model.js +21 -0
  98. package/lib/src/models/pipeline/steps/ai/actions/model.js.map +1 -0
  99. package/lib/src/models/pipeline/steps/ai/actions/reasoning.d.ts +36 -0
  100. package/lib/src/models/pipeline/steps/ai/actions/reasoning.d.ts.map +1 -0
  101. package/lib/src/models/pipeline/steps/ai/actions/reasoning.js +59 -0
  102. package/lib/src/models/pipeline/steps/ai/actions/reasoning.js.map +1 -0
  103. package/lib/src/models/pipeline/steps/ai/actions/tool.d.ts +71 -0
  104. package/lib/src/models/pipeline/steps/ai/actions/tool.d.ts.map +1 -0
  105. package/lib/src/models/pipeline/steps/ai/actions/tool.js +160 -0
  106. package/lib/src/models/pipeline/steps/ai/actions/tool.js.map +1 -0
  107. package/lib/src/models/pipeline/steps/ai/errors.d.ts +26 -0
  108. package/lib/src/models/pipeline/steps/ai/errors.d.ts.map +1 -0
  109. package/lib/src/models/pipeline/steps/ai/errors.js +73 -0
  110. package/lib/src/models/pipeline/steps/ai/errors.js.map +1 -0
  111. package/lib/src/models/pipeline/steps/{ai.d.ts → ai/index.d.ts} +8 -13
  112. package/lib/src/models/pipeline/steps/ai/index.d.ts.map +1 -0
  113. package/lib/src/models/pipeline/steps/{ai.js → ai/index.js} +149 -191
  114. package/lib/src/models/pipeline/steps/ai/index.js.map +1 -0
  115. package/lib/src/models/pipeline/steps/ai/types.d.ts +12 -0
  116. package/lib/src/models/pipeline/steps/ai/types.d.ts.map +1 -0
  117. package/lib/src/models/pipeline/steps/ai/types.js +3 -0
  118. package/lib/src/models/pipeline/steps/ai/types.js.map +1 -0
  119. package/lib/src/models/pipeline/steps/ai/utils.d.ts +9 -0
  120. package/lib/src/models/pipeline/steps/ai/utils.d.ts.map +1 -0
  121. package/lib/src/models/pipeline/steps/ai/utils.js +34 -0
  122. package/lib/src/models/pipeline/steps/ai/utils.js.map +1 -0
  123. package/lib/src/models/vfs.d.ts +2 -2
  124. package/lib/src/models/vfs.d.ts.map +1 -1
  125. package/lib/src/models/vfs.js +4 -4
  126. package/lib/src/models/vfs.js.map +1 -1
  127. package/lib/src/utils/common.d.ts +9 -0
  128. package/lib/src/utils/common.d.ts.map +1 -1
  129. package/lib/src/utils/common.js +16 -1
  130. package/lib/src/utils/common.js.map +1 -1
  131. package/lib/types/json2md.global.d.ts +2 -7
  132. package/lib/types/json2md.global.d.ts.map +1 -1
  133. package/package.json +1 -1
  134. package/lib/src/models/pipeline/steps/ai.d.ts.map +0 -1
  135. package/lib/src/models/pipeline/steps/ai.js.map +0 -1
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PipelineAiError = void 0;
7
+ const ai_1 = require("ai");
8
+ const lodash_1 = __importDefault(require("lodash"));
9
+ class PipelineAiError extends Error {
10
+ constructor(provided) {
11
+ super(`Got error [${provided.type}] while generation. Reason: ${provided.reason}`);
12
+ this.provided = provided;
13
+ this.type = this.provided.type;
14
+ this.llm = this.provided.llm;
15
+ /** Errors sequence bolong to this */
16
+ this.sequence = this.provided.sequence ?? [];
17
+ this.reason = this.provided.reason ?? 'none';
18
+ }
19
+ is(types) {
20
+ return types.includes(this.type);
21
+ }
22
+ assign(payload) {
23
+ if (payload.type) {
24
+ this.type = payload.type;
25
+ }
26
+ if (payload.sequence?.length) {
27
+ this.sequence = payload.sequence;
28
+ }
29
+ return this;
30
+ }
31
+ /** Returns full sequence of this error (in ascending order) */
32
+ research() {
33
+ if (this.sequence.length) {
34
+ return lodash_1.default.uniq(this.sequence
35
+ .reduce((acc, error) => acc.concat(error.research()), [])
36
+ .concat(this)
37
+ .reverse());
38
+ }
39
+ return [this];
40
+ }
41
+ static build(provided) {
42
+ return new PipelineAiError(provided);
43
+ }
44
+ static convert(provided) {
45
+ if (provided.error instanceof PipelineAiError) {
46
+ return provided.error;
47
+ }
48
+ if (ai_1.APICallError.isInstance(provided.error)) {
49
+ return new PipelineAiError({
50
+ type: 'BAD_API_CALL',
51
+ reason: provided.error.message,
52
+ llm: provided.llm,
53
+ });
54
+ }
55
+ if (ai_1.NoObjectGeneratedError.isInstance(provided.error)) {
56
+ return new PipelineAiError({
57
+ type: 'WRONG_RESPONSE',
58
+ reason: provided.error.message,
59
+ llm: provided.llm,
60
+ });
61
+ }
62
+ const reason = String(lodash_1.default.isObject(provided.error) && 'message' in provided.error
63
+ ? provided.error.message
64
+ : provided.error);
65
+ return new PipelineAiError({
66
+ reason,
67
+ type: 'BAD_API_CALL',
68
+ llm: provided.llm,
69
+ });
70
+ }
71
+ }
72
+ exports.PipelineAiError = PipelineAiError;
73
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/errors.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA0D;AAC1D,oDAAuB;AAIvB,MAAa,eAAgB,SAAQ,KAAK;IASxC,YAAsB,QAGrB;QACC,KAAK,CAAC,cAAc,QAAQ,CAAC,IAAI,+BAA+B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAJ/D,aAAQ,GAAR,QAAQ,CAG7B;QAXM,SAAI,GAAuD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9E,QAAG,GAAgB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAE5C,qCAAqC;QAC9B,aAAQ,GAAsB,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC3D,WAAM,GAAW,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,MAAM,CAAC;IAQvD,CAAC;IAEM,EAAE,CAAC,KAAgC;QACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAEM,MAAM,CAAC,OAA4D;QACxE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,E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ClB,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CACnB,gBAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,IAAI,QAAQ,CAAC,KAAK;YACvD,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO;YACxB,CAAC,CAAC,QAAQ,CAAC,KAAK,CACnB,CAAC;QAEF,OAAO,IAAI,eAAe,CAAC;YACzB,MAAM;YAEN,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,QAAQ,CAAC,GAAG;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AAvFD,0CAuFC"}
@@ -1,15 +1,11 @@
1
1
  import { ZodType } from 'zod/v3';
2
- import { IPipelineStepDefinition, IPipelineStepSource, PipelineStep, PipelineStepCompiler } from './model';
3
- import { IPipelineConfiguration, TPipelineContentPredicate } from '../types';
4
- import { TPipelineStepNestedHandler } from './types';
5
- import { PipelineParameters } from '../parameters';
6
- import { LlmProvider } from '../../llm/providers/model';
7
- interface IDefinition<TConfiguration extends IPipelineConfiguration> extends IPipelineStepDefinition {
8
- prompt: TPipelineContentPredicate | TPipelineStepNestedHandler<TConfiguration, TPipelineContentPredicate>;
9
- schema?: ZodType | TPipelineStepNestedHandler<TConfiguration, ZodType>;
10
- llm?: LlmProvider | TPipelineStepNestedHandler<TConfiguration, LlmProvider>;
11
- debug?: boolean;
12
- }
2
+ import { IPipelineStepSource, PipelineStep, PipelineStepCompiler } from '../model';
3
+ import { IPipelineConfiguration } from '../../types';
4
+ import { TPipelineStepNestedHandler } from '../types';
5
+ import { PipelineParameters } from '../../parameters';
6
+ import { IDefinition } from './types';
7
+ export * from './actions';
8
+ export * from './errors';
13
9
  export declare class PipelineAiStepCompiler<TConfiguration extends IPipelineConfiguration = any, TSchema = string> extends PipelineStepCompiler<TSchema> {
14
10
  protected definition: Partial<IDefinition<TConfiguration>>;
15
11
  private type;
@@ -29,5 +25,4 @@ export declare class PipelineAiStep<TConfiguration extends IPipelineConfiguratio
29
25
  run(parameters: PipelineParameters<TConfiguration>): Promise<TSchema>;
30
26
  private generate;
31
27
  }
32
- export {};
33
- //# sourceMappingURL=ai.d.ts.map
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAA6B,MAAM,aAAa,CAAC;AAGhF,OAAO,EAAE,0BAA0B,EAAqB,MAAM,UAAU,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,qBAAa,sBAAsB,CACjC,cAAc,SAAS,sBAAsB,GAAG,GAAG,EACnD,OAAO,GAAG,MAAM,CAChB,SAAQ,oBAAoB,CAAC,OAAO,CAAC;IAGzB,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAFtE,OAAO,CAAC,IAAI,CAA0C;gBAEhC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAItE,qCAAqC;IAC9B,MAAM,CAAC,CAAC,EAAE,OAAO,SAAS,sBAAsB,CAAC,cAAc,EAAE,CAAC,CAAC,EACxE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAC7E,OAAO;IAKV,8BAA8B;IACvB,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI;IAKrE,yBAAyB;IAClB,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;IAK/D,qGAAqG;IAC9F,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,QAAQ,EAAE,mBAAmB,GAAG,cAAc,CAAC,cAAc,EAAE,OAAO,CAAC;IAkBtF,MAAM,CAAC,KAAK,CAAC,cAAc,SAAS,sBAAsB,EAAE,OAAO,EACjE,KAAK,CAAC,EAAE,MAAM,GACb,sBAAsB,CAAC,cAAc,EAAE,OAAO,CAAC;CAGnD;AAED,qBAAa,cAAc,CACzB,cAAc,SAAS,sBAAsB,GAAG,GAAG,EACnD,OAAO,GAAG,GAAG,CACb,SAAQ,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACnE,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;YA2KpE,QAAQ;CAkSvB"}
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
3
17
  if (value !== null && value !== void 0) {
4
18
  if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
@@ -58,19 +72,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
58
72
  exports.PipelineAiStep = exports.PipelineAiStepCompiler = void 0;
59
73
  const lodash_1 = __importDefault(require("lodash"));
60
74
  const ai_1 = require("ai");
61
- const zocker_1 = require("zocker");
62
- const model_1 = require("./model");
63
- const utils_1 = require("../../../utils");
64
- const content_1 = require("../../content");
65
- const errors_1 = require("../errors");
66
- const vfs_1 = require("../../vfs");
67
- const llm_1 = require("../../llm");
68
- const file_1 = require("../../file");
69
- const renderDebugHeader = (title) => [
70
- '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
71
- title.toUpperCase().padStart(40, ' '),
72
- '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
73
- ].join('\n');
75
+ const model_1 = require("../model");
76
+ const actions_1 = require("./actions");
77
+ const content_1 = require("../../../content");
78
+ const utils_1 = require("../../../../utils");
79
+ const errors_1 = require("../../errors");
80
+ const vfs_1 = require("../../../vfs");
81
+ const llm_1 = require("../../../llm");
82
+ const errors_2 = require("./errors");
83
+ const utils_2 = require("./utils");
84
+ __exportStar(require("./actions"), exports);
85
+ __exportStar(require("./errors"), exports);
74
86
  class PipelineAiStepCompiler extends model_1.PipelineStepCompiler {
75
87
  constructor(definition) {
76
88
  super();
@@ -103,7 +115,7 @@ class PipelineAiStepCompiler extends model_1.PipelineStepCompiler {
103
115
  }
104
116
  return new PipelineAiStep(this.type, {
105
117
  title: this.definition.title,
106
- debug: this.definition.debug,
118
+ debug: this.definition.debug ?? provided.pipeline.debug,
107
119
  prompt: this.definition.prompt,
108
120
  schema: this.definition.schema,
109
121
  llm: this.definition.llm,
@@ -168,20 +180,18 @@ class PipelineAiStep extends model_1.PipelineStep {
168
180
  return tasks.push(...segment.payload);
169
181
  }
170
182
  if (content_1.ContentFactory.is('attachment', segment)) {
171
- if (segment.payload.isVirtual) {
172
- return vfs.register({
173
- title: segment.payload.title,
174
- path: segment.payload.path,
175
- content: segment.render(),
176
- });
177
- }
178
- return sources.push(...content_1.SourcesContent
179
- .build([{ location: segment.payload.path, title: segment.payload.title }])
180
- .serialize());
183
+ return vfs.register({
184
+ title: segment.payload.title,
185
+ key: segment.payload.key,
186
+ content: segment.render(),
187
+ });
181
188
  }
182
189
  });
183
- for (const file of vfs.values()) {
184
- sources.push(...content_1.SourcesContent.build([{ location: file.path, title: file.title }]).serialize());
190
+ if (articles.length) {
191
+ system.push(...articles);
192
+ }
193
+ if (rules.length) {
194
+ system.push(content_1.ArticleContent.build({ title: 'Rules', content: [{ ol: rules }] }).render());
185
195
  }
186
196
  if (llm.skills.length) {
187
197
  system.push(content_1.ArticleContent
@@ -194,26 +204,37 @@ class PipelineAiStep extends model_1.PipelineStep {
194
204
  if (sources.length) {
195
205
  system.push(content_1.ArticleContent
196
206
  .build({
197
- title: 'Sources. Read **ALL** the files below **(IMPORTANT: FOLLOW THE ORDER)**',
207
+ title: 'Sources. Read **ALL** the content below using `read` tool **(IMPORTANT: FOLLOW THE ORDER)**',
198
208
  content: [{ ol: sources }],
199
209
  })
200
210
  .render());
201
211
  }
202
- if (rules.length) {
203
- system.push(content_1.ArticleContent.build({ title: 'Rules', content: [{ ol: rules }] }).render());
204
- }
205
- if (articles.length) {
206
- system.push(...articles);
212
+ if (vfs.size) {
213
+ system.push(content_1.ArticleContent
214
+ .build({
215
+ title: 'Attachments. Read **ALL** the content below using `attachment` tool **(IMPORTANT: FOLLOW THE ORDER)**',
216
+ content: [{
217
+ ol: content_1.SourcesContent
218
+ .build([...vfs.values()].map((file) => ({ path: file.key, title: file.title })))
219
+ .serialize()
220
+ }],
221
+ })
222
+ .render());
207
223
  }
208
224
  if (tasks.length) {
209
225
  user.push(content_1.ArticleContent
210
- .build({ title: '**Task** (complete following list step by step)', content: [{ ol: tasks }] })
226
+ .build({
227
+ title: '**Task** (complete following list step by step)',
228
+ tag: 'h1',
229
+ content: [{ ol: tasks }]
230
+ })
211
231
  .render());
212
232
  }
213
233
  const tools = Object
214
- .entries(llm.skills.length
215
- ? Object.assign({}, llm.tools, { skill: llm_1.skill })
216
- : llm.tools)
234
+ .entries(Object.assign({}, llm.tools, {
235
+ ...(llm.skills.length && { skill: llm_1.skill }),
236
+ ...(vfs.size && { attachment: llm_1.attachment }),
237
+ }))
217
238
  .reduce((acc, [name, compiler]) => lodash_1.default.set(acc, name, compiler.compile(parameters.extend({ vfs, step: this }))), {});
218
239
  await Promise.all(mcp.entity.map(async (client) => Object
219
240
  .entries(await client.tools())
@@ -253,6 +274,7 @@ class PipelineAiStep extends model_1.PipelineStep {
253
274
  const actions = {
254
275
  sequence: (0, utils_1.cast)([]),
255
276
  map: (0, utils_1.cast)({}),
277
+ trace: (0, utils_1.cast)(undefined),
256
278
  };
257
279
  const info = provided.messages.info ?? content_1.ArticleContent
258
280
  .build({
@@ -275,54 +297,35 @@ class PipelineAiStep extends model_1.PipelineStep {
275
297
  },
276
298
  ];
277
299
  if (provided.messages.history?.length) {
278
- provided.messages.history.forEach((record) => messages.push({
279
- role: 'assistant',
280
- providerOptions: record.provider,
281
- content: record.actions.map((action) => {
282
- if (action.type === 'reasoning') {
283
- return {
284
- type: 'reasoning',
285
- text: action.text,
286
- providerOptions: action.provider,
287
- id: action.id,
288
- };
289
- }
290
- return {
291
- type: 'tool-call',
292
- providerOptions: action.provider,
293
- toolName: action.name,
294
- toolCallId: action.id,
295
- input: action.input.value,
296
- };
297
- }),
298
- }, {
299
- role: 'tool',
300
- providerOptions: record.provider,
301
- content: record.actions.filter((action) => action.type === 'tool').map((action) => ({
302
- type: 'tool-result',
303
- providerOptions: action.provider,
304
- toolCallId: action.id,
305
- toolName: action.name,
306
- output: {
307
- type: action.output.type === 'error' ? 'error-text' : action.output.type,
308
- value: action.output.value,
309
- },
310
- })),
311
- }));
300
+ provided.messages.history.forEach((record) => {
301
+ if (record.actions.every((action) => action instanceof actions_1.PipelineAiReasoningAction)) {
302
+ return messages.push({
303
+ role: 'assistant',
304
+ providerOptions: record.trace,
305
+ content: record.actions.map((action) => action.format()),
306
+ });
307
+ }
308
+ messages.push({
309
+ role: 'assistant',
310
+ providerOptions: record.trace,
311
+ content: record.actions.map((action) => action instanceof actions_1.PipelineAiReasoningAction
312
+ ? action.format()
313
+ : action.format('call-part')),
314
+ }, {
315
+ role: 'tool',
316
+ providerOptions: record.trace,
317
+ content: record.actions
318
+ .filter((action) => action instanceof actions_1.PipelineAiToolAction)
319
+ .map((action) => action.format('result-part')),
320
+ });
321
+ });
312
322
  }
313
323
  if (this.definition.debug) {
314
- const location = `${new Date().toLocaleTimeString()}-${this.pipeline.session.id}`;
315
- const title = this.trace().reverse().map((entity) => lodash_1.default.kebabCase(entity.title)).join('.');
316
- const file = await file_1.File.build(`.pipeline/${location}/${title}.md`);
317
- file.append([
318
- `${renderDebugHeader('tools')}\n`,
319
- ...Object
320
- .entries(provided.tools ?? {})
321
- .map(([name, tool]) => `# \`${name}\`\n\n${tool.description}\n\n---\n`)
322
- ].join('\n'));
323
- messages.forEach((message) => file.append([`${renderDebugHeader(message.role)}\n`, message.content].join('\n')));
324
- await file.write(file.content.trim());
325
- return provided.schema ? (0, zocker_1.zocker)(provided.schema).generate() : 'DEBUG AI OUTPUT';
324
+ return (0, utils_2.useStepDebug)(this, {
325
+ messages,
326
+ schema: provided.schema,
327
+ tools: provided.tools,
328
+ });
326
329
  }
327
330
  try {
328
331
  const stream = (0, ai_1.streamText)({
@@ -348,121 +351,76 @@ class PipelineAiStep extends model_1.PipelineStep {
348
351
  model: provided.llm.tag,
349
352
  tools: provided.tools,
350
353
  onError: () => undefined,
354
+ onFinish: ({ providerMetadata }) => {
355
+ actions.trace = providerMetadata;
356
+ },
351
357
  });
352
358
  for await (const fragment of stream.fullStream) {
353
- if (fragment.type === 'tool-call') {
354
- const action = {
355
- type: 'tool',
356
- meta: (0, utils_1.buildMetaManager)(),
357
- id: fragment.toolCallId,
358
- name: fragment.toolName,
359
- provider: fragment.providerMetadata,
360
- input: {
361
- preview: lodash_1.default.isObject(fragment.input) ? (0, utils_1.preview)(fragment.input) : String(fragment.input),
362
- value: fragment.input,
363
- },
364
- output: {
365
- type: 'text',
366
- value: undefined,
367
- },
368
- };
369
- actions.map[fragment.toolCallId] = action;
370
- this.pipeline.session.emit('step:llm:tool', {
371
- step: this,
372
- name: fragment.toolName,
373
- meta: action.meta.init(),
374
- message: action.input.preview,
375
- });
376
- }
377
- if (fragment.type === 'tool-result') {
378
- const action = actions.map[fragment.toolCallId];
379
- if (action?.type === 'tool') {
380
- if (fragment.providerMetadata) {
381
- action.provider = fragment.providerMetadata;
359
+ switch (fragment.type) {
360
+ case 'tool-call':
361
+ {
362
+ const action = actions_1.PipelineAiToolAction.build(this, fragment);
363
+ actions.map[action.id] = action;
364
+ this.pipeline.session.emit('step:ai:tool', action);
365
+ continue;
382
366
  }
383
- action.output = {
384
- type: lodash_1.default.isObject(fragment.output) ? 'json' : 'text',
385
- value: fragment.output,
386
- };
387
- actions.sequence.push(fragment.toolCallId);
388
- this.pipeline.session.emit('step:llm:tool', {
389
- step: this,
390
- name: fragment.toolName,
391
- meta: action.meta.done(),
392
- message: action.input.preview,
393
- });
394
- }
395
- }
396
- if (fragment.type === 'tool-error') {
397
- const action = actions.map[fragment.toolCallId];
398
- if (action?.type === 'tool') {
399
- if (fragment.providerMetadata) {
400
- action.provider = fragment.providerMetadata;
367
+ ;
368
+ case 'tool-result':
369
+ {
370
+ const action = actions.map[fragment.toolCallId];
371
+ if (action instanceof actions_1.PipelineAiToolAction) {
372
+ actions.sequence.push(action.id);
373
+ this.pipeline.session.emit('step:ai:tool', action.complete('DONE', fragment));
374
+ }
375
+ ;
376
+ continue;
401
377
  }
402
- action.output = {
403
- type: 'error',
404
- value: fragment.error instanceof Error ? fragment.error.message : String(fragment.error),
405
- };
406
- actions.sequence.push(fragment.toolCallId);
407
- this.pipeline.session.emit('step:llm:tool', {
408
- step: this,
409
- name: fragment.toolName,
410
- meta: action.meta.error(),
411
- message: action.input.preview,
412
- });
413
- }
414
- }
415
- if (fragment.type === 'reasoning-start') {
416
- const action = {
417
- type: 'reasoning',
418
- meta: (0, utils_1.buildMetaManager)(),
419
- id: fragment.id,
420
- provider: fragment.providerMetadata,
421
- text: '',
422
- };
423
- actions.map[fragment.id] = action;
424
- this.pipeline.session.emit('step:llm:reasoning', {
425
- step: this,
426
- meta: action.meta.init(),
427
- message: 'Thinking',
428
- });
429
- }
430
- if (fragment.type === 'reasoning-delta') {
431
- const action = actions.map[fragment.id];
432
- if (action?.type === 'reasoning') {
433
- if (fragment.providerMetadata) {
434
- action.provider = fragment.providerMetadata;
378
+ ;
379
+ case 'tool-error':
380
+ {
381
+ const action = actions.map[fragment.toolCallId];
382
+ if (action instanceof actions_1.PipelineAiToolAction) {
383
+ actions.sequence.push(action.id);
384
+ this.pipeline.session.emit('step:ai:tool', action.complete('ERROR', fragment));
385
+ }
386
+ ;
387
+ continue;
435
388
  }
436
- this.pipeline.session.emit('step:llm:reasoning', {
437
- step: this,
438
- meta: action.meta.pending(),
439
- message: fragment.text,
440
- });
441
- action.text += fragment.text;
442
- action.meta = (0, utils_1.buildMetaManager)();
443
- }
444
- }
445
- if (fragment.type === 'reasoning-end') {
446
- const action = actions.map[fragment.id];
447
- if (action?.type === 'reasoning') {
448
- if (fragment.providerMetadata) {
449
- action.provider = fragment.providerMetadata;
389
+ ;
390
+ case 'reasoning-start':
391
+ {
392
+ const action = actions_1.PipelineAiReasoningAction.build(this, fragment);
393
+ actions.map[action.id] = action;
394
+ this.pipeline.session.emit('step:ai:reasoning', action);
395
+ continue;
450
396
  }
451
- actions.sequence.push(fragment.id);
452
- this.pipeline.session.emit('step:llm:reasoning', {
453
- step: this,
454
- meta: action.meta.done(),
455
- message: action.text,
456
- });
457
- }
458
- }
459
- if (fragment.type === 'error' && fragment.error instanceof Error) {
460
- throw errors_1.PipelineAiError.convert({ error: fragment.error, llm: provided.llm });
397
+ ;
398
+ case 'reasoning-delta':
399
+ {
400
+ const action = actions.map[fragment.id];
401
+ if (action instanceof actions_1.PipelineAiReasoningAction) {
402
+ this.pipeline.session.emit('step:ai:reasoning', action.enrich(fragment));
403
+ }
404
+ ;
405
+ continue;
406
+ }
407
+ ;
408
+ case 'reasoning-end':
409
+ {
410
+ const action = actions.map[fragment.id];
411
+ if (action instanceof actions_1.PipelineAiReasoningAction) {
412
+ actions.sequence.push(action.id);
413
+ this.pipeline.session.emit('step:ai:reasoning', action.complete(fragment));
414
+ }
415
+ ;
416
+ continue;
417
+ }
418
+ ;
461
419
  }
462
420
  }
463
421
  const output = await stream.output;
464
422
  if (typeof output === 'string' && !output.length) {
465
- throw errors_1.PipelineAiError.build({ type: 'EMPTY_OUTPUT', llm: provided.llm });
423
+ throw errors_2.PipelineAiError.build({ type: 'EMPTY_OUTPUT', llm: provided.llm });
466
424
  }
467
425
  const usage = await stream.usage;
468
426
  if (usage.inputTokens) {
@@ -474,7 +432,7 @@ class PipelineAiStep extends model_1.PipelineStep {
474
432
  return output;
475
433
  }
476
434
  catch (error) {
477
- const converted = errors_1.PipelineAiError.convert({ error, llm: provided.llm });
435
+ const converted = errors_2.PipelineAiError.convert({ error, llm: provided.llm });
478
436
  if (actions.sequence.length) {
479
437
  converted.assign({ type: 'EMPTY_OUTPUT' });
480
438
  }
@@ -490,7 +448,7 @@ class PipelineAiStep extends model_1.PipelineStep {
490
448
  throw converted.assign({ sequence: errors.global });
491
449
  }
492
450
  if (fallback) {
493
- this.pipeline.session.emit('step:llm:fallback', {
451
+ this.pipeline.session.emit('step:ai:fallback', {
494
452
  reason: converted,
495
453
  step: this,
496
454
  providers: {
@@ -520,8 +478,8 @@ class PipelineAiStep extends model_1.PipelineStep {
520
478
  user: provided.messages.user,
521
479
  history: converted.is(['EMPTY_OUTPUT'])
522
480
  ? (provided.messages.history ?? []).concat({
523
- provider: Object.values(actions.map).find((action) => action.provider)?.provider,
524
481
  actions: actions.sequence.map((id) => actions.map[id]),
482
+ trace: actions.trace,
525
483
  })
526
484
  : provided.messages.history,
527
485
  ...(fallback?.strategy === 'restart' && {
@@ -534,4 +492,4 @@ class PipelineAiStep extends model_1.PipelineStep {
534
492
  }
535
493
  }
536
494
  exports.PipelineAiStep = PipelineAiStep;
537
- //# sourceMappingURL=ai.js.map
495
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AAEvB,2BAA8F;AAG9F,oCAAmF;AAEnF,uCAA4E;AAC5E,8CAAkF;AAElF,6CAAsE;AACtE,yCAA4D;AAE5D,sCAAiD;AACjD,sCAAiD;AACjD,qCAA2C;AAC3C,mCAAuC;AAIvC,4CAA0B;AAC1B,2CAAyB;AAEzB,MAAa,sBAGX,SAAQ,4BAA6B;IAGrC,YAAsB,UAAgD;QACpE,KAAK,EAAE,CAAC;QADY,eAAU,GAAV,UAAU,CAAsC;QAF9D,SAAI,GAAqC,IAAI,CAAC;IAItD,CAAC;IAED,qCAAqC;IAC9B,MAAM,CACX,SAA8E;QAE9E,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC;QACnC,OAAuB,IAAI,CAAC;IAC9B,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,SAAgD;QAC5D,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yBAAyB;IAClB,GAAG,CAAC,SAA6C;QACtD,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,qGAAqG;IAC9F,KAAK;QACV,IAAI,C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C,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;4BACtD,KAAK,EAAE,OAAO,CAAC,KAAK;yBACrB,CAAC;wBACF,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO;oBAE7B,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,IAAI;wBACtC,OAAO,EAAE,SAAS;wBAClB,IAAI,EAAE,SAAS;qBAChB,CAAC;iBACH;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAjdD,wCAidC"}
@@ -0,0 +1,12 @@
1
+ import type { ZodType } from 'zod/v3';
2
+ import type { IPipelineConfiguration, TPipelineContentPredicate } from '../../types';
3
+ import type { TPipelineStepNestedHandler } from '../types';
4
+ import type { IPipelineStepDefinition } from '../model';
5
+ import type { LlmProvider } from '../../../llm';
6
+ export interface IDefinition<TConfiguration extends IPipelineConfiguration> extends IPipelineStepDefinition {
7
+ prompt: TPipelineContentPredicate | TPipelineStepNestedHandler<TConfiguration, TPipelineContentPredicate>;
8
+ schema?: ZodType | TPipelineStepNestedHandler<TConfiguration, ZodType>;
9
+ llm?: LlmProvider | TPipelineStepNestedHandler<TConfiguration, LlmProvider>;
10
+ debug?: boolean;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,WAAW,CAAC,cAAc,SAAS,sBAAsB,CAAE,SAAQ,uBAAuB;IACzG,MAAM,EAAE,yBAAyB,GAAG,0BAA0B,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAC;IAE1G,MAAM,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACvE,GAAG,CAAC,EAAE,WAAW,GAAG,0BAA0B,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAE5E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ModelMessage, Tool } from 'ai';
2
+ import { ZodType } from 'zod/v3';
3
+ import type { PipelineAiStep } from './index';
4
+ export declare const useStepDebug: <TSchema>(step: PipelineAiStep, parameters: {
5
+ messages: ModelMessage[];
6
+ schema?: ZodType<TSchema>;
7
+ tools?: Record<string, Tool>;
8
+ }) => Promise<TSchema>;
9
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/models/pipeline/steps/ai/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAsC,IAAI,EAAE,MAAM,IAAI,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,OAAO,KAAK,EAA6B,cAAc,EAAwB,MAAM,SAAS,CAAC;AAS/F,eAAO,MAAM,YAAY,GAAU,OAAO,QAAQ,cAAc,cAAc;IAC5E,QAAQ,EAAE,YAAY,EAAE,CAAC;IAEzB,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC9B,KAAG,OAAO,CAAC,OAAO,CAwBlB,CAAA"}