local-operator-ui 0.4.7 → 0.5.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/README.md CHANGED
@@ -123,6 +123,22 @@ All desktop applications are code signed and notarized to ensure security and tr
123
123
 
124
124
  For detailed information about the code signing and notarization process, see the [CODE_SIGNING.md](./docs/CODE_SIGNING.md) document.
125
125
 
126
+ ## 🗂️ Project Structure
127
+
128
+ The codebase is organized for modularity and code reuse:
129
+
130
+ - `src/renderer/src/shared/`: Contains all shared code, including components, hooks, stores, configuration, themes, and utilities. Use the `@shared/` path alias for imports.
131
+ - `src/renderer/src/features/`: Contains feature-specific code for the UI, organized by domain.
132
+ - `src/renderer/src/app.tsx`, `main.tsx`, etc.: Entry points for the Electron renderer process.
133
+ - `build/`, `resources/`, `scripts/`: Build assets, static resources, and build scripts.
134
+
135
+ **Import Conventions:**
136
+ - Use `@shared/` for shared modules (e.g., `import { useAgents } from "@shared/hooks/use-agents"`).
137
+ - Use `@features/` for feature-specific modules.
138
+ - The old aliases (`@renderer`, `@components`, `@hooks`, etc.) have been removed in favor of this unified structure.
139
+
140
+ For more details on building or contributing, see the [Contributing Guide](./CONTRIBUTING.md) and [BUILD.md](./docs/BUILD.md).
141
+
126
142
  ## ✨ Features
127
143
 
128
144
  The Local Operator UI provides a comprehensive interface for interacting with AI agents:
Binary file
Binary file
@@ -0,0 +1,144 @@
1
+ function words(str) {
2
+ var obj = {}, words2 = str.split(" ");
3
+ for (var i = 0; i < words2.length; ++i) obj[words2[i]] = true;
4
+ return obj;
5
+ }
6
+ const defaults = {
7
+ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS"),
8
+ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
9
+ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION"),
10
+ status: words("current deprecated mandatory obsolete"),
11
+ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL"),
12
+ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
13
+ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED"),
14
+ accessTypes: words("not-accessible accessible-for-notify read-only read-create read-write"),
15
+ multiLineStrings: true
16
+ };
17
+ function asn1(parserConfig) {
18
+ var keywords = parserConfig.keywords || defaults.keywords, cmipVerbs = parserConfig.cmipVerbs || defaults.cmipVerbs, compareTypes = parserConfig.compareTypes || defaults.compareTypes, status = parserConfig.status || defaults.status, tags = parserConfig.tags || defaults.tags, storage = parserConfig.storage || defaults.storage, modifier = parserConfig.modifier || defaults.modifier, accessTypes = parserConfig.accessTypes || defaults.accessTypes;
19
+ parserConfig.multiLineStrings || defaults.multiLineStrings;
20
+ var indentStatements = parserConfig.indentStatements !== false;
21
+ var isOperatorChar = /[\|\^]/;
22
+ var curPunc;
23
+ function tokenBase(stream, state) {
24
+ var ch = stream.next();
25
+ if (ch == '"' || ch == "'") {
26
+ state.tokenize = tokenString(ch);
27
+ return state.tokenize(stream, state);
28
+ }
29
+ if (/[\[\]\(\){}:=,;]/.test(ch)) {
30
+ curPunc = ch;
31
+ return "punctuation";
32
+ }
33
+ if (ch == "-") {
34
+ if (stream.eat("-")) {
35
+ stream.skipToEnd();
36
+ return "comment";
37
+ }
38
+ }
39
+ if (/\d/.test(ch)) {
40
+ stream.eatWhile(/[\w\.]/);
41
+ return "number";
42
+ }
43
+ if (isOperatorChar.test(ch)) {
44
+ stream.eatWhile(isOperatorChar);
45
+ return "operator";
46
+ }
47
+ stream.eatWhile(/[\w\-]/);
48
+ var cur = stream.current();
49
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
50
+ if (cmipVerbs.propertyIsEnumerable(cur)) return "variableName";
51
+ if (compareTypes.propertyIsEnumerable(cur)) return "atom";
52
+ if (status.propertyIsEnumerable(cur)) return "comment";
53
+ if (tags.propertyIsEnumerable(cur)) return "typeName";
54
+ if (storage.propertyIsEnumerable(cur)) return "modifier";
55
+ if (modifier.propertyIsEnumerable(cur)) return "modifier";
56
+ if (accessTypes.propertyIsEnumerable(cur)) return "modifier";
57
+ return "variableName";
58
+ }
59
+ function tokenString(quote) {
60
+ return function(stream, state) {
61
+ var escaped = false, next, end = false;
62
+ while ((next = stream.next()) != null) {
63
+ if (next == quote && !escaped) {
64
+ var afterNext = stream.peek();
65
+ if (afterNext) {
66
+ afterNext = afterNext.toLowerCase();
67
+ if (afterNext == "b" || afterNext == "h" || afterNext == "o")
68
+ stream.next();
69
+ }
70
+ end = true;
71
+ break;
72
+ }
73
+ escaped = !escaped && next == "\\";
74
+ }
75
+ if (end || false)
76
+ state.tokenize = null;
77
+ return "string";
78
+ };
79
+ }
80
+ function Context(indented, column, type, align, prev) {
81
+ this.indented = indented;
82
+ this.column = column;
83
+ this.type = type;
84
+ this.align = align;
85
+ this.prev = prev;
86
+ }
87
+ function pushContext(state, col, type) {
88
+ var indent = state.indented;
89
+ if (state.context && state.context.type == "statement")
90
+ indent = state.context.indented;
91
+ return state.context = new Context(indent, col, type, null, state.context);
92
+ }
93
+ function popContext(state) {
94
+ var t = state.context.type;
95
+ if (t == ")" || t == "]" || t == "}")
96
+ state.indented = state.context.indented;
97
+ return state.context = state.context.prev;
98
+ }
99
+ return {
100
+ name: "asn1",
101
+ startState: function() {
102
+ return {
103
+ tokenize: null,
104
+ context: new Context(-2, 0, "top", false),
105
+ indented: 0,
106
+ startOfLine: true
107
+ };
108
+ },
109
+ token: function(stream, state) {
110
+ var ctx = state.context;
111
+ if (stream.sol()) {
112
+ if (ctx.align == null) ctx.align = false;
113
+ state.indented = stream.indentation();
114
+ state.startOfLine = true;
115
+ }
116
+ if (stream.eatSpace()) return null;
117
+ curPunc = null;
118
+ var style = (state.tokenize || tokenBase)(stream, state);
119
+ if (style == "comment") return style;
120
+ if (ctx.align == null) ctx.align = true;
121
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") {
122
+ popContext(state);
123
+ } else if (curPunc == "{") pushContext(state, stream.column(), "}");
124
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
125
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
126
+ else if (curPunc == "}") {
127
+ while (ctx.type == "statement") ctx = popContext(state);
128
+ if (ctx.type == "}") ctx = popContext(state);
129
+ while (ctx.type == "statement") ctx = popContext(state);
130
+ } else if (curPunc == ctx.type) popContext(state);
131
+ else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement"))
132
+ pushContext(state, stream.column(), "statement");
133
+ state.startOfLine = false;
134
+ return style;
135
+ },
136
+ languageData: {
137
+ indentOnInput: /^\s*[{}]$/,
138
+ commentTokens: { line: "--" }
139
+ }
140
+ };
141
+ }
142
+ export {
143
+ asn1
144
+ };