@fias/arche-sdk 1.0.0 → 1.1.1
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 +100 -55
- package/package.json +1 -1
- package/templates/default/package.json +4 -1
package/README.md
CHANGED
|
@@ -10,18 +10,28 @@ 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
|
-
#
|
|
17
|
-
|
|
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), click the **MOCK** badge in the toolbar to switch to live mode. If you haven't saved an API key yet, the harness will prompt you to enter one.
|
|
23
|
+
|
|
24
|
+
Alternatively, use the CLI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx fias-dev login # Save your API key (one-time)
|
|
28
|
+
npm run dev:harness # Start harness in live mode
|
|
18
29
|
```
|
|
19
30
|
|
|
20
31
|
When you're ready to submit:
|
|
21
32
|
|
|
22
33
|
```bash
|
|
23
|
-
npm run
|
|
24
|
-
# Package your plugin into a tarball, then upload it through the submission flow (see below)
|
|
34
|
+
npm run submit # Builds, validates, packages, and submits for review
|
|
25
35
|
```
|
|
26
36
|
|
|
27
37
|
## Manifest Reference (`fias-plugin.json`)
|
|
@@ -42,17 +52,17 @@ Every plugin must include a `fias-plugin.json` at its root:
|
|
|
42
52
|
}
|
|
43
53
|
```
|
|
44
54
|
|
|
45
|
-
| Field | Type
|
|
46
|
-
| ------------- |
|
|
47
|
-
| `name` | `string`
|
|
48
|
-
| `version` | `string`
|
|
49
|
-
| `description` | `string`
|
|
50
|
-
| `main` | `string`
|
|
51
|
-
| `archeType` | `"tool" \| "
|
|
52
|
-
| `tags` | `string[]`
|
|
53
|
-
| `pricing` | `{ model: "free" \| "
|
|
54
|
-
| `permissions` | `PluginPermission[]`
|
|
55
|
-
| `sdk` | `string`
|
|
55
|
+
| Field | Type | Description |
|
|
56
|
+
| ------------- | ------------------------------------------------------- | ----------------------------------------------------- |
|
|
57
|
+
| `name` | `string` | Unique plugin identifier (lowercase, hyphens allowed) |
|
|
58
|
+
| `version` | `string` | Semver version of your plugin |
|
|
59
|
+
| `description` | `string` | Short description shown in the marketplace |
|
|
60
|
+
| `main` | `string` | Entry point source file |
|
|
61
|
+
| `archeType` | `"tool" \| "site"` | Category of your plugin |
|
|
62
|
+
| `tags` | `string[]` | Discovery tags for the marketplace |
|
|
63
|
+
| `pricing` | `{ model: "free" \| "fixed" \| "per_use" \| "tiered" }` | Pricing model |
|
|
64
|
+
| `permissions` | `PluginPermission[]` | Scopes your plugin requires (see Permissions) |
|
|
65
|
+
| `sdk` | `string` | Required SDK version range |
|
|
56
66
|
|
|
57
67
|
## API Reference
|
|
58
68
|
|
|
@@ -280,56 +290,85 @@ Requesting only the permissions you need improves user trust and review speed.
|
|
|
280
290
|
- `storage_delete`: 60/minute
|
|
281
291
|
- **Sandboxing:** Plugins run in an iframe with `sandbox="allow-scripts allow-forms"`. No access to the parent page DOM, cookies, or local storage.
|
|
282
292
|
|
|
283
|
-
##
|
|
293
|
+
## Local Development
|
|
284
294
|
|
|
285
|
-
|
|
295
|
+
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.
|
|
286
296
|
|
|
287
|
-
|
|
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
|
-
```
|
|
297
|
+
### Mock Mode (free, offline)
|
|
298
298
|
|
|
299
|
-
|
|
299
|
+
Best for UI development, layout, and styling work:
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
```bash
|
|
302
|
+
npm run dev:mock
|
|
303
|
+
# Opens http://localhost:3200 with canned AI responses and in-memory storage
|
|
304
|
+
```
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
### Live Mode (real AI, costs credits)
|
|
307
307
|
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
Best for integration testing with real AI models:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
npx fias-dev login # One-time: save your API key
|
|
312
|
+
npm run dev:harness # Connects to FIAS production API
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
The harness provides:
|
|
316
|
+
|
|
317
|
+
- An iframe embedding your plugin (same sandbox attributes as production)
|
|
318
|
+
- A toolbar with:
|
|
319
|
+
- Clickable **MOCK/LIVE** badge to toggle between modes
|
|
320
|
+
- **DARK/LIGHT** theme badge
|
|
321
|
+
- Credit balance (visible in live mode)
|
|
322
|
+
- Theme toggle and reload buttons
|
|
323
|
+
- A dev console showing all bridge messages with timestamps
|
|
324
|
+
|
|
325
|
+
### Dev Preview (alternative)
|
|
326
|
+
|
|
327
|
+
If you have the full FIAS platform running locally, you can also use the built-in dev preview:
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
http://localhost:3000/a/arche_plugins/dev-preview?url=http://localhost:3100&permissions=theme:read,storage:sandbox
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
This loads your plugin with a real `PluginBridgeHost`, auth tokens, and live platform data. The URL must be `localhost` or `https://`.
|
|
310
334
|
|
|
311
335
|
## Submission Flow
|
|
312
336
|
|
|
313
|
-
|
|
337
|
+
The easiest way to submit is with the dev harness CLI:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
npm run submit
|
|
341
|
+
# or: npx fias-dev submit
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
This automates the full pipeline: build, validate manifest, package, upload to S3, create submission, and poll review status.
|
|
345
|
+
|
|
346
|
+
### Manual submission
|
|
347
|
+
|
|
348
|
+
If you prefer to submit manually via the API:
|
|
314
349
|
|
|
315
350
|
1. **Build:** `npm run build` to create the production bundle in `dist/`
|
|
316
|
-
2. **
|
|
317
|
-
3. **Get upload URL:**
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
351
|
+
2. **Validate:** `npx fias-dev validate` to check your manifest
|
|
352
|
+
3. **Get upload URL:** `POST /v1/plugins/submissions/upload-url`
|
|
353
|
+
4. **Upload:** PUT your `.tar.gz` to the returned presigned URL
|
|
354
|
+
5. **Create submission:** `POST /v1/plugins/submissions` with `{ submissionId, manifest }`
|
|
355
|
+
6. **Track status:** `GET /v1/plugins/submissions/:submissionId`
|
|
356
|
+
|
|
357
|
+
See `docs/api-plugins.md` for full API details.
|
|
358
|
+
|
|
359
|
+
## CLI Tools
|
|
360
|
+
|
|
361
|
+
The `@fias/plugin-dev-harness` package provides CLI commands for the full development lifecycle:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
npx fias-dev # Start harness (mock mode)
|
|
365
|
+
npx fias-dev --live # Start harness (live mode, costs credits)
|
|
366
|
+
npx fias-dev login # Save API key to ~/.fias/credentials
|
|
367
|
+
npx fias-dev entities # Browse available entities
|
|
368
|
+
npx fias-dev entities --search "summarize"
|
|
369
|
+
npx fias-dev validate # Validate fias-plugin.json
|
|
370
|
+
npx fias-dev submit # Build, package, and submit for review
|
|
371
|
+
```
|
|
333
372
|
|
|
334
373
|
## TypeScript Types
|
|
335
374
|
|
|
@@ -351,6 +390,12 @@ import type {
|
|
|
351
390
|
} from '@fias/arche-sdk';
|
|
352
391
|
```
|
|
353
392
|
|
|
393
|
+
## Further Reading
|
|
394
|
+
|
|
395
|
+
- **[Plugin Creation Guide](../../docs/plugin-creation-guide.md)** — Step-by-step tutorial for beginners
|
|
396
|
+
- **[Developer API Reference](../../docs/api-developer.md)** — Bridge, entities, credits, and validation endpoints
|
|
397
|
+
- **[Plugin API Reference](../../docs/api-plugins.md)** — Submission, review pipeline, and production bridge
|
|
398
|
+
|
|
354
399
|
## License
|
|
355
400
|
|
|
356
401
|
MIT
|
package/package.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "vite build",
|
|
8
8
|
"validate": "tsc --noEmit",
|
|
9
|
-
"
|
|
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",
|