openrod 0.2.0-rc.2 → 0.2.0-rc.4

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.
@@ -1,4 +1,4 @@
1
- import{u as en,a as tn,r as Re,d as sn,s as hs,b as Xe,c as ls,e as cs,f as rn,j as V,p as ds,T as nn,L as on,B as us,R as an,D as hn,g as ln,C as cn,h as dn,i as un,t as _n}from"./index-X6JTD5c-.js";/**
1
+ import{u as en,a as tn,r as Re,d as sn,s as hs,b as Xe,c as ls,e as cs,f as rn,j as V,p as ds,T as nn,L as on,B as us,R as an,D as hn,g as ln,C as cn,h as dn,i as un,t as _n}from"./index-Cys0XhXV.js";/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *
package/dist/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="theme-color" content="#ffffff" />
8
8
  <meta name="description" content="OpenRod — sandboxes, templates, and activity." />
9
9
  <title>OpenRod</title>
10
- <script type="module" crossorigin src="/assets/index-X6JTD5c-.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-Cys0XhXV.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-BXCNsM6h.css">
12
12
  </head>
13
13
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrod",
3
- "version": "0.2.0-rc.2",
3
+ "version": "0.2.0-rc.4",
4
4
  "description": "A local console for OpenShell gateways, sandboxes, and activity.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/OpenRod/OpenRod#readme",
@@ -19,6 +19,7 @@ const text = value => typeof value === 'string' ? value.trim().slice(0, 2000) :
19
19
  const agentIds = value => Array.isArray(value) ? [...new Set(value.filter(id => ['claude', 'codex', 'cursor', 'pi', 'antigravity', 'opencode', 'aider', 'copilot', 'kiro', 'droid'].includes(id)))].slice(0, 12) : undefined
20
20
  const configFields = { creation_mode: choices('quick', 'template'), file_source: choices('empty', 'folder', 'repo'), agent_ids: agentIds, setup_count: number, provider_count: number, group_count: number }
21
21
  const EVENTS = {
22
+ telemetry_declined: {},
22
23
  console_opened: { gateway_state: choices('available', 'setup_required', 'unavailable'), first_observed_visit: boolean, connection_method: choices('automatic', 'manual', 'existing', 'unknown') },
23
24
  view_opened: { previous_view: view },
24
25
  flow_started: { ...flowFields, ...configFields },
@@ -31,6 +32,7 @@ const EVENTS = {
31
32
 
32
33
  export function sanitizeEvent(event, properties = {}) {
33
34
  if (!Object.hasOwn(EVENTS, event)) return null
35
+ if (event === 'telemetry_declined') return {}
34
36
  const safe = {}
35
37
  for (const [key, validate] of Object.entries({ view, ...EVENTS[event] })) {
36
38
  const value = validate(properties[key])
@@ -119,6 +121,16 @@ export function createAnalytics({ getStorage = () => window.localStorage, getLoc
119
121
  refresh()
120
122
  })
121
123
  }
124
+ function declineSharing() {
125
+ return safe(() => {
126
+ refresh()
127
+ if (state.sharing === false) return false
128
+ const report = state.available
129
+ // Revoke usage and erase correlation before sending the one-off choice.
130
+ setSharing(false)
131
+ return report && state.sharing === false && capture('telemetry_declined', {}, { explicitDecline: true })
132
+ }, false)
133
+ }
122
134
  function identity() {
123
135
  const store = storage()
124
136
  let id = uuid(store.getItem(ID_KEY)), session
@@ -130,10 +142,12 @@ export function createAnalytics({ getStorage = () => window.localStorage, getLoc
130
142
  store.setItem(SESSION_KEY, JSON.stringify({ id: session.id, at: now() }))
131
143
  return { id, session: session.id, first: firstVisit }
132
144
  }
133
- function capture(event, properties = {}, { explicitFeedback = false } = {}) {
145
+ function capture(event, properties = {}, { explicitFeedback = false, explicitDecline = false } = {}) {
134
146
  return safe(() => {
135
147
  refresh()
136
- if (!state.available || (state.sharing !== true && !(explicitFeedback && event === 'feedback_submitted'))) return false
148
+ const decline = explicitDecline && event === 'telemetry_declined' && state.sharing === false
149
+ if (event === 'telemetry_declined' && !decline) return false
150
+ if (!state.available || (state.sharing !== true && !decline && !(explicitFeedback && event === 'feedback_submitted'))) return false
137
151
  const sanitized = sanitizeEvent(event, properties)
138
152
  if (!sanitized) return false
139
153
  // Recheck the stored preference before every request, including in other tabs.
@@ -152,7 +166,7 @@ export function createAnalytics({ getStorage = () => window.localStorage, getLoc
152
166
  ...(regular && who.session ? { $session_id: who.session } : {}),
153
167
  ...(regular && currentView ? { view: currentView } : {}),
154
168
  // Opted-in usage gets PostHog's approximate location (country, city);
155
- // the project discards the IP itself. Feedback-only events get neither.
169
+ // the project discards the IP itself. Feedback-only and decline events get neither.
156
170
  ...sanitized, $process_person_profile: false, ...(regular ? {} : { $geoip_disable: true }),
157
171
  ...(event === 'console_opened' ? { first_observed_visit: who.first } : {}),
158
172
  ...(explicitFeedback ? { feedback_only: !regular } : {}),
@@ -309,7 +323,7 @@ export function createAnalytics({ getStorage = () => window.localStorage, getLoc
309
323
  }
310
324
  })
311
325
  }
312
- return { configure, setSharing, refresh, capture, observeConsole, observeView, startFlow, exploreFlow, step, finishFlow, ready, templateStarted, observeTemplates,
326
+ return { configure, setSharing, declineSharing, refresh, capture, observeConsole, observeView, startFlow, exploreFlow, step, finishFlow, ready, templateStarted, observeTemplates,
313
327
  submitFeedback, terminalClick, terminalFlow,
314
328
  subscribe: listener => { listeners.add(listener); return () => listeners.delete(listener) }, getSnapshot: () => state,
315
329
  stop: () => { authorized = false; halt(); refresh() },