@reticlehq/core 2.8.0 → 2.10.0

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/impact.js ADDED
@@ -0,0 +1,127 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The impact record: what Reticle has actually done for this user, and what that is worth.
4
+ *
5
+ * Everything here is derived from calls that really happened - the dispatch chokepoint counts them
6
+ * - and is stored locally. Two kinds of number live in this file and they are NOT interchangeable:
7
+ *
8
+ * MEASURED - counted from real calls (tokens returned, verdicts, defects, sessions, minutes).
9
+ * ESTIMATED - a comparison against a run that did not happen (tokens/minutes SAVED). Every one of
10
+ * these carries the baseline it is measured against, because a saving without its
11
+ * denominator is not a claim, it is a slogan - and this project has already been
12
+ * bitten by publishing one ("2574x cheaper" compares against an LLM re-drive, not a
13
+ * compiled suite).
14
+ *
15
+ * The UI must render the two differently and must never present an estimate as a count.
16
+ */
17
+ /** Storage + wire version for the impact record. Bump on any breaking shape change. */
18
+ export const IMPACT_SCHEMA_VERSION = 1;
19
+ /** How many daily buckets a store keeps - enough for a month's chart plus a fortnight of slack. */
20
+ export const IMPACT_DAILY_BUCKETS = 45;
21
+ /** Counts of things that actually happened. Every field is a tally, never an estimate. */
22
+ export const ImpactCountsSchema = z.object({
23
+ /** Session-bound tool calls that reached a handler. */
24
+ calls: z.number().int().nonnegative(),
25
+ /** Calls that produced a verdict (act_and_wait / assert). */
26
+ verdicts: z.number().int().nonnegative(),
27
+ /** Verdicts that came back verified:"yes". */
28
+ passed: z.number().int().nonnegative(),
29
+ /** Verdicts that came back verified:"no" - a defect the agent would otherwise have called done. */
30
+ failed: z.number().int().nonnegative(),
31
+ /** Verdicts Reticle could not decide. Shown, not hidden: an unknown is not a pass. */
32
+ unknown: z.number().int().nonnegative(),
33
+ /** Refusals - a drive Reticle declined rather than faking. */
34
+ refusals: z.number().int().nonnegative(),
35
+ /** Notes a human pinned to the page. */
36
+ marks: z.number().int().nonnegative(),
37
+ /** Distinct sessions seen. */
38
+ sessions: z.number().int().nonnegative(),
39
+ /** Tokens Reticle returned to the agent (estimated per call at ~4 chars/token, then summed). */
40
+ tokensReturned: z.number().int().nonnegative(),
41
+ /** Wall-clock milliseconds spent inside tool calls. */
42
+ drivingMs: z.number().int().nonnegative(),
43
+ });
44
+ /** One day's slice of the same counters, keyed by ISO date, for the chart. */
45
+ export const ImpactDaySchema = z.object({
46
+ /** YYYY-MM-DD, local to the machine that recorded it. */
47
+ date: z.string(),
48
+ counts: ImpactCountsSchema,
49
+ });
50
+ /** Bests worth beating. Gamification, entirely local. */
51
+ export const ImpactRecordsSchema = z.object({
52
+ /** Longest single session, in ms. */
53
+ longestRunMs: z.number().int().nonnegative(),
54
+ /** Most verdicts in one day. */
55
+ bestVerdictDay: z.number().int().nonnegative(),
56
+ /** Most defects caught in one day. */
57
+ bestDefectDay: z.number().int().nonnegative(),
58
+ /** Consecutive days with at least one verdict, up to and including today. */
59
+ streakDays: z.number().int().nonnegative(),
60
+ /** Longest such streak ever. */
61
+ bestStreakDays: z.number().int().nonnegative(),
62
+ });
63
+ /**
64
+ * A saving, with the comparison that produced it.
65
+ *
66
+ * `basis` names what the number is measured AGAINST, in the user's own words, and it is rendered
67
+ * next to the figure. No basis, no number.
68
+ */
69
+ export const ImpactEstimateSchema = z.object({
70
+ value: z.number().nonnegative(),
71
+ basis: z.string(),
72
+ });
73
+ export const ImpactSavingsSchema = z.object({
74
+ /** Tokens not spent, vs looking at the app the way an agent without Reticle has to. */
75
+ tokens: ImpactEstimateSchema,
76
+ /** Minutes not spent, vs the re-prompt cycle a false green costs. */
77
+ minutes: ImpactEstimateSchema,
78
+ });
79
+ /** One scope of the record: this project, or everything on this machine. */
80
+ export const ImpactScopeSchema = z.object({
81
+ counts: ImpactCountsSchema,
82
+ days: z.array(ImpactDaySchema),
83
+ records: ImpactRecordsSchema,
84
+ savings: ImpactSavingsSchema,
85
+ /** When this scope first recorded anything (epoch ms). */
86
+ since: z.number().int().nonnegative(),
87
+ });
88
+ /** What the HUD receives: this project, and the machine-wide total. */
89
+ export const ImpactSnapshotSchema = z.object({
90
+ schemaVersion: z.number().int().positive(),
91
+ project: ImpactScopeSchema,
92
+ global: ImpactScopeSchema,
93
+ /** Project name, for the report's title row. */
94
+ projectName: z.string().optional(),
95
+ });
96
+ /** Empty counters - the starting point for a fresh store and the identity for merges. */
97
+ export function emptyImpactCounts() {
98
+ return {
99
+ calls: 0,
100
+ verdicts: 0,
101
+ passed: 0,
102
+ failed: 0,
103
+ unknown: 0,
104
+ refusals: 0,
105
+ marks: 0,
106
+ sessions: 0,
107
+ tokensReturned: 0,
108
+ drivingMs: 0,
109
+ };
110
+ }
111
+ export function emptyImpactRecords() {
112
+ return {
113
+ longestRunMs: 0,
114
+ bestVerdictDay: 0,
115
+ bestDefectDay: 0,
116
+ streakDays: 0,
117
+ bestStreakDays: 0,
118
+ };
119
+ }
120
+ /** Add one delta into a running total. Pure; the store owns persistence. */
121
+ export function addImpactCounts(base, delta) {
122
+ const out = { ...base };
123
+ for (const key of Object.keys(out)) {
124
+ out[key] = out[key] + (delta[key] ?? 0);
125
+ }
126
+ return out;
127
+ }
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export * from './consequence.js';
26
26
  export * from './project-id.js';
