@hilbras/omninode 0.5.2 → 0.7.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.
package/dist/index.d.ts CHANGED
@@ -27,6 +27,43 @@ interface Report {
27
27
  createdAt: string;
28
28
  metadata?: Record<string, unknown>;
29
29
  }
30
+ /** Source attribution for an aggregated finding (§17). */
31
+ interface FindingSource {
32
+ agent: string;
33
+ reportId: string;
34
+ }
35
+ interface AggregatedFinding {
36
+ title: string;
37
+ /** Distinct details contributed across reports. */
38
+ details: string[];
39
+ sources: FindingSource[];
40
+ /** How many reports reported this (or a similar) finding. */
41
+ occurrences: number;
42
+ /** Highest severity seen across merged duplicates. */
43
+ severity?: FindingSeverity;
44
+ evidence: string[];
45
+ }
46
+ interface AggregatedRecommendation {
47
+ text: string;
48
+ sources: FindingSource[];
49
+ occurrences: number;
50
+ }
51
+ /** Combined intelligence produced from several independent reports (§17). */
52
+ interface CombinedReport {
53
+ id: string;
54
+ title: string;
55
+ objective?: string;
56
+ pipelineRunId?: string;
57
+ taskIds: string[];
58
+ summary: string;
59
+ findings: AggregatedFinding[];
60
+ recommendations: AggregatedRecommendation[];
61
+ /** Distinct agent names that contributed. */
62
+ sources: string[];
63
+ reportIds: string[];
64
+ createdAt: string;
65
+ metadata?: Record<string, unknown>;
66
+ }
30
67
 
31
68
  /** Role system: what an AI is supposed to do, independent of any provider (§11). */
