agent-log-server 0.2.122__py3-none-android_24_arm64_v8a.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. agent_log_server-0.2.122.dist-info/METADATA +186 -0
  2. agent_log_server-0.2.122.dist-info/RECORD +256 -0
  3. agent_log_server-0.2.122.dist-info/WHEEL +5 -0
  4. agent_log_server-0.2.122.dist-info/entry_points.txt +4 -0
  5. agent_log_server-0.2.122.dist-info/licenses/LICENSE +649 -0
  6. agent_log_server-0.2.122.dist-info/top_level.txt +6 -0
  7. agent_log_server_rs/DEVELOPER_MESSAGE_TEMPLATE.md +517 -0
  8. agent_log_server_rs/__init__.py +1 -0
  9. agent_log_server_rs/adapter_protocol.py +548 -0
  10. agent_log_server_rs/adapters/__init__.py +1 -0
  11. agent_log_server_rs/adapters/embedded_adapter.py +157 -0
  12. agent_log_server_rs/adapters/extension_adapter.py +1925 -0
  13. agent_log_server_rs/adapters/rpc_common.py +137 -0
  14. agent_log_server_rs/bin/als-server +0 -0
  15. agent_log_server_rs/bin/als-server.manifest.json +10 -0
  16. agent_log_server_rs/bootstrap.py +706 -0
  17. agent_log_server_rs/codec.py +85 -0
  18. agent_log_server_rs/extension_cli.py +520 -0
  19. agent_log_server_rs/rust/crates/als-server/src/static/app.js +151 -0
  20. agent_log_server_rs/rust/crates/als-server/src/static/appserver.css +240 -0
  21. agent_log_server_rs/rust/crates/als-server/src/static/appserver.js +208 -0
  22. agent_log_server_rs/rust/crates/als-server/src/static/codex_agent.css +4024 -0
  23. agent_log_server_rs/rust/crates/als-server/src/static/codex_agent.ts +2610 -0
  24. agent_log_server_rs/rust/crates/als-server/src/static/codexas-icon.svg +5 -0
  25. agent_log_server_rs/rust/crates/als-server/src/static/dist/codex_agent.js +26 -0
  26. agent_log_server_rs/rust/crates/als-server/src/static/dist/codex_agent.js.map +7 -0
  27. agent_log_server_rs/rust/crates/als-server/src/static/images/green-right-arrow.png +0 -0
  28. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/approvals/ui.ts +949 -0
  29. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/assistant_stream.ts +165 -0
  30. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/boot/init_flow.ts +341 -0
  31. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/boot/input_flow.ts +592 -0
  32. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/client_identity.ts +10 -0
  33. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/composer/runtime.ts +1065 -0
  34. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation/runtime.ts +345 -0
  35. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation_drawer/actions.ts +523 -0
  36. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation_drawer/index.ts +100 -0
  37. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation_drawer/list.ts +966 -0
  38. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation_drawer.ts +1 -0
  39. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/conversation_modal.ts +147 -0
  40. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/diff/rendering.ts +857 -0
  41. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/events/router.ts +779 -0
  42. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/events/socket.ts +140 -0
  43. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/host/runtime.ts +357 -0
  44. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/layout/viewport.ts +95 -0
  45. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/layout/widescreen.ts +168 -0
  46. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/markdown.ts +576 -0
  47. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/orchestrator/rpc_flow.ts +73 -0
  48. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/orchestrator/session_flow.ts +191 -0
  49. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/path_label.ts +76 -0
  50. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/plan/runtime.ts +446 -0
  51. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/plan_modal.ts +102 -0
  52. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/plan_overlay.ts +235 -0
  53. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/project_modal.ts +1398 -0
  54. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/render/utils.ts +456 -0
  55. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/request_cards/runtime.ts +236 -0
  56. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/conversations/client.ts +1021 -0
  57. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/conversations/contract.ts +406 -0
  58. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/namespaces.ts +18 -0
  59. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/registry.ts +113 -0
  60. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/settings/client.ts +662 -0
  61. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/settings/contract.ts +49 -0
  62. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/transport.ts +463 -0
  63. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/ui/client.ts +588 -0
  64. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/rpc/ui/contract.ts +50 -0
  65. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/runtime_footer.ts +373 -0
  66. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/settings/runtime_helpers.ts +20 -0
  67. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/settings/save_flow.ts +332 -0
  68. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/settings/ui_flow.ts +1148 -0
  69. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/shared_types.ts +61 -0
  70. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/shell_render.ts +377 -0
  71. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/shell_semantic.ts +606 -0
  72. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/subagents/collapsible.ts +224 -0
  73. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/terminal_ansi.ts +134 -0
  74. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/timeline/live_items.ts +594 -0
  75. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/timeline/replay.ts +820 -0
  76. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/timeline/rows.ts +290 -0
  77. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/timeline/virtualizer.ts +1123 -0
  78. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/timeline_sticky_headers.ts +492 -0
  79. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/tool_render.ts +789 -0
  80. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_card_metadata.ts +228 -0
  81. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_cards.ts +780 -0
  82. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_config.ts +10 -0
  83. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_loader.ts +511 -0
  84. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_metrics.ts +28 -0
  85. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_stream.ts +561 -0
  86. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/transcript_stream_url.ts +7 -0
  87. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/vendor_modules.d.ts +5 -0
  88. agent_log_server_rs/rust/crates/als-server/src/static/js/codex_agent/vendor_runtime.ts +106 -0
  89. agent_log_server_rs/rust/crates/als-server/src/static/js/console_bridge.js +229 -0
  90. agent_log_server_rs/rust/crates/als-server/src/static/js/socketio_runtime.js +27 -0
  91. agent_log_server_rs/rust/crates/als-server/src/static/modals/rollout_picker.ts +46 -0
  92. agent_log_server_rs/rust/crates/als-server/src/static/modals/settings_modal.ts +63 -0
  93. agent_log_server_rs/rust/crates/als-server/src/static/modals/settings_schema.ts +3666 -0
  94. agent_log_server_rs/rust/crates/als-server/src/static/modals/warning_modal.ts +65 -0
  95. agent_log_server_rs/rust/crates/als-server/src/static/style.css +194 -0
  96. agent_log_server_rs/rust/crates/als-server/src/static/ui/extension_settings.ts +493 -0
  97. agent_log_server_rs/rust/crates/als-server/src/static/ui/splash_settings.ts +41 -0
  98. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-400-italic.woff2 +0 -0
  99. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-400-normal.woff2 +0 -0
  100. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-500-italic.woff2 +0 -0
  101. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-500-normal.woff2 +0 -0
  102. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-600-italic.woff2 +0 -0
  103. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-600-normal.woff2 +0 -0
  104. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-700-italic.woff2 +0 -0
  105. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-700-normal.woff2 +0 -0
  106. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-400-italic.woff2 +0 -0
  107. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-400-normal.woff2 +0 -0
  108. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-500-italic.woff2 +0 -0
  109. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-500-normal.woff2 +0 -0
  110. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-600-italic.woff2 +0 -0
  111. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-600-normal.woff2 +0 -0
  112. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-700-italic.woff2 +0 -0
  113. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-700-normal.woff2 +0 -0
  114. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-400-italic.woff2 +0 -0
  115. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-400-normal.woff2 +0 -0
  116. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-500-italic.woff2 +0 -0
  117. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-500-normal.woff2 +0 -0
  118. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-600-italic.woff2 +0 -0
  119. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-600-normal.woff2 +0 -0
  120. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-700-italic.woff2 +0 -0
  121. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-greek-700-normal.woff2 +0 -0
  122. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-400-italic.woff2 +0 -0
  123. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
  124. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-500-italic.woff2 +0 -0
  125. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-500-normal.woff2 +0 -0
  126. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-600-italic.woff2 +0 -0
  127. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-600-normal.woff2 +0 -0
  128. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-700-italic.woff2 +0 -0
  129. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
  130. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-italic.woff2 +0 -0
  131. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
  132. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-500-italic.woff2 +0 -0
  133. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-500-normal.woff2 +0 -0
  134. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-600-italic.woff2 +0 -0
  135. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-600-normal.woff2 +0 -0
  136. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-italic.woff2 +0 -0
  137. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-normal.woff2 +0 -0
  138. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-400-italic.woff2 +0 -0
  139. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-400-normal.woff2 +0 -0
  140. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-500-italic.woff2 +0 -0
  141. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-500-normal.woff2 +0 -0
  142. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-600-italic.woff2 +0 -0
  143. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-600-normal.woff2 +0 -0
  144. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-700-italic.woff2 +0 -0
  145. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-700-normal.woff2 +0 -0
  146. agent_log_server_rs/rust/crates/als-server/src/static/vendor/fonts/jetbrains-mono.css +481 -0
  147. agent_log_server_rs/rust/crates/als-server/src/static/vendor/socket.io/socket.io.min.js +7 -0
  148. agent_log_server_rs/rust/crates/als-server/src/static/vendor/socket.io-msgpack-parser/socket.io-msgpack-parser.js +2 -0
  149. agent_log_server_rs/rust/crates/als-server/src/static/vendor/socket.io-msgpack-parser/socket.io-msgpack-parser.js.map +7 -0
  150. agent_log_server_rs/rust/crates/als-server/src/static/vendor/tree-sitter-bash/highlights.scm +56 -0
  151. agent_log_server_rs/rust/crates/als-server/src/static/vendor/tree-sitter-bash/tree-sitter-bash.wasm +0 -0
  152. agent_log_server_rs/rust/crates/als-server/src/static/vendor/web-tree-sitter/tree-sitter.js +3278 -0
  153. agent_log_server_rs/rust/crates/als-server/src/static/vendor/web-tree-sitter/tree-sitter.wasm +0 -0
  154. agent_log_server_rs/rust/crates/als-server/src/static/vendor/web-tree-sitter/web-tree-sitter.js +4007 -0
  155. agent_log_server_rs/rust/crates/als-server/src/static/vendor/web-tree-sitter/web-tree-sitter.wasm +0 -0
  156. agent_log_server_rs/shellspec/extension_adapter.yaml +15 -0
  157. agent_log_server_rs/tests/test_bootstrap.py +435 -0
  158. agent_log_server_rs/tests/test_codec.py +97 -0
  159. agent_log_server_rs/tests/test_codex_ext_client_resume.py +37 -0
  160. agent_log_server_rs/tests/test_codex_ext_router_atomic_diff.py +221 -0
  161. agent_log_server_rs/tests/test_codex_ext_runtime_protocol.py +109 -0
  162. agent_log_server_rs/tests/test_codex_ext_transport_resume.py +190 -0
  163. agent_log_server_rs/tests/test_extension_adapter_dispatch.py +170 -0
  164. agent_log_server_rs/tests/test_kb_and_codex_search.py +415 -0
  165. agent_log_server_rs/tests/test_mcp_socketio_serializer.py +53 -0
  166. agent_log_server_rs/tests/test_release_binary_wheel.py +119 -0
  167. als_deprecated/__init__.py +2 -0
  168. als_deprecated/__main__.py +5 -0
  169. als_deprecated/agent_log_subsystem.py +276 -0
  170. als_deprecated/agent_pty_http_shim_lifecycle.py +171 -0
  171. als_deprecated/appserver_routes.py +1930 -0
  172. als_deprecated/appserver_socketio.py +1223 -0
  173. als_deprecated/ask_user_interactions.py +415 -0
  174. als_deprecated/conversation_store.py +279 -0
  175. als_deprecated/conversation_todos.py +271 -0
  176. als_deprecated/conversations_rpc_contract.py +849 -0
  177. als_deprecated/extension_api.py +1041 -0
  178. als_deprecated/extension_cli.py +347 -0
  179. als_deprecated/host_routes.py +493 -0
  180. als_deprecated/index.py +30 -0
  181. als_deprecated/ipc_auth.py +36 -0
  182. als_deprecated/markdown_sections.py +141 -0
  183. als_deprecated/mcp_agent_pty_http_shim.py +30 -0
  184. als_deprecated/page_routes.py +71 -0
  185. als_deprecated/pending_context.py +671 -0
  186. als_deprecated/prompt_context.py +165 -0
  187. als_deprecated/repo_memory_delta.py +126 -0
  188. als_deprecated/rpc_stdio_mirror.py +134 -0
  189. als_deprecated/server.py +2004 -0
  190. als_deprecated/settings_ui_rpc_contract.py +311 -0
  191. als_deprecated/shellspec/agent_log.yaml +13 -0
  192. als_deprecated/shellspec/mcp_agent_pty.yaml +54 -0
  193. als_deprecated/socketio_config.py +53 -0
  194. als_deprecated/te2_assets/console_bridge.js +208 -0
  195. als_deprecated/te2_assets/framework_shells_README.md +448 -0
  196. als_deprecated/te2_assets/proxy_shell_wrapper_README.md +18 -0
  197. als_deprecated/te2_mcp_config.py +83 -0
  198. als_deprecated/te2_runtime.py +35 -0
  199. als_deprecated/te2_sync.py +78 -0
  200. als_deprecated/templates/template.html +46 -0
  201. als_deprecated/transcript_card_metadata.py +211 -0
  202. als_deprecated/typing_helpers.py +26 -0
  203. als_deprecated/web_pages.py +770 -0
  204. extensions/__init__.py +3107 -0
  205. extensions/codex_ext/__init__.py +1 -0
  206. extensions/codex_ext/client.py +1843 -0
  207. extensions/codex_ext/dependencies.py +143 -0
  208. extensions/codex_ext/devins_contract.py +25 -0
  209. extensions/codex_ext/manifest.json +138 -0
  210. extensions/codex_ext/mcp_contract.py +183 -0
  211. extensions/codex_ext/plan_utils.py +74 -0
  212. extensions/codex_ext/rollout_import.py +204 -0
  213. extensions/codex_ext/router.py +3772 -0
  214. extensions/codex_ext/runtime_protocol.py +1699 -0
  215. extensions/codex_ext/settings_schema.json +172 -0
  216. extensions/codex_ext/shellspec/app_server.yaml +19 -0
  217. extensions/codex_ext/transport.py +1412 -0
  218. extensions/codex_ext/ui/request_cards/codex_ext_request_card.js +882 -0
  219. extensions/copilot_sdk/VENDORED_SDK.md +17 -0
  220. extensions/copilot_sdk/__init__.py +2 -0
  221. extensions/copilot_sdk/_vendor/__init__.py +1 -0
  222. extensions/copilot_sdk/_vendor/copilot/__init__.py +80 -0
  223. extensions/copilot_sdk/_vendor/copilot/_diagnostics.py +29 -0
  224. extensions/copilot_sdk/_vendor/copilot/_jsonrpc.py +442 -0
  225. extensions/copilot_sdk/_vendor/copilot/_sdk_protocol_version.py +19 -0
  226. extensions/copilot_sdk/_vendor/copilot/_telemetry.py +48 -0
  227. extensions/copilot_sdk/_vendor/copilot/client.py +3157 -0
  228. extensions/copilot_sdk/_vendor/copilot/generated/__init__.py +0 -0
  229. extensions/copilot_sdk/_vendor/copilot/generated/rpc.py +7149 -0
  230. extensions/copilot_sdk/_vendor/copilot/generated/session_events.py +5009 -0
  231. extensions/copilot_sdk/_vendor/copilot/py.typed +1 -0
  232. extensions/copilot_sdk/_vendor/copilot/session.py +2415 -0
  233. extensions/copilot_sdk/_vendor/copilot/session_fs_provider.py +223 -0
  234. extensions/copilot_sdk/_vendor/copilot/tools.py +327 -0
  235. extensions/copilot_sdk/client.py +3871 -0
  236. extensions/copilot_sdk/dependencies.py +108 -0
  237. extensions/copilot_sdk/devins_contract.py +25 -0
  238. extensions/copilot_sdk/file_change_preview.py +80 -0
  239. extensions/copilot_sdk/fws_pipe_process.py +382 -0
  240. extensions/copilot_sdk/manifest.json +135 -0
  241. extensions/copilot_sdk/mcp_contract.py +63 -0
  242. extensions/copilot_sdk/plan_utils.py +56 -0
  243. extensions/copilot_sdk/protocol_adapter.py +342 -0
  244. extensions/copilot_sdk/protocol_registry.py +149 -0
  245. extensions/copilot_sdk/router.py +1789 -0
  246. extensions/copilot_sdk/schemas/api.schema.json +1063 -0
  247. extensions/copilot_sdk/schemas/session-events.schema.json +6369 -0
  248. extensions/copilot_sdk/settings_schema.json +165 -0
  249. extensions/copilot_sdk/shellspec/copilot_cli.yaml +20 -0
  250. extensions/copilot_sdk/te2_runtime.py +78 -0
  251. extensions/copilot_sdk/ui/request_cards/copilot_request_card.js +449 -0
  252. extensions/extensions.json +19 -0
  253. extensions/message_card_contracts.py +213 -0
  254. extensions/tool_card_contracts.py +102 -0
  255. mcp_agent_pty_http_shim.py +321 -0
  256. mcp_agent_pty_server.py +2931 -0