27
27
  export * from './notices.js';
28
28
  export * from './journal.js';
29
+ export * from './browser-misdirect.js';
29
30
  export * from './daemon-registry.js';
30
31
  export * from './security.js';
31
32
  export * from './redaction.js';
@@ -34,5 +35,9 @@ export * from './toon.js';
34
35
  export * from './upgrade.js';
35
36
  export * from './telemetry.js';
36
37
  export * from './telemetry-session.js';
38
+ export * from './telemetry-license.js';
37
39
  export * from './telemetry-feedback.js';
38
- export { CONTRACT_FINGERPRINT, fingerprintOf } from './contract-fingerprint.js';
40
+ export * from './impact.js';
41
+ export * from './impact-savings.js';
42
+ export { CONTRACT_FINGERPRINT, fnv1a, fingerprintOf } from './contract-fingerprint.js';
43
+ export { fingerprintFinding, type FindingIdentity } from './finding-fingerprint.js';
package/dist/index.js CHANGED
@@ -27,6 +27,9 @@ export * from './consequence.js';
27
27
  export * from './project-id.js';
28
28
  export * from './notices.js';
29
29
  export * from './journal.js';
30
+ // Not an API — three names that exist so importing the BROWSER SDK from here fails with a sentence
31
+ // naming @reticlehq/browser, instead of a bare SyntaxError that blanks the app. See the module.
32
+ export * from './browser-misdirect.js';
30
33
  // ── INTERNAL cross-package plumbing (shared impl; not a stable outside API — may change in a minor) ─
