@kya-os/cli 0.1.0-beta.13 ā 0.1.0-beta.15
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/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +11 -96
- package/dist/commands/init.js.map +1 -1
- package/dist/components/agent-card.d.ts +14 -0
- package/dist/components/agent-card.d.ts.map +1 -0
- package/dist/components/agent-card.js +170 -0
- package/dist/components/agent-card.js.map +1 -0
- package/dist/components/box.d.ts +14 -0
- package/dist/components/box.d.ts.map +1 -0
- package/dist/components/box.js +222 -0
- package/dist/components/box.js.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/messages.d.ts +62 -0
- package/dist/components/messages.d.ts.map +1 -0
- package/dist/components/messages.js +146 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/components/types.d.ts +51 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/components/types.js +5 -0
- package/dist/components/types.js.map +1 -0
- package/dist/effects/cli-integration.js +3 -3
- package/dist/effects/cli-integration.js.map +1 -1
- package/dist/effects/index.d.ts +9 -12
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +69 -34
- package/dist/effects/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -19
- package/package.json +4 -5
- package/dist/commands/cli-experience-demo-simple.d.ts +0 -14
- package/dist/commands/cli-experience-demo-simple.d.ts.map +0 -1
- package/dist/commands/cli-experience-demo-simple.js +0 -119
- package/dist/commands/cli-experience-demo-simple.js.map +0 -1
- package/dist/commands/cli-experience-demo.d.ts +0 -14
- package/dist/commands/cli-experience-demo.d.ts.map +0 -1
- package/dist/commands/cli-experience-demo.js +0 -172
- package/dist/commands/cli-experience-demo.js.map +0 -1
- package/dist/commands/effects-demo.d.ts +0 -10
- package/dist/commands/effects-demo.d.ts.map +0 -1
- package/dist/commands/effects-demo.js +0 -292
- package/dist/commands/effects-demo.js.map +0 -1
- package/dist/dev.d.ts +0 -7
- package/dist/dev.d.ts.map +0 -1
- package/dist/dev.js +0 -9
- package/dist/dev.js.map +0 -1
- package/dist/effects/__tests__/effects.test.d.ts +0 -5
- package/dist/effects/__tests__/effects.test.d.ts.map +0 -1
- package/dist/effects/__tests__/effects.test.js +0 -206
- package/dist/effects/__tests__/effects.test.js.map +0 -1
- package/dist/effects/implementations/binary-path.d.ts +0 -88
- package/dist/effects/implementations/binary-path.d.ts.map +0 -1
- package/dist/effects/implementations/binary-path.js +0 -296
- package/dist/effects/implementations/binary-path.js.map +0 -1
- package/dist/effects/implementations/test.d.ts +0 -113
- package/dist/effects/implementations/test.d.ts.map +0 -1
- package/dist/effects/implementations/test.js +0 -552
- package/dist/effects/implementations/test.js.map +0 -1
- package/dist/effects/template/effect-template.d.ts +0 -97
- package/dist/effects/template/effect-template.d.ts.map +0 -1
- package/dist/effects/template/effect-template.js +0 -208
- package/dist/effects/template/effect-template.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/effects/index.d.ts
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Effect Registry and Exports
|
|
3
|
+
* Uses lazy loading to reduce initial bundle size
|
|
3
4
|
*/
|
|
4
5
|
import { Effect, EffectRegistryEntry } from "./types.js";
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Get an effect by name (async with lazy loading)
|
|
7
8
|
*/
|
|
8
|
-
export declare
|
|
9
|
+
export declare function getEffect(name: string): Promise<Effect | null>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Get an effect synchronously if already cached
|
|
12
|
+
* For backward compatibility with sync code
|
|
11
13
|
*/
|
|
12
|
-
export declare function
|
|
14
|
+
export declare function getEffectSync(name: string): Effect | null;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Preload specific effects for performance
|
|
15
17
|
*/
|
|
16
|
-
export declare function
|
|
18
|
+
export declare function preloadEffects(...names: string[]): Promise<void>;
|
|
17
19
|
/**
|
|
18
|
-
* Get all available effects
|
|
20
|
+
* Get all available effects (returns basic info without loading)
|
|
19
21
|
*/
|
|
20
22
|
export declare function getAllEffects(): EffectRegistryEntry[];
|
|
21
|
-
export { BurnEffect } from "./implementations/burn.js";
|
|
22
|
-
export { BeamsEffect } from "./implementations/beams.js";
|
|
23
|
-
export { DecryptEffect } from "./implementations/decrypt.js";
|
|
24
|
-
export { BlackholeEffect } from "./implementations/blackhole.js";
|
|
25
|
-
export { WavesEffect } from "./implementations/waves.js";
|
|
26
23
|
export * from "./types.js";
|
|
27
24
|
export * from "./utils.js";
|
|
28
25
|
export * from "./config.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA4BzD;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmBpE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,mBAAmB,EAAE,CAarD;AAwCD,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG/E,OAAO,EACL,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,cAAc,EACd,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGlE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/effects/index.js
CHANGED
|
@@ -1,68 +1,103 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Effect Registry and Exports
|
|
3
|
+
* Uses lazy loading to reduce initial bundle size
|
|
3
4
|
*/
|
|
4
|
-
import { BurnEffect } from "./implementations/burn.js";
|
|
5
|
-
import { BeamsEffect } from "./implementations/beams.js";
|
|
6
|
-
import { DecryptEffect } from "./implementations/decrypt.js";
|
|
7
|
-
import { BlackholeEffect } from "./implementations/blackhole.js";
|
|
8
|
-
import { WavesEffect } from "./implementations/waves.js";
|
|
9
5
|
/**
|
|
10
|
-
* Registry of all available effects
|
|
6
|
+
* Registry of all available effects (lazy loaded)
|
|
11
7
|
*/
|
|
12
|
-
|
|
8
|
+
const lazyEffectRegistry = new Map();
|
|
13
9
|
/**
|
|
14
|
-
*
|
|
10
|
+
* Cache for loaded effect classes
|
|
15
11
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const effectClassCache = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Register a lazy-loaded effect
|
|
15
|
+
*/
|
|
16
|
+
function registerLazyEffect(entry) {
|
|
17
|
+
lazyEffectRegistry.set(entry.name.toLowerCase(), entry);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get an effect by name (async with lazy loading)
|
|
21
|
+
*/
|
|
22
|
+
export async function getEffect(name) {
|
|
23
|
+
const entry = lazyEffectRegistry.get(name.toLowerCase());
|
|
24
|
+
if (!entry)
|
|
25
|
+
return null;
|
|
26
|
+
try {
|
|
27
|
+
// Check cache first
|
|
28
|
+
let EffectClass = effectClassCache.get(name.toLowerCase());
|
|
29
|
+
if (!EffectClass) {
|
|
30
|
+
// Load the effect class
|
|
31
|
+
EffectClass = await entry.loader();
|
|
32
|
+
effectClassCache.set(name.toLowerCase(), EffectClass);
|
|
33
|
+
}
|
|
34
|
+
return new EffectClass();
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error(`Failed to load effect '${name}':`, error);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get an effect synchronously if already cached
|
|
43
|
+
* For backward compatibility with sync code
|
|
44
|
+
*/
|
|
45
|
+
export function getEffectSync(name) {
|
|
46
|
+
const EffectClass = effectClassCache.get(name.toLowerCase());
|
|
47
|
+
return EffectClass ? new EffectClass() : null;
|
|
18
48
|
}
|
|
19
49
|
/**
|
|
20
|
-
*
|
|
50
|
+
* Preload specific effects for performance
|
|
21
51
|
*/
|
|
22
|
-
export function
|
|
23
|
-
|
|
24
|
-
return entry ? entry.factory() : null;
|
|
52
|
+
export async function preloadEffects(...names) {
|
|
53
|
+
await Promise.all(names.map(name => getEffect(name)));
|
|
25
54
|
}
|
|
26
55
|
/**
|
|
27
|
-
* Get all available effects
|
|
56
|
+
* Get all available effects (returns basic info without loading)
|
|
28
57
|
*/
|
|
29
58
|
export function getAllEffects() {
|
|
30
|
-
return Array.from(
|
|
59
|
+
return Array.from(lazyEffectRegistry.values()).map(entry => ({
|
|
60
|
+
name: entry.name,
|
|
61
|
+
description: entry.description,
|
|
62
|
+
factory: () => {
|
|
63
|
+
// This is a sync factory that throws if effect not loaded
|
|
64
|
+
const EffectClass = effectClassCache.get(entry.name.toLowerCase());
|
|
65
|
+
if (!EffectClass) {
|
|
66
|
+
throw new Error(`Effect '${entry.name}' not loaded. Use getEffect() instead.`);
|
|
67
|
+
}
|
|
68
|
+
return new EffectClass();
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
31
71
|
}
|
|
32
|
-
// Register built-in effects
|
|
33
|
-
|
|
72
|
+
// Register built-in effects with lazy loading
|
|
73
|
+
registerLazyEffect({
|
|
34
74
|
name: "burn",
|
|
35
75
|
description: "Characters are ignited and burn up the screen",
|
|
36
|
-
|
|
76
|
+
loader: async () => (await import("./implementations/burn.js")).BurnEffect,
|
|
37
77
|
});
|
|
38
|
-
|
|
78
|
+
registerLazyEffect({
|
|
39
79
|
name: "beams",
|
|
40
80
|
description: "Creates beams which travel over the canvas illuminating the characters",
|
|
41
|
-
|
|
81
|
+
loader: async () => (await import("./implementations/beams.js")).BeamsEffect,
|
|
42
82
|
});
|
|
43
83
|
// Binary Path effect removed - was causing issues and blocking demo
|
|
44
|
-
|
|
84
|
+
registerLazyEffect({
|
|
45
85
|
name: "decrypt",
|
|
46
86
|
description: "Movie-style text decryption effect with typing animation",
|
|
47
|
-
|
|
87
|
+
loader: async () => (await import("./implementations/decrypt.js")).DecryptEffect,
|
|
48
88
|
});
|
|
49
|
-
|
|
89
|
+
registerLazyEffect({
|
|
50
90
|
name: "blackhole",
|
|
51
91
|
description: "Characters are consumed by a black hole and explode outwards",
|
|
52
|
-
|
|
92
|
+
loader: async () => (await import("./implementations/blackhole.js")).BlackholeEffect,
|
|
53
93
|
});
|
|
54
|
-
|
|
94
|
+
registerLazyEffect({
|
|
55
95
|
name: "waves",
|
|
56
96
|
description: "Creates wave patterns that travel across the text",
|
|
57
|
-
|
|
97
|
+
loader: async () => (await import("./implementations/waves.js")).WavesEffect,
|
|
58
98
|
});
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
export { BeamsEffect } from "./implementations/beams.js";
|
|
62
|
-
// BinaryPathEffect removed - was causing issues
|
|
63
|
-
export { DecryptEffect } from "./implementations/decrypt.js";
|
|
64
|
-
export { BlackholeEffect } from "./implementations/blackhole.js";
|
|
65
|
-
export { WavesEffect } from "./implementations/waves.js";
|
|
99
|
+
// Individual effect classes are now lazy-loaded
|
|
100
|
+
// Use getEffect() to access them
|
|
66
101
|
// Export types
|
|
67
102
|
export * from "./types.js";
|
|
68
103
|
export * from "./utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,kBAAkB,GAAyC,IAAI,GAAG,EAAE,CAAC;AAE3E;;GAEG;AACH,MAAM,gBAAgB,GAAkC,IAAI,GAAG,EAAE,CAAC;AAElE;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,CAAC;QACH,oBAAoB;QACpB,IAAI,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,wBAAwB;YACxB,WAAW,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC;YACnC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,WAAW,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,IAAI,WAAW,EAA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AiE;AACjE,OAAO,EACL,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAQ/B,6DAA6D;AAC7D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,9 +6,6 @@ import { check } from "./commands/check.js";
|
|
|
6
6
|
import { env } from "./commands/env.js";
|
|
7
7
|
import { rotate } from "./commands/rotate.js";
|
|
8
8
|
import { claim } from "./commands/claim.js";
|
|
9
|
-
import { createEffectsDemoCommand } from "./commands/effects-demo.js";
|
|
10
|
-
import { createCLIExperienceDemoCommand } from "./commands/cli-experience-demo.js";
|
|
11
|
-
import { createSimpleCLIDemoCommand } from "./commands/cli-experience-demo-simple.js";
|
|
12
9
|
export const program = new Command();
|
|
13
10
|
// ASCII art logo
|
|
14
11
|
const logo = chalk.cyan(`
|
|
@@ -24,18 +21,17 @@ program
|
|
|
24
21
|
// Init command
|
|
25
22
|
program
|
|
26
23
|
.command("init")
|
|
27
|
-
.description("Initialize MCP-I
|
|
24
|
+
.description("Initialize MCP-I for your AI agent")
|
|
28
25
|
.option("-n, --name <name>", "Agent name")
|
|
29
26
|
.option("-d, --description <description>", "Agent description")
|
|
30
|
-
.option("-r, --repository <
|
|
31
|
-
.option("-
|
|
32
|
-
.option("--
|
|
33
|
-
.option("--force", "Overwrite existing configuration")
|
|
27
|
+
.option("-r, --repository <repository>", "Repository URL")
|
|
28
|
+
.option("--skip-registration", "Skip agent registration with knowthat.ai")
|
|
29
|
+
.option("--force", "Force overwrite existing configuration")
|
|
34
30
|
.action(init);
|
|
35
31
|
// Check command
|
|
36
32
|
program
|
|
37
33
|
.command("check")
|
|
38
|
-
.description("Check MCP-I
|
|
34
|
+
.description("Check if MCP-I is configured for this project")
|
|
39
35
|
.option("-v, --verbose", "Show detailed information")
|
|
40
36
|
.action(check);
|
|
41
37
|
// Env command with subcommands
|
|
@@ -57,22 +53,19 @@ envCommand
|
|
|
57
53
|
// Rotate command
|
|
58
54
|
program
|
|
59
55
|
.command("rotate")
|
|
60
|
-
.description("Rotate identity keys")
|
|
56
|
+
.description("Rotate your agent's identity keys")
|
|
61
57
|
.option("-f, --force", "Force rotation without confirmation")
|
|
62
58
|
.option("-r, --reason <reason>", "Reason for rotation")
|
|
63
59
|
.action(rotate);
|
|
64
60
|
// Claim command
|
|
65
|
-
program
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// Simple CLI demo command
|
|
71
|
-
program.addCommand(createSimpleCLIDemoCommand());
|
|
72
|
-
// Parse arguments
|
|
61
|
+
program
|
|
62
|
+
.command("claim")
|
|
63
|
+
.description("Get your agent's claim URL for the registry")
|
|
64
|
+
.action(claim);
|
|
65
|
+
// Parse command line arguments
|
|
73
66
|
program.parse();
|
|
74
67
|
// Show help if no command specified
|
|
75
68
|
if (!process.argv.slice(2).length) {
|
|
76
69
|
program.outputHelp();
|
|
77
70
|
}
|
|
78
|
-
//# sourceMappingURL=index.js.map
|
|
71
|
+
//# sourceMappingURL=index.prod.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/cli",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.15",
|
|
4
4
|
"description": "CLI for KYA-OS MCP-I setup and management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -26,12 +26,11 @@
|
|
|
26
26
|
"templates"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "tsc && node scripts/fix-esm-imports.js",
|
|
29
|
+
"build": "tsc -p tsconfig.build.json && mv dist/index.prod.js dist/index.js && mv dist/index.prod.d.ts dist/index.d.ts && rm -f dist/index.prod.* && node scripts/fix-esm-imports.js",
|
|
30
30
|
"dev": "tsx src/index.ts",
|
|
31
31
|
"dev:effects": "tsx src/index.ts effects-demo",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"prepare": "npm run build"
|
|
32
|
+
"clean": "rm -rf dist",
|
|
33
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@kya-os/mcp-i": "^0.1.0-alpha.3.2",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simplified CLI Experience Demo
|
|
3
|
-
* A more stable version of the full demo with better timing
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
/**
|
|
7
|
-
* Run simplified demo
|
|
8
|
-
*/
|
|
9
|
-
export declare function runSimpleCLIDemo(): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Create the simplified CLI demo command
|
|
12
|
-
*/
|
|
13
|
-
export declare function createSimpleCLIDemoCommand(): Command;
|
|
14
|
-
//# sourceMappingURL=cli-experience-demo-simple.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-experience-demo-simple.d.ts","sourceRoot":"","sources":["../../src/commands/cli-experience-demo-simple.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAwHtD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAQpD"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simplified CLI Experience Demo
|
|
3
|
-
* A more stable version of the full demo with better timing
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
import { cliEffects } from "../effects/index.js";
|
|
8
|
-
/**
|
|
9
|
-
* Simulated delay for realistic timing
|
|
10
|
-
*/
|
|
11
|
-
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
|
-
/**
|
|
13
|
-
* Run simplified demo
|
|
14
|
-
*/
|
|
15
|
-
export async function runSimpleCLIDemo() {
|
|
16
|
-
try {
|
|
17
|
-
// Clear screen
|
|
18
|
-
console.clear();
|
|
19
|
-
console.log(chalk.bold.cyan("\nš KYA-OS CLI Demo\n"));
|
|
20
|
-
await delay(1000);
|
|
21
|
-
// Show command
|
|
22
|
-
console.log(chalk.gray("$ ") + chalk.white("npx @kya-os/cli init"));
|
|
23
|
-
await delay(1500);
|
|
24
|
-
// Simple loading message
|
|
25
|
-
console.log(chalk.gray("\nš Initializing KYA-OS CLI..."));
|
|
26
|
-
await delay(1000);
|
|
27
|
-
// Welcome with simple effect
|
|
28
|
-
console.log(chalk.bold.magenta("\nšÆ Welcome to KYA-OS"));
|
|
29
|
-
console.log(chalk.white("Know Your Agent - Secure AI Identity Infrastructure\n"));
|
|
30
|
-
await delay(1500);
|
|
31
|
-
// Project detection
|
|
32
|
-
console.log(chalk.cyan("š Analyzing project structure...\n"));
|
|
33
|
-
await delay(1000);
|
|
34
|
-
console.log(chalk.green("ā") + " Detected: Next.js project");
|
|
35
|
-
console.log(chalk.green("ā") + " Found: package.json");
|
|
36
|
-
console.log(chalk.green("ā") + " No existing KYA-OS configuration");
|
|
37
|
-
await delay(1500);
|
|
38
|
-
// Configuration prompts
|
|
39
|
-
console.log(chalk.bold("\nš§ Configuration\n"));
|
|
40
|
-
console.log(chalk.cyan("? ") + chalk.white("What's your agent name? ") + chalk.green("AutomationBot-X1"));
|
|
41
|
-
await delay(800);
|
|
42
|
-
console.log(chalk.cyan("? ") + chalk.white("Description? ") + chalk.green("AI assistant for code review"));
|
|
43
|
-
await delay(800);
|
|
44
|
-
console.log(chalk.cyan("? ") + chalk.white("Repository URL? ") + chalk.green("https://github.com/acme/bot"));
|
|
45
|
-
await delay(800);
|
|
46
|
-
// Registration spinner simulation
|
|
47
|
-
console.log(chalk.gray("\nā” Registering with knowthat.ai..."));
|
|
48
|
-
await delay(1500);
|
|
49
|
-
console.log(chalk.green("ā Agent registered successfully!"));
|
|
50
|
-
await delay(500);
|
|
51
|
-
// Clear some space for the effect
|
|
52
|
-
console.log("\n");
|
|
53
|
-
// Show DID generation with Blackhole effect (persistent mode)
|
|
54
|
-
await cliEffects.showCustomEffect("blackhole", `š ${chalk.bold('Generating Decentralized Identity')}\n` +
|
|
55
|
-
`\n` +
|
|
56
|
-
`DID: ${chalk.green('did:web:knowthat.ai:agents:automation-bot-x1')}`, {
|
|
57
|
-
config: {
|
|
58
|
-
duration: 4000,
|
|
59
|
-
blackholeColor: 'ffffff',
|
|
60
|
-
starColors: ['ffcc0d', 'ff7326', 'ff194d', 'bf2669', '702a8c', '049dbf'],
|
|
61
|
-
finalColor: '00ff00',
|
|
62
|
-
useGradient: true,
|
|
63
|
-
gradientDirection: 'diagonal',
|
|
64
|
-
blackholeSize: 0.3
|
|
65
|
-
},
|
|
66
|
-
skipExitPrompt: true,
|
|
67
|
-
persistent: true, // Keep the DID visible after animation
|
|
68
|
-
});
|
|
69
|
-
await delay(500);
|
|
70
|
-
// Show agent profile with Decrypt effect
|
|
71
|
-
await cliEffects.showCustomEffect("decrypt", `š ${chalk.bold('Agent Profile:')}\n` +
|
|
72
|
-
` ${chalk.cyan('https://knowthat.ai/agents/automation-bot-x1')}`, {
|
|
73
|
-
config: {
|
|
74
|
-
duration: 1500,
|
|
75
|
-
ciphertextColors: ['008000', '00cb00', '00ff00'],
|
|
76
|
-
finalColor: 'eda000',
|
|
77
|
-
typingSpeed: 3
|
|
78
|
-
},
|
|
79
|
-
skipExitPrompt: true,
|
|
80
|
-
});
|
|
81
|
-
await delay(500);
|
|
82
|
-
// Files created
|
|
83
|
-
console.log(chalk.bold("š Created files:"));
|
|
84
|
-
console.log(chalk.gray(" - .env.local ") + chalk.green("(for local development)"));
|
|
85
|
-
console.log(chalk.gray(" - .env.local.example ") + chalk.green("(for version control)"));
|
|
86
|
-
await delay(1500);
|
|
87
|
-
// Next steps
|
|
88
|
-
console.log(chalk.bold("\nš Next Steps:\n"));
|
|
89
|
-
console.log("1. " + chalk.white("Install the SDK: ") + chalk.cyan("npm install @kya-os/mcp-i"));
|
|
90
|
-
console.log("2. " + chalk.white("Add to your code: ") + chalk.cyan('import "@kya-os/mcp-i/auto"'));
|
|
91
|
-
console.log("3. " + chalk.white("Deploy with environment variables set"));
|
|
92
|
-
console.log("4. " + chalk.white("Verify at: ") + chalk.cyan("https://knowthat.ai/agents/automation-bot-x1"));
|
|
93
|
-
await delay(2000);
|
|
94
|
-
// Success
|
|
95
|
-
console.log(chalk.bold.green("\n⨠Setup Complete!\n"));
|
|
96
|
-
console.log(chalk.gray("Your AI agent now has a verifiable identity on the KYA-OS network.\n"));
|
|
97
|
-
// Claim URL
|
|
98
|
-
console.log(chalk.bold("šÆ Claim your agent:"));
|
|
99
|
-
console.log(chalk.cyan("https://knowthat.ai/agents/claim?token=eyJ0eXAi...\n"));
|
|
100
|
-
console.log(chalk.gray("š Documentation: ") + chalk.cyan("https://docs.kya-os.com"));
|
|
101
|
-
console.log(chalk.gray("š¬ Support: ") + chalk.cyan("https://discord.gg/kya-os"));
|
|
102
|
-
console.log("");
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
console.error(chalk.red("\nError in demo:"), error);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Create the simplified CLI demo command
|
|
110
|
-
*/
|
|
111
|
-
export function createSimpleCLIDemoCommand() {
|
|
112
|
-
const command = new Command("cli-demo-simple")
|
|
113
|
-
.description("Simplified KYA-OS CLI experience demo")
|
|
114
|
-
.action(async () => {
|
|
115
|
-
await runSimpleCLIDemo();
|
|
116
|
-
});
|
|
117
|
-
return command;
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=cli-experience-demo-simple.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-experience-demo-simple.js","sourceRoot":"","sources":["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,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC,CAAC;QAEhF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAElB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;SAC3C,WAAW,CAAC,uCAAuC,CAAC;SACpD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,gBAAgB,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Experience Demo Command
|
|
3
|
-
* Simulates the full KYA-OS CLI init experience with animations
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
/**
|
|
7
|
-
* Create the CLI experience demo command
|
|
8
|
-
*/
|
|
9
|
-
export declare function createCLIExperienceDemoCommand(): Command;
|
|
10
|
-
/**
|
|
11
|
-
* Export for direct execution
|
|
12
|
-
*/
|
|
13
|
-
export declare function runCLIExperienceDemo(fast?: boolean): Promise<void>;
|
|
14
|
-
//# sourceMappingURL=cli-experience-demo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-experience-demo.d.ts","sourceRoot":"","sources":["../../src/commands/cli-experience-demo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,CA0MxD;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/E"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Experience Demo Command
|
|
3
|
-
* Simulates the full KYA-OS CLI init experience with animations
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
import { cliEffects, withLoadingEffect, showAgentIdentityCreateEffect, showDIDGenerationEffect, EffectTrigger, } from "../effects/index.js";
|
|
8
|
-
/**
|
|
9
|
-
* Simulated delay for realistic timing
|
|
10
|
-
*/
|
|
11
|
-
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
|
-
/**
|
|
13
|
-
* Simulate typing effect
|
|
14
|
-
*/
|
|
15
|
-
async function simulateTyping(text, delayMs = 50) {
|
|
16
|
-
for (const char of text) {
|
|
17
|
-
process.stdout.write(char);
|
|
18
|
-
await delay(delayMs);
|
|
19
|
-
}
|
|
20
|
-
process.stdout.write("\n");
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create the CLI experience demo command
|
|
24
|
-
*/
|
|
25
|
-
export function createCLIExperienceDemoCommand() {
|
|
26
|
-
const command = new Command("cli-demo")
|
|
27
|
-
.description("Demonstrate the full KYA-OS CLI experience")
|
|
28
|
-
.option("--fast", "Run demo at increased speed")
|
|
29
|
-
.action(async (options) => {
|
|
30
|
-
const speedMultiplier = options.fast ? 0.5 : 1;
|
|
31
|
-
const d = (ms) => delay(ms * speedMultiplier);
|
|
32
|
-
try {
|
|
33
|
-
// Clear screen and show header
|
|
34
|
-
console.clear();
|
|
35
|
-
console.log(chalk.bold.cyan("\nš KYA-OS CLI Experience Demo\n"));
|
|
36
|
-
await d(1000);
|
|
37
|
-
// Simulate command execution
|
|
38
|
-
console.log(chalk.gray("$ ") + chalk.white("npx @kya-os/cli init"));
|
|
39
|
-
await d(1500);
|
|
40
|
-
// Initial loading
|
|
41
|
-
await withLoadingEffect("š Initializing KYA-OS CLI...", d(2000));
|
|
42
|
-
// Welcome message with decrypt effect
|
|
43
|
-
await cliEffects.showCustomEffect("decrypt", chalk.bold.magenta("šÆ Welcome to KYA-OS\n") +
|
|
44
|
-
chalk.white("Know Your Agent - Secure AI Identity Infrastructure"), {
|
|
45
|
-
config: {
|
|
46
|
-
duration: 1500 * speedMultiplier,
|
|
47
|
-
typingSpeed: 4,
|
|
48
|
-
ciphertextColors: ["404040", "606060", "808080"],
|
|
49
|
-
finalColor: "00ff00",
|
|
50
|
-
useGradient: false,
|
|
51
|
-
},
|
|
52
|
-
skipExitPrompt: true,
|
|
53
|
-
});
|
|
54
|
-
await d(500);
|
|
55
|
-
// Project detection
|
|
56
|
-
console.log(chalk.cyan("\nš Analyzing project structure...\n"));
|
|
57
|
-
await d(1000);
|
|
58
|
-
console.log(chalk.green("ā") + " Detected: Next.js project");
|
|
59
|
-
console.log(chalk.green("ā") + " Found: package.json");
|
|
60
|
-
console.log(chalk.green("ā") + " No existing KYA-OS configuration");
|
|
61
|
-
await d(1500);
|
|
62
|
-
// Configuration prompts
|
|
63
|
-
console.log(chalk.bold("\nš§ Configuration\n"));
|
|
64
|
-
await simulateTyping(chalk.cyan("? ") + chalk.white("What's your agent name? ") +
|
|
65
|
-
chalk.gray("(My Cool Agent) ") + chalk.green("AutomationBot-X1"));
|
|
66
|
-
await d(500);
|
|
67
|
-
await simulateTyping(chalk.cyan("? ") + chalk.white("Description? ") +
|
|
68
|
-
chalk.gray("(An agent that...) ") + chalk.green("AI assistant for code review and testing"));
|
|
69
|
-
await d(500);
|
|
70
|
-
await simulateTyping(chalk.cyan("? ") + chalk.white("Repository URL? ") +
|
|
71
|
-
chalk.gray("(https://github.com/...) ") + chalk.green("https://github.com/acme/automation-bot"));
|
|
72
|
-
await d(500);
|
|
73
|
-
console.log(chalk.cyan("? ") + chalk.white("Which directories to list on? ") +
|
|
74
|
-
chalk.gray("(Use arrow keys)"));
|
|
75
|
-
console.log(chalk.cyan("⯠All verified directories ") + chalk.gray("(recommended)"));
|
|
76
|
-
console.log(chalk.gray(" Specific directories"));
|
|
77
|
-
console.log(chalk.gray(" None (registry only)"));
|
|
78
|
-
await d(1500);
|
|
79
|
-
// Creating identity with animation
|
|
80
|
-
console.log("");
|
|
81
|
-
await showAgentIdentityCreateEffect("AutomationBot-X1", true);
|
|
82
|
-
await d(500);
|
|
83
|
-
// Generating DID with beams effect
|
|
84
|
-
await showDIDGenerationEffect("did:kya:z6Mkf5rGMoatrSj1f4CgPrHknGZ", true);
|
|
85
|
-
await d(500);
|
|
86
|
-
// Show registration process
|
|
87
|
-
await withLoadingEffect("ā” Registering with KYA-OS directory...", d(3000));
|
|
88
|
-
console.log(chalk.green("\nā Agent registered successfully!\n"));
|
|
89
|
-
await d(1000);
|
|
90
|
-
// Show created files with waves effect
|
|
91
|
-
await cliEffects.showCustomEffect("waves", chalk.bold("š Created files:\n") +
|
|
92
|
-
chalk.gray(" - .env.local ") + chalk.green("(for local development)\n") +
|
|
93
|
-
chalk.gray(" - .env.local.example ") + chalk.green("(for version control)"), {
|
|
94
|
-
config: {
|
|
95
|
-
duration: 2500 * speedMultiplier,
|
|
96
|
-
waveColors: ["0080ff", "00ffff", "ffffff"],
|
|
97
|
-
waveSpeed: 1.5,
|
|
98
|
-
},
|
|
99
|
-
skipExitPrompt: true,
|
|
100
|
-
});
|
|
101
|
-
await d(500);
|
|
102
|
-
// Show identity details with blackhole effect for emphasis
|
|
103
|
-
await cliEffects.showCustomEffect("blackhole", chalk.bold("š Your Identity:\n\n") +
|
|
104
|
-
chalk.yellow("DID: ") + chalk.white("did:kya:z6Mkf5rGMoatrSj1f4CgPrHknGZ\n") +
|
|
105
|
-
chalk.yellow("Agent ID: ") + chalk.white("agt_2gY7kR9mN3pQ5sT8vX\n") +
|
|
106
|
-
chalk.yellow("Status: ") + chalk.green("Active"), {
|
|
107
|
-
config: {
|
|
108
|
-
duration: 4000 * speedMultiplier,
|
|
109
|
-
blackholeColor: "ffffff",
|
|
110
|
-
starColors: ["ffcc0d", "ff7326", "ff194d", "bf2669", "702a8c"],
|
|
111
|
-
finalColor: "00ff00",
|
|
112
|
-
},
|
|
113
|
-
skipExitPrompt: true,
|
|
114
|
-
});
|
|
115
|
-
await d(500);
|
|
116
|
-
// Environment variables section
|
|
117
|
-
console.log(chalk.bold("\nāļø Environment Variables:\n"));
|
|
118
|
-
console.log(chalk.gray("For production deployment, add these to your platform:"));
|
|
119
|
-
console.log("");
|
|
120
|
-
console.log(chalk.blue('MCP_IDENTITY_DID="did:kya:z6Mkf5rGMoatrSj1f4CgPrHknGZ"'));
|
|
121
|
-
console.log(chalk.blue('MCP_IDENTITY_PUBLIC_KEY="z6Mkf5rGMo..."'));
|
|
122
|
-
console.log(chalk.blue('MCP_IDENTITY_PRIVATE_KEY="[ENCRYPTED]"'));
|
|
123
|
-
console.log("");
|
|
124
|
-
console.log(chalk.gray("Copy command: ") + chalk.cyan("npx @kya-os/cli env --copy"));
|
|
125
|
-
await d(2000);
|
|
126
|
-
// Next steps with final effect
|
|
127
|
-
await cliEffects.showCustomEffect("beams", chalk.bold("š Next Steps:\n\n") +
|
|
128
|
-
"1. " + chalk.white("Install the SDK: ") + chalk.cyan("npm install @kya-os/mcp-i\n") +
|
|
129
|
-
"2. " + chalk.white("Add to your code: ") + chalk.cyan('import "@kya-os/mcp-i/auto"\n') +
|
|
130
|
-
"3. " + chalk.white("Deploy with environment variables set\n") +
|
|
131
|
-
"4. " + chalk.white("Verify at: ") + chalk.cyan("https://knowthat.ai/agents/AutomationBot-X1"), {
|
|
132
|
-
config: {
|
|
133
|
-
duration: 3500 * speedMultiplier,
|
|
134
|
-
beamCount: 12,
|
|
135
|
-
beamColors: ["00ff00", "00ffff", "ffffff"],
|
|
136
|
-
beamSpeed: 2.0,
|
|
137
|
-
illuminationBrightness: 2.5,
|
|
138
|
-
},
|
|
139
|
-
skipExitPrompt: true,
|
|
140
|
-
});
|
|
141
|
-
await d(1000);
|
|
142
|
-
// Success message
|
|
143
|
-
console.log(chalk.bold.green("\n⨠Setup Complete!\n"));
|
|
144
|
-
console.log(chalk.gray("Your AI agent now has a verifiable identity on the KYA-OS network.\n"));
|
|
145
|
-
// Claim URL with animation
|
|
146
|
-
await cliEffects.showEffect(EffectTrigger.OPERATION_SUCCESS, chalk.bold("šÆ Claim your agent:\n") +
|
|
147
|
-
chalk.cyan("https://knowthat.ai/agents/claim?token=eyJ0eXAiOiJKV1QiLCJh..."), { skipExitPrompt: true });
|
|
148
|
-
await d(1000);
|
|
149
|
-
console.log(chalk.gray("\nš Documentation: ") + chalk.cyan("https://docs.kya-os.com"));
|
|
150
|
-
console.log(chalk.gray("š¬ Support: ") + chalk.cyan("https://discord.gg/kya-os"));
|
|
151
|
-
console.log("");
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
if (error instanceof Error && error.message.includes("prompt")) {
|
|
155
|
-
// User cancelled with Ctrl+C
|
|
156
|
-
console.log(chalk.gray("\n\nDemo cancelled.\n"));
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
console.error(chalk.red("Error:"), error);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
return command;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Export for direct execution
|
|
167
|
-
*/
|
|
168
|
-
export async function runCLIExperienceDemo(fast = false) {
|
|
169
|
-
const command = createCLIExperienceDemoCommand();
|
|
170
|
-
await command.parseAsync(fast ? ["node", "cli-demo", "--fast"] : ["node", "cli-demo"]);
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=cli-experience-demo.js.map
|