arka-agent 0.1.0__py3-none-any.whl
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.
- arka/__init__.py +3 -0
- arka/__main__.py +6 -0
- arka/_bootstrap.py +183 -0
- arka/agent/__init__.py +1 -0
- arka/agent/app_check.py +52 -0
- arka/agent/ascii_art.py +315 -0
- arka/agent/assemblyai_stt.py +210 -0
- arka/agent/astronomy.py +182 -0
- arka/agent/automation.py +118 -0
- arka/agent/background.py +221 -0
- arka/agent/background_remove.py +28 -0
- arka/agent/batch.py +244 -0
- arka/agent/blocks.py +128 -0
- arka/agent/bookmarks.py +387 -0
- arka/agent/browser_check.py +48 -0
- arka/agent/change_guards.py +16 -0
- arka/agent/chat.py +2396 -0
- arka/agent/code_convert.py +41 -0
- arka/agent/coding_tui.py +1396 -0
- arka/agent/coding_workflows.py +49 -0
- arka/agent/competitions.py +361 -0
- arka/agent/cool_build.py +45 -0
- arka/agent/core.py +1667 -0
- arka/agent/council.py +327 -0
- arka/agent/daily_brief.py +737 -0
- arka/agent/data_ask.py +1011 -0
- arka/agent/data_collect.py +153 -0
- arka/agent/deploy.py +60 -0
- arka/agent/design_flow.py +51 -0
- arka/agent/design_from_screenshot.py +157 -0
- arka/agent/design_memory.py +52 -0
- arka/agent/design_resources.py +22 -0
- arka/agent/dev_tools.py +664 -0
- arka/agent/dev_workflows.py +59 -0
- arka/agent/env_bridge.py +41 -0
- arka/agent/env_setup.py +49 -0
- arka/agent/exercise_dataset.py +280 -0
- arka/agent/fact_check.py +329 -0
- arka/agent/flow.py +336 -0
- arka/agent/free_credits.py +240 -0
- arka/agent/frontend_loop.py +271 -0
- arka/agent/game_control.py +318 -0
- arka/agent/game_studio.py +54 -0
- arka/agent/generate_data.py +998 -0
- arka/agent/geo_seo.py +29 -0
- arka/agent/git_changes.py +122 -0
- arka/agent/github_actions.py +55 -0
- arka/agent/github_dataset.py +466 -0
- arka/agent/github_repo.py +609 -0
- arka/agent/goal.py +1158 -0
- arka/agent/graphify.py +40 -0
- arka/agent/hackathon.py +58 -0
- arka/agent/hallmark.py +41 -0
- arka/agent/ideate.py +19 -0
- arka/agent/integration_setup.py +267 -0
- arka/agent/interesting_fact.py +56 -0
- arka/agent/iterate.py +53 -0
- arka/agent/judge_demo.py +32 -0
- arka/agent/lint_project.py +147 -0
- arka/agent/local_image_gen.py +137 -0
- arka/agent/loop_engineering.py +73 -0
- arka/agent/media_quiz.py +40 -0
- arka/agent/metallurgy.py +153 -0
- arka/agent/model_to_image.py +117 -0
- arka/agent/move_file.py +63 -0
- arka/agent/multi_llm.py +39 -0
- arka/agent/optimize.py +42 -0
- arka/agent/parallax_2d.py +43 -0
- arka/agent/parallel.py +40 -0
- arka/agent/pdf_interactive.py +35 -0
- arka/agent/personas/__init__.py +12 -0
- arka/agent/personas/base.py +320 -0
- arka/agent/personas/cli.py +296 -0
- arka/agent/personas/elon.py +129 -0
- arka/agent/personas/format.py +148 -0
- arka/agent/personas/io.py +270 -0
- arka/agent/personas/schema.py +111 -0
- arka/agent/personas/templates/blank.yaml +17 -0
- arka/agent/personas/templates/elon.yaml +27 -0
- arka/agent/personas/templates/feynman.yaml +19 -0
- arka/agent/personas/templates/socrates.yaml +19 -0
- arka/agent/platform_howto.py +62 -0
- arka/agent/play.py +151 -0
- arka/agent/post_scaffold.py +211 -0
- arka/agent/pr_check.py +558 -0
- arka/agent/price_sources.py +1274 -0
- arka/agent/product_sources.py +153 -0
- arka/agent/profession_plugins.py +485 -0
- arka/agent/profession_projects.py +311 -0
- arka/agent/profession_sources.py +580 -0
- arka/agent/professions.py +758 -0
- arka/agent/prompt_optimize.py +76 -0
- arka/agent/quiz_practice.py +477 -0
- arka/agent/race.py +58 -0
- arka/agent/repo_context.py +586 -0
- arka/agent/repo_graph.py +94 -0
- arka/agent/repo_health.py +333 -0
- arka/agent/repo_map.py +297 -0
- arka/agent/repo_reverse.py +23 -0
- arka/agent/research_math.py +34 -0
- arka/agent/rig_3d.py +43 -0
- arka/agent/route_learn.py +163 -0
- arka/agent/sandbox.py +135 -0
- arka/agent/scaffold_3d.py +319 -0
- arka/agent/scene_3d.py +137 -0
- arka/agent/script_understanding.py +56 -0
- arka/agent/search_setup.py +75 -0
- arka/agent/self_improve.py +1192 -0
- arka/agent/semantic_alert.py +32 -0
- arka/agent/skill_hints.py +33 -0
- arka/agent/skills.py +706 -0
- arka/agent/society.py +103 -0
- arka/agent/space_visual.py +26 -0
- arka/agent/spline_guide.py +65 -0
- arka/agent/structure.py +42 -0
- arka/agent/stt_install.py +155 -0
- arka/agent/stt_map.py +245 -0
- arka/agent/super_replica.py +48 -0
- arka/agent/surgical_edit.py +57 -0
- arka/agent/survival_lang.py +386 -0
- arka/agent/symbolic_image.py +78 -0
- arka/agent/talents.py +541 -0
- arka/agent/teammate_review.py +86 -0
- arka/agent/text_edit.py +56 -0
- arka/agent/text_to_3d.py +79 -0
- arka/agent/three_d.py +12 -0
- arka/agent/three_js_model.py +242 -0
- arka/agent/ui_copy_audit.py +50 -0
- arka/agent/ultra_fast.py +89 -0
- arka/agent/url_app_analyzer.py +55 -0
- arka/agent/usage_dashboard.py +28 -0
- arka/agent/video_evidence.py +176 -0
- arka/agent/view_data.py +528 -0
- arka/agent/vision_evidence.py +54 -0
- arka/agent/visual_diagnose.py +40 -0
- arka/agent/voice.py +467 -0
- arka/agent/wake.py +1130 -0
- arka/agent/web_answer.py +64 -0
- arka/agent/web_screenshot.py +95 -0
- arka/agent/word_counter.py +32 -0
- arka/agent/workflow_templates.py +65 -0
- arka/agent/workspace.py +64 -0
- arka/aie/__init__.py +1 -0
- arka/aie/_common.py +54 -0
- arka/aie/auto_click.py +73 -0
- arka/aie/auto_copy_selection.py +79 -0
- arka/aie/classifier.py +76 -0
- arka/aie/cli.py +396 -0
- arka/aie/delete_useless.py +53 -0
- arka/aie/zip_open.py +55 -0
- arka/bundled/_shim_path.py +21 -0
- arka/bundled/aie/__init__.py +1 -0
- arka/bundled/aie/_common.py +54 -0
- arka/bundled/aie/auto_click.py +73 -0
- arka/bundled/aie/auto_copy_selection.py +79 -0
- arka/bundled/aie/classifier.py +76 -0
- arka/bundled/aie/cli.py +396 -0
- arka/bundled/aie/delete_useless.py +53 -0
- arka/bundled/aie/zip_open.py +55 -0
- arka/bundled/arka_agent.py +15 -0
- arka/bundled/arka_agent_hub.py +15 -0
- arka/bundled/arka_aie.py +15 -0
- arka/bundled/arka_ascii_art.py +15 -0
- arka/bundled/arka_assemblyai_stt.py +15 -0
- arka/bundled/arka_astronomy.py +15 -0
- arka/bundled/arka_batch_summarize.py +15 -0
- arka/bundled/arka_benchmark.py +15 -0
- arka/bundled/arka_bookmarks.py +15 -0
- arka/bundled/arka_boot.sh +137 -0
- arka/bundled/arka_chart.py +15 -0
- arka/bundled/arka_chat.py +15 -0
- arka/bundled/arka_chat_requirements.txt +10 -0
- arka/bundled/arka_clipboard_history.py +15 -0
- arka/bundled/arka_competition_funding.py +15 -0
- arka/bundled/arka_competitions.py +15 -0
- arka/bundled/arka_compose_3d.py +15 -0
- arka/bundled/arka_compose_slides.py +15 -0
- arka/bundled/arka_compose_video.py +15 -0
- arka/bundled/arka_compute.py +15 -0
- arka/bundled/arka_config.py +15 -0
- arka/bundled/arka_convert_media.py +15 -0
- arka/bundled/arka_council.py +15 -0
- arka/bundled/arka_currency.py +15 -0
- arka/bundled/arka_daily_brief.py +15 -0
- arka/bundled/arka_data_ask.py +15 -0
- arka/bundled/arka_describe_image.py +15 -0
- arka/bundled/arka_describe_video.py +15 -0
- arka/bundled/arka_disk.py +15 -0
- arka/bundled/arka_docker_status.py +15 -0
- arka/bundled/arka_drawing.py +15 -0
- arka/bundled/arka_elon.py +15 -0
- arka/bundled/arka_fact_check.py +15 -0
- arka/bundled/arka_flow.py +15 -0
- arka/bundled/arka_free_credits.py +15 -0
- arka/bundled/arka_fugu.py +15 -0
- arka/bundled/arka_gemini.py +15 -0
- arka/bundled/arka_generate_data.py +15 -0
- arka/bundled/arka_generate_image.py +15 -0
- arka/bundled/arka_generate_thumbnail.py +15 -0
- arka/bundled/arka_generate_video.py +15 -0
- arka/bundled/arka_github_repo.py +15 -0
- arka/bundled/arka_google.py +15 -0
- arka/bundled/arka_harvard_ark.py +15 -0
- arka/bundled/arka_heartbeat.py +15 -0
- arka/bundled/arka_hf_bridge.py +15 -0
- arka/bundled/arka_jsonkit.py +15 -0
- arka/bundled/arka_kaggle.py +15 -0
- arka/bundled/arka_kalshi.py +15 -0
- arka/bundled/arka_llm.py +15 -0
- arka/bundled/arka_llm_fallback.py +15 -0
- arka/bundled/arka_llm_servers.py +15 -0
- arka/bundled/arka_mac_mic.py +15 -0
- arka/bundled/arka_macro_events.py +15 -0
- arka/bundled/arka_market_emotion.py +15 -0
- arka/bundled/arka_mcp.py +15 -0
- arka/bundled/arka_mcp_server.py +15 -0
- arka/bundled/arka_media.py +15 -0
- arka/bundled/arka_media_qa.py +15 -0
- arka/bundled/arka_memory.py +15 -0
- arka/bundled/arka_memory_detect.py +15 -0
- arka/bundled/arka_message_sessions.py +15 -0
- arka/bundled/arka_metallurgy.py +15 -0
- arka/bundled/arka_model_advisor.py +15 -0
- arka/bundled/arka_open_url.py +15 -0
- arka/bundled/arka_password_vault.py +15 -0
- arka/bundled/arka_paths.py +15 -0
- arka/bundled/arka_pdf_rag.py +15 -0
- arka/bundled/arka_pdf_tools.py +15 -0
- arka/bundled/arka_persona.py +15 -0
- arka/bundled/arka_personalize.py +15 -0
- arka/bundled/arka_phone.py +15 -0
- arka/bundled/arka_platform.py +15 -0
- arka/bundled/arka_pr_check.py +15 -0
- arka/bundled/arka_predictions.py +15 -0
- arka/bundled/arka_profession_plugins.py +15 -0
- arka/bundled/arka_profession_projects.py +15 -0
- arka/bundled/arka_professions.py +15 -0
- arka/bundled/arka_progress.py +15 -0
- arka/bundled/arka_qr.py +15 -0
- arka/bundled/arka_quiz_practice.py +15 -0
- arka/bundled/arka_remind.py +15 -0
- arka/bundled/arka_remote_server.py +15 -0
- arka/bundled/arka_repo_context.py +15 -0
- arka/bundled/arka_repo_health.py +15 -0
- arka/bundled/arka_repo_map.py +15 -0
- arka/bundled/arka_route_learn.py +15 -0
- arka/bundled/arka_routines.py +15 -0
- arka/bundled/arka_screen.py +15 -0
- arka/bundled/arka_security.py +15 -0
- arka/bundled/arka_self_improve.py +15 -0
- arka/bundled/arka_session_memory.py +15 -0
- arka/bundled/arka_signoz.py +15 -0
- arka/bundled/arka_skills.py +15 -0
- arka/bundled/arka_sports.py +15 -0
- arka/bundled/arka_spotify.py +15 -0
- arka/bundled/arka_stock_bridge.py +15 -0
- arka/bundled/arka_stock_context_worker.py +15 -0
- arka/bundled/arka_stock_fundamentals.py +15 -0
- arka/bundled/arka_stock_ui.py +15 -0
- arka/bundled/arka_stt_install.py +15 -0
- arka/bundled/arka_stt_map.py +15 -0
- arka/bundled/arka_subagent.py +15 -0
- arka/bundled/arka_summarize.py +15 -0
- arka/bundled/arka_supermemory.py +15 -0
- arka/bundled/arka_survival_lang.py +15 -0
- arka/bundled/arka_talents.py +15 -0
- arka/bundled/arka_teams.py +15 -0
- arka/bundled/arka_text_to_3d.py +8 -0
- arka/bundled/arka_textkit.py +15 -0
- arka/bundled/arka_three_d.py +15 -0
- arka/bundled/arka_timekit.py +15 -0
- arka/bundled/arka_timezone_convert.py +15 -0
- arka/bundled/arka_turboquant_install.py +15 -0
- arka/bundled/arka_turboquant_rag.py +15 -0
- arka/bundled/arka_turboquant_requirements.txt +11 -0
- arka/bundled/arka_unified_memory.py +15 -0
- arka/bundled/arka_urlkit.py +15 -0
- arka/bundled/arka_usage.py +15 -0
- arka/bundled/arka_view_data.py +15 -0
- arka/bundled/arka_voice.py +15 -0
- arka/bundled/arka_voice_hf.sh +172 -0
- arka/bundled/arka_wake.py +15 -0
- arka/bundled/arka_webhook.py +15 -0
- arka/bundled/arka_whatsapp_inbox.py +15 -0
- arka/bundled/arka_x_post.py +15 -0
- arka/bundled/arka_youtube.py +15 -0
- arka/bundled/arka_youtube_bulk.py +15 -0
- arka/bundled/arka_youtube_research.py +15 -0
- arka/bundled/arka_ytdlp_progress.py +15 -0
- arka/bundled/config.fish +20314 -0
- arka/bundled/edge_speak.py +15 -0
- arka/bundled/indic_tts.py +15 -0
- arka/bundled/privategpt/settings.override.yaml +5 -0
- arka/bundled/sarvam_speak.py +15 -0
- arka/bundled/sarvam_stt.py +15 -0
- arka/bundled/spotify_dom.py +15 -0
- arka/bundled/termux-boot-arka.sh +16 -0
- arka/bundled/web_answer.py +15 -0
- arka/charts/__init__.py +1 -0
- arka/charts/data.py +1842 -0
- arka/charts/defaults.py +217 -0
- arka/charts/plot.py +2010 -0
- arka/cli.py +1270 -0
- arka/core/__init__.py +1 -0
- arka/core/auto_refetch.py +143 -0
- arka/core/code_project.py +452 -0
- arka/core/compute.py +147 -0
- arka/core/config_backup.py +544 -0
- arka/core/default_config.py +300 -0
- arka/core/disk.py +413 -0
- arka/core/jsonkit.py +209 -0
- arka/core/memory_detect.py +468 -0
- arka/core/memory_scope.py +492 -0
- arka/core/mode.py +372 -0
- arka/core/notifications.py +23 -0
- arka/core/object_orientation.py +69 -0
- arka/core/output.py +96 -0
- arka/core/personalize.py +798 -0
- arka/core/platform.py +274 -0
- arka/core/progress.py +132 -0
- arka/core/project_rules.py +165 -0
- arka/core/security.py +425 -0
- arka/core/session_memory.py +319 -0
- arka/core/skill_settings.py +121 -0
- arka/core/skill_usage.py +36 -0
- arka/core/textkit.py +115 -0
- arka/core/timekit.py +158 -0
- arka/core/unified_memory.py +488 -0
- arka/core/urlkit.py +162 -0
- arka/core/usage.py +845 -0
- arka/dispatch.py +660 -0
- arka/documents/__init__.py +5 -0
- arka/documents/drawing.py +437 -0
- arka/env.example +695 -0
- arka/env.py +102 -0
- arka/fish/config.fish +20314 -0
- arka/fish/scripts/arka_boot.sh +137 -0
- arka/fish/scripts/arka_voice_hf.sh +172 -0
- arka/fish/scripts/termux-boot-arka.sh +16 -0
- arka/fish_bridge.py +177 -0
- arka/generate/__init__.py +1 -0
- arka/generate/image.py +389 -0
- arka/generate/video.py +268 -0
- arka/integrations/__init__.py +1 -0
- arka/integrations/agent_hub.py +1407 -0
- arka/integrations/agent_hub_cli.py +281 -0
- arka/integrations/backend_client.py +185 -0
- arka/integrations/benchmark_cli.py +138 -0
- arka/integrations/butterfish.py +129 -0
- arka/integrations/clipboard_history.py +497 -0
- arka/integrations/context7_mcp.py +341 -0
- arka/integrations/currency.py +538 -0
- arka/integrations/docker_status.py +293 -0
- arka/integrations/fugu.py +216 -0
- arka/integrations/gemini_cli.py +200 -0
- arka/integrations/google_oauth.py +456 -0
- arka/integrations/google_workspace.py +1510 -0
- arka/integrations/greeting.py +40 -0
- arka/integrations/harvard_ark.py +582 -0
- arka/integrations/heartbeat.py +294 -0
- arka/integrations/hf_bridge.py +282 -0
- arka/integrations/kaggle.py +580 -0
- arka/integrations/kalshi.py +433 -0
- arka/integrations/mac_mic.py +277 -0
- arka/integrations/macos_calendar.py +155 -0
- arka/integrations/mcp_autoconfig.py +69 -0
- arka/integrations/mcp_cli.py +379 -0
- arka/integrations/mcp_client.py +379 -0
- arka/integrations/mcp_logs.py +95 -0
- arka/integrations/mcp_manager.py +746 -0
- arka/integrations/mcp_server.py +2647 -0
- arka/integrations/memory_cli.py +59 -0
- arka/integrations/message_sessions.py +432 -0
- arka/integrations/open_url.py +368 -0
- arka/integrations/password_vault.py +304 -0
- arka/integrations/phone.py +231 -0
- arka/integrations/qr_code.py +88 -0
- arka/integrations/remind.py +666 -0
- arka/integrations/remote_server.py +1105 -0
- arka/integrations/routines.py +692 -0
- arka/integrations/signoz_mcp.py +97 -0
- arka/integrations/site_summary.py +303 -0
- arka/integrations/sports.py +399 -0
- arka/integrations/spotify.py +603 -0
- arka/integrations/spotify_dom.py +471 -0
- arka/integrations/subagent.py +438 -0
- arka/integrations/supermemory.py +783 -0
- arka/integrations/teams_cli.py +266 -0
- arka/integrations/timezone_convert.py +379 -0
- arka/integrations/webhook.py +251 -0
- arka/integrations/whatsapp_inbox.py +297 -0
- arka/integrations/x_post.py +1387 -0
- arka/llm/__init__.py +1 -0
- arka/llm/api_keys.py +238 -0
- arka/llm/backend.py +57 -0
- arka/llm/benchmarks.py +470 -0
- arka/llm/chunking.py +54 -0
- arka/llm/cli.py +764 -0
- arka/llm/edge.py +29 -0
- arka/llm/fallback.py +2339 -0
- arka/llm/free_models.py +83 -0
- arka/llm/grounding.py +55 -0
- arka/llm/guardrails.py +71 -0
- arka/llm/hybrid.py +153 -0
- arka/llm/model_advisor.py +759 -0
- arka/llm/model_host_setup.py +74 -0
- arka/llm/model_optimizer.py +63 -0
- arka/llm/prompt_compact.py +134 -0
- arka/llm/provider_select.py +571 -0
- arka/llm/providers.py +428 -0
- arka/llm/quantize.py +32 -0
- arka/llm/servers.py +620 -0
- arka/llm/skill_models.py +155 -0
- arka/llm/skill_profiles.py +188 -0
- arka/llm/speculative.py +33 -0
- arka/llm/thinking.py +27 -0
- arka/llm/train_plan.py +47 -0
- arka/media/__init__.py +1 -0
- arka/media/batch.py +321 -0
- arka/media/chart_slide.py +730 -0
- arka/media/compose_3d.py +1456 -0
- arka/media/compose_3d_backends.py +560 -0
- arka/media/compose_slides.py +2422 -0
- arka/media/compose_video.py +2295 -0
- arka/media/convert_media.py +842 -0
- arka/media/media_transform.py +92 -0
- arka/media/qa.py +69 -0
- arka/media/slide_design.py +232 -0
- arka/media/stock_photos.py +944 -0
- arka/media/summarize.py +69 -0
- arka/media/thumbnail.py +422 -0
- arka/media/transcript.py +1215 -0
- arka/media/unsplash.py +129 -0
- arka/output.py +87 -0
- arka/paths.py +293 -0
- arka/pdf/__init__.py +1 -0
- arka/pdf/privategpt/settings.override.yaml +5 -0
- arka/pdf/rag.py +1243 -0
- arka/pdf/tools.py +1385 -0
- arka/platform_info.py +89 -0
- arka/professions/examples/architect/README.md +18 -0
- arka/professions/examples/architect/profession.json +28 -0
- arka/professions/life_sciences/profession.json +47 -0
- arka/requirements/chat.txt +10 -0
- arka/requirements/observability.txt +3 -0
- arka/requirements/turboquant.txt +11 -0
- arka/router.py +922 -0
- arka/routing/__init__.py +5 -0
- arka/routing/council.py +60 -0
- arka/routing/file_size.py +40 -0
- arka/routing/interesting_fact.py +68 -0
- arka/routing/learned.py +317 -0
- arka/routing/platform_howto.py +91 -0
- arka/routing/symbolic.py +1826 -0
- arka/setup_runtime.py +128 -0
- arka/skills/astronomy/__pycache__/lib.cpython-313.pyc +0 -0
- arka/skills/astronomy/lib.py +321 -0
- arka/skills/astronomy/objects.json +266 -0
- arka/skills/astronomy/run.py +96 -0
- arka/skills/astronomy/skill.json +23 -0
- arka/skills/describe_video/run.py +4 -0
- arka/skills/describe_video/skill.json +18 -0
- arka/skills/examples/demo_echo/__pycache__/run.cpython-313.pyc +0 -0
- arka/skills/examples/demo_echo/run.py +18 -0
- arka/skills/examples/demo_echo/skill.json +24 -0
- arka/skills/exercise_dataset/skill.json +17 -0
- arka/skills/game_control/run.py +6 -0
- arka/skills/game_control/skill.json +18 -0
- arka/skills/github_dataset/skill.json +17 -0
- arka/skills/life_sciences/__pycache__/lib.cpython-313.pyc +0 -0
- arka/skills/life_sciences/__pycache__/protocol_sources.cpython-313.pyc +0 -0
- arka/skills/life_sciences/lib.py +627 -0
- arka/skills/life_sciences/marketplace.json +181 -0
- arka/skills/life_sciences/protocol_sources.py +307 -0
- arka/skills/life_sciences/protocols.json +123 -0
- arka/skills/life_sciences/run.py +58 -0
- arka/skills/life_sciences/skill.json +22 -0
- arka/skills/local_image_gen/run.py +4 -0
- arka/skills/local_image_gen/skill.json +10 -0
- arka/skills/metallurgy/__pycache__/lib.cpython-313.pyc +0 -0
- arka/skills/metallurgy/alloys.json +126 -0
- arka/skills/metallurgy/heat_treatments.json +139 -0
- arka/skills/metallurgy/lib.py +271 -0
- arka/skills/metallurgy/metallurgy_sources.py +37 -0
- arka/skills/metallurgy/run.py +88 -0
- arka/skills/metallurgy/skill.json +21 -0
- arka/skills/parallax_2d/run.py +4 -0
- arka/skills/parallax_2d/skill.json +10 -0
- arka/skills/rig_3d/run.py +4 -0
- arka/skills/rig_3d/skill.json +10 -0
- arka/skills/scene_3d/run.py +4 -0
- arka/skills/scene_3d/skill.json +10 -0
- arka/skills/semantic_alert/run.py +4 -0
- arka/skills/semantic_alert/skill.json +10 -0
- arka/skills/symbolic_image/run.py +4 -0
- arka/skills/symbolic_image/skill.json +10 -0
- arka/skills/text_to_3d/run.py +3 -0
- arka/skills/text_to_3d/skill.json +15 -0
- arka/skills/three_d/__pycache__/lib.cpython-313.pyc +0 -0
- arka/skills/three_d/lib.py +307 -0
- arka/skills/three_d/run.py +216 -0
- arka/skills/three_d/skill.json +25 -0
- arka/skills/video_evidence/skill.json +19 -0
- arka/skills/visual_diagnose/run.py +4 -0
- arka/skills/visual_diagnose/skill.json +10 -0
- arka/skills/word_counter/run.py +4 -0
- arka/skills/word_counter/skill.json +10 -0
- arka/skills.py +76 -0
- arka/stock/__init__.py +1 -0
- arka/stock/analyzer.py +29 -0
- arka/stock/bridge.py +200 -0
- arka/stock/competition_funding.py +590 -0
- arka/stock/context_worker.py +102 -0
- arka/stock/emotion.py +511 -0
- arka/stock/fundamentals.py +388 -0
- arka/stock/macro_events.py +532 -0
- arka/stock/predictions.py +1002 -0
- arka/stock/turboquant_install.py +190 -0
- arka/stock/turboquant_rag.py +677 -0
- arka/stock/ui.py +179 -0
- arka/teams/__init__.py +19 -0
- arka/teams/doctor.py +187 -0
- arka/teams/executor.py +710 -0
- arka/teams/io.py +252 -0
- arka/teams/mcp_context.py +95 -0
- arka/teams/resolve.py +104 -0
- arka/teams/schema.py +282 -0
- arka/teams/templates/team-clawbox-edge.yaml +19 -0
- arka/teams/templates/team-code-review.yaml +16 -0
- arka/teams/templates/team-research.yaml +22 -0
- arka/teams/templates/workflow-brainstorm.yaml +22 -0
- arka/teams/templates/workflow-code-review.yaml +16 -0
- arka/teams/templates/workflow-review-and-ship.yaml +16 -0
- arka/telemetry/__init__.py +41 -0
- arka/telemetry/_otlp.py +218 -0
- arka/telemetry/codebase_connectors.py +74 -0
- arka/telemetry/llm_obs.py +178 -0
- arka/telemetry/logs.py +162 -0
- arka/telemetry/mcp_obs.py +112 -0
- arka/telemetry/metrics.py +275 -0
- arka/telemetry/observability_doctor.py +60 -0
- arka/telemetry/signoz_alerts.py +191 -0
- arka/telemetry/signoz_cli.py +575 -0
- arka/telemetry/signoz_cursor_setup.py +92 -0
- arka/telemetry/signoz_demo.py +577 -0
- arka/telemetry/signoz_setup.py +409 -0
- arka/telemetry/supermemory_obs.py +117 -0
- arka/telemetry/tracing.py +490 -0
- arka/vision/__init__.py +5 -0
- arka/vision/chart_visual.py +351 -0
- arka/vision/describe.py +1479 -0
- arka/vision/ocr.py +393 -0
- arka/vision/screen.py +310 -0
- arka/vision/video.py +409 -0
- arka/voice/__init__.py +1 -0
- arka/voice/edge_speak.py +385 -0
- arka/voice/indic_tts.py +406 -0
- arka/voice/sarvam_speak.py +138 -0
- arka/voice/sarvam_stt.py +129 -0
- arka/youtube/__init__.py +1 -0
- arka/youtube/bulk.py +507 -0
- arka/youtube/research.py +502 -0
- arka/youtube/transcript.py +877 -0
- arka/youtube/ytdlp_progress.py +278 -0
- arka_agent-0.1.0.dist-info/METADATA +229 -0
- arka_agent-0.1.0.dist-info/RECORD +570 -0
- arka_agent-0.1.0.dist-info/WHEEL +5 -0
- arka_agent-0.1.0.dist-info/entry_points.txt +2 -0
- arka_agent-0.1.0.dist-info/licenses/LICENSE +339 -0
- arka_agent-0.1.0.dist-info/top_level.txt +1 -0
arka/__init__.py
ADDED
arka/__main__.py
ADDED
arka/_bootstrap.py
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"""Bootstrap legacy flat imports and dev checkout paths."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import inspect
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from types import ModuleType
|
|
10
|
+
|
|
11
|
+
_SRC = Path(__file__).resolve().parent.parent
|
|
12
|
+
_ROOT = _SRC.parent.parent
|
|
13
|
+
|
|
14
|
+
LEGACY_MODULES: dict[str, str] = {
|
|
15
|
+
"arka_paths": "arka.paths",
|
|
16
|
+
"arka_platform": "arka.core.platform",
|
|
17
|
+
"arka_progress": "arka.core.progress",
|
|
18
|
+
"arka_compute": "arka.core.compute",
|
|
19
|
+
"arka_disk": "arka.core.disk",
|
|
20
|
+
"arka_jsonkit": "arka.core.jsonkit",
|
|
21
|
+
"arka_timekit": "arka.core.timekit",
|
|
22
|
+
"arka_urlkit": "arka.core.urlkit",
|
|
23
|
+
"arka_textkit": "arka.core.textkit",
|
|
24
|
+
"arka_security": "arka.core.security",
|
|
25
|
+
"arka_usage": "arka.core.usage",
|
|
26
|
+
"arka_memory_detect": "arka.core.memory_detect",
|
|
27
|
+
"arka_session_memory": "arka.core.session_memory",
|
|
28
|
+
"arka_unified_memory": "arka.core.unified_memory",
|
|
29
|
+
"arka_memory": "arka.integrations.memory_cli",
|
|
30
|
+
"arka_personalize": "arka.core.personalize",
|
|
31
|
+
"arka_config": "arka.core.config_backup",
|
|
32
|
+
"arka_llm": "arka.llm.cli",
|
|
33
|
+
"arka_llm_fallback": "arka.llm.fallback",
|
|
34
|
+
"arka_llm_servers": "arka.llm.servers",
|
|
35
|
+
"arka_youtube": "arka.youtube.transcript",
|
|
36
|
+
"arka_youtube_research": "arka.youtube.research",
|
|
37
|
+
"arka_youtube_bulk": "arka.youtube.bulk",
|
|
38
|
+
"arka_ytdlp_progress": "arka.youtube.ytdlp_progress",
|
|
39
|
+
"arka_batch_summarize": "arka.media.batch",
|
|
40
|
+
"arka_media": "arka.media.transcript",
|
|
41
|
+
"arka_media_qa": "arka.media.qa",
|
|
42
|
+
"arka_summarize": "arka.media.summarize",
|
|
43
|
+
"arka_stock_bridge": "arka.stock.bridge",
|
|
44
|
+
"arka_stock_fundamentals": "arka.stock.fundamentals",
|
|
45
|
+
"arka_stock_ui": "arka.stock.ui",
|
|
46
|
+
"arka_stock_context_worker": "arka.stock.context_worker",
|
|
47
|
+
"arka_macro_events": "arka.stock.macro_events",
|
|
48
|
+
"arka_market_emotion": "arka.stock.emotion",
|
|
49
|
+
"arka_competition_funding": "arka.stock.competition_funding",
|
|
50
|
+
"arka_predictions": "arka.stock.predictions",
|
|
51
|
+
"arka_turboquant_install": "arka.stock.turboquant_install",
|
|
52
|
+
"arka_turboquant_rag": "arka.stock.turboquant_rag",
|
|
53
|
+
"arka_agent": "arka.agent.core",
|
|
54
|
+
"arka_professions": "arka.agent.professions",
|
|
55
|
+
"arka_profession_plugins": "arka.agent.profession_plugins",
|
|
56
|
+
"arka_profession_projects": "arka.agent.profession_projects",
|
|
57
|
+
"arka_chat": "arka.agent.chat",
|
|
58
|
+
"arka_survival_lang": "arka.agent.survival_lang",
|
|
59
|
+
"arka_pr_check": "arka.agent.pr_check",
|
|
60
|
+
"arka_github_repo": "arka.agent.github_repo",
|
|
61
|
+
"arka_competitions": "arka.agent.competitions",
|
|
62
|
+
"arka_bookmarks": "arka.agent.bookmarks",
|
|
63
|
+
"arka_repo_health": "arka.agent.repo_health",
|
|
64
|
+
"arka_free_credits": "arka.agent.free_credits",
|
|
65
|
+
"arka_repo_map": "arka.agent.repo_map",
|
|
66
|
+
"arka_repo_context": "arka.agent.repo_context",
|
|
67
|
+
"arka_self_improve": "arka.agent.self_improve",
|
|
68
|
+
"arka_generate_data": "arka.agent.generate_data",
|
|
69
|
+
"arka_data_ask": "arka.agent.data_ask",
|
|
70
|
+
"arka_view_data": "arka.agent.view_data",
|
|
71
|
+
"arka_docker_status": "arka.integrations.docker_status",
|
|
72
|
+
"arka_clipboard_history": "arka.integrations.clipboard_history",
|
|
73
|
+
"arka_route_learn": "arka.agent.route_learn",
|
|
74
|
+
"arka_skills": "arka.agent.skills",
|
|
75
|
+
"arka_talents": "arka.agent.talents",
|
|
76
|
+
"arka_wake": "arka.agent.wake",
|
|
77
|
+
"arka_voice": "arka.agent.voice",
|
|
78
|
+
"arka_stt_map": "arka.agent.stt_map",
|
|
79
|
+
"arka_assemblyai_stt": "arka.agent.assemblyai_stt",
|
|
80
|
+
"arka_supermemory": "arka.integrations.supermemory",
|
|
81
|
+
"arka_spotify": "arka.integrations.spotify",
|
|
82
|
+
"arka_whatsapp_inbox": "arka.integrations.whatsapp_inbox",
|
|
83
|
+
"arka_hf_bridge": "arka.integrations.hf_bridge",
|
|
84
|
+
"arka_remote_server": "arka.integrations.remote_server",
|
|
85
|
+
"arka_phone": "arka.integrations.phone",
|
|
86
|
+
"arka_remind": "arka.integrations.remind",
|
|
87
|
+
"arka_routines": "arka.integrations.routines",
|
|
88
|
+
"arka_heartbeat": "arka.integrations.heartbeat",
|
|
89
|
+
"arka_message_sessions": "arka.integrations.message_sessions",
|
|
90
|
+
"arka_subagent": "arka.integrations.subagent",
|
|
91
|
+
"arka_teams": "arka.integrations.teams_cli",
|
|
92
|
+
"arka_webhook": "arka.integrations.webhook",
|
|
93
|
+
"arka_sports": "arka.integrations.sports",
|
|
94
|
+
"arka_currency": "arka.integrations.currency",
|
|
95
|
+
"arka_open_url": "arka.integrations.open_url",
|
|
96
|
+
"arka_kalshi": "arka.integrations.kalshi",
|
|
97
|
+
"arka_kaggle": "arka.integrations.kaggle",
|
|
98
|
+
"arka_password_vault": "arka.integrations.password_vault",
|
|
99
|
+
"arka_google": "arka.integrations.google_workspace",
|
|
100
|
+
"arka_gemini": "arka.integrations.gemini_cli",
|
|
101
|
+
"arka_harvard_ark": "arka.integrations.harvard_ark",
|
|
102
|
+
"arka_fugu": "arka.integrations.fugu",
|
|
103
|
+
"arka_benchmark": "arka.integrations.benchmark_cli",
|
|
104
|
+
"arka_qr": "arka.integrations.qr_code",
|
|
105
|
+
"arka_mac_mic": "arka.integrations.mac_mic",
|
|
106
|
+
"arka_pdf_rag": "arka.pdf.rag",
|
|
107
|
+
"arka_pdf_tools": "arka.pdf.tools",
|
|
108
|
+
"arka_generate_image": "arka.generate.image",
|
|
109
|
+
"arka_generate_video": "arka.generate.video",
|
|
110
|
+
"arka_compose_slides": "arka.media.compose_slides",
|
|
111
|
+
"arka_compose_3d": "arka.media.compose_3d",
|
|
112
|
+
"arka_text_to_3d": "arka.agent.text_to_3d",
|
|
113
|
+
"arka_convert_media": "arka.media.convert_media",
|
|
114
|
+
"arka_chart": "arka.charts.plot",
|
|
115
|
+
"arka_ascii_art": "arka.agent.ascii_art",
|
|
116
|
+
"arka_flow": "arka.agent.flow",
|
|
117
|
+
"arka_fact_check": "arka.agent.fact_check",
|
|
118
|
+
"arka_astronomy": "arka.agent.astronomy",
|
|
119
|
+
"arka_metallurgy": "arka.agent.metallurgy",
|
|
120
|
+
"arka_three_d": "arka.media.compose_3d",
|
|
121
|
+
"arka_elon": "arka.agent.personas.elon",
|
|
122
|
+
"arka_persona": "arka.agent.personas.cli",
|
|
123
|
+
"arka_drawing": "arka.documents.drawing",
|
|
124
|
+
"arka_describe_image": "arka.vision.describe",
|
|
125
|
+
"arka_describe_video": "arka.vision.video",
|
|
126
|
+
"arka_aie": "arka.aie.cli",
|
|
127
|
+
"web_answer": "arka.agent.web_answer",
|
|
128
|
+
"edge_speak": "arka.voice.edge_speak",
|
|
129
|
+
"indic_tts": "arka.voice.indic_tts",
|
|
130
|
+
"sarvam_speak": "arka.voice.sarvam_speak",
|
|
131
|
+
"sarvam_stt": "arka.voice.sarvam_stt",
|
|
132
|
+
"spotify_dom": "arka.integrations.spotify_dom",
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
_bootstrapped = False
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def _ensure_src_on_path() -> None:
|
|
139
|
+
src_root = str(_ROOT / "src")
|
|
140
|
+
if src_root not in sys.path:
|
|
141
|
+
sys.path.insert(0, src_root)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def install_legacy_aliases() -> None:
|
|
145
|
+
for legacy, qualname in LEGACY_MODULES.items():
|
|
146
|
+
if legacy in sys.modules:
|
|
147
|
+
continue
|
|
148
|
+
try:
|
|
149
|
+
sys.modules[legacy] = importlib.import_module(qualname)
|
|
150
|
+
except ImportError:
|
|
151
|
+
continue
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def bootstrap() -> None:
|
|
155
|
+
global _bootstrapped
|
|
156
|
+
if _bootstrapped:
|
|
157
|
+
return
|
|
158
|
+
_ensure_src_on_path()
|
|
159
|
+
_bootstrapped = True
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def run_legacy_module(qualname: str) -> int:
|
|
163
|
+
"""Run a package module's ``main()`` or ``__main__`` block."""
|
|
164
|
+
bootstrap()
|
|
165
|
+
mod = importlib.import_module(qualname)
|
|
166
|
+
main = getattr(mod, "main", None)
|
|
167
|
+
if callable(main):
|
|
168
|
+
try:
|
|
169
|
+
params = list(inspect.signature(main).parameters)
|
|
170
|
+
except (TypeError, ValueError):
|
|
171
|
+
params = []
|
|
172
|
+
if params and params[0] in ("argv", "args"):
|
|
173
|
+
return int(main(sys.argv[1:]) or 0)
|
|
174
|
+
return int(main() or 0)
|
|
175
|
+
import runpy
|
|
176
|
+
|
|
177
|
+
runpy.run_module(qualname, run_name="__main__", alter_sys=True)
|
|
178
|
+
return 0
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def legacy_shim(qualname: str) -> ModuleType:
|
|
182
|
+
bootstrap()
|
|
183
|
+
return importlib.import_module(qualname)
|
arka/agent/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Arka agent."""
|
arka/agent/app_check.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Detect and validate common app build/test commands."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import json
|
|
6
|
+
import subprocess
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def commands(root: Path) -> list[list[str]]:
|
|
11
|
+
if (root / "package.json").is_file():
|
|
12
|
+
return [["npm", "run", "build"], ["npm", "test", "--", "--runInBand"]]
|
|
13
|
+
if (root / "pyproject.toml").is_file() or (root / "setup.py").is_file():
|
|
14
|
+
return [["python", "-m", "compileall", "-q", "."], ["python", "-m", "pytest", "-q"]]
|
|
15
|
+
if (root / "Cargo.toml").is_file():
|
|
16
|
+
return [["cargo", "check"], ["cargo", "test"]]
|
|
17
|
+
if (root / "go.mod").is_file():
|
|
18
|
+
return [["go", "build", "./..."], ["go", "test", "./..."]]
|
|
19
|
+
return []
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def check(root: str = ".", *, run: bool = False) -> dict:
|
|
23
|
+
path = Path(root).expanduser().resolve()
|
|
24
|
+
plan = commands(path)
|
|
25
|
+
results = []
|
|
26
|
+
if run:
|
|
27
|
+
for command in plan:
|
|
28
|
+
proc = subprocess.run(command, cwd=path, text=True, capture_output=True, timeout=900, check=False)
|
|
29
|
+
results.append({"command": command, "exit_code": proc.returncode, "output": (proc.stdout + proc.stderr)[-4000:]})
|
|
30
|
+
if proc.returncode:
|
|
31
|
+
break
|
|
32
|
+
return {"root": str(path), "commands": plan, "results": results, "ok": not results or all(item["exit_code"] == 0 for item in results)}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main(argv: list[str] | None = None) -> int:
|
|
36
|
+
parser = argparse.ArgumentParser(prog="arka app-check")
|
|
37
|
+
parser.add_argument("path", nargs="?", default=".")
|
|
38
|
+
parser.add_argument("--run", action="store_true", help="Run the detected build and test checks")
|
|
39
|
+
parser.add_argument("--json", action="store_true")
|
|
40
|
+
args = parser.parse_args(argv)
|
|
41
|
+
payload = check(args.path, run=args.run)
|
|
42
|
+
if args.json:
|
|
43
|
+
print(json.dumps(payload, indent=2))
|
|
44
|
+
else:
|
|
45
|
+
print(f"Detected checks for {payload['root']}:")
|
|
46
|
+
for command in payload["commands"]:
|
|
47
|
+
print(" "+" ".join(command))
|
|
48
|
+
for result in payload["results"]:
|
|
49
|
+
print(f" {'PASS' if result['exit_code'] == 0 else 'FAIL'} {' '.join(result['command'])}")
|
|
50
|
+
if result["exit_code"]:
|
|
51
|
+
print(result["output"])
|
|
52
|
+
return 0 if payload["ok"] else 1
|
arka/agent/ascii_art.py
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Render text or images as ASCII art in the terminal."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import re
|
|
8
|
+
import shlex
|
|
9
|
+
import shutil
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
DEFAULT_FONT = "standard"
|
|
15
|
+
ASCII_CHARS = "@%#*+=-:. "
|
|
16
|
+
_IMAGE_EXT = r"(?:jpg|jpeg|png|gif|webp|bmp|tiff|tif)"
|
|
17
|
+
|
|
18
|
+
# Minimal 5-row block font (A–Z, 0–9, space) when figlet/pyfiglet unavailable.
|
|
19
|
+
_BLOCK_FONT: dict[str, list[str]] = {
|
|
20
|
+
" ": [" ", " ", " ", " ", " "],
|
|
21
|
+
"0": [" ### ", "# #", "# ##", "# # #", " ### "],
|
|
22
|
+
"1": [" # ", " ## ", " # ", " # ", " ### "],
|
|
23
|
+
"2": [" ### ", "# #", " # ", " # ", "#####"],
|
|
24
|
+
"3": [" ### ", " #", " ### ", " #", " ### "],
|
|
25
|
+
"4": [" # #", "# # ", "#####", " # ", " # "],
|
|
26
|
+
"5": ["#####", "# ", "#### ", " #", "#### "],
|
|
27
|
+
"6": [" ### ", "# ", "#### ", "# #", " ### "],
|
|
28
|
+
"7": ["#####", " # ", " # ", " # ", " # "],
|
|
29
|
+
"8": [" ### ", "# #", " ### ", "# #", " ### "],
|
|
30
|
+
"9": [" ### ", "# #", " ####", " #", " ### "],
|
|
31
|
+
"A": [" ### ", "# #", "#####", "# #", "# #"],
|
|
32
|
+
"B": ["#### ", "# #", "#### ", "# #", "#### "],
|
|
33
|
+
"C": [" ### ", "# #", "# ", "# #", " ### "],
|
|
34
|
+
"D": ["#### ", "# #", "# #", "# #", "#### "],
|
|
35
|
+
"E": ["#####", "# ", "#### ", "# ", "#####"],
|
|
36
|
+
"F": ["#####", "# ", "#### ", "# ", "# "],
|
|
37
|
+
"G": [" ### ", "# ", "# ##", "# #", " ### "],
|
|
38
|
+
"H": ["# #", "# #", "#####", "# #", "# #"],
|
|
39
|
+
"I": [" ### ", " # ", " # ", " # ", " ### "],
|
|
40
|
+
"J": [" ###", " # ", " # ", "# # ", " ## "],
|
|
41
|
+
"K": ["# #", "# # ", "### ", "# # ", "# #"],
|
|
42
|
+
"L": ["# ", "# ", "# ", "# ", "#####"],
|
|
43
|
+
"M": ["# #", "## ##", "# # #", "# #", "# #"],
|
|
44
|
+
"N": ["# #", "## #", "# # #", "# ##", "# #"],
|
|
45
|
+
"O": [" ### ", "# #", "# #", "# #", " ### "],
|
|
46
|
+
"P": ["#### ", "# #", "#### ", "# ", "# "],
|
|
47
|
+
"Q": [" ### ", "# #", "# #", "# ##", " ### "],
|
|
48
|
+
"R": ["#### ", "# #", "#### ", "# # ", "# #"],
|
|
49
|
+
"S": [" ####", "# ", " ### ", " #", "#### "],
|
|
50
|
+
"T": ["#####", " # ", " # ", " # ", " # "],
|
|
51
|
+
"U": ["# #", "# #", "# #", "# #", " ### "],
|
|
52
|
+
"V": ["# #", "# #", "# #", " # # ", " # "],
|
|
53
|
+
"W": ["# #", "# #", "# # #", "## ##", "# #"],
|
|
54
|
+
"X": ["# #", " # # ", " # ", " # # ", "# #"],
|
|
55
|
+
"Y": ["# #", " # # ", " # ", " # ", " # "],
|
|
56
|
+
"Z": ["#####", " # ", " # ", " # ", "#####"],
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _is_ascii_art_request(text: str) -> bool:
|
|
61
|
+
t = text.strip()
|
|
62
|
+
if not t:
|
|
63
|
+
return False
|
|
64
|
+
if re.search(rf"(?i)\b(?:from|of)\s+.+\.{_IMAGE_EXT}\b", t):
|
|
65
|
+
return True
|
|
66
|
+
if re.search(rf"(?i)\b.+\.{_IMAGE_EXT}\s+(?:to|into)\s+ascii", t):
|
|
67
|
+
return True
|
|
68
|
+
return bool(
|
|
69
|
+
re.search(
|
|
70
|
+
r"(?i)(?:^|\b)(?:make|create|show|print|render|draw)\s+(?:an?\s+)?ascii\s+(?:art|banner|text)\b",
|
|
71
|
+
t,
|
|
72
|
+
)
|
|
73
|
+
or re.search(r"(?i)(?:^|\b)ascii\s+(?:art|banner)\b", t)
|
|
74
|
+
or re.search(r"(?i)(?:^|\b)figlet\b", t)
|
|
75
|
+
or re.match(r"(?i)^ascii\s+\S", t)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _extract_text_prompt(text: str) -> str:
|
|
80
|
+
t = text.strip()
|
|
81
|
+
for pat in (
|
|
82
|
+
r"(?i)^(?:make|create|show|print|render|draw)\s+(?:an?\s+)?ascii\s+(?:art|banner|text)\s+(?:of|for|with|say(?:ing)?|that\s+says)?\s*",
|
|
83
|
+
r"(?i)^ascii\s+(?:art|banner)\s+(?:of|for|with|say(?:ing)?|that\s+says)?\s*",
|
|
84
|
+
r"(?i)^figlet\s+",
|
|
85
|
+
r"(?i)^ascii\s+",
|
|
86
|
+
):
|
|
87
|
+
t = re.sub(pat, "", t).strip()
|
|
88
|
+
return t.strip("'\"")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _extract_image_path(text: str) -> str:
|
|
92
|
+
t = text.strip()
|
|
93
|
+
m = re.search(rf"(?i)(?:from|of)\s+([^\s'\"]+\.{_IMAGE_EXT})\b", t)
|
|
94
|
+
if m:
|
|
95
|
+
return m.group(1)
|
|
96
|
+
m = re.search(rf"(?i)([^\s'\"]+\.{_IMAGE_EXT})\s+(?:to|into)\s+ascii", t)
|
|
97
|
+
if m:
|
|
98
|
+
return m.group(1)
|
|
99
|
+
return ""
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def nl_to_argv(text: str) -> list[str]:
|
|
103
|
+
t = text.strip()
|
|
104
|
+
if not t or not _is_ascii_art_request(t):
|
|
105
|
+
return []
|
|
106
|
+
|
|
107
|
+
img = _extract_image_path(t)
|
|
108
|
+
if img:
|
|
109
|
+
argv = ["--from-image", img]
|
|
110
|
+
m = re.search(r"(?i)--width\s+(\d+)", t)
|
|
111
|
+
if m:
|
|
112
|
+
argv.extend(["--width", m.group(1)])
|
|
113
|
+
return argv
|
|
114
|
+
|
|
115
|
+
prompt = _extract_text_prompt(t)
|
|
116
|
+
m = re.search(r"(?i)(?:font|style)\s+([a-z0-9_-]+)", t)
|
|
117
|
+
if m:
|
|
118
|
+
prompt = re.sub(r"(?i)\s*(?:font|style)\s+[a-z0-9_-]+\s*$", "", prompt).strip()
|
|
119
|
+
if not prompt:
|
|
120
|
+
return []
|
|
121
|
+
|
|
122
|
+
argv = [prompt]
|
|
123
|
+
if m:
|
|
124
|
+
argv[:0] = ["--font", m.group(1)]
|
|
125
|
+
return argv
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _render_pyfiglet(text: str, font: str) -> str | None:
|
|
129
|
+
try:
|
|
130
|
+
import pyfiglet
|
|
131
|
+
except ImportError:
|
|
132
|
+
return None
|
|
133
|
+
try:
|
|
134
|
+
return pyfiglet.figlet_format(text, font=font)
|
|
135
|
+
except Exception:
|
|
136
|
+
try:
|
|
137
|
+
return pyfiglet.figlet_format(text, font=DEFAULT_FONT)
|
|
138
|
+
except Exception:
|
|
139
|
+
return None
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _render_system_figlet(text: str, font: str) -> str | None:
|
|
143
|
+
exe = shutil.which("figlet")
|
|
144
|
+
if not exe:
|
|
145
|
+
return None
|
|
146
|
+
for f in (font, DEFAULT_FONT):
|
|
147
|
+
try:
|
|
148
|
+
proc = subprocess.run(
|
|
149
|
+
[exe, "-f", f, text],
|
|
150
|
+
capture_output=True,
|
|
151
|
+
text=True,
|
|
152
|
+
timeout=15,
|
|
153
|
+
check=False,
|
|
154
|
+
)
|
|
155
|
+
if proc.returncode == 0 and proc.stdout.strip():
|
|
156
|
+
return proc.stdout
|
|
157
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
158
|
+
continue
|
|
159
|
+
return None
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def _render_npx_figlet(text: str) -> str | None:
|
|
163
|
+
if not shutil.which("npx"):
|
|
164
|
+
return None
|
|
165
|
+
try:
|
|
166
|
+
proc = subprocess.run(
|
|
167
|
+
["npx", "--yes", "figlet-cli", text],
|
|
168
|
+
capture_output=True,
|
|
169
|
+
text=True,
|
|
170
|
+
timeout=45,
|
|
171
|
+
check=False,
|
|
172
|
+
)
|
|
173
|
+
if proc.returncode == 0 and proc.stdout.strip():
|
|
174
|
+
return proc.stdout
|
|
175
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
176
|
+
pass
|
|
177
|
+
return None
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def _render_block_fallback(text: str) -> str:
|
|
181
|
+
rows = [""] * 5
|
|
182
|
+
for ch in text.upper():
|
|
183
|
+
glyph = _BLOCK_FONT.get(ch, _BLOCK_FONT.get("?"))
|
|
184
|
+
if glyph is None:
|
|
185
|
+
glyph = [" ? ", " # # ", " # ", " # # ", " ? "]
|
|
186
|
+
for i, line in enumerate(glyph):
|
|
187
|
+
rows[i] += line + " "
|
|
188
|
+
return "\n".join(rows).rstrip() + "\n"
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def render_text(text: str, font: str = DEFAULT_FONT) -> str:
|
|
192
|
+
text = text.strip()
|
|
193
|
+
if not text:
|
|
194
|
+
raise ValueError("empty text")
|
|
195
|
+
for fn in (
|
|
196
|
+
lambda: _render_pyfiglet(text, font),
|
|
197
|
+
lambda: _render_system_figlet(text, font),
|
|
198
|
+
lambda: _render_npx_figlet(text),
|
|
199
|
+
):
|
|
200
|
+
out = fn()
|
|
201
|
+
if out:
|
|
202
|
+
return out if out.endswith("\n") else out + "\n"
|
|
203
|
+
return _render_block_fallback(text)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def image_to_ascii(path: Path, width: int = 80) -> str:
|
|
207
|
+
try:
|
|
208
|
+
from PIL import Image
|
|
209
|
+
except ImportError as exc:
|
|
210
|
+
raise SystemExit(
|
|
211
|
+
"Pillow is required for image-to-ASCII.\n"
|
|
212
|
+
"Install: pip install Pillow\n"
|
|
213
|
+
"Or: pip install 'arka-agent[vision]'"
|
|
214
|
+
) from exc
|
|
215
|
+
|
|
216
|
+
if not path.is_file():
|
|
217
|
+
raise SystemExit(f"Image not found: {path}")
|
|
218
|
+
|
|
219
|
+
width = max(20, min(width, 200))
|
|
220
|
+
img = Image.open(path).convert("L")
|
|
221
|
+
aspect = img.height / img.width if img.width else 1
|
|
222
|
+
height = max(1, int(width * aspect * 0.55))
|
|
223
|
+
img = img.resize((width, height))
|
|
224
|
+
|
|
225
|
+
lines: list[str] = []
|
|
226
|
+
pixels = img.load()
|
|
227
|
+
for y in range(height):
|
|
228
|
+
row = []
|
|
229
|
+
for x in range(width):
|
|
230
|
+
lum = pixels[x, y] if pixels is not None else 0
|
|
231
|
+
idx = int(lum / 256 * len(ASCII_CHARS))
|
|
232
|
+
idx = min(idx, len(ASCII_CHARS) - 1)
|
|
233
|
+
row.append(ASCII_CHARS[idx])
|
|
234
|
+
lines.append("".join(row))
|
|
235
|
+
return "\n".join(lines) + "\n"
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def render_and_output(
|
|
239
|
+
*,
|
|
240
|
+
text: str = "",
|
|
241
|
+
font: str = DEFAULT_FONT,
|
|
242
|
+
from_image: str = "",
|
|
243
|
+
width: int = 80,
|
|
244
|
+
output: str = "",
|
|
245
|
+
) -> int:
|
|
246
|
+
if from_image:
|
|
247
|
+
art = image_to_ascii(Path(from_image).expanduser(), width=width)
|
|
248
|
+
else:
|
|
249
|
+
if not text.strip():
|
|
250
|
+
print("Usage: ascii_art <text> [--font NAME] [-o path]", file=sys.stderr)
|
|
251
|
+
print(" ascii_art --from-image photo.jpg [--width 80]", file=sys.stderr)
|
|
252
|
+
return 1
|
|
253
|
+
art = render_text(text, font=font)
|
|
254
|
+
|
|
255
|
+
print(art, end="" if art.endswith("\n") else "\n")
|
|
256
|
+
|
|
257
|
+
if output:
|
|
258
|
+
out = Path(output).expanduser()
|
|
259
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
260
|
+
out.write_text(art, encoding="utf-8")
|
|
261
|
+
print(f"Saved: {out}")
|
|
262
|
+
|
|
263
|
+
return 0
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def cmd_parse(args: argparse.Namespace) -> int:
|
|
267
|
+
argv = nl_to_argv(" ".join(args.text))
|
|
268
|
+
if not argv:
|
|
269
|
+
return 1
|
|
270
|
+
print(" ".join(shlex.quote(a) for a in argv))
|
|
271
|
+
return 0
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
275
|
+
p = argparse.ArgumentParser(description="Render ASCII art (figlet / pyfiglet / image)")
|
|
276
|
+
sub = p.add_subparsers(dest="cmd")
|
|
277
|
+
|
|
278
|
+
p_parse = sub.add_parser("parse", help="Parse natural language → ascii_art args")
|
|
279
|
+
p_parse.add_argument("text", nargs="+")
|
|
280
|
+
p_parse.set_defaults(func=cmd_parse)
|
|
281
|
+
|
|
282
|
+
return p
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def main(argv: list[str] | None = None) -> int:
|
|
286
|
+
argv = list(argv if argv is not None else sys.argv[1:])
|
|
287
|
+
if argv and argv[0] == "parse":
|
|
288
|
+
args = build_parser().parse_args(argv)
|
|
289
|
+
return args.func(args)
|
|
290
|
+
|
|
291
|
+
if argv and argv[0] in {"-h", "--help", "help"}:
|
|
292
|
+
build_parser().print_help()
|
|
293
|
+
return 0
|
|
294
|
+
|
|
295
|
+
nl = nl_to_argv(" ".join(argv))
|
|
296
|
+
if nl and not any(a.startswith("-") for a in argv[:2]):
|
|
297
|
+
argv = nl
|
|
298
|
+
|
|
299
|
+
parser = argparse.ArgumentParser(description="Render ASCII art (figlet / pyfiglet / image)")
|
|
300
|
+
parser.add_argument("text", nargs="*", help="Text to render")
|
|
301
|
+
parser.add_argument("-f", "--font", default=DEFAULT_FONT, help="Figlet font name")
|
|
302
|
+
parser.add_argument("--from-image", metavar="PATH", help="Convert image to ASCII")
|
|
303
|
+
parser.add_argument("--width", type=int, default=80, help="Image ASCII width (default 80)")
|
|
304
|
+
parser.add_argument("-o", "--output", help="Save output to file (also prints to terminal)")
|
|
305
|
+
args = parser.parse_args(argv)
|
|
306
|
+
|
|
307
|
+
if args.from_image:
|
|
308
|
+
return render_and_output(from_image=args.from_image, width=args.width, output=args.output or "")
|
|
309
|
+
|
|
310
|
+
text = " ".join(args.text).strip()
|
|
311
|
+
return render_and_output(text=text, font=args.font, output=args.output or "")
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
if __name__ == "__main__":
|
|
315
|
+
raise SystemExit(main())
|