kly 0.1.1 → 0.3.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.
Potentially problematic release.
This version of kly might be problematic. Click here for more details.
- package/dist/ai/storage.mjs +3 -2
- package/dist/ai/storage.mjs.map +1 -1
- package/dist/bin/bin-registry-DOBspniG.mjs +3 -0
- package/dist/bin/kly.mjs +3268 -2468
- package/dist/bin/kly.mjs.map +1 -1
- package/dist/bin/{permissions-extractor-BfUPS0Tr.mjs → permissions-extractor-ySRyhQut.mjs} +4 -2
- package/dist/bin/permissions-extractor-ySRyhQut.mjs.map +1 -0
- package/dist/bin/remote-tQeFZX9o.mjs +3 -0
- package/dist/cli.mjs +4 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/define-app.d.mts.map +1 -1
- package/dist/define-app.mjs +43 -29
- package/dist/define-app.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/mcp/schema-converter.d.mts.map +1 -1
- package/dist/mcp/schema-converter.mjs +2 -1
- package/dist/mcp/schema-converter.mjs.map +1 -1
- package/dist/mcp/server.d.mts.map +1 -1
- package/dist/mcp/server.mjs +7 -6
- package/dist/mcp/server.mjs.map +1 -1
- package/dist/permissions/index.mjs +8 -10
- package/dist/permissions/index.mjs.map +1 -1
- package/dist/sandbox/bundled-executor.d.mts.map +1 -1
- package/dist/sandbox/bundled-executor.mjs +72 -12
- package/dist/sandbox/bundled-executor.mjs.map +1 -1
- package/dist/sandbox/ipc-client.mjs +2 -0
- package/dist/sandbox/ipc-client.mjs.map +1 -1
- package/dist/sandbox/sandboxed-context.mjs.map +1 -1
- package/dist/shared/constants.mjs +5 -1
- package/dist/shared/constants.mjs.map +1 -1
- package/dist/shared/errors.mjs +21 -0
- package/dist/shared/errors.mjs.map +1 -0
- package/dist/types.d.mts +19 -6
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ui/components/confirm.d.mts.map +1 -1
- package/dist/ui/components/confirm.mjs +4 -8
- package/dist/ui/components/confirm.mjs.map +1 -1
- package/dist/ui/components/form.d.mts.map +1 -1
- package/dist/ui/components/form.mjs +12 -26
- package/dist/ui/components/form.mjs.map +1 -1
- package/dist/ui/components/input.d.mts.map +1 -1
- package/dist/ui/components/input.mjs +3 -7
- package/dist/ui/components/input.mjs.map +1 -1
- package/dist/ui/{utils/output.d.mts → components/log.d.mts} +22 -2
- package/dist/ui/components/log.d.mts.map +1 -0
- package/dist/ui/components/log.mjs +92 -0
- package/dist/ui/components/log.mjs.map +1 -0
- package/dist/ui/components/prompts.d.mts +1 -0
- package/dist/ui/components/select.d.mts.map +1 -1
- package/dist/ui/components/select.mjs +5 -8
- package/dist/ui/components/select.mjs.map +1 -1
- package/dist/ui/components/table.d.mts +1 -1
- package/dist/ui/components/table.d.mts.map +1 -1
- package/dist/ui/components/table.mjs +19 -19
- package/dist/ui/components/table.mjs.map +1 -1
- package/dist/ui/index.d.mts +3 -2
- package/dist/ui/utils/cancel.mjs +17 -0
- package/dist/ui/utils/cancel.mjs.map +1 -0
- package/dist/ui/utils/colors.d.mts +3 -3
- package/dist/ui/utils/colors.d.mts.map +1 -1
- package/dist/ui/utils/colors.mjs +21 -33
- package/dist/ui/utils/colors.mjs.map +1 -1
- package/package.json +14 -12
- package/dist/bin/permissions-extractor-BfUPS0Tr.mjs.map +0 -1
- package/dist/ui/utils/output.d.mts.map +0 -1
- package/dist/ui/utils/output.mjs +0 -42
- package/dist/ui/utils/output.mjs.map +0 -1
- /package/dist/bin/{config-builder-D5EtwOB3.mjs → config-builder-VSUaGlaV.mjs} +0 -0
- /package/dist/bin/{launcher-Ex3ynZdE.mjs → launcher-DD6vpEFb.mjs} +0 -0
- /package/dist/bin/{permissions-C_WgoA3t.mjs → permissions-D7-M2lRi.mjs} +0 -0
package/dist/ui/utils/colors.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as colors from "xycolors";
|
|
2
2
|
|
|
3
3
|
//#region src/ui/utils/colors.ts
|
|
4
4
|
/**
|
|
@@ -22,43 +22,31 @@ const theme = {
|
|
|
22
22
|
disabled: "#6e7681"
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Color mapping for formatText function
|
|
26
|
+
*/
|
|
27
|
+
const colorMap = {
|
|
28
|
+
red: colors.red,
|
|
29
|
+
green: colors.green,
|
|
30
|
+
yellow: colors.yellow,
|
|
31
|
+
blue: colors.blue,
|
|
32
|
+
magenta: colors.magenta,
|
|
33
|
+
cyan: colors.cyan,
|
|
34
|
+
white: colors.white,
|
|
35
|
+
gray: colors.gray
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Format text with xycolors
|
|
26
39
|
*/
|
|
27
40
|
function formatText(text, options) {
|
|
28
41
|
let result = text;
|
|
29
|
-
if (options?.color)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
result = pc$1.green(result);
|
|
35
|
-
break;
|
|
36
|
-
case "yellow":
|
|
37
|
-
result = pc$1.yellow(result);
|
|
38
|
-
break;
|
|
39
|
-
case "blue":
|
|
40
|
-
result = pc$1.blue(result);
|
|
41
|
-
break;
|
|
42
|
-
case "magenta":
|
|
43
|
-
result = pc$1.magenta(result);
|
|
44
|
-
break;
|
|
45
|
-
case "cyan":
|
|
46
|
-
result = pc$1.cyan(result);
|
|
47
|
-
break;
|
|
48
|
-
case "white":
|
|
49
|
-
result = pc$1.white(result);
|
|
50
|
-
break;
|
|
51
|
-
case "gray":
|
|
52
|
-
result = pc$1.gray(result);
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
if (options?.bold) result = pc$1.bold(result);
|
|
56
|
-
if (options?.dim) result = pc$1.dim(result);
|
|
57
|
-
if (options?.italic) result = pc$1.italic(result);
|
|
58
|
-
if (options?.underline) result = pc$1.underline(result);
|
|
42
|
+
if (options?.color) result = colorMap[options.color](result);
|
|
43
|
+
if (options?.bold) result = colors.bold(result);
|
|
44
|
+
if (options?.dim) result = colors.dim(result);
|
|
45
|
+
if (options?.italic) result = colors.italic(result);
|
|
46
|
+
if (options?.underline) result = colors.underline(result);
|
|
59
47
|
return result;
|
|
60
48
|
}
|
|
61
49
|
|
|
62
50
|
//#endregion
|
|
63
|
-
export {
|
|
51
|
+
export { colors, formatText, theme };
|
|
64
52
|
//# sourceMappingURL=colors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.mjs","names":["
|
|
1
|
+
{"version":3,"file":"colors.mjs","names":["colorMap: Record<AnsiColor, (text: string) => string>"],"sources":["../../../src/ui/utils/colors.ts"],"sourcesContent":["import * as colors from \"xycolors\";\n\n/**\n * Default color theme for UI components (hex values for reference)\n */\nexport const theme = {\n // Brand colors\n primary: \"#3b82f6\", // Blue\n success: \"#10b981\", // Green\n warning: \"#f59e0b\", // Orange\n error: \"#ef4444\", // Red\n info: \"#06b6d4\", // Cyan\n\n // UI colors\n background: \"#161b22\", // Dark gray\n surface: \"#1e293b\", // Lighter gray\n border: \"#30363d\", // Border gray\n text: \"#c9d1d9\", // Light text\n textDim: \"#8b949e\", // Dimmed text\n textBright: \"#ffffff\", // Bright text\n\n // Interactive states\n focused: \"#3b82f6\", // Blue\n selected: \"#3b82f6\", // Blue\n hover: \"#334155\", // Lighter gray\n disabled: \"#6e7681\", // Muted gray\n} as const;\n\nexport type AnsiColor =\n | \"red\"\n | \"green\"\n | \"yellow\"\n | \"blue\"\n | \"magenta\"\n | \"cyan\"\n | \"white\"\n | \"gray\";\n\n/**\n * Color mapping for formatText function\n */\nconst colorMap: Record<AnsiColor, (text: string) => string> = {\n red: colors.red,\n green: colors.green,\n yellow: colors.yellow,\n blue: colors.blue,\n magenta: colors.magenta,\n cyan: colors.cyan,\n white: colors.white,\n gray: colors.gray,\n};\n\n/**\n * Format text with xycolors\n */\nexport function formatText(\n text: string,\n options?: {\n color?: AnsiColor;\n bold?: boolean;\n dim?: boolean;\n italic?: boolean;\n underline?: boolean;\n },\n): string {\n let result = text;\n\n // Apply color first\n if (options?.color) {\n result = colorMap[options.color](result);\n }\n\n // Apply styles\n if (options?.bold) result = colors.bold(result);\n if (options?.dim) result = colors.dim(result);\n if (options?.italic) result = colors.italic(result);\n if (options?.underline) result = colors.underline(result);\n\n return result;\n}\n\nexport { colors };\n"],"mappings":";;;;;;AAKA,MAAa,QAAQ;CAEnB,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CAGN,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,MAAM;CACN,SAAS;CACT,YAAY;CAGZ,SAAS;CACT,UAAU;CACV,OAAO;CACP,UAAU;CACX;;;;AAeD,MAAMA,WAAwD;CAC5D,KAAK,OAAO;CACZ,OAAO,OAAO;CACd,QAAQ,OAAO;CACf,MAAM,OAAO;CACb,SAAS,OAAO;CAChB,MAAM,OAAO;CACb,OAAO,OAAO;CACd,MAAM,OAAO;CACd;;;;AAKD,SAAgB,WACd,MACA,SAOQ;CACR,IAAI,SAAS;AAGb,KAAI,SAAS,MACX,UAAS,SAAS,QAAQ,OAAO,OAAO;AAI1C,KAAI,SAAS,KAAM,UAAS,OAAO,KAAK,OAAO;AAC/C,KAAI,SAAS,IAAK,UAAS,OAAO,IAAI,OAAO;AAC7C,KAAI,SAAS,OAAQ,UAAS,OAAO,OAAO,OAAO;AACnD,KAAI,SAAS,UAAW,UAAS,OAAO,UAAU,OAAO;AAEzD,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -41,35 +41,37 @@
|
|
|
41
41
|
"lint": "biome check --write --unsafe ./src && nr typecheck",
|
|
42
42
|
"prepublishOnly": "nr build",
|
|
43
43
|
"release": "release-it",
|
|
44
|
-
"start": "bun run
|
|
44
|
+
"start": "bun run bin/kly.ts",
|
|
45
45
|
"test": "bun test",
|
|
46
46
|
"up": "taze major -I",
|
|
47
47
|
"prepare": "simple-git-hooks"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ai-sdk/anthropic": "^3.0.
|
|
51
|
-
"@ai-sdk/deepseek": "^2.0.
|
|
52
|
-
"@ai-sdk/google": "^3.0.
|
|
53
|
-
"@ai-sdk/mistral": "^3.0.
|
|
54
|
-
"@ai-sdk/openai": "^3.0.
|
|
50
|
+
"@ai-sdk/anthropic": "^3.0.2",
|
|
51
|
+
"@ai-sdk/deepseek": "^2.0.2",
|
|
52
|
+
"@ai-sdk/google": "^3.0.2",
|
|
53
|
+
"@ai-sdk/mistral": "^3.0.2",
|
|
54
|
+
"@ai-sdk/openai": "^3.0.2",
|
|
55
55
|
"@anthropic-ai/sandbox-runtime": "^0.0.23",
|
|
56
56
|
"@clack/prompts": "1.0.0-alpha.9",
|
|
57
57
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
58
|
-
"ai": "^6.0.
|
|
59
|
-
"
|
|
60
|
-
"
|
|
58
|
+
"ai": "^6.0.6",
|
|
59
|
+
"js-yaml": "^4.1.1",
|
|
60
|
+
"xycolors": "^0.1.2",
|
|
61
|
+
"zod": "^4.3.4"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@antfu/ni": "^28.0.0",
|
|
64
65
|
"@biomejs/biome": "^2.3.10",
|
|
65
66
|
"@release-it/conventional-changelog": "^10.0.4",
|
|
66
67
|
"@types/bun": "^1.3.5",
|
|
68
|
+
"@types/js-yaml": "^4.0.9",
|
|
67
69
|
"lint-staged": "^16.2.7",
|
|
68
70
|
"publint": "^0.3.16",
|
|
69
|
-
"release-it": "^19.2.
|
|
71
|
+
"release-it": "^19.2.2",
|
|
70
72
|
"simple-git-hooks": "^2.13.1",
|
|
71
73
|
"taze": "^19.9.2",
|
|
72
|
-
"tsdown": "^0.18.
|
|
74
|
+
"tsdown": "^0.18.4",
|
|
73
75
|
"typescript": "^5.9.3"
|
|
74
76
|
},
|
|
75
77
|
"simple-git-hooks": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions-extractor-BfUPS0Tr.mjs","names":[],"sources":["../../src/remote/permissions-extractor.ts"],"sourcesContent":["import type { AppPermissions } from \"../types\";\n\n/**\n * Extract declared permissions from a remote app\n *\n * This function safely loads the app definition to read its declared permissions\n * WITHOUT executing the actual tool logic.\n *\n * @param entryPath - Absolute path to the app entry point\n * @returns Declared permissions or undefined if not specified\n */\nexport async function extractAppPermissions(\n entryPath: string,\n): Promise<AppPermissions | undefined> {\n try {\n // Temporarily mark as programmatic mode to avoid triggering CLI logic\n const prevProgrammatic = process.env.KLY_PROGRAMMATIC;\n process.env.KLY_PROGRAMMATIC = \"true\";\n\n // Dynamic import to load the app module\n const appModule = await import(entryPath);\n\n // Restore environment\n if (prevProgrammatic === undefined) {\n delete process.env.KLY_PROGRAMMATIC;\n } else {\n process.env.KLY_PROGRAMMATIC = prevProgrammatic;\n }\n\n // The app module should export a KlyApp instance\n // which has a definition.permissions field\n if (appModule.default?.definition) {\n return appModule.default.definition.permissions;\n }\n\n // Some apps might export the app directly\n if (appModule.definition) {\n return appModule.definition.permissions;\n }\n\n return undefined;\n } catch (error) {\n // If we can't extract permissions, return undefined\n // The calling code will fall back to asking for all permissions\n console.warn(\n `⚠️ Could not extract permissions from app (${error instanceof Error ? error.message : \"unknown error\"})`,\n );\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;AAWA,eAAsB,sBACpB,WACqC;AACrC,KAAI;EAEF,MAAM,mBAAmB,QAAQ,IAAI;AACrC,UAAQ,IAAI,mBAAmB;EAG/B,MAAM,YAAY,MAAM,OAAO;AAG/B,MAAI,qBAAqB,OACvB,QAAO,QAAQ,IAAI;MAEnB,SAAQ,IAAI,mBAAmB;AAKjC,MAAI,UAAU,SAAS,WACrB,QAAO,UAAU,QAAQ,WAAW;AAItC,MAAI,UAAU,WACZ,QAAO,UAAU,WAAW;AAG9B;UACO,OAAO;AAGd,UAAQ,KACN,+CAA+C,iBAAiB,QAAQ,MAAM,UAAU,gBAAgB,GACzG;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.mts","names":[],"sources":["../../../src/ui/utils/output.ts"],"sourcesContent":[],"mappings":";;AAOA;AAkBA;AAmBA;;iBArCgB,MAAA;;;;;;;iBAkBA,KAAA;;;;;;iBAmBA,IAAA"}
|
package/dist/ui/utils/output.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { formatText } from "./colors.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/ui/utils/output.ts
|
|
4
|
-
/**
|
|
5
|
-
* Output a result to the console
|
|
6
|
-
*
|
|
7
|
-
* @param result - The result to display (string, object, etc.)
|
|
8
|
-
*/
|
|
9
|
-
function output(result) {
|
|
10
|
-
if (result === void 0 || result === null) return;
|
|
11
|
-
if (typeof result === "string") console.log(result);
|
|
12
|
-
else console.log(JSON.stringify(result, null, 2));
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Display an error message with optional suggestions
|
|
16
|
-
*
|
|
17
|
-
* @param message - Error message
|
|
18
|
-
* @param suggestions - Optional suggestions for fixing the error
|
|
19
|
-
*/
|
|
20
|
-
function error(message, suggestions) {
|
|
21
|
-
console.error(`${formatText("Error:", {
|
|
22
|
-
color: "red",
|
|
23
|
-
bold: true
|
|
24
|
-
})} ${message}`);
|
|
25
|
-
if (suggestions?.length) {
|
|
26
|
-
console.error("");
|
|
27
|
-
console.error(formatText("Suggestions:", { dim: true }));
|
|
28
|
-
for (const suggestion of suggestions) console.error(` ${formatText("•", { dim: true })} ${suggestion}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Display help text
|
|
33
|
-
*
|
|
34
|
-
* @param content - Help text content
|
|
35
|
-
*/
|
|
36
|
-
function help(content) {
|
|
37
|
-
console.log(content);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { error, help, output };
|
|
42
|
-
//# sourceMappingURL=output.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.mjs","names":[],"sources":["../../../src/ui/utils/output.ts"],"sourcesContent":["import { formatText } from \"./colors\";\n\n/**\n * Output a result to the console\n *\n * @param result - The result to display (string, object, etc.)\n */\nexport function output(result: unknown): void {\n if (result === undefined || result === null) {\n return;\n }\n\n if (typeof result === \"string\") {\n console.log(result);\n } else {\n console.log(JSON.stringify(result, null, 2));\n }\n}\n\n/**\n * Display an error message with optional suggestions\n *\n * @param message - Error message\n * @param suggestions - Optional suggestions for fixing the error\n */\nexport function error(message: string, suggestions?: string[]): void {\n console.error(\n `${formatText(\"Error:\", { color: \"red\", bold: true })} ${message}`,\n );\n\n if (suggestions?.length) {\n console.error(\"\");\n console.error(formatText(\"Suggestions:\", { dim: true }));\n for (const suggestion of suggestions) {\n console.error(` ${formatText(\"•\", { dim: true })} ${suggestion}`);\n }\n }\n}\n\n/**\n * Display help text\n *\n * @param content - Help text content\n */\nexport function help(content: string): void {\n console.log(content);\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,OAAO,QAAuB;AAC5C,KAAI,WAAW,UAAa,WAAW,KACrC;AAGF,KAAI,OAAO,WAAW,SACpB,SAAQ,IAAI,OAAO;KAEnB,SAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC;;;;;;;;AAUhD,SAAgB,MAAM,SAAiB,aAA8B;AACnE,SAAQ,MACN,GAAG,WAAW,UAAU;EAAE,OAAO;EAAO,MAAM;EAAM,CAAC,CAAC,GAAG,UAC1D;AAED,KAAI,aAAa,QAAQ;AACvB,UAAQ,MAAM,GAAG;AACjB,UAAQ,MAAM,WAAW,gBAAgB,EAAE,KAAK,MAAM,CAAC,CAAC;AACxD,OAAK,MAAM,cAAc,YACvB,SAAQ,MAAM,KAAK,WAAW,KAAK,EAAE,KAAK,MAAM,CAAC,CAAC,GAAG,aAAa;;;;;;;;AAUxE,SAAgB,KAAK,SAAuB;AAC1C,SAAQ,IAAI,QAAQ"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|