npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sunny-agent/agent-connector

v1.0.3

Published

Reverse WebSocket relay between local Codex/Claude Code runtimes and Sunny Gateway

Downloads

54

Readme

Sunny Agent Relay

로컬 맥에서 Codex app-server, Claude Agent SDK, 또는 sena-ai agent를 실행해 원격 Sunny Gateway에 붙이는 connector/relay 패키지입니다.

Sena config connector

Sena 프로젝트에서는 sena.config.ts에 Sunny connector를 직접 붙이는 방식을 우선 사용합니다.

pnpm add -D @sunny-agent/agent-connector@^1.0.3

@sunny-agent/contracts는 직접 설치하지 않습니다. @sunny-agent/[email protected]가 호환되는 @sunny-agent/[email protected]을 dependency로 가져옵니다.

import { defineConfig, env } from '@sena-ai/core'
import { sunnyConnector, sunnySystemHook } from '@sunny-agent/agent-connector'

export default defineConfig({
  // 기존 runtime/tools/schedules 설정은 유지한다.
  connectors: [
    sunnyConnector({
      gatewayUrl: env('SUNNY_GATEWAY_URL'),
      authToken: env('AGENT_RELAY_AUTH_TOKEN'),
    }),
  ],
  hooks: {
    onTurnStart: [
      sunnySystemHook(),
    ],
  },
})

sunnySystemHook()은 Sunny connector에서 들어온 turn에만 SAY, SCENE, DELTA 출력 프로토콜을 system context로 주입합니다. 자세한 운영 가이드는 SUNNY_SETUP_GUIDE.md를 봅니다.

Codex

Codex는 codex app-server --listen stdio://를 장기 실행하고, 릴레이가 app-server JSON RPC로 thread/turn을 제어합니다.

export AGENT_RELAY_AUTH_TOKEN="<gateway와 같은 토큰>"
export SUNNY_GATEWAY_URL="<gateway base URL>"
pnpm agent:relay -- --provider codex --cwd /Users/channy/workspace/sunny

Gateway URL은 반드시 --gateway, GATEWAY_URL, 또는 SUNNY_GATEWAY_URL로 설정해야 합니다.

Codex 옵션:

pnpm agent:relay -- \
  --provider codex \
  --model gpt-5.4 \
  --codex-approval never \
  --codex-sandbox danger-full-access \
  --codex-effort high

기본값도 --codex-approval never, --codex-sandbox danger-full-access입니다. 필요할 때만 환경 변수 CODEX_APPROVAL_POLICY, CODEX_SANDBOX 또는 CLI 옵션으로 더 좁게 설정합니다.

Claude Code

Claude Code는 @anthropic-ai/claude-agent-sdkquery() API로 실행합니다.

export AGENT_RELAY_AUTH_TOKEN="<gateway와 같은 토큰>"
export SUNNY_GATEWAY_URL="<gateway base URL>"
pnpm agent:relay -- --provider claude-code --cwd /Users/channy/workspace/sunny

Claude 옵션:

pnpm agent:relay -- \
  --provider claude-code \
  --model claude-sonnet-4-6 \
  --claude-permission auto

Gateway

--gateway는 base URL만 줘도 자동으로 /ws/agent를 붙입니다. 환경 변수는 GATEWAY_URL 또는 SUNNY_GATEWAY_URL을 사용할 수 있습니다.

pnpm agent:relay -- \
  --gateway <gateway base URL> \
  --token "$AGENT_RELAY_AUTH_TOKEN" \
  --provider codex \
  --cwd /Users/channy/workspace/sunny

Logs

기본 출력은 간결 모드입니다. 시스템 지시, 연결 상태, progress delta, tool 이벤트는 숨기고 최신 사용자 메시지와 최종 result만 출력합니다.

[user] 일정 확인해줘
[result] SAY 일정 볼게요.
SCENE {"kind":"spotlight","title":"확인 중","data":{"value":"일정 확인 중"}}

기존처럼 연결 상태와 raw IO JSON을 모두 보려면 --verbose를 켭니다.

로그 prefix:

[sunny-agent-connector:io]

포함되는 이벤트:

input.raw
output.progress.raw
output.progress_delta.raw
output.result.raw
output.error.raw

토큰은 verbose IO 로그에도 포함하지 않습니다.

pnpm agent:relay -- --verbose --provider codex --cwd /Users/channy/workspace/sunny