@layers/amba-mcp 0.1.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -16
  2. package/package.json +7 -6
package/dist/index.js CHANGED
@@ -266,7 +266,7 @@ function registerTools$18(server, apiClient) {
266
266
  text: JSON.stringify(result, null, 2)
267
267
  }] };
268
268
  });
269
- server.tool("amba_create_api_key", "Generate a new API key for a project. The full key value is returned ONCE in the response and cannot be retrieved later — store it immediately. Server keys are for backend services; client keys are for the @layers/amba-client SDK.", {
269
+ server.tool("amba_create_api_key", "Generate a new API key for a project. The full key value is returned ONCE in the response and cannot be retrieved later — store it immediately. Server keys are for backend services; client keys are for the Amba client SDKs (@layers/amba-web, @layers/amba-expo, @layers/amba-react-native, @layers/amba-node).", {
270
270
  project_id: z.string().describe("The project ID"),
271
271
  key_type: z.enum(["client", "server"]).describe("Key type. `client` for the SDK on end-user devices; `server` for backend services."),
272
272
  environment: z.enum(["development", "production"]).describe("Environment this key targets.")
@@ -1112,32 +1112,29 @@ val dailyLimit = Amba.Config.get("daily_limit", default = 10)
1112
1112
  val streak = Amba.Streaks.get("daily_login")
1113
1113
  println("Current streak: \${streak.currentCount}")`,
1114
1114
  "react-native": `// Bare React Native — App.tsx
1115
- // Use @layers/amba-client directly. For Expo apps, prefer @layers/amba-expo.
1116
- import { Amba } from '@layers/amba-client';
1115
+ // For Expo apps, use @layers/amba-expo instead.
1116
+ import { Amba } from '@layers/amba-react-native';
1117
1117
 
1118
1118
  // Configure once at app startup
1119
- Amba.configure({
1119
+ await Amba.configure({
1120
1120
  projectId: 'YOUR_PROJECT_ID',
1121
1121
  apiKey: 'YOUR_CLIENT_API_KEY',
1122
1122
  });
1123
1123
 
1124
- // Initialise (restores session, fetches remote config)
1125
- await Amba.client.init();
1126
-
1127
1124
  // Track events
1128
- await Amba.client.track('workout_completed', {
1125
+ await Amba.events.track('workout_completed', {
1129
1126
  duration_minutes: 30,
1130
1127
  type: 'strength',
1131
1128
  });
1132
1129
 
1133
1130
  // Register a push token (obtained from your native push library, e.g. @react-native-firebase/messaging)
1134
- await Amba.client.push.registerToken(deviceToken, 'ios');
1131
+ await Amba.push.register(deviceToken, 'ios');
1135
1132
 
1136
- // Get remote config
1137
- const dailyLimit = Amba.client.config.get('daily_limit') ?? 10;
1133
+ // Read remote config
1134
+ const config = await Amba.config.fetch();
1138
1135
 
1139
- // Get current streaks
1140
- const streaks = await Amba.client.streaks.getAll();`,
1136
+ // Email sign-in
1137
+ await Amba.auth.signInWithEmail('user@example.com', 'hunter2');`,
1141
1138
  expo: `// Expo — app/_layout.tsx
1142
1139
  import { useEffect } from 'react';
1143
1140
  import { Slot } from 'expo-router';
@@ -1145,7 +1142,7 @@ import { Amba } from '@layers/amba-expo';
1145
1142
 
1146
1143
  export default function RootLayout() {
1147
1144
  useEffect(() => {
1148
- Amba.init({
1145
+ Amba.configure({
1149
1146
  projectId: process.env.EXPO_PUBLIC_AMBA_PROJECT_ID!,
1150
1147
  apiKey: 'YOUR_CLIENT_API_KEY',
1151
1148
  });
@@ -1159,7 +1156,7 @@ import { Amba } from '@layers/amba-expo';
1159
1156
 
1160
1157
  function HomeScreen() {
1161
1158
  const onComplete = async () => {
1162
- await Amba.track('workout_completed', { type: 'strength' });
1159
+ await Amba.events.track('workout_completed', { type: 'strength' });
1163
1160
  };
1164
1161
 
1165
1162
  const onSignInApple = async () => {
@@ -1244,7 +1241,7 @@ function registerTools$9(server, _apiClient) {
1244
1241
  "```"
1245
1242
  ] : platform === "react-native" ? [
1246
1243
  "```bash",
1247
- "npm install @layers/amba-client",
1244
+ "npm install @layers/amba-react-native",
1248
1245
  "```"
1249
1246
  ] : platform === "expo" ? [
1250
1247
  "```bash",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers/amba-mcp",
3
- "version": "0.1.2",
3
+ "version": "1.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -20,9 +20,9 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "@layers/amba-shared": "^0.1.0",
24
23
  "@modelcontextprotocol/sdk": "^1.12.1",
25
- "zod": "^3.25.0"
24
+ "zod": "^3.25.0",
25
+ "@layers/amba-shared": "1.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.10.2",
@@ -31,12 +31,13 @@
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
34
- "url": "git+https://github.com/layers/amba-mcp.git"
34
+ "url": "git+https://github.com/layers/amba.git",
35
+ "directory": "packages/mcp"
35
36
  },
36
37
  "bugs": {
37
- "url": "https://github.com/layers/amba-mcp/issues"
38
+ "url": "https://github.com/layers/amba/issues"
38
39
  },
39
- "homepage": "https://github.com/layers/amba-mcp#readme",
40
+ "homepage": "https://amba.dev",
40
41
  "publishConfig": {
41
42
  "access": "public"
42
43
  },