skilluse 0.1.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/README.md +100 -0
- package/dist/app.d.ts +6 -0
- package/dist/app.js +6 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +167 -0
- package/dist/commands/demo.d.ts +14 -0
- package/dist/commands/demo.js +46 -0
- package/dist/commands/index.d.ts +8 -0
- package/dist/commands/index.js +77 -0
- package/dist/commands/list.d.ts +14 -0
- package/dist/commands/list.js +54 -0
- package/dist/commands/login.d.ts +14 -0
- package/dist/commands/login.js +153 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.js +47 -0
- package/dist/commands/repo/add.d.ts +22 -0
- package/dist/commands/repo/add.js +139 -0
- package/dist/commands/repo/edit.d.ts +19 -0
- package/dist/commands/repo/edit.js +117 -0
- package/dist/commands/repo/index.d.ts +8 -0
- package/dist/commands/repo/index.js +47 -0
- package/dist/commands/repo/list.d.ts +8 -0
- package/dist/commands/repo/list.js +47 -0
- package/dist/commands/repo/remove.d.ts +16 -0
- package/dist/commands/repo/remove.js +83 -0
- package/dist/commands/repo/sync.d.ts +10 -0
- package/dist/commands/repo/sync.js +78 -0
- package/dist/commands/repo/use.d.ts +10 -0
- package/dist/commands/repo/use.js +56 -0
- package/dist/commands/repos.d.ts +11 -0
- package/dist/commands/repos.js +50 -0
- package/dist/commands/search.d.ts +16 -0
- package/dist/commands/search.js +199 -0
- package/dist/commands/skills.d.ts +11 -0
- package/dist/commands/skills.js +43 -0
- package/dist/commands/whoami.d.ts +8 -0
- package/dist/commands/whoami.js +69 -0
- package/dist/components/CLIError.d.ts +27 -0
- package/dist/components/CLIError.js +24 -0
- package/dist/components/ProgressBar.d.ts +7 -0
- package/dist/components/ProgressBar.js +9 -0
- package/dist/components/Select.d.ts +11 -0
- package/dist/components/Select.js +6 -0
- package/dist/components/Spinner.d.ts +6 -0
- package/dist/components/Spinner.js +7 -0
- package/dist/components/StatusMessage.d.ts +9 -0
- package/dist/components/StatusMessage.js +13 -0
- package/dist/components/Table.d.ts +9 -0
- package/dist/components/Table.js +27 -0
- package/dist/components/TextInput.d.ts +9 -0
- package/dist/components/TextInput.js +6 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +43815 -0
- package/dist/services/credentials.d.ts +69 -0
- package/dist/services/credentials.js +216 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.js +10 -0
- package/dist/services/oauth.d.ts +106 -0
- package/dist/services/oauth.js +208 -0
- package/dist/services/paths.d.ts +19 -0
- package/dist/services/paths.js +21 -0
- package/dist/services/store.d.ts +64 -0
- package/dist/services/store.js +107 -0
- package/dist/services/update.d.ts +20 -0
- package/dist/services/update.js +93 -0
- package/package.json +70 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface CLIErrorProps {
|
|
2
|
+
/** Main error message */
|
|
3
|
+
message: string;
|
|
4
|
+
/** Optional context like the repository name */
|
|
5
|
+
context?: string;
|
|
6
|
+
/** Possible causes for the error */
|
|
7
|
+
causes?: string[];
|
|
8
|
+
/** Suggested command or action */
|
|
9
|
+
suggestion?: string;
|
|
10
|
+
/** Error type: 'error' for failures, 'warning' for non-fatal issues */
|
|
11
|
+
type?: "error" | "warning";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Structured CLI error message component.
|
|
15
|
+
* Shows actionable error information with possible causes and suggestions.
|
|
16
|
+
*
|
|
17
|
+
* Example output:
|
|
18
|
+
* ✗ Repository 'foo/bar' not found
|
|
19
|
+
*
|
|
20
|
+
* Possible causes:
|
|
21
|
+
* • The repository doesn't exist
|
|
22
|
+
* • You don't have access (try: skilluse login)
|
|
23
|
+
*
|
|
24
|
+
* Run 'skilluse repo list' to see available repos
|
|
25
|
+
*/
|
|
26
|
+
export declare function CLIError({ message, context, causes, suggestion, type, }: CLIErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=CLIError.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import figures from "figures";
|
|
4
|
+
/**
|
|
5
|
+
* Structured CLI error message component.
|
|
6
|
+
* Shows actionable error information with possible causes and suggestions.
|
|
7
|
+
*
|
|
8
|
+
* Example output:
|
|
9
|
+
* ✗ Repository 'foo/bar' not found
|
|
10
|
+
*
|
|
11
|
+
* Possible causes:
|
|
12
|
+
* • The repository doesn't exist
|
|
13
|
+
* • You don't have access (try: skilluse login)
|
|
14
|
+
*
|
|
15
|
+
* Run 'skilluse repo list' to see available repos
|
|
16
|
+
*/
|
|
17
|
+
export function CLIError({ message, context, causes, suggestion, type = "error", }) {
|
|
18
|
+
const icon = type === "error" ? figures.cross : figures.warning;
|
|
19
|
+
const color = type === "error" ? "red" : "yellow";
|
|
20
|
+
// Format the main message with optional context
|
|
21
|
+
const displayMessage = context ? `${message} '${context}'` : message;
|
|
22
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { color: color, children: [icon, " "] }), _jsx(Text, { children: displayMessage })] }), causes && causes.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "Possible causes:" }), causes.map((cause, i) => (_jsx(Box, { marginLeft: 0, children: _jsxs(Text, { dimColor: true, children: ["\u2022 ", cause] }) }, i)))] })), suggestion && (_jsx(Box, { marginTop: 1, marginLeft: 2, children: _jsx(Text, { dimColor: true, children: suggestion }) }))] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=CLIError.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export function ProgressBar({ percent, width = 20 }) {
|
|
4
|
+
const clampedPercent = Math.max(0, Math.min(100, percent));
|
|
5
|
+
const filled = Math.round((clampedPercent / 100) * width);
|
|
6
|
+
const empty = width - filled;
|
|
7
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "█".repeat(filled) }), _jsx(Text, { color: "gray", children: "░".repeat(empty) }), _jsxs(Text, { children: [" ", clampedPercent, "%"] })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface SelectItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
interface SelectProps {
|
|
6
|
+
items: SelectItem[];
|
|
7
|
+
onSelect: (item: SelectItem) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function Select({ items, onSelect }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import InkSpinner from "ink-spinner";
|
|
4
|
+
export function Spinner({ text }) {
|
|
5
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: "cyan", children: _jsx(InkSpinner, { type: "dots" }) }), text && _jsxs(Text, { children: [" ", text] })] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type StatusType = "success" | "error" | "warning";
|
|
3
|
+
interface StatusMessageProps {
|
|
4
|
+
type: StatusType;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function StatusMessage({ type, children }: StatusMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=StatusMessage.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import figures from "figures";
|
|
4
|
+
const statusConfig = {
|
|
5
|
+
success: { icon: figures.tick, color: "green" },
|
|
6
|
+
error: { icon: figures.cross, color: "red" },
|
|
7
|
+
warning: { icon: figures.warning, color: "yellow" },
|
|
8
|
+
};
|
|
9
|
+
export function StatusMessage({ type, children }) {
|
|
10
|
+
const { icon, color } = statusConfig[type];
|
|
11
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: color, children: [icon, " "] }), _jsx(Text, { children: children })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=StatusMessage.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Scalar = string | number | boolean | null | undefined;
|
|
2
|
+
type ScalarDict = Record<string, Scalar>;
|
|
3
|
+
interface TableProps<T extends ScalarDict> {
|
|
4
|
+
data: T[];
|
|
5
|
+
columns?: (keyof T)[];
|
|
6
|
+
}
|
|
7
|
+
export declare function Table<T extends ScalarDict>({ data, columns, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export function Table({ data, columns, }) {
|
|
4
|
+
if (data.length === 0) {
|
|
5
|
+
return _jsx(Text, { dimColor: true, children: "No data" });
|
|
6
|
+
}
|
|
7
|
+
// Get columns from data keys if not specified
|
|
8
|
+
const cols = columns || Object.keys(data[0]);
|
|
9
|
+
// Calculate column widths
|
|
10
|
+
const widths = cols.map((col) => {
|
|
11
|
+
const headerWidth = String(col).length;
|
|
12
|
+
const maxDataWidth = data.reduce((max, row) => {
|
|
13
|
+
const value = row[col];
|
|
14
|
+
const width = value == null ? 0 : String(value).length;
|
|
15
|
+
return Math.max(max, width);
|
|
16
|
+
}, 0);
|
|
17
|
+
return Math.max(headerWidth, maxDataWidth);
|
|
18
|
+
});
|
|
19
|
+
const renderCell = (value, width, isHeader = false) => {
|
|
20
|
+
const str = value == null ? "" : String(value);
|
|
21
|
+
const padded = str.padEnd(width);
|
|
22
|
+
return isHeader ? (_jsx(Text, { bold: true, children: padded })) : (_jsx(Text, { children: padded }));
|
|
23
|
+
};
|
|
24
|
+
const separator = (_jsx(Box, { children: _jsx(Text, { children: widths.map((w, i) => "─".repeat(w) + (i < widths.length - 1 ? "─┼─" : "")).join("") }) }));
|
|
25
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: cols.map((col, i) => (_jsxs(Box, { children: [renderCell(String(col), widths[i], true), i < cols.length - 1 && _jsx(Text, { children: " \u2502 " })] }, String(col)))) }), separator, data.map((row, rowIndex) => (_jsx(Box, { children: cols.map((col, i) => (_jsxs(Box, { children: [renderCell(row[col], widths[i]), i < cols.length - 1 && _jsx(Text, { children: " \u2502 " })] }, String(col)))) }, rowIndex)))] }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface TextInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
onSubmit?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextInput({ value, onChange, placeholder, onSubmit, }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import InkTextInput from "ink-text-input";
|
|
3
|
+
export function TextInput({ value, onChange, placeholder, onSubmit, }) {
|
|
4
|
+
return (_jsx(InkTextInput, { value: value, onChange: onChange, placeholder: placeholder, onSubmit: onSubmit }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Spinner } from "./Spinner.js";
|
|
2
|
+
export { Select } from "./Select.js";
|
|
3
|
+
export { Table } from "./Table.js";
|
|
4
|
+
export { ProgressBar } from "./ProgressBar.js";
|
|
5
|
+
export { StatusMessage } from "./StatusMessage.js";
|
|
6
|
+
export { TextInput } from "./TextInput.js";
|
|
7
|
+
export { CLIError, type CLIErrorProps } from "./CLIError.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Spinner } from "./Spinner.js";
|
|
2
|
+
export { Select } from "./Select.js";
|
|
3
|
+
export { Table } from "./Table.js";
|
|
4
|
+
export { ProgressBar } from "./ProgressBar.js";
|
|
5
|
+
export { StatusMessage } from "./StatusMessage.js";
|
|
6
|
+
export { TextInput } from "./TextInput.js";
|
|
7
|
+
export { CLIError } from "./CLIError.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED