vanaheimr 0.4.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/lib/tools.ts ADDED
@@ -0,0 +1,42 @@
1
+ export type ToolDefinition = {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ href: string;
6
+ icon: string;
7
+ };
8
+
9
+ export const TOOLS: ToolDefinition[] = [
10
+ {
11
+ id: "entity-studio",
12
+ name: "Entity studio",
13
+ description:
14
+ "Define entity classes (allies, enemies, and custom types) with schemas, player data, and records.",
15
+ href: "/tools/entity-studio",
16
+ icon: "◎",
17
+ },
18
+ {
19
+ id: "publish",
20
+ name: "Publish",
21
+ description:
22
+ "Review draft changes, assign a version number, and push live for your game to consume.",
23
+ href: "/tools/publish",
24
+ icon: "▲",
25
+ },
26
+ {
27
+ id: "analytics",
28
+ name: "Player analytics",
29
+ description:
30
+ "Per-player field values reported from the game (e.g. has_defeated) keyed by anonymous player id.",
31
+ href: "/tools/analytics",
32
+ icon: "▤",
33
+ },
34
+ {
35
+ id: "docs-tool",
36
+ name: "SDK reference",
37
+ description:
38
+ "getEntityClasses(), getEntities(slug), player schemas, and AllyTree types.",
39
+ href: "/tools/docs-tool",
40
+ icon: "≡",
41
+ },
42
+ ];
package/lib/types.ts ADDED
@@ -0,0 +1,37 @@
1
+ export type FieldType = "int" | "string" | "image" | "bool";
2
+
3
+ export type SchemaField = {
4
+ id: string;
5
+ key: string;
6
+ type: FieldType;
7
+ /** Optional schema-level default used when a row has no value for this key yet. */
8
+ defaultValue?: number | string | boolean | null;
9
+ };
10
+
11
+ export type AllySchema = {
12
+ fields: SchemaField[];
13
+ };
14
+
15
+ /** Values stored on an ally/enemy row (content schema; includes bool when used as a field type). */
16
+ export type AllyRowValue = number | string | boolean | null;
17
+
18
+ export type AllyRow = {
19
+ id: string;
20
+ values: Record<string, AllyRowValue>;
21
+ };
22
+
23
+ export type AllyStore = {
24
+ schema: AllySchema;
25
+ /** Per-player tracking fields defined by the studio author (e.g. has_defeated, flawless). */
26
+ playerSchema: AllySchema;
27
+ allies: AllyRow[];
28
+ };
29
+
30
+ export const FIELD_TYPES: FieldType[] = ["int", "string", "image", "bool"];
31
+
32
+ /** Subset of field types suitable for player-data fields (no images). */
33
+ export const PLAYER_FIELD_TYPES: FieldType[] = ["bool", "int", "string"];
34
+
35
+ export function emptyStore(): AllyStore {
36
+ return { schema: { fields: [] }, playerSchema: { fields: [] }, allies: [] };
37
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "vanaheimr",
3
+ "version": "0.4.0",
4
+ "description": "Runtime access to studio entity classes, rows (PK → props), and player-data schemas.",
5
+ "files": [
6
+ "lib"
7
+ ],
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./lib/entry.ts",
14
+ "default": "./lib/entry.ts"
15
+ },
16
+ "./sdk": {
17
+ "types": "./lib/sdk/index.ts",
18
+ "default": "./lib/sdk/index.ts"
19
+ },
20
+ "./node": {
21
+ "types": "./lib/sdk/node.ts",
22
+ "default": "./lib/sdk/node.ts"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "dev": "next dev",
27
+ "build": "next build",
28
+ "start": "next start",
29
+ "lint": "eslint"
30
+ },
31
+ "dependencies": {
32
+ "@aws-sdk/client-s3": "^3.758.0",
33
+ "@supabase/ssr": "^0.10.3",
34
+ "@supabase/supabase-js": "^2.105.4",
35
+ "@vercel/blob": "^0.27.0",
36
+ "next": "16.2.4",
37
+ "react": "19.2.4",
38
+ "react-dom": "19.2.4"
39
+ },
40
+ "devDependencies": {
41
+ "@tailwindcss/postcss": "^4",
42
+ "@types/node": "^20",
43
+ "@types/react": "^19",
44
+ "@types/react-dom": "^19",
45
+ "eslint": "^9",
46
+ "eslint-config-next": "16.2.4",
47
+ "tailwindcss": "^4",
48
+ "typescript": "^5"
49
+ }
50
+ }