@noorm/marie-cli 0.1.0

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 (193) hide show
  1. package/JOY_ZONING.md +200 -0
  2. package/LICENSE.md +190 -0
  3. package/README.md +94 -0
  4. package/dist/cli-new/components/App.js +138 -0
  5. package/dist/cli-new/components/App.js.map +1 -0
  6. package/dist/cli-new/components/ApprovalDialog.js +31 -0
  7. package/dist/cli-new/components/ApprovalDialog.js.map +1 -0
  8. package/dist/cli-new/components/Banner.js +23 -0
  9. package/dist/cli-new/components/Banner.js.map +1 -0
  10. package/dist/cli-new/components/ChatArea.js +49 -0
  11. package/dist/cli-new/components/ChatArea.js.map +1 -0
  12. package/dist/cli-new/components/Header.js +20 -0
  13. package/dist/cli-new/components/Header.js.map +1 -0
  14. package/dist/cli-new/components/InputArea.js +97 -0
  15. package/dist/cli-new/components/InputArea.js.map +1 -0
  16. package/dist/cli-new/components/MessageBubble.js +114 -0
  17. package/dist/cli-new/components/MessageBubble.js.map +1 -0
  18. package/dist/cli-new/components/SessionSwitcher.js +46 -0
  19. package/dist/cli-new/components/SessionSwitcher.js.map +1 -0
  20. package/dist/cli-new/components/SetupWizard.js +283 -0
  21. package/dist/cli-new/components/SetupWizard.js.map +1 -0
  22. package/dist/cli-new/components/ToolCallDisplay.js +45 -0
  23. package/dist/cli-new/components/ToolCallDisplay.js.map +1 -0
  24. package/dist/cli-new/hooks/useGit.js +99 -0
  25. package/dist/cli-new/hooks/useGit.js.map +1 -0
  26. package/dist/cli-new/hooks/useMarie.js +249 -0
  27. package/dist/cli-new/hooks/useMarie.js.map +1 -0
  28. package/dist/cli-new/hooks/useSessions.js +75 -0
  29. package/dist/cli-new/hooks/useSessions.js.map +1 -0
  30. package/dist/cli-new/index.js +52 -0
  31. package/dist/cli-new/index.js.map +1 -0
  32. package/dist/cli-new/styles/theme.js +68 -0
  33. package/dist/cli-new/styles/theme.js.map +1 -0
  34. package/dist/cli-new/types/cli.js +2 -0
  35. package/dist/cli-new/types/cli.js.map +1 -0
  36. package/dist/extension.cjs +655 -0
  37. package/dist/monolith/adapters/CliMarieAdapter.js +72 -0
  38. package/dist/monolith/adapters/CliMarieAdapter.js.map +1 -0
  39. package/dist/monolith/adapters/VscodeMarieAdapter.js +81 -0
  40. package/dist/monolith/adapters/VscodeMarieAdapter.js.map +1 -0
  41. package/dist/monolith/cli/CliFileSystemPort.js +83 -0
  42. package/dist/monolith/cli/CliFileSystemPort.js.map +1 -0
  43. package/dist/monolith/cli/MarieToolDefinitionsCLI.js +438 -0
  44. package/dist/monolith/cli/MarieToolDefinitionsCLI.js.map +1 -0
  45. package/dist/monolith/cli/index.js +272 -0
  46. package/dist/monolith/cli/index.js.map +1 -0
  47. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js +80 -0
  48. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js.map +1 -0
  49. package/dist/monolith/cli/services/JoyServiceCLI.js +63 -0
  50. package/dist/monolith/cli/services/JoyServiceCLI.js.map +1 -0
  51. package/dist/monolith/cli/storage.js +119 -0
  52. package/dist/monolith/cli/storage.js.map +1 -0
  53. package/dist/monolith/domain/joy/JoyTools.js +513 -0
  54. package/dist/monolith/domain/joy/JoyTools.js.map +1 -0
  55. package/dist/monolith/domain/joy/RitualService.js +51 -0
  56. package/dist/monolith/domain/joy/RitualService.js.map +1 -0
  57. package/dist/monolith/domain/marie/MarieTypes.js +2 -0
  58. package/dist/monolith/domain/marie/MarieTypes.js.map +1 -0
  59. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js +230 -0
  60. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js.map +1 -0
  61. package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js +207 -0
  62. package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js.map +1 -0
  63. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js +129 -0
  64. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js.map +1 -0
  65. package/dist/monolith/infrastructure/ai/context/ContextManager.js +118 -0
  66. package/dist/monolith/infrastructure/ai/context/ContextManager.js.map +1 -0
  67. package/dist/monolith/infrastructure/ai/core/FileSystemPort.js +2 -0
  68. package/dist/monolith/infrastructure/ai/core/FileSystemPort.js.map +1 -0
  69. package/dist/monolith/infrastructure/ai/core/GhostPort.js +2 -0
  70. package/dist/monolith/infrastructure/ai/core/GhostPort.js.map +1 -0
  71. package/dist/monolith/infrastructure/ai/core/MarieAscensionTypes.js +2 -0
  72. package/dist/monolith/infrastructure/ai/core/MarieAscensionTypes.js.map +1 -0
  73. package/dist/monolith/infrastructure/ai/core/MarieEngine.js +590 -0
  74. package/dist/monolith/infrastructure/ai/core/MarieEngine.js.map +1 -0
  75. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js +161 -0
  76. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js.map +1 -0
  77. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js +121 -0
  78. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js.map +1 -0
  79. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js +256 -0
  80. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js.map +1 -0
  81. package/dist/monolith/infrastructure/ai/core/MariePulseService.js +67 -0
  82. package/dist/monolith/infrastructure/ai/core/MariePulseService.js.map +1 -0
  83. package/dist/monolith/infrastructure/ai/core/MarieResponse.js +101 -0
  84. package/dist/monolith/infrastructure/ai/core/MarieResponse.js.map +1 -0
  85. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js +86 -0
  86. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js.map +1 -0
  87. package/dist/monolith/infrastructure/ai/core/MarieSession.js +202 -0
  88. package/dist/monolith/infrastructure/ai/core/MarieSession.js.map +1 -0
  89. package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js +58 -0
  90. package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js.map +1 -0
  91. package/dist/monolith/infrastructure/ai/core/MarieToolMender.js +127 -0
  92. package/dist/monolith/infrastructure/ai/core/MarieToolMender.js.map +1 -0
  93. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js +548 -0
  94. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js.map +1 -0
  95. package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js +2 -0
  96. package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js.map +1 -0
  97. package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js +125 -0
  98. package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js.map +1 -0
  99. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js +30 -0
  100. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js.map +1 -0
  101. package/dist/monolith/infrastructure/ai/providers/AIProvider.js +2 -0
  102. package/dist/monolith/infrastructure/ai/providers/AIProvider.js.map +1 -0
  103. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js +148 -0
  104. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js.map +1 -0
  105. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js +208 -0
  106. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js.map +1 -0
  107. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js +404 -0
  108. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js.map +1 -0
  109. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js +283 -0
  110. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js.map +1 -0
  111. package/dist/monolith/infrastructure/config/ConfigService.js +398 -0
  112. package/dist/monolith/infrastructure/config/ConfigService.js.map +1 -0
  113. package/dist/monolith/infrastructure/services/MarieMemoryStore.js +140 -0
  114. package/dist/monolith/infrastructure/services/MarieMemoryStore.js.map +1 -0
  115. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js +1568 -0
  116. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js.map +1 -0
  117. package/dist/monolith/infrastructure/tools/PureStreamParser.js +147 -0
  118. package/dist/monolith/infrastructure/tools/PureStreamParser.js.map +1 -0
  119. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js +223 -0
  120. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js.map +1 -0
  121. package/dist/monolith/infrastructure/tools/ToolRegistry.js +29 -0
  122. package/dist/monolith/infrastructure/tools/ToolRegistry.js.map +1 -0
  123. package/dist/monolith/infrastructure/tools/ToolUtils.js +59 -0
  124. package/dist/monolith/infrastructure/tools/ToolUtils.js.map +1 -0
  125. package/dist/monolith/plumbing/analysis/CodeHealthService.js +146 -0
  126. package/dist/monolith/plumbing/analysis/CodeHealthService.js.map +1 -0
  127. package/dist/monolith/plumbing/analysis/ComplexityService.js +43 -0
  128. package/dist/monolith/plumbing/analysis/ComplexityService.js.map +1 -0
  129. package/dist/monolith/plumbing/analysis/DependencyService.js +51 -0
  130. package/dist/monolith/plumbing/analysis/DependencyService.js.map +1 -0
  131. package/dist/monolith/plumbing/analysis/DiscoveryService.js +49 -0
  132. package/dist/monolith/plumbing/analysis/DiscoveryService.js.map +1 -0
  133. package/dist/monolith/plumbing/analysis/JoyMapService.js +66 -0
  134. package/dist/monolith/plumbing/analysis/JoyMapService.js.map +1 -0
  135. package/dist/monolith/plumbing/analysis/LintService.js +132 -0
  136. package/dist/monolith/plumbing/analysis/LintService.js.map +1 -0
  137. package/dist/monolith/plumbing/analysis/MarieSentinelService.js +276 -0
  138. package/dist/monolith/plumbing/analysis/MarieSentinelService.js.map +1 -0
  139. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js +119 -0
  140. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js.map +1 -0
  141. package/dist/monolith/plumbing/analysis/SurgicalMender.js +70 -0
  142. package/dist/monolith/plumbing/analysis/SurgicalMender.js.map +1 -0
  143. package/dist/monolith/plumbing/analysis/TestService.js +104 -0
  144. package/dist/monolith/plumbing/analysis/TestService.js.map +1 -0
  145. package/dist/monolith/plumbing/filesystem/FileService.js +406 -0
  146. package/dist/monolith/plumbing/filesystem/FileService.js.map +1 -0
  147. package/dist/monolith/plumbing/filesystem/PathResolver.js +26 -0
  148. package/dist/monolith/plumbing/filesystem/PathResolver.js.map +1 -0
  149. package/dist/monolith/plumbing/git/GitService.js +71 -0
  150. package/dist/monolith/plumbing/git/GitService.js.map +1 -0
  151. package/dist/monolith/plumbing/lsp/SymbolService.js +36 -0
  152. package/dist/monolith/plumbing/lsp/SymbolService.js.map +1 -0
  153. package/dist/monolith/plumbing/terminal/ProcessRegistry.js +31 -0
  154. package/dist/monolith/plumbing/terminal/ProcessRegistry.js.map +1 -0
  155. package/dist/monolith/plumbing/terminal/TerminalService.js +180 -0
  156. package/dist/monolith/plumbing/terminal/TerminalService.js.map +1 -0
  157. package/dist/monolith/plumbing/ui/DecorationService.js +54 -0
  158. package/dist/monolith/plumbing/ui/DecorationService.js.map +1 -0
  159. package/dist/monolith/plumbing/utils/ErrorUtils.js +11 -0
  160. package/dist/monolith/plumbing/utils/ErrorUtils.js.map +1 -0
  161. package/dist/monolith/plumbing/utils/JsonUtils.js +360 -0
  162. package/dist/monolith/plumbing/utils/JsonUtils.js.map +1 -0
  163. package/dist/monolith/plumbing/utils/PrefixTree.js +153 -0
  164. package/dist/monolith/plumbing/utils/PrefixTree.js.map +1 -0
  165. package/dist/monolith/plumbing/utils/RetryUtils.js +141 -0
  166. package/dist/monolith/plumbing/utils/RetryUtils.js.map +1 -0
  167. package/dist/monolith/plumbing/utils/StreamTagDetector.js +128 -0
  168. package/dist/monolith/plumbing/utils/StreamTagDetector.js.map +1 -0
  169. package/dist/monolith/plumbing/utils/StringUtils.js +97 -0
  170. package/dist/monolith/plumbing/utils/StringUtils.js.map +1 -0
  171. package/dist/monolith/plumbing/utils/TimeoutUtils.js +21 -0
  172. package/dist/monolith/plumbing/utils/TimeoutUtils.js.map +1 -0
  173. package/dist/monolith/runtime/MarieRuntime.js +354 -0
  174. package/dist/monolith/runtime/MarieRuntime.js.map +1 -0
  175. package/dist/monolith/runtime/RuntimeAdapterBase.js +59 -0
  176. package/dist/monolith/runtime/RuntimeAdapterBase.js.map +1 -0
  177. package/dist/monolith/runtime/providerFactory.js +11 -0
  178. package/dist/monolith/runtime/providerFactory.js.map +1 -0
  179. package/dist/monolith/runtime/types.js +2 -0
  180. package/dist/monolith/runtime/types.js.map +1 -0
  181. package/dist/monolith/services/HealthService.js +38 -0
  182. package/dist/monolith/services/HealthService.js.map +1 -0
  183. package/dist/monolith/services/JoyAutomationService.js +131 -0
  184. package/dist/monolith/services/JoyAutomationService.js.map +1 -0
  185. package/dist/monolith/services/JoyLogService.js +48 -0
  186. package/dist/monolith/services/JoyLogService.js.map +1 -0
  187. package/dist/monolith/services/JoyService.js +190 -0
  188. package/dist/monolith/services/JoyService.js.map +1 -0
  189. package/dist/monolith/services/MarieGhostService.js +168 -0
  190. package/dist/monolith/services/MarieGhostService.js.map +1 -0
  191. package/dist/monolith/services/MarieSCMProvider.js +41 -0
  192. package/dist/monolith/services/MarieSCMProvider.js.map +1 -0
  193. package/package.json +168 -0
