@fias/arche-sdk 1.2.1 → 1.3.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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fias/arche-sdk",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "SDK for building FIAS platform plugin arches",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -249,33 +249,32 @@ These are hard limits enforced by the platform. Code that violates these will fa
249
249
 
250
250
  ## Development Workflow
251
251
 
252
- ### Step 1: Authenticate (one-time)
252
+ ### Starting Development
253
253
 
254
254
  ```bash
255
- npx fias-dev login # Opens browser to sign in, saves API key automatically
255
+ npm start # Starts both Vite + dev harness
256
256
  ```
257
257
 
258
- This opens the FIAS platform in your browser. If you're already signed in, the API key is created and saved automatically. If not, you'll need to sign in (or sign up for a FIAS account if you don't have one — an invite code is required for new accounts). The URL is also printed in the terminal if the browser doesn't open automatically.
258
+ This starts the plugin in **mock mode** (free, offline). Open **http://localhost:3200** in your browser to see the plugin running inside the harness.
259
259
 
260
- ### Step 2: Start development
260
+ Port 3200 is the dev harness that wraps the plugin in the platform iframe. Port 3100 is just the raw Vite server and won't work correctly on its own.
261
261
 
262
- **With real AI (recommended requires login first):**
263
- ```bash
264
- npm start # Starts both Vite + dev harness with real AI (uses credits)
265
- ```
262
+ ### Switching to Live Mode (Real AI)
266
263
 
267
- **Without AI (offline, for UI-only work):**
268
- ```bash
269
- npm run start:mock # Starts both Vite + dev harness with mock responses
270
- ```
264
+ In the harness toolbar, click the **MOCK** badge to switch to **LIVE** mode. If you haven't authenticated yet, a login popup will open automatically. Sign in with your FIAS account and the harness will switch to live mode.
271
265
 
272
- `npm start` will fail with "Not logged in" if `npx fias-dev login` hasn't been run. If that happens, run the login command first, then retry `npm start`.
266
+ You can choose between **Staging** and **Production** environments using the dropdown in the toolbar. Each environment requires separate authentication.
273
267
 
274
- **IMPORTANT:** Always tell the user to open **http://localhost:3200** in their browser to see the plugin running. Port 3200 is the dev harness that wraps the plugin in the platform iframe. Port 3100 is just the raw Vite server and won't work correctly on its own.
268
+ **IMPORTANT:** Live mode uses real AI and costs credits. Mock mode returns canned responses and does NOT call real AI models. If you want actual AI-powered features to work during testing, you MUST switch to live mode.
275
269
 
276
- **IMPORTANT:** `npm start` uses real AI and costs credits. `npm run start:mock` returns canned responses and does NOT call real AI models. If the user wants actual AI-powered features to work during testing, they MUST use `npm start` (not `start:mock`).
270
+ ### CLI Authentication (Alternative)
277
271
 
278
- **Advanced:** If you prefer separate terminals, use `npm run dev` (Vite on port 3100) and `npm run dev:harness` or `npm run dev:mock` (harness on port 3200) independently.
272
+ You can also authenticate via the command line:
273
+
274
+ ```bash
275
+ npx fias-dev login # Authenticate with staging (default)
276
+ npx fias-dev login --env production # Authenticate with production
277
+ ```
279
278
 
280
279
  ### Browsing Available Entities
281
280
 
@@ -249,33 +249,32 @@ These are hard limits enforced by the platform. Code that violates these will fa
249
249
 
250
250
  ## Development Workflow
251
251
 
252
- ### Step 1: Authenticate (one-time)
252
+ ### Starting Development
253
253
 
254
254
  ```bash
255
- npx fias-dev login # Opens browser to sign in, saves API key automatically
255
+ npm start # Starts both Vite + dev harness
256
256
  ```
257
257
 
258
- This opens the FIAS platform in your browser. If you're already signed in, the API key is created and saved automatically. If not, you'll need to sign in (or sign up for a FIAS account if you don't have one — an invite code is required for new accounts). The URL is also printed in the terminal if the browser doesn't open automatically.
258
+ This starts the plugin in **mock mode** (free, offline). Open **http://localhost:3200** in your browser to see the plugin running inside the harness.
259
259
 
260
- ### Step 2: Start development
260
+ Port 3200 is the dev harness that wraps the plugin in the platform iframe. Port 3100 is just the raw Vite server and won't work correctly on its own.
261
261
 
262
- **With real AI (recommended requires login first):**
263
- ```bash
264
- npm start # Starts both Vite + dev harness with real AI (uses credits)
265
- ```
262
+ ### Switching to Live Mode (Real AI)
266
263
 
267
- **Without AI (offline, for UI-only work):**
268
- ```bash
269
- npm run start:mock # Starts both Vite + dev harness with mock responses
270
- ```
264
+ In the harness toolbar, click the **MOCK** badge to switch to **LIVE** mode. If you haven't authenticated yet, a login popup will open automatically. Sign in with your FIAS account and the harness will switch to live mode.
271
265
 
272
- `npm start` will fail with "Not logged in" if `npx fias-dev login` hasn't been run. If that happens, run the login command first, then retry `npm start`.
266
+ You can choose between **Staging** and **Production** environments using the dropdown in the toolbar. Each environment requires separate authentication.
273
267
 
274
- **IMPORTANT:** Always tell the user to open **http://localhost:3200** in their browser to see the plugin running. Port 3200 is the dev harness that wraps the plugin in the platform iframe. Port 3100 is just the raw Vite server and won't work correctly on its own.
268
+ **IMPORTANT:** Live mode uses real AI and costs credits. Mock mode returns canned responses and does NOT call real AI models. If you want actual AI-powered features to work during testing, you MUST switch to live mode.
275
269
 
276
- **IMPORTANT:** `npm start` uses real AI and costs credits. `npm run start:mock` returns canned responses and does NOT call real AI models. If the user wants actual AI-powered features to work during testing, they MUST use `npm start` (not `start:mock`).
270
+ ### CLI Authentication (Alternative)
277
271
 
278
- **Advanced:** If you prefer separate terminals, use `npm run dev` (Vite on port 3100) and `npm run dev:harness` or `npm run dev:mock` (harness on port 3200) independently.
272
+ You can also authenticate via the command line:
273
+
274
+ ```bash
275
+ npx fias-dev login # Authenticate with staging (default)
276
+ npx fias-dev login --env production # Authenticate with production
277
+ ```
279
278
 
280
279
  ### Browsing Available Entities
281
280
 
@@ -3,13 +3,11 @@
3
3
  "version": "1.0.0",
4
4
  "private": true,
5
5
  "scripts": {
6
- "start": "fias-dev check-auth && vite & sleep 2 && fias-dev --live",
7
- "start:mock": "vite & sleep 2 && fias-dev",
6
+ "start": "vite & sleep 2 && fias-dev",
8
7
  "dev": "vite",
9
8
  "build": "vite build",
10
9
  "validate": "tsc --noEmit",
11
- "dev:harness": "fias-dev --live",
12
- "dev:mock": "fias-dev",
10
+ "dev:harness": "fias-dev",
13
11
  "submit": "fias-dev submit"
14
12
  },
15
13
  "dependencies": {