@kwirthmagnify/kwirth-common 0.5.14 → 0.5.16
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/dist/Daemon.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/nameGenerator.d.ts +3 -0
- package/dist/nameGenerator.js +36 -0
- package/package.json +1 -1
package/dist/Daemon.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export interface IDaemonManager {
|
|
|
43
43
|
listInstances(daemonId?: string): IDaemonInstanceConfig[];
|
|
44
44
|
subscribe(instanceId: string, callback: (event: IDaemonEvent) => void): () => void;
|
|
45
45
|
sendCommand(instanceId: string, command: string, data: unknown): Promise<unknown>;
|
|
46
|
+
sendDaemonCommand(daemonId: string, command: string, data: unknown): Promise<unknown>;
|
|
46
47
|
routeAddObject(podNamespace: string, podName: string, containerName: string): Promise<void>;
|
|
47
48
|
directAddObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
|
|
48
49
|
directDeleteObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSessionName = exports.pickAdjective = exports.pick = void 0;
|
|
4
|
+
const ADJECTIVES = [
|
|
5
|
+
'eager', 'silent', 'clever', 'swift', 'bold', 'dark', 'bright', 'cold', 'wild', 'calm',
|
|
6
|
+
'deep', 'sharp', 'quiet', 'fierce', 'lone', 'hidden', 'fast', 'ancient', 'distant', 'electric',
|
|
7
|
+
'phantom', 'rogue', 'broken', 'noble', 'hollow', 'frozen', 'burning', 'glowing', 'twisted', 'sacred',
|
|
8
|
+
'lost', 'raw', 'free', 'pure', 'strange', 'cursed', 'lucid', 'restless', 'ashen', 'wandering'
|
|
9
|
+
];
|
|
10
|
+
const SCIENTISTS = [
|
|
11
|
+
'turing', 'lovelace', 'hopper', 'knuth', 'dijkstra', 'shannon', 'neumann', 'babbage', 'boole', 'hamilton',
|
|
12
|
+
'liskov', 'engelbart', 'wozniak', 'ritchie', 'kernighan', 'torvalds', 'stallman', 'euler', 'gauss', 'tesla',
|
|
13
|
+
'curie', 'feynman', 'hawking', 'einstein', 'darwin', 'fermat', 'pascal', 'leibniz', 'church', 'godel',
|
|
14
|
+
'chomsky', 'diffie', 'hellman', 'rivest', 'shamir', 'vigenere', 'stroustrup', 'gosling', 'kay', 'cerf'
|
|
15
|
+
];
|
|
16
|
+
const TECH_NOUNS = [
|
|
17
|
+
'cipher', 'trace', 'phantom', 'scanner', 'signal', 'pattern', 'filter', 'watcher',
|
|
18
|
+
'sentinel', 'daemon', 'probe', 'stream', 'lens', 'monitor', 'shadow', 'vector',
|
|
19
|
+
'parser', 'inspector', 'relay', 'vault'
|
|
20
|
+
];
|
|
21
|
+
const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
22
|
+
exports.pick = pick;
|
|
23
|
+
const pickAdjective = () => (0, exports.pick)(ADJECTIVES);
|
|
24
|
+
exports.pickAdjective = pickAdjective;
|
|
25
|
+
const generateSessionName = (usedNames = []) => {
|
|
26
|
+
const used = new Set(usedNames);
|
|
27
|
+
for (let i = 0; i < 20; i++) {
|
|
28
|
+
const adj = (0, exports.pick)(ADJECTIVES);
|
|
29
|
+
const noun = Math.random() < 0.5 ? (0, exports.pick)(SCIENTISTS) : (0, exports.pick)(TECH_NOUNS);
|
|
30
|
+
const name = `${adj}_${noun}`;
|
|
31
|
+
if (!used.has(name))
|
|
32
|
+
return name;
|
|
33
|
+
}
|
|
34
|
+
return `session_${Date.now()}`;
|
|
35
|
+
};
|
|
36
|
+
exports.generateSessionName = generateSessionName;
|