Repository navigation
Expand file tree
/
Copy pathnative_apps.rs
More file actions
582 lines (569 loc) · 27.6 KB
/
Copy pathnative_apps.rs
File metadata and controls
582 lines (569 loc) · 27.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
//! @generated by tools/native_apps.py from native-apps.json: do not edit;
//! change the manifest and run the script (ADR 0004 §1).
//!
//! The native apps this shell can link, in link order: the modules
//! `apps::linked_modules()` pushes under each app's feature, and the
//! hosting each app gets by default on each target.
use makepad_app_module::AppModule;
/// An app's hosting on one target, as the manifest declares it.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Hosting {
/// In the shell's process: a splash isolate per instance.
Module,
/// Its own process (`bin`), connected to the shell's hub.
Process,
/// Its own process on a Vulkan build in a Wayland session; in the
/// shell's process otherwise (a process-only app: not there).
ProcessIfVulkan,
/// Not on this target: a process-only app (no module) where
/// there are no processes.
None,
}
/// Who shows the person a tool's live confirmation (ADR 0004 §8).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Confirm {
/// The shell's own sheet (the assistant's confirm card).
Host,
/// The owning app's own sheet.
App,
}
/// How the shell treats one of an app's assistant tools.
#[derive(Debug)]
pub struct ToolPolicy {
pub tool: &'static str,
pub confirm: Confirm,
/// Whether a standing rule may answer its confirmation; `false`:
/// only the person, live, every time (outside developer mode).
pub auto_approvable: bool,
}
/// What a process-hosted instance may reach on the network (ADR 0004 §3).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Network {
/// Nothing but the shell's hub on loopback.
None,
Any,
}
/// The port to the shell's octos kernel an app that is itself an octos
/// client gets (`kernel`; ADR 0003).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum KernelPort {
/// None: a port the app opens is closed.
None,
/// The coding scope the kernel router enforces: the app's own
/// sessions, in workspaces the person picked.
Coding,
}
/// One `native-apps.json` entry, as far as the shell reads it.
#[derive(Debug)]
pub struct NativeApp {
pub id: &'static str,
/// The shell's Cargo feature that links it.
pub feature: &'static str,
/// The binary a process-hosted instance runs.
pub bin: Option<&'static str>,
pub macos: Hosting,
pub windows: Hosting,
pub linux: Hosting,
pub android: Hosting,
pub ios: Hosting,
pub ohos: Hosting,
pub wasm: Hosting,
/// The `octos.*` services its reviewed entry grants it.
pub octos: &'static [&'static str],
/// Its assistant tools' confirmation rules (`agent.tool_policy`).
pub tools: &'static [ToolPolicy],
/// `sandbox.network`: what its OS sandbox lets it reach.
pub network: Network,
/// `sandbox.processes`: whether it may start child processes.
pub processes: bool,
/// `storage.accounts`: one folder (and agent) per account.
pub accounts: bool,
/// `storage.external`: `<root>[/<path>]:ro|rw` outside its jail.
pub external: &'static [&'static str],
/// The whole `storage` block as JSON, which the shell parses with
/// `app_storage::StorageSpec` at startup (ADR 0004 §11).
pub storage: &'static str,
/// `agent.tools`: its own tools, the `tools.json` entries (a JSON
/// array; empty when it declares none).
pub tools_json: &'static str,
/// `agent.generic_tools`: exactly the octos kernel tools its agent
/// gets (none when empty; never octos's shell).
pub generic_tools: &'static [&'static str],
/// `agent.grants`: other apps' shareable tools its agent may call,
/// as (owning app, tool).
pub grants: &'static [(&'static str, &'static str)],
/// `agent.system_tools`: its own read tools the system agent may
/// call while the app runs (full names).
pub system_tools: &'static [&'static str],
/// `agent.own_tools`: the tools its own agent may call (full
/// names; every one of `tools` unless the entry narrows them).
pub own_tools: &'static [&'static str],
/// `agent.budget`: its agent's tool calls per turn and per day
/// (`None`: the shell's defaults).
pub calls_per_turn: Option<u32>,
pub calls_per_day: Option<u32>,
/// `kernel`: its port to the shell's kernel.
pub kernel: KernelPort,
}
pub const APPS: &[NativeApp] = &[
NativeApp {
id: "updater",
feature: "app-updater",
bin: None,
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &[],
tools: &[],
network: Network::Any,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "rinx",
feature: "app-rinx",
bin: None,
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::Any,
processes: false,
accounts: true,
external: &[],
storage: r#"{"accounts": true, "agent_workspace": "account", "external": []}"#,
tools_json: r##"[]"##,
generic_tools: &["read_file", "write_file", "edit_file", "diff_edit", "apply_patch", "glob", "grep", "list_dir", "code_structure", "ask_user_question", "view_image", "recall", "recall_memory", "memory_search", "memory_load", "save_memory", "memory_note", "web_search", "web_fetch", "tool_search"],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "reference",
feature: "app-reference",
bin: Some("octosense-reference"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &[],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "sheets",
feature: "app-sheets",
bin: Some("sheets"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"sheets.new","description":"Create an empty workbook session on the sheet engine. Answers the workbook handle and its sheet names. Nothing touches disk until sheets.export.","input_schema":{"type":"object","properties":{},"additionalProperties":false},"risk":"act"},{"name":"sheets.open","description":"Open an xlsx file from your workspace as a workbook session. The path is relative to your workspace; paths outside it are refused.","input_schema":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512}},"required":["path"],"additionalProperties":false},"risk":"act"},{"name":"sheets.set","description":"Set cells in an open workbook: each entry is a cell like A1 with a value (number, text or boolean) or a formula. Formulas compute at the next sheets.recalc.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1},"sheet":{},"cells":{"type":"array","minItems":1,"maxItems":256,"items":{"type":"object","properties":{"at":{"type":"string","maxLength":12},"value":{},"formula":{"type":"string","maxLength":2048}},"required":["at"],"additionalProperties":false}}},"required":["book","cells"],"additionalProperties":false},"risk":"act"},{"name":"sheets.get","description":"Read a rectangle of computed values from an open workbook, row-major, as a range like A1:C9 or a single cell like B2.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1},"sheet":{},"range":{"type":"string","minLength":2,"maxLength":24}},"required":["book","range"],"additionalProperties":false},"risk":"read","shareable":true},{"name":"sheets.eval","description":"Evaluate one spreadsheet formula and answer its value, without storing anything: against an open workbook when `book` is given, else as a plain calculation.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1},"sheet":{},"at":{"type":"string","maxLength":12},"formula":{"type":"string","minLength":1,"maxLength":2048}},"required":["formula"],"additionalProperties":false},"risk":"read","shareable":true},{"name":"sheets.fill","description":"Fill a formula down a column of an open workbook for up to two million rows. The numeric subset runs as one compiled kernel (milliseconds for a million rows); anything else computes row by row on the engine's evaluator — the answer says which. Results land as values.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1},"sheet":{},"column":{"type":"string","minLength":1,"maxLength":4},"rows":{"type":"integer","minimum":1,"maximum":2000000},"formula":{"type":"string","minLength":1,"maxLength":2048}},"required":["book","column","rows","formula"],"additionalProperties":false},"risk":"act"},{"name":"sheets.recalc","description":"Recalculate every stored formula in an open workbook, so sheets.get reads fresh values.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1}},"required":["book"],"additionalProperties":false},"risk":"act"},{"name":"sheets.export","description":"Write an open workbook as an xlsx file into your workspace. The path is relative to your workspace; paths outside it are refused, and a file already at that path is never replaced: choose a new name.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1},"path":{"type":"string","minLength":1,"maxLength":512}},"required":["book","path"],"additionalProperties":false},"risk":"act"},{"name":"sheets.close","description":"Close an open workbook session without exporting it. Unexported changes are gone; the engine holds at most sixteen open workbooks.","input_schema":{"type":"object","properties":{"book":{"type":"integer","minimum":1}},"required":["book"],"additionalProperties":false},"risk":"act"}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["sheets.get", "sheets.eval"],
own_tools: &["sheets.new", "sheets.open", "sheets.set", "sheets.get", "sheets.eval", "sheets.fill", "sheets.recalc", "sheets.export", "sheets.close"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "terminal",
feature: "app-terminal",
bin: Some("terminal"),
macos: Hosting::Process,
windows: Hosting::Process,
linux: Hosting::ProcessIfVulkan,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[
ToolPolicy { tool: "run", confirm: Confirm::Host, auto_approvable: false },
],
network: Network::Any,
processes: true,
accounts: false,
external: &["home:rw"],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": ["home:rw"]}"#,
tools_json: r##"[{"name":"terminal.run","description":"Type a command followed by Enter into the person's live Terminal. The person approves each command first, on a sheet that shows it exactly; it then runs for real in the terminal they see, inside the Terminal's own sandbox: the person's files and the network are reachable, OctoSense's private data and the build toolchain are not. It returns at once: the output is on the Terminal's screen.","input_schema":{"type":"object","properties":{"command":{"type":"string","maxLength":4096}},"required":["command"],"additionalProperties":false},"risk":"destructive","confirm":"host","shareable":true},{"name":"terminal.read_screen","description":"Read the terminal grid that is visible now, with trailing spaces removed from each row, plus cursor and working-directory context.","input_schema":{"type":"object","properties":{},"additionalProperties":false},"risk":"read","shareable":true},{"name":"terminal.read_scrollback","description":"Read the last requested number of lines from the terminal's scrollback plus screen (default 200, at most 2000).","input_schema":{"type":"object","properties":{"lines":{"type":"integer","minimum":1,"maximum":2000}},"additionalProperties":false},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &["terminal.read_screen", "terminal.read_scrollback"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "appcard",
feature: "app-appcard",
bin: None,
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &[],
tools: &[],
network: Network::Any,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "apphub",
feature: "app-hub",
bin: None,
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::Any,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"apphub.search","description":"Find apps in the signed OctoSense catalog whose name, description, category or publisher match every word of the query. Answers each app's id, name, subtitle, category, publisher, version and status (available, installed, update available, built in or unavailable). Does not install anything.","input_schema":{"type":"object","properties":{"query":{"type":"string","maxLength":200},"category":{"type":"string","maxLength":64}},"required":["query"],"additionalProperties":false},"risk":"read","shareable":true},{"name":"apphub.installed","description":"List the apps installed from App Hub: id, name, version and whether an update is available.","input_schema":{"type":"object","properties":{},"additionalProperties":false},"risk":"read","shareable":true},{"name":"apphub.updates","description":"List the installed apps that have a newer release in the catalog: id, name and the catalog's version. Does not update anything.","input_schema":{"type":"object","properties":{},"additionalProperties":false},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["apphub.search", "apphub.installed", "apphub.updates"],
own_tools: &["apphub.search", "apphub.installed", "apphub.updates"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "calculator",
feature: "app-calculator",
bin: Some("calculator"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"calculator.eval","description":"Evaluate an expression. Uses the on-screen angle mode. Does not change the calculation, memory, or history.","input_schema":{"type":"object","properties":{"expression":{"type":"string","maxLength":1024}},"required":["expression"],"additionalProperties":false},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["calculator.eval"],
own_tools: &["calculator.eval"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "clock",
feature: "app-clock",
bin: Some("clock"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"clock.now","description":"The current local time and date, the next alarm, and any running timer or stopwatch.","input_schema":{"type":"object","properties":{}},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["clock.now"],
own_tools: &["clock.now"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "notes",
feature: "app-notes",
bin: Some("notes"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"notes.search","description":"Find active notes whose title or body contains the query. Answers id, title, preview, folder, edited_ms and pinned.","input_schema":{"type":"object","properties":{"query":{"type":"string","description":"text to find"}},"required":["query"]},"risk":"read","shareable":true},{"name":"notes.read","description":"Read one active note by id: folder, title, complete source, timestamps and pinned state.","input_schema":{"type":"object","properties":{"id":{"type":"string","description":"note id such as n000001"}},"required":["id"]},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["notes.search", "notes.read"],
own_tools: &["notes.search", "notes.read"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "reminders",
feature: "app-reminders",
bin: Some("reminders"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"reminders.due","description":"Incomplete dated reminders due before today plus N days, including overdue items and today.","input_schema":{"type":"object","properties":{"days":{"type":"integer","minimum":1,"maximum":31}},"required":["days"],"additionalProperties":false},"risk":"read","shareable":true},{"name":"reminders.list","description":"Reminders in a smart list or personal list, using the same projection as the UI.","input_schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"],"additionalProperties":false},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["reminders.due", "reminders.list"],
own_tools: &["reminders.due", "reminders.list"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "weather",
feature: "app-weather",
bin: Some("weather"),
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &["octos.session.open", "octos.session.history", "octos.turn.start", "octos.turn.interrupt"],
tools: &[],
network: Network::Any,
processes: false,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[{"name":"weather.current","description":"Current conditions and the 5-day forecast for the city selected on screen.","input_schema":{"type":"object","properties":{}},"risk":"read","shareable":true}]"##,
generic_tools: &[],
grants: &[],
system_tools: &["weather.current"],
own_tools: &["weather.current"],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
NativeApp {
id: "octoscode",
feature: "app-octoscode",
bin: None,
macos: Hosting::Module,
windows: Hosting::Module,
linux: Hosting::Module,
android: Hosting::Module,
ios: Hosting::Module,
ohos: Hosting::Module,
wasm: Hosting::Module,
octos: &[],
tools: &[],
network: Network::None,
processes: false,
accounts: false,
external: &["home:rw"],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": ["home:rw"]}"#,
tools_json: r##"[]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::Coding,
},
NativeApp {
id: "task",
feature: "app-task",
bin: Some("task"),
macos: Hosting::Process,
windows: Hosting::Process,
linux: Hosting::ProcessIfVulkan,
android: Hosting::None,
ios: Hosting::None,
ohos: Hosting::None,
wasm: Hosting::None,
octos: &[],
tools: &[],
network: Network::None,
processes: true,
accounts: false,
external: &[],
storage: r#"{"accounts": false, "agent_workspace": "none", "external": []}"#,
tools_json: r##"[]"##,
generic_tools: &[],
grants: &[],
system_tools: &[],
own_tools: &[],
calls_per_turn: None,
calls_per_day: None,
kernel: KernelPort::None,
},
];
impl NativeApp {
/// Its hosting on the target this shell is built for.
pub const fn on_this_target(&self) -> Hosting {
if cfg!(target_arch = "wasm32") {
self.wasm
} else if cfg!(target_os = "android") {
self.android
} else if cfg!(target_os = "ios") {
self.ios
} else if cfg!(target_env = "ohos") {
self.ohos
} else if cfg!(target_os = "macos") {
self.macos
} else if cfg!(target_os = "windows") {
self.windows
} else {
self.linux
}
}
}
impl NativeApp {
/// The rule for one of its tools, if the manifest sets one.
pub fn tool(&self, name: &str) -> Option<&'static ToolPolicy> {
self.tools.iter().find(|rule| rule.tool == name)
}
}
/// The manifest entry for an app id.
pub fn find(id: &str) -> Option<&'static NativeApp> {
APPS.iter().find(|app| app.id == id)
}
/// The Cargo package (`crate`) of an app with a `bin`: what a process
/// launch builds from the workspace, `cargo build --locked -p
/// octosense-process-apps -p <package>` (crates/process-apps).
pub fn package_of(id: &str) -> Option<&'static str> {
match id {
"reference" => Some("octosense-reference"),
"sheets" => Some("makepad-sheets"),
"terminal" => Some("makepad-terminal"),
"calculator" => Some("makepad-calculator"),
"clock" => Some("makepad-clock"),
"notes" => Some("makepad-notes"),
"reminders" => Some("makepad-reminders"),
"weather" => Some("makepad-weather"),
"task" => Some("makepad-task"),
_ => None,
}
}
/// Push the native modules this build links, in manifest order.
#[allow(unused_variables)]
pub fn link(out: &mut Vec<&'static dyn AppModule>) {
#[cfg(any(feature = "app-updater", native_mobile))]
out.push(&octosense_updater_ui::UPDATER_MODULE);
#[cfg(feature = "app-rinx")]
out.push(&rinx::module::RINX_MODULE);
#[cfg(any(feature = "app-reference", native_mobile))]
out.push(&octosense_reference::REFERENCE_MODULE);
#[cfg(any(feature = "app-sheets", native_mobile))]
out.push(&makepad_sheets::SHEETS_MODULE);
#[cfg(feature = "app-terminal")]
out.push(&makepad_terminal::TERMINAL_MODULE);
#[cfg(feature = "app-appcard")]
out.push(&octosense_appcard::APPCARD_MODULE);
#[cfg(any(feature = "app-hub", native_mobile))]
{
out.push(&octosense_app_hub_app::APP_HUB_MODULE);
out.push(&octosense_app_hub_app::CARD_MODULE);
}
#[cfg(feature = "app-calculator")]
out.push(&makepad_calculator::CALCULATOR_MODULE);
#[cfg(feature = "app-clock")]
out.push(&makepad_clock::CLOCK_MODULE);
#[cfg(feature = "app-notes")]
out.push(&makepad_notes::NOTES_MODULE);
#[cfg(feature = "app-reminders")]
out.push(&makepad_reminders::REMINDERS_MODULE);
#[cfg(feature = "app-weather")]
out.push(&makepad_weather::WEATHER_MODULE);
#[cfg(feature = "app-octoscode")]
out.push(&octoscode_module::OCTOSCODE_MODULE);
}