@holostaff/sdk 0.9.8 → 0.9.10
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/eval.d.ts +25 -0
- package/dist/eval.d.ts.map +1 -0
- package/dist/eval.js +36 -0
- package/dist/eval.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/observations.d.ts +21 -26
- package/dist/observations.d.ts.map +1 -1
- package/dist/observations.js +161 -46
- package/dist/observations.js.map +1 -1
- package/package.json +1 -1
package/dist/eval.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eval-mode hook.
|
|
3
|
+
*
|
|
4
|
+
* When a Holostaff evaluation drives a real browser (Browserbase + Stagehand)
|
|
5
|
+
* against an instrumented page, the runner injects:
|
|
6
|
+
*
|
|
7
|
+
* window.__HS_EVAL__ = { visitorId: 'eval_<runId>', sourceId?, tenantId? }
|
|
8
|
+
*
|
|
9
|
+
* before any page script runs. The SDK reads it on init() and:
|
|
10
|
+
* - pins the device id to that `eval_<runId>` so every fire under this
|
|
11
|
+
* runtime user belongs to the run (server-side observation key), with no
|
|
12
|
+
* localStorage/cookie writes — each run is isolated;
|
|
13
|
+
* - forces observation on (the perceive+decide loop needs eyes);
|
|
14
|
+
* - skips the heavy/visible Theater + Voice surfaces (the verdict is scored
|
|
15
|
+
* server-side from interventionHistory, not from rendered UI).
|
|
16
|
+
*
|
|
17
|
+
* Absent the hook this is inert — zero effect on production traffic.
|
|
18
|
+
*/
|
|
19
|
+
export interface EvalOverride {
|
|
20
|
+
visitorId: string;
|
|
21
|
+
sourceId?: string;
|
|
22
|
+
tenantId?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function readEvalConfig(): EvalOverride | null;
|
|
25
|
+
//# sourceMappingURL=eval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,cAAc,IAAI,YAAY,GAAG,IAAI,CAapD"}
|
package/dist/eval.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eval-mode hook.
|
|
3
|
+
*
|
|
4
|
+
* When a Holostaff evaluation drives a real browser (Browserbase + Stagehand)
|
|
5
|
+
* against an instrumented page, the runner injects:
|
|
6
|
+
*
|
|
7
|
+
* window.__HS_EVAL__ = { visitorId: 'eval_<runId>', sourceId?, tenantId? }
|
|
8
|
+
*
|
|
9
|
+
* before any page script runs. The SDK reads it on init() and:
|
|
10
|
+
* - pins the device id to that `eval_<runId>` so every fire under this
|
|
11
|
+
* runtime user belongs to the run (server-side observation key), with no
|
|
12
|
+
* localStorage/cookie writes — each run is isolated;
|
|
13
|
+
* - forces observation on (the perceive+decide loop needs eyes);
|
|
14
|
+
* - skips the heavy/visible Theater + Voice surfaces (the verdict is scored
|
|
15
|
+
* server-side from interventionHistory, not from rendered UI).
|
|
16
|
+
*
|
|
17
|
+
* Absent the hook this is inert — zero effect on production traffic.
|
|
18
|
+
*/
|
|
19
|
+
export function readEvalConfig() {
|
|
20
|
+
if (typeof window === 'undefined')
|
|
21
|
+
return null;
|
|
22
|
+
const cfg = window.__HS_EVAL__;
|
|
23
|
+
if (!cfg || typeof cfg !== 'object')
|
|
24
|
+
return null;
|
|
25
|
+
const v = cfg.visitorId;
|
|
26
|
+
if (typeof v !== 'string' || !v.startsWith('eval_'))
|
|
27
|
+
return null;
|
|
28
|
+
const src = cfg.sourceId;
|
|
29
|
+
const ten = cfg.tenantId;
|
|
30
|
+
return {
|
|
31
|
+
visitorId: v,
|
|
32
|
+
sourceId: typeof src === 'string' ? src : undefined,
|
|
33
|
+
tenantId: typeof ten === 'string' ? ten : undefined,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=eval.js.map
|
package/dist/eval.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,MAAM,UAAU,cAAc;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAA;IAC9C,MAAM,GAAG,GAAI,MAA+C,CAAC,WAAW,CAAA;IACxE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAChD,MAAM,CAAC,GAAI,GAA+B,CAAC,SAAS,CAAA;IACpD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAA;IAChE,MAAM,GAAG,GAAI,GAA8B,CAAC,QAAQ,CAAA;IACpD,MAAM,GAAG,GAAI,GAA8B,CAAC,QAAQ,CAAA;IACpD,OAAO;QACL,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;QACnD,QAAQ,EAAE,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;KACpD,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiBH,OAAO,EAAiB,KAAK,WAAW,EAAmB,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA;AA4EzH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,IAAI,IAAI,CAAA;IACrB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IACxC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACjE;;;;;;OAMG;IACH,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACzE,kCAAkC;IAClC,QAAQ,IAAI,IAAI,CAAA;CACjB;AAED,eAAO,MAAM,SAAS,EAAE,YA+QvB,CAAA;AAED,YAAY,EACV,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAC7D,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,GAC1D,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import { startPresence } from './presence/index.js';
|
|
|
26
26
|
import { startNote } from './presence/note.js';
|
|
27
27
|
import { startTheater } from './theater/index.js';
|
|
28
28
|
import { startStage } from './stage/index.js';
|
|
29
|
+
import { readEvalConfig } from './eval.js';
|
|
29
30
|
import { BOWTIE_STAGES } from './types.js';
|
|
30
31
|
/** Public Theater service — overridable via init({ theater: { baseUrl } }). */
|
|
31
32
|
const DEFAULT_THEATER_URL = 'https://theater.holostaff.ai';
|
|
@@ -77,9 +78,13 @@ export const holostaff = {
|
|
|
77
78
|
}
|
|
78
79
|
this._destroy();
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
// Eval mode (inert in production): pin the device id to `eval_<runId>` so
|
|
82
|
+
// fires land under this run's runtime user, and force observation on.
|
|
83
|
+
const evalCfg = readEvalConfig();
|
|
84
|
+
const deviceId = evalCfg?.visitorId ?? getOrMintDeviceId();
|
|
81
85
|
const sessionId = mintSessionId();
|
|
82
86
|
const transport = resolveTransportConfig(opts);
|
|
87
|
+
const observe = evalCfg ? { ...opts.observe, enabled: true } : opts.observe;
|
|
83
88
|
const nextState = {
|
|
84
89
|
sourceId: opts.sourceId,
|
|
85
90
|
tenantId: opts.tenantId,
|
|
@@ -105,12 +110,12 @@ export const holostaff = {
|
|
|
105
110
|
// Vision-reconciliation wave — rrweb capture batched to
|
|
106
111
|
// /observations; the server replays in Browserbase and the Gemini
|
|
107
112
|
// perceive+decide tick runs on what it sees. On by default.
|
|
108
|
-
nextState.observeOpts =
|
|
113
|
+
nextState.observeOpts = observe;
|
|
109
114
|
nextState.observations = startObservations({
|
|
110
115
|
cfg: transport,
|
|
111
116
|
sessionId,
|
|
112
117
|
buildBody: () => commonBody(nextState),
|
|
113
|
-
observe
|
|
118
|
+
observe,
|
|
114
119
|
});
|
|
115
120
|
// P2 — the living-portrait chip. Subscribes to the `presence` SSE
|
|
116
121
|
// event and renders the copilot as a presence in the corner. The
|
|
@@ -138,7 +143,7 @@ export const holostaff = {
|
|
|
138
143
|
// P5 — the Theater overlay. Opened from a note's "Show me" CTA (and
|
|
139
144
|
// the Stage's present() in P6). Session-agnostic (buildContext reads
|
|
140
145
|
// the live sessionId), so it persists across identity changes.
|
|
141
|
-
if (opts.theater?.enabled !== false) {
|
|
146
|
+
if (opts.theater?.enabled !== false && !evalCfg) {
|
|
142
147
|
nextState.theater = startTheater({
|
|
143
148
|
baseUrl: opts.theater?.baseUrl ?? DEFAULT_THEATER_URL,
|
|
144
149
|
buildContext: () => ({
|
|
@@ -155,7 +160,7 @@ export const holostaff = {
|
|
|
155
160
|
// While open it reports conversationActive so the runtime suppresses
|
|
156
161
|
// autonomous fires (the copilot doesn't interrupt itself). The voice
|
|
157
162
|
// engine + Anam SDK load lazily on first open.
|
|
158
|
-
if (opts.voice?.enabled !== false) {
|
|
163
|
+
if (opts.voice?.enabled !== false && !evalCfg) {
|
|
159
164
|
nextState.stage = startStage({
|
|
160
165
|
cfg: transport,
|
|
161
166
|
getSessionId: () => nextState.sessionId,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAA;AACtH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAsB,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAuB,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAwB,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAoB,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,aAAa,EAAiF,MAAM,YAAY,CAAA;AAEzH,+EAA+E;AAC/E,MAAM,mBAAmB,GAAG,8BAA8B,CAAA;AA0B1D,IAAI,KAAK,GAAoB,IAAI,CAAA;AAIjC,MAAM,YAAY,GAAiB,EAAE,CAAA;AAErC,SAAS,SAAS,CAAC,EAAyB;IAC1C,IAAI,KAAK,EAAE,CAAC;QACV,EAAE,CAA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AAa,CAAC,cAAc,EAAE,OAAO;QACnC,IAAI,CAAC,cAAc,IAAI,CAAC,OAAO;YAAE,OAAM;QACvC,SAAS,CAAC,CAAC,CAAC,EAAE;YACZ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE;gBACvF,cAAc;gBACd,OAAO;aACR,CAAC,CAAC,CAAA;QACL,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,KAAK;YAAE,OAAM;QAClB,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAA;QACvB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,CAAA;QACxB,KAAK,CAAC,YAAY,EAAE,OAAO,EAAE,CAAA;QAC7B,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAA;QACrB,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;QACzB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,CAAA;QACxB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,CAAA;QACtB,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAA;QACvB,KAAK,GAAG,IAAI,CAAA;IACd,CAAC;CACF,CAAA;AAMD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/observations.d.ts
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Observations — rrweb session capture (vision-reconciliation wave,
|
|
3
|
-
* Phase A).
|
|
3
|
+
* Phase A; Browserbase cost-optimization, Phase A/B).
|
|
4
4
|
*
|
|
5
5
|
* Records the visitor's session with rrweb and ships event batches to
|
|
6
6
|
* `POST /api/runtime/sessions/:sessionId/observations`, where the
|
|
7
7
|
* server's vision bridge replays them in Browserbase and screenshots
|
|
8
8
|
* feed the Gemini perceive+decide tick.
|
|
9
9
|
*
|
|
10
|
+
* Cost gating (Browserbase is the expensive resource, rrweb is free):
|
|
11
|
+
* - We RECORD from page load but BUFFER client-side — nothing is sent
|
|
12
|
+
* (so the server never spins up a Browserbase session) until the
|
|
13
|
+
* first *trusted* interaction. Bots and bounces that load the page
|
|
14
|
+
* but never interact cost nothing. The pre-gate buffer is trimmed to
|
|
15
|
+
* the latest FullSnapshot so it stays small AND replayable, and the
|
|
16
|
+
* whole lead-up is flushed at gate-open — we never lose the first
|
|
17
|
+
* moments, the server just receives them a beat later once we know
|
|
18
|
+
* it's a human.
|
|
19
|
+
* - `navigator.webdriver` is reported so the server can reap automated
|
|
20
|
+
* clients that drive trusted input (headless browsers).
|
|
21
|
+
* - A visibility-gated heartbeat keeps the session marked live while
|
|
22
|
+
* the tab is visible; it stops the instant the tab is hidden or
|
|
23
|
+
* closed, so the server reaps the Browserbase session within seconds
|
|
24
|
+
* instead of waiting out a 30-minute timeout.
|
|
25
|
+
*
|
|
10
26
|
* Capture policy (wave doc §Phase A — "everything the user sees,
|
|
11
|
-
* except PII"):
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* doesn't depend on URLs staying reachable.
|
|
15
|
-
* - Typed PII never leaves the page: password / email / tel inputs
|
|
16
|
-
* are masked at the keystroke level. Rendered PII is the
|
|
17
|
-
* customer's to mark: `holostaff-mask` masks text content,
|
|
18
|
-
* `holostaff-block` blanks a region, `holostaff-ignore` skips an
|
|
19
|
-
* input entirely.
|
|
27
|
+
* except PII"): full DOM, canvas (~2 fps), media state, fonts + images
|
|
28
|
+
* inlined. Typed PII never leaves the page (password/email/tel masked;
|
|
29
|
+
* `holostaff-mask`/`-block`/`-ignore` for rendered PII).
|
|
20
30
|
*
|
|
21
31
|
* Version pin: rrweb 2.0.0-alpha.4 — MUST match the server's replay
|
|
22
|
-
* bundle (server/src/bowtie/vision/rrweb.bundle.js)
|
|
23
|
-
* replayer share the event format.
|
|
24
|
-
*
|
|
25
|
-
* Loading: rrweb is imported dynamically so hosts that disable
|
|
26
|
-
* observation (or render server-side) never evaluate it; a failed
|
|
27
|
-
* import degrades to no-capture and routes to onError, per the SDK's
|
|
28
|
-
* fail-soft contract.
|
|
29
|
-
*
|
|
30
|
-
* Batching:
|
|
31
|
-
* - flush every FLUSH_INTERVAL_MS, or at MAX_BATCH_EVENTS, or when
|
|
32
|
-
* the approximate batch size passes MAX_BATCH_BYTES (full
|
|
33
|
-
* snapshots with inlined images are heavy — don't let them queue).
|
|
34
|
-
* - final flush on dispose goes over sendBeacon (survives unload);
|
|
35
|
-
* beacons cap at ~64KB so an oversized final batch is truncated to
|
|
36
|
-
* the most recent events — replay loses the tail of a dying
|
|
37
|
-
* session, never the session.
|
|
32
|
+
* bundle (server/src/bowtie/vision/rrweb.bundle.js).
|
|
38
33
|
*/
|
|
39
34
|
import { type TransportConfig } from './transport.js';
|
|
40
35
|
import type { ObserveOptions } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observations.d.ts","sourceRoot":"","sources":["../src/observations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"observations.d.ts","sourceRoot":"","sources":["../src/observations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAiBhD,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,eAAe,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,SAAS,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,OAAO,IAAI,IAAI,CAAA;CAChB;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,uBAAuB,GAAG,mBAAmB,CAoLpF"}
|
package/dist/observations.js
CHANGED
|
@@ -1,97 +1,206 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Observations — rrweb session capture (vision-reconciliation wave,
|
|
3
|
-
* Phase A).
|
|
3
|
+
* Phase A; Browserbase cost-optimization, Phase A/B).
|
|
4
4
|
*
|
|
5
5
|
* Records the visitor's session with rrweb and ships event batches to
|
|
6
6
|
* `POST /api/runtime/sessions/:sessionId/observations`, where the
|
|
7
7
|
* server's vision bridge replays them in Browserbase and screenshots
|
|
8
8
|
* feed the Gemini perceive+decide tick.
|
|
9
9
|
*
|
|
10
|
+
* Cost gating (Browserbase is the expensive resource, rrweb is free):
|
|
11
|
+
* - We RECORD from page load but BUFFER client-side — nothing is sent
|
|
12
|
+
* (so the server never spins up a Browserbase session) until the
|
|
13
|
+
* first *trusted* interaction. Bots and bounces that load the page
|
|
14
|
+
* but never interact cost nothing. The pre-gate buffer is trimmed to
|
|
15
|
+
* the latest FullSnapshot so it stays small AND replayable, and the
|
|
16
|
+
* whole lead-up is flushed at gate-open — we never lose the first
|
|
17
|
+
* moments, the server just receives them a beat later once we know
|
|
18
|
+
* it's a human.
|
|
19
|
+
* - `navigator.webdriver` is reported so the server can reap automated
|
|
20
|
+
* clients that drive trusted input (headless browsers).
|
|
21
|
+
* - A visibility-gated heartbeat keeps the session marked live while
|
|
22
|
+
* the tab is visible; it stops the instant the tab is hidden or
|
|
23
|
+
* closed, so the server reaps the Browserbase session within seconds
|
|
24
|
+
* instead of waiting out a 30-minute timeout.
|
|
25
|
+
*
|
|
10
26
|
* Capture policy (wave doc §Phase A — "everything the user sees,
|
|
11
|
-
* except PII"):
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* doesn't depend on URLs staying reachable.
|
|
15
|
-
* - Typed PII never leaves the page: password / email / tel inputs
|
|
16
|
-
* are masked at the keystroke level. Rendered PII is the
|
|
17
|
-
* customer's to mark: `holostaff-mask` masks text content,
|
|
18
|
-
* `holostaff-block` blanks a region, `holostaff-ignore` skips an
|
|
19
|
-
* input entirely.
|
|
27
|
+
* except PII"): full DOM, canvas (~2 fps), media state, fonts + images
|
|
28
|
+
* inlined. Typed PII never leaves the page (password/email/tel masked;
|
|
29
|
+
* `holostaff-mask`/`-block`/`-ignore` for rendered PII).
|
|
20
30
|
*
|
|
21
31
|
* Version pin: rrweb 2.0.0-alpha.4 — MUST match the server's replay
|
|
22
|
-
* bundle (server/src/bowtie/vision/rrweb.bundle.js)
|
|
23
|
-
* replayer share the event format.
|
|
24
|
-
*
|
|
25
|
-
* Loading: rrweb is imported dynamically so hosts that disable
|
|
26
|
-
* observation (or render server-side) never evaluate it; a failed
|
|
27
|
-
* import degrades to no-capture and routes to onError, per the SDK's
|
|
28
|
-
* fail-soft contract.
|
|
29
|
-
*
|
|
30
|
-
* Batching:
|
|
31
|
-
* - flush every FLUSH_INTERVAL_MS, or at MAX_BATCH_EVENTS, or when
|
|
32
|
-
* the approximate batch size passes MAX_BATCH_BYTES (full
|
|
33
|
-
* snapshots with inlined images are heavy — don't let them queue).
|
|
34
|
-
* - final flush on dispose goes over sendBeacon (survives unload);
|
|
35
|
-
* beacons cap at ~64KB so an oversized final batch is truncated to
|
|
36
|
-
* the most recent events — replay loses the tail of a dying
|
|
37
|
-
* session, never the session.
|
|
32
|
+
* bundle (server/src/bowtie/vision/rrweb.bundle.js).
|
|
38
33
|
*/
|
|
39
34
|
import { postJson, postBeacon } from './transport.js';
|
|
40
35
|
const FLUSH_INTERVAL_MS = 5000;
|
|
41
36
|
const MAX_BATCH_EVENTS = 200;
|
|
42
37
|
const MAX_BATCH_BYTES = 800000;
|
|
43
38
|
const BEACON_SAFE_BYTES = 55000;
|
|
39
|
+
/** Force a periodic FullSnapshot so the pre-gate buffer can be trimmed to
|
|
40
|
+
* a replayable checkpoint and the server replay self-heals. */
|
|
41
|
+
const CHECKOUT_EVERY_MS = 30000;
|
|
42
|
+
/** Pre-gate buffer caps — trimmed to the latest FullSnapshot when hit. */
|
|
43
|
+
const PREGATE_MAX_EVENTS = 800;
|
|
44
|
+
const PREGATE_MAX_BYTES = 3000000;
|
|
45
|
+
/** Liveness ping cadence while visible (server reap grace must exceed it). */
|
|
46
|
+
const HEARTBEAT_INTERVAL_MS = 15000;
|
|
47
|
+
/** rrweb EventType.FullSnapshot. */
|
|
48
|
+
const RRWEB_FULL_SNAPSHOT = 2;
|
|
44
49
|
export function startObservations(deps) {
|
|
45
50
|
if (typeof window === 'undefined')
|
|
46
51
|
return { dispose: () => { } };
|
|
47
52
|
if (deps.observe?.enabled === false)
|
|
48
53
|
return { dispose: () => { } };
|
|
49
54
|
let disposed = false;
|
|
55
|
+
let gateOpen = false;
|
|
50
56
|
let stopRecording = null;
|
|
57
|
+
// Post-gate send buffer.
|
|
51
58
|
let buffer = [];
|
|
52
59
|
let bufferBytes = 0;
|
|
60
|
+
// Pre-gate buffer: recorded but withheld until a human interacts.
|
|
61
|
+
let pregate = [];
|
|
62
|
+
let pregateBytes = 0;
|
|
53
63
|
let flushTimer = null;
|
|
64
|
+
let heartbeatTimer = null;
|
|
54
65
|
const path = `/api/runtime/sessions/${deps.sessionId}/observations`;
|
|
66
|
+
const heartbeatPath = `/api/runtime/sessions/${deps.sessionId}/heartbeat`;
|
|
67
|
+
// Trusted interaction can still come from a headless browser driving
|
|
68
|
+
// real input — flag automation so the server can reap it.
|
|
69
|
+
const automated = typeof navigator !== 'undefined'
|
|
70
|
+
&& navigator.webdriver === true;
|
|
71
|
+
const bodyExtra = automated ? { automated: true } : {};
|
|
55
72
|
const flush = () => {
|
|
56
73
|
if (!buffer.length)
|
|
57
74
|
return;
|
|
58
75
|
const events = buffer;
|
|
59
76
|
buffer = [];
|
|
60
77
|
bufferBytes = 0;
|
|
61
|
-
void postJson(deps.cfg, path, { ...deps.buildBody(), events });
|
|
78
|
+
void postJson(deps.cfg, path, { ...deps.buildBody(), ...bodyExtra, events });
|
|
62
79
|
};
|
|
63
|
-
/** Unload-safe flush
|
|
64
|
-
*
|
|
65
|
-
* tail of a dying session, never the session. */
|
|
80
|
+
/** Unload-safe flush over sendBeacon (≤64KB; keep the most recent
|
|
81
|
+
* events if the tail is oversized — lose the tail, never the session). */
|
|
66
82
|
const flushBeacon = () => {
|
|
67
83
|
if (!buffer.length)
|
|
68
84
|
return;
|
|
69
85
|
let events = buffer;
|
|
70
86
|
buffer = [];
|
|
71
87
|
bufferBytes = 0;
|
|
72
|
-
// Size by the events alone (body adds ~200 constant bytes); halving
|
|
73
|
-
// converges in ≤4 rounds from the 800KB batch cap.
|
|
74
88
|
while (events.length > 1 && JSON.stringify(events).length > BEACON_SAFE_BYTES) {
|
|
75
89
|
events = events.slice(Math.ceil(events.length / 2));
|
|
76
90
|
}
|
|
77
|
-
postBeacon(deps.cfg, path, { ...deps.buildBody(), events });
|
|
91
|
+
postBeacon(deps.cfg, path, { ...deps.buildBody(), ...bodyExtra, events });
|
|
92
|
+
};
|
|
93
|
+
const sizeof = (e) => {
|
|
94
|
+
try {
|
|
95
|
+
return JSON.stringify(e).length;
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return 1000;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/** Drop everything before the latest FullSnapshot — bounds memory while
|
|
102
|
+
* keeping the buffer independently replayable. */
|
|
103
|
+
const trimPregate = () => {
|
|
104
|
+
let lastSnap = -1;
|
|
105
|
+
for (let i = pregate.length - 1; i >= 0; i--) {
|
|
106
|
+
if (pregate[i].type === RRWEB_FULL_SNAPSHOT) {
|
|
107
|
+
lastSnap = i;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (lastSnap > 0)
|
|
112
|
+
pregate = pregate.slice(lastSnap);
|
|
113
|
+
pregateBytes = pregate.reduce((n, e) => n + sizeof(e), 0);
|
|
78
114
|
};
|
|
79
115
|
const push = (event) => {
|
|
80
116
|
if (disposed)
|
|
81
117
|
return;
|
|
118
|
+
if (!gateOpen) {
|
|
119
|
+
pregate.push(event);
|
|
120
|
+
pregateBytes += sizeof(event);
|
|
121
|
+
if (pregate.length > PREGATE_MAX_EVENTS || pregateBytes > PREGATE_MAX_BYTES)
|
|
122
|
+
trimPregate();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
82
125
|
buffer.push(event);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
126
|
+
bufferBytes += sizeof(event);
|
|
127
|
+
if (buffer.length >= MAX_BATCH_EVENTS || bufferBytes >= MAX_BATCH_BYTES)
|
|
128
|
+
flush();
|
|
129
|
+
};
|
|
130
|
+
const startSending = () => {
|
|
131
|
+
if (flushTimer == null)
|
|
132
|
+
flushTimer = setInterval(flush, FLUSH_INTERVAL_MS);
|
|
133
|
+
};
|
|
134
|
+
const stopSending = () => {
|
|
135
|
+
if (flushTimer != null) {
|
|
136
|
+
clearInterval(flushTimer);
|
|
137
|
+
flushTimer = null;
|
|
86
138
|
}
|
|
87
|
-
|
|
88
|
-
|
|
139
|
+
};
|
|
140
|
+
const startHeartbeat = () => {
|
|
141
|
+
if (heartbeatTimer != null)
|
|
142
|
+
return;
|
|
143
|
+
heartbeatTimer = setInterval(() => {
|
|
144
|
+
if (typeof document !== 'undefined' && document.hidden)
|
|
145
|
+
return;
|
|
146
|
+
void postJson(deps.cfg, heartbeatPath, { ...deps.buildBody(), ...bodyExtra });
|
|
147
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
148
|
+
};
|
|
149
|
+
const stopHeartbeat = () => {
|
|
150
|
+
if (heartbeatTimer != null) {
|
|
151
|
+
clearInterval(heartbeatTimer);
|
|
152
|
+
heartbeatTimer = null;
|
|
89
153
|
}
|
|
90
|
-
|
|
154
|
+
};
|
|
155
|
+
// -- The human gate -------------------------------------------------
|
|
156
|
+
const GATE_EVENTS = ['pointerdown', 'pointermove', 'keydown', 'wheel', 'scroll', 'touchstart'];
|
|
157
|
+
const gateOpts = { passive: true, capture: true };
|
|
158
|
+
const openGate = () => {
|
|
159
|
+
if (gateOpen || disposed)
|
|
160
|
+
return;
|
|
161
|
+
gateOpen = true;
|
|
162
|
+
removeGateListeners();
|
|
163
|
+
// Hand the buffered lead-up to the send queue (already trimmed to a
|
|
164
|
+
// valid FullSnapshot) and flush it now — this is what creates the BB
|
|
165
|
+
// session, only now that we've seen a human.
|
|
166
|
+
buffer = pregate;
|
|
167
|
+
bufferBytes = pregateBytes;
|
|
168
|
+
pregate = [];
|
|
169
|
+
pregateBytes = 0;
|
|
170
|
+
flush();
|
|
171
|
+
startSending();
|
|
172
|
+
startHeartbeat();
|
|
173
|
+
};
|
|
174
|
+
const onGateEvent = (e) => { if (e.isTrusted)
|
|
175
|
+
openGate(); };
|
|
176
|
+
const addGateListeners = () => {
|
|
177
|
+
for (const t of GATE_EVENTS)
|
|
178
|
+
window.addEventListener(t, onGateEvent, gateOpts);
|
|
179
|
+
};
|
|
180
|
+
const removeGateListeners = () => {
|
|
181
|
+
for (const t of GATE_EVENTS)
|
|
182
|
+
window.removeEventListener(t, onGateEvent, gateOpts);
|
|
183
|
+
};
|
|
184
|
+
// -- Visibility: pause sending + heartbeat when hidden --------------
|
|
185
|
+
const onVisibility = () => {
|
|
186
|
+
if (!gateOpen)
|
|
187
|
+
return;
|
|
188
|
+
if (document.hidden) {
|
|
91
189
|
flush();
|
|
190
|
+
stopSending();
|
|
191
|
+
stopHeartbeat();
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
startSending();
|
|
195
|
+
startHeartbeat();
|
|
196
|
+
}
|
|
92
197
|
};
|
|
93
|
-
|
|
94
|
-
|
|
198
|
+
if (typeof document !== 'undefined') {
|
|
199
|
+
document.addEventListener('visibilitychange', onVisibility);
|
|
200
|
+
}
|
|
201
|
+
addGateListeners();
|
|
202
|
+
// Dynamic import keeps rrweb out of hosts that never observe and makes
|
|
203
|
+
// a missing/incompatible module a soft failure.
|
|
95
204
|
void import('rrweb')
|
|
96
205
|
.then((rrweb) => {
|
|
97
206
|
if (disposed)
|
|
@@ -103,6 +212,8 @@ export function startObservations(deps) {
|
|
|
103
212
|
}
|
|
104
213
|
stopRecording = record({
|
|
105
214
|
emit: (event) => push(event),
|
|
215
|
+
// Periodic FullSnapshot → trimmable pre-gate buffer + self-healing replay.
|
|
216
|
+
checkoutEveryNms: CHECKOUT_EVERY_MS,
|
|
106
217
|
// -- everything the user sees --
|
|
107
218
|
recordCanvas: true,
|
|
108
219
|
sampling: { canvas: 2 },
|
|
@@ -117,7 +228,7 @@ export function startObservations(deps) {
|
|
|
117
228
|
...(deps.observe?.blockSelector ? { blockSelector: deps.observe.blockSelector } : {}),
|
|
118
229
|
...(deps.observe?.rrweb ?? {}),
|
|
119
230
|
}) ?? null;
|
|
120
|
-
|
|
231
|
+
// NB: sending does NOT start here — it starts at the human gate.
|
|
121
232
|
})
|
|
122
233
|
.catch((err) => {
|
|
123
234
|
deps.cfg.onError?.(err instanceof Error ? err : new Error(String(err)), { method: 'OBSERVE', path });
|
|
@@ -127,16 +238,20 @@ export function startObservations(deps) {
|
|
|
127
238
|
if (disposed)
|
|
128
239
|
return;
|
|
129
240
|
disposed = true;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
241
|
+
stopSending();
|
|
242
|
+
stopHeartbeat();
|
|
243
|
+
removeGateListeners();
|
|
244
|
+
if (typeof document !== 'undefined') {
|
|
245
|
+
document.removeEventListener('visibilitychange', onVisibility);
|
|
133
246
|
}
|
|
134
247
|
try {
|
|
135
248
|
stopRecording?.();
|
|
136
249
|
}
|
|
137
250
|
catch { /* recorder already gone */ }
|
|
138
251
|
stopRecording = null;
|
|
139
|
-
|
|
252
|
+
// Only beacon a tail if we'd opened the gate (a real human session).
|
|
253
|
+
if (gateOpen)
|
|
254
|
+
flushBeacon();
|
|
140
255
|
},
|
|
141
256
|
};
|
|
142
257
|
}
|
package/dist/observations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observations.js","sourceRoot":"","sources":["../src/observations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file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,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;SAC/B,CAAC,IAAI,IAAI,CAAA;QACV,iEAAiE;IACnE,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAChB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EACnD,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAC5B,CAAA;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO;QACL,OAAO;YACL,IAAI,QAAQ;gBAAE,OAAM;YACpB,QAAQ,GAAG,IAAI,CAAA;YACf,WAAW,EAAE,CAAA;YACb,aAAa,EAAE,CAAA;YACf,mBAAmB,EAAE,CAAA;YACrB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;gBACpC,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAA;YAChE,CAAC;YACD,IAAI,CAAC;gBAAC,aAAa,EAAE,EAAE,CAAA;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,2BAA2B,CAAC,CAAC;YAC/D,aAAa,GAAG,IAAI,CAAA;YACpB,qEAAqE;YACrE,IAAI,QAAQ;gBAAE,WAAW,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holostaff/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.10",
|
|
4
4
|
"description": "Holostaff SDK — lifetime identity, stage detection, custom signal probes, and the living-portrait presence layer (chip, note, Theater, voice Stage) for the Holostaff runtime.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.holostaff.ai",
|