Compare commits

2 Commits
main ... min

Author SHA1 Message Date
743c1096ae minimal 2026-01-18 20:42:45 +09:00
ea3652aec6 fix oauth config 2026-01-18 20:14:49 +09:00
374 changed files with 181 additions and 11477 deletions

View File

@@ -1,13 +0,0 @@
# LMS Translation API
TRANSLATE_URL=http://127.0.0.1:1234/v1
TRANSLATE_MODEL=plamo-2-translate
# Chat API
CHAT_URL=http://127.0.0.1:1234/v1
CHAT_MODEL=gpt-oss-20b
CHAT_LANG=en
# CHAT_MAX_TOKENS=2048
# Character/system prompt (choose one)
# CHAT_SYSTEM="You are ai, a friendly AI assistant."
# CHAT_SYSTEM_FILE=./character.txt

View File

@@ -1,36 +0,0 @@
name: Deploy to Cloudflare Pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- name: Build content from ATProto
run: npm run build
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@@ -7,4 +7,3 @@ node_modules
package-lock.json
Cargo.lock
.env
.mcp.json

View File

@@ -1,25 +0,0 @@
[package]
name = "ailog"
version = "0.0.1"
edition = "2021"
description = "ATProto blog CLI"
authors = ["syui"]
homepage = "https://syui.ai"
repository = "https://git.syui.ai/ai/log"
[[bin]]
name = "ailog"
path = "src/main.rs"
[dependencies]
clap = { version = "4.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
anyhow = "1.0"
dirs = "5.0"
chrono = { version = "0.4", features = ["serde"] }
rand = "0.8"
dotenvy = "0.15"
rustyline = "15"

View File

@@ -1,48 +0,0 @@
{
"lexicon": 1,
"id": "ai.syui.at.link",
"defs": {
"main": {
"type": "record",
"description": "Record containing links to external service profiles.",
"key": "literal:self",
"record": {
"type": "object",
"required": ["links", "createdAt"],
"properties": {
"links": {
"type": "array",
"items": { "type": "ref", "ref": "#linkItem" },
"description": "Array of external service links."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp when this record was created."
},
"updatedAt": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp when this record was last updated."
}
}
}
},
"linkItem": {
"type": "object",
"required": ["service", "username"],
"properties": {
"service": {
"type": "string",
"knownValues": ["github", "youtube", "x"],
"description": "Service identifier."
},
"username": {
"type": "string",
"maxLength": 300,
"description": "Username or ID on the service."
}
}
}
}
}

View File

@@ -1,71 +0,0 @@
{
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"id": "ai.syui.card.admin",
"defs": {
"main": {
"type": "record",
"key": "literal:self",
"description": "Card game configuration and master data (admin only)",
"record": {
"type": "object",
"required": ["gacha", "card", "createdAt", "updatedAt"],
"properties": {
"gacha": {
"type": "object",
"required": ["pickup", "rate", "pool"],
"properties": {
"pickup": { "type": "integer", "description": "Pickup card ID" },
"rate": {
"type": "object",
"required": ["pickup", "rare"],
"properties": {
"pickup": { "type": "integer", "description": "1/n for pickup rate (100 = 1%)" },
"rare": { "type": "integer", "description": "1/n for rare:1 rate (10 = 10%), rare:2 = 1/(n*10), rare:3 = 1/(n*100)" }
}
},
"pool": {
"type": "array",
"description": "Card IDs available in gacha pool",
"items": { "type": "integer" }
}
}
},
"card": {
"type": "array",
"description": "Card master data",
"items": {
"type": "object",
"required": ["id", "character", "name", "text", "cp", "effect"],
"properties": {
"id": { "type": "integer", "description": "Card ID" },
"character": { "type": "integer", "description": "Associated character ID" },
"name": {
"type": "object",
"required": ["ja", "en"],
"properties": {
"ja": { "type": "string" },
"en": { "type": "string" }
}
},
"text": {
"type": "object",
"required": ["ja", "en"],
"properties": {
"ja": { "type": "string" },
"en": { "type": "string" }
}
},
"cp": { "type": "string", "description": "CP type (status, time, damage)" },
"effect": { "type": "string", "description": "Effect type (status, fly, mode, damage)" },
"key": { "type": "string", "description": "Key binding (R1, L1, Y, X, etc.)" }
}
}
},
"createdAt": { "type": "string", "format": "datetime" },
"updatedAt": { "type": "string", "format": "datetime" }
}
}
}
}
}

View File

