create-workframe 0.1.0
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/.dockerignore +22 -0
- package/.gitignore +73 -0
- package/LICENSE +201 -0
- package/NOTICE +12 -0
- package/README.md +111 -0
- package/SECURITY.md +40 -0
- package/bin/create-workframe.js +2814 -0
- package/bin/workframe.js +329 -0
- package/docs/workspace-instructions/WORKFRAME_DISCORD.md +20 -0
- package/docs/workspace-instructions/WORKFRAME_DOCUMENTS_AND_ARTIFACTS.md +20 -0
- package/docs/workspace-instructions/WORKFRAME_KANBAN.md +20 -0
- package/docs/workspace-instructions/WORKFRAME_ONBOARDING.md +21 -0
- package/docs/workspace-instructions/WORKFRAME_ROUTING.md +29 -0
- package/docs/workspace-instructions/WORKFRAME_TELEGRAM.md +19 -0
- package/package.json +67 -0
- package/profiles/README.md +15 -0
- package/profiles/architect/AGENTS.md +29 -0
- package/profiles/architect/SOUL.md +44 -0
- package/profiles/architect/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/designer/AGENTS.md +26 -0
- package/profiles/designer/SOUL.md +31 -0
- package/profiles/designer/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/dev/AGENTS.md +28 -0
- package/profiles/dev/SOUL.md +31 -0
- package/profiles/dev/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/docs/AGENTS.md +27 -0
- package/profiles/docs/SOUL.md +30 -0
- package/profiles/docs/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/research/AGENTS.md +26 -0
- package/profiles/research/SOUL.md +31 -0
- package/profiles/research/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/visionary/AGENTS.md +25 -0
- package/profiles/visionary/SOUL.md +31 -0
- package/profiles/visionary/skills/devops/kanban-worker/SKILL.md +27 -0
- package/profiles/workframe-agent/AGENTS.md +37 -0
- package/profiles/workframe-agent/SETUP.md +185 -0
- package/profiles/workframe-agent/SOUL.md +61 -0
- package/profiles/workframe-agent/skills/devops/botfather/SKILL.md +85 -0
- package/profiles/workframe-agent/skills/devops/kanban-handoff-pattern/SKILL.md +58 -0
- package/profiles/workframe-agent/skills/devops/workframe-cohort/SKILL.md +54 -0
- package/prompts/WORKFRAME_PROMPT_TEMPLATES.md +16 -0
- package/rules/.hermes.md +11 -0
- package/rules/AGENTS.md +22 -0
- package/rules/workspace-README.md +5 -0
- package/scripts/apply-update-hermes.sh +17 -0
- package/scripts/apply-update-workframe.sh +77 -0
- package/scripts/bootstrap-workspace-link.sh +8 -0
- package/scripts/bundle-workframe-ui.mjs +77 -0
- package/scripts/compose-docker-host.sh +37 -0
- package/scripts/create_workframe_scaffold.py +648 -0
- package/scripts/ensure-compose-host-paths.mjs +51 -0
- package/scripts/fix-zk-encryption-key.sh +35 -0
- package/scripts/lib/install-identity.mjs +212 -0
- package/scripts/lib/workframe-registry.mjs +290 -0
- package/scripts/new-project.mjs +68 -0
- package/scripts/restart-gateway-hermes.sh +12 -0
- package/scripts/security_audit.py +156 -0
- package/scripts/select_agent_pack.py +31 -0
- package/scripts/set-compose-public-url.mjs +92 -0
- package/scripts/setup-stack-secrets.sh +50 -0
- package/scripts/sync-canonical-to-package.mjs +146 -0
- package/scripts/test-scaffold.mjs +390 -0
- package/scripts/verify-public-deploy.sh +105 -0
- package/shared/WORKFRAME_AGENT_LIBRARY.md +31 -0
- package/shared/WORKFRAME_AGENT_OPERATIONS.md +29 -0
- package/shared/WORKFRAME_AGENT_PACKS.json +64 -0
- package/shared/WORKFRAME_AGENT_PACKS.yaml +20 -0
- package/shared/WORKFRAME_CHAT_PERMISSION_MODEL.md +20 -0
- package/shared/WORKFRAME_HANDOFF_SCHEMA.md +25 -0
- package/shared/WORKFRAME_SKILL_CURATION.md +27 -0
- package/shared/agent-avatars/ada.png +0 -0
- package/shared/agent-avatars/aibert.png +0 -0
- package/shared/agent-avatars/amelia.png +0 -0
- package/shared/agent-avatars/andy.png +0 -0
- package/shared/agent-avatars/arc.png +0 -0
- package/shared/agent-avatars/bob.png +0 -0
- package/shared/agent-avatars/buzz.png +0 -0
- package/shared/agent-avatars/carl.png +0 -0
- package/shared/agent-avatars/catalog.json +171 -0
- package/shared/agent-avatars/corbu.png +0 -0
- package/shared/agent-avatars/diana.png +0 -0
- package/shared/agent-avatars/ella.png +0 -0
- package/shared/agent-avatars/elvis.png +0 -0
- package/shared/agent-avatars/f1.png +0 -0
- package/shared/agent-avatars/f2.png +0 -0
- package/shared/agent-avatars/f3.png +0 -0
- package/shared/agent-avatars/f4.png +0 -0
- package/shared/agent-avatars/f5.png +0 -0
- package/shared/agent-avatars/f6.png +0 -0
- package/shared/agent-avatars/frida.png +0 -0
- package/shared/agent-avatars/george.png +0 -0
- package/shared/agent-avatars/grace.png +0 -0
- package/shared/agent-avatars/hedy.png +0 -0
- package/shared/agent-avatars/hermes.png +0 -0
- package/shared/agent-avatars/isaac.png +0 -0
- package/shared/agent-avatars/jes.png +0 -0
- package/shared/agent-avatars/john.png +0 -0
- package/shared/agent-avatars/joni.png +0 -0
- package/shared/agent-avatars/leo.png +0 -0
- package/shared/agent-avatars/louis.png +0 -0
- package/shared/agent-avatars/ludwig.png +0 -0
- package/shared/agent-avatars/m1.png +0 -0
- package/shared/agent-avatars/m2.png +0 -0
- package/shared/agent-avatars/m3.png +0 -0
- package/shared/agent-avatars/m4.png +0 -0
- package/shared/agent-avatars/m5.png +0 -0
- package/shared/agent-avatars/m6.png +0 -0
- package/shared/agent-avatars/marie.png +0 -0
- package/shared/agent-avatars/marilyn.png +0 -0
- package/shared/agent-avatars/neil.png +0 -0
- package/shared/agent-avatars/nikola.png +0 -0
- package/shared/agent-avatars/nina.png +0 -0
- package/shared/agent-avatars/paul.png +0 -0
- package/shared/agent-avatars/ringo.png +0 -0
- package/shared/agent-avatars/rosie.png +0 -0
- package/shared/agent-avatars/ste.png +0 -0
- package/shared/agent-avatars/steve.png +0 -0
- package/shared/agent-avatars/sun.png +0 -0
- package/shared/agent-avatars/tom.png +0 -0
- package/shared/agent-avatars/warren.png +0 -0
- package/shared/agent-avatars/woz.png +0 -0
- package/shared/agent-avatars/zaha.png +0 -0
- package/workframe-api/Dockerfile +14 -0
- package/workframe-api/README.md +28 -0
- package/workframe-api/action_proxy.py +131 -0
- package/workframe-api/auth_rate_limit.py +49 -0
- package/workframe-api/catalog/avatar-catalog.json +171 -0
- package/workframe-api/catalog/logo-catalog.json +86 -0
- package/workframe-api/catalog/user-avatar-catalog.json +171 -0
- package/workframe-api/credential_vault.py +445 -0
- package/workframe-api/data/.gitkeep +0 -0
- package/workframe-api/data/avatar-catalog.json +41 -0
- package/workframe-api/data/logo-catalog.json +14 -0
- package/workframe-api/data/user-avatar-catalog.json +18 -0
- package/workframe-api/email_sender.py +220 -0
- package/workframe-api/google_auth.py +90 -0
- package/workframe-api/install_api.py +359 -0
- package/workframe-api/internal_proxy_auth.py +150 -0
- package/workframe-api/llm_proxy.py +277 -0
- package/workframe-api/oidc_jwt.py +108 -0
- package/workframe-api/package.json +13 -0
- package/workframe-api/platform_auth.py +194 -0
- package/workframe-api/profile_secret_policy.py +86 -0
- package/workframe-api/public/assets/index-DPXu_lGn.css +1 -0
- package/workframe-api/public/assets/index-DYnLrCZZ.js +9 -0
- package/workframe-api/public/assets/index-DglUqFB_.js +9 -0
- package/workframe-api/public/index.html +12 -0
- package/workframe-api/requirements.txt +2 -0
- package/workframe-api/server.py +19646 -0
- package/workframe-api/site_meta.py +271 -0
- package/workframe-api/stack_config.py +427 -0
- package/workframe-api/tests/__init__.py +0 -0
- package/workframe-api/tests/db_setup.py +13 -0
- package/workframe-api/tests/test_admin_updates_gated.py +30 -0
- package/workframe-api/tests/test_agent_dm_bootstrap.py +196 -0
- package/workframe-api/tests/test_agent_profile_sync.py +76 -0
- package/workframe-api/tests/test_auth_email.py +222 -0
- package/workframe-api/tests/test_auth_hole_fix_selfcheck.py +99 -0
- package/workframe-api/tests/test_auth_rate_limit.py +19 -0
- package/workframe-api/tests/test_avatar_resolve.py +77 -0
- package/workframe-api/tests/test_child_soul_template.py +71 -0
- package/workframe-api/tests/test_credential_canary.py +135 -0
- package/workframe-api/tests/test_credential_isolation.py +448 -0
- package/workframe-api/tests/test_credential_resolution.py +206 -0
- package/workframe-api/tests/test_device_oauth.py +108 -0
- package/workframe-api/tests/test_doctor_repair.py +103 -0
- package/workframe-api/tests/test_ensure_profile_api.py +77 -0
- package/workframe-api/tests/test_gateway_compose_security.py +136 -0
- package/workframe-api/tests/test_install_secure_host.py +39 -0
- package/workframe-api/tests/test_internal_proxy_auth.py +125 -0
- package/workframe-api/tests/test_invite_runtime_bootstrap.py +72 -0
- package/workframe-api/tests/test_kanban_delegation.py +185 -0
- package/workframe-api/tests/test_llm_proxy.py +155 -0
- package/workframe-api/tests/test_login_access_policy.py +183 -0
- package/workframe-api/tests/test_mvp_model_bootstrap.py +75 -0
- package/workframe-api/tests/test_onboarding_bootstrap.py +248 -0
- package/workframe-api/tests/test_platform_auth.py +47 -0
- package/workframe-api/tests/test_profile_config_path.py +56 -0
- package/workframe-api/tests/test_profile_config_yaml_repair.py +63 -0
- package/workframe-api/tests/test_profile_create.py +72 -0
- package/workframe-api/tests/test_profile_identity_overlay.py +61 -0
- package/workframe-api/tests/test_profile_install_health.py +45 -0
- package/workframe-api/tests/test_profile_secret_policy.py +57 -0
- package/workframe-api/tests/test_profile_workspace_cwd.py +34 -0
- package/workframe-api/tests/test_provider_bootstrap.py +75 -0
- package/workframe-api/tests/test_provider_connect.py +54 -0
- package/workframe-api/tests/test_room_crud.py +192 -0
- package/workframe-api/tests/test_room_tenancy.py +701 -0
- package/workframe-api/tests/test_runtime_identity_backfill.py +34 -0
- package/workframe-api/tests/test_site_meta.py +81 -0
- package/workframe-api/tests/test_soul_stub.py +42 -0
- package/workframe-api/tests/test_space_member_sync.py +99 -0
- package/workframe-api/tests/test_stripe_stack_config.py +37 -0
- package/workframe-api/tests/test_supervisor_lifecycle.py +52 -0
- package/workframe-api/tests/test_turn_credential_vault.py +125 -0
- package/workframe-api/tests/test_updates.py +176 -0
- package/workframe-api/tests/test_user_cohort.py +113 -0
- package/workframe-api/tests/test_vault_envelope.py +110 -0
- package/workframe-api/tests/test_workspace_members.py +183 -0
- package/workframe-api/tests/test_workspace_messaging_sync.py +125 -0
- package/workframe-api/tests/test_workspace_provider_list.py +57 -0
- package/workframe-api/time-bind-chat.py +99 -0
- package/workframe-api/turn_credentials.py +226 -0
- package/workframe-api/updates.py +417 -0
- package/workframe-api/vault_kek.py +159 -0
- package/workframe-api/zk_auth.py +633 -0
- package/workframe-supervisor/Dockerfile +11 -0
- package/workframe-supervisor/profile_secret_policy.py +76 -0
- package/workframe-supervisor/server.py +787 -0
- package/workframe-supervisor/tests/test_exec_guard.py +42 -0
- package/workframe-supervisor/tests/test_server_import.py +21 -0
- package/workframe-ui/docker/nginx.conf +85 -0
- package/workframe-ui/public/assets/1-DLJbBkOb.png +0 -0
- package/workframe-ui/public/assets/10-uwRwj5ce.png +0 -0
- package/workframe-ui/public/assets/11-5OuV9F_e.png +0 -0
- package/workframe-ui/public/assets/12-u_axjxW-.png +0 -0
- package/workframe-ui/public/assets/13-ldSvcMsH.png +0 -0
- package/workframe-ui/public/assets/14-xdcALEYD.png +0 -0
- package/workframe-ui/public/assets/15-aZ4snEFB.png +0 -0
- package/workframe-ui/public/assets/16-L_5-DttY.png +0 -0
- package/workframe-ui/public/assets/2-zOPZTppD.png +0 -0
- package/workframe-ui/public/assets/3-Dc3WoVu5.png +0 -0
- package/workframe-ui/public/assets/4-C50hk7_m.png +0 -0
- package/workframe-ui/public/assets/5-Eweetkq4.png +0 -0
- package/workframe-ui/public/assets/6-5sOXgfkw.png +0 -0
- package/workframe-ui/public/assets/7-BqRBCbiC.png +0 -0
- package/workframe-ui/public/assets/8-DEDKS94h.png +0 -0
- package/workframe-ui/public/assets/9-DNj34GW-.png +0 -0
- package/workframe-ui/public/assets/ada-DsvuOc9n.png +0 -0
- package/workframe-ui/public/assets/aibert-BCz8Lo8H.png +0 -0
- package/workframe-ui/public/assets/amelia-DUf3EBGu.png +0 -0
- package/workframe-ui/public/assets/andy-Cpymuhhx.png +0 -0
- package/workframe-ui/public/assets/arc-CBDYvkAF.js +1 -0
- package/workframe-ui/public/assets/architecture-7EHR7CIX-CtbQKTuT.js +1 -0
- package/workframe-ui/public/assets/architectureDiagram-3BPJPVTR-XnBRKeW0.js +36 -0
- package/workframe-ui/public/assets/array-BifhSqXX.js +1 -0
- package/workframe-ui/public/assets/avatars/ada.png +0 -0
- package/workframe-ui/public/assets/avatars/aibert.png +0 -0
- package/workframe-ui/public/assets/avatars/amelia.png +0 -0
- package/workframe-ui/public/assets/avatars/andy.png +0 -0
- package/workframe-ui/public/assets/avatars/bob.png +0 -0
- package/workframe-ui/public/assets/avatars/buzz.png +0 -0
- package/workframe-ui/public/assets/avatars/carl.png +0 -0
- package/workframe-ui/public/assets/avatars/catalog.json +171 -0
- package/workframe-ui/public/assets/avatars/corbu.png +0 -0
- package/workframe-ui/public/assets/avatars/diana.png +0 -0
- package/workframe-ui/public/assets/avatars/elvis.png +0 -0
- package/workframe-ui/public/assets/avatars/frida.png +0 -0
- package/workframe-ui/public/assets/avatars/george.png +0 -0
- package/workframe-ui/public/assets/avatars/grace.png +0 -0
- package/workframe-ui/public/assets/avatars/hedy.png +0 -0
- package/workframe-ui/public/assets/avatars/hermes.png +0 -0
- package/workframe-ui/public/assets/avatars/isaac.png +0 -0
- package/workframe-ui/public/assets/avatars/john.png +0 -0
- package/workframe-ui/public/assets/avatars/joni.png +0 -0
- package/workframe-ui/public/assets/avatars/leo.png +0 -0
- package/workframe-ui/public/assets/avatars/louis.png +0 -0
- package/workframe-ui/public/assets/avatars/ludwig.png +0 -0
- package/workframe-ui/public/assets/avatars/marie.png +0 -0
- package/workframe-ui/public/assets/avatars/marilyn.png +0 -0
- package/workframe-ui/public/assets/avatars/nikola.png +0 -0
- package/workframe-ui/public/assets/avatars/nina.png +0 -0
- package/workframe-ui/public/assets/avatars/paul.png +0 -0
- package/workframe-ui/public/assets/avatars/ringo.png +0 -0
- package/workframe-ui/public/assets/avatars/rosie.png +0 -0
- package/workframe-ui/public/assets/avatars/steve.png +0 -0
- package/workframe-ui/public/assets/avatars/sun.png +0 -0
- package/workframe-ui/public/assets/avatars/warren.png +0 -0
- package/workframe-ui/public/assets/avatars/woz.png +0 -0
- package/workframe-ui/public/assets/avatars/zaha.png +0 -0
- package/workframe-ui/public/assets/blockDiagram-GPEHLZMM-VYHUfVhd.js +132 -0
- package/workframe-ui/public/assets/bob-DRz-48Id.png +0 -0
- package/workframe-ui/public/assets/branding/banner.png +0 -0
- package/workframe-ui/public/assets/branding/og-default.png +0 -0
- package/workframe-ui/public/assets/branding/workframe'white.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-1.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-2.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-3.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-4.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-5.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-banner.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-logo-horizontal-mini.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-logo-horizontal-nano.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-logo-horizontal.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-logo-vertical-alt.png +0 -0
- package/workframe-ui/public/assets/branding/workframe-logo-vertical.png +0 -0
- package/workframe-ui/public/assets/branding/workframe.png +0 -0
- package/workframe-ui/public/assets/buzz-mC4PtMvC.png +0 -0
- package/workframe-ui/public/assets/c4Diagram-AAUBKEIU-BTjUcJpm.js +10 -0
- package/workframe-ui/public/assets/carl-CtE74db_.png +0 -0
- package/workframe-ui/public/assets/channel-Dy4Z4-jn.js +1 -0
- package/workframe-ui/public/assets/chunk-2J33WTMH-w7uu7R-b.js +1 -0
- package/workframe-ui/public/assets/chunk-3OPIFGDE-Cb9LtnDX.js +62 -0
- package/workframe-ui/public/assets/chunk-4BX2VUAB-DiQ-qCwH.js +1 -0
- package/workframe-ui/public/assets/chunk-55IACEB6-C-mLFr7z.js +1 -0
- package/workframe-ui/public/assets/chunk-5ZQYHXKU-DOesfiCI.js +2 -0
- package/workframe-ui/public/assets/chunk-727SXJPM-BJ3oBZuz.js +206 -0
- package/workframe-ui/public/assets/chunk-AQP2D5EJ-CCA6xpGs.js +231 -0
- package/workframe-ui/public/assets/chunk-BSJP7CBP-a0cMNFb2.js +1 -0
- package/workframe-ui/public/assets/chunk-CSCIHK7Q-kuqN8EIY.js +122 -0
- package/workframe-ui/public/assets/chunk-FMBD7UC4-DyPgYHCg.js +15 -0
- package/workframe-ui/public/assets/chunk-KSCS5N6A-CdUuvR0V.js +10 -0
- package/workframe-ui/public/assets/chunk-L5ZTLDWV-Dq9NoWmK.js +1 -0
- package/workframe-ui/public/assets/chunk-LZXEDZCA-p74rddlO.js +2 -0
- package/workframe-ui/public/assets/chunk-ND2GUHAM-DBD2u1Gz.js +1 -0
- package/workframe-ui/public/assets/chunk-NNHCCRGN-DlpIbxXb.js +159 -0
- package/workframe-ui/public/assets/chunk-NZK2D7GU-BeIeYFnd.js +1 -0
- package/workframe-ui/public/assets/chunk-O5CBEL6O-ClHc56ib.js +70 -0
- package/workframe-ui/public/assets/chunk-QZHKN3VN-CtBEchFK.js +1 -0
- package/workframe-ui/public/assets/chunk-WU5MYG2G-B9pBtriN.js +1 -0
- package/workframe-ui/public/assets/chunk-XPW4576I-EFr8R_1p.js +32 -0
- package/workframe-ui/public/assets/classDiagram-4FO5ZUOK-BMAEA8jI.js +1 -0
- package/workframe-ui/public/assets/classDiagram-v2-Q7XG4LA2-BMAEA8jI.js +1 -0
- package/workframe-ui/public/assets/corbu-KiaMXzXQ.png +0 -0
- package/workframe-ui/public/assets/cose-bilkent-S5V4N54A-C7aPBODd.js +1 -0
- package/workframe-ui/public/assets/cytoscape.esm-h6BdjjI9.js +321 -0
- package/workframe-ui/public/assets/dagre-BM42HDAG-BdU1Rv-H.js +4 -0
- package/workframe-ui/public/assets/dagre-Bx709z4p.js +1 -0
- package/workframe-ui/public/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/workframe-ui/public/assets/diagram-2AECGRRQ-DWowSo85.js +43 -0
- package/workframe-ui/public/assets/diagram-5GNKFQAL-MnxBbceO.js +10 -0
- package/workframe-ui/public/assets/diagram-KO2AKTUF-DQaLRXFf.js +3 -0
- package/workframe-ui/public/assets/diagram-LMA3HP47-CQaBud9k.js +24 -0
- package/workframe-ui/public/assets/diagram-OG6HWLK6-D8bAXbY9.js +24 -0
- package/workframe-ui/public/assets/diana-DW0MsL38.png +0 -0
- package/workframe-ui/public/assets/dist-DGpTLHr_.js +1 -0
- package/workframe-ui/public/assets/elvis-LCFaZIcT.png +0 -0
- package/workframe-ui/public/assets/erDiagram-TEJ5UH35-1E-xSvBK.js +85 -0
- package/workframe-ui/public/assets/eventmodeling-FCH6USID-D75cstNT.js +1 -0
- package/workframe-ui/public/assets/flowDiagram-I6XJVG4X-CgOVD5hu.js +162 -0
- package/workframe-ui/public/assets/frida-CXFA0w3F.png +0 -0
- package/workframe-ui/public/assets/ganttDiagram-6RSMTGT7-JFYAIauo.js +292 -0
- package/workframe-ui/public/assets/george-DBSH2Sm2.png +0 -0
- package/workframe-ui/public/assets/gitGraph-WXDBUCRP-B9REenIl.js +1 -0
- package/workframe-ui/public/assets/gitGraphDiagram-PVQCEYII-BQ7NcMSn.js +106 -0
- package/workframe-ui/public/assets/grace-BhV0UPc0.png +0 -0
- package/workframe-ui/public/assets/graphlib-B8gBHxth.js +1 -0
- package/workframe-ui/public/assets/hedy-BR2IHift.png +0 -0
- package/workframe-ui/public/assets/hermes-CqCzcE0y.png +0 -0
- package/workframe-ui/public/assets/index-Dnw6vjqb.js +133 -0
- package/workframe-ui/public/assets/index-DpAGxump.css +1 -0
- package/workframe-ui/public/assets/info-J43DQDTF-CL6-eTjH.js +1 -0
- package/workframe-ui/public/assets/infoDiagram-5YYISTIA-LJTODW4W.js +2 -0
- package/workframe-ui/public/assets/init-D6jRqBbL.js +1 -0
- package/workframe-ui/public/assets/isaac-D1nhJAuv.png +0 -0
- package/workframe-ui/public/assets/ishikawaDiagram-YF4QCWOH-bchrQVuo.js +70 -0
- package/workframe-ui/public/assets/john-zSPWwNi4.png +0 -0
- package/workframe-ui/public/assets/joni-BFLoyfJP.png +0 -0
- package/workframe-ui/public/assets/journeyDiagram-JHISSGLW-DkrvYuxP.js +139 -0
- package/workframe-ui/public/assets/kanban-definition-UN3LZRKU-DFRbj0IG.js +89 -0
- package/workframe-ui/public/assets/katex-Vhh-h91d.js +257 -0
- package/workframe-ui/public/assets/leo-C_3IOL11.png +0 -0
- package/workframe-ui/public/assets/line-Vd48P7-O.js +1 -0
- package/workframe-ui/public/assets/linear-Ckizh2G7.js +1 -0
- package/workframe-ui/public/assets/louis-DEEECFSX.png +0 -0
- package/workframe-ui/public/assets/ludwig-_hoKhhyK.png +0 -0
- package/workframe-ui/public/assets/marie-DET6MsfO.png +0 -0
- package/workframe-ui/public/assets/marilyn-DTqwt8Yh.png +0 -0
- package/workframe-ui/public/assets/mermaid-parser.core-Bkimsnqj.js +4 -0
- package/workframe-ui/public/assets/mermaid.core-x0TvVuPo.js +9 -0
- package/workframe-ui/public/assets/mindmap-definition-RKZ34NQL-6ykAFPEz.js +96 -0
- package/workframe-ui/public/assets/nikola-B4PtHrJv.png +0 -0
- package/workframe-ui/public/assets/nina-BYbrOn0d.png +0 -0
- package/workframe-ui/public/assets/ordinal-hYBb2elL.js +1 -0
- package/workframe-ui/public/assets/packet-YPE3B663-Dw3xgMDt.js +1 -0
- package/workframe-ui/public/assets/path-BWPyau1x.js +1 -0
- package/workframe-ui/public/assets/paul-CGURYQIn.png +0 -0
- package/workframe-ui/public/assets/pie-LRSECV5Y-DATysawG.js +1 -0
- package/workframe-ui/public/assets/pieDiagram-4H26LBE5-SJKD1S0S.js +30 -0
- package/workframe-ui/public/assets/project-logos/1.png +0 -0
- package/workframe-ui/public/assets/project-logos/10.png +0 -0
- package/workframe-ui/public/assets/project-logos/11.png +0 -0
- package/workframe-ui/public/assets/project-logos/12.png +0 -0
- package/workframe-ui/public/assets/project-logos/13.png +0 -0
- package/workframe-ui/public/assets/project-logos/14.png +0 -0
- package/workframe-ui/public/assets/project-logos/15.png +0 -0
- package/workframe-ui/public/assets/project-logos/16.png +0 -0
- package/workframe-ui/public/assets/project-logos/2.png +0 -0
- package/workframe-ui/public/assets/project-logos/3.png +0 -0
- package/workframe-ui/public/assets/project-logos/4.png +0 -0
- package/workframe-ui/public/assets/project-logos/5.png +0 -0
- package/workframe-ui/public/assets/project-logos/6.png +0 -0
- package/workframe-ui/public/assets/project-logos/7.png +0 -0
- package/workframe-ui/public/assets/project-logos/8.png +0 -0
- package/workframe-ui/public/assets/project-logos/9.png +0 -0
- package/workframe-ui/public/assets/project-logos/catalog.json +86 -0
- package/workframe-ui/public/assets/quadrantDiagram-W4KKPZXB-BrYDZX8q.js +7 -0
- package/workframe-ui/public/assets/radar-GUYGQ44K-BmWYPCds.js +1 -0
- package/workframe-ui/public/assets/requirementDiagram-4Y6WPE33-DwL9Mc8e.js +84 -0
- package/workframe-ui/public/assets/ringo-WhfUNOyY.png +0 -0
- package/workframe-ui/public/assets/rosie-CAtcIf87.png +0 -0
- package/workframe-ui/public/assets/rough.esm-CSKSodPl.js +1 -0
- package/workframe-ui/public/assets/sankeyDiagram-5OEKKPKP-DYIFsL8h.js +40 -0
- package/workframe-ui/public/assets/sequenceDiagram-3UESZ5HK-0-FPkFk8.js +162 -0
- package/workframe-ui/public/assets/src-B_od6b6h.js +1 -0
- package/workframe-ui/public/assets/stateDiagram-AJRCARHV-BQCiBk6u.js +1 -0
- package/workframe-ui/public/assets/stateDiagram-v2-BHNVJYJU-B89jAMFF.js +1 -0
- package/workframe-ui/public/assets/steve-CgXXJ9EZ.png +0 -0
- package/workframe-ui/public/assets/sun-BLNAhoZd.png +0 -0
- package/workframe-ui/public/assets/timeline-definition-PNZ67QCA-DS3tFcXj.js +120 -0
- package/workframe-ui/public/assets/treeView-BLDUP644-DSyUCKLY.js +1 -0
- package/workframe-ui/public/assets/treemap-LRROVOQU-CEZaNh5Y.js +1 -0
- package/workframe-ui/public/assets/vennDiagram-CIIHVFJN-CD-Vc9NF.js +34 -0
- package/workframe-ui/public/assets/wardley-L42UT6IY-Drq5w1Mc.js +1 -0
- package/workframe-ui/public/assets/wardleyDiagram-YWT4CUSO-DouXDJoF.js +78 -0
- package/workframe-ui/public/assets/warren-DIH7UKMY.png +0 -0
- package/workframe-ui/public/assets/woz-D2yleG-V.png +0 -0
- package/workframe-ui/public/assets/xychartDiagram-2RQKCTM6-DDf_Lol5.js +7 -0
- package/workframe-ui/public/assets/zaha-wersOEq9.png +0 -0
- package/workframe-ui/public/favicon.ico +0 -0
- package/workframe-ui/public/favicon.svg +7 -0
- package/workframe-ui/public/icons.svg +24 -0
- package/workframe-ui/public/index.html +50 -0
- package/workframe-ui/public/manifest.webmanifest +18 -0
- package/workframe-ui/public/workframe-config.json +4 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Workframe Handoff Schema
|
|
2
|
+
|
|
3
|
+
Every completed specialist task should include:
|
|
4
|
+
|
|
5
|
+
Required
|
|
6
|
+
- summary: what was done
|
|
7
|
+
- changed_files: absolute or repo-relative paths
|
|
8
|
+
- next_action: concrete next step
|
|
9
|
+
- owner: next responsible profile/person
|
|
10
|
+
|
|
11
|
+
Recommended
|
|
12
|
+
- decisions: key choices made
|
|
13
|
+
- assumptions: unresolved assumptions
|
|
14
|
+
- blockers: explicit question if blocked
|
|
15
|
+
- evidence: links/refs/tests for verification
|
|
16
|
+
|
|
17
|
+
Heartbeat schema (for long-running tasks)
|
|
18
|
+
- state: phase name
|
|
19
|
+
- progress: short status
|
|
20
|
+
- eta: rough estimate
|
|
21
|
+
- risk: only if material risk changed
|
|
22
|
+
|
|
23
|
+
Storage
|
|
24
|
+
- heartbeat/handoff in Kanban comments
|
|
25
|
+
- durable result in project files
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Workframe Skill and Tool Curation
|
|
2
|
+
|
|
3
|
+
Purpose
|
|
4
|
+
- enforce lean specialization and avoid context bloat.
|
|
5
|
+
|
|
6
|
+
Skill matrix (recommended baseline)
|
|
7
|
+
|
|
8
|
+
| Profile | Mandatory (recommended) | Optional (recommended) | Avoid |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| {nativeProfileSlug} (project agent) | kanban-orchestrator | writing-plans, plan | domain-heavy implementation skills |
|
|
11
|
+
| visionary | writing-plans | arxiv, blogwatcher | low-level debugging stacks |
|
|
12
|
+
| architect | writing-plans | systematic-debugging, github-code-review | generic creative bundles |
|
|
13
|
+
| docs | humanizer | hermes-agent-skill-authoring | infra-heavy ops bundles |
|
|
14
|
+
| dev | test-driven-development, systematic-debugging | python-debugpy, requesting-code-review | broad strategy skills |
|
|
15
|
+
| research | arxiv | llm-wiki, blogwatcher | unrelated creative generators |
|
|
16
|
+
| designer | sketch | popular-web-designs, architecture-diagram | deep backend/debug toolchains |
|
|
17
|
+
|
|
18
|
+
Tool curation rules
|
|
19
|
+
1) Give each profile only tools it uses weekly.
|
|
20
|
+
2) Shared essentials should be small.
|
|
21
|
+
3) Add a skill only after repeated need.
|
|
22
|
+
4) Remove stale skills quarterly.
|
|
23
|
+
|
|
24
|
+
Install-time selection
|
|
25
|
+
- default to the `native` starter pack unless a larger reference pack is explicitly requested
|
|
26
|
+
- reference packs remain available (`core` / `product` / `engineering` / `full`)
|
|
27
|
+
- concierge can request profile add/remove later with owner approval.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"public_base": "/assets/avatars",
|
|
4
|
+
"avatars": [
|
|
5
|
+
{
|
|
6
|
+
"id": "ada",
|
|
7
|
+
"file": "ada.png",
|
|
8
|
+
"label": "Ada"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "aibert",
|
|
12
|
+
"file": "aibert.png",
|
|
13
|
+
"label": "Aibert"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "amelia",
|
|
17
|
+
"file": "amelia.png",
|
|
18
|
+
"label": "Amelia"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "andy",
|
|
22
|
+
"file": "andy.png",
|
|
23
|
+
"label": "Andy"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "bob",
|
|
27
|
+
"file": "bob.png",
|
|
28
|
+
"label": "Bob"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "buzz",
|
|
32
|
+
"file": "buzz.png",
|
|
33
|
+
"label": "Buzz"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "carl",
|
|
37
|
+
"file": "carl.png",
|
|
38
|
+
"label": "Carl"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "corbu",
|
|
42
|
+
"file": "corbu.png",
|
|
43
|
+
"label": "Corbu"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "diana",
|
|
47
|
+
"file": "diana.png",
|
|
48
|
+
"label": "Diana"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "elvis",
|
|
52
|
+
"file": "elvis.png",
|
|
53
|
+
"label": "Elvis"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "frida",
|
|
57
|
+
"file": "frida.png",
|
|
58
|
+
"label": "Frida"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "george",
|
|
62
|
+
"file": "george.png",
|
|
63
|
+
"label": "George"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "grace",
|
|
67
|
+
"file": "grace.png",
|
|
68
|
+
"label": "Grace"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "hedy",
|
|
72
|
+
"file": "hedy.png",
|
|
73
|
+
"label": "Hedy"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "hermes",
|
|
77
|
+
"file": "hermes.png",
|
|
78
|
+
"label": "Hermes"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "isaac",
|
|
82
|
+
"file": "isaac.png",
|
|
83
|
+
"label": "Isaac"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "john",
|
|
87
|
+
"file": "john.png",
|
|
88
|
+
"label": "John"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "joni",
|
|
92
|
+
"file": "joni.png",
|
|
93
|
+
"label": "Joni"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "leo",
|
|
97
|
+
"file": "leo.png",
|
|
98
|
+
"label": "Leo"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "louis",
|
|
102
|
+
"file": "louis.png",
|
|
103
|
+
"label": "Louis"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "ludwig",
|
|
107
|
+
"file": "ludwig.png",
|
|
108
|
+
"label": "Ludwig"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "marie",
|
|
112
|
+
"file": "marie.png",
|
|
113
|
+
"label": "Marie"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "marilyn",
|
|
117
|
+
"file": "marilyn.png",
|
|
118
|
+
"label": "Marilyn"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "nikola",
|
|
122
|
+
"file": "nikola.png",
|
|
123
|
+
"label": "Nikola"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "nina",
|
|
127
|
+
"file": "nina.png",
|
|
128
|
+
"label": "Nina"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "paul",
|
|
132
|
+
"file": "paul.png",
|
|
133
|
+
"label": "Paul"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "ringo",
|
|
137
|
+
"file": "ringo.png",
|
|
138
|
+
"label": "Ringo"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "rosie",
|
|
142
|
+
"file": "rosie.png",
|
|
143
|
+
"label": "Rosie"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "steve",
|
|
147
|
+
"file": "steve.png",
|
|
148
|
+
"label": "Steve"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "sun",
|
|
152
|
+
"file": "sun.png",
|
|
153
|
+
"label": "Sun"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "warren",
|
|
157
|
+
"file": "warren.png",
|
|
158
|
+
"label": "Warren"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "woz",
|
|
162
|
+
"file": "woz.png",
|
|
163
|
+
"label": "Woz"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "zaha",
|
|
167
|
+
"file": "zaha.png",
|
|
168
|
+
"label": "Zaha"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
FROM python:3-alpine
|
|
2
|
+
|
|
3
|
+
RUN apk add --no-cache docker-cli docker-cli-compose bash nodejs npm
|
|
4
|
+
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
COPY requirements.txt .
|
|
8
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
9
|
+
|
|
10
|
+
COPY . .
|
|
11
|
+
|
|
12
|
+
EXPOSE 8080
|
|
13
|
+
|
|
14
|
+
CMD ["python3", "server.py"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Workframe API Service
|
|
2
|
+
|
|
3
|
+
**Version:** `0.1.0` (`workframe-api-0.1.0`). See `docs/VERSION.md`.
|
|
4
|
+
|
|
5
|
+
Active backend service for the transplanted Workframe vertical slice.
|
|
6
|
+
|
|
7
|
+
This is intentionally preserved as the current Python BFF instead of being rewritten into `apps/api`.
|
|
8
|
+
|
|
9
|
+
## Local
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd services/workframe-api
|
|
13
|
+
python3 -m venv .venv
|
|
14
|
+
. .venv/bin/activate
|
|
15
|
+
pip install -r requirements.txt
|
|
16
|
+
HOST=0.0.0.0 PORT=8080 HERMES_DATA=/opt/data WORKSPACE=/workspace python3 server.py
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Runtime state
|
|
20
|
+
|
|
21
|
+
Runtime files are intentionally not committed:
|
|
22
|
+
|
|
23
|
+
- `data/*.db`
|
|
24
|
+
- `data/.auth_keys`
|
|
25
|
+
- Hermes `Agents/`
|
|
26
|
+
- workspace `Files/`
|
|
27
|
+
|
|
28
|
+
For VPS deployment, mount clean persistent volumes into `/opt/data` and `/workspace`.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Internal action proxy — dev/tool PATs stay in vault; Hermes sends lease tokens."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import re
|
|
7
|
+
import urllib.error
|
|
8
|
+
import urllib.request
|
|
9
|
+
from http.server import BaseHTTPRequestHandler
|
|
10
|
+
from typing import Any, Callable
|
|
11
|
+
|
|
12
|
+
import llm_proxy
|
|
13
|
+
import turn_credentials
|
|
14
|
+
|
|
15
|
+
UPSTREAM_BASE: dict[str, str] = {
|
|
16
|
+
"github": "https://api.github.com",
|
|
17
|
+
"vercel": "https://api.vercel.com",
|
|
18
|
+
"netlify": "https://api.netlify.com/api/v1",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
PROXY_PATH_RE = re.compile(r"^/internal/action/([a-z0-9_-]+)(/.*)?$", re.IGNORECASE)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def upstream_auth_header(provider: str, secret: str) -> dict[str, str]:
|
|
25
|
+
provider = str(provider or "").strip().lower()
|
|
26
|
+
secret = str(secret or "").strip()
|
|
27
|
+
if provider == "github":
|
|
28
|
+
return {"Authorization": f"Bearer {secret}", "Accept": "application/vnd.github+json"}
|
|
29
|
+
if provider == "netlify":
|
|
30
|
+
return {"Authorization": f"Bearer {secret}"}
|
|
31
|
+
return {"Authorization": f"Bearer {secret}"}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def forward_request(
|
|
35
|
+
provider: str,
|
|
36
|
+
subpath: str,
|
|
37
|
+
method: str,
|
|
38
|
+
headers: dict[str, str],
|
|
39
|
+
body: bytes | None,
|
|
40
|
+
*,
|
|
41
|
+
resolve_secret: Callable[[str, str, str, str], tuple[str, str]],
|
|
42
|
+
) -> tuple[int, dict[str, str], bytes]:
|
|
43
|
+
provider = str(provider or "").strip().lower()
|
|
44
|
+
base = UPSTREAM_BASE.get(provider)
|
|
45
|
+
if not base:
|
|
46
|
+
return 404, {"Content-Type": "application/json"}, json.dumps({"error": "unknown provider"}).encode()
|
|
47
|
+
|
|
48
|
+
token = llm_proxy.extract_bearer(headers)
|
|
49
|
+
lease = turn_credentials.validate_lease(token)
|
|
50
|
+
if not lease:
|
|
51
|
+
return 401, {"Content-Type": "application/json"}, json.dumps({"error": "invalid lease"}).encode()
|
|
52
|
+
if str(lease.get("provider") or "").lower() != provider:
|
|
53
|
+
return 403, {"Content-Type": "application/json"}, json.dumps({"error": "provider mismatch"}).encode()
|
|
54
|
+
|
|
55
|
+
ok_profile, profile_err, profile_status = llm_proxy.validate_lease_profile(lease, headers)
|
|
56
|
+
if not ok_profile:
|
|
57
|
+
return (
|
|
58
|
+
profile_status,
|
|
59
|
+
{"Content-Type": "application/json"},
|
|
60
|
+
json.dumps({"error": profile_err}).encode(),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
_env_var, secret = turn_credentials.resolve_lease_secret(lease, resolve_secret)
|
|
64
|
+
if not secret:
|
|
65
|
+
return 402, {"Content-Type": "application/json"}, json.dumps({"error": "no credential"}).encode()
|
|
66
|
+
|
|
67
|
+
path = subpath if subpath.startswith("/") else f"/{subpath}"
|
|
68
|
+
url = f"{base.rstrip('/')}{path}"
|
|
69
|
+
upstream_headers = {
|
|
70
|
+
k: v
|
|
71
|
+
for k, v in headers.items()
|
|
72
|
+
if k.lower()
|
|
73
|
+
not in {
|
|
74
|
+
"host",
|
|
75
|
+
"connection",
|
|
76
|
+
"content-length",
|
|
77
|
+
"authorization",
|
|
78
|
+
"x-api-key",
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
upstream_headers.update(upstream_auth_header(provider, secret))
|
|
82
|
+
|
|
83
|
+
req = urllib.request.Request(url, data=body, headers=upstream_headers, method=method.upper())
|
|
84
|
+
try:
|
|
85
|
+
with urllib.request.urlopen(req, timeout=600) as resp:
|
|
86
|
+
resp_body = resp.read()
|
|
87
|
+
out_headers = {"Content-Type": resp.headers.get("Content-Type", "application/octet-stream")}
|
|
88
|
+
return resp.status, out_headers, resp_body
|
|
89
|
+
except urllib.error.HTTPError as exc:
|
|
90
|
+
raw = exc.read()
|
|
91
|
+
out_headers = {"Content-Type": exc.headers.get("Content-Type", "application/json")}
|
|
92
|
+
return exc.code, out_headers, raw
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def handle_proxy_request(
|
|
96
|
+
handler: BaseHTTPRequestHandler,
|
|
97
|
+
path: str,
|
|
98
|
+
method: str,
|
|
99
|
+
body: bytes | None,
|
|
100
|
+
*,
|
|
101
|
+
resolve_secret: Callable[[str, str, str, str], tuple[str, str]],
|
|
102
|
+
) -> bool:
|
|
103
|
+
ok, err = llm_proxy.authorize_internal_proxy(handler)
|
|
104
|
+
if not ok:
|
|
105
|
+
handler.send_response(403)
|
|
106
|
+
handler.send_header("Content-Type", "application/json")
|
|
107
|
+
handler.end_headers()
|
|
108
|
+
handler.wfile.write(json.dumps({"error": err or "internal only"}).encode())
|
|
109
|
+
return True
|
|
110
|
+
|
|
111
|
+
match = PROXY_PATH_RE.match(path)
|
|
112
|
+
if not match:
|
|
113
|
+
return False
|
|
114
|
+
|
|
115
|
+
provider = match.group(1).lower()
|
|
116
|
+
subpath = match.group(2) or "/"
|
|
117
|
+
headers = {k: v for k, v in handler.headers.items()}
|
|
118
|
+
status, out_headers, resp_body = forward_request(
|
|
119
|
+
provider,
|
|
120
|
+
subpath,
|
|
121
|
+
method,
|
|
122
|
+
headers,
|
|
123
|
+
body,
|
|
124
|
+
resolve_secret=resolve_secret,
|
|
125
|
+
)
|
|
126
|
+
handler.send_response(status)
|
|
127
|
+
for key, value in out_headers.items():
|
|
128
|
+
handler.send_header(key, value)
|
|
129
|
+
handler.end_headers()
|
|
130
|
+
handler.wfile.write(resp_body)
|
|
131
|
+
return True
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""In-process auth endpoint throttle — trust boundary (0022 N5)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import time
|
|
5
|
+
from collections import deque
|
|
6
|
+
|
|
7
|
+
_BUCKETS: dict[str, deque[float]] = {}
|
|
8
|
+
_MINUTE_WINDOW = 60.0
|
|
9
|
+
_MINUTE_MAX = 5
|
|
10
|
+
_HOUR_WINDOW = 3600.0
|
|
11
|
+
_HOUR_MAX = 20
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _bucket_key(kind: str, client_ip: str, email: str) -> str:
|
|
15
|
+
return f"{kind}:{client_ip}:{email.strip().lower()}"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _prune(queue: deque[float], now: float, window: float) -> None:
|
|
19
|
+
while queue and now - queue[0] > window:
|
|
20
|
+
queue.popleft()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def allow_auth_request(kind: str, client_ip: str, email: str) -> bool:
|
|
24
|
+
now = time.time()
|
|
25
|
+
key = _bucket_key(kind, client_ip, email)
|
|
26
|
+
queue = _BUCKETS.setdefault(key, deque())
|
|
27
|
+
_prune(queue, now, _HOUR_WINDOW)
|
|
28
|
+
if len(queue) >= _HOUR_MAX:
|
|
29
|
+
return False
|
|
30
|
+
recent = deque(queue)
|
|
31
|
+
_prune(recent, now, _MINUTE_WINDOW)
|
|
32
|
+
if len(recent) >= _MINUTE_MAX:
|
|
33
|
+
return False
|
|
34
|
+
queue.append(now)
|
|
35
|
+
return True
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def reset_for_tests() -> None:
|
|
39
|
+
_BUCKETS.clear()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
reset_for_tests()
|
|
44
|
+
ip = "203.0.113.1"
|
|
45
|
+
email = "a@example.com"
|
|
46
|
+
for _ in range(_MINUTE_MAX):
|
|
47
|
+
assert allow_auth_request("start", ip, email)
|
|
48
|
+
assert not allow_auth_request("start", ip, email)
|
|
49
|
+
print("auth_rate_limit ok")
|