interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / omega / allen / intent.om

292 lines · 6482 bytes Raw Blame History
1note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers.
2global Fold uchar 160
3global Fn ulong 2
4text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n"
5fn foldin to void
6n = ulong 0
7space = false
8for i ulong get Inlen 0
9c = get In i
10if and ge c 65 le c 90
11c = add sub c 65 97
12end
13if or and ge c 97 le c 122 isdigit c
14if and space gt n 0
15put Fold n uchar 32
16n = add n 1
17end
18put Fold n c
19n = add n 1
20space = false
21else
22space = true
23end
24end
25put Fn 0 n
26put Fn 1 0
27end
28fn phrase at ulong off ulong size ulong to bool
29if gt add at size get Fn 0
30ret false
31end
32for i ulong size
33if ne get Fold add at i get Lists add off i
34ret false
35end
36end
37if lt add at size get Fn 0
38if ne get Fold add at size 32
39ret false
40end
41end
42ret true
43end
44fn inphrase off ulong size ulong anypos bool to bool
45if not anypos
46ret phrase get Fn 1 off size
47end
48count = sub get Fn 0 get Fn 1
49for i ulong count
50at = add i get Fn 1
51ok = eq at get Fn 1
52if gt at 0
53ok = or ok eq get Fold sub at 1 32
54end
55if ok
56if phrase at off size
57ret true
58end
59end
60end
61ret false
62end
63fn listed group ulong anypos bool to ulong
64g = ulong 0
65s = ulong 0
66for p ulong len Lists
67c = get Lists p
68if or eq c 124 eq c 10
69if eq g group
70if inphrase s sub p s anypos
71ret sub p s
72end
73end
74s = add p 1
75if eq c 10
76g = add g 1
77end
78end
79end
80ret 0
81end
82fn classify to ulong
83if not textok
84ret 0
85end
86foldin
87skip = listed 0 false
88while gt skip 0
89if ge add get Fn 1 skip get Fn 0
90skip = 0
91else
92put Fn 1 add add get Fn 1 skip 1
93skip = listed 0 false
94end
95end
96if and ne get R 6 0 gt listed 5 false 0
97ret 3
98end
99plain = listed 4 false
100if or eq plain 4 eq plain 7
101ret 2
102end
103if and gt listed 3 true 0 eq listed 4 true 0
104ret 1
105end
106if and gt listed 1 false 0 gt listed 2 true 0
107ret 2
108end
109ret 1
110end
111note Ordinary want enum0chat,1make,2explain,3do.
112fn jobwant to ulong
113if gt listed 8 false 0
114ret 2
115end
116if or gt listed 6 false 0 gt listed 7 true 0
117ret 1
118end
119if gt listed 10 false 0
120ret 3
121end
122if gt listed 9 true 0
123ret 2
124end
125ret 0
126end
127text Job "JOB "
128text Codeask " asked "
129text Forcode " for code.\t"
130text Formore " to change the code just shown.\t"
131text Wantstr "chatmakeexplaindo"
132text Intro "You are the far hands of "
133text Home ", a quiet presence living in AIENOS on "
134text Comp "'s computer. You answer as "
135text Sees "; "
136text Words " sees only your words, as if "
137text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. "
138text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself."
139text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed."
140text Doing " asked for something to be done. "
141text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need."
142text Chat " said something in passing. Answer in one or two warm, plain sentences."
143text Allen "Allen"
144text Person "the person"
145fn selfemit to void
146off = add 40 mul mem32 32 113
147if eq get Mem off 0
148for i ulong len Allen
149emitb get Allen i
150end
151else
152for i ulong 24
153c = get Mem add off i
154if eq c 0
155ret
156end
157emitb c
158end
159end
160end
161fn whoemit to void
162if eq get Mem 8 0
163for i ulong len Person
164emitb get Person i
165end
166else
167for i ulong 24
168c = get Mem add i 8
169if eq c 0
170ret
171end
172emitb c
173end
174end
175end
176fn jobbuild kind ulong seq ulong to bool
177if or lt kind 1 gt kind 3
178ret false
179end
180if or eq seq 0 gt seq 4294967295
181ret false
182end
183if not textok
184ret false
185end
186outreset
187for i ulong len Job
188emitb get Job i
189end
190emitn seq
191emitb 32
192if gt kind 1
193emitb 99
194emitb 111
195emitb 100
196emitb 101
197if eq kind 3
198emitb 45
199emitb 109
200emitb 111
201emitb 114
202emitb 101
203end
204emitb 32
205whoemit
206for i ulong len Codeask
207emitb get Codeask i
208end
209selfemit
210if eq kind 3
211for i ulong len Formore
212emitb get Formore i
213end
214else
215for i ulong len Forcode
216emitb get Forcode i
217end
218end
219else
220w = jobwant
221off = ulong 0
222size = ulong 4
223if eq w 1
224off = 4
225end
226if eq w 2
227off = 8
228size = 7
229end
230if eq w 3
231off = 15
232size = 2
233end
234for i ulong size
235emitb get Wantstr add off i
236end
237emitb 32
238for i ulong len Intro
239emitb get Intro i
240end
241selfemit
242for i ulong len Home
243emitb get Home i
244end
245whoemit
246for i ulong len Comp
247emitb get Comp i
248end
249selfemit
250for i ulong len Sees
251emitb get Sees i
252end
253whoemit
254for i ulong len Words
255emitb get Words i
256end
257selfemit
258for i ulong len Said
259emitb get Said i
260end
261whoemit
262if eq w 0
263for i ulong len Chat
264emitb get Chat i
265end
266end
267if eq w 1
268for i ulong len Make
269emitb get Make i
270end
271end
272if eq w 2
273for i ulong len Explain
274emitb get Explain i
275end
276end
277if eq w 3
278for i ulong len Doing
279emitb get Doing i
280end
281selfemit
282for i ulong len Cannot
283emitb get Cannot i
284end
285end
286emitb 9
287end
288for i ulong get Inlen 0
289emitb get In i
290end
291ret le get Outlen 0 4096
292end