> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# veryfront/trigger

> Shared source-trigger discovery and local execution primitives.

## Import

```ts theme={null}
import { discoverSourceTriggers, runTriggerTarget } from "veryfront/trigger";
```

## Examples

### Discover and run a source-defined trigger target

```ts theme={null}
import { discoverSchedules } from "veryfront/schedule";
import { runTriggerTarget } from "veryfront/trigger";

const { items } = await discoverSchedules({ projectDir, adapter });
const dailyTriage = items.find((item) => item.id === "daily-support-triage");

if (dailyTriage) {
  await runTriggerTarget({
    projectDir,
    adapter,
    target: dailyTriage.target,
    input: dailyTriage.input,
  });
}
```

## Exports

### Functions

| Name                     | Description | Source                                                                                           |
| ------------------------ | ----------- | ------------------------------------------------------------------------------------------------ |
| `discoverSourceTriggers` |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L113)    |
| `runTriggerTarget`       |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/local-runner.ts#L134) |

### Types

| Name                              | Description | Source                                                                                          |
| --------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| `RunTriggerTargetOptions`         |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/local-runner.ts#L19) |
| `SourceTriggerDiscoveryError`     |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L26)    |
| `SourceTriggerDiscoveryErrorCode` |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L18)    |
| `SourceTriggerDiscoveryResult`    |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L36)    |
| `SourceTriggerKind`               |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L16)    |
| `TriggerDefinitionWithId`         |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L49)    |
| `TriggerDiscoveryOptions`         |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/discovery.ts#L41)    |
| `TriggerTarget`                   |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/target.ts#L3)        |
| `TriggerTargetRunResult`          |             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/trigger/local-runner.ts#L30) |
