Skip to main content

weft_capabilities 0.7.0-dev.3 copy "weft_capabilities: ^0.7.0-dev.3" to clipboard
weft_capabilities: ^0.7.0-dev.3 copied to clipboard

Built-in capability identifiers and policy contracts for Weft.

weft_capabilities #

Capability gateway and policy contracts for Weft scripts.

A JS session sees only the capability namespaces its host enabled. This package implements the gateway that authenticates each call, enforces the policy (allow-list, argument schema, size and rate limits) and journals side effects so a restarted runtime can replay state without repeating them.

Pieces #

Type Role
WeftCapabilityIds Stable ids for the built-in state, events and net namespaces
CapabilityPolicy Which namespaces and methods a document may call, plus limits
CapabilityGateway BridgeDispatcher that authenticates and dispatches calls
BridgeJournalEntry Record of an applied call, used for recovery de-duplication

The built-in implementations (state, events, network) are separate libraries in the same package so a host can wire only what it enables.

Boundaries #

  • Disabled capabilities are absent from the JS namespace, not merely rejected at call time.
  • Network access is proxied by the host: URL allow-list, redirect and response size checks happen on the Dart side before any bytes reach a script.
  • The gateway does not decide navigation, storage or auth policy; those stay in host code.

License #

MIT.

0
likes
0
points
789
downloads

Publisher

unverified uploader

Weekly Downloads

Built-in capability identifiers and policy contracts for Weft.

Repository (GitHub)
View/report issues

Topics

#flutter #javascript #security

License

unknown (license)

Dependencies

weft_runtime_api

More

Packages that depend on weft_capabilities