feat(harness): 用戶 CC harness(acr install-harness)+ 公開 repo 只留對外
讓「用 arcrun 開發」的用戶,他的 CC 自動載入 arcrun 防護、不退回自寫 Python。 新增 user-cc-harness(SDD: .agents/specs/user-cc-harness,本機): - acr install-harness:冪等裝進用戶當前專案(新/舊專案皆可),acr init 末尾也順便裝 - CLAUDE.md arcrun 區塊(標記包夾,append 不破壞既有) - .claude/skills/arcrun-mindset(世界觀 + 資源去哪取 acr parts/auth-recipe) - .claude/commands/arcrun.md(/arcrun slash command) - .claude/hooks/arcrun-guard.sh(python→提醒不硬擋、暴露→exit 2、每條含正路) - settings.json 合併 hook(不覆蓋用戶既有 hooks/設定) - llms.txt + README「給 AI」段:第一接觸點(用戶丟連結,CC 讀了知道第一步 install-harness) 含 CF 憑證白話照抄式引導(不對用戶講 KV/Worker/R2 術語) - harness 素材內嵌 npm 套件(cli/harness/,files 帶上),不依賴用戶有 arcrun repo - 實測:空目錄/冪等/既有檔合併皆通過,tsc exit 0,npm pack 含 harness 5 檔 公開 repo 清理(richblack:用戶要用不要開發 arcrun): - git rm --cached 移除開發痕跡 + 思考過程出公開 repo(本機保留供 richblack 開發): .claude/CLAUDE.md/AGENTS.md/.agents/docs/DECISIONS/BACKLOG/landing/.github - .gitignore 防回流;補 MIT LICENSE MCP(P7)納入 install-harness/update 的接點已設計,實作待 MCP 對齊(BACKLOG 另一條線)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
'use client';
|
||||
|
||||
// Mira 子應用 layout
|
||||
// SDD: polaris/mira/.agents/specs/mira-app/design.md §5.5
|
||||
// 規範:白名單 user 進得去;非白名單 user 看到「即將開放」頁
|
||||
// middleware 已做未登入跳 /login?redirect=/mira 檢查(不在這裡重做)
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import SiteNav from '../components/SiteNav';
|
||||
import { MATRIX_APPS } from '../components/apps';
|
||||
|
||||
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev';
|
||||
|
||||
type Me = { email: string; display_name: string; api_key: string };
|
||||
|
||||
const MIRA = MATRIX_APPS.find(a => a.id === 'mira');
|
||||
const ALLOWED = new Set(MIRA?.allowlist_emails ?? []);
|
||||
|
||||
export default function MiraLayout({ children }: { children: React.ReactNode }) {
|
||||
const [me, setMe] = useState<Me | null | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
fetch(`${API_BASE}/me`, { credentials: 'include' })
|
||||
.then(r => r.ok ? r.json() as Promise<Me> : null)
|
||||
.then(u => setMe(u))
|
||||
.catch(() => setMe(null));
|
||||
}, []);
|
||||
|
||||
if (me === undefined) {
|
||||
return (
|
||||
<>
|
||||
<SiteNav currentPath="/mira" />
|
||||
<div className="flex-1 flex items-center justify-center text-[#666]">載入中…</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (me === null) {
|
||||
// 理論上 middleware 已擋住,但保險
|
||||
if (typeof window !== 'undefined') {
|
||||
window.location.href = '/login?redirect=/mira';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!ALLOWED.has(me.email)) {
|
||||
return (
|
||||
<>
|
||||
<SiteNav currentPath="/mira" />
|
||||
<BetaBlocked email={me.email} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SiteNav currentPath="/mira" />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function BetaBlocked({ email }: { email: string }) {
|
||||
return (
|
||||
<main className="flex-1 flex items-center justify-center px-6">
|
||||
<div className="max-w-md text-center space-y-4">
|
||||
<div className="text-6xl mb-2">🌊</div>
|
||||
<h1 className="text-3xl font-bold text-white">Mira 仍封測中</h1>
|
||||
<p className="text-[#888] leading-relaxed">
|
||||
Mira 是 arcrun 的個人化 KM 河道,目前僅開放給少數測試用戶。
|
||||
</p>
|
||||
<p className="text-sm text-[#555]">
|
||||
你登入的帳號是 <span className="font-mono text-[#888]">{email}</span>,
|
||||
不在白名單內。準備好對外開放時會公告。
|
||||
</p>
|
||||
<div className="pt-4">
|
||||
<a
|
||||
href="/dashboard"
|
||||
className="inline-block bg-indigo-600 hover:bg-indigo-500 text-white px-5 py-2 rounded-md text-sm font-medium transition-colors"
|
||||
>
|
||||
回 Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user