moltengine-cli 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/moltengine.js +46 -130
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moltengine-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "CLI for Moltengine - The WP Engine for AI Agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/moltengine.js CHANGED
@@ -122,7 +122,7 @@ function checkPaymentRequired(tenant) {
122
122
  console.log();
123
123
  print("Plans", colors.bold);
124
124
  print("─".repeat(40), colors.muted);
125
- console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, Safe Mode`);
125
+ console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, all tools, approvals`);
126
126
  console.log(` ${colors.accent}Team${colors.reset} ${PLAN_PRICES.team} — 5 agents, approvals`);
127
127
  console.log(` ${colors.accent}Business${colors.reset} ${PLAN_PRICES.business} — 25 agents, SIEM, RBAC`);
128
128
  console.log(` ${colors.accent}Enterprise${colors.reset} ${PLAN_PRICES.enterprise} — SSO, VPC, compliance`);
@@ -178,7 +178,7 @@ function showAuthRequired() {
178
178
  console.log();
179
179
  print("Plans", colors.bold);
180
180
  print("─".repeat(40), colors.muted);
181
- console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, Safe Mode`);
181
+ console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, all tools, approvals`);
182
182
  console.log(` ${colors.accent}Team${colors.reset} ${PLAN_PRICES.team} — 5 agents, approvals`);
183
183
  console.log(` ${colors.accent}Business${colors.reset} ${PLAN_PRICES.business} — 25 agents, SIEM, RBAC`);
184
184
  console.log();