package/JOY_ZONING.md ADDED
@@ -0,0 +1,200 @@
1
+ # Joy Zoning Protocol 🌸 (v5)
2
+
3
+ Non-joyful code is not a moral failure.
4
+ It is often necessary infrastructure, transitional work, or support plumbing.
5
+
6
+ Joy Zoning exists to protect clarity, reduce cognitive load, and preserve creative space.
7
+ The goal is containment—not shame.
8
+
9
+ ## The Core Principle
10
+
11
+ **All code has a home.**
12
+ Code without a home becomes clutter.
13
+
14
+ We do not delete necessary complexity.
15
+ We name it, place it, and limit its spread.
16
+
17
+ ## The Prime Directive
18
+
19
+ **Joyful zones must be defended.**
20
+ **Non-joyful zones must be honest.**
21
+
22
+ This protocol optimizes for long-term human comprehension, not short-term velocity.
23
+
24
+ ## Zones (with Intent)
25
+
26
+ ### 1. Joyful Code ✨
27
+
28
+ * **Purpose**: Expression and meaning
29
+ * **Question**: Is this the reason the system exists?
30
+ * **Location**: `src/domain/`, core application flows
31
+
32
+ **Characteristics**:
33
+ * Expressive
34
+ * Intentional
35
+ * Readable
36
+
37
+ **Constraints**:
38
+ * No adapters
39
+ * No glue
40
+ * No “just in case” logic
41
+ * No environment awareness
42
+ * No orchestration logic
43
+ * **Protected Zone**: Complexity must justify its presence
44
+
45
+ *Joyful code is where humans think. Guard it fiercely.*
46
+
47
+ ### 2. Infrastructure 🏗️
48
+
49
+ * **Purpose**: Stability and coordination
50
+ * **Question**: Does this absorb complexity so the system stays calm?
51
+ * **Location**: `src/infrastructure/`
52
+
53
+ **Characteristics**:
54
+ * Heavy
55
+ * Necessary
56
+ * Emotionally flat
57
+
58
+ **Examples**:
59
+ * Config loaders
60
+ * AI clients
61
+ * Registries
62
+ * State bridges
63
+ * Dependency wiring
64
+
65
+ **Constraints**:
66
+ * Must terminate complexity
67
+ * Must not leak abstractions upward
68
+ * Must be replaceable without touching domain logic
69
+ * Should be boring to read
70
+
71
+ *Infrastructure exists so joyful code doesn’t have to care.*
72
+
73
+ ### 3. Plumbing 🔧
74
+
75
+ * **Purpose**: Mechanical execution
76
+ * **Question**: Is this unavoidable work best treated as machinery?
77
+ * **Location**: `src/plumbing/`
78
+
79
+ **Characteristics**:
80
+ * Low-level
81
+ * Mechanical
82
+ * Replaceable
83
+
84
+ **Examples**:
85
+ * Filesystem I/O
86
+ * Git wrappers
87
+ * Shell execution
88
+ * Static analysis primitives
89
+
90
+ **Constraints**:
91
+ * Explicit boundaries
92
+ * Minimal surface area
93
+ * No domain knowledge
94
+ * No opinionated logic
95
+ * No lifecycle awareness
96
+
97
+ *Plumbing is respected, but never romanticized.*
98
+
99
+ ## Dependency Law (Hard Rule) 📐
100
+
101
+ Dependencies may only flow downward.
102
+
103
+ | From \ To | Joyful | Infrastructure | Plumbing |
104
+ | :--- | :---: | :---: | :---: |
105
+ | **Joyful** | ✅ | ✅ | ❌ |
106
+ | **Infrastructure** | ❌ | ✅ | ✅ |
107
+ | **Plumbing** | ❌ | ❌ | ✅ |
108
+
109
+ **Rule**: If you violate this table, zoning has failed.
110
+ This rule exists to prevent conceptual backflow.
111
+
112
+ ## Project Formation Rule 🧱
113
+
114
+ There are no generic buckets.
115
+
116
+ ❌ `utils.ts`
117
+ ❌ `helpers/`
118
+
119
+ ✅ `filesystem/`
120
+ ✅ `analysis/`
121
+ ✅ `formatting/`
122
+
123
+ Every file belongs to a **Project** that explains what responsibility it owns.
124
+ If you cannot name the project, the code is not ready to exist.
125
+
126
+ ## Lifecycle & Movement
127
+
128
+ Code is allowed—and expected—to move.
129
+
130
+ 1. **Sprout → Joyful**: When intent becomes legible.
131
+ 2. **Joyful → Infrastructure**: When patterns stabilize and repetition appears.
132
+ 3. **Infrastructure → Plumbing**: When logic becomes mechanical or commoditized.
133
+ 4. **Any → Compost**: When obsolete. Trust version control.
134
+
135
+ *Movement is maturity, not failure.*
136
+
137
+ ## Pressure Valves 🔋
138
+
139
+ Pressure valves allow temporary disorder without dishonesty.
140
+
141
+ **Allowed**:
142
+ * Flat files
143
+ * TODOs with intent
144
+ * Unzoned drafts
145
+
146
+ **Rules**:
147
+ 1. Must be acknowledged.
148
+ 2. Must answer: “Where does this belong once it settles?”
149
+ 3. Are not permanent homes.
150
+
151
+ *Pressure valves prevent premature abstraction and false cleanliness.*
152
+
153
+ ## Agent & Automation Contract 🤖
154
+
155
+ When AI agents or automated tools interact with this codebase:
156
+ * Agents may observe and suggest, never enforce.
157
+ * Agents may flag heaviness, never moralize.
158
+ * Agents must prefer containment over refactor.
159
+ * Agents must not invent zones, projects, or abstractions without human approval.
160
+ * Agents must never optimize for “elegance” over placement.
161
+
162
+ *Agents assist judgment. They do not replace it.*
163
+
164
+ ## Review & Maintenance Cadence (NEW) 📅
165
+
166
+ Joy Zoning is enforced continuously, lightly.
167
+
168
+ * **During development**: Ask “Where does this belong?”
169
+ * **During review**: Ask “Is this carrying the right amount of meaning?”
170
+ * **Periodically**: Relocate, don’t redesign.
171
+
172
+ *There are no “zoning sprints.” Tidying is part of normal work.*
173
+
174
+ ## Reviewer Heuristics (Fast Checks)
175
+
176
+ * “Why does this live here?”
177
+ * “What zone would this fall into if it grew 3×?”
178
+ * “Is this protecting joyful code—or polluting it?”
179
+ * “Is this doing thinking it shouldn’t be doing?”
180
+
181
+ *If the answer feels fuzzy, pause. Do not invent abstractions to escape discomfort.*
182
+
183
+ ## Failure Conditions (Explicit) 🚨
184
+
185
+ Joy Zoning has failed if it:
186
+ 1. Becomes a gatekeeping tool.
187
+ 2. Encourages hiding work.
188
+ 3. Replaces judgment with ritual.
189
+ 4. Rewards cleverness over clarity.
190
+ 5. Lets agents override humans.
191
+
192
+ *When this happens, simplify the protocol, not the people.*
193
+
194
+ ## Final Safeguard
195
+
196
+ This protocol exists to reduce suffering, not to increase purity.
197
+
198
+ Clarity is the goal.
199
+ Joy is the signal.
200
+ Humans are the authority.
package/LICENSE.md ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Marie
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # Marie: The Sovereign AI Architecture 🌸
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/marie-cli.svg?style=flat-square&color=FF69B4)](https://www.npmjs.com/package/marie-cli)
4
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=flat-square)](LICENSE.md)
5
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
6
+
7
+ > "Engineering is a ritual of meaning. We are not merely deploying tools; we are constructing the Integrated Bridge for the era of Technical Sovereignty. Marie is the guardian of your creative essence, the silent architect of your Joy."
8
+
9
+ Marie is a high-fidelity, autonomous AI coding agent designed for developers who demand both raw performance and architectural elegance. Engineered on the principles of the **Joy Zoning Protocol**, Marie orchestrates the transition from chaotic complexity to disciplined focus, ensuring your creative spirit remains unburdened by the weight of infrastructure.
10
+
11
+ ---
12
+
13
+ ## 🏛️ The Vision: Technical Sovereignty
14
+
15
+ In an industry saturated with ephemeral utilities, Marie represents a return to **Sovereignty**. She operates on the conviction that every line of code must have a home, and every developer must have the space to think. Marie doesn't just automate; she *converges* with your intent, powered by a sophisticated engine that monitors "Spirit Pressure" and "Heroic Vows."
16
+
17
+ ### The Joy Zoning Philosophy
18
+ Marie adheres to a rigorous three-tier architectural hierarchy to protect your cognitive flow:
19
+ * **Joyful Code ✨**: The domain of pure expression and tactical meaning.
20
+ * **Infrastructure 🏗️**: The coordination layer that stabilizes the system's pulse.
21
+ * **Plumbing 🔧**: The mechanical execution primitives that remain invisible.
22
+
23
+ ---
24
+
25
+ ## 🛰️ Two Interfaces. One Unified Intelligence.
26
+
27
+ ### 1. The Command Deck (CLI)
28
+ A reactive, high-velocity terminal interface built for the kinetic energy of modern engineering.
29
+ * **Real-time Reasoning**: Witness the internal monologue of the agent as she navigates your codebase.
30
+ * **Setup Wizard**: A seamless, zero-config onboarding experience that respects your time.
31
+ * **Kinetic Velocity**: Optimized for rapid-fire iterations and terminal-native workflows.
32
+
33
+ ### 2. The Integrated Bridge (VS Code)
34
+ A deep, spatial integration into your primary development environment.
35
+ * **Contextual Anchoring**: Marie maintains a durable strategic map of your architecture.
36
+ * **Autonomy Calibration**: Orchestrate the agent's agency—from `Balanced` collaboration to `High-Autonomy` execution.
37
+ * **Webview Mastery**: A premium, responsive UI that feels like a natural extension of the editor.
38
+
39
+ ---
40
+
41
+ ## ⚡ The Ascension Engine: Mechanics of Conviction
42
+
43
+ Marie's performance is driven by the **Ascension Protocol**, a state-machine that calibrates agency based on systemic confidence:
44
+
45
+ * **Awakened State (Ultra Instinct)**: Achieved through peak conviction, Marie gains full codebase sovereignty to execute complex, multi-file transformations with surgical precision.
46
+ * **Zenith Autonomy**: Proactive roadmap expansion and context anchoring. If a challenge evolves, Marie's strategy evolves with it.
47
+ * **Self-Healing Resilience**: Autonomous detection and repair of lint regressions or architectural instabilities.
48
+
49
+ ---
50
+
51
+ ## 🚀 Rapid Deployment
52
+
53
+ ### Installation via NPM
54
+
55
+ ```bash
56
+ # Global installation for universal sovereignty
57
+ npm install -g marie-cli
58
+ ```
59
+
60
+ ### Direct Invocation
61
+
62
+ ```bash
63
+ # Launch the Command Deck
64
+ marie
65
+ ```
66
+
67
+ ### Configuration
68
+
69
+ Marie retrieves credentials from your environment or her secure registry at `~/.marie/config.json`.
70
+
71
+ ```bash
72
+ export ANTHROPIC_API_KEY=your_key_here
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 💠 Technical Foundations
78
+
79
+ Marie is built on a resilient, provider-agnostic core, allowing you to choose the "Spirit" that fuels your build:
80
+ - **Anthropic (Claude 3.5 Sonnet)**: The pinnacle of reasoned execution.
81
+ - **OpenRouter**: Access to a distributed swarm of specialized models.
82
+ - **Cerebras**: Sub-second Llama-powered execution for high-velocity tasks.
83
+
84
+ ---
85
+
86
+ ## 🤝 Join the Convergence
87
+
88
+ Marie is more than an agent; she is an invitation to a more intentional way of building. We are reclaiming the joy of engineering, one file at a time.
89
+
90
+ **Welcome to the Sovereign Era. Welcome to Marie.**
91
+
92
+ ---
93
+ *License: Apache-2.0*
94
+ *Crafted with precision by [CardSorting](https://github.com/CardSorting)*
@@ -0,0 +1,138 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useState, useCallback } from "react";
3
+ import { Box, useApp, useInput, Text, useStdout } from "ink";
4
+ import { Header } from "./Header.js";
5
+ import { ChatArea } from "./ChatArea.js";
6
+ import { InputArea } from "./InputArea.js";
7
+ import { SessionSwitcher } from "./SessionSwitcher.js";
8
+ import { ApprovalDialog } from "./ApprovalDialog.js";
9
+ import { useMarie } from "../hooks/useMarie.js";
10
+ import { useSessions } from "../hooks/useSessions.js";
11
+ import { useGit } from "../hooks/useGit.js";
12
+ import { marieTheme } from "../styles/theme.js";
13
+ import { Storage } from "../../monolith/cli/storage.js";
14
+ import { SetupWizard } from "./SetupWizard.js";
15
+ import { Banner } from "./Banner.js";
16
+ export const App = ({ workingDir }) => {
17
+ const { exit } = useApp();
18
+ const [viewMode, setViewMode] = useState("chat");
19
+ const [showSetup, setShowSetup] = useState(false);
20
+ // Core hooks
21
+ const { messages, isLoading, streamingState, pendingApproval, runElapsedMs, sendMessage, stopGeneration, createSession, loadSession, clearSession, marie, } = useMarie({ workingDir });
22
+ const { sessions, currentSessionId, createSession: createNewSession, switchSession, deleteSession, renameSession, togglePinSession, } = useSessions({ marie });
23
+ const { gitStatus, createCheckpoint, undoLastCommit } = useGit({
24
+ workingDir,
25
+ });
26
+ // Get current session title
27
+ const currentSession = sessions.find((s) => s.id === currentSessionId);
28
+ const sessionTitle = currentSession?.title || "New Session";
29
+ // Command handlers
30
+ const handleCommand = useCallback(async (command) => {
31
+ const [cmd, ...args] = command.slice(1).split(" ");
32
+ switch (cmd.toLowerCase()) {
33
+ case "help":
34
+ // Help is shown via input suggestions
35
+ break;
36
+ case "clear":
37
+ await clearSession();
38
+ break;
39
+ case "new":
40
+ await createNewSession();
41
+ break;
42
+ case "sessions":
43
+ setViewMode("sessions");
44
+ break;
45
+ case "exit":
46
+ case "quit":
47
+ exit();
48
+ break;
49
+ case "checkpoint": {
50
+ const checkpointMsg = args.join(" ") || undefined;
51
+ const commit = await createCheckpoint(checkpointMsg);
52
+ if (commit) {
53
+ // Show success message
54
+ }
55
+ break;
56
+ }
57
+ case "undo": {
58
+ const result = await undoLastCommit();
59
+ if (!result.success) {
60
+ // Show error
61
+ }
62
+ break;
63
+ }
64
+ case "autonomy": {
65
+ const level = (args[0] || "").toLowerCase();
66
+ if (level === "balanced" ||
67
+ level === "high" ||
68
+ level === "ascension") {
69
+ Storage.saveConfig({
70
+ autonomyMode: level,
71
+ });
72
+ }
73
+ break;
74
+ }
75
+ case "config":
76
+ setShowSetup(true);
77
+ break;
78
+ default:
79
+ // Unknown command
80
+ break;
81
+ }
82
+ }, [
83
+ clearSession,
84
+ createNewSession,
85
+ setViewMode,
86
+ exit,
87
+ createCheckpoint,
88
+ undoLastCommit,
89
+ ]);
90
+ const handleSubmit = useCallback(async (value) => {
91
+ if (value.startsWith("/")) {
92
+ await handleCommand(value);
93
+ }
94
+ else {
95
+ await sendMessage(value);
96
+ }
97
+ }, [handleCommand, sendMessage]);
98
+ // Keyboard shortcuts
99
+ useInput((input, key) => {
100
+ if (key.ctrl && input === "c") {
101
+ if (isLoading) {
102
+ stopGeneration();
103
+ }
104
+ else {
105
+ exit();
106
+ }
107
+ }
108
+ else if (key.ctrl && input === "s") {
109
+ setViewMode(viewMode === "sessions" ? "chat" : "sessions");
110
+ }
111
+ else if (key.ctrl && input === "n") {
112
+ createNewSession();
113
+ }
114
+ });
115
+ // Get current model + autonomy mode
116
+ const config = Storage.getConfig();
117
+ const model = config.model || "claude-3-5-sonnet-20241022";
118
+ const autonomyMode = config.autonomyMode ||
119
+ (config.requireApproval === false ? "high" : "balanced");
120
+ // Show setup wizard when requested
121
+ if (showSetup) {
122
+ return React.createElement(SetupWizard, {
123
+ onComplete: () => setShowSetup(false),
124
+ });
125
+ }
126
+ if (viewMode === "sessions") {
127
+ return (_jsx(SessionSwitcher, { sessions: sessions, currentSessionId: currentSessionId, onSelect: (id) => {
128
+ switchSession(id);
129
+ setViewMode("chat");
130
+ }, onCreate: () => {
131
+ createNewSession();
132
+ setViewMode("chat");
133
+ }, onDelete: deleteSession, onRename: renameSession, onTogglePin: togglePinSession, onClose: () => setViewMode("chat") }));
134
+ }
135
+ const { stdout } = useStdout();
136
+ return (_jsxs(Box, { flexDirection: "column", height: stdout?.rows || 24, children: [_jsx(Header, { model: model, sessionTitle: sessionTitle, gitStatus: gitStatus || undefined, isLoading: isLoading, elapsedMs: runElapsedMs, autonomyMode: autonomyMode }), pendingApproval && _jsx(ApprovalDialog, { request: pendingApproval }), messages.length === 0 && !isLoading && _jsx(Banner, {}), _jsx(ChatArea, { messages: messages, streamingState: streamingState }), _jsx(InputArea, { onSubmit: handleSubmit, isLoading: isLoading }), _jsx(Box, { marginTop: 0, children: _jsx(Text, { color: marieTheme.colors.muted, dimColor: true, italic: true, children: "Ctrl+C Cancel \u2022 Ctrl+S Sessions \u2022 Ctrl+N New \u2022 /autonomy [balanced|high|ascension] \u2022 /config Settings \u2022 /help" }) })] }));
137
+ };
138
+ //# sourceMappingURL=App.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../../../src/c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,EACD,QAAQ,EAAE,GAAG,EAAE;gBACb,gBAAgB,EAAE,CAAC;gBACnB,WAAW,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC,EACD,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,GAClC,CACH,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAE/B,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,aACpD,KAAC,MAAM,IACL,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,YAAY,EACvB,YAAY,EAAE,YAAY,GAC1B,EAED,eAAe,IAAI,KAAC,cAAc,IAAC,OAAO,EAAE,eAAe,GAAI,EAE/D,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,KAAC,MAAM,KAAG,EAElD,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,GAAI,EAEhE,KAAC,SAAS,IAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAI,EAE3D,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,QAAC,MAAM,6JAE9C,GACH,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from "ink";
3
+ import { marieTheme } from "../styles/theme.js";
4
+ export const ApprovalDialog = ({ request }) => {
5
+ const isDestructive = [
6
+ "write_file",
7
+ "delete_file",
8
+ "replace_in_file",
9
+ "run_command",
10
+ ].includes(request.toolName);
11
+ useInput((input) => {
12
+ if (input === "y" || input === "Y") {
13
+ request.resolve(true);
14
+ }
15
+ else if (input === "n" || input === "N" || input === "\u0003") {
16
+ request.resolve(false);
17
+ }
18
+ });
19
+ const formatToolInput = () => {
20
+ const input = request.toolInput;
21
+ if (input.path || input.file) {
22
+ return `Path: ${input.path || input.file}`;
23
+ }
24
+ if (input.command) {
25
+ return `Cmd: ${input.command}`;
26
+ }
27
+ return JSON.stringify(input, null, 2).slice(0, 150);
28
+ };
29
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "double", borderColor: isDestructive ? marieTheme.colors.warning : marieTheme.colors.info, paddingX: 1, paddingY: 0, marginY: 0, children: [_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { bold: true, color: isDestructive ? marieTheme.colors.warning : marieTheme.colors.info, children: [isDestructive ? marieTheme.icons.warning : marieTheme.icons.info, " ", "Approval Required: ", _jsx(Text, { color: marieTheme.colors.foreground, children: request.toolName })] }) }), _jsx(Box, { borderStyle: "single", borderColor: marieTheme.colors.border, paddingX: 1, marginBottom: 0, children: _jsx(Text, { color: marieTheme.colors.muted, children: formatToolInput() }) }), request.diff && (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: marieTheme.colors.secondary, paddingX: 1, marginBottom: 0, children: [_jsxs(Text, { color: marieTheme.colors.muted, children: [request.diff.old.slice(0, 80), "..."] }), _jsxs(Text, { color: marieTheme.colors.success, children: ["\u2192 ", request.diff.new.slice(0, 80), "..."] })] })), _jsxs(Box, { marginTop: 0, gap: 3, children: [_jsx(Text, { color: marieTheme.colors.success, children: "Y - Approve" }), _jsx(Text, { color: marieTheme.colors.error, children: "N - Reject" })] })] }));
30
+ };
31
+ //# sourceMappingURL=ApprovalDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApprovalDialog.js","sourceRoot":"","sources":["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