Skip to main content

arvo_api/generated/
arvo.platform.v1.rs

1// This file is @generated by prost-build.
2#[derive(serde::Serialize, serde::Deserialize)]
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct JobId {
5    #[prost(string, tag = "1")]
6    pub id: ::prost::alloc::string::String,
7}
8#[derive(serde::Serialize, serde::Deserialize)]
9#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10pub struct VendorId {
11    #[prost(string, tag = "1")]
12    pub vendor: ::prost::alloc::string::String,
13}
14#[derive(serde::Serialize, serde::Deserialize)]
15#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
16pub struct VendorProfile {
17    #[prost(string, tag = "1")]
18    pub vendor: ::prost::alloc::string::String,
19    /// Which sub-account, for a vendor that has them (Alpaca's paper and live).
20    #[prost(string, optional, tag = "2")]
21    pub profile: ::core::option::Option<::prost::alloc::string::String>,
22}
23#[derive(serde::Serialize, serde::Deserialize)]
24#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
25pub struct AccountKeys {
26    #[prost(string, tag = "1")]
27    pub vendor: ::prost::alloc::string::String,
28    #[prost(string, optional, tag = "2")]
29    pub profile: ::core::option::Option<::prost::alloc::string::String>,
30    #[prost(string, tag = "3")]
31    pub key_id: ::prost::alloc::string::String,
32    #[prost(string, tag = "4")]
33    pub secret: ::prost::alloc::string::String,
34}
35#[derive(serde::Serialize, serde::Deserialize)]
36#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
37pub struct SignIn {
38    /// Where to send the person. The caller opens it: the engine binds the
39    /// loopback listener and exchanges the code, but opening a browser is the
40    /// front end's job (ADR-0028).
41    #[prost(string, tag = "1")]
42    pub url: ::prost::alloc::string::String,
43}
44/// A script's path, relative to the project folder. What identifies a
45/// schedule: one schedule per script.
46#[derive(serde::Serialize, serde::Deserialize)]
47#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
48pub struct ScriptPath {
49    #[prost(string, tag = "1")]
50    pub path: ::prost::alloc::string::String,
51}
52/// A run in progress, as `RunScript` numbered it.
53#[derive(serde::Serialize, serde::Deserialize)]
54#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
55pub struct RunId {
56    #[prost(uint32, tag = "1")]
57    pub run: u32,
58}
59/// A cadence a person set for one of their scripts.
60#[derive(serde::Serialize, serde::Deserialize)]
61#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
62pub struct ScriptSchedule {
63    /// Relative to the project folder.
64    #[prost(string, tag = "1")]
65    pub script: ::prost::alloc::string::String,
66    /// The cadence when no cron expression is set. Kept either way, so
67    /// switching to cron and back does not lose what the interval was.
68    #[prost(uint64, tag = "2")]
69    pub every_secs: u64,
70    /// A cron expression as the person wrote it. When set it decides when the
71    /// script runs and `every_secs` is not consulted.
72    #[prost(string, optional, tag = "3")]
73    pub cron: ::core::option::Option<::prost::alloc::string::String>,
74    #[prost(bool, tag = "4")]
75    pub enabled: bool,
76}
77#[derive(serde::Serialize, serde::Deserialize)]
78#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
79pub struct JobView {
80    #[prost(string, tag = "1")]
81    pub id: ::prost::alloc::string::String,
82    #[prost(string, tag = "2")]
83    pub label: ::prost::alloc::string::String,
84    /// The project script this job runs, when it is a scheduled script
85    /// rather than one of the runtime's own. `None` for a built-in.
86    #[prost(string, optional, tag = "3")]
87    pub script: ::core::option::Option<::prost::alloc::string::String>,
88    /// The cron expression it runs on, as the person wrote it. `None` for a
89    /// job on a fixed interval, where `every_secs` is the cadence.
90    #[prost(string, optional, tag = "4")]
91    pub cron: ::core::option::Option<::prost::alloc::string::String>,
92    #[prost(uint64, tag = "5")]
93    pub every_secs: u64,
94    #[prost(bool, tag = "6")]
95    pub running: bool,
96    #[prost(uint32, tag = "7")]
97    pub runs: u32,
98    #[prost(string, optional, tag = "8")]
99    pub last_started: ::core::option::Option<::prost::alloc::string::String>,
100    #[prost(string, optional, tag = "9")]
101    pub last_finished: ::core::option::Option<::prost::alloc::string::String>,
102    /// One line from the last run that succeeded.
103    #[prost(string, optional, tag = "10")]
104    pub last_result: ::core::option::Option<::prost::alloc::string::String>,
105    /// Why the last run failed, when it did.
106    #[prost(string, optional, tag = "11")]
107    pub last_error: ::core::option::Option<::prost::alloc::string::String>,
108    #[prost(string, optional, tag = "12")]
109    pub next_run: ::core::option::Option<::prost::alloc::string::String>,
110}
111#[derive(serde::Serialize, serde::Deserialize)]
112#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
113pub struct PluginStatusView {
114    #[prost(oneof = "plugin_status_view::Of", tags = "1, 2")]
115    pub of: ::core::option::Option<plugin_status_view::Of>,
116}
117/// Nested message and enum types in `PluginStatusView`.
118pub mod plugin_status_view {
119    #[derive(serde::Serialize, serde::Deserialize)]
120    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
121    pub enum Of {
122        #[prost(message, tag = "1")]
123        Reachable(super::PluginStatusViewReachable),
124        #[prost(message, tag = "2")]
125        Unreachable(super::PluginStatusViewUnreachable),
126    }
127}
128#[derive(serde::Serialize, serde::Deserialize)]
129#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
130pub struct PluginStatusViewReachable {
131    #[prost(string, tag = "1")]
132    pub name: ::prost::alloc::string::String,
133    #[prost(string, tag = "2")]
134    pub version: ::prost::alloc::string::String,
135    #[prost(string, repeated, tag = "3")]
136    pub capabilities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
137}
138#[derive(serde::Serialize, serde::Deserialize)]
139#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
140pub struct PluginStatusViewUnreachable {
141    #[prost(string, tag = "1")]
142    pub reason: ::prost::alloc::string::String,
143}
144#[derive(serde::Serialize, serde::Deserialize)]
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct PluginView {
147    #[prost(string, tag = "1")]
148    pub id: ::prost::alloc::string::String,
149    #[prost(string, tag = "2")]
150    pub address: ::prost::alloc::string::String,
151    #[prost(message, optional, tag = "3")]
152    pub status: ::core::option::Option<PluginStatusView>,
153}
154/// One signal a plugin publishes, as it stands right now (#163).
155///
156/// A signal that is declared and has no value is shown with none, not with
157/// a zero and not with whatever it last said. That is the invariant made
158/// visible: a reader looking at this list should be able to see the
159/// difference between "nothing to say" and "saying nothing has changed".
160#[derive(serde::Serialize, serde::Deserialize)]
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct SignalView {
163    #[prost(string, tag = "1")]
164    pub name: ::prost::alloc::string::String,
165    #[prost(string, tag = "2")]
166    pub description: ::prost::alloc::string::String,
167    /// Whether each value is computed from what was known at that instant.
168    /// A study may gate on a causal signal and never on a descriptive one.
169    #[prost(bool, tag = "3")]
170    pub causal: bool,
171    /// Why it is not causal, in the provider's own words. Empty when it is.
172    #[prost(string, tag = "4")]
173    pub because: ::prost::alloc::string::String,
174    /// What computes it, by name and version.
175    #[prost(string, tag = "5")]
176    pub engine: ::prost::alloc::string::String,
177    /// The instant the value describes, empty when there is no value.
178    #[prost(string, tag = "6")]
179    pub at: ::prost::alloc::string::String,
180    /// `None` is the answer for a signal that is declared and silent, and
181    /// for one whose provider has gone away.
182    #[prost(double, optional, tag = "7")]
183    pub value: ::core::option::Option<f64>,
184}
185/// One strategy an extension contributes as a document (#162).
186///
187/// Data Arvo reads, like a theme: there is no code in it and none runs in
188/// the window. A document this build cannot offer is listed with the reason
189/// rather than dropped, so a person can see why their catalog is one entry
190/// short.
191#[derive(serde::Serialize, serde::Deserialize)]
192#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
193pub struct StrategyContributionView {
194    /// Namespaced by its extension: `their-catalog.fast-cross`.
195    #[prost(string, tag = "1")]
196    pub id: ::prost::alloc::string::String,
197    #[prost(string, tag = "2")]
198    pub label: ::prost::alloc::string::String,
199    #[prost(string, tag = "3")]
200    pub premise: ::prost::alloc::string::String,
201    /// `grid` or `rules`, as the document names its kind.
202    #[prost(string, tag = "4")]
203    pub kind: ::prost::alloc::string::String,
204    #[prost(string, tag = "5")]
205    pub interval: ::prost::alloc::string::String,
206    /// Configurations the search holds; zero for a kind that is not a grid.
207    #[prost(uint32, tag = "6")]
208    pub configurations: u32,
209    /// Why it is not in the strategy picker. `None` means it is.
210    #[prost(string, optional, tag = "7")]
211    pub problem: ::core::option::Option<::prost::alloc::string::String>,
212}
213/// A list, as a message.
214///
215/// An RPC returns one message, never a bare repeated field, so a call that
216/// answers with a list needs a name for the list. The wrapper is also where
217/// a total or a "when this was read" goes later, without renumbering what is
218/// already here.
219#[derive(serde::Serialize, serde::Deserialize)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct JobsView {
222    #[prost(message, repeated, tag = "1")]
223    pub jobs: ::prost::alloc::vec::Vec<JobView>,
224}
225/// The plugins this engine hosts. A list, as a message; see `JobsView`.
226#[derive(serde::Serialize, serde::Deserialize)]
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct PluginsView {
229    #[prost(message, repeated, tag = "1")]
230    pub plugins: ::prost::alloc::vec::Vec<PluginView>,
231}
232/// What the plugins publish. A list, as a message; see `JobsView`.
233#[derive(serde::Serialize, serde::Deserialize)]
234#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct SignalsView {
236    #[prost(message, repeated, tag = "1")]
237    pub signals: ::prost::alloc::vec::Vec<SignalView>,
238}
239/// What one extension contributes to the strategy picker.
240///
241/// Its own message because a proto map's value cannot itself be repeated.
242#[derive(serde::Serialize, serde::Deserialize)]
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct StrategyContributionsView {
245    #[prost(message, repeated, tag = "1")]
246    pub contributions: ::prost::alloc::vec::Vec<StrategyContributionView>,
247}
248/// Every extension's contributions, by extension name.
249#[derive(serde::Serialize, serde::Deserialize)]
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct ExtensionStrategiesView {
252    #[prost(map = "string, message", tag = "1")]
253    pub by_extension: ::std::collections::HashMap<
254        ::prost::alloc::string::String,
255        StrategyContributionsView,
256    >,
257}
258/// One vendor as the Accounts view shows it: what it needs from the
259/// person, whether it has it, and what it gives back.
260#[derive(serde::Serialize, serde::Deserialize)]
261#[derive(Clone, PartialEq, ::prost::Message)]
262pub struct AccountView {
263    /// The vendor's id: `robinhood`, `alpaca`, `yahoo`.
264    #[prost(string, tag = "1")]
265    pub id: ::prost::alloc::string::String,
266    #[prost(string, tag = "2")]
267    pub label: ::prost::alloc::string::String,
268    /// `none`, `sign_in` or `keys`.
269    #[prost(string, tag = "3")]
270    pub credential: ::prost::alloc::string::String,
271    /// Whether the credential is there and the vendor can be used. Always
272    /// true for one needing nothing.
273    #[prost(bool, tag = "4")]
274    pub connected: bool,
275    /// In words: `bars`, `quotes`, `holdings`, `option quotes`.
276    #[prost(string, repeated, tag = "5")]
277    pub provides: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
278    /// The sources under this vendor, by label.
279    #[prost(string, repeated, tag = "6")]
280    pub sources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
281    /// When one vendor login holds several accounts that each need their own
282    /// credential — Alpaca's paper and live, from one login but two key pairs
283    /// — each is one of these. Empty for a vendor with a single credential.
284    #[prost(message, repeated, tag = "7")]
285    pub subaccounts: ::prost::alloc::vec::Vec<SubAccountView>,
286}
287/// One account under a vendor that has more than one: its own credential and
288/// its own state, sharing the vendor's row.
289#[derive(serde::Serialize, serde::Deserialize)]
290#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
291pub struct SubAccountView {
292    /// The vendor's spelling: `paper`, `live`.
293    #[prost(string, tag = "1")]
294    pub id: ::prost::alloc::string::String,
295    #[prost(string, tag = "2")]
296    pub label: ::prost::alloc::string::String,
297    #[prost(bool, tag = "3")]
298    pub connected: bool,
299    /// Real money, so the window can mark it. Paper is not.
300    #[prost(bool, tag = "4")]
301    pub live: bool,
302}
303/// A person's vendors. A list, as a message; see `JobsView`.
304#[derive(serde::Serialize, serde::Deserialize)]
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct AccountsView {
307    #[prost(message, repeated, tag = "1")]
308    pub accounts: ::prost::alloc::vec::Vec<AccountView>,
309}
310/// Something that happened while nobody was looking: a plugin dropped, a
311/// broker session ended (#150).
312///
313/// Every other view answers a question a front end asked. This is the other
314/// direction, so it arrives on a stream rather than as a reply.
315///
316/// # Why the text is in the payload
317///
318/// `title` and `detail` are filled in by the engine rather than derived from
319/// the kind by whoever renders it. There are two renderers — the OS
320/// notification and the in-app alerts list — and text derived twice is text
321/// that drifts. The kind is left for what a renderer needs *structurally*:
322/// the status bar needs to know a feed is down, not how to phrase it.
323#[derive(serde::Serialize, serde::Deserialize)]
324#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
325pub struct EventView {
326    #[prost(message, optional, tag = "1")]
327    pub kind: ::core::option::Option<EventKindView>,
328    #[prost(string, tag = "2")]
329    pub title: ::prost::alloc::string::String,
330    #[prost(string, tag = "3")]
331    pub detail: ::prost::alloc::string::String,
332    #[prost(enumeration = "SeverityView", tag = "4")]
333    pub severity: i32,
334}
335/// What happened, structurally.
336#[derive(serde::Serialize, serde::Deserialize)]
337#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
338pub struct EventKindView {
339    #[prost(oneof = "event_kind_view::Of", tags = "1, 2, 3, 4, 5")]
340    pub of: ::core::option::Option<event_kind_view::Of>,
341}
342/// Nested message and enum types in `EventKindView`.
343pub mod event_kind_view {
344    #[derive(serde::Serialize, serde::Deserialize)]
345    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
346    pub enum Of {
347        #[prost(message, tag = "1")]
348        Plugin(super::PluginEvent),
349        #[prost(message, tag = "2")]
350        Feed(super::FeedEvent),
351        #[prost(message, tag = "3")]
352        Stream(super::StreamEvent),
353        #[prost(message, tag = "4")]
354        Findings(super::FindingsEvent),
355        #[prost(message, tag = "5")]
356        Session(super::SessionEvent),
357    }
358}
359#[derive(serde::Serialize, serde::Deserialize)]
360#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
361pub struct PluginEvent {
362    #[prost(string, tag = "1")]
363    pub id: ::prost::alloc::string::String,
364    #[prost(bool, tag = "2")]
365    pub reachable: bool,
366}
367/// A broker connection came up or went away. `connected: false` covers both
368/// signing out and a session that expired underneath you — which of the two
369/// it was is in the detail, because the difference matters to a person
370/// reading it and not at all to the status bar.
371#[derive(serde::Serialize, serde::Deserialize)]
372#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
373pub struct FeedEvent {
374    #[prost(string, tag = "1")]
375    pub id: ::prost::alloc::string::String,
376    #[prost(bool, tag = "2")]
377    pub connected: bool,
378}
379/// The live price stream stopped or came back.
380///
381/// Its own kind rather than another feed: the status bar reads a feed event
382/// to decide whether a broker session is held, and a price socket dropping
383/// says nothing about that. Folding the two together would have a Yahoo
384/// reconnect claim you had been signed out of your broker.
385///
386/// Worth an event at all because the failure is otherwise invisible: a dead
387/// socket looks exactly like a market where nothing is trading.
388#[derive(serde::Serialize, serde::Deserialize)]
389#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
390pub struct StreamEvent {
391    #[prost(bool, tag = "1")]
392    pub live: bool,
393}
394/// Stored findings went stale since they were last checked — their data
395/// changed or disappeared. The count is how many were newly so.
396#[derive(serde::Serialize, serde::Deserialize)]
397#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
398pub struct FindingsEvent {
399    #[prost(uint32, tag = "1")]
400    pub count: u32,
401}
402/// A trading session changed state: starting, running, stopped, halted or
403/// failed.
404#[derive(serde::Serialize, serde::Deserialize)]
405#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
406pub struct SessionEvent {
407    #[prost(string, tag = "1")]
408    pub id: ::prost::alloc::string::String,
409    #[prost(string, tag = "2")]
410    pub state: ::prost::alloc::string::String,
411}
412/// One scheduled script: a project file the engine runs on a timer.
413///
414/// The engine runs it, not a window, so a cadence a person set goes on being
415/// honoured after they close the window (ADR-0018). A schedule that only
416/// fires while someone is watching is not a schedule.
417#[derive(serde::Serialize, serde::Deserialize)]
418#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
419pub struct ScriptJobView {
420    /// Relative to the project folder, and what identifies the schedule: one
421    /// schedule per script.
422    #[prost(string, tag = "1")]
423    pub script: ::prost::alloc::string::String,
424    /// The cadence when `cron` is unset. Kept either way, so switching to a
425    /// cron expression and back does not lose what the interval was.
426    #[prost(uint64, tag = "2")]
427    pub every_secs: u64,
428    /// A cron expression, as the person wrote it. When set it decides when the
429    /// script runs and `every_secs` is not consulted.
430    #[prost(string, optional, tag = "3")]
431    pub cron: ::core::option::Option<::prost::alloc::string::String>,
432    #[prost(bool, tag = "4")]
433    pub enabled: bool,
434}
435/// Every saved schedule. A list, as a message; see `JobsView`.
436#[derive(serde::Serialize, serde::Deserialize)]
437#[derive(Clone, PartialEq, ::prost::Message)]
438pub struct ScriptJobsView {
439    #[prost(message, repeated, tag = "1")]
440    pub jobs: ::prost::alloc::vec::Vec<ScriptJobView>,
441}
442/// One line from a running script, or the fact that it ended.
443#[derive(serde::Serialize, serde::Deserialize)]
444#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
445pub struct ScriptOutputView {
446    /// Which run, as `RunScript` numbered it.
447    #[prost(uint32, tag = "1")]
448    pub run: u32,
449    /// `out`, `err`, `info` (what the engine started) or `exit`.
450    #[prost(string, tag = "2")]
451    pub stream: ::prost::alloc::string::String,
452    /// The line without its newline; for `exit`, how it ended.
453    #[prost(string, tag = "3")]
454    pub text: ::prost::alloc::string::String,
455}
456/// Whether this is worth interrupting someone for.
457///
458/// The one thing that decides it: a warning raises an OS notification, info
459/// only lands in the alerts list. Both are always recorded, so the
460/// distinction costs nothing but noise.
461#[derive(serde::Serialize, serde::Deserialize)]
462#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
463#[repr(i32)]
464pub enum SeverityView {
465    Unspecified = 0,
466    Info = 1,
467    Warning = 2,
468}
469impl SeverityView {
470    /// String value of the enum field names used in the ProtoBuf definition.
471    ///
472    /// The values are not transformed in any way and thus are considered stable
473    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
474    pub fn as_str_name(&self) -> &'static str {
475        match self {
476            Self::Unspecified => "SEVERITY_VIEW_UNSPECIFIED",
477            Self::Info => "SEVERITY_VIEW_INFO",
478            Self::Warning => "SEVERITY_VIEW_WARNING",
479        }
480    }
481    /// Creates an enum from field names used in the ProtoBuf definition.
482    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
483        match value {
484            "SEVERITY_VIEW_UNSPECIFIED" => Some(Self::Unspecified),
485            "SEVERITY_VIEW_INFO" => Some(Self::Info),
486            "SEVERITY_VIEW_WARNING" => Some(Self::Warning),
487            _ => None,
488        }
489    }
490}