induscode 0.1.0__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 (167) hide show
  1. induscode/__init__.py +56 -0
  2. induscode/addons/__init__.py +176 -0
  3. induscode/addons/contract.py +923 -0
  4. induscode/addons/dispatch/__init__.py +43 -0
  5. induscode/addons/dispatch/event_dispatcher.py +348 -0
  6. induscode/addons/dispatch/tool_interceptor.py +349 -0
  7. induscode/addons/host.py +469 -0
  8. induscode/addons/loader.py +314 -0
  9. induscode/addons/manifest.py +232 -0
  10. induscode/addons/surface.py +199 -0
  11. induscode/boot/__init__.py +108 -0
  12. induscode/boot/auth_vault.py +323 -0
  13. induscode/boot/boot.py +210 -0
  14. induscode/boot/contract.py +223 -0
  15. induscode/boot/invocation.py +117 -0
  16. induscode/boot/runners/__init__.py +42 -0
  17. induscode/boot/runners/link_runner.py +82 -0
  18. induscode/boot/runners/oneshot_runner.py +85 -0
  19. induscode/boot/runners/registry.py +46 -0
  20. induscode/boot/runners/repl_runner.py +340 -0
  21. induscode/boot/runners/session.py +549 -0
  22. induscode/boot/stages.py +198 -0
  23. induscode/boot/upgrade/__init__.py +36 -0
  24. induscode/boot/upgrade/apply.py +125 -0
  25. induscode/boot/upgrade/upgrades.py +136 -0
  26. induscode/briefing/__init__.py +115 -0
  27. induscode/briefing/compose.py +414 -0
  28. induscode/briefing/contract.py +528 -0
  29. induscode/briefing/macros.py +721 -0
  30. induscode/briefing/skills.py +417 -0
  31. induscode/capability_deck/__init__.py +233 -0
  32. induscode/capability_deck/bridge_ledger/__init__.py +66 -0
  33. induscode/capability_deck/bridge_ledger/key.py +181 -0
  34. induscode/capability_deck/bridge_ledger/ledger.py +276 -0
  35. induscode/capability_deck/bridge_ledger/network.py +336 -0
  36. induscode/capability_deck/builtin_bridge.py +358 -0
  37. induscode/capability_deck/cards/__init__.py +116 -0
  38. induscode/capability_deck/cards/bg_process.py +482 -0
  39. induscode/capability_deck/cards/memory.py +226 -0
  40. induscode/capability_deck/cards/saas.py +280 -0
  41. induscode/capability_deck/cards/task.py +256 -0
  42. induscode/capability_deck/cards/todo.py +312 -0
  43. induscode/capability_deck/contract.py +450 -0
  44. induscode/capability_deck/manifest.py +126 -0
  45. induscode/capability_deck/provision.py +217 -0
  46. induscode/channels/__init__.py +146 -0
  47. induscode/channels/contract.py +585 -0
  48. induscode/channels/framer.py +132 -0
  49. induscode/channels/link/__init__.py +50 -0
  50. induscode/channels/link/dialog.py +246 -0
  51. induscode/channels/link/driver.py +308 -0
  52. induscode/channels/link/server.py +217 -0
  53. induscode/channels/oneshot.py +178 -0
  54. induscode/channels/ops.py +140 -0
  55. induscode/channels/session_ops.py +172 -0
  56. induscode/conductor/__init__.py +240 -0
  57. induscode/conductor/catalog.py +309 -0
  58. induscode/conductor/conductor.py +1084 -0
  59. induscode/conductor/contract.py +1035 -0
  60. induscode/conductor/matcher.py +291 -0
  61. induscode/conductor/serialize.py +575 -0
  62. induscode/conductor/signal_hub.py +382 -0
  63. induscode/conductor/skill_parse.py +294 -0
  64. induscode/conductor/transcript_store.py +449 -0
  65. induscode/console/__init__.py +236 -0
  66. induscode/console/app.py +1677 -0
  67. induscode/console/components/__init__.py +62 -0
  68. induscode/console/components/banner.py +499 -0
  69. induscode/console/components/banner_sweep.py +188 -0
  70. induscode/console/components/emblem.py +181 -0
  71. induscode/console/components/status_bar.py +102 -0
  72. induscode/console/contract.py +836 -0
  73. induscode/console/input/__init__.py +107 -0
  74. induscode/console/input/chord.py +197 -0
  75. induscode/console/input/dir_reader.py +113 -0
  76. induscode/console/input/intents.py +258 -0
  77. induscode/console/input/providers.py +469 -0
  78. induscode/console/mount.py +137 -0
  79. induscode/console/overlays/__init__.py +94 -0
  80. induscode/console/overlays/auth.py +503 -0
  81. induscode/console/overlays/pickers.py +526 -0
  82. induscode/console/overlays/router.py +129 -0
  83. induscode/console/overlays/sessions.py +232 -0
  84. induscode/console/reducer.py +145 -0
  85. induscode/console/resume_picker.py +156 -0
  86. induscode/console/slash_commands/__init__.py +78 -0
  87. induscode/console/slash_commands/builtins.py +254 -0
  88. induscode/console/slash_commands/dynamic.py +217 -0
  89. induscode/console/slash_commands/integrations.py +949 -0
  90. induscode/console/slash_commands/transcript.py +404 -0
  91. induscode/console/slash_commands/workbench.py +430 -0
  92. induscode/console/startup.py +434 -0
  93. induscode/console/theme/__init__.py +44 -0
  94. induscode/console/theme/adapter.py +168 -0
  95. induscode/console/theme/palette.py +128 -0
  96. induscode/console/theme/resolve.py +123 -0
  97. induscode/console/theme/tokens.py +185 -0
  98. induscode/console_slash/__init__.py +111 -0
  99. induscode/console_slash/contract.py +185 -0
  100. induscode/console_slash/registry.py +140 -0
  101. induscode/console_slash/resolve.py +194 -0
  102. induscode/console_slash/shared.py +172 -0
  103. induscode/entry.py +108 -0
  104. induscode/insight/__init__.py +153 -0
  105. induscode/insight/collector.py +73 -0
  106. induscode/insight/replay.py +305 -0
  107. induscode/insight/wrapper.py +1115 -0
  108. induscode/kit/__init__.py +82 -0
  109. induscode/kit/clipboard_image.py +215 -0
  110. induscode/kit/external_editor.py +120 -0
  111. induscode/kit/image.py +188 -0
  112. induscode/kit/shell.py +89 -0
  113. induscode/kit/tool_fetch.py +288 -0
  114. induscode/launch/__init__.py +224 -0
  115. induscode/launch/catalog.py +310 -0
  116. induscode/launch/contract.py +569 -0
  117. induscode/launch/credentials.py +852 -0
  118. induscode/launch/invocation/__init__.py +39 -0
  119. induscode/launch/invocation/attachments.py +281 -0
  120. induscode/launch/invocation/flags.py +210 -0
  121. induscode/launch/invocation/read.py +369 -0
  122. induscode/launch/invocation/usage.py +110 -0
  123. induscode/launch/oauth.py +808 -0
  124. induscode/launch/packages.py +299 -0
  125. induscode/launch/pickers.py +291 -0
  126. induscode/py.typed +0 -0
  127. induscode/runtime_bridge/__init__.py +166 -0
  128. induscode/runtime_bridge/bridges/__init__.py +66 -0
  129. induscode/runtime_bridge/bridges/_drive.py +268 -0
  130. induscode/runtime_bridge/bridges/builtins.py +177 -0
  131. induscode/runtime_bridge/bridges/claude_cli.py +198 -0
  132. induscode/runtime_bridge/bridges/codex_cli.py +203 -0
  133. induscode/runtime_bridge/bridges/indusagi_cli.py +217 -0
  134. induscode/runtime_bridge/broker.py +397 -0
  135. induscode/runtime_bridge/contract.py +734 -0
  136. induscode/runtime_bridge/sink.py +351 -0
  137. induscode/sessions/__init__.py +25 -0
  138. induscode/sessions/contract.py +119 -0
  139. induscode/sessions/library.py +350 -0
  140. induscode/settings/__init__.py +47 -0
  141. induscode/settings/contract.py +313 -0
  142. induscode/settings/manager.py +268 -0
  143. induscode/transcript_export/__init__.py +109 -0
  144. induscode/transcript_export/contract.py +522 -0
  145. induscode/transcript_export/publish.py +455 -0
  146. induscode/transcript_export/sgr.py +566 -0
  147. induscode/transcript_export/template.py +319 -0
  148. induscode/transcript_export/theme_bridge.py +325 -0
  149. induscode/window_budget/__init__.py +76 -0
  150. induscode/window_budget/budget/__init__.py +26 -0
  151. induscode/window_budget/budget/estimate.py +273 -0
  152. induscode/window_budget/budget/gate.py +60 -0
  153. induscode/window_budget/budget/slice.py +145 -0
  154. induscode/window_budget/condenser.py +170 -0
  155. induscode/window_budget/contract.py +329 -0
  156. induscode/window_budget/summarize/__init__.py +33 -0
  157. induscode/window_budget/summarize/condense.py +212 -0
  158. induscode/window_budget/summarize/prompt.py +241 -0
  159. induscode/workspace/__init__.py +30 -0
  160. induscode/workspace/brand.py +96 -0
  161. induscode/workspace/locator.py +269 -0
  162. induscode-0.1.0.dist-info/METADATA +97 -0
  163. induscode-0.1.0.dist-info/RECORD +167 -0
  164. induscode-0.1.0.dist-info/WHEEL +4 -0
  165. induscode-0.1.0.dist-info/entry_points.txt +3 -0
  166. induscode-0.1.0.dist-info/licenses/CREDITS.md +22 -0
  167. induscode-0.1.0.dist-info/licenses/NOTICE +7 -0