@@ -607,7 +607,7 @@ async function cmdCheckout(plan) {
607
607
 
608
608
  print("Plans", colors.bold);
609
609
  print("─".repeat(40), colors.muted);
610
- console.log(` ${colors.accent}starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, Safe Mode`);
610
+ console.log(` ${colors.accent}starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, all tools, approvals`);
611
611
  console.log(` ${colors.accent}team${colors.reset} ${PLAN_PRICES.team} — 5 agents, approvals`);
612
612
  console.log(` ${colors.accent}business${colors.reset} ${PLAN_PRICES.business} — 25 agents, SIEM, RBAC`);
613
613
  console.log(` ${colors.accent}enterprise${colors.reset} ${PLAN_PRICES.enterprise} — SSO, VPC, compliance`);
@@ -676,8 +676,8 @@ function showHelp() {
676
676
  console.log(` ${colors.accent}approvals${colors.reset} List and manage pending approvals`);
677
677
  console.log(` ${colors.accent}deployments${colors.reset} List recent deployments`);
678
678
  console.log(` ${colors.accent}upgrade${colors.reset} Upgrade to a higher plan`);
679
- console.log(` ${colors.accent}audit${colors.reset} Search and export audit logs (Team+)`);
680
- console.log(` ${colors.accent}policies${colors.reset} Manage security policies (Team+)`);
679
+ console.log(` ${colors.accent}audit${colors.reset} Search and export audit logs`);
680
+ console.log(` ${colors.accent}policies${colors.reset} Manage security policies`);
681
681
  console.log(` ${colors.accent}help${colors.reset} Show this help message`);
682
682
  console.log();
683
683
 
@@ -782,16 +782,14 @@ async function cmdStatus() {
782
782
  }
783
783
 
784
784
  const plan = tenant.plan || "starter";
785
- const hasApprovals = plan !== "starter";
785
+ // All plans have approvals
786
786
 
787
787
  // Print logo
788
788
  console.log(ASCII_LOGO_COMPACT);
789
789
 
790
790
  // Tenant Status section
791
791
  printHeader("Tenant Status");
792
- const planDisplay = plan === "starter"
793
- ? `Starter (${PLAN_PRICES.starter}) — ${colors.warning}Safe Mode${colors.reset}`
794
- : `${plan.charAt(0).toUpperCase() + plan.slice(1)} (${PLAN_PRICES[plan] || ""})`;
792
+ const planDisplay = `${plan.charAt(0).toUpperCase() + plan.slice(1)} (${PLAN_PRICES[plan] || ""})`;
795
793
  console.log(` ${colors.muted}Plan:${colors.reset} ${planDisplay}`);
796
794
 
797
795
  const statusIcon = tenant.status === "active" ? "●" : "○";
@@ -819,67 +817,38 @@ async function cmdStatus() {
819
817
  const runsPct = limits.runs > 0 ? (usage.runs / limits.runs) * 100 : 0;
820
818
  const eventsPct = limits.events > 0 ? (usage.events / limits.events) * 100 : 0;
821
819
 
822
- // Approvals section (for Team+ plans)
823
- if (hasApprovals) {
824
- const pendingApprovals = approvals.filter(a => a.status === "pending");
825
- const pendingCount = pendingApprovals.length;
826
-
827
- console.log();
828
- if (pendingCount > 0) {
829
- print(`Approvals ${colors.warning}⚠ ${pendingCount} pending${colors.reset}`, colors.bold);
830
- } else {
831
- print(`Approvals ${colors.success}✓ none pending${colors.reset}`, colors.bold);
832
- }
833
- print("─".repeat(40), colors.muted);
834
-
835
- if (pendingCount > 0) {
836
- // Show up to 5 pending approvals
837
- const toShow = pendingApprovals.slice(0, 5);
838
- for (let i = 0; i < toShow.length; i++) {
839
- const a = toShow[i];
840
- const actionType = (a.action_type || "ACTION").toUpperCase().padEnd(5);
841
- const target = truncate(a.action_path || a.description || "unknown", 28);
842
- const time = formatRelativeTime(a.created_at);
843
- console.log(` ${colors.muted}[${i + 1}]${colors.reset} ${actionType} ${target.padEnd(28)} ${colors.muted}${time}${colors.reset}`);
844
- }
845
-
846
- if (pendingCount > 5) {
847
- console.log(` ${colors.muted}... and ${pendingCount - 5} more${colors.reset}`);
848
- }
849
-
850
- console.log();
851
- console.log(` ${colors.info}→ moltctl approvals approve <id>${colors.reset}`);
852
- console.log(` ${colors.info}→ moltctl approvals list --all${colors.reset}`);
853
- } else {
854
- console.log(` ${colors.muted}No actions waiting for approval${colors.reset}`);
855
- }
820
+ // Approvals section (available on all plans)
821
+ const pendingApprovals = approvals.filter(a => a.status === "pending");
822
+ const pendingCount = pendingApprovals.length;
823
+
824
+ console.log();
825
+ if (pendingCount > 0) {
826
+ print(`Approvals ${colors.warning}⚠ ${pendingCount} pending${colors.reset}`, colors.bold);
856
827
  } else {
857
- // Starter plan - show blocked actions
858
- const blockedCount = blockedActions.length || 0;
859
- const todayBlocked = usage.blocked_today || blockedCount || 0;
860
-
861
- console.log();
862
- if (todayBlocked > 0) {
863
- print(`Blocked Today ${colors.error}⛔ ${todayBlocked} actions${colors.reset}`, colors.bold);
864
- } else {
865
- print(`Blocked Today ${colors.success}✓ none${colors.reset}`, colors.bold);
828
+ print(`Approvals ${colors.success}✓ none pending${colors.reset}`, colors.bold);
829
+ }
830
+ print("─".repeat(40), colors.muted);
831
+
832
+ if (pendingCount > 0) {
833
+ // Show up to 5 pending approvals
834
+ const toShow = pendingApprovals.slice(0, 5);
835
+ for (let i = 0; i < toShow.length; i++) {
836
+ const a = toShow[i];
837
+ const actionType = (a.action_type || "ACTION").toUpperCase().padEnd(5);
838
+ const target = truncate(a.action_path || a.description || "unknown", 28);
839
+ const time = formatRelativeTime(a.created_at);
840
+ console.log(` ${colors.muted}[${i + 1}]${colors.reset} ${actionType} ${target.padEnd(28)} ${colors.muted}${time}${colors.reset}`);
866
841
  }
867
- print("─".repeat(40), colors.muted);
868
842
 
869
- if (todayBlocked > 0 && blockedActions.length > 0) {
870
- // Show recent blocked actions
871
- const toShow = blockedActions.slice(0, 3);
872
- for (const b of toShow) {
873
- const actionType = (b.action_type || "ACTION").toUpperCase().padEnd(5);
874
- const target = truncate(b.action_path || b.description || "unknown", 28);
875
- const time = formatRelativeTime(b.created_at);
876
- console.log(` ${actionType} ${target.padEnd(28)} ${colors.muted}${time}${colors.reset}`);
877
- }
878
- console.log();
843
+ if (pendingCount > 5) {
844
+ console.log(` ${colors.muted}... and ${pendingCount - 5} more${colors.reset}`);
879
845
  }
880
846
 
881
- console.log(` ${colors.muted}Risky actions are blocked in Safe Mode.${colors.reset}`);
882
- console.log(` ${colors.info}→ Upgrade to enable approvals: ${colors.accent}moltctl upgrade team${colors.reset}`);
847
+ console.log();
848
+ console.log(` ${colors.info}→ moltctl approvals approve <id>${colors.reset}`);
849
+ console.log(` ${colors.info}→ moltctl approvals list --all${colors.reset}`);
850
+ } else {
851
+ console.log(` ${colors.muted}No high-risk actions waiting for approval${colors.reset}`);
883
852
  }
884
853
 
885
854
  // Show warning if approaching limits
@@ -1010,7 +979,7 @@ async function cmdUpgrade(targetPlan) {
1010
979
  console.log();
1011
980
  print("Choose a Plan", colors.bold);
1012
981
  print("─".repeat(40), colors.muted);
1013
- console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, Safe Mode`);
982
+ console.log(` ${colors.accent}Starter${colors.reset} ${PLAN_PRICES.starter} — 1 agent, all tools, approvals`);
1014
983
  console.log(` ${colors.accent}Team${colors.reset} ${PLAN_PRICES.team} — 5 agents, approvals`);
1015
984
  console.log(` ${colors.accent}Business${colors.reset} ${PLAN_PRICES.business} — 25 agents, SIEM, RBAC`);
1016
985
  console.log(` ${colors.accent}Enterprise${colors.reset} ${PLAN_PRICES.enterprise} — SSO, VPC, compliance`);
@@ -1029,7 +998,7 @@ async function cmdUpgrade(targetPlan) {
1029
998
  console.log(ASCII_LOGO_COMPACT);
1030
999
 
1031
1000
  const plans = [
1032
- { id: "starter", price: "$49/mo", agents: 1, runs: "100/day", highlight: "Safe Mode" },
1001
+ { id: "starter", price: "$49/mo", agents: 1, runs: "100/day", highlight: "All Tools" },
1033
1002
  { id: "team", price: "$299/mo", agents: 5, runs: "1,000/day", highlight: "Human-in-the-loop approvals" },
1034
1003
  { id: "business", price: "$999/mo", agents: 25, runs: "10,000/day", highlight: "SIEM export, RBAC" },
1035
1004
  { id: "enterprise", price: "Custom", agents: 100, runs: "100,000/day", highlight: "SSO, VPC, compliance" }
@@ -1100,6 +1069,7 @@ async function cmdUpgrade(targetPlan) {
1100
1069
 
1101
1070
  /**
1102
1071
  * Approvals command - list, approve, or deny pending approvals
1072
+ * Available on all plans (required for high-risk actions)
1103
1073
  */
1104
1074
  async function cmdApprovals(subcommand, id) {
1105
1075
  const tenant = await apiGet("/tenant/me");
@@ -1109,27 +1079,7 @@ async function cmdApprovals(subcommand, id) {
1109
1079
  return;
1110
1080
  }
1111
1081
 
1112
- const plan = tenant.plan || "starter";
1113
-
1114
- // Check if plan supports approvals
1115
- if (plan === "starter") {
1116
- console.log(ASCII_LOGO_COMPACT);
1117
- console.log();
1118
- print(`${colors.error}⛔ Approvals require Team plan or higher${colors.reset}`, colors.bold);
1119
- console.log();
1120
- console.log(` Your current plan (Starter) runs in Safe Mode where`);
1121
- console.log(` risky actions are automatically blocked.`);
1122
- console.log();
1123
- console.log(` ${colors.info}Team plan includes:${colors.reset}`);
1124
- console.log(` • Human-in-the-loop approvals`);
1125
- console.log(` • Audit log search & export`);
1126
- console.log(` • Policy editor`);
1127
- console.log(` • Email alerts`);
1128
- console.log();
1129
- console.log(` ${colors.info}→ Upgrade: ${colors.accent}moltctl upgrade team${colors.reset}`);
1130
- console.log();
1131
- return;
1132
- }
1082
+ // Approvals available on all plans
1133
1083
 
1134
1084
  // Handle subcommands
1135
1085
  switch (subcommand) {
@@ -1222,7 +1172,8 @@ async function denyAction(id) {
1222
1172
  }
1223
1173
 
1224
1174
  /**
1225
- * Audit command - search and export audit logs (Team+ only)
1175
+ * Audit command - search and export audit logs
1176
+ * Available on all plans
1226
1177
  */
1227
1178
  async function cmdAudit(subcommand, ...args) {
1228
1179
  const tenant = await apiGet("/tenant/me");
@@ -1232,25 +1183,7 @@ async function cmdAudit(subcommand, ...args) {
1232
1183
  return;
1233
1184
  }
1234
1185
 
1235
- const plan = tenant.plan || "starter";
1236
-
1237
- if (plan === "starter") {
1238
- console.log(ASCII_LOGO_COMPACT);
1239
- console.log();
1240
- print(`${colors.error}⛔ Audit search requires Team plan or higher${colors.reset}`, colors.bold);
1241
- console.log();
1242
- console.log(` Your current plan (Starter) stores audit logs but`);
1243
- console.log(` search and export require an upgrade.`);
1244
- console.log();
1245
- console.log(` ${colors.info}Team plan includes:${colors.reset}`);
1246
- console.log(` • Audit log search`);
1247
- console.log(` • CSV/JSON export`);
1248
- console.log(` • 90-day retention (vs 7 days)`);
1249
- console.log();
1250
- console.log(` ${colors.info}→ Upgrade: ${colors.accent}moltctl upgrade team${colors.reset}`);
1251
- console.log();
1252
- return;
1253
- }
1186
+ // Audit available on all plans
1254
1187
 
1255
1188
  // Handle subcommands
1256
1189
  switch (subcommand) {
@@ -1388,7 +1321,8 @@ async function auditStats() {
1388
1321
  }
1389
1322
 
1390
1323
  /**
1391
- * Policies command - manage security policies (Team+ only)
1324
+ * Policies command - manage security policies
1325
+ * Available on all plans
1392
1326
  */
1393
1327
  async function cmdPolicies(subcommand, ...args) {
1394
1328
  const tenant = await apiGet("/tenant/me");
@@ -1398,25 +1332,7 @@ async function cmdPolicies(subcommand, ...args) {
1398
1332
  return;
1399
1333
  }
1400
1334
 
1401
- const plan = tenant.plan || "starter";
1402
-
1403
- if (plan === "starter") {
1404
- console.log(ASCII_LOGO_COMPACT);
1405
- console.log();
1406
- print(`${colors.error}⛔ Policy editor requires Team plan or higher${colors.reset}`, colors.bold);
1407
- console.log();
1408
- console.log(` Your current plan (Starter) uses default security`);
1409
- console.log(` policies. Custom policies require an upgrade.`);
1410
- console.log();
1411
- console.log(` ${colors.info}Team plan includes:${colors.reset}`);
1412
- console.log(` • Tool allowlist/blocklist`);
1413
- console.log(` • Network domain policies`);
1414
- console.log(` • Filesystem access rules`);
1415
- console.log();
1416
- console.log(` ${colors.info}→ Upgrade: ${colors.accent}moltctl upgrade team${colors.reset}`);
1417
- console.log();
1418
- return;
1419
- }
1335
+ // Policy editor available on all plans
1420
1336
 
1421
1337
  // Handle subcommands
1422
1338
  switch (subcommand) {
@@ -1463,9 +1379,9 @@ async function policiesList() {
1463
1379
  console.log(` ${colors.muted}Using secure defaults${colors.reset}`);
1464
1380
  console.log();
1465
1381
  console.log(` ${colors.info}Default policy:${colors.reset}`);
1466
- console.log(` • Dangerous tools blocked (shell, browser)`);
1382
+ console.log(` • All tools available (high-risk actions require approval)`);
1467
1383
  console.log(` • Network requests allowed (except blocked domains)`);
1468
- console.log(` • Filesystem writes restricted to /data/*, /exports/*`);
1384
+ console.log(` • Sandboxing enabled by default (user-configurable)`);
1469
1385
  console.log();
1470
1386
  return;
1471
1387
  }