31
34
  export * from './daemon-registry.js'; // daemon discovery, used by the vite plugin + server
32
35
  export * from './security.js'; // sanitize/serialize helpers shared by browser + server
@@ -36,5 +39,9 @@ export * from './toon.js'; // TOON encoding used by the server's result encoder
36
39
  export * from './upgrade.js'; // self-update policy shared by the CLI
37
40
  export * from './telemetry.js';
38
41
  export * from './telemetry-session.js'; // the session/project rollup payloads
42
+ export * from './telemetry-license.js'; // LicenseActivation — shared by the licence gate and telemetry
39
43
  export * from './telemetry-feedback.js'; // the two things a PERSON writes: feedback + a self-declared identity // anonymous adoption telemetry wire contract (DAU/WAU/MAU/installs)
40
- export { CONTRACT_FINGERPRINT, fingerprintOf } from './contract-fingerprint.js';
44
+ export * from './impact.js'; // the user's own record of what Reticle has done for them (local only)
45
+ export * from './impact-savings.js'; // the savings model - one file, so every claim is derivable there
46
+ export { CONTRACT_FINGERPRINT, fnv1a, fingerprintOf } from './contract-fingerprint.js';
47
+ export { fingerprintFinding } from './finding-fingerprint.js';
package/dist/notices.d.ts CHANGED
@@ -50,6 +50,18 @@ export declare const UNDELIVERED_NOTES_LABEL = "Undelivered (paste into your ter
50
50
  export declare const AGENT_WAITING_NOTICE = "Agent finished its turn \u2014 your move. Continue in your terminal.";
51
51
  /** Panel notice prefix when the agent is blocked on you (reticle_yield mode:'ask'); the question follows. */
52
52
  export declare const AGENT_ASK_NOTICE = "Agent needs your input \u2014 answer in your terminal";
53
+ /**
54
+ * Returned by `reticle_session` yield/end when the turn ends with no browser session connected.
55
+ *
56
+ * Ending a turn is not an operation on a tab. The agent is reporting that it has stopped driving,
57
+ * and that is true whether or not anything was ever connected — so refusing it made the agent fail
58
+ * a call it was told is MANDATORY, on the most common state a session is in. Reported agents skip
59
+ * yield entirely and note the gap in prose, which is the outcome this notice exists to remove.
60
+ *
61
+ * Said back to the caller rather than swallowed, so "the panel showed nothing" is a fact the agent
62
+ * can put in its report instead of an absence it has to infer.
63
+ */
64
+ export declare const YIELD_WITHOUT_SESSION_NOTE: string;
53
65
  /**
54
66
  * Actionable companion to THROTTLED_WARNING. Surfaced on act/assert results and
55
67
  * reticle_sessions rows when a tab is hidden/throttled and may be un-focusable/un-recoverable from
package/dist/notices.js CHANGED
@@ -54,6 +54,19 @@ export const UNDELIVERED_NOTES_LABEL = 'Undelivered (paste into your terminal):'
54
54
  export const AGENT_WAITING_NOTICE = 'Agent finished its turn — your move. Continue in your terminal.';
55
55
  /** Panel notice prefix when the agent is blocked on you (reticle_yield mode:'ask'); the question follows. */
56
56
  export const AGENT_ASK_NOTICE = 'Agent needs your input — answer in your terminal';
