@saluzi/saluzi-edu 0.2.63 → 0.2.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +176 -176
- package/dist/guide/assets/main-Bx1xb7yl.css +1 -0
- package/dist/guide/assets/main-CdOE18lg.js +277 -0
- package/dist/guide/guide-data.json +27 -5
- package/dist/guide/index.html +2 -2
- package/dist/rcs-schema.sql +2 -1
- package/package.json +1 -1
- package/packages/remote-control-server/src/__tests__/attach-code.test.ts +195 -0
- package/packages/remote-control-server/src/__tests__/attach-wait.test.ts +270 -0
- package/packages/remote-control-server/src/__tests__/attach.test.ts +580 -0
- package/packages/remote-control-server/src/auth/bridge-auth.ts +120 -0
- package/packages/remote-control-server/src/db/rcs-schema.sql +2 -1
- package/packages/remote-control-server/src/db/sqlite.ts +1 -0
- package/packages/remote-control-server/src/routes/v1/environments.ts +97 -73
- package/packages/remote-control-server/src/routes/v1/sessions.ts +592 -4
- package/packages/remote-control-server/src/routes/web/sessions.ts +67 -0
- package/packages/remote-control-server/src/services/environment.ts +27 -0
- package/packages/remote-control-server/src/store.ts +123 -2
- package/packages/remote-control-server/src/types/api.ts +2 -0
- package/dist/guide/assets/main-CSpz9pKf.css +0 -1
- package/dist/guide/assets/main-C_ykjDzn.js +0 -167
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { config } from '../config'
|
|
2
|
+
import { log } from '../logger'
|
|
2
3
|
import {
|
|
3
4
|
storeCreateEnvironment,
|
|
4
5
|
storeCreateSession,
|
|
@@ -14,7 +15,10 @@ import {
|
|
|
14
15
|
storeClaimEnvironment,
|
|
15
16
|
storeSetEnvironmentClaim,
|
|
16
17
|
storeBindEnvSessionsToUser,
|
|
18
|
+
storeListWorkItems,
|
|
19
|
+
storeUpdateWorkItem,
|
|
17
20
|
} from '../store'
|
|
21
|
+
import { isSessionClosedStatus } from './session'
|
|
18
22
|
import type {
|
|
19
23
|
RegisterEnvironmentRequest,
|
|
20
24
|
EnvironmentResponse,
|
|
@@ -42,6 +46,11 @@ function toResponse(
|
|
|
42
46
|
team_id: row.teamId ?? null,
|
|
43
47
|
team_name: row.teamName ?? null,
|
|
44
48
|
owner_user_id: row.ownerUserId ?? null,
|
|
49
|
+
attach_waiting:
|
|
50
|
+
row.sessionMode === 'attach' &&
|
|
51
|
+
!storeListSessionsByEnvironment(row.id).some(
|
|
52
|
+
s => !isSessionClosedStatus(s.status),
|
|
53
|
+
),
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
|
|
@@ -64,10 +73,13 @@ export function registerEnvironment(
|
|
|
64
73
|
teamId?: string | null
|
|
65
74
|
claimToken?: string | null
|
|
66
75
|
claimExpiresAt?: Date | null
|
|
76
|
+
session_mode?: string | null
|
|
67
77
|
},
|
|
68
78
|
): RegisterEnvironmentResult {
|
|
69
79
|
const secret = config.apiKeys[0] || ''
|
|
70
80
|
const workerType = req.worker_type || req.metadata?.worker_type
|
|
81
|
+
// Session Attach wait mode: only 'attach' is meaningful today.
|
|
82
|
+
const sessionMode = req.session_mode === 'attach' ? 'attach' : null
|
|
71
83
|
|
|
72
84
|
// Idempotent re-registration: the CLI echoes back a backend-issued
|
|
73
85
|
// environment_id on restart (bridge pointer / --session-id resume).
|
|
@@ -85,6 +97,7 @@ export function registerEnvironment(
|
|
|
85
97
|
machineName: req.machine_name,
|
|
86
98
|
maxSessions: req.max_sessions,
|
|
87
99
|
capabilities: req.capabilities ?? null,
|
|
100
|
+
sessionMode,
|
|
88
101
|
})
|
|
89
102
|
// Ownership is backfill-only: a restart must not reassign the env
|
|
90
103
|
// (the route layer already gated reattach on admin/owner/unowned).
|
|
@@ -201,6 +214,7 @@ export function registerEnvironment(
|
|
|
201
214
|
ownerUserId: req.ownerUserId,
|
|
202
215
|
claimToken: req.claimToken,
|
|
203
216
|
claimExpiresAt: req.claimExpiresAt,
|
|
217
|
+
sessionMode,
|
|
204
218
|
})
|
|
205
219
|
|
|
206
220
|
let sessionId: string | undefined
|
|
@@ -240,6 +254,19 @@ export function registerEnvironment(
|
|
|
240
254
|
|
|
241
255
|
export function deregisterEnvironment(envId: string) {
|
|
242
256
|
storeUpdateEnvironment(envId, { status: 'deregistered' })
|
|
257
|
+
// Complete the env's open work items. Without this, a clean CLI exit
|
|
258
|
+
// leaves the acked item behind and isSessionOccupied keeps reporting
|
|
259
|
+
// session_busy (the reclaim path only covers dispatched items on a LIVE
|
|
260
|
+
// env). kill -9 crashes skip this — the env-status check in
|
|
261
|
+
// isSessionOccupied is the recovery path for those.
|
|
262
|
+
for (const item of storeListWorkItems()) {
|
|
263
|
+
if (item.environmentId === envId && item.state !== 'completed') {
|
|
264
|
+
storeUpdateWorkItem(item.id, { state: 'completed' })
|
|
265
|
+
log(
|
|
266
|
+
`[RCS] Completed orphaned work item ${item.id} (session=${item.sessionId}) on deregistered env ${envId}`,
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
243
270
|
}
|
|
244
271
|
|
|
245
272
|
export function getEnvironment(envId: string) {
|
|
@@ -24,6 +24,14 @@ export interface EnvironmentRecord {
|
|
|
24
24
|
lastPollAt: Date | null
|
|
25
25
|
createdAt: Date
|
|
26
26
|
updatedAt: Date
|
|
27
|
+
/**
|
|
28
|
+
* Session Attach (P2): 'attach' marks a worker that registered in
|
|
29
|
+
* wait-for-assignment mode — it created no session and is polling for the
|
|
30
|
+
* Web UI to bind one. Surfaced as `attach_waiting` on GET /web/environments
|
|
31
|
+
* so the Web UI can enumerate "waiting CLIs" to bind sessions to. Null =
|
|
32
|
+
* default create-mode behavior.
|
|
33
|
+
*/
|
|
34
|
+
sessionMode?: string | null
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
export interface SessionRecord {
|
|
@@ -119,6 +127,7 @@ export function storeCreateEnvironment(req: {
|
|
|
119
127
|
ownerUserId?: string | null
|
|
120
128
|
claimToken?: string | null
|
|
121
129
|
claimExpiresAt?: Date | null
|
|
130
|
+
sessionMode?: string | null
|
|
122
131
|
}): EnvironmentRecord {
|
|
123
132
|
const id = `env_${randomUUID().replace(/-/g, '')}`
|
|
124
133
|
const now = new Date()
|
|
@@ -138,14 +147,15 @@ export function storeCreateEnvironment(req: {
|
|
|
138
147
|
lastPollAt: now,
|
|
139
148
|
createdAt: now,
|
|
140
149
|
updatedAt: now,
|
|
150
|
+
sessionMode: req.sessionMode ?? null,
|
|
141
151
|
}
|
|
142
152
|
environments.set(id, record)
|
|
143
153
|
try {
|
|
144
154
|
const db = getDb()
|
|
145
155
|
const secretHash = createHash('sha256').update(record.secret).digest('hex')
|
|
146
156
|
db.query(
|
|
147
|
-
`INSERT OR REPLACE INTO environments (id, secret_hash, machine_name, worker_type, status, last_poll_at, created_at, owner_user_id, claim_token, claim_expires_at)
|
|
148
|
-
VALUES ($id, $sh, $mn, $wt, $st, $lp, $ca, $ou, $ct, $ce)`,
|
|
157
|
+
`INSERT OR REPLACE INTO environments (id, secret_hash, machine_name, worker_type, status, last_poll_at, created_at, owner_user_id, claim_token, claim_expires_at, session_mode)
|
|
158
|
+
VALUES ($id, $sh, $mn, $wt, $st, $lp, $ca, $ou, $ct, $ce, $sm)`,
|
|
149
159
|
).run({
|
|
150
160
|
$id: id,
|
|
151
161
|
$sh: secretHash,
|
|
@@ -157,6 +167,7 @@ export function storeCreateEnvironment(req: {
|
|
|
157
167
|
$ou: req.ownerUserId ?? null,
|
|
158
168
|
$ct: req.claimToken ?? null,
|
|
159
169
|
$ce: req.claimExpiresAt?.toISOString() ?? null,
|
|
170
|
+
$sm: record.sessionMode ?? null,
|
|
160
171
|
})
|
|
161
172
|
} catch (err) {
|
|
162
173
|
console.error('[store] DB write failed in storeCreateEnvironment:', err)
|
|
@@ -181,6 +192,7 @@ export function storeUpdateEnvironment(
|
|
|
181
192
|
| 'machineName'
|
|
182
193
|
| 'maxSessions'
|
|
183
194
|
| 'bridgeId'
|
|
195
|
+
| 'sessionMode'
|
|
184
196
|
>
|
|
185
197
|
>,
|
|
186
198
|
): boolean {
|
|
@@ -204,6 +216,10 @@ export function storeUpdateEnvironment(
|
|
|
204
216
|
sets.push('machine_name = $machineName')
|
|
205
217
|
params.$machineName = patch.machineName
|
|
206
218
|
}
|
|
219
|
+
if (patch.sessionMode !== undefined) {
|
|
220
|
+
sets.push('session_mode = $sessionMode')
|
|
221
|
+
params.$sessionMode = patch.sessionMode
|
|
222
|
+
}
|
|
207
223
|
|
|
208
224
|
// bridgeId, maxSessions, capabilities, updatedAt are in-memory only —
|
|
209
225
|
// the environments table has no corresponding columns.
|
|
@@ -561,6 +577,46 @@ export function storeListSessionsByEnvironment(envId: string): SessionRecord[] {
|
|
|
561
577
|
return [...sessions.values()].filter(s => s.environmentId === envId)
|
|
562
578
|
}
|
|
563
579
|
|
|
580
|
+
/**
|
|
581
|
+
* Re-point a session to a different environment (Session Attach).
|
|
582
|
+
*
|
|
583
|
+
* Only mutates environment_id + updated_at — session_owners (user/team) are
|
|
584
|
+
* deliberately untouched: attach transfers *driving* of the session, never
|
|
585
|
+
* ownership. The sessions.environment_id column predates this function;
|
|
586
|
+
* storeUpdateSession's patch type intentionally excludes environment_id
|
|
587
|
+
* because ownership-binding flows must never re-point a session as a side
|
|
588
|
+
* effect. Attach is the one flow with an explicit re-bind contract.
|
|
589
|
+
*
|
|
590
|
+
* environmentId may be null — the rollback path (dispatch failure in
|
|
591
|
+
* performAttach) restores "no environment" when the session had none.
|
|
592
|
+
*/
|
|
593
|
+
export function storeRebindSessionEnvironment(
|
|
594
|
+
sessionId: string,
|
|
595
|
+
environmentId: string | null,
|
|
596
|
+
): boolean {
|
|
597
|
+
const rec = sessions.get(sessionId)
|
|
598
|
+
if (!rec) return false
|
|
599
|
+
rec.environmentId = environmentId
|
|
600
|
+
rec.updatedAt = new Date()
|
|
601
|
+
try {
|
|
602
|
+
const db = getDb()
|
|
603
|
+
db.query(
|
|
604
|
+
'UPDATE sessions SET environment_id = $envId, updated_at = $ua WHERE id = $id',
|
|
605
|
+
).run({
|
|
606
|
+
$envId: environmentId,
|
|
607
|
+
$ua: rec.updatedAt.toISOString(),
|
|
608
|
+
$id: sessionId,
|
|
609
|
+
})
|
|
610
|
+
} catch (err) {
|
|
611
|
+
console.error(
|
|
612
|
+
'[store] DB write failed in storeRebindSessionEnvironment:',
|
|
613
|
+
err,
|
|
614
|
+
)
|
|
615
|
+
throw err
|
|
616
|
+
}
|
|
617
|
+
return true
|
|
618
|
+
}
|
|
619
|
+
|
|
564
620
|
export function storeDeleteSession(id: string): boolean {
|
|
565
621
|
sessionWorkers.delete(id)
|
|
566
622
|
const deleted = sessions.delete(id)
|
|
@@ -941,6 +997,70 @@ export function storeMarkAcpAgentOnline(id: string): boolean {
|
|
|
941
997
|
return true
|
|
942
998
|
}
|
|
943
999
|
|
|
1000
|
+
// ---------- Session Attach codes ----------
|
|
1001
|
+
|
|
1002
|
+
export interface AttachCodeRecord {
|
|
1003
|
+
code: string
|
|
1004
|
+
sessionId: string
|
|
1005
|
+
expiresAt: Date
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
const attachCodes = new Map<string, AttachCodeRecord>()
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Issue a one-time, short-TTL attach code for a session (P3). The Web UI
|
|
1012
|
+
* session manager calls POST /web/sessions/:id/attach-code and hands the
|
|
1013
|
+
* code to a CLI operator (`/rc --attach atc_...`); the code is the attach
|
|
1014
|
+
* authorization — the CLI needs no manage rights of its own.
|
|
1015
|
+
*
|
|
1016
|
+
* In-memory only (no DB table): codes are single-use with a 15-minute TTL,
|
|
1017
|
+
* so losing them on a server restart is acceptable — the user just clicks
|
|
1018
|
+
* "copy attach code" again.
|
|
1019
|
+
*/
|
|
1020
|
+
export function storeIssueAttachCode(
|
|
1021
|
+
sessionId: string,
|
|
1022
|
+
ttlMs = 15 * 60 * 1000,
|
|
1023
|
+
): AttachCodeRecord {
|
|
1024
|
+
// Sweep expired codes: consume() only removes a code when it is actually
|
|
1025
|
+
// presented, so unconsumed expired codes would otherwise accumulate for
|
|
1026
|
+
// the process lifetime. Map deletion during iteration is safe.
|
|
1027
|
+
const now = Date.now()
|
|
1028
|
+
for (const [code, record] of attachCodes) {
|
|
1029
|
+
if (record.expiresAt.getTime() <= now) attachCodes.delete(code)
|
|
1030
|
+
}
|
|
1031
|
+
const code = `atc_${randomUUID().replace(/-/g, '')}`
|
|
1032
|
+
const record: AttachCodeRecord = {
|
|
1033
|
+
code,
|
|
1034
|
+
sessionId,
|
|
1035
|
+
expiresAt: new Date(Date.now() + ttlMs),
|
|
1036
|
+
}
|
|
1037
|
+
attachCodes.set(code, record)
|
|
1038
|
+
return record
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Consume an attach code: single-use — returns the record and deletes it.
|
|
1043
|
+
* Expired or unknown codes return null.
|
|
1044
|
+
*/
|
|
1045
|
+
export function storeConsumeAttachCode(code: string): AttachCodeRecord | null {
|
|
1046
|
+
const record = attachCodes.get(code)
|
|
1047
|
+
if (!record) return null
|
|
1048
|
+
attachCodes.delete(code)
|
|
1049
|
+
if (record.expiresAt.getTime() <= Date.now()) return null
|
|
1050
|
+
return record
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/** Test helper — drop all attach codes. */
|
|
1054
|
+
export function storeResetAttachCodes() {
|
|
1055
|
+
attachCodes.clear()
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/** Test helper — number of attach codes currently held (expired codes that
|
|
1059
|
+
* have not been swept yet still count). */
|
|
1060
|
+
export function storeAttachCodesSize(): number {
|
|
1061
|
+
return attachCodes.size
|
|
1062
|
+
}
|
|
1063
|
+
|
|
944
1064
|
// ---------- Reset (for tests) ----------
|
|
945
1065
|
|
|
946
1066
|
export function storeReset() {
|
|
@@ -950,6 +1070,7 @@ export function storeReset() {
|
|
|
950
1070
|
sessions.clear()
|
|
951
1071
|
workItems.clear()
|
|
952
1072
|
sessionWorkers.clear()
|
|
1073
|
+
storeResetAttachCodes()
|
|
953
1074
|
try {
|
|
954
1075
|
const db = getDb()
|
|
955
1076
|
// Delete in FK-safe order: child tables before parent tables
|
|
@@ -142,6 +142,8 @@ export interface EnvironmentResponse {
|
|
|
142
142
|
team_id: string | null
|
|
143
143
|
team_name: string | null
|
|
144
144
|
owner_user_id: string | null
|
|
145
|
+
/** Session Attach wait mode: registered to be assigned a session, none bound yet. */
|
|
146
|
+
attach_waiting?: boolean
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
export interface ServerInfoResponse {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap";@layer components;@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-content:""}}}@layer theme{:root,:host{--font-sans:"Poppins", system-ui, -apple-system, sans-serif;--font-serif:Georgia, "Times New Roman", serif;--font-mono:"JetBrains Mono", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.625rem;--font-display:"Poppins", sans-serif;--color-surface-3:#d4bfae;--color-text-primary:#372e37;--color-text-secondary:#737373;--color-background:#f0e0d3;--color-foreground:#372e37;--color-card:#e6d2c2;--color-primary:#7d5a8a;--color-primary-foreground:#f0e0d3;--color-secondary:#e6d2c2;--color-secondary-foreground:#372e37;--color-muted:#e6d2c2;--color-muted-foreground:#737373;--color-accent:#7d5a8a;--color-accent-foreground:#f0e0d3;--color-destructive:#4b1535;--color-border:#7d5a8a;--color-border-light:#e6d2c2;--color-ring:#7d5a8a}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html,body{background:var(--color-background);color:var(--color-text-primary);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}*,:before,:after{border-color:var(--color-border)}}@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.mb-12{margin-bottom:calc(var(--spacing) * 12)}.mb-14{margin-bottom:calc(var(--spacing) * 14)}.mb-16{margin-bottom:calc(var(--spacing) * 16)}.mb-20{margin-bottom:calc(var(--spacing) * 20)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-full{width:100%;height:100%}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-16{height:calc(var(--spacing) * 16)}.h-\[46px\]{height:46px}.h-\[calc\(100vh-2rem\)\]{height:calc(100vh - 2rem)}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-\[200px\]{min-height:200px}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[120px\]{min-width:120px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-center{transform-origin:50%}.rotate-\[0\.3deg\]{rotate:.3deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-10{gap:calc(var(--spacing) * 10)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)){border-color:var(--color-border)}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:var(--radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-border{border-color:var(--color-border)}.border-border-light{border-color:var(--color-border-light)}.border-current{border-color:currentColor}.border-destructive{border-color:var(--color-destructive)}.border-muted-foreground\/30{border-color:#7373734d}@supports (color:color-mix(in lab, red, red)){.border-muted-foreground\/30{border-color:color-mix(in oklab, var(--color-muted-foreground) 30%, transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-200{border-color:var(--color-red-200)}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10{border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-\[\#0b0e14\]{background-color:#0b0e14}.bg-\[\#27c93f\]{background-color:#27c93f}.bg-\[\#ff5f56\]{background-color:#ff5f56}.bg-\[\#ffbd2e\]{background-color:#ffbd2e}.bg-accent{background-color:var(--color-accent)}.bg-background{background-color:var(--color-background)}.bg-background\/80{background-color:#f0e0d3cc}@supports (color:color-mix(in lab, red, red)){.bg-background\/80{background-color:color-mix(in oklab, var(--color-background) 80%, transparent)}}.bg-background\/90{background-color:#f0e0d3e6}@supports (color:color-mix(in lab, red, red)){.bg-background\/90{background-color:color-mix(in oklab, var(--color-background) 90%, transparent)}}.bg-background\/95{background-color:#f0e0d3f2}@supports (color:color-mix(in lab, red, red)){.bg-background\/95{background-color:color-mix(in oklab, var(--color-background) 95%, transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\/10{background-color:color-mix(in oklab, var(--color-black) 10%, transparent)}}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-muted{background-color:var(--color-muted)}.bg-muted\/40{background-color:#e6d2c266}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--color-muted) 40%, transparent)}}.bg-muted\/80{background-color:#e6d2c2cc}@supports (color:color-mix(in lab, red, red)){.bg-muted\/80{background-color:color-mix(in oklab, var(--color-muted) 80%, transparent)}}.bg-primary{background-color:var(--color-primary)}.bg-primary\/10{background-color:#7d5a8a1a}@supports (color:color-mix(in lab, red, red)){.bg-primary\/10{background-color:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-secondary{background-color:var(--color-secondary)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/5{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.wrap-anywhere{overflow-wrap:anywhere}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.text-\[\#7dd3fc\]{color:#7dd3fc}.text-\[\#27c93f\]{color:#27c93f}.text-\[\#ffbd2e\]{color:#ffbd2e}.text-accent-foreground{color:var(--color-accent-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-primary\/80{color:#7d5a8acc}@supports (color:color-mix(in lab, red, red)){.text-primary\/80{color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.\[counter-increment\:line_0\]{counter-increment:line 0}.\[counter-reset\:line\]{counter-reset:line}@media (hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.before\:mr-4:before{content:var(--tw-content);margin-right:calc(var(--spacing) * 4)}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:w-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4)}.before\:w-6:before{content:var(--tw-content);width:calc(var(--spacing) * 6)}.before\:text-right:before{content:var(--tw-content);text-align:right}.before\:font-mono:before{content:var(--tw-content);font-family:var(--font-mono)}.before\:text-\[13px\]:before{content:var(--tw-content);font-size:13px}.before\:text-muted-foreground\/50:before{content:var(--tw-content);color:#73737380}@supports (color:color-mix(in lab, red, red)){.before\:text-muted-foreground\/50:before{color:color-mix(in oklab, var(--color-muted-foreground) 50%, transparent)}}.before\:content-\[counter\(line\)\]:before{--tw-content:counter(line);content:var(--tw-content)}.before\:select-none:before{content:var(--tw-content);-webkit-user-select:none;user-select:none}.before\:\[counter-increment\:line\]:before{content:var(--tw-content);counter-increment:line}:is(.\*\:first\:mt-0>*):first-child{margin-top:calc(var(--spacing) * 0)}:is(.\*\:last\:mb-0>*):last-child{margin-bottom:calc(var(--spacing) * 0)}:is(.\*\:last\:after\:inline>*):last-child:after{content:var(--tw-content);display:inline}:is(.\*\:last\:after\:align-baseline>*):last-child:after{content:var(--tw-content);vertical-align:baseline}:is(.\*\:last\:after\:content-\(--streamdown-caret\)>*):last-child:after{--tw-content:var(--streamdown-caret);content:var(--tw-content)}@media (hover:hover){.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-muted\/40:hover{background-color:#e6d2c266}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/40:hover{background-color:color-mix(in oklab, var(--color-muted) 40%, transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.hover\:text-foreground:hover{color:var(--color-foreground)}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,var(--color-ring));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-primary:focus-visible{--tw-ring-color:var(--color-primary)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:px-14{padding-inline:calc(var(--spacing) * 14)}.sm\:px-16{padding-inline:calc(var(--spacing) * 16)}.sm\:py-16{padding-block:calc(var(--spacing) * 16)}.sm\:py-20{padding-block:calc(var(--spacing) * 20)}}@media (width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\:block{display:block}}@media (prefers-color-scheme:dark){.dark\:bg-\(--shiki-dark-bg\)\!{background-color:var(--shiki-dark-bg)!important}.dark\:text-\(--shiki-dark\)\!{color:var(--shiki-dark)!important}}.\[\&_svg\]\:h-auto svg{height:auto}.\[\&_svg\]\:w-auto svg{width:auto}.\[\&\>div\]\:h-full>div{height:100%}.\[\&\>div\]\:overflow-hidden>div{overflow:hidden}.\[\&\>p\]\:inline>p{display:inline}li .\[li_\&\]\:pl-6{padding-left:calc(var(--spacing) * 6)}}.dark{--color-surface-0:#1a1917;--color-surface-1:#222120;--color-surface-2:#2c2a28;--color-surface-3:#3a3835;--color-text-primary:#efeee9;--color-text-secondary:#969088;--color-text-muted:#5e5a54;--color-bg-inverted:#f6f5f2;--color-text-inverted:#2c2a28;--color-border:#3a3835;--color-border-light:#2c2a28;--color-background:#1a1917;--color-foreground:#efeee9;--color-card:#222120;--color-card-foreground:#efeee9;--color-popover:#1a1917;--color-popover-foreground:#efeee9;--color-primary:#7d5a8a;--color-primary-foreground:#efeee9;--color-secondary:#2c2a28;--color-secondary-foreground:#efeee9;--color-muted:#2c2a28;--color-muted-foreground:#969088;--color-accent:#7d5a8a;--color-accent-foreground:#efeee9;--color-destructive:#4b1535;--color-input:#3a3835;--color-ring:#7d5a8a}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-surface-3);border-radius:3px}.chapter-content{font-family:var(--font-sans);color:var(--color-text-primary);font-size:1.0625rem;line-height:1.75}.chapter-content p,.chapter-content ul,.chapter-content ol,.chapter-content blockquote,.chapter-content pre,.chapter-content table,.chapter-content hr,.chapter-content img{margin-top:1.25rem;margin-bottom:1.25rem}.chapter-content>:first-child,.chapter-content>div>:first-child{margin-top:0}.chapter-content>:last-child,.chapter-content>div>:last-child{margin-bottom:0}.chapter-content h1,.chapter-content h2,.chapter-content h3,.chapter-content h4,.chapter-content h5,.chapter-content h6{font-family:var(--font-display);letter-spacing:-.015em;color:var(--color-text-primary);margin-top:2.5rem;margin-bottom:1rem;font-weight:600;line-height:1.3}.chapter-content h1{margin-top:0;font-size:1.875rem}.chapter-content h2{border-bottom:1px solid var(--color-border-light);padding-bottom:.5rem;font-size:1.5rem}.chapter-content h3{font-size:1.25rem}.chapter-content h4{font-size:1.125rem}.chapter-content p{line-height:1.75}.chapter-content a{color:var(--color-primary);border-bottom:1px solid #0000;text-decoration:none;transition:border-color .2s}.chapter-content a:hover{border-bottom-color:var(--color-primary)}.chapter-content strong{color:var(--color-text-primary);font-weight:600}.chapter-content em{font-style:italic}.chapter-content ul,.chapter-content ol{padding-left:1.5rem}.chapter-content ul{list-style:outside}.chapter-content ol{list-style:decimal}.chapter-content li{margin-top:.5rem;margin-bottom:.5rem;line-height:1.7}.chapter-content li::marker{color:var(--color-primary)}.chapter-content blockquote{border-left:3px solid var(--color-primary);color:var(--color-text-secondary);padding:.5rem 0 .5rem 1.25rem;font-style:italic}.chapter-content code{font-family:var(--font-mono);background:var(--color-muted);color:var(--color-primary);border-radius:.375rem;padding:.125rem .375rem;font-size:.875em;font-weight:500}.chapter-content pre{background:var(--color-card);border:1px solid var(--color-border-light);border-radius:.75rem;padding:1.25rem 1.5rem;font-size:.875rem;line-height:1.6;overflow-x:auto}.chapter-content pre code{color:inherit;font-weight:inherit;background:0 0;border-radius:0;padding:0}.chapter-content pre code>span:last-child:empty{display:none}.chapter-content table{border-collapse:collapse;width:100%;font-size:.9375rem}.chapter-content th{text-align:left;font-family:var(--font-display);color:var(--color-text-primary);border-bottom:2px solid var(--color-primary);background:var(--color-muted);padding:.75rem 1rem;font-weight:600}.chapter-content td{border-bottom:1px solid var(--color-border-light);color:var(--color-text-primary);vertical-align:top;padding:.75rem 1rem}.chapter-content tr:hover td{background:var(--color-muted)}.chapter-content hr{border:none;border-top:1px solid var(--color-border-light)}.chapter-content img{border-radius:.625rem;max-width:100%;height:auto}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/streamdown-nMT_aKRc.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/shiki-CMaUdEs0.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as e,l as t,o as n,s as r}from"./streamdown-nMT_aKRc.js";import{t as i}from"./vendor-BU1MXatO.js";import{Ja as a}from"./shiki-CMaUdEs0.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var o=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),u=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},f=t(),p=(0,f.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,f.createElement)(`svg`,{ref:c,...d,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l(`lucide`,i),...!a&&!u(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(a)?a:[a]])),m=(e,t)=>{let n=(0,f.forwardRef)(({className:n,...r},i)=>(0,f.createElement)(p,{ref:i,iconNode:t,className:l(`lucide-${o(c(e))}`,`lucide-${e}`,n),...r}));return n.displayName=c(e),n},h=m(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),g=m(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),_=m(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ee=m(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),v=m(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),y=m(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),b=m(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),x=i();function S(...t){return r(e(t))}var C=n();function w({navigation:e,selected:t,onSelect:n,onHome:r}){return(0,C.jsxs)(`nav`,{className:`flex h-full w-64 flex-col border-r border-border bg-card`,children:[(0,C.jsx)(`div`,{className:`flex h-16 items-center border-b border-border px-4`,children:(0,C.jsxs)(`button`,{type:`button`,onClick:()=>r?.(),title:`返回首页`,className:`block text-left transition-opacity hover:opacity-80`,children:[(0,C.jsx)(`h1`,{className:`font-display text-lg font-bold `+(t===null?`text-primary`:`text-primary/80`),children:`Saluzi Guide`}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`使用指南`})]})}),(0,C.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[(0,C.jsx)(T,{label:`命令宝典`,isActive:t===`__commands__`,onClick:()=>n(`__commands__`)}),(0,C.jsx)(`div`,{className:`my-2 border-t border-border-light`}),e.map(e=>(0,C.jsx)(E,{group:e,selected:t,onSelect:n},e.group))]})]})}function T({label:e,isActive:t,onClick:n}){return(0,C.jsx)(`button`,{type:`button`,onClick:n,className:S(`w-full rounded-md px-3 py-1.5 text-left text-sm transition-colors`,t?`bg-primary text-primary-foreground`:`text-foreground hover:bg-muted`),children:e})}function E({group:e,selected:t,onSelect:n}){let[r,i]=(0,f.useState)(!0);return(0,C.jsxs)(`div`,{className:`mb-1`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex w-full items-center gap-1 px-2 py-1.5 text-left text-xs font-semibold uppercase text-muted-foreground hover:text-foreground`,children:[r?(0,C.jsx)(_,{className:`h-3 w-3`}):(0,C.jsx)(ee,{className:`h-3 w-3`}),e.group]}),r?(0,C.jsx)(`div`,{className:`ml-2 border-l border-border-light pl-2`,children:D(e.pages).map(e=>(0,C.jsx)(T,{label:e.title??e.path??``,isActive:t===e.path,onClick:()=>e.path&&n(e.path)},e.path))}):null]})}function D(e){let t=[];for(let n of e)n.path?t.push({title:n.title??n.path,path:n.path}):n.pages?t.push(...D(n.pages)):n.group&&t.push({title:n.group,path:void 0});return t}var O=`saluzi-guide-theme`;function k(){return typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function A(){return typeof window>`u`?`system`:localStorage.getItem(O)??`system`}function j(e){let t=e===`system`?k():e,n=document.documentElement;n.classList.remove(`light`,`dark`),n.classList.add(t)}function M(){let[e,t]=(0,f.useState)(A);return(0,f.useEffect)(()=>{j(e),e===`system`?localStorage.removeItem(O):localStorage.setItem(O,e)},[e]),(0,f.useEffect)(()=>{if(e!==`system`)return;let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>j(`system`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),{theme:e,setTheme:t,resolved:e===`system`?k():e}}function N(){let{theme:e,setTheme:t}=M();return(0,C.jsx)(`div`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card p-1`,children:[{id:`light`,icon:b,label:`Light`},{id:`dark`,icon:y,label:`Dark`},{id:`system`,icon:v,label:`Auto`}].map(({id:n,icon:r,label:i})=>(0,C.jsx)(`button`,{type:`button`,onClick:()=>t(n),"aria-label":i,"aria-pressed":e===n,className:S(`inline-flex h-7 w-7 items-center justify-center rounded-sm transition-colors`,e===n?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`),children:(0,C.jsx)(r,{className:`h-4 w-4`})},n))})}var P=[{id:`login`,step:1,title:`首次登录`,commands:[`/login`],description:`登录 Saluzi 账户或设置 API Key`,chapterPath:`docs/guide/getting-started`},{id:`model`,step:2,title:`选择与切换模型`,commands:[`/model`,`/effort`,`/mom`],description:`切换 Max/Pro/Std,调节推理深度,使用 MOM 混合模型`,chapterPath:`docs/guide/model-selection`},{id:`conversation`,step:3,title:`对话基础与多轮交互`,commands:[`/compact`,`/resume`,`/rewind`,`/export`],description:`第一次提问、多轮对话、流式输出、对话压缩与导出恢复`,chapterPath:`docs/guide/conversation-basics`},{id:`shortcuts`,step:4,title:`快捷键与模式切换`,commands:[`Shift+Tab`,`Ctrl+C`,`/keybindings`],description:`一键打断、切换计划模式、搜历史输入;不合手还能自定义按键`,chapterPath:`docs/guide/keyboard-shortcuts`},{id:`commit`,step:5,title:`查看与提交代码`,commands:[`/diff`,`/commit`,`/commit-push-pr`],description:`预览改动、提交、推送并创建 PR 一条龙`,chapterPath:`docs/guide/commit-workflow`},{id:`context`,step:6,title:`上下文与项目记忆`,commands:[`/add-dir`,`/memory`,`/compact`],description:`挂载目录、SALUZI.md 项目记忆、个人偏好,让 AI 更懂你的项目`,chapterPath:`docs/guide/context-tips`},{id:`cost`,step:7,title:`查看消耗`,commands:[`/cost`,`/stats`],description:`当前会话花费与历史统计`,chapterPath:`docs/guide/cost-usage`},{id:`troubleshoot`,step:8,title:`排障`,commands:[`/doctor`,`/help`,`/permissions`,`/plan`],description:`诊断安装、查命令、调整权限、规划模式`,chapterPath:`docs/guide/troubleshooting`}];function F({workflow:e,onSelect:t}){return(0,C.jsxs)(`button`,{type:`button`,onClick:()=>e.chapterPath&&t?.(e.chapterPath),className:S(`group flex w-full flex-col gap-2 rounded-xl border border-border bg-card p-5 text-left`,`transition-shadow hover:shadow-md`,!e.chapterPath&&`cursor-default`),disabled:!e.chapterPath,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(`span`,{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground`,children:e.step}),(0,C.jsx)(`h3`,{className:`font-display text-base font-semibold text-foreground`,children:e.title}),e.chapterPath&&(0,C.jsx)(g,{className:`ml-auto h-4 w-4 text-muted-foreground transition-transform group-hover:translate-x-1`})]}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.commands.map(e=>(0,C.jsx)(`code`,{className:`rounded-md border border-border-light bg-background px-2 py-0.5 font-mono text-xs text-foreground`,children:e},e))})]})}function I({command:e,onSelect:t}){let n=e.descriptionZh||e.description||`—`,r=!!e.detail,i=r&&t,a=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(`code`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,e.name]}),e.aliases?.length?(0,C.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`alias: `,e.aliases.map(e=>`/${e}`).join(`, `)]}):null]}),(0,C.jsx)(`p`,{className:`text-sm text-foreground`,children:n}),r?(0,C.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-xs font-medium text-primary`,children:[`查看详情`,(0,C.jsx)(g,{className:`h-3 w-3 transition-transform group-hover:translate-x-0.5`})]}):null]}),o=`group flex w-full flex-col gap-1.5 rounded-lg border border-border bg-card p-4 text-left transition-shadow`+(i?` hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-primary`:``);return i?(0,C.jsx)(`button`,{type:`button`,className:o,onClick:()=>t?.(e.name),children:a}):(0,C.jsx)(`div`,{className:o,children:a})}function L({preview:e}){let t=e.kind===`floating`,n=e.kind===`pane`;return(0,C.jsxs)(`div`,{className:`my-4`,children:[(0,C.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`面板预览 · Panel Preview`}),(0,C.jsxs)(`div`,{className:S(`overflow-hidden rounded-lg border border-border bg-[#0b0e14] shadow-sm`,t&&`rotate-[0.3deg] shadow-md`),children:[n?(0,C.jsxs)(`div`,{className:`flex items-stretch border-b border-white/10 bg-white/5`,children:[(0,C.jsx)(`div`,{className:`w-1.5 shrink-0 bg-primary`}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5`,children:[(0,C.jsx)(`span`,{className:`font-mono text-xs font-semibold text-foreground`,children:e.title}),e.subtitle?(0,C.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:e.subtitle}):null]})]}):(0,C.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-white/10 bg-white/5 px-3 py-1.5`,children:[(0,C.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,C.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ff5f56]`}),(0,C.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#ffbd2e]`}),(0,C.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[#27c93f]`})]}),(0,C.jsx)(`span`,{className:`ml-1 font-mono text-xs font-semibold text-foreground`,children:e.title}),e.subtitle?(0,C.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:e.subtitle}):null]}),(0,C.jsx)(`div`,{className:S(`font-mono text-[13px] leading-relaxed`,`px-4 py-3`),children:e.lines.map((e,t)=>(0,C.jsx)(R,{line:e},t))}),e.footer?(0,C.jsx)(`div`,{className:`border-t border-white/10 bg-white/5 px-3 py-1.5`,children:(0,C.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.footer})}):null]})]})}function R({line:e}){switch(e.type){case`heading`:return(0,C.jsx)(`div`,{className:`mt-2 mb-1 font-bold text-primary`,children:e.text});case`text`:return(0,C.jsx)(`div`,{className:`text-foreground`,children:e.text});case`dim`:return(0,C.jsx)(`div`,{className:`text-muted-foreground`,children:e.text});case`code`:return(0,C.jsx)(`div`,{className:`rounded bg-white/5 px-2 py-0.5 text-[#7dd3fc]`,children:e.text});case`success`:return(0,C.jsx)(`div`,{className:`text-[#27c93f]`,children:e.text});case`warn`:return(0,C.jsx)(`div`,{className:`text-[#ffbd2e]`,children:e.text});case`divider`:return(0,C.jsx)(`div`,{className:`my-1 border-t border-white/10`});case`kv`:return(0,C.jsxs)(`div`,{className:`text-foreground`,children:[(0,C.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),e.value?(0,C.jsx)(`span`,{className:`mx-1 text-muted-foreground`,children:`:`}):null,e.value?(0,C.jsx)(`span`,{className:`text-foreground`,children:e.value}):null]});case`item`:return(0,C.jsxs)(`div`,{className:S(`flex items-center gap-2 rounded px-2 py-0.5`,e.focused?`bg-primary text-primary-foreground`:`text-foreground hover:bg-white/5`),children:[(0,C.jsx)(`span`,{className:e.focused?`text-primary-foreground`:`text-muted-foreground`,children:e.focused?`❯`:` `}),(0,C.jsx)(`span`,{children:e.text})]});default:return null}}function z({title:e,children:t}){return(0,C.jsxs)(`section`,{className:`mb-10`,children:[(0,C.jsx)(`h2`,{className:`mb-3 font-display text-lg font-semibold text-primary`,children:e}),(0,C.jsx)(`div`,{className:`text-sm leading-relaxed text-foreground`,children:t})]})}function B({command:e,onBack:t}){let n=e.detail,r=e.descriptionZh||e.description,i=n?.summary||r||`—`;return(0,C.jsxs)(`div`,{className:`mx-auto max-w-3xl px-10 py-12 sm:px-14 sm:py-16`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:t,className:`mb-8 inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,C.jsx)(h,{className:`h-4 w-4`}),`返回命令宝典`]}),(0,C.jsxs)(`header`,{className:`mb-10 border-b border-border pb-8`,children:[(0,C.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-primary`,children:`Command`}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,C.jsxs)(`code`,{className:`font-mono text-3xl font-bold text-foreground`,children:[`/`,e.name]}),e.aliases?.length?(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.aliases.map(e=>(0,C.jsxs)(`span`,{className:`rounded-full border border-border-light bg-muted px-2.5 py-0.5 font-mono text-xs text-muted-foreground`,children:[`/`,e]},e))}):null]}),(0,C.jsx)(`p`,{className:`mt-4 font-serif text-base leading-relaxed text-muted-foreground`,children:i})]}),n?(0,C.jsxs)(C.Fragment,{children:[n.panelPreview?(0,C.jsx)(L,{preview:n.panelPreview}):null,(0,C.jsx)(z,{title:`使用场景`,children:n.scenario}),(0,C.jsx)(z,{title:`使用方式`,children:n.usage}),n.parameters?.length?(0,C.jsx)(z,{title:`参数说明`,children:(0,C.jsx)(`dl`,{className:`space-y-3`,children:n.parameters.map(e=>(0,C.jsxs)(`div`,{className:`rounded-lg border border-border-light bg-card p-3`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,C.jsx)(`code`,{className:`font-mono text-sm font-semibold text-foreground`,children:e.name}),e.required?(0,C.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary`,children:`必填`}):(0,C.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase text-muted-foreground`,children:`可选`}),e.default?(0,C.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`默认:`,(0,C.jsx)(`code`,{className:`font-mono`,children:e.default})]}):null]}),(0,C.jsx)(`p`,{className:`mt-1.5 text-sm text-foreground`,children:e.description}),e.example?(0,C.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`示例:`,(0,C.jsx)(`code`,{className:`font-mono text-foreground`,children:e.example})]}):null]},e.name))})}):(0,C.jsx)(z,{title:`参数说明`,children:(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:`该命令无参数。`})}),n.examples?.length?(0,C.jsx)(z,{title:`示例`,children:(0,C.jsx)(`ul`,{className:`space-y-3`,children:n.examples.map(e=>(0,C.jsxs)(`li`,{className:`rounded-lg border border-border-light bg-card p-3`,children:[(0,C.jsx)(`code`,{className:`block font-mono text-sm text-primary`,children:e.command}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:e.description})]},e.command))})}):null,n.tips?.length?(0,C.jsx)(z,{title:`小贴士`,children:(0,C.jsx)(`ul`,{className:`space-y-1.5`,children:n.tips.map((e,t)=>(0,C.jsxs)(`li`,{className:`flex gap-2 text-sm text-foreground`,children:[(0,C.jsx)(`span`,{className:`text-primary`,children:`·`}),(0,C.jsx)(`span`,{children:e})]},t))})}):null]}):(0,C.jsx)(z,{title:`使用方式`,children:(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:`该命令暂无详细说明。`})})]})}function V(){return(0,C.jsxs)(`div`,{className:`parade-preview-root`,style:{margin:`24px 0`},children:[(0,C.jsx)(`style`,{children:H}),(0,C.jsxs)(`div`,{className:`pp-window`,children:[(0,C.jsx)(`div`,{className:`pp-cube-stage`,children:(0,C.jsx)(`div`,{className:`pp-cube`})}),(0,C.jsxs)(`div`,{className:`pp-panel`,children:[(0,C.jsxs)(`div`,{className:`pp-counts-row`,children:[(0,C.jsx)(`span`,{className:`pp-running-count`,children:`2`}),(0,C.jsx)(`span`,{className:`pp-counts-sep`,children:`/`}),(0,C.jsxs)(`span`,{className:`pp-waiting-pill`,children:[(0,C.jsx)(`span`,{className:`pp-dot`}),`1`]})]}),(0,C.jsxs)(`div`,{className:`pp-sessions`,children:[(0,C.jsx)(`div`,{className:`pp-session-row`,children:`cli · coding auth module`}),(0,C.jsx)(`div`,{className:`pp-session-row`,children:`cli · review PR #42`}),(0,C.jsx)(`div`,{className:`pp-session-row pp-blocked`,children:`cli · waiting approval`})]}),(0,C.jsx)(`div`,{className:`pp-ws-status`})]})]}),(0,C.jsx)(`div`,{className:`pp-caption`,children:`示意图 · 实际数据来自当前会话`})]})}var H=`
|
|
3
|
-
.parade-preview-root .pp-window {
|
|
4
|
-
width: 100%;
|
|
5
|
-
max-width: 320px;
|
|
6
|
-
aspect-ratio: 220 / 130;
|
|
7
|
-
display: flex;
|
|
8
|
-
border-radius: 10px;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
background: #15121f;
|
|
11
|
-
box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(139, 92, 246, 0.18);
|
|
12
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
13
|
-
color: #e7e3f4;
|
|
14
|
-
user-select: none;
|
|
15
|
-
}
|
|
16
|
-
.parade-preview-root .pp-cube-stage {
|
|
17
|
-
flex: 0 0 43%;
|
|
18
|
-
position: relative;
|
|
19
|
-
background:
|
|
20
|
-
radial-gradient(circle at 50% 45%, rgba(139, 92, 246, 0.35) 0%, transparent 60%),
|
|
21
|
-
linear-gradient(180deg, #1d1830 0%, #15121f 100%);
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
border-right: 1px solid rgba(139, 92, 246, 0.18);
|
|
26
|
-
perspective: 200px;
|
|
27
|
-
}
|
|
28
|
-
.parade-preview-root .pp-cube-stage::after {
|
|
29
|
-
content: '';
|
|
30
|
-
position: absolute;
|
|
31
|
-
inset: 14px;
|
|
32
|
-
border: 1px solid rgba(139, 92, 246, 0.12);
|
|
33
|
-
border-radius: 8px;
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
}
|
|
36
|
-
.parade-preview-root .pp-cube {
|
|
37
|
-
width: 22px;
|
|
38
|
-
height: 22px;
|
|
39
|
-
position: relative;
|
|
40
|
-
transform-style: preserve-3d;
|
|
41
|
-
transform: rotateX(-28deg) rotateY(45deg);
|
|
42
|
-
animation: pp-cube-spin 8s linear infinite;
|
|
43
|
-
background: rgba(139, 92, 246, 0.45);
|
|
44
|
-
border: 1px solid #8B5CF6;
|
|
45
|
-
}
|
|
46
|
-
.parade-preview-root .pp-cube::before,
|
|
47
|
-
.parade-preview-root .pp-cube::after {
|
|
48
|
-
content: '';
|
|
49
|
-
position: absolute;
|
|
50
|
-
inset: 0;
|
|
51
|
-
}
|
|
52
|
-
.parade-preview-root .pp-cube::before {
|
|
53
|
-
transform: rotateY(90deg) translateZ(11px);
|
|
54
|
-
background: rgba(167, 139, 250, 0.55);
|
|
55
|
-
border: 1px solid #a78bfa;
|
|
56
|
-
}
|
|
57
|
-
.parade-preview-root .pp-cube::after {
|
|
58
|
-
transform: rotateX(90deg) translateZ(11px);
|
|
59
|
-
background: rgba(109, 40, 217, 0.4);
|
|
60
|
-
border: 1px solid #6d28d9;
|
|
61
|
-
}
|
|
62
|
-
@keyframes pp-cube-spin {
|
|
63
|
-
from { transform: rotateX(-28deg) rotateY(0deg); }
|
|
64
|
-
to { transform: rotateX(-28deg) rotateY(360deg); }
|
|
65
|
-
}
|
|
66
|
-
@media (prefers-reduced-motion: reduce) {
|
|
67
|
-
.parade-preview-root .pp-cube { animation: none; }
|
|
68
|
-
}
|
|
69
|
-
.parade-preview-root .pp-panel {
|
|
70
|
-
flex: 1;
|
|
71
|
-
padding: 12px 14px 10px;
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
gap: 8px;
|
|
75
|
-
background: linear-gradient(180deg, #1d1830 0%, #15121f 100%);
|
|
76
|
-
position: relative;
|
|
77
|
-
}
|
|
78
|
-
.parade-preview-root .pp-counts-row {
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: baseline;
|
|
81
|
-
gap: 8px;
|
|
82
|
-
}
|
|
83
|
-
.parade-preview-root .pp-running-count {
|
|
84
|
-
font-size: 28px;
|
|
85
|
-
font-weight: 700;
|
|
86
|
-
line-height: 1;
|
|
87
|
-
color: #a78bfa;
|
|
88
|
-
letter-spacing: -0.5px;
|
|
89
|
-
font-variant-numeric: tabular-nums;
|
|
90
|
-
}
|
|
91
|
-
.parade-preview-root .pp-counts-sep {
|
|
92
|
-
font-size: 14px;
|
|
93
|
-
color: #5c5575;
|
|
94
|
-
font-weight: 300;
|
|
95
|
-
}
|
|
96
|
-
.parade-preview-root .pp-waiting-pill {
|
|
97
|
-
display: inline-flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
gap: 4px;
|
|
100
|
-
padding: 2px 7px;
|
|
101
|
-
border-radius: 9px;
|
|
102
|
-
background: rgba(251, 191, 36, 0.12);
|
|
103
|
-
color: #fbbf24;
|
|
104
|
-
font-size: 11px;
|
|
105
|
-
font-weight: 600;
|
|
106
|
-
line-height: 1.3;
|
|
107
|
-
font-variant-numeric: tabular-nums;
|
|
108
|
-
}
|
|
109
|
-
.parade-preview-root .pp-waiting-pill .pp-dot {
|
|
110
|
-
width: 5px;
|
|
111
|
-
height: 5px;
|
|
112
|
-
border-radius: 50%;
|
|
113
|
-
background: #fbbf24;
|
|
114
|
-
box-shadow: 0 0 4px #fbbf24;
|
|
115
|
-
}
|
|
116
|
-
.parade-preview-root .pp-sessions {
|
|
117
|
-
flex: 1;
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
gap: 3px;
|
|
121
|
-
min-height: 0;
|
|
122
|
-
}
|
|
123
|
-
.parade-preview-root .pp-session-row {
|
|
124
|
-
font-size: 10.5px;
|
|
125
|
-
line-height: 1.35;
|
|
126
|
-
color: #9b94b8;
|
|
127
|
-
padding: 2px 0 2px 14px;
|
|
128
|
-
position: relative;
|
|
129
|
-
font-variant-numeric: tabular-nums;
|
|
130
|
-
overflow: hidden;
|
|
131
|
-
text-overflow: ellipsis;
|
|
132
|
-
white-space: nowrap;
|
|
133
|
-
}
|
|
134
|
-
.parade-preview-root .pp-session-row::before {
|
|
135
|
-
content: '';
|
|
136
|
-
position: absolute;
|
|
137
|
-
left: 0;
|
|
138
|
-
top: 50%;
|
|
139
|
-
transform: translateY(-50%);
|
|
140
|
-
width: 4px;
|
|
141
|
-
height: 4px;
|
|
142
|
-
border-radius: 50%;
|
|
143
|
-
background: #8B5CF6;
|
|
144
|
-
}
|
|
145
|
-
.parade-preview-root .pp-session-row.pp-blocked { color: #c9a96a; }
|
|
146
|
-
.parade-preview-root .pp-session-row.pp-blocked::before { background: #fbbf24; }
|
|
147
|
-
.parade-preview-root .pp-ws-status {
|
|
148
|
-
position: absolute;
|
|
149
|
-
bottom: 5px;
|
|
150
|
-
right: 6px;
|
|
151
|
-
width: 6px;
|
|
152
|
-
height: 6px;
|
|
153
|
-
border-radius: 50%;
|
|
154
|
-
background: #4ade80;
|
|
155
|
-
box-shadow: 0 0 4px #4ade80;
|
|
156
|
-
}
|
|
157
|
-
.parade-preview-root .pp-caption {
|
|
158
|
-
margin-top: 8px;
|
|
159
|
-
font-size: 12px;
|
|
160
|
-
color: #9b94b8;
|
|
161
|
-
text-align: center;
|
|
162
|
-
font-style: italic;
|
|
163
|
-
}
|
|
164
|
-
`,U=(0,f.lazy)(async()=>({default:(await a(()=>import(`./streamdown-nMT_aKRc.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))).Streamdown}));function W(e){let t=e.split(`
|
|
165
|
-
`),n=[],r=!1,i=``;for(let e=0;e<t.length;e++){let a=t[e],o=a.trim(),s=/^(`{3}|~{3})/.exec(o);if(s){r?o.startsWith(i.repeat(3))&&(r=!1,i=``):(r=!0,i=s[1][0]),n.push(a);continue}if(r){n.push(a);continue}if(o===``||/^#{1,6} /.test(o)||o.startsWith(`|`)||/^[-*+]\s/.test(o)||/^\d+\.\s/.test(o)||o.startsWith(`>`)||/^(-{3,}|\*{3,}|_{3,})$/.test(o)||o.startsWith("```")){n.push(a);continue}let c=(n[n.length-1]??``).trim();c!==``&&!/^#{1,6} /.test(c)&&!c.startsWith(`|`)&&!/^[-*+]\s/.test(c)&&!/^\d+\.\s/.test(c)&&!c.startsWith(`>`)&&!/^(-{3,}|\*{3,}|_{3,})$/.test(c)&&!c.startsWith("```")&&n.push(``),n.push(a)}return n.join(`
|
|
166
|
-
`)}var G=`::parade-preview::`;function K(e){return e.replace(/[*_`~]/g,``).replace(/[^\p{L}\p{N}\s-]/gu,``).trim().toLowerCase().replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function q(e){let t=e.split(`
|
|
167
|
-
`),n=[],r=!1,i=``;for(let e of t){let t=e.trim(),a=/^(`{3}|~{3})/.exec(t);if(a){r?t.startsWith(i.repeat(3))&&(r=!1,i=``):(r=!0,i=a[1][0]);continue}if(r)continue;let o=/^(#{2,3})\s+(.+?)\s*$/.exec(t);if(!o)continue;let s=o[1].length,c=o[2],l=K(c);l&&n.push({level:s,text:c,slug:l})}let a=new Map;return n.map(e=>{let t=a.get(e.slug)??0;return a.set(e.slug,t+1),t===0?e:{...e,slug:`${e.slug}-${t}`}})}function J(e){let t=[],n=e.split(G);for(let e=0;e<n.length;e++)n[e]&&t.push({kind:`md`,content:W(n[e])}),e<n.length-1&&t.push({kind:`parade-preview`});return t}function Y({chapter:e,path:t,onNavigate:n}){let r=e.frontmatter.title??t,i=(0,f.useRef)(null),a=(0,f.useRef)(null),[o,s]=(0,f.useState)(null),c=(0,f.useMemo)(()=>J(e.content.replace(/^\{\/\*[\s\S]*?\*\/\}\s*\n/gm,``).replace(/^\{\/\*[\s\S]*?\*\/\}/gm,``)),[e.content]),l=(0,f.useMemo)(()=>q(e.content),[e.content]);(0,f.useEffect)(()=>{if(!i.current||l.length===0)return;let e=i.current,t=()=>{e.querySelectorAll(`h2, h3`).forEach((e,t)=>{let n=l[t];n&&(e.id!==n.slug&&(e.id=n.slug),e.style.scrollMarginTop!==`5rem`&&(e.style.scrollMarginTop=`5rem`))})};t();let n=new MutationObserver(()=>t());return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()},[l,c]),(0,f.useEffect)(()=>{if(!i.current)return;let e=i.current.parentElement;for(;e&&getComputedStyle(e).overflowY!==`auto`;)e=e.parentElement;a.current=e},[]),(0,f.useEffect)(()=>{let e=a.current;if(!e||l.length===0)return;let t=()=>{let t=e.scrollTop,n=null;for(let e of l){let r=document.getElementById(e.slug);if(r)if(r.offsetTop-120<=t)n=e;else break}s(n?.slug??null)};return t(),e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[l]);function u(e){if(!n)return null;if(e.startsWith(`docs/`))return e;let r=e.replace(/^(?:\.\.\/|\.\/|\/)+/,``);return r=r.replace(/\.(md|mdx)$/,``),r?`${t.split(`/`).slice(0,-1).join(`/`)}/${r}`:null}function d(e){if(!n)return;let t=e.target.closest(`a`);if(!t)return;let r=t.getAttribute(`href`);if(!r||/^(https?:|mailto:|#)/.test(r))return;let i=u(r);i&&(e.preventDefault(),n(i))}function p(e){let t=document.getElementById(e);if(t){t.scrollIntoView({behavior:`smooth`,block:`start`}),s(e);return}let n=0,r=window.setInterval(()=>{n+=1;let t=document.getElementById(e);t?(window.clearInterval(r),t.scrollIntoView({behavior:`smooth`,block:`start`}),s(e)):n>=20&&window.clearInterval(r)},50)}let m=l.length>=2;return(0,C.jsx)(`div`,{className:`mx-auto max-w-5xl px-6 py-12 sm:px-10 sm:py-16`,children:(0,C.jsxs)(`div`,{className:`flex gap-10`,children:[(0,C.jsxs)(`article`,{ref:i,className:`min-w-0 max-w-2xl flex-1 px-2 sm:px-4`,onClick:d,children:[(0,C.jsxs)(`header`,{className:`mb-12 border-b border-border pb-8`,children:[(0,C.jsx)(`h1`,{className:`font-display text-4xl font-bold leading-tight tracking-tight text-foreground`,children:r}),e.frontmatter.description?(0,C.jsx)(`p`,{className:`mt-4 font-serif text-lg leading-relaxed text-muted-foreground`,children:e.frontmatter.description}):null,e.frontmatter.keywords?.length?(0,C.jsx)(`div`,{className:`mt-6 flex flex-wrap gap-2`,children:e.frontmatter.keywords.map(e=>(0,C.jsx)(`span`,{className:`rounded-full border border-border-light bg-muted px-3 py-1 text-xs font-medium text-muted-foreground`,children:e},e))}):null]}),(0,C.jsx)(`div`,{className:`chapter-content max-w-none`,children:(0,C.jsx)(f.Suspense,{fallback:(0,C.jsx)(`div`,{className:`py-8 text-sm text-muted-foreground`,children:`Loading content…`}),children:c.map((e,t)=>e.kind===`parade-preview`?(0,C.jsx)(V,{},`pp-${t}`):(0,C.jsx)(U,{children:e.content},`md-${t}`))})})]}),m?(0,C.jsx)(`aside`,{className:`sticky top-4 hidden h-[calc(100vh-2rem)] w-56 shrink-0 self-start overflow-y-auto lg:block`,children:(0,C.jsxs)(`nav`,{"aria-label":`章节目录`,children:[(0,C.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`本章目录`}),(0,C.jsx)(`ul`,{className:`space-y-1 border-l border-border-light`,children:l.map(e=>{let t=o===e.slug;return(0,C.jsx)(`li`,{className:e.level===3?`ml-3`:``,children:(0,C.jsx)(`button`,{type:`button`,onClick:()=>p(e.slug),className:`block w-full border-l-2 py-1 pl-3 text-left text-xs leading-relaxed transition-colors `+(t?`border-primary text-primary`:`border-transparent text-muted-foreground hover:text-foreground`),style:{marginLeft:`-1px`},children:e.text})},e.slug)})})]})}):null]})})}var X=null;async function Z(){if(X)return X;let e=await fetch(`./guide-data.json`);if(!e.ok)throw Error(`Failed to load guide-data.json: ${e.status}`);return X=await e.json(),X}function Q(){let e=window.location.hash.replace(/^#\/?/,``);if(!e)return{kind:`home`};if(e===`commands`)return{kind:`commands`};if(e.startsWith(`commands/`)){let t=e.slice(9);return t?{kind:`command`,name:t}:{kind:`commands`}}return{kind:`chapter`,path:e}}function te(e){return e.kind===`home`?`#/`:e.kind===`commands`?`#/commands`:e.kind===`command`?`#/commands/${e.name}`:`#/${e.path}`}function ne(){let[e,t]=(0,f.useState)(null),[n,r]=(0,f.useState)(null),[i,a]=(0,f.useState)(()=>Q()),o=(0,f.useRef)(null),s=(0,f.useRef)(!1);if((0,f.useEffect)(()=>{Z().then(t).catch(e=>r(e.message??String(e)))},[]),(0,f.useEffect)(()=>{let e=()=>a(Q());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,f.useEffect)(()=>{o.current?.scrollTo(0,0)},[i]),n)return(0,C.jsx)(`div`,{className:`flex h-screen items-center justify-center`,children:(0,C.jsxs)(`div`,{className:`max-w-md rounded-xl border border-destructive bg-card p-8 text-center`,children:[(0,C.jsx)(`h1`,{className:`font-display text-xl font-bold text-destructive`,children:`加载失败`}),(0,C.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:n}),(0,C.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`请确认 guide-data.json 已生成(运行 `,(0,C.jsx)(`code`,{children:`npm run build:guide`}),`)。`]})]})});if(!e)return(0,C.jsx)(`div`,{className:`flex h-screen items-center justify-center text-muted-foreground`,children:`Loading guide…`});let c=e=>{window.location.hash!==e&&(window.history.pushState(null,``,e),s.current=!0)},l=e=>{c(te(e)),a(e)},u=e=>{if(e===`__commands__`){l({kind:`commands`});return}l({kind:`chapter`,path:e})},d=e=>{l({kind:`command`,name:e})},p=()=>{l({kind:`commands`})},m=()=>{l({kind:`home`})},h=()=>{s.current&&window.history.length>1?window.history.back():p()},g=i.kind===`chapter`?i.path:i.kind===`commands`||i.kind===`command`?`__commands__`:null;return(0,C.jsxs)(`div`,{className:`flex h-screen w-screen overflow-hidden bg-background text-foreground`,children:[(0,C.jsx)(w,{navigation:e.navigation,selected:g,onSelect:u,onHome:m}),(0,C.jsxs)(`main`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,C.jsx)(`header`,{className:`flex h-16 items-center justify-end border-b border-border bg-background/80 px-8 backdrop-blur-sm`,children:(0,C.jsx)(N,{})}),(0,C.jsx)(`div`,{ref:o,className:`flex-1 overflow-y-auto`,children:i.kind===`home`?(0,C.jsx)(re,{data:e,onSelect:u}):i.kind===`commands`?(0,C.jsx)(ie,{data:e,onSelectCommand:d}):i.kind===`command`?(0,C.jsx)(ae,{data:e,name:i.name,onBack:h}):(0,C.jsx)(oe,{data:e,path:i.path,onSelect:u})})]})]})}function re({data:e,onSelect:t}){return(0,C.jsxs)(`div`,{className:`mx-auto max-w-5xl px-10 py-16 sm:px-16 sm:py-20`,children:[(0,C.jsxs)(`header`,{className:`mb-16`,children:[(0,C.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-primary`,children:`Saluzi Guide`}),(0,C.jsx)(`h1`,{className:`font-display text-5xl font-bold leading-tight tracking-tight text-foreground`,children:`使用指南`}),(0,C.jsx)(`p`,{className:`mt-5 max-w-2xl font-serif text-lg leading-relaxed text-muted-foreground`,children:`Terminal-native agentic coding system · 终端原生的 AI 编程系统。 从新手入门到 Saluzi 特色,按你的节奏探索。`})]}),(0,C.jsxs)(`section`,{className:`mb-20`,children:[(0,C.jsxs)(`div`,{className:`mb-8 flex items-baseline justify-between border-b border-border pb-3`,children:[(0,C.jsx)(`h2`,{className:`font-display text-2xl font-semibold text-foreground`,children:`新手 Top 8 工作流`}),(0,C.jsx)(`span`,{className:`text-xs uppercase tracking-wider text-muted-foreground`,children:`按推荐顺序`})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 gap-5 md:grid-cols-2`,children:P.map(e=>(0,C.jsx)(F,{workflow:e,onSelect:t},e.id))})]}),(0,C.jsxs)(`section`,{children:[(0,C.jsxs)(`div`,{className:`mb-8 flex items-baseline justify-between border-b border-border pb-3`,children:[(0,C.jsx)(`h2`,{className:`font-display text-2xl font-semibold text-foreground`,children:`Saluzi 特色`}),(0,C.jsx)(`span`,{className:`text-xs uppercase tracking-wider text-muted-foreground`,children:`saluzi 独有`})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:e.navigation.find(e=>e.group===`Saluzi 特色`)?.pages.flatMap(e=>e.pages?e.pages:[e]).filter(e=>e.path).map(e=>(0,C.jsxs)(`button`,{type:`button`,onClick:()=>e.path&&t(e.path),className:`group flex items-center justify-between rounded-xl border border-border bg-card p-4 text-left transition-shadow hover:shadow-md`,children:[(0,C.jsx)(`span`,{className:`font-display text-base font-medium text-foreground`,children:e.title??e.path}),(0,C.jsx)(g,{className:`h-4 w-4 text-muted-foreground transition-transform group-hover:translate-x-1`})]},e.path))??null})]})]})}function ie({data:e,onSelectCommand:t}){let n=Object.values(e.commands).filter(e=>e.detail).length;return(0,C.jsxs)(`div`,{className:`mx-auto max-w-4xl px-10 py-16 sm:px-14 sm:py-20`,children:[(0,C.jsxs)(`header`,{className:`mb-14 border-b border-border pb-8`,children:[(0,C.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-primary`,children:`Command Dictionary`}),(0,C.jsx)(`h1`,{className:`font-display text-4xl font-bold tracking-tight text-foreground`,children:`命令宝典`}),(0,C.jsxs)(`p`,{className:`mt-4 font-serif text-base leading-relaxed text-muted-foreground`,children:[`按分类列出所有可用命令(共 `,Object.keys(e.commands).length,` 条,其中 `,n,` `,`条含详解)。点击任意命令卡片查看命令名、简介、使用场景、使用方式与参数说明。`]})]}),e.categories.map(e=>(0,C.jsxs)(`section`,{className:`mb-14`,children:[(0,C.jsx)(`h2`,{className:`mb-6 font-display text-xl font-semibold text-primary`,children:e.titleZh??e.title}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:e.commands.map(e=>(0,C.jsx)(I,{command:e,onSelect:t},e.name))})]},e.id))]})}function ae({data:e,name:t,onBack:n}){let r=e.commands[t];return r?(0,C.jsx)(B,{command:r,onBack:n}):(0,C.jsxs)(`div`,{className:`mx-auto max-w-2xl px-10 py-16`,children:[(0,C.jsx)(`button`,{type:`button`,onClick:n,className:`mb-6 text-sm text-muted-foreground hover:text-foreground`,children:`← 返回命令宝典`}),(0,C.jsx)(`h1`,{className:`font-display text-3xl font-bold text-foreground`,children:`未找到命令`}),(0,C.jsxs)(`p`,{className:`mt-3 font-mono text-sm text-muted-foreground`,children:[`/`,t]}),(0,C.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`该命令可能已移除或重命名。`})]})}function oe({data:e,path:t,onSelect:n}){let r=e.chapters[t];return r?(0,C.jsx)(Y,{chapter:r,path:t,onNavigate:n}):(0,C.jsxs)(`div`,{className:`mx-auto max-w-2xl px-10 py-16`,children:[(0,C.jsx)(`h1`,{className:`font-display text-3xl font-bold text-foreground`,children:`未找到章节`}),(0,C.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:`该章节可能已移除或重命名。`})]})}var $=document.getElementById(`root`);if(!$)throw Error(`root element not found`);(0,x.createRoot)($).render((0,C.jsx)(f.StrictMode,{children:(0,C.jsx)(ne,{})}));
|