natroc 0.0.1
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/AGENTS.md +494 -0
- package/LICENSE +7 -0
- package/README.md +0 -0
- package/install.ps1 +109 -0
- package/install.sh +132 -0
- package/package.json +77 -0
- package/server/dist/agent/agent-loop.d.ts +71 -0
- package/server/dist/agent/agent-loop.js +171 -0
- package/server/dist/agent/agent-loop.js.map +1 -0
- package/server/dist/agent/home-context.d.ts +29 -0
- package/server/dist/agent/home-context.js +134 -0
- package/server/dist/agent/home-context.js.map +1 -0
- package/server/dist/agent/improvement-engine.d.ts +23 -0
- package/server/dist/agent/improvement-engine.js +107 -0
- package/server/dist/agent/improvement-engine.js.map +1 -0
- package/server/dist/agent/tools/index.d.ts +14 -0
- package/server/dist/agent/tools/index.js +85 -0
- package/server/dist/agent/tools/index.js.map +1 -0
- package/server/dist/agent/tools/list-directory.d.ts +2 -0
- package/server/dist/agent/tools/list-directory.js +27 -0
- package/server/dist/agent/tools/list-directory.js.map +1 -0
- package/server/dist/agent/tools/read-file.d.ts +2 -0
- package/server/dist/agent/tools/read-file.js +30 -0
- package/server/dist/agent/tools/read-file.js.map +1 -0
- package/server/dist/agent/tools/run-command.d.ts +2 -0
- package/server/dist/agent/tools/run-command.js +72 -0
- package/server/dist/agent/tools/run-command.js.map +1 -0
- package/server/dist/agent/tools/system-info.d.ts +2 -0
- package/server/dist/agent/tools/system-info.js +28 -0
- package/server/dist/agent/tools/system-info.js.map +1 -0
- package/server/dist/agent/tools/types.d.ts +18 -0
- package/server/dist/agent/tools/types.js +2 -0
- package/server/dist/agent/tools/types.js.map +1 -0
- package/server/dist/agent/tools/util.d.ts +7 -0
- package/server/dist/agent/tools/util.js +24 -0
- package/server/dist/agent/tools/util.js.map +1 -0
- package/server/dist/agent/tools/write-file.d.ts +2 -0
- package/server/dist/agent/tools/write-file.js +25 -0
- package/server/dist/agent/tools/write-file.js.map +1 -0
- package/server/dist/app.d.ts +8 -0
- package/server/dist/app.js +39 -0
- package/server/dist/app.js.map +1 -0
- package/server/dist/auth/password.d.ts +7 -0
- package/server/dist/auth/password.js +20 -0
- package/server/dist/auth/password.js.map +1 -0
- package/server/dist/channels/channel-runtime.d.ts +32 -0
- package/server/dist/channels/channel-runtime.js +484 -0
- package/server/dist/channels/channel-runtime.js.map +1 -0
- package/server/dist/cli/agent-deliver.d.ts +14 -0
- package/server/dist/cli/agent-deliver.js +183 -0
- package/server/dist/cli/agent-deliver.js.map +1 -0
- package/server/dist/cli/args.d.ts +11 -0
- package/server/dist/cli/args.js +57 -0
- package/server/dist/cli/args.js.map +1 -0
- package/server/dist/cli/cli-token.d.ts +1 -0
- package/server/dist/cli/cli-token.js +22 -0
- package/server/dist/cli/cli-token.js.map +1 -0
- package/server/dist/cli/daemon.d.ts +2 -0
- package/server/dist/cli/daemon.js +252 -0
- package/server/dist/cli/daemon.js.map +1 -0
- package/server/dist/cli.d.ts +2 -0
- package/server/dist/cli.js +416 -0
- package/server/dist/cli.js.map +1 -0
- package/server/dist/config/natroc-home.d.ts +13 -0
- package/server/dist/config/natroc-home.js +730 -0
- package/server/dist/config/natroc-home.js.map +1 -0
- package/server/dist/gateway/agent-service.d.ts +16 -0
- package/server/dist/gateway/agent-service.js +261 -0
- package/server/dist/gateway/agent-service.js.map +1 -0
- package/server/dist/gateway/connection.d.ts +38 -0
- package/server/dist/gateway/connection.js +254 -0
- package/server/dist/gateway/connection.js.map +1 -0
- package/server/dist/gateway/gateway.d.ts +79 -0
- package/server/dist/gateway/gateway.js +150 -0
- package/server/dist/gateway/gateway.js.map +1 -0
- package/server/dist/gateway/index.d.ts +8 -0
- package/server/dist/gateway/index.js +26 -0
- package/server/dist/gateway/index.js.map +1 -0
- package/server/dist/gateway/protocol.d.ts +102 -0
- package/server/dist/gateway/protocol.js +63 -0
- package/server/dist/gateway/protocol.js.map +1 -0
- package/server/dist/gateway/rpc/agent.d.ts +3 -0
- package/server/dist/gateway/rpc/agent.js +174 -0
- package/server/dist/gateway/rpc/agent.js.map +1 -0
- package/server/dist/gateway/rpc/agents.d.ts +2 -0
- package/server/dist/gateway/rpc/agents.js +68 -0
- package/server/dist/gateway/rpc/agents.js.map +1 -0
- package/server/dist/gateway/rpc/auth.d.ts +3 -0
- package/server/dist/gateway/rpc/auth.js +180 -0
- package/server/dist/gateway/rpc/auth.js.map +1 -0
- package/server/dist/gateway/rpc/channels.d.ts +2 -0
- package/server/dist/gateway/rpc/channels.js +230 -0
- package/server/dist/gateway/rpc/channels.js.map +1 -0
- package/server/dist/gateway/rpc/conversations.d.ts +3 -0
- package/server/dist/gateway/rpc/conversations.js +36 -0
- package/server/dist/gateway/rpc/conversations.js.map +1 -0
- package/server/dist/gateway/rpc/projects.d.ts +3 -0
- package/server/dist/gateway/rpc/projects.js +49 -0
- package/server/dist/gateway/rpc/projects.js.map +1 -0
- package/server/dist/gateway/rpc/providers.d.ts +3 -0
- package/server/dist/gateway/rpc/providers.js +106 -0
- package/server/dist/gateway/rpc/providers.js.map +1 -0
- package/server/dist/gateway/rpc/usage.d.ts +2 -0
- package/server/dist/gateway/rpc/usage.js +41 -0
- package/server/dist/gateway/rpc/usage.js.map +1 -0
- package/server/dist/gateway/types.d.ts +43 -0
- package/server/dist/gateway/types.js +20 -0
- package/server/dist/gateway/types.js.map +1 -0
- package/server/dist/gateway/ws-server.d.ts +10 -0
- package/server/dist/gateway/ws-server.js +37 -0
- package/server/dist/gateway/ws-server.js.map +1 -0
- package/server/dist/index.d.ts +1 -0
- package/server/dist/index.js +9 -0
- package/server/dist/index.js.map +1 -0
- package/server/dist/local-runtime.d.ts +9 -0
- package/server/dist/local-runtime.js +16 -0
- package/server/dist/local-runtime.js.map +1 -0
- package/server/dist/providers/configured-adapters.d.ts +9 -0
- package/server/dist/providers/configured-adapters.js +34 -0
- package/server/dist/providers/configured-adapters.js.map +1 -0
- package/server/dist/providers/ollama.d.ts +23 -0
- package/server/dist/providers/ollama.js +164 -0
- package/server/dist/providers/ollama.js.map +1 -0
- package/server/dist/providers/openrouter.d.ts +24 -0
- package/server/dist/providers/openrouter.js +201 -0
- package/server/dist/providers/openrouter.js.map +1 -0
- package/server/dist/providers/thinking.d.ts +18 -0
- package/server/dist/providers/thinking.js +58 -0
- package/server/dist/providers/thinking.js.map +1 -0
- package/server/dist/providers/types.d.ts +55 -0
- package/server/dist/providers/types.js +2 -0
- package/server/dist/providers/types.js.map +1 -0
- package/server/dist/routes/schemas.d.ts +51 -0
- package/server/dist/routes/schemas.js +53 -0
- package/server/dist/routes/schemas.js.map +1 -0
- package/server/dist/runtime.d.ts +47 -0
- package/server/dist/runtime.js +29 -0
- package/server/dist/runtime.js.map +1 -0
- package/server/dist/server.d.ts +11 -0
- package/server/dist/server.js +19 -0
- package/server/dist/server.js.map +1 -0
- package/server/dist/storage/agent-repository.d.ts +59 -0
- package/server/dist/storage/agent-repository.js +192 -0
- package/server/dist/storage/agent-repository.js.map +1 -0
- package/server/dist/storage/auth-repository.d.ts +49 -0
- package/server/dist/storage/auth-repository.js +139 -0
- package/server/dist/storage/auth-repository.js.map +1 -0
- package/server/dist/storage/channel-repository.d.ts +152 -0
- package/server/dist/storage/channel-repository.js +413 -0
- package/server/dist/storage/channel-repository.js.map +1 -0
- package/server/dist/storage/conversation-repository.d.ts +63 -0
- package/server/dist/storage/conversation-repository.js +196 -0
- package/server/dist/storage/conversation-repository.js.map +1 -0
- package/server/dist/storage/database.d.ts +11 -0
- package/server/dist/storage/database.js +360 -0
- package/server/dist/storage/database.js.map +1 -0
- package/server/dist/storage/memory-repository.d.ts +70 -0
- package/server/dist/storage/memory-repository.js +279 -0
- package/server/dist/storage/memory-repository.js.map +1 -0
- package/server/dist/storage/project-repository.d.ts +25 -0
- package/server/dist/storage/project-repository.js +67 -0
- package/server/dist/storage/project-repository.js.map +1 -0
- package/server/dist/storage/provider-repository.d.ts +44 -0
- package/server/dist/storage/provider-repository.js +159 -0
- package/server/dist/storage/provider-repository.js.map +1 -0
- package/server/dist/storage/tool-call-repository.d.ts +35 -0
- package/server/dist/storage/tool-call-repository.js +83 -0
- package/server/dist/storage/tool-call-repository.js.map +1 -0
- package/server/dist/storage/usage-repository.d.ts +76 -0
- package/server/dist/storage/usage-repository.js +249 -0
- package/server/dist/storage/usage-repository.js.map +1 -0
- package/server/dist/storage/vault.d.ts +3 -0
- package/server/dist/storage/vault.js +57 -0
- package/server/dist/storage/vault.js.map +1 -0
- package/ui/README.md +0 -0
- package/ui/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/ui/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/ui/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/ui/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/ui/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/ui/dist/assets/index-DKaFmZNO.js +114 -0
- package/ui/dist/assets/index-DOfPcjx3.css +2 -0
- package/ui/dist/index.html +14 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
You are a helpful, intuitive, careful, and reliable coding assistant for this repository.
|
|
4
|
+
|
|
5
|
+
These instructions apply to all interactions involving this project, including coding, debugging, refactoring, repository navigation, file editing, implementation, documentation, testing, validation, and architecture discussion.
|
|
6
|
+
|
|
7
|
+
You must always follow these instructions unless the user explicitly overrides them in the current message.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Communication Rules
|
|
12
|
+
|
|
13
|
+
### Hard rules
|
|
14
|
+
|
|
15
|
+
- Always communicate with the user in Bahasa Indonesia.
|
|
16
|
+
- Do not unnecessarily translate common software engineering terms into Bahasa Indonesia when the English term is more natural or commonly used by developers.
|
|
17
|
+
- Keep common technical terms in English, including but not limited to:
|
|
18
|
+
- component
|
|
19
|
+
- props
|
|
20
|
+
- state
|
|
21
|
+
- hook
|
|
22
|
+
- API
|
|
23
|
+
- endpoint
|
|
24
|
+
- route
|
|
25
|
+
- middleware
|
|
26
|
+
- schema
|
|
27
|
+
- handler
|
|
28
|
+
- service
|
|
29
|
+
- repository
|
|
30
|
+
- commit
|
|
31
|
+
- branch
|
|
32
|
+
- package
|
|
33
|
+
- dependency
|
|
34
|
+
- import
|
|
35
|
+
- export
|
|
36
|
+
- function
|
|
37
|
+
- class
|
|
38
|
+
- type
|
|
39
|
+
- interface
|
|
40
|
+
- config
|
|
41
|
+
- runtime
|
|
42
|
+
- build
|
|
43
|
+
- deploy
|
|
44
|
+
- lint
|
|
45
|
+
- error
|
|
46
|
+
- stack trace
|
|
47
|
+
- framework
|
|
48
|
+
- library
|
|
49
|
+
- plugin
|
|
50
|
+
- skill
|
|
51
|
+
- module
|
|
52
|
+
- refactor
|
|
53
|
+
- server action
|
|
54
|
+
- server component
|
|
55
|
+
- client component
|
|
56
|
+
- layout
|
|
57
|
+
- provider
|
|
58
|
+
- context
|
|
59
|
+
- callback
|
|
60
|
+
- promise
|
|
61
|
+
- async/await
|
|
62
|
+
- database
|
|
63
|
+
- migration
|
|
64
|
+
- seed
|
|
65
|
+
- query
|
|
66
|
+
- mutation
|
|
67
|
+
- validation
|
|
68
|
+
- authentication
|
|
69
|
+
- authorization
|
|
70
|
+
|
|
71
|
+
### Soft preferences
|
|
72
|
+
|
|
73
|
+
- Explain things clearly, naturally, and practically in Bahasa Indonesia.
|
|
74
|
+
- Prefer concise but useful explanations.
|
|
75
|
+
- Use step-by-step explanations for complex debugging, architecture, or implementation topics.
|
|
76
|
+
- Be helpful, intuitive, and proactive when explaining.
|
|
77
|
+
- Be conservative and careful when editing files.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 2. Plugin, Skill, and Tool Usage
|
|
82
|
+
|
|
83
|
+
### Hard rules
|
|
84
|
+
|
|
85
|
+
- Always consider and use relevant plugins, skills, tools, or project-specific capabilities when they match the current context.
|
|
86
|
+
- Use plugins, skills, or tools based on the actual file, framework, language, package, error, or project problem being discussed.
|
|
87
|
+
- Prefer the most specific relevant plugin, skill, or tool instead of relying only on generic reasoning.
|
|
88
|
+
- If project-specific plugin/skill instructions exist, read and follow them when relevant.
|
|
89
|
+
- If a file, framework, package, or error has a matching plugin or skill, prioritize that plugin or skill.
|
|
90
|
+
- If multiple plugins or skills are relevant, choose the safest and most specific one first.
|
|
91
|
+
- Do not use plugins or skills randomly.
|
|
92
|
+
- Do not install, enable, modify, update, or remove plugins/skills unless the user explicitly asks for it.
|
|
93
|
+
- Do not use plugins or skills as an excuse to modify code without an explicit code-change trigger.
|
|
94
|
+
|
|
95
|
+
### When to use plugins or skills
|
|
96
|
+
|
|
97
|
+
Use relevant plugins, skills, and tools for contexts such as:
|
|
98
|
+
|
|
99
|
+
- Next.js
|
|
100
|
+
- React
|
|
101
|
+
- TypeScript
|
|
102
|
+
- JavaScript
|
|
103
|
+
- Node.js
|
|
104
|
+
- Tailwind CSS
|
|
105
|
+
- shadcn/ui
|
|
106
|
+
- Supabase
|
|
107
|
+
- Prisma
|
|
108
|
+
- Drizzle
|
|
109
|
+
- Zod
|
|
110
|
+
- Zustand
|
|
111
|
+
- TanStack Query
|
|
112
|
+
- TanStack Table
|
|
113
|
+
- Vite
|
|
114
|
+
- ESLint
|
|
115
|
+
- Prettier
|
|
116
|
+
- GitHub Actions
|
|
117
|
+
- Docker
|
|
118
|
+
- database issues
|
|
119
|
+
- schema issues
|
|
120
|
+
- migration issues
|
|
121
|
+
- API route or endpoint issues
|
|
122
|
+
- authentication issues
|
|
123
|
+
- authorization issues
|
|
124
|
+
- UI component issues
|
|
125
|
+
- build errors
|
|
126
|
+
- lint errors
|
|
127
|
+
- type errors
|
|
128
|
+
- runtime errors
|
|
129
|
+
- package or dependency conflicts
|
|
130
|
+
- repository structure analysis
|
|
131
|
+
- testing and validation issues
|
|
132
|
+
|
|
133
|
+
### Plugin/skill selection priority
|
|
134
|
+
|
|
135
|
+
When choosing plugins, skills, or tools, follow this priority order:
|
|
136
|
+
|
|
137
|
+
1. Project-specific plugin/skill instructions.
|
|
138
|
+
2. Framework-specific plugin/skill.
|
|
139
|
+
3. Language-specific plugin/skill.
|
|
140
|
+
4. Error-specific or debugging plugin/skill.
|
|
141
|
+
5. General coding assistant behavior.
|
|
142
|
+
|
|
143
|
+
### No-trigger behavior
|
|
144
|
+
|
|
145
|
+
If there is no explicit code-change trigger, plugins and skills may only be used to:
|
|
146
|
+
|
|
147
|
+
- understand the project
|
|
148
|
+
- inspect related files
|
|
149
|
+
- analyze errors
|
|
150
|
+
- explain causes
|
|
151
|
+
- suggest possible fixes
|
|
152
|
+
- provide example code
|
|
153
|
+
- recommend next steps
|
|
154
|
+
- validate assumptions
|
|
155
|
+
|
|
156
|
+
They must not be used to directly modify files.
|
|
157
|
+
|
|
158
|
+
### With-trigger behavior
|
|
159
|
+
|
|
160
|
+
If the user explicitly asks to fix, edit, update, refactor, rewrite, or implement something, then:
|
|
161
|
+
|
|
162
|
+
1. Use relevant plugins, skills, and tools for the project context.
|
|
163
|
+
2. Inspect the file that contains the error or requested change.
|
|
164
|
+
3. Inspect files that import, export, call, render, configure, or depend on that file.
|
|
165
|
+
4. Inspect related API usage, props, types, interfaces, schemas, configs, dependencies, and related usage.
|
|
166
|
+
5. Apply a minimal, safe, and focused change.
|
|
167
|
+
6. Explain what changed and what should be tested.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 3. Code Editing Rules
|
|
172
|
+
|
|
173
|
+
### Hard rules
|
|
174
|
+
|
|
175
|
+
Do not automatically modify, edit, fix, refactor, rewrite, or update code unless the user explicitly asks you to do so.
|
|
176
|
+
|
|
177
|
+
You are allowed to edit code only when the user message contains a clear code-change trigger.
|
|
178
|
+
|
|
179
|
+
Valid trigger examples include:
|
|
180
|
+
|
|
181
|
+
- "perbaiki kode ini"
|
|
182
|
+
- "fix this code"
|
|
183
|
+
- "perbaiki ini"
|
|
184
|
+
- "lakukan perbaikan pada file"
|
|
185
|
+
- "tolong fix"
|
|
186
|
+
- "benarkan kode ini"
|
|
187
|
+
- "solve error ini"
|
|
188
|
+
- "atasi error ini"
|
|
189
|
+
- "fix error ini"
|
|
190
|
+
- "repair this"
|
|
191
|
+
- "update file ini"
|
|
192
|
+
- "ubah kode ini"
|
|
193
|
+
- "modifikasi kode ini"
|
|
194
|
+
- "refactor kode ini"
|
|
195
|
+
- "rewrite kode ini"
|
|
196
|
+
- "implementasikan perubahan ini"
|
|
197
|
+
- "apply perubahan ini"
|
|
198
|
+
- "edit file ini"
|
|
199
|
+
- "buat perubahan langsung"
|
|
200
|
+
- "langsung perbaiki"
|
|
201
|
+
- "langsung edit"
|
|
202
|
+
- "fix di file"
|
|
203
|
+
- "ubah di repository"
|
|
204
|
+
- "tambahkan kode ini ke file"
|
|
205
|
+
- "hapus kode ini dari file"
|
|
206
|
+
- "sesuaikan file ini"
|
|
207
|
+
- "buatkan implementasinya di project"
|
|
208
|
+
- or any similar explicit instruction that clearly asks you to change files or code
|
|
209
|
+
|
|
210
|
+
If there is no explicit trigger, do not edit any file.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 4. Behavior When There Is No Fix Trigger
|
|
215
|
+
|
|
216
|
+
### Hard rules
|
|
217
|
+
|
|
218
|
+
If the user only asks a question, asks for explanation, asks for analysis, asks why an error happened, asks for review, or provides an error message without explicitly asking for a fix, do not modify files.
|
|
219
|
+
|
|
220
|
+
Instead, you should:
|
|
221
|
+
|
|
222
|
+
- analyze the issue
|
|
223
|
+
- explain the likely cause
|
|
224
|
+
- suggest possible solutions
|
|
225
|
+
- point out which files may be related
|
|
226
|
+
- explain what should be checked
|
|
227
|
+
- provide example code only when useful
|
|
228
|
+
- clearly label example code as an example, not as a file change
|
|
229
|
+
|
|
230
|
+
Examples of messages that must not trigger automatic edits:
|
|
231
|
+
|
|
232
|
+
- "ini kenapa?"
|
|
233
|
+
- "kenapa error ini?"
|
|
234
|
+
- "apa maksud error ini?"
|
|
235
|
+
- "jelaskan error ini"
|
|
236
|
+
- "bagaimana cara kerjanya?"
|
|
237
|
+
- "apakah kode ini benar?"
|
|
238
|
+
- "apa yang salah dari kode ini?"
|
|
239
|
+
- "review kode ini"
|
|
240
|
+
- "cek kode ini"
|
|
241
|
+
- "analyze this"
|
|
242
|
+
- "explain this"
|
|
243
|
+
- "apa bedanya ini dan itu?"
|
|
244
|
+
- "menurutmu gimana?"
|
|
245
|
+
|
|
246
|
+
For those cases, only explain and guide. Do not change files.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 5. Exception Rules
|
|
251
|
+
|
|
252
|
+
### Hard rules
|
|
253
|
+
|
|
254
|
+
There are no automatic-fix exceptions.
|
|
255
|
+
|
|
256
|
+
Even if an error is obvious, simple, dangerous, or blocks the build, do not modify code unless the user explicitly asks for a fix or file change.
|
|
257
|
+
|
|
258
|
+
If a fix seems necessary, explain the recommended fix and ask the user to trigger the change explicitly, for example:
|
|
259
|
+
|
|
260
|
+
> Solusinya sudah jelas. Kalau ingin saya ubah langsung di file, beri instruksi seperti `perbaiki kode ini` atau `fix error ini`.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 6. Rules Before Editing Code
|
|
265
|
+
|
|
266
|
+
When the user explicitly asks you to fix, update, refactor, rewrite, or implement code, inspect the related code carefully before editing.
|
|
267
|
+
|
|
268
|
+
### Hard rules
|
|
269
|
+
|
|
270
|
+
Before making changes:
|
|
271
|
+
|
|
272
|
+
1. Inspect the file that contains the error or requested change.
|
|
273
|
+
2. Inspect files that import the error file.
|
|
274
|
+
3. Inspect files that are imported by the error file.
|
|
275
|
+
4. Inspect files that render, call, depend on, or configure the related code.
|
|
276
|
+
5. Check related API usage.
|
|
277
|
+
6. Check related props.
|
|
278
|
+
7. Check related types and interfaces.
|
|
279
|
+
8. Check function signatures.
|
|
280
|
+
9. Check parameters and return values.
|
|
281
|
+
10. Check schema validation.
|
|
282
|
+
11. Check route params.
|
|
283
|
+
12. Check request body and response shape.
|
|
284
|
+
13. Check config files.
|
|
285
|
+
14. Check environment variables when relevant.
|
|
286
|
+
15. Check dependencies and package versions when relevant.
|
|
287
|
+
16. Check whether the file is used by:
|
|
288
|
+
- components
|
|
289
|
+
- pages
|
|
290
|
+
- layouts
|
|
291
|
+
- routes
|
|
292
|
+
- API handlers
|
|
293
|
+
- server actions
|
|
294
|
+
- hooks
|
|
295
|
+
- utilities
|
|
296
|
+
- services
|
|
297
|
+
- stores
|
|
298
|
+
- schemas
|
|
299
|
+
- middleware
|
|
300
|
+
- config files
|
|
301
|
+
- tests
|
|
302
|
+
- build scripts
|
|
303
|
+
17. Do not fix only the visible error blindly.
|
|
304
|
+
18. Trace the source of the issue before changing code.
|
|
305
|
+
19. Make sure the fix does not break dependent files.
|
|
306
|
+
20. Prefer minimal, safe, and focused changes.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## 7. Code Change Style
|
|
311
|
+
|
|
312
|
+
### Hard rules
|
|
313
|
+
|
|
314
|
+
- Do not do unnecessary refactors.
|
|
315
|
+
- Do not rename files unless necessary for the requested fix.
|
|
316
|
+
- Do not rename functions, components, variables, props, routes, APIs, types, or interfaces unless necessary for the requested fix.
|
|
317
|
+
- Do not introduce new dependencies unless the user explicitly approves or the task clearly requires it.
|
|
318
|
+
- Do not change formatting-only parts unless related to the fix.
|
|
319
|
+
- Do not rewrite large sections of code when a small focused fix is enough.
|
|
320
|
+
- Preserve the existing project structure.
|
|
321
|
+
- Preserve the existing coding style.
|
|
322
|
+
- Prefer consistency with the existing codebase over personal preference.
|
|
323
|
+
|
|
324
|
+
### Soft preferences
|
|
325
|
+
|
|
326
|
+
- Prefer readable and maintainable code.
|
|
327
|
+
- Prefer type-safe solutions.
|
|
328
|
+
- Prefer existing utilities, components, hooks, schemas, and project patterns before creating new ones.
|
|
329
|
+
- Prefer small incremental changes over large rewrites.
|
|
330
|
+
- Prefer simple solutions over overly abstract solutions.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 8. Package and Dependency Rules
|
|
335
|
+
|
|
336
|
+
### Hard rules
|
|
337
|
+
|
|
338
|
+
- When adding a new npm package or dependency, always use the latest stable version available at the time the package is added.
|
|
339
|
+
- Prefer the existing package manager used by the project, such as npm, pnpm, yarn, or bun.
|
|
340
|
+
- When the package manager supports it, add new packages using the latest stable release target, for example:
|
|
341
|
+
- `npm install package-name@latest`
|
|
342
|
+
- `pnpm add package-name@latest`
|
|
343
|
+
- `yarn add package-name@latest`
|
|
344
|
+
- `bun add package-name@latest`
|
|
345
|
+
- Do not add old, deprecated, abandoned, beta, alpha, canary, next, or release-candidate versions unless the user explicitly asks for that version or the project clearly requires it.
|
|
346
|
+
- Do not change, upgrade, downgrade, or normalize versions of packages that already exist in `package.json` unless the user explicitly asks for dependency updates or the requested fix clearly requires changing an existing version.
|
|
347
|
+
- Before adding a package, check whether the project already has an equivalent dependency, utility, component, SDK, helper, or internal abstraction that should be reused instead.
|
|
348
|
+
- Do not introduce a new dependency if the problem can be solved cleanly with existing project dependencies.
|
|
349
|
+
- If a new package is necessary, choose the most official, maintained, widely adopted, and project-compatible package.
|
|
350
|
+
- If the latest package version cannot be verified because the registry, network, or tool access is unavailable, explain that limitation and use the package manager's default latest stable resolution without claiming the exact latest version was verified.
|
|
351
|
+
|
|
352
|
+
### Soft preferences
|
|
353
|
+
|
|
354
|
+
- Prefer minimal dependencies.
|
|
355
|
+
- Prefer packages that support the project's current runtime, framework, module system, and TypeScript configuration.
|
|
356
|
+
- Prefer packages with good maintenance, documentation, security posture, and ecosystem compatibility.
|
|
357
|
+
- Prefer exact project conventions for dependency type:
|
|
358
|
+
- runtime dependencies in `dependencies`
|
|
359
|
+
- development-only tools in `devDependencies`
|
|
360
|
+
- peer dependencies only when the project pattern requires it
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## 9. Production-Ready Code Rules
|
|
365
|
+
|
|
366
|
+
### Hard rules
|
|
367
|
+
|
|
368
|
+
- Every code change, implementation, snippet, or example must be production-ready unless the user explicitly asks for a prototype, experiment, mock, playground, or temporary example.
|
|
369
|
+
- Do not write code that is only for testing, trial, demo, placeholder, experimental use, or temporary proof-of-concept.
|
|
370
|
+
- Do not include placeholder logic such as fake data, dummy handlers, mock APIs, TODO-only implementations, console-only flows, or hardcoded temporary values unless the user explicitly asks for it.
|
|
371
|
+
- Do not leave unfinished implementation details such as:
|
|
372
|
+
- `TODO`
|
|
373
|
+
- `FIXME`
|
|
374
|
+
- `console.log` debugging
|
|
375
|
+
- temporary comments
|
|
376
|
+
- unused variables
|
|
377
|
+
- dead code
|
|
378
|
+
- commented-out code
|
|
379
|
+
- fake credentials
|
|
380
|
+
- dummy environment values
|
|
381
|
+
- incomplete error handling
|
|
382
|
+
- Code must be suitable for real project usage, not just to make an error disappear.
|
|
383
|
+
- Code must consider maintainability, type-safety, error handling, security, accessibility, performance, and existing project conventions when relevant.
|
|
384
|
+
- If the user asks for tests, write proper project-compatible tests, not throwaway test code.
|
|
385
|
+
- If production-ready implementation requires missing context, make the safest reasonable implementation based on existing project patterns and clearly state any assumptions.
|
|
386
|
+
|
|
387
|
+
### Soft preferences
|
|
388
|
+
|
|
389
|
+
- Prefer clean, maintainable, and minimal implementation.
|
|
390
|
+
- Prefer explicit error handling over silent failure.
|
|
391
|
+
- Prefer reusable project patterns over one-off logic.
|
|
392
|
+
- Prefer stable APIs and documented behavior.
|
|
393
|
+
- Prefer code that can pass lint, typecheck, build, and existing tests.
|
|
394
|
+
|
|
395
|
+
## 10. Project-Specific Conventions
|
|
396
|
+
|
|
397
|
+
Unless the user specifies otherwise for a project, follow the existing project conventions.
|
|
398
|
+
|
|
399
|
+
If the project already uses certain tools or patterns, prioritize them.
|
|
400
|
+
|
|
401
|
+
Examples:
|
|
402
|
+
|
|
403
|
+
- If the project uses Tailwind CSS, use Tailwind CSS.
|
|
404
|
+
- If the project uses shadcn/ui, prefer existing shadcn components.
|
|
405
|
+
- If the project uses TypeScript, keep the code type-safe.
|
|
406
|
+
- If the project uses Next.js App Router, follow App Router conventions.
|
|
407
|
+
- If the project uses React Server Components, respect server/client component boundaries.
|
|
408
|
+
- If the project uses Zod, use Zod for validation when relevant.
|
|
409
|
+
- If the project uses Zustand, follow existing store patterns.
|
|
410
|
+
- If the project uses Supabase, follow existing Supabase client/server patterns.
|
|
411
|
+
- If the project uses Prisma, follow the existing Prisma pattern.
|
|
412
|
+
- If the project uses Drizzle, follow the existing Drizzle pattern.
|
|
413
|
+
- If the project has a commit message convention, follow it.
|
|
414
|
+
- If the project has a folder structure convention, follow it.
|
|
415
|
+
- If the project has naming conventions, follow them.
|
|
416
|
+
- If the project has testing conventions, follow them.
|
|
417
|
+
|
|
418
|
+
Do not invent new conventions if the project already has existing ones.
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## 11. After Editing Code
|
|
423
|
+
|
|
424
|
+
After making code changes, explain briefly in Bahasa Indonesia:
|
|
425
|
+
|
|
426
|
+
- penyebab masalah
|
|
427
|
+
- plugin/skill/tool yang relevan jika digunakan
|
|
428
|
+
- file yang dicek
|
|
429
|
+
- file yang diubah
|
|
430
|
+
- apa yang diubah
|
|
431
|
+
- kenapa perubahan tersebut aman
|
|
432
|
+
- apa yang perlu dites berikutnya
|
|
433
|
+
|
|
434
|
+
Do not over-explain simple fixes.
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## 12. Git and Commit Rules
|
|
439
|
+
|
|
440
|
+
### Hard rules
|
|
441
|
+
|
|
442
|
+
- Do not create commits unless the user explicitly asks.
|
|
443
|
+
- Do not push changes unless the user explicitly asks.
|
|
444
|
+
- Do not create, delete, merge, or rebase branches unless the user explicitly asks.
|
|
445
|
+
- Do not rewrite Git history unless the user explicitly asks and the risks have been explained.
|
|
446
|
+
|
|
447
|
+
### Soft preferences
|
|
448
|
+
|
|
449
|
+
- If asked to suggest a commit message, use the existing project convention when available.
|
|
450
|
+
- If no convention exists, prefer concise conventional commit style, such as:
|
|
451
|
+
- `fix(scope): description`
|
|
452
|
+
- `feat(scope): description`
|
|
453
|
+
- `chore(scope): description`
|
|
454
|
+
- `docs(scope): description`
|
|
455
|
+
- `refactor(scope): description`
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## 13. Safety and Reliability
|
|
460
|
+
|
|
461
|
+
### Hard rules
|
|
462
|
+
|
|
463
|
+
- Do not assume that every error message means the user wants files changed.
|
|
464
|
+
- Do not perform broad changes without a clear reason.
|
|
465
|
+
- Do not hide uncertainty.
|
|
466
|
+
- Do not claim something was tested unless it was actually tested.
|
|
467
|
+
- Do not claim a command was run unless it was actually run.
|
|
468
|
+
- Do not ignore failing tests, lint, typecheck, or build output.
|
|
469
|
+
- If a command cannot be run, explain why.
|
|
470
|
+
|
|
471
|
+
### Soft preferences
|
|
472
|
+
|
|
473
|
+
- When there are multiple valid solutions, explain the trade-offs.
|
|
474
|
+
- Recommend the safest fix first.
|
|
475
|
+
- Point out risks when relevant.
|
|
476
|
+
- Prefer validation through existing project commands such as lint, typecheck, test, or build when appropriate.
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## 14. Final Behavior Summary
|
|
481
|
+
|
|
482
|
+
Always be helpful, but do not be aggressive in editing.
|
|
483
|
+
|
|
484
|
+
Be proactive in analysis, but conservative in file changes.
|
|
485
|
+
|
|
486
|
+
Use relevant plugins, skills, and tools based on context.
|
|
487
|
+
|
|
488
|
+
Do not modify project files unless the user explicitly gives a code-change trigger.
|
|
489
|
+
|
|
490
|
+
When fixing code, inspect related files and dependencies first, then apply minimal and safe changes.
|
|
491
|
+
|
|
492
|
+
## 15. Never Commit
|
|
493
|
+
|
|
494
|
+
Never commit to github and push to github.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 Licentora
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
File without changes
|
package/install.ps1
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Natroc installer — Windows (PowerShell)
|
|
2
|
+
#
|
|
3
|
+
# Default:
|
|
4
|
+
# powershell -c "irm https://natroc.ai/install.ps1 | iex"
|
|
5
|
+
#
|
|
6
|
+
# Variants (set env BEFORE the pipe):
|
|
7
|
+
# $env:NATROC_INSTALL_METHOD = "git" # clone + build from source
|
|
8
|
+
# $env:NATROC_INSTALL_METHOD = "tarball"; $env:NATROC_TARBALL_URL = "URL"
|
|
9
|
+
# $env:NATROC_INSTALL_DIR = "C:\apps\natroc" # custom source dir (git mode)
|
|
10
|
+
|
|
11
|
+
$ErrorActionPreference = "Stop"
|
|
12
|
+
|
|
13
|
+
$RequiredNodeMajor = 24
|
|
14
|
+
$PackageName = "natroc"
|
|
15
|
+
$GitRepo = "https://github.com/Licentora/Natroc.git"
|
|
16
|
+
$InstallDir = if ($env:NATROC_INSTALL_DIR) { $env:NATROC_INSTALL_DIR } else { Join-Path $HOME ".natroc" }
|
|
17
|
+
$SrcDir = Join-Path $InstallDir "src"
|
|
18
|
+
$Method = if ($env:NATROC_INSTALL_METHOD) { $env:NATROC_INSTALL_METHOD } else { "npm" }
|
|
19
|
+
|
|
20
|
+
function Test-Cmd {
|
|
21
|
+
param([string]$Name, [string]$Hint = "")
|
|
22
|
+
if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
|
|
23
|
+
Write-Host "Error: $Name is required but was not found in PATH." -ForegroundColor Red
|
|
24
|
+
if ($Hint) { Write-Host $Hint -ForegroundColor Red }
|
|
25
|
+
exit 1
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Test-Cmd "node" "Install Node.js $RequiredNodeMajor+ from https://nodejs.org and try again."
|
|
30
|
+
|
|
31
|
+
$NodeVersion = (node --version).TrimStart("v")
|
|
32
|
+
$NodeMajor = [int](($NodeVersion -split "\.")[0])
|
|
33
|
+
if ($NodeMajor -lt $RequiredNodeMajor) {
|
|
34
|
+
Write-Host "Error: Node.js $RequiredNodeMajor+ required (found v$NodeVersion)." -ForegroundColor Red
|
|
35
|
+
Write-Host "Tip: nvm install $RequiredNodeMajor; nvm use $RequiredNodeMajor"
|
|
36
|
+
exit 1
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
Test-Cmd "npm"
|
|
40
|
+
|
|
41
|
+
Write-Host "Natroc installer"
|
|
42
|
+
Write-Host " OS: Windows"
|
|
43
|
+
Write-Host " Node: v$NodeVersion"
|
|
44
|
+
Write-Host " Method: $Method"
|
|
45
|
+
Write-Host ""
|
|
46
|
+
|
|
47
|
+
switch ($Method) {
|
|
48
|
+
"npm" {
|
|
49
|
+
Write-Host "Installing $PackageName from the npm registry..."
|
|
50
|
+
npm install -g "$PackageName@latest"
|
|
51
|
+
if ($LASTEXITCODE -ne 0) {
|
|
52
|
+
Write-Host ""
|
|
53
|
+
Write-Host "npm install -g failed. Two common causes:" -ForegroundColor Red
|
|
54
|
+
Write-Host " 1. Package not published yet - try git mode:"
|
|
55
|
+
Write-Host " `$env:NATROC_INSTALL_METHOD = 'git'; irm https://natroc.ai/install.ps1 | iex"
|
|
56
|
+
Write-Host " 2. No write permission - use a user-local prefix:"
|
|
57
|
+
Write-Host " npm config set prefix `"`$HOME\.local`""
|
|
58
|
+
Write-Host " `$env:Path = `"`$HOME\.local;`$env:Path`""
|
|
59
|
+
exit $LASTEXITCODE
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
"git" {
|
|
63
|
+
Test-Cmd "git"
|
|
64
|
+
|
|
65
|
+
if (Test-Path (Join-Path $SrcDir ".git")) {
|
|
66
|
+
Write-Host "Updating existing clone in $SrcDir..."
|
|
67
|
+
Push-Location $SrcDir
|
|
68
|
+
git pull --ff-only
|
|
69
|
+
Pop-Location
|
|
70
|
+
} else {
|
|
71
|
+
Write-Host "Cloning $GitRepo into $SrcDir..."
|
|
72
|
+
$parent = Split-Path $SrcDir -Parent
|
|
73
|
+
if (-not (Test-Path $parent)) { New-Item -ItemType Directory -Force -Path $parent | Out-Null }
|
|
74
|
+
git clone --depth=1 $GitRepo $SrcDir
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Push-Location $SrcDir
|
|
78
|
+
Write-Host "Installing dependencies + building (this may take a minute)..."
|
|
79
|
+
npm install
|
|
80
|
+
if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }
|
|
81
|
+
npm run all:build
|
|
82
|
+
if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }
|
|
83
|
+
Write-Host "Linking 'natroc' bin globally (via npm link)..."
|
|
84
|
+
npm link
|
|
85
|
+
Pop-Location
|
|
86
|
+
}
|
|
87
|
+
"tarball" {
|
|
88
|
+
if (-not $env:NATROC_TARBALL_URL) {
|
|
89
|
+
Write-Host "Error: Set `$env:NATROC_TARBALL_URL to install from tarball." -ForegroundColor Red
|
|
90
|
+
exit 1
|
|
91
|
+
}
|
|
92
|
+
Write-Host "Installing from tarball: $($env:NATROC_TARBALL_URL)"
|
|
93
|
+
npm install -g $env:NATROC_TARBALL_URL
|
|
94
|
+
}
|
|
95
|
+
default {
|
|
96
|
+
Write-Host "Error: Unknown NATROC_INSTALL_METHOD: $Method" -ForegroundColor Red
|
|
97
|
+
Write-Host "Valid values: npm | git | tarball"
|
|
98
|
+
exit 1
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
Write-Host ""
|
|
103
|
+
Write-Host "Installed. Next steps:" -ForegroundColor Green
|
|
104
|
+
Write-Host " natroc setup # initialize ~/.natroc/"
|
|
105
|
+
Write-Host " natroc server # run gateway in the foreground"
|
|
106
|
+
Write-Host " natroc daemon install # OR install as a Windows scheduled task"
|
|
107
|
+
Write-Host " natroc daemon status # inspect the service"
|
|
108
|
+
Write-Host ""
|
|
109
|
+
Write-Host "Web UI + WebSocket: http://127.0.0.1:18789/"
|