@infersec/conduit 1.112.0 → 1.113.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.
@@ -24,6 +24,9 @@ export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
24
24
  private lifecycleState;
25
25
  private downloadLockHandle;
26
26
  private stopRequested;
27
+ private lastEngineExitCode;
28
+ private lastEngineExitSignal;
29
+ private reachedRunningState;
27
30
  protected readonly modelsDirectory: string;
28
31
  constructor({ contextLength, engineConfig, enginePort, engineType, logger, model, root }: {
29
32
  contextLength?: number | null;
@@ -43,7 +46,10 @@ export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
43
46
  stop(): Promise<void>;
44
47
  get canStart(): boolean;
45
48
  get canStop(): boolean;
49
+ get lastExitCode(): number | null;
50
+ get lastExitSignal(): NodeJS.Signals | null;
46
51
  get state(): EngineLifecycleState;
52
+ get wasRunning(): boolean;
47
53
  private checkEngineReadiness;
48
54
  private checkGenericHealthReadiness;
49
55
  private checkLlamacppReadiness;
@@ -0,0 +1,12 @@
1
+ import { EngineExecutionErrorType } from "@infersec/definitions";
2
+ /**
3
+ * Coarse engine-failure classification used only to fill `engine_execution.error_type`. Exit code and
4
+ * terminating signal are consulted FIRST (SIGKILL/SIGSEGV are reliable OOM signals regardless of
5
+ * how much stderr the engine produced); the message text then refines the category. Anything
6
+ * unrecognized is "unknown".
7
+ */
8
+ export declare function classifyEngineFailure({ error, exitCode, signal }: {
9
+ error: Error;
10
+ exitCode: number | null;
11
+ signal?: NodeJS.Signals | null;
12
+ }): EngineExecutionErrorType;
@@ -0,0 +1,54 @@
1
+ import { EngineExecutionErrorType, EngineExecutionReportPayload, LLMEngine } from "@infersec/definitions";
2
+ import { Logger } from "@infersec/logger";
3
+ export interface EngineExecutionReportSource {
4
+ durationMs: number;
5
+ errorDetail: string | null;
6
+ errorType: EngineExecutionErrorType | null;
7
+ ttftMs: number;
8
+ throughput: {
9
+ avgTps: number;
10
+ peakTps: number | null;
11
+ };
12
+ usage: {
13
+ completionTokens: number;
14
+ promptTokens: number;
15
+ totalTokens: number;
16
+ };
17
+ }
18
+ /**
19
+ * Flattens flat CLI extra-arg tokens into [arg, value] pairs, sorted by ARG NAME (ascending, ties by
20
+ * value). `--flag=value` pairs split on the first `=`; a bare `--flag` consumes the following token
21
+ * as its value when that token does not start with "-" (classic CLI convention); anything else
22
+ * (flags, non-strings) is dropped.
23
+ */
24
+ export declare function pairExtraArgs(tokens: unknown): Array<[string, string]>;
25
+ /**
26
+ * Files AT MOST ONE engine_execution report per engine startup. `beginStartup(runAt)` re-arms the
27
+ * latch on every fresh model start (initial boot or cycle) and stamps the startup epoch used as the
28
+ * row's `run_at`. Whichever of the three report* paths fires first wins: startup failure, in-flight
29
+ * crash, or first successful full prompt completion.
30
+ */
31
+ export declare class EngineExecutionReporter {
32
+ private readonly options;
33
+ private currentStartupAt;
34
+ private reportedForCurrentStartup;
35
+ constructor(options: {
36
+ buildContext: () => {
37
+ engineType: LLMEngine;
38
+ engineVersion: string | null;
39
+ extraArgsPairs: Array<[string, string]>;
40
+ };
41
+ logger: Logger;
42
+ report: (payload: EngineExecutionReportPayload) => Promise<void>;
43
+ sourceLabel: string;
44
+ });
45
+ /** Re-arms the latch; the stamp becomes the row's `run_at` (moment startup began). */
46
+ beginStartup(runAt: Date): void;
47
+ /** Reports a startup failure (rejected prepare/start, readiness timeout, pre-ready death). */
48
+ reportStartupFailure(report: EngineExecutionReportSource): Promise<void>;
49
+ /** Reports a spontaneous crash of an engine that had reached the running state. */
50
+ reportRuntimeCrash(report: EngineExecutionReportSource): Promise<void>;
51
+ /** Reports the first fully-responded, token-bearing prompt completion since startup. */
52
+ reportSuccess(report: EngineExecutionReportSource): Promise<void>;
53
+ private file;
54
+ }
@@ -0,0 +1 @@
1
+ export { EngineExecutionReporter, type EngineExecutionReportSource, pairExtraArgs } from "./engineExecutionReporter.js";
@@ -86,7 +86,7 @@ export declare function createPostMessagesHandler(options: {
86
86
  budget_tokens: number;
87
87
  type: "enabled";
88
88
  } | undefined;
89
- tool_choice?: "none" | "any" | "auto" | {
89
+ tool_choice?: "any" | "none" | "auto" | {
90
90
  type: "auto";
91
91
  disable_parallel_tool_use?: boolean | undefined;
92
92
  } | {
@@ -1,8 +1,26 @@
1
1
  import type { InferenceAgentMachineMetadata } from "@infersec/definitions";
2
2
  import type { Logger } from "@infersec/logger";
3
3
  export declare function normalizeBusAddress(bus: string | null | undefined): string | null;
4
+ export declare function parseRocmSmiMemory({ keyPrefix, stdout }: {
5
+ keyPrefix: "GTT" | "VRAM";
6
+ stdout: string;
7
+ }): Array<{
8
+ bus: string;
9
+ memoryTotalBytes: number | null;
10
+ memoryUsedBytes: number | null;
11
+ }>;
4
12
  export declare function parseNvidiaSmiNumber(value: string | undefined): number | null;
5
13
  export declare function parseNvidiaSmiMemoryBytes(value: string | undefined): number | null;
14
+ export declare function mergeGTTMemory({ gttTotalBytes, gttUsedBytes, systemTotalBytes, vramTotalBytes, vramUsedBytes }: {
15
+ gttTotalBytes: number | null;
16
+ gttUsedBytes: number | null;
17
+ systemTotalBytes: number | null;
18
+ vramTotalBytes: number | null;
19
+ vramUsedBytes: number | null;
20
+ }): {
21
+ memoryTotalBytes: number | null;
22
+ memoryUsedBytes: number | null;
23
+ };
6
24
  export declare function collectMachineMetadata({ logger }: {
7
25
  logger: Logger;
8
26
  }): Promise<InferenceAgentMachineMetadata>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infersec/conduit",
3
3
  "description": "End user conduit agent for connecting local LLMs to the cloud.",
4
- "version": "1.112.0",
4
+ "version": "1.113.0",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },