arkaos 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONSTITUTION.md +81 -0
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/VERSION +1 -0
- package/arka/SKILL.md +134 -0
- package/bin/arkaos +107 -0
- package/config/constitution.yaml +168 -0
- package/config/hooks/post-tool-use-v2.sh +116 -0
- package/config/hooks/post-tool-use.sh +188 -0
- package/config/hooks/pre-compact-v2.sh +43 -0
- package/config/hooks/pre-compact.sh +99 -0
- package/config/hooks/user-prompt-submit-v2.sh +119 -0
- package/config/hooks/user-prompt-submit.sh +312 -0
- package/core/__init__.py +3 -0
- package/core/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__init__.py +14 -0
- package/core/agents/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/validator.cpython-313.pyc +0 -0
- package/core/agents/loader.py +88 -0
- package/core/agents/registry_gen.py +118 -0
- package/core/agents/schema.py +265 -0
- package/core/agents/validator.py +141 -0
- package/core/conclave/__init__.py +12 -0
- package/core/conclave/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/advisor_db.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/display.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/matcher.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/persistence.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/profiler.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/prompts.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/conclave/advisor_db.py +373 -0
- package/core/conclave/display.py +104 -0
- package/core/conclave/matcher.py +104 -0
- package/core/conclave/persistence.py +61 -0
- package/core/conclave/profiler.py +298 -0
- package/core/conclave/prompts.py +77 -0
- package/core/conclave/schema.py +132 -0
- package/core/governance/__init__.py +5 -0
- package/core/governance/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/constitution.cpython-313.pyc +0 -0
- package/core/governance/constitution.py +152 -0
- package/core/registry/__init__.py +1 -0
- package/core/registry/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/registry/__pycache__/generator.cpython-313.pyc +0 -0
- package/core/registry/generator.py +199 -0
- package/core/runtime/__init__.py +6 -0
- package/core/runtime/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/base.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/claude_code.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/codex_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/cursor.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/gemini_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
- package/core/runtime/base.py +143 -0
- package/core/runtime/claude_code.py +104 -0
- package/core/runtime/codex_cli.py +71 -0
- package/core/runtime/cursor.py +71 -0
- package/core/runtime/gemini_cli.py +68 -0
- package/core/runtime/registry.py +86 -0
- package/core/runtime/subagent.py +201 -0
- package/core/specs/__init__.py +10 -0
- package/core/specs/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/specs/manager.py +164 -0
- package/core/specs/schema.py +199 -0
- package/core/squads/__init__.py +7 -0
- package/core/squads/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/squads/loader.py +40 -0
- package/core/squads/registry.py +145 -0
- package/core/squads/schema.py +93 -0
- package/core/synapse/__init__.py +11 -0
- package/core/synapse/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/cache.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
- package/core/synapse/cache.py +82 -0
- package/core/synapse/engine.py +184 -0
- package/core/synapse/layers.py +441 -0
- package/core/tasks/__init__.py +6 -0
- package/core/tasks/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/tasks/manager.py +150 -0
- package/core/tasks/schema.py +108 -0
- package/core/workflow/__init__.py +10 -0
- package/core/workflow/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/workflow/engine.py +216 -0
- package/core/workflow/loader.py +28 -0
- package/core/workflow/schema.py +129 -0
- package/departments/brand/SKILL.md +85 -0
- package/departments/brand/agents/brand-director.yaml +77 -0
- package/departments/brand/agents/brand-strategist.md +182 -0
- package/departments/brand/agents/brand-strategist.yaml +58 -0
- package/departments/brand/agents/creative-director.md +149 -0
- package/departments/brand/agents/motion-designer.md +113 -0
- package/departments/brand/agents/ux-designer.yaml +60 -0
- package/departments/brand/agents/visual-designer.md +187 -0
- package/departments/brand/agents/visual-designer.yaml +58 -0
- package/departments/brand/references/brand-creation-guide.md +559 -0
- package/departments/brand/scripts/provider-call.sh +262 -0
- package/departments/brand/skills/archetype-finder/SKILL.md +18 -0
- package/departments/brand/skills/colors/SKILL.md +18 -0
- package/departments/brand/skills/design-system/SKILL.md +18 -0
- package/departments/brand/skills/identity-system/SKILL.md +18 -0
- package/departments/brand/skills/logo-brief/SKILL.md +18 -0
- package/departments/brand/skills/mockup-generate/SKILL.md +18 -0
- package/departments/brand/skills/naming-evaluate/SKILL.md +50 -0
- package/departments/brand/skills/positioning-statement/SKILL.md +18 -0
- package/departments/brand/skills/primal-audit/SKILL.md +43 -0
- package/departments/brand/skills/ux-audit/SKILL.md +18 -0
- package/departments/brand/skills/voice-guide/SKILL.md +18 -0
- package/departments/brand/skills/wireframe/SKILL.md +18 -0
- package/departments/brand/squad.yaml +39 -0
- package/departments/brand/workflows/identity.yaml +113 -0
- package/departments/brand/workflows/naming.yaml +58 -0
- package/departments/community/SKILL.md +62 -0
- package/departments/community/agents/community-manager.yaml +57 -0
- package/departments/community/agents/community-strategist.yaml +74 -0
- package/departments/community/agents/engagement-designer.yaml +56 -0
- package/departments/community/skills/ai-community/SKILL.md +18 -0
- package/departments/community/skills/betting-setup/SKILL.md +18 -0
- package/departments/community/skills/business-model/SKILL.md +53 -0
- package/departments/community/skills/content-calendar/SKILL.md +18 -0
- package/departments/community/skills/events-plan/SKILL.md +18 -0
- package/departments/community/skills/gamification-design/SKILL.md +18 -0
- package/departments/community/skills/growth-plan/SKILL.md +18 -0
- package/departments/community/skills/metrics-track/SKILL.md +18 -0
- package/departments/community/skills/moderation/SKILL.md +18 -0
- package/departments/community/skills/monetize-plan/SKILL.md +18 -0
- package/departments/community/skills/niche-setup/SKILL.md +18 -0
- package/departments/community/skills/onboarding-flow/SKILL.md +18 -0
- package/departments/community/skills/platform-select/SKILL.md +18 -0
- package/departments/community/skills/retention-system/SKILL.md +48 -0
- package/departments/community/squad.yaml +32 -0
- package/departments/community/workflows/setup.yaml +62 -0
- package/departments/content/SKILL.md +65 -0
- package/departments/content/agents/content-strategist.yaml +74 -0
- package/departments/content/agents/repurpose-distributor.yaml +57 -0
- package/departments/content/agents/scriptwriter.yaml +56 -0
- package/departments/content/agents/viral-engineer.yaml +56 -0
- package/departments/content/skills/ai-workflow/SKILL.md +18 -0
- package/departments/content/skills/analytics/SKILL.md +18 -0
- package/departments/content/skills/calendar/SKILL.md +18 -0
- package/departments/content/skills/content-system/SKILL.md +75 -0
- package/departments/content/skills/hook-write/SKILL.md +43 -0
- package/departments/content/skills/monetization-plan/SKILL.md +18 -0
- package/departments/content/skills/newsletter-write/SKILL.md +18 -0
- package/departments/content/skills/platform-optimize/SKILL.md +18 -0
- package/departments/content/skills/repurpose-plan/SKILL.md +18 -0
- package/departments/content/skills/script-structure/SKILL.md +18 -0
- package/departments/content/skills/short-form/SKILL.md +18 -0
- package/departments/content/skills/thumbnail-package/SKILL.md +18 -0
- package/departments/content/skills/viral-design/SKILL.md +45 -0
- package/departments/content/skills/youtube-strategy/SKILL.md +18 -0
- package/departments/content/squad.yaml +39 -0
- package/departments/content/workflows/viral.yaml +99 -0
- package/departments/dev/SKILL.md +135 -0
- package/departments/dev/agents/analyst.md +184 -0
- package/departments/dev/agents/architect.md +184 -0
- package/departments/dev/agents/architect.yaml +74 -0
- package/departments/dev/agents/backend-dev.yaml +70 -0
- package/departments/dev/agents/cto.md +140 -0
- package/departments/dev/agents/cto.yaml +77 -0
- package/departments/dev/agents/dba.yaml +72 -0
- package/departments/dev/agents/devops-eng.yaml +72 -0
- package/departments/dev/agents/devops.md +204 -0
- package/departments/dev/agents/frontend-dev.md +213 -0
- package/departments/dev/agents/frontend-dev.yaml +71 -0
- package/departments/dev/agents/qa-eng.yaml +72 -0
- package/departments/dev/agents/qa.md +231 -0
- package/departments/dev/agents/security-eng.yaml +72 -0
- package/departments/dev/agents/security.md +174 -0
- package/departments/dev/agents/senior-dev.md +177 -0
- package/departments/dev/agents/tech-lead.md +188 -0
- package/departments/dev/agents/tech-lead.yaml +72 -0
- package/departments/dev/skills/adversarial-review/SKILL.md +117 -0
- package/departments/dev/skills/agent-design/SKILL.md +127 -0
- package/departments/dev/skills/agent-workflow/SKILL.md +116 -0
- package/departments/dev/skills/ai-assisted-dev/SKILL.md +18 -0
- package/departments/dev/skills/ai-security/SKILL.md +112 -0
- package/departments/dev/skills/api-design/SKILL.md +59 -0
- package/departments/dev/skills/architecture-design/SKILL.md +89 -0
- package/departments/dev/skills/changelog/SKILL.md +110 -0
- package/departments/dev/skills/ci-cd-pipeline/SKILL.md +130 -0
- package/departments/dev/skills/clean-code-review/SKILL.md +65 -0
- package/departments/dev/skills/code-review/SKILL.md +18 -0
- package/departments/dev/skills/codebase-onboard/SKILL.md +109 -0
- package/departments/dev/skills/db-design/SKILL.md +18 -0
- package/departments/dev/skills/db-schema/SKILL.md +130 -0
- package/departments/dev/skills/ddd-model/SKILL.md +18 -0
- package/departments/dev/skills/dependency-audit/SKILL.md +118 -0
- package/departments/dev/skills/deploy/SKILL.md +18 -0
- package/departments/dev/skills/devops-pipeline/SKILL.md +18 -0
- package/departments/dev/skills/docs/SKILL.md +18 -0
- package/departments/dev/skills/env-secrets/SKILL.md +89 -0
- package/departments/dev/skills/incident/SKILL.md +125 -0
- package/departments/dev/skills/mcp/SKILL.md +106 -0
- package/departments/dev/skills/mcp-builder/SKILL.md +121 -0
- package/departments/dev/skills/observability/SKILL.md +119 -0
- package/departments/dev/skills/onboard/SKILL.md +389 -0
- package/departments/dev/skills/onboard/scripts/detect-stack.py +472 -0
- package/departments/dev/skills/performance-audit/SKILL.md +49 -0
- package/departments/dev/skills/performance-profiler/SKILL.md +128 -0
- package/departments/dev/skills/rag-architect/SKILL.md +125 -0
- package/departments/dev/skills/red-team/SKILL.md +112 -0
- package/departments/dev/skills/refactor-plan/SKILL.md +18 -0
- package/departments/dev/skills/release/SKILL.md +130 -0
- package/departments/dev/skills/research/SKILL.md +18 -0
- package/departments/dev/skills/runbook/SKILL.md +103 -0
- package/departments/dev/skills/scaffold/SKILL.md +249 -0
- package/departments/dev/skills/security-audit/SKILL.md +68 -0
- package/departments/dev/skills/skill-audit/SKILL.md +96 -0
- package/departments/dev/skills/spec/SKILL.md +218 -0
- package/departments/dev/skills/stack-check/SKILL.md +18 -0
- package/departments/dev/skills/tdd-cycle/SKILL.md +56 -0
- package/departments/dev/skills/tech-debt/SKILL.md +100 -0
- package/departments/dev/squad.yaml +62 -0
- package/departments/dev/workflows/debug.yaml +63 -0
- package/departments/dev/workflows/feature.yaml +129 -0
- package/departments/dev/workflows/refactor.yaml +64 -0
- package/departments/ecom/SKILL.md +39 -0
- package/departments/ecom/agents/commerce-engineer.yaml +58 -0
- package/departments/ecom/agents/cro-specialist.yaml +56 -0
- package/departments/ecom/agents/ecom-director.yaml +73 -0
- package/departments/ecom/agents/retention-manager.yaml +59 -0
- package/departments/ecom/skills/analytics/SKILL.md +18 -0
- package/departments/ecom/skills/cart-recovery/SKILL.md +18 -0
- package/departments/ecom/skills/cro-optimize/SKILL.md +58 -0
- package/departments/ecom/skills/customer-journey/SKILL.md +18 -0
- package/departments/ecom/skills/fulfillment-plan/SKILL.md +18 -0
- package/departments/ecom/skills/marketplace-manage/SKILL.md +18 -0
- package/departments/ecom/skills/pricing-strategy/SKILL.md +18 -0
- package/departments/ecom/skills/product-launch/SKILL.md +18 -0
- package/departments/ecom/skills/rfm-segment/SKILL.md +44 -0
- package/departments/ecom/skills/social-commerce/SKILL.md +18 -0
- package/departments/ecom/skills/store-audit/SKILL.md +18 -0
- package/departments/ecom/skills/subscription-model/SKILL.md +18 -0
- package/departments/ecom/squad.yaml +39 -0
- package/departments/ecom/workflows/product-page.yaml +62 -0
- package/departments/ecommerce/SKILL.md +363 -0
- package/departments/ecommerce/agents/ecommerce-manager.md +91 -0
- package/departments/finance/SKILL.md +37 -0
- package/departments/finance/agents/cfo.md +85 -0
- package/departments/finance/agents/cfo.yaml +77 -0
- package/departments/finance/agents/financial-analyst.yaml +57 -0
- package/departments/finance/agents/investment-strategist.yaml +58 -0
- package/departments/finance/skills/budget-plan/SKILL.md +18 -0
- package/departments/finance/skills/cashflow-forecast/SKILL.md +18 -0
- package/departments/finance/skills/ciso-advisor/SKILL.md +113 -0
- package/departments/finance/skills/financial-model/SKILL.md +70 -0
- package/departments/finance/skills/pitch-deck/SKILL.md +18 -0
- package/departments/finance/skills/scenario-analysis/SKILL.md +18 -0
- package/departments/finance/skills/unit-economics/SKILL.md +44 -0
- package/departments/finance/skills/valuation-model/SKILL.md +18 -0
- package/departments/finance/squad.yaml +37 -0
- package/departments/finance/workflows/cashflow.yaml +47 -0
- package/departments/finance/workflows/model.yaml +83 -0
- package/departments/kb/SKILL.md +38 -0
- package/departments/kb/agents/knowledge-curator.yaml +60 -0
- package/departments/kb/agents/knowledge-director.yaml +72 -0
- package/departments/kb/agents/research-analyst.yaml +58 -0
- package/departments/kb/skills/ai-research/SKILL.md +18 -0
- package/departments/kb/skills/competitive-intel/SKILL.md +18 -0
- package/departments/kb/skills/knowledge-review/SKILL.md +18 -0
- package/departments/kb/skills/learn-content/SKILL.md +18 -0
- package/departments/kb/skills/moc-create/SKILL.md +18 -0
- package/departments/kb/skills/persona-build/SKILL.md +18 -0
- package/departments/kb/skills/research-plan/SKILL.md +51 -0
- package/departments/kb/skills/search-kb/SKILL.md +18 -0
- package/departments/kb/skills/source-evaluate/SKILL.md +18 -0
- package/departments/kb/skills/taxonomy-manage/SKILL.md +18 -0
- package/departments/kb/skills/write-as-persona/SKILL.md +18 -0
- package/departments/kb/skills/zettelkasten-process/SKILL.md +56 -0
- package/departments/kb/squad.yaml +34 -0
- package/departments/kb/workflows/learn.yaml +63 -0
- package/departments/knowledge/SKILL.md +474 -0
- package/departments/knowledge/agents/knowledge-curator.md +89 -0
- package/departments/knowledge/scripts/kb-check-capabilities.sh +143 -0
- package/departments/knowledge/scripts/kb-cleanup.sh +135 -0
- package/departments/knowledge/scripts/kb-queue.sh +156 -0
- package/departments/knowledge/scripts/kb-status.sh +195 -0
- package/departments/knowledge/scripts/kb-worker.sh +217 -0
- package/departments/landing/SKILL.md +65 -0
- package/departments/landing/agents/affiliate-manager.yaml +57 -0
- package/departments/landing/agents/conversion-strategist.yaml +74 -0
- package/departments/landing/agents/cro-specialist.yaml +58 -0
- package/departments/landing/agents/sales-copywriter.yaml +61 -0
- package/departments/landing/skills/ab-test/SKILL.md +18 -0
- package/departments/landing/skills/affiliate-bridge/SKILL.md +18 -0
- package/departments/landing/skills/awareness-diagnose/SKILL.md +18 -0
- package/departments/landing/skills/copy-framework/SKILL.md +55 -0
- package/departments/landing/skills/email-sequence/SKILL.md +18 -0
- package/departments/landing/skills/funnel-design/SKILL.md +49 -0
- package/departments/landing/skills/funnel-metrics/SKILL.md +18 -0
- package/departments/landing/skills/headline-write/SKILL.md +18 -0
- package/departments/landing/skills/landing-gen/SKILL.md +124 -0
- package/departments/landing/skills/launch-sequence/SKILL.md +18 -0
- package/departments/landing/skills/offer-create/SKILL.md +62 -0
- package/departments/landing/skills/optimize-page/SKILL.md +18 -0
- package/departments/landing/skills/page-architect/SKILL.md +18 -0
- package/departments/landing/skills/persuasion-apply/SKILL.md +18 -0
- package/departments/landing/skills/webinar-funnel/SKILL.md +18 -0
- package/departments/landing/squad.yaml +39 -0
- package/departments/landing/workflows/launch.yaml +72 -0
- package/departments/landing/workflows/offer.yaml +99 -0
- package/departments/leadership/SKILL.md +35 -0
- package/departments/leadership/agents/culture-coach.yaml +59 -0
- package/departments/leadership/agents/hr-specialist.yaml +57 -0
- package/departments/leadership/agents/leadership-director.yaml +72 -0
- package/departments/leadership/skills/change-manage/SKILL.md +18 -0
- package/departments/leadership/skills/conflict-resolve/SKILL.md +18 -0
- package/departments/leadership/skills/culture-audit/SKILL.md +18 -0
- package/departments/leadership/skills/delegation-matrix/SKILL.md +18 -0
- package/departments/leadership/skills/disc-assess/SKILL.md +18 -0
- package/departments/leadership/skills/feedback-give/SKILL.md +18 -0
- package/departments/leadership/skills/hiring-plan/SKILL.md +18 -0
- package/departments/leadership/skills/okr-define/SKILL.md +69 -0
- package/departments/leadership/skills/performance-review/SKILL.md +18 -0
- package/departments/leadership/skills/team-health/SKILL.md +56 -0
- package/departments/leadership/squad.yaml +35 -0
- package/departments/leadership/workflows/team-build.yaml +55 -0
- package/departments/marketing/SKILL.md +61 -0
- package/departments/marketing/agents/content-creator.md +85 -0
- package/departments/marketing/agents/content-marketer.yaml +58 -0
- package/departments/marketing/agents/marketing-director.yaml +75 -0
- package/departments/marketing/agents/paid-specialist.yaml +58 -0
- package/departments/marketing/agents/seo-specialist.yaml +57 -0
- package/departments/marketing/skills/ab-test/SKILL.md +18 -0
- package/departments/marketing/skills/analytics-report/SKILL.md +18 -0
- package/departments/marketing/skills/audience-segment/SKILL.md +18 -0
- package/departments/marketing/skills/calendar-plan/SKILL.md +18 -0
- package/departments/marketing/skills/cold-email/SKILL.md +128 -0
- package/departments/marketing/skills/competitor-analysis/SKILL.md +18 -0
- package/departments/marketing/skills/content-audit/SKILL.md +18 -0
- package/departments/marketing/skills/email-sequence/SKILL.md +18 -0
- package/departments/marketing/skills/growth-loop/SKILL.md +50 -0
- package/departments/marketing/skills/marketing-automation/SKILL.md +18 -0
- package/departments/marketing/skills/paid-campaign/SKILL.md +18 -0
- package/departments/marketing/skills/programmatic-seo/SKILL.md +123 -0
- package/departments/marketing/skills/seo-audit/SKILL.md +48 -0
- package/departments/marketing/skills/social-strategy/SKILL.md +18 -0
- package/departments/marketing/squad.yaml +39 -0
- package/departments/marketing/workflows/campaign.yaml +112 -0
- package/departments/marketing/workflows/social.yaml +56 -0
- package/departments/operations/SKILL.md +422 -0
- package/departments/operations/agents/coo.md +88 -0
- package/departments/ops/SKILL.md +37 -0
- package/departments/ops/agents/automation-engineer.yaml +58 -0
- package/departments/ops/agents/ops-lead.yaml +71 -0
- package/departments/ops/skills/bottleneck-find/SKILL.md +49 -0
- package/departments/ops/skills/dashboard-build/SKILL.md +18 -0
- package/departments/ops/skills/gtd-setup/SKILL.md +18 -0
- package/departments/ops/skills/integration-design/SKILL.md +18 -0
- package/departments/ops/skills/lean-audit/SKILL.md +18 -0
- package/departments/ops/skills/metrics-dashboard/SKILL.md +18 -0
- package/departments/ops/skills/n8n-flow/SKILL.md +18 -0
- package/departments/ops/skills/sop-create/SKILL.md +18 -0
- package/departments/ops/skills/workflow-automate/SKILL.md +39 -0
- package/departments/ops/skills/zapier-flow/SKILL.md +18 -0
- package/departments/ops/squad.yaml +35 -0
- package/departments/ops/workflows/lean-audit.yaml +69 -0
- package/departments/org/SKILL.md +34 -0
- package/departments/org/agents/coo.yaml +80 -0
- package/departments/org/agents/org-designer.yaml +56 -0
- package/departments/org/agents/people-ops.yaml +56 -0
- package/departments/org/skills/compensation-plan/SKILL.md +18 -0
- package/departments/org/skills/culture-define/SKILL.md +18 -0
- package/departments/org/skills/decision-framework/SKILL.md +18 -0
- package/departments/org/skills/hiring-plan/SKILL.md +18 -0
- package/departments/org/skills/meeting-optimize/SKILL.md +18 -0
- package/departments/org/skills/onboarding-design/SKILL.md +18 -0
- package/departments/org/skills/org-design/SKILL.md +18 -0
- package/departments/org/skills/remote-setup/SKILL.md +18 -0
- package/departments/org/skills/sop-process/SKILL.md +18 -0
- package/departments/org/skills/team-assess/SKILL.md +18 -0
- package/departments/org/squad.yaml +33 -0
- package/departments/org/workflows/design.yaml +55 -0
- package/departments/pm/SKILL.md +39 -0
- package/departments/pm/agents/pm-director.yaml +75 -0
- package/departments/pm/agents/product-owner.yaml +59 -0
- package/departments/pm/agents/scrum-master.yaml +59 -0
- package/departments/pm/skills/agile-po/SKILL.md +118 -0
- package/departments/pm/skills/backlog-groom/SKILL.md +18 -0
- package/departments/pm/skills/discovery-plan/SKILL.md +48 -0
- package/departments/pm/skills/estimate-forecast/SKILL.md +18 -0
- package/departments/pm/skills/impact-map/SKILL.md +18 -0
- package/departments/pm/skills/kanban-setup/SKILL.md +18 -0
- package/departments/pm/skills/risk-register/SKILL.md +18 -0
- package/departments/pm/skills/roadmap-build/SKILL.md +18 -0
- package/departments/pm/skills/shape-pitch/SKILL.md +55 -0
- package/departments/pm/skills/sprint-plan/SKILL.md +18 -0
- package/departments/pm/skills/stakeholder-map/SKILL.md +18 -0
- package/departments/pm/skills/standup-run/SKILL.md +18 -0
- package/departments/pm/skills/story-write/SKILL.md +18 -0
- package/departments/pm/squad.yaml +37 -0
- package/departments/pm/workflows/retro.yaml +33 -0
- package/departments/quality/SKILL.md +66 -0
- package/departments/quality/agents/copy-director.md +134 -0
- package/departments/quality/agents/copy-director.yaml +73 -0
- package/departments/quality/agents/cqo.md +134 -0
- package/departments/quality/agents/cqo.yaml +76 -0
- package/departments/quality/agents/tech-director.yaml +79 -0
- package/departments/quality/agents/tech-ux-director.md +193 -0
- package/departments/quality/squad.yaml +25 -0
- package/departments/saas/SKILL.md +64 -0
- package/departments/saas/agents/cs-manager.yaml +57 -0
- package/departments/saas/agents/growth-engineer.yaml +57 -0
- package/departments/saas/agents/metrics-analyst.yaml +57 -0
- package/departments/saas/agents/saas-strategist.yaml +74 -0
- package/departments/saas/skills/benchmark-compare/SKILL.md +18 -0
- package/departments/saas/skills/churn-analysis/SKILL.md +18 -0
- package/departments/saas/skills/customer-success/SKILL.md +18 -0
- package/departments/saas/skills/growth-plan/SKILL.md +18 -0
- package/departments/saas/skills/gtm-strategy/SKILL.md +18 -0
- package/departments/saas/skills/launch-execute/SKILL.md +18 -0
- package/departments/saas/skills/metrics-dashboard/SKILL.md +18 -0
- package/departments/saas/skills/micro-saas-stack/SKILL.md +18 -0
- package/departments/saas/skills/mvp-build/SKILL.md +18 -0
- package/departments/saas/skills/niche-evaluate/SKILL.md +18 -0
- package/departments/saas/skills/onboarding-optimize/SKILL.md +18 -0
- package/departments/saas/skills/plg-setup/SKILL.md +53 -0
- package/departments/saas/skills/pricing-strategy/SKILL.md +48 -0
- package/departments/saas/skills/saas-scaffold/SKILL.md +127 -0
- package/departments/saas/skills/validate-idea/SKILL.md +55 -0
- package/departments/saas/squad.yaml +37 -0
- package/departments/saas/workflows/metrics.yaml +58 -0
- package/departments/saas/workflows/validate.yaml +103 -0
- package/departments/sales/SKILL.md +35 -0
- package/departments/sales/agents/sales-closer.yaml +58 -0
- package/departments/sales/agents/sales-director.yaml +72 -0
- package/departments/sales/agents/sales-ops.yaml +55 -0
- package/departments/sales/skills/challenger-sell/SKILL.md +18 -0
- package/departments/sales/skills/deal-qualify/SKILL.md +18 -0
- package/departments/sales/skills/discovery-call/SKILL.md +18 -0
- package/departments/sales/skills/forecast-revenue/SKILL.md +18 -0
- package/departments/sales/skills/negotiate-plan/SKILL.md +18 -0
- package/departments/sales/skills/objection-handle/SKILL.md +18 -0
- package/departments/sales/skills/pipeline-manage/SKILL.md +18 -0
- package/departments/sales/skills/pricing-negotiate/SKILL.md +18 -0
- package/departments/sales/skills/proposal-write/SKILL.md +54 -0
- package/departments/sales/skills/spin-sell/SKILL.md +50 -0
- package/departments/sales/squad.yaml +35 -0
- package/departments/sales/workflows/pipeline.yaml +49 -0
- package/departments/strategy/SKILL.md +37 -0
- package/departments/strategy/agents/business-model-designer.yaml +58 -0
- package/departments/strategy/agents/market-analyst.yaml +58 -0
- package/departments/strategy/agents/strategist.md +79 -0
- package/departments/strategy/agents/strategy-director.yaml +75 -0
- package/departments/strategy/skills/blue-ocean/SKILL.md +56 -0
- package/departments/strategy/skills/bmc/SKILL.md +18 -0
- package/departments/strategy/skills/board-advisor/SKILL.md +121 -0
- package/departments/strategy/skills/cto-advisor/SKILL.md +113 -0
- package/departments/strategy/skills/five-forces/SKILL.md +74 -0
- package/departments/strategy/skills/growth-strategy/SKILL.md +18 -0
- package/departments/strategy/skills/moat-analysis/SKILL.md +18 -0
- package/departments/strategy/skills/position/SKILL.md +18 -0
- package/departments/strategy/skills/scenario-plan/SKILL.md +18 -0
- package/departments/strategy/squad.yaml +37 -0
- package/departments/strategy/workflows/analysis.yaml +90 -0
- package/departments/strategy/workflows/swot.yaml +47 -0
- package/installer/adapters/claude-code.js +73 -0
- package/installer/adapters/codex-cli.js +34 -0
- package/installer/adapters/cursor.js +34 -0
- package/installer/adapters/gemini-cli.js +37 -0
- package/installer/cli.js +91 -0
- package/installer/detect-runtime.js +122 -0
- package/installer/doctor.js +105 -0
- package/installer/index.js +199 -0
- package/installer/uninstall.js +46 -0
- package/installer/update.js +39 -0
- package/knowledge/agents-registry-v2.json +2702 -0
- package/knowledge/commands-registry-v2.json +3827 -0
- package/package.json +58 -0
- package/pyproject.toml +64 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ARKA OS — KB Capability Detection
|
|
4
|
+
# Probes local binaries and API keys, writes ~/.arka-os/capabilities.json
|
|
5
|
+
# ============================================================================
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
ARKA_DIR="$HOME/.arka-os"
|
|
9
|
+
CAPS_FILE="$ARKA_DIR/capabilities.json"
|
|
10
|
+
ENV_FILE="$ARKA_DIR/.env"
|
|
11
|
+
|
|
12
|
+
mkdir -p "$ARKA_DIR"
|
|
13
|
+
|
|
14
|
+
# Load env if present
|
|
15
|
+
[ -f "$ENV_FILE" ] && source "$ENV_FILE"
|
|
16
|
+
|
|
17
|
+
# ─── Binary checks ──────────────────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
check_binary() {
|
|
20
|
+
local name="$1"
|
|
21
|
+
local path=""
|
|
22
|
+
local version=""
|
|
23
|
+
|
|
24
|
+
if path=$(command -v "$name" 2>/dev/null); then
|
|
25
|
+
case "$name" in
|
|
26
|
+
whisper) version=$(pip3 show openai-whisper 2>/dev/null | grep "^Version:" | cut -d' ' -f2 || echo "installed") ;;
|
|
27
|
+
yt-dlp) version=$($path --version 2>&1 | head -1 || echo "unknown") ;;
|
|
28
|
+
ffmpeg) version=$(ffmpeg -version 2>&1 | head -1 | sed 's/ffmpeg version //' | cut -d' ' -f1 || echo "unknown") ;;
|
|
29
|
+
jq) version=$($path --version 2>&1 || echo "unknown") ;;
|
|
30
|
+
python3) version=$($path --version 2>&1 | cut -d' ' -f2 || echo "unknown") ;;
|
|
31
|
+
esac
|
|
32
|
+
version=$(printf '%s' "$version" | tr -d '\n\r' | tr -cd '[:print:]')
|
|
33
|
+
printf '{"available":true,"path":"%s","version":"%s"}' "$path" "$version"
|
|
34
|
+
else
|
|
35
|
+
printf '{"available":false,"path":null,"version":null}'
|
|
36
|
+
fi
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# ─── API key checks ─────────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
check_key() {
|
|
42
|
+
local var_name="$1"
|
|
43
|
+
local value="${!var_name:-}"
|
|
44
|
+
if [ -n "$value" ] && [ ${#value} -ge 8 ]; then
|
|
45
|
+
printf '{"configured":true,"key_prefix":"%s***"}' "${value:0:6}"
|
|
46
|
+
else
|
|
47
|
+
printf '{"configured":false,"key_prefix":null}'
|
|
48
|
+
fi
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
# ─── Determine transcription method ─────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
whisper_available=false
|
|
54
|
+
openai_available=false
|
|
55
|
+
|
|
56
|
+
if command -v whisper &>/dev/null; then
|
|
57
|
+
whisper_available=true
|
|
58
|
+
fi
|
|
59
|
+
if [ -n "${OPENAI_API_KEY:-}" ] && [ ${#OPENAI_API_KEY} -ge 8 ]; then
|
|
60
|
+
openai_available=true
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if $whisper_available; then
|
|
64
|
+
transcription_method="local_whisper"
|
|
65
|
+
transcription_note="Using local Whisper (free, private)"
|
|
66
|
+
elif $openai_available; then
|
|
67
|
+
transcription_method="openai_api"
|
|
68
|
+
transcription_note="Using OpenAI Whisper API (requires credits)"
|
|
69
|
+
else
|
|
70
|
+
transcription_method="none"
|
|
71
|
+
transcription_note="No transcription available. Install whisper (pip install openai-whisper) or set OPENAI_API_KEY."
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# ─── Build JSON ──────────────────────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
cat > "$CAPS_FILE" << JSONEOF
|
|
77
|
+
{
|
|
78
|
+
"generated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
79
|
+
"binaries": {
|
|
80
|
+
"whisper": $(check_binary whisper),
|
|
81
|
+
"yt-dlp": $(check_binary yt-dlp),
|
|
82
|
+
"ffmpeg": $(check_binary ffmpeg),
|
|
83
|
+
"jq": $(check_binary jq),
|
|
84
|
+
"python3": $(check_binary python3)
|
|
85
|
+
},
|
|
86
|
+
"api_keys": {
|
|
87
|
+
"OPENAI_API_KEY": $(check_key OPENAI_API_KEY),
|
|
88
|
+
"GEMINI_API_KEY": $(check_key GEMINI_API_KEY),
|
|
89
|
+
"OPENROUTER_API_KEY": $(check_key OPENROUTER_API_KEY),
|
|
90
|
+
"REPLICATE_API_TOKEN": $(check_key REPLICATE_API_TOKEN),
|
|
91
|
+
"FAL_KEY": $(check_key FAL_KEY)
|
|
92
|
+
},
|
|
93
|
+
"transcription": {
|
|
94
|
+
"method": "$transcription_method",
|
|
95
|
+
"note": "$transcription_note"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
JSONEOF
|
|
99
|
+
|
|
100
|
+
# ─── Pretty output if running interactively ──────────────────────────────────
|
|
101
|
+
|
|
102
|
+
if [ -t 1 ]; then
|
|
103
|
+
CYAN='\033[0;36m'
|
|
104
|
+
GREEN='\033[0;32m'
|
|
105
|
+
YELLOW='\033[1;33m'
|
|
106
|
+
RED='\033[0;31m'
|
|
107
|
+
NC='\033[0m'
|
|
108
|
+
|
|
109
|
+
echo ""
|
|
110
|
+
echo -e "${CYAN}═══ ARKA OS — Capabilities ═══${NC}"
|
|
111
|
+
echo ""
|
|
112
|
+
echo -e "${CYAN}Binaries:${NC}"
|
|
113
|
+
for bin in whisper yt-dlp ffmpeg jq python3; do
|
|
114
|
+
if command -v "$bin" &>/dev/null; then
|
|
115
|
+
echo -e " ${GREEN}✓${NC} $bin ($(command -v "$bin"))"
|
|
116
|
+
else
|
|
117
|
+
echo -e " ${RED}✗${NC} $bin — not found"
|
|
118
|
+
fi
|
|
119
|
+
done
|
|
120
|
+
|
|
121
|
+
echo ""
|
|
122
|
+
echo -e "${CYAN}API Keys:${NC}"
|
|
123
|
+
for key in OPENAI_API_KEY GEMINI_API_KEY OPENROUTER_API_KEY REPLICATE_API_TOKEN FAL_KEY; do
|
|
124
|
+
value="${!key:-}"
|
|
125
|
+
if [ -n "$value" ] && [ ${#value} -ge 8 ]; then
|
|
126
|
+
echo -e " ${GREEN}✓${NC} $key (${value:0:6}***)"
|
|
127
|
+
else
|
|
128
|
+
echo -e " ${YELLOW}⚠${NC} $key — not set"
|
|
129
|
+
fi
|
|
130
|
+
done
|
|
131
|
+
|
|
132
|
+
echo ""
|
|
133
|
+
echo -e "${CYAN}Transcription:${NC}"
|
|
134
|
+
case "$transcription_method" in
|
|
135
|
+
local_whisper) echo -e " ${GREEN}✓${NC} $transcription_note" ;;
|
|
136
|
+
openai_api) echo -e " ${GREEN}✓${NC} $transcription_note" ;;
|
|
137
|
+
none) echo -e " ${RED}✗${NC} $transcription_note" ;;
|
|
138
|
+
esac
|
|
139
|
+
|
|
140
|
+
echo ""
|
|
141
|
+
echo -e "Written to: ${CYAN}$CAPS_FILE${NC}"
|
|
142
|
+
echo -e "${CYAN}═══════════════════════════════${NC}"
|
|
143
|
+
fi
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ARKA OS — KB Media Cleanup
|
|
4
|
+
# Removes old media directories for completed jobs.
|
|
5
|
+
#
|
|
6
|
+
# Usage: kb-cleanup.sh [--older-than 90d] [--dry-run]
|
|
7
|
+
# ============================================================================
|
|
8
|
+
|
|
9
|
+
ARKA_DIR="$HOME/.arka-os"
|
|
10
|
+
MEDIA_DIR="$ARKA_DIR/media"
|
|
11
|
+
JOBS_FILE="$ARKA_DIR/kb-jobs.json"
|
|
12
|
+
LOCK_FILE="$ARKA_DIR/kb-jobs.lock"
|
|
13
|
+
|
|
14
|
+
MAX_DAYS=90
|
|
15
|
+
DRY_RUN=false
|
|
16
|
+
|
|
17
|
+
# Parse args
|
|
18
|
+
while [ $# -gt 0 ]; do
|
|
19
|
+
case "$1" in
|
|
20
|
+
--older-than)
|
|
21
|
+
MAX_DAYS=$(echo "${2:-90d}" | sed 's/d$//')
|
|
22
|
+
shift 2
|
|
23
|
+
;;
|
|
24
|
+
--dry-run)
|
|
25
|
+
DRY_RUN=true
|
|
26
|
+
shift
|
|
27
|
+
;;
|
|
28
|
+
*)
|
|
29
|
+
shift
|
|
30
|
+
;;
|
|
31
|
+
esac
|
|
32
|
+
done
|
|
33
|
+
|
|
34
|
+
CYAN='\033[0;36m'
|
|
35
|
+
GREEN='\033[0;32m'
|
|
36
|
+
YELLOW='\033[1;33m'
|
|
37
|
+
RED='\033[0;31m'
|
|
38
|
+
NC='\033[0m'
|
|
39
|
+
|
|
40
|
+
if [ ! -d "$MEDIA_DIR" ]; then
|
|
41
|
+
echo -e "${YELLOW}No media directory found.${NC}"
|
|
42
|
+
exit 0
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
if ! command -v jq &>/dev/null; then
|
|
46
|
+
echo "Error: jq not found. Install with: brew install jq" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
echo ""
|
|
51
|
+
echo -e "${CYAN}═══ ARKA OS — KB Media Cleanup ═══${NC}"
|
|
52
|
+
echo -e " Removing completed jobs older than ${CYAN}${MAX_DAYS} days${NC}"
|
|
53
|
+
if $DRY_RUN; then
|
|
54
|
+
echo -e " ${YELLOW}DRY RUN — no files will be deleted${NC}"
|
|
55
|
+
fi
|
|
56
|
+
echo ""
|
|
57
|
+
|
|
58
|
+
CUTOFF_DATE=$(date -v-${MAX_DAYS}d +%Y-%m-%d 2>/dev/null || date -d "-${MAX_DAYS} days" +%Y-%m-%d 2>/dev/null)
|
|
59
|
+
if [ -z "$CUTOFF_DATE" ]; then
|
|
60
|
+
echo "Error: Could not calculate cutoff date" >&2
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo -e " Cutoff date: $CUTOFF_DATE"
|
|
65
|
+
echo ""
|
|
66
|
+
|
|
67
|
+
TOTAL_FREED=0
|
|
68
|
+
DIRS_REMOVED=0
|
|
69
|
+
|
|
70
|
+
# Iterate date directories
|
|
71
|
+
for date_dir in "$MEDIA_DIR"/*/; do
|
|
72
|
+
[ -d "$date_dir" ] || continue
|
|
73
|
+
DIR_DATE=$(basename "$date_dir")
|
|
74
|
+
|
|
75
|
+
# Check if date directory is older than cutoff
|
|
76
|
+
if [[ "$DIR_DATE" > "$CUTOFF_DATE" ]] || [[ "$DIR_DATE" == "$CUTOFF_DATE" ]]; then
|
|
77
|
+
continue
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# Check each job directory inside the date dir
|
|
81
|
+
for job_dir in "$date_dir"*/; do
|
|
82
|
+
[ -d "$job_dir" ] || continue
|
|
83
|
+
JOB_ID=$(basename "$job_dir")
|
|
84
|
+
|
|
85
|
+
# Check if this job is completed in the jobs file
|
|
86
|
+
if [ -f "$JOBS_FILE" ]; then
|
|
87
|
+
STATUS=$(jq -r --arg id "$JOB_ID" '.jobs[] | select(.id == $id) | .status // "unknown"' "$JOBS_FILE" 2>/dev/null)
|
|
88
|
+
|
|
89
|
+
# Only remove completed jobs
|
|
90
|
+
if [ "$STATUS" != "completed" ] && [ "$STATUS" != "unknown" ]; then
|
|
91
|
+
echo -e " ${YELLOW}SKIP${NC} $DIR_DATE/$JOB_ID (status: $STATUS)"
|
|
92
|
+
continue
|
|
93
|
+
fi
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
# Calculate directory size
|
|
97
|
+
DIR_SIZE=$(du -sk "$job_dir" 2>/dev/null | cut -f1)
|
|
98
|
+
DIR_SIZE_MB=$(echo "scale=1; $DIR_SIZE / 1024" | bc 2>/dev/null || echo "$DIR_SIZE KB")
|
|
99
|
+
|
|
100
|
+
if $DRY_RUN; then
|
|
101
|
+
echo -e " ${YELLOW}WOULD REMOVE${NC} $DIR_DATE/$JOB_ID (${DIR_SIZE_MB}MB)"
|
|
102
|
+
else
|
|
103
|
+
rm -rf "$job_dir"
|
|
104
|
+
echo -e " ${GREEN}REMOVED${NC} $DIR_DATE/$JOB_ID (${DIR_SIZE_MB}MB)"
|
|
105
|
+
|
|
106
|
+
# Remove job from jobs file
|
|
107
|
+
if [ -f "$JOBS_FILE" ]; then
|
|
108
|
+
(
|
|
109
|
+
flock -x 200
|
|
110
|
+
tmp="$JOBS_FILE.tmp.$$"
|
|
111
|
+
jq --arg id "$JOB_ID" '.jobs = [.jobs[] | select(.id != $id)]' \
|
|
112
|
+
"$JOBS_FILE" > "$tmp" && mv "$tmp" "$JOBS_FILE"
|
|
113
|
+
) 200>"$LOCK_FILE"
|
|
114
|
+
fi
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
TOTAL_FREED=$((TOTAL_FREED + DIR_SIZE))
|
|
118
|
+
DIRS_REMOVED=$((DIRS_REMOVED + 1))
|
|
119
|
+
done
|
|
120
|
+
|
|
121
|
+
# Remove empty date directories
|
|
122
|
+
if ! $DRY_RUN; then
|
|
123
|
+
rmdir "$date_dir" 2>/dev/null || true
|
|
124
|
+
fi
|
|
125
|
+
done
|
|
126
|
+
|
|
127
|
+
# Summary
|
|
128
|
+
echo ""
|
|
129
|
+
FREED_MB=$(echo "scale=1; $TOTAL_FREED / 1024" | bc 2>/dev/null || echo "${TOTAL_FREED}KB")
|
|
130
|
+
if $DRY_RUN; then
|
|
131
|
+
echo -e "${YELLOW}DRY RUN:${NC} Would remove ${CYAN}$DIRS_REMOVED${NC} directories, freeing ~${CYAN}${FREED_MB}MB${NC}"
|
|
132
|
+
else
|
|
133
|
+
echo -e "${GREEN}Cleaned up:${NC} ${CYAN}$DIRS_REMOVED${NC} directories, freed ~${CYAN}${FREED_MB}MB${NC}"
|
|
134
|
+
fi
|
|
135
|
+
echo -e "${CYAN}══════════════════════════════════${NC}"
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ARKA OS — KB Queue Dispatcher
|
|
4
|
+
# Queues a URL for background download + transcription.
|
|
5
|
+
#
|
|
6
|
+
# Usage: kb-queue.sh <url> [--persona "Name"]
|
|
7
|
+
# Output: job ID (8 chars)
|
|
8
|
+
# ============================================================================
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
URL="${1:-}"
|
|
12
|
+
PERSONA=""
|
|
13
|
+
|
|
14
|
+
# Parse args
|
|
15
|
+
shift || true
|
|
16
|
+
while [ $# -gt 0 ]; do
|
|
17
|
+
case "$1" in
|
|
18
|
+
--persona) PERSONA="${2:-}"; shift 2 ;;
|
|
19
|
+
*) shift ;;
|
|
20
|
+
esac
|
|
21
|
+
done
|
|
22
|
+
|
|
23
|
+
if [ -z "$URL" ]; then
|
|
24
|
+
echo "Usage: kb-queue.sh <url> [--persona \"Name\"]" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
ARKA_DIR="$HOME/.arka-os"
|
|
29
|
+
JOBS_FILE="$ARKA_DIR/kb-jobs.json"
|
|
30
|
+
LOCK_FILE="$ARKA_DIR/kb-jobs.lock"
|
|
31
|
+
CAPS_FILE="$ARKA_DIR/capabilities.json"
|
|
32
|
+
SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
33
|
+
|
|
34
|
+
mkdir -p "$ARKA_DIR"
|
|
35
|
+
|
|
36
|
+
# ─── Generate job ID ────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
JOB_ID=$(printf '%s%s' "$URL" "$(date +%s%N)" | md5sum 2>/dev/null || printf '%s%s' "$URL" "$(date +%s)" | md5 2>/dev/null)
|
|
39
|
+
JOB_ID="${JOB_ID:0:8}"
|
|
40
|
+
|
|
41
|
+
# ─── Create output directory ────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
DATE_DIR=$(date +%Y-%m-%d)
|
|
44
|
+
OUTPUT_DIR="$ARKA_DIR/media/$DATE_DIR/$JOB_ID"
|
|
45
|
+
mkdir -p "$OUTPUT_DIR"
|
|
46
|
+
|
|
47
|
+
# ─── Determine transcription method ─────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
TRANSCRIPTION_METHOD="none"
|
|
50
|
+
|
|
51
|
+
# Run capabilities check if file doesn't exist or is older than 1 hour
|
|
52
|
+
REFRESH_CAPS=false
|
|
53
|
+
if [ ! -f "$CAPS_FILE" ]; then
|
|
54
|
+
REFRESH_CAPS=true
|
|
55
|
+
elif [ "$(uname)" = "Darwin" ]; then
|
|
56
|
+
CAPS_AGE=$(( $(date +%s) - $(stat -f%m "$CAPS_FILE") ))
|
|
57
|
+
[ "$CAPS_AGE" -gt 3600 ] && REFRESH_CAPS=true
|
|
58
|
+
else
|
|
59
|
+
CAPS_AGE=$(( $(date +%s) - $(stat -c%Y "$CAPS_FILE") ))
|
|
60
|
+
[ "$CAPS_AGE" -gt 3600 ] && REFRESH_CAPS=true
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if $REFRESH_CAPS && [ -f "$SCRIPTS_DIR/kb-check-capabilities.sh" ]; then
|
|
64
|
+
bash "$SCRIPTS_DIR/kb-check-capabilities.sh" >/dev/null 2>&1
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# Read transcription method from capabilities
|
|
68
|
+
if [ -f "$CAPS_FILE" ] && command -v jq &>/dev/null; then
|
|
69
|
+
TRANSCRIPTION_METHOD=$(jq -r '.transcription.method // "none"' "$CAPS_FILE")
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# ─── Check yt-dlp is available ──────────────────────────────────────────────
|
|
73
|
+
|
|
74
|
+
if ! command -v yt-dlp &>/dev/null; then
|
|
75
|
+
echo "Error: yt-dlp not found. Install with: brew install yt-dlp" >&2
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# ─── Initialize jobs file if needed ─────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
(
|
|
82
|
+
flock -x 200
|
|
83
|
+
|
|
84
|
+
if [ ! -f "$JOBS_FILE" ]; then
|
|
85
|
+
echo '{"jobs":[]}' > "$JOBS_FILE"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Validate JSON
|
|
89
|
+
if ! jq empty "$JOBS_FILE" 2>/dev/null; then
|
|
90
|
+
echo '{"jobs":[]}' > "$JOBS_FILE"
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Add job entry
|
|
94
|
+
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
95
|
+
tmp="$JOBS_FILE.tmp.$$"
|
|
96
|
+
jq --arg id "$JOB_ID" \
|
|
97
|
+
--arg url "$URL" \
|
|
98
|
+
--arg dir "$OUTPUT_DIR" \
|
|
99
|
+
--arg method "$TRANSCRIPTION_METHOD" \
|
|
100
|
+
--arg persona "$PERSONA" \
|
|
101
|
+
--arg now "$NOW" \
|
|
102
|
+
'.jobs += [{
|
|
103
|
+
"id": $id,
|
|
104
|
+
"url": $url,
|
|
105
|
+
"output_dir": $dir,
|
|
106
|
+
"transcription_method": $method,
|
|
107
|
+
"persona": $persona,
|
|
108
|
+
"status": "queued",
|
|
109
|
+
"title": null,
|
|
110
|
+
"word_count": null,
|
|
111
|
+
"error": null,
|
|
112
|
+
"pid": null,
|
|
113
|
+
"created_at": $now,
|
|
114
|
+
"updated_at": $now
|
|
115
|
+
}]' "$JOBS_FILE" > "$tmp" && mv "$tmp" "$JOBS_FILE"
|
|
116
|
+
|
|
117
|
+
) 200>"$LOCK_FILE"
|
|
118
|
+
|
|
119
|
+
# ─── Launch worker in background ────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
WORKER_SCRIPT="$SCRIPTS_DIR/kb-worker.sh"
|
|
122
|
+
if [ ! -f "$WORKER_SCRIPT" ]; then
|
|
123
|
+
echo "Error: Worker script not found: $WORKER_SCRIPT" >&2
|
|
124
|
+
exit 1
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
nohup bash "$WORKER_SCRIPT" "$JOB_ID" "$URL" "$OUTPUT_DIR" "$TRANSCRIPTION_METHOD" \
|
|
128
|
+
> /dev/null 2>&1 &
|
|
129
|
+
WORKER_PID=$!
|
|
130
|
+
|
|
131
|
+
# Record PID in jobs file
|
|
132
|
+
(
|
|
133
|
+
flock -x 200
|
|
134
|
+
tmp="$JOBS_FILE.tmp.$$"
|
|
135
|
+
jq --arg id "$JOB_ID" --argjson pid "$WORKER_PID" \
|
|
136
|
+
'(.jobs[] | select(.id == $id)).pid = $pid' \
|
|
137
|
+
"$JOBS_FILE" > "$tmp" && mv "$tmp" "$JOBS_FILE"
|
|
138
|
+
) 200>"$LOCK_FILE"
|
|
139
|
+
|
|
140
|
+
# ─── Output ─────────────────────────────────────────────────────────────────
|
|
141
|
+
|
|
142
|
+
if [ -t 1 ]; then
|
|
143
|
+
CYAN='\033[0;36m'
|
|
144
|
+
GREEN='\033[0;32m'
|
|
145
|
+
NC='\033[0m'
|
|
146
|
+
echo -e "${GREEN}✓${NC} Queued job ${CYAN}$JOB_ID${NC}"
|
|
147
|
+
echo -e " URL: $URL"
|
|
148
|
+
echo -e " Method: $TRANSCRIPTION_METHOD"
|
|
149
|
+
echo -e " Output: $OUTPUT_DIR"
|
|
150
|
+
echo -e " PID: $WORKER_PID"
|
|
151
|
+
if [ -n "$PERSONA" ]; then
|
|
152
|
+
echo -e " Persona: $PERSONA"
|
|
153
|
+
fi
|
|
154
|
+
else
|
|
155
|
+
echo "$JOB_ID"
|
|
156
|
+
fi
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ARKA OS — KB Status Checker
|
|
4
|
+
# Shows status of queued/running/ready/completed jobs.
|
|
5
|
+
#
|
|
6
|
+
# Usage: kb-status.sh [job-id] [--json]
|
|
7
|
+
# ============================================================================
|
|
8
|
+
|
|
9
|
+
ARKA_DIR="$HOME/.arka-os"
|
|
10
|
+
JOBS_FILE="$ARKA_DIR/kb-jobs.json"
|
|
11
|
+
LOCK_FILE="$ARKA_DIR/kb-jobs.lock"
|
|
12
|
+
|
|
13
|
+
JOB_ID=""
|
|
14
|
+
JSON_MODE=false
|
|
15
|
+
|
|
16
|
+
# Parse args
|
|
17
|
+
while [ $# -gt 0 ]; do
|
|
18
|
+
case "$1" in
|
|
19
|
+
--json) JSON_MODE=true; shift ;;
|
|
20
|
+
*) JOB_ID="$1"; shift ;;
|
|
21
|
+
esac
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
# Colors
|
|
25
|
+
CYAN='\033[0;36m'
|
|
26
|
+
GREEN='\033[0;32m'
|
|
27
|
+
YELLOW='\033[1;33m'
|
|
28
|
+
RED='\033[0;31m'
|
|
29
|
+
BLUE='\033[0;34m'
|
|
30
|
+
NC='\033[0m'
|
|
31
|
+
|
|
32
|
+
# ─── Check jobs file exists ─────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
if [ ! -f "$JOBS_FILE" ]; then
|
|
35
|
+
if $JSON_MODE; then
|
|
36
|
+
echo '{"jobs":[]}'
|
|
37
|
+
else
|
|
38
|
+
echo -e "${YELLOW}No jobs found.${NC} Queue a URL with: /kb learn <url>"
|
|
39
|
+
fi
|
|
40
|
+
exit 0
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
if ! command -v jq &>/dev/null; then
|
|
44
|
+
echo "Error: jq not found. Install with: brew install jq" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# ─── Validate running PIDs ──────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
(
|
|
51
|
+
flock -x 200
|
|
52
|
+
|
|
53
|
+
# Check each running/downloading/transcribing job's PID
|
|
54
|
+
ACTIVE_IDS=$(jq -r '.jobs[] | select(.status == "downloading" or .status == "transcribing" or .status == "queued") | .id' "$JOBS_FILE" 2>/dev/null)
|
|
55
|
+
|
|
56
|
+
CHANGED=false
|
|
57
|
+
for id in $ACTIVE_IDS; do
|
|
58
|
+
PID=$(jq -r --arg id "$id" '.jobs[] | select(.id == $id) | .pid // empty' "$JOBS_FILE")
|
|
59
|
+
if [ -n "$PID" ] && ! kill -0 "$PID" 2>/dev/null; then
|
|
60
|
+
# PID is dead — mark as failed
|
|
61
|
+
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
62
|
+
tmp="$JOBS_FILE.tmp.$$"
|
|
63
|
+
jq --arg id "$id" --arg t "$NOW" \
|
|
64
|
+
'(.jobs[] | select(.id == $id)) |= (.status = "failed" | .error = "Worker process died unexpectedly" | .updated_at = $t)' \
|
|
65
|
+
"$JOBS_FILE" > "$tmp" && mv "$tmp" "$JOBS_FILE"
|
|
66
|
+
CHANGED=true
|
|
67
|
+
fi
|
|
68
|
+
done
|
|
69
|
+
|
|
70
|
+
) 200>"$LOCK_FILE"
|
|
71
|
+
|
|
72
|
+
# ─── Single job detail ──────────────────────────────────────────────────────
|
|
73
|
+
|
|
74
|
+
if [ -n "$JOB_ID" ]; then
|
|
75
|
+
JOB=$(jq --arg id "$JOB_ID" '.jobs[] | select(.id == $id)' "$JOBS_FILE" 2>/dev/null)
|
|
76
|
+
|
|
77
|
+
if [ -z "$JOB" ] || [ "$JOB" = "null" ]; then
|
|
78
|
+
echo "Job not found: $JOB_ID" >&2
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
if $JSON_MODE; then
|
|
83
|
+
echo "$JOB" | jq .
|
|
84
|
+
exit 0
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
STATUS=$(echo "$JOB" | jq -r '.status')
|
|
88
|
+
URL=$(echo "$JOB" | jq -r '.url')
|
|
89
|
+
TITLE=$(echo "$JOB" | jq -r '.title // "Pending..."')
|
|
90
|
+
DIR=$(echo "$JOB" | jq -r '.output_dir')
|
|
91
|
+
METHOD=$(echo "$JOB" | jq -r '.transcription_method')
|
|
92
|
+
PERSONA=$(echo "$JOB" | jq -r '.persona // "Not assigned"')
|
|
93
|
+
WORDS=$(echo "$JOB" | jq -r '.word_count // "—"')
|
|
94
|
+
ERROR=$(echo "$JOB" | jq -r '.error // ""')
|
|
95
|
+
CREATED=$(echo "$JOB" | jq -r '.created_at')
|
|
96
|
+
UPDATED=$(echo "$JOB" | jq -r '.updated_at')
|
|
97
|
+
|
|
98
|
+
# Status color
|
|
99
|
+
case "$STATUS" in
|
|
100
|
+
queued) STATUS_COLOR="$YELLOW" ;;
|
|
101
|
+
downloading) STATUS_COLOR="$BLUE" ;;
|
|
102
|
+
transcribing) STATUS_COLOR="$BLUE" ;;
|
|
103
|
+
ready) STATUS_COLOR="$GREEN" ;;
|
|
104
|
+
analyzing) STATUS_COLOR="$CYAN" ;;
|
|
105
|
+
completed) STATUS_COLOR="$GREEN" ;;
|
|
106
|
+
failed) STATUS_COLOR="$RED" ;;
|
|
107
|
+
*) STATUS_COLOR="$NC" ;;
|
|
108
|
+
esac
|
|
109
|
+
|
|
110
|
+
echo ""
|
|
111
|
+
echo -e "${CYAN}═══ Job: $JOB_ID ═══${NC}"
|
|
112
|
+
echo -e " Status: ${STATUS_COLOR}$STATUS${NC}"
|
|
113
|
+
echo -e " Title: $TITLE"
|
|
114
|
+
echo -e " URL: $URL"
|
|
115
|
+
echo -e " Method: $METHOD"
|
|
116
|
+
echo -e " Persona: $PERSONA"
|
|
117
|
+
echo -e " Words: $WORDS"
|
|
118
|
+
echo -e " Output: $DIR"
|
|
119
|
+
echo -e " Created: $CREATED"
|
|
120
|
+
echo -e " Updated: $UPDATED"
|
|
121
|
+
if [ -n "$ERROR" ]; then
|
|
122
|
+
echo -e " ${RED}Error: $ERROR${NC}"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# Show available files
|
|
126
|
+
if [ -d "$DIR" ]; then
|
|
127
|
+
echo ""
|
|
128
|
+
echo -e " ${CYAN}Files:${NC}"
|
|
129
|
+
for f in "$DIR"/*; do
|
|
130
|
+
[ -f "$f" ] || continue
|
|
131
|
+
SIZE=$(ls -lh "$f" | awk '{print $5}')
|
|
132
|
+
echo -e " $(basename "$f") ($SIZE)"
|
|
133
|
+
done
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
echo -e "${CYAN}══════════════════════${NC}"
|
|
137
|
+
exit 0
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
# ─── Summary table ──────────────────────────────────────────────────────────
|
|
141
|
+
|
|
142
|
+
if $JSON_MODE; then
|
|
143
|
+
jq . "$JOBS_FILE"
|
|
144
|
+
exit 0
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
TOTAL=$(jq '.jobs | length' "$JOBS_FILE")
|
|
148
|
+
if [ "$TOTAL" -eq 0 ]; then
|
|
149
|
+
echo -e "${YELLOW}No jobs found.${NC} Queue a URL with: /kb learn <url>"
|
|
150
|
+
exit 0
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
echo ""
|
|
154
|
+
echo -e "${CYAN}═══ ARKA OS — KB Job Queue ═══${NC}"
|
|
155
|
+
echo ""
|
|
156
|
+
printf " ${CYAN}%-10s %-12s %-40s %s${NC}\n" "ID" "STATUS" "TITLE" "METHOD"
|
|
157
|
+
printf " %-10s %-12s %-40s %s\n" "──────────" "────────────" "────────────────────────────────────────" "──────────"
|
|
158
|
+
|
|
159
|
+
jq -r '.jobs[] | [.id, .status, (.title // "Pending..."), .transcription_method] | @tsv' "$JOBS_FILE" | while IFS=$'\t' read -r id status title method; do
|
|
160
|
+
# Truncate title
|
|
161
|
+
if [ ${#title} -gt 38 ]; then
|
|
162
|
+
title="${title:0:35}..."
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Status color
|
|
166
|
+
case "$status" in
|
|
167
|
+
queued) SC="$YELLOW" ;;
|
|
168
|
+
downloading) SC="$BLUE" ;;
|
|
169
|
+
transcribing) SC="$BLUE" ;;
|
|
170
|
+
ready) SC="$GREEN" ;;
|
|
171
|
+
analyzing) SC="$CYAN" ;;
|
|
172
|
+
completed) SC="$GREEN" ;;
|
|
173
|
+
failed) SC="$RED" ;;
|
|
174
|
+
*) SC="$NC" ;;
|
|
175
|
+
esac
|
|
176
|
+
|
|
177
|
+
printf " %-10s ${SC}%-12s${NC} %-40s %s\n" "$id" "$status" "$title" "$method"
|
|
178
|
+
done
|
|
179
|
+
|
|
180
|
+
# Summary counts
|
|
181
|
+
QUEUED=$(jq '[.jobs[] | select(.status == "queued")] | length' "$JOBS_FILE")
|
|
182
|
+
ACTIVE=$(jq '[.jobs[] | select(.status == "downloading" or .status == "transcribing")] | length' "$JOBS_FILE")
|
|
183
|
+
READY=$(jq '[.jobs[] | select(.status == "ready")] | length' "$JOBS_FILE")
|
|
184
|
+
COMPLETED=$(jq '[.jobs[] | select(.status == "completed")] | length' "$JOBS_FILE")
|
|
185
|
+
FAILED=$(jq '[.jobs[] | select(.status == "failed")] | length' "$JOBS_FILE")
|
|
186
|
+
|
|
187
|
+
echo ""
|
|
188
|
+
echo -e " Queued: ${YELLOW}$QUEUED${NC} Active: ${BLUE}$ACTIVE${NC} Ready: ${GREEN}$READY${NC} Completed: ${GREEN}$COMPLETED${NC} Failed: ${RED}$FAILED${NC}"
|
|
189
|
+
echo ""
|
|
190
|
+
|
|
191
|
+
if [ "$READY" -gt 0 ]; then
|
|
192
|
+
echo -e " ${GREEN}$READY job(s) ready for processing.${NC} Run: /kb process <job-id>"
|
|
193
|
+
fi
|
|
194
|
+
|
|
195
|
+
echo -e "${CYAN}═══════════════════════════════${NC}"
|