@cubelife/sdk 0.1.0 → 0.2.1
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 +15 -8
- package/dist/client.d.ts +22 -14
- package/dist/client.js +1 -0
- package/dist/index.d.ts +1 -1
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @cubelife/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Give your AI agent a living pixel-art character. Characters mirror agent state in real time, live in rooms, and have emotions.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -15,16 +15,23 @@ import { CubeLifeClient } from '@cubelife/sdk';
|
|
|
15
15
|
|
|
16
16
|
const client = new CubeLifeClient({ apiKey: 'your-agent-api-key' });
|
|
17
17
|
|
|
18
|
-
// Report what your agent is doing
|
|
19
18
|
await client.report('coding', { detail: 'Building the login page', sentiment: 'positive' });
|
|
20
|
-
|
|
21
|
-
// Update progress
|
|
22
19
|
await client.report('coding', { detail: 'Building the login page', progress: 0.5 });
|
|
23
|
-
|
|
24
|
-
// Mark complete
|
|
25
20
|
await client.report('complete', { detail: 'Login page shipped' });
|
|
26
21
|
```
|
|
27
22
|
|
|
23
|
+
Your character appears at [life.cubeworld.co.za](https://life.cubeworld.co.za), in the desktop companion, or embedded in your own app via `<iframe>`.
|
|
24
|
+
|
|
25
|
+
## MCP Server
|
|
26
|
+
|
|
27
|
+
If you use Claude Code, Cursor, Windsurf, or any MCP-compatible tool, you can skip the SDK and use the CLI's built-in MCP server instead:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx cubelife setup claude-code # auto-configures MCP
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The MCP server exposes `cubelife_report`, `cubelife_complete`, `cubelife_error`, and `cubelife_status` tools. See the [cubelife CLI](https://www.npmjs.com/package/cubelife) package.
|
|
34
|
+
|
|
28
35
|
## API
|
|
29
36
|
|
|
30
37
|
### `CubeLifeClient`
|
|
@@ -37,8 +44,8 @@ const client = new CubeLifeClient({ apiKey: 'your-key' });
|
|
|
37
44
|
|
|
38
45
|
**Methods:**
|
|
39
46
|
|
|
40
|
-
- `report(state, options?)` - Report agent state
|
|
41
|
-
- `getState()` - Get current agent state
|
|
47
|
+
- `report(state, options?)` - Report agent state
|
|
48
|
+
- `getState()` - Get current agent state (returns sleeping status)
|
|
42
49
|
- `navigate(destination)` - Move agent to a different room
|
|
43
50
|
- `customise(options)` - Update character appearance (outfit, skin tone, accessories)
|
|
44
51
|
- `setCreature(type)` - Switch agent to a creature form
|
package/dist/client.d.ts
CHANGED
|
@@ -26,8 +26,16 @@ interface AgentState {
|
|
|
26
26
|
detail: string | null;
|
|
27
27
|
progress: number | null;
|
|
28
28
|
sentiment: Sentiment | null;
|
|
29
|
+
sleeping: boolean;
|
|
29
30
|
updatedAt: number | null;
|
|
30
31
|
}
|
|
32
|
+
interface ReportResponse {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
sleeping: boolean;
|
|
35
|
+
wokeUp: boolean;
|
|
36
|
+
burst?: boolean;
|
|
37
|
+
burstSparksRemaining?: number;
|
|
38
|
+
}
|
|
31
39
|
interface CubeLifeOptions {
|
|
32
40
|
apiKey: string;
|
|
33
41
|
baseUrl?: string;
|
|
@@ -45,19 +53,19 @@ export declare class CubeLifeClient {
|
|
|
45
53
|
private readonly baseUrl;
|
|
46
54
|
constructor(opts: CubeLifeOptions);
|
|
47
55
|
getState(): Promise<AgentState>;
|
|
48
|
-
report(state: WorkState, opts?: ReportOptions): Promise<
|
|
49
|
-
coding(detail?: string, progress?: number): Promise<
|
|
50
|
-
reading(detail?: string): Promise<
|
|
51
|
-
researching(detail?: string): Promise<
|
|
52
|
-
designing(detail?: string): Promise<
|
|
53
|
-
testing(detail?: string, progress?: number): Promise<
|
|
54
|
-
reviewing(detail?: string): Promise<
|
|
55
|
-
thinking(detail?: string): Promise<
|
|
56
|
-
writing(detail?: string): Promise<
|
|
57
|
-
error(detail?: string): Promise<
|
|
58
|
-
complete(detail?: string): Promise<
|
|
59
|
-
waiting(detail?: string): Promise<
|
|
60
|
-
awaitingInput(detail?: string): Promise<
|
|
56
|
+
report(state: WorkState, opts?: ReportOptions): Promise<ReportResponse>;
|
|
57
|
+
coding(detail?: string, progress?: number): Promise<ReportResponse>;
|
|
58
|
+
reading(detail?: string): Promise<ReportResponse>;
|
|
59
|
+
researching(detail?: string): Promise<ReportResponse>;
|
|
60
|
+
designing(detail?: string): Promise<ReportResponse>;
|
|
61
|
+
testing(detail?: string, progress?: number): Promise<ReportResponse>;
|
|
62
|
+
reviewing(detail?: string): Promise<ReportResponse>;
|
|
63
|
+
thinking(detail?: string): Promise<ReportResponse>;
|
|
64
|
+
writing(detail?: string): Promise<ReportResponse>;
|
|
65
|
+
error(detail?: string): Promise<ReportResponse>;
|
|
66
|
+
complete(detail?: string): Promise<ReportResponse>;
|
|
67
|
+
waiting(detail?: string): Promise<ReportResponse>;
|
|
68
|
+
awaitingInput(detail?: string): Promise<ReportResponse>;
|
|
61
69
|
moveTo(roomId: string, zone?: string): Promise<void>;
|
|
62
70
|
/** World-product only. Returns 403 for life projects. */
|
|
63
71
|
navigateTo(worldRoomId: string, zone?: string): Promise<NavigationResult>;
|
|
@@ -65,4 +73,4 @@ export declare class CubeLifeClient {
|
|
|
65
73
|
}
|
|
66
74
|
type AgentForm = 'human' | 'creature';
|
|
67
75
|
type HairStyle = 'none' | 'short' | 'long' | 'curly' | 'ponytail' | 'mohawk';
|
|
68
|
-
export type { WorkState, Sentiment, ReportOptions, CubeLifeOptions, CharacterOptions, OutfitStyle, AccessoryStyle, NavigationResult, AgentState, AgentForm, HairStyle };
|
|
76
|
+
export type { WorkState, Sentiment, ReportOptions, ReportResponse, CubeLifeOptions, CharacterOptions, OutfitStyle, AccessoryStyle, NavigationResult, AgentState, AgentForm, HairStyle };
|
package/dist/client.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { CubeLifeClient, CubeLifeError, RateLimitError } from './client';
|
|
2
|
-
export type { WorkState, Sentiment, ReportOptions, CubeLifeOptions, CharacterOptions, OutfitStyle, AccessoryStyle, NavigationResult, AgentState, AgentForm, HairStyle, } from './client';
|
|
2
|
+
export type { WorkState, Sentiment, ReportOptions, ReportResponse, CubeLifeOptions, CharacterOptions, OutfitStyle, AccessoryStyle, NavigationResult, AgentState, AgentForm, HairStyle, } from './client';
|
|
3
3
|
export { CubeLifeAdmin } from './admin';
|
|
4
4
|
export type { CubeLifeAdminOptions, AuthTokens, Project, Agent, Character, CreatureTraits, Personality, Room, ChestItem, Possession, Neighbourhood, WorldRoom, } from './admin';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubelife/sdk",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "SDK for CubeLife — give your AI agent a living pixel-art character",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,14 @@
|
|
|
20
20
|
"agent",
|
|
21
21
|
"pixel-art",
|
|
22
22
|
"character",
|
|
23
|
-
"visualization"
|
|
23
|
+
"visualization",
|
|
24
|
+
"mcp",
|
|
25
|
+
"mcp-server",
|
|
26
|
+
"developer-tools",
|
|
27
|
+
"companion",
|
|
28
|
+
"claude",
|
|
29
|
+
"cursor",
|
|
30
|
+
"copilot"
|
|
24
31
|
],
|
|
25
32
|
"license": "MIT",
|
|
26
33
|
"repository": {
|