zjcode 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. deepagents_code/__init__.py +42 -0
  2. deepagents_code/__main__.py +6 -0
  3. deepagents_code/_ask_user_types.py +90 -0
  4. deepagents_code/_cli_context.py +96 -0
  5. deepagents_code/_constants.py +41 -0
  6. deepagents_code/_debug.py +148 -0
  7. deepagents_code/_debug_buffer.py +204 -0
  8. deepagents_code/_env_vars.py +411 -0
  9. deepagents_code/_fake_models.py +66 -0
  10. deepagents_code/_git.py +521 -0
  11. deepagents_code/_paths.py +69 -0
  12. deepagents_code/_server_config.py +576 -0
  13. deepagents_code/_session_stats.py +235 -0
  14. deepagents_code/_startup_error.py +45 -0
  15. deepagents_code/_testing_models.py +305 -0
  16. deepagents_code/_textual_patches.py +420 -0
  17. deepagents_code/_tool_stream.py +694 -0
  18. deepagents_code/_version.py +46 -0
  19. deepagents_code/agent.py +1976 -0
  20. deepagents_code/app.py +19239 -0
  21. deepagents_code/app.tcss +438 -0
  22. deepagents_code/approval_mode.py +131 -0
  23. deepagents_code/ask_user.py +306 -0
  24. deepagents_code/auth_display.py +185 -0
  25. deepagents_code/auth_store.py +545 -0
  26. deepagents_code/built_in_skills/__init__.py +5 -0
  27. deepagents_code/built_in_skills/remember/SKILL.md +118 -0
  28. deepagents_code/built_in_skills/skill-creator/SKILL.md +383 -0
  29. deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py +366 -0
  30. deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py +158 -0
  31. deepagents_code/client/__init__.py +1 -0
  32. deepagents_code/client/commands/__init__.py +1 -0
  33. deepagents_code/client/commands/auth.py +541 -0
  34. deepagents_code/client/commands/config.py +714 -0
  35. deepagents_code/client/commands/mcp.py +250 -0
  36. deepagents_code/client/commands/tools.py +416 -0
  37. deepagents_code/client/launch/__init__.py +1 -0
  38. deepagents_code/client/launch/server.py +978 -0
  39. deepagents_code/client/launch/server_manager.py +540 -0
  40. deepagents_code/client/non_interactive.py +1758 -0
  41. deepagents_code/client/remote_client.py +794 -0
  42. deepagents_code/clipboard.py +217 -0
  43. deepagents_code/command_registry.py +450 -0
  44. deepagents_code/config.py +4829 -0
  45. deepagents_code/config_manifest.py +1451 -0
  46. deepagents_code/configurable_model.py +577 -0
  47. deepagents_code/default_agent_prompt.md +12 -0
  48. deepagents_code/doctor.py +559 -0
  49. deepagents_code/editor.py +142 -0
  50. deepagents_code/event_bus.py +411 -0
  51. deepagents_code/extras_info.py +661 -0
  52. deepagents_code/file_ops.py +576 -0
  53. deepagents_code/formatting.py +135 -0
  54. deepagents_code/goal_rubric.py +497 -0
  55. deepagents_code/goal_tools.py +459 -0
  56. deepagents_code/hooks.py +348 -0
  57. deepagents_code/input.py +1041 -0
  58. deepagents_code/integrations/__init__.py +1 -0
  59. deepagents_code/integrations/openai_codex.py +551 -0
  60. deepagents_code/integrations/sandbox_config.py +198 -0
  61. deepagents_code/integrations/sandbox_factory.py +1124 -0
  62. deepagents_code/integrations/sandbox_provider.py +137 -0
  63. deepagents_code/integrations/sandbox_registry.py +350 -0
  64. deepagents_code/iterm_cursor_guide.py +176 -0
  65. deepagents_code/local_context.py +926 -0
  66. deepagents_code/main.py +3985 -0
  67. deepagents_code/managed_tools.py +642 -0
  68. deepagents_code/mcp_auth.py +1950 -0
  69. deepagents_code/mcp_config.py +176 -0
  70. deepagents_code/mcp_disabled.py +212 -0
  71. deepagents_code/mcp_login_service.py +281 -0
  72. deepagents_code/mcp_oauth_ui.py +199 -0
  73. deepagents_code/mcp_providers/__init__.py +23 -0
  74. deepagents_code/mcp_providers/_registry.py +39 -0
  75. deepagents_code/mcp_providers/base.py +133 -0
  76. deepagents_code/mcp_providers/github.py +102 -0
  77. deepagents_code/mcp_providers/slack.py +175 -0
  78. deepagents_code/mcp_tools.py +2427 -0
  79. deepagents_code/mcp_trust.py +207 -0
  80. deepagents_code/media_utils.py +826 -0
  81. deepagents_code/memory_guard.py +474 -0
  82. deepagents_code/model_config.py +4156 -0
  83. deepagents_code/notifications.py +247 -0
  84. deepagents_code/offload.py +402 -0
  85. deepagents_code/onboarding.py +223 -0
  86. deepagents_code/output.py +69 -0
  87. deepagents_code/paste_collapse.py +103 -0
  88. deepagents_code/project_utils.py +231 -0
  89. deepagents_code/py.typed +0 -0
  90. deepagents_code/reasoning_effort.py +641 -0
  91. deepagents_code/reliable_rubric.py +97 -0
  92. deepagents_code/resume_state.py +237 -0
  93. deepagents_code/server_graph.py +310 -0
  94. deepagents_code/session_end_summary.py +329 -0
  95. deepagents_code/sessions.py +1716 -0
  96. deepagents_code/skills/__init__.py +18 -0
  97. deepagents_code/skills/commands.py +1252 -0
  98. deepagents_code/skills/invocation.py +112 -0
  99. deepagents_code/skills/load.py +196 -0
  100. deepagents_code/skills/trust.py +547 -0
  101. deepagents_code/state_migration.py +136 -0
  102. deepagents_code/subagents.py +278 -0
  103. deepagents_code/system_prompt.md +204 -0
  104. deepagents_code/terminal_capabilities.py +115 -0
  105. deepagents_code/terminal_escape.py +287 -0
  106. deepagents_code/theme.py +891 -0
  107. deepagents_code/todo_list_prompt.md +12 -0
  108. deepagents_code/tool_catalog.py +509 -0
  109. deepagents_code/tool_display.py +367 -0
  110. deepagents_code/tools.py +516 -0
  111. deepagents_code/tui/__init__.py +1 -0
  112. deepagents_code/tui/textual_adapter.py +2553 -0
  113. deepagents_code/tui/widgets/__init__.py +9 -0
  114. deepagents_code/tui/widgets/_js_eval_display.py +139 -0
  115. deepagents_code/tui/widgets/_links.py +261 -0
  116. deepagents_code/tui/widgets/agent_selector.py +420 -0
  117. deepagents_code/tui/widgets/approval.py +602 -0
  118. deepagents_code/tui/widgets/ask_user.py +515 -0
  119. deepagents_code/tui/widgets/auth.py +1997 -0
  120. deepagents_code/tui/widgets/autocomplete.py +890 -0
  121. deepagents_code/tui/widgets/chat_input.py +3181 -0
  122. deepagents_code/tui/widgets/codex_auth.py +452 -0
  123. deepagents_code/tui/widgets/cwd_switch.py +242 -0
  124. deepagents_code/tui/widgets/debug_console.py +868 -0
  125. deepagents_code/tui/widgets/diff.py +252 -0
  126. deepagents_code/tui/widgets/effort_selector.py +189 -0
  127. deepagents_code/tui/widgets/goal_review.py +390 -0
  128. deepagents_code/tui/widgets/goal_status.py +50 -0
  129. deepagents_code/tui/widgets/history.py +194 -0
  130. deepagents_code/tui/widgets/install_confirm.py +248 -0
  131. deepagents_code/tui/widgets/launch_init.py +482 -0
  132. deepagents_code/tui/widgets/loading.py +227 -0
  133. deepagents_code/tui/widgets/mcp_login.py +539 -0
  134. deepagents_code/tui/widgets/mcp_reconnect.py +212 -0
  135. deepagents_code/tui/widgets/mcp_viewer.py +1634 -0
  136. deepagents_code/tui/widgets/message_store.py +999 -0
  137. deepagents_code/tui/widgets/messages.py +3846 -0
  138. deepagents_code/tui/widgets/model_selector.py +2343 -0
  139. deepagents_code/tui/widgets/notification_center.py +456 -0
  140. deepagents_code/tui/widgets/notification_detail.py +257 -0
  141. deepagents_code/tui/widgets/notification_settings.py +170 -0
  142. deepagents_code/tui/widgets/restart_prompt.py +158 -0
  143. deepagents_code/tui/widgets/skill_trust.py +131 -0
  144. deepagents_code/tui/widgets/startup_tip.py +91 -0
  145. deepagents_code/tui/widgets/status.py +781 -0
  146. deepagents_code/tui/widgets/subagent_panel.py +969 -0
  147. deepagents_code/tui/widgets/theme_selector.py +401 -0
  148. deepagents_code/tui/widgets/thread_selector.py +2564 -0
  149. deepagents_code/tui/widgets/tool_renderers.py +190 -0
  150. deepagents_code/tui/widgets/tool_widgets.py +304 -0
  151. deepagents_code/tui/widgets/update_available.py +311 -0
  152. deepagents_code/tui/widgets/update_confirm.py +184 -0
  153. deepagents_code/tui/widgets/update_progress.py +327 -0
  154. deepagents_code/tui/widgets/welcome.py +508 -0
  155. deepagents_code/turn_end_summary.py +522 -0
  156. deepagents_code/ui.py +858 -0
  157. deepagents_code/unicode_security.py +563 -0
  158. deepagents_code/update_check.py +3124 -0
  159. zjcode-0.0.1.data/data/deepagents_code/default_agent_prompt.md +12 -0
  160. zjcode-0.0.1.dist-info/METADATA +220 -0
  161. zjcode-0.0.1.dist-info/RECORD +163 -0
  162. zjcode-0.0.1.dist-info/WHEEL +4 -0
  163. zjcode-0.0.1.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,212 @@
