@geminilight/mindos 0.6.30 → 0.6.31

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.
Files changed (52) hide show
  1. package/README_zh.md +10 -4
  2. package/app/app/api/ask/route.ts +12 -7
  3. package/app/app/api/export/route.ts +105 -0
  4. package/app/app/globals.css +2 -2
  5. package/app/app/trash/page.tsx +7 -0
  6. package/app/app/view/[...path]/ViewPageClient.tsx +234 -2
  7. package/app/components/ExportModal.tsx +220 -0
  8. package/app/components/FileTree.tsx +22 -2
  9. package/app/components/HomeContent.tsx +91 -20
  10. package/app/components/MarkdownView.tsx +45 -10
  11. package/app/components/Sidebar.tsx +10 -1
  12. package/app/components/TrashPageClient.tsx +263 -0
  13. package/app/components/ask/ToolCallBlock.tsx +102 -18
  14. package/app/components/changes/ChangesContentPage.tsx +58 -14
  15. package/app/components/explore/ExploreContent.tsx +4 -7
  16. package/app/components/explore/UseCaseCard.tsx +18 -1
  17. package/app/components/explore/use-cases.generated.ts +76 -0
  18. package/app/components/explore/use-cases.yaml +185 -0
  19. package/app/components/panels/DiscoverPanel.tsx +1 -1
  20. package/app/components/renderers/workflow-yaml/StepEditor.tsx +98 -91
  21. package/app/components/renderers/workflow-yaml/WorkflowEditor.tsx +82 -72
  22. package/app/components/renderers/workflow-yaml/WorkflowRunner.tsx +163 -120
  23. package/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx +61 -61
  24. package/app/components/renderers/workflow-yaml/execution.ts +64 -12
  25. package/app/components/renderers/workflow-yaml/selectors.tsx +64 -12
  26. package/app/components/settings/AiTab.tsx +191 -174
  27. package/app/components/settings/AppearanceTab.tsx +168 -77
  28. package/app/components/settings/KnowledgeTab.tsx +131 -136
  29. package/app/components/settings/McpTab.tsx +11 -11
  30. package/app/components/settings/Primitives.tsx +60 -0
  31. package/app/components/settings/SettingsContent.tsx +15 -8
  32. package/app/components/settings/SyncTab.tsx +12 -12
  33. package/app/components/settings/UninstallTab.tsx +8 -18
  34. package/app/components/settings/UpdateTab.tsx +82 -82
  35. package/app/components/settings/types.ts +17 -8
  36. package/app/lib/acp/session.ts +12 -3
  37. package/app/lib/actions.ts +57 -3
  38. package/app/lib/agent/stream-consumer.ts +18 -0
  39. package/app/lib/agent/tools.ts +56 -9
  40. package/app/lib/core/export.ts +116 -0
  41. package/app/lib/core/trash.ts +241 -0
  42. package/app/lib/fs.ts +47 -0
  43. package/app/lib/hooks/usePinnedFiles.ts +90 -0
  44. package/app/lib/i18n/generated/explore-i18n.generated.ts +138 -0
  45. package/app/lib/i18n/index.ts +3 -0
  46. package/app/lib/i18n/modules/knowledge.ts +120 -6
  47. package/app/lib/i18n/modules/onboarding.ts +2 -134
  48. package/app/lib/i18n/modules/settings.ts +12 -0
  49. package/app/package.json +8 -2
  50. package/app/scripts/generate-explore.ts +145 -0
  51. package/package.json +1 -1
  52. package/app/components/explore/use-cases.ts +0 -58
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * generate-explore.ts — YAML → TypeScript code generator for Explore use cases.
4
+ *
5
+ * Reads: components/explore/use-cases.yaml (single source of truth)
6
+ * Generates:
7
+ * 1. components/explore/use-cases.generated.ts (UseCase[] array + types)
8
+ * 2. lib/i18n/generated/explore-i18n.generated.ts (zh + en translation objects)
9
+ *
10
+ * Run: npx tsx scripts/generate-explore.ts
11
+ * Or: npm run generate (via package.json hook)
12
+ */
13
+ import { readFileSync, writeFileSync, mkdirSync } from 'fs';
14
+ import { resolve, dirname } from 'path';
15
+ import yaml from 'js-yaml';
16
+
17
+ const BANNER = '// ⚠️ AUTO-GENERATED — DO NOT EDIT. Source: components/explore/use-cases.yaml\n// Run `npm run generate` to regenerate.\n';
18
+
19
+ interface YamlText { title: string; desc: string; prompt: string }
20
+ interface YamlCase {
21
+ id: string;
22
+ icon: string;
23
+ image?: string;
24
+ category: string;
25
+ scenario: string;
26
+ zh: YamlText;
27
+ en: YamlText;
28
+ }
29
+ interface YamlMeta {
30
+ categories: Record<string, { en: string; zh: string }>;
31
+ scenarios: Record<string, { en: string; zh: string }>;
32
+ ui: Record<string, { en: string; zh: string }>;
33
+ }
34
+ interface YamlRoot { meta: YamlMeta; cases: YamlCase[] }
35
+
36
+ // ── Load YAML ──
37
+ const appDir = resolve(__dirname, '..');
38
+ const yamlPath = resolve(appDir, 'components/explore/use-cases.yaml');
39
+ const raw = readFileSync(yamlPath, 'utf-8');
40
+ const data = yaml.load(raw) as YamlRoot;
41
+
42
+ if (!data?.cases?.length) {
43
+ console.error('[generate-explore] No cases found in YAML');
44
+ process.exit(1);
45
+ }
46
+ if (!data?.meta) {
47
+ console.error('[generate-explore] No meta section found in YAML');
48
+ process.exit(1);
49
+ }
50
+
51
+ // ── Validate ──
52
+ const validCategories = new Set(Object.keys(data.meta.categories));
53
+ const validScenarios = new Set(Object.keys(data.meta.scenarios));
54
+ for (const c of data.cases) {
55
+ if (!c.id || !c.icon || !c.category || !c.scenario || !c.zh || !c.en) {
56
+ console.error(`[generate-explore] Invalid case: ${JSON.stringify(c)}`);
57
+ process.exit(1);
58
+ }
59
+ if (!validCategories.has(c.category)) {
60
+ console.error(`[generate-explore] Unknown category "${c.category}" in case ${c.id}`);
61
+ process.exit(1);
62
+ }
63
+ if (!validScenarios.has(c.scenario)) {
64
+ console.error(`[generate-explore] Unknown scenario "${c.scenario}" in case ${c.id}`);
65
+ process.exit(1);
66
+ }
67
+ }
68
+
69
+ // ── Generate use-cases.generated.ts ──
70
+ const categoryUnion = Object.keys(data.meta.categories).map(k => `'${k}'`).join(' | ');
71
+ const scenarioUnion = Object.keys(data.meta.scenarios).map(k => `'${k}'`).join(' | ');
72
+
73
+ const useCasesTs = `${BANNER}
74
+ /** Capability axis — maps to product pillars */
75
+ export type UseCaseCategory = ${categoryUnion};
76
+
77
+ /** Scenario axis — maps to user journey phase */
78
+ export type UseCaseScenario = ${scenarioUnion};
79
+
80
+ export interface UseCase {
81
+ id: string;
82
+ icon: string;
83
+ image?: string;
84
+ category: UseCaseCategory;
85
+ scenario: UseCaseScenario;
86
+ }
87
+
88
+ export const useCases: UseCase[] = ${JSON.stringify(
89
+ data.cases.map(c => ({
90
+ id: c.id,
91
+ icon: c.icon,
92
+ ...(c.image ? { image: c.image } : {}),
93
+ category: c.category,
94
+ scenario: c.scenario,
95
+ })),
96
+ null,
97
+ 2,
98
+ )};
99
+
100
+ export const categories: UseCaseCategory[] = ${JSON.stringify(Object.keys(data.meta.categories))};
101
+ export const scenarios: UseCaseScenario[] = ${JSON.stringify(Object.keys(data.meta.scenarios))};
102
+ `;
103
+
104
+ const useCasesPath = resolve(appDir, 'components/explore/use-cases.generated.ts');
105
+ writeFileSync(useCasesPath, useCasesTs, 'utf-8');
106
+ console.log(`[generate-explore] ✓ ${useCasesPath}`);
107
+
108
+ // ── Generate explore-i18n.generated.ts ──
109
+ function buildI18n(lang: 'en' | 'zh') {
110
+ const ui: Record<string, string> = {};
111
+ for (const [key, val] of Object.entries(data.meta.ui)) {
112
+ ui[key] = val[lang];
113
+ }
114
+
115
+ const categories: Record<string, string> = {};
116
+ for (const [key, val] of Object.entries(data.meta.categories)) {
117
+ categories[key] = val[lang];
118
+ }
119
+
120
+ const scenarios: Record<string, string> = {};
121
+ for (const [key, val] of Object.entries(data.meta.scenarios)) {
122
+ scenarios[key] = val[lang];
123
+ }
124
+
125
+ const cases: Record<string, { title: string; desc: string; prompt: string }> = {};
126
+ for (const c of data.cases) {
127
+ cases[c.id] = c[lang];
128
+ }
129
+
130
+ return { ...ui, categories, scenarios, ...cases };
131
+ }
132
+
133
+ const i18nTs = `${BANNER}
134
+ export const exploreEn = ${JSON.stringify(buildI18n('en'), null, 2)} as const;
135
+
136
+ export const exploreZh = ${JSON.stringify(buildI18n('zh'), null, 2)} as const;
137
+ `;
138
+
139
+ const i18nDir = resolve(appDir, 'lib/i18n/generated');
140
+ mkdirSync(i18nDir, { recursive: true });
141
+ const i18nPath = resolve(i18nDir, 'explore-i18n.generated.ts');
142
+ writeFileSync(i18nPath, i18nTs, 'utf-8');
143
+ console.log(`[generate-explore] ✓ ${i18nPath}`);
144
+
145
+ console.log(`[generate-explore] Done — ${data.cases.length} use cases generated.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminilight/mindos",
3
- "version": "0.6.30",
3
+ "version": "0.6.31",
4
4
  "description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
5
5
  "keywords": [
6
6
  "mindos",
@@ -1,58 +0,0 @@
1
- /** Capability axis — maps to product pillars */
2
- export type UseCaseCategory = 'knowledge-management' | 'memory-sync' | 'auto-execute' | 'experience-evolution' | 'human-insights' | 'audit-control';
3
-
4
- /** Scenario axis — maps to user journey phase */
5
- export type UseCaseScenario = 'first-day' | 'daily' | 'project' | 'advanced';
6
-
7
- export interface UseCase {
8
- id: string;
9
- icon: string;
10
- category: UseCaseCategory;
11
- scenario: UseCaseScenario;
12
- }
13
-
14
- /**
15
- * C1-C9 use case definitions.
16
- * All display text (title, description, prompt) comes from i18n — this file is structure only.
17
- *
18
- * Category (capability axis):
19
- * knowledge-management — Inject, organize, and maintain knowledge
20
- * memory-sync — Record once, all Agents know
21
- * auto-execute — One sentence, auto-execute
22
- * experience-evolution — Gets smarter with use
23
- * human-insights — Understand and manage relationships
24
- * audit-control — You have final say
25
- *
26
- * Scenario (journey axis):
27
- * first-day — Onboarding / first-time tasks
28
- * daily — Everyday workflows
29
- * project — Project-scoped work
30
- * advanced — Power-user patterns
31
- */
32
- export const useCases: UseCase[] = [
33
- { id: 'c1', icon: '👤', category: 'memory-sync', scenario: 'first-day' },
34
- { id: 'c2', icon: '📥', category: 'knowledge-management', scenario: 'daily' },
35
- { id: 'c3', icon: '🔄', category: 'memory-sync', scenario: 'project' },
36
- { id: 'c4', icon: '🔁', category: 'experience-evolution', scenario: 'daily' },
37
- { id: 'c5', icon: '💡', category: 'auto-execute', scenario: 'daily' },
38
- { id: 'c6', icon: '🚀', category: 'auto-execute', scenario: 'project' },
39
- { id: 'c7', icon: '🔍', category: 'knowledge-management', scenario: 'project' },
40
- { id: 'c8', icon: '🤝', category: 'human-insights', scenario: 'daily' },
41
- { id: 'c9', icon: '🛡️', category: 'audit-control', scenario: 'advanced' },
42
- ];
43
-
44
- export const categories: UseCaseCategory[] = [
45
- 'knowledge-management',
46
- 'memory-sync',
47
- 'auto-execute',
48
- 'experience-evolution',
49
- 'human-insights',
50
- 'audit-control',
51
- ];
52
-
53
- export const scenarios: UseCaseScenario[] = [
54
- 'first-day',
55
- 'daily',
56
- 'project',
57
- 'advanced',
58
- ];