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

# nora edges

> 블록 배선. 포트 연결, 와이어 삭제, 현재 배선 나열

엣지가 블록 사이 와이어. `edges`로 터미널에서 와이어를 그리고 지울 수 있음. Flow 구성 스크립트와, 한꺼번에 바꾼 뒤 정리에 좋음.

## 명령

| 명령                                | 설명                      |
| --------------------------------- | ----------------------- |
| `edges connect <source> <target>` | 소스 블록에서 타겟 블록으로 와이어 그림. |
| `edges delete <edge-id>`          | 와이어 제거.                 |
| `edges list`                      | 현재 와이어 나열(필터 선택).       |

## `edges connect`

```bash theme={null}
nora edges connect tr_events ag_support
```

`tr_events`(출력)에서 `ag_support`(입력)로 와이어를 그림.

기본 포트: `right`(소스 오른쪽 가장자리) → `left`(타겟 왼쪽 가장자리). side 플래그로 덮어씀:

* `--source-side left|right` 와이어가 떠나는 소스 블록의 어느 쪽.
* `--target-side left|right` 와이어가 들어가는 타겟 블록의 어느 쪽.

Flow가 보통 왼쪽에서 오른쪽으로 놓이므로 right-to-left가 기본.

생성한 엣지의 ID를 출력.

## `edges delete`

```bash theme={null}
nora edges delete edge_abc
```

와이어 제거. 두 블록은 그대로. 연결만 끊김.

## `edges list`

```bash theme={null}
nora edges list
```

Flow의 모든 와이어를 출력: 엣지 id, source id, target id, sides.

특정 블록이 낀 와이어로 필터:

```bash theme={null}
nora edges list --source ag_support   # ag_support를 떠나는 모든 것
nora edges list --target tr_events    # tr_events로 들어오는 모든 것
```

구조화 출력은 `--json`을 붙임.

## 레시피

### 간단한 Flow를 처음부터 배선

```bash theme={null}
# 블록 생성
TR=$(nora triggers create --kind api --name entry | jq -r '.id')
AG=$(nora agents create --name assistant --model gpt-4o-mini | jq -r '.id')
AC=$(nora actions create --name log --runtime '{"kind":"http","method":"POST","url":"https://logs.internal/nora"}' | jq -r '.id')

# 배선
nora edges connect $TR $AG
nora edges connect $AG $AC

nora flows publish --note "초기 버전"
```

### 와이어 다시 잇기 (엣지 하나를 다른 것으로 교체)

`edges update`는 없음. 지우고 다시 이음:

```bash theme={null}
old=$(nora edges list --target ag_old --json | jq -r '.[0].id')
nora edges delete $old
nora edges connect $(nora edges list --json | jq -r '.[0].source_id') ag_new
```

더 깔끔한 방법: `flows snapshot` → JSON 손편집 → `flows apply`.

### 감사: 들어오는 와이어 없는 블록 찾기

```bash theme={null}
comm -23 \
  <(nora flows get support | jq -r '.blocks[].id' | sort) \
  <(nora edges list --json | jq -r '.[].target_id' | sort -u)
```

아무것도 안 가리키는 블록 ID를 출력. 도달 못 할 수 있으니 가지치기할 만함.

### 감사: 나가는 와이어 없는 블록 찾기

```bash theme={null}
comm -23 \
  <(nora flows get support | jq -r '.blocks[].id' | sort) \
  <(nora edges list --json | jq -r '.[].source_id' | sort -u)
```

아무도 안 쓰는 출력을 내는 블록.

## 포트와 사이드

블록마다 왼쪽과 오른쪽 가장자리에 포트가 있음. 각 쪽의 **기본 포트**가 주 in/out. 출력 경로가 여럿인 블록(병렬 분기가 있는 Agent)은 이름 붙은 포트를 더 노출.

지금 CLI는 side 기반 배선(`left`/`right`)만 씀. 이름 붙은 포트는 아님. 이름 붙은 포트가 필요한 Flow는 앱 캔버스나 손으로 만든 JSON으로 `flows apply`를 씀.

## 사이클과 검증

배포 전 점검에 acyclicity가 포함됨. Draft에서는 사이클을 만들 수 있지만 Publish가 거절함. 먼저 사이클을 깰 것.

드문 예외: 경계 있는 루프(검증-재시도 패턴을 위해 하류 Agent에서 상류 Agent로 돌아오기). 반복 경계를 명시하면 검증을 통과.
