designnn 0.3.0 → 0.4.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.
- package/dist/cli.js +392 -153
- package/package.json +1 -1
- package/public/app.js +159 -68
- package/public/i18n-trends.js +92 -0
- package/public/i18n.js +207 -0
- package/public/index.html +41 -42
- package/public/style.css +29 -1
package/dist/cli.js
CHANGED
|
@@ -2629,11 +2629,236 @@ var init_source = __esm(() => {
|
|
|
2629
2629
|
source_default = chalk;
|
|
2630
2630
|
});
|
|
2631
2631
|
|
|
2632
|
+
// src/utils/i18n.ts
|
|
2633
|
+
function setLang(lang) {
|
|
2634
|
+
currentLang = lang;
|
|
2635
|
+
}
|
|
2636
|
+
function detectLang() {
|
|
2637
|
+
const envLang = process.env.LANG || process.env.LANGUAGE || process.env.LC_ALL || "";
|
|
2638
|
+
if (envLang.startsWith("ja"))
|
|
2639
|
+
return "ja";
|
|
2640
|
+
return "en";
|
|
2641
|
+
}
|
|
2642
|
+
function t(key) {
|
|
2643
|
+
const msg = messages[key];
|
|
2644
|
+
if (!msg)
|
|
2645
|
+
return key;
|
|
2646
|
+
return msg[currentLang] || msg.en;
|
|
2647
|
+
}
|
|
2648
|
+
function getCategoryName(category) {
|
|
2649
|
+
const key = `cat${category.charAt(0).toUpperCase() + category.slice(1)}`;
|
|
2650
|
+
return t(key);
|
|
2651
|
+
}
|
|
2652
|
+
var currentLang = "en", messages;
|
|
2653
|
+
var init_i18n = __esm(() => {
|
|
2654
|
+
messages = {
|
|
2655
|
+
tagline: {
|
|
2656
|
+
en: "Trend-driven design prompt engine for Figma AI",
|
|
2657
|
+
ja: "Figma AI のためのトレンド駆動デザインプロンプトエンジン"
|
|
2658
|
+
},
|
|
2659
|
+
chatNoMessage: {
|
|
2660
|
+
en: `Please provide a design description. Example:
|
|
2661
|
+
designnn chat "SaaS pricing page with dark theme"`,
|
|
2662
|
+
ja: `デザインの説明を入力してください。例:
|
|
2663
|
+
designnn chat "ダークテーマのSaaS料金ページ"`
|
|
2664
|
+
},
|
|
2665
|
+
chatAnalyzing: {
|
|
2666
|
+
en: "Analyzing your request and generating Figma AI prompt...",
|
|
2667
|
+
ja: "リクエストを分析し、Figma AIプロンプトを生成中..."
|
|
2668
|
+
},
|
|
2669
|
+
chatPromptFor: {
|
|
2670
|
+
en: "Prompt for",
|
|
2671
|
+
ja: "プロンプト:"
|
|
2672
|
+
},
|
|
2673
|
+
chatApiKeyError: {
|
|
2674
|
+
en: `OpenAI API key not found. Set it with:
|
|
2675
|
+
export OPENAI_API_KEY=your-key
|
|
2676
|
+
or: designnn config --api-key your-key`,
|
|
2677
|
+
ja: `OpenAI APIキーが見つかりません。以下で設定してください:
|
|
2678
|
+
export OPENAI_API_KEY=your-key
|
|
2679
|
+
または: designnn config --api-key your-key`
|
|
2680
|
+
},
|
|
2681
|
+
chatFailed: {
|
|
2682
|
+
en: "Generation failed",
|
|
2683
|
+
ja: "生成に失敗しました"
|
|
2684
|
+
},
|
|
2685
|
+
exploreAllTrends: {
|
|
2686
|
+
en: "All Design Trends",
|
|
2687
|
+
ja: "全デザイントレンド"
|
|
2688
|
+
},
|
|
2689
|
+
exploreTrendsInDb: {
|
|
2690
|
+
en: "trends in database",
|
|
2691
|
+
ja: "件のトレンドがデータベースに登録済み"
|
|
2692
|
+
},
|
|
2693
|
+
exploreMatching: {
|
|
2694
|
+
en: "Trends matching",
|
|
2695
|
+
ja: "検索結果"
|
|
2696
|
+
},
|
|
2697
|
+
exploreTrends: {
|
|
2698
|
+
en: "Trends",
|
|
2699
|
+
ja: "トレンド"
|
|
2700
|
+
},
|
|
2701
|
+
exploreTop: {
|
|
2702
|
+
en: "Top",
|
|
2703
|
+
ja: "トップ"
|
|
2704
|
+
},
|
|
2705
|
+
exploreDesignTrends: {
|
|
2706
|
+
en: "Design Trends",
|
|
2707
|
+
ja: "デザイントレンド"
|
|
2708
|
+
},
|
|
2709
|
+
exploreNoResults: {
|
|
2710
|
+
en: "No trends found matching your query.",
|
|
2711
|
+
ja: "該当するトレンドが見つかりませんでした。"
|
|
2712
|
+
},
|
|
2713
|
+
exploreResults: {
|
|
2714
|
+
en: "results",
|
|
2715
|
+
ja: "件"
|
|
2716
|
+
},
|
|
2717
|
+
exploreInvalidCategory: {
|
|
2718
|
+
en: "Invalid category. Choose from",
|
|
2719
|
+
ja: "無効なカテゴリです。以下から選択してください"
|
|
2720
|
+
},
|
|
2721
|
+
exploreTipFilter: {
|
|
2722
|
+
en: "Tip: Use --category, --component, or --top to filter",
|
|
2723
|
+
ja: "ヒント: --category, --component, --top でフィルタリングできます"
|
|
2724
|
+
},
|
|
2725
|
+
exploreTipGenerate: {
|
|
2726
|
+
en: "Tip: Use --generate <trend-id> to create a prompt from a trend",
|
|
2727
|
+
ja: "ヒント: --generate <trend-id> でトレンドからプロンプトを生成できます"
|
|
2728
|
+
},
|
|
2729
|
+
exploreGenerating: {
|
|
2730
|
+
en: "Generating Figma AI prompt for",
|
|
2731
|
+
ja: "Figma AIプロンプトを生成中:"
|
|
2732
|
+
},
|
|
2733
|
+
exploreTrendNotFound: {
|
|
2734
|
+
en: "Trend not found",
|
|
2735
|
+
ja: "トレンドが見つかりません"
|
|
2736
|
+
},
|
|
2737
|
+
exploreAvailableIds: {
|
|
2738
|
+
en: "Available IDs",
|
|
2739
|
+
ja: "利用可能なID"
|
|
2740
|
+
},
|
|
2741
|
+
mixNoTrends: {
|
|
2742
|
+
en: `Please provide two trend names to mix. Example:
|
|
2743
|
+
designnn mix "Bento UI" "Glassmorphism"
|
|
2744
|
+
designnn mix bento-ui glassmorphism`,
|
|
2745
|
+
ja: `ミックスする2つのトレンド名を入力してください。例:
|
|
2746
|
+
designnn mix "Bento UI" "Glassmorphism"
|
|
2747
|
+
designnn mix bento-ui glassmorphism`
|
|
2748
|
+
},
|
|
2749
|
+
mixTrendNotFound: {
|
|
2750
|
+
en: "Trend not found",
|
|
2751
|
+
ja: "トレンドが見つかりません"
|
|
2752
|
+
},
|
|
2753
|
+
mixMixing: {
|
|
2754
|
+
en: "Mixing Trends",
|
|
2755
|
+
ja: "トレンドをミックス中"
|
|
2756
|
+
},
|
|
2757
|
+
mixTrendA: {
|
|
2758
|
+
en: "Trend A:",
|
|
2759
|
+
ja: "トレンドA:"
|
|
2760
|
+
},
|
|
2761
|
+
mixTrendB: {
|
|
2762
|
+
en: "Trend B:",
|
|
2763
|
+
ja: "トレンドB:"
|
|
2764
|
+
},
|
|
2765
|
+
mixContext: {
|
|
2766
|
+
en: "Context",
|
|
2767
|
+
ja: "コンテキスト"
|
|
2768
|
+
},
|
|
2769
|
+
mixGenerating: {
|
|
2770
|
+
en: "Mixing into a Figma AI prompt...",
|
|
2771
|
+
ja: "Figma AIプロンプトにミックス中..."
|
|
2772
|
+
},
|
|
2773
|
+
mixResult: {
|
|
2774
|
+
en: "Mix",
|
|
2775
|
+
ja: "ミックス"
|
|
2776
|
+
},
|
|
2777
|
+
mixDidYouMean: {
|
|
2778
|
+
en: "Did you mean:",
|
|
2779
|
+
ja: "もしかして:"
|
|
2780
|
+
},
|
|
2781
|
+
mixAvailableTrends: {
|
|
2782
|
+
en: "Available trends:",
|
|
2783
|
+
ja: "利用可能なトレンド:"
|
|
2784
|
+
},
|
|
2785
|
+
mixSeeAll: {
|
|
2786
|
+
en: "Use 'designnn explore' to see all trends.",
|
|
2787
|
+
ja: "'designnn explore' で全トレンドを表示できます。"
|
|
2788
|
+
},
|
|
2789
|
+
statsTitle: {
|
|
2790
|
+
en: "Trend Database Statistics",
|
|
2791
|
+
ja: "トレンドデータベース統計"
|
|
2792
|
+
},
|
|
2793
|
+
statsOverview: {
|
|
2794
|
+
en: "Overview",
|
|
2795
|
+
ja: "概要"
|
|
2796
|
+
},
|
|
2797
|
+
statsTotalTrends: {
|
|
2798
|
+
en: "Total Trends",
|
|
2799
|
+
ja: "総トレンド数"
|
|
2800
|
+
},
|
|
2801
|
+
statsBuiltin: {
|
|
2802
|
+
en: "Built-in",
|
|
2803
|
+
ja: "ビルトイン"
|
|
2804
|
+
},
|
|
2805
|
+
statsAiGenerated: {
|
|
2806
|
+
en: "AI-Generated",
|
|
2807
|
+
ja: "AI生成"
|
|
2808
|
+
},
|
|
2809
|
+
statsUserAdded: {
|
|
2810
|
+
en: "User-Added",
|
|
2811
|
+
ja: "ユーザー追加"
|
|
2812
|
+
},
|
|
2813
|
+
statsByCategory: {
|
|
2814
|
+
en: "By Category",
|
|
2815
|
+
ja: "カテゴリ別"
|
|
2816
|
+
},
|
|
2817
|
+
statsTop5: {
|
|
2818
|
+
en: "Top 5 Trends",
|
|
2819
|
+
ja: "トップ5トレンド"
|
|
2820
|
+
},
|
|
2821
|
+
statsRecentlyAdded: {
|
|
2822
|
+
en: "Recently Added",
|
|
2823
|
+
ja: "最近追加されたトレンド"
|
|
2824
|
+
},
|
|
2825
|
+
statsTipUpdate: {
|
|
2826
|
+
en: "Tip: Run 'designnn update' to research and add new trends",
|
|
2827
|
+
ja: "ヒント: 'designnn update' で新しいトレンドをリサーチ・追加できます"
|
|
2828
|
+
},
|
|
2829
|
+
statsTipReset: {
|
|
2830
|
+
en: "Tip: Run 'designnn update --reset' to clear custom trends",
|
|
2831
|
+
ja: "ヒント: 'designnn update --reset' でカスタムトレンドをリセットできます"
|
|
2832
|
+
},
|
|
2833
|
+
generatedPrompt: {
|
|
2834
|
+
en: "Generated Prompt",
|
|
2835
|
+
ja: "生成されたプロンプト"
|
|
2836
|
+
},
|
|
2837
|
+
copyHint: {
|
|
2838
|
+
en: "Copy the prompt above and paste it into Figma AI (Ctrl+I)",
|
|
2839
|
+
ja: "上のプロンプトをコピーしてFigma AI(Ctrl+I)に貼り付けてください"
|
|
2840
|
+
},
|
|
2841
|
+
keywords: {
|
|
2842
|
+
en: "Keywords",
|
|
2843
|
+
ja: "キーワード"
|
|
2844
|
+
},
|
|
2845
|
+
serveStarting: {
|
|
2846
|
+
en: "DESIGNNN Web UI running at",
|
|
2847
|
+
ja: "DESIGNNN Web UI 起動中:"
|
|
2848
|
+
},
|
|
2849
|
+
catStyle: { en: "style", ja: "スタイル" },
|
|
2850
|
+
catComponent: { en: "component", ja: "コンポーネント" },
|
|
2851
|
+
catPattern: { en: "pattern", ja: "パターン" },
|
|
2852
|
+
catLayout: { en: "layout", ja: "レイアウト" },
|
|
2853
|
+
catInteraction: { en: "interaction", ja: "インタラクション" }
|
|
2854
|
+
};
|
|
2855
|
+
});
|
|
2856
|
+
|
|
2632
2857
|
// src/utils/display.ts
|
|
2633
2858
|
function printBanner() {
|
|
2634
2859
|
console.log("");
|
|
2635
2860
|
console.log(` ${BRAND.name} ${BRAND.version}`);
|
|
2636
|
-
console.log(` ${BRAND.tagline}`);
|
|
2861
|
+
console.log(` ${BRAND.tagline()}`);
|
|
2637
2862
|
console.log("");
|
|
2638
2863
|
}
|
|
2639
2864
|
function printTrend(trend, index) {
|
|
@@ -2641,12 +2866,12 @@ function printTrend(trend, index) {
|
|
|
2641
2866
|
const pop = getPopularityBar(trend.popularity);
|
|
2642
2867
|
console.log(` ${prefix} ${source_default.bold(trend.name)} ${source_default.gray(`[${trend.category}]`)} ${pop}`);
|
|
2643
2868
|
console.log(` ${source_default.dim(trend.description)}`);
|
|
2644
|
-
console.log(` ${source_default.gray("
|
|
2869
|
+
console.log(` ${source_default.gray(t("keywords") + ":")} ${trend.keywords.map((k) => source_default.cyan(k)).join(", ")}`);
|
|
2645
2870
|
console.log("");
|
|
2646
2871
|
}
|
|
2647
2872
|
function printPrompt(prompt, label) {
|
|
2648
2873
|
console.log("");
|
|
2649
|
-
console.log(source_default.hex("#CCFF00").bold(` ─── ${label || "
|
|
2874
|
+
console.log(source_default.hex("#CCFF00").bold(` ─── ${label || t("generatedPrompt")} ───`));
|
|
2650
2875
|
console.log("");
|
|
2651
2876
|
console.log(source_default.white(` ${prompt.split(`
|
|
2652
2877
|
`).join(`
|
|
@@ -2654,7 +2879,7 @@ function printPrompt(prompt, label) {
|
|
|
2654
2879
|
console.log("");
|
|
2655
2880
|
console.log(source_default.hex("#CCFF00")(" ─────────────────────────────────"));
|
|
2656
2881
|
console.log("");
|
|
2657
|
-
console.log(source_default.dim(
|
|
2882
|
+
console.log(source_default.dim(` \uD83D\uDCCB ${t("copyHint")}`));
|
|
2658
2883
|
console.log("");
|
|
2659
2884
|
}
|
|
2660
2885
|
function printError(message) {
|
|
@@ -2673,10 +2898,11 @@ function printSection(title) {
|
|
|
2673
2898
|
var BRAND;
|
|
2674
2899
|
var init_display = __esm(() => {
|
|
2675
2900
|
init_source();
|
|
2901
|
+
init_i18n();
|
|
2676
2902
|
BRAND = {
|
|
2677
2903
|
name: source_default.bold.hex("#CCFF00")("DESIGNNN"),
|
|
2678
|
-
tagline: source_default.gray("
|
|
2679
|
-
version: source_default.gray("v0.
|
|
2904
|
+
tagline: () => source_default.gray(t("tagline")),
|
|
2905
|
+
version: source_default.gray("v0.4.0")
|
|
2680
2906
|
};
|
|
2681
2907
|
});
|
|
2682
2908
|
|
|
@@ -7293,7 +7519,7 @@ function hasAutoParseableInput(params) {
|
|
|
7293
7519
|
if (isAutoParsableResponseFormat(params.response_format)) {
|
|
7294
7520
|
return true;
|
|
7295
7521
|
}
|
|
7296
|
-
return params.tools?.some((
|
|
7522
|
+
return params.tools?.some((t2) => isAutoParsableTool(t2) || t2.type === "function" && t2.function.strict === true) ?? false;
|
|
7297
7523
|
}
|
|
7298
7524
|
function assertToolCallsAreChatCompletionFunctionToolCalls(toolCalls) {
|
|
7299
7525
|
for (const toolCall of toolCalls || []) {
|
|
@@ -7609,15 +7835,15 @@ var init_AbstractChatCompletionRunner = __esm(() => {
|
|
|
7609
7835
|
functionsByName[f.function.name || f.function.function.name] = f.function;
|
|
7610
7836
|
}
|
|
7611
7837
|
}
|
|
7612
|
-
const tools = "tools" in params ? inputTools.map((
|
|
7838
|
+
const tools = "tools" in params ? inputTools.map((t2) => t2.type === "function" ? {
|
|
7613
7839
|
type: "function",
|
|
7614
7840
|
function: {
|
|
7615
|
-
name:
|
|
7616
|
-
parameters:
|
|
7617
|
-
description:
|
|
7618
|
-
strict:
|
|
7841
|
+
name: t2.function.name || t2.function.function.name,
|
|
7842
|
+
parameters: t2.function.parameters,
|
|
7843
|
+
description: t2.function.description,
|
|
7844
|
+
strict: t2.function.strict
|
|
7619
7845
|
}
|
|
7620
|
-
} :
|
|
7846
|
+
} : t2) : undefined;
|
|
7621
7847
|
for (const message of params.messages) {
|
|
7622
7848
|
this._addMessage(message, false);
|
|
7623
7849
|
}
|
|
@@ -12012,7 +12238,7 @@ function saveCustomTrends(trends) {
|
|
|
12012
12238
|
}
|
|
12013
12239
|
function addCustomTrend(trend) {
|
|
12014
12240
|
const customs = loadCustomTrends();
|
|
12015
|
-
const idx = customs.findIndex((
|
|
12241
|
+
const idx = customs.findIndex((t2) => t2.id === trend.id);
|
|
12016
12242
|
if (idx >= 0) {
|
|
12017
12243
|
customs[idx] = trend;
|
|
12018
12244
|
} else {
|
|
@@ -12025,13 +12251,13 @@ function getAllTrends() {
|
|
|
12025
12251
|
}
|
|
12026
12252
|
function searchTrends(query2) {
|
|
12027
12253
|
const q = query2.toLowerCase();
|
|
12028
|
-
return getAllTrends().filter((
|
|
12254
|
+
return getAllTrends().filter((t2) => t2.name.toLowerCase().includes(q) || t2.description.toLowerCase().includes(q) || t2.keywords.some((k) => k.includes(q)) || t2.category.includes(q)).sort((a, b) => b.popularity - a.popularity);
|
|
12029
12255
|
}
|
|
12030
12256
|
function getTrendById(id) {
|
|
12031
|
-
return getAllTrends().find((
|
|
12257
|
+
return getAllTrends().find((t2) => t2.id === id);
|
|
12032
12258
|
}
|
|
12033
12259
|
function getTrendsByCategory(category) {
|
|
12034
|
-
return getAllTrends().filter((
|
|
12260
|
+
return getAllTrends().filter((t2) => t2.category === category).sort((a, b) => b.popularity - a.popularity);
|
|
12035
12261
|
}
|
|
12036
12262
|
function getTopTrends(limit2 = 10) {
|
|
12037
12263
|
return getAllTrends().sort((a, b) => b.popularity - a.popularity).slice(0, limit2);
|
|
@@ -12039,8 +12265,8 @@ function getTopTrends(limit2 = 10) {
|
|
|
12039
12265
|
function getTrendStats() {
|
|
12040
12266
|
const all = getAllTrends();
|
|
12041
12267
|
const categories = {};
|
|
12042
|
-
for (const
|
|
12043
|
-
categories[
|
|
12268
|
+
for (const t2 of all) {
|
|
12269
|
+
categories[t2.category] = (categories[t2.category] || 0) + 1;
|
|
12044
12270
|
}
|
|
12045
12271
|
return {
|
|
12046
12272
|
total: all.length,
|
|
@@ -13131,7 +13357,7 @@ async function updateCommand(options) {
|
|
|
13131
13357
|
const stats = getTrendStats();
|
|
13132
13358
|
console.log(source_default.dim(` Current DB: ${stats.total} trends (${stats.builtin} built-in, ${stats.custom} custom)
|
|
13133
13359
|
`));
|
|
13134
|
-
const existingNames = getAllTrends().map((
|
|
13360
|
+
const existingNames = getAllTrends().map((t2) => t2.name.toLowerCase());
|
|
13135
13361
|
const spinner = ora({
|
|
13136
13362
|
text: `Researching ${count} new design trends${category ? ` in "${category}"` : ""}...`,
|
|
13137
13363
|
color: "yellow"
|
|
@@ -13268,15 +13494,15 @@ __export(exports_stats, {
|
|
|
13268
13494
|
async function statsCommand() {
|
|
13269
13495
|
const stats = getTrendStats();
|
|
13270
13496
|
const customs = loadCustomTrends();
|
|
13271
|
-
printSection("
|
|
13272
|
-
console.log(source_default.bold(
|
|
13497
|
+
printSection(t("statsTitle"));
|
|
13498
|
+
console.log(source_default.bold(` ${t("statsOverview")}`));
|
|
13273
13499
|
console.log(source_default.dim(" ─────────────────────────────────"));
|
|
13274
|
-
console.log(`
|
|
13275
|
-
console.log(`
|
|
13276
|
-
console.log(`
|
|
13277
|
-
console.log(`
|
|
13500
|
+
console.log(` ${t("statsTotalTrends")}: ${source_default.hex("#CCFF00").bold(String(stats.total))}`);
|
|
13501
|
+
console.log(` ${t("statsBuiltin")}: ${source_default.white(String(stats.builtin))}`);
|
|
13502
|
+
console.log(` ${t("statsAiGenerated")}: ${source_default.cyan(String(customs.filter((t2) => t2.source === "ai-generated").length))}`);
|
|
13503
|
+
console.log(` ${t("statsUserAdded")}: ${source_default.magenta(String(customs.filter((t2) => t2.source === "user").length))}`);
|
|
13278
13504
|
console.log("");
|
|
13279
|
-
console.log(source_default.bold(
|
|
13505
|
+
console.log(source_default.bold(` ${t("statsByCategory")}`));
|
|
13280
13506
|
console.log(source_default.dim(" ─────────────────────────────────"));
|
|
13281
13507
|
const categoryEmojis = {
|
|
13282
13508
|
style: "◆",
|
|
@@ -13287,38 +13513,40 @@ async function statsCommand() {
|
|
|
13287
13513
|
};
|
|
13288
13514
|
for (const [cat, count] of Object.entries(stats.categories).sort((a, b) => b[1] - a[1])) {
|
|
13289
13515
|
const bar = "█".repeat(Math.round(count / 2)) + source_default.dim("░".repeat(Math.max(0, 15 - Math.round(count / 2))));
|
|
13290
|
-
|
|
13516
|
+
const label = getCategoryName(cat);
|
|
13517
|
+
console.log(` ${categoryEmojis[cat] || "○"} ${source_default.bold(label.padEnd(14))} ${bar} ${source_default.hex("#CCFF00")(String(count))}`);
|
|
13291
13518
|
}
|
|
13292
13519
|
console.log("");
|
|
13293
13520
|
const allTrends = [...BUILTIN_TRENDS, ...customs].sort((a, b) => b.popularity - a.popularity);
|
|
13294
|
-
console.log(source_default.bold(
|
|
13521
|
+
console.log(source_default.bold(` ${t("statsTop5")}`));
|
|
13295
13522
|
console.log(source_default.dim(" ─────────────────────────────────"));
|
|
13296
|
-
for (const
|
|
13297
|
-
const popBar = source_default.hex("#CCFF00")("█".repeat(Math.round(
|
|
13298
|
-
console.log(` ${popBar} ${source_default.bold(
|
|
13523
|
+
for (const trend of allTrends.slice(0, 5)) {
|
|
13524
|
+
const popBar = source_default.hex("#CCFF00")("█".repeat(Math.round(trend.popularity / 5)));
|
|
13525
|
+
console.log(` ${popBar} ${source_default.bold(trend.name)} ${source_default.dim(`${trend.popularity}%`)}`);
|
|
13299
13526
|
}
|
|
13300
13527
|
console.log("");
|
|
13301
13528
|
if (customs.length > 0) {
|
|
13302
|
-
const recent = customs.filter((
|
|
13529
|
+
const recent = customs.filter((trend) => trend.addedAt).sort((a, b) => new Date(b.addedAt).getTime() - new Date(a.addedAt).getTime()).slice(0, 5);
|
|
13303
13530
|
if (recent.length > 0) {
|
|
13304
|
-
console.log(source_default.bold(
|
|
13531
|
+
console.log(source_default.bold(` ${t("statsRecentlyAdded")}`));
|
|
13305
13532
|
console.log(source_default.dim(" ─────────────────────────────────"));
|
|
13306
|
-
for (const
|
|
13307
|
-
const date = new Date(
|
|
13308
|
-
const source =
|
|
13309
|
-
console.log(` ${source} ${source_default.bold(
|
|
13533
|
+
for (const trend of recent) {
|
|
13534
|
+
const date = new Date(trend.addedAt).toLocaleDateString();
|
|
13535
|
+
const source = trend.source === "ai-generated" ? source_default.cyan("AI") : source_default.magenta("User");
|
|
13536
|
+
console.log(` ${source} ${source_default.bold(trend.name)} ${source_default.dim(`[${trend.category}] ${date}`)}`);
|
|
13310
13537
|
}
|
|
13311
13538
|
console.log("");
|
|
13312
13539
|
}
|
|
13313
13540
|
}
|
|
13314
|
-
console.log(source_default.dim(
|
|
13315
|
-
console.log(source_default.dim(`
|
|
13541
|
+
console.log(source_default.dim(` ${t("statsTipUpdate")}`));
|
|
13542
|
+
console.log(source_default.dim(` ${t("statsTipReset")}
|
|
13316
13543
|
`));
|
|
13317
13544
|
}
|
|
13318
13545
|
var init_stats = __esm(() => {
|
|
13319
13546
|
init_source();
|
|
13320
13547
|
init_trends();
|
|
13321
13548
|
init_display();
|
|
13549
|
+
init_i18n();
|
|
13322
13550
|
});
|
|
13323
13551
|
|
|
13324
13552
|
// node_modules/ms/index.js
|
|
@@ -36622,7 +36850,7 @@ async function createServer(port = 3333) {
|
|
|
36622
36850
|
res.json({ trend });
|
|
36623
36851
|
});
|
|
36624
36852
|
app.get("/api/categories", (_req, res) => {
|
|
36625
|
-
const categories = [...new Set(getAllTrends().map((
|
|
36853
|
+
const categories = [...new Set(getAllTrends().map((t2) => t2.category))];
|
|
36626
36854
|
res.json({ categories });
|
|
36627
36855
|
});
|
|
36628
36856
|
app.get("/api/stats", (_req, res) => {
|
|
@@ -36713,8 +36941,8 @@ var init_server = __esm(() => {
|
|
|
36713
36941
|
|
|
36714
36942
|
// node_modules/zod/v3/helpers/util.js
|
|
36715
36943
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
36716
|
-
const
|
|
36717
|
-
switch (
|
|
36944
|
+
const t2 = typeof data;
|
|
36945
|
+
switch (t2) {
|
|
36718
36946
|
case "undefined":
|
|
36719
36947
|
return ZodParsedType.undefined;
|
|
36720
36948
|
case "string":
|
|
@@ -41121,8 +41349,8 @@ function getLengthableOrigin(input) {
|
|
|
41121
41349
|
return "unknown";
|
|
41122
41350
|
}
|
|
41123
41351
|
function parsedType(data) {
|
|
41124
|
-
const
|
|
41125
|
-
switch (
|
|
41352
|
+
const t2 = typeof data;
|
|
41353
|
+
switch (t2) {
|
|
41126
41354
|
case "number": {
|
|
41127
41355
|
return Number.isNaN(data) ? "nan" : "number";
|
|
41128
41356
|
}
|
|
@@ -41139,7 +41367,7 @@ function parsedType(data) {
|
|
|
41139
41367
|
}
|
|
41140
41368
|
}
|
|
41141
41369
|
}
|
|
41142
|
-
return
|
|
41370
|
+
return t2;
|
|
41143
41371
|
}
|
|
41144
41372
|
function issue(...args) {
|
|
41145
41373
|
const [iss, input, inst] = args;
|
|
@@ -41200,8 +41428,8 @@ class Class {
|
|
|
41200
41428
|
constructor(..._args) {}
|
|
41201
41429
|
}
|
|
41202
41430
|
var EVALUATING, captureStackTrace, allowsEval, getParsedType2 = (data) => {
|
|
41203
|
-
const
|
|
41204
|
-
switch (
|
|
41431
|
+
const t2 = typeof data;
|
|
41432
|
+
switch (t2) {
|
|
41205
41433
|
case "undefined":
|
|
41206
41434
|
return "undefined";
|
|
41207
41435
|
case "string":
|
|
@@ -41240,7 +41468,7 @@ var EVALUATING, captureStackTrace, allowsEval, getParsedType2 = (data) => {
|
|
|
41240
41468
|
}
|
|
41241
41469
|
return "object";
|
|
41242
41470
|
default:
|
|
41243
|
-
throw new Error(`Unknown data type: ${
|
|
41471
|
+
throw new Error(`Unknown data type: ${t2}`);
|
|
41244
41472
|
}
|
|
41245
41473
|
}, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES;
|
|
41246
41474
|
var init_util2 = __esm(() => {
|
|
@@ -42334,12 +42562,12 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
42334
42562
|
const unrecognized = [];
|
|
42335
42563
|
const keySet = def.keySet;
|
|
42336
42564
|
const _catchall = def.catchall._zod;
|
|
42337
|
-
const
|
|
42565
|
+
const t2 = _catchall.def.type;
|
|
42338
42566
|
const isOptionalOut = _catchall.optout === "optional";
|
|
42339
42567
|
for (const key in input) {
|
|
42340
42568
|
if (keySet.has(key))
|
|
42341
42569
|
continue;
|
|
42342
|
-
if (
|
|
42570
|
+
if (t2 === "never") {
|
|
42343
42571
|
unrecognized.push(key);
|
|
42344
42572
|
continue;
|
|
42345
42573
|
}
|
|
@@ -46036,16 +46264,16 @@ var error18 = () => {
|
|
|
46036
46264
|
set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
|
|
46037
46265
|
number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }
|
|
46038
46266
|
};
|
|
46039
|
-
const typeEntry = (
|
|
46040
|
-
const typeLabel = (
|
|
46041
|
-
const e = typeEntry(
|
|
46267
|
+
const typeEntry = (t2) => t2 ? TypeNames[t2] : undefined;
|
|
46268
|
+
const typeLabel = (t2) => {
|
|
46269
|
+
const e = typeEntry(t2);
|
|
46042
46270
|
if (e)
|
|
46043
46271
|
return e.label;
|
|
46044
|
-
return
|
|
46272
|
+
return t2 ?? TypeNames.unknown.label;
|
|
46045
46273
|
};
|
|
46046
|
-
const withDefinite = (
|
|
46047
|
-
const verbFor = (
|
|
46048
|
-
const e = typeEntry(
|
|
46274
|
+
const withDefinite = (t2) => `ה${typeLabel(t2)}`;
|
|
46275
|
+
const verbFor = (t2) => {
|
|
46276
|
+
const e = typeEntry(t2);
|
|
46049
46277
|
const gender = e?.gender ?? "m";
|
|
46050
46278
|
return gender === "f" ? "צריכה להיות" : "צריך להיות";
|
|
46051
46279
|
};
|
|
@@ -53946,8 +54174,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
53946
54174
|
}
|
|
53947
54175
|
const type = schema.type;
|
|
53948
54176
|
if (Array.isArray(type)) {
|
|
53949
|
-
const typeSchemas = type.map((
|
|
53950
|
-
const typeSchema = { ...schema, type:
|
|
54177
|
+
const typeSchemas = type.map((t2) => {
|
|
54178
|
+
const typeSchema = { ...schema, type: t2 };
|
|
53951
54179
|
return convertBaseSchema(typeSchema, ctx);
|
|
53952
54180
|
});
|
|
53953
54181
|
if (typeSchemas.length === 0) {
|
|
@@ -56857,12 +57085,12 @@ var init_esm = __esm(() => {
|
|
|
56857
57085
|
});
|
|
56858
57086
|
|
|
56859
57087
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
56860
|
-
function mapMiniTarget(
|
|
56861
|
-
if (!
|
|
57088
|
+
function mapMiniTarget(t2) {
|
|
57089
|
+
if (!t2)
|
|
56862
57090
|
return "draft-7";
|
|
56863
|
-
if (
|
|
57091
|
+
if (t2 === "jsonSchema7" || t2 === "draft-7")
|
|
56864
57092
|
return "draft-7";
|
|
56865
|
-
if (
|
|
57093
|
+
if (t2 === "jsonSchema2019-09" || t2 === "draft-2020-12")
|
|
56866
57094
|
return "draft-2020-12";
|
|
56867
57095
|
return "draft-7";
|
|
56868
57096
|
}
|
|
@@ -57615,8 +57843,8 @@ class Protocol {
|
|
|
57615
57843
|
}
|
|
57616
57844
|
async _clearTaskQueue(taskId, sessionId) {
|
|
57617
57845
|
if (this._taskMessageQueue) {
|
|
57618
|
-
const
|
|
57619
|
-
for (const message of
|
|
57846
|
+
const messages2 = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
|
|
57847
|
+
for (const message of messages2) {
|
|
57620
57848
|
if (message.type === "request" && isJSONRPCRequest(message.message)) {
|
|
57621
57849
|
const requestId = message.message.id;
|
|
57622
57850
|
const resolver = this._requestResolvers.get(requestId);
|
|
@@ -59210,7 +59438,7 @@ var require_dataType = __commonJS((exports) => {
|
|
|
59210
59438
|
exports.coerceAndCheckDataType = coerceAndCheckDataType;
|
|
59211
59439
|
var COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
|
|
59212
59440
|
function coerceToTypes(types2, coerceTypes) {
|
|
59213
|
-
return coerceTypes ? types2.filter((
|
|
59441
|
+
return coerceTypes ? types2.filter((t2) => COERCIBLE.has(t2) || coerceTypes === "array" && t2 === "array") : [];
|
|
59214
59442
|
}
|
|
59215
59443
|
function coerceData(it, types2, coerceTo) {
|
|
59216
59444
|
const { gen, data, opts } = it;
|
|
@@ -59220,9 +59448,9 @@ var require_dataType = __commonJS((exports) => {
|
|
|
59220
59448
|
gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types2, data, opts.strictNumbers), () => gen.assign(coerced, data)));
|
|
59221
59449
|
}
|
|
59222
59450
|
gen.if((0, codegen_1._)`${coerced} !== undefined`);
|
|
59223
|
-
for (const
|
|
59224
|
-
if (COERCIBLE.has(
|
|
59225
|
-
coerceSpecificType(
|
|
59451
|
+
for (const t2 of coerceTo) {
|
|
59452
|
+
if (COERCIBLE.has(t2) || t2 === "array" && opts.coerceTypes === "array") {
|
|
59453
|
+
coerceSpecificType(t2);
|
|
59226
59454
|
}
|
|
59227
59455
|
}
|
|
59228
59456
|
gen.else();
|
|
@@ -59232,8 +59460,8 @@ var require_dataType = __commonJS((exports) => {
|
|
|
59232
59460
|
gen.assign(data, coerced);
|
|
59233
59461
|
assignParentData(it, coerced);
|
|
59234
59462
|
});
|
|
59235
|
-
function coerceSpecificType(
|
|
59236
|
-
switch (
|
|
59463
|
+
function coerceSpecificType(t2) {
|
|
59464
|
+
switch (t2) {
|
|
59237
59465
|
case "string":
|
|
59238
59466
|
gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`);
|
|
59239
59467
|
return;
|
|
@@ -59305,8 +59533,8 @@ var require_dataType = __commonJS((exports) => {
|
|
|
59305
59533
|
}
|
|
59306
59534
|
if (types2.number)
|
|
59307
59535
|
delete types2.integer;
|
|
59308
|
-
for (const
|
|
59309
|
-
cond = (0, codegen_1.and)(cond, checkDataType(
|
|
59536
|
+
for (const t2 in types2)
|
|
59537
|
+
cond = (0, codegen_1.and)(cond, checkDataType(t2, data, strictNums, correct));
|
|
59310
59538
|
return cond;
|
|
59311
59539
|
}
|
|
59312
59540
|
exports.checkDataTypes = checkDataTypes;
|
|
@@ -60204,9 +60432,9 @@ var require_validate = __commonJS((exports) => {
|
|
|
60204
60432
|
it.dataTypes = types2;
|
|
60205
60433
|
return;
|
|
60206
60434
|
}
|
|
60207
|
-
types2.forEach((
|
|
60208
|
-
if (!includesType(it.dataTypes,
|
|
60209
|
-
strictTypesError(it, `type "${
|
|
60435
|
+
types2.forEach((t2) => {
|
|
60436
|
+
if (!includesType(it.dataTypes, t2)) {
|
|
60437
|
+
strictTypesError(it, `type "${t2}" not allowed by context "${it.dataTypes.join(",")}"`);
|
|
60210
60438
|
}
|
|
60211
60439
|
});
|
|
60212
60440
|
narrowSchemaTypes(it, types2);
|
|
@@ -60222,7 +60450,7 @@ var require_validate = __commonJS((exports) => {
|
|
|
60222
60450
|
const rule = rules[keyword];
|
|
60223
60451
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
|
|
60224
60452
|
const { type } = rule.definition;
|
|
60225
|
-
if (type.length && !type.some((
|
|
60453
|
+
if (type.length && !type.some((t2) => hasApplicableType(ts, t2))) {
|
|
60226
60454
|
strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
|
|
60227
60455
|
}
|
|
60228
60456
|
}
|
|
@@ -60231,15 +60459,15 @@ var require_validate = __commonJS((exports) => {
|
|
|
60231
60459
|
function hasApplicableType(schTs, kwdT) {
|
|
60232
60460
|
return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
|
|
60233
60461
|
}
|
|
60234
|
-
function includesType(ts,
|
|
60235
|
-
return ts.includes(
|
|
60462
|
+
function includesType(ts, t2) {
|
|
60463
|
+
return ts.includes(t2) || t2 === "integer" && ts.includes("number");
|
|
60236
60464
|
}
|
|
60237
60465
|
function narrowSchemaTypes(it, withTypes) {
|
|
60238
60466
|
const ts = [];
|
|
60239
|
-
for (const
|
|
60240
|
-
if (includesType(withTypes,
|
|
60241
|
-
ts.push(
|
|
60242
|
-
else if (withTypes.includes("integer") &&
|
|
60467
|
+
for (const t2 of it.dataTypes) {
|
|
60468
|
+
if (includesType(withTypes, t2))
|
|
60469
|
+
ts.push(t2);
|
|
60470
|
+
else if (withTypes.includes("integer") && t2 === "number")
|
|
60243
60471
|
ts.push("integer");
|
|
60244
60472
|
}
|
|
60245
60473
|
it.dataTypes = ts;
|
|
@@ -61783,7 +62011,7 @@ var require_core = __commonJS((exports) => {
|
|
|
61783
62011
|
type: (0, dataType_1.getJSONTypes)(def.type),
|
|
61784
62012
|
schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
|
|
61785
62013
|
};
|
|
61786
|
-
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((
|
|
62014
|
+
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t2) => addRule.call(this, k, definition, t2)));
|
|
61787
62015
|
return this;
|
|
61788
62016
|
}
|
|
61789
62017
|
getKeyword(keyword) {
|
|
@@ -61977,7 +62205,7 @@ var require_core = __commonJS((exports) => {
|
|
|
61977
62205
|
if (dataType && post)
|
|
61978
62206
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
61979
62207
|
const { RULES } = this;
|
|
61980
|
-
let ruleGroup = post ? RULES.post : RULES.rules.find(({ type:
|
|
62208
|
+
let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t2 }) => t2 === dataType);
|
|
61981
62209
|
if (!ruleGroup) {
|
|
61982
62210
|
ruleGroup = { type: dataType, rules: [] };
|
|
61983
62211
|
RULES.rules.push(ruleGroup);
|
|
@@ -62486,7 +62714,7 @@ var require_uniqueItems = __commonJS((exports) => {
|
|
|
62486
62714
|
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
|
|
62487
62715
|
}
|
|
62488
62716
|
function canOptimize() {
|
|
62489
|
-
return itemTypes.length > 0 && !itemTypes.some((
|
|
62717
|
+
return itemTypes.length > 0 && !itemTypes.some((t2) => t2 === "object" || t2 === "array");
|
|
62490
62718
|
}
|
|
62491
62719
|
function loopN(i, j) {
|
|
62492
62720
|
const item = gen.name("item");
|
|
@@ -65054,7 +65282,7 @@ class McpServer {
|
|
|
65054
65282
|
return createCompletionResult(suggestions);
|
|
65055
65283
|
}
|
|
65056
65284
|
async handleResourceCompletion(request, ref) {
|
|
65057
|
-
const template = Object.values(this._registeredResourceTemplates).find((
|
|
65285
|
+
const template = Object.values(this._registeredResourceTemplates).find((t2) => t2.resourceTemplate.uriTemplate.toString() === ref.uri);
|
|
65058
65286
|
if (!template) {
|
|
65059
65287
|
if (this._registeredResources[ref.uri]) {
|
|
65060
65288
|
return EMPTY_COMPLETION_RESULT;
|
|
@@ -65682,14 +65910,14 @@ async function startMcpServer() {
|
|
|
65682
65910
|
} else {
|
|
65683
65911
|
results = getTopTrends(10);
|
|
65684
65912
|
}
|
|
65685
|
-
const formatted = results.map((
|
|
65686
|
-
id:
|
|
65687
|
-
name:
|
|
65688
|
-
category:
|
|
65689
|
-
description:
|
|
65690
|
-
popularity:
|
|
65691
|
-
keywords:
|
|
65692
|
-
figmaPromptHints:
|
|
65913
|
+
const formatted = results.map((t2) => ({
|
|
65914
|
+
id: t2.id,
|
|
65915
|
+
name: t2.name,
|
|
65916
|
+
category: t2.category,
|
|
65917
|
+
description: t2.description,
|
|
65918
|
+
popularity: t2.popularity,
|
|
65919
|
+
keywords: t2.keywords,
|
|
65920
|
+
figmaPromptHints: t2.figmaPromptHints
|
|
65693
65921
|
}));
|
|
65694
65922
|
return {
|
|
65695
65923
|
content: [
|
|
@@ -65709,7 +65937,7 @@ async function startMcpServer() {
|
|
|
65709
65937
|
content: [
|
|
65710
65938
|
{
|
|
65711
65939
|
type: "text",
|
|
65712
|
-
text: `Trend "${trendId}" not found. Available trends: ${TRENDS.map((
|
|
65940
|
+
text: `Trend "${trendId}" not found. Available trends: ${TRENDS.map((t2) => t2.id).join(", ")}`
|
|
65713
65941
|
}
|
|
65714
65942
|
],
|
|
65715
65943
|
isError: true
|
|
@@ -65744,7 +65972,7 @@ async function startMcpServer() {
|
|
|
65744
65972
|
content: [
|
|
65745
65973
|
{
|
|
65746
65974
|
type: "text",
|
|
65747
|
-
text: `Trend "${trend1}" not found. Available trends: ${TRENDS.map((
|
|
65975
|
+
text: `Trend "${trend1}" not found. Available trends: ${TRENDS.map((t3) => t3.id).join(", ")}`
|
|
65748
65976
|
}
|
|
65749
65977
|
],
|
|
65750
65978
|
isError: true
|
|
@@ -65755,7 +65983,7 @@ async function startMcpServer() {
|
|
|
65755
65983
|
content: [
|
|
65756
65984
|
{
|
|
65757
65985
|
type: "text",
|
|
65758
|
-
text: `Trend "${trend2}" not found. Available trends: ${TRENDS.map((
|
|
65986
|
+
text: `Trend "${trend2}" not found. Available trends: ${TRENDS.map((t3) => t3.id).join(", ")}`
|
|
65759
65987
|
}
|
|
65760
65988
|
],
|
|
65761
65989
|
isError: true
|
|
@@ -65783,11 +66011,11 @@ async function startMcpServer() {
|
|
|
65783
66011
|
{
|
|
65784
66012
|
uri: uri.href,
|
|
65785
66013
|
mimeType: "application/json",
|
|
65786
|
-
text: JSON.stringify(TRENDS.map((
|
|
65787
|
-
id:
|
|
65788
|
-
name:
|
|
65789
|
-
category:
|
|
65790
|
-
popularity:
|
|
66014
|
+
text: JSON.stringify(TRENDS.map((t2) => ({
|
|
66015
|
+
id: t2.id,
|
|
66016
|
+
name: t2.name,
|
|
66017
|
+
category: t2.category,
|
|
66018
|
+
popularity: t2.popularity
|
|
65791
66019
|
})), null, 2)
|
|
65792
66020
|
}
|
|
65793
66021
|
]
|
|
@@ -65826,28 +66054,26 @@ init_display();
|
|
|
65826
66054
|
init_ora();
|
|
65827
66055
|
init_engine();
|
|
65828
66056
|
init_display();
|
|
66057
|
+
init_i18n();
|
|
65829
66058
|
async function chatCommand(message) {
|
|
65830
66059
|
if (!message || message.trim().length === 0) {
|
|
65831
|
-
printError("
|
|
65832
|
-
console.log(' designnn chat "SaaS pricing page with dark theme"');
|
|
66060
|
+
printError(t("chatNoMessage"));
|
|
65833
66061
|
process.exit(1);
|
|
65834
66062
|
}
|
|
65835
66063
|
const spinner = ora({
|
|
65836
|
-
text: "
|
|
66064
|
+
text: t("chatAnalyzing"),
|
|
65837
66065
|
color: "yellow"
|
|
65838
66066
|
}).start();
|
|
65839
66067
|
try {
|
|
65840
66068
|
const prompt = await generateChatPrompt(message);
|
|
65841
66069
|
spinner.stop();
|
|
65842
|
-
printPrompt(prompt,
|
|
66070
|
+
printPrompt(prompt, `${t("chatPromptFor")} "${message}"`);
|
|
65843
66071
|
} catch (error3) {
|
|
65844
66072
|
spinner.stop();
|
|
65845
66073
|
if (error3?.code === "ENOTFOUND" || error3?.message?.includes("API key")) {
|
|
65846
|
-
printError(
|
|
65847
|
-
export OPENAI_API_KEY=your-key
|
|
65848
|
-
or: designnn config --api-key your-key`);
|
|
66074
|
+
printError(t("chatApiKeyError"));
|
|
65849
66075
|
} else {
|
|
65850
|
-
printError(
|
|
66076
|
+
printError(`${t("chatFailed")}: ${error3?.message || "Unknown error"}`);
|
|
65851
66077
|
}
|
|
65852
66078
|
process.exit(1);
|
|
65853
66079
|
}
|
|
@@ -65859,57 +66085,58 @@ init_source();
|
|
|
65859
66085
|
init_trends();
|
|
65860
66086
|
init_engine();
|
|
65861
66087
|
init_display();
|
|
66088
|
+
init_i18n();
|
|
65862
66089
|
async function exploreCommand(options) {
|
|
65863
66090
|
let results = [];
|
|
65864
|
-
let title = "
|
|
66091
|
+
let title = t("exploreDesignTrends");
|
|
65865
66092
|
if (options.component) {
|
|
65866
66093
|
results = searchTrends(options.component);
|
|
65867
|
-
title =
|
|
66094
|
+
title = `${t("exploreMatching")}: "${options.component}"`;
|
|
65868
66095
|
} else if (options.category) {
|
|
65869
66096
|
const validCategories = ["style", "component", "pattern", "layout", "interaction"];
|
|
65870
66097
|
if (!validCategories.includes(options.category)) {
|
|
65871
|
-
printError(
|
|
66098
|
+
printError(`${t("exploreInvalidCategory")}: ${validCategories.join(", ")}`);
|
|
65872
66099
|
process.exit(1);
|
|
65873
66100
|
}
|
|
65874
66101
|
results = getTrendsByCategory(options.category);
|
|
65875
|
-
title = `${options.category
|
|
66102
|
+
title = `${getCategoryName(options.category)} ${t("exploreTrends")}`;
|
|
65876
66103
|
} else if (options.top) {
|
|
65877
66104
|
const limit2 = parseInt(options.top) || 10;
|
|
65878
66105
|
results = getTopTrends(limit2);
|
|
65879
|
-
title =
|
|
66106
|
+
title = `${t("exploreTop")} ${limit2} ${t("exploreDesignTrends")}`;
|
|
65880
66107
|
} else {
|
|
65881
|
-
printSection("
|
|
65882
|
-
console.log(source_default.dim(` ${TRENDS.length}
|
|
66108
|
+
printSection(t("exploreAllTrends"));
|
|
66109
|
+
console.log(source_default.dim(` ${TRENDS.length} ${t("exploreTrendsInDb")}
|
|
65883
66110
|
`));
|
|
65884
66111
|
const categories = ["style", "component", "pattern", "layout", "interaction"];
|
|
65885
66112
|
for (const cat of categories) {
|
|
65886
66113
|
const catTrends = getTrendsByCategory(cat);
|
|
65887
|
-
console.log(source_default.bold(` ${cat.toUpperCase()} (${catTrends.length})`));
|
|
65888
|
-
catTrends.forEach((
|
|
66114
|
+
console.log(source_default.bold(` ${getCategoryName(cat).toUpperCase()} (${catTrends.length})`));
|
|
66115
|
+
catTrends.forEach((t2, i) => printTrend(t2, i));
|
|
65889
66116
|
}
|
|
65890
|
-
console.log(source_default.dim(
|
|
65891
|
-
console.log(source_default.dim(`
|
|
66117
|
+
console.log(source_default.dim(` ${t("exploreTipFilter")}`));
|
|
66118
|
+
console.log(source_default.dim(` ${t("exploreTipGenerate")}
|
|
65892
66119
|
`));
|
|
65893
66120
|
return;
|
|
65894
66121
|
}
|
|
65895
66122
|
if (results.length === 0) {
|
|
65896
|
-
printError("
|
|
66123
|
+
printError(t("exploreNoResults"));
|
|
65897
66124
|
console.log(source_default.dim(" Try: designnn explore --top 10"));
|
|
65898
66125
|
return;
|
|
65899
66126
|
}
|
|
65900
66127
|
printSection(title);
|
|
65901
|
-
console.log(source_default.dim(` ${results.length}
|
|
66128
|
+
console.log(source_default.dim(` ${results.length} ${t("exploreResults")}
|
|
65902
66129
|
`));
|
|
65903
|
-
results.forEach((
|
|
66130
|
+
results.forEach((t2, i) => printTrend(t2, i));
|
|
65904
66131
|
if (options.generate) {
|
|
65905
|
-
const trend = results.find((
|
|
66132
|
+
const trend = results.find((t2) => t2.id === options.generate) || TRENDS.find((t2) => t2.id === options.generate);
|
|
65906
66133
|
if (!trend) {
|
|
65907
|
-
printError(
|
|
65908
|
-
console.log(source_default.dim("
|
|
66134
|
+
printError(`${t("exploreTrendNotFound")}: "${options.generate}"`);
|
|
66135
|
+
console.log(source_default.dim(` ${t("exploreAvailableIds")}: ` + results.map((t2) => t2.id).join(", ")));
|
|
65909
66136
|
return;
|
|
65910
66137
|
}
|
|
65911
66138
|
const spinner = ora({
|
|
65912
|
-
text:
|
|
66139
|
+
text: `${t("exploreGenerating")} "${trend.name}"...`,
|
|
65913
66140
|
color: "yellow"
|
|
65914
66141
|
}).start();
|
|
65915
66142
|
try {
|
|
@@ -65918,7 +66145,7 @@ async function exploreCommand(options) {
|
|
|
65918
66145
|
printPrompt(prompt, `Trend: ${trend.name}`);
|
|
65919
66146
|
} catch (error3) {
|
|
65920
66147
|
spinner.stop();
|
|
65921
|
-
printError(
|
|
66148
|
+
printError(`${t("chatFailed")}: ${error3?.message || "Unknown error"}`);
|
|
65922
66149
|
}
|
|
65923
66150
|
}
|
|
65924
66151
|
}
|
|
@@ -65929,54 +66156,53 @@ init_source();
|
|
|
65929
66156
|
init_trends();
|
|
65930
66157
|
init_engine();
|
|
65931
66158
|
init_display();
|
|
66159
|
+
init_i18n();
|
|
65932
66160
|
async function mixCommand(trend1Name, trend2Name, options) {
|
|
65933
66161
|
if (!trend1Name || !trend2Name) {
|
|
65934
|
-
printError("
|
|
65935
|
-
console.log(' designnn mix "Bento UI" "Glassmorphism"');
|
|
65936
|
-
console.log(" designnn mix bento-ui glassmorphism");
|
|
66162
|
+
printError(t("mixNoTrends"));
|
|
65937
66163
|
process.exit(1);
|
|
65938
66164
|
}
|
|
65939
66165
|
const trend1 = findTrend(trend1Name);
|
|
65940
66166
|
const trend2 = findTrend(trend2Name);
|
|
65941
66167
|
if (!trend1) {
|
|
65942
|
-
printError(
|
|
66168
|
+
printError(`${t("mixTrendNotFound")}: "${trend1Name}"`);
|
|
65943
66169
|
suggestTrends(trend1Name);
|
|
65944
66170
|
process.exit(1);
|
|
65945
66171
|
}
|
|
65946
66172
|
if (!trend2) {
|
|
65947
|
-
printError(
|
|
66173
|
+
printError(`${t("mixTrendNotFound")}: "${trend2Name}"`);
|
|
65948
66174
|
suggestTrends(trend2Name);
|
|
65949
66175
|
process.exit(1);
|
|
65950
66176
|
}
|
|
65951
|
-
printSection("
|
|
66177
|
+
printSection(t("mixMixing"));
|
|
65952
66178
|
console.log("");
|
|
65953
|
-
console.log(source_default.bold(
|
|
66179
|
+
console.log(source_default.bold(` ${t("mixTrendA")}`));
|
|
65954
66180
|
printTrend(trend1);
|
|
65955
|
-
console.log(source_default.bold(
|
|
66181
|
+
console.log(source_default.bold(` ${t("mixTrendB")}`));
|
|
65956
66182
|
printTrend(trend2);
|
|
65957
66183
|
if (options.context) {
|
|
65958
|
-
console.log(source_default.dim(`
|
|
66184
|
+
console.log(source_default.dim(` ${t("mixContext")}: "${options.context}"
|
|
65959
66185
|
`));
|
|
65960
66186
|
}
|
|
65961
66187
|
const spinner = ora({
|
|
65962
|
-
text: `
|
|
66188
|
+
text: `"${trend1.name}" × "${trend2.name}" ${t("mixGenerating")}`,
|
|
65963
66189
|
color: "yellow"
|
|
65964
66190
|
}).start();
|
|
65965
66191
|
try {
|
|
65966
66192
|
const prompt = await generateMixPrompt(trend1, trend2, options.context);
|
|
65967
66193
|
spinner.stop();
|
|
65968
|
-
printPrompt(prompt,
|
|
66194
|
+
printPrompt(prompt, `${t("mixResult")}: ${trend1.name} × ${trend2.name}`);
|
|
65969
66195
|
} catch (error3) {
|
|
65970
66196
|
spinner.stop();
|
|
65971
|
-
printError(
|
|
66197
|
+
printError(`${t("chatFailed")}: ${error3?.message || "Unknown error"}`);
|
|
65972
66198
|
process.exit(1);
|
|
65973
66199
|
}
|
|
65974
66200
|
}
|
|
65975
66201
|
function findTrend(query2) {
|
|
65976
|
-
const byId = TRENDS.find((
|
|
66202
|
+
const byId = TRENDS.find((t2) => t2.id === query2.toLowerCase());
|
|
65977
66203
|
if (byId)
|
|
65978
66204
|
return byId;
|
|
65979
|
-
const byName = TRENDS.find((
|
|
66205
|
+
const byName = TRENDS.find((t2) => t2.name.toLowerCase() === query2.toLowerCase());
|
|
65980
66206
|
if (byName)
|
|
65981
66207
|
return byName;
|
|
65982
66208
|
const results = searchTrends(query2);
|
|
@@ -65985,23 +66211,35 @@ function findTrend(query2) {
|
|
|
65985
66211
|
function suggestTrends(query2) {
|
|
65986
66212
|
const results = searchTrends(query2);
|
|
65987
66213
|
if (results.length > 0) {
|
|
65988
|
-
console.log(source_default.dim(
|
|
65989
|
-
results.slice(0, 3).forEach((
|
|
65990
|
-
console.log(source_default.dim(` - ${
|
|
66214
|
+
console.log(source_default.dim(` ${t("mixDidYouMean")}`));
|
|
66215
|
+
results.slice(0, 3).forEach((trend) => {
|
|
66216
|
+
console.log(source_default.dim(` - ${trend.name} (${trend.id})`));
|
|
65991
66217
|
});
|
|
65992
66218
|
} else {
|
|
65993
|
-
console.log(source_default.dim(
|
|
65994
|
-
TRENDS.slice(0, 5).forEach((
|
|
65995
|
-
console.log(source_default.dim(` - ${
|
|
66219
|
+
console.log(source_default.dim(` ${t("mixAvailableTrends")}`));
|
|
66220
|
+
TRENDS.slice(0, 5).forEach((trend) => {
|
|
66221
|
+
console.log(source_default.dim(` - ${trend.name} (${trend.id})`));
|
|
65996
66222
|
});
|
|
65997
|
-
console.log(source_default.dim(
|
|
66223
|
+
console.log(source_default.dim(` ${t("mixSeeAll")}`));
|
|
65998
66224
|
}
|
|
65999
66225
|
}
|
|
66000
66226
|
|
|
66001
66227
|
// src/cli.ts
|
|
66228
|
+
init_i18n();
|
|
66002
66229
|
var program2 = new Command;
|
|
66230
|
+
function initLang(options) {
|
|
66231
|
+
if (options?.lang) {
|
|
66232
|
+
setLang(options.lang);
|
|
66233
|
+
} else {
|
|
66234
|
+
setLang(detectLang());
|
|
66235
|
+
}
|
|
66236
|
+
}
|
|
66003
66237
|
program2.name("designnn").description(`Trend-driven design prompt engine for Figma AI.
|
|
66004
|
-
Generate high-quality UI/UX prompts powered by real-time design trend analysis
|
|
66238
|
+
Generate high-quality UI/UX prompts powered by real-time design trend analysis.
|
|
66239
|
+
|
|
66240
|
+
Figma AI のためのトレンド駆動デザインプロンプトエンジン。`).version("0.4.0").option("--lang <language>", "Display language: en or ja (auto-detected from system)").hook("preAction", (thisCommand) => {
|
|
66241
|
+
const opts = thisCommand.opts();
|
|
66242
|
+
initLang(opts);
|
|
66005
66243
|
if (thisCommand.name() !== "agent") {
|
|
66006
66244
|
printBanner();
|
|
66007
66245
|
}
|
|
@@ -66034,6 +66272,7 @@ program2.command("agent").description("Start DESIGNNN as an MCP server for AI ag
|
|
|
66034
66272
|
});
|
|
66035
66273
|
program2.parse(process.argv);
|
|
66036
66274
|
if (!process.argv.slice(2).length) {
|
|
66275
|
+
setLang(detectLang());
|
|
66037
66276
|
printBanner();
|
|
66038
66277
|
program2.outputHelp();
|
|
66039
66278
|
}
|