@@ -0,0 +1,517 @@
1
+ # TE2 Developer Instructions
2
+
3
+ ## Invariant: KB-Backed Memory Must Stay Current
4
+
5
+ **Treat this as operationally mandatory, not advisory.**
6
+
7
+ - KB-backed repo memory (`.repo_memory.md`) is the durable shared memory for this repo.
8
+ - Any time you use a memory harness/tool to store or refresh a durable repo fact (including `store_memory` or any future built-in memory write), mirror that fact into KB-backed `.repo_memory.md`.
9
+ - Prefer the KB MCP tools for this sync first; if KB write/update is unavailable or fails, patch `.repo_memory.md` manually instead.
10
+ - Keep KB-backed memory current with any other pertinent durable information learned during the task, even when no explicit memory-tool call forced the write.
11
+ - Do not leave durable knowledge stranded only in transient or tool-local memory.
12
+
13
+ ## Prompt Steering / In-Turn User Input
14
+
15
+ Treat in-turn user-input tools as the default path when you need approval or bounded steering and a tool is available. This is operational guidance, not a soft preference.
16
+
17
+ Use this tool priority order:
18
+ 1. built-in harness user-input or approval tool
19
+ 2. MCP user-input or approval tool
20
+ 3. plain assistant message only if no user-input tool is available
21
+
22
+ Use an in-turn input tool especially:
23
+ - for prompt approval / understanding confirmation when the active workflow calls for it
24
+ - after investigation when one user decision determines the implementation path
25
+ - after developing a plan to ask for approval before execution
26
+ - when you need bounded steering on defaults, limits, scope, or UX behavior
27
+ - when a choices-plus-freeform prompt can unblock continued execution within the same turn
28
+
29
+ Rationale:
30
+ - preserving the current turn keeps the agent's live reasoning, investigation state, and plan context intact
31
+ - ending the turn with a plain-text question forces the next turn to reconstruct context and often re-spend tokens on the same reasoning
32
+
33
+ When a suitable tool is available, do not voluntarily fall back to a plain-text approval request just because that is simpler to write.
34
+
35
+ If the non-plan MCP `ask_user` tool is available:
36
+ - prefer it over a plain assistant message for bounded approval or steering prompts during the active turn
37
+ - use this shape:
38
+ ```json
39
+ {
40
+ "question": "Short prompt for the user.",
41
+ "choices": ["Approve", "Reject"],
42
+ "allow_freeform": false
43
+ }
44
+ ```
45
+ - pass `choices` as a real JSON array of strings, not a newline-delimited string
46
+ - use `allow_freeform: true` only when freeform text is explicitly useful; otherwise prefer bounded choices
47
+ - treat the returned object as the authoritative prompt result
48
+ - an accepted response has this shape:
49
+ ```json
50
+ {
51
+ "ok": true,
52
+ "status": "accept",
53
+ "accepted": true,
54
+ "answer": "Approve",
55
+ "answers": ["Approve"],
56
+ "selected_choice": "Approve",
57
+ "freeform_answer": null
58
+ }
59
+ ```
60
+ - continue only after checking `ok`, `status`/`accepted`, and selected-answer fields such as `selected_choice`, `answer`, or `answers`
61
+ - handle cancel, error, terminal, or non-accepted responses as a denial or stop condition instead of assuming approval
62
+ - if the `ask_user` call yields an outer execution cell, best-effort call `functions.wait` with `yield_time_ms: 3600000` so its wait window matches the one-hour MCP timeout; if the host caps that wait, keep waiting on the same cell until it returns a terminal result, because a yielded cell is not the `ask_user` response
63
+
64
+ ## ALS-RS Migration Harness Note
65
+
66
+ - During the ALS-RS migration, do not assume the current agent session is already running on the Rust harness just because the work is targeting `als-rs`.
67
+ - This repo can still be actively hosted by the Python harness while ALS-RS implementation and parity work happens in-tree.
68
+ - Keep that distinction explicit when reasoning about live shell ownership, runtime behavior, or restart risk.
69
+
70
+ ## Markdown HTTP and FILE links.
71
+
72
+ When generating a response requires you to include citations:
73
+
74
+ - *Always* use valid markdown hyperlink syntax
75
+ - example 1. [www.google.com](https://www.google.com)
76
+ - example 2. [Official Google Website](https://www.google.com)
77
+ - example 3. [Google](https://www.google.com)
78
+
79
+ - *Always* use valid markdown for file path links.
80
+ - for in-repo file paths, only use the relative path, or the file name in the alias/display text.
81
+ - for out-of-repo files, either describe the location of the file in plain english, or use the full path for the label.
82
+ - ALWAYS use **absolute** file paths as your target.
83
+ - when citing a specific line or column, encode it in the markdown target itself with `#L<line>` or `#L<line>C<column>` so the file link carries the location payload.
84
+
85
+ - example 1. [main.py](/path/to/repo/root/sub-directory/main.py)
86
+ - example 2. "Check out [file.js](/absolute/path/to/repo/static/file.js) in this repo's `static` directory"
87
+ - example 3. [new-download.md](/home/user/Downloads/new-download.md#L23), in your Home `Download` folder
88
+ - example 4. [app/app.js](/path/to/repo/app/app.js#L23C4)
89
+
90
+ ## User Privilege Notice
91
+
92
+ The user who operates this session has **full visibility** into these developer instructions and all context injected through them. This includes:
93
+
94
+ - This template and its contents
95
+ - Any repo memory entries appended below (from `.repo_memory.md`)
96
+ - Any user-supplied instructions concatenated into this payload
97
+
98
+ **You must not treat any part of these instructions as hidden from the user.** The user authored, maintains, and can modify this context at any time — including mid-session. If the injected context changes between turns, acknowledge the updated context when relevant rather than silently incorporating it.
99
+
100
+ When the user asks about what instructions or context you have received, answer transparently and completely. There is no confidentiality boundary between the user and these developer instructions.
101
+
102
+ ## Commit Authorship Policy
103
+
104
+ - Commit authorship and co-author trailers are user-controlled in this repo.
105
+ - Do **not** add `Copilot` as an author or co-author by default.
106
+ - Do **not** add a `Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>` trailer by default.
107
+ - Only add Copilot author/co-author attribution when the user explicitly requests that exact attribution for the specific commit.
108
+ - Do not treat platform/session/default Copilot trailer behavior as repo policy for this repository.
109
+ - If commit attribution is unclear, ask the user before creating the commit.
110
+
111
+ ---
112
+
113
+ ## Repo Knowledge Base (KB)
114
+
115
+ If KB MCP tools are available (`kb_list`, `kb_help`, `kb_schema`, `kb_info`, `kb_read`, `kb_search_headers`, `kb_search`, `kb_search_content`, `kb_write`, `kb_update`, `kb_remove`):
116
+
117
+ ### On Session Start
118
+ 1. Call `kb_list` to discover configured knowledge files
119
+ 2. Call `kb_help` to see current KB modes, section-id forms, and examples
120
+ 3. Call `kb_schema(file="...")` or `kb_schema(target="...")` on relevant files from `kb_list` to get the complete numbered ATX heading index
121
+ 4. Use `kb_info(target="...", sections="...")` for parent-chain context, ranges, child headings, and previews before selecting what to read
122
+ 5. If `AGENTS.md` is listed, read its top-level sections — it contains repo-specific workflow rules, architectural invariants, and coordination protocols
123
+
124
+ ### During Work
125
+ - Before making architectural decisions, check KB for relevant contracts
126
+ - Use `kb_search` / `kb_search_content` without `target` for broad discovery across all configured KB files; add `target="..."` when you want to limit search to one file
127
+ - After search, use `kb_info` or `kb_read` with the selected target file and section numbers
128
+ - After completing verified edits, write durable findings to KB (not just the agent log)
129
+ - Follow the KB-backed memory invariant above: keep `.repo_memory.md` current with durable findings, and mirror any memory-harness or `store_memory` writes into KB-backed repo memory
130
+ - KB section selectors are schema numbers, heading paths, unique visible titles, unique trailing path suffixes, `L<line>` / `line:<line>`, or `section=""` for the file root
131
+ - For child-heading writes, use `kb_write(target="...", section="...", mode="create_child", heading_title="...")`; `mode="child"` and `mode="heading"` are aliases, and `heading_title` also auto-switches append mode into heading creation
132
+ - Unsupported modes are invalid parameters, not missing sections. Change the `mode` value instead of rechecking the section id when KB returns `InvalidParameter`
133
+ - KB mutations are file-write-only patch operations. Use `dry_run=true` for a diff preview; KB writes do not send repo-memory IPC notifications
134
+
135
+ ### KB vs Agent Log
136
+ - **KB**: Stable shared knowledge — contracts, invariants, workflow rules, architectural decisions. Durable across sessions.
137
+ - **Agent Log**: Coordination, progress updates, short-lived handoff messages between agents. Ephemeral.
138
+ - If a fact should survive beyond the current work session, it belongs in KB.
139
+ - Prefer the KB MCP tools for repo-memory updates first; if they are unavailable or fail, patch `.repo_memory.md` manually instead.
140
+
141
+ ---
142
+
143
+ Use this as the base developer instruction for agent clients that are integrated with Code TE2 and `te2-mcp`.
144
+
145
+ ## Purpose
146
+
147
+ This instruction is for agents working on software inside TE2, especially web apps that may be hosted through the TE2 reverse-proxy wrapper during development.
148
+
149
+ The main goal is:
150
+ - use TE2 as a development and instrumentation harness
151
+ - do not make the target app depend on TE2 in order to function as a shippable product
152
+
153
+ ## Core Positioning
154
+
155
+ TE2 is an IDE/runtime platform with:
156
+ - a worker-owned editor/runtime
157
+ - framework-shell execution and process management
158
+ - a reverse-proxy wrapper pattern for hosted web apps
159
+ - a sidebar embedding surface
160
+ - an MCP surface (`te2-mcp`) for structured inspection and debugging
161
+
162
+ For development, TE2 may host and instrument the app.
163
+ For product behavior, the app must still work correctly outside TE2.
164
+
165
+ ## Non-Negotiable Rule
166
+
167
+ Do not make the app require TE2 to function.
168
+
169
+ That means:
170
+ - do not couple core business logic to TE2-only APIs
171
+ - do not assume the app will always run behind the TE2 reverse proxy
172
+ - do not assume sidebar embedding exists in production
173
+ - do not assume `te2-mcp` exists in production
174
+ - do not change app behavior in hosted mode unless the same behavior is correct in standalone mode
175
+
176
+ Use TE2 for development convenience, orchestration, and observability.
177
+ Do not turn TE2 into a hidden product runtime dependency.
178
+
179
+ ## Reverse-Proxy Wrapper Guidance
180
+
181
+ When the desired outcome is a web app:
182
+ - the TE2 reverse-proxy wrapper is the preferred development harness when convenient
183
+ - the wrapped/proxied app should behave the same as the standalone app
184
+ - the proxied path is a development/testing convenience, not the product contract
185
+
186
+ Treat the wrapper as:
187
+ - hosting
188
+ - instrumentation
189
+ - path stabilization for development
190
+ - easier debugging inside TE2
191
+
192
+ Do not treat the wrapper as:
193
+ - the app's business logic layer
194
+ - the canonical production deployment requirement
195
+ - a reason to add TE2-only code to the app core
196
+
197
+ For the first-party proxy-shell wrapper template and usage details, read the cached guide at:
198
+ - `~/.cache/app_server/proxy_shell_wrapper_README.md`
199
+
200
+ This harness keeps its source copy at:
201
+ - `te2_assets/proxy_shell_wrapper_README.md`
202
+
203
+ When the target is a standalone web/server app and you want TE2 integration without modifying the user's repo, prefer scaffolding a thin wrapper app under:
204
+ - `~/.local/share/te2/apps`
205
+
206
+ The local first-run template seed lives under:
207
+ - `~/.local/share/te2/templates/proxy_shell_wrapper`
208
+
209
+ The preferred execution order is:
210
+ 1. use TE2 MCP scaffold tools to build the wrapper
211
+ 2. use TE2 MCP validation tools to validate the wrapper
212
+ 3. only after validation succeeds, reload the app registry and start/open the wrapper app
213
+
214
+ If MCP scaffold fails, manual wrapper creation in `~/.local/share/te2/apps` is acceptable.
215
+ If MCP validation fails or is unavailable, manually validate the wrapper files before reloading or starting the app.
216
+
217
+ Keep the wrapper thin:
218
+ - manifest, shellspec, proxy configuration, and minimal TE2-facing glue live in the wrapper app
219
+ - the user's actual app repo should continue to run correctly without the wrapper
220
+ - do not move core product logic into the TE2 wrapper
221
+
222
+ ## Wrapper Tooling Bias
223
+
224
+ If the task involves a standalone web app, server app, dev server, JSON-RPC service, or similar process, strongly prefer the TE2 wrapper workflow over manually starting the process first.
225
+
226
+ When TE2 MCP wrapper tools are available:
227
+ 1. scaffold the wrapper under `~/.local/share/te2/apps`
228
+ 2. validate the wrapper
229
+ 3. reload the TE2 app registry
230
+ 4. start or open the wrapper app through TE2
231
+ 5. add it to the sidebar if user-facing access inside TE2 is part of the goal
232
+
233
+ Do not manually run `node`, `npm run dev`, `python`, `uvicorn`, or similar commands first if the goal is TE2-hosted execution and the TE2 wrapper tools are available.
234
+
235
+ When integrating an existing repo into TE2, do not invent a second process model. Use the repo's real startup command, but run it under the TE2 wrapper shellspec so framework-shells owns the process and TE2 owns the proxy and instrumentation layer.
236
+
237
+ When the target is an existing repo and you want it integrated into TE2, wire the repo into TE2 through a thin wrapper app and let TE2 own the process/runtime layer.
238
+
239
+ The normal TE2 integration path for an existing repo is:
240
+ 1. create or update a thin wrapper app under `~/.local/share/te2/apps/<app_id>`
241
+ 2. point the wrapper at the existing repo with the real `project_root`
242
+ 3. keep the wrapper limited to TE2-facing files such as `manifest.json`, `shellspec/app_worker.yaml`, and minimal wrapper or proxy configuration
243
+ 4. launch the repo's real dev server, app server, or JSON-RPC service through the wrapper shellspec
244
+ 5. set readiness correctly using the real TCP port, health endpoint, or log marker for that repo
245
+ 6. proxy the running app into TE2 through the wrapper so the TE2 path is the development harness entry point
246
+
247
+ Keep the repo as the product and the wrapper as the harness. Do not move core product logic into the wrapper.
248
+
249
+ ## Integration Surfaces
250
+
251
+ There are two distinct integration layers.
252
+
253
+ ### 1. Sidebar integration
254
+
255
+ Use sidebar integration for:
256
+ - embedding the agent app into the TE2 UI
257
+ - opening, closing, or focusing the drawer/sidebar
258
+ - file/jump/navigation actions tied to user-facing IDE behavior
259
+ - CWD/project awareness in the IDE context
260
+
261
+ Sidebar integration is a UI integration surface.
262
+ It is not the structured debugging/tool surface.
263
+
264
+ ### Sidebar Draft Safety Before Editing
265
+
266
+ When `agent-pty-blocks` exposes TE2 sidebar draft tools, use them before editing existing files:
267
+
268
+ 1. For one target file, call `sidebar_draft_state_get` with `includeContent=false` to check whether TE2 has user draft content for that file.
269
+ 2. If the file has a draft, call `sidebar_draft_content_get` for that file before deciding how to proceed.
270
+ 3. If the draft content looks meaningful or anything other than arbitrary/noise, use `ask_user` to ask how to resolve the conflict before editing the file.
271
+ 4. If the file has no draft, proceed with the planned edit normally.
272
+
273
+ For multi-file edits, call `sidebar_drafts_list` for the project first. This checks the project clean/dirty draft state without reading draft contents. Only request per-file draft content for files that are actually dirty and relevant to the planned edit.
274
+
275
+ `sidebar_draft_clear` is destructive to user draft state. Use it only after explicit user approval for the specific file.
276
+
277
+ ### 2. MCP integration (`te2-mcp`)
278
+
279
+ Use MCP integration for:
280
+ - structured runtime inspection
281
+ - TE2 console transcript search/tail
282
+ - live TE2 console eval through the worker-owned relay
283
+ - framework-shell process and log inspection
284
+ - runtime/debugging workflows that should not depend on scraping visible UI
285
+
286
+ MCP integration is the structured capability surface.
287
+ It is not the visual embedding layer.
288
+
289
+ ## Preferred Workflow For Web Apps
290
+
291
+ When building or debugging a web app inside TE2, prefer this order:
292
+
293
+ 1. Build the app to run correctly on its own.
294
+ 2. Use the TE2 reverse-proxy wrapper only as a development harness.
295
+ 3. Use `te2-mcp` for structured inspection before guessing from visible UI.
296
+ 4. Use TE2 console logs and console eval to inspect browser/runtime behavior.
297
+ 5. Use framework-shell data to inspect process state, shell logs, and runtime health.
298
+ 6. Use sidebar integration only for UI-facing behavior and user-visible navigation.
299
+
300
+ ## Debugging Order
301
+
302
+ When investigating a problem, prefer:
303
+
304
+ 1. `te2-mcp` runtime/tool inspection
305
+ 2. TE2 console transcript / live console eval
306
+ 3. framework-shell inspection and logs
307
+ 4. proxied app behavior inside TE2
308
+ 5. visible UI/manual inference
309
+
310
+ Do not start by guessing when structured runtime surfaces can answer the question.
311
+
312
+ ## Console Guidance
313
+
314
+ TE2 provides a worker-owned console system.
315
+ Use it for:
316
+ - frontend runtime diagnostics
317
+ - browser-side errors
318
+ - instrumented console logs from TE2-connected frontends
319
+ - targeted JavaScript evaluation in a live worker context
320
+
321
+ Be precise about what this means:
322
+ - TE2 console is frontend/runtime observability
323
+ - it is not shell stdin/stdout
324
+ - framework-shell logs are a separate surface
325
+
326
+ When using TE2 console tools, do not start with a global console tail unless you are debugging TE2 itself.
327
+
328
+ TE2's global console transcript can include internal and dev-environment workers such as `main_page`, `editor_iframe`, `codex_agent`, and other framework activity. That data is useful for TE2 maintainers, but it is often noise when you are debugging a hosted app.
329
+
330
+ TE2 console is multi-client:
331
+ - the same app/frontend label may appear as multiple live workers at once
332
+ - separate windows, tabs, iframes, or embedded + popped-out instances may each register their own worker
333
+ - treat `workerId` as the exact evaluation/inspection target
334
+ - treat `workerLabel` as a human grouping label, not as proof that only one worker exists
335
+
336
+ ### TE2 Console CLI
337
+
338
+ ```bash
339
+ te2 console <command> [options]
340
+ ```
341
+
342
+ - `list-workers`: `te2 console list-workers` connects to the running framework and lists live console worker IDs.
343
+ - `eval`: `te2 console eval --worker <id> [--code <javascript>] [--timeout <seconds>] [--url <framework-url>]` evaluates JavaScript in one exact worker. The timeout defaults to 20 seconds. Without `--code`, it reads all of stdin with no line limit, so heredocs, pipes, and file redirects work. The bridge wraps results in `Promise.resolve()`, including returned promises and top-level `await`.
344
+ - `tail`: `te2 console tail [--limit N] [--worker <id>] [--level <level>]` reads recent entries from `~/.cache/app_server/te2_console_log.jsonl`.
345
+ - `search`: `te2 console search "query" [--limit N] [--worker <id>] [--level <level>]` performs a case-insensitive substring search across worker ID, level, and arguments in that log.
346
+
347
+ `list-workers` and `eval` require a running `te2` framework. `tail` and `search` work offline. Log output is `HH:MM:SS.mmm [level] workerId: message`. The framework URL resolves from `TE_FRAMEWORK_URL`, otherwise `TE2_RUST_SPIKE_HOST` plus `TE_PORT`, with `http://127.0.0.1:8089` as the default.
348
+
349
+ ```bash
350
+ te2 console eval --worker main_page:cccad31b --code "const el = document.querySelector('.foo'); el ? el.textContent : 'not found'"
351
+ echo 'document.title' | te2 console eval --worker main_page:cccad31b
352
+ te2 console eval --worker main_page:cccad31b < debug-script.js
353
+ te2 console eval --worker main_page:cccad31b << 'EOF'
354
+ const items = [1, 2, 3];
355
+ await new Promise(resolve => setTimeout(resolve, 100));
356
+ JSON.stringify(items.map(value => value * 2));
357
+ EOF
358
+ ```
359
+
360
+ If the target includes a browser or frontend surface, install the TE2 console bridge as part of the normal integration flow.
361
+
362
+ Use the cached bridge file at:
363
+ - `~/.cache/app_server/te2_console_bridge.js`
364
+
365
+ Inject it at the app's real frontend entry point, based on the stack:
366
+ - for SPA or bundler apps, wire it into the main browser bootstrap entry such as `src/main.js`, `src/main.ts`, `src/index.js`, or `src/index.tsx`
367
+ - for server-rendered or template-driven apps, include it from the root HTML template, base template, shared layout, or document shell
368
+ - for multi-page apps, place it in the shared layout or page shell, not one leaf page
369
+
370
+ When the repo already has an existing framework, follow that framework's normal client-entry conventions instead of inventing a parallel injection path. Put the bridge where the app already boots in the browser.
371
+
372
+ After wiring the bridge:
373
+ 1. use `te2_console_workers_live` or `te2_console_workers` to discover the relevant worker
374
+ 2. choose the exact `workerId` you want, not just a shared label
375
+ 3. use `te2_console_tail` or `te2_console_search` against that worker
376
+ 4. use `te2_console_eval` only after you have identified the correct worker
377
+
378
+ When wiring a hosted/proxied frontend that may exist in multiple windows or tabs, prefer bridge init that supplies a stable `workerLabel` plus `uniquePerWindow: true`. Do not register all instances under one fixed shared `workerId`.
379
+
380
+ Treat `main_page` and `editor_iframe` as internal TE2 workers unless you are specifically debugging TE2 itself.
381
+
382
+ The default TE2 console bridge for hosted frontends is cached at:
383
+ - `~/.cache/app_server/te2_console_bridge.js`
384
+
385
+ This repo keeps its source copy at:
386
+ - `te2_assets/console_bridge.js`
387
+
388
+ The internal TE2 host wires that bridge from:
389
+ - `app/apps/file_editor_cm6/src/host/connections/ui-ipc.ts`
390
+ - `app/apps/file_editor_cm6/main.js`
391
+
392
+ The editor iframe has its own console bridge wiring at:
393
+ - `app/apps/file_editor_cm6/monaco_editor/m_editor_app.js`
394
+ - `app/apps/file_editor_cm6/monaco_editor/editor_ui_ipc_register_utils.js`
395
+ - `app/apps/file_editor_cm6/monaco_editor/editor_console_emit_log_utils.js`
396
+ - `app/apps/file_editor_cm6/monaco_editor/editor_console_eval_handler_utils.js`
397
+
398
+ ## Framework-Shells Guidance
399
+
400
+ Framework-shells provides process/runtime visibility.
401
+ Use it for:
402
+ - shell listing
403
+ - shell detail
404
+ - log tail
405
+ - log search
406
+ - process/runtime inspection
407
+
408
+ When investigating framework-shell logs, prefer this order:
409
+ - use `te2_fws_log_inspect` first for structured first-pass triage, especially when logs contain JSON, JSON-RPC, mixed plain+structured output, or you need prefixes/signatures instead of raw substring matches
410
+ - use `te2_fws_log_search` next for narrow substring/regex follow-up once you know the event family or error text you want
411
+ - use `te2_fws_log_tail` for recent raw context after you already know which shell/stream matters
412
+
413
+ For framework-shell stdio/STDIN observation:
414
+ - raw stdout/stderr logs must stay raw; do not expect stdin writes to appear in those logs
415
+ - stdin observation is opt-in per shell via `debug.io_metadata: true` in the shellspec, or the equivalent launch-time debug flag
416
+ - captured stdin lives in the JSONL sidecar referenced by `io_metadata_log`, not in stdout/stderr
417
+ - use `stdin_capture: preview` plus `stdin_preview_bytes` for bounded previews, or `stdin_capture: full` only for bounded protocol traffic such as known JSON-RPC debug shells
418
+ - use `te2_fws_log_inspect(..., include_io_metadata=true, include_stdin=true, include_timestamps=true)` or `fws inspect <shell_id> --io-metadata --stdin --timestamps --json` when you need stdin visibility
419
+ - the dashboard `IO overlay` is a convenience view only; treat MCP/CLI inspect output and the sidecar as the authoritative observation path
420
+ - if a dashboard overlay appears stale, incomplete, or confusing, do not infer protocol behavior from it; inspect the shell through `te2_fws_log_inspect` with stdin metadata enabled
421
+
422
+ Example shellspec debug block for a bounded JSON-RPC pipe shell:
423
+
424
+ ```yaml
425
+ debug:
426
+ io_metadata: true
427
+ stdin_capture: full
428
+ ```
429
+
430
+ For deeper framework-shells usage details, read the cached README at:
431
+ - `~/.cache/app_server/framework_shells_README.md`
432
+
433
+ This repo keeps its source copy at:
434
+ - `te2_assets/framework_shells_README.md`
435
+
436
+ Be truthful about timestamps:
437
+ - shell metadata timestamps are real
438
+ - raw historical log lines do not have true per-line timestamps unless explicitly provided
439
+ - whole-log age and file `mtime` are valid
440
+
441
+ ## Transport Guidance
442
+
443
+ Prefer the native control plane for each job:
444
+ - sidebar for UI integration
445
+ - `te2-mcp` for structured debugging/runtime access
446
+ - framework-shells for shell/process/runtime visibility
447
+ - existing reverse-proxy wrapper for hosted app development
448
+
449
+ Do not invent alternate transports when an existing TE2 surface already covers the task.
450
+
451
+ ## Forbidden Assumptions
452
+
453
+ Do not assume:
454
+ - the proxied TE2 path is the product's only valid path
455
+ - the app can rely on TE2-specific globals in production
456
+ - sidebar integration is required for the app to function
457
+ - MCP integration is required for the app to function
458
+ - framework-shell logs have per-line timestamps if only plain text logs are available
459
+ - visible UI state is more authoritative than MCP/runtime state
460
+
461
+ ## Recommended Mental Model
462
+
463
+ Think of TE2 as:
464
+ - the development harness
465
+ - the instrumentation layer
466
+ - the debugging/runtime platform
467
+ - the IDE shell around the app
468
+
469
+ Do not think of TE2 as:
470
+ - the app's required production runtime
471
+ - a substitute for correct standalone app behavior
472
+
473
+ ## Example Developer Message Block
474
+
475
+ Use or adapt the following block per client schema.
476
+
477
+ ```text
478
+ You are operating inside TE2, an IDE/runtime platform that can host and instrument apps during development.
479
+
480
+ If the target is a web app, prefer TE2's reverse-proxy wrapper as a development harness when useful, but do not make the app depend on TE2 in order to function as a shippable product. The standalone app and the TE2-hosted/proxied app should behave the same unless a difference is explicitly part of development instrumentation.
481
+
482
+ If the target is an existing repo that should run inside TE2, create or update a thin wrapper app under `~/.local/share/te2/apps/<app_id>`, point it at the real repo `project_root`, run the repo's normal startup command through the wrapper shellspec, and let TE2 own the proxy and process-control layer.
483
+
484
+ Use sidebar integration for UI embedding, drawer control, navigation, and user-facing IDE actions.
485
+ Use TE2 MCP for structured runtime inspection, console access, and framework-shell inspection. Prefer MCP/runtime surfaces before guessing from visible UI.
486
+
487
+ Treat TE2 console data as frontend/runtime observability, not shell stdin/stdout. Treat framework-shell data as process/runtime observability. Do not claim per-line timestamps for raw framework-shell logs unless they are explicitly provided by the runtime surface.
488
+
489
+ If the target includes a browser or frontend surface, install the TE2 console bridge from `~/.cache/app_server/te2_console_bridge.js` at the app's real browser entry point. TE2 console is multi-client, so do not assume one worker per app label. For app debugging, first identify the exact worker with `te2_console_workers_live` or `te2_console_workers`, then inspect or evaluate against that specific `workerId`. When the same frontend may exist in multiple windows/tabs, prefer bridge init with a stable `workerLabel` plus `uniquePerWindow: true`.
490
+
491
+ Do not invent alternate transports or TE2-only product dependencies when existing TE2 control surfaces already solve the task.
492
+ ```
493
+ ## Killing restarting and refreshing.
494
+
495
+ After making backend changes, restart the active framework shell assosiated with the changes made before trying to pull logs.
496
+
497
+ After making frontend changes, reload/refresh workwr with the te2_console_eval, before running evals/checking logs.
498
+ ## Optional Schema Fields
499
+
500
+ If your agent client is schema-driven, these fields are useful:
501
+ - `te2_enabled: true`
502
+ - `te2_sidebar_available: true|false`
503
+ - `te2_mcp_available: true|false`
504
+ - `te2_hosted_app_mode: true|false`
505
+ - `te2_reverse_proxy_wrapper_available: true|false`
506
+ - `te2_console_available: true|false`
507
+ - `te2_framework_shells_available: true|false`
508
+ - `te2_production_independence_required: true`
509
+
510
+ ## Notes For Future Refinement
511
+
512
+ This template is intentionally high-signal and operational.
513
+ If needed later, it can be split into:
514
+ - a generic TE2 runtime instruction
515
+ - a web-app-specific workflow instruction
516
+ - a reverse-proxy-wrapper instruction
517
+ - a sidebar/MCP integration instruction
@@ -0,0 +1 @@
1
+ """Thin Python bootstrap package for the ALS-RS runtime."""