evolcore 0.0.23 → 0.0.25
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/CHANGELOG.md +583 -516
- package/LICENSE +21 -21
- package/README.md +455 -453
- package/bin/codex-managed-acl.ps1 +160 -155
- package/bin/codex-managed-hook.mjs +209 -92
- package/bin/ec-safe-output.js +327 -245
- package/bin/ec.js +29 -29
- package/bin/install-codex-managed-hooks.mjs +555 -544
- package/dist/agents/baseagent-availability.js +4 -4
- package/dist/agents/baseagent.js +29 -1
- package/dist/agents/claude-runner.js +152 -14
- package/dist/agents/codex/app-server-client.js +18 -8
- package/dist/agents/codex/catalog.js +1 -1
- package/dist/agents/codex/diagnostics.js +215 -0
- package/dist/agents/codex-runner.js +445 -63
- package/dist/agents/ecagent-runner.js +31 -16
- package/dist/agents/gemini-runner.js +82 -4
- package/dist/agents/runner-types.js +1 -1
- package/dist/aun/aid/agentmd.js +56 -4
- package/dist/aun/aid/index.js +1 -0
- package/dist/aun/aid/managed-operation.js +80 -6
- package/dist/aun/aid/store.js +41 -0
- package/dist/aun/msg/managed-operation.js +6 -1
- package/dist/aun/outbox.js +56 -18
- package/dist/aun/rpc/client.js +4 -5
- package/dist/aun/storage/client.js +4 -1
- package/dist/aun/storage/index.js +1 -1
- package/dist/channels/aun.js +147 -76
- package/dist/channels/daemon.js +7 -1
- package/dist/channels/dingtalk.js +1 -0
- package/dist/channels/feishu.js +10 -4
- package/dist/channels/wecom.js +2 -1
- package/dist/cli/agent-command.js +214 -89
- package/dist/cli/agent-create.js +576 -0
- package/dist/cli/agent.js +129 -676
- package/dist/cli/aun-commands.js +419 -313
- package/dist/cli/bench.js +20 -20
- package/dist/cli/config.js +20 -20
- package/dist/cli/contact.js +10 -10
- package/dist/cli/ctl-command.js +22 -20
- package/dist/cli/daemon-commands.js +163 -32
- package/dist/cli/fs-command.js +67 -67
- package/dist/cli/handoff-command.js +7 -7
- package/dist/cli/index.js +79 -79
- package/dist/cli/link-rules.js +21 -21
- package/dist/cli/managed-command-guard.js +3 -0
- package/dist/cli/menu-client.js +11 -11
- package/dist/cli/net-check.js +22 -22
- package/dist/cli/queue-command.js +29 -29
- package/dist/cli/response.js +30 -30
- package/dist/cli/restart-monitor.js +462 -38
- package/dist/cli/stats.js +161 -51
- package/dist/cli/trigger-command.js +56 -56
- package/dist/config/builtin-roles.js +3 -0
- package/dist/config/config-manager.js +15 -0
- package/dist/config/config-operation-service.js +20 -3
- package/dist/config/resolved-config-op.js +39 -1
- package/dist/core/auth/auth-gateway.js +3 -2
- package/dist/core/auth/authorization-audit.js +72 -19
- package/dist/core/auth/operation-authorizer.js +125 -7
- package/dist/core/auth/operation-catalog.js +26 -2
- package/dist/core/auth/remote-access-store.js +3 -2
- package/dist/core/baseagent-loader.js +4 -4
- package/dist/core/bootstrap-messages.js +39 -18
- package/dist/core/bootstrap-service.js +32 -26
- package/dist/core/capability/capability-manager.js +8 -4
- package/dist/core/capability/providers/codex-capability-provider.js +1 -1
- package/dist/core/command/agent-control.js +60 -26
- package/dist/core/command/cli-intent-parser.js +18 -0
- package/dist/core/command/command-handler.js +173 -36
- package/dist/core/command/menu-catalog.js +4 -1
- package/dist/core/command/menu-handler.js +315 -75
- package/dist/core/command/menu-protocol.js +7 -2
- package/dist/core/command/slash-gate.js +1 -3
- package/dist/core/command/slash-handler.js +166 -57
- package/dist/core/data-migration.js +5 -15
- package/dist/core/event-catalog.js +8 -0
- package/dist/core/evolagent.js +3 -3
- package/dist/core/handoff/runtime.js +3 -1
- package/dist/core/handoff/store.js +7 -1
- package/dist/core/message/im-renderer.js +13 -6
- package/dist/core/message/message-bridge.js +5 -36
- package/dist/core/message/message-utils.js +6 -3
- package/dist/core/message/response-engine.js +85 -27
- package/dist/core/model/catalog-service.js +3 -1
- package/dist/core/model/model-catalog.js +10 -0
- package/dist/core/model/model-permission.js +4 -1
- package/dist/core/permission/approval-gateway.js +169 -33
- package/dist/core/permission/tool-policy.js +56 -10
- package/dist/core/session/adapters/codex-session-file-adapter.js +71 -3
- package/dist/core/session/session-manager.js +49 -13
- package/dist/core/session/session-renew.js +1 -0
- package/dist/index.js +327 -134
- package/dist/ipc.js +68 -21
- package/dist/paths.js +23 -1
- package/dist/stats/billing.js +18 -4
- package/dist/stats/db.js +159 -159
- package/dist/stats/eck-vars.js +9 -9
- package/dist/stats/query.js +139 -139
- package/dist/stats/role-budget.js +6 -6
- package/dist/stats/writer.js +51 -51
- package/dist/utils/atomic-write.js +26 -2
- package/dist/utils/avatar-upload.js +282 -23
- package/dist/utils/cross-platform.js +436 -1
- package/dist/utils/error-dict.json +160 -160
- package/dist/utils/error-utils.js +11 -4
- package/dist/utils/macos-autostart.js +22 -22
- package/dist/utils/model-prices.jsonl +23 -20
- package/dist/utils/npm-ops.js +24 -1
- package/dist/utils/welcome.js +22 -22
- package/dist/utils/windows-autostart.js +1 -1
- package/ecagent/LICENSE +21 -21
- package/ecagent/NOTICE +11 -11
- package/ecagent/README.md +61 -61
- package/ecagent/dist/harness/compaction/branch-summarization.js +30 -30
- package/ecagent/dist/harness/compaction/compaction.js +83 -83
- package/ecagent/dist/harness/messages.js +7 -7
- package/kits/docs/GUIDE.md +20 -20
- package/kits/docs/INDEX.md +66 -66
- package/kits/docs/aun/CHEATSHEET.md +19 -19
- package/kits/docs/aun/SYNC_PROTOCOL.md +15 -15
- package/kits/docs/channels/aun.md +56 -56
- package/kits/docs/channels/feishu.md +56 -56
- package/kits/docs/context-assembly.md +365 -364
- package/kits/docs/eck_templates/GUIDE.template.md +22 -22
- package/kits/docs/eck_templates/INDEX.template.md +28 -28
- package/kits/docs/eck_templates/path-registry.template.md +33 -33
- package/kits/docs/eck_templates/runtime.template.md +19 -19
- package/kits/docs/evolcore/INDEX.md +71 -69
- package/kits/docs/evolcore/agent-create.md +170 -156
- package/kits/docs/evolcore/agent.md +83 -73
- package/kits/docs/evolcore/aid.md +64 -62
- package/kits/docs/evolcore/codex-windows-sandbox.md +146 -0
- package/kits/docs/evolcore/config.md +195 -195
- package/kits/docs/evolcore/contact.md +68 -68
- package/kits/docs/evolcore/ctl.md +46 -46
- package/kits/docs/evolcore/event.md +216 -216
- package/kits/docs/evolcore/fs-architecture.md +1215 -1215
- package/kits/docs/evolcore/fs.md +110 -110
- package/kits/docs/evolcore/group-collaboration.md +243 -243
- package/kits/docs/evolcore/group-fs.md +17 -17
- package/kits/docs/evolcore/group-rules.md +251 -251
- package/kits/docs/evolcore/group.md +152 -152
- package/kits/docs/evolcore/menu-client.md +34 -34
- package/kits/docs/evolcore/model.md +50 -50
- package/kits/docs/evolcore/msg.md +165 -165
- package/kits/docs/evolcore/response.md +75 -75
- package/kits/docs/evolcore/rpc.md +37 -37
- package/kits/docs/evolcore/self-summary.md +29 -29
- package/kits/docs/evolcore/stats.md +83 -83
- package/kits/docs/evolcore/storage.md +50 -50
- package/kits/docs/evolcore/trigger.md +575 -575
- package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -26
- package/kits/docs/identity/PATH_OPS.md +16 -16
- package/kits/docs/identity/ROLE_DETAIL.md +25 -25
- package/kits/docs/identity/identity-tools.md +26 -26
- package/kits/docs/path-registry.md +62 -62
- package/kits/docs/prompt-loading-architecture.md +270 -269
- package/kits/docs/venues/aun-group.md +45 -45
- package/kits/docs/venues/aun-private.md +10 -10
- package/kits/docs/venues/client-desktop.md +10 -10
- package/kits/docs/venues/client-mobile.md +10 -10
- package/kits/docs/venues/feishu-group.md +13 -13
- package/kits/docs/venues/feishu-private.md +9 -9
- package/kits/docs/venues/group.md +25 -25
- package/kits/docs/venues/private.md +10 -10
- package/kits/eck_manifest.auxiliary.json +43 -43
- package/kits/eck_manifest.json +195 -183
- package/kits/eck_message_manifest.json +74 -74
- package/kits/migrations/README-role-config-v4.md +32 -32
- package/kits/migrations/migrate-contact-book-v2.mjs +748 -748
- package/kits/migrations/migrate-role-config-v4.mjs +614 -614
- package/kits/migrations/migrate-role-config-v5.mjs +365 -365
- package/kits/migrations/rename-config-file.mjs +99 -99
- package/kits/rules/01-overview.md +162 -162
- package/kits/rules/02-navigation.md +96 -96
- package/kits/rules/03-identity.md +39 -37
- package/kits/rules/04-relation.md +75 -75
- package/kits/rules/05-venue.md +60 -60
- package/kits/rules/06-channel.md +63 -63
- package/kits/schemas/_meta.json +53 -53
- package/kits/schemas/agent-config.schema.1.json +177 -177
- package/kits/schemas/agent-config.schema.10.json +395 -395
- package/kits/schemas/agent-config.schema.11.json +421 -421
- package/kits/schemas/agent-config.schema.12.json +427 -427
- package/kits/schemas/agent-config.schema.2.json +239 -239
- package/kits/schemas/agent-config.schema.3.json +119 -119
- package/kits/schemas/agent-config.schema.4.json +208 -208
- package/kits/schemas/agent-config.schema.5.json +326 -326
- package/kits/schemas/agent-config.schema.6.json +322 -322
- package/kits/schemas/agent-config.schema.7.json +303 -303
- package/kits/schemas/agent-config.schema.8.json +304 -304
- package/kits/schemas/agent-config.schema.9.json +364 -364
- package/kits/schemas/contact-book.schema.1.json +36 -36
- package/kits/schemas/contact-book.schema.2.json +43 -43
- package/kits/schemas/contact-book.schema.3.json +67 -67
- package/kits/schemas/daemon.schema.1.json +91 -91
- package/kits/schemas/daemon.schema.2.json +101 -101
- package/kits/schemas/daemon.schema.3.json +123 -123
- package/kits/schemas/daemon.schema.4.json +136 -136
- package/kits/schemas/daemon.schema.5.json +135 -135
- package/kits/schemas/daemon.schema.6.json +131 -131
- package/kits/schemas/defaults.schema.1.json +81 -81
- package/kits/schemas/defaults.schema.2.json +85 -85
- package/kits/schemas/defaults.schema.3.json +73 -73
- package/kits/schemas/defaults.schema.4.json +107 -107
- package/kits/schemas/defaults.schema.5.json +119 -119
- package/kits/schemas/menu-exec-schema-commands.md +208 -208
- package/kits/schemas/migrations/README.md +30 -30
- package/kits/schemas/relation-config.schema.1.json +158 -158
- package/kits/schemas/relation-config.schema.2.json +73 -73
- package/kits/schemas/relation-config.schema.3.json +50 -50
- package/kits/schemas/relation-config.schema.4.json +47 -47
- package/kits/schemas/relation-config.schema.5.json +47 -47
- package/kits/schemas/relation-config.schema.6.json +46 -46
- package/kits/schemas/relation-config.schema.7.json +59 -59
- package/kits/schemas/relation-config.schema.8.json +103 -103
- package/kits/schemas/role-config.schema.1.json +201 -201
- package/kits/schemas/role-registry.schema.1.json +35 -35
- package/kits/schemas/single-session.schema.1.json +31 -31
- package/kits/schemas/single-session.schema.2.json +57 -57
- package/kits/schemas/single-session.schema.3.json +32 -32
- package/kits/templates/bootstrap-welcome.md +17 -17
- package/kits/templates/message-fragments/handoff-context-to-target.md +9 -9
- package/kits/templates/message-fragments/handoff-request-to-target.md +19 -19
- package/kits/templates/message-fragments/handoff-response-to-origin.md +9 -9
- package/kits/templates/message-fragments/inject-default.md +2 -2
- package/kits/templates/message-fragments/item.md +2 -2
- package/kits/templates/roles/admin.json +96 -82
- package/kits/templates/roles/member.json +97 -96
- package/kits/templates/roles/owner.json +9 -9
- package/kits/templates/roles/visitor.json +86 -85
- package/kits/templates/system-fragments/baseagent.md +14 -14
- package/kits/templates/system-fragments/bootstrap.md +38 -29
- package/kits/templates/system-fragments/channel.md +64 -64
- package/kits/templates/system-fragments/commands.md +28 -28
- package/kits/templates/system-fragments/identity.md +13 -13
- package/kits/templates/system-fragments/relation.md +19 -19
- package/kits/templates/system-fragments/session.md +59 -59
- package/kits/templates/system-fragments/venue.md +31 -31
- package/package.json +98 -94
- package/AGENTS.md +0 -62
- package/dist/utils/codex-cli.js +0 -43
- package/skills/eclink/SKILL.md +0 -84
- package/skills/eclink/agents/openai.yaml +0 -4
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": [
|
|
3
|
-
{
|
|
4
|
-
"id": "context-too-long-cn",
|
|
5
|
-
"match": "上下文过长",
|
|
6
|
-
"action": "stop",
|
|
7
|
-
"type": "context_too_long",
|
|
8
|
-
"message": "⚠️ 上下文过长,请手动输入 /compact 压缩上下文"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"id": "context-too-long-en",
|
|
12
|
-
"match": "context too long",
|
|
13
|
-
"action": "stop",
|
|
14
|
-
"type": "context_too_long",
|
|
15
|
-
"message": "⚠️ 上下文过长,请手动输入 /compact 压缩上下文"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"id": "prompt-too-long",
|
|
19
|
-
"match": "prompt is too long",
|
|
20
|
-
"action": "stop",
|
|
21
|
-
"type": "context_too_long",
|
|
22
|
-
"message": "⚠️ 输入过长,请精简提问或使用 /compact 压缩上下文"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "invalid-api-key",
|
|
26
|
-
"match": "invalid api key",
|
|
27
|
-
"action": "stop",
|
|
28
|
-
"type": "auth_error",
|
|
29
|
-
"message": "❌ API Key 无效,请检查密钥配置。使用 /status 查看当前配置"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "key-not-found",
|
|
33
|
-
"match": "key_not_found",
|
|
34
|
-
"action": "stop",
|
|
35
|
-
"type": "auth_error",
|
|
36
|
-
"message": "❌ API Key 未找到,请检查密钥配置"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"id": "api-key-verifier-too-many-connections",
|
|
40
|
-
"match": "error 1040 (08004): too many connections",
|
|
41
|
-
"action": "retry",
|
|
42
|
-
"type": "api_error",
|
|
43
|
-
"message": "⚠️ API 服务繁忙,请稍后重试"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "credit-query-timeout",
|
|
47
|
-
"match": "积分查询超时",
|
|
48
|
-
"action": "retry",
|
|
49
|
-
"type": "api_error",
|
|
50
|
-
"message": "⚠️ 积分查询超时,请稍后重试"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"id": "capacity-pool-switching-cn",
|
|
54
|
-
"match": "算力池切换",
|
|
55
|
-
"action": "retry",
|
|
56
|
-
"type": "api_error",
|
|
57
|
-
"message": "⚠️ 当前算力池切换中,请稍后重试"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"id": "retry-attempt-stalled",
|
|
61
|
-
"match": "retry_attempt_stalled",
|
|
62
|
-
"action": "retry",
|
|
63
|
-
"type": "api_error",
|
|
64
|
-
"message": "⚠️ API 重试调用长时间无响应"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"id": "selected-model-at-capacity",
|
|
68
|
-
"match": "selected model is at capacity",
|
|
69
|
-
"action": "retry",
|
|
70
|
-
"type": "api_error",
|
|
71
|
-
"message": "⚠️ 当前模型繁忙,请稍后重试"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "api-error-400",
|
|
75
|
-
"match": "api error: 400",
|
|
76
|
-
"action": "stop",
|
|
77
|
-
"type": "api_error",
|
|
78
|
-
"message": "❌ 请求格式错误,请检查输入内容"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"id": "model-not-supported-403",
|
|
82
|
-
"match": "api error: 403 不支持该模型",
|
|
83
|
-
"action": "stop",
|
|
84
|
-
"type": "model_unavailable",
|
|
85
|
-
"message": "❌ 当前模型不受支持,请正确配置模型后重试"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"id": "api-error-403",
|
|
89
|
-
"match": "api error: 403",
|
|
90
|
-
"action": "retry",
|
|
91
|
-
"type": "api_error",
|
|
92
|
-
"message": "⚠️ API 访问受限,请稍后重试"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"id": "api-error-429",
|
|
96
|
-
"match": "api error: 429",
|
|
97
|
-
"action": "retry",
|
|
98
|
-
"type": "api_error",
|
|
99
|
-
"message": "⚠️ 请求过于频繁,请稍后重试"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"id": "api-error-500",
|
|
103
|
-
"match": "api error: 500",
|
|
104
|
-
"action": "retry",
|
|
105
|
-
"type": "api_error",
|
|
106
|
-
"message": "❌ API 服务暂时不可用,请稍后重试"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"id": "api-error-502",
|
|
110
|
-
"match": "api error: 502",
|
|
111
|
-
"action": "retry",
|
|
112
|
-
"type": "api_error"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id": "api-error-503",
|
|
116
|
-
"match": "api error: 503",
|
|
117
|
-
"action": "retry",
|
|
118
|
-
"type": "api_error"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"id": "api-error-504",
|
|
122
|
-
"match": "api error: 504",
|
|
123
|
-
"action": "retry",
|
|
124
|
-
"type": "api_error"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id": "not-valid-json",
|
|
128
|
-
"match": "is not valid json",
|
|
129
|
-
"action": "retry",
|
|
130
|
-
"type": "api_error",
|
|
131
|
-
"message": "⚠️ API 返回异常响应,请稍后重试"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "json-parse-error",
|
|
135
|
-
"match": "json parse error",
|
|
136
|
-
"action": "retry",
|
|
137
|
-
"type": "api_error",
|
|
138
|
-
"message": "⚠️ API 返回 JSON 解析异常,请稍后重试"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"id": "feishu-permission",
|
|
142
|
-
"match": "im:resource",
|
|
143
|
-
"action": "stop",
|
|
144
|
-
"type": "unknown",
|
|
145
|
-
"message": "❌ 权限不足,请联系管理员配置应用权限"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"id": "stream-error",
|
|
149
|
-
"match": "stream",
|
|
150
|
-
"action": "retry",
|
|
151
|
-
"type": "stream_error"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"id": "request-aborted",
|
|
155
|
-
"match": "request was aborted",
|
|
156
|
-
"action": "ignore",
|
|
157
|
-
"type": "stream_error"
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"id": "context-too-long-cn",
|
|
5
|
+
"match": "上下文过长",
|
|
6
|
+
"action": "stop",
|
|
7
|
+
"type": "context_too_long",
|
|
8
|
+
"message": "⚠️ 上下文过长,请手动输入 /compact 压缩上下文"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "context-too-long-en",
|
|
12
|
+
"match": "context too long",
|
|
13
|
+
"action": "stop",
|
|
14
|
+
"type": "context_too_long",
|
|
15
|
+
"message": "⚠️ 上下文过长,请手动输入 /compact 压缩上下文"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "prompt-too-long",
|
|
19
|
+
"match": "prompt is too long",
|
|
20
|
+
"action": "stop",
|
|
21
|
+
"type": "context_too_long",
|
|
22
|
+
"message": "⚠️ 输入过长,请精简提问或使用 /compact 压缩上下文"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "invalid-api-key",
|
|
26
|
+
"match": "invalid api key",
|
|
27
|
+
"action": "stop",
|
|
28
|
+
"type": "auth_error",
|
|
29
|
+
"message": "❌ API Key 无效,请检查密钥配置。使用 /status 查看当前配置"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "key-not-found",
|
|
33
|
+
"match": "key_not_found",
|
|
34
|
+
"action": "stop",
|
|
35
|
+
"type": "auth_error",
|
|
36
|
+
"message": "❌ API Key 未找到,请检查密钥配置"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "api-key-verifier-too-many-connections",
|
|
40
|
+
"match": "error 1040 (08004): too many connections",
|
|
41
|
+
"action": "retry",
|
|
42
|
+
"type": "api_error",
|
|
43
|
+
"message": "⚠️ API 服务繁忙,请稍后重试"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "credit-query-timeout",
|
|
47
|
+
"match": "积分查询超时",
|
|
48
|
+
"action": "retry",
|
|
49
|
+
"type": "api_error",
|
|
50
|
+
"message": "⚠️ 积分查询超时,请稍后重试"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "capacity-pool-switching-cn",
|
|
54
|
+
"match": "算力池切换",
|
|
55
|
+
"action": "retry",
|
|
56
|
+
"type": "api_error",
|
|
57
|
+
"message": "⚠️ 当前算力池切换中,请稍后重试"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "retry-attempt-stalled",
|
|
61
|
+
"match": "retry_attempt_stalled",
|
|
62
|
+
"action": "retry",
|
|
63
|
+
"type": "api_error",
|
|
64
|
+
"message": "⚠️ API 重试调用长时间无响应"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "selected-model-at-capacity",
|
|
68
|
+
"match": "selected model is at capacity",
|
|
69
|
+
"action": "retry",
|
|
70
|
+
"type": "api_error",
|
|
71
|
+
"message": "⚠️ 当前模型繁忙,请稍后重试"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "api-error-400",
|
|
75
|
+
"match": "api error: 400",
|
|
76
|
+
"action": "stop",
|
|
77
|
+
"type": "api_error",
|
|
78
|
+
"message": "❌ 请求格式错误,请检查输入内容"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "model-not-supported-403",
|
|
82
|
+
"match": "api error: 403 不支持该模型",
|
|
83
|
+
"action": "stop",
|
|
84
|
+
"type": "model_unavailable",
|
|
85
|
+
"message": "❌ 当前模型不受支持,请正确配置模型后重试"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "api-error-403",
|
|
89
|
+
"match": "api error: 403",
|
|
90
|
+
"action": "retry",
|
|
91
|
+
"type": "api_error",
|
|
92
|
+
"message": "⚠️ API 访问受限,请稍后重试"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "api-error-429",
|
|
96
|
+
"match": "api error: 429",
|
|
97
|
+
"action": "retry",
|
|
98
|
+
"type": "api_error",
|
|
99
|
+
"message": "⚠️ 请求过于频繁,请稍后重试"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "api-error-500",
|
|
103
|
+
"match": "api error: 500",
|
|
104
|
+
"action": "retry",
|
|
105
|
+
"type": "api_error",
|
|
106
|
+
"message": "❌ API 服务暂时不可用,请稍后重试"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "api-error-502",
|
|
110
|
+
"match": "api error: 502",
|
|
111
|
+
"action": "retry",
|
|
112
|
+
"type": "api_error"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "api-error-503",
|
|
116
|
+
"match": "api error: 503",
|
|
117
|
+
"action": "retry",
|
|
118
|
+
"type": "api_error"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "api-error-504",
|
|
122
|
+
"match": "api error: 504",
|
|
123
|
+
"action": "retry",
|
|
124
|
+
"type": "api_error"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "not-valid-json",
|
|
128
|
+
"match": "is not valid json",
|
|
129
|
+
"action": "retry",
|
|
130
|
+
"type": "api_error",
|
|
131
|
+
"message": "⚠️ API 返回异常响应,请稍后重试"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "json-parse-error",
|
|
135
|
+
"match": "json parse error",
|
|
136
|
+
"action": "retry",
|
|
137
|
+
"type": "api_error",
|
|
138
|
+
"message": "⚠️ API 返回 JSON 解析异常,请稍后重试"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "feishu-permission",
|
|
142
|
+
"match": "im:resource",
|
|
143
|
+
"action": "stop",
|
|
144
|
+
"type": "unknown",
|
|
145
|
+
"message": "❌ 权限不足,请联系管理员配置应用权限"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "stream-error",
|
|
149
|
+
"match": "stream",
|
|
150
|
+
"action": "retry",
|
|
151
|
+
"type": "stream_error"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "request-aborted",
|
|
155
|
+
"match": "request was aborted",
|
|
156
|
+
"action": "ignore",
|
|
157
|
+
"type": "stream_error"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
@@ -38,6 +38,7 @@ export var ErrorType;
|
|
|
38
38
|
ErrorType["STREAM_ERROR"] = "stream_error";
|
|
39
39
|
ErrorType["CONTEXT_TOO_LONG"] = "context_too_long";
|
|
40
40
|
ErrorType["MODEL_UNAVAILABLE"] = "model_unavailable";
|
|
41
|
+
ErrorType["SESSION_UNAVAILABLE"] = "session_unavailable";
|
|
41
42
|
ErrorType["SANDBOX_INITIALIZATION_FAILED"] = "sandbox_initialization_failed";
|
|
42
43
|
ErrorType["CLAUDE_STARTUP_ARGUMENTS_TOO_LONG"] = "claude_startup_arguments_too_long";
|
|
43
44
|
ErrorType["UNKNOWN"] = "unknown";
|
|
@@ -278,6 +279,9 @@ function hasRetryableHttpStatus(text) {
|
|
|
278
279
|
}
|
|
279
280
|
export function classifyError(error) {
|
|
280
281
|
const msg = (error?.message || '').toLowerCase();
|
|
282
|
+
if (error?.code === 'TOPIC_BACKEND_UNAVAILABLE') {
|
|
283
|
+
return ErrorType.SESSION_UNAVAILABLE;
|
|
284
|
+
}
|
|
281
285
|
// Startup-size failures are deterministic local failures and must win over
|
|
282
286
|
// dictionary rules that would otherwise turn them into generic retries.
|
|
283
287
|
if (isClaudeStartupArgumentsTooLong(error)) {
|
|
@@ -380,20 +384,23 @@ export function getErrorMessage(error, terminalReason, includeEmoji = true) {
|
|
|
380
384
|
}
|
|
381
385
|
// 回退到原有的错误消息匹配逻辑
|
|
382
386
|
const msg = error?.message || String(error);
|
|
387
|
+
const warnPrefix = includeEmoji ? '⚠️ ' : '';
|
|
388
|
+
const errPrefix = includeEmoji ? '❌ ' : '';
|
|
383
389
|
// Codex app-server reports this when another app-server still owns the
|
|
384
390
|
// thread writer. Surface the handoff condition instead of hiding it behind
|
|
385
391
|
// the generic "processing failed" message.
|
|
386
392
|
if (error?.code === 'THREAD_ACTIVE_WRITER' || /already has an active writer/i.test(msg)) {
|
|
387
|
-
|
|
388
|
-
|
|
393
|
+
return `${warnPrefix}Codex 会话正在由另一个执行通道占用,请稍后重试(THREAD_ACTIVE_WRITER)`;
|
|
394
|
+
}
|
|
395
|
+
if (error?.code === 'TOPIC_BACKEND_UNAVAILABLE'
|
|
396
|
+
|| /bound topic backend is unavailable/i.test(msg)) {
|
|
397
|
+
return `${warnPrefix}当前会话已失效,请发送 /renew。`;
|
|
389
398
|
}
|
|
390
399
|
// 字典优先 — 命中且有自定义消息则直接返回
|
|
391
400
|
const rule = matchErrorRule(msg.toLowerCase());
|
|
392
401
|
if (rule?.message)
|
|
393
402
|
return rule.message;
|
|
394
403
|
// 内置兜底规则(结构性错误)
|
|
395
|
-
const warnPrefix = includeEmoji ? '⚠️ ' : '';
|
|
396
|
-
const errPrefix = includeEmoji ? '❌ ' : '';
|
|
397
404
|
if (msg.includes('CONTEXT_COMPACT_FAILED') || isContextTooLongText(msg)) {
|
|
398
405
|
const detail = msg.match(/^CONTEXT_COMPACT_FAILED:\s*(.+)$/)?.[1]?.trim();
|
|
399
406
|
return detail
|
|
@@ -51,28 +51,28 @@ function createPlist(runtimeRoot) {
|
|
|
51
51
|
const args = [process.execPath, '--no-warnings=ExperimentalWarning', cliEntry, 'start']
|
|
52
52
|
.map(value => ` <string>${xmlLiteral(value)}</string>`)
|
|
53
53
|
.join('\n');
|
|
54
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
56
|
-
<plist version="1.0">
|
|
57
|
-
<dict>
|
|
58
|
-
<key>Label</key>
|
|
59
|
-
<string>${xmlLiteral(MACOS_AUTOSTART_LABEL)}</string>
|
|
60
|
-
<key>ProgramArguments</key>
|
|
61
|
-
<array>
|
|
62
|
-
${args}
|
|
63
|
-
</array>
|
|
64
|
-
<key>EnvironmentVariables</key>
|
|
65
|
-
<dict>
|
|
66
|
-
${environmentXml}
|
|
67
|
-
</dict>
|
|
68
|
-
<key>RunAtLoad</key>
|
|
69
|
-
<true/>
|
|
70
|
-
<key>StandardOutPath</key>
|
|
71
|
-
<string>${xmlLiteral(path.join(absoluteRoot, 'logs', 'autostart.stdout.log'))}</string>
|
|
72
|
-
<key>StandardErrorPath</key>
|
|
73
|
-
<string>${xmlLiteral(path.join(absoluteRoot, 'logs', 'autostart.stderr.log'))}</string>
|
|
74
|
-
</dict>
|
|
75
|
-
</plist>
|
|
54
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
56
|
+
<plist version="1.0">
|
|
57
|
+
<dict>
|
|
58
|
+
<key>Label</key>
|
|
59
|
+
<string>${xmlLiteral(MACOS_AUTOSTART_LABEL)}</string>
|
|
60
|
+
<key>ProgramArguments</key>
|
|
61
|
+
<array>
|
|
62
|
+
${args}
|
|
63
|
+
</array>
|
|
64
|
+
<key>EnvironmentVariables</key>
|
|
65
|
+
<dict>
|
|
66
|
+
${environmentXml}
|
|
67
|
+
</dict>
|
|
68
|
+
<key>RunAtLoad</key>
|
|
69
|
+
<true/>
|
|
70
|
+
<key>StandardOutPath</key>
|
|
71
|
+
<string>${xmlLiteral(path.join(absoluteRoot, 'logs', 'autostart.stdout.log'))}</string>
|
|
72
|
+
<key>StandardErrorPath</key>
|
|
73
|
+
<string>${xmlLiteral(path.join(absoluteRoot, 'logs', 'autostart.stderr.log'))}</string>
|
|
74
|
+
</dict>
|
|
75
|
+
</plist>
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
78
|
function restorePlist(file, previous) {
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
{"model":"claude-opus-4-8","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5}
|
|
2
|
-
{"model":"claude-opus-4-7","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5}
|
|
3
|
-
{"model":"claude-opus-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5}
|
|
4
|
-
{"model":"claude-sonnet-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":3,"price_output":15,"price_cache_creation":3.75,"price_cache_read":0.3}
|
|
5
|
-
{"model":"claude-haiku-4-5-20251001","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":0.8,"price_output":4,"price_cache_creation":1,"price_cache_read":0.08}
|
|
6
|
-
{"model":"gpt-5.6-sol","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":12.5,"price_cache_read":1}]}
|
|
7
|
-
{"model":"gpt-5.6-terra","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":6.25,"price_cache_read":0.5}]}
|
|
8
|
-
{"model":"gpt-5.6-luna","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1,"tiers":[{"up_to_input_tokens":272000,"price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1},{"up_to_input_tokens":null,"price_input":2,"price_output":9,"price_cache_creation":2.5,"price_cache_read":0.2}]}
|
|
9
|
-
{"model":"gpt-5.5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":0,"price_cache_read":1}]}
|
|
10
|
-
{"model":"gpt-5.4","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":0,"price_cache_read":0.5}]}
|
|
11
|
-
{"model":"gpt-5.3-codex","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1.75,"price_output":14,"price_cache_creation":0,"price_cache_read":0.175}
|
|
12
|
-
{"model":"deepseek-v4-pro","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8}
|
|
13
|
-
{"model":"deepseek-v4-flash","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.1,"price_cache_miss":0.5,"price_output":2}
|
|
14
|
-
{"model":"deepseek-v3.2","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8}
|
|
15
|
-
{"model":"kimi-k2.6","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0}
|
|
16
|
-
{"model":"kimi-k2.5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0}
|
|
17
|
-
{"model":"glm-5.1","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0}
|
|
18
|
-
{"model":"glm-5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0}
|
|
19
|
-
{"model":"glm-4.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0}
|
|
20
|
-
{"model":"MiniMax-M2.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0}
|
|
1
|
+
{"model":"claude-opus-4-8","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
|
|
2
|
+
{"model":"claude-opus-4-7","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
|
|
3
|
+
{"model":"claude-opus-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
|
|
4
|
+
{"model":"claude-sonnet-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":3,"price_output":15,"price_cache_creation":3.75,"price_cache_read":0.3,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":true}
|
|
5
|
+
{"model":"claude-haiku-4-5-20251001","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":0.8,"price_output":4,"price_cache_creation":1,"price_cache_read":0.08,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":false}
|
|
6
|
+
{"model":"gpt-5.6-sol","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":12.5,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
7
|
+
{"model":"gpt-5.6-terra","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":6.25,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
8
|
+
{"model":"gpt-5.6-luna","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1,"tiers":[{"up_to_input_tokens":272000,"price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1},{"up_to_input_tokens":null,"price_input":2,"price_output":9,"price_cache_creation":2.5,"price_cache_read":0.2}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
9
|
+
{"model":"gpt-5.5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":0,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
10
|
+
{"model":"gpt-5.4","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":0,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
11
|
+
{"model":"gpt-5.3-codex","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1.75,"price_output":14,"price_cache_creation":0,"price_cache_read":0.175,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
|
|
12
|
+
{"model":"deepseek-v4-pro","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
|
|
13
|
+
{"model":"deepseek-v4-flash","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.1,"price_cache_miss":0.5,"price_output":2,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
|
|
14
|
+
{"model":"deepseek-v3.2","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192,"supports_cache":true}
|
|
15
|
+
{"model":"kimi-k2.6","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
16
|
+
{"model":"kimi-k2.5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
17
|
+
{"model":"glm-5.1","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
18
|
+
{"model":"glm-5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
19
|
+
{"model":"glm-4.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
20
|
+
{"model":"MiniMax-M2.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
|
|
21
|
+
{"model":"claude-opus-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
|
|
22
|
+
{"model":"claude-sonnet-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
|
|
23
|
+
{"model":"claude-fable-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
|
package/dist/utils/npm-ops.js
CHANGED
|
@@ -14,6 +14,26 @@ import { getPackageRoot } from '../paths.js';
|
|
|
14
14
|
import { isWindows } from './cross-platform.js';
|
|
15
15
|
const execFileAsync = promisify(execFile);
|
|
16
16
|
// ── npm install -g (shared) ────────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* Can we run sudo without a password prompt?
|
|
19
|
+
*
|
|
20
|
+
* `sudo -n` never prompts: it exits non-zero instead when credentials are
|
|
21
|
+
* needed. That matters because upgrades run inside a detached monitor with no
|
|
22
|
+
* tty — a plain `sudo` there would block until the 180s timeout rather than
|
|
23
|
+
* fail. NOPASSWD rules and an unexpired credential cache both pass this check,
|
|
24
|
+
* so the cases where sudo can actually succeed are preserved.
|
|
25
|
+
*/
|
|
26
|
+
async function canSudoNonInteractively() {
|
|
27
|
+
if (isWindows)
|
|
28
|
+
return false;
|
|
29
|
+
try {
|
|
30
|
+
await execFileAsync('sudo', ['-n', 'true'], { timeout: 5000 });
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
17
37
|
export async function npmInstallGlobal(pkg, options = {}) {
|
|
18
38
|
let cmd;
|
|
19
39
|
let args;
|
|
@@ -41,7 +61,10 @@ export async function npmInstallGlobal(pkg, options = {}) {
|
|
|
41
61
|
if (isWindows) {
|
|
42
62
|
throw new Error('权限不足。请以管理员身份运行 PowerShell 或 CMD,然后重试');
|
|
43
63
|
}
|
|
44
|
-
await
|
|
64
|
+
if (!await canSudoNonInteractively()) {
|
|
65
|
+
throw new Error(`权限不足,且 sudo 需要密码(当前进程无法交互输入)。请手动执行: sudo npm install -g ${pkg}`);
|
|
66
|
+
}
|
|
67
|
+
await execFileAsync('sudo', ['-n', 'npm', 'install', '-g', pkg], {
|
|
45
68
|
timeout: options.timeoutMs ?? 180000,
|
|
46
69
|
windowsHide: false,
|
|
47
70
|
signal: options.signal,
|
package/dist/utils/welcome.js
CHANGED
|
@@ -31,23 +31,23 @@ export function generateWelcomeMessage(options) {
|
|
|
31
31
|
const bindingNote = options.includeBindingNote
|
|
32
32
|
? `\n\n🔐 **绑定说明**:\n- 这条消息表示您的设备已和此 Agent 绑定\n- 只有您能看到和使用这个 Agent\n- AUN 提供端到端加密和跨设备同步`
|
|
33
33
|
: '';
|
|
34
|
-
return `🎉 欢迎使用 EvolCore!
|
|
35
|
-
|
|
36
|
-
${greeting}
|
|
37
|
-
|
|
38
|
-
${agentIntro}${channelInfo}
|
|
39
|
-
|
|
40
|
-
📋 **日常使用方法**:
|
|
41
|
-
|
|
42
|
-
1. **查看帮助**:发送 \`/help\` 查看所有可用命令
|
|
43
|
-
2. **查看状态**:发送 \`/status\` 查看当前会话状态
|
|
44
|
-
3. **会话管理**:发送 \`/session\` 查看和切换会话
|
|
45
|
-
|
|
46
|
-
💡 **提示**:
|
|
47
|
-
- 直接发送消息即可与 Claude/Codex 对话
|
|
48
|
-
- 支持多会话管理,每个会话独立上下文
|
|
49
|
-
- 所有命令以 \`/\` 开头${channelSpecificNote}${bindingNote}
|
|
50
|
-
|
|
34
|
+
return `🎉 欢迎使用 EvolCore!
|
|
35
|
+
|
|
36
|
+
${greeting}
|
|
37
|
+
|
|
38
|
+
${agentIntro}${channelInfo}
|
|
39
|
+
|
|
40
|
+
📋 **日常使用方法**:
|
|
41
|
+
|
|
42
|
+
1. **查看帮助**:发送 \`/help\` 查看所有可用命令
|
|
43
|
+
2. **查看状态**:发送 \`/status\` 查看当前会话状态
|
|
44
|
+
3. **会话管理**:发送 \`/session\` 查看和切换会话
|
|
45
|
+
|
|
46
|
+
💡 **提示**:
|
|
47
|
+
- 直接发送消息即可与 Claude/Codex 对话
|
|
48
|
+
- 支持多会话管理,每个会话独立上下文
|
|
49
|
+
- 所有命令以 \`/\` 开头${channelSpecificNote}${bindingNote}
|
|
50
|
+
|
|
51
51
|
现在就可以开始工作了!`;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -65,25 +65,25 @@ export function generateInitSuccessMessage(channelType, hasOwner) {
|
|
|
65
65
|
const channelName = getChannelDescription(channelType);
|
|
66
66
|
// AUN 在 connect 时向 owner 发送欢迎消息
|
|
67
67
|
if (hasOwner && channelType === 'aun') {
|
|
68
|
-
return `\n💡 提示:首次启动时会向 owner 发送欢迎消息
|
|
68
|
+
return `\n💡 提示:首次启动时会向 owner 发送欢迎消息
|
|
69
69
|
启动服务: ec start`;
|
|
70
70
|
}
|
|
71
71
|
// Feishu 虽然有 owner,但已改为首次交互发送(与其他 IM 统一)
|
|
72
72
|
if (hasOwner && channelType === 'feishu') {
|
|
73
|
-
return `\n💡 提示:首次用户交互时会发送欢迎消息
|
|
73
|
+
return `\n💡 提示:首次用户交互时会发送欢迎消息
|
|
74
74
|
启动服务: ec start`;
|
|
75
75
|
}
|
|
76
76
|
// 其他 IM 渠道:首次交互发送
|
|
77
77
|
if (hasOwner) {
|
|
78
|
-
return `\n💡 提示:${channelName}渠道已配置
|
|
78
|
+
return `\n💡 提示:${channelName}渠道已配置
|
|
79
79
|
启动服务: ec start`;
|
|
80
80
|
}
|
|
81
81
|
const ownerHint = channelType === 'aun'
|
|
82
82
|
? ` 配置 owner: ec init ${channelType}`
|
|
83
83
|
: ' 配置 owner: 在 agent config.json 的 owners 中写入 AID;非 AUN 渠道身份写入 contact.json';
|
|
84
84
|
// 无 owner 的渠道
|
|
85
|
-
return `\n💡 提示:${channelName}渠道已配置
|
|
86
|
-
启动服务: ec start
|
|
85
|
+
return `\n💡 提示:${channelName}渠道已配置
|
|
86
|
+
启动服务: ec start
|
|
87
87
|
${ownerHint}`;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
@@ -693,7 +693,7 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
693
693
|
'/TN', WINDOWS_AUTOSTART_TASK_NAME,
|
|
694
694
|
'/SC', 'ONLOGON',
|
|
695
695
|
'/TR', taskCommand(scriptPath),
|
|
696
|
-
'/RL', '
|
|
696
|
+
'/RL', 'HIGHEST',
|
|
697
697
|
'/F',
|
|
698
698
|
];
|
|
699
699
|
const result = runSchtasks(args);
|