@pretense/cli 0.6.24 → 0.6.25

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.
@@ -17,7 +17,7 @@ function versionFromPackageJson() {
17
17
  return void 0;
18
18
  }
19
19
  }
20
- var PRETENSE_VERSION = (true ? "0.6.24" : void 0) ?? versionFromPackageJson() ?? "0.0.0-unknown";
20
+ var PRETENSE_VERSION = (true ? "0.6.25" : void 0) ?? versionFromPackageJson() ?? "0.0.0-unknown";
21
21
 
22
22
  export {
23
23
  PRETENSE_VERSION
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  PRETENSE_VERSION
4
- } from "./chunk-AWXABIHH.js";
4
+ } from "./chunk-XYBJ63JG.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM,
@@ -16657,11 +16657,11 @@ function versionFromCliPackageJson() {
16657
16657
  return void 0;
16658
16658
  }
16659
16659
  function productVersion() {
16660
- return override ?? (true ? "0.6.24" : void 0) ?? versionFromCliPackageJson() ?? "0.0.0-unknown";
16660
+ return override ?? (true ? "0.6.25" : void 0) ?? versionFromCliPackageJson() ?? "0.0.0-unknown";
16661
16661
  }
16662
16662
  var UNKNOWN_COMMIT = "unknown";
16663
16663
  function bakedCommitSha() {
16664
- return "b258672fe5eb6d72b12faf92d12452d06dfa8ab2".length > 0 ? "b258672fe5eb6d72b12faf92d12452d06dfa8ab2" : UNKNOWN_COMMIT;
16664
+ return "24595f8f691656d511f75ed2d8b59f98069779ac".length > 0 ? "24595f8f691656d511f75ed2d8b59f98069779ac" : UNKNOWN_COMMIT;
16665
16665
  }
16666
16666
  var FEATURE_TIERS = {
16667
16667
  compliance_export: "pro",
@@ -18634,6 +18634,13 @@ function planToTier(plan) {
18634
18634
  return null;
18635
18635
  }
18636
18636
  }
18637
+ var SUBSCRIPTION_STATUS_SHAPE = /^[A-Za-z][A-Za-z0-9_-]{0,31}$/;
18638
+ function parseSubscriptionStatus(raw2) {
18639
+ if (raw2 === null) return null;
18640
+ if (typeof raw2 !== "string") return void 0;
18641
+ const trimmed = raw2.trim();
18642
+ return SUBSCRIPTION_STATUS_SHAPE.test(trimmed) ? trimmed : void 0;
18643
+ }
18637
18644
  function parseEntitlement(body) {
18638
18645
  const raw2 = body["entitlement"];
18639
18646
  if (!raw2 || typeof raw2 !== "object") return void 0;
@@ -18641,11 +18648,13 @@ function parseEntitlement(body) {
18641
18648
  const effectivePlan = planToTier(e["effectivePlan"]);
18642
18649
  const planOnRecord = planToTier(e["planOnRecord"]);
18643
18650
  if (effectivePlan === null && planOnRecord === null) return void 0;
18651
+ const subscriptionStatus = parseSubscriptionStatus(e["subscriptionStatus"]);
18644
18652
  return {
18645
18653
  effectivePlan,
18646
18654
  planOnRecord,
18647
18655
  comped: e["comped"] === true,
18648
- hasActiveSubscription: e["hasActiveSubscription"] === true
18656
+ hasActiveSubscription: e["hasActiveSubscription"] === true,
18657
+ ...subscriptionStatus !== void 0 ? { subscriptionStatus } : {}
18649
18658
  };
18650
18659
  }
18651
18660
  async function tierFromBackend(apiKey) {
@@ -18761,9 +18770,44 @@ function entitlementMismatchLines(ent) {
18761
18770
  const paidOnRecord = ent.planOnRecord === "pro" || ent.planOnRecord === "enterprise";
18762
18771
  if (ent.effectivePlan !== "free" || !paidOnRecord) return [];
18763
18772
  const planName = ent.planOnRecord === "enterprise" ? "Enterprise" : "Pro";
18773
+ const status = ent.subscriptionStatus;
18774
+ if (status === void 0) {
18775
+ return [
18776
+ `${planName} plan on record, but this key resolves to Free.`,
18777
+ "This server did not report the reason \u2014 a paid org without an entitling",
18778
+ "subscription or comp resolves to Free; see pretense.ai/dashboard/settings."
18779
+ ];
18780
+ }
18781
+ if (status === null) {
18782
+ if (ent.comped) {
18783
+ return [
18784
+ `${planName} plan on record and the org is comped with no subscription record,`,
18785
+ "yet this key resolves to Free \u2014 that combination is unexpected.",
18786
+ "Please contact support with this output \u2014 pretense.ai/dashboard/settings."
18787
+ ];
18788
+ }
18789
+ return [
18790
+ `${planName} plan present, but no active subscription or comp \u2014 running as Free.`,
18791
+ "Attach a Stripe subscription or set the org comp flag \u2014 pretense.ai/dashboard/settings."
18792
+ ];
18793
+ }
18794
+ if (ent.hasActiveSubscription) {
18795
+ return [
18796
+ `${planName} plan on record with a ${status} subscription the server reports as`,
18797
+ "active, yet this key resolves to Free \u2014 that combination is unexpected.",
18798
+ "Please contact support with this output \u2014 pretense.ai/dashboard/settings."
18799
+ ];
18800
+ }
18801
+ if (ent.comped) {
18802
+ return [
18803
+ `${planName} plan on record and the org IS comped, but a ${status} subscription`,
18804
+ "record is overriding the comp \u2014 running as Free.",
18805
+ `Remove or replace that ${status} subscription record \u2014 pretense.ai/dashboard/settings.`
18806
+ ];
18807
+ }
18764
18808
  return [
18765
- `${planName} plan present, but no active subscription or comp \u2014 running as Free.`,
18766
- "Attach a Stripe subscription or set the org comp flag \u2014 pretense.ai/dashboard/settings."
18809
+ `${planName} plan on record, but its subscription is ${status} \u2014 running as Free.`,
18810
+ "Replace it with a live subscription \u2014 pretense.ai/dashboard/settings."
18767
18811
  ];
18768
18812
  }
18769
18813
  function planMismatchHint(resolution) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  PRETENSE_VERSION
4
- } from "./chunk-AWXABIHH.js";
4
+ } from "./chunk-XYBJ63JG.js";
5
5
  import {
6
6
  init_esm_shims
7
7
  } from "./chunk-TWMRHZGM.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretense/cli",
3
- "version": "0.6.24",
3
+ "version": "0.6.25",
4
4
  "description": "Local-first AI firewall that mutates proprietary code before sending to LLM APIs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,14 +24,14 @@
24
24
  "typescript": "^5.4.0",
25
25
  "vitest": "^1.0.0",
26
26
  "@pretense/billing": "0.1.0",
27
- "@pretense/compliance-engine": "0.1.0",
28
- "@pretense/protocol": "0.1.0",
29
27
  "@pretense/learner": "0.2.0",
28
+ "@pretense/compliance-engine": "0.1.0",
30
29
  "@pretense/mutator": "0.2.0",
31
30
  "@pretense/proxy": "0.1.0",
32
31
  "@pretense/scanner": "0.2.0",
33
32
  "@pretense/scanner-rs": "0.2.0",
34
- "@pretense/store": "0.2.0"
33
+ "@pretense/store": "0.2.0",
34
+ "@pretense/protocol": "0.1.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public",