induscode/__init__.py ADDED
@@ -0,0 +1,56 @@
1
+ """induscode — terminal-first AI coding agent on the indusagi framework.
2
+
3
+ Python rebuild of the TS ``indusagi-coding-agent`` (lineage v0.1.62). This is
4
+ the namespace barrel — the analogue of the TS ``src/index.ts``, which
5
+ ``export * as <subsystem>``-s every subsystem package plus ``VERSION``.
6
+
7
+ Each subsystem is exposed as a *lazy* namespace attribute via PEP 562 module
8
+ ``__getattr__`` (mirroring the framework's ``indusagi/__init__.py``): ``import
9
+ induscode`` stays cheap and side-effect-free, and the Textual-heavy console
10
+ shell is only imported when ``induscode.console`` is first touched. The
11
+ terminal binary is ``entry.py`` (the ``indus`` / ``indusagi`` bin); this barrel
12
+ exists for embedding and testing.
13
+ """
14
+
15
+ from induscode.workspace import VERSION
16
+
17
+ #: Single-sourced from package metadata (see ``workspace/brand.py``).
18
+ __version__ = VERSION
19
+
20
+ #: Lazy namespace re-exports — the Python analogue of the TS ``src/index.ts``
21
+ #: ``export * as <name> from "./<dir>"`` block. Keyed by the public attribute
22
+ #: name (snake_case), valued by the subsystem package name under ``induscode``.
23
+ #: Lazy so ``import induscode`` does not eagerly pull the Textual console.
24
+ _SUBSYSTEMS = {
25
+ "workspace": "workspace",
26
+ "conductor": "conductor",
27
+ "runtime_bridge": "runtime_bridge",
28
+ "capability_deck": "capability_deck",
29
+ "addons": "addons",
30
+ "briefing": "briefing",
31
+ "insight": "insight",
32
+ "window_budget": "window_budget",
33
+ "transcript_export": "transcript_export",
34
+ "boot": "boot",
35
+ "launch": "launch",
36
+ "settings": "settings",
37
+ "sessions": "sessions",
38
+ "channels": "channels",
39
+ "console": "console",
40
+ "console_slash": "console_slash",
41
+ "kit": "kit",
42
+ }
43
+
44
+ __all__ = ["VERSION", "__version__", *sorted(_SUBSYSTEMS)]
45
+
46
+
47
+ def __getattr__(name: str): # PEP 562 lazy namespace re-exports
48
+ if name in _SUBSYSTEMS:
49
+ import importlib
50
+
51
+ return importlib.import_module(f"induscode.{_SUBSYSTEMS[name]}")
52
+ raise AttributeError(f"module 'induscode' has no attribute {name!r}")
53
+
54
+
55
+ def __dir__() -> list[str]:
56
+ return sorted([*globals(), *_SUBSYSTEMS])
@@ -0,0 +1,176 @@
1
+ """Addons subsystem — public barrel.
2
+
3
+ Re-exports the FROZEN third-party customization contract: the
4
+ :class:`AddonManifest` an addon module provides and the :class:`AddonSurface`
5
+ its ``register`` entry point receives, the colon-named :data:`HookEvent`
6
+ taxonomy with its observe/transform/gate :data:`HookHandler` middleware and
7
+ the :class:`EventDispatcher` that runs them, the tool-boundary
8
+ :class:`ToolInterceptor` stages and the :class:`InterceptorChain` pipeline
9
+ that folds them around a tool execution, the capabilities an addon
10
+ contributes (:data:`AddonTool`, :class:`AddonCommand`), the injectable
11
+ :class:`ModuleLoader` + :class:`AddonDiscovery` loading seam, and the typed
12
+ :class:`AddonFault`.
13
+
14
+ Behavior modules:
15
+
16
+ - ``loader`` — the importlib-backed :class:`ModuleLoader` (the TS jiti
17
+ sandbox collapses: Python addons are ``.py`` and ``import indusagi.*``
18
+ just works), plus the verbatim path-hygiene helpers
19
+ (:func:`scrub_invisible`, :func:`expand_path`, :func:`resolve_path`).
20
+ - ``manifest`` — scan a ``.indus/addons`` directory for entry modules
21
+ (``*.py`` files and packages holding ``__init__.py``) and fold an
22
+ :class:`AddonDiscovery` config into id-stamped :class:`AddonSource`
23
+ records.
24
+ - ``dispatch`` — the unified :class:`AddonEventDispatcher` (observe /
25
+ transform / gate) and the tool-boundary :class:`AddonInterceptorChain`,
26
+ plus the :func:`subscription` / :func:`interceptor` minters.
27
+ - ``surface`` — the per-addon recording :class:`AddonSurface` the host hands
28
+ to an addon's ``register``.
29
+ - ``host`` — the assembly point: discover + load (injectable loader),
30
+ register each addon against a fresh surface, fold every
31
+ :class:`RegisteredManifest` into one registry, and wire the dispatch
32
+ engine + interceptor chain + collected commands/tools.
33
+
34
+ Consumers import the addon surface from ``induscode.addons`` rather than
35
+ reaching into individual modules.
36
+ """
37
+
38
+ from __future__ import annotations
39
+
40
+ from .contract import (
41
+ ADDONS_DIR,
42
+ BUNDLED_NAMESPACES,
43
+ AddonCommand,
44
+ AddonDiscovery,
45
+ AddonFault,
46
+ AddonFaultKind,
47
+ AddonFaultListener,
48
+ AddonId,
49
+ AddonManifest,
50
+ AddonSource,
51
+ AddonSurface,
52
+ AddonTool,
53
+ AgentMessage,
54
+ AgentTool,
55
+ AgentToolResult,
56
+ ArgsRewrite,
57
+ BundledNamespace,
58
+ CommandContext,
59
+ CommandRun,
60
+ CommandSpec,
61
+ Component,
62
+ DispatchOutcome,
63
+ EnterFn,
64
+ EnterOutcome,
65
+ EventDispatcher,
66
+ EventSubscription,
67
+ ExecOutcome,
68
+ ExecuteFn,
69
+ ExitFn,
70
+ ExitOutcome,
71
+ FrameworkHandles,
72
+ GateDecision,
73
+ GateHandler,
74
+ HookEvent,
75
+ HookHandler,
76
+ HookKind,
77
+ InterceptorChain,
78
+ InterceptorStage,
79
+ InterceptResult,
80
+ KeyId,
81
+ Model,
82
+ ModuleLoader,
83
+ ObserveHandler,
84
+ RegisteredManifest,
85
+ Schema,
86
+ ThinkingLevel,
87
+ ToolEnterContext,
88
+ ToolExitContext,
89
+ ToolInterceptor,
90
+ TransformHandler,
91
+ addon_fault,
92
+ addon_id,
93
+ empty_manifest,
94
+ )
95
+ from .dispatch import (
96
+ AddonEventDispatcher,
97
+ AddonInterceptorChain,
98
+ interceptor,
99
+ subscription,
100
+ )
101
+ from .host import AddonHost, AddonRegistry, AddonSurfaceBundle, create_addon_host
102
+ from .loader import create_module_loader, expand_path, resolve_path, scrub_invisible
103
+ from .manifest import discover_addons, discover_sources
104
+ from .surface import RecordingSurface, create_surface
105
+
106
+ __all__ = [
107
+ "ADDONS_DIR",
108
+ "AddonCommand",
109
+ "AddonDiscovery",
110
+ "AddonEventDispatcher",
111
+ "AddonFault",
112
+ "AddonFaultKind",
113
+ "AddonFaultListener",
114
+ "AddonHost",
115
+ "AddonId",
116
+ "AddonInterceptorChain",
117
+ "AddonManifest",
118
+ "AddonRegistry",
119
+ "AddonSource",
120
+ "AddonSurface",
121
+ "AddonSurfaceBundle",
122
+ "AddonTool",
123
+ "AgentMessage",
124
+ "AgentTool",
125
+ "AgentToolResult",
126
+ "ArgsRewrite",
127
+ "BUNDLED_NAMESPACES",
128
+ "BundledNamespace",
129
+ "CommandContext",
130
+ "CommandRun",
131
+ "CommandSpec",
132
+ "Component",
133
+ "DispatchOutcome",
134
+ "EnterFn",
135
+ "EnterOutcome",
136
+ "EventDispatcher",
137
+ "EventSubscription",
138
+ "ExecOutcome",
139
+ "ExecuteFn",
140
+ "ExitFn",
141
+ "ExitOutcome",
142
+ "FrameworkHandles",
143
+ "GateDecision",
144
+ "GateHandler",
145
+ "HookEvent",
146
+ "HookHandler",
147
+ "HookKind",
148
+ "InterceptResult",
149
+ "InterceptorChain",
150
+ "InterceptorStage",
151
+ "KeyId",
152
+ "Model",
153
+ "ModuleLoader",
154
+ "ObserveHandler",
155
+ "RecordingSurface",
156
+ "RegisteredManifest",
157
+ "Schema",
158
+ "ThinkingLevel",
159
+ "ToolEnterContext",
160
+ "ToolExitContext",
161
+ "ToolInterceptor",
162
+ "TransformHandler",
163
+ "addon_fault",
164
+ "addon_id",
165
+ "create_addon_host",
166
+ "create_module_loader",
167
+ "create_surface",
168
+ "discover_addons",
169
+ "discover_sources",
170
+ "empty_manifest",
171
+ "expand_path",
172
+ "interceptor",
173
+ "resolve_path",
174
+ "scrub_invisible",
175
+ "subscription",
176
+ ]