portercode 0.1.3 → 0.1.10
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.
- package/LICENSE +174 -21
- package/README.md +101 -2
- package/dist/auth/index.d.ts +99 -0
- package/dist/brand/index.d.ts +7 -0
- package/dist/brand/loader.d.ts +463 -0
- package/dist/brand/rules.d.ts +25 -0
- package/dist/brand/schema.d.ts +246 -0
- package/dist/cli/auth.d.ts +14 -2
- package/dist/cli/brand.d.ts +6 -0
- package/dist/config/config.d.ts +0 -720
- package/dist/constants/index.d.ts +6 -9
- package/dist/constants/version.d.ts +5 -0
- package/dist/gateway/index.d.ts +5 -4
- package/dist/global/index.d.ts +12 -0
- package/dist/index.js +39 -1
- package/dist/prompt/template.d.ts +24 -0
- package/dist/provider/models.d.ts +0 -3
- package/dist/provider/provider.d.ts +5 -1
- package/dist/server/services/agent.d.ts +11 -0
- package/dist/session/context-cache.d.ts +75 -0
- package/dist/session/context-optimization.d.ts +5 -0
- package/dist/session/llm.d.ts +38 -1
- package/dist/session/message-optimizer.d.ts +32 -0
- package/dist/session/session.d.ts +101 -9
- package/dist/session/types.d.ts +92 -16
- package/dist/src/auth/index.d.ts +202 -0
- package/dist/src/brand/index.d.ts +7 -0
- package/dist/src/bus/bus-event.d.ts +10 -0
- package/dist/src/bus/global.d.ts +7 -0
- package/dist/src/bus/index.d.ts +26 -0
- package/dist/src/cli/auth.d.ts +23 -0
- package/dist/src/cli/index.d.ts +1 -0
- package/dist/src/cli/ui.d.ts +26 -0
- package/dist/src/command/index.d.ts +54 -0
- package/dist/src/config/config.d.ts +6036 -0
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/config/markdown.d.ts +415 -0
- package/dist/src/constants/index.d.ts +6 -0
- package/dist/src/constants/version.d.ts +5 -0
- package/dist/src/diff/engine.d.ts +15 -0
- package/dist/src/diff/index.d.ts +8 -0
- package/dist/src/diff/types.d.ts +66 -0
- package/dist/src/file/ignore.d.ts +7 -0
- package/dist/src/flag/index.d.ts +19 -0
- package/dist/src/gateway/bridge.d.ts +11 -0
- package/dist/src/gateway/handlers/llm.d.ts +7 -0
- package/dist/src/gateway/handlers/permission.d.ts +15 -0
- package/dist/src/gateway/handlers/session.d.ts +7 -0
- package/dist/src/gateway/handlers/system.d.ts +7 -0
- package/dist/src/gateway/handlers/tool.d.ts +7 -0
- package/dist/src/gateway/index.d.ts +18 -0
- package/dist/src/gateway/protocol.d.ts +159 -0
- package/dist/src/gateway/router.d.ts +7 -0
- package/dist/src/gateway/server.d.ts +24 -0
- package/dist/src/global/index.d.ts +23 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/permission/index.d.ts +2 -0
- package/dist/src/permission/permission.d.ts +172 -0
- package/dist/src/permission/types.d.ts +109 -0
- package/dist/src/project/index.d.ts +3 -0
- package/dist/src/project/instance.d.ts +33 -0
- package/dist/src/project/project.d.ts +82 -0
- package/dist/src/project/state.d.ts +4 -0
- package/dist/src/prompt/index.d.ts +5 -0
- package/dist/src/prompt/system.d.ts +29 -0
- package/dist/src/prompt/template.d.ts +24 -0
- package/dist/src/provider/index.d.ts +3 -0
- package/dist/src/provider/models.d.ts +14 -0
- package/dist/src/provider/provider.d.ts +848 -0
- package/dist/src/provider/types.d.ts +328 -0
- package/dist/src/server/index.d.ts +21 -0
- package/dist/src/server/routes/api.d.ts +2 -0
- package/dist/src/server/routes/auth.d.ts +2 -0
- package/dist/src/server/routes/events.d.ts +2 -0
- package/dist/src/server/routes/health.d.ts +2 -0
- package/dist/src/server/routes/sessions.d.ts +2 -0
- package/dist/src/server/services/agent.d.ts +40 -0
- package/dist/src/server/services/permission.d.ts +43 -0
- package/dist/src/server/sse/emitter.d.ts +57 -0
- package/dist/src/session/context-cache.d.ts +75 -0
- package/dist/src/session/context-optimization.d.ts +165 -0
- package/dist/src/session/index.d.ts +5 -0
- package/dist/src/session/llm.d.ts +68 -0
- package/dist/src/session/message-optimizer.d.ts +32 -0
- package/dist/src/session/session.d.ts +524 -0
- package/dist/src/session/title-generator.d.ts +11 -0
- package/dist/src/session/types.d.ts +713 -0
- package/dist/src/snapshot/index.d.ts +40 -0
- package/dist/src/storage/index.d.ts +1 -0
- package/dist/src/storage/storage.d.ts +34 -0
- package/dist/src/theme.d.ts +66 -0
- package/dist/src/tool/bash.d.ts +19 -0
- package/dist/src/tool/edit.d.ts +21 -0
- package/dist/src/tool/glob.d.ts +15 -0
- package/dist/src/tool/grep.d.ts +20 -0
- package/dist/src/tool/image.d.ts +22 -0
- package/dist/src/tool/index.d.ts +11 -0
- package/dist/src/tool/ls.d.ts +14 -0
- package/dist/src/tool/read.d.ts +17 -0
- package/dist/src/tool/registry.d.ts +30 -0
- package/dist/src/tool/think.d.ts +11 -0
- package/dist/src/tool/todo.d.ts +76 -0
- package/dist/src/tool/tool.d.ts +65 -0
- package/dist/src/tool/webfetch.d.ts +15 -0
- package/dist/src/tool/websearch.d.ts +18 -0
- package/dist/src/tool/write.d.ts +16 -0
- package/dist/src/tui/App.d.ts +10 -0
- package/dist/src/tui/components/Header.d.ts +13 -0
- package/dist/src/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/src/tui/components/Message/AssistantMessage.d.ts +11 -0
- package/dist/src/tui/components/Message/ReasoningMessage.d.ts +21 -0
- package/dist/src/tui/components/Message/ToolCallMessage.d.ts +26 -0
- package/dist/src/tui/components/Message/UserMessage.d.ts +12 -0
- package/dist/src/tui/components/Message/index.d.ts +16 -0
- package/dist/src/tui/components/PermissionPrompt.d.ts +6 -0
- package/dist/src/tui/components/PromptInput.d.ts +33 -0
- package/dist/src/tui/components/REPL.d.ts +22 -0
- package/dist/src/tui/components/Spinner.d.ts +13 -0
- package/dist/src/tui/components/StatusBar.d.ts +13 -0
- package/dist/src/tui/components/TodoList.d.ts +17 -0
- package/dist/src/tui/components/WelcomeBox.d.ts +13 -0
- package/dist/src/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
- package/dist/src/tui/components/dialogs/HelpPanel.d.ts +11 -0
- package/dist/src/tui/components/dialogs/ModelSelector.d.ts +14 -0
- package/dist/src/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
- package/dist/src/tui/components/dialogs/SessionPicker.d.ts +20 -0
- package/dist/src/tui/components/dialogs/index.d.ts +10 -0
- package/dist/src/tui/components/diff/DiffHunk.d.ts +12 -0
- package/dist/src/tui/components/diff/DiffLine.d.ts +14 -0
- package/dist/src/tui/components/diff/DiffStats.d.ts +12 -0
- package/dist/src/tui/components/diff/DiffView.d.ts +15 -0
- package/dist/src/tui/components/diff/index.d.ts +9 -0
- package/dist/src/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/src/tui/hooks/usePermission.d.ts +34 -0
- package/dist/src/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/src/tui/index.d.ts +20 -0
- package/dist/src/tui/theme.d.ts +8 -0
- package/dist/src/tui/utils/Cursor.d.ts +37 -0
- package/dist/src/tui/utils/clipboard.d.ts +3 -0
- package/dist/src/tui/utils/keypress.d.ts +39 -0
- package/dist/src/tui/utils/markdown.d.ts +13 -0
- package/dist/src/tui/utils/openContent.d.ts +22 -0
- package/dist/src/util/ascii.d.ts +22 -0
- package/dist/src/util/bell.d.ts +14 -0
- package/dist/src/util/color.d.ts +28 -0
- package/dist/src/util/context.d.ts +10 -0
- package/dist/src/util/debug.d.ts +51 -0
- package/dist/src/util/error.d.ts +294 -0
- package/dist/src/util/example-commands.d.ts +18 -0
- package/dist/src/util/filesystem.d.ts +17 -0
- package/dist/src/util/id.d.ts +24 -0
- package/dist/src/util/iife.d.ts +1 -0
- package/dist/src/util/index.d.ts +7 -0
- package/dist/src/util/lazy.d.ts +1 -0
- package/dist/src/util/log.d.ts +26 -0
- package/dist/src/util/paths.d.ts +45 -0
- package/dist/src/util/shell.d.ts +36 -0
- package/dist/src/util/timeout.d.ts +1 -0
- package/dist/src/util/wildcard.d.ts +8 -0
- package/dist/theme.d.ts +64 -0
- package/dist/tool/image.d.ts +3 -4
- package/dist/tool/think.d.ts +11 -0
- package/dist/tool/webfetch.d.ts +15 -0
- package/dist/tool/websearch.d.ts +18 -0
- package/dist/tools/think.d.ts +2 -0
- package/dist/tui/App.d.ts +1 -1
- package/dist/tui/components/Header.d.ts +2 -1
- package/dist/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/tui/components/Message/AssistantMessage.d.ts +2 -1
- package/dist/tui/components/Message/ReasoningMessage.d.ts +2 -1
- package/dist/tui/components/Message/ToolCallMessage.d.ts +3 -2
- package/dist/tui/components/Message/UserMessage.d.ts +2 -1
- package/dist/tui/components/Message/index.d.ts +4 -1
- package/dist/tui/components/PromptInput.d.ts +2 -1
- package/dist/tui/components/REPL.d.ts +6 -1
- package/dist/tui/components/StatusBar.d.ts +2 -1
- package/dist/tui/components/dialogs/SessionPicker.d.ts +6 -1
- package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/tui/hooks/usePermission.d.ts +9 -1
- package/dist/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/tui/index.d.ts +5 -0
- package/dist/tui/theme.d.ts +4 -23
- package/dist/util/ascii.d.ts +22 -0
- package/dist/util/bell.d.ts +14 -0
- package/dist/util/color.d.ts +28 -0
- package/dist/util/paths.d.ts +45 -0
- package/dist/util/shell.d.ts +36 -0
- package/package.json +21 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
PROPRIETARY SOFTWARE LICENSE WITH
|
|
1
|
+
PROPRIETARY SOFTWARE LICENSE WITH RESTRICTED USE
|
|
2
2
|
================================================
|
|
3
3
|
|
|
4
4
|
Copyright (c) 2025 Carlos Alexis Gomez Ruiz
|
|
@@ -79,22 +79,91 @@ shall be subject to the following terms:
|
|
|
79
79
|
any authorization or license agreement.
|
|
80
80
|
|
|
81
81
|
--------------------------------------------------------------------------------
|
|
82
|
-
5.
|
|
82
|
+
5. PERSONAL AND NON-COMMERCIAL USE LICENSE
|
|
83
83
|
--------------------------------------------------------------------------------
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
The Author grants to any person obtaining a copy of this Software a LIMITED,
|
|
86
|
+
NON-EXCLUSIVE, NON-TRANSFERABLE license for PERSONAL AND NON-COMMERCIAL USE
|
|
87
|
+
ONLY, subject to the following restrictions:
|
|
88
|
+
|
|
89
|
+
5.1 PERMITTED USES:
|
|
90
|
+
a) Personal learning and education
|
|
91
|
+
b) Academic research and study
|
|
92
|
+
c) Non-commercial personal projects
|
|
93
|
+
d) Code review and security research (responsible disclosure)
|
|
94
|
+
e) Contributing improvements via pull requests (subject to section 4)
|
|
95
|
+
|
|
96
|
+
5.2 PROHIBITED USES - General:
|
|
97
|
+
a) Any COMMERCIAL use, including but not limited to:
|
|
98
|
+
- Offering the Software as a service (SaaS)
|
|
99
|
+
- Integrating into commercial products or services
|
|
100
|
+
- Using in business operations or professional services
|
|
101
|
+
- Generating revenue directly or indirectly from the Software
|
|
102
|
+
|
|
103
|
+
b) CREATING COMPETING PRODUCTS OR SERVICES, including but not limited to:
|
|
104
|
+
- AI-powered coding assistants or CLI tools
|
|
105
|
+
- Developer productivity tools using LLM integration
|
|
106
|
+
- Code generation or editing tools
|
|
107
|
+
- Any product or service that competes with PorterCode
|
|
108
|
+
- Any product or service that competes with offerings from:
|
|
109
|
+
* Porter Metrics Inc.
|
|
110
|
+
* Companies affiliated with Carlos Alexis Gomez Ruiz
|
|
111
|
+
* Companies where Carlos Alexis Gomez Ruiz has ownership interest
|
|
112
|
+
|
|
113
|
+
c) REBRANDING, RESELLING, OR REDISTRIBUTION:
|
|
114
|
+
- Removing or altering copyright notices or attributions
|
|
115
|
+
- Distributing modified versions under a different name
|
|
116
|
+
- Selling or licensing the Software or derivatives
|
|
117
|
+
- Incorporating into products intended for distribution
|
|
118
|
+
- White-labeling or rebranding for any purpose
|
|
119
|
+
|
|
120
|
+
d) Reverse engineering, decompiling, or attempting to extract proprietary
|
|
121
|
+
algorithms, methodologies, or trade secrets with intent to replicate
|
|
122
|
+
|
|
123
|
+
e) Using the Software to train AI models or create training datasets
|
|
124
|
+
for competitive purposes
|
|
125
|
+
|
|
126
|
+
f) Circumventing or removing security features, license checks, or
|
|
127
|
+
usage limitations
|
|
128
|
+
|
|
129
|
+
g) Using the Software in any manner that violates applicable laws or
|
|
130
|
+
regulations
|
|
131
|
+
|
|
132
|
+
5.3 SPECIFIC PROHIBITED COMPETITIVE USES:
|
|
133
|
+
You may NOT use this Software to create, develop, or operate:
|
|
134
|
+
- LLM-based coding assistants or development tools
|
|
135
|
+
- CLI tools for code generation or manipulation
|
|
136
|
+
- AI agents for software development
|
|
137
|
+
- Developer productivity platforms using AI
|
|
138
|
+
- Code editors with AI capabilities
|
|
139
|
+
- Automated programming or refactoring tools
|
|
140
|
+
- Developer workflow automation tools using LLM
|
|
141
|
+
- Any tool marketed as an alternative to PorterCode or similar products
|
|
142
|
+
|
|
143
|
+
5.4 REQUIRED ATTRIBUTION:
|
|
144
|
+
- All redistributions (if permitted) must retain copyright notices
|
|
145
|
+
- Modified versions must clearly indicate changes made
|
|
146
|
+
- No use of Author's or Porter Metrics Inc.'s names for endorsement
|
|
87
147
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
148
|
+
--------------------------------------------------------------------------------
|
|
149
|
+
6. RESTRICTIONS FOR UNAUTHORIZED COMMERCIAL ENTITIES
|
|
150
|
+
--------------------------------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
Unless expressly authorized in writing by the Author, commercial entities,
|
|
153
|
+
organizations, or businesses may NOT:
|
|
154
|
+
|
|
155
|
+
a) Use the Software for any commercial purpose
|
|
156
|
+
b) Copy, reproduce, or duplicate the Software or any portion thereof
|
|
157
|
+
c) Modify, adapt, translate, or create derivative works based on the Software
|
|
158
|
+
d) Distribute, sublicense, lease, rent, loan, or transfer the Software
|
|
159
|
+
e) Integrate the Software into commercial products or services
|
|
160
|
+
f) Perform competitive analysis or benchmarking for commercial purposes
|
|
161
|
+
|
|
162
|
+
Commercial entities seeking to use the Software must obtain explicit written
|
|
163
|
+
permission and a separate commercial license from the Author.
|
|
95
164
|
|
|
96
165
|
--------------------------------------------------------------------------------
|
|
97
|
-
|
|
166
|
+
7. CONFIDENTIALITY
|
|
98
167
|
--------------------------------------------------------------------------------
|
|
99
168
|
|
|
100
169
|
All parties with access to the Software acknowledge and agree that:
|
|
@@ -109,26 +178,75 @@ All parties with access to the Software acknowledge and agree that:
|
|
|
109
178
|
effect indefinitely for trade secrets and for five (5) years for other
|
|
110
179
|
Confidential Information.
|
|
111
180
|
|
|
181
|
+
d) Source code and internal documentation marked as confidential must not
|
|
182
|
+
be shared publicly or with unauthorized parties.
|
|
183
|
+
|
|
184
|
+
--------------------------------------------------------------------------------
|
|
185
|
+
8. TERMINATION
|
|
186
|
+
--------------------------------------------------------------------------------
|
|
187
|
+
|
|
188
|
+
8.1 AUTOMATIC TERMINATION:
|
|
189
|
+
This license automatically terminates if you:
|
|
190
|
+
- Violate any term or restriction of this license
|
|
191
|
+
- Use the Software for any prohibited purpose
|
|
192
|
+
- Fail to comply with attribution requirements
|
|
193
|
+
- Attempt to create competing products or services
|
|
194
|
+
- Engage in any commercial use without authorization
|
|
195
|
+
|
|
196
|
+
8.2 EFFECT OF TERMINATION:
|
|
197
|
+
Upon termination:
|
|
198
|
+
- You must immediately cease all use of the Software
|
|
199
|
+
- Delete or destroy all copies in your possession
|
|
200
|
+
- Discontinue distribution of any derivatives
|
|
201
|
+
- Return or destroy all confidential materials
|
|
202
|
+
|
|
203
|
+
8.3 SURVIVAL:
|
|
204
|
+
Sections 1 (Ownership), 7 (Confidentiality), 9 (Disclaimer), 10 (Limitation
|
|
205
|
+
of Liability), and 11 (Governing Law) survive termination.
|
|
206
|
+
|
|
112
207
|
--------------------------------------------------------------------------------
|
|
113
|
-
|
|
208
|
+
9. DISCLAIMER OF WARRANTIES
|
|
114
209
|
--------------------------------------------------------------------------------
|
|
115
210
|
|
|
116
211
|
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
117
212
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
118
213
|
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. THE AUTHOR DOES NOT
|
|
119
|
-
WARRANT THAT THE SOFTWARE WILL BE ERROR-FREE OR
|
|
214
|
+
WARRANT THAT THE SOFTWARE WILL BE ERROR-FREE, UNINTERRUPTED, SECURE, OR
|
|
215
|
+
FREE OF HARMFUL COMPONENTS.
|
|
216
|
+
|
|
217
|
+
YOU ASSUME ALL RISK ASSOCIATED WITH THE USE OF THIS SOFTWARE. THE AUTHOR
|
|
218
|
+
SHALL NOT BE LIABLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM, LOSS OF DATA,
|
|
219
|
+
OR ANY OTHER DAMAGE RESULTING FROM USE OF THE SOFTWARE.
|
|
120
220
|
|
|
121
221
|
--------------------------------------------------------------------------------
|
|
122
|
-
|
|
222
|
+
10. LIMITATION OF LIABILITY
|
|
123
223
|
--------------------------------------------------------------------------------
|
|
124
224
|
|
|
125
225
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
|
|
126
|
-
CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO
|
|
127
|
-
|
|
128
|
-
|
|
226
|
+
CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO:
|
|
227
|
+
- Loss of profits, revenue, or business opportunities
|
|
228
|
+
- Loss of data or data corruption
|
|
229
|
+
- Business interruption or downtime
|
|
230
|
+
- Cost of substitute products or services
|
|
231
|
+
- Loss of goodwill or reputation damage
|
|
232
|
+
|
|
233
|
+
THIS LIMITATION APPLIES EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY
|
|
234
|
+
OF SUCH DAMAGES. THE AUTHOR'S TOTAL LIABILITY SHALL NOT EXCEED THE AMOUNT
|
|
235
|
+
PAID BY YOU FOR THE SOFTWARE (IF ANY).
|
|
236
|
+
|
|
237
|
+
SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF CERTAIN
|
|
238
|
+
DAMAGES, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
|
|
239
|
+
|
|
240
|
+
--------------------------------------------------------------------------------
|
|
241
|
+
11. EXPORT COMPLIANCE
|
|
242
|
+
--------------------------------------------------------------------------------
|
|
243
|
+
|
|
244
|
+
You agree to comply with all applicable export and import laws and regulations.
|
|
245
|
+
You shall not export, re-export, or transfer the Software to prohibited
|
|
246
|
+
countries or individuals under applicable laws.
|
|
129
247
|
|
|
130
248
|
--------------------------------------------------------------------------------
|
|
131
|
-
|
|
249
|
+
12. GOVERNING LAW AND JURISDICTION
|
|
132
250
|
--------------------------------------------------------------------------------
|
|
133
251
|
|
|
134
252
|
This License shall be governed by and construed in accordance with the laws
|
|
@@ -136,11 +254,35 @@ of the State of Delaware, United States of America, without regard to conflict
|
|
|
136
254
|
of law principles. Any disputes arising under this License shall be resolved
|
|
137
255
|
exclusively in the state or federal courts located in Delaware.
|
|
138
256
|
|
|
257
|
+
Both parties consent to personal jurisdiction in Delaware and waive any
|
|
258
|
+
objection to venue in such courts.
|
|
259
|
+
|
|
260
|
+
--------------------------------------------------------------------------------
|
|
261
|
+
13. SEVERABILITY
|
|
262
|
+
--------------------------------------------------------------------------------
|
|
263
|
+
|
|
264
|
+
If any provision of this License is held to be invalid or unenforceable, the
|
|
265
|
+
remaining provisions shall continue in full force and effect, and the invalid
|
|
266
|
+
provision shall be modified to the minimum extent necessary to make it valid
|
|
267
|
+
and enforceable.
|
|
268
|
+
|
|
269
|
+
--------------------------------------------------------------------------------
|
|
270
|
+
14. ENTIRE AGREEMENT
|
|
271
|
+
--------------------------------------------------------------------------------
|
|
272
|
+
|
|
273
|
+
This License constitutes the entire agreement between you and the Author
|
|
274
|
+
regarding the Software and supersedes all prior or contemporaneous
|
|
275
|
+
communications, whether written or oral.
|
|
276
|
+
|
|
277
|
+
This License may only be modified by a written amendment signed by the Author.
|
|
278
|
+
No waiver of any provision shall constitute a waiver of any other provision
|
|
279
|
+
or future waiver of the same provision.
|
|
280
|
+
|
|
139
281
|
--------------------------------------------------------------------------------
|
|
140
|
-
|
|
282
|
+
15. CONTACT INFORMATION
|
|
141
283
|
--------------------------------------------------------------------------------
|
|
142
284
|
|
|
143
|
-
For licensing inquiries, permissions, or to report violations:
|
|
285
|
+
For licensing inquiries, commercial use permissions, or to report violations:
|
|
144
286
|
|
|
145
287
|
Carlos Alexis Gomez Ruiz
|
|
146
288
|
Email: alexisg.0207@gmail.com
|
|
@@ -150,4 +292,15 @@ For licensing inquiries, permissions, or to report violations:
|
|
|
150
292
|
|
|
151
293
|
================================================================================
|
|
152
294
|
|
|
295
|
+
IMPORTANT NOTICE:
|
|
296
|
+
|
|
297
|
+
This is proprietary software. Unauthorized commercial use, redistribution,
|
|
298
|
+
rebranding, or creation of competing products is strictly prohibited and may
|
|
299
|
+
result in legal action.
|
|
300
|
+
|
|
301
|
+
For commercial licensing options, please contact the Author at the email
|
|
302
|
+
address provided above.
|
|
303
|
+
|
|
304
|
+
================================================================================
|
|
305
|
+
|
|
153
306
|
For third-party software notices and attributions, see the NOTICE file.
|
package/README.md
CHANGED
|
@@ -24,6 +24,9 @@ porter -c
|
|
|
24
24
|
|
|
25
25
|
# Use specific model
|
|
26
26
|
porter -m anthropic/claude-sonnet-4-20250514
|
|
27
|
+
|
|
28
|
+
# Start HTTP server for VS Code extension
|
|
29
|
+
porter --port 50123
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
## Commands
|
|
@@ -42,7 +45,66 @@ porter config Show configuration
|
|
|
42
45
|
| `-s, --session` | Continue specific session |
|
|
43
46
|
| `-c, --continue` | Continue most recent session |
|
|
44
47
|
| `-m, --model` | Model to use (provider/model) |
|
|
45
|
-
|
|
|
48
|
+
| `--port <number>` | Start HTTP server on specified port (for VS Code extension) |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## VS Code Extension Communication
|
|
53
|
+
|
|
54
|
+
When started with `--port`, PorterCode runs an HTTP server for communication with the VS Code extension.
|
|
55
|
+
|
|
56
|
+
### Architecture: HTTP + SSE
|
|
57
|
+
|
|
58
|
+
- **HTTP REST API**: For requests (prompts, sessions, auth, permissions)
|
|
59
|
+
- **SSE (Server-Sent Events)**: For real-time streaming responses
|
|
60
|
+
|
|
61
|
+
### API Endpoints
|
|
62
|
+
|
|
63
|
+
| Endpoint | Method | Description |
|
|
64
|
+
|----------|--------|-------------|
|
|
65
|
+
| `/health` | GET | Health check |
|
|
66
|
+
| `/events` | GET | SSE stream for real-time events |
|
|
67
|
+
| `/api/sessions` | GET | List all sessions |
|
|
68
|
+
| `/api/sessions` | POST | Create a new session |
|
|
69
|
+
| `/api/sessions/:id/messages` | GET | Get messages for a session |
|
|
70
|
+
| `/api/prompt` | POST | Send a prompt to the LLM |
|
|
71
|
+
| `/api/cancel` | POST | Cancel active generation |
|
|
72
|
+
| `/api/permission` | POST | Respond to permission requests |
|
|
73
|
+
| `/api/auth/status` | GET | Check authentication status |
|
|
74
|
+
| `/api/auth/providers` | GET | List available LLM providers |
|
|
75
|
+
| `/api/auth/credentials` | POST | Save API key credential |
|
|
76
|
+
|
|
77
|
+
### SSE Events
|
|
78
|
+
|
|
79
|
+
The `/events` endpoint streams the following event types:
|
|
80
|
+
|
|
81
|
+
| Event | Description |
|
|
82
|
+
|-------|-------------|
|
|
83
|
+
| `heartbeat` | Keep-alive ping |
|
|
84
|
+
| `message.start` | LLM generation started |
|
|
85
|
+
| `message.delta` | Text content chunk |
|
|
86
|
+
| `reasoning.delta` | Reasoning/thinking content chunk |
|
|
87
|
+
| `message.complete` | LLM generation finished |
|
|
88
|
+
| `tool.start` | Tool execution started |
|
|
89
|
+
| `tool.complete` | Tool execution finished |
|
|
90
|
+
| `permission.request` | Permission required for tool |
|
|
91
|
+
| `session.updated` | Session metadata changed |
|
|
92
|
+
|
|
93
|
+
### Example: Connecting to SSE
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
const eventSource = new EventSource('http://localhost:50123/events');
|
|
97
|
+
|
|
98
|
+
eventSource.addEventListener('message.delta', (e) => {
|
|
99
|
+
const data = JSON.parse(e.data);
|
|
100
|
+
console.log('Content:', data.content);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
eventSource.addEventListener('tool.start', (e) => {
|
|
104
|
+
const data = JSON.parse(e.data);
|
|
105
|
+
console.log('Tool:', data.toolName);
|
|
106
|
+
});
|
|
107
|
+
```
|
|
46
108
|
|
|
47
109
|
---
|
|
48
110
|
|
|
@@ -158,6 +220,16 @@ npm deprecate portercode@0.1.1 "Critical bug, use 0.1.2"
|
|
|
158
220
|
|
|
159
221
|
---
|
|
160
222
|
|
|
223
|
+
## Features
|
|
224
|
+
|
|
225
|
+
- 🤖 **Multi-LLM Support**: Works with Anthropic Claude, OpenAI GPT, Google Gemini, and Groq
|
|
226
|
+
- 🔐 **Granular Permissions**: Fine-grained control over file operations and command execution
|
|
227
|
+
- 💬 **Interactive Sessions**: Save and resume conversations
|
|
228
|
+
- ⚙️ **Configurable**: Hierarchical configuration system with JSONC support
|
|
229
|
+
- 🔧 **Extensible Tools**: Read, write, edit files, execute commands, search code
|
|
230
|
+
- 🎨 **Terminal UI**: Beautiful interactive interface built with Ink
|
|
231
|
+
- 📡 **VS Code Integration**: HTTP + SSE server for VS Code extension
|
|
232
|
+
|
|
161
233
|
## Development
|
|
162
234
|
|
|
163
235
|
```bash
|
|
@@ -171,8 +243,35 @@ bun test
|
|
|
171
243
|
bun run typecheck
|
|
172
244
|
```
|
|
173
245
|
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Configuration
|
|
249
|
+
|
|
250
|
+
Create a `porter.jsonc` file in your project root or `~/.config/portercode/porter.jsonc` globally:
|
|
251
|
+
|
|
252
|
+
```jsonc
|
|
253
|
+
{
|
|
254
|
+
"model": "claude-sonnet-4",
|
|
255
|
+
"permission": {
|
|
256
|
+
"edit": "ask", // Always ask before editing files
|
|
257
|
+
"bash": "auto" // Execute commands automatically
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Configuration Options
|
|
263
|
+
|
|
264
|
+
| Option | Description | Values |
|
|
265
|
+
|--------|-------------|--------|
|
|
266
|
+
| `model` | Default LLM model | `claude-sonnet-4`, `gpt-4`, `gemini-pro`, etc. |
|
|
267
|
+
| `permission.edit` | Permission for editing files | `ask`, `auto`, `deny` |
|
|
268
|
+
| `permission.write` | Permission for creating files | `ask`, `auto`, `deny` |
|
|
269
|
+
| `permission.bash` | Permission for shell commands | `ask`, `auto`, `deny` |
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
174
273
|
## License
|
|
175
274
|
|
|
176
275
|
Proprietary - See [LICENSE](LICENSE) for details.
|
|
177
276
|
|
|
178
|
-
Copyright (c) 2025
|
|
277
|
+
Copyright (c) 2025 Carlos Alexis Gomez Ruiz. All rights reserved.
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -42,6 +42,51 @@ export declare namespace Auth {
|
|
|
42
42
|
key: string;
|
|
43
43
|
token: string;
|
|
44
44
|
}>;
|
|
45
|
+
const ServiceAccount: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"service-account">;
|
|
47
|
+
serviceAccount: z.ZodObject<{
|
|
48
|
+
project_id: z.ZodString;
|
|
49
|
+
client_email: z.ZodString;
|
|
50
|
+
private_key: z.ZodString;
|
|
51
|
+
location: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
project_id: string;
|
|
54
|
+
client_email: string;
|
|
55
|
+
private_key: string;
|
|
56
|
+
location?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
project_id: string;
|
|
59
|
+
client_email: string;
|
|
60
|
+
private_key: string;
|
|
61
|
+
location?: string | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
type: "service-account";
|
|
65
|
+
serviceAccount: {
|
|
66
|
+
project_id: string;
|
|
67
|
+
client_email: string;
|
|
68
|
+
private_key: string;
|
|
69
|
+
location?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
type: "service-account";
|
|
73
|
+
serviceAccount: {
|
|
74
|
+
project_id: string;
|
|
75
|
+
client_email: string;
|
|
76
|
+
private_key: string;
|
|
77
|
+
location?: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
80
|
+
const PerplexityApiKey: z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"perplexity-api-key">;
|
|
82
|
+
apiKey: z.ZodString;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
type: "perplexity-api-key";
|
|
85
|
+
apiKey: string;
|
|
86
|
+
}, {
|
|
87
|
+
type: "perplexity-api-key";
|
|
88
|
+
apiKey: string;
|
|
89
|
+
}>;
|
|
45
90
|
const Info: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
46
91
|
type: z.ZodLiteral<"oauth">;
|
|
47
92
|
refresh: z.ZodString;
|
|
@@ -81,6 +126,49 @@ export declare namespace Auth {
|
|
|
81
126
|
type: "wellknown";
|
|
82
127
|
key: string;
|
|
83
128
|
token: string;
|
|
129
|
+
}>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"service-account">;
|
|
131
|
+
serviceAccount: z.ZodObject<{
|
|
132
|
+
project_id: z.ZodString;
|
|
133
|
+
client_email: z.ZodString;
|
|
134
|
+
private_key: z.ZodString;
|
|
135
|
+
location: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
project_id: string;
|
|
138
|
+
client_email: string;
|
|
139
|
+
private_key: string;
|
|
140
|
+
location?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
project_id: string;
|
|
143
|
+
client_email: string;
|
|
144
|
+
private_key: string;
|
|
145
|
+
location?: string | undefined;
|
|
146
|
+
}>;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
type: "service-account";
|
|
149
|
+
serviceAccount: {
|
|
150
|
+
project_id: string;
|
|
151
|
+
client_email: string;
|
|
152
|
+
private_key: string;
|
|
153
|
+
location?: string | undefined;
|
|
154
|
+
};
|
|
155
|
+
}, {
|
|
156
|
+
type: "service-account";
|
|
157
|
+
serviceAccount: {
|
|
158
|
+
project_id: string;
|
|
159
|
+
client_email: string;
|
|
160
|
+
private_key: string;
|
|
161
|
+
location?: string | undefined;
|
|
162
|
+
};
|
|
163
|
+
}>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"perplexity-api-key">;
|
|
165
|
+
apiKey: z.ZodString;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
type: "perplexity-api-key";
|
|
168
|
+
apiKey: string;
|
|
169
|
+
}, {
|
|
170
|
+
type: "perplexity-api-key";
|
|
171
|
+
apiKey: string;
|
|
84
172
|
}>]>;
|
|
85
173
|
type Info = z.infer<typeof Info>;
|
|
86
174
|
function get(providerID: string): Promise<{
|
|
@@ -96,6 +184,17 @@ export declare namespace Auth {
|
|
|
96
184
|
type: "wellknown";
|
|
97
185
|
key: string;
|
|
98
186
|
token: string;
|
|
187
|
+
} | {
|
|
188
|
+
type: "service-account";
|
|
189
|
+
serviceAccount: {
|
|
190
|
+
project_id: string;
|
|
191
|
+
client_email: string;
|
|
192
|
+
private_key: string;
|
|
193
|
+
location?: string | undefined;
|
|
194
|
+
};
|
|
195
|
+
} | {
|
|
196
|
+
type: "perplexity-api-key";
|
|
197
|
+
apiKey: string;
|
|
99
198
|
}>;
|
|
100
199
|
function all(): Promise<Record<string, Info>>;
|
|
101
200
|
function set(key: string, info: Info): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand Module
|
|
3
|
+
*
|
|
4
|
+
* Re-exports brand configuration from theme.ts for backward compatibility
|
|
5
|
+
*/
|
|
6
|
+
export { PRODUCT_NAME, PRODUCT_COMMAND, CONFIG_DIR, CONFIG_FILE, RULES_FILE, ENV_PREFIX, LOGO_SIMPLE, LOGO_EXTENDED, LOGO_ASCII, LOCAL_RULE_FILES, GLOBAL_RULE_FILES, DEFAULT_THEME, PRIMARY_COLOR, themes, getTheme, setTheme, getThemeNames, initTheme, } from "../theme";
|
|
7
|
+
export type { Theme } from "../theme";
|