create-workframe 0.1.11 → 0.1.13

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.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/bin/create-workframe.js +2 -2
  3. package/bin/workframe.js +130 -2
  4. package/docs/security.md +85 -0
  5. package/package.json +1 -1
  6. package/scripts/bundle-workframe-ui.mjs +9 -0
  7. package/scripts/sync-canonical-to-package.mjs +9 -0
  8. package/scripts/verify-public-deploy.sh +121 -3
  9. package/workframe-api/action_proxy.py +23 -17
  10. package/workframe-api/activity_feed.py +798 -0
  11. package/workframe-api/api_meta.py +157 -0
  12. package/workframe-api/auth_gate.py +566 -0
  13. package/workframe-api/avatar_registry.py +343 -0
  14. package/workframe-api/broker_audit.py +164 -0
  15. package/workframe-api/cell_authority.py +231 -0
  16. package/workframe-api/chat_bind.py +319 -0
  17. package/workframe-api/chat_sessions.py +509 -0
  18. package/workframe-api/chat_stream.py +694 -0
  19. package/workframe-api/cleanup_dogfood_smoke.py +252 -0
  20. package/workframe-api/credential_broker.py +162 -0
  21. package/workframe-api/credential_resolve.py +202 -0
  22. package/workframe-api/credential_store.py +245 -0
  23. package/workframe-api/crew_registry.py +250 -0
  24. package/workframe-api/db_schema.py +755 -0
  25. package/workframe-api/docker_gateway.py +166 -0
  26. package/workframe-api/doctor_runtime.py +109 -0
  27. package/workframe-api/domain/__init__.py +47 -0
  28. package/workframe-api/domain/entities.py +252 -0
  29. package/workframe-api/domain/schema/workframe-domain.schema.json +278 -0
  30. package/workframe-api/egress_policy.py +42 -0
  31. package/workframe-api/handler_modules/__init__.py +17 -0
  32. package/workframe-api/handler_modules/handler_admin.py +542 -0
  33. package/workframe-api/handler_modules/handler_auth.py +512 -0
  34. package/workframe-api/handler_modules/handler_chat.py +641 -0
  35. package/workframe-api/handler_modules/handler_install.py +178 -0
  36. package/workframe-api/handler_modules/handler_provider.py +325 -0
  37. package/workframe-api/handler_modules/handler_workspace.py +1420 -0
  38. package/workframe-api/health_monitor.py +80 -0
  39. package/workframe-api/hermes_admin.py +756 -0
  40. package/workframe-api/hermes_profiles.py +1328 -0
  41. package/workframe-api/install_api.py +123 -0
  42. package/workframe-api/kanban_cron.py +473 -0
  43. package/workframe-api/lane_bindings.py +423 -0
  44. package/workframe-api/llm_proxy.py +17 -43
  45. package/workframe-api/mention_helpers.py +180 -0
  46. package/workframe-api/mention_invoke.py +431 -0
  47. package/workframe-api/model_surface.py +1139 -0
  48. package/workframe-api/oauth_pending.py +85 -0
  49. package/workframe-api/oauth_redirect.py +381 -0
  50. package/workframe-api/openrouter_catalog.py +4 -4
  51. package/workframe-api/package.json +2 -2
  52. package/workframe-api/profile_api_lifecycle.py +66 -0
  53. package/workframe-api/profile_config_yaml.py +126 -0
  54. package/workframe-api/profile_gateway.py +436 -0
  55. package/workframe-api/provider_bindings.py +673 -0
  56. package/workframe-api/provider_bootstrap.py +347 -0
  57. package/workframe-api/provider_catalog.py +180 -0
  58. package/workframe-api/rooms.py +1613 -0
  59. package/workframe-api/route_registry.py +470 -0
  60. package/workframe-api/run-typecheck.mjs +26 -0
  61. package/workframe-api/run_authority.py +287 -0
  62. package/workframe-api/run_ledger.py +470 -0
  63. package/workframe-api/run_surface_wiring.py +344 -0
  64. package/workframe-api/runtime_cohort.py +752 -0
  65. package/workframe-api/runtime_tokens.py +127 -0
  66. package/workframe-api/server.py +1376 -19305
  67. package/workframe-api/snapshot_feed.py +49 -0
  68. package/workframe-api/stack_config.py +33 -1
  69. package/workframe-api/supervisor_client.py +154 -0
  70. package/workframe-api/test_api_meta_build_stamp.py +34 -0
  71. package/workframe-api/test_cell_authority.py +79 -0
  72. package/workframe-api/test_chat_bind.py +48 -0
  73. package/workframe-api/test_credential_lease_matrix.py +171 -0
  74. package/workframe-api/test_credential_resolve.py +51 -0
  75. package/workframe-api/test_credential_store.py +27 -0
  76. package/workframe-api/test_dogfood_flows.py +346 -0
  77. package/workframe-api/test_domain_entities.py +152 -0
  78. package/workframe-api/test_exception_hygiene.py +12 -0
  79. package/workframe-api/test_hermes_admin.py +72 -0
  80. package/workframe-api/test_install_wizard_resume.py +78 -0
  81. package/workframe-api/test_local_bootstrap.py +67 -0
  82. package/workframe-api/test_mention_helpers.py +35 -0
  83. package/workframe-api/test_mention_invoke.py +26 -0
  84. package/workframe-api/test_model_surface_consistency.py +117 -0
  85. package/workframe-api/test_oauth_pending.py +41 -0
  86. package/workframe-api/test_profile_model_yaml.py +99 -0
  87. package/workframe-api/test_provider_bindings.py +52 -0
  88. package/workframe-api/test_provider_catalog.py +28 -0
  89. package/workframe-api/test_public_routes.py +41 -0
  90. package/workframe-api/test_route_registry.py +245 -0
  91. package/workframe-api/test_run_authority.py +112 -0
  92. package/workframe-api/test_run_ledger.py +157 -0
  93. package/workframe-api/test_run_surface_wiring.py +130 -0
  94. package/workframe-api/test_runtime_cohort.py +85 -0
  95. package/workframe-api/test_secure_mode_docker_boundary.py +39 -0
  96. package/workframe-api/test_server_reexports.py +99 -0
  97. package/workframe-api/test_stack_config_install_smtp.py +7 -0
  98. package/workframe-api/time-bind-steps.py +75 -0
  99. package/workframe-api/time-perf.py +81 -0
  100. package/workframe-api/time-warm.py +107 -0
  101. package/workframe-api/turn_credentials.py +28 -13
  102. package/workframe-api/turn_overlay.py +715 -0
  103. package/workframe-api/updates.py +16 -1
  104. package/workframe-api/user_prefs.py +387 -0
  105. package/workframe-api/wf032_extract_remaining_handlers.py +417 -0
  106. package/workframe-api/workspace_bootstrap.py +536 -0
  107. package/workframe-api/workspace_files.py +344 -0
  108. package/workframe-api/workspace_messaging.py +206 -0
  109. package/workframe-api/zk_auth.py +3 -2
  110. package/workframe-supervisor/server.py +10 -1
  111. package/workframe-supervisor/test_supervisor_negative.py +75 -0
  112. package/workframe-ui/public/assets/{arc-DjpS9a2b.js → arc-aUUffclm.js} +1 -1
  113. package/workframe-ui/public/assets/architecture-7EHR7CIX-BSUP4S8J.js +1 -0
  114. package/workframe-ui/public/assets/{architectureDiagram-3BPJPVTR-puCKmKHV.js → architectureDiagram-3BPJPVTR-DU6oaqIb.js} +1 -1
  115. package/workframe-ui/public/assets/{blockDiagram-GPEHLZMM-C2P0g-eH.js → blockDiagram-GPEHLZMM-D2p8BU6-.js} +1 -1
  116. package/workframe-ui/public/assets/{c4Diagram-AAUBKEIU-DdvYEITH.js → c4Diagram-AAUBKEIU-ouwyPmTJ.js} +1 -1
  117. package/workframe-ui/public/assets/channel-DOunZZ0X.js +1 -0
  118. package/workframe-ui/public/assets/{chunk-2J33WTMH-Cxe8QsEF.js → chunk-2J33WTMH-DsE7U5dj.js} +1 -1
  119. package/workframe-ui/public/assets/{chunk-3OPIFGDE-DPNyTwR3.js → chunk-3OPIFGDE-DM0kkZ9h.js} +1 -1
  120. package/workframe-ui/public/assets/{chunk-4BX2VUAB-XKG9gfRN.js → chunk-4BX2VUAB-CQ8mAyXp.js} +1 -1
  121. package/workframe-ui/public/assets/{chunk-55IACEB6-oPMTulgb.js → chunk-55IACEB6-DN1BDtbH.js} +1 -1
  122. package/workframe-ui/public/assets/{chunk-5ZQYHXKU-BWwXvpa_.js → chunk-5ZQYHXKU-BzK2KqOt.js} +1 -1
  123. package/workframe-ui/public/assets/{chunk-727SXJPM-Cml2twO_.js → chunk-727SXJPM-C3AxtOi9.js} +1 -1
  124. package/workframe-ui/public/assets/{chunk-AQP2D5EJ-DzrRBhQu.js → chunk-AQP2D5EJ-4mVwEFuD.js} +1 -1
  125. package/workframe-ui/public/assets/{chunk-BSJP7CBP-EZ7STU6h.js → chunk-BSJP7CBP-23kN2q0A.js} +1 -1
  126. package/workframe-ui/public/assets/{chunk-CSCIHK7Q-BGTQzWYw.js → chunk-CSCIHK7Q-CPBKVW-L.js} +2 -2
  127. package/workframe-ui/public/assets/{chunk-FMBD7UC4-Cm4stfRa.js → chunk-FMBD7UC4-CKqcYq7K.js} +1 -1
  128. package/workframe-ui/public/assets/{chunk-KSCS5N6A-exbMijjy.js → chunk-KSCS5N6A-JRQnhxQE.js} +1 -1
  129. package/workframe-ui/public/assets/{chunk-L5ZTLDWV-C75kbQwN.js → chunk-L5ZTLDWV-BLZrdIwa.js} +1 -1
  130. package/workframe-ui/public/assets/chunk-LZXEDZCA-DisG0XJT.js +2 -0
  131. package/workframe-ui/public/assets/{chunk-ND2GUHAM-D84zyIu2.js → chunk-ND2GUHAM-ClAOxArS.js} +1 -1
  132. package/workframe-ui/public/assets/{chunk-NZK2D7GU-CUNNo1bj.js → chunk-NZK2D7GU-XUE1aNkm.js} +1 -1
  133. package/workframe-ui/public/assets/{chunk-O5CBEL6O-DN6WEIh-.js → chunk-O5CBEL6O-DDN-Ifon.js} +1 -1
  134. package/workframe-ui/public/assets/chunk-QZHKN3VN-EVQ0VMd5.js +1 -0
  135. package/workframe-ui/public/assets/chunk-WU5MYG2G-k_-ZsLOS.js +1 -0
  136. package/workframe-ui/public/assets/{chunk-XPW4576I-Ct5VQv2D.js → chunk-XPW4576I-B4_iYZ6r.js} +1 -1
  137. package/workframe-ui/public/assets/classDiagram-4FO5ZUOK-W9WVQsby.js +1 -0
  138. package/workframe-ui/public/assets/classDiagram-v2-Q7XG4LA2-W9WVQsby.js +1 -0
  139. package/workframe-ui/public/assets/{cose-bilkent-S5V4N54A-Bj4W5oMk.js → cose-bilkent-S5V4N54A-Cy1HhS7j.js} +1 -1
  140. package/workframe-ui/public/assets/{dagre-BM42HDAG-DAjHBkAy.js → dagre-BM42HDAG-Bjal81Ie.js} +1 -1
  141. package/workframe-ui/public/assets/{diagram-2AECGRRQ-Ch2gGFPG.js → diagram-2AECGRRQ-v5Gdvzp_.js} +1 -1
  142. package/workframe-ui/public/assets/{diagram-5GNKFQAL-BzIIvgYH.js → diagram-5GNKFQAL-DuyRdfmY.js} +1 -1
  143. package/workframe-ui/public/assets/{diagram-KO2AKTUF-Df0Q8nv6.js → diagram-KO2AKTUF-WwWCGbIW.js} +1 -1
  144. package/workframe-ui/public/assets/{diagram-LMA3HP47-D-G3ekmF.js → diagram-LMA3HP47-DTYwZALT.js} +1 -1
  145. package/workframe-ui/public/assets/{diagram-OG6HWLK6-TBHhT9f5.js → diagram-OG6HWLK6-B46kBIqE.js} +1 -1
  146. package/workframe-ui/public/assets/{dist-CPbiDkEZ.js → dist-mQWmB3z6.js} +1 -1
  147. package/workframe-ui/public/assets/{erDiagram-TEJ5UH35-YxkUmLLV.js → erDiagram-TEJ5UH35-__40xO-y.js} +1 -1
  148. package/workframe-ui/public/assets/eventmodeling-FCH6USID-Cm1uRTxU.js +1 -0
  149. package/workframe-ui/public/assets/{flowDiagram-I6XJVG4X-kfZ7-RSd.js → flowDiagram-I6XJVG4X-Cwj6dVUz.js} +1 -1
  150. package/workframe-ui/public/assets/{ganttDiagram-6RSMTGT7-DmTx3hzR.js → ganttDiagram-6RSMTGT7-D_IOSwAS.js} +1 -1
  151. package/workframe-ui/public/assets/{gitGraph-WXDBUCRP-BXa0ewp3.js → gitGraph-WXDBUCRP-C1vGecee.js} +1 -1
  152. package/workframe-ui/public/assets/{gitGraphDiagram-PVQCEYII-CQr2qMxU.js → gitGraphDiagram-PVQCEYII-DMTxFJxn.js} +1 -1
  153. package/workframe-ui/public/assets/index-BdiM4-lI.js +130 -0
  154. package/workframe-ui/public/assets/index-Fnad47vV.css +1 -0
  155. package/workframe-ui/public/assets/{info-J43DQDTF-t-Qlx8zv.js → info-J43DQDTF-CwjmyPmD.js} +1 -1
  156. package/workframe-ui/public/assets/{infoDiagram-5YYISTIA-CzkYofPx.js → infoDiagram-5YYISTIA-BGzh7ZL2.js} +1 -1
  157. package/workframe-ui/public/assets/{ishikawaDiagram-YF4QCWOH-djK3Oxgb.js → ishikawaDiagram-YF4QCWOH-BLXdnR_5.js} +1 -1
  158. package/workframe-ui/public/assets/{journeyDiagram-JHISSGLW-CWxYXxdF.js → journeyDiagram-JHISSGLW-BK3behMe.js} +1 -1
  159. package/workframe-ui/public/assets/{kanban-definition-UN3LZRKU-D7leCAD9.js → kanban-definition-UN3LZRKU-Bx172cCl.js} +1 -1
  160. package/workframe-ui/public/assets/{line-BSFj2OC5.js → line-BTCEHb7l.js} +1 -1
  161. package/workframe-ui/public/assets/{linear-pfPwnu-o.js → linear-CkbydpnK.js} +1 -1
  162. package/workframe-ui/public/assets/{mermaid-parser.core-Dm2L9Ib_.js → mermaid-parser.core-DvrtArpk.js} +2 -2
  163. package/workframe-ui/public/assets/{mermaid.core-Bevx9bif.js → mermaid.core-yj_1x_qj.js} +3 -3
  164. package/workframe-ui/public/assets/{mindmap-definition-RKZ34NQL-UkjDssmP.js → mindmap-definition-RKZ34NQL-BXbMltQ0.js} +1 -1
  165. package/workframe-ui/public/assets/{packet-YPE3B663-JO2ezH3_.js → packet-YPE3B663-9pVCBQ7S.js} +1 -1
  166. package/workframe-ui/public/assets/{pie-LRSECV5Y-DdMFsfR8.js → pie-LRSECV5Y-CdqoWesP.js} +1 -1
  167. package/workframe-ui/public/assets/{pieDiagram-4H26LBE5-CEPHFBU1.js → pieDiagram-4H26LBE5-kGs-VfXd.js} +1 -1
  168. package/workframe-ui/public/assets/{quadrantDiagram-W4KKPZXB-_RF9_86k.js → quadrantDiagram-W4KKPZXB-D9D8gQw5.js} +1 -1
  169. package/workframe-ui/public/assets/{radar-GUYGQ44K-Cb-YfdaA.js → radar-GUYGQ44K-d4zMZpQS.js} +1 -1
  170. package/workframe-ui/public/assets/{requirementDiagram-4Y6WPE33-DBVOxmBn.js → requirementDiagram-4Y6WPE33-BI7EQ9zc.js} +1 -1
  171. package/workframe-ui/public/assets/{sankeyDiagram-5OEKKPKP-BTpxsGUA.js → sankeyDiagram-5OEKKPKP-Bcz19jQB.js} +1 -1
  172. package/workframe-ui/public/assets/{sequenceDiagram-3UESZ5HK-DHP_Bq3l.js → sequenceDiagram-3UESZ5HK-iQiCEfYp.js} +1 -1
  173. package/workframe-ui/public/assets/{src-CY_By-r7.js → src-D6mvlP96.js} +1 -1
  174. package/workframe-ui/public/assets/{stateDiagram-AJRCARHV-BVtp_LPR.js → stateDiagram-AJRCARHV-CxaTXs02.js} +1 -1
  175. package/workframe-ui/public/assets/stateDiagram-v2-BHNVJYJU-CXikj9xi.js +1 -0
  176. package/workframe-ui/public/assets/{timeline-definition-PNZ67QCA-D38HJhop.js → timeline-definition-PNZ67QCA-Bej-EAnf.js} +1 -1
  177. package/workframe-ui/public/assets/{treeView-BLDUP644-CFCG3Sc_.js → treeView-BLDUP644-C7PnnzwX.js} +1 -1
  178. package/workframe-ui/public/assets/{treemap-LRROVOQU-BeiMs_dF.js → treemap-LRROVOQU-CqISLmkO.js} +1 -1
  179. package/workframe-ui/public/assets/{vennDiagram-CIIHVFJN-CKMeT6PW.js → vennDiagram-CIIHVFJN-eJMTTEW-.js} +1 -1
  180. package/workframe-ui/public/assets/{wardley-L42UT6IY-BljDy8ph.js → wardley-L42UT6IY-D4sMroBF.js} +1 -1
  181. package/workframe-ui/public/assets/{wardleyDiagram-YWT4CUSO-DEE8D94J.js → wardleyDiagram-YWT4CUSO-DC3DCUs7.js} +1 -1
  182. package/workframe-ui/public/assets/{xychartDiagram-2RQKCTM6-BRaAWV_g.js → xychartDiagram-2RQKCTM6-BeMaM6Aq.js} +1 -1
  183. package/workframe-ui/public/index.html +7 -6
  184. package/workframe-ui/public/workframe-build.json +5 -0
  185. package/workframe-ui/public/assets/architecture-7EHR7CIX-CvhbXEvt.js +0 -1
  186. package/workframe-ui/public/assets/channel-D63s_yN9.js +0 -1
  187. package/workframe-ui/public/assets/chunk-LZXEDZCA-CsRdBqUB.js +0 -2
  188. package/workframe-ui/public/assets/chunk-QZHKN3VN-Dj_Yxhgo.js +0 -1
  189. package/workframe-ui/public/assets/chunk-WU5MYG2G-AFchshb6.js +0 -1
  190. package/workframe-ui/public/assets/classDiagram-4FO5ZUOK-Opj8t01I.js +0 -1
  191. package/workframe-ui/public/assets/classDiagram-v2-Q7XG4LA2-Opj8t01I.js +0 -1
  192. package/workframe-ui/public/assets/eventmodeling-FCH6USID-LQOYL50n.js +0 -1
  193. package/workframe-ui/public/assets/index-B08aShJy.css +0 -1
  194. package/workframe-ui/public/assets/index-DCF3W3G_.js +0 -129
  195. package/workframe-ui/public/assets/stateDiagram-v2-BHNVJYJU-CvJhS_BJ.js +0 -1
