# @photon-ai/proto

Generated TypeScript bindings for the public Photon gRPC contracts.

Wraps two proto packages:

- `photon.slack.v1` — Slack runtime contract (`MessageService`, `FileService`, inbound event variants, file metadata).
- `photon.fusor.v1` — Cross-channel `RawInboundEvent` envelope.

Generated with [`ts-proto`](https://github.com/stephenh/ts-proto) using the
photon-hq canonical config (`nice-grpc` + `generic-definitions` service
output). Pair with [`nice-grpc`](https://github.com/deeplay-io/nice-grpc) for
Node transport or [`nice-grpc-web`](https://github.com/deeplay-io/nice-grpc/tree/master/packages/nice-grpc-web)
for browsers.

## Install

```sh
npm install @photon-ai/proto
```

## Usage

```ts
import { InboundMessage } from "@photon-ai/proto/photon/slack/v1/common";

// Construct via the generated helper:
const msg = InboundMessage.create({
  channel: "C012345",
  user: "U67890",
  text: "hello",
});

// Or just an object literal — InboundMessage is a plain interface:
const msg2: InboundMessage = {
  channel: "C012345",
  user: "U67890",
  text: "hello",
  ts: "",
  isFromMe: false,
  files: [],
};

// Encode to wire bytes:
const bytes = InboundMessage.encode(msg).finish();
const round = InboundMessage.decode(bytes);
```

## Source

Definitions live in [`photon-hq/proto`](https://github.com/photon-hq/proto). Releases are cut by the `release-public` GitHub Actions workflow.

## License

MIT — see [LICENSE](./LICENSE).
