@skillrecordings/cli 0.20.0 → 0.21.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.
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-ZNF7XD2S.js";
18
18
  import {
19
19
  queryVectors
20
- } from "./chunk-H3D6VCME.js";
20
+ } from "./chunk-ZZGGSV6N.js";
21
21
  import {
22
22
  createTool
23
23
  } from "./chunk-F4EM72IH.js";
@@ -25,7 +25,7 @@ import {
25
25
  AppsTable,
26
26
  database,
27
27
  eq
28
- } from "./chunk-V34YUISF.js";
28
+ } from "./chunk-SCSLY3L5.js";
29
29
  import {
30
30
  init_esm_shims
31
31
  } from "./chunk-WFANXVQG.js";
@@ -15606,4 +15606,4 @@ export {
15606
15606
  DEFAULT_AGENT_MODEL,
15607
15607
  runSupportAgent
15608
15608
  };
15609
- //# sourceMappingURL=chunk-GNPR4OKX.js.map
15609
+ //# sourceMappingURL=chunk-UTPBU2WN.js.map
@@ -29,17 +29,19 @@ function getVectorIndex() {
29
29
  }
30
30
  return _index;
31
31
  }
32
- async function upsertVector(document) {
32
+ async function upsertVector(document, namespace) {
33
33
  const index = getVectorIndex();
34
- return index.upsert({
34
+ const target = namespace ? index.namespace(namespace) : index;
35
+ return target.upsert({
35
36
  id: document.id,
36
37
  data: document.data,
37
38
  metadata: document.metadata
38
39
  });
39
40
  }
40
- async function queryVectors(options) {
41
+ async function queryVectors(options, namespace) {
41
42
  const index = getVectorIndex();
42
- const results = await index.query(options);
43
+ const target = namespace ? index.namespace(namespace) : index;
44
+ const results = await target.query(options);
43
45
  return results.map((result) => ({
44
46
  id: String(result.id),
45
47
  score: result.score,
@@ -52,4 +54,4 @@ export {
52
54
  upsertVector,
53
55
  queryVectors
54
56
  };
55
- //# sourceMappingURL=chunk-H3D6VCME.js.map
57
+ //# sourceMappingURL=chunk-ZZGGSV6N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../core/src/vector/client.ts"],"sourcesContent":["import { Index } from '@upstash/vector'\nimport type {\n VectorDocument,\n VectorDocumentMetadata,\n VectorQueryResult,\n} from './types'\n\n/**\n * Lazy-initialized Upstash Vector index singleton.\n * Use this pattern to avoid creating connections at import time in serverless environments.\n */\nlet _index: Index | null = null\n\n/**\n * Get or create the Upstash Vector index instance.\n * Uses lazy initialization to defer connection until first use.\n *\n * @throws {Error} If UPSTASH_VECTOR_REST_URL or UPSTASH_VECTOR_REST_TOKEN env vars are missing\n */\nexport function getVectorIndex(): Index {\n if (!_index) {\n const url = process.env.UPSTASH_VECTOR_REST_URL\n const token = process.env.UPSTASH_VECTOR_REST_TOKEN\n\n if (!url) {\n throw new Error(\n 'UPSTASH_VECTOR_REST_URL environment variable is required'\n )\n }\n if (!token) {\n throw new Error(\n 'UPSTASH_VECTOR_REST_TOKEN environment variable is required'\n )\n }\n\n _index = new Index({\n url,\n token,\n })\n }\n\n return _index\n}\n\n/**\n * Options for querying vectors\n */\nexport interface QueryVectorsOptions {\n /** The search query text */\n data: string\n /** Number of results to return */\n topK: number\n /** Include metadata in results */\n includeMetadata?: boolean\n /** Include data in results */\n includeData?: boolean\n /** Metadata filter expression */\n filter?: string\n}\n\n/**\n * Upsert a vector document into the index.\n *\n * @param document - The vector document to upsert\n * @param namespace - Optional namespace for scoped storage (e.g., 'resolved-threads')\n * @returns Promise resolving to the upsert result\n */\nexport async function upsertVector(\n document: VectorDocument,\n namespace?: string\n): Promise<unknown> {\n const index = getVectorIndex()\n const target = namespace ? index.namespace(namespace) : index\n return target.upsert({\n id: document.id,\n data: document.data,\n metadata: document.metadata,\n })\n}\n\n/**\n * Query vectors by semantic similarity.\n *\n * @param options - Query options including search text, topK, and filters\n * @param namespace - Optional namespace for scoped queries (e.g., 'resolved-threads')\n * @returns Promise resolving to array of query results\n */\nexport async function queryVectors(\n options: QueryVectorsOptions,\n namespace?: string\n): Promise<VectorQueryResult[]> {\n const index = getVectorIndex()\n const target = namespace ? index.namespace(namespace) : index\n const results = await target.query(options)\n\n return results.map((result) => ({\n id: String(result.id),\n score: result.score,\n data: result.data,\n metadata: result.metadata as VectorDocumentMetadata | undefined,\n }))\n}\n"],"mappings":";;;;;;;;AAAA;AAWA,IAAI,SAAuB;AAQpB,SAAS,iBAAwB;AACtC,MAAI,CAAC,QAAQ;AACX,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,QAAQ,QAAQ,IAAI;AAE1B,QAAI,CAAC,KAAK;AACR,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,QAAI,CAAC,OAAO;AACV,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,aAAS,IAAI,OAAM;AAAA,MACjB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAyBA,eAAsB,aACpB,UACA,WACkB;AAClB,QAAM,QAAQ,eAAe;AAC7B,QAAM,SAAS,YAAY,MAAM,UAAU,SAAS,IAAI;AACxD,SAAO,OAAO,OAAO;AAAA,IACnB,IAAI,SAAS;AAAA,IACb,MAAM,SAAS;AAAA,IACf,UAAU,SAAS;AAAA,EACrB,CAAC;AACH;AASA,eAAsB,aACpB,SACA,WAC8B;AAC9B,QAAM,QAAQ,eAAe;AAC7B,QAAM,SAAS,YAAY,MAAM,UAAU,SAAS,IAAI;AACxD,QAAM,UAAU,MAAM,OAAO,MAAM,OAAO;AAE1C,SAAO,QAAQ,IAAI,CAAC,YAAY;AAAA,IAC9B,IAAI,OAAO,OAAO,EAAE;AAAA,IACpB,OAAO,OAAO;AAAA,IACd,MAAM,OAAO;AAAA,IACb,UAAU,OAAO;AAAA,EACnB,EAAE;AACJ;","names":[]}
@@ -3,14 +3,14 @@ import {
3
3
  SUPPORT_AGENT_PROMPT,
4
4
  agentTools,
5
5
  runSupportAgent
6
- } from "./chunk-GNPR4OKX.js";
6
+ } from "./chunk-UTPBU2WN.js";
7
7
  import "./chunk-HKRLO2GE.js";
8
8
  import "./chunk-MLNDSBZ4.js";
9
9
  import "./chunk-ZNF7XD2S.js";
10
- import "./chunk-H3D6VCME.js";
10
+ import "./chunk-ZZGGSV6N.js";
11
11
  import "./chunk-MG37YDAK.js";
12
12
  import "./chunk-F4EM72IH.js";
13
- import "./chunk-V34YUISF.js";
13
+ import "./chunk-SCSLY3L5.js";
14
14
  import "./chunk-WFANXVQG.js";
15
15
  export {
16
16
  DEFAULT_AGENT_MODEL,
@@ -18,4 +18,4 @@ export {
18
18
  agentTools,
19
19
  runSupportAgent
20
20
  };
21
- //# sourceMappingURL=config-HHQF5U6R.js.map
21
+ //# sourceMappingURL=config-3GIHLVO4.js.map