ReadAware

プラグインAPIリファレンス

このページでは、開発契約について説明します。開発契約は最新のリリースより先に進んでいる場合があります。末尾の完全なリファレンスには、すべてのケイパビリティについて、開発中のバージョンと最新リリースでのバージョン、必要な権限、各メソッドの解決済みシグネチャとドキュメントが記載されています。Capabilities Explorerでは、同じカタログを対話的に確認できます。公開プラグインリポジトリの型は最新リリースに準拠しています。

パッケージとマニフェスト

プラグインにはmanifest.jsonと、通常はmain.jsという自己完結したESモジュールが含まれます。レビューのため、ソースと必要なアセットをパッケージに含めてください。

フィールド意味
id, name, version安定した名前空間、表示名、パッケージバージョン。IDはフォルダー名と一致します。
schemaVersionプラグインのプライベートデータスキーマを表す正の整数。パッケージバージョンとは独立しています。
requires機能IDとsemver範囲。domains、contributions、services、schemasに分類します。
permissionslibrary:readやservice:llmなどの意味的な権限。
settingsAccess正確なパスまたは明示的なセクショングループに対する、個別のdiscover、read、write付与。
networkAccessNetwork 2.xで許可するHTTP(S)オリジン。service:networkと併せて必須です。
minAppVersion機能要件に加えて指定できる、アプリバージョンの下限。
main相対エントリモジュール。既定値はmain.jsです。
settings, schedules, themes, fontsホストが解釈する宣言。
servicesプラグイン間呼び出し用の、バージョン付き型付きモジュールサービスのエクスポート。

任意のファイルシステム、SQL、DOM、ネイティブIPCアクセスを付与するマニフェストフィールドはありません。

コンテキストとオブジェクトのスコープ

ホストはmanifest、ロケール、アプリバージョン、ライフサイクルフェーズ、機能バージョン、不変の本の付与とともに、ctx.domains、ctx.contributions、ctx.servicesを持つactivate(ctx)を呼び出します。

ctx.grants.bookはall、current、または指定されたbookです。ホストは同意を通じてこれを選択します。読み取り、メモリ、会話、コマンド、リソースは、呼び出しとコールバックをまたいでそのスコープを保持します。現在の本が変わると、保留中の読み取り、ハンドル、提案、観測が無効になることがあります。

ドメインの書き込み権限には読み取りが含まれます。設定の付与は操作ごとに独立しています。権限で保護された名前空間やメソッドは存在しない場合がありますが、ホスト側のチェックは呼び出しごとに実行されます。対応状況を事前確認するにはctx.services.session.operationAvailability(...)を使い、肯定的な結果の後でも実行失敗を処理してください。

ドメイン

ドメイン可能な処理境界
library本とコレクション、目次、正確な位置の検索、範囲、参照と画像、インポート、テキストタスク、メタデータ、重複統合、削除。ソースバージョン、本のスコープ、範囲付き読み取り、アクター所有タスク、個別のファイルクリーンアップレシート。
readingセッションスナップショット、ナビゲーション、選択、再生とモードの制御、進捗、読書時間、洞察。現在のセッションガード、確定済みと保留中の状態、プロバイダーの可用性、キャンセル。
annotationsページ、確認、観測、ハイライトやメモの作成、条件付き編集・削除バッチ。ユーザーの判断前に観測したリビジョンを使います。取得した範囲にはLibraryアクセスも必要です。
conversations許可されたトランスクリプト、保存済み概要、実行時とターン要求の状態、スレッド操作、提案されたターン。ホストの承認で提案ターンを開始します。グローバルスレッド操作には全書籍アクセスが必要です。プラグインはチャットランタイムを置き換えません。
settingsカタログの発見、解決済みスナップショット、選択肢、モデルメタデータ、観測、更新、読書リセット。正確なパス、対象ポリシー、外部プロバイダー処理に必要な追加権限。
memory検索とページ、確認、修正・忘却、プロフィール、エンティティ、分類、グラフとタスク、コンテキストアーカイブ。本の付与と条件付きリビジョン。グローバルなID/プロフィール操作には全書籍アクセスが必要で、生成にはモデル権限も必要です。

ソーステキストとナビゲーション

ナビゲーション可能なソース検索にはlibrary.queries.books.searchLocationsを、範囲付きのソーステキストにはreadRangeを使います。返されたソースバージョンと位置を保持してください。派生したsearchTextヒットはプレビューであり、ナビゲーションアンカーとして相互に置き換えられるものではありません。明示的なテキスト準備はタスクを返すため、その進捗と結果を観測する必要があります。

条件付き書き込み

編集を表示する前に現在のオブジェクトを確認し、そのリビジョンを保持します。そのリビジョンに対して条件付き変更を送信します。競合したら再読み込みしてユーザーに判断してもらいます。期待したリビジョンを黙って置き換えると、別の変更を上書きしてしまいます。

annotations.commands.applyChanges、メモリ変更、プライベートドキュメントのコミット、トランザクションプレビューには、それぞれ型付きの契約があります。通常のコマンドが自動的に取り消し可能になったり、分散トランザクションになったりすることはありません。

観測と反応

現在の状態には許可された観測を、イベントにはコミット済みのサブスクリプションを使います。シーケンス番号は配信順序を示せますが、データベースカーソルや条件付き書き込みのリビジョンではありません。観測の失敗は空の結果と区別できる状態に保ってください。

自動フォローアップ処理にはctx.withEvent(delivery)を使い、必要な因果サブスクリプションには安定したルールIDを使います。非同期呼び出しの間も束縛されたコンテキストを保持してください。ホストは因果サイクルと期限切れの配信を拒否します。独立したユーザー操作には元のコンテキストを使います。

コントリビューション

| コントリビューション| コントリビューション | プラグインが提供するもの | | --- | --- | | selectionActions, headerActions, contextActions, commands, uriHandlers | 型付きホスト画面のアクション、パレットコマンド、名前空間付きURI処理。 | | settingsOptions | 宣言したプラグイン設定の動的な選択肢。 | | voiceProviders, contentProviders, readerModes | 音声合成、仮想ブックのコンテンツ、同梱リーダーの分割モード。 | | agentTools, agentContextProviders, agentRetrievalProviders | ツール、ターンごとに範囲を限定したコンテキスト、検索可能なプラグイン所有ソース。 | | memoryCandidateProviders | ホストが検証・採用するメモリ候補。 | | themes, fonts | マニフェストで宣言する外観の選択肢。 | | syncTransports | 不透明な暗号化同期エンベロープとメタオブジェクトの保存。 |

対応するアクションは、サポートされる範囲で、所有する表示/有効/チェック状態を更新できます。登録と破棄処理は1つの有効化に属します。ビューを返しても、コールバックに追加のドメイン権限は与えられません。

メモリ候補と直接のMemoryコマンドは別経路です。候補はホストの採用処理を通り、直接コマンドには適切なMemory権限とリビジョンが必要です。いずれもシステムルールの注入やコアエージェントの置き換えは許可しません。

ホストサービス

| サービス| サービス | 用途 | 主な制限 | | --- | --- | --- | | storage | プライベートKV、ドキュメントコレクション、条件付きコミット、ページ、観測、利用ポリシー。 | プラグインの名前空間とクォータ。古いカーソルには新しい基準が必要です。 | | resources | ユーザーが選択したファイル/ディレクトリ、封印済みバイトハンドル、エクスポート、画像、プライベートバイナリアセット。 | 周囲のパスにはアクセスできません。ハンドルには所有者、制限、存続期間があります。 | | secrets | プラグイン専用の暗号化認証情報スロット。 | 他プラグインのシークレットにはアクセスできません。 | | network | オリジン単位のHTTP、範囲付きバッファリクエスト、ストリーミング。 | すべてのリダイレクトを確認します。任意の書き込みを自動再送しません。 | | llm | テキストまたは構造化推論、ストリーミング、画像リソース、リクエストレシート、予算。 | ユーザー設定、プライバシールール、キャンセル、ホスト/プロバイダー制限。 | | clipboard | テキストまたは封印済み画像を書き込みます。 | 明示的な権限と対応リソース型。 | | ui | ビュー、トースト、ネイティブ保存/オープンフロー、ワークスペースとコマンドのナビゲーション、リーダーパネルとウィンドウ。 | メソッド固有のドメイン権限とホスト所有の表示。 | | session | 機密でない環境メタデータと操作の可用性。 | 古い読書セッション購読はありません。Readingドメインを使います。 | | schedules | 宣言した定期ハンドラーと所有する延期リクエスト。 | アプリが開いている間だけ動作し、タイミングは正確ではありません。 | | jobs | 対応する永続プラン、チェックポイント、観測、制御。 | 型付きホスト操作であり、任意のJavaScript実行ではありません。 | | changes | スコープ付き永続変更カーソル。 | 更新ヒントであり、生のイベントログや履歴値ではありません。 | | transactions | プレビュー、コミット、レシート検索、条件付き取り消しのプレビュー。 | 対応するローカル操作と元の権限。不明な結果にはレシート検索が必要です。 | | plugins | 登録の確認、変更の観測、型付きプラグインサービスの発見と呼び出し。 | 呼び出し元/呼び出し先の権限の共通部分、スコープ、バージョン、分離されたサービス実行。 | | maintenance | 状態、ホスト所有のバックアップ、接続テスト、更新フロー。 | 認証情報、ファイルダイアログ、重要な確認はホストが保持します。 | | sync | 許可された同期状態、保留処理、ホスト管理のアカウント/同期フロー。 | 暗号化キーや生のアカウント認証情報にはアクセスできません。 | | diagnostics, logging | レビュー済みの診断エクスポートと範囲付き構造化開発イベント。 | 任意のコンテンツ、シークレット、ログAPI経由の自動報告はありません。 |

