@hilbras/omninode 0.8.0 → 0.9.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
@@ -291,6 +291,8 @@ interface PipelineStepRun {
291
291
  status: TaskStatus;
292
292
  /** Tasks created for this step (research fans out to several). */
293
293
  taskIds?: string[];
294
+ /** Set on plan steps that produced a stored plan (§18). */
295
+ planId?: string;
294
296
  error?: string;
295
297
  }
296
298
  interface PipelineRun {
@@ -304,6 +306,38 @@ interface PipelineRun {
304
306
  reports?: Report[];
305
307
  /** Set when the report system generated a combined report for this run. */
306
308
  combinedReportId?: string;
309
+ /** Set when a plan step produced an implementation plan (§18). */
310
+ planId?: string;
311
+ }
312
+
313
+ /** Plan types: the final implementation plan produced by the planner layer (§18). */
314
+ interface PlanStep {
315
+ id: string;
316
+ title: string;
317
+ description?: string;
318
+ order: number;
319
+ /** Files/modules the step touches, if stated. */
320
+ targets?: string[];
321
+ acceptanceCriteria?: string[];
322
+ /** Plan-internal dependencies between steps. */
323
+ dependsOn?: string[];
324
+ /** Finding ids that motivated this step (traceability to reports). */
325
+ sourceFindings?: string[];
326
+ }
327
+ interface Plan {
328
+ id: string;
329
+ objective: string;
330
+ summary: string;
331
+ steps: PlanStep[];
332
+ risks?: string[];
333
+ notes?: string[];
334
+ /** What produced the plan, e.g. "model:my-gateway:chatgpt" or "heuristic". */
335
+ generatedBy: string;
336
+ model?: string;
337
+ taskId?: string;
338
+ pipelineRunId?: string;
339
+ createdAt: string;
340
+ metadata?: Record<string, unknown>;
307
341
  }
308
342
 
309
343
  /** Agent ↔ OmniNode communication protocol (§21). */
@@ -452,7 +486,7 @@ interface IChatProvider extends IProvider {
452
486
  }
453
487
 
454
488
  /** Typed error hierarchy shared across the whole codebase (§4.1 — error model). */
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";
489
+ 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" | "PLANNER_FAILED" | "PLAN_INVALID" | "PROTOCOL_VIOLATION" | "MEMORY_UNAVAILABLE" | "REPORT_NOT_FOUND" | "NOT_IMPLEMENTED" | "CLI_USAGE" | "INTERNAL";
456
490
  interface OmniNodeErrorOptions {
457
491
  cause?: unknown;
458
492
  details?: Record<string, unknown>;
@@ -480,6 +514,9 @@ declare class PipelineError extends OmniNodeError {
480
514
  declare class ProtocolError extends OmniNodeError {
481
515
  constructor(message: string, options?: OmniNodeErrorOptions);
482
516
  }
517
+ declare class PlannerError extends OmniNodeError {
518
+ constructor(code: "PLANNER_FAILED" | "PLAN_INVALID", message: string, options?: OmniNodeErrorOptions);
519
+ }
483
520
  declare class MemoryError extends OmniNodeError {
484
521
  constructor(message: string, options?: OmniNodeErrorOptions);
485
522
  }
@@ -702,6 +739,19 @@ declare const pipelineConfigSchema: z.ZodObject<{
702
739
  name?: string | undefined;
703
740
  objective?: string | undefined;
704
741
  }>;
742
+ declare const plannerConfigSchema: z.ZodObject<{
743
+ kind: z.ZodDefault<z.ZodEnum<["model", "heuristic"]>>;
744
+ model: z.ZodOptional<z.ZodString>;
745
+ instruction: z.ZodOptional<z.ZodString>;
746
+ }, "strict", z.ZodTypeAny, {
747
+ kind: "model" | "heuristic";
748
+ model?: string | undefined;
749
+ instruction?: string | undefined;
750
+ }, {
751
+ kind?: "model" | "heuristic" | undefined;
752
+ model?: string | undefined;
753
+ instruction?: string | undefined;
754
+ }>;
705
755
  declare const projectConfigSchema: z.ZodObject<{
706
756
  name: z.ZodString;
707
757
  providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -853,6 +903,19 @@ declare const projectConfigSchema: z.ZodObject<{
853
903
  name?: string | undefined;
854
904
  objective?: string | undefined;
855
905
  }>, "many">>;
906
+ planner: z.ZodOptional<z.ZodObject<{
907
+ kind: z.ZodDefault<z.ZodEnum<["model", "heuristic"]>>;
908
+ model: z.ZodOptional<z.ZodString>;
909
+ instruction: z.ZodOptional<z.ZodString>;
910
+ }, "strict", z.ZodTypeAny, {
911
+ kind: "model" | "heuristic";
912
+ model?: string | undefined;
913
+ instruction?: string | undefined;
914
+ }, {
915
+ kind?: "model" | "heuristic" | undefined;
916
+ model?: string | undefined;
917
+ instruction?: string | undefined;
918
+ }>>;
856
919
  memory: z.ZodOptional<z.ZodObject<{
857
920
  provider: z.ZodDefault<z.ZodString>;
858
921
  base_url: z.ZodOptional<z.ZodString>;
@@ -914,6 +977,11 @@ declare const projectConfigSchema: z.ZodObject<{
914
977
  name?: string | undefined;
915
978
  objective?: string | undefined;
916
979
  }[];
980
+ planner?: {
981
+ kind: "model" | "heuristic";
982
+ model?: string | undefined;
983
+ instruction?: string | undefined;
984
+ } | undefined;
917
985
  memory?: {
918
986
  provider: string;
919
987
  base_url?: string | undefined;
@@ -967,6 +1035,11 @@ declare const projectConfigSchema: z.ZodObject<{
967
1035
  name?: string | undefined;
968
1036
  objective?: string | undefined;
969
1037
  }[] | undefined;
1038
+ planner?: {
1039
+ kind?: "model" | "heuristic" | undefined;
1040
+ model?: string | undefined;
1041
+ instruction?: string | undefined;
1042
+ } | undefined;
970
1043
  memory?: {
971
1044
  base_url?: string | undefined;
972
1045
  api_key_env_var?: string | undefined;
@@ -1125,6 +1198,19 @@ declare const appConfigSchema: z.ZodObject<{
1125
1198
  name?: string | undefined;
1126
1199
  objective?: string | undefined;
1127
1200
  }>, "many">>;
1201
+ planner: z.ZodOptional<z.ZodObject<{
1202
+ kind: z.ZodDefault<z.ZodEnum<["model", "heuristic"]>>;
1203
+ model: z.ZodOptional<z.ZodString>;
1204
+ instruction: z.ZodOptional<z.ZodString>;
1205
+ }, "strict", z.ZodTypeAny, {
1206
+ kind: "model" | "heuristic";
1207
+ model?: string | undefined;
1208
+ instruction?: string | undefined;
1209
+ }, {
1210
+ kind?: "model" | "heuristic" | undefined;
1211
+ model?: string | undefined;
1212
+ instruction?: string | undefined;
1213
+ }>>;
1128
1214
  memory: z.ZodOptional<z.ZodObject<{
1129
1215
  provider: z.ZodDefault<z.ZodString>;
1130
1216
  base_url: z.ZodOptional<z.ZodString>;
@@ -1186,6 +1272,11 @@ declare const appConfigSchema: z.ZodObject<{
1186
1272
  name?: string | undefined;
1187
1273
  objective?: string | undefined;
1188
1274
  }[];
1275
+ planner?: {
1276
+ kind: "model" | "heuristic";
1277
+ model?: string | undefined;
1278
+ instruction?: string | undefined;
1279
+ } | undefined;
1189
1280
  memory?: {
1190
1281
  provider: string;
1191
1282
  base_url?: string | undefined;
@@ -1239,6 +1330,11 @@ declare const appConfigSchema: z.ZodObject<{
1239
1330
  name?: string | undefined;
1240
1331
  objective?: string | undefined;
1241
1332
  }[] | undefined;
1333
+ planner?: {
1334
+ kind?: "model" | "heuristic" | undefined;
1335
+ model?: string | undefined;
1336
+ instruction?: string | undefined;
1337
+ } | undefined;
1242
1338
  memory?: {
1243
1339
  base_url?: string | undefined;
1244
1340
  api_key_env_var?: string | undefined;
@@ -1301,6 +1397,11 @@ declare const appConfigSchema: z.ZodObject<{
1301
1397
  name?: string | undefined;
1302
1398
  objective?: string | undefined;
1303
1399
  }[];
1400
+ planner?: {
1401
+ kind: "model" | "heuristic";
1402
+ model?: string | undefined;
1403
+ instruction?: string | undefined;
1404
+ } | undefined;
1304
1405
  memory?: {
1305
1406
  provider: string;
1306
1407
  base_url?: string | undefined;
@@ -1359,6 +1460,11 @@ declare const appConfigSchema: z.ZodObject<{
1359
1460
  name?: string | undefined;
1360
1461
  objective?: string | undefined;
1361
1462
  }[] | undefined;
1463
+ planner?: {
1464
+ kind?: "model" | "heuristic" | undefined;
1465
+ model?: string | undefined;
1466
+ instruction?: string | undefined;
1467
+ } | undefined;
1362
1468
  memory?: {
1363
1469
  base_url?: string | undefined;
1364
1470
  api_key_env_var?: string | undefined;
@@ -1374,6 +1480,7 @@ type AgentConfigYaml = z.infer<typeof agentConfigSchema>;
1374
1480
  type RoleConfigYaml = z.infer<typeof roleConfigSchema>;
1375
1481
  type PipelineConfigYaml = z.infer<typeof pipelineConfigSchema>;
1376
1482
  type PipelineStepConfigYaml = z.infer<typeof pipelineStepConfigSchema>;
1483
+ type PlannerConfigYaml = z.infer<typeof plannerConfigSchema>;
1377
1484
  type ProjectConfigYaml = z.infer<typeof projectConfigSchema>;
1378
1485
  type AppConfigYaml = z.infer<typeof appConfigSchema>;
1379
1486
 
@@ -1384,6 +1491,11 @@ interface AppConfig {
1384
1491
  agents: AgentConfig[];
1385
1492
  roles: RoleDefinition[];
1386
1493
  pipelines: PipelineDefinition[];
1494
+ planner?: {
1495
+ kind: "model" | "heuristic";
1496
+ model?: string;
1497
+ instruction?: string;
1498
+ };
1387
1499
  memory?: {
1388
1500
  provider: string;
1389
1501
  baseUrl?: string;
@@ -1730,6 +1842,35 @@ interface AggregateOptions {
1730
1842
  declare function aggregateReports(reports: Report[], options?: AggregateOptions): CombinedReport;
1731
1843
  declare function similar(a: string, b: string, threshold: number): boolean;
1732
1844
 
1845
+ /** Planner interface and request contract (§18). The planner is replaceable. */
1846
+
1847
+ interface PlanRequest {
1848
+ objective: string;
1849
+ /** Raw reports (already normalized) the plan is based on. */
1850
+ reports: Report[];
1851
+ /** Combined research context from upstream pipeline steps, if available. */
1852
+ context?: string;
1853
+ role?: RoleDefinition;
1854
+ memory?: MemoryEntry[];
1855
+ project?: string;
1856
+ taskId?: string;
1857
+ pipelineRunId?: string;
1858
+ }
1859
+ interface IPlanner {
1860
+ readonly name: string;
1861
+ plan(request: PlanRequest): Promise<Plan>;
1862
+ }
1863
+
1864
+ interface PlanFilter {
1865
+ pipelineRunId?: string;
1866
+ taskId?: string;
1867
+ }
1868
+ interface PlanStore {
1869
+ save(plan: Plan): Promise<void>;
1870
+ get(id: string): Promise<Plan | undefined>;
1871
+ list(filter?: PlanFilter): Promise<Plan[]>;
1872
+ }
1873
+
1733
1874
  interface PipelineRunFilter {
1734
1875
  pipelineId?: string;
1735
1876
  status?: PipelineRunStatus;
@@ -1759,6 +1900,10 @@ interface PipelineEngineOptions {
1759
1900
  providers: AppConfig["project"]["providers"];
1760
1901
  store: PipelineRunStore;
1761
1902
  chat?: ChatFn;
1903
+ /** Default planner used by plan steps without their own model (§18). */
1904
+ planner?: IPlanner;
1905
+ /** When present, plans produced by plan steps are persisted. */
1906
+ plans?: PlanStore;
1762
1907
  /** When present, finished runs have their reports collected, stored and combined (§16–§17). */
1763
1908
  reports?: ReportService;
1764
1909
  log?: Logger;
@@ -1797,10 +1942,8 @@ declare class PipelineEngine {
1797
1942
  /** Default chat function: resolves "provider:model" against the configured providers. */
1798
1943
  declare function createDefaultChatFn(providers: AppConfig["project"]["providers"]): ChatFn;
1799
1944
 
1800
- /** Assembles a PipelineEngine from the project configuration (local-first defaults). */
1801
-
1802
1945
  declare function buildPipelineEngine(config: AppConfig, log?: Logger): PipelineEngine;
1803
1946
 
1804
- declare const OMNINODE_VERSION = "0.8.0";
1947
+ declare const OMNINODE_VERSION = "0.9.0";
1805
1948
 
1806
- export { type AgentConfig, type AgentConfigYaml, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregateOptions, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type AppConfigYaml, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatUsage, type CombinedMeta, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type DiscoveryResult, type EnvelopeMeta, type ExtractionMeta, FilePipelineRunStore, FileReportStore, FileTaskStore, type Finding, type FindingSeverity, type FindingSource, type HttpRequestOptions, type HttpResponse, type IAgent, type IChatProvider, type IMemoryProvider, type IProvider, type LoadConfigOptions, LocalMemoryProvider, type LogLevel, type LogSink, Logger, type LoggerOptions, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryQuery, type MemoryScope, MemoryService, 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 RememberaConfig, RememberaMemoryProvider, type Report, type ReportFilter, ReportService, type ReportStore, 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, aggregateReports, appConfigSchema, authHeaders, buildAgentRegistry, buildPipelineEngine, buildRoleRegistry, composeTaskText, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, defaultProjectConfigYaml, expandEnvRefs, extractReportFromText, findConfigFile, isOmniNodeError, keywords, loadConfig, logger, pipelineConfigSchema, pipelineStepConfigSchema, projectConfigSchema, providerConfigSchema, registryKey, requestJson, resolveApiKey, roleConfigSchema, similar };
1949
+ export { type AgentConfig, type AgentConfigYaml, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregateOptions, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type AppConfigYaml, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatUsage, type CombinedMeta, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type DiscoveryResult, type EnvelopeMeta, type ExtractionMeta, FilePipelineRunStore, FileReportStore, FileTaskStore, type Finding, type FindingSeverity, type FindingSource, type HttpRequestOptions, type HttpResponse, type IAgent, type IChatProvider, type IMemoryProvider, type IProvider, type LoadConfigOptions, LocalMemoryProvider, type LogLevel, type LogSink, Logger, type LoggerOptions, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryQuery, type MemoryScope, MemoryService, 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, type Plan, type PlanStep, type PlannerConfigYaml, PlannerError, ProcessAgent, type Project, type ProjectConfigYaml, ProtocolError, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderHealth, type ProviderStatus, type ProviderType, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportFilter, ReportService, type ReportStore, 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, aggregateReports, appConfigSchema, authHeaders, buildAgentRegistry, buildPipelineEngine, buildRoleRegistry, composeTaskText, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, defaultProjectConfigYaml, expandEnvRefs, extractReportFromText, findConfigFile, isOmniNodeError, keywords, loadConfig, logger, pipelineConfigSchema, pipelineStepConfigSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, registryKey, requestJson, resolveApiKey, roleConfigSchema, similar };