Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/about/ai/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# AI質問機能について

my.code(); では、学習をサポートするための AI アシスタント機能を提供しています。
ご利用前に以下の事項をご確認ください。

## AIの回答の正確性について

**AIの回答は誤りを含む場合があります。**

AIは非常に自信を持って誤った情報を回答することがあります。
AIの回答を鵜呑みにせず、必ず自分自身で内容を確認するようにしてください。

## 免責事項

AI質問機能の利用によって生じたいかなる損害についても、ut.code(); は責任を負いません。

## 使用しているAIモデルについて

AIモデルへのアクセスには [OpenRouter](https://openrouter.ai/) を使用しています。
使用するモデルは ut.code(); が選択しており、ユーザーが変更することはできません。
また、使用するモデルは予告なく変更される場合があります。

## データの取り扱いについて

**入力データの利用について**

- AIへの質問内容やこのサイトで実行したコードのデータは、AIモデルのプロバイダーによって学習データとして利用される可能性があります。
- また、サービス品質の向上等を目的として、ut.code(); のメンバーが閲覧可能な形でサイトに保存されます。
- **個人情報や機密情報は入力しないようにしてください。**
16 changes: 16 additions & 0 deletions app/about/ai/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from "next";
import { StyledMarkdown } from "@/markdown/markdown";
import content from "./content.md?raw";

export const metadata: Metadata = {
title: "AI質問機能について",
description: "my.code(); のAI質問機能の詳細と利用上の注意事項について説明します。",
};

export default function AiPage() {
return (
<div className="p-4 pb-16 w-full max-w-docs mx-auto">
<StyledMarkdown content={content} />
</div>
);
}
97 changes: 97 additions & 0 deletions app/about/license/ThirdPartyLicenses.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
"use client";

import { useEffect, useState } from "react";

interface LicenseEntry {
name: string;
version: string;
author?: string;
repository?: string;
source?: string;
license: string;
licenseText?: string;
}

export function ThirdPartyLicenses() {
const [licenses, setLicenses] = useState<LicenseEntry[] | null>(null);
const [error, setError] = useState(false);
const [expanded, setExpanded] = useState<string | null>(null);

useEffect(() => {
fetch("/_next/static/oss-licenses.json")
.then((res) => {
if (!res.ok) throw new Error("not found");
return res.json();
})
.then((data) => setLicenses(data))
.catch(() => setError(true));
}, []);

if (error) {
return (
<p className="opacity-60 text-sm">
ライセンス情報の読み込みに失敗しました。
</p>
);
}

if (!licenses) {
return (
<div className="flex items-center gap-2 opacity-60">
<span className="loading loading-spinner loading-sm" />
<span>読み込み中...</span>
</div>
);
}

return (
<div className="flex flex-col gap-2">
{licenses.map((pkg) => {
const key = `${pkg.name}@${pkg.version}`;
const isOpen = expanded === key;
return (
<div key={key} className="collapse collapse-arrow bg-base-200">
<input
type="checkbox"
checked={isOpen}
onChange={() => setExpanded(isOpen ? null : key)}
/>
<div className="collapse-title font-mono text-sm">
<span className="font-bold">{pkg.name}</span>
<span className="opacity-60 ml-2">v{pkg.version}</span>
<span className="badge badge-outline badge-sm ml-3">
{pkg.license}
</span>
</div>
<div className="collapse-content text-sm">
{pkg.author && (
<p className="mb-1">
<span className="opacity-60">Author: </span>
{pkg.author}
</p>
)}
{pkg.repository && (
<p className="mb-1">
<span className="opacity-60">Repository: </span>
<a
className="link link-primary break-all"
href={pkg.repository}
target="_blank"
rel="noopener noreferrer"
>
{pkg.repository}
</a>
</p>
)}
{pkg.licenseText && (
<pre className="mt-2 whitespace-pre-wrap text-xs bg-base-300 p-3 rounded-box overflow-x-auto">
{pkg.licenseText}
</pre>
)}
</div>
</div>
);
})}
</div>
);
}
31 changes: 31 additions & 0 deletions app/about/license/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Metadata } from "next";
import { Heading } from "@/markdown/heading";
import licenseText from "../../../LICENSE?raw";
import { ThirdPartyLicenses } from "./ThirdPartyLicenses";

export const metadata: Metadata = {
title: "ライセンス",
description: "my.code(); のライセンスおよび使用しているサードパーティライブラリのライセンス情報です。",
};

export default function LicensePage() {
return (
<div className="p-4 pb-16 w-full max-w-docs mx-auto">
<Heading level={1}>ライセンス</Heading>

<Heading level={2}>my.code(); のライセンス</Heading>
<p className="my-4 opacity-80">
my.code(); のソースコードは MIT ライセンスのもとで公開されています。
</p>
<pre className="bg-base-200 rounded-box p-4 text-sm whitespace-pre-wrap overflow-x-auto my-4">
{licenseText}
</pre>

<Heading level={2}>サードパーティライブラリのライセンス</Heading>
<p className="my-4 opacity-80">
my.code(); は以下のオープンソースライブラリを使用しています。
</p>
<ThirdPartyLicenses />
</div>
);
}
53 changes: 53 additions & 0 deletions app/about/runtime/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# コード実行環境について

