netizen-cli 0.15.1__tar.gz → 0.15.2__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.
- {netizen_cli-0.15.1/netizen_cli.egg-info → netizen_cli-0.15.2}/PKG-INFO +1 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/__init__.py +1 -1
- netizen_cli-0.15.2/netizen_cli/admin/answer_previews.py +120 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/file_previews.py +19 -4
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/admin.js +45 -2
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/web.py +31 -21
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/codex_runtime.py +16 -2
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/project_files.py +16 -5
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/runtime/contracts.py +8 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2/netizen_cli.egg-info}/PKG-INFO +1 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli.egg-info/SOURCES.txt +1 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/pyproject.toml +1 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/admin.md +3 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_codex_runtime.py +8 -2
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_latest_answer.py +29 -1
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/MANIFEST.in +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/README.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/_build.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/config.example.yaml +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/__main__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/account_rate_limits.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/auth.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/credentials.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/errors.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/feishu.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/login.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/port_config.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/presentation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/queries.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/admin.css +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/attachment-files.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/chat-picker.css +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/chat-picker.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/content-preview.css +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/content-preview.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/file-browser.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/identity.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/index.html +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/login.html +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/login.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/netizen.svg +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/progress-card.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/project-files.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/question-notifications.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/session-access.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/LICENSE +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/README.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/ace.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/mode-javascript.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/mode-json.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/mode-markdown.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/mode-python.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/worktrees.js +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/transport.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/users.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/attachments.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/bindings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/builtin_skills.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/callbacks.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/chat_target.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/controls.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/defaults.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/fork.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/pagination.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/questions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/reply.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/scheduled.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/session_ids.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/status.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/usage.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cards/workspace.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/completion_mentions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/input_preparation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/messages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/ports.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/question_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/reactions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/reply_presenter.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/reply_suppression.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/session_pages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel/topics.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/channel_app.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/chat_avatars.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/chat_targets.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_data.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_packages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_services.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_setup.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_update.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_update_restore.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/cli_update_worker.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/completion_mention.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/database_migrations.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/defaults/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/defaults/models.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/defaults/service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/defaults/store.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/deployment/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/deployment/restart_worker.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/deployment/update_executor.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/deployment/update_protocol.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/domain.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/error_messages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/experience.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/feishu_app_onboarding.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/feishu_app_permissions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/feishu_links.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/file_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/git_status.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/image_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/instance.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/lark_app.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/main.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/attachment_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/blocking_io.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/chat_directory.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/chat_labels.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/coordination.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/project_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/management/updates.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/markdown_images.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/mcp_transport.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/message_content.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/message_history.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/message_preparation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/message_projection.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/schema.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v14.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v15.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v16.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v17.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v18.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v19.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/migrations/v20.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/model_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/package_resources.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/pagination.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/partial_answers.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/progress_card_config.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/progress_card_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/projects.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/prompt_projection.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/question_notifications.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/quoted_context.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/result_images.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/runtime/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/runtime/name_writes.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/runtime/thread_naming.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/mcp.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/models.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/scheduler.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/schedules/store.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sdk_gap_adapter.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/service_launcher.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/session_inventory.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/session_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/__init__.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/delegation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/errors.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/mcp.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/policy.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/presentation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/schema.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/sessions/sources.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/skill_references.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/task_text.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/terminal_cleanup.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/thread_history.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/turn_activity.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/turn_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/turn_patch_children.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/turn_plan_observer.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/user_questions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/errors.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/git.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/models.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/policy.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/worktrees/store.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli.egg-info/dependency_links.txt +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli.egg-info/entry_points.txt +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli.egg-info/requires.txt +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli.egg-info/top_level.txt +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/setup.cfg +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-lark/SKILL.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-runtime-guidance/SKILL.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/SKILL.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/commands.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/concepts.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/faq.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/feedback-and-files.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/fork-side-goal.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/messages.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/native-capabilities.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/scheduled-tasks.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/session-collaboration.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/sessions.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/status-and-control.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/skills/netizen-user-guide/references/user-guide.md +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_account_rate_limits.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_admin_update_executor_probe.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_attachments.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_binding_scheduled_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_bindings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_card_error_feedback.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_channel_app.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_channel_fixtures.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_channel_input_preparation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_chat_avatars.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_chat_target_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_check_sdk.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_data.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_distribution.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_integration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_packages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_packaging.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_services.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_setup.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cli_update.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_codex_sdk_capabilities.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_codex_sdk_upgrade_0161.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_codex_sdk_upgrade_0163.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_completion_mention_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_completion_mentions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_completion_topic_delivery.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_configuration_publication.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_cron_chat_targets.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_database_migrations.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_defaults_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_defaults_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_defaults_runtime.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_defaults_worktree_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_deployment.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_documentation_links.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_domain_experience.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_error_messages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_feishu_app_onboarding.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_feishu_app_permissions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_file_input_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_file_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_file_pagination.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_fork_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_git_status.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_goal_reply_separation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_image_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_lark_app.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_lark_sdk_contract.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_main.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_markdown_images.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_message_content.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_message_history.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_message_material_inputs.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_message_preparation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_migration_schema_validation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_model_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_name_writes.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_optional_progress_card_settings_migration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_pagination.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_partial_answer_delivery.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_partial_answers.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_persistent_fork_bindings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_persistent_fork_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_persistent_fork_runtime.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_child_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_feishu_completion_mention.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_feishu_partial_answers.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_feishu_turn_file_card.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_persistent_fork.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_python_sdk.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_scheduled_tasks.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_sdk_completion_race.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_sdk_response_recovery.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_skill_execution.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_probe_thread_naming.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_progress_card_config.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_progress_card_entrypoints.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_progress_card_presentation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_progress_card_settings_migration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_project_delete_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_project_delete_runtime.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_project_deletion_storage.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_project_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_prompt_projection.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_question_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_question_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_question_notification_config.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_question_target_parity.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_quoted_context.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_release_script.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_rename_name_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_reply_suppression.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_repository_hygiene.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_result_images.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_resume_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_retired_deployment.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_runtime_resume_activation.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_runtime_thread_naming.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_auto_archive_migration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_card_retry.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_mcp.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_run_now.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_scope_matrix.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_trigger_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_workspace_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_workspace_migration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_workspace_service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedule_workspace_storage.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduled_auto_archive.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduled_channel.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduled_runtime.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduled_worktrees.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduler.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_scheduler_presenter.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_schedules_storage.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_sdk_gap_adapter.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_service_launcher.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_card_pages.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_collaboration_app.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_defaults.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_defaults_migration.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_external_runtime.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_id_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_policy.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_session_tools.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_settings_projects.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_status_cards.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_status_commands.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_suppress_reply.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_task_text.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_terminal_cleanup.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_thread_history.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_thread_naming.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_turn_activity.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_turn_files.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_turn_patch_children.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_turn_patch_statistics.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_turn_plan_observer.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_update_executor.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_usage_card.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_usage_control.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_user_guide_skill.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_user_questions.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_channel_cwd.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_git.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_new.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_runtime_cwd.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_service.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_settings.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_storage.py +0 -0
- {netizen_cli-0.15.1 → netizen_cli-0.15.2}/tests/test_worktree_tools_integration.py +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Bounded native image content for a single latest-answer response.
|
|
2
|
+
|
|
3
|
+
Paths only match final Markdown references to the same Turn's generated images.
|
|
4
|
+
No filesystem, network, history cache or additional native request is involved.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import base64
|
|
9
|
+
import json
|
|
10
|
+
from urllib.parse import unquote, urlsplit
|
|
11
|
+
|
|
12
|
+
from ..project_files import FileBrowseError, validate_image
|
|
13
|
+
from ..runtime.contracts import NativeLatestAnswer
|
|
14
|
+
from .file_previews import render_markdown
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
MAX_IMAGE_BYTES = 10 * 1024 * 1024
|
|
18
|
+
MAX_TOTAL_IMAGE_BYTES = 20 * 1024 * 1024
|
|
19
|
+
MAX_ANSWER_IMAGES = 16
|
|
20
|
+
MAX_TOTAL_IMAGE_PIXELS = 32_000_000
|
|
21
|
+
MAX_IMAGE_DIMENSION = 16_384
|
|
22
|
+
MAX_IMAGE_RESPONSE_BYTES = 32 * 1024 * 1024
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _absolute_path(value: str) -> bool:
|
|
26
|
+
return (
|
|
27
|
+
0 < len(value) <= 4096
|
|
28
|
+
and value.startswith("/") and not value.startswith("//")
|
|
29
|
+
and "\\" not in value
|
|
30
|
+
and not any(ord(c) < 32 or 127 <= ord(c) <= 159 for c in value)
|
|
31
|
+
and all(part not in {"", ".", ".."} for part in value.split("/")[1:])
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _reference_path(value: str) -> str | None:
|
|
36
|
+
try:
|
|
37
|
+
parts = urlsplit(value)
|
|
38
|
+
if parts.scheme or parts.netloc or parts.query or parts.fragment:
|
|
39
|
+
return None
|
|
40
|
+
path = unquote(parts.path, errors="strict")
|
|
41
|
+
if unquote(path, errors="strict") != path or not _absolute_path(path):
|
|
42
|
+
return None
|
|
43
|
+
return path
|
|
44
|
+
except (ValueError, UnicodeError):
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def render_answer_preview(answer: NativeLatestAnswer) -> dict:
|
|
49
|
+
"""Validate only referenced images; failures preserve the complete text."""
|
|
50
|
+
candidates: dict[str, str | None] = {}
|
|
51
|
+
if answer.status == "completed":
|
|
52
|
+
for image in answer.images:
|
|
53
|
+
if _absolute_path(image.saved_path):
|
|
54
|
+
# Multiple native items for one path are ambiguous, even when
|
|
55
|
+
# their current bytes happen to agree. Never choose the last.
|
|
56
|
+
candidates[image.saved_path] = None if image.saved_path in candidates else image.data
|
|
57
|
+
selected: dict[str, str | None] = {}
|
|
58
|
+
pixels: dict[str, int] = {}
|
|
59
|
+
images: list[dict[str, str]] = []
|
|
60
|
+
remaining = MAX_TOTAL_IMAGE_BYTES
|
|
61
|
+
remaining_pixels = MAX_TOTAL_IMAGE_PIXELS
|
|
62
|
+
|
|
63
|
+
def select(target: str) -> str | None:
|
|
64
|
+
nonlocal remaining, remaining_pixels
|
|
65
|
+
path = _reference_path(target)
|
|
66
|
+
if path is None:
|
|
67
|
+
return None
|
|
68
|
+
if path in selected:
|
|
69
|
+
if selected[path] is not None:
|
|
70
|
+
if pixels[path] > remaining_pixels:
|
|
71
|
+
return None
|
|
72
|
+
remaining_pixels -= pixels[path]
|
|
73
|
+
return selected[path]
|
|
74
|
+
selected[path] = None
|
|
75
|
+
data = candidates.get(path)
|
|
76
|
+
if not data or len(images) >= MAX_ANSWER_IMAGES:
|
|
77
|
+
return None
|
|
78
|
+
if len(data) % 4 or len(data) > 4 * ((MAX_IMAGE_BYTES + 2) // 3):
|
|
79
|
+
return None
|
|
80
|
+
size = len(data) // 4 * 3 - (2 if data.endswith("==") else 1 if data.endswith("=") else 0)
|
|
81
|
+
if size > MAX_IMAGE_BYTES or size > remaining:
|
|
82
|
+
return None
|
|
83
|
+
# Charge attempted decoding, including invalid images, once per path.
|
|
84
|
+
remaining -= size
|
|
85
|
+
try:
|
|
86
|
+
decoded = base64.b64decode(data, validate=True)
|
|
87
|
+
if not decoded.startswith(b"\x89PNG\r\n\x1a\n") or not decoded.endswith(b"\x00\x00\x00\x00IEND\xaeB`\x82"):
|
|
88
|
+
return None
|
|
89
|
+
width, height = validate_image(
|
|
90
|
+
decoded, "image/png", max_bytes=MAX_IMAGE_BYTES,
|
|
91
|
+
max_pixels=MAX_TOTAL_IMAGE_PIXELS, max_dimension=MAX_IMAGE_DIMENSION,
|
|
92
|
+
)
|
|
93
|
+
except (ValueError, FileBrowseError):
|
|
94
|
+
return None
|
|
95
|
+
if width * height > remaining_pixels:
|
|
96
|
+
return None
|
|
97
|
+
# Count every rendered occurrence, even when Blob bytes are shared.
|
|
98
|
+
pixels[path] = width * height
|
|
99
|
+
remaining_pixels -= pixels[path]
|
|
100
|
+
slot = f"image-{len(images)}"
|
|
101
|
+
images.append({"id": slot, "mime": "image/png", "data": data})
|
|
102
|
+
selected[path] = slot
|
|
103
|
+
return slot
|
|
104
|
+
|
|
105
|
+
html = render_markdown(answer.answer or "", answer_image=select, max_images=MAX_ANSWER_IMAGES)
|
|
106
|
+
preview = {"markdownHtml": html, "images": images}
|
|
107
|
+
# Include text plus HTML and leave room for the fixed identity/time envelope.
|
|
108
|
+
# This budget does not truncate the pre-existing text-only response.
|
|
109
|
+
# Validated base64 is ASCII without JSON escapes. Count it directly instead
|
|
110
|
+
# of serializing/copying all image strings a second time just to measure.
|
|
111
|
+
envelope = {"answer": answer.answer, "markdownHtml": html,
|
|
112
|
+
"images": [{**image, "data": ""} for image in images]}
|
|
113
|
+
response_size = len(json.dumps(envelope, ensure_ascii=True)) + sum(len(image["data"]) for image in images)
|
|
114
|
+
if images and response_size + 4096 > MAX_IMAGE_RESPONSE_BYTES:
|
|
115
|
+
return {
|
|
116
|
+
"markdownHtml": render_markdown(answer.answer or "", answer_image=lambda _: None),
|
|
117
|
+
"images": [],
|
|
118
|
+
"previewMessage": "图片超过预览总量限制,已保留正文。",
|
|
119
|
+
}
|
|
120
|
+
return preview
|
|
@@ -158,6 +158,8 @@ def render_markdown(
|
|
|
158
158
|
*,
|
|
159
159
|
path: str | None = None,
|
|
160
160
|
image_url: Callable[[str], str] | None = None,
|
|
161
|
+
answer_image: Callable[[str], str | None] | None = None,
|
|
162
|
+
max_images: int = MAX_MARKDOWN_IMAGES,
|
|
161
163
|
) -> str:
|
|
162
164
|
"""Render safe HTML; image_url maps a root-relative file to its Admin endpoint.
|
|
163
165
|
|
|
@@ -166,7 +168,9 @@ def render_markdown(
|
|
|
166
168
|
carry ``data-file-browser-directory="true"``.
|
|
167
169
|
Remote images and fragment-only links remain inert. No filesystem or network
|
|
168
170
|
access occurs here; the file endpoint separately validates image contents.
|
|
169
|
-
Without a file context, local links
|
|
171
|
+
Without a file context, local links remain inert. An answer_image resolver
|
|
172
|
+
may select already validated native image data by opaque slot id; it never
|
|
173
|
+
grants file access or creates a resource URL.
|
|
170
174
|
"""
|
|
171
175
|
try:
|
|
172
176
|
length = len(text.encode("utf-8"))
|
|
@@ -208,12 +212,23 @@ def render_markdown(
|
|
|
208
212
|
token.attrSet("data-file-browser-directory", "true")
|
|
209
213
|
elif token.type == "image":
|
|
210
214
|
target = _target(token.attrGet("src") or "", directory)
|
|
211
|
-
if path is None
|
|
215
|
+
if path is None and answer_image is not None:
|
|
216
|
+
slot = answer_image(token.attrGet("src") or "") if images < max_images else None
|
|
217
|
+
if slot is None:
|
|
218
|
+
_replace_image(token, "图片预览暂不可用")
|
|
219
|
+
else:
|
|
220
|
+
token.children = [Token("text", "", 0, content=_image_alt(token.children or []))]
|
|
221
|
+
token.attrs.pop("src", None)
|
|
222
|
+
token.attrSet("data-answer-image", slot)
|
|
223
|
+
token.attrSet("loading", "lazy")
|
|
224
|
+
token.attrSet("decoding", "async")
|
|
225
|
+
images += 1
|
|
226
|
+
elif path is None or image_url is None:
|
|
212
227
|
_replace_image(token, "此处不加载图片")
|
|
213
228
|
elif target is None or target[0] != "local":
|
|
214
229
|
_replace_image(token, "仅预览当前根目录内的相对路径图片")
|
|
215
|
-
elif images >=
|
|
216
|
-
_replace_image(token, "本页最多预览
|
|
230
|
+
elif images >= max_images:
|
|
231
|
+
_replace_image(token, f"本页最多预览 {max_images} 张图片")
|
|
217
232
|
else:
|
|
218
233
|
token.children = [Token(
|
|
219
234
|
"text", "", 0, content=_image_alt(token.children or []),
|
|
@@ -2399,10 +2399,49 @@ let latestAnswerView = null;
|
|
|
2399
2399
|
let latestAnswerRequest = 0;
|
|
2400
2400
|
const answerNode = (name) => document.querySelector(`#session-answer-${name}`);
|
|
2401
2401
|
|
|
2402
|
+
function releaseLatestAnswerImages(view) {
|
|
2403
|
+
if (!view) return;
|
|
2404
|
+
for (const url of view.imageUrls.values()) URL.revokeObjectURL(url);
|
|
2405
|
+
view.imageUrls.clear();
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
function installLatestAnswerImages(view, images) {
|
|
2409
|
+
const slots = new Map();
|
|
2410
|
+
for (const node of answerNode("content").querySelectorAll("[data-answer-image]")) {
|
|
2411
|
+
const id = node.dataset.answerImage;
|
|
2412
|
+
if (!slots.has(id)) slots.set(id, []);
|
|
2413
|
+
slots.get(id).push(node);
|
|
2414
|
+
}
|
|
2415
|
+
const unavailable = (node) => node.replaceWith(document.createTextNode(
|
|
2416
|
+
`〔图片:${node.getAttribute("alt") || "图片"};图片预览不可用〕`,
|
|
2417
|
+
));
|
|
2418
|
+
for (const [id, nodes] of slots) {
|
|
2419
|
+
const image = Array.isArray(images) ? images.find((item) => item?.id === id) : null;
|
|
2420
|
+
try {
|
|
2421
|
+
// Only bounded, validated PNG bytes from this answer response are accepted.
|
|
2422
|
+
if (image?.mime !== "image/png" || typeof image.data !== "string") throw new Error("Invalid answer image");
|
|
2423
|
+
const decoded = atob(image.data);
|
|
2424
|
+
const bytes = new Uint8Array(decoded.length);
|
|
2425
|
+
for (let index = 0; index < decoded.length; index += 1) bytes[index] = decoded.charCodeAt(index);
|
|
2426
|
+
const url = URL.createObjectURL(new Blob([bytes], { type: image.mime }));
|
|
2427
|
+
view.imageUrls.set(id, url);
|
|
2428
|
+
for (const node of nodes) {
|
|
2429
|
+
node.addEventListener("error", () => {
|
|
2430
|
+
if (latestAnswerView === view && view.imageUrls.get(id) === url) unavailable(node);
|
|
2431
|
+
}, { once: true });
|
|
2432
|
+
node.src = url;
|
|
2433
|
+
}
|
|
2434
|
+
} catch (_error) {
|
|
2435
|
+
for (const node of nodes) unavailable(node);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2402
2440
|
function closeLatestAnswer() {
|
|
2403
2441
|
latestAnswerRequest += 1;
|
|
2404
2442
|
const previous = latestAnswerView;
|
|
2405
2443
|
latestAnswerView = null;
|
|
2444
|
+
releaseLatestAnswerImages(previous);
|
|
2406
2445
|
document.body.classList.toggle("session-answer-open", false);
|
|
2407
2446
|
answerNode("content").replaceChildren();
|
|
2408
2447
|
answerNode("source").textContent = "";
|
|
@@ -2413,7 +2452,8 @@ function closeLatestAnswer() {
|
|
|
2413
2452
|
|
|
2414
2453
|
async function openLatestAnswer(session) {
|
|
2415
2454
|
if (state.authExpired || !session.canReadLatestAnswer) return;
|
|
2416
|
-
latestAnswerView
|
|
2455
|
+
releaseLatestAnswerImages(latestAnswerView);
|
|
2456
|
+
latestAnswerView = { session, returnFocus: document.activeElement, preview: true, result: null, imageUrls: new Map() };
|
|
2417
2457
|
answerNode("title").textContent = "最近一轮回答";
|
|
2418
2458
|
answerNode("identity").textContent = `${session.nativeTitle || "未命名会话"} · ${session.shortId}`;
|
|
2419
2459
|
answerNode("content").textContent = "";
|
|
@@ -2456,8 +2496,11 @@ async function refreshLatestAnswer() {
|
|
|
2456
2496
|
const status = { completed: "已完成", interrupted: "已停止", failed: "失败", inProgress: "运行中" }[result.status] || "状态未知";
|
|
2457
2497
|
answerNode("note").textContent = result.turnId
|
|
2458
2498
|
? `本轮${status}${result.answer ? "" : ",暂无最终回答。"}` : "会话尚无执行轮次。";
|
|
2459
|
-
|
|
2499
|
+
const { images, ...snapshot } = result;
|
|
2500
|
+
releaseLatestAnswerImages(view);
|
|
2501
|
+
view.result = snapshot;
|
|
2460
2502
|
window.NetizenContentPreview.renderMarkdown(answerNode("content"), result.answer ? result.markdownHtml : null);
|
|
2503
|
+
installLatestAnswerImages(view, images);
|
|
2461
2504
|
answerNode("source").textContent = result.answer || "";
|
|
2462
2505
|
answerNode("preview-note").textContent = result.previewMessage || "";
|
|
2463
2506
|
renderLatestAnswer(view);
|
|
@@ -39,6 +39,7 @@ from .auth import (
|
|
|
39
39
|
)
|
|
40
40
|
from .errors import AdminWebError
|
|
41
41
|
from .file_previews import PreviewUnavailable, render_markdown
|
|
42
|
+
from .answer_previews import render_answer_preview
|
|
42
43
|
from .credentials import AdminCredentials
|
|
43
44
|
from .feishu import AuthExpired, FeishuClient, FeishuError
|
|
44
45
|
from .login import AdminLogin
|
|
@@ -210,7 +211,7 @@ _SECURITY_HEADERS = (
|
|
|
210
211
|
b"Content-Security-Policy",
|
|
211
212
|
(
|
|
212
213
|
"default-src 'self'; script-src 'self'; style-src 'self'; "
|
|
213
|
-
f"img-src 'self' {CHAT_AVATAR_IMAGE_SOURCES}
|
|
214
|
+
f"img-src 'self' {CHAT_AVATAR_IMAGE_SOURCES} blob:; "
|
|
214
215
|
"object-src 'none'; base-uri 'none'; frame-ancestors 'none'; "
|
|
215
216
|
"form-action 'self'"
|
|
216
217
|
).encode("ascii"),
|
|
@@ -1533,25 +1534,28 @@ class AdminWebApplication:
|
|
|
1533
1534
|
raise AdminWebError(504, "answer_timeout", "最近一轮读取超时,请手动重试。") from error
|
|
1534
1535
|
except (CodexError, ThreadHistoryUnavailable, OSError) as error:
|
|
1535
1536
|
raise AdminWebError(503, "answer_unavailable", "会话历史暂时不可读取,可能已删除或不可用。") from error
|
|
1536
|
-
|
|
1537
|
+
payload = {
|
|
1538
|
+
"requestId": context.request.request_id,
|
|
1539
|
+
"threadId": answer.thread_id, "turnId": answer.turn_id,
|
|
1540
|
+
"status": answer.status, "answer": answer.answer,
|
|
1541
|
+
"startedAt": answer.started_at, "completedAt": answer.completed_at,
|
|
1542
|
+
"readAt": datetime.now().astimezone().isoformat(),
|
|
1543
|
+
}
|
|
1544
|
+
response = None
|
|
1537
1545
|
if answer.answer:
|
|
1538
1546
|
try:
|
|
1539
|
-
|
|
1540
|
-
|
|
1547
|
+
# Decode, render and encode the larger image-bearing response
|
|
1548
|
+
# in the existing bounded executor, off the service event loop.
|
|
1549
|
+
response = await self._management.file_reads.submit(
|
|
1550
|
+
lambda: _json_response(200, {**payload, **render_answer_preview(answer)}, ensure_ascii=True),
|
|
1551
|
+
deadline=deadline,
|
|
1541
1552
|
)
|
|
1542
1553
|
except PreviewUnavailable:
|
|
1543
|
-
|
|
1554
|
+
payload["previewMessage"] = "回答超出排版预览限制,已显示原文。"
|
|
1544
1555
|
except (TimeoutError, BlockingIOResultUnknown, BlockingIOExecutorClosed, BlockingIOExecutorSaturated):
|
|
1545
|
-
|
|
1556
|
+
payload["previewMessage"] = "排版预览暂不可用,已显示原文。"
|
|
1546
1557
|
self._authenticate(context)
|
|
1547
|
-
return _json_response(200,
|
|
1548
|
-
"requestId": context.request.request_id,
|
|
1549
|
-
"threadId": answer.thread_id, "turnId": answer.turn_id,
|
|
1550
|
-
"status": answer.status, "answer": answer.answer,
|
|
1551
|
-
"startedAt": answer.started_at, "completedAt": answer.completed_at,
|
|
1552
|
-
"readAt": datetime.now().astimezone().isoformat(),
|
|
1553
|
-
**preview,
|
|
1554
|
-
})
|
|
1558
|
+
return response if response is not None else _json_response(200, payload)
|
|
1555
1559
|
|
|
1556
1560
|
async def _sessions(self, context: _RequestContext) -> Response:
|
|
1557
1561
|
allowed = {
|
|
@@ -3109,13 +3113,19 @@ def _secure(response: Response) -> Response:
|
|
|
3109
3113
|
return Response(response.status, tuple(headers), response.body)
|
|
3110
3114
|
|
|
3111
3115
|
|
|
3112
|
-
def _json_response(status: int, payload: object) -> Response:
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3116
|
+
def _json_response(status: int, payload: object, *, ensure_ascii: bool = False) -> Response:
|
|
3117
|
+
if ensure_ascii:
|
|
3118
|
+
# Keep image-bearing chunks ASCII even when the answer contains emoji.
|
|
3119
|
+
# Iteration also avoids one C encoder call holding the GIL across all
|
|
3120
|
+
# images; encode each chunk before joining the final response bytes.
|
|
3121
|
+
chunks = json.JSONEncoder(
|
|
3122
|
+
ensure_ascii=True, separators=(",", ":"), sort_keys=True,
|
|
3123
|
+
).iterencode(payload)
|
|
3124
|
+
body = b"".join(chunk.encode("ascii") for chunk in chunks)
|
|
3125
|
+
else:
|
|
3126
|
+
body = json.dumps(
|
|
3127
|
+
payload, ensure_ascii=False, separators=(",", ":"), sort_keys=True,
|
|
3128
|
+
).encode("utf-8")
|
|
3119
3129
|
return Response(
|
|
3120
3130
|
status,
|
|
3121
3131
|
((b"Content-Type", b"application/json; charset=utf-8"),),
|
|
@@ -56,7 +56,7 @@ from .partial_answers import PartialAnswer, partial_answers_from_items
|
|
|
56
56
|
from .progress_card_settings import ProgressCardSettings
|
|
57
57
|
from .error_messages import describe_error, native_turn_failure
|
|
58
58
|
from .thread_history import AppServerThreadHistory
|
|
59
|
-
from .runtime.contracts import NativeLatestAnswer
|
|
59
|
+
from .runtime.contracts import NativeAnswerImage, NativeLatestAnswer
|
|
60
60
|
from .runtime.name_writes import ThreadNameWrites
|
|
61
61
|
from .runtime.thread_naming import NamingJob, ThreadNameGenerationError, ThreadNamer
|
|
62
62
|
# Preserve existing public imports as aliases of the shared contract types.
|
|
@@ -2162,9 +2162,23 @@ class CodexRuntime:
|
|
|
2162
2162
|
turn = page.data[0]
|
|
2163
2163
|
status = _enum_value(turn.status)
|
|
2164
2164
|
items = list(turn.items) if status in {"completed", "failed", "interrupted"} else []
|
|
2165
|
+
answer = _final_agent_response(items)
|
|
2166
|
+
images = []
|
|
2167
|
+
if status == "completed" and answer:
|
|
2168
|
+
for item in items:
|
|
2169
|
+
root = getattr(item, "root", item)
|
|
2170
|
+
if (getattr(root, "type", None) != "imageGeneration"
|
|
2171
|
+
or _enum_value(getattr(root, "status", None)) != "completed"):
|
|
2172
|
+
continue
|
|
2173
|
+
path = getattr(root, "saved_path", None)
|
|
2174
|
+
path = getattr(path, "root", path)
|
|
2175
|
+
data = getattr(root, "result", None)
|
|
2176
|
+
if isinstance(path, str) and isinstance(data, str):
|
|
2177
|
+
images.append(NativeAnswerImage(path, data))
|
|
2165
2178
|
return NativeLatestAnswer(
|
|
2166
|
-
thread_id, turn.id, status,
|
|
2179
|
+
thread_id, turn.id, status, answer,
|
|
2167
2180
|
getattr(turn, "started_at", None), getattr(turn, "completed_at", None),
|
|
2181
|
+
tuple(images),
|
|
2168
2182
|
)
|
|
2169
2183
|
|
|
2170
2184
|
async def thread_summary(
|
|
@@ -277,14 +277,25 @@ def _image_dimensions(data: bytes, mime: str) -> tuple[int, int]:
|
|
|
277
277
|
raise FileBrowseError("invalid_image", "无法读取图片尺寸,暂不支持预览。")
|
|
278
278
|
|
|
279
279
|
|
|
280
|
+
def validate_image(
|
|
281
|
+
data: bytes, mime: str, *, max_bytes: int = MAX_IMAGE_BYTES,
|
|
282
|
+
max_pixels: int = MAX_IMAGE_PIXELS, max_dimension: int = MAX_IMAGE_DIMENSION,
|
|
283
|
+
) -> tuple[int, int]:
|
|
284
|
+
"""Validate bytes and dimensions under the caller's preview budgets."""
|
|
285
|
+
if len(data) > max_bytes:
|
|
286
|
+
raise FileBrowseError("preview_too_large", "图片过大,暂不支持预览。")
|
|
287
|
+
width, height = _image_dimensions(data, mime)
|
|
288
|
+
if width <= 0 or height <= 0:
|
|
289
|
+
raise FileBrowseError("invalid_image", "图片尺寸无效,暂不支持预览。")
|
|
290
|
+
if max(width, height) > max_dimension or width * height > max_pixels:
|
|
291
|
+
raise FileBrowseError("preview_too_large", "图片尺寸过大,暂不支持预览。")
|
|
292
|
+
return width, height
|
|
293
|
+
|
|
294
|
+
|
|
280
295
|
def _preview(data: bytes, path: str, info: os.stat_result) -> FilePreview:
|
|
281
296
|
mime = _image_mime(data, path)
|
|
282
297
|
if mime:
|
|
283
|
-
|
|
284
|
-
if width <= 0 or height <= 0:
|
|
285
|
-
raise FileBrowseError("invalid_image", "图片尺寸无效,暂不支持预览。")
|
|
286
|
-
if max(width, height) > MAX_IMAGE_DIMENSION or width * height > MAX_IMAGE_PIXELS:
|
|
287
|
-
raise FileBrowseError("preview_too_large", "图片尺寸过大,暂不支持预览。")
|
|
298
|
+
validate_image(data, mime)
|
|
288
299
|
return FilePreview(path, "image", None, data, mime, len(data), _modified_at(info), _file_version(info))
|
|
289
300
|
if len(data) > MAX_TEXT_BYTES:
|
|
290
301
|
raise FileBrowseError("preview_too_large", "文本超过 1 MiB,暂不支持预览。")
|
|
@@ -7,7 +7,7 @@ locks, subscriptions or persistence.
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
from collections.abc import AsyncIterator, Awaitable, Callable
|
|
10
|
-
from dataclasses import dataclass
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
11
|
from enum import Enum
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import Any, Protocol
|
|
@@ -497,6 +497,12 @@ class NativeThreadMetadata:
|
|
|
497
497
|
created_at: int | None = None # Native creation time; independent of Binding registration.
|
|
498
498
|
|
|
499
499
|
|
|
500
|
+
@dataclass(frozen=True, slots=True)
|
|
501
|
+
class NativeAnswerImage:
|
|
502
|
+
saved_path: str
|
|
503
|
+
data: str = field(repr=False)
|
|
504
|
+
|
|
505
|
+
|
|
500
506
|
@dataclass(frozen=True, slots=True)
|
|
501
507
|
class NativeLatestAnswer:
|
|
502
508
|
thread_id: str
|
|
@@ -505,6 +511,7 @@ class NativeLatestAnswer:
|
|
|
505
511
|
answer: str | None
|
|
506
512
|
started_at: int | None = None
|
|
507
513
|
completed_at: int | None = None
|
|
514
|
+
images: tuple[NativeAnswerImage, ...] = ()
|
|
508
515
|
|
|
509
516
|
|
|
510
517
|
@dataclass(frozen=True, slots=True)
|
|
@@ -74,6 +74,7 @@ netizen_cli.egg-info/entry_points.txt
|
|
|
74
74
|
netizen_cli.egg-info/requires.txt
|
|
75
75
|
netizen_cli.egg-info/top_level.txt
|
|
76
76
|
netizen_cli/admin/__init__.py
|
|
77
|
+
netizen_cli/admin/answer_previews.py
|
|
77
78
|
netizen_cli/admin/auth.py
|
|
78
79
|
netizen_cli/admin/credentials.py
|
|
79
80
|
netizen_cli/admin/errors.py
|
|
@@ -243,7 +243,9 @@ Tab 已取得的当前页数据。同一单聊、群聊下的主线和话题归
|
|
|
243
243
|
|
|
244
244
|
正文默认以 Markdown 排版展示,支持标题、列表、表格和代码块,可切换“查看原文”。
|
|
245
245
|
读取时间及轮次信息在“本次读取详情”中展开查看。超出排版限制或预览暂不可用时显示
|
|
246
|
-
|
|
246
|
+
完整原文。已完成轮次中,正文引用且历史中保留了图片内容的原生生成 PNG 可以直接展示;
|
|
247
|
+
不额外列出未被正文引用的图片。图片缺失、过大或不支持时保留说明,不影响阅读文字。
|
|
248
|
+
本地文件链接不打开,其他来源的图片不加载,网页链接可在新窗口打开。
|
|
247
249
|
|
|
248
250
|
## Project 统计与删除
|
|
249
251
|
|
|
@@ -11731,7 +11731,13 @@ class CodexRuntimeTest(unittest.IsolatedAsyncioTestCase):
|
|
|
11731
11731
|
|
|
11732
11732
|
async def test_recovery_interruption_confirmation_keeps_read_and_time_budgets(self) -> None:
|
|
11733
11733
|
real_sleep = asyncio.sleep
|
|
11734
|
-
|
|
11734
|
+
# The last-read budget is bounded by the native IO count alone, so its
|
|
11735
|
+
# recovery window keeps the production default and scheduling jitter
|
|
11736
|
+
# cannot truncate the bounded reads. The timeout budget must end
|
|
11737
|
+
# through the real confirmation sleep instead, so only that subTest
|
|
11738
|
+
# shrinks the window below the patched confirmation delay.
|
|
11739
|
+
budgets = (("last-read", 5.0), ("timeout", 0.5))
|
|
11740
|
+
for budget, recovery_window in budgets:
|
|
11735
11741
|
with self.subTest(budget=budget):
|
|
11736
11742
|
binding = self.binding()
|
|
11737
11743
|
before = len(self.codex.read_calls)
|
|
@@ -11741,7 +11747,7 @@ class CodexRuntimeTest(unittest.IsolatedAsyncioTestCase):
|
|
|
11741
11747
|
)
|
|
11742
11748
|
with (
|
|
11743
11749
|
patch("netizen_cli.codex_runtime._INTERRUPTION_CONFIRMATION_SECONDS", 2),
|
|
11744
|
-
patch("netizen_cli.codex_runtime._TURN_OBSERVATION_RECOVERY_TIMEOUT_SECONDS",
|
|
11750
|
+
patch("netizen_cli.codex_runtime._TURN_OBSERVATION_RECOVERY_TIMEOUT_SECONDS", recovery_window),
|
|
11745
11751
|
patch("netizen_cli.codex_runtime.asyncio.sleep", wraps=real_sleep) as sleep_mock,
|
|
11746
11752
|
patch.object(self.store, "release_scheduled_initial_turn", wraps=self.store.release_scheduled_initial_turn) as release_initial,
|
|
11747
11753
|
):
|
|
@@ -5,9 +5,10 @@ import unittest
|
|
|
5
5
|
from unittest.mock import AsyncMock, patch
|
|
6
6
|
|
|
7
7
|
from openai_codex import InvalidRequestError
|
|
8
|
+
from openai_codex.generated.v2_all import ThreadItem
|
|
8
9
|
|
|
9
10
|
from netizen_cli.codex_runtime import CodexRuntime
|
|
10
|
-
from netizen_cli.runtime.contracts import NativeLatestAnswer
|
|
11
|
+
from netizen_cli.runtime.contracts import NativeAnswerImage, NativeLatestAnswer
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def message(text, phase=None, kind="agentMessage"):
|
|
@@ -15,6 +16,33 @@ def message(text, phase=None, kind="agentMessage"):
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class LatestAnswerTest(unittest.IsolatedAsyncioTestCase):
|
|
19
|
+
async def test_images_come_only_from_completed_generation_in_the_same_completed_turn(self):
|
|
20
|
+
runtime = object.__new__(CodexRuntime)
|
|
21
|
+
runtime._codex = object()
|
|
22
|
+
image = ThreadItem.model_validate({
|
|
23
|
+
"type": "imageGeneration", "id": "image", "status": "completed",
|
|
24
|
+
"result": "native-png-base64", "savedPath": "/original-thread/image.png",
|
|
25
|
+
})
|
|
26
|
+
ignored = [SimpleNamespace(root=SimpleNamespace(type="imageView", path="/view.png")),
|
|
27
|
+
SimpleNamespace(root=SimpleNamespace(type="imageGeneration", status="inProgress",
|
|
28
|
+
saved_path="/pending.png", result="pending")),
|
|
29
|
+
SimpleNamespace(root=SimpleNamespace(type="imageGeneration", status="completed",
|
|
30
|
+
saved_path=None, result="no-path"))]
|
|
31
|
+
for status in ("completed", "failed", "interrupted", "inProgress"):
|
|
32
|
+
with self.subTest(status=status):
|
|
33
|
+
turn = SimpleNamespace(id="latest", status=status,
|
|
34
|
+
items=[image, *ignored, message("", "final_answer")])
|
|
35
|
+
history = SimpleNamespace(list_turns=AsyncMock(return_value=SimpleNamespace(data=[turn])))
|
|
36
|
+
with patch("netizen_cli.codex_runtime.AppServerThreadHistory", return_value=history):
|
|
37
|
+
result = await runtime.latest_thread_answer("fork")
|
|
38
|
+
expected = (NativeAnswerImage("/original-thread/image.png", "native-png-base64"),) if status == "completed" else ()
|
|
39
|
+
self.assertEqual(result.images, expected)
|
|
40
|
+
history.list_turns.assert_awaited_once_with("fork", limit=1, items_view="full")
|
|
41
|
+
turn.status = "completed"
|
|
42
|
+
turn.items = [image]
|
|
43
|
+
with patch("netizen_cli.codex_runtime.AppServerThreadHistory", return_value=history):
|
|
44
|
+
self.assertEqual((await runtime.latest_thread_answer("fork")).images, ())
|
|
45
|
+
|
|
18
46
|
async def test_reads_latest_full_turn_once_and_never_uses_a_tail(self):
|
|
19
47
|
runtime = object.__new__(CodexRuntime)
|
|
20
48
|
runtime._codex = object()
|
|
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
|
|
File without changes
|
{netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/question-notifications.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netizen_cli-0.15.1 → netizen_cli-0.15.2}/netizen_cli/admin/static/vendor/ace/mode-javascript.js
RENAMED
|
File without changes
|