@autono/open-pages 0.5.0 → 0.7.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/{build-L50pau9v.js → build-CCoxDxL-.js} +11 -10
- package/dist/cli/bin.d.ts +1 -1
- package/dist/cli/bin.js +434 -28
- package/dist/{config-CDUdFE8N.js → config-D_U_aCQz.js} +484 -460
- package/dist/{config-C9or4m4J.d.ts → config-p-TWNXbv.d.ts} +4 -4
- package/dist/{design-C13iz9_4.js → design-Cpqx7SJs.js} +1 -2
- package/dist/{dev-CzJYXFOO.js → dev-CTrB263u.js} +40 -20
- package/dist/{export-DbVwSmKW.js → export-enKL9R7x.js} +7 -10
- package/dist/index.d.ts +6 -8
- package/dist/index.js +2 -3
- package/dist/locale/index.d.ts +8 -14
- package/dist/locale/index.js +67 -32
- package/dist/{open-pages-plugin-C0poXLsx.js → open-pages-plugin-C8cFhMB9.js} +23 -38
- package/dist/preview-Dmzyd1cf.js +24 -0
- package/dist/sync-ui-BzRiAGCK.js +132 -0
- package/dist/{types-C5NCdDT-.d.ts → types-DDdUFUIS.d.ts} +19 -6
- package/dist/{update-CV62NhBT.js → update-CWaCKlnl.js} +14 -5
- package/dist/{update-package-Cxt57pz7.js → update-package-GaNsVdr8.js} +50 -22
- package/dist/{version-B6AiiGvT.js → version-DZrXLoAD.js} +19 -3
- package/dist/vite/index.d.ts +3 -7
- package/dist/vite/index.js +2 -7
- package/package.json +24 -22
- package/src/app/app.tsx +19 -14
- package/src/app/assets/autono-social.png +0 -0
- package/src/app/assets/autono.svg +7 -0
- package/src/app/components/asset-view.tsx +510 -26
- package/src/app/components/command/command-menu.tsx +5 -1
- package/src/app/components/command/command.tsx +4 -2
- package/src/app/components/command/home-command-menu.tsx +6 -6
- package/src/app/components/icon-tooltip.tsx +24 -15
- package/src/app/components/sidebar/folder-item.tsx +46 -19
- package/src/app/components/sidebar/icon-picker.tsx +1 -1
- package/src/app/components/sidebar/sidebar-footer.tsx +18 -7
- package/src/app/components/sidebar/sidebar.tsx +91 -64
- package/src/app/components/theme-toggle.tsx +4 -5
- package/src/app/components/themes/theme-detail.tsx +6 -3
- package/src/app/components/themes/themes-gallery.tsx +12 -7
- package/src/app/index.html +33 -2
- package/src/app/lib/assets.ts +33 -0
- package/src/app/lib/last-home-location.ts +18 -0
- package/src/app/main.tsx +10 -1
- package/src/app/routes/home-shell.tsx +82 -61
- package/src/app/routes/home.tsx +42 -39
- package/src/app/routes/page.tsx +18 -3
- package/src/app/routes/themes.tsx +6 -8
- package/src/app/styles.css +40 -4
- package/src/app/virtual.d.ts +1 -0
- package/src/locale/en.ts +17 -6
- package/src/locale/ja.ts +18 -6
- package/src/locale/types.ts +17 -4
- package/src/locale/zh-cn.ts +19 -8
- package/src/locale/zh-tw.ts +17 -6
- package/src/shared/update-package.ts +193 -0
- package/workspace/components.json +25 -0
- package/workspace/deps.json +24 -0
- package/workspace/hooks/use-mobile.ts +19 -0
- package/workspace/lib/utils.ts +6 -0
- package/workspace/styles/globals.css +135 -0
- package/workspace/ui/accordion.tsx +79 -0
- package/workspace/ui/alert-dialog.tsx +197 -0
- package/workspace/ui/alert.tsx +76 -0
- package/workspace/ui/aspect-ratio.tsx +11 -0
- package/workspace/ui/attachment.tsx +204 -0
- package/workspace/ui/avatar.tsx +110 -0
- package/workspace/ui/badge.tsx +49 -0
- package/workspace/ui/breadcrumb.tsx +122 -0
- package/workspace/ui/bubble.tsx +125 -0
- package/workspace/ui/button-group.tsx +83 -0
- package/workspace/ui/button.tsx +67 -0
- package/workspace/ui/calendar.tsx +222 -0
- package/workspace/ui/card.tsx +103 -0
- package/workspace/ui/carousel.tsx +240 -0
- package/workspace/ui/chart.tsx +373 -0
- package/workspace/ui/checkbox.tsx +31 -0
- package/workspace/ui/collapsible.tsx +33 -0
- package/workspace/ui/combobox.tsx +297 -0
- package/workspace/ui/command.tsx +195 -0
- package/workspace/ui/context-menu.tsx +261 -0
- package/workspace/ui/dialog.tsx +168 -0
- package/workspace/ui/direction.tsx +22 -0
- package/workspace/ui/drawer.tsx +132 -0
- package/workspace/ui/dropdown-menu.tsx +269 -0
- package/workspace/ui/empty.tsx +104 -0
- package/workspace/ui/field.tsx +236 -0
- package/workspace/ui/hover-card.tsx +42 -0
- package/workspace/ui/input-group.tsx +156 -0
- package/workspace/ui/input-otp.tsx +87 -0
- package/workspace/ui/input.tsx +19 -0
- package/workspace/ui/item.tsx +196 -0
- package/workspace/ui/kbd.tsx +26 -0
- package/workspace/ui/label.tsx +22 -0
- package/workspace/ui/marker.tsx +69 -0
- package/workspace/ui/menubar.tsx +280 -0
- package/workspace/ui/message-scroller.tsx +129 -0
- package/workspace/ui/message.tsx +92 -0
- package/workspace/ui/native-select.tsx +61 -0
- package/workspace/ui/navigation-menu.tsx +164 -0
- package/workspace/ui/pagination.tsx +129 -0
- package/workspace/ui/popover.tsx +87 -0
- package/workspace/ui/progress.tsx +31 -0
- package/workspace/ui/radio-group.tsx +42 -0
- package/workspace/ui/resizable.tsx +50 -0
- package/workspace/ui/scroll-area.tsx +53 -0
- package/workspace/ui/select.tsx +192 -0
- package/workspace/ui/separator.tsx +26 -0
- package/workspace/ui/sheet.tsx +147 -0
- package/workspace/ui/sidebar.tsx +702 -0
- package/workspace/ui/skeleton.tsx +13 -0
- package/workspace/ui/slider.tsx +59 -0
- package/workspace/ui/sonner.tsx +47 -0
- package/workspace/ui/spinner.tsx +10 -0
- package/workspace/ui/switch.tsx +33 -0
- package/workspace/ui/table.tsx +114 -0
- package/workspace/ui/tabs.tsx +90 -0
- package/workspace/ui/textarea.tsx +18 -0
- package/workspace/ui/toggle-group.tsx +87 -0
- package/workspace/ui/toggle.tsx +45 -0
- package/workspace/ui/tooltip.tsx +57 -0
- package/dist/export-BsK6OCpc.js +0 -4
- package/dist/preview-CPufRmuj.js +0 -21
- package/dist/sync-Be_hxSOF.js +0 -139
- package/dist/sync-lKEXyPOh.js +0 -3
- package/dist/version-CeffgdfZ.js +0 -3
- package/src/app/components/language-toggle.tsx +0 -46
- package/src/app/favicon.ico +0 -0
package/dist/sync-Be_hxSOF.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { cp, lstat, mkdir, readFile, readdir, readlink, rm, symlink } from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { createHash } from "node:crypto";
|
|
5
|
-
import { existsSync } from "node:fs";
|
|
6
|
-
|
|
7
|
-
//#region src/cli/sync.ts
|
|
8
|
-
async function detectSkillsDrift(skillsDir) {
|
|
9
|
-
if (!existsSync(skillsDir)) return [];
|
|
10
|
-
const cwd = process.cwd();
|
|
11
|
-
const agentsSkillsDir = path.join(cwd, ".agents", "skills");
|
|
12
|
-
const skillNames = (await readdir(skillsDir, { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
13
|
-
const results = [];
|
|
14
|
-
for (const name of skillNames) {
|
|
15
|
-
const src = path.join(skillsDir, name);
|
|
16
|
-
const dst = path.join(agentsSkillsDir, name);
|
|
17
|
-
const srcHash = await hashDir(src);
|
|
18
|
-
const dstHash = existsSync(dst) ? await hashDir(dst) : null;
|
|
19
|
-
let status;
|
|
20
|
-
if (dstHash === null) status = "added";
|
|
21
|
-
else if (dstHash !== srcHash) status = "updated";
|
|
22
|
-
else status = "unchanged";
|
|
23
|
-
results.push({
|
|
24
|
-
name,
|
|
25
|
-
status
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return results;
|
|
29
|
-
}
|
|
30
|
-
async function syncSkills(skillsDir, opts = {}) {
|
|
31
|
-
const { dryRun = false } = opts;
|
|
32
|
-
if (!existsSync(skillsDir)) throw new Error(`Built-in skills directory missing at ${skillsDir}. The @autono/open-pages package may be corrupt — try reinstalling.`);
|
|
33
|
-
const cwd = process.cwd();
|
|
34
|
-
const agentsSkillsDir = path.join(cwd, ".agents", "skills");
|
|
35
|
-
const claudeSkillsDir = path.join(cwd, ".claude", "skills");
|
|
36
|
-
const results = await detectSkillsDrift(skillsDir);
|
|
37
|
-
if (results.length === 0) {
|
|
38
|
-
process.stdout.write(chalk.yellow("No skills found to sync.\n"));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
for (const { name, status } of results) {
|
|
42
|
-
const src = path.join(skillsDir, name);
|
|
43
|
-
const dst = path.join(agentsSkillsDir, name);
|
|
44
|
-
if (dryRun) continue;
|
|
45
|
-
if (status === "unchanged") {
|
|
46
|
-
await ensureClaudeSymlink(claudeSkillsDir, name);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
await mkdir(path.dirname(dst), { recursive: true });
|
|
50
|
-
if (existsSync(dst)) await rm(dst, {
|
|
51
|
-
recursive: true,
|
|
52
|
-
force: true
|
|
53
|
-
});
|
|
54
|
-
await cp(src, dst, { recursive: true });
|
|
55
|
-
await ensureClaudeSymlink(claudeSkillsDir, name);
|
|
56
|
-
}
|
|
57
|
-
printSummary(results, dryRun);
|
|
58
|
-
}
|
|
59
|
-
async function ensureClaudeSymlink(claudeSkillsDir, name) {
|
|
60
|
-
await mkdir(claudeSkillsDir, { recursive: true });
|
|
61
|
-
const linkPath = path.join(claudeSkillsDir, name);
|
|
62
|
-
const target = path.join("..", "..", ".agents", "skills", name);
|
|
63
|
-
if (existsSync(linkPath)) try {
|
|
64
|
-
const stat = await lstat(linkPath);
|
|
65
|
-
if (stat.isSymbolicLink()) {
|
|
66
|
-
const current = await readlink(linkPath);
|
|
67
|
-
if (current === target) return;
|
|
68
|
-
}
|
|
69
|
-
await rm(linkPath, {
|
|
70
|
-
recursive: true,
|
|
71
|
-
force: true
|
|
72
|
-
});
|
|
73
|
-
} catch {
|
|
74
|
-
await rm(linkPath, {
|
|
75
|
-
recursive: true,
|
|
76
|
-
force: true
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
await symlink(target, linkPath, "dir");
|
|
81
|
-
} catch (err) {
|
|
82
|
-
const code = err.code;
|
|
83
|
-
if (code === "EPERM" || code === "EEXIST") {
|
|
84
|
-
const absoluteTarget = path.resolve(claudeSkillsDir, target);
|
|
85
|
-
await cp(absoluteTarget, linkPath, { recursive: true });
|
|
86
|
-
} else throw err;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async function hashDir(dir) {
|
|
90
|
-
const hash = createHash("sha256");
|
|
91
|
-
const files = await collectFiles(dir);
|
|
92
|
-
files.sort();
|
|
93
|
-
for (const rel of files) {
|
|
94
|
-
const abs = path.join(dir, rel);
|
|
95
|
-
const data = await readFile(abs);
|
|
96
|
-
hash.update(rel);
|
|
97
|
-
hash.update("\0");
|
|
98
|
-
hash.update(data);
|
|
99
|
-
hash.update("\0");
|
|
100
|
-
}
|
|
101
|
-
return hash.digest("hex");
|
|
102
|
-
}
|
|
103
|
-
async function collectFiles(dir, prefix = "") {
|
|
104
|
-
const out = [];
|
|
105
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
106
|
-
for (const entry of entries) {
|
|
107
|
-
const rel = prefix ? path.join(prefix, entry.name) : entry.name;
|
|
108
|
-
if (entry.isDirectory()) out.push(...await collectFiles(path.join(dir, entry.name), rel));
|
|
109
|
-
else if (entry.isFile()) out.push(rel);
|
|
110
|
-
}
|
|
111
|
-
return out;
|
|
112
|
-
}
|
|
113
|
-
function printSummary(results, dryRun) {
|
|
114
|
-
const symbols = {
|
|
115
|
-
added: chalk.green("+"),
|
|
116
|
-
updated: chalk.yellow("~"),
|
|
117
|
-
unchanged: chalk.dim("=")
|
|
118
|
-
};
|
|
119
|
-
const labels = {
|
|
120
|
-
added: chalk.green("added"),
|
|
121
|
-
updated: chalk.yellow("updated"),
|
|
122
|
-
unchanged: chalk.dim("unchanged")
|
|
123
|
-
};
|
|
124
|
-
const header = dryRun ? chalk.bold("Dry run — no files written:") : chalk.bold("Synced built-in skills:");
|
|
125
|
-
process.stdout.write(`${header}\n`);
|
|
126
|
-
for (const { name, status } of results) process.stdout.write(` ${symbols[status]} ${name} ${chalk.dim(`(${labels[status]})`)}\n`);
|
|
127
|
-
const counts = results.reduce((acc, { status }) => {
|
|
128
|
-
acc[status] += 1;
|
|
129
|
-
return acc;
|
|
130
|
-
}, {
|
|
131
|
-
added: 0,
|
|
132
|
-
updated: 0,
|
|
133
|
-
unchanged: 0
|
|
134
|
-
});
|
|
135
|
-
process.stdout.write(chalk.dim(`\n${counts.added} added, ${counts.updated} updated, ${counts.unchanged} unchanged.\n`));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
//#endregion
|
|
139
|
-
export { detectSkillsDrift, syncSkills };
|
package/dist/sync-lKEXyPOh.js
DELETED
package/dist/version-CeffgdfZ.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Languages } from 'lucide-react';
|
|
2
|
-
import { IconTooltip } from '~/components/icon-tooltip';
|
|
3
|
-
import { buttonVariants } from '~/components/ui/button';
|
|
4
|
-
import {
|
|
5
|
-
DropdownMenu,
|
|
6
|
-
DropdownMenuContent,
|
|
7
|
-
DropdownMenuItem,
|
|
8
|
-
DropdownMenuTrigger,
|
|
9
|
-
} from '~/components/ui/dropdown-menu';
|
|
10
|
-
import { TooltipTrigger } from '~/components/ui/tooltip';
|
|
11
|
-
import { LOCALE_OPTIONS, setLocale } from '~/lib/locale-store';
|
|
12
|
-
import { useLocale } from '~/lib/use-locale';
|
|
13
|
-
import { cn } from '~/lib/utils';
|
|
14
|
-
|
|
15
|
-
export function LanguageToggle() {
|
|
16
|
-
const t = useLocale();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<DropdownMenu>
|
|
20
|
-
<IconTooltip label={t.languageToggle.title}>
|
|
21
|
-
<DropdownMenuTrigger
|
|
22
|
-
render={
|
|
23
|
-
<TooltipTrigger
|
|
24
|
-
type="button"
|
|
25
|
-
aria-label={t.languageToggle.toggleAria}
|
|
26
|
-
className={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }))}
|
|
27
|
-
/>
|
|
28
|
-
}
|
|
29
|
-
>
|
|
30
|
-
<Languages className="size-3.5" />
|
|
31
|
-
</DropdownMenuTrigger>
|
|
32
|
-
</IconTooltip>
|
|
33
|
-
<DropdownMenuContent align="end" className="min-w-[140px]">
|
|
34
|
-
{LOCALE_OPTIONS.map((option) => (
|
|
35
|
-
<DropdownMenuItem
|
|
36
|
-
key={option.id}
|
|
37
|
-
onClick={() => setLocale(option.id)}
|
|
38
|
-
data-active={t.id === option.id}
|
|
39
|
-
>
|
|
40
|
-
{option.label}
|
|
41
|
-
</DropdownMenuItem>
|
|
42
|
-
))}
|
|
43
|
-
</DropdownMenuContent>
|
|
44
|
-
</DropdownMenu>
|
|
45
|
-
);
|
|
46
|
-
}
|
package/src/app/favicon.ico
DELETED
|
Binary file
|