claude-flow 3.7.0-alpha.48 → 3.7.0-alpha.49

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": "claude-flow",
3
- "version": "3.7.0-alpha.48",
3
+ "version": "3.7.0-alpha.49",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1120,5 +1120,71 @@ export const embeddingsTools = [
1120
1120
  return { success: true, handles: registry.list() };
1121
1121
  },
1122
1122
  },
1123
+ // ============================================================
1124
+ // ADR-121 Phase 9 — one-call RAG retrieval (alpha.49 CLI)
1125
+ // ============================================================
1126
+ {
1127
+ name: 'embeddings_search_text',
1128
+ description: "Embed a text query and search a named AnnRouter handle in a single call — the standard RAG retrieval shape. Eliminates the two-call dance of `embeddings_generate` then `embeddings_ann_router_search`. Returns hits plus per-stage latency (embeddingMs + searchMs) so callers can attribute cost. Pair with embeddings_ann_router_build to build the index first. For raw vector input (no embedding step) use embeddings_ann_router_search.",
1129
+ category: 'embeddings',
1130
+ inputSchema: {
1131
+ type: 'object',
1132
+ properties: {
1133
+ text: { type: 'string', description: 'Query text. Will be embedded inline.' },
1134
+ name: { type: 'string', description: 'AnnRouter handle name (set by embeddings_ann_router_build).' },
1135
+ k: { type: 'number', description: 'Number of nearest neighbors.' },
1136
+ },
1137
+ required: ['text', 'name', 'k'],
1138
+ },
1139
+ handler: async (input) => {
1140
+ const config = loadConfig();
1141
+ if (!config) {
1142
+ return {
1143
+ success: false,
1144
+ error: 'Embeddings not initialized. Run embeddings_init first.',
1145
+ };
1146
+ }
1147
+ const text = input.text;
1148
+ const name = input.name;
1149
+ const k = input.k;
1150
+ const tv = validateText(text, 'text');
1151
+ if (!tv.valid)
1152
+ return { success: false, error: tv.error };
1153
+ // Stage 1 — embed the query.
1154
+ const embedT0 = Date.now();
1155
+ let embedding;
1156
+ try {
1157
+ embedding = await generateRealEmbedding(text, config.dimension);
1158
+ }
1159
+ catch (err) {
1160
+ return { success: false, error: `embed failed: ${err instanceof Error ? err.message : String(err)}` };
1161
+ }
1162
+ const embeddingMs = Date.now() - embedT0;
1163
+ // Stage 2 — search the named router handle.
1164
+ const { getAnnRouterRegistry } = await import('../memory/ann-router-registry.js');
1165
+ const registry = getAnnRouterRegistry();
1166
+ const searchT0 = Date.now();
1167
+ try {
1168
+ const hits = await registry.search(name, new Float32Array(embedding), k);
1169
+ const searchMs = Date.now() - searchT0;
1170
+ return {
1171
+ success: true,
1172
+ name,
1173
+ k,
1174
+ hits,
1175
+ latency: { embeddingMs, searchMs, totalMs: embeddingMs + searchMs },
1176
+ embeddingDimension: embedding.length,
1177
+ };
1178
+ }
1179
+ catch (err) {
1180
+ return {
1181
+ success: false,
1182
+ name,
1183
+ error: err instanceof Error ? err.message : String(err),
1184
+ latency: { embeddingMs, searchMs: 0 },
1185
+ };
1186
+ }
1187
+ },
1188
+ },
1123
1189
  ];
1124
1190
  //# sourceMappingURL=embeddings-tools.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.7.0-alpha.48",
3
+ "version": "3.7.0-alpha.49",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",