@xiaoso/dsh-tool-plus 0.1.0-beta.5 → 0.1.0-beta.6
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.en.md +1 -1
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +42 -42
- package/lib/{abort-dIkZBV7Q.mjs → abort-CsjZitYv.mjs} +1 -1
- package/lib/{amazon-bedrock-WQhvjHYu.mjs → amazon-bedrock-CfNIDi5k.mjs} +7 -7
- package/lib/{anthropic-CJCauvYz.mjs → anthropic-BVfZdnMp.mjs} +12 -12
- package/lib/{anthropic-tTntD8BD.mjs → anthropic-DGXmmg43.mjs} +2 -2
- package/lib/{api-key-login-BzqNdM2y.mjs → api-key-login-BikQAfD-.mjs} +1 -1
- package/lib/{aws-credentials-CXryMobh.mjs → aws-credentials-DrssNMn_.mjs} +4 -4
- package/lib/{azure-openai-responses-DuukbD0F.mjs → azure-openai-responses-C-5q-5K2.mjs} +8 -8
- package/lib/browser-render-z6b8Ljo9.mjs +183 -0
- package/lib/{bundled-references-Cavaffah.mjs → bundled-references-D71z7_T3.mjs} +2 -2
- package/lib/{callback-server-CQ5Jo8F-.mjs → callback-server-Di6C4RqI.mjs} +1 -1
- package/lib/client.js +327 -4
- package/lib/{cursor-B6TUEmgP.mjs → cursor-CQQtygwl.mjs} +1 -1
- package/lib/{cursor-DkSX2h3H.mjs → cursor-DXJxwdcg.mjs} +7 -7
- package/lib/{cursor-aJrXeYCb.mjs → cursor-Hr5Zw1gt.mjs} +3 -3
- package/lib/{device-code-DBo3B5nh.mjs → device-code-wZUbgPdB.mjs} +1 -1
- package/lib/{devin-BHZZyMhO.mjs → devin-CF6UhCFw.mjs} +2 -2
- package/lib/{devin-BK7DHeca.mjs → devin-DXJoDlW2.mjs} +1 -1
- package/lib/{devin-vNZTNUON.mjs → devin-P37gURs_.mjs} +5 -5
- package/lib/{dom-DGdYAVTv.mjs → dom-CawWi8fa.mjs} +14 -1
- package/lib/{error-Dd8DIqs-.mjs → error-DoHuatWw.mjs} +1 -1
- package/lib/{event-stream-BbFZJy-z.mjs → event-stream-C-FmBYUt.mjs} +1 -1
- package/lib/{github-copilot-CYkjeTi3.mjs → github-copilot-C2dTonBX.mjs} +3 -3
- package/lib/{github-copilot-B1yiyVRh.mjs → github-copilot-qETlj_bD.mjs} +1 -1
- package/lib/{gitlab-duo-CM7Ref1H.mjs → gitlab-duo-FQZiFRQe.mjs} +3 -3
- package/lib/{gitlab-duo-workflow-BGAF6JDw.mjs → gitlab-duo-workflow-DLTabzOy.mjs} +2 -2
- package/lib/{google-BS4T25Pn.mjs → google-BilwFSzx.mjs} +3 -3
- package/lib/{google-antigravity-DGmwC2KV.mjs → google-antigravity-BfBiINdu.mjs} +2 -2
- package/lib/{google-auth-B6gjsZvg.mjs → google-auth-CWlKXJ-H.mjs} +3 -3
- package/lib/{google-gemini-cli-Dsztq0N5.mjs → google-gemini-cli-CB89ljNz.mjs} +3 -3
- package/lib/{google-gemini-cli-Cqds_Q5T.mjs → google-gemini-cli-CygFcR6N.mjs} +8 -8
- package/lib/{google-oauth-shared-CuEHaDDj.mjs → google-oauth-shared-Cn82h1o2.mjs} +2 -2
- package/lib/{google-shared-Dr-VG-ap.mjs → google-shared-CF1JrqTM.mjs} +6 -6
- package/lib/{google-vertex-BDN2tLaD.mjs → google-vertex-DgMhhFw8.mjs} +5 -5
- package/lib/{identity-Da1GPU9a.mjs → identity-C0SPVyIZ.mjs} +1 -1
- package/lib/{idle-iterator-DUjKQEGT.mjs → idle-iterator-HzbbfXP4.mjs} +2 -2
- package/lib/index.mjs +310 -29
- package/lib/{kimi-Dh0pv3WZ.mjs → kimi-DHDO6Fde.mjs} +3 -3
- package/lib/launch-DwpE70Pv.mjs +148 -0
- package/lib/{markit-BL3cH47U.mjs → markit-B9exZ0ZV.mjs} +1 -1
- package/lib/{minimax-code-Uq8Qu9LW.mjs → minimax-code-vAhEXhev.mjs} +1 -1
- package/lib/{models-SGASygJ3.mjs → models-Cp3PzU3l.mjs} +1 -1
- package/lib/{ollama-DPzBmq89.mjs → ollama-TrkXTNqE.mjs} +8 -8
- package/lib/{openai-codex-Ch8CkT3p.mjs → openai-codex-CrjHtSH4.mjs} +3 -3
- package/lib/{openai-codex-responses-pejZgdZo.mjs → openai-codex-responses-C4uMpWNy.mjs} +10 -10
- package/lib/{openai-completions-DIf361kF.mjs → openai-completions-1ydXm5vF.mjs} +13 -13
- package/lib/{openai-reasoning-fallback-Nj6yB2rY.mjs → openai-reasoning-fallback-CigKCyzc.mjs} +2 -2
- package/lib/{openai-responses-Db_a-U4-.mjs → openai-responses-CN79gRGQ.mjs} +10 -10
- package/lib/{opencode-Rq_Q2vAO.mjs → opencode-CEGlimzL.mjs} +1 -1
- package/lib/{perplexity-C4iLVMUj.mjs → perplexity-BLJN-8dM.mjs} +2 -2
- package/lib/{proxy-pM_NIv-H.mjs → proxy-XOYi58TM.mjs} +1 -1
- package/lib/readability-Cpm-ocau.mjs +455 -0
- package/lib/{scrapers-1FTlHNQV.mjs → scrapers-BlWQMGjU.mjs} +11 -10
- package/lib/{src-BgpusnsB.mjs → src-D_e1qMwi.mjs} +5 -1
- package/lib/{stream-CRtexYLe.mjs → stream-DveNFWSN.mjs} +56 -56
- package/lib/{stream-markup-healing-KMkiAA00.mjs → stream-markup-healing-C9eC7Gf8.mjs} +3 -3
- package/lib/tool-errors-DoyxivAR.mjs +47 -0
- package/lib/types-BUO0JXO-.mjs +251 -0
- package/lib/{utils-D2YknRk4.mjs → utils-B-mTYQBc.mjs} +1 -1
- package/lib/{utils-C616y7eF.mjs → utils-D1QPFbRk.mjs} +28 -268
- package/lib/{utils-Cp76gCyk.mjs → utils-fnV2zzp3.mjs} +3 -3
- package/lib/{vision-guard-01qSwFpf.mjs → vision-guard-BsvOWmfB.mjs} +2 -2
- package/lib/{wafer-CgtPHerf.mjs → wafer-Dpy7tL3l.mjs} +1 -1
- package/lib/{xai-oauth-Buk8XVvM.mjs → xai-oauth-BkPNQS-q.mjs} +2 -2
- package/lib/{xiaomi-D2qT5cAC.mjs → xiaomi-CG3TsYRz.mjs} +1 -1
- package/lib/{zai-C59YnomG.mjs → zai--cewobzN.mjs} +2 -2
- package/lib/{zip-Cg9ANN_U.mjs → zip-CqKW2-TK.mjs} +3 -46
- package/package.json +147 -145
- package/presets/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -9,7 +9,7 @@ Essential tools enhancement for DeepSeek Harness: persistent bash, structured re
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- **bash**: persistent shell; `cd` and `export` keep state across calls; verbose logs (git/npm/cargo…) are condensed automatically; overlong output keeps only head and tail, with the full content written to disk for later retrieval; long-running commands are moved to the background automatically; optionally intercepts `cat`, `grep`, `find`, and `sed -i` to steer you toward the dedicated tools
|
|
12
|
-
- **read**: precise line-range reading (supports `:N-M`, `:raw`, and multiple ranges); large code files return a structural summary by default, with details expanded on demand; zip/tar archives, SQLite, notebooks, and PDFs read directly; PNG / JPEG / WebP / GIF images read directly, oversized ones scaled down automatically; can fetch web content (including images embedded in the page)
|
|
12
|
+
- **read**: precise line-range reading (supports `:N-M`, `:raw`, and multiple ranges); large code files return a structural summary by default, with details expanded on demand; zip/tar archives, SQLite, notebooks, and PDFs read directly; PNG / JPEG / WebP / GIF images read directly, oversized ones scaled down automatically; can fetch web content (including images embedded in the page); SPA sites (content rendered dynamically by JS, e.g. excalidraw.com) are automatically fetched via local browser rendering
|
|
13
13
|
- **write**: atomic writes that return a diff of the changes; supports patch-style writing, and can write directly into zip/tar archive members and SQLite data
|
|
14
14
|
- **edit**: `replace` by default, with patch / hashline / apply-patch formats also supported; multi-hunk edits, uniqueness validation, fuzzy matching tolerant of whitespace differences
|
|
15
15
|
- **grep / glob**: full-text search and filename matching; mtime sorting, context lines, and configurable ignore rules
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ DeepSeek Harness 基础工具增强:持久 bash、结构化 read、多模式 e
|
|
|
9
9
|
## 功能特性
|
|
10
10
|
|
|
11
11
|
- **bash**:持久 shell,`cd`、`export` 跨调用保持状态;冗长日志(git/npm/cargo…)自动压缩;超长输出只保留头尾,完整内容落盘可回读;长命令自动转后台;可选拦截 `cat`、`grep`、`find`、`sed -i`,引导改用专用工具
|
|
12
|
-
- **read**:按行区间精准读取(支持 `:N-M`、`:raw`、多区间);大代码文件默认返回结构摘要,细节按需展开;zip/tar 归档、SQLite、notebook、PDF 直接读;PNG / JPEG / WebP / GIF
|
|
12
|
+
- **read**:按行区间精准读取(支持 `:N-M`、`:raw`、多区间);大代码文件默认返回结构摘要,细节按需展开;zip/tar 归档、SQLite、notebook、PDF 直接读;PNG / JPEG / WebP / GIF 图片直读,超大图自动缩放;可抓取网页内容(含网页内图片);SPA 站点(内容由 JS 动态渲染,如 excalidraw.com)自动改用本机浏览器渲染后抓取
|
|
13
13
|
- **write**:原子写入,返回修改 diff;支持补丁式写入,可直接写 zip/tar 归档成员与 SQLite 数据
|
|
14
14
|
- **edit**:replace 默认,另支持 patch / hashline / apply-patch 三种补丁格式;多段编辑、唯一性校验、空白差异模糊匹配
|
|
15
15
|
- **grep / glob**:全文搜索与文件名匹配;mtime 排序、上下文行、忽略规则可配置
|
|
@@ -91,7 +91,7 @@ npx @xiaoso/dsh-tool-plus-presets@beta
|
|
|
91
91
|
|
|
92
92
|
## 配置
|
|
93
93
|
|
|
94
|
-
开箱即用,无需配置。需要微调时常用项有:后台阈值(`autoBackgroundMs`)、超时(`defaultTimeoutMs` / `maxTimeoutMs`)、输出截断窗口、编辑默认模式(`editMode`,默认 `replace`)、结构化摘要开关(`readSummarizeEnabled
|
|
94
|
+
开箱即用,无需配置。需要微调时常用项有:后台阈值(`autoBackgroundMs`)、超时(`defaultTimeoutMs` / `maxTimeoutMs`)、输出截断窗口、编辑默认模式(`editMode`,默认 `replace`)、结构化摘要开关(`readSummarizeEnabled`)。抓取相关:可切换网页转 Markdown 的后端(`fetchReader`,含浏览器 JS 渲染——SPA 页面),设置面板里可一键「探测浏览器」查看本机可用的 Chrome/Edge。
|
|
95
95
|
|
|
96
96
|
## 环境要求
|
|
97
97
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# Third-Party Notices
|
|
2
|
-
|
|
3
|
-
This project contains code adapted from the upstream project
|
|
4
|
-
[oh-my-pi](https://github.com/can1357/oh-my-pi).
|
|
5
|
-
|
|
6
|
-
Scope of ported upstream code:
|
|
7
|
-
|
|
8
|
-
- from **oh-my-pi** (MIT, notice below): the tool suite sources under
|
|
9
|
-
`src/tools/` (bash runtime, read, write, edit, grep, glob, plus the OMP
|
|
10
|
-
`omp/` engine sources they wrap), and the hashline patch engine fused
|
|
11
|
-
in-repo at `src/tools/hashline/engine/` (upstream `packages/hashline`,
|
|
12
|
-
with small Node-runtime adaptations).
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
oh-my-pi - MIT
|
|
17
|
-
|
|
18
|
-
-- License
|
|
19
|
-
|
|
20
|
-
(The MIT License)
|
|
21
|
-
|
|
22
|
-
Copyright (c) 2025 Mario Zechner
|
|
23
|
-
Copyright (c) 2025-2026 Can Bölük
|
|
24
|
-
|
|
25
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
26
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
27
|
-
in the Software without restriction, including without limitation the rights
|
|
28
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
29
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
30
|
-
furnished to do so, subject to the following conditions:
|
|
31
|
-
|
|
32
|
-
The above copyright notice and this permission notice shall be included in all
|
|
33
|
-
copies or substantial portions of the Software.
|
|
34
|
-
|
|
35
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
37
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
38
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
39
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
40
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
41
|
-
SOFTWARE.
|
|
42
|
-
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
This project contains code adapted from the upstream project
|
|
4
|
+
[oh-my-pi](https://github.com/can1357/oh-my-pi).
|
|
5
|
+
|
|
6
|
+
Scope of ported upstream code:
|
|
7
|
+
|
|
8
|
+
- from **oh-my-pi** (MIT, notice below): the tool suite sources under
|
|
9
|
+
`src/tools/` (bash runtime, read, write, edit, grep, glob, plus the OMP
|
|
10
|
+
`omp/` engine sources they wrap), and the hashline patch engine fused
|
|
11
|
+
in-repo at `src/tools/hashline/engine/` (upstream `packages/hashline`,
|
|
12
|
+
with small Node-runtime adaptations).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
oh-my-pi - MIT
|
|
17
|
+
|
|
18
|
+
-- License
|
|
19
|
+
|
|
20
|
+
(The MIT License)
|
|
21
|
+
|
|
22
|
+
Copyright (c) 2025 Mario Zechner
|
|
23
|
+
Copyright (c) 2025-2026 Can Bölük
|
|
24
|
+
|
|
25
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
26
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
27
|
+
in the Software without restriction, including without limitation the rights
|
|
28
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
29
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
30
|
+
furnished to do so, subject to the following conditions:
|
|
31
|
+
|
|
32
|
+
The above copyright notice and this permission notice shall be included in all
|
|
33
|
+
copies or substantial portions of the Software.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
37
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
38
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
39
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
40
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
41
|
+
SOFTWARE.
|
|
42
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { v as AbortError } from "./error-
|
|
3
|
+
import { v as AbortError } from "./error-DoHuatWw.mjs";
|
|
4
4
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/utils/abort.ts
|
|
5
5
|
/**
|
|
6
6
|
* Tracks whether a merged request signal was aborted by the caller or by provider-local logic.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { I as $flag, _ as parseStreamingJsonThrottled, g as parseStreamingJson } from "./src-
|
|
4
|
-
import { G as fetchWithRetry, I as BedrockApiError, U as EventStreamFrameError, l as finalize, r as ValidationError, v as AbortError } from "./error-
|
|
5
|
-
import { C as kStreamingPartialJson, S as kStreamingLastParseLen, a as normalizeSystemPrompts, h as clearStreamingPartialJson, k as toolWireSchema, m as transformMessages, o as normalizeToolCallId, s as resolveCacheRetention, w as renderDemotedThinking, y as kStreamingBlockIndex } from "./utils-
|
|
6
|
-
import { i as resolveAwsBearerToken, n as resolveAwsCredentials, r as signRequest, s as resolveAwsAmbientRegion, t as invalidateAwsCredentialCache } from "./aws-credentials-
|
|
7
|
-
import { o as mapEffortToAnthropicAdaptiveEffort, s as requireSupportedEffort, t as calculateCost } from "./models-
|
|
8
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
9
|
-
import { i as getStreamFirstEventTimeoutMs, t as armPreResponseTimeout } from "./idle-iterator-
|
|
3
|
+
import { I as $flag, _ as parseStreamingJsonThrottled, g as parseStreamingJson } from "./src-D_e1qMwi.mjs";
|
|
4
|
+
import { G as fetchWithRetry, I as BedrockApiError, U as EventStreamFrameError, l as finalize, r as ValidationError, v as AbortError } from "./error-DoHuatWw.mjs";
|
|
5
|
+
import { C as kStreamingPartialJson, S as kStreamingLastParseLen, a as normalizeSystemPrompts, h as clearStreamingPartialJson, k as toolWireSchema, m as transformMessages, o as normalizeToolCallId, s as resolveCacheRetention, w as renderDemotedThinking, y as kStreamingBlockIndex } from "./utils-fnV2zzp3.mjs";
|
|
6
|
+
import { i as resolveAwsBearerToken, n as resolveAwsCredentials, r as signRequest, s as resolveAwsAmbientRegion, t as invalidateAwsCredentialCache } from "./aws-credentials-DrssNMn_.mjs";
|
|
7
|
+
import { o as mapEffortToAnthropicAdaptiveEffort, s as requireSupportedEffort, t as calculateCost } from "./models-Cp3PzU3l.mjs";
|
|
8
|
+
import { t as AssistantMessageEventStream } from "./event-stream-C-FmBYUt.mjs";
|
|
9
|
+
import { i as getStreamFirstEventTimeoutMs, t as armPreResponseTimeout } from "./idle-iterator-HzbbfXP4.mjs";
|
|
10
10
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/providers/aws-eventstream.ts
|
|
11
11
|
/**
|
|
12
12
|
* `application/vnd.amazon.eventstream` decoder.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
3
|
import { r as __exportAll } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
|
-
import { P as $env, S as debug, T as warn, _ as parseStreamingJsonThrottled, a as readSseEvents, h as parseJsonWithRepair, q as getInstallId, y as isEnoent } from "./src-
|
|
5
|
-
import { A as isTransientStreamParseError, D as isFastModeUnsupported, E as isCopilotTransientModelError, F as AnthropicStreamEnvelopeError, M as AnthropicApiError, N as AnthropicConnectionError, O as isGrammarError, P as AnthropicConnectionTimeoutError, a as isTransientStatus, f as getHeadersFromError, i as isProviderRetryableError$1, k as isStreamEnvelopeError, l as finalize, n as StreamTimeoutError, p as getRetryAfterMsFromHeaders, r as ValidationError, s as ProviderResponseError, t as ConfigurationError, u as finalizeErrorMessage, v as AbortError } from "./error-
|
|
6
|
-
import { A as NO_STRICT, C as kStreamingPartialJson, R as spillToDescription, S as kStreamingLastParseLen, a as normalizeSystemPrompts, h as clearStreamingPartialJson, k as toolWireSchema, m as transformMessages, o as normalizeToolCallId, s as resolveCacheRetention, w as renderDemotedThinking, y as kStreamingBlockIndex, z as COMBINATOR_KEYS } from "./utils-
|
|
4
|
+
import { P as $env, S as debug, T as warn, _ as parseStreamingJsonThrottled, a as readSseEvents, h as parseJsonWithRepair, q as getInstallId, y as isEnoent } from "./src-D_e1qMwi.mjs";
|
|
5
|
+
import { A as isTransientStreamParseError, D as isFastModeUnsupported, E as isCopilotTransientModelError, F as AnthropicStreamEnvelopeError, M as AnthropicApiError, N as AnthropicConnectionError, O as isGrammarError, P as AnthropicConnectionTimeoutError, a as isTransientStatus, f as getHeadersFromError, i as isProviderRetryableError$1, k as isStreamEnvelopeError, l as finalize, n as StreamTimeoutError, p as getRetryAfterMsFromHeaders, r as ValidationError, s as ProviderResponseError, t as ConfigurationError, u as finalizeErrorMessage, v as AbortError } from "./error-DoHuatWw.mjs";
|
|
6
|
+
import { A as NO_STRICT, C as kStreamingPartialJson, R as spillToDescription, S as kStreamingLastParseLen, a as normalizeSystemPrompts, h as clearStreamingPartialJson, k as toolWireSchema, m as transformMessages, o as normalizeToolCallId, s as resolveCacheRetention, w as renderDemotedThinking, y as kStreamingBlockIndex, z as COMBINATOR_KEYS } from "./utils-fnV2zzp3.mjs";
|
|
7
7
|
import { n as isRecord } from "./type-guards-B9VVjRDK.mjs";
|
|
8
|
-
import { Ct as withEmptyCompletionRetry, K as getOpenAIPromptCacheKey, _t as isForcedToolChoice, gt as resolveGitHubCopilotBaseUrl, ht as hasCopilotVisionInput, mt as buildCopilotDynamicHeaders, n as getEnvApiKey, t as OUTPUT_FALLBACK_BUFFER, wt as isFoundryEnabled } from "./stream-
|
|
9
|
-
import { t as createAbortSourceTracker } from "./abort-
|
|
10
|
-
import { N as isVertexRawPredictUrl, f as isAnthropicSigningProxyUrl, j as hostMatchesUrl, n as getBundledModel, o as mapEffortToAnthropicAdaptiveEffort, p as isOfficialAnthropicApiUrl, t as calculateCost } from "./models-
|
|
11
|
-
import { r as isAnthropicOAuthToken } from "./utils-
|
|
12
|
-
import { u as parseGitHubCopilotApiKey } from "./github-copilot-
|
|
13
|
-
import { t as NON_VISION_IMAGE_PLACEHOLDER } from "./vision-guard-
|
|
14
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
15
|
-
import { a as coworkUserAgent, i as claudeCodeVersion, n as CLAUDE_CODE_MAX_OUTPUT_TOKENS, r as claudeCodeSystemInstruction } from "./anthropic-
|
|
16
|
-
import { a as getStreamIdleTimeoutMs, i as getStreamFirstEventTimeoutMs, o as iterateWithIdleTimeout } from "./idle-iterator-
|
|
8
|
+
import { Ct as withEmptyCompletionRetry, K as getOpenAIPromptCacheKey, _t as isForcedToolChoice, gt as resolveGitHubCopilotBaseUrl, ht as hasCopilotVisionInput, mt as buildCopilotDynamicHeaders, n as getEnvApiKey, t as OUTPUT_FALLBACK_BUFFER, wt as isFoundryEnabled } from "./stream-DveNFWSN.mjs";
|
|
9
|
+
import { t as createAbortSourceTracker } from "./abort-CsjZitYv.mjs";
|
|
10
|
+
import { N as isVertexRawPredictUrl, f as isAnthropicSigningProxyUrl, j as hostMatchesUrl, n as getBundledModel, o as mapEffortToAnthropicAdaptiveEffort, p as isOfficialAnthropicApiUrl, t as calculateCost } from "./models-Cp3PzU3l.mjs";
|
|
11
|
+
import { r as isAnthropicOAuthToken } from "./utils-B-mTYQBc.mjs";
|
|
12
|
+
import { u as parseGitHubCopilotApiKey } from "./github-copilot-qETlj_bD.mjs";
|
|
13
|
+
import { t as NON_VISION_IMAGE_PLACEHOLDER } from "./vision-guard-BsvOWmfB.mjs";
|
|
14
|
+
import { t as AssistantMessageEventStream } from "./event-stream-C-FmBYUt.mjs";
|
|
15
|
+
import { a as coworkUserAgent, i as claudeCodeVersion, n as CLAUDE_CODE_MAX_OUTPUT_TOKENS, r as claudeCodeSystemInstruction } from "./anthropic-DGXmmg43.mjs";
|
|
16
|
+
import { a as getStreamIdleTimeoutMs, i as getStreamFirstEventTimeoutMs, o as iterateWithIdleTimeout } from "./idle-iterator-HzbbfXP4.mjs";
|
|
17
17
|
import { t as notifyProviderResponse } from "./provider-response-C6vcbQyO.mjs";
|
|
18
18
|
import { t as notifyRawSseEvent } from "./sse-debug-CYdjOC96.mjs";
|
|
19
19
|
import * as fs from "node:fs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
3
|
import { r as __exportAll } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
|
-
import { V as ProviderHttpError, c as OAuthError } from "./error-
|
|
5
|
-
import { t as OAuthCallbackFlow } from "./callback-server-
|
|
4
|
+
import { V as ProviderHttpError, c as OAuthError } from "./error-DoHuatWw.mjs";
|
|
5
|
+
import { t as OAuthCallbackFlow } from "./callback-server-Di6C4RqI.mjs";
|
|
6
6
|
import { t as generatePKCE } from "./pkce-BlQikGPu.mjs";
|
|
7
7
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/providers/claude-code-fingerprint.ts
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { V as ProviderHttpError, _ as OnPromptRequiredError, h as LoginCancelledError, m as ApiKeyRequiredError } from "./error-
|
|
3
|
+
import { V as ProviderHttpError, _ as OnPromptRequiredError, h as LoginCancelledError, m as ApiKeyRequiredError } from "./error-DoHuatWw.mjs";
|
|
4
4
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/registry/api-key-validation.ts
|
|
5
5
|
const VALIDATION_TIMEOUT_MS = 15e3;
|
|
6
6
|
function normalizeAnthropicCompatibleBaseUrl(baseUrl) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { I as $flag, P as $env, S as debug, y as isEnoent } from "./src-
|
|
4
|
-
import { H as AwsCredentialsError } from "./error-
|
|
5
|
-
import { n as raceWithSignal } from "./abort-
|
|
6
|
-
import { i as isLocalOrMetadataHost } from "./proxy-
|
|
3
|
+
import { I as $flag, P as $env, S as debug, y as isEnoent } from "./src-D_e1qMwi.mjs";
|
|
4
|
+
import { H as AwsCredentialsError } from "./error-DoHuatWw.mjs";
|
|
5
|
+
import { n as raceWithSignal } from "./abort-CsjZitYv.mjs";
|
|
6
|
+
import { i as isLocalOrMetadataHost } from "./proxy-XOYi58TM.mjs";
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
import * as fs from "node:fs";
|
|
9
9
|
import * as os from "node:os";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
3
|
import { r as __exportAll } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
|
-
import { P as $env } from "./src-
|
|
5
|
-
import { B as OpenAIHttpError, g as MissingApiKeyError, l as finalize, n as StreamTimeoutError, s as ProviderResponseError, t as ConfigurationError, v as AbortError } from "./error-
|
|
6
|
-
import { L as sanitizeSchemaForOpenAIResponses, k as toolWireSchema, s as resolveCacheRetention } from "./utils-
|
|
7
|
-
import { C as applyResponsesReasoningParams, D as buildResponsesInput, K as getOpenAIPromptCacheKey, N as createInitialResponsesAssistantMessage, Q as isOpenAIResponsesProgressEvent, g as applyCommonResponsesSamplingParams, it as parseAzureDeploymentNameMap, n as getEnvApiKey, ot as processResponsesStream, yt as mapToOpenAIResponsesToolChoice } from "./stream-
|
|
8
|
-
import { t as createAbortSourceTracker } from "./abort-
|
|
9
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
10
|
-
import { n as getOpenAIStreamFirstEventTimeoutMs, o as iterateWithIdleTimeout, r as getOpenAIStreamIdleTimeoutMs } from "./idle-iterator-
|
|
11
|
-
import { c as postOpenAIStream, r as createOpenAIReasoningEffortFallbackKey, s as resolveOpenAIReasoningEffortFallback, t as applyOpenAIReasoningEffortFallback } from "./openai-reasoning-fallback-
|
|
4
|
+
import { P as $env } from "./src-D_e1qMwi.mjs";
|
|
5
|
+
import { B as OpenAIHttpError, g as MissingApiKeyError, l as finalize, n as StreamTimeoutError, s as ProviderResponseError, t as ConfigurationError, v as AbortError } from "./error-DoHuatWw.mjs";
|
|
6
|
+
import { L as sanitizeSchemaForOpenAIResponses, k as toolWireSchema, s as resolveCacheRetention } from "./utils-fnV2zzp3.mjs";
|
|
7
|
+
import { C as applyResponsesReasoningParams, D as buildResponsesInput, K as getOpenAIPromptCacheKey, N as createInitialResponsesAssistantMessage, Q as isOpenAIResponsesProgressEvent, g as applyCommonResponsesSamplingParams, it as parseAzureDeploymentNameMap, n as getEnvApiKey, ot as processResponsesStream, yt as mapToOpenAIResponsesToolChoice } from "./stream-DveNFWSN.mjs";
|
|
8
|
+
import { t as createAbortSourceTracker } from "./abort-CsjZitYv.mjs";
|
|
9
|
+
import { t as AssistantMessageEventStream } from "./event-stream-C-FmBYUt.mjs";
|
|
10
|
+
import { n as getOpenAIStreamFirstEventTimeoutMs, o as iterateWithIdleTimeout, r as getOpenAIStreamIdleTimeoutMs } from "./idle-iterator-HzbbfXP4.mjs";
|
|
11
|
+
import { c as postOpenAIStream, r as createOpenAIReasoningEffortFallbackKey, s as resolveOpenAIReasoningEffortFallback, t as applyOpenAIReasoningEffortFallback } from "./openai-reasoning-fallback-CigKCyzc.mjs";
|
|
12
12
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/providers/azure-openai-responses.ts
|
|
13
13
|
var azure_openai_responses_exports = /* @__PURE__ */ __exportAll({ streamAzureOpenAIResponses: () => streamAzureOpenAIResponses });
|
|
14
14
|
const DEFAULT_AZURE_API_VERSION = "v1";
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
|
+
__installBunShim();
|
|
3
|
+
import { t as ensureChromiumExecutable } from "./launch-DwpE70Pv.mjs";
|
|
4
|
+
import { l as htmlToBasicMarkdown } from "./types-BUO0JXO-.mjs";
|
|
5
|
+
//#region src/tools/omp/browser/readable.ts
|
|
6
|
+
/** Trim to non-empty string or undefined. */
|
|
7
|
+
function normalize(text) {
|
|
8
|
+
return text?.trim() || void 0;
|
|
9
|
+
}
|
|
10
|
+
let readabilityModule;
|
|
11
|
+
async function loadReadability() {
|
|
12
|
+
if (!readabilityModule) readabilityModule = await import("./readability-Cpm-ocau.mjs");
|
|
13
|
+
return readabilityModule;
|
|
14
|
+
}
|
|
15
|
+
let domModule;
|
|
16
|
+
async function loadDom() {
|
|
17
|
+
if (!domModule) domModule = await import("./dom-CawWi8fa.mjs");
|
|
18
|
+
return domModule;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extract readable content from raw HTML.
|
|
22
|
+
* Tries Readability (article-isolation scoring) first, then falls back to a
|
|
23
|
+
* CSS selector chain over the same pre-parsed DOM. Returns null if neither
|
|
24
|
+
* path yields usable content.
|
|
25
|
+
*/
|
|
26
|
+
async function extractReadableFromHtml(html, url, format) {
|
|
27
|
+
const [{ parseHTML }, { Readability }] = await Promise.all([loadDom(), loadReadability()]);
|
|
28
|
+
const { document } = parseHTML(html);
|
|
29
|
+
const article = new Readability(document).parse();
|
|
30
|
+
if (article) {
|
|
31
|
+
const result = await toReadableResult(url, format, article.textContent, article.content, {
|
|
32
|
+
title: article.title,
|
|
33
|
+
byline: article.byline,
|
|
34
|
+
excerpt: article.excerpt,
|
|
35
|
+
length: article.length
|
|
36
|
+
});
|
|
37
|
+
if (result) return result;
|
|
38
|
+
}
|
|
39
|
+
const candidates = [
|
|
40
|
+
document.querySelector("[data-pagefind-body]"),
|
|
41
|
+
document.querySelector("main article"),
|
|
42
|
+
document.querySelector("article"),
|
|
43
|
+
document.querySelector("main"),
|
|
44
|
+
document.querySelector("[role='main']"),
|
|
45
|
+
document.body
|
|
46
|
+
];
|
|
47
|
+
for (const el of candidates) {
|
|
48
|
+
if (!el) continue;
|
|
49
|
+
const innerHTML = el.innerHTML?.trim();
|
|
50
|
+
const textContent = el.textContent?.trim();
|
|
51
|
+
if (!innerHTML || !textContent) continue;
|
|
52
|
+
const result = await toReadableResult(url, format, textContent, innerHTML, {
|
|
53
|
+
title: document.title,
|
|
54
|
+
excerpt: textContent.slice(0, 240),
|
|
55
|
+
length: textContent.length
|
|
56
|
+
});
|
|
57
|
+
if (result) return result;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
/** Shared builder for both extraction paths. */
|
|
62
|
+
async function toReadableResult(url, format, textContent, htmlContent, meta) {
|
|
63
|
+
const text = normalize(textContent);
|
|
64
|
+
const markdown = format === "markdown" ? normalize(await htmlToBasicMarkdown(htmlContent ?? "")) ?? text : void 0;
|
|
65
|
+
const normalizedText = format === "text" ? text : void 0;
|
|
66
|
+
if (!normalizedText && !markdown) return null;
|
|
67
|
+
return {
|
|
68
|
+
url,
|
|
69
|
+
title: normalize(meta.title),
|
|
70
|
+
byline: normalize(meta.byline),
|
|
71
|
+
excerpt: normalize(meta.excerpt),
|
|
72
|
+
contentLength: meta.length ?? text?.length ?? markdown?.length ?? 0,
|
|
73
|
+
text: normalizedText,
|
|
74
|
+
markdown
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/tools/omp/web/browser-render.ts
|
|
79
|
+
/** Cap on the rendered DOM handed to the readable extractor. */
|
|
80
|
+
const BROWSER_RENDER_MAX_BYTES = 2097152;
|
|
81
|
+
/** Idle time after which the singleton browser is closed (renders reuse it). */
|
|
82
|
+
const BROWSER_IDLE_CLOSE_MS = 6e4;
|
|
83
|
+
/** Per-render goto cap; the caller's timeout budget binds the whole chain. */
|
|
84
|
+
const RENDER_GOTO_MAX_MS = 2e4;
|
|
85
|
+
/** Renders queue through this promise chain — one page open at a time. */
|
|
86
|
+
let renderQueue = Promise.resolve();
|
|
87
|
+
let browserPromise;
|
|
88
|
+
let idleTimer;
|
|
89
|
+
/** Load puppeteer-core lazily (it must stay external to this package). */
|
|
90
|
+
let puppeteerModule;
|
|
91
|
+
async function loadPuppeteer() {
|
|
92
|
+
if (!puppeteerModule) puppeteerModule = (await import("puppeteer-core")).default;
|
|
93
|
+
return puppeteerModule;
|
|
94
|
+
}
|
|
95
|
+
function scheduleIdleClose(browser) {
|
|
96
|
+
if (idleTimer !== void 0) clearTimeout(idleTimer);
|
|
97
|
+
idleTimer = setTimeout(() => {
|
|
98
|
+
browser.close().catch(() => {});
|
|
99
|
+
}, BROWSER_IDLE_CLOSE_MS);
|
|
100
|
+
idleTimer.unref?.();
|
|
101
|
+
}
|
|
102
|
+
process.once("exit", () => {
|
|
103
|
+
const pending = browserPromise;
|
|
104
|
+
if (!pending) return;
|
|
105
|
+
pending.then((browser) => {
|
|
106
|
+
if (browser) browser.process()?.kill("SIGKILL");
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
async function acquireBrowser() {
|
|
110
|
+
if (browserPromise) {
|
|
111
|
+
const existing = await browserPromise;
|
|
112
|
+
if (existing?.connected) {
|
|
113
|
+
scheduleIdleClose(existing);
|
|
114
|
+
return existing;
|
|
115
|
+
}
|
|
116
|
+
browserPromise = void 0;
|
|
117
|
+
}
|
|
118
|
+
browserPromise = (async () => {
|
|
119
|
+
const executablePath = await ensureChromiumExecutable();
|
|
120
|
+
if (!executablePath) return void 0;
|
|
121
|
+
const puppeteer = await loadPuppeteer();
|
|
122
|
+
try {
|
|
123
|
+
const browser = await puppeteer.launch({
|
|
124
|
+
executablePath,
|
|
125
|
+
headless: true,
|
|
126
|
+
args: [
|
|
127
|
+
"--no-sandbox",
|
|
128
|
+
"--disable-setuid-sandbox",
|
|
129
|
+
"--disable-blink-features=AutomationControlled",
|
|
130
|
+
"--disable-dev-shm-usage"
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
scheduleIdleClose(browser);
|
|
134
|
+
return browser;
|
|
135
|
+
} catch {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
})();
|
|
139
|
+
const browser = await browserPromise;
|
|
140
|
+
if (browser) scheduleIdleClose(browser);
|
|
141
|
+
return browser;
|
|
142
|
+
}
|
|
143
|
+
function sleep(ms) {
|
|
144
|
+
return new Promise((resolve) => {
|
|
145
|
+
setTimeout(resolve, ms).unref?.();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Render a URL in a headless browser and return readable markdown, or null
|
|
150
|
+
* when no browser is available / rendering fails. Serialized through the
|
|
151
|
+
* singleton queue; honors `signal` cancellation between attempts.
|
|
152
|
+
*/
|
|
153
|
+
async function renderUrlWithBrowser(url, options = {}) {
|
|
154
|
+
const { timeoutMs = 3e4, signal } = options;
|
|
155
|
+
const run = async () => {
|
|
156
|
+
signal?.throwIfAborted();
|
|
157
|
+
const browser = await acquireBrowser();
|
|
158
|
+
if (!browser) return null;
|
|
159
|
+
signal?.throwIfAborted();
|
|
160
|
+
const page = await browser.newPage();
|
|
161
|
+
try {
|
|
162
|
+
const gotoBudget = Math.max(1e3, Math.min(timeoutMs, RENDER_GOTO_MAX_MS));
|
|
163
|
+
const response = await page.goto(url, {
|
|
164
|
+
waitUntil: "domcontentloaded",
|
|
165
|
+
timeout: gotoBudget
|
|
166
|
+
});
|
|
167
|
+
signal?.throwIfAborted();
|
|
168
|
+
await sleep(800);
|
|
169
|
+
signal?.throwIfAborted();
|
|
170
|
+
const html = await page.content() ?? "";
|
|
171
|
+
const readable = await extractReadableFromHtml(html.length > 2097152 ? html.slice(0, BROWSER_RENDER_MAX_BYTES) : html, response?.url() ?? url, "markdown");
|
|
172
|
+
if (!readable?.markdown) return null;
|
|
173
|
+
return readable.markdown;
|
|
174
|
+
} catch {
|
|
175
|
+
return null;
|
|
176
|
+
} finally {
|
|
177
|
+
await page.close().catch(() => {});
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
return renderQueue = renderQueue.then(run, run);
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
export { renderUrlWithBrowser };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { i as getBundledProviders, r as getBundledModels } from "./models-
|
|
4
|
-
import { r as isZeroCostXaiOAuthReference } from "./identity-
|
|
3
|
+
import { i as getBundledProviders, r as getBundledModels } from "./models-Cp3PzU3l.mjs";
|
|
4
|
+
import { r as isZeroCostXaiOAuthReference } from "./identity-C0SPVyIZ.mjs";
|
|
5
5
|
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@17.3.5/node_modules/@oh-my-pi/pi-catalog/src/provider-models/bundled-references.ts
|
|
6
6
|
/**
|
|
7
7
|
* Project a built `Model` back to spec stage: `compat` becomes the verbatim
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { c as OAuthError, h as LoginCancelledError, t as ConfigurationError } from "./error-
|
|
3
|
+
import { c as OAuthError, h as LoginCancelledError, t as ConfigurationError } from "./error-DoHuatWw.mjs";
|
|
4
4
|
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/oauth.html
|
|
5
5
|
var oauth_default = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>oh my pi · authentication</title>\n <style>\n :root {\n /* dark, slightly purple-tinted neutrals — never #000 */\n --ink-0: oklch(0.135 0.018 295);\n --ink-1: oklch(0.172 0.022 295);\n --ink-2: oklch(0.21 0.024 295);\n --ink-4: oklch(0.36 0.024 295);\n --ink-5: oklch(0.5 0.022 290);\n --ink-6: oklch(0.66 0.018 290);\n --ink-7: oklch(0.82 0.014 285);\n --ink-9: oklch(0.97 0.008 90);\n\n /* brand: magenta lead, cyan reply */\n --magenta: oklch(0.7 0.24 340);\n --iris: oklch(0.62 0.21 295);\n --cyan: oklch(0.81 0.14 200);\n\n /* signal */\n --success: oklch(0.78 0.16 150);\n --error: oklch(0.66 0.22 25);\n\n --bg: var(--ink-0);\n --fg: var(--ink-9);\n --fg-dim: var(--ink-7);\n --fg-faint: var(--ink-5);\n --rule: oklch(1 0 0 / 0.07);\n --rule-strong: oklch(1 0 0 / 0.14);\n --accent: var(--magenta);\n --accent-2: var(--cyan);\n\n color-scheme: dark;\n }\n\n * {\n box-sizing: border-box;\n }\n\n body {\n font-family: \"Geist\", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n background:\n radial-gradient(ellipse 80vw 60vh at 18% -10%, oklch(0.7 0.24 340 / 0.13), transparent 60%),\n radial-gradient(ellipse 70vw 70vh at 110% 30%, oklch(0.81 0.14 200 / 0.09), transparent 60%),\n var(--bg);\n color: var(--fg);\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n margin: 0;\n padding: 1.5rem;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n overflow-x: clip;\n }\n\n /* ascii grid backdrop */\n .grid-bg {\n position: fixed;\n inset: 0;\n background-image:\n linear-gradient(to right, oklch(1 0 0 / 0.025) 1px, transparent 1px),\n linear-gradient(to bottom, oklch(1 0 0 / 0.025) 1px, transparent 1px);\n background-size: 56px 56px;\n background-position: -1px -1px;\n mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);\n pointer-events: none;\n z-index: 0;\n }\n\n .container {\n position: relative;\n z-index: 1;\n background: oklch(0.172 0.022 295 / 0.72);\n backdrop-filter: blur(16px);\n -webkit-backdrop-filter: blur(16px);\n border: 1px solid var(--rule);\n border-radius: 16px;\n padding: 2.5rem 2.5rem 2rem;\n width: 100%;\n max-width: 420px;\n text-align: center;\n box-shadow:\n 0 24px 48px -12px oklch(0 0 0 / 0.55),\n 0 0 0 1px oklch(1 0 0 / 0.03) inset;\n opacity: 0;\n transform: translateY(10px);\n animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n @keyframes rise {\n to {\n opacity: 1;\n transform: none;\n }\n }\n\n /* brand header */\n .brand {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-bottom: 2rem;\n }\n .brand svg {\n width: 22px;\n height: 22px;\n }\n .brand .wordmark {\n font-size: 13px;\n font-weight: 500;\n letter-spacing: -0.01em;\n color: var(--fg);\n }\n\n /* status mark */\n .mark-wrap {\n position: relative;\n width: 72px;\n height: 72px;\n margin: 0 auto 1.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .mark-wrap::before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: 50%;\n background: oklch(1 0 0 / 0.05);\n z-index: 0;\n }\n .mark {\n width: 40px;\n height: 40px;\n z-index: 2;\n }\n .timer-svg {\n position: absolute;\n top: -2px;\n left: -2px;\n width: 76px;\n height: 76px;\n transform: rotate(-90deg);\n z-index: 1;\n pointer-events: none;\n }\n .timer-circle {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-dasharray: 226;\n stroke-dashoffset: 0;\n }\n .countdown .timer-circle {\n animation: countdown 3s linear forwards;\n }\n @keyframes countdown {\n to {\n stroke-dashoffset: 226;\n }\n }\n\n h1 {\n font-family: \"Fraunces\", \"Iowan Old Style\", Georgia, serif;\n font-size: 1.6rem;\n font-weight: 500;\n letter-spacing: -0.022em;\n line-height: 1.15;\n margin: 0 0 0.75rem;\n text-wrap: balance;\n }\n p {\n color: var(--fg-dim);\n line-height: 1.6;\n margin: 0 0 1.75rem;\n font-size: 0.95rem;\n }\n\n .btn {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n background: var(--fg);\n color: var(--bg);\n font-family: inherit;\n font-weight: 500;\n padding: 0.65rem 1.4rem;\n border-radius: 8px;\n text-decoration: none;\n font-size: 0.9rem;\n transition: opacity 0.2s, transform 0.2s;\n cursor: pointer;\n border: none;\n }\n .btn:hover {\n opacity: 0.88;\n transform: translateY(-1px);\n }\n .btn:active {\n transform: translateY(0);\n }\n\n /* State: success */\n .success .mark-wrap::before {\n background: oklch(0.78 0.16 150 / 0.12);\n }\n .success .mark {\n color: var(--success);\n }\n .success .timer-circle {\n stroke: var(--success);\n }\n .success .icon-error {\n display: none;\n }\n\n /* State: error */\n .error .mark-wrap::before {\n background: oklch(0.66 0.22 25 / 0.12);\n }\n .error .mark {\n color: var(--error);\n }\n .error .timer-circle {\n stroke: var(--error);\n }\n .error .icon-success,\n .error .timer-svg {\n display: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .container,\n .countdown .timer-circle {\n animation: none;\n }\n .container {\n opacity: 1;\n transform: none;\n }\n }\n </style>\n </head>\n <body>\n <span aria-hidden=\"true\" class=\"grid-bg\"></span>\n <div id=\"app\" class=\"container\">\n <div class=\"brand\">\n <svg viewBox=\"0 0 64 64\" aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"pi-grad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n <stop offset=\"0\" stop-color=\"oklch(0.7 0.24 340)\" />\n <stop offset=\".5\" stop-color=\"oklch(0.62 0.21 295)\" />\n <stop offset=\"1\" stop-color=\"oklch(0.81 0.14 200)\" />\n </linearGradient>\n </defs>\n <path fill=\"url(#pi-grad)\" d=\"M10 14h44v9H43v33h-9V23h-9v22h-9V23H10z\" />\n </svg>\n <span class=\"wordmark\">oh my pi</span>\n </div>\n\n <div class=\"mark-wrap\">\n <svg class=\"timer-svg\" viewBox=\"0 0 76 76\">\n <circle class=\"timer-circle\" cx=\"38\" cy=\"38\" r=\"36\"></circle>\n </svg>\n <svg class=\"mark icon-success\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n <svg class=\"mark icon-error\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </div>\n\n <h1 id=\"title\">Authentication</h1>\n <p id=\"message\"></p>\n <button onclick=\"window.close()\" class=\"btn\">Close Window</button>\n </div>\n\n <script id=\"server-state\" type=\"application/json\">\n __OAUTH_STATE__\n <\/script>\n\n <script>\n let serverState;\n try {\n serverState = JSON.parse(document.getElementById(\"server-state\").textContent);\n } catch {\n const params = new URLSearchParams(window.location.search);\n serverState = {\n ok: params.get(\"ok\") === \"1\",\n error: params.get(\"error\") || \"Authentication failed\",\n };\n }\n\n const app = document.getElementById(\"app\");\n const title = document.getElementById(\"title\");\n const message = document.getElementById(\"message\");\n\n if (serverState.ok) {\n app.classList.add(\"success\", \"countdown\");\n title.textContent = \"Authentication Successful\";\n message.innerHTML = \"You have successfully logged in.<br>You can now close this tab.\";\n setTimeout(() => window.close(), 3000);\n } else {\n app.classList.add(\"error\");\n title.textContent = \"Authentication Failed\";\n message.textContent = serverState.error || \"An error occurred\";\n }\n <\/script>\n </body>\n</html>\n";
|
|
6
6
|
//#endregion
|