agnostics 0.0.3 → 0.0.5

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.
Files changed (48) hide show
  1. package/lib/bases/_BaseOnCall.js +41 -0
  2. package/lib/bases/_BasePrompt.js +33 -0
  3. package/lib/bases/_BaseRemote.js +118 -0
  4. package/lib/bases/index.js +12 -0
  5. package/lib/helpers/_Yargs.js +28 -57
  6. package/lib/index.js +3 -0
  7. package/lib/loaders/_Loaders.js +62 -0
  8. package/lib/loaders/index.js +9 -0
  9. package/lib/logger/_Logger.js +1 -1
  10. package/lib/logger/index.js +1 -3
  11. package/lib/specification/_Properties.js +23 -8
  12. package/lib/targets/_InquirerTarget.js +15 -0
  13. package/lib/targets/_WebviewTarget.js +182 -0
  14. package/lib/targets/index.js +9 -0
  15. package/lib/workers/_AutoRunner.js +67 -0
  16. package/lib/workers/_AutoWorker.js +136 -0
  17. package/lib/workers/index.js +9 -0
  18. package/package.json +57 -31
  19. package/types/bases/_BaseOnCall.d.ts +7 -0
  20. package/types/bases/_BaseOnCall.d.ts.map +1 -0
  21. package/types/bases/_BasePrompt.d.ts +8 -0
  22. package/types/bases/_BasePrompt.d.ts.map +1 -0
  23. package/types/bases/_BaseRemote.d.ts +13 -0
  24. package/types/bases/_BaseRemote.d.ts.map +1 -0
  25. package/types/bases/index.d.ts +4 -0
  26. package/types/bases/index.d.ts.map +1 -0
  27. package/types/helpers/_Yargs.d.ts +2 -1
  28. package/types/helpers/_Yargs.d.ts.map +1 -1
  29. package/types/loaders/_Loaders.d.ts +8 -0
  30. package/types/loaders/_Loaders.d.ts.map +1 -0
  31. package/types/loaders/index.d.ts +2 -0
  32. package/types/loaders/index.d.ts.map +1 -0
  33. package/types/specification/_Properties.d.ts +41 -35
  34. package/types/targets/_InquirerTarget.d.ts +2 -0
  35. package/types/targets/_InquirerTarget.d.ts.map +1 -0
  36. package/types/targets/_WebviewTarget.d.ts +48 -0
  37. package/types/targets/_WebviewTarget.d.ts.map +1 -0
  38. package/types/targets/index.d.ts +2 -0
  39. package/types/targets/index.d.ts.map +1 -0
  40. package/types/workers/_AutoRunner.d.ts +2 -0
  41. package/types/workers/_AutoRunner.d.ts.map +1 -0
  42. package/types/workers/_AutoWorker.d.ts +17 -0
  43. package/types/workers/_AutoWorker.d.ts.map +1 -0
  44. package/types/workers/index.d.ts +2 -0
  45. package/types/workers/index.d.ts.map +1 -0
  46. package/lib/logger/_ASCII.js +0 -39
  47. package/lib/logger/_System.js +0 -191
  48. package/lib/logger/chars.js +0 -730