my.code(); では、プログラミング言語ごとに異なる仕組みでコードを実行しています。
以下にそれぞれの言語の実行環境について説明します。

## ブラウザ内で実行される言語

以下の言語は、サーバーへの通信を行わず、すべてお使いのブラウザ内で実行されます。
そのため、インターネット接続が不安定な環境でも、一度ページが読み込まれれば実行可能です。

### Python

Python は [Pyodide](https://pyodide.org/) を使用して実行されます。
Pyodide は CPython(Python の公式実装)を WebAssembly にコンパイルしたものです。
Python コードはブラウザ内の Web Worker 上で動作するため、ページの描画をブロックせずに実行できます。

### Ruby

Ruby は [ruby.wasm](https://ruby.github.io/ruby.wasm/) を使用して実行されます。
ruby.wasm は公式の CRuby を WebAssembly にコンパイルしたものです。
Python と同様に Web Worker 上で動作します。

### JavaScript

JavaScript はブラウザ自身の JavaScript エンジンを利用して実行されます。
コードは安全なサンドボックス環境内で評価されます。

### TypeScript

TypeScript は [@typescript/vfs](https://www.npmjs.com/package/@typescript/vfs) を使用してブラウザ内でコンパイルされ、その後 JavaScript と同じ仕組みで実行されます。

## 外部サービスを利用して実行される言語

以下の言語は、外部のコンパイル・実行サービス([Wandbox](https://wandbox.org/))の API を通じて実行されます。
コードはサーバーに送信されてコンパイル・実行され、結果がブラウザに返されます。
そのため、実行にはインターネット接続が必要です。
また、入力したコードが Wandbox のサーバーに送信されることをご了承ください。

### C++

Wandbox の g++ (GNU C++ Compiler) を使用してコンパイル・実行されます。
最新の安定版コンパイラが使用され、Boost ライブラリも利用可能です。
実行時にエラーが発生した場合は、スタックトレースが表示されます。

### Rust

Wandbox の rustc (Rust コンパイラ) を使用してコンパイル・実行されます。
最新版のコンパイラが使用されます。

---

外部サービスを利用して実行される言語(C++・Rust)では、入力したコードが外部サーバーに送信されます。
個人情報や機密情報を含むコードは入力しないようにしてください。
16 changes: 16 additions & 0 deletions app/about/runtime/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from "next";
import { StyledMarkdown } from "@/markdown/markdown";
import content from "./content.md?raw";

export const metadata: Metadata = {
title: "コード実行環境について",
description: "my.code(); で使用しているコード実行環境の仕組みを説明します。",
};

export default function RuntimePage() {
return (
<div className="p-4 pb-16 w-full max-w-docs mx-auto">
<StyledMarkdown content={content} />
</div>
);
}
22 changes: 22 additions & 0 deletions app/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Link from "next/link";

export function Footer() {
return (
<footer className="footer sm:footer-horizontal bg-neutral text-neutral-content p-10 z-30">
Expand Down Expand Up @@ -26,6 +28,26 @@ export function Footer() {
</a>
<p>Copyright © 2026 ut.code();</p>
</aside>
<nav>
<h6 className="footer-title normal-case">my.code(); について</h6>
<Link href="/about/runtime" className="link link-hover">
コード実行環境について
</Link>
<Link href="/about/ai" className="link link-hover">
AI質問機能について
</Link>
<Link href="/about/license" className="link link-hover">
ライセンス
</Link>
<a
className="link link-hover"
href="https://forms.gle/XXXXXXXXXXXXXXXX"
target="_blank"
rel="noopener noreferrer"
>
お問い合わせ
</a>
</nav>
<nav>
<h6 className="footer-title normal-case">ut.code(); について</h6>
<a
Expand Down
24 changes: 23 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { NextConfig } from "next";
import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
import { PyodidePlugin } from "@pyodide/webpack-plugin";
import { version as pyodideVersion } from "pyodide/package.json";
import LicensePlugin from "webpack-license-plugin";
import { dirname } from "node:path";

initOpenNextCloudflareForDev();

Expand Down Expand Up @@ -42,7 +44,7 @@ const nextConfig: NextConfig = {
},
];
},
webpack: (config) => {
webpack: (config, { isServer }) => {
config.plugins.push(
new PyodidePlugin({
// public/ 以下に書き出すと404
Expand All @@ -68,6 +70,26 @@ const nextConfig: NextConfig = {
resourceQuery: /raw/,
type: "asset/source",
});
// クライアントビルドのみサードパーティライセンスを /_next/static/oss-licenses.json に出力
if (!isServer) {
config.plugins.push(
new LicensePlugin({
outputFilename: "static/oss-licenses.json",
includeNoticeText: true,
excludedPackageTest: (packageName /*, version*/) => {
return packageName.startsWith("@my-code");
},
licenseOverrides: {
"@better-auth/core@1.4.20": "MIT",
"@better-fetch/fetch@1.1.21": "MIT",
},
includePackages: () =>
["tailwindcss", "@fontsource/m-plus-rounded-1c"].map((pkg) =>
dirname(import.meta.resolve(`${pkg}/package.json`))
),
})
);
}
return config;
},
async redirects() {
Expand Down
Loading
Loading