refactor(workspace): rewrite @ktx/llm imports to relative paths

This commit is contained in:
Andrey Avtomonov 2026-05-21 03:09:44 +02:00
parent 8d2a36eb2f
commit 8c2333cc15
19 changed files with 38 additions and 18 deletions

View file

@ -35,6 +35,9 @@
"type-check": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@ai-sdk/anthropic": "3.0.77",
"@ai-sdk/devtools": "0.0.17",
"@ai-sdk/google-vertex": "^4.0.128",
"@clack/prompts": "1.4.0",
"@commander-js/extra-typings": "14.0.0",
"@ktx/connector-bigquery": "workspace:*",
@ -47,9 +50,11 @@
"@ktx/context": "workspace:*",
"@ktx/llm": "workspace:*",
"@modelcontextprotocol/sdk": "^1.29.0",
"ai": "^6.0.180",
"commander": "14.0.3",
"fflate": "^0.8.2",
"ink": "^7.0.2",
"openai": "^6.37.0",
"react": "^19.2.6",
"zod": "^4.4.3"
},

View file

@ -1,7 +1,7 @@
import {
type KtxEmbeddingProvider,
createKtxEmbeddingProvider as defaultCreateKtxEmbeddingProvider,
} from '@ktx/llm';
} from './llm/index.js';
import type { KtxLocalProject, KtxProjectEmbeddingConfig } from '@ktx/context/project';
import { resolveLocalKtxEmbeddingConfig } from '@ktx/context';
import type { KtxCliIo } from './cli-runtime.js';

View file

