ccjk 12.0.12 → 12.0.13

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.
@@ -138,12 +138,7 @@ class A2AClient {
138
138
  async function handleEvolutionCommand(action, args, options) {
139
139
  try {
140
140
  const client = new A2AClient(getCloudBaseUrl("MAIN"));
141
- await client.hello({
142
- id: "ccjk-cli",
143
- name: "ccjk",
144
- version: "1.0.0",
145
- capabilities: ["fetch", "report", "publish"]
146
- });
141
+ await client.hello("ccjk", "1.0.0", ["fetch", "report", "publish"]);
147
142
  switch (action) {
148
143
  case "top":
149
144
  await showTopCapabilities(client, options);
@@ -169,14 +164,10 @@ async function handleEvolutionCommand(action, args, options) {
169
164
  async function showTopCapabilities(client, options) {
170
165
  const fetchingMsg = i18n.t("evolution:fetching", "Fetching top capabilities...");
171
166
  console.log(a.blue("\u{1F4CA} " + fetchingMsg));
172
- const genes = await client.fetch(
173
- {
174
- signature: "*",
175
- context: [],
176
- minGDI: Number.parseInt(options.minGdi || "70")
177
- },
178
- Number.parseInt(options.limit || "30")
179
- );
167
+ const genes = await client.fetch({
168
+ minGDI: Number.parseInt(options.minGdi || "70"),
169
+ limit: Number.parseInt(options.limit || "30")
170
+ });
180
171
  const foundMsg = i18n.t("evolution:found", "Found {{count}} capabilities", { count: genes.length });
181
172
  console.log(a.green("\n\u2705 " + foundMsg + "\n"));
182
173
  if (genes.length === 0) {
@@ -185,17 +176,17 @@ async function showTopCapabilities(client, options) {
185
176
  return;
186
177
  }
187
178
  genes.forEach((gene, index) => {
188
- console.log(a.bold(`${index + 1}. ${gene.id.substring(0, 8)}`));
179
+ console.log(a.bold(`${index + 1}. ${gene.geneId.substring(0, 8)}`));
189
180
  const problemLabel = a.cyan(i18n.t("evolution:problem", "Problem"));
190
- console.log(" " + problemLabel + ": " + gene.problem.signature);
181
+ console.log(" " + problemLabel + ": " + gene.problemSignature);
191
182
  const solutionLabel = a.yellow(i18n.t("evolution:solution", "Solution"));
192
- console.log(" " + solutionLabel + ": " + gene.solution.strategy);
193
- console.log(" " + a.green("GDI") + ": " + gene.quality.gdi.toFixed(1));
183
+ console.log(" " + solutionLabel + ": " + gene.solutionStrategy);
184
+ console.log(" " + a.green("GDI") + ": " + gene.gdi.toFixed(1));
194
185
  const usedLabel = a.gray(i18n.t("evolution:used", "Used"));
195
186
  const timesLabel = i18n.t("evolution:times", "times");
196
- console.log(" " + usedLabel + ": " + gene.quality.usageCount + " " + timesLabel);
187
+ console.log(" " + usedLabel + ": " + gene.usageCount + " " + timesLabel);
197
188
  const successLabel = a.gray(i18n.t("evolution:success", "Success"));
198
- const successRate = (gene.quality.successRate * 100).toFixed(1);
189
+ const successRate = (gene.successRate * 100).toFixed(1);
199
190
  console.log(" " + successLabel + ": " + successRate + "%");
200
191
  console.log();
201
192
  });
@@ -203,14 +194,11 @@ async function showTopCapabilities(client, options) {
203
194
  async function searchSolutions(client, query, options) {
204
195
  const searchingMsg = i18n.t("evolution:searching", "Searching for: {{query}}", { query });
205
196
  console.log(a.blue("\u{1F50D} " + searchingMsg));
206
- const genes = await client.fetch(
207
- {
208
- signature: query,
209
- context: [],
210
- minGDI: Number.parseInt(options.minGdi || "60")
211
- },
212
- Number.parseInt(options.limit || "10")
213
- );
197
+ const genes = await client.fetch({
198
+ signature: query,
199
+ minGDI: Number.parseInt(options.minGdi || "60"),
200
+ limit: Number.parseInt(options.limit || "10")
201
+ });
214
202
  if (genes.length === 0) {
215
203
  const noSolutionsMsg = i18n.t("evolution:noSolutions", "No solutions found");
216
204
  console.log(a.yellow("\n" + noSolutionsMsg));
@@ -219,20 +207,20 @@ async function searchSolutions(client, query, options) {
219
207
  const foundMsg = i18n.t("evolution:foundSolutions", "Found {{count}} solutions", { count: genes.length });
220
208
  console.log(a.green("\n\u2705 " + foundMsg + "\n"));
221
209
  genes.forEach((gene, index) => {
222
- console.log(a.bold(`${index + 1}. ${gene.problem.signature}`));
223
- console.log(" " + gene.solution.strategy);
210
+ console.log(a.bold(`${index + 1}. ${gene.problemSignature}`));
211
+ console.log(" " + gene.solutionStrategy);
224
212
  const usedLabel = i18n.t("evolution:used", "Used");
225
- console.log(" GDI: " + gene.quality.gdi.toFixed(1) + " | " + usedLabel + ": " + gene.quality.usageCount + "x");
226
- if (gene.problem.context.length > 0) {
227
- const contextLabel = a.gray(i18n.t("evolution:context", "Context"));
228
- console.log(" " + contextLabel + ": " + gene.problem.context.join(", "));
213
+ console.log(" GDI: " + gene.gdi.toFixed(1) + " | " + usedLabel + ": " + gene.usageCount + "x");
214
+ if (gene.tags.length > 0) {
215
+ const tagsLabel = a.gray(i18n.t("evolution:tags", "Tags"));
216
+ console.log(" " + tagsLabel + ": " + gene.tags.join(", "));
229
217
  }
230
218
  console.log();
231
219
  });
232
220
  }
233
221
  async function showGeneDetails(client, geneId) {
234
- const genes = await client.fetch({ signature: geneId, context: [] }, 5);
235
- const gene = genes.find((g) => g.id.startsWith(geneId));
222
+ const genes = await client.fetch({ geneId, limit: 5 });
223
+ const gene = genes.find((g) => g.geneId.startsWith(geneId));
236
224
  if (!gene) {
237
225
  const notFoundMsg = i18n.t("evolution:geneNotFound", "Gene not found");
238
226
  console.log(a.red(notFoundMsg));
@@ -243,88 +231,61 @@ async function showGeneDetails(client, geneId) {
243
231
  async function showStats(client) {
244
232
  const fetchingMsg = i18n.t("evolution:fetchingStats", "Fetching statistics...");
245
233
  console.log(a.blue("\u{1F4CA} " + fetchingMsg));
246
- const allGenes = await client.fetch({ signature: "*", context: [] }, 1e3);
247
- const totalGenes = allGenes.length;
248
- const avgGDI = allGenes.reduce((sum, g) => sum + g.quality.gdi, 0) / totalGenes;
249
- const totalUsage = allGenes.reduce((sum, g) => sum + g.quality.usageCount, 0);
250
- const avgSuccessRate = allGenes.reduce((sum, g) => sum + g.quality.successRate, 0) / totalGenes;
251
- const typeCount = allGenes.reduce((acc, g) => {
252
- acc[g.type] = (acc[g.type] || 0) + 1;
253
- return acc;
254
- }, {});
234
+ const stats = await client.stats();
255
235
  console.log(a.bold("\n\u{1F4C8} Evolution Layer Statistics\n"));
256
- const totalLabel = a.cyan(i18n.t("evolution:totalGenes", "Total Genes"));
257
- console.log(totalLabel + ": " + totalGenes);
258
- const avgGdiLabel = a.cyan(i18n.t("evolution:avgGDI", "Average GDI"));
259
- console.log(avgGdiLabel + ": " + avgGDI.toFixed(1));
260
- const totalUsageLabel = a.cyan(i18n.t("evolution:totalUsage", "Total Usage"));
261
- console.log(totalUsageLabel + ": " + totalUsage);
262
- const avgSuccessLabel = a.cyan(i18n.t("evolution:avgSuccess", "Average Success Rate"));
263
- console.log(avgSuccessLabel + ": " + (avgSuccessRate * 100).toFixed(1) + "%");
264
- console.log();
265
- const byTypeLabel = i18n.t("evolution:byType", "By Type");
266
- console.log(a.bold(byTypeLabel + ":"));
267
- Object.entries(typeCount).forEach(([type, count]) => {
268
- console.log(" " + type + ": " + count);
269
- });
236
+ const totalLabel = a.cyan(i18n.t("evolution:totalGenes", "Total Genes in Pool"));
237
+ console.log(totalLabel + ": " + stats.totalGenesInPool);
238
+ const myLabel = a.cyan(i18n.t("evolution:myContributions", "My Contributions"));
239
+ console.log(myLabel + ": " + stats.myContributions);
240
+ const reportsLabel = a.cyan(i18n.t("evolution:reportsSubmitted", "Reports Submitted"));
241
+ console.log(reportsLabel + ": " + stats.reportsSubmitted);
242
+ const successLabel = a.cyan(i18n.t("evolution:successRate", "Success Rate"));
243
+ console.log(successLabel + ": " + (stats.successRate * 100).toFixed(1) + "%");
270
244
  }
271
245
  function displayGene(gene) {
272
246
  const detailsLabel = i18n.t("evolution:geneDetails", "Gene Details");
273
247
  console.log(a.bold("\n\u{1F4E6} " + detailsLabel + "\n"));
274
- console.log(a.cyan("ID") + ": " + gene.id);
275
- const typeLabel = i18n.t("evolution:type", "Type");
276
- console.log(a.cyan(typeLabel) + ": " + gene.type);
277
- console.log(a.cyan("SHA256") + ": " + gene.sha256);
248
+ console.log(a.cyan("ID") + ": " + gene.geneId);
249
+ console.log(a.cyan("Version") + ": " + gene.version);
278
250
  console.log();
279
251
  const problemLabel = i18n.t("evolution:problem", "Problem");
280
252
  console.log(a.bold(problemLabel + ":"));
281
- const sigLabel = i18n.t("evolution:signature", "Signature");
282
- console.log(" " + sigLabel + ": " + gene.problem.signature);
283
- if (gene.problem.context.length > 0) {
284
- const contextLabel = i18n.t("evolution:context", "Context");
285
- console.log(" " + contextLabel + ": " + gene.problem.context.join(", "));
286
- }
253
+ console.log(" " + gene.problemSignature);
287
254
  console.log();
288
255
  const solutionLabel = i18n.t("evolution:solution", "Solution");
289
256
  console.log(a.bold(solutionLabel + ":"));
290
257
  const strategyLabel = i18n.t("evolution:strategy", "Strategy");
291
- console.log(" " + strategyLabel + ": " + gene.solution.strategy);
292
- if (gene.solution.code) {
258
+ console.log(" " + strategyLabel + ": " + gene.solutionStrategy);
259
+ if (gene.solutionCode) {
293
260
  const codeLabel = i18n.t("evolution:code", "Code");
294
261
  console.log(" " + codeLabel + ":");
295
- const codeLines = gene.solution.code.split("\n").map((line) => " " + line).join("\n");
262
+ const codeLines = gene.solutionCode.split("\n").map((line) => " " + line).join("\n");
296
263
  console.log(a.gray(codeLines));
297
264
  }
298
- if (gene.solution.steps.length > 0) {
265
+ if (gene.solutionSteps.length > 0) {
299
266
  const stepsLabel = i18n.t("evolution:steps", "Steps");
300
267
  console.log(" " + stepsLabel + ":");
301
- gene.solution.steps.forEach((step, i) => {
268
+ gene.solutionSteps.forEach((step, i) => {
302
269
  console.log(" " + (i + 1) + ". " + step);
303
270
  });
304
271
  }
305
272
  console.log();
306
273
  const qualityLabel = i18n.t("evolution:quality", "Quality");
307
274
  console.log(a.bold(qualityLabel + ":"));
308
- console.log(" GDI: " + gene.quality.gdi.toFixed(1));
275
+ console.log(" GDI: " + gene.gdi.toFixed(1));
309
276
  const successRateLabel = i18n.t("evolution:successRate", "Success Rate");
310
- console.log(" " + successRateLabel + ": " + (gene.quality.successRate * 100).toFixed(1) + "%");
277
+ console.log(" " + successRateLabel + ": " + (gene.successRate * 100).toFixed(1) + "%");
311
278
  const usageCountLabel = i18n.t("evolution:usageCount", "Usage Count");
312
- console.log(" " + usageCountLabel + ": " + gene.quality.usageCount);
313
- const avgTimeLabel = i18n.t("evolution:avgTime", "Average Time");
314
- console.log(" " + avgTimeLabel + ": " + gene.quality.avgTime + "s");
315
- if (gene.metadata) {
279
+ console.log(" " + usageCountLabel + ": " + gene.usageCount);
280
+ const passRateLabel = i18n.t("evolution:passRate", "Pass Rate");
281
+ console.log(" " + passRateLabel + ": " + (gene.passRate * 100).toFixed(1) + "%");
282
+ if (gene.tags.length > 0) {
316
283
  console.log();
317
- const metadataLabel = i18n.t("evolution:metadata", "Metadata");
318
- console.log(a.bold(metadataLabel + ":"));
319
- const authorLabel = i18n.t("evolution:author", "Author");
320
- console.log(" " + authorLabel + ": " + (gene.metadata.author || "-"));
321
- const createdLabel = i18n.t("evolution:createdAt", "Created At");
322
- console.log(" " + createdLabel + ": " + (gene.metadata.createdAt || "-"));
323
- if (gene.metadata.tags && gene.metadata.tags.length > 0) {
324
- const tagsLabel = i18n.t("evolution:tags", "Tags");
325
- console.log(" " + tagsLabel + ": " + gene.metadata.tags.join(", "));
326
- }
284
+ const tagsLabel = i18n.t("evolution:tags", "Tags");
285
+ console.log(" " + tagsLabel + ": " + gene.tags.join(", "));
327
286
  }
287
+ const createdLabel = i18n.t("evolution:createdAt", "Created At");
288
+ console.log(" " + createdLabel + ": " + gene.createdAt);
328
289
  }
329
290
 
330
291
  export { handleEvolutionCommand };
@@ -1,3 +1,3 @@
1
- const version = "12.0.11";
1
+ const version = "12.0.12";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "12.0.12",
4
+ "version": "12.0.13",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CLI toolkit for Claude Code and Codex setup. Simplifies MCP service installation, API configuration, workflow management, and multi-provider support with guided interactive setup.",
7
7
  "author": {