@@ -1,158 +1,164 @@
1
1
  export namespace Properties {
2
- export namespace type {
2
+ export namespace onsend {
3
3
  let description: string;
4
4
  let matches: string[];
5
5
  }
6
- export namespace subtype {
6
+ export namespace onreceive {
7
7
  let description_1: string;
8
8
  export { description_1 as description };
9
9
  let matches_1: string[];
10
10
  export { matches_1 as matches };
11
11
  }
12
- export namespace index {
12
+ export namespace onupdate {
13
13
  let description_2: string;
14
14
  export { description_2 as description };
15
15
  let matches_2: string[];
16
16
  export { matches_2 as matches };
17
17
  }
18
- export namespace key {
18
+ export namespace type {
19
19
  let description_3: string;
20
20
  export { description_3 as description };
21
21
  let matches_3: string[];
22
22
  export { matches_3 as matches };
23
23
  }
24
- export namespace label {
24
+ export namespace subtype {
25
25
  let description_4: string;
26
26
  export { description_4 as description };
27
27
  let matches_4: string[];
28
28
  export { matches_4 as matches };
29
29
  }
30
- export namespace description_5 {
31
- let description_6: string;
32
- export { description_6 as description };
30
+ export namespace index {
31
+ let description_5: string;
32
+ export { description_5 as description };
33
33
  let matches_5: string[];
34
34
  export { matches_5 as matches };
35
35
  }
36
- export { description_5 as description };
37
- namespace _default {
38
- let description_7: string;
39
- export { description_7 as description };
36
+ export namespace key {
37
+ let description_6: string;
38
+ export { description_6 as description };
40
39
  let matches_6: string[];
41
40
  export { matches_6 as matches };
42
41
  }
43
- export { _default as default };
44
- export namespace gui {
45
- let description_8: string;
46
- export { description_8 as description };
42
+ export namespace label {
43
+ let description_7: string;
44
+ export { description_7 as description };
47
45
  let matches_7: string[];
48
46
  export { matches_7 as matches };
49
47
  }
50
- export namespace classname {
48
+ export namespace description_8 {
51
49
  let description_9: string;
52
50
  export { description_9 as description };
53
51
  let matches_8: string[];
54
52
  export { matches_8 as matches };
55
53
  }
56
- export namespace required {
54
+ export { description_8 as description };
55
+ namespace _default {
57
56
  let description_10: string;
58
57
  export { description_10 as description };
59
58
  let matches_9: string[];
60
59
  export { matches_9 as matches };
61
60
  }
62
- export namespace disabled {
61
+ export { _default as default };
62
+ export namespace gui {
63
63
  let description_11: string;
64
64
  export { description_11 as description };
65
65
  let matches_10: string[];
66
66
  export { matches_10 as matches };
67
67
  }
68
- export namespace readonly {
68
+ export namespace classname {
69
69
  let description_12: string;
70
70
  export { description_12 as description };
71
71
  let matches_11: string[];
72
72
  export { matches_11 as matches };
73
73
  }
74
- export namespace oncheck {
74
+ export namespace required {
75
75
  let description_13: string;
76
76
  export { description_13 as description };
77
77
  let matches_12: string[];
78
78
  export { matches_12 as matches };
79
79
  }
80
- export namespace onupdate {
80
+ export namespace disabled {
81
81
  let description_14: string;
82
82
  export { description_14 as description };
83
83
  let matches_13: string[];
84
84
  export { matches_13 as matches };
85
85
  }
86
- export namespace properties {
86
+ export namespace readonly {
87
87
  let description_15: string;
88
88
  export { description_15 as description };
89
89
  let matches_14: string[];
90
90
  export { matches_14 as matches };
91
91
  }
92
- export namespace items {
92
+ export namespace properties {
93
93
  let description_16: string;
94
94
  export { description_16 as description };
95
95
  let matches_15: string[];
96
96
  export { matches_15 as matches };
97
97
  }
98
- export namespace _enum {
98
+ export namespace items {
99
99
  let description_17: string;
100
100
  export { description_17 as description };
101
101
  let matches_16: string[];
102
102
  export { matches_16 as matches };
103
103
  }
104
- export { _enum as enum };
105
- export namespace pattern {
104
+ export namespace _enum {
106
105
  let description_18: string;
107
106
  export { description_18 as description };
108
107
  let matches_17: string[];
109
108
  export { matches_17 as matches };
110
109
  }
111
- export namespace step {
110
+ export { _enum as enum };
111
+ export namespace pattern {
112
112
  let description_19: string;
113
113
  export { description_19 as description };
114
114
  let matches_18: string[];
115
115
  export { matches_18 as matches };
116
116
  }
117
- export namespace unit {
117
+ export namespace step {
118
118
  let description_20: string;
119
119
  export { description_20 as description };
120
120
  let matches_19: string[];
121
121
  export { matches_19 as matches };
122
122
  }
123
- export namespace min {
123
+ export namespace unit {
124
124
  let description_21: string;
125
125
  export { description_21 as description };
126
126
  let matches_20: string[];
127
127
  export { matches_20 as matches };
128
128
  }
129
- export namespace max {
129
+ export namespace min {
130
130
  let description_22: string;
131
131
  export { description_22 as description };
132
132
  let matches_21: string[];
133
133
  export { matches_21 as matches };
134
134
  }
135
- export namespace placeholder {
135
+ export namespace max {
136
136
  let description_23: string;
137
137
  export { description_23 as description };
138
138
  let matches_22: string[];
139
139
  export { matches_22 as matches };
140
140
  }
141
- export namespace accept {
141
+ export namespace placeholder {
142
142
  let description_24: string;
143
143
  export { description_24 as description };
144
144
  let matches_23: string[];
145
145
  export { matches_23 as matches };
146
146
  }
147
- export namespace size {
147
+ export namespace accept {
148
148
  let description_25: string;
149
149
  export { description_25 as description };
150
150
  let matches_24: string[];
151
151
  export { matches_24 as matches };
152
152
  }
153
- export namespace misc {
153
+ export namespace size {
154
154
  let description_26: string;
155
155
  export { description_26 as description };
156
+ let matches_25: string[];
157
+ export { matches_25 as matches };
158
+ }
159
+ export namespace misc {
160
+ let description_27: string;
161
+ export { description_27 as description };
156
162
  }
157
163
  }
158
164
  //# sourceMappingURL=_Properties.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=_InquirerTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_InquirerTarget.d.ts","sourceRoot":"","sources":["../../lib/targets/_InquirerTarget.js"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ export namespace WebviewConfig {
2
+ namespace app {
3
+ let controlFlow: number;
4
+ let waitTime: number;
5
+ let exitCode: number;
6
+ }
7
+ namespace browser {
8
+ let resizable: boolean;
9
+ let title: string;
10
+ let width: number;
11
+ let height: number;
12
+ let x: any;
13
+ let y: any;
14
+ let contentProtection: boolean;
15
+ let alwaysOnTop: boolean;
16
+ let alwaysOnBottom: boolean;
17
+ let visible: boolean;
18
+ let decorations: boolean;
19
+ let transparent: boolean;
20
+ let visibleOnAllWorkspaces: boolean;
21
+ let maximized: boolean;
22
+ let maximizable: boolean;
23
+ let minimizable: boolean;
24
+ let focused: boolean;
25
+ let fullscreen: any;
26
+ }
27
+ namespace webview {
28
+ let enableDevtools: boolean;
29
+ let incognito: boolean;
30
+ let userAgent: any;
31
+ let child: boolean;
32
+ let preload: any;
33
+ let hotkeysZoom: boolean;
34
+ let theme: number;
35
+ let clipboard: boolean;
36
+ let autoplay: boolean;
37
+ let backForwardNavigationGestures: boolean;
38
+ }
39
+ let showDevTools: boolean;
40
+ }
41
+ export class WebviewTarget extends BaseRemote {
42
+ constructor(source: any, config?: {});
43
+ $instance: any;
44
+ construct(...constructArguments: any[]): Promise<any>;
45
+ resolveConstruct: (value: any) => void;
46
+ }
47
+ import { BaseRemote } from '../bases/_BaseRemote.js';
48
+ //# sourceMappingURL=_WebviewTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_WebviewTarget.d.ts","sourceRoot":"","sources":["../../lib/targets/_WebviewTarget.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA;IAMC,sCA2DC;IA7DD,eAAgB;IA+DhB,sDA6CC;IAHC,uCAA+B;CAKjC;2BAzK0B,yBAAyB"}
@@ -0,0 +1,2 @@
1
+ export * from "./_WebviewTarget.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/targets/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=_AutoRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_AutoRunner.d.ts","sourceRoot":"","sources":["../../lib/workers/_AutoRunner.js"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ export const AutoRunnerPath: string;
2
+ export class AutoWorker extends BaseRemote {
3
+ constructor(importPath: any);
4
+ $worker: any;
5
+ $listenerCbs: {
6
+ error: any[];
7
+ exit: any[];
8
+ online: any[];
9
+ };
10
+ importUrl: any;
11
+ importName: any;
12
+ $sendRequest(type: any, name: any, req: any, index: any): void;
13
+ construct(...constructArguments: any[]): Promise<any>;
14
+ finishConstruct: (value: any) => void;
15
+ }
16
+ import { BaseRemote } from '../bases/_BaseRemote.js';
17
+ //# sourceMappingURL=_AutoWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_AutoWorker.d.ts","sourceRoot":"","sources":["../../lib/workers/_AutoWorker.js"],"names":[],"mappings":"AAwBA,oCAAyE;AAEzE;IAeC,6BAUC;IArBD,aAAc;IAEd;;;;MAIC;IAED,eAAgB;IAChB,gBAAiB;IAcjB,+DAQC;IAED,sDAqEC;IA/BE,sCAA2B;CAkC9B;2BA3H0B,yBAAyB"}
@@ -0,0 +1,2 @@
1
+ export * from "./_AutoWorker.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/workers/index.js"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
-
2
- //////////////////////////////////////////
3
- // //
4
- // //
5
- // ASCII //
6
- // //
7
- // //
8
- //////////////////////////////////////////
9
-
10
- import chars from './chars.js'
11
-
12
-
13
- export function BigText( string ) {
14
-
15
-
16
- const height = chars?.[0].length
17
- const spacing = 1
18
-
19
-
20
- let text = ''
21
-
22
- for (let y = 0; y < height; y++) {
23
- for (let i = 0; i < string.length; i++) {
24
-
25
- const letter = string[i]
26
- const line = chars[letter][y]
27
- text += line
28
- text += ('').padEnd(spacing)
29
- }
30
-
31
- text += '\n'
32
- }
33
-
34
- return text
35
-
36
-
37
- }
38
-
39
- // looks great whatever it is
@@ -1,191 +0,0 @@
1
- //////////////////////////////////////////
2
- // //
3
- // //
4
- // SYSTEM //
5
- // //
6
- // //
7
- //////////////////////////////////////////
8
-
9
- import { Timestamp } from './_Defs.js'
10
- import { Settings } from './_Settings.js'
11
- import { ANSI } from './_Defs.js'
12
-
13
- function GetStack() {
14
- const err = new Error()
15
- const stack = err.stack.split('\n').slice(2).map(line => {
16
- return ('').padStart(16) + line.trim()
17
- }).join('\n')
18
- return stack
19
- }
20
-
21
- const GetLine = (type, ...args) => {
22
- const line = (type.toUpperCase()).padEnd(8) + args.join(' ')
23
- const stack = (type == 'error' || type == 'debug' ? '\n' + GetStack() : '')
24
- return line + stack
25
- }
26
-
27
- export function SystemLog(overrides = {} ) {
28
-
29
- const config = { ...Settings, ...overrides }
30
-
31
- const saved = {
32
- log: console.log,
33
- info: console.info,
34
- error: console.error,
35
- warn: console.warn,
36
- trace: console.trace
37
- }
38
-
39
- globalThis.SAYLogger = saved
40
-
41
- const filename = config.filename.replaceAll('$TIMESTAMP', Timestamp(...config.timestamp))
42
-
43
- return new Promise( async resolve => {
44
-
45
-
46
- if (typeof process !== 'undefined') {
47
-
48
-
49
- const fs = await import('node:fs')
50
- const path = await import('node:path')
51
- const util = await import('node:util')
52
-
53
- if (await fs.existsSync(filename)) throw Error(`${filename} already exists`)
54
- const dir = path.dirname(filename)
55
- try { await fs.mkdirSync(dir) } catch(err) {}
56
- const output = fs.createWriteStream(filename, { flags: 'a' })
57
-
58
- output.on('error', err => {
59
- saved.error(err)
60
- })
61
-
62
- globalThis.SAYBuffer = {
63
- log: (...args) => output.write(GetLine('log', ...args)+'\n'),
64
- info: (...args) => output.write(GetLine('info', ...args)+'\n'),
65
- error: (...args) => output.write(GetLine('error', ...args)+'\n'),
66
- warn: (...args) => output.write(GetLine('warn', ...args)+'\n'),
67
- }
68
-
69
- console.log = (...args) => {
70
- const line = GetLine('log', ...args)
71
- output.write(line + '\n')
72
- saved.log(...args)
73
- }
74
-
75
- console.error = (...args) => {
76
- const line = GetLine('error', ...args)
77
- output.write(line + '\n')
78
- saved.error(...args)
79
- }
80
- console.warn = (...args) => {
81
- const line = GetLine('warn', ...args)
82
- output.write(line + '\n')
83
- saved.warn(...args)
84
- }
85
- console.info = (...args) => {
86
- const line = GetLine('info', ...args)
87
- output.write(line + '\n')
88
- saved.info(...args)
89
- }
90
-
91
- process.on('uncaughtException', async err => {
92
- try {
93
- console.error(err)
94
- if (config?.onCrash) await config.onCrash()
95
- } catch (err) {
96
- saved.error('uncaught', err)
97
- } finally {
98
- if (output) output.end()
99
- }
100
- })
101
-
102
- process.on('exit', async e => {
103
- try {
104
- if (config.onExit) await config.onExit(saypath)
105
- } catch(err) {
106
- saved.log('exit', e)
107
- } finally {
108
- if (output) output.end()
109
- }
110
- })
111
-
112
- } else {
113
-
114
- const buffer = []
115
- const MAX_LINES = 200
116
-
117
- const BufferPush = (line) => {
118
- buffer.push(line)
119
- if (buffer.length > MAX_LINES / 2) {
120
- buffer = buffer.slice(MAX_LINES/-4) // remove 1/4
121
- }
122
- }
123
-
124
- globalThis.SAYBuffer = {
125
- log: (...args) => BufferPush(GetLine('log', ...args)),
126
- info: (...args) => BufferPush(GetLine('info', ...args)),
127
- error: (...args) => BufferPush(GetLine('error', ...args)),
128
- warn: (...args) => BufferPush(GetLine('warn', ...args)),
129
- }
130
-
131
- console.log = (...args) => {
132
- BufferPush(GetLine('log', ...args))
133
- saved.log(...args)
134
- }
135
- console.error = (...args) => {
136
- BufferPush(GetLine('error', ...args))
137
- saved.error(...args)
138
- }
139
- console.warn = (...args) => {
140
- BufferPush(GetLine('warn', ...args))
141
- saved.warn(...args)
142
- }
143
- console.info = (...args) => {
144
- BufferPush(GetLine('info', ...args))
145
- saved.info(...args)
146
- }
147
-
148
- window.addEventListener('error', err => {
149
- console.error(err.error.stack)
150
- if (config.onCrash) config.onCrash(DownloadableLog(filename, buffer))
151
- })
152
-
153
- window.addEventListener('pagehide', async e => {
154
- if (config.onExit) config.onExit(DownloadableLog(filename, buffer))
155
- }, { capture: true })
156
-
157
- }
158
-
159
- resolve()
160
- })
161
- }
162
-
163
- export const DownloadableLog = (filename, buffer) => {
164
-
165
- const content = buffer.join('\n') + '\n'
166
- const blob = new Blob([content], {type: 'text/plain'})
167
- const url = URL.createObjectURL(blob)
168
-
169
- const a = document.createElement('a')
170
- a.href = url
171
- a.download = filename
172
- a.style.display = 'none'
173
- document.body.appendChild(a)
174
-
175
- return {
176
- buffer,
177
- filename,
178
- content,
179
- blob,
180
- url,
181
- download: () => {
182
- a.click()
183
- document.body.removeChild(a)
184
- URL.revokeObjectURL(url)
185
- }
186
- }
187
-
188
- }
189
-
190
-
191
-