@team-semicolon/semo-cli 4.0.1 → 4.0.3

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/database.js CHANGED
@@ -45,12 +45,11 @@ function buildDbConfig() {
45
45
  idleTimeoutMillis: 30000,
46
46
  };
47
47
  }
48
- const DB_CONFIG = buildDbConfig();
49
- // PostgreSQL Pool (싱글톤)
48
+ // PostgreSQL Pool (싱글톤) — 최초 getPool() 호출 시점에 config 평가
50
49
  let pool = null;
51
50
  function getPool() {
52
51
  if (!pool) {
53
- pool = new pg_1.Pool(DB_CONFIG);
52
+ pool = new pg_1.Pool(buildDbConfig());
54
53
  }
55
54
  return pool;
56
55
  }
package/dist/index.js CHANGED
@@ -1193,15 +1193,20 @@ function verifyInstallation(cwd, installedExtensions = []) {
1193
1193
  if (fs.existsSync(claudeAgentsDir)) {
1194
1194
  for (const agent of expectedAgents) {
1195
1195
  const linkPath = path.join(claudeAgentsDir, agent);
1196
- if (fs.existsSync(linkPath) || fs.lstatSync(linkPath).isSymbolicLink()) {
1197
- if (isSymlinkValid(linkPath)) {
1198
- result.stats.agents.linked++;
1199
- }
1200
- else {
1201
- result.stats.agents.broken++;
1202
- result.warnings.push(`깨진 링크: .claude/agents/${agent}`);
1196
+ try {
1197
+ if (fs.existsSync(linkPath) || fs.lstatSync(linkPath).isSymbolicLink()) {
1198
+ if (isSymlinkValid(linkPath)) {
1199
+ result.stats.agents.linked++;
1200
+ }
1201
+ else {
1202
+ result.stats.agents.broken++;
1203
+ result.warnings.push(`깨진 링크: .claude/agents/${agent}`);
1204
+ }
1203
1205
  }
1204
1206
  }
1207
+ catch {
1208
+ // path doesn't exist at all — skip
1209
+ }
1205
1210
  }
1206
1211
  }
1207
1212
  }
@@ -2644,14 +2649,14 @@ kbCmd
2644
2649
  });
2645
2650
  kbCmd
2646
2651
  .command("embed")
2647
- .description("기존 KB 항목에 임베딩 벡터 생성 (VOYAGE_API_KEY 필요)")
2652
+ .description("기존 KB 항목에 임베딩 벡터 생성 (OPENAI_API_KEY 필요)")
2648
2653
  .option("--bot <name>", "봇 KB도 임베딩", detectBotId())
2649
2654
  .option("--domain <name>", "도메인 필터")
2650
2655
  .option("--force", "이미 임베딩된 항목도 재생성")
2651
2656
  .action(async (options) => {
2652
- if (!process.env.VOYAGE_API_KEY) {
2653
- console.log(chalk_1.default.red("❌ VOYAGE_API_KEY 환경변수가 설정되지 않았습니다."));
2654
- console.log(chalk_1.default.gray(" export VOYAGE_API_KEY='pa-...'"));
2657
+ if (!process.env.OPENAI_API_KEY) {
2658
+ console.log(chalk_1.default.red("❌ OPENAI_API_KEY 환경변수가 설정되지 않았습니다."));
2659
+ console.log(chalk_1.default.gray(" export OPENAI_API_KEY='sk-...'"));
2655
2660
  process.exit(1);
2656
2661
  }
2657
2662
  const spinner = (0, ora_1.default)("임베딩 대상 조회 중...").start();
package/dist/kb.d.ts CHANGED
@@ -9,12 +9,12 @@
9
9
  */
10
10
  import { Pool } from "pg";
11
11
  /**
12
- * Generate embedding vector for text using OpenAI API
12
+ * Generate embedding vector for text using OpenAI Embeddings API
13
13
  * Requires OPENAI_API_KEY environment variable
14
14
  */
15
15
  export declare function generateEmbedding(text: string): Promise<number[] | null>;
16
16
  /**
17
- * Generate embeddings for multiple texts (batched)
17
+ * Generate embeddings for multiple texts (OpenAI는 단건 처리, 순차 호출)
18
18
  */
19
19
  export declare function generateEmbeddings(texts: string[]): Promise<(number[] | null)[]>;
20
20
  export interface KBEntry {
package/dist/kb.js CHANGED
@@ -59,18 +59,18 @@ const path = __importStar(require("path"));
59
59
  // ============================================================
60
60
  // Embedding
61
61
  // ============================================================
62
- const EMBEDDING_MODEL = "voyage-3";
63
- const EMBEDDING_DIMENSIONS = 1024;
62
+ const EMBEDDING_MODEL = "text-embedding-3-small";
63
+ const EMBEDDING_DIMENSIONS = 1024; // DB vector(1024) 유지 — OpenAI dimensions 파라미터로 축소
64
64
  /**
65
- * Generate embedding vector for text using OpenAI API
65
+ * Generate embedding vector for text using OpenAI Embeddings API
66
66
  * Requires OPENAI_API_KEY environment variable
67
67
  */
68
68
  async function generateEmbedding(text) {
69
- const apiKey = process.env.VOYAGE_API_KEY;
69
+ const apiKey = process.env.OPENAI_API_KEY;
70
70
  if (!apiKey)
71
71
  return null;
72
72
  try {
73
- const response = await fetch("https://api.voyageai.com/v1/embeddings", {
73
+ const response = await fetch("https://api.openai.com/v1/embeddings", {
74
74
  method: "POST",
75
75
  headers: {
76
76
  "Authorization": `Bearer ${apiKey}`,
@@ -78,7 +78,7 @@ async function generateEmbedding(text) {
78
78
  },
79
79
  body: JSON.stringify({
80
80
  model: EMBEDDING_MODEL,
81
- input: text.substring(0, 8000), // truncate to avoid token limit
81
+ input: text.substring(0, 8000),
82
82
  dimensions: EMBEDDING_DIMENSIONS,
83
83
  }),
84
84
  });
@@ -96,14 +96,14 @@ async function generateEmbedding(text) {
96
96
  }
97
97
  }
98
98
  /**
99
- * Generate embeddings for multiple texts (batched)
99
+ * Generate embeddings for multiple texts (OpenAI는 단건 처리, 순차 호출)
100
100
  */
101
101
  async function generateEmbeddings(texts) {
102
- const apiKey = process.env.VOYAGE_API_KEY;
102
+ const apiKey = process.env.OPENAI_API_KEY;
103
103
  if (!apiKey)
104
104
  return texts.map(() => null);
105
105
  try {
106
- const response = await fetch("https://api.voyageai.com/v1/embeddings", {
106
+ const response = await fetch("https://api.openai.com/v1/embeddings", {
107
107
  method: "POST",
108
108
  headers: {
109
109
  "Authorization": `Bearer ${apiKey}`,
@@ -111,8 +111,8 @@ async function generateEmbeddings(texts) {
111
111
  },
112
112
  body: JSON.stringify({
113
113
  model: EMBEDDING_MODEL,
114
- input: texts.map(t => t.substring(0, 16000)),
115
- output_dimension: EMBEDDING_DIMENSIONS,
114
+ input: texts.map(t => t.substring(0, 8000)),
115
+ dimensions: EMBEDDING_DIMENSIONS,
116
116
  }),
117
117
  });
118
118
  if (!response.ok)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-semicolon/semo-cli",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "SEMO CLI - AI Agent Orchestration Framework Installer",
5
5
  "main": "dist/index.js",
6
6
  "bin": {