@litfamily/litcodex 1.0.21 → 1.0.23
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/README-Ko-KR.md +9 -9
- package/README.md +9 -9
- package/dist/install/doctor-render.js +5 -0
- package/dist/install/doctor.js +9 -0
- package/dist/install/types.d.ts +4 -0
- package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
- package/marketplace/plugins/litcodex/.mcp.json +9 -1
- package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
- package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
- package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.d.ts +1 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.js +313 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-mcp.d.ts +14 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-mcp.js +141 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-server.d.ts +2 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-server.js +38 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.d.ts +43 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +363 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/cli.js +5 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.d.ts +14 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +76 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.d.ts +59 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.js +287 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.d.ts +30 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.js +113 -45
- package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
- package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
- package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
- package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
- package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
- package/marketplace/plugins/litcodex/hooks/hooks.json +20 -0
- package/node_modules/@litcodex/lit-loop/dist/card-html.d.ts +1 -0
- package/node_modules/@litcodex/lit-loop/dist/card-html.js +313 -0
- package/node_modules/@litcodex/lit-loop/dist/card-mcp.d.ts +14 -0
- package/node_modules/@litcodex/lit-loop/dist/card-mcp.js +141 -0
- package/node_modules/@litcodex/lit-loop/dist/card-server.d.ts +2 -0
- package/node_modules/@litcodex/lit-loop/dist/card-server.js +38 -0
- package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +43 -0
- package/node_modules/@litcodex/lit-loop/dist/card-status.js +363 -0
- package/node_modules/@litcodex/lit-loop/dist/cli.js +5 -1
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.d.ts +14 -0
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +76 -2
- package/node_modules/@litcodex/lit-loop/dist/live-step.d.ts +59 -0
- package/node_modules/@litcodex/lit-loop/dist/live-step.js +287 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.d.ts +30 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.js +113 -45
- package/node_modules/@litcodex/lit-loop/package.json +1 -1
- package/package.json +2 -2
- package/readme-assets/badge-version.svg +1 -1
package/README-Ko-KR.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/cover-motion.webp" width="100%" alt="LitFamily 모션 커버: 다섯 로봇 패널이 차례로 켜지고, LitCodex 로봇의 눈과 테두리가 빛난 뒤 LITFAMILY와 KEEP THE WORK LIT. 문구가 밝아지는 영상" /></picture></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="#설치"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
5
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
4
|
+
<a href="#설치"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/badge-version.svg" alt="1.0.23" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/badge-license.svg" alt="MIT license" /></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage-Ko-KR.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
9
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage-Ko-KR.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-book-open.svg" width="16" alt="" /> 문서</a> <a href="#설치">설치</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/assets/readme/ignition-film.mp4"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-play.svg" width="16" alt="" /> Ignition</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
@@ -23,12 +23,12 @@ Codex CLI 플러그인입니다.
|
|
|
23
23
|
Node.js 22 이상과 Codex CLI가 필요합니다.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
26
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex install
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
설치기는 어떤 모델이 이끌지, 어떤 모델이 거들지, 답변 스타일은 무엇으로 할지 묻고, 쓰려는 내용을 먼저 보여 준 뒤
|
|
30
30
|
`~/.codex/config.toml`에서 자기가 관리하는 항목만 고칩니다. 계획만 먼저 보려면
|
|
31
|
-
`npm exec --yes --package @litfamily/litcodex@1.0.
|
|
31
|
+
`npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex --dry-run install`을 실행하고, 묻는 단계 없이
|
|
32
32
|
설치하려면 `install` 뒤에 `--yes`를 붙이세요.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
@@ -39,7 +39,7 @@ litcodex install
|
|
|
39
39
|
전역으로 설치하면 영상 스킬이 쓸 도구를 미리 준비하느라 버전이 고정된 파일 몇 개를 내려받습니다. 무엇을 받는지와
|
|
40
40
|
건너뛰는 방법은 [설치 안내](https://github.com/wjgoarxiv/litcodex/blob/main/docs/install-Ko-KR.md#전역-명령으로-쓰기)에 있습니다.
|
|
41
41
|
|
|
42
|
-
> 전역 설치가 없다면 `npm exec --yes --package @litfamily/litcodex@1.0.
|
|
42
|
+
> 전역 설치가 없다면 `npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex <command>` 형식을 사용하세요.
|
|
43
43
|
|
|
44
44
|
## 첫 작업
|
|
45
45
|
|
|
@@ -91,7 +91,7 @@ lit 회원가입 폼에 입력 검증을 추가해줘
|
|
|
91
91
|
## 확인, 문제 해결, 제거
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
94
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex doctor
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
`litcodex doctor`는 등록·훅·설정·호스트 기능을, `litcodex loop doctor`는 현재 프로젝트의 루프 상태를 확인합니다.
|
|
@@ -99,7 +99,7 @@ npm exec --yes --package @litfamily/litcodex@1.0.21 -- litcodex doctor
|
|
|
99
99
|
[문제 해결](https://github.com/wjgoarxiv/litcodex/blob/main/README-Ko-KR.md#문제-해결)에 있습니다.
|
|
100
100
|
|
|
101
101
|
```sh
|
|
102
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
102
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex uninstall
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
플러그인과 LitCodex가 관리하는 설정을 지우고, 관련 없는 설정은 그대로 둡니다.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/cover-motion.webp" width="100%" alt="LitFamily motion cover: five armored robots power on one by one, the LitCodex robot wakes with glowing eyes and a lit frame, then LITFAMILY and KEEP THE WORK LIT. light up." /></picture></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="#install"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
5
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
4
|
+
<a href="#install"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/badge-version.svg" alt="1.0.23" /></a>
|
|
5
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/badge-license.svg" alt="MIT license" /></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.
|
|
9
|
+
<a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/usage.md"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-book-open.svg" width="16" alt="" /> Docs</a> <a href="#install">Install</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/docs/assets/readme/ignition-film.mp4"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-play.svg" width="16" alt="" /> Ignition</a> <a href="https://github.com/wjgoarxiv/litcodex/blob/main/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litcodex@1.0.23/readme-assets/lucide-shield-check.svg" width="16" alt="" /> MIT</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
# LitCodex
|
|
@@ -23,12 +23,12 @@ and hands unfinished work to the next session.
|
|
|
23
23
|
You need Node.js 22 or later and Codex CLI.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
26
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex install
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
The installer asks which model leads, which model helps and which output style you like, shows what it is
|
|
30
30
|
about to write, and changes only the keys it manages in `~/.codex/config.toml`. To see the plan first, run
|
|
31
|
-
`npm exec --yes --package @litfamily/litcodex@1.0.
|
|
31
|
+
`npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex --dry-run install`. To skip the
|
|
32
32
|
questions, add `--yes` after `install`.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
@@ -40,7 +40,7 @@ A global install also gets the video skill's tools ready with a few pinned downl
|
|
|
40
40
|
[install guide](https://github.com/wjgoarxiv/litcodex/blob/main/docs/install.md#a-global-command) lists them
|
|
41
41
|
and shows how to skip them.
|
|
42
42
|
|
|
43
|
-
> Without a global install, use `npm exec --yes --package @litfamily/litcodex@1.0.
|
|
43
|
+
> Without a global install, use `npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex <command>`.
|
|
44
44
|
|
|
45
45
|
## First task
|
|
46
46
|
|
|
@@ -96,7 +96,7 @@ Pick any skill in the Codex skill picker or mention it by scoped name, such as `
|
|
|
96
96
|
## Check, fix, remove
|
|
97
97
|
|
|
98
98
|
```sh
|
|
99
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
99
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex doctor
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
`litcodex doctor` checks registration, hooks, config and host capabilities; `litcodex loop doctor` checks
|
|
@@ -104,7 +104,7 @@ the current project's loop state. If `lit` does nothing, run doctor and check th
|
|
|
104
104
|
in Codex. More fixes are under [troubleshooting](https://github.com/wjgoarxiv/litcodex#troubleshooting).
|
|
105
105
|
|
|
106
106
|
```sh
|
|
107
|
-
npm exec --yes --package @litfamily/litcodex@1.0.
|
|
107
|
+
npm exec --yes --package @litfamily/litcodex@1.0.23 -- litcodex uninstall
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
This removes the plugin and the config LitCodex manages, and leaves your other settings alone.
|
|
@@ -29,6 +29,11 @@ export function renderDoctorText(report) {
|
|
|
29
29
|
]),
|
|
30
30
|
...(report.jevSkillHint === undefined ? [] : [` Jev skill hint: ${report.jevSkillHint}`]),
|
|
31
31
|
...(report.autoHandoff === undefined ? [] : [` automatic handoff: ${autoHandoffLine(report.autoHandoff)}`]),
|
|
32
|
+
...(report.statusCard === undefined
|
|
33
|
+
? []
|
|
34
|
+
: [
|
|
35
|
+
` card: Codex desktop app only; needs the app's MCP Apps feature${report.statusCard.serverInstalled ? "" : " (server missing)"}`,
|
|
36
|
+
]),
|
|
32
37
|
` concurrency: ${capabilityText(report.capabilities.concurrency)}`,
|
|
33
38
|
` probe-only explicit context/auto-compaction override: ${capabilityText(report.capabilities.autoCompaction)}`,
|
|
34
39
|
];
|
package/dist/install/doctor.js
CHANGED
|
@@ -21,6 +21,8 @@ import { canonicalMarketplacePath, LITCODEX_MARKETPLACE, managedMarketplaceRoot
|
|
|
21
21
|
import { probeSkillCatalogPayload } from "./skill-catalog.js";
|
|
22
22
|
export { renderDoctorText } from "./doctor-render.js";
|
|
23
23
|
const PACKAGE_VERSION = createRequire(import.meta.url)("../../package.json").version;
|
|
24
|
+
/** The LIT card MCP server inside the installed plugin; only the Codex desktop app draws the card. */
|
|
25
|
+
const CARD_SERVER_RELPATH = join("components", "lit-loop", "dist", "card-server.js");
|
|
24
26
|
const MAX_DIAGNOSTIC_FAMILIES = 2;
|
|
25
27
|
const MAX_DIAGNOSTIC_PATHS = 2;
|
|
26
28
|
const MAX_DIAGNOSTIC_PATH_LENGTH = 120;
|
|
@@ -154,6 +156,12 @@ export function runDoctor(deps) {
|
|
|
154
156
|
else if (authMode === "unknown") {
|
|
155
157
|
warnings.push("Codex auth mode could not be determined (auth.json absent or unrecognized). ChatGPT-subscription accounts may fail with the public gpt-5.6 alias; run `litcodex install` after authenticating.");
|
|
156
158
|
}
|
|
159
|
+
const statusCard = {
|
|
160
|
+
serverInstalled: deps.fs.existsSync(join(managedRoot, "plugins", "litcodex", CARD_SERVER_RELPATH)),
|
|
161
|
+
};
|
|
162
|
+
if (pluginInstalled && !statusCard.serverInstalled) {
|
|
163
|
+
warnings.push("LIT card server is missing from the installed plugin. Run `litcodex install`.");
|
|
164
|
+
}
|
|
157
165
|
const autoUpdate = readAutoUpdateReport(deps.env);
|
|
158
166
|
if (autoUpdate.status === "unknown-state") {
|
|
159
167
|
issues.push(`Foreground auto-update rollback failed; installation state is unknown. Inspect ${autoUpdate.receiptPath} and reinstall the exact stable package.`);
|
|
@@ -177,6 +185,7 @@ export function runDoctor(deps) {
|
|
|
177
185
|
jevSkillHint: jevSkillHintState(deps.env),
|
|
178
186
|
autoHandoff: autoHandoffWithWarnings(deps, codexHome, warnings),
|
|
179
187
|
tuiSuggestion: inspectTuiSuggestion(deps.fs, join(codexHome, "config.toml")),
|
|
188
|
+
statusCard,
|
|
180
189
|
issues,
|
|
181
190
|
warnings,
|
|
182
191
|
};
|
package/dist/install/types.d.ts
CHANGED
|
@@ -95,6 +95,10 @@ export interface DoctorReport {
|
|
|
95
95
|
readonly autoHandoff?: AutoHandoffDoctorReport;
|
|
96
96
|
/** Built-in Codex status line / terminal title snippet; null when the config already sets both. */
|
|
97
97
|
readonly tuiSuggestion?: TuiSuggestion | null;
|
|
98
|
+
/** The LIT card MCP server: present in the installed plugin or not. Read-only; never touches `[features]`. */
|
|
99
|
+
readonly statusCard?: {
|
|
100
|
+
readonly serverInstalled: boolean;
|
|
101
|
+
};
|
|
98
102
|
}
|
|
99
103
|
export type TuiSuggestionKey = "status_line" | "terminal_title";
|
|
100
104
|
export interface TuiSuggestion {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CARD_HTML = "<!doctype html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n<title>LIT</title>\n<style>\n:root{color-scheme:dark;--bg:#10141c;--bg2:#0d1118;--ink:#e6edf3;--dim:#7d8590;--faint:#30363d;--rail:#3a434e;--flame:#ff6337;--pink:#ff2d95;--acc:#5fd7ff;--accfill:#5fd7ff;--green:#6bdb8f;--amber:#ffaf3c;--red:#ff5f5f;--pillink:#0b0f14;\n--mono:\"SF Mono\",SFMono-Regular,ui-monospace,Menlo,Monaco,Consolas,\"Liberation Mono\",monospace}\n:root.light{color-scheme:light;--bg:#ffffff;--bg2:#fafbfd;--ink:#1b1f27;--dim:#69717e;--faint:#dde2e8;--rail:#cfd6de;--flame:#e2521f;--pink:#d81b78;--acc:#0a87b8;--green:#1f9d55;--amber:#b86e00;--red:#d93a3a}\n*{box-sizing:border-box}\nhtml,body{margin:0;background:transparent}\nbody{color:var(--ink);font-size:12.5px;line-height:1.55;font-weight:500;-webkit-font-smoothing:antialiased}\n.lc,.lc *{font-family:var(--mono)!important}\n.lc{position:relative;border-radius:14px;padding:11px 14px 10px;margin:1px;\nbackground:radial-gradient(110% 120% at 0% 0%,color-mix(in srgb,var(--pink) 8%,transparent),transparent 55%),radial-gradient(80% 110% at 100% 0%,color-mix(in srgb,var(--acc) 6%,transparent),transparent 60%),linear-gradient(180deg,var(--bg),var(--bg2));\nborder:1px solid color-mix(in srgb,var(--acc) 55%,transparent);box-shadow:0 0 0 1px color-mix(in srgb,var(--acc) 8%,transparent),0 10px 30px -18px color-mix(in srgb,var(--acc) 50%,transparent);animation:breathe 4.8s ease-in-out infinite}\n.lc.is-done{border-color:color-mix(in srgb,var(--green) 55%,transparent);box-shadow:0 0 0 1px color-mix(in srgb,var(--green) 8%,transparent);animation:none}\n.lc.is-idle{border-color:color-mix(in srgb,var(--dim) 40%,transparent);box-shadow:none;animation:none}\n@keyframes breathe{0%,100%{border-color:color-mix(in srgb,var(--acc) 38%,transparent)}50%{border-color:color-mix(in srgb,var(--acc) 80%,transparent)}}\n.head{display:flex;align-items:center;gap:7px;white-space:nowrap;min-height:22px}\n.brand{position:relative;overflow:hidden;display:inline-flex;align-items:center;gap:3px;padding:1px 9px 1px 7px;border-radius:999px;background:linear-gradient(90deg,#ff2d95,#ff6337);color:#0b0f14;font-weight:800;letter-spacing:.03em;box-shadow:0 0 16px -6px rgba(255,45,149,.6)}\n.j{color:var(--faint)}\n.name{font-weight:700;overflow:hidden;text-overflow:ellipsis}.acc{color:var(--acc)}.dim{color:var(--dim)}.ok{color:var(--green)}\n.right{margin-left:auto;font-weight:700;letter-spacing:.04em;display:inline-flex;align-items:center;gap:6px}\n.dot{width:6px;height:6px;border-radius:50%;background:var(--acc);box-shadow:0 0 7px var(--acc);animation:pulse 1.6s ease-in-out infinite}\n@keyframes pulse{50%{opacity:.35}}\n.map{display:flex;align-items:center;gap:7px;margin:9px 0 6px;white-space:nowrap;overflow:hidden}\n.st em{font-style:normal;margin-left:3px}.st.todo{color:var(--dim)}.st.done{font-weight:600}\n.rail{position:relative;display:inline-block;height:2px;border-radius:2px;flex:1 1 12px;max-width:56px;min-width:10px;background:var(--rail)}\n.rail.lead{overflow:hidden}.headfill{position:absolute;inset:0;width:40%;background:linear-gradient(90deg,var(--acc),transparent)}\n.comet{position:absolute;top:50%;width:5px;height:5px;margin-top:-2.5px;border-radius:50%;background:#fff;box-shadow:0 0 7px 2px var(--acc);animation:comet 2.4s linear infinite}\n:root.light .comet{background:var(--accfill);box-shadow:0 0 5px 1px var(--accfill)}\n@keyframes comet{0%{left:-8%;opacity:0}15%,85%{opacity:1}100%{left:100%;opacity:0}}\n.nowpill{position:relative;overflow:hidden;display:inline-flex;gap:6px;align-items:center;padding:0 9px;border-radius:999px;background:var(--accfill);color:var(--pillink);font-weight:800;box-shadow:0 0 14px -4px color-mix(in srgb,var(--accfill) 80%,transparent)}\n.sweep{position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.7) 50%,transparent 70%);transform:translateX(-120%);animation:sweep 3.2s ease-in-out infinite;pointer-events:none}\n@keyframes sweep{0%,55%{transform:translateX(-120%)}85%,100%{transform:translateX(120%)}}\n.is-done .sweep,.is-idle .sweep{display:none}\n.row{display:flex;align-items:center;gap:8px;white-space:nowrap;min-height:20px}\n.tl{display:inline-flex;align-items:center;gap:6px;overflow:hidden;min-width:0}\n.nx{overflow:hidden;text-overflow:ellipsis}\n.bar{display:inline-flex;gap:2px;vertical-align:middle}.seg{display:inline-block;width:6px;height:10px;border-radius:1.5px}.seg.off{background:var(--faint)}\n.live{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto}.row .tl+.live{margin-left:auto}\n.live .tool{font-weight:700}.live .last{font-weight:600;overflow:hidden;text-overflow:ellipsis}.live.done{color:var(--green);font-weight:700}\n.spin{color:var(--acc);animation:spin 1s linear infinite;flex:0 0 auto}@keyframes spin{to{transform:rotate(360deg)}}\n.spin.soft{color:var(--dim)}\nkbd{font-size:12px;color:var(--acc);background:color-mix(in srgb,var(--acc) 12%,transparent);border:1px solid color-mix(in srgb,var(--acc) 32%,transparent);border-radius:6px;padding:0 6px}\n.foot{display:flex;align-items:center;gap:12px;margin-top:7px;padding-top:7px;border-top:1px solid color-mix(in srgb,var(--faint) 75%,transparent);font-size:11.5px;color:var(--dim);white-space:nowrap;overflow:hidden}\n.use{display:inline-flex;align-items:center;gap:5px}.use b{font-weight:600;color:var(--ink)}\n.mini{display:inline-flex;gap:1.5px}.mini i{display:inline-block;width:4px;height:8px;border-radius:1px;background:var(--faint)}\n.ws{margin-left:auto;overflow:hidden;text-overflow:ellipsis}\n/* the side pane (the host's fullscreen mode): a vertical timeline, the use bars at the bottom */\n:root.pane .lc{min-height:calc(100vh - 2px);display:flex;flex-direction:column;padding:18px 20px 16px;font-size:13px}\n:root.pane .brand{font-size:13.5px;padding:2px 11px 2px 9px}:root.pane .name{font-size:13.5px}\n.tline{margin:18px 0 6px}\n.stg{position:relative;padding:0 0 12px 24px}\n.stg::before{content:\"\";position:absolute;left:4px;top:0;bottom:0;width:2px;background:var(--line,var(--rail))}\n.stg:first-child::before{top:9px}.stg:last-child::before{bottom:auto;height:9px}.stg:last-child{padding-bottom:0}\n.stg .pt{position:absolute;left:0;top:4px;width:10px;height:10px;border-radius:50%;border:2px solid var(--rail);background:var(--bg)}\n.stg.done .pt{border-color:var(--c);background:var(--c)}\n.stg.cur .pt{border-color:var(--acc);background:var(--bg);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent),0 0 10px var(--acc)}\n.stg .line1{display:flex;align-items:center;gap:8px;min-height:18px}\n.stg .w{font-weight:600}.stg.todo .w{color:var(--dim);font-weight:500}\n.stg .meta{margin-left:auto;color:var(--dim);font-size:12px}\n.detail{margin-top:8px;padding:8px 11px;border-radius:10px;border:1px solid color-mix(in srgb,var(--faint) 85%,transparent);background:color-mix(in srgb,var(--bg2) 60%,transparent);display:flex;flex-direction:column;gap:3px}\n.banner{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:7px 11px;border-radius:10px;color:var(--green);font-weight:700;background:color-mix(in srgb,var(--green) 11%,transparent);border:1px solid color-mix(in srgb,var(--green) 32%,transparent)}\n.banner .dim{font-weight:500}\n.usage{margin-top:auto;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--faint) 75%,transparent);display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--dim)}\n.ub{display:grid;grid-template-columns:3.2em 1fr 3.4em;align-items:center;gap:10px}.ub .pct{text-align:right;color:var(--ink);font-weight:600}\n.track{height:5px;border-radius:3px;background:var(--faint);overflow:hidden}.track i{display:block;height:100%;border-radius:3px}\n.hero{text-align:center;padding:36px 0 10px}.flame{font-size:40px;filter:drop-shadow(0 0 16px rgba(255,99,55,.45))}\n.herot{font-weight:700;font-size:15px;margin-top:8px}.heros{color:var(--dim);margin:6px 0 14px}\n.examples{display:flex;flex-direction:column;align-items:center;gap:6px}\n@media (prefers-reduced-motion:reduce){.lc,.lc *{animation:none!important}.sweep,.comet{display:none}}\n</style></head>\n<body><div id=\"card\" class=\"lc is-idle\" role=\"status\" aria-live=\"polite\"><div class=\"head\"><span class=\"brand\">\uD83D\uDD25 LIT</span><span class=\"j\">\u00B7</span><span class=\"name dim\">starting\u2026</span></div></div>\n<script>\n(function(){\nvar STATUS_TOOL=\"lit_card_status\";\nvar FAST=1500,SLOW=5000,IDLE=15000,MAX_BACKOFF=30000;\nvar root=document.documentElement,card=document.getElementById(\"card\");\nvar status=null,thread=null,timer=null,ticker=null,failures=0,idleSince=Date.now(),bridge=null,hostMode=null;\nvar nextId=1,pending={};\n\nfunction el(tag,cls,text){var n=document.createElement(tag);if(cls)n.className=cls;if(text!=null)n.textContent=String(text);return n;}\nfunction add(parent){for(var i=1;i<arguments.length;i++){var c=arguments[i];if(c!=null)parent.appendChild(typeof c===\"string\"?document.createTextNode(c):c);}return parent;}\nfunction joiner(){return el(\"span\",\"j\",\"\u00B7\");}\n\n/* linear-RGB mixing, so the flame \u2192 pink \u2192 accent ramp keeps its brightness */\nfunction hex(c){c=c.trim().replace(\"#\",\"\");return[0,2,4].map(function(i){return parseInt(c.substr(i,2),16)/255;});}\nfunction lin(v){return v<=0.04045?v/12.92:Math.pow((v+0.055)/1.055,2.4);}\nfunction gam(v){return v<=0.0031308?v*12.92:1.055*Math.pow(v,1/2.4)-0.055;}\nfunction mix(a,b,t){var x=hex(a),y=hex(b);return\"#\"+x.map(function(v,i){var m=gam(lin(v)+(lin(y[i])-lin(v))*t);return(\"0\"+Math.round(Math.max(0,Math.min(1,m))*255).toString(16)).slice(-2);}).join(\"\");}\nfunction token(name){return getComputedStyle(root).getPropertyValue(name)||\"#ffffff\";}\nfunction ramp(t){var f=token(\"--flame\"),p=token(\"--pink\"),a=token(\"--acc\");return t<=0.5?mix(f,p,t*2):mix(p,a,(t-0.5)*2);}\n\nfunction clock(ms){var s=Math.max(0,Math.floor(ms/1000));return Math.floor(s/60)+\":\"+(\"0\"+(s%60)).slice(-2);}\nfunction span(ms){var s=Math.max(1,Math.round(ms/1000));if(s<60)return s+\"s\";var m=Math.floor(s/60);if(m<60)return s%60?m+\"m \"+(s%60)+\"s\":m+\"m\";return Math.floor(m/60)+\"h \"+(m%60)+\"m\";}\nfunction since(t){var n=el(\"span\",\"dim el\",\"\u00B7 \"+clock(Date.now()-t));n.setAttribute(\"data-since\",String(t));return n;}\nfunction pane(){var m=(window.openai&&window.openai.displayMode)||hostMode;return m===\"fullscreen\"||m===\"pip\";}\n\nfunction bar(done,total){\n var cells=Math.min(total,10),filled=total===0?0:Math.round(done/total*cells);\n if(done>0&&filled===0)filled=1;if(done<total&&filled===cells)filled=cells-1;\n var b=el(\"span\",\"bar\");\n for(var i=0;i<cells;i++){var s=el(\"i\",\"seg\"+(i<filled?\"\":\" off\"));if(i<filled)s.style.background=mix(token(\"--pink\"),token(\"--acc\"),cells<=1?0:i/(cells-1));b.appendChild(s);}\n return b;\n}\nfunction useColor(p){return p>=90?token(\"--red\"):p>=70?token(\"--amber\"):null;}\nfunction mini(p){var b=el(\"span\",\"mini\"),on=Math.round(p/10),warn=useColor(p);for(var i=0;i<10;i++){var c=el(\"i\");if(i<on)c.style.background=warn||mix(token(\"--pink\"),token(\"--acc\"),i/9);b.appendChild(c);}return b;}\nfunction spinner(soft){\n var ns=\"http://www.w3.org/2000/svg\",svg=document.createElementNS(ns,\"svg\");\n svg.setAttribute(\"class\",\"spin\"+(soft?\" soft\":\"\"));svg.setAttribute(\"viewBox\",\"0 0 16 16\");svg.setAttribute(\"width\",\"12\");svg.setAttribute(\"height\",\"12\");svg.setAttribute(\"aria-hidden\",\"true\");\n var c=document.createElementNS(ns,\"circle\");\n [[\"cx\",\"8\"],[\"cy\",\"8\"],[\"r\",\"5.6\"],[\"fill\",\"none\"],[\"stroke\",\"currentColor\"],[\"stroke-width\",\"2.2\"],[\"stroke-dasharray\",\"24 11.2\"],[\"stroke-linecap\",\"round\"]].forEach(function(a){c.setAttribute(a[0],a[1]);});\n svg.appendChild(c);return svg;\n}\nfunction currentCell(map){if(!map)return null;for(var i=0;i<map.cells.length;i++)if(map.cells[i].state===\"current\")return map.cells[i];return null;}\nfunction progressOf(map){if(!map)return null;for(var i=0;i<map.cells.length;i++)if(map.cells[i].progress)return map.cells[i].progress;return null;}\nfunction doneWord(s){return progressOf(s.map)?\"COMPLETE\":\"DONE\";}\nfunction took(s){if(s.turnEndedAt)return s.turnEndedAt-(s.turnStartedAt||s.ignitedAt||s.turnEndedAt);return (s.lastStepAt||s.now)-s.ignitedAt;}\n\n/* what LIT is doing now: the running tool, the turn's own time, or that it waits */\nfunction liveNode(s){\n var n=el(\"span\",\"live\");\n if(s.step){add(n,spinner(false),el(\"span\",\"tool\",s.step.tool),since(s.step.startedAt));return n;}\n if(s.state===\"complete\"){n.className=\"live done\";add(n,\"\u2713 \",el(\"span\",null,doneWord(s)===\"DONE\"?\"turn done\":\"all done\"));if(s.ignitedAt)add(n,el(\"span\",\"dim\",\"in \"+span(took(s))));return n;}\n if(s.state===\"ignited\"&&s.working){add(n,spinner(true),el(\"span\",\"dim\",\"thinking\"));if(s.turnStartedAt)n.appendChild(since(s.turnStartedAt));if(s.lastTool)add(n,el(\"span\",\"dim\",\"\u00B7 last\"),el(\"span\",\"acc\",\"\u25B8\"),el(\"span\",\"last\",s.lastTool));return n;}\n if(s.state===\"ignited\"){add(n,el(\"span\",\"dim\",\"\u25E6 waiting for you\"));return n;}\n return null;\n}\nfunction head(s){\n var h=el(\"div\",\"head\"),b=el(\"span\",\"brand\");add(b,el(\"span\",\"sweep\"),\"\uD83D\uDD25 LIT\");add(h,b,joiner());\n if(s.state===\"ready\"){add(h,el(\"span\",\"name dim\",\"ready\"),el(\"span\",\"right dim\",\"idle\"));return h;}\n add(h,el(\"span\",\"name acc\",s.mode||\"lit\"));\n if(s.state===\"complete\"){add(h,el(\"span\",\"right ok\",doneWord(s)+\" \u2713\"));return h;}\n var cur=currentCell(s.map),r=el(\"span\",\"right acc\",cur?(cur.label||cur.word.toUpperCase()):\"IGNITED\");if(s.working)r.appendChild(el(\"i\",\"dot\"));add(h,r);return h;\n}\nfunction pillExtra(c){var l=(c.label||\"\").toLowerCase(),w=c.word.toLowerCase();if(!l||l===w)return\"\";return l.indexOf(w+\" \")===0?l.slice(w.length+1):l;}\nfunction stageWord(c){var w=c.word;if(c.state===\"done\"&&c.label)w+=\" \"+c.label;else if(c.progress&&c.state!==\"current\")w+=\" \"+c.progress.done+\"/\"+c.progress.total;return w;}\nfunction mapRow(s){\n var m=el(\"div\",\"map\"),cells=s.map.cells,n=cells.length,lastColor=null;\n cells.forEach(function(c,i){\n var color=ramp(n<=1?0:i/(n-1)),cur=c.state===\"current\"&&s.state!==\"complete\";\n if(i>0){\n var r=el(\"span\",\"rail\");\n if((c.state===\"done\"||c.state===\"partial\")&&cells[i-1].state!==\"pending\")r.style.background=\"linear-gradient(90deg,\"+(lastColor||color)+\",\"+color+\")\";\n else if(cur){r.style.background=\"linear-gradient(90deg,\"+(lastColor||token(\"--acc\"))+\",\"+token(\"--acc\")+\")\";r.appendChild(el(\"i\",\"comet\"));}\n else if(cells[i-1].state===\"current\"&&s.state!==\"complete\"){r.className=\"rail lead\";r.appendChild(el(\"i\",\"headfill\"));}\n m.appendChild(r);\n }\n if(cur){\n var p=el(\"span\",\"st nowpill\");add(p,el(\"span\",\"sweep\"),c.word);var extra=pillExtra(c);if(extra)add(p,el(\"b\",null,extra));if(c.progress)add(p,el(\"b\",null,c.progress.done+\"/\"+c.progress.total));m.appendChild(p);lastColor=token(\"--acc\");\n }else if(c.state===\"pending\"){var t=el(\"span\",\"st todo\",c.word);t.appendChild(el(\"em\",null,\"\u00B7\"));m.appendChild(t);}\n else{var d=el(\"span\",\"st done\",stageWord(c));d.style.color=color;d.appendChild(el(\"em\",null,c.state===\"partial\"?\"\u2026\":\"\u2713\"));m.appendChild(d);lastColor=color;}\n });\n return m;\n}\n/* the task line: progress and next on the left, the live step on the right; just the live step otherwise */\nfunction taskRow(s){\n var row=el(\"div\",\"row\"),prog=progressOf(s.map),next=s.map&&s.map.next;\n if(prog||next){\n var left=el(\"span\",\"tl\");add(left,el(\"span\",\"dim\",\"\u2514\"));\n if(prog)add(left,el(\"span\",\"dim\",\"task\"),el(\"b\",null,prog.done+\"/\"+prog.total),bar(prog.done,prog.total));\n if(next){if(prog)left.appendChild(joiner());add(left,el(\"span\",\"dim\",\"next\"),el(\"span\",\"acc\",\"\u25B8\"),el(\"span\",\"nx\",next));}\n add(row,left,liveNode(s));return row;\n }\n add(row,el(\"span\",\"dim\",\"\u2514\"),liveNode(s));return row;\n}\nfunction useItems(s){\n var u=s.usage||{},items=[];\n [[\"ctx\",u.ctx],[\"5h\",u.fiveHour],[\"1w\",u.week]].forEach(function(x){if(typeof x[1]===\"number\")items.push(x);});\n return items;\n}\nfunction foot(s){\n var f=el(\"div\",\"foot\");\n useItems(s).forEach(function(x){var u=el(\"span\",\"use\");add(u,x[0],mini(x[1]),el(\"b\",null,x[1]+\"%\"));var w=useColor(x[1]);if(w)u.lastChild.style.color=w;f.appendChild(u);});\n if(s.branch){var g=el(\"span\",\"use\");add(g,\"git\",el(\"b\",null,s.branch));f.appendChild(g);}\n if(s.workspace)f.appendChild(el(\"span\",\"ws\",s.workspace));\n return f.childNodes.length?f:null;\n}\nfunction timeline(s){\n var t=el(\"div\",\"tline\"),cells=s.map.cells,n=cells.length;\n cells.forEach(function(c,i){\n var color=ramp(n<=1?0:i/(n-1)),cur=c.state===\"current\"&&s.state!==\"complete\",todo=c.state===\"pending\";\n var g=el(\"div\",\"stg \"+(cur?\"cur\":todo?\"todo\":\"done\"));g.style.setProperty(\"--c\",color);\n var nextCell=cells[i+1];if(!todo&&!cur&&nextCell&&nextCell.state!==\"pending\")g.style.setProperty(\"--line\",color);\n var l1=el(\"div\",\"line1\"),w;\n if(cur){w=el(\"span\",\"st nowpill\");add(w,el(\"span\",\"sweep\"),c.label||c.word.toUpperCase());}\n else{w=el(\"span\",\"w\",c.word);if(!todo)w.style.color=color;}\n var meta=el(\"span\",\"meta\");if(c.progress)meta.textContent=c.progress.done+\"/\"+c.progress.total;else if(!todo&&!cur)meta.textContent=c.label?c.label+\" \u2713\":\"\u2713\";\n add(l1,w,meta);add(g,el(\"span\",\"pt\"),l1);\n if(cur){\n var d=el(\"div\",\"detail\"),prog=c.progress;\n if(prog){var r1=el(\"div\",\"row\");add(r1,el(\"span\",\"dim\",\"tasks\"),el(\"b\",null,prog.done+\"/\"+prog.total),bar(prog.done,prog.total));d.appendChild(r1);}\n if(s.map.next){var r2=el(\"div\",\"row\");add(r2,el(\"span\",\"dim\",\"next\"),el(\"span\",\"acc\",\"\u25B8\"),el(\"span\",\"nx\",s.map.next));d.appendChild(r2);}\n var r3=el(\"div\",\"row\"),live=liveNode(s);if(live){r3.appendChild(live);d.appendChild(r3);}\n g.appendChild(d);\n }\n t.appendChild(g);\n });\n return t;\n}\nfunction usageBlock(s){\n var items=useItems(s);if(!items.length&&!s.branch&&!s.workspace)return null;\n var u=el(\"div\",\"usage\");\n items.forEach(function(x){var r=el(\"div\",\"ub\"),tr=el(\"span\",\"track\"),fill=el(\"i\"),w=useColor(x[1]);fill.style.width=x[1]+\"%\";fill.style.background=w||\"linear-gradient(90deg,\"+token(\"--pink\")+\",\"+token(\"--acc\")+\")\";tr.appendChild(fill);var pct=el(\"span\",\"pct\",x[1]+\"%\");if(w)pct.style.color=w;add(r,el(\"span\",null,x[0]),tr,pct);u.appendChild(r);});\n var g=el(\"div\",\"row\");if(s.branch)add(g,\"git\",el(\"b\",null,s.branch));if(s.workspace){if(s.branch)g.appendChild(joiner());g.appendChild(el(\"span\",null,s.workspace));}\n if(g.childNodes.length)u.appendChild(g);\n return u;\n}\nfunction renderInline(s){\n card.appendChild(head(s));\n if(s.state===\"ready\"){var hint=el(\"div\",\"row\");add(hint,el(\"span\",\"dim\",\"no LIT skill yet\"),joiner(),el(\"span\",\"dim\",\"type\"),el(\"kbd\",null,\"lit <task>\"),el(\"span\",\"dim\",\"to start one\"));hint.style.marginTop=\"6px\";card.appendChild(hint);return;}\n if(s.map)card.appendChild(mapRow(s));else card.appendChild(el(\"div\",\"map\"));\n card.appendChild(taskRow(s));\n var f=foot(s);if(f){card.appendChild(f);var ws=f.querySelector(\".ws\");if(ws&&ws.scrollWidth>ws.clientWidth+1)f.removeChild(ws);}\n}\nfunction renderPane(s){\n card.appendChild(head(s));\n if(s.state===\"ready\"){\n var hero=el(\"div\",\"hero\"),hs=el(\"div\",\"heros\");add(hs,\"type \",el(\"kbd\",null,\"lit <task>\"),\" in this thread to start one\");\n var ex=el(\"div\",\"examples\");[\"lit add a --shout flag\",\"lit plan the release note\",\"lit-loop fix the parser\"].forEach(function(t){ex.appendChild(el(\"kbd\",null,t));});\n add(hero,el(\"div\",\"flame\",\"\uD83D\uDD25\"),el(\"div\",\"herot\",\"no LIT skill yet\"),hs,ex);card.appendChild(hero);\n }else{\n if(s.state===\"complete\"){var prog=progressOf(s.map),bn=el(\"div\",\"banner\",doneWord(s)+\" \u2713\");if(prog)add(bn,el(\"span\",\"dim\",prog.done+\"/\"+prog.total+\" tasks\"));if(s.ignitedAt)add(bn,el(\"span\",\"dim\",\"\u00B7 \"+span(took(s))));card.appendChild(bn);}\n if(s.map)card.appendChild(timeline(s));else{var r=el(\"div\",\"row\");r.style.marginTop=\"14px\";add(r,liveNode(s));card.appendChild(r);}\n }\n var u=usageBlock(s);if(u)card.appendChild(u);\n}\nfunction render(){\n var s=status;if(!s)return;\n var p=pane();root.classList.toggle(\"pane\",p);\n card.className=\"lc\"+(s.state===\"complete\"?\" is-done\":s.state===\"ready\"?\" is-idle\":\"\");\n card.textContent=\"\";\n if(p)renderPane(s);else renderInline(s);\n reportSize();\n}\nfunction tick(){\n if(ticker){clearInterval(ticker);ticker=null;}\n if(document.hidden||!card.querySelector(\"[data-since]\"))return;\n ticker=setInterval(function(){var n=card.querySelectorAll(\"[data-since]\");for(var i=0;i<n.length;i++)n[i].textContent=\"\u00B7 \"+clock(Date.now()-Number(n[i].getAttribute(\"data-since\")));},1000);\n}\nfunction accept(s){\n if(!s||s.version!==1)return;\n status=s;if(s.thread)thread=s.thread;\n if(s.working)idleSince=Date.now();\n render();tick();\n}\n\n/* host bridge: window.openai when present, else MCP Apps JSON-RPC over postMessage */\nfunction rpc(method,params){return new Promise(function(resolve,reject){var id=nextId++;pending[id]={resolve:resolve,reject:reject};window.parent.postMessage({jsonrpc:\"2.0\",id:id,method:method,params:params},\"*\");setTimeout(function(){if(pending[id]){delete pending[id];reject(new Error(method+\" timed out\"));}},5000);});}\nwindow.addEventListener(\"message\",function(ev){\n var m=ev.data;if(ev.source!==window.parent||!m||m.jsonrpc!==\"2.0\")return;\n if(m.id!=null&&pending[m.id]){var p=pending[m.id];delete pending[m.id];if(m.error)p.reject(m.error);else p.resolve(m.result);return;}\n if(m.method===\"ui/notifications/tool-result\"&&m.params)accept(m.params.structuredContent);\n if(m.method===\"ui/notifications/host-context-changed\"&&m.params){if(m.params.displayMode)hostMode=m.params.displayMode;applyTheme(m.params.theme||null);}\n});\nwindow.addEventListener(\"openai:set_globals\",function(){if(window.openai){applyTheme(window.openai.theme);if(window.openai.toolOutput&&!status)accept(window.openai.toolOutput);else render();}});\nfunction callStatus(){\n var args=thread?{thread_id:thread}:{};\n if(bridge===\"openai\")return window.openai.callTool(STATUS_TOOL,args).then(function(r){return r&&(r.structuredContent||r.result&&r.result.structuredContent);});\n return rpc(\"tools/call\",{name:STATUS_TOOL,arguments:args}).then(function(r){return r&&r.structuredContent;});\n}\nvar lastHeight=0;\nfunction reportSize(){\n if(pane())return;\n var h=Math.ceil(card.getBoundingClientRect().height)+2;if(h===lastHeight)return;lastHeight=h;\n if(bridge===\"openai\"&&typeof window.openai.notifyIntrinsicHeight===\"function\"){try{window.openai.notifyIntrinsicHeight(h);}catch(e){}}\n else if(bridge===\"mcp\")window.parent.postMessage({jsonrpc:\"2.0\",method:\"ui/notifications/size-changed\",params:{height:h}},\"*\");\n}\nfunction applyTheme(theme){\n var dark=theme?theme===\"dark\":!(window.matchMedia&&window.matchMedia(\"(prefers-color-scheme: light)\").matches);\n root.classList.toggle(\"light\",!dark);if(status)render();\n}\n\nfunction delay(){\n if(failures>0)return Math.min(MAX_BACKOFF,FAST*Math.pow(2,failures));\n if(status&&status.working)return FAST;\n return Date.now()-idleSince>120000?IDLE:SLOW;\n}\nfunction schedule(){if(timer)clearTimeout(timer);timer=null;if(!document.hidden)timer=setTimeout(poll,delay());}\nfunction poll(){\n callStatus().then(function(s){failures=0;accept(s);},function(){failures=Math.min(failures+1,5);}).then(schedule);\n}\ndocument.addEventListener(\"visibilitychange\",function(){if(document.hidden){if(timer)clearTimeout(timer);timer=null;tick();}else{idleSince=Date.now();tick();poll();}});\nwindow.addEventListener(\"resize\",function(){if(status)render();});\n\nfunction start(){\n if(window.openai&&typeof window.openai.callTool===\"function\"){\n bridge=\"openai\";applyTheme(window.openai.theme);if(window.openai.toolOutput)accept(window.openai.toolOutput);poll();return;\n }\n bridge=\"mcp\";applyTheme(null);\n rpc(\"ui/initialize\",{protocolVersion:\"2026-01-26\",appInfo:{name:\"lit-card\",version:\"1\"},appCapabilities:{availableDisplayModes:[\"inline\",\"fullscreen\"]}}).then(function(r){\n window.parent.postMessage({jsonrpc:\"2.0\",method:\"ui/notifications/initialized\",params:{}},\"*\");\n var ctx=r&&r.hostContext;if(ctx&&ctx.displayMode)hostMode=ctx.displayMode;applyTheme(ctx&&ctx.theme||null);poll();\n },function(){poll();});\n}\nif(window.matchMedia)window.matchMedia(\"(prefers-color-scheme: light)\").addEventListener(\"change\",function(){if(!(window.openai&&window.openai.theme))applyTheme(null);});\nstart();\n})();\n</script></body></html>\n";
|