You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -101,7 +97,8 @@ Parameters must be sent as tuples for multi-parameter methods:
101
97
```
102
98
103
99
#### Frontend keys in snake_case
104
-
All keys in TypeScript need to stay in snake_case (`node_id`), camelCase (`nodeId`) will break the app!
100
+
All keys in TypeScript need to stay in snake_case (e.g. `node_id`).
101
+
camelCase (e.g. `nodeId`) will break the app!
105
102
```typescript
106
103
exportinterfaceStatusSnapshot {
107
104
node_id:string;
@@ -154,7 +151,7 @@ Add system permissions in `pkg/manifest.json`:
154
151
"request_capabilities": [
155
152
"homepage:homepage:sys",
156
153
"http-server:distro:sys",
157
-
"vfs:distro:sys"// Add as needed
154
+
"vfs:distro:sys"
158
155
]
159
156
```
160
157
@@ -182,47 +179,29 @@ If sending messages between nodes, set:
182
179
- Check that the app is running in Hyperware environment
183
180
184
181
### WIT Generation Errors
185
-
- Use simple types or return JSON strings
186
-
- No HashMap (use Vec<(K,V)>)
187
182
- No fixed arrays (use Vec<T>)
188
183
- Add #[derive(PartialEq)] to structs
189
184
190
-
### Import Errors
191
-
- Import the most important structs and functions from `hyperware_process_lib`, e.g. `Request`, `LazyLoadBlob`, `ProcessId`
192
-
193
-
### manifest.json missing
194
-
- Run `kit b --hyperapp` to generate it
195
-
196
185
### Naming Restrictions
197
186
- No struct/enum/interface name is allowed to contain digits or the substring "stream", because WIT doesn't allow it
198
187
- No record/variant/enum name is allowed to end with `Request`, `Response`, `RequestWrapper`, `ResponseWrapper`, because TS caller utils are autogenerated with those suffixes
199
188
200
189
## Instructions
201
190
202
-
### Create an implementation plan
203
-
204
191
Carefully read the prompt; look carefully at `instructions.md` (if it exists) and in the example-apps directory.
205
-
In particular, note the example applications `example-apps/sign/`, `example-apps/id/`, and `example-apps/file-explorer`.
206
-
Note that `file-explorer` example contains an `api` folder, which is generated by the compiler, and not human or LLM written.
207
-
`sign` and `id` demonstrate local messaging.
208
-
`file-explorer` demonstrates VFS interactions.
209
-
210
-
Note in particular that bindings for the UI will be generated when the app is built with `kit build --hyperapp`.
211
-
As such, first design and implement the backend; the interface will be generated from the backend; finally design and implement the frontend to consume the interface.
212
-
Subsequent changes to the interface must follow this pattern as well: start in backend, generate interface, finish in frontend
213
-
214
-
Do NOT create the API.
215
-
The API is machine generated.
216
-
You create types that end up in the API by defining and using them in functions in the Rust backend "hyperapp"
217
192
218
-
### Implement the plan
193
+
In `example-apps/`:
194
+
-`sign` and `id` demonstrate local messaging.
195
+
-`file-explorer` demonstrates VFS interactions.
196
+
The `file-explorer` example contains an `api` folder, which is generated by the compiler, and not human or LLM written.
219
197
220
-
Look carefully at `IMPLEMENTATION_PLAN.md` and in the `example-apps/` directory, if relevant.
198
+
Look at the `hyperware_process_lib` and in particular at `hyperapp`.
199
+
If not provided with local repo look at https://github.com/hyperware-ai/process_lib/tree/main/src and https://raw.githubusercontent.com/hyperware-ai/process_lib/refs/heads/main/src/hyperapp.rs
221
200
222
-
Work from the existing template that exists at `hyperapp-skeleton/` and `ui/`.
201
+
Work from the existing template, whose backend lives at `my-app-name/` and frontend at`ui/`.
223
202
224
-
Note in particular that bindings for the UI will be generated when the app is built with `kit build --hyperapp`.
225
-
As such, first design and implement the backend; the interface will be generated from the backend; finally design and implement the frontend to consume the interface.
203
+
Bindings for the UI will be generated when the app is built with `kit build --hyperapp`.
204
+
Thus, first design and implement the backend; the interface will be generated from the backend; finally design and implement the frontend to consume the interface.
226
205
Subsequent changes to the interface must follow this pattern as well: start in backend, generate interface, finish in frontend
227
206
228
207
Do NOT create the API.
@@ -231,10 +210,11 @@ You create types that end up in the API by defining and using them in functions
231
210
232
211
When sending p2p always send using `hyperware_process_lib::hyperapp::send` or `hyperware_process_lib::hyperapp::send_rmp` when expecting a Response, never `.send_and_await_response`.
233
212
Example usage of `send` and `send_rmp` are shown in example_apps.
234
-
If not expecting a response, use `.send`.
213
+
If not expecting a response, use `hyperware_process_lib::Request::send`.
235
214
236
-
Do not worry about serialization/deserialization when using `send` and `send_rmp` functions for p2p communication.
237
-
Notice that this all happens within those functions: just take the rust types as args and return rust types as return values.
215
+
`send` and `send_rmp` handle (de)serialization.
216
+
Just put Rust types as args and return Rust types as return values.
217
+
Do not return String or JSON if a more specific Rust type will work.
238
218
239
219
If you create a GUI for the app you MUST use target/ui/caller-utils.ts for HTTP requests to the backend.
0 commit comments