@fias/arche-sdk 1.0.0 → 1.1.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/README.md CHANGED
@@ -10,18 +10,26 @@ npx create-fias-plugin my-plugin
10
10
  cd my-plugin
11
11
  npm install
12
12
 
13
- # Start the dev server
13
+ # Terminal 1: Start the plugin dev server
14
14
  npm run dev
15
15
 
16
- # Open the dev preview in your browser (requires a running FIAS platform)
17
- # http://localhost:3000/a/arche_plugins/dev-preview?url=http://localhost:3100&permissions=theme:read
16
+ # Terminal 2: Start the dev harness (mock mode free, offline)
17
+ npm run dev:mock
18
+
19
+ # Open http://localhost:3200 in your browser
20
+ ```
21
+
22
+ For real AI testing with live entity invocations (costs credits):
23
+
24
+ ```bash
25
+ npx fias-dev login # Save your API key (one-time setup)
26
+ npm run dev:harness # Start harness in live mode
18
27
  ```
19
28
 
20
29
  When you're ready to submit:
21
30
 
22
31
  ```bash
23
- npm run build
24
- # Package your plugin into a tarball, then upload it through the submission flow (see below)
32
+ npm run submit # Builds, validates, packages, and submits for review
25
33
  ```
26
34
 
27
35
  ## Manifest Reference (`fias-plugin.json`)
@@ -42,17 +50,17 @@ Every plugin must include a `fias-plugin.json` at its root:
42
50
  }
43
51
  ```
44
52
 
45
- | Field | Type | Description |
46
- | ------------- | ----------------------------------------------- | ----------------------------------------------------- |
47
- | `name` | `string` | Unique plugin identifier (lowercase, hyphens allowed) |
48
- | `version` | `string` | Semver version of your plugin |
49
- | `description` | `string` | Short description shown in the marketplace |
50
- | `main` | `string` | Entry point source file |
51
- | `archeType` | `"tool" \| "assistant" \| "workflow"` | Category of your plugin |
52
- | `tags` | `string[]` | Discovery tags for the marketplace |
53
- | `pricing` | `{ model: "free" \| "paid", currency: string }` | Pricing model |
54
- | `permissions` | `PluginPermission[]` | Scopes your plugin requires (see Permissions) |
55
- | `sdk` | `string` | Required SDK version range |
53
+ | Field | Type | Description |
54
+ | ------------- | ------------------------------------------------------- | ----------------------------------------------------- |
55
+ | `name` | `string` | Unique plugin identifier (lowercase, hyphens allowed) |
56
+ | `version` | `string` | Semver version of your plugin |
57
+ | `description` | `string` | Short description shown in the marketplace |
58
+ | `main` | `string` | Entry point source file |
59
+ | `archeType` | `"tool" \| "site"` | Category of your plugin |
60
+ | `tags` | `string[]` | Discovery tags for the marketplace |
61
+ | `pricing` | `{ model: "free" \| "fixed" \| "per_use" \| "tiered" }` | Pricing model |
62
+ | `permissions` | `PluginPermission[]` | Scopes your plugin requires (see Permissions) |
63
+ | `sdk` | `string` | Required SDK version range |
56
64
 
57
65
  ## API Reference
58
66
 
@@ -280,56 +288,82 @@ Requesting only the permissions you need improves user trust and review speed.
280
288
  - `storage_delete`: 60/minute
281
289
  - **Sandboxing:** Plugins run in an iframe with `sandbox="allow-scripts allow-forms"`. No access to the parent page DOM, cookies, or local storage.
282
290
 
283
- ## Dev Preview
291
+ ## Local Development
292
+
293
+ The recommended way to develop and test plugins is with the **`@fias/plugin-dev-harness`** — a standalone local server that provides a production-accurate iframe environment without requiring the full FIAS platform.
294
+
295
+ ### Mock Mode (free, offline)
296
+
297
+ Best for UI development, layout, and styling work:
298
+
299
+ ```bash
300
+ npm run dev:mock
301
+ # Opens http://localhost:3200 with canned AI responses and in-memory storage
302
+ ```
303
+
304
+ ### Live Mode (real AI, costs credits)
305
+
306
+ Best for integration testing with real AI models:
307
+
308
+ ```bash
309
+ npx fias-dev login # One-time: save your API key
310
+ npm run dev:harness # Connects to FIAS production API
311
+ ```
284
312
 
285
- Test your plugin locally against the real FIAS platform:
313
+ The harness provides:
286
314
 
287
- 1. Start the FIAS platform on `localhost:3000`
288
- 2. Start your plugin dev server:
289
- ```bash
290
- cd my-plugin
291
- npm run dev
292
- # Runs on localhost:3100
293
- ```
294
- 3. Open the dev preview URL in your browser:
295
- ```
296
- http://localhost:3000/a/arche_plugins/dev-preview?url=http://localhost:3100&permissions=theme:read,storage:sandbox
297
- ```
315
+ - An iframe embedding your plugin (same sandbox attributes as production)
316
+ - A toolbar showing mode (Mock/Live), active permissions, and credit balance
317
+ - A dev console showing all bridge messages with timestamps
318
+ - Theme toggle and reload buttons
298
319
 
