Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
96153f29
Unverified
提交
96153f29
authored
5月 21, 2025
作者:
Will Chen
提交者:
GitHub
5月 21, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deprecate pro budget in app since it's not accurate (#210)
上级
be8252c1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
27 行删除
+6
-27
schemas.ts
src/lib/schemas.ts
+4
-1
main.ts
src/main.ts
+1
-10
pro.ts
src/main/pro.ts
+1
-16
没有找到文件。
src/lib/schemas.ts
浏览文件 @
96153f29
...
@@ -114,14 +114,17 @@ export const UserSettingsSchema = z.object({
...
@@ -114,14 +114,17 @@ export const UserSettingsSchema = z.object({
telemetryUserId
:
z
.
string
().
optional
(),
telemetryUserId
:
z
.
string
().
optional
(),
hasRunBefore
:
z
.
boolean
().
optional
(),
hasRunBefore
:
z
.
boolean
().
optional
(),
enableDyadPro
:
z
.
boolean
().
optional
(),
enableDyadPro
:
z
.
boolean
().
optional
(),
dyadProBudget
:
DyadProBudgetSchema
.
optional
(),
experiments
:
ExperimentsSchema
.
optional
(),
experiments
:
ExperimentsSchema
.
optional
(),
lastShownReleaseNotesVersion
:
z
.
string
().
optional
(),
lastShownReleaseNotesVersion
:
z
.
string
().
optional
(),
maxChatTurnsInContext
:
z
.
number
().
optional
(),
maxChatTurnsInContext
:
z
.
number
().
optional
(),
enableProSaverMode
:
z
.
boolean
().
optional
(),
enableProSaverMode
:
z
.
boolean
().
optional
(),
enableProLazyEditsMode
:
z
.
boolean
().
optional
(),
enableProLazyEditsMode
:
z
.
boolean
().
optional
(),
enableProSmartFilesContextMode
:
z
.
boolean
().
optional
(),
enableProSmartFilesContextMode
:
z
.
boolean
().
optional
(),
////////////////////////////////
// DEPRECATED.
// DEPRECATED.
////////////////////////////////
dyadProBudget
:
DyadProBudgetSchema
.
optional
(),
runtimeMode
:
RuntimeModeSchema
.
optional
(),
runtimeMode
:
RuntimeModeSchema
.
optional
(),
});
});
...
...
src/main.ts
浏览文件 @
96153f29
...
@@ -189,21 +189,12 @@ function handleDeepLinkReturn(url: string) {
...
@@ -189,21 +189,12 @@ function handleDeepLinkReturn(url: string) {
// dyad://dyad-pro-return?key=123&budget_reset_at=2025-05-26T16:31:13.492000Z&max_budget=100
// dyad://dyad-pro-return?key=123&budget_reset_at=2025-05-26T16:31:13.492000Z&max_budget=100
if
(
parsed
.
hostname
===
"dyad-pro-return"
)
{
if
(
parsed
.
hostname
===
"dyad-pro-return"
)
{
const
apiKey
=
parsed
.
searchParams
.
get
(
"key"
);
const
apiKey
=
parsed
.
searchParams
.
get
(
"key"
);
// UTC time
// budget_reset_at: '2025-05-26T16:31:13.492000Z'
const
budgetResetAt
=
parsed
.
searchParams
.
get
(
"budget_reset_at"
);
const
maxBudget
=
Number
(
parsed
.
searchParams
.
get
(
"max_budget"
));
if
(
!
apiKey
)
{
if
(
!
apiKey
)
{
dialog
.
showErrorBox
(
dialog
.
showErrorBox
(
"Invalid URL"
,
"Expected key"
);
"Invalid URL"
,
"Expected key, budget_reset_at, and max_budget"
,
);
return
;
return
;
}
}
handleDyadProReturn
({
handleDyadProReturn
({
apiKey
,
apiKey
,
budgetResetAt
,
maxBudget
,
});
});
// Send message to renderer to trigger re-render
// Send message to renderer to trigger re-render
mainWindow
?.
webContents
.
send
(
"deep-link-received"
,
{
mainWindow
?.
webContents
.
send
(
"deep-link-received"
,
{
...
...
src/main/pro.ts
浏览文件 @
96153f29
import
{
readSettings
,
writeSettings
}
from
"./settings"
;
import
{
readSettings
,
writeSettings
}
from
"./settings"
;
export
function
handleDyadProReturn
({
export
function
handleDyadProReturn
({
apiKey
}:
{
apiKey
:
string
})
{
apiKey
,
budgetResetAt
,
maxBudget
,
}:
{
apiKey
:
string
;
budgetResetAt
:
string
|
null
|
undefined
;
maxBudget
:
number
|
null
|
undefined
;
})
{
const
settings
=
readSettings
();
const
settings
=
readSettings
();
writeSettings
({
writeSettings
({
providerSettings
:
{
providerSettings
:
{
...
@@ -20,13 +12,6 @@ export function handleDyadProReturn({
...
@@ -20,13 +12,6 @@ export function handleDyadProReturn({
},
},
},
},
},
},
dyadProBudget
:
budgetResetAt
&&
maxBudget
?
{
budgetResetAt
,
maxBudget
,
}
:
undefined
,
enableDyadPro
:
true
,
enableDyadPro
:
true
,
});
});
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论