omp-superagent 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,10 @@
1
1
  # 운영·설치 가이드
2
2
 
3
- [프로젝트 소개로 돌아가기](../README.md) · [설계](../DESIGN.md) ·
3
+ [프로젝트 소개로 돌아가기](../README.ko.md) · [English](OPERATIONS.en.md) · [설계](../DESIGN.md) ·
4
4
  [설정 예제](../config.example.json) · [출처·라이선스 고지](../THIRD_PARTY_NOTICES.md)
5
5
 
6
+ [설치](#1-로컬-준비--봇은-시작하지-않음) · [플랫폼별 앱](#2-플랫폼별-앱과-접근-범위) · [설정](#3-설정) · [일상 사용](#4-명령과-일상-사용) · [복구](#5-운영-범위와-복구-제약) · [개발자 검증](#6-개발자-검증)
7
+
6
8
  이 문서는 설치·설정·일상 제어와 복구 절차를 다룬다. 파일·코드 경로와 셸 명령은 별도
7
9
  설명이 없으면 **저장소 루트 기준**이다. npm 설치에서는 같은 관리 명령을
8
10
  `bun --no-env-file src/cli.ts` 대신 `omp-sa`로 실행하며 설정 파일은 사용자 작업 디렉터리에 둔다.
@@ -206,13 +208,13 @@ board_subscribe({channels: ["general", "repo:/absolute/repository"]})
206
208
  사용한다. 이 저장소는 OMP를 다운로드하거나 소스에서 빌드하지 않는다.
207
209
 
208
210
  ```sh
209
- bun add --global --trust omp-superagent@0.1.9
211
+ bun add --global --trust omp-superagent@0.1.10
210
212
  omp-sa --help
211
213
  ```
212
214
 
213
215
  `--trust`는 관리형 omp-superkit 준비 등 패키지 설치 스크립트를 허용한다.
214
216
  `bun pm bin --global`의 출력 경로를 PATH에 포함한다. Bun이 PATH에 있으면
215
- `npm install --global omp-superagent@0.1.9`도 사용할 수 있다.
217
+ `npm install --global omp-superagent@0.1.10`도 사용할 수 있다.
216
218
  설정은 설치 디렉터리가 아닌 사용자 작업 디렉터리에
217
219
  `omp-sa setup --config ./config.local.json`으로 만든다. 설치만으로 봇을 활성화하지 않는다.
218
220
 
@@ -486,6 +488,34 @@ REST 명령을 사용하며 Socket Mode나 Gateway 데몬을 시작하지 않는
486
488
  문서의 bot history scopes를 따른다. bot token이면 채널 스레드를 무조건 조회할 수 없다는
487
489
  과거 제한을 전제로 하지 않는다. 실제 접근 권한·workspace 보존 정책·API rate limit은 여전히 적용된다.
488
490
 
491
+ ### 2.4 KakaoTalk (로컬 브리지, 주인 1:1 전용)
492
+
493
+ > **약관 위험.** 카카오톡에는 공식 봇 API가 없다. 개인 카카오 계정을 자동화하는 것은 카카오의
494
+ > 공식 연동이 아니며 이용약관 위반으로 계정 제한·정지를 받을 수 있다. 브리지를 고르고 운영하는
495
+ > 책임은 운영자에게 있다. 가능하면 별도 계정을 쓰고 다른 사람의 대화는 자동화하지 않는다.
496
+
497
+ 이 어댑터는 카카오에 **로그인하지 않고** 카카오 서버에 접속하지도 않는다. 운영자가 같은 컴퓨터에서
498
+ 직접 운영하는 **브리지**가 카카오 세션을 맡는다. 브리지는 주인 1:1 방에서 주인이 보낸 메시지만
499
+ 수신함에 기록하고 Gateway는 그 수신함을 읽는다. 답장은 주인 1:1 방으로만 보내는 브리지 발송
500
+ 경로로 나간다. 저장소에는 카카오에 연결하지 않는 [참조 브리지](../scripts/kakao-reference-bridge.ts)만
501
+ 들어 있다. 실제 브리지가 지켜야 할 요청·응답 형식과 보안 요구 사항은
502
+ [카카오 브리지 프로토콜](kakao-bridge-protocol.md)에 있다.
503
+
504
+ - 설정 예:
505
+ `"kakao": {"bridgeUrl":"http://127.0.0.1:PORT","tokenEnv":"KAKAO_SUPERAGENT_TOKEN","botUserId":"…","ownerId":"…","chatId":"…"}`.
506
+ `bridgeUrl`은 `127.0.0.1`이나 `[::1]` 숫자 주소만 허용한다(`localhost` 같은 호스트 이름 거부).
507
+ `botUserId`는 브리지 계정, `ownerId`는 주인, `chatId`는 둘의 1:1 방 ID다.
508
+ - `tokenEnv`가 가리키는 토큰은 이 인터페이스 전용으로 만든다. 24자 이상, `[A-Za-z0-9_-]`만
509
+ 쓴다. 브리지의 다른 기능을 여는 토큰을 재사용하지 않는다.
510
+ - 지원: 텍스트 수신과 답장(Markdown을 평문으로 바꾸고 1500자 단위로 분할), `/new` 같은 DM 명령.
511
+ 미지원: 스레드, 첨부, 반응, 확인 카드. 확인 카드가 필요하면 안내문을 보내고 **취소**한다(대신 수락하지 않음).
512
+ - 브리지의 대화방과 모든 메시지 조각의 카카오 발송 영수증을 확인해야 발송 완료로 기록한다.
513
+ 브리지 큐 접수나 일부만 발송된 응답은 완료가 아니다.
514
+ - 브리지가 `stale`로 표시한 메시지는 실행하지 않고 알림을 한 번 시도한다. 처음 연결하면 이전 기록을 재생하지 않는다.
515
+ - 단체방(`groupRooms`)은 kakao에서 허용하지 않는다. `omp-sa setup`은 kakao를 묻지 않으니 설정 파일에 직접 추가한다.
516
+ - 로컬 확인: `KAKAO_SUPERAGENT_TOKEN=… KAKAO_BOT_USER_ID=900 KAKAO_OWNER_CHAT_ID=777 KAKAO_OWNER_ID=42 bun scripts/kakao-reference-bridge.ts`로
517
+ 참조 브리지를 띄우면 첫 줄에 주소가 나온다. `POST /demo/owner-message`로 주인 메시지를 넣으면 답장이 터미널에 찍힌다.
518
+
489
519
  ### 메시지 수신·처리 중 반응
490
520
 
491
521
  새 레인이 필요한 작업은 범위와 작업 디렉터리를 확인한 뒤 배정된 스레드·topic에
@@ -818,7 +848,7 @@ CLI 실행 이름은 `omp-sa`다. 위의 전역 패키지 설치 또는 준비
818
848
  `omp-superagent`로 유지한다. 아래 소스 호출 방식도 같은 CLI이며, 두 방식 모두 `.env`
819
849
  자동 로딩을 끈다.
820
850
 
821
- 모든 관리 명령에 `--config FILE`이 필요하다. 먼저 봇을 시작하지 않는 진단을 실행한다.
851
+ 아래 관리 명령에는 `--config FILE`을 전달한다. 먼저 봇을 시작하지 않는 진단을 실행한다.
822
852
 
823
853
  ```sh
824
854
  bun --no-env-file src/cli.ts doctor --config config.local.json
@@ -888,6 +918,16 @@ launch 직후 소유권 기록 전 crash 등은 수동 조정까지 보류할
888
918
  계속한다. 레인은 메신저 자격 증명을 갖지 않는다. 여러 주제를 비교하거나 공유 HEAD에 명시적으로
889
919
  요청하려면 `/head 요청`(Slack `!head 요청`)을 사용한다.
890
920
 
921
+ **공유 답변 말투(SOUL)를 변경하려면** 헤드에게 새 메시지로
922
+ “앞으로 유능한 편집장처럼, 존댓말로 짧게 결론부터 해줘”라고 말하면 된다.
923
+ “이제부터 옆자리 선배처럼 차분하게 설명해 줘”도 가능하다. `SOUL:`은 필요 없다.
924
+ 연결된 작업 스레드에서만 기존 `/head`(Slack `!head`)로 헤드를 지정한다. 그 외
925
+ 스레드 메시지는 기존 레인으로 간다. “말투를 기본값으로 돌려줘”는 기본값을 복원한다.
926
+ HEAD 답변에서 저장한 리비전을 확인한다. 설정은 재시작 후에도 유지되고, 이후 새 HEAD 답변과
927
+ 레인의 직접 답변에 함께 적용된다. 작성 중인 답변, 내부 보고, 코드가 만드는 상태·승인 안내는
928
+ 바꾸지 않는다. “이번 답변만” 같은 요청도 저장하지 않는다. 컨셉은 현재 편집장형·멘토형·기본형을
929
+ 지원하며, 정체성·모델·도구·승인·워크플로는 그대로다.
930
+
891
931
  헤드에서 Mnemopi가 활성화되어 검색할 수 있으면, 다른 운영자 채널·DM에서도
892
932
  `지난주 로그인 버그 보던 데서 계속해줘`처럼 시점과 작업을 설명할 수 있다. 저장소 이름, 원래
893
933
  메시지 링크, `/new`는 필요 없다. 먼저 헤드 프로필의 **OMP Mnemopi `recall`**로 단서를 찾고,
@@ -1484,6 +1524,65 @@ bun --no-env-file src/cli.ts uninstall --config config.local.json
1484
1524
  실패한 시작을 자동 반복하지 않는다. 등록 성공은 모든 crash 복구의 보장이 아니다.
1485
1525
  - Linux/systemd·Windows 서비스 설치와 Gateway crash 자동 재시작은 이 명령의 범위가 아니다.
1486
1526
 
1527
+ ### 원격 워커 추가
1528
+
1529
+ “이 저장소 Linux에서 테스트해”라고 했을 때 다른 머신에 레인을 열 수 있습니다.
1530
+ 메신저 계정과 봇 토큰은 **헤드에만** 둡니다. 양쪽 모두 `omp-sa worker`가 있는
1531
+ 빌드를 사용하세요. 아직 배포되지 않은 소스라면 이전 npm 버전 대신 [로컬 준비](#1-로컬-준비--봇은-시작하지-않음)의 소스 설치 방법을 따르세요.
1532
+
1533
+ 1. **워커에서:** [로컬 준비](#1-로컬-준비--봇은-시작하지-않음)에 따라 Git, Bun, stock OMP, `omp-superagent`를 설치합니다.
1534
+ 실행 파일과 `omp-superagent` 설치 경로는 등록할 작업용 checkout 밖에 있어야 하며,
1535
+ 다른 사용자가 해당 경로의 파일을 교체할 수 없어야 합니다.
1536
+ 작업할 계정에서 OMP 모델 인증과 네이티브 메모리 백엔드를 설정하세요. 워커에서는 셸 명령으로
1537
+ 가져오는 API 키와 원격 인증 브로커를 지원하지 않습니다. 메모리 백엔드가 없다면
1538
+ 예를 들어 `omp config set memory.backend mnemopi`를 사용할 수 있습니다. 같은 Git 저장소의 전용 clone을
1539
+ **요청할 커밋으로** 맞춥니다. 커밋만 받아 놓고 다른 브랜치에서 작업 중인 상태로는 부족합니다.
1540
+ 테일넷 등 사설망을 통해 이 계정의 **OpenSSH 서버**에 접속할 수 있어야 합니다.
1541
+ `authorized_keys`의 지정 명령 제한을 사용하므로 Tailscale SSH 자체의 로그인 정책으로 대체할 수 없습니다.
1542
+ 공개 포트, 두 번째 헤드, 워커에서의 `omp-sa setup`이나 `omp-sa start`는 필요 없습니다.
1543
+ 2. **헤드에서:** 워커 운영자와 SSH 호스트 키 지문을 확인한 뒤 `known_hosts`에 등록합니다.
1544
+ `~/.ssh/config` 별칭 대신 직접 접속할 수 있는 DNS 이름이나 IP를 사용하세요. Tailscale SSH가
1545
+ 22번 포트를 사용한다면 사설망에서 별도 포트로 수신하는 OpenSSH를 사용하세요. 해당 키는
1546
+ `known_hosts`의 `[호스트]:포트`에 고정하고, 두 번의 `worker add` 모두 `dev@linux-box:포트`를
1547
+ 지정합니다. 기본 SSH 포트를 쓸 때는 다음과 같습니다.
1548
+ ```sh
1549
+ omp-sa worker add dev@linux-box --config ./config.local.json
1550
+ ```
1551
+ 3. **워커에서 `dev` 계정으로:** 위 명령이 출력한 `worker init` 명령을 실행합니다.
1552
+ 생성된 헤드의 **공개키**는 그대로 두고 예시 경로만 실제 저장소로 바꾸세요.
1553
+ ```sh
1554
+ omp-sa worker init --head-key 'ssh-ed25519 …' --repo "$HOME/src/my-app"
1555
+ ```
1556
+ 지정된 워커 명령만 호출할 수 있는 전용 키가 `~/.ssh/authorized_keys`에 등록됩니다.
1557
+ 헤드의 개인 키·봇 토큰·설정 파일은 복사하지 마세요. 레인의 도구는 워커 OS 계정의
1558
+ 권한으로 실행되므로 다른 파일과 격리하려면 전용 계정을 사용하세요.
1559
+ 4. **다시 헤드에서:** 같은 `worker add` 명령을 실행합니다. 처음 안내가 나왔을 때가
1560
+ 아니라 **`verified`가 표시되어야 등록 완료**입니다. 특정 헤드 checkout의 새 레인에
1561
+ 이 워커를 우선 사용하려면 `--default --local-repo /헤드의/경로/my-app`을 붙입니다.
1562
+ `--local-repo`를 생략하면 설정의 `headCwd`를 사용합니다. 같은 Git 원격 주소라도
1563
+ 다른 checkout에 이 기본 배치 권한이 넘어가지는 않습니다.
1564
+
1565
+ 등록 목록은 `omp-sa worker list --config ./config.local.json`으로 확인합니다. 목록 조회는
1566
+ 워커에 접속하지 않습니다. 지금 연결되는지 확인하려면
1567
+ `omp-sa worker doctor dev@linux-box --config ./config.local.json`에 등록 때 쓴 주소와
1568
+ 포트를 그대로 지정하세요. 워커 신원과 빈 슬롯을 확인하며, 기본 워커라면 승인된 헤드
1569
+ checkout의 현재 커밋도 대조합니다. 확인이 막히면 종료 코드는 0이 아니며, 레인을 시작하지 않습니다.
1570
+
1571
+ 이제 채팅에서 원격 실행이나 필요한 OS를 지정하면 됩니다. 저장소는 폴더 이름이 아니라
1572
+ Git 원격 주소로 매칭합니다. 커밋하지 않은 변경과 무시된 파일을 동기화하지 않으므로
1573
+ 깨끗한 커밋을 기준으로 요청하세요. 실행 중인 레인이 해당 checkout을 예약하며
1574
+ 자동 fetch·브랜치 전환·변경 폐기는 하지 않습니다. 후속 요청은 같은 워커의 같은 세션으로 갑니다.
1575
+ SSH가 끊겨도 Host 자체는 종료되지 않습니다. Host가 종료된 뒤 checkout이 달라져 있으면
1576
+ 재기동은 보류됩니다. 답변과 승인 카드는 원래 대화로 돌아오지만 메신저 첨부파일 전달과
1577
+ 헤드의 로컬 SQLite 보드 접근은 원격 레인에서 지원하지 않습니다. 헤드의 OMP 실행 명령에
1578
+ 도구·프로필·승인 등의 추가 플래그가 있으면 이를 빼고 원격 실행하지 않고 요청을 거부합니다.
1579
+ 워커는 자동 로드 플러그인이 없는 전용 OMP 프로필을 사용하세요. `.omp/`, `.env`, Git 필터 등
1580
+ 실행 설정이 있는 checkout, linked worktree, 서브모듈은 자동으로 수정하거나 로드하지 않고 거부합니다.
1581
+ 커스텀 모델 확장이 필요하면 워커 OMP agent 디렉터리의 `worker-extensions.json`(`0600`)에
1582
+ 등록된 checkout 밖의 신뢰하는 모듈 절대경로를 JSON 배열로 적습니다. 배치된 위치는
1583
+ `omp-sa status --config ./config.local.json`에서 확인합니다. 접근을 철회할 때는
1584
+ 워커에서 **해당 등록 키만** 제거하세요. 키 제거가 이미 실행 중인 레인을 중단하지는 않습니다.
1585
+
1487
1586
  ## 5. 운영 범위와 복구 제약
1488
1587
 
1489
1588
  - 자율 작업은 기존 native task/job·goal·workflow owner를 사용하며 원래 허가 목표·source/route·
@@ -1564,7 +1663,7 @@ bun --no-env-file src/cli.ts uninstall --config config.local.json
1564
1663
 
1565
1664
  ## 6. 개발자 검증
1566
1665
 
1567
- 원격 등록·레인 제어는 [워커 추가 절차](../README.ko.md#원격-워커-추가)로 설정한다.
1666
+ 원격 등록·레인 제어는 [워커 추가 절차](#원격-워커-추가)로 설정한다.
1568
1667
  OpenSSH 클라이언트·서버와 stock OMP가 설치되어 있으면 아래 명령으로 별도 머신 없이
1569
1668
  등록 → 원격 시작 → 연결 해제/재접속 → 후속 메시지와 답변 → 종료를 시험할 수 있다.
1570
1669
  임시 HOME과 전용 키, 루프백 `sshd`, 오프라인 모델을 사용한다. 실제 테일넷 연결이나
@@ -1,6 +1,6 @@
1
1
  # Execution and coordination
2
2
 
3
- [Architecture](../../DESIGN.md) · [Messaging and authority](messaging.md) · [Operations](../OPERATIONS.md)
3
+ [Architecture](../../DESIGN.md) · [Messaging and authority](messaging.md) · [Operations](../OPERATIONS.en.md)
4
4
 
5
5
  ## Lane control
6
6
 
@@ -24,7 +24,7 @@ journal. An SSH disconnect is client detach, not cancellation, an exit receipt,
24
24
  or authority to reassign work. Open and attachment are separate from sending
25
25
  the first input. A pending or ambiguous launch must be reconciled on that
26
26
  worker, never retried on another machine. Remote PIDs and session paths are not
27
- local filesystem or board identities. See [worker enrollment](../../README.md#add-a-remote-worker).
27
+ local filesystem or board identities. See [worker enrollment](../OPERATIONS.en.md#add-a-remote-worker).
28
28
 
29
29
  When several workers qualify, placement accounts for both reported free slots
30
30
  and head assignments waiting to start. Concurrent admissions reserve their
@@ -85,6 +85,44 @@ runtime exposes observation timestamps and `ownerCurrent`, not a guarantee
85
85
  that a reported dependency is still live. Native children cannot use the
86
86
  manager, report as the lane, or access the board.
87
87
 
88
+ ### Bound-topic assignment scope review
89
+
90
+ An existing assignment can conflict with a later explicit owner correction.
91
+ Ordinary bound-topic requests and replies still stay in the lane. For a
92
+ standalone original owner message in the active bound topic, the root lane
93
+ may call `lane_report({status:"scope_review", sourceId})` **directly**, using
94
+ the current original source ID. The arguments cannot contain a target,
95
+ owner-text copy, or lane-authored explanation. A scope review is neither a
96
+ progress report nor a manager handoff. It has only an identity receipt from
97
+ the native tool result and appends no custom progress event.
98
+
99
+ The controller requires a matched native execution start and successful end
100
+ from the exact current root lane session, file, request and generation. It
101
+ rejects eval, `xd://`, custom-only or replayed receipts and fails closed on
102
+ steering ambiguity. It rechecks the authenticated original owner input and
103
+ its current topic binding independently. Both the review and corrective
104
+ prompt require a fresh Gateway check of the original messenger account; a
105
+ stored allowlist alone is insufficient after reconnect. A newer owner
106
+ message in the same topic takes precedence even if catch-up admitted the
107
+ older physical message last. Review requires exact trimmed owner text with
108
+ no detected credentials or excluded material, including quotes spanning
109
+ lines. Ineligible text stays in the bound lane; its
110
+ redacted or projected remainder cannot authorize a review. HEAD compares
111
+ the eligible text against the existing assignment and receives no lane
112
+ prose, quote, or attachment as part of the review.
113
+
114
+ If the original text explicitly supersedes the conflicting scope, the only
115
+ allowed dispatch is a direct `lane_message` to that same lane with its review
116
+ ID as `sourceId` and the exact verified owner text as `text`, without a
117
+ workflow or override. The controller may dispatch one fresh, deduplicated
118
+ corrective input only after the original lane run and HEAD review both
119
+ settle successfully. The correction applies only to that assignment, not to
120
+ tool availability, native approvals, operator settings, or other work. It
121
+ cannot replay denied or uncertain effects. The lane delivers the corrected
122
+ outcome on the original thread; HEAD does not echo the request or add a
123
+ second reply. If the correction is unsupported or unclear, HEAD gives one
124
+ bounded reason or clarification there, without dispatching work.
125
+
88
126
  ### Failed lane requests
89
127
 
90
128
  Confirmed provider quota exhaustion is an operator decision, not a recovery
@@ -138,6 +176,10 @@ journal persistence. An enabled native goal, including a paused one, can prevent
138
176
  shutdown. Do not infer eligibility from `agent_end`, an RPC disconnect, a saved
139
177
  file, or a lease alone. Release ownership and the slot only after actual native
140
178
  exit; a shutdown ACK is not exit. Reload the same native session when authorized.
179
+ A read-only ownership snapshot may resample the full evidence for the same
180
+ root after native child registration and attachment invalidate successive
181
+ reads. After at most two resamples, another change leaves ownership
182
+ unverified. Root mismatches, other failures and maintenance drains do not retry.
141
183
 
142
184
  The resident Rust owner speaks the stock JSONL/v2 protocol. Bun and the published SDK still
143
185
  prepare and publish the native session under its exact profile. One short-lived
@@ -327,6 +369,45 @@ the original topic, not a model turn or native approval. The head validates
327
369
  the menu's session and generation before applying it, and an effort selection
328
370
  also requires the model for which the options were shown.
329
371
 
372
+ ## Owner-facing reply voice
373
+
374
+ [SOUL](../../src/soul.ts) is an instance-wide presentation preference, not a
375
+ role, workflow, or OMP profile. The default and the one saved override use
376
+ bounded choices for presentational concept (plain, editorial, or mentoring),
377
+ tone, register, detail, answer order, and emoji. The HEAD
378
+ contract still defines its identity. The `soul_update` native tool checks the
379
+ current root HEAD session and a fresh, explicit original owner request. The
380
+ controller derives the supported combination from that exact message, not from
381
+ model-supplied fields. A plain request already addressed to HEAD does not need
382
+ a command or a SOUL keyword. Questions, one-off requests, quotes, edits,
383
+ derived input, and restricted-group messages cannot authorize a change. The
384
+ instance ledger owns the revision and readback. Choosing a concept does not
385
+ change any other setting by implication or establish a new role.
386
+
387
+ The controller supplies the current voice on new, eligible owner-facing
388
+ HEAD turns (including synthesis from a normal lane report) and on direct
389
+ topic-reply lane turns. It uses the admitted run's delivery scope, not message
390
+ content or the current channel. A steer inherits the opening run's scope:
391
+ joining an active manager handoff does not give the lane the reply voice.
392
+ The private owned Host takes only the closed voice profile and renders a
393
+ root-only, temporary system block. An opaque admission token is removed at
394
+ the stock input boundary; neither token nor style enters the user history,
395
+ lane brief, or global `PERSONALITY.md`. Native task children, internal control prompts,
396
+ structured replies, and code-generated notices do not use it. Settings apply
397
+ to the next eligible run on a capable resident Host, without reloading its
398
+ session or changing SUPER activation. Hosts advertising reply voice v2 also
399
+ receive the concept; v1 Hosts continue receiving the original style fields
400
+ without the concept. Hosts with no capability continue unstyled.
401
+
402
+ The prompt boundary was compared with [Cataly `d2cb7078`](https://github.com/vntrevx/Cataly/blob/d2cb7078033ccab27895515d4c566fe7ed4078de/extension/index.ts#L1274-L1295),
403
+ [OpenClaw `6978b40e`](https://github.com/openclaw/openclaw/blob/6978b40e9d3812083064c97e24de00454d6bf868/docs/concepts/system-prompt.md#L166-L185),
404
+ [Hermes `242315ce`](https://github.com/NousResearch/hermes-agent/blob/242315ce571cde721e717a544cf8ae6c343315cf/agent/system_prompt.py#L547-L553),
405
+ and [Dori `3b5487df`](https://github.com/vntrevx/omp-dori/blob/3b5487df12540cdd428ebcf7455375d72921e2dc/skills/dori-mode/SKILL.md#L65-L74).
406
+ These are design references, not prompt or code reuse. The stock OMP extension
407
+ and RPC contract was inspected at [v19.1.1](https://github.com/can1357/oh-my-pi/commit/31ffee513f27a01bba7d4dfbe12bae239cdc646a);
408
+ the installed Host advertises the optional bridge rather than inferring it
409
+ from a CLI version.
410
+
330
411
  ## Workflow selection
331
412
 
332
413
  The root role extensions add only their own role instructions to native context.
@@ -446,7 +527,7 @@ discarding custom commands or enabling disabled extensions.
446
527
  jobs remain inspectable and removable; pending runs are cancelled rather
447
528
  than forwarded to a model, and queued shell output is not sent. Verify any
448
529
  previously started legacy run on its original host before resolving it.
449
- See the [operator reference](../OPERATIONS.md#예약-작업-cron) for syntax and controls.
530
+ See the [operator reference](../OPERATIONS.en.md#scheduled-jobs-cron) for syntax and controls.
450
531
  - [Repository PR intake](../../src/cron-pr-intake.ts) is a typed cron job, not
451
532
  an executable prompt. Only original configured-owner Discord guild parent
452
533
  controls enroll a repository. Discovery pins the authenticated GitHub owner
@@ -468,7 +549,7 @@ discarding custom commands or enabling disabled extensions.
468
549
  effect checks the enrolled repository, original route and policy revision;
469
550
  higher stages require an explicit policy or a fresh SHA-bound owner command.
470
551
  An uncertain write permits read-only reconciliation, not resubmission. See [operator commands
471
- and supported GitHub protections](../OPERATIONS.md#새-외부-pr-검토-cron-pr-add).
552
+ and supported GitHub protections](../OPERATIONS.en.md#reviewing-new-external-prs-cron-pr-add).
472
553
  - [PR watch](../../src/pr-watch.ts) reads only explicitly registered GitHub PRs
473
554
  through existing `gh` authentication and GETs. Establish a quiet baseline,
474
555
  then record changed observations and their cursor together. Work only while
@@ -1,6 +1,6 @@
1
1
  # Messaging and authority
2
2
 
3
- [Architecture](../../DESIGN.md) · [Execution and coordination](execution.md) · [Operations](../OPERATIONS.md)
3
+ [Architecture](../../DESIGN.md) · [Execution and coordination](execution.md) · [Operations](../OPERATIONS.en.md)
4
4
 
5
5
  ## Transport and identity
6
6
 
@@ -22,6 +22,7 @@ topic is a binding key, not a fabricated conversation or thread ID.
22
22
  | [Discord](../../gateway/src/discord.rs) | Discord Gateway and REST verify the bot/owner and configured guild and parent-channel allowlists; owner one-to-one DMs are separately allowed. History recovery is for known routes after their saved cursors, not unseen chats or all edits/deletions. |
23
23
  | [Telegram](../../gateway/src/telegram.rs) | Bot API `getMe` identifies the bot. Use the configured real owner and allowed chats; anonymous, forwarded, bot-mediated and business identities do not confer authority. Long poll only after startup approval reconciliation; refuse an active webhook without removing it. |
24
24
  | [Slack](../../gateway/src/slack.rs) | Socket Mode and the Web API, with bot/workspace and active human owner checks and actual channel membership. No group DMs or public HTTP endpoint. Known-route history is limited by cursors, scopes, membership, retention and rate limits. |
25
+ | [KakaoTalk](../../gateway/src/kakao.rs) | No Kakao login. Polls an operator-run [loopback bridge](../kakao-bridge-protocol.md) with a dedicated token over a proxy-free, redirect-free client. Admits only rows whose sender, chat and numeric log ID match the configured owner one-to-one chat, at most once per log ID. A first contact or inbox generation change saves a baseline instead of replaying history. Replies carry deterministic push IDs; the bridge fixes the destination. Approval cards are cancelled with a notice, never accepted. No threads, attachments or group rooms. |
25
26
 
26
27
  Set `discord.requireAddressing` to `true` to filter ordinary owner messages in
27
28
  allowed Discord guild parent channels and threads not created by this bot,
@@ -37,6 +38,12 @@ The owner, guild and parent-channel checks still apply. Owner DMs, Discord
37
38
  application commands, approval components and restricted group rooms retain
38
39
  their existing policies.
39
40
 
41
+ Standalone owner preferences, such as the shared reply voice, cannot be set
42
+ through a reply, forward, or attachment. Adapters keep that provenance even
43
+ when a Telegram external reply, Discord forward, or Slack shared attachment
44
+ has no usable in-route snapshot. This marker does not change routing or message
45
+ identity and does not import external reply content.
46
+
40
47
  The Gateway records pending owner-message candidates before advancing the
41
48
  Discord WebSocket sequence. Until it verifies the sender and route, it keeps
42
49
  only lookup coordinates and revision evidence, not message or attachment
@@ -221,7 +228,7 @@ input as cancelled. A stalled lane exposes its exact input ID and queue blocker
221
228
  through `/status` or `lane_inspect`. Only the operator in the bound topic can use
222
229
  `/resolve --lane <input-id>` to cancel that uncertain input. This is not a native
223
230
  interrupt, replay or implicit resume, and it preserves other fences and pauses.
224
- See the [operations guide](../OPERATIONS.md#4-명령과-일상-사용) for command usage.
231
+ See the [operations guide](../OPERATIONS.en.md#4-commands-and-daily-use) for command usage.
225
232
 
226
233
  ## Topic routing and controls
227
234
 
@@ -328,6 +335,9 @@ See the [operations guide](../OPERATIONS.md#4-명령과-일상-사용) for comma
328
335
  answers instead pass through the controller's source-bound outbox without a
329
336
  synthesis turn. Approval cards stay with their original native session and
330
337
  authorized route.
338
+ - Send an explicit [SOUL reply voice change](execution.md#owner-facing-reply-voice)
339
+ through `/head` from a bound thread. Ordinary lane requests, reports and
340
+ quoted text do not become global settings changes.
331
341
  - Thread-first work sends a short kickoff to the selected topic. The durable
332
342
  `sent` receipt gates new lane dispatch and steering for that input. A missing
333
343
  or uncertain delivery is not a successful kickoff.
@@ -0,0 +1,193 @@
1
+ # KakaoTalk bridge protocol (version 2)
2
+
3
+ [Operations guide (Korean)](OPERATIONS.md#24-kakaotalk-로컬-브리지-주인-11-전용) ·
4
+ [Operations guide (English)](OPERATIONS.en.md#24-kakaotalk-local-bridge-owner-one-to-one-only) ·
5
+ [Reference bridge](../scripts/kakao-reference-bridge.ts) · [Adapter](../gateway/src/kakao.rs)
6
+
7
+ KakaoTalk has no bot API. The Gateway's `kakao` adapter therefore never signs in to
8
+ Kakao, stores no Kakao credentials and never contacts Kakao servers. It talks to a
9
+ **bridge** that the operator runs on the same machine. The bridge owns whatever Kakao
10
+ session or client automation the operator chooses. Superagent does not ship one: the
11
+ repository contains only a [reference bridge](../scripts/kakao-reference-bridge.ts)
12
+ with an in-memory inbox for tests and local demos.
13
+
14
+ > **Terms of service risk.** Automating a personal KakaoTalk account is not an
15
+ > official Kakao integration. It can violate Kakao's terms of service and may lead to
16
+ > account restriction or suspension. Kakao may change its client or protocol at any
17
+ > time. The operator alone chooses, runs and is responsible for the bridge. Use a
18
+ > separate account where possible and do not automate other people's chats.
19
+
20
+ ## Roles
21
+
22
+ | Role | Responsibility |
23
+ | --- | --- |
24
+ | Bridge | Receives Kakao messages, durably records messages that the owner sent in the owner's one-to-one chat with the bridge account, serves them on the inbox endpoint, and delivers replies to that same chat only. |
25
+ | Adapter (Gateway) | Polls the inbox, admits rows that exactly match the configured owner and chat, and posts the head's replies. It cannot choose a destination. |
26
+
27
+ Group chats, open chats and other people's one-to-one chats are out of scope for
28
+ version 2. A bridge MUST NOT place their messages in the Superagent inbox.
29
+
30
+ ## Transport and authentication
31
+
32
+ - Plain HTTP on a literal loopback address: `127.0.0.1` or `[::1]`, with an explicit
33
+ port. The adapter rejects host names (including `localhost`), other addresses,
34
+ HTTPS, credentials, query strings and fragments in `bridgeUrl`. It uses a dedicated
35
+ HTTP client with environment/system proxies disabled, no redirects and no retries.
36
+ - A path in `bridgeUrl` is a base: `http://127.0.0.1:8080/kakao` uses
37
+ `/kakao/superagent/inbox`, `/kakao/superagent/v2/destination`, and
38
+ `/kakao/superagent/v2/send`.
39
+ - Every request carries exactly one `X-Superagent-Token` header. The token is a
40
+ dedicated secret for this interface only: at least 24 characters from
41
+ `[A-Za-z0-9_-]`. Do not reuse a token that also authorizes other bridge features.
42
+ The adapter reads it from the environment variable named by `kakao.tokenEnv`.
43
+
44
+ The bridge MUST:
45
+
46
+ 1. Listen only on loopback and check that the peer address is loopback.
47
+ 2. Reject (`403`) any request carrying a proxy or forwarding header (`Forwarded`,
48
+ `X-Forwarded-For`, `X-Real-IP`, `CF-Connecting-IP`) or a browser header (`Origin`,
49
+ `Referer`, `Sec-Fetch-Site`). This blocks tunnelled requests and browser-based
50
+ cross-site requests to the loopback port.
51
+ 3. Reject (`403`) zero or several token headers and compare the token in constant
52
+ time.
53
+ 4. Never log the token or message bodies at default verbosity.
54
+ 5. Never send replies anywhere but the owner's one-to-one chat. Check the required
55
+ expected destination against the actual authenticated account and fixed chat
56
+ before each write. It is a precondition, not a destination selector. A mismatch
57
+ MUST be refused before any queueing or delivery; ignore fields that try to select
58
+ another destination.
59
+
60
+ ## `GET /superagent/inbox`
61
+
62
+ Query parameters:
63
+
64
+ | Name | Meaning |
65
+ | --- | --- |
66
+ | `after` | Last row ID the adapter has processed (`0` on first contact). |
67
+ | `generation` | Inbox generation the adapter last saw (empty on first contact). |
68
+ | `limit` | Maximum rows to return. The adapter sends `50`. The bridge MUST NOT return more. |
69
+
70
+ Response: `200`, `Content-Type: application/json`.
71
+
72
+ ```json
73
+ {
74
+ "generation": "f1d2c3",
75
+ "latest": 42,
76
+ "messages": [
77
+ {
78
+ "id": 41,
79
+ "logId": "3279618400000000001",
80
+ "chatId": "18400000000000001",
81
+ "senderId": "4000001",
82
+ "text": "status?",
83
+ "receivedAtMs": 1764000000000,
84
+ "stale": false
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ - `generation`: non-empty opaque string. It identifies one inbox history. The bridge
91
+ MUST change it whenever row IDs can repeat or go backwards (database recreated or
92
+ restored from backup). The reference rule: if `generation` matches but `after` is
93
+ greater than `latest`, issue a new generation.
94
+ - `latest`: the highest row ID currently stored, `0` when empty.
95
+ - If the requested `generation` differs from the current one, the bridge returns the
96
+ current `generation` and `latest` with **no** messages. The adapter then saves a
97
+ new baseline instead of replaying history: on first contact it starts after `latest`
98
+ (old commands are never executed); after a generation change it starts at `0`.
99
+ - Otherwise, return rows with `id > after` in ascending `id` order, at most `limit`.
100
+ - `id`: positive integer, strictly increasing within a generation.
101
+ - `logId`: Kakao's numeric message log ID, a decimal string without leading zeros (at
102
+ most 20 digits). It is the durable message identity: the adapter admits
103
+ `kakao:<botUserId>:<chatId>:<logId>` at most once, so replaying a row is harmless.
104
+ - `chatId`, `senderId`: decimal strings. The adapter drops rows that are not from the
105
+ configured `ownerId` in the configured `chatId`. Only the row ID is logged.
106
+ - `text`: 1 to 4000 characters after trimming. Longer rows are dropped.
107
+ - `receivedAtMs`: positive Unix milliseconds no greater than 2^53 − 1.
108
+ - `stale` (optional, default `false`): the bridge sets it for a row that is too old to
109
+ act on safely (the reference bridge uses 30 minutes since recording). The adapter
110
+ durably retires the Kakao log ID before attempting one notice, so a rebuilt
111
+ inbox cannot later execute it as fresh or replay an ambiguous notice.
112
+ - The whole response body MUST stay below 4 MiB.
113
+
114
+ A non-JSON `200` (for example an HTML page from an older bridge), a non-`2xx` status,
115
+ invalid JSON, an oversized body, or an invalid page (limit, order, range, or
116
+ generation) produces no admissions and leaves the adapter's cursor unchanged.
117
+ It retries after a short back-off and logs one line per distinct error per minute.
118
+
119
+ ## `GET /superagent/v2/destination`
120
+
121
+ Return `200 application/json` with the authenticated bridge account, owner, and
122
+ fixed one-to-one chat: `{"botUserId":"900","ownerId":"42","chatId":"777"}`.
123
+ The adapter compares all three fields with its configuration before sending
124
+ any output. Missing, unverifiable, or different identity stops the send without
125
+ posting any text. Version 1's send endpoint is never used.
126
+
127
+ ## `POST /superagent/v2/send`
128
+
129
+ Request body (`Content-Type: application/json`):
130
+
131
+ ```json
132
+ {
133
+ "pushId": "sa-0123456789abcdef01234567-0-2",
134
+ "outputId": "out-17",
135
+ "message": "plain text",
136
+ "expectedDestination": {"botUserId":"900","ownerId":"42","chatId":"777"}
137
+ }
138
+ ```
139
+
140
+ - `pushId`: `sa-` followed by at most 120 characters from `[A-Za-z0-9._:-]`. It is
141
+ derived deterministically from the durable output, chunk index and chunk count.
142
+ The bridge MUST deliver a given `pushId` at most once, including across restarts.
143
+ An identical repeated request returns the same known receipt or unconfirmed
144
+ state, without another send. Conflicting reuse of a push ID is refused.
145
+ - `outputId`: the Superagent output that produced this chunk (informational; useful for
146
+ matching answers to requests). Every chunk of one output shares it.
147
+ - `message`: plain text, 1 to 1500 characters. The adapter strips Markdown and splits
148
+ long replies at line breaks (at most 20 chunks per output).
149
+ - `expectedDestination`: the required fixed tuple. The bridge rechecks it
150
+ against the actual destination immediately before queueing or writing, even
151
+ if the previous read succeeded.
152
+
153
+ Responses:
154
+
155
+ | Status | Body | Adapter behaviour |
156
+ | --- | --- | --- |
157
+ | `200` | `{"ok":true,"state":"delivered","pushId":"…","destination":{"botUserId":"900","ownerId":"42","chatId":"777"},"messageId":"1234"}` | Confirmed only for a matching push ID and destination, with the actual Kakao log ID as a decimal string. |
158
+ | `2xx` | `{"ok":true,"state":"queued"}` | Queue acceptance only. The delivery is uncertain; no automatic resend. |
159
+ | `409` | any | Definitely refused before any effect; the chat is temporarily quiet. |
160
+ | other `4xx` | any | Definitely refused before any effect, including `403` for a wrong destination. |
161
+ | `5xx`, timeout, invalid or oversized (> 64 KiB) receipt | any | Outcome unknown. Superagent does not resend automatically. |
162
+
163
+ Each chunk needs its own confirmed Kakao log ID. A failed later chunk after
164
+ confirmed delivery of an earlier one leaves the output uncertain, never
165
+ definitely rejected or fully sent. Reconcile with the original bridge and
166
+ chat before authorizing any follow-up. The reference bridge simulates log IDs
167
+ from its in-memory delivery list; it cannot verify a live Kakao delivery.
168
+
169
+ ## Unsupported features
170
+
171
+ Version 2 carries text only. Threads, attachments, reactions, typing indicators and
172
+ presence are unsupported. Approval cards cannot be shown: the adapter sends a short
173
+ notice and records the approval as **cancelled**. It never accepts one on the owner's
174
+ behalf.
175
+
176
+ ## Security model summary
177
+
178
+ | Threat | Mitigation |
179
+ | --- | --- |
180
+ | Another local user or web page calls the bridge | Dedicated token, constant-time comparison, browser-header rejection. Loopback is not a sandbox: anyone who can run code as the same OS user can read the token. |
181
+ | Token leaves the machine | Literal loopback URL only, proxies disabled, redirects not followed. |
182
+ | Remote callers through a tunnel | Bridge rejects forwarding headers and non-loopback peers. |
183
+ | Someone else's message reaches the head | Bridge filters to the owner's one-to-one chat; adapter re-checks `ownerId`, `chatId` and `logId` on every row. |
184
+ | Replay after restart or restore | `generation` baseline, `after` cursor, and once-only admission by `logId`. |
185
+ | Duplicate sends after a timeout | Deterministic `pushId` and bridge-side deduplication; unknown outcomes are not resent automatically. |
186
+ | Prompt injection in owner chat | Messages are owner input with the same authority as the owner's other messengers. Anyone who controls the owner's Kakao account controls the head, as with any configured messenger. |
187
+ | Unbounded responses | 10 s request timeout, 2 s connect timeout, page and byte limits. |
188
+
189
+ ## Versioning
190
+
191
+ Version 2 retains the inbox endpoint and uses versioned destination and send
192
+ endpoints so an older bridge cannot ignore the new precondition on a write.
193
+ New optional response fields may be added; adapters ignore unknown fields.
@@ -0,0 +1,17 @@
1
+ # omp-superagent 0.1.10
2
+
3
+ - **Optional KakaoTalk adapter.** Gateway can receive and reply in an owner's one-to-one chat through an operator-run loopback bridge. Superagent does not sign in to Kakao or ship a live Kakao client. See the [bridge protocol and limitations](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/kakao-bridge-protocol.md) before enabling it (#56).
4
+ - **Shared reply style for HEAD and lanes.** Tell HEAD how to answer future requests. The saved style applies to new conversational replies and survives restart, but does not change tools, approvals, or workflows. Ordinary messages in a bound work thread still go to its lane (#57, #58).
5
+ - **Safer recovery after interruptions.** HEAD retries interrupted reads of native completion records. The Host owner retries ownership observation if descendants change, and an exited lane Host no longer holds its slot. A fresh `/restart` can retry a failed checkpoint when no stop was sent (#59, #60, #61, #62).
6
+ - **Shorter READMEs and a complete English operations guide.** The [Korean guide](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/OPERATIONS.md) remains available.
7
+
8
+ ## Install or upgrade
9
+
10
+ ```sh
11
+ bun add --global --trust omp-superagent@0.1.10
12
+ omp-sa --help
13
+ ```
14
+
15
+ Alternatively, use `npm install --global omp-superagent@0.1.10` with Bun 1.4.4 or later on `PATH`. Install OMP separately; CI uses stock OMP 19.1.1. Installing does not restart a running Gateway.
16
+
17
+ [Changes since 0.1.9](https://github.com/dbc-hbin/omp-superagent/compare/v0.1.9...v0.1.10) · [Operations guide](https://github.com/dbc-hbin/omp-superagent/blob/v0.1.10/docs/OPERATIONS.en.md)
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-superagent",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "One messenger-connected OMP head with independent work sessions",
5
5
  "license": "MIT",
6
6
  "author": "dbc-hbin",