32
69
  interface RoleDefinition {
@@ -201,6 +238,8 @@ interface TaskResult {
201
238
  reportId?: string;
202
239
  /** Structured reports produced by protocol-mode agents (Phase 6 builds on this). */
203
240
  reports?: Report[];
241
+ /** Truncated verbatim agent output, kept for report extraction and audit. */
242
+ rawOutput?: string;
204
243
  error?: string;
205
244
  finishedAt?: string;
206
245
  }
@@ -219,7 +258,7 @@ interface Task {
219
258
  result?: TaskResult;
220
259
  }
221
260
 
222
- /** Pipeline engine: coordinating multiple AI operations (§14). */
261
+ /** Pipeline engine: coordinating multiple AI operations (§14, §15). */
223
262
 
224
263
  type PipelineStepKind = "research" | "collect" | "analyze" | "plan" | "execute" | "custom";
225
264
  type PipelineStepCondition = "always" | "on-success" | "on-failure";
@@ -228,8 +267,11 @@ interface PipelineStep {
228
267
  kind: PipelineStepKind;
229
268
  /** Agents fanned out for research steps. */
230
269
  agents?: string[];
231
- /** Model used for plan steps, e.g. "my-gateway:chatgpt". */
270
+ /** Single agent for analyze/execute/custom steps. */
271
+ agent?: string;
272
+ /** Model used for plan steps, as "provider:model-id". */
232
273
  model?: string;
274
+ /** Defaults to the previous step (implicit sequential chain). */
233
275
  dependsOn?: string[];
234
276
  condition?: PipelineStepCondition;
235
277
  retries?: number;
@@ -237,13 +279,19 @@ interface PipelineStep {
237
279
  interface PipelineDefinition {
238
280
  id: string;
239
281
  name?: string;
282
+ /** Default objective; can be overridden at run time. */
283
+ objective?: string;
284
+ /** Optional role applied to research/execute tasks. */
285
+ role?: string;
240
286
  steps: PipelineStep[];
241
287
  }
242
288
  type PipelineRunStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
243
289
  interface PipelineStepRun {
244
290
  stepId: string;
245
- taskId?: string;
246
291
  status: TaskStatus;
292
+ /** Tasks created for this step (research fans out to several). */
293
+ taskIds?: string[];
294
+ error?: string;
247
295
  }
248
296
  interface PipelineRun {
249
297
  id: string;
@@ -252,6 +300,10 @@ interface PipelineRun {
252
300
  startedAt?: string;
253
301
  finishedAt?: string;
254
302
  stepRuns: PipelineStepRun[];
303
+ /** Structured reports gathered across all steps (Phase 6 builds on this). */
304
+ reports?: Report[];
305
+ /** Set when the report system generated a combined report for this run. */
306
+ combinedReportId?: string;
255
307
  }
256
308
 
257
309
  /** Agent ↔ OmniNode communication protocol (§21). */
@@ -400,7 +452,7 @@ interface IChatProvider extends IProvider {
400
452
  }
401
453
 
402
454
  /** Typed error hierarchy shared across the whole codebase (§4.1 — error model). */
403
- type OmniNodeErrorCode = "CONFIG_NOT_FOUND" | "CONFIG_INVALID" | "PROVIDER_NOT_FOUND" | "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_FAILED" | "MODEL_NOT_FOUND" | "AGENT_NOT_FOUND" | "AGENT_FAILED" | "AGENT_TIMEOUT" | "TASK_INVALID" | "TASK_NOT_FOUND" | "TASK_FAILED" | "PIPELINE_INVALID" | "PIPELINE_FAILED" | "PROTOCOL_VIOLATION" | "MEMORY_UNAVAILABLE" | "NOT_IMPLEMENTED" | "CLI_USAGE" | "INTERNAL";
455
+ type OmniNodeErrorCode = "CONFIG_NOT_FOUND" | "CONFIG_INVALID" | "PROVIDER_NOT_FOUND" | "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_FAILED" | "MODEL_NOT_FOUND" | "AGENT_NOT_FOUND" | "AGENT_FAILED" | "AGENT_TIMEOUT" | "TASK_INVALID" | "TASK_NOT_FOUND" | "TASK_FAILED" | "PIPELINE_NOT_FOUND" | "PIPELINE_INVALID" | "PIPELINE_FAILED" | "PROTOCOL_VIOLATION" | "MEMORY_UNAVAILABLE" | "REPORT_NOT_FOUND" | "NOT_IMPLEMENTED" | "CLI_USAGE" | "INTERNAL";
404
456
  interface OmniNodeErrorOptions {
405
457
  cause?: unknown;
406
458
  details?: Record<string, unknown>;
@@ -423,7 +475,7 @@ declare class TaskError extends OmniNodeError {
423
475
  constructor(code: "TASK_INVALID" | "TASK_NOT_FOUND" | "TASK_FAILED", message: string, options?: OmniNodeErrorOptions);
424
476
  }
425
477
  declare class PipelineError extends OmniNodeError {
426
- constructor(code: "PIPELINE_INVALID" | "PIPELINE_FAILED", message: string, options?: OmniNodeErrorOptions);
478
+ constructor(code: "PIPELINE_NOT_FOUND" | "PIPELINE_INVALID" | "PIPELINE_FAILED", message: string, options?: OmniNodeErrorOptions);
427
479
  }
428
480
  declare class ProtocolError extends OmniNodeError {
429
481
  constructor(message: string, options?: OmniNodeErrorOptions);
@@ -558,6 +610,98 @@ declare const roleConfigSchema: z.ZodObject<{
558
610
  preferred_agents?: string[] | undefined;
559
611
  system_prompt?: string | undefined;
560
612
  }>;
613
+ declare const pipelineStepConfigSchema: z.ZodObject<{
614
+ id: z.ZodString;
615
+ kind: z.ZodEnum<["research", "collect", "analyze", "plan", "execute", "custom"]>;
616
+ agents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
617
+ agent: z.ZodOptional<z.ZodString>;
618
+ model: z.ZodOptional<z.ZodString>;
619
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
620
+ retries: z.ZodOptional<z.ZodNumber>;
621
+ condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
622
+ }, "strict", z.ZodTypeAny, {
623
+ id: string;
624
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
625
+ agents?: string[] | undefined;
626
+ agent?: string | undefined;
627
+ model?: string | undefined;
628
+ depends_on?: string[] | undefined;
629
+ retries?: number | undefined;
630
+ condition?: "always" | "on-success" | "on-failure" | undefined;
631
+ }, {
632
+ id: string;
633
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
634
+ agents?: string[] | undefined;
635
+ agent?: string | undefined;
636
+ model?: string | undefined;
637
+ depends_on?: string[] | undefined;
638
+ retries?: number | undefined;
639
+ condition?: "always" | "on-success" | "on-failure" | undefined;
640
+ }>;
641
+ declare const pipelineConfigSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ name: z.ZodOptional<z.ZodString>;
644
+ objective: z.ZodOptional<z.ZodString>;
645
+ role: z.ZodOptional<z.ZodString>;
646
+ steps: z.ZodArray<z.ZodObject<{
647
+ id: z.ZodString;
648
+ kind: z.ZodEnum<["research", "collect", "analyze", "plan", "execute", "custom"]>;
649
+ agents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
650
+ agent: z.ZodOptional<z.ZodString>;
651
+ model: z.ZodOptional<z.ZodString>;
652
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
653
+ retries: z.ZodOptional<z.ZodNumber>;
654
+ condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
655
+ }, "strict", z.ZodTypeAny, {
656
+ id: string;
657
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
658
+ agents?: string[] | undefined;
659
+ agent?: string | undefined;
660
+ model?: string | undefined;
661
+ depends_on?: string[] | undefined;
662
+ retries?: number | undefined;
663
+ condition?: "always" | "on-success" | "on-failure" | undefined;
664
+ }, {
665
+ id: string;
666
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
667
+ agents?: string[] | undefined;
668
+ agent?: string | undefined;
669
+ model?: string | undefined;
670
+ depends_on?: string[] | undefined;
671
+ retries?: number | undefined;
672
+ condition?: "always" | "on-success" | "on-failure" | undefined;
673
+ }>, "many">;
674
+ }, "strict", z.ZodTypeAny, {
675
+ id: string;
676
+ steps: {
677
+ id: string;
678
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
679
+ agents?: string[] | undefined;
680
+ agent?: string | undefined;
681
+ model?: string | undefined;
682
+ depends_on?: string[] | undefined;
683
+ retries?: number | undefined;
684
+ condition?: "always" | "on-success" | "on-failure" | undefined;
685
+ }[];
686
+ role?: string | undefined;
687
+ name?: string | undefined;
688
+ objective?: string | undefined;
689
+ }, {
690
+ id: string;
691
+ steps: {
692
+ id: string;
693
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
694
+ agents?: string[] | undefined;
695
+ agent?: string | undefined;
696
+ model?: string | undefined;
697
+ depends_on?: string[] | undefined;
698
+ retries?: number | undefined;
699
+ condition?: "always" | "on-success" | "on-failure" | undefined;
700
+ }[];
701
+ role?: string | undefined;
702
+ name?: string | undefined;
703
+ objective?: string | undefined;
704
+ }>;
561
705
  declare const projectConfigSchema: z.ZodObject<{
562
706
  name: z.ZodString;
563
707
  providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -645,6 +789,70 @@ declare const projectConfigSchema: z.ZodObject<{
645
789
  preferred_agents?: string[] | undefined;
646
790
  system_prompt?: string | undefined;
647
791
  }>, "many">>;
792
+ pipelines: z.ZodDefault<z.ZodArray<z.ZodObject<{
793
+ id: z.ZodString;
794
+ name: z.ZodOptional<z.ZodString>;
795
+ objective: z.ZodOptional<z.ZodString>;
796
+ role: z.ZodOptional<z.ZodString>;
797
+ steps: z.ZodArray<z.ZodObject<{
798
+ id: z.ZodString;
799
+ kind: z.ZodEnum<["research", "collect", "analyze", "plan", "execute", "custom"]>;
800
+ agents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
801
+ agent: z.ZodOptional<z.ZodString>;
802
+ model: z.ZodOptional<z.ZodString>;
803
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
804
+ retries: z.ZodOptional<z.ZodNumber>;
805
+ condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
806
+ }, "strict", z.ZodTypeAny, {
807
+ id: string;
808
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
809
+ agents?: string[] | undefined;
810
+ agent?: string | undefined;
811
+ model?: string | undefined;
812
+ depends_on?: string[] | undefined;
813
+ retries?: number | undefined;
814
+ condition?: "always" | "on-success" | "on-failure" | undefined;
815
+ }, {
816
+ id: string;
817
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
818
+ agents?: string[] | undefined;
819
+ agent?: string | undefined;
820
+ model?: string | undefined;
821
+ depends_on?: string[] | undefined;
822
+ retries?: number | undefined;
823
+ condition?: "always" | "on-success" | "on-failure" | undefined;
824
+ }>, "many">;
825
+ }, "strict", z.ZodTypeAny, {
826
+ id: string;
827
+ steps: {
828
+ id: string;
829
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
830
+ agents?: string[] | undefined;
831
+ agent?: string | undefined;
832
+ model?: string | undefined;
833
+ depends_on?: string[] | undefined;
834
+ retries?: number | undefined;
835
+ condition?: "always" | "on-success" | "on-failure" | undefined;
836
+ }[];
837
+ role?: string | undefined;
838
+ name?: string | undefined;
839
+ objective?: string | undefined;
840
+ }, {
841
+ id: string;
842
+ steps: {
843
+ id: string;
844
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
845
+ agents?: string[] | undefined;
846
+ agent?: string | undefined;
847
+ model?: string | undefined;
848
+ depends_on?: string[] | undefined;
849
+ retries?: number | undefined;
850
+ condition?: "always" | "on-success" | "on-failure" | undefined;
851
+ }[];
852
+ role?: string | undefined;
853
+ name?: string | undefined;
854
+ objective?: string | undefined;
855
+ }>, "many">>;
648
856
  memory: z.ZodOptional<z.ZodObject<{
649
857
  provider: z.ZodString;
650
858
  }, "strict", z.ZodTypeAny, {
@@ -654,15 +862,6 @@ declare const projectConfigSchema: z.ZodObject<{
654
862
  }>>;
655
863
  }, "strict", z.ZodTypeAny, {
656
864
  name: string;
657
- providers: {
658
- name: string;
659
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
660
- base_url: string;
661
- api_key_env_var?: string | undefined;
662
- headers?: Record<string, string> | undefined;
663
- enabled?: boolean | undefined;
664
- metadata?: Record<string, unknown> | undefined;
665
- }[];
666
865
  agents: {
667
866
  name: string;
668
867
  type: "native" | "process" | "cli";
@@ -674,6 +873,15 @@ declare const projectConfigSchema: z.ZodObject<{
674
873
  env?: Record<string, string> | undefined;
675
874
  timeout_ms?: number | undefined;
676
875
  }[];
876
+ providers: {
877
+ name: string;
878
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
879
+ base_url: string;
880
+ api_key_env_var?: string | undefined;
881
+ headers?: Record<string, string> | undefined;
882
+ enabled?: boolean | undefined;
883
+ metadata?: Record<string, unknown> | undefined;
884
+ }[];
677
885
  roles: {
678
886
  name: string;
679
887
  id: string;
@@ -684,20 +892,27 @@ declare const projectConfigSchema: z.ZodObject<{
684
892
  preferred_agents?: string[] | undefined;
685
893
  system_prompt?: string | undefined;
686
894
  }[];
895
+ pipelines: {
896
+ id: string;
897
+ steps: {
898
+ id: string;
899
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
900
+ agents?: string[] | undefined;
901
+ agent?: string | undefined;
902
+ model?: string | undefined;
903
+ depends_on?: string[] | undefined;
904
+ retries?: number | undefined;
905
+ condition?: "always" | "on-success" | "on-failure" | undefined;
906
+ }[];
907
+ role?: string | undefined;
908
+ name?: string | undefined;
909
+ objective?: string | undefined;
910
+ }[];
687
911
  memory?: {
688
912
  provider: string;
689
913
  } | undefined;
690
914
  }, {
691
915
  name: string;
692
- providers?: {
693
- name: string;
694
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
695
- base_url: string;
696
- api_key_env_var?: string | undefined;
697
- headers?: Record<string, string> | undefined;
698
- enabled?: boolean | undefined;
699
- metadata?: Record<string, unknown> | undefined;
700
- }[] | undefined;
701
916
  agents?: {
702
917
  name: string;
703
918
  type?: "native" | "process" | "cli" | undefined;
@@ -709,6 +924,15 @@ declare const projectConfigSchema: z.ZodObject<{
709
924
  input_mode?: "stdin" | "arg" | "protocol" | undefined;
710
925
  timeout_ms?: number | undefined;
711
926
  }[] | undefined;
927
+ providers?: {
928
+ name: string;
929
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
930
+ base_url: string;
931
+ api_key_env_var?: string | undefined;
932
+ headers?: Record<string, string> | undefined;
933
+ enabled?: boolean | undefined;
934
+ metadata?: Record<string, unknown> | undefined;
935
+ }[] | undefined;
712
936
  roles?: {
713
937
  name: string;
714
938
  id: string;
@@ -719,6 +943,22 @@ declare const projectConfigSchema: z.ZodObject<{
719
943
  preferred_agents?: string[] | undefined;
720
944
  system_prompt?: string | undefined;
721
945
  }[] | undefined;
946
+ pipelines?: {
947
+ id: string;
948
+ steps: {
949
+ id: string;
950
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
951
+ agents?: string[] | undefined;
952
+ agent?: string | undefined;
953
+ model?: string | undefined;
954
+ depends_on?: string[] | undefined;
955
+ retries?: number | undefined;
956
+ condition?: "always" | "on-success" | "on-failure" | undefined;
957
+ }[];
958
+ role?: string | undefined;
959
+ name?: string | undefined;
960
+ objective?: string | undefined;
961
+ }[] | undefined;
722
962
  memory?: {
723
963
  provider: string;
724
964
  } | undefined;
@@ -811,6 +1051,70 @@ declare const appConfigSchema: z.ZodObject<{
811
1051
  preferred_agents?: string[] | undefined;
812
1052
  system_prompt?: string | undefined;
813
1053
  }>, "many">>;
1054
+ pipelines: z.ZodDefault<z.ZodArray<z.ZodObject<{
1055
+ id: z.ZodString;
1056
+ name: z.ZodOptional<z.ZodString>;
1057
+ objective: z.ZodOptional<z.ZodString>;
1058
+ role: z.ZodOptional<z.ZodString>;
1059
+ steps: z.ZodArray<z.ZodObject<{
1060
+ id: z.ZodString;
1061
+ kind: z.ZodEnum<["research", "collect", "analyze", "plan", "execute", "custom"]>;
1062
+ agents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1063
+ agent: z.ZodOptional<z.ZodString>;
1064
+ model: z.ZodOptional<z.ZodString>;
1065
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1066
+ retries: z.ZodOptional<z.ZodNumber>;
1067
+ condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
1068
+ }, "strict", z.ZodTypeAny, {
1069
+ id: string;
1070
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1071
+ agents?: string[] | undefined;
1072
+ agent?: string | undefined;
1073
+ model?: string | undefined;
1074
+ depends_on?: string[] | undefined;
1075
+ retries?: number | undefined;
1076
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1077
+ }, {
1078
+ id: string;
1079
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1080
+ agents?: string[] | undefined;
1081
+ agent?: string | undefined;
1082
+ model?: string | undefined;
1083
+ depends_on?: string[] | undefined;
1084
+ retries?: number | undefined;
1085
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1086
+ }>, "many">;
1087
+ }, "strict", z.ZodTypeAny, {
1088
+ id: string;
1089
+ steps: {
1090
+ id: string;
1091
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1092
+ agents?: string[] | undefined;
1093
+ agent?: string | undefined;
1094
+ model?: string | undefined;
1095
+ depends_on?: string[] | undefined;
1096
+ retries?: number | undefined;
1097
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1098
+ }[];
1099
+ role?: string | undefined;
1100
+ name?: string | undefined;
1101
+ objective?: string | undefined;
1102
+ }, {
1103
+ id: string;
1104
+ steps: {
1105
+ id: string;
1106
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1107
+ agents?: string[] | undefined;
1108
+ agent?: string | undefined;
1109
+ model?: string | undefined;
1110
+ depends_on?: string[] | undefined;
1111
+ retries?: number | undefined;
1112
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1113
+ }[];
1114
+ role?: string | undefined;
1115
+ name?: string | undefined;
1116
+ objective?: string | undefined;
1117
+ }>, "many">>;
814
1118
  memory: z.ZodOptional<z.ZodObject<{
815
1119
  provider: z.ZodString;
816
1120
  }, "strict", z.ZodTypeAny, {
@@ -820,15 +1124,6 @@ declare const appConfigSchema: z.ZodObject<{
820
1124
  }>>;
821
1125
  }, "strict", z.ZodTypeAny, {
822
1126
  name: string;
823
- providers: {
824
- name: string;
825
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
826
- base_url: string;
827
- api_key_env_var?: string | undefined;
828
- headers?: Record<string, string> | undefined;
829
- enabled?: boolean | undefined;
830
- metadata?: Record<string, unknown> | undefined;
831
- }[];
832
1127
  agents: {
833
1128
  name: string;
834
1129
  type: "native" | "process" | "cli";
@@ -840,6 +1135,15 @@ declare const appConfigSchema: z.ZodObject<{
840
1135
  env?: Record<string, string> | undefined;
841
1136
  timeout_ms?: number | undefined;
842
1137
  }[];
1138
+ providers: {
1139
+ name: string;
1140
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
1141
+ base_url: string;
1142
+ api_key_env_var?: string | undefined;
1143
+ headers?: Record<string, string> | undefined;
1144
+ enabled?: boolean | undefined;
1145
+ metadata?: Record<string, unknown> | undefined;
1146
+ }[];
843
1147
  roles: {
844
1148
  name: string;
845
1149
  id: string;
@@ -850,20 +1154,27 @@ declare const appConfigSchema: z.ZodObject<{
850
1154
  preferred_agents?: string[] | undefined;
851
1155
  system_prompt?: string | undefined;
852
1156
  }[];
1157
+ pipelines: {
1158
+ id: string;
1159
+ steps: {
1160
+ id: string;
1161
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1162
+ agents?: string[] | undefined;
1163
+ agent?: string | undefined;
1164
+ model?: string | undefined;
1165
+ depends_on?: string[] | undefined;
1166
+ retries?: number | undefined;
1167
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1168
+ }[];
1169
+ role?: string | undefined;
1170
+ name?: string | undefined;
1171
+ objective?: string | undefined;
1172
+ }[];
853
1173
  memory?: {
854
1174
  provider: string;
855
1175
  } | undefined;
856
1176
  }, {
857
1177
  name: string;
858
- providers?: {
859
- name: string;
860
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
861
- base_url: string;
862
- api_key_env_var?: string | undefined;
863
- headers?: Record<string, string> | undefined;
864
- enabled?: boolean | undefined;
865
- metadata?: Record<string, unknown> | undefined;
866
- }[] | undefined;
867
1178
  agents?: {
868
1179
  name: string;
869
1180
  type?: "native" | "process" | "cli" | undefined;
@@ -875,6 +1186,15 @@ declare const appConfigSchema: z.ZodObject<{
875
1186
  input_mode?: "stdin" | "arg" | "protocol" | undefined;
876
1187
  timeout_ms?: number | undefined;
877
1188
  }[] | undefined;
1189
+ providers?: {
1190
+ name: string;
1191
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
1192
+ base_url: string;
1193
+ api_key_env_var?: string | undefined;
1194
+ headers?: Record<string, string> | undefined;
1195
+ enabled?: boolean | undefined;
1196
+ metadata?: Record<string, unknown> | undefined;
1197
+ }[] | undefined;
878
1198
  roles?: {
879
1199
  name: string;
880
1200
  id: string;
@@ -885,6 +1205,22 @@ declare const appConfigSchema: z.ZodObject<{
885
1205
  preferred_agents?: string[] | undefined;
886
1206
  system_prompt?: string | undefined;
887
1207
  }[] | undefined;
1208
+ pipelines?: {
1209
+ id: string;
1210
+ steps: {
1211
+ id: string;
1212
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1213
+ agents?: string[] | undefined;
1214
+ agent?: string | undefined;
1215
+ model?: string | undefined;
1216
+ depends_on?: string[] | undefined;
1217
+ retries?: number | undefined;
1218
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1219
+ }[];
1220
+ role?: string | undefined;
1221
+ name?: string | undefined;
1222
+ objective?: string | undefined;
1223
+ }[] | undefined;
888
1224
  memory?: {
889
1225
  provider: string;
890
1226
  } | undefined;
@@ -899,15 +1235,6 @@ declare const appConfigSchema: z.ZodObject<{
899
1235
  }, "strict", z.ZodTypeAny, {
900
1236
  project: {
901
1237
  name: string;
902
- providers: {
903
- name: string;
904
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
905
- base_url: string;
906
- api_key_env_var?: string | undefined;
907
- headers?: Record<string, string> | undefined;
908
- enabled?: boolean | undefined;
909
- metadata?: Record<string, unknown> | undefined;
910
- }[];
911
1238
  agents: {
912
1239
  name: string;
913
1240
  type: "native" | "process" | "cli";
@@ -919,6 +1246,15 @@ declare const appConfigSchema: z.ZodObject<{
919
1246
  env?: Record<string, string> | undefined;
920
1247
  timeout_ms?: number | undefined;
921
1248
  }[];
1249
+ providers: {
1250
+ name: string;
1251
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
1252
+ base_url: string;
1253
+ api_key_env_var?: string | undefined;
1254
+ headers?: Record<string, string> | undefined;
1255
+ enabled?: boolean | undefined;
1256
+ metadata?: Record<string, unknown> | undefined;
1257
+ }[];
922
1258
  roles: {
923
1259
  name: string;
924
1260
  id: string;
@@ -929,6 +1265,22 @@ declare const appConfigSchema: z.ZodObject<{
929
1265
  preferred_agents?: string[] | undefined;
930
1266
  system_prompt?: string | undefined;
931
1267
  }[];
1268
+ pipelines: {
1269
+ id: string;
1270
+ steps: {
1271
+ id: string;
1272
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1273
+ agents?: string[] | undefined;
1274
+ agent?: string | undefined;
1275
+ model?: string | undefined;
1276
+ depends_on?: string[] | undefined;
1277
+ retries?: number | undefined;
1278
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1279
+ }[];
1280
+ role?: string | undefined;
1281
+ name?: string | undefined;
1282
+ objective?: string | undefined;
1283
+ }[];
932
1284
  memory?: {
933
1285
  provider: string;
934
1286
  } | undefined;
@@ -939,15 +1291,6 @@ declare const appConfigSchema: z.ZodObject<{
939
1291
  }, {
940
1292
  project: {
941
1293
  name: string;
942
- providers?: {
943
- name: string;
944
- type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
945
- base_url: string;
946
- api_key_env_var?: string | undefined;
947
- headers?: Record<string, string> | undefined;
948
- enabled?: boolean | undefined;
949
- metadata?: Record<string, unknown> | undefined;
950
- }[] | undefined;
951
1294
  agents?: {
952
1295
  name: string;
953
1296
  type?: "native" | "process" | "cli" | undefined;
@@ -959,6 +1302,15 @@ declare const appConfigSchema: z.ZodObject<{
959
1302
  input_mode?: "stdin" | "arg" | "protocol" | undefined;
960
1303
  timeout_ms?: number | undefined;
961
1304
  }[] | undefined;
1305
+ providers?: {
1306
+ name: string;
1307
+ type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
1308
+ base_url: string;
1309
+ api_key_env_var?: string | undefined;
1310
+ headers?: Record<string, string> | undefined;
1311
+ enabled?: boolean | undefined;
1312
+ metadata?: Record<string, unknown> | undefined;
1313
+ }[] | undefined;
962
1314
  roles?: {
963
1315
  name: string;
964
1316
  id: string;
@@ -969,6 +1321,22 @@ declare const appConfigSchema: z.ZodObject<{
969
1321
  preferred_agents?: string[] | undefined;
970
1322
  system_prompt?: string | undefined;
971
1323
  }[] | undefined;
1324
+ pipelines?: {
1325
+ id: string;
1326
+ steps: {
1327
+ id: string;
1328
+ kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
1329
+ agents?: string[] | undefined;
1330
+ agent?: string | undefined;
1331
+ model?: string | undefined;
1332
+ depends_on?: string[] | undefined;
1333
+ retries?: number | undefined;
1334
+ condition?: "always" | "on-success" | "on-failure" | undefined;
1335
+ }[];
1336
+ role?: string | undefined;
1337
+ name?: string | undefined;
1338
+ objective?: string | undefined;
1339
+ }[] | undefined;
972
1340
  memory?: {
973
1341
  provider: string;
974
1342
  } | undefined;
@@ -980,6 +1348,8 @@ declare const appConfigSchema: z.ZodObject<{
980
1348
  type ProviderConfigYaml = z.infer<typeof providerConfigSchema>;
981
1349
  type AgentConfigYaml = z.infer<typeof agentConfigSchema>;
982
1350
  type RoleConfigYaml = z.infer<typeof roleConfigSchema>;
1351
+ type PipelineConfigYaml = z.infer<typeof pipelineConfigSchema>;
1352
+ type PipelineStepConfigYaml = z.infer<typeof pipelineStepConfigSchema>;
983
1353
  type ProjectConfigYaml = z.infer<typeof projectConfigSchema>;
984
1354
  type AppConfigYaml = z.infer<typeof appConfigSchema>;
985
1355
 
@@ -989,6 +1359,7 @@ interface AppConfig {
989
1359
  providers: ProviderConfig[];
990
1360
  agents: AgentConfig[];
991
1361
  roles: RoleDefinition[];
1362
+ pipelines: PipelineDefinition[];
992
1363
  memory?: {
993
1364
  provider: string;
994
1365
  };
@@ -1143,10 +1514,16 @@ interface TaskStore {
1143
1514
  }
1144
1515
  declare class FileTaskStore implements TaskStore {
1145
1516
  private readonly filePath;
1517
+ /**
1518
+ * Read-modify-write operations are serialized: parallel pipeline tasks
1519
+ * would otherwise race on the JSON file (last writer wins).
1520
+ */
1521
+ private queue;
1146
1522
  constructor(directory?: string);
1147
1523
  save(task: Task): Promise<void>;
1148
1524
  get(id: string): Promise<Task | undefined>;
1149
1525
  list(filter?: TaskStoreFilter): Promise<Task[]>;
1526
+ private synchronized;
1150
1527
  private load;
1151
1528
  private write;
1152
1529
  }
@@ -1184,6 +1561,114 @@ declare class TaskEngine {
1184
1561
 
1185
1562
  declare function createTaskEngine(config: AppConfig, log?: Logger, directory?: string): TaskEngine;
1186
1563
 
1187
- declare const OMNINODE_VERSION = "0.5.2";
1564
+ interface ReportFilter {
1565
+ taskId?: string;
1566
+ agent?: string;
1567
+ }
1568
+ interface CombinedReportFilter {
1569
+ pipelineRunId?: string;
1570
+ }
1571
+ interface ReportStore {
1572
+ saveReports(reports: Report[]): Promise<void>;
1573
+ listReports(filter?: ReportFilter): Promise<Report[]>;
1574
+ saveCombined(combined: CombinedReport): Promise<void>;
1575
+ getCombined(id: string): Promise<CombinedReport | undefined>;
1576
+ listCombined(filter?: CombinedReportFilter): Promise<CombinedReport[]>;
1577
+ }
1578
+
1579
+ /**
1580
+ * Report service (§16–§17): collects reports from finished tasks (structured
1581
+ * protocol reports when present, extraction from text otherwise), persists
1582
+ * them with source attribution and generates combined reports.
1583
+ */
1584
+
1585
+ interface CombinedMeta {
1586
+ objective?: string;
1587
+ pipelineRunId?: string;
1588
+ taskIds?: string[];
1589
+ }
1590
+ declare class ReportService {
1591
+ private readonly store;
1592
+ private readonly log;
1593
+ constructor(store: ReportStore, log?: Logger);
1594
+ get storeRef(): ReportStore;
1595
+ /** Normalizes finished tasks into reports (§17 — normalizer). */
1596
+ collectFromTasks(tasks: Task[]): Promise<Report[]>;
1597
+ saveReports(reports: Report[]): Promise<void>;
1598
+ generateCombined(reports: Report[], meta?: CombinedMeta): Promise<CombinedReport | undefined>;
1599
+ }
1600
+
1601
+ interface PipelineRunFilter {
1602
+ pipelineId?: string;
1603
+ status?: PipelineRunStatus;
1604
+ }
1605
+ interface PipelineRunStore {
1606
+ save(run: PipelineRun): Promise<void>;
1607
+ get(id: string): Promise<PipelineRun | undefined>;
1608
+ list(filter?: PipelineRunFilter): Promise<PipelineRun[]>;
1609
+ }
1610
+ declare class FilePipelineRunStore implements PipelineRunStore {
1611
+ private readonly filePath;
1612
+ private queue;
1613
+ constructor(directory?: string);
1614
+ save(run: PipelineRun): Promise<void>;
1615
+ get(id: string): Promise<PipelineRun | undefined>;
1616
+ list(filter?: PipelineRunFilter): Promise<PipelineRun[]>;
1617
+ private synchronized;
1618
+ private load;
1619
+ private write;
1620
+ }
1621
+
1622
+ type ChatFn = (modelRef: string, messages: ChatMessage[]) => Promise<string>;
1623
+ interface PipelineEngineOptions {
1624
+ tasks: TaskEngine;
1625
+ agents: AgentRegistry;
1626
+ roles: RoleRegistry;
1627
+ providers: AppConfig["project"]["providers"];
1628
+ store: PipelineRunStore;
1629
+ chat?: ChatFn;
1630
+ /** When present, finished runs have their reports collected, stored and combined (§16–§17). */
1631
+ reports?: ReportService;
1632
+ log?: Logger;
1633
+ }
1634
+ interface RunPipelineOptions {
1635
+ objective?: string;
1636
+ onStep?: (stepRun: PipelineStepRun) => void;
1637
+ }
1638
+ declare class PipelineEngine {
1639
+ private readonly options;
1640
+ private readonly log;
1641
+ constructor(options: PipelineEngineOptions);
1642
+ get store(): PipelineRunStore;
1643
+ /** Structural + semantic validation (§27 Phase 5 — pipeline parser). */
1644
+ validate(def: PipelineDefinition): void;
1645
+ private assertAcyclic;
1646
+ /**
1647
+ * Steps run sequentially in definition order unless they declare explicit
1648
+ * dependencies, which enable parallel branches.
1649
+ */
1650
+ private effectiveDependencies;
1651
+ run(def: PipelineDefinition, options?: RunPipelineOptions): Promise<PipelineRun>;
1652
+ get(runId: string): Promise<PipelineRun | undefined>;
1653
+ listRuns(filter?: {
1654
+ pipelineId?: string;
1655
+ }): Promise<PipelineRun[]>;
1656
+ private shouldRun;
1657
+ private executeStep;
1658
+ private executeStepOnce;
1659
+ /** Research fan-out: one task per agent, in parallel (§15). */
1660
+ private runFanOut;
1661
+ private runSingle;
1662
+ private runPlan;
1663
+ private getChat;
1664
+ }
1665
+ /** Default chat function: resolves "provider:model" against the configured providers. */
1666
+ declare function createDefaultChatFn(providers: AppConfig["project"]["providers"]): ChatFn;
1667
+
1668
+ /** Assembles a PipelineEngine from the project configuration (local-first defaults). */
1669
+
1670
+ declare function buildPipelineEngine(config: AppConfig, log?: Logger): PipelineEngine;
1671
+
1672
+ declare const OMNINODE_VERSION = "0.7.0";
1188
1673
 
1189
- export { type AgentConfig, type AgentConfigYaml, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AppConfig, type AppConfigYaml, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatUsage, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type DiscoveryResult, type EnvelopeMeta, FileTaskStore, type Finding, type FindingSeverity, type HttpRequestOptions, type HttpResponse, type IAgent, type IChatProvider, type IMemoryProvider, type IProvider, type LoadConfigOptions, type LogLevel, type LogSink, Logger, type LoggerOptions, type MemoryEntry, MemoryError, type MemoryQuery, type MemoryScope, type MessageEnvelope, type ModelCapabilities, type ModelFilter, type ModelInfo, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, type OmniHilbrasConnectionResult, OmniHilbrasProvider, OmniNodeError, type OmniNodeErrorCode, type OmniNodeErrorOptions, OpenAICompatibleProvider, type PipelineDefinition, PipelineError, type PipelineRun, type PipelineRunStatus, type PipelineStep, type PipelineStepCondition, type PipelineStepKind, type PipelineStepRun, ProcessAgent, type Project, type ProjectConfigYaml, ProtocolError, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderHealth, type ProviderStatus, type ProviderType, type Report, type RoleConfigYaml, type RoleDefinition, RoleRegistry, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, type WritableLike, agentConfigSchema, appConfigSchema, authHeaders, buildAgentRegistry, buildRoleRegistry, composeTaskText, createAgent, createProvider, createTaskEngine, defaultProjectConfigYaml, expandEnvRefs, findConfigFile, isOmniNodeError, loadConfig, logger, projectConfigSchema, providerConfigSchema, registryKey, requestJson, resolveApiKey, roleConfigSchema };
1674
+ export { type AgentConfig, type AgentConfigYaml, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type AppConfigYaml, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatUsage, type CombinedReport, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type DiscoveryResult, type EnvelopeMeta, FilePipelineRunStore, FileTaskStore, type Finding, type FindingSeverity, type FindingSource, type HttpRequestOptions, type HttpResponse, type IAgent, type IChatProvider, type IMemoryProvider, type IProvider, type LoadConfigOptions, type LogLevel, type LogSink, Logger, type LoggerOptions, type MemoryEntry, MemoryError, type MemoryQuery, type MemoryScope, type MessageEnvelope, type ModelCapabilities, type ModelFilter, type ModelInfo, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, type OmniHilbrasConnectionResult, OmniHilbrasProvider, OmniNodeError, type OmniNodeErrorCode, type OmniNodeErrorOptions, OpenAICompatibleProvider, type PipelineConfigYaml, type PipelineDefinition, PipelineEngine, type PipelineEngineOptions, PipelineError, type PipelineRun, type PipelineRunFilter, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepConfigYaml, type PipelineStepKind, type PipelineStepRun, ProcessAgent, type Project, type ProjectConfigYaml, ProtocolError, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderHealth, type ProviderStatus, type ProviderType, type Report, type RoleConfigYaml, type RoleDefinition, RoleRegistry, type RunPipelineOptions, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, type WritableLike, agentConfigSchema, appConfigSchema, authHeaders, buildAgentRegistry, buildPipelineEngine, buildRoleRegistry, composeTaskText, createAgent, createDefaultChatFn, createProvider, createTaskEngine, defaultProjectConfigYaml, expandEnvRefs, findConfigFile, isOmniNodeError, loadConfig, logger, pipelineConfigSchema, pipelineStepConfigSchema, projectConfigSchema, providerConfigSchema, registryKey, requestJson, resolveApiKey, roleConfigSchema };