cubelife 0.2.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/LICENSE +21 -0
- package/README.md +81 -0
- package/SPRITE-LICENSE +14 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +39 -0
- package/dist/commands/agents.d.ts +2 -0
- package/dist/commands/agents.js +303 -0
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.js +233 -0
- package/dist/commands/billing.d.ts +2 -0
- package/dist/commands/billing.js +362 -0
- package/dist/commands/creature.d.ts +2 -0
- package/dist/commands/creature.js +166 -0
- package/dist/commands/default.d.ts +2 -0
- package/dist/commands/default.js +87 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +48 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +200 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.js +9 -0
- package/dist/commands/projects.d.ts +2 -0
- package/dist/commands/projects.js +122 -0
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +453 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +89 -0
- package/dist/commands/tutorial.d.ts +2 -0
- package/dist/commands/tutorial.js +9 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.js +262 -0
- package/dist/data/sprite-data.d.ts +32 -0
- package/dist/data/sprite-data.js +865 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/lib/api.d.ts +162 -0
- package/dist/lib/api.js +160 -0
- package/dist/lib/auth.d.ts +12 -0
- package/dist/lib/auth.js +113 -0
- package/dist/lib/browser.d.ts +1 -0
- package/dist/lib/browser.js +21 -0
- package/dist/lib/command-helpers.d.ts +26 -0
- package/dist/lib/command-helpers.js +60 -0
- package/dist/lib/compositor.d.ts +34 -0
- package/dist/lib/compositor.js +232 -0
- package/dist/lib/config.d.ts +39 -0
- package/dist/lib/config.js +89 -0
- package/dist/lib/constants.d.ts +12 -0
- package/dist/lib/constants.js +39 -0
- package/dist/lib/detect.d.ts +17 -0
- package/dist/lib/detect.js +99 -0
- package/dist/lib/doctor.d.ts +18 -0
- package/dist/lib/doctor.js +321 -0
- package/dist/lib/index.d.ts +11 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/integration.d.ts +66 -0
- package/dist/lib/integration.js +337 -0
- package/dist/lib/poll.d.ts +11 -0
- package/dist/lib/poll.js +31 -0
- package/dist/lib/resolve.d.ts +1 -0
- package/dist/lib/resolve.js +10 -0
- package/dist/lib/services/account-service.d.ts +17 -0
- package/dist/lib/services/account-service.js +30 -0
- package/dist/lib/services/agent-service.d.ts +17 -0
- package/dist/lib/services/agent-service.js +62 -0
- package/dist/lib/services/creature-service.d.ts +12 -0
- package/dist/lib/services/creature-service.js +35 -0
- package/dist/lib/services/project-service.d.ts +9 -0
- package/dist/lib/services/project-service.js +22 -0
- package/dist/lib/tutorial.d.ts +12 -0
- package/dist/lib/tutorial.js +358 -0
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +116 -0
- package/dist/ui/banner.d.ts +3 -0
- package/dist/ui/banner.js +27 -0
- package/dist/ui/half-block.d.ts +6 -0
- package/dist/ui/half-block.js +45 -0
- package/dist/ui/helpers.d.ts +3 -0
- package/dist/ui/helpers.js +11 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/panel.d.ts +7 -0
- package/dist/ui/panel.js +21 -0
- package/dist/ui/preview.d.ts +7 -0
- package/dist/ui/preview.js +21 -0
- package/dist/ui/table.d.ts +8 -0
- package/dist/ui/table.js +20 -0
- package/dist/ui/theme.d.ts +24 -0
- package/dist/ui/theme.js +32 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +63 -0
package/dist/ui/table.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { brand } from './theme.js';
|
|
2
|
+
export function table(columns, rows) {
|
|
3
|
+
const widths = columns.map((col) => {
|
|
4
|
+
const dataMax = rows.reduce((max, row) => Math.max(max, (row[col.key] ?? '').length), 0);
|
|
5
|
+
return col.width ?? Math.max(col.label.length, dataMax);
|
|
6
|
+
});
|
|
7
|
+
const header = columns
|
|
8
|
+
.map((col, i) => brand.label(col.label.padEnd(widths[i])))
|
|
9
|
+
.join(' ');
|
|
10
|
+
const separator = columns
|
|
11
|
+
.map((_, i) => brand.muted('─'.repeat(widths[i])))
|
|
12
|
+
.join(' ');
|
|
13
|
+
const body = rows.map((row) => columns
|
|
14
|
+
.map((col, i) => {
|
|
15
|
+
const value = (row[col.key] ?? '').padEnd(widths[i]);
|
|
16
|
+
return col.colour ? col.colour(value) : value;
|
|
17
|
+
})
|
|
18
|
+
.join(' '));
|
|
19
|
+
return [header, separator, ...body].join('\n');
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const brand: {
|
|
2
|
+
primary: import("chalk").ChalkInstance;
|
|
3
|
+
accent: import("chalk").ChalkInstance;
|
|
4
|
+
success: import("chalk").ChalkInstance;
|
|
5
|
+
warning: import("chalk").ChalkInstance;
|
|
6
|
+
error: import("chalk").ChalkInstance;
|
|
7
|
+
muted: import("chalk").ChalkInstance;
|
|
8
|
+
heading: import("chalk").ChalkInstance;
|
|
9
|
+
label: import("chalk").ChalkInstance;
|
|
10
|
+
};
|
|
11
|
+
export declare const status: {
|
|
12
|
+
pass: string;
|
|
13
|
+
fail: string;
|
|
14
|
+
warn: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const dot: {
|
|
17
|
+
online: string;
|
|
18
|
+
idle: string;
|
|
19
|
+
offline: string;
|
|
20
|
+
working: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function label(text: string): string;
|
|
23
|
+
export declare function heading(text: string): string;
|
|
24
|
+
export declare function dim(text: string): string;
|
package/dist/ui/theme.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { LABEL_WIDTH } from '../lib/constants.js';
|
|
3
|
+
export const brand = {
|
|
4
|
+
primary: chalk.hex('#7EAAC1'),
|
|
5
|
+
accent: chalk.hex('#9B7ED8'),
|
|
6
|
+
success: chalk.hex('#5B8C5A'),
|
|
7
|
+
warning: chalk.hex('#D4874E'),
|
|
8
|
+
error: chalk.hex('#C75B39'),
|
|
9
|
+
muted: chalk.dim,
|
|
10
|
+
heading: chalk.bold,
|
|
11
|
+
label: chalk.hex('#8B9DAF'),
|
|
12
|
+
};
|
|
13
|
+
export const status = {
|
|
14
|
+
pass: chalk.hex('#5B8C5A')('[pass]'),
|
|
15
|
+
fail: chalk.hex('#C75B39')('[fail]'),
|
|
16
|
+
warn: chalk.hex('#D4874E')('[warn]'),
|
|
17
|
+
};
|
|
18
|
+
export const dot = {
|
|
19
|
+
online: chalk.hex('#5B8C5A')('●'),
|
|
20
|
+
idle: chalk.hex('#7EAAC1')('●'),
|
|
21
|
+
offline: chalk.dim('●'),
|
|
22
|
+
working: chalk.hex('#5B8C5A')('●'),
|
|
23
|
+
};
|
|
24
|
+
export function label(text) {
|
|
25
|
+
return brand.label(text.padEnd(LABEL_WIDTH));
|
|
26
|
+
}
|
|
27
|
+
export function heading(text) {
|
|
28
|
+
return brand.heading(brand.primary(text));
|
|
29
|
+
}
|
|
30
|
+
export function dim(text) {
|
|
31
|
+
return brand.muted(text);
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLI_VERSION = "0.2.0";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CLI_VERSION = '0.2.0';
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cubelife",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "CLI for CubeLife — give your AI agent a living pixel-art companion",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"cubelife": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"SPRITE-LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build:sprites": "tsx scripts/process-sprites.ts",
|
|
17
|
+
"prebuild": "npm run build:sprites",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"prepublishOnly": "npm run build",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test:watch": "vitest",
|
|
23
|
+
"test:coverage": "vitest run --coverage"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ai",
|
|
27
|
+
"agent",
|
|
28
|
+
"pixel-art",
|
|
29
|
+
"character",
|
|
30
|
+
"cli",
|
|
31
|
+
"mcp"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/AndriesJacobus/CubeWorld.git",
|
|
37
|
+
"directory": "cli"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://life.cubeworld.co.za",
|
|
40
|
+
"bugs": "https://github.com/AndriesJacobus/CubeWorld/issues",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@clack/prompts": "^0.10.0",
|
|
46
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
47
|
+
"chalk": "^5.4.1",
|
|
48
|
+
"commander": "^13.1.0",
|
|
49
|
+
"yaml": "^2.9.0",
|
|
50
|
+
"zod": "^4.4.3"
|
|
51
|
+
},
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"terminal-image": "^3.0.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/pngjs": "^6.0.5",
|
|
57
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
58
|
+
"pngjs": "^7.0.0",
|
|
59
|
+
"tsx": "^4.21.1",
|
|
60
|
+
"typescript": "^5.7.0",
|
|
61
|
+
"vitest": "^4.0.18"
|
|
62
|
+
}
|
|
63
|
+
}
|