@omnicross/daemon 0.1.7 → 0.1.9

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.cts CHANGED
@@ -2,7 +2,7 @@ import * as _omnicross_core from '@omnicross/core';
2
2
  import { OutboundApiServerConfig, Logger, ProviderConfigSource, TransformerService, Transformer, ResolvedTransformerChain, ApiServerSettingsStore, PricingStore, AutomaticPricingSource, OutboundKeyDb, OutboundKeyDbRow, OutboundKeyPolicy, PricingEngine as PricingEngine$1 } from '@omnicross/core';
3
3
  import { ApiKeyPoolService } from '@omnicross/core/completion/ApiKeyPoolService';
4
4
  import { AllowanceSchedulingConfig, AccountProbeConfig, OutboundKeyDb as OutboundKeyDb$1, VoucherDb, KeySpendReader, OutboundApiServer } from '@omnicross/core/outbound-api';
5
- import { ProviderProxy } from '@omnicross/core/provider-proxy';
5
+ import { RouteLeaseManager, ProviderProxy } from '@omnicross/core/provider-proxy';
6
6
  import { UsageRecorder, PricingEngine } from '@omnicross/core/usage';
7
7
  import { SubscriptionCredentialStore, FetchLike, SubscriptionProviderRegistry, SubscriptionAccountService } from '@omnicross/subscriptions';
8
8
  import { AccountAllowanceSnapshot } from '@omnicross/contracts/account-allowance-types';
@@ -15,6 +15,7 @@ import { SubscriptionIdentityStore } from '@omnicross/core/provider-proxy/identi
15
15
  import { LoggingConfig, HealthReport } from '@omnicross/contracts/health-logging-types';
16
16
  import { SubscriptionAccountHealth } from '@omnicross/core/pipeline/SubscriptionAccountHealth';
17
17
  import { fetchUpstream } from '@omnicross/core/pipeline/upstreamFetch';
18
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
18
19
  import { AuditRecord, AuditStats, AuditConfig } from '@omnicross/contracts/audit-types';
19
20
  import { BillingDeliveryStatus, BillingConfig, BillingEvent } from '@omnicross/contracts/billing-types';
20
21
  import http from 'node:http';
