@pretense/cli 0.6.23 → 0.6.24
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.
|
|
20
|
+
var PRETENSE_VERSION = (true ? "0.6.24" : 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-
|
|
4
|
+
} from "./chunk-AWXABIHH.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.
|
|
16660
|
+
return override ?? (true ? "0.6.24" : void 0) ?? versionFromCliPackageJson() ?? "0.0.0-unknown";
|
|
16661
16661
|
}
|
|
16662
16662
|
var UNKNOWN_COMMIT = "unknown";
|
|
16663
16663
|
function bakedCommitSha() {
|
|
16664
|
-
return "
|
|
16664
|
+
return "b258672fe5eb6d72b12faf92d12452d06dfa8ab2".length > 0 ? "b258672fe5eb6d72b12faf92d12452d06dfa8ab2" : UNKNOWN_COMMIT;
|
|
16665
16665
|
}
|
|
16666
16666
|
var FEATURE_TIERS = {
|
|
16667
16667
|
compliance_export: "pro",
|
|
@@ -18634,6 +18634,20 @@ function planToTier(plan) {
|
|
|
18634
18634
|
return null;
|
|
18635
18635
|
}
|
|
18636
18636
|
}
|
|
18637
|
+
function parseEntitlement(body) {
|
|
18638
|
+
const raw2 = body["entitlement"];
|
|
18639
|
+
if (!raw2 || typeof raw2 !== "object") return void 0;
|
|
18640
|
+
const e = raw2;
|
|
18641
|
+
const effectivePlan = planToTier(e["effectivePlan"]);
|
|
18642
|
+
const planOnRecord = planToTier(e["planOnRecord"]);
|
|
18643
|
+
if (effectivePlan === null && planOnRecord === null) return void 0;
|
|
18644
|
+
return {
|
|
18645
|
+
effectivePlan,
|
|
18646
|
+
planOnRecord,
|
|
18647
|
+
comped: e["comped"] === true,
|
|
18648
|
+
hasActiveSubscription: e["hasActiveSubscription"] === true
|
|
18649
|
+
};
|
|
18650
|
+
}
|
|
18637
18651
|
async function tierFromBackend(apiKey) {
|
|
18638
18652
|
const url = `${getConfiguredApiRoot()}/api/cli/auth/validate`;
|
|
18639
18653
|
const controller = new AbortController();
|
|
@@ -18668,7 +18682,7 @@ async function tierFromBackend(apiKey) {
|
|
|
18668
18682
|
detail: "the plan service did not report a recognizable plan"
|
|
18669
18683
|
};
|
|
18670
18684
|
}
|
|
18671
|
-
return { tier, source: "backend" };
|
|
18685
|
+
return { tier, source: "backend", entitlement: parseEntitlement(body) };
|
|
18672
18686
|
} catch (err) {
|
|
18673
18687
|
const aborted = err?.name === "AbortError";
|
|
18674
18688
|
return {
|
|
@@ -18743,8 +18757,21 @@ function tierLabel(tier) {
|
|
|
18743
18757
|
if (tier === "free") return "Free";
|
|
18744
18758
|
return `${tierName(tier)} (${priceLabel(tier)})`;
|
|
18745
18759
|
}
|
|
18760
|
+
function entitlementMismatchLines(ent) {
|
|
18761
|
+
const paidOnRecord = ent.planOnRecord === "pro" || ent.planOnRecord === "enterprise";
|
|
18762
|
+
if (ent.effectivePlan !== "free" || !paidOnRecord) return [];
|
|
18763
|
+
const planName = ent.planOnRecord === "enterprise" ? "Enterprise" : "Pro";
|
|
18764
|
+
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."
|
|
18767
|
+
];
|
|
18768
|
+
}
|
|
18746
18769
|
function planMismatchHint(resolution) {
|
|
18747
|
-
if (resolution.
|
|
18770
|
+
if (resolution.source !== "backend") return [];
|
|
18771
|
+
if (resolution.entitlement) {
|
|
18772
|
+
return entitlementMismatchLines(resolution.entitlement);
|
|
18773
|
+
}
|
|
18774
|
+
if (resolution.tier !== "free") return [];
|
|
18748
18775
|
return [
|
|
18749
18776
|
"Not the plan you expected? An org flagged PRO without an active",
|
|
18750
18777
|
"subscription/comp resolves to Free \u2014 see pretense.ai/dashboard/settings or contact support."
|
|
@@ -20376,7 +20403,7 @@ async function verifyApiKey(apiKey) {
|
|
|
20376
20403
|
return { outcome: "rejected", url, detail: "the API reported the key as not valid" };
|
|
20377
20404
|
}
|
|
20378
20405
|
const plan = typeof body["plan"] === "string" ? body["plan"] : void 0;
|
|
20379
|
-
return { outcome: "valid", url, plan };
|
|
20406
|
+
return { outcome: "valid", url, plan, entitlement: parseEntitlement(body) };
|
|
20380
20407
|
} catch (err) {
|
|
20381
20408
|
const aborted = err?.name === "AbortError";
|
|
20382
20409
|
return {
|
|
@@ -20495,14 +20522,15 @@ function authCommand() {
|
|
|
20495
20522
|
};
|
|
20496
20523
|
writeCredentials(creds);
|
|
20497
20524
|
if (verified) {
|
|
20498
|
-
const
|
|
20525
|
+
const mismatchLines = verification.entitlement ? entitlementMismatchLines(verification.entitlement) : String(verification.plan ?? "").trim().toLowerCase() === "free" ? [
|
|
20526
|
+
"Not the plan you expected? A PRO-flagged org without an active",
|
|
20527
|
+
"subscription/comp resolves to Free \u2014 see pretense.ai/dashboard/settings."
|
|
20528
|
+
] : [];
|
|
20499
20529
|
console.log(
|
|
20500
20530
|
chalk10.green("\n Authenticated. The key was verified by the Pretense API.") + chalk10.dim(`
|
|
20501
20531
|
Key: ${maskApiKey(opts.apiKey)}`) + chalk10.dim(`
|
|
20502
20532
|
Server: ${verification.url}`) + (verification.plan ? chalk10.dim(`
|
|
20503
|
-
Plan: ${verification.plan}`) : "") + (
|
|
20504
|
-
"\n Not the plan you expected? A PRO-flagged org without an active\n subscription/comp resolves to Free \u2014 see pretense.ai/dashboard/settings."
|
|
20505
|
-
) : "") + "\n" + storageNotice()
|
|
20533
|
+
Plan: ${verification.plan}`) : "") + (mismatchLines.length > 0 ? chalk10.dim("\n " + mismatchLines.join("\n ")) : "") + "\n" + storageNotice()
|
|
20506
20534
|
);
|
|
20507
20535
|
return;
|
|
20508
20536
|
}
|
package/dist/postinstall.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pretense/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"description": "Local-first AI firewall that mutates proprietary code before sending to LLM APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"tsx": "^4.0.0",
|
|
24
24
|
"typescript": "^5.4.0",
|
|
25
25
|
"vitest": "^1.0.0",
|
|
26
|
+
"@pretense/billing": "0.1.0",
|
|
26
27
|
"@pretense/compliance-engine": "0.1.0",
|
|
27
28
|
"@pretense/protocol": "0.1.0",
|
|
28
29
|
"@pretense/learner": "0.2.0",
|
|
@@ -30,7 +31,6 @@
|
|
|
30
31
|
"@pretense/proxy": "0.1.0",
|
|
31
32
|
"@pretense/scanner": "0.2.0",
|
|
32
33
|
"@pretense/scanner-rs": "0.2.0",
|
|
33
|
-
"@pretense/billing": "0.1.0",
|
|
34
34
|
"@pretense/store": "0.2.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|