@evandu/super-pi-server 0.0.0-stage → 0.1.259
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.md +248 -3
- package/agents/code-auditor.md +64 -0
- package/agents/code-designer.md +64 -0
- package/agents/coder.md +24 -0
- package/agents/critic.md +24 -0
- package/agents/document-organizer.md +48 -0
- package/agents/patcher.md +27 -0
- package/agents/planner.md +30 -0
- package/agents/project-leader.md +28 -0
- package/agents/reviewer.md +27 -0
- package/agents/scout.md +27 -0
- package/agents/solution-designer.md +62 -0
- package/agents/super-pi-documents/index.ts +92 -0
- package/agents/super-pi-feishu/index.ts +88 -0
- package/agents/super-pi-knowledge/index.ts +70 -0
- package/agents/super-pi-managed-model/index.ts +9 -0
- package/agents/super-pi-memory/index.ts +75 -0
- package/agents/super-pi-native-tools/index.ts +1 -0
- package/agents/super-pi-task/core.ts +2262 -0
- package/agents/super-pi-task/index.ts +814 -0
- package/agents/super-pi-task/workflow-schema.ts +34 -0
- package/agents/super-pi-web/index.ts +32 -0
- package/agents/verifier.md +25 -0
- package/assets/fonts/LICENSE +92 -0
- package/assets/fonts/NotoSansSC-Bold.otf +0 -0
- package/assets/fonts/NotoSansSC-Regular.otf +0 -0
- package/assets/knowledge-model/README.md +37 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/config.json +31 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/onnx/model_quantized.onnx +0 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/special_tokens_map.json +7 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/tokenizer.json +21278 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/tokenizer_config.json +15 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/vocab.txt +21128 -0
- package/bin/npm-prefix.d.ts +1 -0
- package/bin/npm-prefix.js +10 -0
- package/bin/super-pi.js +349 -0
- package/dist/client/.super-pi-client-sources.json +82 -0
- package/dist/client/assets/CodeMirrorEditor-mi9rGUce.js +2 -0
- package/dist/client/assets/GitDiffEditor-CpoDDQrA.css +1 -0
- package/dist/client/assets/GitDiffEditor-FQBfGxOY.js +29 -0
- package/dist/client/assets/diff-ChtP43wD.js +1 -0
- package/dist/client/assets/dist-AW5lyI3I.js +1 -0
- package/dist/client/assets/dist-B3-a6uF0.js +7 -0
- package/dist/client/assets/dist-BGxkyh6e.js +1 -0
- package/dist/client/assets/dist-BJxfd7yb.js +11 -0
- package/dist/client/assets/dist-BRVQKlcp.js +1 -0
- package/dist/client/assets/dist-BV64A9Ji.js +1 -0
- package/dist/client/assets/dist-BXAOrsjq.js +1 -0
- package/dist/client/assets/dist-CKF2Jksy.js +1 -0
- package/dist/client/assets/dist-CX_Hm4GS.js +1 -0
- package/dist/client/assets/dist-Cus6_oaF.js +2 -0
- package/dist/client/assets/dist-Cx00EZKR.js +23 -0
- package/dist/client/assets/dist-D71y2EI1.js +1 -0
- package/dist/client/assets/dist-D978o95T.js +5 -0
- package/dist/client/assets/dist-Dc1MBGAG.js +1 -0
- package/dist/client/assets/dist-Dds-qLxY.js +9 -0
- package/dist/client/assets/dist-DeD9copn.js +1 -0
- package/dist/client/assets/dist-DuvGReu-.js +6 -0
- package/dist/client/assets/dist-Dvb0SqcK.js +2 -0
- package/dist/client/assets/dist-J6XWqRpB.js +3 -0
- package/dist/client/assets/dist-QzbOCAU6.js +1 -0
- package/dist/client/assets/dist-moiMRpw_.js +1 -0
- package/dist/client/assets/dist-scBkrwv-.js +2 -0
- package/dist/client/assets/dockerfile-BDePf5PZ.js +1 -0
- package/dist/client/assets/index-Cn7hdrDw.js +350 -0
- package/dist/client/assets/index-UfzqdECL.css +1 -0
- package/dist/client/assets/powershell-D8WpQPaX.js +1 -0
- package/dist/client/assets/properties-C357ku5U.js +1 -0
- package/dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/client/assets/ruby-ChfNwlCY.js +1 -0
- package/dist/client/assets/shell-DwuoZtxw.js +1 -0
- package/dist/client/assets/swift-DKB6_1j6.js +1 -0
- package/dist/client/assets/toml-BPTmHmyx.js +1 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/favicon.svg +10 -0
- package/dist/client/index.html +18 -0
- package/dist/extension.d.ts +15 -0
- package/dist/extension.js +126 -0
- package/dist/server/active-memory.d.ts +247 -0
- package/dist/server/active-memory.js +669 -0
- package/dist/server/agents.d.ts +245 -0
- package/dist/server/agents.js +701 -0
- package/dist/server/application/catalog-service.d.ts +98 -0
- package/dist/server/application/catalog-service.js +245 -0
- package/dist/server/application/conversation-service.d.ts +245 -0
- package/dist/server/application/conversation-service.js +654 -0
- package/dist/server/application/document-service.d.ts +68 -0
- package/dist/server/application/document-service.js +120 -0
- package/dist/server/application/extension-ui-service.d.ts +44 -0
- package/dist/server/application/extension-ui-service.js +135 -0
- package/dist/server/application/feishu-service.d.ts +179 -0
- package/dist/server/application/feishu-service.js +358 -0
- package/dist/server/application/group-chat-service.d.ts +75 -0
- package/dist/server/application/group-chat-service.js +953 -0
- package/dist/server/application/group-execution.d.ts +15 -0
- package/dist/server/application/group-execution.js +77 -0
- package/dist/server/application/project-service.d.ts +464 -0
- package/dist/server/application/project-service.js +2523 -0
- package/dist/server/application/provider-service.d.ts +174 -0
- package/dist/server/application/provider-service.js +510 -0
- package/dist/server/application/run-service.d.ts +547 -0
- package/dist/server/application/run-service.js +2683 -0
- package/dist/server/application/scheduled-task-service.d.ts +184 -0
- package/dist/server/application/scheduled-task-service.js +391 -0
- package/dist/server/application/session-orchestrator-service.d.ts +388 -0
- package/dist/server/application/session-orchestrator-service.js +1146 -0
- package/dist/server/application/session-reminder-service.d.ts +59 -0
- package/dist/server/application/session-reminder-service.js +141 -0
- package/dist/server/application/session-watchdog.d.ts +171 -0
- package/dist/server/application/session-watchdog.js +284 -0
- package/dist/server/application/workspace-service.d.ts +52 -0
- package/dist/server/application/workspace-service.js +186 -0
- package/dist/server/application/worktree-service.d.ts +13 -0
- package/dist/server/application/worktree-service.js +76 -0
- package/dist/server/browser-access.d.ts +34 -0
- package/dist/server/browser-access.js +89 -0
- package/dist/server/capability.d.ts +105 -0
- package/dist/server/capability.js +170 -0
- package/dist/server/command-handler.d.ts +93 -0
- package/dist/server/command-handler.js +540 -0
- package/dist/server/content-search.d.ts +16 -0
- package/dist/server/content-search.js +235 -0
- package/dist/server/conversation-usage.d.ts +22 -0
- package/dist/server/conversation-usage.js +43 -0
- package/dist/server/documents.d.ts +152 -0
- package/dist/server/documents.js +998 -0
- package/dist/server/engineering-learning.d.ts +30 -0
- package/dist/server/engineering-learning.js +106 -0
- package/dist/server/exec-service.d.ts +45 -0
- package/dist/server/exec-service.js +167 -0
- package/dist/server/explicit-file-open.d.ts +34 -0
- package/dist/server/explicit-file-open.js +105 -0
- package/dist/server/failure-text.d.ts +18 -0
- package/dist/server/failure-text.js +44 -0
- package/dist/server/feishu-cli.d.ts +223 -0
- package/dist/server/feishu-cli.js +464 -0
- package/dist/server/file-changes.d.ts +119 -0
- package/dist/server/file-changes.js +280 -0
- package/dist/server/file-diff.d.ts +41 -0
- package/dist/server/file-diff.js +97 -0
- package/dist/server/file-index.d.ts +100 -0
- package/dist/server/file-index.js +296 -0
- package/dist/server/file-name-index.d.ts +160 -0
- package/dist/server/file-name-index.js +411 -0
- package/dist/server/files.d.ts +269 -0
- package/dist/server/files.js +748 -0
- package/dist/server/git.d.ts +245 -0
- package/dist/server/git.js +903 -0
- package/dist/server/http-server.d.ts +45 -0
- package/dist/server/http-server.js +3830 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +485 -0
- package/dist/server/inline-thinking.d.ts +90 -0
- package/dist/server/inline-thinking.js +181 -0
- package/dist/server/json-comments.d.ts +14 -0
- package/dist/server/json-comments.js +71 -0
- package/dist/server/knowledge-embedding-worker.d.ts +1 -0
- package/dist/server/knowledge-embedding-worker.js +27 -0
- package/dist/server/knowledge-vectors.d.ts +150 -0
- package/dist/server/knowledge-vectors.js +385 -0
- package/dist/server/knowledge.d.ts +273 -0
- package/dist/server/knowledge.js +848 -0
- package/dist/server/length-continuation.d.ts +83 -0
- package/dist/server/length-continuation.js +118 -0
- package/dist/server/logging.d.ts +32 -0
- package/dist/server/logging.js +185 -0
- package/dist/server/managed-http-tunnel.d.ts +6 -0
- package/dist/server/managed-http-tunnel.js +85 -0
- package/dist/server/managed-http.d.ts +4 -0
- package/dist/server/managed-http.js +85 -0
- package/dist/server/managed-model-adapter.d.ts +17 -0
- package/dist/server/managed-model-adapter.js +75 -0
- package/dist/server/managed-model-gateway.d.ts +49 -0
- package/dist/server/managed-model-gateway.js +73 -0
- package/dist/server/managed-servers.d.ts +55 -0
- package/dist/server/managed-servers.js +392 -0
- package/dist/server/managed-ssh.d.ts +26 -0
- package/dist/server/managed-ssh.js +73 -0
- package/dist/server/manager-vault.d.ts +11 -0
- package/dist/server/manager-vault.js +67 -0
- package/dist/server/memory-recall.d.ts +25 -0
- package/dist/server/memory-recall.js +45 -0
- package/dist/server/memory.d.ts +67 -0
- package/dist/server/memory.js +216 -0
- package/dist/server/message-media.d.ts +7 -0
- package/dist/server/message-media.js +54 -0
- package/dist/server/model-context-window.d.ts +186 -0
- package/dist/server/model-context-window.js +444 -0
- package/dist/server/model-filter.d.ts +23 -0
- package/dist/server/model-filter.js +48 -0
- package/dist/server/models-store.d.ts +36 -0
- package/dist/server/models-store.js +132 -0
- package/dist/server/native-tool-settings.d.ts +25 -0
- package/dist/server/native-tool-settings.js +41 -0
- package/dist/server/native-tools-extension.d.ts +2 -0
- package/dist/server/native-tools-extension.js +39 -0
- package/dist/server/native-tools-service.d.ts +39 -0
- package/dist/server/native-tools-service.js +240 -0
- package/dist/server/persistence/app-state-repository.d.ts +65 -0
- package/dist/server/persistence/app-state-repository.js +1 -0
- package/dist/server/persistence/json-state-repository.d.ts +14 -0
- package/dist/server/persistence/json-state-repository.js +43 -0
- package/dist/server/persistence/open-state-store.d.ts +3 -0
- package/dist/server/persistence/open-state-store.js +35 -0
- package/dist/server/persistence/rename.d.ts +22 -0
- package/dist/server/persistence/rename.js +44 -0
- package/dist/server/persistence/sqlite-state-repository.d.ts +12 -0
- package/dist/server/persistence/sqlite-state-repository.js +264 -0
- package/dist/server/pi-command.d.ts +94 -0
- package/dist/server/pi-command.js +265 -0
- package/dist/server/pi-native.d.ts +12 -0
- package/dist/server/pi-native.js +16 -0
- package/dist/server/pi-session-events.d.ts +158 -0
- package/dist/server/pi-session-events.js +373 -0
- package/dist/server/pi-session-pool.d.ts +233 -0
- package/dist/server/pi-session-pool.js +382 -0
- package/dist/server/pi-session.d.ts +642 -0
- package/dist/server/pi-session.js +655 -0
- package/dist/server/presentations/schema.d.ts +120 -0
- package/dist/server/presentations/schema.js +128 -0
- package/dist/server/provider-network.d.ts +16 -0
- package/dist/server/provider-network.js +106 -0
- package/dist/server/provider-proxy.d.ts +18 -0
- package/dist/server/provider-proxy.js +200 -0
- package/dist/server/providers.d.ts +333 -0
- package/dist/server/providers.js +989 -0
- package/dist/server/remote-bootstrap.d.ts +17 -0
- package/dist/server/remote-bootstrap.js +119 -0
- package/dist/server/rpc-channel.d.ts +131 -0
- package/dist/server/rpc-channel.js +135 -0
- package/dist/server/runtime.d.ts +1393 -0
- package/dist/server/runtime.js +3286 -0
- package/dist/server/scheduled-tasks.d.ts +101 -0
- package/dist/server/scheduled-tasks.js +138 -0
- package/dist/server/server-context.d.ts +119 -0
- package/dist/server/server-context.js +1 -0
- package/dist/server/session-cwd.d.ts +19 -0
- package/dist/server/session-cwd.js +58 -0
- package/dist/server/session-ledger.d.ts +67 -0
- package/dist/server/session-ledger.js +76 -0
- package/dist/server/session-memory-scope.d.ts +4 -0
- package/dist/server/session-memory-scope.js +30 -0
- package/dist/server/session-repository.d.ts +100 -0
- package/dist/server/session-repository.js +246 -0
- package/dist/server/session-tree-scope.d.ts +125 -0
- package/dist/server/session-tree-scope.js +337 -0
- package/dist/server/skills.d.ts +23 -0
- package/dist/server/skills.js +190 -0
- package/dist/server/store.d.ts +1062 -0
- package/dist/server/store.js +3305 -0
- package/dist/server/subagent-runs.d.ts +185 -0
- package/dist/server/subagent-runs.js +383 -0
- package/dist/server/subagents.d.ts +200 -0
- package/dist/server/subagents.js +619 -0
- package/dist/server/task-tool.d.ts +282 -0
- package/dist/server/task-tool.js +507 -0
- package/dist/server/tavily.d.ts +32 -0
- package/dist/server/tavily.js +136 -0
- package/dist/server/team-context.d.ts +12 -0
- package/dist/server/team-context.js +180 -0
- package/dist/server/terminal.d.ts +163 -0
- package/dist/server/terminal.js +557 -0
- package/dist/server/thinking-level-discovery.d.ts +38 -0
- package/dist/server/thinking-level-discovery.js +183 -0
- package/dist/server/time-zone.d.ts +20 -0
- package/dist/server/time-zone.js +32 -0
- package/dist/server/tool-calls.d.ts +130 -0
- package/dist/server/tool-calls.js +341 -0
- package/dist/server/tool-llm.d.ts +72 -0
- package/dist/server/tool-llm.js +146 -0
- package/dist/server/tool-registry.d.ts +129 -0
- package/dist/server/tool-registry.js +249 -0
- package/dist/server/tool-runner.d.ts +112 -0
- package/dist/server/tool-runner.js +306 -0
- package/dist/server/turn-failure.d.ts +48 -0
- package/dist/server/turn-failure.js +148 -0
- package/dist/server/types.d.ts +2315 -0
- package/dist/server/types.js +11 -0
- package/dist/server/update-status.d.ts +14 -0
- package/dist/server/update-status.js +69 -0
- package/dist/server/update.d.ts +46 -0
- package/dist/server/update.js +104 -0
- package/dist/server/upload.d.ts +35 -0
- package/dist/server/upload.js +177 -0
- package/dist/server/version.d.ts +33 -0
- package/dist/server/version.js +111 -0
- package/dist/server/web.d.ts +27 -0
- package/dist/server/web.js +183 -0
- package/dist/server/workflow-engine.d.ts +47 -0
- package/dist/server/workflow-engine.js +255 -0
- package/dist/server/workflow.d.ts +329 -0
- package/dist/server/workflow.js +469 -0
- package/dist/server/workspace-file-indexes.d.ts +2 -0
- package/dist/server/workspace-file-indexes.js +61 -0
- package/dist/server/workspace-file-operations.d.ts +36 -0
- package/dist/server/workspace-file-operations.js +281 -0
- package/dist/server/workspace-file-response.d.ts +7 -0
- package/dist/server/workspace-file-response.js +79 -0
- package/dist/server/ws-server.d.ts +149 -0
- package/dist/server/ws-server.js +640 -0
- package/dist/shared/agent-order.d.ts +44 -0
- package/dist/shared/agent-order.js +50 -0
- package/dist/shared/archive-decisions.d.ts +44 -0
- package/dist/shared/archive-decisions.js +98 -0
- package/dist/shared/background-task.d.ts +25 -0
- package/dist/shared/background-task.js +183 -0
- package/dist/shared/child-session-lock.d.ts +37 -0
- package/dist/shared/child-session-lock.js +59 -0
- package/dist/shared/content-search.d.ts +22 -0
- package/dist/shared/content-search.js +1 -0
- package/dist/shared/conversation-title.d.ts +4 -0
- package/dist/shared/conversation-title.js +4 -0
- package/dist/shared/file-mentions.d.ts +17 -0
- package/dist/shared/file-mentions.js +91 -0
- package/dist/shared/git-commit.d.ts +11 -0
- package/dist/shared/git-commit.js +1 -0
- package/dist/shared/git-graph.d.ts +42 -0
- package/dist/shared/git-graph.js +30 -0
- package/dist/shared/group-chat.d.ts +132 -0
- package/dist/shared/group-chat.js +6 -0
- package/dist/shared/managed-servers.d.ts +36 -0
- package/dist/shared/managed-servers.js +1 -0
- package/dist/shared/message-media.d.ts +12 -0
- package/dist/shared/message-media.js +27 -0
- package/dist/shared/model-window-label.d.ts +39 -0
- package/dist/shared/model-window-label.js +55 -0
- package/dist/shared/native-tools.d.ts +43 -0
- package/dist/shared/native-tools.js +1 -0
- package/dist/shared/pi-cache-warming.d.ts +9 -0
- package/dist/shared/pi-cache-warming.js +4 -0
- package/dist/shared/project-overview.d.ts +107 -0
- package/dist/shared/project-overview.js +92 -0
- package/dist/shared/project-presentation.d.ts +55 -0
- package/dist/shared/project-presentation.js +111 -0
- package/dist/shared/provider-network.d.ts +30 -0
- package/dist/shared/provider-network.js +1 -0
- package/dist/shared/session-reporting.d.ts +40 -0
- package/dist/shared/session-reporting.js +97 -0
- package/dist/shared/session-search.d.ts +14 -0
- package/dist/shared/session-search.js +1 -0
- package/dist/shared/team-context-view.d.ts +33 -0
- package/dist/shared/team-context-view.js +49 -0
- package/dist/shared/team-context.d.ts +59 -0
- package/dist/shared/team-context.js +3 -0
- package/dist/shared/terminal-protocol.d.ts +71 -0
- package/dist/shared/terminal-protocol.js +1 -0
- package/dist/shared/thinking-levels.d.ts +53 -0
- package/dist/shared/thinking-levels.js +85 -0
- package/dist/shared/tool-glyph.d.ts +7 -0
- package/dist/shared/tool-glyph.js +19 -0
- package/dist/shared/transcript-order.d.ts +7 -0
- package/dist/shared/transcript-order.js +12 -0
- package/dist/shared/update-status.d.ts +28 -0
- package/dist/shared/update-status.js +1 -0
- package/dist/shared/workspace-file-preview.d.ts +4 -0
- package/dist/shared/workspace-file-preview.js +28 -0
- package/package.json +448 -4
- package/scripts/diagnose.mjs +603 -0
- package/scripts/patch-brace-expansion.mjs +260 -0
- package/scripts/restart-server.mjs +104 -0
- package/skills/presentation/SKILL.md +30 -0
- package/skills/presentation/references/data.md +10 -0
- package/skills/presentation/references/quality.md +12 -0
- package/skills/presentation/references/story.md +12 -0
- package/skills/presentation/references/templates-and-editing.md +11 -0
- package/skills/presentation/references/visual-system.md +10 -0
- package/skills/super-pi-agent-development/SKILL.md +25 -0
- package/skills/super-pi-development/SKILL.md +31 -0
- package/skills/super-pi-tool-development/SKILL.md +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function npmInstallPrefix(rootDir: string, platform?: string): string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Infer npm's global prefix from this package's installation root, not its node_modules parent. */
|
|
2
|
+
export function npmInstallPrefix(rootDir, platform = process.platform) {
|
|
3
|
+
const match = rootDir.match(/^(.*)[\\/]node_modules[\\/]@evandu[\\/]super-pi(?:-server)?[\\/]?$/i);
|
|
4
|
+
if (!match) return undefined;
|
|
5
|
+
const parent = match[1];
|
|
6
|
+
// Unix global packages live in <prefix>/lib/node_modules; Windows omits lib.
|
|
7
|
+
// Passing the Unix lib directory as --prefix would install into lib/lib/node_modules.
|
|
8
|
+
if (platform !== "win32" && /[\\/]lib$/.test(parent)) return parent.slice(0, -4) || "/";
|
|
9
|
+
return parent;
|
|
10
|
+
}
|
package/bin/super-pi.js
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFile, spawn } from "node:child_process";
|
|
3
|
+
import { existsSync, readFileSync, statSync, openSync, readSync, closeSync, truncateSync, mkdirSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { dirname, join, resolve } from "node:path";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
import { npmInstallPrefix } from "./npm-prefix.js";
|
|
10
|
+
|
|
11
|
+
const execFileAsync = promisify(execFile);
|
|
12
|
+
const root = resolve(import.meta.dirname, "..");
|
|
13
|
+
const entry = resolve(root, "dist/server/index.js");
|
|
14
|
+
const platform = process.env.SUPER_PI_AUTOSTART_PLATFORM ?? process.platform;
|
|
15
|
+
const prefix = npmInstallPrefix(root, platform);
|
|
16
|
+
const home = process.env.SUPER_PI_AUTOSTART_HOME ?? homedir();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This installation's own version.
|
|
20
|
+
*
|
|
21
|
+
* READ AT RUN TIME, not baked in, because there can be more than one Super Pi on a machine and the one
|
|
22
|
+
* that matters is the one that is RUNNING. The two usual places are the global npm install - which is
|
|
23
|
+
* what the `super_pi` command runs - and the Pi extension's own install - which is what the
|
|
24
|
+
* `/super_pi` slash command loads. They are separate installations on purpose (Super Pi must not
|
|
25
|
+
* require Pi to be installed first), so their versions can differ, and a person comparing the two needs
|
|
26
|
+
* to see which is which. A bare version number cannot say that; a version number AND a path can.
|
|
27
|
+
*/
|
|
28
|
+
function ownVersion() {
|
|
29
|
+
try {
|
|
30
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
31
|
+
return { version: pkg.version ?? "unknown", location: root };
|
|
32
|
+
} catch {
|
|
33
|
+
return { version: "unknown", location: root };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The line that names what is running, so two installations can be told apart at a glance. */
|
|
38
|
+
function runningBanner(url) {
|
|
39
|
+
const { version, location } = ownVersion();
|
|
40
|
+
return `Super Pi v${version} is running at ${url}\n installed at ${location}\n log file: ${logFile()}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* WHERE THE PORT AND HOST COME FROM, IN THE ORDER THEY WIN.
|
|
45
|
+
*
|
|
46
|
+
* The command line beats the environment, the environment beats the saved config, and the saved
|
|
47
|
+
* config beats the built-in default. `super-pi set port` writes the saved config, so a deployment
|
|
48
|
+
* that cannot pass a flag every time still gets the port it asked for.
|
|
49
|
+
*/
|
|
50
|
+
function options(args) {
|
|
51
|
+
const saved = readConfig();
|
|
52
|
+
const envPortValue = Number(process.env.SUPER_PI_PORT ?? "");
|
|
53
|
+
const envPort = Number.isInteger(envPortValue) && envPortValue > 0 ? envPortValue : undefined;
|
|
54
|
+
const savedPort = Number(saved.port);
|
|
55
|
+
const value = {
|
|
56
|
+
port: envPort ?? (Number.isInteger(savedPort) && savedPort > 0 ? savedPort : 3080),
|
|
57
|
+
host: process.env.SUPER_PI_HOST ?? (typeof saved.host === "string" && saved.host ? saved.host : "0.0.0.0"),
|
|
58
|
+
browser: true,
|
|
59
|
+
};
|
|
60
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
61
|
+
const arg = args[i];
|
|
62
|
+
if (arg === "--no-browser") value.browser = false;
|
|
63
|
+
else if (arg === "--browser") value.browser = true;
|
|
64
|
+
else if (arg === "--port") value.port = Number(args[++i]);
|
|
65
|
+
else if (arg.startsWith("--port=")) value.port = Number(arg.slice(7));
|
|
66
|
+
else if (arg === "--host") value.host = args[++i];
|
|
67
|
+
else if (arg.startsWith("--host=")) value.host = arg.slice(7);
|
|
68
|
+
else throw new Error(`Unknown option: ${arg}`);
|
|
69
|
+
}
|
|
70
|
+
if (!value.host || value.host === "undefined") throw new Error("Host must be provided after --host.");
|
|
71
|
+
if (!Number.isInteger(value.port) || value.port < 1 || value.port > 65535) throw new Error("Port must be an integer from 1 to 65535.");
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function running(port) {
|
|
76
|
+
try { const response = await fetch(`http://127.0.0.1:${port}/api/health`, { signal: AbortSignal.timeout(1000) }); return response.ok && (await response.json()).service === "super-pi"; } catch { return false; }
|
|
77
|
+
}
|
|
78
|
+
async function stop(port) { try { const headers = process.env.SUPER_PI_ACCESS_TOKEN ? { authorization: `Bearer ${process.env.SUPER_PI_ACCESS_TOKEN}` } : {}; const response = await fetch(`http://127.0.0.1:${port}/api/shutdown`, { method: "POST", headers, signal: AbortSignal.timeout(3000) }); return response.ok || response.status === 202; } catch { return false; } }
|
|
79
|
+
function openBrowser(url) { const command = platform === "darwin" ? "open" : platform === "win32" ? "cmd.exe" : "xdg-open"; const args = platform === "darwin" ? [url] : platform === "win32" ? ["/c", "start", "", url] : [url]; spawn(command, args, { detached: true, stdio: "ignore", windowsHide: true }).unref(); }
|
|
80
|
+
function usage() { console.log("Usage: super-pi|super_pi <desktop|start|stop|restart|update|set|diagnose|logs|autostart> [options]"); console.log(" set port [PORT] Save the default port (omit the value to show it)"); console.log(" set host [HOST] Save the default host (omit the value to show it)"); console.log(" autostart enable|disable|status Configure startup at sign-in"); console.log(" diagnose Local runtime probe; --url URL for remote transport"); console.log(" logs [N] [--follow] Show the server log (last N lines, default 200)"); console.log(" logs --path Print the log file's path"); console.log(" logs --clear Empty the log file"); console.log(" --port PORT Server port (default: 3080)"); console.log(" --host HOST Server host (default: 0.0.0.0)"); console.log(" --no-browser Do not open a browser"); }
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* WHERE THE SERVER KEEPS ITS LOG FILE.
|
|
84
|
+
*
|
|
85
|
+
* The same rule the server itself uses when it picks its data directory, mirrored here on purpose:
|
|
86
|
+
* the CLI has to find the file the server wrote, and the server may be a DIFFERENT installation of
|
|
87
|
+
* Super Pi than the CLI that is asking (the global install and the one the `/super_pi` extension
|
|
88
|
+
* loads are two separate installs by design). `SUPER_PI_DATA_DIR` overrides both, which is what a
|
|
89
|
+
* person with a custom data directory needs.
|
|
90
|
+
*/
|
|
91
|
+
function dataDir() {
|
|
92
|
+
if (process.env.SUPER_PI_DATA_DIR) return resolve(process.env.SUPER_PI_DATA_DIR);
|
|
93
|
+
const local = join(root, ".super-pi");
|
|
94
|
+
if (!root.match(/[\\/]node_modules[\\/]/i) && existsSync(local)) return local;
|
|
95
|
+
return join(home, ".super-pi");
|
|
96
|
+
}
|
|
97
|
+
function logFile() { return join(dataDir(), "logs", "server.log"); }
|
|
98
|
+
function heartbeatFile() { return join(dataDir(), "logs", "heartbeat.txt"); }
|
|
99
|
+
|
|
100
|
+
/** The saved settings, or an empty object when there are none (or the file is broken). */
|
|
101
|
+
function readConfig() {
|
|
102
|
+
try { return JSON.parse(readFileSync(join(dataDir(), "config.json"), "utf8")) ?? {}; } catch { return {}; }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Saves the settings, keeping the keys the caller did not mention. */
|
|
106
|
+
function writeConfig(patch) {
|
|
107
|
+
const file = join(dataDir(), "config.json");
|
|
108
|
+
mkdirSync(dataDir(), { recursive: true });
|
|
109
|
+
writeFileSync(file, `${JSON.stringify({ ...readConfig(), ...patch }, null, 2)}\n`, "utf8");
|
|
110
|
+
return file;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The saved settings file, and the folder it lives in. */
|
|
114
|
+
function configFile() { return join(dataDir(), "config.json"); }
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* WHERE THE PORT IN EFFECT CAME FROM, so `set` can say it out loud instead of guessing.
|
|
118
|
+
*
|
|
119
|
+
* The command line beats the environment, the environment beats the saved config, and the saved
|
|
120
|
+
* config beats the built-in default. A `set` command carries no port of its own, so the command
|
|
121
|
+
* line only wins when the person passed `--port` to `set` itself.
|
|
122
|
+
*/
|
|
123
|
+
function portSource(saved, args) {
|
|
124
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
125
|
+
const arg = args[i];
|
|
126
|
+
const flag = arg === "--port" ? args[i + 1] : arg.startsWith("--port=") ? arg.slice(7) : undefined;
|
|
127
|
+
const number = Number(flag);
|
|
128
|
+
if (flag !== undefined && Number.isInteger(number) && number > 0) return { port: number, source: "命令行" };
|
|
129
|
+
}
|
|
130
|
+
const envPort = Number(process.env.SUPER_PI_PORT ?? "");
|
|
131
|
+
if (Number.isInteger(envPort) && envPort > 0) return { port: envPort, source: "环境变量 SUPER_PI_PORT" };
|
|
132
|
+
const savedPort = Number(saved.port);
|
|
133
|
+
if (Number.isInteger(savedPort) && savedPort > 0) return { port: savedPort, source: "配置文件" };
|
|
134
|
+
return { port: 3080, source: "默认值" };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** The same rule for the host: the command line, then the environment, then the saved config. */
|
|
138
|
+
function hostSource(saved, args) {
|
|
139
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
140
|
+
const arg = args[i];
|
|
141
|
+
const flag = arg === "--host" ? args[i + 1] : arg.startsWith("--host=") ? arg.slice(7) : undefined;
|
|
142
|
+
if (flag !== undefined && flag) return { host: flag, source: "命令行" };
|
|
143
|
+
}
|
|
144
|
+
const envHost = process.env.SUPER_PI_HOST;
|
|
145
|
+
if (envHost !== undefined) return { host: envHost, source: "环境变量 SUPER_PI_HOST" };
|
|
146
|
+
if (typeof saved.host === "string" && saved.host) return { host: saved.host, source: "配置文件" };
|
|
147
|
+
return { host: "0.0.0.0", source: "默认值" };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* `super-pi set port 8080` - MAKE THE DEFAULT THE ONE YOU WANT, ONCE.
|
|
152
|
+
*
|
|
153
|
+
* The server usually lives behind a firewall that only lets a few ports through, so the port a
|
|
154
|
+
* person has to use is the same every day. Writing it down means `start`, `stop`, `restart` and
|
|
155
|
+
* `autostart` all use it without the flag, and the flag still wins when somebody passes it.
|
|
156
|
+
*/
|
|
157
|
+
async function runSet(args) {
|
|
158
|
+
// The words are the key and the value; a flag and its value belong to the flag, not to the key.
|
|
159
|
+
const words = [];
|
|
160
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
161
|
+
const arg = args[i];
|
|
162
|
+
if (arg === "--port" || arg === "--host") { i += 1; continue; }
|
|
163
|
+
if (arg.startsWith("--")) continue;
|
|
164
|
+
words.push(arg);
|
|
165
|
+
}
|
|
166
|
+
const key = words[0]?.toLowerCase();
|
|
167
|
+
const value = words[1];
|
|
168
|
+
const saved = readConfig();
|
|
169
|
+
|
|
170
|
+
if (!key) {
|
|
171
|
+
const { port } = portSource(saved, []);
|
|
172
|
+
const { host } = hostSource(saved, []);
|
|
173
|
+
console.log(`默认端口:${port}`);
|
|
174
|
+
console.log(`默认主机:${host}`);
|
|
175
|
+
console.log(`配置文件:${configFile()}`);
|
|
176
|
+
return 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (key !== "port" && key !== "host") {
|
|
180
|
+
console.log(`未知设置项:${key}。可用:port、host`);
|
|
181
|
+
return 1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (value === undefined) {
|
|
185
|
+
if (key === "port") {
|
|
186
|
+
const found = portSource(saved, args);
|
|
187
|
+
console.log(`默认端口:${found.port}(来自${found.source})`);
|
|
188
|
+
} else {
|
|
189
|
+
const found = hostSource(saved, args);
|
|
190
|
+
console.log(`默认主机:${found.host}(来自${found.source})`);
|
|
191
|
+
}
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const before = portSource(saved, args).port;
|
|
196
|
+
let patch;
|
|
197
|
+
if (key === "port") {
|
|
198
|
+
const number = Number(value);
|
|
199
|
+
if (!Number.isInteger(number) || number < 1 || number > 65535) {
|
|
200
|
+
console.log("端口必须是 1 到 65535 之间的整数");
|
|
201
|
+
return 1;
|
|
202
|
+
}
|
|
203
|
+
patch = { port: number };
|
|
204
|
+
} else {
|
|
205
|
+
if (!value) {
|
|
206
|
+
console.log("主机不能是空字符串");
|
|
207
|
+
return 1;
|
|
208
|
+
}
|
|
209
|
+
patch = { host: value };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const file = writeConfig(patch);
|
|
213
|
+
const after = readConfig();
|
|
214
|
+
const effective = portSource(after, args);
|
|
215
|
+
const effectiveHost = hostSource(after, args).host;
|
|
216
|
+
|
|
217
|
+
if (key === "port") {
|
|
218
|
+
console.log(`默认端口已设为 ${patch.port}`);
|
|
219
|
+
} else {
|
|
220
|
+
console.log(`默认主机已设为 ${patch.host}`);
|
|
221
|
+
}
|
|
222
|
+
console.log(`配置写在 ${file}`);
|
|
223
|
+
console.log(`下次启动会监听 ${effectiveHost}:${effective.port}`);
|
|
224
|
+
|
|
225
|
+
// A server that is already running keeps the port it started on; only a restart moves it.
|
|
226
|
+
if (effective.port !== before && await running(before)) {
|
|
227
|
+
console.log(`注意:还有实例在 ${before} 上运行;执行 super-pi stop 再 super-pi start 才会切到新端口`);
|
|
228
|
+
}
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** "How long ago was the server alive?" - the answer a silent death cannot give by itself. */
|
|
233
|
+
function lastAlive() {
|
|
234
|
+
const file = heartbeatFile();
|
|
235
|
+
if (!existsSync(file)) return null;
|
|
236
|
+
try {
|
|
237
|
+
const at = statSync(file).mtimeMs;
|
|
238
|
+
const minutes = Math.max(0, Math.round((Date.now() - at) / 60000));
|
|
239
|
+
const when = new Date(at).toLocaleString();
|
|
240
|
+
return minutes < 1 ? `${when} (just now)` : `${when} (${minutes} minute${minutes === 1 ? "" : "s"} ago)`;
|
|
241
|
+
} catch { return null; }
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
/** The last `lines` lines of the log file, read from the end so a big file stays cheap to open. */
|
|
246
|
+
function readLogTail(file, lines) {
|
|
247
|
+
if (!existsSync(file)) return [];
|
|
248
|
+
const size = statSync(file).size;
|
|
249
|
+
if (size === 0) return [];
|
|
250
|
+
const length = Math.min(size, 512 * 1024);
|
|
251
|
+
const buffer = Buffer.alloc(length);
|
|
252
|
+
const fd = openSync(file, "r");
|
|
253
|
+
try { readSync(fd, buffer, 0, length, size - length); } finally { closeSync(fd); }
|
|
254
|
+
const all = buffer.toString("utf8").split(/\r?\n/);
|
|
255
|
+
if (all.length > 0 && all[all.length - 1] === "") all.pop();
|
|
256
|
+
return all.slice(Math.max(0, all.length - lines));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Print whatever the log file gains from now on, until Ctrl+C. */
|
|
260
|
+
function followLog(file) {
|
|
261
|
+
let offset = existsSync(file) ? statSync(file).size : 0;
|
|
262
|
+
const tick = () => {
|
|
263
|
+
try {
|
|
264
|
+
if (!existsSync(file)) return;
|
|
265
|
+
const size = statSync(file).size;
|
|
266
|
+
// A SMALLER FILE MEANS THE LOG WAS ROTATED (or cleared): start over from the top.
|
|
267
|
+
if (size < offset) offset = 0;
|
|
268
|
+
if (size <= offset) return;
|
|
269
|
+
const buffer = Buffer.alloc(size - offset);
|
|
270
|
+
const fd = openSync(file, "r");
|
|
271
|
+
try { readSync(fd, buffer, 0, buffer.length, offset); } finally { closeSync(fd); }
|
|
272
|
+
offset = size;
|
|
273
|
+
process.stdout.write(buffer.toString("utf8"));
|
|
274
|
+
} catch { /* the file is being rotated under us; the next tick picks it up */ }
|
|
275
|
+
};
|
|
276
|
+
tick();
|
|
277
|
+
const timer = setInterval(tick, 400);
|
|
278
|
+
process.on("SIGINT", () => { clearInterval(timer); process.exit(0); });
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function paths() { if (platform === "win32") return { task: "Super Pi" }; if (platform === "darwin") return { file: join(home, "Library", "LaunchAgents", "com.evandu.super-pi.plist") }; return { file: join(process.env.XDG_CONFIG_HOME ?? join(home, ".config"), "systemd", "user", "super-pi.service") }; }
|
|
282
|
+
async function system(command, args) { if (process.env.SUPER_PI_AUTOSTART_DRY_RUN === "1") { console.log(`[dry-run] ${command} ${args.join(" ")}`); return; } await execFileAsync(command, args, { windowsHide: true }); }
|
|
283
|
+
async function enable(value) {
|
|
284
|
+
const target = paths();
|
|
285
|
+
if (platform === "win32") { const command = `"${process.execPath}" "${entry}" --host "${value.host}" --port ${value.port} --no-browser`; await system("schtasks.exe", ["/Create", "/TN", target.task, "/SC", "ONLOGON", "/TR", command, "/RL", "LIMITED", "/F"]); }
|
|
286
|
+
else if (platform === "darwin") { const content = `<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>Label</key><string>com.evandu.super-pi</string><key>ProgramArguments</key><array><string>${process.execPath}</string><string>${entry}</string><string>--host</string><string>${value.host}</string><string>--port</string><string>${value.port}</string></array><key>RunAtLoad</key><true/><key>KeepAlive</key><true/></dict></plist>`; if (process.env.SUPER_PI_AUTOSTART_DRY_RUN !== "1") { await mkdir(dirname(target.file), { recursive: true }); await writeFile(target.file, content); } else console.log(`[dry-run] write ${target.file}\n${content}`); await system("launchctl", ["bootout", `gui/${process.getuid?.() ?? "501"}`, target.file]).catch(() => {}); await system("launchctl", ["bootstrap", `gui/${process.getuid?.() ?? "501"}`, target.file]); }
|
|
287
|
+
else { const content = `[Unit]\nDescription=Super Pi\nAfter=default.target\n\n[Service]\nExecStart=${process.execPath} ${entry} --host ${value.host} --port ${value.port}\nRestart=on-failure\n\n[Install]\nWantedBy=default.target\n`; if (process.env.SUPER_PI_AUTOSTART_DRY_RUN !== "1") { await mkdir(dirname(target.file), { recursive: true }); await writeFile(target.file, content); } else console.log(`[dry-run] write ${target.file}\n${content}`); await system("systemctl", ["--user", "daemon-reload"]); await system("systemctl", ["--user", "enable", "--now", "super-pi.service"]); }
|
|
288
|
+
console.log("Automatic startup enabled.");
|
|
289
|
+
}
|
|
290
|
+
async function disable() { const target = paths(); if (platform === "win32") await system("schtasks.exe", ["/Delete", "/TN", target.task, "/F"]).catch(() => {}); else if (platform === "darwin") { await system("launchctl", ["bootout", `gui/${process.getuid?.() ?? "501"}`, target.file]).catch(() => {}); if (process.env.SUPER_PI_AUTOSTART_DRY_RUN !== "1") await rm(target.file, { force: true }); } else { await system("systemctl", ["--user", "disable", "--now", "super-pi.service"]).catch(() => {}); if (process.env.SUPER_PI_AUTOSTART_DRY_RUN !== "1") await rm(target.file, { force: true }); } console.log("Automatic startup disabled."); }
|
|
291
|
+
async function status() { const target = paths(); let enabled = false; if (platform === "win32") { try { await execFileAsync("schtasks.exe", ["/Query", "/TN", target.task]); enabled = true; } catch {} } else enabled = existsSync(target.file); console.log(enabled ? "Automatic startup is enabled." : "Automatic startup is disabled."); }
|
|
292
|
+
async function start(value) { if (await running(value.port)) return; const child = spawn(process.execPath, [entry, `--port=${value.port}`, `--host=${value.host}`], { detached: true, stdio: "ignore", env: { ...process.env, SUPER_PI_PORT: String(value.port), SUPER_PI_HOST: value.host }, windowsHide: true }); child.unref(); const until = Date.now() + 8000; while (Date.now() < until && !(await running(value.port))) await new Promise((resolve) => setTimeout(resolve, 200)); if (!(await running(value.port))) throw new Error("Server did not respond within 8 seconds."); }
|
|
293
|
+
|
|
294
|
+
const [raw, ...rest] = process.argv.slice(2);
|
|
295
|
+
const implicitStart = raw?.startsWith("-") ?? false;
|
|
296
|
+
const command = implicitStart ? "start" : raw?.toLowerCase();
|
|
297
|
+
const args = implicitStart ? [raw, ...rest] : rest;
|
|
298
|
+
try {
|
|
299
|
+
if (command === "help" || command === "--help" || command === "-h") { usage(); process.exit(0); }
|
|
300
|
+
if (command === "desktop" || command === "app") { if (!existsSync(join(root, "desktop", "launch.cjs"))) throw new Error("纯服务包不包含桌面端,请在自己的电脑安装完整包 @evandu/super-pi"); await import(pathToFileURL(join(root, "desktop", "launch.cjs")).href); process.exit(process.exitCode ?? 0); }
|
|
301
|
+
else if (!command) { const value = options(args); await start(value); const url = `http://127.0.0.1:${value.port}`; if (value.browser) openBrowser(url); console.log(value.browser ? `Opened ${url}\n${runningBanner(url)}` : runningBanner(url)); process.exit(0); }
|
|
302
|
+
if (command === "autostart" || command === "startup") { const action = args.shift()?.toLowerCase() ?? "status"; const value = options(args); if (action === "enable") await enable(value); else if (action === "disable") await disable(); else if (action === "status") await status(); else throw new Error("Autostart action must be enable, disable, or status."); process.exit(0); }
|
|
303
|
+
if (command === "diagnose" || command === "diagnose-latency") {
|
|
304
|
+
// Local mode isolates runtime setup; --url probes this computer's route to an existing server.
|
|
305
|
+
// Neither probe claims to measure browser clicks or provider-only latency.
|
|
306
|
+
const { diagnose, diagnoseRemote, parseDiagnoseArgs, renderReport } = await import(pathToFileURL(join(root, "scripts", "diagnose.mjs")).href);
|
|
307
|
+
const probe = parseDiagnoseArgs(args);
|
|
308
|
+
console.log(`Super Pi v${ownVersion().version} — diagnosing on ${process.platform}, node ${process.versions.node}`);
|
|
309
|
+
const result = probe.url ? await diagnoseRemote(probe) : await diagnose({
|
|
310
|
+
repositoryRoot: root,
|
|
311
|
+
turns: probe.turns ?? 2,
|
|
312
|
+
onProgress: (line) => console.log(` ${line}`),
|
|
313
|
+
});
|
|
314
|
+
console.log("");
|
|
315
|
+
console.log(renderReport(result));
|
|
316
|
+
process.exit(result.error ? 1 : 0);
|
|
317
|
+
}
|
|
318
|
+
if (command === "logs" || command === "log") {
|
|
319
|
+
// HOW THE SERVER DIED, IN ONE COMMAND.
|
|
320
|
+
//
|
|
321
|
+
// The server runs detached with its console thrown away, so this file is the only record of it.
|
|
322
|
+
// It is written synchronously as the server speaks, so the last lines are always the crash.
|
|
323
|
+
const file = logFile();
|
|
324
|
+
const count = Number.parseInt(args.find((a) => /^\d+$/.test(a)) ?? "200", 10);
|
|
325
|
+
const follow = args.some((a) => a === "--follow" || a === "-f");
|
|
326
|
+
if (args.includes("--path")) { console.log(file); process.exit(0); }
|
|
327
|
+
if (args.includes("--clear")) { if (existsSync(file)) truncateSync(file, 0); console.log(`Cleared ${file}`); process.exit(0); }
|
|
328
|
+
if (!existsSync(file)) { console.log(`No log file yet at ${file}\nStart Super Pi with: super-pi start`); process.exit(0); }
|
|
329
|
+
console.log(`Log file: ${file}`);
|
|
330
|
+
const alive = lastAlive();
|
|
331
|
+
console.log(alive ? `Last alive: ${alive}` : "Last alive: unknown (no heartbeat file - the server may never have started)");
|
|
332
|
+
for (const line of readLogTail(file, Number.isInteger(count) && count > 0 ? count : 200)) console.log(line);
|
|
333
|
+
if (follow) {
|
|
334
|
+
// FOLLOWING MEANS THIS COMMAND DOES NOT END. The promise below never settles; `followLog` ends
|
|
335
|
+
// the process on Ctrl+C. Without it this branch would fall through to the "unknown command"
|
|
336
|
+
// check below and take the tail down with it.
|
|
337
|
+
followLog(file);
|
|
338
|
+
await new Promise(() => {});
|
|
339
|
+
}
|
|
340
|
+
process.exit(0);
|
|
341
|
+
}
|
|
342
|
+
if (command === "set") { process.exit(await runSet(args)); }
|
|
343
|
+
if (!["start", "stop", "restart", "update"].includes(command)) throw new Error(`Unknown command: ${command}`);
|
|
344
|
+
if (command === "update") { const packageName = JSON.parse(readFileSync(join(root, "package.json"), "utf8")).name === "@evandu/super-pi-server" ? "@evandu/super-pi-server" : "@evandu/super-pi"; const npm = platform === "win32" ? "npm.cmd" : "npm"; const args = prefix ? ["install", "-g", "--prefix", prefix, "--fetch-timeout=900000", "--fetch-retries=8", "--fetch-retry-maxtimeout=120000", packageName] : ["install", "-g", "--fetch-timeout=900000", "--fetch-retries=8", "--fetch-retry-maxtimeout=120000", packageName]; const child = spawn(npm, args, { stdio: "inherit", shell: platform === "win32", env: process.env }); const code = await new Promise((resolve) => child.on("close", resolve)); if (code !== 0) process.exit(code ?? 1); }
|
|
345
|
+
const value = options(args);
|
|
346
|
+
if (command === "stop") { console.log(await running(value.port) ? (await stop(value.port) ? `Shutdown requested on port ${value.port}.` : "Shutdown request failed.") : `Super Pi is not running on port ${value.port}.`); process.exit(0); }
|
|
347
|
+
if ((command === "restart" || command === "update") && await running(value.port)) { await stop(value.port); await new Promise((resolve) => setTimeout(resolve, 600)); }
|
|
348
|
+
await start(value); const url = `http://127.0.0.1:${value.port}`; if (value.browser) openBrowser(url); console.log(value.browser ? `Opened ${url}\n${runningBanner(url)}` : runningBanner(url));
|
|
349
|
+
} catch (error) { console.error(error instanceof Error ? error.message : String(error)); usage(); process.exit(1); }
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "e930f00594109d0258ef6265ff8333344691e274398cdc2d814de61d45d02a67",
|
|
3
|
+
"files": {
|
|
4
|
+
"src/client/App.tsx": "f3dc490797eddd9dff9d20e6b4599127e136b25830f13e6e21b912b49281b3d3",
|
|
5
|
+
"src/client/CacheWarmingSettings.tsx": "cce26c4547634b76c08c681a4b9605f884d8502f554f12ff8c30cbd2fd0bd9c0",
|
|
6
|
+
"src/client/CodeMirrorEditor.tsx": "10e4444d606b731a117417b052401f27b5d14ba8d12ff518e31ee188bf66e512",
|
|
7
|
+
"src/client/DesktopPanel.tsx": "3f706563e739121e149fbb8b46a28ebadf102cc369ae0fbfc67099c9ec004644",
|
|
8
|
+
"src/client/ErrorBoundary.tsx": "d16376f9f6c7cc1fab8590c65a66438127642f7d6bb8023cec53d8a6cc9f3964",
|
|
9
|
+
"src/client/FeishuPanel.tsx": "3b3257da36bf863e004a33a4c1d721db364b4449fb23f0805cb74b973a2ed2da",
|
|
10
|
+
"src/client/FileMentionMenu.tsx": "d400e7afb31008eda49d4b531eceda65a926b877177d0cffd9a8056b55161c3e",
|
|
11
|
+
"src/client/FileWorkbenchChrome.tsx": "0863c988bdc50962e3dab365e918ad6de6aee7cc2d0d4d3cce049fa3529d2b6b",
|
|
12
|
+
"src/client/FilesPanel.tsx": "2edf2b91f114f0e6aa12239a751f537bceec7f121c531bac558d7b7d1f25c432",
|
|
13
|
+
"src/client/GitDiffEditor.tsx": "192f71ddba603f0254cfa54bb40bb8be3a42d83f4a98634011f7de0d81974ba0",
|
|
14
|
+
"src/client/GitPanel.tsx": "72cf7eb1df5a0b1d63eca6ca981850fc24cb8277689ac4414b9ecc88065ed09f",
|
|
15
|
+
"src/client/GroupChatPane.tsx": "fa8ba7a05bd074c2a29330d34e8ef389b47309a3253787fabfd78551c3edca66",
|
|
16
|
+
"src/client/GroupExecutionPane.tsx": "5cdba8a51b0e5daa097f08979ca4abe0b64b73649e60fdcc83d23e2b588a1ca6",
|
|
17
|
+
"src/client/HelpWindow.tsx": "dd4767f4cdced2fcdb50769eb5417ef8de722f43bbd594c9854f49fe61d15d97",
|
|
18
|
+
"src/client/KnowledgeFilePicker.tsx": "82bdd65e8a624276abd5a7530ef47f86a5f9b7649b464080638055991f6278cf",
|
|
19
|
+
"src/client/KnowledgePanel.tsx": "1e64ee6f9d29456ab9470424def8269cc9b3935e3b8ba674739ce5a6cb7db56d",
|
|
20
|
+
"src/client/ManagedServersPanel.tsx": "24fc762373cf45e7ca48ab821abb784dc2b0909292a670363f6e9227b13bf80b",
|
|
21
|
+
"src/client/MarkdownSyntaxSettings.tsx": "9124d02956a4d70e2607fc584b226f8a82764b613015958fe117159d0cbf78e1",
|
|
22
|
+
"src/client/MarkdownView.tsx": "c52e63bddd2275573731166375275caf80f3327a3b4a2aff07d14aecfda00b8e",
|
|
23
|
+
"src/client/MathView.tsx": "f322a430b93594dd625b4c699994574f81d9bac72fa49b904505ca6e9e3dcb93",
|
|
24
|
+
"src/client/MemoryPanel.tsx": "bbb2fe13bbd6e72ae7a67eba4036d6bee9bb7b0509f52e1e6377575a9fe083c0",
|
|
25
|
+
"src/client/MessageMedia.tsx": "4aee39d81ba4f405f6f3cd66e0ca4c89fc9a59145c2c463743a9869d78a2df25",
|
|
26
|
+
"src/client/NativeToolsPanel.tsx": "31e544b6def3cf0b09d86c485846c48cf787c518575b34aaceb930a8a68c96b6",
|
|
27
|
+
"src/client/ProjectControlPanel.tsx": "ddd1ba2249bd070d35ad0e9bd7154b088c8374c579ff9bbcfd3b46c2d144abd7",
|
|
28
|
+
"src/client/ProviderNetworkSettings.tsx": "004ae9f24452754025cc0a33c7f3a53928fbf3f353ee684a2d1c0aff296d133f",
|
|
29
|
+
"src/client/ScheduledTasksPanel.tsx": "ed69d3617b6e4dc1a815cbf1a8d675c7c2010061b9fe2eac216813527c9cd7ab",
|
|
30
|
+
"src/client/ServerConnectionsPanel.tsx": "38cbcfc6556981f5f0370ecc1643ed79a9c95adda164e3a9d9ea4be6f2c2e41d",
|
|
31
|
+
"src/client/SidebarSection.tsx": "579c014caeddd94d21911d7b9eca4ceef930ca13c2baeb7bf5ffba59c2bb0b75",
|
|
32
|
+
"src/client/SlashCommandMenu.tsx": "8b2319da03b55827865fb9b6646f7a820aa26cc460cceeed9fb7edb20ad9ebb7",
|
|
33
|
+
"src/client/SoftwareUpdate.tsx": "5ded9a91f0387be96a56228bd02aaf3673821feba28cb74b3493cd1f432f49e1",
|
|
34
|
+
"src/client/Tabs.tsx": "a6a853b0752f5a96f451de502669fbb7ad4b5c141cb3f6a9cd3b9746797b5649",
|
|
35
|
+
"src/client/TavilyPanel.css": "22d4fb4a1bc95b2e0a96c49b9650a56f1a6cf7cfc3c6bc68564417d2c268e193",
|
|
36
|
+
"src/client/TavilyPanel.tsx": "c60ffea2bf89811503408f4d32eb9419c65f401275d31c047b2bd36e0df42251",
|
|
37
|
+
"src/client/TeamHandoffCard.tsx": "925284ab81c7845c5cfdcfa1f631e124bb02d7d86b03ede8f3fbabc194c32dca",
|
|
38
|
+
"src/client/TerminalPanel.tsx": "a8ba57d6e7b989fc9042a9356c547d02670928bfeec271779f4bd44651f41e92",
|
|
39
|
+
"src/client/ToolGlyph.tsx": "a1100b61f1eee9520e7323385f667898763bfd69068f22de7dd36db2d4096c76",
|
|
40
|
+
"src/client/WorkbenchChrome.tsx": "6328c984b736651024ebade3f390380e53333e6d11bea74ca4593a4176893778",
|
|
41
|
+
"src/client/WorkbenchSearch.tsx": "7967f393324fd437fa5d56bd2a3d90644189a3e39e2028430d54c3d6ee69ab72",
|
|
42
|
+
"src/client/WorkbenchSplit.tsx": "7afc0e435ad8eae95f95a28563034e3bf09eef070f47bd3366d9b8eff9bc229e",
|
|
43
|
+
"src/client/WorkflowCard.tsx": "8ce5458537a3b02dcbb9bbb4c7afacb07e0f41857ed250aa4cde0cbc8d4bde6c",
|
|
44
|
+
"src/client/WorkspaceBulkSettings.tsx": "859cb5159f1aff91b8e7a7987c569d67df8bbacb3f24c6cc4c47b5ebe17f253c",
|
|
45
|
+
"src/client/WorkspaceExplorerActions.tsx": "455d1487bfb75e250682a00cbebfe6a73ba37afe209f64ec79f0686664c87bf9",
|
|
46
|
+
"src/client/WorkspaceFilePreview.tsx": "1c9370fa08e0ffc64da08026cbfcf5723da886b70c9b48a8b084d5bf9cea186c",
|
|
47
|
+
"src/client/archive-confirm.ts": "a559c1d251e2e3495519d009c50e3adcaaae5859566290c6b8ffef554ddf268c",
|
|
48
|
+
"src/client/clipboard.ts": "54c7b134515f175acb8befa8e19c55f1c048c3245a7edc2cfc4d233b7593f782",
|
|
49
|
+
"src/client/diff-context-scroll.ts": "11f27a1f56c6ec77bf138119c4d00f798e553852d8de07fe258e4af090adfda1",
|
|
50
|
+
"src/client/editor-blame.ts": "d680671b98c64f8ba7f639f660f6b4aab0bf112fc4695c436c9d2a505326b0b0",
|
|
51
|
+
"src/client/editor-languages.ts": "d5319cfd9b9f3b07c2599ba64ec49a9038304d09fa1702302f3b2b97493d0a69",
|
|
52
|
+
"src/client/errors.ts": "2ea215b8676cca8841b93c780563f1f2031320270d4d0865221f6a12b65c6f22",
|
|
53
|
+
"src/client/file-diff.ts": "b1fd62dd0f561c567f249d98364068c947e31758fa9f1644d27250679e0f62a4",
|
|
54
|
+
"src/client/file-icons.tsx": "65e571a5378723511caef0e4bdbecdd4adba9461a46db878d65a948fc99fcb65",
|
|
55
|
+
"src/client/group-chat-client.ts": "23daaa55daa08819cafada4e91650d6b4be34da07f6ce1f57bf98900f56ea140",
|
|
56
|
+
"src/client/group-chat.css": "528f04b8615b3a247bf5b7db30d9a1aee66494eb8d4da3e18c8e4a2fc58fd22f",
|
|
57
|
+
"src/client/main.tsx": "d6325cec79ebc225e4972c33ad9b4266fa1eab5f962fec36ed4c539124a8fcab",
|
|
58
|
+
"src/client/markdown-settings.ts": "33075c9137183ae4874d5a9a764cd2ae5ce9abd27331065880aa53cf6e3f307a",
|
|
59
|
+
"src/client/markdown.ts": "8d1b61361739313914b973cb1eaad5060f4c7ceec2dd18f609a8cfb50852c956",
|
|
60
|
+
"src/client/native-tools.css": "71bbb365a91105be0925acce27f1e1ea5e0c3369aa5137060d2bc426682e113d",
|
|
61
|
+
"src/client/pending-operations.ts": "8a5f9e9711c0f875c8ed194196c218162de5270298dad4091351d41294c859d7",
|
|
62
|
+
"src/client/project-evidence.ts": "3bc5ea85f6b20a19a36cfdd4a958d83dd53b21f3d8f20fae1914a575dfbad3c4",
|
|
63
|
+
"src/client/reader-recovery.ts": "20030e65dce38d06bcc65d13cbe451e87dcee9c10cae7cdb7c056e5407f77849",
|
|
64
|
+
"src/client/server-connections.ts": "f2349d679e3e8cac8f5fdb6800b264aeccf57f5df10cfd3fc188613fa2ceb08a",
|
|
65
|
+
"src/client/server-scope.ts": "8edad8ebe6f35179584c3d2627304f394dd40e6dd83881d7edaf386ff46243cc",
|
|
66
|
+
"src/client/session-tree.ts": "08a14c6611fdd9a72001eb1672060479e7660de5a5d221c7e80036209fd26546",
|
|
67
|
+
"src/client/slash-commands.ts": "4a2cef1eb9517628eadfdc38bca7e3663e4d48090d8b87a8a79de4bfd586e112",
|
|
68
|
+
"src/client/software-update.css": "a4ec1565b70008b55618197a8d88db51a79fb932b9a69bfe4318a62774e8020a",
|
|
69
|
+
"src/client/styles.css": "ca6c46a13a75cb37e24ce7a0f4f64ebd28f8d94fb43ffa894a8ab346a0ac81b7",
|
|
70
|
+
"src/client/system-notifications.ts": "36dccbda2d831812d34af7217778a7a3596b184dfc2b39e0d5a0207a1a7eebd0",
|
|
71
|
+
"src/client/terminal-emulator.ts": "ffcc4f5fbddaf25cebcc9e03dbe5d7d0ad2c21586f5d169e57c04c82e2308b3b",
|
|
72
|
+
"src/client/theme.tsx": "45098ed92bd513629f17ac31280bc559b4251dd1c0b4e3f1abdace72e373cafd",
|
|
73
|
+
"src/client/tool-launcher.ts": "9699c9498c905e395bbe89e0e367721ab253b5ec1e318a8093ce6a88c2ff5c29",
|
|
74
|
+
"src/client/tool-sharing.ts": "011212825dbbffe18c8f15aca721c02938ab6273fb5607b072a1e7b8b1853640",
|
|
75
|
+
"src/client/tool-shortcuts.ts": "4422d29ba770af6acef18e66c6be05a9bc021f7323c7ca28bbe7668f26d4adb8",
|
|
76
|
+
"src/client/tools.ts": "58fe41f0edbd490e3fab7f12f258b1dbc2163b653553b03ac61caf1543618e50",
|
|
77
|
+
"src/client/types.ts": "decedc5db2c31c0f27ce5a19a873aaf6d8543ff0e01fdf4e41d3670a45ff0e9a",
|
|
78
|
+
"src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
|
|
79
|
+
"src/client/workbench-navigation.ts": "3b229752a8ce4a45eba7aeff040eb33001413190141f1e9b8e5f38246a1761e2"
|
|
80
|
+
},
|
|
81
|
+
"recordedAt": "2026-11-20T03:55:01.219Z"
|
|
82
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-J6XWqRpB.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-D978o95T.js","assets/dist-B3-a6uF0.js","assets/dist-Cus6_oaF.js","assets/dist-Dc1MBGAG.js","assets/dist-BXAOrsjq.js","assets/dist-Cx00EZKR.js","assets/dist-moiMRpw_.js","assets/dist-Dds-qLxY.js","assets/dist-AW5lyI3I.js","assets/dist-BGxkyh6e.js","assets/dist-CKF2Jksy.js","assets/dist-BV64A9Ji.js","assets/dist-Dvb0SqcK.js","assets/dist-D71y2EI1.js","assets/dist-DeD9copn.js","assets/dist-QzbOCAU6.js","assets/dist-DuvGReu-.js","assets/dist-BRVQKlcp.js","assets/dist-BJxfd7yb.js","assets/dist-CX_Hm4GS.js","assets/dist-scBkrwv-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{c as t,l as n,n as r,r as i,t as a}from"./index-Cn7hdrDw.js";var o=e(n(),1);async function s(e,t){let[{StreamLanguage:n},r]=await Promise.all([i(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([0,1,2,3,4])),e()]),a=r[t]??r.default??r;return n.define(a)}var c={cpp:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),cc:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),cxx:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),hpp:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),hh:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),hxx:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),c:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),h:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),cu:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),cuh:()=>i(()=>import(`./dist-Dc1MBGAG.js`).then(e=>e.cpp()),__vite__mapDeps([5,4,1,0,2,3,6])),js:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([7,1,2,3,4,0,6,8])),jsx:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([7,1,2,3,4,0,6,8])),mjs:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([7,1,2,3,4,0,6,8])),cjs:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([7,1,2,3,4,0,6,8])),ts:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([7,1,2,3,4,0,6,8])),tsx:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0,jsx:!0})),__vite__mapDeps([7,1,2,3,4,0,6,8])),mts:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([7,1,2,3,4,0,6,8])),cts:()=>i(()=>import(`./dist-Cx00EZKR.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([7,1,2,3,4,0,6,8])),py:()=>i(()=>import(`./dist-Dds-qLxY.js`).then(e=>e.python()),__vite__mapDeps([9,4,1,0,2,3,6,8])),pyi:()=>i(()=>import(`./dist-Dds-qLxY.js`).then(e=>e.python()),__vite__mapDeps([9,4,1,0,2,3,6,8])),java:()=>i(()=>import(`./dist-AW5lyI3I.js`).then(e=>e.java()),__vite__mapDeps([10,4,1,0,2,3,6])),php:()=>i(()=>import(`./dist-BGxkyh6e.js`).then(e=>e.php()),__vite__mapDeps([11,4,1,0,2,3,6,12,13,7,8])),sql:()=>i(()=>import(`./dist-Dvb0SqcK.js`).then(e=>e.sql()),__vite__mapDeps([14,4,1,0,2,3,6,8])),yaml:()=>i(()=>import(`./dist-D71y2EI1.js`).then(e=>e.yaml()),__vite__mapDeps([15,4,1,0,2,3,6])),yml:()=>i(()=>import(`./dist-D71y2EI1.js`).then(e=>e.yaml()),__vite__mapDeps([15,4,1,0,2,3,6])),xml:()=>i(()=>import(`./dist-DeD9copn.js`).then(e=>e.xml()),__vite__mapDeps([16,2,1,3,4,0,6])),json:()=>i(()=>import(`./dist-QzbOCAU6.js`).then(e=>e.json()),__vite__mapDeps([17,4,1,0,2,3,6])),jsonc:()=>i(()=>import(`./dist-QzbOCAU6.js`).then(e=>e.json()),__vite__mapDeps([17,4,1,0,2,3,6])),json5:()=>i(()=>import(`./dist-QzbOCAU6.js`).then(e=>e.json()),__vite__mapDeps([17,4,1,0,2,3,6])),html:()=>i(()=>import(`./dist-CKF2Jksy.js`).then(e=>e.html()),__vite__mapDeps([12,2,1,3,4,0,6,13,7,8])),htm:()=>i(()=>import(`./dist-CKF2Jksy.js`).then(e=>e.html()),__vite__mapDeps([12,2,1,3,4,0,6,13,7,8])),vue:()=>i(()=>import(`./dist-CKF2Jksy.js`).then(e=>e.html()),__vite__mapDeps([12,2,1,3,4,0,6,13,7,8])),svelte:()=>i(()=>import(`./dist-CKF2Jksy.js`).then(e=>e.html()),__vite__mapDeps([12,2,1,3,4,0,6,13,7,8])),css:()=>i(()=>import(`./dist-BV64A9Ji.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([13,1,4,0,2,3,6])),md:()=>i(()=>import(`./dist-DuvGReu-.js`).then(e=>e.markdown()),__vite__mapDeps([18,2,1,3,4,0,8,12,6,13,7])),markdown:()=>i(()=>import(`./dist-DuvGReu-.js`).then(e=>e.markdown()),__vite__mapDeps([18,2,1,3,4,0,8,12,6,13,7])),mdx:()=>i(()=>import(`./dist-DuvGReu-.js`).then(e=>e.markdown()),__vite__mapDeps([18,2,1,3,4,0,8,12,6,13,7])),rs:()=>i(()=>import(`./dist-BRVQKlcp.js`).then(e=>e.rust()),__vite__mapDeps([19,4,1,0,2,3,6])),go:()=>i(()=>import(`./dist-BJxfd7yb.js`).then(e=>e.go()),__vite__mapDeps([20,4,1,0,2,3,6,8])),sh:()=>s(()=>i(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),bash:()=>s(()=>i(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),zsh:()=>s(()=>i(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),fish:()=>s(()=>i(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),ps1:()=>s(()=>i(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),psm1:()=>s(()=>i(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),rb:()=>s(()=>i(()=>import(`./ruby-ChfNwlCY.js`),[]),`ruby`),swift:()=>s(()=>i(()=>import(`./swift-DKB6_1j6.js`),[]),`swift`),toml:()=>s(()=>i(()=>import(`./toml-BPTmHmyx.js`),[]),`toml`),ini:()=>s(()=>i(()=>import(`./properties-C357ku5U.js`),[]),`properties`),cfg:()=>s(()=>i(()=>import(`./properties-C357ku5U.js`),[]),`properties`),conf:()=>s(()=>i(()=>import(`./properties-C357ku5U.js`),[]),`properties`),properties:()=>s(()=>i(()=>import(`./properties-C357ku5U.js`),[]),`properties`),dockerfile:()=>s(()=>i(()=>import(`./dockerfile-BDePf5PZ.js`),[]),`dockerfile`),diff:()=>s(()=>i(()=>import(`./diff-ChtP43wD.js`),[]),`diff`),patch:()=>s(()=>i(()=>import(`./diff-ChtP43wD.js`),[]),`diff`)},l={cpp:`C++`,cc:`C++`,cxx:`C++`,hpp:`C++`,hh:`C++`,hxx:`C++`,cu:`CUDA C++`,cuh:`CUDA C++`,c:`C`,h:`C/C++ Header`,js:`JavaScript`,jsx:`JSX`,mjs:`JavaScript`,cjs:`JavaScript`,ts:`TypeScript`,tsx:`TSX`,mts:`TypeScript`,cts:`TypeScript`,py:`Python`,pyi:`Python Stub`,java:`Java`,php:`PHP`,sql:`SQL`,yaml:`YAML`,yml:`YAML`,xml:`XML`,json:`JSON`,jsonc:`JSON with Comments`,json5:`JSON5`,css:`CSS`,md:`Markdown`,markdown:`Markdown`,mdx:`MDX`,rs:`Rust`,go:`Go`,html:`HTML`,htm:`HTML`,vue:`Vue`,svelte:`Svelte`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,fish:`Fish`,ps1:`PowerShell`,psm1:`PowerShell`,rb:`Ruby`,swift:`Swift`,toml:`TOML`,ini:`INI`,cfg:`Config`,conf:`Config`,properties:`Properties`,dockerfile:`Dockerfile`,diff:`Diff`,patch:`Patch`};function u(e){return c[e.toLowerCase()]}function d(e){return l[e.toLowerCase()]}var f=t(),p=262144,m=131072;function h(e){return e.split(`.`).pop()?.toLowerCase()??``}function g(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function _(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:g(`--cm-keyword`)},{tag:t.tags.string,color:g(`--cm-string`)},{tag:t.tags.number,color:g(`--cm-number`)},{tag:t.tags.comment,color:g(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:g(`--cm-function`)},{tag:t.tags.typeName,color:g(`--cm-type`)},{tag:t.tags.className,color:g(`--cm-type`)},{tag:t.tags.propertyName,color:g(`--cm-property`)},{tag:t.tags.operator,color:g(`--cm-operator`)},{tag:t.tags.variableName,color:g(`--cm-variable`)}])}function v({path:e,value:t,onChange:n,jumpToLine:s,onSave:c,workspaceId:l,blame:g,onPosition:v,readOnly:y=!1}){let b=(0,o.useRef)(null),x=(0,o.useRef)(null),S=(0,o.useRef)(null),C=(0,o.useRef)(null),w=(0,o.useRef)(null),T=(0,o.useRef)(null),E=(0,o.useRef)(null),D=(0,o.useRef)(null),O=(0,o.useRef)(n),k=(0,o.useRef)(c);O.current=n,k.current=c;let[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)(!1),[P,F]=(0,o.useState)(`0,0`),[I,L]=(0,o.useState)(0);(0,o.useEffect)(()=>{let n=!1,a,o,s,c,l;return(async()=>{try{let d=h(e),f=u(d),[m,g,v,A,M,P,I,R]=await Promise.all([i(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([2,1])),i(()=>import(`./dist-B3-a6uF0.js`).then(e=>e.s),__vite__mapDeps([3,1,2])),i(()=>import(`./dist-CX_Hm4GS.js`),__vite__mapDeps([21,2,1,3,4,0])),i(()=>import(`./dist-scBkrwv-.js`),__vite__mapDeps([22,2,1,3])),i(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([0,1,2,3,4])),i(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${d}:`,e),null)):Promise.resolve(null),r().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null))]);if(n||!b.current)return;c=M,l=P,C.current=m.Annotation.define(),w.current=m.Transaction.addToHistory;let z=t.length<=p&&I!==null;o=new m.Compartment;let B=[g.lineNumbers(),g.highlightActiveLine(),g.drawSelection(),v.history(),g.keymap.of([v.indentWithTab,...v.defaultKeymap,...v.historyKeymap,...A.searchKeymap,{key:`Mod-s`,run:()=>(k.current(),!0)}]),g.EditorView.updateListener.of(e=>{e.docChanged&&!(C.current&&e.transactions.some(e=>e.annotation(C.current)===!0))&&O.current(e.state.doc.toString()),e.selectionSet&&F(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),g.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(y&&B.push(m.EditorState.readOnly.of(!0),g.EditorView.editable.of(!1)),R&&!y&&(s=new m.Compartment,B.splice(1,0,s.of([])),B.push(R.base)),I)try{B.push(I)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${d}:`,e),z=!1}if(z&&o&&c&&l)try{B.push(o.of(c.syntaxHighlighting(_(c,l))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${d}:`,e),z=!1}if(a=new g.EditorView({state:m.EditorState.create({doc:t,extensions:B}),parent:b.current}),n){a.destroy();return}x.current=a,j(z),N(!0),T.current=R,E.current=s??null,D.current=null,L(e=>e+1);let V=new MutationObserver(()=>{let e=x.current;if(e&&z&&o&&c&&l)try{e.dispatch({effects:o.reconfigure(c.syntaxHighlighting(_(c,l)))})}catch{}});S.current=V,V.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||N(!0)}})(),()=>{n=!0,S.current?.disconnect(),S.current=null,a?.destroy(),x.current=null,N(!1),b.current&&(b.current.textContent=``)}},[e,y]),(0,o.useEffect)(()=>{let e=x.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:C.current?C.current.of(!0):void 0})},[t]),(0,o.useEffect)(()=>{let e=x.current;if(!e||!s)return;let t=e.state.doc.line(Math.min(Math.max(1,s.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(s.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},scrollIntoView:!0}),e.focus()},[s,M]);let R=!!(g&&g.state===`ready`&&g.response&&g.path===e&&g.workspaceId===l);(0,o.useEffect)(()=>{let t=x.current,n=T.current,r=E.current;if(!t||!n||!r)return;let i=g&&g.state===`ready`&&g.response&&g.path===e&&g.workspaceId===l?g.response:null,o=i?a(i):null;D.current!==o&&(D.current=o,t.dispatch({effects:[n.setBlame.of(o),r.reconfigure(o?n.gutter:[])]}))},[g?.state,g?.response,g?.path,g?.workspaceId,e,l,I]);let z=x.current?.state.doc.toString()??t,B=z.length<=m?z:z.slice(0,m),V=h(e),H=d(V),U=x.current?.state,W=U?.selection.main.head,G=W===void 0?void 0:U?.doc.lineAt(W),K=G?.number,q=W!==void 0&&G?W-G.from+1:void 0;return(0,o.useEffect)(()=>{M&&K!==void 0&&q!==void 0&&v?.({line:K,column:q,language:A&&H||`纯文本`,highlight:A?V:`plain`})},[M,K,q,A,H,V,v]),(0,o.useEffect)(()=>()=>v?.(),[v]),(0,f.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":B,"data-file-content-truncated":z.length>m?`1`:`0`,"data-file-selection":P,"data-file-editor-ready":M?`1`:`0`,"data-file-blame-gutter":R?`1`:void 0,onMouseDown:()=>x.current?.focus(),children:[(0,f.jsx)(`div`,{className:`file-cm`,ref:b,"aria-label":`${y?`查看`:`编辑`} ${e}`}),(!M||!v)&&(0,f.jsxs)(`div`,{className:`file-editor-status`,children:[!M&&(0,f.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),M&&W!==void 0&&G&&(0,f.jsxs)(`span`,{children:[`第 `,G.number,` 行,第 `,W-G.from+1,` 列`]}),M&&!A&&(0,f.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),M&&A&&H&&(0,f.jsx)(`span`,{"data-file-highlight-status":V,children:H})]})]})}export{v as CodeMirrorEditor,u as t,_ as themeHighlightStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.diff-tailwindcss-wrapper .\!container{width:100%!important}.diff-tailwindcss-wrapper .container{width:100%}@media (width>=640px){.diff-tailwindcss-wrapper .\!container{max-width:640px!important}.diff-tailwindcss-wrapper .container{max-width:640px}}@media (width>=768px){.diff-tailwindcss-wrapper .\!container{max-width:768px!important}.diff-tailwindcss-wrapper .container{max-width:768px}}@media (width>=1024px){.diff-tailwindcss-wrapper .\!container{max-width:1024px!important}.diff-tailwindcss-wrapper .container{max-width:1024px}}@media (width>=1280px){.diff-tailwindcss-wrapper .\!container{max-width:1280px!important}.diff-tailwindcss-wrapper .container{max-width:1280px}}@media (width>=1536px){.diff-tailwindcss-wrapper .\!container{max-width:1536px!important}.diff-tailwindcss-wrapper .container{max-width:1536px}}.diff-tailwindcss-wrapper .invisible{visibility:hidden}.diff-tailwindcss-wrapper .collapse{visibility:collapse}.diff-tailwindcss-wrapper .absolute{position:absolute}.diff-tailwindcss-wrapper .relative{position:relative}.diff-tailwindcss-wrapper .sticky{position:sticky}.diff-tailwindcss-wrapper .left-0{left:0}.diff-tailwindcss-wrapper .left-\[100\%\]{left:100%}.diff-tailwindcss-wrapper .right-\[100\%\]{right:100%}.diff-tailwindcss-wrapper .top-0{top:0}.diff-tailwindcss-wrapper .top-\[50\%\]{top:50%}.diff-tailwindcss-wrapper .z-\[1\]{z-index:1}.diff-tailwindcss-wrapper .ml-\[-1\.5em\]{margin-left:-1.5em}.diff-tailwindcss-wrapper .block{display:block}.diff-tailwindcss-wrapper .inline-block{display:inline-block}.diff-tailwindcss-wrapper .flex{display:flex}.diff-tailwindcss-wrapper .table{display:table}.diff-tailwindcss-wrapper .hidden{display:none}.diff-tailwindcss-wrapper .h-\[50\%\]{height:50%}.diff-tailwindcss-wrapper .h-full{height:100%}.diff-tailwindcss-wrapper .min-h-\[28px\]{min-height:28px}.diff-tailwindcss-wrapper .w-\[1\%\]{width:1%}.diff-tailwindcss-wrapper .w-\[1\.5em\]{width:1.5em}.diff-tailwindcss-wrapper .w-\[1\.5px\]{width:1.5px}.diff-tailwindcss-wrapper .w-\[1px\]{width:1px}.diff-tailwindcss-wrapper .w-\[50\%\]{width:50%}.diff-tailwindcss-wrapper .w-\[8px\]{width:8px}.diff-tailwindcss-wrapper .w-full{width:100%}.diff-tailwindcss-wrapper .w-max{width:max-content}.diff-tailwindcss-wrapper .min-w-\[40px\]{min-width:40px}.diff-tailwindcss-wrapper .min-w-full{min-width:100%}.diff-tailwindcss-wrapper .flex-shrink-0,.diff-tailwindcss-wrapper .shrink-0{flex-shrink:0}.diff-tailwindcss-wrapper .basis-\[50\%\]{flex-basis:50%}.diff-tailwindcss-wrapper .table-fixed{table-layout:fixed}.diff-tailwindcss-wrapper .border-collapse{border-collapse:collapse}.diff-tailwindcss-wrapper .border-spacing-0{--tw-border-spacing-x:0px;--tw-border-spacing-y:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.diff-tailwindcss-wrapper .origin-center{transform-origin:50%}.diff-tailwindcss-wrapper .translate-x-\[-50\%\]{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.diff-tailwindcss-wrapper .translate-x-\[50\%\]{--tw-translate-x:50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.diff-tailwindcss-wrapper .translate-y-\[-50\%\]{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.diff-tailwindcss-wrapper .transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.diff-tailwindcss-wrapper .cursor-pointer{cursor:pointer}.diff-tailwindcss-wrapper .select-none{-webkit-user-select:none;user-select:none}.diff-tailwindcss-wrapper .flex-col{flex-direction:column}.diff-tailwindcss-wrapper .items-start{align-items:flex-start}.diff-tailwindcss-wrapper .items-center{align-items:center}.diff-tailwindcss-wrapper .justify-center{justify-content:center}.diff-tailwindcss-wrapper .overflow-x-auto{overflow-x:auto}.diff-tailwindcss-wrapper .overflow-y-hidden{overflow-y:hidden}.diff-tailwindcss-wrapper .whitespace-nowrap{white-space:nowrap}.diff-tailwindcss-wrapper .break-all{word-break:break-all}.diff-tailwindcss-wrapper .rounded-\[2px\]{border-radius:2px}.diff-tailwindcss-wrapper .rounded-md{border-radius:.375rem}.diff-tailwindcss-wrapper .border-l-\[1px\]{border-left-width:1px}.diff-tailwindcss-wrapper .fill-current{fill:currentColor}.diff-tailwindcss-wrapper .p-0{padding:0}.diff-tailwindcss-wrapper .p-\[1px\]{padding:1px}.diff-tailwindcss-wrapper .px-\[10px\]{padding-left:10px;padding-right:10px}.diff-tailwindcss-wrapper .py-\[2px\]{padding-top:2px;padding-bottom:2px}.diff-tailwindcss-wrapper .py-\[6px\]{padding-top:6px;padding-bottom:6px}.diff-tailwindcss-wrapper .pl-\[1\.5em\]{padding-left:1.5em}.diff-tailwindcss-wrapper .pl-\[10px\]{padding-left:10px}.diff-tailwindcss-wrapper .pl-\[2\.0em\]{padding-left:2em}.diff-tailwindcss-wrapper .pl-\[5px\]{padding-left:5px}.diff-tailwindcss-wrapper .pr-\[10px\]{padding-right:10px}.diff-tailwindcss-wrapper .pr-\[5px\]{padding-right:5px}.diff-tailwindcss-wrapper .text-right{text-align:right}.diff-tailwindcss-wrapper .indent-\[0\.2em\]{text-indent:.2em}.diff-tailwindcss-wrapper .align-top{vertical-align:top}.diff-tailwindcss-wrapper .align-middle{vertical-align:middle}.diff-tailwindcss-wrapper .text-\[1\.2em\]{font-size:1.2em}.diff-tailwindcss-wrapper .leading-\[1\.6\]{line-height:1.6}.diff-tailwindcss-wrapper .\!text-red-500{--tw-text-opacity:1!important;color:rgb(239 68 68/var(--tw-text-opacity,1))!important}.diff-tailwindcss-wrapper .opacity-\[0\.5\]{opacity:.5}.diff-tailwindcss-wrapper .transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.diff-tailwindcss-wrapper *{box-sizing:border-box}.diff-tailwindcss-wrapper[data-theme=light] .diff-style-root{--diff-border--:#dedede;--diff-add-content--:#dafbe1;--diff-del-content--:#ffebe9;--diff-add-lineNumber--:#aceebb;--diff-del-lineNumber--:#ffcecb;--diff-plain-content--:#fff;--diff-expand-content--:#fafafa;--diff-plain-lineNumber--:#fafafa;--diff-expand-lineNumber--:#fafafa;--diff-plain-lineNumber-color--:#555;--diff-expand-lineNumber-color--:#555;--diff-hunk-content--:#ddf4ff;--diff-hunk-lineNumber--:#b6e3ff;--diff-hunk-lineNumber-hover--:#0969da;--diff-add-content-highlight--:#aceebb;--diff-del-content-highlight--:#ffcecb;--diff-add-widget--:#0969d2;--diff-add-widget-color--:#fff;--diff-empty-content--:#fafafa;--diff-hunk-content-color--:#777}.diff-tailwindcss-wrapper .diff-style-root .diff-line-syntax-raw *,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw *{color:var(--diff-view-light,inherit);font-weight:var(--diff-view-light-font-weight,inherit)}.diff-tailwindcss-wrapper[data-theme=dark] .diff-style-root{--diff-border--:#3d444d;--diff-add-content--:#18271f;--diff-del-content--:#23191c;--diff-add-lineNumber--:#284228;--diff-del-lineNumber--:#4f2828;--diff-plain-content--:#0d1117;--diff-expand-content--:#161b22;--diff-plain-lineNumber--:#161b22;--diff-expand-lineNumber--:#161b22;--diff-plain-lineNumber-color--:#a0aaab;--diff-expand-lineNumber-color--:#a0aaab;--diff-hunk-content--:#131d2e;--diff-hunk-lineNumber--:#0c2d6b;--diff-hunk-lineNumber-hover--:#1f6feb;--diff-add-content-highlight--:#2f5732;--diff-del-content-highlight--:#713431;--diff-add-widget--:#0969d2;--diff-add-widget-color--:#fff;--diff-empty-content--:#161b22;--diff-hunk-content-color--:#9298a0}.diff-tailwindcss-wrapper[data-theme=dark] [data-state=diff],.diff-tailwindcss-wrapper[data-theme=dark] [data-state=plain],.diff-tailwindcss-wrapper[data-theme=dark] [data-state=hunk]{color:#fff}.diff-tailwindcss-wrapper[data-theme=light] [data-state=diff],.diff-tailwindcss-wrapper[data-theme=light] [data-state=plain],.diff-tailwindcss-wrapper[data-theme=light] [data-state=hunk]{color:#000}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw *{color:var(--diff-view-dark,inherit);font-weight:var(--diff-view-dark-font-weight,inherit)}.diff-tailwindcss-wrapper table,.diff-tailwindcss-wrapper tr,.diff-tailwindcss-wrapper td{text-align:left;border-width:0;border-color:#0000}.diff-tailwindcss-wrapper td{padding:0}.diff-tailwindcss-wrapper .diff-line-old-num,.diff-tailwindcss-wrapper .diff-line-new-num,.diff-tailwindcss-wrapper .diff-line-num{text-align:right}.diff-tailwindcss-wrapper .diff-style-root tr{content-visibility:auto}.diff-tailwindcss-wrapper .diff-add-widget-wrapper{transform-origin:50%;transform:translate(-50%)!important}.diff-tailwindcss-wrapper .diff-line-old-content .diff-add-widget-wrapper,.diff-tailwindcss-wrapper .diff-line-new-content .diff-add-widget-wrapper{transform:translate(50%)!important}.diff-tailwindcss-wrapper .diff-add-widget-wrapper:hover{transform:translate(-50%)scale(1.1)!important}.diff-tailwindcss-wrapper .diff-line-old-content .diff-add-widget-wrapper:hover,.diff-tailwindcss-wrapper .diff-line-new-content .diff-add-widget-wrapper:hover{transform:translate(50%)scale(1.1)!important}.diff-tailwindcss-wrapper .diff-widget-tooltip{position:relative}.diff-tailwindcss-wrapper .diff-add-widget,.diff-tailwindcss-wrapper .diff-widget-tooltip{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-transform:none;background-color:#0000;background-image:none;border-width:0;margin:0}.diff-tailwindcss-wrapper .diff-widget-tooltip:after{box-sizing:border-box;content:attr(data-title);white-space:nowrap;color:#fff;background-color:#555;border-radius:4px;padding:1px 2px;font-size:11px;display:none;position:absolute;top:50%;left:calc(100% + 8px);overflow:hidden;transform:translateY(-50%)}.diff-tailwindcss-wrapper .diff-widget-tooltip:before{box-sizing:border-box;content:"";border:6px solid #0000;border-right-color:#555;display:none;position:absolute;top:50%;left:calc(100% - 2px);transform:translateY(-50%)}.diff-tailwindcss-wrapper .diff-widget-tooltip:hover{background-color:var(--diff-hunk-lineNumber-hover--);color:#fff}.diff-tailwindcss-wrapper .diff-widget-tooltip:hover:before,.diff-tailwindcss-wrapper .diff-widget-tooltip:hover:after{display:block}.diff-line-extend-wrapper,.diff-line-widget-wrapper{display:flow-root}.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num{z-index:2}.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content{position:relative}.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num:after,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num:after,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num:after{content:"";z-index:1;opacity:.15;background-color:var(--diff-multi-select-bg,#f0c000);pointer-events:none;position:absolute;inset:0}.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num:before,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num:before,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num:before{content:"";z-index:2;background-color:var(--diff-multi-select-border,#2588fa);width:4px;position:absolute;top:0;bottom:0;right:-2px}.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content:after,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content:after,.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content:after{content:"";z-index:1;opacity:.15;background-color:var(--diff-multi-select-bg,#f0c000);pointer-events:none;position:absolute;inset:0}.diff-multi-selecting .diff-line-old-num,.diff-multi-selecting .diff-line-new-num,.diff-multi-selecting .diff-line-num,.diff-multi-selecting .diff-line-old-content,.diff-multi-selecting .diff-line-new-content,.diff-multi-selecting .diff-line-content,.diff-multi-selecting,.diff-multi-selecting *{-webkit-user-select:none;user-select:none}.diff-multi-selecting .diff-add-widget-wrapper{display:none}.diff-multiselect-wrapper .diff-add-widget-wrapper{z-index:10!important}.diff-tailwindcss-wrapper .diff-line-new-num span[data-line-num],.diff-tailwindcss-wrapper .diff-line-old-num span[data-line-num]{pointer-events:none}.diff-multiselect-wrapper .diff-line-old-num,.diff-multiselect-wrapper .diff-line-new-num,.diff-multiselect-wrapper .diff-line-num{cursor:pointer}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw pre code.hljs{padding:1em;display:block;overflow-x:auto}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw code.hljs{padding:3px 5px}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs{color:#24292e;background:#fff}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-doctag,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-keyword,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-meta .hljs-keyword,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-template-tag,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-template-variable,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-type,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-variable.language_{color:#d73a49}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-title,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-title.class_,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-title.class_.inherited__,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-title.function_{color:#6f42c1}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-attr,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-attribute,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-literal,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-meta,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-number,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-operator,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-variable,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-selector-attr,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-selector-class,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-selector-id{color:#005cc5}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-regexp,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-string,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-meta .hljs-string{color:#032f62}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-built_in,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-symbol{color:#e36209}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-comment,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-code,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-formula{color:#6a737d}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-name,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-quote,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-selector-tag,.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-selector-pseudo{color:#22863a}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-subst{color:#24292e}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-section{color:#005cc5;font-weight:700}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-bullet{color:#735c0f}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-emphasis{color:#24292e;font-style:italic}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-strong{color:#24292e;font-weight:700}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-addition{color:#22863a;background-color:#f0fff4}.diff-tailwindcss-wrapper[data-theme=light] .diff-line-syntax-raw .hljs-deletion{color:#b31d28;background-color:#ffeef0}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw pre code.hljs{padding:1em;display:block;overflow-x:auto}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw code.hljs{padding:3px 5px}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs{color:#c9d1d9;background:#0d1117}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-doctag,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-keyword,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-meta .hljs-keyword,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-template-tag,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-template-variable,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-type,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-variable.language_{color:#ff7b72}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-title,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-title.class_,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-title.class_.inherited__,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-title.function_{color:#d2a8ff}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-attr,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-attribute,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-literal,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-meta,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-number,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-operator,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-variable,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-selector-attr,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-selector-class,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-selector-id{color:#79c0ff}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-regexp,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-string,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-meta .hljs-string{color:#a5d6ff}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-built_in,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-symbol{color:#ffa657}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-comment,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-code,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-formula{color:#8b949e}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-name,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-quote,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-selector-tag,.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-selector-pseudo{color:#7ee787}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-subst{color:#c9d1d9}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-section{color:#1f6feb;font-weight:700}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-bullet{color:#f2cc60}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-emphasis{color:#c9d1d9;font-style:italic}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-strong{color:#c9d1d9;font-weight:700}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-addition{color:#aff5b4;background-color:#033a16}.diff-tailwindcss-wrapper[data-theme=dark] .diff-line-syntax-raw .hljs-deletion{color:#ffdcd7;background-color:#67060c}.diff-tailwindcss-wrapper .hover\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.diff-tailwindcss-wrapper .group:hover .group-hover\:visible{visibility:visible}
|