@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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # @holostaff/sdk
2
2
 
3
- Lifetime identity, stage detection, and custom signal probes for the holostaff runtime.
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 workflow boundaries (placed by the deploy PR's agent).
23
- holostaff.markStageEntry('selection')
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
- All methods are fail-soft they never throw into your code.
36
- Errors route to the optional `onError` callback you pass to `init()`.
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 holostaff runtime.
44
- - Open a server-sent-events channel for future intervention dispatch.
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
- - Capture rrweb / DOM events that lives in the existing holostaff widget.
48
- - Render interventions Wave 4.
49
- - Manage idle-pause cadenceruntime-side concern.
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
- - [copilot-runtime-design.md](../documents/copilot-runtime-design.md) — runtime control loop + identity model.
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)
@@ -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
- * Wave 1c: the channel opens but the server doesn't dispatch any
35
- * `fire_intervention` events yet (Wave 4). We still establish it now
36
- * so customer apps wire it up once and reap commands automatically
37
- * when the firing engine lands.
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
- * Wave 1c: the channel opens but the server doesn't dispatch any
93
- * `fire_intervention` events yet (Wave 4). We still establish it now
94
- * so customer apps wire it up once and reap commands automatically
95
- * when the firing engine lands.
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.0",
4
- "description": "Holostaff SDK — lifetime identity, stage detection, and custom signal probes for the holostaff runtime.",
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",