@@ -1,52 +0,0 @@
{
"lexicon": 1,
"id": "ai.syui.card.old",
"defs": {
"main": {
"type": "record",
"key": "literal:self",
"description": "Migrated card data from api.syui.ai",
"record": {
"type": "object",
"required": ["user", "card", "migratedAt"],
"properties": {
"user": {
"type": "object",
"required": ["username"],
"properties": {
"username": { "type": "string" },
"did": { "type": "string" },
"aiten": { "type": "integer" },
"fav": { "type": "integer" },
"coin": { "type": "integer" },
"planet": { "type": "integer" },
"createdAt": { "type": "string", "format": "datetime" },
"updatedAt": { "type": "string", "format": "datetime" }
}
},
"card": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "cp", "rare", "cid", "unique"],
"properties": {
"id": { "type": "integer", "description": "Card type ID" },
"cp": { "type": "integer", "description": "Card power" },
"rare": { "type": "integer", "description": "Rarity level" },
"cid": { "type": "string", "description": "Unique card instance ID" },
"unique": { "type": "boolean", "description": "Unique card flag" }
}
}
},
"checksum": {
"type": "string"
},
"migratedAt": {
"type": "string",
"format": "datetime"
}
}
}
}
}
}

View File

@@ -1,34 +0,0 @@
{
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"id": "ai.syui.card.user",
"defs": {
"main": {
"type": "record",
"key": "literal:self",
"description": "User card collection",
"record": {
"type": "object",
"required": ["card", "createdAt", "updatedAt"],
"properties": {
"card": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "cp", "rare", "cid", "unique"],
"properties": {
"id": { "type": "integer", "description": "Card type ID" },
"cp": { "type": "integer", "description": "Card power" },
"rare": { "type": "integer", "description": "Rarity level" },
"cid": { "type": "string", "description": "Unique card instance ID" },
"unique": { "type": "boolean", "description": "Unique card flag" }
}
}
},
"createdAt": { "type": "string", "format": "datetime" },
"updatedAt": { "type": "string", "format": "datetime" }
}
}
}
}
}

View File

@@ -1,72 +0,0 @@
{
"lexicon": 1,
"id": "ai.syui.log.chat",
"defs": {
"main": {
"type": "record",
"description": "Record containing a chat message in a conversation.",
"key": "tid",
"record": {
"type": "object",
"required": ["content", "author", "createdAt"],
"properties": {
"content": {
"type": "string",
"maxLength": 100000,
"maxGraphemes": 10000,
"description": "The content of the message."
},
"author": {
"type": "string",
"format": "did",
"description": "DID of the message author."
},
"root": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the root message in the thread."
},
"parent": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the parent message being replied to."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp when this message was created."
},
"lang": {
"type": "string",
"maxLength": 10,
"description": "Language code of the original content (e.g., 'ja', 'en')."
},
"translations": {
"type": "ref",
"ref": "#translationMap",
"description": "Translations of the message in other languages."
}
}
}
},
"translationMap": {
"type": "object",
"description": "Map of language codes to translations.",
"properties": {
"en": { "type": "ref", "ref": "#translation" },
"ja": { "type": "ref", "ref": "#translation" }
}
},
"translation": {
"type": "object",
"description": "A translation of a chat message.",
"properties": {
"content": {
"type": "string",
"maxLength": 100000,
"maxGraphemes": 10000
}
}
}
}
}

View File

@@ -1,68 +0,0 @@
{
"lexicon": 1,
"id": "ai.syui.log.post",
"defs": {
"main": {
"type": "record",
"description": "Record containing a blog post.",
"key": "tid",
"record": {
"type": "object",
"required": ["title", "content", "createdAt"],
"properties": {
"title": {
"type": "string",
"maxLength": 3000,
"maxGraphemes": 300,
"description": "The title of the post."
},
"content": {
"type": "string",
"maxLength": 1000000,
"maxGraphemes": 100000,
"description": "The content of the post (markdown)."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp when this post was originally created."
},
"lang": {
"type": "string",
"maxLength": 10,
"description": "Language code of the original content (e.g., 'ja', 'en')."
},
"translations": {
"type": "ref",
"ref": "#translationMap",
"description": "Translations of the post in other languages."
}
}
}
},
"translationMap": {
"type": "object",
"description": "Map of language codes to translations.",
"properties": {
"en": { "type": "ref", "ref": "#translation" },
"ja": { "type": "ref", "ref": "#translation" }
}
},
"translation": {
"type": "object",
"description": "A translation of a post.",
"properties": {
"title": {
"type": "string",
"maxLength": 3000,
"maxGraphemes": 300
},
"content": {
"type": "string",
"maxLength": 1000000,
"maxGraphemes": 100000
}
}
}
}
}

View File