1
+ """Confirmation modal shown after a successful MCP login.
2
+
3
+ Restarting the LangGraph server is required for newly minted MCP tokens
4
+ to take effect, but auto-restarting interrupts users who want to
5
+ authenticate against several MCP servers back-to-back. This modal lets
6
+ the user choose between restarting now and deferring until later.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from typing import TYPE_CHECKING, ClassVar, Literal
12
+
13
+ from textual.binding import Binding, BindingType
14
+ from textual.containers import Vertical
15
+ from textual.content import Content
16
+ from textual.screen import ModalScreen
17
+ from textual.widgets import Static
18
+
19
+ from deepagents_code.config import get_glyphs
20
+
21
+ if TYPE_CHECKING:
22
+ from textual.app import ComposeResult
23
+
24
+
25
+ ReconnectChoice = Literal["reconnect", "later"]
26
+ """Outcome of the prompt: restart the server now or keep the current one."""
27
+
28
+
29
+ class MCPReconnectPromptScreen(ModalScreen[ReconnectChoice]):
30
+ """Modal asking whether to restart the server after an MCP login.
31
+
32
+ Dismisses with `"reconnect"` when the user accepts the restart and
33
+ `"later"` when the user defers. Esc is treated as "later" so the
34
+ user is never forced into a reconnect they did not explicitly choose.
35
+ """
36
+
37
+ BINDINGS: ClassVar[list[BindingType]] = [
38
+ Binding("enter", "reconnect", "Reconnect", show=False, priority=True),
39
+ Binding("escape", "later", "Later", show=False, priority=True),
40
+ ]
41
+
42
+ CSS = """
43
+ MCPReconnectPromptScreen {
44
+ align: center middle;
45
+ }
46
+
47
+ MCPReconnectPromptScreen > Vertical {
48
+ width: 64;
49
+ max-width: 90%;
50
+ height: auto;
51
+ background: $surface;
52
+ border: solid $primary;
53
+ padding: 1 2;
54
+ }
55
+
56
+ MCPReconnectPromptScreen .mcp-reconnect-title {
57
+ text-style: bold;
58
+ color: $primary;
59
+ text-align: center;
60
+ margin-bottom: 1;
61
+ }
62
+
63
+ MCPReconnectPromptScreen .mcp-reconnect-body {
64
+ height: auto;
65
+ color: $text;
66
+ margin-bottom: 1;
67
+ }
68
+
69
+ MCPReconnectPromptScreen .mcp-reconnect-help {
70
+ height: 1;
71
+ color: $text-muted;
72
+ text-style: italic;
73
+ text-align: center;
74
+ }
75
+ """
76
+
77
+ def __init__(self, server_name: str) -> None:
78
+ """Initialize the prompt.
79
+
80
+ Args:
81
+ server_name: Server whose login just succeeded.
82
+ """
83
+ super().__init__()
84
+ self._server_name = server_name
85
+
86
+ def compose(self) -> ComposeResult:
87
+ """Compose the confirmation dialog.
88
+
89
+ Yields:
90
+ Title, body, and help-row widgets parented inside a `Vertical`.
91
+ """
92
+ glyphs = get_glyphs()
93
+ with Vertical():
94
+ yield Static(
95
+ Content.from_markup(
96
+ "$check Connected to [bold]$name[/bold]",
97
+ check=glyphs.checkmark,
98
+ name=self._server_name,
99
+ ),
100
+ classes="mcp-reconnect-title",
101
+ markup=False,
102
+ )
103
+ yield Static(
104
+ "Reconnect to load new tools.",
105
+ classes="mcp-reconnect-body",
106
+ markup=False,
107
+ )
108
+ yield Static(
109
+ "Enter to reconnect, Esc to defer",
110
+ classes="mcp-reconnect-help",
111
+ markup=False,
112
+ )
113
+
114
+ def action_reconnect(self) -> None:
115
+ """Dismiss with `"reconnect"`."""
116
+ self.dismiss("reconnect")
117
+
118
+ def action_later(self) -> None:
119
+ """Dismiss with `"later"`."""
120
+ self.dismiss("later")
121
+
122
+ def action_cancel(self) -> None:
123
+ """Alias for `action_later` so the app-level Esc handler defers.
124
+
125
+ The app's `action_interrupt` (`escape` binding, `priority=True`)
126
+ fires before this screen's own `escape` binding. When the active
127
+ screen is a `ModalScreen`, it dispatches to `action_cancel` if
128
+ present, else falls through to `dismiss(None)`. Without this
129
+ alias, Esc would dismiss with `None`, which the caller treats as
130
+ a programmatic dismiss (no toast, no reopen) instead of an
131
+ explicit defer.
132
+ """
133
+ self.action_later()
134
+
135
+
136
+ class MCPReconnectForceConfirmScreen(ModalScreen[bool]):
137
+ """Confirmation overlay for `/mcp reconnect --force` with no pending login.
138
+
139
+ Guards a fat-fingered force-restart when nothing is actually queued.
140
+ """
141
+
142
+ BINDINGS: ClassVar[list[BindingType]] = [
143
+ Binding("enter", "confirm", "Confirm", show=False, priority=True),
144
+ Binding("escape", "cancel", "Cancel", show=False, priority=True),
145
+ ]
146
+
147
+ CSS = """
148
+ MCPReconnectForceConfirmScreen {
149
+ align: center middle;
150
+ }
151
+
152
+ MCPReconnectForceConfirmScreen > Vertical {
153
+ width: 64;
154
+ max-width: 90%;
155
+ height: auto;
156
+ background: $surface;
157
+ border: solid $warning;
158
+ padding: 1 2;
159
+ }
160
+
161
+ MCPReconnectForceConfirmScreen .mcp-reconnect-title {
162
+ text-style: bold;
163
+ color: $warning;
164
+ text-align: center;
165
+ margin-bottom: 1;
166
+ }
167
+
168
+ MCPReconnectForceConfirmScreen .mcp-reconnect-body {
169
+ height: auto;
170
+ color: $text;
171
+ margin-bottom: 1;
172
+ }
173
+
174
+ MCPReconnectForceConfirmScreen .mcp-reconnect-help {
175
+ height: 1;
176
+ color: $text-muted;
177
+ text-style: italic;
178
+ text-align: center;
179
+ }
180
+ """
181
+
182
+ def compose(self) -> ComposeResult: # noqa: PLR6301 # Textual requires an instance method
183
+ """Compose the force-reconnect confirmation dialog.
184
+
185
+ Yields:
186
+ Title, body, and help-row widgets parented inside a `Vertical`.
187
+ """
188
+ with Vertical():
189
+ yield Static(
190
+ "Force reconnect?",
191
+ classes="mcp-reconnect-title",
192
+ markup=False,
193
+ )
194
+ yield Static(
195
+ "No MCP login is queued. Restart will drop the current "
196
+ "session and reload all servers.",
197
+ classes="mcp-reconnect-body",
198
+ markup=False,
199
+ )
200
+ yield Static(
201
+ "Enter to restart, Esc to cancel",
202
+ classes="mcp-reconnect-help",
203
+ markup=False,
204
+ )
205
+
206
+ def action_confirm(self) -> None:
207
+ """Dismiss with `True`."""
208
+ self.dismiss(True)
209
+
210
+ def action_cancel(self) -> None:
211
+ """Dismiss with `False`."""
212
+ self.dismiss(False)