open-index/open-npm huggingface dataset:
npm package: @policies2/sdk
Description: TypeScript SDK for executing policies and flows over REST.
Latest version: 0.1.3

# `@policies2/sdk`

Execute stored policies and flows over REST using API keys only.

This SDK is intentionally narrow:

- execute policies
- execute flows
- use the REST transport
- authenticate with `x-api-key`

It does not support creating, updating, publishing, or administering resources.

## Install

```bash
npm install @policies2/sdk
```

## REST

```ts
import { ExecutionClient } from "@policies2/sdk";

const client = new ExecutionClient({
  apiKey: process.env.POLICY_API_KEY!,
  transport: {
    baseUrl: "https://api.policy2.net",
  },
});

const result = await client.executePolicy({
  id: "3b7d4b2a-9aa0-4b6d-a1b4-9dcf11ce12ab",
  reference: "base",
  data: {
    user: {
      age: 25,
    },
  },
});

console.log(result.result);
```

## API

### `new ExecutionClient(config)`

Creates an execute-only client.

### `client.executePolicy(request)`

Executes a stored policy and returns a `PolicyExecutionResult`.

### `client.executeFlow(request)`

Executes a stored flow and returns a `FlowExecutionResult`.

## Examples

- REST policy execution: [`examples/policy-rest.ts`](./examples/policy-rest.ts)
- REST flow execution: [`examples/flow-rest.ts`](./examples/flow-rest.ts)

You can run an example with Bun from the package root:

```bash
bun examples/policy-rest.ts
```

## Notes

- API key auth is the only auth model exposed by this SDK.
- REST supports base IDs and exact version IDs.
npm package: @policy-kit/contracts
Description: Solidity smart contracts for PolicyKit — decentralized policies-as-code for smart accounts and agents
Latest version: 0.1.0

## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:

-   **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
-   **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
-   **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
-   **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```