@@ -145,11 +146,11 @@ interface DaemonApiKeyEntry {
145
146
  /**
146
147
  * Per-model metadata subset (app-parity child 2). A hand-authored SUBSET of the
147
148
  * app's `ModelConfig` (`app/src/shared-types/llm-config.ts`), carrying ONLY the
148
- * named-five fields the daemon stores + round-trips, keyed by the model `id`:
149
- * `name` (display name), `enabled`, `group`, `vision`, `reasoning`. The wider
149
+ * allowlisted fields the daemon stores + round-trips, keyed by the model `id`:
150
+ * display metadata plus target thinking capabilities. The wider
150
151
  * `ModelConfig` fields the discovery flow may send (`category`/`contextLength`/
151
152
  * `maxTokens`/`functionCall`/`webSearch`/`completionSettings`/`openRouterProvider`/
152
- * `thinkingLevels`/…) are NOT in this allowlist — they are DROPPED by
153
+ * fields are NOT in this allowlist — they are DROPPED by
153
154
  * deny-by-default (`validateModelConfigs`/`parseModelConfigsInput`).
154
155
  *
155
156
  * ENFORCEMENT (app-parity-2 child 2): `enabled` is now a DISCOVERY/advertisement
@@ -158,8 +159,8 @@ interface DaemonApiKeyEntry {
158
159
  * advertisement, NOT a hard per-request block (core does not validate a requested
159
160
  * model against `models[]`, so a hardcoded disabled model id still reaches the
160
161
  * upstream, which rejects it). The admin management view (`toProviderView`) still
161
- * lists ALL models. The other fields (`name`/`group`/`vision`/`reasoning`) remain
162
- * display-only metadata (no core per-model capability binding on the BYO path).
162
+ * lists ALL models. `name`/`group`/`vision`/`reasoning` remain display metadata;
163
+ * thinking capabilities are projected into core for request negotiation.
163
164
  */
164
165
  interface DaemonModelConfig {
165
166
  /** Model id — the metadata key (parallels an entry in the flat `models[]`). */
@@ -175,6 +176,13 @@ interface DaemonModelConfig {
175
176
  vision?: boolean;
176
177
  /** Reasoning-capable hint (display only; not consumed by routing). */
177
178
  reasoning?: boolean;
179
+ /** Discrete reasoning efforts accepted by this target model. */
180
+ thinkingLevels?: ThinkLevel[];
181
+ /** Valid legacy thinking-budget bounds for this target model. */
182
+ thinkingTokenLimit?: {
183
+ min: number;
184
+ max: number;
185
+ };
178
186
  }
179
187
  /**
180
188
  * One transformer chain entry (app-parity child 5). Mirrors the app's
@@ -1831,6 +1839,7 @@ declare class IntegrationManager {
1831
1839
  /** Injectable PATH probe (tests stub this; default scans `process.env.PATH`). */
1832
1840
  type PathProbe = (candidate: string) => string | null;
1833
1841
  /** Open a NEW terminal window running `command [extraArgs…]` with `env` injected. */
1842
+ type TerminalCleanup = () => void;
1834
1843
  type TerminalOpener = (input: {
1835
1844
  cli: string;
1836
1845
  command: string;
@@ -1838,7 +1847,8 @@ type TerminalOpener = (input: {
1838
1847
  env: Record<string, string>;
1839
1848
  cwd?: string;
1840
1849
  platform: NodeJS.Platform;
1841
- }) => void;
1850
+ onFailure?: () => void;
1851
+ }) => void | TerminalCleanup;
1842
1852
  /**
1843
1853
  * Injectable shell runner for `POST /cli/:cli/install` (tests stub this; the
1844
1854
  * default execs the install command with a bounded timeout). Returns the host's
@@ -1947,6 +1957,8 @@ interface AdminApiDeps {
1947
1957
  readonly settingsStore: JsonApiServerSettingsStore;
1948
1958
  /** The running outbound server (status + live applyConfig). */
1949
1959
  readonly outboundApiServer: OutboundApiServer;
1960
+ /** Process-local machine-managed routing leases (optional for light embedders). */
1961
+ readonly routeLeaseManager?: RouteLeaseManager;
1950
1962
  /** Subscription accounts (token-free `listAll`). */
1951
1963
  readonly subscriptionAccounts: AdminAccountsLister;
1952
1964
  /**
@@ -2712,6 +2724,7 @@ interface Daemon {
2712
2724
  readonly keyDb: JsonOutboundKeyDb;
2713
2725
  readonly settingsStore: JsonApiServerSettingsStore;
2714
2726
  readonly providerProxy: ProviderProxy;
2727
+ readonly routeLeaseManager: RouteLeaseManager;
2715
2728
  readonly outboundApiServer: OutboundApiServer;
2716
2729
  /**
2717
2730
  * Multi-key load balancer. Wired into the proxy deps slot
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as _omnicross_core from '@omnicross/core';
2
2
  import { OutboundApiServerConfig, Logger, ProviderConfigSource, TransformerService, Transformer, ResolvedTransformerChain, ApiServerSettingsStore, PricingStore, AutomaticPricingSource, OutboundKeyDb, OutboundKeyDbRow, OutboundKeyPolicy, PricingEngine as PricingEngine$1 } from '@omnicross/core';
3
3
  import { ApiKeyPoolService } from '@omnicross/core/completion/ApiKeyPoolService';
4
4
  import { AllowanceSchedulingConfig, AccountProbeConfig, OutboundKeyDb as OutboundKeyDb$1, VoucherDb, KeySpendReader, OutboundApiServer } from '@omnicross/core/outbound-api';
5
- import { ProviderProxy } from '@omnicross/core/provider-proxy';
5
+ import { RouteLeaseManager, ProviderProxy } from '@omnicross/core/provider-proxy';
6
6
  import { UsageRecorder, PricingEngine } from '@omnicross/core/usage';
7
7
  import { SubscriptionCredentialStore, FetchLike, SubscriptionProviderRegistry, SubscriptionAccountService } from '@omnicross/subscriptions';
8
8
  import { AccountAllowanceSnapshot } from '@omnicross/contracts/account-allowance-types';
@@ -15,6 +15,7 @@ import { SubscriptionIdentityStore } from '@omnicross/core/provider-proxy/identi
15
15
  import { LoggingConfig, HealthReport } from '@omnicross/contracts/health-logging-types';
16
16
  import { SubscriptionAccountHealth } from '@omnicross/core/pipeline/SubscriptionAccountHealth';
17
17
  import { fetchUpstream } from '@omnicross/core/pipeline/upstreamFetch';
18
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
18
19
  import { AuditRecord, AuditStats, AuditConfig } from '@omnicross/contracts/audit-types';
19
20
  import { BillingDeliveryStatus, BillingConfig, BillingEvent } from '@omnicross/contracts/billing-types';
20
21
  import http from 'node:http';
@@ -145,11 +146,11 @@ interface DaemonApiKeyEntry {
145
146
  /**
146
147
  * Per-model metadata subset (app-parity child 2). A hand-authored SUBSET of the
147
148
  * app's `ModelConfig` (`app/src/shared-types/llm-config.ts`), carrying ONLY the
148
- * named-five fields the daemon stores + round-trips, keyed by the model `id`:
149
- * `name` (display name), `enabled`, `group`, `vision`, `reasoning`. The wider
149
+ * allowlisted fields the daemon stores + round-trips, keyed by the model `id`:
150
+ * display metadata plus target thinking capabilities. The wider
150
151
  * `ModelConfig` fields the discovery flow may send (`category`/`contextLength`/
151
152
  * `maxTokens`/`functionCall`/`webSearch`/`completionSettings`/`openRouterProvider`/
152
- * `thinkingLevels`/…) are NOT in this allowlist — they are DROPPED by
153
+ * fields are NOT in this allowlist — they are DROPPED by
153
154
  * deny-by-default (`validateModelConfigs`/`parseModelConfigsInput`).
154
155
  *
155
156
  * ENFORCEMENT (app-parity-2 child 2): `enabled` is now a DISCOVERY/advertisement
@@ -158,8 +159,8 @@ interface DaemonApiKeyEntry {
158
159
  * advertisement, NOT a hard per-request block (core does not validate a requested
159
160
  * model against `models[]`, so a hardcoded disabled model id still reaches the
160
161
  * upstream, which rejects it). The admin management view (`toProviderView`) still
161
- * lists ALL models. The other fields (`name`/`group`/`vision`/`reasoning`) remain
162
- * display-only metadata (no core per-model capability binding on the BYO path).
162
+ * lists ALL models. `name`/`group`/`vision`/`reasoning` remain display metadata;
163
+ * thinking capabilities are projected into core for request negotiation.
163
164
  */
164
165
  interface DaemonModelConfig {
165
166
  /** Model id — the metadata key (parallels an entry in the flat `models[]`). */
@@ -175,6 +176,13 @@ interface DaemonModelConfig {
175
176
  vision?: boolean;
176
177
  /** Reasoning-capable hint (display only; not consumed by routing). */
177
178
  reasoning?: boolean;
179
+ /** Discrete reasoning efforts accepted by this target model. */
180
+ thinkingLevels?: ThinkLevel[];
181
+ /** Valid legacy thinking-budget bounds for this target model. */
182
+ thinkingTokenLimit?: {
183
+ min: number;
184
+ max: number;
185
+ };
178
186
  }
179
187
  /**
180
188
  * One transformer chain entry (app-parity child 5). Mirrors the app's
@@ -1831,6 +1839,7 @@ declare class IntegrationManager {
1831
1839
  /** Injectable PATH probe (tests stub this; default scans `process.env.PATH`). */
1832
1840
  type PathProbe = (candidate: string) => string | null;
1833
1841
  /** Open a NEW terminal window running `command [extraArgs…]` with `env` injected. */
1842
+ type TerminalCleanup = () => void;
1834
1843
  type TerminalOpener = (input: {
1835
1844
  cli: string;
1836
1845
  command: string;
@@ -1838,7 +1847,8 @@ type TerminalOpener = (input: {
1838
1847
  env: Record<string, string>;
1839
1848
  cwd?: string;
1840
1849
  platform: NodeJS.Platform;
1841
- }) => void;
1850
+ onFailure?: () => void;
1851
+ }) => void | TerminalCleanup;
1842
1852
  /**
1843
1853
  * Injectable shell runner for `POST /cli/:cli/install` (tests stub this; the
1844
1854
  * default execs the install command with a bounded timeout). Returns the host's
@@ -1947,6 +1957,8 @@ interface AdminApiDeps {
1947
1957
  readonly settingsStore: JsonApiServerSettingsStore;
1948
1958
  /** The running outbound server (status + live applyConfig). */
1949
1959
  readonly outboundApiServer: OutboundApiServer;
1960
+ /** Process-local machine-managed routing leases (optional for light embedders). */
1961
+ readonly routeLeaseManager?: RouteLeaseManager;
1950
1962
  /** Subscription accounts (token-free `listAll`). */
1951
1963
  readonly subscriptionAccounts: AdminAccountsLister;
1952
1964
  /**
@@ -2712,6 +2724,7 @@ interface Daemon {
2712
2724
  readonly keyDb: JsonOutboundKeyDb;
2713
2725
  readonly settingsStore: JsonApiServerSettingsStore;
2714
2726
  readonly providerProxy: ProviderProxy;
2727
+ readonly routeLeaseManager: RouteLeaseManager;
2715
2728
  readonly outboundApiServer: OutboundApiServer;
2716
2729
  /**
2717
2730
  * Multi-key load balancer. Wired into the proxy deps slot