From 6f4712e461165f49d44b61d33e08f11306da9a9b Mon Sep 17 00:00:00 2001 From: syui Date: Tue, 27 May 2025 01:21:35 +0900 Subject: [PATCH] add lex --- .github/workflows/generate-record.yml | 38 +++++++ lex/ai.syui.system.json | 153 ++++++++++++++++++++++++++ scpt/generate_record.py | 10 ++ 3 files changed, 201 insertions(+) create mode 100644 .github/workflows/generate-record.yml create mode 100644 lex/ai.syui.system.json create mode 100644 scpt/generate_record.py diff --git a/.github/workflows/generate-record.yml b/.github/workflows/generate-record.yml new file mode 100644 index 0000000..c2a5cc4 --- /dev/null +++ b/.github/workflows/generate-record.yml @@ -0,0 +1,38 @@ +name: Generate Record JSON + +on: + workflow_dispatch: # 手動トリガー + push: + paths: + - scpt/generate_record.py # スクリプトに変更があったとき + schedule: + - cron: '0 3 * * *' # 毎日03:00 UTCに自動生成(任意) + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install Dependencies + run: | + pip install -r requirements.txt || true # 必要なら + + - name: Run Record Generator Script + run: | + python scpt/generate_record.py + + - name: Commit and Push Generated JSON + run: | + git config --global user.name "GitHub Actions Bot" + git config --global user.email "actions@github.com" + git add record.json + git commit -m "🧬 Auto-generate record.json" || echo "No changes to commit" + git push origin main diff --git a/lex/ai.syui.system.json b/lex/ai.syui.system.json new file mode 100644 index 0000000..79a430e --- /dev/null +++ b/lex/ai.syui.system.json @@ -0,0 +1,153 @@ +{ + "lexicon": 1, + "id": "ai.syui.system", + "revision": 1, + "description": "Syui's system definitions for game logic and metaphysics", + "defs": { + "main": { + "type": "record", + "record": { + "key": "self", + "recordType": "document", + "schema": { + "type": "object", + "required": ["card", "system"], + "properties": { + "card": { + "type": "array", + "items": { "$ref": "#card" } + }, + "system": { + "type": "array", + "items": { "$ref": "#system" } + }, + "weapon": { + "type": "array", + "items": { "$ref": "#weapon" } + }, + "ability": { + "type": "array", + "items": { "$ref": "#ability" } + }, + "character": { + "type": "array", + "items": { "$ref": "#character" } + } + } + } + } + }, + "card": { + "type": "object", + "required": ["id", "img", "name", "lang"], + "properties": { + "id": { "type": "integer" }, + "img": { "type": "string" }, + "name": { "type": "string" }, + "lang": { + "type": "object", + "properties": { + "ja": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "text": { "type": "string" } + } + } + } + } + } + }, + "system": { + "type": "object", + "required": ["id", "enum", "name", "lang"], + "properties": { + "id": { "type": "integer" }, + "enum": { + "type": "array", + "items": { "type": "string" } + }, + "name": { "type": "string" }, + "alias": { + "type": "array", + "items": { "type": "string" } + }, + "lang": { + "type": "object", + "properties": { + "ja": { "type": "string" } + } + }, + "description": { "type": "string" } + } + }, + "weapon": { + "type": "object", + "required": ["id", "img", "name", "lang"], + "properties": { + "id": { "type": "integer" }, + "img": { "type": "string" }, + "name": { "type": "string" }, + "lang": { + "type": "object", + "properties": { + "ja": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "text": { "type": "string" } + } + } + } + } + } + }, + "ability": { + "type": "object", + "required": ["id", "name", "color"], + "properties": { + "id": { "type": "integer" }, + "name": { "type": "string" }, + "lang": { + "type": "object", + "properties": { + "ja": { "type": "string" } + } + }, + "color": { "type": "string" }, + "group": { + "type": "array", + "items": { "type": "string" } + }, + "duration": { "type": "integer" }, + "multiplier": { + "type": "object", + "additionalProperties": { "type": "number" } + } + } + }, + "character": { + "type": "object", + "required": ["id", "name", "lang"], + "properties": { + "id": { "type": "integer" }, + "img": { "type": "string" }, + "name": { "type": "string" }, + "lang": { + "type": "object", + "properties": { + "ja": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "text": { "type": "string" }, + "description": { "type": "string" } + } + } + } + }, + "text": { "type": "string" } + } + } + } +} diff --git a/scpt/generate_record.py b/scpt/generate_record.py new file mode 100644 index 0000000..e45ca4a --- /dev/null +++ b/scpt/generate_record.py @@ -0,0 +1,10 @@ +import json + +record = { + "$type": "app.bsky.feed.post", + "text": "テスト投稿 from script", + "createdAt": "2025-05-26T12:00:00Z" +} + +with open("record.json", "w", encoding="utf-8") as f: + json.dump(record, f, ensure_ascii=False, indent=2)