@hilbras/omninode 2.0.0-alpha.17 → 2.0.0-alpha.19

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.
@@ -15,7 +15,7 @@ import {
15
15
  providerTransportError,
16
16
  requestJson,
17
17
  resolveApiKey
18
- } from "./chunk-6Z6O63SS.js";
18
+ } from "./chunk-BTJDQTWH.js";
19
19
  export {
20
20
  OPENAI_COMPATIBLE_TYPES,
21
21
  OmniHilbrasProvider,
@@ -33,4 +33,4 @@ export {
33
33
  requestJson,
34
34
  resolveApiKey
35
35
  };
36
- //# sourceMappingURL=providers-OYXBAQTX.js.map
36
+ //# sourceMappingURL=providers-KPW3FURD.js.map
package/dist/index.d.ts CHANGED
@@ -188,10 +188,6 @@ interface QuestionPayload {
188
188
  expected?: "text" | "path" | "choice";
189
189
  options?: string[];
190
190
  }
191
- interface TaskPayload {
192
- taskId: string;
193
- objective: string;
194
- }
195
191
  interface ReportPayload {
196
192
  report: Report | Report[];
197
193
  }
@@ -2028,14 +2024,6 @@ declare const appConfigSchema: z.ZodObject<{
2028
2024
  format?: "text" | "json" | undefined;
2029
2025
  } | undefined;
2030
2026
  }>;
2031
- type ProviderConfigYaml = z.infer<typeof providerConfigSchema>;
2032
- type AgentConfigYaml = z.infer<typeof agentConfigSchema>;
2033
- type RoleConfigYaml = z.infer<typeof roleConfigSchema>;
2034
- type PipelineConfigYaml = z.infer<typeof pipelineConfigSchema>;
2035
- type PipelineStepConfigYaml = z.infer<typeof pipelineStepConfigSchema>;
2036
- type PlannerConfigYaml = z.infer<typeof plannerConfigSchema>;
2037
- type ProjectConfigYaml = z.infer<typeof projectConfigSchema>;
2038
- type AppConfigYaml = z.infer<typeof appConfigSchema>;
2039
2027
 
2040
2028
  /**
2041
2029
  * Inline secret detection (roadmap §17, Secrets).
@@ -2114,10 +2102,6 @@ declare function loadConfig(options?: LoadConfigOptions): AppConfig;
2114
2102
  */
2115
2103
  declare function configDiagnostics(config: AppConfig): string[];
2116
2104
 
