@holostaff/sdk 0.3.0 → 0.3.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 +22 -12
- package/dist/transport.d.ts +4 -4
- package/dist/transport.js +4 -4
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @holostaff/sdk
|
|
2
2
|
|
|
3
|
-
Lifetime identity, stage detection,
|
|
3
|
+
Lifetime identity, stage detection, custom signal probes, and the
|
|
4
|
+
intervention widget for the Holostaff runtime.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
@@ -19,8 +20,8 @@ holostaff.init({
|
|
|
19
20
|
tenantId: 'your-tenant-id',
|
|
20
21
|
})
|
|
21
22
|
|
|
22
|
-
// At
|
|
23
|
-
holostaff.markStageEntry('
|
|
23
|
+
// At journey-stage boundaries (placed by the deploy PR's agent).
|
|
24
|
+
holostaff.markStageEntry('adoption')
|
|
24
25
|
|
|
25
26
|
// On sign-in completion.
|
|
26
27
|
holostaff.identify(user.id)
|
|
@@ -30,25 +31,34 @@ holostaff.clearIdentity()
|
|
|
30
31
|
|
|
31
32
|
// On host-app events the scan detected as worth observing.
|
|
32
33
|
holostaff.emitSignal('first_resource_created', { kind: 'project' })
|
|
34
|
+
|
|
35
|
+
// Only needed if you render interventions yourself — the built-in
|
|
36
|
+
// widget reports outcomes automatically.
|
|
37
|
+
holostaff.reportOutcome(interventionId, 'engaged')
|
|
33
38
|
```
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
Calls made before `init()` queue and replay once it runs, so import
|
|
41
|
+
order is not load-bearing. All methods are fail-soft — they never throw
|
|
42
|
+
into your code. Errors route to the optional `onError` callback you
|
|
43
|
+
pass to `init()`.
|
|
37
44
|
|
|
38
45
|
## What this SDK does (and doesn't)
|
|
39
46
|
|
|
40
47
|
**Does**
|
|
41
48
|
- Mint and persist a lifetime device id (localStorage + first-party cookie).
|
|
42
49
|
- Open / close a session bound to page lifecycle.
|
|
43
|
-
- POST identity / stage / signal / outcome events to the
|
|
44
|
-
-
|
|
50
|
+
- POST identity / stage / signal / outcome events to the Holostaff runtime.
|
|
51
|
+
- Track the current SPA route and last-user-activity time, and forward
|
|
52
|
+
them to the runtime on route changes plus a low-frequency heartbeat.
|
|
53
|
+
- Hold a server-sent-events channel open and render `text` interventions
|
|
54
|
+
as a shadow-DOM pill (dismiss / engage / 30s auto-ignore), reporting
|
|
55
|
+
outcomes back automatically.
|
|
45
56
|
|
|
46
57
|
**Does not (yet)**
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
-
|
|
58
|
+
- Render non-text modalities (voice / email / sms / phone /
|
|
59
|
+
screen automation) — those events are surfaced to `onError` and skipped.
|
|
60
|
+
- Capture rrweb / DOM events — that lives in the Holostaff widget script.
|
|
50
61
|
|
|
51
62
|
## References
|
|
52
63
|
|
|
53
|
-
- [
|
|
54
|
-
- [copilot-deploy-design.md](../documents/copilot-deploy-design.md) — how the deploy PR wires `holostaff.init(...)` + the instrumentation calls into customer code.
|
|
64
|
+
- [docs.holostaff.ai](https://docs.holostaff.ai)
|
package/dist/transport.d.ts
CHANGED
|
@@ -31,10 +31,10 @@ export declare function postBeacon(cfg: TransportConfig, path: string, body: Rec
|
|
|
31
31
|
* Open an SSE channel for intervention commands. Returns the
|
|
32
32
|
* EventSource so the caller can attach listeners + close it.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* The server pushes `fire_intervention` events on this channel when a
|
|
35
|
+
* monitoring-agent decision passes suppression (Wave 3e). The widget
|
|
36
|
+
* subsystem subscribes and renders text interventions; other
|
|
37
|
+
* modalities are ignored client-side for now.
|
|
38
38
|
*/
|
|
39
39
|
export declare function openCommandStream(cfg: TransportConfig, sessionId: string, tenantId: string, sourceId: string): EventSource | null;
|
|
40
40
|
//# sourceMappingURL=transport.d.ts.map
|
package/dist/transport.js
CHANGED
|
@@ -89,10 +89,10 @@ export function postBeacon(cfg, path, body) {
|
|
|
89
89
|
* Open an SSE channel for intervention commands. Returns the
|
|
90
90
|
* EventSource so the caller can attach listeners + close it.
|
|
91
91
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
92
|
+
* The server pushes `fire_intervention` events on this channel when a
|
|
93
|
+
* monitoring-agent decision passes suppression (Wave 3e). The widget
|
|
94
|
+
* subsystem subscribes and renders text interventions; other
|
|
95
|
+
* modalities are ignored client-side for now.
|
|
96
96
|
*/
|
|
97
97
|
export function openCommandStream(cfg, sessionId, tenantId, sourceId) {
|
|
98
98
|
if (typeof EventSource === 'undefined')
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holostaff/sdk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Holostaff SDK — lifetime identity, stage detection,
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Holostaff SDK — lifetime identity, stage detection, custom signal probes, and the intervention widget for the Holostaff runtime.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://docs.holostaff.ai",
|
|
5
7
|
"type": "module",
|
|
6
8
|
"main": "./dist/index.js",
|
|
7
9
|
"module": "./dist/index.js",
|