@tenex-chat/backend 0.9.7 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenex-chat/backend",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "TENEX Command Line Interface",
5
5
  "bin": {
6
6
  "tenex-backend": "./dist/daemon-wrapper.cjs"
@@ -68,6 +68,8 @@
68
68
  "commander": "^14.0.3",
69
69
  "cron-parser": "^5.5.0",
70
70
  "duck-duck-scrape": "^2.2.7",
71
+ "@inquirer/ansi": "^2.0.3",
72
+ "@inquirer/core": "^11.1.5",
71
73
  "inquirer": "^13.2.2",
72
74
  "lmdb": "^3.5.1",
73
75
  "lodash": "^4.17.23",
@@ -9,6 +9,7 @@
9
9
  import { createProviderRegistry } from "ai";
10
10
  import type { ProviderRegistryProvider } from "ai";
11
11
  import type { ProviderV3 } from "@ai-sdk/provider";
12
+ import { createMockProvider } from "../MockProvider";
12
13
  import { logger } from "@/utils/logger";
13
14
  import { keyManager } from "../key-manager";
14
15
  import type {
@@ -253,7 +254,6 @@ export class ProviderRegistry {
253
254
  */
254
255
  private async initializeMockProvider(): Promise<void> {
255
256
  try {
256
- const { createMockProvider } = await import("../MockProvider");
257
257
  const mockProvider = createMockProvider();
258
258
 
259
259
  // Create a wrapper that satisfies ILLMProvider
@@ -12,6 +12,8 @@ import { getProjectContext } from "@/services/projects";
12
12
  import { ReportService } from "@/services/reports";
13
13
  import { SchedulerService } from "@/services/scheduling";
14
14
  import { formatLessonsWithReminder } from "@/utils/lessonFormatter";
15
+ import { agentsMdService } from "@/services/agents-md";
16
+ import { RAGService } from "@/services/rag/RAGService";
15
17
  import { logger } from "@/utils/logger";
16
18
  import type { NDKProject } from "@nostr-dev-kit/ndk";
17
19
  import type { ModelMessage } from "ai";
@@ -251,7 +253,6 @@ async function addCoreAgentFragments(
251
253
  // Add RAG collection attribution - shows agents their contributions to RAG collections
252
254
  // This uses the provenance tracking metadata (agent_pubkey) from document ingestion
253
255
  try {
254
- const { RAGService } = await import("@/services/rag/RAGService");
255
256
  const ragService = RAGService.getInstance();
256
257
  const collections = await ragService.getAllCollectionStats(agent.pubkey);
257
258
 
@@ -716,7 +717,6 @@ async function buildMainSystemPrompt(options: BuildSystemPromptOptions): Promise
716
717
  // When no AGENTS.md exists, the fragment explicitly states so
717
718
  if (projectBasePath) {
718
719
  try {
719
- const { agentsMdService } = await import("@/services/agents-md");
720
720
  const hasRootAgentsMd = await agentsMdService.hasRootAgentsMd(projectBasePath);
721
721
  const rootContent = hasRootAgentsMd
722
722
  ? await agentsMdService.getRootAgentsMdContent(projectBasePath)
@@ -13,6 +13,7 @@ import { config } from "@/services/ConfigService";
13
13
  import { PROVIDER_IDS } from "@/llm/providers/provider-ids";
14
14
  import { llmOpsRegistry, INJECTION_ABORT_REASON } from "@/services/LLMOperationsRegistry";
15
15
  import { getProjectContext, type ProjectContext } from "@/services/projects";
16
+ import { CooldownRegistry } from "@/services/CooldownRegistry";
16
17
  import { RALRegistry } from "@/services/ral";
17
18
  import type { RALRegistryEntry } from "@/services/ral/types";
18
19
  import { logger } from "@/utils/logger";
@@ -832,7 +833,6 @@ export class AgentDispatchService {
832
833
  span: ReturnType<typeof tracer.startSpan>,
833
834
  eventType: "delegation_completion" | "routing"
834
835
  ): Promise<boolean> {
835
- const { CooldownRegistry } = await import("@/services/CooldownRegistry");
836
836
  const cooldownRegistry = CooldownRegistry.getInstance();
837
837
 
838
838
  if (cooldownRegistry.isInCooldown(projectId, conversationId, agentPubkey)) {
@@ -1,4 +1,6 @@
1
1
  import * as path from "node:path";
2
+ import { createOpenRouter } from "@openrouter/ai-sdk-provider";
3
+ import { generateText } from "ai";
2
4
  import { fileExists, readJsonFile, writeJsonFile, ensureDirectory } from "@/lib/fs";
3
5
  import { config } from "@/services/ConfigService";
4
6
  import { resolveApiKey } from "@/services/config/types";
@@ -149,10 +151,6 @@ export class ImageGenerationService {
149
151
  imageSize,
150
152
  });
151
153
 
152
- // Dynamic import of dependencies
153
- const { createOpenRouter } = await import("@openrouter/ai-sdk-provider");
154
- const { generateText } = await import("ai");
155
-
156
154
  const openrouter = createOpenRouter({
157
155
  apiKey: this.apiKey,
158
156
  headers: {
@@ -1,5 +1,5 @@
1
1
  import * as path from "node:path";
2
- import { fileExists, readJsonFile } from "@/lib/fs";
2
+ import { ensureDirectory, fileExists, readJsonFile, writeJsonFile } from "@/lib/fs";
3
3
  import { config } from "@/services/ConfigService";
4
4
  import { resolveApiKey } from "@/services/config/types";
5
5
  import { logger } from "@/utils/logger";
@@ -252,7 +252,6 @@ export class EmbeddingProviderFactory {
252
252
  configToSave.baseUrl = embeddingConfig.baseUrl;
253
253
  }
254
254
 
255
- const { writeJsonFile, ensureDirectory } = await import("@/lib/fs");
256
255
  await ensureDirectory(basePath);
257
256
  await writeJsonFile(configPath, configToSave);
258
257
 
@@ -2,7 +2,7 @@ import { exec, spawn, type ExecException } from "node:child_process";
2
2
  import { createWriteStream } from "node:fs";
3
3
  import { mkdir } from "node:fs/promises";
4
4
  import { tmpdir } from "node:os";
5
- import { join } from "node:path";
5
+ import { isAbsolute, join, resolve } from "node:path";
6
6
  import { promisify } from "node:util";
7
7
  import type { AISdkTool, ToolExecutionContext } from "@/tools/types";
8
8
  import { logger } from "@/utils/logger";
@@ -180,7 +180,6 @@ async function executeShell(input: ShellInput, context: ToolExecutionContext): P
180
180
  let workingDir: string;
181
181
  if (cwd) {
182
182
  // If cwd is relative (like "."), resolve it against the project working directory
183
- const { isAbsolute, resolve } = await import("node:path");
184
183
  workingDir = isAbsolute(cwd) ? cwd : resolve(context.workingDirectory, cwd);
185
184
  } else {
186
185
  workingDir = context.workingDirectory;