299
- The dev preview page:
320
+ ### Dev Preview (alternative)
300
321
 
301
- - Loads your plugin in an iframe with a real `PluginBridgeHost`
302
- - Provides real auth tokens, user data, and theme from the platform
303
- - Grants the permissions you specify in the `permissions` query parameter
304
- - Shows a toolbar with the plugin URL, reload button, and active permissions
322
+ If you have the full FIAS platform running locally, you can also use the built-in dev preview:
305
323
 
306
- **URL requirements:**
324
+ ```
325
+ http://localhost:3000/a/arche_plugins/dev-preview?url=http://localhost:3100&permissions=theme:read,storage:sandbox
326
+ ```
307
327
 
308
- - Must be `localhost` or `https://` (no arbitrary HTTP origins)
309
- - Your Vite dev server must have CORS enabled (the scaffold template configures this)
328
+ This loads your plugin with a real `PluginBridgeHost`, auth tokens, and live platform data. The URL must be `localhost` or `https://`.
310
329
 
311
330
  ## Submission Flow
312
331
 
313
- Once your plugin is ready for review:
332
+ The easiest way to submit is with the dev harness CLI:
333
+
334
+ ```bash
335
+ npm run submit
336
+ # or: npx fias-dev submit
337
+ ```
338
+
339
+ This automates the full pipeline: build, validate manifest, package, upload to S3, create submission, and poll review status.
340
+
341
+ ### Manual submission
342
+
343
+ If you prefer to submit manually via the API:
314
344
 
315
345
  1. **Build:** `npm run build` to create the production bundle in `dist/`
316
- 2. **Package:** Create a tarball of the build output
317
- 3. **Get upload URL:**
318
- ```
319
- POST /v1/arches/plugins/submissions/upload-url
320
- { uploadUrl, submissionId }
321
- ```
322
- 4. **Upload:** PUT the tarball to the returned `uploadUrl`
323
- 5. **Create submission:**
324
- ```
325
- POST /v1/arches/plugins/submissions
326
- Body: { submissionId, manifest: <contents of fias-plugin.json> }
327
- ```
328
- 6. **Track status:**
329
- ```
330
- GET /v1/arches/plugins/submissions/:submissionId
331
- { status: "pending" | "reviewing" | "approved" | "rejected", feedback?: string }
332
- ```
346
+ 2. **Validate:** `npx fias-dev validate` to check your manifest
347
+ 3. **Get upload URL:** `POST /v1/plugins/submissions/upload-url`
348
+ 4. **Upload:** PUT your `.tar.gz` to the returned presigned URL
349
+ 5. **Create submission:** `POST /v1/plugins/submissions` with `{ submissionId, manifest }`
350
+ 6. **Track status:** `GET /v1/plugins/submissions/:submissionId`
351
+
352
+ See `docs/api-plugins.md` for full API details.
353
+
354
+ ## CLI Tools
355
+
356
+ The `@fias/plugin-dev-harness` package provides CLI commands for the full development lifecycle:
357
+
358
+ ```bash
359
+ npx fias-dev # Start harness (mock mode)
360
+ npx fias-dev --live # Start harness (live mode, costs credits)
361
+ npx fias-dev login # Save API key to ~/.fias/credentials
362
+ npx fias-dev entities # Browse available entities
363
+ npx fias-dev entities --search "summarize"
364
+ npx fias-dev validate # Validate fias-plugin.json
365
+ npx fias-dev submit # Build, package, and submit for review
366
+ ```
333
367
 
334
368
  ## TypeScript Types
335
369
 
@@ -351,6 +385,12 @@ import type {
351
385
  } from '@fias/arche-sdk';
352
386
  ```
353
387
 
388
+ ## Further Reading
389
+
390
+ - **[Plugin Creation Guide](../../docs/plugin-creation-guide.md)** — Step-by-step tutorial for beginners
391
+ - **[Developer API Reference](../../docs/api-developer.md)** — Bridge, entities, credits, and validation endpoints
392
+ - **[Plugin API Reference](../../docs/api-plugins.md)** — Submission, review pipeline, and production bridge
393
+
354
394
  ## License
355
395
 
356
396
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fias/arche-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "SDK for building FIAS platform plugin arches",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,7 +6,9 @@
6
6
  "dev": "vite",
7
7
  "build": "vite build",
8
8
  "validate": "tsc --noEmit",
9
- "submit": "echo 'Submission CLI not yet available'"
9
+ "dev:harness": "fias-dev --live",
10
+ "dev:mock": "fias-dev",
11
+ "submit": "fias-dev submit"
10
12
  },
11
13
  "dependencies": {
12
14
  "@fias/arche-sdk": "^1.0.0",
@@ -14,6 +16,7 @@
14
16
  "react-dom": "^19.0.0"
15
17
  },
16
18
  "devDependencies": {
19
+ "@fias/plugin-dev-harness": "^1.0.0",
17
20
  "@types/react": "^19.0.0",
18
21
  "@types/react-dom": "^19.0.0",
19
22
  "@vitejs/plugin-react": "^4.0.0",