ネットワークと推論

Network 2.xにはNetwork 2.xには意味的な権限と明示的なオリジンの両方が必要です。

json
{
  "requires": { "services": { "network": "^2.2.0" } },
  "permissions": ["service:network"],
  "networkAccess": { "origins": ["https://api.example.com"] }
}

例のオリジンを、実際に使うエンドポイントに置き換えてください。オリジンにはスキーム、ホスト、ポートを含めます。URLパスやサブドメインのワイルドカードではありません。リダイレクトも許可済みでなければなりません。ストリーミングの呼び出し元は、完了時に所有するストリームを閉じます。任意の安全な再試行は、レスポンスが返る前の対応する読み取りリクエストに限られます。キャンセルはリモートの副作用をロールバックしません。

推論では、ホストがプライバシーとスコープのルールを適用できるよう、ブックコンテキストにreadingContextを使います。対応画像には封印済みリソースIDを使います。リクエストメタデータと出力予算は処理の制御に役立ちますが、請求書やプロバイダーの遵守を保証するものではありません。

バックグラウンド処理とトランザクション

ハンドラー呼び出しの予定にはハンドラー呼び出しの予定にはスケジュールを、アプリ実行中の後続処理には所有する延期リクエストを、型付きプランが操作に対応する場合だけ永続ジョブを使います。再起動からの復旧では、不確実な外部結果を盲目的に繰り返すのではなく、対応が必要になることがあります。

トランザクションは、元の権限のもとで対応する設定、プライベートドキュメント、ドメイン操作をまとめます。プレビューは提案した処理を固定し、コミットはそのプレビューを消費します。不明な応答の後は、再試行する前にレシートを確認してください。取り消しは、状態が以前の結果とまだ一致する場合に限り条件付きで行われます。

プラグイン間サービス

プロバイダーマニフェストでプロバイダーマニフェストでサービスID、バージョン、スコープ、必要な権限、入出力スキーマを宣言し、モジュールのservicesオブジェクトでハンドラーをエクスポートします。Pluginsサービスを通じて発見・呼び出しを行います。ホストは交差した権限を持つ新しい分離サービス領域で実行し、呼び出しのためにプロバイダーの通常UIランタイムを有効化しません。エージェント起点の呼び出しには承認要件が維持されます。

ビュー、設定、テーマ、フォント

プラグインは宣言的なビュープラグインは宣言的なビューのデータを返します。ホストはリスト、フォーム、Markdown、詳細、対応ブロックレイアウトを描画します。型付きビュー結果とライブビュー更新を使い、読み込み中、競合、空、エラーの状態を区別してください。プラグインコードからReact、DOM、iframe、任意のCSSは利用できません。

設定フィールドはホストが描画します。シークレットフィールドは暗号化されたシークレットスロットに書き込まれ、通常のフォーム値やモデルから見える設定にはなりません。テーマやフォントの提供にはui:themesが必要で、選択には対応するSettings書き込み付与を使います。

ライフサイクルと互換性

  1. **有効化中:**1. 有効化中: 対応する読み取りと登録。ステージされたコントリビューションはまだ表示されません。
  2. 移行中: 変更されたスキーマをコミットする前の、プライベートストレージのみ。
  3. アクティブ: 昇格されたハンドラーが付与された機能を使えます。

ホストは有効化と移行が成功した後に候補をヘルスチェックして昇格します。失敗すると、以前のパッケージとデータを復元します。アンロードでは登録、コールバック、所有リソースを解放します。永続データは別の保持契約に従います。現在の開発版では、アンインストールでプライベートドキュメントコレクションとバイナリアセットを削除し、再インストールに備えて定義済みのKV/シークレット/スキーマ状態を保持します。

使用する各機能とスキーマを個別に宣言してください。バージョン番号は契約互換性を示すだけで、すべてのOS、プロバイダー、障害ケースがエンドツーエンドで受け入れ済みであることを示しません。実際に出荷するデスクトップワークフローを確認してください。

プラグインをビルドする · Capabilities Explorer · 公開

完全リファレンス

開発契約のすべての機能をファミリーごとにグループ化したものです。現在ユーザーが使用しているアプリ向けのプラグインは、最新リリースに記載されているバージョンを必須とすべきです。

ドメイン

domains:library

本、ソーステキスト、目次、正確な位置、範囲、画像、コレクションを確認し、インポート、整理、テキストタスクを管理します。

  • 開発:v1.35.0
  • ReadAware 0.6.8: v1.35.0
  • 権限: library:read / library:write
ctx.domains.library.commands.books.addVirtualBook
(input: { providerId: string; key: string; title: string; author?: string; }): Promise<BookSummary>
ctx.domains.library.commands.books.cancelImportTask
(taskId: string): Promise<BookImportTaskSnapshot>
ctx.domains.library.commands.books.cancelTextTask
(bookId: string, taskId: string): Promise<BookTextTaskSnapshot>

Cancels only this activation's request; shared work or dispatched writes may continue.

ctx.domains.library.commands.books.editMetadata
(bookId: string, patch: { title?: string; author?: string; }): Promise<void>
ctx.domains.library.commands.books.importBook
(input: { fileName: string; data: ArrayBuffer | Uint8Array; }, options?: PluginCallOptions): Promise<BookSummary>
ctx.domains.library.commands.books.importResource
(id: string, options?: PluginCallOptions): Promise<BookImportReceipt>

Library 1.19 adds per-call cancellation. Before the first durable write, cancellation prevents admission; afterward await the actual imported/duplicate receipt or failure. No whole-file transfer, opening or resource release.

ctx.domains.library.commands.books.invalidateVirtualBook
(input: { providerId: string; key: string; }): Promise<{ bookId: string; revision: string; }>

Announce already-saved source changes. Does not reload or move the reader. revision is a process-local invalidation fence, not a content hash. Library 1.15.

ctx.domains.library.commands.books.mergeDuplicates
(input: BookMergeRequest): Promise<BookMergeReceipt>

Conditional record merge with the host's deterministic keeper; not file deletion or undo.

ctx.domains.library.commands.books.pauseTextTask
(bookId: string, taskId: string): Promise<BookTextTaskSnapshot>
ctx.domains.library.commands.books.prepareText
(bookId: string, options?: BookTextPrepareOptions): Promise<BookTextTaskSnapshot>

Library 1.31: starts an actor-owned background request. A receipt is not completion. Current-book grants fence admission and the lease through pause/resume; switching books cancels only this request, without undoing accepted writes.

ctx.domains.library.commands.books.remove
(bookId: string): Promise<void>
ctx.domains.library.commands.books.removeMany
(bookIds: string[]): Promise<BookRemovalReceipt>

1-1000 IDs, deduplicated. Atomic record deletion; local file release is separately reported.

ctx.domains.library.commands.books.removeVirtualBook
(input: { providerId: string; key: string; expectedBookId?: string; }): Promise<void>
ctx.domains.library.commands.books.resumeTextTask
(bookId: string, taskId: string): Promise<BookTextTaskSnapshot>

Library 1.21: reacquires this paused request using saved checkpoints and the same handle.

ctx.domains.library.commands.books.retryEnrichment
(bookId: string): Promise<BookEnrichmentReceipt>

Retry unchecked covers and missing/filename-derived metadata using the shared queue, without forcing replacement or download.

ctx.domains.library.commands.books.retryRemovalCleanup
(bookIds: string[]): Promise<BookFileReleaseReceipt>

Retry file release only. Refuses any ID now present in the library; never deletes records.

ctx.domains.library.commands.books.setStarred
(bookId: string, starred: boolean): Promise<void>
ctx.domains.library.commands.books.setTextTaskPriority
(bookId: string, taskId: string, priority: BookTextPriority): Promise<BookTextTaskSnapshot>

Library 1.21: pauses only this request by releasing its lease; other consumers and dispatched I/O may continue.

ctx.domains.library.commands.books.startImport
(input: BookImportRequest, options?: PluginCallOptions): Promise<BookImportTaskSnapshot>

Start a task over owned sealed resources or <=64 MiB file bytes (wire limits still apply). Queued is not imported. options.signal cancels admission only; use cancelImportTask after the receipt. At most 2 physical task executions per activation, 4 in the app; direct imports/picker jobs are outside this task quota. Tasks do not resume after restart. Accepted writes finish despite cancellation.

ctx.domains.library.commands.collections.assignBooks
(bookIds: string[], collectionId: string | null): Promise<void>
ctx.domains.library.commands.collections.create
(name: string): Promise<CollectionSummary>
ctx.domains.library.commands.collections.remove
(collectionId: string): Promise<void>
ctx.domains.library.commands.collections.rename
(collectionId: string, name: string): Promise<void>
ctx.domains.library.events.observeContentState
(bookId: string, handler: PluginObservationHandler<BookContentObservation>, options?: { ruleId?: string; }): PluginDisposable
ctx.domains.library.events.observeEnrichment
(bookId: string, handler: PluginObservationHandler<BookEnrichmentObservation>, options?: { ruleId?: string; }): PluginDisposable
ctx.domains.library.events.observeImportTask
(taskId: string, handler: PluginObservationHandler<BookImportTaskSnapshot>, options?: { ruleId?: string; }): PluginDisposable

Initial snapshot and coalesced monotonic revisions, including terminal failures.