2117
- /** Loose input shape: composition happens before strict validation. */
2118
- type AppConfigInput = Record<string, unknown>;
2119
- declare const KNOWN_PROFILES: readonly ["default", "development", "production", "testing"];
2120
- type ProfileName = (typeof KNOWN_PROFILES)[number];
2121
2105
  interface ConfigSources {
2122
2106
  /** Project-level configuration file, if any. */
2123
2107
  projectFile?: string;
@@ -2130,24 +2114,6 @@ interface ConfigSources {
2130
2114
  /** Values that came from built-in defaults. */
2131
2115
  defaults: string[];
2132
2116
  }
2133
- /** Default user-level configuration locations, most portable first. */
2134
- declare function userConfigPath(env?: Record<string, string | undefined>): string;
2135
- /** Picks the profile: CLI (applied by the loader) > environment > file > default. */
2136
- declare function resolveProfile(input: {
2137
- profile?: unknown;
2138
- }, env: Record<string, string | undefined>): string;
2139
- /** Deep-merges configuration overlays (objects merge, scalars/arrays replace). */
2140
- declare function mergeConfig<T>(base: T, overlay: unknown): T;
2141
- /** Environment overrides applied above every file source. */
2142
- declare function applyEnvOverrides(input: AppConfigInput, env: Record<string, string | undefined>): {
2143
- config: AppConfigInput;
2144
- applied: string[];
2145
- };
2146
- /** Built-in defaults, applied last. */
2147
- declare function applyDefaults(input: AppConfigInput): {
2148
- config: AppConfigInput;
2149
- applied: string[];
2150
- };
2151
2117
 
2152
2118
  /** Template written by `omninode init` (§22, §23). */
2153
2119
  declare function defaultProjectConfigYaml(projectName?: string): string;
@@ -2431,109 +2397,16 @@ declare class AgentRegistry {
2431
2397
  * "cli" agent configs are mapped to the process integration by the loader.
2432
2398
  */
2433
2399
 
2400
+ /**
2401
+ * Registry consulted first so native/API-level integrations plug in without
2402
+ * touching core (roadmap §8, Native Adapters).
2403
+ */
2404
+ declare const defaultAgentAdapters: AgentAdapterRegistry;
2434
2405
  declare function createAgent(config: AgentConfig, adapters?: AgentAdapterRegistry): IAgent;
2435
2406
 
2436
2407
  /** Builds an agent registry from the project configuration, skipping agents that fail to construct. */
2437
2408
  declare function buildAgentRegistry(config: AppConfig, log?: Logger): AgentRegistry;
2438
2409
 
2439
- /**
2440
- * OmniNode Agent Protocol v2 — versioning (roadmap §7.1).
2441
- *
2442
- * Protocol identifiers are namespaced strings so an agent can negotiate the
2443
- * dialect it speaks: `omninode-agent-protocol/2`.
2444
- */
2445
- declare const PROTOCOL_V2 = "omninode-agent-protocol/2";
2446
- /** Versions this build accepts. v1 is the unversioned dialect shipped with OmniNode 1.x. */
2447
- declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
2448
- declare const MAX_MESSAGE_BYTES = 1048576;
2449
- declare function isSupportedProtocol(protocol: string): boolean;
2450
-
2451
- type ProtocolViolationCode = "INVALID_JSON" | "NOT_AN_OBJECT" | "UNKNOWN_TYPE" | "MISSING_FIELD" | "UNSUPPORTED_VERSION" | "OVERSIZED" | "INVALID_PAYLOAD";
2452
- interface ProtocolViolation {
2453
- code: ProtocolViolationCode;
2454
- message: string;
2455
- /** Raw line (truncated) for diagnostics. */
2456
- sample?: string;
2457
- }
2458
- type DecodeResult = {
2459
- ok: true;
2460
- envelope: ProtocolEnvelope;
2461
- legacy: boolean;
2462
- } | {
2463
- ok: false;
2464
- error: ProtocolViolation;
2465
- };
2466
- /** Validates one decoded JSON value as a protocol envelope. */
2467
- declare function validateEnvelope(value: unknown, line?: string): DecodeResult;
2468
- /** Decodes one protocol line (no trailing newline). */
2469
- declare function decodeMessage(line: string, maxBytes?: number): DecodeResult;
2470
- /** Serializes an envelope to a single JSON line. */
2471
- declare function encodeMessage(envelope: ProtocolEnvelope, maxBytes?: number): string;
2472
- /**
2473
- * Streaming line decoder for agent stdout. Feed chunks; receive decoded
2474
- * envelopes and violations in order. Survives garbage: a bad line yields a
2475
- * violation and the stream continues.
2476
- */
2477
- declare class ProtocolDecoder {
2478
- private buffer;
2479
- private readonly maxBytes;
2480
- constructor(maxBytes?: number);
2481
- push(chunk: string): DecodeResult[];
2482
- /** Flush any trailing line when the process exits. */
2483
- flush(): DecodeResult[];
2484
- }
2485
-
2486
- /**
2487
- * OmniNode Agent Protocol v2 — session (roadmap §7.6).
2488
- *
2489
- * A session drives a protocol-mode agent: it emits v2 envelopes with
2490
- * correlation ids, tolerates legacy (unversioned) replies, answers agent
2491
- * questions through a responder callback, and collects reports, artifacts
2492
- * and the completion — never throwing on malformed input.
2493
- */
2494
-
2495
- interface SessionIds {
2496
- requestId: string;
2497
- taskId: string;
2498
- agentId: string;
2499
- pipelineId?: string;
2500
- executionId?: string;
2501
- }
2502
- interface QuestionResponder {
2503
- (question: {
2504
- questionId: string;
2505
- question: string;
2506
- expected?: string;
2507
- }): Promise<string> | string;
2508
- }
2509
- declare class ProtocolSession {
2510
- readonly decoder: ProtocolDecoder;
2511
- private readonly ids;
2512
- private readonly responder;
2513
- readonly violations: ProtocolViolation[];
2514
- readonly questions: AskedQuestion[];
2515
- readonly artifacts: ProtocolEnvelope["payload"][];
2516
- reports: ProtocolEnvelope["payload"][];
2517
- descriptor?: AgentDescriptor;
2518
- completionSummary?: string;
2519
- errorMessage?: string;
2520
- constructor(ids: SessionIds, options?: {
2521
- responder?: QuestionResponder;
2522
- maxBytes?: number;
2523
- });
2524
- /** The v2 messages OmniNode sends to open a task (written to the agent's stdin). */
2525
- taskMessages(objective: string, role?: unknown, context?: string, instruction?: string): string[];
2526
- helloAck(descriptor: AgentDescriptor): string;
2527
- /** Consumes decoded stdout, answering questions as they arrive. */
2528
- handle(decoded: DecodeResult): Promise<void>;
2529
- private answerQuestion;
2530
- readonly pendingAnswers: string[];
2531
- /** True once any inbound message carried the v2 protocol field. */
2532
- sawV2: boolean;
2533
- }
2534
- declare function decodeStream(session: ProtocolSession, chunk: string): Promise<string[]>;
2535
- declare function requireCompletion(session: ProtocolSession): void;
2536
-
2537
2410
  /** Role registry (§11): the set of roles available for task assignment. */
2538
2411
 
2539
2412
  declare class RoleRegistry {
@@ -2641,7 +2514,6 @@ declare class FileTaskStore extends JsonFileStore<Task> implements TaskStore {
2641
2514
  * dependency-free.
2642
2515
  */
2643
2516
 
2644
- declare function keywords(text: string): Set<string>;
2645
2517
  declare class LocalMemoryProvider extends JsonFileStore<MemoryEntry> implements IMemoryProvider {
2646
2518
  readonly name = "local";
2647
2519
  constructor(directory?: string);
@@ -2734,24 +2606,6 @@ declare class MemoryService {
2734
2606
  private handleFailure;
2735
2607
  }
2736
2608
 
2737
- /**
2738
- * Shared memory-contract helpers (roadmap §12). Adapters implement
2739
- * `retrieve` / `store`; these helpers supply the defaults for `search`,
2740
- * `metadata` and the v1 `query` / `write` aliases, so the contract is
2741
- * defined once.
2742
- */
2743
-
2744
- /** Free-text search defaults to a relevance retrieve. */
2745
- declare function defaultSearch(provider: Pick<IMemoryProvider, "retrieve">, text: string, options?: {
2746
- limit?: number;
2747
- scope?: MemoryQuery["scope"];
2748
- }): Promise<MemoryEntry[]>;
2749
- declare function defaultMetadata(name: string, options?: {
2750
- capabilities?: MemoryProviderMetadata["capabilities"];
2751
- relevanceRanking?: boolean;
2752
- backend?: Record<string, unknown>;
2753
- }): MemoryProviderMetadata;
2754
-
2755
2609
  interface CreateTaskInput {
2756
2610
  objective: string;
2757
2611
  project?: string;
@@ -3144,6 +2998,7 @@ interface RunPipelineOptions {
3144
2998
  objective?: string;
3145
2999
  onStep?: (stepRun: PipelineStepRun) => void;
3146
3000
  }
3001
+
3147
3002
  declare class PipelineEngine implements IPipelineExecutor {
3148
3003
  private readonly options;
3149
3004
  private readonly log;
@@ -3218,8 +3073,6 @@ interface MigrationReport {
3218
3073
  migrated: boolean;
3219
3074
  note?: string;
3220
3075
  }
3221
- /** Every persisted store file OmniNode manages in a project. */
3222
- declare const STORE_FILES: readonly ["tasks.json", "pipelines.json", "reports.json", "plans.json", "memory.json"];
3223
3076
  /**
3224
3077
  * Migration (roadmap §16): inspects every store file, reports its schema
3225
3078
  * state, and — unless `checkOnly` — rewrites v1 documents at the current
@@ -3230,6 +3083,102 @@ declare function migrateProjectStores(directory?: string, options?: {
3230
3083
  checkOnly?: boolean;
3231
3084
  }): Promise<MigrationReport[]>;
3232
3085
 
3233
- declare const OMNINODE_VERSION = "2.0.0-alpha.17";
3086
+ /**
3087
+ * OmniNode Agent Protocol v2 — versioning (roadmap §7.1).
3088
+ *
3089
+ * Protocol identifiers are namespaced strings so an agent can negotiate the
3090
+ * dialect it speaks: `omninode-agent-protocol/2`.
3091
+ */
3092
+ declare const PROTOCOL_V2 = "omninode-agent-protocol/2";
3093
+ /** Versions this build accepts. v1 is the unversioned dialect shipped with OmniNode 1.x. */
3094
+ declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
3095
+ declare const MAX_MESSAGE_BYTES = 1048576;
3096
+ declare function isSupportedProtocol(protocol: string): boolean;
3097
+
3098
+ type ProtocolViolationCode = "INVALID_JSON" | "NOT_AN_OBJECT" | "UNKNOWN_TYPE" | "MISSING_FIELD" | "UNSUPPORTED_VERSION" | "OVERSIZED" | "INVALID_PAYLOAD";
3099
+ interface ProtocolViolation {
3100
+ code: ProtocolViolationCode;
3101
+ message: string;
3102
+ /** Raw line (truncated) for diagnostics. */
3103
+ sample?: string;
3104
+ }
3105
+ type DecodeResult = {
3106
+ ok: true;
3107
+ envelope: ProtocolEnvelope;
3108
+ legacy: boolean;
3109
+ } | {
3110
+ ok: false;
3111
+ error: ProtocolViolation;
3112
+ };
3113
+ /** Validates one decoded JSON value as a protocol envelope. */
3114
+ declare function validateEnvelope(value: unknown, line?: string): DecodeResult;
3115
+ /** Decodes one protocol line (no trailing newline). */
3116
+ declare function decodeMessage(line: string, maxBytes?: number): DecodeResult;
3117
+ /** Serializes an envelope to a single JSON line. */
3118
+ declare function encodeMessage(envelope: ProtocolEnvelope, maxBytes?: number): string;
3119
+ /**
3120
+ * Streaming line decoder for agent stdout. Feed chunks; receive decoded
3121
+ * envelopes and violations in order. Survives garbage: a bad line yields a
3122
+ * violation and the stream continues.
3123
+ */
3124
+ declare class ProtocolDecoder {
3125
+ private buffer;
3126
+ private readonly maxBytes;
3127
+ constructor(maxBytes?: number);
3128
+ push(chunk: string): DecodeResult[];
3129
+ /** Flush any trailing line when the process exits. */
3130
+ flush(): DecodeResult[];
3131
+ }
3132
+
3133
+ /**
3134
+ * OmniNode Agent Protocol v2 — session (roadmap §7.6).
3135
+ *
3136
+ * A session drives a protocol-mode agent: it emits v2 envelopes with
3137
+ * correlation ids, tolerates legacy (unversioned) replies, answers agent
3138
+ * questions through a responder callback, and collects reports, artifacts
3139
+ * and the completion — never throwing on malformed input.
3140
+ */
3141
+
3142
+ interface SessionIds {
3143
+ requestId: string;
3144
+ taskId: string;
3145
+ agentId: string;
3146
+ pipelineId?: string;
3147
+ executionId?: string;
3148
+ }
3149
+ interface QuestionResponder {
3150
+ (question: {
3151
+ questionId: string;
3152
+ question: string;
3153
+ expected?: string;
3154
+ }): Promise<string> | string;
3155
+ }
3156
+ declare class ProtocolSession {
3157
+ readonly decoder: ProtocolDecoder;
3158
+ private readonly ids;
3159
+ private readonly responder;
3160
+ readonly violations: ProtocolViolation[];
3161
+ readonly questions: AskedQuestion[];
3162
+ readonly artifacts: ProtocolEnvelope["payload"][];
3163
+ reports: ProtocolEnvelope["payload"][];
3164
+ descriptor?: AgentDescriptor;
3165
+ completionSummary?: string;
3166
+ errorMessage?: string;
3167
+ constructor(ids: SessionIds, options?: {
3168
+ responder?: QuestionResponder;
3169
+ maxBytes?: number;
3170
+ });
3171
+ /** The v2 messages OmniNode sends to open a task (written to the agent's stdin). */
3172
+ taskMessages(objective: string, role?: unknown, context?: string, instruction?: string): string[];
3173
+ helloAck(descriptor: AgentDescriptor): string;
3174
+ /** Consumes decoded stdout, answering questions as they arrive. */
3175
+ handle(decoded: DecodeResult): Promise<void>;
3176
+ private answerQuestion;
3177
+ readonly pendingAnswers: string[];
3178
+ /** True once any inbound message carried the v2 protocol field. */
3179
+ sawV2: boolean;
3180
+ }
3181
+
3182
+ declare const OMNINODE_VERSION = "2.0.0-alpha.19";
3234
3183
 
3235
- export { AgentAdapterRegistry, type AgentConfig, type AgentConfigYaml, type AgentDescriptor, 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 AppConfigInput, type AppConfigYaml, type ArtifactKind, type ArtifactPayload, type AskedQuestion, type AuditAction, type AuditEvent, type AuditSink, type AuditSink as AuditStore, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatStreamChunk, type ChatUsage, type CollectionDiagnostics, type CombinedMeta, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, type ConfigSources, type ConflictPosition, ConsoleLogSink, type CreateTaskInput, type CwdValidation, DEFAULT_MAX_OUTPUT_BYTES, type DecodeResult, type DefaultChatOptions, type DiscoveryResult, type DocumentState, type Durability, type EnvPolicy, type EnvelopeMeta, type Evidence, type EvidenceInput, type EvidenceKind, type ExecutionRecord, type ExtractionMeta, FileAuditLog, FilePipelineRunStore, FilePlanStore, FileReportStore, FileTaskStore, type Finding, type FindingOrigin, type FindingSeverity, type FindingSource, type HelloResult, HeuristicPlanner, type HttpRequestOptions, type HttpResponse, type IAgent, type IAgentAdapter, type IChatProvider, type IMemoryProvider, type IPipelineExecutor, type IPlanner, type IProvider, type JsonDocument, JsonFileStore, type JsonFileStoreOptions, KNOWN_PROFILES, type LoadConfigOptions, type LoadConfigResult, LocalMemoryProvider, type LogFormat, type LogLevel, type LogSink, Logger, type LoggerOptions, MAX_CONTEXT_CHARS, MAX_MESSAGE_BYTES, MAX_REPORT_BYTES, type MemoryCategory, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryProviderMetadata, type MemoryQuery, type MemoryScope, MemoryService, type MemoryServiceOptions, LocalMemoryProvider as MemoryStore, type MemoryTaskContext, type MessageEnvelope, type MigrationReport, type Modality, type ModelCapabilities, type ModelFilter, type ModelInfo, ModelPlanner, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, type OmniHilbrasConnectionResult, OmniHilbrasProvider, OmniNodeError, type OmniNodeErrorCode, type OmniNodeErrorOptions, OpenAICompatibleProvider, PROTOCOL_V2, type PipelineConfigYaml, type PipelineDefinition, PipelineEngine, type PipelineEngineOptions, PipelineError, type PipelineRun, type PipelineRunAttempt, type PipelineRunFilter, type PipelineRunOptions, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepConfigYaml, type PipelineStepKind, type PipelineStepRun, type PipelineRunStore as PipelineStore, type Plan, type PlanFilter, type PlanJsonResult, type PlanRequest, type PlanStep, type PlanStore, type PlanValidationIssue, type PlanValidationResult, type PlannerConfigYaml, PlannerError, ProcessAgent, ProcessAgentAdapter, type ProfileName, type Project, type ProjectConfigYaml, ProjectStores, type ProtocolAgentToNodeType, ProtocolDecoder, type ProtocolEnvelope, ProtocolError, type ProtocolMessageType, type ProtocolNodeToAgentType, ProtocolSession, type ProtocolViolation, type ProtocolViolationCode, type ProviderAuthentication, type ProviderCapability, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderErrorKind, type ProviderHealth, type ProviderStatus, type ProviderType, type QuestionPayload, type QuestionResponder, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportArtifact, type ReportConflict, type ReportFilter, type ReportPayload, ReportService, type ReportStore, type ReportValidationIssue, type ReportValidationResult, type RoleConfigYaml, type RoleDefinition, RoleRegistry, type RunPipelineOptions, SCHEMA_VERSION, STORE_FILES, SUPPORTED_PROTOCOL_VERSIONS, type SecretFinding, type SessionIds, TERMINAL_TASK_STATUSES, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskPayload, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, type WritableLike, agentConfigSchema, aggregateReports, appConfigSchema, applyDefaults, applyEnvOverrides, authHeaders, buildAgentRegistry, buildChildEnv, buildHello, buildHelloAck, buildPipelineEngine, buildPlanner, buildPlannerContext, buildRoleRegistry, composeTaskText, configDiagnostics, configureLogger, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, decodeMessage, decodeStream, defaultMetadata, defaultProjectConfigYaml, defaultSearch, describeExit, describeSecretFindings, detectConflicts, encodeMessage, envelope, expandEnvRefs, extractMessage, extractReportFromText, findConfigFile, inspectDocument, isNetworkError, isOmniNodeError, isRetryable, isSupportedProtocol, isTimeoutError, keywords, killTree, kindFromStatus, loadConfig, loadConfigDetailed, logger, mergeConfig, migrateProjectStores, newMessageId, normalizeEvidence, normalizeFinding, parseHello, parsePlanJson, parseRetryAfter, pipelineConfigSchema, pipelineStepConfigSchema, planJsonSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, providerHttpError, providerTransportError, readDocument, registryKey, requestJson, requireCompletion, resolveApiKey, resolveEnvPolicy, resolveProfile, roleConfigSchema, sanitizeChunk, scanForInlineSecrets, similar, userConfigPath, validateEnvelope, validatePlan, validateReport, validateWorkingDirectory, writeFileAtomic };
3184
+ export { AgentAdapterRegistry, type AgentConfig, type AgentDescriptor, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type ArtifactPayload, type AskedQuestion, type AuditAction, type AuditEvent, type AuditSink, type AuditSink as AuditStore, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatStreamChunk, type ChatUsage, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, type ConflictPosition, ConsoleLogSink, type CreateProviderOptions, type CreateTaskInput, type CwdValidation, DEFAULT_MAX_OUTPUT_BYTES, type DecodeResult, type DefaultChatOptions, type DocumentState, type Durability, type EnvPolicy, type EnvelopeMeta, type Evidence, type EvidenceInput, type EvidenceKind, type ExecutionRecord, FileAuditLog, FilePipelineRunStore, FilePlanStore, FileReportStore, FileTaskStore, type Finding, type FindingOrigin, type FindingSeverity, type FindingSource, type HelloResult, HeuristicPlanner, type IAgent, type IAgentAdapter, type IChatProvider, type IMemoryProvider, type IPipelineExecutor, type IPlanner, type IProvider, type JsonDocument, JsonFileStore, type JsonFileStoreOptions, type LoadConfigOptions, type LoadConfigResult, LocalMemoryProvider, type LogFormat, type LogLevel, type LogSink, Logger, type LoggerOptions, MAX_CONTEXT_CHARS, MAX_MESSAGE_BYTES, MAX_REPORT_BYTES, type MemoryCategory, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryProviderMetadata, type MemoryQuery, type MemoryScope, MemoryService, type MemoryServiceOptions, LocalMemoryProvider as MemoryStore, type MemoryTaskContext, type MessageEnvelope, type MigrationReport, type Modality, type ModelCapabilities, type ModelInfo, ModelPlanner, type ModelPlannerOptions, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, OmniHilbrasProvider, OmniNodeError, OpenAICompatibleProvider, PROTOCOL_V2, type PipelineDefinition, PipelineEngine, PipelineError, type PipelineRun, type PipelineRunAttempt, type PipelineRunFilter, type PipelineRunOptions, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepKind, type PipelineStepRun, type PipelineRunStore as PipelineStore, type Plan, type PlanFilter, type PlanRequest, type PlanStep, type PlanStore, type PlanValidationIssue, type PlanValidationResult, PlannerError, ProcessAgent, ProcessAgentAdapter, type Project, ProjectStores, type ProtocolAgentToNodeType, ProtocolDecoder, type ProtocolEnvelope, ProtocolError, type ProtocolMessageType, type ProtocolNodeToAgentType, ProtocolSession, type ProtocolViolation, type ProtocolViolationCode, type ProviderAuthentication, type ProviderCapability, type ProviderConfig, ProviderError, type ProviderHealth, type ProviderStatus, type ProviderType, type QuestionPayload, type QuestionResponder, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportArtifact, type ReportConflict, type ReportFilter, type ReportPayload, ReportService, type ReportStore, type RoleDefinition, RoleRegistry, type RunPipelineOptions, type RunTaskOptions, SCHEMA_VERSION, SUPPORTED_PROTOCOL_VERSIONS, type SessionIds, TERMINAL_TASK_STATUSES, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, agentConfigSchema, aggregateReports, appConfigSchema, authHeaders, buildAgentRegistry, buildChildEnv, buildHello, buildHelloAck, buildPipelineEngine, buildPlanner, buildPlannerContext, buildRoleRegistry, composeTaskText, configDiagnostics, configureLogger, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, decodeMessage, defaultAgentAdapters, defaultProjectConfigYaml, describeExit, describeSecretFindings, detectConflicts, encodeMessage, envelope, expandEnvRefs, extractMessage, extractReportFromText, findConfigFile, inspectDocument, isNetworkError, isOmniNodeError, isRetryable, isSupportedProtocol, isTimeoutError, killTree, kindFromStatus, loadConfig, loadConfigDetailed, logger, migrateProjectStores, newMessageId, normalizeEvidence, normalizeFinding, parseHello, parsePlanJson, parseRetryAfter, pipelineConfigSchema, pipelineStepConfigSchema, planJsonSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, providerHttpError, providerTransportError, readDocument, registryKey, requestJson, resolveApiKey, resolveEnvPolicy, roleConfigSchema, sanitizeChunk, scanForInlineSecrets, similar, validateEnvelope, validatePlan, validateReport, validateWorkingDirectory, writeFileAtomic };
package/dist/index.js CHANGED
@@ -1,12 +1,3 @@
1
- // src/types/task.ts
2
- var TERMINAL_TASK_STATUSES = [
3
- "completed",
4
- "failed",
5
- "timed_out",
6
- "cancelled",
7
- "partially_completed"
8
- ];
9
-
10
1
  // src/errors/index.ts
11
2
  var OmniNodeError = class extends Error {
12
3
  code;
@@ -257,7 +248,6 @@ OmniNode never stores credentials in configuration. Replace each value with an e
257
248
  // src/config/profiles.ts
258
249
  import { homedir } from "os";
259
250
  import path from "path";
260
- var KNOWN_PROFILES = ["default", "development", "production", "testing"];
261
251
  function userConfigPath(env = process.env) {
262
252
  if (env.OMNINODE_USER_CONFIG) return env.OMNINODE_USER_CONFIG;
263
253
  const home = env.HOME ?? homedir();
@@ -1157,7 +1147,21 @@ var OPENAI_COMPATIBLE_TYPES = [
1157
1147
  "local",
1158
1148
  "custom"
1159
1149
  ];
1150
+ function assertProviderConfig(config) {
1151
+ if (!config.name || config.name.trim().length === 0) {
1152
+ throw new ConfigError("CONFIG_INVALID", "Provider name must not be empty.");
1153
+ }
1154
+ if (!config.baseUrl || config.baseUrl.trim().length === 0) {
1155
+ throw new ConfigError("CONFIG_INVALID", `Provider "${config.name}" needs a baseUrl.`);
1156
+ }
1157
+ try {
1158
+ new URL(config.baseUrl);
1159
+ } catch {
1160
+ throw new ConfigError("CONFIG_INVALID", `Provider "${config.name}" has an invalid baseUrl: ${config.baseUrl}`);
1161
+ }
1162
+ }
1160
1163
  function createProvider(config, options = {}) {
1164
+ assertProviderConfig(config);
1161
1165
  const shared = {
1162
1166
  ...options.env !== void 0 ? { env: options.env } : {},
1163
1167
  ...options.audit !== void 0 ? { audit: options.audit } : {}
@@ -1547,18 +1551,6 @@ var ProtocolSession = class {
1547
1551
  /** True once any inbound message carried the v2 protocol field. */
1548
1552
  sawV2 = false;
1549
1553
  };
1550
- async function decodeStream(session, chunk) {
1551
- const decoded = session.decoder.push(chunk);
1552
- for (const result of decoded) {
1553
- await session.handle(result);
1554
- }
1555
- return session.pendingAnswers.splice(0);
1556
- }
1557
- function requireCompletion(session) {
1558
- if (session.errorMessage !== void 0) {
1559
- throw new ProtocolError(session.errorMessage);
1560
- }
1561
- }
1562
1554
 
1563
1555
  // src/agents/cwd.ts
1564
1556
  import { statSync } from "fs";
@@ -2042,7 +2034,16 @@ var AgentRegistry = class {
2042
2034
  // src/agents/factory.ts
2043
2035
  var defaultAgentAdapters = new AgentAdapterRegistry();
2044
2036
  defaultAgentAdapters.register(new ProcessAgentAdapter((config) => new ProcessAgent(config)));
2037
+ function assertAgentConfig(config) {
2038
+ if (!config.name || config.name.trim().length === 0) {
2039
+ throw new ConfigError("CONFIG_INVALID", "Agent name must not be empty.");
2040
+ }
2041
+ if (config.integration === "process" && (!config.command || config.command.trim().length === 0)) {
2042
+ throw new ConfigError("CONFIG_INVALID", `Agent "${config.name}" needs a command for the process adapter.`);
2043
+ }
2044
+ }
2045
2045
  function createAgent(config, adapters = defaultAgentAdapters) {
2046
+ assertAgentConfig(config);
2046
2047
  const registered = adapters.get(config.integration);
2047
2048
  if (registered) return registered.create(config);
2048
2049
  if (config.integration === "native") {
@@ -4429,7 +4430,7 @@ async function migrateProjectStores(directory = `${process.cwd()}/.omninode`, op
4429
4430
  }
4430
4431
 
4431
4432
  // src/version.ts
4432
- var OMNINODE_VERSION = "2.0.0-alpha.17";
4433
+ var OMNINODE_VERSION = "2.0.0-alpha.19";
4433
4434
  export {
4434
4435
  AgentAdapterRegistry,
4435
4436
  AgentError,
@@ -4444,7 +4445,6 @@ export {
4444
4445
  FileTaskStore,
4445
4446
  HeuristicPlanner,
4446
4447
  JsonFileStore,
4447
- KNOWN_PROFILES,
4448
4448
  LocalMemoryProvider,
4449
4449
  Logger,
4450
4450
  MAX_CONTEXT_CHARS,
@@ -4474,16 +4474,12 @@ export {
4474
4474
  ReportService,
4475
4475
  RoleRegistry,
4476
4476
  SCHEMA_VERSION,
4477
- STORE_FILES,
4478
4477
  SUPPORTED_PROTOCOL_VERSIONS,
4479
- TERMINAL_TASK_STATUSES,
4480
4478
  TaskEngine,
4481
4479
  TaskError,
4482
4480
  agentConfigSchema,
4483
4481
  aggregateReports,
4484
4482
  appConfigSchema,
4485
- applyDefaults,
4486
- applyEnvOverrides,
4487
4483
  authHeaders,
4488
4484
  buildAgentRegistry,
4489
4485
  buildChildEnv,
@@ -4502,10 +4498,8 @@ export {
4502
4498
  createProvider,
4503
4499
  createTaskEngine,
4504
4500
  decodeMessage,
4505
- decodeStream,
4506
- defaultMetadata,
4501
+ defaultAgentAdapters,
4507
4502
  defaultProjectConfigYaml,
4508
- defaultSearch,
4509
4503
  describeExit,
4510
4504
  describeSecretFindings,
4511
4505
  detectConflicts,
@@ -4521,13 +4515,11 @@ export {
4521
4515
  isRetryable,
4522
4516
  isSupportedProtocol,
4523
4517
  isTimeoutError,
4524
- keywords,
4525
4518
  killTree,
4526
4519
  kindFromStatus,
4527
4520
  loadConfig,
4528
4521
  loadConfigDetailed,
4529
4522
  logger,
4530
- mergeConfig,
4531
4523
  migrateProjectStores,
4532
4524
  newMessageId,
4533
4525
  normalizeEvidence,
@@ -4546,15 +4538,12 @@ export {
4546
4538
  readDocument,
4547
4539
  registryKey,
4548
4540
  requestJson,
4549
- requireCompletion,
4550
4541
  resolveApiKey,
4551
4542
  resolveEnvPolicy,
4552
- resolveProfile,
4553
4543
  roleConfigSchema,
4554
4544
  sanitizeChunk,
4555
4545
  scanForInlineSecrets,
4556
4546
  similar,
4557
- userConfigPath,
4558
4547
  validateEnvelope,
4559
4548
  validatePlan,
4560
4549
  validateReport,