57
+ /**
58
+ * Returned by `reticle_session` yield/end when the turn ends with no browser session connected.
59
+ *
60
+ * Ending a turn is not an operation on a tab. The agent is reporting that it has stopped driving,
61
+ * and that is true whether or not anything was ever connected — so refusing it made the agent fail
62
+ * a call it was told is MANDATORY, on the most common state a session is in. Reported agents skip
63
+ * yield entirely and note the gap in prose, which is the outcome this notice exists to remove.
64
+ *
65
+ * Said back to the caller rather than swallowed, so "the panel showed nothing" is a fact the agent
66
+ * can put in its report instead of an absence it has to infer.
67
+ */
68
+ export const YIELD_WITHOUT_SESSION_NOTE = 'No browser session was connected, so there was no panel to update. The turn end was still ' +
69
+ 'recorded. If you expected an app to be attached, that is the thing to look into.';
57
70
  /**
58
71
  * Actionable companion to THROTTLED_WARNING. Surfaced on act/assert results and
59
72
  * reticle_sessions rows when a tab is hidden/throttled and may be un-focusable/un-recoverable from
@@ -19,18 +19,39 @@ export const PROJECT_ID_HASH_LENGTH = 8;
19
19
  const FALLBACK_PROJECT_BASE = 'app';
20
20
  /** `@acme/web` → `acme-web`; non-alphanumerics collapse to single dashes; edges trimmed. */
21
21
  export function slugifyPackageName(name) {
22
- return name
22
+ const collapsed = name
23
23
  .toLowerCase()
24
24
  .replace(/^@/, '')
25
- .replace(/[^a-z0-9]+/g, '-')
26
- .replace(/^-+|-+$/g, '');
25
+ .replace(/[^a-z0-9]+/g, '-');
26
+ return trimChar(collapsed, '-');
27
+ }
28
+ /**
29
+ * Trim a repeated character from both ends without a regex.
30
+ *
31
+ * `/^-+|-+$/` is an anchored quantifier, and on a string of many dashes the engine retries the
32
+ * match from every position: linear input, quadratic work. Nothing hostile reaches here today (the
33
+ * inputs are the user's own package name and path), which is exactly why it would have gone
34
+ * unnoticed if something ever did. Two index walks cost nothing and cannot backtrack.
35
+ */
36
+ function trimChar(value, char) {
37
+ let start = 0;
38
+ let end = value.length;
39
+ while (start < end && value[start] === char)
40
+ start += 1;
41
+ while (end > start && value[end - 1] === char)
42
+ end -= 1;
43
+ return value.slice(start, end);
27
44
  }
28
45
  /**
29
46
  * The last segment of a path — `node:path`'s `basename`, reimplemented because core may not import
30
47
  * Node. Handles both separators so a Windows root produces the same id as a POSIX one.
31
48
  */
32
49
  function pathTail(path) {
33
- const trimmed = path.replace(/[/\\]+$/, '');
50
+ // Same reason as `trimChar`: an anchored `+` over a run of separators backtracks quadratically.
51
+ let end = path.length;
52
+ while (end > 0 && ('/' === path[end - 1] || '\\' === path[end - 1]))
53
+ end -= 1;
54
+ const trimmed = path.slice(0, end);
34
55
  const cut = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\'));
35
56
  return -1 === cut ? trimmed : trimmed.slice(cut + 1);
36
57
  }