ctx.domains.library.events.observeInvalidation
(handler: PluginObservationHandler<ProjectionInvalidation>): PluginDisposable

Initial and coalesced reload hints, including remote projection changes. Re-query authorized data; not an event log or a conditional-write token.

ctx.domains.library.events.observeTextTask
(bookId: string, taskId: string, handler: PluginObservationHandler<BookTextTaskSnapshot>, options?: { ruleId?: string; }): PluginDisposable

Library 1.32: serial reaction deliveries retain task and history-write sources.

ctx.domains.library.events.subscribe
<K>(event: K, handler: (event: PluginDomainEvent<K>) => unknown, options?: { ignoreSelf?: boolean; ruleId?: string; }): PluginDisposable
ctx.domains.library.queries.books.get
(bookId: string): Promise<BookSummary | null>
ctx.domains.library.queries.books.getChapterText
(bookId: string, chapterIndex: number): Promise<string | null>
ctx.domains.library.queries.books.getContentState
(bookId: string, options?: PluginCallOptions): Promise<BookContentState>

Source metadata only; never loads a provider or reveals reading state. Library 1.16.

ctx.domains.library.queries.books.getEnrichment
(bookId: string): Promise<BookEnrichmentSnapshot>

Library 1.9: local cover/source state and the latest process-local enrichment attempt.

ctx.domains.library.queries.books.getImportTask
(taskId: string, waitMs?: number, options?: PluginCallOptions): Promise<BookImportTaskSnapshot>

waitMs (0..30000) waits for terminal state or returns current progress at the deadline. Cancelling this query stops observation only.

ctx.domains.library.queries.books.getNavigationToc
(bookId: string, options?: PluginCallOptions): Promise<BookNavigationToc>
ctx.domains.library.queries.books.getTextState
(bookId: string): Promise<BookTextSnapshot>

Read-only derived-text state. Never starts parsing, fetching, or extraction.

ctx.domains.library.queries.books.getTextTask
(bookId: string, taskId: string): Promise<BookTextTaskSnapshot>
ctx.domains.library.queries.books.getToc
(bookId: string): Promise<ChapterRef[]>
ctx.domains.library.queries.books.inspectResource
(id: string, options?: PluginCallOptions): Promise<BookInspection>

Initialize this activation's sealed resource with the reader parser; no import.

ctx.domains.library.queries.books.list
(): Promise<BookSummary[]>
ctx.domains.library.queries.books.listDuplicates
(query?: DuplicateBookQuery): Promise<DuplicateBookPage>

Library 1.10: same-content groups; live offset pages, limit 1-50.

ctx.domains.library.queries.books.listFormats
(): Promise<BookFormatCapability[]>

Library 1.11: import routing hints; extensions alone do not prove readability.

ctx.domains.library.queries.books.listImages
(input: BookReferencesQuery, options?: PluginCallOptions): Promise<BookImagesPage>

Library 1.29: section-local img/SVG, srcset/authored CSS and PDF image candidates. No remote fetch; PDF operator inspection can decode objects.

ctx.domains.library.queries.books.listImportTasks
(): Promise<BookImportTaskSnapshot[]>
ctx.domains.library.queries.books.listNavigationTargets
(input: BookNavigationTargetsQuery, options?: PluginCallOptions): Promise<BookNavigationTargetsPage>

Library 1.14: bounded source-section or author-supplied page-label catalog; not screen page counts.

ctx.domains.library.queries.books.listReferences
(input: BookReferencesQuery, options?: PluginCallOptions): Promise<BookReferencesPage>

Library 1.12: versioned section references, not extracted chapter indices.

ctx.domains.library.queries.books.listRemovalCleanup
(query?: BookRemovalCleanupQuery): Promise<BookRemovalCleanupPage>

Durable device-local pending file cleanup, including after view/plugin restart. Live keyset page, limit 1-100 (default 50).

ctx.domains.library.queries.books.listTextTaskHistory
(bookId: string, query?: BookTextTaskHistoryQuery): Promise<BookTextTaskHistoryPage>
ctx.domains.library.queries.books.listTextTasks
(bookId: string): Promise<BookTextTaskSnapshot[]>
ctx.domains.library.queries.books.openImageResource
(input: BookImageQuery): Promise<BookImageResource>

Seal an embedded image as this activation's ResourceRef; does not display it or decode pixels.

ctx.domains.library.queries.books.previewMerge
(bookId: string): Promise<BookMergePreview | null>
ctx.domains.library.queries.books.readRange
(input: BookRangeQuery, options?: PluginCallOptions): Promise<BookRangePage>
ctx.domains.library.queries.books.readReference
(input: BookReferenceQuery, options?: PluginCallOptions): Promise<BookReferencePreview>

Plain-text preview and resolved navigation location; never fetches or opens an external URL.

ctx.domains.library.queries.books.resolveId
(bookId: string): Promise<string | null>

Current book ID or merge redirect, null if neither points to a living book.

ctx.domains.library.queries.books.searchLocations
(input: BookLocationSearch, options?: PluginCallOptions): Promise<BookLocationSearchPage>
ctx.domains.library.queries.books.searchText
(input: BookTextSearch, options?: PluginCallOptions): Promise<BookTextHit[]>

Multi-query derived prose search. Single-book may prepare text; shelf search never does. Results are not navigation locations.

ctx.domains.library.queries.collections.booksIn
(collectionId: string): Promise<string[]>
ctx.domains.library.queries.collections.list
(): Promise<CollectionSummary[]>

domains:reading

読書セッションを観測し、テキストを移動・選択し、再生とモードを制御し、進捗、時間、洞察を照会します。

  • 開発:v2.24.0
  • ReadAware 0.6.8: v2.24.0
  • 権限: reading:read / reading:write