@@ -0,0 +1,278 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workfra.me/schemas/workframe-domain.schema.json",
4
+ "title": "WorkframeDomain",
5
+ "description": "Core domain entities for authority, runs, and credentials (WF-039).",
6
+ "type": "object",
7
+ "$defs": {
8
+ "iso_datetime": { "type": "string", "format": "date-time" },
9
+ "deployment_mode": {
10
+ "type": "string",
11
+ "enum": ["single_user_local", "trusted_team", "public_multi_user"]
12
+ },
13
+ "actor_type": {
14
+ "type": "string",
15
+ "enum": ["user", "agent", "system", "webhook"]
16
+ },
17
+ "run_status": {
18
+ "type": "string",
19
+ "enum": [
20
+ "pending",
21
+ "authorized",
22
+ "running",
23
+ "completed",
24
+ "failed",
25
+ "cancelled",
26
+ "denied"
27
+ ]
28
+ },
29
+ "run_surface": {
30
+ "type": "string",
31
+ "enum": [
32
+ "agent_rail",
33
+ "chat",
34
+ "files",
35
+ "browser",
36
+ "activity",
37
+ "kanban",
38
+ "cron",
39
+ "slash",
40
+ "webhook",
41
+ "mention"
42
+ ]
43
+ },
44
+ "runtime_kind": {
45
+ "type": "string",
46
+ "enum": ["hermes_managed", "candidate", "adapter"]
47
+ },
48
+ "runtime_binding_status": {
49
+ "type": "string",
50
+ "enum": ["active", "detached", "candidate"]
51
+ },
52
+ "funding_source": {
53
+ "type": "string",
54
+ "enum": ["byok", "company", "hybrid"]
55
+ },
56
+ "credential_policy": {
57
+ "type": "string",
58
+ "enum": ["byok", "company", "user_only"]
59
+ },
60
+ "lease_status": {
61
+ "type": "string",
62
+ "enum": ["active", "expired", "revoked"]
63
+ },
64
+ "grant_capability": {
65
+ "type": "string",
66
+ "enum": [
67
+ "llm_turn",
68
+ "tool_call",
69
+ "file_read",
70
+ "file_write",
71
+ "file_delete",
72
+ "runtime_exec",
73
+ "broker_egress"
74
+ ]
75
+ },
76
+ "Cell": {
77
+ "type": "object",
78
+ "required": [
79
+ "cell_id",
80
+ "install_root",
81
+ "manifest_path",
82
+ "package_name",
83
+ "package_version",
84
+ "deployment_mode",
85
+ "created_at"
86
+ ],
87
+ "properties": {
88
+ "cell_id": { "type": "string", "minLength": 1 },
89
+ "install_root": { "type": "string", "minLength": 1 },
90
+ "manifest_path": { "type": "string", "minLength": 1 },
91
+ "package_name": { "type": "string", "const": "create-workframe" },
92
+ "package_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+" },
93
+ "deployment_mode": { "$ref": "#/$defs/deployment_mode" },
94
+ "created_at": { "$ref": "#/$defs/iso_datetime" },
95
+ "git_ref": { "type": "string", "minLength": 7 },
96
+ "packed_artifact_digest": { "type": "string" }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "User": {
101
+ "type": "object",
102
+ "required": ["user_id", "workspace_id", "email", "display_name"],
103
+ "properties": {
104
+ "user_id": { "type": "string" },
105
+ "workspace_id": { "type": "string" },
106
+ "email": { "type": "string", "format": "email" },
107
+ "display_name": { "type": "string" },
108
+ "role": {
109
+ "type": "string",
110
+ "enum": ["owner", "admin", "member", "guest"]
111
+ },
112
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
113
+ },
114
+ "additionalProperties": false
115
+ },
116
+ "Workspace": {
117
+ "type": "object",
118
+ "required": ["workspace_id", "cell_id", "slug", "name"],
119
+ "properties": {
120
+ "workspace_id": { "type": "string" },
121
+ "cell_id": { "type": "string" },
122
+ "slug": { "type": "string" },
123
+ "name": { "type": "string" },
124
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
125
+ },
126
+ "additionalProperties": false
127
+ },
128
+ "AgentIdentity": {
129
+ "type": "object",
130
+ "required": [
131
+ "agent_id",
132
+ "workspace_id",
133
+ "template_slug",
134
+ "display_name"
135
+ ],
136
+ "properties": {
137
+ "agent_id": { "type": "string" },
138
+ "workspace_id": { "type": "string" },
139
+ "template_slug": { "type": "string" },
140
+ "display_name": { "type": "string" },
141
+ "is_native": { "type": "boolean" },
142
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
143
+ },
144
+ "additionalProperties": false
145
+ },
146
+ "RuntimeBinding": {
147
+ "type": "object",
148
+ "required": [
149
+ "binding_id",
150
+ "agent_id",
151
+ "runtime_kind",
152
+ "profile_slug"
153
+ ],
154
+ "properties": {
155
+ "binding_id": { "type": "string" },
156
+ "agent_id": { "type": "string" },
157
+ "runtime_kind": { "$ref": "#/$defs/runtime_kind" },
158
+ "profile_slug": { "type": "string" },
159
+ "status": { "$ref": "#/$defs/runtime_binding_status" },
160
+ "detected_at": { "$ref": "#/$defs/iso_datetime" }
161
+ },
162
+ "additionalProperties": false
163
+ },
164
+ "Run": {
165
+ "type": "object",
166
+ "required": [
167
+ "run_id",
168
+ "workspace_id",
169
+ "surface",
170
+ "actor_type",
171
+ "actor_id",
172
+ "triggering_user_id",
173
+ "agent_id",
174
+ "runtime_binding_id",
175
+ "status",
176
+ "payer_user_id",
177
+ "funding_source"
178
+ ],
179
+ "properties": {
180
+ "run_id": { "type": "string" },
181
+ "workspace_id": { "type": "string" },
182
+ "surface": { "$ref": "#/$defs/run_surface" },
183
+ "actor_type": { "$ref": "#/$defs/actor_type" },
184
+ "actor_id": { "type": "string" },
185
+ "triggering_user_id": { "type": "string" },
186
+ "agent_id": { "type": "string" },
187
+ "runtime_binding_id": { "type": "string" },
188
+ "status": { "$ref": "#/$defs/run_status" },
189
+ "payer_user_id": { "type": "string" },
190
+ "funding_source": { "$ref": "#/$defs/funding_source" },
191
+ "room_id": { "type": "string" },
192
+ "card_id": { "type": "string" },
193
+ "engine": { "type": "string" },
194
+ "runtime": { "type": "string" },
195
+ "risk_tier": {
196
+ "type": "string",
197
+ "enum": ["low", "medium", "high"]
198
+ },
199
+ "budget_usd": { "type": "number" },
200
+ "deny_reason": { "type": "string" },
201
+ "created_at": { "$ref": "#/$defs/iso_datetime" },
202
+ "started_at": { "$ref": "#/$defs/iso_datetime" },
203
+ "ended_at": { "$ref": "#/$defs/iso_datetime" }
204
+ },
205
+ "additionalProperties": false
206
+ },
207
+ "RunEvent": {
208
+ "type": "object",
209
+ "required": ["event_id", "run_id", "event_type"],
210
+ "properties": {
211
+ "event_id": { "type": "string" },
212
+ "run_id": { "type": "string" },
213
+ "event_type": { "type": "string" },
214
+ "payload": { "type": "object", "additionalProperties": true },
215
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
216
+ },
217
+ "additionalProperties": false
218
+ },
219
+ "CredentialRef": {
220
+ "type": "object",
221
+ "required": ["ref_id", "workspace_id", "provider", "policy"],
222
+ "properties": {
223
+ "ref_id": { "type": "string" },
224
+ "workspace_id": { "type": "string" },
225
+ "provider": { "type": "string" },
226
+ "policy": { "$ref": "#/$defs/credential_policy" },
227
+ "user_id": { "type": "string" },
228
+ "binding_id": { "type": "string" },
229
+ "label_redacted": { "type": "string" }
230
+ },
231
+ "additionalProperties": false
232
+ },
233
+ "Lease": {
234
+ "type": "object",
235
+ "required": [
236
+ "lease_id",
237
+ "run_id",
238
+ "workspace_id",
239
+ "payer_user_id",
240
+ "provider",
241
+ "profile_slug",
242
+ "status",
243
+ "expires_at"
244
+ ],
245
+ "properties": {
246
+ "lease_id": { "type": "string" },
247
+ "run_id": { "type": "string" },
248
+ "workspace_id": { "type": "string" },
249
+ "payer_user_id": { "type": "string" },
250
+ "provider": { "type": "string" },
251
+ "profile_slug": { "type": "string" },
252
+ "credential_ref_id": { "type": ["string", "null"] },
253
+ "status": { "$ref": "#/$defs/lease_status" },
254
+ "expires_at": { "$ref": "#/$defs/iso_datetime" },
255
+ "revoked_at": { "$ref": "#/$defs/iso_datetime" },
256
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
257
+ },
258
+ "additionalProperties": false
259
+ },
260
+ "Grant": {
261
+ "type": "object",
262
+ "required": ["grant_id", "run_id", "capability"],
263
+ "properties": {
264
+ "grant_id": { "type": "string" },
265
+ "run_id": { "type": "string" },
266
+ "capability": { "$ref": "#/$defs/grant_capability" },
267
+ "scope": { "type": "object", "additionalProperties": true },
268
+ "granted_by": {
269
+ "type": "string",
270
+ "enum": ["run_authority_gate", "cell_authority_gate", "policy"]
271
+ },
272
+ "expires_at": { "$ref": "#/$defs/iso_datetime" },
273
+ "created_at": { "$ref": "#/$defs/iso_datetime" }
274
+ },
275
+ "additionalProperties": false
276
+ }
277
+ }
278
+ }
@@ -0,0 +1,42 @@
1
+ """Egress policy helpers — brokered provider hosts and forced-broker flag."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+
7
+ # Hostnames agents must not reach directly when WORKFRAME_FORCE_AGENT_EGRESS_BROKER=true.
8
+ BROKERED_PROVIDER_HOSTS: tuple[str, ...] = (
9
+ "openrouter.ai",
10
+ "api.openai.com",
11
+ "api.anthropic.com",
12
+ "generativelanguage.googleapis.com",
13
+ "api.deepseek.com",
14
+ "api.github.com",
15
+ "api.vercel.com",
16
+ "api.netlify.com",
17
+ )
18
+
19
+ BROKER_API_HOST_ENV = "WORKFRAME_API_HOST"
20
+ FORCE_BROKER_ENV = "WORKFRAME_FORCE_AGENT_EGRESS_BROKER"
21
+ EGRESS_GUARD_SERVICE = "gateway-egress-guard"
22
+
23
+
24
+ def force_egress_broker_enabled() -> bool:
25
+ raw = str(os.environ.get(FORCE_BROKER_ENV) or "").strip().lower()
26
+ return raw in {"1", "true", "yes", "on"}
27
+
28
+
29
+ def broker_api_host() -> str:
30
+ return str(os.environ.get(BROKER_API_HOST_ENV) or "workframe-api").strip() or "workframe-api"
31
+
32
+
33
+ def brokered_hosts_csv() -> str:
34
+ return " ".join(BROKERED_PROVIDER_HOSTS)
35
+
36
+
37
+ if __name__ == "__main__":
38
+ assert "openrouter.ai" in BROKERED_PROVIDER_HOSTS
39
+ assert not force_egress_broker_enabled()
40
+ os.environ[FORCE_BROKER_ENV] = "true"
41
+ assert force_egress_broker_enabled()
42
+ print("egress_policy ok")
@@ -0,0 +1,17 @@
1
+ """Handler route mixins extracted from server.Handler (WF-032)."""
2
+
3
+ from handler_modules.handler_admin import AdminRoutesMixin
4
+ from handler_modules.handler_auth import AuthRoutesMixin
5
+ from handler_modules.handler_chat import ChatRoutesMixin
6
+ from handler_modules.handler_install import InstallRoutesMixin
7
+ from handler_modules.handler_provider import ProviderRoutesMixin
8
+ from handler_modules.handler_workspace import WorkspaceRoutesMixin
9
+
10
+ __all__ = [
11
+ "AdminRoutesMixin",
12
+ "AuthRoutesMixin",
13
+ "ChatRoutesMixin",
14
+ "InstallRoutesMixin",
15
+ "ProviderRoutesMixin",
16
+ "WorkspaceRoutesMixin",
17
+ ]