rednote-cli 0.1.5__tar.gz → 0.1.7__tar.gz
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.
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/PKG-INFO +1 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/pyproject.toml +1 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/__init__.py +1 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/account_manager.py +5 -3
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/rednote/issues.py +2 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/account.py +1 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/infra/paths.py +9 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/PKG-INFO +1 -1
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/README.md +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/setup.cfg +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/common/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/common/app_utils.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/common/config.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/common/enums.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/common/errors.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/browser/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/browser/manager.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/database/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/core/database/manager.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/base.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/factory.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/media.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/models.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/validator.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/rednote/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/services/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/services/scraper_service.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/output/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/output/event_stream.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/output/formatter_json.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/output/formatter_table.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/output/writer.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/persistence/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/persistence/file_account_repo.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/extractor.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/publisher.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/runtime_extractor.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/runtime_publisher.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/runtime_registration.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/dto/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/dto/input_models.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/dto/output_models.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/account_list.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/account_mutation.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/auth_login.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/auth_status.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/doctor.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/init_runtime.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/note_get.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/note_search.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/publish_note.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/user_get.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/user_search.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/user_self.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/__main__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/doctor.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/init.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/note.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/publish.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/search.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/commands/user.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/main.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/options.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/runtime.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/utils.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/cli/xsec_help.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/domain/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/domain/errors.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/domain/note_search_filters.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/infra/__init__.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/infra/exit_codes.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/infra/logger.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/infra/platforms.py +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/SOURCES.txt +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/dependency_links.txt +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/entry_points.txt +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/requires.txt +0 -0
- {rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli.egg-info/top_level.txt +0 -0
|
@@ -183,7 +183,7 @@ class AccountManager:
|
|
|
183
183
|
for attempt in range(1, max_attempts + 1):
|
|
184
184
|
qr = page.locator(qr_selector).first
|
|
185
185
|
try:
|
|
186
|
-
await qr.wait_for(state="visible", timeout=
|
|
186
|
+
await qr.wait_for(state="visible", timeout=30_000)
|
|
187
187
|
await page.screenshot(path=str(screenshot_file), full_page=False)
|
|
188
188
|
screenshot_path = str(screenshot_file.resolve())
|
|
189
189
|
logger.info(f"Remote login screenshot saved: {screenshot_path}")
|
|
@@ -201,7 +201,7 @@ class AccountManager:
|
|
|
201
201
|
"issue": None,
|
|
202
202
|
}
|
|
203
203
|
except PlaywrightTimeoutError:
|
|
204
|
-
|
|
204
|
+
pass
|
|
205
205
|
|
|
206
206
|
issue = await detect_issue_from_page(page, include_body=True)
|
|
207
207
|
if issue is None:
|
|
@@ -209,11 +209,13 @@ class AccountManager:
|
|
|
209
209
|
source="page",
|
|
210
210
|
failure_reason="登录二维码未就绪",
|
|
211
211
|
next_action="请刷新页面后重试登录",
|
|
212
|
+
agent_action="RETRY_LATER",
|
|
213
|
+
retry_recommended=True,
|
|
212
214
|
)
|
|
213
215
|
last_issue = issue
|
|
214
216
|
logger.warning(
|
|
215
217
|
"Remote login issue detected: "
|
|
216
|
-
f"{issue.
|
|
218
|
+
f"{issue.failure_type} retry={issue.retry_recommended}"
|
|
217
219
|
)
|
|
218
220
|
if issue.retry_recommended and attempt < max_attempts:
|
|
219
221
|
await page.reload(wait_until="domcontentloaded")
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/rednote/issues.py
RENAMED
|
@@ -165,6 +165,7 @@ def build_unknown_issue(
|
|
|
165
165
|
failure_reason: str = "未知原因",
|
|
166
166
|
next_action: str = "请联系开发者",
|
|
167
167
|
agent_action: str = "STOP",
|
|
168
|
+
retry_recommended: bool = False,
|
|
168
169
|
) -> RednoteIssue:
|
|
169
170
|
return RednoteIssue(
|
|
170
171
|
failure_type="UNKNOWN",
|
|
@@ -173,7 +174,7 @@ def build_unknown_issue(
|
|
|
173
174
|
next_action=next_action,
|
|
174
175
|
agent_action=agent_action,
|
|
175
176
|
source=source,
|
|
176
|
-
retry_recommended=
|
|
177
|
+
retry_recommended=retry_recommended,
|
|
177
178
|
cli_code="INTERNAL_ERROR",
|
|
178
179
|
observed_text=_normalize_text(observed_text),
|
|
179
180
|
)
|
|
@@ -45,7 +45,7 @@ def account_login(
|
|
|
45
45
|
screenshot_path: str = typer.Option(
|
|
46
46
|
"",
|
|
47
47
|
"--screenshot-path",
|
|
48
|
-
help="remote 模式屏幕截图路径,可传目录或文件路径,默认为
|
|
48
|
+
help="remote 模式屏幕截图路径,可传目录或文件路径,默认为 $REDNOTE_OPERATOR_HOME/outputs 或 $HOME/.rednote_cli/outputs 下的 login_viewport.png",
|
|
49
49
|
),
|
|
50
50
|
):
|
|
51
51
|
"""启动登录流程并写入持久登录态。"""
|
|
@@ -3,7 +3,15 @@ from __future__ import annotations
|
|
|
3
3
|
import os
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
def _resolve_app_home() -> Path:
|
|
8
|
+
configured = os.getenv("REDNOTE_OPERATOR_HOME")
|
|
9
|
+
if configured:
|
|
10
|
+
return Path(configured).expanduser().resolve()
|
|
11
|
+
return (Path.home() / ".rednote_cli").resolve()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
APP_HOME = _resolve_app_home()
|
|
7
15
|
SCHEMA_DIR = APP_HOME / "schemas"
|
|
8
16
|
LOG_DIR = APP_HOME / "logs"
|
|
9
17
|
OUTPUT_DIR = APP_HOME / "outputs"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/__init__.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/media.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/models.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/publishing/validator.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/platforms/rednote/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/_runtime/services/scraper_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/persistence/file_account_repo.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/__init__.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/extractor.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/adapters/platform/rednote/publisher.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/account_list.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/account_mutation.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/auth_status.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/init_runtime.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/note_search.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/publish_note.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.5 → rednote-cli-0.1.7}/src/rednote_cli/application/use_cases/user_search.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|