@@ -1,99 +0,0 @@
{
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"id": "ai.syui.rse.admin",
"defs": {
"main": {
"type": "record",
"key": "literal:self",
"description": "RSE admin configuration - abilities, characters, systems and collections",
"record": {
"type": "object",
"required": ["ability", "createdAt", "updatedAt"],
"properties": {
"ability": {
"type": "array",
"description": "Ability/attribute definitions",
"items": {
"type": "object",
"required": ["id", "name", "kind"],
"properties": {
"id": { "type": "integer", "description": "Ability ID" },
"name": { "type": "string", "description": "Ability name (ai, quark, neutron, atom, sun)" },
"kind": { "type": "string", "description": "Attribute type (consciousness, matter)" },
"color": { "type": "string", "description": "Color code (e.g., #ffd700)" },
"level": { "type": "integer", "description": "Hierarchy level (0=fundamental)" },
"relation": { "type": "array", "items": { "type": "integer" }, "description": "Advantage IDs" },
"weakness": { "type": "array", "items": { "type": "integer" }, "description": "Weakness IDs" },
"multiplier": { "type": "integer", "description": "Damage multiplier percent (e.g., 150 = 1.5x)" },
"phantom": { "type": "boolean", "description": "Whether this ability is phantom/lost" }
}
}
},
"character": {
"type": "array",
"description": "Character definitions",
"items": {
"type": "object",
"required": ["id", "name", "ability", "mode"],
"properties": {
"id": { "type": "integer", "description": "Character ID" },
"name": { "type": "string", "description": "Character name" },
"ability": { "type": "integer", "description": "Ability ID reference" },
"mode": { "type": "integer", "description": "Character mode" }
}
}
},
"system": {
"type": "array",
"description": "System definitions",
"items": {
"type": "object",
"required": ["id", "name", "domain"],
"properties": {
"id": { "type": "integer", "description": "System ID" },
"name": { "type": "string", "description": "System name" },
"domain": { "type": "string", "description": "System domain (ability, unique, account, planet, origin)" }
}
}
},
"item": {
"type": "array",
"description": "Item definitions",
"items": {
"type": "object",
"required": ["id", "name", "text"],
"properties": {
"id": { "type": "integer", "description": "Item ID" },
"name": { "type": "string", "description": "Item name" },
"text": {
"type": "object",
"description": "Item description (localized)",
"properties": {
"en": { "type": "string", "description": "English text" },
"ja": { "type": "string", "description": "Japanese text" }
}
}
}
}
},
"collection": {
"type": "array",
"description": "ATProto collection definitions",
"items": {
"type": "object",
"required": ["id", "nsid", "name"],
"properties": {
"id": { "type": "integer", "description": "Collection ID" },
"nsid": { "type": "string", "description": "Namespaced identifier (e.g., ai.syui.card)" },
"name": { "type": "string", "description": "Collection short name" }
}
}
},
"createdAt": { "type": "string", "format": "datetime" },
"updatedAt": { "type": "string", "format": "datetime" }
}
}
}
}
}

View File

@@ -1,48 +0,0 @@
{
"$type": "com.atproto.lexicon.schema",
"lexicon": 1,
"id": "ai.syui.rse.user",
"defs": {
"main": {
"type": "record",
"key": "literal:self",
"description": "User character and item collection",
"record": {
"type": "object",
"required": ["character", "item", "createdAt", "updatedAt"],
"properties": {
"character": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "cp", "rare", "cid", "unique"],
"properties": {
"id": { "type": "integer", "description": "Character type ID" },
"cp": { "type": "integer", "description": "Character power" },
"rare": { "type": "integer", "description": "Rarity level" },
"cid": { "type": "string", "description": "Unique character instance ID" },
"unique": { "type": "boolean", "description": "Unique character flag" }
}
}
},
"item": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "cp", "rare", "cid", "unique"],
"properties": {
"id": { "type": "integer", "description": "Item type ID" },
"cp": { "type": "integer", "description": "Item power" },
"rare": { "type": "integer", "description": "Rarity level" },
"cid": { "type": "string", "description": "Unique item instance ID" },
"unique": { "type": "boolean", "description": "Unique item flag" }
}
}
},
"createdAt": { "type": "string", "format": "datetime" },
"updatedAt": { "type": "string", "format": "datetime" }
}
}
}
}
}

View File

@@ -4,16 +4,14 @@
"type": "module",
"scripts": {
"dev": "vite",
"prebuild": "ailog index 2>/dev/null || true",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@atproto/api": "^0.15.12",
"@atproto/lexicon": "^0.6.0",
"@atproto/oauth-client-browser": "^0.3.19",
"highlight.js": "^11.11.1",
"marked": "^15.0.6"
"marked": "^15.0.6",
"highlight.js": "^11.11.1"
},
"devDependencies": {
"typescript": "^5.7.3",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Some files were not shown because too many files have changed in this diff Show More