ctx.domains.reading.commands.back
(guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>
ctx.domains.reading.commands.clearSelection
(expectedId: string, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingSelectionReceipt>

Clears only the observed selection ID; a replacement selection is never silently cleared.

ctx.domains.reading.commands.close
(guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<void>
ctx.domains.reading.commands.configureMode
(input: ReadingModeConfiguration, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingModeReceipt>

Configure the host mode; modeKey guards the current provider, selectModeKey selects from session().mode.availableModes. Resolves after real indexing (ready/empty) or deactivation. Failed indexing rejects. Disabling the caller cancels an unfinished change; completed mode preferences remain.

ctx.domains.reading.commands.controlPlayback
(action: "start" | "stop", guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingPlaybackReceipt>

Start resolves on actual audio start. Stop is idempotent; disabling the initiating plugin stops its playback.

ctx.domains.reading.commands.forward
(guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>
ctx.domains.reading.commands.goTo
(target: ReadingTarget, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>
ctx.domains.reading.commands.openBook
(bookId: string, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>
ctx.domains.reading.commands.putEmphasis
(input: ReadingEmphasisWrite, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingEmphasisReceipt>

Temporary owned marks, not annotations. No navigation; replacement requires an observed revision.

ctx.domains.reading.commands.reload
(guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>

Reading 2.21: reopen source; virtual sections with identical stable identity/content preserve their location across reorder. Stale/legacy virtual locators restart at the beginning; files still restart. Whole-book contentVersion guards remain strict.

ctx.domains.reading.commands.removeEmphasis
(input: ReadingEmphasisRef, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingEmphasisRemoval>
ctx.domains.reading.commands.returnToMode
(guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>

Return to the versioned resting unit; wait for renderer navigation and unit restoration before committing history.

ctx.domains.reading.commands.selectRange
(range: BookTextRange, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingSelectionReceipt>

Requires this book to be open; validates its source range, navigates, then waits for the selection overlay commit.

ctx.domains.reading.commands.setControls
(visible: boolean, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingControlsReceipt>

Set reader chrome visibility; completes after UI commit. Does not alter panel preferences or playback.

ctx.domains.reading.commands.setFinished
(bookId: string, finished: boolean): Promise<void>
ctx.domains.reading.commands.step
(direction: ReadingStep, guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingNavigationReceipt>

Reading 2.12: page, source-section and book-boundary navigation; section/boundary jumps enter history.

ctx.domains.reading.commands.stepMode
(direction: "next" | "previous", guard?: ReadingSessionGuard, options?: PluginCallOptions): Promise<ReadingModeStepReceipt>

Step one configured text unit, across sections if necessary; reports book boundaries explicitly.

ctx.domains.reading.events.observeEmphasis
(handler: (snapshot: ReadingEmphasisSnapshot[], delivery?: PluginReactionEvent) => void | Promise<void>): PluginDisposable
ctx.domains.reading.events.observeSession
(handler: (snapshot: ReadingSessionSnapshot, delivery?: PluginReactionEvent) => void | Promise<void>, options?: { ruleId?: string; }): PluginDisposable

Immediate and subsequent snapshots carry a live reaction lease. Use withEvent for automatic writes; keep the original context for later user actions. A stable ruleId can resume job causality across activations.

ctx.domains.reading.events.observeTime
(query: ReadingTimeQuery, handler: (event: ReadingTimeObservation, delivery?: PluginReactionEvent) => void | Promise<void>, options?: { ruleId?: string; }): PluginDisposable

Immediate sample then a 1s minimum gap after each delivery. Errors are explicit; dispose stops further delivery. Reading 2.24: delivery retains sampling subscription ancestry across timers. It does not identify historical writers of the aggregate.

ctx.domains.reading.events.subscribe
<K>(event: K, handler: (event: PluginDomainEvent<K>) => unknown, options?: { ignoreSelf?: boolean; ruleId?: string; }): PluginDisposable
ctx.domains.reading.queries.emphasis
(): Promise<ReadingEmphasisSnapshot[]>

This activation's temporary marks only; attached does not mean visible in the viewport.

ctx.domains.reading.queries.session
(): Promise<ReadingSessionSnapshot>
ctx.domains.reading.queries.stats.forBook
(bookId: string): Promise<BookStats | null>
ctx.domains.reading.queries.stats.insights
(query?: ReadingInsightsQuery): Promise<ReadingInsights>
ctx.domains.reading.queries.stats.list
(): Promise<BookStats[]>
ctx.domains.reading.queries.stats.overview
(): Promise<StatsOverview>
ctx.domains.reading.queries.stats.time
(query?: ReadingTimeQuery): Promise<ReadingTimeSnapshot>

Atomic settled + pending time, with native sampling clock. Reading >=2.7.

domains:annotations

ハイライトとメモをページ表示、確認、観測し、作成したり、リビジョンを検証して編集・削除したりします。

  • 開発:v2.2.0
  • ReadAware 0.6.8: v2.2.0
  • 権限: annotations:read / annotations:write
ctx.domains.annotations.commands.applyChanges
(changes: AnnotationMutation[]): Promise<AnnotationCommitResult>

Since 2.0 this is the only edit/delete entry. Use the revision observed before the user's decision; 1..100 distinct items, all commit or none.

ctx.domains.annotations.commands.createHighlight
(input: { range?: BookTextRange; bookId: string; text: string; anchor?: string | null; chapterHref?: string | null; color?: HighlightColor; style?: HighlightStyle; }): Promise<HighlightItem>

annotations >=2.1: range validates and preserves the captured source; requires library:read.

ctx.domains.annotations.commands.createNote
(input: { range?: BookTextRange; bookId: string; body: string; quotedText?: string; anchor?: string | null; chapterHref?: string | null; }): Promise<NoteItem>
ctx.domains.annotations.events.observe
(query: AnnotationObservationQuery, handler: PluginObservationHandler<AnnotationObservation>): PluginDisposable

Since 1.4. Initial authorized snapshot, then changed results/errors/recovery. Disposal ends polling.

ctx.domains.annotations.events.subscribe
<K>(event: K, handler: (event: PluginDomainEvent<K>) => unknown, options?: { ignoreSelf?: boolean; ruleId?: string; }): PluginDisposable
ctx.domains.annotations.queries.get
(annotationId: string): Promise<AnnotationItem | null>

annotations >=1.1.0. Missing IDs return null; read failures reject.

ctx.domains.annotations.queries.inspect
(annotationId: string): Promise<AnnotationSnapshot | null>

annotations >=1.3.0. Read an item and its conditional-write token atomically.

ctx.domains.annotations.queries.list
(filter?: { bookId?: string; kind?: "highlight" | "note" | "ask"; query?: string; }): Promise<AnnotationItem[]>
ctx.domains.annotations.queries.page
(input?: AnnotationPageQuery): Promise<AnnotationPage>

annotations >=1.2.0. Live keyset page, not a frozen snapshot across calls.

domains:conversations

許可されたトランスクリプト、概要、実行時状態を読み取り、ターンを提案し、スレッドを管理し、承認済みの停止・消去操作を使います。

  • 開発:v1.6.0
  • ReadAware 0.6.8: v1.6.0
  • 権限: conversations:read / conversations:write
ctx.domains.conversations.commands.cancelTurnRequest
(id: string): Promise<ConversationTurnRequestSnapshot>
ctx.domains.conversations.commands.clear
(target: ConversationTarget): Promise<ConversationControlReceipt>

Clears transcript/hidden thread state after draining turns, not long-term memory or event history.

ctx.domains.conversations.commands.createThread
(): Promise<ConversationControlReceipt & { draft: true; }>

Creates and selects a global draft; no transcript row until the first message. Does not navigate the app.

ctx.domains.conversations.commands.requestTurn
(request: ConversationTurnRequest): Promise<ConversationTurnRequestSnapshot>

Requires a mounted conversation. Only a host UI confirmation can adopt/send/retry; receipt is not a completed turn.

ctx.domains.conversations.commands.selectThread
(threadId: string): Promise<ConversationControlReceipt>
ctx.domains.conversations.commands.stop
(target: ConversationTarget): Promise<ConversationControlReceipt>

Stops live UI turns and waits for their final transcript writes. Does not undo tool effects.

ctx.domains.conversations.events.observeInvalidation
(handler: PluginObservationHandler<ProjectionInvalidation>): PluginDisposable
ctx.domains.conversations.events.observeRuntime
(handler: PluginObservationHandler<PluginConversationRuntimeSnapshot>, options?: { ruleId?: string; }): PluginDisposable

Conversations 1.6: serial reaction deliveries, with an optional stable rule ID.

ctx.domains.conversations.events.subscribe
<K>(event: K, handler: (event: PluginDomainEvent<K>) => unknown, options?: { ignoreSelf?: boolean; ruleId?: string; }): PluginDisposable
ctx.domains.conversations.queries.getBookThread
(bookId: string): Promise<ChatMessageSummary[]>
ctx.domains.conversations.queries.getInsights
(target: ConversationTarget): Promise<string | null>

Conversations 1.4: stored rolling summary of a book/global thread, or null. No generation, freshness guarantee, raw runtime state or summary writes.

ctx.domains.conversations.queries.getThread
(threadId: string): Promise<ChatMessageSummary[]>
ctx.domains.conversations.queries.listThreads
(): Promise<ThreadSummary[]>
ctx.domains.conversations.queries.runtime
(): Promise<PluginConversationRuntimeSnapshot>
ctx.domains.conversations.queries.turnRequests
(): Promise<ConversationTurnRequestSnapshot[]>

Up to 128 recently retained host requests, filtered to this actor; no text or other actors' requests.

domains:settings

正確な設定パスと選択肢を発見し、確定済みスナップショットを読み、変更を観測し、対応する対象を更新します。

  • 開発:v1.11.0
  • ReadAware 0.6.8: v1.11.0
  • 権限: なし
ctx.domains.settings.commands.refreshModelCatalog
(provider: string, options?: PluginCallOptions): Promise<ModelCatalogPage>

Settings 1.9: additionally requires service:network. Shared native refresh, not a connection test.

ctx.domains.settings.commands.resetReading
(request: ReadingSettingsReset): Promise<SettingsUpdateResult>

Settings 1.7: reset the whole reader-preference bundle; every reading path must be writable. defaults restores built-ins; inherit deletes active and remembered book overrides.

ctx.domains.settings.commands.update
(changes: SettingChange[]): Promise<SettingsUpdateResult>
ctx.domains.settings.events.subscribe
(handler: (event: SettingsChangedEvent & PluginReactionEvent) => unknown, options?: { ignoreSelf?: boolean; ruleId?: string; }): PluginDisposable
ctx.domains.settings.queries.discover
(query?: SettingsQuery): Promise<SettingCatalogEntry[]>
ctx.domains.settings.queries.modelCatalog
(query: ModelCatalogQuery): Promise<ModelCatalogPage>

Settings 1.9: cached public model metadata; discover access to primaryModel or fastModel. No network.

ctx.domains.settings.queries.observe
(query: SettingsQuery, handler: PluginObservationHandler<SettingsObservation>): PluginDisposable

Settled snapshots after native, domain, remote, restore and catalog changes. Coalesces slow callbacks.

ctx.domains.settings.queries.options
(query: SettingsOptionsQuery): Promise<SettingsOptionsPage>

Settings 1.8: bounded options; same path grants as discover. Includes installed system families for reading/content fonts without font paths or bytes. Since 1.10, dynamicOptions fields invoke the registered owning provider with saved non-secret form values, never caller-supplied values. Network-enabled providers additionally require this caller's service:network permission. Results are cached for 60 seconds, at most 16 lists / 2000 options per list, 512 characters per label/value and 1 MiB of label/value JSON. Pages retain the returned revision; changed settings/provider or expiry require restart. Four provider loads host-wide, 10-second wait; already-started provider work is not cancelled by this deadline or caller retirement. No writes/synthesis. Plugin-owned option queries require the caller's active phase, not activation/migration. Empty results still allow manual values; provider failures remain failures.

ctx.domains.settings.queries.read
(path: string, target?: SettingsQueryTarget): Promise<SettingReadResult>
ctx.domains.settings.queries.snapshot
(query?: SettingsQuery): Promise<SettingsSnapshot>

Since settings 1.3: one host snapshot after prior queued writes settle, filtered by exact path grants.

domains:memory

メモリを検索、ページ表示、確認、修正し、プロフィール、エンティティ、分類、グラフ、バージョン付きコンテキストバンドルを扱います。

  • 開発:v2.8.0
  • ReadAware 0.6.8: v2.8.0
  • 権限: memory:read / memory:write
ctx.domains.memory.commands.cancelGraphTask
(bookId: string, taskId: string): Promise<BookGraphTaskSnapshot>
ctx.domains.memory.commands.classify
(input: BookClassificationChange): Promise<BookClassificationReceipt>
ctx.domains.memory.commands.completeOnboarding
(input: OnboardingChange, options?: PluginCallOptions): Promise<OnboardingReceipt>

Memory 2.5: confirm the full summary AND seeds before calling. Reuse the same owner-local submissionId and exact candidate after a lost receipt; a different candidate requires a new id and renewed confirmation. Atomic, event-backed.

ctx.domains.memory.commands.context.capture
(selector: ContextBundleSelector, options?: PluginCallOptions): Promise<ContextBundleCaptureReceipt>
ctx.domains.memory.commands.decideEntity
(input: EntityDecision, options?: PluginCallOptions): Promise<EntityDecisionReceipt>

Memory 2.1: resolve an original member or merge known resolved classes using an observed entities1 revision. Present the exact change for confirmation first. Retains original definitions/aliases, may sync to other devices. No blind conflict retry. Cancellation prevents dispatch only; dispatched writes drain to their actual receipt. A transport timeout or lost Worker leaves the outcome unknown: reread, never retry blindly.

ctx.domains.memory.commands.mutate
(input: MemoryMutation): Promise<MemoryMutationReceipt>
ctx.domains.memory.commands.retryGraphTask
(bookId: string, taskId: string, options?: BookGraphTaskOptions): Promise<BookGraphTaskSnapshot>
ctx.domains.memory.commands.startGraphTask
(bookId: string, mode: "catch-up" | "rebuild", options?: BookGraphTaskOptions): Promise<BookGraphTaskSnapshot>
ctx.domains.memory.commands.updateProfile
(input: UserProfileChange): Promise<UserProfileReceipt>

Replace the event-backed summary using the observed profile2 revision. Present the complete candidate for user confirmation before calling. Empty text clears the summary, not memories or historical copies.

ctx.domains.memory.events.observe
(query: MemoryObservationQuery, handler: PluginObservationHandler<MemoryObservation>): PluginDisposable

Initial snapshot, then changed results/errors; bounded polling, not an event log. Plugins 1.5 supplies a separate reaction delivery, including graph task updates.

ctx.domains.memory.queries.bookGraph
(bookId: string, query?: BookGraphQuery): Promise<BookGraphResult>

memory >=2.6 only exposes current-source digests; chapter results carry contentVersion for navigation.

ctx.domains.memory.queries.classification
(bookId: string): Promise<BookClassificationSnapshot | null>
ctx.domains.memory.queries.context.export
(query: ContextBundleReadQuery, options?: PluginCallOptions): Promise<ResourceRef>
ctx.domains.memory.queries.context.history
(query: ContextBundleHistoryQuery, options?: PluginCallOptions): Promise<ContextBundleHistoryPage>
ctx.domains.memory.queries.context.read
(query: ContextBundleReadQuery, options?: PluginCallOptions): Promise<ContextBundle | null>
ctx.domains.memory.queries.entities
(query?: EntityQuery, options?: PluginCallOptions): Promise<EntityPage>

Global explicit identities, not book-digest characters. Row-bounded, revision-pinned pages. Memory 2.2 adds canonicalDefinition from the same snapshot. Historical field sizes are not bounded. Aborted/retired callers receive no late page.

ctx.domains.memory.queries.getGraphTask
(bookId: string, taskId: string): Promise<BookGraphTaskSnapshot>
ctx.domains.memory.queries.inspect
(id: string): Promise<MemorySnapshot | null>
ctx.domains.memory.queries.listGraphTasks
(bookId: string): Promise<BookGraphTaskSnapshot[]>
ctx.domains.memory.queries.page
(input: MemoryPageQuery): Promise<MemoryPage>
ctx.domains.memory.queries.profile
(query?: UserProfileQuery): Promise<UserProfilePage>

The event-backed summary projection; read grant, bounded revision-pinned pages.

ctx.domains.memory.queries.profileContext
(query?: ProfileInspectionQuery, options?: PluginCallOptions): Promise<ProfileInspectionPage>

Memory 2.3: inspect the generated summary and provenance, separately from curated profile(). Summary pages count UTF-16 units (4000 default, 16000 max); provenance pages count rows (25 default, 100 max; historical ID sizes are unbounded). Pin every page kind to pctx1. Stale text is inspectable, never current context. Invalid blocks expose no content. Current means source-consistent, not semantic verification or completed consolidation. entityEvidence IDs include proposed no-ops, not proof of emitted events. Read grant; no source text, transcripts, raw traits, registry writes or automatic inference.

ctx.domains.memory.queries.search
(input: MemoryQuery): Promise<MemoryRecord[]>

コントリビューション

contributions:uriHandlers

登録したアクションを通じて名前空間付きReadAware URI呼び出しを処理します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.uriHandlers.register
(handler: PluginUriHandler): PluginActionRegistration

contributions:selectionActions

取得した選択範囲、注釈、ナビゲーター入力向けのアクションを追加します。

  • 開発:v1.2.0
  • ReadAware 0.6.8: v1.2.0
  • 権限: なし
ctx.contributions.selectionActions.register
(action: PluginSelectionAction): PluginActionRegistration

contributions:headerActions

リーダー、ライブラリ、エージェントのヘッダーアクションとホスト描画ビューを追加します。

  • 開発:v1.2.0
  • ReadAware 0.6.8: v1.2.0
  • 権限: なし
ctx.contributions.headerActions.register
(action: PluginHeaderAction): PluginActionRegistration

contributions:contextActions

対応する本またはコレクションのコンテキスト画面に型付きアクションを追加します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.contextActions.register
(action: PluginContextAction): PluginActionRegistration

contributions:commands

名前空間付きコマンドパレットアクションを追加し、所有する状態を更新します。

  • 開発:v1.1.0
  • ReadAware 0.6.8: v1.1.0
  • 権限: なし
ctx.contributions.commands.register
(command: PluginCommand): PluginActionRegistration

contributions:settingsOptions

宣言したプラグイン設定の動的な選択肢を解決します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.settingsOptions.register
(fieldId: string, provider: (values: PluginFormValues) => PluginSelectOption[] | Promise<PluginSelectOption[]>): PluginDisposable

contributions:settingsPage

プラグインのマニフェスト設定フォームを置き換える宣言的なページを1つ、プラグイン自身の設定セクションに登録します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.settingsPage.register
(page: { view(): PluginView | Promise<PluginView>; }): PluginDisposable

contributions:voiceProviders

読み上げ用の音声選択肢とエンコード済み音声を提供します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.voiceProviders.register
(provider: PluginVoiceProvider): PluginDisposable

contributions:contentProviders

保存済みフィードなどの仮想ブック向けセクションを提供します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.contributions.contentProviders.register
(provider: { id: string; load(key: string): Promise<PluginBookContent>; }): PluginDisposable

contributions:agentTools

読書アシスタントが発見・呼び出しできる名前空間付きツールを登録します。

  • 開発:v1.3.0
  • ReadAware 0.6.8: v1.3.0
  • 権限: agent:tools
ctx.contributions.agentTools.register
(tool: PluginToolDefinition): PluginActionRegistration

contributions:agentContextProviders

ターンごとに範囲を限定した参照ブロックと、宣言済みの読書意図ソースを提供します。

  • 開発:v1.1.0
  • ReadAware 0.6.8: v1.1.0
  • 権限: agent:context
ctx.contributions.agentContextProviders.register
(provider: PluginAgentContextProvider): PluginDisposable

contributions:agentRetrievalProviders

検索可能なプラグイン所有ソースをアシスタントに公開します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: agent:retrieval
ctx.contributions.agentRetrievalProviders.register
(provider: PluginAgentRetrievalProvider): PluginDisposable

contributions:memoryCandidateProviders

メモリとして採用する事実、嗜好、洞察、概要の候補を提案します。

  • 開発:v1.1.0
  • ReadAware 0.6.8: v1.1.0
  • 権限: agent:memory
ctx.contributions.memoryCandidateProviders.register
(provider: PluginMemoryCandidateProvider): PluginDisposable

contributions:themes

マニフェストでアプリとリーダーの意味的なテーマ選択肢を宣言します。

  • 開発:v1.2.0
  • ReadAware 0.6.8: v1.2.0
  • 権限: ui:themes
ctx.contributions.themes.readerBases
(): Promise<PluginReaderThemeBase[]>

Themes 1.2: built-in and active plugin reader bases, excluding image themes. Saved copies do not change when the original theme changes.

ctx.contributions.themes.register
(theme: PluginRuntimeTheme): Promise<PluginDisposable>

contributions:fonts

フォントのメタデータとパッケージ済みフォントアセットを宣言します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: ui:themes

Manifest宣言

contributions:syncTransports

不透明な暗号化イベント、blob、鍵素材メタオブジェクトを別のリモートに保存・取得します。

  • 開発:v2.0.0
  • ReadAware 0.6.8: v2.0.0
  • 権限: sync:transport
ctx.contributions.syncTransports.register
(transport: PluginSyncTransport): PluginDisposable

サービス

services:storage

プライベートKVとドキュメントコレクション、ページ、観測、条件付きコミット、クォータポリシーを使います。

  • 開発:v2.6.0
  • ReadAware 0.6.8: v2.6.0
  • 権限: なし
ctx.services.storage.applyDocuments
(changes: PluginDocumentChange[]): Promise<PluginDocumentCommit>

Storage 2.1: atomically compare and apply 1..100 private document changes. Every expected revision is checked before any write. Does not include KV, core domain events, files, or another plugin's documents.

ctx.services.storage.collection
(name: string): PluginDocumentCollection

A named document collection — structured plugin-private data one tier above the KV (queryable, per-document, optionally book-anchored). Backed by the app's local store; lifecycle belongs to the plugin (uninstall clears it). bookId/anchor are provenance INDEXES, not ownership — documents survive the referenced book's deletion.

ctx.services.storage.documents(collection).delete
(id: string): Promise<void>
ctx.services.storage.documents(collection).get
<T>(id: string): Promise<PluginDocument<T> | null>
ctx.services.storage.documents(collection).list
<T>(filter?: { bookId?: string; limit?: number; oldestFirst?: boolean; }): Promise<PluginDocument<T>[]>

Newest-first by default.

ctx.services.storage.documents(collection).page
<T>(filter?: PluginDocumentPageFilter): Promise<PluginDocumentPage<T>>

Storage 2.1: 1..200 rows (default 50), 4 MiB JSON per page. Cursors bind namespace/filter/order and expire on any collection write. On stale-cursor restart rather than combining different snapshots.

ctx.services.storage.documents(collection).put
(id: string, data: unknown, options?: { bookId?: string; anchor?: string; }): Promise<void>
ctx.services.storage.flush
(): Promise<void>

Wait for outstanding writes in this plugin's namespace.

ctx.services.storage.get
<T>(key: string): T | null
ctx.services.storage.getDurable
<T>(key: string): Promise<T | null>

2.4: keys up to 1024 UTF-16 units, no NUL. Settle accepted writes, then read this private key from SQLite, not the optimistic mirror. Corrupt JSON rejects; null means absent or JSON null.

ctx.services.storage.observeDocuments
<T>(query: PluginDocumentObservationQuery, handler: PluginObservationHandler<PluginDocumentObservation<T>>): PluginDisposable

Storage 2.2: initial and changed private document query snapshots, including errors/recovery. At most 64 active observers per activation; reads and callbacks settle before the next one-second poll. Not a replayable write stream. Dispose or plugin retirement stops delivery; sequence is not CAS.

ctx.services.storage.onChange
(handler: PluginObservationHandler<{ kind: "changed"; }>, options?: { ruleId?: string; }): PluginDisposable

Fires when this plugin's namespace is written from OUTSIDE the plugin — its settings page, the reading agent, another surface editing the same object. Settings-key changes can also echo after own writes. Serial callbacks receive a reaction credential; use withEvent to preserve causes. No initial callback; intermediate changes coalesce. Use it to re-read (or re-derive from) settings you would otherwise have cached at activate().

ctx.services.storage.policy
(): Promise<PluginStoragePolicy>

Storage 2.5: own persisted usage and actual per-store policy. Null quota means no enforced total limit, not unlimited disk. Call flush first when awaiting this activation's pending writes. No names or secret values. Complete backup refers to full app backup, not reading/OPML exports.

ctx.services.storage.remove
(key: string): Promise<void>
ctx.services.storage.set
(key: string, value: unknown): Promise<void>

Reads update optimistically; resolve only after the write is durable.

services:secrets

プラグイン専用の暗号化スロットで認証情報を読み書きします。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.services.secrets.get
(key: string): Promise<string | null>
ctx.services.secrets.remove
(key: string): Promise<void>
ctx.services.secrets.set
(key: string, value: string): Promise<void>

services:ui

ビューやトーストを公開し、リソースを保存・開き、ワークスペースとコマンドを移動し、対応するリーダーパネルとウィンドウを制御します。

  • 開発:v1.17.0
  • ReadAware 0.6.8: v1.17.0
  • 権限: なし
ctx.services.ui.commands.execute
(request: HostCommandRequest): Promise<HostCommandReceipt>

Library write plus each command's setting grant; opening/leaving a reader needs reading:write.

ctx.services.ui.commands.list
(): Promise<HostCommandSnapshot>
ctx.services.ui.commands.observe
(handler: PluginObservationHandler<HostCommandObservation>, options?: { ruleId?: string; }): PluginDisposable

UI 1.16: serial/coalesced snapshots with a reaction delivery and optional stable ruleId.

ctx.services.ui.exportFile
(file: PluginExportFile): Promise<boolean>
ctx.services.ui.openExternal
(url: string): Promise<void>

UI 1.7, requires service:network. Explicit user intent only; HTTP(S), no credentials or local schemes.

ctx.services.ui.publishView
(channel: PluginViewChannel, update: PluginViewUpdate): Promise<PluginViewUpdateReceipt>

Updates only this activation's visible frame. Revision is a nonnegative, increasing safe integer. Receipt confirms host acceptance, not paint; updates cannot navigate or replace the subscription.

ctx.services.ui.reader.closeReferencePreview
(id: string): Promise<ReaderReferenceCloseReceipt>

Only this activation's current preview ID; never closes a native or other owner's note.

ctx.services.ui.reader.focus
(target: ReaderFocusTarget, guard?: ReadingSessionGuard): Promise<ReaderFocusReceipt>

UI 1.14, reading:write. Focus an already visible semantic target, without opening or dismissing UI. not-focused is not success; close your own dialog before returning focus.

ctx.services.ui.reader.image.control
(request: ReaderImageRequest): Promise<ReaderImageReceipt>

reading:write; exact current viewer ID required. Pan deltas are fractions of its viewport.

ctx.services.ui.reader.image.observe
(handler: PluginObservationHandler<ReaderImageSnapshot | null>): PluginDisposable

Plugins 1.6 supplies a separate reaction delivery, including closed/null snapshots.

ctx.services.ui.reader.image.open
(query: BookImageQuery, guard?: ReadingSessionGuard): Promise<ReaderImageOpenReceipt>

UI 1.13: library read + reading write; opens an embedded image in the current book.

ctx.services.ui.reader.image.snapshot
(): Promise<ReaderImageSnapshot | null>
ctx.services.ui.reader.observe
(handler: PluginObservationHandler<ReaderPanelsSnapshot | null>): PluginDisposable

Plugins 1.6 supplies a separate reaction delivery; callbacks are serial and coalesced.

ctx.services.ui.reader.previewReference
(query: BookReferenceQuery, guard?: ReadingSessionGuard): Promise<ReaderReferencePreviewReceipt>

UI 1.8: also needs library:read. Open book only; resolved preview waits for DOM commit.

ctx.services.ui.reader.setPanel
(panel: ReaderPanel, open: boolean, guard?: ReadingSessionGuard): Promise<ReaderPanelReceipt>

Requires reading:write. Opening reveals controls; completion waits for persistence and DOM commit.

ctx.services.ui.reader.setWidth
(panel: ResizableReaderPanel, width: number, guard?: ReadingSessionGuard): Promise<ReaderPanelReceipt>

Persist a shared TOC/chat width (integer 240..640 CSS px); does not open it or focus.

ctx.services.ui.reader.snapshot
(): Promise<ReaderPanelsSnapshot | null>
ctx.services.ui.showToast
(message: PluginToast): void
ctx.services.ui.window.control
(request: HostWindowRequest): Promise<HostWindowReceipt>
ctx.services.ui.window.observe
(handler: PluginObservationHandler<HostWindowObservation>, options?: { ruleId?: string; }): PluginDisposable

UI 1.17: reaction delivery remains valid until the callback settles.

ctx.services.ui.window.snapshot
(): Promise<HostWindowSnapshot>
ctx.services.ui.workspace.navigate
(target: WorkspaceTarget, expectedRevision?: number): Promise<WorkspaceReceipt>

Library write grant; leaving an active reader additionally requires reading:write.

ctx.services.ui.workspace.observe
(query: WorkspaceQuery, handler: PluginObservationHandler<WorkspaceSnapshot | null>, options?: { ruleId?: string; }): PluginDisposable

UI 1.16: use the separate reaction delivery even for null/retired snapshots.

ctx.services.ui.workspace.snapshot
(query?: WorkspaceQuery): Promise<WorkspaceSnapshot>

services:schedules

宣言済みの定期ハンドラーを結び付け、スケジュールを確認・制御し、所有する延期リクエストを管理します。

  • 開発:v2.1.0
  • ReadAware 0.6.8: v2.1.0
  • 権限: なし
ctx.services.schedules.bind
(scheduleId: string, run: (context: PluginScheduleRun, delivery?: PluginReactionEvent) => void | Promise<void>): PluginDisposable
ctx.services.schedules.cancelDeferred
(id: string, requestId: string, options?: PluginCallOptions): Promise<PluginDeferredReceipt>

Cancel exactly the queued ID, not an in-flight callback or a replacement request.

ctx.services.schedules.control
(id: string, action: "pause" | "resume" | "run"): Promise<PluginScheduleReceipt>

Pause/resume persist; run bypasses pause/cadence once. Neither pause nor cancellation undoes dispatched callback effects.

ctx.services.schedules.defer
(id: string, input: PluginDeferredRequest, options?: PluginCallOptions): Promise<PluginDeferredReceipt>

Schedules 2: enqueue one declared deferred task. Persists before acknowledgement. 1 second..7 days; idle means 5 seconds without host input. Never runs while closed. The most recent request ID is retained for retry; changed input conflicts, another queued ID is busy. A dispatched request is never automatically replayed after a crash. Inspect interrupted and decide explicitly.

ctx.services.schedules.list
(query?: Omit<PluginScheduleQuery, "pluginId">): Promise<PluginSchedulePage>

Bound schedules owned by this plugin only, with the latest persisted attempt/outcome.

ctx.services.schedules.observe
(query: Omit<PluginScheduleQuery, "pluginId">, handler: PluginObservationHandler<PluginSchedulePage>, options?: { ruleId?: string; }): PluginDisposable

services:jobs

対応するホスト操作で構成した永続プランを開始、確認、制御します。

  • 開発:v1.1.0
  • ReadAware 0.6.8: v1.1.0
  • 権限: なし
ctx.services.jobs.control
(id: string, action: DurableJobControl, options?: PluginCallOptions): Promise<DurableJobSnapshot>
ctx.services.jobs.get
(id: string, options?: PluginCallOptions): Promise<DurableJobSnapshot>
ctx.services.jobs.list
(query?: { offset?: number; limit?: number; }, options?: PluginCallOptions): Promise<{ jobs: DurableJobSnapshot[]; nextOffset: number | null; }>
ctx.services.jobs.start
(plan: DurableJobPlan, options?: PluginCallOptions): Promise<DurableJobSnapshot>

jobs 1.1: event-bound starts preserve their source through restart. Every causal event subscription must have a stable ruleId. Unnamed reactions and isolated service invocations cannot create saved jobs.

services:changes

再起動後も保持できるスコープ付き変更カーソルを開いて読み取ります。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.services.changes.open
(query: ChangesQuery, options?: PluginCallOptions): Promise<{ cursor: string; }>

Open before loading a baseline. Persist the returned cursor only after processing each page. Expired cursors require a new baseline. Notices are conservative reload hints, not events or values; settings hints cover the authorized requested paths in a shared storage namespace.

ctx.services.changes.read
(query: ChangesQuery, cursor: string, limit?: number, options?: PluginCallOptions): Promise<ChangesPage>

services:transactions

対応するローカル変更をプレビュー・コミットし、レシートを確認して条件付き取り消しをプレビューします。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.services.transactions.commit
(previewId: string, options?: PluginCallOptions): Promise<AtomicReceipt>
ctx.services.transactions.preview
(operations: AtomicOperation[], options?: PluginCallOptions): Promise<AtomicPreview>
ctx.services.transactions.previewUndo
(receiptId: string, options?: PluginCallOptions): Promise<AtomicPreview>
ctx.services.transactions.receipt
(receiptId: string, options?: PluginCallOptions): Promise<AtomicReceipt | null>

services:session

環境メタデータを読み取り、対応する操作の可用性を確認します。

  • 開発:v2.18.0
  • ReadAware 0.6.8: v2.18.0
  • 権限: なし
ctx.services.session.environment
(): Promise<HostEnvironmentSnapshot>

Fresh non-sensitive metadata; contains no reading or account state.

ctx.services.session.observeEnvironment
(handler: (snapshot: HostEnvironmentSnapshot, delivery?: PluginReactionEvent) => void | Promise<void>, options?: { ruleId?: string; }): PluginDisposable

Session 2.7: locale effects retain their requester; other system facts keep independent sources.

ctx.services.session.operationAvailability
(query: OperationAvailabilityQuery, options?: PluginCallOptions): Promise<OperationAvailability>

Session 2.11: inspect host command permissions/workspace guards and plugin service contract/authority/capacity (Agent approval remains required), export metadata/save entry and clipboard/browser entry availability (no OS access probe), window support/capacity/target state, sync connection/credentials/provider, inference, book-targeted playback/mode, text preparation and graph prerequisites without executing or probing. Missing permission returns only the permission condition. Unknown remote health is not a local refusal or a success guarantee.

services:plugins

インストール済みプラグインと登録を確認・観測し、型付きプラグインサービスを発見・呼び出します。

  • 開発:v1.10.0
  • ReadAware 0.6.8: v1.10.0
  • 権限: なし
ctx.services.plugins.callService
(request: PluginServiceCall, options?: PluginCallOptions): Promise<PluginServiceReceipt>

Executes one declared export in a fresh restricted Worker. No live-root closures, callbacks, binary handles, automatic retries, or resources surviving the call.

ctx.services.plugins.contributions
(query?: PluginContributionQuery): Promise<PluginContributionPage>

Registered identities across extension points, never provider callbacks, data, settings or a grant to invoke another plugin. Offset pages may change.

ctx.services.plugins.list
(query?: PluginDirectoryQuery): Promise<PluginDirectoryPage>

Public installed metadata only, no settings, paths, secrets or raw errors.

ctx.services.plugins.listServices
(query?: PluginServiceQuery, options?: PluginCallOptions): Promise<PluginServicePage>

Plugins 1.8: authorized service contracts; discovery does not execute providers.

ctx.services.plugins.observe
(query: PluginDirectoryQuery, handler: PluginObservationHandler<PluginDirectoryPage>, options?: { ruleId?: string; }): PluginDisposable

Plugins 1.10: serial reaction deliveries with stable rule IDs; reload offset pages after changes.

ctx.services.plugins.observeContributions
(query: PluginContributionQuery, handler: PluginObservationHandler<PluginContributionPage>, options?: { ruleId?: string; }): PluginDisposable

services:maintenance

メンテナンス状態を確認し、ホスト所有のバックアップ、接続テスト、更新、設定フローに入ります。

  • 開発:v1.5.0
  • ReadAware 0.6.8: v1.5.0
  • 権限: なし
ctx.services.maintenance.checkForUpdates
(): Promise<HostMaintenanceSnapshot>

Requires service:network. Uses the host release feed; no caller-supplied URL or silent installation.

ctx.services.maintenance.observe
(handler: PluginObservationHandler<HostMaintenanceSnapshot>, options?: { ruleId?: string; }): PluginDisposable
ctx.services.maintenance.openSettings
(surface: "updates" | "diagnostics" | "plugins" | "backup-import" | "backup-export" | "delete-data" | "ai-connection" | "data-location"): Promise<{ status: "opened"; surface: HostMaintenanceSurface; }>

Maintenance 1.4 adds data-location: shows the directory in host UI, never returns its path or opens the file manager. Also reveals updates/diagnostics/plugins/backup-import/backup-export/delete-data/ai-connection. Does not click controls, open file dialogs, approve installation or bypass typed DELETE.

ctx.services.maintenance.requestBackup
(action: BackupAction, options?: PluginCallOptions): Promise<BackupReceipt>

Reveals a host backup button and awaits the user's click and file dialog. Both directions use the complete encrypted archive (host-only password); import adds host review and confirmation, then reload. Retired v1 JSON library backups are rejected. No passwords, bytes or paths are returned.

ctx.services.maintenance.requestConnectionTest
(options?: PluginCallOptions): Promise<ConnectionTestReceipt>

Maintenance 1.3: reveal native AI test controls; only the user's click starts inference.

ctx.services.maintenance.snapshot
(): Promise<HostMaintenanceSnapshot>

services:diagnostics

対応する診断エクスポートまたは報告フローを要求します。

  • 開発:v1.2.0
  • ReadAware 0.6.8: v1.2.0
  • 権限: service:diagnostics
ctx.services.diagnostics.requestProjectionRepair
(options?: PluginCallOptions): Promise<ProjectionRepairReceipt>

Diagnostics 1.2: opens host confirmation; a committed repair requires reload.

ctx.services.diagnostics.requestReport
(action: DiagnosticsReportAction, options?: PluginCallOptions): Promise<DiagnosticsReportReceipt>
ctx.services.diagnostics.verifyProjections
(options?: PluginCallOptions): Promise<ProjectionVerification>

services:logging

範囲を限定した構造化開発イベントを書き込み、ログポリシーを確認します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし
ctx.services.logging.policy
(): Promise<{ levels: PluginLogEntry["level"][]; maxEntryChars: number; maxFields: number; perPluginLimit: number; appLimit: number; windowMs: number; delivery: "best-effort"; }>
ctx.services.logging.write
(entry: PluginLogEntry): Promise<PluginLogReceipt>

Logging 1.0: accepted means forwarded to the best-effort host logger, not durably stored or uploaded. Allowed during activation and migration. Debug is development-console-only. Retired activations cannot write.

services:resources

ファイルやディレクトリを選び、封印済みリソースを読み書きし、データをエクスポートし、プライベートバイナリアセットを保存します。

  • 開発:v1.6.0
  • ReadAware 0.6.8: v1.6.0
  • 権限: なし
ctx.services.resources.append
(id: string, offset: number, data: ArrayBuffer | Uint8Array<ArrayBufferLike>): Promise<ResourceRef>
ctx.services.resources.assets.delete
(key: string, expectedRevision: string, options?: PluginCallOptions): Promise<{ deleted: true; cleanupPending: boolean; }>
ctx.services.resources.assets.get
(key: string, options?: PluginCallOptions): Promise<PluginAsset | null>
ctx.services.resources.assets.list
(query?: PluginAssetQuery, options?: PluginCallOptions): Promise<PluginAssetPage>
ctx.services.resources.assets.open
(key: string, expectedRevision: string, options?: PluginCallOptions): Promise<ResourceRef>
ctx.services.resources.assets.policy
(options?: PluginCallOptions): Promise<PluginAssetPolicy>
ctx.services.resources.assets.store
(resourceId: string, input: PluginAssetWrite, options?: PluginCallOptions): Promise<PluginAssetReceipt>
ctx.services.resources.commit
(id: string): Promise<ResourceRef>
ctx.services.resources.create
(options: ResourceCreateOptions): Promise<ResourceRef>
ctx.services.resources.listDirectory
(id: string, query?: ResourceDirectoryQuery): Promise<ResourceDirectoryPage>
ctx.services.resources.openAssociated
(id: string, options?: PluginCallOptions): Promise<{ opened: boolean; }>

Resources 1.5: host confirmation then OS association for a temporary document/media copy. No edit-back, arbitrary program/path, or context bundles. True is dispatch, not rendering.

ctx.services.resources.openBook
(bookId: string): Promise<ResourceRef | null>

Requires library:read. Original local file only; no implicit remote download.

ctx.services.resources.openCover
(bookId: string): Promise<ResourceRef | null>

Resources 1.1; requires library:read. No extraction/download when the cover is unavailable.

ctx.services.resources.openDirectoryFile
(id: string, relativePath: string): Promise<ResourceRef>
ctx.services.resources.pick
(options?: ResourcePickOptions): Promise<{ cancelled: boolean; resources: ResourceRef[]; }>
ctx.services.resources.pickDirectory
(): Promise<{ cancelled: boolean; directory: ResourceDirectoryRef | null; }>

Resources 1.4: reader-selected, read-only directory grants; four per activation, one hour. No ambient paths. Listings are live; openDirectoryFile seals the current file bytes.

ctx.services.resources.read
(id: string, offset: number, length: number): Promise<ResourceChunk>
ctx.services.resources.release
(id: string): Promise<void>

Also aborts uncommitted writes.

ctx.services.resources.releaseDirectory
(id: string): Promise<void>
ctx.services.resources.save
(id: string, filename?: string): Promise<{ saved: boolean; }>
ctx.services.resources.stat
(id: string): Promise<ResourceRef>

services:sync

同期状態と保留処理を観測し、同期を要求し、ホスト管理のアカウントまたは接続フローに入ります。

  • 開発:v1.2.0
  • ReadAware 0.6.8: v1.2.0
  • 権限: service:sync
ctx.services.sync.account
(): Promise<HostSyncAccount | null>

Explicit remote read of the account's tier, usage and limits; null without an account. No email, account ID, keys, session or billing ticket.

ctx.services.sync.backlog
(): Promise<{ events: number; blobs: number; }>

Events and blobs waiting to be pushed.

ctx.services.sync.connectionOptions
(): Promise<{ ref: string; label: string; }[]>

Registered backend references and display labels, never endpoint credentials.

ctx.services.sync.observe
(handler: PluginObservationHandler<HostSyncSnapshot>, options?: { ruleId?: string; }): PluginDisposable

Delivers each new sync snapshot (state, progress, completed cycles) while the handle lives.

ctx.services.sync.openSettings
(): Promise<{ status: "opened"; surface: "dataSync"; }>

Opens the host Data & Sync page; not a login, disconnect or purchase.

ctx.services.sync.requestFlow
(request: HostSyncFlowRequest, options?: PluginCallOptions): Promise<HostSyncFlowReceipt>

Host-owned connect, disconnect, account deletion, upgrade or billing flow. Waits for the final local outcome or external handoff; cancellation cannot undo a started operation.

ctx.services.sync.requestSync
(): Promise<HostSyncReceipt>

Runs one sync round on the configured backend (relay or a transport plugin such as WebDAV) and resolves when it has finished: completed, or already-running when a round was in progress (not queued again). Rejects with a coded error when no round can start (ui/unavailable) or the round fails (classified failures carry sync/* codes).

ctx.services.sync.snapshot
(): Promise<HostSyncSnapshot>

Current sync state: backend, connection, progress, last cycle and last error code.

services:network

オリジン単位のHTTPリクエストを実行し、範囲付きストリームを読み取り、選択した安全な再試行を行います。

  • 開発:v2.2.0
  • ReadAware 0.6.8: v2.2.0
  • 権限: service:network
ctx.services.network.closeStream
(id: string): Promise<void>

Idempotent for this activation's released/unknown IDs. Aborts pending reads; does not undo remote effects or remove data already saved by the plugin.

ctx.services.network.fetch
(input: string | URL | Request, init?: RequestInit, options?: { retry?: "none" | "safe"; }): Promise<Response>

Native HTTP; Request/init semantics and cancellation survive the Worker bridge. Bodies are buffered up to 64 MiB per direction. Calls have a 120s deadline; an abort does not undo a remote side effect already committed by the server. Network 2.0 requires networkAccess for the initial URL and each redirect. HTTPS -> HTTP redirects are denied. At most 10 redirects; manual returns the 3xx response, error rejects. Cross-origin hops drop authorization, proxy-authorization, cookie and referer; custom secret headers are the plugin's responsibility (use redirect:error for authenticated endpoints). Host/content-length are transport-owned. No implicit retry or cookie jar. Network 2.2: options.retry="safe" opts GET/HEAD without a body into at most two retries across the whole redirect chain, before response headers are returned. Other methods and all body reads are never replayed. The original deadline includes backoff; Retry-After above 30s returns the HTTP response. Attempts/uploads/read chunks share per-owner and host cumulative quotas; reactivation does not reset owner debt. policy() reports exact limits. Transport failures carry plugin/network-failed; explicit deadlines carry plugin/network-timeout, aborts plugin/cancelled. Existing structured codes survive unchanged. Unclassified native errors are not guessed from prose. HTTP error statuses still return Response; the consumer decides success.

ctx.services.network.openStream
(input: string | URL | Request, init?: RequestInit, options?: { retry?: "none" | "safe"; }): Promise<PluginNetworkStream>

Network 2.1: headers first; download at most 1 GiB without buffering the whole response. Uploads remain capped at 64 MiB. 8 active requests per activation / 32 host-wide, shared with fetch; no hidden durable queue. Optional safe retry applies only before this opening receipt, as in fetch. init.signal cancels OPENING only; after receipt use closeStream to cancel. Close in finally if not reading to EOF. 120s absolute lifetime, including headers/redirects/reads; unload cancels and drains native resources.

ctx.services.network.policy
(): Promise<PluginNetworkAccess & { maxRedirects: number; maxBodyBytes: number; timeoutMs: number; maxStreamBytes: number; maxChunkBytes: number; maxConcurrentRequests: number; maxHostConcurrentRequests: number; cumulative: { windowMs: number; maxOwnerRequests: number; maxHostRequests: number; maxOwnerBytes: number; maxHostBytes: number; maxOwners: number; }; retry: { maxRetries: number; baseDelayMs: number; maxDelayMs: number; statuses: readonly number[]; }; }>

Network 2.0: this activation's immutable authorization and transport limits. All-origins authorization is ["*"], not a guarantee of endpoint reachability.

ctx.services.network.readStream
(id: string, offset: number, maxBytes?: number): Promise<PluginNetworkChunk>

Sequential, non-replayable reads. offset must equal bytes already delivered. One outstanding read per stream; maxBytes defaults to 64 KiB, max 1 MiB. A lost read receipt is not safely retryable: close and restart explicitly.

services:llm

テキスト、構造化、ストリーミング推論を要求し、封印済み画像リソースを使い、リクエストのメタデータと予算を追跡します。

  • 開発:v1.6.0
  • ReadAware 0.6.8: v1.6.0
  • 権限: service:llm
ctx.services.llm.ask
(input: PluginInferenceInput & { schema?: never; onText?: (delta: string) => void; }): Promise<string>
(input: PluginInferenceInput & { schema: Record<string, unknown>; onText?: never; }): Promise<unknown>
ctx.services.llm.askDetailed
(input: PluginInferenceInput & { schema?: never; onText?: (delta: string) => void; }): Promise<InferenceResult<string>>
(input: PluginInferenceInput & { schema: Record<string, unknown>; onText?: never; }): Promise<InferenceResult<unknown>>

llm 1.3: same execution as ask, with per-attempt metadata on success. Includes structured retries; failure/cancellation rejects, not a billing receipt.

ctx.services.llm.cancelRequest
(requestId: string): Promise<InferenceRequestReceipt | null>

Requests cancellation independently of the ask RPC. The returned snapshot may still be running; query again for its outcome and provider settlement.

ctx.services.llm.getRequest
(requestId: string): Promise<InferenceRequestReceipt | null>

llm 1.6: last 64 named requests in this plugin's local private storage. Initial metadata commits before inference dispatch; no prompt/output is retained. Includes backup/rollback and uninstall cleanup, not roaming or billing history. requestAvailable identifies this activation's handle. An older unsettled record has interrupted=true: status is last observed, not proof it still runs remotely. No automatic retry/resume; historical IDs cannot control another activation. Late terminal usage is persisted; unknown/evicted IDs return null.

ctx.services.llm.listRequests
(): Promise<InferenceRequestReceipt[]>
ctx.services.llm.policy
(): Promise<{ defaultTimeoutMs: number; maxTimeoutMs: number; perPluginLimit: number; appLimit: number; maxOutputTokensLimit: number; maxImageCount: number; maxImageBytes: number; maxImageTotalBytes: number; maxTotalOutputTokensLimit: number; maxOutputCharsLimit: number; maxInputChars: number; }>

Plugin inference limits, not billing quotas. maxOutputTokensLimit since 1.3.

services:clipboard

テキストまたは対応する封印済み画像をシステムクリップボードに書き込みます。

  • 開発:v1.1.0
  • ReadAware 0.6.8: v1.1.0
  • 権限: service:clipboard
ctx.services.clipboard.writeImage
(resourceId: string): Promise<ResourceImageReceipt>

Clipboard 1.1. This activation's sealed resource; raster decode stays in the host.

ctx.services.clipboard.writeText
(text: string): Promise<void>

スキーマ

schemas:views

ホスト描画のリスト、フォーム、詳細、Markdown、対応ブロックレイアウトを記述します。

  • 開発:v1.12.0
  • ReadAware 0.6.8: v1.12.0
  • 権限: なし

Manifest宣言

schemas:settings

型付きプラグイン設定、条件付きフィールド、動的な選択肢参照を宣言します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: なし

Manifest宣言

schemas:themes

アプリとリーダーの意味的なパレットを記述します。

  • 開発:v1.0.0
  • ReadAware 0.6.8: v1.0.0
  • 権限: ui:themes

Manifest宣言