package/dist/security.js CHANGED
@@ -1,4 +1,21 @@
1
- const DANGEROUS_ACTION = /\b(delete|remove|destroy|erase|drop|terminate|revoke|reset|logout|log out|sign out|close account|cancel subscription|purchase|buy|pay|place order|confirm order|deploy|publish|send|transfer|withdraw|refund)\b/i;
1
+ /**
2
+ * Labels that can trigger an irreversible or money-moving effect.
3
+ *
4
+ * `send` used to be a bare token here, to cover moving money, and it taxed every ordinary button
5
+ * that sends something: reported from the field on `Send check-in` (a POST that logs a text
6
+ * message) and alongside it `Send message`, `Send invite`, `Send feedback`. A false block costs a
7
+ * round-trip and, repeated, trains an agent to pass confirmDangerous reflexively — which is the one
8
+ * outcome that makes this guard worthless.
9
+ *
10
+ * The money cases are still covered, through the thing being SENT rather than the act of sending:
11
+ * `payment` catches "Send payment" and "Confirm payment" (which the bare-verb list missed entirely,
12
+ * because `\bpay\b` does not match "payment"), and `send money`/`send funds` catch the rest.
13
+ *
14
+ * The guard stays deliberately asymmetric — a false block costs one round-trip, a missed block can
15
+ * charge somebody's card — so this narrows the trigger without lowering money coverage. Both
16
+ * directions are pinned in security.test.ts.
17
+ */
18
+ const DANGEROUS_ACTION = /\b(delete|remove|destroy|erase|drop|terminate|revoke|reset|logout|log out|sign out|close account|cancel subscription|purchase|buy|pay|payment|place order|confirm order|deploy|publish|send money|send funds|transfer|withdraw|refund)\b/i;
2
19
  /** The hostnames that ARE loopback outright, with no parsing: the name, and IPv6 ::1 both ways. */
3
20
  const LOOPBACK_HOSTNAMES = ['localhost', '::1', '0:0:0:0:0:0:0:1'];
4
21
  /** IPv4 loopback is the whole 127.0.0.0/8 block, so the first octet is the entire test. */
@@ -113,3 +113,21 @@ export declare const HealthReason: {
113
113
  readonly INITIAL: "initial";
114
114
  };
115
115
  export type HealthReason = (typeof HealthReason)[keyof typeof HealthReason];
116
+ /**
117
+ * The one thing to DO when nothing is connected — the executable half of the no-session diagnosis.
118
+ *
119
+ * The prose diagnosis tells the cases apart well, and an agent still has to translate it into a
120
+ * command. This is that command's kind, so the agent branches on a value instead of on a sentence.
121
+ * Wire-owned because it crosses daemon → agent on `reticle_sessions`.
122
+ */
123
+ export declare const NoSessionAction: {
124
+ /** Nothing is listening anywhere: the app is not running. Carries the project's own dev script. */
125
+ readonly START_DEV_SERVER: "start_dev_server";
126
+ /** Something is listening but this project carries no Reticle SDK — wire it first. */
127
+ readonly RUN_INIT: "run_init";
128
+ /** A wired app is up and no page is loaded — Reticle only ever sees a page a browser has opened. */
129
+ readonly OPEN_APP: "open_app";
130
+ /** A session was here and went away: reopen the tab, or take a lease. */
131
+ readonly REOPEN_APP: "reopen_app";
132
+ };
133
+ export type NoSessionAction = (typeof NoSessionAction)[keyof typeof NoSessionAction];
@@ -110,3 +110,20 @@ export const HealthReason = {
110
110
  HEARTBEAT: 'heartbeat',
111
111
  INITIAL: 'initial',
112
112
  };
113
+ /**
114
+ * The one thing to DO when nothing is connected — the executable half of the no-session diagnosis.
115
+ *
116
+ * The prose diagnosis tells the cases apart well, and an agent still has to translate it into a
117
+ * command. This is that command's kind, so the agent branches on a value instead of on a sentence.
118
+ * Wire-owned because it crosses daemon → agent on `reticle_sessions`.
119
+ */
120
+ export const NoSessionAction = {
121
+ /** Nothing is listening anywhere: the app is not running. Carries the project's own dev script. */
122
+ START_DEV_SERVER: 'start_dev_server',
123
+ /** Something is listening but this project carries no Reticle SDK — wire it first. */
124
+ RUN_INIT: 'run_init',
125
+ /** A wired app is up and no page is loaded — Reticle only ever sees a page a browser has opened. */
126
+ OPEN_APP: 'open_app',
127
+ /** A session was here and went away: reopen the tab, or take a lease. */
128
+ REOPEN_APP: 'reopen_app',
129
+ };
@@ -49,7 +49,19 @@ export declare const FeedbackKind: {
49
49
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
50
50
  */
51
51
  readonly IMPROVEMENT: "improvement";
52
- /** A human's overall take on using Reticle (carries `rating`). */
52
+ /**
53
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
54
+ *
55
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
56
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
57
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
58
+ * which is the question a refactor actually needs answered.
59
+ *
60
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
61
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
62
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
63
+ * moment, which is also the only part that can be quoted or acted on.
64
+ */
53
65
  readonly EXPERIENCE: "experience";
54
66
  };
