01 · 개요와 아키텍처
선택지가 갈라지는 이야기는 분기가 2n으로 불어납니다. 조건식 수백 개와 상태 변화가 게임 클라이언트 코드 곳곳에 흩어지면, 사람 작가도 AI 에이전트도 어떤 장면에 실제로 닿을 수 있는지 끝까지 따라가기 어렵습니다. 602 v2.0.2는 이 흐름을 게임 코드 밖으로 분리합니다. 작가는 로컬 마크다운(.md) 폴더에 평문으로 원고를 쓰고, C11 네이티브 엔진(story_engine_v2.h)이 파싱과 정적 진단, 1턴 시뮬레이션, 역방향 도달 추적(Backward Reachability)을 한곳에서 맡습니다.
핵심 설계 원칙
- 로컬 마크다운 폴더 집필 (Git 친화적 구조): 원고는
project.json, 전역 선언 파일 declarations.md, 장면별 원고 events/*.md, 다국어 번역 표 translations.json이 담긴 일반 폴더입니다. 별도 서버나 데이터베이스 없이 바로 글을 쓰고 Git으로 버전을 관리할 수 있습니다.
- 호스트가 부를 때만 도는 결정론적 실행: 602 Story Engine은 백그라운드 스레드나 자체 틱 루프를 돌리지 않습니다. 마크다운 분석(
story_v2_analyze), 1턴 시뮬레이션(story_v2_simulate / story_v2_execute_play), 정적 진단(story_v2_check), 역방향 도달 경로 계산(story_v2_reach) 모두 호스트가 호출한 순간에만 돌며, 입력이 같으면 언제나 똑같은 결과를 돌려줍니다.
- 에디터와 런타임이 공유하는 단일 엔진 코어: 데스크톱 앱인 602 Studio와 게임 클라이언트에 넣는 네이티브 라이브러리가 똑같은 C11 엔진 코어를 씁니다. 스튜디오의 1턴 플레이어에서 확인한 분기, 인터럽트, 외부 계약 결과는 실제 게임 빌드(
.602.json 런타임 번들)에서도 한 치의 차이 없이 그대로 움직입니다.
- 줄 밀림 없는 AI 에이전트 협업 (Hashline + Base Revision): 줄 내용에서 뽑은 2글자 체크섬
hashline(예: 14#K2)과 파일 리비전 해시(base_revision)를 함께 대조합니다. 사람 작가와 로컬 MCP 에이전트(Claude Desktop, Claude Code, Cursor, Codex 등)가 같은 원고를 함께 고쳐도 줄 번호가 밀리거나 남의 수정을 덮어쓰는 사고를 막아 줍니다.
v2.0.2 배포 패키지 구성 (4종)
네 가지 패키지 모두 CHOAM Community License, Version 1.0을 따릅니다. 다운로드 페이지와 공개 릴리스 v2.0.2에서 SHA-256 체크섬과 함께 내려받을 수 있습니다.
| 패키지 구분 |
파일명 |
대상 플랫폼 |
담긴 내용 |
1. 602 Studio (데스크톱 애플리케이션) |
602-Studio-v2.0.2-macos-arm64.dmg
602-Studio-v2.0.2-windows-x86_64-setup.exe
602-Studio-v2.0.2-linux-x86_64.zip |
macOS 13+ (Apple Silicon) Windows 10/11 x86_64 Linux x86_64 (glibc 2.31+) |
독립 실행형 데스크톱 앱. 3단 워크스페이스, 1턴 플레이어, 1:1 번역 뷰, 내장 C11 엔진과 --compile / --mcp / --smoke-test CLI가 들어 있습니다. |
2. 602 Story Engine (네이티브 C11 SDK) |
story-engine-v2.0.2-macos-arm64.zip
story-engine-v2.0.2-windows-x86_64.zip
story-engine-v2.0.2-linux-x86_64.zip |
macOS arm64 Windows x86_64 Linux x86_64 |
공유 라이브러리(libstory_engine.dylib / story_engine_v2.dll / libstory_engine.so), C11 헤더(story_engine_v2.h), CMake 패키지 설정, 라이선스와 오픈소스 고지문이 담겨 있습니다. |
3. C ABI v2 Headers (헤더 전용 패키지) |
602-story-engine-v2.0.2-headers.zip
story_engine_v2.h |
플랫폼 무관 (C11 / C++17 / P/Invoke / FFI) |
Group A 5종과 Group B 5종 C ABI 선언이 담긴 단일 헤더 story_engine_v2.h와 라이선스 문서입니다. |
4. 602 Documentation (오프라인 문서 번들) |
602-v2.0.2-docs.zip
602-v2.0.2-Documentation.md |
플랫폼 무관 (Markdown) |
602 v2.0.2 전체 구조, 마크다운 문법, C ABI v2, .602.json 스키마, 로컬 MCP 8종 도구를 정리한 오프라인 문서입니다. |
01 · Overview & Architecture
Branching narratives grow exponentially (2n). Once hundreds of conditions and state changes are scattered across game client scripts, neither writers nor AI agents can tell which scenes are still reachable. 602 v2.0.2 pulls story logic out of client code: writers work in plain local Markdown (.md) folders, while a deterministic C11 engine (story_engine_v2.h) handles parsing, static checks, turn-by-turn simulation, and backward reachability.
Design Principles
- Plain Markdown Folders (Git-Ready): A project is just a folder containing
project.json, global declarations in declarations.md, scene files under events/*.md, and optional translations in translations.json. No database or remote server setup is needed.
- Host-Driven, Deterministic Calls: 602 Story Engine runs no background threads or hidden tick loops. Parsing (
story_v2_analyze), turn execution (story_v2_simulate / story_v2_execute_play), static checks (story_v2_check), and backward reachability queries (story_v2_reach) run only when the host calls them, returning identical output for identical inputs.
- One Core in Both Studio and Runtime: 602 Studio and the embeddable native SDK link the exact same C11 core. Every branch, interrupt, and host contract you test in Studio's 1-turn player runs the same way in shipping builds backed by compiled
.602.json bundles.
- Safe Concurrent Editing for AI Agents (Hashline + Base Revision): Pairing 2-character per-line checksums (
hashline, e.g., 14#K2) with file-level revision hashes (base_revision) stops line-drift edits and stale overwrites when writers and local MCP agents (Claude Desktop, Claude Code, Cursor, Codex) work on the same manuscript.
v2.0.2 Distribution Packages (4 Packages)
All four packages ship under the CHOAM Community License, Version 1.0 and are available with SHA-256 checksums on the Download Portal and the public v2.0.2 release.
| Package |
Filenames |
Target Platforms |
Contents |
1. 602 Studio (Desktop Application) |
602-Studio-v2.0.2-macos-arm64.dmg
602-Studio-v2.0.2-windows-x86_64-setup.exe
602-Studio-v2.0.2-linux-x86_64.zip |
macOS 13+ (Apple Silicon) Windows 10/11 x86_64 Linux x86_64 (glibc 2.31+) |
Standalone desktop app with the 3-panel workspace, 1-turn player, 1:1 translation view, embedded C11 engine, and --compile / --mcp / --smoke-test CLI. |
2. 602 Story Engine (Native C11 SDK) |
story-engine-v2.0.2-macos-arm64.zip
story-engine-v2.0.2-windows-x86_64.zip
story-engine-v2.0.2-linux-x86_64.zip |
macOS arm64 Windows x86_64 Linux x86_64 |
Shared library (libstory_engine.dylib / story_engine_v2.dll / libstory_engine.so), C11 header (story_engine_v2.h), CMake config, license, and third-party notices. |
3. C ABI v2 Headers (Header-Only Archive) |
602-story-engine-v2.0.2-headers.zip
story_engine_v2.h |
Platform-independent (C11 / C++17 / P/Invoke / FFI) |
Single header story_engine_v2.h (Group A 5 functions + Group B 5 functions) and license notices. |
4. 602 Documentation (Offline Docs Bundle) |
602-v2.0.2-docs.zip
602-v2.0.2-Documentation.md |
Platform-independent (Markdown) |
Offline reference covering v2.0.2 architecture, Markdown DSL, C ABI v2, .602.json schema, and the 8 local MCP tools. |
01 · 概要とアーキテクチャ
選択肢で分岐する物語は 2n の勢いで膨らみます。何百もの条件式や状態変化がゲームクライアントのコードに散らばると、人間の作家も AI エージェントも「どのシーンに本当に到達できるのか」を追いきれなくなります。602 v2.0.2 は物語の分岐をゲームコードから切り離し、ローカルのプレーンな Markdown(.md)フォルダで執筆できる環境と、パース・静的診断・1 ターン実行・逆方向到達解析(Backward Reachability)を担う C11 ネイティブエンジン(story_engine_v2.h)を組み合わせた構成を採っています。
設計の基本原則
- ローカル Markdown フォルダ執筆(Git でそのまま管理): 原稿は
project.json、グローバル宣言 declarations.md、シーン別ファイル events/*.md、多言語翻訳 translations.json が入った通常のフォルダです。データベースや外部サーバーを用意せず、そのまま執筆して Git で履歴管理できます。
- ホストから呼ばれたときだけ動く決定論的実行: 602 Story Engine はバックグラウンドスレッドや独自のティックループを持ちません。Markdown 解析(
story_v2_analyze)、1 ターン実行(story_v2_simulate / story_v2_execute_play)、静的診断(story_v2_check)、逆方向到達パス算出(story_v2_reach)はいずれもホストが呼び出した時点でのみ動き、同じ入力には常に同じ結果を返します。
- エディタとランタイムで共有する単一エンジンコア: デスクトップアプリの 602 Studio とゲーム組み込み用ライブラリは同じ C11 コアを使います。Studio の 1 ターンプレイヤーで確認した分岐・割り込み・外部契約の挙動が、本番ビルド(
.602.json ランタイムバンドル)でもそのまま再現されます。
- 行ズレを防ぐ AI エージェント協調(Hashline + Base Revision): 行内容から算出した 2 文字チェックサム
hashline(例:14#K2)とファイルリビジョンハッシュ(base_revision)を照合することで、作家とローカル MCP エージェント(Claude Desktop、Claude Code、Cursor、Codex 等)が並行して編集しても行ズレや古い内容での上書きを防ぎます。
v2.0.2 配布パッケージ一覧(4 種)
4 つのパッケージはすべて CHOAM Community License, Version 1.0 の下で配布され、ダウンロードポータルおよび公開リリース v2.0.2から SHA-256 チェックサム付きでダウンロードできます。
| パッケージ区分 |
ファイル名 |
対象プラットフォーム |
収録内容 |
1. 602 Studio (デスクトップアプリ) |
602-Studio-v2.0.2-macos-arm64.dmg
602-Studio-v2.0.2-windows-x86_64-setup.exe
602-Studio-v2.0.2-linux-x86_64.zip |
macOS 13+ (Apple Silicon) Windows 10/11 x86_64 Linux x86_64 (glibc 2.31+) |
単体動作するデスクトップアプリ。3 パネルワークスペース、1 ターンプレイヤー、1:1 翻訳ビュー、内蔵 C11 エンジン、--compile / --mcp / --smoke-test CLI を収録しています。 |
2. 602 Story Engine (ネイティブ C11 SDK) |
story-engine-v2.0.2-macos-arm64.zip
story-engine-v2.0.2-windows-x86_64.zip
story-engine-v2.0.2-linux-x86_64.zip |
macOS arm64 Windows x86_64 Linux x86_64 |
共有ライブラリ(libstory_engine.dylib / story_engine_v2.dll / libstory_engine.so)、C11 ヘッダー(story_engine_v2.h)、CMake 設定、ライセンスおよび OSS 表記を収録しています。 |
3. C ABI v2 Headers (ヘッダーパッケージ) |
602-story-engine-v2.0.2-headers.zip
story_engine_v2.h |
プラットフォーム非依存 (C11 / C++17 / P/Invoke / FFI) |
Group A 5 種と Group B 5 種の C ABI 宣言を収めた単一ヘッダー story_engine_v2.h とライセンス文書です。 |
4. 602 Documentation (オフライン文書) |
602-v2.0.2-docs.zip
602-v2.0.2-Documentation.md |
プラットフォーム非依存 (Markdown) |
v2.0.2 の全体構成、Markdown DSL 構文、C ABI v2、.602.json スキーマ、ローカル MCP 8 種ツールをまとめたオフライン仕様書です。 |
02 · 설치와 링크 가이드
1) SHA-256 체크섬 확인과 602 Studio 실행
내려받은 설치 파일과 .sha256 파일을 같은 폴더에 두고 아래 명령으로 무결성을 확인할 수 있습니다. macOS 배포판(.dmg와 엔진 바이너리)은 모두 Apple Developer ID 코드 서명과 공증(Notarization)을 마쳤습니다.
# macOS (arm64) 무결성 검증 및 마운트
shasum -a 256 -c 602-Studio-v2.0.2-macos-arm64.dmg.sha256
hdiutil attach 602-Studio-v2.0.2-macos-arm64.dmg
cp -R "/Volumes/602 Studio/602 Studio.app" /Applications/
# Windows (x86_64 PowerShell) 무결성 검증 및 설치 프로그램 실행
Get-FileHash .\602-Studio-v2.0.2-windows-x86_64-setup.exe -Algorithm SHA256
.\602-Studio-v2.0.2-windows-x86_64-setup.exe
& "$env:LOCALAPPDATA\Programs\602 Studio\602-studio.exe" --smoke-test
# Linux (x86_64) 무결성 검증 및 실행
sha256sum -c 602-Studio-v2.0.2-linux-x86_64.zip.sha256
unzip -q 602-Studio-v2.0.2-linux-x86_64.zip
./602-Studio-linux-x86_64/602-studio --smoke-test
./602-Studio-linux-x86_64/602-studio
2) 602 Story Engine 폴더 구성
story-engine-v2.0.2-<platform>.zip 압축을 풀면 아래 파일들이 들어 있습니다.
story-engine-v2.0.2-<platform>/
├── include/
│ └── story_engine_v2.h # C11 / C++17 호환 C ABI v2 단일 헤더
├── lib/
│ ├── libstory_engine.dylib # macOS arm64 공유 라이브러리 (Windows .dll / Linux .so)
│ └── cmake/story_engine/ # CMake find_package 설정 파일
├── LICENSE.md # CHOAM Community License, Version 1.0
└── THIRD_PARTY_NOTICES.md # 오픈소스 고지 (RapidJSON 등)
3) CMake 연동과 컴파일러 직접 링크
C11이나 C++17 프로젝트에서 story_engine_v2.h를 인클루드하고 공유 라이브러리(libstory_engine)를 링크하면 바로 쓸 수 있습니다.
# CMakeLists.txt 예시
cmake_minimum_required(VERSION 3.20)
project(my_game LANGUAGES C CXX)
set(STORY_ENGINE_ROOT "/path/to/story-engine-v2.0.2-linux-x86_64")
add_executable(my_game main.c)
target_include_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/include")
target_link_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/lib")
target_link_libraries(my_game PRIVATE story_engine)
set_target_properties(my_game PROPERTIES
BUILD_RPATH "${STORY_ENGINE_ROOT}/lib"
INSTALL_RPATH "$ORIGIN/lib;@loader_path/lib"
)
# macOS (clang) 직접 컴파일
clang -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,@loader_path/lib -o my_game
# Linux (gcc / clang) 직접 컴파일
cc -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,'$ORIGIN/lib' -o my_game
02 · Installation & Linking
1) SHA-256 Checksum Verification & Launching 602 Studio
Check downloaded files against their companion .sha256 checksums before installing. All macOS binaries (.dmg and engine libraries) are signed with an Apple Developer ID certificate and notarized by Apple.
# macOS (arm64) checksum verification & install
shasum -a 256 -c 602-Studio-v2.0.2-macos-arm64.dmg.sha256
hdiutil attach 602-Studio-v2.0.2-macos-arm64.dmg
cp -R "/Volumes/602 Studio/602 Studio.app" /Applications/
# Windows (x86_64 PowerShell) checksum verification & installer
Get-FileHash .\602-Studio-v2.0.2-windows-x86_64-setup.exe -Algorithm SHA256
.\602-Studio-v2.0.2-windows-x86_64-setup.exe
& "$env:LOCALAPPDATA\Programs\602 Studio\602-studio.exe" --smoke-test
# Linux (x86_64) checksum verification & launch
sha256sum -c 602-Studio-v2.0.2-linux-x86_64.zip.sha256
unzip -q 602-Studio-v2.0.2-linux-x86_64.zip
./602-Studio-linux-x86_64/602-studio --smoke-test
./602-Studio-linux-x86_64/602-studio
2) 602 Story Engine Archive Layout
Unzipping story-engine-v2.0.2-<platform>.zip produces this directory layout:
story-engine-v2.0.2-<platform>/
├── include/
│ └── story_engine_v2.h # C11 / C++17 C ABI v2 single header
├── lib/
│ ├── libstory_engine.dylib # macOS arm64 shared library (Windows .dll / Linux .so)
│ └── cmake/story_engine/ # CMake package configuration files
├── LICENSE.md # CHOAM Community License, Version 1.0
└── THIRD_PARTY_NOTICES.md # Third-party OSS notices (RapidJSON, etc.)
3) CMake & Direct Compiler Linking
Include story_engine_v2.h and link libstory_engine in any C11 or C++17 build target:
# CMakeLists.txt example
cmake_minimum_required(VERSION 3.20)
project(my_game LANGUAGES C CXX)
set(STORY_ENGINE_ROOT "/path/to/story-engine-v2.0.2-linux-x86_64")
add_executable(my_game main.c)
target_include_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/include")
target_link_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/lib")
target_link_libraries(my_game PRIVATE story_engine)
set_target_properties(my_game PROPERTIES
BUILD_RPATH "${STORY_ENGINE_ROOT}/lib"
INSTALL_RPATH "$ORIGIN/lib;@loader_path/lib"
)
# macOS (clang) direct compilation
clang -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,@loader_path/lib -o my_game
# Linux (gcc / clang) direct compilation
cc -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,'$ORIGIN/lib' -o my_game
02 · インストールとリンク
1) SHA-256 チェックサム確認と 602 Studio の起動
ダウンロードしたファイルと同じフォルダに .sha256 ファイルを置き、以下のコマンドで整合性を確認できます。macOS 配布物(.dmg およびエンジンバイナリ)はすべて Apple Developer ID 署名と公証(Notarization)を済ませています。
# macOS (arm64) 整合性検証とインストール
shasum -a 256 -c 602-Studio-v2.0.2-macos-arm64.dmg.sha256
hdiutil attach 602-Studio-v2.0.2-macos-arm64.dmg
cp -R "/Volumes/602 Studio/602 Studio.app" /Applications/
# Windows (x86_64 PowerShell) 整合性検証とインストーラー実行
Get-FileHash .\602-Studio-v2.0.2-windows-x86_64-setup.exe -Algorithm SHA256
.\602-Studio-v2.0.2-windows-x86_64-setup.exe
& "$env:LOCALAPPDATA\Programs\602 Studio\602-studio.exe" --smoke-test
# Linux (x86_64) 整合性検証と起動
sha256sum -c 602-Studio-v2.0.2-linux-x86_64.zip.sha256
unzip -q 602-Studio-v2.0.2-linux-x86_64.zip
./602-Studio-linux-x86_64/602-studio --smoke-test
./602-Studio-linux-x86_64/602-studio
2) 602 Story Engine のフォルダ構成
story-engine-v2.0.2-<platform>.zip を展開すると、以下のファイルが入っています。
story-engine-v2.0.2-<platform>/
├── include/
│ └── story_engine_v2.h # C11 / C++17 互換 C ABI v2 単一ヘッダー
├── lib/
│ ├── libstory_engine.dylib # macOS arm64 共有ライブラリ(Windows .dll / Linux .so)
│ └── cmake/story_engine/ # CMake find_package 設定ファイル
├── LICENSE.md # CHOAM Community License, Version 1.0
└── THIRD_PARTY_NOTICES.md # サードパーティ OSS 表記(RapidJSON 等)
3) CMake 設定とコンパイラ直接リンク
C11 または C++17 プロジェクトから story_engine_v2.h をインクルードし、共有ライブラリ(libstory_engine)をリンクします。
# CMakeLists.txt の例
cmake_minimum_required(VERSION 3.20)
project(my_game LANGUAGES C CXX)
set(STORY_ENGINE_ROOT "/path/to/story-engine-v2.0.2-linux-x86_64")
add_executable(my_game main.c)
target_include_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/include")
target_link_directories(my_game PRIVATE "${STORY_ENGINE_ROOT}/lib")
target_link_libraries(my_game PRIVATE story_engine)
set_target_properties(my_game PROPERTIES
BUILD_RPATH "${STORY_ENGINE_ROOT}/lib"
INSTALL_RPATH "$ORIGIN/lib;@loader_path/lib"
)
# macOS (clang) 直接コンパイル
clang -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,@loader_path/lib -o my_game
# Linux (gcc / clang) 直接コンパイル
cc -std=c11 main.c -I./include -L./lib -lstory_engine -Wl,-rpath,'$ORIGIN/lib' -o my_game
03 · 빠른 시작 (폴더 구조 · 런타임 번들 · C11 예제)
1) 원고 프로젝트 폴더 구조
602 원고 프로젝트는 일반 폴더(또는 이를 묶은 .602.zip 파일)로 다룹니다.
my-story-project/
├── project.json # 프로젝트 메타데이터, 진입 장면(entry_event), 다국어 설정
├── declarations.md # 전역 상태(/set), 영속 상태(/persist), 외부 계약(/contract), 인터럽트(/interrupt)
├── events/
│ ├── opening.md # 개별 장면(Event) 마크다운 원고
│ └── harbor.md
└── translations.json # 원문 줄 해시 기반 1:1 다국어 번역 테이블 (선택)
가장 기본이 되는 project.json 예시입니다.
{
"schema": "602-project-v2",
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
}
2) .602.json 런타임 번들 컴파일
원고 폴더를 게임 빌드에 넣을 때는 602 Studio의 번들 컴파일 버튼을 누르거나 CLI에서 --compile 플래그를 실행해 단일 .602.json 파일을 만듭니다. 컴파일 과정에서 작가 메모(//)는 모두 빠지고, 정적 검사(story_v2_check)를 통과한 정규화 원고와 source_hash만 담깁니다.
# 원고 폴더를 단일 런타임 번들(.602.json)로 컴파일
602-studio --compile ./my-story-project -o ./build/story.602.json
3) C11 호스트 최소 실행 예제 (story_v2_simulate)
#include "story_engine_v2.h"
#include <stdio.h>
int main(void) {
const char *declarations_md =
"/set courage = 0\n"
"/persist cleared_prologue = false\n";
const char *events_md =
"# opening\n"
"\\뱃사람: 안개가 걷히기 전에 출항해야 합니다.\n"
"- [true] 즉시 닻을 올린다\n"
" /set courage = courage + 1\n"
" -> harbor\n"
"\n"
"# harbor\n"
"\\뱃사람: 무사히 외항에 도착했습니다.\n";
/* 0번 선택지를 선택하며 opening 장면부터 시뮬레이션 */
const char *options_json =
"{\"start_event\":\"opening\",\"choices\":[0],\"max_steps\":32}";
char *result_json = story_v2_simulate(declarations_md, events_md, options_json);
if (result_json) {
printf("%s\n", result_json);
story_v2_free(result_json);
}
return 0;
}
03 · Quickstart (Folder Layout, Runtime Bundle & C11 Example)
1) Manuscript Project Folder Structure
A 602 project is a plain directory (or a portable .602.zip archive):
my-story-project/
├── project.json # Project metadata, entry_event, and configured languages
├── declarations.md # Global states (/set), persistent states (/persist), contracts (/contract), interrupts (/interrupt)
├── events/
│ ├── opening.md # Individual scene (Event) Markdown manuscripts
│ └── harbor.md
└── translations.json # 1:1 localization table keyed by source line hash (optional)
Minimal project.json:
{
"schema": "602-project-v2",
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
}
2) Compiling a .602.json Runtime Bundle
To ship a manuscript inside your game build, click Compile Bundle in 602 Studio or run --compile from the CLI to output a single .602.json file. The compiler strips author comments (//), validates the story graph with story_v2_check, and records the canonical source_hash.
# Compile a manuscript folder into a single .602.json runtime bundle
602-studio --compile ./my-story-project -o ./build/story.602.json
3) Minimal C11 Host Example (story_v2_simulate)
#include "story_engine_v2.h"
#include <stdio.h>
int main(void) {
const char *declarations_md =
"/set courage = 0\n"
"/persist cleared_prologue = false\n";
const char *events_md =
"# opening\n"
"\\Sailor: We must set sail before the fog thickens.\n"
"- [true] Weigh anchor immediately\n"
" /set courage = courage + 1\n"
" -> harbor\n"
"\n"
"# harbor\n"
"\\Sailor: We reached the outer harbor safely.\n";
/* Simulate starting from "opening" and picking choice index 0 */
const char *options_json =
"{\"start_event\":\"opening\",\"choices\":[0],\"max_steps\":32}";
char *result_json = story_v2_simulate(declarations_md, events_md, options_json);
if (result_json) {
printf("%s\n", result_json);
story_v2_free(result_json);
}
return 0;
}
03 · クイックスタート(フォルダ構造・ランタイムバンドル・C11 例)
1) 原稿プロジェクトのフォルダ構造
602 のプロジェクトは通常のフォルダ(またはそれをまとめた .602.zip ファイル)として扱います。
my-story-project/
├── project.json # プロジェクトメタデータ、開始イベント (entry_event)、対応言語
├── declarations.md # グローバル変数 (/set)、永続変数 (/persist)、外部契約 (/contract)、割り込み (/interrupt)
├── events/
│ ├── opening.md # 各シーン (Event) の Markdown 原稿
│ └── harbor.md
└── translations.json # 原文行ハッシュに基づく 1:1 多言語翻訳テーブル(任意)
最小構成の project.json 例です。
{
"schema": "602-project-v2",
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
}
2) .602.json ランタイムバンドルのコンパイル
原稿フォルダをゲームビルドへ組み込むときは、602 Studio のバンドルコンパイルボタンを押すか、CLI で --compile を実行して単一の .602.json ファイルを出力します。コンパイル時に執筆メモ(//)がすべて取り除かれ、静的検証(story_v2_check)を通過した正規化原稿と source_hash が書き込まれます。
# 原稿フォルダを単一のランタイムバンドル (.602.json) にコンパイル
602-studio --compile ./my-story-project -o ./build/story.602.json
3) C11 ホスト最小実行例(story_v2_simulate)
#include "story_engine_v2.h"
#include <stdio.h>
int main(void) {
const char *declarations_md =
"/set courage = 0\n"
"/persist cleared_prologue = false\n";
const char *events_md =
"# opening\n"
"\\船乗り: 霧が深まる前に出航しなければなりません。\n"
"- [true] すぐに錨を上げる\n"
" /set courage = courage + 1\n"
" -> harbor\n"
"\n"
"# harbor\n"
"\\船乗り: 無事に外港へ到着しました。\n";
/* インデックス 0 の選択肢を選び opening シーンからシミュレーション */
const char *options_json =
"{\"start_event\":\"opening\",\"choices\":[0],\"max_steps\":32}";
char *result_json = story_v2_simulate(declarations_md, events_md, options_json);
if (result_json) {
printf("%s\n", result_json);
story_v2_free(result_json);
}
return 0;
}
06 · JSON 프로토콜, .602.json 번들 스키마와 정적 진단
1) .602.json 런타임 번들 스키마
602-studio --compile 명령이나 로컬 MCP의 compile_manuscript 도구가 만드는 런타임 번들입니다. 작가 메모(//)를 뺀 정규화 원고와 다국어 번역 표, SHA-256 source_hash가 JSON 파일 하나에 담깁니다.
{
"format": "602-bundle-v2",
"version": "2.0.0",
"source_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"project": {
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
},
"declarations_md": "/set courage = 0\n/persist cleared_prologue = false\n",
"events": [
{
"id": "opening",
"markdown": "# opening\n\\뱃사람: 안개가 걷히기 전에 출항해야 합니다.\n- [true] 즉시 닻을 올린다\n -> harbor\n"
}
],
"translations": {
"en": {
"9f86d081": "We must set sail before the fog thickens."
}
}
}
2) story_v2_simulate 요청·응답 구조
options_json에 시작 장면, 초기 변수값, 선택지 번호 배열, 외부 계약 응답을 담아 넘기면 엔진은 단계별 진행 기록(turn_trace)과 현재 선택 가능한 목록(active_choices), 최종 변수 상태(final_state)를 돌려줍니다.
// 요청 (options_json)
{
"start_event": "등대_입구",
"initial_state": { "hp": 100, "loop_count": 1 },
"choices": [0],
"contract_results": {
"LockpickMiniGame": { "unlocked": true }
},
"max_steps": 64
}
// 응답 (story_v2_simulate 반환 JSON)
{
"ok": true,
"status": "completed",
"current_event": "등대_내부",
"turn_trace": [
{
"step": 1,
"event": "등대_입구",
"lines": [
{ "speaker": null, "text": "차가운 해무 사이로 낡은 등대가 모습을 드러냈다." },
{ "speaker": "유진", "text": "문이 굳게 잠겨 있군." },
{ "speaker": "유진", "text": "잠깐, 화분 아래에 열쇠가 있었던 기억이 나." }
],
"chosen_index": 0,
"chosen_text": "숨겨진 열쇠로 문을 연다",
"state_deltas": { "visited_lighthouse": true, "found_hint": true, "loop_count": 2 }
}
],
"active_choices": [],
"final_state": {
"hp": 100,
"visited_lighthouse": true,
"found_hint": true,
"loop_count": 2
}
}
3) 정적 진단 코드 (story_v2_check)
| 진단 코드 |
심각도 |
검출 원인과 해결 방법 |
DEAD_END_CHOICE_GROUP |
Warning / Error |
선택지 묶음의 모든 항목에 조건식([조건])이 걸려 있어, 변수 조합에 따라 고를 수 있는 선택지가 하나도 남지 않을 수 있습니다. 맨 끝에 기본 선택지(- [true] ...)를 두면 해결됩니다. |
UNREACHABLE_EVENT |
Warning |
시작 장면(entry_event)이나 인터럽트 규칙에서 어떤 -> · /goto 경로를 따라가도 닿을 수 없는 외딴 장면이 있습니다. |
INTERRUPT_LEAK |
Error |
/interrupt로 불려 나온 장면이 /return이나 종료 이동(/goto)으로 마무리되지 않았습니다. 그대로 두면 호출 스택이 쌓이거나 같은 인터럽트에 무한히 다시 들어갈 수 있습니다. |
MISSING_TRANSLATION |
Warning |
project.json에 등록한 언어 가운데 아직 번역문이 비어 있는 대사나 선택지가 있습니다. |
STALE_TRANSLATION |
Warning |
원문 대사나 선택지를 고쳐 줄 해시가 바뀌었는데, 번역 표는 예전 원문 해시를 가리키고 있습니다. 602 Studio의 1:1 번역 뷰에서 바뀐 줄만 바로 찾아 고칠 수 있습니다. |
06 · JSON Protocol, .602.json Bundle Schema & Diagnostics
1) .602.json Runtime Bundle Schema
602-studio --compile and the MCP compile_manuscript tool pack comment-stripped Markdown scenes, translation tables, and the SHA-256 source_hash into a single JSON file:
{
"format": "602-bundle-v2",
"version": "2.0.0",
"source_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"project": {
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
},
"declarations_md": "/set courage = 0\n/persist cleared_prologue = false\n",
"events": [
{
"id": "opening",
"markdown": "# opening\n\\Sailor: We must set sail before the fog thickens.\n- [true] Weigh anchor immediately\n -> harbor\n"
}
],
"translations": {
"en": {
"9f86d081": "We must set sail before the fog thickens."
}
}
}
2) story_v2_simulate Request & Response Payloads
Pass start_event, optional initial_state overrides, player choices indices, and mocked contract_results in options_json to get back the step-by-step turn_trace, active_choices, and final_state:
// Request (options_json)
{
"start_event": "Lighthouse_Entrance",
"initial_state": { "hp": 100, "loop_count": 1 },
"choices": [0],
"contract_results": {
"LockpickMiniGame": { "unlocked": true }
},
"max_steps": 64
}
// Response (story_v2_simulate JSON)
{
"ok": true,
"status": "completed",
"current_event": "Lighthouse_Interior",
"turn_trace": [
{
"step": 1,
"event": "Lighthouse_Entrance",
"lines": [
{ "speaker": null, "text": "Through the cold sea fog, the old lighthouse emerged." },
{ "speaker": "Yujin", "text": "The door is bolted shut." },
{ "speaker": "Yujin", "text": "Wait, I remember a spare key hidden under the planter." }
],
"chosen_index": 0,
"chosen_text": "Open the door with the hidden key",
"state_deltas": { "visited_lighthouse": true, "found_hint": true, "loop_count": 2 }
}
],
"active_choices": [],
"final_state": {
"hp": 100,
"visited_lighthouse": true,
"found_hint": true,
"loop_count": 2
}
}
3) Static Diagnostic Codes (story_v2_check)
| Diagnostic Code |
Severity |
Cause & Fix |
DEAD_END_CHOICE_GROUP |
Warning / Error |
Every option in a choice group carries a condition ([cond]) with no unconditional fallback, so some state combinations could leave the player with zero choices. Add a trailing - [true] ... option. |
UNREACHABLE_EVENT |
Warning |
No path of -> or /goto links from entry_event or any /interrupt rule can reach this scene. |
INTERRUPT_LEAK |
Error |
A scene called by /interrupt ends without /return or a terminal /goto, which can leak the call stack or re-trigger the interrupt in a loop. |
MISSING_TRANSLATION |
Warning |
A dialogue or choice line is missing a translation for one or more languages listed in project.json. |
STALE_TRANSLATION |
Warning |
The source line changed and its line hash moved, leaving an older translation attached to the previous hash. Review and update it in Studio's 1:1 translation view. |
06 · JSON プロトコル、.602.json バンドルスキーマと静的診断
1) .602.json ランタイムバンドルスキーマ
602-studio --compile またはローカル MCP の compile_manuscript ツールが出力するランタイムバンドルです。執筆メモ(//)を除いた正規化原稿と多言語翻訳テーブル、SHA-256 source_hash が 1 つの JSON ファイルにまとまります。
{
"format": "602-bundle-v2",
"version": "2.0.0",
"source_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"project": {
"title": "Harbor Dawn",
"default_lang": "ko",
"languages": ["ko", "en", "ja"],
"entry_event": "opening"
},
"declarations_md": "/set courage = 0\n/persist cleared_prologue = false\n",
"events": [
{
"id": "opening",
"markdown": "# opening\n\\船乗り: 霧が深まる前に出航しなければなりません。\n- [true] すぐに錨を上げる\n -> harbor\n"
}
],
"translations": {
"en": {
"9f86d081": "We must set sail before the fog thickens."
}
}
}
2) story_v2_simulate のリクエスト・レスポンス構造
options_json に開始シーン、初期状態の上書き、選択肢番号の配列、外部契約の返却値を渡すと、ステップごとの進行記録(turn_trace)、現在選べる選択肢(active_choices)、最終状態(final_state)が返ります。
// リクエスト (options_json)
{
"start_event": "灯台_入口",
"initial_state": { "hp": 100, "loop_count": 1 },
"choices": [0],
"contract_results": {
"LockpickMiniGame": { "unlocked": true }
},
"max_steps": 64
}
// レスポンス (story_v2_simulate 返却 JSON)
{
"ok": true,
"status": "completed",
"current_event": "灯台_内部",
"turn_trace": [
{
"step": 1,
"event": "灯台_入口",
"lines": [
{ "speaker": null, "text": "冷たい海霧の向こうから古い灯台が姿を現した。" },
{ "speaker": "ユジン", "text": "扉が固く閉ざされている。" },
{ "speaker": "ユジン", "text": "待てよ、植木鉢の下に予備の鍵があったはずだ。" }
],
"chosen_index": 0,
"chosen_text": "隠された鍵で扉を開ける",
"state_deltas": { "visited_lighthouse": true, "found_hint": true, "loop_count": 2 }
}
],
"active_choices": [],
"final_state": {
"hp": 100,
"visited_lighthouse": true,
"found_hint": true,
"loop_count": 2
}
}
3) 静的診断コード一覧(story_v2_check)
| 診断コード |
重要度 |
検出条件と対処方法 |
DEAD_END_CHOICE_GROUP |
Warning / Error |
選択肢グループの全項目に条件式([条件])が付いており、状態の組み合わせによっては選べる項目が 0 個になるおそれがあります。末尾にフォールバック選択肢(- [true] ...)を置くと解消します。 |
UNREACHABLE_EVENT |
Warning |
開始シーン(entry_event)や割り込みルールから、どの ->・/goto 経路をたどっても到達できない孤立シーンがあります。 |
INTERRUPT_LEAK |
Error |
/interrupt で呼ばれたシーンが /return または終了遷移(/goto)で閉じられていません。放置するとコールスタックが溜まったり、同じ割り込みへ無限に入り直したりする原因になります。 |
MISSING_TRANSLATION |
Warning |
project.json に登録した言語のうち、まだ翻訳が空欄になっているセリフや選択肢があります。 |
STALE_TRANSLATION |
Warning |
原文のセリフや選択肢を書き換えて行ハッシュが変わったのに、翻訳テーブルが古い原文ハッシュを指したままになっています。602 Studio の 1:1 翻訳ビューから該当行をすぐ更新できます。 |
08 · C++17 / C# (Unity P/Invoke) / Godot 연동 가이드
story_engine_v2.h의 모든 함수는 복잡한 구조체 포인터나 콜백 테이블 없이 표준 C 문자열(const char* -> char*)만 주고받습니다. 덕분에 C++17(Unreal이나 자체 엔진), Unity C# P/Invoke, Godot 4(GDExtension / C#) 어디에나 수십 줄짜리 얇은 래퍼만 씌우면 바로 붙습니다.
1) C++17 RAII 래퍼 예제
#include "story_engine_v2.h"
#include <memory>
#include <string>
namespace story602 {
struct GroupBDeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free(p);
}
};
struct GroupADeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free_string(p);
}
};
inline std::string simulate(
const std::string &declarations_md,
const std::string &events_md,
const std::string &options_json
) {
std::unique_ptr<char, GroupBDeleter> raw(
story_v2_simulate(declarations_md.c_str(), events_md.c_str(), options_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
inline std::string execute_play(
const std::string &bundle_json,
const std::string &play_request_json
) {
std::unique_ptr<char, GroupADeleter> raw(
story_v2_execute_play(bundle_json.c_str(), play_request_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
} // namespace story602
2) Unity C# P/Invoke 연동 예제
libstory_engine.dylib(macOS), story_engine_v2.dll(Windows), libstory_engine.so(Linux) 파일을 Assets/Plugins/ 아래에 넣고 UTF-8 바이트 배열로 넘겨 호출합니다.
using System;
using System.Runtime.InteropServices;
using System.Text;
public static class StoryEngineV2
{
private const string LibName = "story_engine";
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_simulate(byte[] declarationsMd, byte[] eventsMd, byte[] optionsJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free(IntPtr ptr);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_execute_play(byte[] projectJson, byte[] playRequestJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free_string(IntPtr ptr);
private static byte[] ToUtf8NullTerminated(string s)
{
int len = Encoding.UTF8.GetByteCount(s);
byte[] buf = new byte[len + 1];
Encoding.UTF8.GetBytes(s, 0, s.Length, buf, 0);
return buf;
}
public static string Simulate(string declarationsMd, string eventsMd, string optionsJson)
{
IntPtr ptr = story_v2_simulate(
ToUtf8NullTerminated(declarationsMd),
ToUtf8NullTerminated(eventsMd),
ToUtf8NullTerminated(optionsJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free(ptr);
}
}
public static string ExecutePlay(string bundleJson, string playRequestJson)
{
IntPtr ptr = story_v2_execute_play(
ToUtf8NullTerminated(bundleJson),
ToUtf8NullTerminated(playRequestJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free_string(ptr);
}
}
}
3) Godot 4 (GDExtension C++ / C#) 연동
Godot 4(.NET)에서는 위 C# StoryEngineV2 정적 클래스를 그대로 가져다 쓰면 됩니다. GDExtension C++을 쓴다면 노드에서 story602::execute_play나 story602::simulate를 호출한 뒤, 돌아온 문자열을 JSON::parse_string()으로 읽어 대사 라벨과 선택지 버튼에 연결하세요.
08 · C++17 / C# (Unity P/Invoke) / Godot Integration
Every function in story_engine_v2.h exchanges plain UTF-8 C strings (const char* -> char*) with no opaque handles or callback tables, so a few dozen lines of wrapper code are enough for C++17 (Unreal or custom engines), Unity C# P/Invoke, or Godot 4.
1) C++17 RAII Wrapper Example
#include "story_engine_v2.h"
#include <memory>
#include <string>
namespace story602 {
struct GroupBDeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free(p);
}
};
struct GroupADeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free_string(p);
}
};
inline std::string simulate(
const std::string &declarations_md,
const std::string &events_md,
const std::string &options_json
) {
std::unique_ptr<char, GroupBDeleter> raw(
story_v2_simulate(declarations_md.c_str(), events_md.c_str(), options_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
inline std::string execute_play(
const std::string &bundle_json,
const std::string &play_request_json
) {
std::unique_ptr<char, GroupADeleter> raw(
story_v2_execute_play(bundle_json.c_str(), play_request_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
} // namespace story602
2) Unity C# P/Invoke Integration
Drop libstory_engine.dylib (macOS), story_engine_v2.dll (Windows), or libstory_engine.so (Linux) into Assets/Plugins/ and marshal null-terminated UTF-8 byte arrays:
using System;
using System.Runtime.InteropServices;
using System.Text;
public static class StoryEngineV2
{
private const string LibName = "story_engine";
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_simulate(byte[] declarationsMd, byte[] eventsMd, byte[] optionsJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free(IntPtr ptr);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_execute_play(byte[] projectJson, byte[] playRequestJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free_string(IntPtr ptr);
private static byte[] ToUtf8NullTerminated(string s)
{
int len = Encoding.UTF8.GetByteCount(s);
byte[] buf = new byte[len + 1];
Encoding.UTF8.GetBytes(s, 0, s.Length, buf, 0);
return buf;
}
public static string Simulate(string declarationsMd, string eventsMd, string optionsJson)
{
IntPtr ptr = story_v2_simulate(
ToUtf8NullTerminated(declarationsMd),
ToUtf8NullTerminated(eventsMd),
ToUtf8NullTerminated(optionsJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free(ptr);
}
}
public static string ExecutePlay(string bundleJson, string playRequestJson)
{
IntPtr ptr = story_v2_execute_play(
ToUtf8NullTerminated(bundleJson),
ToUtf8NullTerminated(playRequestJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free_string(ptr);
}
}
}
3) Godot 4 (GDExtension C++ / C#) Integration
In Godot 4 (.NET), drop in the StoryEngineV2 C# class above as-is. For GDExtension C++, call story602::execute_play or story602::simulate from your node and parse the returned JSON with JSON::parse_string() to populate dialogue labels and choice buttons.
08 · C++17 / C# (Unity P/Invoke) / Godot 連携ガイド
story_engine_v2.h の関数はすべて標準的な UTF-8 C 文字列(const char* -> char*)だけをやり取りし、不透明ポインタやコールバック登録を必要としません。C++17(Unreal や独自エンジン)、Unity C# P/Invoke、Godot 4(GDExtension / C#)のいずれでも短いラッパーだけでつなげられます。
1) C++17 RAII ラッパー例
#include "story_engine_v2.h"
#include <memory>
#include <string>
namespace story602 {
struct GroupBDeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free(p);
}
};
struct GroupADeleter {
void operator()(char *p) const noexcept {
if (p) story_v2_free_string(p);
}
};
inline std::string simulate(
const std::string &declarations_md,
const std::string &events_md,
const std::string &options_json
) {
std::unique_ptr<char, GroupBDeleter> raw(
story_v2_simulate(declarations_md.c_str(), events_md.c_str(), options_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
inline std::string execute_play(
const std::string &bundle_json,
const std::string &play_request_json
) {
std::unique_ptr<char, GroupADeleter> raw(
story_v2_execute_play(bundle_json.c_str(), play_request_json.c_str())
);
return raw ? std::string(raw.get()) : "{}";
}
} // namespace story602
2) Unity C# P/Invoke 連携例
libstory_engine.dylib(macOS)、story_engine_v2.dll(Windows)、または libstory_engine.so(Linux)を Assets/Plugins/ に置き、UTF-8 バイト配列を渡して呼び出します。
using System;
using System.Runtime.InteropServices;
using System.Text;
public static class StoryEngineV2
{
private const string LibName = "story_engine";
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_simulate(byte[] declarationsMd, byte[] eventsMd, byte[] optionsJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free(IntPtr ptr);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr story_v2_execute_play(byte[] projectJson, byte[] playRequestJson);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
private static extern void story_v2_free_string(IntPtr ptr);
private static byte[] ToUtf8NullTerminated(string s)
{
int len = Encoding.UTF8.GetByteCount(s);
byte[] buf = new byte[len + 1];
Encoding.UTF8.GetBytes(s, 0, s.Length, buf, 0);
return buf;
}
public static string Simulate(string declarationsMd, string eventsMd, string optionsJson)
{
IntPtr ptr = story_v2_simulate(
ToUtf8NullTerminated(declarationsMd),
ToUtf8NullTerminated(eventsMd),
ToUtf8NullTerminated(optionsJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free(ptr);
}
}
public static string ExecutePlay(string bundleJson, string playRequestJson)
{
IntPtr ptr = story_v2_execute_play(
ToUtf8NullTerminated(bundleJson),
ToUtf8NullTerminated(playRequestJson)
);
if (ptr == IntPtr.Zero) return "{}";
try {
return Marshal.PtrToStringUTF8(ptr) ?? "{}";
} finally {
story_v2_free_string(ptr);
}
}
}
3) Godot 4(GDExtension C++ / C#)での使い方
Godot 4(.NET)なら上の C# StoryEngineV2 クラスをそのまま使えます。GDExtension C++ を使う場合は、ノードから story602::execute_play や story602::simulate を呼び出し、返ってきた JSON を JSON::parse_string() で読み取ってセリフラベルや選択肢ボタンへ反映してください。
09 · 602 Studio 워크스페이스와 로컬 MCP 에이전트 협업
1) 602 Studio v2.0.2 워크스페이스 주요 기능
- 3단 워크스페이스와 배지 레일 (내어쓰기 정렬): 왼쪽에는 파일·선언 트리, 가운데에는 마크다운 에디터(CodeMirror 6), 오른쪽에는 시뮬레이션·구조도·번역·진단 패널이 놓입니다. 앱을 처음 열면 직전 프로젝트로 곧장 들어가지 않고 프로젝트 목록 화면을 먼저 보여 주며, 에디터와 플레이어 모두 줄마다
대사, 선택지, 조건, 전이, 작성자 메모 같은 4글자 고정폭 배지가 붙고 자동 줄바꿈 내어쓰기(Hanging Indent)가 적용되어 문장이 길어져도 본문 시작 줄이 반듯하게 맞습니다.
- 장·줄 번호 레일과 줄 참조 복사,
@ 변수 자동완성 및 /game 계약 미리보기(Peek): 각 장면 상단에 1장 · 제목 형태의 장 번호가 표시되고, 줄 번호 레일을 누르거나 상단 줄 복사 버튼을 누르면 정본 줄 참조 문자열을 클립보드에 바로 복사해 AI 에이전트나 동료에게 전달할 수 있습니다. 본문에서 @를 입력하면 선언된 상태변수와 현재 시뮬레이션 값을 함께 보여주는 자동완성이 열리며, /game 블록 안에 커서를 두면 오른쪽에 해당 /contract의 입력(/with)·결과(/result) 필드 명세를 보여주는 인라인 계약 미리보기 패널이 자동으로 나타납니다.
- 1턴 시뮬레이션 플레이어와 자동 진행(Auto-Play): 실제 비주얼 노벨 화면처럼 한 턴씩 대사와 선택지 카드를 넘기며 직접 플레이해 볼 수 있습니다. 자동 진행을 켜거나 지난 턴 기록 창을 열어 분기 흐름을 바로 확인하세요.
- 5블록 Choicebox 시뮬레이션 설정: 시작 위치(장면 첫 줄 또는 커서 위치), 진입 조건 무시 여부, 세이브 전후 시점, 영속 변수(
/persist) 적용 방식, 외부 계약(/contract) 결과값까지 다섯 가지 항목을 카드형 Choicebox에서 골라 어떤 분기든 곧장 시험해 볼 수 있습니다.
- 역방향 도달 추적(Backward Reachability)과 백본·통로 자동 배치 구조도(Structure Map): 특정 장면이나 선택지에 닿기 위해 앞서 거쳐야 하는 장면과 변수 조건을 거꾸로 짚어 줍니다. 구조도는 주 줄기(Backbone)와 곁가지(Branch)를 겹치지 않는 통로(Corridor)로 자동 배치하며, 선택한 테마의 모서리 규칙에 맞춰 둥근 필렛 곡선이나 0px 맨해튼 직교 배선으로 1:1 포트 원과 전이 연결선을 그립니다.
- 세헤라자드 정렬 외관 설정(Appearance Settings)과 6종 도시 테마: 상단 앱 설정 · 모양 창에서
602 기본, Sera, Paris, Vancouver, Shanghai, Seoul 여섯 가지 하우스 테마를 고르고, 배경·강조색·텍스트 HEX 색상(WCAG 4.5:1 명도 대비 자동 보정), 유리감 투명도(0%~100%)와 배경 블러(끄기 / 약하게 / 강하게), 글꼴 크기(12px~16px, 0.5px 단위)와 5종 서체(시스템, Pretendard, 세리프, 고정폭, 라운드)를 실시간으로 바꿀 수 있습니다.
- 줄 해시 기반 1:1 번역 뷰: 원문 대사·선택지 바로 옆에 언어별 번역 칸을 1:1로 나란히 띄웁니다. 원문이 바뀌어 손봐야 하는 번역 줄(
STALE_TRANSLATION)은 바로 표시해 줍니다.
2) 로컬 MCP 서버 (602-studio --mcp)와 원클릭 스킬 설치
602 Studio 상단 툴바에서 AI 에이전트 연동 / 스킬 설치 버튼을 누르면 Claude Desktop, Claude Code, Cursor, Codex 같은 로컬 AI 도구에 602-studio --mcp 서버와 전용 집필 스킬(602-studio)이 한 번에 등록됩니다. 설정 파일을 직접 적어 넣을 때는 아래 예시를 참고하세요.
{
"mcpServers": {
"602-studio": {
"command": "/Applications/602 Studio.app/Contents/MacOS/602 Studio",
"args": ["--mcp", "--project", "/absolute/path/to/my-story-project"]
}
}
}
3) 로컬 MCP 8종 도구 레퍼런스
| MCP 도구명 |
주요 인자 |
동작과 반환값 |
list_projects |
workspace_dir (선택) |
열려 있거나 지정한 폴더 안에 있는 602 원고 프로젝트 목록과 시작 장면, 파일 구성을 확인합니다. |
open_project_folder |
project_path |
로컬 원고 폴더(또는 .602.zip)를 워크스페이스에 불러오고 프로젝트 요약과 초기 리비전 값을 돌려줍니다. |
save_project_folder |
project_path, export_zip (선택) |
메모리에서 고친 원고 내용을 디스크 폴더에 안전하게 저장합니다. 원하면 .602.zip 파일로도 함께 내보냅니다. |
read_manuscript |
target (declarations.md, events/<id>.md 또는 장면 제목·ID) |
대상 파일의 현재 revision 해시와 함께, 각 줄 앞에 2글자 체크섬 태그를 붙인 hashline 본문(예: 14#K2: \유진: 문이 잠겨 있군.)을 돌려줍니다. 파일 경로뿐 아니라 장면 제목이나 ID로도 바로 조회할 수 있습니다. |
edit_manuscript |
target, base_revision, edits (start_anchor, end_anchor, replacement) |
base_revision과 줄 체크섬 앵커(예: 14#K2)가 현재 파일과 맞는지 먼저 대조한 뒤 지정한 줄 범위를 고칩니다. 그사이에 파일이 바뀌어 해시가 어긋나면 수정을 거절해 줄 번호가 밀리는 사고를 막아 줍니다. |
simulate_manuscript |
start_event, choices, initial_state, contract_results |
현재 원고로 story_v2_simulate와 역방향 도달 분석(story_v2_reach)을 돌려 턴 진행 결과와 변수 변화를 확인합니다. |
check_manuscript |
include_translations (선택) |
프로젝트 전체에 story_v2_check 정적 검사를 돌려 막다른 선택지, 외딴 장면, 인터럽트 누수, 빠지거나 오래된 번역 목록을 돌려줍니다. |
compile_manuscript |
output_path |
정적 검사를 통과한 원고에서 작가 메모(//)를 빼고 배포용 .602.json 런타임 번들을 만든 뒤 source_hash를 돌려줍니다. |
4) hashline + base_revision 안전 편집 예시
// 1. read_manuscript 응답 예시
{
"target": "events/lighthouse.md",
"revision": "rev_8f31c9a0",
"hashlines": [
"12#A4: # 등대_입구",
"13#F1: 차가운 해무 사이로 낡은 등대가 모습을 드러냈다.",
"14#K2: \\유진: 문이 굳게 잠겨 있군.",
"15#P9: - [has_key] 철문을 연다"
]
}
// 2. edit_manuscript 요청 예시 (14#K2 줄을 안전하게 교체)
{
"target": "events/lighthouse.md",
"base_revision": "rev_8f31c9a0",
"edits": [
{
"start_anchor": "14#K2",
"end_anchor": "14#K2",
"replacement": "\\유진: 녹슨 자물쇠가 걸려 있어. 열쇠나 도구가 필요해."
}
]
}
09 · 602 Studio Workspace & Local MCP Agent Workflows
1) 602 Studio v2.0.2 Desktop Workspace
- 3-Panel Workspace & Badge Rail (Hanging Indent): Places the file and declaration tree on the left, a CodeMirror 6 Markdown editor in the middle, and simulation, structure map, translation, and diagnostics panels on the right. Launching the app opens the project list first instead of auto-entering the last project, and fixed-width 4-character badges (Dialogue, Choice, Condition, Transition, Comment) pair with hanging indent so wrapped lines stay aligned under the prose column.
- Chapter & Line Numbers, Reference Copy,
@ Variable Completion & /game Contract Peek: Displays chapter breadcrumbs (Chapter N · Title) and a clickable line-number gutter with one-click canonical line-reference copy for handing exact line ranges to AI agents or teammates. Typing @ opens inline completion with declared state variables and live simulation values, while placing the cursor inside a /game block opens an inline contract peek panel showing the matching /contract input (/with) and output (/result) fields.
- 1-Turn Simulation Player & Auto-Play: Play through scenes one turn at a time on a visual-novel stage, toggle Auto-Play, and check earlier steps in the turn log modal.
- 5-Block Choicebox Simulation Settings: Pick start position (scene start or cursor line), guard bypass, save/restore timing, persistent (
/persist) variable behavior, and mocked host contract (/contract) outcomes from five Stacked Choicebox cards to test any branch on the spot.
- Backward Reachability & Backbone/Corridor Structure Map: Trace predecessor scenes and variable conditions needed to reach any scene or choice. The Structure Map automatically lays out backbone and branch nodes with non-overlapping corridor routing, rendering 1:1 circular ports and transition wires as rounded fillets in squircle themes or 0px orthogonal Manhattan paths in square themes.
- Scheherazade-Aligned Appearance Settings & 6 House Themes: Choose from six themes (
602 Default, Sera, Paris, Vancouver, Shanghai, and Seoul), customize background, accent, and text HEX colors with automatic WCAG 4.5:1 contrast enforcement, and tune frosted glass opacity (0% to 100%), backdrop blur (off / soft / strong), font size (12px to 16px in 0.5px steps), and five font families (System, Pretendard, Serif, Monospace, Rounded).
- 1:1 Line-Hash Translation View: Edit translations right beside source dialogue and choice lines, with instant markers on
MISSING_TRANSLATION and STALE_TRANSLATION rows whenever source text changes.
2) Local MCP Server (602-studio --mcp) & One-Click Skill Setup
Click AI Agent / Install Skill in the 602 Studio toolbar to register the local 602-studio --mcp server and companion authoring skill in Claude Desktop, Claude Code, Cursor, or Codex. If you prefer manual setup, add this entry to your MCP config:
{
"mcpServers": {
"602-studio": {
"command": "/Applications/602 Studio.app/Contents/MacOS/602 Studio",
"args": ["--mcp", "--project", "/absolute/path/to/my-story-project"]
}
}
}
3) Local MCP 8-Tool Reference
| MCP Tool |
Key Arguments |
What It Does |
list_projects |
workspace_dir (optional) |
Lists 602 manuscript projects, entry events, and file lists in the workspace or given folder. |
open_project_folder |
project_path |
Opens a local manuscript folder (or .602.zip) in the workspace and returns project metadata and initial file revisions. |
save_project_folder |
project_path, export_zip (optional) |
Writes in-memory manuscript changes atomically to disk (and optionally exports a .602.zip archive). |
read_manuscript |
target (declarations.md, events/<id>.md, or event title/ID) |
Returns the file's current revision hash along with hashline-tagged lines (e.g., 14#K2: \Yujin: The door is bolted shut.). Accepts canonical event titles or IDs as well as file paths. |
edit_manuscript |
target, base_revision, edits (start_anchor, end_anchor, replacement) |
Checks base_revision and the 2-character line checksum anchors (14#K2) before replacing lines, rejecting stale edits so line numbers never drift. |
simulate_manuscript |
start_event, choices, initial_state, contract_results |
Runs turn simulation (story_v2_simulate) and backward reachability (story_v2_reach) against the current manuscript. |
check_manuscript |
include_translations (optional) |
Runs project-wide static checks (story_v2_check) for dead-end choices, unreachable scenes, interrupt leaks, and missing or stale translations. |
compile_manuscript |
output_path |
Checks the project, strips author comments (//), writes a shipping .602.json bundle, and returns its source_hash. |
4) hashline + base_revision Safe Editing Example
// 1. read_manuscript response
{
"target": "events/lighthouse.md",
"revision": "rev_8f31c9a0",
"hashlines": [
"12#A4: # Lighthouse_Entrance",
"13#F1: Through the cold sea fog, the old lighthouse emerged.",
"14#K2: \\Yujin: The door is bolted shut.",
"15#P9: - [has_key] Unlock the iron door"
]
}
// 2. edit_manuscript request (atomically replacing line 14#K2)
{
"target": "events/lighthouse.md",
"base_revision": "rev_8f31c9a0",
"edits": [
{
"start_anchor": "14#K2",
"end_anchor": "14#K2",
"replacement": "\\Yujin: A rusted padlock bars the door. I need a key or a lockpick."
}
]
}
09 · 602 Studio ワークスペースとローカル MCP エージェント連携
1) 602 Studio v2.0.2 ワークスペースの主な機能
- 3 パネル構成とバッジレール(ぶら下げインデント): 左にファイル・宣言ツリー、中央に Markdown エディタ(CodeMirror 6)、右にシミュレーション・構造マップ・翻訳・診断パネルを並べています。起動時は前回のプロジェクトを自動で開かずプロジェクト一覧画面を先に表示し、エディタとプレイヤーの両方に 4 文字固定幅のバッジレールと折り返し時のぶら下げインデント(Hanging Indent)が効くため、長い行でも本文の書き出し位置がきれいに揃います。
- 章・行番号レールと参照コピー、
@ 変数補完および /game 契約プレビュー(Peek): 各シーン上部に 第1章 · タイトル 形式の章番号が表示され、行番号のクリックや上部 行コピー ボタンで正確な行参照をクリップボードへ即座にコピーして AI エージェントや共同編集者へ渡せます。エディタ内で @ を入力すると宣言済み変数と現在のシミュレーション値を並べて補完でき、/game ブロック内にカーソルを置くと右側に該当 /contract の入力(/with)・結果(/result)フィールド定義を示すインライン契約プレビューが自動で開きます。
- 1 ターンシミュレーションプレイヤーと自動進行(Auto-Play): ノベルゲームの実画面さながらに 1 ターンずつセリフと選択肢を進められ、オートプレイ切り替えや過去ターンログのモーダルで分岐の見え方をその場で確かめられます。
- 5 ブロック Choicebox シミュレーション設定: 開始位置(シーン先頭/カーソル行)、進入条件のスキップ、セーブ前後のタイミング、永続変数(
/persist)の扱い、外部契約(/contract)の仮結果の 5 項目をカード形式の Choicebox で選び、どの分岐でもすぐ試せます。
- 逆方向到達解析(Backward Reachability)と幹線・通路自動配置の構造マップ(Structure Map): 特定のシーンや選択肢にたどり着くまでの先行ルートと変数条件を逆向きにたどります。構造マップは主幹(Backbone)と枝分かれ(Branch)を重ならない通路(Corridor)で自動配置し、選択中テーマの角丸ルールに合わせて丸みのあるフィレット曲線または 0px のマンハッタン直交配線で 1:1 ポート円と遷移線を描画します。
- Scheherazade 準拠の外観設定(Appearance Settings)と 6 種の都市テーマ: 上部のアプリ設定・外観モーダルから
602 デフォルト、Sera、Paris、Vancouver、Shanghai、Seoul の 6 テーマを選べるほか、背景・アクセント・文字の HEX カラー(WCAG 4.5:1 コントラスト自動補正)、すりガラス透明度(0%〜100%)と背景ブラー(オフ / 弱 / 強)、文字サイズ(12px〜16px、0.5px 刻み)および 5 種の書体(システム、Pretendard、セリフ、等幅、丸ゴシック)をリアルタイムに調整できます。
- 行ハッシュ連動の 1:1 翻訳ビュー: 原文のセリフ・選択肢と各言語の入力欄を 1:1 で並べて編集でき、原文の書き換えで見直しが必要になった行(
STALE_TRANSLATION)をすぐハイライトします。
2) ローカル MCP サーバー(602-studio --mcp)とワンクリックスキル導入
602 Studio 上部ツールバーのAI エージェント連携/スキル導入ボタンを押すと、Claude Desktop、Claude Code、Cursor、Codex などのローカル AI ツールへ 602-studio --mcp サーバーと専用執筆スキル(602-studio)をワンクリックで登録できます。設定ファイルへ手動で書き加える場合は以下の通りです。
{
"mcpServers": {
"602-studio": {
"command": "/Applications/602 Studio.app/Contents/MacOS/602 Studio",
"args": ["--mcp", "--project", "/absolute/path/to/my-story-project"]
}
}
}
3) ローカル MCP 8 種ツール一覧
| MCP ツール名 |
主な引数 |
動作と返却値 |
list_projects |
workspace_dir(任意) |
開いているプロジェクト、または指定フォルダ内の 602 原稿プロジェクト一覧・開始シーン・ファイル構成を返します。 |
open_project_folder |
project_path |
ローカル原稿フォルダ(または .602.zip)をワークスペースに読み込み、メタデータと初期リビジョンを返します。 |
save_project_folder |
project_path, export_zip(任意) |
メモリ上の編集内容をディスクのフォルダへ安全に保存します(必要に応じて .602.zip も同時に書き出します)。 |
read_manuscript |
target(declarations.md、events/<id>.md、またはシーンタイトル・ID) |
対象ファイルの現在の revision ハッシュと、各行の先頭に 2 文字チェックサムが付いた hashline テキスト(例:14#K2: \ユジン: 扉が固く閉ざされている。)を返します。ファイルパスだけでなくシーンタイトルや ID でも指定できます。 |
edit_manuscript |
target, base_revision, edits(start_anchor, end_anchor, replacement) |
base_revision と行チェックサム(14#K2)が一致することを確認してから指定行を書き換えます。食い違いがあれば編集を退け、行ズレ事故を防ぎます。 |
simulate_manuscript |
start_event, choices, initial_state, contract_results |
現在の原稿に対して story_v2_simulate と逆方向到達解析(story_v2_reach)を実行し、ターン進行と変数の変化を確かめます。 |
check_manuscript |
include_translations(任意) |
プロジェクト全体に story_v2_check をかけ、行き止まり選択肢、孤立シーン、割り込みリーク、未翻訳・原文変更ずれの一覧を返します。 |
compile_manuscript |
output_path |
静的検証を通過した原稿から執筆メモ(//)を取り除き、本番用 .602.json バンドルを出力して source_hash を返します。 |
4) hashline + base_revision による安全な編集例
// 1. read_manuscript レスポンス例
{
"target": "events/lighthouse.md",
"revision": "rev_8f31c9a0",
"hashlines": [
"12#A4: # 灯台_入口",
"13#F1: 冷たい海霧の向こうから古い灯台が姿を現した。",
"14#K2: \\ユジン: 扉が固く閉ざされている。",
"15#P9: - [has_key] 鉄扉を開ける"
]
}
// 2. edit_manuscript リクエスト例(14#K2 行を安全に置換)
{
"target": "events/lighthouse.md",
"base_revision": "rev_8f31c9a0",
"edits": [
{
"start_anchor": "14#K2",
"end_anchor": "14#K2",
"replacement": "\\ユジン: 錆びた南京錠がかかっている。鍵かピッキング道具が必要だ。"
}
]
}
10 · v2.0.2 릴리스 노트와 라이선스
602 v2.0.2 주요 변경점
- SHA-256 검증을 거치는 앱 내 자동 및 수동 업데이트: 상단 배너와 앱 설정에서 업데이트를 확인하고 진행할 수 있습니다. 서버에 자동 확인 설정과 알림을 닫은 버전이 저장되며, 저장하지 않은 초안이 있으면 업데이트 적용을 막습니다.
CHOAM-CO/602-releases의 SHA-256 체크섬으로 다운로드를 검증한 뒤 Linux는 기존 설치를 제자리에서 교체하고 실패 시 이전 버전으로 되돌립니다. Windows는 Setup 설치 프로그램으로 넘기고, macOS는 검증된 DMG를 Finder에서 엽니다.
- 뷰포트 스크롤 잠금과 내부 패널 스크롤 전파 차단: 패널 끝에서 계속 스크롤해도 앱 전체가 밀리지 않아 상단 바가 제자리에 있습니다.
- 편집기 줄 번호 여백 정렬: CodeMirror 6의 블록 스페이서 데코레이션과 줄 번호 여백의 패딩을 맞춰 6종 도시 테마 모두에서 줄 번호가 본문과 나란히 표시됩니다.
- 프로젝트 실행 취소 및 다시 실행 상태 표시:
can_undo와 can_redo 값에 따라 사용할 수 없는 도구 모음 버튼을 비활성화합니다.
호환성: 602 Story Engine(libstory_engine_v2), story_engine_v2.h 헤더, .602.json 번들은 v2.0.0 및 v2.0.1과 바이너리 호환성을 유지합니다.
602 v2.0.1 주요 변경점
- 세헤라자드 정렬 외관 설정 및 6종 도시 테마: 상단 앱 설정 · 모양 창에서
602 기본, Sera, Paris, Vancouver, Shanghai, Seoul 6종 테마를 고르고, 배경·강조색·텍스트 HEX 색상(WCAG 4.5:1 명도 대비 자동 보정), 유리감 투명도(0%~100%)와 배경 블러(끄기 / 약하게 / 강하게), 글꼴 크기(12px~16px)와 5종 서체(시스템, Pretendard, 세리프, 고정폭, 라운드)를 실시간으로 조절할 수 있습니다.
- 구조도(Structure Map) 백본·분기 자동 배치 및 테마 연동 배선: 602 1.x의 주 줄기(Backbone)·곁가지(Branch) 비겹침 통로(Corridor) 자동 배치 알고리즘을 이식하고, 스쿼클 테마에서는 둥근 필렛 곡선으로, 직각 테마(
Paris, Shanghai, Seoul)에서는 0px 맨해튼 직교 배선으로 1:1 포트 원과 전이 연결선을 그립니다.
- 장·줄 번호 레일과 줄 참조 복사,
@ 변수 자동완성 및 /game 계약 미리보기(Peek): 장면마다 1장 · 제목 형태의 장 번호와 클릭 가능한 줄 번호 레일, 상단 줄 복사 버튼을 추가했습니다. @ 입력 시 상태변수와 현재 시뮬레이션 값을 자동완성으로 보여 주고, /game 블록 안에 커서를 두면 우측에 /contract 입력·결과 필드 명세를 인라인으로 띄웁니다. 또한 시작 시 직전 프로젝트 자동 진입 대신 프로젝트 목록을 먼저 보여 주며, 로컬 MCP read_manuscript·edit_manuscript가 장면 제목이나 ID만으로도 대상 문서를 찾습니다.
602 v2.0.0 주요 변경점
- 로컬 마크다운 폴더 기반 집필 구조:
project.json, declarations.md, events/*.md, translations.json이 담긴 일반 폴더나 .602.zip 아카이브로 원고를 쓰고, 배포할 때는 작가 메모(//)를 뺀 단일 .602.json 런타임 번들로 컴파일합니다.
- C ABI v2 (
story_engine_v2.h): 마크다운 원문을 바로 다루는 Group B 함수 5종(story_v2_hashline, story_v2_analyze, story_v2_simulate, story_v2_reach, story_v2_free)과 구조화된 프로젝트·번들 JSON을 다루는 Group A 함수 5종(story_v2_compute_hash, story_v2_execute_play, story_v2_check, story_v2_summarize_scene, story_v2_free_string)으로 정리했습니다.
- 602 Studio v2.0.0 데스크톱 워크스페이스: 3단 레이아웃, 4글자 배지 레일과 자동 줄바꿈 내어쓰기(Hanging Indent), 1턴 시뮬레이션 플레이어, 5블록 Choicebox 시뮬레이션 설정, 역방향 도달 추적(Backward Reachability), 1:1 줄 해시 번역 뷰를 담았습니다.
- 로컬 MCP 서버 (
--mcp)와 hashline 편집: 로컬 MCP 도구 8종과 hashline + base_revision 대조 방식으로 줄 밀림 걱정 없이 AI 에이전트와 함께 원고를 다듬을 수 있습니다.
CHOAM Community License, Version 1.0과 오픈소스 고지
602 Studio & 602 Story Engine (v2.0.2) · CHOAM Community License, Version 1.0: 602 Studio v2.0.2, 602 Story Engine v2.0.2, story_engine_v2.h 헤더, 공식 문서 번들에는 모두 동일한 CHOAM Community License, Version 1.0(Copyright (c) 2026 CHOAM Co., Ltd.)이 적용됩니다. 초기 비용이나 사전 등록 없이 본인의 게임·애플리케이션·서비스에 내장해 상업적으로 배포할 수 있습니다. 제품별·역분기(Calendar Quarter)별 순매출(총매출에서 플랫폼 수수료·환불·간접세를 뺀 금액) 가운데 첫 10,000,000원(KRW, 1,000만 원)까지는 로열티가 면제되며, 1,000만 원을 초과한 금액에 대해서만 1% 자진 신고 로열티(분기 종료 후 45일 이내 신고·납부)가 붙습니다. 소프트웨어를 단독 제품으로 재배포하거나 경쟁 범용 엔진·SDK·저작 도구의 일부로 묶어 재배포하는 행위는 금지되며, 배포물에는 라이선스 전문과 저작권 고지를 함께 남겨야 합니다. 법적 효력은 영문 정본(/602/download 페이지와 각 배포 아카이브에 수록)을 따르며 한국어·일본어 번역본은 이해를 돕기 위한 참고용입니다(준거법: 대한민국 법, 전속관할: 서울중앙지방법원).
문의 안내: 라이선스와 상업 이용(로열티 자진 신고 포함) 문의는 mino@choam.studio로, 버그 제보·기능 제안·기술 문의는 cayde@choam.studio로 보내 주세요.
| 오픈소스 구성요소 |
라이선스 |
포함 대상 · 고지 파일 |
| RapidJSON | MIT / BSD-style Notices | 602 Story Engine과 602 Studio 내장 네이티브 엔진 (THIRD_PARTY_NOTICES.md) |
| Python & SQLite | PSF-2.0 / Public Domain | 602 Studio 내장 Python 런타임과 표준 라이브러리 (THIRD_PARTY_NOTICES.md) |
| pywebview, CodeMirror 6 & Web OSS | BSD-3-Clause / MIT Notices | 602 Studio 데스크톱 창과 프론트엔드 오픈소스 고지 (THIRD_PARTY_NOTICES.md) |
| Pretendard, Inter, Montserrat & Barlow Condensed | SIL Open Font License 1.1 | 602 Studio 내장 타이포그래피·테마 글꼴 (THIRD_PARTY_NOTICES.md) |
10 · v2.0.2 Release Notes & Licenses
What's New in 602 v2.0.2
- Verified in-app automatic and manual updates: Check for and apply updates from the top banner or App Settings. The server remembers the automatic check toggle and any dismissed release version, and the unsaved draft guard blocks updates while drafts are unsaved. Studio verifies each download against the SHA-256 checksum from
CHOAM-CO/602-releases before swapping the installation in place with rollback on Linux, handing off to the Setup installer on Windows, or opening the verified DMG in Finder on macOS.
- Viewport scroll lock and inner pane overscroll containment: Scrolling past the end of a pane no longer shifts the top bar.
- Editor line-number gutter alignment: CodeMirror 6 block spacer decorations and matched gutter padding keep line numbers aligned with the text across all six city themes.
- Project undo and redo availability: The toolbar disables unavailable actions based on
can_undo and can_redo.
Compatibility: 602 Story Engine (libstory_engine_v2), the story_engine_v2.h header, and .602.json bundles remain binary-compatible with v2.0.0 and v2.0.1.
What's New in 602 v2.0.1
- Scheherazade-Aligned Appearance Settings & 6 House Themes: Adds the App Settings · Appearance modal with six themes (
602 Default, Sera, Paris, Vancouver, Shanghai, and Seoul), custom background, accent, and text HEX colors with automatic WCAG 4.5:1 contrast enforcement, frosted glass opacity (0% to 100%) and backdrop blur (off / soft / strong), font size (12px to 16px), and five font families (System, Pretendard, Serif, Monospace, Rounded).
- Structure Map Backbone/Corridor Auto-Layout & Theme-Linked Routing: Ports the 602 1.x backbone/branch non-overlapping corridor layout and unifies wire rendering with theme corner radii (rounded fillets in squircle themes vs. 0px orthogonal Manhattan wires in
Paris, Shanghai, and Seoul) with 1:1 circular ports.
- Chapter & Line Numbers, Reference Copy,
@ Variable Completion & /game Contract Peek: Adds chapter breadcrumbs (Chapter N · Title), a clickable line-number gutter, and one-click canonical line-reference copy. Typing @ opens inline completion with declared variables and live simulation values, placing the cursor in a /game block opens an inline /contract input/output peek panel, launching the app shows the project list first, and MCP read_manuscript / edit_manuscript resolve canonical event titles and IDs.
What's New in 602 v2.0.0
- Local Markdown Folder Projects: Write directly in plain-text folders (
project.json, declarations.md, events/*.md, translations.json) or .602.zip archives, and compile comment-stripped .602.json runtime bundles for shipping builds.
- C ABI v2 (
story_engine_v2.h): Ships 5 Group B functions for raw Markdown strings (story_v2_hashline, story_v2_analyze, story_v2_simulate, story_v2_reach, story_v2_free) and 5 Group A functions for structured project and bundle JSON (story_v2_compute_hash, story_v2_execute_play, story_v2_check, story_v2_summarize_scene, story_v2_free_string).
- 602 Studio v2.0.0 Desktop Workspace: Adds the 3-panel layout, 4-character semantic badge rail with hanging indent, 1-turn simulation player, 5-block Choicebox simulation settings, backward reachability checks, and a 1:1 line-hash translation view.
- Local MCP Server (
--mcp) & hashline Editing: Provides 8 stdio MCP tools backed by hashline + base_revision checks for safe concurrent editing with AI agents.
CHOAM Community License, Version 1.0 & Third-Party Notices
602 Studio & 602 Story Engine (v2.0.2) · CHOAM Community License, Version 1.0: Every 602 v2.0.2 package, including 602 Studio v2.0.2, 602 Story Engine v2.0.2, story_engine_v2.h, and the documentation archive, is covered by the CHOAM Community License, Version 1.0 (Copyright (c) 2026 CHOAM Co., Ltd.). You can embed and ship the software inside your own games, apps, or services with no upfront fee or registration. Per product and per calendar quarter, the first 10,000,000 KRW of Net Revenue (Gross Revenue minus platform commissions, refunds/chargebacks, and indirect sales/VAT taxes) is royalty-free; a 1% self-reported royalty applies only to Net Revenue above 10,000,000 KRW, reported and paid within 45 days after quarter end. Redistributing the software standalone or inside a competing general-purpose engine, SDK, or authoring tool is prohibited, and distributed builds must keep the license text and copyright notice. The English license (/602/download and bundled in every archive) is the legally binding text (governing law: Republic of Korea; exclusive jurisdiction: Seoul Central District Court).
Contact: Email mino@choam.studio for licensing, commercial terms, and royalty self-reporting, or cayde@choam.studio for bug reports, feature requests, and technical support.
| Third-Party Component |
License |
Scope & Notice File |
| RapidJSON | MIT / BSD-style Notices | 602 Story Engine and 602 Studio embedded native engine (THIRD_PARTY_NOTICES.md) |
| Python & SQLite | PSF-2.0 / Public Domain | 602 Studio bundled Python runtime and standard library (THIRD_PARTY_NOTICES.md) |
| pywebview, CodeMirror 6 & Web OSS | BSD-3-Clause / MIT Notices | 602 Studio desktop window shell and frontend open-source notices (THIRD_PARTY_NOTICES.md) |
| Pretendard, Inter, Montserrat & Barlow Condensed | SIL Open Font License 1.1 | 602 Studio bundled typography and theme fonts (THIRD_PARTY_NOTICES.md) |
10 · v2.0.2 リリースノートとライセンス
602 v2.0.2 の主な変更点
- SHA-256 検証付きのアプリ内自動・手動アップデート: 上部バナーまたはアプリ設定から更新を確認して適用できます。自動確認の設定と通知を閉じたバージョンはサーバー側に保存され、未保存の下書きがある場合は更新を適用しません。
CHOAM-CO/602-releases の SHA-256 チェックサムでダウンロードを検証した後、Linux では既存のインストールをその場で置き換え、失敗時は元に戻します。Windows では Setup インストーラーに引き継ぎ、macOS では検証済みの DMG を Finder で開きます。
- ビューポートのスクロール固定と内部ペインのオーバースクロール抑制: ペインの端を越えてスクロールしても上部バーがずれなくなりました。
- エディターの行番号ガターの位置合わせ: CodeMirror 6 のブロックスペーサー装飾とガターのパディングを揃え、6 種すべての都市テーマで行番号と本文の位置を合わせました。
- プロジェクトの取り消し・やり直しの可否:
can_undo と can_redo に応じて、使えないツールバーのボタンを無効にします。
互換性: 602 Story Engine(libstory_engine_v2)、story_engine_v2.h ヘッダー、.602.json バンドルは、v2.0.0 および v2.0.1 とのバイナリ互換性を維持します。
602 v2.0.1 の主な変更点
- Scheherazade 準拠の外観設定と 6 種の都市テーマ: 上部のアプリ設定・外観モーダルから
602 デフォルト、Sera、Paris、Vancouver、Shanghai、Seoul の 6 テーマを選べるほか、背景・アクセント・文字の HEX カラー(WCAG 4.5:1 コントラスト自動補正)、すりガラス透明度(0%〜100%)と背景ブラー(オフ / 弱 / 強)、文字サイズ(12px〜16px)および 5 種の書体(システム、Pretendard、セリフ、等幅、丸ゴシック)をリアルタイムに切り替えられます。
- 構造マップ(Structure Map)の幹線・通路自動配置とテーマ連動配線: 602 1.x の主幹(Backbone)・枝分かれ(Branch)の非重複通路レイアウトを移植し、スクワークル系テーマでは丸みのあるフィレット曲線、直角テーマ(
Paris、Shanghai、Seoul)では 0px のマンハッタン直交配線で 1:1 ポート円と遷移線を描画します。
- 章・行番号レールと参照コピー、
@ 変数補完および /game 契約プレビュー(Peek): シーンごとの 第1章 · タイトル 表示とクリック可能な行番号レール、ワンクリックの行コピーボタンを追加しました。@ 入力で状態変数と現在値を補完でき、/game ブロック内にカーソルを置くと右側に /contract の入出力フィールド定義をインライン表示します。また起動時はプロジェクト一覧を先に表示し、ローカル MCP の read_manuscript・edit_manuscript がシーンタイトルや ID でも対象文書を解決します。
602 v2.0.0 の主な変更点
- ローカル Markdown フォルダでの執筆構成:
project.json、declarations.md、events/*.md、translations.json が入った通常のフォルダや .602.zip アーカイブで執筆し、配布時は執筆メモ(//)を除いた単一の .602.json ランタイムバンドルへコンパイルします。
- C ABI v2(
story_engine_v2.h): 生の Markdown 文字列を扱う Group B 関数 5 種(story_v2_hashline、story_v2_analyze、story_v2_simulate、story_v2_reach、story_v2_free)と、構造化プロジェクト/バンドル JSON を扱う Group A 関数 5 種(story_v2_compute_hash、story_v2_execute_play、story_v2_check、story_v2_summarize_scene、story_v2_free_string)を備えています。
- 602 Studio v2.0.0 デスクトップワークスペース: 3 パネル画面、4 文字バッジレールと折り返し時のぶら下げインデント(Hanging Indent)、1 ターンシミュレーションプレイヤー、5 ブロック Choicebox 設定モーダル、逆方向到達解析(Backward Reachability)、1:1 行ハッシュ翻訳ビューを搭載しました。
- ローカル MCP サーバー(
--mcp)と hashline 編集: ローカル MCP の 8 ツールと hashline + base_revision の照合により、行ズレの心配なく AI エージェントと一緒に原稿を編集できます。
CHOAM Community License, Version 1.0 とサードパーティ OSS 表記
602 Studio & 602 Story Engine (v2.0.2) · CHOAM Community License, Version 1.0: 602 Studio v2.0.2、602 Story Engine v2.0.2、story_engine_v2.h、および公式ドキュメントバンドルには、すべて共通の CHOAM Community License, Version 1.0(Copyright (c) 2026 CHOAM Co., Ltd.)が適用されます。初期費用や事前登録なしで自身のゲーム・アプリケーション・サービスへ組み込んで商用配布でき、製品ごと・暦四半期ごとの純売上(総売上からプラットフォーム手数料・返金・間接税を差し引いた額)のうち最初の 10,000,000 韓国ウォン(KRW、1,000 万ウォン)まではロイヤリティは不要です。1,000 万ウォンを超えた分に対してのみ 1% の自己申告ロイヤリティ(四半期終了後 45 日以内に申告・支払)が発生します。本ソフトウェア単体での再配布や、競合する汎用エンジン・SDK・オーサリングツールの一部としての再配布は禁じられており、配布物にはライセンス全文と著作権表示を残す必要があります。法的な正文は英語版(/602/download および各アーカイブに収録)であり、韓国語訳・日本語訳は参考訳です(準拠法:大韓民国法、専属管轄:ソウル中央地方裁判所)。
お問い合わせ窓口: ライセンス・商用利用(ロイヤリティの自己申告を含む)は mino@choam.studio、バグ報告・機能要望・技術的なご質問は cayde@choam.studio までご連絡ください。
| コンポーネント |
ライセンス |
同梱対象・表記ファイル |
| RapidJSON | MIT / BSD-style Notices | 602 Story Engine および 602 Studio 内蔵ネイティブエンジン(THIRD_PARTY_NOTICES.md) |
| Python & SQLite | PSF-2.0 / Public Domain | 602 Studio 同梱 Python ランタイムおよび標準ライブラリ(THIRD_PARTY_NOTICES.md) |
| pywebview, CodeMirror 6 & Web OSS | BSD-3-Clause / MIT Notices | 602 Studio デスクトップウィンドウ・フロントエンド OSS 表記(THIRD_PARTY_NOTICES.md) |
| Pretendard, Inter, Montserrat & Barlow Condensed | SIL Open Font License 1.1 | 602 Studio 同梱タイポグラフィ・テーマ用フォント(THIRD_PARTY_NOTICES.md) |