@onesi/genesis-cli 0.1.13 → 0.2.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 +29 -2
- package/dist/beacons.js +68 -0
- package/dist/dials.js +7 -4
- package/dist/fleets.js +30 -0
- package/dist/flocks.d.ts +7 -1
- package/dist/flocks.js +281 -4
- package/dist/henry.d.ts +5 -1
- package/dist/henry.js +60 -1
- package/dist/hives-coverage.d.ts +12 -0
- package/dist/hives-coverage.js +133 -0
- package/dist/hives-node-transport.js +4 -1
- package/dist/hives-operations.d.ts +1 -0
- package/dist/hives-operations.js +2 -0
- package/dist/hives-platform.d.ts +13 -0
- package/dist/hives-platform.js +133 -0
- package/dist/hives-resources.d.ts +1 -0
- package/dist/hives-resources.js +5 -3
- package/dist/iam-directory.d.ts +15 -0
- package/dist/iam-directory.js +71 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +273 -30
- package/dist/minds.d.ts +1 -1
- package/dist/minds.js +37 -2
- package/dist/onboard/art.d.ts +50 -0
- package/dist/onboard/art.js +139 -0
- package/dist/onboard/brand.d.ts +56 -0
- package/dist/onboard/brand.js +134 -0
- package/dist/onboard/caps.d.ts +90 -0
- package/dist/onboard/caps.js +232 -0
- package/dist/onboard/encode.d.ts +23 -0
- package/dist/onboard/encode.js +235 -0
- package/dist/onboard/eye.d.ts +103 -0
- package/dist/onboard/eye.js +147 -0
- package/dist/onboard/index.d.ts +61 -0
- package/dist/onboard/index.js +562 -0
- package/dist/onboard/mcp.d.ts +35 -0
- package/dist/onboard/mcp.js +118 -0
- package/dist/onboard/raster.d.ts +43 -0
- package/dist/onboard/raster.js +253 -0
- package/dist/onboard/sound.d.ts +2 -0
- package/dist/onboard/sound.js +54 -0
- package/dist/onboard/state.d.ts +24 -0
- package/dist/onboard/state.js +48 -0
- package/dist/onboard/term.d.ts +69 -0
- package/dist/onboard/term.js +292 -0
- package/dist/onboard/ui.d.ts +97 -0
- package/dist/onboard/ui.js +615 -0
- package/dist/orgs.d.ts +16 -0
- package/dist/orgs.js +89 -0
- package/dist/output.d.ts +13 -1
- package/dist/output.js +21 -2
- package/dist/products.d.ts +6 -2
- package/dist/products.js +474 -13
- package/dist/relays-commands/certificates.d.ts +3 -0
- package/dist/relays-commands/certificates.js +20 -0
- package/dist/relays-commands/domains.d.ts +3 -0
- package/dist/relays-commands/domains.js +23 -0
- package/dist/relays-commands/index.d.ts +4 -0
- package/dist/relays-commands/index.js +10 -0
- package/dist/relays-commands/monitoring.d.ts +3 -0
- package/dist/relays-commands/monitoring.js +41 -0
- package/dist/relays-commands/telemetry.d.ts +3 -0
- package/dist/relays-commands/telemetry.js +28 -0
- package/dist/relays-commands/zones.d.ts +7 -0
- package/dist/relays-commands/zones.js +16 -0
- package/dist/runner.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One's eye, from agent-eye.js (the One site's vendor/brand/agent-eye, engine sha256 83cc379a…): its geometry, pose
|
|
3
|
+
* math, easing curves and moments, ported line for line so the terminal eye blinks, glances and smiles on exactly the
|
|
4
|
+
* site's timing. Only the drawing is ours (raster.ts); the numbers are agent-eye's. The bar's painted-on-a-ball bend is
|
|
5
|
+
* left out: at terminal sizes it is under a tenth of a pixel.
|
|
6
|
+
*/
|
|
7
|
+
export const GEOMETRY = { radius: 100, barWidth: 200 / 9, barHeight: 400 / 3, cornerRadius: 200 / 45 };
|
|
8
|
+
export const MOTION = { maxTurn: 55, turnRadius: 70, foreshorten: 0.8, maxLift: 14, closedHeight: 7, lidSquash: 0.3, safeRadius: 89, smileLift: 2.5, smileSquint: 35, squeeze: 1 };
|
|
9
|
+
export const MOUTH = { y: 66, halfWidth: 44, birthHalfWidth: 20, thickness: 200 / 9, born: 3, follow: 0.6 };
|
|
10
|
+
export const REST = { look: 0, lift: 0, open: 1, smile: 0, mouth: 0 };
|
|
11
|
+
const DEG = Math.PI / 180;
|
|
12
|
+
const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
|
|
13
|
+
/** The bar for a pose, in the -100…100 head box: centre (x, y), width w, height h. */
|
|
14
|
+
export function poseToBar(p) {
|
|
15
|
+
const { look = 0, lift = 0, open = 1, smile = 0 } = p;
|
|
16
|
+
const turn = clamp(look, -1, 1) * MOTION.maxTurn * DEG;
|
|
17
|
+
const x = MOTION.turnRadius * Math.sin(turn);
|
|
18
|
+
const y = clamp(lift, -1, 1) * MOTION.maxLift - (MOTION.smileLift + MOTION.smileSquint / 2) * smile;
|
|
19
|
+
const shut = 1 - clamp(open, 0, 1);
|
|
20
|
+
const w = GEOMETRY.barWidth * (1 - MOTION.foreshorten * (1 - Math.cos(turn))) * (1 + MOTION.lidSquash * shut);
|
|
21
|
+
let h = Math.max(MOTION.closedHeight, MOTION.closedHeight + (GEOMETRY.barHeight - MOTION.closedHeight) * Math.max(0, open) - MOTION.smileSquint * smile);
|
|
22
|
+
h *= 1 - MOTION.squeeze * (1 - Math.sqrt(1 - (x / GEOMETRY.radius) ** 2));
|
|
23
|
+
// Keep the whole bar inside the safe radius (agent-eye fitHeight, without tilt).
|
|
24
|
+
const fits = (hh) => Math.hypot(Math.abs(x) + w / 2, Math.abs(y) + hh / 2) <= MOTION.safeRadius + GEOMETRY.cornerRadius;
|
|
25
|
+
if (!fits(h)) {
|
|
26
|
+
let lo = 0, hi = h;
|
|
27
|
+
for (let i = 0; i < 24; i++) {
|
|
28
|
+
const mid = (lo + hi) / 2;
|
|
29
|
+
if (fits(mid))
|
|
30
|
+
lo = mid;
|
|
31
|
+
else
|
|
32
|
+
hi = mid;
|
|
33
|
+
}
|
|
34
|
+
h = lo;
|
|
35
|
+
}
|
|
36
|
+
return { x, y, w, h };
|
|
37
|
+
}
|
|
38
|
+
export function poseToMouth(p) {
|
|
39
|
+
const m = Math.max(0, p.mouth ?? 0);
|
|
40
|
+
if (m === 0)
|
|
41
|
+
return null;
|
|
42
|
+
const turn = clamp(p.look ?? 0, -1, 1) * MOTION.maxTurn * DEG;
|
|
43
|
+
const half = (MOUTH.birthHalfWidth + (MOUTH.halfWidth - MOUTH.birthHalfWidth) * m) * (1 - 0.5 * (1 - Math.cos(turn)));
|
|
44
|
+
return { x: MOUTH.follow * MOTION.turnRadius * Math.sin(turn), y: MOUTH.y + MOUTH.born * (1 - Math.min(1, m)) + 0.5 * clamp(p.lift ?? 0, -1, 1) * MOTION.maxLift,
|
|
45
|
+
w: half * 2, h: MOUTH.thickness, o: clamp((m - 0.05) / 0.4, 0, 1) };
|
|
46
|
+
}
|
|
47
|
+
export const EASE = {
|
|
48
|
+
linear: [0, 0, 1, 1], shut: [0.6, 0, 0.9, 0.55], snap: [0.1, 0.9, 0.25, 1], settle: [0.3, 0, 0.3, 1],
|
|
49
|
+
glide: [0.45, 0, 0.25, 1], emerge: [0.2, 0.6, 0.35, 1], charge: [0.4, 0, 0.2, 1], exit: [0.45, 0, 0.7, 0.9],
|
|
50
|
+
// The site's motion curves (lib/motion CURVES): ease-out-expo for anything that arrives, ease-in-expo for leaving.
|
|
51
|
+
enter: [0.16, 1, 0.3, 1], leave: [0.7, 0, 0.84, 0],
|
|
52
|
+
};
|
|
53
|
+
export function cubicBezier(x1, y1, x2, y2) {
|
|
54
|
+
const cx = 3 * x1, bx = 3 * (x2 - x1) - cx, ax = 1 - cx - bx;
|
|
55
|
+
const cy = 3 * y1, by = 3 * (y2 - y1) - cy, ay = 1 - cy - by;
|
|
56
|
+
const sx = (t) => ((ax * t + bx) * t + cx) * t, sy = (t) => ((ay * t + by) * t + cy) * t;
|
|
57
|
+
const dx = (t) => (3 * ax * t + 2 * bx) * t + cx;
|
|
58
|
+
return (x) => {
|
|
59
|
+
if (x <= 0)
|
|
60
|
+
return 0;
|
|
61
|
+
if (x >= 1)
|
|
62
|
+
return 1;
|
|
63
|
+
let t = x;
|
|
64
|
+
for (let i = 0; i < 8; i++) {
|
|
65
|
+
const err = sx(t) - x;
|
|
66
|
+
if (Math.abs(err) < 1e-7)
|
|
67
|
+
return sy(t);
|
|
68
|
+
const d = dx(t);
|
|
69
|
+
if (Math.abs(d) < 1e-6)
|
|
70
|
+
break;
|
|
71
|
+
t -= err / d;
|
|
72
|
+
}
|
|
73
|
+
let lo = 0, hi = 1;
|
|
74
|
+
t = x;
|
|
75
|
+
while (hi - lo > 1e-7) {
|
|
76
|
+
if (sx(t) < x)
|
|
77
|
+
lo = t;
|
|
78
|
+
else
|
|
79
|
+
hi = t;
|
|
80
|
+
t = (lo + hi) / 2;
|
|
81
|
+
}
|
|
82
|
+
return sy(t);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const FN = Object.fromEntries(Object.entries(EASE).map(([k, v]) => [k, cubicBezier(v[0], v[1], v[2], v[3])]));
|
|
86
|
+
export const ease = (name, x) => FN[name](x);
|
|
87
|
+
export function sample(curve, t) {
|
|
88
|
+
if (t <= curve[0][0])
|
|
89
|
+
return curve[0][1];
|
|
90
|
+
for (let i = 1; i < curve.length; i++) {
|
|
91
|
+
const [t1, v1, e = 'linear'] = curve[i];
|
|
92
|
+
if (t < t1) {
|
|
93
|
+
const [t0, v0] = curve[i - 1];
|
|
94
|
+
return v0 + (v1 - v0) * FN[e]((t - t0) / (t1 - t0));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return curve[curve.length - 1][1];
|
|
98
|
+
}
|
|
99
|
+
export const curveEnd = (c) => c[c.length - 1][0];
|
|
100
|
+
/** agent-eye BLINK: 80 ms close, 50 ms shut, 170 ms open with a little overshoot. Multiplies openness. */
|
|
101
|
+
export const BLINK = [[0, 1], [0.08, 0, 'shut'], [0.13, 0], [0.3, 1.04, 'snap'], [0.42, 1, 'settle']];
|
|
102
|
+
export const DOUBLE_BLINK = [[0, 1], [0.07, 0, 'shut'], [0.11, 0], [0.23, 1, 'snap'], [0.3, 1], [0.37, 0, 'shut'], [0.41, 0], [0.57, 1.04, 'snap'], [0.69, 1, 'settle']];
|
|
103
|
+
/** agent-eye SMILE, 2.9 s. */
|
|
104
|
+
export const SMILE = {
|
|
105
|
+
smile: [[0, 0], [0.36, 1, 'glide'], [1.3, 1], [1.46, 1.12, 'snap'], [1.76, 1, 'settle'], [2.2, 1], [2.7, -0.06, 'glide'], [2.9, 0, 'settle']],
|
|
106
|
+
mouth: [[0, 0], [0.2, 0], [0.46, 0.8, 'emerge'], [0.62, 1.04, 'snap'], [0.82, 1, 'settle'], [1.3, 1], [1.46, 1.05, 'snap'], [1.76, 1, 'settle'], [2.05, 1], [2.26, 0.12, 'glide'], [2.32, 0]],
|
|
107
|
+
};
|
|
108
|
+
/** agent-eye RAINBOW_MOMENT's light, worn here in One's amber: it charges up the bar, holds, and leaves through the top. */
|
|
109
|
+
export const LIGHT = [[0, -1], [0.42, 0, 'charge'], [1.2, 0], [1.8, 1, 'exit']];
|
|
110
|
+
/**
|
|
111
|
+
* The idle eye: agent-eye's alive mode in miniature. Blinks every 2.5–6 s (18 % of them double), glances now and then.
|
|
112
|
+
* Deterministic for a seed, so a recorded demo is the same every time.
|
|
113
|
+
*/
|
|
114
|
+
export class IdleEye {
|
|
115
|
+
nextBlink;
|
|
116
|
+
blinkAt = -10;
|
|
117
|
+
curve = BLINK;
|
|
118
|
+
lookFrom = 0;
|
|
119
|
+
lookTo = 0;
|
|
120
|
+
lookAt = -10;
|
|
121
|
+
nextGlance;
|
|
122
|
+
rnd;
|
|
123
|
+
constructor(seed = 7) {
|
|
124
|
+
let s = seed >>> 0 || 1;
|
|
125
|
+
this.rnd = () => { s ^= s << 13; s >>>= 0; s ^= s >>> 17; s ^= s << 5; s >>>= 0; return s / 4294967296; };
|
|
126
|
+
this.nextBlink = 0.9 + this.rnd() * 1.2;
|
|
127
|
+
this.nextGlance = 2.2 + this.rnd() * 2;
|
|
128
|
+
}
|
|
129
|
+
/** Look toward x (-1…1) now, e.g. at the text it is waiting beside, or straight at you when the window regains focus. */
|
|
130
|
+
look(t, x) { this.lookFrom = this.lookNow(t); this.lookTo = x; this.lookAt = t; }
|
|
131
|
+
blink(t, double = false) { this.blinkAt = t; this.curve = double ? DOUBLE_BLINK : BLINK; this.nextBlink = t + 2.5 + this.rnd() * 3.5; }
|
|
132
|
+
lookNow(t) { const k = Math.min(1, (t - this.lookAt) / 0.22); return this.lookFrom + (this.lookTo - this.lookFrom) * ease('snap', Math.max(0, k)); }
|
|
133
|
+
pose(t) {
|
|
134
|
+
if (t >= this.nextBlink)
|
|
135
|
+
this.blink(t, this.rnd() < 0.18);
|
|
136
|
+
if (t >= this.nextGlance) {
|
|
137
|
+
const target = Math.abs(this.lookTo) > 0.1 ? 0 : (this.rnd() < 0.5 ? -1 : 1) * (0.45 + this.rnd() * 0.4);
|
|
138
|
+
this.look(t, target);
|
|
139
|
+
this.nextGlance = t + (target === 0 ? 2.5 + this.rnd() * 3 : 0.8 + this.rnd() * 1.1);
|
|
140
|
+
if (this.rnd() < 0.3)
|
|
141
|
+
this.blink(t);
|
|
142
|
+
}
|
|
143
|
+
const since = t - this.blinkAt;
|
|
144
|
+
const open = since >= 0 && since < curveEnd(this.curve) ? sample(this.curve, since) : 1;
|
|
145
|
+
return { ...REST, look: this.lookNow(t), open };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AuthConfig } from '../auth.js';
|
|
2
|
+
import type { CredentialStore } from '../store.js';
|
|
3
|
+
import { type Caps } from './caps.js';
|
|
4
|
+
import { type SetupState } from './state.js';
|
|
5
|
+
import { type McpEnv } from './mcp.js';
|
|
6
|
+
/** The two SDK calls setup makes, typed here so this module needs nothing from the SDK at load time. */
|
|
7
|
+
export interface SetupClient {
|
|
8
|
+
whoami(): Promise<{
|
|
9
|
+
org: string;
|
|
10
|
+
principal?: string | null;
|
|
11
|
+
kind: string;
|
|
12
|
+
}>;
|
|
13
|
+
keys: {
|
|
14
|
+
create(org: string, body: {
|
|
15
|
+
name: string;
|
|
16
|
+
custody: 'reveal' | 'blinds';
|
|
17
|
+
scopes?: string[];
|
|
18
|
+
}): Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
value?: unknown;
|
|
21
|
+
blinds_credential_ref?: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface SetupDeps {
|
|
26
|
+
version: string;
|
|
27
|
+
env: Record<string, string | undefined>;
|
|
28
|
+
fetch: typeof fetch;
|
|
29
|
+
auth: AuthConfig;
|
|
30
|
+
getStore: () => Promise<CredentialStore>;
|
|
31
|
+
client: () => Promise<SetupClient>;
|
|
32
|
+
openBrowser: (url: string) => void;
|
|
33
|
+
baseUrl: string;
|
|
34
|
+
stdout?: NodeJS.WriteStream;
|
|
35
|
+
stdin?: NodeJS.ReadStream;
|
|
36
|
+
log: (s: string) => void;
|
|
37
|
+
flags: {
|
|
38
|
+
json?: boolean;
|
|
39
|
+
animation?: boolean;
|
|
40
|
+
screenReader?: boolean;
|
|
41
|
+
sound?: boolean;
|
|
42
|
+
screencast?: boolean;
|
|
43
|
+
restart?: boolean;
|
|
44
|
+
step?: string;
|
|
45
|
+
probe?: boolean;
|
|
46
|
+
};
|
|
47
|
+
login: {
|
|
48
|
+
startLogin: typeof import('../auth.js').startLogin;
|
|
49
|
+
completeLogin: typeof import('../auth.js').completeLogin;
|
|
50
|
+
selectSavedContext: typeof import('../auth.js').selectSavedContext;
|
|
51
|
+
savedLoginProvider: typeof import('../auth.js').savedLoginProvider;
|
|
52
|
+
startDeviceLogin: typeof import('../device-login.js').startDeviceLogin;
|
|
53
|
+
completeDeviceLogin: typeof import('../device-login.js').completeDeviceLogin;
|
|
54
|
+
};
|
|
55
|
+
mcpEnv?: McpEnv;
|
|
56
|
+
/** Tests pin the parade's cast and the clock-free copy. */
|
|
57
|
+
seed?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function capsFor(d: SetupDeps): Promise<Caps>;
|
|
60
|
+
export declare function runSetup(d: SetupDeps): Promise<number>;
|
|
61
|
+
export type { SetupState };
|