docs(plugins): update headers to TypeBox v2; expand v2 doc with Regex/Net method tables; remove BID mentions where v2 exists
This commit is contained in:
@ -101,6 +101,38 @@ Notes
|
|||||||
- Keep result payloads small; prefer handles (tag=8) for large data and stream APIs.
|
- Keep result payloads small; prefer handles (tag=8) for large data and stream APIs.
|
||||||
- Use UTF‑8 strings (tag=6) for human‑readable values; use bytes (tag=7) otherwise.
|
- Use UTF‑8 strings (tag=6) for human‑readable values; use bytes (tag=7) otherwise.
|
||||||
|
|
||||||
|
Method Tables (TLV Contracts)
|
||||||
|
- RegexBox
|
||||||
|
- birth(0): returns `handle` (RegexBox)
|
||||||
|
- compile(1): args [string pattern]; returns `OK`
|
||||||
|
- isMatch(2): args [string text]; returns [bool]
|
||||||
|
- find(3): args [string text]; returns [string match]
|
||||||
|
- replaceAll(4): args [string text, string repl]; returns [string]
|
||||||
|
- split(5): args [string text, i64 limit?]; returns [string joined by "\n"]
|
||||||
|
- fini(MAX): returns `OK`
|
||||||
|
|
||||||
|
- Net — Client/Response/Request
|
||||||
|
- ClientBox
|
||||||
|
- birth(0): returns `handle` (ClientBox)
|
||||||
|
- get(1): args [string url]; returns `handle` (ResponseBox)
|
||||||
|
- post(2): args [string url, bytes|string body]; returns `handle` (ResponseBox)
|
||||||
|
- fini(MAX)
|
||||||
|
- ResponseBox
|
||||||
|
- birth(0)
|
||||||
|
- setStatus(1): args [i32]
|
||||||
|
- setHeader(2): args [string name, string value]
|
||||||
|
- write(3): args [bytes|string]
|
||||||
|
- readBody(4): returns [bytes]
|
||||||
|
- getStatus(5): returns [i32]
|
||||||
|
- getHeader(6): args [string name]; returns [string]
|
||||||
|
- fini(MAX)
|
||||||
|
- RequestBox
|
||||||
|
- birth(0): returns `handle` (RequestBox)
|
||||||
|
- path(1): returns [string]
|
||||||
|
- readBody(2): returns [bytes]
|
||||||
|
- respond(3): args [handle(ResponseBox)]
|
||||||
|
- fini(MAX)
|
||||||
|
|
||||||
Phase‑12 Alignment & Roadmap
|
Phase‑12 Alignment & Roadmap
|
||||||
- Alignment: The Phase‑12 “Unified TypeBox ABI” is a superset of this v2 minimal design. It shares the same core shape: per‑Box TypeBox export, method_id dispatch, and TLV arguments/results.
|
- Alignment: The Phase‑12 “Unified TypeBox ABI” is a superset of this v2 minimal design. It shares the same core shape: per‑Box TypeBox export, method_id dispatch, and TLV arguments/results.
|
||||||
- Current focus (v2 minimal): simplicity and portability for first‑party plugins (Regex/Net/File/Path/Math/Time/Python family). The loader probes `nyash_typebox_<Box>` and calls `invoke_id` with `(instance_id, method_id, TLV)`.
|
- Current focus (v2 minimal): simplicity and portability for first‑party plugins (Regex/Net/File/Path/Math/Time/Python family). The loader probes `nyash_typebox_<Box>` and calls `invoke_id` with `(instance_id, method_id, TLV)`.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash ArrayBox Plugin - Minimal BID-FFI v1
|
//! Nyash ArrayBox Plugin — TypeBox v2 (minimal)
|
||||||
//! Methods: birth(0), length(1), get(2), push(3), fini(u32::MAX)
|
//! Methods: birth(0), length(1), get(2), push(3), fini(u32::MAX)
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash ConsoleBox Plugin - BID-FFI v1
|
//! Nyash ConsoleBox Plugin — TypeBox v2
|
||||||
//! Provides simple stdout printing via ConsoleBox
|
//! Provides simple stdout printing via ConsoleBox
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
//! Nyash FileBox Plugin - BID-FFI v1 Implementation
|
//! Nyash FileBox Plugin — TypeBox v2
|
||||||
//!
|
//!
|
||||||
//! Provides file I/O operations as a Nyash plugin
|
//! Provides file I/O operations as a Nyash plugin(TypeBox v2 エクスポート済み)
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash IntegerBox Plugin - Minimal BID-FFI v1
|
//! Nyash IntegerBox Plugin — TypeBox v2 (minimal)
|
||||||
//! Methods: birth(0), get(1), set(2), fini(u32::MAX)
|
//! Methods: birth(0), get(1), set(2), fini(u32::MAX)
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash MapBox Plugin - Minimal BID-FFI v1
|
//! Nyash MapBox Plugin — TypeBox v2 (minimal)
|
||||||
//! Methods: birth(0), size(1), get(2), has(3), set(4), fini(u32::MAX)
|
//! Methods: birth(0), size(1), get(2), has(3), set(4), fini(u32::MAX)
|
||||||
//! Extension: support both i64 and UTF-8 string keys; values remain i64.
|
//! Extension: support both i64 and UTF-8 string keys; values remain i64.
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
//! Nyash Math/Time Plugin - BID-FFI v1 (minimal)
|
//! Nyash Math/Time Plugin — TypeBox v2
|
||||||
//! MathBox: sqrt(i64) -> i64
|
//! MathBox: sqrt/sin/cos/round
|
||||||
//! TimeBox: now() -> i64 (unix seconds)
|
//! TimeBox: now() -> i64 (unix seconds)
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
//! Nyash Net Plugin (HTTP stub) - BID-FFI v1
|
//! Nyash Net Plugin (HTTP minimal) — TypeBox v2
|
||||||
//! Provides HttpServerBox (singleton), HttpRequestBox, HttpResponseBox, HttpClientBox
|
//! Provides ServerBox/RequestBox/ResponseBox/ClientBox and socket variants.
|
||||||
//! This is a pure in-process stub (no real sockets), suitable for E2E of BoxRef args/returns.
|
//! Pure in-process HTTP over localhost for E2E of BoxRef args/returns.
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use std::collections::{HashMap, VecDeque};
|
use std::collections::{HashMap, VecDeque};
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash RegexBox Plugin - Minimal regex support (compile + match/find/replace/split)
|
//! Nyash RegexBox Plugin — TypeBox v2(compile / isMatch / find / replaceAll / split)
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//! Nyash StringBox Plugin - Minimal BID-FFI v1
|
//! Nyash StringBox Plugin — TypeBox v2 (minimal)
|
||||||
//! Methods: birth(0), length(1), is_empty(2), charCodeAt(3), fini(u32::MAX)
|
//! Methods: birth(0), length(1), is_empty(2), charCodeAt(3), fini(u32::MAX)
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|||||||
Reference in New Issue
Block a user