Compare commits
2 Commits
b212f152a6
...
min
| Author | SHA1 | Date | |
|---|---|---|---|
|
743c1096ae
|
|||
|
ea3652aec6
|
12
.env.example
@@ -1,12 +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_MAX_TOKENS=2048
|
|
||||||
|
|
||||||
# Character/system prompt (choose one)
|
|
||||||
# CHAT_SYSTEM="You are ai, a friendly AI assistant."
|
|
||||||
# CHAT_SYSTEM_FILE=./character.txt
|
|
||||||
36
.github/workflows/cf-pages.yml
vendored
@@ -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
@@ -7,4 +7,3 @@ node_modules
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
.env
|
.env
|
||||||
.mcp.json
|
|
||||||
|
|||||||
25
Cargo.toml
@@ -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"
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,16 +4,14 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"prebuild": "ailog index 2>/dev/null || true",
|
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/api": "^0.15.12",
|
"@atproto/api": "^0.15.12",
|
||||||
"@atproto/lexicon": "^0.6.0",
|
|
||||||
"@atproto/oauth-client-browser": "^0.3.19",
|
"@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": {
|
"devDependencies": {
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 45 KiB |