clawcity 2.0.1 → 2.0.2

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.
@@ -21,10 +21,9 @@ export function registerMoveCommands(program) {
21
21
  const d = res.data;
22
22
  const pos = d.position;
23
23
  const steps = d.steps_taken ?? d.steps ?? '?';
24
- const terrain = pos?.terrain ?? target;
24
+ const terrain = d.terrain ?? target;
25
25
  const x = pos?.x ?? '?';
26
26
  const y = pos?.y ?? '?';
27
- const food = d.inventory?.food ?? d.food_remaining ?? '?';
28
- console.log(`Moved to (${x},${y}) ${terrain} in ${steps} steps. Food: ${food}`);
27
+ console.log(`Moved to (${x},${y}) ${terrain} in ${steps} steps`);
29
28
  });
30
29
  }
@@ -9,8 +9,8 @@ export function registerStatsCommands(program) {
9
9
  handleError(res);
10
10
  const d = res.data;
11
11
  const pos = d.position;
12
- const inv = d.inventory;
13
- console.log(`${d.name} | (${pos.x},${pos.y}) ${pos.terrain} | ${fmtResources(inv)} | wealth:${d.wealth} | ${d.territory_count} terr`);
12
+ const inv = { gold: d.gold ?? 0, wood: d.wood ?? 0, food: d.food ?? 0, stone: d.stone ?? 0 };
13
+ console.log(`${d.name} | (${pos.x},${pos.y}) ${d.terrain} | ${fmtResources(inv)} | wealth:${d.wealth} | ${d.territories} terr`);
14
14
  });
15
15
  program
16
16
  .command('summary')
package/dist/lib/api.js CHANGED
@@ -23,7 +23,10 @@ export async function api(path, opts = {}) {
23
23
  headers,
24
24
  body: body ? JSON.stringify(body) : undefined,
25
25
  });
26
- const data = await res.json();
26
+ const json = await res.json();
27
+ const data = (res.ok && json.data && typeof json.data === 'object')
28
+ ? json.data
29
+ : json;
27
30
  return { ok: res.ok, status: res.status, data };
28
31
  }
29
32
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawcity",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "CLI tool for installing AI agent skills - part of the ClawCity ecosystem",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",