55
67
  export type FeedbackKind = (typeof FeedbackKind)[keyof typeof FeedbackKind];
@@ -146,7 +158,19 @@ export declare const FeedbackSchema: z.ZodObject<{
146
158
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
147
159
  */
148
160
  readonly IMPROVEMENT: "improvement";
149
- /** A human's overall take on using Reticle (carries `rating`). */
161
+ /**
162
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
163
+ *
164
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
165
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
166
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
167
+ * which is the question a refactor actually needs answered.
168
+ *
169
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
170
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
171
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
172
+ * moment, which is also the only part that can be quoted or acted on.
173
+ */
150
174
  readonly EXPERIENCE: "experience";
151
175
  }>;
152
176
  /** The author's account. For an agent: what failed and why (its RCA). For a human: their words. */
@@ -219,10 +243,10 @@ export declare const FeedbackSchema: z.ZodObject<{
219
243
  text: string;
220
244
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
221
245
  source: "agent" | "human";
246
+ impact?: string | undefined;
222
247
  trace?: string | undefined;
223
248
  rating?: number | undefined;
224
249
  need?: string | undefined;
225
- impact?: string | undefined;
226
250
  currentApproach?: string | undefined;
227
251
  model?: string | undefined;
228
252
  clientVersion?: string | undefined;
@@ -237,10 +261,10 @@ export declare const FeedbackSchema: z.ZodObject<{
237
261
  text: string;
238
262
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
239
263
  source: "agent" | "human";
264
+ impact?: string | undefined;
240
265
  trace?: string | undefined;
241
266
  rating?: number | undefined;
242
267
  need?: string | undefined;
243
- impact?: string | undefined;
244
268
  currentApproach?: string | undefined;
245
269
  model?: string | undefined;
246
270
  clientVersion?: string | undefined;
@@ -48,7 +48,19 @@ export const FeedbackKind = {
48
48
  * would hide the second inside the first, and the second is usually cheaper and higher-impact.
49
49
  */
50
50
  IMPROVEMENT: 'improvement',
51
- /** A human's overall take on using Reticle (carries `rating`). */
51
+ /**
52
+ * "This worked, and here is what it did." An overall take on using Reticle, carrying `rating`.
53
+ *
54
+ * Filed by a human at a terminal OR by an agent mid-task, and the agent case is the one that was
55
+ * missing: every other kind an agent can file is a complaint, so the corpus could only ever grow
56
+ * into a defect list. Nothing in it said which parts were worth protecting when we changed them,
57
+ * which is the question a refactor actually needs answered.
58
+ *
59
+ * A score alone is close to worthless here and the tool says so: a model asked for a number will
60
+ * produce an agreeable one, and an agreeable number is indistinguishable from an earned one once
61
+ * both are in the same column. What makes a report usable is the `text` naming the concrete
62
+ * moment, which is also the only part that can be quoted or acted on.
63
+ */
52
64
  EXPERIENCE: 'experience',
53
65
  };
54
66
  /** Which shell the verified app runs in. Mirrors the SDK's own `PAGE_HEALTH` runtime report. */
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Enterprise activation, as the wire reports it.
3
+ *
4
+ * Its own file rather than another block in `telemetry.ts`: this vocabulary is shared by the LICENCE
5
+ * GATE (`describeLicense` types its report against it) and by the telemetry that reports the gate's
6
+ * outcome, and those are the two sides a copied enum silently drifts between. Keeping it at the bottom
7
+ * of the graph is what lets both import the same list instead of each keeping their own.
8
+ */
9
+ /**
10
+ * How enterprise activation resolved on the machine that sent an event. The closed list, defined HERE
11
+ * so the license gate and the telemetry that reports it cannot drift apart: `describeLicense` in the
12
+ * server types its report against this rather than re-listing the strings (rule 4 — a copied
13
+ * vocabulary is a correctness hazard the moment it is a number somebody reads).
14
+ *
15
+ * This is a STATUS, never an identity. It says whether a key verified, not whose key it is; the
16
+ * separate `licenseId` carries the opaque id, and the organisation NAME never goes on the wire at all.
17
+ */
18
+ export declare const LicenseActivation: {
19
+ /** A valid, unexpired, correctly-signed key covering this build. */
20
+ readonly ACTIVE: "active";
21
+ /** An issuer key is baked but no license key is set — an unlicensed install of a release build. */
22
+ readonly MISSING: "missing";
23
+ /** A key was present and rejected: malformed, wrong issuer, or a tampered payload. */
24
+ readonly INVALID: "invalid";
25
+ /**
26
+ * A key that verified but whose expiry has passed. The renewal signal: this arriving from a machine
27
+ * that used to report `active` is a lapse we can see BEFORE the customer reports it, and it is the
28
+ * whole reason status is reported separately from identity — a lapsed customer stops sending
29
+ * `licenseId`, so on identity alone a lapse and a churn look identical.
30
+ */
31
+ readonly EXPIRED: "expired";
32
+ /** No issuer key configured at all: a source build or a dev checkout, where features run free. */
33
+ readonly EVAL: "eval";
34
+ };
35
+ export type LicenseActivation = (typeof LicenseActivation)[keyof typeof LicenseActivation];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Enterprise activation, as the wire reports it.
3
+ *
4
+ * Its own file rather than another block in `telemetry.ts`: this vocabulary is shared by the LICENCE
5
+ * GATE (`describeLicense` types its report against it) and by the telemetry that reports the gate's
6
+ * outcome, and those are the two sides a copied enum silently drifts between. Keeping it at the bottom
7
+ * of the graph is what lets both import the same list instead of each keeping their own.
8
+ */
9
+ /**
10
+ * How enterprise activation resolved on the machine that sent an event. The closed list, defined HERE
11
+ * so the license gate and the telemetry that reports it cannot drift apart: `describeLicense` in the
12
+ * server types its report against this rather than re-listing the strings (rule 4 — a copied
13
+ * vocabulary is a correctness hazard the moment it is a number somebody reads).
14
+ *
15
+ * This is a STATUS, never an identity. It says whether a key verified, not whose key it is; the
16
+ * separate `licenseId` carries the opaque id, and the organisation NAME never goes on the wire at all.
17
+ */
18
+ export const LicenseActivation = {
19
+ /** A valid, unexpired, correctly-signed key covering this build. */
20
+ ACTIVE: 'active',
21
+ /** An issuer key is baked but no license key is set — an unlicensed install of a release build. */
22
+ MISSING: 'missing',
23
+ /** A key was present and rejected: malformed, wrong issuer, or a tampered payload. */
24
+ INVALID: 'invalid',
25
+ /**
26
+ * A key that verified but whose expiry has passed. The renewal signal: this arriving from a machine
27
+ * that used to report `active` is a lapse we can see BEFORE the customer reports it, and it is the
28
+ * whole reason status is reported separately from identity — a lapsed customer stops sending
29
+ * `licenseId`, so on identity alone a lapse and a churn look identical.
30
+ */
31
+ EXPIRED: 'expired',
32
+ /** No issuer key configured at all: a source build or a dev checkout, where features run free. */
33
+ EVAL: 'eval',
34
+ };