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,248 @@
1
+ """Confirmation modal for `/install <package> --package` in the TUI.
2
+
3
+ Arbitrary packages have no curated allowlist to vet against, so installing
4
+ one pulls in third-party code. Rather than forcing the user to re-run with
5
+ `--force`, this non-blocking modal asks for explicit confirmation before the
6
+ install runs. `--force` (or `--yes`) still bypasses the prompt.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from typing import TYPE_CHECKING, ClassVar
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
+ if TYPE_CHECKING:
20
+ from textual.app import ComposeResult
21
+
22
+
23
+ class InstallPackageConfirmScreen(ModalScreen[bool]):
24
+ """Confirmation overlay for installing an arbitrary `--package`.
25
+
26
+ Dismisses with `True` when the user confirms and `False` when the user
27
+ cancels. Esc is treated as cancel so the user is never forced into an
28
+ install they did not explicitly choose.
29
+ """
30
+
31
+ BINDINGS: ClassVar[list[BindingType]] = [
32
+ Binding("enter", "confirm", "Install", show=False, priority=True),
33
+ Binding("escape", "cancel", "Cancel", show=False, priority=True),
34
+ ]
35
+
36
+ CSS = """
37
+ InstallPackageConfirmScreen {
38
+ align: center middle;
39
+ }
40
+
41
+ InstallPackageConfirmScreen > Vertical {
42
+ width: 64;
43
+ max-width: 90%;
44
+ height: auto;
45
+ background: $surface;
46
+ border: solid $warning;
47
+ padding: 1 2;
48
+ }
49
+
50
+ InstallPackageConfirmScreen .install-confirm-title {
51
+ text-style: bold;
52
+ color: $warning;
53
+ text-align: center;
54
+ margin-bottom: 1;
55
+ }
56
+
57
+ InstallPackageConfirmScreen .install-confirm-body {
58
+ height: auto;
59
+ color: $text;
60
+ margin-bottom: 1;
61
+ }
62
+
63
+ InstallPackageConfirmScreen .install-confirm-help {
64
+ height: 1;
65
+ color: $text-muted;
66
+ text-style: italic;
67
+ text-align: center;
68
+ }
69
+ """
70
+
71
+ def __init__(self, package: str) -> None:
72
+ """Initialize the prompt.
73
+
74
+ Args:
75
+ package: The package name to install, surfaced in the body.
76
+ """
77
+ super().__init__()
78
+ self._package = package
79
+
80
+ def compose(self) -> ComposeResult:
81
+ """Compose the install confirmation dialog.
82
+
83
+ Yields:
84
+ Title, body, and help-row widgets parented inside a `Vertical`.
85
+ """
86
+ with Vertical():
87
+ yield Static(
88
+ "Install package?",
89
+ classes="install-confirm-title",
90
+ markup=False,
91
+ )
92
+ yield Static(
93
+ Content.from_markup(
94
+ "Installing [bold]$name[/bold] runs third-party code in "
95
+ "the dcode environment.",
96
+ name=self._package,
97
+ ),
98
+ classes="install-confirm-body",
99
+ markup=False,
100
+ )
101
+ yield Static(
102
+ "Enter to install, Esc to cancel",
103
+ classes="install-confirm-help",
104
+ markup=False,
105
+ )
106
+
107
+ def action_confirm(self) -> None:
108
+ """Dismiss with `True`."""
109
+ self.dismiss(True)
110
+
111
+ def action_cancel(self) -> None:
112
+ """Dismiss with `False`.
113
+
114
+ The method name must stay `cancel`: the app owns a priority `escape`
115
+ binding that, for an active `ModalScreen`, dispatches to
116
+ `action_cancel` if present and otherwise falls through to
117
+ `dismiss(None)`. Renaming this would silently regress Esc to a
118
+ `None` dismiss instead of an explicit cancel.
119
+ """
120
+ self.dismiss(False)
121
+
122
+
123
+ class InstallProviderConfirmScreen(ModalScreen[bool]):
124
+ """Confirmation overlay for installing a model provider's extra.
125
+
126
+ Shown from the model selector when the user picks a model whose provider
127
+ integration package is not installed. Dismisses with `True` to install and
128
+ `False` to cancel; Esc cancels so the user is never forced into an install.
129
+ """
130
+
131
+ BINDINGS: ClassVar[list[BindingType]] = [
132
+ Binding("enter", "confirm", "Install", show=False, priority=True),
133
+ Binding("escape", "cancel", "Cancel", show=False, priority=True),
134
+ ]
135
+
136
+ CSS = """
137
+ InstallProviderConfirmScreen {
138
+ align: center middle;
139
+ }
140
+
141
+ InstallProviderConfirmScreen > Vertical {
142
+ width: 64;
143
+ max-width: 90%;
144
+ height: auto;
145
+ background: $surface;
146
+ border: solid $primary;
147
+ padding: 1 2;
148
+ }
149
+
150
+ InstallProviderConfirmScreen .install-confirm-title {
151
+ text-style: bold;
152
+ color: $primary;
153
+ text-align: center;
154
+ margin-bottom: 1;
155
+ }
156
+
157
+ InstallProviderConfirmScreen .install-confirm-body {
158
+ height: auto;
159
+ color: $text;
160
+ margin-bottom: 1;
161
+ }
162
+
163
+ InstallProviderConfirmScreen .install-confirm-help {
164
+ height: 1;
165
+ color: $text-muted;
166
+ text-style: italic;
167
+ text-align: center;
168
+ }
169
+ """
170
+
171
+ def __init__(
172
+ self, provider: str, extra: str, model_spec: str | None = None
173
+ ) -> None:
174
+ """Initialize the prompt.
175
+
176
+ Args:
177
+ provider: The provider whose integration is missing.
178
+ extra: The `deepagents-code` extra that installs the provider.
179
+ model_spec: The selected `provider:model` spec, surfaced in the body
180
+ by the model selector. Omitted by the `/auth` manager, which
181
+ installs a provider so a key can be added rather than to switch
182
+ to a specific model.
183
+ """
184
+ super().__init__()
185
+ self._provider = provider
186
+ self._extra = extra
187
+ self._model_spec = model_spec
188
+
189
+ def compose(self) -> ComposeResult:
190
+ """Compose the provider-install confirmation dialog.
191
+
192
+ Yields:
193
+ Title, body, and help-row widgets parented inside a `Vertical`.
194
+ """
195
+ # Reuse the auth UI's curated labels (e.g. `google_genai` -> "Google
196
+ # Gemini") so the title reads naturally, falling back to a title-cased
197
+ # provider key. Avoids the event-loop config read in
198
+ # `provider_display_name`, which is overkill for a static title.
199
+ from deepagents_code.tui.widgets.auth import PROVIDER_DISPLAY_NAMES
200
+
201
+ provider = PROVIDER_DISPLAY_NAMES.get(
202
+ self._provider, self._provider.replace("_", " ").title()
203
+ )
204
+ if self._model_spec is not None:
205
+ body = Content.from_markup(
206
+ "To use [bold]$model[/bold], dcode needs to "
207
+ "install the [bold]$extra[/bold] integration. This will add "
208
+ "the provider package to your dcode environment.",
209
+ model=self._model_spec,
210
+ extra=self._extra,
211
+ )
212
+ else:
213
+ body = Content.from_markup(
214
+ "To add a key for [bold]$provider[/bold], dcode "
215
+ "needs to install the [bold]$extra[/bold] integration. This "
216
+ "will add the provider package to your dcode environment.",
217
+ provider=provider,
218
+ extra=self._extra,
219
+ )
220
+ with Vertical():
221
+ yield Static(
222
+ f"Install {provider} support?",
223
+ classes="install-confirm-title",
224
+ markup=False,
225
+ )
226
+ yield Static(
227
+ body,
228
+ classes="install-confirm-body",
229
+ markup=False,
230
+ )
231
+ yield Static(
232
+ "Enter to install, Esc to cancel",
233
+ classes="install-confirm-help",
234
+ markup=False,
235
+ )
236
+
237
+ def action_confirm(self) -> None:
238
+ """Dismiss with `True`."""
239
+ self.dismiss(True)
240
+
241
+ def action_cancel(self) -> None:
242
+ """Dismiss with `False`.
243
+
244
+ The method name must stay `cancel` for the same reason as
245
+ `InstallPackageConfirmScreen.action_cancel`: the app's priority
246
+ `escape` binding dispatches to it for an active `ModalScreen`.
247
+ """
248
+ self.dismiss(False)