@ -1,4 +1,4 @@
import type { KtxEmbeddingConfig } from '@ktx/llm';
import type { KtxEmbeddingConfig } from './llm/index.js';
import type { KtxCliIo } from './cli-runtime.js';
import {
ensureManagedPythonCommandRuntime,

View file

@ -8,7 +8,7 @@ import {
readKtxSetupState,
serializeKtxProjectConfig,
} from '@ktx/context/project';
import { type KtxEmbeddingConfig, type KtxEmbeddingHealthCheckResult, runKtxEmbeddingHealthCheck } from '@ktx/llm';
import { type KtxEmbeddingConfig, type KtxEmbeddingHealthCheckResult, runKtxEmbeddingHealthCheck } from './llm/index.js';
import type { KtxCliIo } from './cli-runtime.js';
import { createStaticCliSpinner, type KtxCliSpinner } from './clack.js';
import {

View file

@ -10,7 +10,7 @@ import {
markKtxSetupStateStepComplete,
serializeKtxProjectConfig,
} from '@ktx/context/project';
import { type KtxLlmConfig, type KtxLlmHealthCheckResult, runKtxLlmHealthCheck } from '@ktx/llm';
import { type KtxLlmConfig, type KtxLlmHealthCheckResult, runKtxLlmHealthCheck } from './llm/index.js';
import {
formatClaudeCodePromptCachingWarning,
ignoredClaudeCodePromptCachingFields,

View file

@ -1,4 +1,4 @@
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../../cli/src/llm/index.js';
import { type KtxLogger, noopLogger } from '../../core/index.js';
import type { AgentRunnerPort, KtxRuntimeToolSet } from '../../llm/index.js';
import type { MemoryAction } from '../../memory/index.js';

View file

@ -15,7 +15,7 @@ import {
type KtxLlmRuntimePort,
type KtxRuntimeToolSet,
} from '../llm/index.js';
import type { KtxEmbeddingProvider } from '@ktx/llm';
import type { KtxEmbeddingProvider } from '../../../cli/src/llm/index.js';
import type { KtxLocalProject } from '../project/index.js';
import { ktxLocalStateDbPath } from '../project/index.js';
import { PromptService } from '../prompts/index.js';

View file

@ -34,7 +34,7 @@ export interface RunLocalIngestOptions {
semanticLayerCompute?: KtxSemanticLayerComputePort;
queryExecutor?: KtxSqlQueryExecutorPort;
logger?: KtxLogger;
embeddingProvider?: import('@ktx/llm').KtxEmbeddingProvider | null;
embeddingProvider?: import('../../../cli/src/llm/index.js').KtxEmbeddingProvider | null;
}
export interface LocalIngestMcpOptions
@ -173,7 +173,7 @@ async function runScheduledPullJob(options: {
semanticLayerCompute?: KtxSemanticLayerComputePort;
queryExecutor?: KtxSqlQueryExecutorPort;
logger?: KtxLogger;
embeddingProvider?: import('@ktx/llm').KtxEmbeddingProvider | null;
embeddingProvider?: import('../../../cli/src/llm/index.js').KtxEmbeddingProvider | null;
}): Promise<LocalIngestResult> {
const runtime = createLocalBundleIngestRuntime(options);
const jobId = options.jobId ?? runtime.nextJobId();

View file

@ -1,4 +1,4 @@
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../cli/src/llm/index.js';
import type { KtxEmbeddingPort } from '../core/embedding.js';
import type { GitService, KtxFileStorePort, KtxLogger, SessionOutcome } from '../core/index.js';
import type { AgentRunnerPort, KtxLlmRuntimePort, KtxRuntimeToolSet } from '../llm/index.js';

View file

@ -1,4 +1,4 @@
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../../cli/src/llm/index.js';
import type { AgentRunnerPort, KtxRuntimeToolSet } from '@ktx/context';
import type { CaptureSession, MemoryAction } from '../../memory/index.js';
import { listTouchedSlSources, type TouchedSlSource } from '../../tools/index.js';

View file

@ -1,5 +1,5 @@
import type { AgentRunnerPort, KtxRuntimeToolSet } from '@ktx/context';
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../../cli/src/llm/index.js';
import type { EvictionUnit } from '../types.js';
import type { StageIndex } from './stage-index.types.js';

View file

@ -1,4 +1,4 @@
import { KtxMessageBuilder, splitKtxSystemMessages, type KtxLlmProvider } from '@ktx/llm';
import { KtxMessageBuilder, splitKtxSystemMessages, type KtxLlmProvider } from '../../../cli/src/llm/index.js';
import { generateText, Output, stepCountIs, type FlexibleSchema, type TelemetrySettings, type ToolSet } from 'ai';
import type { z } from 'zod';
import { noopLogger, type KtxLogger } from '../core/index.js';

View file

@ -1,7 +1,7 @@
import { appendFile, mkdir } from 'node:fs/promises';
import { dirname } from 'node:path';
import type { ModelMessage } from 'ai';
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../cli/src/llm/index.js';
type ProviderOptionsCarrier = { providerOptions?: unknown; [key: string]: unknown };
type ToolMap = Record<string, ProviderOptionsCarrier>;

View file

@ -1,4 +1,4 @@
import type { KtxEmbeddingProvider } from '@ktx/llm';
import type { KtxEmbeddingProvider } from '../../../cli/src/llm/index.js';
import type { KtxEmbeddingPort as KtxIngestEmbeddingPort } from '../core/embedding.js';
import type { KtxEmbeddingPort as KtxScanEmbeddingPort } from '../scan/types.js';

View file

@ -6,7 +6,7 @@ import {
type KtxLlmConfig,
type KtxLlmProvider,
type KtxModelRole,
} from '@ktx/llm';
} from '../../../cli/src/llm/index.js';
import { resolveKtxConfigReference } from '../core/config-reference.js';
import type { KtxProjectEmbeddingConfig, KtxProjectLlmConfig } from '../project/config.js';
import { AiSdkKtxLlmRuntime } from './ai-sdk-runtime.js';

View file

@ -1,4 +1,4 @@
import type { KtxModelRole } from '@ktx/llm';
import type { KtxModelRole } from '../../../cli/src/llm/index.js';
import type { z } from 'zod';
export interface KtxRuntimeToolOutput<TOutput = unknown> {

View file

@ -1,4 +1,4 @@
import { KTX_MODEL_ROLES } from '@ktx/llm';
import { KTX_MODEL_ROLES } from '../../../cli/src/llm/index.js';
import YAML from 'yaml';
import * as z from 'zod';
import { connectionConfigSchema } from './driver-schemas.js';

View file

@ -1,4 +1,4 @@
import type { createKtxEmbeddingProvider, createKtxLlmProvider, KtxEmbeddingProvider } from '@ktx/llm';
import type { createKtxEmbeddingProvider, createKtxLlmProvider, KtxEmbeddingProvider } from '../../../cli/src/llm/index.js';
import {
createDefaultLocalIngestAdapters,
getLocalStageOnlyIngestStatus,

15
pnpm-lock.yaml generated
View file

@ -107,6 +107,15 @@ importers:
packages/cli:
dependencies:
'@ai-sdk/anthropic':
specifier: 3.0.77
version: 3.0.77(zod@4.4.3)
'@ai-sdk/devtools':
specifier: 0.0.17
version: 0.0.17
'@ai-sdk/google-vertex':
specifier: ^4.0.128
version: 4.0.128(zod@4.4.3)
'@clack/prompts':
specifier: 1.4.0
version: 1.4.0
@ -143,6 +152,9 @@ importers:
'@modelcontextprotocol/sdk':
specifier: ^1.29.0
version: 1.29.0(zod@4.4.3)
ai:
specifier: ^6.0.180
version: 6.0.180(zod@4.4.3)
commander:
specifier: 14.0.3
version: 14.0.3
@ -152,6 +164,9 @@ importers:
ink:
specifier: ^7.0.2
version: 7.0.2(@types/react@19.2.14)(react@19.2.6)
openai:
specifier: ^6.37.0
version: 6.37.0(ws@8.20.1)(zod@4.4.3)
react:
specifier: ^19.2.6
version: 19.2.6