@fias/create-fias-plugin 1.7.0 → 1.9.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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- fias-sdk-guide-version: 2.
|
|
1
|
+
<!-- fias-sdk-guide-version: 2.16.0 -->
|
|
2
2
|
|
|
3
3
|
# FIAS Plugin Development Guide
|
|
4
4
|
|
|
@@ -665,7 +665,7 @@ await invoke({ query: 'latest EU AI Act enforcement dates' });
|
|
|
665
665
|
|
|
666
666
|
### `useVaultDocuments()` — User-owned Vault documents
|
|
667
667
|
|
|
668
|
-
**Permissions:** `vault:documents:read` (list / read / getDownloadUrl / search), `vault:documents:write` (write / update / delete / attach / detach / upload)
|
|
668
|
+
**Permissions:** `vault:documents:read` (list / read / readBytes / getDownloadUrl / search), `vault:documents:write` (write / update / delete / attach / detach / upload)
|
|
669
669
|
**Returns:** `VaultDocumentsApi`
|
|
670
670
|
|
|
671
671
|
The Vault is the platform's persistent document store for the signed-in user. Distinct from `useFiasStorage` (per-plugin sandbox): Vault docs live in the user's My Data, survive plugin uninstall, and can be cross-referenced from other arches. Documents this arche creates are scoped to it (`source_arche_id`) and surfaced to the user under `/My-Fias/Arches/<archeId>/`.
|
|
@@ -698,6 +698,17 @@ const result = await vault.upload(bytes, {
|
|
|
698
698
|
});
|
|
699
699
|
// result.status transitions 'uploaded' → 'available' once indexed for search
|
|
700
700
|
|
|
701
|
+
// Read back the raw bytes of a document THIS arche created (any content
|
|
702
|
+
// type) — the reopen path for binary-processing plugins (e.g. a PDF editor
|
|
703
|
+
// reloading a saved PDF). Capped at 15 MB (OWN_DOCUMENT_TOO_LARGE names the
|
|
704
|
+
// cap) with its own tight per-minute budget: read sequentially and surface
|
|
705
|
+
// a RATE_LIMIT error verbatim instead of retrying in a loop. Documents this
|
|
706
|
+
// arche did NOT create reject with DOCUMENT_NOT_FOUND — the user's own
|
|
707
|
+
// files are reachable only through useVaultUserDocuments (picker consent).
|
|
708
|
+
// A document whose upload never finished rejects with OWN_DOCUMENT_NOT_READY
|
|
709
|
+
// but still appears in list() — don't assume every listed doc has bytes.
|
|
710
|
+
const { bytes: saved } = await vault.readBytes(documentId);
|
|
711
|
+
|
|
701
712
|
// Semantic search across documents this arche owns
|
|
702
713
|
// (burns user credits per the AI Markup Invariant — call sparingly)
|
|
703
714
|
const { matches } = await vault.search('quarterly revenue', { topK: 5 });
|
|
@@ -773,7 +784,7 @@ There are two declaration lanes, one shape:
|
|
|
773
784
|
```tsx
|
|
774
785
|
import { useFiasAIActions } from '@fias/arche-sdk';
|
|
775
786
|
|
|
776
|
-
useFiasAIActions({
|
|
787
|
+
const { openAssistant } = useFiasAIActions({
|
|
777
788
|
description: 'Once a document is open, the assistant can rotate its pages.',
|
|
778
789
|
actions: [
|
|
779
790
|
{
|
|
@@ -804,6 +815,7 @@ Rules that matter:
|
|
|
804
815
|
- `requiresConfirmation: true` makes the assistant ask the user before dispatching. It escalates only — nothing can skip a confirmation the platform requires.
|
|
805
816
|
- Manifest actions win id collisions with runtime ones; the merged list is capped at 50.
|
|
806
817
|
- The assistant is not present in the builder preview or the dev harness — declarations are accepted but nothing dispatches until the published plugin runs with the Fias AI window.
|
|
818
|
+
- **`openAssistant()`** (the hook's return) asks the HOST to open the Fias AI panel — use it for a contextual affordance (an empty-state "Ask Fias AI to get started" button). The host already shows its own "Works with Fias AI" chip, debounces your requests, and ignores them for a while after the user closes the panel — never call it in a loop or on mount. There is deliberately no way to pass text along: the assistant's input belongs to the user.
|
|
807
819
|
|
|
808
820
|
### `useArcheAssets()` — Contributor-published asset library
|
|
809
821
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- fias-sdk-guide-version: 2.
|
|
1
|
+
<!-- fias-sdk-guide-version: 2.16.0 -->
|
|
2
2
|
|
|
3
3
|
# FIAS Plugin Development Guide
|
|
4
4
|
|
|
@@ -665,7 +665,7 @@ await invoke({ query: 'latest EU AI Act enforcement dates' });
|
|
|
665
665
|
|
|
666
666
|
### `useVaultDocuments()` — User-owned Vault documents
|
|
667
667
|
|
|
668
|
-
**Permissions:** `vault:documents:read` (list / read / getDownloadUrl / search), `vault:documents:write` (write / update / delete / attach / detach / upload)
|
|
668
|
+
**Permissions:** `vault:documents:read` (list / read / readBytes / getDownloadUrl / search), `vault:documents:write` (write / update / delete / attach / detach / upload)
|
|
669
669
|
**Returns:** `VaultDocumentsApi`
|
|
670
670
|
|
|
671
671
|
The Vault is the platform's persistent document store for the signed-in user. Distinct from `useFiasStorage` (per-plugin sandbox): Vault docs live in the user's My Data, survive plugin uninstall, and can be cross-referenced from other arches. Documents this arche creates are scoped to it (`source_arche_id`) and surfaced to the user under `/My-Fias/Arches/<archeId>/`.
|
|
@@ -698,6 +698,17 @@ const result = await vault.upload(bytes, {
|
|
|
698
698
|
});
|
|
699
699
|
// result.status transitions 'uploaded' → 'available' once indexed for search
|
|
700
700
|
|
|
701
|
+
// Read back the raw bytes of a document THIS arche created (any content
|
|
702
|
+
// type) — the reopen path for binary-processing plugins (e.g. a PDF editor
|
|
703
|
+
// reloading a saved PDF). Capped at 15 MB (OWN_DOCUMENT_TOO_LARGE names the
|
|
704
|
+
// cap) with its own tight per-minute budget: read sequentially and surface
|
|
705
|
+
// a RATE_LIMIT error verbatim instead of retrying in a loop. Documents this
|
|
706
|
+
// arche did NOT create reject with DOCUMENT_NOT_FOUND — the user's own
|
|
707
|
+
// files are reachable only through useVaultUserDocuments (picker consent).
|
|
708
|
+
// A document whose upload never finished rejects with OWN_DOCUMENT_NOT_READY
|
|
709
|
+
// but still appears in list() — don't assume every listed doc has bytes.
|
|
710
|
+
const { bytes: saved } = await vault.readBytes(documentId);
|
|
711
|
+
|
|
701
712
|
// Semantic search across documents this arche owns
|
|
702
713
|
// (burns user credits per the AI Markup Invariant — call sparingly)
|
|
703
714
|
const { matches } = await vault.search('quarterly revenue', { topK: 5 });
|
|
@@ -773,7 +784,7 @@ There are two declaration lanes, one shape:
|
|
|
773
784
|
```tsx
|
|
774
785
|
import { useFiasAIActions } from '@fias/arche-sdk';
|
|
775
786
|
|
|
776
|
-
useFiasAIActions({
|
|
787
|
+
const { openAssistant } = useFiasAIActions({
|
|
777
788
|
description: 'Once a document is open, the assistant can rotate its pages.',
|
|
778
789
|
actions: [
|
|
779
790
|
{
|
|
@@ -804,6 +815,7 @@ Rules that matter:
|
|
|
804
815
|
- `requiresConfirmation: true` makes the assistant ask the user before dispatching. It escalates only — nothing can skip a confirmation the platform requires.
|
|
805
816
|
- Manifest actions win id collisions with runtime ones; the merged list is capped at 50.
|
|
806
817
|
- The assistant is not present in the builder preview or the dev harness — declarations are accepted but nothing dispatches until the published plugin runs with the Fias AI window.
|
|
818
|
+
- **`openAssistant()`** (the hook's return) asks the HOST to open the Fias AI panel — use it for a contextual affordance (an empty-state "Ask Fias AI to get started" button). The host already shows its own "Works with Fias AI" chip, debounces your requests, and ignores them for a while after the user closes the panel — never call it in a loop or on mount. There is deliberately no way to pass text along: the assistant's input belongs to the user.
|
|
807
819
|
|
|
808
820
|
### `useArcheAssets()` — Contributor-published asset library
|
|
809
821
|
|